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
ericchuhong/WellSoonWeb
www/models.py
1
1460
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Model for users comment,blog """ __author__ = 'Chuhong Ma' import time, uuid from orm import Model, StringField, BoolenField, FloatField, TextField def next_id(): return '%015d%s000' % (int(time.time() * 1000), uuid.uuid4().hex) class User(Model): __tabl...
mit
-4,328,421,956,334,911,500
27.076923
74
0.65411
false
sschmeier/genomics-tutorial
conf.py
1
13833
# -*- coding: utf-8 -*- # # Genomics Tutorial documentation build configuration file, created by # sphinx-quickstart on Sat Nov 19 11:28:35 2016. # # 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 f...
mit
-4,872,524,209,302,796,000
31.081206
97
0.688725
false
kreeger/etcetera
checkout/admin.py
1
1647
from etcetera.checkout.models import Checkout from django.contrib import admin # This file determines what's shown in the admin interface class CheckoutAdmin(admin.ModelAdmin): fieldsets = ( ('Basic information', { 'fields': ( 'first_name', 'last_name', ...
bsd-3-clause
692,675,820,649,193,000
24.734375
58
0.428051
false
kaiw/meld
meld/filediff.py
1
85802
### Copyright (C) 2002-2006 Stephen Kennedy <stevek@gnome.org> ### Copyright (C) 2009-2012 Kai Willadsen <kai.willadsen@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 Software Foundation; either v...
gpl-2.0
-4,633,573,906,481,092,000
42.910952
154
0.556036
false
WmHHooper/aima-python
submissions/Thompson/myLogic.py
1
1132
## farmer = { 'kb': ''' Farmer(Mac) Rabbit(Pete) Mother(MrsMac, Mac) Mother(MrsRabbit, Pete) (Rabbit(r) & Farmer(f)) ==> Hates(f, r) (Mother(m, c)) ==> Loves(m, c) (Mother(m, r) & Rabbit(r)) ==> Rabbit(m) (Farmer(f)) ==> Human(f) (Mother(m, h) & Human(h)) ==> Human(m) ''', # Note that this order of conjuncts # woul...
mit
-1,356,765,412,437,163,300
16.703125
71
0.560954
false
DemocracyClub/UK-Polling-Stations
polling_stations/apps/data_importers/tests/test_address_list.py
1
18783
from django.test import TestCase from addressbase.tests.factories import AddressFactory from data_importers.data_types import AddressList class MockLogger: logs = [] def log_message(self, level, message, variable=None, pretty=False): self.logs.append(message) def clear_logs(self): self....
bsd-3-clause
-7,876,145,225,259,177,000
30.568067
119
0.369909
false
ContextLab/quail
quail/analysis/lagcrp.py
1
4765
import numpy as np import pandas as pd from .recmat import recall_matrix from scipy.spatial.distance import cdist from ..helpers import check_nan def lagcrp_helper(egg, match='exact', distance='euclidean', ts=None, features=None): """ Computes probabilities for each transition distance (proba...
mit
8,503,094,469,382,664,000
35.937984
101
0.555089
false
SuLab/scheduled-bots
scheduled_bots/query_tester/validators.py
1
1080
class Validator: description = '' # Plain text description of what is being checked expected_result = [] # optional def __init__(self): self.success = None # True or False self.result_message = '' # optional extra information about test result def validate(self, result): r...
mit
5,172,143,440,517,708,000
28.216216
80
0.669444
false
beiko-lab/gengis
bin/Lib/site-packages/scipy/signal/signaltools.py
1
56054
# Author: Travis Oliphant # 1999 -- 2002 from __future__ import division, print_function, absolute_import import warnings from . import sigtools from scipy.lib.six import callable from scipy import linalg from scipy.fftpack import fft, ifft, ifftshift, fft2, ifft2, fftn, \ ifftn, fftfreq from num...
gpl-3.0
-7,537,377,946,632,358,000
29.86697
80
0.52478
false
roderickmackenzie/gpvdm
gpvdm_gui/gui/token_lib.py
1
59716
# # General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall # model for 1st, 2nd and 3rd generation solar cells. # Copyright (C) 2012-2017 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com # # https://www.gpvdm.com # Room B86 Coates, University Park, Nottingham, NG7 2RD...
gpl-2.0
-7,389,480,505,478,320,000
71.82439
357
0.624824
false
znes/renpass_gis
renpass/components/electrical.py
1
4361
# -*- coding: utf-8 -*- """ This module is designed to contain classes that act as simplified / reduced energy specific interfaces (facades) for solph components to simplify its application and work with the oemof datapackage - reader functionality SPDX-License-Identifier: GPL-3.0-or-later """ import logging from py...
gpl-3.0
-7,568,780,707,150,623,000
30.15
79
0.569136
false
tylerclair/py3canvas
py3canvas/apis/accounts.py
1
26185
"""Accounts API Version 1.0. This API client was generated using a template. Make sure this code is valid before using it. """ import logging from datetime import date, datetime from .base import BaseCanvasAPI from .base import BaseModel class AccountsAPI(BaseCanvasAPI): """Accounts API Version 1.0.""" def ...
mit
-5,909,541,274,754,134,000
46.010772
722
0.652015
false
akalipetis/djoser
testproject/testapp/tests/social/test_provider_auth.py
1
3270
from django.contrib.sessions.middleware import SessionMiddleware from django.utils import six from rest_framework import status from djet import assertions, restframework import djoser.social.views from social_core.exceptions import AuthException from ..common import create_user, mock class ProviderAuthViewTestCase...
mit
-147,925,745,511,879,970
37.928571
77
0.649847
false
sbhal/be-fruitful
pythonProject/qlearning_tf.py
1
5122
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Jun 8 19:14:33 2017 @author: sbhal """ import numpy as np import pandas as pd import random import tensorflow as tf class qlearningTF: def __init__(self, m_criteria, initialWeights=None): if initialWeights == None: self.weight...
mit
606,855,611,802,600,200
36.115942
135
0.577509
false
sarahdunbar/Multiplication-table
multiplication-table.py
1
1123
""" multiplication-table.py Author: Sarah Dunbar Credit: http://stackoverflow.com/questions/12102749/how-can-i-suppress-the-newline-after-a-print-statement, https://docs.python.org/3.3/library/functions.html#print, Mr. Dennison Assignment: Write and submit a Python program that prints a multiplication table. The user ...
mit
5,617,071,994,563,114,000
28.552632
107
0.610864
false
arne-cl/discoursegraphs
src/discoursegraphs/readwrite/__init__.py
1
2684
# discoursegraphs.readwrite: input/output functionality """ The ``readwrite`` package contains importers, exporters and other output functionality. Basically, it allows you to convert annotated linguistic documents into a graph-based representation for further processing. """ from discoursegraphs.readwrite.anaphorici...
bsd-3-clause
-3,401,569,570,732,145,000
62.904762
91
0.861028
false
kyleabeauchamp/EnsemblePaper
code/model_building/evaluate_BW_entropy.py
1
1791
import pandas as pd import numpy as np from fitensemble import bayesian_weighting, belt import experiment_loader import ALA3 prior = "BW" ff = "amber96" stride = 1000 regularization_strength = 10.0 thin = 400 factor = 50 steps = 1000000 predictions_framewise, measurements, uncertainties = experiment_loader.load(ff, ...
gpl-3.0
1,257,935,225,862,620,400
31.563636
151
0.719151
false
inmcm/Simon_Speck_Ciphers
Python/simonspeckciphers/tests/test_simonspeck.py
1
31076
import pytest from random import randint from speck import SpeckCipher from simon import SimonCipher # Official Test Vectors class TestOfficialTestVectors: """ Official Test Vector From the Original Paper "The SIMON and SPECK Families of Lightweight Block Ciphers" """ # Speck Test Vectors def ...
mit
-6,233,174,175,237,877,000
38.138539
153
0.609731
false
simonacca/TelegramLogHandler
TelegramLogHandler/handler.py
1
1167
import logging class TelegramHandler(logging.Handler): """ A handler class which sends a Telegram message for each logging event. """ def __init__(self, token, ids): """ Initialize the handler. Initialize the instance with the bot's token and a list of chat_id(s) of the...
mit
-6,455,856,852,596,988,000
28.175
81
0.547558
false
mradamcox/arc2arches
scripts/shapefile_local.py
1
45114
""" shapefile.py Provides read and write support for ESRI Shapefiles. author: jlawhead<at>geospatialpython.com date: 20140507 version: 1.2.1 Compatible with Python versions 2.4-3.x version changelog: Fixed u() to just return the byte sequence on exception """ __version__ = "1.2.1" from struct import pack, unpack, ca...
mit
-4,559,625,308,051,093,500
37.297114
136
0.519972
false
Septima/qgis-GeoDanmarkCheck
GeoDanmarkChecker/fot/rules/rule.py
1
1036
# -*- coding: utf-8 -*- """ Routines for quality control of GeoDanmark map data Copyright (C) 2016 Developed by Septima.dk for the Danish Agency for Data Supply and Efficiency 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 F...
gpl-3.0
7,447,081,774,711,142,000
37.407407
78
0.75
false
yugangzhang/chxanalys
chxanalys/chx_compress.py
1
37856
import os,shutil from glob import iglob import matplotlib.pyplot as plt from chxanalys.chx_libs import (np, roi, time, datetime, os, getpass, db, get_images,LogNorm, RUN_GUI) from chxanalys.chx_generic_functions import (create_time_slice,get_detector, get_fields, get_sid_filenam...
bsd-3-clause
-9,175,865,570,974,697,000
39.618026
231
0.520684
false
arangodb/arangodb
3rdParty/rocksdb/6.8/tools/advisor/advisor/rule_parser_example.py
14
3190
# Copyright (c) 2011-present, Facebook, Inc. All rights reserved. # This source code is licensed under both the GPLv2 (found in the # COPYING file in the root directory) and Apache 2.0 License # (found in the LICENSE.Apache file in the root directory). from advisor.rule_parser import RulesSpec from advisor.db_log_...
apache-2.0
7,147,545,253,902,652,000
34.842697
79
0.655172
false
scott-maddox/obpds
src/obpds/examples/interactive_schottky_diode.py
1
1288
# # Copyright (c) 2015, Scott J Maddox # # This file is part of Open Band Parameters Device Simulator (OBPDS). # # OBPDS 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...
agpl-3.0
-4,934,516,960,856,693,000
32.921053
77
0.653727
false
internetarchive/brozzler
tests/test_cluster.py
1
33391
#!/usr/bin/env python ''' test_cluster.py - integration tests for a brozzler cluster, expects brozzler, warcprox, pywb, rethinkdb and other dependencies to be running already Copyright (C) 2016-2018 Internet Archive Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in co...
apache-2.0
1,845,609,178,133,929,700
37.513264
130
0.627055
false
edwardgeorge/libgmail
demos/MakeTarBall.py
1
1530
#!/usr/bin/env python # make tarball! VERSION = '0.3' PACKAGENAME = 'libgmail-docs_' import os print "\nCreate API docs" os.system('epydoc -o API ../libgmail.py') def cleanup(*args): """Used by os.path.walk to traverse the tree and remove CVS dirs""" if os.path.split(args[1])[1] == "CVS": print "Remo...
gpl-2.0
-953,915,241,889,044,600
29
87
0.660784
false
googleads/google-ads-python
google/ads/googleads/v8/services/types/operating_system_version_constant_service.py
1
1324
# -*- 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
6,450,602,099,501,945,000
32.948718
184
0.737915
false
Kuniwak/vint
test/unit/vint/linting/formatter/test_json_formatter.py
1
2170
import unittest from test.asserting.formatter import FormatterAssertion import json from pathlib import Path from vint.linting.formatter.json_formatter import JSONFormatter from vint.linting.level import Level class TestJSONFormatter(FormatterAssertion, unittest.TestCase): def test_format_violations(self): ...
mit
8,809,824,793,104,851,000
30.911765
63
0.469585
false
sysadminmatmoz/odoo-clearcorp
cash_budget/wizard/cash_budget_program_populate.py
1
4063
# -*- coding: utf-8 -*- # © 2016 ClearCorp # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import errno from openerp.osv import osv, fields from openerp.tools.translate import _ import base64 import logging class cash_budget_program_populate(osv.osv_memory): _name = 'cash.budget.program.popu...
agpl-3.0
-6,161,663,397,664,325,000
61.492308
172
0.602659
false
forkbong/passata
tests/test_show.py
1
3697
# Copyright 2017 Panagiotis Ktistakis <panktist@gmail.com> # # This file is part of passata. # # passata 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) a...
gpl-3.0
-2,492,659,238,193,900,000
29.303279
74
0.614011
false
fracpete/python-weka-wrapper3
python/weka/clusterers.py
1
20196
# 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 # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
gpl-3.0
7,037,974,789,696,343,000
34.184669
132
0.640969
false
johnwlockwood/stream_tap
stream_tap/__init__.py
1
1389
from . import _meta from collections import deque __version__ = _meta.version __version_info__ = _meta.version_info class Bucket(object): """ Encloses a function that produces results from an item of an iterator, accumulating any results in a deque. """ def __init__(self, func): self...
apache-2.0
-7,339,902,638,887,691,000
24.722222
61
0.614831
false
dilynfullerton/tr-A_dependence_plots
unused/xl.py
1
1861
"""Put data into an excel workbook. Currently unused. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals from openpyxl import load_workbook, Workbook from ImsrgDataMap import ImsrgDataMapInt from Exp import ExpInt def print_single_particle_energy_data_...
cc0-1.0
-8,680,902,879,900,898,000
28.078125
72
0.584095
false
srznew/heat
doc/source/ext/resources.py
1
15178
# # 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
401,516,824,030,433,600
35.224344
79
0.564238
false
ngtrhieu/outline_alignment
autumn_utils/feature_mappings.py
1
1570
import cv import cv2 import numpy as np import math def get_features (cnt, approx = 5): return cv2.approxPolyDP (cnt, approx, False) def simplify_feature (feature): simple = [] prev = None for v in feature: dist = 5000 if prev is not None: dist = np.linalg.norm (v - prev) if dist > 2: simple.append (...
mit
3,110,566,440,364,656,000
19.402597
54
0.63121
false
nddsg/SimpleDBMS
simple_dbms/create_statement.py
1
2985
from sql_statement import SQLStatement from catalog import Catalog from operation_status import OperationStatus import simple_dbms try: from bsddb import db except ImportError: from bsddb3 import db class CreateStatement(SQLStatement, object): def __init__(self, table, column_def_list): """ ...
gpl-3.0
-5,155,393,903,485,593,000
39.337838
101
0.558124
false
pytlakp/intranetref
src/intranet3/models/times.py
1
1043
import datetime from sqlalchemy import Column, ForeignKey from sqlalchemy.types import DateTime, Date, String, Integer, Float, Boolean from intranet3.models import Base class TimeEntry(Base): __tablename__ = 'time_entry' id = Column(Integer, primary_key=True, index=True) user_id = Column(Integ...
mit
8,433,913,652,926,332,000
33.766667
86
0.705657
false
frew/simpleproto
scons-local-1.1.0/SCons/Tool/swig.py
1
4609
"""SCons.Tool.swig Tool-specific initialization for swig. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # Permission ...
bsd-2-clause
-4,627,851,629,485,158,000
38.059322
121
0.644174
false
eirmag/weboob
contrib/downloadboob/downloadboob.py
1
7890
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(C) 2012 Alexandre Flament # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the L...
agpl-3.0
-1,746,346,105,877,346,800
33.757709
120
0.604689
false
jakemalley/training-log
traininglog/admin/views.py
1
4565
# admin/views.py # Jake Malley # 19/02/15 """ Define the routes for the admin blueprint. """ # Imports from flask import redirect, render_template, \ request, url_for, Blueprint, abort, flash from flask.ext.login import fresh_login_required, current_user from traininglog import db from traininglog.mod...
mit
-4,846,714,409,154,546,000
33.854962
105
0.635487
false
jiansenzheng/oanda_trading
oanda_trading/forex_trading_general_171005.py
1
27162
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created on Mon Jul 06 20:00:30 2016 @author: Jiansen """ import requests import threading import copy import logging import os #import urllib3 import json from scipy import stats #from decimal import Decimal, getcontext, ROUND_HALF_DOWN #from event00 import TickEvent,Tick...
gpl-3.0
-6,703,210,643,960,976,000
40.723502
130
0.533024
false
catapult-project/catapult
dashboard/dashboard/pinpoint/models/cas.py
3
2757
# Copyright 2021 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. """Model for storing information to look up CAS from RBE. A CASReference instance contains metadata that allows us to use RBE-CAS digests when starting Swarm...
bsd-3-clause
5,540,963,464,776,257,000
33.037037
77
0.700762
false
googleinterns/server-side-identity
tests/crypt/test__python_rsa.py
1
7625
# Copyright 2016 Google LLC # Modifications: 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 ...
apache-2.0
-869,925,340,974,221,600
38.102564
87
0.679475
false
Boris-Barboris/rsoi
lab03/local_library/app_local_library/models.py
1
2941
from django.db import models import json import logging from .clients import * log = logging.getLogger('app_logging') # Create your models here. class Book(models.Model): isbn = models.CharField(max_length=20, blank=False) BORROWED = 'brwed' FREE = 'free' state_choices = ( (BORROWED, 'bo...
mit
1,966,678,895,610,190,300
25.035398
80
0.584495
false
EderSantana/seya
seya/parzen.py
1
2543
""" This file was copyed from pyleran2.distributions.parzen.py Their license is BSD clause-3: https://github.com/lisa-lab/pylearn2/ """ import numpy import theano T = theano.tensor def log_mean_exp(a): """ We need the log-likelihood, this calculates the logarithm of a Parzen window """ max_ = a.m...
bsd-3-clause
-7,313,181,990,569,429,000
27.573034
79
0.616201
false
cyphactor/lifecyclemanager
testenv/trac-0.10.4/trac/web/modpython_frontend.py
1
2761
# -*- coding: utf-8 -*- # # Copyright (C) 2004-2005 Edgewall Software # Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de> # Copyright (C) 2005 Matthew Good <trac@matt-good.net> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this ...
gpl-3.0
-3,080,754,147,963,335,000
30.375
72
0.62912
false
mhbashari/machine-learning-snippets
Basic/01-linear_regression_tensorflow.py
1
2015
import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from numpy.core.multiarray import ndarray __author__ = "mhbashari" class LinearRegression: def __init__(self, train_X: ndarray, train_Y: ndarray, learning_rate=0.001, training_epochs=100): self.train_X = train_X self.train...
mit
-6,478,785,350,685,866,000
32.583333
104
0.585112
false
QKaiser/pynessus
pynessus/nessus.py
1
26073
""" Copyright 2014 Quentin Kaiser 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 dis...
apache-2.0
-6,025,734,581,301,239,000
31.149199
116
0.536225
false
madgik/exareme
Exareme-Docker/src/exareme/exareme-tools/madis/src/functions/vtable/flow.py
1
3257
""" .. function:: flow(query:None) Translates the input query results into sql statements if possible. :Returned table schema: - *query* text A complete sql query statement with the semicolon at the end .. note:: Input query results must be sql statements separated with semicolons in the first place...
mit
-3,962,485,522,345,674,000
28.609091
284
0.55327
false
sergeneren/anima
anima/env/mayaEnv/relax_vertices.py
1
1428
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Anima Istanbul # # This module is part of anima-tools and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause """Relax Vertices by Erkan Ozgur Yilmaz Relaxes vertices without shrinking/expanding the geometry. Version History -------...
bsd-2-clause
2,163,826,030,786,291,200
20.636364
68
0.64916
false
corbt/pypeline
setup.py
1
1413
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.di...
mit
-2,353,462,996,388,564,500
32.642857
84
0.635527
false
facelessuser/sublime-markdown-popups
st3/mdpopups/pygments/lexers/pawn.py
1
8073
# -*- coding: utf-8 -*- """ pygments.lexers.pawn ~~~~~~~~~~~~~~~~~~~~ Lexers for the Pawn languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from ..lexer import RegexLexer from ..token import Text, Comment, Operator, Keyword, ...
mit
-358,244,456,042,769,800
39.567839
84
0.445559
false
wooga/airflow
airflow/utils/log/stackdriver_task_handler.py
1
11730
# 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 # "License"); you may not u...
apache-2.0
2,753,684,676,931,630,600
40.013986
111
0.641347
false
kagklis/Frequent-Itemset-Hiding-Toolbox-x86
Apriori.py
1
2242
#------------------------------------------------------------------------------- # Name: Apriori.py # Purpose: Mining Frequent Itemsets # Author: Vasileios Kagklis # Created: 10/02/2014 # Copyright: (c) Vasileios Kagklis #----------------------------------------------------------------------------...
mit
-4,553,797,885,954,154,000
34.03125
80
0.591436
false
hbiyik/tribler
src/tribler-core/tribler_core/utilities/unicode.py
1
2666
""" Conversions to unicode. Author(s): Arno Bakker """ import binascii import chardet def ensure_unicode(s, encoding, errors='strict'): """Similar to six.ensure_text() except that the encoding parameter is *not* optional """ if isinstance(s, bytes): return s.decode(encoding, errors) elif isi...
lgpl-3.0
2,811,927,565,161,218,600
31.512195
112
0.645536
false
commtrack/temp-aquatest
apps/buildmanager/models.py
1
25166
import os, sys import logging import traceback from django.conf import settings from datetime import datetime import time # make things easier so people don't have to install pygments try: from pygments import highlight from pygments.lexers import HtmlLexer from pygments.formatters import HtmlFo...
bsd-3-clause
623,411,994,008,804,400
40.657627
162
0.539339
false
chiahaoliu/2016_summer_XPD
XPD_view/XPD_view_1.py
1
6464
""" This file will contain the code to create the XPD view GUI """ from xray_vision.qt_widgets import CrossSectionMainWindow from PyQt4 import QtGui, QtCore import os import sys import numpy as np from Tif_File_Finder import TifFileFinder from plot_analysis import reducedRepPlot def data_gen(length): ...
bsd-2-clause
-7,495,527,753,662,878,000
35.149425
118
0.603651
false
hacklabr/geodjango-boundaries
boundaries/models.py
1
1543
# -*- coding: utf-8 -*- from django.utils.encoding import python_2_unicode_compatible from django.contrib.gis.db import models @python_2_unicode_compatible class NamedModel(models.Model): name = models.CharField(max_length=255) geometry = models.MultiPolygonField() # Multipolygon in NAD83 objects = mod...
bsd-3-clause
5,712,905,196,875,916,000
23.870968
86
0.669909
false
dangra/scrapy
tests/test_crawler.py
2
16388
import logging import os import platform import subprocess import sys import warnings from unittest import skipIf from pytest import raises, mark from testfixtures import LogCapture from twisted.internet import defer from twisted.trial import unittest import scrapy from scrapy.crawler import Crawler, CrawlerRunner, C...
bsd-3-clause
6,069,620,214,822,966,000
40.463291
112
0.666992
false
metacloud/python-cinderclient
cinderclient/v1/volume_types.py
1
3496
# Copyright (c) 2011 Rackspace US, 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 to in...
apache-2.0
-7,710,020,607,655,474,000
27.655738
78
0.578661
false
mefly2012/platform
test/guozibeijing/deal_repeat.py
1
1867
# coding=utf-8 import json import codecs import os import sys import re if __name__ == '__main__': fr1 = codecs.open(sys.argv[1], 'r', encoding='utf-8') # 我统计的 fr2 = codecs.open(sys.argv[2], 'r', encoding='utf-8') # 君哥统计的 dics1 = [] dics2 = [] for i in fr1: js = json.loads(i) ...
apache-2.0
2,724,095,015,985,590,300
25.536232
106
0.495358
false
klose911/klose911.github.io
src/python/src/lisp/lispy.py
1
12433
################ Scheme Interpreter in Python ## (c) Peter Norvig, 2010; See http://norvig.com/lispy2.html ################ Symbol, Procedure, classes from __future__ import division from __future__ import print_function import re, sys from io import StringIO class Symbol(str): pass def Sym(s, symbol_table={}): ...
apache-2.0
21,476,832,186,802,524
37.974922
87
0.541945
false
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/BioSQL/BioSeqDatabase.py
1
30416
# Copyright 2002 by Andrew Dalke. All rights reserved. # Revisions 2007-2014 copyright by Peter Cock. All rights reserved. # Revisions 2009 copyright by Cymon J. Cox. All rights reserved. # Revisions 2013-2014 copyright by Tiago Antao. All rights reserved. # This code is part of the Biopython distribution and gover...
apache-2.0
1,127,389,766,597,076,100
38.044929
100
0.594523
false
SanaMobile/sana.protocol_builder
src-django/api/serializer.py
1
7122
from collections import OrderedDict from rest_framework import serializers from rest_framework.fields import SkipField from django.contrib.auth.models import User import models import field import json class ElementSerializer(serializers.ModelSerializer): choices = field.ArrayAsStringField(required=False) ans...
bsd-3-clause
-1,810,374,835,869,102,800
26.712062
90
0.55827
false
jedie/django-debug-toolbar-django-info
django_info_panel/panels/database.py
1
1644
#!/usr/bin/env python """ django-info-panel ~~~~~~~~~~~~~~~~~ :copyleft: 2015-2016 by the django-debug-toolbar-django-info team, see AUTHORS for more details. :created: 2015 by JensDiemer.de :license: GNU GPL v3 or above, see LICENSE for more details. """ from __future__ import absolute_import, u...
gpl-3.0
8,547,051,120,517,676,000
28.890909
100
0.599148
false
NeilT-UK/python-utilities
engineering_conversions.py
1
15717
""" The engineering_conversions module This provides two functions eng_float() which behaves like float() eng_str() which behaves like str() but use engineering powers of 1000, and BIPM text multipliers like k and G In the spirit of 'talk exact, listen forgiving', eng_float() understands all prefixes defined by BIPM,...
bsd-2-clause
-5,959,914,873,885,239,000
31.603734
101
0.598855
false
Nepochal/wallabag-cli
wallabag/wallabag_show.py
1
3546
""" Show a wallabag entry """ import io import formatter import json import os from sys import exit import sys from bs4 import BeautifulSoup import api import conf import entry def show(entry_id, colors=True, raw=False, html=False): """ Main function for showing an entry. """ conf.l...
mit
553,081,221,058,167,040
25.703125
98
0.551043
false
jmptrader/duktape
tools/genconfig.py
1
56701
#!/usr/bin/env python2 # # Process Duktape option metadata and produce various useful outputs: # # - duk_config.h with specific or autodetected platform, compiler, and # architecture, forced options, sanity checks, etc # - option documentation for Duktape config options (DUK_USE_xxx) # # Genconfig tries to...
mit
-6,401,203,405,470,451,000
37.105511
313
0.606021
false
noironetworks/group-based-policy
gbpservice/neutron/services/grouppolicy/drivers/extensions/aim_mapping_extension_driver.py
1
4344
# 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
-5,990,733,584,893,358,000
39.222222
78
0.662063
false
JaneliaSciComp/osgpyplusplus
examples/rough_translated1/osgdirectinput.py
1
10576
#!/bin/env python # Automatically translated python version of # OpenSceneGraph example program "osgdirectinput" # !!! This program will need manual tuning before it will work. !!! import sys from osgpypp import osgDB from osgpypp import osgGA from osgpypp import osgViewer # Translated from file 'DirectInputRegis...
bsd-3-clause
779,081,873,386,174,500
36.637011
111
0.647315
false
ROS-PSE/arni
arni_gui/src/arni_gui/connection_item.py
1
7933
import genpy from rospy.rostime import Time, Duration from python_qt_binding.QtCore import QTranslator from abstract_item import AbstractItem from helper_functions import prepare_number_for_representation, MAXIMUM_OFFLINE_TIME, ROUND_DIGITS class ConnectionItem(AbstractItem): """ A ConnectionItem reresents ...
bsd-2-clause
8,285,537,754,295,539,000
40.103627
164
0.541787
false
pshchelo/ironic
ironic/objects/conductor.py
1
6820
# coding=utf-8 # # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 # #...
apache-2.0
-1,894,912,130,061,540,000
45.394558
78
0.643548
false
ke4roh/RPiNWR
tests/test_Si4707.py
1
12599
# -*- coding: utf-8 -*- __author__ = 'ke4roh' # Copyright © 2016 James E. Scarborough # # 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 # (at your option) an...
gpl-3.0
-3,110,605,552,138,210,300
45.483395
119
0.595856
false
astrofra/demo-unusual-suspects
Python-toolchain/3D/vector3.py
1
17953
from math import * from util import format_number class Vector3(object): __slots__ = ('_v',) def __init__(self, *args): """Creates a Vector3 from 3 numeric values or a list-like object containing at least 3 values. No arguments result in a null vector. ...
mit
-5,893,449,000,307,266,000
23.576923
117
0.408233
false
csb-toolbox/CSB
csb/test/cases/bio/io/wwpdb/__init__.py
1
23555
import os import sys import csb.test as test from csb.bio.io.wwpdb import EntryID, StandardID, DegenerateID, SeqResID, InvalidEntryIDError, HeaderFormatError from csb.bio.io.wwpdb import RobustResidueMapper, FastResidueMapper, CombinedResidueMapper, ResidueMappingError, SparseChainSequence from csb.bio.io.wwpdb import...
mit
-2,096,132,994,395,017,200
35.462848
170
0.613288
false
sourcepole/qgis
python/plugins/fTools/tools/doVisual.py
1
21411
# -*- coding: utf-8 -*- from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import * from ui_frmVisual import Ui_Dialog import ftools_utils import math class VisualDialog( QDialog, Ui_Dialog ): def __init__( self, iface, function ): QDialog.__init__( self ) self.iface = iface self.setupUi...
gpl-2.0
-2,410,296,027,648,014,000
38.797398
133
0.603848
false
andresriancho/python-aop
aop/aspecttype.py
1
1966
# -*- coding: utf-8 -*- """ python-aop is part of LemonFramework. python-aop 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. python-aop is ...
gpl-3.0
-6,336,378,035,457,480,000
44.488372
84
0.676892
false
efiop/dvc
dvc/_debug.py
1
2310
from contextlib import ExitStack, contextmanager from typing import TYPE_CHECKING if TYPE_CHECKING: from argparse import Namespace @contextmanager def instrument(html_output=False): """Run a statistical profiler""" try: from pyinstrument import Profiler # pylint: disable=import-error except ...
apache-2.0
1,679,155,082,171,922,400
24.384615
78
0.634632
false
JarbasAI/JarbasAI
mycroft/messagebus/api.py
1
2458
from mycroft.messagebus.message import Message import time __author__ = "jarbas" class BusQuery(): def __init__(self, emitter, message_type, message_data=None, message_context=None): self.emitter = emitter self.waiting = False self.response = Message(None, None, None) ...
gpl-3.0
1,356,580,934,561,058,300
31.342105
74
0.617168
false
vlegoff/tsunami
src/primaires/affection/editeurs/__init__.py
1
1618
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 the above copyright notice, this # ...
bsd-3-clause
621,346,735,999,611,600
49.5
79
0.780322
false
USGSDenverPychron/pychron
pychron/canvas/canvas2D/stage_canvas.py
1
5114
# =============================================================================== # Copyright 2015 Jake Ross # # 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
5,148,437,984,851,985,000
33.554054
97
0.51447
false
AndrasKovacs/dawg-gen
dawg_gen.py
1
7469
#!/usr/bin/env python import os import array as ar import hashlib from sys import argv from copy import copy from collections import defaultdict from time import clock ######################## Read/check word list ############################### print if len(argv) != 2: print "Usage: dawg_gen.py [word list path...
mit
-984,014,338,422,908,400
28.405512
122
0.560718
false
ministryofjustice/collectd-ntp
setup.py
1
1397
import os from setuptools import setup def pkg_dir(path): return os.path.join(os.path.dirname(__file__), path) with open(pkg_dir('VERSION'), 'r') as f: version = f.read().strip() with open(pkg_dir('README.rst'), 'r') as f: readme = f.read() setup( name='collectd-ntp', version=version, py...
mit
2,740,606,144,956,291,000
30.044444
71
0.614173
false
arruah/ensocoin
qa/rpc-tests/txPerf.py
1
10160
#!/usr/bin/env python3 # Copyright (c) 2015-2017 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test re-org scenarios with a mempool that contains transactions # that spend (directly or indire...
mit
-7,180,355,255,265,386,000
40.8107
148
0.584055
false
idiles/opendict
lib/extra/html2text.py
1
4084
""" html2text.py convert an html doc to text """ # system libraries import os, sys, string, time, getopt import re WIDTH = 80 def tag_replace (data,center,indent, use_ansi = 0): data = re.sub ("\s+", " ", data) data = re.sub ("(?s)<!--.*?-->", "", data) data = string.replace (data, "\n", " ") output = ...
gpl-2.0
3,743,144,919,791,192,600
26.594595
72
0.481636
false
xuru/pyvisdk
pyvisdk/do/host_authentication_manager_info.py
1
1086
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def HostAuthenticationManagerInfo(vim, *args, **kwargs): '''The HostAuthenticationManager...
mit
8,138,604,160,572,094,000
30.970588
124
0.616943
false
timpalpant/calibre
src/calibre/ebooks/metadata/cli.py
1
9135
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' ''' ebook-meta ''' import sys, os from calibre.utils.config import StringConfig from calibre.customize.ui import metadata_readers, metadata_writers, force_ident...
gpl-3.0
4,562,069,038,732,612,600
40.148649
117
0.573508
false
rs2/pandas
pandas/core/indexers.py
1
14164
""" Low-dependency indexing utilities. """ import warnings import numpy as np from pandas._typing import Any, AnyArrayLike from pandas.core.dtypes.common import ( is_array_like, is_bool_dtype, is_extension_array_dtype, is_integer, is_integer_dtype, is_list_like, ) from pandas.core.dtypes.gene...
bsd-3-clause
7,059,395,294,665,719,000
27.556452
88
0.578791
false
Shihta/python-novaclient
novaclient/tests/fixture_data/security_groups.py
1
3693
# 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 # distributed under t...
apache-2.0
2,774,355,458,957,496,300
36.30303
78
0.486325
false
XENON1T/pax
pax/plugins/io/MongoDB.py
1
42439
"""Interfacing to MongoDB MongoDB is used as a data backend within the DAQ. For example, 'kodiaq', which reads out the digitizers, will write data to MongoDB. This data from kodiaq can either be triggered or untriggered. In the case of untriggered, an event builder must be run on the data and will result in triggere...
bsd-3-clause
-4,955,728,548,880,822,000
50.881418
120
0.567355
false
PurpleHominid/The-Warlock-of-Firetop-Mountain
WOFT_01.py
1
1632
class clsLocation: #this class provides the support for enumerated locations ROOM=0 DOOR=1 WALL=2 #some more changes went here before the start of the service # # #this branch is called development 01 #this is another branch here class clsPlayerState: #this class provides the functions to suppor...
mit
5,276,123,399,268,443,000
27.137931
90
0.681985
false
hootnot/oandapyV20-examples
src/contrib_mo_tp_sl.py
1
1328
# -*- coding: utf-8 -*- """Example demonstrating the contrib.request classes. Create a MarketOrderRequest to enter 10000 EUR_USD LONG position along with - a TakeProfitOrder to take profit @1.10 - a StopLossOrder to take loss @1.07 These values apply for this moment: EUR_USD 1.0605 So when you run the example you may...
mit
-5,632,243,889,746,396,000
25.039216
77
0.750753
false
thommiller/ANN---Pymier-League
Main.py
1
1763
import numpy as np # sigmoid function def nonlin(x,deriv=False): if(deriv==True): return x*(1-x) return 1/(1+np.exp(-x)) def displayPred(num): if(num> 0.5 and num <0.75): return " - Draw" elif(num>0.75): return " - Win" else: return " - Loss" # for training data we...
mit
3,757,302,599,893,747,700
27.435484
81
0.600681
false
ibrahimkarahan/Flexget
flexget/plugins/output/exec.py
1
7984
from __future__ import unicode_literals, division, absolute_import import logging import subprocess from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.config_schema import one_or_more from flexget.utils.template import render_from_entry, render_from_task, RenderErr...
mit
1,534,387,490,243,318,500
39.527919
116
0.516032
false
Outernet-Project/librarian
librarian/tasks/notifications.py
1
1481
import datetime import logging from greentasks import Task from ..core.exts import ext_container as exts from ..core.utils import utcnow class NotificationCleanupTask(Task): name = 'notifications' periodic = True def get_start_delay(self): return exts.config['notifications.default_expiry'] ...
gpl-3.0
-2,417,505,482,011,534,000
37.973684
76
0.633356
false
wolf9s/doconce
lib/doconce/mwiki.py
1
17031
""" MediaWiki translator, aimed at Wikipedia/WikiBooks type of web pages. Syntax defined by http://en.wikipedia.org/wiki/Help:Wiki_markup and http://en.wikipedia.org/wiki/Help:Displaying_a_formula. The prefix m in the name mwiki distinguishes this translator from gwiki (googlecode wiki). Not yet implemented: mwiki_ref...
bsd-3-clause
7,633,075,306,408,647,000
37.531674
122
0.557278
false
andyeff/skybot
plugins/giantbomb.py
1
1360
from urllib2 import HTTPError from util import hook, http @hook.command(autohelp=False) def gb(inp): '.gb - lists upcoming shows on Giant Bomb' url = 'http://www.giantbomb.com' try: doc = http.get_html(url) except HTTPError as e: errors = {400: 'bad request (ratelimited?) 400', ...
unlicense
7,194,837,047,324,547,000
29.909091
69
0.548529
false
digwanderlust/pants
tests/python/pants_test/backend/jvm/tasks/test_ivy_utils.py
1
12440
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import xml...
apache-2.0
5,113,953,510,214,122,000
35.696165
113
0.61037
false
cc-archive/commoner
src/commoner/broadcast/context_processors.py
1
1043
from django.conf import settings from django.contrib.auth.decorators import login_required from commoner.broadcast.models import Message, Log def messages(request): if request.user.is_authenticated(): messages = Message.active.all() site_messages = [] for message in m...
agpl-3.0
3,577,103,782,968,181,000
28
73
0.466922
false
telefonicaid/murano-agent
muranoagent/app.py
1
8000
# Copyright (c) 2013 Mirantis 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 to in writ...
apache-2.0
-4,816,543,227,355,885,000
36.735849
79
0.541375
false