From inside a new folder run:
pipenv --three
pipenv install --dev --pre pylint black pytest
touch README.md
mkdir tests
class User: | |
""" | |
User class | |
It has some methods and properties to simulate the functions | |
of a regular class. | |
""" | |
def __init__(self, first_name, last_name, email, password): | |
self.first_name = first_name | |
self.last_name = last_name |
""" | |
Data are bits | |
Numbers can be written as bits | |
Therefore, any data can be written as a number | |
Here is a small playground | |
""" | |
def text_to_int(filename): |
""" | |
primes provide a very simple iterator that's able | |
to generate all the prime numbers! | |
This is for teaching purposes only. | |
""" | |
class Primes: | |
""" |
326.75 | 39.9 | 39.92 | 3.69 | |
---|---|---|---|---|
333.05 | 49.75 | 49.76 | 3.91 | |
338.45 | 59.85 | 59.72 | 4.09 | |
340.95 | 64.9 | 64.86 | 4.17 | |
343.25 | 69.81 | 69.9 | 4.25 | |
345.35 | 74.84 | 74.78 | 4.31 | |
347.45 | 79.85 | 79.93 | 4.38 |
class CacheState(Enum): | |
""" | |
Enum to diferentiate caches hits and misses for boolean values. | |
It was created to store OAuth2 token validity in cache. In that | |
scenario, a cache miss prompts an API call to check the token, | |
while a cache hit with a False value does not. | |
VALID and INVALID are bool compatible. | |
>>> bool(CacheState.INVALID) |
aws ecs describe-task-definition \
--task-definition <task_arn> \
--query "taskDefinition.containerDefinitions[0].environment[]" |
jq -r '.[] | "-e \(.name)=\"\(.value)\" \\"'
import boto3 | |
class Cluster: | |
""" | |
Class to handle an ECS Cluster | |
""" | |
def __init__(self, name, boto3_session): | |
assert type(boto3_session) == boto3.session.Session, "Please, provide an boto3 Session as argument!" | |
self.name = name | |
self.boto3_session = boto3_session |
from xml.dom import minidom # Ou qualquer parser XML que você preferir | |
from Bio import Entrez | |
def search_sra(query, email='[email protected]'): | |
""" | |
Retorna um handler de busca para o SRA | |
""" | |
Entrez.email = email | |
handle = Entrez.esearch(db='sra', | |
sort='relevance', |
0x26fc5049bC81986BB3703af70BBe1ef4babb07E1 |