repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
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
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
pytorch/vision
torchvision/_internally_replaced_utils.py
1
1606
import os import importlib.machinery def _download_file_from_remote_location(fpath: str, url: str) -> None: pass def _is_remote_location_available() -> bool: return False try: from torch.hub import load_state_dict_from_url except ImportError: from torch.utils.model_zoo import load_url as load_stat...
bsd-3-clause
6,062,785,199,781,493,000
28.2
84
0.648817
false
3.691954
false
false
false
AnnieJumpCannon/RAVE
article/figures/plot_bensby.py
1
1775
""" Make label comparisons with Bensby et al. (2014). """ import numpy as np import matplotlib.pyplot as plt try: bensby except NameError: # Do you know who I am? from rave_io import get_cannon_dr1, get_literature_bensby rave_cannon_dr1 = get_cannon_dr1() #OK = (data["SNRK"] > 10) * (data["R_CHI...
mit
-8,901,556,318,300,327,000
21.468354
86
0.585352
false
2.598829
false
false
false
mdpiper/topoflow
topoflow/components/met_base.py
1
110618
## Does "land_surface_air__latent_heat_flux" make sense? (2/5/13) # Copyright (c) 2001-2014, Scott D. Peckham # # Sep 2014. Fixed sign error in update_bulk_richardson_number(). # Ability to compute separate P_snow and P_rain. # Aug 2014. New CSDMS Standard Names and clean up. # Nov 2013. Con...
mit
5,983,719,761,350,209,000
48.053394
117
0.417861
false
4.000072
false
false
false
pablo2000/picochess
dgtlib.py
1
2752
# Copyright (C) 2013-2016 Jean-Francois Romang (jromang@posteo.de) # Shivkumar Shivaji () # Jürgen Précour (LocutusOfPenguin@posteo.de) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
gpl-3.0
-1,395,131,923,043,318,800
41.96875
117
0.622182
false
3.069196
false
false
false
cytex124/celsius-cloud-backend
src/celsius/tools.py
1
3362
from rest_framework.pagination import PageNumberPagination from rest_framework import serializers from rest_framework import permissions from collections import OrderedDict typing_arr = { 'AutoField': 'int', 'CharField': 'string', 'DateTimeField': 'datetime', 'DateField': 'date', 'BooleanField': 'b...
mit
795,435,036,950,483,000
26.112903
73
0.6279
false
3.946009
false
false
false
tsolar/bikepolo-tournament
base/models.py
1
3221
# coding: utf-8 from django.contrib.auth.models import User from django.db import models from django.forms import ModelForm from django.http import HttpResponse NOMBRE_MAX_LENGTH = 100 class Jugador(models.Model): user = models.OneToOneField(User, null=True, blank=True) nombre = models.CharField(max_length =...
gpl-3.0
3,063,254,844,025,939,500
32.894737
78
0.66646
false
3.184965
false
false
false
boknilev/dsl-char-cnn
src/cnn_multifilter_cv.py
1
6190
'''CNN code for DSL 2016 task 2, with cross validation ''' from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.preprocessing import sequence from keras.models import Sequential, Model, load_model from keras.layers import Dense, Dropout, Activation, Flatten, ...
mit
8,944,023,813,990,312,000
37.209877
123
0.677868
false
3.545246
true
false
false
catmaid/CATMAID
django/applications/catmaid/control/skeleton.py
1
174650
# -*- coding: utf-8 -*- from collections import defaultdict import csv from datetime import datetime, timedelta from itertools import chain import dateutil.parser import json import networkx as nx import pytz import re from typing import Any, DefaultDict, Dict, List, Optional, Set, Tuple, Union from django.conf impor...
gpl-3.0
-7,145,342,037,780,130,000
38.308575
176
0.597041
false
3.95767
false
false
false
kosystem/Outliner
layout.py
1
4571
import wx import random from wx.lib.expando import ExpandoTextCtrl, EVT_ETC_LAYOUT_NEEDED def randColor(): r = random.randint(0, 255) g = random.randint(0, 255) b = random.randint(0, 255) return (r, g, b) class TextPanel(wx.Panel): def __init__(self, parent, id): wx.Panel.__init__(self, ...
mit
-6,932,235,869,819,650,000
32.610294
75
0.591555
false
3.069846
false
false
false
mitsei/dlkit
dlkit/abstract_osid/learning/queries.py
1
61163
"""Implementations of learning abstract base class queries.""" # pylint: disable=invalid-name # Method names comply with OSID specification. # pylint: disable=no-init # Abstract classes do not define __init__. # pylint: disable=too-few-public-methods # Some interfaces are specified as 'markers' and include ...
mit
-5,389,931,156,146,499,000
28.405288
137
0.626686
false
4.341188
false
false
false
viable-hartman/DashboardDirector
fabric_bolt/core/waithelper.py
1
2710
#!/usr/bin/env python """ Wait for a certain PID to terminate and check for PID existance (POSIX). """ import os import time import errno class TimeoutExpired(Exception): pass def pid_exists(pid): """Check whether pid exists in the current process table.""" if pid < 0: return False try: ...
mit
-3,769,212,887,919,976,000
29.795455
72
0.547232
false
4.449918
false
false
false
bootchk/resynthesizer
PluginScripts/plugin-uncrop.py
1
6040
#!/usr/bin/env python ''' Gimp plugin "Uncrop" Increase image/canvas size and synthesize outer band from edge of original. Author: lloyd konneker, lkk Version: 1.0 lkk 5/15/2009 Initial version in scheme, released to Gimp Registry. 1.1 lkk 9/21/2009 Translate to python. License: This program is free software; you...
gpl-3.0
-6,648,487,917,637,886,000
36.515528
182
0.716391
false
3.642943
false
false
false
vineodd/PIMSim
GEM5Simulation/gem5/tests/testing/helpers.py
3
6498
#!/usr/bin/env python2 # # Copyright (c) 2016 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementati...
gpl-3.0
-1,388,819,918,736,515,300
32.84375
77
0.671283
false
4.258191
false
false
false
lmregus/Portfolio
python/design_patterns/env/lib/python3.7/site-packages/prompt_toolkit/patch_stdout.py
1
4296
""" patch_stdout ============ This implements a context manager that ensures that print statements within it won't destroy the user interface. The context manager will replace `sys.stdout` by something that draws the output above the current prompt, rather than overwriting the UI. Usage:: with patch_stdout(): ...
mit
-6,573,644,135,968,771,000
28.627586
79
0.607309
false
4.326284
false
false
false
lqhuang/SAXS-tools
RAW/RAWAnalysisWrapper.py
1
19413
from __future__ import print_function, division import os import sys import re import copy import platform import subprocess from scipy import polyval, polyfit import numpy as np RAW_DIR = os.path.dirname(os.path.abspath(__file__)) if RAW_DIR not in sys.path: sys.path.append(RAW_DIR) import SASM import SASFileIO...
gpl-3.0
9,173,039,079,503,906,000
32.703125
269
0.515273
false
3.603007
false
false
false
thomasvdv/flightbit
analysis/thermal_stats.py
1
9061
import numpy as np import pandas as pd import sys import gdal import math from gdalconst import GA_ReadOnly from skewt import SkewT import os import matplotlib.pyplot as plt from os.path import expanduser home = expanduser("~") thermal_file = home + "/RAP/CSV/{}.csv" def open_raster(name): """ This functions...
gpl-2.0
8,520,788,158,754,758,000
33.196226
147
0.585587
false
2.631717
false
false
false
suutari/shoop
shuup/testing/admin_module/toolbar.py
1
1529
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.utils.translat...
agpl-3.0
-2,588,089,296,794,377,700
32.977778
73
0.646174
false
3.666667
false
false
false
hep-cce/hpc-edge-service
balsam/BalsamJobReceiver.py
1
2368
import logging,sys,os logger = logging.getLogger(__name__) from common import MessageReceiver,db_tools from balsam import models from django.conf import settings from django.db import utils,connections,DEFAULT_DB_ALIAS class BalsamJobReceiver(MessageReceiver.MessageReceiver): ''' subscribes to the input user job ...
bsd-3-clause
-2,875,591,182,772,225,000
36.587302
115
0.644426
false
4.125436
false
false
false
SoBeRBot94/TicTacToe-GE
GameEngine/Player.py
1
1883
from GameEngine.AI import _AI from GameEngine.User import _User class Player(object): """ The class which controls if it's a human player or an AI. Can take three parameters as input, where the name and the type of the player (AI or user) is mandatory A second parameter, difficulty, is not needed when...
gpl-3.0
-5,555,820,729,064,458,000
44.926829
114
0.663303
false
4.231461
false
false
false
SCSSoftware/BlenderTools
addon/io_scs_tools/internals/persistent/initialization.py
1
6852
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 # of the License, or (at your option) any later version. # # This program is distributed ...
gpl-2.0
-7,920,692,968,261,022,000
45.297297
148
0.691039
false
3.993007
true
false
false
64studio/smart
smart/fetcher.py
1
67875
# # Copyright (c) 2005 Canonical # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as publi...
gpl-2.0
3,637,493,377,482,120,700
34.629921
106
0.483727
false
4.744844
false
false
false
GaretJax/docker-deployer
deployer/routing/models.py
1
1776
import socket import struct from sqlalchemy import Column, Integer, String, ForeignKey from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, backref from structlog import get_logger from deployer.applications.models import Instance from deployer.utils import get_container_ip...
mit
3,688,632,540,628,936,000
30.157895
76
0.614865
false
3.844156
false
false
false
mvaled/sentry
src/sentry/api/helpers/group_index.py
1
35584
from __future__ import absolute_import import logging import six from collections import defaultdict from datetime import timedelta from uuid import uuid4 from django.db import IntegrityError, transaction from django.utils import timezone from rest_framework import serializers from rest_framework.exceptions import ...
bsd-3-clause
3,098,362,800,758,515,000
39.117249
100
0.582987
false
4.516309
false
false
false
wintersandroid/sbrick-controller
SBrickCommunications.py
1
17959
import struct import threading import monotonic import six from bluepy.btle import Peripheral, BTLEException from IdleObject import IdleObject import gi gi.require_version('Gtk', '3.0') # noinspection PyUnresolvedReferences,PyPep8 from gi.repository import GObject class SBrickChannelDrive: def __init__(self,...
apache-2.0
3,421,896,256,226,806,300
35.725971
119
0.556378
false
3.979393
true
false
false
howard11/autodownload
schedule.download.py
1
1520
#!/usr/bin/python3 import sys, os, re import dao, constants, zimuzu, boxdownload from requests import Request, Session sys.stdout = open("/root/autodownloadjob/schedule.download.log", encoding='utf-8', mode='w') sys.stderr = open("/root/autodownloadjob/schedule.download.error.log", encoding='utf-8', mode='w') def dow...
mit
-1,746,285,889,057,662,200
30.666667
105
0.676316
false
2.728905
false
false
false
weso/landportal-importers
LandPortalEntities/lpentities/observation.py
1
2674
''' Created on 18/12/2013 @author: Nacho ''' from lpentities.computation import Computation from lpentities.dataset import Dataset from lpentities.indicator import Indicator from lpentities.value import Value class Observation(object): ''' classdocs ''' def __init__(self, chain_for_id, int_for_id, r...
unlicense
7,113,201,815,411,518,000
29.05618
77
0.582274
false
4.555366
false
false
false
RemiFr82/ck_addons
ck_equipment/models/eqpt_trailer.py
1
1582
# -*- coding: utf-8 -*- from odoo import models, fields, api TRAILER_TYPES = [('b','B'), ('be','BE')] class Trailer(models.Model): _name = 'eqpt.trailer' _description = "Trailer equipment" _inherits = {'eqpt.equipment':'eqpt_id'} eqpt_id = fields.Many2one('eqpt.equipment') eqpt_...
gpl-3.0
-8,480,008,855,262,436,000
36.666667
95
0.654867
false
3.235174
false
false
false
skosukhin/spack
var/spack/repos/builtin/packages/llvm/package.py
1
19620
############################################################################## # 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
9,089,586,911,029,377,000
42.892617
96
0.558818
false
3.203265
false
false
false
stepbot/resiliant-trader
robinhood.py
1
12260
############################## # Robinhood API based on https://github.com/Jamonek/Robinhood.git # refence available at https://github.com/sanko/Robinhood.git ############################## import getpass import requests from datetime import datetime import numpy as np class Robinhood: """wrapper class f...
mit
-2,829,565,844,686,962,700
31.606383
140
0.530343
false
4.153117
false
false
false
EvoluxBR/txthoonk
txthoonk/client.py
1
14839
from zope.interface import implements #@UnresolvedImport from twisted.internet.protocol import ReconnectingClientFactory from txredis.protocol import Redis, RedisSubscriber, defer from twisted.internet import interfaces import uuid import itertools from txthoonk.types import Feed try: from collection import Ord...
mit
-747,066,772,516,353,300
29.659091
86
0.571602
false
4.514451
true
false
false
bmentges/django-cart
cart/models.py
1
2340
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.contenttypes.models import ContentType class Cart(models.Model): creation_date = models.DateTimeField(verbose_name=_('creation date')) checked_out = models.BooleanField(default=False, verbose_name=_('check...
lgpl-3.0
-903,081,689,665,839,700
35
99
0.649145
false
3.979592
false
false
false
brain-research/mirage-rl-qprop
rllab/envs/mujoco/ant_env.py
2
2342
from rllab.envs.mujoco.mujoco_env import MujocoEnv from rllab.core.serializable import Serializable from rllab.envs.base import Step from rllab.misc.overrides import overrides from rllab.misc import logger from rllab.envs.mujoco.mujoco_env import q_mult, q_inv import numpy as np import math class AntEnv(MujocoEnv, S...
mit
-4,974,392,672,893,091,000
34.484848
108
0.596926
false
3.152086
false
false
false
weng-lab/SnoPlowPy
snoPlowPy/exp_file.py
1
5223
#!/usr/bin/env python from __future__ import print_function import os import json from .files_and_paths import Dirs, Urls from .utils import Utils from .exp_file_metadata import ExpFileMetadata class ExpFile(ExpFileMetadata): def __init__(self, expID=None, fileID=None): ExpFileMetadata.__init__(self) ...
mit
879,180,562,057,076,400
30.463855
94
0.560789
false
3.486649
false
false
false
iansealy/rosalind
grph/grph-biopython.py
1
1618
#!/usr/bin/env python """This script is given "A collection of DNA strings in FASTA format having total length at most 10 kbp" and returns "The adjacency list corresponding to O3. You may return edges in any order". """ import argparse from Bio import SeqIO from Bio.Alphabet import generic_dna def main(args): "...
gpl-3.0
-3,033,114,035,736,476,000
28.962963
77
0.580964
false
3.74537
false
false
false
mgorny/PyGithub
github/Organization.py
1
47843
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Steve English <steve.english@navetas.com> # # Copyright 2012 Vincent Jacques <vincent@vincent-ja...
lgpl-3.0
4,850,455,243,568,008,000
39.067839
137
0.600385
false
4.351555
false
false
false
ianawilson/inspecttp
inspecttp/settings.py
1
5359
# Django settings for inspecttp project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '', ...
mit
2,355,210,286,938,402,300
33.352564
127
0.686509
false
3.731894
false
false
false
unt-libraries/coda
coda/coda_validate/views.py
1
18393
import json import random import datetime from codalib import APP_AUTHOR from codalib.bagatom import wrapAtom, makeObjectFeed from dateutil import parser from django.conf import settings from django.contrib.sites.models import Site from django.contrib.syndication.views import Feed from django.core.paginator import Pag...
bsd-3-clause
-3,355,197,747,545,127,400
33.835227
103
0.608547
false
4.032668
false
false
false
lgrahl/scripthookvpy3k
python/gta/ui/primitive.py
1
3310
""" Primitive UI elements. """ import gta_native from gta import Font from gta.ui import Item, Point, Color __all__ = ('Rectangle', 'Label') class Rectangle(Item): def draw(self, offset=Point.Zero, **settings): # TODO: Remove logging from gta import utils logger = utils.get_logger('gta.R...
mit
6,848,006,543,339,703,000
40.898734
162
0.607855
false
3.081937
false
false
false
fupadev/FuME
fume/ui/filter.py
1
2752
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'filter.ui' # # Created by: PyQt5 UI code generator 5.9 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_filter(object): def setupUi(self, filter): filter.setObjectName...
gpl-3.0
-4,410,328,212,400,600,000
44.85
111
0.700109
false
4.004367
false
false
false
meraki-analytics/cassiopeia-datastores
cassiopeia-diskstore/cassiopeia_diskstore/patch.py
1
1306
from typing import Type, TypeVar, MutableMapping, Any, Iterable from datapipelines import DataSource, DataSink, PipelineContext from cassiopeia.dto.patch import PatchListDto from .common import SimpleKVDiskService T = TypeVar("T") class PatchDiskService(SimpleKVDiskService): @DataSource.dispatch def get(s...
mit
-4,634,316,932,255,871,000
34.297297
119
0.689127
false
3.597796
false
false
false
rtfd/readthedocs.org
readthedocs/doc_builder/base.py
1
4554
"""Base classes for Builders.""" import logging import os import shutil from functools import wraps from readthedocs.projects.models import Feature log = logging.getLogger(__name__) def restoring_chdir(fn): # XXX:dc: This would be better off in a neutral module @wraps(fn) def decorator(*args, **kw): ...
mit
4,921,347,170,352,560,000
30.625
84
0.593544
false
4.14
false
false
false
Bmillidgework/Misc-Maths
Misc/rejection_sample.py
1
7356
# okay, time to test this out here # in a simple python script import numpy as np import random def rejection_sample(fn, envelope_fn, squeeze_fn, N): samples = [] num_accepted = 0 num_rejected = 0 for i in xrange(N): position = sample(envelope_fn) # sample a position from the envelope function height_multipli...
mit
-5,688,628,599,580,016,000
34.196172
371
0.717102
false
2.832499
false
false
false
andytopham/podplayer
oled.py
1
6071
#!/usr/bin/python ''' Module to control the picaxe OLED. Updated to work with both 16x2 and 20x4 versions. Requires new picaxe fw that inverts serial polarity, i.e. N2400 -> T2400. The oled modules work fine off the RPi 3v3, which avoids the need for level shifting. Requires the installation of the python seria...
mit
-5,049,980,333,659,571,000
32.174863
112
0.672871
false
2.869093
false
false
false
vrutkovs/atomic-reactor
atomic_reactor/plugins/pre_resolve_module_compose.py
1
8023
""" 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. Takes a reference to a module, and looks up or triggers a compose in the on-demand compose server (ODCS). In addition to retrieving the URL for ...
bsd-3-clause
9,058,405,850,769,840,000
37.204762
99
0.60177
false
3.909844
false
false
false
JonLerida/X-Serv-Practica-Aparcamientos
project/aparcamientos/migrations/0002_auto_20170524_1849.py
1
5694
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('aparcamiento...
apache-2.0
-7,302,533,556,450,678,000
34.811321
114
0.544433
false
4.271568
false
false
false
bwmichael/jccc-cis142-python
chapter4/project1-yahtzee.py
1
3244
## # @author Brandon Michael # This program simulates a simplified game of Yahtzee where a player # plays against the computer. # Allow your program to use the randint function import random # Create and initialize pre-loop "constants" TWO_OF_KIND_POINTS = 25 YAHTZEE_POINTS = 50 # Create any other pre-loop variables...
apache-2.0
-5,997,405,287,427,632,000
33.88172
79
0.637793
false
3.340886
false
false
false
florian-f/sklearn
sklearn/tree/tree.py
1
32488
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Code is originally adapted from MILK: Machine Learning Toolkit # Copyright (C) 2008-2011, Luis Pedro Coelho <luis@luispedro.org> # License: MIT. See COPYING.MIT file...
bsd-3-clause
8,197,242,999,076,984,000
37.131455
79
0.553004
false
4.324814
false
false
false
thisismedium/md
docs/examples/fluidprint.py
1
1620
from __future__ import print_function import __builtin__, sys, contextlib, StringIO from md import fluid __all__ = ( 'display', 'read', 'current_input_port', 'current_output_port', 'output_to_string', 'input_from_string', 'output_to_file', 'input_from_file' ) ## Default to None. This let's the cells play...
bsd-2-clause
3,917,577,163,526,138,000
30.153846
68
0.719753
false
3.476395
false
false
false
Gabvaztor/TFBoost
src/projects/Web_Traffic_Time/TFBooster_backup.py
1
7343
# -*- coding: utf-8 -*- """ Author: @gabvaztor StartDate: 04/03/2017 This file contains the next information: - Libraries to import with installation comment and reason. - Data Mining Algorithm. - Sets (train,validation and test) information. - ANN Arquitectures. - A lot of utils methods which you'...
apache-2.0
-1,287,549,112,972,866,000
41.201149
132
0.559444
false
4.469264
true
false
false
mortardata/mortar-examples
luigiscripts/word-luigi-solution.py
1
3104
import luigi from luigi import configuration from luigi.s3 import S3Target, S3PathTask from mortar.luigi import mortartask """ To run, replace <your-handle-here> with something unique to you (for instance, first initial plus last name): mortar luigi luigiscripts/word-luigi-solution.py \ --output-pa...
apache-2.0
3,113,173,805,581,149,700
31.333333
131
0.619523
false
3.944091
false
false
false
cjlee112/socraticqs2
mysite/ctms/middleware.py
1
10451
import re from collections import OrderedDict from django.urls import reverse, resolve, NoReverseMatch from django.conf import settings from django.http import HttpResponseRedirect from ct.models import Course, CourseUnit, UnitLesson, Response from ctms.urls import urlpatterns as ctms_urls from .views import CourseCou...
apache-2.0
3,459,832,055,753,479,700
36.729242
134
0.547507
false
3.963216
false
false
false
TechAtNYU/overlord
overlord/reminder.py
1
5326
import os import requests from datetime import datetime from dateutil.parser import parse from dateutil import tz from pytz import timezone from threading import Thread from overlord import celery from utils import Event, Email, headers from email.mime.multipart import MIMEMultipart from email.mime.text import MIMET...
mit
8,884,969,978,495,147,000
36.244755
163
0.550695
false
3.823403
false
false
false
MadeiraCloud/salt
sources/salt/modules/useradd.py
1
13501
# -*- coding: utf-8 -*- ''' Manage users with the useradd command ''' # Import python libs import re try: import grp import pwd except ImportError: pass import logging import copy # Import salt libs import salt.utils from salt.modules import state_std from salt._compat import string_types log = logging....
apache-2.0
715,055,845,312,761,200
24.425612
79
0.570624
false
3.659799
false
false
false
0sw4l/Cuke
DjFacilito/settings.py
1
2092
""" Django settings for DjFacilito project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
mit
2,898,602,150,506,420,700
23.325581
71
0.724187
false
3.203675
false
false
false
murarth/cashan
cashan_game.py
1
103880
#!/usr/bin/python3 # -*- coding: utf-8 import argparse from collections import Counter, defaultdict, deque import curses import itertools import json import os import random import socket import sys import threading import time from cashan import * from game import * from network import * VERSION = '0.0.4' # High f...
mit
587,392,067,179,884,900
33.523097
91
0.542097
false
3.644912
false
false
false
pombreda/py2neo
py2neo/error/server.py
1
3846
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011-2014, Nigel Small # # 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...
apache-2.0
-7,849,616,567,500,276,000
30.268293
94
0.594904
false
3.880928
false
false
false
agoose77/hivesystem
manual/movingpanda/panda-11b.py
1
6279
import dragonfly import dragonfly.pandahive import bee from bee import connect import math, functools from panda3d.core import NodePath import dragonfly.scene.unbound, dragonfly.scene.bound import dragonfly.std import dragonfly.io import dragonfly.canvas import Spyder # ## random matrix generator from random impor...
bsd-2-clause
-8,391,680,054,532,955,000
27.540909
109
0.644529
false
3.043626
false
false
false
InteractiveComputerGraphics/SPlisHSPlasH
Scripts/Paraview/partio_extension/setup.py
1
3879
from setuptools import setup # Available at setup time due to pyproject.toml from pybind11.setup_helpers import Pybind11Extension, build_ext from pybind11 import get_cmake_dir import sys import platform __version__ = "0.0.1" # The main interface is through Pybind11Extension. # * You can add cxx_std=11/14/17, and th...
mit
5,408,965,410,109,457,000
43.597701
98
0.484403
false
3.894578
false
false
false
7yl4r/eventsEngine
EventsEngine/Event.py
1
1041
''' A base event class. Subclasses should implement abstract methods "trigger" and "action". ''' class Event(object): def __init__(self,trigger=None,action=None): self.trigger = trigger self.action = action self.initiated = False self.completed = False # currently s...
gpl-2.0
8,409,640,018,674,820,000
27.162162
96
0.612872
false
4.775229
false
false
false
youen/djity
djity/utils/inherit.py
1
1641
""" This module uses the django snippets 'Model inheritance with content type and inheritance aware manager' (http://djangosnippets.org/snippets/1034/). Using this module, instances of a model class and its subclasses can be accessed by the objects manager of the super class. Usage: from django.db import models from...
gpl-3.0
4,219,098,135,859,925,000
29.962264
123
0.686167
false
4.012225
false
false
false
mredar/markupsafe
markupsafe/__init__.py
1
10369
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import string from collections import Mapping from markupsafe._compat import text_type, string_types, int_types, \ u...
bsd-3-clause
5,793,642,374,991,073,000
33.795302
82
0.568618
false
4.003475
false
false
false
WeirdCarrotMonster/forest
forest/components/database.py
1
2987
# coding=utf-8 """Модуль описывает функции получения синхронного и асинхронного подключения к базе.""" import motor import pymongo # pylint: disable=R0913,W0613 def get_connection_async( host="127.0.0.1", port=27017, database="trunk", user="admin", password="password", ...
lgpl-3.0
-2,785,771,197,535,213,600
25.295918
87
0.542491
false
2.928409
false
false
false
mlperf/training_results_v0.7
Google/benchmarks/resnet/implementations/resnet-research-TF-tpu-v4-512/resnet_main.py
1
14273
# Copyright 2018 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
8,271,973,849,442,803,000
36.072727
80
0.66342
false
3.504297
false
false
false
laurenbarker/SHARE
project/urls.py
1
2269
"""share URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
apache-2.0
-4,742,425,690,949,599,000
44.38
124
0.690172
false
3.376488
false
false
false
lhillber/qops
figure2.py
1
5048
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import os from figure3 import select, ket, exp from matrix import ops from measures import local_entropies_from_rhos, local_exp_vals_from_rhos from mpl_toolkits.axes_grid1 import ImageGrid from matplotlib import rc rc("text", usetex=True) fon...
mit
-4,930,191,000,067,315,000
32.184211
85
0.419112
false
3.115503
false
false
false
MoisesTedeschi/python
Scripts-Python/Modulos-Diversos/python-com-scrapy/Lib/site-packages/w3lib/encoding.py
1
10288
# -*- coding: utf-8 -*- """ Functions for handling encoding of web pages """ import re, codecs, encodings from sys import version_info _HEADER_ENCODING_RE = re.compile(r'charset=([\w-]+)', re.I) def http_content_type_encoding(content_type): """Extract the encoding in the content-type header >>> import w3lib....
gpl-3.0
4,184,339,390,128,500,700
36.547445
483
0.630735
false
3.252608
false
false
false
xialingxiao/andokaelk
roles/image/files/oauth2/oauth2_proxy/oauth2_proxy.py
1
2932
#!/usr/bin/env python3 ################################################################################ # Abstract: # A wrapper for oauth2_proxy # # Description: # # # Copyright (c) 2015 Dragon Law # Project: Dragon Law Data Manager # Creation: Lingxiao Xia # Creation Date: 18/05/2015 ##################################...
mit
-2,359,374,295,190,575,600
40.295775
219
0.55764
false
3.904128
true
false
false
evandromr/python_scitools
lombscargle.py
1
2281
#!/bin/env python import numpy as np import scipy.signal as ss import astropy.io.fits as fits import matplotlib.pyplot as plt inpt = str(raw_input("File: ")) lc = fits.open(inpt) bin = float(raw_input("bin size (or camera resolution): ")) # Convert to big-endian array is necessary to the lombscargle function time =...
mit
2,129,934,250,010,130,400
24.344444
73
0.658483
false
2.91688
false
false
false
F5Networks/f5-ansible
ansible_collections/f5networks/f5_modules/plugins/modules/bigip_selfip.py
1
28056
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2016, F5 Networks 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 DOCUMENTATION = r''' --- module: bigip_selfip short_desc...
gpl-3.0
8,649,483,992,823,860,000
29.528836
110
0.571536
false
4.161994
false
false
false
wreid/Jacunski_Exercises
python_scripts/ppi_network.py
1
2585
#!/usr/bin/env import networkx as nx import matplotlib.pyplot as plt import numpy as np from scipy import stats from sys import argv from sys import exit def main(args): input_file1 = args[1] input_file2 = args[2] inp1 = sanitize_name(input_file1) inp2 = sanitize_name(input_file2) Y = nx.Graph()...
gpl-2.0
3,597,497,723,429,499,000
23.865385
100
0.598839
false
3.284625
false
false
false
opinnmr/stjornbord
register/registration.py
1
2138
from django.forms import ValidationError from stjornbord.user.models import validate_username import datetime def slugify(name): import unicodedata as ud import string name = unicode(name) slug = u''.join(c for c in ud.normalize('NFD', name.lower()) if ud.combining(c) == 0) slug = slug.repla...
gpl-3.0
2,208,290,807,513,363,200
25.395062
89
0.572965
false
3.448387
false
false
false
comses/catalog
catalog/core/tests/test_views.py
1
10103
import json import logging from unittest import mock from unittest.mock import patch from django.contrib.auth.models import User from haystack.query import SearchQuerySet from citation.models import Publication from .common import BaseTest logger = logging.getLogger(__name__) MAX_EXAMPLES = 30 CONTACT_US_URL = 'co...
gpl-3.0
7,917,445,301,192,095,000
39.09127
124
0.623082
false
3.761355
true
false
false
tisnik/fabric8-analytics-common
integration-tests/features/steps/authorization.py
1
3810
"""Test steps that are related to authorization tokens for the server API and jobs API.""" import os import datetime import json from behave import when, then import jwt from jwt.contrib.algorithms.pycrypto import RSAAlgorithm DEFAULT_AUTHORIZATION_TOKEN_FILENAME = "private_key.pem" # try to register the SHA256 alg...
apache-2.0
-1,218,336,546,389,011,700
33.954128
90
0.698163
false
3.87589
false
false
false
PSU-OIT-ARC/django-local-settings
setup.py
1
2003
import sys from setuptools import find_packages, setup py_version = sys.version_info[:2] py_version_dotted = '{0.major}.{0.minor}'.format(sys.version_info) supported_py_versions = ('2.7', '3.3', '3.4', '3.5', '3.6') if py_version_dotted not in supported_py_versions: sys.stderr.write('WARNING: django-local-sett...
mit
6,929,469,746,565,898,000
26.438356
90
0.630055
false
3.459413
false
false
false
rbrnk/phpffl-gamestats
update_player_ids.py
1
3644
import sys import MySQLdb import MySQLdb.cursors import json import nflgame import os import config as c db = MySQLdb.connect(host=c.dbhost, user=c.dbuser, passwd=c.dbpass, db=c.dbname, cursorclass=MySQLdb.cursors.DictCursor) # File to save a lookup table to be used for nflgame -> cbs player id lookup lookupfile = o...
mit
-5,664,523,390,465,720,000
36.958333
223
0.587267
false
3.138674
false
false
false
kichkasch/gxpphonetools
gxpphonewatcher/SIPWatcher.py
1
1871
#! /usr/bin/python # # SIP Watcher # # Michael Pilgermann (michael.pilgermann@gmx.de) # Version 0.1 (2008-10-31) # # #import sys import pjsua as pj import WatcherApplet import threading import gtk import thread # Globals #current_call = None acc = None acc_cb = None #gui = None # Callback to receive events from ac...
gpl-3.0
-8,859,535,708,912,758,000
22.098765
88
0.609834
false
3.347048
false
false
false
dylanseago/CommunityFund
server/communityfund/apps/home/models.py
1
2355
from django.db import models from django.contrib.auth.models import User from datetime import datetime from django.core.urlresolvers import reverse from django.db.models import Sum from communityfund.apps.home.templatetags.custom_tags import currency_filter class DatedModel(models.Model): created_on = models.Date...
apache-2.0
-5,548,570,505,306,578,000
30.413333
89
0.692994
false
3.879736
false
false
false
dpapathanasiou/intelligent-smtp-responder
utils/email_utils.py
1
2452
#!/usr/bin/python """ Utilities for processing the parsed email output of messages sent through the smtp server """ import re from lxml import html as lxml_html from config import pass_through_mailboxes, action_mailboxes, default_mailbox from rfc_822_email_address_validator import is_valid_email_address def valid...
mit
-4,512,159,627,556,549,000
38.548387
153
0.650489
false
3.867508
false
false
false
davidrpugh/pyAM
pyam/inputs.py
1
9450
""" Classes for modeling heterogenous factors of production. @author : David R. Pugh @date : 2015-08-06 """ from __future__ import division import collections import numpy as np from scipy import optimize, special import sympy as sym class Input(object): """Class representing a heterogenous production input.""...
mit
744,981,528,001,345,400
28.256966
81
0.580529
false
4.5
false
false
false
Azure/azure-sdk-for-python
sdk/agrifood/azure-agrifood-farming/azure/agrifood/farming/aio/operations/_seasons_operations.py
1
18589
# 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
-3,638,587,050,284,170,000
49.651226
162
0.626446
false
4.12722
true
false
false
cpatrick/comic-django
django/comicsite/middleware/project.py
1
2748
from django.core.urlresolvers import resolve,Resolver404 from django.conf import settings from comicmodels.models import ComicSite,get_projectname class ProjectMiddleware: """ Everything you do on comicframework is related to a project. This middleware makes this possible without having to duplicate 'pro...
apache-2.0
-7,650,004,721,259,196,000
36.148649
96
0.61099
false
4.58
false
false
false
codeforamerica/naics-api
data/inverse-index.py
1
6786
# -*- coding: utf-8 -*- import json from sys import argv from re import compile from collections import defaultdict import inflect p = inflect.engine() stop_words = '''a, about, above, after, again, against, all, am, an, and, any, are, aren't, as, at, be, because, been, before, being, below, between, both, but, by, c...
bsd-3-clause
-5,669,027,410,985,313,000
39.261905
729
0.597132
false
3.611319
false
false
false
tbenthompson/cppimport
cppimport/templating.py
1
2092
import io import logging import os import mako.exceptions import mako.lookup import mako.runtime import mako.template logger = logging.getLogger(__name__) def run_templating(module_data): module_data["cfg"] = BuildArgs( sources=[], include_dirs=[], extra_compile_args=[], librarie...
mit
-8,459,070,731,217,982,000
28.055556
87
0.656788
false
3.76259
false
false
false
arozumenko/locust
locust/resource_tools.py
1
5788
# Copyright (c) 2014 Artem Rozumenko (artyom.rozumenko@gmail.com) # # 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
-4,284,016,076,011,271,700
29.145833
77
0.607636
false
3.881958
false
false
false
jvrsantacruz/upversion
tests/__init__.py
1
1934
# -*- coding: utf-8 -*- import os import logging import traceback import contextlib from click.testing import CliRunner from hamcrest import (assert_that, all_of, has_property, has_properties, anything) from upversion import cli logger = logging.getLogger('tests.cli') class CommandTest(object...
gpl-2.0
6,734,251,735,488,621,000
25.493151
76
0.597208
false
3.85259
false
false
false
mementum/bfplusplus
bfplusplus/gui/ProgressDialog.py
1
2589
#!/usr/bin/env python # -*- coding: latin-1; py-indent-offset:4 -*- ################################################################################ # # This file is part of Bfplusplus # # Bfplusplus is a graphical interface to the Betfair Betting Exchange # Copyright (C) 2010 Daniel Rodriguez (aka Daniel Rodriksson) ...
gpl-3.0
9,045,739,586,648,589,000
29.104651
80
0.623793
false
3.752174
false
false
false
open-craft/opencraft
pr_watch/tests/test_api.py
1
11845
# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015-2019 OpenCraft <contact@opencraft.com> # # This program 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 Fre...
agpl-3.0
5,607,447,087,860,703,000
46.003968
114
0.661376
false
3.612382
true
false
false
cauanicastro/smssurveytools
yegsms/settings.py
1
3508
""" Django settings for yegsms project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import dj_database_url # Build paths inside the project like this: os.path.j...
apache-2.0
7,114,435,093,570,781,000
26.40625
88
0.70268
false
3.09894
false
false
false
sdee/yummly-goulash
app/search/search.py
1
1739
from flask import render_template, request, redirect, url_for from wtforms import Form, TextField from app.search.api import YummlyClient from app.search.api import SearchResults from flask_bootstrap import Bootstrap from flask import Flask import random app = Flask(__name__) Bootstrap(app) app.config['DEBUG'] = True ...
mit
-1,652,940,506,979,181,000
36.804348
101
0.707878
false
3.050877
false
false
false
jskeet/google-api-dotnet-client
ClientGenerator/src/googleapis/codegen/targets.py
1
6986
#!/usr/bin/python2.7 # Copyright 2011 Google Inc. All Rights Reserved. """Targets class describes which languages/platforms we support.""" __author__ = 'wclarkso@google.com (Will Clarkson)' import logging import os from googleapis.codegen.filesys import files from googleapis.codegen.utilities import json_expander ...
apache-2.0
420,110,255,415,303,740
30.899543
79
0.6712
false
4.17823
false
false
false
codilime/cloudify-manager
tests/testenv/processes/elastic.py
1
6757
######## # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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...
apache-2.0
3,925,448,571,460,775,000
36.331492
79
0.566672
false
4.562458
false
false
false
gurneyalex/odoo
addons/crm/tests/test_crm_pls.py
4
5565
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import timedelta from odoo import fields, tools from odoo.tests.common import TransactionCase class TestCRMPLS(TransactionCase): def _get_lead_values(self, team_id, name_suffix, country_id, state_id...
agpl-3.0
-9,076,126,193,186,145,000
52
185
0.616532
false
3.395363
true
false
false
kulawczukmarcin/mypox
mininet_scripts/5sw-2host-proactive_net.py
1
1609
#!/usr/bin/python from mininet.net import Mininet from mininet.node import Controller, RemoteController, Node from mininet.cli import CLI from mininet.log import setLogLevel, info from mininet.link import Link, Intf """ THis is from https://haryachyy.wordpress.com/2014/06/14/learning-pox-openflow-controller-proactive...
apache-2.0
-7,188,892,072,148,140,000
25.816667
128
0.628341
false
2.957721
false
false
false
macosforge/ccs-calendarserver
twistedcaldav/test/test_xml.py
1
5529
## # Copyright (c) 2005-2017 Apple 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 by applicable l...
apache-2.0
-8,531,242,181,165,564,000
32.713415
99
0.505336
false
4.306075
true
false
false
puneetgkaur/sugar-toolkit-gtk3
src/sugar3/graphics/menuitem.py
1
3409
# Copyright (C) 2007, Eduardo Silva <edsiper@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # Thi...
lgpl-2.1
-5,601,322,465,322,806,000
34.510417
78
0.645057
false
3.821749
false
false
false
a10networks/acos-client
acos_client/v30/slb/hm.py
1
5639
# Copyright 2014, Jeff Buttars, A10 Networks. # # 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 appli...
apache-2.0
-3,965,902,010,584,862,700
38.159722
99
0.528817
false
3.838666
false
false
false
drifterza/openstack-ansible-os_prometheus_server
doc/source/conf.py
1
10221
#!/usr/bin/env python3 # 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...
apache-2.0
-411,856,084,028,370,200
32.511475
79
0.707074
false
3.746701
false
false
false
MMaus/mutils
fmalibs/sde.py
1
13361
from numpy import ( # array handling asarray, zeros, zeros_like, empty, newaxis, floating, # array operations dot, linspace, mean, std, arange, any, # core math pi, nan, sin, cos, log, sqrt, exp, sinh, isnan, ) from pylab import ( # plotting plot, figure, clf, subplot, semilogy, axis, title, xlab...
gpl-2.0
-5,816,760,792,579,759,000
31.990123
137
0.55909
false
2.782382
true
false
false
TalAmuyal/YAGBC2A
tools/CompileAll.py
1
1996
""" @ Set-up instructions In order to run this tool, the following steps are required: 1. Set the working directory to the project's root. 2. Build the project into a "bin" directory under the project's root. 3. JRE must be installed and available globally through OS shell. The above may be altered by reconfiguring t...
gpl-3.0
-1,318,118,175,961,597,700
20.462366
138
0.655812
false
3.089783
false
false
false
ulikoehler/Translatron
Translatron/Misc/UniprotMetadatabase.py
1
3699
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ A fetcher for the UniProt metadatabase. Iterates over all database IDs ranging from 1-300 and stores basic information about any valid database id in a python dictionary. """ import requests from ansicolor import red, green from bs4 import BeautifulSoup import json _...
apache-2.0
-285,140,666,107,954,020
35.264706
105
0.63801
false
3.968884
false
false
false