repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
CNS-OIST/STEPS_Example
publication_models/API_2/Anwar_J_Neurosci_2013/StochasticHH.py
1
7959
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Okinawa Institute of Science and Technology, Japan. # # This script runs on STEPS 2.x http://steps.sourceforge.net # # H Anwar, I Hepburn, H Nedelescu, W Chen and E De Schutter # Stochastic calcium mechanisms cause dendritic calcium spike...
gpl-2.0
-3,676,595,133,771,194,000
29.033962
117
0.582737
false
2.43618
false
false
false
ChristopherLucas/txtorg
textorganizer/indexutils.py
1
2090
#from whoosh.reading import iter_docs import threading, sys, time, os, csv, re, codecs, shutil from collections import defaultdict def reindex_all(reader, writer, analyzer): for i in xrange(reader.maxDoc()): if reader.isDeleted(i): continue doc = reader.document(i) p = doc.get("path") ...
mit
-2,620,840,998,572,831,000
34.423729
108
0.548804
false
3.98855
false
false
false
sawardekar/django
test_django/settings.py
1
3090
""" Django settings for test_django project. Generated by 'django-admin startproject' using Django 1.8.7. 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 ...
mit
567,366,854,526,499,000
24.75
71
0.671197
false
3.452514
false
false
false
Stratoscale/pyracktest
py/strato/racktest/infra/rootfslabel.py
1
1376
from upseto import gitwrapper from upseto import run import subprocess class RootfsLabel: def __init__(self, rootfs, product="rootfs"): self._rootfs = rootfs self._product = product if rootfs == "THIS": self._label = run.run([ "solvent", "printlabel", "--thisPro...
apache-2.0
4,555,124,989,347,845,000
36.189189
109
0.549419
false
4.058997
false
false
false
zouyapeng/horizon-newtouch
openstack_dashboard/dashboards/newtouch/server/forms.py
1
2881
from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import messages from openstack_dashboard.dashboards.newtouch.models import Server,Service def get_available_services(): services = Service.objects.all() return ((service.name, servic...
apache-2.0
5,850,093,691,570,547,000
38.465753
88
0.553974
false
4.761983
false
false
false
torchingloom/edx-platform
lms/djangoapps/branding/tests.py
10
2744
""" Tests for branding page """ import datetime from pytz import UTC from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.test.utils import override_settings from django.test.client import RequestFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase...
agpl-3.0
-9,094,167,721,782,870,000
36.081081
94
0.701166
false
4.083333
true
false
false
tgbugs/pyontutils
nifstd/complete/nifga_deprecation.py
1
29254
#!/usr/bin/env python3 # this should be run at NIF-Ontology 9ef5b9e63d60f92cd01733be9d480ac3e5aee31c # TODO need to retrieve the FMA hierarchy... import os from collections import defaultdict, namedtuple import rdflib from rdflib import URIRef, RDFS, RDF, OWL from rdflib.namespace import SKOS import requests from py...
mit
-2,009,078,740,112,054,500
42.275148
247
0.549121
false
3.272992
false
false
false
rspavel/spack
var/spack/repos/builtin/packages/r-interactivedisplaybase/package.py
5
1208
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RInteractivedisplaybase(RPackage): """Base package for enabling powerful shiny web display...
lgpl-2.1
-8,164,230,157,478,357,000
42.142857
81
0.737583
false
3.089514
false
false
false
ramses-tech/nefertari
nefertari/__init__.py
3
1851
import logging from pkg_resources import get_distribution APP_NAME = __package__.split('.')[0] _DIST = get_distribution(APP_NAME) PROJECTDIR = _DIST.location __version__ = _DIST.version log = logging.getLogger(__name__) RESERVED_PARAMS = [ '_start', '_limit', '_page', '_fields', '_count', '_...
apache-2.0
-1,996,295,607,098,615,800
31.473684
75
0.693139
false
3.615234
true
false
false
dvitme/odoo-addons
partner_user/__openerp__.py
7
1783
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
5,099,512,440,611,145,000
34.66
132
0.590017
false
3.962222
false
false
false
foospidy/DbDat
plugins/oracle/check_privilege_revoke_all_context.py
1
1242
class check_privilege_revoke_all_context(): """ check_privilege_revoke_all_context Ensure 'ALL' Is Revoked from Unauthorized 'GRANTEE' on CONTEXT$ The CONTEXT$ table contains columns for the schema and name for a PL/SQL package that will execute for a given application context. """ # Refere...
gpl-2.0
-2,970,980,244,086,498,000
31.684211
91
0.590177
false
3.663717
false
false
false
markus61/selfstoredict
selfstoredict.py
1
6408
"""SelfStoreDict for Python. Author: markus schulte <ms@dom.de> The module provides a subclassed dictionary that saves itself to a JSON file or redis-key whenever changed or when used within a context. """ import json from os.path import getmtime from datetime import datetime, timedelta from pathlib import Path def a...
mit
5,304,001,048,038,711,000
25.37037
119
0.560705
false
3.895441
false
false
false
jdeligt/Genetics
add_metadata_to_delly_manta_vcf.py
3
1779
#!/usr/bin/env python """ add_metadata_to_delly_manta_vcf.py ##INFO=<ID=SOMATIC is automatically added after i) the delly somatic filtering step ii) manta somatic calling """ import sys import argparse import re import vcf def add_meta2vcf(vcf_file): try: f = open(vcf_file, 'r') except IOError: sys.exit("Er...
mit
-1,473,262,784,085,636,000
27.238095
110
0.631254
false
2.96995
false
false
false
mvaled/sentry
src/sentry/api/issue_search.py
2
4681
from __future__ import absolute_import from django.utils.functional import cached_property from parsimonious.exceptions import IncompleteParseError from sentry.api.event_search import ( event_search_grammar, InvalidSearchQuery, SearchFilter, SearchKey, SearchValue, SearchVisitor, ) from sentry...
bsd-3-clause
228,605,746,677,789,060
33.932836
103
0.656056
false
4.045808
false
false
false
lpramuk/robottelo
tests/foreman/cli/test_usergroup.py
1
16308
# -*- encoding: utf-8 -*- """Test class for User Group CLI :Requirement: Usergroup :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: UsersRoles :TestType: Functional :CaseImportance: High :Upstream: No """ import random from robottelo.cli.base import CLIReturnCodeError from robottelo.cli.factory...
gpl-3.0
8,556,261,803,946,540,000
37.013986
99
0.595904
false
3.892124
true
false
false
operasoftware/tlswebprober
webprober/prober/templatetags/tags.py
1
1761
# Copyright 2010-2012 Opera Software ASA # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
-7,333,397,232,341,761,000
31.036364
110
0.712663
false
3.6841
false
false
false
adcrn/transcript-helper
stuff/audio_op.py
1
2796
# Author: Alexander Decurnou # Team: iDev from math import ceil from moviepy.editor import VideoFileClip, AudioFileClip from os.path import join import subprocess DEFAULT_AUDIOFILE_CODEC = 'libvorbis' # used to create webms DEFAULT_AUDIOFILE_BITRATE = None DEFAULT_ZEROES_PADDING = 5 DEFAULT_AUDIO_SEGMENT_DURATION_SE...
gpl-3.0
-2,825,435,699,956,229,600
36.783784
91
0.608727
false
3.75302
false
false
false
shingonoide/odoo
addons/procurement_jit_stock/procurement_jit_stock.py
64
2047
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-8,509,350,440,075,620,000
43.5
167
0.638007
false
4.013725
false
false
false
BenjamenMeyer/openstackinabox
openstackinabox/tests/models/keystone/test_roles.py
2
7366
import uuid import ddt from openstackinabox.tests.base import TestBase, DbFailure from openstackinabox.models.keystone import exceptions from openstackinabox.models.keystone.db.roles import KeystoneDbRoles @ddt.ddt class TestKeystoneDbRoles(TestBase): def setUp(self): super(TestKeystoneDbRoles, self)....
apache-2.0
6,227,425,451,324,088,000
26.3829
79
0.492941
false
3.868697
true
false
false
glassesfactory/Shimehari
shimehari/app.py
1
24726
#!/usr/bin/env python # -*- coding: utf-8 -*- u""" =============================== Shimehari.app ~~~~~~~~~~~~~ Flask などなど参考に。 ルーティングが多少複雑になっても 対応できるような作りにしたいなぁ =============================== """ import os import sys from threading import Lock from functools import update_wrapper from datetime impo...
bsd-3-clause
7,813,359,774,298,345,000
31.313953
137
0.610651
false
3.293142
true
false
false
Aurous/Magic-Discord-Bot
bot.py
1
3281
from mtgsdk import Card import json, discord prop = {'name','multiverse_id','layout','names','mana_cost','cmc','colors','type','supertypes','subtypes','rarity','text','flavor','artist','number','power','toughness','loyalty','variations','watermark','border','timeshifted','hand','life','reserved','release_date','starter...
gpl-3.0
8,098,310,293,257,380,000
59.759259
403
0.53947
false
3.919952
false
false
false
AdamRTomkins/libSpineML2NK
libSpineML2NK/nk_executable.py
1
9925
#! /usr/bin/env python # -*- coding: utf-8 -*- """nk_exectuable will store a single executable experiment, designed in SpineML SpineML is a declaratice Spiking neuron modelling language. """ #import os # STD lib imports first #import sys # alphabetical #import some_third_party_lib # 3rd party stuff next #import ...
gpl-3.0
8,144,121,179,548,089,000
34.446429
145
0.590227
false
3.879984
false
false
false
animeshramesh/incremental-learning
tensorflow/utils.py
1
3548
import tensorflow as tf import os, re def get_checkpoints(checkpoint_dir): ''' Finds all checkpoints in a directory and returns them in order from least iterations to most iterations ''' meta_list=[] for file in os.listdir(checkpoint_dir): if file.endswith('.meta'): meta_lis...
apache-2.0
-7,966,682,305,243,552,000
33.446602
102
0.618377
false
3.770457
false
false
false
akaija/HTSOHM-dev
htsohm/db/material.py
2
1466
from sqlalchemy import Column, Integer, String, Float from sqlalchemy.orm import relationship from htsohm.db import Base, GasLoading, SurfaceArea, VoidFraction class Material(Base): """Declarative class mapping to table storing material/simulation data. Attributes: id (int): database table primary_ke...
mit
-5,930,481,133,151,788,000
28.32
75
0.618008
false
4.212644
false
false
false
magenta/magenta
magenta/models/onsets_frames_transcription/audio_label_data_utils.py
1
14908
# Copyright 2021 The Magenta Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
-474,272,086,295,592,960
36.741772
80
0.669775
false
3.716779
false
false
false
82Flex/DCRM
WEIPDCRM/manage/admin/build.py
1
15565
# coding:utf-8 """ DCRM - Darwin Cydia Repository Manager Copyright (C) 2017 WU Zheng <i.82@me.com> 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 yo...
agpl-3.0
-7,491,214,560,196,319,000
39.219638
157
0.539608
false
4.055498
false
false
false
lino-framework/book
lino_book/projects/min9/settings.py
1
2375
# -*- coding: UTF-8 -*- # Copyright 2012-2021 Rumma & Ko Ltd # License: BSD (see file COPYING for details) from lino.projects.std.settings import * from lino.utils import i2d class Site(Site): title = "Lino Mini 9" project_model = 'contacts.Person' languages = 'en de fr' user_types_module = 'lino_xl....
bsd-2-clause
7,751,269,490,660,809,000
32.450704
82
0.621053
false
3.108639
false
false
false
liuyonggg/learning_python
leetcode/wordpattern.py
1
1080
''' Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str. Examples: pattern = "abba", str = "dog cat cat dog" should return true. pattern = "abba", str = "dog cat cat fish" should ...
mit
-168,464,825,315,798,340
39
119
0.676852
false
3.564356
false
false
false
Diti24/python-ivi
ivi/dicon/diconGP700.py
1
20788
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2014-2016 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
mit
4,720,886,702,923,921,000
39.681018
121
0.502117
false
4.32183
true
false
false
cjvogl/finite_volume_seismic_model
2d/setplot_both.py
1
4889
""" Set up the plot figures, axes, and items to be done for each frame. This module is imported by the plotting routines and then the function setplot is called to set the plot parameters. """ import numpy as np from mapping import Mapping from clawpack.clawutil.data import ClawData import dtopotools_horiz_okada_an...
gpl-3.0
2,835,834,433,527,814,700
32.258503
88
0.633667
false
3.162354
false
false
false
blitzagency/django-chatterbox
chatterbox/drivers/facebook.py
1
1460
import logging from six.moves.urllib.parse import parse_qsl from .oauth import OAuth2 from .oauth import BEARER_URI log = logging.getLogger(__name__) class Facebook(OAuth2): # General info about the provider provider_url = 'https://facebook.com/' docs_url = 'https://developers.facebook.com/docs/' c...
mit
505,490,276,797,752,770
33.761905
84
0.639726
false
3.852243
false
false
false
cgallemore/djvasa
djvasa/main.py
1
5398
import argparse import pystache import os import random import sys from djvasa.templates import View class Project(object): _secret_key = None def __init__(self, **kwargs): self.project_name = raw_input("What's the name of your project? ") self.heroku = kwargs.get('heroku') self.mysql...
mit
-4,106,207,016,604,869,600
31.715152
119
0.564839
false
3.820241
false
false
false
kmadathil/sanskrit_parser
sanskrit_parser/generator/cmd_line.py
1
9432
# -*- coding: utf-8 -*- """ @author: Karthik Madathil (github: @kmadathil) """ from argparse import ArgumentParser, Action import logging from sanskrit_parser.base.sanskrit_base import SLP1, DEVANAGARI from sanskrit_parser.generator.paninian_object import PaninianObject from sanskrit_parser.generator.prakriya import P...
mit
-4,587,673,785,871,555,000
41.286996
140
0.568293
false
3.504274
false
false
false
xolox/python-deb-pkg-tools
deb_pkg_tools/gpg.py
1
25753
# Debian packaging tools: GPG key pair generation. # # Author: Peter Odding <peter@peterodding.com> # Last Change: April 18, 2020 # URL: https://github.com/xolox/python-deb-pkg-tools """ GPG key pair generation and signing of ``Release`` files. The :mod:`deb_pkg_tools.gpg` module is used to manage GPG key pairs. It a...
mit
1,790,061,008,065,040,600
39.619874
138
0.633907
false
4.144351
false
false
false
anarkiwi/faucet
faucet/prom_client.py
6
3515
"""Implement Prometheus client.""" # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2019 The Contributors # # Licensed under the Apac...
apache-2.0
6,146,038,869,145,513,000
38.055556
94
0.637838
false
4.007982
true
false
false
amunozf/legibilidad
rarewords.py
1
1297
#!/usr/bin/env python3 # Legibilidad 2 (beta) # Averigua la legibilidad de un texto # Spanish readability calculations # © 2016 Alejandro Muñoz Fernández #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 Found...
gpl-3.0
-6,993,172,489,587,939,000
34
128
0.718702
false
3.655367
false
false
false
vseledkin/LV_groundhog
experiments/nmt/utils/binarize_top_unigram.py
3
1093
import numpy import cPickle import argparse parser = argparse.ArgumentParser() parser.add_argument("--top-unigram", type=str) parser.add_argument("--src-w2i", type=str) parser.add_argument("--trg-w2i", type=str) parser.add_argument("--vocab-size", type=int) parser.add_argument("--output", type=str) args = parser.parse...
bsd-3-clause
-8,987,425,407,344,949,000
31.147059
97
0.662397
false
2.795396
false
false
false
jrugis/cell_mesh
poly.py
1
1938
#!/usr/bin/python import numpy as np import scipy.interpolate as si import mayavi.mlab as mylab def calc_points(line): points = np.zeros((len(line),3)) # indicies -> point coordinates for i in range(points.shape[0]): #points[i,0] = 2 * 0.556 * (line[i][0]-0.5) #points[i,1] = 2 * 0.556 * (line[i][1]-0.5) ...
gpl-3.0
-8,972,178,347,469,171,000
30.258065
87
0.566563
false
2.459391
false
false
false
moustakas/impy
image/im2rgbfits.py
2
5419
# im2rgbfits CL0024.png -over -header det.fits # WILL HONOR WCS FROM headerfile # im2rgbfits.py # ~/ACS/CL0024/color/production/color.py # ALSO SEE pyfits.pdf (Pyfits manual) #from coetools import * from PIL import Image import pyfits import sys, os import string from os.path import exists, join from numpy import * ...
gpl-2.0
8,847,682,197,896,846,000
27.521053
93
0.506736
false
3.46262
false
false
false
anksp21/Community-Zenpacks
ZenPacks.community.HPMon/ZenPacks/community/HPMon/HPLogicalDisk.py
2
2225
################################################################################ # # This program is part of the HPMon Zenpack for Zenoss. # Copyright (C) 2008, 2009, 2010 Egor Puzanov. # # This program can be used under the GNU General Public License version 2 # You can find full information here: http://www.zenoss.co...
gpl-2.0
5,101,791,954,218,777,000
33.230769
80
0.449438
false
4.151119
false
false
false
iraklikhitarishvili/data2class
jsonparser/examples/bog_example.py
1
2544
import os from base.field import * from jsonparser.documents import BaseJsonDocument from jsonparser.encoder import EnumEncoder import json class Person(BaseJsonDocument): Name = StringField() Inn = StringField() AccountNumber = StringField() BankCode = StringField() BankName = StringField() cl...
bsd-2-clause
8,811,415,984,244,913,000
33.378378
69
0.704403
false
4.378657
false
false
false
RobinMorisset/Btrsync
btrsync_cmd.py
1
1925
#!/usr/bin/env python2 from __future__ import print_function __author__ = "Antoine Amarilli and Fabrice Ben Hamouda" import os, re import argparse def shellquote(s): return "'" + s.replace("'", "'\\''") + "'" def main(): parser = argparse.ArgumentParser(description="WARNING: Internal use. Please use btrsync.sh"...
gpl-3.0
3,168,805,924,806,372,000
34.648148
120
0.649351
false
2.921093
false
false
false
massimo-nocentini/on-python
microkanren/muk/sexp.py
1
3546
from collections import namedtuple from contextlib import contextmanager from functools import wraps from inspect import signature from muk.utils import identity class cons(namedtuple('_cons', ['car', 'cdr'])): def walk_star(self, W): return cons(W(self.car), W(self.cdr)) def unification(self, othe...
mit
-3,657,997,878,783,638,000
29.247863
104
0.570218
false
3.179695
false
false
false
RedHatInsights/insights-core
insights/parsers/net_namespace.py
1
1326
""" NetworkNamespace = ``/bin/ls /var/run/netns`` ============================================= This specs provides list of network namespace created on the host machine. Typical output of this command is as below:: temp_netns temp_netns_2 temp_netns_3 The ``/bin/ls /var/run/netns`` is prefered over ``/bin/i...
apache-2.0
2,550,812,489,670,395,400
26.061224
90
0.635747
false
3.683333
false
false
false
jerbob92/CouchPotatoServer
couchpotato/core/providers/torrent/thepiratebay/main.py
3
5605
from bs4 import BeautifulSoup from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode from couchpotato.core.helpers.variable import tryInt, cleanHost from couchpotato.core.logger import CPLog from couchpotato.core.providers.torrent.base import TorrentMagnetProvider from couchpotato.environment import Env ...
gpl-3.0
-7,151,975,899,739,110,000
36.119205
164
0.487957
false
4.136531
false
false
false
turbokongen/home-assistant
homeassistant/components/tado/const.py
2
4136
"""Constant values for the Tado component.""" from PyTado.const import ( CONST_HVAC_COOL, CONST_HVAC_DRY, CONST_HVAC_FAN, CONST_HVAC_HEAT, CONST_HVAC_HOT_WATER, CONST_HVAC_IDLE, CONST_HVAC_OFF, ) from homeassistant.components.climate.const import ( CURRENT_HVAC_COOL, CURRENT_HVAC_D...
apache-2.0
8,073,339,454,037,373,000
23.915663
88
0.691973
false
2.506667
false
false
false
italomaia/turtle-linux
games/gHell/lib/separador.py
1
21974
import qgl import pygame from pygame.locals import * import data from scene import Scene from actions import * import pygame import view import main_menu import leafs from data import filepath from intro import Intro DADDY_FALL = 10000 # milliseconds ROJO_SANGRE = (0.8, 0.1, 0.05, 0) class Separador(Scene): de...
gpl-3.0
4,949,236,643,092,968,000
30.391429
85
0.492264
false
3.559695
false
false
false
patbeagan1/libbeagan
scripts/file_management/shard.py
1
3521
#!/usr/bin/env python3 import os import time import subprocess import argparse from sys import argv from os.path import join, getsize import hashlib import re description = """ New Script. """ verbosity = 0 verbosity_level = {'quiet': (None, -100), 'error': ('E: ', -2), 'warning': ('W: ', -1), 'inf...
mit
-5,081,354,538,176,762,000
31.601852
115
0.530815
false
3.925307
false
false
false
kaushik94/sympy
sympy/core/basic.py
1
67914
"""Base class for all the objects in SymPy""" from __future__ import print_function, division from collections import defaultdict from itertools import chain from .assumptions import BasicMeta, ManagedProperties from .cache import cacheit from .sympify import _sympify, sympify, SympifyError from .compatibility import ...
bsd-3-clause
-4,783,632,093,631,095,000
31.479197
103
0.5283
false
4.146407
false
false
false
Zulan/PBStats
tests/Updater/Mods/Updater/Assets/Python/Extras/simplejson.py
4
33784
import sre_parse, sre_compile, sre_constants from sre_constants import BRANCH, SUBPATTERN from re import VERBOSE, MULTILINE, DOTALL import re import cgi import warnings _speedups = None class JSONFilter(object): def __init__(self, app, mime_type='text/x-json'): self.app = app self.mi...
gpl-2.0
-2,590,146,868,092,183,600
34.405172
79
0.547626
false
4.177569
false
false
false
BenWiederhake/House-Of-Tweets
tools/PhotoMiner/checkout_hot_poli.py
1
9492
#!/usr/bin/env python3 # NOTE: Before running this script, you may want to either get my cache, # or run 'fetch.py' from the branch 'crawler-fetch'. import json import nice import os import subprocess # If True: # - only export images where CHOICES_PRIORITY is still relevant # (i.e., more than one image and no...
gpl-3.0
-5,207,065,709,094,016,000
23.952632
486
0.507171
false
2.940155
false
false
false
jrichte43/ProjectEuler
Problem-0402/solutions.py
1
1258
__problem_title__ = "Integer-valued polynomials" __problem_url___ = "https://projecteuler.net/problem=402" __problem_description__ = "It can be shown that the polynomial + 4 + 2 + 5 is a multiple of 6 " \ "for every integer . It can also be shown that 6 is the largest " \ ...
gpl-3.0
-311,755,246,571,413,500
38.03125
100
0.52442
false
3.652047
false
false
false
idegtiarov/gnocchi-rep
gnocchi/storage/__init__.py
1
6326
# -*- encoding: utf-8 -*- # # Copyright © 2014-2015 eNovance # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
7,452,011,963,883,705,000
30.625
79
0.62087
false
4.432376
false
false
false
gytdau/holiday-thingy
holiday_bot/Messenger.py
1
1372
import json class Messenger: """ Messenger is a wrapper for either a Message or SlackClient instance. """ def __init__(self, service, channel=None): self.service = service self.service_type = type(service).__name__ self.channel = channel def reply(self, message): if...
mit
3,061,471,265,636,078,600
33.3
94
0.599125
false
4.035294
false
false
false
DuCorey/bokeh
bokeh/sampledata/airports.py
15
1027
""" The data in airports.json is a subset of US airports with field elevations > 1500 meters. The query result was taken from .. code-block:: none http://services.nationalmap.gov/arcgis/rest/services/GlobalMap/GlobalMapWFS/MapServer/10/query on October 15, 2015. """ from __future__ import absolute_import from b...
bsd-3-clause
113,116,088,189,705,220
37.037037
98
0.69036
false
3.389439
false
true
false
baskiotisn/soccersimulator
soccersimulator/mdpsoccer.py
1
22276
# -*- coding: utf-8 -*-< import math import threading from collections import namedtuple from threading import Lock from copy import deepcopy from .utils import Vector2D, MobileMixin from .events import SoccerEvents from . import settings from .utils import dict_to_json import random import time import zipfile import t...
gpl-2.0
6,704,401,290,783,556,000
40.405204
148
0.565092
false
3.493726
false
false
false
sapcc/monasca-api
monasca_tempest_tests/tests/api/helpers.py
1
5784
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP # # 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 ...
apache-2.0
-6,628,142,678,852,287,000
33.224852
85
0.591805
false
4.119658
false
false
false
OstapHEP/ostap
ostap/math/covtransform.py
1
4364
#!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================= ## @file ostap/math/covtransform.py # Transformation of covariance matrices # for \f$ y = y ( x ) \f$, it gets # \f$ C_y = J C_x J^\mathrm{T} \f$, # where \f$ J = \left( \frac{\parti...
bsd-3-clause
-2,332,939,205,737,670,000
36.619469
86
0.35472
false
3.499599
false
false
false
tensorflow/tfx
tfx/orchestration/portable/execution_watcher.py
1
4660
# Copyright 2021 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-8,736,963,928,753,540,000
36.28
80
0.700215
false
4.138544
false
false
false
AdaDoom3/AdaDoom3
Tools/compile-materials.py
1
5285
## textures/base_door/light_panel1 ## { ## qer_editorimage textures/base_door/stedoorframe2.tga ## bumpmap textures/base_door/stedoorframe2_local.tga ## diffusemap textures/base_door/stedoorframe2_d.tga ## specularmap textures/base_door/stedoorframe2_s.tga ## { ## if ( parm7 == 0 ) ## blend a...
gpl-3.0
-8,753,381,104,364,044,000
25.293532
106
0.541154
false
2.989253
false
false
false
darth-dodo/what_2_watch
data_import.py
1
1541
from reddit_to_csv import sub2csv import csv import sqlite3 '''insert into table sub_categories first''' '''make sure constraints are met''' # -- for foreign_keys support (on delete cascade) # --con.execute("PRAGMA foreign_keys = ON") for python def csv_2_list(csv_name): with open(csv_name) as f: data = ...
mit
-1,786,287,117,802,510,000
29.82
103
0.651525
false
2.786618
false
false
false
bskari/sparkfun-avc
control/test/benchmark.py
1
3105
"""Benchmarks the parts of the system.""" import time from control.command import Command from control.simple_waypoint_generator import SimpleWaypointGenerator from control.location_filter import LocationFilter from control.telemetry import Telemetry from control.test.dummy_driver import DummyDriver from control.test...
mit
755,614,114,784,942,000
29.145631
88
0.648953
false
3.86675
false
false
false
davidyezsetz/kuma
vendor/packages/translate-toolkit/translate/filters/helpers.py
7
2818
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2006 Zuza Software Foundation # # This file is part of translate. # # translate 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...
mpl-2.0
-5,246,357,640,311,967,000
41.059701
100
0.726757
false
3.78255
true
false
false
blacknred0/mdup
main.py
1
9061
''' Created on Feb 28, 2017 @contact: Irving Duran @author: irving.duran@gmail.com @summary: Collect and send via SMS your current month data usage. ''' # TODO: Rewrite to accept one high-level argument (instead of two separate) # python scripts to be used an an input in crontab import os import datetime import...
apache-2.0
-2,506,896,233,334,858,000
56.713376
128
0.526432
false
4.021749
false
false
false
Shinoby1992/xstream
resources/lib/handler/pluginHandler.py
1
6324
import sys import os import json from resources.lib.config import cConfig from resources.lib import common, logger class cPluginHandler: def __init__(self): self.addon = common.addon self.rootFolder = common.addonPath self.settingsFile = os.path.join(self.rootFolder, 'resources'...
gpl-3.0
7,924,670,292,942,928,000
37.279503
97
0.545225
false
4.481928
false
false
false
mscuthbert/abjad
abjad/tools/abjadbooktools/test/test_LaTeXDocumentHandler_syntax_error.py
1
2098
# -*- encoding: utf-8 -*- import platform import unittest from abjad.tools import abjadbooktools from abjad.tools import systemtools @unittest.skipIf( platform.python_implementation() != 'CPython', 'Only for CPython.', ) class TestLaTeXDocumentHandler_syntax_error(unittest.TestCase): def test_syntax_...
gpl-3.0
3,024,261,067,868,072,000
28.152778
70
0.513346
false
4.221328
true
false
false
hayatoy/dataflow-tutorial
tutorial7.py
1
2908
# -*- coding: utf-8 -*- # WindowでGroupByの区間を区切る import apache_beam as beam # Dataflowの基本設定 # ジョブ名、プロジェクト名、一時ファイルの置き場を指定します。 options = beam.options.pipeline_options.PipelineOptions() gcloud_options = options.view_as( beam.options.pipeline_options.GoogleCloudOptions) gcloud_options.job_name = 'dataflow-tutorial7' ...
apache-2.0
-6,978,195,330,371,331,000
32.5
110
0.724295
false
2.305927
false
false
false
brandicted/nefertari-es
tests/test_fields.py
2
7580
import datetime from mock import Mock, patch import pytest from elasticsearch_dsl.exceptions import ValidationException from elasticsearch_dsl.utils import AttrList from nefertari_es import fields from .fixtures import ( id_model, story_model, tag_model, person_model, parent_model, ) class TestF...
apache-2.0
5,352,501,933,605,441,000
30.583333
74
0.575858
false
3.651252
true
false
false
quequino/Revolution
script.tvguidedixie/gui.py
1
72339
# # Copyright (C) 2014 Sean Poyser - With acknowledgement to some original code by twinther (Tommy Winther) # # 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, or (at you...
gpl-2.0
1,359,988,126,903,621,000
36.55919
235
0.611883
false
3.807917
false
false
false
elenaoat/AutobahnPython
examples/websocket/multiproto/server2.py
19
2348
############################################################################### ## ## Copyright 2013 Tavendo GmbH ## ## 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-2.0
-3,127,271,166,840,233,500
30.306667
79
0.618825
false
4.480916
false
false
false
slavik-m/genetic-algorithm
src/python/genetic_algorithm.py
1
7108
__author__ = 'ViS' import random import math import itertools M = 10 class Individual: def __init__(self, num, val, fitness): self.num = num self.val = val self.fitness = M - fitness class Population: def __init__(self): self.individuals = [] self.fitness_avg = 0 ...
mit
-7,957,650,740,815,945,000
32.214953
118
0.549522
false
3.914097
false
false
false
jsbronder/inhibitor
inhibitor/actions.py
1
5706
import os import shutil import util import glob import tarfile import types class InhibitorAction(object): """ Basic action. Handles running through the action_sequence and catching errors that can be passed back up in order to do cleaning first. @param name - String representing this action ...
bsd-3-clause
-7,309,664,444,589,774,000
34.886792
93
0.545566
false
4.155863
false
false
false
istb-mia/miapy
miapy/data/creation/writer.py
1
3795
import abc import os import numpy as np import h5py import miapy.data.indexexpression as expr class Writer(metaclass=abc.ABCMeta): """Represents the abstract dataset writer.""" def __enter__(self): self.open() return self def __exit__(self, exc_type, exc_val, exc_tb): self.clos...
apache-2.0
-5,185,869,669,824,150,000
28.192308
101
0.596838
false
3.977987
false
false
false
davismathew/netbot-django
bootcamp/utils/loadconfig.py
1
1081
import os import ConfigParser from bootcamp.settings import ENVIRONMENT def readconf(): config = ConfigParser.ConfigParser() config.read('/etc/netaut.conf') return config # def project_path(type): # config = readconf() # if type == 'project': # path = config.get('paths', 'project_path') ...
mit
8,785,802,740,819,030,000
29.055556
56
0.617946
false
3.410095
true
false
false
mc706/task-burndown
task_burndown/urls.py
1
1091
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static from django.views.generic import TemplateView urlpatterns = patterns('', url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), ...
mit
-8,829,211,339,080,916,000
46.434783
100
0.690192
false
3.474522
false
true
false
tomsimonart/GLM-web-interface
GLM/source/libs/rainbow.py
1
3798
#!/usr/bin/env python3 # By Infected # 2016 import os import sys def check_verbosity(): dir = os.path.dirname(__file__) abs_path = os.path.join(dir, '../../verbosity') try: with open(abs_path, 'r') as verbosity: VERBOSITY = int(verbosity.readline()) # Verbosity level SVERBO...
mit
268,586,680,848,380,480
24.266667
79
0.480475
false
3.651252
false
false
false
ecreall/lagendacommun
lac/views/admin_process/edit_smart_folder.py
1
1673
# Copyright (c) 2014 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi from pyramid.view import view_config from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS from pontus.default_behavior import Cancel from pontus.form impo...
agpl-3.0
974,138,662,456,670,800
30
81
0.637776
false
3.810934
false
false
false
Samreay/ChainConsumer
chainconsumer/colors.py
1
2969
# -*- coding: utf-8 -*- from matplotlib.colors import rgb2hex import matplotlib.pyplot as plt import numpy as np # Colours drawn from material designs colour pallet at https://material.io/guidelines/style/color.html class Colors(object): def __init__(self): self.color_map = { "blue": "#1976D2...
mit
1,061,258,463,298,375,700
33.126437
140
0.496127
false
3.412644
false
false
false
ekaputra07/wpcdesk
wpcdesk/comment_editor.py
1
4371
# -*- coding: utf-8 -*- # wpcdesk - WordPress Comment Desktop # Copyright (C) 2012 Eka Putra - ekaputra@balitechy.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 ...
gpl-3.0
4,248,496,486,360,316,000
39.472222
157
0.653855
false
3.732707
false
false
false
selectel/pyte
benchmark.py
1
1226
""" benchmark ~~~~~~~~~ A simple script for running benchmarks on captured process output. Example run:: $ BENCHMARK=tests/captured/ls.input python benchmark.py ..................... ls.input: Mean +- std dev: 644 ns +- 23 ns :copyright: (c) 2016-2021 by pyte authors and ...
lgpl-3.0
7,462,292,348,859,635,000
25.085106
79
0.628874
false
3.659701
false
false
false
codelieche/codelieche.com
apps/wenjuan/models/question.py
1
3710
# -*- coding:utf-8 -*- from django.db import models from account.models import User class Job(models.Model): """ 问卷 Model """ name = models.SlugField(verbose_name="网址", max_length=40, unique=True) title = models.CharField(verbose_name="标题", max_length=128) questions = models.ManyToManyField(v...
mit
3,347,785,241,776,150,500
31.990291
116
0.645968
false
2.975482
false
false
false
ingof/ems-collector
tools/ems-gen-graphs.py
1
4875
#!/usr/bin/python # -*- coding: utf-8 -*- import contextlib import errno import os import subprocess import sys import time mysql_socket_path = "/var/run/mysqld/mysqld.sock" mysql_user = "emsdata" mysql_password = "emsdata" mysql_db_name = "ems_data" @contextlib.contextmanager def flock(path, wait_delay = 1): whi...
gpl-3.0
6,674,389,353,177,872,000
33.28169
126
0.577034
false
3.232404
false
false
false
stefan-andritoiu/upm
examples/python/grovecollision.py
4
2277
#!/usr/bin/env python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without ...
mit
4,105,925,778,254,278,000
36.95
73
0.72332
false
4.177982
false
false
false
aplicatii-romanesti/allinclusive-kodi-pi
.kodi/addons/plugin.video.kidsplace/channels/nickjr.py
1
2501
import urllib, re import helper import json thisChannel = "nickjr" baseLink = "http://www.nickjr.com" apiLink = "http://www.nickjr.com/common/data/kids/get-kids-config-data.jhtml?fsd=/dynaboss&urlAlias=%s&af=false" extractPlaylist = re.compile("<h2 id=\".*?\"><span>(.*?)</span></h2>.*?<ul>(.*?)</ul>",re.DOTALL) def ...
apache-2.0
-8,844,964,255,450,748,000
32.346667
161
0.637745
false
3.352547
false
false
false
robocomp/robocomp-robolab
components/hardware/external_control/joystickSimulatorController/src/specificworker.py
1
4413
# # Copyright (C) 2019 by Bartlomiej Kocot # # This file is part of RoboComp # # RoboComp 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) a...
gpl-3.0
-6,077,114,154,922,575,000
31.688889
80
0.722864
false
2.725757
false
false
false
hgrimelid/feincms
feincms/admin/filterspecs.py
1
3277
# encoding=utf-8 # Thanks to http://www.djangosnippets.org/snippets/1051/ # # Authors: Marinho Brandao <marinho at gmail.com> # Guilherme M. Gondim (semente) <semente at taurinus.org> from django.contrib.admin.filterspecs import FilterSpec, ChoicesFilterSpec from django.utils.encoding import smart_unicode fro...
bsd-3-clause
7,906,961,818,176,670,000
35.010989
135
0.615197
false
3.698646
false
false
false
endlessm/chromium-browser
third_party/libvpx/source/libvpx/tools/3D-Reconstruction/MotionEST/MotionEST.py
7
3453
## Copyright (c) 2020 The WebM project authors. All Rights Reserved. ## ## Use of this source code is governed by a BSD-style license ## that can be found in the LICENSE file in the root of the source ## tree. An additional intellectual property rights grant can be found ## in the file PATENTS. All contributing p...
bsd-3-clause
-3,653,202,839,931,690,500
28.512821
71
0.609904
false
3.06117
false
false
false
tkw1536/PythonCaseClass
case_class/exceptions.py
1
6411
""" Exceptions for the case_class module Copyright (c) 2016 Tom Wiesing -- licensed under MIT, see LICENSE """ class CaseClassException(Exception): """ Base Exception for all exceptions raised by the case_class module. """ pass # # Instantiation of CaseClasses # class NotInstantiableClassException(CaseCla...
mit
-2,436,562,700,801,174,000
27.367257
79
0.609265
false
4.689832
false
false
false
kambysese/mne-python
mne/tests/test_morph.py
4
42270
# -*- coding: utf-8 -*- # Author: Tommy Clausner <Tommy.Clausner@gmail.com> # # License: BSD (3-clause) import os.path as op import pytest import numpy as np from numpy.testing import (assert_array_less, assert_allclose, assert_array_equal) from scipy.spatial.distance import cdist from scipy...
bsd-3-clause
4,909,157,670,620,142,000
41.826748
79
0.630447
false
3.168428
true
false
false
molmod/hipart
hipart/tests/test_scripts.py
1
2143
# -*- coding: utf-8 -*- # HiPart is a program to analyze the electronic structure of molecules with # fuzzy-atom partitioning methods. # Copyright (C) 2007 - 2012 Toon Verstraelen <Toon.Verstraelen@UGent.be> # # This file is part of HiPart. # # HiPart is free software; you can redistribute it and/or # modify it under t...
gpl-3.0
-2,299,937,459,381,667,000
32.484375
111
0.677555
false
3.256839
false
false
false
samcheck/Scripts
py3/BingBackground/bing_background.py
1
2674
#!/usr/bin/env python3 # bing_background.py - downoads the bing homepage background and sets it as the # desktop backgroud. import logging import os from urllib.request import urlopen import time from bs4 import BeautifulSoup from selenium import webdriver from pyvirtualdisplay import Display d...
mit
5,856,054,562,960,298,000
31.216867
101
0.652206
false
3.653005
false
false
false
Plain-Andy-legacy/android_external_chromium_org
build/android/adb_logcat_printer.py
44
7089
#!/usr/bin/env python # # Copyright (c) 2012 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. """Shutdown adb_logcat_monitor and print accumulated logs. To test, call './adb_logcat_printer.py <base_dir>' where <base_dir> c...
bsd-3-clause
-6,038,289,180,201,884,000
32.28169
79
0.659472
false
3.540959
false
false
false
msincenselee/vnpy
vnpy/gateway/oanda/oanda_common.py
1
2259
import time from datetime import datetime, timedelta, timezone from typing import TYPE_CHECKING from vnpy.trader.constant import Direction, Interval, OrderType, Status if TYPE_CHECKING: # noinspection PyUnresolvedReferences from vnpy.gateway.oanda import OandaGateway # noqa STATUS_OANDA2VT = { "PENDING"...
mit
1,327,175,221,755,135,500
25.267442
71
0.684816
false
2.980211
false
false
false
Sungup/Undine
undine/utils/system.py
1
1063
from __future__ import print_function from collections import namedtuple import multiprocessing import platform import socket import sys class System: @staticmethod def is_window(): return platform.system() == 'Windows' @staticmethod def is_linux(): return platform.system() == 'Linux...
mit
4,274,021,166,244,103,700
21.145833
80
0.631232
false
3.823741
false
false
false
pwwang/bioprocs
bioprocs/scripts/imtherapy/pVACseq.py
1
3365
from pathlib import Path from diot import Diot from bioprocs.utils import shell2 as shell from bioprocs.utils.reference import vcfIndex from bioprocs.utils.tsvio2 import TsvReader, TsvWriter, TsvRecord {% from os import path %} {% from pyppl.utils import alwaysList %} infile = {{i.infile | quote}} afile = {{i.afi...
mit
6,464,409,861,217,951,000
48.485294
717
0.682021
false
2.73355
false
false
false
Temzasse/ntu-crysis
server/crysis/cms/facebookUpdate/facebook.py
1
1198
from facepy import GraphAPI from django.conf import settings import os # Initialize the Graph API with a valid access token (optional, # but will allow you to do all sorts of fun stuff). # oauth_access_token = 'EAABZC0OOt2wQBAOcKcpbbYiuFyEONLyqOsdUrODvEBLXq6ZCPXBcI1oZA4UZCPrIkXcZBOzkF9ue0AXNRAEjeE4tfJHy4GwjGfT4CZArvk...
mit
-7,475,239,108,665,978,000
26.227273
211
0.732888
false
2.312741
false
false
false
kmjungersen/pyscan
pyscan/main.py
1
3076
""" pyscan ====== main.py This file houses the core of the application """ # imports import csv import pprint import requests from bs4 import BeautifulSoup from pyscan.local import * class Barcode(): def __init__(self, barcode_id=None, barcode_ids=None, autosave=False): """ :return: ...
apache-2.0
1,413,329,931,169,230,300
16.780347
79
0.491873
false
4.213699
false
false
false
spacemansteve/AdsDataSqlSync
tests/tests/test_metrics.py
2
8763
import sys import os PROJECT_HOME = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../')) sys.path.append(PROJECT_HOME) import unittest from datetime import datetime from mock import Mock, patch from adsdata.metrics import Metrics from adsdata.models import NonBibTable class metrics_test(unittest.TestCa...
gpl-3.0
3,286,390,973,501,658,600
55.173077
139
0.584161
false
3.408401
true
false
false
tdsymonds/djangocms-typedjs
setup.py
1
1343
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='djangocms-t...
mit
-8,282,335,474,856,264,000
30.756098
82
0.600894
false
3.699725
false
true
false
lilsweetcaligula/Online-Judges
lintcode/medium/convert_sorted_list_to_balanced_bst/py/convert_sorted_list_to_balanced_bst.py
1
1225
# coding:utf-8 ''' @Copyright:LintCode @Author: lilsweetcaligula @Problem: http://www.lintcode.com/problem/convert-sorted-list-to-balanced-bst @Language: Python @Datetime: 17-02-16 16:14 ''' """ Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val se...
mit
-7,702,063,534,747,963,000
22.576923
78
0.537143
false
3.79257
false
false
false