repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
ollie314/kafka
tests/kafkatest/services/verifiable_producer.py
4
11845
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
7,249,880,353,434,015,000
43.530075
156
0.62195
false
Drooids/pixie
pixie/vm/symbol.py
9
2435
import pixie.vm.object as object from pixie.vm.primitives import nil, true, false import pixie.vm.stdlib as proto from pixie.vm.code import extend, as_var from pixie.vm.string import String import pixie.vm.rt as rt import pixie.vm.util as util from rpython.rlib.rarithmetic import intmask class Symbol(object.Object): ...
gpl-3.0
-5,686,724,152,103,560,000
24.364583
57
0.607392
false
shy1/language-model
loaders.py
1
21164
import torch import numpy as np from torch.utils.data import Dataset import pickle class MooreMnistNoESN(Dataset): def __init__(self, U1, h_size, tvt='train', bs=1, lastonly=False, chunkfile='../data/mooreQ4_mnist_tvt.p', chunklen=112, leakrate=0.4405): torch.manual_seed(481639) self.bs = bs ...
mit
2,207,616,866,653,465,900
39.857143
175
0.585003
false
tchellomello/home-assistant
homeassistant/components/dyson/__init__.py
15
3790
"""Support for Dyson Pure Cool Link devices.""" import logging from libpurecool.dyson import DysonAccount import voluptuous as vol from homeassistant.const import CONF_DEVICES, CONF_PASSWORD, CONF_TIMEOUT, CONF_USERNAME from homeassistant.helpers import discovery import homeassistant.helpers.config_validation as cv ...
apache-2.0
1,037,927,715,431,638,800
33.454545
88
0.57467
false
CenterForOpenScience/osf.io
osf/migrations/0217_auto_20200901_1344.py
5
3012
# -*- coding: utf-8 -*- # Generated by Django 1.11.28 on 2020-09-01 13:44 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields import osf.models.base class Migration(migrations.Migration):...
apache-2.0
-6,658,548,878,453,231,000
54.777778
392
0.617862
false
tdickers/mitmproxy
mitmproxy/console/statusbar.py
1
8853
from __future__ import absolute_import, print_function, division import os.path import urwid import netlib.http.url from mitmproxy.console import common from mitmproxy.console import pathedit from mitmproxy.console import signals from netlib import human class ActionBar(urwid.WidgetWrap): def __init__(self): ...
mit
-7,069,500,458,238,586,000
32.157303
78
0.524229
false
JaDogg/__py_playground
reference/regexercise_solutions/star_thompsonlike.py
1
2793
# Let's refactor star.py into an almost-Thompson algorithm. The idea: # represent a regex with tree nodes augmented with a 'chain' link that # can be cyclic. The nodes plus the chains form the Thompson NFA # graph, but a node can be labeled with 'star' (as well as Thompson's # 'literal' and 'either' nodes), and we deri...
mit
2,683,971,662,512,472,000
37.791667
77
0.653419
false
JuliBakagianni/CEF-ELRC
metashare/accounts/forms.py
1
10331
from django import forms from metashare.accounts.models import UserProfile, EditorGroupApplication, \ OrganizationApplication, Organization, OrganizationManagers, EditorGroup, \ EditorGroupManagers from django.conf import settings from django.contrib.admin import widgets from django.contrib.auth.models import U...
bsd-3-clause
4,879,277,122,939,481,000
34.624138
116
0.609234
false
mlperf/training_results_v0.7
DellEMC/benchmarks/ssd/implementation/mxnet/ssd/ssd.py
2
21005
"""Single-shot Multi-box Detector.""" import os import logging import warnings import mxnet as mx from mxnet import autograd from mxnet.gluon import nn from mxnet.gluon import HybridBlock import numpy as np from .feature import FeatureExpander from .predictor import ConvPredictor from .initializer import SegmentedXavie...
apache-2.0
-3,945,837,907,396,751,000
49.736715
119
0.599952
false
AnderEnder/ansible-modules-extras
cloud/amazon/ec2_vpc_nacl_facts.py
41
6485
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
6,437,807,812,871,315,000
31.263682
122
0.614341
false
mr-cloud/deep-learning-udacity
dl_assignment_5_skip_gram.py
1
9990
# %matplotlib inline from __future__ import print_function import collections import math import numpy as np import os import random import tensorflow as tf import zipfile from matplotlib import pylab from six.moves import range from six.moves.urllib.request import urlretrieve from sklearn.manifold import TSNE url = '...
mit
-3,382,668,822,822,092,300
41.151899
200
0.631932
false
point97/hapifis
server/apps/survey/migrations/0036_auto__add_questionreport__del_field_question_filterBy__del_field_quest.py
1
7859
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'QuestionReport' db.create_table(u'survey_questionreport', ( (u'question_ptr', se...
gpl-3.0
-8,521,616,064,779,723,000
67.947368
207
0.560249
false
rahulxxarora/Jango
jango/jango.py
1
1056
import ConfigParser import os import jangopath, start, conversation, brain, internet os.system('clear') Config = ConfigParser.ConfigParser() class Jango(object): def __init__(self): if not os.path.exists(jangopath.CONFIG_PATH): try: start.add_name() except: print...
mit
-7,003,552,034,308,671,000
26.076923
71
0.508523
false
airbnb/airflow
tests/kubernetes/test_client.py
7
2353
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-3,945,609,550,655,575,600
44.25
103
0.740756
false
sephii/django
django/db/models/query.py
3
70946
""" The main QuerySet implementation. This provides the public API for the ORM. """ from collections import deque, OrderedDict import copy import sys import warnings from django.conf import settings from django.core import exceptions from django.db import (connections, router, transaction, IntegrityError, DJANGO_...
bsd-3-clause
5,755,617,676,152,921,000
39.310227
115
0.587729
false
tebriel/dd-agent
emitter.py
5
2388
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from hashlib import md5 import logging import re import zlib # 3p import requests import simplejson as json # project from config import get_version from utils.proxy import set_no_proxy_settings set_no...
bsd-3-clause
-7,868,835,654,060,473,000
27.428571
106
0.659129
false
sftd/scons
scons-local/SCons/Tool/aixlink.py
8
2592
"""SCons.Tool.aixlink Tool-specific initialization for the IBM Visual Age linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ...
mit
1,863,498,434,286,081,300
33.105263
119
0.711806
false
z1gm4/desarrollo_web_udp
env/lib/python2.7/site-packages/faker/providers/internet/el_GR/__init__.py
19
2593
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as InternetProvider import re from faker.utils.decorators import slugify_domain class Provider(InternetProvider): free_email_domains = ( 'hol.gr', 'gmail.com', 'hotmail.gr', 'yahoo.gr', 'googlemail.gr', 'otenet.gr', '...
gpl-3.0
-4,999,783,161,999,809,000
29.7875
78
0.569225
false
jdrumgoole/dejooper
testtools/randomutils.py
1
6051
''' Created on 30 Nov 2010 @author: jdrumgoole ''' import tempfile import os import random import string class RandomName: ''' Create random path name. If rootDir is not specified create file in default location for OS. ''' def __init__(self, rootDir=None) : t = ...
gpl-2.0
2,977,071,326,094,057,000
25.134529
86
0.456949
false
kakunbsc/enigma2.4
lib/python/Screens/ParentalControlSetup.py
3
10759
from Screen import Screen from Components.ConfigList import ConfigListScreen from Components.ActionMap import NumberActionMap from Components.config import config, getConfigListEntry, ConfigNothing, NoSave, ConfigPIN from Components.ParentalControlList import ParentalControlEntryComponent, ParentalControlList from Com...
gpl-2.0
-2,336,692,732,549,722,600
37.288256
239
0.73715
false
akatsoulas/mozillians
mozillians/users/search_indexes.py
3
3651
from haystack import indexes from mozillians.groups.models import GroupMembership from mozillians.users.models import IdpProfile, UserProfile class UserProfileIndex(indexes.SearchIndex, indexes.Indexable): """User Profile Search Index.""" # Primary field of the index text = indexes.CharField(document=Tru...
bsd-3-clause
-7,219,976,596,618,334,000
40.965517
80
0.699534
false
sbesson/PyGithub
tests/Tag.py
3
2956
############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
lgpl-3.0
6,708,066,951,284,296,000
56.960784
94
0.4523
false
KimTaehee/eucalyptus
clc/eucadmin/eucadmin/describecloudwatch.py
6
1525
# Copyright 2011-2014 Eucalyptus Systems, Inc. # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of source code must retain the above copyright notice, # this list of conditions ...
gpl-3.0
-409,709,941,847,747,260
49.833333
74
0.789508
false
dmargala/tpcorr
examples/plugmap.py
1
12679
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np import sys,os import string import math import argparse def read_plugmap(filename): debug=False file=open(filename,"r") doc={} intypedef=False indices={} indices["HOLETYPE"]=8 indices["OBJECT"]=21 indices["ra"]=9...
mit
8,056,772,923,345,085,000
34.024862
259
0.568736
false
wscullin/spack
var/spack/repos/builtin/packages/py-slepc4py/package.py
3
1684
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
5,777,832,457,175,649,000
43.315789
81
0.671615
false
sammyshj/stem
test/network.py
1
9720
# Copyright 2012-2016, Damian Johnson and The Tor Project # See LICENSE for licensing information """ Helper functions and classes to support tests which need to connect through the tor network. :: ProxyError - Base error for proxy issues. +- SocksError - Reports problems returned by the SOCKS proxy. Socks ...
lgpl-3.0
3,488,182,803,070,852,000
27.84273
129
0.666975
false
tinloaf/pygooglevoice
googlevoice/settings.py
1
1604
DEFAULT_CONFIG = """ [auth] # Google Account email address (one associated w/ your Voice account) email= # Raw password used or login password= [gvoice] # Number to place calls from (eg, your google voice number) forwardingNumber= # Default phoneType for your forwardingNumber as defined below # 1 - Hom...
bsd-3-clause
4,204,385,564,621,041,700
27.703704
72
0.65586
false
postlund/home-assistant
homeassistant/scripts/benchmark/__init__.py
3
4649
"""Script to run benchmarks.""" import argparse import asyncio from contextlib import suppress from datetime import datetime import logging from timeit import default_timer as timer from typing import Callable, Dict from homeassistant import core from homeassistant.const import ATTR_NOW, EVENT_STATE_CHANGED, EVENT_TIM...
apache-2.0
3,715,476,771,603,199,000
23.860963
85
0.625511
false
perseas/Pyrseas
pyrseas/testutils.py
1
14719
# -*- coding: utf-8 -*- """Utility functions and classes for testing Pyrseas""" import sys import os import getpass import tempfile import glob import subprocess from unittest import TestCase import yaml from pyrseas.config import Config from pyrseas.database import Database from pyrseas.augmentdb import AugmentData...
bsd-3-clause
-5,852,404,436,829,119,000
34.725728
79
0.569876
false
dennytwix/pukanoid_server
models/shoot.py
1
3068
# -*- coding: utf-8 -*- # # Author: Den Schigrov <dennytwix@gmail.com> # Created: 2/21/15 # # Id: $ import math from settings import SCENE_SIZE, MIN_ACCEL, MAX_ACCEL __author__ = 'den' from position import Position class Shoot(object): user = None target = None position = None speed = None streng...
gpl-2.0
-3,182,409,513,579,587,000
32.725275
101
0.539113
false
alirazabhayani/django_workshop_poll_app
mysite/settings.py
10
5485
import os # Django settings for mysite project. DEBUG = True TEMPLATE_DEBUG = DEBUG BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_p...
bsd-3-clause
1,809,541,827,269,230,800
32.858025
127
0.687511
false
peterheim1/robbie_ros
robbie_bringup/nodes/arm_driver_lower.py
1
19253
#!/usr/bin/env python ''' left elbow is in upper arm controller Created March, 2012 @author: Peter Heim r_shoulder.py - gateway to Arduino based arm controller Copyright (c) 2011 Peter Heim. All right reserved. Borrowed heavily from Mike Feguson's ArbotiX base_controller.py code. Redistribution and use in s...
bsd-3-clause
3,432,607,577,818,463,700
42.756818
116
0.496754
false
syscoin/syscoin2
test/functional/p2p_feefilter.py
1
4083
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test processing of feefilter messages.""" from decimal import Decimal import time from test_framework...
mit
4,278,274,206,910,500,000
38.259615
96
0.654421
false
davogler/POSTv3
video/migrations/0001_initial.py
2
15947
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'VideoCategory' db.create_table(u'video_videocategory', ( (u'id', self.gf('django...
mit
1,938,429,100,586,387,700
73.176744
160
0.563868
false
jjmiranda/edx-platform
lms/djangoapps/shoppingcart/utils.py
23
2848
""" Utility methods for the Shopping Cart app """ from django.conf import settings from pdfminer.pdfparser import PDFParser from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import PDFPageAggregator from pdfminer.pdfpage import PD...
agpl-3.0
6,958,614,517,140,344,000
37.486486
102
0.718048
false
bxlab/HiFive_Paper
Scripts/HiCLib/bx-python-0.7.1/build/scripts-2.7/axt_extract_ranges.py
1
1710
#!/galaxy/home/mgehrin/hiclib/bin/python """ Reads a list of intervals and an axt. Produces a new axt containing the portions of the original that overlapped the intervals usage: %prog interval_file refindex [options] < axt_file -m, --mincols=10: Minimum length (columns) required for alignment to be output """ im...
bsd-3-clause
-6,113,938,122,197,647,000
24.147059
86
0.694152
false
StackStorm/mistral
mistral/rpc/base.py
1
5334
# Copyright 2015 - Mirantis, Inc. # Copyright 2017 - Brocade Communications Systems, 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/LI...
apache-2.0
9,079,687,660,797,999,000
27.677419
78
0.659918
false
shaunstanislaus/ibis
ibis/expr/types.py
5
34443
# Copyright 2014 Cloudera 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 writing, so...
apache-2.0
6,730,388,602,279,921,000
22.721074
79
0.576634
false
jazkarta/edx-platform-for-isc
common/djangoapps/course_modes/views.py
7
11696
""" Views for the course_mode module """ import decimal from django.core.urlresolvers import reverse from django.conf import settings from django.http import HttpResponse, HttpResponseBadRequest from django.shortcuts import redirect from django.views.generic.base import View from django.utils.translation import ugette...
agpl-3.0
4,550,272,164,827,110,000
41.842491
127
0.628505
false
frankrousseau/weboob
modules/hds/browser.py
7
1785
# -*- coding: utf-8 -*- # Copyright(C) 2011 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
agpl-3.0
-1,714,818,095,203,303,000
30.315789
83
0.664986
false
amjith/python-prompt-toolkit
examples/inputhook.py
3
2374
#!/usr/bin/env python """ An example that demonstrates how inputhooks can be used in prompt-toolkit. An inputhook is a callback that an eventloop calls when it's idle. For instance, readline calls `PyOS_InputHook`. This allows us to do other work in the same thread, while waiting for input. Important however is that w...
bsd-3-clause
5,060,993,980,679,099,000
28.675
79
0.675653
false
starrify/scrapy
tests/test_utils_conf.py
6
8337
import unittest import warnings from scrapy.exceptions import UsageError, ScrapyDeprecationWarning from scrapy.settings import BaseSettings, Settings from scrapy.utils.conf import ( arglist_to_dict, build_component_list, feed_complete_default_values_from_settings, feed_process_params_from_cli ) class...
bsd-3-clause
5,297,211,060,372,712,000
39.275362
117
0.537603
false
kipel/koans
python_koans/python3/koans/about_packages.py
3
1966
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This is very different to AboutModules in Ruby Koans # Our AboutMultipleInheritance class is a little more comparable # from runner.koan import * # # Package hierarchy of Python Koans project: # # contemplate_koans.py # koans/ # __init__.py # about_asserts.py...
mit
-5,767,290,267,459,299,000
31.766667
80
0.64293
false
lgp171188/fjord
vendor/packages/requests-mock-0.6.0/requests_mock/tests/test_mocker.py
6
7756
# 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 writing, software # distributed under t...
bsd-3-clause
494,551,888,883,112,600
30.657143
75
0.63164
false
alanhdu/nycodex
nycodex/db/tests/test_db_utils.py
1
1431
import sqlalchemy as sa from nycodex import db from nycodex.db.utils import UpsertMixin class FakeTable(db.Base, UpsertMixin): __tablename__ = "_fake_table" id = sa.Column(sa.CHAR(9), primary_key=True) name = sa.Column(sa.TEXT, nullable=False) description = sa.Column(sa.TEXT, nullable=True) def...
apache-2.0
-7,484,325,156,101,321,000
30.108696
72
0.628931
false
aam-at/tensorflow
tensorflow/python/data/experimental/kernel_tests/directed_interleave_dataset_test.py
4
6475
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
apache-2.0
2,018,000,628,903,052,800
40.242038
80
0.684942
false
wuyuewen/libcloud
libcloud/test/test_httplib_ssl.py
6
7967
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
791,290,166,524,662,300
36.228972
94
0.649303
false
CloudVLab/professional-services
examples/dataflow-data-generator/data-generator-pipeline/data_generator/ParquetUtil.py
2
5795
# Copyright 2018 Google 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 writing,...
apache-2.0
2,268,106,221,893,970,000
38.965517
81
0.546678
false
11craft/django-cms
menus/models.py
31
1490
# -*- coding: utf-8 -*- from django.db import models class CacheKeyManager(models.Manager): def get_keys(self, site_id=None, language=None): ret = self.none() if not site_id and not language: # Both site and language are None - return everything ret = self.all() e...
bsd-3-clause
-547,477,670,997,914,100
35.341463
77
0.628859
false
VanirAOSP/external_chromium_org
base/android/jni_generator/jni_generator.py
13
40471
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Extracts native methods from a Java file and generates the JNI bindings. If you change this, please run and update the tests."""...
bsd-3-clause
-8,794,100,382,105,297,000
35.493237
80
0.61187
false
masamichi/bite-project
deps/gdata-python-client/tests/gdata_tests/sites/data_test.py
41
12028
#!/usr/bin/python # # Copyright 2009 Google Inc. All Rights Reserved. # # 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 b...
apache-2.0
-3,139,683,034,235,437,600
39.635135
80
0.694879
false
voriux/Flexget
flexget/plugins/urlrewrite_newpct.py
1
1778
from __future__ import unicode_literals, division, absolute_import import logging import re from flexget import plugin from flexget.event import event from flexget.plugins.plugin_urlrewriting import UrlRewritingError from flexget.utils.requests import Session from flexget.utils.soup import get_soup log = logging.getL...
mit
-7,639,031,589,375,727,000
34.56
110
0.668166
false
bqlabs/aditi
engine/board.py
1
2382
# -*- coding: utf-8 -*- # This file is part of the Aditi Project __author__ = 'Jesús Arroyo Torrens' __email__ = 'jesus.arroyo@bq.com' __copyright__ = 'Copyright (c) 2015 Mundo Reader S.L.' __license__ = 'GPLv2' import math import serial class Board: def __init__(self, serial_name='/dev/ttyUSB0', baud_rate=1152...
gpl-2.0
-6,809,369,366,323,037,000
33.014286
89
0.51407
false
ebigelow/LOTlib
LOTlib/Performance/Chains/run.py
3
3269
# -*- coding: utf-8 -*- """ Simple evaluation of number schemes -- read LOTlib.Performance.Evaluation to see what the output is """ import re import os from itertools import product from optparse import OptionParser import LOTlib from LOTlib.MPI.MPI_map import MPI_map, get_rank from LOTlib.Examples.ExampleLoa...
gpl-3.0
-3,677,784,559,772,681,700
45.7
234
0.587641
false
Teagan42/home-assistant
tests/components/device_sun_light_trigger/test_init.py
1
6726
"""The tests device sun light trigger component.""" # pylint: disable=protected-access from datetime import datetime from asynctest import patch import pytest from homeassistant.components import ( device_sun_light_trigger, device_tracker, group, light, ) from homeassistant.components.device_tracker.c...
apache-2.0
8,488,034,777,266,015,000
33.142132
88
0.610021
false
tboyce1/home-assistant
homeassistant/components/remote/demo.py
12
1999
""" Demo platform that has two fake remotes. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ from homeassistant.components.remote import RemoteDevice from homeassistant.const import DEVICE_DEFAULT_NAME # pylint: disable=unused-argument def setup_...
apache-2.0
-4,015,652,823,068,701,700
27.557143
76
0.615808
false
xingyepei/edx-platform
openedx/core/lib/json_utils.py
2
2002
""" Utilities for dealing with JSON. """ import json import simplejson from xmodule.modulestore import EdxJSONEncoder class EscapedEdxJSONEncoder(EdxJSONEncoder): """ Class for encoding edx JSON which will be printed inline into HTML templates. """ def encode(self, obj): """ Enco...
agpl-3.0
6,519,357,546,602,676,000
27.6
88
0.649351
false
kumasento/mwparserfromhell
mwparserfromhell/nodes/template.py
1
13302
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2014 Ben Kurtovic <ben.kurtovic@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation ...
mit
6,700,506,774,143,693,000
39.309091
102
0.587205
false
esatterwhite/django-tastypie
tests/core/tests/api.py
19
7559
from django.contrib.auth.models import User from django.http import HttpRequest from django.test import TestCase from tastypie.api import Api from tastypie.exceptions import NotRegistered, BadRequest from tastypie.resources import Resource, ModelResource from tastypie.serializers import Serializer from core.models impo...
bsd-3-clause
4,648,074,153,289,140,000
40.081522
336
0.631168
false
IONISx/XBlock
xblock/django/request.py
1
4267
"""Helpers for WebOb requests and responses.""" import webob from collections import MutableMapping from lazy import lazy from itertools import chain, repeat, izip from webob.multidict import MultiDict, NestedMultiDict, NoVars def webob_to_django_response(webob_response): """Returns a django response to the `web...
agpl-3.0
-5,832,340,283,420,002,000
27.637584
100
0.626435
false
pieleric/odemis
src/odemis/acq/test/path_test.py
2
66771
# -*- coding: utf-8 -*- """ @author: Kimon Tsitsikas Copyright © 2015 Kimon Tsitsikas, Delmic This file is part of Odemis. Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. Odemis is distributed...
gpl-2.0
6,271,077,439,538,759,000
41.938907
129
0.627692
false
saai/codingbitch
isValidBST.py
2
1648
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # @param {TreeNode} root # @return {boolean} def isValidBST(self, root): p = root st = [] last_pop = None...
mit
-212,683,786,284,806,880
28.428571
70
0.376214
false
candrews/portage
pym/portage/tests/resolver/test_or_choices.py
9
7699
# Copyright 2013-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, ResolverPlaygroundTestCase) class OrChoicesTestCase(TestCase): def testOrChoices(self): ebuilds ...
gpl-2.0
-9,205,452,362,723,772,000
21.511696
84
0.570594
false
MingzeGao2/get-me-to-course
project/user/views.py
1
5584
# project/user/views.py ################# #### imports #### ################# from flask import render_template, Blueprint, url_for, \ redirect, flash, request from flask.ext.login import login_user, logout_user, \ login_required, current_user from project.models import User, Job # from project.email import...
mit
-6,966,973,863,566,849,000
29.850829
80
0.646132
false
gaetjen/TNSII_Exercises
extra/src/inference.py
1
8367
import numpy as np # give the corresponding posterior distribution of stimulus parameters, given the response def postsGivenResp(bins, posts, response, preferred=0): assert 0 <= preferred <= (2 * np.pi), "preferred should be in range 0, 2π" idx = np.argmin(np.abs(bins[2][:-1] - response)) slc = posts[:, :...
mit
-451,206,784,512,374,400
38.462264
115
0.619173
false
mahak/neutron
neutron/conf/db/migration_cli.py
2
1618
# 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 writing, software # d...
apache-2.0
-7,220,733,286,932,805,000
32.020408
78
0.644623
false
dhocker/athomepowerlineserver
meross_asyncio_test.py
1
6673
# # Meross smart plug device driver research on meross-iot package # Copyright © 2019, 2021 Dave Hocker # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # See the L...
gpl-3.0
-8,285,276,633,365,532,000
40.962264
113
0.598171
false
jdaigneau/geoq
geoq/core/migrations/0017_auto__add_field_organization_order.py
6
14698
# -*- coding: utf-8 -*- 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 'Organization.order' db.add_column(u'core_organization', 'order', self....
mit
-591,987,638,085,479,700
82.994286
209
0.546537
false
gwaldo/graphite-web
webapp/tests/test_render_glyph.py
2
39041
import copy from .base import TestCase from graphite.render import glyph from graphite.render.datalib import TimeSeries class glyphStandaloneFunctionTest(TestCase): from datetime import datetime, timedelta dt = datetime(2016, 6, 16, 15, 55, 38) dt2 = datetime(2016, 6, 17, 15, 55, 38) # Convenience f...
apache-2.0
-2,329,018,277,925,466,600
37.501972
121
0.640122
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_ip_configuration.py
1
3088
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
2,355,536,799,078,311,400
45.787879
103
0.638925
false
brainelectronics/towerdefense
_build/lib/pyglet/input/__init__.py
22
7262
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bsd-3-clause
8,682,007,182,520,372,000
40.261364
79
0.686312
false
bloyl/mne-python
mne/io/tests/test_reference.py
4
29830
# Authors: Marijn van Vliet <w.m.vanvliet@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Teon Brooks <teon.brooks@gmail.com> # # License: BSD (3-clause) from contextlib import nullcontext import itertools import os.path as op import numpy as np from numpy.testing import assert_array...
bsd-3-clause
-7,187,628,156,254,887,000
43.389881
822
0.626852
false
gypleon/codesCloud
dm/6_cohesion_separation.py
1
2290
#!/usr/local/bin/python3 import numpy as np def load_data(data_path): points = list() with open(data_path, 'r') as f: lines = f.readlines() for line in lines: point_str = line.strip("\n").split("\t") points.append([float(point_str[0]), float(point_str[1])]) poin...
apache-2.0
8,754,231,497,710,029,000
25.022727
69
0.546725
false
spacetelescope/asv
test/test_statistics.py
2
14323
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import warnings from itertools import product import math import random import pytest from asv.util import inf import a...
bsd-3-clause
911,863,461,428,725,800
28.777547
93
0.553096
false
MihaiMoldovanu/ansible
lib/ansible/modules/network/dellos10/dellos10_facts.py
27
15059
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # Copyright (c) 2017 Dell Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_versio...
gpl-3.0
-6,217,662,363,451,889,000
28.819802
129
0.600239
false
neerajvashistha/pa-dude
lib/python2.7/site-packages/numpy/distutils/ccompiler.py
19
24182
from __future__ import division, absolute_import, print_function import re import os import sys import types from copy import copy from distutils.ccompiler import * from distutils import ccompiler from distutils.errors import DistutilsExecError, DistutilsModuleError, \ DistutilsPlatformEr...
mit
-3,853,528,672,822,627,000
33.995658
97
0.578488
false
yutkin/News-Aggregator
web_server/parsers/Tass.py
2
2289
import requests import datetime import logging import re from bs4 import BeautifulSoup from .BaseParser import BaseParser import time from multiprocessing import cpu_count class Tass(BaseParser): """docstring for Tass""" def __init__(self, threads=cpu_count()*2-1): super(Tass, self).__init__( ...
mit
4,104,090,419,611,617,000
32.676471
84
0.585845
false
Kniyl/mezzanine
mezzanine/core/middleware.py
1
12608
from __future__ import unicode_literals from future.utils import native_str from django.contrib import admin from django.contrib.auth import logout from django.contrib.messages import error from django.contrib.redirects.models import Redirect from django.core.exceptions import MiddlewareNotUsed from django.core.urlres...
bsd-2-clause
6,873,817,648,819,589,000
41.884354
79
0.612706
false
HybridF5/jacket
jacket/tests/compute/unit/virt/xenapi/test_vmops.py
1
77493
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # 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 requ...
apache-2.0
5,816,188,525,677,706,000
45.017221
79
0.581949
false
Back2Basics/routeedu
bp_content/themes/redu/handlers/delete this/models/concept.py
1
3165
from google.appengine.ext import ndb from models.gr_tag import Tag from models.gr_translate_tag import Tag_translated class Concept(ndb.Model): """ prerequisites: you need to get_or_insert a Title and description from TagTranslated optional prerequisites: make a tag for the institution, make the prequisites ...
lgpl-3.0
189,670,285,683,741,570
46.253731
175
0.684044
false
shaftoe/home-assistant
tests/components/test_weblink.py
19
1310
"""The tests for the weblink component.""" import unittest from homeassistant.setup import setup_component from homeassistant.components import weblink from tests.common import get_test_home_assistant class TestComponentWeblink(unittest.TestCase): """Test the Weblink component.""" def setUp(self): ...
apache-2.0
8,828,234,685,704,932,000
28.111111
68
0.548855
false
hieukypc/ERP
openerp/addons/l10n_ro/res_partner.py
46
1504
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # @author - Fekete Mihai <feketemihai@gmail.com> # Copyright (C) 2015 Forest and Biomass Services Romania (http://www.forbiom.eu). # Copyright (C) 2011 TOTAL PC SYSTEMS (http://www.erpsystems.ro). # Copyright (C) 2009...
gpl-3.0
-3,888,397,787,652,538,000
46
112
0.666223
false
meredith-digops/ansible
lib/ansible/modules/network/lenovo/cnos_factory.py
59
5013
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
gpl-3.0
-7,206,669,624,592,876,000
33.088435
139
0.701058
false
mwkang/zeppelin
python/src/main/resources/python/zeppelin_context.py
1
10257
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
2,272,731,413,069,566,700
35.501779
111
0.612167
false
nilsonmorales/Puppyes-nightrc
usr/share/doc/python-cairo/examples/warpedtext.py
3
2025
#!/usr/bin/env python import cairo import math def warpPath(ctx, function): first = True for type, points in ctx.copy_path(): if type == cairo.PATH_MOVE_TO: if first: ctx.new_path() first = False x, y = function(*points) ctx.move_to(...
gpl-3.0
5,917,408,100,791,903,000
22.823529
64
0.582716
false
MaxVanDeursen/tribler
Tribler/Test/Core/TorrentChecker/test_torrentchecker_session.py
1
14018
import struct from libtorrent import bencode from twisted.internet.defer import Deferred, DeferredList from twisted.internet.task import Clock from twisted.python.failure import Failure from Tribler.Core.Session import Session from Tribler.Core.SessionConfig import SessionStartupConfig from Tribler.Core.TorrentChecker...
lgpl-3.0
-2,915,472,319,685,212,000
39.281609
120
0.654088
false
BRCDcomm/pynos
pynos/versions/base/yang/brocade_entity.py
10
1301
#!/usr/bin/env python import xml.etree.ElementTree as ET class brocade_entity(object): """Auto generated class. """ def __init__(self, **kwargs): self._callback = kwargs.pop('callback') def get_contained_in_ID_output_contained_in_ID(self, **kwargs): """Auto Generated Code...
apache-2.0
-2,161,125,934,390,560,500
34.189189
67
0.607225
false
mrshu/iepy
iepy/extraction/active_learning_core.py
1
10059
from copy import copy import inspect import logging import pickle import random import os.path import numpy from sklearn.cross_validation import StratifiedKFold from sklearn.metrics import precision_recall_curve from iepy import defaults from iepy.extraction.relation_extraction_classifier import RelationExtractionCla...
bsd-3-clause
-9,107,058,594,345,535,000
37.39313
108
0.612586
false
mbreese/mvpipe_py
mvpipe/runner/sjqrunner.py
1
6068
''' Job runner for SJQ - Simple Job Queue SJQ is included with MVpipe as a single-user batch scheduler ''' import os import time import socket import string import multiprocessing import mvpipe.config from mvpipe.runner import Runner, Job import sjq.client import sjq.server def_options = {'env': True, 'cwd': os.pa...
mit
6,690,849,619,656,685,000
28.891626
181
0.513514
false
tswast/google-cloud-python
speech/samples/v1p1beta1/speech_transcribe_word_level_confidence_beta.py
2
2893
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
3,454,023,589,682,669,000
31.875
137
0.70515
false
crepererum/invenio
invenio/modules/formatter/format_elements/bfe_video_platform_suggestions.py
13
5850
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # Li...
gpl-2.0
-4,404,983,587,393,557,000
34.889571
103
0.648889
false
limitemp/ROPgadget
ropgadget/loaders/universal.py
8
3433
## -*- coding: utf-8 -*- ## ## Christoffer Brodd-Reijer - 2014-07-20 - ROPgadget tool ## ## http://twitter.com/ephracis ## http://shell-storm.org/project/ROPgadget/ ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by #...
gpl-2.0
-6,593,251,865,151,483,000
31.084112
99
0.559278
false
rcrowder/pycapnp
test/test_object.py
2
1412
import pytest import capnp import os this_dir = os.path.dirname(__file__) @pytest.fixture def addressbook(): return capnp.load(os.path.join(this_dir, 'addressbook.capnp')) def test_object_basic(addressbook): obj = capnp._MallocMessageBuilder().get_root_as_any() person = obj.as_struct(addressbook.Perso...
bsd-2-clause
-8,523,553,985,585,152,000
26.686275
67
0.65864
false
AOSP-S4-KK/platform_external_chromium_org
tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py
26
2762
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from telemetry.core import util from telemetry.core.backends.chrome import android_browser_finder from telemetry.core.platform import profiler c...
bsd-3-clause
-6,282,609,275,966,702,000
36.324324
80
0.685735
false
dr-prodigy/python-holidays
test/countries/test_sweden.py
1
5435
# -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Author: ryanss <ryanssdev@icl...
mit
-6,092,426,190,018,321,000
44.291667
78
0.679669
false
Azure/azure-sdk-for-python
sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/azure/eventhub/extensions/checkpointstoreblobaio/_vendor/storage/blob/_generated/operations/_container_operations.py
2
85119
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-352,600,474,287,041,600
56.435223
174
0.657644
false
andsild/dotfiles
.nvimex.py
1
4867
#!/usr/bin/env python3 #encoding:utf-8 """ The MIT License (MIT) Copyright (c) [2015] [Andreas Karlsson] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without lim...
unlicense
3,121,182,161,705,380,400
32.537931
432
0.593461
false
simonspa/eudaq
legacy/etc/pybindgen/PyIndexReader-gen.py
14
2604
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
lgpl-3.0
-6,071,137,466,712,818,000
26.702128
85
0.625192
false
ramondelafuente/ansible
lib/ansible/playbook/__init__.py
20
4128
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
-3,912,583,761,820,026,400
37.222222
151
0.655039
false
rzarzynski/tempest
tempest/api/database/versions/test_versions.py
24
1568
# Copyright 2014 OpenStack Foundation # All Rights Reserved. # # 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 requ...
apache-2.0
-6,446,258,507,213,314,000
39.205128
78
0.697066
false