text stringlengths 4 1.02M | meta dict |
|---|---|
"""Grab bag file for transaction."""
import logging
from google.appengine.api import datastore_errors
from google.appengine.ext import ndb
from google.appengine.runtime import apiproxy_errors
__all__ = [
'CommitError',
'transaction',
'transaction_async',
]
class CommitError(Exception):
"""A transaction pr... | {
"content_hash": "67d577d092560d6fce3b6187f67e2338",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 79,
"avg_line_length": 28.35593220338983,
"alnum_prop": 0.7184698147041243,
"repo_name": "madecoste/swarming",
"id": "7ec08a19af400d046fb96f123aba3a938e20a284",
"size": "18... |
from __future__ import absolute_import, division, print_function, unicode_literals
#http://www.w3.org/TR/2009/WD-xmlschema11-2-20091203/type-hierarchy-200901.longdesc.html
#https://www.w3.org/TR/xmlschema11-2/#built-in-datatypes
class Type(object):
def detectType(self, value):
raise NotImplementedError(... | {
"content_hash": "81dfe2bf221371a729349d31c364c302",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 88,
"avg_line_length": 26.774647887323944,
"alnum_prop": 0.5318253550762756,
"repo_name": "ODInfoBiz/pyyacp",
"id": "c9b423485827f4efaae6aca9de9481c827f9c768",
"size": "194... |
"""Makes figure with PMM composites of extreme examples for GridRad model.
PMM = probability-matched means
"Extreme examples" include best hits, best correct nulls, worst misses, worst
false alarms, high-probability examples (regardless of true label), and
low-probability examples (regardless of true label).
"""
imp... | {
"content_hash": "53f713341e2177cadbbf9f1b17efe282",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 80,
"avg_line_length": 36.369565217391305,
"alnum_prop": 0.6792438732815301,
"repo_name": "thunderhoser/GewitterGefahr",
"id": "3edcd44d4d8b364da07f1a144f144eab740356ca",
... |
from __future__ import absolute_import
import unittest
from pyoauth2.provider import AuthorizationProvider
class MockAuthorizationProvider(AuthorizationProvider):
pass
class AuthorizationProviderTest(unittest.TestCase):
def setUp(self):
self.provider = MockAuthorizationProvider()
def test_make... | {
"content_hash": "c1e9237b29cfef0cb7a9ee77e1c7fdc2",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 77,
"avg_line_length": 36.116279069767444,
"alnum_prop": 0.6297488731487444,
"repo_name": "iamjakob/pyoauth2",
"id": "330a870ec53372971d409dd9f67d64ec81607201",
"size": "15... |
from django.core.mail.backends import locmem
from base import BaseEmailBackend
class EmailBackend(locmem.EmailBackend, BaseEmailBackend):
def send_messages(self, email_messages):
email_messages = self.render_messages(email_messages)
super(EmailBackend, self).send_messages(email_messages)
| {
"content_hash": "5b7a9b15b87cdca4a4840db4e577ea96",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 63,
"avg_line_length": 38.875,
"alnum_prop": 0.77491961414791,
"repo_name": "benoitbar/django-template-mail",
"id": "87fd0941385de853fc14caa37e8ac9140c79ae53",
"size": "311"... |
from __future__ import division, unicode_literals
from future.builtins import str
from copy import copy
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ImproperlyConfigured, AppRegistryNotReady
from django.db.models import IntegerField, CharField, FloatField
from djan... | {
"content_hash": "b9cd2ae88cc5cc52b3a4027db71942ee",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 77,
"avg_line_length": 42.14661654135338,
"alnum_prop": 0.6124342163946125,
"repo_name": "wbtuomela/mezzanine",
"id": "d27e48402c8065d176d6c264390df68457e31b2e",
"size": "... |
"""Test the functionality of the detect_repo module.
This will consist of the following functional test:
1. Determine if an OSS-Fuzz projects main repo can be detected from example
commits.
2. Determine if an OSS-Fuzz project main repo can be detected from a
repo name.
"""
import os
import re
import sys
import ... | {
"content_hash": "8909f4bf185ea084d764707dab5bac57",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 78,
"avg_line_length": 36.22784810126582,
"alnum_prop": 0.6477987421383647,
"repo_name": "FeliciaLim/oss-fuzz",
"id": "4886522ac3dd59d1130f32b90ea010e4f73fd5d9",
"size": "3... |
from .inference import InferenceStrategy, SumProductInference, NaiveInference, random_ordering | {
"content_hash": "ce89d32cc795e3e20d178f99368c5914",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 94,
"avg_line_length": 94,
"alnum_prop": 0.8829787234042553,
"repo_name": "DLunin/pygraphmodels",
"id": "4055af9ae8a8d2c9123d5e21fd09d46a748d9645",
"size": "94",
"binary":... |
import random, time, os, datetime
import boto
from boto.sdb.persist.object import SDBObject
from boto.sdb.persist.property import *
class Identifier(object):
_hex_digits = '0123456789abcdef'
@classmethod
def gen(cls, prefix):
suffix = ''
for i in range(0,8):
suffix += random.c... | {
"content_hash": "3c77c18817e139115f28317cae21b813",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 100,
"avg_line_length": 30.526666666666667,
"alnum_prop": 0.6018781393317318,
"repo_name": "marshall/pynaries",
"id": "6443d0293c12030b8155996deb44af50aaebba5e",
"size": "... |
import json
import nltk
import codecs
import random
from news_item import NewsItem
from pymongo import MongoClient
from nltk.classify import apply_features
DEBUG = True
def _load_stop_words():
stop_words = nltk.corpus.stopwords.words('portuguese')
d_stop_words = set(stop_words)
return d_stop_words
cla... | {
"content_hash": "ea4c5b9b305c8523098617675ad457ac",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 90,
"avg_line_length": 29.128440366972477,
"alnum_prop": 0.5861417322834646,
"repo_name": "nolram/news_crawler",
"id": "414f425549e05f4f31c66d63bf2c5b6cdb9c0677",
"size": ... |
from GameHistory import *
from GameBoard import *
"""class yang menginisiasi menu utama MNK Game"""
class GameMNK:
def __init__(self, screenWidth, screenHeight):
self.window = Tk()
self.window.resizable(False, False)
self.screenWidth = screenWidth
self.screenHeight = screenHeight
... | {
"content_hash": "9eaa50a7d740ae0919f16fc9534db848",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 139,
"avg_line_length": 41.8859649122807,
"alnum_prop": 0.5979057591623037,
"repo_name": "argaghulamahmad/MNK-Game",
"id": "acc9597f8bf95f417d2f8f649b9a275b1e674f03",
"siz... |
"""
Add to SockJS-tornado the multi-room support
"""
from sockjs.tornado import SockJSConnection
from jsonParser import Parser
from structure import Struct
import logging
try:
import json
except ImportError:
import simplejson as json
# Limit import
__all__ = ["SockJSDefaultHandler", "SockJSRoomHandler"]
... | {
"content_hash": "f63f67c402005ab07ea8652a361ae6d4",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 127,
"avg_line_length": 33.84761904761905,
"alnum_prop": 0.5796285875070343,
"repo_name": "Deisss/python-sockjsroom",
"id": "08128b65a1f23f99bcf86430374e490d4d415943",
"si... |
from tempest.api.compute import base
class BaseFloatingIPsTest(base.BaseV2ComputeTest):
@classmethod
def setUpClass(cls):
# Floating IP actions might need a full network configuration
cls.set_network_resources(network=True, subnet=True,
router=True, dhcp=True... | {
"content_hash": "02b47b7dd90ee1af9270f09827d3dcff",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 69,
"avg_line_length": 34.09090909090909,
"alnum_prop": 0.672,
"repo_name": "vedujoshi/os_tempest",
"id": "fd76e62e3f321d17fd7e4f5f3303678a81705e96",
"size": "1011",
"bin... |
__version__=''' $Id: signsandsymbols.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__="""This file is a collection of widgets to produce some common signs and symbols.
Widgets include:
- ETriangle (an equilateral triangle),
- RTriangle (a right angled triangle),
- Octagon,
- Crossbox,
- Tickbox,
- SmileyF... | {
"content_hash": "08b908b0cacbd3332eb8f1703c6f37d0",
"timestamp": "",
"source": "github",
"line_count": 927,
"max_line_length": 181,
"avg_line_length": 33.33980582524272,
"alnum_prop": 0.49330227140361094,
"repo_name": "nickpack/reportlab",
"id": "34e92bf87f8965145310a30857aef733474b0740",
"size": ... |
from fabric.api import env, require, task
from denim import paths, system, utils
from denim.constants import DeployUser
def manage(cmd, args=None, revision=None, noinput=True, use_sudo=True, user=DeployUser):
"""
Run a django manage.py command.
:param cmd: the command to run.
:param args: arguments t... | {
"content_hash": "b4eb408e5ede9ab0192dcd47003d9c85",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 110,
"avg_line_length": 25.63235294117647,
"alnum_prop": 0.6483075157773953,
"repo_name": "timsavage/denim",
"id": "7d0504d807467a200f0242ae8dbb9fd7d37f8bba",
"size": "1767... |
from a10sdk.common.A10BaseClass import A10BaseClass
class Connect(A10BaseClass):
"""Class Description::
Connect to license manager to activate.
Class connect supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param connect... | {
"content_hash": "f71b3e9f43861af7e139eefe2c8d0c7f",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 179,
"avg_line_length": 33.24324324324324,
"alnum_prop": 0.6357723577235772,
"repo_name": "a10networks/a10sdk-python",
"id": "204902fc337380e6073bced5a1b5aacd6f290c7a",
"si... |
import json
import datetime
from httpretty import HTTPretty
from social.p3 import urlencode
from social.actions import do_disconnect
from social.tests.models import User
from social.tests.backends.oauth import OAuth1Test, OAuth2Test
from social.tests.backends.open_id import OpenIdTest
class GoogleOAuth2Test(OAuth2... | {
"content_hash": "0a577df17ff2f5bb8d2b6b00c9186983",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 79,
"avg_line_length": 36.975265017667844,
"alnum_prop": 0.5449159021406728,
"repo_name": "duoduo369/python-social-auth",
"id": "bef2d088bb38323947b35ad90a2d45f604108d13",
... |
"""empty message
Revision ID: 1bd8afe10204
Revises: 10d978d3a8e
Create Date: 2013-09-26 21:32:34.543861
"""
# revision identifiers, used by Alembic.
revision = '1bd8afe10204'
down_revision = '10d978d3a8e'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade():
### co... | {
"content_hash": "c12962d9ac4690a5b396f32e34e5daa2",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 101,
"avg_line_length": 40.283018867924525,
"alnum_prop": 0.688056206088993,
"repo_name": "dedalusj/PaperChase",
"id": "11521ede36563ad718c9c2f56104ec359d9d86de",
"size": "... |
"""
Description: Singleton implementation using decorators
@author: Paul Bodean
@date: 23.01.2018
"""
from selenium import webdriver
from singleton_decorator import singleton
def my_singleton(*args):
"""
:param cls: class to be changed as a singleton
:return: instance of the singleton
"""
insta... | {
"content_hash": "617a98b3a6d509e6294161a9339f2f2d",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 89,
"avg_line_length": 21.048780487804876,
"alnum_prop": 0.660486674391657,
"repo_name": "paulbodean88/automation-design-patterns",
"id": "232024fdf36e7f84ec08131bf350a384f12... |
import sys
import re
import requests
from cachecontrol import CacheControl
from bs4 import BeautifulSoup
session = requests.session()
cached_session = CacheControl(session)
# URL for the chatbot
URL = "https://kakko.pandorabots.com/pandora/talk?botid=f6a012073e345a08&skin=chat"
# Regex pattern to get the appropriate... | {
"content_hash": "f6633665c3e0becd92f2f577f1a38e7c",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 95,
"avg_line_length": 23.204545454545453,
"alnum_prop": 0.7110675808031341,
"repo_name": "christopher18/Celsearch",
"id": "a7c2bdcce8cfc4a38b9ae2f4f67fba1ba6854ef6",
"size... |
from flask import Flask
from redis import Redis
import os
app = Flask(__name__)
redis = Redis(host="redis", port=6379)
@app.route('/')
def hello():
redis.incr('hits')
return 'Hello Docker Book reader! I have been seen {0} times'.format(redis.get('hits'))
if __name__ == "__main__":
app.run(host="0.0.0.0",... | {
"content_hash": "d832ada702995aa9f3b440370c585e21",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 91,
"avg_line_length": 22.266666666666666,
"alnum_prop": 0.6377245508982036,
"repo_name": "abelwuxin/docker-study",
"id": "6dd62973dc3827d4660181d79dd43f4909a27dbd",
"size"... |
import pytest
from matchpy.expressions.constraints import CustomConstraint
from matchpy.expressions.expressions import Symbol, Pattern, Operation, Arity, Wildcard
from matchpy.matching.many_to_one import ManyToOneMatcher
from .common import *
from .utils import MockConstraint
def test_add_duplicate_pattern():
pa... | {
"content_hash": "65b97253013048cda98c7a20898db738",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 146,
"avg_line_length": 32.71647509578544,
"alnum_prop": 0.6124838974118749,
"repo_name": "wheerd/patternmatcher",
"id": "eca1747eceb2bc8fd4ea3fe71dd552bffa48d495",
"size"... |
from RGT.XML.SVG.baseContainerNode import BaseContainerNode
from RGT.XML.SVG.Attribs.conditionalProcessingAttributes import ConditionalProcessingAttributes
from RGT.XML.SVG.Attribs.graphicalEventAttributes import GraphicalEventAttributes
from types import StringType
from RGT.XML.SVG.basicSvgNode import BasicSvgNode... | {
"content_hash": "012ec8393f7e136f59b7abaf58be84f9",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 113,
"avg_line_length": 44,
"alnum_prop": 0.6483471074380165,
"repo_name": "danrg/RGT-tool",
"id": "0c6d07464721a9d01254a0edc513d2bf89d7aa88",
"size": "2420",
"binary": f... |
import sys
import logging
import warnings
from datetime import timedelta
from celery import routes
from celery.loaders import load_settings
DEFAULT_PROCESS_LOG_FMT = """
[%(asctime)s: %(levelname)s/%(processName)s] %(message)s
""".strip()
DEFAULT_LOG_FMT = '[%(asctime)s: %(levelname)s] %(message)s'
DEFAULT_TASK_L... | {
"content_hash": "3a1edf3bd1734479727d752cbc363815",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 78,
"avg_line_length": 41.276679841897234,
"alnum_prop": 0.629129560471129,
"repo_name": "mitsuhiko/celery",
"id": "b2b25cf29854f0995b099533d19900caba13a9b1",
"size": "104... |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HM6_if_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HM6_if_IsolatedLHS.
"""
# Flag this instance as com... | {
"content_hash": "1c2c27a398951f36c2b8b2b4ce61ba61",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 125,
"avg_line_length": 43.3859649122807,
"alnum_prop": 0.48281439547108773,
"repo_name": "levilucio/SyVOLT",
"id": "2d79dbebf7748741c0c5b4f7d648a8c9fc871408",
"size": "247... |
from csvkit import CSVKitReader, CSVKitDictReader
from csvkit.cli import CSVFileType, CSVKitUtility
class CSVPy(CSVKitUtility):
description = 'Load a CSV file into a CSVKitReader object and then drops into a Python shell.'
override_flags = ['l', 'f', 'zero']
def add_arguments(self):
self.argparse... | {
"content_hash": "718d788c956fafee26ecd06571ad4bde",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 124,
"avg_line_length": 36.90243902439025,
"alnum_prop": 0.6338400528750826,
"repo_name": "jsvine/csvkit",
"id": "a840f2f4ae5f634c4c8a71fe8fefb9f1d8bf9984",
"size": "1536",... |
'''
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
Note:
Please do the sorting in a one-pass algor... | {
"content_hash": "cd5cf2abc2bdc75870829a2b356e1a7e",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 165,
"avg_line_length": 29.692307692307693,
"alnum_prop": 0.5375647668393783,
"repo_name": "shub0/algorithm-data-structure",
"id": "2d4e87de369c1948c893c14ede2016553c563fd2",... |
import unittest
import merge_active_shadow
from google.protobuf import descriptor_pb2
from google.protobuf import text_format
class MergeActiveShadowTest(unittest.TestCase):
# Poor man's text proto equivalence. Tensorflow has better tools for this,
# i.e. assertProto2Equal.
def assertTextProtoEq(self, lhs, r... | {
"content_hash": "838ed362958ad6dbf913eb8f74fc6170",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 90,
"avg_line_length": 20.099585062240664,
"alnum_prop": 0.6765070189925682,
"repo_name": "istio/envoy",
"id": "8f7c98d4fa7b5de057b41836503666e5c261a4fb",
"size": "4844",
... |
"""Save and restore variables."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os.path
import re
import time
import uuid
import numpy as np
import six
from google.protobuf.any_pb2 import Any
from google.protobuf import text_for... | {
"content_hash": "ba5e79e2ce03e25f69b0189fa56fdd6a",
"timestamp": "",
"source": "github",
"line_count": 1741,
"max_line_length": 80,
"avg_line_length": 37.90522688110281,
"alnum_prop": 0.6643128816692679,
"repo_name": "naturali/tensorflow",
"id": "b1b40061468c1db076e13f81abbb48b7ade86822",
"size": ... |
from __future__ import absolute_import
import logging
from geocoder.location import BBox
from geocoder.base import OneResult, MultipleResultsQuery
class KomootResult(OneResult):
def __init__(self, json_content):
# create safe shortcuts
self._geometry = json_content.get('geometry', {})
s... | {
"content_hash": "c9860469698899adfab147c970b9e01c",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 67,
"avg_line_length": 25.353383458646615,
"alnum_prop": 0.5652431791221827,
"repo_name": "DenisCarriere/geocoder",
"id": "4a647d4309da71d27af13ae37623ed9c13e2d025",
"size... |
'''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p
from OpenGL.GL import glget
EXTENSION_NAME = 'GL_NV_multisample_filter_hint'
_p.unpack_constants( """GL_MULTISAMPLE_FILTER_HINT_NV 0x8534""", globals())
glget.addGLGetConstant( GL_MULTISAMPLE_FILTER_HINT_NV, (1,) )
def glI... | {
"content_hash": "28991bc992c08f699c5db9f1cb9f08f4",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 75,
"avg_line_length": 42.583333333333336,
"alnum_prop": 0.761252446183953,
"repo_name": "frederica07/Dragon_Programming_Process",
"id": "10ef9a52ee89d3df260f183d795d85d7fbef... |
__author__ = ['davidharcombe@google.com (David Harcombe)']
"""Discovery Class.
Authenticate and fetch a discoverable API service.
"""
import logging
from typing import Any, Mapping
from apiclient import discovery
from oauth2client.client import AccessTokenCredentials
from classes.secret_manager_credentials import ... | {
"content_hash": "4f808ed531ef2ae32e37c6e2d71ee039",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 77,
"avg_line_length": 32.81818181818182,
"alnum_prop": 0.6947368421052632,
"repo_name": "google/report2bq",
"id": "b1b3f5fe348130199f82d7d2d845bb3a6eb4399f",
"size": "2398... |
import logging
from ginga import GingaPlugin
from ginga.gtkw import GtkHelp
import gtk
import pango
class Log(GingaPlugin.GlobalPlugin):
def __init__(self, fv):
# superclass defines some variables for us, like logger
super(Log, self).__init__(fv)
self.histlimit = 100
self.histmax... | {
"content_hash": "b1deb3cb0cd3b37f2bb7d2b799dbf2b3",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 78,
"avg_line_length": 33.05785123966942,
"alnum_prop": 0.56575,
"repo_name": "astrofrog/ginga",
"id": "2a301553d0b44f179c8f6b9a8773091205c149e0",
"size": "4246",
"binar... |
"""Views for comments app."""
from __future__ import absolute_import
from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.decorators import method_decorator
from rest_framework import permissions, status
f... | {
"content_hash": "e38c2d29f3bfcd800273d2fec82333b3",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 93,
"avg_line_length": 34.35748792270532,
"alnum_prop": 0.656214848143982,
"repo_name": "pombredanne/readthedocs.org",
"id": "a959924dcf083255e7a87414d8a47d96826aa038",
"s... |
from networkx.algorithms.components.strongly_connected import strongly_connected_components
from networkx.classes.digraph import DiGraph
from networkx.classes.function import selfloop_edges
from typing import List, Set, Tuple, Dict
from hwtHls.ssa.basicBlock import SsaBasicBlock
from hwtHls.ssa.transformation.utils.bl... | {
"content_hash": "e92dd1201a2b9e586346f38c746a1200",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 116,
"avg_line_length": 41.31609195402299,
"alnum_prop": 0.6000834608429545,
"repo_name": "Nic30/hwtHls",
"id": "f5830c4cd728058d4d171b41f4f29d1590bf1717",
"size": "7189",... |
"""
Test experiment for parse.
Add cardinality format field after type:
"... {person:Person?} ..." -- CARDINALITY: Zero or one, 0..1 (optional)
"... {persons:Person*} ..." -- CARDINALITY: Zero or more, 0..N (many0)
"... {persons:Person+} ..." -- CARDINALITY: One or more, 1..N (many)
REQUIRES:
p... | {
"content_hash": "f9757bae9a064c2f86e31b226276804c",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 88,
"avg_line_length": 49.8159509202454,
"alnum_prop": 0.6322660098522167,
"repo_name": "benthomasson/parse_type",
"id": "3c59cb0635583f21ca5821eb487854a4dd406550",
"size"... |
import sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as pl
# import pylab as pl
if len(sys.argv) != 2:
print("Need a filename for the plot output. Exiting...")
else:
outputFile = sys.argv[1]
data = []
for line in sys.stdin:
data.append(line.strip())
data=map(int, data... | {
"content_hash": "fd8cc1626137cdd6073a7bfdb80cfdb3",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 60,
"avg_line_length": 21.555555555555557,
"alnum_prop": 0.6443298969072165,
"repo_name": "kunalghosh/T-61.5060-Algorithmic-Methods-of-Data-Mining",
"id": "68eb8303bd85aa3c3d... |
from django.db import models
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
## GTFS Models
class Agency(models.Model):
agency_id = models.CharField(primary_key=True, blank=False, null=False, max_length=200, unique=True)
agency_url = ... | {
"content_hash": "aedac52a69492d501b48463ec45cbca1",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 104,
"avg_line_length": 40.807291666666664,
"alnum_prop": 0.6703254626675176,
"repo_name": "LiquidGalaxyLAB/FlOYBD",
"id": "03ee9c05c7b0c243b8293cdff8a32c6a72ddc810",
"siz... |
from __future__ import print_function
import os
import sys, logging
import json
import re
import mechanize
import boto3
mechlog = logging.getLogger("mechanize")
mechlog.addHandler(logging.StreamHandler(sys.stdout))
if os.getenv('DEBUG') != None:
logging.basicConfig(level=logging.DEBUG)
mechlog.setLevel(loggi... | {
"content_hash": "61f080ff85add966bb02aa81363c451a",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 108,
"avg_line_length": 34.63529411764706,
"alnum_prop": 0.6606657608695652,
"repo_name": "kounta/lambda-acm-validate",
"id": "5b30e0ab57d1e31b8f6c0a435bb906112b14c1bb",
"s... |
import sqlite3
from cobiv.modules.database.datasources.datasource import Datasource
class Sqliteds(Datasource):
def build_yaml_config(self, config):
config[self.get_name()] = {'url': self.get_app().get_user_path('cobiv.db')}
def create_connection(self):
url = self.get_config_value('url', ':m... | {
"content_hash": "c345417f541506405244d96d8ce149ed",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 83,
"avg_line_length": 33.90909090909091,
"alnum_prop": 0.6434316353887399,
"repo_name": "gokudomatic/cobiv",
"id": "0f5d327b422c28e5c08286c4c7426d7f3be94684",
"size": "746... |
from FileType import *
class FlatDict(FileType):
extensions = ['.dict'] ## list of extensions handled by this class
dataTypes = [dict] ## list of python types handled by this class
priority = 50
##not implemented yet.
#@classmethod
#def write(cls, data, dirHan... | {
"content_hash": "9a3ec609ce441e70c7b2291b26fb3756",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 98,
"avg_line_length": 28.96,
"alnum_prop": 0.5925414364640884,
"repo_name": "hiuwo/acq4",
"id": "7d7aadc2c9f48914181d3eb98f439515d2650d98",
"size": "748",
"binary": fals... |
"""
Copyright 2013 The Trustees of Princeton University
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 applicab... | {
"content_hash": "69b10abf31480ba090f34cf8216aaf3d",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 110,
"avg_line_length": 27.63855421686747,
"alnum_prop": 0.5990627724498693,
"repo_name": "iychoi/syndicate",
"id": "94d90bbf5a01384c6cf676e8a5c050a2119ae0a0",
"size": "91... |
"""Interface for a USB-connected Monsoon power meter
(http://msoon.com/LabEquipment/PowerMonitor/).
"""
_author_ = 'kens@google.com (Ken Shirriff)'
import fcntl
import os
import select
import signal
import stat
import struct
import sys
import time
import collections
try:
from absl import flags
except ImportError:... | {
"content_hash": "84bcf6d7991581a3856968ae4c39abdb",
"timestamp": "",
"source": "github",
"line_count": 428,
"max_line_length": 109,
"avg_line_length": 35.85747663551402,
"alnum_prop": 0.6148432918485698,
"repo_name": "google/synthmark",
"id": "33a69e49505749147cd2a34ba2af1aa680ddc0c4",
"size": "15... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from datetime import datetime, timedelta
from sqlalchemy import Table, Column, Integer, Float, String, Unicode, Boolean, DateTime
from sqlalchemy.schema import F... | {
"content_hash": "35e961846aa1b5dd84cbd943cf2fbfbf",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 116,
"avg_line_length": 37.28635346756152,
"alnum_prop": 0.6046679066418672,
"repo_name": "qvazzler/Flexget",
"id": "6a4134bb8fe60d13e1db13d22b8a76fec3f388ef",
"size": "16... |
import os, sys, io
from . import ffiplatform, model
from .error import VerificationError
from .cffi_opcode import *
VERSION_BASE = 0x2601
VERSION_EMBEDDED = 0x2701
VERSION_CHAR16CHAR32 = 0x2801
USE_LIMITED_API = (sys.platform != 'win32' or sys.version_info < (3, 0) or
sys.version_info >= (3, 5))
... | {
"content_hash": "097e5a12bf235e7cbd716e9caad5402b",
"timestamp": "",
"source": "github",
"line_count": 1571,
"max_line_length": 80,
"avg_line_length": 40.77721196690006,
"alnum_prop": 0.506283073945146,
"repo_name": "sserrot/champion_relationships",
"id": "1aeae5b92a5fc1927f7e7d24056fb68eb8dbc329",
... |
from distutils.core import setup
from kafkameta import __version__
setup(name='kafkameta',
version=__version__,
description='Query Kafka metadata via Zookeeper',
author='Justin Lintz',
author_email='jlintz@gmail.com',
license='Apache License 2.0',
url='https://github.com/chartbeat/k... | {
"content_hash": "489d9edefd6f6dd9d8aa543dbfc4576c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 55,
"avg_line_length": 30.923076923076923,
"alnum_prop": 0.654228855721393,
"repo_name": "chartbeat-labs/kafkameta",
"id": "bf147bcbd4fb6635c7dd6dc9abab6c06cf181f8a",
"size... |
"""
The logger class responsible for writing the loglines to the given
file. We can also set the log level to one of the following levels
WARNING, INFO, VERBOSE and DEBUG
"""
import sys
import datetime
class Logger(object):
''' Logger class'''
def __init__(self, log_config, verbose=False, debug=F... | {
"content_hash": "78125e5571e23cee170e7b776b6d087d",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 79,
"avg_line_length": 33.369565217391305,
"alnum_prop": 0.47133550488599346,
"repo_name": "samklr/simoorg",
"id": "e0bbc4feb9ccdb2f40a6a07a0138b161d03a73c0",
"size": "663... |
from __future__ import unicode_literals
from operator import attrgetter
from uuid import UUID
from flask import flash, jsonify, redirect, request, session
from sqlalchemy.orm import contains_eager, subqueryload
from werkzeug.exceptions import Forbidden, NotFound
from indico.modules.auth.util import redirect_to_login... | {
"content_hash": "b1ae23b58a5361f5ebeca6c104c830e8",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 120,
"avg_line_length": 48.81325301204819,
"alnum_prop": 0.6326052079476737,
"repo_name": "mic4ael/indico",
"id": "7f22080703255dbe03191e002b096240581cc2ee",
"size": "1642... |
from .contexts import *
from .nddata_base import *
from .nddata import *
from .nduncertainty_converter import *
from .nduncertainty_unknown import *
from .nduncertainty_stddev import *
from .nduncertainty_var import *
from .nduncertainty_relstd import *
from .flag_collection import *
from .nddata_collection import *
f... | {
"content_hash": "2d2563deae050f3a5049c51adb85c9b7",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 38,
"avg_line_length": 26.933333333333334,
"alnum_prop": 0.7797029702970297,
"repo_name": "MSeifert04/nddata",
"id": "ac0928a9e39ff6b9763d4abe304f97ff5a27feb8",
"size": "46... |
"""This module is deprecated. Please use `airflow.providers.amazon.aws.hooks.aws_hook`."""
import warnings
# pylint: disable=unused-import
from airflow.providers.amazon.aws.hooks.aws_hook import AwsHook, _parse_s3_config, boto3 # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.providers.amaz... | {
"content_hash": "b27ccdd6ad87b0eda547c16950dfd86d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 96,
"avg_line_length": 35,
"alnum_prop": 0.7584415584415585,
"repo_name": "spektom/incubator-airflow",
"id": "cb9f4c22153f9e8dd2afb8038c4e48de320a2757",
"size": "1172",
"... |
'''
## License
The MIT License (MIT)
GrovePi for the Raspberry Pi: an open source platform for connecting Grove Sensors to the Raspberry Pi.
Copyright (C) 2015 Dexter Industries
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Sof... | {
"content_hash": "1bfa77414be07f71907d31405b89a547",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 126,
"avg_line_length": 33.70175438596491,
"alnum_prop": 0.7418011452368558,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "8720309b9a7e466520c1a4226facfaa823330935",
"siz... |
'''
Train
Train your nerual network
Author: Tawn Kramer
'''
from __future__ import print_function
import os
import sys
import glob
import time
import fnmatch
import argparse
import random
import json
import numpy as np
from PIL import Image
from tensorflow import keras
import conf
import models
'''
matplotlib can be... | {
"content_hash": "5e4b86de1d4dc55cc0536eca02fd4e1c",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 119,
"avg_line_length": 31.647302904564317,
"alnum_prop": 0.609545037367248,
"repo_name": "tawnkramer/sdsandbox",
"id": "b14b5f87ce181b4b29c2a7f35038a00fa1e605a8",
"size":... |
import operator
import numpy as np
import pytest
from pandas._libs.tslibs import (
IncompatibleFrequency,
Period,
Timestamp,
to_offset,
)
from pandas.errors import PerformanceWarning
import pandas as pd
from pandas import (
PeriodIndex,
Series,
Timedelta,
TimedeltaIndex,
period_ra... | {
"content_hash": "b4afa6bfa0c5ec868deba038321731fc",
"timestamp": "",
"source": "github",
"line_count": 1544,
"max_line_length": 88,
"avg_line_length": 36.31541450777202,
"alnum_prop": 0.5568118991992296,
"repo_name": "gfyoung/pandas",
"id": "5f93442cae4f6f4314f9d7a95df91622586d15d2",
"size": "5619... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="sci_instr",
version="0.0.1",
author="Tim Hellwig",
author_email="tim.hellwig@gmail.com",
description="VISA communication with scientific instruments",
url="https://github.com/timhellwi... | {
"content_hash": "7f579ba7b29b88f6e2f2c2f49b6730d3",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 65,
"avg_line_length": 28.63157894736842,
"alnum_prop": 0.6452205882352942,
"repo_name": "timhellwig/sci_instr",
"id": "e22770af0f719894c9f2625113bddab8a9b74072",
"size": "... |
import os
import sys
from db_pool import *
import re
import datetime
import subprocess
from PackageControl.PackageController import *
from MetaControl.MetaController import *
from Sample import *
from Launcher import *
import csv
import json
import string
import random
import re
import logging
import time
import traceb... | {
"content_hash": "7da7f05aa9cd9d47fa93a1c7b46c1d09",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 142,
"avg_line_length": 27.07606263982103,
"alnum_prop": 0.5710154507146988,
"repo_name": "codexgigassys/codex-backend",
"id": "9532b278dc51934c6c30dda43d2f2fac793fe4ce",
... |
import collections
TestCase = collections.namedtuple('TestCase', ['url', 'description'])
class TestCaseDecorator:
"""An object containing all test cases that make up the test suite for a specific database system.
Exposes its functionality via the decorator pattern.
Attributes:
url_prefix: The path prefix... | {
"content_hash": "bd3aa2071bc1cbea72ce8797726d28d5",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 100,
"avg_line_length": 31.81132075471698,
"alnum_prop": 0.697508896797153,
"repo_name": "google/security-testbeds",
"id": "b59a422b154bf321c0a80a96fadc68ce00b5e3fe",
"size... |
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_snowboydetect', [dirname(__file__)])
except ImportError:
import _sn... | {
"content_hash": "5e26c62f7f6e2b59db5abb47acb53ff1",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 94,
"avg_line_length": 30.51127819548872,
"alnum_prop": 0.6320847708230656,
"repo_name": "adam-c-fox/smartMirror",
"id": "b9b9b45ca4d14be3215135a6ce12eaf2095d52e2",
"size"... |
from __future__ import print_function
from itertools import islice, product
import logging
import MDAnalysis as md
import math
import random
import numpy as np
import pandas as pd
import plotly
import plotly.graph_objs as go
import subprocess
import scipy
import scipy.stats
import string
import time
import setting... | {
"content_hash": "5be666535186cc250e720d4c9b18862d",
"timestamp": "",
"source": "github",
"line_count": 1131,
"max_line_length": 141,
"avg_line_length": 39.779840848806366,
"alnum_prop": 0.5237936476184125,
"repo_name": "mikkkee/Bubble",
"id": "53ff78b695acab293155638bf1cce25450d125c6",
"size": "44... |
import re
from trac.config import get_configinfo
from trac.core import *
from trac.loader import get_plugin_info
from trac.perm import IPermissionRequestor
from trac.util.html import tag
from trac.util.translation import _
from trac.web.api import IRequestHandler
from trac.web.chrome import Chrome, INavigationContribu... | {
"content_hash": "5497b9a34282a89064861b7bb27cdacd",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 77,
"avg_line_length": 32.08064516129032,
"alnum_prop": 0.6430367018602313,
"repo_name": "rbaumg/trac",
"id": "469856a58838ca7987ff54b596d5b9c79d078b07",
"size": "2764",
... |
import tornado.web
from . import configuration
#from controllers.legacy import Legacy
#from controllers.robot import RobotController
from .handlers.ws_handler import WSHandler
from .handlers.login_handler import LoginHandler
from .handlers.logout_handler import LogoutHandler
from .handlers.signin_handler import SignInH... | {
"content_hash": "74be50f5c62b999c76134a785a91d814",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 64,
"avg_line_length": 30.285714285714285,
"alnum_prop": 0.6273584905660378,
"repo_name": "fernandolopez/xremotebot",
"id": "5cca70d2a0ec01153c20c18d8f887c8df4f54708",
"siz... |
import asyncio
import discord
from discord.ext import commands
from random import *
yoMumma = ["Yo momma is so fat, I took a picture of her last Christmas and it's still printing.",
'Yo momma is so fat when she got on the scale it said, "I need your weight not your phone number."',
"Yo momma's so... | {
"content_hash": "4c86e9dbb399e64803aa11749bab10e0",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 162,
"avg_line_length": 68.94805194805195,
"alnum_prop": 0.6328875494443398,
"repo_name": "ImTheTom/discordBot",
"id": "643e2b6de4d6c0d4fed6a41f691ee47aa08180d0",
"size": "... |
from .fill_sinks import SinkFiller
__all__ = ['SinkFiller', ]
| {
"content_hash": "67f78863bec7ac78527cf10d19f2db56",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 34,
"avg_line_length": 16,
"alnum_prop": 0.65625,
"repo_name": "Carralex/landlab",
"id": "a9001ab4c0e7e1cdd8c3f66467bbf6cafb8dd85f",
"size": "64",
"binary": false,
"copi... |
"""Script to run the experiments and plot the results."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
from absl import app
from absl import flags
import matplotlib.pyplot as plt
import numpy as np
import scipy.io
import skl... | {
"content_hash": "df5b504f3dd22f6ada3e47645181d22d",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 100,
"avg_line_length": 35.63025210084034,
"alnum_prop": 0.6326650943396226,
"repo_name": "google-research/accelerated_gbm",
"id": "44fd4b28e5a612c1c1566992e521d1ddc59f27a6"... |
import socket
import os
HOST = ''
PORT = 10000
servSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM);
print 'Socket created'
try:
servSock.bind((HOST, PORT))
except socket.error, msg:
print "Bind failed, error code: " + str(msg[0]) + ", message: " + msg[1]
sys.exit()
print "socket bind complete"
... | {
"content_hash": "2f9af32258adc96be78d249f887fcbe9",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 19.90909090909091,
"alnum_prop": 0.6552511415525114,
"repo_name": "alxshine/stp-tree-generator",
"id": "919a2fd064b987c94e5b9e407ec3bc9a49637501",
"s... |
from lockedash import app
from lockedash.auth.config import AuthConfig
from unittest import TestCase
from unittest.mock import patch
from lockedash.auth.app import AuthApp
from lockedash.auth.models import User
from lockedash.service import Service, Route
import os
class AuthTest(TestCase):
def setUp(self):
... | {
"content_hash": "f6057551bbbe499997b54de83c951a8f",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 78,
"avg_line_length": 24,
"alnum_prop": 0.6519097222222222,
"repo_name": "andrew-plunk/lockedash",
"id": "708fefe789ea775a32c87cd398684fdf047dd2bc",
"size": "1152",
"bin... |
"""Tests for data access and related functions in the pysat Instrument object.
Includes:
* data loading
* equality method comparisons
* index tests
* setter and getter functions
* concat
* empty data flags
* variable renaming
Note
----
Base class stored here, but tests inherited by test_instrument.py
"""
import dat... | {
"content_hash": "329148a3e72dbc013e1c0188212ee718",
"timestamp": "",
"source": "github",
"line_count": 1030,
"max_line_length": 80,
"avg_line_length": 38.23300970873787,
"alnum_prop": 0.5518537328593195,
"repo_name": "rstoneback/pysat",
"id": "93f784c3b0e073a4be3897a193da87543f5b2cb6",
"size": "39... |
import pygame
class GameObject(pygame.sprite.Sprite):
def __init__(self, image, parent, pos=(0,0), vel=(0,0)):
pygame.sprite.Sprite.__init__(self)
self.image = image
self.rect = image.get_rect()
self.rect.center = int(pos[0]), int(pos[1])
self.position = pos
self.ve... | {
"content_hash": "932a568587907fe85e75d007785f23e9",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 76,
"avg_line_length": 33.853658536585364,
"alnum_prop": 0.5770893371757925,
"repo_name": "jceipek/Mind-Rush",
"id": "2b134632d77824250f52b630cef0928467707dc9",
"size": "15... |
'''SMTP/ESMTP client class.
This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).
Notes:
Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RCPT
and MAIL commands!
E... | {
"content_hash": "f0a8c2541e4f8c3a1b03e915e22ea789",
"timestamp": "",
"source": "github",
"line_count": 846,
"max_line_length": 89,
"avg_line_length": 36.26359338061466,
"alnum_prop": 0.5777567717331074,
"repo_name": "Symmetry-Innovations-Pty-Ltd/Python-2.7-for-QNX6.5.0-x86",
"id": "5c487e59b8fff5bd8... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kumbhmela_metadb.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "2b42c91a0ae45a38292afa6c686771f8",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 80,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.7172995780590717,
"repo_name": "louisdijkstra/kumbhmela-metadata",
"id": "f30af29a0065a941f8c7852035fc683ec6fe0b59",... |
"""This module is deprecated. Please use :mod:`airflow.providers.amazon.aws.operators.emr`."""
import warnings
from airflow.providers.amazon.aws.operators.emr import EmrClusterLink, EmrModifyClusterOperator # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.providers.amazon.aws.operators.emr`... | {
"content_hash": "f5d0ecf3f640802aad8ca9ef62a7bfa6",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 103,
"avg_line_length": 33.45454545454545,
"alnum_prop": 0.7690217391304348,
"repo_name": "Acehaidrey/incubator-airflow",
"id": "71b44d5364e42c31330b3044210ad2cf680fb6b5",
... |
"""
Cluster-related objects and collections
"""
import copy
from distutils.version import StrictVersion
import six
import yaml
import sqlalchemy as sa
from nailgun.objects.serializers.cluster import ClusterSerializer
from nailgun.orchestrator import graph_configuration
from nailgun import consts
from nailgun.db i... | {
"content_hash": "424620cc2bd881d4ec3c838edca79ddf",
"timestamp": "",
"source": "github",
"line_count": 893,
"max_line_length": 79,
"avg_line_length": 34.63157894736842,
"alnum_prop": 0.5960033628661967,
"repo_name": "prmtl/fuel-web",
"id": "697996e6184d7f2ad0702ad60654d577f4322daf",
"size": "31561... |
import logging
import socket
from .deadline import Deadline
from .message import Message
logger = logging.getLogger(__name__)
BLOCK_SIZE = 4096
DEFAULT_TIMEOUT = 2.0
class Connection(object):
def __init__(self, host: str, port: int):
self.__buffer: bytearray = bytearray()
self.__socket = socket... | {
"content_hash": "2d15d9fb8b28ab6c17367df7687549cf",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 79,
"avg_line_length": 31.559322033898304,
"alnum_prop": 0.5461868958109559,
"repo_name": "goodfield/python-maxcube-api",
"id": "5cd398971983909dd84080045ce79f3669bf6ed9",
... |
from lino.api import _
from lino_xl.lib.lists.models import *
# from lino_xl.lib.coachings.mixins import Coachable
from lino_tera.lib.contacts.models import Partner
class List(List, Partner):
class Meta(List.Meta):
app_label = 'lists'
abstract = dd.is_abstract_model(__name__, 'List')
ver... | {
"content_hash": "c99077bde90dd22722b788763def5a3d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 75,
"avg_line_length": 33.233333333333334,
"alnum_prop": 0.633901705115346,
"repo_name": "lino-framework/tera",
"id": "b6e93daaa358479630716f1653df0252c3b953b9",
"size": "1... |
import unittest
from collections import namedtuple
from common import event
from crawler import prepare, get_items, crawl
import crawler
crawler.add_link = lambda *args, **kwargs: crawl(*args, **kwargs)
crawler.website_sleep_time = 0
html = lambda body: "<html><head></head><body>{}</body></html>".format(bo... | {
"content_hash": "ce9ce31683255a2e42c6c3ef063635a7",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 98,
"avg_line_length": 33.83098591549296,
"alnum_prop": 0.5441298917568693,
"repo_name": "andychase/eventizer",
"id": "2935eee8b0ef18418a60e07ff1623563113b1af7",
"size": "2... |
from __future__ import with_statement
from contextlib import contextmanager
@contextmanager
def Switch():
D = {}
class _P(Exception): pass
def _mkCase(var):
class _PP(_P):
V = var
def __repr__(self):
return str(self.V)
D[var]=_PP
return _PP
... | {
"content_hash": "4ca2912393979cc703e73b278257f49e",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 49,
"avg_line_length": 23.1864406779661,
"alnum_prop": 0.4283625730994152,
"repo_name": "ActiveState/code",
"id": "f7433cbf523d0f5c2705fb35118db345473a32fd",
"size": "1368"... |
import argparse, os
import multiprocessing, subprocess
from comm import *
__author__ = "Michael Wang"
__version__ = "0.1.0"
# window platform or linux platform
import platform
iswindow = platform.platform().find("Window")>=0
encodestr = "utf-8"
if iswindow:
encodestr = "gbk"
# 在每一个设备上面运行测试用例 / run testcase on each... | {
"content_hash": "b6924661965aff307968b6dacd27abd5",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 93,
"avg_line_length": 26.043478260869566,
"alnum_prop": 0.6750139120756817,
"repo_name": "butyesbutno/pyappium",
"id": "eaf6b5ff790f1fcf1e32b1777d7bd2003d6b4491",
"size": ... |
"""Helper functions for resegmentation.
Resegmentation is local segmentation targeted to specific points in an already
segmented volume. The results of resegmentation can be compared to the original
segments in order to perform object agglomeration.
"""
from __future__ import absolute_import
from __future__ import div... | {
"content_hash": "4231df00cdb7ecb8e8f65d5790c97a07",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 80,
"avg_line_length": 32.95189003436426,
"alnum_prop": 0.6092397538846595,
"repo_name": "google/ffn",
"id": "fa919a39abac344eade56ca298a8bd02d7ee0317",
"size": "10246",
... |
import os.path
import sys
import imp
PY_VERSION = sys.version_info[:2]
import ctypes
from collections import defaultdict
import math
import random
import timeit
import unittest
from flatbuffers import compat
from flatbuffers import util
from flatbuffers.compat import range_func as compat_range
from flatbuffers.compat... | {
"content_hash": "2f88e721f3022d305e718fd423d36b3c",
"timestamp": "",
"source": "github",
"line_count": 1802,
"max_line_length": 123,
"avg_line_length": 36.405105438401776,
"alnum_prop": 0.5676961068260113,
"repo_name": "yuryleb/osrm-backend",
"id": "b15227091680aa50ab88006ebcf6d123edd23077",
"size... |
import unittest
from tempfile import *
from util import *
import socket
import subprocess
class TestAsyncIO(unittest.TestCase):
def test_socket(self):
s = socket.socket()
s.connect(('google.com', 80))
x = AsyncIO(s)
data_recvd = BoxedObject(False)
x_closed = BoxedObject(False)
def do_reques... | {
"content_hash": "b847d9e3970ecdaf109f9e55288d4f6d",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 101,
"avg_line_length": 25.91578947368421,
"alnum_prop": 0.628757108042242,
"repo_name": "natduca/ndbg",
"id": "8da52be19403936e08aeda8736bb1445c7c8debd",
"size": "3038",
... |
from collections import Sequence # noqa
import logging
from django.conf import settings # noqa
from horizon import exceptions
__all__ = ('APIResourceWrapper', 'APIDictWrapper',
'get_service_from_catalog', 'url_for',)
LOG = logging.getLogger(__name__)
class APIVersionManager(object):
""" Object ... | {
"content_hash": "940f87a9fcf9fdf09147b36847f9656c",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 79,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.5629442788351295,
"repo_name": "kaiweifan/horizon",
"id": "0f5f51c4979cbfaceee42c35677f86c2f482db5c",
"size": "9... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "recast.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is real... | {
"content_hash": "5333ff9a25f0060e0d9e8a832edf5c32",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.23809523809524,
"alnum_prop": 0.6202046035805626,
"repo_name": "xurble/recast",
"id": "62a132ae0fa171e7a249f8ecaf93a7c2ed4824fb",
"size": "804",
... |
import numpy as np
import argparse
import glob
parser = argparse.ArgumentParser(description='''get the specfiles for training validating and testing''')
parser.add_argument('--specname_dir', metavar='DIR', required=True, help='the path to the specname npy file')
parser.add_argument('--train_valid_test_ratio', metavar=... | {
"content_hash": "f1992c93ced383dea1e289e779a5f815",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 115,
"avg_line_length": 31.96551724137931,
"alnum_prop": 0.5814455231930961,
"repo_name": "hycis/Pynet",
"id": "9c6a1ac3f1cb3b32bda26fd089c3ce1714661635",
"size": "1856",
... |
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("liveblog", "0002_liveblog_title"),
]
operations = [
migrations.AddField(
model_name="liveblog",
name="p... | {
"content_hash": "266a30a85c0db017461449e4de7efb9c",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 112,
"avg_line_length": 29.166666666666668,
"alnum_prop": 0.5622857142857143,
"repo_name": "nephila/djangocms-blog",
"id": "d58cf6eec1e45efd28e709364f20502206d184f2",
"size... |
from TimeseriesDB.MessageFormatting import *
import importlib
import unittest
from pytest import raises
import numpy as np
from TimeseriesDB.tsdb_error import *
from TimeseriesDB import DatabaseServer
from TimeseriesDB.MessageFormatting import * #Deserializer
from Similarity.find_most_similar import find_most_similiar,... | {
"content_hash": "6749db160da9b02a2718e494f8b5b4dd",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 107,
"avg_line_length": 36.425925925925924,
"alnum_prop": 0.563972208100322,
"repo_name": "slac207/cs207project",
"id": "ba772fedbe29250bc8c5ad05beadcae4505b7d62",
"size":... |
import sys
from atom.api import Typed
from enaml.widgets.splitter import ProxySplitter
from .QtCore import Qt, QEvent, Signal
from .QtGui import (
QSplitter, QSplitterHandle, QVBoxLayout, QFrame, QApplication
)
from .qt_constraints_widget import QtConstraintsWidget, size_hint_guard
from .qt_split_item import Qt... | {
"content_hash": "4a98d5865c10bee680d5d55bdb155244",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 79,
"avg_line_length": 36.68493150684932,
"alnum_prop": 0.5848892208115509,
"repo_name": "ContinuumIO/ashiba",
"id": "49d6ee6956ae14876a2d404f06cc7d9c820f3d7a",
"size": "8... |
from .docker_compose import DockerBaseSettings
class BuildDevSettings(DockerBaseSettings):
@property
def DATABASES(self): # noqa
return {}
DONT_HIT_DB = True
BuildDevSettings.load_settings(__name__)
| {
"content_hash": "9c9a0253ebb2808979b63672e200d0ae",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 46,
"avg_line_length": 18.75,
"alnum_prop": 0.7066666666666667,
"repo_name": "rtfd/readthedocs.org",
"id": "836352f3580ddf5a6539ccd26ef2d6e403597dce",
"size": "225",
"bin... |
"""Model defination for the Mask-RCNN Model.
Defines model_fn of Mask-RCNN for TF Estimator. The model_fn includes Mask-RCNN
model architecture, loss function, learning rate schedule, and evaluation
procedure.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_fun... | {
"content_hash": "a4d94cddb87592df546e7ac5b6733a13",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 180,
"avg_line_length": 45.07786885245902,
"alnum_prop": 0.6833348486226021,
"repo_name": "mlperf/training_results_v0.7",
"id": "7b4f0ba8c46bea5fc80d717dcd3fe6d8454b9f78",
... |
from .culture import *
from .recognizer import *
from .model import *
from .extractor import *
from .parser import *
from .utilities import *
| {
"content_hash": "f134b2d3f52a2a72e06e7cccc71c7c22",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 25,
"avg_line_length": 23.666666666666668,
"alnum_prop": 0.7464788732394366,
"repo_name": "matthewshim-ms/Recognizers-Text",
"id": "bfd07762e1bfbf1a30cb8bba5378ed93125747c0",
... |
from sys import winver
from sys import winver as baz
from sys.fob import winver
from sys.fob import winver as baz
from ...fob import oar
from ....fob import oar
from ......fob import oar
from .......fob import oar
from fob import (fob as oar, baz as quox) | {
"content_hash": "ab25024e6120c6ef673280fed10d18a7",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 41,
"avg_line_length": 28.333333333333332,
"alnum_prop": 0.7294117647058823,
"repo_name": "int19h/PTVS",
"id": "38049da1a1428521fe54c65020b588578494f851",
"size": "255",
"... |
import datetime
import logging
from django.conf import settings
from django.db import connections
from django.db import DEFAULT_DB_ALIAS
from django_transaction_barrier import postgresql
from django_transaction_barrier import sqlite3
from django_transaction_barrier.models import TransactionCommitBarrier
log = loggin... | {
"content_hash": "47e4723859a84c0270dfa229236f8359",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 78,
"avg_line_length": 35.559322033898304,
"alnum_prop": 0.7433269780743565,
"repo_name": "godaddy/django_transaction_barrier",
"id": "83024db57387a47e534bceb59eace093964e7a... |
import json
import random
import string
from SoftLayer import SoftLayerAPIError, SshKeyManager
from jumpgate.common.error_handling import bad_request, duplicate, not_found
NULL_KEY = "AAAAB3NzaC1yc2EAAAABIwAAAIEArkwv9X8eTVK4F7pMlSt45pWoiakFk" \
"ZMwG9BjydOJPGH0RFNAy1QqIWBGWv7vS5K2tr+EEO+F8WL2Y/jK4ZkUoQgoi+n7" \... | {
"content_hash": "aa84e838cce363f33ed8190ce93ead25",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 79,
"avg_line_length": 32.04587155963303,
"alnum_prop": 0.612081305468079,
"repo_name": "BillArnold/barnoldjg",
"id": "db985ec5d6816033a017b4ef498ae11eac356173",
"size": "... |
"""
Tests for implementations of L{IReactorUDP} and the UDP parts of
L{IReactorSocket}.
"""
from __future__ import division, absolute_import
__metaclass__ = type
import socket
from zope.interface import implementer
from zope.interface.verify import verifyObject
from twisted.python import context
f... | {
"content_hash": "00ddbc567141e7070ffce7767881d952",
"timestamp": "",
"source": "github",
"line_count": 454,
"max_line_length": 79,
"avg_line_length": 35.301762114537446,
"alnum_prop": 0.6006114681475011,
"repo_name": "hlzz/dotfiles",
"id": "53bb2d399a240a70ae78373f7d74b450b9fcd29d",
"size": "16101... |
"""Script for initializing EMA weights."""
import tensorflow as tf
from tensorflow.python import pywrap_tensorflow
from tensorflow import logging
import sys
src_cp = sys.argv[1] # the checkpoint with the weights
latest_checkpoint = sys.argv[2] # the checkpoint with the graph
destination = sys.argv[3] # the model d... | {
"content_hash": "6fe2775bf1cf9a232742929d088d8519",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 95,
"avg_line_length": 37.114285714285714,
"alnum_prop": 0.7128560431100847,
"repo_name": "mpekalski/Y8M",
"id": "ce91bb367b272cdd194d881621616a42f39acf69",
"size": "1875",... |
"""
Contains the DispatcherServer class and Dispatcher XMLRPC client.
The DispatcherServer takes in requests to perform commands and passes
those requests onto available nodes if any.
The DispatcherClient provides and XMLRPC-over-messagebus interface
to the dispatcher for querying the dispatcher s... | {
"content_hash": "6d748b1fe18ad8c8ea430a14e7a7d73a",
"timestamp": "",
"source": "github",
"line_count": 523,
"max_line_length": 96,
"avg_line_length": 37.44168260038241,
"alnum_prop": 0.6009600653661525,
"repo_name": "fedora-conary/rmake-2",
"id": "1a794d99bc997fcb4e7e9b2e68bea908c1160e97",
"size":... |
from .lin_op import LinOp
from ..utils.cuda_codegen import ReverseInOut
import numpy as np
class sum(LinOp):
"""Sums its inputs.
"""
def __init__(self, input_nodes, implem=None):
shape = input_nodes[0].shape
super(sum, self).__init__(input_nodes, shape)
def forward(self, inputs, outp... | {
"content_hash": "0f6995fc6898afd03116daea9324c34f",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 121,
"avg_line_length": 31.68421052631579,
"alnum_prop": 0.5664451827242525,
"repo_name": "timmeinhardt/ProxImaL",
"id": "077cf6df8bb6949e02b0b3f8578a54329740e800",
"size"... |
"""
:Author Patrik Valkovic
:Created 03.08.2017 12:28
:Licence MIT
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.old_api import Grammar
class TerminalAddWhenCreatingTest(TestCase):
def test_addOneInArray(self):
gr = Grammar(terminals=['A'])
self.assertTrue(gr.have_term('A'... | {
"content_hash": "fab63011f46fb5758ab35e68c87f6386",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 54,
"avg_line_length": 31.116666666666667,
"alnum_prop": 0.5902517407605785,
"repo_name": "PatrikValkovic/grammpy",
"id": "101b40c7b09f7c070a7766ebe88d80af2989eccc",
"size"... |
from tempest.lib import exceptions
TempestException = exceptions.TempestException
class QoSLimitReached(TempestException):
message = "Limit reached, limit = %(limit)d"
class SocketConnectionRefused(TempestException):
message = "Unable to connect to %(host)s port %(port)d:Connection Refused"
class Connect... | {
"content_hash": "9c767e575083ae6d860a89dfd20d5873",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 78,
"avg_line_length": 28.842105263157894,
"alnum_prop": 0.7700729927007299,
"repo_name": "cloudbase/neutron",
"id": "369a85b3b5c94b389ab58265b208b4f77f4402bd",
"size": "11... |
import os
import shutil
import signal
import netaddr
from neutron_lib.api.definitions import portbindings
from neutron_lib import constants as n_consts
from neutron_lib.utils import runtime
from oslo_log import log as logging
from neutron.agent.l3 import namespaces
from neutron.agent.l3 import router_info as router
f... | {
"content_hash": "b60e3f84fe57f0d8ea98bd6680b3fd99",
"timestamp": "",
"source": "github",
"line_count": 530,
"max_line_length": 79,
"avg_line_length": 41.781132075471696,
"alnum_prop": 0.6013367052023122,
"repo_name": "mahak/neutron",
"id": "222e1d1df36ebd8092b903c35e4991bac4db7ffb",
"size": "22761... |
from coyote_framework.config.abstract_config import ConfigBase
class LogConfig(ConfigBase):
def __init__(self):
super(LogConfig, self).__init__('log') | {
"content_hash": "06f7630fa3ca6775980bbdd66f114e5d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 62,
"avg_line_length": 23.571428571428573,
"alnum_prop": 0.696969696969697,
"repo_name": "Shapeways/coyote_framework",
"id": "2261a9d59e2865c32f17f5ab4fd2d1f9e941bb42",
"siz... |
"""Utility functions for curses-menu."""
import os
import sys
from typing import Callable
def null_input_factory() -> Callable[[int], None]:
"""Create a lambda that takes a single input and does nothing."""
return lambda input_: None
def clear_terminal() -> None:
"""
Call the platform specific func... | {
"content_hash": "cdc13f2ef4d3496af9baae4c1657cf6a",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 69,
"avg_line_length": 26.387096774193548,
"alnum_prop": 0.6308068459657702,
"repo_name": "pmbarrett314/curses-menu",
"id": "ae4c9f6b3f9f28265dc1dede267b163e0169d34f",
"siz... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.