repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
novopl/sphinx-refdoc
src/refdoc/objects/module.py
1
1803
# -*- coding: utf-8 -*- """ Python module encapsulation. """ from __future__ import absolute_import, unicode_literals from os.path import abspath, basename import attr from .. import rst from .base import DocObjBase @attr.s class Module(DocObjBase): """ Represents a python module. This is all the informatio...
mit
-2,269,849,587,264,274,200
25.910448
78
0.5868
false
myint/cppclean
cpp/tokenize.py
1
10119
# Copyright 2007 Neal Norwitz # Portions Copyright 2007 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 ...
apache-2.0
5,799,962,709,868,037,000
33.070707
79
0.476332
false
wangyushun/myblog
project/project/settings.py
1
3093
""" Django settings for project project. Generated by 'django-admin startproject' using Django 1.8.16. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
gpl-3.0
1,316,615,652,272,308,500
25.211864
71
0.685095
false
dhomeier/astropy
astropy/coordinates/builtin_frames/skyoffset.py
3
8147
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy import units as u from astropy.coordinates.transformations import DynamicMatrixTransform, FunctionTransform from astropy.coordinates.baseframe import (frame_transform_graph, Ba...
bsd-3-clause
-4,277,491,515,703,179,300
44.513966
115
0.66638
false
WoLpH/onkyo-eiscp
eiscp/commands.py
3
136214
# Generated # by generate_commands_module.py # from eiscp-commands.yaml # at 2013-08-04 14:40:46.165040 from collections import OrderedDict COMMANDS = OrderedDict([('main', OrderedDict([('PWR', {'description': 'System Power Command', 'name': 'system-power', 'values': OrderedDict([('00', {'description': 'set...
mit
-8,840,003,991,964,150,000
43.196626
876
0.53899
false
javo100/plugin.video.PAQUETEDIVIERTAS2
servers/hulkshare.py
43
2308
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para hulkshare # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core imp...
gpl-2.0
7,841,621,588,759,307,000
31.507042
91
0.595145
false
SmithsonianEnterprises/django-cms
cms/test_utils/project/placeholderapp_urls.py
45
1293
from cms.utils.compat.dj import is_installed from cms.utils.conf import get_cms_setting from django.conf import settings from django.conf.urls import include, url from django.conf.urls.i18n import i18n_patterns from django.contrib import admin admin.autodiscover() urlpatterns = [ url(r'^admin/', include(admin.sit...
bsd-3-clause
-3,585,035,955,383,362,600
40.709677
129
0.66744
false
asalomatov/variants
variants/test_known.py
1
2504
#!/mnt/xfs1/home/asalomatov/miniconda2/bin/python from __future__ import print_function import sys #sys.path.insert(0, '/mnt/xfs1/home/asalomatov/projects/update_vars/variants/variants') import train import numpy import pandas import os #from ggplot import * from sklearn.externals import joblib from keras.models import...
mit
7,369,483,448,799,165,000
29.536585
87
0.658147
false
ampotos/dynStruct
_dynStruct/access.py
1
10001
import binascii import _dynStruct import capstone unsigned_int_instr = [capstone.x86.X86_INS_ADCX, capstone.x86.X86_INS_ADOX, capstone.x86.X86_INS_DIV, capstone.x86.X86_INS_MUL, capstone.x86.X86_INS_MULX] xmm_regs = [xmm for xmm in range(capstone.x86.X86_REG_XMM0 - 1, capst...
mit
6,079,976,538,210,272,000
42.672489
97
0.50375
false
nickveenhof/sixpack
sixpack/test/experiment_model_test.py
2
14589
import unittest # from numbers import Number # from sixpack.db import _key from datetime import datetime import fakeredis from sixpack.models import Experiment, Alternative, Client class TestExperimentModel(unittest.TestCase): unit = True def setUp(self): self.redis = fakeredis.FakeStrictRedis() ...
bsd-2-clause
6,040,342,911,589,705,000
36.216837
117
0.62554
false
sometallgit/AutoUploader
Python27/Lib/distutils/tests/test_msvc9compiler.py
9
6049
"""Tests for distutils.msvc9compiler.""" import sys import unittest import os from distutils.errors import DistutilsPlatformError from distutils.tests import support from test.test_support import run_unittest # A manifest with the only assembly reference being the msvcrt assembly, so # should have the assembly comple...
mit
-3,585,948,453,612,352,000
31.875
78
0.653662
false
johnkeepmoving/oss-ftp
python27/win32/Lib/site-packages/setuptools/tests/test_develop.py
41
3496
"""develop tests """ import os import shutil import site import sys import tempfile import unittest from distutils.errors import DistutilsError from setuptools.command.develop import develop from setuptools.dist import Distribution SETUP_PY = """\ from setuptools import setup setup(name='foo', packages=['foo'], ...
mit
8,935,290,389,563,014,000
27.655738
129
0.536327
false
hdmetor/scikit-learn
examples/cluster/plot_kmeans_digits.py
53
4524
""" =========================================================== A demo of K-Means clustering on the handwritten digits data =========================================================== In this example we compare the various initialization strategies for K-means in terms of runtime and quality of the results. As the gr...
bsd-3-clause
-8,434,303,465,154,016,000
34.622047
79
0.595933
false
zerobatu/edx-platform
lms/djangoapps/instructor/views/api.py
7
101880
""" Instructor Dashboard API views JSON views which the instructor dashboard requests. Many of these GETs may become PUTs in the future. """ import StringIO import json import logging import re import time import requests from django.conf import settings from django.views.decorators.csrf import ensure_csrf_cookie fro...
agpl-3.0
-9,094,045,273,673,961,000
38.275251
159
0.653121
false
hlzz/dotfiles
graphics/VTK-7.0.0/IO/GeoJSON/Testing/Python/TestGeoJSONReader.py
1
3943
from __future__ import print_function import sys import vtk from vtk.test import Testing def load_geojson(input_string, feature_properties={}): '''Parses input_string with vtkGeoJSONReader, returns vtkPolyData feature_properties is a dictionary of name-default_values to attach as cell data in the ret...
bsd-3-clause
7,147,107,941,439,486,000
29.047244
77
0.585087
false
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/email/utils.py
22
13488
# Copyright (C) 2001-2010 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Miscellaneous utilities.""" __all__ = [ 'collapse_rfc2231_value', 'decode_params', 'decode_rfc2231', 'encode_rfc2231', 'formataddr', 'formatdate', 'format_datetime', 'getaddre...
gpl-3.0
-4,224,727,550,451,570,000
34.87234
79
0.637974
false
todaychi/hue
desktop/core/ext-py/Mako-0.8.1/test/test_lexer.py
36
28240
from mako.lexer import Lexer from mako import exceptions, util, compat from test.util import flatten_result from mako.template import Template import re from test import TemplateTest, eq_, assert_raises_message # create fake parsetree classes which are constructed # exactly as the repr() of a real parsetree object. # ...
apache-2.0
4,229,367,894,190,315,000
31.164009
83
0.383994
false
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/pandas/tests/dtypes/test_generic.py
7
2098
# -*- coding: utf-8 -*- from warnings import catch_warnings import numpy as np import pandas as pd from pandas.core.dtypes import generic as gt class TestABCClasses(object): tuples = [[1, 2, 2], ['red', 'blue', 'red']] multi_index = pd.MultiIndex.from_arrays(tuples, names=('number', 'color')) datetime_in...
mit
-7,111,623,542,017,201,000
51.45
78
0.663489
false
hamedhsn/incubator-airflow
tests/contrib/hooks/test_ftp_hook.py
35
3084
# -*- 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,293,907,567,266,367,000
29.534653
74
0.633268
false
gram526/VTK
Examples/Graphics/Python/SegmentAndBrokenLineSources.py
15
1389
#!/usr/bin/env python ############################################################ from vtk import * ############################################################ # Create sources line1 = vtkLineSource() line1.SetPoint1( 1, 0, 0 ) line1.SetPoint2( -1, 0, 0 ) line1.SetResolution( 32 ) points = vtkPoints() points.Insert...
bsd-3-clause
2,219,672,494,517,183,500
24.254545
60
0.676026
false
davidyezsetz/kuma
vendor/packages/ipython/IPython/FakeModule.py
12
2056
# -*- coding: utf-8 -*- """ Class which mimics a module. Needed to allow pickle to correctly resolve namespaces during IPython sessions. """ #***************************************************************************** # Copyright (C) 2002-2004 Fernando Perez. <fperez@colorado.edu> # # Distributed under the t...
mpl-2.0
3,784,876,172,737,993,700
30.151515
78
0.615759
false
dgitz/icarus_jet_pc
net/nodes/createtrainingimages.py
2
5416
#!/usr/bin/python min_factor = 0.08 #Minimum scaling factor max_factor = 0.12 #Maximum scaling factor leftmax_rotate_angle = -30.0 #Left-most maximum rotation angle, in degrees rightmax_rotate_angle = 30.0 #Right-most maximum rotation angle, in degrees import cv2 import os from os import listdir from os.path import ...
gpl-2.0
5,795,614,841,449,660,000
37.140845
265
0.736706
false
claudep/pootle
tests/commands/find_duplicate_emails.py
8
1602
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import pytest from django.core.management i...
gpl-3.0
6,190,927,134,669,527,000
30.411765
83
0.698502
false
egabancho/invenio
invenio/modules/annotations/testsuite/test_api.py
3
3609
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
gpl-2.0
2,065,326,644,972,854,300
36.59375
78
0.582156
false
cernops/nova
nova/tests/unit/virt/vmwareapi/test_read_write_util.py
10
1887
# Copyright 2013 IBM Corp. # Copyright 2011 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 ...
apache-2.0
9,035,297,542,819,451,000
41.886364
78
0.567568
false
luckydonald/python-utils
luckydonaldUtils/dependencies/install.py
2
5316
# -*- coding: utf-8 -*- from luckydonaldUtils.logger import logging try: from .pip_interface import pip_install except ImportError as e: logger = logging.getLogger(__name__) logger.warn("Could not apply logger workaround. Falling back to using pip directly.") from .pip_interface_fallback import pip_ins...
gpl-2.0
-4,576,213,748,962,197,500
35.916667
119
0.592363
false
Phonebooth/depot_tools
third_party/logilab/astng/inspector.py
19
10260
# This program 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 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be usefu...
bsd-3-clause
-4,001,310,612,407,806,500
34.50173
87
0.595419
false
Arno-Nymous/pyload
module/plugins/hoster/TenluaVn.py
7
2990
# -*- coding: utf-8 -*- import random import re from module.network.RequestFactory import getURL as get_url from ..internal.SimpleHoster import SimpleHoster from ..internal.misc import json def gen_r(): return "0." + "".join([random.choice("0123456789") for x in range(16)]) class TenluaVn(SimpleHoster): _...
gpl-3.0
5,634,794,185,604,538,000
32.595506
102
0.515385
false
gugahoi/maraschino
modules/log.py
8
1033
from flask import render_template from maraschino import app, LOG_FILE from maraschino.noneditable import * from maraschino import logger from pastebin.pastebin import PastebinAPI from maraschino.tools import requires_auth import maraschino @app.route('/xhr/log') @requires_auth def xhr_log(): return render_templat...
mit
-478,173,583,844,203,500
24.825
74
0.647628
false
metal88888/F2E.im
model/favorite.py
9
2085
#!/usr/bin/env python # coding=utf-8 # # Copyright 2012 F2E.im # Do have a faith in what you're doing. # Make your life a story worth telling. import time from lib.query import Query class FavoriteModel(Query): def __init__(self, db): self.db = db self.table_name = "favorite" super(Favorit...
bsd-3-clause
-7,219,605,412,098,331,000
40.7
121
0.609592
false
rtucker/sycamore
Sycamore/support/pytz/zoneinfo/Asia/Beirut.py
9
6152
'''tzinfo timezone information for Asia/Beirut.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Beirut(DstTzInfo): '''Asia/Beirut timezone definition. See datetime.tzinfo for details''' zone = 'Asia/Beirut' _utc_tran...
gpl-2.0
6,341,336,817,846,684,000
19.506667
74
0.590052
false
AZCompTox/AZOrange
orange/OrangeWidgets/Classify/OWParamOpt.py
2
42608
""" <name>Parameter Optimizer</name> <description>Automatic optimization of learners parameters</description> <icon>icons/Opt.png</icon> <contact>Pedro Rafael Almeida</contact> <priority>7</priority> """ import string from AZutilities import dataUtilities from OWWidget import * import OWGUI import orange import AZOrang...
lgpl-3.0
-7,613,772,914,191,800,000
52.127182
445
0.577615
false
ychen820/microblog
y/google-cloud-sdk/lib/googlecloudsdk/compute/subcommands/backend_services/add_backend.py
4
3198
# Copyright 2014 Google Inc. All Rights Reserved. """Command for adding a backend to a backend service.""" import copy from googlecloudsdk.calliope import exceptions from googlecloudsdk.compute.lib import backend_services_utils from googlecloudsdk.compute.lib import base_classes class AddBackend(base_classes.ReadWri...
bsd-3-clause
-3,025,253,970,019,805,000
32.663158
76
0.679487
false
EmanueleCannizzaro/scons
test/Libs/SharedLibrary-update-deps.py
1
2591
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
mit
-7,112,565,602,712,549,000
36.014286
112
0.745658
false
denisff/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_bitfields.py
46
8643
from ctypes import * import unittest import os import ctypes import _ctypes_test class BITS(Structure): _fields_ = [("A", c_int, 1), ("B", c_int, 2), ("C", c_int, 3), ("D", c_int, 4), ("E", c_int, 5), ("F", c_int, 6), ...
apache-2.0
393,931,840,046,793,100
34.422131
93
0.469629
false
eayunstack/horizon
openstack_dashboard/dashboards/admin/routers/tabs.py
50
1549
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic...
apache-2.0
5,346,667,285,619,817,000
37.725
78
0.761136
false
rdhyee/cookiecutter_test
setup.py
1
1548
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read().replace('.. :changelog:', ...
bsd-3-clause
-6,297,815,846,297,164,000
26.157895
63
0.620155
false
TeamHG-Memex/autologin
tests/test_autologin.py
1
3571
import pytest import unittest from autologin import AutoLogin, AutoLoginException from tests.mockserver import MockServer, PORT, Login, LoginNoChangeCookie, \ LoginCheckProxy from tests.proxy import PROXY_PORT def test_login_request(): al = AutoLogin() html = ''' <form method="POST" action="."> ...
apache-2.0
8,318,888,454,725,512,000
36.589474
77
0.593391
false
mcclurmc/xen
tools/python/xen/xend/server/ConsoleController.py
49
1310
from xen.xend.server.DevController import DevController from xen.xend.XendLogging import log from xen.xend.XendError import VmError class ConsoleController(DevController): """A dummy controller for us to represent serial and vnc console devices with persistent UUIDs. """ valid_cfg = ['location', 'uui...
gpl-2.0
-6,386,599,191,117,471,000
33.473684
79
0.647328
false
khchine5/xl
lino_xl/lib/events/fixtures/vor.py
1
10131
# -*- coding: UTF-8 -*- # Copyright 2013-2014 Luc Saffre # License: BSD (see file COPYING for details) """ """ from __future__ import unicode_literals from lino.api import dd, rt from lino.utils import i2d Country = dd.resolve_model("countries.Country") City = dd.resolve_model("countries.Place") Type = dd.resolve_mode...
bsd-2-clause
-7,455,656,731,788,142,000
36.674157
77
0.5593
false
JTarball/docker-django-polymer-starter-kit
docker/app/app/backend/apps/_archive/content/admin.py
8
2614
from django.contrib import admin from content.models import Post, Language, Category, SubCategory, PostNode, PostCard, Update, Comment, CommentCard, Dependency, Troubleshooting, Issue class PostAdmin(admin.ModelAdmin): #date_hierarchy = "created_at" #field = ("published", "title", "slug", "updated_at", "auth...
isc
8,995,701,318,955,002,000
29.045977
150
0.694721
false
emsrc/hitaext
lib/htxt/gui.py
1
31920
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2007-2013 by # Erwin Marsi and TST-Centrale # # # This file is part of the Hitaext program. # # The Hitaext 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 S...
gpl-3.0
-4,358,360,901,107,539,000
36.954816
114
0.509211
false
aoakeson/home-assistant
tests/util/test_dt.py
4
4802
"""Test Home Assistant date util methods.""" # pylint: disable=too-many-public-methods import unittest from datetime import datetime, timedelta import homeassistant.util.dt as dt_util TEST_TIME_ZONE = 'America/Los_Angeles' class TestDateUtil(unittest.TestCase): """Test util date methods.""" def setUp(self)...
mit
6,260,780,298,936,296,000
34.051095
78
0.622865
false
davidfather/TizenRT
external/iotjs/deps/jerry/tools/js2c.py
33
3950
#!/usr/bin/env python # Copyright JS Foundation and other contributors, http://js.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....
apache-2.0
-7,376,069,163,883,445,000
30.349206
109
0.598987
false
turbokongen/home-assistant
homeassistant/components/ping/device_tracker.py
9
4625
"""Tracks devices by sending a ICMP echo request (ping).""" from datetime import timedelta import logging import subprocess import sys from icmplib import SocketPermissionError, ping as icmp_ping import voluptuous as vol from homeassistant import const, util from homeassistant.components.device_tracker import PLATFOR...
apache-2.0
-5,301,725,473,579,390,000
30.25
80
0.610595
false
LumPenPacK/NetworkExtractionFromImages
win_build/nefi2_win_amd64_msvc_2015/tools/pyqtdeploy/pyqtdeploy/gui/exception_handlers.py
1
1651
# Copyright (c) 2014, Riverbank Computing Limited # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of c...
bsd-2-clause
6,005,242,608,227,723,000
42.447368
78
0.76378
false
wong2/gunicorn
examples/when_ready.conf.py
4
1067
import signal import commands import threading import time max_mem = 100000 class MemoryWatch(threading.Thread): def __init__(self, server, max_mem): super(MemoryWatch, self).__init__() self.daemon = True self.server = server self.max_mem = max_mem self.timeout = serve...
mit
2,480,432,556,739,973,600
27.078947
78
0.540769
false
Laurawly/tvm-1
tests/python/unittest/test_te_verify_compute.py
5
2428
# 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 u...
apache-2.0
-2,562,394,316,911,468,000
28.609756
71
0.606672
false
yephper/django
tests/raw_query/models.py
1
1298
from django.db import models class Author(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) dob = models.DateField() def __init__(self, *args, **kwargs): super(Author, self).__init__(*args, **kwargs) # Protect against a...
bsd-3-clause
-5,808,809,182,959,689,000
30.45
97
0.656394
false
geosolutions-it/ckanext-geonetwork
ckanext/geonetwork/harvesters/utils.py
2
1941
# -*- coding: utf-8 -*- import logging #import re import urllib import urllib2 import zipfile from StringIO import StringIO from lxml import etree GEONETWORK_V26 = "2.6" GEONETWORK_V210 = "2.10" GEONETWORK_VERSIONS = [GEONETWORK_V26, GEONETWORK_V210] logger = logging.getLogger(__name__) class GeoNetworkClient(objec...
gpl-3.0
-8,594,300,413,167,136,000
25.958333
103
0.556414
false
kose-y/pylearn2
pylearn2/scripts/mlp/predict_csv.py
44
4691
#!/usr/bin/env python # coding: utf-8 """ Script to predict values using a pkl model file. This is a configurable script to make predictions. Basic usage: .. code-block:: none predict_csv.py pkl_file.pkl test.csv output.csv Optionally it is possible to specify if the prediction is regression or classification ...
bsd-3-clause
-6,073,500,448,119,417,000
31.344828
105
0.615352
false
slimcoin-project/Slimcoin
contrib/bitrpc/bitrpc.py
4
7840
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:41683") else: access = Se...
mit
5,070,777,812,789,766,000
23.197531
79
0.661862
false
frederick-masterton/django
django/contrib/gis/tests/geoapp/test_feeds.py
12
4346
from __future__ import unicode_literals from unittest import skipUnless from xml.dom import minidom from django.conf import settings from django.contrib.sites.models import Site from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import HAS_SPATIAL_DB from django.test import TestCase, mod...
bsd-3-clause
7,450,322,027,230,693,000
46.758242
103
0.650023
false
jordan-developer/pyOCNI
pyocni/suppliers/resourceSupplier.py
2
6610
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # Copyright (C) 2011 Houssem Medhioub - Institut Mines-Telecom # # 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 Fo...
apache-2.0
4,743,949,110,524,539,000
26.890295
97
0.569592
false
sdague/home-assistant
homeassistant/auth/permissions/merge.py
19
1786
"""Merging of policies.""" from typing import Dict, List, Set, cast from .types import CategoryType, PolicyType def merge_policies(policies: List[PolicyType]) -> PolicyType: """Merge policies.""" new_policy: Dict[str, CategoryType] = {} seen: Set[str] = set() for policy in policies: for categ...
apache-2.0
737,417,408,198,421,800
26.476923
73
0.581747
false
HybridF5/jacket
jacket/tests/storage/unit/volume/drivers/emc/scaleio/test_manage_existing.py
1
5492
# Copyright (c) 2016 EMC Corporation. # 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 # # Un...
apache-2.0
8,863,677,949,633,148,000
41.587302
78
0.576475
false
vit2/vit-e2
lib/python/Screens/InfoBarGenerics.py
1
100355
from ChannelSelection import ChannelSelection, BouquetSelector, SilentBouquetSelector from Components.ActionMap import ActionMap, HelpableActionMap from Components.ActionMap import NumberActionMap from Components.Harddisk import harddiskmanager from Components.Input import Input from Components.Label import Label from...
gpl-2.0
-2,611,762,494,794,469,000
32.653588
216
0.71834
false
salspaugh/splparser
splparser/lexers/toplexer.py
1
5030
#!/usr/bin/env python import ply.lex from ply.lex import TOKEN import re from splparser.regexes.searchregexes import * from splparser.exceptions import SPLSyntaxError tokens = [ 'COMMA', 'WILDCARD', 'EQ', 'IPV4ADDR', 'IPV6ADDR', 'EMAIL','HOSTNAME', 'URL', 'PATH', 'US_PHONE', 'WORD', 'INT'...
bsd-3-clause
-6,684,632,810,067,020,000
19.699588
79
0.599602
false
shawnadelic/shuup
shuup/notify/admin_module/__init__.py
2
3876
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.core.exceptions import ...
agpl-3.0
46,661,231,146,315,830
37
101
0.614551
false
ababic/waddleadmin
waddleadmin/helpers/url.py
1
1589
from __future__ import unicode_literals from django.contrib.admin.utils import quote from django.core.urlresolvers import reverse from django.utils.http import urlquote from wagtail.contrib.modeladmin.helpers import ( AdminURLHelper as WagtailAdminURLHelper, PageAdminURLHelper as WagtailPageAdminURLHelper ) ...
mit
-6,192,402,966,888,174,000
39.74359
77
0.662681
false
pymagic-org/pymagic_driver
bmp180.py
1
5278
import pyb from struct import unpack as unp # BMP180 default address BMP180_I2CADDR = 0x77 # Operating Modes BMP180_ULTRALOWPOWER = 0 BMP180_STANDARD = 1 BMP180_HIGHRES = 2 BMP180_ULTRAHIGHRES = 3 # BMP180 Registers BMP180_CAL_AC1 = 0xAA BMP180_CAL_AC2 = 0xAC BMP180_...
mit
7,641,198,691,529,508,000
37.246377
81
0.555324
false
gibiansky/tensorflow
tensorflow/contrib/deprecated/__init__.py
9
4576
# Copyright 2016 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
-5,136,313,745,253,109,000
46.175258
80
0.769231
false
HaraldWeber/client
src/config/__init__.py
1
3081
__author__ = 'Sheeo' import os import sys import version import logging from logging.handlers import RotatingFileHandler from PyQt4 import QtCore _settings = QtCore.QSettings("ForgedAllianceForever", "FA Lobby") class Settings(object): """ This wraps QSettings, fetching default values from the selected ...
gpl-3.0
-4,364,117,400,433,639,000
33.617978
102
0.59656
false
RafaelRMachado/qtwebkit
Source/WTF/WTF.vcxproj/work-around-vs-dependency-tracking-bugs.py
13
2585
#!/usr/bin/env python import glob import os import re import sys # It's fragile to rely on the location of this script to find the top-level # source directory. TOP_LEVEL_DIRECTORY = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) WEBKIT_LIBRARIES = os.environ['WEBKIT_LI...
gpl-2.0
8,825,537,818,848,532,000
38.166667
115
0.692456
false
infoINGenieria/Zweb
z_web/costos/migrations/0025_auto_20170910_1318.py
1
2595
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0019_auto_20170813_1123'), ('parametros', '0005_auto_20160423_1019'), ('costos', '0024_auto_20170910_1209'), ] ...
gpl-2.0
-6,774,689,786,310,076,000
39.453125
140
0.541908
false
ZHAW-INES/rioxo-uClinux-dist
user/python/python-2.4.4/Mac/Tools/IDE/Wquicktime.py
4
3469
import os from Carbon import Qd from Carbon import Win from Carbon import Qt, QuickTime import W from Carbon import File from Carbon import Evt, Events _moviesinitialized = 0 def EnterMovies(): global _moviesinitialized if not _moviesinitialized: Qt.EnterMovies() _moviesinitialized = 1 class ...
gpl-2.0
-5,461,630,728,268,689,000
29.699115
96
0.555203
false
AnselCmy/ARPS
report_proposal.py
1
3359
#!/usr/bin/env python # -*- coding:utf-8 -*- from __future__ import print_function import sys import re import time reload(sys) sys.setdefaultencoding('utf8') import pymongo as pm cs_labels = ['计算机网络', '信息安全', '云计算&大数据', '机器学习&模式识别', '数据科学', '计算机图形学&图像处理', '计算机教学', '数据库', '计算机组成与结构', '人机交互', '软件技术', '计算机应用', '...
mit
-7,529,311,655,118,725,000
29.520833
97
0.601912
false
mitodl/lmod_proxy
lmod_proxy/web.py
1
2179
# -*- coding: utf-8 -*- """Root flask application for lmod_proxy""" import json import OpenSSL.crypto from .config import LMODP_CERT from datetime import datetime from flask import Flask, redirect, url_for from passlib.apache import HtpasswdFile from lmod_proxy import __project__ from lmod_proxy.auth import requires_...
agpl-3.0
-4,694,407,644,492,820,000
28.849315
78
0.623222
false
azavea/nyc-trees
src/nyc_trees/apps/home/training/routes.py
3
1471
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.contrib.auth.decorators import login_required from django_tinsel.decorators import route, render_template from django_tinsel.utils import decorate as do from apps.users.vie...
agpl-3.0
159,455,125,249,875,520
30.978261
78
0.664174
false
jxta/cc
vendor/Twisted-10.0.0/twisted/internet/test/test_threads.py
4
6106
# Copyright (c) 2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for implementations of L{IReactorThreads}. """ __metaclass__ = type from weakref import ref import gc from twisted.internet.test.reactormixins import ReactorBuilder from twisted.python.threadpool import ThreadPool class ThreadT...
apache-2.0
-8,656,049,951,480,084,000
36.460123
79
0.660007
false
AnishShah/tensorflow
tensorflow/contrib/estimator/python/estimator/export.py
6
9460
# Copyright 2018 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
-2,163,381,448,625,918,000
41.421525
174
0.730338
false
xuru/pyvisdk
pyvisdk/do/license_source.py
1
1044
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def LicenseSource(vim, *args, **kwargs): '''This data object type is used to communicate ...
mit
-4,995,339,743,859,988,000
29.735294
124
0.597701
false
vityagi/azure-linux-extensions
VMEncryption/main/oscrypto/rhel_68/encryptstates/PatchBootSystemState.py
8
6049
#!/usr/bin/env python # # VM Backup extension # # Copyright 2015 Microsoft 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 # # U...
apache-2.0
3,507,540,613,643,794,000
41.006944
127
0.631344
false
mosbasik/buzhug
javasrc/lib/Jython/Lib/test/test_random.py
9
21793
#!/usr/bin/env python import unittest import random import time import pickle import warnings from math import log, exp, sqrt, pi from test import test_support class TestBasicOps(unittest.TestCase): # Superclass with tests common to all generators. # Subclasses must arrange for self.gen to retrieve the Random...
bsd-3-clause
-9,055,497,666,217,425,000
38.055556
88
0.569862
false
CompassionCH/compassion-modules
crm_request/models/holiday_closure.py
3
1153
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2019 Compassion CH (http://www.compassion.ch) # @author: Quentin Gigon <gigon.quentin@gmail.com> # # The licence is in the file __manifest__.py # ############################################...
agpl-3.0
-6,084,692,401,030,151,000
36.193548
78
0.53686
false
mark-adams/django-waffle
waffle/tests/test_middleware.py
14
1578
from django.http import HttpResponse from django.test import RequestFactory from waffle.middleware import WaffleMiddleware get = RequestFactory().get('/foo') def test_set_cookies(): get.waffles = {'foo': [True, False], 'bar': [False, False]} resp = HttpResponse() assert 'dwf_foo' not in resp.cookies ...
bsd-3-clause
-1,903,850,581,952,319,200
31.204082
77
0.6109
false
markovmodel/adaptivemd
setup.py
2
1953
from pprint import pprint import sys, os, shutil try: from setuptools import setup, Command, find_packages except ImportError as e: print("Needs setuptools to install") sys.exit(1) try: import yaml except ImportError as e: print("Needs pyyaml to install") sys.exit(1) # +--------------------...
lgpl-2.1
-2,117,176,535,561,625,900
23.721519
80
0.554019
false
bstroebl/QGIS
python/plugins/sextante/saga/SplitRGBBands.py
1
3473
# -*- coding: utf-8 -*- """ *************************************************************************** SplitRGBBands.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************************...
gpl-2.0
3,618,545,700,103,078,400
46.575342
116
0.544486
false
bioinformatics-ua/catalogue
emif/datatable/tests.py
12
1154
# -*- coding: utf-8 -*- # Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/ # # 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 vers...
gpl-3.0
-4,801,321,234,140,725,000
35.0625
108
0.727036
false
pquentin/django
tests/forms_tests/tests/test_fields.py
1
77332
# -*- coding: utf-8 -*- """ ########## # Fields # ########## Each Field class does some sort of validation. Each Field has a clean() method, which either raises django.forms.ValidationError or returns the "clean" data -- usually a Unicode object, but, in some rare cases, a list. Each Field's __init__() takes at least...
bsd-3-clause
2,720,080,960,476,381,700
52.579569
211
0.618176
false
rstens/gwells
gwells/models/ScreenIntakeMethodCode.py
1
1289
""" 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 distri...
apache-2.0
6,329,418,084,396,265
38.060606
102
0.715283
false
superchilli/webapp
config.py
1
1439
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string' SSL_DISABLE = False SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_TRACK_MODIFICATION = False SQLALCHEMY_RECORD_QUERIES = True MAIL_SERVER = 'smtp.li...
mit
-3,404,573,651,877,395,000
27.78
72
0.669215
false
waseem18/oh-mainline
vendor/packages/twill/twill/other_packages/_mechanize_dist/_clientcookie.py
20
62742
"""HTTP cookie handling for web clients. This module originally developed from my port of Gisle Aas' Perl module HTTP::Cookies, from the libwww-perl library. Docstrings, comments and debug strings in this code refer to the attributes of the HTTP cookie system as cookie-attributes, to distinguish them clearly from Pyt...
agpl-3.0
5,814,518,179,863,201,000
37.002423
83
0.588123
false
OriHoch/Open-Knesset
mks/migrations/0021_add_member_backlinks_enabled.py
14
11000
# encoding: 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): # Adding field 'Member.backlinks_enabled' db.add_column('mks_member', 'backlinks_enabled', self.gf('django...
bsd-3-clause
7,459,421,677,559,605,000
78.136691
200
0.546182
false
shiquanwang/pylearn2
pylearn2/cross_validation/train_cv_extensions.py
19
4594
""" Cross-validation training extensions. """ __author__ = "Steven Kearnes" __copyright__ = "Copyright 2014, Stanford University" __license__ = "3-clause BSD" __maintainer__ = "Steven Kearnes" import numpy as np import os from pylearn2.train import SerializationGuard from pylearn2.train_extensions.best_params import...
bsd-3-clause
-8,686,569,234,582,203,000
33.80303
78
0.603396
false
JConwayAWT/PGSS14CC
lib/python/multimetallics/ase/neb.py
2
10714
from math import sqrt import numpy as np import ase.parallel as mpi from ase.calculators.singlepoint import SinglePointCalculator from ase.io import read class NEB: def __init__(self, images, k=0.1, climb=False, parallel=False, world=None): """Nudged elastic band. images: list ...
gpl-2.0
-3,329,476,169,308,717,000
32.376947
75
0.482733
false
hzlf/openbroadcast
website/lib/util/merge.py
1
4599
from django.db import transaction from django.db.models import get_models, Model from django.contrib.contenttypes.generic import GenericForeignKey import logging logger = logging.getLogger(__name__) @transaction.commit_on_success def merge_model_objects(primary_object, alias_objects=[], keep_old=False): log = lo...
gpl-3.0
1,839,782,211,920,915,000
44.544554
148
0.651446
false
oskar456/youtube-dl
youtube_dl/extractor/noovo.py
13
3504
# coding: utf-8 from __future__ import unicode_literals from .brightcove import BrightcoveNewIE from .common import InfoExtractor from ..compat import compat_str from ..utils import ( int_or_none, js_to_json, smuggle_url, try_get, ) class NoovoIE(InfoExtractor): _VALID_URL = r'https?://(?:[^/]+\....
unlicense
4,679,593,537,187,388,000
34.01
112
0.52585
false
nemesisdesign/django
tests/model_fields/test_foreignkey.py
42
3522
from decimal import Decimal from django.apps import apps from django.core import checks from django.db import models from django.test import TestCase, skipIfDBFeature from django.test.utils import isolate_apps from django.utils import six from .models import Bar, FkToChar, Foo, PrimaryKeyCharModel class ForeignKeyT...
bsd-3-clause
-7,693,355,165,790,673,000
35.6875
100
0.631459
false
jeanmask/opps
tests/core/test_cache.py
5
1194
#!/usr/bin/env python # -*- coding: utf-8 -*- from unittest import TestCase from django.http import HttpRequest from opps.core.cache import cache_page class DecoratorsTest(TestCase): def test_cache_page_new_style(self): """ Test that we can call cache_page the new way """ def my_...
mit
1,234,804,438,560,658,200
30.421053
69
0.624791
false
jkonecki/autorest
AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/multiple_responses.py
5
54689
# 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
755,333,431,665,381,200
36.638679
84
0.634954
false
ohsailey/MAD-IS
mad_interface_server/views/communicate.py
1
10093
''' Copyright (c) 2014 OpenISDM Project Name: OpenISDM MAD-IS Version: 1.0 File Name: communicate.py Abstract: communicate.py is a module of Interface Server (IS) of Mobile Assistance for Disasters (MAD) in the OpenISDM Virt...
gpl-3.0
-2,992,886,536,795,352,000
27.51462
79
0.579213
false
anbangleo/NlsdeWeb
Python-3.6.0/Lib/json/encoder.py
4
16020
"""Implementation of JSONEncoder """ import re try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from _json import encode_basestring as c_encode_basestring except ImportError: c_encode_basestring = None try: from _j...
mit
-111,930,662,550,374,030
35.326531
78
0.528589
false
tradej/pykickstart-old
pykickstart/handlers/rhel3.py
10
3894
# # Chris Lumens <clumens@redhat.com> # # Copyright 2007 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that it # will be usef...
gpl-2.0
4,120,978,417,579,551,000
44.27907
79
0.694145
false
mfazekas/safaridriver
selenium/src/py/lib/docutils/core.py
5
27509
# Authors: David Goodger # Contact: goodger@python.org # Revision: $Revision: 4361 $ # Date: $Date: 2006-02-28 23:33:41 +0100 (Tue, 28 Feb 2006) $ # Copyright: This module has been placed in the public domain. """ Calling the ``publish_*`` convenience functions (or instantiating a `Publisher` object) with comp...
apache-2.0
1,154,422,403,144,568,600
42.730081
81
0.608019
false
timbennett/twitter-tools
get_followers.py
1
2031
''' Get the user IDs of everyone who follows a certain account, written into username.txt. Usage: python get_followers.py username Twitter users have a screen name, which is changeable, and a user ID, which is permanent. This script returns the latter, because Twitter returns 5000 followers per query by this method,...
mit
3,929,431,864,385,541,600
29.313433
114
0.6903
false
ragupta-git/ImcSdk
imcsdk/mometa/mgmt/MgmtController.py
1
5087
"""This module contains the general information for MgmtController ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class MgmtControllerConsts: SUBJECT_SAS_EXPANDER = "SAS Expander" SUBJECT_ADAPTOR = "adaptor" SUBJEC...
apache-2.0
982,515,583,627,515,400
54.293478
383
0.610183
false
CiscoSystems/nova
nova/tests/integrated/v3/test_flavor_manage.py
20
1578
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
258,590,737,368,351,400
35.697674
78
0.634981
false
AdrianRibao/notifintime
docs/source/conf.py
2
8083
# -*- coding: utf-8 -*- # # django-users documentation build configuration file, created by # sphinx-quickstart on Thu Jul 19 12:19:01 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
bsd-3-clause
-8,799,851,572,573,176,000
31.841463
193
0.706028
false
openstack/vitrage
vitrage/evaluator/template_functions/v2/__init__.py
1
1691
# Copyright 2019 - Nokia # # 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, sof...
apache-2.0
-1,409,433,809,184,499,700
36.577778
78
0.745121
false