text stringlengths 0 1.05M | meta dict |
|---|---|
"""Add response table
Revision ID: 2527acb7f3eb
Revises: 50d3cad50bb8
Create Date: 2013-09-13 20:11:17.840269
"""
# revision identifiers, used by Alembic.
revision = '2527acb7f3eb'
down_revision = '50d3cad50bb8'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('responses',
sa.C... | {
"repo_name": "vladan-m/ggrc-core",
"path": "src/ggrc/migrations/versions/20130913201117_2527acb7f3eb_add_response_table.py",
"copies": "2",
"size": "2422",
"license": "apache-2.0",
"hash": -4866437537746364000,
"line_mean": 42.25,
"line_max": 110,
"alpha_frac": 0.6754748142,
"autogenerated": false... |
ADDRESS = '127.0.0.1'
PORT = 8700
import os
os.environ["SEAMLESS_COMMUNION_ID"] = "jobmaster-service"
os.environ["SEAMLESS_COMMUNION_OUTGOING"] = "8600"
import seamless
seamless.set_ncores(0)
from seamless import communion_server
communion_server.configure_master(
buffer=True,
buffer_status=True,
transfor... | {
"repo_name": "sjdv1982/seamless",
"path": "scripts/color-graph-service.py",
"copies": "1",
"size": "1747",
"license": "mit",
"hash": -2424835789730155000,
"line_mean": 23.2638888889,
"line_max": 62,
"alpha_frac": 0.6433886663,
"autogenerated": false,
"ratio": 3.385658914728682,
"config_test": ... |
#Address Book creator
#Ask user for whether they are looking up a contact or if they're adding a new contact
import time
import sys
choice = input("Enter 'looking for a contact' to search for a contact or Enter 'New contact' to add a new contact. Enter 'Exit' to exit.\n").lower()
while choice not in ["looking for ... | {
"repo_name": "Vite94/pythondepo",
"path": "Address _Book.py",
"copies": "1",
"size": "6490",
"license": "mit",
"hash": 2833017906339489000,
"line_mean": 59.8095238095,
"line_max": 182,
"alpha_frac": 0.5334360555,
"autogenerated": false,
"ratio": 4.110196326789107,
"config_test": false,
"has_... |
"""addressbook 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... | {
"repo_name": "mauerbac/addressbook",
"path": "addressbook/urls.py",
"copies": "1",
"size": "1347",
"license": "mit",
"hash": -6591887206096219000,
"line_mean": 37.4857142857,
"line_max": 83,
"alpha_frac": 0.6636971047,
"autogenerated": false,
"ratio": 3.427480916030534,
"config_test": false,
... |
"""Address module
Address data lives in the 'addresses' table. Several entities link
to address via foreign keys.
"""
from sqlalchemy.dialects.postgresql import ENUM
from ..database import db
address_type = ENUM('postal', 'physical', 'both', name='address_type',
create_type=False)
address_use =... | {
"repo_name": "uwcirg/true_nth_usa_portal",
"path": "portal/models/address.py",
"copies": "1",
"size": "2384",
"license": "bsd-3-clause",
"hash": 2947297204266540000,
"line_mean": 31.2162162162,
"line_max": 78,
"alpha_frac": 0.5318791946,
"autogenerated": false,
"ratio": 3.495601173020528,
"con... |
# Address monitor
from picshell.engine.util.Format import Format
import wx.lib.newevent
import wx
class UpDownCounter:
def __init__(self,ui,address,selectBit,incBit,upDownBit,max,name="",csBar=False):
self.address = Format.toNumber(address)
self.ui = ui
self.selectBit =... | {
"repo_name": "sirloon/jaluino",
"path": "ide/plugins/JaluinoDebugger/picshell/ui/debug/comp/Counter.py",
"copies": "1",
"size": "1930",
"license": "bsd-3-clause",
"hash": -6429332897391366000,
"line_mean": 27.2727272727,
"line_max": 84,
"alpha_frac": 0.5041450777,
"autogenerated": false,
"ratio"... |
# Address monitor
import wx
import wx.lib.newevent
from wx import gizmos
from picshell.engine.util.Format import Format
class Dual7Seg:
def __init__(self,ui,address,razBit,uniteeBit,deciBit,name=""):
self.address = Format.toNumber(address)
self.ui = ui
self.unitee=0;
... | {
"repo_name": "sirloon/jaluino",
"path": "ide/plugins/JaluinoDebugger/picshell/ui/debug/comp/Dual7Seg.py",
"copies": "1",
"size": "2074",
"license": "bsd-3-clause",
"hash": -3802446014534816300,
"line_mean": 27.6285714286,
"line_max": 69,
"alpha_frac": 0.5226615236,
"autogenerated": false,
"ratio... |
# Address monitor
import wx
from picshell.engine.util.Format import Format
class Dual7Seg:
def __init__(self,ui,address,razBit,uniteeBit,deciBit,name=""):
self.address = Format.toNumber(address)
self.ui = ui
self.unitee=0;
self.deci=0;
self.oldIncUnitee = 0
... | {
"repo_name": "sirloon/jaluino",
"path": "ide/plugins/JaluinoDebugger/picshell/ui/debug/comp/SevenSegment.py",
"copies": "1",
"size": "1457",
"license": "bsd-3-clause",
"hash": -4541048091560956400,
"line_mean": 27.7755102041,
"line_max": 66,
"alpha_frac": 0.5161290323,
"autogenerated": false,
"r... |
# Address monitor
from picshell.engine.util.Format import Format
from picshell.engine.util import BitUtil
import wx.lib.newevent
import wx
class LCD :
# http://www.doc.ic.ac.uk/~ih/doc/lcd/initiali.html
# http://www.myke.com/lcd.htm
# Taken from bert's lcd jal lib
#
#clea... | {
"repo_name": "sirloon/jaluino",
"path": "ide/plugins/JaluinoDebugger/picshell/ui/debug/comp/LCD.py",
"copies": "1",
"size": "6410",
"license": "bsd-3-clause",
"hash": -1592823929043019500,
"line_mean": 37.5679012346,
"line_max": 103,
"alpha_frac": 0.388299532,
"autogenerated": false,
"ratio": 4.... |
# Address utilities
from __future__ import absolute_import
import re
from .crypto import (
sha3,
)
from .encoding import (
encode_hex,
)
from .string import (
force_text,
coerce_args_to_text,
coerce_return_to_text,
)
from .types import (
is_string,
)
from .formatting import (
add_0x_prefix... | {
"repo_name": "shravan-shandilya/web3.py",
"path": "web3/utils/address.py",
"copies": "1",
"size": "2834",
"license": "mit",
"hash": -3592311787607494700,
"line_mean": 22.2295081967,
"line_max": 95,
"alpha_frac": 0.6235003529,
"autogenerated": false,
"ratio": 3.481572481572482,
"config_test": f... |
"""Add restricted theme
Revision ID: 1d5d4abfebd1
Revises: 54645a535ad6
Create Date: 2014-11-25 16:51:51.567026
"""
# revision identifiers, used by Alembic.
revision = '1d5d4abfebd1'
down_revision = '54645a535ad6'
from alembic import op, context
from sqlalchemy import Column, ForeignKey
from sqlalchemy.types import... | {
"repo_name": "tsauerwein/c2cgeoportal",
"path": "c2cgeoportal/scaffolds/update/CONST_alembic/versions/1d5d4abfebd1_add_restricted_theme.py",
"copies": "2",
"size": "1218",
"license": "bsd-2-clause",
"hash": 702936470458691300,
"line_mean": 25.4782608696,
"line_max": 83,
"alpha_frac": 0.6543513957,
... |
"""Add resumes.
Revision ID: e7410a32fd81
Revises: 4453e9c3a9be
Create Date: 2018-01-17 11:49:53.974612
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e7410a32fd81'
down_revision = '4453e9c3a9be'
branch_labels = None
depends_on = None
def upgrade():
# #... | {
"repo_name": "saseumn/website",
"path": "migrations/versions/e7410a32fd81_.py",
"copies": "1",
"size": "1218",
"license": "mit",
"hash": 9013851385332065000,
"line_mean": 28,
"line_max": 65,
"alpha_frac": 0.6666666667,
"autogenerated": false,
"ratio": 3.3278688524590163,
"config_test": false,
... |
"""add reviewRequested to workspace table
Revision ID: 98595efd597e
Revises: 9bde0801927b
Create Date: 2020-04-06 15:31:13.382126
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '98595efd597e'
down_revision = '9bde0801927b'
branch_labels = None
depends_on = None... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/98595efd597e_add_reviewrequested_to_workspace_table.py",
"copies": "1",
"size": "1331",
"license": "bsd-3-clause",
"hash": 3224335975592063000,
"line_mean": 25.0980392157,
"line_max": 108,
"alpha_frac": 0.6799398948,... |
"""add_roach_temp_table
Revision ID: f29adafca107
Revises: 38aa03a7c923
Create Date: 2017-12-09 19:59:50.058296+00:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f29adafca107'
down_revision = '64bc793c6237'
branch_labels = None
depends_on = None
def upgr... | {
"repo_name": "HERA-Team/Monitor_and_Control",
"path": "alembic/versions/f29adafca107_add_roach_temp_table.py",
"copies": "2",
"size": "1068",
"license": "bsd-2-clause",
"hash": -2554360161644391400,
"line_mean": 27.8648648649,
"line_max": 65,
"alpha_frac": 0.670411985,
"autogenerated": false,
"r... |
"""Add role column to groups_tenants_table
Revision ID: 7aae863786af
Revises: 406821843b55
Create Date: 2017-10-04 11:10:48.227654
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7aae863786af'
down_revision = '406821843b55'
branch_labels = None
depends_on = No... | {
"repo_name": "cloudify-cosmo/cloudify-manager",
"path": "resources/rest-service/cloudify/migrations/versions/7aae863786af_add_role_column_groups_tenants_table.py",
"copies": "1",
"size": "1645",
"license": "apache-2.0",
"hash": -965583712299888800,
"line_mean": 23.1911764706,
"line_max": 64,
"alpha_... |
"""Add role column to users_tenants table
Revision ID: 406821843b55
Revises: 3496c876cd1a
Create Date: 2017-10-01 19:37:31.484983
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '406821843b55'
down_revision = '4dfd8797fdfa'
branch_labels = None
depends_on = None
... | {
"repo_name": "cloudify-cosmo/cloudify-manager",
"path": "resources/rest-service/cloudify/migrations/versions/406821843b55_add_role_column_to_users_tenants_table.py",
"copies": "1",
"size": "2787",
"license": "apache-2.0",
"hash": 4767588812979075000,
"line_mean": 24.3363636364,
"line_max": 79,
"alph... |
"""Add roles and role implications for gdrive connectors
Revision ID: 24c56d737c18
Revises: 18bf74925b9
Create Date: 2013-11-22 00:10:39.635553
"""
# revision identifiers, used by Alembic.
revision = '24c56d737c18'
down_revision = '18bf74925b9'
import sqlalchemy as sa
from alembic import op
from datetime import dat... | {
"repo_name": "uskudnik/ggrc-core",
"path": "src/ggrc_basic_permissions/migrations/versions/20131122001039_24c56d737c18_add_roles_and_role_i.py",
"copies": "2",
"size": "2368",
"license": "apache-2.0",
"hash": 8949674108140033000,
"line_mean": 31.8888888889,
"line_max": 103,
"alpha_frac": 0.659206081... |
"""Add role seed data for flask-security
Revision ID: 7b2d863b105
Revises: 2a3fee7de8d4
Create Date: 2015-07-02 10:48:35.805882
"""
# revision identifiers, used by Alembic.
revision = '7b2d863b105'
down_revision = '2a3fee7de8d4'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto g... | {
"repo_name": "betterlife/psi",
"path": "psi/migrations/versions/05_7b2d863b105_.py",
"copies": "2",
"size": "4346",
"license": "mit",
"hash": -4404478219019477000,
"line_mean": 56.1842105263,
"line_max": 95,
"alpha_frac": 0.5959502991,
"autogenerated": false,
"ratio": 3.5828524319868094,
"conf... |
"""Add RoleState table.
Revision ID: e86b741dc3fc
Revises: b68e0d8ed9fe
Create Date: 2017-02-04 14:47:51.072291
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'e86b741dc3fc'
down_revision = 'b68e0d8ed9fe'
branch_labels... | {
"repo_name": "MJB47/Jokusoramame",
"path": "migrations/versions/e86b741dc3fc_add_rolestate_table.py",
"copies": "1",
"size": "1036",
"license": "mit",
"hash": -5190973541077401000,
"line_mean": 27.7777777778,
"line_max": 70,
"alpha_frac": 0.6785714286,
"autogenerated": false,
"ratio": 3.35275080... |
"""add rollouts
Revision ID: e9288c901c60
Revises: 3b0eac21d779
Create Date: 2019-05-20 09:54:52.711057
"""
# revision identifiers, used by Alembic.
revision = 'e9288c901c60'
down_revision = '3b0eac21d779'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects... | {
"repo_name": "CanopyTax/toggle-meister",
"path": "migrations/versions/e9288c901c60_add_rollouts.py",
"copies": "1",
"size": "1913",
"license": "apache-2.0",
"hash": 7916422713842947000,
"line_mean": 39.7021276596,
"line_max": 99,
"alpha_frac": 0.645060115,
"autogenerated": false,
"ratio": 3.2368... |
"""Add room features
Revision ID: 7e03b2262e9e
Revises: 868c04697dd7
Create Date: 2018-10-26 13:22:27.627996
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '7e03b2262e9e'
down_revision = '868c04697dd7'
branch_labels = None
depends_on = None
def upgrade():
... | {
"repo_name": "indico/indico",
"path": "indico/migrations/versions/20181026_1322_7e03b2262e9e_add_room_features.py",
"copies": "7",
"size": "1299",
"license": "mit",
"hash": 1842048663026054400,
"line_mean": 29.9285714286,
"line_max": 86,
"alpha_frac": 0.6643571978,
"autogenerated": false,
"ratio... |
"""Add Room.notification_emails column
Revision ID: fe73a07da0b4
Revises: 3e4a0c08eae6
Create Date: 2019-03-19 17:28:46.354942
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'fe73a07da0b4'
down_revision = '3e4a0c08eae... | {
"repo_name": "ThiefMaster/indico",
"path": "indico/migrations/versions/20190319_1728_fe73a07da0b4_add_room_notification_emails_column.py",
"copies": "7",
"size": "2039",
"license": "mit",
"hash": -6440591727876420000,
"line_mean": 36.7592592593,
"line_max": 115,
"alpha_frac": 0.6449239823,
"autoge... |
"""Add room principals table
Revision ID: cbe630695800
Revises: 252c0015c9a0
Create Date: 2018-12-13 11:10:12.684382
"""
from __future__ import print_function
import json
import sqlalchemy as sa
from alembic import context, op
from sqlalchemy.dialects import postgresql
from indico.core.auth import multipass
from i... | {
"repo_name": "OmeGak/indico",
"path": "indico/migrations/versions/20181213_1110_cbe630695800_add_room_principals_table.py",
"copies": "3",
"size": "11259",
"license": "mit",
"hash": -1735228198831489500,
"line_mean": 51.6121495327,
"line_max": 120,
"alpha_frac": 0.620303757,
"autogenerated": false... |
"""Add room principals table
Revision ID: cbe630695800
Revises: 252c0015c9a0
Create Date: 2018-12-13 11:10:12.684382
"""
import json
import sqlalchemy as sa
from alembic import context, op
from sqlalchemy.dialects import postgresql
from indico.core.auth import multipass
from indico.core.db.sqlalchemy import PyIntE... | {
"repo_name": "indico/indico",
"path": "indico/migrations/versions/20181213_1110_cbe630695800_add_room_principals_table.py",
"copies": "4",
"size": "11530",
"license": "mit",
"hash": 6371399686940524000,
"line_mean": 50.2444444444,
"line_max": 120,
"alpha_frac": 0.6202948829,
"autogenerated": false... |
"""Add rss bits!
Revision ID: 34f427187628
Revises: b88c4e0d8ed4
Create Date: 2017-02-27 02:45:31.776790
"""
# revision identifiers, used by Alembic.
revision = '34f427187628'
down_revision = 'b88c4e0d8ed4'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy_utils.... | {
"repo_name": "fake-name/ReadableWebProxy",
"path": "alembic/versions/00026_34f427187628_add_rss_bits.py",
"copies": "1",
"size": "7058",
"license": "bsd-3-clause",
"hash": -3768902020650808000,
"line_mean": 59.8448275862,
"line_max": 157,
"alpha_frac": 0.7111079626,
"autogenerated": false,
"rati... |
"""Add RTPLaunchRecord table
Revision ID: bad90ab035ba
Revises: 77c082c87844
Create Date: 2021-03-08 19:16:44.611253+00:00
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "bad90ab035ba"
down_revision = "77c082c87844"
br... | {
"repo_name": "HERA-Team/hera_mc",
"path": "alembic/versions/bad90ab035ba_add_rtplaunchrecord_table.py",
"copies": "1",
"size": "1092",
"license": "bsd-2-clause",
"hash": 3032425211695831600,
"line_mean": 27.7368421053,
"line_max": 69,
"alpha_frac": 0.6575091575,
"autogenerated": false,
"ratio": ... |
"""Add rtp_task_resource_record table
Revision ID: 3d3c72ecbc0d
Revises: c9a1ff35c6ed
Create Date: 2018-01-20 21:35:16.716477+00:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3d3c72ecbc0d'
down_revision = 'c9a1ff35c6ed'
branch_labels = None
depends_on = N... | {
"repo_name": "HERA-Team/Monitor_and_Control",
"path": "alembic/versions/3d3c72ecbc0d_add_rtp_task_resource_record_table.py",
"copies": "2",
"size": "1123",
"license": "bsd-2-clause",
"hash": -7458420873891244000,
"line_mean": 29.3513513514,
"line_max": 65,
"alpha_frac": 0.6758682102,
"autogenerate... |
"""add_rtp_tracking_tables
Revision ID: bb6db4d3fee6
Revises: 77c082c87844
Create Date: 2021-02-18 21:10:33.076138+00:00
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'bb6db4d3fee6'
down_revision = 'bad90ab035ba'
bran... | {
"repo_name": "HERA-Team/hera_mc",
"path": "alembic/versions/bb6db4d3fee6_add_rtp_tracking_tables.py",
"copies": "1",
"size": "2508",
"license": "bsd-2-clause",
"hash": 6300514259796285000,
"line_mean": 38.1875,
"line_max": 73,
"alpha_frac": 0.6403508772,
"autogenerated": false,
"ratio": 3.282722... |
"""Add rule table to configure rules and alerts.
Revision ID: fd28e46e46a6
Revises: d2b00dd93241
Create Date: 2016-05-02 17:46:46.658227
"""
# revision identifiers, used by Alembic.
revision = 'fd28e46e46a6'
down_revision = 'd2b00dd93241'
from alembic import op
import sqlalchemy as sa
import doorman.database
from s... | {
"repo_name": "mwielgoszewski/doorman",
"path": "migrations/versions/fd28e46e46a6_.py",
"copies": "1",
"size": "1147",
"license": "mit",
"hash": 5240756503258983000,
"line_mean": 30.8611111111,
"line_max": 98,
"alpha_frac": 0.6904969486,
"autogenerated": false,
"ratio": 3.4444444444444446,
"con... |
"""addRuleTiming
Revision ID: e4d26a4b740e
Revises: 77ce67003a95
Create Date: 2016-03-24 14:24:55.778000
"""
# revision identifiers, used by Alembic.
revision = 'e4d26a4b740e'
down_revision = '77ce67003a95'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engine_nam... | {
"repo_name": "fedspendingtransparency/data-act-validator",
"path": "dataactvalidator/migrations/versions/e4d26a4b740e_addruletiming.py",
"copies": "1",
"size": "1269",
"license": "cc0-1.0",
"hash": 2777950557507053600,
"line_mean": 27.8409090909,
"line_max": 94,
"alpha_frac": 0.6753349094,
"autoge... |
"""Adds a backend for storing documents as flat files.
To use add this to settings.local:
NORMALIZED_PROCESSING = ['storage']
RAW_PROCESSING = ['storage']
"""
import os
import copy
import json
from scrapi.processing.base import BaseProcessor
class StorageProcessor(BaseProcessor):
NAME = 'storage'
... | {
"repo_name": "icereval/scrapi",
"path": "scrapi/processing/storage.py",
"copies": "1",
"size": "1173",
"license": "apache-2.0",
"hash": -2513332523352699400,
"line_mean": 30.7027027027,
"line_max": 103,
"alpha_frac": 0.6359761296,
"autogenerated": false,
"ratio": 3.723809523809524,
"config_tes... |
"""Adds a backend for storing documents as flat files.
To use add this to settings.local:
NORMALIZED_PROCESSING = ['storage']
RAW_PROCESSING = ['storage']
"""
import os
import json
from scrapi.util import json_without_bytes
from scrapi.processing.base import BaseProcessor
from .postgres import HarvesterRes... | {
"repo_name": "CenterForOpenScience/scrapi",
"path": "scrapi/processing/storage.py",
"copies": "1",
"size": "1287",
"license": "apache-2.0",
"hash": -1998086297258879700,
"line_mean": 27.6,
"line_max": 84,
"alpha_frac": 0.6837606838,
"autogenerated": false,
"ratio": 3.9722222222222223,
"config_... |
"""Adds account to a project"""
from baseCmd import *
from baseResponse import *
class addAccountToProjectCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""ID of the project to add the account to"""
"""Required"""
self.projectid = None
self.type... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/addAccountToProject.py",
"copies": "1",
"size": "1031",
"license": "apache-2.0",
"hash": 6376106598097270000,
"line_mean": 29.3235294118,
"line_max": 74,
"alpha_frac": 0.6023278371,
"autogenerated": false,
"ratio": 4.19105... |
"""Adds a chook to a git repository.
Usage:
chooks add [--stdin | --argument] [--once | --filter=FILTER...] [--global]
[--fatal] [--hook=NAME...] [--name=NAME] [--disabled]
[--] <command> [<args>...]
Options:
--stdin Supply input files to this chook via stdin.
--filter=<filt... | {
"repo_name": "thegedge/chooks",
"path": "chooks/commands/add.py",
"copies": "1",
"size": "1970",
"license": "mit",
"hash": -4633034512226892000,
"line_mean": 38.4,
"line_max": 79,
"alpha_frac": 0.5934010152,
"autogenerated": false,
"ratio": 3.995943204868154,
"config_test": false,
"has_no_ke... |
"""Adds a directory to sys.path, permanently.
"""
import sys
import os
import site
HEADER = """\
# .pth file created by the pypath script.
# edit at your own risk
"""
SITEDIR = site.getusersitepackages()
PATH = os.path.join(SITEDIR, "pypath.pth")
if not os.path.exists(SITEDIR):
os.mkdirs(SITEDIR)
def add(pat... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578043_Script_that_Adds_Directory_syspath/recipe-578043.py",
"copies": "1",
"size": "2290",
"license": "mit",
"hash": -7103668853676106000,
"line_mean": 25.0227272727,
"line_max": 73,
"alpha_frac": 0.5794759825,
"autogenerated": false,
"ra... |
"""Adds a distinct vulnerbility table column for keeping track of the initial review_feedback reviewer.
Revision ID: c10e1faccb1c
Revises: fb11cb6a2398
Create Date: 2020-10-03 09:50:58.363062
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "c10e1faccb1c"
down_r... | {
"repo_name": "google/vulncode-db",
"path": "migrations/versions/c10e1faccb1c_adds_a_distinct_vulnerbility_table_.py",
"copies": "1",
"size": "1041",
"license": "apache-2.0",
"hash": 1216071739682578200,
"line_mean": 26.3947368421,
"line_max": 103,
"alpha_frac": 0.6666666667,
"autogenerated": false... |
"""Adds a empty protocols column to `base_result` and wavefunction to `result`
Revision ID: c194a8ef6acf
Revises: cc54842bb6ba
Create Date: 2019-09-30 10:31:23.552722
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "c19... | {
"repo_name": "psi4/DatenQM",
"path": "qcfractal/alembic/versions/c194a8ef6acf_protocols.py",
"copies": "2",
"size": "1081",
"license": "bsd-3-clause",
"hash": 5937581573691617000,
"line_mean": 32.78125,
"line_max": 112,
"alpha_frac": 0.7058279371,
"autogenerated": false,
"ratio": 3.4208860759493... |
"""Adds a few finishing touches to the IPHAS DR2 binary FITS catalogues.
It will add TDISP keywords, sanitise TUNIT keywords, add checksums,
and add origin information.
"""
import numpy as np
from astropy.io import fits
from astropy import log
def augment(filename_origin, filename_target):
log.info('Opening {0}'... | {
"repo_name": "barentsen/iphas-dr2",
"path": "scripts/release-preparation/augment-catalogue.py",
"copies": "1",
"size": "4349",
"license": "mit",
"hash": 1715670377547698000,
"line_mean": 43.3775510204,
"line_max": 91,
"alpha_frac": 0.4899977006,
"autogenerated": false,
"ratio": 2.922715053763441... |
# Adds a fourth 'name' column to the accessionid_to_taxonid.tsv table.
import argparse, csv
def get_accession_to_taxon(accessionfilename):
accession_to_taxon = {}
with open(accessionfilename, 'r') as afile:
i = 0
for line in afile:
fields = line.split('\t')
ncbi_id = fi... | {
"repo_name": "OpenTreeOfLife/reference-taxonomy",
"path": "import_scripts/silva/get_taxon_names.py",
"copies": "1",
"size": "2420",
"license": "bsd-2-clause",
"hash": -7662449143392651000,
"line_mean": 35.6666666667,
"line_max": 90,
"alpha_frac": 0.5404958678,
"autogenerated": false,
"ratio": 3.... |
"""Adds a guest OS name to hypervisor OS name mapping"""
from baseCmd import *
from baseResponse import *
class addGuestOsMappingCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""Hypervisor type. One of : XenServer, KVM"""
"""Required"""
self.hypervisor... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/addGuestOsMapping.py",
"copies": "1",
"size": "2158",
"license": "apache-2.0",
"hash": -3090484583819889700,
"line_mean": 36.8596491228,
"line_max": 96,
"alpha_frac": 0.6139944393,
"autogenerated": false,
"ratio": 4.206627... |
"""Adds a help webpage and query functions for commands."""
import collections
import io
from plumeria.command import commands
from plumeria.message import Response, MemoryAttachment
from plumeria.core.webserver import app, render_template
@commands.create('help', 'commands', category='Utility')
async def help(mes... | {
"repo_name": "sk89q/Plumeria",
"path": "plumeria/core/help.py",
"copies": "1",
"size": "2211",
"license": "mit",
"hash": 4285825018072487000,
"line_mean": 33.0153846154,
"line_max": 106,
"alpha_frac": 0.6824966079,
"autogenerated": false,
"ratio": 3.976618705035971,
"config_test": false,
"ha... |
"""Adds a list of files into the META-INF directory of the passed deploy jar.
"""
import argparse
from itertools import izip
import shutil
import zipfile
# Set to Jan 1 1980, the earliest date supported by zipfile
ZIP_DATE = (1980, 1, 1, 0, 0, 0)
parser = argparse.ArgumentParser()
parser.add_argument(
"--deploy... | {
"repo_name": "brendandouglas/intellij",
"path": "build_defs/package_meta_inf_files.py",
"copies": "1",
"size": "1026",
"license": "apache-2.0",
"hash": -78276815953253660,
"line_mean": 22.3181818182,
"line_max": 77,
"alpha_frac": 0.6608187135,
"autogenerated": false,
"ratio": 3.257142857142857,
... |
"""add_saliva_code
Revision ID: f098d2c51614
Revises: e26ea978c345
Create Date: 2018-04-10 11:55:36.406746
"""
import model.utils
import sqlalchemy as sa
from alembic import op
from rdr_service.participant_enums import OrderStatus, SampleStatus
# revision identifiers, used by Alembic.
revision = "f098d2c51614"
down... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/f098d2c51614_add_saliva_code.py",
"copies": "1",
"size": "1889",
"license": "bsd-3-clause",
"hash": 7622167912451686000,
"line_mean": 28.515625,
"line_max": 116,
"alpha_frac": 0.6829010058,
"autogenerated": false,
... |
"""Adds all Sphinx "objects" to the table of contents."""
from typing import Optional
import docutils.nodes
import sphinx.addnodes
import sphinx.application
import sphinx.environment.collectors.toctree
def _monkey_patch_toc_tree_process_doc(app: sphinx.application.Sphinx):
"""Enables support for also finding Sphi... | {
"repo_name": "google/tensorstore",
"path": "docs/tensorstore_sphinx_material/sphinx_material/object_toc.py",
"copies": "1",
"size": "5767",
"license": "apache-2.0",
"hash": -5586200962627016000,
"line_mean": 37.7046979866,
"line_max": 98,
"alpha_frac": 0.5867868909,
"autogenerated": false,
"rati... |
"""Add same_tool and tool_id
Revision ID: 16f121110a0f
Revises: 2c58f1b857f1
Create Date: 2015-11-09 12:28:43.019410
"""
# revision identifiers, used by Alembic.
revision = '16f121110a0f'
down_revision = '2c58f1b857f1'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated b... | {
"repo_name": "go-lab/appcomposer",
"path": "alembic/versions/16f121110a0f_add_same_tool_and_tool_id.py",
"copies": "3",
"size": "1266",
"license": "bsd-2-clause",
"hash": 657974739117903600,
"line_mean": 38.5625,
"line_max": 120,
"alpha_frac": 0.7353870458,
"autogenerated": false,
"ratio": 3.421... |
"""add sample and identifier history
Revision ID: b4f6eb55d503
Revises: 4aa79d5ac86e
Create Date: 2018-08-31 13:26:22.482944
"""
import model.utils
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "b4f6eb55d503"
down_revision = "4aa79d5ac86e"
branch_labels = None
dep... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/b4f6eb55d503_add_sample_and_identifier_history.py",
"copies": "1",
"size": "2374",
"license": "bsd-3-clause",
"hash": -604238389329764400,
"line_mean": 32.9142857143,
"line_max": 90,
"alpha_frac": 0.6575400168,
"au... |
"""Add sample groups
Revision ID: 1c15bafd311a
Revises: 52c2d8ff8e6f
Create Date: 2015-08-12 17:58:22.640975
"""
# revision identifiers, used by Alembic.
revision = '1c15bafd311a'
down_revision = '52c2d8ff8e6f'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembi... | {
"repo_name": "varda/varda",
"path": "alembic/versions/1c15bafd311a_add_sample_groups.py",
"copies": "1",
"size": "1107",
"license": "mit",
"hash": 7748948407039880000,
"line_mean": 27.3846153846,
"line_max": 77,
"alpha_frac": 0.6684733514,
"autogenerated": false,
"ratio": 3.3545454545454545,
"... |
"""add_sample_prep
Revision ID: 4e1a5a724f61
Revises: df29b42d614
Create Date: 2016-05-11 13:16:30.339670
"""
# revision identifiers, used by Alembic.
revision = '4e1a5a724f61'
down_revision = 'df29b42d614'
import sqlalchemy as sa
from alembic import op
def upgrade():
op.create_table('SamplePrepWorkerTbl',
... | {
"repo_name": "UManPychron/pychron",
"path": "alembic_dvc/versions/4e1a5a724f61_add_sample_prep.py",
"copies": "3",
"size": "2505",
"license": "apache-2.0",
"hash": -8451233955739186000,
"line_mean": 40.0655737705,
"line_max": 103,
"alpha_frac": 0.5385229541,
"autogenerated": false,
"ratio": 3.72... |
"""Adds an attachment to an existing ticket."""
# :license: MIT, see LICENSE for more details.
import os
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import helpers
@click.command()
@click.argument('identifier')
@click.option('--path', ... | {
"repo_name": "kyubifire/softlayer-python",
"path": "SoftLayer/CLI/ticket/upload.py",
"copies": "5",
"size": "1158",
"license": "mit",
"hash": 7784721970717351000,
"line_mean": 30.2972972973,
"line_max": 78,
"alpha_frac": 0.6614853195,
"autogenerated": false,
"ratio": 4.034843205574913,
"config... |
"""Adds a network serviceProvider to a physical network"""
from baseCmd import *
from baseResponse import *
class addNetworkServiceProviderCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""the name for the physical network service provider"""
"""Required"""
... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/addNetworkServiceProvider.py",
"copies": "1",
"size": "1973",
"license": "apache-2.0",
"hash": 8173339617989073000,
"line_mean": 36.2264150943,
"line_max": 91,
"alpha_frac": 0.6259503294,
"autogenerated": false,
"ratio": 4... |
"""Adds a new cluster"""
from baseCmd import *
from baseResponse import *
class addClusterCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "false"
"""the cluster name"""
"""Required"""
self.clustername = None
self.typeInfo['clustername'] = 'string'
... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/addCluster.py",
"copies": "1",
"size": "3800",
"license": "apache-2.0",
"hash": -400041690979819100,
"line_mean": 33.2342342342,
"line_max": 89,
"alpha_frac": 0.5618421053,
"autogenerated": false,
"ratio": 4.18041804180418... |
"""Adds a new host."""
from baseCmd import *
from baseResponse import *
class addHostCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "false"
"""hypervisor type of the host"""
"""Required"""
self.hypervisor = None
self.typeInfo['hypervisor'] = 'string'
... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/addHost.py",
"copies": "1",
"size": "9618",
"license": "apache-2.0",
"hash": -2644649808279163000,
"line_mean": 39.2426778243,
"line_max": 172,
"alpha_frac": 0.5829694323,
"autogenerated": false,
"ratio": 4.136774193548387... |
"""Adds a new HTTPS handler to urllib2, which uses the SSL library from Python 2.6."""
import logging
log = logging.getLogger('sslurllib')
import sys
# We only need this wrapper for Python versions < 2.6
# sys.hexversion is guaranteed to always increment
if sys.hexversion >= 0x020600F0:
runningPython26 = True
el... | {
"repo_name": "jordotech/satchmofork",
"path": "satchmo/apps/satchmo_utils/sslurllib.py",
"copies": "13",
"size": "2035",
"license": "bsd-3-clause",
"hash": -6917595699230877000,
"line_mean": 32.3606557377,
"line_max": 96,
"alpha_frac": 0.6314496314,
"autogenerated": false,
"ratio": 3.96686159844... |
"""Adds a new load_balancer service."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import loadbal
@click.command()
@click.argument('identifier')
@click.option('--allocation',
required=True,
type=cl... | {
"repo_name": "nanjj/softlayer-python",
"path": "SoftLayer/CLI/loadbal/group_add.py",
"copies": "5",
"size": "1257",
"license": "mit",
"hash": -6613113585282953000,
"line_mean": 29.6585365854,
"line_max": 73,
"alpha_frac": 0.599840891,
"autogenerated": false,
"ratio": 4.395104895104895,
"config... |
"""Adds a new load balancer service."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import loadbal
@click.command()
@click.argument('identifier')
@click.option('--enabled / --disabled',
required=True,
... | {
"repo_name": "skraghu/softlayer-python",
"path": "SoftLayer/CLI/loadbal/service_add.py",
"copies": "4",
"size": "1702",
"license": "mit",
"hash": -5545226448736186000,
"line_mean": 31.1132075472,
"line_max": 78,
"alpha_frac": 0.5904817861,
"autogenerated": false,
"ratio": 4.121065375302663,
"c... |
"""Adds a new load_balancer service."""
# :license: MIT, see LICENSE for more details.
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import loadbal
import click
@click.command()
@click.argument('identifier')
@click.option('--allocation',
required=True,
type=cl... | {
"repo_name": "iftekeriba/softlayer-python",
"path": "SoftLayer/CLI/loadbal/group_add.py",
"copies": "2",
"size": "1257",
"license": "mit",
"hash": -8290777336085122000,
"line_mean": 29.6585365854,
"line_max": 73,
"alpha_frac": 0.599840891,
"autogenerated": false,
"ratio": 4.395104895104895,
"c... |
"""Adds a new load balancer service."""
# :license: MIT, see LICENSE for more details.
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import loadbal
import click
@click.command()
@click.argument('identifier')
@click.option('--enabled / --disabled',
required=True,
... | {
"repo_name": "iftekeriba/softlayer-python",
"path": "SoftLayer/CLI/loadbal/service_add.py",
"copies": "2",
"size": "1701",
"license": "mit",
"hash": -5702753782360820000,
"line_mean": 31.0943396226,
"line_max": 78,
"alpha_frac": 0.5902410347,
"autogenerated": false,
"ratio": 4.11864406779661,
... |
"""Adds a new transaction summary table to reduce all time calculation times
Revision ID: 2b3b1f654b5
Revises: 53dcf1daebec
Create Date: 2014-07-07 19:25:17.114450
"""
# revision identifiers, used by Alembic.
revision = '2b3b1f654b5'
down_revision = '53dcf1daebec'
from alembic import op
import sqlalchemy as sa
de... | {
"repo_name": "simplecrypto/simplecoin",
"path": "migrations/versions/2b3b1f654b5_adds_a_new_transaction_summary_table_to_.py",
"copies": "1",
"size": "1151",
"license": "mit",
"hash": 8355419743709821000,
"line_mean": 31.8857142857,
"line_max": 86,
"alpha_frac": 0.6959165943,
"autogenerated": fals... |
"""Adds a Nicira NVP device"""
from baseCmd import *
from baseResponse import *
class addNiciraNvpDeviceCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""Hostname of ip address of the Nicira NVP Controller."""
"""Required"""
self.hostname = None
... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/addNiciraNvpDevice.py",
"copies": "1",
"size": "2286",
"license": "apache-2.0",
"hash": 3363061833845239000,
"line_mean": 35.8709677419,
"line_max": 104,
"alpha_frac": 0.6106736658,
"autogenerated": false,
"ratio": 4.14130... |
"""Add sanity check to tas
Revision ID: 9dded6e6bf79
Revises: 180c6e439a69
Create Date: 2016-11-02 17:34:03.314917
"""
# revision identifiers, used by Alembic.
revision = '9dded6e6bf79'
down_revision = '180c6e439a69'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade... | {
"repo_name": "fedspendingtransparency/data-act-broker-backend",
"path": "dataactcore/migrations/versions/9dded6e6bf79_add_sanity_check_to_tas.py",
"copies": "1",
"size": "1070",
"license": "cc0-1.0",
"hash": -6024681441434611000,
"line_mean": 25.75,
"line_max": 276,
"alpha_frac": 0.7028037383,
"au... |
"""Adds an update to an existing ticket."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import helpers
from SoftLayer.CLI import ticket
@click.command()
@click.argument('identifier')
@click.option('--body', help="Text to add t... | {
"repo_name": "allmightyspiff/softlayer-python",
"path": "SoftLayer/CLI/ticket/update.py",
"copies": "2",
"size": "1383",
"license": "mit",
"hash": -2641012299453345000,
"line_mean": 31.1627906977,
"line_max": 115,
"alpha_frac": 0.6876355748,
"autogenerated": false,
"ratio": 3.8739495798319328,
... |
"""adds a range of portable public IP's to a region"""
from baseCmd import *
from baseResponse import *
class createPortableIpRangeCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""the ending IP address in the portable IP range"""
"""Required"""
self.en... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/createPortableIpRange.py",
"copies": "1",
"size": "3169",
"license": "apache-2.0",
"hash": -2304959834246790400,
"line_mean": 35.4252873563,
"line_max": 106,
"alpha_frac": 0.5777847902,
"autogenerated": false,
"ratio": 4.1... |
"""Adds a Region"""
from baseCmd import *
from baseResponse import *
class addRegionCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "false"
"""Id of the Region"""
"""Required"""
self.id = None
self.typeInfo['id'] = 'integer'
"""Region service en... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/addRegion.py",
"copies": "1",
"size": "1358",
"license": "apache-2.0",
"hash": -6288617407236292000,
"line_mean": 29.1777777778,
"line_max": 76,
"alpha_frac": 0.5670103093,
"autogenerated": false,
"ratio": 4.12765957446808... |
"""Adds a simulated sensor."""
from datetime import datetime
import logging
import math
from random import Random
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpe... | {
"repo_name": "nkgilley/home-assistant",
"path": "homeassistant/components/simulated/sensor.py",
"copies": "10",
"size": "4609",
"license": "apache-2.0",
"hash": 2035162879398523400,
"line_mean": 28.9285714286,
"line_max": 84,
"alpha_frac": 0.6107615535,
"autogenerated": false,
"ratio": 3.6064162... |
"""Adds a simulated sensor."""
from datetime import datetime
import math
from random import Random
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity impor... | {
"repo_name": "mezz64/home-assistant",
"path": "homeassistant/components/simulated/sensor.py",
"copies": "9",
"size": "4535",
"license": "apache-2.0",
"hash": -8189537015309690000,
"line_mean": 29.2333333333,
"line_max": 84,
"alpha_frac": 0.6103638368,
"autogenerated": false,
"ratio": 3.599206349... |
"""Adds a simulated sensor."""
from datetime import datetime
import math
from random import Random
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
import homeassistant.util... | {
"repo_name": "kennedyshead/home-assistant",
"path": "homeassistant/components/simulated/sensor.py",
"copies": "5",
"size": "4506",
"license": "apache-2.0",
"hash": 8812218134252604000,
"line_mean": 29.2416107383,
"line_max": 84,
"alpha_frac": 0.608743897,
"autogenerated": false,
"ratio": 3.59043... |
"""Adds async capabilities to the base product object"""
import asyncio
import aiohttp
from domaintools.base_results import Results
from domaintools.exceptions import ServiceUnavailableException, ServiceException
class _AIter(object):
"""A wrapper to wrap an AsyncResults as an async iterable"""
__slots__ = (... | {
"repo_name": "DomainTools/python_api",
"path": "domaintools_async/__init__.py",
"copies": "1",
"size": "2457",
"license": "mit",
"hash": 2357463837164870700,
"line_mean": 32.2027027027,
"line_max": 120,
"alpha_frac": 0.5767195767,
"autogenerated": false,
"ratio": 4.541589648798522,
"config_tes... |
"""adds autohandler functionality to Mako templates.
requires that the TemplateLookup class is used with templates.
usage:
<%!
from mako.ext.autohandler import autohandler
%>
<%inherit file="${autohandler(template, context)}"/>
or with custom autohandler filename:
<%!
from mako.ext.autohandler import autohandle... | {
"repo_name": "tebeka/pythonwise",
"path": "tagcloud/mako/ext/autohandler.py",
"copies": "2",
"size": "1565",
"license": "bsd-3-clause",
"hash": 1150788806840755300,
"line_mean": 26.4736842105,
"line_max": 93,
"alpha_frac": 0.6146964856,
"autogenerated": false,
"ratio": 3.8641975308641974,
"con... |
"""Adds backup image store."""
from baseCmd import *
from baseResponse import *
class addImageStoreCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "false"
"""the image store provider name"""
"""Required"""
self.provider = None
self.typeInfo['provider'] ... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/addImageStore.py",
"copies": "1",
"size": "2048",
"license": "apache-2.0",
"hash": -2132041095111330800,
"line_mean": 32.5737704918,
"line_max": 159,
"alpha_frac": 0.5649414062,
"autogenerated": false,
"ratio": 3.923371647... |
"""Adds boolean merged mined column for payouts and blocks, along with a table for merge mining address associations
Revision ID: 450b99a485f8
Revises: 322f0244224f
Create Date: 2014-05-03 02:47:32.704020
"""
# revision identifiers, used by Alembic.
revision = '450b99a485f8'
down_revision = '322f0244224f'
from alem... | {
"repo_name": "simplecrypto/simplecoin",
"path": "migrations/versions/450b99a485f8_adds_boolean_merged_mined_column_for_.py",
"copies": "1",
"size": "1253",
"license": "mit",
"hash": 2782317533599447600,
"line_mean": 33.8055555556,
"line_max": 116,
"alpha_frac": 0.691141261,
"autogenerated": false,... |
"""Adds capacities table for users.
Revision ID: 58c968a5c213
Revises: a2c99320aae4
Create Date: 2017-12-29 18:53:26.489653
"""
# revision identifiers, used by Alembic.
revision = '58c968a5c213'
down_revision = 'a2c99320aae4'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto ge... | {
"repo_name": "Rdbaker/WPI-IFC",
"path": "migrations/versions/58c968a5c213_.py",
"copies": "1",
"size": "1051",
"license": "bsd-3-clause",
"hash": 7303802393144287000,
"line_mean": 29.0285714286,
"line_max": 82,
"alpha_frac": 0.6669838249,
"autogenerated": false,
"ratio": 3.233846153846154,
"co... |
"""Adds challenge types and uses keys table
Revision ID: 87733981ca0e
Revises: cb3cfcc47e2f
Create Date: 2017-02-04 14:50:16.999303
"""
from CTFd.models import db, Challenges, Keys
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import text, table, column
from sqlalchemy.orm import sessionmaker
imp... | {
"repo_name": "mschwager/CTFd",
"path": "migrations/versions/87733981ca0e_adds_challenge_types_and_uses_keys_table.py",
"copies": "2",
"size": "3283",
"license": "apache-2.0",
"hash": -2769333597934081000,
"line_mean": 31.83,
"line_max": 109,
"alpha_frac": 0.6491014316,
"autogenerated": false,
"r... |
"""Add Scheduler info to the database
Revision ID: 4b8e6be32ada
Revises: 54e60d31349a
Create Date: 2013-12-27 19:54:24.832911
"""
# revision identifiers, used by Alembic.
revision = '4b8e6be32ada'
down_revision = '54e60d31349a'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto ge... | {
"repo_name": "zstars/weblabdeusto",
"path": "server/src/weblab/db/upgrade/regular/versions/4b8e6be32ada_add_scheduler_info_t.py",
"copies": "1",
"size": "2682",
"license": "bsd-2-clause",
"hash": 2405706887533656000,
"line_mean": 37.8695652174,
"line_max": 83,
"alpha_frac": 0.6808351976,
"autogene... |
"""add scheduler related tables
Revision ID: 20d2e65b1fd2
Revises: fefa06dd93cc
Create Date: 2021-04-09 11:21:19.103241
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '20d2e65b1fd2'
down_revision = 'fefa06dd93cc'
branch_labels = None
depends_on = None
def up... | {
"repo_name": "bytedance/fedlearner",
"path": "web_console_v2/api/migrations/versions/20d2e65b1fd2_add_scheduler_related_tables.py",
"copies": "1",
"size": "4202",
"license": "apache-2.0",
"hash": 1728592682392433200,
"line_mean": 52.8717948718,
"line_max": 133,
"alpha_frac": 0.6861018563,
"autogen... |
"""add schema hash
Revision ID: c37d49853d1b
Revises: 6eae0fb73bcc
Create Date: 2020-06-05 13:04:48.192373
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from sqlalchemy.dialects import mysql
from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus,... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/c37d49853d1b_add_schema_hash.py",
"copies": "1",
"size": "3515",
"license": "bsd-3-clause",
"hash": 5063834024226617000,
"line_mean": 42.3950617284,
"line_max": 125,
"alpha_frac": 0.7240398293,
"autogenerated": fal... |
"""Add school information using Excel spread sheets.
This is mostly used at startup to add the teachers, subjects, and social skills.
"""
import openpyxl
from errors.core import (InvalidExcelSheetFormatException,
NoExcelSheetRowsException)
import core.excel.excel_utilities as excel_utils
impo... | {
"repo_name": "cantell/silos",
"path": "silos/core/excel/school_info.py",
"copies": "1",
"size": "4873",
"license": "mit",
"hash": -4342890307913788000,
"line_mean": 38.6178861789,
"line_max": 82,
"alpha_frac": 0.6519597784,
"autogenerated": false,
"ratio": 3.9812091503267975,
"config_test": fa... |
"""Adds config flow for AccuWeather."""
from __future__ import annotations
import asyncio
from typing import Any
from accuweather import AccuWeather, ApiError, InvalidApiKeyError, RequestsExceededError
from aiohttp import ClientError
from aiohttp.client_exceptions import ClientConnectorError
from async_timeout import... | {
"repo_name": "kennedyshead/home-assistant",
"path": "homeassistant/components/accuweather/config_flow.py",
"copies": "2",
"size": "4474",
"license": "apache-2.0",
"hash": -5284807563277703000,
"line_mean": 35.0806451613,
"line_max": 88,
"alpha_frac": 0.5847116674,
"autogenerated": false,
"ratio"... |
"""Adds config flow for AccuWeather."""
import asyncio
from accuweather import AccuWeather, ApiError, InvalidApiKeyError, RequestsExceededError
from aiohttp import ClientError
from aiohttp.client_exceptions import ClientConnectorError
from async_timeout import timeout
import voluptuous as vol
from homeassistant impor... | {
"repo_name": "mezz64/home-assistant",
"path": "homeassistant/components/accuweather/config_flow.py",
"copies": "11",
"size": "4174",
"license": "apache-2.0",
"hash": 5717172662766872000,
"line_mean": 36.2678571429,
"line_max": 88,
"alpha_frac": 0.5828941064,
"autogenerated": false,
"ratio": 4.49... |
"""Adds config flow for Airly."""
from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME
from homeassistant.core import callback
from ho... | {
"repo_name": "leppa/home-assistant",
"path": "homeassistant/components/airly/config_flow.py",
"copies": "1",
"size": "3976",
"license": "apache-2.0",
"hash": -1002484137566711400,
"line_mean": 33.8771929825,
"line_max": 88,
"alpha_frac": 0.5716800805,
"autogenerated": false,
"ratio": 4.374037403... |
"""Adds config flow for Airly."""
import async_timeout
import voluptuous as vol
from airly import Airly
from airly.exceptions import AirlyError
import homeassistant.helpers.config_validation as cv
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF... | {
"repo_name": "qedi-r/home-assistant",
"path": "homeassistant/components/airly/config_flow.py",
"copies": "2",
"size": "3976",
"license": "apache-2.0",
"hash": -597709820204643000,
"line_mean": 33.8771929825,
"line_max": 88,
"alpha_frac": 0.5716800805,
"autogenerated": false,
"ratio": 4.374037403... |
"""Adds config flow for Bravia TV integration."""
import ipaddress
import logging
import re
from bravia_tv import BraviaRC
from bravia_tv.braviarc import NoIPControl
import voluptuous as vol
from homeassistant import config_entries, exceptions
from homeassistant.const import CONF_HOST, CONF_MAC, CONF_PIN
from homeass... | {
"repo_name": "robbiet480/home-assistant",
"path": "homeassistant/components/braviatv/config_flow.py",
"copies": "2",
"size": "6488",
"license": "apache-2.0",
"hash": -8750293057679700000,
"line_mean": 31.9340101523,
"line_max": 84,
"alpha_frac": 0.607891492,
"autogenerated": false,
"ratio": 3.96... |
"""Adds config flow for Brother Printer."""
import ipaddress
import re
from brother import Brother, SnmpError, UnsupportedModel
import voluptuous as vol
from homeassistant import config_entries, exceptions
from homeassistant.const import CONF_HOST, CONF_TYPE
from .const import DOMAIN, PRINTER_TYPES
from .utils impor... | {
"repo_name": "adrienbrault/home-assistant",
"path": "homeassistant/components/brother/config_flow.py",
"copies": "3",
"size": "4407",
"license": "mit",
"hash": 3360446324924501000,
"line_mean": 32.641221374,
"line_max": 83,
"alpha_frac": 0.5888359428,
"autogenerated": false,
"ratio": 4.046831955... |
"""Adds config flow for Dune HD integration."""
from __future__ import annotations
import ipaddress
import logging
import re
from typing import Any, Final
from pdunehd import DuneHDPlayer
import voluptuous as vol
from homeassistant import config_entries, exceptions
from homeassistant.const import CONF_HOST
from home... | {
"repo_name": "home-assistant/home-assistant",
"path": "homeassistant/components/dunehd/config_flow.py",
"copies": "2",
"size": "3388",
"license": "apache-2.0",
"hash": -364915577055524100,
"line_mean": 31.2666666667,
"line_max": 83,
"alpha_frac": 0.6071428571,
"autogenerated": false,
"ratio": 4.... |
"""Adds config flow for Dune HD integration."""
import ipaddress
import logging
import re
from pdunehd import DuneHDPlayer
import voluptuous as vol
from homeassistant import config_entries, exceptions
from homeassistant.const import CONF_HOST
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
def hos... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/components/dunehd/config_flow.py",
"copies": "3",
"size": "3308",
"license": "apache-2.0",
"hash": -2486452650846179000,
"line_mean": 31.7524752475,
"line_max": 84,
"alpha_frac": 0.6055018138,
"autogenerated": false,
"ratio": 4.19264... |
"""Adds config flow for GIOS."""
import asyncio
from aiohttp.client_exceptions import ClientConnectorError
from async_timeout import timeout
from gios import ApiError, Gios, InvalidSensorsData, NoStationError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_NAME
f... | {
"repo_name": "mKeRix/home-assistant",
"path": "homeassistant/components/gios/config_flow.py",
"copies": "6",
"size": "1969",
"license": "mit",
"hash": 8669842686844972000,
"line_mean": 32.9482758621,
"line_max": 88,
"alpha_frac": 0.6272219401,
"autogenerated": false,
"ratio": 4.068181818181818,
... |
"""Adds config flow for GIOS."""
import asyncio
from aiohttp.client_exceptions import ClientConnectorError
from async_timeout import timeout
from gios import ApiError, Gios, NoStationError
import voluptuous as vol
from homeassistant import config_entries, exceptions
from homeassistant.const import CONF_NAME
from home... | {
"repo_name": "postlund/home-assistant",
"path": "homeassistant/components/gios/config_flow.py",
"copies": "2",
"size": "2157",
"license": "apache-2.0",
"hash": -622666431586207200,
"line_mean": 32.1846153846,
"line_max": 88,
"alpha_frac": 0.6267964766,
"autogenerated": false,
"ratio": 4.15606936... |
"""Adds config flow for Mill integration."""
import logging
from mill import Mill
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN # pylint... | {
"repo_name": "pschmitt/home-assistant",
"path": "homeassistant/components/mill/config_flow.py",
"copies": "6",
"size": "1706",
"license": "apache-2.0",
"hash": -7888228120362871000,
"line_mean": 30.0181818182,
"line_max": 85,
"alpha_frac": 0.6494724502,
"autogenerated": false,
"ratio": 3.9953161... |
"""Adds config flow for Nettigo Air Monitor."""
from __future__ import annotations
import asyncio
import logging
from typing import Any, cast
from aiohttp.client_exceptions import ClientConnectorError
import async_timeout
from nettigo_air_monitor import ApiError, CannotGetMac, NettigoAirMonitor
import voluptuous as v... | {
"repo_name": "kennedyshead/home-assistant",
"path": "homeassistant/components/nam/config_flow.py",
"copies": "2",
"size": "4193",
"license": "apache-2.0",
"hash": 5386702381332036000,
"line_mean": 33.652892562,
"line_max": 86,
"alpha_frac": 0.6119723348,
"autogenerated": false,
"ratio": 4.226814... |
"""Adds config flow for Tibber integration."""
import asyncio
import aiohttp
import tibber
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
DATA_SCHEM... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/components/tibber/config_flow.py",
"copies": "3",
"size": "2267",
"license": "apache-2.0",
"hash": -4784417641404741000,
"line_mean": 30.4861111111,
"line_max": 73,
"alpha_frac": 0.5955006617,
"autogenerated": false,
"ratio": 4.24531... |
import asyncio
from discord.ext import commands
def decToHex(dec: int):
"""Converts a decimal integer to a hex string."""
hexDigits = "0123456789ABCDEF"
conversion = '' # (Re-)initiate string
# dec referenced as division
# special case if dec is already 0
if dec == 0:
... | {
"repo_name": "retrodpc/Bulbaspot-Cogs",
"path": "bulbautils/bulbautils.py",
"copies": "1",
"size": "5991",
"license": "apache-2.0",
"hash": 314027902224836030,
"line_mean": 44.1,
"line_max": 162,
"alpha_frac": 0.6105825405,
"autogenerated": false,
"ratio": 3.9860279441117763,
"config_test": fa... |
#Adds day of week
def day_of_week():
import pandas as pd
days=pd.DataFrame([[0,1,2,3,4,5,6],["Sun","Mon","Tue","Wed","Thr","Fri","Sat"]]).transpose()
days.columns=['indx','dayOfWeek']
return days
#joins dataset and day of week
def set_day_of_week(df,days):
df=df.merge(days,how='left',left_on... | {
"repo_name": "Achilles107/BikeRental",
"path": "bikeRental.py",
"copies": "1",
"size": "9995",
"license": "mit",
"hash": -5644749837821821000,
"line_mean": 31.2059800664,
"line_max": 105,
"alpha_frac": 0.6203101551,
"autogenerated": false,
"ratio": 2.9844729770080622,
"config_test": true,
"h... |
"""Adds default (bad) framework lifecycle event datetimes where those fields are currently null, so that we can set them
as non-nullable in the next migration. This migration will run against preview/staging/production, but we have already
manually populated all of the frameworks there, so it will take no effect. The p... | {
"repo_name": "alphagov/digitalmarketplace-api",
"path": "migrations/versions/1150_add_dates_to_empty_frameworks_for_tests.py",
"copies": "1",
"size": "2201",
"license": "mit",
"hash": -6360806096910406000,
"line_mean": 41.3269230769,
"line_max": 120,
"alpha_frac": 0.6288050886,
"autogenerated": fa... |
"""Adds detail for the Resource."""
from baseCmd import *
from baseResponse import *
class addResourceDetailCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""Map of (key/value pairs)"""
"""Required"""
self.details = []
self.typeInfo['details'] =... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/addResourceDetail.py",
"copies": "1",
"size": "1235",
"license": "apache-2.0",
"hash": 3843862349573584400,
"line_mean": 30.6666666667,
"line_max": 101,
"alpha_frac": 0.5935222672,
"autogenerated": false,
"ratio": 4.288194... |
"""Adds docstrings to functions defined in the torch._C"""
import re
import torch._C
from torch._C import _add_docstr as add_docstr
def parse_kwargs(desc):
"""Maps a description of args to a dictionary of {argname: description}.
Input:
(' weight (Tensor): a weight tensor\n' +
' So... | {
"repo_name": "ryfeus/lambda-packs",
"path": "pytorch/source/torch/_torch_docs.py",
"copies": "1",
"size": "194542",
"license": "mit",
"hash": -6973738704708488000,
"line_mean": 30.855575569,
"line_max": 119,
"alpha_frac": 0.61419128,
"autogenerated": false,
"ratio": 3.117760184621302,
"config_... |
"""Adds docstrings to functions defined in the torch._C"""
import torch._C
from torch._C import _add_docstr as add_docstr
add_docstr(torch._C.abs,
"""abs(input, out=None) -> Tensor
Computes the element-wise absolute value of the given :attr:`input` a tensor.
Example::
>>> torch.abs(torch.FloatTensor... | {
"repo_name": "RPGOne/Skynet",
"path": "pytorch-master/torch/_torch_docs.py",
"copies": "1",
"size": "103053",
"license": "bsd-3-clause",
"hash": 42147154166949410,
"line_mean": 22.3627295398,
"line_max": 119,
"alpha_frac": 0.6090555345,
"autogenerated": false,
"ratio": 3.0017476915906904,
"con... |
"""Adds docstrings to Tensor functions"""
import torch._C
from torch._C import _add_docstr as add_docstr
from ._torch_docs import parse_kwargs
def add_docstr_all(method, docstr):
add_docstr(getattr(torch._C._TensorBase, method), docstr)
new_common_args = parse_kwargs("""
size (int...): a list, tuple, or :cl... | {
"repo_name": "ryfeus/lambda-packs",
"path": "pytorch/source/torch/_tensor_docs.py",
"copies": "1",
"size": "70644",
"license": "mit",
"hash": 8127286000224170000,
"line_mean": 22.5951903808,
"line_max": 114,
"alpha_frac": 0.5967102656,
"autogenerated": false,
"ratio": 3.1821621621621623,
"conf... |
"""Adds docstrings to Tensor functions"""
import torch._C
from torch._C import _add_docstr as add_docstr
add_docstr(torch._C.FloatTensorBase.abs,
"""
abs() -> Tensor
See :func:`torch.abs`
""")
add_docstr(torch._C.FloatTensorBase.abs_,
"""
abs_() -> Tensor
In-place version of :meth:`~Tensor.ab... | {
"repo_name": "RPGOne/Skynet",
"path": "pytorch-master/torch/_tensor_docs.py",
"copies": "1",
"size": "34576",
"license": "bsd-3-clause",
"hash": 1831959725932663000,
"line_mean": 19.5077105575,
"line_max": 94,
"alpha_frac": 0.6280657103,
"autogenerated": false,
"ratio": 3.066063669415625,
"con... |
"""Add searchtemplate relationship to View model
Revision ID: ecf00882f546
Revises: 36e85b266dba
Create Date: 2016-09-30 11:42:03.009501
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 = '... | {
"repo_name": "google/timesketch",
"path": "timesketch/migrations/versions/ecf00882f546_.py",
"copies": "1",
"size": "1047",
"license": "apache-2.0",
"hash": 3557390965745463000,
"line_mean": 30.7272727273,
"line_max": 88,
"alpha_frac": 0.6991404011,
"autogenerated": false,
"ratio": 3.42156862745... |
"""Adds edges between family members at the same address."""
import six
from . import entity_tools
from . import graph_tools
from . import utils
# Edges between neighbours are added only if the number of entities
# at a particular address is at most `MAX_NEIGHBOUR_GROUP_SIZE`:
MAX_NEIGHBOUR_GROUP_SIZE = 2
# String ... | {
"repo_name": "verejnedigital/verejne.digital",
"path": "data/prod_generation/post_process_neighbours.py",
"copies": "1",
"size": "4812",
"license": "apache-2.0",
"hash": -7172173169473873000,
"line_mean": 35.7328244275,
"line_max": 122,
"alpha_frac": 0.6047381546,
"autogenerated": false,
"ratio"... |
"""add_segment_allocations
Revision ID: 1bd7cff90384
Revises: 374c1bdb4480
Create Date: 2016-01-25 19:26:27.899610
"""
# revision identifiers, used by Alembic.
revision = '1bd7cff90384'
down_revision = '374c1bdb4480'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'quark... | {
"repo_name": "alanquillin/quark",
"path": "quark/db/migration/alembic/versions/1bd7cff90384_add_segment_allocations.py",
"copies": "4",
"size": "3204",
"license": "apache-2.0",
"hash": 5609530279693270000,
"line_mean": 43.5,
"line_max": 76,
"alpha_frac": 0.6207865169,
"autogenerated": false,
"ra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.