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
kriberg/eve-armada
armada/logistics/models.py
1
2472
from django.db import models from django.contrib import admin from armada.capsuler.models import UserPilot, \ UserCorporation, \ UserAPIKey, \ Capsuler class LogisticsTeam(models.Model): name = models.CharField(max_length=200) corporation = models.ForeignKey(UserCorporation) creato...
agpl-3.0
-895,496,008,196,292,100
32.863014
97
0.64644
false
sapcc/monasca-agent
monasca_agent/collector/checks_d/prometheus.py
1
8246
""" Plugin to scrape prometheus endpoint """ # This file uses 'print' as a function rather than a statement, a la Python3 from __future__ import print_function import math import requests # import prometheus client dependency dynamically from monasca_agent.common import util from requests import RequestException tr...
bsd-3-clause
5,412,609,451,448,231,000
45.067039
120
0.573975
false
vivyly/fancast
fancast/casting/views.py
1
6503
import simplejson from django.views import generic from django.http import HttpResponse from django.views.decorators.csrf import (csrf_exempt, requires_csrf_token) from rest_framework import (viewsets, generics, ) from re...
bsd-3-clause
-2,488,046,979,807,079,400
33.775401
78
0.584807
false
blab/nextstrain-augur
builds/dengue/dengue.process.py
1
9677
from __future__ import print_function import os, sys # we assume (and assert) that this script is running from the virus directory, i.e. inside H7N9 or zika sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) import base.process from base.process import process import argparse import numpy as np from deng...
agpl-3.0
-5,209,273,781,426,590,000
48.372449
152
0.571045
false
LowerSilesians/geo-squizzy
build_big_data/main.py
1
2041
import random import json from models import CITY class Duplicates: def __init__(self): self.storage = dict() pass class Feature: def __init__(self, *args, **kwargs): self.data = dict({"type": "Feature", "properties": dict(), "geometry": {"type": kwargs['type'], "coordinates": []}}) ...
mit
-4,119,395,978,009,548,000
33.033333
124
0.590397
false
mrh1997/cymu
libclang/build-and-test-clang.py
1
1065
import subprocess import sys from os.path import dirname, join prj_path = dirname(sys.argv[0]) if len(sys.argv) == 1 or sys.argv[1] != 'no-rebuild': subprocess.check_call(['vagrant', 'powershell', '-c', 'cmd.exe', '-c', r'C:\vagrant\build.cmd']) sys.path.append(join(prj_path, r'src\tools...
gpl-3.0
7,588,159,631,043,952,000
31.272727
148
0.647887
false
jhauberg/cards.py
cards/templatefield.py
1
2868
# coding=utf-8 """ This module provides functions for working with template fields. """ import re from typing import Iterator class TemplateField: # pylint: disable=too-few-public-methods """ Represents a field in a template. """ def __init__(self, name: str=None, contex...
mit
-7,489,422,013,993,804,000
36.246753
98
0.561018
false
mrunge/horizon_lib
horizon_lib/tables/actions.py
1
38071
# Copyright 2012 Nebula, 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 agree...
apache-2.0
7,165,437,380,666,320,000
38.906709
79
0.614168
false
marwoodandrew/superdesk-aap
server/aap/publish/formatters/anpa_formatter_test.py
1
15888
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from d...
agpl-3.0
-7,921,156,450,565,238,000
41.368
120
0.592837
false
repotvsupertuga/repo
plugin.video.zen/resources/lib/indexers/navigator.py
1
14704
# -*- coding: utf-8 -*- ''' zen Add-on Copyright (C) 2016 zen This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later v...
gpl-2.0
-5,556,857,216,013,222,000
55.122137
222
0.696477
false
crccheck/atx-bandc
bandc/apps/agenda/tests/test_utils.py
1
3059
import datetime import os.path from unittest import mock from django.test import TestCase from ..factories import BandCFactory from ..utils import ( MeetingCancelled, parse_date, clean_text, process_page, get_number_of_pages, _save_page, ) from .. import scrape_logger BASE_DIR = os.path.dirn...
bsd-3-clause
-7,105,842,265,565,726,000
33.761364
82
0.632887
false
wyrdmeister/OnlineAnalysis
OAGui/src/GuiBase.py
1
5421
# -*- coding: utf-8 -*- """ Online Analysis Configuration Editor - Base class with logging functions Version 2.0 Michele Devetta (c) 2013 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 ver...
gpl-3.0
5,279,471,035,327,872,000
32.060976
119
0.608006
false
gpodder/gpodder
share/gpodder/extensions/notification-win32.py
1
6754
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # # gPodder 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 Licens...
gpl-3.0
-7,643,252,481,788,382,000
40.950311
126
0.659165
false
bslatkin/8-bits
appengine-ndb/ndb/key_test.py
1
16345
"""Tests for key.py.""" import base64 import pickle import unittest from .google_imports import datastore_errors from .google_imports import datastore_types from .google_imports import entity_pb from . import eventloop from . import key from . import model from . import tasklets from . import test_utils class KeyT...
apache-2.0
-8,650,296,654,672,698,000
33.194561
80
0.614561
false
jsafrane/openlmi-storage
test/unit/config/test_unit_settings.py
1
7966
# Copyright (C) 2012 Red Hat, Inc. All rights reserved. # # This library 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
4,726,737,873,234,810,000
39.436548
84
0.647878
false
DBrianKimmel/PyHouse
Project/src/Modules/Computer/Web/test/test_web_utils.py
1
3750
""" @name: PyHouse/src/Modules/Computer/Web/_test/test_web_utils.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com> @copyright: (c) 2014-2017 by D. Brian Kimmel @license: MIT License @note: Created on Jun 29, 2013 @Summary: Test web utilities module Passed all 7 tests - DBK - 2017-01-12 ...
mit
5,935,139,643,977,492,000
29.241935
88
0.6464
false
chencoyote/owasp-pysec
pysec/load.py
1
11062
# Python Security Project (PySec) and its related class files. # # PySec is a set of tools for secure application development under Linux # # Copyright 2014 PySec 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...
apache-2.0
2,443,859,515,778,118,700
30.696275
79
0.568975
false
skim1420/spinnaker
testing/citest/tests/aws_smoke_test.py
1
19365
# 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 applicable law or a...
apache-2.0
5,472,275,676,813,450,000
36.240385
80
0.636871
false
kedz/cuttsum
old/python/cuttsum/readers.py
1
2494
import codecs import numpy as np from sklearn.feature_extraction import DictVectorizer def gold_reader(bow_file, l_file, sim_idx, vector=u'latent'): op = codecs.open sims = [] vectors = [] labels = [] unicodes = [] last_hour = None with op(bow_file, u'r', u'utf-8') as bf, op(l_file, u'r', u...
apache-2.0
-8,457,494,943,271,030,000
32.702703
78
0.468324
false
Karajlug/karajlug
dbot/views.py
1
2174
# ----------------------------------------------------------------------------- # Karajlug.org # Copyright (C) 2010 Karajlug community # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Found...
gpl-2.0
284,063,036,326,837,600
33.507937
79
0.596136
false
tos-kamiya/agec2
src/gen_ngram.py
1
25223
#!/usr/bin/env python #coding: utf-8 __author__ = 'Toshihiro Kamiya <kamiya@mbj.nifty.com>' __status__ = 'experimental' import collections import os import sys import datetime from _utilities import sort_uniq import asm_manip as am import ope_manip as om import precomp_manip as pm UNTRACKED_CLAZS = frozenset([ ...
mit
5,821,878,241,560,408,000
43.960784
153
0.587638
false
NaviNet/ImageFeeder
imagefeeder/imagefeeder.py
1
19421
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014 NaviNet Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
apache-2.0
-32,061,546,921,340,204
35.574388
79
0.582359
false
mattclark/osf.io
addons/github/models.py
1
16200
# -*- coding: utf-8 -*- import os import urlparse import markupsafe from addons.base.models import (BaseOAuthNodeSettings, BaseOAuthUserSettings, BaseStorageAddon) from django.db import models from framework.auth import Auth from github3 import GitHubError from osf.models.external impo...
apache-2.0
8,612,263,753,383,808,000
32.333333
117
0.553457
false
rhyolight/hypersearch
setup.py
1
1371
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
gpl-3.0
1,950,163,098,414,486,500
36.054054
78
0.644785
false
tboggs/fretboard
fretboard/displays/common.py
1
1370
from __future__ import division, print_function, unicode_literals class Fret(object): '''Represents an individual fret on a fretboard.''' def __init__(self, string, fret, note): self.string = string self.number = fret self.note = note self.text = None class FretboardDis...
gpl-3.0
-8,315,247,631,235,190,000
29.444444
87
0.545985
false
omji/django-tabbed-admin
tabbed_admin/templatetags/tabbed_admin_tags.py
1
1878
# -*- coding: utf-8 -*- from django import template from django.contrib.admin.helpers import Fieldset from django.template.loader import render_to_string from django.core.exceptions import ImproperlyConfigured register = template.Library() @register.simple_tag(takes_context=True) def render_tab_fieldsets_inlines(con...
bsd-3-clause
6,588,136,163,030,727,000
37.326531
78
0.620873
false
fredgj/lazy
lazy/lazy.py
1
1420
class LazyRef(object): def __init__(self, fget): self.fget = fget self.name = fget.__name__ def __get__(self, instance, cls): value = self.fget(instance) instance.__dict__[self.name] = value return value class LazyProperty(object): def __init__(self, fget=None, fse...
mit
-501,561,031,706,150,700
26.307692
73
0.557042
false
ifp-uiuc/an-analysis-of-unsupervised-pre-training-iclr-2015
cifar10/1_to_1/cnn_a/train.py
1
1904
import os import sys sys.path.append('../..') import numpy from anna import util from anna.datasets import supervised_dataset from models import CNNModel print('Start') pid = os.getpid() print('PID: {}'.format(pid)) f = open('pid', 'wb') f.write(str(pid)+'\n') f.close() model = CNNModel('experiment', './', learni...
bsd-3-clause
2,796,604,632,929,201,700
32.403509
78
0.682248
false
tjsavage/djangononrel-starter
settings.py
1
1733
# Initialize App Engine and import the default settings (DB backend, etc.). # If you want to use a different backend you have to remove all occurences # of "djangoappengine" from this file. from djangoappengine.settings_base import * import os SECRET_KEY = '=r-$b*8hglm+858&9t043hlm6-&6-3d3vfc4((7yd0dbrakhvi' INSTALL...
bsd-3-clause
-3,507,845,645,340,688,000
30.509091
83
0.719561
false
frePPLe/frePPLe
contrib/odoo/addons_v8/frepple/res_company.py
1
1239
# -*- coding: utf-8 -*- # # Copyright (C) 2014 by frePPLe bv # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # ...
agpl-3.0
-7,058,372,471,046,832,000
34.4
114
0.719935
false
cpcloud/numpy
numpy/distutils/command/autodist.py
3
1650
"""This module implements additional tests ala autoconf which can be useful. """ from __future__ import division, absolute_import, print_function # We put them here since they could be easily reused outside numpy.distutils def check_inline(cmd): """Return the inline identifier (may be empty).""" cmd._check_...
bsd-3-clause
3,202,266,910,410,981,400
20.428571
76
0.638788
false
GeoMop/GeoMop
src/LayerEditor/ui/dialogs/layers/split_layer.py
1
4224
""" Dialog for appending new layer to the end. """ import PyQt5.QtWidgets as QtWidgets import PyQt5.QtGui as QtGui from .layers_helpers import LayersHelpers from LayerEditor.leconfig import cfg import gm_base.icon as icon class SplitLayerDlg(QtWidgets.QDialog): def __init__(self, min, max, copy_block, parent=Non...
gpl-3.0
2,672,201,235,913,936,000
38.111111
105
0.624763
false
SCPR/calif-earthquakes
tests.py
1
6616
# -*- coding: utf-8 -*- from earthquakes import app, db # from earthquakes import settings_production from earthquakes.models import Earthquake, NearestCity import os import logging import time import datetime import calendar import pytz from pytz import timezone from datetime import tzinfo, date import unittest import...
gpl-2.0
-7,676,197,781,481,037,000
36.378531
114
0.606106
false
moreati/revelation
epiphany/test/test_asm.py
1
11662
from epiphany.sim import Epiphany from epiphany.utils import float2bits from epiphany.test.machine import StateChecker import os.path import pytest elf_dir = os.path.join('epiphany', 'test', 'asm') @pytest.mark.parametrize("elf,expected", [('add.elf', StateChecker(rf1=110, rf2=7, rf3=105)), ('and.elf'...
bsd-3-clause
4,192,714,999,340,684,000
50.149123
84
0.483708
false
MartinThoma/hwrt
hwrt/features_plugin.py
1
2007
"""Features in development.""" # Core Library modules import os import urllib.request # Local modules from . import handwritten_data, utils class Bitmap: """n × n grayscale bitmap of the recording.""" normalize = True def __init__(self, n=28): self.n = n # Size of the bitmap (n x n) def...
mit
-5,350,278,061,378,514,000
28.072464
87
0.536391
false
openstack/heat
heat/policies/build_info.py
1
1502
# 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 # d...
apache-2.0
7,344,856,664,631,625,000
29.04
78
0.673768
false
levibostian/VSAS
VSAS system/VSAS/vsasGUI/EmailScreen.py
1
4232
""" Test of an Email Screen Author: Kristen Nielsen kristen.e.nielsen@gmail.com Modeled after tkSimpleDialog.py from pythonware.com """ from Tkinter import * import tkMessageBox as MsgBox from multilistbox import MultiListbox from emailInputNew import EmailInput class EmailSettings(Toplevel): def _...
mit
3,505,993,686,349,974,500
34.17094
105
0.587902
false
mropert/conan
conans/test/integration/go_diamond_test.py
1
3953
import unittest from conans.test.utils.tools import TestServer, TestClient from conans.model.ref import ConanFileReference import platform import os from conans.test.utils.context_manager import CustomEnvPath from conans.test.utils.test_files import hello_conan_files from nose.plugins.attrib import attr @attr('golang...
mit
-5,165,749,421,708,407,000
47.207317
99
0.616747
false
Lana-B/Pheno4T
madanalysis/enumeration/observable_type.py
1
6721
################################################################################ # # Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks # The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> # # This file is part of MadAnalysis 5. # Official website: <https://launchpad.net/madanalysis5> # # MadAnal...
gpl-3.0
7,029,142,806,390,245,000
37.626437
190
0.586371
false
mganeva/mantid
scripts/Muon/GUI/Common/context_example/context_example_widget.py
1
1841
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, div...
gpl-3.0
-1,136,197,275,128,112,800
31.875
93
0.689299
false
cumc-dbmi/pmi_sprint_reporter
file_transfer.py
1
3848
from base64 import b64encode from io import BytesIO from uuid import uuid4 import requests import time import wddx import settings TRANSFER_API_URL_FMT = 'https://transfer.nyp.org/seos/1000/%s.api' TRANSFER_LOGIN_URL = TRANSFER_API_URL_FMT % 'login' TRANSFER_FIND_URL = TRANSFER_API_URL_FMT % 'find' TRANSFER_PUT_URL ...
mit
-8,684,232,296,754,300,000
35.301887
116
0.661123
false
funkring/fdoo
addons-funkring/shop_delivery/__openerp__.py
1
1296
# -*- coding: utf-8 -*- ############################################################################# # # Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
agpl-3.0
-7,352,487,846,455,987,000
34.054054
78
0.574074
false
giraldeau/autovm
autovm/helpers.py
1
3970
#!/usr/bin/env python # coding=utf-8 import os from os.path import join, dirname, exists from os import makedirs, utime, unlink, walk from heapq import heappush, heappop, heappushpop import platform import sys def default_dist(): (a, b, c) = platform.dist() return c def default_arch(): mapping = { 'x86_6...
gpl-3.0
-6,377,656,115,338,019,000
28.857143
106
0.589673
false
endlessm/chromium-browser
chrome/android/java/src/PRESUBMIT.py
1
8949
# Copyright (c) 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Presubmit script for Android Java code. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presub...
bsd-3-clause
-43,752,571,225,410,950
41.614286
80
0.721086
false
Uli1/mapnik
scons/scons-local-2.4.0/SCons/Tool/ifort.py
1
3327
"""SCons.Tool.ifort Tool-specific initialization for newer versions of the Intel Fortran Compiler for Linux/Windows (and possibly Mac OS X). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) ...
lgpl-2.1
-6,600,932,587,542,999,000
36.806818
104
0.685903
false
allenai/allennlp
allennlp/training/trainer.py
1
56811
import datetime import logging import math import os import re import time import traceback from contextlib import contextmanager from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union from allennlp.common.util import int_to_device import torch import torch.distributed as dist from torch...
apache-2.0
2,535,458,135,862,169,600
41.618905
114
0.608544
false
christabor/codeReflector
tests/test_htmlreflector.py
1
4205
# -*- coding: utf-8 -*- __author__ = """Chris Tabor (dxdstudio@gmail.com)""" import unittest from code_reflector import html_reflector class SelectorOutputTestCase(unittest.TestCase): def setUp(self): self.ref = html_reflector.HTMLReflector() def test_single_class(self): res = self.ref.pro...
apache-2.0
4,916,741,392,170,460,000
39.047619
79
0.571463
false
co-ment/comt
src/cm/tests/test_comment_positioning.py
1
4722
# -*- coding: utf-8 -*- from django.test import TestCase from BeautifulSoup import BeautifulSoup from cm.models import * from django.core.cache import cache # python manage.py test #  # python manage.py test cm.CommentPositioningTest def create_comment(start_wrapper=0, end_wrapper=0, start_offset=0, end_offse...
agpl-3.0
716,923,079,325,918,800
43.942857
124
0.563255
false
google/playhvz
backend/constants.py
1
1174
#!/usr/bin/python # # Copyright 2017 Google 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 a...
apache-2.0
-48,341,932,827,967,384
27.634146
74
0.707836
false
williamdean/pywbem
testsuite/test_mof_compiler.py
1
5847
#!/usr/bin/env python # from comfychair import main, TestCase, NotRunError from pywbem import * from pywbem.mof_compiler import MOFCompiler, MOFWBEMConnection, MOFParseError from urllib import urlretrieve, urlopen from time import time import os import sys from zipfile import ZipFile from tempfile import TemporaryF...
lgpl-2.1
3,154,006,598,126,819,300
31.303867
135
0.575167
false
t3dev/odoo
addons/stock/tests/test_report.py
2
1121
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import odoo import odoo.tests class TestReports(odoo.tests.TransactionCase): def test_reports(self): product1 = self.env['product.product'].create({ 'name': 'Mellohi', 'default_code':...
gpl-3.0
436,866,183,249,691,840
42.115385
180
0.597681
false
scholer/cadnano2.5
cadnano/color.py
2
3229
# -*- coding: utf-8 -*- """This allows the model to have a :class:`Color` object class without the need for :class:`PyQt5.QtGui.QColor` When running the Qt Application, :class:`QColor` will be used, otherwise an API compatible class is used and exported as a :class:`Color` object Currently :class:`Color` objects are ...
mit
8,278,896,522,655,440,000
27.324561
85
0.5048
false
jessicalucci/TaskManagement
taskflow/engines/dist_engine/dtclient.py
1
7108
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2013 Rackspace Hosting 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
-4,631,248,882,896,480,000
37.215054
78
0.589617
false
Dev-Cloud-Platform/Dev-Cloud
dev_cloud/cc1/src/clm/utils/decorators.py
1
10248
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
apache-2.0
987,290,668,116,218,800
29.771772
160
0.620084
false
opmuse/opmuse
opmuse/sizeof.py
1
1750
# stolen from http://code.activestate.com/recipes/577504/ with some minor changes # for pep8 compatibility from __future__ import print_function from sys import getsizeof, stderr from itertools import chain from collections import deque try: from reprlib import repr except ImportError: pass def total_size(o,...
agpl-3.0
-667,687,790,504,563,000
31.407407
86
0.609143
false
sunlightlabs/read_FEC
fecreader/summary_data/management/commands/update_all_candidate_times.py
1
3767
from datetime import date from django.core.management.base import BaseCommand, CommandError from django.db.models import Sum from summary_data.utils.summary_utils import summarize_committee_periodic_webk from summary_data.models import Candidate_Overlay, Authorized_Candidate_Committees, Committee_Time_Summary, Comm...
bsd-3-clause
9,153,019,869,231,300,000
46.696203
235
0.63605
false
bertdecoensel/noysim
noysim/viewer.py
1
28081
# Noysim -- Noise simulation tools for Aimsun. # Copyright (c) 2010-2011 by Bert De Coensel, Ghent University & Griffith University. # # Classes for sending and viewing noise levels in real-time import os import sys import socket import threading import time import random import msvcrt if not hasattr(sys...
mit
800,746,014,258,861,400
35.794078
159
0.607493
false
GedheFoundation/sidesa2.0
surat_masuk.py
1
6371
#Boa:Frame:surat_masuk import wx import wx.richtext import wx.lib.buttons import input_administrasi_surat def create(parent): return surat_masuk(parent) [wxID_SURAT_MASUK, wxID_SURAT_MASUKDARI, wxID_SURAT_MASUKDATEPICKERCTRL1, wxID_SURAT_MASUKINPUT_KETERANGAN, wxID_SURAT_MASUKINPUT_NOMOR_SURAT, wxID_SURAT_MA...
gpl-2.0
-2,547,471,735,619,508,700
47.633588
189
0.638832
false
calamares/calamares
src/modules/dummypythonqt/main.py
1
8246
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # === This file is part of Calamares - <https://calamares.io> === # # SPDX-FileCopyrightText: 2016-2017 Teo Mrnjavac <teo@kde.org> # SPDX-FileCopyrightText: 2017 Alf Gaida <agaida@siduction.org> # SPDX-License-Identifier: GPL-3.0-or-later # # Calamares is Free So...
gpl-3.0
-682,205,914,237,107,000
42.861702
79
0.680936
false
ofavre/cellulart
utils.py
1
1311
# -*- coding: utf-8 -*- # License: See LICENSE file. import math CLASSIC = 0 WRAP = 1 #MOBIUS = 2 def distance(world_shape, type=CLASSIC): def distance_classic(a,b): val = 0.0 for ad,bd in zip(a,b): val += (ad-bd)**2 return math.sqrt(val) def distance_wrap(a,b): ...
bsd-3-clause
-2,513,885,121,454,406,000
23.735849
84
0.500381
false
nathanbjenx/cairis
cairis/core/colourcodes.py
1
3560
# 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
3,056,037,936,750,514,000
33.901961
63
0.660674
false
operasoftware/twisted-apns
apns/notification.py
1
5424
from datetime import datetime import binascii import json import struct from apns.commands import NOTIFICATION from apns.utils import datetime_to_timestamp class NotificationError(Exception): """To be thrown upon failures on notification processing.""" pass class NotificationInvalidPriorityError(Notificati...
mit
4,067,661,437,472,473,600
31.872727
79
0.615413
false
jahodfra/mrkev
mrkev/__init__.py
1
1675
__version__ = '0.1' __license__ = ''' Copyright (c) 2012, Frantisek Jahoda 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
1,534,452,892,119,909,400
87.157895
755
0.798806
false
vessemer/concept-to-clinic
prediction/src/tests/test_segmentation.py
1
2579
import os import time import pylidc as pl import pytest from config import Config from . import get_timeout from ..algorithms.identify.prediction import load_patient_images from ..algorithms.segment.trained_model import predict from ..preprocess.lung_segmentation import save_lung_segments, get_z_range def test_cor...
mit
-8,960,259,686,865,526,000
32.934211
118
0.68166
false
dabrahams/0install
zeroinstall/0launch-gui/main.py
1
6132
# Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. from __future__ import print_function import os, sys import logging import warnings from optparse import OptionParser from zeroinstall import _, SafeException from zeroinstall.injector import requirements from zero...
lgpl-2.1
4,441,060,670,262,614,500
31.791444
134
0.708415
false
otov4its/django-walletone
walletone/views.py
1
1337
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.http.response import HttpResponse, HttpResponseBadRequest from django.views.decorators.csrf import csrf_exempt from .forms import WalletOneConfirmForm from . import signals logger = logging.getLogger(__name__) @csrf_exempt ...
mit
1,945,754,972,225,154,600
35.162162
80
0.646223
false
amrishparmar/mal_cl_interface
nl_interface/search.py
1
4686
import html from enum import Enum import click import requests from bs4 import BeautifulSoup import agent import network import ui class StatusCode(Enum): """An Enum represented the type of result of database searches""" NO_RESULTS = 0 USER_CANCELLED = 1 def display_entry_details(entry): """Displa...
mit
740,526,283,656,575,100
39.396552
116
0.607981
false
vlegoff/tsunami
src/secondaires/peche/commandes/banc/editer.py
1
2649
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this ...
bsd-3-clause
-2,259,236,170,578,934,000
43.677966
79
0.709408
false
reviewboard/rbtools
rbtools/clients/plastic.py
1
13440
"""A client for Plastic SCM.""" from __future__ import unicode_literals import logging import os import re from rbtools.clients import SCMClient, RepositoryInfo from rbtools.clients.errors import (InvalidRevisionSpecError, TooManyRevisionsError, ...
mit
1,965,228,939,996,342,800
34.368421
79
0.510714
false
Statoil/SegyIO
python/examples/write.py
1
2756
import sys import segyio import numpy as np def main(): if len( sys.argv ) < 2: sys.exit("Usage: write.py [file]") filename = sys.argv[1] # the mode parameter is passed directly to C's fopen # opening the file for writing requires r+, not rw because rw would # truncate (effectively destro...
lgpl-3.0
8,186,660,944,869,912,000
31.809524
78
0.58164
false
oblalex/gnuplot.py-py3k
PlotItems.py
1
26123
# $Id: PlotItems.py 299 2007-03-30 12:52:17Z mhagger $ # Copyright (C) 1998-2003 Michael Haggerty <mhagger@alum.mit.edu> # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """PlotItems.py -- Objects that can be plotted by Gnuplot. This module contains severa...
lgpl-2.1
6,933,519,582,789,603,000
33.87717
79
0.598515
false
wtpayne/hiai
a3_src/h70_internal/da/lwc/env.py
1
8714
# -*- coding: utf-8 -*- """ Local working copy runtime environment control. --- type: python_module validation_level: v00_minimum protection: k00_public copyright: "Copyright 2016 High Integrity Artificial Intelligence Systems" license: "Licensed under the Apache License, Version 2.0 (the Licen...
apache-2.0
-3,498,644,829,901,860,400
33.995984
79
0.506197
false
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/cr/crvserver_binding.py
1
4725
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
-5,411,408,159,442,030,000
27.810976
119
0.702646
false
jfouca/confucius
confucius/models/conference.py
1
7188
from django.db import models from django.db.models import Q from django.db.models.signals import pre_save, post_delete from django.dispatch import receiver from datetime import datetime from confucius.models import ConfuciusModel, User class Action(ConfuciusModel): name = models.CharField(max_length=155, verbose_...
bsd-3-clause
-5,912,912,759,637,472,000
31.378378
139
0.664719
false
rajpushkar83/cloudmesh
cloudmesh/management/project.py
1
12236
from mongoengine import * from mongoengine.context_managers import switch_db from datetime import datetime import hashlib import uuid from user import User, Users # from comittee import Committee from pprint import pprint from cloudmeshobject import CloudmeshObject from cloudmesh_base.ConfigDict import ConfigDict from ...
apache-2.0
-4,249,167,181,425,727,000
28.990196
100
0.505721
false
berkeley-stat159/project-epsilon
code/utils/scripts/t_test_plot_script.py
1
3981
""" Purpose: ----------------------------------------------------------- This script creates graphs for t-test for 4 conditions For each subject each run each condition, plot the t statistics ----------------------------------------------------------- """ import sys, os sys.path.append(os.path.join(os.path.dirname(_...
bsd-3-clause
6,409,189,543,104,317,000
34.544643
97
0.558905
false
basho/riak-python-client
riak/test_server.py
1
10342
# Copyright 2010-present Basho Technologies, 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 a...
apache-2.0
4,965,672,027,850,435,000
33.358804
79
0.508219
false
bkold/CarbonCopy
ribbit_app/tests.py
1
6847
from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from django.conf.urls import url from ribbit_app.models import Ribbit from . import views from django.core.urlresolvers import reverse from django.test import LiveServerTestCase from django.contrib.auth....
mit
3,674,270,257,799,125,000
32.89604
138
0.701913
false
dezgeg/debbindiff
setup.py
1
1468
#!/usr/bin/env python2 from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import debbindiff class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(s...
gpl-3.0
7,436,780,751,955,286,000
29.583333
87
0.606267
false
Micronaet/micronaet-mx8
mx_stock_status_multicompany/__init__.py
1
1084
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
agpl-3.0
7,192,910,538,212,100,000
42.36
79
0.617159
false
keans/dstools
dstools/utils.py
1
1422
import itertools def pairwise(iterable): """ s -> (s0,s1), (s1,s2), (s2, s3), ... """ a, b = itertools.tee(iterable) next(b, None) return list(zip(a, b)) def str2bool(v): """ converts a string to a boolean """ return v.lower() in ("yes", "true", "t", "1") def chunks(li, siz...
mit
-6,534,625,633,302,136,000
21.571429
66
0.530942
false
archesproject/arches
arches/app/models/migrations/0005_4_0_1.py
1
6158
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2017-04-25 11:36 import os from django.db import migrations, models from django.core import management from arches.app.models.system_settings import settings from arches.app.models.concept import Concept from arches.app.search.search_engine_factory import SearchE...
agpl-3.0
4,566,194,626,997,596,000
32.107527
115
0.546606
false
theblindr/blindr-backend
tests/models/test_user.py
1
2530
from datetime import datetime from freezegun import freeze_time from unittest import mock from tests.blindrtest import BlindrTest from tests.factory_boy.user_factory import UserFactory from blindr.models.user import User class UserTests(BlindrTest): @freeze_time('2015-01-01') @mock.patch('blindr.models.user....
gpl-3.0
-527,985,798,835,686,300
31.857143
77
0.624506
false
OpenTrons/opentrons_sdk
api/src/opentrons/deck_calibration/endpoints.py
1
24629
from uuid import uuid1 from typing import Dict, Tuple, Optional, NamedTuple import logging from enum import Enum try: from opentrons import instruments except ImportError: pass from opentrons.config import pipette_config, robot_configs, feature_flags from opentrons.types import Mount, Point from opentrons.hard...
apache-2.0
6,045,012,831,655,699,000
34.335725
79
0.618336
false
RyanSkraba/beam
sdks/python/apache_beam/metrics/metric_test.py
1
5846
# # 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
4,210,012,796,646,365,000
34.216867
80
0.7039
false
benitesf/Skin-Lesion-Analysis-Towards-Melanoma-Detection
main.py
1
9476
# Import methods of features extraction from features_extraction.feature_extraction import FeatureExtraction # Import methods of learning from learning.learning import neural_network # Import methods of classification from classification.classification import classify, confusion_matrix, total_error, local_error # fr...
mit
-516,867,449,965,981,630
32.132867
117
0.529232
false
snakeleon/YouCompleteMe-x64
third_party/ycmd/third_party/watchdog_deps/watchdog/src/watchdog/events.py
2
16163
# coding: utf-8 # # Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> # Copyright 2012 Google, Inc & contributors. # # 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.a...
gpl-3.0
-7,516,226,166,804,324,000
27.55477
99
0.619602
false
igorgai/django-custom-user
custom_user/forms.py
1
3880
"""EmailUser forms.""" import django from django import forms from django.contrib.auth import get_user_model from django.contrib.auth.forms import ReadOnlyPasswordHashField from django.utils.translation import ugettext_lazy as _ class EmailUserCreationForm(forms.ModelForm): """A form for creating new users. ...
bsd-3-clause
-1,206,752,125,892,193,000
28.846154
75
0.617268
false
quater/calico-containers
calicoctl/calico_ctl/status.py
1
9262
# Copyright (c) 2015-2016 Tigera, 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 applicabl...
apache-2.0
-3,644,788,646,197,634,000
35.464567
99
0.603865
false
niwinz/Green-Mine
src/greenmine/wiki/views.py
1
4981
# -*- coding: utf-8 -*- from __future__ import absolute_import from django.core.urlresolvers import reverse from django.template.defaultfilters import slugify from django.shortcuts import get_object_or_404 from ..core.utils.slug import slugify_uniquely from ..core.generic import GenericView from ..core.decorators im...
bsd-3-clause
2,264,128,126,756,378,400
28.64881
83
0.592853
false
akesterson/dpath-python
tests/test_util_set.py
1
1710
import dpath.util def test_set_existing_separator(): dict = { "a": { "b": 0, }, } dpath.util.set(dict, ';a;b', 1, separator=";") assert(dict['a']['b'] == 1) dict['a']['b'] = 0 dpath.util.set(dict, ['a', 'b'], 1, separator=";") assert(dict['a']['b'] == 1) def...
mit
6,502,466,740,530,720,000
17.791209
60
0.391813
false
openlawlibrary/pygls
examples/json-extension/server/tests/unit/test_features.py
1
3751
############################################################################ # Copyright(c) Open Law Library. All rights reserved. # # See ThirdPartyNotices.txt in the project root for additional notices. # # # # Licensed u...
apache-2.0
6,875,330,818,496,659,000
33.1
79
0.582245
false
ustuehler/git-cvs
cvsgit/command/clone.py
1
3887
"""Command to clone a CVS repository or module as a Git repository.""" import os.path import shutil from cvsgit.main import Command, Conduit from cvsgit.i18n import _ from cvsgit.command.verify import Verify class Clone(Command): __doc__ = _( """Clone a CVS repository or module into a Git repository. Us...
isc
4,724,368,370,476,854,000
38.262626
79
0.565475
false
Clinical-Genomics/scout
scout/server/blueprints/dashboard/controllers.py
1
12437
import logging from flask import flash, redirect, request, url_for from flask_login import current_user from scout.server.extensions import store from scout.server.utils import user_institutes from .forms import DashboardFilterForm LOG = logging.getLogger(__name__) def institute_select_choices(): """Return a ...
bsd-3-clause
-1,192,204,301,845,954,000
31.643045
98
0.617512
false
HenningOp/ACS
GIS-Tools/Q_prePro1/ACS_preProcessing1/acs_preProcessing1_dialog.py
1
1828
# -*- coding: utf-8 -*- """ /*************************************************************************** ACS_preProcessing1Dialog A QGIS plugin Transfer stream data ------------------- begin : 2017-07-26 git sha ...
gpl-3.0
7,588,516,538,750,990,000
43.585366
77
0.429978
false
cgarrard/osgeopy-code
Chapter3/chapter3.py
1
17766
# I use the print function in this code, even though I don't in the book text, # so that you can run it as a regular script and still get the output. You only # get output without using print if you're using the interactive window. # Set this variable to your osgeopy-data directory so that the following # examples wi...
mit
3,989,574,481,614,995,500
32.969407
79
0.675335
false
Hitachi-Data-Systems/org-chart-builder
openpyxl/worksheet/dimensions.py
1
6673
from __future__ import absolute_import # Copyright (c) 2010-2014 openpyxl from openpyxl.compat import safe_string from openpyxl.cell import get_column_interval, column_index_from_string from openpyxl.descriptors import Integer, Float, Bool, Strict, String, Alias from openpyxl.compat import OrderedDict class Dimensio...
apache-2.0
5,091,376,572,354,088,000
30.476415
84
0.542335
false
timberline-secondary/hackerspace
src/portfolios/views.py
1
8722
import os from django.urls import reverse from django.http import Http404 from django.contrib import messages from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.messages.views import Success...
gpl-3.0
-2,756,887,367,504,752,600
35.957627
105
0.658794
false
bzamecnik/sms-tools
tests/sprModel_test.py
1
1710
import math import numpy as np from scipy.signal import get_window from smst.utils.math import rmse from smst.utils import audio from smst.models import spr from .common import sound_path # TODO: the test needs fixing after the model is fixed def test_reconstruct_sound(): fs, x = audio.read_wav(sound_path("sax-...
agpl-3.0
-4,352,714,113,328,351,000
34.625
97
0.70117
false
hojel/epubia
markdown2pdf.py
1
3489
# -*- coding: utf-8 -*- import markdown import ho.pisa as pisa import StringIO import os import re from Cheetah.Template import Template from tempfile import NamedTemporaryFile debug = False def markdown2pdf(text, pdffile, cssfile='xhtml2pdf.css', src_dir='.', fontfile='arial.ttf', skipTo1st=False...
mit
-3,050,844,844,239,022,000
34.642105
116
0.554726
false