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
freedomtan/tensorflow
tensorflow/python/keras/preprocessing/timeseries.py
1
8536
# Copyright 2020 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,371,571,566,166,718,000
40.843137
94
0.678304
false
akintolga/superdesk-aap
server/aap/io/feed_parsers/zczc_medianet.py
1
4102
# # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license*. from .zczc import ZCZCFeedParser from superdesk.metadata.item import FO...
agpl-3.0
-4,504,097,776,540,009,500
39.215686
120
0.573379
false
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/django/contrib/gis/db/backends/mysql/operations.py
4
3816
from django.contrib.gis.db.backends.base.adapter import WKTAdapter from django.contrib.gis.db.backends.base.operations import ( BaseSpatialOperations, ) from django.contrib.gis.db.backends.utils import SpatialOperator from django.contrib.gis.db.models import aggregates from django.contrib.gis.geos.geometry import G...
apache-2.0
3,364,332,919,509,989,400
37.545455
95
0.622379
false
Ghini/ghini.desktop
bauble/utils/test.py
1
10762
# -*- coding: utf-8 -*- # # Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <brett@belizebotanic.org> # Copyright (c) 2012-2015 Mario Frasca <mario@anche.no> # Copyright 2017 Jardín Botánico de Quito # # This file is part of ghini.desktop. # # ghini.desktop is free software: you can redistribute it and/or modify # i...
gpl-2.0
2,246,268,003,325,092,400
36.103448
114
0.593401
false
dguevel/PyZOGY
PyZOGY/test/mock_image_class.py
1
1822
import numpy as np from astropy.io import fits class MockImageClass(np.ndarray): """Creates a mock version of ImageClass for testing""" def __new__(cls, image_filename='', psf_filename='', mask_filename=None, n_stamps=1, saturation=np.inf, variance=np.inf, shape=(50,50)): raw_image, header = np.ones(s...
mit
7,069,680,640,840,340,000
40.409091
140
0.618551
false
rawdlite/mopidy-beets-local
setup.py
1
1430
from __future__ import unicode_literals import re from setuptools import find_packages, setup def get_version(filename): content = open(filename).read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content)) return metadata['version'] setup( name='Mopidy-BeetsLocal', version=get_vers...
apache-2.0
-1,899,545,129,688,441,900
27.039216
68
0.586713
false
SalesforceFoundation/CumulusCI
cumulusci/tasks/metadata_etl/value_sets.py
1
3136
from cumulusci.core.exceptions import TaskOptionsError from cumulusci.tasks.metadata_etl import MetadataSingleEntityTransformTask from cumulusci.utils.xml.metadata_tree import MetadataElement class AddValueSetEntries(MetadataSingleEntityTransformTask): entity = "StandardValueSet" task_options = { **Me...
bsd-3-clause
-2,364,462,508,562,814,000
41.958904
98
0.546237
false
mrtukkin/ifp
olympic_layer/olympic_data_layer.py
1
3300
import caffe import numpy as np from glob import glob import random from PIL import Image from os.path import normpath, basename from scipy.misc import imresize from ifp_morris import downsample_segmentation class OlympicDataLayer(caffe.Layer): im_factor = 1.0 #label_factor = 0.25 label_factor = 0.5 #...
gpl-3.0
-33,537,435,243,634,360
31.352941
82
0.578788
false
UCHIC/ODM2Sensor
src/sensordatainterface/forms.py
1
31049
# -*- coding: utf-8 -*- from django.core.exceptions import ValidationError from django.db.models import Q from django.forms import ModelForm, TextInput, Textarea, NumberInput, ModelChoiceField, DateTimeInput, Select, SelectMultiple \ , ModelMultipleChoiceField, FileInput, HiddenInput from django.forms.models import...
bsd-3-clause
-1,623,401,265,978,536,200
32.492988
176
0.60735
false
zackdever/vsims
vsims/nestedstore.py
1
2886
from vsims.block import Block class NestedStore: """Simple key-value store that supports nested transactional blocks.""" def __init__(self): self.blocks = [] self.store = {} self.value_counts = {} def set(self, key, value, doLog=True): """Add the key to the store if not alr...
mit
7,066,074,681,128,292,000
30.369565
78
0.567221
false
Venturi/cms
env/lib/python2.7/site-packages/aldryn_people/south_migrations/0009_rename_tables_because_of_new_cms.py
1
14315
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import connection class Migration(SchemaMigration): TABLES_MAPPING = { 'cmsplugin_peopleplugin': 'aldryn_people_peopleplugin', } REVERSE_TABLES_MAPPING = dict((v, k) for k, v in TA...
gpl-2.0
6,811,224,199,680,188,000
80.335227
192
0.557248
false
WebCampZg/conference-web
people/admin.py
1
1117
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from people.models import User from django.utils.translation import ugettext as _ from .forms import CustomUserCreationForm, CustomUserChangeForm class CustomUserAdmin(UserAdmin): # Set the add/modify forms add_form = CustomUser...
bsd-3-clause
-74,037,275,173,721,460
35.032258
85
0.610564
false
nyaruka/django-hamlpy
hamlpy/test/test_attributes.py
1
11450
import unittest from collections import OrderedDict from hamlpy.compiler import Compiler from hamlpy.parser.attributes import read_attribute_dict from hamlpy.parser.core import ParseException, Stream class AttributeDictParserTest(unittest.TestCase): @staticmethod def _parse(text): return read_attribu...
mit
2,449,532,288,532,912,000
40.941392
132
0.515808
false
nearlyfreeapps/python-googleadwords
tests/adspygoogle/adwords/traffic_estimator_service_unittest.py
1
4019
#!/usr/bin/python # # Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
-3,430,418,294,230,301,700
30.896825
74
0.497387
false
jccotou/OneCodex-Python
src/v0/common/OneCodexRequest.py
1
1451
import requests from v0.config import Configuration class OneCodexRequest(object): @classmethod def get(cls, url, **kwargs): """ Issue a get request to the given action :param url: The One Codex URL to which the GET request will be issued. :return: The request object to the gi...
gpl-2.0
-3,258,561,765,096,408,000
35.3
94
0.643694
false
sapcc/monasca-agent
monasca_setup/detection/plugins/octavia.py
3
1383
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP # 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/licens...
bsd-3-clause
-7,596,376,750,140,457,000
36.378378
80
0.647144
false
juju/python-libjuju
juju/client/facade.py
1
29940
import argparse import builtins import functools import json import keyword import pprint import re import textwrap import typing import typing_inspect from collections import defaultdict from glob import glob from pathlib import Path from typing import Any, Mapping, Sequence, TypeVar from . import codegen _marker = ...
apache-2.0
-4,172,417,565,822,012,000
31.472885
124
0.52682
false
artursmet/django-prices-openexchangerates
setup.py
1
1578
#! /usr/bin/env python import os from setuptools import setup os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_settings') CLASSIFIERS = [ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Progr...
bsd-3-clause
7,590,473,101,946,400,000
36.571429
78
0.676806
false
Yangqing/caffe2
caffe2/python/layers/sparse_lookup.py
1
13787
# Copyright (c) 2016-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
2,902,705,643,870,155,000
38.846821
81
0.565895
false
odahoda/noisicaa
noisicaa/builtin_nodes/instrument/model.py
1
2817
#!/usr/bin/python3 # @begin:license # # Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de> # # 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 y...
gpl-2.0
1,434,338,962,164,650,500
34.2125
85
0.699681
false
groovehunter/xmlflat2db
test/test_McApp.py
1
1973
from TestBase import TestBase class TestMcApp(TestBase): """ sollte grundlegende ablaeufe der app testen """ def setUp(self): """ instantiieren; sources laden; db init. """ TestBase.setUp(self) self.mc.scan_source_dirs_all() self.mc.scan_sources() self.mc.source_...
gpl-2.0
-7,792,078,210,384,689,000
27.185714
74
0.608718
false
yuval-harpaz/MNE4D
pyScripts/yoni.py
1
1301
__author__ = 'yuval' import mne from os import chdir #from IPython.display import Image #from mayavi import mlab # mne_bti2fiff.py -p xc,hb,lf,9_34c,rfhp0.1Hz -o idan_raw.fif chdir("/home/yuval/wsMNE/") raw=mne.io.bti.read_raw_bti('xc,hb,lf_c,rfDC') raw.save('idanTest-raw.fif') raw=mne.io.Raw('idanTest-raw.fif') sub...
gpl-2.0
3,468,862,391,317,658,000
35.138889
126
0.749424
false
cisalhante/matricula-o-matic
test_bench_disciplina.py
1
1134
__author__ = "William Batista Aguiar Motta" __email__ = "william.b.motta@aluno.unb.br" __license__ = "GPL" import matricula_web_web_crawler as MT import sys if len(sys.argv)>1: for a in sys.argv[1:]: # print('\n') D = MT.Disciplina(a) print(D.codigo) print(D.nome) print(...
gpl-3.0
-4,359,458,083,531,792,400
23.652174
44
0.538801
false
ptressel/sahana-eden-madpub
modules/s3/s3validators.py
1
20338
# -*- coding: utf-8 -*- """ Custom Validators @requires: U{B{I{gluon}} <http://web2py.com>} @author: Fran Boon <fran[at]aidiq.com> @author: Dominic König <dominic[at]aidiq.com> @author: sunneach @copyright: (c) 2010-2011 Sahana Software Foundation @license: MIT Permission is hereby gran...
mit
7,582,023,155,462,627,000
33.526316
132
0.511703
false
fakusb/FiVES-Nao-Visualisation
WebClient/resources/models/v11/modify.py
1
21395
# vim: fenc=utf-8 foldmethod=marker # call this script with nao-dummy.html as argument. import os import sys import math from subprocess import call, Popen, PIPE if not len(sys.argv) > 1: print("No file argument given.") sys.exit() infile = sys.argv[1] if not os.path.isfile(infile): print("No valid file ...
lgpl-3.0
1,122,742,542,264,320,800
37.273703
90
0.665483
false
jadhavhninad/-CSE_515_MWD_Analytics-
Phase 1/Project Code/phase1_code/print_actor_vector.py
1
4823
from mysqlConn import DbConnect import argparse import operator from math import log import pprint #DB connector and curosor db = DbConnect() db_conn = db.get_connection() cur2 = db_conn.cursor(); #Argument parser parser = argparse.ArgumentParser() parser.add_argument("ACTOR_ID") parser.add_argument("MODEL") args = p...
gpl-3.0
-3,575,886,717,172,771,000
33.697842
133
0.671574
false
philippj/python-burningseries
notifier.py
1
3494
#!/usr/local/bin/python # -*- coding: utf-8 -*- #python-burningseries Copyright (C) 2015 Philipp "freaK" ''' YOWSUP 2.0 https://github.com/tgalal/yowsup ''' ''' python-burningseries # This does sen...
gpl-2.0
-1,798,651,883,595,741,000
32.932039
321
0.59731
false
ipa-led/airbus_coop
airbus_docgen/src/airbus_docgen/docgen/pkg/__init__.py
1
7020
#!/usr/bin/env python # # Copyright 2015 Airbus # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA) # # 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 # # ...
apache-2.0
3,991,856,374,120,932,000
35.753927
135
0.562963
false
chrys87/fenrir
src/fenrirscreenreader/commands/commands/review_next_line.py
1
1627
#!/bin/python # -*- coding: utf-8 -*- # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributers. from fenrirscreenreader.core import debug from fenrirscreenreader.utils import line_utils class command(): def __init__(self): pass def initialize(self, environment): self...
lgpl-3.0
8,339,499,634,889,436,000
43.194444
158
0.610326
false
lipis/life-line
main/control/user.py
1
12057
# coding: utf-8 import copy from flask.ext import login from flask.ext import wtf from flask.ext.babel import gettext as __ from flask.ext.babel import lazy_gettext as _ from google.appengine.ext import ndb import flask import wtforms import auth import cache import config import i18n import model import task import...
mit
-6,274,276,460,085,191,000
31.763587
94
0.606121
false
jschornick/i2c_device
setup.py
1
1721
import os from glob import glob from setuptools import setup, find_packages # Setup flags and parameters pkg_name = 'i2c_device' # top-level package name # Cache readme contents for use as long_description readme = open('readme.md').read() # Call setup() setup( name=pkg_name, version='0.1', description='I2C d...
mit
-3,040,005,242,851,160,000
32.096154
77
0.677513
false
alexandrosstergiou/The-Drivers-Assistant-Traffic-Sign-Recognition
show.py
1
1041
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import ImageGrid import numpy as np from os import listdir, getcwd from os import chdir from PIL import Image import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib.image as mimage from ...
mit
2,028,056,922,246,869,200
21.148936
66
0.691643
false
andyneff/python-plyfile
examples/plot.py
1
1337
''' Example script illustrating plotting of PLY data using Mayavi. Mayavi is not a dependency of plyfile, but you will need to install it in order to run this script. Failing to do so will immediately result in ImportError. ''' from argparse import ArgumentParser import numpy from mayavi import mlab from plyfile ...
gpl-3.0
-5,918,219,094,796,757,000
23.759259
72
0.59985
false
Akuli/porcupine
tests/test_filetypes_plugin.py
1
3057
import logging import pathlib import sys from tkinter import filedialog import pytest from porcupine import dirs, filedialog_kwargs, get_main_window from porcupine.plugins import filetypes @pytest.fixture def custom_filetypes(): # We don't overwrite the user's file because porcupine.dirs is monkeypatched as...
mit
-3,899,674,040,829,050,400
32.228261
99
0.697089
false
GNOME/dots
dots/docdocument.py
1
1733
# Dots - A braille translation program. # # Copyright (C) 2010 Consorcio Fernando de los Rios # Author: Fernando Herrera <fherrera@onirica.com> # # 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,...
gpl-3.0
1,013,742,404,977,871,100
31.092593
71
0.699365
false
shashi28/nuts
port scanner/ui_portScanner.py
1
4932
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'portScanner.ui' # # Created: Tue Apr 29 18:10:30 2014 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except At...
mit
-6,696,726,251,446,786,000
49.326531
109
0.708232
false
ewejeen/2017sejongAI
week 12/2-1.py
1
2186
from nltk.corpus import movie_reviews from nltk.classify import NaiveBayesClassifier from nltk.classify.util import accuracy as nltk_accuracy def extract_features(words): return dict([(word, True) for word in words]) if __name__=='__main__': fileids_pos = movie_reviews.fileids('pos') fileids_neg = movie...
gpl-3.0
2,249,432,951,698,209,800
40.245283
531
0.723696
false
default1406/PhyLab
PythonExperimentDataHandle/phylab.py
1
4356
# -*- coding: utf-8 -*- from math import sqrt #将二维列表x中的每一个值保留b位小数(带四舍五入) def RoundTwo(x,b): for i in range(len(x)): for j in range(len(x[i])): x[i][j] = round(x[i][j],b) if b == 0: x[i][j] = ("%d" %x[i][j]) elif b == 1: x[i][j] = ("%.1f" %x[i][j]) elif b == 2: x[i][j] = ("%.2f" %x[i][j]) ...
gpl-2.0
-669,399,115,657,459,200
18.959391
97
0.453204
false
vaibhawvipul/Python-Politics-Game
trailblazers.py
1
20603
import sys import math import time print "\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\vEnter Your name" name = raw_input("> ") """This will display only first name""" f_name = name.split() print "\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\vWelcome %r! Be a \n\n\n\n\t\t\t...TRAILBLAZER..."...
apache-2.0
1,313,378,677,649,439,200
45.718821
173
0.653885
false
fniephaus/alfred-dropbox
src/dropbox_filter.py
1
5886
import os import sys import time from email.utils import parsedate import config from helpers import get_resource, get_hash, get_account_info, uid_exists from dropbox import client from workflow import Workflow, PasswordNotFound, ICON_TRASH from workflow.background import run_in_background def main(wf): if wf.u...
mit
-1,506,039,148,886,385,700
34.672727
80
0.51546
false
jakevdp/altair
altair/vegalite/v3/schema/mixins.py
1
47188
# -*- coding: utf-8 -*- # # The contents of this file are automatically written by # tools/generate_schema_wrapper.py. Do not modify directly. from . import core from altair.utils import use_signature from altair.utils.schemapi import Undefined class MarkMethodMixin(object): """A mixin class that defines mark met...
bsd-3-clause
-2,069,377,104,403,368,400
57.330037
104
0.635946
false
alejo8591/maker
core/api/managers.py
1
2413
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of maker. # License www.tree.io/license from django.db import models from django.contrib.auth.models import User from maker.core.conf import settings KEY_SIZE = 18 SECRET_SIZE = 32 CONSUMER_DB = getattr(settings, 'MAKER_API_CONSUMER_DB', 'default...
mit
2,176,478,604,376,307,200
28.426829
86
0.594281
false
wengzhiwen/Your-Vehicle-Status
main.py
1
1119
# coding=utf-8 import os import helper from google.appengine.ext.webapp import template from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users class MainHandler(webapp.RequestHandler): def get(self): user = users.get_current_user() ...
mit
2,130,439,821,703,919,400
28.756757
75
0.563124
false
SushiTee/teerace
teerace/accounts/forms.py
1
4377
from django import forms from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.core.exceptions import ImproperlyConfigured from accounts.models import UserProfile from annoying.functions import get_config from recaptcha_works.fields import RecaptchaField class RegisterFo...
bsd-3-clause
-4,667,468,854,348,954,000
33.203125
76
0.739319
false
bparsons/bootalert
bootalert.py
1
2055
#!/usr/bin/python2 """ bootalert Sends email with hostname and IP address Brian Parsons <brian@pmex.com> """ import ConfigParser import datetime import re import smtplib import socket import sys import urllib2 # Get Hostname hostname = socket.gethostname() # Get current IP try: ipsite = urllib2.urlopen('http...
mit
3,794,377,055,659,140,600
24.6875
122
0.672019
false
papaiking/faceChecker_device
app/lib/search.py
1
3775
""" @Author: Thuc VX<vxthuc@labsofthings.com> @ORG: labsofthings.com @date: 27 May 2017 Purpose: This package is for search for user in captured image. It does some processing: - Request to get Linkedface token, - Post search image to Linkedace, - Ssearch user appear in image """ import time import req...
mit
-2,242,247,548,680,306,700
33.009009
115
0.600795
false
networkdynamics/zenlib
src/zen/drawing/ubigraph.py
1
12030
""" The ``zen.drawing.ubigraph`` module provides support for rendering Zen graphs in the `Ubigraph visualization environment <http://ubietylab.net/ubigraph/>`_. The renderer will update the visualization in real time as changes are made to the underlying graph. Furthermore, edges and nodes can be visually highlighted...
bsd-3-clause
-3,296,160,238,034,257,400
34.385294
386
0.705653
false
cjbe/artiqDrivers
artiqDrivers/devices/coherentDds/driver.py
1
6338
import logging import serial import math import time logger = logging.getLogger(__name__) class CoherentDds: ser = None; lsbAmp = 1.0 / 16383 # 0x3fff is maximum amplitude lsbPhase = 360.0 / 65536 # Degrees per LSB. def __init__(self, addr, clockFreq, baudrate=115200, internal_clock=False, ...
gpl-3.0
-1,789,794,188,135,591,000
38.36646
129
0.622436
false
enixdark/im-r-e-d-i-s
flask-cook/my_app/catalog/forms.py
1
2193
from flask_wtf import Form from wtforms import TextField,DecimalField,SelectField from decimal import Decimal from wtforms.validators import InputRequired,NumberRange,Optional from models import Category,Product from wtforms.validators import ValidationError from wtforms.widgets import html_params,Select, HTMLString fr...
mit
-5,309,016,394,700,146,000
30.782609
100
0.720474
false
arokem/MRS-old
MRS/qc.py
1
2437
""" quality control for MRS data """ import os import os.path as op import nibabel as nib import numpy as np import nipype.pipeline.engine as pe from nipype.interfaces import fsl def motioncheck(ref_file, end_file, out_path=None, thres=5.0): """ Checks motion between structural scans of the same modality. ...
mit
-6,128,460,252,175,409,000
26.382022
78
0.629873
false
3liz/QuickOSM
QuickOSM/ui/base_overpass_panel.py
1
9703
"""Panel OSM Queries based on Overpass base class.""" import io from qgis.core import ( Qgis, QgsCoordinateReferenceSystem, QgsCoordinateTransform, QgsGeometry, QgsProject, QgsRectangle, QgsVectorLayer, ) from qgis.PyQt.QtWidgets import QCompleter, QDialog from QuickOSM.core.exceptions im...
gpl-2.0
7,361,262,418,288,470,000
38.283401
101
0.601154
false
maybelinot/clicktrack
setup.py
1
2323
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: Eduard Trott # @Date: 2015-09-07 14:59:52 # @Email: etrott@redhat.com # @Last modified by: etrott # @Last Modified time: 2015-10-05 11:03:49 from setuptools import setup VERSION_FILE = "clicktrack/_version.py" VERSION_EXEC = ''.join(open(VERSION_FILE).read...
gpl-3.0
8,813,746,658,269,782,000
26.654762
77
0.605682
false
hzlf/openbroadcast
website/apps/alibrary/migrations/0099_auto__add_distributor.py
1
56270
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Distributor' db.create_table('alibrary_distributor', ( ('id', self.gf('django.db...
gpl-3.0
-5,774,735,863,854,991,000
98.243386
240
0.560459
false
craigbruce/awacs
awacs/elasticache.py
1
2765
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from aws import Action service_name = 'AWS ElastiCache' prefix = 'elasticache' AddTagsToResource = Action(prefix, 'AddTagsToResource') AuthorizeCacheSecurityGroupIngress = \ Action(prefix, 'Authoriz...
bsd-2-clause
2,653,114,337,146,885,000
47.508772
71
0.824955
false
christabor/MoAL
MOAL/languages/formal_language_theory/grammars/context_sensitive.py
1
4856
# -*- coding: utf-8 -*- __author__ = """Chris Tabor (dxdstudio@gmail.com)""" if __name__ == '__main__': from os import getcwd from os import sys sys.path.append(getcwd()) from MOAL.helpers.display import Section from MOAL.helpers.display import prnt from random import choice from MOAL.languages.formal_la...
apache-2.0
4,727,653,786,450,231,000
33.935252
79
0.545923
false
equalitie/EchoChamber
echochamber/tests/test_messaging.py
1
6514
""" Test client connections to a XMPP chat room """ import math import time import bisect import logging import random from threading import Thread import pytest from echochamber.utils import create_client_connections, establish_channel, find_available_port from echochamber.proxy import ProxyServer def read_message...
gpl-3.0
100,258,749,795,892,370
33.284211
95
0.620663
false
pypyr/pypyr-cli
pypyr/parser/jsonfile.py
1
1285
"""Context parser that returns a dictionary from a local json file.""" from collections.abc import Mapping import logging import json # use pypyr logger to ensure loglevel is set correctly logger = logging.getLogger(__name__) def get_parsed_context(args): """Parse args as path to a json file and returns context ...
apache-2.0
-6,151,299,585,859,462,000
37.939394
78
0.638132
false
SnowWalkerJ/quantlib
quant/data/wind/tables/sindexperformance.py
1
3151
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE VARCHAR2 = VARCHAR class SIndexPerformance(BaseModel): """ 4.89 中国股票指数业绩表现 Attributes ---------- object_id: VARCHAR2(100) 对象ID s_info_windcode: VARCHAR2(40) Wind代码 ...
gpl-3.0
941,308,491,787,101,700
28.091837
109
0.593476
false
joeyoung658/A-Level_2016-18
Challenges/Hangman/Everyones/Samuel/hangman.py
1
2594
""" Hangman Game (v1.0) Name: samuel armstrong Date: """ import random count=0 def load_file(filename): """ Function to return a word list from a plain text file; Note: You will need to open the file, read and append each line to an array (or list), close the file and then ret...
gpl-3.0
-9,055,671,597,323,212,000
29.880952
81
0.543177
false
websafe/slpkg
slpkg/sbo/read.py
1
1623
#!/usr/bin/python # -*- coding: utf-8 -*- # read.py file is part of slpkg. # Copyright 2014-2017 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # All rights reserved. # Slpkg is a user-friendly package manager for Slackware installations # https://github.com/dslackw/slpkg # Slpkg is free software: you can redistribu...
gpl-3.0
-4,101,729,055,160,015,000
30.211538
70
0.67098
false
peterdv/pyreststore
pyreststore/tests/test_bckt/test_bckt_model.py
1
5830
# -*- coding: utf-8; mode: Python; -*- from __future__ import unicode_literals import json from django.test import TestCase from bckt.models import Bckt from django.contrib.auth.models import User from django.contrib.auth.hashers import make_password from tests.test_bckt.utils import create_bckt class BcktTest(TestC...
bsd-3-clause
-6,327,749,684,678,481,000
31.651685
78
0.564006
false
Mnk3y/plugin.video.lastship
lastship.py
1
10683
# -*- coding: UTF-8 -*- """ Lastship Add-on (C) 2017 Credits to Placenta and Covenant; our thanks go to their creators 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 vers...
gpl-3.0
-6,966,446,947,023,699,000
26.748052
174
0.65403
false
Freeseer/freeseer
src/freeseer/plugins/output/videopreview/widget.py
1
1906
#!/usr/bin/python # -*- coding: utf-8 -*- ''' freeseer - vga/presentation capture software Copyright (C) 2013 Free and Open Source Software Learning Centre http://fosslc.org 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 ...
gpl-3.0
1,840,719,251,519,555,600
31.862069
101
0.730325
false
bstroebl/xplanplugin
HandleDb.py
1
2613
# -*- coding: utf-8 -*- """ /*************************************************************************** XPlan A QGIS plugin Fachschale XPlan für XPlanung ------------------- begin : 2011-03-08 copyright : (C) 2011 by Bernhard Stroebl, KIJ/DV email :...
gpl-2.0
514,960,653,646,335,300
34.767123
81
0.458445
false
ipfire/ddns
src/ddns/system.py
1
12221
#!/usr/bin/python3 ############################################################################### # # # ddns - A dynamic DNS client for IPFire # # Copyright (C) 2012 IPFire development team ...
gpl-3.0
-9,210,014,487,743,441,000
25.452381
96
0.617544
false
google-research/google-research
uflow/uflow_flags.py
1
9220
# 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
2,380,989,639,241,699,000
47.020833
80
0.679935
false
mandeepjadon/python-game
battleship.py
1
1203
from random import randint board = [] for x in range(5): board.append(["O"] * 5) def print_board(board): for row in board: print " ".join(row) print "Let's play Battleship!" print_board(board) def random_row(board): return randint(0, len(board) - 1) def random_col(board): return randint(0,...
mit
-3,335,248,240,708,133,000
25.733333
80
0.594347
false
dc3-plaso/dfvfs
dfvfs/resolver/gzip_resolver_helper.py
1
1202
# -*- coding: utf-8 -*- """The gzip file path specification resolver helper implementation.""" # This is necessary to prevent a circular import. import dfvfs.file_io.gzip_file_io import dfvfs.vfs.gzip_file_system from dfvfs.lib import definitions from dfvfs.resolver import resolver from dfvfs.resolver import resolver...
apache-2.0
1,747,874,747,060,713,000
28.317073
76
0.739601
false
TheAlgorithms/Python
bit_manipulation/binary_twos_complement.py
1
1121
# Information on 2's complement: https://en.wikipedia.org/wiki/Two%27s_complement def twos_complement(number: int) -> str: """ Take in a negative integer 'number'. Return the two's complement representation of 'number'. >>> twos_complement(0) '0b0' >>> twos_complement(-1) '0b11' >>> t...
mit
2,760,411,776,246,601,700
25.069767
81
0.580731
false
jobiols/odoo-argentina
l10n_ar_account/models/res_company.py
1
1884
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, models, api from opene...
agpl-3.0
8,990,268,929,781,817,000
34.54717
78
0.612527
false
CiscoSystems/nova
nova/compute/utils.py
1
19238
# Copyright (c) 2011 OpenStack Foundation # # 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 ...
apache-2.0
2,790,141,694,222,280,700
36.870079
79
0.647001
false
fabiocorneti/xlpo
tests/readers/test_xlsx_reader.py
1
3567
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from xlpo.readers import XLSXTranslationsReader from tests.base import BaseTestCase import os import unittest class TestXLSXTranslationsReader(BaseTestCase): def test_valid_files(self): xlsx_file = os....
bsd-3-clause
4,593,761,699,565,382,700
36.93617
79
0.606282
false
googlefonts/color-fonts
config/more_samples-glyf_colr_1.py
1
6716
"""Compile samples that are infeasible or difficult by svg compilation. """ import datetime from pathlib import Path from fontTools import fontBuilder from fontTools import ttLib from fontTools.colorLib import builder as colorBuilder from fontTools.pens.ttGlyphPen import TTGlyphPen from fontTools.ttLib.tables._g_l_y_f...
apache-2.0
-2,336,679,535,853,925,400
26.983333
88
0.558368
false
donspaulding/adspygoogle
examples/adspygoogle/adwords/v201302/optimization/get_placement_ideas.py
1
2587
#!/usr/bin/python # # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
1,005,778,109,689,792,100
29.435294
77
0.637031
false
mganeva/mantid
scripts/test/AbinsIOmoduleTest.py
1
4979
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
gpl-3.0
-7,953,543,048,989,678,000
40.14876
97
0.630247
false
danakj/chromium
mojo/public/tools/bindings/generators/mojom_cpp_generator.py
1
20410
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generates C++ source files from a mojom.Module.""" import mojom.generate.generator as generator import mojom.generate.module as mojom import mojom.genera...
bsd-3-clause
-230,045,905,145,959,070
36.449541
80
0.69706
false
Damian9449/Python
lab10_abstrakcyjneTypyDanych/10.2.py
1
1396
#!/usr/bin/python class Stack: def __init__(self, size=10): self.items = size * [None] # utworzenie tablicy self.n = 0 # liczba elementow na stosie self.size = size def is_empty(self): return self.n == 0 def is_full(self): return self.siz...
mit
2,741,167,808,983,571,000
22.661017
68
0.536533
false
kittiu/sale-workflow
sale_sourced_by_line/tests/test_sale_is_delivered.py
1
3494
# -*- coding: utf-8 -*- # Copyright 2014 Camptocamp SA - Yannick Vaucher # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo.tests.common import TransactionCase class TestSaleIsDelivered(TransactionCase): """Check the _g...
agpl-3.0
-9,047,940,310,241,662,000
36.978261
77
0.641671
false
scorpionis/docklet
src/env.py
1
2460
import os def getenv(key): if key == "CLUSTER_NAME": return os.environ.get("CLUSTER_NAME", "docklet-vc") elif key == "FS_PREFIX": return os.environ.get("FS_PREFIX", "/opt/docklet") elif key == "CLUSTER_SIZE": return int(os.environ.get("CLUSTER_SIZE", 1)) elif key == "CLUSTER_NET...
bsd-3-clause
8,593,028,398,002,000,000
41.413793
104
0.595122
false
martinzlocha/mad
mad/settings.py
1
3790
""" Django settings for mad project. Generated by 'django-admin startproject' using Django 1.10.4. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os # ...
mit
7,744,071,093,783,556,000
25.319444
91
0.656992
false
tombstone/models
research/object_detection/predictors/heads/keras_class_head_tf2_test.py
1
7624
# 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,731,678,658,689,163,000
36.55665
80
0.67458
false
JohnGriffiths/dipy
dipy/reconst/tests/test_dki.py
1
20608
""" Testing DKI """ from __future__ import division, print_function, absolute_import import numpy as np import random import dipy.reconst.dki as dki from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_almost_equal) from nose.tools import assert_raises from dipy....
bsd-3-clause
-1,048,268,427,265,407,500
35.603908
79
0.60724
false
HybridF5/hybrid-jacket
nova_jacket/virt/jacket/vcloud/vcloud_client.py
1
17538
import time import eventlet import subprocess from oslo.config import cfg from oslo.utils import units from nova import exception from nova.compute import power_state from nova.openstack.common import log as logging from nova.virt.jacket.vcloud import constants from nova.virt.jacket.vcloud.vcloud import exceptions fro...
apache-2.0
8,852,122,167,758,338,000
38.32287
126
0.571217
false
xuru/pyvisdk
pyvisdk/do/vm_disk_file_query_filter.py
1
1060
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def VmDiskFileQueryFilter(vim, *args, **kwargs): '''The filter for the virtual disk prima...
mit
141,172,380,356,876,660
30.205882
124
0.595283
false
fdroidtravis/fdroidserver
fdroidserver/scanner.py
1
20098
#!/usr/bin/env python3 # # scanner.py - part of the FDroid server tools # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.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 Free Software Foundation, eit...
agpl-3.0
577,908,906,297,143,800
39.276553
123
0.574535
false
redtoad/python-amazon-product-api
amazonproduct/contrib/retry.py
1
1626
import socket import time import sys # support Python 2 and Python 3 without conversion try: from urllib.request import URLError except ImportError: from urllib2 import URLError from amazonproduct.api import API class RetryAPI (API): """ API which will try up to ``TRIES`` times to fetch a result fr...
bsd-3-clause
-2,704,879,142,169,400,000
26.559322
80
0.589176
false
mapr/sahara
sahara/plugins/mapr/plugin.py
1
2831
# Copyright (c) 2015, MapR Technologies # # 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
-8,880,976,792,963,895,000
37.780822
78
0.702932
false
jkettleb/iris
lib/iris/tests/unit/experimental/um/test_Field.py
1
6019
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
lgpl-3.0
4,416,094,728,972,679,700
33.994186
79
0.633328
false
pfwangthu/Convolutional-Neural-Networks
display.py
1
7128
import matplotlib #Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') import matplotlib.pyplot as plt import scipy.io as sio import os import sys import numpy import theano import theano.tensor as T import gzip import cPickle from convolutional_mlp import LeNetConvPoolLayer from logi...
mpl-2.0
-2,081,077,153,515,145,500
36.128342
172
0.525814
false
umich-brcf-bioinf/Jacquard
jacquard/utils/command_validator.py
1
7653
"""Validates command preconditions. Specifically checks that the command, arguments, and environment (e.g. input/output directories or files) are consistent and plausible. Each validation function evaluates a specific precondition. Each function is allowed to: * change the environment (e.g. create a dir) * change t...
apache-2.0
766,562,585,724,645,900
38.448454
79
0.580818
false
lptorres/noah-inasafe
web_api/third_party/simplejson/__init__.py
1
22985
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained versi...
gpl-3.0
5,512,813,960,546,909,000
40.02011
79
0.641157
false
cmacro/flaskblog
app/main/views.py
1
9124
from flask import render_template, redirect, url_for, abort, flash, request, current_app, make_response from flask_login import login_required, current_user from . import main from ..models import User, Role, Permission, Post, Comment from ..decorators import admin_required, permission_required from .. import db from ...
mit
-2,767,377,335,529,196,500
36.208163
103
0.658183
false
nagyistoce/geokey
geokey/contributions/serializers.py
1
21039
import requests import tempfile from django.core import files from django.core.exceptions import PermissionDenied, ValidationError from easy_thumbnails.files import get_thumbnailer from rest_framework import serializers from rest_framework_gis import serializers as geoserializers from rest_framework.serializers imp...
apache-2.0
-2,704,248,957,482,316,000
28.884943
79
0.547032
false
elec-otago/agbase
testing/selenium-tests/test_farm_delete_member.py
1
1298
from end_to_end_test import EndToEndTest import test_config as config #============================================================= # This tests that an account with permission to manage a farm # can delete another account management with farm management # Permissions. # Requires test farm, test farmer, and test far...
mpl-2.0
-3,059,780,765,964,965,000
37.176471
89
0.613251
false
davehunt/selenium
py/selenium/webdriver/ie/webdriver.py
1
3912
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-8,441,446,402,448,930,000
39.329897
117
0.665644
false
YRSNorwich/ProjectBlock
classicmaterials.py
1
6273
from materials import MCMaterials classicMaterials = MCMaterials(defaultName = "Not present in Classic"); classicMaterials.name = "Classic" cm = classicMaterials cm.Air = cm.Block(0, name="Air", texture=(0x80,0xB0), ) cm.Rock = cm.Block(1, name="Rock", texture=(0x10,0x00), ) cm.Grass = cm.B...
isc
4,731,822,456,268,912,000
18.481366
91
0.57883
false
ioam/holoviews
holoviews/core/data/grid.py
1
28568
from __future__ import absolute_import import sys import datetime as dt from collections import OrderedDict, defaultdict, Iterable try: import itertools.izip as zip except ImportError: pass import numpy as np from .dictionary import DictInterface from .interface import Interface, DataError from ..dimension ...
bsd-3-clause
5,546,692,618,131,833,000
40.402899
113
0.555027
false
whiteclover/dbpy
tests/pymysqlt.py
1
12224
#!/usr/bin/env python # Copyright (C) 2014-2015 Thomas Huang # # 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 2 of the License. # # This program is distributed in the hope that it will ...
gpl-2.0
4,985,435,720,029,420,000
30.589147
108
0.551865
false
akx/shoop
_misc/ensure_license_headers.py
1
4075
#!/usr/bin/env python3 # This file is part of Shoop. # # Copyright (c) 2012-2016, Shoop 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. """ License header updater. """ from __future__ import unicode_literals impo...
agpl-3.0
5,779,910,031,184,858,000
26.910959
115
0.593374
false
GNOME/gegl
tests/test-runner.py
1
10509
#!/usr/bin/env python3 # # Copyright John Marshall 2020 # # Flatten function is from a comment by Jordan Callicoat on # http://code.activestate.com/recipes/363051-flatten/ # from __future__ import print_function import os import sys import argparse import errno import subprocess class Args(): def __init__(s...
lgpl-3.0
8,229,793,823,248,587,000
30.186944
72
0.530307
false