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
shyamalschandra/picochess
server.py
2
9171
#!/usr/bin/env python # Copyright (C) 2013-2014 Jean-Francois Romang (jromang@posteo.de) # Shivkumar Shivaji () # # 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...
gpl-3.0
7,047,831,063,330,097,000
34.273077
167
0.59819
false
sunjincheng121/flink
flink-python/pyflink/table/tests/test_environment_settings.py
13
5290
################################################################################ # 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...
apache-2.0
1,773,832,937,216,332,800
38.774436
99
0.679395
false
Nick-OpusVL/odoo
addons/sale/wizard/__init__.py
444
1129
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
1,724,158,854,674,093,800
42.423077
78
0.627989
false
mxOBS/deb-pkg_trusty_chromium-browser
third_party/webdriver/pylib/test/selenium/webdriver/common/rendered_webelement_tests.py
28
2265
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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 requir...
bsd-3-clause
-8,226,931,401,569,406,000
34.390625
83
0.70596
false
zevanzhao/TCCL-Code
Misc/xyz2mode.py
1
1906
#!/usr/bin/env python """ This script is similiar to modemake.pl. The script will generate DIMER_VECTOR in CP2K. """ from XYZFile import * import sys, copy def GetDiffXYZ(XYZ1, XYZ2): """ Get the difference of two XYZ file. A DIMER VECTOR or MODECAR is made from this difference. """ DiffXYZ = XYZ()...
gpl-3.0
35,441,942,985,437,564
28.78125
129
0.637461
false
dtroyer/python-openstacksdk
openstack/tests/unit/cloud/test_qos_policy.py
1
13244
# Copyright 2017 OVH SAS # 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 agreed ...
apache-2.0
-8,820,054,015,115,783,000
40.130435
78
0.502567
false
KlaasDeNys/Arduino
arduino-core/src/processing/app/i18n/python/requests/sessions.py
151
15091
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from datetime import datetime from .compat import cookielib from .cookies import cookiejar_from_dict from .models import Request,...
lgpl-2.1
7,249,836,560,818,372,000
30.972458
115
0.585581
false
DirtyUnicorns/android_external_chromium-org
ppapi/generators/idl_generator.py
165
8397
#!/usr/bin/env python # Copyright (c) 2012 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. import sys from idl_log import ErrOut, InfoOut, WarnOut from idl_option import GetOption, Option, ParseOptions from idl_parser imp...
bsd-3-clause
-7,713,490,069,690,885,000
29.314079
79
0.636894
false
ehashman/oh-mainline
vendor/packages/Pygments/pygments/lexers/special.py
270
3080
# -*- coding: utf-8 -*- """ pygments.lexers.special ~~~~~~~~~~~~~~~~~~~~~~~ Special lexers. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import cStringIO from pygments.lexer import Lexer from pygments.token import Token,...
agpl-3.0
3,412,416,267,934,151,000
29.8
75
0.542857
false
ngoclinh84phys/QE_finite_field
dev-tools/src-normal.py
20
6001
#!/usr/bin/env python # (C) 2010 Norbert Nemec # # USAGE: src-normal.py < input.f90 > output.f90 # # Script to normalize Fortran source code: # a) expand tabs to spaces (tab width 8 characters # b) remove trailing space # c) normalize multiword keywords # d) normalize capitalization of keywords and intrinsics ...
gpl-2.0
6,180,127,024,157,767,000
25.790179
104
0.64256
false
Fireblend/chromium-crosswalk
tools/perf/page_sets/key_mobile_sites_repaint.py
5
7857
# Copyright 2014 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module from page_sets import key_mobile_sites_pages from page_...
bsd-3-clause
-3,172,912,236,625,451,500
39.292308
103
0.678503
false
fspaolo/scikit-learn
examples/cluster/plot_kmeans_digits.py
8
4495
""" =========================================================== A demo of K-Means clustering on the handwritten digits data =========================================================== In this example with compare the various initialization strategies for K-means in terms of runtime and quality of the results. As the ...
bsd-3-clause
9,016,195,088,582,753,000
34.393701
79
0.594883
false
wmbutler/courtlistener
alert/corpus_importer/lawbox/generate_judge_stats.py
2
4545
import datetime import pickle import pprint import argparse import time from alert.corpus_importer.lawbox.import_law_box import ( get_judge, get_court_object, get_html_from_raw_text, ) from alert.search.models import Court DEBUG = 4 ########################################## # This variable is used to do statis...
agpl-3.0
3,346,779,324,005,375,500
38.868421
119
0.5967
false
proxysh/Safejumper-for-Mac
buildlinux/env64/lib/python2.7/site-packages/twisted/python/shortcut.py
12
2441
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """Creation of Windows shortcuts. Requires win32all. """ from win32com.shell import shell import pythoncom import os def open(filename): """Open an existing shortcut for reading. @return: The shortcut object @rtype: Shortcut ...
gpl-2.0
6,832,442,379,185,030,000
31.118421
80
0.598116
false
skapfer/rubber
src/tex.py
1
14284
# This file is part of Rubber and thus covered by the GPL # (c) Emmanuel Beffara, 2008 # vim: noet:ts=4 """ General-purpose classes for reading TeX code. Classes and functions from this module can be used without Rubber. """ import re from io import StringIO # The catcodes EOF = -2 CSEQ = -1 ESCAPE = 0 OPEN = 1 CLOS...
gpl-2.0
2,797,327,243,951,643,000
26.682171
89
0.506511
false
iovation/launchkey-python
launchkey/utils/shared.py
2
5725
""" Shared Utilities """ from functools import wraps from uuid import UUID import warnings import six from jwkest import JWKESTException from ..exceptions import InvalidIssuerFormat, InvalidIssuerVersion, \ JWTValidationFailure, InvalidJWTResponse, WebhookAuthorizationError, \ XiovJWTValidationFailure, XiovJ...
mit
-5,356,389,399,389,039,000
35.006289
79
0.644891
false
jjmachan/activityPointsApp
activitypoints/lib/python3.5/site-packages/django/core/cache/backends/filebased.py
73
5319
"File-based cache backend" import errno import glob import hashlib import io import os import random import tempfile import time import zlib from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.core.files.move import file_move_safe from django.utils.encoding import force_bytes try: f...
mit
2,680,916,587,182,116,400
33.764706
84
0.57492
false
secondstory/dewpoint
libcloud/providers.py
1
2585
# 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 use ...
apache-2.0
7,735,479,051,597,986,000
38.166667
74
0.69323
false
bsmr-ansible/ansible-modules-extras
files/blockinfile.py
7
9731
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, 2015 YAEGASHI Takeshi <yaegashi@debian.org> # # This file is part of Ansible # # Ansible 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 ...
gpl-3.0
-5,859,433,097,651,414,000
30.089457
124
0.60929
false
LightberryEu/plugin.program.hyperion.configurator
resources/lib/Led.py
1
6398
import json class Led: def __init__(self): self.x_start = 0 self.x_end = 0 self.y_start = 0 self.y_end = 0 self.position = 0 self.color = bytearray([0,0,0]) def setCoordinates(self, in_x_start, in_x_end, in_y_start,in_y_end): self.x_start = in_x_start self.x_end = in_x_end self.y_st...
gpl-2.0
-684,550,313,806,654,500
37.012195
129
0.662863
false
rittersport3/CityWatchers
boilerplate/external/httplib2/__init__.py
83
64159
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright...
lgpl-3.0
-1,662,337,992,665,416,700
41.265481
235
0.587478
false
liaorubei/depot_tools
third_party/gsutil/gslib/addlhelp/prod.py
51
8580
# Copyright 2012 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...
bsd-3-clause
5,415,862,029,930,760,000
52.625
79
0.765501
false
caioserra/apiAdwords
examples/adspygoogle/dfp/v201308/get_all_orders.py
2
1619
#!/usr/bin/python # # Copyright 2013 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 b...
apache-2.0
1,195,587,120,636,674,800
33.446809
80
0.718962
false
slgobinath/SafeEyes
safeeyes/plugins/audiblealert/plugin.py
1
2359
#!/usr/bin/env python # Safe Eyes is a utility to remind you to take break frequently # to protect your eyes from eye strain. # Copyright (C) 2017 Gobinath # 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...
gpl-3.0
-8,379,223,866,682,541,000
28.860759
95
0.688851
false
maxisi/gwsumm
gwsumm/html/utils.py
1
1587
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2013) # # This file is part of GWSumm. # # GWSumm 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) ...
gpl-3.0
7,918,633,420,352,642,000
32.787234
74
0.653434
false
chrismeyersfsu/ansible
lib/ansible/modules/network/dellos6/dellos6_command.py
32
6660
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # # Copyright (c) 2016 Dell Inc. # # This file is part of Ansible # # Ansible 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 versi...
gpl-3.0
-3,904,057,700,746,909,000
29.833333
83
0.653754
false
openwisp/django-netjsonconfig
django_netjsonconfig/tests/test_views.py
1
1185
from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse User = get_user_model() class TestViews(TestCase): """ tests for django_netjsonconfig.views """ def setUp(self): User.objects.create_superuser( username='admin', passwo...
gpl-3.0
561,502,092,984,339,260
31.916667
75
0.643882
false
ergs/rickshaw
tests/test_choose_niches.py
1
1257
# -*- coding: utf-8 -*- """ Created on Fri Sep 23 10:49:39 2016 @author: adam """ import pytest from rickshaw.simspec import SimSpec, def_niches, def_commodities from rickshaw.generate import random_niches, choose_commodity, choose_commodities @pytest.mark.parametrize("i", range(100)) def test_random_niches(i): s...
bsd-3-clause
-3,161,080,474,548,095,000
30.425
101
0.675418
false
Barmaley-exe/scikit-learn
examples/tree/plot_iris.py
271
2186
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
bsd-3-clause
-5,256,231,851,708,946,000
27.025641
78
0.58097
false
amondot/QGIS
python/plugins/processing/algs/lidar/lastools/lasgrid.py
9
3382
# -*- coding: utf-8 -*- """ *************************************************************************** lasgrid.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com --------------------- D...
gpl-2.0
-4,707,366,093,024,928,000
42.358974
81
0.578356
false
qubitcoin/QubitCoin-p2pool
p2pool/web.py
6
25283
from __future__ import division import errno import json import os import sys import time import traceback from twisted.internet import defer from twisted.python import log from twisted.web import resource, static import p2pool from bitcoin import data as bitcoin_data from . import data as p2pool_data from util impo...
gpl-3.0
1,099,758,611,428,907,500
55.059867
260
0.631136
false
lardissone/mcfinance
mcfinance/settings.py
1
2971
""" Django settings for mcfinance project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ from mongoengine import connect # Build paths inside the project like t...
mit
-2,923,366,692,722,441,700
23.553719
71
0.733423
false
egaxegax/django-dbcartajs
django/contrib/flatpages/templatetags/flatpages.py
227
3631
from django import template from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import get_current_site register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self....
gpl-2.0
-4,807,135,271,542,821,000
34.598039
74
0.616635
false
ABaldwinHunter/django-clone
django/contrib/gis/utils/ogrinspect.py
391
9090
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O...
bsd-3-clause
4,898,510,895,667,357,000
37.033473
92
0.624532
false
thumbimigwe/echorizr
lib/python2.7/site-packages/django/utils/log.py
84
5261
from __future__ import unicode_literals import logging import logging.config # needed when logging_config doesn't start with logging.config import sys import warnings from copy import copy from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.utils.depr...
mit
5,132,518,794,192,669,000
32.509554
90
0.623075
false
javiergarridomellado/Empresa_django
devcodela/lib/python2.7/site-packages/django/contrib/messages/api.py
321
2952
from django.contrib.messages import constants from django.contrib.messages.storage import default_storage __all__ = ( 'add_message', 'get_messages', 'get_level', 'set_level', 'debug', 'info', 'success', 'warning', 'error', ) class MessageFailure(Exception): pass def add_message(request, level, mess...
gpl-2.0
8,667,711,474,014,288,000
27.941176
78
0.645325
false
romankagan/DDBWorkbench
python/lib/Lib/datetime.py
74
74800
"""Concrete date/time and related types -- prototype implemented in Python. See http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage See also http://dir.yahoo.com/Reference/calendars/ For a primer on DST, including many current DST rules, see http://webexhibits.org/daylightsaving/ For more about DST than you e...
apache-2.0
-1,788,848,857,167,292,200
34.99615
89
0.563369
false
lodemo/CATANA
src/face_recognition/youtube_dl/extractor/tvp.py
22
8498
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, clean_html, get_element_by_attribute, ExtractorError, ) class TVPIE(InfoExtractor): IE_NAME = 'tvp' IE_DESC = 'Telewizja Polska' _VALID_URL = r'https?:...
mit
6,646,843,938,213,271,000
36.530973
111
0.511908
false
milkey-mouse/SongRater
flasktasks.py
1
4842
# -*- coding: cp1252 -*- #Copyright Milkey Mouse 2015 from HTMLParser import HTMLParser import simplejson as json import celery from celery import Celery from flask import render_template from flask.ext.gzip import Gzip from celery import task from flask import Flask import datetime import urllib2 import string import ...
mit
7,243,354,705,898,804,000
33.820144
104
0.426446
false
Arcanemagus/SickRage
sickbeard/traktTrending.py
6
5411
# coding=utf-8 from __future__ import print_function, unicode_literals import os import posixpath from libtrakt.exceptions import traktException from libtrakt.trakt import TraktAPI import sickbeard from sickbeard import helpers, logger from sickbeard.indexers.indexer_config import INDEXER_TVDB from sickrage.helper....
gpl-3.0
4,460,796,137,083,000,300
39.081481
158
0.563297
false
pieiscool/edited-hearthbreaker
tests/agents/trade_agent_tests.py
2
1499
import unittest from hearthbreaker.cards import Wisp, WarGolem, BloodfenRaptor, RiverCrocolisk, AbusiveSergeant, ArgentSquire from tests.agents.trade.test_helpers import TestHelpers from tests.agents.trade.test_case_mixin import TestCaseMixin from hearthbreaker.agents.trade.possible_play import PossiblePlays class Te...
mit
4,464,051,441,537,592,300
33.860465
109
0.677785
false
cyberark-bizdev/ansible
test/units/modules/network/netscaler/netscaler_module.py
57
1638
import sys from ansible.compat.tests.mock import patch, Mock from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase base_modules_mock = Mock() nitro_service_mock = Mock() nitro_exception_mock = Mock() base_modules_to_mock = { 'nssrc': base_modules_mock, 'nssrc.com': base_modules_mo...
gpl-3.0
2,779,889,809,877,129,700
36.227273
103
0.718559
false
CAChemE/stochastic-optimization
ConventionalDistillationColumn/column_algorithm.py
1
2956
# -*- coding: utf-8 -*- from Test_Column_ObjFnc import tac_column import time """ % ------------------------------------------------------------------------- % SIMULATION-BASED OPTIMIZATION OF A SINGLE CONVENTIONAL DISTILLATION % COLUMN USING THE PARTICLE SWARM OPTIMIZATION ALGORITHM %----------------------...
bsd-3-clause
-8,751,511,323,158,388,000
35.481481
104
0.572589
false
chris-lee-mc/MutInf
cluster_list_to_pml.py
1
20752
import re, os, sys from optparse import OptionParser from numpy import * import subprocess from communities import * class ResCluster : members = [] selection_text = None #selection text for pymol number = 0 #cluster number intra_cluster_variance = 0 extra_cluster_variance = 0 indexlist = [] ...
gpl-3.0
7,366,411,161,771,070,000
45.321429
298
0.610254
false
thanethomson/statik
tests/integration/test_issue_51.py
1
1717
# -*- coding: utf-8 -*- """Regression test for issue #51.""" import unittest import os.path from xml.etree import ElementTree as ET from statik.generator import generate class TestStaticPagesFromProjectDynamicContext(unittest.TestCase): def test_issue(self): test_path = os.path.dirname(os.path.realpath...
mit
3,257,167,400,426,198,000
35.531915
87
0.616773
false
ibc/MediaSoup
worker/deps/gyp/test/cflags/gyptest-cflags.py
38
2088
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies the use of the environment during regeneration when the gyp file changes, specifically via build of an executable with C prepro...
isc
5,303,447,971,223,246,000
26.84
75
0.692529
false
bnwn/ardupilot
mk/VRBRAIN/Tools/genmsg/src/genmsg/srvs.py
51
3095
# Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # 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 ...
gpl-3.0
-4,494,958,927,959,344,000
37.679487
109
0.666882
false
gauribhoite/personfinder
env/google_appengine/gen_protorpc.py
69
3127
#!/usr/bin/env python # # 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 applicable law o...
apache-2.0
148,038,806,506,499,600
22.511278
80
0.709946
false
pombredanne/teamwork
w2/static/Brython2.0.0-20140209-164925/Lib/tokenize.py
728
24424
"""Tokenization help for Python programs. tokenize(readline) is a generator that breaks a stream of bytes into Python tokens. It decodes the bytes according to PEP-0263 for determining source file encoding. It accepts a readline-like method which is called repeatedly to get the next line of input (or b"" for EOF). ...
gpl-2.0
-5,714,173,533,827,550,000
34.812317
83
0.514699
false
qt911025/pw_module_system
header_operations.py
2
141015
################################################### # header_operations.py # This file cfontains opcode declarations # DO NOT EDIT THIS FILE! ################################################### #----------------------------------------------------------------------------- # CONTROL OPERATIONS #------------------------...
bsd-3-clause
-1,899,764,248,712,151,800
83.137828
337
0.566457
false
pahaz/fabtools
fabtools/require/users.py
1
1964
""" System users ============ """ from fabtools.files import is_file from fabtools.user import * import fabtools.require def user(name, comment=None, home=None, group=None, extra_groups=None, create_home=False, skeleton_dir=None, password=None, system=False, shell=None, uid=None): """ Require a user ...
bsd-2-clause
5,924,842,653,718,361,000
31.196721
91
0.635947
false
liuzzfnst/tp-libvirt
libvirt/tests/src/virsh_cmd/domain/virsh_setmem.py
7
14922
import re import os import logging import time from autotest.client.shared import error from virttest import virsh from virttest import utils_libvirtd from virttest import data_dir from virttest.utils_test import libvirt from virttest import utils_misc from virttest.libvirt_xml import vm_xml def manipulate_domain(vm_...
gpl-2.0
420,709,355,759,119,940
36.681818
83
0.548184
false
mrquim/repository.mrquim
plugin.video.poseidon/resources/lib/modules/tvmaze.py
4
4183
# -*- coding: utf-8 -*- ''' Poseidon Add-on Copyright (C) 2016 Poseidon 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) a...
gpl-2.0
7,305,247,987,600,014,000
25.643312
157
0.549606
false
frankvdp/django
django/utils/ipv6.py
129
1350
import ipaddress from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ def clean_ipv6_address(ip_str, unpack_ipv4=False, error_message=_("This is not a valid IPv6 address.")): """ Clean an IPv6 address string. Raise ValidationErr...
bsd-3-clause
4,686,428,403,614,969,000
28.347826
77
0.668148
false
noba3/KoTos
addons/script.module.youtube.dl/lib/youtube_dl/extractor/tagesschau.py
102
6530
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import parse_filesize class TagesschauIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tagesschau\.de/multimedia/(?:[^/]+/)*?[^/#?]+?(?P<id>-?[0-9]+)(?:~_[^/#?]+?)?\.html' _TESTS = [...
gpl-2.0
7,904,568,288,801,026,000
41.116129
135
0.469516
false
hackerbot/DjangoDev
django/forms/fields.py
34
48292
""" Field classes. """ from __future__ import unicode_literals import copy import datetime import os import re import sys import uuid import warnings from decimal import Decimal, DecimalException from io import BytesIO from django.core import validators from django.core.exceptions import ValidationError # Provide th...
bsd-3-clause
1,779,313,228,671,756,800
37.449045
110
0.596144
false
upconsulting/IsisCB
isiscb/zotero/migrations/0026_auto_20200601_0013.py
1
4896
# Generated by Django 3.0.5 on 2020-06-01 00:13 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ('isisdata', '0091_auto_20200601_0...
mit
3,641,457,864,839,707,000
46.533981
164
0.634804
false
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_internal/download.py
7
33335
from __future__ import absolute_import import cgi import email.utils import getpass import json import logging import mimetypes import os import platform import re import shutil import sys from pip._vendor import requests, six, urllib3 from pip._vendor.cachecontrol import CacheControlAdapter from pip._vendor.cachecon...
apache-2.0
6,741,434,362,404,756,000
35.155098
79
0.60069
false
xin1195/smartSearch
test/hanzi.py
1
2343
#!/usr/bin/env python3 # _*_coding:utf-8_*_ # Created by "LiuXin" # Time import traceback import pymongo # text = """吖】ā[吖嗪](āqín)名有机化合物的一类,呈环状结构,含有一个或几个氮原子,如吡啶、哒嗪、嘧啶等。[英azine] # # 【阿】ā〈方〉前缀。①用在排行、小名或姓的前面,有亲昵的意味:~大|~宝|~唐。②用在某些亲属名称的前面:~婆|~爹|~哥。 # 另见2页•ɑ“啊”;354页ē。 # # 【阿鼻地狱】ābídìyù佛教指最深层的地狱,是犯了重罪的人死后灵魂永远受苦的地方。""" # fi...
apache-2.0
-3,830,903,602,155,663,400
23.402439
84
0.554223
false
danlangridge/galah
galah/web/views/_api.py
1
7617
# Copyright 2012-2013 John Sullivan # Copyright 2012-2013 Other contributers as noted in the CONTRIBUTERS file # # This file is part of Galah. # # Galah 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, e...
agpl-3.0
-3,806,611,168,316,241,400
34.101382
82
0.598136
false
muntasirsyed/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/in_/in_states.py
296
1859
""" A mapping of state misspellings/abbreviations to normalized abbreviations, and an alphabetical list of states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ STATE_CHOICES = ( ('KA', 'Karnataka'), ('AP', 'Andhra Pr...
apache-2.0
8,666,369,970,084,760,000
21.130952
78
0.470683
false
oxtopus/nupic
nupic/regions/ImageSensorExplorers/RandomSweep.py
17
10407
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gpl-3.0
-4,005,250,883,600,172,500
40.96371
79
0.627943
false
Shekharrajak/django-db-mailer
dbmail/south_migrations/0034_auto__chg_field_mailgroupemail_email__chg_field_mailfromemail_email__c.py
2
19791
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'MailGroupEmail.email' db.alter_column('dbmail_mailgrou...
gpl-2.0
1,813,070,405,000,121,300
78.168
200
0.554191
false
ehostunreach/qemu
scripts/tracetool/format/events_h.py
78
1406
#!/usr/bin/env python # -*- coding: utf-8 -*- """ trace/generated-events.h """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi"...
gpl-2.0
-8,837,645,216,981,743,000
26
76
0.554843
false
JRock007/boxxy
dist/Boxxy server.app/Contents/Resources/lib/python2.7/pygame/tests/surflock_test.py
5
5483
if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1] == 'pygame') if not is_pygame_pkg: sys.pa...
mit
2,047,549,133,576,590,800
33.374194
72
0.559183
false
cldershem/osf.io
tests/test_utils.py
15
14688
# -*- coding: utf-8 -*- import os import mock import unittest from flask import Flask from nose.tools import * # noqa (PEP8 asserts) import datetime from tests.base import OsfTestCase from tests.factories import RegistrationFactory from framework.routing import Rule, json_renderer from framework.utils import secure_...
apache-2.0
8,479,762,644,867,852,000
42.218935
119
0.591867
false
akvo/akvo-rsr
akvo/rsr/management/commands/lock_unlock_periods.py
1
1998
# -*- coding: utf-8 -*- # Akvo Reporting is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. import sys from django.core.ma...
agpl-3.0
6,458,502,891,060,040,000
30.714286
102
0.603604
false
beiko-lab/gengis
bin/Lib/lib2to3/tests/data/py2_test_grammar.py
18
31954
# Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. # NOTE: When you run this test as a script from the command line, you # get warnings about certain hex/oct constants. Since those are # issued by the parser, you can't suppress them by adding a # filterwarnings() call t...
gpl-3.0
-4,638,273,122,655,081,000
30.806982
132
0.460224
false
thaim/ansible
lib/ansible/modules/cloud/vmware/vmware_guest_file_operation.py
23
20590
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Stéphane Travassac <stravassac@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metad...
mit
1,168,577,169,258,964,700
43.756522
151
0.553283
false
paramecio/parameciofm
paramecio/cromosoma/extrafields/slugifyfield.py
1
1059
#!/usr/bin/env python3 from paramecio.cromosoma.corefields import CharField from paramecio.citoplasma.slugify import slugify from paramecio.cromosoma.coreforms import HiddenForm class SlugifyField(CharField): def __init__(self, name, size=255, field_related=None, required=False): super(Slugi...
gpl-3.0
293,104,214,508,820,740
27.621622
95
0.531634
false
rs91092/subtitle-downloader
subtitle-downloader.py
1
4389
#------------------------------------------------------------------------------- # Name : subtitle downloader # Purpose : One step subtitle download # # Authors : manoj m j, arun shivaram p, Valentin Vetter, niroyb # Edited by : Valentin Vetter # Created : # Copyright : (c) www.manojmj.com # Licence : GPL ...
gpl-3.0
-746,804,804,849,228,800
34.395161
124
0.586466
false
TobbeEdgeware/shaka-player
third_party/gjslint/closure_linter-2.3.13/closure_linter/scopeutil.py
25
5563
#!/usr/bin/env python # # Copyright 2012 The Closure Linter 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 # #...
apache-2.0
-518,120,842,690,524,500
29.905556
79
0.721373
false
bmachiel/python-nport
smith/create_smith_plot.py
1
1537
""" Contains a convenience function to create a ready-made Smith plot """ # Major library imports from numpy import array, ndarray, transpose, real, imag from enthought.chaco.array_data_source import ArrayDataSource from enthought.chaco.data_range_1d import DataRange1D # Local relative imports from .smith_mapper imp...
gpl-3.0
7,017,037,659,748,273,000
33.155556
80
0.618738
false
jotacor/tradunio-web
app/tradunio/comunio_service.py
1
5174
#!/usr/bin/env python # -*- coding: utf-8 -*- from bs4 import BeautifulSoup as bs from datetime import date, timedelta, datetime import re from suds.client import Client from ..models import Player class Comunio: def __init__(self): self.client = Client(url='http://www.comunio.es/soapservice.php?wsdl') ...
mit
680,974,589,956,552,600
36.766423
132
0.553923
false
manishpatell/erpcustomizationssaiimpex123qwe
addons/delivery/__openerp__.py
113
1902
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-4,920,677,306,770,915,000
37.816327
83
0.595163
false
bac/horizon
openstack_dashboard/usage/quotas.py
2
17368
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
-654,293,287,180,952,300
37.767857
79
0.607381
false
MiniLight/DeepCL
thirdparty/cogapp/cogapp/test_cogapp.py
10
66477
""" Test cogapp. http://nedbatchelder.com/code/cog Copyright 2004-2015, Ned Batchelder. """ from __future__ import absolute_import import os, os.path, random, re, shutil, stat, sys, tempfile # Use unittest2 if it's available, otherwise unittest. This gives us # back-ported features for 2.6. try: import...
mpl-2.0
-2,230,558,047,872,296,200
29.733703
212
0.44122
false
Cinntax/home-assistant
homeassistant/components/switch/__init__.py
1
3209
"""Component to interface with switches that can be controlled remotely.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.loader import bind_hass from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity import ToggleEntity from ho...
apache-2.0
5,445,250,433,488,144,000
25.741667
83
0.684637
false
alec-heif/MIT-Thesis
spark-bin/python/pyspark/ml/param/shared.py
15
22317
# # 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...
mit
3,261,565,614,167,070,700
32.111276
435
0.64704
false
Asana/boto
tests/unit/beanstalk/test_layer1.py
114
6971
#!/usr/bin/env python import json from tests.unit import AWSMockServiceTestCase from boto.beanstalk.layer1 import Layer1 # These tests are just checking the basic structure of # the Elastic Beanstalk code, by picking a few calls # and verifying we get the expected results with mocked # responses. The integration t...
mit
7,795,050,611,015,226,000
45.785235
96
0.591163
false
nycholas/ask-undrgz
src/ask-undrgz/django/db/backends/postgresql/introspection.py
308
3725
from django.db.backends import BaseDatabaseIntrospection class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', 20: 'BigIntegerField', 21: 'SmallIntegerField', 23: 'IntegerField', 25: 'T...
bsd-3-clause
1,543,683,538,963,734,300
41.329545
95
0.572617
false
scifiswapnil/Project-LoCatr
lib/python2.7/site-packages/django/contrib/postgres/forms/ranges.py
132
3063
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange from django import forms from django.core import exceptions from django.forms.widgets import MultiWidget from django.utils.translation import ugettext_lazy as _ __all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField...
mit
-2,232,849,063,356,993,500
32.293478
97
0.623898
false
xuanyuanking/spark
python/pyspark/pandas/data_type_ops/base.py
5
13688
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
5,083,086,210,169,483,000
39.497041
100
0.664158
false
vincenzo/LIBSVM
python/svm.py
5
7768
#!/usr/bin/env python from ctypes import * from ctypes.util import find_library import sys # For unix the prefix 'lib' is not considered. if find_library('svm'): libsvm = CDLL(find_library('svm')) elif find_library('libsvm'): libsvm = CDLL(find_library('libsvm')) else: if sys.platform == 'win32': libsvm = CDLL('...
bsd-3-clause
1,009,872,799,665,381,200
28.992278
122
0.640062
false
harddevelop/jukebox
core/cipher.py
1
1196
from core.Cipher import DES from hashlib import md5 import hashlib import base64 import re import os ''' PBEWithMD5AndDES port based on ''' class PBEWithMD5AndDES(): @staticmethod def get_derived_key(password, salt, count): key = password + salt for i in range(count): m = hashlib....
gpl-2.0
8,409,232,383,664,698,000
27.5
73
0.591973
false
danieljaouen/ansible
lib/ansible/modules/cloud/cloudstack/cs_staticnat.py
21
6799
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2015, René Moser <mail@renemoser.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported...
gpl-3.0
-6,219,706,531,293,043,000
26.971193
92
0.61792
false
geerlingguy/ansible
lib/ansible/modules/fetch.py
7
3790
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # This is a virtual module that is entirely implemented as an action plugin and runs on the controller from __future__ import absolute_import, ...
gpl-3.0
4,189,154,183,729,560,000
35.095238
116
0.71372
false
willharris/django
tests/sites_tests/tests.py
8
8628
from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.contrib.sites import models from django.contrib.sites.management import create_default_site from django.contrib.sites.middleware import CurrentSiteMiddleware from django.contrib.sites.models import Site, c...
bsd-3-clause
-9,042,026,056,493,253,000
38.218182
90
0.65044
false
weblyzard/ewrt
tests/ws/wikidata/test_bundle_wikipedia_requests.py
1
15715
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on October 04, 2018 @author: jakob <jakob.steixner@modul.ac.at> ''' from __future__ import print_function from builtins import next from builtins import str from builtins import range import datetime import mock import pytest from eWRT.ws.wikidata.bundle_wikipedia...
gpl-3.0
5,938,466,527,326,198,000
56.98893
126
0.490105
false
Pajinek/spacewalk
backend/server/action/image.py
14
1837
# -*- coding: utf-8 -*- # # Copyright (c) 2011 SUSE LLC # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have...
gpl-2.0
3,313,556,402,483,723,000
34.326923
123
0.645618
false
pleaseproject/python-for-android
python3-alpha/extra_modules/gdata/Crypto/Hash/HMAC.py
45
3337
"""HMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. This is just a copy of the Python 2.2 HMAC module, modified to work when used on versions of Python before 2.2. """ __revision__ = "$Id: HMAC.py,v 1.5 2002/07/25 17:19:02 z3p Exp $" import strin...
apache-2.0
8,959,498,752,268,538,000
29.898148
78
0.606233
false
akash1808/nova
nova/tests/functional/v3/test_extended_server_attributes.py
28
2687
# 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
7,460,229,925,131,192,000
37.942029
78
0.630071
false
miyakz1192/neutron
neutron/db/migration/models/frozen.py
10
72451
# Copyright (c) 2014 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
-8,167,522,142,285,659,000
38.311449
78
0.595727
false
walteryang47/ovirt-engine
packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-common/distro-rpm/packages.py
6
17845
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 Red Hat, 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 # # Unl...
apache-2.0
-3,213,299,727,158,135,000
35.567623
76
0.467974
false
zxjzxj9/FlaskBoard
web/lib/python2.7/site-packages/psycopg2/tests/testconfig.py
10
1249
# Configure the test suite from the env variables. import os dbname = os.environ.get('PSYCOPG2_TESTDB', 'psycopg2_test') dbhost = os.environ.get('PSYCOPG2_TESTDB_HOST', None) dbport = os.environ.get('PSYCOPG2_TESTDB_PORT', None) dbuser = os.environ.get('PSYCOPG2_TESTDB_USER', None) dbpass = os.environ.get('PSYCOPG2_T...
apache-2.0
7,439,127,112,395,895,000
33.694444
78
0.690152
false
dayatz/taiga-back
taiga/users/gravatar.py
1
1419
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # Copyright (C) 2014-2017 Anler Hernández ...
agpl-3.0
-8,107,461,020,138,980,000
35.307692
74
0.721045
false
JakeBrand/CMPUT410-E6
v1/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/schema.py
57
3048
import logging from django.contrib.gis.db.models.fields import GeometryField from django.db.utils import OperationalError from django.db.backends.mysql.schema import DatabaseSchemaEditor logger = logging.getLogger('django.contrib.gis') class MySQLGISSchemaEditor(DatabaseSchemaEditor): sql_add_spatial_index = 'C...
apache-2.0
-6,236,837,184,736,648,000
38.584416
96
0.595472
false
aclevy/vcrpy
vcr/request.py
3
3068
from six import BytesIO, text_type from six.moves.urllib.parse import urlparse, parse_qsl class Request(object): """ VCR's representation of a request. There is a weird quirk in HTTP. You can send the same header twice. For this reason, headers are represented by a dict, with lists as the values. ...
mit
4,881,428,995,260,085,000
27.672897
78
0.602021
false
DailyActie/Surrogate-Model
01-codes/scipy-master/scipy/special/lambertw.py
33
3041
from __future__ import division, print_function, absolute_import from ._ufuncs import _lambertw def lambertw(z, k=0, tol=1e-8): r""" lambertw(z, k=0, tol=1e-8) Lambert W function. The Lambert W function `W(z)` is defined as the inverse function of ``w * exp(w)``. In other words, the value of ``...
mit
-2,097,089,116,538,274,300
27.420561
76
0.598159
false
MjnMixael/knossos
knossos/__main__.py
1
3121
#!/usr/bin/python ## Copyright 2017 Knossos authors, see NOTICE file ## ## 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 requ...
apache-2.0
-3,226,768,737,397,734,000
28.72381
80
0.63249
false