text stringlengths 0 1.05M | meta dict |
|---|---|
"""Add initial length limits
Revision ID: dddf9a5cdd08
Revises: 8cde5e07b63f
Create Date: 2018-03-10 12:20:17.091148
"""
# revision identifiers, used by Alembic.
revision = 'dddf9a5cdd08'
down_revision = '8cde5e07b63f'
from alembic import op # lgtm[py/unused-import]
import sqlalchemy as sa # lgtm[py/unused-impor... | {
"repo_name": "Weasyl/weasyl",
"path": "libweasyl/libweasyl/alembic/versions/dddf9a5cdd08_add_initial_length_limits.py",
"copies": "1",
"size": "5269",
"license": "apache-2.0",
"hash": -4570414465705857500,
"line_mean": 39.2213740458,
"line_max": 112,
"alpha_frac": 0.5585500095,
"autogenerated": fa... |
"""Add initial models
Revision ID: 2241ef954d7f
Revises: None
Create Date: 2013-07-06 19:02:12.980884
"""
revision = '2241ef954d7f'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'category',
sa.Column('id', sa.Integer(), nullable=False),
... | {
"repo_name": "mythmon/piper",
"path": "piper/migrations/versions/2241ef954d7f_add_initial_models.py",
"copies": "1",
"size": "1718",
"license": "mit",
"hash": 4374634549184182300,
"line_mean": 30.2363636364,
"line_max": 74,
"alpha_frac": 0.6181606519,
"autogenerated": false,
"ratio": 3.670940170... |
"""Addins are the primary way of extending FeedPlatform the add
additional aggregator functionality.
You'll find a number of them in the builtin ``feedplatform.lib``
module, although custom addins can easily be created, and
generally, when extended or specialized customization is required,
creating an addin will... | {
"repo_name": "miracle2k/feedplatform",
"path": "feedplatform/addins.py",
"copies": "1",
"size": "8393",
"license": "bsd-2-clause",
"hash": 4249017373016078300,
"line_mean": 35.8153153153,
"line_max": 84,
"alpha_frac": 0.6019301799,
"autogenerated": false,
"ratio": 4.502682403433476,
"config_te... |
"""add instance logs to db.
Revision ID: 5b9110dd4ffd
Revises: 902fbdab393a
Create Date: 2017-02-10 17:22:04.107017
"""
# revision identifiers, used by Alembic.
revision = '5b9110dd4ffd'
down_revision = '902fbdab393a'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by... | {
"repo_name": "CSC-IT-Center-for-Science/pouta-blueprints",
"path": "migrations/versions/5b9110dd4ffd_.py",
"copies": "1",
"size": "1310",
"license": "mit",
"hash": -5208705421202935000,
"line_mean": 34.4054054054,
"line_max": 116,
"alpha_frac": 0.6832061069,
"autogenerated": false,
"ratio": 3.26... |
"""Addins that deal with item enclosures.
TODO: A ``store_enclosure`` addin (singular) that handles only one
enclosure and doesn't rely on a separate table, but rather fields
in the item table might be nice.
"""
import datetime
from storm.locals import Unicode, Int, Reference, ReferenceSet
from feedplatfor... | {
"repo_name": "miracle2k/feedplatform",
"path": "feedplatform/lib/addins/items/enclosures.py",
"copies": "1",
"size": "9795",
"license": "bsd-2-clause",
"hash": 509914148902111300,
"line_mean": 38.316872428,
"line_max": 84,
"alpha_frac": 0.5634507402,
"autogenerated": false,
"ratio": 4.3766756032... |
"""Addins that handle feed images/covers.
Some of them require PIL.
# TODO: Validate against PIL addin: The image is only processed if PIL finds
a valid image, by looking at the headers (or optionally by fully reading
the image?
# TODO: Support updating the image when the href changes.
# TODO: There is an... | {
"repo_name": "miracle2k/feedplatform",
"path": "feedplatform/lib/addins/feeds/images.py",
"copies": "1",
"size": "30912",
"license": "bsd-2-clause",
"hash": -5718747755676528000,
"line_mean": 36.8855345912,
"line_max": 80,
"alpha_frac": 0.609698499,
"autogenerated": false,
"ratio": 4.50480909355... |
"""Addins that provide various fallbacks should a feed not provide
``<guid>`` elements to identify it's items.
Generally, it is a good idea to use many of those, since a huge number
of feeds out in the wild are in fact lacking guids, and FeedPlatform
ultimately requires *some* way to identify an item - otherwise,... | {
"repo_name": "miracle2k/feedplatform",
"path": "feedplatform/lib/addins/items/guid.py",
"copies": "1",
"size": "6034",
"license": "bsd-2-clause",
"hash": 5517546598208463000,
"line_mean": 32.1016949153,
"line_max": 74,
"alpha_frac": 0.6312562148,
"autogenerated": false,
"ratio": 4.11315610088616... |
"""Addins that relate to HTTP functionality.
"""
from storm.locals import DateTime, Unicode
from feedplatform import addins
from feedplatform import db
from feedplatform.util import \
datetime_to_struct, struct_to_datetime, to_unicode
__all__ = (
'update_redirects',
'save_bandwith',
)
... | {
"repo_name": "miracle2k/feedplatform",
"path": "feedplatform/lib/addins/feeds/http.py",
"copies": "1",
"size": "6188",
"license": "bsd-2-clause",
"hash": -6058208560989287000,
"line_mean": 34.8452380952,
"line_max": 84,
"alpha_frac": 0.5935681965,
"autogenerated": false,
"ratio": 4.2181322426721... |
"""Addins that store feed metadata in the database for offline access.
# TODO: support custom rules for updating, e.g. update data never when
already existing, update always, only when a certain parser flag is
set (e.g. "fullparse"). This is useful for:
* making sure data, once set or found, can't be changed ... | {
"repo_name": "miracle2k/feedplatform",
"path": "feedplatform/lib/addins/feeds/collect_feed_data.py",
"copies": "1",
"size": "7289",
"license": "bsd-2-clause",
"hash": -2916325561161206000,
"line_mean": 35.7668393782,
"line_max": 81,
"alpha_frac": 0.5947317876,
"autogenerated": false,
"ratio": 4.... |
"""add interpreted age tables
Revision ID: 3874acf6600c
Revises: 3f5681f0fc5d
Create Date: 2015-06-19 13:46:19.937856
"""
# revision identifiers, used by Alembic.
revision = '3874acf6600c'
down_revision = '3f5681f0fc5d'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated ... | {
"repo_name": "USGSDenverPychron/pychron",
"path": "alembic_dvc/versions/3874acf6600c_add_interpreted_age_.py",
"copies": "3",
"size": "3976",
"license": "apache-2.0",
"hash": -5332757514638856000,
"line_mean": 49.3291139241,
"line_max": 112,
"alpha_frac": 0.6106639839,
"autogenerated": false,
"r... |
"""add interpretedtables
Revision ID: 5517015226ba
Revises: 35a07261cd96
Create Date: 2013-12-04 17:47:20.013670
"""
# revision identifiers, used by Alembic.
revision = '5517015226ba'
down_revision = '35a07261cd96'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('proc_Interpreted... | {
"repo_name": "USGSDenverPychron/pychron",
"path": "migration/versions/5517015226ba_add_interpretedtable.py",
"copies": "1",
"size": "2628",
"license": "apache-2.0",
"hash": -1938880660973415000,
"line_mean": 45.1052631579,
"line_max": 109,
"alpha_frac": 0.6426940639,
"autogenerated": false,
"rat... |
"""add invalid questionnaire flag
Revision ID: 075b9eee88b7
Revises: 9f0935df44bb
Create Date: 2018-07-18 13:07:58.598473
"""
import model.utils
import sqlalchemy as sa
from alembic import op
from rdr_service.participant_enums import QuestionnaireDefinitionStatus
# revision identifiers, used by Alembic.
revision = ... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/075b9eee88b7_add_invalid_questionnaire_flag.py",
"copies": "1",
"size": "1433",
"license": "bsd-3-clause",
"hash": 3348440414381786000,
"line_mean": 25.537037037,
"line_max": 119,
"alpha_frac": 0.6915561759,
"autog... |
""" Add inventory in and inventory out link to calculate profit using FIFO method
Revision ID: a173601e2e8c
Revises: 5fa54f2ce13c
Create Date: 2017-03-29 07:06:57.758959
"""
# revision identifiers, used by Alembic.
revision = 'a173601e2e8c'
down_revision = '5fa54f2ce13c'
from alembic import op
import sqlalchemy as ... | {
"repo_name": "betterlife/flask-psi",
"path": "psi/migrations/versions/35_a173601e2e8c_.py",
"copies": "2",
"size": "2034",
"license": "mit",
"hash": 1548395696544570600,
"line_mean": 43.2173913043,
"line_max": 153,
"alpha_frac": 0.6902654867,
"autogenerated": false,
"ratio": 3.3619834710743803,
... |
"""Add InventoryItem class.
Revision ID: b68e0d8ed9fe
Revises: 80e470911917
Create Date: 2017-02-03 23:19:40.082764
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b68e0d8ed9fe'
down_revision = '80e470911917'
branch_labels = None
depends_on = None
def upgrad... | {
"repo_name": "MJB47/Jokusoramame",
"path": "migrations/versions/b68e0d8ed9fe_add_inventoryitem_class.py",
"copies": "1",
"size": "1083",
"license": "mit",
"hash": -6716269908361171000,
"line_mean": 28.2702702703,
"line_max": 76,
"alpha_frac": 0.6712834718,
"autogenerated": false,
"ratio": 3.3220... |
"""Add invitation related tables
Revision ID: 42bd0c8938f9
Revises: 54e63b0a9b06
Create Date: 2016-09-01 17:48:05.935684
"""
# revision identifiers, used by Alembic.
revision = '42bd0c8938f9'
down_revision = '54e63b0a9b06'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generat... | {
"repo_name": "weblabdeusto/weblabdeusto",
"path": "server/src/weblab/db/upgrade/regular/versions/42bd0c8938f9_add_invitation_related_tables.py",
"copies": "3",
"size": "1942",
"license": "bsd-2-clause",
"hash": -3939896026292488000,
"line_mean": 35.641509434,
"line_max": 91,
"alpha_frac": 0.67559217... |
#add IokeLexer to __all__ at the top of agile.py like so:
__all__ = ['PythonLexer', 'PythonConsoleLexer', 'PythonTracebackLexer',
'RubyLexer', 'RubyConsoleLexer', 'PerlLexer', 'LuaLexer',
'MiniDLexer', 'IoLexer', 'IokeLexer', 'TclLexer', 'ClojureLexer',
'Python3Lexer', 'Python3Tracebac... | {
"repo_name": "olabini/ioke",
"path": "share/pygments/lexer.py",
"copies": "2",
"size": "6882",
"license": "mit",
"hash": -44385216918597900,
"line_mean": 42.2830188679,
"line_max": 562,
"alpha_frac": 0.4875036327,
"autogenerated": false,
"ratio": 3.010498687664042,
"config_test": false,
"has... |
"""add ios available os updates fields
Revision ID: 0201b96ab856
Revises: e947cdf82307
Create Date: 2018-07-01 21:37:27.355712
"""
# From: http://alembic.zzzcomputing.com/en/latest/cookbook.html#conditional-migration-elements
from alembic import op
import sqlalchemy as sa
import commandment.dbtypes
from alembic i... | {
"repo_name": "jessepeterson/commandment",
"path": "commandment/alembic/versions/0201b96ab856_add_ios_available_os_updates_fields.py",
"copies": "1",
"size": "1618",
"license": "mit",
"hash": -6295644024508088000,
"line_mean": 26.8965517241,
"line_max": 101,
"alpha_frac": 0.7014833127,
"autogenerat... |
"""add ios installed application fields
Revision ID: e947cdf82307
Revises: 3061e56045eb
Create Date: 2018-07-01 20:30:53.621855
"""
# From: http://alembic.zzzcomputing.com/en/latest/cookbook.html#conditional-migration-elements
from alembic import op
import sqlalchemy as sa
import commandment.dbtypes
from alembic ... | {
"repo_name": "jessepeterson/commandment",
"path": "commandment/alembic/versions/e947cdf82307_add_ios_installed_application_fields.py",
"copies": "1",
"size": "2289",
"license": "mit",
"hash": 62126815360543220,
"line_mean": 34.2153846154,
"line_max": 117,
"alpha_frac": 0.7164700743,
"autogenerated... |
"""add irb to questionnaire
Revision ID: 90a21cce431b
Revises: 641372364227
Create Date: 2020-10-23 13:47:03.004003
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, OrderStatus
from rdr_servic... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/90a21cce431b_add_irb_to_questionnaire.py",
"copies": "1",
"size": "2408",
"license": "bsd-3-clause",
"hash": -5936204934251027000,
"line_mean": 35.4848484848,
"line_max": 125,
"alpha_frac": 0.7446013289,
"autogener... |
"""add is_creator for workspace user
Revision ID: c0394a487b8b
Revises: e8b090aa164e
Create Date: 2020-05-08 14:39:52.677433
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'c0394a487b8b'
down_revision = 'e8b090aa164e'
branc... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/c0394a487b8b_add_is_creator_for_workspace_user.py",
"copies": "1",
"size": "1950",
"license": "bsd-3-clause",
"hash": -5822099810893918000,
"line_mean": 29.46875,
"line_max": 107,
"alpha_frac": 0.6574358974,
"autog... |
"""add is_deleted and last_modified columns
Revision ID: 59cbcf04663
Revises: 59935c933ab
Create Date: 2015-04-20 13:32:09.792703
"""
# revision identifiers, used by Alembic.
revision = '59cbcf04663'
down_revision = '59935c933ab'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, colum... | {
"repo_name": "LandRegistry/digital-register-api",
"path": "migrations/versions/59cbcf04663_add_is_deleted_and_last_modified_columns.py",
"copies": "1",
"size": "1681",
"license": "mit",
"hash": -3076684068678171000,
"line_mean": 39.0238095238,
"line_max": 94,
"alpha_frac": 0.6615110054,
"autogener... |
"""Add is_draft status to queries and dashboards
Revision ID: 65fc9ede4746
Revises:
Create Date: 2016-12-07 18:08:13.395586
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
from sqlalchemy.exc import ProgrammingError
revision = '65fc9ede4746'
down_revision = None
branch_l... | {
"repo_name": "EverlyWell/redash",
"path": "migrations/versions/65fc9ede4746_add_is_draft_status_to_queries_and_.py",
"copies": "9",
"size": "1229",
"license": "bsd-2-clause",
"hash": 6163682399812627000,
"line_mean": 33.1388888889,
"line_max": 125,
"alpha_frac": 0.6834825061,
"autogenerated": fals... |
"""Add is_draft status to queries and dashboards
Revision ID: 65fc9ede4746
Revises:
Create Date: 2016-12-07 18:08:13.395586
"""
from __future__ import print_function
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
from sqlalchemy.exc import ProgrammingError
revision = '65fc9... | {
"repo_name": "moritz9/redash",
"path": "migrations/versions/65fc9ede4746_add_is_draft_status_to_queries_and_.py",
"copies": "5",
"size": "1269",
"license": "bsd-2-clause",
"hash": 5992217628889519000,
"line_mean": 33.2972972973,
"line_max": 126,
"alpha_frac": 0.6847911742,
"autogenerated": false,
... |
"""Add is_draft status to queries and dashboards
Revision ID: 65fc9ede4746
Revises:
Create Date: 2016-12-07 18:08:13.395586
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
from sqlalchemy.exc import ProgrammingError
revision = "65fc9ede4746"
down_revision = None
branch_l... | {
"repo_name": "denisov-vlad/redash",
"path": "migrations/versions/65fc9ede4746_add_is_draft_status_to_queries_and_.py",
"copies": "3",
"size": "1370",
"license": "bsd-2-clause",
"hash": -20671171271675856,
"line_mean": 28.1489361702,
"line_max": 114,
"alpha_frac": 0.6102189781,
"autogenerated": fal... |
"""Add is_ready field to Project.
Revision ID: 2aa8c8ea9d62
Revises: 4f99b161d06c
Create Date: 2013-02-13 11:22:37.123917
"""
# revision identifiers, used by Alembic.
revision = '2aa8c8ea9d62'
down_revision = '4f99b161d06c'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.schema import DefaultClause
f... | {
"repo_name": "ucsb-cs/submit",
"path": "submit/migrations/versions/2aa8c8ea9d62_add_is_ready_field_t.py",
"copies": "1",
"size": "1428",
"license": "bsd-2-clause",
"hash": -4777260176930122000,
"line_mean": 33,
"line_max": 151,
"alpha_frac": 0.6470588235,
"autogenerated": false,
"ratio": 3.45762... |
"""add is_reviewed to workspace table
Revision ID: 679d13d850ce
Revises: 1edcfe7d61ec
Create Date: 2020-04-29 12:53:17.135885
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '679d13d850ce'
down_revision = '1edcfe7d61ec'
branch_labels = None
depends_on = None
d... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/679d13d850ce_add_is_reviewed_to_workspace_table.py",
"copies": "1",
"size": "1327",
"license": "bsd-3-clause",
"hash": -394644042766869200,
"line_mean": 25.0196078431,
"line_max": 104,
"alpha_frac": 0.6767143934,
"... |
"""Add is_test_sample flag to biobank_dv_order
Revision ID: 39f421efaa73
Revises: 9cbaee181bc9
Create Date: 2020-03-17 12:13:52.824158
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '39f421efaa73'
down_revision = '9cbaee181bc9'
branch_labels = None
depends_on =... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/39f421efaa73_add_is_test_sample_flag_to_biobank_dv_.py",
"copies": "1",
"size": "1146",
"license": "bsd-3-clause",
"hash": 3025442355486442000,
"line_mean": 22.875,
"line_max": 95,
"alpha_frac": 0.6631762653,
"auto... |
"""add is_utc_to_pages
Revision ID: 16dbded8a5cf
Revises: a0f4fda7588f
Create Date: 2016-12-14 23:46:54.211173
"""
# revision identifiers, used by Alembic.
revision = '16dbded8a5cf'
down_revision = 'a0f4fda7588f'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(eng... | {
"repo_name": "c4fcm/CivilServant",
"path": "alembic/versions/16dbded8a5cf_add_is_utc_to_pages.py",
"copies": "1",
"size": "2009",
"license": "mit",
"hash": 5533098550293813000,
"line_mean": 28.5441176471,
"line_max": 86,
"alpha_frac": 0.6550522648,
"autogenerated": false,
"ratio": 3.348333333333... |
"""Add ItemSequence
Revision ID: 1f5caa34d9c2
Revises: bb141e41aab
Create Date: 2014-03-31 22:44:32.721446
"""
# revision identifiers, used by Alembic.
revision = '1f5caa34d9c2'
down_revision = 'bb141e41aab'
from alembic import op
import sqlalchemy as sa
NEXT_ITEM_VALUE_FUNCTION = """
CREATE OR REPLACE FUNCTION n... | {
"repo_name": "dropbox/changes",
"path": "migrations/versions/1f5caa34d9c2_add_itemsequence.py",
"copies": "4",
"size": "1636",
"license": "apache-2.0",
"hash": 6586986604427308000,
"line_mean": 23.7878787879,
"line_max": 79,
"alpha_frac": 0.6900977995,
"autogenerated": false,
"ratio": 3.23960396... |
"""Additional autograd differential operators."""
from functools import wraps
AUTOGRAD_AVAILABLE = True
try:
from autograd import make_vjp as vjp_and_value
from autograd.wrap_util import unary_to_nary
from autograd.builtins import tuple as atuple
from autograd.core import make_vjp
from autograd.ex... | {
"repo_name": "matt-graham/hmc",
"path": "mici/autograd_wrapper.py",
"copies": "1",
"size": "4569",
"license": "mit",
"hash": -6592566817244653000,
"line_mean": 33.4924242424,
"line_max": 81,
"alpha_frac": 0.6531956951,
"autogenerated": false,
"ratio": 3.2684852835606604,
"config_test": false,
... |
"""Additional behaviors for genetic algorithms.
Contents
--------
:FittestTriggerGA:
A GA that triggers an event whenever a new best fitness score is observed.
:FittestInGenerationGA:
A GA that stores the fittest chromosome from each generation and its score.
:FinishWhenSlowGA:
A GA that will terminate wh... | {
"repo_name": "rawg/levis",
"path": "levis/behavior.py",
"copies": "1",
"size": "3378",
"license": "mit",
"hash": -7987479584750882000,
"line_mean": 30.5700934579,
"line_max": 79,
"alpha_frac": 0.6705150977,
"autogenerated": false,
"ratio": 4.0262216924910605,
"config_test": true,
"has_no_key... |
"""Additional clustering algorithms and estimators."""
import numpy as np
from scipy.cluster.hierarchy import fcluster
from scipy.cluster.hierarchy import linkage
from sklearn.base import BaseEstimator
from sklearn.base import ClusterMixin
from sklearn.utils import check_array
def hierarchical_clustering(
X,... | {
"repo_name": "ottogroup/dstoolbox",
"path": "dstoolbox/cluster.py",
"copies": "1",
"size": "3828",
"license": "apache-2.0",
"hash": 3137737069875822600,
"line_mean": 28.4461538462,
"line_max": 69,
"alpha_frac": 0.6384535005,
"autogenerated": false,
"ratio": 4.498237367802585,
"config_test": fa... |
"""Additional data encoders."""
from __future__ import absolute_import
from .errors import EncodingError
from collections import OrderedDict
import six
class BaseEncoder(object):
"""Base encoder class."""
def __init__(self, document):
"""Create an encoder for the given document."""
self.docum... | {
"repo_name": "WiFast/bearfield",
"path": "bearfield/encoders.py",
"copies": "1",
"size": "16702",
"license": "bsd-3-clause",
"hash": -2783234003826323000,
"line_mean": 34.6119402985,
"line_max": 98,
"alpha_frac": 0.5609507843,
"autogenerated": false,
"ratio": 4.325822325822326,
"config_test": ... |
"""Additional dataset classes."""
from __future__ import (division, print_function, )
from collections import OrderedDict
from scipy.stats import multivariate_normal
import numpy as np
import numpy.random as npr
from fuel import config
from fuel.datasets import H5PYDataset, IndexableDataset
from fuel.transformers.def... | {
"repo_name": "IshmaelBelghazi/ALI",
"path": "ali/datasets.py",
"copies": "1",
"size": "5781",
"license": "mit",
"hash": 3808113923672862000,
"line_mean": 35.13125,
"line_max": 85,
"alpha_frac": 0.5448884276,
"autogenerated": false,
"ratio": 4.204363636363636,
"config_test": false,
"has_no_ke... |
""" Additional datasets for Nilearn
Function to fetch abide movements
"""
import os
import collections
import numpy as np
from sklearn.datasets.base import Bunch
from nilearn.datasets import _fetch_files, _get_dataset_dir
def _filter_column(array, col, criteria):
""" Return index array matching criteria
... | {
"repo_name": "AlexandreAbraham/movements",
"path": "nilearn_private/more_datasets.py",
"copies": "1",
"size": "5318",
"license": "mit",
"hash": -7338085498414197000,
"line_mean": 30.6547619048,
"line_max": 80,
"alpha_frac": 0.5802933434,
"autogenerated": false,
"ratio": 3.4599869876382563,
"co... |
''' additional_datastructures.py: File containing custom utility data structures for use in simple_rl. '''
import json
class SimpleRLStack(object):
''' Implementation for a basic Stack data structure '''
def __init__(self, _list=None):
'''
Args:
_list (list) : underlying elements in... | {
"repo_name": "david-abel/simple_rl",
"path": "simple_rl/utils/additional_datastructures.py",
"copies": "1",
"size": "2155",
"license": "apache-2.0",
"hash": -5759182819550566000,
"line_mean": 28.5205479452,
"line_max": 106,
"alpha_frac": 0.543387471,
"autogenerated": false,
"ratio": 4.2928286852... |
"""Additional Enrichment models"""
import enrichment_model as em
from scipy.special import i0
import numpy as np
class EnrichmentModel2_recur(em.EnrichmentModel2):
def __init__(self, kappa=1, span=0.2, mean_recur=None, **kwargs):
super(EnrichmentModel2_recur, self).__init__(**kwargs)
self.para... | {
"repo_name": "losonczylab/Zaremba_NatNeurosci_2017",
"path": "enrichment_model/enrichment_model_theoretical.py",
"copies": "1",
"size": "5272",
"license": "mit",
"hash": -7173605994464979000,
"line_mean": 26.8941798942,
"line_max": 94,
"alpha_frac": 0.6170333839,
"autogenerated": false,
"ratio":... |
"""Additional features for templates."""
from os.path import dirname, join, isfile
from django import VERSION
from django.template.base import Origin
from django.template.loaders.filesystem import Loader as FilesystemLoader
class BaseLoader(FilesystemLoader):
"""Custom base loader for templates."""
_app_di... | {
"repo_name": "ExCiteS/geokey-wegovnow",
"path": "geokey_wegovnow/templates.py",
"copies": "1",
"size": "1398",
"license": "mit",
"hash": -8760904891046444000,
"line_mean": 30.0666666667,
"line_max": 78,
"alpha_frac": 0.6623748212,
"autogenerated": false,
"ratio": 4.509677419354839,
"config_tes... |
"""additional fields for consent records
Revision ID: 60486b6dab35
Revises: 898171d91a3e, e9a549d1882d, 6079f2fae734
Create Date: 2021-06-15 07:46:01.937649
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
# revision identifiers, used by Alembic.
revision = '60486b6dab35'
down_revis... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/60486b6dab35_additional_fields_for_consent_records.py",
"copies": "1",
"size": "1549",
"license": "bsd-3-clause",
"hash": 7458591249107243000,
"line_mean": 27.6851851852,
"line_max": 118,
"alpha_frac": 0.6797934151,
... |
"""Additional form validators
"""
# future imports
from __future__ import absolute_import
# stdlib import
import re
from StringIO import StringIO
# third-party imports
from PIL import Image
from wtforms import ValidationError
from wtforms import validators
# Pulled from http://www.regular-expressions.info/email.htm... | {
"repo_name": "mjmcconnell/sra",
"path": "src-server/app/forms/utils/validators.py",
"copies": "1",
"size": "3603",
"license": "apache-2.0",
"hash": -3344695934838971000,
"line_mean": 32.9905660377,
"line_max": 79,
"alpha_frac": 0.4979184013,
"autogenerated": false,
"ratio": 4.263905325443787,
... |
'Additional functions for Keras'
# Authors: Afshine Amidi <lastname@mit.edu>
# Shervine Amidi <firstname@stanford.edu>
# MIT License
import os.path
import itertools
import numpy as np
from keras.callbacks import Callback
from enzynet.indicators import Indicators
from enzynet.real_time import RealTimePlot... | {
"repo_name": "shervinea/enzynet",
"path": "enzynet/keras_utils.py",
"copies": "1",
"size": "8033",
"license": "mit",
"hash": -5236458490415014000,
"line_mean": 34.5442477876,
"line_max": 96,
"alpha_frac": 0.5888211129,
"autogenerated": false,
"ratio": 4.069402228976697,
"config_test": false,
... |
'''Additional functions
prediction standard errors and confidence intervals
A: josef pktd
'''
import numpy as np
from scipy import stats
import scikits.statsmodels as sm
def atleast_2dcol(x):
''' convert array_like to 2d from 1d or 0d
not tested because not used
'''
x = np.asarray(x)
if (x.ndi... | {
"repo_name": "matthew-brett/draft-statsmodels",
"path": "scikits/statsmodels/sandbox/regression/predstd.py",
"copies": "1",
"size": "3993",
"license": "bsd-3-clause",
"hash": 9041548839718012000,
"line_mean": 28.3602941176,
"line_max": 88,
"alpha_frac": 0.631354871,
"autogenerated": false,
"rati... |
'''Additional functions
prediction standard errors and confidence intervals
A: josef pktd
'''
import numpy as np
from scipy import stats
def atleast_2dcol(x):
''' convert array_like to 2d from 1d or 0d
not tested because not used
'''
x = np.asarray(x)
if (x.ndim == 1):
x = x[:, None]
... | {
"repo_name": "bsipocz/statsmodels",
"path": "statsmodels/sandbox/regression/predstd.py",
"copies": "34",
"size": "3000",
"license": "bsd-3-clause",
"hash": -945231561045324500,
"line_mean": 28.702970297,
"line_max": 79,
"alpha_frac": 0.6373333333,
"autogenerated": false,
"ratio": 3.8610038610038... |
""" Additional guiqwt tools to facilitate plot navigation.
"""
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QMessageBox
try:
from PyQt4 import QtCore
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
from guiqwt.tools import CommandTool, Defa... | {
"repo_name": "rproepp/spykeutils",
"path": "spykeutils/plot/guiqwt_tools.py",
"copies": "1",
"size": "2375",
"license": "bsd-3-clause",
"hash": 6147148450201313000,
"line_mean": 30.68,
"line_max": 72,
"alpha_frac": 0.6703157895,
"autogenerated": false,
"ratio": 3.8183279742765275,
"config_test... |
""" Additional Haystack Signal Processors
This module provides additional HAYSTACK_SIGNAL_PROCESSOR classes to reindex more effeciently.
They may be tied to various other haystack-related libraries.
They are not tied to `tastypie_search` in any way! Use them anywhere Haystack is installed.
"""
import sys
from django.... | {
"repo_name": "adroffner/tastypie-searchable",
"path": "tastypie_search/signals.py",
"copies": "1",
"size": "2443",
"license": "mit",
"hash": -7273136065500973000,
"line_mean": 34.9264705882,
"line_max": 128,
"alpha_frac": 0.6983217356,
"autogenerated": false,
"ratio": 4.1689419795221845,
"conf... |
"""Additional helpful utility functions."""
import sys
from django.conf import settings
try:
from html.parser import HTMLParser
except ImportError:
from HTMLParser import HTMLParser
try:
from bs4 import BeautifulSoup
except ImportError: # pragma: nocover
sys.stderr.write('Warning: BeautifulSoup coul... | {
"repo_name": "bitmazk/django-libs",
"path": "django_libs/utils/converter.py",
"copies": "1",
"size": "4898",
"license": "mit",
"hash": -9181839672506032000,
"line_mean": 37.873015873,
"line_max": 79,
"alpha_frac": 0.546957942,
"autogenerated": false,
"ratio": 4.085070892410342,
"config_test": ... |
"""Additional HTTPAdapter subclasses for python `requests` module."""
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
class SSLAdapter(HTTPAdapter):
"""An adapter that allows passing in an arbitrary ssl_version.
Useful because OpenSSL bugs can create sit... | {
"repo_name": "kevinseelbach/generic_utils",
"path": "src/generic_utils/requests_utils.py",
"copies": "1",
"size": "1440",
"license": "bsd-3-clause",
"hash": 3346223347625739000,
"line_mean": 37.9189189189,
"line_max": 109,
"alpha_frac": 0.6388888889,
"autogenerated": false,
"ratio": 4.5859872611... |
"""Additional IR Pass for VTA"""
# pylint: disable=len-as-condition
from __future__ import absolute_import as _abs
import tvm
from topi import util as util
from .environment import get_env
def _match_pragma(stmt, key):
"""Internal helper to match stmt to pragma stmt.
Parameters
----------
stmt : St... | {
"repo_name": "mlperf/training_results_v0.6",
"path": "Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/vta/python/vta/ir_pass.py",
"copies": "1",
"size": "30165",
"license": "apache-2.0",
"hash": -1532618107827082000,
"line_mean": 35.2996389892,
"line_max": 94,
"alpha_frac": 0.4978617603... |
""" Additional Jinja2 filters """
import os
import re
import sys
from jinja2 import is_undefined, contextfilter
from jinja2.exceptions import UndefinedError
if sys.version_info >= (3,0):
from shutil import which
elif sys.version_info >= (2,5):
from shutilwhich import which
else:
assert False, "Unsupported ... | {
"repo_name": "m000/j2cli",
"path": "j2cli/extras/filters.py",
"copies": "1",
"size": "4836",
"license": "bsd-2-clause",
"hash": -2902209838115560000,
"line_mean": 27.9580838323,
"line_max": 105,
"alpha_frac": 0.6048387097,
"autogenerated": false,
"ratio": 3.6775665399239545,
"config_test": fal... |
"""Additional methods usable in with-context
"""
import contextlib
import os
import os.path as osp
import shutil
import sys
import tempfile
import timeit
import six
@contextlib.contextmanager
def capture_stdout():
"""Intercept standard output in a with-context
:return: cStringIO instance
>>> with captur... | {
"repo_name": "tristan0x/hpcbench",
"path": "hpcbench/toolbox/contextlib_ext.py",
"copies": "1",
"size": "3572",
"license": "mit",
"hash": -1119679845580710000,
"line_mean": 25.0729927007,
"line_max": 78,
"alpha_frac": 0.6349384099,
"autogenerated": false,
"ratio": 4.0590909090909095,
"config_t... |
# Additional MySQL-specific tests
# Written by: F. Gabriel Gosselin <gabrielNOSPAM@evidens.ca>
# Based on tests by: aarranz
from south.tests import unittest
from south.db import db, generic, mysql
from django.db import connection, models
class TestMySQLOperations(unittest.TestCase):
"""MySQL-specific tests"""
... | {
"repo_name": "cubicova17/annet",
"path": "venv/lib/python2.7/site-packages/south/tests/db_mysql.py",
"copies": "13",
"size": "7006",
"license": "mit",
"hash": 3030316746634474500,
"line_mean": 41.4606060606,
"line_max": 79,
"alpha_frac": 0.6216100485,
"autogenerated": false,
"ratio": 3.824235807... |
# Additional MySQL-specific tests
# Written by: F. Gabriel Gosselin <gabrielNOSPAM@evidens.ca>
# Based on tests by: aarranz
from south.tests import unittest, skipUnless
from south.db import db, generic, mysql
from django.db import connection, models
class TestMySQLOperations(unittest.TestCase):
"""MySQL-specifi... | {
"repo_name": "lmorchard/whuru",
"path": "vendor-local/src/south/south/tests/db_mysql.py",
"copies": "1",
"size": "7005",
"license": "bsd-3-clause",
"hash": -8867923128787148000,
"line_mean": 41.9754601227,
"line_max": 82,
"alpha_frac": 0.6302640971,
"autogenerated": false,
"ratio": 3.80913539967... |
"""Additional regular expression utilities, to make it easier to sync up
with Java regular expression code.
>>> import re
>>> from .re_util import fullmatch
>>> from .util import u
>>> string = 'abcd'
>>> r1 = re.compile('abcd')
>>> r2 = re.compile('bc')
>>> r3 = re.compile('abc')
>>> fullmatch(r1, string) # doctest:... | {
"repo_name": "daviddrysdale/python-phonenumbers",
"path": "python/phonenumbers/re_util.py",
"copies": "1",
"size": "1425",
"license": "apache-2.0",
"hash": -592040432917925200,
"line_mean": 31.3863636364,
"line_max": 77,
"alpha_frac": 0.6343859649,
"autogenerated": false,
"ratio": 3.384798099762... |
"""Additional simple tables defined here."""
from terminaltables.ascii_table import AsciiTable
from terminaltables.terminal_io import IS_WINDOWS
class UnixTable(AsciiTable):
"""Draw a table using box-drawing characters on Unix platforms. Table borders won't have any gaps between lines.
Similar to the tables... | {
"repo_name": "Robpol86/terminaltables",
"path": "terminaltables/other_tables.py",
"copies": "3",
"size": "8480",
"license": "mit",
"hash": 679205521949493400,
"line_mean": 46.9096045198,
"line_max": 119,
"alpha_frac": 0.6795990566,
"autogenerated": false,
"ratio": 3.087004004368402,
"config_te... |
"""Additional test images.
For more images, see
- http://sipi.usc.edu/database/database.php
"""
import numpy as np
from scipy import ndimage
from skimage.io import imread
import os.path as _osp
data_dir = _osp.abspath(_osp.dirname(__file__)) + "/data"
def load(f):
"""Load an image file located in the data di... | {
"repo_name": "michaelborck/ipfe",
"path": "ipfe/data.py",
"copies": "1",
"size": "9042",
"license": "bsd-3-clause",
"hash": 381209431492486000,
"line_mean": 23.5706521739,
"line_max": 110,
"alpha_frac": 0.6280690113,
"autogenerated": false,
"ratio": 3.41981845688351,
"config_test": false,
"h... |
""" Additional TileStache cache providers.
"""
import os
from os.path import exists
import hashlib
from wsgiref.headers import Headers
from TileStache.Core import TheTileLeftANote
from TileStache.Caches import Disk
class SparseCache(Disk):
""" Disk cache which 404s "empty" tiles.
"""
def __init__(self,... | {
"repo_name": "stamen/tilestache-goodies",
"path": "stamen/__init__.py",
"copies": "1",
"size": "2724",
"license": "bsd-3-clause",
"hash": 3941888326459323000,
"line_mean": 25.9702970297,
"line_max": 84,
"alpha_frac": 0.580763583,
"autogenerated": false,
"ratio": 3.721311475409836,
"config_test... |
'Additional tools'
# Authors: Afshine Amidi <lastname@mit.edu>
# Shervine Amidi <firstname@stanford.edu>
# MIT License
import csv
import threading
csv.field_size_limit(10**7)
def read_dict(path):
'Reads Python dictionary stored in a csv file'
dictionary = {}
for key, val in csv.reader(open(pa... | {
"repo_name": "shervinea/enzynet",
"path": "enzynet/tools.py",
"copies": "1",
"size": "1469",
"license": "mit",
"hash": 7166020229225057000,
"line_mean": 25.7090909091,
"line_max": 81,
"alpha_frac": 0.6439754935,
"autogenerated": false,
"ratio": 3.489311163895487,
"config_test": false,
"has_n... |
"""Additional utilities"""
import numpy as np
from ..coreDataContainers import Variable
def generateRandomVariable(shape, transpose=False, nInputs=1):
"""Generate a ga.Variable of a given shape filled with random values
from a Gaussian distribution with mean 0.
If the transpose flag is set, generate a Va... | {
"repo_name": "jgolebiowski/graphAttack",
"path": "graphAttack/gaUtilities/misc.py",
"copies": "1",
"size": "2823",
"license": "mit",
"hash": 4774768542845561000,
"line_mean": 23.1282051282,
"line_max": 80,
"alpha_frac": 0.6291179596,
"autogenerated": false,
"ratio": 4.397196261682243,
"config_... |
# ./additional_xml.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:e92452c8d3e28a9e27abfc9994d2007779e7f4c9
# Generated 2018-02-11 21:12:19.981503 by PyXB version 1.2.6 using Python 3.6.3.final.0
# Namespace AbsentNamespace0
from __future__ import unicode_literals
import pyxb
import pyxb.binding
import pyxb.binding.... | {
"repo_name": "TrafficSenseMSD/core",
"path": "ts_core/config/bindings/additional_xml.py",
"copies": "1",
"size": "726215",
"license": "epl-1.0",
"hash": 1775665385447303400,
"line_mean": 53.7549574003,
"line_max": 307,
"alpha_frac": 0.704862885,
"autogenerated": false,
"ratio": 3.366236354787123... |
#additions of code for layer printing
#under line
#stream_auc = tf.contrib.metrics.streaming_auc(predictions = tf.round(tf.nn.sigmoid(pred)), labels = tf.round(y))
#
#added commands
image = tf.reshape(x, shape=[-1, 120, 120, 1])
h_conv1=conv2d(image, weights['wc1'], biases['bc1'])
#h_conv1_mp = maxpool2d... | {
"repo_name": "emarkou/Audio-auto-tagging",
"path": "aux_layer_to_image_enhancement.py",
"copies": "1",
"size": "2186",
"license": "mit",
"hash": 8021023714165200000,
"line_mean": 48.8372093023,
"line_max": 170,
"alpha_frac": 0.6006404392,
"autogenerated": false,
"ratio": 2.9580514208389714,
"c... |
# Additions that need to be made:
# 1) choose track to convert to binary. e.g. only piano, no drums
# 2) Correct the length of each note.
# 3) add in effects besides note on and note off
# 4) catch if conversion is out of bounds
import csv
import sys
import glob
# CSV file to read from
csv_file = 'morse.t... | {
"repo_name": "spacerafe/Solenoise",
"path": "python3.py",
"copies": "1",
"size": "3725",
"license": "mit",
"hash": 295402787765278000,
"line_mean": 27.5793650794,
"line_max": 82,
"alpha_frac": 0.5551677852,
"autogenerated": false,
"ratio": 3.3987226277372264,
"config_test": false,
"has_no_ke... |
""" Additions to python's shutil standard library """
import fnmatch
import glob
import os
import shutil
import subprocess
import time
import zipfile
class SvnError(Exception):
pass
def svn_checkout(remote, local):
""" Check out repository 'remote' to 'local' path """
if subprocess.call(['svn', 'co', ... | {
"repo_name": "uozuAho/doit_helpers",
"path": "doit_helpers/shutil2.py",
"copies": "1",
"size": "3559",
"license": "mit",
"hash": 4528998315549651500,
"line_mean": 28.9075630252,
"line_max": 83,
"alpha_frac": 0.6226468109,
"autogenerated": false,
"ratio": 4.062785388127854,
"config_test": false... |
# Additive models
import random
from copy import copy
import numpy as np
from numpy.linalg import eigh
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plot
class AdditiveModel():
def __init__(self):
self.knots = None
self.X = None
self.Y = None
s... | {
"repo_name": "bsautrey/generalized-additive-models",
"path": "gam.py",
"copies": "1",
"size": "13243",
"license": "mit",
"hash": 67591255135136990,
"line_mean": 32.614213198,
"line_max": 151,
"alpha_frac": 0.4859925999,
"autogenerated": false,
"ratio": 3.253808353808354,
"config_test": true,
... |
# Additive number is a string whose digits can form additive sequence.
#
# A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the sequence must be the sum of the preceding two.
#
# For example:
# "112358" is an additive number because the digit... | {
"repo_name": "darrencheng0817/AlgorithmLearning",
"path": "Python/leetcode/AdditiveNumber.py",
"copies": "1",
"size": "1827",
"license": "mit",
"hash": 8526398470927179000,
"line_mean": 32.8518518519,
"line_max": 177,
"alpha_frac": 0.5249042146,
"autogenerated": false,
"ratio": 3.846315789473684... |
"""Additive recursion sequence."""
import numpy
def generalized_golden_ratio(dim):
"""
Using nested radical formula to calculate generalized golden ratio.
Args:
dim (int):
The number of dimension the ratio is to be used in.
Returns:
(float):
The generalize gol... | {
"repo_name": "jonathf/chaospy",
"path": "chaospy/distributions/sampler/sequences/additive_recursion.py",
"copies": "1",
"size": "2296",
"license": "mit",
"hash": -3687100003842804000,
"line_mean": 31.338028169,
"line_max": 79,
"alpha_frac": 0.581010453,
"autogenerated": false,
"ratio": 3.4115898... |
"""Add job and schedule 's isDeleted fields.
Revision ID: 1b595e095951
Revises: b85f81a9f3cf
Create Date: 2016-08-04 20:25:24.702258
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1b595e095951'
down_revision = 'b85f81a9f3cf'
def upgrade():
"""Add is job ... | {
"repo_name": "scattm/DanceCat",
"path": "migrations/versions/1b595e095951_.py",
"copies": "1",
"size": "1057",
"license": "mit",
"hash": 3715140251793046500,
"line_mean": 30.0882352941,
"line_max": 62,
"alpha_frac": 0.550614948,
"autogenerated": false,
"ratio": 3.973684210526316,
"config_test"... |
"""Add Jobs
Revision ID: 5da21d856a57
Revises: edd910853060
Create Date: 2017-07-30 16:43:35.839411
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5da21d856a57'
down_revision = 'edd910853060'
branch_labels = None
depends_on = None
def upgrade():
op.crea... | {
"repo_name": "charlesj/Apollo",
"path": "database/versions/5da21d856a57_add_jobs.py",
"copies": "1",
"size": "1454",
"license": "mit",
"hash": 26698565045155436,
"line_mean": 32.0454545455,
"line_max": 81,
"alpha_frac": 0.6568088033,
"autogenerated": false,
"ratio": 3.342528735632184,
"config_... |
"""Add jobs table
Revision ID: 5706baf73b01
Revises: 6bd350cf4748
Create Date: 2016-09-14 15:53:50.394610
"""
# revision identifiers, used by Alembic.
revision = '5706baf73b01'
down_revision = '6bd350cf4748'
from alembic import op
import sqlalchemy as sa
import server
def upgrade():
### commands auto generate... | {
"repo_name": "Cal-CS-61A-Staff/ok",
"path": "migrations/versions/5706baf73b01_add_jobs_table.py",
"copies": "1",
"size": "1741",
"license": "apache-2.0",
"hash": 5282669216772338000,
"line_mean": 37.6888888889,
"line_max": 102,
"alpha_frac": 0.6593911545,
"autogenerated": false,
"ratio": 3.17700... |
"""add_job_to_gen_task
Revision ID: 9aa153cb12a4
Revises: 1e0b1d3e3cca
Create Date: 2016-09-08 09:59:15.023182
"""
# revision identifiers, used by Alembic.
revision = '9aa153cb12a4'
down_revision = '1e0b1d3e3cca'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(eng... | {
"repo_name": "fedspendingtransparency/data-act-broker-backend",
"path": "dataactcore/migrations/versions/9aa153cb12a4_add_job_to_gen_task.py",
"copies": "2",
"size": "1503",
"license": "cc0-1.0",
"hash": -1075958835865058400,
"line_mean": 31.6739130435,
"line_max": 148,
"alpha_frac": 0.6859614105,
... |
"""Add journal and submission spam filtering
Revision ID: 6f71a90cff21
Revises: 9270baf773a5
Create Date: 2019-08-31 00:56:04.057666
"""
# revision identifiers, used by Alembic.
revision = '6f71a90cff21'
down_revision = 'a48c39473126'
from alembic import op # lgtm[py/unused-import]
import sqlalchemy as sa # lgtm... | {
"repo_name": "Weasyl/weasyl",
"path": "libweasyl/libweasyl/alembic/versions/6f71a90cff21_add_journal_and_submission_spam_.py",
"copies": "1",
"size": "2307",
"license": "apache-2.0",
"hash": 9168968821777637000,
"line_mean": 51.4318181818,
"line_max": 171,
"alpha_frac": 0.6918075423,
"autogenerate... |
"""Add Keach
Revision ID: 53ed37276d53
Revises: cbef96b83a96
Create Date: 2017-10-21 12:50:07.872595
"""
from alembic import op # type: ignore
import sqlalchemy as sa # type: ignore
from sqlalchemy.sql import table, column # type: ignore
from typing import Tuple, List, Dict, Any # noqa
from mypy_extensions import... | {
"repo_name": "bryanforbes/Erasmus",
"path": "alembic/versions/53ed37276d53_add_keach.py",
"copies": "1",
"size": "2182",
"license": "bsd-3-clause",
"hash": 5675630940486015000,
"line_mean": 30.6231884058,
"line_max": 103,
"alpha_frac": 0.6159486709,
"autogenerated": false,
"ratio": 3.43081761006... |
"""AddKeyToList
Adds/Updates a Key to a JSON-backed List
"""
import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
from typing import Dict, Any
import traceback
''' STANDALONE FUNCTION '''
def add_key_to_list(li... | {
"repo_name": "demisto/content",
"path": "Packs/CommonScripts/Scripts/AddKeyToList/AddKeyToList.py",
"copies": "1",
"size": "2769",
"license": "mit",
"hash": -7223711860547449000,
"line_mean": 27.5463917526,
"line_max": 118,
"alpha_frac": 0.6309136873,
"autogenerated": false,
"ratio": 3.624345549... |
"""add kingdoms
Revision ID: ea6f4ddd78a9
Revises: e7a0ff5cc43c
Create Date: 2016-09-27 15:06:14.662950
"""
# revision identifiers, used by Alembic.
revision = 'ea6f4ddd78a9'
down_revision = 'e7a0ff5cc43c'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects... | {
"repo_name": "EliRibble/dominus",
"path": "alembic/versions/ea6f4ddd78a9_add_kingdoms.py",
"copies": "1",
"size": "3479",
"license": "mit",
"hash": -2927172798174804000,
"line_mean": 48.7,
"line_max": 114,
"alpha_frac": 0.686979017,
"autogenerated": false,
"ratio": 3.354869816779171,
"config_t... |
"""Add knowledge base
Revision ID: 15f55946909
Revises: 1dd1f9d85e2e
Create Date: 2014-11-15 22:09:02.701979
"""
# revision identifiers, used by Alembic.
revision = '15f55946909'
down_revision = '1dd1f9d85e2e'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('knowledgebase_article... | {
"repo_name": "404d/Temporals-Web",
"path": "temporals_web/migration/versions/201411152209_15f55946909_add_knowledge_base.py",
"copies": "2",
"size": "1813",
"license": "mit",
"hash": 6912378755666116000,
"line_mean": 35.26,
"line_max": 83,
"alpha_frac": 0.6872586873,
"autogenerated": false,
"rat... |
"""Add labels to component ports for lab measurements
"""
from typing import Callable, Optional, Union
import phidl.device_layout as pd
from phidl.device_layout import Label
import pp
from pp.component import Component, ComponentReference
from pp.port import Port
from pp.types import Layer
def get_optical_text(
... | {
"repo_name": "gdsfactory/gdsfactory",
"path": "pp/add_labels.py",
"copies": "1",
"size": "5452",
"license": "mit",
"hash": -2949221566458281500,
"line_mean": 27.3958333333,
"line_max": 86,
"alpha_frac": 0.6254585473,
"autogenerated": false,
"ratio": 3.441919191919192,
"config_test": false,
"... |
""" Add language and time zone to user profile
Revision ID: 736f035d9c77
Revises: d0bbf6c460f5
Create Date: 2016-03-04 20:37:33.149292
"""
# revision identifiers, used by Alembic.
revision = '736f035d9c77'
down_revision = 'd0bbf6c460f5'
from alembic import op
import sqlalchemy as sa
def upgrade():
### command... | {
"repo_name": "betterlife/psi",
"path": "psi/migrations/versions/14_736f035d9c77_.py",
"copies": "2",
"size": "1032",
"license": "mit",
"hash": -3902110483951657000,
"line_mean": 31.25,
"line_max": 80,
"alpha_frac": 0.6676356589,
"autogenerated": false,
"ratio": 3.225,
"config_test": false,
"... |
""" Add language column to projects
Revision ID: 219963bb18dc
Revises: 4f685c062cff
Create Date: 2015-09-21 18:06:53.922781
"""
# revision identifiers, used by Alembic.
revision = '219963bb18dc'
down_revision = '4f685c062cff'
from alembic import op
import sqlalchemy as sa
from models import JsonType
def upgrade()... | {
"repo_name": "smalley/cfapi",
"path": "migrations/versions/219963bb18dc_add_language_column.py",
"copies": "3",
"size": "2579",
"license": "mit",
"hash": -1822151017231745800,
"line_mean": 39.9365079365,
"line_max": 155,
"alpha_frac": 0.6638231873,
"autogenerated": false,
"ratio": 3.547455295735... |
"""Add languages
Revision ID: 2b963e6ca2a2
Revises: 3aac2c8dbcb6
Create Date: 2017-06-11 19:01:30.554383
"""
# revision identifiers, used by Alembic.
revision = '2b963e6ca2a2'
down_revision = '3aac2c8dbcb6'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | {
"repo_name": "gateway4labs/labmanager",
"path": "alembic/versions/2b963e6ca2a2_add_languages.py",
"copies": "5",
"size": "1725",
"license": "bsd-2-clause",
"hash": -5746512356033352000,
"line_mean": 42.125,
"line_max": 96,
"alpha_frac": 0.7008695652,
"autogenerated": false,
"ratio": 3.0969479353... |
"""Add last check
Revision ID: 5ac5404bfcd9
Revises: 100cfe53a84
Create Date: 2015-05-11 18:13:41.180372
"""
# revision identifiers, used by Alembic.
revision = '5ac5404bfcd9'
down_revision = '100cfe53a84'
import datetime
from alembic import op
import sqlalchemy as sa
import sqlalchemy.sql as sql
import sys
sys.pa... | {
"repo_name": "morelab/appcomposer",
"path": "alembic/versions/5ac5404bfcd9_add_last_check.py",
"copies": "3",
"size": "1453",
"license": "bsd-2-clause",
"hash": 4789112052578327000,
"line_mean": 31.2888888889,
"line_max": 191,
"alpha_frac": 0.7295251204,
"autogenerated": false,
"ratio": 3.641604... |
"""add last login to user table
Revision ID: cdcaa9c693e3
Revises: 608afa719fb8
Create Date: 2016-04-04 13:40:48.574963
"""
# revision identifiers, used by Alembic.
revision = 'cdcaa9c693e3'
down_revision = 'a04d38e74be3'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def up... | {
"repo_name": "fedspendingtransparency/data-act-core",
"path": "dataactcore/migrations/versions/cdcaa9c693e3_add_last_login_to_user_table.py",
"copies": "1",
"size": "1541",
"license": "cc0-1.0",
"hash": 4606191714504750600,
"line_mean": 22.3484848485,
"line_max": 103,
"alpha_frac": 0.6612589228,
"... |
"""Add last_used_ip and use_count to tokens
Revision ID: 5cbb0eb12eb3
Revises: 1b7e98f581bc
Create Date: 2021-06-30 13:49:55.566636
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '5cbb0eb12eb3'
down_revision = '1b7e98... | {
"repo_name": "indico/indico",
"path": "indico/migrations/versions/20210630_1349_5cbb0eb12eb3_add_last_used_ip_and_use_count_to_tokens.py",
"copies": "1",
"size": "1247",
"license": "mit",
"hash": 4977818263105297000,
"line_mean": 36.7878787879,
"line_max": 117,
"alpha_frac": 0.7000801925,
"autogen... |
# add LDDMM shooting code into path
import sys
sys.path.append('../../vectormomentum/Code/Python');
from subprocess import call
import argparse
import os.path
#Add LDDMM registration related libraries
# pyca modules
import PyCA.Core as ca
import PyCA.Common as common
import numpy as np
from skimage import exposure
p... | {
"repo_name": "rkwitt/quicksilver",
"path": "code/tools/preprocessing/affine_and_histogram_eq.py",
"copies": "1",
"size": "3787",
"license": "apache-2.0",
"hash": 6391856064842232000,
"line_mean": 45.1829268293,
"line_max": 203,
"alpha_frac": 0.6329548455,
"autogenerated": false,
"ratio": 3.69103... |
# add LDDMM shooting code into path
import sys
sys.path.append('../vectormomentum/Code/Python')
sys.path.append('../library')
from subprocess import call
import argparse
import os.path
import gc
#Add deep learning related libraries
from collections import Counter
import torch
from torch.utils.serialization import load... | {
"repo_name": "rkwitt/quicksilver",
"path": "code/tools/qs_train.py",
"copies": "1",
"size": "9174",
"license": "apache-2.0",
"hash": 3026164173014974000,
"line_mean": 42.8947368421,
"line_max": 201,
"alpha_frac": 0.7135382603,
"autogenerated": false,
"ratio": 3.140705237932215,
"config_test": ... |
# add LDDMM shooting code into path
import sys
sys.path.append('../vectormomentum/Code/Python');
sys.path.append('../library')
from subprocess import call
import argparse
import os.path
#Add deep learning related libraries
from collections import Counter
import torch
import prediction_network
import util
import numpy... | {
"repo_name": "rkwitt/quicksilver",
"path": "code/applications/qs_predict_probablistic.py",
"copies": "1",
"size": "9413",
"license": "apache-2.0",
"hash": 8798789634040187000,
"line_mean": 45.599009901,
"line_max": 185,
"alpha_frac": 0.6646127696,
"autogenerated": false,
"ratio": 3.6541149068322... |
"""Add legal entity city, county, and state info to PublishedAwardFinancialAssistance
Revision ID: 0ca75433c435
Revises: 18d9b114c1dc
Create Date: 2017-07-31 10:56:52.937763
"""
# revision identifiers, used by Alembic.
revision = '0ca75433c435'
down_revision = '18d9b114c1dc'
branch_labels = None
depends_on = None
f... | {
"repo_name": "fedspendingtransparency/data-act-broker-backend",
"path": "dataactcore/migrations/versions/0ca75433c435_add_legal_entity_city_county_and_state_info_.py",
"copies": "1",
"size": "1814",
"license": "cc0-1.0",
"hash": 8372764542335311000,
"line_mean": 36.7916666667,
"line_max": 122,
"alph... |
"""Add legal_entity_congressional to detached and published award financial assistance tables
Revision ID: f57696aefcc1
Revises: 41350e71ae8c
Create Date: 2017-04-21 10:12:04.850729
"""
# revision identifiers, used by Alembic.
revision = 'f57696aefcc1'
down_revision = '41350e71ae8c'
branch_labels = None
depends_on =... | {
"repo_name": "fedspendingtransparency/data-act-broker-backend",
"path": "dataactcore/migrations/versions/f57696aefcc1_add_legal_entity_congressional_to_.py",
"copies": "1",
"size": "1206",
"license": "cc0-1.0",
"hash": 6793217650237457000,
"line_mean": 27.7142857143,
"line_max": 124,
"alpha_frac": 0... |
"""Add legal_entity_congressional to DetachedAwardFinancialAssistance table
Revision ID: c36ce06daaa1
Revises: 5f1470603fa0
Create Date: 2018-03-06 11:08:38.185497
"""
# revision identifiers, used by Alembic.
revision = 'c36ce06daaa1'
down_revision = '5f1470603fa0'
branch_labels = None
depends_on = None
from alembi... | {
"repo_name": "fedspendingtransparency/data-act-broker-backend",
"path": "dataactcore/migrations/versions/c36ce06daaa1_add_legal_entity_congressional_to_.py",
"copies": "1",
"size": "1297",
"license": "cc0-1.0",
"hash": -2346838504123981000,
"line_mean": 29.880952381,
"line_max": 179,
"alpha_frac": 0... |
"""Add LetterTemplates
Revision ID: 9005ab594598
Revises: 949aebe9e480
Create Date: 2018-03-20 18:41:57.143317
"""
# revision identifiers, used by Alembic.
revision = "9005ab594598"
down_revision = "949aebe9e480"
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alem... | {
"repo_name": "CityOfNewYork/NYCOpenRecords",
"path": "migrations/versions/9005ab594598_add_lettertemplates.py",
"copies": "1",
"size": "1256",
"license": "apache-2.0",
"hash": 6739578341837139000,
"line_mean": 25.7234042553,
"line_max": 68,
"alpha_frac": 0.5644904459,
"autogenerated": false,
"ra... |
add_library('box2d_processing')
# add_library('jbox2d')
class Box():
def __init__(self, box2d, x, y):
self.x = x
self.y = y
self.w = 16
self.h = 16
bd = BodyDef()
bd.type = BodyType.DYNAMIC
bd.position.set(box2d.coordPixelsToWorld(self.x, self.y... | {
"repo_name": "kantel/processingpy",
"path": "sketches/box2dtest/box.py",
"copies": "1",
"size": "1050",
"license": "mit",
"hash": -8749425458108634000,
"line_mean": 25.25,
"line_max": 65,
"alpha_frac": 0.5085714286,
"autogenerated": false,
"ratio": 3.29153605015674,
"config_test": false,
"ha... |
# Add lib/ to the import path:
import sys
import os
agent_lib_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../lib')
sys.path.insert(1, agent_lib_dir)
import re
import errno
from checks import AgentCheck
from helpers import reverse_readline
class OOM(AgentCheck):
def check(self, instance):
... | {
"repo_name": "stripe/stripe-datadog-checks",
"path": "checks.d/oom.py",
"copies": "2",
"size": "2792",
"license": "mit",
"hash": -4397761886110943700,
"line_mean": 36.2266666667,
"line_max": 104,
"alpha_frac": 0.5229226361,
"autogenerated": false,
"ratio": 4.86411149825784,
"config_test": fals... |
# Add lib/ to the import path:
import sys
import os
agent_lib_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../lib')
sys.path.insert(1, agent_lib_dir)
import re
from checks import AgentCheck
from collections import defaultdict
from helpers import reverse_readline, parse_fix_timestamp
from datetime ... | {
"repo_name": "stripe/datadog-checks",
"path": "checks.d/segfault.py",
"copies": "2",
"size": "4433",
"license": "mit",
"hash": -5325803012039397000,
"line_mean": 36.8888888889,
"line_max": 107,
"alpha_frac": 0.5761335439,
"autogenerated": false,
"ratio": 4.406560636182903,
"config_test": false... |
# Add lib/ to the import path:
import sys
import os
agent_lib_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../lib')
sys.path.insert(1, agent_lib_dir)
# stdlib
from collections import namedtuple
import urlparse
import json
import time
import sys
# 3p
import requests
# project
from checks import Ag... | {
"repo_name": "stripe/stripe-datadog-checks",
"path": "checks.d/storm_rest_api.py",
"copies": "2",
"size": "13207",
"license": "mit",
"hash": 7086271769188336000,
"line_mean": 42.4440789474,
"line_max": 129,
"alpha_frac": 0.5700007572,
"autogenerated": false,
"ratio": 4.036369193154035,
"config... |
# add licence from base project ? or wait til we've modified everything :P ?
from PIL import Image
import logging
class ImageFormatter:
def __init__(self, image_path):
self.image_path = image_path
try:
self.image = Image.open(image_path)
except IOError:
logging.i... | {
"repo_name": "insacloud/insacloud-back",
"path": "insacloud/services/mosaic/ImageFormatter.py",
"copies": "1",
"size": "2773",
"license": "mit",
"hash": -2944896209923318300,
"line_mean": 27.8958333333,
"line_max": 132,
"alpha_frac": 0.5517490083,
"autogenerated": false,
"ratio": 3.6201044386422... |
"""Add linkage model to the DB.
Revision ID: aac638b04072
Revises: a8849e4e6784
Create Date: 2019-12-21 19:47:17.878084
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "aac638b04072"
down_revision = "a8849e4e6784"
def upgrade():
op.create_table(
"l... | {
"repo_name": "alephdata/aleph",
"path": "aleph/migrate/versions/aac638b04072_add_linkage.py",
"copies": "1",
"size": "1518",
"license": "mit",
"hash": -5231175847084169000,
"line_mean": 32.7333333333,
"line_max": 84,
"alpha_frac": 0.6251646904,
"autogenerated": false,
"ratio": 3.343612334801762,... |
"""add link between sample and case
Revision ID: 2f5352038e54
Revises: 156d2138ea8b
Create Date: 2017-02-07 11:06:17.737229
"""
# revision identifiers, used by Alembic.
revision = "2f5352038e54"
down_revision = "156d2138ea8b"
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from... | {
"repo_name": "Clinical-Genomics/housekeeper",
"path": "alembic/versions/2f5352038e54_add_link_between_sample_and_case.py",
"copies": "1",
"size": "1132",
"license": "mit",
"hash": 3860723140657662500,
"line_mean": 28.0256410256,
"line_max": 83,
"alpha_frac": 0.6696113074,
"autogenerated": false,
... |
"""Add list and cards tables
Revision ID: 1c1883fada8
Revises: 18554c40c9e
Create Date: 2015-04-08 20:24:35.892248
"""
# revision identifiers, used by Alembic.
revision = '1c1883fada8'
down_revision = '18554c40c9e'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade()... | {
"repo_name": "lizardschool/wordbook",
"path": "migrations/versions/1c1883fada8_add_list_and_cards_tables.py",
"copies": "1",
"size": "1543",
"license": "mit",
"hash": -454381980561097100,
"line_mean": 33.2888888889,
"line_max": 103,
"alpha_frac": 0.6785482826,
"autogenerated": false,
"ratio": 3.... |
"""Add local time
Revision ID: 56d38b1172f9
Revises: 3999a40ec7b
Create Date: 2017-06-09 19:31:20.999843
"""
# revision identifiers, used by Alembic.
revision = '56d38b1172f9'
down_revision = '3999a40ec7b'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - p... | {
"repo_name": "gateway4labs/labmanager",
"path": "alembic/versions/56d38b1172f9_add_local_time.py",
"copies": "5",
"size": "1964",
"license": "bsd-2-clause",
"hash": -575874088971928600,
"line_mean": 43.6363636364,
"line_max": 100,
"alpha_frac": 0.6822810591,
"autogenerated": false,
"ratio": 2.90... |
"""add local_user_id
Revision ID: 57bbf0c387c
Revises: 13391c68750
Create Date: 2016-04-02 09:54:09.643644
"""
from __future__ import unicode_literals
import sqlalchemy as sa
from alembic import op
from sqlalchemy.sql import table
# revision identifiers, used by Alembic.
revision = "57bbf0c387c"
down_revision = "13... | {
"repo_name": "ergo/ziggurat_foundations",
"path": "ziggurat_foundations/migrations/versions/57bbf0c387c_add_local_user_id.py",
"copies": "1",
"size": "1653",
"license": "bsd-3-clause",
"hash": 703831136301463600,
"line_mean": 25.6612903226,
"line_max": 88,
"alpha_frac": 0.6261343013,
"autogenerate... |
"""Add Locate control to folium Map.
Based on leaflet plugin: https://github.com/domoritz/leaflet-locatecontrol
"""
from branca.element import MacroElement
from folium.elements import JSCSSMixin
from folium.utilities import parse_options
from jinja2 import Template
class LocateControl(JSCSSMixin, MacroElement):
... | {
"repo_name": "python-visualization/folium",
"path": "folium/plugins/locate_control.py",
"copies": "2",
"size": "2302",
"license": "mit",
"hash": -5430750179169502000,
"line_mean": 30.9722222222,
"line_max": 104,
"alpha_frac": 0.6242397915,
"autogenerated": false,
"ratio": 3.8559463986599667,
"... |
"""Add location attributes to Request.
Revision ID: 2f22504b1e6
Revises: None
Create Date: 2014-05-02 13:24:00.045482
"""
# revision identifiers, used by Alembic.
revision = '2f22504b1e6'
down_revision = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import update, select, table, column
imp... | {
"repo_name": "paxswill/evesrp",
"path": "src/evesrp/migrate/versions/2f22504b1e6_.py",
"copies": "1",
"size": "3200",
"license": "bsd-2-clause",
"hash": 4879872680741604000,
"line_mean": 32.3333333333,
"line_max": 78,
"alpha_frac": 0.6303125,
"autogenerated": false,
"ratio": 3.5754189944134076,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.