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
HewlettPackard/oneview-ansible
library/oneview_network_set_facts.py
1
4474
#!/usr/bin/python # -*- coding: utf-8 -*- ### # Copyright (2016-2020) Hewlett Packard Enterprise Development 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/licen...
apache-2.0
-7,717,356,519,994,723,000
25.790419
104
0.673894
false
anntzer/scikit-learn
sklearn/utils/_estimator_html_repr.py
1
9497
from contextlib import closing from contextlib import suppress from io import StringIO from string import Template import uuid import html from sklearn import config_context class _VisualBlock: """HTML Representation of Estimator Parameters ---------- kind : {'serial', 'parallel', 'single'} ...
bsd-3-clause
-6,215,935,959,145,116,000
28.77116
87
0.605349
false
zack3241/incubator-airflow
airflow/operators/docker_operator.py
1
9407
# -*- 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 ...
apache-2.0
-7,895,282,612,694,790,000
38.860169
100
0.613586
false
openstack/yaql
yaql/language/conventions.py
1
1410
# Copyright (c) 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
-6,692,259,790,340,050,000
28.375
78
0.680851
false
henry0312/LightGBM
python-package/lightgbm/basic.py
1
150238
# coding: utf-8 """Wrapper for C API of LightGBM.""" import ctypes import json import os import warnings from collections import OrderedDict from copy import deepcopy from functools import wraps from logging import Logger from tempfile import NamedTemporaryFile from typing import Any, Dict, List, Set, Union import num...
mit
6,481,589,992,037,159,000
41.512168
161
0.553914
false
llvm/llvm-zorg
zorg/buildbot/builders/AnnotatedBuilder.py
1
3401
from buildbot.process.properties import WithProperties from buildbot.steps.shell import SetProperty from zorg.buildbot.commands.AnnotatedCommand import AnnotatedCommand from zorg.buildbot.process.factory import LLVMBuildFactory def getAnnotatedBuildFactory( script, clean=False, depends_on_projects=None, ...
apache-2.0
84,255,668,484,032,700
34.427083
81
0.628051
false
cbitterfield/JobCard
archive/bulkvideosize.py
1
3578
#!/opt/local/bin/python # encoding: utf-8 ''' bulkvideosize -- shortdesc bulkvideosize is a description It defines classes_and_methods @author: user_name @copyright: 2017 organization_name. All rights reserved. @license: license @contact: user_email @deffield updated: Updated ''' import sys import ...
gpl-3.0
-261,463,053,978,957,760
28.089431
149
0.58161
false
Dapid/pywt
demo/dwt_signal_decomposition.py
1
1789
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import numpy as np import matplotlib.pyplot as plt import pywt ecg = np.load(os.path.join('data', 'ecg.npy')) data1 = np.concatenate((np.arange(1, 400), np.arange(398, 600), np.arange(601, 1024))) x = np.linspa...
mit
5,571,234,884,135,789,000
23.847222
80
0.536613
false
danrg/RGT-tool
src/RGT/XML/SVG/Attribs/xlinkAttributes.py
1
4217
from RGT.XML.SVG.Attribs.basicSvgAttribute import BasicSvgAttribute from types import StringType class XlinkAttributes(BasicSvgAttribute): ATTRIBUTE_XLINK_HREF = 'xlink:href' ATTRIBUTE_XLINK_SHOW = 'xlink:show' ATTRIBUTE_XLINK_ACTUATE = 'xlink:actuate' ATTRIBUTE_XLINK_TYPE = 'xlink:type' ...
mit
2,037,298,200,612,529,700
32.867769
85
0.564857
false
hsnr-gamera/gamera
gamera/gui/gaoptimizer/StopCriteriaPanel.py
1
4654
# # Copyright (C) 2012 Tobias Bolten # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed i...
gpl-2.0
-2,199,924,503,062,840,000
46.489796
94
0.613666
false
BenKaehler/q2-feature-classifier
q2_feature_classifier/tests/__init__.py
1
1162
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2019, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
-7,658,275,673,037,822,000
32.2
78
0.598107
false
kalyan02/dayone
do/lib.py
1
2300
from BeautifulSoup import BeautifulSoup as Soupify import urllib, re import settings import oauth2, urlparse, json from do import settings class DropboxAPI(object): def __init__(self, user): self.user = user dinfo = self.user.social_auth.get(provider='dropbox') access_token = urlparse.parse_qs( dinfo.extra_da...
gpl-2.0
-606,869,924,962,227,300
33.863636
126
0.677391
false
cfobel/sconspiracy
Python/racy/plugins/qt/sconstools/qt4.py
1
21143
# ***** BEGIN LICENSE BLOCK ***** # Sconspiracy - Copyright (C) IRCAD, 2004-2010. # Distributed under the terms of the BSD Licence as # published by the Open Source Initiative. # ****** END LICENSE BLOCK ****** """SCons.Tool.qt Tool-specific initialization for Qt. There normally shouldn't be any need to import th...
bsd-3-clause
6,324,493,422,340,307,000
38.593633
130
0.593577
false
terrelln/python-zstandard
tests/test_train_dictionary.py
1
2899
import sys import unittest import zstandard as zstd from . common import ( make_cffi, ) if sys.version_info[0] >= 3: int_type = int else: int_type = long def generate_samples(): samples = [] for i in range(128): samples.append(b'foo' * 64) samples.append(b'bar' * 64) sam...
bsd-3-clause
-5,757,206,112,141,331,000
25.842593
69
0.574336
false
jpopelka/fabric8-analytics-worker
f8a_worker/solver.py
1
37059
"""Classes for resolving dependencies as specified in each ecosystem.""" import anymarkup from bs4 import BeautifulSoup from collections import defaultdict from functools import cmp_to_key import logging from lxml import etree from operator import itemgetter from pip._internal.req.req_file import parse_requirements fr...
gpl-3.0
-6,675,852,524,338,168,000
35.320588
100
0.562799
false
JohnLunzer/flexx
flexx/ui/widgets/_html.py
1
3211
""" Simple example: .. UIExample:: 75 from flexx import app, ui class Example(ui.Widget): def init(self): with ui.html.UL(): ui.html.LI(text='foo') ui.html.LI(text='bar') .. UIExample:: 150 from flexx import app, ui, ev...
bsd-2-clause
-7,527,310,105,070,645,000
27.415929
82
0.540953
false
oskyar/test-TFG
TFG/urls.py
1
2144
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.auth.views import login, logout_then_login from django.views.static import serve import logging from importlib import import_module from django.conf import settings from TFG.apps.ha...
gpl-2.0
830,453,397,419,805,600
34.7
90
0.668534
false
dingzg/onepanel
lib/module/user.py
1
10650
#!/usr/bin/env python2.6 #-*- coding: utf-8 -*- # Copyright [OnePanel] # # 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 b...
apache-2.0
-5,547,206,471,437,395,000
33.801347
100
0.543731
false
Fat-Zer/FreeCAD_sf_master
src/Tools/updatefromcrowdin.py
11
12203
#!/usr/bin/python #*************************************************************************** #* * #* Copyright (c) 2009 Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
-2,449,099,759,645,174,300
44.87594
156
0.588462
false
tlksio/tlksio
env/lib/python3.4/site-packages/logilab/astng/mixins.py
1
4348
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-astng. # # logilab-astng is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as publis...
mit
-2,813,748,875,574,029,000
34.639344
81
0.635005
false
naturali/tensorflow
tensorflow/python/kernel_tests/variable_scope_test.py
1
35348
# Copyright 2015 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
-7,995,408,519,929,527,000
40.931198
80
0.606286
false
craigderington/striker_api
tutorial/snippets/views4.py
1
1130
from snippets.models import Snippet from snippets.serializers import SnippetSerializer from rest_framework import mixins from rest_framework import generics class SnippetList(mixins.ListModelMixin, mixins.CreateModelMixin, generics.GenericAPIView): queryset = Snippet.objects.al...
gpl-3.0
2,336,629,355,937,926,000
30.388889
54
0.659292
false
bretttegart/treadmill
lib/python/treadmill/runtime/linux/image/native.py
1
18468
"""A collection of native images. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import errno import glob import io import logging import os import pwd import shutil import stat from treadmill import appcfg from...
apache-2.0
-8,521,182,695,245,798,000
30.038655
79
0.589398
false
catalpainternational/OIPA
OIPA/api/v3/resources/csv_serializer.py
1
7048
from __future__ import print_function from future import standard_library standard_library.install_aliases() import csv import io from tastypie.serializers import Serializer import string class CsvSerializer(Serializer): formats = ['json', 'xml', 'csv'] content_types = { 'json': 'application/json', ...
agpl-3.0
7,082,719,169,658,676,000
37.939227
591
0.462684
false
ClimbsRocks/auto_ml
tests/advanced_tests/automated_tests.py
1
1586
from collections import OrderedDict import os import sys sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path os.environ['is_test_suite'] = 'True' import classifiers as classifier_tests import regressors as regressor_tests training_parameters = { 'model_names': ['DeepLearning', 'GradientBoosting', ...
mit
-5,031,269,755,627,746,000
45.647059
191
0.747793
false
hlange/LogSoCR
.waf/waflib/extras/use_config.py
1
5505
#!/usr/bin/env python # coding=utf-8 # Mathieu Courtois - EDF R&D, 2013 - http://www.code-aster.org """ When a project has a lot of options the 'waf configure' command line can be very long and it becomes a cause of error. This tool provides a convenient way to load a set of configuration parameters from a local file ...
agpl-3.0
2,054,614,675,661,956,600
29.247253
142
0.702997
false
madedotcom/photon-pump
test/conversations/test_read_all_events_stream_conversation.py
1
4703
from asyncio import Queue from uuid import uuid4 import pytest from photonpump import messages as msg, exceptions from photonpump import messages_pb2 as proto from photonpump.conversations import ReadAllEvents @pytest.mark.asyncio async def test_read_all_request(): output = Queue() convo = ReadAllEvents(m...
mit
23,669,084,093,015,520
26.828402
86
0.672549
false
unixunion/python-libsolace
bin/solace-list-clients.py
1
4986
#!/usr/bin/env python """ Show solace clients and counts, optionally pump all stats into influxdb """ import logging import sys logging.basicConfig(format='[%(module)s] %(filename)s:%(lineno)s %(asctime)s %(levelname)s %(message)s', stream=sys.stderr) import libsolace.settingsloader as settings...
mit
-2,089,378,427,571,660,000
37.953125
140
0.609306
false
sonicyang/TIE
src/forwarder/dev-bluetooth.py
1
4067
#!/usr/bin/env python # # Copyright (C) 2013 AcoMo Technology. # All rights reserved. # # Authored by Jyun-Yu Huang <yillkid@acomotech.com> # # This is a bluetooth forwarder. # # AcoMo forwarder bridge sensor and server, the protocol of client (sensor) is bluetooth RFCOMM, # and the protocol of server is XML-RPC. # # ...
gpl-2.0
5,352,912,468,466,347,000
23.208333
96
0.681338
false
ingadhoc/sale
sale_require_ref/__manifest__.py
1
1503
############################################################################## # # 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 Public License as # pub...
agpl-3.0
5,450,806,373,730,809,000
33.159091
78
0.566201
false
espensirnes/paneltime
paneltime/system/system_arguments.py
1
8361
#!/usr/bin/env python # -*- coding: utf-8 -*- #This module contains the arguments class used to handle regression arguments import numpy as np import functions as fu import stat_functions as stat class arguments: """Sets initial arguments and stores static properties of the arguments""" def __init__(self,panel, a...
gpl-3.0
7,984,326,016,556,555,000
28.234266
139
0.668222
false
praekelt/panya-event
event/models.py
1
1514
from django.db import models from django.core.urlresolvers import reverse from ckeditor.fields import RichTextField from panya.models import ModelBase PROVINCES = ( ('Eastern Cape', 'Eastern Cape'), ('Free State', 'Free State'), ('Gauteng', 'Gauteng'), ('KwaZulu-Natal', 'KwaZulu-Natal'), ('Limpopo...
bsd-3-clause
7,660,587,681,568,411,000
28.115385
83
0.637384
false
xindiguo/pythonSynapseUtils
pythonSynapseUtils/synutils.py
1
4081
#!/usr/bin/env python import argparse import os import sys import synapseclient import hashlib import string script_path = os.path.dirname(__file__) local_module_path = os.path.abspath(os.path.join(script_path,'lib')) sys.path.append(local_module_path) import s3 STATIC_BUCKET = "static.synapse.org" def create_html...
apache-2.0
-1,364,867,809,172,800,000
33.008333
144
0.645675
false
dddomodossola/remi
examples/onclose_window_app.py
1
1513
""" Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed ...
apache-2.0
-3,865,904,934,796,648,400
34.186047
121
0.662921
false
opentripplanner/OTPQA
hreport.py
1
2481
import simplejson as json import numpy as np def parsetime(aa): if aa is None: return None return float( aa.split()[0] ) def main(filenames): if len(filenames)==0: return yield "<html>" yield """<head><style>table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { text-ali...
gpl-3.0
-7,302,979,014,916,302,000
24.854167
204
0.614672
false
gnowledge/OTM2
opentreemap/treemap/plugin.py
1
3086
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.conf import settings from django.db.models import Q from django.test.signals import setting_changed from django.dispatch import receiver from treemap.lib import get_functio...
gpl-3.0
-6,459,698,252,821,900,000
30.814433
79
0.692158
false
pdamodaran/yellowbrick
yellowbrick/text/dispersion.py
1
10916
# yellowbrick.text.dispersion # Implementations of lexical dispersions for text visualization. # # Author: Larry Gray # Created: 2018-06-21 10:06 # # Copyright (C) 2018 District Data Labs # For license information, see LICENSE.txt # # ID: dispersion.py [] lwgray@gmail.com $ """ Implementation of lexical dispersion ...
apache-2.0
-2,299,755,290,369,907,200
33.764331
84
0.588402
false
lucasberti/telegrao-py
plugins/apex.py
1
2106
import requests import json from api import send_message ENDPOINT = "https://public-api.tracker.gg/apex/v1/standard/profile/5/" PLAYERS = { 14160874: "bertoncio", 16631085: "beartz", 85867003: "R3TCH4", 52451934: "xisteaga", 10549434: "Axasdas123", 123123862: "MeroFabio", 569341...
mit
2,123,689,757,657,363,200
25
93
0.561254
false
DecipherOne/Troglodyte
Trog Build Dependencies/Python26/Lib/bsddb/test/test_all.py
1
16100
"""Run all test cases. """ import sys import os import unittest try: # For Pythons w/distutils pybsddb import bsddb3 as bsddb except ImportError: # For Python 2.3 import bsddb if sys.version_info[0] >= 3 : charset = "iso8859-1" # Full 8 bit class cursor_py3k(object) : def __init__(s...
mit
-3,441,069,557,960,012,300
29.666667
88
0.511677
false
vik001ind/RSAExploits
RSAExploits/exploits/hastad.py
1
3524
""" Class defintion for simple hastad broadcast exploit """ from RSAExploits import util from RSAExploits.exploits.exploit import Exploit class Hastad(Exploit): """ Class providing a run interface to hastad broadcast exploit""" def run(self, rsadata_list, info_dict = None): """ Attempts to recove...
mit
-132,503,831,933,218,540
33.891089
80
0.542849
false
aschleg/mathpy
mathpy/special/gamma.py
1
1555
# encoding=utf8 import numpy as np def k_function(n): r""" Returns the K-function up to a given integer n. Parameters ---------- n : int The length of the returned K-function as in :math:`K(n)`. Returns ------- array-like numpy array of the computed integers returne...
mit
-6,329,161,334,717,358,000
21.867647
114
0.573633
false
maarteninja/ml2014
three/minimize.py
1
8935
#This program is distributed WITHOUT ANY WARRANTY; without even the implied #warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # #This file contains a Python version of Carl Rasmussen's Matlab-function #minimize.m # #minimize.m is copyright (C) 1999 - 2006, Carl Edward Rasmussen. #Python adaptation ...
gpl-2.0
-1,338,693,259,614,311,000
49.196629
97
0.484835
false
rande/python-element
element/plugins/disqus/disqus.py
1
1405
# # Copyright 2014 Thomas Rabaix <thomas.rabaix@gmail.com> # # 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
-9,126,190,087,776,498,000
29.565217
91
0.659786
false
GiulioRossetti/ndlib
ndlib/models/epidemics/IndependentCascadesModel.py
1
3628
from ..DiffusionModel import DiffusionModel import numpy as np import future.utils __author__ = 'Giulio Rossetti' __license__ = "BSD-2-Clause" __email__ = "giulio.rossetti@gmail.com" class IndependentCascadesModel(DiffusionModel): """ Edge Parameters to be specified via ModelConfig :param thresh...
bsd-2-clause
-6,692,687,738,186,138,000
35.28
118
0.507993
false
Northeaster/TargetSentimentAnalysis
lib/rnn_cells/gru_cell.py
1
1575
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from lib.rnn_cells.base_cell import BaseCell from lib import linalg #*************************************************************** clas...
apache-2.0
-7,597,540,596,920,359,000
34.795455
68
0.486984
false
cbenhagen/kivy
kivy/uix/textinput.py
1
108858
# -*- encoding: utf-8 -*- ''' Text Input ========== .. versionadded:: 1.0.4 .. image:: images/textinput-mono.jpg .. image:: images/textinput-multi.jpg The :class:`TextInput` widget provides a box for editable plain text. Unicode, multiline, cursor navigation, selection and clipboard features are supported. The :cl...
mit
6,712,873,367,837,512,000
34.263362
80
0.549193
false
gregpuzzles1/Sandbox
Example Programs/Ch_12_Student_Files/teststudent.py
1
1833
""" File: teststudent.py Unit test suite for the Student class. """ from student import Student import unittest class TestStudent(unittest.TestCase): """Defines a unit test suite for the Student class.""" def setUp(self): """Sets up the test fixture. Scores are 1-5.""" self._student = Student...
gpl-3.0
2,613,367,701,992,044,500
28.095238
61
0.578833
false
robcarver17/systematictradingexamples
plots_for_perhaps/compareoptmethods.py
1
22426
import numpy as np import matplotlib.pyplot as plt from matplotlib.pyplot import plot, show, xticks, xlabel, ylabel, legend, yscale, title, savefig, rcParams, figure, hist, text, bar, subplots import Image def file_process(filename): fig = plt.gcf() fig.set_size_inches(18.5,10.5) fig.savefig("/home/rob/%s....
gpl-2.0
4,701,163,412,939,915,000
30.408964
147
0.66463
false
anchore/anchore-engine
tests/integration/subsys/auth/stores/test_basic_store.py
1
5494
import json import unittest from anchore_engine.db import session_scope from anchore_engine.subsys import identities from anchore_engine.subsys.identities import AccountTypes, UserAccessCredentialTypes from anchore_engine.subsys.auth.stores import basic as basic_accountstore from yosai.core import UsernamePasswordToken...
apache-2.0
-7,519,868,430,979,338,000
31.508876
93
0.542956
false
bqbn/addons-server
src/olympia/users/tests/test_user_utils.py
1
1451
# -*- coding: utf-8 -*- import pytest from olympia.amo.tests import user_factory from olympia.users.utils import ( UnsubscribeCode, system_addon_submission_allowed) def test_email_unsubscribe_code_parse(): email = u'nobody@mozîlla.org' token, hash_ = UnsubscribeCode.create(email) r_email = Unsubscri...
bsd-3-clause
2,683,786,618,169,446,000
31.133333
76
0.707469
false
maxive/erp
addons/google_drive/models/google_drive.py
9
11240
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging import json import re import requests import werkzeug.urls from odoo import api, fields, models from odoo.exceptions import RedirectWarning, UserError from odoo.tools import pycompat from odoo.tools.safe_...
agpl-3.0
3,801,002,757,147,754,000
48.515419
201
0.611833
false
vst/normalazy
normalazy.py
1
27657
import copy import datetime from collections import OrderedDict from decimal import Decimal from functools import wraps from six import add_metaclass #: Defines the version of the `normalazy` library. __version__ = "0.0.3" def iffnotnull(func): """ Wraps a function, returns None if the first argument is Non...
bsd-2-clause
2,155,762,320,283,130,600
28.674893
120
0.576599
false
janhahne/nest-simulator
pynest/nest/tests/test_connect_arrays.py
1
3293
# -*- coding: utf-8 -*- # # test_connect_arrays.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the Lic...
gpl-2.0
-6,105,020,392,207,008,000
36
78
0.641057
false
CIECODE-Madrid/tipi-engine
stats/process_stats.py
1
6001
from tipi_data.models.stats import Stats from tipi_data.models.topic import Topic from tipi_data.models.initiative import Initiative class GenerateStats(object): def __init__(self): self.topics = Topic.objects() self.subtopics = self.topics.distinct('tags.subtopic') self.stats = Stats() ...
gpl-3.0
3,043,947,720,192,462,300
41.864286
130
0.481753
false
DayGitH/Python-Challenges
DailyProgrammer/DP20120723C.py
1
1700
""" [7/23/2012] Challenge #80 [difficult] (Multi-word anagrams) https://www.reddit.com/r/dailyprogrammer/comments/x0vj7/7232012_challenge_80_difficult_multiword_anagrams/ In [today's easy problem](http://www.reddit.com/r/dailyprogrammer/comments/x0v3e/7232012_challenge_80_easy_anagrams/), we investigated anagrams tha...
mit
8,144,650,209,013,004,000
55.666667
119
0.752941
false
mercycorps/tola-activity
htdocs/activitydb/migrations/0037_auto_20151028_1631.py
1
1470
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('activitydb', '0036_auto_20151028_1519'), ] operations = [ migrations.AlterField( model_name='siteprofile', ...
gpl-2.0
-7,011,314,465,358,522,000
35.75
168
0.6
false
williamthegrey/swift
test/probe/test_object_metadata_replication.py
1
30416
#!/usr/bin/python -u # Copyright (c) 2010-2012 OpenStack Foundation # # 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 ap...
apache-2.0
-900,956,658,026,259,200
39.500666
79
0.57233
false
srajag/contrail-controller
src/config/device-manager/device_manager/db.py
1
14129
# # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # """ This file contains implementation of data model for physical router configuration manager """ from vnc_api.common.exceptions import NoIdError from physical_router_config import PhysicalRouterConfig from sandesh.dm_introspect import ttypes as sand...
apache-2.0
-7,415,153,349,394,149,000
33.972772
84
0.544978
false
sl4shme/pplloopp
images/shaddock/mistral/configparse.py
1
2038
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2014 Thibaut Lapierre <root@epheo.eu>. 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 # # ...
apache-2.0
166,885,613,919,734,000
36.740741
78
0.677134
false
globocom/database-as-a-service
dbaas/drivers/tests/test_driver_pymongo.py
1
9370
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os from mock import patch, MagicMock from drivers import DriverFactory from physical.tests import factory as factory_physical from logical.tests import factory as factory_logical from logical.models import Database from drivers.mon...
bsd-3-clause
-8,187,081,293,294,255,000
36.48
79
0.649733
false
aliyun/aliyun-oss-python-sdk
tests/test_utils.py
1
14543
# -*- coding: utf-8 -*- import unittest import oss2 from oss2.exceptions import make_exception import os import sys import tempfile import requests import datetime import locale import io from functools import partial from .common import * import logging try: xrange except NameError: xrange = range is_p...
mit
-59,843,685,782,884,540
36.318766
115
0.581112
false
rcomer/iris
lib/iris/tests/unit/fileformats/cf/test_CFReader.py
1
14385
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Unit tests for the `iris.fileformats.cf.CFReader` class. """ # Import iris.tests first so that some things can be initial...
lgpl-3.0
7,296,252,401,670,800,000
39.407303
79
0.583455
false
Impavidity/kim_cnn
model.py
1
2614
import torch import torch.nn as nn import torch.nn.functional as F class KimCNN(nn.Module): def __init__(self, config): super(KimCNN, self).__init__() output_channel = config.output_channel target_class = config.target_class words_num = config.words_num words_dim = config.w...
mit
-8,031,420,437,314,376,000
43.305085
116
0.590283
false
sony/nnabla
python/src/nnabla/backward_function/greater_equal_scalar.py
1
1032
# Copyright 2019,2020,2021 Sony Corporation. # # 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...
apache-2.0
-4,171,969,917,226,927,600
34.586207
86
0.738372
false
Dzess/ALFIRT
alfirt.runner/src/readers/tests/TagReaderX3DUnitTests.py
1
4002
''' Created on Jun 9, 2011 @author: Piotr ''' import unittest import os from readers.TagReaderX3D import TagReaderX3D class TagReaderX3DUnitTests(unittest.TestCase): def setUp(self): # Setting up the X3D string with ALFIRT namespace tags x3dString = """<?xml version="1.0" encoding="UTF-8"?> <!...
mit
5,748,462,383,747,537,000
32.07438
155
0.615942
false
cloud-fan/spark
python/pyspark/pandas/internal.py
1
68330
# # 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,017,516,604,919,470,000
39.052755
100
0.549305
false
Russell-IO/ansible
lib/ansible/plugins/action/gather_facts.py
1
1434
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type from collections import MutableMapping from ansible import constants as C from ansible.plugins.acti...
gpl-3.0
-5,338,959,078,966,732,000
33.97561
148
0.640167
false
h1ds/h1ds
h1ds/h1ds/migrations/0010_auto__chg_field_nodepath_parent.py
1
11299
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'NodePath.parent' db.alter_column(u'h1ds_nodepath', 'parent_id', self.gf('django.db.models...
mit
7,576,822,004,211,700,000
67.902439
187
0.543588
false
SCPR/firetracker
calfire_tracker/utilities.py
1
3930
from django.conf import settings from django.db import models from django.utils.encoding import smart_str from django.utils import timezone from django.template.defaultfilters import slugify from geopy import geocoders import pytz import time import datetime import requests import logging logger = logging.getLogger("f...
gpl-2.0
-4,657,212,522,448,050,000
48.125
236
0.622901
false
AlexEKoren/grumpy
compiler/stmt_test.py
1
14166
# coding=utf-8 # Copyright 2016 Google 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 required by app...
apache-2.0
3,293,463,276,318,064,600
28.94926
97
0.567203
false
h2oloopan/easymerge
EasyMerge/tests/beets/ui/migrate.py
1
13881
# This file is part of beets. # Copyright 2013, Adrian Sampson. # # 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, ...
mit
-8,236,018,070,992,035,000
32.367788
77
0.610187
false
tinyms/ArchiveX
tinyms/controller/setting.py
1
3046
__author__ = 'tinyms' #coding=UTF8 from sqlalchemy import func from tinyms.core.common import Utils from tinyms.core.web import IAuthRequest from tinyms.core.entity import Account from tinyms.core.orm import SessionFactory from tinyms.core.annotation import ObjectPool, route, setting, api from tinyms.core.setting imp...
bsd-3-clause
-2,948,846,204,067,711,000
30.925532
108
0.576
false
phobson/statsmodels
statsmodels/tools/tests/test_tools.py
1
20793
""" Test functions for models.tools """ from statsmodels.compat.python import lrange, range import numpy as np from numpy.random import standard_normal from numpy.testing import (assert_equal, assert_array_equal, assert_almost_equal, assert_string_equal, TestCase) from nose.tools import (asse...
bsd-3-clause
-8,172,001,138,678,050,000
36.943431
83
0.581879
false
IonAgorria/SysWatcher
modules/smart.py
1
2212
import logging from subprocess import run, PIPE from module import Module from utils import break_lines, show_message __author__ = 'Ion Agorria' class Smart(Module): name = "SMART" def __init__(self, modules): super().__init__(modules) self.update_notified = [] def run(self): ""...
gpl-3.0
-7,410,101,434,767,311,000
35.866667
96
0.55651
false
jcnix/shade
social/auth.py
1
2295
from django.contrib import auth from django.contrib.auth.models import User from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, render_to_response from django.template import RequestContext import forms as myforms def login(request): if not request.user.is_authenticated(...
gpl-3.0
-197,508,900,974,582,820
37.898305
85
0.554684
false
CoachCoen/games
settings.py
1
2112
from vector import Vector class Config: """ Configuration - mostly the (relative) position of various screen elements """ # TODO: Work this out dynamically tabletop_size = Vector(1368, 768) scaling_factor = 1 card_size = Vector(100, 120) card_spacing = 10 column_width = card_si...
mit
-4,934,462,521,332,214,000
24.445783
78
0.645833
false
pierrelux/mathnotes
mathnotes/views/auth.py
1
1936
from flask_oauthlib.client import OAuth from mathnotes.models import db, ZoteroAuthorization from flask import Flask, redirect, url_for, render_template, jsonify, Response, current_app, Blueprint, request from flask.ext.login import login_required, current_user oauth = OAuth() auth = Blueprint('auth', __name__, url_p...
bsd-3-clause
237,288,060,501,950,180
32.964912
111
0.668388
false
malaterre/dicom-private-dicts
re/pms/dump1.py
1
3032
#!/usr/bin/env python """ dump 1 """ import sys, json from struct import * array=[] def doit(f): chunk = f.read(0x2) l0 = unpack('>H', chunk) assert l0[0] == 50 chunk = f.read(l0[0]) s = unpack('>%ds' % l0[0], chunk) chunk = f.read(0x1) l2 = unpack('>B', chunk) #assert l2[0] == 0 ...
bsd-3-clause
-5,247,748,825,108,255,000
26.315315
77
0.581464
false
parksandwildlife/wastd
taxonomy/migrations/0003_auto_20181022_1156.py
1
3205
# Generated by Django 2.0.8 on 2018-10-22 03:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('taxonomy', '0002_auto_20180926_1147'), ] operations = [ migrations.AlterField( model_name='hbvfamily', name='class_n...
mit
3,855,156,913,284,721,700
40.089744
132
0.582527
false
jamespcole/home-assistant
homeassistant/components/openuv/binary_sensor.py
1
3751
"""Support for OpenUV binary sensors.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.util.dt import as_local, parse_datetime, utcnow from . import (...
apache-2.0
5,144,571,123,839,647,000
32.491071
72
0.625966
false
gokmen/Rasta
rasta_lib/model.py
1
1631
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Rasta RST Editor 2010 - Gökmen Göksel <gokmeng:gmail.com> ''' # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as Published by the Free # Software Foundation; either version 2 of the License,...
gpl-2.0
9,176,064,816,522,145,000
32.9375
79
0.654389
false
mdavoodi/konkourse-python
messages/views.py
1
2496
# Create your views here. from django.http import HttpResponse from django.template import loader from django.template.context import Context from django.template import RequestContext from django.shortcuts import redirect from django.shortcuts import render from conversation.models import ConvoWall, ConversationPost ...
mit
-7,466,661,102,449,948,000
37.4
92
0.648638
false
jelly/calibre
src/calibre/gui2/tweak_book/ui.py
1
39312
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os from functools import partial from itertools import product from f...
gpl-3.0
1,148,555,098,009,233,500
49.142857
159
0.604777
false
andrewlewis/camera-id
test_characteristic.py
1
1197
#!/usr/bin/env python from make_characteristic import get_noise_from_file import cPickle import glob import numpy import sys from PIL import Image, ImageOps TILE_OVERLAP = 8 if len(sys.argv) != 3: print "Usage:\n\t%s noise_file_name path_with_png_files" % (sys.argv[0],) sys.exit(0) noise_file_name = sys.argv[...
mit
6,780,480,121,013,508,000
29.692308
76
0.675856
false
mitodl/micromasters
dashboard/api_edx_cache_test.py
1
21604
""" Tests for the dashboard APIs functions that deal with the edx cached data """ from datetime import timedelta from unittest.mock import patch, MagicMock, ANY import ddt from requests.exceptions import HTTPError from edx_api.certificates.models import Certificate, Certificates from edx_api.enrollments.models import...
bsd-3-clause
3,159,953,239,633,138,000
47.767494
116
0.679133
false
unt-libraries/django-nomination
nomination/migrations/0004_auto_20190927_1904.py
1
7862
# -*- coding: utf-8 -*- # Generated by Django 1.11.24 on 2019-09-27 19:04 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('nomination', '0003_project_archive_url'), ] opera...
bsd-3-clause
2,851,599,570,489,149,000
43.670455
343
0.598067
false
medunigraz/outpost
src/outpost/django/kages/api.py
1
1284
import logging import ldap from rest_framework import ( exceptions, permissions, viewsets, ) from rest_framework.response import Response from . import models from .conf import settings logger = logging.getLogger(__name__) class TranslateViewSet(viewsets.ViewSet): permission_classes = ( per...
bsd-2-clause
-7,632,317,316,049,999,000
26.319149
65
0.576324
false
jscn/django
django/contrib/contenttypes/models.py
1
7319
from __future__ import unicode_literals from django.apps import apps from django.db import models from django.db.utils import IntegrityError, OperationalError, ProgrammingError from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ class Cont...
bsd-3-clause
8,636,261,011,933,846,000
37.119792
105
0.585872
false
Acidburn0zzz/archiso-gui
releng/root-image/usr/share/cnchi/src/misc.py
1
28903
#!/usr/bin/python # -*- coding: UTF-8 -*- # # Copyright (c) 2012 Canonical Ltd. # Copyright (c) 2013 Antergos # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, o...
gpl-3.0
-3,050,432,571,631,182,000
30.484749
79
0.558593
false
bytedance/fedlearner
test/data_join/test_data_portal_job_manager.py
1
8196
# Copyright 2021 The FedLearner 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
402,065,272,321,751,940
36.424658
79
0.599683
false
mosbasik/fluidspaces
src/fluidspaces/i3_commands.py
1
1215
import subprocess class i3Commands(object): @staticmethod def send_to_wp(i3_name): '''Send the currently focused window/container to the named workspace''' subprocess.Popen(['i3-msg', 'move container to workspace', i3_name], stdout=subprocess.PIPE) @staticmethod def go_to_wp(i3_name)...
mit
-4,274,740,972,160,197,000
32.75
100
0.604938
false
gigglearrows/anniesbot
pajbot/models/timer.py
1
6625
import json import logging from pajbot.models.db import DBManager, Base from pajbot.models.action import ActionParser from pajbot.tbutil import find from sqlalchemy import orm from sqlalchemy import Column, Integer, String, Boolean from sqlalchemy.dialects.mysql import TEXT log = logging.getLogger('pajbot') class ...
mit
-3,706,695,500,516,823,600
38.201183
135
0.616453
false
white-lab/pyproteome
brainrnaseq/__init__.py
1
2373
from . import cache, mapping, enrichments CELL_TYPE_COLS = { 'Homo sapiens': { 'Astrocyte': [ '8yo', '13yo', '16yo', '21yo.1', '22yo.1', '35yo', '47yo', '51yo', '53yo', '60yo', '63yo - 1', '63yo - 2', ], 'Neuron': [ '25yo', ], ...
bsd-2-clause
7,507,329,908,707,769,000
21.6
79
0.435735
false
arthur-e/gass
public/views.py
1
3181
import datetime from django.shortcuts import render_to_response from django.http import HttpResponse from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist from django.views.decorators.cache import cache_page from public.models import News from bering.models import Station, Ablation ...
mit
8,327,074,673,310,716,000
29.009434
77
0.61773
false
synthesio/infra-ovh-ansible-module
plugins/modules/dedicated_server_install.py
1
2843
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.module_utils.basic import AnsibleModule DOCUMENTATION = ''' --- module: dedicated_server_install short_description: Install a new dedicated server description: - Install ...
mit
5,904,091,304,778,387,000
27.148515
143
0.646148
false
certik/sfepy
tests/test_parsing.py
1
3180
from sfepy.base.testing import TestCommon ## # 16.07.2007, c class Test( TestCommon ): ## # 16.07.2007, c def from_conf( conf, options ): return Test( conf = conf, options = options ) from_conf = staticmethod( from_conf ) ## # c: 16.07.2007, r: 08.07.2008 def test_parse_equations(...
bsd-3-clause
-26,389,724,490,425,080
33.193548
80
0.416981
false
robtherad/BC-Mod
tools/make.py
1
56000
#!/usr/bin/env python3 # vim: set fileencoding=utf-8 : # make.py # An Arma 3 addon build system # Created by ACE 3 team, modified by BC: https://github.com/acemod/ACE3 ############################################################################### # The MIT License (MIT) # Copyright (c) 2013-2014 Ryan Schultz # Per...
gpl-3.0
-626,459,769,304,963,800
37.780471
227
0.56901
false
waidyanatha/pingsam
visualize.py
1
8668
import numpy as np import datetime as dtm from dateutil import rrule import pandas as pd import csv import matplotlib.pylab as plt import sys, os #lets first create the csv file # #change this to actual csv file name pingfile="weeklylogs.csv" #paramters @plotinterval = 10 minutes plotinterval = 10 #csv file columns col...
mit
-8,745,131,300,681,286,000
48.531429
121
0.639132
false
pbauman/libmesh
doc/statistics/libmesh_pagehits.py
1
10542
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Import stuff for working with dates from datetime import datetime from matplotlib.dates import date2num # Hits/month, pages, and gigabytes served. # To get the Google analytics data: # .) Go to analytics.google.com. # .) There should be (as o...
lgpl-2.1
-5,319,884,989,136,103,000
36.119718
131
0.525232
false
not-na/peng3d
peng3d/gui/layout.py
1
8877
#!/usr/bin/env python # -*- coding: utf-8 -*- # # layout.py # # Copyright 2020 notna <notna@apparat.org> # # This file is part of peng3d. # # peng3d 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, ei...
gpl-2.0
-6,435,422,355,169,676,000
30.038462
198
0.600315
false