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
dials/dials
tests/algorithms/indexing/test_non_primitive_basis.py
1
1945
import pytest import scitbx.matrix from cctbx import sgtbx from cctbx.sgtbx import bravais_types from dxtbx.model import Crystal, Experiment, ExperimentList from dials.algorithms.indexing import assign_indices, non_primitive_basis from dials.array_family import flex @pytest.mark.parametrize("space_group_symbol", br...
bsd-3-clause
7,598,806,288,202,229,000
37.137255
82
0.705398
false
3.020186
false
false
false
usc-isi/horizon-old
horizon/horizon/dashboards/settings/user/urls.py
1
1066
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
-3,605,575,973,021,152,000
37.071429
78
0.722326
false
4.084291
false
false
false
codelucas/facebook-context
backend-flask/backend/example.py
1
15518
#!/usr/bin/env python # Copyright 2013 AlchemyAPI # # 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
-368,163,000,386,899,300
27.163339
168
0.47345
false
3.758295
false
false
false
oblique-labs/pyVM
rpython/rlib/unicodedata/test/test_unicodedata.py
1
6594
# encoding: utf-8 import random import unicodedata import py from rpython.rlib.unicodedata import ( unicodedb_3_2_0, unicodedb_5_2_0, unicodedb_6_0_0, unicodedb_6_2_0, unicodedb_8_0_0) class TestUnicodeData(object): def setup_class(cls): if unicodedata.unidata_version != '5.2.0': py....
mit
-4,423,305,646,221,714,000
42.946667
107
0.614381
false
3.130104
true
false
false
dereneaton/ipyrad
ipyrad/core/paramsinfo.py
1
21970
#!/usr/bin/env python """ Return explanation and options for each parameter. ip.get_params_info(1) or ip.get_params_info("project_dir") return the same result. If not argument, a summary of the available parameters and their numbered references is returned. Parameter info is stored as a dict of tupl...
gpl-3.0
1,552,804,021,922,965,200
44.298969
82
0.454802
false
4.884393
false
false
false
pshchelo/heat
heat/engine/resources/stack_resource.py
1
20765
# # 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 # ...
apache-2.0
-4,581,617,663,593,579,000
38.932692
79
0.584589
false
4.578831
false
false
false
hds-lab/coding-ml
msgvis/apps/enhance/migrations/0002_auto_20160222_0230.py
1
1306
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('enhance', '0001_initial'), (b'auth', b'__first__'), # This line and the next line is for fixi...
mit
-7,770,648,743,024,572,000
30.853659
119
0.570444
false
4.367893
false
false
false
jj1bdx/wspr
WsprMod/iq.py
1
4726
#------------------------------------------------------------------ iq from Tkinter import * import Pmw import g import w import time import tkMessageBox import pickle def done(): root.withdraw() root=Toplevel() root.withdraw() root.protocol('WM_DELETE_WINDOW',done) if g.Win32: root.iconbitmap("wsjt.ico") root.ti...
gpl-2.0
-423,385,164,766,437,600
27.46988
82
0.621244
false
2.233459
false
false
false
zestyr/lbry
lbrynet/core/server/ServerRequestHandler.py
1
5866
import json import logging from twisted.internet import interfaces, defer from zope.interface import implements from lbrynet.interfaces import IRequestHandler log = logging.getLogger(__name__) class ServerRequestHandler(object): """This class handles requests from clients. It can upload blobs and return req...
mit
8,375,703,638,704,539,000
30.537634
93
0.608421
false
4.335551
false
false
false
diegodelemos/reana-job-controller
tests/test_job_manager.py
1
4870
# -*- coding: utf-8 -*- # # This file is part of REANA. # Copyright (C) 2019 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """REANA-Job-Controller Job Manager tests.""" import json import os import uuid import mock ...
mit
-5,248,791,011,333,741,000
34.289855
87
0.634702
false
3.637043
true
false
false
kencochrane/docker-django-demo
dockerdemo/voting/migrations/0001_initial.py
1
1782
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-02-16 20:05 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Creat...
mit
-4,280,010,848,897,716,000
36.914894
114
0.574635
false
4.304348
false
false
false
todddeluca/diabric
diabric/files.py
1
11396
''' Fabric utilities for working with files. ''' import StringIO import contextlib import os import shutil import subprocess import uuid from fabric.api import sudo, run, settings, hide, put, local from fabric.contrib.files import exists ################## # HELPER FUNCTIONS # These functions are reusable snippets...
mit
3,146,706,489,054,374,400
33.850153
115
0.650053
false
4.106667
false
false
false
zeroSteiner/boltons
boltons/formatutils.py
1
11298
# -*- coding: utf-8 -*- """`PEP 3101`_ introduced the :meth:`str.format` method, and what would later be called "new-style" string formatting. For the sake of explicit correctness, it is probably best to refer to Python's dual string formatting capabilities as *bracket-style* and *percent-style*. There is overlap, but ...
bsd-3-clause
5,633,073,641,725,229,000
33.340426
93
0.610816
false
3.842857
false
false
false
iandees/all-the-places
locations/spiders/sunloan.py
1
2377
# -*- coding: utf-8 -*- import scrapy import json import re from locations.items import GeojsonPointItem DAYS={ 'Monday':'Mo', 'Tuesday':'Tu', 'Wednesday':'We', 'Friday':'Fr', 'Thursday':'Th', 'Saturday':'Sa', 'Sunday':'Su', } class SunLoanSpider(scrapy.Spider): name = "sunloan" a...
mit
2,616,339,130,988,153,000
27.987805
123
0.519983
false
3.90312
false
false
false
PiaBianca/PyMaster
pymasterlib/ask.py
1
1995
# PyMaster # Copyright (C) 2014, 2015 FreedomOfRestriction <FreedomOfRestriction@openmailbox.org> # # 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...
gpl-3.0
-6,075,815,982,666,345,000
30.666667
86
0.66416
false
3.421955
false
false
false
dark1729dragon/pixutils
pixutils/vplayer/PlayImgs.py
1
2169
from __future__ import nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals from .videoutils import * def default_labeller(x): try: return int(x.split('_')[1].split('.')[0]) except: try: return int(basename(x).split('_')[1].split(...
bsd-2-clause
8,355,155,217,002,081,000
27.552632
125
0.545874
false
3.464856
false
false
false
jonathf/chaospy
chaospy/distributions/baseclass/operator.py
1
2655
"""Operator transformation.""" import numpy import chaospy from ..baseclass import Distribution class OperatorDistribution(Distribution): """Operator transformation.""" def __init__(self, left, right, exclusion=None, repr_args=None): if not isinstance(left, Distribution): left = numpy.at...
mit
8,029,556,839,526,679,000
39.227273
103
0.59548
false
4.561856
false
false
false
usingnamespace/pyramid_authsanity
src/pyramid_authsanity/policy.py
1
6144
import base64 import os from pyramid.authorization import Authenticated, Everyone from pyramid.interfaces import IAuthenticationPolicy, IDebugLogger from zope.interface import implementer from .util import _find_services, _session_registered, add_vary_callback def _clean_principal(princid): """Utility function ...
isc
-7,210,039,205,602,359,000
32.032258
85
0.585938
false
4.578241
false
false
false
CroceRossaItaliana/jorvik
formazione/migrations/0035_auto_20190510_1149.py
1
2215
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2019-05-10 11:49 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('formazione', '0034_auto_201904...
gpl-3.0
6,304,392,364,393,148,000
60.5
247
0.681572
false
3.432558
false
false
false
kgullikson88/General
Analyze_CCF.py
1
9048
""" This is a module to read in an HDF5 file with CCFs. Use this to determine the best parameters, and plot the best CCF for each star/date """ from collections import defaultdict import logging import h5py import numpy as np import pandas as pd from scipy.interpolate import InterpolatedUnivariateSpline as spline cl...
gpl-3.0
5,668,383,523,431,874,000
42.710145
126
0.513263
false
4.11647
false
false
false
clausqr/HTPC-Manager
modules/qbittorrent.py
1
12490
#!/usr/bin/env python # -*- coding: utf-8 -*- import htpc import cherrypy import json import logging import time import math from cherrypy.lib.auth2 import require from htpc.helpers import striphttp, sizeof import requests from requests.auth import HTTPDigestAuth class Qbittorrent(object): session = requests.Ses...
mit
-863,452,485,712,000,900
36.507508
182
0.517374
false
3.945041
false
false
false
SpaceGroupUCL/qgisSpaceSyntaxToolkit
esstoolkit/external/networkx/algorithms/swap.py
4
9829
"""Swap edges in a graph. """ import math from networkx.utils import py_random_state import networkx as nx __all__ = ["double_edge_swap", "connected_double_edge_swap"] @py_random_state(3) def double_edge_swap(G, nswap=1, max_tries=100, seed=None): """Swap two edges in the graph while keeping the node degrees f...
gpl-3.0
5,574,572,882,945,417,000
35.539033
85
0.550005
false
4.220266
false
false
false
durandj/ynot-django
ynot/django/themes/templatetags/breadcrumbs.py
1
2421
from django import template as django_template from django.template import defaulttags as django_defaulttags from django.utils import encoding as django_encoding # pylint: disable=invalid-name, too-few-public-methods register = django_template.Library() # pylint: disable=unused-argument @register.tag def...
mit
-5,690,095,699,108,651,000
24.21875
84
0.674515
false
3.030038
false
false
false
edx/edx-enterprise
enterprise/migrations/0111_pendingenterprisecustomeradminuser.py
1
3009
# Generated by Django 2.2.15 on 2020-09-09 14:31 import simple_history.models import django.db.models.deletion import django.utils.timezone from django.conf import settings from django.db import migrations, models import model_utils.fields class Migration(migrations.Migration): dependencies = [ migrat...
agpl-3.0
-8,918,742,934,730,054,000
52.732143
205
0.627783
false
4.256011
false
false
false
blueshed/blueshed-micro
blueshed/micro/utils/executor.py
1
2437
from blueshed.micro.utils import resources from tornado.concurrent import Future from tornado.ioloop import IOLoop from tornado.autoreload import add_reload_hook from functools import wraps import logging import os import inspect from concurrent.futures.process import ProcessPoolExecutor LOGGER = logging.getLogger(__...
mit
-5,598,329,544,635,889,000
26.077778
71
0.623718
false
3.886762
false
false
false
espressofiend/NCIL-SOC-2015
PsychoPy/stroop_lastrun.py
1
14481
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ This experiment was created using PsychoPy2 Experiment Builder (v1.82.00), Mon Jun 22 22:53:33 2015 If you publish work using this script please cite the relevant PsychoPy publications Peirce, JW (2007) PsychoPy - Psychophysics software in Python. Journal of Neurosci...
mit
883,825,306,107,728,600
43.832817
153
0.653477
false
3.55886
false
false
false
SauloAislan/ironic
ironic/common/keystone.py
1
4019
# coding=utf-8 # # 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 # di...
apache-2.0
4,339,364,489,607,921,700
35.87156
78
0.700423
false
4.368478
true
false
false
gnoack/ukechord
chordpro.py
1
4308
"""Read ChordPro files and output them through a PDFWriter object""" import re import song import uke class ChordProError(Exception): """Error in a ChordPro input.""" pass def _analyze_chordpro_textline(line): """Analyze the text and chords in a line of text. Args: line: The line of text, with chords...
apache-2.0
-5,033,884,073,311,483,000
31.885496
77
0.634401
false
3.293578
false
false
false
remind101/stacker_blueprints
stacker_blueprints/policies.py
1
6595
from awacs.aws import ( Action, Allow, Policy, Principal, Statement, ) from troposphere import ( Sub, Join, Region, AccountId, AWSHelperFn ) from awacs import ( sts, s3, logs, ec2, dynamodb, cloudwatch, ) def make_simple_assume_statement(*principals): ...
bsd-2-clause
-2,938,821,598,821,418,500
25.808943
167
0.549659
false
3.963341
false
false
false
osborne6/luminotes
view/Page_navigation.py
1
1736
from Tags import P, Span, A, Strong class Page_navigation( P ): def __init__( self, page_path, displayed_item_count, total_item_count, start, items_per_page, return_text = None ): if start is None or items_per_page is None: P.__init__( self ) return if displayed_item_count == 1 and displayed_ite...
gpl-3.0
-6,957,415,015,767,892,000
28.423729
117
0.522465
false
3.535642
false
false
false
tambetm/gymexperiments
a2c_atari.py
1
10250
import argparse import os import multiprocessing from multiprocessing import Process, Queue, Array import pickle import gym from gym.spaces import Box, Discrete from keras.models import Model from keras.layers import Input, TimeDistributed, Convolution2D, Flatten, LSTM, Dense from keras.objectives import categorical...
mit
6,621,470,067,187,979,000
34.590278
137
0.639805
false
3.831776
false
false
false
SymbiFlow/symbiflow-arch-defs
utils/lib/parse_route.py
1
1541
""" Library for parsing route output from VPR route files. """ from collections import namedtuple Node = namedtuple('Node', 'inode x_low y_low x_high y_high ptc') def format_name(s): """ Converts VPR parenthesized name to just name. """ assert s[0] == '(' assert s[-1] == ')' return s[1:-1] def form...
isc
6,817,013,597,185,511,000
27.018182
77
0.506814
false
3.862155
false
false
false
NaohiroTamura/python-ironicclient
ironicclient/v1/chassis.py
1
6569
# -*- coding: utf-8 -*- # # Copyright © 2013 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
1,744,163,797,057,530,600
37.635294
79
0.564708
false
4.668088
false
false
false
1905410/Misago
misago/threads/views/admin/attachments.py
1
3500
from django.contrib import messages from django.core.urlresolvers import reverse from django.db import transaction from django.db.models import Count from django.shortcuts import redirect from django.utils.translation import ugettext_lazy as _ from misago.admin.views import generic from ...forms import SearchAttachme...
gpl-2.0
-8,330,892,099,958,133,000
33.653465
98
0.626857
false
4.358655
false
false
false
pombredanne/blivet-1
tests/devicelibs_test/edd_test.py
1
9403
import mock class EddTestCase(mock.TestCase): def setUp(self): self.setupModules( ['_isys', 'logging', 'pyanaconda.anaconda_log', 'block']) def tearDown(self): self.tearDownModules() def test_biosdev_to_edd_dir(self): from blivet.devicelibs import edd path = ed...
gpl-2.0
2,521,215,230,570,225,700
43.353774
107
0.605764
false
2.787726
true
false
false
Marcelpv96/SITWprac2017
sportsBetting/migrations/0018_auto_20170515_1009.py
1
1050
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-05-15 10:09 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
gpl-3.0
7,969,951,120,777,904,000
29.882353
121
0.612381
false
4.007634
false
false
false
djb1815/Essex-MuSoc
musoc_web/schedule/views.py
1
1465
from django.shortcuts import render, redirect from django.db import transaction from django.contrib.auth.decorators import login_required from .forms import ProfileNameForm, ProfileDetailForm from django.contrib import messages # Create your views here. def index(request): # Add variables in the custom_variables...
mit
6,622,172,651,528,371,000
34.731707
102
0.686689
false
4.221902
false
false
false
cloughrm/Flask-Angular-Template
backend/pastry/resources/v1/users.py
1
1720
from pastry.db import mongo from pastry.models import User from pastry.resources.auth import login_required from pastry.resources import validators, httpcodes from bson.objectid import ObjectId from flask import request from flask.ext.restful import Resource, reqparse class UsersResource(Resource): @login_requi...
mit
-4,205,179,780,906,292,700
33.4
101
0.640116
false
3.813747
false
false
false
shanksauce/mintr
mintr/__init__.py
1
1862
import requests import time import re from pprint import pprint auth_headers = {} def _validate_credentials(fn): def wrapper(*args): def is_not_populated(d,r): return reduce( lambda x,y: x or y, map(lambda k: k not in d or not d[k], r) ) if is_not_populated(auth_headers, ('cookie...
mit
3,864,896,717,037,192,700
24.162162
77
0.605263
false
3.342908
false
false
false
davidtrem/ThunderStorm
thunderstorm/lightning/utils.py
1
5027
# -*- coding: utf-8 -*- # Copyright (C) 2010-2013 Trémouilles David #This file is part of Thunderstorm. # #ThunderStrom is free software: you can redistribute it and/or modify #it under the terms of the GNU Lesser General Public License as published by #the Free Software Foundation, either version 3 of the License, o...
gpl-3.0
895,360,067,562,563,700
35.686131
77
0.569041
false
4.129827
false
false
false
MicroPyramid/forex-python
setup.py
1
1589
import io import os from setuptools import setup, find_packages VERSION = '1.6' long_description_text = """Forex Python is a Free Foreign exchange rates and currency conversion. Features: List all currency rates. BitCoin price for all curuncies. Converting amount to BitCoins. Get historical rates for any day since 199...
mit
7,102,093,925,092,458,000
32.104167
97
0.680931
false
4.032995
false
false
false
answer-huang/StatisticsCodeLines
statistics.py
1
3024
#coding=utf-8 __author__ = 'answer-huang' import sys reload(sys) sys.setdefaultencoding('utf8') """ 代码行统计工具 """ import wx from MyInfo import AboutMe from AHDropTarget import AHDropTarget import os class AHFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title, wx...
mit
6,652,973,643,853,062,000
30.902174
105
0.630198
false
3.043568
false
false
false
klahnakoski/ActiveData
vendor/mo_testing/fuzzytestcase.py
1
9712
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import unicode_literals impor...
mpl-2.0
-932,436,513,672,928,600
36.210728
134
0.576091
false
4.138049
true
false
false
PopCap/GameIdea
Engine/Extras/Maya_AnimationRiggingTools/MayaTools/General/Scripts/perforceUtils.py
1
32585
import maya.cmds as cmds from P4 import P4,P4Exception import os, cPickle from functools import partial # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # def p4_getLatestRevision(fileName, *args): fileArg = fileName #try to connect p4 = P4() try: ...
bsd-2-clause
-8,773,135,227,386,069,000
14.551724
316
0.561792
false
3.307115
false
false
false
priomsrb/vimswitch
vimswitch/UpdateProfileAction.py
1
1247
from .Action import Action from .Settings import getSettings from .SwitchProfileAction import createSwitchProfileAction class UpdateProfileAction(Action): def __init__(self, settings, switchProfileAction): Action.__init__(self) self.settings = settings self.switchProfileAction = switchProf...
gpl-2.0
-8,137,162,348,852,659,000
30.974359
76
0.677626
false
4.85214
false
false
false
indico/indico
indico/modules/events/registration/models/invitations.py
1
3543
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from uuid import uuid4 from sqlalchemy.dialects.postgresql import UUID from indico.core.db import db fro...
mit
-4,382,065,804,384,135,000
27.344
109
0.61558
false
3.998871
false
false
false
ajroussel/shell-nouns-data
src/extractor.py
1
3851
#!/usr/bin/env python3 import os import argparse import pickle from lxml import etree from sys import argv from objects import * ## returns a list of ints def to_index(s): outlist = list() spl1 = s.split(',') try: for item in spl1: spl2 = item.split('..') start = int(spl2...
gpl-3.0
7,349,968,066,567,672,000
32.780702
77
0.491041
false
4.015641
false
false
false
CybOXProject/python-cybox
cybox/__init__.py
1
4103
# Copyright (c) 2020, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. from mixbox import entities from mixbox.vendor import six from .version import __version__ # noqa #: Mapping of xsi:types to implementation/extension classes _EXTENSION_MAP = {} def _lookup_unprefixed(typename)...
bsd-3-clause
-1,116,159,880,867,913,500
25.816993
79
0.654155
false
3.995131
false
false
false
mlsecproject/gglsbl-rest
config.py
1
1443
from os import environ import logging.config from apscheduler.schedulers.background import BackgroundScheduler from multiprocessing import cpu_count from subprocess import Popen logging.config.fileConfig('logging.conf') bind = "0.0.0.0:5000" workers = int(environ.get('WORKERS', cpu_count() * 8 + 1)) timeout = int(en...
apache-2.0
-1,130,091,579,888,611,300
33.357143
167
0.677755
false
3.150655
false
false
false
estaban/pyload
module/plugins/hoster/UnrestrictLi.py
1
4420
# -*- coding: utf-8 -*- ############################################################################ # 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 ...
gpl-3.0
7,935,763,041,935,266,000
43.646465
104
0.541629
false
4.25409
false
false
false
mikeh69/JammerDetect
src/audio_tones.py
1
3644
import math #import needed modules import pyaudio #sudo apt-get install python-pyaudio import struct import pickle from time import sleep PyAudio = pyaudio.PyAudio #initialize pyaudio #See http://en.wikipedia.org/wiki/Bit_rate#Audio BITRATE = 48000 #number of frames per second - 44.1kHz does not work pro...
mit
-6,694,274,719,032,910,000
37.357895
128
0.586718
false
3.370953
false
false
false
mirkobronzi/finance-analyzer
lib/entries.py
1
3600
""" classes Entry and Entries """ __author__ = 'bronzi' from datetime import datetime import re #TODO: should be configurable PUNCTUATION_REMOVER = re.compile("[0-9,\.#\-_/']") SPACE_REMOVER = re.compile(" +") def string_to_float(string): """ simply convert a string into a float string : basestring ...
gpl-3.0
-7,055,621,584,990,460,000
29
76
0.563889
false
3.829787
false
false
false
Si-elegans/Web-based_GUI_Tools
spirit/forms/comment_like.py
1
1042
#-*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext as _ from spirit.models.comment_like import CommentLike class LikeForm(forms.ModelForm): class Meta: model = CommentLike fields = [] def __init__(self, user=None, comment=None, *args, **kwargs): ...
apache-2.0
6,114,016,247,906,903,000
27.189189
76
0.606526
false
4.288066
false
false
false
vIiRuS/Lagerregal
users/forms.py
1
1438
from django import forms from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext from users.models import Lageruser, DepartmentUser from Lagerregal import settings class SettingsForm(forms.ModelForm): error_css_class = 'has-error' class Meta: model = Lag...
bsd-3-clause
492,863,469,276,929,150
30.26087
122
0.626565
false
4.144092
false
false
false
dmsimard/ansible
lib/ansible/plugins/filter/core.py
1
21532
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # This file is part of Ansible # # Ansible 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....
gpl-3.0
2,740,070,881,585,711,600
31.476621
120
0.611694
false
3.874055
false
false
false
stormi/tsunami
src/secondaires/familier/editeurs/famedit/__init__.py
1
6790
# -*-coding:Utf-8 -* # Copyright (c) 2014 LE GOFF Vincent # 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 # lis...
bsd-3-clause
-1,508,693,470,477,261,300
43.394737
81
0.655009
false
3.256757
false
false
false
JukeboxPipeline/jukebox-core
src/jukeboxcore/addons/guerilla/guerillamgmt.py
1
82524
from PySide import QtGui from jukeboxcore.log import get_logger log = get_logger(__name__) from jukeboxcore import ostool from jukeboxcore import djadapter from jukeboxcore.gui.main import JB_MainWindow, JB_Dialog, dt_to_qdatetime from jukeboxcore.gui import treemodel from jukeboxcore.gui import djitemdata from jukeb...
bsd-3-clause
-4,366,240,837,862,051,000
32.697019
142
0.592131
false
3.71462
false
false
false
tbullmann/heuhaufen
publication/generators_and_depth/aggregate.py
1
5320
import os import pandas import numpy as np from bokeh.palettes import Viridis4 as palette from bokeh.layouts import layout, column, row from bokeh.plotting import figure, output_file, show, ColumnDataSource from bokeh.models import HoverTool, Div, DataTable, TableColumn, NumberFormatter, LinearAxis, Select, CustomJS, ...
mit
2,667,029,470,658,940,000
37
126
0.644361
false
3.658872
true
false
false
Statoil/libres
python/res/enkf/ert_template.py
1
2187
# Copyright (C) 2012 Equinor ASA, Norway. # # The file 'ert_template.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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 Li...
gpl-3.0
87,037,044,405,299,280
36.067797
98
0.631459
false
3.521739
false
false
false
oemof/oemof_base
src/oemof/solph/groupings.py
1
2875
# -*- coding: utf-8 -*- """Groupings needed on an energy system for it to work with solph. If you want to use solph on an energy system, you need to create it with these groupings specified like this: .. code-block: python from oemof.network import EnergySystem import solph energy_system = EnergySy...
gpl-3.0
3,557,383,444,322,008,600
29.252632
79
0.707376
false
3.615094
false
false
false
NIRALUser/RodentThickness
Applications/RodentThickness/Testing/Data/vtkPointAttributes.py
2
3379
import sys # path="/tools/Python/Python-2.7.3/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg:/tools/Python/Python-2.7.3/lib/python2.7/site-packages/pip-1.0-py2.7.egg:/tools/Python/Python-2.7.3/lib/python2.7/site-packages/VTK-6.0-py2.7.egg:/tools/Python/Python-2.7.3/lib/python2.7/site-packages/distribute-0.6....
gpl-3.0
4,282,565,386,402,492,400
33.479592
762
0.669725
false
2.837112
false
false
false
imsut/commons
src/python/twitter/pants/targets/jvm_target.py
1
2954
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
-2,108,860,342,207,043,300
40.027778
100
0.636425
false
4.21398
false
false
false
ver228/tierpsy-tracker
tierpsy/helper/misc/file_processing.py
1
2071
import os import tables from .misc import TABLE_FILTERS RESERVED_EXT = ['_skeletons.hdf5', '_trajectories.hdf5', '_features.hdf5', '_intensities.hdf5', '_feat_manual.hdf5', '_subsample.avi', '.wcon.zip', ...
mit
-487,200,462,895,574,000
30.861538
77
0.551424
false
3.50423
false
false
false
attia42/twitter_word2vec
kmeans/experimentm.py
1
3559
import csv import nltk from nltk.tokenize import word_tokenize import string from nltk import pos_tag from gensim.models.word2vec import Word2Vec from gensim import matutils from numpy import array, float32 as REAL from sklearn.cluster import MiniBatchKMeans, KMeans from multiprocessing import Pool from collections imp...
mit
-3,103,478,720,361,940,000
18.662983
134
0.629952
false
2.527699
false
false
false
fga-gpp-mds/2017.2-Receituario-Medico
medical_prescription/exam/test/test_view_list_custom_exam.py
1
2151
# Django imports from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied # Local Django imports from exam.views import ListCustomExams from user.models import User, Patient, HealthProfessiona...
mit
-498,659,966,404,250,100
41.156863
120
0.605581
false
4.232283
true
false
false
mxcube/mxcube
mxcubeqt/widgets/optimisation_parameters_widget_layout.py
1
2158
# # Project: MXCuBE # https://github.com/mxcube # # This file is part of MXCuBE software. # # MXCuBE is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
lgpl-3.0
7,412,875,325,961,287,000
36.859649
88
0.579703
false
4.231373
false
false
false
PowerHMC/HmcRestClient
src/managed_system/PowerOnManagedSystem.py
1
2162
# Copyright 2015, 2016 IBM Corp. # # 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 require...
apache-2.0
6,232,945,339,774,236,000
37.607143
107
0.682701
false
3.813051
false
false
false
Nablaquabla/sns-analysis
ba-missing-files.py
1
5827
import os import time as tm import sys # Handles the creation of condor files for a given set of directories # ----------------------------------------------------------------------------- def createCondorFile(dataDir,outDir,run,day,time): # Condor submission file name convention: run-day-time.condor with open...
gpl-3.0
-2,322,044,558,256,752,000
42.485075
168
0.519478
false
3.00826
false
false
false
iotaledger/iota.lib.py
iota/transaction/validator.py
1
9563
from typing import Generator, List, Optional, Type from iota.crypto.kerl import Kerl from iota.crypto.signing import validate_signature_fragments from iota.transaction.base import Bundle, Transaction __all__ = [ 'BundleValidator', ] # In very rare cases, the IOTA protocol may switch hash algorithms. # When this ...
mit
-1,442,031,086,814,618,400
35.361217
79
0.527136
false
5.146932
false
false
false
nilbody/h2o-3
h2o-py/tests/testdir_golden/pyunit_svd_1_golden.py
1
2402
from __future__ import print_function from builtins import zip import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def svd_1_golden(): print("Importing USArrests.csv data...") arrestsH2O = h2o.upload_file(pyunit_utils.locate("smalldata/pca_test/USArrests.csv")) print("Co...
apache-2.0
-2,250,794,566,595,891,700
39.711864
117
0.61199
false
2.404404
false
false
false
sophacles/invoke
tests/runner.py
1
8258
import sys import os from spec import eq_, skip, Spec, raises, ok_, trap from invoke.runner import Runner, run from invoke.exceptions import Failure from _utils import support, reset_cwd def _run(returns=None, **kwargs): """ Create a Runner w/ retval reflecting ``returns`` & call ``run(**kwargs)``. """...
bsd-2-clause
-1,536,870,026,090,481,400
31.640316
90
0.541899
false
3.666963
false
false
false
coreymcdermott/artbot
artbot_scraper/spiders/arthouse_spider.py
1
2106
# -*- coding: utf-8 -*- import re from scrapy import Spider, Request from dateutil import parser from artbot_scraper.items import EventItem from pytz import timezone class ArthouseSpider(Spider): name = 'Arthouse Gallery' allowed_domains = ['www.arthousegal...
mit
2,145,790,434,256,513,000
43.765957
142
0.545627
false
3.665505
false
false
false
mmb90/dftintegrate
dftintegrate/fourier/readdata.py
1
5536
""" Classes:: ReadData -- A collection of functions to collect extracted VASP/QE data into a json file. """ import json from copy import deepcopy from ast import literal_eval from collections import defaultdict class ReadData(object): """ A collection of functions to collect extracted VASP/QE data ...
mit
-6,101,243,481,345,637,000
34.716129
74
0.601156
false
4.052709
false
false
false
nkmk/python-snippets
notebook/pypdf2_metadata_remove.py
1
4178
import PyPDF2 src_pdf = PyPDF2.PdfFileReader('data/src/pdf/sample1.pdf') dst_pdf = PyPDF2.PdfFileWriter() dst_pdf.cloneReaderDocumentRoot(src_pdf) with open('data/temp/sample1_no_meta.pdf', 'wb') as f: dst_pdf.write(f) print(PyPDF2.PdfFileReader('data/temp/sample1_no_meta.pdf').documentInfo) # {'/Producer': 'Py...
mit
287,211,407,982,853,760
37.485981
192
0.675085
false
2.679245
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/payments_account_service/client.py
1
18740
# -*- 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
-9,072,559,174,270,836,000
43.619048
154
0.631964
false
4.572962
false
false
false
feureau/Small-Scripts
Blender/Blender config/2.91/scripts/addons/bricker_v2-2-1/lib/property_groups/created_model_properties.py
1
35831
# Copyright (C) 2020 Christopher Gearhart # chris@bblanimation.com # http://bblanimation.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 License, or # (at your opt...
gpl-3.0
8,693,281,229,719,090,000
35.674514
170
0.634395
false
3.951367
false
false
false
xclxxl414/rqalpha
rqalpha/__main__.py
1
14210
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
apache-2.0
1,797,748,913,422,962,200
34.845758
130
0.602266
false
3.486872
true
false
false
kim135797531/opencog-python-blending
opencog_b/python/blending/util/blending_util.py
1
1884
# coding=utf-8 __author__ = 'DongMin Kim' from opencog.type_constructors import * # Choose atoms which are connected to specific atom. def get_incoming_nodes(a, target): ret = [] xget_target_link = a.xget_atoms_by_target_atom(types.Link, target) for link in xget_target_link: xget_target_link_no...
agpl-3.0
70,699,895,936,959,990
28.451613
77
0.652245
false
3.254902
false
false
false
elysium001/zamboni
sites/s3dev/settings_base.py
1
5495
"""private_base will be populated from puppet and placed in this directory""" import logging import os import dj_database_url from mkt.settings import (CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING, HOSTNAME) from .. import splitstrip import private_base as private ALLOWED_HOSTS = ['.a...
bsd-3-clause
6,948,503,791,888,337,000
28.86413
79
0.66697
false
2.949544
false
false
false
rackerlabs/qonos
qonos/openstack/common/rpc/dispatcher.py
1
5310
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
apache-2.0
3,698,796,998,904,787,500
37.478261
79
0.673446
false
4.366776
false
false
false
Mirantis/disk_perf_test_tool
wally/test_run_class.py
1
1980
from typing import List, Callable, Any, Dict, Optional, Set from concurrent.futures import ThreadPoolExecutor from cephlib.istorage import IStorage from cephlib.node import NodeInfo, IRPCNode from cephlib.ssh import ConnCreds from cephlib.storage_selectors import DevRolesConfig from .openstack_api import OSCreds, OSC...
apache-2.0
7,912,155,741,855,254,000
35
91
0.64798
false
3.626374
true
false
false
vmahuli/contrail-controller
src/opserver/partition_handler.py
1
28794
#!/usr/bin/python from gevent import monkey monkey.patch_all() import logging import gevent from gevent.coros import BoundedSemaphore from kafka import KafkaClient, KeyedProducer, SimpleConsumer, common from uveserver import UVEServer import os import json import copy import traceback import uuid import struct import ...
apache-2.0
-5,221,414,559,799,287,000
38.661157
129
0.44992
false
4.194319
false
false
false
edesky/text_validator
lib/validate.py
1
1509
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import argparse import json import math parser = argparse.ArgumentParser() parser.add_argument("--text", required=True, help="Input text") parser.add_argument("--short", action='store_true') args = parser.parse_args() input_text = ...
mit
4,563,589,001,996,884,000
25.571429
110
0.649866
false
2.95825
false
false
false
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/system-config-printer/errordialogs.py
1
3111
#!/usr/bin/python ## system-config-printer ## Copyright (C) 2006, 2007, 2008, 2010 Red Hat, Inc. ## Authors: ## Florian Festi <ffesti@redhat.com> ## Tim Waugh <twaugh@redhat.com> ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as publi...
gpl-3.0
8,152,813,570,208,546,000
35.6
82
0.6072
false
3.998715
false
false
false
drelu/SAGA-Hadoop
hadoop1/launcher.py
1
2591
#!/usr/bin/env python import time import saga import os, sys import subprocess import pdb import logging logging.basicConfig(level=logging.ERROR) def main(): try: # create a job service for Futuregrid's 'india' PBS cluster js = saga.job.Service("pbs+ssh://india") #js = saga.job.Servi...
apache-2.0
944,839,436,700,455,200
29.482353
106
0.564261
false
3.351876
false
false
false
heilaaks/snippy
tests/lib/helper.py
1
7104
# -*- coding: utf-8 -*- # # SPDX-License-Identifier: AGPL-3.0-or-later # # snippy - software development and maintenance notes manager. # Copyright 2017-2020 Heikki J. Laaksonen <laaksonen.heikki.j@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
agpl-3.0
-3,998,784,855,587,372,000
32.668246
126
0.634713
false
4.047863
false
false
false
leshchevds/ganeti
lib/ssh.py
1
43027
# # # Copyright (C) 2006, 2007, 2010, 2011 Google 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list ...
bsd-2-clause
-2,877,672,071,644,923,400
32.432012
80
0.659144
false
3.685712
false
false
false
vwflow/raws-python
raws_json/__init__.py
1
28752
#!/usr/bin/python # -*- coding: utf-8 -*- # # This is a modified version of '__init__.py' (version 1.1.1), part of the 'atom' module # from the gdata-python-client project (http://code.google.com/p/gdata-python-client/) by Google Inc. # Copyright (C) 2006, 2007, 2008 Google Inc. # # It has been modified to support jso...
apache-2.0
4,799,143,421,886,727,000
40.015692
116
0.643399
false
4.255773
false
false
false
google/google-ctf
2019/finals/web-gphotos-finals/app/gallery/middleware.py
1
1230
# Copyright 2019 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
8,556,968,117,111,451,000
28.285714
74
0.704065
false
3.649852
false
false
false
UKPLab/emnlp2017-claim-identification
src/main/python/process_data_se_WithDevel.py
1
4976
import cPickle import numpy as np import pandas as pd import re import sys from collections import defaultdict def build_data_cv(data_folder, cv=10, clean_string=True): """ Loads data. """ revs = [] pos_file = data_folder[0] # train file neg_file = data_folder[1] # test file devel_file = d...
apache-2.0
-3,612,380,496,805,541,400
32.85034
96
0.530748
false
3.275839
false
false
false
bcgov/gwells
app/backend/gwells/views/bulk.py
1
18358
""" 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 distri...
apache-2.0
-6,203,309,790,408,724,000
41.787879
123
0.620288
false
3.633413
false
false
false
live-clones/dolfin-adjoint
tests_dolfin/optimization_scalar/optimization_scalar.py
1
1880
from __future__ import print_function from dolfin import * from dolfin_adjoint import * import sys dolfin.set_log_level(ERROR) n = 10 mesh = UnitIntervalMesh(n) V = FunctionSpace(mesh, "CG", 2) ic = project(Expression("sin(2*pi*x[0])", degree=1), V) u = ic.copy(deepcopy=True) def main(nu): u_next = Function(V)...
lgpl-3.0
-1,891,839,056,240,876,000
27.923077
125
0.534574
false
3.122924
false
false
false
Eternali/synk
synk-pre/synk-pre.py
1
5279
''' Synk - Sublime Text Plugin ''' import os import socket import sublime import sublime_plugin from threading import Thread, Timer # variables for storing user defined settings settings_filename = "synk_pre.sublime-settings" enabled_field = "enabled" server_ips_field = "project_server_ips" # NOTE: add feature ...
gpl-3.0
-5,355,001,853,979,260,000
33.730263
113
0.602387
false
3.867399
false
false
false
PostTenebrasLab/DrinkingBuddyServer
drinkingBuddyDB_declarative.py
1
3467
#!/usr/bin/python3 import os import sys from sqlalchemy import Column, ForeignKey, Integer, String, DateTime, Boolean from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from marshmallow import Schema, fields from flask_sqlalchemy import ...
mit
974,896,659,334,482,000
27.418033
87
0.677531
false
3.847947
false
false
false
ifzing/ceilometer-extended-monitor
network/lbaas.py
1
2469
# -*- encoding: utf-8 -*- from ceilometer.openstack.common import log from ceilometer.openstack.common import timeutils from ceilometer.central import plugin from ceilometer import sample from ceilometer import neutron_client class LbaasInBytesPollster(plugin.CentralPollster): LOG = log.getLogger(__name__ + '....
apache-2.0
8,639,770,541,434,874,000
31.486842
63
0.534629
false
3.882075
false
false
false
bromjiri/Presto
predictor/predictor_new.py
1
8137
import settings import pandas as pd import numpy as np import os from datetime import datetime from datetime import timedelta import predictor.predictor_classifier as cls import predictor.predictor_statistic as stat import random import nltk class Stock: def __init__(self, subject): input_file = settings...
mit
-6,080,565,351,509,108,000
28.915441
117
0.577731
false
3.313111
false
false
false
imgos/asterisk-scripts
script/googlecontacts.py
1
2701
#!/usr/bin/python3 """Get Google Contacts Usage: google_contacts.py [--noauth_local_webserver] Options: --noauth_local_webserver passed on to google auth """ import docopt import httplib2 import subprocess import unidecode from apiclient import discovery from argparse import Namespace from oauth...
mit
-8,137,995,456,563,472,000
26.561224
87
0.654202
false
3.920174
false
false
false
dingmingliu/quanttrade
bt/core.py
1
37660
""" Contains the core building blocks of the framework. """ import math from copy import deepcopy import pandas as pd import numpy as np import cython as cy class Node(object): """ The Node is the main building block in bt's tree structure design. Both StrategyBase and SecurityBase inherit Node. It cont...
apache-2.0
-3,770,879,272,697,670,000
32.151408
80
0.553877
false
4.469499
false
false
false
adamkovics/atmosphere
atmosphere/gas_opacity.py
1
8280
""" Add gas opacities to model based on the composition and vertical structure. """ import numpy as np import logging logger = logging.getLogger() def interpolate_kc(p, T, kc, verbose=False): """Linearly interpolate k-coefficients at a particular pressure and temperature, using the input k-coefficent grid, k...
gpl-2.0
4,651,276,065,316,480,000
39.004831
91
0.533333
false
3.189522
false
false
false
ArcherSys/ArcherSys
node_modules/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py
1
18134
<<<<<<< HEAD <<<<<<< HEAD #!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Argument-less script to select what to run on the buildbots.""" import os import shutil import subprocess imp...
mit
4,987,594,992,532,851,000
30.482639
117
0.635657
false
3.427977
true
false
false