text stringlengths 4 1.02M | meta dict |
|---|---|
from django.contrib import admin
from django.utils.translation import ugettext as _
from django_attach.forms import AttachmentInline
from linguo.forms import MultilingualModelForm
from main.models import *
class CategoryAdmin(admin.ModelAdmin):
list_display = ('title','path')
inlines = (AttachmentInline,)
class ... | {
"content_hash": "d071d71d06b048ee75e606cc55586d26",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 50,
"avg_line_length": 20.543478260869566,
"alnum_prop": 0.6624338624338625,
"repo_name": "peterkuma/tjrapid",
"id": "6c7800d560def6e439f3b0d4fbb4ffe8cfa47f89",
"size": "10... |
from django.contrib import admin
from blog.models import *
class ArticleAdmin(admin.ModelAdmin):
list_display = ('author', 'title', 'date_post')
fieldsets = (
(
'None',
{'fields': ('author', 'title', 'content')}
),
)
admin.site.register(Article, ArticleAdmin)
admin.... | {
"content_hash": "dc03f5bc22469be16a22669d6a94fcef",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 54,
"avg_line_length": 24.714285714285715,
"alnum_prop": 0.6098265895953757,
"repo_name": "piratos/ctfbulletin",
"id": "3aa1b4248fa6d8de708205cf522d6413c07846c0",
"size": "... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import os
import shutil
import logging
import time
from flexget import plugin
from flexget.event import event
from flexget.config_schema import one_or_more
from flexget.ut... | {
"content_hash": "f76b8da22e8347035bd05ae84a8b5d98",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 115,
"avg_line_length": 38.60597826086956,
"alnum_prop": 0.532976701625959,
"repo_name": "jacobmetrick/Flexget",
"id": "ba6d31e250e7944626e69769da9e58bb5b3b5698",
"size": ... |
import sys
import os
from StringIO import StringIO
from grammar import GrammarStore
from theme import ThemeStore
from debug_formatter import DebugFormatter
def validate_testcases(dirname):
print(u'Testcase validation\n')
gs = GrammarStore()
print(u'\nRunning Testcases')
testcases = os.path.join(dirn... | {
"content_hash": "01cdf26be8b0bcd0782af361550d0f7a",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 88,
"avg_line_length": 36.986666666666665,
"alnum_prop": 0.5075702956020187,
"repo_name": "mountainstorm/textfriend",
"id": "c4f31f8ae55219a75467af15b3f5984eaf6be3d2",
"siz... |
from game import *
from learningAgents import ReinforcementAgent
from featureExtractors import *
import random,util,math
import numpy as np
class QLearningAgent(ReinforcementAgent):
"""
Q-Learning Agent
Functions you should fill in:
- computeValueFromQValues
- computeActionFromQValues... | {
"content_hash": "d1454035c5d2b8f2bea74ff461cdc1f2",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 93,
"avg_line_length": 34.610619469026545,
"alnum_prop": 0.5793914599846587,
"repo_name": "PiscesDream/Ideas",
"id": "bd78ad92e1d66375a6d64b510631fae14e687219",
"size": "8... |
import os
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
from CIP.logic.SlicerUtil import SlicerUtil
from CIP.ui import PreProcessingWidget
#
# CIP_InteractiveLobeSegmentation
#
class CIP_InteractiveLobeSegmentation(ScriptedLoadableModule):
def __init__(self, parent):
... | {
"content_hash": "00e13140971a83a33954494c756225ca",
"timestamp": "",
"source": "github",
"line_count": 1028,
"max_line_length": 176,
"avg_line_length": 43.69357976653696,
"alnum_prop": 0.6588819377963799,
"repo_name": "acil-bwh/SlicerCIP",
"id": "026a169dd72bef0c18dfa6cc4b2bacf357109aad",
"size": ... |
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain... | {
"content_hash": "ae66dba832d0dc82144db742bf10e8b1",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 126,
"avg_line_length": 39.85,
"alnum_prop": 0.7979924717691342,
"repo_name": "microsoft/DiscoFaceGAN",
"id": "ad43827d8a279c4a797e09b51b8fd96e8e003ee6",
"size": "799",
"... |
class InputCell(object):
def __init__(self, initial_value):
self.value = None
class ComputeCell(object):
def __init__(self, inputs, compute_function):
self.value = None
def add_callback(self, callback):
pass
def remove_callback(self, callback):
pass
| {
"content_hash": "c83c152193fc2b10999322ebc301cd69",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 49,
"avg_line_length": 21.571428571428573,
"alnum_prop": 0.6158940397350994,
"repo_name": "N-Parsons/exercism-python",
"id": "c7de0e007844583b1b0d121ecf5ce910aee3c018",
"si... |
import sys
import json
import string
def hw():
print 'Hello, world!'
def lines(fp):
print str(len(fp.readlines()))
def sent_dict(ssf):
"""
#Creates a dictionary from the sentiment input file
"""
scores = {}
for line in ssf:
term, score = line.split("\t")
scores[term] = int(s... | {
"content_hash": "3fcedd8f70ea8df970222cca753e1d32",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 98,
"avg_line_length": 21.323943661971832,
"alnum_prop": 0.5429326287978864,
"repo_name": "jbagd/twitter-sentiment",
"id": "35080718d379c030f5ef33413fbeec042be2b7de",
"size... |
import time
import requests
class AnticaptchaError(Exception):
pass
class Anticaptcha(object):
base_url = "https://api.anti-captcha.com"
create_task_url = base_url + "/createTask"
get_task_result_url = base_url + "/getTaskResult"
language_pool = "en"
soft_id = 850
def __init__(self, a... | {
"content_hash": "87a2ed1de67eaf4f54b93fe6be3aa948",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 88,
"avg_line_length": 30.56896551724138,
"alnum_prop": 0.5707839819514946,
"repo_name": "bogdal/freepacktbook",
"id": "c921ae71340995fc7b2a0f439a5fe557e8d962ec",
"size": "... |
import synapse.lib.cli as s_cli
from synapse.tests.common import *
class TstThrowCmd(s_cli.Cmd):
'''
Throw an exception.
'''
_cmd_name = 'throwzero'
def runCmdOpts(self, opts):
ret = 1 / 0
class TstThrowKeyboard(s_cli.Cmd):
'''
Throw an exception.
'''
_cmd_name = 'throwke... | {
"content_hash": "39ead391023bd14ea132af924f0aae0f",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 100,
"avg_line_length": 30.82116788321168,
"alnum_prop": 0.4966252220248668,
"repo_name": "vivisect/synapse",
"id": "4e4dcb27e65c7b4095e0733171b8adefe99cb415",
"size": "84... |
def main():
# equilibrate then isolate cold finger
info('Equilibrate then isolate coldfinger')
close(name="C", description="Bone to Turbo")
sleep(1)
open(name="B", description="Bone to Diode Laser")
sleep(20)
close(name="B", description="Bone to Diode Laser")
| {
"content_hash": "914f09486bb3c2711fcd97844224d74e",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 54,
"avg_line_length": 35.875,
"alnum_prop": 0.6724738675958188,
"repo_name": "NMGRL/pychron",
"id": "70135f5b49049c75cfb17ec24f3f02b4f1a805aa",
"size": "287",
"binary": f... |
from django.contrib import admin
from django.conf import settings
from blog.models import Post, Blog, BlogUserAccess
class BlogUserAccessInline(admin.TabularInline):
model = BlogUserAccess
raw_id_fields = ('user', )
class BlogAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('name',)... | {
"content_hash": "20539567676118272ce036564e2d284d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 59,
"avg_line_length": 26.233333333333334,
"alnum_prop": 0.6404066073697586,
"repo_name": "ilblackdragon/django-blogs",
"id": "f52609e726760e9265f0c7056da81fe6b3fae5a2",
"s... |
"""
Module to update migration scenario file migrate.yaml, during execution,
point to insert fail step ('fail_migration') is being chosen randomly by
_insert_break_point method from list of steps generated by _get_list_of_tasks
method.
"""
import os
import random
import yaml
from filtering_utils import FilteringUtils... | {
"content_hash": "b702e53d32001f8cccc92a3d37caf361",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 79,
"avg_line_length": 39.675925925925924,
"alnum_prop": 0.5628938156359393,
"repo_name": "Settis/CloudFerry",
"id": "bcfdb98e1cbbb42c4b7594dc26a8c36c653a5c28",
"size": "4... |
import abc
import six
from cdn.provider.base import controller
from cdn.provider.base import responder
@six.add_metaclass(abc.ABCMeta)
class ServicesControllerBase(controller.ProviderControllerBase):
def __init__(self, driver):
super(ServicesControllerBase, self).__init__(driver)
self.responder... | {
"content_hash": "d8b1d7cb25408d7785ac4cf8ccaf835e",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 66,
"avg_line_length": 26.076923076923077,
"alnum_prop": 0.7300884955752213,
"repo_name": "obulpathi/cdn1",
"id": "482c839e38f2fca203f3d6c282fa6a3d5adef192",
"size": "1263"... |
"""A experimental script for setting up DVS recording with VOT dataset.
This script uses Sacred from IDSIA lab to setup the experiment.
This allows me to configure experiment by JSON file.
Author: Yuhuang Hu
Email : duugyue100@gmail.com
"""
from sacred import Experiment
import os
import cPickle as pickle
import num... | {
"content_hash": "44d87ee15466ebcf768efef7fd579b20",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 76,
"avg_line_length": 32.731884057971016,
"alnum_prop": 0.5711755589993358,
"repo_name": "duguyue100/spikefuel",
"id": "01a6784163d1fdaa6ef7a992c6ea4571786e33ab",
"size":... |
import collections
import hashlib
from django import forms
from django.conf import settings
from django.db import models
from django.db.models import Max
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.template.defaultfilters import slugify
from django.utils import timez... | {
"content_hash": "47e6090ae79759216fb8ed5a68398f4f",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 134,
"avg_line_length": 31.97991967871486,
"alnum_prop": 0.6389551676503831,
"repo_name": "pinax/django-waitinglist",
"id": "c4b488ef0875f10aa282906bc979336805a71591",
"si... |
from airflow import DAG
from airflow.providers.plexus.operators.job import PlexusJobOperator
from airflow.utils.dates import days_ago
HOME = '/home/acc'
T3_PRERUN_SCRIPT = 'cp {home}/imdb/run_scripts/mlflow.sh {home}/ && chmod +x mlflow.sh'.format(home=HOME)
dag = DAG(
'test',
default_args={'owner': 'core sc... | {
"content_hash": "e2f2a86d6b5b8a09d89b6144fd40c733",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 105,
"avg_line_length": 24.580645161290324,
"alnum_prop": 0.6233595800524935,
"repo_name": "dhuang/incubator-airflow",
"id": "2f0a492a671228c60888504c3d2e68215e651303",
"si... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('scorecard', '0006_auto_20150602_1821'),
]
operations = [
migrations.AddField(
model_name='indicatorscore',
name='comment',
... | {
"content_hash": "9e2c755ae7660c67f6826d74c4d87d48",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 49,
"avg_line_length": 23.52173913043478,
"alnum_prop": 0.5748613678373382,
"repo_name": "sunlightlabs/mptindicators",
"id": "ceb4b653927e886d5bd57668f36d1284ed4c3df3",
"si... |
"""The nexia integration base entity."""
from aiopvapi.resources.shade import ATTR_TYPE
import homeassistant.helpers.device_registry as dr
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import (
DEVICE_FIRMWARE,
DEVICE_MAC_ADDRESS,
DEVICE_MODEL,
DEVICE_NAME,
DE... | {
"content_hash": "7b0fb5355cebfaa9ae56ef5e80665ff3",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 114,
"avg_line_length": 32.84444444444444,
"alnum_prop": 0.6072395128552097,
"repo_name": "adrienbrault/home-assistant",
"id": "679e55e806c79761750ced997dafdc7ae7fcb18f",
"... |
"""Support for fans through the SmartThings cloud API."""
from typing import Optional, Sequence
from pysmartthings import Capability
from homeassistant.components.fan import (
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM,
SPEED_OFF,
SUPPORT_SET_SPEED,
FanEntity,
)
from . import SmartThingsEntity
from ... | {
"content_hash": "69321734f80e0d74dc5c90f8fd88fe65",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 77,
"avg_line_length": 34.87640449438202,
"alnum_prop": 0.6543170103092784,
"repo_name": "Teagan42/home-assistant",
"id": "aad62aed486cf9c9013ea51fc293591ad9508e9d",
"size"... |
from distutils.version import LooseVersion
import pytest
from pandas.compat._optional import VERSIONS
import pandas as pd
from pandas.core.computation.engines import _engines
import pandas.core.computation.expr as expr
def test_compat():
# test we have compat with our version of nu
from pandas.core.comput... | {
"content_hash": "7af7473f50359a9073f542c71c044480",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 80,
"avg_line_length": 27.163265306122447,
"alnum_prop": 0.6168294515401953,
"repo_name": "kushalbhola/MyStuff",
"id": "b3fbd8c17d8bfa9c7a1397b928962d70bf7a7a7f",
"size": "... |
""" Various kinds of icon widgets.
"""
from __future__ import absolute_import
from ...core.properties import abstract
from ...core.properties import Bool, Float, Enum
from ...core.enums import NamedIcon
from .widget import Widget
@abstract
class AbstractIcon(Widget):
""" An abstract base class for icon widgets. ... | {
"content_hash": "d35ffbc3b8f88fd335be955b93acf564",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 74,
"avg_line_length": 26.384615384615383,
"alnum_prop": 0.6618075801749271,
"repo_name": "ptitjano/bokeh",
"id": "19e411eda29785740da6554f61edfcb6f1e0803f",
"size": "1029"... |
import argparse
import os
class Config(object):
def __init__(self):
self.config = None
def parse(self):
parser = argparse.ArgumentParser()
parser.add_argument(
'command',
help='Choose from setup, games, load, or upload.'
)
parser.add_argument(... | {
"content_hash": "a911b19f575768d0bd699c0b82f8e68d",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 71,
"avg_line_length": 26.6,
"alnum_prop": 0.5468215994531784,
"repo_name": "gak/giant-multiplayer-robot-helper",
"id": "c66f098174681e2b43862ad57f07187e5bf9a98a",
"size": ... |
from __future__ import unicode_literals
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import logging
from oauthlib.common import add_params_to_uri
from oauthlib.common import urldecode as _urldecode
from oauthlib.oauth1 import (
SIGNATURE_HMAC, SIGNATURE_RSA, SI... | {
"content_hash": "44ac0332b8498bfb2fd06453e59bb48f",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 145,
"avg_line_length": 43.40431266846361,
"alnum_prop": 0.6235484071291064,
"repo_name": "ericoporto/Chove-Agora",
"id": "3097a2e3f51f3784898414da6cbf570fe02c50c4",
"size... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configurat... | {
"content_hash": "03590499df48ae92c57dc7fe6a35bbb8",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 80,
"avg_line_length": 32.714285714285715,
"alnum_prop": 0.7075741605179943,
"repo_name": "gilliM/wallace",
"id": "21103b183c945ec2c546537cc52568695a778d76",
"size": "7066... |
import unittest
from ..a import add
from ..b import multiply
# what s
class TestAB(unittest.TestCase):
def test_add_and_multiply(self):
"""test adding and multiplying at the same time"""
self.assertEqual(add(2, 3), 5)
self.assertEqual(multiply(2, 3), 6)
| {
"content_hash": "b7f3d2364de7505d6bc7533468314beb",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 58,
"avg_line_length": 25.818181818181817,
"alnum_prop": 0.6619718309859155,
"repo_name": "public/testmon",
"id": "79c3e0c52969a3de8c04313ecbe31ee3fe9062ad",
"size": "284",... |
from django.db import models
from django.contrib.contenttypes.fields import GenericRelation
from mezzanine.pages.page_processors import processor_for
from hs_core.models import BaseResource, ResourceManager, resource_processor,\
CoreMetaData, AbstractMetaDataElement
from lxml import etree
... | {
"content_hash": "e94ae88c8f2abb0b9078c7899309402f",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 98,
"avg_line_length": 42.17619047619048,
"alnum_prop": 0.6410748560460653,
"repo_name": "RENCI/xDCIShare",
"id": "a2adf8c5410132b2b3046c32e14a188908e754d1",
"size": "8857... |
"""
Context managers for use with the ``with`` statement.
.. note:: When using Python 2.5, you will need to start your fabfile
with ``from __future__ import with_statement`` in order to make use of
the ``with`` statement (which is a regular, non ``__future__`` feature of
Python 2.6+.)
"""
from contextlib ... | {
"content_hash": "841e36345113b232ee3f516fbb884654",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 91,
"avg_line_length": 33.69642857142857,
"alnum_prop": 0.6399929341105812,
"repo_name": "fitoria/fabric",
"id": "2bf81d7831593fddb2389a6a58a07b3ed1833b61",
"size": "11322... |
import cherrypy
from server.Concept import Concept, Concepts
from server.Description import Description, Descriptions, DescriptionsForConcept, ConceptForDescription, \
PreferredDescriptionForConcept, FSNForConcept, ConceptBase
from server.Relationship import Relationship, Relationships, RelationshipsForSource, Rela... | {
"content_hash": "94eb74840e5756b1c26dc12020902ba0",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 118,
"avg_line_length": 64.22,
"alnum_prop": 0.6662514273850306,
"repo_name": "cts2/rf2service",
"id": "8e8049510689d337fb049a92c9154231ef981853",
"size": "11211",
"bina... |
from otp.level import LevelMgr
import FactoryUtil
from toontown.toonbase.ToonPythonUtil import Functor
from toontown.toonbase import ToontownGlobals
class FactoryLevelMgr(LevelMgr.LevelMgr):
InterestingLocations = [(((-866, -272, -40), -101),
((-662, -242, 7.5), 0),
((-20, -180, 20), 0),
((-249, ... | {
"content_hash": "c8c58d557f30f4d5628b5146332af0bc",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 99,
"avg_line_length": 39.404761904761905,
"alnum_prop": 0.6163141993957704,
"repo_name": "silly-wacky-3-town-toon/SOURCE-COD",
"id": "566ce5bc741d0c2bb61b6894ce560b8304bdd08... |
from buildHTMLSection import Document
from buildHTMLSection import Requirements
from buildHTMLSection import Objective
from buildHTMLSection import findElementById
import sys
import os
class TraceTable(Document):
def __init__ (self,template,target,information):
super(TraceTable,self).__init__(template)
... | {
"content_hash": "f1732cb13c1343b292d8566e9aac2a0d",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 113,
"avg_line_length": 31.928571428571427,
"alnum_prop": 0.6517524235645041,
"repo_name": "mbroihier/tfw",
"id": "ad2e3a5e4c88e65340bad8462d5880d93501c8ec",
"size": "2701"... |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class PacketCapturesOperations(object):
"""PacketCapturesOperations operations... | {
"content_hash": "e2a860fbd9a13422639cbf5590c9f886",
"timestamp": "",
"source": "github",
"line_count": 539,
"max_line_length": 215,
"avg_line_length": 49.647495361781075,
"alnum_prop": 0.6609118086696562,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "3aff82b28741ab3d52076c811d29b430f7b887a6",
... |
import _plotly_utils.basevalidators
class HoverinfosrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hoverinfosrc", parent_name="cone", **kwargs):
super(HoverinfosrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "53f6d0e82030898f4874915f86eeafc5",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 81,
"avg_line_length": 36.90909090909091,
"alnum_prop": 0.6305418719211823,
"repo_name": "plotly/plotly.py",
"id": "48110ff964a3383ebddd52060509d3b8b0c2bbd4",
"size": "406"... |
"""
Test cases format for time space networks and jointed dispatch of time and space networks
"""
F_BUS = 0
T_BUS = 1
TIME = 2
BUS_ID = 0
D = 1
LOCATION = 2
| {
"content_hash": "76011fbdcb8fd027c3f0134bf27cf642",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 89,
"avg_line_length": 14.454545454545455,
"alnum_prop": 0.6729559748427673,
"repo_name": "Matrixeigs/Optimization",
"id": "bef822ae825747ead82cc60bffe234ad61dd7237",
"size... |
from .sub_resource import SubResource
class ApplicationGatewayBackendHttpSettings(SubResource):
"""Backend address pool settings of an application gateway.
:param id: Resource Identifier.
:type id: str
:param port: Port
:type port: int
:param protocol: Protocol. Possible values are: 'Http' an... | {
"content_hash": "8d800074fbcf9a0c2936d9cab07b7b1f",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 167,
"avg_line_length": 47.75438596491228,
"alnum_prop": 0.6734019103600294,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "5c5fb92a3e4c0e02626ee38886e7ec00512f055b",... |
"""The backups api."""
import webob
from webob import exc
from cinder.api import common
from cinder.api import extensions
from cinder.api.openstack import wsgi
from cinder.api.views import backups as backup_views
from cinder.api import xmlutil
from cinder import backup as backupAPI
from cinder import exception
from ... | {
"content_hash": "e00d29f37f0e701b2a509c24ad239361",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 78,
"avg_line_length": 35.42537313432836,
"alnum_prop": 0.627343585422372,
"repo_name": "ntt-sic/cinder",
"id": "e284baa29ddf1eb8210cddbba9ada3c7b2a0ce35",
"size": "10155"... |
from __future__ import unicode_literals
import logging
import sys
import os
import re
import shutil
from . import errors
from .tvdb import TVDB
log = logging.getLogger('Core')
class Episode(object):
def __init__(self, file_, number):
self.file_ = file_ # cache reverse reference to parent object
... | {
"content_hash": "c0fad67de0a5615a1a33231ce2bee9dd",
"timestamp": "",
"source": "github",
"line_count": 409,
"max_line_length": 91,
"avg_line_length": 34.696821515892424,
"alnum_prop": 0.5734620534141357,
"repo_name": "ghickman/tvrenamr",
"id": "b1b93b6e6a1bdc2351ade53431ecd47ae9cc1d11",
"size": "1... |
from django.contrib import admin
# Issue 182: six no longer included with Django 3.0
try:
from django.utils import six
except ImportError:
import six
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
from avatar.models import Avatar
from avatar.signals ... | {
"content_hash": "deb39c6d8ea6b8767de9bbe300d75546",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 91,
"avg_line_length": 33,
"alnum_prop": 0.671451355661882,
"repo_name": "jezdez/django-avatar",
"id": "a47f74b2da5f323fba936f520046ff5c901aefdd",
"size": "1254",
"binary... |
"""
Ce module permet de créer des commandes pour faire agir les robots.
Des fonctions utilitaire permettent de transformer une commande de
Position (Pose) en une commande de vitesse.
L'embarqué et le simulateur utilise un vecteur de vitesse (Pose) pour
contrôler les robots.
"""
from abc import abst... | {
"content_hash": "1450eceb22dba459f72342b4a50c5394",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 75,
"avg_line_length": 32.16822429906542,
"alnum_prop": 0.647588611272516,
"repo_name": "MaximeGLegault/StrategyIA",
"id": "111d68d0ac809a941dc3c6b9c0341171f4deb874",
"siz... |
"""First API, local access only"""
import hug
@hug.local()
def happy_birthday(name: hug.types.text, age: hug.types.number, hug_timer=3):
"""Says happy birthday to a user"""
return {'message': 'Happy {0} Birthday {1}!'.format(age, name),
'took': float(hug_timer)}
| {
"content_hash": "6ce5fe21af1267e157b03fc129d467c4",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 77,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.631578947368421,
"repo_name": "MuhammadAlkarouri/hug",
"id": "3cc8dbeaea72402f635b13ce5dc866e5bf687e24",
"size": "... |
import unittest
from tageditor import musicTitle
class TestTagEditor(unittest.TestCase):
def test_title_case(self):
title = "I LiKe TyPiNg LiKe ThIs"
self.assertEquals(musicTitle(title), "I Like Typing Like This")
def test_title_with_spaces(self):
title = "this contains spaces ... | {
"content_hash": "db088114ada27089a8328eea2a246035",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 73,
"avg_line_length": 38.31818181818182,
"alnum_prop": 0.6405693950177936,
"repo_name": "mikekucharski/PyD3",
"id": "0877eb52e6306840d68564ea1598fe21173bfe66",
"size": "16... |
import json
import pickle
from revscoring.scoring.statistics.classification.counts import \
MultilabelCounts
def test_counts():
c = MultilabelCounts(
["foo", "bar", "baz"],
[({'prediction': ["foo"]}, ["foo", "bar"])] * 10 +
[({'prediction': ["foo", "bar", "baz"]}, ["foo", "baz"])] * 2... | {
"content_hash": "1c95acc4906f19d936c67c7ce3067f76",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 72,
"avg_line_length": 31.307692307692307,
"alnum_prop": 0.5577395577395577,
"repo_name": "wiki-ai/revscoring",
"id": "9ec4a563f58fdf835736b557fb2d4d6677b9bc56",
"size": "8... |
class BaseExtension:
def __init__(self, bot, config):
self.bot = bot
self.config = config
| {
"content_hash": "ab427ba2ba701855a9c098681733987e",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 36,
"avg_line_length": 27.5,
"alnum_prop": 0.5818181818181818,
"repo_name": "Slko/Slot",
"id": "899b2f2970b5057a887d9c5787b7ed83ceef1284",
"size": "110",
"binary": false,
... |
"""
$description Bulgarian CDN hosting live content for various websites in Bulgaria.
$url armymedia.bg
$url bgonair.bg
$url bloombergtv.bg
$url bnt.bg
$url live.bstv.bg
$url i.cdn.bg
$url nova.bg
$url mu-vi.tv
$type live
$region Bulgaria
"""
import logging
import re
from urllib.parse import urlparse
from streamlink.... | {
"content_hash": "cb67ab844c747218151959d11ba4451e",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 100,
"avg_line_length": 29.752136752136753,
"alnum_prop": 0.47112898592358515,
"repo_name": "chhe/streamlink",
"id": "c080becebd1ec4bc626be50ad59f2c3e7dc74a12",
"size": "3... |
"""
PlexAPI Examples
As of Plex version 0.9.11 I noticed that you must be logged in
to browse even the plex server locatewd at localhost. You can
run this example suite with the following command:
>> python examples.py -u <USERNAME> -p <PASSWORD> -s <SERVERNAME>
"""
import argparse, sys
from os.path import dirname, a... | {
"content_hash": "9d0e77cbdf5630faded7ba0a14fc498a",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 119,
"avg_line_length": 37.154761904761905,
"alnum_prop": 0.6719000320410125,
"repo_name": "jmjordan/python-plexapi",
"id": "1a2b10d41e83920b46fc4dd9283f9a084203e9e7",
"siz... |
try:
import unittest2 as unittest
except ImportError:
import unittest
from sunlight.service import EntityList, EntityDict
class TestEntityList(unittest.TestCase):
def test_list_meta(self):
obj = EntityList(['foo', 'bar'], meta={'number': 20})
self.assertIsNotNone(obj._meta)
class TestE... | {
"content_hash": "41b4685eb9b710955c7b3a11b8ae154c",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 61,
"avg_line_length": 24.15,
"alnum_prop": 0.6749482401656315,
"repo_name": "sunlightlabs/python-sunlight",
"id": "ae1e0a38d0005e0a5c6fc3791c47ef1dbbaa0be2",
"size": "483"... |
from copy import deepcopy
import functools
import hashlib
import http.client as httpstatus
import json
from typing import Dict
from typing import List
from typing import Tuple
from unittest import mock
import uuid
from cinder import context
from cinder import db
from cinder import exception
from cinder.tests.unit impo... | {
"content_hash": "b85094aef133344e698b180dda4ece58",
"timestamp": "",
"source": "github",
"line_count": 889,
"max_line_length": 79,
"avg_line_length": 44.66591676040495,
"alnum_prop": 0.5692051979449985,
"repo_name": "openstack/cinder",
"id": "35fddb1bbee174421426145c54da4b39913c18b4",
"size": "403... |
"""
Yelp API v2.0 code sample.
This program demonstrates the capability of the Yelp API version 2.0
by using the Search API to query for businesses by a search term and location,
and the Business API to query additional information about the top result
from the search query.
Please refer to http://www.yelp.com/develo... | {
"content_hash": "2f208c938db5d0b2da386efe0cc97e76",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 143,
"avg_line_length": 29.32704402515723,
"alnum_prop": 0.6635213381942955,
"repo_name": "willyem/yelp-api",
"id": "6f70b1e06c36d44a9b73510505c4416c5e55f278",
"size": "46... |
import BoostBuild
t = BoostBuild.Tester(pass_toolset=False)
t.write("input.sss", "")
t.write("Jamroot.jam", """
import type ;
import common ;
import generators ;
import "class" : new ;
import feature : feature ;
import toolset : flags ;
type.register AAA : aaa ;
type.register BBB : bbb ;
type.register CCC : ccc ;
t... | {
"content_hash": "017a2b2d1451ea6d4fc06aa1232ce726",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 76,
"avg_line_length": 25.737864077669904,
"alnum_prop": 0.6212749905695963,
"repo_name": "davehorton/drachtio-server",
"id": "2d22f34087b9874f60d33173022ee77ee4b147a6",
"... |
"""
This module can do slight modifications to a wiki page source code such that
the code looks cleaner. The changes are not supposed to change the look of the
rendered wiki page.
The following parameters are supported:
¶ms;
-always Don't prompt you for each replacement. Warning (see below)
... | {
"content_hash": "03e70bb6e0184726de6d4dd02fcf0623",
"timestamp": "",
"source": "github",
"line_count": 667,
"max_line_length": 222,
"avg_line_length": 46.78110944527736,
"alnum_prop": 0.5424157933532032,
"repo_name": "azatoth/pywikipedia",
"id": "ee371c44ce10eb0f01b8809b2e96867edcd92725",
"size": ... |
"""Config flow for Bond integration."""
from __future__ import annotations
from http import HTTPStatus
import logging
from typing import Any
from aiohttp import ClientConnectionError, ClientResponseError
from bond_api import Bond
import voluptuous as vol
from homeassistant import config_entries, exceptions
from home... | {
"content_hash": "e17918936cae3aa338807aa8c6dc75bd",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 88,
"avg_line_length": 35.53,
"alnum_prop": 0.6020264565156206,
"repo_name": "aronsky/home-assistant",
"id": "6f70d37e0a1a3d15586d431a25bcaf9bebe640ea",
"size": "7106",
... |
__source__ = 'https://leetcode.com/problems/complex-number-multiplication/'
# Time: O(1)
# Space: O(1)
#
# Description: Leetcode # 537. Complex Number Multiplication
#
# Given two strings representing two complex numbers.
# https://en.wikipedia.org/wiki/Complex_number
#
# A complex number is a number that can be expre... | {
"content_hash": "c1143289ca99b8628463334b00e99aa5",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 117,
"avg_line_length": 29.897058823529413,
"alnum_prop": 0.5757501229709788,
"repo_name": "JulyKikuAkita/PythonPrac",
"id": "7c9c72816505280ea4f8e539d5530b21b02c41f1",
"s... |
import os, sys, subprocess, difflib
from scripts.test.support import run_command, split_wast
print '[ processing and updating testcases... ]\n'
for asm in sorted(os.listdir('test')):
if asm.endswith('.asm.js'):
for precise in [0, 1, 2]:
for opts in [1, 0]:
cmd = [os.path.join('bin', 'asm2wasm'), ... | {
"content_hash": "b3a77666efa9d53378a791ca977a2966",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 154,
"avg_line_length": 40.45374449339207,
"alnum_prop": 0.576608951323097,
"repo_name": "yurydelendik/binaryen",
"id": "76cd02cbbb3fd11935a081e18d2b960d29551315",
"size":... |
from threading import Thread
import subprocess
from time import sleep
import signal
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os
import sys
g_RD_Robot_Roslaunch_Config_Dir = os.environ['RD_SYSTEM_CONFIG_DIR']
g_RD_Robot_Roslaunch_Config_File = os.en... | {
"content_hash": "ad0672d2c38a8a47dfd5b7c30a958e66",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 111,
"avg_line_length": 35.54081632653061,
"alnum_prop": 0.6821705426356589,
"repo_name": "cuixiongyi/setup_workspace",
"id": "f530757f1c8accbc1d5d7bac43720bfaf43af253",
"s... |
import math
from ransac import Ransac, Result
class Line:
def __init__(self, params, x_range, y_range, error):
self.params = params
self.x_range = x_range
self.y_range = y_range
self.error = error
# Ransac: iterations, threshDist, minInlier, threshAngle
ransac = Ransac(20, 50, ... | {
"content_hash": "2f70b611839477e47c9572327ed36667",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 76,
"avg_line_length": 21.285714285714285,
"alnum_prop": 0.6134228187919463,
"repo_name": "BerlinUnited/NaoTH",
"id": "2487675297d3e82744cc52dda72f2e20b45562da",
"size": "7... |
"""
Splunk Search State Module
.. versionadded:: 2015.5.0
This state is used to ensure presence of splunk searches.
.. code-block:: yaml
server-warning-message:
splunk_search.present:
- name: This is the splunk search name
- search: index=main sourcetype=
"""
def __virtual__():
"""
... | {
"content_hash": "f4d8a6609b12cbde368f61540f077163",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 82,
"avg_line_length": 27.76923076923077,
"alnum_prop": 0.5290858725761773,
"repo_name": "saltstack/salt",
"id": "a12ca481e295567542ca52d249f221673d144f27",
"size": "3249"... |
"""List missing tracks.
"""
from beets.autotag import hooks
from beets.library import Item
from beets.plugins import BeetsPlugin
from beets.ui import decargs, print_obj, Subcommand
def _missing_count(album):
"""Return number of missing items in `album`.
"""
return (album.tracktotal or 0) - len(album.items... | {
"content_hash": "c5ee0a94f69de24672b0ac1a27840d36",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 78,
"avg_line_length": 36.87591240875913,
"alnum_prop": 0.47961203483768805,
"repo_name": "andremiller/beets",
"id": "a27be65d1967c35750f76d38689026fdf609c78c",
"size": "5... |
import os
import urlparse
import mock
from oslo.config import cfg
import webob
from webob import exc
import webtest
from neutron.api import api_common
from neutron.api.extensions import PluginAwareExtensionManager
from neutron.api.v2 import attributes
from neutron.api.v2 import base as v2_base
from neutron.api.v2 imp... | {
"content_hash": "a2487d51f98494c409f18f0dab8f9ee7",
"timestamp": "",
"source": "github",
"line_count": 1485,
"max_line_length": 79,
"avg_line_length": 41.96026936026936,
"alnum_prop": 0.5503201681886023,
"repo_name": "citrix-openstack-build/neutron",
"id": "3268bbac18ce92b4671d553849b6cb96930cc881",... |
import errno
import json
import os
from flask import g, session
from flask_babel import Domain
from flask_pluginengine import (Plugin, PluginBlueprintMixin, PluginBlueprintSetupStateMixin, PluginEngine,
current_plugin, render_plugin_template, wrap_in_plugin_context)
from werkzeug.utils ... | {
"content_hash": "229e8ee7793b059b26577fa5c1c5c6d4",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 114,
"avg_line_length": 43.66352201257862,
"alnum_prop": 0.6715160244868563,
"repo_name": "DirkHoffmann/indico",
"id": "43548a68683de84c69107a15c5fe04db29cca91f",
"size": ... |
import mock
import unittest
import responses
import base64
import json
from peewee import SqliteDatabase
from library.item import Item
resps = json.load(open("responses.json"))
class LibraryAddingTestCase(unittest.TestCase):
def setUp(self):
db = SqliteDatabase(":memory:")
Item._meta.database... | {
"content_hash": "9f7f3819c23ceab488e2f39033a3131d",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 96,
"avg_line_length": 44.50420168067227,
"alnum_prop": 0.5818542296072508,
"repo_name": "U2Ft/library",
"id": "868f85cabba3c2c1664d9e09e57f2ef0a21627cf",
"size": "10622",... |
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from horseradish.views import HelpView
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url... | {
"content_hash": "82397e3844891d3b2125a9acce025bf3",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 81,
"avg_line_length": 30.454545454545453,
"alnum_prop": 0.6895522388059702,
"repo_name": "sunlightlabs/horseradish",
"id": "cd0ec72b15d55ba2458517bfd3eac95fe1fb989f",
"siz... |
"""
The package provides different property value editor.
"""
__version__ = "$Revision-Id:$"
| {
"content_hash": "8f5e35ffc6a6db7acba3c4a7740f794c",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 53,
"avg_line_length": 13.375,
"alnum_prop": 0.5887850467289719,
"repo_name": "DLR-SC/DataFinder",
"id": "f648b029a222e443f63d724ef8322059568e2ef0",
"size": "1801",
"binar... |
from setuptools import setup
from pip.req import parse_requirements
import app
install_reqs = parse_requirements('requirements.txt', session=False)
reqs = [ str(i.req) for i in install_reqs ]
setup(name='app',
version="v0.0.4",
description='app',
url='http://github.com/martyni/jenkins_test',
... | {
"content_hash": "d35c4fd9ec4f56c9e5571b5b9098c590",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 68,
"avg_line_length": 27.08695652173913,
"alnum_prop": 0.6115569823434992,
"repo_name": "martyni/boop",
"id": "adaa1cf749c7940a7fd2eac5ca7e0f624ada5790",
"size": "623",
... |
"""
Copyright 2014 Sotera Defense Solutions, Inc.
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 writ... | {
"content_hash": "d53b49edb3830a91f711d8ef00902a6f",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 91,
"avg_line_length": 32.171052631578945,
"alnum_prop": 0.7296523517382413,
"repo_name": "Sotera/Datawake",
"id": "c5070f6a598eb4e7e0f17a963350900e95348fea",
"size": "2445... |
""" Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
... | {
"content_hash": "29ab653d6ffc7a08d59668e3d38fb792",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 84,
"avg_line_length": 34.33552631578947,
"alnum_prop": 0.6008813949032382,
"repo_name": "grupoprog3/proyecto_final",
"id": "21d3b869f7357843ebe4f28447f630f2714c2109",
"si... |
import json
import threading
import importlib
import six
from django.conf import settings
from django.http import HttpResponse
from django.core.serializers.json import DjangoJSONEncoder
from gripcontrol import HttpStreamFormat
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
tlocal =... | {
"content_hash": "8a6946e22463c360cbb85f1c2a939454",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 85,
"avg_line_length": 25.66867469879518,
"alnum_prop": 0.6974888523820699,
"repo_name": "fanout/django-eventstream",
"id": "1980f668df5746d99f23d1d8e06b325810053485",
"si... |
from functools import partial
from robot.errors import DataError
from robot.utils import (is_dict_like, is_list_like, normalize,
RecommendationFinder)
def raise_not_found(name, candidates, msg=None):
"""Raise DataError for missing variable name.
Return recommendations for similar va... | {
"content_hash": "45befea3ced1df78c729865001b30b49",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 71,
"avg_line_length": 37.9,
"alnum_prop": 0.6358839050131926,
"repo_name": "edbrannin/robotframework",
"id": "146fc8a2d46be252baa0b2d22860cc8ff5248c6a",
"size": "1745",
... |
__author__ = 'stefanotranquillini'
| {
"content_hash": "6a498ae8588ef2c775e51db12060be1c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 34,
"avg_line_length": 35,
"alnum_prop": 0.7142857142857143,
"repo_name": "esseti/dododo-dadada",
"id": "1e4ded1c6a4f0c0af8627f82ccec245230701367",
"size": "35",
"binary":... |
import argparse
from os import listdir
from os.path import isfile, join
def count_fathatan(folder_path):
files = [file for file in listdir(folder_path) if isfile(join(folder_path, file))]
before = 0
after = 0
for file in files:
with open(join(folder_path, file), 'r') as f:
lines = f.readlines()
... | {
"content_hash": "f947e681ef83af5c77c1e43e5ac54a2e",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 114,
"avg_line_length": 27.441176470588236,
"alnum_prop": 0.6087888531618435,
"repo_name": "AliOsm/arabic-text-diacritization",
"id": "0bc0e825d3a797e70a03aecefa4907ac1e61e7a... |
"""Nearly exact trust-region optimization subproblem."""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.linalg import (norm, get_lapack_funcs, solve_triangular,
cho_solve)
from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproble... | {
"content_hash": "aa37f16194386b865a02cf4f496aa0f4",
"timestamp": "",
"source": "github",
"line_count": 432,
"max_line_length": 110,
"avg_line_length": 35.861111111111114,
"alnum_prop": 0.5331784146656339,
"repo_name": "gfyoung/scipy",
"id": "2fd1b092ea030ff0d428e08f223922379deb72f1",
"size": "1549... |
'''
OpenShiftCLI class that wraps the oc commands in a subprocess
'''
# pylint: disable=too-many-lines
import atexit
import json
import os
import re
import shutil
import subprocess
import ruamel.yaml as yaml
#import yaml
#
## This is here because of a bug that causes yaml
## to incorrectly handle timezone info on t... | {
"content_hash": "676eb833a5c3a63e7fe66e156acfffec",
"timestamp": "",
"source": "github",
"line_count": 1173,
"max_line_length": 118,
"avg_line_length": 32.690537084398976,
"alnum_prop": 0.5285818599071611,
"repo_name": "jupierce/openshift-tools",
"id": "a64e47ff6d59cd511ba8ef364c57931a4995c1fd",
"... |
import json
from core.err_code import err_desc_ch, OCT_SUCCESS, err_desc_en
from core.log import ERROR
from views.api.center.api import PARAM_NOT_NULL, PARAM_TYPE_INT, PARAM_TYPE_STRING
def appendBaseArg(argObj, request):
if (not argObj):
argObj = {}
argObj["LAST_ADDR"] = request.remote_ip
argObj["REMOTE_ADDR"... | {
"content_hash": "e098572468181d4161ee1d810d542b21",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 82,
"avg_line_length": 22.06086956521739,
"alnum_prop": 0.6342136381553015,
"repo_name": "maqg/wcrobot",
"id": "f1e8b1d658c41e26f8785a965c4ee505ec3a7610",
"size": "2580",
... |
from citrination_client.views.descriptors.descriptor import MaterialDescriptor
class AlloyCompositionDescriptor(MaterialDescriptor):
def __init__(self, key, balance_element, basis=100, threshold=None):
self.options = dict(balance_element=balance_element, basis=basis, threshold=threshold)
super(All... | {
"content_hash": "aba18bc9d81ca837221171bd858c8541",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 94,
"avg_line_length": 43.111111111111114,
"alnum_prop": 0.7680412371134021,
"repo_name": "CitrineInformatics/python-citrination-client",
"id": "45fdf26f35415ba6bd25905a2fd4e3... |
import dotslash
dotslash.export_fbcode_build(
target="//flow/src/facebook/server_callable:server_callable_extract_metadata",
oncall="staticresources",
generated_dotslash_file="flib/intern/build/meerkat/steps/server_callable/bin/server_callable_extract_metadata",
)
| {
"content_hash": "e4d4edaeec96512faf9cad42ec10b088",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 115,
"avg_line_length": 39.714285714285715,
"alnum_prop": 0.7841726618705036,
"repo_name": "nmote/flow",
"id": "26289cba33ac66dfbbb1a2ef2d07438dbeb68181",
"size": "479",
"... |
"""Contains code for loading and preprocessing the CIFAR-10 data."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
from tensorflow.contrib import slim
from tensorflow.contrib.slim import dataset_data_provider
from exte... | {
"content_hash": "e03645fbcc565c14873dad71bcc984ac",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 78,
"avg_line_length": 35.811764705882354,
"alnum_prop": 0.6521024967148489,
"repo_name": "mfigurnov/sact",
"id": "6bcecc77b3ef260faa13435af83179559c3e5e35",
"size": "3722"... |
import json
import logging
from amqp import Connection as AmqpConnection
from amqp.basic_message import Message as AmqpMessage
from urllib.parse import urlparse
from . import base
log = logging.getLogger("tagia.events")
def _make_rabbitmq_connection(url):
parse_result = urlparse(url)
# Parse host & user/p... | {
"content_hash": "ae09597a7a44f2f1fd93165f15ee500a",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 87,
"avg_line_length": 28.11764705882353,
"alnum_prop": 0.6443514644351465,
"repo_name": "mattcongy/itshop",
"id": "829dcf3a2d16955bcee5d594a926cbdd8ef80394",
"size": "2169... |
from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tenma.settings')
app = Celery('tenma')
# Using a string here means the worker will not have to... | {
"content_hash": "c728f765690b2388b47e543525c4bdde",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 66,
"avg_line_length": 30.944444444444443,
"alnum_prop": 0.7648114901256733,
"repo_name": "hmhrex/Tenma",
"id": "84277d91ec222e3786e0aca923ffec714990e205",
"size": "557",
... |
from ..core import db
import datetime
import json
from bson import ObjectId
from ..models import UserModel
class FileModel(db.Document):
"""CoRR backend file model.
Model that represents the meta-data about a file in CoRR.
Attributes:
created_at: A string value of the creation timestamp.
o... | {
"content_hash": "a9cbe75aea07a5762fa491855965278b",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 152,
"avg_line_length": 38.88775510204081,
"alnum_prop": 0.6224088165835738,
"repo_name": "usnistgov/corr",
"id": "144b67b17f018a98735bfd2de94ce8cc989d5f1f",
"size": "3811"... |
import re, sys
if sys.version_info[0] == 3:
from .get_setting import get_setting
else:
from get_setting import get_setting
lower_then_upper_pattern = re.compile('([a-z])([A-Z])')
def module_name(variable_name):
known = known_name(variable_name)
if known:
return known
else:
return ... | {
"content_hash": "0a31dc4e6c5369608b0c8f1a90f5a4eb",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 69,
"avg_line_length": 28.303030303030305,
"alnum_prop": 0.6605995717344754,
"repo_name": "psalaets/QuickRequire",
"id": "a0e45e8a29af92974431f9815da02231849e60d9",
"size":... |
from vt_manager.communication.sfa.rspecs.elements.element import Element
class Position3D(Element):
fields = [
'x',
'y',
'z',
]
| {
"content_hash": "896f5a16236a4acd9ee2105b063f20b6",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 72,
"avg_line_length": 18.444444444444443,
"alnum_prop": 0.5662650602409639,
"repo_name": "avlach/univbris-ocf",
"id": "d74a9359b989b1a8a53e82d71d6c8846451871e8",
"size": "1... |
import time
import random
from collections import OrderedDict
import numpy as np
class TrafficLight(object):
"""A traffic light that switches periodically."""
valid_states = [True, False] # True = NS open, False = EW open
def __init__(self, state=None, period=None):
self.state = state if state... | {
"content_hash": "c5d12ddcd40b666827c6d743aeb16533",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 164,
"avg_line_length": 40.992805755395686,
"alnum_prop": 0.573008073008073,
"repo_name": "drpjm/udacity-mle-project4",
"id": "233fb6c85950bd69275dce69441185656caa4526",
"... |
from builtins import str
from builtins import object
import re
import csv
import unicodecsv
from openelex.base.load import BaseLoader
from openelex.models import RawResult
from openelex.lib.text import ocd_type_id, slugify
from .datasource import Datasource
"""
West Virginia elections have CSV results files for elect... | {
"content_hash": "bb192d98867b42af39744fa5ed51feeb",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 178,
"avg_line_length": 35.75478927203065,
"alnum_prop": 0.5448992713244749,
"repo_name": "openelections/openelections-core",
"id": "c753531bdd4743c1ce74a3f240fd615030210224... |
from test_framework.test_framework import VCoinTestFramework
from test_framework.util import *
class WalletTest (VCoinTestFramework):
def check_fee_amount(self, curr_balance, balance_with_fee, fee_per_byte, tx_size):
"""Return curr_balance after asserting the fee was in range"""
fee = balance_with... | {
"content_hash": "38c30ca39f4cf1ec809943972064e47a",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 164,
"avg_line_length": 42.743589743589745,
"alnum_prop": 0.6174479389836318,
"repo_name": "vcoin-project/v",
"id": "c3df9735c10f08fc039583bce2ccc6ab4b34a600",
"size": "11... |
from django.conf import settings
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from django.contrib.auth import get_user_model
from registration import signals
from registration.models import RegistrationProfile
from registration.views import ActivationView as BaseActi... | {
"content_hash": "e8ad7bdc92b2b9ccb4cfb54165893475",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 128,
"avg_line_length": 40.83802816901409,
"alnum_prop": 0.6282117606483877,
"repo_name": "raulgarreta/django-registration",
"id": "d0eff2abd7b892018dc9ec2d42b0da119b886e16"... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
become: pfexec
short_description: profile based execution
description:
- This become plugins allows your remote/login user to execute commands as another user via the pfexec utility.
auth... | {
"content_hash": "9b9777e8c145349038329687e656143e",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 125,
"avg_line_length": 34.71287128712871,
"alnum_prop": 0.5362236166571591,
"repo_name": "thaim/ansible",
"id": "cef870a6d61860cb6deb6d1bb7fa4fcbd554bc28",
"size": "3662"... |
import copy
import inspect
import logging
from functools import partialmethod
from gen.exceptions import ValidationError
from pkgpanda.util import json_prettyprint
log = logging.getLogger(__name__)
def get_function_parameters(function):
return set(inspect.signature(function).parameters)
def validate_arguments... | {
"content_hash": "006568810e37e75d033394813f0e8d4e",
"timestamp": "",
"source": "github",
"line_count": 466,
"max_line_length": 120,
"avg_line_length": 38.9206008583691,
"alnum_prop": 0.6088107184209075,
"repo_name": "xinxian0458/dcos",
"id": "866cce04d40e06db900a0d00e7363c9cbf856eb3",
"size": "181... |
import optparse
import os
import shlex
import sys
import textwrap
from . import version
_DEFAULT_PARALLELISM = 32
_DEFAULT_TIMEOUT = 0 # "infinity" by default
def common_parser():
"""
Create a basic OptionParser with arguments common to all pssh programs.
"""
# The "resolve" conflict handler avo... | {
"content_hash": "5836e12d28f69424d04497e295077686",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 77,
"avg_line_length": 40.234234234234236,
"alnum_prop": 0.5989699955217197,
"repo_name": "rlewczuk/pssh",
"id": "2eb14ac05bf75ec24a24066433d6b0e54ab40fcc",
"size": "4549"... |
from urllib.error import URLError
from urllib.request import urlopen
import re
import pymysql
import ssl
from pymysql import Error
# 通过指定的字符集对页面进行解码(不是每个网站都将字符集设置为utf-8)
def decode_page(page_bytes, charsets=('utf-8',)):
page_html = None
for charset in charsets:
try:
page_html = page_byte... | {
"content_hash": "b0fd450d5c06e1c575863ecac2852704",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 96,
"avg_line_length": 34.75,
"alnum_prop": 0.539568345323741,
"repo_name": "tzpBingo/github-trending",
"id": "981213895e966a8e16760b7ba7de6ad109d5868e",
"size": "3125",
... |
from io import StringIO
import numpy as np
import pytest
import pandas as pd
from .base import BaseExtensionTests
class BaseParsingTests(BaseExtensionTests):
@pytest.mark.parametrize('engine', ['c', 'python'])
def test_EA_types(self, engine, data):
df = pd.DataFrame({
'with_dtype': pd.... | {
"content_hash": "77f9a572a626bf6afec75ad3c615fabf",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 64,
"avg_line_length": 27.17391304347826,
"alnum_prop": 0.6352,
"repo_name": "cbertinato/pandas",
"id": "22787c38b66fbc99b89efca33faac0b7604974cc",
"size": "625",
"binary... |
"""Tests for the JSON lines output module."""
import json
import os
import sys
import unittest
from plaso.formatters import manager as formatters_manager
from plaso.lib import timelib
from plaso.output import json_line
from tests.cli import test_lib as cli_test_lib
from tests.output import test_lib
class JSONLines... | {
"content_hash": "4a00b2e4b7873168207e552c9d0d9c69",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 73,
"avg_line_length": 34.734693877551024,
"alnum_prop": 0.6383666274970623,
"repo_name": "ostree/plaso",
"id": "d5e3f43b4942f9b36a21f925a7672d57b02f59cc",
"size": "3446",
... |
from decimal import Decimal
import pytest
from stellar_sdk import (
AiohttpClient,
Asset,
MuxedAccount,
Network,
ServerAsync,
TransactionEnvelope,
)
from stellar_sdk.account import Thresholds
from stellar_sdk.call_builder.call_builder_async import *
@pytest.mark.slow
@pytest.mark.asyncio
cla... | {
"content_hash": "704259e2afa77b6c06bdfcf563149f46",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 296,
"avg_line_length": 46.80120481927711,
"alnum_prop": 0.6392071051615394,
"repo_name": "StellarCN/py-stellar-base",
"id": "191efc6e5ba911fd3c4050fc0d92f156b2245e6f",
"s... |
"""This module contains Google Dataproc Metastore operators."""
from datetime import datetime
from time import sleep
from typing import TYPE_CHECKING, Dict, List, Optional, Sequence, Tuple, Union
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
from google.api_core.retry import Retry, exponential_s... | {
"content_hash": "33d03d1cb1df579a7ffd632fab4e7628",
"timestamp": "",
"source": "github",
"line_count": 1108,
"max_line_length": 110,
"avg_line_length": 44.72563176895307,
"alnum_prop": 0.6471264831705545,
"repo_name": "Acehaidrey/incubator-airflow",
"id": "4bdf519d2f5b548a184e80260aaa0dab8a58e151",
... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
qualities,
)
class TeacherTubeIE(InfoExtractor):
IE_NAME = 'teachertube'
IE_DESC = 'teachertube.com videos'
_VALID_URL = r'https?://(?:www\.)?teachertube\... | {
"content_hash": "710236b39a7232c8ae419d7d89a8876f",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 145,
"avg_line_length": 34.3828125,
"alnum_prop": 0.5480572597137015,
"repo_name": "aboutsajjad/Bridge",
"id": "1272078c50b8703aa906e055fc57842078542e95",
"size": "4417",
... |
from gui_lib.textline import Textline
from productSuggestion import findSuggestion
import gui_lib.core as core
import curses
class ProductLine (Textline):
def __init__(self, width, attribute=curses.A_NORMAL, attribute_suggestion=curses.A_REVERSE):
super(ProductLine,self).__init__(width, "", attribute)
self.sugge... | {
"content_hash": "cca836f7f42b13b8ab663ccaa530373d",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 93,
"avg_line_length": 32.357142857142854,
"alnum_prop": 0.7071376011773363,
"repo_name": "davidv1992/madmin",
"id": "dcc137b48051b66e0118bef8d4632e649c591386",
"size": "13... |
#!/usr/bin/env python
from __future__ import print_function
import os, sys, re, string, io
# the list only for debugging. The real list, used in the real OpenCV build, is specified in CMakeLists.txt
opencv_hdr_list = [
"../../core/include/opencv2/core.hpp",
"../../core/include/opencv2/core/ocl.hpp",
"../../flann/incl... | {
"content_hash": "315dfb7f3d28d296036e403b0e05e623",
"timestamp": "",
"source": "github",
"line_count": 880,
"max_line_length": 142,
"avg_line_length": 39.16136363636364,
"alnum_prop": 0.4521792118855551,
"repo_name": "apavlenko/opencv",
"id": "ea32a17e76bebb27d6aeb916747f29f191676885",
"size": "34... |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(247, 195)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.edit_text = QtWi... | {
"content_hash": "175359c13d5bef90fefad14c8be39576",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 106,
"avg_line_length": 43.925925925925924,
"alnum_prop": 0.7209106239460371,
"repo_name": "GandaG/fomod-editor",
"id": "48689d918c528f6ed2390af594fe63d543ad0428",
"size": ... |
from __future__ import unicode_literals
from captcha.fields import CaptchaField
from django import forms
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.forms import PasswordInput
from djanban.apps.password_reseter.models import PasswordResetRequest
# Reque... | {
"content_hash": "d83c93722cba637208388c07d00e04f0",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 95,
"avg_line_length": 39.40425531914894,
"alnum_prop": 0.7143628509719222,
"repo_name": "diegojromerolopez/djanban",
"id": "b0a383098efe753bce9053c892e4f4e36fd0874d",
"siz... |
import unittest
import logging
import subprocess
from tempfile import mkdtemp
import time
import socket
import pymongo
from tests.common import load_check
from nose.plugins.skip import SkipTest
PORT1 = 37017
PORT2 = 37018
MAX_WAIT = 150
class TestMongo(unittest.TestCase):
def wait4mongo(self, process, port):
... | {
"content_hash": "6b7ee0dd90959aa24496406dfdfde8e0",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 97,
"avg_line_length": 36.114155251141554,
"alnum_prop": 0.49424706031103804,
"repo_name": "sapcc/monasca-agent",
"id": "c3a42e13d912c0a7af448a09c25a96bf882bbd84",
"size":... |
from rsqueakvm import constants, storage_classes
from rsqueakvm.model.numeric import W_Float, W_SmallInteger, W_LargeIntegerWord, W_LargeIntegerBig
from rsqueakvm.model.variable import W_BytesObject
from .util import read_image, open_reader, copy_to_module, cleanup_module, InterpreterForTest, slow_test, very_slow_test... | {
"content_hash": "1048dbc1f4a48028dd8217cd301c9a2b",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 151,
"avg_line_length": 44.204301075268816,
"alnum_prop": 0.6256385307711019,
"repo_name": "HPI-SWA-Lab/RSqueak",
"id": "c10c1827be5cceca8a82262f197e5605a1bd7e2f",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.