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
| CUDA_REPO_PKG=cuda-repo-ubuntu1804_10.2.89-1_amd64.deb | |
| CUDA_URL=http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 | |
| wget -O /tmp/${CUDA_REPO_PKG} ${CUDA_URL}/${CUDA_REPO_PKG} | |
| sudo dpkg -i /tmp/${CUDA_REPO_PKG} | |
| sudo apt-key adv --fetch-keys ${CUDA_URL}/7fa2af80.pub | |
| rm -f /tmp/${CUDA_REPO_PKG} |
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 time | |
| from functools import wraps | |
| from typing import List | |
| from typing import Union | |
| import numpy as np | |
| import psutil | |
| from sklearn import preprocessing | |
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
Show hidden characters
| { | |
| // https://www.schemecolor.com/dysfunctional.php | |
| "workbench.colorCustomizations": { | |
| // activity bar | |
| "activityBar.background": "#CE3C63", | |
| "activityBar.inactiveForeground": "#c5c4c4", | |
| "activityBar.activeBackground": "#FBE9B7", | |
| "activityBar.activeBorder": "#04B9B0", | |
| // badge | |
| "activityBarBadge.background": "#04B9B0", |
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 https://gist.github.com/rbf/195acdfe8f51b65e5ecd | |
| # Forked from https://gist.github.com/jasonlong/5395357 | |
| # // Copy this to your keybindings (Preferences > Key Bindings - User) | |
| # // Change the keybinding, color schemes, and themes to your preferences | |
| # | |
| # { | |
| # "keys": ["ctrl+shift+s"], "command": "toggle_color_scheme", | |
| # "args": { | |
| # "light_color_scheme": "Packages/User/Soda Light - Espresso.tmTheme", |
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
| class A: | |
| """This is an example of wrong functions default parameters: | |
| This should actually be: | |
| def __init__(self, l=None): | |
| if l is None: | |
| self.l = [] | |
| """ | |
| def __init__(self, l=[]): | |
| self.l = l |
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
| # Join multiple lines without new line | |
| value: > | |
| part 1 | |
| part 2 | |
| # Join with newline | |
| value2: | | |
| line 1 | |
| line 2 |
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 sys | |
| import os | |
| from loguru import logger | |
| from tqdm.auto import tqdm | |
| from functools import partialmethod | |
| class TqdmStream(object): | |
| @classmethod |
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
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Python: Current File", | |
| "type": "python", | |
| "request": "launch", |
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 | |
| # Get postman app | |
| wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz | |
| sudo tar -xzf postman.tar.gz -C /opt | |
| sudo ln -s /opt/Postman/Postman /usr/bin/postman | |
| #Create a Desktop Entry | |
| cat > ~/.local/share/applications/postman.desktop <<EOL | |
| [Desktop Entry] | |
| Encoding=UTF-8 |
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 pycountry | |
| from pprint import pformat | |
| from data.model_languages import bert_languages, xlm_lang_codes | |
| def get_codes(language): | |
| lang = pycountry.languages.get(name=language) | |
| alpha_2 = alpha_3 = None | |
| try: |