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
ben-e-whitney/mpi-tutorial
scripts/c.py
1
3280
import os class Macro: def __init__(self, name, value): self.name = name self.value = value def __str__(self): return '#define {nam} {val}'.format(nam=self.name, val=self.value) class Typedef: def __init__(self, type_specifier, declarator): self.type_specifier = type_speci...
gpl-3.0
19,194,634,387,759,416
29.091743
79
0.509756
false
3.895487
false
false
false
electric-cloud/EC-WebSphere
src/main/resources/project/wsadmin_scripts/stop_app.py
1
1413
# # Copyright 2015 Electric Cloud, 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 agree...
apache-2.0
3,546,637,956,825,736,700
29.06383
85
0.726822
false
3.757979
false
false
false
nirgal/ngw
core/views/messages.py
1
18534
''' Messages managing views ''' import email import json from datetime import date, timedelta from email.message import EmailMessage from email.utils import formatdate from importlib import import_module from django import forms from django.conf import settings from django.contrib import messages from django.contrib....
bsd-2-clause
4,930,909,412,600,218,000
34.437859
79
0.561886
false
4.330374
false
false
false
sdcharle/brat
app/forms.py
1
1692
from flask.ext.wtf import Form from wtforms import TextField, BooleanField, TextAreaField from wtforms.validators import Required, Length from models import User class PostForm(Form): post = TextField('post', validators = [Required()]) class LoginForm(Form): openid = TextField('openid', validators = [Required...
bsd-3-clause
-5,981,637,791,839,527,000
40.292683
136
0.654255
false
4.086957
false
false
false
bjornwallner/proq2-server
apps/modeller9v8/modlib/modeller/saxsdata.py
1
17392
"""Classes to handle SAXS (Small Angle X-ray Scattering) data""" import _modeller from modeller.util.modobject import modobject from modeller.util import modlist, array __docformat__ = "epytext en" class SAXSList(modlist.LinkList): """A list of L{saxsdata} objects""" def __init__(self, edat): self.__...
gpl-3.0
-8,359,119,961,480,063,000
43.824742
112
0.570607
false
3.068454
false
false
false
APC524/tsap
tsap/cluster.py
1
8181
import numpy as np from scipy.cluster.hierarchy import linkage, fcluster from scipy.spatial.distance import pdist, squareform import scipy.linalg as Linalg from scipy.stats import multivariate_normal as mvn class Cluster(object): def __init__(self, X): """Return a new object to cluster data based on sele...
gpl-3.0
5,548,100,727,968,990,000
35.199115
133
0.569124
false
3.961743
false
false
false
tensorflow/ranking
tensorflow_ranking/python/metrics.py
1
27729
# Copyright 2021 The TensorFlow Ranking 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 applicable law or ag...
apache-2.0
-822,287,671,420,614,300
40.20208
80
0.662664
false
3.942699
false
false
false
GiulioDenardi/constrained-kmeans
constrainedKMeans.py
1
7768
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import random as rand; import math; from sets import Set; import copy; import numpy as np; import itertools; ## mlCons / dlCons structure: [(instance, instance), ... (instance, instance)] ## instance / point structure: Set(attr1, attr2......
apache-2.0
-6,149,740,040,443,396,000
36.331731
117
0.565688
false
3.901508
false
false
false
all-of-us/raw-data-repository
tests/cron_job_tests/test_enrollment_status_checking.py
1
3062
from datetime import datetime, timedelta from rdr_service.participant_enums import EnrollmentStatus, PhysicalMeasurementsStatus, QuestionnaireStatus, \ SampleStatus from tests.helpers.unittest_base import BaseTestCase class CheckEnrollmentStatusTest(BaseTestCase): """Tests checking enrollment status of parti...
bsd-3-clause
-156,174,767,499,015,650
44.029412
111
0.684847
false
4.200274
true
false
false
pycroscopy/pycroscopy
pycroscopy/processing/histogram.py
1
3539
""" Utilities for building 2D histograms of spectroscopic data Created on Mar 1, 2016 @author: Chris Smith -- cmsith55@utk.edu """ from __future__ import division, print_function, absolute_import import numpy as np import sys if sys.version_info.major == 3 and sys.version_info.minor >= 6: disable_histogram = Tr...
mit
4,812,204,602,772,528,000
26.015267
118
0.598757
false
3.399616
false
false
false
fatty-arbuckle/crypto.challenges
set_1/challenge_5.py
1
1143
#! /usr/bin/python import string import sys INPUT="Burning 'em, if you ain't quick and nimble\nI go crazy when I hear a cymbal" XOR_STRING="ICE" EXPECT="0b3637272a2b2e63622c2e69692a23693a2a3c6324202d623d63343c2a26226324272765272a282b2f20430a652e2c652a3124333a653e2b2027630c692b20283165286326302e27282f" # hex string ge...
mit
4,259,251,163,925,024,000
24.4
157
0.745407
false
2.603645
false
false
false
Orange-OpenSource/vespa-core
vespa/agent_connections.py
1
3930
# -*- coding: utf-8 -*- # # Module name: agent_connections.py # Version: 1.0 # Created: 29/04/2014 by Aurélien Wailly <aurelien.wailly@orange.com> # # Copyright (C) 2010-2014 Orange # # This file is part of VESPA. # # VESPA is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
gpl-3.0
-2,598,357,917,571,393,500
27.889706
79
0.549758
false
4.140148
false
false
false
jerabaul29/python_huffman
test/test_example_build_tree.py
1
3381
from __future__ import print_function from bitarray import bitarray import pyhuffman.pyhuffman as pyhuffman """ A test case that can also be used as example, about how to build trees. """ def test_valid_dicts(): # example of data: frequencies in the alphabet for typical english text # this data is from: http...
mit
3,625,160,815,430,537,000
38.776471
127
0.371192
false
3.663055
false
false
false
hankcs/HanLP
hanlp/components/parsers/alg.py
1
29627
# MIT License # # Copyright (c) 2020 Yu Zhang # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pub...
apache-2.0
-5,404,664,505,970,615,000
37.931669
120
0.52972
false
3.163926
false
false
false
mafrosis/flask-security
flask_security/forms.py
1
9697
# -*- coding: utf-8 -*- """ flask_security.forms ~~~~~~~~~~~~~~~~~~~~ Flask-Security forms module :copyright: (c) 2012 by Matt Wright. :copyright: (c) 2017 by CERN. :license: MIT, see LICENSE for more details. """ import inspect from flask import Markup, current_app, flash, request from flas...
mit
-6,662,313,277,829,583,000
31.649832
79
0.64587
false
4.038734
false
false
false
mattsmart/biomodels
oncogenesis_dynamics/stability_diagram.py
1
14631
import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import LinearSegmentedColormap from os import sep from constants import PARAMS_ID, PARAMS_ID_INV, STATES_ID_INV, OUTPUT_DIR, Z_TO_COLOUR_BISTABLE_WIDE, Z_TO_COLOUR_ORIG from data_io import write_matrix_data_and_idx_vals, read_matrix_data_and_idx...
mit
-1,257,420,118,555,779,300
46.970492
155
0.623197
false
2.793775
false
false
false
bennymartinson/Oort
docs/quickstart/3_timing.py
1
3826
""" Quickstart guide 3: Timing""" from oort import * control_rate(15000) print_off() # Oort offers an alternative, wait-based approach to timing inspired by, # but departing from languages like ChucK and Common Music. Oort's schedule # module uses a system of threads and locks which reorganizes the operation # of...
gpl-3.0
-6,791,078,751,666,071,000
37.656566
77
0.7138
false
3.332753
false
false
false
tensorflow/ecosystem
distribution_strategy/tf_std_server.py
1
1269
# Copyright 2018 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
6,705,573,256,972,178,000
35.257143
80
0.700552
false
4.391003
false
false
false
COL-IU/XLSearch
library/filterByFDR.py
1
3141
def filterByFDR(tophits, cutoff): tophits = sorted(tophits, key = lambda x : x[4], reverse = True) intraCumCount = [] interCumCount = [] tardecCumCount = [] decdecCumCount = [] intraCount = 0 interCount = 0 tardecCount = 0 decdecCount = 0 xlType = [] for i in range(len(tophits)): pro1 = tophits[i][2][...
mit
-7,691,671,662,447,833,000
25.846154
136
0.596944
false
2.24197
false
false
false
cloudify-cosmo/cloudify-manager
rest-service/manager_rest/rest/resources_v3_1/filters.py
1
8528
from flask import request from cloudify.models_states import VisibilityState from manager_rest import manager_exceptions from manager_rest.security import SecuredResource from manager_rest.constants import RESERVED_PREFIX from manager_rest.utils import get_formatted_timestamp from manager_rest.rest import rest_decora...
apache-2.0
-4,878,345,227,776,293,000
38.299539
78
0.634615
false
4.153921
false
false
false
lamter/slaveo
scout/base.py
1
10394
# coding: utf-8 import logging import os import datetime as dt from collections import OrderedDict import pandas as pd import tushare as ts import numpy as np from mymath import * class BaseScout: """ 基础策略实例 1. 有监控标的本身,如股票,期货等,直接交易其标的自身 2. 有监控指数,则要交易其对应的证券 初始化 >>> setting = {"path": "scout...
gpl-3.0
-2,856,707,596,434,818,000
27.137072
113
0.531001
false
2.630169
false
false
false
XVMX/vmbot
vmbot/__main__.py
1
1292
# coding: utf-8 # Copyright (C) 2010 Arthur Furlan <afurlan@afurlan.org> # Copyright (c) 2013 Sascha J�ngling <sjuengling@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either ver...
gpl-3.0
5,210,573,513,656,405,000
32.076923
86
0.686822
false
3.534247
false
false
false
fritzo/distributions
setup.py
1
6121
# Copyright (c) 2014, Salesforce.com, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # - Redistributions of source code must retain the above copyright # notice, this list of conditions...
bsd-3-clause
7,079,599,730,979,026,000
27.872642
78
0.643196
false
3.665269
false
false
false
morta-code/YAX
yax/YAXReader.py
1
10807
import re import inspect from .condition import Condition import warnings __author__ = 'Móréh, Tamás' # Type of compiled regexes RE = type(re.compile("")) def element_to_string(element, encoding="unicode", method="xml", **kwargs): return YAXReader.etree.tostring(element, encoding=encoding, method=method, **kwa...
gpl-3.0
-1,334,978,849,130,943,200
36.741259
98
0.560311
false
4.115135
false
false
false
DataDog/integrations-core
tokumx/datadog_checks/tokumx/vendor/pymongo/thread_util.py
1
4017
# Copyright 2012-2015 MongoDB, 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 writin...
bsd-3-clause
4,264,808,422,550,712,300
29.664122
78
0.630819
false
4.12423
false
false
false
TeamSWAP/swap
src/overlays/raid_mechanics/tfb.py
1
2196
# # Copyright 2013 TeamSWAP # # 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, so...
apache-2.0
6,516,623,201,248,352,000
28.675676
140
0.623862
false
3.935484
false
false
false
noironetworks/apic-ml2-driver
apic_ml2/neutron/db/migration/alembic_migrations/versions/5d1c1f1d1282_rename_tenant_id.py
1
1198
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
8,279,858,757,475,654,000
30.526316
78
0.680301
false
3.533923
false
false
false
Urinx/Project_Euler_Answers
123.py
1
1544
#!/usr/bin/env python #coding:utf-8 """ Prime square remainders Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn−1)n + (pn+1)n is divided by pn2. For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25. The least value of n for which the remainder first exceeds 109 is 7037. Find...
gpl-2.0
641,334,964,325,962,500
23.460317
114
0.545455
false
2.996109
false
false
false
costadorione/purestream
servers/idowatch.py
1
2261
# -*- coding: utf-8 -*- #------------------------------------------------------------ # streamondemand - XBMC Plugin # Conector para idowatch # http://www.mimediacenter.info/foro/viewforum.php?f=36 #------------------------------------------------------------ import re from core import jsunpack from core import logge...
gpl-3.0
-2,722,581,283,899,343,000
35.451613
130
0.60531
false
3.318649
false
false
false
ak212/python-hockey-rss
retry_decorator.py
1
1529
from functools import wraps import time __author__ = "Aaron Koeppel" __version__ = 1.0 def retry(ExceptionToCheck, logger, tries=4, delay=3, backoff=2): """Retry calling the decorated function using an exponential backoff. http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/ origina...
mit
-6,569,519,518,677,940,000
30.854167
76
0.608895
false
4.023684
false
false
false
phac-nml/irida-miseq-uploader
API/directorymonitor.py
1
4383
import os import logging import time import threading from wx.lib.pubsub import pub from API.pubsub import send_message from API.directoryscanner import find_runs_in_directory toMonitor = True TIMEBETWEENMONITOR = 120 class DirectoryMonitorTopics(object): """Topics for monitoring directories for new runs.""" ...
apache-2.0
-3,668,619,201,657,861,000
34.346774
131
0.680356
false
4.162393
false
false
false
jamiebull1/transport-carbon
transport_carbon/make_db.py
1
1496
''' Created on 16 Jan 2014 @author: Jamie ''' import sqlite3 as lite import pandas import pandas.io.sql as pd_lite ''' Create the stations database ''' with lite.connect("./db/uk_stations.db") as con: cur = con.cursor() cur.execute("DROP TABLE IF EXISTS Stations") stations = pandas.read_csv('./tables...
mit
-5,008,361,842,240,347,000
33.790698
85
0.643048
false
3.604819
false
false
false
repotvsupertuga/tvsupertuga.repository
script.module.streamtvsupertuga/lib/resources/lib/sources/en_de/rapidmoviez.py
1
6433
# -*- coding: utf-8 -*- ''' This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in...
gpl-2.0
8,336,147,231,519,264,000
39.20625
161
0.524794
false
3.746651
false
false
false
openprocurement/openprocurement.auction
openprocurement/auction/tests/test_databridge.py
1
14374
# -*- coding: utf-8 -*- # TODO: test do_until_success function from gevent import monkey monkey.patch_all() import logging from mock import MagicMock, call import pytest from openprocurement.auction.databridge import AuctionsDataBridge from openprocurement.auction.utils import FeedItem from openprocurement.auction.tes...
apache-2.0
7,674,672,193,438,880,000
40.543353
133
0.60039
false
3.701777
true
false
false
david-wm-sanders/rwrtrack
rwrtrack/sum.py
1
5245
"""Provides functionality for calculating sums from statistics data.""" from sqlalchemy.sql import func, and_ from sqlalchemy.orm.query import Query from .db import sesh from .record import Record, RA, RB from .difference import Diff from .filter import filter_ from .constants import EARTH_EQUAT_CIRC class Sum: ...
mit
1,729,537,021,495,413,200
47.564815
112
0.691134
false
3.196222
false
false
false
googleapis/python-compute
google/cloud/compute_v1/services/global_operations/transports/base.py
1
7885
# -*- 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
-7,184,622,160,919,310,000
35.336406
103
0.636271
false
4.311099
false
false
false
Onirik79/aaritmud
data/proto_items/flora/_flora_item_mirtillo-rosso-01-frutto.py
1
14309
# -*- coding: utf-8 -*- #= DESCRIZIONE ================================================================= # SCRIPT CESTINATO (prototipo delle plants) # mirtilli rossi # semplice progetto d'ecosistema su mirtillo rosso # il DROP in locazioni opportune del seme di mirtillo rosso # origina una sequenza di callLater che ...
gpl-2.0
5,973,117,736,689,592,000
33.580097
124
0.66035
false
2.712681
false
false
false
jvce92/web-tdd
superlists/settings.py
1
2740
""" Django settings for superlists 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 pat...
gpl-3.0
1,074,121,401,098,659,500
25.346154
71
0.690146
false
3.477157
false
false
false
085astatine/togetter
togetter/webpage.py
1
2064
# -*- coding:utf-8 -*- import logging import pathlib from typing import Union import lxml.html import requests class WebPage: def __init__( self, url: str, session: requests.sessions.Session = None, params: dict = None, logger: logg...
mit
-6,903,450,613,005,605,000
29.352941
78
0.580426
false
4.496732
false
false
false
persandstrom/home-assistant
homeassistant/components/config/automation.py
3
1986
"""Provide configuration end points for Automations.""" import asyncio from collections import OrderedDict import uuid from homeassistant.const import CONF_ID from homeassistant.components.config import EditIdBasedConfigView from homeassistant.components.automation import ( PLATFORM_SCHEMA, DOMAIN, async_reload) i...
apache-2.0
4,748,439,277,051,262,000
33.241379
78
0.639476
false
4.207627
true
false
false
idosekely/python-lessons
lesson_5/server.py
1
1684
import socket import sys __author__ = 'sekely' class SimpleServer(object): def __init__(self, addr='localhost', port=50000, buf=1024): self.buf = buf self.server_address = (addr, port) print('setting up server up on %s port %s' % self.server_address) self._bind() def _bind(sel...
mit
4,789,459,424,898,749,000
29.071429
73
0.529097
false
4.526882
false
false
false
Mellthas/quodlibet
quodlibet/quodlibet/ext/events/trayicon/__init__.py
1
2461
# Copyright 2004-2006 Joe Wreschnig, Michael Urman, Iñigo Serna # 2012 Christoph Reiter # 2013 Nick Boultbee # # 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 ...
gpl-2.0
5,917,764,536,973,619,000
30.139241
74
0.657317
false
3.565217
false
false
false
moneymaker365/plugin.video.ustvvod
resources/lib/stations/pbskids.py
1
8311
#!/usr/bin/python # -*- coding: utf-8 -*- import common import connection import m3u8 import re import simplejson import sys import urllib import ustvpaths import xbmc import xbmcaddon import xbmcgui import xbmcplugin addon = xbmcaddon.Addon() pluginHandle = int (sys.argv[1]) SITE = "pbskids" NAME = "PBS Kids" DESCRI...
gpl-2.0
-609,971,110,751,474,700
34.669528
213
0.670316
false
2.936749
false
false
false
samstav/requests-chef
requests_chef/__about__.py
1
1183
# 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 the...
apache-2.0
4,353,036,945,659,839,500
32.8
74
0.664413
false
3.617737
false
false
false
m-weigand/ccd_tools
src/dd_single/characterisation/TooMuchTimeReg/plot.py
1
3707
#!/usr/bin/python from plot_settings import * import numpy as np import sip_formats.convert as SC def plot_specs(ax, result_dir, specs): # load data f = np.loadtxt(result_dir + '/frequencies.dat') response = np.loadtxt(result_dir + '/f.dat') data = np.loadtxt(result_dir + '/data.dat') data_format ...
gpl-3.0
-5,896,570,371,492,413,000
33.324074
79
0.580793
false
2.672675
false
false
false
LiamBao/Spiders
tmall&taobao/Tmall_Thread_Only(Keyword & Shop.py
1
23082
# -*- coding: utf-8 -*- # __author__ =='liam' import re import requests import math import time import datetime from lxml import etree import xlsxwriter as wx import random import os import json import ctypes import win32ui STD_INPUT_HANDLE = -10 STD_OUTPUT_HANDLE= -11 STD_ERROR_HANDLE = -12 FOREGROUND_BLACK...
gpl-3.0
-1,888,404,789,537,275,400
32.985141
625
0.559549
false
3.488181
false
false
false
BertrandBordage/django-cachalot
cachalot/api.py
1
5217
# coding: utf-8 from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.db import connections from django.utils.six import string_types from .cache import cachalot_caches from .settings import cachalot_settings from .signals import post_invalidation from .tra...
bsd-3-clause
-5,263,881,530,152,889,000
39.757813
79
0.672609
false
3.97032
false
false
false
vakaras/nmadb-session-reg
src/nmadb_session_reg/models/section_based.py
1
1388
from django.db import models from django.utils.translation import ugettext_lazy as _ class SessionGroup(models.Model): """ The session group. In most cases it will be section. """ title = models.CharField( max_length=80, verbose_name=_(u'title'), unique=True, ...
lgpl-3.0
-4,476,336,846,390,657,000
26.215686
66
0.575648
false
4.180723
false
false
false
LarsSchy/SMAC-M
chart-installation/cache_monitor/cache_monitor.py
1
1824
#!/usr/bin/python2 import os import argparse import subprocess import shutil import time def parse_arguments(): parser = argparse.ArgumentParser( prog="cache_monitor.py", description="This program monitors a directory and clears it if the size is above a certain limit") parser.add_argument("path", n...
mit
2,335,487,726,664,124,400
31.571429
185
0.612939
false
3.931034
false
false
false
spjmurray/openstack-sentinel
sentinel/api/controllers/image/v2/images.py
1
1414
# Copyright 2017 DataCentred Ltd # # 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 ag...
apache-2.0
8,207,387,003,058,586,000
31.136364
78
0.695898
false
3.938719
false
false
false
bgribble/mfp
mfp/gui/processor_element.py
1
6854
#! /usr/bin/env python ''' processor_element.py A patch element corresponding to a signal or control processor ''' from gi.repository import Clutter import cairo from .patch_element import PatchElement from .colordb import ColorDB from .modes.label_edit import LabelEditMode from ..gui_main import MFPGUI from mfp impor...
gpl-2.0
-4,675,372,229,137,122,000
29.061404
88
0.568573
false
3.507677
false
false
false
fcecin/infinitum
share/qt/extract_strings_qt.py
1
2538
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt stringdefs so that they can be picked up by Qt linguist. ''' from __future__ import division,print_function,unicode_literals from subprocess import Popen, PIPE import glob import operator import os import sys OUT_CPP="qt/infinitumstrings....
mit
-8,116,536,709,440,369,000
28.172414
108
0.613869
false
3.317647
false
false
false
srusskih/SublimeJEDI
dependencies/jedi/inference/gradual/typing.py
1
17752
""" We need to somehow work with the typing objects. Since the typing objects are pretty bare we need to add all the Jedi customizations to make them work as values. This file deals with all the typing.py cases. """ import itertools from jedi._compatibility import unicode from jedi import debug from jedi.inference.co...
mit
1,786,058,261,746,276,600
36.294118
99
0.603369
false
4.191736
false
false
false
ZeroCater/Eyrie
interface/migrations/0001_initial.py
1
1650
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-04-14 21:17 from __future__ import unicode_literals import django.contrib.auth.models from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('auth', ...
mit
629,217,487,608,357,400
31.352941
129
0.533939
false
4.520548
false
false
false
GFZ-Centre-for-Early-Warning/REM_RRVS
webapp/views.py
1
11255
''' --------------------------- views.py --------------------------- Created on 24.04.2015 Last modified on 15.01.2016 Author: Marc Wieland, Michael Haas Description: The main views file setting up the flask application layout, defining all routes ---- ''' import flask from webapp import app, db from models import ...
bsd-3-clause
3,528,388,904,670,477,000
41.794677
201
0.616526
false
3.725588
false
false
false
mivade/qCamera
viewer/ring_buffer_viewer.py
1
1959
"""Ring buffer viewer""" from qcamera.ring_buffer import RingBuffer from PyQt4 import QtGui from guiqwt.builder import make from ui_ring_buffer_viewer import Ui_RingBufferViewer from util import get_image_item, get_rect_item class RingBufferViewer(QtGui.QDialog, Ui_RingBufferViewer): def __init__(self, rbuffer, ...
bsd-2-clause
-6,084,053,276,708,281,000
32.220339
93
0.614599
false
3.710227
false
false
false
EduPepperPDTesting/pepper2013-testing
lms/djangoapps/reportlab/lib/abag.py
1
1171
#Copyright ReportLab Europe Ltd. 2000-2016 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/abag.py __version__='3.3.0' __doc__='''Data structure to hold a collection of attributes, used by styles.''' class ABag: """ 'Attrib...
agpl-3.0
7,076,339,163,037,442,000
30.527778
100
0.557643
false
3.261838
false
false
false
raony/pugpexxix
blackart.py
1
3057
# Hijacking third party libs # now things are going to get serious. # imagine you need to put some code inside a third party lib. Let's say # it is some logging feature so you can understand some wacky behavior. # you don't know where this will lead you, and you are exploring # alternatives to learn more about the c...
gpl-2.0
-2,859,481,613,356,873,000
31.870968
87
0.636572
false
3.904215
false
false
false
lebauce/artub
projectproperties.py
1
2568
# Glumol - An adventure game creator # Copyright (C) 1998-2008 Sylvain Baubeau & Alexis Contour # This file is part of Glumol. # Glumol 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 th...
gpl-2.0
1,089,999,112,614,734,500
39.761905
91
0.641745
false
3.58159
false
false
false
davidsoncolin/IMS
GCore/State.py
1
12941
#!/usr/bin/env python import IO def freeze(v): return str(IO.encode(v)) def thaw(s): ret,e = IO.decode(s); assert(e==len(s)); return ret g_state = {} g_dirty = set() # keys that have been modified from re import compile as re_compile g_reLastNum = re_compile(r'(?:[^\d]*(\d+)[^\d]*)+') g_undos,g_redos,g_undo = [],[]...
mit
7,403,516,768,357,741,000
30.640587
126
0.653582
false
2.793826
true
false
false
flask-restful/flask-restful
tests/test_accept.py
1
7700
import unittest from flask import Flask import flask_restful from werkzeug import exceptions class AcceptTestCase(unittest.TestCase): def test_accept_default_application_json(self): class Foo(flask_restful.Resource): def get(self): return "data" app = Flask(__name__...
bsd-3-clause
4,420,775,435,837,858,000
31.083333
119
0.574026
false
3.936605
true
false
false
Agnishom/agnishomsudoku
sudoku-solver.py
1
6193
#!/usr/bin/env python def initiate(): box.append([0, 1, 2, 9, 10, 11, 18, 19, 20]) box.append([3, 4, 5, 12, 13, 14, 21, 22, 23]) box.append([6, 7, 8, 15, 16, 17, 24, 25, 26]) box.append([27, 28, 29, 36, 37, 38, 45, 46, 47]) box.append([30, 31, 32, 39, 40, 41, 48, 49, 50]) box.append([33, ...
mit
6,588,004,776,784,848,000
36.949686
166
0.550783
false
3.06736
false
false
false
richbrowne/f5-cccl
f5_cccl/test/test_exceptions.py
1
3099
#!/usr/bin/env python # Copyright 2017 F5 Networks 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...
apache-2.0
1,642,826,834,951,448,000
27.431193
74
0.690223
false
3.747279
true
false
false
rr-/drill
drillsrs/cmd/list_tags.py
1
1333
import argparse from typing import Any import sqlalchemy as sa from drillsrs import db, util from drillsrs.cmd.command_base import CommandBase def _print_single_tag(session: Any, index: int, tag: db.Tag) -> None: tag_usages = ( session.query(sa.func.count(db.CardTag.tag_id)) .filter(db.CardTag.t...
mit
5,066,354,452,943,796,000
28.622222
77
0.581395
false
3.383249
false
false
false
xuleiboy1234/autoTitle
tensorflow/tensorflow/python/eager/tensor_node.py
1
8327
# 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...
mit
6,730,232,823,244,881,000
28.528369
86
0.68416
false
3.465252
false
false
false
kluge-iitk/Project-Euler
58_spiral_primes.py
1
1635
""" Problem 58: Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed. 37 36 35 34 33 32 31 38 17 16 15 14 13 30 39 18 5 4 3 12 29 40 19 6 1 2 11 28 41 20 7 8 9 10 27 42 21 22 23 24 25 26 43 44 45 46 47 48 49 It is interesting to note that the odd sq...
mit
5,847,286,381,652,083,000
26.677966
81
0.652786
false
3.128352
false
false
false
google/meterstick
confidence_interval_display_test.py
1
20694
# 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 writing, ...
apache-2.0
-4,961,730,074,671,474,000
38.417143
80
0.543346
false
3.387461
true
false
false
pythonsingapore/pythonsingapore
website/webapps/django/myproject/myproject/tests/mixins.py
1
3801
""" Generally useful mixins for tests of any project. This should be open sourced in the future, so it must be project agnostic. """ from django.core.urlresolvers import reverse from myproject.tests.factories import UserFactory class ViewTestsMixin(object): """Mixin that provides commonly tested assertions."""...
mit
4,344,034,524,574,619,000
33.87156
79
0.622205
false
4.069593
true
false
false
wbkang/rpi-repo
rpiweather/temppressure.py
1
3102
#!/usr/bin/env python3 import time import smbus2 as smbus import logging import threading from collections import deque from rpiweather.sampler import Sampler from rpiweather.data import insert_data from rpiweather import config import rpiweather.data import datetime import pytz logger = logging.getLogger(__name__) ...
mit
-1,262,101,671,438,950,400
27.458716
79
0.591554
false
2.631043
false
false
false
Flamacue/pretix
src/pretix/base/views/metrics.py
1
1363
import hmac from django.conf import settings from django.http import HttpResponse from .. import metrics def unauthed_response(): content = "<html><title>Forbidden</title><body>You are not authorized to view this page.</body></html>" response = HttpResponse(content, content_type="text/html") response["W...
apache-2.0
8,437,268,350,399,311,000
29.288889
107
0.682318
false
4.032544
false
false
false
Julian/home-assistant
homeassistant/components/binary_sensor/homematic.py
1
3515
""" Support for Homematic binary sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.homematic/ """ import logging from homeassistant.const import STATE_UNKNOWN from homeassistant.components.binary_sensor import BinarySensorDevice impor...
mit
-9,173,895,971,348,694,000
34.15
79
0.607397
false
4.302326
false
false
false
pyfarm/pyfarm-master
pyfarm/master/user_interface/jobgroups.py
1
11572
# No shebang line, this module is meant to be imported # # Copyright 2015 Ambient Entertainment GmbH & Co. KG # # 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/lice...
apache-2.0
526,505,934,287,155,460
48.033898
80
0.538714
false
3.81285
false
false
false
Swaraj1998/MyCode
ML-Workshop/day5/analysis3.py
1
1513
__author__ = 'Ashish' import pandas as pd import numpy as np import matplotlib.pyplot as plt pd.set_option('max_columns', 50) # pass in column names for each CSV u_cols = ['user_id', 'age', 'sex', 'occupation', 'zip_code'] users = pd.read_csv('Data\ml-100k\u.user', sep='|', names=u_cols) r_cols = ['user_id', 'movie_i...
mit
109,061,741,188,661,280
33.386364
84
0.658956
false
2.898467
false
false
false
ucarion/git-code-debt
tests/metrics/imports_test.py
1
2077
from __future__ import absolute_import from __future__ import unicode_literals import pytest from git_code_debt.file_diff_stat import FileDiffStat from git_code_debt.metric import Metric from git_code_debt.metrics.imports import CheetahTemplateImportCount from git_code_debt.metrics.imports import is_python_import fro...
mit
2,708,372,159,157,328,400
29.544118
68
0.64131
false
3.562607
true
false
false
radiasoft/radtrack
experimental/LSD_crash/pyqt_undoCommands.py
1
1895
from PyQt4.QtGui import QUndoCommand, QTreeWidgetItem # QUndoCommand for creating a new THING and adding it's name to the # QTreeWidget class LoadThings(QUndoCommand): def __init__(self, widget, thing): super(LoadThings, self).__init__() self.widget = widget self.createdThing = thing ...
apache-2.0
-3,442,286,966,883,006,500
35.442308
83
0.638522
false
3.637236
false
false
false
uber/pyro
pyro/contrib/gp/likelihoods/binary.py
1
1963
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import torch import pyro import pyro.distributions as dist from pyro.contrib.gp.likelihoods.likelihood import Likelihood class Binary(Likelihood): """ Implementation of Binary likelihood, which is used for binary classi...
apache-2.0
8,119,565,542,898,236,000
36.037736
98
0.62812
false
3.703774
false
false
false
flexpeace/btb
printing/print_mail.py
1
4166
import os import sys import glob import json from collections import defaultdict from utils import UnicodeReader, slugify, count_pages, combine_pdfs, parser import addresscleaner from click2mail import Click2MailBatch parser.add_argument("directory", help="Path to downloaded mail batch") def fix_lines(address): ...
agpl-3.0
2,824,114,001,440,336,400
31.546875
98
0.590494
false
3.864564
false
false
false
mdraeger/gmapcatcher
gmapcatcher/tilesRepo/tilesRepoRMaps.py
1
16125
## @package gmapcatcher.tilesRepo.tilesRepoRMaps # This module provides sqlite3 tile repository functions in the format # used by the RMaps android app. # # Usage: # # - constructor requires MapServ instance, because method # 'get_tile_from_coord' is provided in the MapServ # import os import gtk import sys import t...
gpl-2.0
3,090,410,139,767,253,500
33.235669
144
0.57631
false
3.693312
false
false
false
kbase/assembly
lib/assembly/plugins/discovar.py
1
1581
import glob import logging import os import subprocess from plugins import BaseAssembler from yapsy.IPlugin import IPlugin logger = logging.getLogger(__name__) class DiscovarAssembler(BaseAssembler, IPlugin): def run(self): """ Build the command and run. Return list of contig file(s) ...
mit
-849,724,596,757,140,000
30
163
0.55408
false
3.392704
false
false
false
linuxscout/arramooz
scripts/nouns/stardict.py
1
3461
#!/usr/bin/python2 # -*- coding=utf-8 -*- #************************************************************************ # $Id: generatenoundict.py,v 0.7 2011/03/26 01:10:00 Taha Zerrouki $ # # ------------ # Description: # ------------ # Copyright (c) 2011, Arabtechies, Arabeyes Taha Zerrouki # # This file is the main fi...
gpl-2.0
-9,102,461,087,602,533,000
33.049505
110
0.443734
false
3.833891
false
false
false
ActiveState/code
recipes/Python/578369_War_Game_Version_5/recipe-578369.py
1
7275
from random import randint, seed from time import time # region: change # from window import * from Zpaw import * from cards import * card_list = [card_0, card_1, card_2, card_3, card_4, card_5, card_6, card_7, card_8, card_9] # endregion def game(): print 'Welcome to WAR V5!' print asking = True while...
mit
-4,348,524,934,949,283,000
43.090909
119
0.485636
false
3.70229
false
false
false
RomainBrault/OVFM
Climate/climate2.py
1
7428
import numpy as np from sklearn import ensemble from sklearn import cross_validation from sklearn import metrics from sklearn import preprocessing from sklearn import linear_model import OVFM.Model as md import OVFM.FeatureMap as fm import OVFM.Risk as rsk import OVFM.LearningRate as lr import OVFM.DataGeneration as d...
mit
-1,827,408,120,212,465,400
38.094737
145
0.593296
false
2.418756
false
false
false
ContextLab/hypertools
hypertools/tools/df2mat.py
1
1267
#!/usr/bin/env python import pandas as pd def df2mat(data, return_labels=False): """ Transforms a Pandas DataFrame into a Numpy array with binarized text columns This function transforms single-level df to an array so it can be plotted with HyperTools. Additionally, it uses the Pandas.Dataframe.get...
mit
7,591,116,103,792,897,000
27.155556
80
0.665351
false
4.047923
false
false
false
sebatyler/django_tdd
django_tdd/settings.py
1
3108
""" Django settings for django_tdd project. Generated by 'django-admin startproject' using Django 1.11.6. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import...
mit
6,978,576,545,869,449,000
24.9
91
0.68758
false
3.507901
false
false
false
cargocult/rowan-python
rowan/controllers/base.py
1
2016
""" Some base classes for common styles of controller. """ import logging class LoggingMixin(object): """ We generally want to be able to log the behavior of controllers. This mixin makes a logging object available. """ @classmethod def get_logger(cls): if not hasattr(cls, "_logger"): ...
mit
1,128,868,552,093,589,100
26.616438
75
0.614583
false
4.71028
false
false
false
JamHsu/Pocketmap
script/crawler/model/tabelog.py
1
1390
import json from urlparse import urlparse class Restaurant(object): def __init__(self, data): self.url = data.get('@id', '') self.tabelog_id = self.parse_id_from_url(self.url) self.name = data.get('name', '').encode('utf8') self.img_url = data.get('image', '') geo = data.ge...
mit
4,636,327,346,200,734,000
31.348837
77
0.553957
false
3.638743
false
false
false
pietromarchesi/pidpy
setup.py
1
1173
try: from setuptools import setup except ImportError: from distutils.core import setup import numpy as np from distutils.extension import Extension def readme(): with open('README.md') as f: return f.read() setup(name='pidpy', version='0.1', description='Partial Information Decompo...
gpl-3.0
-1,308,581,805,493,007,000
25.681818
66
0.595908
false
4.072917
false
false
false
angr/angr
angr/storage/memory_mixins/paged_memory/pages/list_page.py
1
12194
# pylint:disable=abstract-method import logging from typing import Optional, List, Set, Tuple from sortedcontainers import SortedSet from . import PageBase from angr.storage.memory_object import SimMemoryObject from .cooperation import MemoryObjectMixin l = logging.getLogger(name=__name__) class ListPage(MemoryOb...
bsd-2-clause
-4,268,543,217,243,824,600
42.241135
174
0.542316
false
4.044444
false
false
false
pombredanne/PyGithub
github/Authorization.py
1
7655
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
-3,392,938,758,577,682,400
41.06044
205
0.55885
false
4.690564
false
false
false
andres-hurtado-lopez/naranjaverdeprod
app/functionality_access/__init__.py
1
3538
#!/usr/bin/env python # -*- coding: utf-8 -*- from bottle import template, redirect, request import utils, json from passlib.hash import bcrypt def GET(**params): table = utils.RenderTable(\ """SELECT * FROM users""",\ (),\ u""" <tr> <th><input type="checkbox"></th> <th>Usuario</th>...
mit
-3,747,365,128,313,200,000
25.601504
166
0.552289
false
3.117181
false
false
false
lorensen/VTKExamples
src/Python/Widgets/EmbedInPyQt.py
1
1287
#!/usr/bin/env python import sys import vtk from PyQt4 import QtGui from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor class MainWindow(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QMainWindow.__init__(self, parent) self.frame = QtGui.QFrame() self....
apache-2.0
2,054,659,394,894,716,700
22.833333
73
0.639472
false
3.698276
false
false
false
Passaudage/PLD
simulateur/jacky.py
1
5825
import GenerateurEntrees import Intersection import SimulationManager import Troncon import Coordonnees import Vehicule def charger_simulateur(): longueur_troncon = 5000 sm = SimulationManager.SimulationManager(5) gen_sud = GenerateurEntrees.GenerateurEntrees([[1 , 20]]) sm.add_listener(gen_sud) ...
mit
-3,497,025,016,034,291,000
34.090361
128
0.586266
false
2.335605
false
false
false
dennisss/sympy
sympy/core/evalf.py
1
47559
""" Adaptive numerical evaluation of SymPy expressions, using mpmath for mathematical functions. """ from __future__ import print_function, division import math import sympy.mpmath.libmp as libmp from sympy.mpmath import make_mpc, make_mpf, mp, mpc, mpf, nsum, quadts, quadosc from sympy.mpmath import inf as mpmath_in...
bsd-3-clause
528,281,993,822,744,960
32.421644
99
0.536449
false
3.546797
false
false
false
auduny/chains
lib/chains/common/cusb.py
1
4584
import usb.core import usb.util usb_iclass_map = { usb.CLASS_PER_INTERFACE: 'PerInterface', # 0 usb.CLASS_AUDIO: 'Audio', # 1 usb.CLASS_COMM: 'Comm', # 2 usb.CLASS_HID: 'HID', # 3 usb.CLASS_PRINTER: 'Printer', # 7 usb.CLASS_MASS_STORAGE: 'MassStorage', # 8 usb.CLASS_HUB: 'Hub', # 9 ...
gpl-2.0
-2,259,089,511,217,608,400
26.781818
85
0.52356
false
3.670136
false
false
false
sahat/Wappalyzer
drivers/python/wappalyzer.py
1
1417
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import PyV8 import urllib from urlparse import urlparse try: import json except ImportError: import simplejson as json class Wappalyzer(object): def __init__(self, url): self.file_dir = os.path.dirname(__file__) f = ope...
gpl-3.0
1,305,981,902,608,662,500
25.735849
135
0.568102
false
3.264977
false
false
false
ittner/sked
libsked/options.py
1
2982
# -*- coding: utf-8 -*- # Sked - a wikish scheduler with Python and PyGTK # (c) 2006-10 Alexandre Erwin Ittner <alexandre@ittner.com.br> # # 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; eithe...
gpl-2.0
-8,001,215,012,241,772,000
26.611111
70
0.560698
false
3.732165
false
false
false
Suwings/Yeinw
src/Suwings/security/oth_pxfilter.py
1
7109
# -*- coding: utf-8 -*- """ Python 富文本XSS过滤类 @package XssHtml @version 0.1 @link http://phith0n.github.io/python-xss-filter @since 20150407 @copyright (c) Phithon All Rights Reserved Based on native Python module HTMLParser purifier of HTML, To Clear all javascript in html You can use it in all python web framework Wr...
gpl-3.0
8,411,199,126,742,387,000
32.428571
107
0.529563
false
3.292214
false
false
false
felipenaselva/felipe.repository
script.module.universalscrapers/lib/universalscrapers/scraperplugins/housemovies.py
1
3241
import requests import re, base64 import xbmc from ..scraper import Scraper from ..common import clean_title,clean_search,random_agent class housemovie(Scraper): domains = ['https://housemovie.to/'] name = "Housemovies" sources = [] def __init__(self): self.base_link = 'https://housemovie.t...
gpl-2.0
5,268,606,886,261,176,000
53.016667
245
0.523604
false
4.236601
false
false
false
pylint-bot/astroid-unofficial
astroid/protocols.py
1
21725
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid 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 #...
gpl-2.0
8,057,490,289,828,611,000
36.328179
83
0.590012
false
4.221726
false
false
false
SaintAttila/attila
attila/processes.py
1
7909
""" Tools for controlling and interacting with Windows processes. """ import time import pywintypes import win32api import win32com.client import win32con from .utility import only from .exceptions import TooFewItemsError, verify_type, verify_callable __author__ = 'Aaron Hosford' __all__ = [ "process_exists...
mit
-3,496,954,635,227,142,000
30.50996
98
0.663801
false
4.055897
false
false
false