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 _validate_fieldsets(self): | |
valid = False | |
fields_defined = sum((fset[1]['fields'] for fset in self.fieldsets), | |
()) | |
fields_set = set(fields_defined) | |
# Fieldsets are valid if: | |
# * Each field is defined in a Fieldset | |
# * Each field is defined only once. | |
if len(fields_defined) == len(fields_set) and \ | |
set(self.fields.keys()) == fields_set: |
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 rpyc | |
import time | |
import pushy | |
import unittest | |
import logging | |
BIG = SMALL = connection = bgsrv = None | |
TARGET_HOSTNAME = "localhost" |
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 _winreg | |
def subkeys(key): | |
i = 0 | |
while True: | |
try: | |
subkey = _winreg.EnumKey(key, i) | |
yield subkey | |
i+=1 | |
except WindowsError as e: |
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 time | |
import functools | |
import timeit | |
import logging | |
directions = [ | |
(0, -1), # north | |
(0, 1), # south | |
(1, 0), # east |
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
LATEST_MASTER_JOB_ID=`aws s3 ls downloads.scylladb.com/relocatable/unstable/master/ | grep '2020-' | tr -s ' ' | cut -d ' ' -f 3 | tr -d '\/' | sort -g | tail -n 1` | |
BASE_VERSION=http://downloads.scylladb.com.s3.amazonaws.com/relocatable/unstable/master/${LATEST_MASTER_JOB_ID} | |
AWS_BASE=s3://downloads.scylladb.com/relocatable/unstable/master/${LATEST_MASTER_JOB_ID} | |
aws s3 cp ${AWS_BASE}/scylla-package.tar.gz . | |
aws s3 cp ${AWS_BASE}/scylla-tools-package.tar.gz . | |
aws s3 cp ${AWS_BASE}/scylla-jmx-package.tar.gz . | |
ccm create scylla-reloc-1-local-temp -n 1 --scylla --version unstable/master:$LATEST_MASTER_JOB_ID \ | |
--scylla-core-package-uri=./scylla-package.tar.gz \ |
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 jenkins | |
import sys | |
server = jenkins.Jenkins('https://jenkins.scylladb.com', username='[your user]', password='[your token]') | |
user = server.get_whoami() | |
version = server.get_version() | |
print('Hello %s from Jenkins %s' % (user['fullName'], version)) | |
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 subprocess import run | |
import boto3 | |
from cassandra import ConsistencyLevel | |
from cassandra.query import SimpleStatement | |
from dtest import Tester, debug | |
from scylla_tools import insert_c1c2 |
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 numpy as np | |
import pandas as pd | |
import csv | |
input = "" | |
for l in open('/home/fruch/Downloads/data_short.csv').readlines(): | |
input += l.replace('"', '') + '\n' | |
with open('/home/fruch/Downloads/data_short_clean.csv', 'w') as f: | |
f.write(input) |
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 requests | |
import pandas as pd | |
res = requests.get("https://data.gov.il/api/action/datastore_search?resource_id=9eedd26c-019b-433a-b28b-efcc98de378d") | |
data = res.json() | |
df = pd.DataFrame(data['result']['records']) | |
df['date'] = pd.to_datetime(df['date'], infer_datetime_format=True) | |
df.plot(figsize=(10,5), x ='date', y='isolated_today_contact_with_confirmed', kind='line') |
OlderNewer