text stringlengths 4 1.02M | meta dict |
|---|---|
import os.path
import tempfile
import wordcount_lib
def _make_testfile(filename, data):
"Make a temp file containing the given data; return full path to file."
tempdir = tempfile.mkdtemp(prefix='wordcounttest_')
testfile = os.path.join(tempdir, filename)
with open(testfile, 'wt') as fp:
... | {
"content_hash": "b52158dab9a13d5547761cff11190319",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 78,
"avg_line_length": 29.966666666666665,
"alnum_prop": 0.64293659621802,
"repo_name": "lifan0127/2016-pycon-tutorial-project",
"id": "711e5dadaa176e9f9b080ce781e7bf78b3afe1... |
import _plotly_utils.basevalidators
class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="colorsrc", parent_name="funnel.marker.line", **kwargs
):
super(ColorsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | {
"content_hash": "19c9c7ac166973019224ffedacb31fcc",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 80,
"avg_line_length": 33.285714285714285,
"alnum_prop": 0.5944206008583691,
"repo_name": "plotly/python-api",
"id": "f517260ef7a8327ac46c434bf4169a388b4da38e",
"size": "46... |
from __future__ import unicode_literals
from django.db import models, migrations
def starting_urls(apps, schema_editor):
Url = apps.get_model("url_checker", "url")
Url(name="mitre", url="http://buecrplb01.cienradios.com.ar/Mitre790.aac").save()
Url(name="continental", url="http://1351.live.streamtheworld... | {
"content_hash": "3c7f2c703a3ca6f505f481278a589ba7",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 114,
"avg_line_length": 43.34285714285714,
"alnum_prop": 0.6420566908371786,
"repo_name": "unbalancedparentheses/radioelm",
"id": "6abe7867f68c4e9a91b449cdbd015374ff20b788",
... |
'''
Stack Layout
============
.. only:: html
.. image:: images/stacklayout.gif
:align: right
.. only:: latex
.. image:: images/stacklayout.png
:align: right
.. versionadded:: 1.0.5
The :class:`StackLayout` arranges children vertically or horizontally, as many
as the layout can fit. The siz... | {
"content_hash": "09703a7c3a9221e132938d9c2b632d84",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 80,
"avg_line_length": 33.78964401294498,
"alnum_prop": 0.5331864763911502,
"repo_name": "JohnHowland/kivy",
"id": "ea1f15fd9cb87b3d4046369161d98df61caf467e",
"size": "104... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from operator import or_
from six.moves import reduce
from sentry.models import ApiKey, AuditLogEntryEvent
from sentry.web.frontend.base import OrganizationView
DEFAULT_SCOPES = [
'pro... | {
"content_hash": "022a7176a92c6256962fb85f7e7ef28d",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 87,
"avg_line_length": 29.756756756756758,
"alnum_prop": 0.5540417801998183,
"repo_name": "fotinakis/sentry",
"id": "638484ea7aeb1226898a5269be832a370b33a9ee",
"size": "220... |
'''OpenGL extension SGI.texture_color_table
This module customises the behaviour of the
OpenGL.raw.GL.SGI.texture_color_table to provide a more
Python-friendly API
Overview (from the spec)
This extension adds a color lookup table to the texture mechanism.
The table is applied to the filtered result of a texture... | {
"content_hash": "f3c75fa4f029517cb2de7efbe50fb8ed",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 71,
"avg_line_length": 36.707317073170735,
"alnum_prop": 0.7966777408637874,
"repo_name": "alexus37/AugmentedRealityChess",
"id": "a917dbe39e8d333eebff9b6d75f2c7891d1ccb9b",
... |
""" Representation of DNS A records """
from sqlalchemy import Column, ForeignKey, Index
from sqlalchemy.orm import (relation, backref, mapper, deferred, object_session,
validates)
from sqlalchemy.orm.attributes import instance_state
from sqlalchemy.sql import join, and_
from aquilon.excep... | {
"content_hash": "de2cf0658e41b4c0584da172ea4e40a3",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 94,
"avg_line_length": 46.55913978494624,
"alnum_prop": 0.5196304849884527,
"repo_name": "guillaume-philippon/aquilon",
"id": "a7b42ee37c2c64e5d632dce94f196dfe04e7758f",
"... |
from collections import defaultdict, OrderedDict
import math
import os
import cPickle
import copy
import numpy as np
import pysal as ps
from pysal.weights.util import get_ids
from analysis import NetworkG, NetworkK, NetworkF
import util
__all__ = ["Network", "PointPattern", "NetworkG", "NetworkK", "NetworkF" ]
cl... | {
"content_hash": "1e2e6170513abd71fbe1308d18b30a78",
"timestamp": "",
"source": "github",
"line_count": 1167,
"max_line_length": 128,
"avg_line_length": 33.94515852613539,
"alnum_prop": 0.5221891250567982,
"repo_name": "darribas/pysal",
"id": "6ed98581c4dfaed113e2adfcc6d108c06f262229",
"size": "396... |
from . import app
from datetime import date
from flask import url_for, current_app
from flask.ext.themes2 import render_theme_template, get_theme
from markdown import markdown
from smartypants import smartyPants
import bleach
import bs4
import codecs
import datetime
import jwt
import os
import os.path
import random
imp... | {
"content_hash": "d66b48789615e1f89d8ec19197d9282a",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 94,
"avg_line_length": 28.435267857142858,
"alnum_prop": 0.5910197032734124,
"repo_name": "thedod/redwind",
"id": "2e254dfdf30af38372919be488c210a5dd44c9ec",
"size": "1273... |
import stat
import sys
from pathlib import Path
from synthtool.sources import templates
FIXTURES = Path(__file__).parent / "fixtures" / "node_templates" / "standard"
NODE_TEMPLATES = Path(__file__).parent.parent / "synthtool/gcp/templates/node_library"
def test_render():
t = templates.Templates(FIXTURES)
r... | {
"content_hash": "49ff355ed8a879172981d9d196948805",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 86,
"avg_line_length": 30.979166666666668,
"alnum_prop": 0.6455951580363147,
"repo_name": "googleapis/synthtool",
"id": "0e555be22be78aa5604c2053ee4171c30387418e",
"size": ... |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from sqlserver_ado.fields import (LegacyDateTimeField, LegacyDateField,
LegacyTimeField, DateField, DateTimeField, TimeField, DateTimeOffsetField)
@python_2_unicode_compatible
class LegacyDateTimeTable(models.Model):... | {
"content_hash": "690a9eaa462af4cccf99aa46b75825aa",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 78,
"avg_line_length": 23.426470588235293,
"alnum_prop": 0.6603892027620841,
"repo_name": "theoriginalgri/django-mssql",
"id": "de0133a793e946a85b5a15ab3197a18f7a66fb0d",
"... |
from setuptools import setup
setup(
setup_requires=["pbr>=1.8"],
pbr=True,
)
| {
"content_hash": "1fb730006d7c739b2eeef2c00c250770",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 32,
"avg_line_length": 14.333333333333334,
"alnum_prop": 0.6395348837209303,
"repo_name": "Marx314/python-ubersmithclient",
"id": "b2e43a5b397959ae7e47644f24fbc1c4e1c5607c",
... |
from django.apps import AppConfig
class TestsConfig(AppConfig):
name = 'tests'
| {
"content_hash": "553469c02c45dd7e31108c1b4eba53e3",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 17,
"alnum_prop": 0.7411764705882353,
"repo_name": "ZeroCater/zc_common",
"id": "a56b400e349311bb9e10781ef3d7898761c32a75",
"size": "85",
"binary": ... |
import urllib.request
from urllib.error import URLError
import html2text
import xml.etree.ElementTree as ET
#from time import strptime, mktime
#PUBDATEFORMAT = "%a, %d %b %Y %H:%M:%S %z"
def get_new_articles(source):
articles = []
try:
response = urllib.request.urlopen(source)
orig_rss = response.read().decode(... | {
"content_hash": "424918ab16fa6012535019989d13edce",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 65,
"avg_line_length": 24.306122448979593,
"alnum_prop": 0.6607892527287993,
"repo_name": "SmBe19/RedditBots",
"id": "059859eb9e3dc85cbdff491229986149417ee2fa",
"size": "11... |
from rctk.widgets.control import Control, Attribute
from rctk.event import Changable, Submittable, Keypressable
class Text(Control, Changable, Submittable, Keypressable):
name = "text"
value = Attribute("")
rows = Attribute(1, Attribute.NUMBER)
columns = Attribute(20, Attribute.NUMBER)
class Passwor... | {
"content_hash": "02c834bd7aaffd0d7c80b98cdb875901",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 27,
"alnum_prop": 0.7293447293447294,
"repo_name": "rctk/rctk",
"id": "c73f00c03a5e9c6532ba7aa2eda653743faa65b3",
"size": "351",
"binary": false,
... |
"""Support for Sonarr."""
from datetime import datetime
import logging
import time
from pytz import timezone
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_API_KEY,
CONF_HOST,
CONF_MONITORED_CONDITIONS,
CONF_P... | {
"content_hash": "f4b525b2912e1952d488958ae4fb3254",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 87,
"avg_line_length": 35.1021897810219,
"alnum_prop": 0.5236015803701394,
"repo_name": "postlund/home-assistant",
"id": "c0781b37603ab3e13e832c29d8f16ce9b02dc5c3",
"size"... |
import argparse
import tarfile
import re
def extract_text(filein):
return filein.read().decode("utf-16").replace("\r","").encode("utf-8")
if __name__ == "__main__":
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-f', '--file', required=True, h... | {
"content_hash": "d51630ffe4ff5c329f6a55a6138a18c2",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 103,
"avg_line_length": 46.8936170212766,
"alnum_prop": 0.5707803992740472,
"repo_name": "xingniu/nlp-util",
"id": "110ea377d74423dbf66247064fa3cab63a8b5810",
"size": "2249... |
import locale
import os
import struct
from subprocess import Popen, PIPE
import sys
import threading
import time
from .util import six
# Import some platform-specific things at top level so they can be mocked for
# tests.
try:
import pty
except ImportError:
pty = None
try:
import fcntl
except ImportError:... | {
"content_hash": "aa99017230d1bcd60f2a596203cc1a9c",
"timestamp": "",
"source": "github",
"line_count": 1174,
"max_line_length": 132,
"avg_line_length": 40.057069846678026,
"alnum_prop": 0.5860250494396836,
"repo_name": "mkusz/invoke",
"id": "72786702fc8083d7af048b13b7c5a9b872cdc651",
"size": "4705... |
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 field 'OrderItem.product_legacy_id'
db.add_column(u'checkout_orderitem', 'product_legacy_id',
self.gf... | {
"content_hash": "9f9ad90267ca13fb6556264aa79dfccf",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 181,
"avg_line_length": 80.57534246575342,
"alnum_prop": 0.5572934376062564,
"repo_name": "Lisaveta-K/lisaveta-k.github.io",
"id": "1e7ebc095b2588a359ae6830b5f7b925a350c1f0"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import flags
import absl.logging as _logging # pylint: disable=unused-import
import collections
import os
import time
import math
import json
import six
import random
import gc
import numpy as np
... | {
"content_hash": "6b7ab5e43fe21676418b22d75b20b369",
"timestamp": "",
"source": "github",
"line_count": 1309,
"max_line_length": 83,
"avg_line_length": 34.99923605805959,
"alnum_prop": 0.617169424193478,
"repo_name": "zihangdai/xlnet",
"id": "156fa4396e149186ab0a1873750e851796558f6e",
"size": "4583... |
"""
sphinx.locale
~~~~~~~~~~~~~
Locale utilities.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import gettext
from six import PY3, text_type
from six.moves import UserString
class _TranslationProxy(UserString, object):
"""
... | {
"content_hash": "997536b7dcb3b1a0cce310ed9f9edff1",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 80,
"avg_line_length": 27.060606060606062,
"alnum_prop": 0.5872660374340105,
"repo_name": "axbaretto/beam",
"id": "d6ce7329bec527cd9be812b0afa045d3c6ea60ea",
"size": "6275... |
from __future__ import division
import logging
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # Seemingly unused, but for 3D plots
from matplotlib.colors import ColorConverter
from shapely.geometry import box, Polygon
from descartes.patch import PolygonPatch
from cops_and_... | {
"content_hash": "cc52366b0e9fafe580a299475eb5a75a",
"timestamp": "",
"source": "github",
"line_count": 348,
"max_line_length": 88,
"avg_line_length": 36.11494252873563,
"alnum_prop": 0.5568905155951623,
"repo_name": "COHRINT/cops_and_robots",
"id": "230fbd01667e2e19b74c84059e1cb5da3de382c5",
"size... |
class Solution:
def jump(self, nums: [int]) -> int:
count = max_right = current_right = 0
for i, num in enumerate(nums):
if i > max_right:
return 0
if i > current_right:
current_right = max_right
count += 1
if i + n... | {
"content_hash": "d0cc7d02b6f0956d291d2ff547b13e18",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 45,
"avg_line_length": 28.142857142857142,
"alnum_prop": 0.4517766497461929,
"repo_name": "BigEgg/LeetCode",
"id": "9e0dc4f0e40b6db9ff269c56080ca9d587329cdf",
"size": "394"... |
from django.conf import settings
from django.db import models
from django.core.urlresolvers import reverse
from . import util
import mimetypes
from datetime import datetime
import os
class Attachment(models.Model):
"""
a file attachment assiciated with a post
a post may have many attachments
"""
... | {
"content_hash": "c47f832c1acf80906c104edc8a74f7ec",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 81,
"avg_line_length": 28.545454545454547,
"alnum_prop": 0.5947452229299363,
"repo_name": "majestrate/nntpchan",
"id": "19ded9eb9efcaeb2ec18c676a763686a8143986e",
"size": ... |
import requests
from requests.exceptions import HTTPError
#from requests_toolbelt.utils import dump
#def print_raw_http(response):
# data = dump.dump_all(response, request_prefix=b'', response_prefix=b'')
# print('\n' * 2 + data.decode('utf-8'))
class Request(object):
"""HTTP helper class"""
def __init... | {
"content_hash": "b1c613ce4c41322133e9a0d9a18824b1",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 115,
"avg_line_length": 37.28358208955224,
"alnum_prop": 0.5800640512409928,
"repo_name": "jeffreydwalter/arlo",
"id": "f80afa3475b9f530b734c30756af9802570e7d48",
"size": "... |
import direct.directbase.DirectStart
from pandac.PandaModules import *
from direct.filter.CommonFilters import CommonFilters
import sys
base.accept("escape", sys.exit)
base.disableMouse()
base.oobe()
base.accept("v", base.bufferViewer.toggleEnable)
base.accept("V", base.bufferViewer.toggleEnable)
base.bufferViewer.s... | {
"content_hash": "77a8a5e44fd1aefb4886d4b6c83ff461",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 66,
"avg_line_length": 26.742857142857144,
"alnum_prop": 0.7649572649572649,
"repo_name": "mdinacci/rtw",
"id": "c20e671e30d79cd20c6a0a5cbf7b042d2ebf7106",
"size": "936",
... |
class Address(object):
def __init__(self, street_address, district, city):
self.street_address = street_address
self.district = district
self.city = city
self.country = "Vietnam"
def get_street_address(self):
return self.street_address
def get_district(self):
... | {
"content_hash": "6eadbbf17150b469379965f36ef67d80",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 75,
"avg_line_length": 25,
"alnum_prop": 0.6018181818181818,
"repo_name": "earlwlkr/POICrawler",
"id": "8cae604b8ca8a8dfaa05f9e3ff31fc8cbc6591de",
"size": "550",
"binary"... |
import subprocess
import time
from progressbar import ProgressBar
import make_mfcc_data
def cmd(cmd):
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
return stdout.rstrip()
dirs = cmd("ls voice2")
labels = dirs.splitlines()
if 'do... | {
"content_hash": "bdaa3640fe24f12805a60538686905ad",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 89,
"avg_line_length": 21.209302325581394,
"alnum_prop": 0.6370614035087719,
"repo_name": "piruty-joy/voice_actor_recog",
"id": "c812e6345ce23046dfab6e30c21976fdde2c7039",
... |
<<<<<<< HEAD
<<<<<<< HEAD
"""
Tests for the threading module.
"""
import test.support
from test.support import verbose, strip_python_stderr, import_module, cpython_only
from test.script_helper import assert_python_ok, assert_python_failure
import random
import re
import sys
_thread = import_module('_thread')
threadin... | {
"content_hash": "73bff6500397b661639eebf810578f63",
"timestamp": "",
"source": "github",
"line_count": 3312,
"max_line_length": 89,
"avg_line_length": 35.5024154589372,
"alnum_prop": 0.5524561164784324,
"repo_name": "ArcherSys/ArcherSys",
"id": "f7368019ab44fc70ae4941f30d9528d63251d967",
"size": "... |
import logging
from collections import OrderedDict
from io import BytesIO
from django import forms
from django.contrib.staticfiles import finders
from django.core.files import File
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy as _
from pretix.base.ticketoutput import BaseTic... | {
"content_hash": "c1ab5e65e6ea25cb6bb7a91d5525136a",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 119,
"avg_line_length": 45.732919254658384,
"alnum_prop": 0.5370093711802254,
"repo_name": "awg24/pretix",
"id": "256c1784a22db4a1c03645661b5784ee5a283e0d",
"size": "7365"... |
"""
For handling the config file data.
"""
import json
import logging
import os
import yaml
from box import Box
from .util import deepmerge
log = logging.getLogger(__name__)
class Config(Box):
"""
A class to deal with our config file in a nice way.
"""
def __init__(self, *args, **kwargs):
... | {
"content_hash": "b2a469c8076960ed6fd674614ea5d4fa",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 73,
"avg_line_length": 23.421965317919074,
"alnum_prop": 0.5165350444225074,
"repo_name": "jwplayer/rssalertbot",
"id": "a64f1a7e7f6fbfbb85641e0bf409887386e25d00",
"size":... |
import asyncio
import mimetypes
import os
from . import hdrs
from .helpers import create_future
from .web_reqrep import StreamResponse
class FileSender:
""""A helper that can be used to send files.
"""
def __init__(self, *, resp_factory=StreamResponse, chunk_size=256*1024):
self._response_factor... | {
"content_hash": "823cbc77b737dad4bd3a098853f0a30d",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 76,
"avg_line_length": 31.321428571428573,
"alnum_prop": 0.572215887495249,
"repo_name": "jettify/aiohttp",
"id": "c2768deeb309c81790d4ac0e29370e9cbed2a393",
"size": "5262... |
from ..encoding import wif_to_secret_exponent
from ..convention import tx_fee
from .Spendable import Spendable
from .Tx import Tx
from .TxOut import TxOut, standard_tx_out_script
from .pay_to import build_hash160_lookup
from ..networks import wif_prefix_for_netcode
class SecretExponentMissing(Exception):
pass
c... | {
"content_hash": "efe58f937fce38c4fcf509dc198b1a4a",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 118,
"avg_line_length": 39.42307692307692,
"alnum_prop": 0.6726829268292683,
"repo_name": "shayanb/pycoin",
"id": "94e9a00a3142a2ce16dbce7e30c345b2c1e99aff",
"size": "8201... |
import pylab as pl
import numpy as np
import fourpeaks as fF
class ga:
def __init__(self,stringLength,fitnessFunction,nEpochs,populationSize=100,mutationProb=-1,crossover='un',nElite=4,tournament=True):
""" Constructor"""
self.stringLength = stringLength
# Population size should be even
if np.mod(populati... | {
"content_hash": "66dd0b43b4f42d69bf9e6e1a1e221441",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 132,
"avg_line_length": 34.32214765100671,
"alnum_prop": 0.7094251075479077,
"repo_name": "Anderson-Lab/anderson-lab.github.io",
"id": "4bfc51bb5fdf3feb57eee70c633d52e36a6a7... |
from .leaflet import (
Map,
Marker,
TileLayer, ImageOverlay,
Polyline, Polygon, Rectangle, Circle, CircleMarker,
GeoJSON,
LayerGroup, FeatureGroup,
DrawControl
)
from .notebook import initialize_notebook, get_static_path
| {
"content_hash": "84914bf5866026f8f7c87596396e891d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 58,
"avg_line_length": 21.166666666666668,
"alnum_prop": 0.7007874015748031,
"repo_name": "erdc-cm/leafletwidget",
"id": "8d1452d01df58689dfb76df7ff08cc48f4116931",
"size":... |
from airflow.exceptions import AirflowException
from airflow.providers.amazon.aws.hooks.aws_hook import AwsHook
from airflow.providers.amazon.aws.operators.sagemaker_base import SageMakerBaseOperator
from airflow.utils.decorators import apply_defaults
class SageMakerModelOperator(SageMakerBaseOperator):
"""
... | {
"content_hash": "67639c5fda05e7ccf1ab235dba4e038f",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 95,
"avg_line_length": 34.270833333333336,
"alnum_prop": 0.6370820668693009,
"repo_name": "spektom/incubator-airflow",
"id": "57b110042d3280aaac4cdfbc990d018c4d7b2cc3",
"si... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class ListGlobalOperations(Choreography):
def __init__(self, temboo_session):
"""
C... | {
"content_hash": "5cbae5488f22da5d80d9038a17e17eee",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 273,
"avg_line_length": 50.584158415841586,
"alnum_prop": 0.7020943433157174,
"repo_name": "jordanemedlock/psychtruths",
"id": "2d6ba1474c9f0623695ea8feb2a287157df45e71",
... |
import datetime as dt
import argparse
import psycopg2 as psy
import simplejson as json
import yaml
import re
# other database functions
import setup_db
# peyotl setup
from peyotl.api.phylesystem_api import PhylesystemAPI
from peyotl.manip import iter_trees
from peyotl import gen_otu_dict, iter_node
from peyotl.phyles... | {
"content_hash": "aa3f7334f390dced0ec6b9e43c844bce",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 85,
"avg_line_length": 36.65814696485623,
"alnum_prop": 0.5741676834582534,
"repo_name": "OpenTreeOfLife/ottreeindex",
"id": "3530b01dda1af9d5c8085bfc7b2133778bb99143",
"s... |
'''
Created on Apr 30, 2012
@author: h87966
'''
from final.user.user_datastore_appengine import UserAppengineDataStore
class UserDataStoreFactory():
'''
Factory for getting a UserDataStore implementation
'''
storage_implementations = {'appengine':UserAppengineDataStore()}
def __init__(self, ... | {
"content_hash": "4d6765bddfeeeb60bf0c73bd07067b4b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 70,
"avg_line_length": 23.5,
"alnum_prop": 0.6382978723404256,
"repo_name": "cdoremus/udacity-python_web_development-cs253",
"id": "869269151ba59e533b1dd46a2fb9b1c79105bf04",... |
import numpy as np
import pytest
import pandas as pd
import kfp.v2.dsl
@pytest.fixture(autouse=True)
def patch_kfp_component_decorator(monkeypatch):
"""
This fixture runs once after all tests are collected.
Args:
monkeypatch: Built-in pytest fixture used to patch the decorator `@component`
... | {
"content_hash": "6fa5938af3987fe4c88d501894b617fe",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 86,
"avg_line_length": 28.3,
"alnum_prop": 0.6279151943462897,
"repo_name": "GoogleCloudPlatform/vertex-pipelines-end-to-end-samples",
"id": "c10a2504aeaef4ea1a8b399902b14b5... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import shutil
from os.path import join, dirname
import pstats
import pytest
import six
from asv import benchmarks
from asv import config
from asv import environment
from asv import util
from . impo... | {
"content_hash": "630d8a0a31162cebaf9e53378a857f21",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 123,
"avg_line_length": 36.55605381165919,
"alnum_prop": 0.568081452404318,
"repo_name": "mdboom/asv",
"id": "5d98448db69acfdc1f45a31e47f3ded08b168e67",
"size": "8241",
... |
from .fakedb import List, Todo, list
from .app import App
from .model import Root
@App.json(model=Root)
def view_root(self, request):
return {"collection": request.link(list)}
@App.json(model=List)
def view_list(self, request):
return {"todos": [request.view(todo) for todo in self.get_all()]}
@App.json(mo... | {
"content_hash": "1e29f960d59838298d50494f36e142ba",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 88,
"avg_line_length": 24.266666666666666,
"alnum_prop": 0.6813186813186813,
"repo_name": "morepath/morepath_cerebral_todomvc",
"id": "f6c7bb1a379fe89ff58ce211e224cb0c3351cbe... |
intake = np.array([5260., 5470, 5640, 6180, 6390, 6515, 6805, 7515, \
7515, 8230, 8770])
# Does their energy intake deviate systematically from the recommended
# value of 7725 kJ?
# We have 10 degrees of freedom, so is the sample mean within 95% of the
# recommended value?
s = np.random.standard_t... | {
"content_hash": "d915e2b6a2df2e889475b0d003108917",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 72,
"avg_line_length": 31.64516129032258,
"alnum_prop": 0.7135575942915392,
"repo_name": "leesavide/pythonista-docs",
"id": "7b5b7a955667e5fd845d1fe38d7c3505f86e9f57",
"siz... |
"""Utilities for debugging garbage collection, leaked memory, etc."""
import gc
def get_objects_by_typename():
gc.collect()
x = {}
for obj in gc.get_objects():
t = type(obj).__name__
if t in x:
x[t].append(obj)
else:
x[t] = [obj]
return x
def get_object... | {
"content_hash": "322b9224901b9712b1e2519d246970e8",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 69,
"avg_line_length": 24.157894736842106,
"alnum_prop": 0.5762527233115469,
"repo_name": "celiafish/VisTrails",
"id": "172130c446b5b99392ef578271a1a22ff5835118",
"size": "... |
from builtins import object
class VarImpl(object):
"""Implement the Var function used within the DEPS file."""
def __init__(self, local_scope, custom_scope):
self._local_scope = local_scope
self._custom_scope = custom_scope
def Lookup(self, var_name):
"""Implements the Var syntax."""
if var_nam... | {
"content_hash": "c8070e9736df78643fa1ae9652bde57e",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 74,
"avg_line_length": 30.53191489361702,
"alnum_prop": 0.6390243902439025,
"repo_name": "ric2b/Vivaldi-browser",
"id": "b3c30afdbe2f249417981a31a59465dab6daee27",
"size": ... |
from oslo_utils import excutils
import six
from sahara import conductor as c
from sahara import context
from sahara.plugins import base as plugin_base
from sahara.service import api
from sahara.service.health import verification_base
from sahara.service import quotas
from sahara.utils import cluster as c_u
from sahara... | {
"content_hash": "34e0ec638c1d67fbde9ce2572afaad4d",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 75,
"avg_line_length": 33.642857142857146,
"alnum_prop": 0.6456121726822364,
"repo_name": "openstack/sahara",
"id": "6e6db0264e5c59483847c0e349c9e5dccc82c87b",
"size": "62... |
from gppylib.mainUtils import *
import os, sys, time, signal
from optparse import Option, OptionGroup, OptionParser, OptionValueError, SUPPRESS_USAGE
from gppylib.gpparseopts import OptParser, OptChecker
from gppylib import gplog
from gppylib.commands import base
from gppylib.commands import unix
from gppylib.comman... | {
"content_hash": "faed1f64b827215f5d0fb488417f1ea3",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 169,
"avg_line_length": 39.11794871794872,
"alnum_prop": 0.5697430519140011,
"repo_name": "foyzur/gpdb",
"id": "604a59788b4e97c4e950f2c5480f9942fc9d553f",
"size": "7830",
... |
'''
Video Gstplayer
===============
.. versionadded:: 1.8.0
Implementation of a VideoBase with Kivy :class:`~kivy.lib.gstplayer.GstPlayer`
This player is the prefered player, using Gstreamer 1.0, working on both Python
2 and 3.
'''
from kivy.lib.gstplayer import GstPlayer, get_gst_version
from kivy.graphics.texture ... | {
"content_hash": "21f25db818ba60e1e5f4a0f9836a8812",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 79,
"avg_line_length": 28.350746268656717,
"alnum_prop": 0.5991050276388523,
"repo_name": "andnovar/kivy",
"id": "8ecd008b35d698f3f5faa1a536543bb4222cc3d4",
"size": "3799"... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import os
import shutil
from .common import BASE_DIR
try:
from jinja2 import Environment
from jinja2 import FileSystemLoader
HAS_JINJA = True
except ImportError:
HAS_JINJA = False
if HAS_JINJA:
JINJA_ENV = Envi... | {
"content_hash": "0a4db7ee4c5d2a8087c6bd53e666ec1d",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 125,
"avg_line_length": 32.323699421965316,
"alnum_prop": 0.6623748211731044,
"repo_name": "F5Networks/f5-ansible-modules",
"id": "f6c4acdb7b86cc113f0c9aa5724021575927faa3",... |
"""Hello, Python 3!
Welcome to Python version 3, a very fun language
to use and learn!
Here we have a simple "Hello World!" program. All
you have to do is print, and you have output. Try
running it now, either by clicking *Run*, or
pressing *Shift-Enter*.
What happened? This tutorial contains a *Python 3
interpreter... | {
"content_hash": "7021d8f00d5531ff48260a28d1aa41c0",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 112,
"avg_line_length": 32.30612244897959,
"alnum_prop": 0.7359444093493367,
"repo_name": "shiblon/pytour",
"id": "2a79ca2ee7b1c23adc0095403b0f59a46cf635fe",
"size": "1596"... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plugins', '0037_auto_20200518_1959'),
]
operations = [
migrations.AlterField(
model_name='plugin',
name='max_gpu_limit',
field=models.IntegerField(blank=... | {
"content_hash": "727edec432a4eb281784152f80b7927f",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 72,
"avg_line_length": 22.875,
"alnum_prop": 0.5846994535519126,
"repo_name": "FNNDSC/ChRIS_ultron_backEnd",
"id": "07b77377c7c1d89a6b586b3a539f19bdfb9c1224",
"size": "416"... |
from bs4 import BeautifulSoup
import requests
import re
class Scrapper:
def __init__(self):
pass
def visible(self, element):
try:
if element.parent.name in ['style', 'script', '[document]', 'head', 'title', 'div', 'input']:
return False
elif re.match('<... | {
"content_hash": "a37eeef4317b92b4332b545c3ec668fb",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 105,
"avg_line_length": 28.285714285714285,
"alnum_prop": 0.4805194805194805,
"repo_name": "Saket-Komawar/Forex",
"id": "11efecbf8293c951399b2a71cc235901c81429aa",
"size": ... |
"""
Django settings for radioslackservice project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# ... | {
"content_hash": "a01783f3cc7c1fab17b8bf87f66d70db",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 71,
"avg_line_length": 25.893805309734514,
"alnum_prop": 0.6913875598086124,
"repo_name": "schatten/radioslack",
"id": "5fb8e2343725666ae4cf3ee2a2696bad2cb8c2e9",
"size": ... |
"""
Get a user by id
"""
# import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API
pytan_loc = "~/gh/p... | {
"content_hash": "de9204b94bfd49307c1f3e74d296a031",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 198,
"avg_line_length": 32.75409836065574,
"alnum_prop": 0.6936936936936937,
"repo_name": "tanium/pytan",
"id": "c238acba5f043682e00ab89ab8cb78cb9c073623",
"size": "4018",... |
"""
fnordstalk.py
Copyright 2012 Stephen Holiday
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... | {
"content_hash": "3ac23b988137cbe66da5c0ff05348be2",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 83,
"avg_line_length": 30.46551724137931,
"alnum_prop": 0.5274476513865308,
"repo_name": "sholiday/fnordstalk",
"id": "5fafbec111507cfe400fd90848f02ff6cd2a279a",
"size": "... |
from common import connector
from common import urlutil
from common import environment
from common import xmlutil
from services.locations.domain.common.country_subdivisions import countrysubdivision
from services.locations.domain.common.country_subdivisions import countrysubdivisions
import xml.etree.ElementTree as ET
... | {
"content_hash": "47298dc6eb7d7e0a7190ec1ac128e978",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 96,
"avg_line_length": 47.707317073170735,
"alnum_prop": 0.7229038854805726,
"repo_name": "M4gn4tor/mastercard-api-python",
"id": "2f261e0ab98be015e84a27b53e3f3a924133314c",
... |
# coding: utf-8
import os
import datetime
from babel.dates import format_datetime
from babel.core import Locale, UnknownLocaleError
from bottle import default_app, route, view, static_file, TEMPLATE_PATH, request, BaseTemplate, debug, hook
from peewee import IntegrityError, DoesNotExist, fn
from bottle_utils.i18n i... | {
"content_hash": "4914f07ceb2ce542b5b2c1abcef6ccb8",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 128,
"avg_line_length": 32.09049773755656,
"alnum_prop": 0.6400169204737732,
"repo_name": "christophmeissner/lagesonum",
"id": "01f36ac245374648be8fb048a418a84949d2994f",
... |
from django.conf.urls import patterns, include, url
from captcha_api.views import CaptchaAPIView, CaptchaAPIJSONPView
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
url(r'^captcha_api/verify$', CaptchaAPIView.as_view()),
... | {
"content_hash": "362485b43e0fee316ae8b38c78f9aea1",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 70,
"avg_line_length": 26.266666666666666,
"alnum_prop": 0.7461928934010152,
"repo_name": "quekshuy/shopify-easy-captcha",
"id": "58fcf8282d6c69585fcb407ae72c535923e6d9f3",
... |
from django.contrib.gis.db.models.fields import ExtentField
from django.db.models.aggregates import Aggregate
__all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union']
class GeoAggregate(Aggregate):
function = None
is_extent = False
def as_sql(self, compiler, connection):
# this will be c... | {
"content_hash": "528441754242cef0f795722c98702b92",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 108,
"avg_line_length": 33.753846153846155,
"alnum_prop": 0.6649954421148587,
"repo_name": "intgr/django",
"id": "95dce944c5afaee04eca1288d3b0718baffa9fe1",
"size": "2194",... |
import logging
import os
import pandas as pd
from .sampleRetraction import sampleRetraction
logger = logging.getLogger(__name__)
class patientRetraction(sampleRetraction):
_fileType = "patientRetraction" | {
"content_hash": "171538677eff9f9096249714669fafa4",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 46,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.7924528301886793,
"repo_name": "thomasyu888/Genie",
"id": "5d16849a364ca2136c0d49572c2e4b8c92480325",
"size": "21... |
import nltk
from nltk.corpus import cess_esp
from nltk import UnigramTagger as ut
from pickle import dump
def main():
# Read the corpus into a list,
# each entry in the list is one sentence.
cess_sents = cess_esp.tagged_sents()
# Train the unigram tagger
uni_tag = ut(cess_sents)
out... | {
"content_hash": "78451e9e2bf8b5f432d8cf5d825e930d",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 45,
"avg_line_length": 22,
"alnum_prop": 0.6272727272727273,
"repo_name": "juditacs/dsl",
"id": "ef596d7acde93173d2e67901d83ce843e73b737d",
"size": "440",
"binary": false... |
from unittest import TestCase, mock
from collections import namedtuple
from data_vault import VaultEnvironment, get_synced_params, get_connected_params
from helper import KeeperApiHelper
from keepercommander import api, generator
vault_env = VaultEnvironment()
PasswordStrength = namedtuple('PasswordStrength', 'lengt... | {
"content_hash": "05b835242823cda49e1cbd67772dd4a6",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 102,
"avg_line_length": 35.928,
"alnum_prop": 0.6261411712313516,
"repo_name": "Keeper-Security/Commander",
"id": "9bc47a179a7578371a4ff293a59eacf8d7fae63b",
"size": "4491... |
from . import test_hr_attendance_constraints
from . import test_hr_attendance_process
from . import test_kiosk_tour
| {
"content_hash": "6d897edcb0d85f063e5e26da95739fe7",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 44,
"avg_line_length": 38.666666666666664,
"alnum_prop": 0.8017241379310345,
"repo_name": "it-projects-llc/misc-addons",
"id": "fb3ee35974d73df98839aef16633f8108816b36e",
"s... |
import binascii
import hmac
import os
import random
import string
__all__ = ['constant_time_compare', 'random_bytes', 'random_string']
random = random.SystemRandom()
ASCII_ALPHANUMERIC = string.ascii_letters + string.digits
BASE64_ALPHABET = ASCII_ALPHANUMERIC + '-_'
HEX = string.digits + 'abcdef'
def random_by... | {
"content_hash": "5bbd7ac6d1edad6160180464d2a68772",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 75,
"avg_line_length": 25.587628865979383,
"alnum_prop": 0.6192586623690572,
"repo_name": "TangledWeb/tangled",
"id": "a4a1fa544cc9a4dad47c62ae93edc1116f79ed2e",
"size": "2... |
"""Tests for contrib.seq2seq.python.seq2seq.basic_decoder."""
# pylint: disable=unused-import,g-bad-import-order
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: enable=unused-import
import numpy as np
from tensorflow.contrib.seq2seq.python.ops imp... | {
"content_hash": "84bea6c95ee530ef4a3af114fbd28cca",
"timestamp": "",
"source": "github",
"line_count": 656,
"max_line_length": 80,
"avg_line_length": 43.519817073170735,
"alnum_prop": 0.6371151353812743,
"repo_name": "brchiu/tensorflow",
"id": "b7f9f3fb090356a1c8d2bfb5044712ff93e267ce",
"size": "2... |
import _plotly_utils.basevalidators
class TickformatValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="tickformat", parent_name="surface.colorbar", **kwargs
):
super(TickformatValidator, self).__init__(
plotly_name=plotly_name,
par... | {
"content_hash": "a8a0cac2dd6b8738fd8afebf96c4b3b7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 80,
"avg_line_length": 33,
"alnum_prop": 0.6153846153846154,
"repo_name": "plotly/plotly.py",
"id": "0f2bce4c26468ef3b3ba9a42284061cbe1493077",
"size": "429",
"binary": f... |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename('chart_combined04.xlsx')
self.ignore... | {
"content_hash": "4f6e099083a302f0c7c172438984dbd2",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 75,
"avg_line_length": 27.170212765957448,
"alnum_prop": 0.5379796397807362,
"repo_name": "jmcnamara/XlsxWriter",
"id": "a22a3dfc448df1d118afde60c045b2c05f477859",
"size": ... |
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
map_error,
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import... | {
"content_hash": "5f5f0f266130861ed97b295c73b99e4c",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 121,
"avg_line_length": 45.03785488958991,
"alnum_prop": 0.6628143167332072,
"repo_name": "Azure/azure-sdk-for-python",
"id": "92259a98793d7caa8f24419d42cb3d63cf75b7f7",
"... |
import os
from django.shortcuts import render, redirect, get_object_or_404
from django.utils.translation import ugettext as _
from django.views.decorators.vary import vary_on_headers
from django.core.urlresolvers import reverse, NoReverseMatch
from django.http import HttpResponse, JsonResponse
from wagtail.utils.pagi... | {
"content_hash": "9d340180e7108a6444601dbc35b3f4a7",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 105,
"avg_line_length": 35.06923076923077,
"alnum_prop": 0.642904145645975,
"repo_name": "JoshBarr/wagtail",
"id": "62a462a878d71af262a82d9f980c5fd02ae00488",
"size": "911... |
import logging
from collections import defaultdict
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template import defaultfilters as filters
from django.utils.http import urlencode
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from horizon... | {
"content_hash": "d82f7b2193aaf3045378149f18237f00",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 75,
"avg_line_length": 33.25414364640884,
"alnum_prop": 0.6050839009802292,
"repo_name": "Horace1117/MKTCloud",
"id": "36bd67ebe171692d5448c511c27d47bb487c4821",
"size": "... |
from phi import utils
from tensorbuilder import TensorBuilder
@TensorBuilder.RegisterMethod("tb")
def rnn_placeholders_from_state(self, zero_state, name="rnn_state"):
if isinstance(zero_state, tuple):
return tuple([self.rnn_placeholders_from_state(substate, name=name) for substate in zero_state])
else... | {
"content_hash": "153b57832b73ed6caa218e0c35b281a4",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 104,
"avg_line_length": 41.357142857142854,
"alnum_prop": 0.7495682210708118,
"repo_name": "cgarciae/tensorbuilder",
"id": "ef343f40eda779a07b3aa8bab7e1247ed5a42a25",
"size... |
import pytest
import sncosmo
"""Test all of the builtins code.
This file is designed to test that all of the code that loads builtins works,
and only tests a single example for each kind of builtin. A separate file
(test_download_builtins.py) actually makes sure that all of the builtins can be
downloaded and loaded,... | {
"content_hash": "10f92e356a794a84c208fa6e46a5d066",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 79,
"avg_line_length": 21.818181818181817,
"alnum_prop": 0.7424242424242424,
"repo_name": "sncosmo/sncosmo",
"id": "a2b59cc361ec06cd27dcf0d0b36da37f3a2ef53c",
"size": "264... |
import unittest
from td_query.td_query_base import td_query_instance as instance
from tools.settings import *
class TestExample(unittest.TestCase):
@classmethod
def setUpClass(cls):
print("**************************************** setUpClass ****************************************")
@classmethod... | {
"content_hash": "5343c492b3342a8504e8ccd52312765a",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 109,
"avg_line_length": 27.037037037037038,
"alnum_prop": 0.4684931506849315,
"repo_name": "Ernestyj/PyStudy",
"id": "77b0f34f2567e578ecac69149a4c4382177bcfa8",
"size": "75... |
__version__ = "PyExpression v1.0.2"
__author__ = "Daniel Sage"
# TODO: Add exponents
# TODO: Create basic equation solver w/ this class
class Part:
# Part class, basically part of an expression
# Example:
# Part(1, 2, "+") would mean the part of an expression like this:
# 1 + 2
# You CAN nest p... | {
"content_hash": "459d7ce3ebf18b7f372c9f3c0b688169",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 150,
"avg_line_length": 28.251184834123222,
"alnum_prop": 0.4742492870323771,
"repo_name": "sagedanielr/PyExpression",
"id": "748e62964e1b675d03d26699106958185f29f5db",
"s... |
import sys
from .api import PrettyDir
__author__ = 'laike9m <laike9m@gmail.com>'
sys.modules[__name__] = PrettyDir # type: ignore
| {
"content_hash": "d1240c3b83bd3f92d913cbb08b415bc5",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 49,
"avg_line_length": 22.166666666666668,
"alnum_prop": 0.6917293233082706,
"repo_name": "laike9m/pdir2",
"id": "8e8185621156de62a3a820c575c73d14e7c6dbf9",
"size": "133",
... |
from celery.task import task
import datetime
import time
import md5
import csv
import os
import logging
from django.conf import settings
from django_bulk_export.models import *
from django.utils.encoding import smart_str
from django_bulk_export.constants import *
@task
def execute(task_name, params, url,cache_func,use... | {
"content_hash": "5f8eca5e01525ea5826fcb4095538fed",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 113,
"avg_line_length": 34.5,
"alnum_prop": 0.64563796533106,
"repo_name": "Thinktiv/django-bulk-export",
"id": "bec9407a4fc1f206ff6180dbb54f1bd75ec123f2",
"size": "3545",... |
from __future__ import print_function, unicode_literals, absolute_import
from agstools._helpers import create_argument_groups, execute_args, format_output_path
from ._helpers import open_map_document
def create_parser_save_copy(parser):
parser_copy = parser.add_parser("copy", add_help = False,
help = "Sav... | {
"content_hash": "4c786813371faa59b9d9bda049e88a36",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 117,
"avg_line_length": 38.611111111111114,
"alnum_prop": 0.658273381294964,
"repo_name": "DavidWhittingham/agstools",
"id": "d7bf7948908c5859cb52ef18a94158708a120c65",
"si... |
'''
Created on Oct 20, 2015
@author: ahmadjaved.se@gmail.com
'''
from math import ceil
from sqlalchemy import func
from .exceptions import PageNotAnInteger, EmptyPage
class Paginator(object):
"""
This class helps you to manage data with pagination. This class will fetch
data in pages. That is, instead o... | {
"content_hash": "c734059beba9bab326fefe59f1aaa34e",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 99,
"avg_line_length": 39.6425855513308,
"alnum_prop": 0.5857471705352004,
"repo_name": "prikevs/pagination-sqlalchemy",
"id": "6a20c468d02715a30a673507c2ae82bd9575d2b8",
... |
from __future__ import absolute_import
from __future__ import unicode_literals
import collections
Metric = collections.namedtuple('Metric', ['name', 'value'])
| {
"content_hash": "79ebf829e9a98b7fb736f8f820a8c9d7",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 60,
"avg_line_length": 23.142857142857142,
"alnum_prop": 0.7407407407407407,
"repo_name": "ucarion/git-code-debt",
"id": "2ea0ac4f6c9215bd554d3606c122d598711b5390",
"size": ... |
import proto # type: ignore
from google.ads.googleads.v12.enums.types import conversion_action_category
from google.ads.googleads.v12.enums.types import (
conversion_value_rule_set_status,
)
from google.ads.googleads.v12.enums.types import value_rule_set_attachment_type
from google.ads.googleads.v12.enums.types i... | {
"content_hash": "2bbd437058f5cc11d11bd61b32aa3382",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 140,
"avg_line_length": 44.2967032967033,
"alnum_prop": 0.6871743984123047,
"repo_name": "googleads/google-ads-python",
"id": "2c0b0894bef6592f4af9a29a43e84b5c8c32dd4e",
"s... |
import CommonModule
import TimestampModule
import SnapshotModule
import TargetsModule
def Bundle(num_of_ecus=1):
'''Director signs fresh top-level timestamp, snapshot, and targets metadata.'''
# The top-level targets role signs a target, together with custom metadata,
# for each ECU.
# This role uses one sign... | {
"content_hash": "4770b5e5a6a55ee4c5fcfca10055d748",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 81,
"avg_line_length": 36.3,
"alnum_prop": 0.6262626262626263,
"repo_name": "trishankkarthik/sizeof-uptane",
"id": "eda2137275022de11d2ac131c143a334d487e44a",
"size": "1134... |
import os
import configobj
config = configobj.ConfigObj() # for interpreters
for f in [os.environ.get("MACHETE_CONFIG", ""), "machete.cfg", "/etc/machete.cfg"]:
if os.path.isfile(f):
config = configobj.ConfigObj(f)
break
else:
raise Exception("Config file not found")
| {
"content_hash": "9638725507f61458ff2f941bdcdab97e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 83,
"avg_line_length": 22.76923076923077,
"alnum_prop": 0.6655405405405406,
"repo_name": "rustyrazorblade/machete",
"id": "f58392c5b7de58dfaf6ae36d78d9a7d34f2e075d",
"size"... |
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service_builder', '0004_auto_20180402_1354'),
]
operations = [
migrations.AlterField(
model_... | {
"content_hash": "35f6fe980865f5c0496a4b880ce3f71d",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 77,
"avg_line_length": 28.333333333333332,
"alnum_prop": 0.5656108597285068,
"repo_name": "dipapaspyros/bdo_platform",
"id": "c268d548007ff62ff8165f3c63e754a2ce17fc63",
"si... |
import netaddr
import six
from tempest_lib.common.utils import data_utils
from neutron.tests.api import base_routers as base
from neutron.tests.api import clients
from neutron.tests.tempest import config
from neutron.tests.tempest import test
CONF = config.CONF
class RoutersTest(base.BaseRouterTest):
@classmet... | {
"content_hash": "70ecd60dfaeb40a6ca44ec351a5c35c2",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 79,
"avg_line_length": 47.48854961832061,
"alnum_prop": 0.6044044365857579,
"repo_name": "apporc/neutron",
"id": "064157e47cd880296b12f1ded6654aead61d72ed",
"size": "19299... |
from simple_rl.abstraction.AbstractionWrapperClass import AbstractionWrapper
from simple_rl.abstraction.AbstractValueIterationClass import AbstractValueIteration
from simple_rl.abstraction.state_abs.StateAbstractionClass import StateAbstraction
from simple_rl.abstraction.state_abs.ProbStateAbstractionClass import ProbS... | {
"content_hash": "dd73f7e94e504b7e0599e8de1bfc5ce3",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 90,
"avg_line_length": 64.3,
"alnum_prop": 0.8779160186625194,
"repo_name": "david-abel/simple_rl",
"id": "8d8468d3133caf523ff1fa602bcf91f86657194f",
"size": "1297",
"bin... |
import os
import shutil
from nose.tools import (assert_equal, assert_true)
from qipipe.interfaces.copy import Copy
from ... import ROOT
from ...helpers.logging import logger
FIXTURE = os.path.join(ROOT, 'fixtures', 'interfaces', 'copy')
"""The test fixture file."""
SOURCE = os.path.join(FIXTURE, 'small.txt')
"""The t... | {
"content_hash": "79fdcb337c4a44c13a4970c02d873dac",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 78,
"avg_line_length": 32.98684210526316,
"alnum_prop": 0.5827682489030714,
"repo_name": "ohsu-qin/qipipe",
"id": "c9bfdb1eb6dde99a6219d4636ae666c1be7ed8f2",
"size": "2507"... |
"""
logbook.base
~~~~~~~~~~~~
Base implementation for logbook.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import thread
import threading
import traceback
from itertools import chain
from weakref import ref as weakref
... | {
"content_hash": "15ed3e0e01ee28c96564d3e5ba6ea4c8",
"timestamp": "",
"source": "github",
"line_count": 898,
"max_line_length": 79,
"avg_line_length": 36.0456570155902,
"alnum_prop": 0.6108931384967098,
"repo_name": "zacharyvoase/logbook",
"id": "241940ec1773e8a9728c82093e9ecfb4d9ef85ab",
"size": "... |
"""
Component to interface with various media players.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/media_player/
"""
import hashlib
import logging
import os
import requests
import voluptuous as vol
from homeassistant.config import load_yaml_config_... | {
"content_hash": "1a71ccf40c7ce6a92147488add5f94ea",
"timestamp": "",
"source": "github",
"line_count": 710,
"max_line_length": 79,
"avg_line_length": 30.738028169014086,
"alnum_prop": 0.6441532258064516,
"repo_name": "Smart-Torvy/torvy-home-assistant",
"id": "a3a6274a89eac932d40938677b056b102ae2b445... |
from Child import Child
from Node import Node # noqa: I201
TYPE_NODES = [
# simple-type-identifier -> identifier generic-argument-clause?
Node('SimpleTypeIdentifier', kind='Type',
children=[
Child('Name', kind='Token',
token_choices=[
'Identifier... | {
"content_hash": "2002e9eec80933204100cbcde43da920",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 76,
"avg_line_length": 37.004926108374384,
"alnum_prop": 0.5090521831735889,
"repo_name": "huonw/swift",
"id": "45ffb4149f77b2f69d5a3f69bab4f4440889f8ad",
"size": "7512",
... |
from plugins.contracts import ICartridgeAgentPlugin
import os
import subprocess
from modules.util.log import LogFactory
class ExtensionExecutor(ICartridgeAgentPlugin):
def run_plugin(self, values):
log = LogFactory().get_log(__name__)
event_name = values["EVENT"]
log.debug("Running extens... | {
"content_hash": "af18ca5366a565ba35536a9fe07ea16e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 107,
"avg_line_length": 39.146341463414636,
"alnum_prop": 0.6286604361370717,
"repo_name": "lasinducharith/stratos",
"id": "fbd315bc7c0906825cc61cf50fd796af29cf13f7",
"size... |
import os
from flask import Blueprint
from flask import json, url_for, current_app
from flask import g, request, abort, send_file
from flask.ext.login import current_user, login_required
from ..utils import as_resource, as_collection
from ..errors import InvalidFieldError, AuthorizationError
from ..services import pa... | {
"content_hash": "5ea8445eddd2affb9bb26a5923e71ef0",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 86,
"avg_line_length": 30.18,
"alnum_prop": 0.6805831676607025,
"repo_name": "mcflugen/wmt-rest",
"id": "24b6b05f4d019ad7cdd97501436b311afd8a1c52",
"size": "1509",
"binar... |
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter as ADHF
from sys import stderr, stdout, exit
import logging
import csv
import re
PAT_CHR = re.compile('^(?:.*;)?chromosome=([^;]+)(?:;.*)?$', re.I)
PAT_NAME = re.compile('^(?:.*;)?Name=([^;]+)(?:;.*)?$', re.I)
LOG = logging.getLogger(__name__)
LOG.se... | {
"content_hash": "018c5ed517bc43a4b30f97c1c5a32204",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 82,
"avg_line_length": 28.730434782608697,
"alnum_prop": 0.5493341404358354,
"repo_name": "danydoerr/GraphTeams",
"id": "94753604a1d76902d90e8d0c93c414f9ad80a80f",
"size":... |
"""Module for common statistic tests metadata providers."""
from abc import ABC, abstractmethod
from typing import Dict
from .criteria import CriteriaFactory
from .function import FunctionFactory
from .types import MeasurementDef, StatisticDef
from .baseline import Provider as BaselineProvider
# pylint: disable=R09... | {
"content_hash": "fa51a174030b97fecd2069759ab8a983",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 80,
"avg_line_length": 35.98203592814371,
"alnum_prop": 0.4504909302712598,
"repo_name": "firecracker-microvm/firecracker",
"id": "fcd37f86bee30f6a60aaeee2fcb290744d6208cb",... |
import os
import time
import requests
import re
import json
import io
import subprocess
import base64
import audioread
from flask import Flask, request
from google.cloud import storage
from google.cloud.storage.blob import Blob
from google.cloud import speech
from google.cloud import pubsub_v1
app = Flask(__name__)
#... | {
"content_hash": "7f0a868a6930867d31a684b2f8815256",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 147,
"avg_line_length": 40.814332247557005,
"alnum_prop": 0.5660814046288907,
"repo_name": "googleforgames/clean-chat",
"id": "749b5befffad4f8f3dcc747f5c7fd09c68150699",
"... |
from __future__ import absolute_import, unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from django.contrib.auth.models import User
#from .models import Us... | {
"content_hash": "41c28a2341656c8ef266d56bad5bde9d",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 78,
"avg_line_length": 28.151515151515152,
"alnum_prop": 0.7373519913885899,
"repo_name": "LABETE/TestYourProject",
"id": "0167a5412004c184f32abde4f57e601a92a873de",
"size"... |
import pygame, sys, time
from pygame.locals import *
import random
import math
#constants
#player and ball sizes are radius
PLAYER_SIZE=22
BALL_SIZE=10
FIELD_LENGTH=1000
FIELD_WIDTH=500
GOAL_SIZE=280
#Classes
#ball has velocity and position
class ball():
def __init__(self, pos=None):
se... | {
"content_hash": "66745f4ed1d46879d9f00294331e96c8",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 529,
"avg_line_length": 36.48,
"alnum_prop": 0.5775767543859649,
"repo_name": "akshitharamachandran/soccergame",
"id": "128898266fb3ac83388fc1894f8ae31c77a29907",
"size": ... |
import logging
import requests
from osf.metrics import PreprintSummaryReport
from website import settings
from ._base import DailyReporter
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
LOG_THRESHOLD = 11
def get_elastic_query(date, provider):
return {
'query': {
... | {
"content_hash": "01c6e9606ba15952cbeef3497bfc1ee4",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 121,
"avg_line_length": 30.391304347826086,
"alnum_prop": 0.4444444444444444,
"repo_name": "CenterForOpenScience/osf.io",
"id": "319f72ae319e7d49719be88aaed560b57e850909",
... |
import re
import json
from urlparse import urlparse
from scrapy.selector import Selector
try:
from scrapy.spider import Spider
except:
from scrapy.spider import BaseSpider as Spider
from scrapy.utils.response import get_base_url
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextr... | {
"content_hash": "54f7c8802bfa258a6b2a123170bb713b",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 83,
"avg_line_length": 34.369127516778526,
"alnum_prop": 0.5127904706112087,
"repo_name": "geekan/google-scholar-crawler",
"id": "c9c2c1fe143c5d87c459210fb1d644bbe96d8928",
... |
from msrest.serialization import Model
class InnerError(Model):
"""Inner error details.
:param exceptiontype: The exception type.
:type exceptiontype: str
:param errordetail: The internal error message or exception dump.
:type errordetail: str
"""
_attribute_map = {
'exceptiontyp... | {
"content_hash": "cbd480af604a43f16559fee64e605c44",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 69,
"avg_line_length": 28.9,
"alnum_prop": 0.6505190311418685,
"repo_name": "v-iam/azure-sdk-for-python",
"id": "48d4db17e2a252fcde48809d2e8870b1a5226367",
"size": "1052",
... |
from __future__ import absolute_import
from celery import task
from celery import Celery
from celery import app
import pymongo
import json
from bson import json_util,ObjectId
from pymongo import MongoClient
# from pymongo import find_many
from bson.dbref import DBRef
from pymongo.mongo_replica_set_client import MongoRe... | {
"content_hash": "f92f23634d5b8d399f7ac28531835922",
"timestamp": "",
"source": "github",
"line_count": 1135,
"max_line_length": 193,
"avg_line_length": 35.459030837004406,
"alnum_prop": 0.5814242409183521,
"repo_name": "karlfloersch/socs",
"id": "2f361521811e263721644eaf65571d3d49994282",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.