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
andrewbird/wader
core/contact.py
1
4899
# -*- coding: utf-8 -*- # Copyright (C) 2008-2009 Warp Networks, S.L. # Author: Pablo Martí # # 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 opt...
gpl-2.0
-4,741,642,807,645,253,000
33.251748
79
0.62107
false
3.972425
false
false
false
divio/askbot-devel
askbot/management/commands/fix_revisionless_posts.py
1
1535
"""this management commands will fix corrupted posts that do not have revisions by creating a fake initial revision based on the content stored in the post itself """ from django.core.management.base import NoArgsCommand from django.db.models import signals, Count from askbot import models from askbot import const def...
gpl-3.0
-7,073,818,593,907,466,000
35.547619
78
0.585668
false
4.54142
false
false
false
Forage/Gramps
gramps/webapp/grampsdb/views.py
1
63123
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Douglas S. Blank <doug.blank@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 version 2 of the L...
gpl-2.0
-8,317,743,001,590,288,000
40.858753
135
0.507866
false
4.330018
false
false
false
legoktm/pywikipedia-scripts
fa_bot.py
1
8724
#!/usr/bin/env python from __future__ import unicode_literals import datetime import mwparserfromhell import pywikibot import re site = pywikibot.Site('en', 'wikipedia') GA_SUBPAGES = ['Agriculture, food and drink', 'Art and architecture', 'Engineering and technology', 'Geography and places', 'History...
mit
-2,991,678,182,104,832,000
41.975369
136
0.580124
false
3.635
false
false
false
mhrivnak/python-semanticversion
setup.py
1
1895
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2013 Raphaël Barrois import os import re import sys from setuptools import setup root_dir = os.path.abspath(os.path.dirname(__file__)) def get_version(package_name): version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$") package_c...
bsd-2-clause
5,534,795,490,026,703,000
31.084746
71
0.612256
false
3.793587
false
false
false
Moguri/ullur
src/scripts/attack_manager.py
1
9496
# Copyright 2013 Daniel Stokes, Mitchell Stokes # # 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 ...
apache-2.0
7,831,219,333,449,191,000
29.050633
139
0.709983
false
3.293791
false
false
false
vertigo235/Sick-Beard-XEM
sickbeard/tvtumbler.py
1
1380
''' Created on Aug 26, 2013 Wrappers around tvtumbler access. @author: dermot@buckley.ie ''' import time from sickbeard import helpers from sickbeard import logger try: import json except ImportError: from lib import simplejson as json UPDATE_INTERVAL = 432000 # 5 days SHOW_LOOKUP_URL = 'http://show-api.t...
gpl-3.0
-8,656,769,210,096,295,000
28.361702
96
0.64058
false
3.699732
false
false
false
EdLogan18/logan-repository
plugin.video.exodus/resources/lib/sources/tunemovie_mv.py
1
4348
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
gpl-2.0
4,080,782,292,295,762,400
34.639344
189
0.533349
false
3.899552
false
false
false
astrobayes/BMAD
chapter_6/code_6.25.py
1
2480
# From: Bayesian Models for Astrophysical Data, Cambridge Univ. Press # (c) 2017, Joseph M. Hilbe, Rafael S. de Souza and Emille E. O. Ishida # # you are kindly asked to include the complete citation if you used this # material in a publication # Code 6.25 - Zero-truncated negative binomial model in Python using S...
gpl-3.0
8,588,875,585,503,170,000
25.105263
78
0.566129
false
3.167305
false
false
false
xDeda/tactcat.py
drawingapp.py
1
5276
from tkinter import * import pyautogui import math draw = [] fromx = 0 fromy = 0 tox = 0 toy = 0 phase = 1 togglevar = 0 def callback(e): global fromx, fromy, tox, toy, phase, infox, infoy pos = [0, 1] pos[0] = master.winfo_pointerx() pos[1] = master.winfo_pointery() infox, infoy = click() if (phase == 0): ...
mit
3,088,950,010,462,635,000
22.873303
113
0.658832
false
2.553727
true
false
false
stefanoteso/musm-adt17
adt17.py
1
9489
#!/usr/bin/env python3.5 import sys import os import logging import numpy as np import musm from sklearn.utils import check_random_state from textwrap import dedent _LOG = musm.get_logger('adt17') PROBLEMS = { 'synthetic': musm.Synthetic, 'pc': musm.PC, } USERS = { 'noiseless': musm.NoiselessUser, ...
mit
6,166,764,988,512,294,000
34.406716
89
0.547476
false
4.008872
false
false
false
pcmanus/ccm
ccmlib/common.py
1
34212
# # Cassandra Cluster Management lib # from __future__ import absolute_import import copy import fnmatch import logging import os import platform import re import shutil import signal import socket import stat import subprocess import sys import time from distutils.version import LooseVersion #pylint: disable=import...
apache-2.0
8,092,441,482,355,559,000
35.985946
175
0.614755
false
3.569699
true
false
false
BeyondTheClouds/nova
nova/db/discovery/api.py
1
253919
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file...
apache-2.0
2,467,734,757,161,626,000
34.935324
195
0.609651
false
3.985544
false
false
false
TellinaTool/awesome_nmt
encoder_decoder/seq2seq/rnn_decoder.py
1
15532
""" RNN-based decoders. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from encoder_decoder import decoder, data_utils, graph_utils, rnn class RNNDecoder(decoder.Decoder): def __init__(self, hyperparame...
gpl-3.0
-156,950,947,882,189,980
50.260726
116
0.483196
false
4.476081
false
false
false
fsalmoir/EZyRB
tests/test_vtkhandler.py
1
5854
from unittest import TestCase import unittest import ezyrb.vtkhandler as vh import numpy as np import filecmp import os class TestVtkHandler(TestCase): def test_vtk_instantiation(self): vtk_handler = vh.VtkHandler() def test_vtk_default_infile_member(self): vtk_handler = vh.VtkHandler() assert vtk_handl...
mit
7,400,576,381,474,663,000
30.473118
93
0.709771
false
2.710185
true
false
false
timlinux/inasafe
safe/gis/vector/prepare_vector_layer.py
1
16942
# coding=utf-8 """Prepare layers for InaSAFE.""" import logging from PyQt4.QtCore import QPyNullVariant from qgis.core import ( QgsField, QgsFeatureRequest, QGis, QgsExpressionContext, QgsExpression ) from safe.common.exceptions import ( InvalidKeywordsForProcessingAlgorithm) from safe.defin...
gpl-3.0
-3,798,770,344,162,614,000
32.749004
79
0.632334
false
4.137241
false
false
false
chromium/chromium
tools/privacy_budget/blink_apis/blink_api_proto.py
6
10613
# Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function from v8_utilities import capitalize from google.protobuf.text_format import MessageToString import web_idl import blin...
bsd-3-clause
-5,837,196,703,785,977,000
41.282869
79
0.620089
false
4.275987
false
false
false
rsling/cow
src/corex/corex_basic.py
1
14500
# -*- coding: utf-8 -*- # Get elemenatry features from COW-DOM. import os.path import sys import glob import re from lxml import etree as ET # Just for rounding. StringHandler etc. maybe? class FloatHandler: def __init__(self, digits): self.digits = digits def act(self, d): return str(round...
bsd-2-clause
2,654,311,583,169,194,000
38.243902
918
0.592846
false
2.587741
false
false
false
sbarnabas/gowhere
magic.py
1
6640
#!/usr/bin/env python # coding: utf-8 from datetime import datetime from HTMLParser import HTMLParser import argparse import json import os import sys import urllib2 ############################################################################### # Options #############################################################...
mit
-1,313,950,203,779,619,600
33.583333
85
0.525151
false
3.792119
false
false
false
nkmk/python-snippets
notebook/feedparser_example.py
1
17786
import feedparser import pprint import time print(feedparser.__version__) # 5.2.1 d_atom = feedparser.parse('http://gihyo.jp/feed/atom') print(type(d_atom)) # <class 'feedparser.FeedParserDict'> pprint.pprint(d_atom, depth=1) # {'bozo': 0, # 'encoding': 'UTF-8', # 'entries': [...], # 'feed': {...}, # 'headers':...
mit
-1,421,063,402,178,534,700
39.049231
144
0.64536
false
1.536718
false
false
false
rukayaj/eia
core/migrations/0003_auto_20160205_1051.py
1
3028
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import core.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('core', '0002_auto_2016...
gpl-2.0
-7,470,328,502,815,166,000
36.382716
126
0.55251
false
4.67284
false
false
false
elfmz/far2l
python/configs/plug/plugins/upanel.py
1
3472
import os import logging from far2l.plugin import PluginVFS log = logging.getLogger(__name__) class Screen: def __init__(self, parent): self.parent = parent self.hScreen = None def __enter__(self): self.hScreen = self.parent.info.SaveScreen(0,0,-1,-1) def __exit__(self, *args):...
gpl-2.0
6,142,778,009,898,682,000
33.376238
85
0.590438
false
3.357834
false
false
false
littleweaver/django-zenaida
zenaida/contrib/hints/templatetags/hints.py
1
4054
from django import template from django.core.urlresolvers import reverse, NoReverseMatch from zenaida.contrib import hints from zenaida.contrib.hints.models import Dismissed from zenaida.contrib.hints.forms import DismissHintForm register = template.Library() @register.tag("hint") def hint(parser, token): """ ...
bsd-3-clause
8,631,350,533,585,729,000
35.854545
139
0.532067
false
4.529609
false
false
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/vlans/vlan/members/member/interface_ref/state/__init__.py
1
9178
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
-9,067,072,770,732,377,000
37.241667
329
0.596099
false
4.272812
true
false
false
MattDevo/edk2
BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/dec.py
1
9287
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # distribution. The full text of the license may be found at # http://open...
bsd-2-clause
-6,716,872,132,618,789,000
27.112853
99
0.576612
false
3.951915
false
false
false
yamahata/python-tackerclient
tackerclient/v1_0/client.py
1
16159
# Copyright 2012 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 requ...
apache-2.0
-3,739,107,755,041,018,000
38.316302
79
0.604679
false
4.34265
false
false
false
mclarkson/obdi-saltconfigserver
scripts/update_gitfs_cache.py
1
1711
#!/bin/env python # # Obdi - a REST interface and GUI for deploying software # Copyright (C) 2014 Mark Clarkson # # 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...
gpl-3.0
-122,485,219,555,617,860
27.516667
71
0.675628
false
3.579498
false
false
false
ant31/kpm
kpm/formats/kub_base.py
1
7117
import io import tempfile import json from urlparse import urlparse import copy import tarfile import shutil import logging import os.path import yaml from cnrclient.discovery import ishosted, split_package_name import kpm.registry as registry import kpm.packager as packager from kpm.utils import mkdir_p from kpm.uti...
apache-2.0
-9,166,837,297,015,897,000
30.772321
99
0.537727
false
4.606472
false
false
false
rtrwalker/geotecha
tools/delete_files_ending_in_tilde.py
1
3900
# geotecha - A software suite for geotechncial engineering # Copyright (C) 2018 Rohan T. Walker (rtrwalker@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 version 3 of the L...
gpl-3.0
8,885,603,661,803,638,000
36.509615
104
0.601538
false
4.166667
false
false
false
SymbiFlow/prjuray
fuzzers/002-tilegrid/clem_r/top.py
1
1815
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The Project U-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import os import random random.seed(int(o...
isc
8,936,989,087,958,077,000
24.56338
98
0.519559
false
3.134715
false
false
false
patrickbwarren/SunlightHNC
gw_p_compare.py
1
2321
#!/usr/bin/env python3 # This file is part of SunlightDPD - a home for open source software # related to the dissipative particle dynamics (DPD) simulation # method. # Based on an original code copyright (c) 2007 Lucian Anton. # Modifications copyright (c) 2008, 2009 Andrey Vlasov. # Additional modifications copyri...
gpl-2.0
-3,540,673,232,949,221,000
30.364865
70
0.672124
false
2.816748
false
false
false
hellsgate1001/graphs
hack_plot/api/serializers.py
1
1248
from rest_framework import serializers from ..models import SshHackIP, SshHackLocation class HackIpSerializer(serializers.ModelSerializer): attempts = serializers.SerializerMethodField() def get_attempts(self, obj): return [ { 'id': x.id, 'attempted': x.at...
mit
-5,571,386,398,493,157,000
24.469388
80
0.524038
false
4.28866
false
false
false
jaromrax/vme
02_gregory/scripts/counter_test/mmap_startstop.py
1
2145
#!/usr/bin/python3 import mmap import contextlib import time import mmap def getMM(): with open(".mmap.1.vme", "r+b") as f: mm = mmap.mmap(f.fileno(), 0)# memory-map the file,size 0= whole qqqqq= mm.readline() return mm print("I can watch mmapfile now:") mystatus='stop' mystatus='====' mm=get...
gpl-2.0
-3,886,287,125,998,798,300
27.223684
79
0.468531
false
3.66041
false
false
false
nerdvegas/rez
src/rez/cli/yaml2py.py
1
1656
""" Print a package.yaml file in package.py format. """ from __future__ import print_function def setup_parser(parser, completions=False): parser.add_argument( "PATH", type=str, nargs='?', help="path to yaml to convert, or directory to search for package.yaml;" " cwd if not provided") de...
lgpl-3.0
-8,332,321,005,046,832,000
30.846154
80
0.705314
false
3.990361
false
false
false
eren/bugspy
bugspy/bugparser.py
1
6695
#!/usr/bin/python # -*- coding: utf-8 -*- import piksemel from bugspy.error import ParseError, BugzillaError from bugspy.constants import Constants as constants class BugStruct(object): """A container which can be accessed like class objects f = BugStruct(foo="bar", baz="heh", bug=BugStruct("id": 1)) f.s...
gpl-2.0
6,014,441,359,802,927,000
31.028708
151
0.536002
false
4.358073
false
false
false
StevenCHowell/code_sas_modeling
sas_modeling/geometric.py
1
13131
#!/usr/bin/env python # coding:utf-8 ''' Author: Steven C. Howell --<steven.howell@nist.gov> Purpose: definiton of geometric shapes and their scattering Created: 02/03/2017 00000000011111111112222222222333333333344444444445555555555666666666677777777778 1234567890123456789012345678901234567890123456789012...
gpl-3.0
-6,022,846,960,485,903,000
30.489209
96
0.529586
false
3.23344
false
false
false
akittas/geocoder
geocoder/arcgis_reverse.py
1
2489
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.arcgis import Arcgis from geocoder.location import Location class ArcgisReverse(Arcgis): """ ArcGIS REST API ======================= The World Geocoding Service finds addresses and places in all supported countries ...
mit
-2,753,164,750,829,711,400
26.655556
103
0.609883
false
3.944532
false
false
false
benrudolph/commcare-hq
corehq/apps/userreports/reports/factory.py
1
4971
import json from jsonobject.exceptions import BadValueError from corehq.apps.reports_core.filters import DatespanFilter, ChoiceListFilter, Choice, DynamicChoiceListFilter, \ NumericFilter from corehq.apps.userreports.exceptions import BadSpecError from django.utils.translation import ugettext as _ from corehq.apps....
bsd-3-clause
-3,618,213,141,510,659,600
32.362416
113
0.622209
false
4.054649
false
false
false
jarretluft/bCNC
CNCPendant.py
1
5324
# -*- coding: latin1 -*- # $Id: CNCPendant.py,v 1.3 2014/10/15 15:04:48 bnv Exp bnv $ # # Author: Vasilis.Vlachoudis@cern.ch # Date: 06-Oct-2014 __author__ = "Vasilis Vlachoudis" __email__ = "Vasilis.Vlachoudis@cern.ch" import os import sys #import cgi import json import threading import urllib from websocket_server...
gpl-2.0
-7,774,686,962,426,335,000
26.163265
117
0.583208
false
3.493438
false
false
false
zyndagj/ZED-bsmap-align
zed-align.py
1
15337
#!/usr/bin/env python from math import ceil import os import sys import argparse import multiprocessing import subprocess as sp import re #from pprint import pprint from array import array from yaml import load, dump contexts = ('CG','CHG','CHH') def main(): fCheck = fileCheck() #class for checking parameters pars...
bsd-3-clause
-5,348,734,016,164,579,000
42.571023
207
0.573385
false
3.232926
true
false
false
elbeardmorez/quodlibet
quodlibet/quodlibet/ext/songsmenu/html.py
1
2241
# -*- coding: utf-8 -*- # Copyright 2005 Eduardo Gonzalez # # 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 version. from quodli...
gpl-2.0
-609,721,440,372,669,300
27.0125
70
0.606872
false
3.138655
false
false
false
CmWork/RegressionReport
models/db.py
1
6228
# -*- coding: utf-8 -*- ######################################################################### ## This scaffolding model makes your app work on Google App Engine too ## File is released under public domain and you can use without limitations ######################################################################### ...
gpl-2.0
9,043,120,127,899,749,000
45.827068
258
0.615125
false
4.023256
true
false
false
nce/sedater
sedater/plotter/main.py
1
1499
# ./sedater/plotter/main.py # Author: Ulli Goschler <ulligoschler@gmail.com> # Modified: Thu, 10.12.2015 - 20:25:10 import sys,os sys.path.insert(0, os.getcwd()) import re from sedater.plotter.options import CLIParser from sedater.plotter.plotter import Plotter if __name__ == "__main__": cli = CLIParser() ...
mit
8,716,604,688,822,519,000
30.893617
80
0.615077
false
3.83376
false
false
false
zerthimon/archive_whisper_store
archive_whisper_store.py
1
3320
#!/usr/bin/env python # -*- coding: utf-8 -*- # # archive_whisper_store.py: Backup Whisper Store to a Gzipped Tar Archive. # # Author: Lior Goikhburg <goikhburg at gmail.com> # # Set the 'WHISPER_LOCK_WRITES = True' parameter in carbon.conf for consistent backups import argparse import fcntl import tarfile import logg...
gpl-2.0
339,008,337,865,672,770
32.877551
104
0.625904
false
3.531915
false
false
false
jtriley/s3site
s3site/static.py
1
2179
""" Module for storing static data structures """ import os import sys VERSION = 0.9999 PID = os.getpid() S3SITE_CFG_DIR = os.path.join(os.path.expanduser('~'), '.s3site') S3SITE_CFG_FILE = os.path.join(S3SITE_CFG_DIR, 'config') S3SITE_LOG_DIR = os.path.join(S3SITE_CFG_DIR, 'logs') S3SITE_META_FILE = '__s3site.cfg' ...
gpl-3.0
8,637,566,825,480,623,000
32.523077
75
0.605782
false
2.878468
false
false
false
eahrold/Crypt-Server
server/migrations/0001_initial.py
1
1392
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Computer' db.create_table('server_computer', ( ('id', self.gf('django.db.models....
apache-2.0
-6,627,562,643,909,896,000
37.694444
109
0.588362
false
3.741935
false
false
false
amas0/patools
patools/dataset.py
1
12952
import pandas as pd import patools.trial as tr import os import numpy as np from collections import OrderedDict class Dataset: def __init__(self, directory=os.getcwd(), nbs=False): self.trials = self.loadDataset(directory, nbs=nbs) self.df = pd.DataFrame(index=self.trials.keys()) self._get...
mit
8,661,511,466,148,958,000
39.475
82
0.51189
false
3.74877
false
false
false
qwcode/pip
pip/locations.py
1
5528
"""Locations where we look for configs, install stuff, etc""" import sys import site import os import tempfile from distutils.command.install import install, SCHEME_KEYS import getpass from pip.backwardcompat import get_python_lib import pip.exceptions DELETE_MARKER_MESSAGE = '''\ This file is placed here by pip to ...
mit
6,825,077,443,133,603,000
34.664516
94
0.6411
false
3.668215
false
false
false
DannyArends/genenetwork2
wqflask/wqflask/marker_regression/display_mapping_results.py
1
123026
# Copyright (C) University of Tennessee Health Science Center, Memphis, TN. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License # as published by the Free Software Foundation, either version 3 of the # License, or (at your option) any la...
agpl-3.0
-4,374,926,609,536,563,000
50.866358
272
0.549274
false
3.706161
false
false
false
siis/pfwall
tools/pfwall/pftables/modules.py
1
1277
import ConfigParser import os import sys # Dealing with registering match and target modules match_modules_registered = {} target_modules_registered = {} def register_target_module(name, func): target_modules_registered[name.lower()] = func def get_target_module_func(name): if name.lower() in target_modules_regi...
gpl-2.0
6,047,247,875,065,488,000
30.146341
61
0.738449
false
3.396277
true
false
false
hzlf/openbroadcast.org
website/apps/media_asset/util/grapher.py
1
17923
#!/usr/bin/env python # processing.py -- various audio processing functions # Copyright (C) 2008 MUSIC TECHNOLOGY GROUP (MTG) # UNIVERSITAT POMPEU FABRA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publish...
gpl-3.0
3,122,047,624,547,121,000
33.667311
100
0.569269
false
3.496488
false
false
false
nilsonmorales/Badass
Packages_POU/pre-paquetes/20140430/20140430.pet/usr/share/local/apps/VideoThumbnail/thumb.py
1
4964
# $Id: thumb.py,v 1.4 2006/05/30 09:24:18 stephen Exp $ """Template for a thumbnail generation program. This provides a Python class which you extend to generate a thumbnail image for a type of file. An example is included which generates thumbnails for text files. A more useful implemetation is VideoThumbnail. ""...
gpl-3.0
8,253,834,313,409,660,000
31.657895
75
0.559025
false
3.80967
false
false
false
femtotrader/pyfolio
pyfolio/tests/test_pos.py
1
6812
from unittest import TestCase from nose_parameterized import parameterized from collections import OrderedDict import os import gzip from pandas import ( Series, DataFrame, date_range, Timestamp, read_csv ) from pandas.util.testing import assert_frame_equal from numpy import ( arange, zero...
apache-2.0
-8,497,933,115,427,768,000
35.623656
77
0.52158
false
3.694143
true
false
false
hiatobr/midiacapoeira
models/menu.py
1
6415
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations response.logo = A( B('Mídia Capoeira'), XML('&trade;&nbsp;'), _class="brand", _href=domainname ) response.title = 'Mídia Capoeira' response.subtitle = 'garimpando no lado de baixo do tapete' response.meta.autho...
gpl-3.0
2,605,010,243,501,771,000
44.721429
152
0.516013
false
3.486383
false
false
false
bellettif/MultimodePIF
PythonWksp/classic_HMM/inference/Test_Viterbi.py
1
1819
''' Created on 8 mai 2014 @author: Francois Belletti ''' import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from surrogate.Markov_model import Markov_model from HMM_algos import Proba_computer initial = [0.1, 0.1, 0.1] A = [[0.3, 0.5, 0.3], [0.3, 0.3, 0.5], [0.5, 0.3, 0.3]] alphabet = ...
gpl-2.0
603,588,227,454,014,700
19.908046
99
0.581089
false
2.777099
false
false
false
Kotaimen/awscfncli
awscfncli2/cli/utils/pprint.py
1
15613
"""Proxy interfaces for cli print.""" import difflib import json import backoff import botocore.exceptions import click import yaml from .colormaps import CHANGESET_STATUS_TO_COLOR, CHANGESET_ACTION_TO_COLOR, \ CHANGESET_REPLACEMENT_TO_COLOR, DRIFT_STATUS_TO_COLOR, \ STACK_STATUS_TO_COLOR, CHANGESET_RESOURCE_...
mit
8,779,636,657,920,822,000
41.542234
125
0.554538
false
4.251906
false
false
false
Kvoti/ditto
ditto/formbuilder/renderer.py
1
3294
from tabulate import tabulate from . import models def render_form(form): s = form.title + '\n\n' for question in form.questions.order_by('order').select_subclasses(): s += _render_question_heading(question) s += _render_question(question) + '\n\n' return s def _render_question_heading(...
bsd-3-clause
-2,711,049,681,233,670,700
27.153846
85
0.600789
false
3.738933
false
false
false
tonyseek/rsocks
rsocks/utils.py
1
2050
from __future__ import unicode_literals import os import sys import logging from six.moves.urllib.parse import urlparse, parse_qsl from .green import socks __all__ = ['parse_proxy_uri', 'printable_uri', 'debug'] def parse_proxy_uri(uri): uri = urlparse(uri) proxy_options = dict(parse_qsl(uri.query)) ...
mit
6,146,472,114,585,619,000
26.333333
75
0.596585
false
3.634752
false
false
false
yeleman/snisi
snisi_trachoma/indicators.py
1
3288
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import copy from snisi_core.indicators import (IndicatorTable, Indicator, gen_report_indicator) ...
mit
848,647,027,905,594,900
27.034188
73
0.639024
false
3.485654
false
false
false
brguez/TEIBA
src/python/makeConsensusVCF.MEI.py
1
27711
#!/usr/bin/env python #coding: utf-8 #### FUNCTIONS #### def header(string): """ Display header """ timeInfo = time.strftime("%Y-%m-%d %H:%M") print '\n', timeInfo, "****", string, "****" def info(string): """ Display basic information """ timeInfo = time.strftime("%Y-%m-%...
gpl-3.0
1,597,810,666,362,342,400
45.561345
237
0.638283
false
3.353589
false
false
false
haamoon/tensorpack
tensorpack/dataflow/tf_func.py
1
2482
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: tf_func.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import tensorflow as tf from .base import ProxyDataFlow """ This file was deprecated """ __all__ = [] class TFFuncMapper(ProxyDataFlow): def __init__(self, ds, get_placeholders, symbf, ap...
apache-2.0
-2,703,263,593,143,187,000
30.417722
86
0.556003
false
3.354054
false
false
false
kosborn/PyDeepSee
PyDeepSee/__init__.py
1
3216
""" License: GPLv2 Python bindings for Solera DeepSee forensics tool """ import requests,sys,math,pprint,time from datetime import datetime, timedelta class PyDeepSee: def __init__(self,server,username,password,verify=True): self.server=server self.username=username self.password=password self.verify=ver...
gpl-2.0
-6,653,746,003,933,924,000
23.549618
138
0.699938
false
3.125364
false
false
false
vdragan1993/serbian-document-network
src/relationship_builder.py
1
3823
# coding=utf-8 __author__ = "Dragan Vidakovic" import reader import os import writer from nltk.tokenize import RegexpTokenizer import serbian_stemmer def load_doc_num(file_path): lines = reader.read_file_line(file_path) doc_num_mapper = {} num_doc_mapper = {} clean_lines = [line[:-2] for line in lines...
apache-2.0
654,675,548,980,116,200
29.830645
109
0.636673
false
3.419499
false
false
false
DSSG2017/florence
src/utils/plotting/gpdutils.py
1
4695
import pandas as pd import geopandas as gpd import shapely as sp import numpy as np from scipy.spatial import Voronoi def convert_point_csv_to_data_frame(path, lat_key='lat', lon_key='lon', encoding='utf-8', separator='\t', decimal='.', index_col...
mit
2,671,435,066,684,136,000
33.777778
80
0.646645
false
3.8047
false
false
false
donK23/shed01
PyBeispiele/SherlockRec/app/views.py
1
3398
""" Views """ from flask import render_template, request, redirect, url_for from app import app import models import json import collections rating_to_process = None # MAIN page @app.route("/") def index(): return render_template("index.html") # SURVEY page @app.route("/survey") def survey(): global bookT...
apache-2.0
-7,004,490,056,156,988,000
32
117
0.645674
false
3.763012
false
false
false
syci/ingadhoc-odoo-addons
product_pack_discount/__openerp__.py
1
1505
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2009 Àngel Àlvarez - NaN (http://www.nan-tic.com) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
agpl-3.0
2,295,275,906,327,924,500
29.673469
78
0.551564
false
3.99734
false
false
false
tysonholub/twilio-python
tests/integration/preview/trusted_comms/test_device.py
1
1401
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class DeviceTestCase(Integratio...
mit
-7,126,152,793,064,093,000
29.456522
119
0.596003
false
3.880886
true
false
false
YarkoL/colorcore
lib/bitcoin/wallet.py
1
9562
# Copyright (C) 2012-2014 The python-bitcoinlib developers # # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be copied, modified, # propagated, or dist...
mit
-3,244,833,931,316,918,300
35.776923
117
0.649864
false
3.877534
false
false
false
projectshift/shift-media
shiftmedia/paths.py
1
9544
import hashlib from shiftmedia import exceptions as x from shiftmedia import utils class PathBuilder: def __init__(self, secret_key): """ Path builder constructor Initializes path builder service. :param secret_key: string - secret key from config """ self.secret_ke...
mit
-5,693,655,965,590,283,000
32.843972
80
0.570096
false
4.610628
false
false
false
bancek/egradebook
src/apps/infosys/migrations/0005_auto__add_field_ocena_datum_vnosa__add_field_ocena_datum_spremembe.py
1
11590
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Ocena.datum_vnosa' db.add_column('infosys_ocena', 'datum_vnosa', self.gf('django.db.model...
gpl-3.0
1,098,968,508,762,735,000
73.294872
233
0.553581
false
3.378024
false
false
false
longyangking/Husky
Husky/Optimize/Graph.py
1
1699
import numpy as np import heapq class Graph: def __init__(self,vertices=None): if vertices is None: self.vertices = {} else: # Need to check data-structure self.vertices = vertices def addvertex(self,name,edges): self.vertices[name] = edges def ...
lgpl-2.1
2,880,668,799,225,625,600
28.310345
77
0.476162
false
4.910405
false
false
false
kyungtaekLIM/PSI-BLASTexB
src/ncbi-blast-2.5.0+/c++/scripts/projects/igblast/post_build/rpm/make_rpm.py
1
5630
#!/usr/bin/env python3 """Script to create a source/binary RPM. """ # $Id: make_rpm.py 496124 2016-03-23 20:34:27Z camacho $ from __future__ import print_function import sys, os, shutil from optparse import OptionParser import subprocess import tarfile SCRIPT_DIR = os.path.dirname(os.path.abspath(sys.argv[0])) sys.pat...
lgpl-3.0
8,979,687,938,229,214,000
31.732558
84
0.607815
false
3.371257
false
false
false
darkman66/langcodes
langcodes/db_sqlite.py
1
13427
import sqlite3 import json import threading from util import data_filename class lazy_property(object): """ A lazy_property decorator from StackOverflow: http://stackoverflow.com/a/6849299/773754 """ def __init__(self, fget): self.fget = fget self.func_name = fget.__name__ de...
mit
8,022,281,609,776,654,000
32.317618
116
0.564236
false
4.310433
false
false
false
DanielCollins/pgtq
src/schema.py
1
3243
"""SQL for storing and working on tasks.""" SQL_TEMPLATE = """ CREATE TABLE IF NOT EXISTS pgtq_{0}_scheduled ( key INTEGER PRIMARY KEY, not_before TIMESTAMP WITHOUT TIME ZONE NOT NULL, task JSON NOT NULL, attempts INTEGER NOT NULL, max_retries INTEGER ); CREATE INDEX IF NOT EXISTS ix_pgtq_{0}_scheduled_no...
isc
-3,844,235,232,650,008,600
28.481818
72
0.63799
false
3.487097
false
false
false
boto/s3transfer
tests/integration/test_crt.py
1
12474
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
apache-2.0
-1,206,893,386,883,824,600
37.619195
80
0.598846
false
3.958743
true
false
false
Rhoana/rh_aligner
old/export_mesh.py
1
1903
import sys import os import glob import argparse from subprocess import call from bounding_box import BoundingBox import json import itertools import utils def export_mesh(jar_file, image_width, image_height, out_fname, conf=None): conf_args = utils.conf_args_from_file(conf, 'ExportMesh') java_cmd = 'java -Xm...
mit
-2,538,754,642,739,668,500
37.836735
171
0.61114
false
3.790837
false
false
false
ProjectQ-Framework/ProjectQ
projectq/setups/decompositions/sqrtswap2cnot.py
1
1588
# -*- coding: utf-8 -*- # Copyright 2018 ProjectQ-Framework (www.projectq.ch) # # 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
-7,979,988,676,417,737,000
34.288889
94
0.693325
false
3.521064
false
false
false
machalekj/ontap-api-wrapper
setup.py
1
1076
#!/usr/bin/env python from setuptools import setup setup(name='ontap-api-wrapper', version='0.5.4.post0', description='Python wrapper for NetApp Manageability SDK', author='Andrew Leonard', author_email='andy.leonard@sbri.org', maintainer='Jiri Machalek', maintainer_email='machalek...
apache-2.0
6,061,288,055,529,719,000
36.103448
90
0.611524
false
3.955882
false
false
false
wangjun/flask-admin
flask_admin/contrib/mongoengine/view.py
1
18887
import logging from flask import request, flash, abort, Response from flask.ext.admin import expose from flask.ext.admin.babel import gettext, ngettext, lazy_gettext from flask.ext.admin.model import BaseModelView from flask.ext.admin._compat import iteritems, string_types import mongoengine import gridfs from mongo...
bsd-3-clause
-3,655,146,573,183,305,000
29.660714
114
0.532906
false
4.76824
false
false
false
kvnn/btcimg
btcimg/settings/base.py
1
5315
""" Django settings for btcimg 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 i...
gpl-2.0
-5,483,455,525,117,364,000
28.203297
98
0.620132
false
3.627986
false
false
false
honeynet/beeswarm
beeswarm/shared/asciify.py
1
1725
# Parts of this code are taken from: https://gist.github.com/chris-hailstorm/4989643 # All credits go to the original author import unicodedata def _remove_accents(data): """ Changes accented letters to non-accented approximation, like Nestle """ return unicodedata.normalize('NFKD', data).encode('as...
gpl-3.0
-1,297,287,412,328,637,000
27.766667
84
0.591304
false
3.709677
false
false
false
terranodo/django-osgeo-importer
osgeo_importer/geonode_apis.py
1
1360
import os from .api import ( # noqa: F401 UserResource, UploadedLayerResource, UserOwnsObjectAuthorization, UploadedDataResource, MultipartResource, UploadedFileResource ) from geonode.api.api import ProfileResource from geonode.geoserver.helpers import ogc_server_settings from tastypie.fields ...
gpl-3.0
6,555,169,954,289,598,000
34.789474
99
0.658088
false
4.31746
true
false
false
weiweihuanghuang/Glyphs-Scripts
Stylistic Sets/Create ssXX from layer.py
1
1166
#MenuTitle: Create .ssXX glyph from current layer # -*- coding: utf-8 -*- __doc__=""" Takes the currently opened layers and creates new glyphs with a .ssXX ending. Checks if the name is free. """ import GlyphsApp Font = Glyphs.font FirstMasterID = Font.masters[0].id allGlyphNames = [ x.name for x in Font.glyphs ] sel...
apache-2.0
-6,344,059,178,143,018,000
23.808511
77
0.745283
false
3.399417
false
false
false
ybodnar/datagene
dist-count.py
1
2781
import logging import os from Queue import Queue import threading import argparse LOG = logging.getLogger(__name__) logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO) class LineCounterWorker(threading.Thread): def __init__(self, worker_id, processing_queue, result_queue):...
gpl-2.0
-1,638,717,782,786,126,600
32.914634
114
0.637181
false
3.621094
false
false
false
aiorchestra/aiorchestra-openstack-plugin
setup.py
1
2341
# Author: Denys Makogon # # 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 t...
apache-2.0
3,291,491,262,194,808,300
35.015385
79
0.634344
false
4.064236
false
false
false
phatina/lmishell
src/lmi/shell/obj/impl/ns.py
1
3200
from lmi.shell import obj QUERY_TYPE_CQL = 'DMTF:CQL' QUERY_TYPE_WQL = 'WQL' class LMINamespace(obj.LMIBase): ''' LMI class representing CIM namespace. ''' _SUPPORTED_NAMESPACES = [ u'root' + ns for ns in u'', u'/cimv2', u'/dcim', u'/interop', ...
gpl-2.0
-2,149,266,257,538,665,700
30.372549
79
0.57625
false
3.652968
false
false
false
syl20bnr/testrail-api
python/testrail.py
1
2077
# # TestRail API binding for Python (API v2, available since TestRail 3.0) # # Learn more: # # http://docs.gurock.com/testrail-api2/start # http://docs.gurock.com/testrail-api2/accessing # # Copyright Gurock Software GmbH. See license.md for details. # import urllib2, json, base64 class APIClient: def __init__(self,...
mit
7,369,945,157,175,601,000
24.024096
74
0.620125
false
3.027697
false
false
false
peterwilletts24/Monsoon-Python-Scripts
rain/land_sea_diurnal/rain_mask_save_lat_lon_west_southern_indian_ocean.py
1
7070
import os, sys import datetime import iris import iris.unit as unit import iris.analysis.cartography import numpy as np from iris.coord_categorisation import add_categorised_coord diag = 'avg.5216' cube_name_explicit='stratiform_rainfall_rate' cube_name_param='convective_rainfall_rate' pp_file_path='/projects/casc...
mit
-6,895,962,552,583,639,000
44.031847
197
0.654597
false
2.825739
false
false
false
twilio/twilio-python
twilio/rest/ip_messaging/v2/service/binding.py
1
14162
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import...
mit
-5,625,618,278,813,193,000
31.631336
103
0.600621
false
4.324275
false
false
false
kyubifire/softlayer-python
SoftLayer/CLI/file/order.py
1
4648
"""Order a file storage volume.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions CONTEXT_SETTINGS = {'token_normalize_func': lambda x: x.upper()} @click.command(context_settings=CONTEXT_SETTINGS) @click.option...
mit
3,788,993,315,149,172,700
38.058824
96
0.591222
false
4.33178
false
false
false
fossfreedom/cb_dev
coverart_entryview.py
1
10046
# -*- Mode: python; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*- # # Copyright (C) 2012 - fossfreedom # Copyright (C) 2012 - Agustin Carrasco # # 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 Fou...
gpl-3.0
-1,016,717,941,151,101,700
36.485075
78
0.660462
false
3.720741
false
false
false
mjuenema/python-TSIP
docs/examples/example2.py
1
9086
#!/usr/bin/env python """ More elaborate example trying to retrieve as much data as possible from a Trimble Copernicus II GPS. It shows how to a) Establish a connection to the GPS. b) Send request packets to the GPS. c) Read report packets from the GPS and extract data. Includes code inspired and co-written by Danie...
bsd-2-clause
7,181,874,790,834,013,000
34.081081
108
0.583865
false
3.137431
false
false
false
corani/beancount-web
fava/api/budgets.py
1
2759
from collections import defaultdict, namedtuple from beancount.core.data import Custom from beancount.core.number import Decimal from fava.util.date import days_in_daterange, number_of_days_in_period Budget = namedtuple('Budget', 'account date_start period number currency') BudgetError = namedtuple('BudgetError', 's...
mit
4,650,383,985,711,415,000
33.061728
77
0.571221
false
4.205793
false
false
false
sergeii/swat4stats.com
tracker/signals.py
1
9440
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, absolute_import, division) import logging from datetime import datetime import six from django.dispatch import receiver, Signal from django.db.models import F from django.db.models.signals import pre_save, post_save from django.db import transaction, I...
mit
-3,782,167,431,929,711,000
40.769912
128
0.560064
false
4.32829
false
false
false
johnnyslt/plugin.video.quasar
resources/site-packages/quasar/navigation.py
1
6038
import os import sys import urllib2 import xbmc import xbmcgui import xbmcplugin import socket import traceback from quasar.logger import log from quasar.config import QUASARD_HOST from quasar.addon import ADDON, ADDON_ID from quasar.util import notify, getLocalizedString, getLocalizedLabel, system_information try: ...
bsd-3-clause
6,440,026,434,462,497,000
36.503106
137
0.609308
false
3.890464
false
false
false
TueVJ/RE-Europe_SimpleEnsembles
kernel_regression.py
1
3400
"""The :mod:`sklearn.kernel_regressor` module implements the Kernel Regressor. """ # Author: Jan Hendrik Metzen <janmetzen@mailbox.de> # Github link: https://github.com/jmetzen/kernel_regression/ # License: BSD 3 clause import numpy as np from sklearn.metrics.pairwise import pairwise_kernels from sklearn.base import ...
mit
-2,318,198,228,584,046,600
33.693878
79
0.622353
false
4.101327
false
false
false
google-research/google-research
student_mentor_dataset_cleaning/training/loss/triplet_loss.py
1
7316
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
-9,144,044,782,884,564,000
37.104167
89
0.640514
false
3.796575
false
false
false
eyaler/tensorpack
tensorpack/utils/gpu.py
1
1912
# -*- coding: utf-8 -*- # File: gpu.py import os from .utils import change_env from . import logger from .nvml import NVMLContext from .concurrency import subproc_call __all__ = ['change_gpu', 'get_nr_gpu', 'get_num_gpu'] def change_gpu(val): """ Returns: a context where ``CUDA_VISIBLE_DEVICES=val`...
apache-2.0
7,753,184,123,614,870,000
29.349206
89
0.613494
false
3.540741
false
false
false
vvv-v13/backend-tools
python/asyncio/app.py
1
1997
import ujson import asyncio from aiohttp import web from aiopg.sa import create_engine import sqlalchemy as sa from sqlalchemy.dialects import postgresql metadata = sa.MetaData() models = sa.Table( 'models', metadata, sa.Column('id', sa.Integer, primary_key=True), sa.Column('uid', postgresql.UUID), ...
bsd-2-clause
5,000,754,358,622,015,000
26.356164
97
0.615423
false
3.289951
false
false
false
apple/llvm-project
lldb/test/API/tools/lldb-server/commandline/TestStubSetSID.py
5
1837
import gdbremote_testcase import lldbgdbserverutils import os import select from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestStubSetSIDTestCase(gdbremote_testcase.GdbRemoteTestCaseBase): mydir = TestBase.compute_mydir(__file__) def ge...
apache-2.0
6,014,576,486,730,429,000
36.489796
152
0.691345
false
3.696177
true
false
false