repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
rchuppala/usc_agent
src/usc-agent-dev/common/source/pyang/pyang/translators/schemanode.py
1
10232
# Copyright (c) 2013 by Ladislav Lhotka, CZ.NIC <lhotka@nic.cz> # # Python class representing a node in a RELAX NG schema. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice a...
gpl-2.0
3,778,500,691,622,639,600
35.412811
89
0.57672
false
lukaszb/django-richtemplates
richtemplates/listeners.py
1
1369
import logging from django.db.models import signals from django.db import DatabaseError, IntegrityError from django.contrib.auth.models import User from richtemplates.utils import get_user_profile_model def new_richtemplates_profile(instance, **kwargs): if kwargs['created'] is True: UserProfile = get_use...
bsd-3-clause
9,204,878,192,692,085,000
41.78125
80
0.604091
false
spotify/crtauth
test/roundtrip_test.py
1
14010
# Copyright (c) 2011-2017 Spotify AB # # 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 w...
apache-2.0
1,554,741,149,084,993,500
47.310345
82
0.635261
false
Litetokens/litetokensd
litetokensd.py
1
63305
#! /usr/bin/env python3 import os import argparse import json import decimal import sys import logging import unicodedata import time import dateutil.parser import calendar import configparser import traceback import threading from threading import Thread import binascii from fractions import Fraction import requests ...
mit
-3,661,254,247,231,459,000
54.542581
289
0.619398
false
kosklain/CausalityCompetition
CausalityTrainer.py
1
2257
import data_io import CausalityFeatureFunctions as f from sklearn.ensemble import RandomForestRegressor from sklearn.pipeline import Pipeline class CausalityTrainer: def __init__(self, directionForward=True): self.directionForward = directionForward def getFeatureExtractor(self, features): com...
gpl-2.0
6,256,355,404,492,569,000
38.614035
96
0.594152
false
dgnorth/DriftUe4Plugin
Scripts/publish.py
1
13837
"""Build and upload script to make UE4 client and server builds available on S3. """ import sys import os import threading import time import json from datetime import datetime import mimetypes import argparse import re import getpass import operator from dateutil.parser import parse from tabulate import tabulate impo...
mit
7,270,144,388,517,457,000
36.702997
170
0.610176
false
brianloveswords/django-badger
setup.py
1
1111
from setuptools import setup setup( name='django-badger', version='0.0.1', description='Django app for managing and awarding badgers', long_description=open('README.rst').read(), author='Leslie Michael Orchard', author_email='me@lmorchard.com', url='http://github.com/lmorchard/django-badge...
bsd-3-clause
3,426,159,240,017,291,300
41.730769
202
0.656166
false
paulsbrookes/cqed_sims_qutip
spectroscopy/spec_anim.py
1
6723
import numpy as np from qutip import * from pylab import * from scipy.fftpack import fft import matplotlib.pyplot as plt import yaml from scipy.interpolate import interp1d class parameters: def __init__(self, wc, wq, eps, g, chi, kappa, gamma, t_levels, c_levels): self.wc = wc self.wq = wq ...
apache-2.0
1,119,140,199,306,191,900
37.861272
118
0.638554
false
marpaia/chef-osx
cookbooks/python/files/default/ipython/profile_default/ipython_config.py
1
16895
# Configuration file for ipython. c = get_config() #------------------------------------------------------------------------------ # InteractiveShellApp configuration #------------------------------------------------------------------------------ # A Mixin for applications that start InteractiveShell instances. # # ...
apache-2.0
5,318,918,276,306,134,000
35.333333
418
0.671974
false
sevazhidkov/leonard
jobs/return_messages.py
1
3006
import os import random import logging import arrow import telegram from telegram.error import Unauthorized from leonard import Leonard from modules.menu import GREETING_PHRASES from libs.timezone import local_time from libs.utils import FakeMessage telegram_client = telegram.Bot(os.environ['BOT_TOKEN']) bot = Leona...
mit
8,447,620,987,240,022,000
31.956044
103
0.592197
false
libvirt/autotest
client/common_lib/software_manager.py
1
23931
#!/usr/bin/python """ Software package management library. This is an abstraction layer on top of the existing distributions high level package managers. It supports package operations useful for testing purposes, and multiple high level package managers (here called backends). If you want to make this lib to support ...
gpl-2.0
-5,629,466,862,281,476,000
29.254109
83
0.557018
false
espdev/readthedocs.org
readthedocs/projects/signals.py
1
1499
"""Project signals""" import logging import django.dispatch from django.contrib import messages from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ from readthedocs.oauth.services import registry before_vcs = django.dispatch.Signal(providing_args=["version"]) after_vcs = dj...
mit
8,835,816,446,431,787,000
30.893617
95
0.651768
false
apple/swift-lldb
packages/Python/lldbsuite/test/lang/swift/expression/access_control/TestExpressionAccessControl.py
1
1897
# TestExpressionAccessControl.py # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift....
apache-2.0
-7,535,670,957,241,162,000
32.875
80
0.650501
false
alexis-roche/niseg
examples/partial_volume_estimation.py
1
1753
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Script example of partial volume estimation """ from argparse import ArgumentParser import numpy as np import nibabel as nb from niseg import BrainT1PVE # Parse command line de...
bsd-3-clause
9,000,726,666,906,467,000
28.711864
88
0.697661
false
leigh2/gchq_puzzle
puzzle.py
1
3170
#!/usr/bin/env python import numpy as np cols = {0: [7,2,1,1,7], 1: [1,1,2,2,1,1], 2: [1,3,1,3,1,3,1,3,1], 3: [1,3,1,1,5,1,3,1], 4: [1,3,1,1,4,1,3,1], 5: [1,1,1,2,1,1], 6: [7,1,1,1,1,1,7], 7: [1,1,3], 8: [2,1,2,1,8,2,1], 9: [2,2,1,2,1,1,1,2], ...
gpl-2.0
-3,621,785,363,306,098,700
36.738095
84
0.346372
false
ShrimpingIt/tableaux
depictions/umbrella/main.py
1
2106
from os import urandom from time import sleep from neopixel import NeoPixel from machine import Pin from math import floor dataPin = Pin(13) ledCount = 27 np = NeoPixel(dataPin, ledCount) def blank(): for pos in range(ledCount): np[pos]=(0,0,0) np.write(); def visitAll(): for pos in range(ledCount): blank() ...
agpl-3.0
2,675,218,914,456,920,600
16.697479
91
0.625356
false
fullphat/redsquare
support/blink1.py
1
8924
#!/usr/bin/env python import sys import time import re import sys import uuid debugimport=False use_pyusb=False try: print "[blink1]: trying blink1_pyusb..." from blink1_pyusb import Blink1 as Blink1_pyusb print "[blink1]: using blink1_pyusb" use_pyusb = True #sys.modules['Blink1'] = blink1_pyus...
mit
-756,769,589,801,679,400
32.051852
146
0.532721
false
AddonScriptorDE/plugin.video.trailerseite_de
default.py
1
11540
#!/usr/bin/python # -*- coding: utf-8 -*- import urllib import urllib2 import socket import re import sys import xbmcplugin import xbmcaddon import xbmcgui socket.setdefaulttimeout(30) pluginhandle = int(sys.argv[1]) addonId = 'plugin.video.trailerseite_de' addon = xbmcaddon.Addon(id=addonId) translation = addon.getLo...
gpl-2.0
-1,058,085,944,360,981,600
39.911348
166
0.623039
false
bmmalone/as-auto-sklearn
as_asl/train_oasc_models.py
1
2559
#! /usr/bin/env python3 import argparse import misc.automl_utils as automl_utils import misc.parallel as parallel import as_asl.as_asl_command_line_utils as clu import as_asl.as_asl_filenames as filenames import as_asl.as_asl_utils as as_asl_utils from as_asl.as_asl_ensemble import ASaslPipeline import logging impo...
mit
-4,272,369,325,987,425,300
27.433333
92
0.66823
false
rndusr/stig
stig/helpmgr.py
1
22776
# 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, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful # but...
gpl-3.0
-7,333,468,026,851,191,000
43.311284
112
0.530207
false
sage-code/level
core/levDriver.py
1
10035
import core.levScanner as levScanner import core.levParser as levParser import core.levLexer as levLexer import core.levExecute as executor import core.levSystem as system from core.levConsole import * from core.levConfig import * # Execute a level program def run_console(p_file): if p_file: initCon...
mit
636,423,577,740,252,400
32.33887
80
0.461286
false
rbraley/django-tastypie
tests/core/tests/authentication.py
1
10334
import base64 import time import warnings from django.contrib.auth.models import User from django.core import mail from django.http import HttpRequest from django.test import TestCase from tastypie.authentication import Authentication, BasicAuthentication, ApiKeyAuthentication, DigestAuthentication, OAuthAuthentication...
bsd-3-clause
2,878,950,592,333,090,000
39.367188
136
0.655603
false
moshthepitt/afya360
health_facilities/sitemaps.py
1
1083
from django.contrib.sitemaps import Sitemap, GenericSitemap from django.core.paginator import Paginator from .models import HealthFacility class HealthFacilitySitemap(Sitemap): changefreq = "monthly" priority = 0.6 def items(self): return HealthFacility.objects.all() def lastmod(self, obj):...
mit
-7,888,297,912,088,862,000
32.84375
100
0.698984
false
JavierAntonioGonzalezTrejo/SCAZAC
administracionScazac/views.py
1
41167
# -*- coding: utf-8 -*- from __future__ import unicode_literals # Modification 20171022: Requirment F3-3 finished. # Modification 20171025: Requirment F3 finished. import datetime from django.db.models import Max import json import pandas import dateutil.parser from django import forms from decimal import Decimal from ...
gpl-3.0
6,718,961,637,690,790,000
50.749686
507
0.605066
false
datapythonista/pandas
scripts/sync_flake8_versions.py
3
5144
""" Check that the flake8 (and pandas-dev-flaker) pins are the same in: - environment.yml - .pre-commit-config.yaml, in the flake8 hook - .pre-commit-config.yaml, in the additional dependencies of the yesqa hook The flake8 hook revision in .pre-commit-config.yaml is taken as the reference revision. Usage: either - ...
bsd-3-clause
-1,023,367,306,878,247,000
29.43787
88
0.625
false
atakan/Fractal-Trails
trail_analyze.py
1
6139
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2011 Mehmet Atakan Gürkan # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed i...
gpl-3.0
-4,184,026,960,048,453,000
34.894737
152
0.558977
false
fw1121/bcbio-nextgen
bcbio/pipeline/qcsummary.py
1
48654
"""Quality control and summary metrics for next-gen alignments and analysis. """ import collections import contextlib import csv import os import shutil import subprocess import pandas as pd import lxml.html import yaml from datetime import datetime # allow graceful during upgrades try: import matplotlib matpl...
mit
7,761,196,467,507,781,000
42.171251
119
0.571731
false
googleads/google-ads-python
google/ads/googleads/v8/services/types/topic_view_service.py
1
1202
# -*- coding: utf-8 -*- # Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
5,047,127,096,734,223,000
29.820513
100
0.710483
false
bsmedberg/socorro
socorro/external/crash_data_base.py
1
3506
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from socorro.external import ( MissingArgumentError, ResourceNotFound, ResourceUnavailable, ServiceUnava...
mpl-2.0
8,774,703,158,655,654,000
37.108696
78
0.595836
false
EarToEarOak/RTLSDR-Scanner
rtlsdr_scanner/plot_spect.py
1
16014
# # rtlsdr_scan # # http://eartoearoak.com/software/rtlsdr-scanner # # Copyright 2012 - 2015 Al Brown # # A frequency scanning GUI for the OsmoSDR rtl-sdr library at # http://sdr.osmocom.org/trac/wiki/rtl-sdr # # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
gpl-3.0
6,269,624,982,629,573,000
36.415888
87
0.513301
false
jasongrout/jupyterlab-extension
setup.py
1
5340
# -*- coding: utf-8 -*- # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function from setuptools import setup, find_packages, Command from setuptools.command.sdist import sdist from setuptools.command.build_py import build_py from setup...
bsd-3-clause
-5,766,849,120,819,335,000
32.797468
124
0.603371
false
ox-it/talks.ox
talks/users/forms.py
1
3163
from __future__ import absolute_import from django import forms from django.core.exceptions import ValidationError from django.db.models.query_utils import Q from talks.events import typeahead, datasources from django.contrib.auth.models import User from talks.users.models import Collection, TalksUser, TalksUserCollec...
apache-2.0
9,132,082,129,076,920,000
42.328767
172
0.653494
false
Som-Energia/somenergia-generationkwh
generationkwh/amortizations_test.py
1
3982
# -*- coding:utf8 -*- import unittest from .amortizations import pendingAmortizations class Amortization_Test(unittest.TestCase): def setUp(self): self.maxDiff = None def test_pendingAmortizations_unpaid(self): self.assertEqual( pendingAmortizations( purchase_da...
agpl-3.0
1,300,526,490,195,909,400
31.373984
62
0.443747
false
sanguinariojoe/FreeCAD
src/Mod/Draft/draftguitools/gui_mirror.py
9
9314
# *************************************************************************** # * (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> * # * (c) 2009, 2010 Ken Cline <cline@frii.com> * # * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> * # * ...
lgpl-2.1
-7,578,842,251,887,063,000
42.12037
129
0.492914
false
nicodv/bgg
bgg/util/retry.py
1
3841
""" Module that implements a retry decorator. You can, for example, do this: @retry(5) def my_function(): ... And 'my_function', upon an exception, will be retried 4 more times until a final exception is raised. 'retry' will wait a little bit longer after each failure before retrying. Very useful fo...
mit
5,816,004,726,221,605,000
36.656863
79
0.634731
false
sjtindell/pulp_deb
plugins/pulp_deb/plugins/distributors/steps.py
1
4603
from gettext import gettext as _ import logging import os import subprocess import gzip from pulp.plugins.util import misc from pulp.plugins.util.publish_step import PluginStep, AtomicDirectoryPublishStep from pulp_deb.common import constants from pulp_deb.plugins.distributors import configuration from pulp_deb.plugi...
gpl-2.0
-2,664,845,375,098,594,300
37.358333
100
0.61612
false
mifumagalli/mypython
redshifts/zfit.py
1
48275
""" Gui to inspect spectra in 1/2D """ try: import Tkinter as tkinter import tkFont as tkfont from Tkinter import Tk import tkFileDialog as filedialog except: import tkinter from tkinter import font as tkfont from tkinter import Tk from tkinter import filedialog from astropy.io import fits import matplot...
gpl-2.0
7,933,736,069,385,149,000
36.833072
139
0.588938
false
airbnb/streamalert
streamalert_cli/terraform/monitoring.py
1
3570
""" Copyright 2017-present Airbnb, 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, sof...
apache-2.0
-359,748,981,042,700,000
40.034483
97
0.685154
false
sarisabban/ProtVR
FlaskApp/ProtVR.py
1
1848
# Author: Sari Sabban # Email: sari.sabban@gmail.com # URL: https://github.com/sarisabban # # Created By: Sari Sabban # Created Date: 20 March 2017 import urllib def ProtVR(x): lis=list() filename='HELLO C ' filename=urllib.urlopen('http://files.rcsb.org/view/'+x+'.pdb') lis.append('<script src="/static/...
mit
2,022,517,550,096,471,300
39.173913
119
0.653139
false
mitsei/dlkit
tests/cataloging/test_queries.py
1
9061
"""Unit tests of cataloging queries.""" import pytest from ..utilities.general import is_never_authz, is_no_authz, uses_cataloging, uses_filesystem_only from dlkit.abstract_osid.osid import errors from dlkit.primordium.id.primitives import Id from dlkit.primordium.type.primitives import Type from dlkit.runtime impo...
mit
-4,018,463,533,155,172,400
40.949074
176
0.648825
false
danieldmm/minerva
kw_evaluation_runs/aac_full_text_kw_selection_exp.py
1
12856
# Experiments with the ACL corpus like the ones for LREC'16 # # Copyright: (c) Daniel Duma 2016 # Author: Daniel Duma <danielduma@gmail.com> # For license information, see LICENSE.TXT from __future__ import print_function from __future__ import absolute_import # from proc.nlp_functions import AZ_ZONES_LIST, CORESC_L...
gpl-3.0
-1,403,679,893,338,411,800
43.638889
170
0.529947
false
Einsteinish/PyTune3
apps/reader/views.py
1
103912
import datetime import time import boto import redis import requests import random import zlib from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.template.loader import render_to_string from django.db import IntegrityE...
mit
-6,293,551,005,867,734,000
42.350855
137
0.595985
false
clchiou/garage
py/garage/examples/asyncs/supervisors.py
1
1115
"""Supervisor tree example.""" import logging import curio from garage.asyncs import TaskStack from garage.asyncs.queues import Closed, Queue async def supervisor(): print('supervisor start') async with TaskStack() as stack: queue = Queue() await stack.spawn(consumer(queue)), await ...
mit
3,136,778,452,220,943,400
20.037736
53
0.620628
false
PostRockFTW/ExcitingBike
src/screenscrolltest/__init__.py
1
2317
import sys import pygame from pygame.locals import * def main(): pygame.init() gameWidth = 460 gameHeight = 230 miniMapFactor = 8 mainSurface = pygame.display.set_mode((gameWidth, gameHeight)) mainClock = pygame.time.Clock() FPS = 30 pygame.display.set_caption('Screen Scroll Test') ...
gpl-2.0
-1,759,312,278,505,376,500
30.739726
128
0.630988
false
Donkyhotay/MoonPy
zope/app/component/tests/factory.py
1
1462
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # T...
gpl-3.0
723,490,795,661,606,500
32.227273
78
0.633379
false
NaPs/Kolekto
kolekto/commands/edit.py
1
1031
import json from kolekto.printer import printer from kolekto.commands import Command from kolekto.helpers import get_hash class Edit(Command): """ Edit a movie. """ help = 'edit a movie' def prepare(self): self.add_arg('input', metavar='movie-hash-or-file') def run(self, args, config)...
mit
4,217,550,169,612,711,400
22.976744
92
0.534433
false
synthesio/infra-ovh-ansible-module
plugins/modules/public_cloud_instance.py
1
3577
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) from ansible.module_utils.basic import AnsibleModule __metaclass__ = type DOCUMENTATION = ''' --- module: public_cloud_instance short_description: Manage OVH API for public cloud instance creatikon descripti...
mit
4,153,331,261,659,755,000
27.846774
105
0.609729
false
smlacombe/sageo
app/model/filters/filter_host_state.py
1
2263
# # Copyright (C) 2013 Savoir-Faire Linux Inc. # # This file is part of Sageo # # Sageo 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 optio...
gpl-3.0
-3,413,612,498,410,856,400
40.145455
151
0.604949
false
JDevlieghere/InTeXration
intexration/task.py
1
4809
import logging import os import shutil import subprocess import tempfile from intexration.tools import create_dir, cd from intexration.build import Identifier, Build from intexration.document import Document from intexration.parser import BuildParser class Task(): def run(self): pass class CloneTask(Ta...
apache-2.0
7,176,475,637,325,700,000
35.157895
110
0.550842
false
maoy/zknova
nova/api/openstack/compute/contrib/extended_status.py
1
4009
# Copyright 2011 OpenStack, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
3,888,264,689,838,659,000
38.693069
79
0.65777
false
projectatomic/atomic-reactor
atomic_reactor/plugins/exit_remove_worker_metadata.py
1
1722
""" Copyright (c) 2017 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import absolute_import from atomic_reactor.plugin import ExitPlugin from atomic_reactor.constants import PLUGIN_REMOVE_WORKER...
bsd-3-clause
-3,733,896,536,567,704,000
33.44
87
0.641115
false
ccpgames/eve-metrics
web2py/cgihandler.py
1
1527
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) This is a CGI handler for Apache Requires apache+[mod_cgi or mod_cgid]. In httpd.conf put somet...
mit
4,005,331,098,302,896,000
22.238095
59
0.646365
false
matt-gardner/deep_qa
tests/data/data_indexer_test.py
1
5324
# pylint: disable=no-self-use,invalid-name import codecs from deep_qa.data.data_indexer import DataIndexer from deep_qa.data.datasets import TextDataset from deep_qa.data.instances.text_classification.text_classification_instance import TextClassificationInstance from ..common.test_case import DeepQaTestCase class T...
apache-2.0
5,252,858,860,208,307,000
51.712871
110
0.64707
false
JNRowe/versionah
tests/test_date.py
1
1244
# """test_date - Date tests""" # Copyright © 2012-2018 James Rowe <jnrowe@gmail.com> # # SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of versionah. # # versionah 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 So...
gpl-3.0
5,703,269,001,026,856,000
31.710526
79
0.711183
false
Makeystreet/makeystreet
woot/apps/catalog/migrations/0020_auto__add_image__chg_field_documentation_url.py
1
21689
# -*- 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 'Image' db.create_table(u'catalog_image', ( (u'id', self.gf('django.db.models.fie...
apache-2.0
7,494,500,861,876,699,000
74.051903
260
0.55867
false
pawelmhm/scrapy
scrapy/core/http2/protocol.py
3
16522
import ipaddress import itertools import logging from collections import deque from ipaddress import IPv4Address, IPv6Address from typing import Dict, List, Optional, Union from h2.config import H2Configuration from h2.connection import H2Connection from h2.errors import ErrorCodes from h2.events import ( Event, C...
bsd-3-clause
-3,718,572,256,000,780,300
38.526316
112
0.646169
false
afaheem88/tempest
tempest/thirdparty/boto/base.py
1
14745
# Copyright 2012 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
-9,187,748,402,305,624,000
37.498695
78
0.571448
false
pberkes/persistent_locals
test_deco.py
1
2351
import unittest import deco class _TestException(Exception): pass @deco.persistent_locals def _globalfunc(x): z = 2*x return z _a = 2 @deco.persistent_locals def _globaldependent(x): z = x + _a return z @deco.persistent_locals def _toberemoved(x): z = 2*x return z class TestPersistLocal...
gpl-3.0
4,609,870,817,239,272,400
24.27957
71
0.535517
false
Ecotrust/TEKDB
TEKDB/TEKDB/settings.py
1
5770
""" Django settings for TEKDB project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
mit
-8,495,687,464,848,662,000
24.418502
140
0.64922
false
gautelinga/BERNAISE
problems/porous.py
1
10258
import dolfin as df import os from . import * from common.io import mpi_is_root, load_mesh from common.bcs import Fixed, Pressure, Charged from ufl import sign import numpy as np __author__ = "Gaute Linga" class PeriodicBoundary(df.SubDomain): # Left boundary is target domain def __init__(self, Ly, grid_spaci...
mit
7,689,344,559,994,583,000
32.854785
113
0.540456
false
cbertinato/pandas
pandas/tests/test_window.py
1
158948
from collections import OrderedDict from datetime import datetime, timedelta from itertools import product import warnings from warnings import catch_warnings import numpy as np from numpy.random import randn import pytest from pandas.errors import UnsupportedFunctionCall import pandas.util._test_decorators as td im...
bsd-3-clause
4,312,994,284,276,125,700
37.402513
79
0.505008
false
passy/glashammer-rdrei
glashammer/bundles/csrf.py
1
3865
# -*- coding: utf-8 -*- """ glashammer.bundles.middleware.csrf_protection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides a simple middleware to secure against Cross Site Remote Forgery attacks by setting cookies on every request and validate them on post requests. :copyright: 2010, The Glashammer Authors :license: MIT ...
mit
3,107,017,994,892,241,400
32.034188
78
0.615783
false
coderb0t/CouchPotatoServer
couchpotato/core/media/movie/providers/info/couchpotatoapi.py
1
4212
import base64 import time from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.encoding import tryUrlencode, ss from couchpotato.core.logger import CPLog from couchpotato.core.media.movie.providers.base import MovieProvider from couchpotato.environment import Env log = CPLog(__name__)...
gpl-3.0
2,660,003,703,913,347,000
32.967742
154
0.616809
false
timothyclemansinsea/smc
src/scripts/gce/pricing.py
1
1971
# https://cloud.google.com/compute/pricing # all storage prices are per GB per month. PRICING = { 'gcs-standard' : 0.026, 'gcs-reduced' : 0.02, 'gcs-nearline' : 0.01, 'snapshot' : 0.026, 'local-ssd' : 0.218, 'pd-ssd' : 0.17, 'pd-standard' : 0.04, ...
gpl-3.0
4,755,622,627,190,812,000
27.565217
107
0.515982
false
rdevon/cortex
demos/demo_classifier.py
1
2354
'''Simple classifier model ''' from cortex.main import run from cortex.plugins import ModelPlugin import torch import torch.nn as nn import torch.nn.functional as F from cortex.built_ins.models.utils import update_encoder_args class MyClassifier(ModelPlugin): '''Basic image classifier. Classifies images ...
bsd-3-clause
-8,868,400,450,535,550,000
26.057471
76
0.623195
false
phborba/dsgtoolsop
auxiliar/geopy/geocoders/dot_us.py
1
5485
""" :class:`GeocoderDotUS` geocoder. """ import csv from base64 import b64encode from geopy.compat import urlencode, py3k, Request from geopy.geocoders.base import ( Geocoder, DEFAULT_FORMAT_STRING, DEFAULT_TIMEOUT, ) from geopy.location import Location from geopy.exc import ConfigurationError from geopy.u...
gpl-2.0
2,699,461,029,512,830,000
31.64881
100
0.558067
false
anergictcell/SonosBar
sonosBar.py
1
13759
#!/usr/bin/env python -W ignore # -*- coding: utf-8 -*- """ Control you Sonos system from you Mac Menu Bar """ # <bitbar.title>SonosBar</bitbar.title> # <bitbar.version>v1.0</bitbar.version> # <bitbar.author>Jonas Marcello</bitbar.author> # <bitbar.author.github>anergictcell</bitbar.author.github> # <bitbar.desc>Contr...
mit
-7,581,023,862,845,307,000
28.941176
116
0.612821
false
ray-project/ray
python/ray/util/collective/tests/distributed_gpu_tests/test_distributed_allgather.py
1
5383
"""Test the allgather API on a distributed Ray cluster.""" import pytest import ray import cupy as cp import torch from ray.util.collective.tests.util import create_collective_workers, \ init_tensors_for_gather_scatter @pytest.mark.parametrize("tensor_backend", ["cupy", "torch"]) @pytest.mark.parametrize("array...
apache-2.0
3,633,413,706,309,417,000
39.473684
79
0.577002
false
altair-viz/altair
altair/sphinxext/utils.py
1
5859
import ast import hashlib import itertools import json import re def create_thumbnail(image_filename, thumb_filename, window_size=(280, 160)): """Create a thumbnail whose shortest dimension matches the window""" from PIL import Image im = Image.open(image_filename) im_width, im_height = im.size w...
bsd-3-clause
2,410,201,326,460,441,600
28.442211
84
0.604028
false
wpoely86/easybuild-easyblocks
easybuild/easyblocks/f/freetype.py
1
2546
## # Copyright 2009-2016 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # Flemish Research Foundation ...
gpl-2.0
8,661,694,134,422,940,000
37
110
0.690102
false
jajberni/pcse_web
main/model/simulation.py
1
7917
# coding: utf-8 """Provides implementation of Simulation model and Simulation""" from __future__ import absolute_import from google.appengine.ext import ndb from google.appengine.ext.ndb.model import GeoPt import model import time from pcse.db import NASAPowerWeatherDataProvider from pcse.fileinput import CABOFileRea...
apache-2.0
3,805,909,013,444,385,000
34.186667
119
0.674119
false
gnmathur/aMAZEd
solution_grid.py
1
3092
""" Solution-Grid definition MIT License Copyright (c) 2017 Gaurav Mathur 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 the rights to use, cop...
mit
1,898,911,336,600,446,000
35.376471
82
0.645213
false
mattrid93/ProjectEuler
probs/prob41.py
1
1223
"""Problem 41: Pandigital primes""" import unittest from prob24 import next_perm from utils.primes import is_prime def is_n_pandigital(n): """Tests if n is 1-len(n) pandigital.""" if len(str(n)) > 9: return False if len(str(n)) != len(set(str(n))): return False m = len(str(n)) digit...
mit
-6,400,612,861,880,300,000
27.44186
54
0.587081
false
leaprovenzano/kutils
kutils/metrics.py
1
1376
from keras import backend as K def d_precision(y_true, y_pred): '''this is basically precision metric from keras 1. but I've attempted to make it differentiable ''' true_positives = K.sum(K.clip(y_true * y_pred, 0, 1)) predicted_positives = K.sum(K.clip(y_pred, 0, 1)) precision = true_positiv...
mit
163,005,164,945,517,700
30.272727
86
0.613372
false
eri-trabiccolo/exaile
plugins/daapclient/__init__.py
1
25181
# Copyright (C) 2006-2007 Aren Olson # 2011 Brian Parma # # 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; either version 2, or (at your option) # any later version. # # This p...
gpl-2.0
-3,843,772,557,405,208,000
31.533592
118
0.547079
false
MRN-Code/pl2mind
models/nice_mlp.py
1
1883
""" Module for classes to simplify MLPs for NICE training. """ import pylearn2 import pylearn2.models import nice import nice.pylearn2.models.mlp from pylearn2.models.mlp import MLP from pylearn2.models.mlp import Linear from pylearn2.models.mlp import RectifiedLinear from nice.pylearn2.models.mlp import CouplingLayer...
gpl-2.0
9,018,267,773,866,419,000
35.211538
81
0.553372
false
mouradmourafiq/django-subways
subways/views.py
1
2167
# -*- coding: utf-8 -*- from django.shortcuts import render_to_response from django.template import RequestContext, Context, loader from subways.models import Map, Line, Stop from subways.utilis import ride_path, longest_ride_path def map(request, map_name, template_name=None): """ view a map """ map = Map...
bsd-2-clause
7,201,897,100,008,982,000
45.106383
91
0.53761
false
asfin/electrum
electrum/constants.py
1
3987
# -*- coding: utf-8 -*- # # Electrum - lightweight Bitcoin client # Copyright (C) 2018 The Electrum developers # # 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, # includi...
mit
8,130,624,915,382,426,000
28.977444
81
0.656383
false
joyhchen/zulip
zerver/views/messages.py
1
44785
from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.utils.timezone import now from django.conf import settings from django.core import validators from django.core.exceptions import ValidationError from django.db import connection from django.db.models import Q from dja...
apache-2.0
8,876,619,067,596,775,000
43.919759
183
0.604488
false
ebrian/dispenserd
tests/test.py
1
7171
import unittest import requests import sys import random import json class TestDispenserd(unittest.TestCase): base_url = 'http://127.0.0.1:8282' def test010_is_running(self): res = requests.get(self.base_url + '/') json = res.json() self.assertEqual(res.status_code, 200) self....
mit
5,116,270,982,148,051,000
39.514124
104
0.569516
false
chop-dbhi/brptoolkit-demo-harvest
brp_demo/formatters.py
1
36221
from django.core.urlresolvers import reverse from avocado.formatters import registry from serrano.formatters import HTMLFormatter from brp_demo.models import * from django.template import Context from django.template.loader import get_template from django.conf import settings try: from collections import OrderedDic...
bsd-2-clause
5,607,928,141,524,938,000
36.690947
256
0.574032
false
budurli/python-paytrail
paytrail/base.py
1
2679
# -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime import hmac import base64 import hashlib from requests import Request from paytrail.settings import BASE_API_URL, PAYTRAIL_AUTH_KEY, PAYTRAIL_ID, PAYTRAIL_SECRET class PaytrailConnectAPIRequest(Request): def __init__(s...
mit
-6,063,210,949,374,005,000
29.804598
104
0.605077
false
jazzband/site
jazzband/projects/models.py
1
5929
import os from datetime import datetime from uuid import uuid4 from flask import current_app, safe_join from flask_login import current_user from sqlalchemy import func, orm from sqlalchemy.dialects.postgresql import UUID, JSONB from sqlalchemy_utils import aggregated, generic_repr from ..auth import current_user_is_...
mit
7,964,328,019,318,782,000
34.933333
88
0.661326
false
olof/svtplay-dl
lib/svtplay_dl/service/raw.py
1
1082
from __future__ import absolute_import import os import re from svtplay_dl.fetcher.dash import dashparse from svtplay_dl.fetcher.hds import hdsparse from svtplay_dl.fetcher.hls import hlsparse from svtplay_dl.service import Service class Raw(Service): def get(self): filename = os.path.basename(self.url[...
mit
-1,032,772,615,640,684,500
33.903226
143
0.624769
false
redhat-cip/dci-ansible
callback/dci.py
1
9044
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ansible import constants as C from ansible.plugins.callback.default import CallbackModule as CM_default from ansible.release import __version__ as ansible_version from dciauth.version...
apache-2.0
2,457,845,636,947,778,000
34.466667
92
0.555617
false
kubeflow/pipelines
test/sample-test/run_sample_test.py
1
8450
# Copyright 2019-2021 The Kubeflow Authors # # 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 ...
apache-2.0
896,296,228,944,902,400
37.761468
82
0.539645
false
BetaNYC/tree-one-one
app.py
1
1276
from flask import Flask from flask import jsonify, render_template #from flask_cors import CORS import math import pandas as pd import os import datetime import json app = Flask(__name__) @app.route("/") def default(): return render_template('index.html') @app.route('/test') @app.route('/test/<metric>') de...
gpl-3.0
3,023,585,623,126,684,000
26.148936
92
0.552508
false
deepakgupta1313/models
video_prediction/prediction_train.py
1
8670
# Copyright 2016 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 applicab...
apache-2.0
3,539,439,255,335,017,500
33.819277
80
0.633218
false
yephper/django
tests/m2m_regress/tests.py
1
4828
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from django.utils import six from .models import ( Entry, Line, Post, RegressionModelSplit, SelfRefer, SelfReferChild, SelfReferChildSibling, Tag, TagCollection, Worksheet, ) cl...
bsd-3-clause
-8,945,947,115,624,770,000
36.935484
97
0.617854
false
JavierGarciaD/banking
banking/credit/forecast.py
1
8013
# -*- coding: utf-8 -*- import pandas as pd from rates.models import InterestRateModel from credit.prepayment import PrepaymentModel from common.db_manager import DB from sqlalchemy import select from sqlalchemy import and_ from sqlalchemy import asc def vintage_sett_manual(name, forecast, nper, sdate, repricing, rat...
mit
512,306,728,074,246,300
31.840164
79
0.527393
false
eirannejad/pyRevit
pyrevitlib/pyrevit/revit/selection.py
1
9893
from pyrevit import HOST_APP, DOCS, PyRevitException from pyrevit import framework, DB, UI from pyrevit.coreutils.logger import get_logger from pyrevit.revit import ensure from pyrevit.revit import query __all__ = ('pick_element', 'pick_element_by_category', 'pick_elements', 'pick_elements_by_category', ...
gpl-3.0
-2,571,831,693,091,678,700
28.978788
85
0.570403
false
pontikos/uclex_browser
lookups.py
1
17567
import re from utils import * import itertools import pysam import csv #hpo lookup import phizz import random import pickle import hashlib import pprint import utils import orm SEARCH_LIMIT = 10000 # massive genes? #UNSUPPORTED_QUERIES = ['TTN', 'ENSG00000155657', 'CMD1G', 'CMH9', 'CMPD4', 'FLJ32040', 'LGMD2J', 'MYLK5...
mit
-3,338,054,858,156,872,700
33.51277
233
0.599989
false
partofthething/home-assistant
homeassistant/components/tado/binary_sensor.py
1
7734
"""Support for Tado sensors for each zone.""" import logging from homeassistant.components.binary_sensor import ( DEVICE_CLASS_BATTERY, DEVICE_CLASS_CONNECTIVITY, DEVICE_CLASS_POWER, DEVICE_CLASS_WINDOW, BinarySensorEntity, ) from homeassistant.config_entries import ConfigEntry from homeassistant.c...
mit
-1,611,426,186,836,054,300
27.32967
80
0.571115
false
ciex/souma
synapse/electrical.py
1
26338
import datetime import json import logging import requests import iso8601 import os from base64 import b64encode from Crypto import Random from dateutil.parser import parse as dateutil_parse from gevent import Greenlet from hashlib import sha256 from humanize import naturaltime from operator import itemgetter from nu...
apache-2.0
2,572,205,078,655,930,000
34.688347
120
0.549244
false
whiler/a-walk-in-python
spider/spider.py
1
10172
#!/usr/bin/env python # -*- coding: utf-8 -*- # # file: spider.py # author: whiler # license: BSD # 引入 http.cookiejar 模块,提供 Cookie 支持 import http.cookiejar # 引入模块 logging 模块,记录运行日志 import logging # 引入 socket 模块,用于捕获 HTTP 超时错误 import socket # 引入 urllib.request 模块,处理 HTTP 连接,创建 HTTP 请求 import urllib.request # 引入 url...
cc0-1.0
5,744,109,774,003,198,000
24.326923
111
0.51468
false
karulont/combopt
project5/draw.py
1
1977
import turtle OFFSET=200 MULTIPLE=10 def draw(n,paths): cords=[(0,0),(n,0),(n,n),(0,n),(0,0)] turtle.penup() for c in cords: turtle.setpos(getCoord(c[0]),getCoord(c[1])) turtle.pendown() ## turtle.left(90) ## turtle.penup() ## turtle.goto(-OFFSET,-OFFSET) ## turtle.pen...
mit
3,498,382,939,808,764,000
38.54
579
0.438543
false
joaks1/PyMsBayes
pymsbayes/utils/functions.py
1
4664
#! /usr/bin/env python import sys import os import errno import random import string from pymsbayes.utils import GLOBAL_RNG from pymsbayes.fileio import process_file_arg def mkdr(path): """ Creates directory `path`, but suppresses error if `path` already exists. """ try: os.makedirs(path) ...
gpl-3.0
-502,087,976,988,867,900
26.116279
88
0.566681
false
minlexx/skype_movie_bot
classes/yandex_translate.py
1
2217
# -*- coding: utf-8 -*- import sys import collections # external libraries import requests import requests.exceptions class YandexTranslate: def __init__(self, yandex_api_key: str): self._apikey = yandex_api_key self._yt_url = 'https://translate.yandex.net/api/v1.5/tr.json/translate' ...
gpl-3.0
-2,401,171,451,816,979,500
29.779412
112
0.576122
false
azizmb/django-activity-stream
actstream/templatetags/activity_tags.py
1
6757
from django.template import Variable, Library, Node, TemplateSyntaxError,\ VariableDoesNotExist from django.template.loader import render_to_string from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from actstream.mode...
bsd-3-clause
-565,753,785,344,135,000
31.485577
125
0.641261
false
qilicun/python
python2/PyMOTW-1.132/PyMOTW/zipimport/zipimport_get_data.py
1
1323
#!/usr/bin/env python # # Copyright 2007 Doug Hellmann. # # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and tha...
gpl-3.0
-5,497,708,476,643,799,000
34.756757
71
0.76644
false