text stringlengths 0 1.05M | meta dict |
|---|---|
# Adapted from test_file.py by Daniel Stutzbach
from __future__ import unicode_literals
import sys
import os
import errno
import unittest
from array import array
from weakref import proxy
from functools import wraps
from test.test_support import TESTFN, check_warnings, run_unittest, make_bad_fd
from tes... | {
"repo_name": "MattDevo/edk2",
"path": "AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_fileio.py",
"copies": "9",
"size": "14236",
"license": "bsd-2-clause",
"hash": 6071421114717797000,
"line_mean": 30.801843318,
"line_max": 83,
"alpha_frac": 0.5191064906,
"autogenerated": false,
"ratio":... |
### Adapted from TF repo
import tensorflow as tf
from tensorflow import gradients
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
def hessian_vector_product(ys, xs, v):
"""Multiply the Hessian of `ys` wrt `xs` by `v`.
This is an e... | {
"repo_name": "kohpangwei/influence-release",
"path": "influence/hessians.py",
"copies": "1",
"size": "5137",
"license": "mit",
"hash": -2683368139492086300,
"line_mean": 40.7723577236,
"line_max": 83,
"alpha_frac": 0.6893128285,
"autogenerated": false,
"ratio": 3.8595041322314048,
"config_test... |
bl_info = {
"name": "Add-on Template",
"author": "Alex Martinelli",
"location": "View3D > Tools > Simple Addon",
"version": (1, 0, 0),
"blender": (2, 7, 8),
"description": "Template",
"category": "Development"
}
import bpy
# Panel takes care of the UI components
class SimplePanel(bpy.typ... | {
"repo_name": "5agado/data-science-learning",
"path": "graphics/blender_addon_template.py",
"copies": "1",
"size": "3418",
"license": "apache-2.0",
"hash": 6293365353858813000,
"line_mean": 29.7927927928,
"line_max": 115,
"alpha_frac": 0.6091281451,
"autogenerated": false,
"ratio": 4.209359605911... |
# adapted from the following examples:
# - the video capture example http://processing.org/reference/libraries/video/Capture.html
# - the blob detection example http://www.v3ga.net/processing/BlobDetection/index-page-download.html
# - the video background subtraction example https://github.com/processing/processing/tre... | {
"repo_name": "jeisenma/ProgrammingConcepts",
"path": "14-libraries/blobs.py",
"copies": "1",
"size": "5601",
"license": "bsd-3-clause",
"hash": 7941896664336055000,
"line_mean": 25.6714285714,
"line_max": 157,
"alpha_frac": 0.6391715765,
"autogenerated": false,
"ratio": 2.627110694183865,
"con... |
# adapted from the Keras LSTM text generation example
# basic imports
import numpy as np
import matplotlib.pyplot as plt
# load FsPeptide simulation data, featurize
from msmbuilder.example_datasets import FsPeptide
from msmbuilder.featurizer import DihedralFeaturizer
fs = FsPeptide().get().trajectories
n_atoms = fs[... | {
"repo_name": "maxentile/md-metric-learning",
"path": "algorithms/lstm.py",
"copies": "1",
"size": "1587",
"license": "mit",
"hash": 823034044081042800,
"line_mean": 26.8421052632,
"line_max": 64,
"alpha_frac": 0.7246376812,
"autogenerated": false,
"ratio": 2.9943396226415095,
"config_test": fa... |
# Standard scientific Python imports
#import matplotlib.pyplot as plt
# Import datasets, classifiers and performance metrics
from sklearn import datasets, svm, metrics
import numpy
from PIL import Image
import os
import time
from datetime import datetime
#class Images:
NUM_FILES=30
class MyDataSet:
images = n... | {
"repo_name": "spacepirates/marchine_learning",
"path": "read_nasa_img.py",
"copies": "1",
"size": "5687",
"license": "apache-2.0",
"hash": -7054122301096947000,
"line_mean": 29.4117647059,
"line_max": 82,
"alpha_frac": 0.6272199754,
"autogenerated": false,
"ratio": 3.5213622291021673,
"config_... |
# adapted from the plugin_comments provided with web2py
import re
from gluon.tools import prettydate
from gluon.contrib.markdown.markdown2 import markdown
import requests
import os.path
import urllib
import bleach
from bleach.sanitizer import Cleaner
from datetime import datetime
import json
from opentreewebapputil imp... | {
"repo_name": "OpenTreeOfLife/opentree",
"path": "webapp/controllers/plugin_localcomments.py",
"copies": "1",
"size": "45022",
"license": "bsd-2-clause",
"hash": -2446368944814021600,
"line_mean": 45.3189300412,
"line_max": 212,
"alpha_frac": 0.5791612989,
"autogenerated": false,
"ratio": 3.90240... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# 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 applic... | {
"repo_name": "jameshanlon/convolutional-neural-network",
"path": "extra/conv2.py",
"copies": "1",
"size": "3233",
"license": "mit",
"hash": -8345645666696928000,
"line_mean": 31.9897959184,
"line_max": 90,
"alpha_frac": 0.6637797711,
"autogenerated": false,
"ratio": 2.8917710196779964,
"config... |
import direct.directbase.DirectStart
from panda3d.core import CollisionTraverser, CollisionNode
from panda3d.core import CollisionHandlerQueue, CollisionRay
from panda3d.core import AmbientLight, DirectionalLight, LightAttrib
from panda3d.core import TextNode
from panda3d.core import Point3, Vec3, Vec4, BitMask32, Mat... | {
"repo_name": "agoose77/hivesystem",
"path": "manual/chess/components/TutChessboard.py",
"copies": "1",
"size": "11440",
"license": "bsd-2-clause",
"hash": -4071269278587002400,
"line_mean": 40.7518248175,
"line_max": 89,
"alpha_frac": 0.6462412587,
"autogenerated": false,
"ratio": 3.730029344636... |
# Adapted from unittest2/loader.py from the unittest2 plugins branch.
# This module contains some code copied from unittest2/loader.py and other
# code developed in reference to that module and others within unittest2.
# unittest2 is Copyright (c) 2001-2010 Python Software Foundation; All
# Rights Reserved. See: http:/... | {
"repo_name": "leth/nose2",
"path": "nose2/loader.py",
"copies": "1",
"size": "4059",
"license": "bsd-2-clause",
"hash": 6257230855401016000,
"line_mean": 32.825,
"line_max": 74,
"alpha_frac": 0.6385809313,
"autogenerated": false,
"ratio": 4.445783132530121,
"config_test": true,
"has_no_keywo... |
# Adapted from @wbond's resource loader.
import sys
import sublime
VERSION = int(sublime.version())
mod_prefix = "advanced_new_file"
reload_mods = []
if VERSION > 3000:
mod_prefix = "AdvancedNewFile." + mod_prefix
from imp import reload
for mod in sys.modules:
if mod[0:15] == 'AdvancedNewFile' a... | {
"repo_name": "herove/dotfiles",
"path": "sublime/Packages/AdvancedNewFile/advanced_new_file/reloader.py",
"copies": "1",
"size": "1154",
"license": "mit",
"hash": 1257705942804746800,
"line_mean": 23.0416666667,
"line_max": 77,
"alpha_frac": 0.6377816291,
"autogenerated": false,
"ratio": 3.42433... |
# adapted from whoosh.spelling
"""This module contains helper functions for correcting typos in user queries.
"""
from whoosh import query
from whoosh.spelling import QueryCorrector, Correction
# QueryCorrector objects
class MultiFieldQueryCorrector(QueryCorrector):
"""A simple query corrector based on a mappi... | {
"repo_name": "braddockcg/internet-in-a-box",
"path": "iiab/whoosh_multi_field_spelling_correction.py",
"copies": "1",
"size": "2974",
"license": "bsd-2-clause",
"hash": 7493908281082443000,
"line_mean": 42.7352941176,
"line_max": 142,
"alpha_frac": 0.6203765972,
"autogenerated": false,
"ratio": ... |
# Adapted from Will Bonds Package Control (thread_progress.py)
import sublime
class ProgressNotifier():
"""
Animates an indicator, [= ]
:param message:
The message to display next to the activity indicator
:param success_message:
The message to display once the thread is complete
... | {
"repo_name": "NicoSantangelo/sublime-text-trello",
"path": "progress_notifier.py",
"copies": "1",
"size": "1140",
"license": "mit",
"hash": -4004866993503490000,
"line_mean": 25.5348837209,
"line_max": 88,
"alpha_frac": 0.5710526316,
"autogenerated": false,
"ratio": 3.944636678200692,
"config_... |
# Adapted from Will Bonds Package Control (thread_progress.py)
import sublime
class ProgressNotifier():
"""
Animates an indicator, [= ]
:param message:
The message to display next to the activity indicator
:param success_message:
The message to display once the thread is complete
... | {
"repo_name": "NicoSantangelo/sublime-gulp",
"path": "progress_notifier.py",
"copies": "1",
"size": "1103",
"license": "mit",
"hash": -6655684512976986000,
"line_mean": 24.6511627907,
"line_max": 88,
"alpha_frac": 0.5757026292,
"autogenerated": false,
"ratio": 3.9113475177304964,
"config_test":... |
# adapted from zmq_server_example.py in tinyrpc
import time, sys
import zmq
from tinyrpc.protocols.jsonrpc import JSONRPCProtocol
from tinyrpc.transports.zmq import ZmqServerTransport
from tinyrpc.server import RPCServer
from tinyrpc.dispatch import RPCDispatcher
class Server(object):
def __init__(self, req_callba... | {
"repo_name": "dongting/sdnac",
"path": "sdnac/api/rpc.py",
"copies": "1",
"size": "1086",
"license": "apache-2.0",
"hash": 5105035686370608000,
"line_mean": 29.1666666667,
"line_max": 96,
"alpha_frac": 0.6279926335,
"autogenerated": false,
"ratio": 4.037174721189591,
"config_test": false,
"h... |
# Adapted in part from Olivier Hagolle
# https://github.com/olivierhagolle/LANDSAT-Download
import os
import urllib
import urllib2
import time
import re
import sys
import math
import subprocess
from datetime import datetime, timedelta
import web_tools
def connect_earthexplorer_proxy(proxy_info, usgs):
print "Est... | {
"repo_name": "dgketchum/MT_Rsense",
"path": "utils/usgs_download.py",
"copies": "1",
"size": "10603",
"license": "apache-2.0",
"hash": 5956426135794001000,
"line_mean": 34.9423728814,
"line_max": 118,
"alpha_frac": 0.5497500707,
"autogenerated": false,
"ratio": 3.673943173943174,
"config_test"... |
# Adaptee (source) interface
class EuropeanSocketInterface:
def voltage(self): pass
def live(self): pass
def neutral(self): pass
def earth(self): pass
# Adaptee
class Socket(EuropeanSocketInterface):
def voltage(self):
return 230
def live(self):
return 1
def neutral(s... | {
"repo_name": "AnhellO/DAS_Sistemas",
"path": "Ago-Dic-2017/Emilio Almazan/Practica2/adapter.py",
"copies": "1",
"size": "1436",
"license": "mit",
"hash": 8000793049349686000,
"line_mean": 17.8947368421,
"line_max": 48,
"alpha_frac": 0.5577994429,
"autogenerated": false,
"ratio": 3.77894736842105... |
""" Adaptep from Colin Raffel's git repo https://github.com/craffel/"""
import numpy as np
import theano
from theano import tensor as T
import lasagne
import nnet_utils
def set_trace():
from IPython.core.debugger import Pdb
import sys
Pdb(color_scheme='Linux').set_trace(sys._getframe().f_back)
def train... | {
"repo_name": "rafaelvalle/MDI",
"path": "neural_networks.py",
"copies": "1",
"size": "5022",
"license": "mit",
"hash": -2063686782664809500,
"line_mean": 39.176,
"line_max": 79,
"alpha_frac": 0.583831143,
"autogenerated": false,
"ratio": 4.241554054054054,
"config_test": false,
"has_no_keywo... |
""" Adaptep from Colin Raffel's git repo https://github.com/craffel/
Shared utility functions for downsampled hash sequence experiments.
"""
import os
import numpy as np
import lasagne
import deepdish
import traceback
import functools
import glob
import sys
import simple_spearmint
import neural_networks
def run_tr... | {
"repo_name": "rafaelvalle/MDI",
"path": "bayesian_parameter_optimization.py",
"copies": "1",
"size": "7953",
"license": "mit",
"hash": 7062951554247341000,
"line_mean": 41.0793650794,
"line_max": 80,
"alpha_frac": 0.6161197033,
"autogenerated": false,
"ratio": 4.364983534577387,
"config_test":... |
"""Adapter - Converts django models to Front-end format.
Calls on the model's get_field_order method to know which fields that
are available for display and what order. Returns a config json
that dumps the field config and the json data for model/table.
"""
import datetime
import json
import string
from ... | {
"repo_name": "woodymit/millstone_accidental_source",
"path": "genome_designer/main/adapters.py",
"copies": "1",
"size": "8660",
"license": "mit",
"hash": -7724443117070356000,
"line_mean": 36.8165938865,
"line_max": 79,
"alpha_frac": 0.6538106236,
"autogenerated": false,
"ratio": 4.0204271123491... |
'''Adapter for access to S3 filesystem.'''
import os
from abc import ABCMeta, abstractmethod
from conans.errors import NotFoundException
from conans.util.files import relative_dirs, rmdir, md5sum, decode_text
from conans.util.files import path_exists
from conans.paths import SimplePaths
class ServerStorageAdapter(obj... | {
"repo_name": "mropert/conan",
"path": "conans/server/store/disk_adapter.py",
"copies": "6",
"size": "4396",
"license": "mit",
"hash": -3717030601240870400,
"line_mean": 37.9026548673,
"line_max": 90,
"alpha_frac": 0.6253412193,
"autogenerated": false,
"ratio": 4.123827392120075,
"config_test":... |
""" Adapter for Clova Extensions Kit """
import traceback
from cek import (
Clova,
URL,
IntentRequest
)
from ..serializer import dumps
from .base import Adapter
from ..models import Message
class ClovaAdapter(Adapter):
"""
Adapter for Clova Extensions Kit
Attributes
----------
bot :... | {
"repo_name": "uezo/minette-python",
"path": "minette/adapter/clovaadapter.py",
"copies": "1",
"size": "5119",
"license": "apache-2.0",
"hash": -8874002624017316000,
"line_mean": 30.99375,
"line_max": 100,
"alpha_frac": 0.5780425864,
"autogenerated": false,
"ratio": 4.397766323024055,
"config_t... |
"""Adapter for RunSnakeRun to load coldshot profiles"""
import wx, sys, os, logging
log = logging.getLogger( __name__ )
from squaremap import squaremap
from coldshot import stack,loader
class BaseColdshotAdapter( squaremap.DefaultAdapter):
"""Base class for the various adapters"""
percentageView = False
to... | {
"repo_name": "ktan2020/legacy-automation",
"path": "win/Lib/site-packages/runsnakerun/coldshotadapter.py",
"copies": "3",
"size": "5580",
"license": "mit",
"hash": 4717340373897047000,
"line_mean": 33.6583850932,
"line_max": 80,
"alpha_frac": 0.5853046595,
"autogenerated": false,
"ratio": 4.0464... |
"""Adapter for the Requests Library"""
import json
import requests
import requests.auth
from emma import exceptions as ex
from emma.adapter import AbstractAdapter
def process_response(response):
"""Takes a :class:`Response` and produces python built-ins"""
if response.status_code == 400:
raise ex.Api... | {
"repo_name": "myemma/EmmaPython",
"path": "emma/adapter/requests_adapter.py",
"copies": "1",
"size": "5610",
"license": "mit",
"hash": 7003252425094027000,
"line_mean": 32.7951807229,
"line_max": 80,
"alpha_frac": 0.5374331551,
"autogenerated": false,
"ratio": 3.920335429769392,
"config_test":... |
"""Adapter for using Jinja2 with Django."""
from __future__ import unicode_literals
import functools
import imp
import logging
import re
from django.conf import settings
from django.template.base import Origin, TemplateDoesNotExist
from django.template.context import get_standard_processors
from django.template.load... | {
"repo_name": "jsocol/jingo",
"path": "jingo/__init__.py",
"copies": "1",
"size": "7562",
"license": "bsd-3-clause",
"hash": -2789610080519373000,
"line_mean": 30.2479338843,
"line_max": 79,
"alpha_frac": 0.60711452,
"autogenerated": false,
"ratio": 4.328563251287922,
"config_test": true,
"ha... |
# adapter from audio stream to asynchronous graph
import time
import warnings
import numpy as np
from typing import Tuple
import queue
from . import AudioHardware as AH
from ..graph import Port, Block, UnderrunWarning
from ..graph.typing import Array
from .stream import IOStream
class InStream_SourceBlock(IOStream, Bl... | {
"repo_name": "piannucci/blurt",
"path": "blurt_py_80211/streaming/blurt/audio/graph_adapter.py",
"copies": "1",
"size": "3122",
"license": "mit",
"hash": 7913129483973551000,
"line_mean": 29.3106796117,
"line_max": 94,
"alpha_frac": 0.5800768738,
"autogenerated": false,
"ratio": 3.85908529048207... |
"""Adapter layer to distributed job manager server api
"""
import os
import os.path
import logging
import datetime
from fabric.api import *
from fabric.operations import put
import fabric.network
from file_locator import FileLocator
import utils
from dist_job_mgr.client import get_local_connection
from dist_job_mgr.v... | {
"repo_name": "mpi-sws-rse/datablox",
"path": "engage/adapter_pkg/datablox_engage_adapter/djm_server.py",
"copies": "1",
"size": "5697",
"license": "apache-2.0",
"hash": 2887419267799295500,
"line_mean": 37.7551020408,
"line_max": 150,
"alpha_frac": 0.5875021941,
"autogenerated": false,
"ratio": ... |
import requests
from hs_restclient import HydroShare, DEFAULT_HOSTNAME, HydroShareNotAuthorized, HydroShareNotFound, \
HydroShareHTTPException, default_progress_callback
from requests_toolbelt import MultipartEncoder, MultipartEncoderMonitor
from oauthlib.oauth2.rfc6749.errors import TokenExpiredError
class Hydro... | {
"repo_name": "ODM2/ODM2WebSDL",
"path": "src/hydroshare_util/adapter.py",
"copies": "1",
"size": "5639",
"license": "bsd-3-clause",
"hash": -5919317772670111000,
"line_mean": 42.0458015267,
"line_max": 114,
"alpha_frac": 0.5829047703,
"autogenerated": false,
"ratio": 4.26228269085412,
"config_... |
"""Adapters for connecting time-series data to Bokeh visualizations
To use Bokeh visualizations, do the following
1. Create an instance of BokehPlotManager
2. Register all plots with the BokehPlotManager using BokehPlot objects.
BokehPlot objects provide the basic formatting of the plots.
3. Call BokehPlotManager's st... | {
"repo_name": "mpi-sws-rse/antevents-python",
"path": "antevents/adapters/bokeh.py",
"copies": "1",
"size": "7891",
"license": "apache-2.0",
"hash": 3266741370045244000,
"line_mean": 31.8791666667,
"line_max": 162,
"alpha_frac": 0.6146242555,
"autogenerated": false,
"ratio": 3.6164069660861595,
... |
"""Adapters for converting to and from a type's value according to an
IConvertible protocol.
"""
from datetime import date, time
try:
import decimal
haveDecimal = True
except ImportError:
haveDecimal = False
from formal import iformal, validation
from zope.interface import implements
class _Adapter(objec... | {
"repo_name": "emgee/formal",
"path": "formal/converters.py",
"copies": "1",
"size": "5383",
"license": "mit",
"hash": -5309029155154310000,
"line_mean": 25.1310679612,
"line_max": 92,
"alpha_frac": 0.5652981609,
"autogenerated": false,
"ratio": 4.604790419161676,
"config_test": false,
"has_n... |
"""Adapters for IPython msg spec versions."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
from IPython.core.release import kernel_protocol_version_info
from IPython.utils.tokenutil import token_at_cursor
def code_to_line(code, cursor_pos):
""... | {
"repo_name": "wolfram74/numerical_methods_iserles_notes",
"path": "venv/lib/python2.7/site-packages/IPython/kernel/adapter.py",
"copies": "2",
"size": "11788",
"license": "mit",
"hash": -8934437121141680000,
"line_mean": 30.6032171582,
"line_max": 94,
"alpha_frac": 0.5563284696,
"autogenerated": f... |
"""Adapters for Jupyter msg spec versions."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import re
import json
from datetime import datetime
from jupyter_client import protocol_version_info
def code_to_line(code, cursor_pos):
"""Turn a multiline code b... | {
"repo_name": "lancezlin/ml_template_py",
"path": "lib/python2.7/site-packages/jupyter_client/adapter.py",
"copies": "3",
"size": "12462",
"license": "mit",
"hash": 2297094977251245800,
"line_mean": 29.6191646192,
"line_max": 94,
"alpha_frac": 0.5692505216,
"autogenerated": false,
"ratio": 4.0251... |
"""Adapters for Jupyter msg spec versions."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import re
import json
from jupyter_client import protocol_version_info
def code_to_line(code, cursor_pos):
"""Turn a multiline code block and cursor position into a... | {
"repo_name": "bdh1011/wau",
"path": "venv/lib/python2.7/site-packages/jupyter_client/adapter.py",
"copies": "1",
"size": "12208",
"license": "mit",
"hash": 484897025171666100,
"line_mean": 29.52,
"line_max": 94,
"alpha_frac": 0.5686435125,
"autogenerated": false,
"ratio": 4.022405271828665,
"c... |
"""Adapters for registering models with django-watson."""
from __future__ import unicode_literals
import sys, json
from itertools import chain, islice
from threading import local
from functools import wraps
from weakref import WeakValueDictionary
from compat import force_text
from django.conf import settings
from dj... | {
"repo_name": "arteria/django-watson",
"path": "src/watson/registration.py",
"copies": "1",
"size": "23286",
"license": "bsd-3-clause",
"hash": 5331670670279649000,
"line_mean": 36.7406807131,
"line_max": 158,
"alpha_frac": 0.6068453148,
"autogenerated": false,
"ratio": 4.516291698991466,
"conf... |
""" Adapters for the :py:class:`.hardware_control.API` instances.
"""
import asyncio
import functools
from typing import TYPE_CHECKING
from .types import HardwareAPILike
if TYPE_CHECKING:
from .dev_types import HasLoop # noqa (F501)
# TODO: BC 2020-02-25 instead of overwriting __get_attribute__ in this class
# ... | {
"repo_name": "Opentrons/labware",
"path": "api/src/opentrons/hardware_control/adapters.py",
"copies": "3",
"size": "3543",
"license": "apache-2.0",
"hash": 8390573801762520000,
"line_mean": 39.2386363636,
"line_max": 79,
"alpha_frac": 0.6676080203,
"autogenerated": false,
"ratio": 4.366214549938... |
"""Adapter to wrap the rachiopy api for home assistant."""
from __future__ import annotations
import logging
import voluptuous as vol
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, HTTP_OK
from homeassistant.helpers import config_validation as cv
from .const import (
DOMAIN,
KEY_DEVICES,
KEY_... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/components/rachio/device.py",
"copies": "3",
"size": "9590",
"license": "apache-2.0",
"hash": 6146850347762021000,
"line_mean": 34.2573529412,
"line_max": 99,
"alpha_frac": 0.5822732013,
"autogenerated": false,
"ratio": 3.94650205761... |
"""Adapter to wrap the rachiopy api for home assistant."""
import logging
from typing import Optional
import voluptuous as vol
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, HTTP_OK
from homeassistant.helpers import config_validation as cv
from .const import (
DOMAIN,
KEY_DEVICES,
KEY_ENABLED,... | {
"repo_name": "turbokongen/home-assistant",
"path": "homeassistant/components/rachio/device.py",
"copies": "4",
"size": "9585",
"license": "apache-2.0",
"hash": -8905244874139958000,
"line_mean": 34.36900369,
"line_max": 99,
"alpha_frac": 0.5826812728,
"autogenerated": false,
"ratio": 3.949320148... |
"""Adapter to wrap the rachiopy api for home assistant."""
import logging
from typing import Optional
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, HTTP_OK
from .const import (
KEY_DEVICES,
KEY_ENABLED,
KEY_EXTERNAL_ID,
KEY_FLEX_SCHEDULES,
KEY_ID,
KEY_MAC_ADDRESS,
KEY_MODEL,
... | {
"repo_name": "mKeRix/home-assistant",
"path": "homeassistant/components/rachio/device.py",
"copies": "7",
"size": "6803",
"license": "mit",
"hash": 2191683429331065300,
"line_mean": 34.4322916667,
"line_max": 99,
"alpha_frac": 0.5951785977,
"autogenerated": false,
"ratio": 3.900802752293578,
"... |
"""Adaptive active learning
"""
import copy
import numpy as np
from joblib import Parallel, delayed
from libact.base.dataset import Dataset
from libact.base.interfaces import QueryStrategy, ContinuousModel
from libact.utils import inherit_docstring_from, seed_random_state, zip
from libact.models.multilabel import Bin... | {
"repo_name": "ntucllab/libact",
"path": "libact/query_strategies/multilabel/adaptive_active_learning.py",
"copies": "1",
"size": "5082",
"license": "bsd-2-clause",
"hash": -4465277713873521000,
"line_mean": 31.5769230769,
"line_max": 87,
"alpha_frac": 0.5979929162,
"autogenerated": false,
"ratio... |
""" Adaptive Gradient Clipping
An impl of AGC, as per (https://arxiv.org/abs/2102.06171):
@article{brock2021high,
author={Andrew Brock and Soham De and Samuel L. Smith and Karen Simonyan},
title={High-Performance Large-Scale Image Recognition Without Normalization},
journal={arXiv preprint arXiv:},
year={2021... | {
"repo_name": "rwightman/pytorch-image-models",
"path": "timm/utils/agc.py",
"copies": "1",
"size": "1624",
"license": "apache-2.0",
"hash": -7188842237585664000,
"line_mean": 37.6666666667,
"line_max": 103,
"alpha_frac": 0.6828817734,
"autogenerated": false,
"ratio": 3.0583804143126176,
"confi... |
# Adaptive Histogram Equalization
#
# This example shows off how to use adaptive histogram equalization to improve
# the contrast in the image. Adaptive histogram equalization splits the image
# into regions and then equalizes the histogram in those regions to improve
# the image contrast versus a global histogram equa... | {
"repo_name": "openmv/openmv",
"path": "scripts/examples/Arduino/Portenta-H7/04-Image-Filters/adaptive_histogram_equalization.py",
"copies": "2",
"size": "1062",
"license": "mit",
"hash": 732665345149227500,
"line_mean": 35.6206896552,
"line_max": 78,
"alpha_frac": 0.7589453861,
"autogenerated": fa... |
"""Adaptive Smoothed Aggregation."""
from __future__ import absolute_import
from warnings import warn
import numpy as np
import scipy as sp
from scipy.sparse import csr_matrix, bsr_matrix, isspmatrix_csr,\
isspmatrix_csc, isspmatrix_bsr, eye, SparseEfficiencyWarning
from pyamg.multilevel import multilevel_solver... | {
"repo_name": "pyamg/pyamg",
"path": "pyamg/aggregation/adaptive.py",
"copies": "1",
"size": "32239",
"license": "mit",
"hash": 231700961214871070,
"line_mean": 41.5878467635,
"line_max": 105,
"alpha_frac": 0.5394398089,
"autogenerated": false,
"ratio": 3.8398046688899474,
"config_test": false,... |
"""Adaptive Smoothed Aggregation"""
__docformat__ = "restructuredtext en"
from warnings import warn
import numpy as np
import scipy as sp
from scipy.sparse import csr_matrix, bsr_matrix, isspmatrix_csr,\
isspmatrix_csc, isspmatrix_bsr, eye, SparseEfficiencyWarning
from pyamg.multilevel import multilevel_solver
f... | {
"repo_name": "kidaa/pyamg",
"path": "pyamg/aggregation/adaptive.py",
"copies": "1",
"size": "32192",
"license": "bsd-3-clause",
"hash": 1693258017600904700,
"line_mean": 41.1913499345,
"line_max": 79,
"alpha_frac": 0.5353503976,
"autogenerated": false,
"ratio": 3.82782401902497,
"config_test":... |
"""Adaptive Smoothed Aggregation"""
__docformat__ = "restructuredtext en"
from warnings import warn
import numpy
import scipy
from scipy.sparse import csr_matrix, bsr_matrix, isspmatrix_csr,\
isspmatrix_csc, isspmatrix_bsr, eye
from pyamg.multilevel import multilevel_solver
from pyamg.strength import symmetric_s... | {
"repo_name": "pombreda/pyamg",
"path": "pyamg/aggregation/adaptive.py",
"copies": "1",
"size": "32061",
"license": "bsd-3-clause",
"hash": 6261546143239529000,
"line_mean": 40.9646596859,
"line_max": 79,
"alpha_frac": 0.5377249618,
"autogenerated": false,
"ratio": 3.8309236467917316,
"config_t... |
"""Adaptive tracks for psychophysics (individual, or multiple randomly dealt)
"""
# Author: Ross Maddox <ross.maddox@rochester.edu>
#
# License: BSD (3-clause)
import numpy as np
import time
from scipy.stats import binom
import json
import warnings
from .. import ExperimentController
# =============================... | {
"repo_name": "LABSN/expyfun",
"path": "expyfun/stimuli/_tracker.py",
"copies": "2",
"size": "50985",
"license": "bsd-3-clause",
"hash": -6085855555935634000,
"line_mean": 35.1852377573,
"line_max": 79,
"alpha_frac": 0.5419240953,
"autogenerated": false,
"ratio": 4.207030283026652,
"config_test... |
"Adaptive Weights Clustering"
__author__ = 'Kirill Efimov, Larisa Adamyan, Vladimir Spokoiny'
import scipy.spatial.distance as sci
import numpy as np
import scipy.special as spec
import matplotlib.pyplot as plt
def distance_matrix(X):
"""Compute the distance matrix of the data X"""
return sci.squareform... | {
"repo_name": "larisahax/awc",
"path": "awc/awc.py",
"copies": "1",
"size": "15189",
"license": "mit",
"hash": -7683095211330169000,
"line_mean": 34.4055944056,
"line_max": 133,
"alpha_frac": 0.5487523866,
"autogenerated": false,
"ratio": 3.3294607628233233,
"config_test": false,
"has_no_keyw... |
"""Adaptor for DynamoDB.
"""
import copy
from boto3.dynamodb import conditions
from oto import response
from oto import status
from sukimu import consts
from sukimu import operations
from sukimu import schema
class TableDynamo(schema.Table):
def __init__(self, name, connection, **options):
"""Create a... | {
"repo_name": "xethorn/sukimu",
"path": "sukimu/dynamodb.py",
"copies": "1",
"size": "16893",
"license": "mit",
"hash": -7047208814552277000,
"line_mean": 35.3290322581,
"line_max": 79,
"alpha_frac": 0.6128573966,
"autogenerated": false,
"ratio": 4.2032843991042546,
"config_test": false,
"has... |
"""Adaptor is a subclass of :class:`~smif.model.model.Model`, to be used for converting
data between units or dimensions.
The method to override is `generate_coefficients`, which accepts two
:class:`~smif.metadata.spec.Spec` definitions.
"""
from abc import ABCMeta, abstractmethod
import numpy as np # type: ignore
f... | {
"repo_name": "willu47/smif",
"path": "src/smif/convert/adaptor.py",
"copies": "3",
"size": "6401",
"license": "mit",
"hash": -7679682117943993000,
"line_mean": 35.3693181818,
"line_max": 93,
"alpha_frac": 0.6064677394,
"autogenerated": false,
"ratio": 4.161898569570871,
"config_test": false,
... |
""" Adaptor module.
Responsible for creating custom nodes for storing viewable data,
and connecting them to the observed object.
The nodes are added to the model, and this step should be done
prior to passing the model to the simulator.
Views can then subscribe to be updated with the given data,
according to the giv... | {
"repo_name": "chairmanmeow50/Brainspawn",
"path": "brainspawn/simulator/adaptor.py",
"copies": "1",
"size": "7826",
"license": "bsd-3-clause",
"hash": -6180596435921100000,
"line_mean": 33.0260869565,
"line_max": 78,
"alpha_frac": 0.6032455916,
"autogenerated": false,
"ratio": 4.193997856377278,... |
""" Adapt the binary search algorithm so that instead of outputting whether a specific value was found, it outputs whether a value within an interval (specified by you) was found. Write the pseudocode and code and give the time complexity of the algorithm using the Big O notation."""
def bina... | {
"repo_name": "megasan/210-CT",
"path": "coursework 9.py",
"copies": "1",
"size": "1511",
"license": "mit",
"hash": -8335320677247389000,
"line_mean": 33.9761904762,
"line_max": 310,
"alpha_frac": 0.619457313,
"autogenerated": false,
"ratio": 4.220670391061453,
"config_test": false,
"has_no_k... |
"""adapt URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | {
"repo_name": "deafhhs/adapt",
"path": "adapt/urls.py",
"copies": "1",
"size": "1577",
"license": "mit",
"hash": -2840120015824734700,
"line_mean": 45.3823529412,
"line_max": 129,
"alpha_frac": 0.7064045656,
"autogenerated": false,
"ratio": 3.4060475161987043,
"config_test": false,
"has_no_ke... |
#A database of snapshots
import os, pickle
from time import sleep
from Snapshot import Snapshot
class Database:
def __init__(self):
self.history = []
self.historyLength = 14
self.snapshots = []
self.lastss = Snapshot()
def addSnapshot(self,ss):
self.sna... | {
"repo_name": "henfredemars/python-personal-projects",
"path": "ChatBot/Database.py",
"copies": "1",
"size": "2177",
"license": "mit",
"hash": 7907048366013189000,
"line_mean": 27.4189189189,
"line_max": 75,
"alpha_frac": 0.5480018374,
"autogenerated": false,
"ratio": 4.251953125,
"config_test"... |
"""A DataFrame is a container for ingesting and preprocessing data."""
# Copyright 2016 Google Inc. All Rights Reserved.
#
# 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.apa... | {
"repo_name": "ninotoshi/tensorflow",
"path": "tensorflow/contrib/learn/python/learn/dataframe/dataframe.py",
"copies": "2",
"size": "5867",
"license": "apache-2.0",
"hash": -3019765076197016600,
"line_mean": 33.1104651163,
"line_max": 79,
"alpha_frac": 0.6475200273,
"autogenerated": false,
"rati... |
""" A dataset parser that reads images from folders
Folders are scannerd recursively to find image files. Labels are based
on the folder hierarchy, just leaf folders by default.
Hacked together by / Copyright 2020 Ross Wightman
"""
import os
from timm.utils.misc import natural_key
from .parser import Parser
from .c... | {
"repo_name": "rwightman/pytorch-image-models",
"path": "timm/data/parsers/parser_image_folder.py",
"copies": "1",
"size": "2508",
"license": "apache-2.0",
"hash": -6738571055835827000,
"line_mean": 35.347826087,
"line_max": 118,
"alpha_frac": 0.6279904306,
"autogenerated": false,
"ratio": 3.6774... |
""" A dataset parser that reads single tarfile based datasets
This parser can read datasets consisting if a single tarfile containing images.
I am planning to deprecated it in favour of ParerImageInTar.
Hacked together by / Copyright 2020 Ross Wightman
"""
import os
import tarfile
from .parser import Parser
from .cl... | {
"repo_name": "rwightman/pytorch-image-models",
"path": "timm/data/parsers/parser_image_tar.py",
"copies": "1",
"size": "2589",
"license": "apache-2.0",
"hash": 6998333572099825000,
"line_mean": 34.9583333333,
"line_max": 100,
"alpha_frac": 0.6508304365,
"autogenerated": false,
"ratio": 3.7906295... |
""" A dataset parser that reads tarfile based datasets
This parser can read and extract image samples from:
* a single tar of image files
* a folder of multiple tarfiles containing imagefiles
* a tar of tars containing image files
Labels are based on the combined folder and/or tar name structure.
Hacked together by ... | {
"repo_name": "rwightman/pytorch-image-models",
"path": "timm/data/parsers/parser_image_in_tar.py",
"copies": "1",
"size": "8987",
"license": "apache-2.0",
"hash": -3681078907760514600,
"line_mean": 39.481981982,
"line_max": 118,
"alpha_frac": 0.6147769,
"autogenerated": false,
"ratio": 3.6281792... |
"""A data sink implementation for the core listener notification service of
:class:`openxc.vehicle.Vehicle`.
"""
from threading import Thread
from collections import defaultdict
import logging
from openxc.measurements import Measurement, UnrecognizedMeasurementError
from .queued import QueuedSink
LOG = logging.getLog... | {
"repo_name": "openxc/openxc-python",
"path": "openxc/sinks/notifier.py",
"copies": "1",
"size": "2408",
"license": "bsd-3-clause",
"hash": -6824652568816227000,
"line_mean": 34.9402985075,
"line_max": 80,
"alpha_frac": 0.6316445183,
"autogenerated": false,
"ratio": 4.777777777777778,
"config_t... |
"""A data source for reading from pre-recorded OpenXC trace files."""
import logging
import time
from .base import DataSourceError, BytestreamDataSource
from openxc.formats.json import JsonFormatter
LOG = logging.getLogger(__name__)
class TraceDataSource(BytestreamDataSource):
"""A class to replay a previous... | {
"repo_name": "openxc/openxc-python",
"path": "openxc/sources/trace.py",
"copies": "1",
"size": "3543",
"license": "bsd-3-clause",
"hash": -3904050951738538500,
"line_mean": 35.5257731959,
"line_max": 79,
"alpha_frac": 0.6136042901,
"autogenerated": false,
"ratio": 4.451005025125628,
"config_te... |
"""A datasource providing different types of noise.
"""
# standard imports
from typing import Tuple
# third party imports
import numpy as np
# toolbox imports
from dltb.base.data import Data
from .datasource import Imagesource, Livesource, Random
class Noise(Random, Livesource, Imagesource):
# pylint: disable=... | {
"repo_name": "Petr-By/qtpyvis",
"path": "dltb/datasource/noise.py",
"copies": "1",
"size": "2209",
"license": "mit",
"hash": -5813427164859042000,
"line_mean": 29.6805555556,
"line_max": 78,
"alpha_frac": 0.5830692621,
"autogenerated": false,
"ratio": 4.314453125,
"config_test": false,
"has_... |
"""A datasource reading images from a webcam.
This module mainly provides the class :py:class:`Webcam` that is
a Datasource interface for accessing the a webcam.
Examples
--------
from dltb.datasource.webcam import Webcam
webcam = Webcam()
webcam.prepare()
frame = webcam.get_data()
image = fram... | {
"repo_name": "Petr-By/qtpyvis",
"path": "dltb/datasource/webcam.py",
"copies": "1",
"size": "5275",
"license": "mit",
"hash": 984577935876798000,
"line_mean": 29.8479532164,
"line_max": 77,
"alpha_frac": 0.5793364929,
"autogenerated": false,
"ratio": 4.160094637223975,
"config_test": false,
... |
"""A data store holds the bulk of model setup, intermediate and output data:
- scenario variant and narrative data (including parameter defaults)
- model interventions, initial conditions and state
- conversion coefficients
- results
"""
from abc import ABCMeta, abstractmethod
from typing import Dict, List
from smif.d... | {
"repo_name": "willu47/smif",
"path": "src/smif/data_layer/abstract_data_store.py",
"copies": "1",
"size": "7442",
"license": "mit",
"hash": 1239349126053676800,
"line_mean": 25.8664259928,
"line_max": 90,
"alpha_frac": 0.5713517872,
"autogenerated": false,
"ratio": 4.657071339173967,
"config_t... |
"""A data structure for representing dependency tree graphs."""
__author__ = ["John Stewart <free-variation>"]
from typing import Dict, List, Union
from xml.etree.ElementTree import Element, ElementTree
from cltk.core.data_types import Doc, Process, Word
from cltk.core.exceptions import CLTKException
from cltk.morph... | {
"repo_name": "diyclassics/cltk",
"path": "src/cltk/dependency/tree.py",
"copies": "4",
"size": "10141",
"license": "mit",
"hash": -9107261459092737000,
"line_mean": 35.7282608696,
"line_max": 291,
"alpha_frac": 0.5766005722,
"autogenerated": false,
"ratio": 3.679491833030853,
"config_test": fa... |
from __future__ import print_function
import subprocess
import tempfile
import uuid
# A temporary directory on the Android device.
DEVICE_TEMP_DIR = '/data/local/tmp'
def shell(args):
"""
Execute 'adb shell' with the given arguments.
Raise an exception if 'adb shell' returns a non-zero exit code.
... | {
"repo_name": "ben-ng/swift",
"path": "utils/android/adb/commands.py",
"copies": "1",
"size": "6053",
"license": "apache-2.0",
"hash": 5749937097594741000,
"line_mean": 38.8223684211,
"line_max": 79,
"alpha_frac": 0.6484387907,
"autogenerated": false,
"ratio": 4.259676284306826,
"config_test": ... |
from __future__ import print_function
import os
import subprocess
import tempfile
import uuid
# A temporary directory on the Android device.
DEVICE_TEMP_DIR = '/data/local/tmp'
ENV_PREFIX = 'ANDROID_CHILD_'
def shell(args):
"""
Execute 'adb shell' with the given arguments.
Raise an exception if 'adb ... | {
"repo_name": "airspeedswift/swift",
"path": "utils/android/adb/commands.py",
"copies": "27",
"size": "8088",
"license": "apache-2.0",
"hash": 1750062538578977000,
"line_mean": 41.125,
"line_max": 79,
"alpha_frac": 0.6454005935,
"autogenerated": false,
"ratio": 4.31590181430096,
"config_test": ... |
from __future__ import print_function
import subprocess
import tempfile
import uuid
# A temporary directory on the Android device.
DEVICE_TEMP_DIR = '/data/local/tmp'
def shell(args):
"""
Execute 'adb shell' with the given arguments.
Raise an exception if 'adb shell' returns a non-zero exit code.
... | {
"repo_name": "bitjammer/swift",
"path": "utils/android/adb/commands.py",
"copies": "32",
"size": "6053",
"license": "apache-2.0",
"hash": -624846327794969900,
"line_mean": 38.8223684211,
"line_max": 79,
"alpha_frac": 0.6484387907,
"autogenerated": false,
"ratio": 4.259676284306826,
"config_tes... |
# adb tools
import os
import platform
import libs.common_tools as U
system = platform.system()
if system is "Linux":
find_tool = 'grep'
else:
find_tool = 'findstr'
if "ANDROID_HOME" in os.environ:
if system is "Windows":
command = os.path.join(
os.environ['ANDROID_HOME'], 'platform-too... | {
"repo_name": "ZzZxL/tf",
"path": "libs/adb_tools.py",
"copies": "1",
"size": "2222",
"license": "apache-2.0",
"hash": 8743134193878870000,
"line_mean": 20.7708333333,
"line_max": 95,
"alpha_frac": 0.5942583732,
"autogenerated": false,
"ratio": 2.8907330567081604,
"config_test": false,
"has_n... |
'''ADC Device
===============
ADC implementation of :class:`~moa.device.Device`.
'''
from kivy.properties import (
DictProperty, BooleanProperty, NumericProperty, ObjectProperty,
ListProperty)
from moa.device import Device
from time import clock
from kivy.clock import Clock
__all__ = ('ADCPort', 'VirtualADCP... | {
"repo_name": "matham/moa",
"path": "moa/device/adc.py",
"copies": "1",
"size": "9043",
"license": "mit",
"hash": -6651264604249573000,
"line_mean": 34.8849206349,
"line_max": 79,
"alpha_frac": 0.6199270154,
"autogenerated": false,
"ratio": 3.8188344594594597,
"config_test": false,
"has_no_ke... |
"""A DCHP sniffer that listens for DHCP request messages"""
import socket
import time
from threading import Thread
from pydispatch import dispatcher
class DHCPListener(Thread):
"""The dhcp listener thread"""
def __init__(self):
"""Init Worker Thread Class."""
self.shutdown = False
dis... | {
"repo_name": "AMXAUNZ/Magic-DXLink-Configurator",
"path": "scripts/dhcp_sniffer.py",
"copies": "1",
"size": "5493",
"license": "mit",
"hash": -4967445744880776000,
"line_mean": 37.6830985915,
"line_max": 105,
"alpha_frac": 0.458401602,
"autogenerated": false,
"ratio": 5.021023765996343,
"confi... |
"""ADC module B2b interface
SPI Rack interface code for the ADC module. An 2 channel 24-bit ADC module
with integrated ARM Cortex M4 microcontroller. Used to connect to two neighbouring
IVVI rack modules
Example:
Example use: ::
B2b = spirack.B2b_module(SPI_Rack1, 1, True)
"""
import logging
from enum i... | {
"repo_name": "Rubenknex/SPI-rack",
"path": "spirack/B2b_module.py",
"copies": "2",
"size": "23197",
"license": "mit",
"hash": 9123332131648882000,
"line_mean": 36.1168,
"line_max": 145,
"alpha_frac": 0.582575333,
"autogenerated": false,
"ratio": 3.682063492063492,
"config_test": false,
"has_... |
"""ADC module D4b interface
SPI Rack interface code for the ADC module. An 2 channel 24-bit ADC module
with integrated ARM Cortex M4 microcontroller. Used to connect to two neighbouring
IVVI rack modules. Is in hardware identical to the B2b module, the only difference
is the presence of connectors on the front of the ... | {
"repo_name": "Rubenknex/SPI-rack",
"path": "spirack/D4b_module.py",
"copies": "2",
"size": "4976",
"license": "mit",
"hash": 3723048741171442000,
"line_mean": 39.7868852459,
"line_max": 114,
"alpha_frac": 0.6117363344,
"autogenerated": false,
"ratio": 3.958631662688942,
"config_test": false,
... |
"""ADC module D4 interface
SPI Rack interface code for the D4 module.
Example:
Example use: ::
D4 = spirack.D4_modules(SPI_Rack1, 5)
"""
from .chip_mode import AD7175_MODE, AD7175_SPEED
class D4_module(object):
"""D4 module interface class
This class does the low level interfacing with the D4 m... | {
"repo_name": "Rubenknex/SPI-rack",
"path": "spirack/D4_module.py",
"copies": "2",
"size": "13448",
"license": "mit",
"hash": 1818657467135176400,
"line_mean": 34.5767195767,
"line_max": 115,
"alpha_frac": 0.5726502082,
"autogenerated": false,
"ratio": 3.5039082855653985,
"config_test": false,
... |
# adc.py
# Part of PyBBIO
# github.com/graycatlabs/PyBBIO
# MIT License
#
# Beaglebone ADC driver for kernels >= 3.8.
#
# Just a wrapper for the sysfs ADC driver for the time being.
import os, glob, bbio
import cape_manager
from config import ADC, ADC_ENABLE_DTS_OVERLAY
_ADC_INITIALIZED = False
def analog_init():... | {
"repo_name": "ims-tyler/PyBBIO",
"path": "bbio/platform/beaglebone/adc.py",
"copies": "3",
"size": "1879",
"license": "mit",
"hash": -646001964217655200,
"line_mean": 28.359375,
"line_max": 78,
"alpha_frac": 0.6620542842,
"autogenerated": false,
"ratio": 3.0853858784893267,
"config_test": fals... |
"""Add 1"/hr over one day storms."""
import sys
import os
from datetime import date
from pyiem.util import get_dbconn
from pyiem.dep import read_cli
from pandas.io.sql import read_sql
from tqdm import tqdm
MYHUCS = [x.strip() for x in open("myhucs.txt")]
def do(origfn, scenario, numstorms):
"""Work we do."""
... | {
"repo_name": "akrherz/idep",
"path": "scripts/climatechange/addstorms_cli.py",
"copies": "2",
"size": "2708",
"license": "mit",
"hash": -5955747885565635000,
"line_mean": 29.7727272727,
"line_max": 77,
"alpha_frac": 0.5284342688,
"autogenerated": false,
"ratio": 3.5123216601815823,
"config_tes... |
"""Add 3 digit version of all 2 digit IRONMAN identifiers
Revision ID: 265e7dc4c1a5
Revises: 2e1421ac841a
Create Date: 2019-04-23 11:29:22.633160
"""
import re
from portal.database import db
from portal.models.identifier import Identifier
from portal.models.organization import OrganizationIdentifier
from portal.mode... | {
"repo_name": "uwcirg/true_nth_usa_portal",
"path": "portal/migrations/versions/265e7dc4c1a5_.py",
"copies": "1",
"size": "3066",
"license": "bsd-3-clause",
"hash": -3668357799552844000,
"line_mean": 33.4494382022,
"line_max": 76,
"alpha_frac": 0.6242661448,
"autogenerated": false,
"ratio": 3.757... |
"""Add 3DMark06 Result
Revision ID: ad580d7b4f2a
Revises: 0959737bcdfd
Create Date: 2016-10-23 13:47:14.849821
"""
# revision identifiers, used by Alembic.
revision = 'ad580d7b4f2a'
down_revision = '0959737bcdfd'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alem... | {
"repo_name": "rivalrockets/rivalrockets-api",
"path": "migrations/versions/ad580d7b4f2a_add_3dmark06_result.py",
"copies": "2",
"size": "2782",
"license": "mit",
"hash": -3837390896411258000,
"line_mean": 51.4905660377,
"line_max": 133,
"alpha_frac": 0.7221423436,
"autogenerated": false,
"ratio"... |
"""Add about_pages table
Revision ID: 4c236d4eac4
Revises: 55a2c1bad7
Create Date: 2015-04-22 23:45:51.210213
"""
# revision identifiers, used by Alembic.
revision = '4c236d4eac4'
down_revision = '55a2c1bad7'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'about_pages',... | {
"repo_name": "djds23/pygotham-1",
"path": "migrations/versions/4c236d4eac4_add_about_pages_table.py",
"copies": "3",
"size": "1086",
"license": "bsd-3-clause",
"hash": 4484492885169358300,
"line_mean": 27.5789473684,
"line_max": 75,
"alpha_frac": 0.6279926335,
"autogenerated": false,
"ratio": 3.... |
"""Add accepted_by_customer
Revision ID: 3183d344740d
Revises: 4190b0aefe23
Create Date: 2015-06-30 15:00:54.718273
"""
# revision identifiers, used by Alembic.
revision = '3183d344740d'
down_revision = '4190b0aefe23'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
old_opt... | {
"repo_name": "openmaraude/APITaxi_models",
"path": "APITaxi_models2/migrations/versions/20150630_15:00:54_3183d344740d_add_accepted_by_customer.py.py",
"copies": "4",
"size": "1109",
"license": "mit",
"hash": -9207266718272020000,
"line_mean": 27.4358974359,
"line_max": 99,
"alpha_frac": 0.684400360... |
"""Add Access logs table
Revision ID: 26cfd7b0439e
Revises: 6adeb5d3032e
Create Date: 2019-07-23 16:06:28.766128
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "26cfd7b0439e"
down_revision = "6adeb5d3032e"
branch_labels = None
depends_on = None
def upgrade()... | {
"repo_name": "psi4/mongo_qcdb",
"path": "qcfractal/alembic/versions/26cfd7b0439e_add_access_logs_table.py",
"copies": "2",
"size": "2411",
"license": "bsd-3-clause",
"hash": 6227631294846209000,
"line_mean": 43.6481481481,
"line_max": 100,
"alpha_frac": 0.669431771,
"autogenerated": false,
"rati... |
"""Add access_request table to manage requests to access datastores.
Revision ID: 5e4a03ef0bf0
Revises: 41f6a59a61f2
Create Date: 2016-09-09 17:39:57.846309
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5e4a03ef0bf0'
down_revision = 'b347b202819b'
def upgra... | {
"repo_name": "SingTel-DataCo/incubator-superset",
"path": "superset/migrations/versions/5e4a03ef0bf0_add_request_access_model.py",
"copies": "13",
"size": "1064",
"license": "apache-2.0",
"hash": -1270022737268020700,
"line_mean": 31.2424242424,
"line_max": 75,
"alpha_frac": 0.6588345865,
"autogen... |
"""add access tier to workspace
Revision ID: fc1eb86aa8f4
Revises: a2d41894a561
Create Date: 2021-06-22 13:26:42.138628
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from rdr_service.participant_enums import WorkbenchWorkspaceAccessTier
# revision identifiers, used by Alembic.
r... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/fc1eb86aa8f4_add_access_tier_to_workspace.py",
"copies": "1",
"size": "1517",
"license": "bsd-3-clause",
"hash": -8332885029408151000,
"line_mean": 26.5818181818,
"line_max": 150,
"alpha_frac": 0.70468029,
"autogen... |
"""add_accounts
Revision ID: 355b644453f9
Revises: e10a938e5801
Create Date: 2017-10-05 10:25:41.180601
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '355b644453f9'
down_revision = 'e10a938e5801'
branch_labels = None
depen... | {
"repo_name": "DavisPoGo/Monocle",
"path": "migrations/versions/355b644453f9_add_accounts.py",
"copies": "1",
"size": "2242",
"license": "mit",
"hash": 2806388094154781000,
"line_mean": 41.3018867925,
"line_max": 93,
"alpha_frac": 0.6846565566,
"autogenerated": false,
"ratio": 3.2777777777777777,... |
"""add account table
Revision ID: 4cc9c46f9d8b
Revises: 725816dc500
Create Date: 2014-07-23 16:01:47.462597
"""
# revision identifiers, used by Alembic.
revision = '4cc9c46f9d8b'
down_revision = '725816dc500'
import warnings
from alembic import op
import sqlalchemy as sa
from gertty.dbsupport import sqlite_alter_... | {
"repo_name": "aspiers/gertty",
"path": "gertty/alembic/versions/4cc9c46f9d8b_add_account_table.py",
"copies": "1",
"size": "2761",
"license": "apache-2.0",
"hash": 2283768518075008000,
"line_mean": 36.8219178082,
"line_max": 95,
"alpha_frac": 0.6468670771,
"autogenerated": false,
"ratio": 3.4086... |
"""Add ACL relationships
Revision ID: be32626451fb
Revises: None
Create Date: 2016-03-21 11:59:44.094720
Auto generated code by flask-migrate and Alembic.
"""
# This code is auto generated. Ignore linter errors.
# pylint: skip-file
# revision identifiers, used by Alembic.
revision = 'be32626451fb'
down_revision = No... | {
"repo_name": "google/timesketch",
"path": "timesketch/migrations/versions/be32626451fb_.py",
"copies": "1",
"size": "1600",
"license": "apache-2.0",
"hash": -5024000130520575000,
"line_mean": 40.0256410256,
"line_max": 103,
"alpha_frac": 0.709375,
"autogenerated": false,
"ratio": 3.3826638477801... |
"""Add a column
Revision ID: 37d1722a4621
Revises: None
Create Date: 2015-06-26 10:08:07.026259
"""
# revision identifiers, used by Alembic.
revision = '37d1722a4621'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('sites', sa.Column('redis', sa.DateTime))
def... | {
"repo_name": "rjdp/EE-dbmigrate",
"path": "alembic/versions/37d1722a4621_add_a_column.py",
"copies": "1",
"size": "4017",
"license": "mit",
"hash": -2799064995831511600,
"line_mean": 31.136,
"line_max": 91,
"alpha_frac": 0.6019417476,
"autogenerated": false,
"ratio": 3.0067365269461077,
"confi... |
"""add action description table
Revision ID: d09a5945e4a0
Revises: d098df6021e2
Create Date: 2017-07-13 20:33:01.473711
"""
from alembic import op
import oslo_db
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd09a5945e4a0'
down_revision = 'd098df6021e2'
def upgrade():
op.create_t... | {
"repo_name": "stackforge/watcher",
"path": "watcher/db/sqlalchemy/alembic/versions/d09a5945e4a0_add_action_description_table.py",
"copies": "2",
"size": "1076",
"license": "apache-2.0",
"hash": -633961439938958800,
"line_mean": 28.8888888889,
"line_max": 74,
"alpha_frac": 0.6542750929,
"autogenera... |
"""add action field to experiment_actions
Revision ID: ae72c799d321
Revises: da0fe56f616b
Create Date: 2016-07-24 13:00:06.432146
"""
# revision identifiers, used by Alembic.
revision = 'ae72c799d321'
down_revision = 'da0fe56f616b'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as s... | {
"repo_name": "c4fcm/CivilServant",
"path": "alembic/versions/ae72c799d321_add_action_field_to_experiment_actions.py",
"copies": "1",
"size": "2252",
"license": "mit",
"hash": -4793044192457673000,
"line_mean": 31.1714285714,
"line_max": 105,
"alpha_frac": 0.6896092362,
"autogenerated": false,
"r... |
"""add activation and expiration date columns to executive_compensation table
Revision ID: 427320dea2ab
Revises: 551a8e1cc551
Create Date: 2017-07-10 14:00:30.273558
"""
# revision identifiers, used by Alembic.
revision = '427320dea2ab'
down_revision = '551a8e1cc551'
branch_labels = None
depends_on = None
from alem... | {
"repo_name": "fedspendingtransparency/data-act-broker-backend",
"path": "dataactcore/migrations/versions/427320dea2ab_add_activation_and_expiration_date_.py",
"copies": "1",
"size": "1092",
"license": "cc0-1.0",
"hash": -5411111967507352000,
"line_mean": 25,
"line_max": 99,
"alpha_frac": 0.708791208... |
"""Add Active translation users
Revision ID: 2a68ba66c32b
Revises: 4148c3cb14ad
Create Date: 2015-04-27 13:32:26.521250
"""
# revision identifiers, used by Alembic.
revision = '2a68ba66c32b'
down_revision = '4148c3cb14ad'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generate... | {
"repo_name": "porduna/appcomposer",
"path": "alembic/versions/2a68ba66c32b_add_active_translation_users.py",
"copies": "3",
"size": "1251",
"license": "bsd-2-clause",
"hash": 6824805748001724000,
"line_mean": 33.75,
"line_max": 130,
"alpha_frac": 0.7114308553,
"autogenerated": false,
"ratio": 3.... |
"""Add activity tables
Revision ID: 19f590834366
Revises: 43cda5e14cf0
Create Date: 2012-11-14 23:31:56.202053
"""
# revision identifiers, used by Alembic.
revision = '19f590834366'
down_revision = '43cda5e14cf0'
from alembic import op
import sqlalchemy as db
def upgrade():
op.create_table('activities',
... | {
"repo_name": "chenmingd/ScriptFan.com",
"path": "website/migrate/versions/19f590834366_add_activity_tables.py",
"copies": "2",
"size": "3285",
"license": "bsd-3-clause",
"hash": -8184891875619499000,
"line_mean": 39.0609756098,
"line_max": 95,
"alpha_frac": 0.6347031963,
"autogenerated": false,
... |
"""add additional fields to capture sample family Id and disposed status
Revision ID: 1e944af3ad04
Revises: 041fdb188c55
Create Date: 2018-12-31 11:10:25.824690
"""
import model.utils
import sqlalchemy as sa
from alembic import op
from rdr_service.participant_enums import SampleStatus
# revision identifiers, used b... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/1e944af3ad04_da_814_added_additional_fields_to_.py",
"copies": "1",
"size": "1583",
"license": "bsd-3-clause",
"hash": 2558314855798292500,
"line_mean": 28.3148148148,
"line_max": 110,
"alpha_frac": 0.6910928617,
"... |
"""Add additional year to the climate files
python add_new_year.py <scenario> <year_to_add>
The previous year is choosen based on if the year to add is a leap year or not,
if it is, then pick a year four years ago, if it isn't, use last year
"""
import glob
import sys
import os
import subprocess
from tqdm import... | {
"repo_name": "akrherz/idep",
"path": "scripts/cligen/add_new_year.py",
"copies": "2",
"size": "2610",
"license": "mit",
"hash": -177412779348833500,
"line_mean": 30.4457831325,
"line_max": 79,
"alpha_frac": 0.6042145594,
"autogenerated": false,
"ratio": 3.2954545454545454,
"config_test": false... |
"""Add address relation
Revision ID: ff700db83195
Revises: f85ef1ef556c
Create Date: 2019-10-03 19:15:55.716640
"""
from typing import List, Callable
import sqlalchemy as sa
from alembic import op
from sqlalchemy import orm
from sqlalchemy.orm import declarative_base
# revision identifiers, used by Alembic.
revisi... | {
"repo_name": "agdsn/pycroft",
"path": "pycroft/model/alembic/versions/ff700db83195_add_address_relation.py",
"copies": "1",
"size": "8146",
"license": "apache-2.0",
"hash": -4867022263849872000,
"line_mean": 33.6340425532,
"line_max": 97,
"alpha_frac": 0.6434451407,
"autogenerated": false,
"rati... |
"""Add Admin role.
Revision ID: 3be0d9d2c9f8
Revises: 3148b80be376
Create Date: 2013-10-05 14:07:22.359908
"""
# revision identifiers, used by Alembic.
revision = '3be0d9d2c9f8'
down_revision = '3148b80be376'
import json
import sqlalchemy as sa
from alembic import op
from datetime import datetime
from sqlalchemy.sq... | {
"repo_name": "vladan-m/ggrc-core",
"path": "src/ggrc_basic_permissions/migrations/versions/20131005140722_3be0d9d2c9f8_add_admin_role.py",
"copies": "2",
"size": "1994",
"license": "apache-2.0",
"hash": -1588333283341607700,
"line_mean": 26.6944444444,
"line_max": 75,
"alpha_frac": 0.646439318,
"a... |
"""Add a flag to pause and wait for all Travis jobs to complete."""
from __future__ import print_function
import os
import sys
import json
import time
from tox.config import _split_env as split_env
try:
import urllib.request as urllib2
except ImportError:
import urllib2 # Python 2
from .utils import TRAVIS_F... | {
"repo_name": "tox-dev/tox-travis",
"path": "src/tox_travis/after.py",
"copies": "2",
"size": "5104",
"license": "mit",
"hash": -8898074917901155000,
"line_mean": 33.7210884354,
"line_max": 79,
"alpha_frac": 0.6291144201,
"autogenerated": false,
"ratio": 3.6798846431146357,
"config_test": false... |
"""Add a fun 'group 8 ball' command."""
import random
import re
from plumeria.command import commands, channel_only, CommandError
from plumeria.core.activity import tracker
from plumeria.transport.status import ONLINE
# maximum number of users if we don't have a list of recent chatters
MAX_USERS = 10
def map_choic... | {
"repo_name": "sk89q/Plumeria",
"path": "orchard/group_prob.py",
"copies": "1",
"size": "2156",
"license": "mit",
"hash": -5929352779811134000,
"line_mean": 29.8,
"line_max": 112,
"alpha_frac": 0.603432282,
"autogenerated": false,
"ratio": 3.7495652173913046,
"config_test": false,
"has_no_key... |
"""Add age and disabled columns to category table
Revision ID: 2eb054267c19
Revises: 1145cc4ac43b
Create Date: 2015-02-01 20:37:41.995995
"""
# revision identifiers, used by Alembic.
revision = '2eb054267c19'
down_revision = '1145cc4ac43b'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import ta... | {
"repo_name": "jlutz777/FreeStore",
"path": "alembic/versions/2eb054267c19_add_age_and_disabled_columns_to_.py",
"copies": "1",
"size": "2229",
"license": "mit",
"hash": 6362944066433224000,
"line_mean": 31.3043478261,
"line_max": 72,
"alpha_frac": 0.6114849708,
"autogenerated": false,
"ratio": 3... |
"""Add agency name and sub-tier agency name to published award financial assistance
Revision ID: 5664b0e3e179
Revises: ce1087583081
Create Date: 2017-05-19 02:47:18.081619
"""
# revision identifiers, used by Alembic.
revision = '5664b0e3e179'
down_revision = 'ce1087583081'
branch_labels = None
depends_on = None
fro... | {
"repo_name": "fedspendingtransparency/data-act-broker-backend",
"path": "dataactcore/migrations/versions/5664b0e3e179_add_agency_name_and_sub_tier_agency_.py",
"copies": "1",
"size": "1469",
"license": "cc0-1.0",
"hash": -6512015536320690000,
"line_mean": 34.8292682927,
"line_max": 124,
"alpha_frac"... |
"""Add agency_type to SQS and FileRequest tables
Revision ID: a9b778fd5181
Revises: c7da6e4c9b8a
Create Date: 2018-08-22 11:07:57.731050
"""
# revision identifiers, used by Alembic.
revision = 'a9b778fd5181'
down_revision = 'c7da6e4c9b8a'
branch_labels = None
depends_on = None
from alembic import op
import sqlalche... | {
"repo_name": "fedspendingtransparency/data-act-broker-backend",
"path": "dataactcore/migrations/versions/a9b778fd5181_add_agency_type_to_sqs_and_filerequest_.py",
"copies": "1",
"size": "1761",
"license": "cc0-1.0",
"hash": 7032322507280407000,
"line_mean": 30.4464285714,
"line_max": 154,
"alpha_fra... |
"""Add a genome to an existing (genomeless) panel report.
"""
import os
import json
import requests
from requests.auth import HTTPBasicAuth
import sys
import argparse
# Load environment variables for request authentication parameters
if "FABRIC_API_PASSWORD" not in os.environ:
sys.exit("FABRIC_API_PASSWORD enviro... | {
"repo_name": "Omicia/omicia_api_examples",
"path": "python/ClinicalReportLaunchers/upload_genome_to_panel_report.py",
"copies": "1",
"size": "6649",
"license": "mit",
"hash": -8974043081047927000,
"line_mean": 42.7434210526,
"line_max": 116,
"alpha_frac": 0.5391788239,
"autogenerated": false,
"r... |
"Add a label to all publications having other label(s). Both must exist."
from publications import utils
from publications.publication import PublicationSaver
qualifier_lookup = {'Collaborative': 3,
'Technology development': 2,
'Service': 1}
def add_label(db, new_label, exist... | {
"repo_name": "pekrau/Publications",
"path": "publications/scripts/add_label.py",
"copies": "1",
"size": "2359",
"license": "mit",
"hash": -2739431958648613000,
"line_mean": 39.6724137931,
"line_max": 73,
"alpha_frac": 0.5731242052,
"autogenerated": false,
"ratio": 4.2428057553956835,
"config_t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.