repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
biobai/LiBis
LiBis/test/final.py
import multiprocessing from Comb_fastq import combine from utils import * import sys import gzip import os def cut(step,length_bin,link,i): start = step*i end = length_bin + start if end > len(link): end = len(link) if start>=end or end-start<=length_bin-step: return False,'' return ...
biobai/LiBis
LiBis/test/bsseq_sim.py
import numpy as np import math import random import sys #==============================Variable setting=================================== readsname = sys.argv[1] readsnum= int(sys.argv[2]) conversion_ratio=1 methylation_ratio=0.75 read_length=100 ''' @Variables: chrom_set: dictionary, {chromsome_name:chromsome_genome...
biobai/LiBis
LiBis/fastqc.py
''' Tested ''' from .utils import * import os class FASTQC(): def check(self,nockeck=False): #return True,'' if not toolcheck('fastqc --help'): return False,'Fastqc command not found' if os.path.exists('Fastqc'): if nockeck: print('Fastqc file or di...
biobai/LiBis
LiBis/test/clipped_extractor.py
from utils import * import os def reads_map(partfilelist,args): mapfilenum = args['mapfilenumber'] step = args['step'] file_order=0 mapreduce_file=[] rootfile = partfilelist[0][:partfilelist[0].find('.')] dic={} for i in range(mapfilenum): mapreduce_file.append(rootfile+'_'+str(i)+...
biobai/LiBis
LiBis/test/setup.py
from setuptools import setup, find_packages setup(name = 'pl',version = '0.1',packages = find_packages(),)
biobai/LiBis
LiBis/test/GenerateResult.py
import os from utils import * def GenerateResult(tablefile, fastqcfile, fig): os.system('mkdir RESULT/qc') os.system('cp Fastqc/*.html RESULT/qc')
biobai/LiBis
LiBis/bedtools.py
''' Tested ''' import os from .utils import * class BEDTOOLS: def check(self,nockeck=False): if not toolcheck('bedtools --version'): return False,'Bedtools not found!' return True,'' def setparam(self,param): self.genome = param['genome'] if 'bin' in param and para...
biobai/LiBis
setup.py
<filename>setup.py import sys try: from setuptools import setup except: from distutils.core import setup #!/usr/bin/env python import sys if sys.version_info < (3, 4): sys.exit('Python 3.4 or greater is required.') try: from setuptools import setup, find_packages except ImportError: from distu...
biobai/LiBis
LiBis/test/pos_clipped_length.py
def comb(bam_file,fq_start,fq_end): fq={} with open(fq_start) as f: lines = f.readlines() for i in range(1,len(lines),4): l = len(lines[i].strip()) name = lines[i-1].strip()[1:] fq[name]=[str(l)] with open(fq_end) as f: lines = f.readlines() for i in range(1,l...
biobai/LiBis
LiBis/bsplot.py
<filename>LiBis/bsplot.py<gh_stars>0 ''' Tested ''' import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt from sklearn.manifold import TSNE from sklearn.decomposition import PCA import os from urllib import request from copy import deepcopy import matplotlib.cm as cm def point_cl...
jhugestar/detectron2
projects/DensePose/run_3dpw.py
<reponame>jhugestar/detectron2 from apply_net import denseposeRunner import sys import glob import os # mocapRootDir = '/run/media/hjoo/disk/data/Penn_Action/labels' g_bIsDevfair = False if os.path.exists('/private/home/hjoo'): g_bIsDevfair = True if g_bIsDevfair: inputDir_root = '/private/home/hjoo/data/3d...
jhugestar/detectron2
projects/DensePose/run_penn.py
<reponame>jhugestar/detectron2 from apply_net import denseposeRunner import sys import glob import os def runPennAction(startIdx, endIdx): # mocapRootDir = '/run/media/hjoo/disk/data/Penn_Action/labels' g_bIsDevfair = False if os.path.exists('/private/home/hjoo'): g_bIsDevfair = True if g_bI...
jhugestar/detectron2
projects/DensePose/submit_pennaction.py
<gh_stars>0 import submitit executor = submitit.AutoExecutor(folder="pennImg") executor.update_parameters(timeout_min=4320, gpus_per_node=1, cpus_per_task=8, partition="learnfair", comment= 'CVPR 11/15', name='pennImg') # timeout in min from run_penn import runPennAction, runPennAction_img interval = 100 for i in...
jhugestar/detectron2
projects/DensePose/submit_3dpw.py
import glob import os import submitit from apply_net import denseposeRunner executor = submitit.AutoExecutor(folder="3dpwImg2") executor.update_parameters(timeout_min=4320, gpus_per_node=1, cpus_per_task=8, partition="learnfair", comment= 'CVPR 11/15', name='3dpwImg2') # timeout in min # mocapRootDir = '/run/medi...
pulumi-bot/pulumi-random
sdk/python/pulumi_random/tables.py
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** _SNAKE_TO_CAMEL_CASE_TABLE = { "b64_std": "b64Std", "b64_url": "b64Url", "byte_length": "byteLength", "min_lower": "min...
pulumi-bot/pulumi-random
sdk/python/pulumi_random/random_pet.py
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from . import utilities, tables class RandomP...
pulumi-bot/pulumi-random
sdk/python/pulumi_random/random_string.py
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from . import utilities, tables class RandomS...
pulumi-bot/pulumi-random
sdk/python/pulumi_random/random_integer.py
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from . import utilities, tables class RandomI...
pulumi-bot/pulumi-random
sdk/python/pulumi_random/random_id.py
<reponame>pulumi-bot/pulumi-random # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from . impo...
pulumi-bot/pulumi-random
sdk/python/pulumi_random/__init__.py
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** # Export this package's modules as members: from .provider import * from .random_id import * from .random_integer import * from .random...
pulumi-bot/pulumi-random
sdk/python/pulumi_random/random_shuffle.py
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from . import utilities, tables class RandomS...
pulumi-bot/pulumi-random
sdk/python/pulumi_random/random_uuid.py
<reponame>pulumi-bot/pulumi-random # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from . impo...
pulumi-bot/pulumi-random
sdk/python/pulumi_random/random_password.py
<reponame>pulumi-bot/pulumi-random # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from . impo...
mfrashad/blockchain
register_nodes.py
import os import requests import json stream = os.popen('sudo docker node ps $(sudo docker node ls -q) --filter desired-state=Running | uniq | grep blockchain_app | cut -d " " -f1') processes = stream.read().splitlines() print("Processes : ", processes) overlay_addresses = [] port = "5000" for process in processes: ...
MasterCash/Creer
creer/__init__.py
<gh_stars>1-10 import os import creer.data import creer.prototype import creer.template import creer.writer import creer.input GAMES_DIR = '../Games/' def run(games, inputs, output, merge=False, tagless=False, no_write=False): if len(games) == 0: raise Exception('No game(s) provided to run Creer against'...
MasterCash/Creer
creer/prototype.py
from creer.utilities import extend, copy_dict, sort_dict_keys import creer.default as default import creer.validate import hashlib import json def _copy_from(obj, keys): d = {} for key in keys: d[key] = obj[key] return d def _clean_functions(obj): cleaned = {} if 'functions' in obj: ...
MasterCash/Creer
creer/githash.py
import subprocess def get(): try: return (subprocess.check_output(['git', 'rev-parse', 'HEAD'])).decode("utf-8").rstrip() except: return "Error: git probably not installed"
MasterCash/Creer
creer/validate.py
<filename>creer/validate.py<gh_stars>1-10 # this validates a prototype to ensure none of the data/types/setup will screw with an output template # basically, this validates Creer input data after it has been parsed import re _primitives = [ 'string', 'boolean', 'int', 'float', 'list', 'diction...
MasterCash/Creer
creer/writer.py
<reponame>MasterCash/Creer<filename>creer/writer.py import os from shutil import copyfile def write(generated_files): for generated_file in generated_files: if 'copy-from' in generated_file: # we just need to copy the file from to dest copyfile(generated_file['copy-from'], generated...
MasterCash/Creer
creer/utilities.py
import re import os import collections import operator def extend(d, u): for k, v in u.items(): if isinstance(v, collections.Mapping): r = extend(d.get(k, {}), v) d[k] = r else: d[k] = u[k] return d def list_dirs(path): folders = [] while path != ""...
MasterCash/Creer
creer/input.py
<gh_stars>1-10 import glob from os import path from creer.template import TEMPLATES_DIR def validate(inputs): validated_inputs = [] for input_dir in inputs: dirs = glob.glob(input_dir) if not dirs: raise Exception("No directories matching {}".format(input_dir)) if not glob....
MasterCash/Creer
main.py
<filename>main.py import argparse import creer parser = argparse.ArgumentParser(description='Runs the Creer game generator with a main data file against imput templates to generate an output skeleton game framework') parser.add_argument('games', nargs='*', action='store', help='the file(s) or game names that should be...
MasterCash/Creer
creer/merge.py
from creer.utilities import extract_str MERGE_KEYWORD_START_PRE = "<<-- Creer-Merge: " MERGE_KEYWORD_START_POST = " -->>" MERGE_KEYWORD_END_PRE = "<<-- /Creer-Merge: " MERGE_KEYWORD_END_POST = " -->>" def with_data(data, pre_comment, key, alt, add_tags=True, optional=False, help=True): merged = [] # begin mer...
vincestorm/Docker-on-Amazon-Web-Services
ch17/todobackend/src/todobackend/settings_release.py
<reponame>vincestorm/Docker-on-Amazon-Web-Services from .settings import * import os # Disable debug DEBUG = True # Looks up secret in following order: # 1. /run/secret/<key> # 2. Environment variable named <key> # 3. Value of default or None if no default supplied def secret(key, default=None): root = os.envi...
rabbit-of-caerbannog/yahsd
yahsd.py
import os import sys import time import argparse import itertools import collections import html.parser import urllib.parse import urllib.request class HorribleSubsShow: BASE_URL = "https://horriblesubs.info/api.php" HEADERS = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:77.0) Gecko/20100101 Fi...
vlad9i22/DeckBuilderDjangoWebsiteCC
CCwebsite/tests/DeckBuilderTests.py
<reponame>vlad9i22/DeckBuilderDjangoWebsiteCC<gh_stars>0 import json import os import sys sys.path.insert(1, os.path.abspath('DeckBuilder')) import tools def test_sort_1(): context = json.load(open("templates/static/jsons/deckbuilder_state_default.json", "r")) context2 = json.load(open("templates/static/jsons...
vlad9i22/DeckBuilderDjangoWebsiteCC
CCwebsite/DeckBuilder/migrations/0001_initial.py
# Generated by Django 3.2.5 on 2022-04-17 17:51 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='DeckStructure', fields=[ ('id', models.BigA...
vlad9i22/DeckBuilderDjangoWebsiteCC
dodo.py
from doit.tools import run_once DOIT_CONFIG = {'default_tasks': ['docs', 'babel', 'private_settings', 'migrate', 'tests']} def task_docs(): """Creates documentation in html.""" return { 'actions': ['make -C ./docs html'] } def task_babel(): """Creates generative files for ba...
vlad9i22/DeckBuilderDjangoWebsiteCC
tools/img_tools.py
from PIL import Image from glob import glob from os import path from shutil import copytree, rmtree def get_all_file_names(dir_name: str) -> list: """ Recursively gets all file names from given directory Args: dir_name (str): Directory name Returns: list: Names of all files in directo...
vlad9i22/DeckBuilderDjangoWebsiteCC
CCwebsite/DeckBuilder/migrations/0002_simplemodel.py
# Generated by Django 3.2.5 on 2022-04-18 14:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('DeckBuilder', '0001_initial'), ] operations = [ migrations.CreateModel( name='SimpleModel', fields=[ ...
vlad9i22/DeckBuilderDjangoWebsiteCC
tools/img_filename_taker.py
from img_tools import get_all_file_names import json import os if __name__ == "__main__": filenames = get_all_file_names("../raw_data/cards") dump_dict = {} for i, fname in enumerate(filenames): splitted_path = fname.split("/") dump_dict[os.path.join(splitted_path[-2], splitted_path[-1])] =...
vlad9i22/DeckBuilderDjangoWebsiteCC
CCwebsite/DeckBuilder/urls.py
<filename>CCwebsite/DeckBuilder/urls.py from django.urls import path from . import views urlpatterns = [ # Main page path('', views.index), # Deck build page path('deckbuild/', views.deck_builder) ]
vlad9i22/DeckBuilderDjangoWebsiteCC
CCwebsite/CCwebsite/generate_default_private_settings.py
<reponame>vlad9i22/DeckBuilderDjangoWebsiteCC import json if __name__ == '__main__': SITE_ID = 3 SECRET_KEY = "<KEY>" private_settings = { "SITE_ID": SITE_ID, "SECRET_KEY": SECRET_KEY } with open('private_settings.json', 'w') as f: json.dump(private_settings, f)
vlad9i22/DeckBuilderDjangoWebsiteCC
CCwebsite/DeckBuilder/views.py
from django.shortcuts import render from django.http import HttpResponse from DeckBuilder.tools import process_deckbuilder_request # Create your views here. def index(request): return render(request, './base.html') def deck_builder(request): context = process_deckbuilder_request(request) if request.meth...
vlad9i22/DeckBuilderDjangoWebsiteCC
CCwebsite/DeckBuilder/tools.py
<filename>CCwebsite/DeckBuilder/tools.py import json import os import gettext def sort_deck(context: dict) -> None: ''' Sorts deck according to the rules of the game ''' unit_order = json.load(open("templates/static/jsons/sort_order.json", "r")) deck_slots = [] if context["deck_switch"]: ...
INN/maine-legislature
helpers.py
<reponame>INN/maine-legislature # _*_ coding:utf-8 _*_ # Helper functions for the Maine Legislature project import app_config import collections import copytext import re import json from unicodedata import normalize CACHE = {} _punct_re = re.compile(r'[\t !"#$%&\'()*\-/<=>?@\[\\\]^_`{|},.]+') def get_legislators()...
INN/maine-legislature
app.py
#!/usr/bin/env python # _*_ coding:utf-8 _*_ """ Example application views. Note that `render_template` is wrapped with `make_response` in all application routes. While not necessary for most Flask apps, it is required in the App Template for static publishing. """ import app_config import oauth import static from f...
INN/maine-legislature
tests/test_app.py
<reponame>INN/maine-legislature #!/usr/bin/env python # _*_ coding:utf-8 _*_ import json import unittest import app import app_config class IndexTestCase(unittest.TestCase): """ Test the index page. """ def setUp(self): app.app.config['TESTING'] = True self.client = app.app.test_clien...
wvandertoorn/nanoRMS
visualization_per_read/per_read_mean.py
import sys import pandas as pd infile = sys.argv[1] inp=pd.read_csv(infile,sep='\t') #this step will take ages if the file is huge! inp = inp [inp['model_kmer'] != 'NNNNN'] #Remove NNNNN values grouped_multiple_mean_inp = inp.groupby(['contig', 'position','reference_kmer', "read_index"]).agg({'event_level_mean':['mean'...
wvandertoorn/nanoRMS
per_read/fast5_to_fastq.py
<reponame>wvandertoorn/nanoRMS #!/usr/bin/env python3 desc="""Report FastQ from basecalled Fast5 file(s). Originally from https://github.com/lpryszcz/Pszczyna Dependencies: ont_fast5_api """ epilog="""Author: <EMAIL> Barcelona, 30/00/2020 """ import os, sys from datetime import datetime from ont_fast5_api.fast5_inte...
wvandertoorn/nanoRMS
per_read/get_features.py
#!/usr/bin/env python3 desc="""Requiggle basecalled FastQ files and features in BAM file. For all reference bases we store (as BAM comments): - normalised signal intensity mean [tag si:B,f] - reference base probability [tag tr:B:C] retrieved from guppy (trace scaled 0-255) - dwell time [tag dt:B:C] in signal step cap...
wvandertoorn/nanoRMS
epinano_RMS/epinano_rms.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys,os,re,io,pysam import shutil, fileinput import glob, itertools import subprocess import argparse import multiprocessing as mp from multiprocessing import Process, Manager from functools import partial from sys import __stdout__ import dask import dask.dataframe a...
wvandertoorn/nanoRMS
per_read/common_functions.py
<filename>per_read/common_functions.py """ Here we store all functions that are used across Jupyter notebooks """ import csv, gzip, os, matplotlib.pyplot as plt, numpy as np, pandas as pd, pysam, sys import seaborn as sns#; sns.set() import eif_new as iso_new from sklearn.cluster import AgglomerativeClustering, KMeans...
QCoDeS/MQML-scripts
mqml/instrument/conductresist.py
<reponame>QCoDeS/MQML-scripts<gh_stars>1-10 """ Definition of an instrument to calculate differential conductance and reristance for 2 and 4 probe measurements using inputs of two lock-in amplifiers""" from qcodes.instrument.parameter import Parameter from qcodes.instrument.base import Instrument import numpy as np im...
QCoDeS/MQML-scripts
setup.py
<gh_stars>1-10 """ Installs the mqml package """ from setuptools import setup, find_packages from pathlib import Path import versioneer readme_file_path = Path(__file__).absolute().parent / "README.md" required_packages = [ 'opencensus-ext-azure', 'qcodes' ] package_data = {"mqml": ["conf/telemetry.ini"] } ...
QCoDeS/MQML-scripts
mqml/tests/test_conductresist.py
"""The test file for conductresist.py""" import pytest from mqml.instrument.conductresist import ConductResist from qcodes.instrument.base import Instrument from qcodes.instrument.parameter import Parameter import numpy as np import warnings @pytest.fixture(autouse=True) def close_all_instruments(): """Makes sure ...
RacingTadpole/twenty-questions
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file based on https://github.com/kennethreitz/setup.py/blob/master/setup.py # From https://packaging.python.org/discussions/install-requires-vs-requirements/#requirements-files : # # Whereas install_requires defines the dependencies for a single project, # requirem...
RacingTadpole/twenty-questions
twenty_questions/009-learning.py
<filename>twenty_questions/009-learning.py from dataclasses import dataclass from typing import Union @dataclass class Answer: name: str @dataclass class Question: text: str yes: Union['Question', Answer] no: Union['Question', Answer] q = Question( 'Does your animal fly?', yes=Question( ...
RacingTadpole/twenty-questions
twenty_questions/005-while.py
<filename>twenty_questions/005-while.py<gh_stars>0 x = 'ok' while x != 'stop': x = input('Type anything, or "stop" to stop: ') print('You typed: ' + x) print('Finally!')
RacingTadpole/twenty-questions
twenty_questions/006-choose-your-own.py
data = [ [0, 'Does your animal fly?', 1, 2], [1, 'Is your flying animal a bird?', 3, 4], [2, 'Does your animal live underwater?', 7, 8], [3, 'Is your bird native to Australia?', 5, 6], [4, 'Is it a fruit bat?'], [5, 'Is it a kookaburra?'], [6, 'Is it a blue jay?'], [7, 'Is your animal a ...
RacingTadpole/twenty-questions
twenty_questions/010-dataclasses-json.py
<gh_stars>0 from dataclasses import dataclass from dataclasses_serialization.json import JSONSerializer import json @dataclass class Person: eye_color: str hair_color: str hair_count: int name: str life_span: int poobear = Person ('blue', 'red', 400000, 'PooBear', 89) print(poobear.life_span / 2)...
RacingTadpole/twenty-questions
twenty_questions/008-data-classes.py
from dataclasses import dataclass from typing import Union @dataclass class Answer: text: str @dataclass class Question: text: str yes: Union['Question', Answer] no: Union['Question', Answer] q = Question( 'Does your animal fly?', yes=Question( 'Is your flying animal a bird?', ...
RacingTadpole/twenty-questions
twenty_questions/010-saving.py
<filename>twenty_questions/010-saving.py from dataclasses import dataclass from typing import Union from dataclasses_serialization.json import JSONSerializer import json @dataclass class Answer: name: str @dataclass class Question: text: str yes: Union['Question', Answer] no: Union['Question', Answer...
RacingTadpole/twenty-questions
twenty_questions/007-simpler-dict.py
<filename>twenty_questions/007-simpler-dict.py ages = {'Jack': 13, 'Olivia': 15, 'Robert': 48, 'Jess': 47} print ('Jack is', ages['Jack']) print() for name in ages: print(name, 'is', ages[name]) print() name = input('Enter a name: ') print(name, 'is', ages[name])
RacingTadpole/twenty-questions
twenty_questions/question.py
<filename>twenty_questions/question.py from dataclasses import dataclass @dataclass class Question: number: int text: str yes_number: int no_number: int @dataclass class Answer: number: int text: str data = [ Question(0, 'Does your animal fly?', 1, 2), Question(1, 'Is your flying anim...
RacingTadpole/twenty-questions
twenty_questions/007-dictionaries.py
<reponame>RacingTadpole/twenty-questions data = [ {'number': 0, 'question': 'Does your animal fly?', 'yes': 1, 'no': 2}, {'number': 1, 'question': 'Is your flying animal a bird?', 'yes': 3, 'no': 4}, {'number': 2, 'question': 'Does your animal live underwater?', 'yes': 7, 'no': 8}, {'number': 3, 'questi...
RacingTadpole/twenty-questions
twenty_questions/002-if.py
print('Welcome to Guess the Animal') print('Please think of an animal, and I will try to guess what it is by asking questions.') print('Please answer questions with "y" or "n"') print() x = input('Does your animal fly? ') if x == 'yes': xy = input('Is your flying animal a bird? ') if xy == 'yes': print...
RacingTadpole/twenty-questions
twenty_questions/main.py
<gh_stars>0 from twenty_questions.question import Question print('Welcome to Twenty Questions') print('Please think of an animal or plant, and I will try to guess what it is by asking questions.') print('Please answer questions with "y" or "n"') print() question2 = Question(text='Does it live underwater?', yes_answer...
RacingTadpole/twenty-questions
twenty_questions/008-person.py
from dataclasses import dataclass @dataclass class Person: eye_color: str hair_color: str hair_count: int name: str life_span: int poobear = Person ('blue', 'red', 400000, 'PooBear', 89) print(poobear.life_span / 2)
ovidner/openmdao-bridge-excel
tests/conftest.py
from hypothesis import settings settings.register_profile("fast", max_examples=5, derandomize=True) settings.load_profile("fast")
ovidner/openmdao-bridge-excel
src/openmdao_bridge_excel/timeout_utils.py
<reponame>ovidner/openmdao-bridge-excel import dataclasses import threading from contextlib import contextmanager import psutil @dataclasses.dataclass(eq=False) class TimeoutState: timer = None reached = False @contextmanager def timeout(seconds, timeout_reached_fn): state = TimeoutState() def _ti...
ovidner/openmdao-bridge-excel
src/openmdao_bridge_excel/macro_execution.py
<reponame>ovidner/openmdao-bridge-excel<filename>src/openmdao_bridge_excel/macro_execution.py import dataclasses import hashlib import logging import openmdao.api as om logger = logging.getLogger(__package__) MACRO_WRAPPER_BASE = """Option Private Module Option Explicit""" MACRO_WRAPPER_INSTANCE = """Function {wrap...
ovidner/openmdao-bridge-excel
tests/test_integration.py
<filename>tests/test_integration.py import dataclasses import time import hypothesis.strategies as st import numpy as np import openmdao.api as om import pytest from hypothesis import given, settings from openmdao_bridge_excel import ExcelComponent, ExcelVar TEST_FILE_PATH = "tests/data/test.xlsm" @dataclasses.dat...
ovidner/openmdao-bridge-excel
setup.py
from setuptools import find_packages, setup setup( name="openmdao-bridge-excel", use_scm_version=True, author="<NAME>", author_email="<EMAIL>", packages=find_packages(where="src"), package_dir={"": "src"}, python_requires=">=3.6, <4", install_requires=["openmdao", "psutil", "xlwings"], ...
ovidner/openmdao-bridge-excel
src/openmdao_bridge_excel/__init__.py
import dataclasses import itertools import logging import os.path import numpy as np import openmdao.api as om import xlwings from pywintypes import com_error from .macro_execution import run_and_raise_macro, wrap_macros from .timeout_utils import TimeoutComponentMixin, kill_pid logger = logging.getLogger(__package_...
ArielAlvarezCortez/proyecto_SemTec
convolucion.py
<filename>convolucion.py import numpy as np import cv2 #Ioriginal = matriz original def convolucion(Ioriginal,Kernel): '''Método encargado de realizar una convolución a una imagen Entrada: Ioriginal - imagen original en forma de matríz kernel - kernel para barrer la imagen ...
cmput401-fall2018/web-app-ci-cd-with-travis-ci-manweile
selenium_test.py
import unittest from selenium import webdriver from selenium.webdriver.common.keys import Keys class AssignFourTestCase(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome() def test_home(self): self.driver.get('http://192.168.127.12:8000') ...
cmput401-fall2018/web-app-ci-cd-with-travis-ci-manweile
test_service.py
import unittest from unittest import mock from unittest.mock import patch, mock_open from unittest import TestCase from service import Service ''' The selenium test should run on your development (local) machine. It does not (and should not) be running on your cybera instance The method bad_random in se...
gaybro8777/klio
cli/tests/commands/job/test_run.py
<filename>cli/tests/commands/job/test_run.py # Copyright 2019-2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
gaybro8777/klio
cli/src/klio_cli/utils/config_utils.py
# Copyright 2019-2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
gaybro8777/klio
exec/src/klio_exec/commands/utils/plugin_utils.py
<reponame>gaybro8777/klio # Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
gaybro8777/klio
exec/tests/unit/commands/audit_steps/test_multithreaded_tf.py
<gh_stars>100-1000 # Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
gaybro8777/klio
cli/src/klio_cli/commands/job/test.py
<gh_stars>1-10 # Copyright 2019-2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
gaybro8777/klio
examples/catvdog/transforms.py
<filename>examples/catvdog/transforms.py # Copyright 2019-2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
gaybro8777/klio
exec/src/klio_exec/commands/utils/wrappers.py
# Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
gaybro8777/klio
lib/src/klio/message/serializer.py
# Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
gaybro8777/klio
lib/tests/unit/metrics/test_client.py
# Copyright 2019-2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
gaybro8777/klio
exec/src/klio_exec/commands/stop.py
<gh_stars>100-1000 # Copyright 2019-2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
gaybro8777/klio
integration/read-file/integration_test.py
<gh_stars>100-1000 # Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
gaybro8777/klio
exec/src/klio_exec/commands/audit_steps/tempfile_usage.py
<filename>exec/src/klio_exec/commands/audit_steps/tempfile_usage.py # Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
gaybro8777/klio
exec/tests/unit/commands/audit_steps/test_base.py
# Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
gaybro8777/klio
cli/src/klio_cli/commands/job/__init__.py
# Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
gaybro8777/klio
core/tests/config/test_converters.py
# Copyright 2019-2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
gaybro8777/klio
lib/src/klio/transforms/_utils.py
# Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
gaybro8777/klio
integration/read-bq-write-bq/transforms.py
<filename>integration/read-bq-write-bq/transforms.py # Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
gaybro8777/klio
lib/tests/unit/message/test_serializer.py
# Copyright 2019-2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
gaybro8777/klio
integration/read-bq-write-bq/integration_test.py
# Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
gaybro8777/klio
cli/tests/conftest.py
# Copyright 2019-2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
gaybro8777/klio
lib/tests/unit/transforms/test_io.py
# Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
gaybro8777/klio
exec/src/klio_exec/commands/profile.py
<gh_stars>100-1000 # Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...