repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
marlengit/BitcoinUnlimited
qa/rpc-tests/prioritise_transaction.py
1
6053
#!/usr/bin/env python3 # Copyright (c) 2015 The Bitcoin Core developers # Copyright (c) 2015-2016 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test PrioritiseTransaction code # from test_fr...
mit
-2,588,565,102,612,625,400
41.034722
128
0.63324
false
fource/fource
your_hacks/aditya/fource_http.py
1
3453
import requests class HttpClass(object): """ Generate an HTTP Request. Accepts request parameters as params_dict during init. Accepted Parameters: HTTP URL as url - String HTTP Method as method - String HTTP Headers as headers - Dictionary HTTP Basic Auth as auth - Tuple Query String/P...
mit
-181,291,372,744,618,340
42.708861
146
0.631045
false
BillBillBillBill/WishTalk-server
WishTalk/api/image.py
1
2980
# -*- coding: utf-8 -*- #!/usr/bin/env python import os import uuid from api import api, GlobalError from flask import request, Response from model.image import Image as Image_model from server import db from util.jsonResponse import jsonSuccess, jsonError from config import UPLOAD_PATH from werkzeug.utils import secu...
mit
163,071,177,810,335,070
33.252874
106
0.597651
false
miniconfig/home-assistant
homeassistant/components/climate/zwave.py
1
7581
""" Support for Z-Wave climate devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.zwave/ """ # Because we do not compile openzwave on CI # pylint: disable=import-error import logging from homeassistant.components.climate import DOMAIN from h...
mit
5,530,945,481,629,688,000
33.775229
103
0.601108
false
DOAJ/doaj
doajtest/unit/test_article_prepare_update_publisher.py
1
3830
from parameterized import parameterized from combinatrix.testintegration import load_parameter_sets from doajtest.fixtures import ArticleFixtureFactory, AccountFixtureFactory, JournalFixtureFactory from doajtest.helpers import DoajTestCase from portality.bll import DOAJ from portality.bll import exceptions from portal...
apache-2.0
-1,273,290,277,358,624,500
41.566667
130
0.677807
false
JeroenZegers/Nabu-MSSS
nabu/postprocessing/reconstructors/deepclusteringnoise_reconstructor.py
1
5366
"""@file deepclusteringnoise_reconstructor.py contains the reconstor class using deep clustering for modified noise architecture""" from sklearn.cluster import KMeans import mask_reconstructor from nabu.postprocessing import data_reader import numpy as np import os class DeepclusteringnoiseReconstructor(mask_reconst...
mit
-6,201,207,245,161,696,000
38.455882
114
0.726239
false
arg-hya/taxiCab
Tools/Misc/TaskPointGenerator.py
1
1502
import json import shapefile as shp import matplotlib.pyplot as plt import random def mean(numbers): return float(sum(numbers)) / max(len(numbers), 1) numbersX = [] numbersY = [] TaskPoints = {} shpFilePath = r"D:\TaxiCab\mycode\Plots\ShapefileAndTrajectory\taxi_zones\taxi_zones" sf = shp.Reader(shpFil...
gpl-3.0
-1,998,065,879,706,729,000
24.033333
115
0.66245
false
Chipe1/aima-python
tests/test_mdp.py
2
8327
import pytest from mdp import * random.seed("aima-python") sequential_decision_environment_1 = GridMDP([[-0.1, -0.1, -0.1, +1], [-0.1, None, -0.1, -1], [-0.1, -0.1, -0.1, -0.1]], term...
mit
-2,294,445,903,934,735,400
48.565476
117
0.403507
false
comjoy91/SouthKorean-legislativeElection-history
crawlers/election_results/crawlers/assembly/base.py
1
9308
#!/usr/bin/env python3 # -*- coding=utf-8 -*- ############### is proportional in parse! import gevent from gevent import monkey import itertools from urllib.parse import urljoin from utils import flatten, get_json, get_xpath, parse_cell, sanitize, split monkey.patch_all() class BaseCrawler(object): url_image_ba...
apache-2.0
3,233,375,519,743,952,000
33.586873
202
0.66142
false
Jyrsa/hoppy.fi
beerstatus/tasks.py
1
11309
import logging from django.conf import settings from django.template.defaultfilters import slugify from django.utils import timezone from huey.djhuey import db_periodic_task from huey.djhuey import crontab from huey.djhuey import db_task import pytz import requests import json import datetime from beerstatus import mo...
mit
4,492,921,484,083,990,000
35.363344
92
0.56203
false
acidjunk/django-scrumboard
scrumtools/apps/scrumboard/views.py
1
7382
from django.views.generic import ListView, TemplateView from django.views.generic.detail import DetailView from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.forms.models import modelform_factory from django.core.urlresolvers import reverse_lazy from django.shortcuts import render fro...
gpl-3.0
-6,036,080,027,663,365,000
29.382716
107
0.652533
false
dalejung/edamame
edamame/tools/follow.py
1
9062
import inspect import gc import sys import os.path import difflib from collections import OrderedDict import pandas as pd from pandas.core.common import in_ipnb def is_property(code): """ Using some CPython gc magics, check if a code object is a property gc idea taken from trace.py from stdlib """ ...
mit
-7,262,418,995,845,113,000
31.24911
80
0.537078
false
Nuevosmedios/django-badger
badger/migrations/0012_auto__add_field_badge_assignment_badge.py
1
10979
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Badge.assignment_badge' db.add_column(u'badger_badge', 'a...
bsd-3-clause
-2,302,220,583,995,254,000
82.816794
195
0.554149
false
argriffing/arb
doc/source/conf.py
1
8167
# -*- coding: utf-8 -*- # # Arb documentation build configuration file, created by # sphinx-quickstart on Thu Oct 11 09:33:44 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All con...
lgpl-2.1
4,570,452,874,068,180,000
31.027451
81
0.697563
false
compas-dev/compas
src/compas/numerical/ga/ga.py
1
31945
from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import random import json import copy __all__ = ['ga'] TPL = """ GA summary ========== - fitness function name: {} - fitnes function type : {} - number of generations : {} - number of individuals ...
mit
-830,581,242,874,230,100
38.389642
135
0.564595
false
v-a/check_mk
web/htdocs/index.py
1
13788
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
gpl-2.0
4,738,782,860,625,158,000
41.294479
131
0.570859
false
unicefuganda/rapidsms-bednets
bednets/view_helpers.py
1
3046
import datetime import xlwt from time import strftime from mtrack.utils import write_xls from django.http import HttpResponse from django.db import connection def generate_excel_response(data, headings): book = xlwt.Workbook(encoding="utf8") write_xls(sheet_name="BedNets Report", headings=headings, data=data, ...
bsd-3-clause
-170,221,384,607,029,760
45.151515
192
0.674655
false
twneale/hercules
hercules/dict.py
1
5018
import functools from hercules.loop_interface import IteratorWrapperBase class KeyClobberError(KeyError): pass class NoClobberDict(dict): '''An otherwise ordinary dict that complains if you try to overwrite any existing keys. ''' KeyClobberError = KeyClobberError def __setitem__(self, key, ...
bsd-3-clause
3,272,178,730,380,776,000
28.345029
79
0.521722
false
interDist/pasportaservo
hosting/forms/places.py
1
11530
from collections import namedtuple from datetime import date from django import forms from django.contrib.auth import get_user_model from django.utils.text import format_lazy from django.utils.translation import ugettext_lazy as _ from core.models import SiteConfiguration from maps.widgets import MapboxGlWidget from...
agpl-3.0
-1,749,623,336,786,708,500
40.775362
111
0.57719
false
krasch/smart-assistants
examples/visualize_habits.py
1
1689
# -*- coding: UTF-8 -*- """ Plot visualization of user habits, i.e. show which actions typically follow some given user action. Note: the figure for "Frontdoor=Closed" slightly deviates from Figure 1 in the paper and Figure 5.1 in the dissertation (see paper_experiments.py for bibliographical information). The numb...
mit
-6,601,924,424,743,180,000
43.447368
116
0.778567
false
macosforge/ccs-calendarserver
twistedcaldav/test/test_extensions.py
1
9681
# -*- coding: utf-8 -*- ## # Copyright (c) 2009-2017 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
-730,047,790,414,134,700
34.054348
132
0.657571
false
twosigma/beaker-notebook
beakerx/beakerx_magics/java_magic.py
1
1242
# Copyright 2017 TWO SIGMA OPEN SOURCE, 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 agr...
apache-2.0
-1,441,257,565,892,691,500
31.684211
74
0.732689
false
andrewor14/iolap
python/pyspark/ml/param/__init__.py
2
8455
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
432,614,469,154,766,200
32.027344
95
0.59657
false
hrashk/sympy
sympy/plotting/textplot.py
1
2000
from __future__ import print_function, division from sympy import * def textplot(expr, a, b, W=55, H=18): """ Print a crude ASCII art plot of the SymPy expression 'expr' (which should contain a single symbol, e.g. x or something else) over the interval [a, b]. Examples ======== textplot...
bsd-3-clause
-2,627,293,115,692,088,000
25.315789
89
0.4125
false
vamin/MESS.DB
mess/utils.py
1
5267
# -*- coding: utf-8 -*- # Copyright 2013-2014 Victor Amin, http://vamin.net/ """MESS.DB utilities module This module contains helper functions and classes that are used by many mess modules. """ from __future__ import print_function from __future__ import unicode_literals import argparse import hashlib import json ...
agpl-3.0
2,871,678,152,651,886,000
29.097143
79
0.569774
false
evstropov/django-webmoney-merchant
webmoney_merchant/forms.py
1
2066
import re from django import forms from django.utils.translation import ugettext_lazy as _ PURSE_RE = re.compile(r'^(?P<type>[BCDEGKRUXYZ])(?P<number>\d{12})$') WMID_RE = re.compile(r'^\d{12}$') class PaymentRequestForm(forms.Form): LMI_PAYMENT_AMOUNT = forms.DecimalField(max_digits=7, decimal_places=2, widget=f...
apache-2.0
-4,126,681,343,636,265,000
33.433333
103
0.736205
false
the76thHunter/tmdbsimple
tests/test_account.py
1
7205
# -*- coding: utf-8 -*- """ test_account.py ~~~~~~~~~~~~~~~ This test suite checks the methods of the Account class of tmdbsimple. Created by Celia Oakley on 2013-11-05 :copyright: (c) 2013-2014 by Celia Oakley. :license: GPLv3, see LICENSE for more details. """ import unittest import tmdbsimple as tmdb from test...
gpl-3.0
5,291,779,505,636,827,000
31.899543
70
0.623595
false
csb-toolbox/CSB
csb/test/cases/bio/io/mrc/__init__.py
1
2664
import csb.test as test from csb.io import MemoryStream from csb.bio.io.mrc import DensityMapReader, DensityMapWriter, DensityMapFormatError, HeaderInfo, ByteOrder @test.unit class TestDensityMapReader(test.Case): def setUp(self): super(TestDensityMapReader, self).setUp() ...
mit
-905,255,989,804,159,600
31.096386
107
0.584459
false
bayesimpact/bob-emploi
data_analysis/importer/deployments/uk/test/career_changers_test.py
1
1456
"""Tests for the bob_emploi.data_analysis.importer.deployments.uk.career_changers module.""" import io from os import path import unittest import requests_mock from bob_emploi.data_analysis.importer.deployments.uk import career_changers @requests_mock.mock() class TestCareerChangers(unittest.TestCase): """Test...
gpl-3.0
-3,983,676,365,504,305,700
29.333333
92
0.544643
false
kaochiuan/HsinchuCityWebsite
HsinchuCityWebsite/HsinchuCityWebsite/app/templateModels.py
1
1595
 class temple(object): def __init__(self, name, locateRegion, mastergod, religiousBelief, organizationType, location, phone1, phone2): self.name = name self.locateRegion = locateRegion self.mastergod = mastergod self.religiousBelief = religiousBelief self.organizationType = ...
mit
4,606,429,468,003,518,000
32.914894
115
0.655367
false
yunity/foodsaving-backend
karrot/users/factories.py
1
1082
from django.contrib.auth import get_user_model from factory import DjangoModelFactory, CREATE_STRATEGY, LazyAttribute, PostGeneration, Sequence from karrot.utils.tests.fake import faker class UserFactory(DjangoModelFactory): class Meta: model = get_user_model() strategy = CREATE_STRATEGY is_...
agpl-3.0
-8,607,476,821,204,952,000
31.787879
96
0.678373
false
inveniosoftware/invenio-oauthclient
invenio_oauthclient/views/client.py
1
8781
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Client blueprint used to handle OAuth callbacks.""" from flask import Blueprint, ...
mit
2,452,009,956,719,134,700
29.810526
77
0.639677
false
128technology/yinsolidated
test/plugin_json_test.py
1
5346
# Copyright 2016 128 Technology, Inc. """Unit tests for the yinsolidated pyang plugin""" from __future__ import unicode_literals import json import os import subprocess import pyang import pytest from yinsolidated.plugin import plugin YINSOLIDATED_PLUGIN_DIRECTORY = os.path.dirname(plugin.__file__) YIN_NAMESPAC...
mit
6,492,448,924,455,224,000
32.204969
88
0.648148
false
lepy/phuzzy
phuzzy/contrib/pydoe/doe_composite.py
1
6172
""" This code was originally published by the following individuals for use with Scilab: Copyright (C) 2012 - 2013 - Michael Baudin Copyright (C) 2012 - Maria Christopoulou Copyright (C) 2010 - 2011 - INRIA - Michael Baudin Copyright (C) 2009 - Yann Collette Copyright (C) 2009 - CEA - Jean-Marc Mart...
mit
4,254,063,885,363,651,600
36.634146
106
0.516202
false
brendanator/atari-rl
agents/training.py
1
3130
import os import tensorflow as tf from threading import Thread from networks.factory import NetworkFactory import util class Trainer(object): def __init__(self, config): util.log('Creating network and training operations') self.config = config # Creating networks factory = NetworkFactory(config) ...
mit
2,544,414,966,929,689,000
29.990099
78
0.666454
false
ibrahimsh/final-project-software-programming
HashTable.py
1
22420
__author__ = 'MatrixRev' import codecs import json import re from collections import Mapping from collections import defaultdict from collections import Counter import Levenshtein import nltk from nltk.corpus import stopwords import fileinput import string import os import collections import rdflib from rdflib.namespa...
apache-2.0
-3,101,594,761,690,827,300
36.807757
135
0.504416
false
onlineconvert/onlineconvert-api-sdk-python3
client/jobs_api.py
1
11925
#!/usr/bin/env python """ JobsApi.py Copyright 2015 SmartBear Software 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
9,035,207,243,163,449,000
29.266497
359
0.536688
false
code-kitchen/django-utensils
utensils/storage.py
1
1100
from django.conf import settings from storages.backends.s3boto import S3BotoStorage """ Store your static and media files on Amazon S3 easily. Example settings config: AWS = { 'STATIC': { 'location': 'static', # AWS_LOCATION 'querystring_auth': False, # AWS_QUERYSTRING_AU...
mit
4,000,050,045,559,622,000
31.352941
73
0.66
false
elidrc/PSO
test_pso.py
1
1192
from benchmark_functions import * from pso import * import matplotlib.pyplot as plt iterations = 100 particles = 500 dimensions = 2 search_space = [[-5.12] * dimensions, [5.12] * dimensions] # print init_pso(iterations, particles, search_space) velocity, fitness, local_best, local_position, global_best, global_positi...
mit
2,549,936,103,298,485,000
34.058824
117
0.680369
false
mjabri/holoviews
holoviews/element/path.py
1
8204
""" A Path element is a way of drawing arbitrary shapes that can be overlayed on top of other elements. Subclasses of Path are designed to generate certain common shapes quickly and condeniently. For instance, the Box path is often useful for marking areas of a raster image. Contours is also a subclass of Path but in...
bsd-3-clause
1,391,249,197,297,087,200
34.669565
90
0.624573
false
RobinQuetin/CAIRIS-web
cairis/cairis/tests/GoalTests.py
1
8342
import logging from urllib import quote import jsonpickle from Goal import Goal from GoalEnvironmentProperties import GoalEnvironmentProperties from tests.CairisTests import CairisTests __author__ = 'Robin Quetin' class GoalTests(CairisTests): # region Class fields logger = logging.getLogger(__name__) ex...
apache-2.0
-8,014,873,749,702,705,000
40.924623
156
0.587509
false
bitmazk/django-people
people/admin.py
1
2123
"""Admin classes for the ``people`` app.""" from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from hvad.admin import TranslatableAdmin from . import models class NationalityAdmin(TranslatableAdmin): """Admin for the ``Nationality`` model.""" list_display = ['get_name',...
mit
2,866,603,225,132,881,400
29.328571
75
0.659444
false
Onirik79/aaritmud
src/controllers/game_connection_comet.py
1
1690
# -*- coding: utf-8 -*- """ Modulo per la gestione della connessione al gioco con tecnologia simil-comet. """ #= IMPORT ====================================================================== from twisted.web.server import NOT_DONE_YET from src.web_resource import WebResource #= CLASSI ==========================...
gpl-2.0
3,280,582,672,710,947,000
27.59322
80
0.595139
false
sebastianlan/wedfairy-api
poll/models.py
1
1124
from django.db import models class Poll(models.Model): id = models.AutoField(primary_key=True) title = models.CharField(blank=True, null=True, max_length=255) message = models.TextField(blank=True, null=True) select = models.IntegerField(blank=True, null=True) type = models.IntegerField(blank=True...
mit
-4,689,786,348,986,709,000
32.058824
69
0.69306
false
nathanbjenx/cairis
cairis/gui/TemplateRequirementPanel.py
1
2080
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
apache-2.0
9,020,233,058,832,603,000
41.44898
104
0.774038
false
vzantedeschi/L3SVMs
validation.py
1
1853
import time import statistics from src.l3svms import * from src.utils import * args = get_args(__file__) TRAIN = args.train_file TEST = args.test_file LAND = args.nb_landmarks # default 10 CLUS = args.nb_clusters # default 1 NORM = args.norm # default False LIN = args.linear # default True PCA_BOOL = args.pca # defa...
mit
3,042,199,218,215,240,700
26.264706
101
0.689692
false
googleapis/python-kms
samples/snippets/create_key_ring.py
1
1511
# 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 agreed to in writing, s...
apache-2.0
6,052,987,254,862,620,000
31.847826
121
0.679682
false
rwl/PyCIM
CIM14/ENTSOE/Dynamics/IEC61970/Dynamics/DynamicsMetaBlockParameter.py
1
3262
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
mit
6,889,832,679,586,051,000
38.301205
109
0.704476
false
pratikgujjar/DeepIntent
code/autoencoder_model/scripts/attention_autoencoder.py
1
20029
from __future__ import absolute_import from __future__ import division from __future__ import print_function import hickle as hkl import numpy as np np.random.seed(2 ** 10) from keras import backend as K K.set_image_dim_ordering('tf') from keras.layers import Dropout from keras.models import Sequential from keras.lay...
mit
-5,578,589,266,398,006,000
36.863894
116
0.597484
false
digitalmacgyver/vedit
vedit/__init__.py
1
1074
__all__ = [ # Paths to binaries we depend on. 'FFMPEG', 'FFPROBE', # Various "constants" used in configuration. 'OVERLAY', 'CROP', 'PAD', 'PAN', 'DISPLAY_STYLES,' 'DOWN', 'LEFT', 'RIGHT', 'UP', 'OVERLAY_DIRECTIONS', 'ALTERNATE', 'PAN_DIRECTIONS', ...
mit
-2,561,378,409,578,989,600
19.653846
48
0.673184
false
gVallverdu/myScripts
CRYSTAL/crystalio.py
1
14817
#!/usr/bin/env python3 # -*- coding=utf-8 -*- """ crystailio ---------- Read a CRYSTAL output file and export all structures, SCF energies and convergence data. """ __author__ = "Germain Vallverdu" __email__ = "germain.vallverdu@univ-pau.fr" __licence__ = "GPL" import re import numpy as np from pymatgen import Stru...
gpl-2.0
5,053,067,532,660,909,000
41.213675
100
0.437943
false
emacsway/django-oembed
oembed/models.py
1
1251
import datetime from django.db import models from django.utils import simplejson from django.utils.translation import ugettext_lazy as _ JSON = 1 XML = 2 FORMAT_CHOICES = ( (JSON, "JSON"), (XML, "XML"), ) class ProviderRule(models.Model): name = models.CharField(_("name"), max_length=128, null=True, blank...
bsd-3-clause
-859,522,205,000,884,200
30.275
79
0.657074
false
lupien/pyHegel
pyHegel/instruments/agilent_smu.py
1
68624
# -*- coding: utf-8 -*- ########################## Copyrights and license ############################ # # # Copyright 2019-2019 Christian Lupien <christian.lupien@usherbrooke.ca> # # ...
lgpl-3.0
5,311,880,424,862,998,000
48.763597
176
0.546733
false
rmhyman/DataScience
Lesson3/exploratory_data_analysis_subway_data.py
1
1558
import numpy as np import pandas import matplotlib.pyplot as plt def entries_histogram(turnstile_weather): ''' Before we perform any analysis, it might be useful to take a look at the data we're hoping to analyze. More specifically, let's examine the hourly entries in our NYC subway data and d...
mit
-433,697,089,876,752,400
48.258065
159
0.716945
false
wglass/zoonado
examples/locking.py
1
1246
import logging import random from tornado import gen log = logging.getLogger() def arguments(parser): parser.add_argument( "--workers", "-w", type=int, default=3, help="Number of workers to launch." ) parser.add_argument( "--lock-path", "-p", type=str, default="examplelock", ...
apache-2.0
-1,379,920,386,763,527,400
22.074074
66
0.585875
false
TribeMedia/synapse
tests/util/test_lrucache.py
2
7584
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
6,387,675,951,914,420,000
28.281853
74
0.580169
false
jakubbrindza/gtg
GTG/plugins/export/templates.py
1
6180
# -*- coding: utf-8 -*- # Copyright (c) 2010 - Luca Invernizzi <invernizzi.l@gmail.com> # 2012 - Izidor Matušov <izidor.matusov@gmail.com> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Fou...
gpl-3.0
4,735,512,752,990,252,000
34.308571
79
0.597993
false
hrashk/sympy
release/fabfile.py
1
29364
# -*- coding: utf-8 -*- """ Fab file for releasing Please read the README in this directory. Guide for this file =================== Vagrant is a tool that gives us a reproducible VM, and fabric is a tool that we use to run commands on that VM. Each function in this file should be run as fab vagrant func Even tho...
bsd-3-clause
8,105,300,423,079,544,000
33.419695
126
0.638862
false
CharlesGulian/Deconv
fits_tools_tesla.py
1
5575
# -*- coding: utf-8 -*- """ Created on Thu Jul 14 21:18:54 2016 @author: charlesgulian """ import os #os.chdir('/Users/annepstein/Work/Deconv') curr_dir = os.getcwd() import numpy as np from astropy.io import fits import matplotlib.pyplot as plt import matplotlib #from photutils import aperture_photometry #from phot...
gpl-3.0
1,029,574,979,489,327,000
28.973118
131
0.649865
false
r39132/airflow
airflow/contrib/operators/mlengine_operator.py
1
23245
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the 'License'); you may not us...
apache-2.0
-5,851,779,120,407,853,000
36.431562
107
0.605248
false
PanDAWMS/autopyfactory
autopyfactory/plugins/queue/sched/StatusTest.py
1
1879
#! /usr/bin/env python # from autopyfactory.interfaces import SchedInterface import logging class StatusTest(SchedInterface): id = 'statustest' def __init__(self, apfqueue, config, section): try: self.apfqueue = apfqueue self.log = logging.getLogger('auto...
apache-2.0
-4,370,198,464,711,407,000
38.145833
146
0.589143
false
BD823/pcover
project_version1/booklist.py
1
3959
# -*- coding: ms949 -*- import re import json #text file read with open('GutindexAll.txt','r') as gutinfile: data=gutinfile.read() data=unicode(data, errors='replace') result = [] isStart = False for line in data.splitlines(): #if 'by': #line¿¡ ÀúÀÚ°¡ ÀÖ´Â °æ¿ì¿Í ŸÀÌÆ²¸¸ Àִ°æ¿ì¸¦ ±¸ºÐÇØ¾ßÇÒµí if i...
mit
7,297,451,816,901,036,000
40.673684
137
0.475625
false
gdl-civestav-localization/cinvestav_location_fingerprinting
experimentation/__init__.py
1
1691
import os import cPickle import matplotlib.pyplot as plt from datasets import DatasetManager def plot_cost(results, data_name, plot_label): plt.figure(plot_label) plt.ylabel('Accuracy (m)', fontsize=30) plt.xlabel('Epoch', fontsize=30) plt.yscale('symlog') plt.tick_params(axis='both', which='major...
gpl-3.0
-6,899,155,482,714,190,000
27.661017
112
0.624483
false
danxhuber/isoclassify
setup.py
1
1463
import os from setuptools import setup # Load version __version__ = None # exec(open('isoclassify/version.py').read()) # Load requirements requirements = None with open('requirements.txt') as file: requirements = file.read().splitlines() # mwdust requires manual install to download maps # TODO: add warning if `m...
mit
5,368,206,483,387,825,000
28.26
92
0.686945
false
lebauce/artub
sysfont.py
1
10522
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
gpl-2.0
4,310,771,421,104,446,500
30.78852
101
0.567953
false
asquared/openreplay
console/openreplay_console.py
1
18254
import wx import os, sys import signal import traceback all_processes = { } MAX_CAPTURES = 8 def sigchld_handler(signum, frame): (pid, status) = os.wait( ) if all_processes.has_key(pid): all_processes[pid].on_dead(status) else: print "unknown child died?" def sigint_handler(signum, frame...
gpl-3.0
-8,944,415,610,846,493,000
29.122112
150
0.549852
false
stephenmcd/ratemyflight
ratemyflight/scripts/create_project.py
1
1581
#!/usr/bin/env python import os import shutil import sys import ratemyflight class ProjectException(Exception): pass def create_project(): """ Copies the contents of the project_template directory to a new directory specified as an argument to the command line. """ # Ensure a directory na...
bsd-2-clause
-4,580,954,432,024,506,400
27.232143
79
0.649589
false
jdgwartney/meter-plugin-sdk-python
setup.py
1
1283
# # Copyright 2016 BMC Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
-3,823,786,787,623,511,000
32.763158
74
0.680436
false
hasadna/open-shot
qa/tasks.py
1
3325
import httplib from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.mail import EmailMultiAlternatives from django.contrib.sites.models import Site from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from django.templ...
bsd-3-clause
335,651,410,459,111,230
38.117647
88
0.67609
false
Newsrecommender/newsrecommender
ArticleRecommendationProject/Recommendation/Collab_Content_Based.py
1
5856
import yaml import pandas as pd import numpy as np import sys import os from math import sqrt import matplotlib import matplotlib.pyplot as plot import networkx as nx def get_script_directory(): """ This function returns the directory of the script in scrip mode In interactive mode returns interpreter name...
mit
4,368,910,734,218,285,000
38.04
198
0.715335
false
akretion/connector
connector/queue/model.py
1
16341
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
4,304,506,418,957,077,000
40.474619
87
0.553944
false
cl0ne/vital-records-registry
registry/registry/settings.py
1
3274
""" Django settings for registry project. Generated by 'django-admin startproject' using Django 1.9.4. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os ...
gpl-3.0
-2,707,232,421,402,551,000
25.192
91
0.694258
false
jabesq/home-assistant
homeassistant/components/totalconnect/alarm_control_panel.py
1
4506
"""Interfaces with TotalConnect alarm control panels.""" import logging import homeassistant.components.alarm_control_panel as alarm from homeassistant.const import ( STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, STATE_ALARM_DISARMED, STATE_ALARM_ARMING, STATE_ALARM_DISARMING, ST...
apache-2.0
-3,600,262,308,670,847,000
34.761905
76
0.612517
false
gabrielecker/DogAdoption-Backend
views/dogs.py
1
1667
# encoding: utf-8 from flask import jsonify, request from flask_login import login_required, current_user from project.app import db from project.models import Dog from utils.rest import RestView class DogAPI(RestView): schema = 'Dog' def get(self, id): page = request.args.get('page') or 1 if...
mit
-6,304,520,599,628,042,000
27.741379
67
0.587882
false
efiop/dvc
dvc/repo/experiments/base.py
1
4573
from typing import Optional from dvc.exceptions import DvcException, InvalidArgumentError # Experiment refs are stored according baseline git SHA: # refs/exps/01/234abcd.../<exp_name> EXPS_NAMESPACE = "refs/exps" EXPS_STASH = f"{EXPS_NAMESPACE}/stash" EXEC_NAMESPACE = f"{EXPS_NAMESPACE}/exec" EXEC_APPLY = f"{EXEC_N...
apache-2.0
2,720,833,934,026,154,000
30.979021
78
0.569429
false
becm/meson
mesonbuild/modules/pkgconfig.py
1
25361
# Copyright 2015 The Meson development team # 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 ...
apache-2.0
3,331,586,665,542,594,000
47.12334
130
0.550649
false
labordoc/labordoc-next
modules/bibformat/lib/bibformat_templates.py
1
86532
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of t...
gpl-2.0
7,907,009,272,232,269,000
43.420945
507
0.534947
false
stormrose-va/xobox
tests/t_cli/test_logger.py
1
1540
# -*- coding: utf-8 -*- """ tests.t_cli.test_logger ~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2017 by the Stormrose Project team, see AUTHORS. :license: MIT License, see LICENSE for details. """ import os import sys import tempfile from unittest import TestCase, skipIf from xobox.cli.logger impor...
mit
-4,778,570,877,447,688,000
27
98
0.567532
false
CORDEA/analysis_of_1000genomes-data
programs/add_annotations/missense.py
1
1346
#!/bin/env python # encoding:utf-8 # # Author: CORDEA # Created: 2014-09-12 # infile = open("ilm_missene.onmis.vcf", "r") lines = infile.readlines() infile.close() msDict = {} for line in lines: samples = line.split(",")[5] tmp = samples.split("|") for i in range(len(tmp)): try: m...
apache-2.0
-7,018,247,842,795,256,000
28.911111
70
0.531204
false
Saviio/ClawMonitor
urls.py
1
1245
from utils import current_random, current, timestring import urllib, time class urls(): def __init__(): return None @staticmethod def verify_usr(usr): return "http://login.xunlei.com/check/?u=%s&business_type=108&cachetime=%d&" % (usr, current()) @staticmethod def login(): ...
mit
-6,989,403,600,762,888,000
34.6
202
0.655422
false
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/resources/types/managed_placement_view.py
1
1296
# -*- 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
-5,183,687,149,090,668,000
28.454545
90
0.684414
false
TamiaLab/PySkCode
skcode/utility/cosmetics.py
1
1689
""" SkCode cosmetics replacement utility code. """ import re # Default cosmetics replacement map (compiled regex) DEFAULT_COSMETICS_MAP = ( (re.compile(r'(\s+)---(\s+)'), r'\1—\2'), (re.compile(r'(\s+)--(\s+)'), r'\1—\2'), (re.compile(r'\.\.\.'), r'…'), (re.compile(r'\(tm\)'), r'™'), ) # Document a...
agpl-3.0
4,560,335,722,737,678,300
30.12963
97
0.672814
false
gregbanks/suds
suds/bindings/binding.py
1
19048
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
-868,910,296,671,780,100
34.405204
87
0.569404
false
annarev/tensorflow
tensorflow/python/keras/integration_test/multi_worker_tutorial_test.py
2
13552
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-4,059,636,220,372,690,400
37.5
101
0.643669
false
stvstnfrd/edx-platform
lms/djangoapps/courseware/tests/test_context_processor.py
1
1674
""" Unit tests for courseware context_processor """ from django.contrib.auth.models import AnonymousUser from mock import Mock from lms.djangoapps.courseware.context_processor import user_timezone_locale_prefs from openedx.core.djangoapps.user_api.preferences.api import set_user_preference from common.djangoapps.stu...
agpl-3.0
-4,738,014,847,497,425,000
36.2
115
0.70908
false
destinokm/DesHabitat
backend/articles/migrations/0001_initial.py
1
1937
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-26 07:54 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Articl...
gpl-3.0
-4,343,730,946,445,375,500
33.589286
114
0.503356
false
butterscotchstallion/SpiffyRPG
SpiffyRPG/SpiffyWorld/db.py
1
1041
# -*- coding: utf-8 -*- import sqlite3 as lite import os class Database: """ Handles db connection """ def __init__(self, **kwargs): self.log = None if "log" in kwargs: self.log = kwargs["log"] if "path" in kwargs: path = kwargs["path"] ...
mit
1,049,532,641,733,517,800
23.209302
76
0.548511
false
jakevdp/klsh
klsh/hamming_ann.py
1
6489
""" This is a set of classes to perform fast (approximate) nearest neighbors searches over Hamming spaces. [1] M. Charikar. Similarity Estimation Techniques from Rounding Algorithms. ACM Symposium on Theory of Computing, 2002. """ __all__ = ["HammingANN", "HammingBrute", "HammingBallTree"] import numpy as np from...
bsd-3-clause
3,745,315,121,985,854,000
34.459016
78
0.572507
false
os2webscanner/os2webscanner
django-os2webscanner/os2webscanner/validate.py
1
3231
# The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS"basis, #...
mpl-2.0
564,477,714,231,741,000
33.741935
87
0.666357
false
nvbn/thefuck
thefuck/rules/omnienv_no_such_command.py
1
1061
import re from thefuck.utils import (cache, for_app, replace_argument, replace_command, which) from subprocess import PIPE, Popen supported_apps = 'goenv', 'nodenv', 'pyenv', 'rbenv' enabled_by_default = any(which(a) for a in supported_apps) COMMON_TYPOS = { 'list': ['versions', 'inst...
mit
-7,693,855,433,599,655,000
29.314286
80
0.655042
false
nextgis-extra/tests
lib_gdal/gdrivers/wmts.py
1
55102
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # $Id: wmts.py 33793 2016-03-26 13:02:07Z goatbar $ # # Project: GDAL/OGR Test Suite # Purpose: WMTS driver test suite. # Author: Even Rouault, even dot rouault at spatialys.com # ##########...
gpl-2.0
-4,747,166,600,107,798,000
34.734112
244
0.558582
false
HumanExposure/factotum
dashboard/views/functional_use_curation.py
1
5589
from dashboard.models.functional_use import FunctionalUseToRawChem from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import render, reverse, get_object_or_404, redirect from django.contrib.auth.decorators import login_required from django.db.models impor...
gpl-3.0
5,112,750,429,061,577,000
34.826923
86
0.615853
false
cjaymes/pyscap
src/scap/model/oval_5/sc/OvalSystemCharacteristicsElement.py
1
1356
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
gpl-3.0
-3,917,951,773,532,624,000
40.090909
105
0.662242
false
qedsoftware/commcare-hq
corehq/apps/userreports/tests/test_report_charts.py
1
5758
from django.test import SimpleTestCase from corehq.apps.userreports.models import ReportConfiguration from corehq.apps.userreports.exceptions import BadSpecError from corehq.apps.userreports.reports.factory import ChartFactory from corehq.apps.userreports.reports.specs import PieChartSpec, MultibarChartSpec, MultibarAg...
bsd-3-clause
221,100,501,716,279,600
34.109756
112
0.540292
false
acemod/ace3-misc
tools/setup.py
2
3202
#!/usr/bin/env python3 ####################### # ACEX Setup Script # ####################### import os import sys import shutil import platform import subprocess import winreg ######## GLOBALS ######### MAINDIR = "z" PROJECTDIR = "acex" ########################## def main(): FULLDIR = "{}\\{}".format(MAINDIR,...
gpl-2.0
8,127,507,055,567,471,000
31.02
209
0.599001
false
dankcoin/dankcoin
qa/rpc-tests/bipdersig.py
1
3247
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test the BIP66 changeover logic # from test_framework.test_framework import DankcoinTestFramework fr...
mit
-7,816,225,313,490,346,000
34.681319
98
0.608562
false
qedsoftware/commcare-hq
custom/apps/crs_reports/fields.py
2
1360
from corehq.apps.reports.dont_use.fields import ReportSelectField from corehq.apps.reports.filters.users import SelectCaseOwnerFilter from django.utils.translation import ugettext_noop from django.utils.translation import ugettext as _ from corehq.apps.es import CaseES def _get_blocks(domain): query = (CaseES('re...
bsd-3-clause
6,461,348,915,643,667,000
30.627907
94
0.672059
false
sayanchowdhury/fedmsg_meta_fedora_infrastructure
fedmsg_meta_fedora_infrastructure/autocloud.py
1
2497
# This file is part of fedmsg. # Copyright (C) 2015 Sayan Chowdhury. # # fedmsg 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 2.1 of the License, or (at your option) any later version...
lgpl-2.1
-6,810,911,462,513,405,000
39.274194
78
0.620344
false
ChengeLi/VehicleTracking
utilities/embedding.py
1
3427
#### embedding from sklearn.decomposition import PCA from sklearn.manifold import TSNE, MDS from mpl_toolkits.mplot3d import Axes3D class embeddings(obj): def __init__(self, model,data): self.modelChoice = model self.data = data # self.data = FeatureMtx_norm def PCA_embedding(self,n_c...
mit
-6,324,826,729,370,016,000
40.289157
164
0.640502
false
shamanu4/netmiko
netmiko/ssh_dispatcher.py
1
3921
"""Controls selection of proper class based on the device type.""" from __future__ import unicode_literals from netmiko.cisco import CiscoIosSSH from netmiko.cisco import CiscoIosTelnet from netmiko.cisco import CiscoAsaSSH from netmiko.cisco import CiscoNxosSSH from netmiko.cisco import CiscoXrSSH from netmiko.cisco i...
mit
-3,015,145,150,224,998,000
33.095652
117
0.744708
false