project
│ README.md
│ file001.txt
│
└───folder1
│ │ file011.txt
│ │ file012.txt
│ │
│ └───subfolder1
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
0 = Success | |
1 = Operation not permitted | |
2 = No such file or directory | |
3 = No such process | |
4 = Interrupted system call | |
5 = Input/output error | |
6 = No such device or address | |
7 = Argument list too long | |
8 = Exec format error | |
9 = Bad file descriptor |
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
function bycache() { | |
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf | |
} |
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
print('__file__={0:<35} | __name__={1:<20} | __package__={2:<20}'.format( | |
__file__, __name__, str(__package__))) |
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
@blueprint.record_once | |
def record_params(state): | |
"""Store app.config in blueprint when blueprint is registered on app.""" | |
app = state.app | |
blueprint.config = {key: value for key, value in app.config.iteritems()} |
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 json | |
import uuid | |
from IPython.display import display_javascript, display_html, display | |
class RenderJSON(object): | |
def __init__(self, json_data): | |
if isinstance(json_data, dict) or isinstance(json_data, list): | |
self.json_str = json.dumps(json_data) | |
else: | |
self.json_str = json_data |
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
def print_exceptions_tree(exception_class, level=0): | |
if level > 1: | |
print(" |" * (level - 1), end="") | |
if level > 0: | |
print(" +---", end="") | |
print(exception_class.__name__) | |
for subclass in exception_class.__subclasses__(): | |
print_exceptions_tree(subclass, level + 1) |
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 uuid | |
import csv | |
def my_random_string(string_length=10): | |
"""Returns a random string of length string_length.""" | |
random = str(uuid.uuid4()) # Convert UUID format to a Python string. | |
random = random.upper() # Make all characters uppercase. | |
random = random.replace("-", "") # Remove the UUID '-'. | |
return random[0:string_length] # Return the random string. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.