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
danirus/django-comments-xtd
django_comments_xtd/admin.py
1
1729
from __future__ import unicode_literals from django.contrib import admin from django_comments import get_model from django_comments.admin import CommentsAdmin from django_comments.models import CommentFlag from django_comments_xtd.models import XtdComment, BlackListedDomain class XtdCommentsAdmin(CommentsAdmin): ...
bsd-2-clause
6,129,600,062,988,580,000
34.285714
78
0.585309
false
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/conf/locale/eo/formats.py
1
2387
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j\-\a \d\e F Y' #...
mit
-3,731,351,361,881,060,400
43.903846
80
0.412652
false
marcharper/python-ternary
examples/scatter_colorbar.py
1
4211
"""An example of the colorbar display on the scatter plot.""" import ternary import matplotlib.pyplot as plt def _en_to_enth(energy, concs, A, B, C): """Converts an energy to an enthalpy. Converts energy to enthalpy using the following formula: Enthalpy = energy - (energy contribution from A) - (energy c...
mit
334,574,868,188,572,740
24.521212
112
0.560912
false
ITCase/ps_gallery
pyramid_sacrud_gallery/tests/test_models.py
1
3733
# -*- coding: utf-8 -*- # # Copyright © 2014 Petr Zelenin (po.zelenin@gmail.com) # # Distributed under terms of the MIT license. import hashlib import os import unittest import transaction from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from zope.sqlalchemy import ZopeTr...
mit
-1,741,868,866,605,887,200
33.238532
78
0.643891
false
siavashk/pycpd
testing/affine_test.py
1
1194
import pytest import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from pycpd import AffineRegistration def test_2D(): B = np.array([[1.0, 0.5], [0, 1.0]]) t = np.array([0.5, 1.0]) Y = np.loadtxt('data/fish_target.txt') X = np.dot(Y, B) + np.tile(t, (np.shape(Y)...
mit
1,301,905,175,649,250,300
30.421053
72
0.577889
false
tomprince/gemrb
gemrb/GUIScripts/Spellbook.py
1
16543
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2011 The GemRB Project # # 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) ...
gpl-2.0
-1,405,279,672,849,003,800
34.423983
112
0.708457
false
hkernbach/arangodb
3rdParty/V8/v5.7.492.77/src/js/macros.py
1
9259
# Copyright 2006-2009 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of co...
apache-2.0
-6,143,239,776,302,362,000
45.762626
161
0.696836
false
enthought/traitsbackendqt
enthought/traits/ui/qt4/image_enum_editor.py
1
12386
#------------------------------------------------------------------------------ # # Copyright (c) 2009, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions d...
gpl-2.0
-7,069,525,519,631,933,000
37.110769
80
0.516793
false
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/gtk/gdk/__init__/PixbufAnimation.py
1
1026
# encoding: utf-8 # module gtk.gdk # from /usr/lib/python2.7/dist-packages/gtk-2.0/pynotify/_pynotify.so # by generator 1.135 # no doc # imports from exceptions import Warning import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject import pango as __pango import pangocairo as __p...
gpl-2.0
4,487,719,490,974,702,000
22.318182
73
0.648148
false
ActiveState/code
recipes/Python/66426_ReadWriteLock/recipe-66426.py
1
1131
import threading class ReadWriteLock: """A lock object that allows many simultaneous "read-locks", but only one "write-lock".""" def __init__(self): self._read_ready = threading.Condition(threading.Lock()) self._readers = 0 def acquire_read(self): """Acquire a read-lock. B...
mit
3,673,597,987,764,956,700
28
68
0.555261
false
realitix/vulkan
setup.py
1
1143
from setuptools import setup with open("README.md") as file: long_description = file.read() setup( name='vulkan', version='1.1.99.1', description='Ultimate Python binding for Vulkan API', author='realitix', author_email='realitix@gmail.com', packages=['vulkan'], long_descripiton=long...
apache-2.0
-5,513,329,181,179,121,000
31.657143
71
0.634296
false
VerosK/django-dashing
dashing/widgets.py
1
2802
# -*- coding: utf-8 -*- import json from django.http import HttpResponse from django.views.generic.detail import View class JSONResponseMixin(object): """ A mixin that can be used to render a JSON response. """ def render_to_json_response(self, context, **response_kwargs): """ Returns ...
bsd-3-clause
4,210,653,318,595,151,000
22.745763
81
0.568879
false
sunqm/pyscf
pyscf/pbc/gw/krgw_ac.py
1
25949
#!/usr/bin/env python # Copyright 2014-2021 The PySCF Developers. 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 # # U...
apache-2.0
-9,168,461,443,576,111,000
35.754958
120
0.541524
false
chrislit/abydos
tests/distance/test_distance_baystat.py
1
3929
# Copyright 2018-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
gpl-3.0
6,592,109,680,175,767,000
41.247312
138
0.65691
false
shakamunyi/sahara
sahara/tests/unit/plugins/storm/test_config_helper.py
1
2392
# Copyright 2017 Massachusetts Open Cloud # # 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
-3,610,181,268,468,644,400
45
77
0.677258
false
USGM/suds
suds/sudsobject.py
1
11056
# 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
1,173,960,176,114,197,800
27.645078
84
0.510492
false
lmazuel/azure-sdk-for-python
azure-batch/azure/batch/operations/account_operations.py
1
10813
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-5,444,836,896,498,578,000
46.634361
148
0.626468
false
tombstone/models
official/nlp/nhnet/optimizer.py
1
3030
# 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
7,990,494,737,155,448,000
35.95122
80
0.690099
false
gem/oq-hazardlib
openquake/hmtk/sources/complex_fault_source.py
1
9353
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # LICENSE # # Copyright (c) 2010-2017, GEM Foundation, G. Weatherill, M. Pagani, # D. Monelli. # # The Hazard Modeller's Toolkit is free software: you can redistribute # it and/or modify it under the terms of the GNU Affero Gene...
agpl-3.0
-315,525,468,201,625,000
37.331967
79
0.63338
false
AutoGentoo/AutoGentoo
autogentoo/portage/resolve.py
1
22795
import warnings from abc import ABC, abstractmethod from queue import Queue from typing import List, Optional, Dict, Generator, Tuple, Set from autogentoo.cportage import ( get_portage, Dependency, Atom, Ebuild, UseFlag, UseOperatorT, Portage, AtomUseT, AtomUseDefaultT, Required...
gpl-3.0
1,697,455,195,590,679,300
31.940751
88
0.567624
false
rochacbruno/dynaconf
dynaconf/vendor/ruamel/yaml/scalarfloat.py
1
2326
from __future__ import print_function,absolute_import,division,unicode_literals _B=False _A=None import sys from .compat import no_limit_int from .anchor import Anchor if _B:from typing import Text,Any,Dict,List __all__=['ScalarFloat','ExponentialFloat','ExponentialCapsFloat'] class ScalarFloat(float): def __new__(D,*...
mit
-8,955,087,405,345,137,000
69.515152
311
0.677988
false
Wen777/beets
beetsplug/freedesktop.py
1
2206
# This file is part of beets. # Copyright 2014, Matt Lichtenberg. # # 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
3,143,787,163,430,786,000
30.070423
72
0.677244
false
angstwad/linky
linky/bookmarklet.py
1
1564
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2013 Paul Durivage <pauldurivage@gmail.com> # # This file is part of linky. # # 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...
apache-2.0
1,377,445,842,668,371,200
59.153846
787
0.725064
false
dokipen/trac-announcer-plugin
announcer/util/mail.py
1
3241
# -*- coding: utf-8 -*- # # Copyright (c) 2009, Robert Corsaro # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright # ...
bsd-3-clause
-2,618,730,130,924,297,700
35.829545
79
0.685591
false
HaroldMills/Vesper
vesper/signal/wave_audio_file.py
1
6118
"""Module containing class `WaveAudioFileType`.""" import os.path import wave import numpy as np from vesper.signal.audio_file_reader import AudioFileReader from vesper.signal.unsupported_audio_file_error import UnsupportedAudioFileError ''' audio_file_utils: read_audio_file(file_path) write_audio_file(fi...
mit
6,694,778,441,508,051,000
27.588785
80
0.52746
false
editxt/editxt
editxt/test/command/test_pathfind.py
1
4370
# -*- coding: utf-8 -*- # EditXT # Copyright 2007-2016 Daniel Miller <millerdev@gmail.com> # # This file is part of EditXT, a programmer's text editor for Mac OS X, # which can be found at http://editxt.org/. # # EditXT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publ...
gpl-3.0
-5,833,606,073,200,345,000
33.409449
81
0.566133
false
asshinator/CodeScraps
utilities/timinator.py
1
1604
"""This module is used to time the execution of other modules, and is executed through tasks.json""" import sys import timeit import cProfile if len(sys.argv) < 2: raise AssertionError("NoScript specified to time!") elif ".py" not in sys.argv[1]: print(str(sys.argv[1])+ " is not a python Script!") exit(1) ...
mit
1,828,312,055,412,470,800
37.214286
93
0.696384
false
rjw57/openni-skeleton-export
examples/labelbones.py
1
4166
#!/usr/bin/env python # # An example script for extracting labelled images by associating points with # their closest bone. """ Usage: labelbones.py (-h | --help) labelbones.py [--verbose] <logfile> <frame-prefix> Options: -h, --help Show a brief usage summary. -v, --verbose Increase verbosity o...
apache-2.0
-3,595,863,162,251,792,400
27.930556
78
0.56097
false
malept/gmusicprocurator
docs/conf.py
1
12282
# -*- coding: utf-8 -*- # # 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 configuration values have a default; values that are commented out # serve to show the default. import json ...
gpl-3.0
5,358,588,643,516,297,000
29.552239
82
0.693535
false
micahflee/onionshare
desktop/src/onionshare/tab/mode/receive_mode/__init__.py
1
15632
# -*- coding: utf-8 -*- """ OnionShare | https://onionshare.org/ Copyright (C) 2014-2021 Micah Lee, et al. <micah@micahflee.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 t...
gpl-3.0
5,165,836,029,262,839,000
35.269142
101
0.604273
false
YingYang/STFT_R_git_repo
MNE_stft/mne_stft_regression_individual_G.py
1
12643
# -*- coding: utf-8 -*- """ Created on Tue Apr 1 12:55:06 2014 @author: ying """ import mne import numpy as np #import matplotlib.pyplot as plt from mne.minimum_norm.inverse import (apply_inverse, _check_method, _check_ori, prepare_inverse_operator, _pick_channels_inverse_operator, _check_ch_names, ...
gpl-3.0
9,214,749,064,001,478,000
42.450172
113
0.529779
false
google-research/google-research
stacked_capsule_autoencoders/capsules/math_ops.py
1
4235
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
-4,903,853,938,586,949,000
26.322581
93
0.647934
false
1fish2/the-blue-alliance
controllers/backup_controller.py
1
12856
import cloudstorage import csv import datetime import json import logging import os import StringIO import tba_config from google.appengine.api import taskqueue from google.appengine.api import urlfetch from google.appengine.ext import ndb from google.appengine.ext import webapp from google.appengine.ext.webapp import...
mit
3,481,643,148,437,116,000
44.588652
163
0.596842
false
neingeist/azulejo
azulejo/WindowTools.py
1
3160
''' Created on Jul 12, 2012 @author: gillesB ''' from Window import Window from Workarea import Workarea class WindowTools(object): """ Some utilities for the windows """ @staticmethod def get_active_window(): """ Returns the active window :return: the active window ...
mit
-2,038,185,904,146,247,700
29.990196
139
0.592089
false
HomeRad/TorCleaner
wc/dns/rdtypes/IN/PX.py
1
3823
# -*- coding: iso-8859-1 -*- # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. ...
gpl-2.0
-6,621,502,497,215,966,000
38.010204
79
0.63458
false
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_models_py3.py
1
64701
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
8,620,681,322,227,704,000
39.012987
188
0.638676
false
keen99/SickRage
sickbeard/dailysearcher.py
1
4533
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
gpl-3.0
-3,312,056,714,057,756,700
37.415254
182
0.62056
false
trackmastersteve/alienfx
alienfx/core/controller_m17xr4.py
1
5637
# # controller_m17xr3.py # # Copyright (C) 2013-2014 Ashwin Menon <ashwin.menon@gmail.com> # Copyright (C) 2015-2021 Track Master Steve <trackmastersteve@gmail.com> # # Alienfx is free software. # # You may redistribute it and/or modify it under the terms of the # GNU General Public License, as published by the Free So...
gpl-3.0
-5,833,071,122,726,631,000
38.697183
121
0.665247
false
AutorestCI/azure-sdk-for-python
azure-mgmt-web/azure/mgmt/web/models/site_seal_request.py
1
1069
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
4,656,552,938,915,643,000
32.40625
76
0.571562
false
brandicted/nefertari
nefertari/renderers.py
2
6370
import json import logging from datetime import date, datetime from nefertari import wrappers from nefertari.utils import get_json_encoder from nefertari.json_httpexceptions import JHTTPOk, JHTTPCreated from nefertari.events import trigger_after_events log = logging.getLogger(__name__) class _JSONEncoder(json.JSONE...
apache-2.0
-4,746,659,759,339,364,000
36.692308
79
0.610204
false
redondomarco/useradm
src/models/gestionssl.py
1
1494
def obtener_certificado(usuario, perfil): """devuelvo certificado, si no existe lo creo en seguinf""" env.user = myconf.take('datos.seguinf_user') env.warn_only = True seguinf = FabricSupport() comando='sudo ls -la /root/Clientes_ssl/'+str(usuario)+'-'+str(perfil)+'.p12' seguinf.run(myconf.take('datos.seguinf_srv...
gpl-3.0
3,485,720,391,723,372,000
37.307692
120
0.718206
false
pizzathief/scipy
scipy/linalg/tests/test_decomp_cossin.py
1
5753
import pytest import numpy as np from numpy.random import seed from numpy.testing import assert_allclose from scipy.linalg.lapack import _compute_lwork from scipy.stats import ortho_group, unitary_group from scipy.linalg import cossin, get_lapack_funcs REAL_DTYPES = (np.float32, np.float64) COMPLEX_DTYPES = (np.compl...
bsd-3-clause
-8,984,024,263,995,868,000
36.357143
78
0.530506
false
ViciusChile/Scraper_Dealer
Metacritic.py
1
7087
from Scrapers.tools import tools class MetacriticInfo: """Model for each elements""" def __init__(self): self.name = None self.platform = None self.developer = None self.publisher = None self.esrb = None self.release = None self.tags = None self...
gpl-2.0
7,326,300,751,974,268,000
38.372222
240
0.550444
false
atwilc3000/buildroot-at91
support/testing/infra/basetest.py
1
2170
import unittest import os import datetime from infra.builder import Builder from infra.emulator import Emulator BASIC_TOOLCHAIN_CONFIG = \ """ BR2_arm=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarb...
gpl-2.0
-4,470,137,271,963,074,600
29.138889
121
0.629954
false
pedrosacramento/inkscape-animation
spritesheet.py
1
1674
# This class handles sprite sheets # This was taken from www.scriptefun.com/transcript-2-using # sprite-sheets-and-drawing-the-background # I've added some code to fail if the file wasn't found.. # Note: When calling images_at the rect is the format: # (x, y, x + offset, y + offset) import pygame class spritesheet(...
mit
-8,077,948,598,029,545,000
43.052632
64
0.639785
false
gaurav/phylo2owl
tests/test_shacl.py
1
1141
#!/usr/bin/env python """test_shacl.py: Test generated ontologies against SHACL shapes.""" import os import libshacl import pytest def test_execute_testShacl(): """ Can we execute testShacl at all? """ (rc, stdout, stderr) = libshacl.exec_testShacl(["--version"]) print stdout print stderr assert ...
mit
1,449,120,676,683,983,000
30.694444
94
0.659071
false
coala/coala
coalib/processes/communication/LogMessage.py
1
1633
from datetime import datetime from coalib.output.printers.LOG_LEVEL import LOG_LEVEL class LogMessage: def __init__(self, log_level, *messages, delimiter=' ', timestamp=None): if log_level not in LOG_LEVEL.reverse: raise Val...
agpl-3.0
8,628,628,486,573,394,000
31.66
77
0.578077
false
Larhard/tsp
tsp/solver.py
1
2482
# Copyright (c) 2015, Bartlomiej Puget <larhard@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this...
bsd-3-clause
-8,710,665,200,263,397,000
39.688525
80
0.680097
false
abalakh/robottelo
robottelo/ui/navigator.py
1
12312
# -*- encoding: utf-8 -*- """Implements Navigator UI.""" from robottelo.ui.base import Base, UIError from robottelo.ui.locators import menu_locators class Navigator(Base): """Quickly navigate through menus and tabs.""" def menu_click(self, top_menu_locator, sub_menu_locator, tertiary_menu_...
gpl-3.0
7,753,651,298,242,059,000
28.52518
79
0.556936
false
OmeGak/indico
indico/modules/attachments/models/folders_test.py
1
1890
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from indico.modules.attachments import AttachmentFolder def tes...
mit
6,373,904,373,456,727,000
40.086957
85
0.732275
false
galeone/dynamic-training-bench
dytb/evaluators/AutoencoderEvaluator.py
1
1413
#Copyright (C) 2017 Paolo Galeone <nessuno@nerdz.eu> # #This Source Code Form is subject to the terms of the Mozilla Public #License, v. 2.0. If a copy of the MPL was not distributed with this #file, you can obtain one at http://mozilla.org/MPL/2.0/. #Exhibit B is not attached; this software is compatible with the #lic...
mpl-2.0
-1,403,732,228,782,369,000
38.25
98
0.625619
false
hsfzxjy/wisecitymbc
common/rest/decorators.py
1
1087
from django.utils.decorators import method_decorator from django.core.cache import cache from django.http import HttpResponse def cache_view_func(func): def wrapper(request, *args, **kwargs): key = request.method + request.META['PATH_INFO'] + request.META['QUERY_STRING'] content = cache.get(key) ...
gpl-2.0
774,915,620,516,630,300
31
87
0.624655
false
andrew-lundgren/gwpy
gwpy/signal/filter.py
1
3049
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2016) # # This file is part of GWpy. # # GWpy 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 ...
gpl-3.0
2,693,603,008,467,231,000
31.43617
77
0.610692
false
sharkykh/SickRage
sickbeard/providers/elitetorrent.py
1
7522
# coding=utf-8 # Author: CristianBB # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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...
gpl-3.0
-8,951,345,537,618,904,000
39.659459
149
0.539484
false
mdklatt/serial-python
src/serial/core/sort.py
1
3047
""" Sorted input and output. """ from collections import deque from operator import itemgetter from .buffer import _ReaderBuffer from .buffer import _WriterBuffer __all__ = "SortReader", "SortWriter" class _Sorter(object): """ Abstract base class for SortReader and SortWriter. """ def __init__(se...
mit
-4,089,957,522,293,261,300
27.476636
80
0.54808
false
twitter/pycascading
examples/subassembly.py
1
1199
# # Copyright 2011 Twitter, 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 writing, so...
apache-2.0
-7,289,176,963,484,494,000
33.257143
76
0.69558
false
jdeguire/pjcontroller
software/updatepage.py
1
4410
#! /usr/bin/env python # # Copyright 2011-2013 Jesse DeGuire # # This file is part of Projector Controller. # # Projector Controller 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 Lic...
gpl-3.0
-2,336,973,511,080,071,700
33.186047
93
0.66644
false
1844144/django-blog-zinnia
zinnia/tests/implementations/settings.py
1
1200
"""Settings for testing zinnia""" import os from zinnia.xmlrpc import ZINNIA_XMLRPC_METHODS SITE_ID = 1 USE_TZ = True STATIC_URL = '/static/' SECRET_KEY = 'secret-key' ROOT_URLCONF = 'zinnia.tests.implementions.urls.default' LOCALE_PATHS = [os.path.join(os.path.dirname(__file__), 'locale')] PASSWORD_HASHERS = [ ...
bsd-3-clause
9,107,452,346,140,057,000
20.818182
66
0.694167
false
benkirk/mpi_playground
mpi4py/tests/test_rma.py
1
15531
from mpi4py import MPI import mpiunittest as unittest import arrayimpl import sys pypy_lt_53 = (hasattr(sys, 'pypy_version_info') and sys.pypy_version_info < (5, 3)) def mkzeros(n): if pypy_lt_53: return b'\0' * n return bytearray(n) def memzero(m): try: m[:] = 0 except ...
gpl-3.0
4,210,494,767,471,415,000
34.86836
87
0.463203
false
dragonrider7225/PythonGames
main.py
1
2439
#!py -3 from solitaire import * import sys def main(): opt = int(input("Which game would you like to play?\n\t0: Quit program\n" + "\t1: Klondike\n")) if not opt: sys.exit(0) if opt == 1: game = klondike args = [] game.set_up(*args) game.show_board() while Tr...
apache-2.0
-2,390,675,310,736,939,000
31.959459
79
0.373514
false
jaredhasenklein/the-blue-alliance
tbans/models/notifications/event_schedule.py
1
2021
import calendar from tbans.models.notifications.notification import Notification class EventScheduleNotification(Notification): def __init__(self, event, next_match=None): self.event = event self._event_feed = event.key_name self._district_feed = event.event_district_abbrev if n...
mit
268,706,569,295,279,700
32.131148
94
0.642751
false
SF-Zhou/quite
quite/deferred_function.py
1
3424
from . import deferred_define from . import Widget, QWidget from . import QMainWindow, QDockWidget from . import QHBoxLayout, SquareLayout from . import WidgetController from . import QSize, QSizeF, QPoint from . import QPicture, QPixmap from . import QPrinter, QPainter @deferred_define def set_central_widget(self: W...
mit
8,475,001,357,784,681,000
29.571429
102
0.669977
false
strongrandom/awesome-fedora
generate.py
1
6196
# https://github.com/strongrandom/awesome-fedora # # This is a quick-and-dirty tool to convert packages.yml into README.md. It is not pretty. It is not efficient. It is # nowhere near my best work... but it works. # # Use Python 3. Install PyYAML. # import operator import textwrap import dnf import yaml def write_pa...
mit
2,793,258,951,590,367,000
33.614525
119
0.596191
false
CiscoDevNet/netconf-examples
netconf-102/get_config_csr1000V.py
1
1234
#!/usr/bin/python # # Get configured interfaces using Netconf # # darien@sdnessentials.com # from ncclient import manager import sys import xml.dom.minidom # the variables below assume the user is requesting access # to a IOS-XE device running in the DevNet Always On SandBox # use the IP address or hostname of your ...
apache-2.0
4,805,675,626,811,635,000
27.045455
81
0.679092
false
redixin/keyserver-ng
keyserver/key.py
1
1886
from datetime import datetime import gpgme from io import BytesIO class PublicKey: def __init__(self, fp): if isinstance(fp, str): fp = BytesIO(bytes(fp, "ascii")) elif isinstance(fp, bytes): fp = BytesIO(fp) self.ctx = gpgme.Context() self.ctx.armor = Fals...
apache-2.0
8,411,964,592,434,458,000
24.486486
77
0.560445
false
leonardr/sycorax
timeline.py
1
21201
"""Parse a Sycorax script into an annotated multi-author timeline.""" from datetime import datetime, timedelta import json import random import re import hashlib import os import pytz # 10M: ~10 minutes later # 4H: ~4 hours later # 1D: the next day # R: Reply to previous # 10A: 10AM on the current day # 9P: 9PM on th...
bsd-2-clause
-76,825,165,262,542,300
35.61658
172
0.566058
false
maxis1314/pyutils
web/views/user.py
1
1484
# coding: utf-8 from flask import Flask,request,session,g,redirect,url_for,Blueprint from flask import abort,render_template,flash from helpers import getAvatar import config #from .base import BaseHandler import base config = config.rec() user = Blueprint('user', __name__) import pika #class LoginHandler(BaseHandl...
apache-2.0
-7,283,646,547,762,287,000
29.285714
69
0.644879
false
respawner/peering-manager
peering/migrations/0050_auto_20190806_2159.py
1
3436
# Generated by Django 2.2.4 on 2019-08-06 19:59 import taggit.managers from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("taggit", "0003_taggeditem_add_unique_index"), ("peering", "0049_auto_20190731_1946"), ] operations = [ migrations.Add...
apache-2.0
1,025,210,879,864,040,000
31.72381
60
0.489814
false
nlsynth/iroha
examples/shared_reg_options.py
1
1324
import sys sys.path.append('../py') from iroha import * from iroha.iroha import * d = IDesign() mod = IModule(d, "mod") tab1 = ITable(mod) sreg = design_tool.CreateSharedReg(tab1, "o", 32) wtab = ITable(mod) w = design_tool.CreateSharedRegWriter(wtab, sreg) wst1 = IState(wtab) wst2 = IState(wtab) wst3 = IState(wtab)...
bsd-3-clause
-322,881,621,275,133,300
21.440678
52
0.746979
false
lquirosd/TFM
ILA/code/trainGMM.py
1
5034
from __future__ import division import sys, argparse #--- To handle console arguments import numpy as np #--- To handle math processing import scipy.ndimage as ndi #--- To handle image processing from scipy import misc import glob, os #--- To handle OS callbacks import utils from sklearn import mixture import time im...
apache-2.0
-933,522,224,188,337,200
36.288889
135
0.591577
false
offlinehacker/flumotion
flumotion/test/test_wizard_save.py
1
43842
# -*- Mode: Python; test-case-name: flumotion.test.test_wizard_models -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2008 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Public License v...
gpl-2.0
-6,053,539,841,310,184,000
42.92986
78
0.467543
false
mikicaivosevic/flask-cassandra-sessions
tests/test_session.py
1
2092
import json from time import sleep from unittest import TestCase from cassandra.cluster import Cluster from flask import Flask, session from cassandra_flask_sessions import CassandraSessionInterface, AbstractConnectionProvider class ConnectionProvider(AbstractConnectionProvider): _connection = Cluster(['127.0....
mit
-7,179,838,590,307,754,000
26.168831
98
0.639101
false
PapenfussLab/MHC-clogs
bin/fasta_rename_by_pos.py
1
1734
#!/usr/bin/env python """ fasta_rename_by_pos.py """ from argparse import ArgumentParser from mungolite.fasta import FastaFile from srt.intervals import GenomeIntersector def get_position(tokens): for token in tokens: if "Position" in token: for delim in ["=", ":", "(", ")"]: ...
artistic-2.0
-8,437,597,413,394,435,000
30.527273
158
0.643022
false
ibab/tensorprob
tensorprob/utilities.py
1
1469
from collections import defaultdict, Iterable import itertools import numpy as np import tensorflow as tf from six.moves import zip_longest NAME_COUNTERS = defaultdict(lambda: 0) def generate_name(obj): """Generate a unique name for the object in question Returns a name of the form "{calling_class_name}_{...
mit
3,968,733,909,219,394,000
23.081967
76
0.639891
false
rseedorff/pi-kiosk
helloWorld.py
1
5178
from flask import Flask, jsonify import datetime import time import atexit import RPi.GPIO as GPIO app = Flask(__name__) ##################################################### # Initialise GPIO Board and setup all pins # ##################################################### # Green LED at Pin 7 LED_GREEN = 7 ...
apache-2.0
-4,223,882,474,366,889,000
31.772152
91
0.556779
false
Austriker/LuxLogger
tsl2561.py
1
10465
'''Driver for the TSL2561 digital luminosity (light) sensors. Pick one up at http://www.adafruit.com/products/439 Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Code ported from Adafruit Arduino library, comm...
mit
-6,918,371,752,110,139,000
32.758065
79
0.57592
false
loaclhostjason/react-redux-admin
console/app/app.py
1
1394
# -*- coding: utf-8 -*- from flask import Flask from flask_bootstrap import Bootstrap from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager from flask_babel import Babel from flask_moment import Moment from .assets import assets_env, bundles from flask_caching import Cache from config import Con...
mit
5,873,634,761,814,845,000
24.62963
66
0.723988
false
afajl/sy
docs/conf.py
1
6337
# -*- coding: utf-8 -*- # # 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 configuration values have a default; values that are commented out # serve to show the default. import sys, os...
bsd-3-clause
8,141,396,965,501,481,000
31.167513
80
0.709957
false
erudit/zenon
eruditorg/apps/userspace/library/subscription_information/views.py
1
1593
# -*- coding: utf-8 -*- from django.contrib import messages from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic import FormView from django.contrib.auth.mixins import LoginRequiredMixin from base.viewmixins import MenuItemMixin from ..viewmixins import Org...
gpl-3.0
-7,446,036,456,903,838,000
36.833333
95
0.735053
false
lebauce/artub
pypoujol/sound.py
1
1742
# Glumol - An adventure game creator # Copyright (C) 1998-2008 Sylvain Baubeau & Alexis Contour # This file is part of Glumol. # Glumol 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 th...
gpl-2.0
-4,415,843,273,799,223,300
24.757576
70
0.598163
false
jeffmahoney/supybot
src/commands.py
2
33100
### # Copyright (c) 2002-2005, Jeremiah Fincher # Copyright (c) 2009-2010, James McCoy # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above ...
bsd-3-clause
4,640,401,204,701,421,000
32.1
84
0.593505
false
akhileshpillai/treeherder
treeherder/webapp/api/runnable_jobs.py
1
5374
from django.conf import settings from django.core.exceptions import ValidationError from django.core.validators import URLValidator from rest_framework import viewsets from rest_framework.response import Response from rest_framework.status import HTTP_500_INTERNAL_SERVER_ERROR from treeherder.etl.common import fetch_j...
mpl-2.0
-607,443,222,029,147,600
42.691057
99
0.566617
false
avanzosc/avanzosc6.1
avanzosc_tire_management/wizard/wizard_interchange.py
1
15211
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011-2012 Daniel (Avanzosc) <http://www.avanzosc.com> # 28/03/2012 # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
5,135,022,820,725,371,000
42.827089
156
0.460577
false
spark8103/ops17
tools/test_init.py
1
18237
#!/bin/env python # coding: utf-8 from app import db from app.models import User, Role, Department, Idc, Server, Software, Project, Module, Environment import os if os.path.exists('.env'): print('Importing environment from .env...') for line in open('.env'): var = line.strip().split('=') if le...
mit
-3,189,856,236,642,584,000
46.867568
123
0.54085
false
lexifdev/pyconkr-2015
pyconkr/views.py
1
12386
# -*- coding: utf-8 -*- import logging from django.conf import settings from django.contrib.auth import login as user_login, logout as user_logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.core.e...
mit
-7,112,165,041,920,347,000
30.098237
131
0.611291
false
kmee/pycorreios
test/test_correios.py
1
1853
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os test_root = os.path.dirname(os.path.abspath(__file__)) os.chdir(test_root) sys.path.insert(0, os.path.dirname(test_root)) sys.path.insert(0, test_root) import unittest from pycorreios.correios import Correios from pycorreios.model import Cep, Frete, Encome...
mit
7,613,583,466,708,231,000
33.962264
111
0.501349
false
gabisurita/kinto-codegen-tutorial
python-client/swagger_client/apis/utilities_api.py
1
21953
# coding: utf-8 """ kinto Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host. **Limitations of this OpenAPI specification:** 1. Validation on OR clauses is not supported (e.g. provide `data` or `permissions` in patch ...
mit
-6,518,620,422,209,996,000
37.046794
938
0.52453
false
mgeorgehansen/FIFE_Technomage
engine/python/fife/extensions/pychan/widgets/scrollarea.py
1
4667
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2009 by the FIFE team # http://www.fifengine.de # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General P...
lgpl-2.1
-4,644,638,224,177,974,000
35.336
101
0.71952
false
leliel12/scikit-criteria
doc/source/conf.py
1
6770
# -*- coding: utf-8 -*- # # Scikit-Criteria documentation build configuration file, created by # sphinx-quickstart on Thu Aug 3 02:18:36 2017. # # 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 fil...
bsd-3-clause
4,692,782,530,310,709,000
30.055046
79
0.67223
false
andela/troupon
troupon/middleware/general.py
1
1525
from django.conf import settings from deals.models import Category, Advertiser, NIGERIAN_LOCATIONS, KENYAN_LOCATIONS, ALL_LOCATIONS class SharedContextMiddleware(object): """ Middleware class that injects common data that's needed when rendering most of view responses into the context of the templat...
mit
7,258,990,352,408,417,000
37.125
98
0.637377
false
polera/rblwatch
rblwatch/rblwatch.py
1
6297
#!/usr/bin/env python import sys import socket import re from IPy import IP from dns.resolver import Resolver, NXDOMAIN, NoNameservers, Timeout, NoAnswer from threading import Thread RBLS = [ 'aspews.ext.sorbs.net', 'b.barracudacentral.org', 'bl.deadbeef.com', 'bl.emailbasura.org', 'bl.spamcanniba...
bsd-2-clause
-1,166,850,851,907,662,000
30.80303
89
0.532476
false
anchore/anchore-engine
tests/unit/anchore_engine/services/policy_engine/engine/policy/gates/test_vulnerabilities.py
1
44126
import datetime import json import os import re from unittest.mock import Mock import pytest from anchore_engine.common.models.policy_engine import ImageVulnerabilitiesReport from anchore_engine.db import Image from anchore_engine.db.entities.policy_engine import ( DistroMapping, FeedGroupMetadata, FeedMe...
apache-2.0
-2,858,890,194,203,769,300
33.500391
152
0.491366
false
curious-abhinav/change-point
docs/conf.py
1
7843
# -*- coding: utf-8 -*- # # Change Point documentation build configuration file, created by # sphinx-quickstart. # # 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 configuration values h...
mit
-955,102,581,346,214,800
31.143443
96
0.697565
false
tbunnyman/FAiler
FAiler/faile.py
1
2872
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os from datetime import datetime from FAiler.exceptions import FAError class FAile(): """ Represents a file downloaded from FurAffinity. The base parameters of this class are public access read safe by design FAile.directory: the directo...
bsd-3-clause
931,305,739,904,286,800
32.788235
78
0.612465
false
academichero/jobs
modules/board/migrations/0003_auto_20160622_2034.py
1
1227
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-06-22 23:34 from __future__ import unicode_literals import datetime import django.core.validators from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('board', '...
mit
998,880,232,990,725,600
29.675
162
0.600652
false
pavel-paulau/perfrunner
perfrunner/tests/kv.py
1
12499
from logger import logger from perfrunner.helpers.cbmonitor import timeit, with_stats from perfrunner.helpers.worker import ( pillowfight_data_load_task, pillowfight_task, ) from perfrunner.tests import PerfTest from perfrunner.workloads.pathoGen import PathoGen from perfrunner.workloads.tcmalloc import Workloa...
apache-2.0
-1,810,513,932,737,493,200
23.799603
96
0.587807
false
guillempalou/scikit-cv
skcv/video/segmentation/region_tracking.py
1
3595
import networkx as nx import numpy as np def bipartite_region_tracking(partition, optical_flow, reliability, matching_th=0.1, reliability_th=0.2): """ Parameters ---------- partition: numpy array A 3D label array where each label represents a region optical_flow: numpy arra...
bsd-3-clause
868,079,825,263,690,500
31.107143
77
0.569124
false
iradicek/clara
clara/modeltograph.py
1
1609
''' Converts Program model to a image (graph) ''' import pygraphviz as pgv def stmts_to_str(title, types, ss): l = [title] if types: l.append(', '.join(['%s: %s' % x for x in types])) for (v, e) in ss: ls = str(e) ls = ls.replace(r'\n', r'\\n') ls = ls.replace(r'\r', r'\\r...
gpl-3.0
-2,082,160,572,237,811,200
25.816667
77
0.444997
false
willmcgugan/rich
rich/palette.py
1
3288
from math import sqrt from functools import lru_cache from typing import Sequence, Tuple, TYPE_CHECKING from .color_triplet import ColorTriplet if TYPE_CHECKING: from rich.table import Table class Palette: """A palette of available colors.""" def __init__(self, colors: Sequence[Tuple[int, int, int]]): ...
mit
1,800,412,422,958,308,600
31.86
82
0.532562
false
liushuyu/DraftBin
pyscripts/acbs/lib/magic.py
1
8071
# coding: utf-8 ''' Python bindings for libmagic ''' import ctypes from collections import namedtuple from ctypes import * from ctypes.util import find_library def _init(): """ Loads the shared library through ctypes and returns a library L{ctypes.CDLL} instance """ return ctypes.cdll.LoadLibr...
lgpl-2.1
-4,565,356,466,739,291,600
28.137184
78
0.635237
false