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
n3wb13/OpenNfrGui-5.0-1
lib/python/Plugins/Extensions/NFR4XBoot/ubi_reader/ui/common.py
5
3812
import os from ubi_io import leb_virtual_file from ubifs import ubifs, walk, output from ubifs.defines import PRINT_UBIFS_KEY_HASH, PRINT_UBIFS_COMPR from ubi.defines import PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORESIZE_FLG output_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'output'...
gpl-2.0
6,523,534,966,752,915,000
41.83908
113
0.543284
false
rosenvladimirov/addons
sale_partial_invoicing/tests/test_sale_partial_invoicing.py
1
14964
# -*- coding: utf-8 -*- # ############################################################################## # # Authors: Adrien Peiffer # Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
agpl-3.0
4,426,487,082,173,416,000
48.062295
79
0.599105
false
DS-CM/live-slides
src/GetImage.py
1
1282
import http.client, urllib.request, urllib.parse, urllib.error, base64, json from pprint import pprint class GetImage: def __init__(self, key): self.key = key def getImage(self, keywords): search_string = "" for x in keywords: search_string = search_string + " " + x ...
apache-2.0
6,372,495,451,247,394,000
28.136364
90
0.513261
false
paypal/keystone
keystone/common/sql/migrate_repo/versions/016_normalize_domain_ids.py
1
19579
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # Copyright 2013 IBM Corp. # # 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/...
apache-2.0
4,975,266,049,065,287,000
44.21709
78
0.623117
false
xfournet/intellij-community
python/helpers/typeshed/tests/pytype_test.py
1
7684
#!/usr/bin/env python r"""Test runner for typeshed. Depends on mypy and pytype being installed. If pytype is installed: 1. For every pyi, do nothing if it is in pytype_blacklist.txt. 2. If the blacklist line has a "# parse only" comment run "pytd <foo.pyi>" in a separate process. 3. If the file is n...
apache-2.0
-3,468,179,501,221,475,000
32.264069
80
0.565851
false
hpc/hypnotoad
hypnotoad/plugins/datamodels/ldap/ldap_plugin.py
1
3400
# # An ldap data model plugin for hypnotoad. # import ldap import logging from hypnotoad.core import plugin LOG = logging.getLogger('root') class ldap_plugin(plugin.data_model_plugin): def setup(self, config, model_version): """Called before the plugin is asked to do anything.""" if config.ge...
bsd-3-clause
450,297,542,380,948,160
32.333333
86
0.519412
false
hanelsofterp/green-hanel
purchase_landed_cost_assigning_before_receiving/wizard/wizard_import.py
1
1127
__author__ = 'trananhdung' from openerp import models, fields, api class extendPickingImportWizard(models.TransientModel): _inherit = 'picking.import.wizard' pickings = fields.Many2many( comodel_name='stock.picking', relation='distribution_import_picking_rel', column1='wizard_id', ...
gpl-3.0
947,077,968,450,730,200
38.25
77
0.582076
false
rambler-digital-solutions/aioriak
aioriak/datatypes/datatype.py
1
4884
from . import TYPES from aioriak.error import ContextRequired class Datatype: ''' Base class for all convergent datatype wrappers. You will not use this class directly, but it does define some methods are common to all datatype wrappers. ''' #: The string "name" of this datatype. Each datatyp...
mit
-50,095,760,985,934,680
27.231214
75
0.577805
false
nschaetti/pyTweetBot
pyTweetBot/tweet/RSSHunter.py
1
2080
#!/usr/bin/env python # -*- coding: utf-8 -*- # import feedparser from .Hunter import Hunter from .Tweet import Tweet import logging from textblob import TextBlob # Find new tweets from RSS streams class RSSHunter(Hunter): """ Find new tweets from RSS streams """ # Constructor def __init__(self,...
gpl-3.0
-6,919,431,503,497,942,000
21.608696
99
0.522115
false
Dymaxion00/KittenGroomer
fs/opt/groomer/functions_pier9.py
1
2525
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from helpers import FileBase, KittenGroomerBase, main printers = ['.STL', '.obj'] cnc = ['.nc', '.tap', '.gcode', '.dxf', '.stl', '.obj', '.iges', '.igs', '.vrml', '.vrl', '.thing', '.step', '.stp', '.x3d'] shopbot = ['.ai', '.svg', '.dxf', '.dwg', '.eps...
bsd-3-clause
8,387,122,660,357,544,000
36.132353
101
0.565149
false
zqfan/leetcode
algorithms/227. Basic Calculator II/solution.py
1
1095
class Solution(object): def calculate(self, s): """ :type s: str :rtype: int """ queue = collections.deque() method = { "+": operator.add, "-": operator.sub, "*": operator.mul, "/": operator.div } pri = {...
gpl-3.0
8,992,052,370,713,019,000
27.076923
68
0.368037
false
kailIII/emaresa
trunk.cl/client_lock_unlock/__openerp__.py
1
1969
# -*- coding: utf-8 -*- ############################################################################## # # Author: OpenDrive Ltda # Copyright (c) 2013 Opendrive Ltda # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # cons...
agpl-3.0
6,928,426,690,630,475,000
36.150943
109
0.672423
false
RaghavPro/Runescape-Hiscores
hiscores/forms.py
1
2377
from django import forms from django.core.exceptions import FieldError from .models import Skills class SearchForm(forms.Form): search = forms.CharField( widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Username', 'required': ''}), max_length=12, label=False) def clean_s...
gpl-2.0
856,744,986,639,875,300
36.730159
109
0.63231
false
kevinr/750book-web
750book-web-env/lib/python2.7/site-packages/kombu/transport/beanstalk.py
1
3295
""" kombu.transport.beanstalk ========================= Beanstalk transport. :copyright: (c) 2010 - 2012 by David Ziegler. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import socket from Queue import Empty from anyjson import loads, dumps from beanstalkc import Connectio...
mit
6,936,786,577,293,115,000
24.944882
69
0.553869
false
atlefren/beerdatabase
breweryname_compare.py
1
1755
# -*- coding: utf-8 -*- import json from beertools import BreweryNameMatcher def read_json(filename): with open(filename, 'r') as infile: return json.loads(infile.read()) def get_breweries_polet(): with open('data/polet.json', 'r') as infile: data = json.loads(infile.read()) breweri...
mit
8,518,859,701,575,844,000
30.909091
73
0.614815
false
noironetworks/heat
heat/common/config.py
1
25507
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
-464,540,316,762,593,900
44.548214
79
0.551966
false
ddico/odoo
addons/mrp/models/mrp_workorder.py
1
39609
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from collections import defaultdict import json from odoo import api, fields, models, _, SUPERUSER_ID from odoo.exceptions import...
agpl-3.0
3,872,464,057,137,297,000
50.708877
230
0.601883
false
juliotrigo/juliotrigo
juliotrigo/wsgi.py
1
1431
""" WSGI config for juliotrigo project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION...
bsd-3-clause
1,546,838,388,843,277,300
43.71875
79
0.794549
false
blakev/suds
suds/__init__.py
1
4404
# 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 ...
lgpl-3.0
-8,721,852,589,140,907,000
27.597403
85
0.581971
false
GPGPackageHandler/gpgpackagehandler
gpg_package_handler.py
1
37509
#Use the included script run.sh to execute gpg_package_handler - execute run using ./run.sh #the options available to run.sh are shown below # debugFlag - If value is 1 print error/descriptive messages. # pathToScript - The path leading to the folder containing this script. # (Used if run.sh is launched outs...
lgpl-3.0
-1,344,193,104,869,084,000
31.730366
173
0.69298
false
meprogrammerguy/pyMadness
scrape_stats.py
1
2098
#!/usr/bin/env python3 from urllib.request import urlopen from bs4 import BeautifulSoup import pandas as pd import html5lib import pdb from collections import OrderedDict import json import csv import contextlib url = "https://kenpom.com/index.php" #url = "https://kenpom.com/index.php?y=2017" #past year testing over...
mit
-3,005,067,790,104,389,600
22.054945
72
0.609152
false
berkeley-stat159/project-alpha
code/utils/scripts/glm_script.py
1
3957
""" Script for GLM functions. Run with: python glm_script.py """ # Loading modules. from __future__ import absolute_import, division, print_function import numpy as np import matplotlib.pyplot as plt import nibabel as nib import os import sys # Relative paths to subject 1 data. project_path = "../../.....
bsd-3-clause
-381,920,970,145,549,500
28.75188
125
0.664645
false
manufactured-solutions/analytical
navier_stokes/NS_Power_law_transient_scalar_sympy/sympy/NS_PowerLaw_scalar_transient_3d_phi_codes.py
1
1413
# Writing Q_phi into a C code ------------------------------------------ #Q_phi_time=Q2n #Q_phi_convection=Q1n #Q_phi_diffusion=Q3n #unassigning variables Q_phi_time and Q_phi_convection in order to write a more readable C code var('Q_phi_time, Q_phi_convection, Q_phi_diffusion') Q_phi=Q_phi_time+Q_phi_convection+...
lgpl-2.1
5,003,624,397,822,584,000
19.185714
100
0.57891
false
dbatalov/ri-optimizer
example_main.py
1
9032
""" This is the main example script to execute, it is meant as an example of how the riptimize.py module is to be used, and effectivey acts as the driver of the module with rudimentary console UI + CSV report generation and S3 upload. It's job is to demonstrate the functionality of riptimize and it is not meant to...
bsd-2-clause
-7,441,872,143,540,658,000
46.042553
192
0.660762
false
EKiefer/edge-starter
py34env/Scripts/enhancer.py
1
1558
#!c:\users\ekiefer\projects\django\my_edge\py34env\scripts\python.exe # # The Python Imaging Library # $Id$ # # this demo script creates four windows containing an image and a slider. # drag the slider to modify the image. # try: from tkinter import Tk, Toplevel, Frame, Label, Scale, HORIZONTAL except ImportError:...
mit
8,260,503,957,191,499,000
25.40678
80
0.646341
false
prasannav7/ggrc-core
test/integration/ggrc/models/factories.py
1
4323
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: urban@reciprocitylabs.com """Factories for models""" import random import factory from ggrc import db f...
apache-2.0
-2,486,109,641,783,697,400
23.844828
78
0.734906
false
mira67/DL4RS
MPFprj/prjutil.py
1
1728
""" utils configure file parser Author: Qi Liu, 11/2016 """ import ConfigParser def cfgmap(cfg,section): dict1 = {} options = cfg.options(section) for option in options: try: dict1[option] = cfg.get(section, option) if dict1[option] == -1: DebugPrint("skip: ...
gpl-3.0
3,041,653,088,066,856,400
32.882353
72
0.594329
false
k0001/meaningtoolws
meaningtoolws/ct.py
1
4944
# -*- coding: utf-8 -*- # Copyright (c) 2009, Popego Corporation <contact [at] popego [dot] com> # All rights reserved. # # This file is part of the Meaningtool Web Services Python Client project # # See the COPYING file distributed with this project for its licensing terms. """ Meaningtool Category Tree REST API v0....
bsd-3-clause
6,838,378,754,736,598,000
32.405405
101
0.587379
false
proversity-org/edx-platform
lms/djangoapps/student_account/talenetic.py
1
7807
from six.moves.urllib_parse import urlencode, unquote import jwt import json from django.conf import settings from student.models import Registration, UserProfile from social_core.backends.oauth import BaseOAuth2 from django.contrib.auth.models import User import uuid import logging import social_django log...
agpl-3.0
211,726,550,094,709,500
33.166667
106
0.575893
false
edx/cookiecutter-django-ida
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/apps/core/tests/test_models.py
1
1676
""" Tests for core models. """ from django.test import TestCase from django_dynamic_fixture import G from social_django.models import UserSocialAuth from {{cookiecutter.repo_name}}.apps.core.models import User class UserTests(TestCase): """ User model tests. """ TEST_CONTEXT = {'foo': 'bar', 'baz': None} ...
apache-2.0
3,668,149,026,875,080,700
36.244444
102
0.647375
false
denis-guillemenot/pmi_collect
simpleHTTPServer.py
1
1587
# ---------------------------------------------------------------- # name : simpleHTTPServer.py # object: Simple MultiThreaded Web Server # usage: python SimpleHTTPServer [port] / default port: 8080 # author: denis_guillemenot@fr.ibm.com / denis.guillemenot@gmail.com # date : 19/09/2013 # ---------------------------...
mit
3,394,831,740,184,228,400
24.190476
82
0.608066
false
theolind/home-assistant
tests/helpers/test_init.py
1
1603
""" tests.test_helpers ~~~~~~~~~~~~~~~~~~~~ Tests component helpers. """ # pylint: disable=protected-access,too-many-public-methods import unittest from common import get_test_home_assistant import homeassistant as ha import homeassistant.loader as loader from homeassistant.const import STATE_ON, STATE_OFF, ATTR_ENT...
mit
9,065,493,892,400,765,000
31.714286
67
0.615097
false
sylvainnizac/Djangoctopus
blog/admin.py
1
2774
# -*- coding: utf8 -*- from django.contrib import admin from blog.models import Categorie, Article, Comment class ArticleAdmin(admin.ModelAdmin): list_display = ('titre', 'auteur', 'date', 'categorie', 'apercu_contenu') list_filter = ('auteur','categorie',) date_hierarchy = 'date' ordering =...
gpl-2.0
-2,033,523,279,121,713,400
33.848101
104
0.587722
false
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/media_file_service/transports/grpc.py
1
11285
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-4,525,491,664,470,927,400
43.254902
112
0.608773
false
derv82/wifite2
wifite/tools/ifconfig.py
1
1784
#!/usr/bin/env python # -*- coding: utf-8 -*- import re from .dependency import Dependency class Ifconfig(Dependency): dependency_required = True dependency_name = 'ifconfig' dependency_url = 'apt-get install net-tools' @classmethod def up(cls, interface, args=[]): '''Put interface up'''...
gpl-2.0
4,402,937,286,454,165,000
28.245902
113
0.568946
false
HalcyonChimera/osf.io
website/project/metadata/schemas.py
1
2265
import os import json LATEST_SCHEMA_VERSION = 2 def _id_to_name(id): return ' '.join(id.split('_')) def _name_to_id(name): return '_'.join(name.split(' ')) def ensure_schema_structure(schema): schema['pages'] = schema.get('pages', []) schema['title'] = schema['name'] schema['version'] = schema.g...
apache-2.0
8,412,698,295,121,021,000
38.736842
98
0.696247
false
ashbc/tgrsite
tgrsite/settings.py
1
6161
""" Django settings for tgrsite project. Generated by 'django-admin startproject' using Django 1.10.2. 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...
isc
-7,394,605,813,598,171,000
26.382222
91
0.687226
false
Guts/isogeo-api-py-minsdk
isogeo_pysdk/models/metadata.py
1
38320
# -*- coding: UTF-8 -*- #! python3 """ Isogeo API v1 - Model of Metadata (= Resource) entity See: http://help.isogeo.com/api/complete/index.html#definition-resource """ # ############################################################################# # ########## Libraries ############# # #####################...
gpl-3.0
639,171,598,854,724,600
26.235252
116
0.522886
false
Yupeek/django-dynamic-logging
dynamic_logging/scheduler.py
1
8574
# -*- coding: utf-8 -*- import functools import logging import threading from django.db.utils import ProgrammingError from django.utils import timezone from dynamic_logging.models import Trigger logger = logging.getLogger(__name__) class Scheduler(object): """ a special class that keep trace of the next ev...
agpl-3.0
6,981,103,584,917,624,000
34.429752
119
0.55575
false
lochiiconnectivity/exabgp
lib/exabgp/configuration/engine/tokeniser.py
1
3330
# encoding: utf-8 """ tokeniser.py Created by Thomas Mangin on 2014-06-22. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ from exabgp.util import coroutine from exabgp.configuration.engine.location import Location from exabgp.configuration.engine.raised import Raised # convert special caracters @cor...
bsd-3-clause
-4,720,082,603,888,199,000
22.125
100
0.597297
false
tmilicic/networkx
networkx/classes/function.py
1
16409
"""Functional interface to graph methods and assorted utilities. """ # Copyright (C) 2004-2015 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # import networkx as nx from networkx.utils import not_implemente...
bsd-3-clause
-4,094,525,715,898,061,000
23.899848
82
0.566945
false
clintonblackmore/enchanting2
factory.py
1
1388
"""factory.py lets you deserialize an unknown type from XML""" import xml.etree.cElementTree as ElementTree import data import script import media import actor def deserialize_value(element, *args): """Get an object representing this element, be it a literal, list or what-not""" class_map = { "...
agpl-3.0
7,742,323,621,183,669,000
26.215686
74
0.650576
false
ESS-LLP/erpnext-healthcare
erpnext/hr/doctype/salary_slip/salary_slip.py
1
34819
# 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, erpnext import datetime from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words, getdate from fr...
gpl-3.0
4,243,228,669,414,350,300
42.415212
176
0.711881
false
SISC2014/JobAnalysis
MongoRetrieval/src/EfficiencyHistogram.py
1
6076
''' Created on Jun 19, 2014 @author: Erik Halperin List of Keys _id JobStartDate Requirements TransferInput TotalSuspensions LastJobStatus BufferBlockSize OrigMaxHosts RequestMemory WantRemoteSyscalls LastHoldReasonCode ExitStatus Args JobFinishedHookDone JobCurrentStartDate CompletionDate JobLeaseDuration Err Remote...
mit
4,049,639,096,715,589,000
22.46332
129
0.697334
false
openprocurement/openprocurement.edge
openprocurement/edge/views/auctions.py
1
7066
# -*- coding: utf-8 -*- from functools import partial from openprocurement.edge.utils import ( context_unpack, decrypt, encrypt, APIResource, json_view ) from openprocurement.edge.utils import eaopresource from openprocurement.edge.design import ( by_dateModified_view_ViewDefinition, real_b...
apache-2.0
-6,018,885,631,503,351,000
37.612022
154
0.538353
false
IhToN/DAW1-PRG
Ejercicios/SeguTrim/Objetos/Punto.py
1
4377
""" Clase Punto coord x coord y suma(punto) resta(punto) Clase Traza instancias Punto en una Lista añadir punto comparar dos trazas (dos trazas serán iguales si sus puntos son iguales) """ import math import turtle class Punto: def __init__(self, x...
apache-2.0
-7,849,022,810,489,935,000
25.815951
100
0.538778
false
pmediano/ComputationalNeurodynamics
Fall2016/Exercise_1/Solutions/IzNeuronRK4.py
1
1897
""" Computational Neurodynamics Exercise 1 Simulates Izhikevich's neuron model using the Runge-Kutta 4 method. Parameters for regular spiking, fast spiking and bursting neurons extracted from: http://www.izhikevich.org/publications/spikes.htm (C) Murray Shanahan et al, 2016 """ import numpy as np import matplotlib....
gpl-3.0
194,822,784,332,023,800
19.397849
78
0.618345
false
jkettleb/iris
lib/iris/tests/test_cube_to_pp.py
1
15153
# (C) British Crown Copyright 2010 - 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
-5,607,596,048,526,821,000
43.177843
172
0.598825
false
BenBoZ/hexaco
Engine/Components/tst/Test_PositionComponent.py
1
4037
""" This file is part of HexACO. HexACO is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. HexACO is distributed in t...
gpl-3.0
-2,831,596,542,244,316,700
28.467153
76
0.58162
false
RaminderSinghSahni/micro-ram-bot
tasks.py
1
4411
#!/usr/bin/env python # -*- coding: utf-8 -*- from microsoftbotframework import Response import celery import os import sys import json # import argparse from google.cloud import language import google.auth # import language try: import apiai except ImportError: sys.path.append(os.path.join(os.path.dirname(os...
mit
-5,725,038,473,106,126,000
37.692982
150
0.568579
false
malcolmwhite/DungeonsAndDragons
src/test/managers/test_model_conflict_manager.py
1
3021
from unittest import TestCase from itertools import permutations from src.main.managers.players.hard_coded_player_manager import HardCodedPlayerManager from src.main.managers.conflict.hard_coded_example_conflict_manager import HardCodedExampleConflictManager from src.main.managers.conflict.automated_conflict_manager i...
mit
2,843,952,573,210,768,000
47.741935
106
0.69712
false
ooici/marine-integrations
mi/dataset/test/test_single_dir_harvester.py
1
22218
#!/usr/bin/env python """ @package mi.dataset.test.test_single_dir_harvester.py @file mi/dataset/test/test_single_dir_harvester.py @author Emily Hahn @brief Test code to exercize the single directory harvester """ import os import glob import gevent import time import shutil import hashlib from mi.core.log import get...
bsd-2-clause
-3,474,479,848,297,348,000
44.622177
109
0.57854
false
orlenko/sfpirg
sfpirgapp/migrations/0022_auto__del_field_organization_mailing_address__add_field_organization_m.py
1
25180
# -*- 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): # Deleting field 'Organization.mailing_address' db.delete_column(u'sfpirgapp_organization', 'mailing_address...
bsd-2-clause
-7,932,003,057,941,393,000
78.686709
187
0.562311
false
QudevETH/PycQED_py3
pycqed/simulations/chevron_sim.py
1
2373
""" Based on Olli's mathematica notebook used to simulate chevrons """ import numpy as np from scipy.linalg import expm ham = lambda e, g: np.array([[0.5*e, g], [g, -0.5*e]]) evol = lambda e, g, dt: expm(dt*1j*ham(e, g)) def rabisim(efun, g, t, dt): """ This function returns the evolution of a system descri...
mit
-6,412,169,818,103,500,000
33.897059
81
0.554994
false
theoryno3/gensim
gensim/test/test_models.py
1
26406
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import os import o...
gpl-3.0
-7,871,270,214,023,811,000
42.006515
140
0.642998
false
sde1000/quicktill
quicktill/tillweb/urls.py
1
4931
from django.urls import include, path, re_path from quicktill.tillweb.views import * from .stocktake import * tillurls = [ path('', pubroot, name="tillweb-pubroot"), path('session/', sessionfinder, name="tillweb-sessions"), path('session/<int:sessionid>/', include([ path('', session, name="tillweb...
gpl-3.0
-821,744,168,511,656,600
43.827273
80
0.654634
false
felipead/breakout
source/breakout/game/GameController.py
1
4147
from OpenGL.GL import * from OpenGL.GLU import * import pygame from pygame.constants import * from breakout.game.GameEngine import GameEngine _FRAMES_PER_SECOND = 60 _MOUSE_VISIBLE = True _CANVAS_WIDTH = 250 _CANVAS_HEIGHT = 300 _DEFAULT_SCREEN_WIDTH = 500 _DEFAULT_SCREEN_HEIGHT = 600 class GameController(object)...
gpl-2.0
2,273,906,769,018,133,000
35.699115
112
0.661201
false
pampi/pad
backend.py
1
26210
#Copyright (C) 2014 Adrian "APi" Pielech #This program is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, either version 3 of the License, or #any later version. #This program is distributed in the hope that it w...
gpl-3.0
-7,560,106,690,500,875,000
44.687063
175
0.488578
false
N-Parsons/exercism-python
exercises/palindrome-products/palindrome_products_test.py
1
3862
""" Notes regarding the implementation of smallest_palindrome and largest_palindrome: Both functions must take two keyword arguments: max_factor -- int min_factor -- int, default 0 Their return value must be a tuple (value, factors) where value is the palindrome itself, and factors is an iterable containing b...
mit
-3,542,696,955,969,475,600
38.814433
78
0.685137
false
endlessm/chromium-browser
third_party/chromite/scripts/test_image.py
1
4062
# -*- coding: utf-8 -*- # Copyright 2014 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. """Script to mount a built image and run tests on it.""" from __future__ import print_function import os import sys import unitt...
bsd-3-clause
-3,099,706,782,971,267,600
32.295082
79
0.670852
false
OCA/contract
contract_variable_quantity/models/contract_line.py
1
2127
# Copyright 2016 Tecnativa - Pedro M. Baeza # Copyright 2018 Tecnativa - Carlos Dauden # Copyright 2018 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, models from odoo.tools import float_is_zero from odoo.tools.safe_eval import safe_eval class AccountAnalyticInvoic...
agpl-3.0
1,996,008,599,080,476,700
33.306452
77
0.5496
false
justanr/flask-plugins
tests/pluginmanager_tests.py
1
4662
import unittest from flask import Flask from flask.ext.plugins import PluginManager, PluginError, get_plugins_list, \ get_plugin class InitializationTestCase(unittest.TestCase): def setUp(self): self.app = Flask(__name__) self.app.config['TESTING'] = True def test_init_app(self): ...
bsd-3-clause
-858,463,977,783,038,500
29.874172
80
0.649292
false
fusionbox/satchless
examples/demo/core/views.py
1
1250
# -*- coding:utf-8 -*- from django.contrib import messages from django.shortcuts import redirect from django.template.response import TemplateResponse from django.utils.translation import ugettext_lazy as _ from satchless.order.app import order_app def home_page(request): messages.success(request, _(u'<strong>We...
bsd-3-clause
-7,441,253,123,787,888,000
36.878788
109
0.6872
false
Robbie1977/AlignmentPipe
align/settings.py
1
10620
import psycopg2, os # import subprocess from socket import gethostname host = gethostname() con = psycopg2.connect(host='bocian.inf.ed.ac.uk', database='alignment', user='aligner_admin', password='default99') cur = con.cursor() cur.execute("SELECT upload_dir FROM system_server WHERE host_name like '" + host + "'") rec...
mit
-6,374,926,531,072,543,000
34.165563
146
0.706874
false
apel/rest
api/tests/test_cloud_record_summary_get.py
1
9827
"""This module tests GET requests to the Cloud Sumamry Record endpoint.""" import logging import MySQLdb from api.utils.TokenChecker import TokenChecker from django.core.urlresolvers import reverse from django.test import Client, TestCase from mock import patch QPATH_TEST = '/tmp/django-test/' class CloudRecordSum...
apache-2.0
-8,940,463,494,486,466,000
40.817021
79
0.51908
false
leighpauls/k2cro4
tools/swarm_client/tests/isolate_test.py
1
28440
#!/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. import cStringIO import hashlib import logging import os import sys import tempfile import unittest ROOT_DIR = os.path.dirname(os....
bsd-3-clause
2,551,652,073,914,647,600
28.380165
79
0.493847
false
JIC-CSB/jicbioimage
setup.py
1
1144
from setuptools import setup readme = open('README.rst').read() version = "0.15.0" setup(name='jicbioimage', packages=['jicbioimage', ], version=version, description='Python package designed to make it easy to work with bio images.', long_description=readme, author='Tjelvar Olsson', ...
mit
-7,883,911,221,225,092,000
35.903226
89
0.620629
false
KWierso/treeherder
tests/push_health/test_compare.py
1
2050
import datetime import responses from treeherder.model.models import Push from treeherder.push_health.compare import (get_parent, get_response_object) def test_get_response_object(test_push, test_repository): resp = get_response_object('1234', test_push, test_reposito...
mpl-2.0
-8,634,045,018,885,420,000
38.423077
104
0.697561
false
globocom/tapioca
tests/acceptance/test_validation.py
1
2829
from json import loads import tornado.web from schema import Use from tornado.testing import AsyncHTTPTestCase from tests.support import AsyncHTTPClientMixin, assert_response_code from tapioca import TornadoRESTful, ResourceHandler, validate, optional class ProjectsResource(ResourceHandler): @validate(queryst...
mit
8,893,176,927,390,336,000
34.810127
94
0.684341
false
berkmancenter/mediacloud
apps/webapp-api/src/python/webapp/auth/password.py
1
5455
import base64 import hashlib import os from mediawords.db import DatabaseHandler from mediawords.util.log import create_logger from mediawords.util.perl import decode_object_from_bytes_if_needed __HASH_SALT_PREFIX = "{SSHA256}" __HASH_LENGTH = 64 # SHA-256 hash length __SALT_LENGTH = 64 __MIN_PASSWORD_LENGTH = 8 _...
agpl-3.0
8,678,888,388,578,591,000
32.67284
120
0.67846
false
jakubtyniecki/pact
sort/hybrid.py
1
2447
""" hybrid sort module """ from sort.framework import validate THRESHOLD = 10 # threshold when to fallback to insert sort @validate def sort(arr): """ hybrid sort """ hybridsort(arr, 0, len(arr) - 1) return arr def hybridsort(arr, first, last): """ hybrid sort """ stack = [] stack.append(...
mit
7,002,549,922,402,661,000
23.969388
67
0.548018
false
xuludev/CVLH_tutorial
netease_spider.py
1
3334
import json import time import os import re import requests from bs4 import BeautifulSoup import chardet """ url_list = [ 'http://tech.163.com/special/00097UHL/tech_datalist_02.js?callback=data_callback', 'http://ent.163.com/special/000380VU/newsdata_index_02.js?callback=data_callback', 'http://spor...
apache-2.0
-1,926,016,843,630,203,600
34.855556
152
0.653092
false
mdavidsaver/spicetools
spicetools/view/mainwin_ui.py
1
8609
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'spicetools/view/mainwin.ui' # # Created: Sun Apr 27 13:13:01 2014 # by: PyQt4 UI code generator 4.9.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf...
gpl-3.0
8,151,757,473,375,844,000
58.784722
137
0.724707
false
Jumpscale/jumpscale_portal8
apps/portalbase/macros/page/action/3_action.py
1
1083
def main(j, args, params, tags, tasklet): page = args.page data = {'action': args.getTag('id'), 'class': args.getTag('class') or '', 'deleterow': args.getTag('deleterow') or 'false', 'label': args.getTag('label') or '', } extradata = {} tags = j.data.tags...
apache-2.0
6,079,685,514,749,661,000
32.84375
74
0.554017
false
volnrok/sortable-challenge
main.py
1
3683
import json import random import re from check import check_match from encoder import Encoder from listing import Listing from product import Product # We'll sort products by manufacturer first man_lookup = {} # List of common manufacturer aliases aliases = { 'agfaphoto': 'agfa', 'fuji': 'fujifilm', 'hew...
mit
-3,413,363,037,030,869,000
31.307018
132
0.519685
false
ExCiteS/geokey-wegovnow
geokey_wegovnow/tests/test_commands.py
1
7233
"""Test all commands.""" import sys from StringIO import StringIO from django.conf import settings from django.test import TestCase from django.core import management from django.contrib.sites.shortcuts import get_current_site from allauth.socialaccount import providers from allauth.socialaccount.models import Soci...
mit
8,339,166,114,679,516,000
34.985075
78
0.574036
false
Jorgesolis1989/SIVORE
corporaciones/views.py
1
11935
from django.shortcuts import render_to_response from django.shortcuts import render ,redirect from django.template.context import RequestContext from corporaciones.models import Corporacion , Sede from django.contrib.auth.decorators import permission_required from corporaciones.forms import FormularioRegistroCorporacio...
apache-2.0
9,110,471,766,066,271,000
43.155556
157
0.585472
false
teamCarel/EyeTracker
src/shared_modules/calibration_routines/finish_calibration.py
1
17482
''' (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2017 Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. -----------------------------------...
lgpl-3.0
1,249,891,660,788,555,000
50.875371
194
0.605709
false
brachyprint/brachyprint
src/mesh/__init__.py
1
1496
# Brachyprint -- 3D printing brachytherapy moulds # Copyright (C) 2013-14 James Cranch, Martin Green and Oliver Madge # # 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 ver...
gpl-2.0
-4,344,528,957,305,115,600
28.92
76
0.72861
false
nfqsolutions/pylm
tests/test_services/test_subscribed_client.py
1
2736
import concurrent.futures import time from concurrent.futures import ThreadPoolExecutor import zmq from pylm.clients import Client from pylm.parts.core import zmq_context from pylm.parts.messages_pb2 import PalmMessage def fake_server(messages=1): db_socket = zmq_context.socket(zmq.REP) db_socket.bind('inpr...
agpl-3.0
-7,718,448,006,989,908,000
25.823529
72
0.56981
false
pwnbus/scoring_engine
scoring_engine/config_loader.py
1
2625
import configparser import os class ConfigLoader(object): def __init__(self, location="../engine.conf"): config_location = os.path.join(os.path.dirname(os.path.abspath(__file__)), location) self.parser = configparser.ConfigParser() self.parser.read(config_location) self.debug = ...
mit
7,857,065,895,646,105,000
28.829545
92
0.525333
false
Stargrazer82301/CAAPR
CAAPR/CAAPR_AstroMagic/PTS/pts/magic/tools/sesame.py
1
3792
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
mit
-434,090,002,494,834,500
27.727273
78
0.498813
false
containers-ftw/cftw
cftw/utils.py
1
8502
''' utils.py: part of cftw package Copyright (c) 2017 Vanessa Sochat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, mod...
mit
8,000,063,582,081,847,000
32.472441
90
0.597389
false
pepincho/playground
python/Learn-Python-The-Hard-Way/exercises11to20.py
1
2190
# exercise 11 name = input("What's your name? ") # take the name from the keyboard print ("Your name is {}".format(name)) # exercise 15 file_again = input("Type the filename again: > ") # read the file's name from the keyboard txt_again = open(file_again) # open the file print (txt_again.read()) # print the file's co...
mit
-1,002,428,991,431,571,700
21.121212
90
0.67032
false
bfontaine/Teebr
teebr/features.py
1
6724
# -*- coding: UTF-8 -*- from __future__ import absolute_import, unicode_literals import re from json import dumps from collections import defaultdict from .log import mkLogger from .text.utils import contains_emoji, extract_named_entities from .text.utils import most_common_words from .text.spam import is_spam logg...
mit
-323,460,344,605,223,000
22.840426
81
0.542466
false
jabez007/Training_Helpyr
Setup/__init__.py
1
7646
import re import os APP_PATH = os.path.join(*os.path.split(os.path.dirname(os.path.realpath(__file__)))[:-1]) import sys if APP_PATH not in sys.path: sys.path.append(APP_PATH) import MyTrack import PowerShell import Phonebook import Overlord import Log LOGGER = Log.MyLog(name=__name__) # # # # """ Special setup ...
mit
-4,601,870,185,056,420,400
31.675214
132
0.639681
false
aricaldeira/PySPED
pysped/cte/webservices_flags.py
1
2161
# -*- coding: utf-8 -*- # # PySPED - Python libraries to deal with Brazil's SPED Project # # Copyright (C) 2010-2012 # Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Library General Public Lic...
lgpl-2.1
-2,877,343,729,118,594,600
36.54386
76
0.757944
false
sunoru/pokemon_only
stall/migrations/0001_initial.py
1
6359
# Generated by Django 2.2.2 on 2019-06-04 21:16 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
gpl-2.0
-6,446,297,086,749,532,000
59.343137
246
0.560845
false
meraki-analytics/cassiopeia
cassiopeia/cassiopeia.py
1
6069
from typing import List, Set, Dict, Union, TextIO import arrow import datetime from .data import Region, Queue, Season, Tier, Division, Position from .core import Champion, Summoner, ChampionMastery, Rune, Item, Match, Map, SummonerSpell, Realms, ProfileIcon, LanguageStrings, CurrentMatch, ShardStatus, Versions, Match...
mit
2,522,235,741,749,909,500
35.341317
429
0.731257
false
sk413025/tilitools
latentsvdd.py
1
3222
from cvxopt import matrix,spmatrix,sparse,uniform,normal,setseed from cvxopt.blas import dot,dotu from cvxopt.solvers import qp from cvxopt.lapack import syev import numpy as np import math as math from kernel import Kernel from svdd import SVDD from ocsvm import OCSVM import pylab as pl import matplotlib.pyplot as...
mit
-4,128,180,928,146,153,500
29.396226
86
0.646182
false
sniemi/SamPy
sandbox/src1/pviewer/pviewer.py
1
31336
#!/usr/bin/env python from tkFileDialog import * from Tkinter import * from tkSimpleDialog import Dialog import tkMessageBox from plotAscii import * from imageUtil import * from view2d import * from mdaAscii import * import Pmw import os, string import AppShell global Scan global SH # SHARED class setupPrinter(...
bsd-2-clause
-3,291,895,447,585,921,000
27.987974
146
0.633361
false
c0cky/mediathread
mediathread/projects/admin.py
1
1386
from django.contrib import admin from django.contrib.auth.models import User from mediathread.projects.models import Project class ProjectAdmin(admin.ModelAdmin): search_fields = ("title", "participants__last_name", "author__username", "participants__last_name") list...
gpl-2.0
7,909,254,326,937,188,000
43.709677
75
0.519481
false
lorensen/VTKExamples
src/Python/Deprecated/GeometricObjects/ParametricObjectsDemo.py
1
5485
# !/usr/bin/env python # -*- coding: utf-8 -*- import vtk def main(): colors = vtk.vtkNamedColors() colors.SetColor("BkgColor", [26, 51, 102, 255]) parametricObjects = list() parametricObjects.append(vtk.vtkParametricBoy()) parametricObjects.append(vtk.vtkParametricConicSpiral()) parametric...
apache-2.0
3,249,549,297,955,955,000
36.827586
88
0.678213
false
jamielennox/python-keystoneclient
keystoneclient/tests/test_cms.py
1
6122
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
-8,033,659,842,411,192,000
40.364865
78
0.601764
false
rmed/textventures
src/textventures/instances/key_navigation.py
1
4144
# -*- coding: utf-8 -*- # This file is part of TextVentures - https://github.com/RMed/textventures # # Copyright (C) 2013 Rafael Medina García <rafamedgar@gmail.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...
gpl-2.0
5,757,127,063,372,303,000
30.150376
74
0.502052
false
banansson/cask
cask.py
1
3281
#!/usr/bin/python import sys import argparse from os import path from src.bag import Bag from src.package import Package from src.task import Task from src.message import Message from src.application import Application from src.application_info import ApplicationInfo from src.bootstrap import Bootstrap from src impor...
mit
1,634,004,693,254,727,000
29.663551
97
0.650716
false
singingwolfboy/webhookdb
docs/conf.py
1
7995
# -*- coding: utf-8 -*- # # WebhookDB documentation build configuration file, created by # sphinx-quickstart on Wed Feb 25 10:08:26 2015. # # 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. # # A...
agpl-3.0
-2,868,988,720,259,349,000
30.85259
80
0.702564
false
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Tools/scripts/pep384_macrocheck.py
4
4720
""" pep384_macrocheck.py This programm tries to locate errors in the relevant Python header files where macros access type fields when they are reachable from the limided API. The idea is to search macros with the string "->tp_" in it. When the macro name does not begin with an underscore, then we have found a dorman...
apache-2.0
-1,668,539,338,901,291,500
30.891892
75
0.523517
false
KaiSzuttor/espresso
testsuite/python/rotation.py
1
5271
import numpy as np import unittest as ut try: import scipy.spatial.transform as sst except ImportError: pass import espressomd.rotation import unittest_decorators as utx @utx.skipIfUnmetModuleVersionRequirement('scipy', '>=1.4.0') class TestRotation(ut.TestCase): """ Tests for the rotation utility f...
gpl-3.0
711,070,109,601,223,000
29.824561
108
0.589262
false
yongfuyang/vnpy
vn.trader/ctaAlgo/ctaBase.py
1
5912
# encoding: UTF-8 ''' 本文件中包含了CTA模块中用到的一些基础设置、类和常量等。 ''' from __future__ import division # 把vn.trader根目录添加到python环境变量中 import sys sys.path.append('..') # 常量定义 # CTA引擎中涉及到的交易方向类型 CTAORDER_BUY = u'买开' CTAORDER_SELL = u'卖平' CTAORDER_SELLTODAY = u'卖平今' CTAORDER_SELLYESTERDAY = u'卖平昨' CTAORDER_SHORT = u'卖开' CTAORDER_CO...
mit
8,423,452,578,316,974,000
25.412935
79
0.514883
false