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
xcoder123/KodiLatviesiem
plugin.video.filmaslatviski/network.py
1
4593
# -*- coding: utf-8 -*- import sys import urllib, urllib2, ssl, re import requests import httplib import urlparse import re UA = 'Mozilla/6.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.5) Gecko/2008092417 Firefox/3.0.3' def cleanHTML(raw_html): cleanr = re.compile('<.*?>') cleantext = re.sub(cleanr, '', raw_html...
gpl-3.0
-8,216,003,831,289,595,000
26.508982
132
0.644024
false
mozman/ezdxf
examples_dxf/create_mtext_column_examples.py
1
2961
# Copyright (c) 2021, Manfred Moitzi # License: MIT License import ezdxf from ezdxf import zoom from ezdxf.math import Vec3 from ezdxf.lldxf import const from ezdxf.tools.text_layout import lorem_ipsum def create_doc(filename: str, dxfversion: str): def add_mtext_columns(msp): insert = Vec3(0, 0, 0) ...
mit
-46,317,164,573,828,980
39.013514
79
0.631543
false
kiwiheretic/logos-v2
bibleapp/models.py
1
3007
from django.db import models DB_ROUTER={"bibles":('BibleTranslations', 'BibleBooks', 'BibleVerses', 'BibleConcordance', 'BibleDict', 'XRefs')} class BibleColours(models.Model): network = models.TextField() room = models.TextField() element = models.TextField() mir...
apache-2.0
6,952,629,051,345,176,000
30.989362
77
0.616229
false
akretion/ir_attachment_exchange
ir_attachment_metadata/__openerp__.py
1
1435
# -*- coding: utf-8 -*- ############################################################################### # # Module for OpenERP # Copyright (C) 2015 Akretion (http://www.akretion.com). # @author Valentin CHEMIERE <valentin.chemiere@akretion.com> # # This program is free software: you can redistribute it and/or m...
agpl-3.0
8,027,474,551,862,338,000
30.888889
79
0.616725
false
GrossfieldLab/loos
Packages/PyLOOS/renum-by-mol.py
1
1582
#!/usr/bin/env python3 """ Renumber a model so that the resids for each molecule start at 1 """ """ This file is part of LOOS. LOOS (Lightweight Object-Oriented Structure library) Copyright (c) 2016 Tod Romo, Grossfield Lab Department of Biochemistry and Biophysics School of Medicine & Dentistry, Universi...
gpl-3.0
8,267,078,855,940,090,000
27.25
77
0.709861
false
seman/cloud-weather-report
cloudweatherreport/run.py
1
13999
from __future__ import print_function import multiprocessing as mp import argparse from cStringIO import StringIO from datetime import datetime import logging import os import sys import traceback from copy import copy from pkg_resources import resource_string from bundletester import tester from cloudweatherreport ...
apache-2.0
3,704,018,672,796,776,400
40.41716
79
0.556468
false
ROCmSoftwarePlatform/Tensile
Tensile/Tests/unit/test_Configuration.py
1
21207
import ast from Tensile.Configuration import ReadWriteTransformDict from Tensile.Configuration import Parameter from Tensile.Configuration import CallableParameter from Tensile.Configuration import ExpressionEvaluator from Tensile.Configuration import ProjectConfig def test_ReadWriteTransformDict(): def readXForm(...
mit
-7,224,286,161,857,877,000
33.82266
108
0.619701
false
coaic/eb-deployment-boto-scripts
create_beanstalk_with_eb_api.py
1
12773
#!/usr/local/bin/python3 # # Create application and launch environment with dummy application running # import boto3 import time import webbrowser import argparse parser = argparse.ArgumentParser() parser.add_argument('region') parser.add_argument('vpcid') parser.add_argument('security_group') parser.add_argument('sub...
mit
-5,348,063,781,889,448,000
28.43318
198
0.613951
false
mvaled/sentry
src/sentry/south_migrations/0312_create_missing_emails.py
1
110908
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models from sentry.utils.query import RangeQuerySetWrapperWithProgressBar class Migration(DataMigration): def forwards(self, orm): db.commit_transact...
bsd-3-clause
7,830,268,031,218,054,000
35.797611
100
0.397474
false
cmajames/py_touhou
pytouhou/formats/t6rp.py
1
6321
# -*- encoding: utf-8 -*- ## ## Copyright (C) 2011 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published ## by the Free Software Foundation; version 3 only. ## ## This program is distri...
gpl-3.0
-6,476,166,564,893,812,000
30.447761
122
0.577757
false
rclmenezes/sqlalchemy
lib/sqlalchemy/schema.py
1
131047
# sqlalchemy/schema.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """The schema module provides the building blocks for database metadata. Each el...
mit
-6,112,658,784,394,598,000
36.282219
85
0.593802
false
FreeScienceCommunity/PLPlot
examples/python/x12.py
2
1201
#!/usr/bin/env python # # x12c.c # # Bar chart demo. import sys import os module_dir = "@MODULE_DIR@" if module_dir[0] == '@': module_dir = os.getcwd () sys.path.insert (0, module_dir) # main # # Does a simple bar chart, using color fill. If color fill is # unavailable, pattern fill is used instead (automatic). ...
lgpl-2.1
-6,948,795,662,705,207,000
18.063492
70
0.545379
false
ah-anssi/SecuML
SecuML/experiments/ActiveLearning/QueryStrategies/AladinExp.py
1
1133
# SecuML # Copyright (C) 2017 ANSSI # # SecuML 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 version. # # SecuML is distributed in the hope t...
gpl-2.0
4,381,602,460,878,328,000
36.766667
84
0.745808
false
tpsatish95/Universal-MultiDomain-Sentiment-Classifier
Thrift/server.py
1
2422
# -*- coding: utf-8 -*- # Author : Satish Palaniappan __author__ = "Satish Palaniappan" ''' Copyright 2015 Satish Palaniappan 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.o...
apache-2.0
-4,865,982,801,482,183,000
33.112676
208
0.732453
false
PaddlePaddle/Paddle
python/paddle/fluid/dygraph/dygraph_to_static/convert_call_func.py
1
9376
# Copyright (c) 2020 PaddlePaddle 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 appli...
apache-2.0
2,091,633,303,029,675,500
35.200772
136
0.600683
false
joaks1/PyMsBayes
pymsbayes/test/test_parsing.py
1
26215
#! /usr/bin/env python import unittest import os import sys import math from cStringIO import StringIO import pymsbayes from pymsbayes.test.support.pymsbayes_test_case import PyMsBayesTestCase from pymsbayes.test.support import package_paths from pymsbayes.workers import PosteriorWorker from pymsbayes.utils import pa...
gpl-3.0
834,428,385,231,129,700
42.330579
79
0.50597
false
pope/SublimeYetAnotherCodeSearch
settings.py
1
3377
import sublime import os.path def fix_path(path, project_dir=None): """Resolves absolute path: absolute path is reported as is resolve paths with user home (~) other relative paths resolved against project dir""" path = os.path.expanduser(path) if not os.path.isabs(path) and proje...
mit
9,089,648,303,568,716,000
36.522222
78
0.615931
false
bolkedebruin/airflow
tests/providers/google/cloud/operators/test_cloud_sql_system.py
1
2655
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
-7,100,946,580,129,036,000
46.410714
103
0.718267
false
zachtib/HouseholdQuests
quests/migrations/0001_initial.py
1
2110
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-03 22:06 from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True depen...
mit
-5,799,994,657,903,302,000
38.074074
145
0.597156
false
garthylou/Libreosteo
zipcode_lookup/management/commands/import_zipcodes.py
1
2394
import json from urllib.request import urlopen, URLError from django.core.management.base import BaseCommand, CommandError from ...models import ZipcodeMapping # https://www.data.gouv.fr/en/datasets/codes-postaux/ DEFAULT_JSON_URL = 'https://www.data.gouv.fr/en/datasets/r/34d4364c-22eb-4ac0-b179-7a1845ac033a' class...
gpl-3.0
4,344,133,023,219,369,000
34.731343
104
0.565163
false
AnneGilles/dexterity.product
setup.py
1
1049
# from setuptools import setup, find_packages import sys, os version = "1.0" shortdesc = "" longdesc = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() setup(name="agx.dexteritytemplate", version=version, description=shortdesc, long_description=longdesc, classifiers=[ ...
bsd-3-clause
8,680,315,032,631,773,000
23.395349
77
0.564347
false
clusterfudge/boomer
boomer/client/speech/listener.py
1
9335
# This file is part of Boomer Core. # # Boomer Core 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. # # Boomer Core is distributed in t...
gpl-3.0
-8,681,405,689,325,949,000
34.359848
90
0.6
false
1stop-st/jsonrpc-calculator
main.py
1
1146
from jsonrpc import JSONRPCResponseManager, dispatcher import frame dispatcher.add_method(frame.calculate, 'frame.calculate') def app(environ, start_response): if 'POST' != environ.get('REQUEST_METHOD'): if 'OPTIONS' == environ.get('REQUEST_METHOD'): start_response('200 OK', [ ...
mit
-6,257,496,709,001,948,000
41.444444
126
0.560209
false
Signbank/NGT-signbank
signbank/registration/urls.py
1
3693
""" URLConf for Django user registration. Recommended usage is to use a call to ``include()`` in your project's root URLConf to include this URLConf for any URL beginning with '/accounts/'. """ from django.conf.urls import * from django.urls import reverse_lazy from django.views.generic import TemplateView from djan...
bsd-3-clause
1,424,423,522,740,892,200
45.746835
108
0.503114
false
macosforge/ccs-calendarserver
txdav/common/datastore/common.py
1
1586
# -*- test-case-name: txdav -*- ## # Copyright (c) 2012-2017 Apple 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 # #...
apache-2.0
-1,552,729,446,302,939,600
28.37037
81
0.674653
false
f3at/feat
src/feat/database/query.py
1
24571
import decimal import inspect import time from zope.interface import implements, classProvides from feat.common import serialization, enum, first, defer, annotate, error from feat.common import container from feat.database.interface import IPlanBuilder, IQueryField, IQueryFactory from feat.database.interface import ...
gpl-2.0
-5,811,510,325,973,837,000
32.069987
79
0.568923
false
Rawash/parking-car-counter
skimage-Hog-CLFfromVideos.py
1
1866
import numpy as np import pickle import cv2 from skimage.feature import hog from skimage.transform import pyramid_gaussian print(cv2.__version__) windowSize = [120,120] stepSize = 60 def sliding_window(image, stepSize, windowSize): # slide a window across the image for x in range(0, image.shape[0], stepSize):...
mit
6,633,590,432,293,883,000
30.627119
134
0.610397
false
geometalab/pyGeoTile
tests/conftest.py
1
1406
import pytest ''' Chicago, IL LatLng: (41.85, -87.64999999999998) Zoom level: 19 World Coordinate: (65.67111111111113, 95.17492654697409) Pixel Coordinate: (34430575, 49899071) Tile Coordinate: (134494, 194918) ''' @pytest.fixture(scope="session", autouse=True) def chicago_latitude_longitude(): return 41.85, -87...
mit
5,025,962,805,753,271,000
22.433333
91
0.736842
false
wangshiphys/HamiltonianPy
HamiltonianPy/quantumoperator/matrixrepr.py
1
9096
""" Implementation of the algorithm for calculating the matrix representation of a Fermionic operator/term in occupation number representation. """ import numpy as np from numba import jit, int64, uint64 from scipy.sparse import csr_matrix from HamiltonianPy.quantumoperator.constant import CREATION __all__ = [ ...
gpl-3.0
2,622,375,520,283,315,000
36.432099
80
0.579925
false
modoboa/modoboa
modoboa/admin/models/base.py
1
2162
"""Base admin models.""" from django.contrib.contenttypes.fields import GenericRelation from django.db import models from django.utils import timezone from modoboa.core import models as core_models from modoboa.lib.permissions import ( grant_access_to_object, ungrant_access_to_object ) class AdminObjectManager(...
isc
349,020,989,349,496,700
28.616438
73
0.650786
false
Jamil/sabre_dev_studio
examples/cheapest_destinations.py
1
2424
''' Finds the cheapest fares filed to a given city Example: python cheapest-destinations.py YTO CA Result: FLL 165.62 MCO 165.62 JFK 172.36 LGA 191.12 ''' import datetime import json import sys sys.path.append('..') import sabre_dev_studio import sabre_dev_studio.sabre_exceptions as sabre_except...
mit
-4,755,766,842,573,069,000
27.186047
84
0.516502
false
lucastan/django-starter-box
djbase/models.py
1
6234
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ # for Python 2 & 3 compat from django.utils.six import with_metaclass from django.utils import six from . import forms # cPickle for speed try: import cPickle as pickle except ImportError...
mit
4,223,189,699,639,055,400
32.880435
90
0.646936
false
dismalpy/dismalpy
dismalpy/ssm/tests/test_tools.py
1
13177
""" Tests for tools Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np import pandas as pd from dismalpy.ssm import tools from statsmodels.tsa.api import acovf # from .results import results_sarimax from numpy.testing import ( asser...
bsd-2-clause
1,808,202,640,787,587,000
34.23262
96
0.535023
false
bsmr-eve/Pyfa
gui/builtinItemStatsViews/itemCompare.py
1
8648
# noinspection PyPackageRequirements import wx from .helpers import AutoListCtrl from service.price import Price as ServicePrice from service.market import Market from service.attribute import Attribute from gui.utils.numberFormatter import formatAmount class ItemCompare(wx.Panel): def __init__(self, parent, stu...
gpl-3.0
5,095,220,946,369,849,000
40.980583
131
0.566952
false
gangadhar-kadam/powapp
accounts/doctype/sales_invoice/sales_invoice.py
1
37240
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes import webnotes.defaults from webnotes.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, \ get_first_day, get_la...
agpl-3.0
5,381,097,011,979,427,000
36.314629
286
0.657035
false
GoogleCloudPlatform/solutions-cloud-orchestrate
api/orchestrateapi/commands/images/create.py
1
1929
# python3 # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
6,861,793,614,863,113,000
31.15
79
0.743909
false
valdecdev/odoo
addons/analytic/__openerp__.py
1
1619
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name' : 'Analytic Accounting', 'version': '1.1', 'author' : 'OpenERP SA', 'website' : 'https://www.odoo.com/page/accounting', 'category': 'Hidden/Dependency', 'depends' : ['base', 'decimal_prec...
agpl-3.0
-1,243,115,946,435,930,000
36.651163
78
0.636813
false
rbuffat/pyidf
tests/test_exteriorlights.py
1
1680
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.exterior_equipment import ExteriorLights log = logging.getLogger(__name__) class TestExteriorLights(unittest.TestCase): def setUp(self): self.fd, self.path = tempfi...
apache-2.0
-4,872,944,371,620,351,000
30.12963
92
0.655357
false
NYPDVisionZeroAccountability/compstat-vs-moving-violation-enforcement
tools/text2num.py
1
3919
# This library is a simple implementation of a function to convert textual # numbers written in English into their integer representations. # # This code is open source according to the MIT License as follows. # # Copyright (c) 2008 Greg Hewgill # # Permission is hereby granted, free of charge, to any person obtaining ...
apache-2.0
-5,403,188,165,344,453,000
28.689394
144
0.624394
false
ClaudioNahmad/Servicio-Social
Parametros/CosmoMC/CosmoMC-master/python/GetDistGUI.py
1
1231
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import sys import logging import getdist try: import argparse except ImportError: print('use "module load" to load python 2.7+, or see docs/readme_python.html for how to install') sys.exit() try: from g...
gpl-3.0
-8,061,934,203,258,364,000
29.02439
105
0.726239
false
aww/cs_practice
leetcode/decode_ways.py
1
1704
#!/usr/bin/env python import unittest class Solution: def __init__(self): self.twodig = set(map(lambda x: "%d" % x, range(10, 27))) self.onedig = set(map(lambda x: "%d" % x, range(1,10))) # @param s, a string # @return an integer def numDecodings(self, s): if len(s)==0: ...
apache-2.0
5,739,174,276,443,857,000
31.150943
67
0.502934
false
AlexKavourias/slackline
slack.py
1
5471
from slackclient import SlackClient from slack_screen import SlackTerminal import os import json import threading import time class SlackLine(object): _name_to_ids = None _ids_to_names = None _user_id = None _commands = ("lc", "sc", "exit", "quit", "is_online") def __init__(self, slack_name, ...
mit
-169,065,942,854,007,420
38.644928
105
0.593127
false
kappius/web2py_utils
web2py_utils/menu.py
1
2842
# # Copyright (C) 2009 Thadeus Burgess # # 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 distr...
gpl-3.0
4,889,956,848,034,862,000
26.326923
97
0.512667
false
oska874/raspberry
get_ip_send_email.py
1
2318
#!/usr/bin/python #-*-coding:utf8-*- __author__ = 'laixintao' import socket import fcntl import time import struct import smtplib import urllib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.image import MIMEImage import re import urllib2 # the e-mail config # thi...
mit
-7,240,020,109,966,365,000
23.145833
59
0.610009
false
agateau/yokadi
yokadi/tests/helptestcase.py
1
1726
# -*- coding: UTF-8 -*- """ Help test cases @author: Aurélien Gâteau <mail@agateau.com> @license: GPL v3 or later """ import os import sys import unittest from cmd import Cmd from contextlib import contextmanager from yokadi.core import db from yokadi.ycli.main import YokadiCmd @contextmanager def to_devnull(out): ...
gpl-3.0
-7,332,356,089,390,799,000
27.733333
77
0.585267
false
SamK/pynagios
pynagios/check.py
1
1975
#!/usr/bin/env python class Check: """ Will calculate and print the check result """ # the status codes status_codes = {'OK': 0, 'WARNING': 1, 'CRITICAL': 2, 'UNKNOWN': 3} # The same status sorted from worst to best status_order = ['CRITICAL', 'WARNING', 'UNKNOWN', 'OK'] #The list of the ...
mit
1,523,309,798,690,544,000
28.044118
80
0.566582
false
epheo/shaddock
shaddock/checks.py
1
4479
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2014 Thibaut Lapierre <root@epheo.eu>. 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 # # ...
apache-2.0
-5,982,405,037,692,937,000
37.612069
78
0.538067
false
sven1103/pibi-course
rosalind/long/main.py
1
3980
#!/usr/bin/python2.7 from __future__ import print_function from rosalind.utils.orf_utils import read_multi_fasta import argparse # Create the CLI cli_parser = argparse.ArgumentParser(description= 'Compute the Hamming distance matrix of ' 'given ...
gpl-3.0
-8,815,593,271,538,568,000
38.81
107
0.586181
false
davy39/eric
Project/NewPythonPackageDialog.py
1
1662
# -*- coding: utf-8 -*- # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a dialog to add a new Python package. """ from __future__ import unicode_literals from PyQt5.QtWidgets import QDialog, QDialogButtonBox from PyQt5.QtCore import pyqtSlot from .Ui_NewPythonPacka...
gpl-3.0
-4,034,412,619,558,682,000
28.157895
72
0.619134
false
Masood-M/yalih
mechanize/_testcase.py
2
4154
from __future__ import absolute_import import os import shutil import tempfile import unittest class SetupStack(object): def __init__(self): self._on_teardown = [] def add_teardown(self, teardown): self._on_teardown.append(teardown) def tear_down(self): for func in reversed(self....
apache-2.0
-8,596,310,614,707,668,000
29.101449
79
0.610014
false
michaelhkw/incubator-impala
tests/failure/test_failpoints.py
1
7338
# 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
-1,482,499,538,362,145,300
43.204819
90
0.695012
false
openstack/nomad
cyborg/accelerator/drivers/fpga/intel/sysinfo.py
1
4665
# Copyright 2018 Intel, 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 writing,...
apache-2.0
2,078,273,668,625,966,800
27.619632
76
0.591426
false
ryancoleman/traveldistance
src/tm3summarize.py
1
1792
#!/usr/bin/env python #summarize data in a tm3 file import tm3 import string import sys import statistics def summarizeOneFeature(tmDataList, columnName, intervals=50, outName="a.txt"): '''takes that column, makes a histogram for each structure''' outFile = open(outName, 'w') columnNum = tmDataList[0].titleToC...
gpl-2.0
1,415,430,397,039,921,400
33.461538
79
0.705915
false
TrentFranks/ssNMR-Topspin-Python
modules/Bak.July2013/SetupW.py
1
22203
""" Modules to Set default parameters: W.T. Franks FMP Berlin """ import de.bruker.nmr.mfw.root as root import math import os import sys import TopCmds import IntShape import CPDtools p90H=2.5 ampH=4.0 p90C=3.0 ampC=0.0 p90N=5.0 ampN=-2.0 MAS =10000.0 def dBtoW(dB): watts=math.pow(10,-dB/10.) #TopCmds.MSG("w...
mit
-4,134,814,152,606,690,300
29.624828
169
0.604963
false
zcoinofficial/zcoin
src/tor/scripts/maint/redox.py
1
7338
#!/usr/bin/python # # Copyright (c) 2008-2019, The Tor Project, Inc. # See LICENSE for licensing information. # # Hi! # I'm redox.py, the Tor redocumentation tool! # I am a horrible hack! # I read the output of doxygen from stderr, and add missing DOCDOC comments # to tell you where documentation should go! # To us...
mit
-1,511,183,339,948,589,300
31.469027
135
0.588035
false
KarlParkinson/412Project
src/tracker.py
1
7708
""" Modified camshift tracker from opencv sample """ import math import json import socket import cv CAM_WINDOW = "CamShiftTracker" HISTOGRAM_WINDOW = "Histogram" STOP_CRITERIA = (cv.CV_TERMCRIT_EPS | cv.CV_TERMCRIT_ITER, 10, 1) TARGET_ELLIPSE_COLOR = (255, 255, 0) CENTROID_COLOR = (255, 0, 0) def is_rect_nonzero(r):...
mit
3,815,445,395,101,629,000
37.733668
110
0.571484
false
MuffinMedic/CloudBot
plugins/minecraft_user.py
1
1961
import re import uuid import requests from cloudbot import hook HIST_API = "http://api.fishbans.com/history/{}" UUID_API = "http://api.goender.net/api/uuids/{}/" def get_name(uuid): # submit the profile request request = requests.get(UUID_API.format(uuid)) request.raise_for_status() data = request....
gpl-3.0
-4,586,829,106,227,990,000
30.126984
99
0.628251
false
conorsch/securedrop
molecule/testinfra/app-code/test_securedrop_app_code.py
1
3805
import pytest import testutils securedrop_test_vars = testutils.securedrop_test_vars testinfra_hosts = [securedrop_test_vars.app_hostname] python_version = securedrop_test_vars.python_version def test_apache_default_docroot_is_absent(host): """ Ensure that the default docroot for Apache, containing static ...
agpl-3.0
-3,738,630,439,913,632,300
35.941748
98
0.690407
false
hellrich/coling2016
python/compare_top1_over_models_by_frequency.py
1
1460
import gensim import sys import collections import codecs import re import math from copy import deepcopy bins = 100 def compare(models): words = {} counts = {} sim = {} rel = {} for i in range(len(models)): models[i] = gensim.models.Word2Vec.load_word2vec_format( models[i], b...
gpl-3.0
792,174,899,140,383,000
26.54717
140
0.617123
false
onshape-public/onshape-clients
python/onshape_client/oas/models/bt_view_data_info.py
1
5079
# coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 im...
mit
8,784,284,466,140,843,000
32.414474
79
0.569994
false
buscarini/meta
example_spec/platforms/swift_coredata/GlobalPlatform.py
1
2121
import os import json import sys import meta from meta.MetaProcessor import MetaProcessor class GlobalPlatform(MetaProcessor): """docstring for Preprocessor""" def __init__(self,config,stringUtils): super(GlobalPlatform, self).__init__(config, stringUtils) thisPath = os.path.realpa...
mit
3,497,337,897,452,519,400
31.646154
86
0.558699
false
britram/qof
pytools/qof_tcpopts.py
1
5248
import argparse import bz2 from sys import stdin, stdout, stderr import ipfix import qof import pandas as pd args = None def characteristic_present(df, flag): return ((df["qofTcpCharacteristics"] & flag) == flag) | \ ((df["reverseQofTcpCharacteristics"] & flag) == flag) def ecn_negotiated(df): ec...
gpl-2.0
63,505,606,524,413,700
37.881481
104
0.619665
false
jacknjzhou/neutron
neutron/tests/unit/api/test_extensions.py
1
34944
# Copyright (c) 2011 OpenStack Foundation. # 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...
apache-2.0
-7,130,091,252,125,298,000
40.06228
79
0.616844
false
TLemur/freq-bot
src/plugins/query/disco.py
1
2563
#!/usr/bin/env python # -*- coding: utf8 -*- #~####################################################################### #~ Copyright (c) 2008 Burdakov Daniel <kreved@kreved.org> # #~ # #~ This file is part of FreQ-bot. ...
gpl-3.0
1,910,563,791,328,330,000
43.189655
79
0.476395
false
eLRuLL/scrapy
scrapy/utils/engine.py
1
1355
"""Some debugging functions for working with the Scrapy engine""" # used in global tests code from time import time # noqa: F401 def get_engine_status(engine): """Return a report of the current engine status""" tests = [ "time()-engine.start_time", "engine.has_capacity()", "len(engin...
bsd-3-clause
4,057,573,841,147,418,600
27.229167
67
0.591144
false
kperun/nestml
pynestml/cocos/co_co_init_vars_with_odes_provided.py
1
3786
# # co_co_init_vars_with_odes_provided.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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
6,593,271,330,842,153,000
38.852632
109
0.642631
false
aaltinisik/OCBAltinkaya
addons/product/product.py
1
70029
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-2,923,583,481,406,589,400
49.562455
379
0.594825
false
OpenCanada/website
analytics/management/commands/update_page_analytics.py
1
3912
from __future__ import absolute_import, division, unicode_literals import datetime import os import sys from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand from django.db import transaction from django.utils.timezone import now f...
mit
8,961,741,343,606,666,000
29.80315
92
0.583333
false
Kray/qmdc
src/tracklistview.py
1
4206
class TrackListView(QTreeView): def __init__(self, parent): super(TrackListView, self).__init__(parent) self.setRootIsDecorated(False) self.setSortingEnabled(True) self.setAllColumnsShowFocus(True) self.setSelectionBehavior(QTreeView.SelectRows) #self....
gpl-3.0
-2,895,516,154,502,533,000
39.057143
148
0.558726
false
MahdiZareie/PyShop
product/migrations/0001_initial.py
1
1027
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Picture', fields=[ ('id', models.AutoField(prim...
mit
1,292,277,649,275,318,000
29.205882
114
0.526777
false
muxiaobai/CourseExercises
python/tensorflow/tensorflowbase/logisticClassification-diabetes.py
1
1666
#!/usr/bin/python # -*- coding: utf-8 -*- # 案例:是否得了糖尿病 import tensorflow as tf import numpy as np tf.set_random_seed(777) # for reproducibility xy = np.loadtxt('data-logisticClassificationdiabetes-diabetes.csv', delimiter=',', dtype=np.float32) x_data = xy[:, 0:-1] y_data = xy[:, [-1]] X = tf.placeholder(tf.float32,...
gpl-2.0
-353,991,877,810,684,100
29.734694
108
0.700531
false
hooliooo/python3-social-media-api-retriever
app.py
1
4002
from flask import Flask from flask_restful import Resource, Api # import json from facebook import facebook_json from instagram import instagram_json from twitter import twitter_json import requests_cache import os # from youtube import youtube_json # import pdb app = Flask(__name__) api = Api(app) requests_cache.i...
mit
4,721,026,097,362,952,000
23.857143
82
0.666417
false
zer0yu/ZEROScan
lib/core/convert.py
1
1260
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from lib.core.settings import IS_WIN, UNICODE_ENCODING def singleTimeWarnMessage(message): # Cross-linked function sys.stdout.write(message) sys.stdout.write("\n") sys.stdout.flush() def stdoutencode(data): retVal = None try: da...
mit
7,783,712,084,488,827,000
30.5
85
0.595238
false
theJollySin/pytextgame
pytextgame/ui.py
1
6368
# -- coding: utf-8 -- '''Simple UIs for Text Games in Python, built on pygame ''' import string import sys from pytextgame import screen from pytextgame.displays import Displays from pytextgame.actions import ActionKeys from pytextgame.window import Window, Windows from colors import WHITE if sys.version_info[0] < 3: ...
mit
7,162,272,413,126,270,000
30.84
91
0.577889
false
AleksanderLidtke/AnalyseScinetificArticles
DownloadArticles.py
1
38230
# -*- coding: utf-8 -*- """ Test downloading scientific articles' infomration from the web. Created on Sun Apr 19 20:46:55 2015 @author: alek """ import os, requests, re, difflib, time, numpy, subprocess, networkx, matplotlib.pyplot import nltk, string, sklearn.metrics, sklearn.cluster try: from selenium import ...
lgpl-3.0
-8,477,136,316,659,236,000
51.951524
290
0.639079
false
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/HButtonBox.py
1
7005
# encoding: utf-8 # module gtk._gtk # from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so # by generator 1.135 # no doc # imports import atk as __atk import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject from ButtonBox import ButtonBox class HButtonBox(ButtonBox): "...
gpl-2.0
6,013,262,387,118,644,000
37.701657
104
0.664954
false
emulbreh/shrubbery
shrubbery/polymorph/models.py
1
9774
from django.db import models, transaction from django.utils.importlib import import_module from shrubbery.conf import settings from shrubbery.db.managers import Manager from shrubbery.db.utils import get_sub_models, get_query_set, get_model, remove_join, forge_join from shrubbery.db.union import UnionQuerySet from shr...
mit
-6,236,834,543,948,433,000
34.802198
169
0.614897
false
drytoastman/scorekeeperbackend
common/sccommon/changelogs.py
1
4875
#!/usr/bin/env python3 import datetime import itertools import json import psycopg2 import psycopg2.extras import re import sys import time psycopg2.extras.register_uuid() psycopg2.extensions.register_adapter(dict, psycopg2.extras.Json) def print_log(table, action, otime, ltime, old, new, idfield): if action == ...
gpl-3.0
9,106,229,219,233,841,000
37.690476
164
0.567795
false
mramire8/active
experiment/anytimev2.py
1
13575
__author__ = 'maru' __copyright__ = "Copyright 2013, ML Lab" __version__ = "0.1" __status__ = "Development" import sys import os sys.path.append(os.path.abspath(".")) from experiment_utils import * import argparse from sklearn.datasets.base import Bunch from sklearn import linear_model import time from sklearn imp...
apache-2.0
-27,461,355,118,457,564
35.296791
135
0.528103
false
dhodges/sgfspider
tests/test_igokisen.py
1
1778
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import pdb import unittest from datetime import date from testing_utils import setupTestDB, fake_response_from_file from scrapy.http import Response, Request, HtmlResponse from sgfSpider.dbsgf import DBsgf, DBNewsItem from sgfSpider.spiders.igokis...
mit
8,311,244,726,089,681,000
31.327273
102
0.691226
false
fowie/PiCoolerControl
CoolerControl.py
1
4625
#/bin/python # Script will be run as a cron job every minute # Steps: # 1 - Obtain current state (read GPIO pins) # 2 - Read the schedule # 2a - Get the current position of the state machine # 3 - Determine if anything needs to happen on the schedule # 3a - Perform operations # - Determine if the pump was on recentl...
apache-2.0
9,062,713,403,212,197,000
30.462585
140
0.694919
false
jakelever/kindred
tests/test_utils.py
1
1774
import kindred import os import shutil import tempfile import hashlib class TempDir: def __init__(self): pass def __enter__(self): self.tempDir = tempfile.mkdtemp() return self.tempDir def __exit__(self, type, value, traceback): shutil.rmtree(self.tempDir) def test_loadBioNLP_findDir(): with TempDir() ...
mit
-6,767,766,425,493,751,000
29.067797
152
0.748591
false
glassnotes/Balthasar
src/balthasar/coarsewignerfunction.py
1
14961
#!/usr/bin/python # -*- coding: utf-8 -*- # # coarsewignerfunction.py: A class for Coarse-grained Wigner functions # # © 2016 Olivia Di Matteo (odimatte@uwaterloo.ca) # # This file is part of the project Balthasar. # Licensed under BSD-3-Clause # from itertools import product import numpy as np from pynitefields imp...
bsd-3-clause
-6,178,820,922,894,147,000
42.74269
103
0.544118
false
jeffcarter-github/MachineLearningLibrary
MachineLearningLibrary/Regression/LinearRegression.py
1
2075
import numpy as np from scipy.stats import kstest, norm class LinearRegression(object): '''Ordinary Least Squares...''' def __init__(self, X, y, fit_intercept=True): self.X = X self.y = y self.fit_intercept = fit_intercept self._coeff = None def fit(self, check_residuals=T...
mit
4,874,837,497,256,467,000
31.421875
85
0.54988
false
lakepay/lake
share/qt/extract_strings_qt.py
1
1851
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator import os import sys OUT_CPP="qt/lakestrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format...
mit
-4,923,338,201,270,589,000
22.730769
78
0.580227
false
morucci/pygerrit
pygerrit/__init__.py
1
4818
# The MIT License # # Copyright 2012 Sony Mobile Communications. All rights reserved. # # 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 r...
mit
1,186,567,472,564,510,700
34.688889
79
0.62308
false
brainwater/identitone
idt_site/settings.py
1
2005
""" Django settings for identitone project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
gpl-2.0
-8,730,750,947,671,568,000
23.156627
71
0.715212
false
horazont/aioxmpp
tests/test_testutils.py
1
33815
######################################################################## # File name: test_testutils.py # This file is part of: aioxmpp # # LICENSE # # 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 F...
lgpl-3.0
-4,439,955,328,372,459,500
27.559966
79
0.520331
false
cancro7/gem5
fault-instance-generator.py
1
3941
#!/usr/bin/env python import argparse from random import randint parser = argparse.ArgumentParser(description='Gem5 Fault Instance Generator') parser.add_argument('-b', '--btb-access-count', type=str, dest='bacFile', help='File containing BTB access references') parser.set_defaults(bacFile="m5ou...
bsd-3-clause
-1,088,697,293,508,398,000
34.1875
77
0.465618
false
DemocracyClub/yournextrepresentative
ynr/apps/parties/models.py
1
6389
from django.db import models from django.utils import timezone from django_extensions.db.models import TimeStampedModel from .managers import PartyQuerySet class Party(TimeStampedModel): """ A UK political party The canonical source of these parties is The Electoral Commission, with some exceptions....
agpl-3.0
590,743,517,109,042,200
31.93299
101
0.62232
false
zach-king/Python-Miscellaneous
Networking/chat_server.py
1
1693
import socket import select import sys sock_list = [] def chat_server(): global sock_list buff_size = 1024 s = socket.socket() s.bind(('127.0.0.1', 9000)) s.listen(5) print('Server started on port 9000') conn, addr = s.accept() sock_list.append(conn) while True: ...
gpl-2.0
-1,800,638,584,765,242,600
27.711864
95
0.468399
false
TwolDE2/enigma2
lib/python/Components/config.py
2
57619
from enigma import getPrevAsciiCode from Tools.NumericalTextInput import NumericalTextInput from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists from Components.Harddisk import harddiskmanager from copy import copy as copy_copy from os import path as os_path from time import localtime, strftime # Co...
gpl-2.0
-416,073,081,692,490,400
25.937354
195
0.664243
false
nesl/SensorActuatorManager
pkg/devices/PushDevice.py
1
5552
# Author: Mani Srivastava, NESL, UCLA # Created on: May 22, 2013 # # Copyright notice in LICENSE file # import sys import os import Queue import BaseDevice import time import json import cherrypy import iso8601 import logging from pkg.utils.debug import debug_mesg from pkg.utils.misc import json_convert_unicode_to_s...
bsd-3-clause
8,166,600,524,441,771,000
29.510989
167
0.657421
false
PyCQA/astroid
doc/conf.py
1
7862
# # Astroid documentation build configuration file, created by # sphinx-quickstart on Wed Jun 26 15:00:40 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 # autogenerated file. # # All configuration values ha...
lgpl-2.1
3,628,337,848,040,499,000
29.59144
80
0.694353
false
chiang831/LeHavre
src/game/resource_picker.py
1
1842
"""This module handles picking resource from available resource.""" from game import resource class ResourcePickerError(Exception): pass class ResourcePicker(object): def __init__(self): self._available = None self._picked_resource = resource.Resource() def SetAvailableResource(self, res): self._a...
gpl-2.0
2,077,889,943,885,185,800
27.338462
71
0.732899
false
ic-hep/DIRAC
Workflow/Modules/test/Test_Modules.py
1
28453
""" Unit Test of Workflow Modules """ import unittest import itertools import os import copy import shutil from mock import MagicMock as Mock from DIRAC import gLogger class ModulesTestCase( unittest.TestCase ): """ Base class for the Modules test cases """ def setUp( self ): gLogger.setLevel( 'ERROR' ) ...
gpl-3.0
-2,412,094,816,721,327,000
50.826958
142
0.540681
false
geoffkilpin/pombola
pombola/hansard/management/commands/hansard_reattribute_entries.py
1
3681
# This admin command is to save having to move Hansard Entries # individually in the admin console, which is not fun - or particularly # safe - when there are more than one or two of them from dateutil import parser import sys from django.conf import settings from django.contrib.contenttypes.models import ContentType...
agpl-3.0
8,819,104,886,562,429,000
41.802326
101
0.619397
false
testedminds/sand
sand/cytoscape/positions.py
1
1772
import csv def __positions_to_csv(positions, path): with open(path, 'w') as csvfile: writer = csv.writer(csvfile) writer.writerows(positions) def positions_to_csv(network, path): view = network.get_first_view() __positions_to_csv(view_to_positions(view), path) def view_to_positions(vie...
apache-2.0
2,434,277,917,504,964,600
32.433962
92
0.648984
false
woocoins/wooo
contrib/spendfrom/spendfrom.py
1
10053
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
mit
1,001,304,914,272,341,500
36.651685
111
0.619815
false
Juniper/contrail-provisioning
contrail_provisioning/common/keepalived_setup.py
1
5562
#!/usr/bin/python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import os import sys import argparse import netaddr import netifaces import ConfigParser import platform from fabric.api import local from contrail_provisioning.common.base import ContrailSetup from contrail_provisioning.compute.n...
apache-2.0
6,912,362,993,338,527,000
42.795276
107
0.531464
false