text stringlengths 4 1.02M | meta dict |
|---|---|
from enum import Enum, auto
class HTTPMethod(str, Enum):
def _generate_next_value_(name, start, count, last_values):
return name.upper()
def __eq__(self, value: object) -> bool:
value = str(value).upper()
return super().__eq__(value)
def __hash__(self) -> int:
return hash... | {
"content_hash": "1339e7876a6ef89467464353aef267fc",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 63,
"avg_line_length": 22.571428571428573,
"alnum_prop": 0.5806962025316456,
"repo_name": "channelcat/sanic",
"id": "80f1d2a9bf2319c73e0c05d8acdca1abc777f4e3",
"size": "632... |
"""Utilities for NetApp drivers."""
import collections
import decimal
import platform
import re
from oslo_concurrency import processutils as putils
from oslo_log import log
import six
from manila import exception
from manila.i18n import _
from manila import version
LOG = log.getLogger(__name__)
VALID_TRACE_FLAGS ... | {
"content_hash": "c57d74640ca9a346729e5ad908e8ff8f",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 76,
"avg_line_length": 32.755656108597286,
"alnum_prop": 0.5750794308606161,
"repo_name": "bswartz/manila",
"id": "3240593a0550131a8bd913c8b763e1c51ec72aa1",
"size": "7984... |
from __future__ import print_function
import inspect
import pprint
import sys
import types
def displayDict(d, remove_keys=()):
if "__loader__" in d:
d = dict(d)
d["__loader__"] = "<__loader__ removed>"
if "__file__" in d:
d = dict(d)
d["__file__"] = "<__file__ removed>"
... | {
"content_hash": "9ebe4e9f14686ff3644e4e7ee04e22eb",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 85,
"avg_line_length": 25.580882352941178,
"alnum_prop": 0.6990514515665421,
"repo_name": "kayhayen/Nuitka",
"id": "57f12e98f7ddaa92d51e00609f4fac4e9cee2c0f",
"size": "424... |
from django.conf.urls import patterns
from rbxmppnotification.extension import RBXmppNotification
from rbxmppnotification.forms import RBXmppNotificationSettingsForm
urlpatterns = patterns('',
(r'^$', 'reviewboard.extensions.views.configure_extension',
{'ext_class': RBXmppNotification,
'form_class': RB... | {
"content_hash": "a4372f363e3b5279aee9d3111261b7bb",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 67,
"avg_line_length": 32.72727272727273,
"alnum_prop": 0.775,
"repo_name": "iconoeugen/rb-xmpp-notification",
"id": "bc40cbdcf5235f6608aff802199bc1d32c901cc0",
"size": "14... |
from datetime import date
from datetime import datetime
from juriscraper.OpinionSite import OpinionSite
from lxml import html
class Site(OpinionSite):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.court_id = self.__module__
today = date.today()
... | {
"content_hash": "1b53bb161d0137ea049bfe90f2a24783",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 92,
"avg_line_length": 38.12328767123287,
"alnum_prop": 0.5422206252245778,
"repo_name": "Andr3iC/juriscraper",
"id": "7e68d2151f1b4ff66783eb8434343bdd86f6700f",
"size": "2... |
""" These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | {
"content_hash": "e989ce86da2246a435c9ca7def524ceb",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 76,
"avg_line_length": 34.89473684210526,
"alnum_prop": 0.5867269984917044,
"repo_name": "mdmintz/SeleniumBase",
"id": "976118b3fcca7b603fb11ecc09dfeed2824630ca",
"size": "... |
from . import Framework
class Commit(Framework.TestCase):
def setUp(self):
Framework.TestCase.setUp(self)
self.commit = self.g.get_user().get_repo("PyGithub").get_commit("1292bf0e22c796e91cc3d6e24b544aece8c21f2a")
self.commit.author.login # to force lazy completion
def testAttributes... | {
"content_hash": "6f7a8e5f7f4587e08ac6a5b48196280d",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 175,
"avg_line_length": 60.955882352941174,
"alnum_prop": 0.7326899879372738,
"repo_name": "iModels/ffci",
"id": "99390a0993400f1b6da0a847124b70bccab52563",
"size": "5953",... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import re
import time
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from datetime import datetime
from airflow.ex... | {
"content_hash": "26cc898e35674dca77b5ce569b1eff84",
"timestamp": "",
"source": "github",
"line_count": 598,
"max_line_length": 90,
"avg_line_length": 34.94983277591973,
"alnum_prop": 0.5678947368421052,
"repo_name": "vineet-rh/incubator-airflow",
"id": "fc4ca1baf1a1627e8c0e1ccdcb60bd030bfaf4cb",
"... |
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.urls import reverse
from extras.choices import *
from utilities.querysets import RestrictedQuerySet
class Ob... | {
"content_hash": "955b1839fda38cb8ad088b2f701df240",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 116,
"avg_line_length": 28.757009345794394,
"alnum_prop": 0.6301592460188495,
"repo_name": "digitalocean/netbox",
"id": "2c91d97a4150dd44369ccef2d2bf6de77b21e6fd",
"size":... |
"""
test having entities using a custom base class
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import six
from elixir import *
import elixir
def setup():
metadata.bind = 'sqlite://'
global MyBase
... | {
"content_hash": "9c3b082f08a1dec7974fc9b1092d2770",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 79,
"avg_line_length": 24.808888888888887,
"alnum_prop": 0.5684342529559298,
"repo_name": "Didacti/elixir",
"id": "3aa51ac8b8b877dceaf34b3f9389a24e580c8147",
"size": "5582... |
import unittest
from test import test_support
import Queue
from evy.patched import socket, thread, threading
HOST = test_support.HOST
MSG = b'Michael Gilfix was here\n'
class SocketUDPTest(unittest.TestCase):
def setUp (self):
self.serv = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sel... | {
"content_hash": "a8493360ff7525446ec1eb3ad9d0466b",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 74,
"avg_line_length": 29.609137055837564,
"alnum_prop": 0.621806960397737,
"repo_name": "inercia/evy",
"id": "5853d946f42ab2fd41d3bb70340012162fb9209f",
"size": "7218",
... |
import io
import os
import setuptools
# Package metadata.
name = 'google-cloud-bigtable'
description = 'Google Cloud Bigtable API client library'
version = '1.1.0'
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_statu... | {
"content_hash": "9ee14a246f03773453d236112bf806b5",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 75,
"avg_line_length": 29.285714285714285,
"alnum_prop": 0.6541019955654102,
"repo_name": "tseaver/google-cloud-python",
"id": "82c3aa499dcdaa2f47965e1ebf12db6f10cd225c",
"... |
from __future__ import absolute_import
import atexit
import logging
import os
import os.path
import socket
import subprocess
import time
import uuid
import py
from kafka.vendor.six.moves import urllib, range
from kafka.vendor.six.moves.urllib.parse import urlparse # pylint: disable=E0611,F0401
from kafka import err... | {
"content_hash": "ae947f6e6060a0d28b0bb79cf490d64e",
"timestamp": "",
"source": "github",
"line_count": 673,
"max_line_length": 118,
"avg_line_length": 40.23179791976226,
"alnum_prop": 0.563044762889644,
"repo_name": "ohmu/kafka-python",
"id": "26fb5e89d669cba967b383ad58b981ff35298f15",
"size": "27... |
"""Unit tests for the transform.environments classes."""
# pytype: skip-file
from __future__ import absolute_import
import logging
import sys
import unittest
from apache_beam.options.pipeline_options import PortableOptions
from apache_beam.portability import common_urns
from apache_beam.runners import pipeline_cont... | {
"content_hash": "6d59acc8abb9ab30c1cc2f0f9fc6ba14",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 77,
"avg_line_length": 42.84285714285714,
"alnum_prop": 0.6652217405801933,
"repo_name": "iemejia/incubator-beam",
"id": "6259d7125bf24b3007018e6eea9d7425cfd38394",
"size":... |
''' The data in world_cities.csv was taken from GeoNames ``cities5000.zip``
downloaded from
.. code-block:: none
http://www.geonames.org/export/
on Tuesday September 15, 2015.
Under ``CC-BY`` license (creative commons attributions license).
'''
#----------------------------------------------------------------... | {
"content_hash": "bddc515cd0cd546379ac867a666d75fd",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 82,
"avg_line_length": 31.406779661016948,
"alnum_prop": 0.2887209929843497,
"repo_name": "rs2/bokeh",
"id": "9d2896f8856ab8c9b3ff5bde696f9696bc0988ef",
"size": "2200",
"... |
import utils_tests
import trappy
class TestSystrace(utils_tests.SetupDirectory):
def __init__(self, *args, **kwargs):
super(TestSystrace, self).__init__(
[("trace_systrace.html", "trace.html")],
*args,
**kwargs)
def test_systrace_html(self):
"""Tests pa... | {
"content_hash": "a88df3163ad1c5522f88847aac084700",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 94,
"avg_line_length": 38.111111111111114,
"alnum_prop": 0.6483236151603499,
"repo_name": "sinkap/trappy",
"id": "c49800211fe46e954e43abad86c9dc9e2f604597",
"size": "3325",... |
import logging
from concurrent.futures import Future
import warnings
from gremlin_python.driver import client, serializer
from gremlin_python.driver.remote_connection import (
RemoteConnection, RemoteTraversal)
from gremlin_python.process.strategies import OptionsStrategy
from gremlin_python.process.traversal impo... | {
"content_hash": "f4649ca42a75c29e9ca4f1a1a6eefe7b",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 120,
"avg_line_length": 48.80152671755725,
"alnum_prop": 0.577350226810574,
"repo_name": "apache/incubator-tinkerpop",
"id": "0767022e6cb86a86919fefbdd7daaa77f86a5d8c",
"s... |
import argparse
import matplotlib.pyplot as plt
from pylab import savefig
import os
from os import path
import csv
from glob import glob
from collections import defaultdict
parser = argparse.ArgumentParser()
parser.add_argument(dest="output_file", help="path to output folder", metavar="output_file")
parser.add_argumen... | {
"content_hash": "97500333d866fa59b6e2408b3c25b25a",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 117,
"avg_line_length": 24.98,
"alnum_prop": 0.6409127301841473,
"repo_name": "Electrostatics/graphcut",
"id": "ea033722258d73ee6d3d3704106cb81ed7fb9ec5",
"size": "2498",
... |
from __future__ import unicode_literals
from django.db import models, migrations
def add_data_to_issue_status(apps, schema_editor):
IssueField = apps.get_model('issues', 'IssueField')
# pk 1
IssueField(**{'history_message': '',
'plugin_version': '0.1',
'name': 'commen... | {
"content_hash": "3f2a3ce128817c16536227e1e134ce00",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 66,
"avg_line_length": 37.43023255813954,
"alnum_prop": 0.4423734078906493,
"repo_name": "znick/anytask",
"id": "04ce27161fb04dee4c1763ecf93e1763cf2f9be2",
"size": "3422",
... |
"""DAG run APIs."""
from datetime import datetime
from typing import Dict
from airflow.api.common.experimental import check_and_get_dag, check_and_get_dagrun
def get_dag_run_state(dag_id: str, execution_date: datetime) -> Dict[str, str]:
"""Return the task object identified by the given dag_id and task_id.
... | {
"content_hash": "703b9d6207432fbf2cb26f797120d366",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 83,
"avg_line_length": 29.3,
"alnum_prop": 0.6996587030716723,
"repo_name": "spektom/incubator-airflow",
"id": "cdc518d4d5a1d7aa0beb19107e3d0951fcfe6620",
"size": "1373",
... |
"""Runs plain netperf in a few modes.
docs:
https://hewlettpackard.github.io/netperf/doc/netperf.html
manpage: http://manpages.ubuntu.com/manpages/maverick/man1/netperf.1.html
Runs TCP_RR, TCP_CRR, and TCP_STREAM benchmarks from netperf across two
machines.
"""
import collections
import csv
import json
import loggin... | {
"content_hash": "d1f3658e7a5b8737f315559d6706a874",
"timestamp": "",
"source": "github",
"line_count": 546,
"max_line_length": 80,
"avg_line_length": 37.49267399267399,
"alnum_prop": 0.6742709198378194,
"repo_name": "GoogleCloudPlatform/PerfKitBenchmarker",
"id": "b19592817243ead023f1cefbd9b492816d1... |
"""Tests for the Broadlink integration."""
from homeassistant.components.broadlink.const import DOMAIN
from tests.async_mock import MagicMock, patch
from tests.common import MockConfigEntry
# Do not edit/remove. Adding is ok.
BROADLINK_DEVICES = {
"Entrance": (
"192.168.0.11",
"34ea34befc25",
... | {
"content_hash": "2c1e13b866ca4223f31495c65a103fad",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 86,
"avg_line_length": 25.480916030534353,
"alnum_prop": 0.5290593169562612,
"repo_name": "tchellomello/home-assistant",
"id": "4051f94c0d306ba35eea968ab563d1373b37c904",
... |
"""
A special directive for generating a matplotlib plot.
.. warning::
This is a hacked version of plot_directive.py from Matplotlib.
It's very much subject to change!
Usage
-----
Can be used like this::
.. plot:: examples/example.py
.. plot::
import matplotlib.pyplot as plt
plt.plot... | {
"content_hash": "eca7b0d0158d8cc0fff4291816d87bba",
"timestamp": "",
"source": "github",
"line_count": 636,
"max_line_length": 88,
"avg_line_length": 32.07232704402516,
"alnum_prop": 0.5311305029904893,
"repo_name": "veeresht/CommPy",
"id": "86e53b8538d31bc59843ece5f4ad83e43f2f5c0b",
"size": "2039... |
name = 'Zed A. Shaw'
age = 35 # not a lie
height = 74 # inches
weight = 180 # lbs
eyes = 'Blue'
teeth = 'White'
hair = 'Brown'
inch_to_cm_multiplier = 2.54
lbs_to_kg_multiplier = 0.4535924
height_cm = height * inch_to_cm_multiplier
weight_kg = weight * lbs_to_kg_multiplier
print "Let's talk about %s." % na... | {
"content_hash": "394184fb506f979cf442d81ae4461075",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 88,
"avg_line_length": 36.31818181818182,
"alnum_prop": 0.6420525657071339,
"repo_name": "Herne/pythonplayground",
"id": "f38e1e599397927d0cdfaffdffcb3621d9f74195",
"size":... |
"""
maker Core decorators for views
"""
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse, NoReverseMatch
from maker.core.conf import settings
from django.utils.html import escape
from jinja2.loaders import TemplateNotFound
from maker.core.models impo... | {
"content_hash": "2c021c7b27556c7b3a9c5327fed1c562",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 136,
"avg_line_length": 39.69101123595506,
"alnum_prop": 0.5218683651804671,
"repo_name": "alejo8591/maker",
"id": "75fa3ad3878886aba049b222a594490e260e0be0",
"size": "711... |
from txweb2 import responsecode
from txweb2.http import HTTPError
from txweb2.test.test_server import SimpleRequest
from twisted.internet.defer import inlineCallbacks, succeed
from twistedcaldav.linkresource import LinkResource
from twistedcaldav.resource import CalendarHomeResource
from twistedcaldav.test.util impor... | {
"content_hash": "a79c0462cfd4b1b54b9c2d0e66001ec0",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 89,
"avg_line_length": 30.920454545454547,
"alnum_prop": 0.6644615950018375,
"repo_name": "macosforge/ccs-calendarserver",
"id": "1eb498b1336de1f3f18586d9798adf1f04274d3b",
... |
__author__ = 'Alexander.Nevskiy'
import argparse
import json
import sys
# todo: write unit test
# data = {}
# data['a'] = {}
# data['a']['b'] = 3
# data['a']['c'] = 45
# data['a']['d'] = 4
#
# r = {}
# set_value("a.b", data, r)
# set_value("a.c", data, r)
# print(r)
def set_value(k, data, result):
keys = k.split... | {
"content_hash": "e658e497a0918411ab63e52984b16fc8",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 106,
"avg_line_length": 25.080645161290324,
"alnum_prop": 0.5151125401929261,
"repo_name": "bedge/dev-shell-essentials",
"id": "a62208eacb7e3a8de3d24de5373d5898bb529df1",
"... |
import sys, os
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
sys.path.append(os.path.abspath('sphinxext'))
# -- General configuration ------------------------------------------------... | {
"content_hash": "58228798f38b7ada5d819c959a83b497",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 95,
"avg_line_length": 33.12558139534884,
"alnum_prop": 0.6971356360572872,
"repo_name": "CoolProp/CoolProp-museum",
"id": "84e0ba3e8fec1835c393e929b6c1a90bfea1fb59",
"siz... |
import urllib, os, sys
import tarfile
SQLITE_URL = "http://conceptnet.media.mit.edu/dist/ConceptNet-sqlite.tar.gz"
def prompt_for_download(filename):
print """
You don't seem to have the ConceptNet database installed. (If you do,
I couldn't find the db_config.py file that says where it is.)
If you want, I can dow... | {
"content_hash": "45728c69ab8a0281e99280e851c03d70",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 76,
"avg_line_length": 33.84375,
"alnum_prop": 0.6500461680517082,
"repo_name": "pbarton666/buzz_bot",
"id": "1423f65a1eb655fa0587dedcf4b8b05bf14a7fb7",
"size": "2166",
"... |
"""RequestContext: context for requests that persist through all of cinder."""
import copy
from cinder.openstack.common import log as logging
from cinder.openstack.common import local
from cinder.openstack.common import timeutils
from cinder import utils
LOG = logging.getLogger(__name__)
def generate_request_id()... | {
"content_hash": "c0fffe953c1784024ae616ed2cc25a6b",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 78,
"avg_line_length": 34.55,
"alnum_prop": 0.5868306801736614,
"repo_name": "freedomhui/cinder",
"id": "7e7f2417791f531869e2e170d047dc0db256e971",
"size": "4955",
"bina... |
from baseconvert import base
import sys
import argparse
def main():
"""
Main entry point for running baseconvert as a command.
Examples:
$ python -m baseconvert -n 0.5 -i 10 -o 20 -s True
0.A
$ echo 3.1415926 | python -m baseconvert -i 10 -o 16 -d 3 -s True
3.243
"... | {
"content_hash": "dd25aa426ff545dff9600e756edb436b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 152,
"avg_line_length": 41.4,
"alnum_prop": 0.6169082125603865,
"repo_name": "squdle/baseconvert",
"id": "d2521a8ad42b44ea379df2750cc18a8d1992109d",
"size": "2070",
"bina... |
"""Network Hosts are responsible for allocating ips and setting up network.
There are multiple backend drivers that handle specific types of networking
topologies. All of the network commands are issued to a subclass of
:class:`NetworkManager`.
"""
import collections
import datetime
import functools
import itertool... | {
"content_hash": "bd9d45b79c44535fbff2cd445fc1ed8b",
"timestamp": "",
"source": "github",
"line_count": 2208,
"max_line_length": 89,
"avg_line_length": 44.77853260869565,
"alnum_prop": 0.5519919895621568,
"repo_name": "j-carpentier/nova",
"id": "86c1b9f26c589d7a5eda9d60801cf1f90272909e",
"size": "9... |
from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api import client
from sentry.api.bases.group import GroupEndpoint
from sentry.api.helpers.environments import get_environments
class GroupEventsLatestEndpoint(GroupEndpoint):
def get(self, request, group):
"... | {
"content_hash": "bb259beb33e907100d16ca9afbe9c669",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 94,
"avg_line_length": 33.611111111111114,
"alnum_prop": 0.6057851239669422,
"repo_name": "beeftornado/sentry",
"id": "2a3b1a8c8ca6a0472ebb3700d594741d57b2eef1",
"size": "1... |
from participantCollection import ParticipantCollection
import re
import datetime
import pyperclip
# Edit Me!
# This script gets run on the first day of the following month, and that month's URL is
# what goes here. E.g. If this directory is the directory for February, this script gets
# run on March 1, and this URL ... | {
"content_hash": "59fdb374ea983f146d60ddc0a2377741",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 199,
"avg_line_length": 45.13846153846154,
"alnum_prop": 0.6806407634628494,
"repo_name": "foobarbazblarg/stayclean",
"id": "de4c797598ee3afac10d3e1c861103a4445e8703",
"siz... |
from questionnaire.forms.locations import RegionForm
from questionnaire.models import Organization
from questionnaire.tests.base_test import BaseTest
class LocationTypeFormTest(BaseTest):
def setUp(self):
org = Organization.objects.create(name="WHO")
self.form_data = {
'name': 'AFRO',
... | {
"content_hash": "c40240d7b6e95426ee0641b2026ad50b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 63,
"avg_line_length": 33.76,
"alnum_prop": 0.6398104265402843,
"repo_name": "testvidya11/ejrf",
"id": "cf2dc5e2dcfa9547c0e4991f45cba9b1fcfeecca",
"size": "844",
"binary"... |
import unittest
import os
import shutil
import imath
import IECore
import IECoreScene
import IECoreImage
import IECoreGL
IECoreGL.init( False )
class MeshPrimitiveTest( unittest.TestCase ) :
outputFileName = os.path.dirname( __file__ ) + "/output/testMesh.tif"
def testVertexAttributes( self ) :
vertexSource =... | {
"content_hash": "aa9abb6110b950d02ff0eda1723ae0f6",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 125,
"avg_line_length": 30.936,
"alnum_prop": 0.6488233772950608,
"repo_name": "appleseedhq/cortex",
"id": "1af84d7f25de2d041009f6a088b6c2e87396ef0f",
"size": "9523",
"b... |
"""Turn the lamp on and off"""
import logging
# If we're not running on a Raspberry, use a GPIO stub so we can still get some coding done
from platform import processor
if processor() == 'x86_64' or 'i386':
from lib.gpio_stub import LED
else:
from gpiozero import LED # pylint: disable=import-error
class Lam... | {
"content_hash": "521f97d6a7dd6f5673598194a8f22e58",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 91,
"avg_line_length": 28.15,
"alnum_prop": 0.6092362344582594,
"repo_name": "arunderwood/BasilPi",
"id": "f0212a8c4f5145106f167baff9b444de270efeb3",
"size": "1126",
"bin... |
from django.conf.urls import patterns, url
from documents.views import (DocumentDetailView, ExportDocumentView,
DocumentForksView, DocumentStarsView,
NewDocumentView, MyDocumentsView, DocumentEditView,
ForkDocumentView, StarDocument... | {
"content_hash": "8ce7c76e3b8f825fdc8a3e23890b295b",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 80,
"avg_line_length": 47.214285714285715,
"alnum_prop": 0.5832072617246596,
"repo_name": "fatiherikli/dbpatterns",
"id": "276e288f6bb0397c6c7e50551bbbcab7eb3286e6",
"size"... |
from .base import ischema_names
from ...sql import expression, operators
from ... import types as sqltypes
try:
from uuid import UUID as _python_UUID
except ImportError:
_python_UUID = None
def Any(other, arrexpr, operator=operators.eq):
"""A synonym for the :meth:`.ARRAY.Comparator.any` method.
Thi... | {
"content_hash": "593702f1405a045c85cba032aef64a62",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 79,
"avg_line_length": 32.27272727272727,
"alnum_prop": 0.5983748645720477,
"repo_name": "276361270/sqlalchemy",
"id": "ebdfe16953ce5ba4687bde26a01e545c8dc05570",
"size": ... |
from .version import APP_NAME, APP_VERSION
def main(*args, **kwargs):
from .__main__ import main
main(*args, **kwargs)
| {
"content_hash": "307e6ba368531e073356752b7108cf61",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 42,
"avg_line_length": 25.6,
"alnum_prop": 0.6484375,
"repo_name": "bell345/gif2xls",
"id": "6176db23fc9c22c905ed2deaac3a2e62c60c024f",
"size": "152",
"binary": false,
"... |
"""
IO related utilities.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#----------------... | {
"content_hash": "a949e42972dc05ac313ae58e617bc0e0",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 81,
"avg_line_length": 31.877394636015325,
"alnum_prop": 0.5725961538461538,
"repo_name": "poojavade/Genomics_Docker",
"id": "c3390ed2bb9cadbaa286bf5e1ba664897ae85fa0",
"s... |
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from testapp.sampleapp.models import Category
def sample_view(request, **kw):
context = RequestContext(request, kw)
return render_to_response("sampleapp/home.html", context)
def category_view(request, id):
r... | {
"content_hash": "82ad707cd107aafa1df54fdc8783af70",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 128,
"avg_line_length": 44.3,
"alnum_prop": 0.781038374717833,
"repo_name": "dibaunaumh/tikal-corp-website",
"id": "129c28fcd9f28d79656b6d6217ab270bf291398e",
"size": "469"... |
"""
5. Many-to-many relationships
To define a many-to-many relationship, use ``ManyToManyField()``.
In this example, an ``Article`` can be published in multiple ``Publication``
objects, and a ``Publication`` has multiple ``Article`` objects.
"""
from django.db import models
class Publication(models.Model):
titl... | {
"content_hash": "f98e18dd7680cac0143cab613723257c",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 171,
"avg_line_length": 35.867158671586715,
"alnum_prop": 0.7148148148148148,
"repo_name": "hugs/django",
"id": "cc34c868b93025f0022c71e4054c48e3d76bdf7f",
"size": "9720",... |
import sqlite3
import hashlib
import random
import string
_conn = None
_c = None
def init(conn):
c = conn.cursor()
_conn = conn
_c = c
_c.execute('CREATE TABLE IF NOT EXISTS users (id INTEGER AUTO_INCREMENT, pass VARCHAR(200), uname VARCHAR(200), group INTEGER)')
def getAllUsers():
_c.execute('SE... | {
"content_hash": "da34b5f4c8ae36265fcfea871695bef6",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 132,
"avg_line_length": 26.515625,
"alnum_prop": 0.6370064820271066,
"repo_name": "demilletech/cert-gui",
"id": "4c7318654f9c33702b2fb8deaf859b236cec08ec",
"size": "1697",
... |
from __future__ import unicode_literals
from codecs import open as codecs_open
from setuptools import setup, find_packages
# Get the long description from the relevant file
with codecs_open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(name='geopandas_osm',
version='0.0.1',
... | {
"content_hash": "e628950d88f0fe3754d1cf4c3f461222",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 72,
"avg_line_length": 26.428571428571427,
"alnum_prop": 0.6075675675675676,
"repo_name": "jwass/geopandas_osm",
"id": "810c947b02279c23f2cbcf19be47185cf11b5dad",
"size": "... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/structure/shared_house_player_small_style_02.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return resul... | {
"content_hash": "9f35bd2f26cc7254fdc86d228d40ce09",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 92,
"avg_line_length": 24.692307692307693,
"alnum_prop": 0.7009345794392523,
"repo_name": "anhstudios/swganh",
"id": "72c3ca4331fe0c2a19ac9b87f56d7e1c0d20f6e9",
"size": "46... |
"""
Unit test for String parameters
"""
from . import API1TestCase
import param
ip_regex = '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'
class TestStringParameters(API1TestCase):
def test_regex_ok(self):
class A(param.Parameterized):
s = param.Strin... | {
"content_hash": "35ee10c705c6dedfdaba563c27911424",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 102,
"avg_line_length": 28.232142857142858,
"alnum_prop": 0.5768500948766604,
"repo_name": "ioam/param",
"id": "4a4197dd97ec26b0db3897d90ce89abf4d82a001",
"size": "1581",
... |
"""Job registries."""
from core.domain import collection_jobs_one_off
from core.domain import exp_jobs_one_off
from core.domain import feedback_jobs_one_off
from core.domain import feedback_jobs_continuous
from core.domain import stats_jobs_continuous
from core.domain import stats_jobs_one_off
from core.domain import ... | {
"content_hash": "4bbecc693071f203f9e18ba8f13bfd44",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 79,
"avg_line_length": 46.03174603174603,
"alnum_prop": 0.7882758620689655,
"repo_name": "shaz13/oppia",
"id": "bb628a1225e929e5b590ebd720e06a77274a23ba",
"size": "3523",
... |
from google.cloud import documentai_v1beta3
async def sample_evaluate_processor_version():
# Create a client
client = documentai_v1beta3.DocumentProcessorServiceAsyncClient()
# Initialize request argument(s)
request = documentai_v1beta3.EvaluateProcessorVersionRequest(
processor_version="proc... | {
"content_hash": "42764c8cb61acb6742752561658aee17",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 92,
"avg_line_length": 29.217391304347824,
"alnum_prop": 0.7529761904761905,
"repo_name": "googleapis/python-documentai",
"id": "4d8177fc81552d532c7a446fdc84f7b07d510d46",
... |
import os
import time
import json
import shutil
from bigmler.tests.world import world, res_filename
from subprocess import check_call, CalledProcessError
from bigml.api import check_resource
from bigml.io import UnicodeReader
from bigmler.processing.models import MONTECARLO_FACTOR
from bigmler.checkpoint import file_... | {
"content_hash": "a4aa76455314341ae9a1725aab35da73",
"timestamp": "",
"source": "github",
"line_count": 1944,
"max_line_length": 93,
"avg_line_length": 43.51543209876543,
"alnum_prop": 0.5840130505709625,
"repo_name": "bigmlcom/bigmler",
"id": "78150c64c2211ccf54561016a9572190b6804bd1",
"size": "85... |
from django.contrib import admin
from .models import *
admin_models = [
Profile,
Broker,
GenericBrokerInfo,
NYTBrokerInfo,
]
admin.site.register(admin_models)
| {
"content_hash": "910a05d02a92e57f4cb348f8b606b4fa",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 33,
"avg_line_length": 14.833333333333334,
"alnum_prop": 0.7078651685393258,
"repo_name": "thomasgilgenast/pinax-sandbox",
"id": "45299187ef2b0e8a355c993bbbc3810667a227cf",
... |
import os
from twisted.python import usage, runtime, filepath, log
from twisted.application import service
from twisted.internet import defer, reactor, protocol
from foolscap.api import Referenceable
class BadServiceArguments(Exception):
pass
class UnknownServiceType(Exception):
pass
class BaseOptions(usage.O... | {
"content_hash": "b65a5de66285718fae3b957b61806f16",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 89,
"avg_line_length": 35.18707482993197,
"alnum_prop": 0.6039632672788787,
"repo_name": "pexip/os-foolscap",
"id": "f75248eae50c817036fc89b846a69df457874f55",
"size": "10... |
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.osgunittest as osgunittest
class TestStartCvmfs(osgunittest.OSGTestCase):
def setup_fuse(self):
fuse_conf_path='/etc/fuse.conf'
files.preserve(fuse_conf_path, 'cvmfs')
try:
contents... | {
"content_hash": "fdd35dd0f14cf6c8200678b09939b7c0",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 222,
"avg_line_length": 41.46031746031746,
"alnum_prop": 0.6236600306278713,
"repo_name": "efajardo/osg-test",
"id": "bdca1a7c635e0ed94d856a16bace6a58d7efca02",
"size": "26... |
from .default import * # noqa
# import djcelery
import os
# ===================
# = Global Settings =
# ===================
DEBUG = True
THUMBNAIL_DEBUG = True
# ===================
# = Server Settings =
# ===================
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DEFAULT_FILE_STORAGE = ... | {
"content_hash": "ea23bba9e66ad79dfb96d3ed8952b05e",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 100,
"avg_line_length": 21.833333333333332,
"alnum_prop": 0.5430752453653217,
"repo_name": "allink/cookiecutter-allink-project",
"id": "d6df21ab3cab5a2c7fce55de6887be6bd6c23f... |
"""optik
A powerful, extensible, and easy-to-use command-line parser for Python.
By Greg Ward <gward@python.net>
See http://optik.sourceforge.net/
Cheetah modifications: added "Cheetah.Utils.optik." prefix to
all intra-Optik imports.
"""
# Copyright (c) 2001 Gregory P. Ward. All rights reserved.
# See the READ... | {
"content_hash": "956debffcfcf214b2c21ee125881662d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 72,
"avg_line_length": 30.03125,
"alnum_prop": 0.7440166493236212,
"repo_name": "tebeka/pythonwise",
"id": "75a30badc28b0032c95071ba1d3f8f562e8e34a9",
"size": "961",
"bin... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0005_auto_20170613_1149'),
]
operations = [
migrations.AlterModelOptions(
name='account',
options={'ordering': ['order',... | {
"content_hash": "a5087bc13623d26277b1f9c659750fdc",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 115,
"avg_line_length": 24.176470588235293,
"alnum_prop": 0.6009732360097324,
"repo_name": "bejmy/backend",
"id": "3a8f066f8a3302bd7dbb328264332098df7f9017",
"size": "484",... |
from django.conf.urls import patterns, url
from django.views.generic import RedirectView
import views
urlpatterns = patterns(
'',
# Home
url(r'^$', views.home, name='pontoon.home'),
# Legacy: Translate project's page
url(r'^locale/(?P<locale>[A-Za-z0-9\-\@\.]+)/project/(?P<slug>.+)' +
'/... | {
"content_hash": "72866ec3ff7754b4df6d933551d36266",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 84,
"avg_line_length": 34.49640287769784,
"alnum_prop": 0.602711157455683,
"repo_name": "yfdyh000/pontoon",
"id": "f29919bcaeec3b8f618611c4c04c2eae82c989c5",
"size": "4795... |
with section("format"):
# How wide to allow formatted cmake files
line_width = 90
# How many spaces to tab for indent
tab_size = 2
# If a positional argument group contains more than this many arguments,
# then force it to a vertical layout.
max_pargs_hwrap = 4
# If the statement spel... | {
"content_hash": "df3a9b1f62e204e6d969c4cb28e052b8",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 78,
"avg_line_length": 37.28846153846154,
"alnum_prop": 0.6714801444043321,
"repo_name": "kou/arrow",
"id": "3e77733f4d1ee342d7d9aae4366fab75d5014a0b",
"size": "2947",
"b... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from .. import constraints
from ..torch_transform import TransformModule
from ..util import copy_docs_from
@copy_docs_from(TransformModule)
class BatchNorm(TransformModule):
r"""
A type of batch normalization that can be used to stabilize tra... | {
"content_hash": "55c8443cba962cb7e37e0de02a571820",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 106,
"avg_line_length": 39.33766233766234,
"alnum_prop": 0.6654011224826676,
"repo_name": "uber/pyro",
"id": "1a92e09a2a7f6473132e36b230e026f7731dc6e2",
"size": "6147",
... |
"""
@package mi.dataset.parser.test.test_vel3d_k_wfp_stc
@file marine-integrations/mi/dataset/parser/test/test_vel3d_k_wfp_stc.py
@author Steve Myerson (Raytheon)
@brief Test code for a vel3d_k_wfp_stc data parser
"""
import ntplib
from nose.plugins.attrib import attr
from StringIO import StringIO
from mi.core.excep... | {
"content_hash": "856833ab9ab31943afef7aa1ac7aa3f2",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 81,
"avg_line_length": 42.02577319587629,
"alnum_prop": 0.6574880412118239,
"repo_name": "ooici/marine-integrations",
"id": "99741d23cb41d82c404aa89f73548280288b48cd",
"si... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/crafting/station/shared_weapon_tool.iff"
result.attribute_template_id = 1
result.stfName("crafting","weapon_tool_name")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "13351dcbecfc0c0ec57c8fae3a741fc2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 76,
"avg_line_length": 23.923076923076923,
"alnum_prop": 0.7041800643086816,
"repo_name": "obi-two/Rebelion",
"id": "bf0dc04b9ecd2e9dcc45e919b63ac70b51c9276e",
"size": "456... |
import sys
if sys.version_info[0] == 3:
_input = input
else:
_input = raw_input
| {
"content_hash": "edf8617d8b276a3622231b38c54575df",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 28,
"avg_line_length": 14.833333333333334,
"alnum_prop": 0.6067415730337079,
"repo_name": "AlexandreAbraham/my_nilearn_sandbox",
"id": "235b0cce366bb68c650352b1e904ce1044fbd59... |
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 'AffectedUserByGroup.tuser'
db.add_column('sentry_affecteduserbygroup', 'tuser',
self.gf('djang... | {
"content_hash": "4fbab28449cf6d073dd594a3f73d861f",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 182,
"avg_line_length": 81.69424460431655,
"alnum_prop": 0.5469596230901326,
"repo_name": "SilentCircle/sentry",
"id": "057cdc74526384764c3f08e488eccc5e6d4d754b",
"size": ... |
from nose.tools import assert_raises
import gevent
from zerorpc import zmq
import zerorpc
from testutils import teardown, random_ipc_endpoint
def test_close_server_bufchan():
endpoint = random_ipc_endpoint()
server_events = zerorpc.Events(zmq.XREP)
server_events.bind(endpoint)
server = zerorpc.Channe... | {
"content_hash": "49abd90b8c260ccc6eb7f18c9f9a996e",
"timestamp": "",
"source": "github",
"line_count": 399,
"max_line_length": 77,
"avg_line_length": 32.73684210526316,
"alnum_prop": 0.659546776910121,
"repo_name": "VanL/zerorpc-python",
"id": "aee03e72b0f339b61e09bbef492f0bfd1d1d846a",
"size": "1... |
"""Tests for treadmill.runtime.linux.image.native.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import os
import shutil
import stat
import tempfile
import unittest
import collections
from collections... | {
"content_hash": "dbef34af1158c2abcd1599cb0b13a431",
"timestamp": "",
"source": "github",
"line_count": 432,
"max_line_length": 78,
"avg_line_length": 36.45601851851852,
"alnum_prop": 0.4736173725315893,
"repo_name": "captiosus/treadmill",
"id": "6f604382d4baaf2e92c2c789b639392c349a6191",
"size": "... |
"""
Tests for latex2e writer.
"""
import string
from __init__ import DocutilsTestSupport
def suite():
settings = {'use_latex_toc': False}
s = DocutilsTestSupport.PublishTestSuite('latex', suite_settings=settings)
s.generateTests(totest)
settings['use_latex_toc'] = True
s.generateTests(totest_latex... | {
"content_hash": "4b6ac8e095263dc1ff50bb100ff4886d",
"timestamp": "",
"source": "github",
"line_count": 948,
"max_line_length": 82,
"avg_line_length": 17.218354430379748,
"alnum_prop": 0.6231697604606996,
"repo_name": "cloudera/hue",
"id": "d7b9b993f00333cf075e3330695892e369cf1bec",
"size": "16556"... |
"""
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.
The Sudoku board could be partially filled, where empty cells are filled with the character '.'.
A partially filled sudoku which is valid.
Note:
A valid Sudoku board (partially filled) is not necessarily solvable. Only the filled c... | {
"content_hash": "ac4a7f38952e7d9e84fca63155eafd4c",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 132,
"avg_line_length": 36.388888888888886,
"alnum_prop": 0.4778625954198473,
"repo_name": "ee08b397/LeetCode-4",
"id": "cc22a81f7207d95db08f73be5d432af243b63601",
"size": ... |
"""Configuration for HEOS tests."""
from __future__ import annotations
from typing import Sequence
from unittest.mock import Mock, patch as patch
from pyheos import Dispatcher, Heos, HeosPlayer, HeosSource, InputSource, const
import pytest
from homeassistant.components import ssdp
from homeassistant.components.heos ... | {
"content_hash": "cd5ff46b5785af42c0b9876bdfb89b08",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 96,
"avg_line_length": 33.04819277108434,
"alnum_prop": 0.6806416332482683,
"repo_name": "FreekingDean/home-assistant",
"id": "2c48b7fe8e1b135d9615b06da083a89ba89f5c2f",
"... |
import os, sys, re
PROF_HEADER = "hip_prof_str.h"
OUTPUT = PROF_HEADER
REC_MAX_LEN = 1024
# Messages and errors controll
verbose = 0
errexit = 0
inp_file = 'none'
line_num = -1
# Verbose message
def message(msg):
if verbose: sys.stdout.write(msg + '\n')
# Fatal error termination
def error(msg):
if line_num != -... | {
"content_hash": "230368b4d02add16fa3ec3acba4e5129",
"timestamp": "",
"source": "github",
"line_count": 487,
"max_line_length": 124,
"avg_line_length": 31.862422997946613,
"alnum_prop": 0.5502996713282207,
"repo_name": "GPUOpen-ProfessionalCompute-Tools/HIP",
"id": "475d28186ba44a8b0e91c0a435923f4a09... |
"""Keras layers API."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Generic layers.
# pylint: disable=g-bad-import-order
from tensorflow.python.keras.engine.input_layer import Input
from tensorflow.python.keras.engine.input_layer import InputLayer
fro... | {
"content_hash": "c72364cea05fba8c86b56b397fb9c1f8",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 102,
"avg_line_length": 50.72674418604651,
"alnum_prop": 0.8644126074498567,
"repo_name": "ghchinoy/tensorflow",
"id": "50ca739d90317259b9c13af71c564942ab9a0b1d",
"size": ... |
import math
import torch
from torch.nn.parameter import Parameter
import torch.nn.functional as F
from torch.nn.modules import Module
class BilinearWithBias(Module):
def __init__(self, in1_features, in2_features, out_features):
super(BilinearWithBias, self).__init__()
self.in1_features = in1_featu... | {
"content_hash": "155b55c80df0556d5d026ba119d2e43e",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 90,
"avg_line_length": 39.111111111111114,
"alnum_prop": 0.6470170454545454,
"repo_name": "masashi-y/depccg",
"id": "235f5b84eff5dce1d166b8c7eb961b73d6c9c513",
"size": "140... |
"""Tests for feedback-related services."""
from core.domain import feedback_services
from core.platform import models
from core.tests import test_utils
(feedback_models,) = models.Registry.import_models([models.NAMES.feedback])
class FeedbackServicesUnitTests(test_utils.GenericTestBase):
"""Test functions in fe... | {
"content_hash": "3f4d24aa454cd6d4266e6a7970df66ac",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 79,
"avg_line_length": 42.905660377358494,
"alnum_prop": 0.6503957783641161,
"repo_name": "amitdeutsch/oppia",
"id": "3c851e3dac9ef6cc100f3889feac73f2c5d23cbc",
"size": "28... |
"""
WSGI config for shufflelunch project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shufflelunch.settings")
from dja... | {
"content_hash": "2b68186ccab0a83f78422ddbb0f73909",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 28.5,
"alnum_prop": 0.7794486215538847,
"repo_name": "lmtest/shufflelunch",
"id": "2de876402ad693984506c4daad91bfa97744a896",
"size": "399",
"binar... |
from cogent.util.misc import get_merged_by_value_coords
__author__ = "Gavin Huttley"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__credits__ = ["Gavin Huttley"]
__license__ = "GPL"
__version__ = "1.5.3"
__maintainer__ = "Gavin Huttley"
__email__ = "gavin.huttley@anu.edu.au"
__status__ = "alpha"
# follow... | {
"content_hash": "5a0c7fdca76e91d9bfe377d93dd9d184",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 78,
"avg_line_length": 39.52713178294574,
"alnum_prop": 0.6083545793292803,
"repo_name": "sauloal/cnidaria",
"id": "b48204bdf4524532ad6658edf140b11d0bbcf8cf",
"size": "509... |
import sys
from osgpypp import osg
from osgpypp import osgDB
from osgpypp import osgViewer
# Translated from file 'osgimagesequence.cpp'
# OpenSceneGraph example, osgtexture3D.
#*
#* Permission is hereby granted, free of charge, to any person obtaining a copy
#* of this software and associated documentation files... | {
"content_hash": "84f24dd14007d6347587ce7a95071ad2",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 122,
"avg_line_length": 33.28287841191067,
"alnum_prop": 0.5970327294415865,
"repo_name": "JaneliaSciComp/osgpyplusplus",
"id": "57d87f292879f0bbb1db4e1d7f37d5a6f9a43587",
... |
from util.tasks import add_task, poll_task_queue
#from util.io import flatten_model
from project.models import Project
from ballot.models import Ballot, DenormalizedBallot
from django.db import models
from django.db.models.signals import post_save, pre_delete
from django.dispatch import receiver
from django.co... | {
"content_hash": "747c60de5df9ee7c8d6aa3689f837bf5",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 176,
"avg_line_length": 46.46408839779006,
"alnum_prop": 0.6537455410225922,
"repo_name": "asrashley/ieee-802-11-timeline",
"id": "05e39317c85234795d75ba70a4e0aa18e7549e11",... |
from __future__ import absolute_import, division, print_function
from datetime import datetime, date, timedelta
import sys
def identity(x):
return x
def asday(dt):
if isinstance(dt, datetime):
return dt.date()
else:
return dt
def asweek(dt):
if isinstance(dt, datetime):
dt... | {
"content_hash": "24b67dd03cc02b84da61f047f80928ee",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 81,
"avg_line_length": 25.238683127572017,
"alnum_prop": 0.5776944399152127,
"repo_name": "scls19fr/blaze",
"id": "6465d025a5e9fc143f2ea436e969ec2d309d7997",
"size": "6133... |
"""Reports binary size metrics for LaCrOS build artifacts.
More information at //docs/speed/binary_size/metrics.md.
"""
import argparse
import collections
import contextlib
import json
import logging
import os
import subprocess
import sys
import tempfile
@contextlib.contextmanager
def _SysPath(path):
"""Library i... | {
"content_hash": "4f17e36a5838623fd274c74d44f76d95",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 80,
"avg_line_length": 34.95072463768116,
"alnum_prop": 0.6559960192403383,
"repo_name": "youtube/cobalt_sandbox",
"id": "bf791c6531b7b52cc0d9bdf0651bf7dac22b32bc",
"size"... |
from tempest.common import commands
from tempest import config
from tempest.openstack.common import log as logging
CONF = config.CONF
LOG = logging.getLogger(__name__)
TABLES = ['filter', 'nat', 'mangle']
def log_ip_ns():
if not CONF.debug.enable:
return
LOG.info("Host Addr:\n" + commands.ip_addr_r... | {
"content_hash": "fd107ca6a325c6e4ecbb6b7374044389",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 75,
"avg_line_length": 28.736842105263158,
"alnum_prop": 0.6089743589743589,
"repo_name": "vmahuli/tempest",
"id": "228be7a9aef9a3f281f3fde9be7668f45f1c5beb",
"size": "1690... |
"""
@author: Franz Papst
"""
import os
import numpy as np
import matplotlib.pyplot as plt
from label import Label
from config import MGC_DIR, LABEL_DIR, DATA_DIR, COMPONENTS_TO_PLOT, MGCORD, OUT_DIR
class Prediction:
"""Class to collect and compare predictions made by different models.
This class acts as a... | {
"content_hash": "4b2a07e7ccaacc5463fe873083d954e3",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 107,
"avg_line_length": 35.346820809248555,
"alnum_prop": 0.5901880621422732,
"repo_name": "CPUFronz/basis_speech",
"id": "01d966359fca4437decb73e54218115f38c78b36",
"size... |
from framework.dependency_management.dependency_resolver import ServiceLocator
"""
PASSIVE Plugin for Old, Backup and Unreferenced Files (OWASP-CM-006)
https://www.owasp.org/index.php/Testing_for_Old,_Backup_and_Unreferenced_Files_(OWASP-CM-006)
"""
DESCRIPTION = "Google Hacking for juicy files"
def run(PluginInfo):
... | {
"content_hash": "c2483efb210c604f9d5ab0a5f3bf9ef3",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 185,
"avg_line_length": 50.36363636363637,
"alnum_prop": 0.8032490974729242,
"repo_name": "DePierre/owtf",
"id": "852928201ae08c81983d7294058fbc8efaa88166",
"size": "554",
... |
DEFAULT_MIRROR = "debian.lcs.mit.edu" # HTTP Only
| {
"content_hash": "feb3733194ed605a2e15a4c68d11b124",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 50,
"avg_line_length": 51,
"alnum_prop": 0.7058823529411765,
"repo_name": "lucaskanashiro/debile",
"id": "357dd12f2056c102d5fe8e818df3d394e2a81ad8",
"size": "1265",
"binar... |
from itertools import product, filterfalse
def crackingPassword(digits, k, d):
def createNumber(digs):
return "".join(map(str, digs))
return sorted(filterfalse(lambda digs: int(digs) % d, map(createNumber, product(digits, repeat = k))))
| {
"content_hash": "7ba737000db045a745701d1829059b83",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 106,
"avg_line_length": 36.42857142857143,
"alnum_prop": 0.7019607843137254,
"repo_name": "RevansChen/online-judge",
"id": "d5cb0c8513c87ea5ec73b5c5ba1db37891c6b7d1",
"size"... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 0, ar_order = 12); | {
"content_hash": "d7a1f164af4b58e50cc7dfd01fa3a0c5",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 164,
"avg_line_length": 37.714285714285715,
"alnum_prop": 0.7045454545454546,
"repo_name": "antoinecarme/pyaf",
"id": "6ae6bc60cb40dc7f30dcc6e3318d681593937d07",
"size": "26... |
import numpy as np
import skimage.io
import instance_occlsegm_lib.datasets.apc.arc2017
import instance_occlsegm_lib.image
def load_item_data(item_data_dir, load_pred=True, skip_known=False):
obj_names, obj_data = instance_occlsegm_lib.datasets.apc.\
arc2017.load_item_data(item_data_dir, skip_known=skip_k... | {
"content_hash": "bd7fe0792d114acd6e0e5f9c60824b9f",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 74,
"avg_line_length": 33.285714285714285,
"alnum_prop": 0.6148068669527897,
"repo_name": "pazeshun/jsk_apc",
"id": "061766426b0bdedc84618596bf917da520145fb0",
"size": "932... |
import logging
import json
from datetime import datetime
from django.core.management.base import NoArgsCommand
from external import utils
from external import mongo
logger = logging.getLogger(__name__)
class Command(NoArgsCommand):
def handle_noargs(self, **options):
cursor = ''
retries = 0
t0 = datetim... | {
"content_hash": "2fcc7b8828682f376580a32ba169c992",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 136,
"avg_line_length": 26.895522388059703,
"alnum_prop": 0.6548279689234184,
"repo_name": "Pancho/failiac",
"id": "b650c07d168f211b07ce55ea9f76723457cc7144",
"size": "1802... |
from __future__ import unicode_literals
from __future__ import absolute_import
__author__ = "scalyr-cloudtech@scalyr.com"
from scalyr_agent import compat
from scalyr_agent.monitor_utils.k8s import (
KubernetesApi,
K8sApiException,
K8sApiAuthorizationException,
ApiQueryOptions,
K8sNamespaceFilter,... | {
"content_hash": "41b9377cbb5525898f2d6ee569a52b67",
"timestamp": "",
"source": "github",
"line_count": 920,
"max_line_length": 623,
"avg_line_length": 44.517391304347825,
"alnum_prop": 0.5541312628186347,
"repo_name": "scalyr/scalyr-agent-2",
"id": "605a930259e70cd3acda7001172baf7272532ef5",
"size... |
"""Support for the Google Cloud TTS service."""
import asyncio
import logging
import os
import async_timeout
from google.cloud import texttospeech
import voluptuous as vol
from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider
import homeassistant.helpers.config_validation as cv
_LOGGER = logg... | {
"content_hash": "bdf2e5cb23a1e67b56c808b0e3ca04f5",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 88,
"avg_line_length": 28.837638376383765,
"alnum_prop": 0.6003838771593091,
"repo_name": "pschmitt/home-assistant",
"id": "1658fcec1f5af4c26ca2d862efa888b011005c2d",
"siz... |
"""Check RPC argument consistency."""
from collections import defaultdict
import os
import re
import sys
# Source files (relative to root) to scan for dispatch tables
SOURCES = [
"src/rpc/server.cpp",
"src/rpc/blockchain.cpp",
"src/rpc/mining.cpp",
"src/rpc/misc.cpp",
"src/rpc/net.cpp",
"src/r... | {
"content_hash": "87b02b78473cadbe7315da066f96add6",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 157,
"avg_line_length": 37.22012578616352,
"alnum_prop": 0.5631970260223048,
"repo_name": "aurarad/auroracoin",
"id": "a40a6ccc1609df4401be229899b971f75bdcdb22",
"size": "... |
'''
================
Tree Classifier
================
Decision tree based classifier
------------------------------
'''
from __future__ import division
import numpy as np
from .classifier import normaliselabels
from .base import supervised_model
__all__ = [
'tree_learner',
'stump_learner',
]
class Leaf... | {
"content_hash": "ff95a9e4cf52483ab7ddfe59295f0c5c",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 139,
"avg_line_length": 31.326612903225808,
"alnum_prop": 0.6054833311880551,
"repo_name": "arnaudsj/milk",
"id": "39e22d7b8dd44354db59ee8dc420ff77eed79631",
"size": "7973... |
from __future__ import division # Standardmäßig float division - Ganzzahldivision kann man explizit mit '//' durchführen
from pyecs import *
from pyecs.components import Pose, Size
from time import time
class Draggable(Component):
"""docstring for Draggable"""
def __init__(self, move_every = 1/60, *args,*... | {
"content_hash": "22a9d069d60ae43ed3621a90c3f4c8c2",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 131,
"avg_line_length": 34.98076923076923,
"alnum_prop": 0.5865860362836723,
"repo_name": "xaedes/pyecs",
"id": "511a2e8f7365b32d60875d142ca30c1533f007ab",
"size": "1869",
... |
import random
import sys
from nomesLista import nomes_list
from nomesLista import sobrenomes_list
def name_Generator():
print("Gerador de Nomes")
while(True):
ask_Opt = input("""
1. Gerar primeiro nome.
2. Gerar sobrenome.
3. Nome + sobrenome.
4. Avançado.
O que deseja fazer?: """)
if str(ask_O... | {
"content_hash": "03d72f5095bdf50553c7f2785e08d31a",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 119,
"avg_line_length": 42.151162790697676,
"alnum_prop": 0.3997241379310345,
"repo_name": "Pharaoh00/Pharaoh-Toolkit",
"id": "340e792d3a4f57cca6b0766e937098e0a641440a",
"s... |
import functools
import IECore
import Gaffer
import GafferUI
import GafferImage
## Supported plug metadata :
#
# - "channelPlugValueWidget:extraChannels", a list of extra channel names to always support.
# Can be used to provide special functionality such as the reserved White/Black channels on Shuffle
# - "chann... | {
"content_hash": "37692580f69175fa977dc9e2ea10de53",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 111,
"avg_line_length": 34.163636363636364,
"alnum_prop": 0.7094199042043641,
"repo_name": "GafferHQ/gaffer",
"id": "62e1416b3f8860c8dc4ece3d6710eb06e298a23f",
"size": "55... |
import os
import sys
import traceback
import codecs
import logging
import time
import xml.etree.ElementTree as ET
import numpy as np
from optparse import OptionParser
from gensim.models import word2vec
from nltools import misc, tokenizer
from align_model import AlignMod... | {
"content_hash": "1b4a0265c39dbb923e4ca5c3bed583d8",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 74,
"avg_line_length": 20.33009708737864,
"alnum_prop": 0.5835721107927412,
"repo_name": "gooofy/zamia-ai",
"id": "31aef29d385ba3f4cff4cdfd462dbce697e37f77",
"size": "2814... |
import os, sys, re, collections
from operator import itemgetter
from collections import defaultdict
from optparse import OptionParser
import pylab as P
import matplotlib
import array
import Tkinter as Tk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from random import randint
... | {
"content_hash": "23ad2dc08d36ffb370d5b5af48883484",
"timestamp": "",
"source": "github",
"line_count": 781,
"max_line_length": 101,
"avg_line_length": 34.778489116517285,
"alnum_prop": 0.5563286944996687,
"repo_name": "tidyjiang8/zephyr-doc",
"id": "84f7f5a592244813f301eab6467d4285b9016c02",
"size... |
from __future__ import print_function
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pylab as py
from tqdm import tqdm
import math
import warnings
warnings.filterwarnings('ignore')
from movement import utils
import movement.config as CONFIG
def load_shots():
"""
Load shots on... | {
"content_hash": "ba3ca771596c055f0612d855c0478a2e",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 152,
"avg_line_length": 28.814432989690722,
"alnum_prop": 0.5819320214669051,
"repo_name": "sealneaward/nba-movement-data",
"id": "6999866a09dd930007de19fd1b659d82ae24208d",... |
"""Run fuzz test targets.
"""
from concurrent.futures import ThreadPoolExecutor, as_completed
import argparse
import configparser
import logging
import os
import subprocess
import sys
def get_fuzz_env(*, target, source_dir):
return {
'FUZZ': target,
'UBSAN_OPTIONS':
f'suppressions={source... | {
"content_hash": "88d5a678cfe6a7c54d397333a1ff26bb",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 180,
"avg_line_length": 35.05921052631579,
"alnum_prop": 0.5728091574404204,
"repo_name": "apoelstra/bitcoin",
"id": "eeff7a4515480d927496559f2aed385a70af8d98",
"size": "1... |
"""Tests for the Sonos Alarm switch platform."""
from copy import copy
from datetime import timedelta
from unittest.mock import patch
from homeassistant.components.sonos.const import DATA_SONOS_DISCOVERY_MANAGER
from homeassistant.components.sonos.switch import (
ATTR_DURATION,
ATTR_ID,
ATTR_INCLUDE_LINKED... | {
"content_hash": "548b0b9d623df6fb598aac5cc34094b9",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 87,
"avg_line_length": 40.376543209876544,
"alnum_prop": 0.7315395199510778,
"repo_name": "mezz64/home-assistant",
"id": "2b7946575657054d46ee58a434c3e7c7a2a166f7",
"size"... |
import collections
from nova.compute import task_states
from nova.compute import vm_states
from nova import context
from nova import exception
from nova.i18n import _
from nova import objects
from nova.openstack.common import log as logging
from nova.pci import pci_device
from nova.pci import pci_stats
LOG = logging.... | {
"content_hash": "334ec35f14de20a517ccb4949b31ec03",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 79,
"avg_line_length": 40.477777777777774,
"alnum_prop": 0.5861469484856803,
"repo_name": "eayunstack/nova",
"id": "370c086911d886f873cfe027b6abe676fe1183f3",
"size": "116... |
"""
The coalib package is a collection of various subpackages regarding
writing, executing and editing bears. Various other packages such as
formatting and settings are also included in coalib.
"""
import sys
from os.path import join, dirname
VERSION_FILE = join(dirname(__file__), 'VERSION')
def get_version():
... | {
"content_hash": "2e59d881cf5dd29cca6e223a5ece8914",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 68,
"avg_line_length": 21.74074074074074,
"alnum_prop": 0.6882453151618398,
"repo_name": "IPMITMO/statan",
"id": "6ca8738aed06cc89d95a46e3db75eba92752cd05",
"size": "587",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.