repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
libero/eLife-style-content-adapter | dags/libero/context_facades.py | <gh_stars>0
import logging
logger = logging.getLogger(__name__)
def get_previous_task_name(context: dict):
if context['task'].upstream_list:
return context['task'].upstream_list[0].task_id
return None
def get_return_value_from_previous_task(context: dict, task_id: str = None):
previous_task = t... |
libero/eLife-style-content-adapter | dags/trigger_dag.py | """
DAG identify zip files to process from s3 bucket and trigger dag for each zip file
"""
import json
import logging
import re
from datetime import timedelta
from uuid import uuid4
from airflow import DAG, configuration
from airflow.api.common.experimental.trigger_dag import trigger_dag
from airflow.models import Dag... |
libero/eLife-style-content-adapter | tests/python/mocks.py | from io import BytesIO
from pathlib import Path
from zipfile import ZipFile
from tests.assets import get_asset, find_asset
class s3ClientMock:
def __init__(self, *args, **kwargs):
self.downloaded_files = []
self.uploaded_files = []
self.last_uploaded_file_bytes = None
def __call__(s... |
libero/eLife-style-content-adapter | dags/libero/operators.py | <reponame>libero/eLife-style-content-adapter<gh_stars>0
import os
from airflow import configuration, DAG
from airflow.operators.bash_operator import BashOperator
ARTICLE_ASSETS_URL = configuration.conf.get('libero', 'article_assets_url')
COMPLETED_TASKS_BUCKET = configuration.conf.get('libero', 'completed_tasks_bucke... |
libero/eLife-style-content-adapter | dags/libero/aws.py | from airflow import configuration
from airflow.hooks.S3_hook import S3Hook
REMOTE_LOGS_CONNECTION_ID = configuration.conf.get('core', 'remote_log_conn_id') or None
def get_s3_client():
return S3Hook(aws_conn_id=REMOTE_LOGS_CONNECTION_ID).get_conn()
def list_bucket_keys_iter(**list_objects_v2_params):
"""
... |
libero/eLife-style-content-adapter | tests/python/test_aws.py | <reponame>libero/eLife-style-content-adapter<filename>tests/python/test_aws.py
import pytest
from dags.libero.aws import get_s3_client, list_bucket_keys_iter
from dags.trigger_dag import SOURCE_BUCKET, DESTINATION_BUCKET
def test_get_s3_client():
conn = get_s3_client()
assert conn._endpoint._endpoint_prefix ... |
libero/eLife-style-content-adapter | tests/python/test_assets.py | <gh_stars>0
import pytest
from tests.assets import get_asset
@pytest.mark.parametrize('asset_name', ['elife-00666.xml', 'elife-00666-vor-r1.zip'])
def test_get_assets(asset_name):
assert get_asset(asset_name)
def test_get_assets_raises_exception():
with pytest.raises(FileNotFoundError):
get_asset('... |
CAOR-MINES-ParisTech/colibri-vr-unity-package | Runtime/ExternalConnectors/Blender_CheckOBJMeshInfo.py | ### Copyright 2019-2020 MINES ParisTech (PSL University)
### This work is licensed under the terms of the MIT license, see the LICENSE file.
###
### Author: <NAME>, <EMAIL>
import sys, os
sys.path.append(sys.argv[sys.argv.index("--") + 1:][0])
import bpy
from Blender_Core import print_out, print_err, delete_all_on_st... |
CAOR-MINES-ParisTech/colibri-vr-unity-package | Runtime/ExternalConnectors/Blender_Core.py | ### Copyright 2019-2020 MINES ParisTech (PSL University)
### This work is licensed under the terms of the MIT license, see the LICENSE file.
###
### Author: <NAME>, <EMAIL>
import sys
import bpy
def print_out(lineToWrite) :
sys.stdout.write(lineToWrite + "\n")
sys.stdout.flush()
def print_err(errorLine) :
... |
CAOR-MINES-ParisTech/colibri-vr-unity-package | Runtime/ExternalConnectors/Blender_ConvertPLYtoOBJ.py | ### Copyright 2019-2020 MINES ParisTech (PSL University)
### This work is licensed under the terms of the MIT license, see the LICENSE file.
###
### Author: <NAME>, <EMAIL>
import sys, os
sys.path.append(sys.argv[sys.argv.index("--") + 1:][0])
import bpy
from math import radians
from Blender_Core import print_out, pr... |
CAOR-MINES-ParisTech/colibri-vr-unity-package | Runtime/ExternalConnectors/Blender_SimplifyOBJ.py | ### Copyright 2019-2020 MINES ParisTech (PSL University)
### This work is licensed under the terms of the MIT license, see the LICENSE file.
###
### Author: <NAME>, <EMAIL>
import sys, os
sys.path.append(sys.argv[sys.argv.index("--") + 1:][0])
import bpy
from Blender_Core import print_out, print_err, delete_all_on_st... |
CAOR-MINES-ParisTech/colibri-vr-unity-package | Runtime/ExternalConnectors/Blender_SmartUVProjectOBJ.py | <reponame>CAOR-MINES-ParisTech/colibri-vr-unity-package
### Copyright 2019-2020 MINES ParisTech (PSL University)
### This work is licensed under the terms of the MIT license, see the LICENSE file.
###
### Author: <NAME>, <EMAIL>
import sys, os
sys.path.append(sys.argv[sys.argv.index("--") + 1:][0])
import bpy
from Bl... |
akariv/kvfile | kvfile/cached.py | <reponame>akariv/kvfile
from itertools import chain
import cachetools
from .kvfile import KVFile
class CachedKVFile(cachetools.LRUCache):
def __init__(self, size=1024):
super().__init__(size)
self.db = KVFile()
def get(self, key):
return self[key]
def set(self, key, value):
... |
akariv/kvfile | tests/test_main.py | import datetime
import decimal
import pytest
def test_sanity():
from kvfile import KVFile
kv = KVFile()
data = dict(
s='value',
i=123,
d=datetime.datetime.fromtimestamp(12325),
n=decimal.Decimal('1234.56'),
ss=set(range(10)),
o=dict(d=decimal.Decimal('12... |
akariv/kvfile | kvfile/__init__.py | from .kvfile import KVFile, db_kind
from .cached import CachedKVFile
|
akariv/kvfile | kvfile/kvfile.py | <reponame>akariv/kvfile<gh_stars>1-10
import os
import tempfile
import warnings
from collections import deque
try:
import plyvel as DB_ENGINE
db_kind = 'LevelDB'
except ImportError:
import sqlite3 as DB_ENGINE
db_kind = 'sqlite'
from .serializer import JsonSerializer
class SqliteDB(object):
def... |
andycranston/mbtester | mbtester.py | #
# @(!--#) @(#) mbtester.py, version 011, 08-february-2019
#
# drive the "Generic Modbus/Jbus Tester" windows program
# from Schneider Electric
#
# tester.exe available from:
#
# https://www.schneider-electric.com/en/faqs/FA180037/
#
# version 4.7 (c) 1998-2008
#
# Links:
#
# https://pyautogui.readthedocs.io/en/... |
i3detroit/dixie-narco | code/helper/display.py | #!/usr/bin/env python3
from luma.core.interface.serial import spi
from luma.core.render import canvas
from luma.oled.device import ssd1322
from PIL import Image,ImageFont
import signal
class Display:
def __init__(self):
self._serial = spi(device=0, port=0, bus_speed_hz=32000000)
self._device = ss... |
i3detroit/dixie-narco | code/vend.py | <reponame>i3detroit/dixie-narco<filename>code/vend.py
#!/usr/bin/env python3
from helper.row_driver import Row
from helper.keypad import Keypad
from helper.display import Display
class Dixie_Narco:
def __init__(self):
self.rows = {
'A':Row(0x25,'A'),
'B':Row(0x24,'B'),
'... |
i3detroit/dixie-narco | code/helper/keypad.py | #!/usr/bin/env python3
from time import sleep
import pigpio
class Keypad:
_cols = [21, 20, 26]
_rows = [5, 6, 12, 13, 19, 16]
_keys = [
['F','*','CLR'],
['E','9','0'],
['D','7','8'],
['C','5','6'],
['B','3','4'],
['A','1','2']
... |
i3detroit/dixie-narco | code/helper/row_driver.py | <gh_stars>0
#!/usr/bin/env python3
import board
import busio
import adafruit_mcp230xx
import digitalio
from time import sleep
class I2C:
_shared_state = {}
def __init__(self):
self.__dict__ = self._shared_state
self.i2c = busio.I2C(board.SCL,board.SDA)
def __hash__(self): return 1
def _... |
flavours/fam-flavour | bin/check.py | <filename>bin/check.py
#!/usr/bin/env python3
import subprocess
import sys
import click
import libflavour
def log(string):
click.echo(f"fam-flavour: {string}")
def check_structure(yaml):
libflavour.Addon(yaml)
def check_policies(yaml):
process = subprocess.Popen(
["conftest", "test", "-p=... |
flavours/fam-flavour | bin/add.py | #!/usr/bin/env python3
import hashlib
import os
from collections import OrderedDict
from pathlib import Path
import click
import libflavour
from strictyaml import as_document
def log(string):
click.echo(f"fam-flavour: {string}")
def save_yaml(yaml_as_string):
base_folder = Path(".flavour") / "addons"
... |
flavours/fam-flavour | bin/remove.py | <filename>bin/remove.py
#!/usr/bin/env python3
from pathlib import Path
import click
import libflavour
from strictyaml import load
def log(string):
click.echo(f"fam-flavour: {string}")
def remove_requirement(flavour_package_name, version):
with Path("app.flavour").open("r") as f:
yml = f.read()
... |
oaksharks/HyperTS | hyperts/search_space.py | # -*- coding:utf-8 -*-
from hypernets.core.ops import HyperInput
from hypernets.core.search_space import HyperSpace, Choice
from hyperts.estimators import TSEstimatorMS, ProphetWrapper, VARWrapper, SKTimeWrapper
def search_space_univariate_forecast():
space = HyperSpace()
with space.as_default():
... |
oaksharks/HyperTS | hyperts/experiment.py | <reponame>oaksharks/HyperTS
import copy
import numpy as np
import pandas as pd
from hypernets.core import set_random_state
from hypernets.experiment import StepNames
from hypernets.experiment.compete import SteppedExperiment, ExperimentStep, EnsembleStep, FinalTrainStep
from hypernets.tabular import get_tool_... |
oaksharks/HyperTS | hyperts/estimators.py | import numpy as np
from prophet import Prophet
from sktime.classification.interval_based import TimeSeriesForestClassifier
from statsmodels.tsa.vector_ar.var_model import VAR
from hypernets.core.search_space import ModuleSpace
from hypernets.utils import logging
logger = logging.get_logger(__name__)
class Estimator... |
oaksharks/HyperTS | hyperts/tests/task_test.py | <reponame>oaksharks/HyperTS<filename>hyperts/tests/task_test.py<gh_stars>0
# -*- coding:utf-8 -*-
from sklearn.model_selection import train_test_split
from sktime.datasets import load_arrow_head
from hypernets.core.callbacks import *
from hypernets.core.searcher import OptimizeDirection
from hypernets.searchers.rando... |
oaksharks/HyperTS | hyperts/hyper_ts.py | <gh_stars>0
# -*- coding:utf-8 -*-
"""
"""
import pickle
import numpy as np
from sklearn import metrics as sk_metrics
from hypernets.dispatchers.in_process_dispatcher import InProcessDispatcher
from hypernets.model.estimator import Estimator
from hypernets.model.hyper_model import HyperModel
from hyperne... |
oaksharks/HyperTS | hyperts/utils/data_ops.py | import numpy as np
import pandas as pd
import datetime
import chinese_calendar
from sklearn.preprocessing import OrdinalEncoder
class offsets_pool:
neighbor = [-1, 1]
second = [-1, 1, -60 * 4, -60 * 3, -60 * 2, -60 * 1, 60 * 1, 60 * 2, 60 * 3, 60 * 4]
minute = [-1, 1, -60 * 4, -60 * 3, -60 * 2, -60 * 1, ... |
oaksharks/HyperTS | hyperts/mk_experiment.py | # -*- coding:utf-8 -*-
__author__ = 'yangjian'
"""
"""
def make_experiment(train_data,
target=None,
eval_data=None,
test_data=None,
task=None,
id=None,
callbacks=None,
... |
bernardotorres/eventsourcing | eventsourcing/tests/test_postgres.py | <gh_stars>0
import os
from time import sleep
from unittest import TestCase
from unittest.mock import Mock
from uuid import uuid4
import psycopg2
from psycopg2.extensions import connection
from eventsourcing.persistence import (
DatabaseError,
DataError,
InfrastructureFactory,
IntegrityError,
Inter... |
wdomitrz/input_device_handler | input_device_handler.py | <filename>input_device_handler.py
#!/usr/bin/env python3
import json
from os import path
from evdev import InputDevice, InputEvent, categorize, ecodes
from subprocess import Popen
CONFIG_FILE = path.expanduser('~/.config/input_device_handler/config.json')
class DeviceHandler:
def __init__(self, device_options: ... |
ppanero/invenio-rdm-extension-demo | invenio_rdm_extension_demo/views.py | <filename>invenio_rdm_extension_demo/views.py
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# Invenio RDM Extension Demo is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Invenio module to showcase how to add an extension t... |
AlgebraicWolf/CAMNS | camns.py | import numpy as np
import cvxpy as cp
def is_extreme_point(C, alpha, d, tol):
"""
Check whether alpha is an extreme point of polyhedron
Arguments:
----------
C : np.ndarray matrix
d : np.ndarray vector
Tuple characterizing affine set
alpha:
Point to be ... |
LinuxIsCool/dotfiles | sdk/cpp/ycm_extra_conf.py | import subprocess as sp
from sys import version_info
if version_info > (3, 0):
gcc_version = sp.run(['gcc', '-dumpversion'], stdout=sp.PIPE).stdout.decode('utf-8').strip()
else:
gcc_version = sp.check_output(['gcc', '-dumpversion']).strip()
FLAGS = [
'-Wall',
'-Wextra',
'-Wno-long-long... |
MohawkTSDB/mohawk | src/alerts/examples/alert-buffer.py | #!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class AlertHandler(BaseHTTPRequestHandler):
def do_POST(self):
# print out new alert changes
print(self.rfile.read(int(self.headers['Content-Length'])))
self.send_response(200)
self.end_headers()
... |
gaybro8777/ApplicationInsights-LocalForwarder | examples/opencensus/python-app/app/views.py | <reponame>gaybro8777/ApplicationInsights-LocalForwarder
from django.http import HttpResponse
from django.shortcuts import render
from opencensus.trace import config_integration
from opencensus.trace.exporters.ocagent import trace_exporter
from opencensus.trace import tracer as tracer_module
from opencensus.trace.propa... |
MatheusJCastro/astropy_displayFITSfile | open_fits.py | <reponame>MatheusJCastro/astropy_displayFITSfile<gh_stars>0
###########################################
# Display .FITS file #
# <NAME> #
# Version 2.1 #
# Last Modification: 05/04/2020 #
###########################################
# lear... |
nevalenny/WyliePy | Wylie.py | # -*- coding: utf-8 -*-
# pylint: disable=too-many-function-args
from __future__ import print_function
import re
# This Python package implements the conversion between Unicode Tibetan text, and
# Wylie (EWTS) transliteration.
# It is based on the equivalent Java module, found at
# http://www.thlib.org/reference/t... |
LasTOmocha/SadigliBot | bot.py | #!/usr/bin/env python
# -*BSD 3-Clause License*-
#__müəllif__ = "<NAME>"
#__müəllif huquqları__ = "Müə<NAME> 2021, SadigliBot"
#__lizensiya__ = "BSD 3-Clause License"
import os
import json
import discord
import random
import asyncio
from random import *
from os.path import join, dirname
from dotenv import... |
carlingkirk/ircportland | plugins/comic.py | # WeedBotRefresh's comic.py - based on nekosune's comic.py
from util import hook
import os
from random import shuffle
from PIL import Image, ImageDraw, ImageFont
import base64
import requests
import json
from datetime import datetime
from io import BytesIO
api_key = None
background_file = None
font_file = None
font_s... |
tkcroat/SC | UnderDev/SC_under_development.py | <reponame>tkcroat/SC
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 3 15:13:53 2016
@author: tkcplayers['DOB'] = pd.to_datetime(players['DOB'], format='%Y-%m-%d')
"""
import numpy as np
import pandas as pd
import glob, math
import datetime
from datetime import date
from PIL import Image, ImageDraw, ImageFont
import... |
tkcroat/SC | UnderDev/SC_data_classes.py | import os
import pandas as pd
import filedialog
class playerinfo():
''' loads all dataframes with player info, teams, etc. '''
def __init__(self, *args, **kwargs):
self.path = filedialog.askdirectory()
# open files
self.players=None
self.famcontact=None
self.m... |
tkcroat/SC | SC_maintenance_main.py | <reponame>tkcroat/SC
# -*- coding: utf-8 -*-
"""
SC maintenance main/workflow ... assorted functions that are run annually or thereabouts
Created on Wed Aug 23 09:14:51 2017
@author: tkc
"""
# Standardize schools to match Pat Moore table
players, famcontact = SC.loadProcessPlayerInfo() # version w/o signup processing
... |
tkcroat/SC | pkg/schedule_scraping.py | <reponame>tkcroat/SC<filename>pkg/schedule_scraping.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 18 11:06:34 2016
@author: tkc
"""
from lxml import html
import requests
import urllib.request
#%%
# xml.etree.ElementTree -- flexible container
page = requests.get('http://www.judgedowdsoccer.com/content... |
tkcroat/SC | pkg/SC_signup_functions.py | # -*- coding: utf-8 -*-
"""
Created on Sun May 22 10:30:01 2016
SC process signups functions
@author: tkc
"""
#%%
import pandas as pd
import numpy as np
from datetime import datetime, date
import re, glob, math
from openpyxl import load_workbook # writing to Excel
from PIL import Image, ImageDraw, ImageFont
import tkin... |
tkcroat/SC | pkg/SC_signup_google_API_functions.py | from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from collections import Counter
import pandas as pd
from datetime import datetime
import numpy as np
im... |
tkcroat/SC | pkg/track_stats.py | <filename>pkg/track_stats.py
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 17 11:42:21 2017
@author: tkc
"""
import pandas as pd
import os
os.chdir('C:\\Users\\tkc\\Documents\\Python_Scripts\\SC')
roster=pd.read_csv('Track_2016_rosters.csv', encoding='cp437')
results=pd.read_excel('Cabrini_track_results.xlsx', shee... |
tkcroat/SC | pkg/SC_messaging_functions.py | # -*- coding: utf-8 -*-
"""
Created on Wed May 24 16:15:24 2017
Sponsors Club messaging functions
@author: tkc
"""
import pandas as pd
import smtplib
import numpy as np
import datetime
import tkinter as tk
import glob
import re
import math
import textwrap
from tkinter import filedialog
from email.mime.multipart impor... |
tkcroat/SC | pkg/SC_uniform_functions.py | <reponame>tkcroat/SC
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 27 11:06:45 2018
@author: tkc
"""
import pandas as pd
import numpy as np
import datetime
import pkg.SC_config as cnf
def checkuni_duplicates(unilist):
''' Check uniform set to see if numbers are unique '''
grouped=unilist.groupby(['Setname','... |
tkcroat/SC | pkg/SC_config.py | <reponame>tkcroat/SC
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 26 21:29:30 2019
@author: kevin
"""
from os.path import expanduser
homedir = expanduser("~")
_OUTPUT_DIR=homedir+"\\Documents\\Sponsors_Club"
_INPUT_DIR=homedir+"\\Documents\\Sponsors_Club\\SC_files" |
tkcroat/SC | SC_schedules_main.py | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 3 11:22:49 2017
@author: tkc
"""
import pandas as pd
import os
import datetime
import sys
import numpy as np
import pkg.SC_messaging_functions as SCmess
import pkg.SC_schedule_functions as SCsch
import pkg.SC_config as cnf # specifies input/output file directories
#%%
f... |
tkcroat/SC | UnderDev/SC_db_alchemy.py | <filename>UnderDev/SC_db_alchemy.py
# -*- coding: utf-8 -*-
"""
Created on Wed May 10 08:58:05 2017
Implementation of database model (players, families) using SQLAlchemy
@author: tkc
"""
import os
import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_b... |
tkcroat/SC | pkg/SC_database_transfer_scripts.py | <reponame>tkcroat/SC
# -*- coding: utf-8 -*-
"""
Created on Wed May 25 08:44:02 2016
@author: tkc
"""
#%% Transfer database tables to new pandas dataframe structure (probably one time use)
import pandas as pd
#%%
# Transfer parent names/numbers/textable from parents to famcontact
# Using phonelist and check for uni... |
tkcroat/SC | UnderDev/SC_tk_underdev.py | <filename>UnderDev/SC_tk_underdev.py
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 15 09:43:09 2017
@author: tkc
"""
import pandas as pd
import smtplib
import numpy as np
import datetime
import tkinter as tk
import glob
import sys
import textwrap
from email.mime.multipart import MIMEMultipart
from email.mime.text imp... |
tkcroat/SC | pkg/SC_billing_functions.py | <reponame>tkcroat/SC<filename>pkg/SC_billing_functions.py
# -*- coding: utf-8 -*-
"""
Created on Sun May 22 10:30:01 2016
SC billing functions
@author: tkc
"""
#%%
import pandas as pd
import datetime
import smtplib
import re
import numpy as np
from email.mime.text import MIMEText
import tkinter as tk
import math
import... |
tkcroat/SC | SC_messaging_main.py | <reponame>tkcroat/SC<filename>SC_messaging_main.py
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 1 17:41:41 2017
@author: tkc
"""
import pandas as pd
import os, sys
if 'C:\\Users\\tkc\\Documents\\Python_Scripts\\SC' not in sys.path:
sys.path.append('C:\\Users\\tkc\\Documents\\Python_Scripts\\SC')
print ('SC ... |
tkcroat/SC | pkg/SC_schedule_functions.py | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 22 06:46:15 2017
@author: tkc
"""
import pandas as pd
import re
from datetime import datetime, timedelta
import tkinter as tk
def alterSchedule(sched):
''' Convert/prepare google docs online schedule version to work with
previous scheduler version.. mainly Divi... |
tkcroat/SC | pkg/SC_legacy_functions.py | <filename>pkg/SC_legacy_functions.py
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 29 10:24:49 2016
SC legacy funct
@author: tkc
"""
import pandas as pd
# Testing option now built in to sendebills
def testautobilling(billlist, Mastersignups, season, year, emailtitle, messagefile, **kwargs):
''' Test e-billing and... |
tkcroat/SC | SC_analysis_main.py | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 24 11:30:49 2017
@author: tkc
"""
os.chdir('C:\\Users\\tkc\\Documents\\Python_Scripts\\SC')
resfile='C:\\Users\\tkc\\Documents\\Sponsors_Club\\League Request Template_BBall_2018.xlsx'
stats=pd.read_excel(resfile, sheetname='Results by League')
stats['Level']=''
for index... |
tkcroat/SC | SC_signups_main.py |
# -*- coding: utf-8 -*-
"""
Created on Sun May 22 10:25:19 2016
Process signups from google drive
@author: tkc
"""
#%%
import pandas as pd
import os
import pkg.SC_signup_functions as SC
import pkg.SC_config as cnf
import pkg.SC_signup_google_API_functions as SCapi
# /from pandas_ods_reader import read_ods # too slow... |
tkcroat/SC | UnderDev/SCdownload_signups.py | <reponame>tkcroat/SC<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Sun May 22 10:12:03 2016
@author: tkc
"""
import gspread
import pandas as pd
#%% Authorization
oauthfile = '/path/to/file/your-api-key.json',
scope = ['https://spreadsheets.google.com/feeds']
json_key = json.load(open(oauthfile))
... |
tkcroat/SC | SC_billing_main.py | # -*- coding: utf-8 -*-
"""
Sponsors club billing main program
Created on Sat Oct 1 13:53:36 2016
@author: tkc
"""
#%%
import pandas as pd
import os, sys
import pkg.SC_signup_functions as SC
import pkg.SC_billing_functions as SCbill
import pkg.SC_signup_google_API_functions as SCapi
import pkg.SC_config as cnf
#%%... |
tkcroat/SC | pkg/SC_signup_functions_13Julbackup.py | <reponame>tkcroat/SC
# -*- coding: utf-8 -*-
"""
Created on Sun May 22 10:30:01 2016
SC process signups functions
@author: tkc
"""
#%%
import pandas as pd
import numpy as np
import datetime
import re
#%%
def findavailablekeys(df, colname, numkeys):
'''Pass df and colname, return a defined number of available keys... |
tkcroat/SC | SC_uniforms_main.py | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 27 10:10:08 2018
@author: tkc
"""
import os, sys
import pandas as pd
import pkg.SC_billing_functions as SCbill
import pkg.SC_uniform_functions as SCuni
import pkg.SC_signup_google_API_functions as SCapi
import pkg.SC_config as cnf
import pkg.SC_signup_functions as SC
#%... |
tkcroat/SC | pkg/sc_database_setup.py | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 5 16:42:40 2019
@author: kevin
"""
crtStmt=tkcreateTable(Mastersignups)
# Create statement for players table
stmt =''' CREATE TABLE players (
Plakey FLOAT NOT NULL,
First VARCHAR NOT NULL,
Last VARCHAR NOT NULL,
DOB VARCHAR NOT NULL,
Gender VARCHAR ... |
podo-os/podo-std-eye | op.py | <filename>op.py
import cv2
import datetime
cam = cv2.VideoCapture(0)
cam.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'))
cam.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
cam.set(cv2.CAP_PROP_FPS, 30)
t = []
for _ in range(32):
_, mat = cam.read()
print(mat.sh... |
craigderington/blocknav.io | forms.py | # -*- coding: utf-8 -*-
from wtforms import Form, BooleanField, StringField, PasswordField, validators
class SearchForm(Form):
search = StringField('Search', [validators.DataRequired()])
class AddressSearchForm(Form):
addr = StringField('Address', [validators.DataRequired()])
class RegistrationForm(Form):... |
craigderington/blocknav.io | config.py | # -*- coding: utf-8 -*-
import os
DEBUG = True
PORT = 5550
SECRET_KEY = os.urandom(64)
API_KEY = ''
STATS_URL = 'https://btc.com/stats/pool'
|
craigderington/blocknav.io | app.py | <gh_stars>0
# -*- coding: utf-8 -*-
from flask import Flask, request, render_template, redirect, flash, url_for, session
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_misaka import Misaka
from blockchain import blockexplorer as be
from blockchain import statistics
from blockchain.exc... |
alexandre-flamant/2DFEM | src/datatypes.py | from config import *
class Node:
__slots__ = ('x', 'y')
class Member:
__slots__ = ('start', 'end', 'area', 'length', 'inertia')
class Structure:
__slots__ = ('nodes', 'members', 'supports')
class Support:
__slots__ = ('ux', 'uy', 'ry')
|
alexandre-flamant/2DFEM | src/parser.py | <reponame>alexandre-flamant/2DFEM<filename>src/parser.py
from config import *
def parse_from_file(p, absolute: True):
try:
file = open(p, mode='r') # Get a read-only stream
except Exception:
raise
while()
file.close()
return None
|
alexandre-flamant/2DFEM | src/solver.py | <gh_stars>0
from config import *
class Solver():
@staticmethod
def create_stiffness_matrix(l, a, e, i):
"""
Return local stiffness array of an edge based on its property
...
:param l: length of the edge in [m]
:param a: section area of the edge in [m^2]
:param... |
estherjsuh/airflow_practice | dags/store_DAG.py | <gh_stars>0
from airflow import DAG
from datetime import datetime, timedelta
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from airflow.operators.mysql_operator import MySqlOperator
from airflow.operators.email_operator import EmailOperator
from ... |
jamesmalin/former2 | util/findImportAttributes.py | import boto3
import pprint
import json
import re
cfnclient = boto3.client('cloudformation', region_name = "us-east-1")
cfn_types = [
'AWS::ApiGatewayV2::VpcLink',
'AWS::ImageBuilder::ImagePipeline',
'AWS::ImageBuilder::ImageRecipe',
'AWS::ImageBuilder::Component',
'AWS::ImageBuilder::DistributionC... |
srounet/pystormlib | pystormlib/structure.py | <filename>pystormlib/structure.py
import ctypes
class MPQFileData(ctypes.Structure):
_fields_ = [
('filename', ctypes.c_char * 1024),
('plainpath', ctypes.c_char_p),
('hashindex', ctypes.c_int, 32),
('blockindex', ctypes.c_int, 32),
('filesize', ctypes.c_int, 32),
(... |
srounet/pystormlib | pystormlib/utils.py | import ctypes
import pystormlib.winerror
def raise_for_error(func, *args, **kwargs):
"""Small helper around GetLastError
:param func: a function using SetLastError internally
:type func: callable
:param args: Arbitrary Argument Lists
:param kwargs: Keyword Arguments
:return: func result
... |
srounet/pystormlib | pystormlib/__init__.py | <reponame>srounet/pystormlib
# -*- coding: UTF-8 -*-
"""Python wrapper for stormlib
Credits goes to <NAME> for the initial python code version (linux)
https://github.com/vjeux/pyStormLib
"""
import ctypes
import os
import pystormlib.structure
import pystormlib.winerror
from pystormlib.utils import raise_for_error
... |
srounet/pystormlib | setup.py | # -*- coding: utf-8 -*-
import setuptools
setuptools.setup(
name='PyStormLib',
version='0.1',
description='Wrapper around Stormlib',
author='<NAME>',
author_email='<EMAIL>',
license = "BSD",
url = "https://github.com/srounet/pystormlib",
packages = setuptools.find_packages(),
packag... |
srounet/pystormlib | pystormlib/winerror.py | <gh_stars>0
class PyStormException(Exception):
message = 'Oops, something bad happend'
def __init__(self, error_code):
message = '{}, ErrorCode: {}'.format(self.message, error_code)
super(PyStormException, self).__init__(message)
class ErrorNoMoreFiles(PyStormException):
message = 'No mor... |
exifna/gitHack | src/gitTools.py | <gh_stars>0
import subprocess
import traceback
from typing import List
import requests
import re
from src import tables, crud
from src.types import FirstHash, SimpleGitObject, GitObjectType
import os
class Git:
def __init__(self, proxies : dict = None, timeout: int = 5):
self.session = requests.session()
... |
exifna/gitHack | console.py | import os
import subprocess
import time
import traceback
from datetime import datetime
from time import sleep
import faker
from pick import pick
from src import crud, types
from src.gitTools import Git
from googlesearch import search
title = types.label + 'Выбери с чем ты хочешь работать'
options = ['Мои сайты', 'Про... |
exifna/gitHack | tests.py | <gh_stars>0
from src import crud
from src.gitTools import Git
from src.types import GitObjectType
proxy = 'socks5://127.0.0.1:9050'
git = Git(proxies={
'http' : proxy,
'https' : proxy
})
print(crud.get_config()) |
exifna/gitHack | src/crud.py | import configparser
from typing import List
from src.database import session
from src.gitTools import Git
from src.tables import *
def get_my_sites(session = session) -> List[Site]:
return session.query(Site).order_by(-Site.id).all()
def get_interested_files(session = session) -> List[str]:
return [x.name fo... |
exifna/gitHack | src/database.py | <gh_stars>0
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
# init all tables
from src.tables import *
engine = create_engine('sqlite:///data.db', echo=False, connect_args={'check_same_thread': False}) ... |
exifna/gitHack | src/types.py | from enum import Enum
class FirstHash:
def __init__(self, last_hash: str, _hash: str, user: str, mail: str, time: int, hour: str, commit_message: str):
self.last_hash = last_hash
self._hash = _hash
self.user = user
self.mail = mail
self.time = time
self.hour = hour
... |
exifna/gitHack | src/tables.py | <filename>src/tables.py
from enum import Enum
from sqlalchemy import Column, Integer, String, Boolean, ForeignKey
from src.database import Base
from src.types import GitObjectType
class Site(Base):
__tablename__ = 'sites'
id: int = Column(Integer, nullable=False, unique=True, primary_key=True, autoincrement=... |
HypoChloremic/fcsan | src/indexer.py | <reponame>HypoChloremic/fcsan
from analyze import Analyze
import argparse
# ap = argparse.ArgumentParser()
# ap.addargument("-f", "--folder")
# opts = ap.parse_args()
run = Analyze()
run.read()
files = run.files
def indexer():
with open("FACS_INDEX.txt", "w") as file:
for i in files:
run.read(i)
meta = run.... |
HypoChloremic/fcsan | src/test.py | <gh_stars>0
# Test of fcsreader.py
# (cc) 2017 <NAME>
# Formagna
import fcsreader
import matplotlib.pyplot as plt
process = fcsreader.fcsReader("data.fcs")
s = process.data()
print(s.columns)
s.plot(x = "SSC-A", y="FSC-A", kind="scatter")
plt.show() |
HypoChloremic/fcsan | src/example_runs.py | # print(run.meta)
# run.kmeans(channels=['FSC-A', 'SSC-A', 'FSC-H', 'FSC-W', 'SSC-H', 'SSC-W', 'FITC-A', 'FITC-H', 'PE-A', 'PE-H', 'PE-Cy7-A', 'PE-Cy7-H', 'UV1-A', 'UV1-H', 'UV2-A', 'UV2-H', 'APC-Cy7-A', 'APC-Cy7-H', 'APC-A', 'APC-H', 'PE-Cy5-A', 'PE-Cy5-H'], logx=False, logy=True, transpose=False, nclusters=5)
# ru... |
HypoChloremic/fcsan | src/fcsreader.py | <reponame>HypoChloremic/fcsan
# Reader of fcs files
# (cc) 2017 <NAME>
# Formagna
from pandas import DataFrame as df
import fcsparser
import numpy as np
__version__ = "0.1"
class fcsReader:
def __init__(self, path, **kwargs):
self.path = path
# Returns the data contained in the fcs file
self.meta, self.d... |
HypoChloremic/fcsan | src/analyze.py | <reponame>HypoChloremic/fcsan<filename>src/analyze.py
# Test of fcsreader.py
# (cc) 2017 <NAME>
# Formagna
# An illustration of how access the arguments.
# Den här kommer att spara det the user har entered, vilket är värt att förstå.
# Alltså, när användaren skriver exempelvis python 1.py -a hello world (för att -a
# ... |
HypoChloremic/fcsan | src/dash_server.py | from dash.dependencies import Input, Output
from analyze import Analyze
import dash
import dash_core_components as dcc
import dash_html_components as html
import json
analyze_run = Analyze()
data = analyze_run.read()
print(analyze_run.meta)
app = dash.Dash(__name__)
app.layout = html.Div([
dcc.Graph(
i... |
HypoChloremic/fcsan | src/dropdown_plotly.py | <filename>src/dropdown_plotly.py<gh_stars>0
import plotly
from plotly.graph_objs import Scattergl, Layout
import plotly.figure_factory as ff
import plotly.graph_objs as go
import pandas as pd
plotly.offline.init_notebook_mode(connected=True)
columns = ["x","y","z"]
x = [1,2,3,4,5,6,7,8,9,10]
y = [2,3,4,5,6,7,8,9,10,1... |
ConnectionMaster/YCSB | vitess/scripts/workload-runner-generator.py | <reponame>ConnectionMaster/YCSB<filename>vitess/scripts/workload-runner-generator.py
import json
import sys
def main(unused_argv):
vtgate_host = sys.argv[1]
ycsb_count = int(sys.argv[2])
workload_file = sys.argv[3] if len(sys.argv) > 3 else 'workloads.json'
shards = sys.argv[4] or '0'
with open(workload_file... |
xeruvimov/admins_pain | replacer.py | <reponame>xeruvimov/admins_pain
from datetime import date
import math
SITE = 'site'
TWITTER = 'twitter'
INSTAGRAM = 'instagram'
TELEGRAM = 'tlg'
def prepare_text(text, target, img):
res_text = remove_tag(text)
# res_text = replace_tag_with_link(res_text)
if target is SITE:
return prepare_text_for... |
xeruvimov/admins_pain | main.py | import threading
import traceback
from datetime import date
from datetime import datetime
import telebot
import vk_api
from telebot.types import InputMediaPhoto
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
import data
import replacer
start_msg = "Start listen just now"
message_breakers = [':', ' ', '... |
xeruvimov/admins_pain | data.py | <reponame>xeruvimov/admins_pain<filename>data.py
import configparser
config_path = 'settings.ini'
config = configparser.ConfigParser()
config.read(config_path)
GROUP_TOKEN = config.get('VK', 'GROUP_TOKEN')
GROUP_ID = config.get('VK', 'GROUP_ID')
BOT_TOKEN = config.get('Telegram', 'BOT_TOKEN')
MY_CHAT_ID = config.get('... |
rt-phb/Spooq | src/spooq2/spooq2_logger.py | <reponame>rt-phb/Spooq
"""
Global Logger instance used by Spooq2.
Example
-------
>>> import logging
>>> logga = logging.getLogger("spooq2")
<logging.Logger at 0x7f5dc8eb2890>
>>> logga.info("Hello World")
[spooq2] 2020-03-21 23:55:48,253 INFO logging_example::<module>::4: Hello World
"""
import os
import sys
import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.