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
ikumen/project-euler
solutions/016.py
1
1723
#!/usr/bin/env python ''' 016.py: https://projecteuler.net/problem=16 Power digit sum 2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^1000? ''' import os import pytest import time import math def power_digit_sum(N, P): """ Calculates the sum of dig...
mit
8,554,294,037,166,094,000
21.671053
74
0.631457
false
2.801626
false
false
false
bhupennewalkar1337/erpnext
erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
1
26311
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint, formatdate, flt, getdate from frappe import _, throw from erpnext.setup.utils import get_company_currency i...
gpl-3.0
-4,062,770,884,894,112,000
37.749632
184
0.689559
false
3.18073
false
false
false
npilon/planterbox
planterbox/decorators.py
1
2059
"""Decorators used when building a package of planterbox features to define steps and hooks Also some private functions used by those decorators. """ from functools import partial import logging import re from six import ( string_types, ) log = logging.getLogger('planterbox') EXAMPLE_TO_FORMAT = re.compile(r'...
mit
-6,669,727,340,165,458,000
29.731343
78
0.668771
false
3.771062
false
false
false
rahimnathwani/measure-anything
project/auth/models.py
1
6772
from datetime import datetime import hashlib from werkzeug.security import generate_password_hash, check_password_hash from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from flask import current_app from flask.ext.login import UserMixin, AnonymousUserMixin from .. import db, login_manager class P...
mit
-7,012,245,458,600,389,000
31.557692
73
0.603219
false
3.834655
true
false
false
eubr-bigsea/tahiti
migrations/versions/1d7c21b6c7d2_add_keras_core_layer_operation_reshape.py
1
10248
# -*- coding: utf-8 -*- """Add Keras Core Layer Operation Reshape Revision ID: 1d7c21b6c7d2 Revises: 4a4b7df125b7 Create Date: 2018-11-01 10:26:22.659859 """ from alembic import op import sqlalchemy as sa from alembic import context from alembic import op from sqlalchemy import String, Integer, Text from sqlalchemy.o...
apache-2.0
7,580,760,651,073,423,000
28.268571
113
0.577314
false
3.694194
false
false
false
phtj/eddex
houdini/python_libs/houdini_ea/wrappers.py
1
4084
""" Executor classes used for executing tasks. """ import sys, os import hou from bson.binary import Binary #Current working directory HOU_FOLDER_PATH = os.getcwd() #Helper functions def _load_hip_file(hip_file_name): """Attempt to load a hip file in Houdini """ #Replacing "\\" with "/" is required to avoid ...
gpl-3.0
4,568,971,612,252,445,000
33.033333
87
0.63859
false
3.312247
false
false
false
fugitifduck/exabgp
lib/exabgp/protocol/family.py
1
5287
# encoding: utf-8 """ address.py Created by Thomas Mangin on 2010-01-19. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import pack from struct import unpack # =================================================================== AFI # http://www.iana.org/assignments/address-family-number...
bsd-3-clause
2,321,827,960,558,510,000
22.923077
142
0.566106
false
2.520019
false
false
false
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
3.88314
false
false
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
2.864286
false
false
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
2.375313
false
false
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
3.531287
false
false
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
4.259134
false
false
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
3.050059
false
false
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
4.327139
false
false
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
3.367877
true
false
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
4.35578
false
false
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
3.443992
false
false
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
2.874055
false
false
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
3.380711
false
false
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
4.354157
false
false
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
4.059309
false
false
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
4.027254
false
false
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
4.094319
false
false
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
3.178253
true
false
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
4.378119
false
false
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
3.839024
false
false
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
3.962478
false
false
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
4.270986
false
false
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
3.316353
false
false
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
3.945518
false
false
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
3.638138
false
false
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
3.247842
false
false
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
4.219493
false
false
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
3.940104
false
false
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
3.574953
false
false
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
4.137555
false
false
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
2.833333
false
false
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
4.048287
false
false
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
4.49963
true
false
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
4.690805
false
false
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
2.997245
false
false
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
4.621128
false
false
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
3.782342
false
false
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
4.224913
false
false
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
4.172086
false
false
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
3.981982
false
false
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
3.458753
false
false
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
4.092272
false
false
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
3.661936
false
false
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
4.224615
false
false
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
3.986725
true
false
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
3.680967
false
false
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
3.700145
false
false
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
3.256055
false
false
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
3.573412
false
false
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
2.515753
false
false
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
3.346958
false
false
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
3.76773
false
false
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
3.393855
false
false
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
3.186483
false
false
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
2.652348
false
false
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
3.77492
false
false
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
2.449275
false
false
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
4.187935
false
false
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
4.207207
true
false
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
5.272398
false
false
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
3.103747
false
false
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
3.892655
false
false
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
3.771772
true
false
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
4.90411
false
false
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
3.691383
true
false
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
3.525547
false
false
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
3.361702
false
false
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
4.149306
false
false
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
3.523517
false
false
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
4.320675
false
false
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
4.02697
false
false
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
3.764976
true
false
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
2.904872
false
false
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
4.20516
false
false
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
3.204268
false
false
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
4.167183
false
false
false
PieterMostert/Lipgloss
view/pretty_names.py
1
1617
# LIPGLOSS - Graphical user interface for constructing glaze recipes # Copyright (C) 2017 Pieter Mostert # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # This progra...
gpl-3.0
344,815,602,470,841,860
32
70
0.594929
false
3.273279
false
false
false
gsnbng/erpnext
erpnext/patches/v4_2/fix_gl_entries_for_stock_transactions.py
2
2129
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import print_function, unicode_literals import frappe from frappe.utils import flt def execute(): from erpnext.stock.stock_balance import repost repost(allow_zero_rate=True,...
agpl-3.0
-6,838,263,425,813,662,000
38.425926
100
0.672147
false
3.126285
false
false
false
alessio/prey
platform/linux/prey-config.py
1
21957
#!/usr/bin/env python ################################################ # Prey Configurator for Linux # By Tomas Pollak # (c) 2010 - Fork Ltd. (usefork.com) ################################################ # if having trouble with the GTK theme as root, do this: # sudo ln -s ~/.themes/ /root/.themes #################...
gpl-3.0
-2,701,603,045,709,129,000
35.53411
455
0.644851
false
3.212436
true
false
false
xrmx/pylokit
setup.py
1
1072
from setuptools import setup, find_packages import os VERSION = "0.8.1" CLASSIFIERS = [ 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Operating System :: OS Independent'...
mpl-2.0
-7,979,361,998,995,849,000
28.777778
88
0.655784
false
3.549669
false
false
false
hroark13/android_kernel_zte_draconis
scripts/gcc-wrapper.py
2
3383
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain th...
gpl-2.0
7,115,874,685,368,545,000
34.239583
97
0.668342
false
4.105583
false
false
false
rouxcode/django-cms-plugins
cmsplugins/baseplugin/utils.py
1
1125
from __future__ import unicode_literals from importlib import import_module from django.utils import six from django.utils.html import mark_safe from django.utils.translation import ugettext_lazy as _ def get_indicator_hidden(request, instance): html = '' is_visible = getattr(instance, 'is_visible', True) ...
mit
25,095,546,226,057,910
29.405405
70
0.636444
false
3.800676
false
false
false
bsandrow/hn-saved-stories
hn_saved_stories/__init__.py
1
8406
import os import json import re import sys import requests import lxml.html from datetime import datetime, timedelta from pprint import pprint as PP from time import sleep from urlparse import urljoin from .utils import hn_relatime_to_datetime, get_story_id from .logger import logger def parse_date_header(date): ...
mit
7,238,045,857,086,352,000
35.868421
134
0.557935
false
4.023935
false
false
false
rosarior/mayan
apps/main/__init__.py
1
2420
from __future__ import absolute_import from django.utils.translation import ugettext_lazy as _ from django.conf import settings from navigation.api import register_top_menu from navigation.api import register_links from project_setup.api import register_setup from project_tools.api import register_tool from .conf.se...
gpl-3.0
7,616,351,844,105,236,000
35.119403
177
0.659504
false
3.180026
false
false
false
annarev/tensorflow
tensorflow/python/distribute/input_lib.py
1
101510
# 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,909,316,437,415,284,700
39.799839
110
0.663353
false
4.231346
false
false
false
dellytools/maze
readfq.py
1
1674
# source: https://github.com/lh3/readfq def readfq(fp): # this is a generator function last = None # this is a buffer keeping the last unprocessed line while True: # mimic closure; is it a bad idea? if not last: # the first record or a record following a fastq for l in fp: # search for the ...
mit
-3,479,504,749,326,615,600
39.829268
74
0.492832
false
3.948113
false
false
false
hello-base/web
apps/merchandise/music/managers.py
1
1125
# -*- coding: utf-8 -*- from django.db import models from django.db.models.query import QuerySet class EditionManager(models.Manager): def find_edition(self, release, edition, **kwargs): if release: kwargs[release.identifier] = release if edition: kwargs[edition.parent.iden...
apache-2.0
4,398,973,060,987,976,000
30.25
106
0.648
false
3.933566
false
false
false
ndronen/pylearnutils
pylearnutils/datasets/sparse_expander.py
1
7801
# From https://gist.github.com/ccsevers/10295174 import os.path import numpy as np from .utils import take_subset from pylearn2.datasets.dataset import Dataset from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix from pylearn2.utils.iteration import (SequentialSubsetIterator, FiniteDatasetIterator,...
bsd-3-clause
-6,055,127,632,347,842,000
32.337607
195
0.542879
false
4.138462
false
false
false
watson-developer-cloud/python-primer-companion-code
episode-2/flask/src/translation.py
1
2054
# -*- coding: utf-8 -*- # Copyright 2016 IBM Corp. 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
-5,859,510,575,257,219,000
36.345455
111
0.729309
false
4.243802
false
false
false
justanr/pyxl
pyxl.py
1
13205
''' This simple module consists of the Pyxl class and a few helper functions. ''' from os.path import basename, join from glob import glob from PIL import Image, ImageDraw, ImageFont #import flickrapi #Helper functions. def buildHex(hexStr): ''' Accepts a supposed hex color string and ensures it's 6 chara...
mit
8,869,948,142,380,855,000
29.780886
79
0.526089
false
4.202737
false
false
false
elemel/drillion
drillion/cannon_entity_creator.py
1
1825
from drillion.animation_component import AnimationComponent from drillion.collision import CollisionBody from drillion.collision_component import CollisionComponent from drillion.entity import Entity from drillion.maths import Polygon2, Transform2 from drillion.sprite import PolygonSprite from drillion.sprite_component...
mit
-3,641,659,004,998,115,000
42.452381
78
0.647123
false
4.324645
false
false
false
desmo999r/cmssysadmin
cmssysadmin/__init__.py
1
1437
import os import socket import fcntl import struct import subprocess import logging logger = logging.getLogger(__name__) class CmdLine(object): options = {} class __metaclass__(type): def __new__(cls, *kargs, **kwargs): t = type.__new__(cls, *kargs, **kwargs) with open("/proc/...
gpl-2.0
-8,696,028,773,016,488,000
28.9375
77
0.551844
false
3.565757
false
false
false
spadev/chatlogsync
chatlogsync.py
1
10218
#!/usr/bin/env python # Copyright 2013 Evan Vitero # This file is part of chatlogsync. # chatlogsync is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
-4,886,149,893,731,973,000
29.777108
79
0.534743
false
4.275314
false
false
false
evilsephiroth/plugin.video.vvvvid
vvvvid.py
1
1369
import urllib2 def f(m): l = list() o = 0 b = None while not b and o < len(m): n = m[o] <<2 o +=1 k = -1 j = -1 if o < len(m): n += m[o] >> 4 o += 1 if o < len(m): k = (m[o - 1] << 4) & 255; ...
gpl-2.0
-2,904,059,955,838,083,000
22.482143
74
0.308985
false
3.132723
false
false
false