text stringlengths 4 1.02M | meta dict |
|---|---|
import datetime
from django.utils.translation import ugettext as _
from django.db.models import Sum, Count
from django import forms
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.contrib import messages
from django.contrib.auth.models import User
... | {
"content_hash": "d922da97401565d5394ab44646aa4c0e",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 120,
"avg_line_length": 37.1764705882353,
"alnum_prop": 0.5777074542897328,
"repo_name": "ugoertz/tippspiel",
"id": "ef688f4fdcfe57a1a9985a9b65f29d95d35615f7",
"size": "56... |
import 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 'TaskStatus'
db.create_table(u'profiles_taskstatus', (
(u'id', self.gf('django.db.models.fields.A... | {
"content_hash": "4f914e37cc98b299e885a3bfccc3c017",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 194,
"avg_line_length": 81.97297297297297,
"alnum_prop": 0.5553907022749752,
"repo_name": "ProvidencePlan/Profiles",
"id": "dc085382b5408d370e09666bbd90cf733fc16585",
"siz... |
import deeplearn
# Rather than showing numbers show the species names
species = ["Iris-setosa", "Iris-versicolor", "Iris-virginica"]
# Load the neural network
deeplearn.load("result.nn")
# These dimensions are similar to those which exist in the
# data set, but are adjusted slightly so that the network
# has never... | {
"content_hash": "ed618e52a657dc543bea512c98df2adb",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 62,
"avg_line_length": 29.36,
"alnum_prop": 0.7125340599455041,
"repo_name": "xypan1232/libdeep-python",
"id": "4094e48ce92591d43a21745a8d94cde5a0b1e579",
"size": "753",
... |
"""
Installation script:
To release a new version to PyPi:
- Ensure the version is correctly set in accounting.__init__.py
- Run:
`python setup.py sdist`
`twine upload dist/*`
"""
from setuptools import setup, find_packages
import os
import sys
from accounting import get_version
PROJECT_DIR = os.path.dirname... | {
"content_hash": "d99463f01f8646f336949036db0ea794",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 81,
"avg_line_length": 35.131147540983605,
"alnum_prop": 0.592627158189454,
"repo_name": "dulaccc/django-accounting",
"id": "a0f9302a5d5fea02d70229ab6e6cb70f39978aa1",
"siz... |
from __future__ import annotations
import abc
from collections.abc import Callable, Sequence
from logging import getLogger
from typing import Optional
import numpy as np
from numpy.typing import ArrayLike
from pandas import DataFrame, Series
from scipy.interpolate import interp1d
from scipy.special import wofz
impor... | {
"content_hash": "b0c141d6212d398e7418ceeb968c6f5f",
"timestamp": "",
"source": "github",
"line_count": 473,
"max_line_length": 126,
"avg_line_length": 35.579281183932345,
"alnum_prop": 0.5207677223839801,
"repo_name": "mnishida/RII_Pandas",
"id": "77fa30876bcea76343e1b3f11f91c9d68da9e346",
"size":... |
lista = enumerate('zero um dois três quatro cinco seis sete oito nove'.split())
numero_string=dict(lista)
string_numero={valor:chave for chave,valor in numero_string.items()}
print (numero_string)
print(string_numero)
def para_numeral(n):
numeros=[]
for digito in str(n):
numeros.append(numero_... | {
"content_hash": "2585a563825ceb9e6b134be0c5cbd9c8",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 79,
"avg_line_length": 25.310344827586206,
"alnum_prop": 0.6430517711171662,
"repo_name": "igorlimasan/poo-python",
"id": "f763efa97d0a86654d7de1b48c84b73efd878388",
"size"... |
from lxml import etree
from webob import exc
from nova.api.openstack.compute.contrib import hypervisors
from nova import context
from nova import db
from nova import exception
from nova import test
from nova.tests.api.openstack import fakes
TEST_HYPERS = [
dict(id=1,
service_id=1,
service=dict(... | {
"content_hash": "89e966e4ea726c26a70cad2273dc656c",
"timestamp": "",
"source": "github",
"line_count": 496,
"max_line_length": 78,
"avg_line_length": 37.23991935483871,
"alnum_prop": 0.5002977640625846,
"repo_name": "tylertian/Openstack",
"id": "740477ca3b3aa3e13bc6fde5729ad8bbc919c457",
"size": "... |
"""Views for the node settings page."""
# -*- coding: utf-8 -*-
from dateutil.parser import parse as dateparse
import httplib as http
import logging
from flask import request, make_response
from framework.exceptions import HTTPError
from addons.base import generic_views
from addons.github.api import GitHubClient
fro... | {
"content_hash": "1c2d2932ec72fc2c2c6a034692db97ac",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 93,
"avg_line_length": 26.835483870967742,
"alnum_prop": 0.6089674239692271,
"repo_name": "hmoco/osf.io",
"id": "0a3b7da6fd11aac3d37f30da5a4202bd28428322",
"size": "8319",... |
from mudwyrm_users.admin.achaea import ScriptState
from mudwyrm_users.admin.achaea.action import Action, Outcome, EventOutcome
from mudwyrm_users.admin.achaea.trigger import Trigger, Alias, OnEvent
from mudwyrm_users.admin.achaea.scripts import achaea
from mudwyrm_users.admin.achaea.scripts import char
from mudwyrm_us... | {
"content_hash": "64f9cf207b37526c9bfc7150dc544d65",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 84,
"avg_line_length": 32.67901234567901,
"alnum_prop": 0.6501700037778617,
"repo_name": "sh-ft/mudwyrm_users",
"id": "540a4e94ecd5a13b55e9342e7657229b1c7cd51e",
"size": "2... |
import imghdr
import json
import os.path
import string
from copy import copy
from datetime import datetime
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.safestring import mark_safe
import bleach
import commonware.log
import jinja2
from tow... | {
"content_hash": "15aaae981e28de36803489825c084d84",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 79,
"avg_line_length": 33.0911528150134,
"alnum_prop": 0.5928056388236247,
"repo_name": "jinankjain/zamboni",
"id": "e366c234fd1b9f8c9c364484511f8f5232e758c5",
"size": "12... |
import datetime
import qsstats
def _is_empty(series):
for s in series:
for v in s['values']:
if v['y'] > 0:
return False
return True
class SimpleGraph(object):
datetime_xaxis = False
def __init__(self, *args):
self.series = [{
'area': False,
... | {
"content_hash": "ba81976de31a2370d0951cb39fefe03a",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 131,
"avg_line_length": 28.192660550458715,
"alnum_prop": 0.5206638464041653,
"repo_name": "animekita/selvbetjening",
"id": "ab56ac13f79a9e0be5a6751e1ae6322dbc002fc4",
"si... |
import build
import config
import train
| {
"content_hash": "81223ed3bfe25eda2f5bf3a2442189c2",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 13,
"avg_line_length": 13.333333333333334,
"alnum_prop": 0.85,
"repo_name": "2PacIsAlive/DeepOncology",
"id": "0627dd1db0c177d1c6aa50a2bef645aa21d275ca",
"size": "40",
"bi... |
import pexpect
import sys
import os
#
# Creates Variables to be referenced by code
#
switch_un = "pytest"
switch_pw = "pytest"
enable_pw = "password"
vlan = "300"
vlan_name = "TESTVLAN"
switch_port = "GigabitEthernet0/10"
#
#
# Create a logfile
stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
# Create Import for Text fi... | {
"content_hash": "f2035fb67481817c396a0449c642d808",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 70,
"avg_line_length": 25.737704918032787,
"alnum_prop": 0.7089171974522293,
"repo_name": "joshobrien77/staticnat",
"id": "c8d89a492d4c8aa21303ae96853c7479d05a3ec7",
"size"... |
from datetime import datetime, timedelta, time
from decimal import Decimal
from uuid import uuid1, uuid4, UUID
import six
import unittest
from cassandra.cqlengine import columns
from cassandra.cqlengine.management import sync_table
from cassandra.cqlengine.management import drop_table
from cassandra.cqlengine.models i... | {
"content_hash": "14199719bfcaa5b6777b9f577a7715ab",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 134,
"avg_line_length": 25.48605577689243,
"alnum_prop": 0.6560887916210724,
"repo_name": "kracekumar/python-driver",
"id": "243f7096ad43aa8381a9579323523312663a0964",
"si... |
"""ACL Groups admin handler."""
import httplib
import re
from simian.mac import admin
from simian.mac import models
from simian.mac.common import auth
from simian.mac.common import util
# TODO(user): consolidate email regex duplicated in settings.
MAIL_REGEX = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b'
c... | {
"content_hash": "2c5834d0db933466e13a911dc9cc31d7",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 80,
"avg_line_length": 33.62686567164179,
"alnum_prop": 0.6147359076786507,
"repo_name": "sillywilly42/simian",
"id": "12b6aa2d63c5dbe2bdeeba0a69f89a5a61352e4f",
"size": "2... |
class SbtBuildFileEditor:
def __init__(self, outputHandle):
self.outputHandle = outputHandle
commentInfo = "\n\n// ----- This part is generated by Scala Project Generator Facade plugin -----"
self.__writeToOutputHandle(commentInfo)
def simpleTransformation(self, kv):
key, value... | {
"content_hash": "74d3e143ea7a4e3d12ce16e62af04848",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 106,
"avg_line_length": 32.51851851851852,
"alnum_prop": 0.6150341685649203,
"repo_name": "lgmerek/ScalaProjectGeneratorFacade",
"id": "b4444fbc90a60c8aa59f899c4059b84a04d517... |
import traceback
import tornado.web
from tornado import gen
from admin.handler.baseHandler import BaseHandler
from common.authLib import auth_permissions
from setting import logger
class AdminRoleHandler(BaseHandler):
@tornado.web.authenticated
@auth_permissions
@gen.coroutine
def get(self, *args, *... | {
"content_hash": "c99f5c725dddb02b99c555c4f59c4a6f",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 122,
"avg_line_length": 32.34615384615385,
"alnum_prop": 0.562128418549346,
"repo_name": "xin1195/smartSearch",
"id": "4a017c74dee3ca7a2cecac654ba8659402332a71",
"size": "... |
import os
os.chdir('bindings/python')
execfile('setup.py')
| {
"content_hash": "a96578aefce7be8663eacab0dac27327",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 27,
"avg_line_length": 19.666666666666668,
"alnum_prop": 0.7457627118644068,
"repo_name": "jpetso/libtorrent",
"id": "06f12e01a8b3a7a9836fe9c0f516524b04be96fb",
"size": "82"... |
"""Main entry point for the Oozie to Airflow converter"""
import argparse
import logging
import os
import sys
# pylint: disable=no-name-in-module
from distutils.spawn import find_executable
from subprocess import CalledProcessError, check_call
from o2a.converter.mappers import ACTION_MAP
from o2a.converter.oozie_conv... | {
"content_hash": "f0f026000ada503b05806e4205b7c373",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 109,
"avg_line_length": 40.32592592592592,
"alnum_prop": 0.695077149155033,
"repo_name": "GoogleCloudPlatform/oozie-to-airflow",
"id": "2ccb2beefdd787976ce3a622e811a689734ea... |
"""Tests for artifacts."""
import os
import subprocess
import time
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# Pull in some extra artifacts used for testing.
from grr.lib import artifact_lib_test
# pylint: enable=unused-import,g-bad-import-order
from grr.client import cl... | {
"content_hash": "06bb73fe889105ba72ba1ffeb466a962",
"timestamp": "",
"source": "github",
"line_count": 751,
"max_line_length": 80,
"avg_line_length": 41.82423435419441,
"alnum_prop": 0.6292581980261064,
"repo_name": "ojengwa/grr",
"id": "eb81a052c2acff07a9d486ad7094dd180b3ae3ff",
"size": "31473",
... |
"""GitLab unused jobs collector."""
from typing import cast
from dateutil.parser import parse
from collector_utilities.functions import days_ago
from collector_utilities.type import Job
from .base import GitLabJobsBase
class GitLabUnusedJobs(GitLabJobsBase):
"""Collector class to get unused job counts from Gi... | {
"content_hash": "bed5c15c82f19c619833fb54c25ba26f",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 88,
"avg_line_length": 30.68421052631579,
"alnum_prop": 0.7084048027444254,
"repo_name": "ICTU/quality-time",
"id": "f79c0fe0de66cc198a72b91a4c919125c8d5c15a",
"size": "583... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir,'app.db')
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
SECRET_KEY = 'you-will-never-guess'
OPENID_PROVIDERS = [
{'name': 'Google', 'url': 'https://accounts.google.com/o... | {
"content_hash": "55519caad4dc21c73d2bb384723a00ac",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 76,
"avg_line_length": 41.642857142857146,
"alnum_prop": 0.6243567753001715,
"repo_name": "ychen820/microblog",
"id": "f2b14efd0fd50225d4baf1d3b152e6765bcbbde8",
"size": "5... |
from django.apps.registry import Apps
from django.db import models
from django.db.migrations.state import ProjectState, ModelState, InvalidBasesError
from django.test import TestCase
from .models import ModelWithCustomBase
class StateTests(TestCase):
"""
Tests state construction, rendering and modification b... | {
"content_hash": "793ed65c88acbaeb50d59ba6316fbbdf",
"timestamp": "",
"source": "github",
"line_count": 432,
"max_line_length": 132,
"avg_line_length": 36.61805555555556,
"alnum_prop": 0.575384031860421,
"repo_name": "dhoffman34/django",
"id": "ebeaffb7873827e0cd0162e689854ff46d9268dd",
"size": "15... |
"""DBCore is an abstract database package that forms the basis for beets'
Library.
"""
from __future__ import absolute_import
from .db import Model, Database
from .query import Query, FieldQuery, MatchQuery, AndQuery, OrQuery
from .types import Type
from .queryparse import query_from_strings
from .queryparse import so... | {
"content_hash": "ddf1790ff5384d2045ce8c306313c91e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 73,
"avg_line_length": 30.857142857142858,
"alnum_prop": 0.7939814814814815,
"repo_name": "kareemallen/beets",
"id": "059f1fc4f1bad3134303d3aa5c1600331fff96c5",
"size": "11... |
import os
import sys
import stat
import operator
import struct
import shutil
#from modulegraph.util import *
from macholib import mach_o
MAGIC = [
struct.pack('!L', getattr(mach_o, 'MH_' + _))
for _ in ['MAGIC', 'CIGAM', 'MAGIC_64', 'CIGAM_64']
]
FAT_MAGIC_BYTES = struct.pack('!L', mach_o.FAT_MAGIC)
MAGIC_LE... | {
"content_hash": "2be71d854b0909bbea72e28e816dea91",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 90,
"avg_line_length": 28.820408163265306,
"alnum_prop": 0.5749893782750318,
"repo_name": "lovexiaov/SandwichApp",
"id": "7f954b6f789d42f33251d91ae56db2d29523b214",
"size"... |
"""
Provides a ``CustomFormatter`` and ``CustomColoredFormatter`` which are enable
to insert ANSI color codes.
"""
from __future__ import absolute_import
import logging
__all__ = [
'CustomFormatter',
'CustomColoredFormatter',
]
# The background is set with 40 plus the number of the color, and the foreground ... | {
"content_hash": "d18c672ecf3852bba152c651aae3094b",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 88,
"avg_line_length": 30.80952380952381,
"alnum_prop": 0.6347243688820196,
"repo_name": "kreczko/rootpy",
"id": "82f3c750bcb443183f43fd96b01319467453e6fd",
"size": "1941",... |
"""Utilities for working with ``Future`` objects.
Tornado previously provided its own ``Future`` class, but now uses
`asyncio.Future`. This module contains utility functions for working
with `asyncio.Future` in a way that is backwards-compatible with
Tornado's old ``Future`` implementation.
While this module is an im... | {
"content_hash": "ce488ed6e3ec80b0398c74922b07bd58",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 83,
"avg_line_length": 30.2570281124498,
"alnum_prop": 0.6529068224050969,
"repo_name": "TeamSPoon/logicmoo_workspace",
"id": "7638fcfc988b65b287c016a66995ad6bb2b0f9e2",
"... |
import json
from http.client import HTTPSConnection
from paytrail import common
class AuthorizationNotDoneError(BaseException): pass
class ConnectAPI:
APINAME='PaytrailConnectAPI'
def __init__(self, apiKey, secret, apiLocation='account.paytrail.com:443', connectionMethod=HTTPSConnection, location=''):
... | {
"content_hash": "70ecaebf7a08fa42f477997132bcfcf0",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 126,
"avg_line_length": 35.98863636363637,
"alnum_prop": 0.633722766024629,
"repo_name": "paytrail/paytrail",
"id": "69113c01c6803c0c2c71b9b48998f16c6563c09f",
"size": "316... |
import email.parser
import itertools
import random
import time
import unittest
from collections import defaultdict
from contextlib import contextmanager
import json
from hashlib import md5
import mock
from eventlet import Timeout
from six import BytesIO
from six.moves import range
import swift
from swift.common impor... | {
"content_hash": "46a974088f7fcdd035b4301d65e017e6",
"timestamp": "",
"source": "github",
"line_count": 2465,
"max_line_length": 79,
"avg_line_length": 42.42068965517242,
"alnum_prop": 0.5583979649411382,
"repo_name": "aerwin3/swift",
"id": "d18ac4299bc6e74de3ec3e7d0bdcf7aee509c749",
"size": "10518... |
"""
Specific exception types
"""
class UnknownChannel(Exception):
pass
| {
"content_hash": "c590d830002083d4e2554e8447958b52",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 32,
"avg_line_length": 11,
"alnum_prop": 0.7012987012987013,
"repo_name": "PythonSanSebastian/python-rtmbot",
"id": "bbccff2953fa4792cea7fd2a90ba3128a519af4f",
"size": "77",... |
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
__author__ = '[email protected] (Wesley Chun)'
import httplib
import endpoints
from protorpc import messages
from... | {
"content_hash": "22f6f9124735a8aac3647a62beb450ac",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 74,
"avg_line_length": 31.50980392156863,
"alnum_prop": 0.7181082762912259,
"repo_name": "anudhagat/ConferenceCentral",
"id": "1b13ebe8b28855ffcf039d0fe579e5c3b49d7d5a",
"... |
"""
Copyright 2015 Paul T. Grogan, Massachusetts Institute of Technology
Copyright 2017 Paul T. Grogan, Stevens Institute of Technology
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://ww... | {
"content_hash": "92492e51b8809c855944ba3afc9d871c",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 81,
"avg_line_length": 45.46551724137931,
"alnum_prop": 0.586841107318923,
"repo_name": "ptgrogan/ofspy",
"id": "62600956aa1b3b5b276cb8332c7132136613bebf",
"size": "5274",... |
import unittest2
from tbans.consts.fcm.platform_type import PlatformType
class TestPlatformType(unittest2.TestCase):
def test_validate_invalid(self):
with self.assertRaises(ValueError):
PlatformType.validate(3)
def test_validate(self):
PlatformType.validate(PlatformType.ANDROID)... | {
"content_hash": "b392487bc38b6595a8293290865b3024",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 94,
"avg_line_length": 39.72727272727273,
"alnum_prop": 0.7231121281464531,
"repo_name": "jaredhasenklein/the-blue-alliance",
"id": "e5b879df2aab8fbf48c5969a3fe7a891aafcbc61"... |
from mpf.core.platform import SwitchConfig
from mpf.core.rgb_color import RGBColor
from mpf.exceptions.config_file_error import ConfigFileError
from mpf.tests.MpfTestCase import MpfTestCase, MagicMock, test_config, expect_startup_error
from mpf.tests.loop import MockSerial
class BaseMockFast(MockSerial):
def __... | {
"content_hash": "4efae5fec932ce833412ff6566d43e4f",
"timestamp": "",
"source": "github",
"line_count": 986,
"max_line_length": 121,
"avg_line_length": 36.504056795131845,
"alnum_prop": 0.5523851860083905,
"repo_name": "missionpinball/mpf",
"id": "e82439aa0bf09f46252f962f5319d7c254b79a44",
"size": ... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Logit'] , ['LinearTrend'] , ['NoCycle'] , ['LSTM'] ); | {
"content_hash": "d016963d2ba75650a440b2fa055619c3",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 76,
"avg_line_length": 37.25,
"alnum_prop": 0.697986577181208,
"repo_name": "antoinecarme/pyaf",
"id": "7115b43867838637f047842e4c5063d314ecca6a",
"size": "149",
"binary":... |
import os
from flask import Flask, render_template, send_from_directory
tmpl_dir = os.path.dirname(os.path.abspath(__file__))
app = Flask(__name__, template_folder=tmpl_dir, static_folder=tmpl_dir)
@app.route('/')
def main():
return render_template('index.html')
@app.route('/<path:filename>')
def static_url(fi... | {
"content_hash": "a87d2a6a5e55a9b4e213dda9a28c0d74",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 71,
"avg_line_length": 23.94736842105263,
"alnum_prop": 0.676923076923077,
"repo_name": "dongweiming/sed_and_awk",
"id": "e135b7cbe9aa3e051f7d211be40e4869a9827650",
"size":... |
import uuid
from glance.api import policy
from glance.openstack.common import local
class RequestContext(object):
"""
Stores information about the security context under which the user
accesses the system, as well as additional request information.
"""
user_idt_format = '{user} {tenant} {domain}... | {
"content_hash": "1337f4ffc0f2225a4c5f5e3dc4ef68db",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 77,
"avg_line_length": 34.71910112359551,
"alnum_prop": 0.565695792880259,
"repo_name": "redhat-openstack/glance",
"id": "e3905e82570482239f7bd3297c4c9e286cf57275",
"size":... |
from astropy.stats.histogram import calculate_bin_edges
__all__ = ["hist"]
def hist(x, bins=10, ax=None, max_bins=1e5, **kwargs):
"""Enhanced histogram function
This is a histogram function that enables the use of more sophisticated
algorithms for determining bins. Aside from the ``bins`` argument allo... | {
"content_hash": "92f8974061c298a646499fe5ccc67b44",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 79,
"avg_line_length": 32.32876712328767,
"alnum_prop": 0.6411016949152543,
"repo_name": "pllim/astropy",
"id": "0c1de320cd69739f0c436f623f3bf67f20e67827",
"size": "2425",
... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import os
import xml.etree.ElementTree as ET
from flexget import plugin
from flexget.utils.imdb import is_valid_imdb_title_id
from flexget.event import even... | {
"content_hash": "4830076e25704c3cda8b48d9e96123b4",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 120,
"avg_line_length": 41.178260869565214,
"alnum_prop": 0.5999366487171365,
"repo_name": "LynxyssCZ/Flexget",
"id": "37ddc4ba17951cdc0bcf03b266651ad1913f6eed",
"size": "... |
import os
from configSiteMover import config_sm
import SiteMover
from xrootdObjectstoreSiteMover import xrootdObjectstoreSiteMover
from S3ObjectstoreSiteMover import S3ObjectstoreSiteMover
class objectstoreSiteMover(SiteMover.SiteMover):
"""
ObjectstoreSiteMover
It uses the url to decide which Objectstore... | {
"content_hash": "c225e39d7e340c73f47bdd75f2dddeae",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 256,
"avg_line_length": 47.627450980392155,
"alnum_prop": 0.6873198847262247,
"repo_name": "PanDAWMS/pilot",
"id": "0aab9dbbc4006ac10614eb6e13f1101929dde5bc",
"size": "524... |
import _plotly_utils.basevalidators
class FillValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="fill", parent_name="volume.slices.x", **kwargs):
super(FillValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "7d2347a47640a0db4a4de5eda5a492fd",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 84,
"avg_line_length": 36.92857142857143,
"alnum_prop": 0.5764023210831721,
"repo_name": "plotly/python-api",
"id": "3271a78fa214b3660e6c56c9a8067749a59221d6",
"size": "517... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from dropbot import __version__ as pkg_version
readme = open('README.md').read()
requirements = [
'sleekxmpp==1.3.1',
'eveapi==1.2.6',
'redis==2.10.2',
'requests==2.3.0',
'humanize==0.5',
'dnspython... | {
"content_hash": "aab387ea5c4d0f2a3b66169a12ae02de",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 91,
"avg_line_length": 24.673076923076923,
"alnum_prop": 0.6118472330475448,
"repo_name": "nikdoof/dropbot",
"id": "001fc39cda2cde5276285311b022f8feef3b0ca3",
"size": "1330... |
from flask import request, url_for
from funcy import project, partial
from flask_restful import abort
from redash import models
from redash.handlers.base import (
BaseResource,
get_object_or_404,
paginate,
filter_by_tags,
order_results as _order_results,
)
from redash.permissions import (
can_m... | {
"content_hash": "d79bc7572c95fa48bf227a1a0b6c0412",
"timestamp": "",
"source": "github",
"line_count": 429,
"max_line_length": 163,
"avg_line_length": 33.7995337995338,
"alnum_prop": 0.6021379310344828,
"repo_name": "getredash/redash",
"id": "b86fb5e30d882eadc7745e7018b6884f302f709c",
"size": "145... |
import json
import unittest
from eve.utils import config
from tests import BaseTest, SimpleDoc, ComplexDoc
class TestHttpPut(BaseTest, unittest.TestCase):
def setUp(self):
response = self.client.post('/simpledoc/',
data='{"a": "jimmy", "b": 23}',
... | {
"content_hash": "a554b46c0c5fac6bbbc7b2d780fbf546",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 87,
"avg_line_length": 39.36144578313253,
"alnum_prop": 0.5681052953780227,
"repo_name": "MongoEngine/eve-mongoengine",
"id": "f98975855acc34bd1d7874312785d1c30192732a",
"s... |
import os
import ctypes
WORKING_DIR = os.environ.get("TRT_WORKING_DIR") or os.path.dirname(os.path.realpath(__file__))
IS_WINDOWS = os.name == "nt"
if IS_WINDOWS:
HARDMAX_PLUGIN_LIBRARY_NAME = "customHardmaxPlugin.dll"
HARDMAX_PLUGIN_LIBRARY = [
os.path.join(WORKING_DIR, "build", "Debug", HARDMAX_PLUGI... | {
"content_hash": "d2519c1a7dbbe891624b3df11892f6b5",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 94,
"avg_line_length": 41.27777777777778,
"alnum_prop": 0.6157469717362046,
"repo_name": "NVIDIA/TensorRT",
"id": "4e2c3946c9781c96425a646c853516b3a4e50b16",
"size": "2175"... |
"""Helper script for making sure that the configuration of the logger works. Called by test-logger.sh"""
from peyotl import get_logger
_LOG = get_logger()
_LOG.debug("a debug message")
_LOG.info("an info with umlaut ü message")
_LOG.warning("a warning message")
_LOG.error("an error message")
_LOG.critical("a critical m... | {
"content_hash": "9fdf50730b5b7cfa99b2f22f9ad9ad6a",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 104,
"avg_line_length": 37.166666666666664,
"alnum_prop": 0.742152466367713,
"repo_name": "OpenTreeOfLife/peyotl",
"id": "a5c5ee593088432c365c4a7b4b6f61dce7529d75",
"size":... |
import itertools
import weakref
class MetaSignals(type):
"""
register the list of signals in the class varable signals,
including signals in superclasses.
"""
def __init__(cls, name, bases, d):
signals = d.get("signals", [])
for superclass in cls.__bases__:
signals.exte... | {
"content_hash": "0a39419a687bd072c89d71b2951ba36b",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 93,
"avg_line_length": 42.03214285714286,
"alnum_prop": 0.6041294927351517,
"repo_name": "fkolacek/FIT-VUT",
"id": "b716939c9623128e5a17ffca649af42eb4274b72",
"size": "126... |
from collections import defaultdict
__author__ = 'esteele'
# Primary sources have two characters
# Implied or derived sources have three characters
FIND_A_BIBLE_SOURCE_ABBREV = "FB"
WALS_SOURCE_ABBREV = "WA"
JOSHUA_PROJECT_SOURCE_ABBREV = "JP"
AUSTLANG_SOURCE_ABBREV = "AL"
AUSTLANG_ABS_SOURCE_ABBREV = "AB"
SIL_RCEM_S... | {
"content_hash": "1c24c00335bb4482e313d166f6b37adc",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 75,
"avg_line_length": 39.75757575757576,
"alnum_prop": 0.7092987804878049,
"repo_name": "edwinsteele/language_explorer",
"id": "b891e032632eda51197e69e1fd2eb45e5013448f",
... |
"""
A module for decoding "Actions" additional PSD data format.
"""
from __future__ import absolute_import, unicode_literals
from psd_tools.utils import read_unicode_string, read_fmt
from psd_tools.constants import OSType, ReferenceOSType, UnitFloatType
from psd_tools.debug import pretty_namedtuple
from psd_tools.util... | {
"content_hash": "77edfefc5df8cb60370a5854132bce97",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 78,
"avg_line_length": 31.66030534351145,
"alnum_prop": 0.6335141651597348,
"repo_name": "tommo/gii",
"id": "4030300e77856e78c2fee96798f4d29a8d2de65c",
"size": "8319",
"... |
""""""
from __future__ import division # 1/2 == 0.5, as in Py3
from __future__ import absolute_import # avoid hiding global modules with locals
from __future__ import print_function # force use of print("hello")
from __future__ import unicode_literals # force unadorned strings "" to be unicode without prepending u"... | {
"content_hash": "65fda8decc403805e0b8d7a4ff721c7a",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 192,
"avg_line_length": 35.559633027522935,
"alnum_prop": 0.6289989680082559,
"repo_name": "ianozsvald/ipython_memory_usage",
"id": "bf77f9989b5470b3ae5df9159a922628fb288b97... |
import json
import os
import sys
import time
from . import junit_output
ABS_PATH_PREFIX = os.getcwd() + os.sep
def EscapeCommand(command):
parts = []
for part in command:
if ' ' in part:
# Escape spaces. We may need to escape more characters for this
# to work properly.
parts.append('"%s... | {
"content_hash": "d22cef68f2b6691a399fac76ecac2ea5",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 79,
"avg_line_length": 28.99127906976744,
"alnum_prop": 0.6237842173869448,
"repo_name": "guorendong/iridium-browser-ubuntu",
"id": "a02e9842b1ea3181851dc98cc59791905a58cc2d... |
"""Device-related support functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import context
from tensorflow.python.framework import device as tf_device
from tensorflow.python.framework import ops
def canonicalize(d,... | {
"content_hash": "b6ca73201d39a13cf98c7dd959aab4ad",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 91,
"avg_line_length": 32.7037037037037,
"alnum_prop": 0.687995469988675,
"repo_name": "adit-chandra/tensorflow",
"id": "db6009d1a45e7fa2f436ebd3ffa6625425e7a52a",
"size":... |
from setuptools import setup, find_packages
setup(name='fnordstalk',
version='0.0.4',
description='A tool to save beanstalk stats to fnordmetric',
author='Stephen Holiday',
author_email='[email protected]',
url='https://github.com/sholiday/fnordstalk',
install_requires=(
'... | {
"content_hash": "d61ba09cc5e52ec5610702cf7833185e",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 64,
"avg_line_length": 30.833333333333332,
"alnum_prop": 0.5765765765765766,
"repo_name": "sholiday/fnordstalk",
"id": "6bad95c551b7c926f9b3baa040449fb0870ba19b",
"size": "... |
import json
import pika
import socket
import sys
import time
import traceback
from dfa.common import dfa_logger as logging
LOG = logging.getLogger(__name__)
class DCNMListener(object):
"""This AMQP client class listens to DCNM's AMQP notification and
interacts with openstack for further tenant and network ... | {
"content_hash": "e29e1838cd7ca7bd42059d9811590090",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 78,
"avg_line_length": 39.096385542168676,
"alnum_prop": 0.5274268104776579,
"repo_name": "CiscoSystems/fabric_enabler",
"id": "87aa8fecfc11871c278a2197e3cbb685e6f49f22",
... |
'''A python package that handles the serialization/deserialization of XML SOAP
requests/responses from Tanium to/from python objects.
'''
from .object_types.all_objects import *
# from .session import Session
# from .question_asker import QuestionAsker
from .object_types.base import BaseType
from .object_types.result_... | {
"content_hash": "ea63b2197cb054ec035128cf1d623fa8",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 78,
"avg_line_length": 39,
"alnum_prop": 0.8076923076923077,
"repo_name": "tanium/pytan",
"id": "436c33a3bfa71852087a6821b956cff07dec9435",
"size": "390",
"binary": false... |
import mock
from rally import consts
from rally import exceptions
from rally import objects
from rally.plugins.openstack.context.keystone import users
from tests.unit import test
CTX = "rally.plugins.openstack.context.keystone.users"
class UserGeneratorTestCase(test.TestCase):
tenants_num = 1
users_per_ten... | {
"content_hash": "928a4539d7ef6c54f6001b4a670569a9",
"timestamp": "",
"source": "github",
"line_count": 343,
"max_line_length": 79,
"avg_line_length": 41.48396501457726,
"alnum_prop": 0.576779815869,
"repo_name": "shdowofdeath/rally",
"id": "d3fb3c640803ad33430e15c75670c1da5138e330",
"size": "14859... |
"""
An object for managing IPython profile directories.
Authors:
* Brian Granger
* Fernando Perez
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full licens... | {
"content_hash": "0c44a835623991579964161c99c2909b",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 110,
"avg_line_length": 34.46124031007752,
"alnum_prop": 0.5490945900348667,
"repo_name": "noslenfa/tdjangorest",
"id": "03726c41c855dacea14df195268dcf0ed43b1bc8",
"size":... |
"""
Plots the 2D velocity magnitude from a IBAMR simulation at saved time-steps
using the visualization software VisIt.
"""
from snake.ibamr.simulation import IBAMRSimulation
simulation = IBAMRSimulation()
body_name = 'flyingSnake2dAoA35ds004filledInside' # file name (no extension)
simulation.plot_field_contours_v... | {
"content_hash": "93ae3428abdfdae8b423868960bcef71",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 77,
"avg_line_length": 37.625,
"alnum_prop": 0.5764119601328903,
"repo_name": "mesnardo/snake",
"id": "63f0b3128d6710f75a7aaddf5f7374bcd3db23b2",
"size": "602",
"binary":... |
from rest_framework.views import APIView
from rest_framework.exceptions import APIException, NotFound
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from station.models import *
from clinic.models import *... | {
"content_hash": "9fbfdd6f369e4c6fd7bd1973eb11cd33",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 130,
"avg_line_length": 33.884393063583815,
"alnum_prop": 0.5214943705220061,
"repo_name": "slogan621/tscharts",
"id": "33cf0dc30926246d2d96a12eb223388e238e9992",
"size": ... |
from __future__ import print_function, unicode_literals
from django.core.management.base import CommandError
from django.db.models import Q
from django_evolution.compat.commands import BaseCommand
from django_evolution.compat.six.moves import input
from django_evolution.compat.translation import gettext as _
from dja... | {
"content_hash": "abf5d0108a5252f96988b2ee8e22b528",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 78,
"avg_line_length": 34.6875,
"alnum_prop": 0.5570570570570571,
"repo_name": "beanbaginc/django-evolution",
"id": "82fb95f257c935e0dba7da748aabe6c229c8b4a5",
"size": "333... |
from django.test import TestCase | {
"content_hash": "a0ee12cdc1f3aa194074be570b99435a",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 32,
"avg_line_length": 32,
"alnum_prop": 0.875,
"repo_name": "designcc/django-ccstartapp",
"id": "0fabb9f5311f015961b207d7d46bcb26acb37960",
"size": "32",
"binary": false,... |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import optparse
import os
import shutil
from StringIO import StringIO
import sys
import urlparse
import build_server
# Copy all the files necessary to run the server. These are cleaned up when the
# server quits.
build_server.main()
from fake_fetchers impo... | {
"content_hash": "0dec79a783ec80e564158f4902f948b8",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 79,
"avg_line_length": 31.991666666666667,
"alnum_prop": 0.6663193539984371,
"repo_name": "leiferikb/bitpop-private",
"id": "ff6585cd25d2da5731cbc9c9fa111f5564dc53cd",
"si... |
"""TensorFlow Debugger (tfdbg) Stepper Module."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import os
import shutil
import tempfile
import time
import six
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.debug import... | {
"content_hash": "73b71879612d68b64c74e025533c3668",
"timestamp": "",
"source": "github",
"line_count": 951,
"max_line_length": 109,
"avg_line_length": 36.44689800210305,
"alnum_prop": 0.6593000778973486,
"repo_name": "kchodorow/tensorflow",
"id": "ab500f52e358e521c62345797030dc706917e75e",
"size":... |
"""
TANTIGEN: Tumor T-cell Antigen Database from Dana Farber CVC
http://cvc.dfci.harvard.edu/tadb/index.html
"""
from os.path import join
import pandas as pd
import numpy as np
from static_data import DATA_DIR
from common import bad_amino_acids
from features import make_unlabeled_ngram_dataset_from_args
def _load_d... | {
"content_hash": "f161a04f075a24c7dfd8d19264a2b1a2",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 80,
"avg_line_length": 33.05194805194805,
"alnum_prop": 0.6385068762278978,
"repo_name": "cpcloud/pepdata",
"id": "3fcf8b1d956527baa3fb05c5765592983f1c624a",
"size": "3145"... |
"""Constants for use in the keystone.conf package.
These constants are shared by more than one module in the keystone.conf
package.
"""
_DEFAULT_AUTH_METHODS = ['external', 'password', 'token', 'oauth1', 'mapped']
_CERTFILE = '/etc/keystone/ssl/certs/signing_cert.pem'
_KEYFILE = '/etc/keystone/ssl/private/signing_... | {
"content_hash": "f796c7e53237e32fccd403945d3b3cfe",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 77,
"avg_line_length": 27.416666666666668,
"alnum_prop": 0.723404255319149,
"repo_name": "rajalokan/keystone",
"id": "8304e769a4eda03b68e508573da2d2d21f1134f8",
"size": "87... |
from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as n_const
from neutron_lib.plugins import constants as plugin_constants
from neutron_lib.plugins import ... | {
"content_hash": "f26c8e00a030f1db453709f503fdcb06",
"timestamp": "",
"source": "github",
"line_count": 502,
"max_line_length": 79,
"avg_line_length": 46.211155378486055,
"alnum_prop": 0.5949650831968273,
"repo_name": "eayunstack/neutron",
"id": "a68c758a4f53c1a81b6feaec8ead1a0fe9247a6e",
"size": "... |
import os
import subprocess
def execute_command(command):
"""Executes the specified command using a shell"""
print(command)
exitcode = subprocess.call(command, shell=True)
if exitcode != 0:
print("Exit code returned:", exitcode)
exit(exitcode)
def main():
site = "https://mapcruzin.... | {
"content_hash": "f4585f2420ac5130b7c49ca4abd3a3df",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 59,
"avg_line_length": 26.05,
"alnum_prop": 0.6314779270633397,
"repo_name": "mbudiu-vmw/hiero",
"id": "640e96e089cc577a78b348f0ea0bdb05cb972ea6",
"size": "1275",
"binary... |
import zmq
context = zmq.Context()
# This is where the weather server sits
frontend = context.socket(zmq.SUB)
frontend.connect("tcp://192.168.55.210:5556")
# This is our public endpoint for subscribers
backend = context.socket(zmq.PUB)
backend.bind("tcp://10.1.1.0:8100")
# Subscribe on everything
frontend.setsockop... | {
"content_hash": "a8a8ebc965503fd12ebece9cabd213f5",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 50,
"avg_line_length": 26.166666666666668,
"alnum_prop": 0.7117834394904459,
"repo_name": "krattai/noo-ebs",
"id": "249aa176280e0167d79c7c42607ddcc29ca4747e",
"size": "700"... |
"""MSA class to store MSA sequence.
"""
__author__ = 'Wenzhi Mao'
__all__ = ['MSA']
class MSA(object):
"""A MSA class to store sequences indexed by labels."""
def __init__(self, msa, labels=None, **kwargs):
from numpy import dtype, array
if type(msa) == list:
msa = [list(i) for ... | {
"content_hash": "10878c45548b888d6b4655fdd5487c4f",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 95,
"avg_line_length": 30.627118644067796,
"alnum_prop": 0.5229662423907028,
"repo_name": "wzmao/mbio",
"id": "191d2d2287d1a1d6cdf351e31342242abd05841f",
"size": "1831",
... |
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_tatooine_hutt_assassin_camp_large1.iff"
result.attribute_template_id = -1
result.stfName("poi_n","base_poi_building")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "ccf25ee86debe9c65f613d9ca68e3ab9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 86,
"avg_line_length": 24.615384615384617,
"alnum_prop": 0.7,
"repo_name": "anhstudios/swganh",
"id": "d4950f6706e3b227a31f8f61a7f33c1b79a32156",
"size": "465",
"binary":... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.cloud.vision.v1p4beta1",
manifest={
"WebDetection",
},
)
class WebDetection(proto.Message):
r"""Relevant information for the image from the Internet.
Attributes:
web_entities (Sequence[google.cloud.vision_... | {
"content_hash": "3cd32d4a27786ceb2ecac35e11af6f88",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 106,
"avg_line_length": 31.026881720430108,
"alnum_prop": 0.5598683070525039,
"repo_name": "googleapis/python-vision",
"id": "55d0b826dc636f43e37ba87ffe0813ff8d09c32f",
"s... |
from datetime import date, datetime
from stdnet import QuerySetError, odm
from stdnet.utils import test, zip, range
from examples.models import (SportAtDate, SportAtDate2, Person,
TestDateModel, Group)
class SortGenerator(test.DataGenerator):
def generate(self, **kwargs)... | {
"content_hash": "f533677a816bf653bb08296f1872fcea",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 77,
"avg_line_length": 32.08383233532934,
"alnum_prop": 0.578200821201941,
"repo_name": "lsbardel/python-stdnet",
"id": "b729d2bdb988336bd26b4b2857690d3c866edba3",
"size":... |
from google.appengine.ext import vendor
#https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27#installing_a_library
# pip install -t lib gcloud
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
| {
"content_hash": "e7b4fad337d3024098c3885e2bd71fb5",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 100,
"avg_line_length": 47.6,
"alnum_prop": 0.7857142857142857,
"repo_name": "tdliu/hoop-picks",
"id": "11a7706ec550ddd6c67151d96d4d9a694bd50979",
"size": "238",
"binary":... |
from __future__ import division, unicode_literals
import os
import glob
import numpy as np
from monty.json import jsanitize
from monty.json import MSONable
scipy_old_piecewisepolynomial = True
try:
from scipy.interpolate import PiecewisePolynomial
except ImportError:
from scipy.interpolate import CubicSpline
... | {
"content_hash": "8c3976f9454a7f9b05d5110b0b6d9ce3",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 83,
"avg_line_length": 42.53846153846154,
"alnum_prop": 0.5641369655252872,
"repo_name": "czhengsci/pymatgen",
"id": "d6c4bb446bb3652ea37876112c72d99c7138847b",
"size": "1... |
"""
cli:
Generic Abstract class for the Stasipy CLI.
Author: Corwin Brown
Date: 05/02/2016
"""
from abc import ABCMeta, abstractmethod
import argparse
class StasipyCLI(object):
__metaclass__ = ABCMeta
_description = None
def __init__(self, args):
"""
Constructor.
Args:
... | {
"content_hash": "31aefd0d6ce932d2ba7c63833ba2e0b6",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 79,
"avg_line_length": 26.192307692307693,
"alnum_prop": 0.5090553108174254,
"repo_name": "blakfeld/stasipy",
"id": "a0a0e43915d00717705aea2c58b55544aec733e3",
"size": "204... |
"""Tests for the experimental input pipeline ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import numpy as np
from tensorflow.python.client import session
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.pytho... | {
"content_hash": "cd334e1311160be1ee2470f686aa1f2b",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 80,
"avg_line_length": 35.092233009708735,
"alnum_prop": 0.6309309724719878,
"repo_name": "seanli9jan/tensorflow",
"id": "a0c6b37a6dc0c7f4cec829efb26bec08899b8b34",
"size"... |
import operator
import argparse
import praw
parser = argparse.ArgumentParser()
parser.add_argument("--subreddit", help="which subreddit to use", default="funny")
parser.add_argument("-n","--num", help="How many posts to test", default=10)
parser.add_argument("--type", help="What type of posts, hot/new/top", default='... | {
"content_hash": "37512c3fc6175cce56e46f1815221733",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 84,
"avg_line_length": 28.725,
"alnum_prop": 0.6753698868581375,
"repo_name": "dannyvai/reddit_crawlers",
"id": "9914119f6c847b86a40205f02712382c72289eb3",
"size": "1149",
... |
'''
Windows auditpol audit module
'''
from __future__ import absolute_import
import copy
import csv
import fnmatch
import logging
import salt.utils
import salt.utils.platform
log = logging.getLogger(__name__)
__virtualname__ = 'win_auditpol'
def __virtual__():
if not salt.utils.platform.is_windows():
r... | {
"content_hash": "468a62ba5233c7303858427434de3023",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 146,
"avg_line_length": 40.48039215686274,
"alnum_prop": 0.48050375393557765,
"repo_name": "HubbleStack/Hubble",
"id": "b46c4a6c9884d194513ca74b178c11006a1102a5",
"size": ... |
from setuptools import setup
import swiftly
setup(
name='swiftly', version=swiftly.VERSION, description='Client for Swift',
author='Gregory Holt', author_email='[email protected]',
url='http://gholt.github.com/swiftly/',
packages=['swiftly', 'swiftly.cli', 'swiftly.client'],
scripts=['bin/swiftly'... | {
"content_hash": "21272dfac8889397997927f790e71ed1",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 76,
"avg_line_length": 31.727272727272727,
"alnum_prop": 0.6962750716332379,
"repo_name": "dpgoetz/swiftly",
"id": "4ae113f6827e5a116fccc6194c9dd24f4a81e746",
"size": "948"... |
import argparse
import binascii
import getpass
import os
import sys
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
import king_phisher.color as color
import king_phisher.find as find
import king_phisher.security_keys as security_keys
import king_phisher.serializers as seriali... | {
"content_hash": "c8af6d0400209a394dc7668a45da8aa6",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 122,
"avg_line_length": 32.554054054054056,
"alnum_prop": 0.7359900373599004,
"repo_name": "wolfthefallen/king-phisher",
"id": "fa32172098561488b1d39e05755bda4d750f380b",
"... |
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reservations', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='queue',
name='difficulty',
field=models.P... | {
"content_hash": "495821aa2d4c08e415881d84eb0eb0ee",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 120,
"avg_line_length": 26.863636363636363,
"alnum_prop": 0.6040609137055838,
"repo_name": "hackerspace-ntnu/website",
"id": "983c998d6eed2ba9330d2e0f88237c51419154a1",
"si... |
import requests
import json
def retrieveCnnNews(search, num, filepath):
r = requests.get("https://search.api.cnn.io/content?q=" + search + "&size=" + str(num) + "")
response = r.json()["result"]
with open(filepath, 'a') as outfile:
print("CRAWLING RESULT")
for newsitem in response:
aux = dict()
... | {
"content_hash": "aa1416ada32616e54a3b042dbdf645d4",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 93,
"avg_line_length": 26.72222222222222,
"alnum_prop": 0.6008316008316008,
"repo_name": "gsi-upm/gsicrawler",
"id": "ea655f320797212a7a6a82977d6d98775a2d1113",
"size": "48... |
import rhc.tcpsocket as network
PORT = 12345
class EchoServer(network.BasicHandler):
def on_data(self, data):
self.send(data) # step 2: on server recv, send data back
class EchoClient(network.BasicHandler):
def on_ready(self):
self.test_data = b'test_data'
self.send(se... | {
"content_hash": "b4ea1dcbda0b42cf70628bbe0aa52fa1",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 77,
"avg_line_length": 24.733333333333334,
"alnum_prop": 0.628032345013477,
"repo_name": "robertchase/rhc",
"id": "05bf659feadf114bbb99acb29b3572f4872a742e",
"size": "742",... |
"""The service for gating features.
This service provides different interfaces to access the feature flag values
for clients and the backend respectively as they have different context for
evaluation of feature flag values.
For clients, please use 'evaluate_all_feature_flag_values_for_client' from
request handlers wi... | {
"content_hash": "85a06a35f988b33b32435468eb974b9a",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 80,
"avg_line_length": 32.17733990147783,
"alnum_prop": 0.6887630128597673,
"repo_name": "brianrodri/oppia",
"id": "571ceee976b74a153bb50bf7932ea4d926a8464a",
"size": "715... |
# Modify the print statement according to
# the mini-project instructions
print "We want... a shrubbery!" | {
"content_hash": "125470e157c4b823ff58532127b1c2d1",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 42,
"avg_line_length": 22.4,
"alnum_prop": 0.7232142857142857,
"repo_name": "mr-ice/pipython",
"id": "8c9dc3ce5e48c8291e6679bc6d476fedade4447a",
"size": "151",
"binary": f... |
from decimal import Decimal as D
from django.test import TestCase
from accounts.checkout.allocation import Allocations
class TestAllocations(TestCase):
def setUp(self):
self.allocations = Allocations()
def test_have_default_total_of_zero(self):
self.assertEqual(D('0.00'), self.allocations.... | {
"content_hash": "ae9fe57fe6b43d99b8c4ff3b63ce7e91",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 60,
"avg_line_length": 29.962962962962962,
"alnum_prop": 0.6551297898640297,
"repo_name": "carver/django-account-balances",
"id": "485cc3a2450501b152eac9c99a063fd076c17851",
... |
"""Test result objects."""
__all__ = [
'ExtendedToOriginalDecorator',
'MultiTestResult',
'TestResult',
'TextTestResult',
'ThreadsafeForwardingResult',
]
from testtools.testresult.real import (
ExtendedToOriginalDecorator,
MultiTestResult,
TestResult,
TextTestResult,
Threads... | {
"content_hash": "52ecf9719eae9fd0f83616e3acd6b20e",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 39,
"avg_line_length": 20.41176470588235,
"alnum_prop": 0.6829971181556196,
"repo_name": "postfix/pth-toolkit",
"id": "19f88bc8a34e77c0c7ff3b424d7da9f4a6325ddc",
"size": "4... |
"""
Metric index of a reference database
"""
import scripts
from amquery.core.distance import distances, FFP_JSD
from amquery.core.preprocessing.kmer_counter import KmerCounter
from amquery.core.sample import Sample
from amquery.core.storage import VpTree
from amquery.utils.config import get_sample_dir
class Referen... | {
"content_hash": "1c5c59d66c71a291c1d7c9cdd64947df",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 78,
"avg_line_length": 30.360655737704917,
"alnum_prop": 0.6490280777537797,
"repo_name": "arriam-lab2/amquery",
"id": "a352580a654e922c33089b1e742f609159c5d374",
"size": "... |
bind = "0.0.0.0:8080"
workers = 3
daemon = False
loglevel = "debug"
proc_name = "Residency"
pidfile = "/tmp/Residency.pid"
worker_class = "gevent"
debug = True
django_settings = "Residency.settings"
| {
"content_hash": "e8102e05e34a59db691ee579d5731718",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 38,
"avg_line_length": 22.11111111111111,
"alnum_prop": 0.7035175879396985,
"repo_name": "Kbman99/CodeWarriors",
"id": "0de252095cd2475ce8c7a3eb368e1ec28ee35c0d",
"size": "1... |
import bz2
import collections
import os
import re
import tarfile
import time
try:
import lzma
except ImportError:
lzma = None
import arpy
import six
from .utils import gzip_compress
from .version import __version__
class AptMeta(collections.OrderedDict):
def __init__(self, data):
super(AptMeta,... | {
"content_hash": "0d92a217fb9c17f43ef3dbf8161fb255",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 137,
"avg_line_length": 41.3399209486166,
"alnum_prop": 0.5882015489052491,
"repo_name": "coderanger/depot",
"id": "52059a94f8a69484ff6c1b989d5fe2ab42e7c873",
"size": "104... |
import sys, 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 configurat... | {
"content_hash": "60b4b676aeaac058db4a395d5d8e714a",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 80,
"avg_line_length": 32.62068965517241,
"alnum_prop": 0.7053760193295077,
"repo_name": "aino/aino-utkik",
"id": "bf7765e8a28e4eafc676de8356ca60f0d5c3218c",
"size": "7043... |
'''
@author: Frank
'''
import ConfigParser
class Parser(ConfigParser.SafeConfigParser):
def get(self, section, option, default=None):
try:
return ConfigParser.SafeConfigParser.get(self, section, option)
except ConfigParser.NoOptionError:
return default | {
"content_hash": "a955360817737be290bfa8171ba6b1b4",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 75,
"avg_line_length": 25.75,
"alnum_prop": 0.656957928802589,
"repo_name": "SoftwareKing/zstack-utility",
"id": "6c1255e72674dce6a5b02f66098c82e62e6fa104",
"size": "309",
... |
import optparse
import os
import pprint
import re
import shlex
import subprocess
import sys
import shutil
import string
# gcc and g++ as defaults matches what GYP's Makefile generator does,
# except on OS X.
CC = os.environ.get('CC', 'cc' if sys.platform == 'darwin' else 'gcc')
CXX = os.environ.get('CXX', 'c++' if sys... | {
"content_hash": "a27d4bf70c28778af4dcf756048be3aa",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 84,
"avg_line_length": 25.830357142857142,
"alnum_prop": 0.6310058762530245,
"repo_name": "xforce/jc3-handling-editor",
"id": "f34ec77758a3462ac877d4037fcf2388f2aedac0",
"... |
from datetime import datetime
import pytz
import arrow
from airy import settings
timezone = pytz.timezone(settings.TIMEZONE)
def tz_now() -> datetime:
return arrow.now(settings.TIMEZONE).datetime
def day_beginning(dt: datetime) -> datetime:
return arrow.get(dt).floor('day').datetime
def week_beginning(... | {
"content_hash": "6baf10a36c065274220e200656e277f0",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 73,
"avg_line_length": 22.34285714285714,
"alnum_prop": 0.6867007672634271,
"repo_name": "xuhcc/airy",
"id": "70dc624f2edd98cf9d8653d97003bcf0e7863a08",
"size": "782",
"b... |
"""
dfsbuild.py
单Git仓库多Dockerfile构建工具,提高了构建效率
快速使用:
chmod +x ./dfsbuild.py
只构建Git最近一次修改的Dockerfile
./dfsbuild.py -a auto -r registry.cn-shanghai.aliyuncs.com/userename
构建所有的Dockerfile
./dfsbuild.py -a all -r registry.cn-shanghai.aliyuncs.com/userename
构建特定的Dockerfile
./dfsbuild.py -a dfs -r registry.cn-shanghai.a... | {
"content_hash": "2bfda485292e1eb633c59a17b3044b9e",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 74,
"avg_line_length": 26.38888888888889,
"alnum_prop": 0.5915789473684211,
"repo_name": "wwek/docker",
"id": "9cd838a8b432de90cda224e48d3114010f1e16b0",
"size": "5955",
... |
import threading, MySQLdb
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from config import healthy_check_server_port as port
mysql_host = 'localhost'
mysql_port = 3306
mysql_user = 'mysql'
mysql_passwd = ''
CHECK_QUERY="SHOW GLOBAL STATUS WHERE variable_name='wsrep_local_state';"
class HealthyCheckHTTP... | {
"content_hash": "b06561a8032ff9a2617abc1ce74e3d62",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 73,
"avg_line_length": 28.813333333333333,
"alnum_prop": 0.5881536325775104,
"repo_name": "kuipertan/rdbs",
"id": "6183a5cefe3f23be33f36de83ee6227eb4a40d58",
"size": "2161"... |
import argparse
import time
import lib.asciicanvas as canvas
import itertools
import os
import tempfile
from sys import stderr
from lib.constants import *
from lib.encoding import *
from lib.vectorizer import *
from lib.statements import *
from lib.constants import ConstantsInvoker
from lib.extended_math import Exten... | {
"content_hash": "e9dc3fe3dae7a421833cffa94c5e7e07",
"timestamp": "",
"source": "github",
"line_count": 4176,
"max_line_length": 120,
"avg_line_length": 32.713840996168585,
"alnum_prop": 0.45421006785591417,
"repo_name": "Emigna/05AB1E",
"id": "ec32690e4741d3466cb7dda685f040404cbfacb1",
"size": "13... |
if 1:
from google.appengine.ext import testbed
from google.appengine.api.app_identity import app_identity_stub
from google.appengine.api.app_identity import app_identity_keybased_stub
import local_config
email_address = local_config.SERVICE_EMAIL
private_key_path = local_config.SERVICE_KEY_FILE
... | {
"content_hash": "20829074fc69dbfce7275e27f28ecbdb",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 103,
"avg_line_length": 40.69230769230769,
"alnum_prop": 0.6947069943289225,
"repo_name": "mitodl/xanalytics",
"id": "0c9925223ef20d6c61f0424babd47f1a73ef7919",
"size": "10... |
from datetime import datetime
from sqlalchemy.ext.associationproxy import AssociationProxy
from sqlalchemy.orm.attributes import InstrumentedAttribute
from sqlalchemy.orm.properties import RelationshipProperty
from werkzeug.exceptions import BadRequest
import iso8601
import sqlalchemy
from ggrc import db
from ggrc.lo... | {
"content_hash": "af2ac9a2e82e20620ece1acae8287532",
"timestamp": "",
"source": "github",
"line_count": 742,
"max_line_length": 79,
"avg_line_length": 36.30053908355795,
"alnum_prop": 0.6477816966771858,
"repo_name": "prasannav7/ggrc-core",
"id": "651997917e2de8ecf76541f355d583eee3eeed53",
"size": ... |
"""
This module contains all the classes that handle the intermediate
representation language. It is basically the REIL language with minor
changes. Below there is an overview of the REIL language and its
instruction format. For full details see "REIL: A platform-independent
intermediate representation of disassembled ... | {
"content_hash": "2d6b67ef6ebef511b4a8aaf977f4b36f",
"timestamp": "",
"source": "github",
"line_count": 768,
"max_line_length": 85,
"avg_line_length": 25.31640625,
"alnum_prop": 0.542251710127038,
"repo_name": "bj7/barf-project",
"id": "b34e8d2e536dbe267c98c85d0a13aaa43df7de15",
"size": "20789",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.