- у нас есть пользователи от которых мы получаем некоторые данные
- мы получаем данные каждый день, таким образом каждая точка данных соответствует некоторой дате
- в рамках этой задачи будем считать что все данные имеют тип float
- в результате сбора данных мы имеем массивы вида [{"date": ..., "value": ...}, {"date": ..., "value": ...}, ...]
- видов (например шаги, средняя частота пульса и тп) данных может быть много, в рамках этой задачи будем считать, что они однозначно различаются по строковому названию (см. примеры запросов к АПИ ниже)
- как данные попадают к нам и как они технически храняться - за рамками данной задачи
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# /home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/pip install -U keytar jupyter-server-proxy | |
echo == INSTALLING CODE-SERVER == | |
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=4.13.0 | |
######################################### | |
### INTEGRATE CODE-SERVER WITH JUPYTER | |
######################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from functools import lru_cache | |
def lru_with_ttl(*, ttl_seconds, maxsize=128): | |
""" | |
A decorator to apply LRU in-memory cache to a function with defined maximum(!) TTL in seconds. | |
Be design an actual TTL may be shorter then the passed value (in rare randomized cases). But it can't be higher. | |
:param ttl_seconds: TTL for a cache record in seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
from IPython.core.display import display, HTML | |
display(HTML("<style>.container { width:100% !important; }</style>")) | |
HTML(""" | |
<script> | |
code_show=true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = [ | |
['User', 'Content Type', 'File', 'Mb'], | |
['User 1', 'Text', 'F1', 0.1], | |
['User 1', 'Text', 'F2', 0.5], | |
['User 1', 'Video', 'V1', 100], | |
['User 2', 'Text', 'F1', 2], | |
['User 2', 'Video', 'V1', 75], | |
['User 3', 'Video', 'V2', 60], | |
] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipenv shell | |
pipenv install ipykernel | |
python -m ipykernel install --user --name=VENV_NAME | |
jupyter lab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!# /bin/sh | |
sudo mkdir /shared | |
sudo chmod a+rwxs /shared | |
sudo setfacl -d -m o:rwx /shared |
NewerOlder