text
stringlengths
4
1.02M
meta
dict
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Cluster' db.create_table(u'clm_cluster', ( (u'id', self.gf('django.db....
{ "content_hash": "1978d59180e43b90ac81c720a83aae11", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 120, "avg_line_length": 58.3421052631579, "alnum_prop": 0.5461434370771313, "repo_name": "Dev-Cloud-Platform/Dev-Cloud", "id": "70c931a69656084eb2508c001119441641bada7d", ...
from __future__ import absolute_import, division, print_function from stripe import util from stripe.api_resources.abstract import ListableAPIResource class Account(ListableAPIResource): """ A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted so...
{ "content_hash": "d5dd9e339346f5aa00d9814eb89f5165", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 142, "avg_line_length": 30.085714285714285, "alnum_prop": 0.561886672997784, "repo_name": "stripe/stripe-python", "id": "e7e46fb0962280e2e37acd8ac71d713fb38676a7", "size":...
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value fo...
{ "content_hash": "06ca95ed0230e0cce1d587c5254b43c5", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 86, "avg_line_length": 27.212962962962962, "alnum_prop": 0.5382783259612113, "repo_name": "la0rg/Genum", "id": "55888a616ddd28a0a9b7065fb8515cd7213e489e", "size": "5878", ...
keys = ['eth1', 'eth2', 'eth3', 'eth4', 'eth5', 'eth6', 'eth7', 'eth8', 'eth9'] def merge(dbag, gn): device = gn['device'] if not gn['add'] and device in dbag: if dbag[device]: device_to_die = dbag[device][0] try: dbag[device].remove(device_to_die) ...
{ "content_hash": "7d40bac83dc77cc39bc9e5a881df80e1", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 117, "avg_line_length": 28, "alnum_prop": 0.5178571428571429, "repo_name": "remibergsma/cosmic", "id": "dc65c16b4639849b3cfed9135f8397862e3bb57a", "size": "616", "binary"...
from ..utils.utils import * from ..utils.functions import * from ..database.database import * from ..utils.settings import Settings from .SuperCommand import * from ..globals import * from ..globals import GlobalVariables class InfoCommand(SuperCommand): def __init__(self,cmd_handler): super().__init__(cm...
{ "content_hash": "b6b440bf2f3b4aa0f2e8b6eef8cd1361", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 101, "avg_line_length": 40.282051282051285, "alnum_prop": 0.7110120942075111, "repo_name": "samisalkosuo/clipasswordmgr", "id": "b17a257bc52205a1b6568c65d409d0819de9b0e6", ...
import contextlib import exception import os from utils import log from utils.cmd import run def print_list(l, nl_before=False, nl_after=False): if nl_before: log.info("") for e in l: log.info("- %s" % e) if nl_after: log.info("") def ensure_dir(path): if os.path.exists(path...
{ "content_hash": "5a32445829b2c45d98947a4db2a490e2", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 52, "avg_line_length": 18.5, "alnum_prop": 0.5720720720720721, "repo_name": "yac/rdoupdate", "id": "25b008e2d45e93d75d42cf3370c36ef0667fa300", "size": "888", "binary": fa...
__all__ = ["ParseFromValue", \ "CreateValueFrom", \ "CreateElement", \ "CallAtomsJs", \ "VerifyElementClickable", \ "FindElement", \ "IsElementEnabled", \ "IsOptionElementSelected", \ "GetElementSize", \ "IsElementDisplay...
{ "content_hash": "9e09eb2c41f4c98055578955ff1f6b1d", "timestamp": "", "source": "github", "line_count": 467, "max_line_length": 135, "avg_line_length": 37.19700214132762, "alnum_prop": 0.6787749697772149, "repo_name": "PeterWangIntel/crosswalk-webdriver-python", "id": "6aebd982eb103d11abbdf7cf93a8cbe...
try: from hashlib import md5 except ImportError: from md5 import md5 import bisect class ConsistentHashRing: def __init__(self, nodes, replica_count=100): self.ring = [] self.nodes = set() self.replica_count = replica_count for node in nodes: self.add_node(node) def compute_ring_positio...
{ "content_hash": "3fe34971dbf98dbd4d58853b4f98ab2a", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 72, "avg_line_length": 28.559322033898304, "alnum_prop": 0.626706231454006, "repo_name": "mattrobenolt/carbon", "id": "177acfafffe6835264a60f17f19a0ccf76bbd2ca", "size": "1...
import sys import time from datetime import datetime, timedelta, timezone from libqtile.log_utils import logger from libqtile.widget import base try: import pytz except ImportError: pass try: import dateutil.tz except ImportError: pass class Clock(base.InLoopPollText): """A simple but flexible ...
{ "content_hash": "a540b21f2126c9f183ed332198799da7", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 79, "avg_line_length": 36.57377049180328, "alnum_prop": 0.6140744060959211, "repo_name": "tych0/qtile", "id": "98149064e92b5bbedc7a2a4df3481fc41820d069", "size": "3426", ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json from builtins import * import pandas as pd from . import utils class EntrustOrder(object): def __init__(self, security, action, price, size): ...
{ "content_hash": "49788f6ff4f30d520f7a4c34365246b6", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 110, "avg_line_length": 33.298986486486484, "alnum_prop": 0.5017501141378785, "repo_name": "mumuwoyou/vnpy-master", "id": "58f928d21520e6d735e0c119af6bd7fedd5ab335", "size...
import sqlite3 from settings import settings from dryorm.mixin import Mixin class SqliteMixin(Mixin): _param_placeholder = '?' _connection = None @staticmethod def connect(): if not SqliteMixin._connection: SqliteMixin._connection = sqlite3.connect(settings['METADATA']) print settings['METADATA'] return...
{ "content_hash": "99aea8a29c8599fa8f38954e4f69a306", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 66, "avg_line_length": 22.80952380952381, "alnum_prop": 0.7494780793319415, "repo_name": "jAlpedrinha/dryorm", "id": "92b2ae8520e8e056e0044eb1d6fba2dba5dd0994", "size": "47...
import sys import os import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) __ve...
{ "content_hash": "1726379022e473f2afdd3a4d31ef24db", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 79, "avg_line_length": 33.245791245791246, "alnum_prop": 0.7053878873810006, "repo_name": "jonparrott/google-cloud-python", "id": "1ff2461b145db597d5c5d6827381ab2e97fb5216",...
""" General tests for all estimators in sklearn. """ # Authors: Andreas Mueller <amueller@ais.uni-bonn.de> # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause from __future__ import print_function import os import warnings import sys import pkgutil from sklearn.externals.six import PY3 fr...
{ "content_hash": "f0284991933bd2feb825f4ddf8e55dea", "timestamp": "", "source": "github", "line_count": 393, "max_line_length": 83, "avg_line_length": 41.659033078880405, "alnum_prop": 0.6399951136086001, "repo_name": "evgchz/scikit-learn", "id": "0dbf18e46bb0c4ff485f3db57e562a0d2ad4ae63", "size": ...
"""Custom marshmallow fields.""" from .datetime import DateString from .generated import GenFunction, GenMethod from .marshmallow_contrib import Function, Method from .persistentidentifier import PersistentIdentifier from .sanitizedhtml import SanitizedHTML from .sanitizedunicode import SanitizedUnicode from .trimmeds...
{ "content_hash": "b2cd1ce2fbf7dfb5347edaa5fa645b8f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 54, "avg_line_length": 25.714285714285715, "alnum_prop": 0.75, "repo_name": "inveniosoftware/invenio-records-rest", "id": "3144d39e315aae75e38796fccc3bc5e42aaf4700", "size"...
__author__ = 'Yaroslav Halchenko' __license__ = 'BSD' from nose.tools import assert_equal try: from sklearn import * _top_import_error = None except Exception, e: _top_import_error = e def test_import_skl(): """Test either above import has failed for some reason "import *" is discouraged outsid...
{ "content_hash": "48463e03e2ece6f52b30d621a874fc39", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 67, "avg_line_length": 23.36842105263158, "alnum_prop": 0.6756756756756757, "repo_name": "ominux/scikit-learn", "id": "18fb44b2a0601732fef3be269a53da7913158f99", "size": "6...
ANSIBLE_METADATA = { 'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.0' } DOCUMENTATION = ''' --- module: bigip_pool short_description: "Manages F5 BIG-IP LTM pools" description: - Manages F5 BIG-IP LTM pools via iControl SOAP API version_added: 1.2 author: - Matt Hite (@mhit...
{ "content_hash": "a36344d06cbdbe9baa8dec1f33af5530", "timestamp": "", "source": "github", "line_count": 570, "max_line_length": 166, "avg_line_length": 33.717543859649126, "alnum_prop": 0.5708413549092044, "repo_name": "mcgonagle/ansible_f5", "id": "846ad2ce0e87efac26ac901fffc668fe74df877e", "size"...
""" @author: achm Final ensemble of strong and weak model, weight based on ../ensemble_weight """ import numpy as np import pandas as pd import sys sys.path.append('../input') import evaluation import cPickle import copy import glob import os print("Load test data using pandas") test = pd.read_csv(...
{ "content_hash": "cd2c1e42b10d6f98d1602352b9b488f6", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 166, "avg_line_length": 45.25373134328358, "alnum_prop": 0.5798153034300791, "repo_name": "achm6174/kaggle-physics-tau", "id": "fe12ad06b35d2d54c70f3169192c6e64ab3f95e8", ...
from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.utils.feedgenerator import Atom1Feed from django.utils.html import strip_tags ...
{ "content_hash": "e1ac00d3bffc78fb8fe5f01cf17086d1", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 78, "avg_line_length": 32.771929824561404, "alnum_prop": 0.6354389721627409, "repo_name": "Kniyl/mezzanine", "id": "280330c9d8d83fb0e0090021bbca6eeb3c718903", "size": "373...
"""Certificate chain where the intermediate has a basic constraints extension that indicates it is NOT a CA.""" import sys sys.path += ['../..'] import gencerts # Self-signed root certificate. root = gencerts.create_self_signed_root_certificate('Root') # Intermediate with incorrect basic constraints. intermediate =...
{ "content_hash": "e25960b4569d72b48a64bf540164e1c7", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 33.04761904761905, "alnum_prop": 0.7190201729106628, "repo_name": "chromium/chromium", "id": "f130ad6e63ee4f15b25074c9594f284d0d522f03", "size": "857...
import sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() cur.executescript(""" create table person( firstname, lastname, age ); create table book( title, author, published ); insert into book(title, author, publish...
{ "content_hash": "3c8d4adc3073d63ae752dc6f874795eb", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 52, "avg_line_length": 19.615384615384617, "alnum_prop": 0.5215686274509804, "repo_name": "janusnic/21v-python", "id": "cab81861d46f9709273e75cea9e8489b067f87ec", "size": "...
from __future__ import unicode_literals, absolute_import import os import pytest import django from configurations import importer os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings') os.environ.setdefault('DJANGO_CONFIGURATION', 'StandaloneTest') def pytest_configure(): importer.install() # ...
{ "content_hash": "cfbc1967a5664d94aa1ac70568c86c47", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 68, "avg_line_length": 23.448979591836736, "alnum_prop": 0.72236727589208, "repo_name": "tangentlabs/django-fancypages", "id": "05af486aa9a9bef012b869d1b2f48c95e67bfa60", "...
import mock from sahara import exceptions as ex from sahara.plugins import base as pb from sahara.plugins.cdh.v5_9_0 import edp_engine from sahara.plugins import exceptions as pl_ex from sahara.tests.unit import base as sahara_base from sahara.tests.unit.plugins.cdh import utils as c_u from sahara.utils import edp d...
{ "content_hash": "dc8b080e938a8b931efe725d2f32f6e1", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 78, "avg_line_length": 43.6972972972973, "alnum_prop": 0.6262988619495299, "repo_name": "egafford/sahara", "id": "de0f6139f188d4b3637e5f6e9db7630e63562c05", "size": "8671"...
import os import datetime import logging from django.db import models from django.db.models import Q from django.utils import timezone from pysearpc import SearpcError from seaserv import seafile_api from seahub.auth.signals import user_logged_in from seahub.utils import calc_file_path_hash, within_time_range, \ ...
{ "content_hash": "1495edf6002b43273ee3971ca799097e", "timestamp": "", "source": "github", "line_count": 350, "max_line_length": 105, "avg_line_length": 34.17142857142857, "alnum_prop": 0.5929765886287626, "repo_name": "miurahr/seahub", "id": "068d87bd1c2a1d4f0a3d1c6a6018fc13eec7033a", "size": "1199...
import logging from neutronclient.neutron import v2_0 as neutronv20 class ListVPNService(neutronv20.ListCommand): """List VPNService configurations that belong to a given tenant.""" resource = 'vpnservice' log = logging.getLogger(__name__ + '.ListVPNService') list_columns = [ 'id', 'name', '...
{ "content_hash": "7559da3a86f49c723e4900c28ea3f611", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 77, "avg_line_length": 32.43589743589744, "alnum_prop": 0.5972332015810277, "repo_name": "neumerance/deploy", "id": "0f9e92b0d91a6206a55db4d0ceba78e9ad4f0f2d", "size": "329...
from django.conf import settings from django.core import exceptions from django.utils.importlib import import_module CLASS_PATH_ERROR = '''django-shop is unable to interpret settings value for %s. %s should ' \ 'be in ther form of a tuple: (\'path.to.models.Class\', \'app_label\')...
{ "content_hash": "06fc3608ec323800cef0f21de25e3693", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 102, "avg_line_length": 37.05747126436781, "alnum_prop": 0.5911910669975186, "repo_name": "airtonix/django-shop", "id": "3f6043792d0d19507c62521056a6e9345b750ea6", "size": ...
class SkeletonProvider(object): """ A skeleton of a metadata provider. """ def __init__(self, *args): """ Initialize the metadata provider. Parameters ---------- args: Arguments given in the config file. """ def formats(se...
{ "content_hash": "c14a33e32785042e53552add4cf32cc0", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 91, "avg_line_length": 31.663716814159294, "alnum_prop": 0.5036333147009503, "repo_name": "Tietoarkisto/kuha", "id": "aa9bddaaf0d453037095648158976b8b8f7aaaf1", "size": "3...
import time # third party related imports from sqlalchemy import Column, Integer, String # local library imports from mobile_push.models.base import Base class ApnsToken(Base): __tablename__ = 'apns_tokens' token = Column(String, primary_key=True) application_arn = Column(String, primary_key=True) ...
{ "content_hash": "d528c04edf0821ed1665721839f3d352", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 66, "avg_line_length": 27.38888888888889, "alnum_prop": 0.7221095334685599, "repo_name": "theKono/mobile-push", "id": "316b786a0801b89e7885f3ae96c56d7d77bf869e", "size": "5...
from bot import OgameBot class LoggerBot(OgameBot): """Logging functions for the bot""" def log_planets(self): """Log planets info""" planets = self.planets self.logger.info("Logging planets") for planet in planets: self.logger.info(planet) def log_defenses(se...
{ "content_hash": "2a67cfbc3b3262a99af9be85c847f795", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 87, "avg_line_length": 33.21917808219178, "alnum_prop": 0.6074226804123711, "repo_name": "winiciuscota/OG-Bot", "id": "017abed6153397b1be6db8ad03c20482e3ef978f", "size": "2...
import tensorflow as tf import numpy as np import unittest from dnc.memory import Memory def random_softmax(shape, axis): rand = np.random.uniform(0, 1, shape).astype(np.float32) return np.exp(rand) / np.sum(np.exp(rand), axis=axis, keepdims=True) class DNCMemoryTests(unittest.TestCase): def test_constr...
{ "content_hash": "a2ea769674ee8d502e1566c76b61d46f", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 232, "avg_line_length": 44.58536585365854, "alnum_prop": 0.5420541575492341, "repo_name": "Mostafa-Samir/DNC-tensorflow", "id": "31705c7865dd9582ed665851005d9df552316270", ...
""" Contains utility functions and classes for Runners. """ from behave import parser from behave.model import FileLocation from bisect import bisect import glob import os.path import re import sys import types # ----------------------------------------------------------------------------- # EXCEPTIONS: # ----------...
{ "content_hash": "741121fc493b2293aaa153b7c0d64534", "timestamp": "", "source": "github", "line_count": 397, "max_line_length": 80, "avg_line_length": 35.88413098236776, "alnum_prop": 0.5859890495577706, "repo_name": "WillisXChen/django-oscar", "id": "ee1dd6ac19d69a067a6ce76fdbb7a5a1e578c025", "siz...
from flask import jsonify, make_response, Response from flask_sqlalchemy import SQLAlchemy from src.webservice.base import Base db = SQLAlchemy() Base.query = db.session.query_property() class Output(Base): __tablename__ = 'tbl_OutputPin' id = db.Column(db.Integer, primary_key=True) number = db.Column(db...
{ "content_hash": "05dee673c125e2071f577d261fdae482", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 127, "avg_line_length": 35.52459016393443, "alnum_prop": 0.6119058606368251, "repo_name": "deklungel/iRulez", "id": "c40a12fbd14b3fe2410ddbec936219b6d691559a", "size": "216...
def sing(b, end): print(b or 'No more', 'bottle' + ('s' if b-1 else ''), end) for i in range(99, 0, -1): sing(i, 'of beer on the wall,') sing(i, 'of beer,') print "Take one down, and pass it around," sing(i-1, 'of beer on the wall.\n') verse = '''\ {some} bottles of beer on the wall {some} bottles...
{ "content_hash": "2bf00e53233fa776501b87ebf23e720a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 63, "avg_line_length": 26.944444444444443, "alnum_prop": 0.6164948453608248, "repo_name": "juandc/platzi-courses", "id": "bf5e8fba181be8754e864b932be16516d158cfad", "size":...
''' Python3 program for extracting fpkm data from cuffdiff outputs and writing it to a file in a two dimensional matrix of values with one gene per line and each condition clustered. Output will preserve the exact order of the input. Written by Michael Weinstein, UCLA Cohn Lab and Collaboratory, 2015 ''' def yesansw...
{ "content_hash": "5fcb175f259319f51460603f45dbb462", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 251, "avg_line_length": 68.77380952380952, "alnum_prop": 0.6734464254803532, "repo_name": "michael-weinstein/UCLA-CPU", "id": "64f0d56f7c1d832cf03474b530ca489896dc37c0", "...
""" Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License ...
{ "content_hash": "22e46eb3c0398e49f666d11deb16748a", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 216, "avg_line_length": 38.625352112676055, "alnum_prop": 0.6621936989498249, "repo_name": "hughperkins/coriander", "id": "cdf2b31e55583bb63f392e76c972fef7468c4a5c", "size...
__author__ = 'Bruno Quint' import os import unittest from goodman_pipeline.core import check_version __version__ = __import__('goodman_pipeline').__version__ class TestVersionChecker(unittest.TestCase): def test_get_last(self): try: v = check_version.get_last() self.assertRegex...
{ "content_hash": "4d5f7cbc7f8df64db11404be0d0b643f", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 73, "avg_line_length": 31.325581395348838, "alnum_prop": 0.5612472160356348, "repo_name": "simontorres/goodman", "id": "5bfbbd512f9e061e2d4aa3dfc7e62f8f7ad5e302", "size": "...
from __future__ import print_function,division import sys, os sys.path.append(os.path.abspath(".")) import numpy as np import matplotlib.pyplot as plt __author__ = 'panzer' COLORS = ["blue", "green", "red", "cyan", "magenta", "yellow", "saddlebrown", "orange", "darkgreen"] def bar_plot(data, y_label, title, path, fo...
{ "content_hash": "0f71683f87147a5a092aa3e41c3817c4", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 100, "avg_line_length": 26.625, "alnum_prop": 0.6253521126760564, "repo_name": "bigfatnoob/optima", "id": "2aef10074f12e7bbef34c66f207467bceeb741b3", "size": "1065", "bin...
"""Provides mechanisms to time-slice Reach Gym Environments. Example usage - agent1 = KittingAgent() agent2 = KittingAgent(new_features=True) with gym.make("benchmark-kitting-v0") as env: env_time_slicer.randomized_run( env, # Environment. [agent1.attempt, agent2.attempt], ...
{ "content_hash": "40882420fa06c47dabb6dfbc94a026c3", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 80, "avg_line_length": 39.24576271186441, "alnum_prop": 0.6703735694234506, "repo_name": "google-research/pyreach", "id": "b2b35b671d66c8365d1447c493aa9720cf59479b", "size...
"""Pretrain.""" import dataclasses import importlib from typing import Mapping import jax import jax.numpy as jnp from jestimator import amos from jestimator.data.pipeline_lm import lm_data from jestimator.data.pipeline_seqio import is_seqio, seqio_data # pylint: disable=g-multiple-import from jestimator.models.rope...
{ "content_hash": "63cc29e97a26548034ee02517b91d5a1", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 100, "avg_line_length": 33.325892857142854, "alnum_prop": 0.6630944407233758, "repo_name": "google-research/jestimator", "id": "ae8b2f5deb6fdc319c3716f6852454df5472b718", ...
from django.forms import ModelForm from django import forms from .models import Denuncia class DenunciaForm(ModelForm): class Meta: model = Denuncia
{ "content_hash": "c802046726fd3fdabc9b46baf171a6e5", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 34, "avg_line_length": 18.22222222222222, "alnum_prop": 0.75, "repo_name": "oscarmcm/AlzoMiVoz", "id": "b7b881d4a25129f6c47758c4da940c65adc9ed94", "size": "188", "binary":...
"""Python datastore class User to be used as a datastore data type. Classes defined here: User: object representing a user. Error: base exception type UserNotFoundError: UserService exception RedirectTooLongError: UserService exception NotAllowedError: UserService exception """ import os from google.ap...
{ "content_hash": "f2d3f44d32c0ff528c6a8ca1ea0699e2", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 78, "avg_line_length": 27.347417840375588, "alnum_prop": 0.6684978540772533, "repo_name": "jamslevy/gsoc", "id": "270df4d2dd7d9729fa20bbe7488a8c8c04149992", "size": "6427"...
"""Python layer for image_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.image.ops import gen_single_image_random_dot_stereograms_ops from tensorflow.contrib.util import loader from tensorflow.python.framework import ops from...
{ "content_hash": "85bebbe9537b8adbc36cf34a459708bf", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 124, "avg_line_length": 42.9059829059829, "alnum_prop": 0.6258964143426294, "repo_name": "chemelnucfin/tensorflow", "id": "dfc6af3e55815763fab6b3d102a9b2508c511238", "size...
from google.cloud import aiplatform_v1 async def sample_batch_import_model_evaluation_slices(): # Create a client client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.BatchImportModelEvaluationSlicesRequest( parent="parent_value", ) ...
{ "content_hash": "6a802b95227ddeeee5a9add64b13a260", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 83, "avg_line_length": 29.210526315789473, "alnum_prop": 0.7495495495495496, "repo_name": "googleapis/python-aiplatform", "id": "74c69c11cf9ef902862446569f5bddbcf1dd720d", ...
''' Created By: Quintin Leong Created Date: November 5th, 2014 File Name: get_data.py File Description: Utility to pull all consolidated content data from database in a clean nested format. ''' import MySQLdb, sys import ClassesGetData as classes HOST = "sead.systems" USER = "dataeng" PASSWD = "dataeng" DB = "shempser...
{ "content_hash": "2c065823a7e5973e777d31f6050910d9", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 103, "avg_line_length": 30.089887640449437, "alnum_prop": 0.6030619865571322, "repo_name": "seadsystem/Backend", "id": "f44d05737658826350cf88d4e507cdefe7225207", "size": ...
import glooey import pyglet class MyPlaceholder(glooey.Placeholder): custom_size_hint = 300, 200 # width, height custom_alignment = 'center' window = pyglet.window.Window() gui = glooey.Gui(window) widget = MyPlaceholder() gui.add(widget) pyglet.app.run()
{ "content_hash": "96c99aebcd8923b47cb2d44a57a758be", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 48, "avg_line_length": 18, "alnum_prop": 0.725925925925926, "repo_name": "kxgames/glooey", "id": "798a721247c50cfbb84673de00842e13b26d5b2c", "size": "294", "binary": fals...
import unicode_tex def escape_for_tex(chars): escaped = ''.join(list(map(lambda x : unicode_tex.unicode_to_tex_map.get(x, x), chars))) return escaped.replace('\space', ' ')
{ "content_hash": "9a1d56653afe887e7eeb4500a27d5ddd", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 89, "avg_line_length": 35.2, "alnum_prop": 0.6875, "repo_name": "emrehan/daily-planner", "id": "833d37505b8a49481f46d48b4b06439e47d4396d", "size": "176", "binary": false, ...
from django.shortcuts import render from django.template import RequestContext from django.shortcuts import render, render_to_response from django.views.generic import View from django.http import HttpResponse from django.core import serializers from customers.models import Users as users from customers.models import V...
{ "content_hash": "2fd907973f06c024e7467eb502bd0f0f", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 235, "avg_line_length": 43.395348837209305, "alnum_prop": 0.6580921757770632, "repo_name": "abhaystoic/barati", "id": "5bba33d9228ebc330f7a930bb57b13c1c11911c9", "size": "1...
from __future__ import unicode_literals, print_function from django.db import migrations import datetime data = [{u'comment': u'From *sw\u012b(s) ' 'which reflects the PIE acc. 2 pl. *us-we.', u'source_id': 273, u'reliability': u'A', u'pages': u'48-49', u'modif...
{ "content_hash": "5e59a32c31a5aef77a2676162ac0b818", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 77, "avg_line_length": 40.10606060606061, "alnum_prop": 0.5799017755950132, "repo_name": "lingdb/CoBL-public", "id": "dc34049854f3d2d01eda501af2d63c1db398acbf", "size": "26...
from datetime import datetime import os from django.core.files.base import File from django.core.files.storage import default_storage from django.core.management import call_command from onadata.apps.main.tests.test_base import TestBase from onadata.apps.logger.models import Attachment, Instance from onadata.libs.uti...
{ "content_hash": "86608a61d5751ea23cdc3b6ec18c4d5b", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 78, "avg_line_length": 42.10526315789474, "alnum_prop": 0.61375, "repo_name": "smn/onadata", "id": "e87d1fb7543d8aac5727fc284966c80b5c463973", "size": "3200", "binary": f...
from http import HTTPStatus from oslo_log import log as logging from oslo_utils import strutils import webob from cinder.api import api_utils from cinder.api import common from cinder.api.contrib import resource_common_manage from cinder.api import extensions from cinder.api import microversions as mv from cinder.api...
{ "content_hash": "d3ab3f1b64cd237c95670f1f2c1200f8", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 79, "avg_line_length": 41.66477272727273, "alnum_prop": 0.607527614891586, "repo_name": "mahak/cinder", "id": "3cc246925a276805509f66af570c40add6eeea39", "size": "7926", ...
import sys import logging import colorlog from .main import Turbo __all__ = ['Turbo'] logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) fh = logging.FileHandler( filename='turbo.log', encoding='utf-8', mode='w') fh.setFormatter(logging.Formatter( "[{asctime}] {levelname} ({filename} L{linen...
{ "content_hash": "8b44a122ca99db1ed8b0a44f4e1f19b8", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 88, "avg_line_length": 29.027027027027028, "alnum_prop": 0.6108007448789572, "repo_name": "jaydenkieran/Turbo", "id": "691d4e310241aaa19ca51388be0792d729a21372", "size": "1...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('survey', '0015_auto_20150325_1306'), ] operations = [ migrations.AlterField( model_name='likertquestion', name='scale', ...
{ "content_hash": "77c34b4b648c5a9faa2d2560e6350a1b", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 683, "avg_line_length": 55.36842105263158, "alnum_prop": 0.6653992395437263, "repo_name": "izzyalonso/tndata_backend", "id": "2825a28f52112631ac256f0e9155fcf9f766659a", "si...
import os.path from django.conf import settings from django.core.exceptions import ImproperlyConfigured from djblets.log import siteconfig as log_siteconfig from djblets.siteconfig.django_settings import apply_django_settings, \ get_django_defaults, \ ...
{ "content_hash": "71d87dc107cea59739fe78e083c18d33", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 78, "avg_line_length": 38.012269938650306, "alnum_prop": 0.6223369916074887, "repo_name": "asutherland/opc-reviewboard", "id": "73ff16f1284db3ca8b79d160b587af03bdae6a4b", ...
import os from mock import Mock, MagicMock, patch, mock_open import pexpect from trove.common.exception import GuestError, ProcessExecutionError from trove.common import utils from trove.guestagent import volume from trove.tests.unittests import trove_testtools def _setUp_fake_spawn(return_val=0): fake_spawn = ...
{ "content_hash": "8c260bd5c100160047071f4806d15143", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 79, "avg_line_length": 39.59649122807018, "alnum_prop": 0.648980948161276, "repo_name": "mmasaki/trove", "id": "efbb96bb7cdf0c2badad400386ca5bdb97c1d2de", "size": "9644", ...
import os def data_path(name): """ Return the absolute path to a file in the varcode/test/data directory. The name specified should be relative to varcode/test/data. """ return os.path.join(os.path.dirname(__file__), "data", name)
{ "content_hash": "16805a10da10d122bb5529c915969785", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 74, "avg_line_length": 31.375, "alnum_prop": 0.6772908366533864, "repo_name": "hammerlab/gtftools", "id": "0ea6986ecf2ce7d5ad8bead4f4a71c23e5458974", "size": "251", "binar...
import datetime, sys, os import xlwt import env import common import htmlreport def generate_result_xls(): wbk = xlwt.Workbook() style_red = xlwt.easyxf('font: colour red, bold False;') style_green = xlwt.easyxf('font: colour green, bold False;') style_bold = xlwt.easyxf('font: colour blac...
{ "content_hash": "bc2ae0a5af89ec3ed49c56b6584c3672", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 226, "avg_line_length": 40.21470588235294, "alnum_prop": 0.5025232209463907, "repo_name": "tangchenxuan/AutoMan", "id": "5a84113cba386d392c68e8fb796677b438242a06", "size":...
__author__ = 'To\xc3\xb1o G. Quintela (tgq.spm@gmail.com)' """Module of testing the functions programed in the module cooperativegames. """ import numpy as np from cooperativegames.measures.cooperativegames_metrics import banzhaf_index,\ shapley_index, shapley_value, weighted_winning_coalitions,\ weighted_wor...
{ "content_hash": "9167eac2e3949714d8cdef70ad41c2b4", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 79, "avg_line_length": 41.198237885462554, "alnum_prop": 0.5960222412318221, "repo_name": "tgquintela/CooperativeGames", "id": "e9a0f8ae31fe600974c45df3522560fc38a29b86", ...
try: import uasyncio as asyncio except ImportError: import asyncio class Hardware(object): def __init__(self, count): self.count = count def __await__(self): # Typical use, loop until an interface becomes ready. while self.count: print(self.count) yield ...
{ "content_hash": "895521880f68e02b43a84e9da4836e9f", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 20.26923076923077, "alnum_prop": 0.6015180265654649, "repo_name": "peterhinch/micropython-async", "id": "a9087f6f94c7240705c70d71f7cdf8b4bd07b918", "...
import copy import pickle import time # Third-party import astropy.units as u import matplotlib.pyplot as plt import numpy as np from scipy.misc import derivative import pytest # Project from ..io import load from ...frame import StaticFrame from ...hamiltonian import Hamiltonian from ....units import UnitSystem, Dim...
{ "content_hash": "bc1c1622177fd9b44570e342e7e0a633", "timestamp": "", "source": "github", "line_count": 454, "max_line_length": 80, "avg_line_length": 33.75330396475771, "alnum_prop": 0.5376533542156094, "repo_name": "adrn/gala", "id": "3083fa79c333f5c05547f2feed9b3e5a0f8a92a6", "size": "15343", ...
import re from .base import ARRAY, ischema_names from ... import types as sqltypes from ...sql import functions as sqlfunc from ...sql.operators import custom_op from ... import util __all__ = ('HSTORE', 'hstore') # My best guess at the parsing rules of hstore literals, since no formal # grammar is given. This is m...
{ "content_hash": "181239d3b2d05ae931af070ab5b29016", "timestamp": "", "source": "github", "line_count": 356, "max_line_length": 87, "avg_line_length": 30.0561797752809, "alnum_prop": 0.5693457943925234, "repo_name": "sauloal/PiCastPy", "id": "c645e25d2b28fe43cbee0c7d89e1d235c4661437", "size": "1093...
import sys import re import copy ENABLE_LOG = False IN_PLACE = False # Not actually needed because indent level is autodetected for each block NO_NAMESPACE_INDENT = False ANNOTATE_FILES = False ANNOTATION_PREFIX = "STYLEFIX: " ANNOTATION_POSTFIX = "" def log(message): if ENABLE_LOG: print("-!- "+message) input_f...
{ "content_hash": "80cad2e91620e748771b962715145d97", "timestamp": "", "source": "github", "line_count": 590, "max_line_length": 75, "avg_line_length": 31.596610169491527, "alnum_prop": 0.6147945499409935, "repo_name": "celeron55/buildat", "id": "ae5338e00ac628eb6c88d54c887089ff04684f31", "size": "1...
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union import warnings from google.api import httpbody_pb2 # type: ignore from google.api_core import gapic_v1, grpc_helpers_async, operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grp...
{ "content_hash": "85d555b38e16673f51ddccdafd297f3b", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 90, "avg_line_length": 44.888888888888886, "alnum_prop": 0.6231140971239981, "repo_name": "googleapis/google-cloud-python", "id": "36e3beec06b0d884cd9dbbb3c675e8aaf254ac99",...
# coding: utf-8 #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #---------------------------------------------------------------------...
{ "content_hash": "79e51e4ce5c2e6c22c87d66af4ca1eb0", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 97, "avg_line_length": 35.55045871559633, "alnum_prop": 0.5883870967741935, "repo_name": "SUSE/azure-sdk-for-python", "id": "cab229510344a7b2e0abbb0aaeabab6b6928e9ea", "si...
from django.conf import settings from hashlib import sha1 from mediagenerator.generators.bundles.base import Filter from mediagenerator.utils import get_media_dirs, find_file from subprocess import Popen, PIPE import os import posixpath import re import sys # Emits extra debug info that can be used by the FireSass Fir...
{ "content_hash": "4de361efb53a34d620f3792268f70ac1", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 82, "avg_line_length": 36.130434782608695, "alnum_prop": 0.5465302847974328, "repo_name": "flashycud/timestack", "id": "064acea8a457aaaf8604aeb193e9c06e6f7a5228", "size": ...
import SoftLayer import sys import logging import time class SoftlayerVirtualServerBasic(object): __cached_sl_instance_id = None def __init__(self, sl_client, instance_config): self.sl_vs_manager = SoftLayer.VSManager(sl_client) self.sl_client = sl_client self.ic = instance_config ...
{ "content_hash": "409d1a70cd1a941a642668b6e6bc41d6", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 74, "avg_line_length": 29.958333333333332, "alnum_prop": 0.5516921650440426, "repo_name": "hubward/ansible-softlayer", "id": "5b2888996e9a1d3fd5626cfd19fd17b4b68b26ce", "si...
from contextlib import closing from tempfile import NamedTemporaryFile from typing import TYPE_CHECKING, Optional, Sequence import MySQLdb import unicodecsv as csv from airflow.models import BaseOperator from airflow.providers.mysql.hooks.mysql import MySqlHook from airflow.providers.vertica.hooks.vertica import Vert...
{ "content_hash": "be55394d62b44cadfb3bf79502cf477b", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 102, "avg_line_length": 40.8125, "alnum_prop": 0.6120469627360898, "repo_name": "Acehaidrey/incubator-airflow", "id": "595b2cb01b3dc5fd699e1bc6d1ca4938f8d2f680", "size": "...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HProp1_ConnectedLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HProp1_ConnectedLHS. """ # Flag th...
{ "content_hash": "895dd59c75d71d1d48b2a6cc0c5bb35a", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 125, "avg_line_length": 52.817629179331306, "alnum_prop": 0.4738447372964263, "repo_name": "levilucio/SyVOLT", "id": "34596c4b630645c7d88c7669d47842a84cd0ed9a", "size": "1...
from django.utils import timezone from django.utils.text import slugify from .models import Article def create_articles(num): article = Article.objects.all()[0] pk = article.pk for i in range(num): article = Article() article.title = "Article number " + str(i+pk) article.slug = sl...
{ "content_hash": "44d42b99ab5d0c8373cbaf11fd8f788f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 53, "avg_line_length": 27.133333333333333, "alnum_prop": 0.6560196560196561, "repo_name": "groundupnews/gu", "id": "2ceacb5a800bc9dad5710c88de6cc4bf349b57a8", "size": "407"...
""" Holds user_metrics table model. """ __author__ = 'Jonny Lamb' __copyright__ = 'Copyright © 2008 Jonny Lamb' __license__ = 'MIT' import sqlalchemy as sa from sqlalchemy import orm from debexpo.model import meta, OrmObject from debexpo.model.users import User t_user_metrics = sa.Table('user_metrics', meta.metadat...
{ "content_hash": "1513a8fbfef98e21e72db73d275c4e4d", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 70, "avg_line_length": 27.296296296296298, "alnum_prop": 0.6919945725915875, "repo_name": "swvist/Debexpo", "id": "88c5a333cb643270279fccae3ab62d31d725051e", "size": "2048"...
""" Performance runner for d8. Call e.g. with tools/run-perf.py --arch ia32 some_suite.json The suite json format is expected to be: { "path": <relative path chunks to perf resources and main file>, "name": <optional suite name, file name is default>, "archs": [<architecture name for which this suite is run>, ....
{ "content_hash": "1e6b92d776477ecf9d9d81ac67a36db6", "timestamp": "", "source": "github", "line_count": 720, "max_line_length": 79, "avg_line_length": 33.147222222222226, "alnum_prop": 0.6338305539260873, "repo_name": "guorendong/iridium-browser-ubuntu", "id": "20a6537990ac8330b87c65a27841ad087e22008...
''' @summary: Bootstrapper file to run rest_server, and flask api's associated with it. Ensures all submodules are added to sys path and configures all runtime settings. Note: app instantiation is at module-level within project dir : api/init.py @author devopsec ''' import os from api import app, db ,API from flask im...
{ "content_hash": "fce4d70d59d350c5ba535461a7f3d58e", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 219, "avg_line_length": 57.18181818181818, "alnum_prop": 0.7516693163751987, "repo_name": "flyballlabs/threatdetectionservice", "id": "31d0c83416380310dd2619fe627bfbe5dd3adeb...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) # -- General conf...
{ "content_hash": "286afefbd0717adf9db7eaa170ce5b1d", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 79, "avg_line_length": 31.625, "alnum_prop": 0.704792490118577, "repo_name": "daodaoliang/pyscreenshot", "id": "b4319858e6344a71ed14d56b7838d11fc6c7e1eb", "size": "8521", ...
from __future__ import print_function import boto3 from botocore.exceptions import ClientError import uuid import datetime from passlib.apps import custom_app_context as pwd_context print('Loading function') def lambda_handler(event, context): if (event["user"]): user = event["user"] if (user["u...
{ "content_hash": "b196d4a39d7ab238e6b0d5a24631ca15", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 129, "avg_line_length": 43.42424242424242, "alnum_prop": 0.5938590369853455, "repo_name": "austindlawless/cudas", "id": "96d59a3e447d2ec662616fd5853ebabafa1a40d3", "size": ...
from getpass import getpass from . import gpt from . import mbr from ...utils import print_error, print_warning, query_yes_no, system from ...config import usr_cfg, get_logger logger = get_logger(__name__) def partition(): print_warning("WARNING! This will encrypt {0}".format(usr_cfg['drive'])) if not query...
{ "content_hash": "3e9f46ed4109bba0d9e29abea849f27e", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 98, "avg_line_length": 34.22222222222222, "alnum_prop": 0.5936920222634509, "repo_name": "ArchStrike/archstrike-installer", "id": "0f3ad5c9e1400283365284fbc7962b67d513412a", ...
import unittest from shapely import prepared from shapely import geometry class PreparedGeometryTestCase(unittest.TestCase): def test_prepared(self): polygon = geometry.Polygon([ (0, 0), (1, 0), (1, 1), (0, 1) ]) p = prepared.PreparedGeometry(polygon) self.assertTr...
{ "content_hash": "397b5cf75eca1a0019812d9a7dbb949d", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 75, "avg_line_length": 34.964285714285715, "alnum_prop": 0.6189989785495403, "repo_name": "aaronr/shapely", "id": "0ec947d19e4a875f1f1e9cc122faad23e7a20d7f", "size": "979",...
""" ODE and DAE routines ==================== dae -- Solve DAE systems ode -- Solve ODE systems, an extension to the scipy.integrate API Interface to numerical integrators of DAE/ODE systems. * Via the dae class: ida -- The sundials IDA general dae solver. BDF method or Adams ...
{ "content_hash": "b4292ce218d15a083199e9ded27722c1", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 78, "avg_line_length": 33.40625, "alnum_prop": 0.598690364826941, "repo_name": "logicabrity/odes", "id": "dfc2a886abafc6479bfaabb49901d1da83f3f5c3", "size": "1121", "bina...
''' Code for hooking import address tables by making them invalid pointers and catching the exceptions... ''' import PE import vtrace import vtrace.watchpoints as vt_watchpoints class IatHook(vt_watchpoints.Watchpoint): ''' Abuse the PageWatch subsystem to allow function pointers to be frob'd to create bre...
{ "content_hash": "17d9a1fe311ae5ebc6b7a9435e14e493", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 72, "avg_line_length": 29.127906976744185, "alnum_prop": 0.6227544910179641, "repo_name": "cmaruti/vivisect", "id": "a735a4a210eb6f7d192ec50e74d5e31179149e87", "size": "250...
from corehq.apps.users.models import CouchUser from django.contrib.auth.forms import AuthenticationForm from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ class EmailAuthenticationForm(AuthenticationForm): username = forms.EmailField...
{ "content_hash": "8ea4717b203a7230c0b0e5a4aacbaaed", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 67, "avg_line_length": 37.25, "alnum_prop": 0.7785234899328859, "repo_name": "gmimano/commcaretest", "id": "77abf9c401262af0db1479f9046915e4dcad1377", "size": "596", "bin...
from runner.koan import * class Proxy: def __init__(self, target_object): # WRITE CODE HERE self._messages = [] #initialize '_obj' attribute last. Trust me on this! self._obj = target_object # WRITE CODE HERE def __getattr__(self, attr_name): self._messages.append(a...
{ "content_hash": "b8a356cd442379e5c9e9ca145806ab68", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 70, "avg_line_length": 26.145569620253166, "alnum_prop": 0.5792786250302591, "repo_name": "erikld/Bobo", "id": "c9732b3e1e44070a370d1d37ac347735ebfd8aad", "size": "4833", ...
from django.db import migrations, models import django.db.models.deletion def backpopulate_lines(apps, schema_editor): """Create a BootcampApplicationLine for each BootcampApplication""" BootcampApplication = apps.get_model("applications", "BootcampApplication") BootcampApplicationLine = apps.get_model("a...
{ "content_hash": "87665dcb14d65fba894dd73d99bfcdce", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 87, "avg_line_length": 34.96078431372549, "alnum_prop": 0.5255187885586091, "repo_name": "mitodl/bootcamp-ecommerce", "id": "209398b3e14d9c526f4bec69088ccc9cb12cbe8e", "siz...
"""YouTube Playlist Reddit Bot Usage: $ python youtubeplaylistbot.py You can also get help on all the command-line flags the program understands by running: $ python youtubeplaylistbot.py --help """ __author__ = 'Jon Minter (jdiminter@gmail.com)' __version__ = '1.0a' import time import datetime import sqlite3 ...
{ "content_hash": "20e1bf376dce173ea72df575083414e8", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 144, "avg_line_length": 39.38912133891213, "alnum_prop": 0.7262587635436584, "repo_name": "jonminter/youtubeplaylistbot", "id": "3e98ad7f9ce8021d369614a3a69522999512a4f3", ...
from wtforms import TextField, validators from lib.forms import Form class RegisterForm(Form): username = TextField('Username', [ validators.Required(message = "必须填写用户名"), validators.Length(min = 3, message = "用户名长度过短(3-12个字符)"), validators.Length(max = 12, message = "用户名长度过长(3-12个字符)"), ...
{ "content_hash": "20ddae435d04057db3ef005cd7273b05", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 91, "avg_line_length": 35.254901960784316, "alnum_prop": 0.6112347052280311, "repo_name": "Angel-fund/skycity", "id": "738817b0755e4d8199bed6e0d725a9c60e238553", "size": "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('events', '0004_auto_20160329_0405'), ] operations = [ migrations.RemoveField( model_name='likes', name='image', ), ...
{ "content_hash": "4145a0d21ec80cdb221c762e94315df5", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 72, "avg_line_length": 22.727272727272727, "alnum_prop": 0.566, "repo_name": "EricZaporzan/evention", "id": "bd9c735a440a74b37a6746e385ae79bceced0884", "size": "572", "bi...
import logging import os, os.path from collections import namedtuple from random import shuffle logger = logging.getLogger(__name__) LookItem = namedtuple("LookItem", ["username", "top", "middle", "bottom"]) def iterate_subfolders(folder): for item in os.listdir(folder): full_path = os.path.join(folder, ...
{ "content_hash": "3aa0730fa080da67f2e5b47f0b63e44e", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 93, "avg_line_length": 31.046728971962615, "alnum_prop": 0.6327513546056592, "repo_name": "alex-33/look_viewer", "id": "39d424990767b4f7fab3793d59a43d8fbca760be", "size": ...
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.electric_load_center import GeneratorFuelCellWaterSupply log = logging.getLogger(__name__) class TestGeneratorFuelCellWaterSupply(unittest.TestCase): def setUp(self): ...
{ "content_hash": "e97047ee2cdd2dbb1ab2b86084c67638", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 186, "avg_line_length": 50.725806451612904, "alnum_prop": 0.7259141494435613, "repo_name": "rbuffat/pyidf", "id": "a0c80a75da044053c85d3745c10e6b872289be46", "size": "3145"...
from django.contrib import admin from events.orfik import models def graph(green, total): if not total: return ('<div style="width: 100px; height: 10px; ' 'border:1px solid black"></div>') percentage_passed = int(green * 100.0 / total) return ('<div style="width: 100px; height: 10p...
{ "content_hash": "fe8931bbcf144a24dd963de3f5567f21", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 78, "avg_line_length": 31.952380952380953, "alnum_prop": 0.6192250372578242, "repo_name": "compsoc-ssc/compsocssc", "id": "54a54ee80be7cf9e97cfde0122098e6aadb5c8a9", "size"...
from __future__ import print_function module_level = 1 def defaultValueTest1(no_default, some_default_constant = 1): return some_default_constant def defaultValueTest2(no_default, some_default_computed = module_level*2): local_var = no_default return local_var, some_default_computed def defaultValueTest...
{ "content_hash": "cf874b4220b27fe9fde848752b72f19d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 84, "avg_line_length": 27.9, "alnum_prop": 0.7405017921146954, "repo_name": "wfxiang08/Nuitka", "id": "88c47c5f45eb6b22ef73fc3801a54821f53c57fd", "size": "2164", "binary"...
from __future__ import unicode_literals import frappe from frappe.model.document import Document class TemplateMapper(Document): pass
{ "content_hash": "bd613ebc853e785758949213d7b97cab", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 22.666666666666668, "alnum_prop": 0.8161764705882353, "repo_name": "rohitwaghchaure/New_Theme_frappe", "id": "08264fa7f222376535996b328fae32dba0c4c795",...
""" Metrics API module: http://metrics-api.wikimedia.org/ Defines the API which exposes metrics on Wikipedia users. The metrics are defined at https://meta.wikimedia.org/wiki/Research:Metrics. """ from user_metrics.utils import nested_import from user_metrics.config import settings from user_metrics.api....
{ "content_hash": "9b5768353c5dbad0f3f9171a259c3fe9", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 74, "avg_line_length": 29.625, "alnum_prop": 0.6751054852320675, "repo_name": "wikimedia/analytics-user-metrics", "id": "1a16895f4e3b2e20dbd9030ae8faf7bfe1d3e9ee", "size": ...
from .proxy_only_resource import ProxyOnlyResource class DiagnosticSettingsResource(ProxyOnlyResource): """The diagnostic setting resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Azure resource Id :vartype id: str :ivar name: Azure r...
{ "content_hash": "d90715b8fdbc688fe6a9de3d298787ee", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 152, "avg_line_length": 45.21311475409836, "alnum_prop": 0.6555474981870921, "repo_name": "lmazuel/azure-sdk-for-python", "id": "09cbca388e28402d48c60d8a069e53dcf9c433e5", ...
"""This module is deprecated. Please use :mod:`airflow.providers.amazon.aws.operators.s3_list`.""" import warnings # pylint: disable=unused-import from airflow.providers.amazon.aws.operators.s3_list import S3ListOperator # noqa warnings.warn( "This module is deprecated. Please use `airflow.providers.amazon.aws....
{ "content_hash": "9e9b2a44b67652b095ead196fb4e5e0e", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 98, "avg_line_length": 32.166666666666664, "alnum_prop": 0.7590673575129534, "repo_name": "sekikn/incubator-airflow", "id": "b9eb3542287f5c4c7cd81707453310366da62f51", "siz...
import argparse import datetime import os from importlib import resources import emailer def get_version(): return f'{emailer.__version__}' def get_sample_config(): return resources.read_text(emailer, 'sample-emailer.json') def get_parser(): parser = argparse.ArgumentParser() parser.add_argument('-c', ...
{ "content_hash": "c6f1ff411edc6bc574261eb932355a9c", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 80, "avg_line_length": 39.40506329113924, "alnum_prop": 0.5210407966591712, "repo_name": "WhiteHalmos/emailer", "id": "36fce99bfc3612eccef615029bfdc7c0ccc5c401", "size": "3...
"""empty message Revision ID: 54cfab92f5a1 Revises: 968fa5ab793 Create Date: 2015-04-23 02:03:14.208399 """ # revision identifiers, used by Alembic. revision = '54cfab92f5a1' down_revision = '968fa5ab793' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - pl...
{ "content_hash": "22e5457c3679337366faf7fc52beb6cf", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 63, "avg_line_length": 25.129032258064516, "alnum_prop": 0.6623876765083441, "repo_name": "philipschoemig/TACTourney", "id": "404df54d6d37fbfc62303e1ea19eb4467b7d08ec", "si...
from .tools import add_constant, categorical from statsmodels import NoseWrapper as Tester test = Tester().test
{ "content_hash": "6a5e7786681db1e6d107f6baa386b78c", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 45, "avg_line_length": 28.25, "alnum_prop": 0.8053097345132744, "repo_name": "rgommers/statsmodels", "id": "08bdbeb2a4c0a055119f02a2099ac10520f98a09", "size": "113", "bina...
def msg(): print "discriptor"
{ "content_hash": "171a153ff8fe788957c50bee94272a26", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 22, "avg_line_length": 17, "alnum_prop": 0.6176470588235294, "repo_name": "haikentcode/haios", "id": "357fbc1c86abb87eb683faebbae1c079a79a9fe4", "size": "35", "binary": fa...
import tensorflow as tf import awesome_gans.modules as t tf.set_random_seed(777) # reproducibility class AdaGAN: def __init__( self, s, batch_size=64, height=28, width=28, channel=1, n_classes=10, sample_num=64, sample_size=8, n_in...
{ "content_hash": "49d312ea49407b4b4a0d81e4de0fefb7", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 100, "avg_line_length": 32.293103448275865, "alnum_prop": 0.5495639793557573, "repo_name": "kozistr/Awesome-GANs", "id": "71b489356a9b6a4e2d8539e259760ad20b98179d", "size"...
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, in_data, out_attributes, user_options, num_cores, out_path): import os from genomicode import filelib from genomicode import...
{ "content_hash": "8f303313816bae29092d0a27cb041c4d", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 72, "avg_line_length": 29.011627906976745, "alnum_prop": 0.6032064128256514, "repo_name": "jefftc/changlab", "id": "f35c0f0e5a10e419ae2355a0cecab4bc517094a4", "size": "2495...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('tasks', '0025_exporttask_created_at'), ] operations = [ migrations.AlterModelOptions( name='exporttask', options={'ordering'...
{ "content_hash": "f53f05f906d8a1568fe4ee3b84313294", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 66, "avg_line_length": 21.941176470588236, "alnum_prop": 0.6005361930294906, "repo_name": "dodobas/osm-export-tool2", "id": "66a0cf5e62be47f3f97d021fbcab61b7dada3753", "siz...
import sys import struct import Image #from cliente.cliente import socketcliente def main (): #print struct.unpack('I',p) #print "{:<15}".format('si')+'s' s = bytearray() s.append(10) #s.append(bytearray('megalol')) for c in s: print(c) if __name__=="__main__": main()
{ "content_hash": "637dc935fbc8056465292e9f5f39f6f1", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 42, "avg_line_length": 16.470588235294116, "alnum_prop": 0.6428571428571429, "repo_name": "EnriquePS/ProtocoloPokemon", "id": "45a65e53da2b126692ae256da8e56d87fef95ba7", "s...
import re from storage.ssh import SSHSession WWN_REGEX = re.compile('[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}' , re.I) class BrocadeSwitch(SSHSession): """ Establish SSH Connection to Brocade FC Switch which can be used to run comm...
{ "content_hash": "f22a7cf6a056dd4514db8dab56508065", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 120, "avg_line_length": 30.678861788617887, "alnum_prop": 0.49940373658407317, "repo_name": "OpenSRM/storage", "id": "eb3e57e2a46151c62428dceb152d4f4fa3ecf94c", "size": "7...
import datetime from unittest import mock import ddt import iso8601 from oslo_utils import versionutils from cinder.api import extensions from cinder.api import microversions as mv from cinder.api.openstack import api_version_request as api_version from cinder.api.v3 import clusters from cinder import context from ci...
{ "content_hash": "677a34d814a10a15a12461f8b43bf1f5", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 79, "avg_line_length": 44.47452229299363, "alnum_prop": 0.5387039026136771, "repo_name": "openstack/cinder", "id": "93d042fad86658d149e2184dcc1d9d85acc0da92", "size": "145...