This file contains hidden or 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 asyncio | |
| async def wait(): | |
| print('Waiting') | |
| for x in range(10 ** 100): | |
| z = 10 + 20 | |
| print('Done') | |
This file contains hidden or 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 | |
| set -eu | |
| # Install PyEnv | |
| if [ ! -e ~/.pyenv ]; then | |
| git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
| echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile | |
| echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile | |
| echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile |
This file contains hidden or 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
| from typing import Type, TypeVar, Union | |
| import numpy as np | |
| Number = TypeVar("TypeVar", int, float) | |
| class Rectangle(np.ndarray): | |
| def __new__( | |
| cls, |
This file contains hidden or 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 hashlib | |
| def compute_file_checksum( | |
| filepath: str, | |
| algorithm: str = "md5", | |
| chunk_size: int = 1024, | |
| ) -> str: | |
| hasher = hashlib.new(algorithm) | |
| with open(filepath, "rb") as fp: |
OlderNewer