repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
heavenshell/py-robo-cron
examples/main.py
1
1308
#!/usr/bin/env python # -*- coding: utf-8 -*- """ main ~~~~ Endpoint of robo. :copyright: (c) 2016 Shinya Ohyanagi, All rights reserved. :license: BSD, see LICENSE for more details. """ import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import argpa...
bsd-3-clause
6,208,383,552,914,727,000
23.679245
77
0.639144
false
3.564033
false
false
false
google-research/google-research
poem/cv_mim/action_recognition/eval_with_encoder_base.py
1
9742
# 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
8,072,479,954,315,714,000
36.32567
80
0.675631
false
3.608148
false
false
false
Batch21/pywr
examples/two_reservoir_moea.py
1
8981
""" This example shows the trade-off (pareto frontier) of deficit against cost by altering a reservoir control curve. Two types of control curve are possible. The first is a monthly control curve containing one value for each month. The second is a harmonic control curve with cosine terms around a mean. Both Parameter...
gpl-3.0
3,599,268,737,297,028,000
37.545064
130
0.651821
false
3.439678
false
false
false
LeandroRoberto/sapl
sapl/materia/views.py
1
62121
from datetime import datetime from random import choice from string import ascii_letters, digits from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML from django.contrib import messages from django.contrib.auth.decorators import permission_required from django.contrib.auth.mixins import Perm...
gpl-3.0
-572,955,679,359,772,100
35.47322
79
0.571601
false
3.574115
false
false
false
orbitfold/tardis
tardis/io/util.py
1
6837
#Utility functions for the IO part of TARDIS import os import pandas as pd import numpy as np import collections from collections import OrderedDict import yaml from astropy import constants, units as u from tardis.util import element_symbol2atomic_number import logging logger = logging.getLogger(__name__) def quan...
bsd-3-clause
-6,159,270,194,558,091,000
29.659193
116
0.610794
false
3.981945
true
false
false
jkitchin/pycse
pycse/colab.py
1
16907
from datetime import datetime import glob import io from IPython import get_ipython from IPython.core.magic import register_line_magic from IPython.display import HTML, IFrame from nbconvert import HTMLExporter, PDFExporter import nbformat import os import requests import shlex import shutil import subprocess import te...
gpl-2.0
2,358,838,269,037,825,000
30.13628
182
0.559118
false
3.609522
false
false
false
lsaffre/timtools
timtools/tools/age.py
1
1517
## Copyright 2006-2009 Luc Saffre ## This file is part of the TimTools project. ## TimTools 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 la...
bsd-2-clause
-1,407,870,924,265,700,000
33.27907
71
0.624258
false
3.586288
false
false
false
wasade/qiime
qiime/collate_alpha.py
1
2347
#!/usr/bin/env python __author__ = "Justin Kuczynski" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Justin Kuczynski"] __license__ = "GPL" __version__ = "1.8.0-dev" __maintainer__ = "Justin Kuczynski" __email__ = "justinak@gmail.com" """takes as input alpha diveristy files, format: file: one rar...
gpl-2.0
6,763,250,047,278,648,000
32.056338
78
0.671069
false
3.310296
false
false
false
lilulu/openmc
openmc/checkvalue.py
1
4543
def check_type(name, value, expected_type, expected_iter_type=None): """Ensure that an object is of an expected type. Optionally, if the object is iterable, check that each element is of a particular type. Parameters ---------- name : str Description of value being checked value : objec...
mit
-2,732,315,803,855,901,000
32.160584
81
0.57319
false
4.376686
false
false
false
yotchang4s/cafebabepy
src/main/python/idlelib/idle_test/test_calltips.py
2
6658
import unittest import idlelib.calltips as ct import textwrap import types default_tip = ct._default_callable_argspec # Test Class TC is used in multiple get_argspec test methods class TC(): 'doc' tip = "(ai=None, *b)" def __init__(self, ai=None, *b): 'doc' __init__.tip = "(self, ai=None, *b)" def...
bsd-3-clause
-5,845,890,373,682,991,000
36.615819
89
0.563382
false
3.416111
true
false
false
demisto/content
Templates/Integrations/CaseManagement/CaseManagement.py
1
14520
from CommonServerPython import * ''' IMPORTS ''' from typing import Dict, Tuple, List, AnyStr, Optional, Union import urllib3 # Disable insecure warnings urllib3.disable_warnings() """GLOBALS/PARAMS Attributes: INTEGRATION_NAME: Name of the integration as shown in the integration UI, for example: Microso...
mit
4,286,001,515,527,455,000
33.903846
113
0.609848
false
3.808025
false
false
false
ralphwetzel/theonionbox
theonionbox/tob/deviation.py
1
4728
import socket import struct from time import time # class TimeManager(object): # # time_deviation = 0 # ntp_server = None # # def __init__(self, ntp_server=None): # # if ntp_server is not None: # self.ntp_server = ntp_server # # # self.update_time_deviation() # ...
mit
8,790,246,071,791,990,000
23.978022
89
0.530668
false
3.2879
false
false
false
bmazin/SDR
Setup/WideSweep/autofit.py
1
3468
import numpy as np from WideSweepFile import WideSweepFile from Resonator import Resonator from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt import datetime import argparse import os class autofit(): def __init__(self, wideSweepFileName, reslocFileName, logFileName): self....
gpl-2.0
2,793,827,730,837,882,000
44.631579
143
0.615052
false
3.36699
false
false
false
0x1mason/GribApi.XP
grib_api/examples/python/grib_set_pv.py
1
1434
# # Copyright 2005-2017 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovern...
apache-2.0
-3,276,897,571,185,709,600
23.305085
78
0.638773
false
3.350467
false
false
false
bmya/tkobr-addons
tko_web_sessions_management/res_groups.py
1
2442
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
agpl-3.0
-6,772,305,000,199,667,000
54.5
222
0.572482
false
4.750973
false
false
false
Depado/we-rate
app/models/review.py
1
1451
# -*- coding: utf-8 -*- from datetime import datetime from flask_admin.contrib.sqla import ModelView from flask_login import current_user from app.models import AuthMixin from app import db class Review(db.Model): id = db.Column(db.Integer, primary_key=True) grade = db.Column(db.Integer) critic = db.Co...
gpl-2.0
6,761,924,300,085,468,000
24.910714
67
0.600965
false
3.414118
false
false
false
googleapis/python-aiplatform
google/cloud/aiplatform/v1beta1/schema/predict/instance_v1beta1/types/image_classification.py
1
1525
# -*- 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,939,411,597,889,113,000
31.446809
74
0.664262
false
4.18956
false
false
false
oasis-open/cti-python-stix2
stix2/patterns.py
1
23320
"""Classes to aid in working with the STIX2 patterning language.""" import base64 import binascii import datetime import re from .utils import parse_into_datetime def escape_quotes_and_backslashes(s): return s.replace(u'\\', u'\\\\').replace(u"'", u"\\'") def quote_if_needed(x): if isinstance(x, str): ...
bsd-3-clause
2,983,958,358,843,958,000
32.125
146
0.6247
false
4.054242
false
false
false
loads/loads-broker
loadsbroker/aws.py
1
23742
"""AWS Higher Level Abstractions This module contains higher-level AWS abstractions to make working with AWS instances and collections of instances easier and less error-prone. :class:`EC2Instance` is responsible for maintaining information about itself and updating its state when asked to. The executer passed in mus...
apache-2.0
7,481,006,613,202,182,000
34.121302
79
0.585924
false
4.286333
false
false
false
davidrobles/mlnd-capstone-code
capstone/rl/value_functions/mlp.py
1
1026
import numpy as np from keras.layers.core import Dense from keras.models import Sequential from keras.optimizers import RMSprop from ..value_function import ValueFunction from ...game.utils import normalize_board class MLP(ValueFunction): def __init__(self): self.model = Sequential() self.model.a...
mit
6,710,450,683,781,463,000
32.096774
89
0.622807
false
3.638298
false
false
false
mattock/fabric
package.py
1
1994
from fabric.api import * from urlparse import urlparse from fabric.contrib.files import exists import os import re @task def is_installed(package): """Check if package is installed""" import vars vars = vars.Vars() # This will work with "package.<extension> and "package" package_name = os.path.spli...
bsd-2-clause
5,655,381,179,378,703,000
30.650794
162
0.636911
false
3.856867
false
false
false
dogukantufekci/easyfind
easyfind/easyfind/decorators.py
1
2159
import json import pytz from threading import Thread from django.core.urlresolvers import reverse from django.conf import settings from django.http import HttpResponseRedirect from threading import Thread from django.conf import settings from django.http import HttpResponse from django.utils import timezone, transl...
mit
2,939,057,249,684,449,300
33.83871
86
0.643353
false
4.406122
false
false
false
cym13/epydemy
virus.py
1
5387
# Copyright (c) 2014, Cédric Picard # All rights reserved. # # 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 pr...
gpl-3.0
1,229,342,190,867,799,600
28.271739
73
0.556628
false
4.016406
false
false
false
dessn/sn-bhm
dessn/utility/doJob.py
1
3107
import os import shutil import logging def write_jobscript(filename, name=None, queue="low.q", num_tasks=24, num_cpu=24, num_walks=24, outdir="out_files", delete=False): directory = os.path.dirname(os.path.abspath(filename)) executable = os.path.basename(filename) if name is None: ...
mit
-8,235,756,662,523,549,000
27.245455
97
0.625684
false
2.879518
false
false
false
thelabnyc/django-oscar-cch
src/oscarcch/models.py
1
6362
from decimal import Decimal from django.db import models, transaction from django.contrib.postgres.fields import HStoreField from .settings import CCH_PRECISION from .prices import ShippingChargeComponent class OrderTaxation(models.Model): """ Persist top-level taxation data related to an Order. """ ...
isc
7,803,629,308,897,347,000
34.127072
125
0.635577
false
3.910209
false
false
false
systori/bericht
bericht/html/box.py
1
14218
from copy import copy from string import whitespace from reportlab.pdfbase.pdfmetrics import stringWidth, getFont, getAscentDescent from .style import TextAlign, default as default_style, VerticalAlign __all__ = ('Box', 'Block', 'Inline', 'ListItem') def flatten(sub): for line in sub: if isinstance(line,...
bsd-3-clause
-7,909,066,686,637,133,000
30.248352
102
0.537066
false
3.952738
false
false
false
ppwwyyxx/tensorflow
tensorflow/compiler/tests/binary_ops_test.py
1
59390
# Copyright 2017 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
-3,210,155,200,398,151,000
37.021767
80
0.493046
false
3.174238
true
false
false
Nasafato/LearningCloudEndpoints
Lesson_2/00_Conference_Central/conference.py
1
3871
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ __author__ = 'wesc+api@google.com (Wesley Chun)' from datetime import datetime import j...
gpl-3.0
1,710,577,581,900,458,800
30.729508
93
0.611212
false
4.028096
false
false
false
kumasento/mwparserfromhell
mwparserfromhell/parser/tokenizer.py
1
55460
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2014 Ben Kurtovic <ben.kurtovic@gmail.com> # # 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 ...
mit
4,105,971,670,673,814,000
39.188406
112
0.508276
false
4.252089
false
false
false
unreal666/outwiker
src/outwiker/gui/taglabel.py
3
4841
# -*- coding: utf-8 -*- import wx import wx.lib.newevent import wx.adv from outwiker.gui.controls.hyperlink import (HyperLinkCtrl, EVT_HYPERLINK_LEFT, EVT_HYPERLINK_RIGHT, EVT_HYPERLI...
gpl-3.0
-7,853,590,657,730,478,000
29.269231
72
0.604405
false
3.759554
false
false
false
PennyDreadfulMTG/Penny-Dreadful-Discord-Bot
discordbot/commands/swiss.py
1
2398
import math from typing import List, Optional, Tuple from discord.ext import commands from discordbot.command import MtgContext from magic import tournaments @commands.command() async def swiss(ctx: MtgContext, num_players: Optional[int], num_rounds: Optional[int], top_n: Optional[int]) -> None: """Display the ...
gpl-3.0
8,841,244,004,000,301,000
47.897959
181
0.674457
false
3.304828
false
false
false
lowRISC/edalize
tests/test_xsim.py
1
1062
import pytest def test_xsim(): import os import shutil from edalize_common import compare_files, setup_backend, tests_dir ref_dir = os.path.join(tests_dir, __name__) paramtypes = ['plusarg', 'vlogdefine', 'vlogparam'] name = 'test_xsim_0' tool = 'xsim' tool_optio...
bsd-2-clause
-8,831,796,508,175,589,000
32.1875
84
0.560264
false
3.308411
false
false
false
cuauv/software
mission/framework/position.py
1
3567
import shm from auv_math.math_utils import rotate from mission.framework.combinators import Concurrent, Defer, Sequential from mission.framework.movement import RelativeToInitialPositionN, RelativeToInitialPositionE, PositionN, PositionE, Heading, Depth from mission.framework.task import Task from mission.framework.pr...
bsd-3-clause
-2,753,264,956,545,246,700
32.027778
131
0.632464
false
3.570571
false
false
false
the-maldridge/paperAirplane
server/central_billing.py
1
1615
import logging import database import json import central_psparser import math class Billing(): def __init__(self, config, queues): self.threadOps = queues["threadControl"] self.toBill = queues["toBill"] self.toPrint = queues["toPrint"] self.logger = logging.getLogger("Billing") ...
mit
7,876,902,421,887,854,000
30.057692
88
0.604954
false
3.900966
false
false
false
mkell43/tumblrcl
auth.py
1
2017
import sys import yaml import tumblrtokens from os import stat from os.path import isfile, expanduser auth_file = expanduser("~") + '/tumblrauth' def auth_check_file(): if isfile(auth_file) is False or stat(auth_file)[6] == 0: print "Looks like your auth file is either empty or doesn't exist." ...
mit
-2,256,350,178,264,654,000
28.246377
111
0.642043
false
3.728281
false
false
false
shiehinms/vminspector
ui/textedit.py
1
3385
#!/usr/bin/env python # Copyright (c) 2007-8 Qtrac Ltd. All rights reserved. # This program or module 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 # version 3 of the Lice...
apache-2.0
-6,563,168,420,188,574,000
34.631579
74
0.573708
false
4.459816
false
false
false
algolab-inc/tensorflow-deep-q-network
dqn_agent.py
1
4247
from collections import deque import os import numpy as np import tensorflow as tf class DQNAgent: """ Multi Layer Perceptron with Experience Replay """ def __init__(self, enable_actions, environment_name): # parameters self.name = os.path.splitext(os.path.basename(__file__))[0] ...
mit
4,605,008,561,245,219,000
33.528455
112
0.592889
false
3.455655
false
false
false
mwalercz/virus-total-helper
server/htmlparser/standalone.py
1
2751
import json import sys from pathlib import Path from .finder import Finder from .parser import Parser class JsonNotListError(Exception): pass class IncorrectNumberOfArguments(Exception): pass class Standalone: def __init__(self, html_path, json_path=None): self.parser = Parser() self....
bsd-3-clause
749,772,384,195,993,700
31.75
127
0.628499
false
3.946915
false
false
false
PhilLidar-DAD/geonode
geonode/people/views.py
1
4579
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
gpl-3.0
-2,216,366,786,165,776,400
36.227642
92
0.619568
false
4.686796
false
false
false
thozza/tracking-portal
tracking_portal/tracker/serializers.py
1
1851
# -*- coding: utf-8 -*- # # Tracking portal for sensor data # Copyright (C) 2014 Tomas Hozza <thozza@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 # he Free Software Foundation; either version 2 of the License, ...
gpl-2.0
6,629,100,424,021,626,000
29.866667
85
0.681253
false
4.235698
false
false
false
umutkarahan/Project100
sample/PrimeFactor.py
1
1701
# # Created By: Umut Karahan # Aim: Calculation for prime numbers of the number # Algorithm: Pollard Formula # Date Created: 15/11/2016 import time from sympy.ntheory import factorint from functools import reduce def primes(n): sieve = [True] * (n // 2) for i in range(3, int(n ** 0.5) + 1, 2): if sie...
bsd-2-clause
-7,791,346,054,208,244,000
25.578125
99
0.572016
false
3.16171
false
false
false
Royce/GammaJS
docs/conf.py
1
8956
# -*- coding: utf-8 -*- # # Gma documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable ...
mit
2,679,243,018,022,192,600
31.567273
104
0.705226
false
3.657003
true
false
false
AutorestCI/azure-sdk-for-python
azure-mgmt-datafactory/azure/mgmt/datafactory/models/cassandra_linked_service.py
1
3473
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
6,718,755,832,612,969,000
45.932432
187
0.661388
false
4.551769
false
false
false
ucloud/uai-sdk
ufile/operation/download_single_op.py
1
1795
from ufile.api.ufile_api import DowloadUfileSingle from ufile.operation.operation import Operation class DownloadUfileSingleOp(Operation): def __init__(self, parser): super(DownloadUfileSingleOp, self).__init__(parser) def _add_args(self, parser): super(DownloadUfileSingleOp, self)._add_args(...
apache-2.0
-7,330,438,944,295,425,000
35.653061
121
0.574373
false
4.024664
false
false
false
pauljohnleonard/MusicBox
src/util/filters.py
1
5047
import array,math def make_array(N,init_val=0.0): #return array.array('d',N*[init_val]) # array of floats broken in micropython return N*[init_val] def halfLifeFactors(nsamp): # fact ^ nsamp = 0.5 # nsamp*ln(fact) = ln(0.5) # ln(fact)= ln(0.5)/nsamp # fact=exp(ln(0.5)/nsamp) fact=math.exp(math....
gpl-2.0
4,583,448,818,959,659,500
19.031746
102
0.478106
false
2.703267
false
false
false
RoboCupULaval/UI-Debug
test/testQPainterWidget.py
1
2130
# Under GNU GPLv3 License, see LICENSE.txt import sys, time from random import randint from PyQt5.QtWidgets import QWidget, QApplication from PyQt5.QtGui import QPainter, QPen, QBrush, QColor from PyQt5.QtCore import pyqtSignal, QMutex, QTimer __author__ = 'jbecirovski' class TestPainter(QWidget): frame_rate = ...
mit
2,455,249,001,436,098,000
31.272727
177
0.562441
false
3.491803
false
false
false
whyflyru/django-cacheops
cacheops/tree.py
1
6608
# -*- coding: utf-8 -*- from itertools import product # Use Python 2 map here for now from funcy.py2 import map, cat from django.db.models.query import QuerySet from django.db.models.sql import OR from django.db.models.sql.query import Query, ExtraWhere from django.db.models.sql.where import NothingNode # This thing e...
bsd-3-clause
-5,426,173,242,248,831,000
34.718919
90
0.596852
false
4.051502
false
false
false
nive-cms/nive
nive/userdb/useradmin/view.py
1
5542
#---------------------------------------------------------------------- # Copyright 2012, 2013 Arndt Droullier, Nive GmbH. All rights reserved. # # 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
-5,148,675,441,834,349,000
35.946667
117
0.563154
false
4.093058
false
false
false
delvelabs/htcap
core/util/utilities/updcookie.py
1
1332
# -*- coding: utf-8 -*- import sys import sqlite3 import json import getopt import os from core.util.base_util import BaseUtil reload(sys) sys.setdefaultencoding('utf8') class Updcookie(BaseUtil): @staticmethod def get_settings(): return dict( descr = "Update the value of a cookie of saved requests", op...
gpl-2.0
-6,109,026,695,752,438,000
18.588235
94
0.626877
false
2.846154
false
false
false
Edilmo/brat-widget
brat_widget/annotation.py
1
37154
# coding=utf-8 from codecs import open as codecs_open from itertools import chain, takewhile from time import time from re import match as re_match from brat_widget.common import ProtocolError from brat_widget.messager import Messager # String used to catenate texts of discontinuous annotations in reference text DISC...
mit
4,513,409,429,725,703,700
33.78839
123
0.579911
false
4.086
false
false
false
shreyaspotnis/rampage
rampage/widgets/CommonWidgets.py
1
3059
"""Provides useful utility widgets. Widgets: MyDoubleSpinBox(QtGui.QDoubleSpinBox) QNamedPushButton(QtGui.QPushButton) QMultipleSpinBoxEdit(QtGui.QWidget) """ from PyQt4 import QtGui, QtCore class MyDoubleSpinBox(QtGui.QDoubleSpinBox): """Selects all text once it receives a focusInEvent. Use t...
mit
3,963,634,378,506,475,500
29.287129
78
0.648578
false
3.972727
false
false
false
mariakesa/CountingGrids
usage_example.py
1
1191
from scipy import io import numpy as np from counting_grid import CountingGrid ''' This is an example of using the CountingGrid class on lung cancer gene expression data. ''' def filter_by_variance(X,nr_of_features_to_keep): ''' Function for thresholding data by variance, keeping only 'nr_of_features_to_...
gpl-2.0
-6,687,901,654,638,976,000
25.466667
58
0.617128
false
2.634956
false
false
false
hbprotoss/weii
app/widget/picture_viewer.py
1
8416
# coding=utf-8 import imghdr from PyQt4.QtCore import * from PyQt4.QtGui import * from app import theme_manager from app import logger from app import constant SIGNAL_FINISH = SIGNAL('downloadFinished') SIGNAL_PROGRESS = SIGNAL('progress') SIGNAL_ZOOM = SIGNAL('zoom') log = logger.getLogger(__name__) class Downloa...
mit
9,179,085,862,147,919,000
33.076923
96
0.569867
false
3.934549
false
false
false
alessiomoretti/ArduPi-Temperature-Server
start.py
1
3687
import threading import time import sys import serial from deployment.ClientServer import Monitor, WebClient from deployment.DBMS import TemperatureDatabase from deployment.IO.configuration import ServerConfiguration global id_flag global server def monitoring(database, lock, debug=False): """ this function ...
mit
-6,871,545,279,269,392,000
27.346154
122
0.571777
false
4.455865
false
false
false
corredD/upy
blender/v257/blenderUI.py
1
86477
""" Copyright (C) <2010> Autin L. TSRI This file git_upy/blender/v257/blenderUI.py is part of upy. upy 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, o...
gpl-3.0
2,942,870,015,219,741,000
41.850842
420
0.514253
false
3.858507
false
false
false
hzlf/openbroadcast
website/apps/invitation/views.py
1
7841
from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.template import RequestContext from django.shortcuts import render_to_response from django.utils.translation import ugettext from django.contrib.auth.decorators import login_required from django.contrib.admin.views.dec...
gpl-3.0
3,799,500,612,918,630,400
37.24878
127
0.642648
false
4.667262
false
false
false
hemnathmouli/Python
Multiple_addition_with_average.py
1
1407
raw=input("Enter the number 2 to 6:") if(raw=='2'): n1_str=input("n1: ") n1=int(n1_str) n2_str=input("n2: ") n2=int(n2_str) n3=0 n4=0 n5=0 n6=0 elif(raw=='3'): n1_str=input("n1: ") n1=int(n1_str) n2_str=input("n2: ") n2=int(n2_str) n3_str=input("n3: ") n3=int(n3_s...
gpl-2.0
4,730,122,530,302,240,000
19.391304
70
0.529495
false
2.078287
false
true
false
grepme/CMPUT410Lab01
name-family.py
1
1218
class Student: """This is a very simple Student class""" course_marks = {} name = "" family = "" def __init__(self, name, family): self.name = name self.family = family def addCourseMark(self, course, mark): """Add the course to the course dictionary, this will overide the old mark if one exists.""" ...
apache-2.0
-5,834,589,806,476,257,000
23.36
72
0.674877
false
3.147287
false
false
false
tianyin/confuzz
testcase.py
1
1604
import os from datetime import datetime import shutil class TestCase: """ Any subclass must implemenet runtest() and oracle() """ def __init__(self, app, prog, re): self.appid = app self.tprog = prog self.res = re def oracle(self): print '[error] This is a virtual...
mit
5,006,395,989,702,973,000
30.45098
91
0.564838
false
3.612613
false
false
false
MDSLab/s4t-iotronic
iotronic/api/controllers/v1/utils.py
1
5364
# Copyright 2013 Red Hat, 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 by...
apache-2.0
4,270,878,264,823,975,400
31.707317
78
0.667412
false
3.812367
false
false
false
toastdriven/restless
restless/resources.py
1
18786
from functools import wraps import sys from .constants import OK, CREATED, ACCEPTED, NO_CONTENT from .data import Data from .exceptions import MethodNotImplemented, Unauthorized from .preparers import Preparer from .serializers import JSONSerializer from .utils import format_traceback def skip_prepare(func): """...
bsd-3-clause
6,065,238,444,160,676,000
30.733108
86
0.60066
false
4.616859
false
false
false
davislg/Google-s-Python-Class
logpuzzle/davis_solution/logpuzzle.py
1
2461
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import os import re import sys import urllib """Logpuzzle exercise Given an apache logfile, ...
apache-2.0
-709,408,762,317,981,300
23.858586
192
0.641203
false
3.060945
false
false
false
shailr/vms
authentication/models.py
1
1421
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser from django.db import models from core.models import TimeStampedModel from organizations.models import Organization class AccountManager(BaseUserManager): def create_user(self, email, password=None, **kwargs): if not email: ...
gpl-2.0
1,738,641,979,850,879,200
26.862745
72
0.655876
false
4.28012
false
false
false
xNovax/SickRage
sickbeard/providers/bitsoup.py
1
10189
# Author: Idan Gutman # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 o...
gpl-3.0
5,974,201,855,236,837,000
36.186131
125
0.547061
false
4.116768
false
false
false
cbclab/MOT
mot/mcmc_diagnostics.py
1
25240
"""This module contains some diagnostic functions to diagnose the performance of MCMC sample. The two most important functions are :func:`multivariate_ess` and :func:`univariate_ess` to calculate the effective sample size of your samples. """ from collections import Mapping import itertools import numpy as np from num...
lgpl-3.0
-2,409,278,531,703,763,500
40.85738
120
0.666561
false
3.732623
false
false
false
fheinle/Photoblog
gdata/gauth.py
1
16843
#!/usr/bin/env python # # Copyright (C) 2009 Google 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 ...
gpl-3.0
-1,152,089,210,906,043,900
36.849438
81
0.691445
false
3.862188
false
false
false
chen-charles/PyPokemon
PokemonFinalProjectV1/rgine/exception.py
1
1444
import os import inspect path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) f = open(path+os.sep+"__DEBUG__", "rb") __DEBUG__ = f.read(1)[0] f.close() if __DEBUG__: from common import * else: from rgine.common import * _logfmt = \ '''===================================================...
gpl-3.0
6,031,378,608,480,243,000
21.920635
106
0.574792
false
2.899598
false
false
false
crs4/omero.biobank
build_configuration.py
1
6061
#!/usr/bin/env python #======================================================================= # The build_configuration.py tool is used to build the configuration # details used by the KB to interact with the Graph engine. # The tool requires to connect to a properly configured OMERO server # to retrieve all the info...
gpl-2.0
3,069,578,788,366,068,700
30.242268
78
0.575318
false
3.59064
true
false
false
thast/EOSC513
DC/SimultaneousSources/NoUpdateW/NoUpdateW.py
1
8631
from SimPEG import Mesh, Regularization, Maps, Utils, EM from SimPEG.EM.Static import DC import numpy as np import matplotlib.pyplot as plt #%matplotlib inline import copy #import pandas as pd #from scipy.sparse import csr_matrix, spdiags, dia_matrix,diags #from scipy.sparse.linalg import spsolve from scipy.stats imp...
mit
-8,826,195,697,761,138,000
28.972222
110
0.633994
false
2.555062
false
false
false
brechtm/rinohtype
src/rinoh/number.py
1
4278
# This file is part of rinohtype, the Python document preparation system. # # Copyright (c) Brecht Machiels. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. from copy import copy from .attribute import Attribute,...
agpl-3.0
1,381,425,716,698,403,800
30.791045
78
0.629343
false
3.547044
false
false
false
mworks/mworks
mwel/mwel/decompiler/simplifier.py
1
1736
from __future__ import division, print_function, unicode_literals class Simplifier(object): _ignored = ( 'action_marker', 'transition_marker', ) _omit_tag = ( 'action', 'list_replicator', 'range_replicator', 'transition', ) _ignored_attrib...
mit
2,658,166,716,732,770,300
28.423729
77
0.520161
false
4.34
false
false
false
UWCS/uwcs-website
uwcs_website/elections/views.py
1
6821
from django.forms import ModelForm from models import Vote, Candidate, Election from django.shortcuts import render_to_response,get_object_or_404 from django.forms.formsets import formset_factory from django.forms.widgets import HiddenInput, Widget, TextInput from django import forms from django.utils.encoding import S...
agpl-3.0
-9,025,061,004,539,054,000
37.977143
139
0.669257
false
3.929147
false
false
false
jendap/tensorflow
tensorflow/python/ops/nn_grad.py
1
36024
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-2,020,794,719,108,256,300
32.952875
80
0.633161
false
3.338956
false
false
false
SEL-Columbia/commcare-hq
corehq/apps/smsbillables/async_handlers.py
1
4044
import json import logging from couchdbkit import ResourceNotFound from django.utils.encoding import force_unicode from django_countries.countries import COUNTRIES from phonenumbers import COUNTRY_CODE_TO_REGION_CODE from django.utils.translation import ugettext_lazy as _ from corehq.apps.accounting.utils import fmt_do...
bsd-3-clause
835,041,903,931,174,100
37.514286
101
0.622898
false
3.8551
false
false
false
harmsm/uhbd
uhbd/UhbdSingleFunctions.py
1
4607
""" UhbdSingleFunctions.py Functions for running single-site calculations using UHBD. Replaces the prepares and doinps binaries. """ import os TITRATABLE = {"HISA":"NE2","HISB":"ND1","HISN":"ND1","HISC":"ND1", "LYS":"NZ","LYSN":"NZ","LYSC":"NZ", "ARG":"CZ","ARGN":"CZ","ARGC":"CZ", ...
unlicense
-1,013,267,368,904,412,000
31.443662
78
0.545474
false
3.06113
false
false
false
czl/hackTX_2014
facebook-sdk-master/examples/appengine/example.py
1
5526
#!/usr/bin/env python # # Copyright 2010 Facebook # # 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 a...
mit
3,903,462,240,229,973,500
33.5375
79
0.606768
false
4.202281
false
false
false
personal-robots/sar_social_stories
src/ss_init_db.py
1
6277
#!/usr/bin/env python # Jacqueline Kory Westlund # July 2016 # # The MIT License (MIT) # # Copyright (c) 2016 Personal Robots Group # # 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 ...
mit
1,927,267,452,784,436,000
42.895105
80
0.638203
false
4.480371
false
false
false
oVirt/ovirt-engine-cli
src/ovirtcli/platform/posix/spice.py
1
5697
# # Copyright (c) 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
apache-2.0
2,232,064,803,984,959,000
30.65
99
0.612077
false
3.601138
true
false
false
all-of-us/raw-data-repository
tests/test_data.py
1
5702
"""Utilities for loading test data.""" import datetime import json import os import random from rdr_service.code_constants import ( BIOBANK_TESTS, CONSENT_FOR_STUDY_ENROLLMENT_MODULE, EMAIL_QUESTION_CODE, FIRST_NAME_QUESTION_CODE, LAST_NAME_QUESTION_CODE, LOGIN_PHONE_NUMBER_QUESTION_CODE, ...
bsd-3-clause
-6,512,344,247,479,060,000
35.787097
118
0.678709
false
3.487462
true
false
false
saullocastro/pyNastran
pyNastran/bdf/dev_vectorized/cards/constraints/spcd.py
3
2802
from six.moves import zip import numpy as np from numpy import array from pyNastran.bdf.field_writer_8 import print_card_8 from pyNastran.bdf.field_writer_16 import print_card_16 class SPCD(object): """ Defines an enforced displacement value for static analysis and an enforced motion value (displacement,...
lgpl-3.0
-3,054,176,026,512,221,700
34.468354
104
0.519986
false
3.476427
false
false
false
seetea/serving
tensorflow_serving/example/inception_client.py
1
2472
# Copyright 2016 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 by applicable law or a...
apache-2.0
-992,515,238,466,406,800
31.96
80
0.679612
false
3.593023
false
false
false
matheuscas/pyfuzzy_toolbox
pyfuzzy_toolbox/fis.py
1
7697
import mf class FuzzySet(object): """docstring for FuzzySet""" TRIMF = 'trimf' def __init__(self, name, params, _range, type=TRIMF): self.name = name self.type = type self.params = params self.range = _range def _get_mf(self, input_value): return mf.trimf(in...
bsd-3-clause
6,151,367,680,362,581,000
35.13615
152
0.510459
false
3.399735
false
false
false
goller/casstest
docs/conf.py
1
8472
#!/usr/bin/env python # -*- coding: utf-8 -*- # # casstest documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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 # au...
bsd-3-clause
-3,545,522,322,632,810,000
29.807273
76
0.705146
false
3.720685
true
false
false
wongcyrus/ExcelLexBot
codehook/appointment.py
1
21925
""" This code sample demonstrates an implementation of the Lex Code Hook Interface in order to serve a bot which manages dentist appointments. Bot, Intent, and Slot models which are compatible with this sample can be found in the Lex Console as part of the 'MakeAppointment' template. For instructions on how to se...
apache-2.0
-1,808,212,765,944,189,400
39.526802
139
0.59813
false
4.386755
false
false
false
ic-hep/DIRAC
AccountingSystem/private/DataCache.py
1
3187
""" Accounting Cache """ __RCSID__ = "$Id$" import os.path import time import threading from DIRAC import S_OK, S_ERROR, gLogger, rootPath, gConfig from DIRAC.Core.Utilities.DictCache import DictCache class DataCache( object ): def __init__( self ): self.graphsLocation = os.path.join( gConfig.getValue( '/Lo...
gpl-3.0
-4,990,429,044,922,010,000
31.191919
124
0.631315
false
3.705814
false
false
false
GrognardsFromHell/TemplePlus
tpdatasrc/co8infra/scr/Spell233 - Holy Word.py
1
3722
from toee import * def OnBeginSpellCast( spell ): print "Holy Word OnBeginSpellCast" print "spell.target_list=", spell.target_list print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level game.particles( "sp-evocation-conjure", spell.caster ) def OnSpellEffect ( spell ): print "Holy Word OnSpel...
mit
7,799,302,661,690,194,000
39.032258
163
0.702311
false
2.806938
false
false
false
oasisvali/pythonchallenge
ch17.py
1
1991
from urllib2 import Request, build_opener, HTTPCookieProcessor, HTTPHandler import cookielib import urllib import urllib2 import bz2 import re import requests import xmlrpclib if __name__ == '__main__': info = '' i=0 # while (i<400): # if i == 0: # url = url = "http://www.pythonchallenge.com/pc/def...
apache-2.0
-668,484,745,419,057,900
30.109375
287
0.649422
false
2.690541
false
false
false
DevMan01/SkullKingCalc
skullKingCalc.py
1
10010
import time import os import math # Global variables gameComplete = "n" numPlayersValid = "n" playerNameList = [] numRounds = 10 scoringComplete = 'n' currentRound = 1 playerScoreList = [0,0,0,0,0,0] # Print Applications banner information print('Welcome to the Skull King Calculator') print('Version ...
gpl-3.0
-705,307,556,621,614,600
39.543568
247
0.454745
false
5.047907
false
false
false
ShawnHymel/TweetRace
pytest/twitter_test_04.py
1
1533
# Twitter API Test # Execute: $ python twitter_test_02.py from twython import TwythonStreamer # Search terms (Note: hashtags only right now!) terms = ['#fml', '#blessed', '#diy', '#guncontrol', '#obamacare'] # Twitter authentication APP_KEY = 'li8wn8Tb7xBifCnNIgyqUw' APP_SECRET = 'vcwq36w4C4VXamlqWBDKM2E8etsOoangDoM...
mit
1,147,011,769,013,680,300
29.66
68
0.629485
false
3.078313
false
false
false
marchchad/keg-server
TemperatureMonitor/TempMonitor.py
1
8148
import time import glob import atexit # Once we get a DB set up, we'll activate this # import mysql.connector # To save data locally in the event we can't post or need to recover/reset data import logging import requests import json import threading import datetime import RPi.GPIO as GPIO # from socketIO_client import...
mit
6,574,876,405,779,873,000
33.235294
135
0.60297
false
4.119312
false
false
false
mmcauliffe/linguistic-helper-functions
linghelper/phonetics/helper.py
1
3054
import math #from scipy.fftpack import dct,idct import numpy as np from scipy.spatial.distance import euclidean from praatinterface import PraatLoader def get_intensity(filename, praat = None): if not praat: praat = PraatLoader() text = praat.run_script('intensity.praat',filename) return praat.rea...
gpl-3.0
6,798,388,226,170,063,000
32.56044
88
0.571054
false
3.151703
false
false
false
longde123/MultiversePlatform
server/config/sampleworld/instance_load.py
1
3726
# # The Multiverse Platform is made available under the MIT License. # # Copyright (c) 2012 The Multiverse Foundation # # 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 restrict...
mit
7,086,195,152,425,173,000
34.826923
72
0.809716
false
3.19554
false
false
false
matthiasdiener/spack
var/spack/repos/builtin/packages/nalu/package.py
1
3377
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-1,985,905,764,868,269,800
36.94382
152
0.610305
false
3.743902
false
false
false
inercia/evy
evy/patched/urllib.py
1
2538
# # Evy - a concurrent networking library for Python # # Unless otherwise noted, the files in Evy are under the following MIT license: # # Copyright (c) 2012, Alvaro Saurin # Copyright (c) 2008-2010, Eventlet Contributors (see AUTHORS) # Copyright (c) 2007-2010, Linden Research, Inc. # Copyright (c) 2005-2006, Bob Ippo...
mit
8,116,206,676,802,269,000
38.65625
93
0.749803
false
3.776786
false
false
false
jandom/GromacsWrapper
gromacs/tests/fileformats/top/test_amber03star.py
1
1066
# GromacsWrapper: test_amber03star.py # Copyright (c) 2009 Oliver Beckstein <orbeckst@gmail.com> # Released under the GNU Public License 3 (or higher, your choice) # See the file COPYING for details. from __future__ import division, absolute_import, print_function import pytest from gromacs.exceptions import Gromacs...
gpl-3.0
-7,592,141,780,115,156,000
40
98
0.690432
false
3.373418
true
false
false
dtroyer/python-openstacksdk
openstack/network/v2/load_balancer.py
1
2371
# 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
-7,590,232,310,654,306,000
40.596491
75
0.703079
false
4.032313
false
false
false
OctavianLee/Barrage
danmaku/cores/produce_and_consume.py
1
2588
# -*- coding: utf-8 -*- """ The core algorithm of reciever. Definitely, it's the model of producer and consumer. Coroutine is a better way of implementing that model. However, when connecting to the server, it also needs to keep alive by heartbeat. """ import time import gevent import struct from ge...
mit
-2,510,978,549,289,738,000
26.11828
66
0.633228
false
3.288136
false
false
false
garethr/serf-master
serf_master/__init__.py
1
1396
#!/usr/bin/env python import os import logging class SerfHandler(object): def __init__(self): self.name = os.environ['SERF_SELF_NAME'] self.role = os.environ.get('SERF_TAG_ROLE') or os.environ.get('SERF_SELF_ROLE') self.logger = logging.getLogger(type(self).__name__) if os.environ[...
mit
-3,681,707,510,721,545,700
28.702128
87
0.565903
false
3.814208
false
false
false
jdurgin/radosgw-agent
radosgw_agent/lock.py
1
3451
import logging import threading import time from radosgw_agent import client log = logging.getLogger(__name__) class LockBroken(Exception): pass class LockRenewFailed(LockBroken): pass class LockExpired(LockBroken): pass class Lock(threading.Thread): """A lock on a shard log that automatically ref...
mit
7,317,300,985,968,116,000
32.833333
79
0.56969
false
4.162847
false
false
false
PushAMP/pamagent
pamagent/hooks/mysql_hook.py
1
1463
import wrapt from pamagent.hooks.dbapi2 import (ConnectionWrapper as DBAPI2ConnectionWrapper, ConnectionFactory as DBAPI2ConnectionFactory) from pamagent.trace import register_database_client from pamagent.transaction_cache import current_transaction from pamagent.wrapper import Func...
gpl-3.0
3,856,025,594,746,976,000
34.682927
103
0.687628
false
4.18
false
false
false