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
andrewjrobinson/FreeCAD_sf_master
src/Mod/Draft/DraftTrackers.py
1
34739
#*************************************************************************** #* * #* Copyright (c) 2011 * #* Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
-1,483,052,015,789,805,300
37.945067
114
0.567259
false
CiscoSystems/os-sqe
lab/scenarios/servers_from_snapshot_scenario.py
1
1179
from lab.test_case_worker import TestCaseWorker class ServersFromSnapshotScenario(TestCaseWorker): ARG_MANDATORY_N_SERVERS = 'n_servers' ARG_MANDATORY_UPTIME = 'uptime' def check_arguments(self): assert self.n_servers >= 1 assert self.uptime > 10 @property def n_servers(self): ...
apache-2.0
719,308,940,948,195,300
30.864865
174
0.648855
false
kreatorkodi/repository.torrentbr
plugin.video.youtube/resources/lib/youtube_plugin/kodion/impl/xbmc/xbmc_context_ui.py
1
5105
__author__ = 'bromix' from six import string_types import xbmc import xbmcgui from ..abstract_context_ui import AbstractContextUI from .xbmc_progress_dialog import XbmcProgressDialog from .xbmc_progress_dialog_bg import XbmcProgressDialogBG from ... import constants from ... import utils class XbmcContextUI(Abstra...
gpl-2.0
5,859,240,278,206,949,000
33.261745
108
0.610382
false
fernan9/LANGEBIO-Internship
BLAST_rbh_run.py
1
3987
#! /usr/bin/env python """ DESCRIPTION """ import glob, sys, csv from tabulate import tabulate from Bio.Blast.Applications import NcbiblastpCommandline """--- FUNCTIONS ---""" def carga_csv(file_name): """ creates a list of lists with a csv file """ tabla = [] cr = csv.reader(open(file_name,"rb")) ...
gpl-2.0
-2,226,153,138,521,786,600
34.598214
118
0.610986
false
CajetanP/code-learning
Python/Learning/Language/ifelse.py
1
1729
people = 30 cars = 40 trucks = 15 if cars > people: print("Take the cars.") elif cars < people: print("Don't take the cars!") else: print("We can't decide ;/") if trucks > cars: print("Too many trucks!") elif trucks < cars: print("Maybe we could take the trucks?") else: print("We can't decide....
mit
6,353,056,969,983,072,000
24.80597
109
0.622325
false
brayden2544/Mystuff-final
account/views/reset_password.py
1
1223
from django import forms from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, Http404 from account import models as amod from . import templater import datetime def process_request(request): '''Creates a reset password form to email a unique link to the user''' user ...
apache-2.0
-6,399,470,654,394,678,000
30.358974
77
0.670482
false
rootio/rootio_web
alembic/env.py
1
2308
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python...
agpl-3.0
-2,669,275,381,323,216,400
27.146341
79
0.687608
false
sam-roth/Keypad
keypad/qt/qt_util.py
1
2494
from PyQt4.Qt import * from collections import namedtuple import contextlib from ..core.key import SimpleKeySequence from ..core.color import Color from ..abstract.textview import KeyEvent from ..core.responder import Responder from .. import api import abc import math def set_tab_order(parent, widgets): for f...
gpl-3.0
-4,094,260,488,308,843,500
20.135593
71
0.615477
false
nextoa/comb
comb/slot.py
1
2027
# -*- coding: utf-8 -*- class Slot(object): """ To use comb, you should create a python module file. we named *slot*. A legal slot must be named 'Slot' in your module file and it must be at least contain four method: * `initialize` initial resource, e.g: database handle * `__enter__` g...
mit
-5,057,463,884,052,601,000
19.474747
102
0.51258
false
4ndreas/ROSCoffeButler
src/arbotix_python/src/arbotix_python/diff_controller.py
1
10710
#!/usr/bin/env python """ diff_controller.py - controller for a differential drive Copyright (c) 2010-2011 Vanadium Labs LLC. All right reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributi...
mit
5,647,903,849,542,350,000
40.034483
144
0.556489
false
juancarlospaco/css-html-js-minify
css_html_js_minify/js_minifier.py
1
6476
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """JavaScript Minifier functions for CSS-HTML-JS-Minify.""" import re from io import StringIO # pure-Python StringIO supports unicode. from .css_minifier import condense_semicolons __all__ = ('js_minify', ) def remove_commented_lines(js): """Force remove com...
lgpl-3.0
1,878,974,442,023,061,800
35.178771
79
0.468345
false
YYWen0o0/python-frame-django
tests/admin_filters/tests.py
2
41331
from __future__ import unicode_literals import datetime from django.contrib.admin import (site, ModelAdmin, SimpleListFilter, BooleanFieldListFilter, AllValuesFieldListFilter, RelatedOnlyFieldListFilter) from django.contrib.admin.views.main import ChangeList from django.contrib.auth.admin import UserAdmin from dj...
bsd-3-clause
-9,038,131,155,378,770,000
43.925
168
0.656916
false
DataDog/integrations-core
vertica/datadog_checks/vertica/vertica.py
1
28443
# (C) Datadog, Inc. 2019-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from __future__ import division import logging import ssl from collections import OrderedDict, defaultdict from datetime import datetime from itertools import chain import vertica_python as vertica from ...
bsd-3-clause
2,484,851,219,268,113,000
43.442188
135
0.589143
false
ofafa/pynotes
2015.4.14.forum.py
1
12428
class panel: def 瞿志豪(Michel): Natsdaq def vicent: b84 華楊、悠遊卡董事 def Bruce: EMBA95 矽谷創業,開曼控股 def 司徒嘉恆(Seetoo): b84,台大經濟->國外法律,創拓法律事務 新創集資等等,到IPO或是併購階段從後端來探討 web 1.0時代,大學畢業做網路媒體,失敗跟當時的法律因素也有關 def 詹德弘(Joseph): b80, Giga media,華威、之初、台式架構/美式架構,大...
cc0-1.0
-4,045,274,517,115,713,000
33.045977
125
0.626772
false
garibaldu/boundary-seekers
Boundary Hunter Ideas/TensorFlow/RBF-BH-Network.py
1
6690
import tensorflow as tf import matplotlib import numpy as np import matplotlib.pyplot as plt import random import math np.random.seed(1234) random.seed(1234) plt.switch_backend("TkAgg") def plotScatter(points, color): xs = [x[0] for x in points] ys = [y[1] for y in points] plt.scatter(xs, ys, c=colo...
mit
-5,844,633,788,650,325,000
26.991632
108
0.582511
false
hamdyaea/Daylight-GNU-Linux
Version4/usr/share/daylight/PySpeaking-GUI/speak.py
1
1687
# Developer : Hamdy Abou El Anein import os import sys from easygui import * print("IMPORTANT\n\nThis software work only if google_speech is installed on the system. To install it go to this link please : https://pypi.python.org/pypi/google_speech/\n\n") def language(): global lang msg = "What's the langu...
gpl-3.0
3,731,881,394,284,948,500
24.575758
177
0.578542
false
dubvulture/pyku
pyku/digit_classifier.py
1
4575
# coding=utf-8 import os import cv2 import numpy as np from .utils import DSIZE, TRAIN_DATA class DigitClassifier(object): @staticmethod def _feature(image): """ It's faster but still accurate enough with DSIZE = 14. ~0.9983 precision and recall :param image: :return:...
gpl-3.0
-8,652,264,273,431,171,000
35.903226
80
0.532022
false
jorgecarleitao/pt_law_parser
tests/test_full_doc.py
1
3393
from tests.test_basic import TestDocument class TestDocStart(TestDocument): """ Test case intended to show that summary pages of a document are correctly ignored. """ def test_107190_page_1(self): file_name = 'tests/samples/107190.pdf' self._run_test(file_name, [0]) self.a...
mit
585,957,194,112,291,200
28.763158
79
0.605659
false
darrencheng0817/AlgorithmLearning
Python/leetcode/MergeKLists.py
1
1442
class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode """ from heapq import heappush, heappop, heapreplace, heapify ...
mit
-99,459,296,128,431,540
22.639344
65
0.511789
false
pkill-nine/qutebrowser
tests/unit/completion/test_models.py
1
24554
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2017 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net> # # This file is part of qutebrowser. # # qutebrowser 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...
gpl-3.0
-5,333,383,868,739,639,000
35.002933
79
0.590332
false
captainsafia/agate
agate/columns/base.py
1
3431
#!/usr/bin/env python from collections import Mapping, Sequence try: from collections import OrderedDict except ImportError: #pragma: no cover from ordereddict import OrderedDict import six from agate.exceptions import ColumnDoesNotExistError from agate.utils import memoize class ColumnMapping(Mapping): ...
mit
-8,266,430,875,048,023,000
23.507143
75
0.568347
false
Pulgama/supriya
supriya/nonrealtime/Moment.py
1
1816
from supriya.nonrealtime.SessionObject import SessionObject class Moment(SessionObject): """ A moment-in-time referencing a singleton non-realtime state. :: >>> import supriya.nonrealtime >>> session = supriya.nonrealtime.Session() >>> moment = session.at(10.5) """ ### ...
mit
-4,129,431,815,755,473,400
24.942857
80
0.590859
false
dennisss/sympy
sympy/functions/special/tests/test_error_functions.py
2
24070
from sympy import ( symbols, expand, expand_func, nan, oo, Float, conjugate, diff, re, im, Abs, O, factorial, exp_polar, polar_lift, gruntz, limit, Symbol, I, integrate, S, sqrt, sin, cos, sinh, cosh, exp, log, pi, EulerGamma, erf, erfc, erfi, erf2, erfinv, erfcinv, erf2inv, gamma, uppergamma, l...
bsd-3-clause
-8,657,577,822,490,563,000
34.712166
102
0.523889
false
kdebrab/pandas
pandas/core/resample.py
1
52045
from datetime import timedelta import numpy as np import warnings import copy from textwrap import dedent import pandas as pd from pandas.core.groupby.base import GroupByMixin from pandas.core.groupby.ops import BinGrouper from pandas.core.groupby.groupby import ( _GroupBy, GroupBy, groupby, _pipe_template ) from ...
bsd-3-clause
-5,954,581,995,773,467,000
31.630094
79
0.550562
false
grze/parentheses
clc/eucadmin/eucadmin/describeinstances.py
1
2047
# Software License Agreement (BSD License) # # Copyright (c) 2013 Eucalyptus Systems, Inc. # All rights reserved. # # Redistribution and use of this software in source and binary forms, with or # without modification, are permitted provided that the following conditions # are met: # # Redistributions of source code m...
gpl-3.0
-8,749,896,958,695,378,000
40.77551
77
0.737665
false
ryansb/disq
tests/test_job_commands.py
1
2851
# Copyright 2015 Ryan Brown <sb@ryansb.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
4,155,654,131,376,370,000
26.152381
74
0.649947
false
cmars/pystdf
pystdf/TestSummarizer.py
1
7154
# # PySTDF - The Pythonic STDF Parser # Copyright (C) 2006 Casey Marshall # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later versi...
gpl-2.0
1,444,826,504,898,870
35.131313
91
0.638803
false
brkwon/arista_eapi
modules/arista_eapi_urllib2.py
1
3060
# EAPI call program using urllib2 and json import urllib2 #import random import json # eAPI JSON template enableCmd = {"input" : "test", "cmd" : "enable"} jsonCmd = {"params" : {"format" : "json", "version" : 1, "cmds" : "command"}, "jsonrpc" : "2.0", "method" : "runCmds", "id" : 0} # Create json based on enable_pa...
lgpl-3.0
-2,830,876,098,484,342,300
32.26087
128
0.675817
false
chdecultot/frappe
frappe/model/base_document.py
1
25095
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from six import iteritems, string_types import datetime import frappe, sys from frappe import _ from frappe.utils import (cint, flt, now, cstr, strip_html, getdate, get_datetime, ...
mit
-9,026,169,210,520,244,000
29.905172
120
0.66308
false
Sult/evetool
evetool/settings.py
1
4146
""" Django settings for evetool project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
mit
8,719,298,617,498,412,000
23.975904
73
0.646406
false
SEL-Columbia/commcare-hq
corehq/apps/users/bulkupload.py
1
19528
from StringIO import StringIO import logging from couchdbkit.exceptions import ( BulkSaveError, MultipleResultsFound, ResourceNotFound, ) from django.core.exceptions import ValidationError from django.utils.translation import ugettext as _ from corehq.apps.groups.models import Group from corehq.apps.users.f...
bsd-3-clause
4,689,480,229,207,205,000
35.500935
130
0.552284
false
Jarn/jarn.viewdoc
jarn/viewdoc/testing.py
1
1874
import sys import os import unittest import tempfile import shutil import functools if sys.version_info[0] >= 3: from io import StringIO else: from StringIO import StringIO from os.path import realpath, isdir class ChdirStack(object): """Stack of current working directories.""" def __init__(self): ...
bsd-2-clause
-3,124,150,782,722,566,000
21.309524
53
0.570971
false
halfakop/Teacup_Firmware
configtool/gui.py
1
19693
import sys import time try: import wx except: print("ImportError: No module named wx\n\n" "wxPython is not installed. This program requires wxPython to run.\n" "See your package manager and/or http://wxpython.org/download.php.") time.sleep(10) sys.exit(-1) import os.path from configtool.data ...
gpl-2.0
6,312,573,059,711,797,000
30.917342
80
0.607779
false
ahwkuepper/stdme
app/constants.py
1
8339
import numpy as np #labels for summary plots d_label = np.array(["You", "Your gender", "Your age group", "Your race / ethnicity", "Your location"]) #US statistics gender_number = {} gender_number["Male"] = 155651602 gender_number["Female"] = 160477237 race_number = {} race_number["Native"] = 1942876.0 race_number[...
mit
658,293,424,676,495,500
37.428571
102
0.699844
false
riolet/rioauth
provider/pages/register.py
1
1949
import web import common import base class Register(base.Page): def __init__(self): base.Page.__init__(self, "Register") def GET(self): # show login page return common.render.register() @staticmethod def send_conf_email(user_id, name, email): duration = 1800 # 30 mi...
gpl-3.0
6,252,393,982,004,596,000
30.95082
104
0.636224
false
geosoco/twitter_capture_client
multiprocess_client_test.py
1
1546
#!/usr/bin/env python """Base classes for clients.""" import argparse import logging import logging.config from multiprocessing import freeze_support from clients.multiprocess import MultiprocessClientBase from configfile import ConfigFile import exceptions # # global # log = None # # configure basic logger # de...
bsd-3-clause
-522,471,715,683,376,060
18.820513
66
0.631307
false
dileep-kishore/microbial-ai
tests/conftest.py
1
2031
# @Author: dileep # @Last Modified by: dileep import json import os import random import pytest from microbial_ai.io import ModelTable from microbial_ai.metabolism import Microbe CURRPATH = os.path.dirname(__file__) @pytest.fixture(scope="module") def model_table(): return ModelTable(db_uri=f"sqlite:///{CURRP...
mit
-7,260,259,383,662,208,000
24.708861
83
0.688331
false
O-T-L/PyOTL
Tests/nsga_ii.py
1
5611
""" Copyright (C) 2014, 申瑞珉 (Ruimin Shen) This program 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 later version. This program is distributed i...
lgpl-3.0
5,589,080,152,595,766,000
51.383178
142
0.688671
false
siacs/HttpUploadComponent
httpupload/server.py
2
13933
#!/usr/bin/env python3 import argparse import base64 import errno import hashlib import logging import mimetypes import os import random import shutil import ssl import string import sys import time import urllib.parse import yaml from sleekxmpp.componentxmpp import ComponentXMPP from threading import Event from thre...
agpl-3.0
1,377,332,783,470,547,000
41.478659
165
0.55975
false
joaofanti/TrabRedesIIFinal
Modelos/Mapa/MapFactory.py
1
2000
import json from Map import Map from Door import Door from Room import Room from Item import Item """ Define um gerador de mapas. """ class MapFactory: """ Cria uma nova instancia de gerador de mapas. """ def __init__(self): self.RoomsList = [] # Lista de salas geradas. self.DoorsList = [] # Lista de portas...
mit
-4,662,907,654,454,719,000
25.328947
95
0.697
false
gdanezis/claimchain-core
claimchain/utils/wrappers.py
1
6989
import hippiehug from hippiehug.Utils import binary_hash from .encodings import ensure_binary # TODO: Move to hippiehug 1.0 # TODO: Move the tests out of doctests class Blob(bytes): @property def hid(self): return binary_hash(self) def _check_hash(key, value): if value.hid != key: rai...
mit
3,593,495,631,763,739,600
27.880165
76
0.597653
false
onyg/aserializer
aserializer/django/fields.py
1
2229
# -*- coding: utf-8 -*- from collections import Iterable try: from django.db.models.query import QuerySet from django.db.models import Manager except ImportError: QuerySet = None Manager = None from aserializer.fields import ListSerializerField from aserializer.django.utils import get_local_fields, get...
mit
-4,767,140,626,325,645,000
42.705882
120
0.61956
false
pedrobaeza/l10n-spain
l10n_es_partner/models/l10n_es_partner.py
1
7222
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2008 Spanish Localization Team # Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) # Jordi Esteve <jesteve@zikzakm...
agpl-3.0
6,887,857,847,909,223,000
40.705202
81
0.461123
false
151706061/SimpleITK
Examples/Segmentation/ConnectedThresholdImageFilter.py
1
2202
'''========================================================================= ' ' Copyright Insight Software Consortium ' ' Licensed under the Apache License, Version 2.0 (the "License"); ' you may not use this file except in compliance with the License. ' You may obtain a copy of the License at ' ' ...
apache-2.0
7,621,793,930,765,058,000
26.525
136
0.645322
false
dbrattli/RxPY
rx/linq/observable/sequenceequal.py
1
3360
import collections from rx import AnonymousObservable, Observable from rx.disposables import CompositeDisposable from rx.internal import default_comparer from rx.internal import extensionmethod @extensionmethod(Observable) def sequence_equal(self, second, comparer=None): """Determines whether two sequences are e...
apache-2.0
2,095,176,045,865,010,000
32.267327
110
0.545238
false
laborautonomo/django-newsletter
newsletter/migrations/0005_auto__del_emailtemplate__del_unique_emailtemplate_title_action__del_fi.py
1
11955
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from ..utils import get_user_model User = get_user_model() user_orm_label = '%s.%s' % (User._meta.app_label, User._meta.object_name) user_model_label = '%s.%s' % (User._meta.app_label, Us...
agpl-3.0
-1,749,140,199,191,356,700
71.018072
187
0.582016
false
rakhimov/cppdep
setup.py
1
1609
#!/usr/bin/env python """The setup script to generate dist files for PyPi. To upload the release to PyPi: $ ./setup.py sdist bdist_wheel --universal $ twine upload dist/* """ from setuptools import setup from cppdep import cppdep setup( name="cppdep", version=cppdep.VERSION, maintainer="Olzhas R...
gpl-3.0
8,897,259,033,538,249,000
31.836735
85
0.607209
false
ScientificDataFormat/SDF-Python
sdf/hdf5.py
1
5874
# Copyright (c) 2019 Dassault Systemes. All rights reserved. import h5py import sdf import numpy as np import os import sys def _to_python_str(s): """ Convert to Python string """ if isinstance(s, bytes): return s.decode('utf-8') else: return s def load(filename, obje...
bsd-3-clause
7,269,598,341,535,490,000
26.240385
112
0.52843
false
XNBlank/sudoBot
modules/profile.py
1
8013
import discord from discord.ext import commands from PIL import Image from PIL import ImageOps from PIL import ImageDraw from PIL import ImageFont import asyncio, aiohttp, io, time, imghdr, os, json, textwrap, re class Profile: """ Profile card setup and display """ def __init__(self, client, config):...
gpl-3.0
1,141,081,767,628,333,000
35.094595
212
0.560215
false
chirpradio/chirpradio-machine
chirp/stream/statistics.py
1
6045
""" Compute statistics about a consumed sequence of messages. """ from chirp.common import http_console_server from chirp.common import timestamp from chirp.stream import message class _ConnectionInfo(object): MAX_NUM_ERRORS = 25 connection_id = None start_timestamp_ms = None last_timestamp_ms ...
apache-2.0
-8,816,550,096,536,408,000
37.503185
79
0.561952
false
unreal666/outwiker
src/outwiker/core/htmltemplate.py
2
2477
# -*- coding: utf-8 -*- import re from string import Template from outwiker.gui.guiconfig import HtmlRenderConfig from outwiker.core.application import Application class MyTemplate (Template): """ Класс работы с шаблонами. Единственное, для чего сделан такой класс - избавитсья от замены $$ на $ Реал...
gpl-3.0
1,693,166,516,128,128,300
34.290323
79
0.579525
false
DanLindeman/memegen
tests/test_api_aliases.py
1
1225
# pylint: disable=unused-variable,misplaced-comparison-constant,expression-not-assigned from expecter import expect from .utils import load def describe_get(): def it_requires_a_name_to_return_aliases(client): status, data = load(client.get("/api/aliases/")) expect(status) == 200 expec...
mit
-1,296,583,061,009,426,400
27.488372
87
0.516735
false
PoolC/pythonstudy
entity.py
1
1669
#coding:utf-8 import types class Channel(object): def __init__(self, owner): self._owner = owner def _process_message(self, sender, msg, msgargs): return self._owner._handle(sender, msg, msgargs) def sendto(self, receiver, msg, msgargs = None): return receiver._process_mes...
gpl-3.0
-5,939,575,256,779,529,000
24.287879
60
0.537448
false
keenondrums/sovrin-node
sovrin_client/agent/agent_issuer.py
1
3182
import json from plenum.common.types import f from anoncreds.protocol.issuer import Issuer from anoncreds.protocol.types import ID from anoncreds.protocol.types import ClaimRequest from sovrin_client.agent.constants import EVENT_NOTIFY_MSG, CLAIMS_LIST_FIELD from sovrin_client.agent.msg_constants import CLAIM, CLAIM_R...
apache-2.0
4,596,627,729,626,327,000
37.337349
95
0.641735
false
jbeezley/girder
girder/__init__.py
1
11346
# -*- coding: utf-8 -*- from pkg_resources import DistributionNotFound, get_distribution try: __version__ = get_distribution(__name__).version except DistributionNotFound: # package is not installed __version__ = None __license__ = 'Apache 2.0' import cherrypy import functools import logging import loggi...
apache-2.0
-6,225,005,307,584,097,000
37.591837
98
0.654328
false
zhewang/lcvis
main.py
1
3262
import json import numpy as np import pca import process_object as po from flask import Flask, request, jsonify, render_template, url_for app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') @app.route('/supernova') def supernova(): return render_template('supernova.html'...
gpl-2.0
1,719,386,529,822,531,600
26.411765
92
0.57572
false
nicememory/pie
pyglet/examples/opengl_3.py
1
1655
#!/usr/bin/python # $Id:$ '''In order to use the new features of OpenGL 3, you must explicitly create an OpenGL 3 context. You can do this by supplying the `major_version` and `minor_version` attributes for a GL Config. This example creates an OpenGL 3 context, prints the version string to stdout, and exits....
apache-2.0
8,591,080,027,478,945,000
34.777778
78
0.712387
false
datascopeanalytics/sensor_fusion
main.py
1
6487
import copy import datetime import math import random from collections import defaultdict import matplotlib as mpl import matplotlib.animation from matplotlib.ticker import FormatStrFormatter import numpy as np import scipy import seaborn as sns import traces # local imports from kalman import Estimate, Reading from...
unlicense
-2,849,462,378,540,954,000
34.839779
112
0.617389
false
minrk/sympy
sympy/tensor/indexed.py
1
13604
"""Module that defines indexed objects The classes IndexedBase, Indexed and Idx would represent a matrix element M[i, j] as in the following graph:: 1) The Indexed class represents the entire indexed object. | ___|___ ' ' M[i, j] ...
bsd-3-clause
-3,039,205,285,116,504,000
31.623501
99
0.60394
false
1503051/webhookshipping
app.py
1
1887
#!/usr/bin/env python import urllib import json import os from flask import Flask from flask import request from flask import make_response from pymongo import MongoClient # Flask app should start in global layout app = Flask(__name__) client = MongoClient('mongodb://localhost:27017') @app.route('/star', methods=['...
apache-2.0
-2,935,963,759,269,244,400
24.849315
126
0.612083
false
rajanandakumar/DIRAC
DataManagementSystem/Client/ReplicaManager.py
1
113878
""" :mod: ReplicaManager .. module: ReplicaManager :synopsis: ReplicaManager links the functionalities of StorageElement and FileCatalog. This module consists ReplicaManager and related classes. OBSOLETED !!! DO NOT USE THIS ANYMORE!!!! USE THE DataManager CLASS """ # # imports from datetime import datetime, tim...
gpl-3.0
-7,696,063,295,908,667,000
43.10457
157
0.646042
false
level12/blazeweb
blazeweb/pytest_plugin.py
2
1203
def pytest_addoption(parser): parser.addoption("--blazeweb_package", action="store", help="blazeweb-package: app module to run for tests") parser.addoption("--blazeweb_profile", action="store", default="Test", help="blazeweb-profile: app settings profile to use (default...
bsd-3-clause
7,284,290,946,232,201,000
41.964286
92
0.671654
false
matrix-org/synapse
tests/storage/test_devices.py
1
5336
# Copyright 2016-2021 The Matrix.org Foundation C.I.C. # # 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...
apache-2.0
3,141,021,267,772,333,600
34.573333
88
0.587706
false
JQIamo/artiq
artiq/coredevice/comm_moninj.py
1
2537
import asyncio import logging import struct from enum import Enum __all__ = ["TTLProbe", "TTLOverride", "CommMonInj"] logger = logging.getLogger(__name__) class TTLProbe(Enum): level = 0 oe = 1 class TTLOverride(Enum): en = 0 level = 1 oe = 2 class CommMonInj: def __init__(self, monito...
lgpl-3.0
838,825,745,491,158,500
29.202381
78
0.546709
false
hzlf/openbroadcast.ch
app/media_embed/utils.py
1
1679
# -*- coding: utf-8 -*- from __future__ import unicode_literals try: from urlparse import urlparse, parse_qs except ImportError: from urllib.parse import urlparse, parse_qs EMBED_SERVICE_PROVIDERS = [ # Video 'Youtube', 'Vimeo', # Audio ] def process_provider_url(url, exclude_providers=[]):...
gpl-3.0
296,941,797,632,779,200
23.691176
87
0.57832
false
prats226/python-amazon-product-api-0.2.8
tests/utils.py
1
2424
from lxml import objectify import re try: # make it python2.4/2.5 compatible! from urlparse import urlparse, parse_qs except ImportError: # pragma: no cover from urlparse import urlparse from cgi import parse_qs def convert_camel_case(operation): """ Converts ``CamelCaseOperationName`` into ``pyt...
bsd-3-clause
8,023,360,274,834,195,000
35.727273
82
0.636964
false
imiyoo2010/mitmproxy
doc-src/index.py
1
2510
import os, sys, datetime import countershape from countershape import Page, Directory, PythonModule, markup, model import countershape.template sys.path.insert(0, "..") from libmproxy import filt, version MITMPROXY_SRC = os.environ.get("MITMPROXY_SRC", os.path.abspath("..")) ns.VERSION = version.VERSION if ns.options...
mit
-5,763,400,009,474,492,000
27.202247
95
0.627888
false
e7dal/hexy
setup.py
1
1766
#!/usr/bin/env python # -*- coding: utf-8 -*- import imp import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup readme = open('readme.txt').read() history = open('history.txt').read().replace('.. :changelog:', '') curr_path = os.path.dirname(os.path.realpa...
gpl-3.0
-8,694,179,322,663,520,000
25.757576
66
0.637599
false
evernote/pootle
pootle/core/views.py
1
13622
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2013 Zuza Software Foundation # Copyright 2013-2014 Evernote Corporation # # This file is part of Pootle. # # Pootle 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 Softw...
gpl-2.0
-2,622,846,277,347,944,000
35.132626
79
0.624284
false
projectatomic/atomic-reactor
tests/constants.py
1
4756
# -*- coding: utf-8 -*- """ Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals, absolute_import import os from textwrap import dedent HERE = os.path.dirna...
bsd-3-clause
720,660,319,337,230,600
25.276243
98
0.719512
false
simonbr73/nyc-subway-finder
interfaces.py
1
4396
import sys class TextInterface: """Text-based interface that contains methods for getting input from the user and displaying search results. """ def __init__(self, trains_list): """Initializes the TextInterface object with a list of all train objects in the simulation. """ ...
mit
-7,588,274,881,581,400,000
48.954545
132
0.613285
false
etianen/moody-templates
src/moody/loader.py
1
5355
"""A caching template loader that allows disk-based templates to be used.""" import os, sys from abc import ABCMeta, abstractmethod class TemplateDoesNotExist(Exception): """A named template could not be found.""" class Source(metaclass=ABCMeta): """A source of template data.""" __slots...
bsd-3-clause
-6,064,786,215,887,489,000
30.692308
129
0.580579
false
ewjoachim/pyler
pyler/euler_test_base.py
1
2100
import signal import unittest import time from . import website as w class EulerProblem(unittest.TestCase): problem_id = None def solver(self, input_val): raise NotImplementedError() simple_input = None simple_output = None real_input = None def solve_real(self): """ ...
mit
8,948,021,599,226,098,000
26.631579
78
0.57381
false
almeidapaulopt/frappe
frappe/model/db_query.py
1
21364
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from six import iteritems, string_types """build query for doclistview and return results""" import frappe, json, copy, re import frappe.defaults import frappe.share import fra...
mit
-5,802,090,927,492,263,000
32.43349
120
0.66921
false
rdkit/rdkit-orig
Code/ML/FeatureSelect/Wrap/testCMIM.py
2
1730
from rdkit.ML import FeatureSelect as FS from rdkit import DataStructs as DS from rdkit import RDConfig import unittest class TestCase(unittest.TestCase): def setUp(self) : pass def test0FromList(self) : examples = [] bv = DS.ExplicitBitVect(5) bv.SetBitsFromList([0,2,4]) examples.app...
bsd-3-clause
-1,545,998,874,891,628,800
21.763158
40
0.610405
false
thalesians/tsa
src/test/python/thalesians/tsa/q/testq.py
1
5227
import datetime import unittest import thalesians.tsa.q as kdb class TestDataTypes(unittest.TestCase): def setUp(self): self.conn = kdb.q('localhost', 41822) def testInteger(self): self.conn.k('{[x]test::x}', (15,)) self.assertEqual(self.conn.k('test'), 15) self.conn.k('test:2...
apache-2.0
-5,831,748,582,302,765,000
36.604317
97
0.548881
false
ratzeni/vcf-miner.client
setup.py
1
1546
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'VERSION')) as f: __version__ = f.read().strip() with open(os.path.join(here, 'requirements.txt')) as f: required = f.read().splitlines() with open(os.path.join(here, 'README....
mit
-9,032,565,296,916,977,000
31.893617
63
0.575679
false
marcuschia/ShaniXBMCWork
script.video.F4mProxy/lib/f4mDownloader.py
1
49882
# -*- coding: utf-8 -*- import xml.etree.ElementTree as etree import base64 from struct import unpack, pack import sys import io import os import time import itertools import xbmcaddon import xbmc import urllib2,urllib import traceback import urlparse import posixpath import re import hmac import hashl...
gpl-2.0
-2,045,013,516,949,013,200
42.145133
548
0.494427
false
lluisball/godenerg
axpert/charger.py
1
2546
from time import sleep from datetime import datetime, timedelta from axpert.protocol import ( CMD_REL, parse_inverter_conf, empty_inverter_conf, CmdSpec ) from axpert.settings import charger_conf from axpert.datalogger import get_avg_last FLOAT_VOL = charger_conf['float_voltage'] ABSORB_VOL = charger_conf['absorb...
gpl-3.0
5,399,676,398,103,707,000
34.361111
79
0.569521
false
wooster/framework_depviz
depviz.py
1
10369
#!/usr/bin/env python """ The MIT License (MIT) Copyright (c) 2013 Andrew Wooster 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 u...
mit
-6,358,658,463,639,979,000
43.311966
135
0.621564
false
jsubpy/jsub
jsub/exts/repo/file_system.py
1
2428
import os import json import logging import fcntl from jsub.util import safe_mkdir from jsub.util import safe_rmdir from jsub.error import RepoReadError from jsub.error import TaskNotFoundError ID_FILENAME = 'id' class FileSystem(object): def __init__(self, param): self.__jsub_dir = os.path.expanduser(param.get...
mit
5,301,751,721,617,016,000
27.564706
107
0.656919
false
sumihai-tekindo/account_sicepat
sicepat_erp/invoice_line_exp_cost/invoice_line_exp_cost.py
1
7446
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Pambudi Satria (<https://github.com/pambudisatria>). # @author Pambudi Satria <pambudi.satria@yahoo.com> # # This program is free software: you can redistribute it and/or modify ...
gpl-3.0
-6,949,873,827,119,664,000
58.048387
165
0.592399
false
jzerbe/taskifier
taskifier/internal/__init__.py
1
3830
from datetime import datetime from django.core.exceptions import ObjectDoesNotExist import json from taskifier import const from taskifier.models import Task, TaskOwner from taskifier.internal.TaskPayloadHelper import TaskPayloadHelper def DELETE(task_owner, task_id): task = _get_task_by_id(task_id) if task...
bsd-3-clause
-939,080,448,045,002,200
35.132075
92
0.620627
false
nss350/magPy
core/windowSelector.py
1
17249
""" Created on Thu Mar 24 08:18:04 2016 @author: npop The window selector calculates which global windows to use Calculates overlapping windows between given sites This removes the burden on the upcoming processor Upcoming processor can then simply get the data for the windows And process them """ import os from datet...
apache-2.0
-2,665,271,720,281,101,300
35.856838
222
0.681663
false
amahabal/PySeqsee
farg/core/util.py
1
3569
# Copyright (C) 2011, 2012 Abhijit Mahabal # # 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 distribu...
gpl-3.0
-742,354,667,693,318,000
32.046296
93
0.692351
false
lbjay/cds-invenio
modules/bibformat/lib/bibformat_bfx_engine_config.py
1
5843
## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (...
gpl-2.0
-8,086,134,669,331,546,000
49.808696
146
0.479719
false
jantman/cobbler
newtests/cli/imports/test_vmware/vmware_import_test.py
1
1218
import os import sys import unittest from cobbler import utils from newtests.cli.imports.import_base import CobblerImportTest from newtests.cli.imports.import_base import create_import_func class Test_VMWare_Imports(CobblerImportTest): """ Tests imports of various distros """ pass distros = [ {"name":"v...
gpl-2.0
6,504,870,934,439,871,000
42.5
129
0.683087
false
smurfix/gevent-socketio
socketio/transports.py
1
11396
import gevent import urllib try: import urllib.parse as urlparse except ImportError: import urlparse from geventwebsocket import WebSocketError from gevent.queue import Empty class BaseTransport(object): """Base class for all transports. Mostly wraps handler class functions.""" def __init__(self, han...
bsd-3-clause
116,012,888,092,994,820
34.6125
114
0.550807
false
bjornwallner/proq2-server
apps/modeller9v8/examples/commands/saxs.py
1
1049
# script to calculate SAXS spectrum of a model from modeller import * from modeller.scripts import complete_pdb env=environ() env.libs.topology.read(file='$(LIB)/top_heav.lib') env.libs.parameters.read(file='$(LIB)/par.lib') log.verbose() ### Calculate SAXS spectrum of correct structure mdl = complete_pdb(env, '1cuk')...
gpl-3.0
-4,310,941,405,752,410,000
36.464286
74
0.731173
false
TurboTurtle/sos
sos/collector/__init__.py
1
54982
# Copyright Red Hat 2020, Jake Hunsaker <jhunsake@redhat.com> # This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Publi...
gpl-2.0
-8,600,018,873,667,082,000
42.258851
79
0.524299
false
0x1001/BabyMonitor
app/add_finger_print.py
1
1251
def add_finger_print(file_path): import wave import analyzer import storage import recording import config import os a = analyzer.Analyzer() s = storage.Storage(config.Config("../config.json")) waveFile = wave.open(file_path) waveData = waveFile.readframes(waveFile.getnframes()...
gpl-2.0
-7,902,132,046,651,514,000
28.809524
119
0.643485
false
benschneider/sideprojects1
density_matrix/fft_filter_test.py
1
1683
from scipy.signal.signaltools import _next_regular from matplotlib import pyplot as plt from numpy.fft import fft, rfftn, irfftn, fftshift # for real data can take advantage of symmetries import numpy as np import codecs, json # from scipy.signal import remez, freqz, lfilter # lpf = remez(21, [0, 0.2, 0.3, 0.5], [1.0, ...
gpl-2.0
-3,275,720,611,350,555,000
32
118
0.623886
false
KhronosGroup/COLLADA-CTS
Core/Gui/Dialog/FSettingsScrolledSizer.py
1
3448
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publis...
mit
8,386,046,570,576,897,000
48.271429
466
0.639211
false
YtvwlD/metecli
metecli/cmdline.py
1
1638
from . import setup, account, audits, drinks, config, show_version from .utils import test_terminal_utf8 import argparse import logging log = logging.getLogger(__name__) def setup_logging(log_level: str) -> None: numeric_log_level = getattr(logging, log_level.upper(), None) if not numeric_log_level: ...
gpl-3.0
-4,544,778,988,285,004,300
29.333333
79
0.653846
false
dpgaspar/AutoAnt
autoant/console.py
1
2092
#!/usr/bin/env python import argparse import logging import datetime from autoant import AutoAnt from .providers import providers from .version import VERSION_STRING log_level = {'INFO':logging.INFO, 'DEBUG':logging.DEBUG, 'CRITICAL':logging.CRITICAL, 'ERROR':logging.ERROR} def...
bsd-3-clause
133,878,767,866,146,460
33.866667
98
0.641969
false
3upperm2n/DIGITS
tools/create_db.py
2
20860
#!/usr/bin/env python # Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. import sys import os.path import time import argparse import logging import re import shutil import math import random from collections import Counter import threading import Queue try: import digits except ImportError: ...
bsd-3-clause
-4,733,648,372,469,106,000
31.492212
143
0.573058
false
bgaultier/laboitepro
boites/migrations/0009_pushbutton.py
1
1086
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-09-06 07:31 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('boites', '0008_auto_20170801_1406'), ] operations ...
agpl-3.0
1,413,793,480,327,889,000
40.769231
149
0.627993
false
jalabort/ijcv-2014-aam
aam/image/test/image_features_test.py
1
12108
import numpy as np from numpy.testing import assert_allclose import random import math from menpo.image import MaskedImage import menpo.io as mio def test_imagewindowiterator_hog_padding(): n_cases = 5 image_width = np.random.randint(50, 250, [n_cases, 1]) image_height = np.random.randint(50, 250, [n_cas...
bsd-2-clause
-4,259,554,534,044,738,600
47.432
79
0.553105
false
krother/maze_run
leftovers/part2_before_pylint.py
1
11490
# TODO: fix and check all command-line arguments from util import debug_print from pygame import image, Rect, Surface from pygame.locals import KEYDOWN, KEYUP, USEREVENT import pygame import sys import random import json import os from collections import namedtuple from functools import partial import argparse import...
mit
-7,573,846,476,509,047,000
29.15748
95
0.573716
false
neozerosv/ciberues
agente-servidor.py
1
2142
#!/usr/bin/env python # ------------------------------ # importacion # ------------------------------ import socket, sys, time, ConfigParser def poner_mensaje( tipo , mensaje ): # ----------------------------- # Colocar mensajes con formato # y marca de tiempo # ----------------------------- print time.strftime(...
gpl-2.0
6,846,871,219,183,194,000
31.953846
129
0.546218
false