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
ogdch/ckanext-meteoswiss
ckanext/meteoswiss/harvesters/meteoswissharvester.py
1
13076
#n -*- coding: utf-8 -*- import json import os import tempfile from uuid import NAMESPACE_OID, uuid4, uuid5 from boto.s3.connection import S3Connection from boto.s3.key import Key from ckan import model from ckan.model import Session from ckan.logic import get_action, action from ckan.lib.munge import munge_title_to_...
agpl-3.0
-5,317,946,303,690,557,000
32.14467
79
0.532353
false
Morgan-Stanley/hobbes
scripts/fregion.py
1
33452
#!/usr/bin/env python ######################################################## # # fregion.py : read structured data files # # to load a file from the path P into the variable f: # f = fregion.FRegion(P) # # to read the stored field 'x' out of f: # f.x # # to read the 'metadata' for the field 'x' (t...
apache-2.0
-8,184,452,706,866,680,000
25.073266
152
0.582207
false
tiagoams/blueC_fluxes
int_adv.py
1
2848
#!/usr/bin/env python # -*- coding: utf-8 -*- """ budget_term_densities Calculates density maps for nutrient budget terms from NEMO-ERSEM output. NERC-DEFRA SSB-BlueC projects Created on Tue Jan 24 09:18:52 2017 @author: TAMS00 """ #import pandas as pd import netCDF4 import xarray as xr import num...
gpl-3.0
214,627,983,886,993,120
32.313253
179
0.629916
false
unibg-gislab/treets
treets/db_client.py
1
5982
#! /urs/bin/python # coding: utf8 from __future__ import print_function import pymongo from random import uniform TWEETS_LIMIT = 0 TRACES_LIMIT = 0 class DBClient(object): '''Docstring for DBClient''' def __init__(self): super(DBClient, self).__init__() self.mongo = pymongo.MongoClient() ...
mit
-6,620,564,958,461,042,000
35.699387
97
0.564694
false
ClearcodeHQ/pytest-redis
src/pytest_redis/executor.py
1
7872
# Copyright (C) 2017 by Clearcode <http://clearcode.cc> # and associates (see AUTHORS). # This file is part of pytest-redis. # pytest-redis 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 versi...
lgpl-3.0
-2,153,815,324,643,324,000
32.21519
100
0.605183
false
PaloAltoNetworks-BD/ansible-pan
library/panos_object.py
1
17603
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 Palo Alto Networks, 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...
isc
49,532,090,653,482,990
34.418511
118
0.589104
false
svenrdz/bot_twitter
autofollowrt/autofollowrt.py
1
21724
# -*- coding: utf-8 -*- # native imports import os import re import sys import copy import time import pickle import random from threading import Thread, RLock from multiprocessing import Queue # external imports # Twitter package: https://pypi.python.org/pypi/twitter # Homepage of Twitter package: http://mike.verdon...
gpl-3.0
-6,055,042,456,488,697,000
33.537361
135
0.506997
false
linksuccess/linksuccess
parsingframework/heatmaps.py
1
18035
import numpy as np import numpy.random import matplotlib.pyplot as plt import cPickle as pickle import MySQLdb from wsd.database import MySQLDatabase import matplotlib.cm as cm from matplotlib.colors import LogNorm, Normalize, BoundaryNorm, PowerNorm from conf import * from matplotlib import style style.use('acm-3c...
mit
-2,729,897,635,614,966,000
29.158863
115
0.623177
false
google/dotty
efilter/stdlib/core.py
1
10013
# EFILTER Forensic Query Language # # Copyright 2015 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 # # Un...
apache-2.0
3,722,554,393,945,833,500
24.478372
80
0.602517
false
endlessm/chromium-browser
third_party/chromite/lib/image_lib_unittest.py
1
25414
# -*- coding: utf-8 -*- # Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Test the image_lib module.""" from __future__ import print_function import collections import gc import glob import os import...
bsd-3-clause
-1,855,077,315,737,941,500
42.074576
80
0.638939
false
pygeek/django
django/contrib/gis/db/backends/postgis/creation.py
1
3881
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation class PostGISCreation(DatabaseCreation): geom_index_type = 'GIST' geom_index_opts = 'GIST_GEOMETRY_OPS' def sql_indexes_for_field(self, mode...
bsd-3-clause
-6,418,817,060,973,817,000
48.126582
99
0.509147
false
sciencewiz1/datahub
src/datahub/browser/views.py
1
1691
import json, sys, re, hashlib, smtplib, base64, urllib, os from auth import * from core.account import manager from django.http import * from django.shortcuts import render_to_response from django.views.decorators.csrf import csrf_exempt from django.core.context_processors import csrf from django.core.validators impor...
mit
-9,209,395,502,883,774,000
28.666667
121
0.752218
false
mikister/webgen
tests/test_dom.py
1
25088
"""Unit tests for `dom.py`. Todo: * Add class methods to html tag tests * Ul (from_list, from_dict, ) * Ol (from_list, from_dict, ) * Table (from_list, ) * Pass an instance of same class as parameter to ElementHTML class (test) * """ import unittest import os # Allowing to import m...
mit
-2,836,461,636,050,776,000
40.813333
122
0.601044
false
downquark/algorithms
square_root.py
1
1141
from math import floor def sqrt(S): """Given an integer, return the square root. A continued fraction expansion implementation. https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Continued_fraction_expansion Args: S: Any natural number """ i = 0 s = 1 i...
gpl-2.0
7,549,270,143,950,171,000
24.377778
100
0.468887
false
brucework/demo
src/python/hello/objvar.py
1
1332
#!/usr/bin/python #Filename: objvar.py class Person: "'Represents a person.'" population = 0 def __init__(self, name): ''''Initializes the person's data.''' self.name = name print '(Initializing %s)'% self.name #When this person is created, he/she #adds to the pop...
gpl-3.0
8,220,158,943,830,193,000
19.492308
69
0.583333
false
Southpaw-TACTIC/Team
src/python/Lib/site-packages/PySide/examples/tutorials/addressbook/part4.py
1
9061
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ## Contact: Qt Software Information (qt-info@nokia.com) ## ## This file is part of the example classes of the Qt Toolkit. ## ######################...
epl-1.0
8,617,441,876,815,813,000
32.684015
90
0.584152
false
kret0s/gnuhealth-live
tryton/server/trytond-3.8.3/trytond/ir/rule.py
1
10814
# This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. from ..model import ModelView, ModelSQL, fields, EvalEnvironment, Check from ..transaction import Transaction from ..cache import Cache from ..pool import Pool from .. import b...
gpl-3.0
1,320,602,009,460,516,000
35.657627
78
0.561309
false
opnsense/core
src/opnsense/scripts/ipsec/list_status.py
1
3842
#!/usr/local/bin/python3 """ Copyright (c) 2015-2019 Ad Schellevis <ad@opnsense.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain th...
bsd-2-clause
-7,422,858,684,513,032,000
41.688889
101
0.640552
false
ddalex/p9
sign/migrations/0007_auto__add_field_channel_description.py
1
7738
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Channel.description' db.add_column(u'sign_channel', 'desc...
mit
-8,665,449,170,731,710,000
66.295652
187
0.544456
false
Intel-Corporation/tensorflow
tensorflow/python/distribute/minimize_loss_test.py
1
22211
# 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
2,174,429,013,716,935,700
41.14611
82
0.62397
false
portnov/sverchok
nodes/network/udp_client.py
1
3820
# ##### 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 distrib...
gpl-3.0
7,752,315,496,420,771,000
32.517544
92
0.605236
false
rlowrance/mlpack
minimize_1d_golden_section.py
1
1783
'''golden section search to minimize a function of one variable in [low,high] NOTE: the function fun is assumed to be unimodal RETURN low high, such that the minimizer is in [low,high] dict, dictionary with function evalutions dict[x] = f(x) ARGS fun(x) -> number low -> number high -> number tolerance -> number...
mit
3,258,253,841,374,939,000
22.773333
77
0.53281
false
jdepoix/goto_cloud
goto_cloud/status_model/models.py
1
2281
from abc import abstractmethod from django.db import models from enums.public import StringEnum from tracked_model.public import TrackedModel from .lifecycle_management import ObjectStatusLifecycleManager, StatusLifecycle class StatusModel(TrackedModel): """ This Model can be inherited by models which hav...
mit
7,181,498,220,778,321,000
31.126761
114
0.665498
false
GorillaNation/pipestash
pipestash/__init__.py
1
3148
import socket import optparse def parseargs(): def parse_field_args(option, opt_str, value, parser): args=[] for arg in parser.rargs: if arg[0] != "-": args.append(arg) else: del parser.rargs[:len(args)] break if getatt...
bsd-3-clause
7,890,449,419,665,262,000
55.214286
269
0.645172
false
sfriesel/suds
suds/xsd/sxbuiltin.py
1
6653
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 b...
lgpl-3.0
-2,954,499,898,351,151,600
25.505976
76
0.563655
false
Bihaqo/t3f
t3f/__init__.py
1
3157
from t3f.tensor_train_base import TensorTrainBase from t3f.tensor_train import TensorTrain from t3f.tensor_train_batch import TensorTrainBatch from t3f.variables import assign from t3f.variables import get_variable from t3f.ops import add from t3f.ops import cast from t3f.ops import flat_inner from t3f.ops import fro...
mit
8,852,712,789,191,167,000
34.875
80
0.803928
false
sporto/rails_go_to_spec
resolver_test.py
1
5072
# to run # python resolver_test.py import unittest try: from .resolver import * except ImportError: from resolver import * class ResolverTest(unittest.TestCase): def test_is_spec_returns_true(self): file = '/spec/foo/something_spec.rb' r = Resolver().is_spec(file) self.assertEqual(r, True) def test_is_sp...
mit
-3,987,177,846,458,583,600
31.935065
77
0.695386
false
openstack/os-net-config
os_net_config/validator.py
1
7202
# -*- coding: utf-8 -*- # Copyright 2017 Red Hat, 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 l...
apache-2.0
-4,055,297,311,342,866,400
38.790055
79
0.621772
false
datalyze-solutions/pandas-qt
pandasqt/views/DataTableView.py
1
13381
# -*- coding: utf-8 -*- from pandasqt.compat import QtCore, QtGui, Qt, Slot, Signal from pandasqt.models.DataFrameModel import DataFrameModel from pandasqt.views.EditDialogs import AddAttributesDialog, RemoveAttributesDialog from pandasqt.views.CustomDelegates import createDelegate from pandasqt.models.mime import Pan...
mit
1,387,420,655,620,008,400
33.312821
128
0.626112
false
PeteAndersen/swarfarm
bestiary/models/items.py
1
6510
from django.contrib.postgres.fields import ArrayField from django.contrib.staticfiles.templatetags.staticfiles import static from django.db import models from django.utils.safestring import mark_safe from django.utils.text import slugify from . import base ESSENCE_MAP = { 'magic': { 'low': 11006, ...
apache-2.0
-2,082,593,143,098,325,200
28.862385
145
0.601075
false
explora26/zephyr
scripts/sanity_chk/harness.py
1
3312
import re from collections import OrderedDict class Harness: GCOV_START = "GCOV_COVERAGE_DUMP_START" GCOV_END = "GCOV_COVERAGE_DUMP_END" FAULTS = [ "Unknown Fatal Error", "MPU FAULT", "Kernel Panic", "Kernel OOPS", "BUS FAULT", "CPU Pa...
apache-2.0
3,593,360,791,085,379,000
29.109091
66
0.485809
false
LinkCareServices/period
docs/conf.py
1
8403
# -*- coding: utf-8 -*- # # period documentation build configuration file, created by # sphinx-quickstart on Tue Jul 10 18:37:45 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
artistic-2.0
6,534,941,978,792,994,000
30.829545
80
0.697132
false
alirizakeles/zato
code/zato-server/test/zato/server/service/internal/kvdb/__init__.py
1
2245
# -*- coding: utf-8 -*- """ Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib from traceback import format_exc # Zato from zato.common import ZatoExc...
gpl-3.0
4,555,896,742,429,259,300
30.180556
100
0.621826
false
semplice/quickstart
quickstart/builder.py
1
2423
# -*- coding: utf-8 -*- # # quickstart - Refreshing the GUI world. # Copyright (C) 2013 Eugenio "g7" Paolantonio # # 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.1 of...
lgpl-2.1
-5,219,807,691,265,484,000
27.505882
80
0.684276
false
junmin-zhu/chromium-rivertrail
chrome/common/extensions/docs/server2/build_server.py
1
2634
#!/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. # This script is used to copy all dependencies into the local directory. # The package of files can then be uploaded to App Engine....
bsd-3-clause
5,980,907,068,329,087,000
35.583333
80
0.621868
false
ddimensia/RaceCapture_App
autosportlabs/comms/comms.py
1
5498
import traceback import threading import multiprocessing from Queue import Empty from time import sleep from kivy.logger import Logger from autosportlabs.comms.commscommon import PortNotOpenException STAY_ALIVE_TIMEOUT = 4 COMMAND_CLOSE = 'CLOSE' COMMAND_KEEP_ALIVE = 'PING' def connection_process_message_reader(rx_qu...
gpl-3.0
-2,222,995,248,042,992,600
34.701299
160
0.631139
false
franklingu/leetcode-solutions
questions/palindrome-linked-list/Solution.py
1
1513
""" Given a singly linked list, determine if it is a palindrome. Example 1: Input: 1->2 Output: false Example 2: Input: 1->2->2->1 Output: true Follow up: Could you do it in O(n) time and O(1) space? """ # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val ...
mit
-2,569,556,633,888,039,400
23.403226
60
0.489095
false
blckshrk/Weboob
modules/popolemploi/backend.py
1
17379
# -*- coding: utf-8 -*- # Copyright(C) 2013 Bezleputh # # 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
5,952,296,868,497,060,000
48.070822
117
0.58163
false
nelseric/qmk_firmware
lib/python/qmk/cli/new/keymap.py
16
1884
"""This script automates the copying of the default keymap into your own keymap. """ import shutil from pathlib import Path import qmk.path from qmk.decorators import automagic_keyboard, automagic_keymap from milc import cli @cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60h...
gpl-2.0
5,085,182,209,697,416,000
39.085106
122
0.706476
false
fivejjs/crosscat
crosscat/cython_code/test_sample.py
1
4283
# # Copyright (c) 2010-2014, MIT Probabilistic Computing Project # # Lead Developers: Dan Lovell and Jay Baxter # Authors: Dan Lovell, Baxter Eaves, Jay Baxter, Vikash Mansinghka # Research Leads: Vikash Mansinghka, Patrick Shafto # # Licensed under the Apache License, Version 2.0 (the "License"); # you may...
apache-2.0
8,966,423,893,119,867,000
35.29661
84
0.69951
false
brahle/I-Rcbot
irc/mysocket.py
1
1895
#!/usr/bin/env python2.6 # Zeckviz IRC bot # Copyright (C) 2011 Bruno Rahle # # 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 Free Software Foundation, either version 3 of the License, or # (at your option) any la...
agpl-3.0
-2,516,814,916,496,474,000
34.092593
79
0.616359
false
ctogle/dilapidator
src/dilap/BROKEN/generate/toremove/street.py
1
1258
import dilap.core.context as dgc import dilap.generate.landscape as dls import dilap.generate.lot as dlt import dilap.primitive.road as dr import dp_vector as dpv import dp_quaternion as dpq class street(dgc.context): def generate(self,worn = 0): start = dpv.vector(-100,-300, 20) end = dpv.vect...
mit
-4,722,324,031,005,298,000
30.45
66
0.605723
false
ninuxorg/netdiff
tests/test_cnml.py
1
4009
import os import libcnml import networkx from netdiff import CnmlParser, diff from netdiff.exceptions import ParserError from netdiff.tests import TestCase CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) cnml1 = '{0}/static/26494_detail_1.cnml'.format(CURRENT_DIR) cnml2 = '{0}/static/26494_detail_2.cnml'.f...
mit
-38,226,968,968,311,980
34.166667
79
0.59566
false
jurcicek/ndm
ndm/model.py
1
19396
#!/usr/bin/env python3 from statistics import mean import tensorflow as tf import numpy as np from tfx.logging import LogMessage class BaseModel: def __init__(self, data, FLAGS): self.data = data self.FLAGS = FLAGS self.batch_idx = tf.placeholder("int32", name='batch_idx') self....
apache-2.0
-3,818,700,218,189,610,000
41.257081
139
0.562951
false
idlesign/django-etc
etc/admin/admins.py
1
2599
from django.contrib import admin from django.contrib import messages from django.db import models from django.http import HttpRequest, HttpResponse, HttpResponseRedirect from django.urls import path if False: # pragma: nocover from .models import CustomModelPage # noqa class EtcAdmin(admin.ModelAdmin): """...
bsd-3-clause
7,494,133,136,866,920,000
31.08642
97
0.643709
false
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/txclib/project.py
1
48650
# -*- coding: utf-8 -*- import getpass import os import re import fnmatch import datetime import time import ssl try: import configparser except ImportError: import ConfigParser as configparser from txclib.web import * from txclib.utils import * from txclib.packages import urllib3 from txclib.packages.urlli...
agpl-3.0
-8,030,408,997,415,867,000
37.611111
98
0.519301
false
hmflash/Cura
cura/QualityManager.py
1
16324
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. # This collects a lot of quality and quality changes related code which was split between ContainerManager # and the MachineManager and really needs to usable from both. from typing import List from UM.Application i...
agpl-3.0
-6,735,441,099,129,865,000
55.076923
145
0.678878
false
msyriac/orphics
bin/rot_recon.py
1
4352
from orphics.mpi import MPI import orphics.pipelines as utils import argparse from enlib import enmap # Parse command line parser = argparse.ArgumentParser(description='Run south rotation test.') parser.add_argument("-x", "--patch-width", type=float, default=40., help="Patch width in degrees.") parser.add_argument("-...
bsd-2-clause
4,958,113,471,433,312,000
41.252427
128
0.637638
false
doozr/euler.py
p0013_large_sum_test.py
1
11957
""" Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 23067588207539346171171...
gpl-3.0
8,063,223,558,314,383,000
54.356481
87
0.851133
false
gjhiggins/graphpath
graphpath/entail.py
1
8355
from __future__ import generators from expr import Step, Class, Property from util.anysets import Set, ImmutableSet empty_set = ImmutableSet() class RuleDict(dict): """A mapping of resources to GraphPath expressions. The expression for a given resource is the Union() of all the expressions assigned to th...
gpl-2.0
-8,830,023,813,209,567,000
31.134615
77
0.59234
false
Intel-Corporation/tensorflow
tensorflow/python/keras/optimizer_v2/ftrl.py
1
9853
# 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
-5,455,901,851,465,060,000
41.106838
80
0.628134
false
faeli/joke
joke/fair/db_url.py
1
2442
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from urlparse import urlparse, parse_qsl except ImportError as e: from urllib.parse import urlparse, parse_qsl from .database import SQLiteDatabase schemes = { 'sqlite': SQLiteDatabase } def parseresult_to_dict(parsed): # urlparse in python 2.6 i...
mit
-5,027,614,411,988,602,000
29.5375
78
0.604013
false
a-nai/django-wiki
wiki/plugins/images/models.py
1
5261
from __future__ import unicode_literals from __future__ import absolute_import import os.path from django.conf import settings as django_settings from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translat...
gpl-3.0
-3,529,403,965,202,404,400
32.08805
83
0.617943
false
fulfilio/trytond-gift-card
product.py
1
3978
# -*- coding: utf-8 -*- from trytond.model import fields, ModelSQL, ModelView from trytond.pool import PoolMeta from trytond.pyson import Eval, Bool __all__ = ['Product', 'GiftCardPrice'] __metaclass__ = PoolMeta class Product: "Product" __name__ = 'product.product' is_gift_card = fields.Boolean("Is Gif...
bsd-3-clause
-2,309,821,036,936,442,000
26.246575
74
0.565108
false
DavidCain/WinterSchool
ws/utils/ratings.py
1
7905
from datetime import timedelta from django.db.models import Case, F, IntegerField, Q, Sum, When import ws.utils.perms as perm_utils from ws import models from ws.utils.dates import local_date, local_now, ws_year def deactivate_ratings(participant, activity): """ Mark any existing ratings for the activity as ina...
gpl-3.0
-4,544,151,928,431,443,500
37.560976
96
0.651739
false
emanueldima/b2share
b2share/modules/deposit/fetchers.py
1
1411
# -*- coding: utf-8 -*- # # This file is part of EUDAT B2Share. # Copyright (C) 2016 CERN. # # B2Share 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...
gpl-2.0
-4,996,539,150,165,683,000
35.179487
76
0.736357
false
suprzer0/aoc2016
day4/solve.py
1
1719
from collections import namedtuple, Counter from itertools import groupby import re from string import ascii_lowercase Room = namedtuple('Room', ['name', 'id', 'chksum']) def common_chars(text): chars = '' cnt = Counter(text) del cnt['-'] for group in groupby(cnt.most_common(), key=lambda c: c[1]): ...
mit
5,726,174,863,873,327,000
25.045455
65
0.601513
false
pschmitt/home-assistant
homeassistant/components/stream/__init__.py
2
7096
"""Provide functionality to stream video source.""" import logging import secrets import threading import voluptuous as vol from homeassistant.const import CONF_FILENAME, EVENT_HOMEASSISTANT_STOP from homeassistant.core import callback from homeassistant.exceptions import HomeAssistantError import homeassistant.helpe...
apache-2.0
-3,241,758,894,251,153,000
29.718615
91
0.628241
false
robk5uj/invenio
modules/bibcirculation/lib/bibcirculation_utils.py
1
21415
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011 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 ## License, or ...
gpl-2.0
-8,326,159,641,433,594,000
29.505698
118
0.543638
false
HiSPARC/publicdb
publicdb/raw_data/date_generator.py
1
1373
import datetime def daterange(start, stop): """Generator for date ranges This is a generator for date ranges. Based on a start and stop value, it generates one day intervals. :param start: a date instance, end of range :param stop: a date instance, end of range :yield date: dates with one da...
gpl-3.0
-3,784,288,338,580,211,700
27.604167
74
0.639476
false
TileStache/TileStache
TileStache/Config.py
1
15616
""" The configuration bits of TileStache. TileStache configuration is stored in JSON files, and is composed of two main top-level sections: "cache" and "layers". There are examples of both in this minimal sample configuration: { "cache": {"name": "Test"}, "layers": { "example": { "...
bsd-3-clause
-1,455,473,924,395,118,800
32.367521
146
0.613473
false
labcodes/django
tests/schema/models.py
1
4719
from django.apps.registry import Apps from django.db import models # Because we want to test creation and deletion of these as separate things, # these models are all inserted into a separate Apps so the main test # runner doesn't migrate them. new_apps = Apps() class Author(models.Model): name = models.CharFie...
bsd-3-clause
8,553,160,393,117,914,000
22.595
77
0.671117
false
ddurieux/alignak
alignak/misc/termcolor.py
1
5121
#!/usr/bin/env python # -*- coding: utf-8 -*- # coding: utf-8 # Copyright (c) 2008-2011 Volvox Development Team # # 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, includin...
agpl-3.0
-3,544,723,343,725,155,000
28.096591
79
0.582894
false
rsgemignani/dotfiles
root/usr/lib/gedit/plugins/smart_highlight/config_manager.py
1
2226
# -*- encoding:utf-8 -*- # config_manager.py is part of smart-highlighting-gedit. # # # Copyright 2010-2012 swatch # # smart-highlighting-gedit 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 ...
gpl-2.0
8,742,912,433,380,789,000
30.352113
82
0.699461
false
jsidew/jakidy
src/food/models.py
1
1882
from django.db import models class Food(models.Model): name = models.CharField(max_length=45) protein = models.DecimalField(max_digits=4, decimal_places=2) carbs = models.DecimalField(max_digits=4, decimal_places=2) fat = models.DecimalField(max_digits=4, decimal_places=2) price = models.DecimalFie...
gpl-3.0
3,854,542,961,084,282,000
32.017544
69
0.565887
false
netphi/deepin-ui
dtk/ui/scrolled_window.py
1
21880
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 ~ 2012 Deepin, Inc. # 2011 ~ 2012 Xia Bin # # Author: Xia Bin <xiabin@linuxdeepin.com> # Maintainer: Xia Bin <xiabin@linuxdeepin.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
gpl-3.0
-7,670,683,437,124,144,000
40.596958
137
0.603016
false
golden-tech-native/gd_facerecognize
server/common/hanzi_to_pinyin/pinyin.py
1
2488
#!/usr/bin/env python # -*- coding:utf-8 -*- """ 原版代码:https://github.com/cleverdeng/pinyin.py 新增功能: 1、可以传入参数firstcode:如果为true,只取汉子的第一个拼音字母;如果为false,则会输出全部拼音; 2、修复:如果为英文字母,则直接输出; 3、修复:如果分隔符为空字符串,仍然能正常输出; 4、升级:可以指定词典的文件路径 """ __version__ = '0.9' __all__ = ["PinYin"] import os.path class PinYin(objec...
mit
-7,410,435,475,929,635,000
27.746667
87
0.551948
false
TheRook/nsshell
nsshell/__init__.py
1
31810
#!/usr/bin/env python #rook from __future__ import print_function import base64 import itertools import random import Queue import string import sys import subprocess import re import os import datetime from argparse import ArgumentParser, RawTextHelpFormatter from twisted.internet import defer, stdio from twisted.n...
gpl-3.0
-888,703,662,291,551,500
42.220109
174
0.536655
false
jaantollander/CrowdDynamics
crowddynamics/core/tests/test_quantities.py
1
1070
import numpy as np import pytest from hypothesis.control import assume from hypothesis.core import given from scipy.spatial.qhull import QhullError, Voronoi from crowddynamics.core.quantities import density_voronoi_1 from crowddynamics.testing import reals def all_unique(data: np.ndarray) -> bool: """Test that a...
gpl-3.0
-7,790,188,025,380,964,000
27.157895
60
0.696262
false
mivp/tessterrain
examples/geo_weather/fetch_weather_data.py
1
3521
#!/usr/bin/env python import csv import json import requests import numpy as np import sqlite3 csv_filename = "testdata/vic_usgs/south_west_stations.csv" db_filename = "testdata/vic_usgs/south_west_stations.db" # open database conn = sqlite3.connect(db_filename) c = conn.cursor() # Create stations table c.execute('...
gpl-3.0
-7,483,555,041,241,263,000
31.311927
140
0.575689
false
eteq/ginga
ginga/qtw/GingaQt.py
1
27414
# # GingaQt.py -- Qt display handler for the Ginga reference viewer. # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # # stdlib imports import sys, os import traceback im...
bsd-3-clause
8,010,920,929,081,022,000
32.14873
92
0.546691
false
mapgears/scribeui
scribeui_pyramid/modules/plugins/mapcache/models.py
1
1215
# -*- coding: utf-8 -*- from scribeui_pyramid.modules.app.sqla import Base, BaseMixin import sqlalchemy as sa #from . import ( # DBSession, # Base, # BaseMixin #) class Job(Base, BaseMixin): __tablename__ = 'jobs' id = sa.Column(sa.Integer, primary_key=True, autoincrement=True) title = sa.Colu...
mit
-287,510,345,046,188,900
27.255814
72
0.61893
false
barneygale/mcocr
app/server.py
1
2546
import StringIO import asyncore import socket import urlparse import re import settings as settings_herp import os import mimetypes import time import traceback import docs import http mimetypes.init() response_reasons = { 200: 'OK', 304: 'Not Modified', 404: 'Not Found', 500: 'Internal Server Error', 501: 'Not I...
bsd-3-clause
-3,733,676,247,853,530,600
23.018868
77
0.677141
false
google-research/google-research
caql/dual_method.py
1
5310
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
5,858,996,064,217,988,000
31.181818
78
0.575706
false
googleapis/python-game-servers
samples/snippets/update_cluster.py
1
2348
#!/usr/bin/env python # Copyright 2020 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 require...
apache-2.0
-2,334,753,272,189,716,500
38.79661
124
0.721039
false
mclaughlin6464/pearce
bin/optimization/cosmo_hyperparams_mcmc.py
1
2197
import emcee as mc from pearce.emulator import OriginalRecipe, ExtraCrispy from pearce.mocks import cat_dict import numpy as np from os import path training_file = '/home/users/swmclau2/scratch/PearceRedMagicXiCosmo.hdf5' a = 1.0 z = 1./a-1.0 fixed_params = {'z':z, 'r':24.06822623} n_leaves, n_overlap = 10, 2 em_metho...
mit
4,898,353,105,985,238,000
32.287879
107
0.646791
false
Azure/azure-sdk-for-python
sdk/datalake/azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/job/models/job_state_audit_record.py
1
1805
# 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
-5,939,820,053,492,980,000
34.392157
81
0.584488
false
tcalmant/ipopo
tests/shell/test_eventadmin.py
1
5604
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Tests the EventAdmin shell commands :author: Thomas Calmant """ # Standard library import threading try: import unittest2 as unittest except ImportError: import unittest # Pelix from pelix.ipopo.constants import use_ipopo import pelix.framework import...
apache-2.0
4,493,402,563,130,737,000
27.738462
80
0.544254
false
Micronaet/micronaet-bom
order_bom_explode_report/report/originali/mrp_status_hw_component_parser.py
1
21833
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2010-2012 Associazione OpenERP Italia # (<http://www.openerp-italia.org>). # Copyright(c)2008-2010 SIA "KN dati".(http://kndati.lv) All Rights Reserved. # G...
agpl-3.0
4,514,814,840,149,318,000
41.809804
95
0.373609
false
google/makani
analysis/control/dynamics.py
1
28331
# Copyright 2020 Makani Technologies 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 to...
apache-2.0
-7,089,321,281,316,663,000
41.222057
80
0.614592
false
offlinehacker/sphinxcontrib.jinjadomain
sphinxcontrib/jinjadomain.py
1
3445
""" sphinxcontrib.jinjadomain ~~~~~~~~~~~~~~~~~~~~~~~~ The jinja domain for documenting jinja templates. :copyright: Copyright 2012 by Jaka Hudoklin :license: BSD, see LICENSE for details. """ import re import os from sphinx import addnodes from sphinx.domains import Domain, ObjType, Index from...
bsd-2-clause
4,406,314,289,829,284,400
27.708333
79
0.584906
false
deuscoin-org/deuscoin-core
qa/rpc-tests/bip9-softforks.py
1
8792
#!/usr/bin/env python2 # Copyright (c) 2015 The Deuscoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * fro...
mit
258,358,214,866,683,870
38.968182
110
0.645018
false
gooftroop/Zeus
ef5/lib/handlers/authentication.py
1
5728
""" """ import logging import settings import tornado.gen as gen from lib.auth import login, logout, is_authenticated from lib.error.exceptions import AuthenticationError class LoginHandler(BaseHandler): """ TODO As designed, Tornado is stateless, which means that everything goes back to client This...
mit
-561,951,879,802,041,500
36.933775
112
0.516585
false
jcshen007/cloudstack
systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py
1
7368
# -- coding: utf-8 -- # 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 # "Li...
apache-2.0
-8,724,128,362,881,490,000
28.007874
173
0.588626
false
ah744/ScaffCC_RKQC
rkqc/tools/embed_truth_table.py
1
1594
#!/home/adam/Documents/revkit-1.3/python #!/usr/bin/python # RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org) # Copyright (C) 2009-2011 The RevKit Developers <revkit@informatik.uni-bremen.de> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
bsd-2-clause
4,276,062,404,617,988,000
36.952381
107
0.732748
false
contactless/mqtt-rpc
python/server.py
1
2415
#!/usr/bin/python import argparse try: import mosquitto except ImportError: import paho.mqtt.client as mosquitto import time, random import sys from mqttrpc import MQTTRPCResponseManager, dispatcher import logging logging.getLogger().setLevel(logging.DEBUG) @dispatcher.add_method def foobar(**kwargs): ...
mit
-7,693,251,067,194,599,000
24.691489
125
0.612422
false
muyeby/NLP
Tagger/PerceptronTagger/PerceptronClassifier.py
1
11234
#!/usr/bin/env python # encoding: utf-8 """ @version: V1.2 @author: muyeby @contact: bxf_hit@163.com @site: http://muyeby.github.io @software: PyCharm @file: assignment2.py @time: 16-7-7 下午8:44 """ from __future__ import print_function from copy import copy import time class PerceptronClassifier(object): # The per...
mit
1,610,744,026,520,288,800
34.539683
123
0.506343
false
PanDAWMS/panda-server
pandaserver/taskbuffer/ErrorCode.py
1
1738
############## errror code # killed EC_Kill = 100 # transfer timeout EC_Transfer = 101 # expire EC_Expire = 102 # aborted EC_Aborted = 103 # wait timeout EC_WaitTimeout = 104 # reassigned by rebrokeage EC_Reassigned = 105 # reassigned by server-side retry EC_Retried = 106 # retried by pilot EC_PilotRetried = 1...
apache-2.0
3,461,998,897,724,639,700
17.688172
53
0.758343
false
coteyr/home-assistant
homeassistant/components/rollershutter/demo.py
1
2390
""" Demo platform for the rollor shutter component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ from homeassistant.components.rollershutter import RollershutterDevice from homeassistant.const import EVENT_TIME_CHANGED from homeassistant.helpers...
mit
-3,810,794,242,415,817,000
27.795181
77
0.593305
false
osupython/pip2
tests/test_search.py
1
8658
import inspect import sys from io import StringIO import pip2.commands.freeze import pip2.commands.search import tests.log from pip2.compat import mock from pip2.compat import packaging @mock.patch.object(pip2.commands.freeze, 'freeze') @mock.patch.object(packaging.pypi.xmlrpc.Client, 'search_projects') class TestSe...
mit
8,237,081,458,629,602,000
41.234146
79
0.57161
false
System25/gecosws-config-assistant
firstboot/serverconf/ChefConf.py
1
3448
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # This file is part of Guadalinex # # This software 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, ...
gpl-2.0
-7,859,253,604,361,442,000
32.784314
185
0.619269
false
tovmeod/anaf
minidetector/__init__.py
1
2048
from useragents import search_strings class Middleware(object): @staticmethod def process_request(request): """Adds a "mobile" attribute to the request which is True or False depending on whether the request should be considered to come from a small-screen device such as a phone...
bsd-3-clause
6,936,481,703,161,349,000
36.925926
124
0.606445
false
AstroHuntsman/POCS
pocs/images.py
1
7615
import os from astropy import units as u from astropy import wcs from astropy.coordinates import EarthLocation from astropy.coordinates import FK5 from astropy.coordinates import SkyCoord from astropy.io import fits from astropy.time import Time from collections import namedtuple from . import PanBase from .utils imp...
mit
-6,846,705,688,718,471,000
34.584112
98
0.562049
false
pombredanne/django-rest-assured
docs/source/conf.py
1
8599
# -*- coding: utf-8 -*- # # django-rest-assured documentation build configuration file, created by # sphinx-quickstart on Fri Oct 24 10:48:27 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated...
bsd-2-clause
9,114,272,420,712,339,000
30.966543
107
0.711362
false
chop-dbhi/omop_harvest
fabfile.py
1
18855
from __future__ import print_function, with_statement import os import sys import stat import json import etcd from functools import wraps from fabric.api import * from fabric.colors import red, yellow, white, green from fabric.contrib.console import confirm from fabric.contrib.files import exists __doc__ = """\ Help...
bsd-2-clause
-3,427,390,257,368,080,400
42.146453
284
0.627208
false
jkriege2/JKQtPlotter
lib/jkqtmathtext/resources/xits/tools/copy-math-from-amiri.py
2
1252
import sys import fontforge amiri = fontforge.open(sys.argv[1]) xits = fontforge.open(sys.argv[2]) amiri.em = 1000 amiri.layers[1].is_quadratic = 0 amiri.selection.all() amiri.unlinkReferences() names = [] alts = [] for aglyph in amiri.glyphs(): u = aglyph.unicode if (u in range(0x1EE00, 0x1EF00) or ...
lgpl-2.1
-6,084,916,335,181,398,000
24.55102
76
0.640575
false
pcdummy/wzlobbyserver-ng
wzlobby/protocol/protocol4.py
1
6682
# -*- coding: utf-8 -*- # vim: set et sts=4 sw=4 encoding=utf-8: # # This file is part of Warzone 2100. # Copyright (C) 2011 Warzone 2100 Project # # Warzone 2100 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 Foundatio...
gpl-2.0
7,357,415,535,087,798,000
29.372727
107
0.550883
false
RPGOne/Skynet
pytorch-master/torch/distributed/collectives.py
1
2102
import torch class reduce_op(object): SUM = object() PRODUCT = object() MAX = object() MIN = object() class group(object): WORLD = object() class _DistributedRequest(object): def __init__(self, request): self.request = request def is_completed(self): return torch._C._d...
bsd-3-clause
4,712,149,255,523,797,000
22.617978
70
0.685062
false
getsentry/symsynd
symsynd/images.py
1
4038
import os import bisect from symsynd.libdebug import get_cpu_name, DebugInfo from symsynd.exceptions import DebugInfoError from symsynd.utils import timedsection, parse_addr from symsynd._compat import string_types, itervalues def get_image_cpu_name(image): cpu_name = image.get('cpu_name') if cpu_name is not...
bsd-3-clause
-2,597,764,121,753,902,000
34.113043
75
0.552006
false
quantopian/zipline
tests/pipeline/test_events.py
1
22248
""" Tests for setting up an EventsLoader and a BlazeEventsLoader. """ from datetime import time from itertools import product from unittest import skipIf import blaze as bz import numpy as np import pandas as pd import pytz from zipline.pipeline import Pipeline, SimplePipelineEngine from zipline.pipeline.common impor...
apache-2.0
8,105,170,151,466,807,000
35.834437
79
0.572726
false