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
ema/conpaas
conpaas-services/contrib/libcloud/compute/drivers/ktucloud.py
5
3393
# 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 ...
bsd-3-clause
2,519,932,485,907,413,500
33.272727
78
0.581491
false
Huyuwei/tvm
tests/python/contrib/test_sort.py
2
3267
# 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
-5,875,340,476,806,476,000
40.884615
97
0.585859
false
liaorubei/depot_tools
third_party/pylint/pyreverse/main.py
67
5143
# # Copyright (c) 2000-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License,...
bsd-3-clause
-725,632,330,350,875,800
40.475806
85
0.632121
false
hobarrera/django
django/core/checks/security/base.py
45
6645
from django.conf import settings from .. import Tags, Warning, register from ..utils import patch_middleware_message SECRET_KEY_MIN_LENGTH = 50 SECRET_KEY_MIN_UNIQUE_CHARACTERS = 5 W001 = Warning( "You do not have 'django.middleware.security.SecurityMiddleware' " "in your MIDDLEWARE so the SECURE_HSTS_SECOND...
bsd-3-clause
8,100,128,224,318,600,000
32.730964
116
0.697818
false
mmardini/django
django/contrib/messages/storage/base.py
113
6286
from __future__ import unicode_literals from django.conf import settings from django.utils.encoding import force_text, python_2_unicode_compatible from django.contrib.messages import constants, utils LEVEL_TAGS = utils.get_level_tags() @python_2_unicode_compatible class Message(object): """ Represents an a...
bsd-3-clause
9,138,650,506,240,260,000
32.795699
93
0.610245
false
andrecunha/idd3
idd3/rules/universal/misc_rulesets.py
1
10997
# -*- coding: utf-8 -*- # IDD3 - Propositional Idea Density from Dependency Trees # Copyright (C) 2014-2015 Andre Luiz Verucci da Cunha # # 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
-2,110,611,596,257,975,800
34.820847
80
0.541784
false
Gamebasis/3DGamebasisServer
GameData/blender-2.71-windows64/2.71/scripts/modules/bl_i18n_utils/merge_po.py
1
6180
#!/usr/bin/env python3 # ***** BEGIN GPL LICENSE BLOCK ***** # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This...
gpl-3.0
1,561,254,353,420,536,000
42.174825
118
0.601879
false
saurabh6790/-aimobilize-lib
core/page/permission_manager/permission_manager.py
32
3461
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import webnotes import webnotes.defaults @webnotes.whitelist() def get_roles_and_doctypes(): webnotes.only_for(("System Manager", "Administrator")) return { "doctypes": [d...
mit
312,497,691,909,479,300
33.267327
103
0.708177
false
apache/airflow
tests/providers/odbc/hooks/test_odbc.py
2
7642
# # 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...
apache-2.0
4,982,944,658,094,561,000
36.64532
110
0.579691
false
psaavedra/matrix-bot
matrixbot/plugins/wkbotsfeeder.py
1
9174
import json import logging import os import pytz import requests import sys import urllib.request, urllib.parse, urllib.error import time if os.path.dirname(__file__) == "matrixbot/plugins": sys.path.append(os.path.abspath(".")) from matrixbot import utils pp, puts, set_property = utils.pp, utils.puts, utils.set...
mit
-4,697,543,367,671,114,000
36.598361
123
0.585568
false
PaulcyMboungou/django-messaging
django_messaging/models.py
1
2827
from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.contrib.auth.models import User class DmUser(models.Model): user=models.ForeignKey(User,unique=True,related_name='dm_user') last_activity=models.DateTimeField(auto_now_add=True) contacts=models.ManyToManyField(User,rel...
bsd-3-clause
4,181,967,758,614,692,400
26.446602
131
0.672798
false
sodexis/odoo
openerp/addons/base/ir/ir_model.py
4
61629
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
4,177,439,264,689,746,400
47.185301
207
0.557221
false
TOC-Shard/moul-scripts
Python/system/encodings/cp037.py
593
13377
""" Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
gpl-3.0
7,563,345,489,460,644,000
42.57329
116
0.528295
false
jmckaskill/subversion
tools/buildbot/master/Feeder.py
5
16341
# # # 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 n...
apache-2.0
4,112,482,127,476,861,400
40.792839
111
0.530873
false
nathania/networkx
examples/algorithms/blockmodel.py
32
3009
#!/usr/bin/env python # encoding: utf-8 """ Example of creating a block model using the blockmodel function in NX. Data used is the Hartford, CT drug users network: @article{, title = {Social Networks of Drug Users in {High-Risk} Sites: Finding the Connections}, volume = {6}, shorttitle = {Social Networks of Drug ...
bsd-3-clause
3,941,475,111,338,393,600
33.193182
121
0.672981
false
gdub/django
tests/gis_tests/geoapp/tests.py
189
41436
from __future__ import unicode_literals import re import tempfile from django.contrib.gis import gdal from django.contrib.gis.db.models import Extent, MakeLine, Union from django.contrib.gis.geos import ( GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon, fromstr, ) from django.core.man...
bsd-3-clause
-5,483,027,283,845,470,000
44.434211
117
0.613307
false
rbaindourov/v8-inspector
Source/chrome/net/tools/net_docs/net_docs.py
15
3541
#!/usr/bin/env python # Copyright 2015 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. """Reads, parses, and (optionally) writes as HTML the contents of Markdown files passed as arguments. Intended for rendering network s...
bsd-3-clause
-6,078,871,631,389,672,000
29.264957
79
0.715617
false
wrbutros/condominios
registro/serializers.py
1
1679
from rest_framework import serializers from models import Condominio, Edificio, Departamento, Servicio, LecturaServicio from models import AdministradorEdificio, Conserje class ConserjeSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Conserje class AdministradorEdificioSerializer...
gpl-3.0
-5,723,106,566,631,023,000
22.985714
80
0.642049
false
harshilasu/GraphicMelon
y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/ec2/cloudwatch/__init__.py
761
1104
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
gpl-3.0
-4,983,879,411,998,132,000
54.2
74
0.770833
false
davidobrien1985/ansible-modules-core
cloud/google/gc_storage.py
101
16678
#!/usr/bin/python # 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 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
-6,149,869,737,483,803,000
37.16476
487
0.631011
false
frrp/ipcoin
contrib/testgen/base58.py
2139
2818
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
mit
-993,592,242,039,702,000
26.096154
97
0.607523
false
eufarn7sp/egads
egads/thirdparty/quantities/constants/naturalunits.py
4
1604
# -*- coding: utf-8 -*- """ """ from __future__ import absolute_import from ._utils import _cd from ..unitquantity import UnitConstant natural_unit_of_action = UnitConstant( 'natural_unit_of_action', _cd('natural unit of action'), symbol='hbar', u_symbol='ħ' ) natural_unit_of_energy = UnitConstant( ...
gpl-3.0
-4,816,846,977,138,062,000
23.430769
53
0.63665
false
woutersmet/Zeosummer
lib/zeobuilder/expressions.py
2
2479
# Zeobuilder is an extensible GUI-toolkit for molecular model construction. # Copyright (C) 2007 - 2009 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center # for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights # reserved unless otherwise stated. # # This file is part of Zeobuilder. # # Zeobuilde...
gpl-3.0
7,581,212,632,759,538,000
32.958904
80
0.691004
false
danieljaouen/ansible
lib/ansible/modules/cloud/google/gcp_storage_bucket_access_control.py
12
12033
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
-5,999,377,856,572,000,000
32.33241
138
0.569019
false
roryk/recipes
recipes/deepvariant/dv_call_variants.py
28
1904
#!/opt/anaconda1anaconda2anaconda3/bin/python # # Wrapper script for DeepVariant call_variants BINARY_DIR="/opt/anaconda1anaconda2anaconda3/BINARYSUB" MODEL_DIRS= {"wgs": "/opt/anaconda1anaconda2anaconda3/WGSMODELSUB", "wes": "/opt/anaconda1anaconda2anaconda3/WESMODELSUB"} import argparse import os impor...
mit
-8,140,960,980,555,647,000
39.510638
117
0.680672
false
gdi2290/django
django/contrib/postgres/fields/hstore.py
14
4495
import json from django.contrib.postgres import forms from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, Lookup, Transform, TextField from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStore...
bsd-3-clause
-5,215,284,546,288,144,000
30
81
0.635818
false
stianrh/askbot-nordic
askbot/migrations/0168_add_twitter_fields_to_user_profile.py
13
35766
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): """add fields twitter_access_token, twitter_handle, social_sharing...
gpl-3.0
-2,213,629,965,454,185,000
87.311111
644
0.554689
false
pyload/pyload
src/pyload/plugins/accounts/UptoboxCom.py
1
1145
# -*- coding: utf-8 -*- import re from ..base.xfs_account import XFSAccount class UptoboxCom(XFSAccount): __name__ = "UptoboxCom" __type__ = "account" __version__ = "0.25" __status__ = "testing" __description__ = """Uptobox.com account plugin""" __license__ = "GPLv3" __authors__ = [ ...
agpl-3.0
-1,471,316,296,564,966,400
25.022727
80
0.562445
false
ESOedX/edx-platform
lms/djangoapps/bulk_email/tests/test_tasks.py
1
23176
# -*- coding: utf-8 -*- """ Unit tests for LMS instructor-initiated background tasks. Runs tasks on answers to course problems to validate that code paths actually work. """ from __future__ import absolute_import, print_function import json from itertools import chain, cycle, repeat from smtplib import SMTPAuthentic...
agpl-3.0
8,600,854,474,835,909,000
47.768421
119
0.66812
false
mgedmin/ansible
lib/ansible/modules/cloud/cloudstack/cs_zone_facts.py
48
5787
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # 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 of the Lice...
gpl-3.0
5,162,208,228,943,439,000
27.219512
80
0.659118
false
SUSE/kiwi
test/unit/tasks/system_build_test.py
1
12177
import logging import sys import mock import os from pytest import fixture from mock import patch, call import kiwi from ..test_helper import argv_kiwi_tests from kiwi.tasks.system_build import SystemBuildTask class TestSystemBuildTask: @fixture(autouse=True) def inject_fixtures(self, caplog): self...
gpl-3.0
8,846,929,571,133,299,000
37.780255
79
0.617476
false
RusDavies/ansible-modules-core
database/postgresql/postgresql_user.py
89
25160
#!/usr/bin/python # -*- coding: utf-8 -*- # 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 of the License, or # (at your option) any later version. #...
gpl-3.0
-4,282,253,362,818,547,700
37.06354
410
0.629094
false
heke123/chromium-crosswalk
tools/grit/grit/clique.py
25
18007
#!/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. '''Collections of messages and their translations, called cliques. Also collections of cliques (uber-cliques). ''' import re impo...
bsd-3-clause
4,752,300,235,099,997,000
36.05144
80
0.679458
false
Argon-Zhou/django
tests/admin_checks/models.py
98
1724
""" Tests of ModelAdmin system checks logic. """ from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible class Album(models.Model): title = models.CharFie...
bsd-3-clause
-8,741,201,496,430,093,000
24.352941
68
0.720418
false
badloop/SickRage
lib/unidecode/x0b7.py
253
4833
data = ( 'ddwim', # 0x00 'ddwib', # 0x01 'ddwibs', # 0x02 'ddwis', # 0x03 'ddwiss', # 0x04 'ddwing', # 0x05 'ddwij', # 0x06 'ddwic', # 0x07 'ddwik', # 0x08 'ddwit', # 0x09 'ddwip', # 0x0a 'ddwih', # 0x0b 'ddyu', # 0x0c 'ddyug', # 0x0d 'ddyugg', # 0x0e 'ddyugs', # 0x0f 'dd...
gpl-3.0
-6,956,381,290,472,292,000
17.732558
19
0.46886
false
Krossom/python-for-android
python-modules/twisted/twisted/persisted/crefutil.py
61
4644
# -*- test-case-name: twisted.test.test_persisted -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Utility classes for dealing with circular references. """ from twisted.python import log, reflect try: from new import instancemethod except: from org.python.core impo...
apache-2.0
1,112,831,899,288,588,800
26.808383
97
0.57149
false
feigames/Odoo
addons/portal_claim/portal_claim.py
315
1871
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
5,458,565,465,629,414,000
41.522727
112
0.615179
false
yan12125/youtube-dl
youtube_dl/extractor/rmcdecouverte.py
20
2017
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveLegacyIE from ..compat import ( compat_parse_qs, compat_urlparse, ) from ..utils import smuggle_url class RMCDecouverteIE(InfoExtractor): _VALID_URL = r'https?://rmcdecou...
unlicense
3,608,488,650,037,344,000
35.672727
121
0.591472
false
arikpoz/mxnet
example/recommenders/movielens_data.py
15
1636
"""MovieLens data handling: download, parse, and expose as DataIter """ import os import mxnet as mx def load_mldata_iter(filename, batch_size): """Not particularly fast code to parse the text file and load it into three NDArray's and product an NDArrayIter """ user = [] item = [] score = [] ...
apache-2.0
-5,562,769,595,041,476,000
31.078431
89
0.571516
false
couwbat/couwbatns3
ns-allinone-3.23/ns-3.23/src/click/bindings/modulegen__gcc_ILP32.py
124
289391
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
8,629,859,979,647,977,000
62.574473
934
0.607058
false
dcherian/tools
ROMS/pmacc/tools/post_tools/rompy/tags/rompy-0.1.6/test.py
4
8114
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from rompy import rompy, plot_utils, utils map1 = False map2 = False map3 = False map4 = False map5 = False map6 = False map7 = Fa...
mit
1,822,424,920,746,678,300
38.009615
261
0.67895
false
CVL-GitHub/karaage
karaage/legacy/people/south_migrations/0001_initial.py
3
11036
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Institute' db.create_table('institute', ( ('gid', self.gf('django.db.models.fields.IntegerField')()), ...
gpl-3.0
-371,903,780,292,639,700
77.828571
184
0.576749
false
cloudbase/cinder
cinder/tests/unit/volume/drivers/emc/vnx/test_utils.py
5
6969
# Copyright (c) 2016 EMC Corporation, 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 ap...
apache-2.0
5,126,279,752,148,077,000
39.051724
78
0.607117
false
engdan77/edoAutoHomeMobile
twisted/conch/ssh/service.py
69
1408
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ The parent class for all the SSH services. Currently implemented services are ssh-userauth and ssh-connection. Maintainer: Paul Swartz """ from twisted.python import log class SSHService(log.Logger): name = None # this is the ssh name...
mit
-4,349,330,520,458,887,700
28.333333
75
0.619318
false
ianyh/heroku-buildpack-python-opencv
vendor/.heroku/lib/python2.7/test/test_datetime.py
9
134923
"""Test date/time type. See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases """ from __future__ import division import sys import pickle import cPickle import unittest from test import test_support from datetime import MINYEAR, MAXYEAR from datetime import timedelta from datetime import tzinfo from datetim...
mit
7,569,242,782,605,324,000
39.072171
91
0.566212
false
adelina-t/neutron
neutron/api/v2/base.py
9
32455
# Copyright (c) 2012 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
9,086,085,502,932,506,000
46.036232
79
0.553289
false
kevinastone/sentry
tests/integration/tests.py
9
10414
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import datetime import json import logging import mock import zlib from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from django.utils import timezone from gzip i...
bsd-3-clause
7,082,410,902,070,440,000
34.182432
117
0.619839
false
TeachAtTUM/edx-platform
cms/djangoapps/contentstore/tests/test_import_pure_xblock.py
25
3002
""" Integration tests for importing courses containing pure XBlocks. """ from django.conf import settings from xblock.core import XBlock from xblock.fields import String from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.mongo.draft import as_dr...
agpl-3.0
-4,227,454,334,600,749,000
34.317647
118
0.667555
false
pleaseproject/python-for-android
python3-alpha/python3-src/Lib/test/pydocfodder.py
203
6332
"""Something just to look at via pydoc.""" import types class A_classic: "A classic class." def A_method(self): "Method defined in A." def AB_method(self): "Method defined in A and B." def AC_method(self): "Method defined in A and C." def AD_method(self): "Method de...
apache-2.0
-5,712,734,725,559,720,000
28.314815
71
0.569962
false
asgard-lab/neutron
neutron/tests/unit/objects/qos/test_rule.py
10
3451
# 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
-4,565,740,543,863,377,000
39.127907
79
0.668502
false
mm1ke/portage
pym/_emerge/post_emerge.py
3
5021
# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function import logging import textwrap import portage from portage import os from portage.emaint.modules.logs.logs import CleanLogs from portage.news import count_unread_news, disp...
gpl-2.0
-5,205,338,751,817,795,000
28.886905
74
0.721171
false
sxjscience/mxnet
python/mxnet/gluon/contrib/estimator/batch_processor.py
12
3925
# 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
-5,470,817,863,700,877,000
36.380952
90
0.639236
false
schreiberx/sweet
benchmarks_sphere/rexi_mass_energy_galewsky_martinium/pp_plot_csv.py
2
2918
#! /usr/bin/python2 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import sys first = True s = 2e-5 eta_contour_levels = np.append(np.arange(-1e-4, 0, s), np.arange(s, 1e-4, s)) zoom_lat = True zoom_lat = False zoom_lat = 'eta' in sys.argv[1] fontsize=8 figsize=(9, 3)...
mit
7,078,067,539,959,477,000
20.93985
155
0.661069
false
dmilith/SublimeText3-dmilith
Packages/pygments/all/pygments/styles/algol_nu.py
37
2278
# -*- coding: utf-8 -*- """ pygments.styles.algol_nu ~~~~~~~~~~~~~~~~~~~~~~~~ Algol publication style without underlining of keywords. This style renders source code for publication of algorithms in scientific papers and academic texts, where its format is frequently used. It is based on the ...
mit
5,971,395,800,556,388,000
35.15873
105
0.615891
false
ovilab/atomify-lammps
libs/lammps/tools/moltemplate/moltemplate/postprocess_input_script.py
8
6687
#!/usr/bin/env python """ Reorder the integer arguments to the commands in a LAMMPS input file if these arguments violate LAMMPS order requirements. We have to do this because the moltemplate.sh script will automatically assign these integers in a way which may violate these restrictions and the user ha...
gpl-3.0
-8,701,371,230,233,700,000
40.79375
110
0.469717
false
chubiei/ycmd
ycmd/extra_conf_store.py
13
7343
#!/usr/bin/env python # # Copyright (C) 2011, 2012 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 # (...
gpl-3.0
681,037,107,494,559,500
32.226244
80
0.706932
false
astroumd/GradMap
notebooks/check_imports/draw_dolphins.py
1
3779
""" Draws dolphins using matplotlib features. From matplotlib documentation: https://matplotlib.org/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py """ # Fixing random state for reproducibility import matplotlib.cm as cm import matplotlib.pyplot as plt from matplotlib.pa...
gpl-3.0
-1,957,072,980,951,599,600
36.04902
117
0.697804
false
zhoulingjun/django
django/utils/deprecation.py
199
2627
from __future__ import absolute_import import inspect import warnings class RemovedInDjango20Warning(PendingDeprecationWarning): pass class RemovedInDjango110Warning(DeprecationWarning): pass RemovedInNextVersionWarning = RemovedInDjango110Warning class warn_about_renamed_method(object): def __init...
bsd-3-clause
6,793,705,033,984,638,000
34.026667
90
0.594975
false
kitsunde/ansible
lib/ansible/plugins/action/fail.py
172
1228
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2012, Dag Wieers <dag@wieers.com> # # 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,957,636,956,174,416,000
34.085714
70
0.712541
false
pkimber/old_cms
cms/tests/test_service.py
1
1778
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from cms.models import Page from cms.service import init_page class TestService(TestCase): def setUp(self): self.SLUG = 'home' self.HOME = 'Home' def test_init_not(self): try: ...
apache-2.0
9,057,924,955,533,452,000
29.135593
72
0.595051
false
zenners/angular-contacts
node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/node_modules/jstest/node_modules/nopt/node_modules/tap/node_modules/readable-stream/node_modules/string_decoder/node_modules/tap/node_modules/yamlish/yamlish-py/test/test_input.py
157
1764
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import test try: import unittest2 as unittest except ImportError: import unittest import yamlish test_data_list = [ { "name": "Input test", "in": r"""--- bill-to: address: city: "Royal Oak" ...
mit
6,726,140,509,883,096,000
20.777778
81
0.515306
false
nozuono/calibre-webserver
src/calibre/ebooks/rtf2xml/convert_to_tags.py
19
10742
import os, sys from codecs import EncodedFile from calibre.ebooks.rtf2xml import copy, check_encoding from calibre.ptempfile import better_mktemp public_dtd = 'rtf2xml1.0.dtd' class ConvertToTags: """ Convert file to XML """ def __init__(self, in_file, bug_handler, ...
gpl-3.0
3,877,178,989,511,612,400
36.559441
96
0.504934
false
elventear/ansible-modules-core
system/group.py
25
14205
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <sfromm@gmail.com> # # 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 of the Lice...
gpl-3.0
3,841,016,392,135,283,700
28.905263
85
0.538543
false
avocado-framework/avocado-vt
virttest/libvirt_xml/devices/base.py
8
10527
""" Common base classes for devices """ import logging from six import StringIO from virttest import xml_utils from virttest.libvirt_xml import base, xcepts, accessors from virttest.xml_utils import ElementTree class UntypedDeviceBase(base.LibvirtXMLBase): """ Base class implementing common functions for a...
gpl-2.0
835,937,899,563,285,600
37.56044
83
0.566353
false
VasLem/KinectPainting
palm_detection_alg.py
1
18445
import numpy as np import math import cv2 import itertools as it import sys import time import helping_functs as hf import class_objects as co def detect_corners(): '''function to detects intersection limits of mask with calib_edges''' calib_set = set([tuple(i) for i in np.transpose( np.fliplr(np.non...
bsd-3-clause
7,662,775,782,173,510,000
50.811798
142
0.548929
false
framon/samba
python/samba/tests/registry.py
49
1772
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007 # # 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-3.0
-4,625,162,138,053,537,000
28.533333
71
0.690181
false
openfun/edx-platform
common/test/acceptance/tests/studio/test_studio_settings_certificates.py
20
8185
""" Acceptance tests for Studio's Setting pages """ from .base_studio_test import StudioCourseTest from ...pages.studio.settings_certificates import CertificatesPage class CertificatesTest(StudioCourseTest): """ Tests for settings/certificates Page. """ def setUp(self, is_staff=False): super(C...
agpl-3.0
7,682,905,224,609,779,000
41.630208
100
0.659988
false
Erotemic/dtool
dtool_ibeis/experimental_features.py
1
3573
# @ut.accepts_scalar_input2(argx_list=[1]) # def get_obj(depc, tablename, root_rowids, config=None, ensure=True): # """ Convinience function. Gets data in `tablename` as a list of # objects. """ # print('WARNING EXPERIMENTAL') # try: # if tablename == depc.root: # obj_list = list(de...
apache-2.0
8,202,605,299,147,068,000
37.419355
79
0.506577
false
bogdal/django-filer
filer/tests/permissions.py
1
14540
#-*- coding: utf-8 -*- try: from django.contrib.auth import get_user_model User = get_user_model() except ImportError: from django.contrib.auth.models import User, Permission # NOQA from django.contrib.auth.models import Group from django.core.files import File as DjangoFile from django.conf import setting...
bsd-3-clause
327,662,456,044,132,400
43.876543
226
0.677235
false
evancich/apm_motor
modules/waf/waflib/Utils.py
1
18328
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2010 (ita) """ Utilities and platform-specific fixes The portability fixes try to provide a consistent behavior of the Waf API through Python versions 2.3 to 3.X and across different platforms (win32, linux, etc) """ import os, sys, errno, traceback, inspec...
gpl-3.0
7,169,903,543,489,937,000
22.618557
114
0.663466
false
kidaa/encoded
src/contentbase/util.py
1
1415
from past.builtins import basestring from pyramid.threadlocal import manager as threadlocal_manager def get_root_request(): if threadlocal_manager.stack: return threadlocal_manager.stack[0]['request'] def ensurelist(value): if isinstance(value, basestring): return [value] return value ...
mit
-3,935,420,433,764,009,000
26.211538
73
0.609894
false
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/dataframe/queues/feeding_functions.py
12
12480
# 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...
gpl-3.0
7,241,782,046,416,466,000
39.38835
94
0.610417
false
y-higuchi/ramcloud
scripts/upload.py
10
64911
#!/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...
isc
-4,814,837,691,551,187,000
36.028523
80
0.626026
false
raphaelmerx/django
django/core/management/commands/sendtestemail.py
349
1449
import socket from django.core.mail import mail_admins, mail_managers, send_mail from django.core.management.base import BaseCommand from django.utils import timezone class Command(BaseCommand): help = "Sends a test email to the email addresses specified as arguments." missing_args_message = "You must specif...
bsd-3-clause
1,965,324,348,545,452,000
41.617647
111
0.651484
false
Sorsly/subtle
google-cloud-sdk/platform/gsutil/gslib/tests/test_notification.py
38
2770
# -*- coding: utf-8 -*- # 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 require...
mit
-6,215,908,442,483,482,000
35.447368
76
0.695668
false
wilvk/ansible
test/units/module_utils/test_distribution_version.py
13
35740
# -*- 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) from __future__ import absolute_import, division, print_function __metaclass__ = type from itertools import product import pytest # the module we are actually te...
gpl-3.0
8,281,519,882,733,530,000
36.190427
275
0.508646
false
Ziqi-Li/bknqgis
bokeh/examples/embed/embed_multiple.py
7
2314
import io from jinja2 import Template from bokeh.embed import components from bokeh.models import Range1d from bokeh.plotting import figure from bokeh.resources import INLINE from bokeh.util.browser import view # create some data x1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12] y1 = [0, 8, 2, 4, 6, 9, 5, 6, 25, 28, 4, 7]...
gpl-2.0
-4,101,947,574,063,116,000
26.547619
83
0.585134
false
ulif/pulp
server/test/unit/server/db/model/test_consumer.py
15
14706
# -*- coding: utf-8 -*- """ This module contains tests for the pulp.server.db.model.consumer module. """ import unittest import mock from ....base import PulpServerTests from pulp.server.db.model import consumer class TestRepoProfileApplicability(PulpServerTests): """ Test the RepoProfileApplicability Mode...
gpl-2.0
1,520,386,854,586,974,200
46.882736
100
0.592313
false
tectronics/gpo2py
models/menu.py
7
6122
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## Customize your APP title, subtitle and menus here ######################################################################### response.titl...
agpl-3.0
9,083,828,231,824,590,000
59.019608
108
0.475335
false
naototty/pyflag
src/plugins/Themes/Standard.py
7
6877
""" These are the standard themes that come with Pyflag. """ import pyflag.conf config=pyflag.conf.ConfObject() import pyflag.FlagFramework as FlagFramework import pyflag.Registry as Registry import pyflag.Theme as Theme class BlueTheme(Theme.BasicTheme): """ This class encapsulates the theme elements. The results...
gpl-2.0
-6,062,801,816,255,323,000
43.947712
318
0.507198
false
matrix-org/synapse
synapse/rest/client/v1/login.py
1
18517
# Copyright 2014-2016 OpenMarket Ltd # # 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 w...
apache-2.0
-5,644,447,724,070,481,000
37.417012
91
0.60539
false
Orav/kbengine
kbe/src/lib/python/Doc/tools/sphinxext/pyspecific.py
1
13744
# -*- coding: utf-8 -*- """ pyspecific.py ~~~~~~~~~~~~~ Sphinx extension with Python doc-specific markup. :copyright: 2008-2014 by Georg Brandl. :license: Python license. """ ISSUE_URI = 'http://bugs.python.org/issue%s' SOURCE_URI = 'https://hg.python.org/cpython/file/3.4/%s' from ...
lgpl-3.0
6,494,132,347,267,454,000
35.449591
84
0.604045
false
ThePletch/ansible
lib/ansible/modules/cloud/vmware/vmware_vmkernel.py
48
7589
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # # 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 of the Li...
gpl-3.0
5,365,716,394,569,122,000
34.79717
99
0.634998
false
mayankcu/Django-social
venv/Lib/site-packages/django/contrib/gis/gdal/geometries.py
388
26357
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" u...
bsd-3-clause
-6,482,914,545,494,995,000
34.762551
105
0.610464
false
JLMARIN/paparazziUAV
sw/tools/attitude_viz.py
52
11943
#! /usr/bin/python # Tool for visualizing quaternion as rotated cube from OpenGL.GLUT import * from OpenGL.GLU import * from OpenGL.GL import * import sys import math from ivy.std_api import * import logging import getopt import pygame import time import platform import os _NAME = 'attitude_viz' class TelemetryQ...
gpl-2.0
5,460,235,455,991,702,000
30.511873
117
0.553965
false
amarian12/p2pool-adaptive-drk
nattraverso/pynupnp/upnp.py
283
18985
""" This module is the heart of the upnp support. Device discover, ip discovery and port mappings are implemented here. @author: Raphael Slinckx @author: Anthony Baxter @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" impor...
gpl-3.0
989,634,574,400,915,600
34.820755
96
0.593521
false
kmod/icbd
stdlib/python2.5/ctypes/test/test_funcptr.py
66
3962
import os, unittest from ctypes import * try: WINFUNCTYPE except NameError: # fake to enable this test on Linux WINFUNCTYPE = CFUNCTYPE import _ctypes_test lib = CDLL(_ctypes_test.__file__) class CFuncPtrTestCase(unittest.TestCase): def test_basic(self): X = WINFUNCTYPE(c_int, c_int, c_int) ...
mit
-6,369,475,210,223,815,000
30.19685
87
0.551489
false
simonwydooghe/ansible
lib/ansible/modules/network/f5/bigip_appsvcs_extension.py
19
16524
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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 = {'metadata_version': '1.1', ...
gpl-3.0
-290,379,749,767,974,600
29.098361
101
0.587993
false
pabelanger/did
did/base.py
2
13985
# coding: utf-8 """ Config, Date, User and Exceptions """ from __future__ import unicode_literals, absolute_import import os import re import sys import codecs import datetime import optparse import StringIO import xmlrpclib import ConfigParser from dateutil.relativedelta import MO as MONDAY from ConfigParser import...
gpl-2.0
-5,019,501,114,693,383,000
33.026764
79
0.526779
false
levkar/odoo
addons/base_iban/models/res_partner_bank.py
30
6689
# -*- coding: utf-8 -*- import re from odoo import api, models, _ from odoo.exceptions import UserError, ValidationError def normalize_iban(iban): return re.sub('[\W_]', '', iban or '') def pretty_iban(iban): """ return iban in groups of four characters separated by a single space """ return ' '.join([...
agpl-3.0
2,007,326,551,444,420,600
43.892617
120
0.622365
false
mfwarren/createbucket
createbucket/create_s3_bucket.py
1
3009
#!/usr/bin/env python from __future__ import print_function import os import re import boto from boto.s3.connection import S3Connection from boto.iam.connection import IAMConnection import inquirer key_policy_json = """{ "Statement": [ { "Action": "iam:*AccessKey*", "Effect": "Allow", "Resour...
mit
-6,911,447,958,380,103,000
26.108108
144
0.544367
false
slohse/ansible
lib/ansible/modules/network/nxos/nxos_vrrp.py
68
12591
#!/usr/bin/python # # 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 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
-6,966,440,828,160,574,000
29.784841
87
0.598046
false
ominux/skia
tools/skpdiff/skpdiff_server.py
161
24230
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import BaseHTTPServer import json import os import os.path import re import subprocess import sys import tempfile import urllib2 # Grab the script path because that is where all the static assets are SCRIPT_DIR = os.path.d...
apache-2.0
-6,050,180,566,509,211,000
40.775862
103
0.595873
false
garverp/gnuradio
gr-blocks/examples/ctrlport/usrp_sink_controller.py
24
1510
#!/usr/bin/env python import sys import pmt from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient from optparse import OptionParser parser = OptionParser(usage="%prog: [options]") parser.add_option("-H", "--host", type="string", default="localhost", help="Hostname to conn...
gpl-3.0
533,138,655,790,485,950
34.952381
101
0.677483
false
jaantollander/CrowdDynamics
crowddynamics/core/geom2D.py
1
1734
import numba @numba.jit(['f8(f8[:, :])'], nopython=True, nogil=True, cache=True) def polygon_area(vertices): r"""Shoelace formula for computing area of polygon .. math:: A = \sum_{i=1}^{n} x_i \left(y_{i+1} - y_{i-1}\right), \quad i\mod n References: - https://en.wikipedia.org/wiki/Shoel...
gpl-3.0
8,167,034,571,920,529,000
28.389831
110
0.542099
false
liorvh/golismero
tools/sqlmap/plugins/generic/fingerprint.py
8
1726
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.common import Backend from lib.core.common import readInput from lib.core.data import logger from lib.core.enums import OS from lib.core.exception import SqlmapU...
gpl-2.0
-1,813,625,461,622,847,200
28.758621
71
0.619351
false
nwjs/chromium.src
third_party/pycoverage/coverage/execfile.py
209
5865
"""Execute files of Python code.""" import imp, marshal, os, sys from coverage.backward import exec_code_object, open_source from coverage.misc import ExceptionDuringRun, NoCode, NoSource try: # In Py 2.x, the builtins were in __builtin__ BUILTINS = sys.modules['__builtin__'] except KeyError: # In Py 3....
bsd-3-clause
-5,687,948,683,531,032,000
33.298246
79
0.58312
false
agiliq/merchant
billing/models/pin_models.py
3
3331
from django.db import models from django.conf import settings User = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') class PinCard(models.Model): token = models.CharField(max_length=32, db_index=True, editable=False) display_number = models.CharField(max_length=20, editable=False) expiry_month = models...
bsd-3-clause
-6,715,637,191,839,261,000
39.621951
120
0.698889
false
mdutkin/m2core
example/run_rest_tests.py
1
8041
import unittest from tornado.options import define, options from m2core.utils.tests import RESTTest from m2core.utils.data_helper import DataHelper from m2core import M2Core from m2core.bases import http_statuses from tornado.escape import json_decode from example.models import User # init empty object to pass it thr...
mit
-3,436,606,027,038,512,000
36.4
129
0.522199
false
mercycorps/tola-help
project/settings/production.py
47
2181
"""Production settings and globals.""" from os import environ from base import * # Normally you should not import ANYTHING from Django directly # into your settings, but ImproperlyConfigured is an exception. from django.core.exceptions import ImproperlyConfigured def get_env_setting(setting): """ Get the envi...
gpl-2.0
3,299,949,198,670,186,000
32.045455
95
0.713434
false