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 pandas as pd | |
from datetime import datetime, timedelta | |
dt = timedelta(seconds=1) | |
base_time = datetime(2014, 9, 24, 10, 5, 30) | |
indx1 = [base_time + j * dt for j in range(0, 10)] | |
indx2 = [base_time + j * dt for j in range(0, 10, 2)] | |
ds1 = pd.Series(5, index=indx1) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from jsonschema import validate | |
schema = { | |
"definitions": { | |
"data_key": { | |
"properties": { | |
"external": { | |
"type": "string", | |
"pattern": "^[A-Z]+:?" | |
}, |
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
import sys | |
sys.setrecursionlimit(10000) | |
class Meta(type): | |
def __new__(*args, **kwargs): | |
print('I will not use metaclasses just for the fun of using them', end=' ') | |
magic_count = kwargs.pop('__magic_count', 0) | |
if magic_count > 1000: | |
return type.__new__(*args, **kwargs) | |
Meta.__new__(__magic_count=magic_count+1, *args, **kwargs) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
class Document(dict): | |
def __init__(self, name, *args, **kwargs): | |
self._name = name | |
super(Document, self).__init__(*args, **kwargs) | |
def __getattr__(self, key): | |
return self[key] | |
def __setattr__(self, key, value): |