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
openmotics/gateway
src/gateway/migrations/orm/013_add_config.py
1
1498
# Copyright (C) 2020 OpenMotics BV # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribu...
agpl-3.0
6,835,297,483,976,506,000
32.288889
76
0.694927
false
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
flask/lib/python2.7/site-packages/Crypto/Random/OSRNG/fallback.py
138
1520
# # Random/OSRNG/fallback.py : Fallback entropy source for systems with os.urandom # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to ...
mit
-8,722,480,588,647,490,000
32.043478
81
0.657895
false
nishantjr/pjproject
tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py
42
1562
# $Id$ import inc_sip as sip import inc_sdp as sdp # In this test we simulate broken server, where: # - it wants to signal that NONCE has change # - but it sets stale=false # For this case pjsip will retry authentication until # PJSIP_MAX_STALE_COUNT is exceeded. # pjsua = "--null-audio --id=sip:CLIENT --registrar s...
gpl-2.0
-3,393,045,737,889,642,000
37.097561
93
0.660051
false
pecan/pecan
pecan/__init__.py
4
5028
from .core import ( abort, override_template, Pecan, Request, Response, load_app, redirect, render, request, response ) from .decorators import expose from .hooks import RequestViewerHook from .middleware.debug import DebugMiddleware from .middleware.errordocument import ErrorDocumentMiddleware from .middlewar...
bsd-3-clause
5,986,543,629,739,394,000
36.522388
79
0.626691
false
printedheart/h2o-3
py2/testdir_single_jvm/test_parse_nfs.py
20
2678
import unittest, sys sys.path.extend(['.','..','../..','py']) import os import h2o2 as h2o import h2o_cmd, h2o_import as h2i, h2o_browse as h2b from h2o_test import find_file, dump_json, verboseprint expectedZeros = [0 for i in range(11)] CAUSE_FAIL = False def assertEqualMsg(a, b): assert a == b, "%s %s" % (a, b) ...
apache-2.0
568,067,369,480,995,800
34.236842
96
0.609783
false
ojake/django
django/core/files/locks.py
725
3516
""" Portable file locking utilities. Based partially on an example by Jonathan Feignberg in the Python Cookbook [1] (licensed under the Python Software License) and a ctypes port by Anatoly Techtonik for Roundup [2] (license [3]). [1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203 [2] http://sourceforg...
bsd-3-clause
6,761,999,983,944,371,000
30.115044
89
0.593857
false
hwu25/AppPkg
Applications/Python/Python-2.7.2/Lib/distutils/command/install_headers.py
59
1397
"""distutils.command.install_headers Implements the Distutils 'install_headers' command, to install C/C++ header files to the Python include directory.""" __revision__ = "$Id$" from distutils.core import Command # XXX force is never used class install_headers(Command): description = "install C/C+...
bsd-2-clause
6,978,801,997,373,422,000
25.392157
75
0.545455
false
google/skywater-pdk-libs-sky130_fd_io
docs/conf.py
1
13864
# -*- coding: utf-8 -*- # Copyright 2020 SkyWater PDK Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
7,627,929,198,001,180,000
32.088305
124
0.631492
false
jphnoel/udata
udata/search/fields.py
1
10369
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging import re from datetime import date from bson.objectid import ObjectId from elasticsearch_dsl import Q, A from elasticsearch_dsl.faceted_search import ( Facet as DSLFacet, TermsFacet as DSLTermsFacet, RangeFacet as DSLRangeFac...
agpl-3.0
-8,814,252,677,100,742,000
29.230321
79
0.581445
false
mdeemer/XlsxWriter
xlsxwriter/test/comparison/test_outline06.py
8
2936
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
1,126,080,471,270,529,200
31.988764
101
0.577657
false
rheise/python-suds-tz
suds/xsd/doctor.py
204
6308
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
5,116,650,219,267,576,000
26.915929
76
0.56468
false
waterponey/scikit-learn
sklearn/datasets/species_distributions.py
13
7866
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/details/3038/0>`_ , the Bro...
bsd-3-clause
5,727,074,152,853,127,000
29.726563
79
0.620646
false
prefetchnta/questlab
bin/python/Lib/doctest.py
5
104492
# Module doctest. # Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org). # Major enhancements and refactoring by: # Jim Fulton # Edward Loper # Provided as-is; use at your own risk; no warranty; no promises; enjoy! r"""Module doctest -- a framework for running examples in docstrings. In...
lgpl-2.1
5,167,230,425,692,205,000
36.533046
79
0.569948
false
sn1k/app_mundial
lib/python2.7/site-packages/django/contrib/admindocs/views.py
10
15480
from importlib import import_module import inspect import os import re import warnings from django import template from django.apps import apps from django.conf import settings from django.contrib import admin from django.contrib.admin.views.decorators import staff_member_required from django.db import models from dja...
gpl-2.0
-6,869,755,659,833,660,000
38.489796
147
0.559755
false
alsrgv/tensorflow
tensorflow/contrib/learn/python/learn/export_strategy.py
42
4759
# 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
-1,180,884,078,801,767,200
42.263636
95
0.692793
false
adelq/TextBlob
tests/test_sentiments.py
13
1884
from __future__ import unicode_literals import unittest from nose.tools import * # PEP8 asserts from nose.plugins.attrib import attr from textblob.sentiments import PatternAnalyzer, NaiveBayesAnalyzer, DISCRETE, CONTINUOUS class TestPatternSentiment(unittest.TestCase): def setUp(self): self.analyzer = ...
mit
-8,936,527,951,277,204,000
32.052632
89
0.65552
false
bernard357/shellbot
examples/audit.py
1
4144
#!/usr/bin/env python # -*- coding: utf-8 -*- # 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, ...
apache-2.0
-8,978,679,248,497,796,000
37.018349
80
0.750241
false
minhphung171093/GreenERP_V7
openerp/addons/web/tests/test_serving_base.py
138
1031
# -*- coding: utf-8 -*- import random import unittest2 from ..controllers.main import module_topological_sort as sort def sample(population): return random.sample( population, random.randint(0, min(len(population), 5))) class TestModulesLoading(unittest2.TestCase): def setUp(self): ...
agpl-3.0
-5,292,095,127,408,246,000
29.323529
76
0.548982
false
3L3N4/metagoofil
extractors/metadataMSOfficeXML.py
16
7833
import unzip import zipfile import sys import re import os import random import myparser class metaInfoMS: def __init__(self): self.template ="" self.totalTime ="" self.pages ="" self.words ="" self.characters ="" self.application ="" self.docSecurity ="" self.lines ="" self.paragraphs ="" self.sc...
gpl-2.0
1,997,612,044,507,765,500
22.106195
81
0.620835
false
Kazade/NeHe-Website
google_appengine/lib/django-1.2/django/core/management/commands/shell.py
45
2962
import os from django.core.management.base import NoArgsCommand from optparse import make_option class Command(NoArgsCommand): option_list = NoArgsCommand.option_list + ( make_option('--plain', action='store_true', dest='plain', help='Tells Django to use plain Python, not IPython.'), ) ...
bsd-3-clause
-3,732,195,824,608,522,000
41.927536
92
0.568197
false
dashmug/saleor
saleor/registration/backends.py
20
1428
from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend from .models import ExternalUserData User = get_user_model() class Backend(ModelBackend): def get_user(self, user_id): try: return User.objects.get(pk=user_id) except User.DoesNotExi...
bsd-3-clause
-3,399,950,109,434,540,500
28.142857
77
0.601541
false
cwilliamson226/SecondString
dbscripts/dbpop.py
1
1716
# dbpop.py # cwilliamson226 # Python script that uses nflgame to pull stats of all players then pushes them to the MongoDB import nflgame from pymongo import MongoClient # Imports the stats from the 2016 season games = nflgame.games(2016) plays = nflgame.combine_plays(games) # Creates a connection through...
mit
6,300,348,384,655,267,000
38.904762
164
0.727273
false
emote-project/Scenario1
NAOBridges/NAOThalamusGUI/bin/Release/python/soundLocationModule.py
2
2745
from datetime import datetime import naoqi from naoqi import ALBroker from naoqi import ALModule from naoqi import ALProxy instance = None SoundLocator = None def log(text): instance.nao.log("SoundLocationModule: " + text) return; class SoundLocationModule(object): nao = None proxy = None lastD...
lgpl-3.0
3,574,422,539,927,134,000
32.888889
124
0.567942
false
AyoubZahid/odoo
openerp/addons/base/ir/ir_rule.py
34
7149
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from openerp import SUPERUSER_ID from openerp import tools from openerp.osv import fields, osv, expression from openerp.tools.safe_eval import safe_eval as eval from openerp.tools.misc import unquote as unquo...
gpl-3.0
-518,217,577,713,393,300
44.826923
222
0.5812
false
pcampese/codewars
where_is_my_parent_cry.py
1
2360
# https://www.codewars.com/kata/where-is-my-parent-cry/python def find_children(input_string): print('original = [{}]'.format(input_string)) ########### # Method 1: 1st Attempt ########### string_sorted = ''.join(sorted(input_string)) # Separate the string by case upper = [c ...
gpl-3.0
7,244,737,360,756,532,000
50.326087
194
0.548305
false
JFriel/honours_project
networkx/build/lib/networkx/algorithms/tree/tests/test_branchings.py
31
9935
from nose import SkipTest from nose.tools import * import networkx as nx try: import numpy as np except: raise SkipTest('NumPy not available.') from networkx.algorithms.tree import branchings from networkx.algorithms.tree import recognition from networkx.testing import * # # Explicitly discussed examples fr...
gpl-3.0
2,135,592,161,819,949,300
30.741214
80
0.584701
false
techdragon/django
django/core/management/commands/dbshell.py
174
1240
from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections class Command(BaseCommand): help = ( "Runs the command-line client for specified database, or the " "default database if none is provided." ) requires_system_checks = Fals...
bsd-3-clause
6,414,330,736,390,294,000
39
104
0.637903
false
rendermotion/RMMel
snippets/ReverseSideCustomRig.py
2
2215
import maya.cmds as cmds import RMUncategorized def MirrorChildren(Objects): for eachObject in Objects: children = cmds.listRelatives(eachObject, children = True,type='transform') if (children): MirrorChildren(children) for eachObject in Objects: ObjectTransformDic = RMUn...
lgpl-3.0
-1,969,502,634,393,754,400
51.738095
233
0.598646
false
akopich/spark
python/pyspark/ml/pipeline.py
69
13177
# # 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
-1,026,649,592,191,838,200
32.787179
98
0.623814
false
utensil-star/PeachPy
peachpy/arm/microarchitecture.py
6
3571
# This file is part of Peach-Py package and is licensed under the Simplified BSD license. # See license.rst for the full text of the license. from peachpy.arm.isa import Extension, Extensions class Microarchitecture: def __init__(self, name, extensions): self.name = name self.extensions = Exte...
bsd-2-clause
4,624,637,423,456,754,000
58.516667
114
0.604593
false
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons/l10n_be_invoice_bba/__init__.py
438
1101
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
7,058,376,010,772,872,000
41.346154
78
0.620345
false
ucldc/harvester
scripts/delete_couchdocs_by_obj_checksum.py
1
3470
#! /bin/env python # -*- coding: utf-8 -*- import sys import argparse from harvester.couchdb_init import get_couchdb from harvester.couchdb_sync_db_by_collection import delete_id_list from harvester.post_processing.couchdb_runner import CouchDBCollectionFilter def confirm_deletion(count, objChecksum, cid): prompt...
bsd-3-clause
8,173,720,680,722,310,000
47.859155
132
0.721245
false
niphlod/pydal
pydal/parsers/sqlite.py
4
1042
from datetime import datetime, date from decimal import Decimal from ..adapters.sqlite import SQLite from .base import ListsParser, DateParser, TimeParser, DateTimeParser, \ JSONParser from . import parsers, for_type, before_parse @parsers.register_for(SQLite) class SQLiteParser( ListsParser, DateParser, Time...
bsd-3-clause
-2,027,377,366,841,194,800
30.575758
72
0.646833
false
robbertvanginkel/buck
third-party/py/pex/pex/commands/bdist_pex.py
39
2822
import os from distutils import log from setuptools import Command from pex.bin.pex import build_pex, configure_clp from pex.common import die from pex.variables import ENV # Suppress checkstyle violations due to setuptools command requirements. class bdist_pex(Command): # noqa description = "create a PEX file f...
apache-2.0
9,213,736,583,541,926,000
32.2
93
0.666903
false
ResEnv/chain-api
chain/influx_client.py
1
7963
import requests from pytz import UTC from datetime import datetime from django.db import IntegrityError import itertools from time import sleep from chain.core.api import BadRequestException from itertools import izip from time import sleep EPOCH = UTC.localize(datetime.utcfromtimestamp(0)) HTTP_STATUS_SUCCESSFUL_WRI...
mit
9,099,003,525,692,470,000
42.043243
112
0.519151
false
adw0rd/lettuce
tests/integration/lib/Django-1.3/django/contrib/localflavor/fi/forms.py
309
1803
""" FI-specific Form helpers """ import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.translation import ugettext_lazy as _ class FIZipCodeField(RegexField): default_error_messages = { ...
gpl-3.0
1,383,442,105,510,918,100
34.352941
87
0.61675
false
mjs/juju
acceptancetests/repository/trusty/mysql/hooks/lib/cluster_utils.py
19
3331
# # Copyright 2012 Canonical Ltd. # # This file is sourced from lp:openstack-charm-helpers # # Authors: # James Page <james.page@ubuntu.com> # Adam Gandelman <adamg@ubuntu.com> # from lib.utils import ( juju_log, relation_ids, relation_list, relation_get, get_unit_hostname, config_get ) i...
agpl-3.0
5,156,808,410,683,291,000
24.623077
76
0.580306
false
jimi-c/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py
17
30286
#!/usr/bin/python # # This is a 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. # # This Ansible library is distributed in the hope that i...
gpl-3.0
-8,205,442,003,299,388,000
39.435247
139
0.633593
false
ergenekonyigit/Numerical-Analysis-Examples
Python/leastsquares.py
1
2271
# # The MIT License (MIT) # # Copyright (c) 2016 Scott J. Johnson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy...
mit
-944,363,305,646,781,200
35.629032
111
0.693527
false
sekikn/incubator-airflow
tests/providers/google/cloud/hooks/test_cloud_memorystore.py
5
25979
# # 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,497,880,310,286,458,400
41.588525
110
0.635629
false
snoonetIRC/CloudBot
plugins/metars.py
3
1095
import requests from cloudbot import hook api_url_metar = "http://api.av-wx.com/metar/" api_url_taf = "http://api.av-wx.com/taf/" def lookup(text, url): station = text.split(' ')[0].upper() if len(station) != 4: return "please specify a valid station code see http://weather.rap.ucar.edu/surface/stat...
gpl-3.0
8,344,363,251,287,191,000
30.285714
117
0.66758
false
Justin-Yuan/Image2Music-Generator
library/jython2.5.3/Lib/encodings/iso8859_4.py
593
13632
""" Python Character Mapping Codec iso8859_4 generated from 'MAPPINGS/ISO8859/8859-4.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,errors='...
gpl-2.0
-1,465,927,745,739,902,700
43.403909
107
0.536165
false
jackkiej/SickRage
lib/imdb/parser/sql/objectadapter.py
62
7978
""" parser.sql.objectadapter module (imdb.parser.sql package). This module adapts the SQLObject ORM to the internal mechanism. Copyright 2008-2010 Davide Alberani <da@erlug.linux.it> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published...
gpl-3.0
-2,935,121,267,694,366,000
36.810427
79
0.644522
false
lucasplus/MABDI
mabdi/FilterDepthImageToSurface.py
1
7799
import vtk from vtk.util.vtkAlgorithm import VTKPythonAlgorithmBase from vtk.util import numpy_support from vtk.numpy_interface import dataset_adapter as dsa from Utilities import DebugTimeVTKFilter import numpy as np from scipy import ndimage from timeit import default_timer as timer import logging class FilterDe...
bsd-3-clause
7,770,543,942,542,496,000
39.832461
121
0.590717
false
Distrotech/reportlab
src/rl_addons/rl_accel/tests/t3.py
14
1431
from reportlab.pdfbase.pdfmetrics import getFont import time from sys import getrefcount font = getFont('Times-Roman') _py_stringWidth = font._py_stringWidth stringWidth = font.stringWidth assert stringWidth!=_py_stringWidth #print "font=%s(%d) widths=%s(%d)" % ( # hex(id(font)), getrefcount(font), # hex(id...
bsd-3-clause
-2,539,542,111,787,214,300
38.75
269
0.705101
false
JamesMura/yo_payments
setup.py
1
1224
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() readme = open('README.rst').read() history = open('HISTORY.rst...
mit
-5,962,306,546,492,166,000
24.5
66
0.609477
false
kalaidin/luigi
test/contrib/hadoop_jar_test.py
20
2357
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
1,304,789,335,510,926,300
31.736111
74
0.700042
false
emon10005/sympy
sympy/printing/tests/test_jscode.py
59
10228
from sympy.core import pi, oo, symbols, Rational, Integer, GoldenRatio, EulerGamma, Catalan, Lambda, Dummy from sympy.functions import Piecewise, sin, cos, Abs, exp, ceiling, sqrt from sympy.utilities.pytest import raises from sympy.printing.jscode import JavascriptCodePrinter from sympy.utilities.lambdify import imple...
bsd-3-clause
-7,384,697,010,450,534,000
26.945355
137
0.454732
false
carhaas/cdec-semparse
python/cdec/sa/online.py
5
4497
from __future__ import division import collections import gzip import itertools from cdec.sa._sa import gzip_or_text # Same as Cython implementation. Collisions with NULL in bitext? NULL_WORD = 'NULL' def learn_vocab(text_f): vocab = set() for line in gzip_or_text(text_f): for word in line.strip()....
apache-2.0
-193,100,741,778,513,920
30.669014
135
0.491439
false
ramcn/demo3
venv/lib/python3.4/site-packages/django/db/backends/mysql/client.py
520
1518
import subprocess from django.db.backends.base.client import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' @classmethod def settings_to_cmd_args(cls, settings_dict): args = [cls.executable_name] db = settings_dict['OPTIONS'].get('db', settings_dic...
mit
-4,348,171,648,621,437,400
35.142857
82
0.550066
false
kyroskoh/phantomjs
src/qt/qtwebkit/Source/ThirdParty/gtest/scripts/pump.py
233
22879
#!/usr/bin/env python # # Copyright 2008, Google 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 the above copyright # notice, this list...
bsd-3-clause
-8,323,518,169,382,624,000
26.4
80
0.619695
false
QijunPan/ansible
lib/ansible/modules/web_infrastructure/django_manage.py
31
11716
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Scott Anderson <scottanderson42@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 o...
gpl-3.0
-8,847,266,952,141,712,000
37.794702
215
0.649881
false
gautelinga/BERNAISE
utilities/units.py
1
3837
''' This converts the simulation parmatetor into dimensionless quantiteis and give is the physical uints that the feilds should be scaled whit. ''' # import external packs import dolfin as df import h5py import os import glob import numpy as np import sys # import internal BERNAISE packs # Find path to the BERNAISE ...
mit
6,602,078,232,879,485,000
29.696
81
0.593432
false
cjaymes/pyscap
src/scap/model/oval_5/defs/StateType.py
1
1565
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
gpl-3.0
-2,564,383,789,555,319,300
41.297297
134
0.653035
false
joejulian/openstack-guest-agents-unix
commands/password.py
4
9612
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2011 Openstack, LLC. # 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-2.0
4,208,027,303,562,018,000
27.778443
79
0.558365
false
andrewls/bzrflag
bzagents/grid-agent.py
1
20370
#!/usr/bin/python -tt # An incredibly simple agent. All we do is find the closest enemy tank, drive # towards it, and shoot. Note that if friendly fire is allowed, you will very # often kill your own tanks with this code. ################################################################# # NOTE TO STUDENTS # This is...
gpl-3.0
-2,838,369,228,134,350,000
45.935484
242
0.56431
false
zielmicha/torrent-workshops
bencode.py
1
2431
import ioutil import string import io EndSenitel = object() class Decoder(): def __init__(self, stream): self.stream = stream def decode(self): c = self.stream.read(1) if c == b'i': data = ioutil.read_until(self.stream, b'e') if data != b'0' and data.startswith...
gpl-3.0
-7,255,859,405,961,192,000
22.833333
76
0.481695
false
scorphus/scrapy
scrapy/commands/shell.py
107
2194
""" Scrapy Shell See documentation in docs/topics/shell.rst """ from threading import Thread from scrapy.commands import ScrapyCommand from scrapy.shell import Shell from scrapy.http import Request from scrapy.utils.spider import spidercls_for_request, DefaultSpider class Command(ScrapyCommand): requires_proj...
bsd-3-clause
-5,033,840,394,705,688,000
30.797101
78
0.637192
false
pomack/pychecker
pychecker/checker.py
1
13095
#!/usr/bin/env python # -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # Copyright (c) 2001-2004, MetaSlash Inc. All rights reserved. # Portions Copyright (c) 2005, Google, Inc. All rights reserved. """ Check python source code files for possible errors and print warnings Contact Info: http://pychecker.sourcefo...
bsd-3-clause
-4,957,162,914,046,283,000
30.030806
82
0.592516
false
citrix-openstack-build/cinder
cinder/tests/test_HpSanISCSIDriver.py
1
9385
# Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
8,676,656,230,395,790,000
43.061033
79
0.554289
false
jmesteve/openerpseda
openerp/addons/l10n_es_payment_order/wizard/export_remesas.py
4
9922
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2006 ACYSOS S.L. (http://acysos.com) All Rights Reserved. # Pedro Tarrafeta <pedro@acysos.com> # Copyright (c) 2008 Pablo Roc...
agpl-3.0
-9,093,786,812,468,706,000
49.784615
214
0.558821
false
rodrigods/keystone
keystone/common/driver_hints.py
15
2754
# Copyright 2013 OpenStack Foundation # 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 by app...
apache-2.0
-2,820,086,131,938,091,500
41.369231
78
0.645969
false
amita-kapoor/Neural-Networks
Hopfield_img.py
1
7221
import numpy as np import logging as lg import random import os import cv2 from copy import deepcopy def learn(X): """ Learns the fundamental memories represented in the input vector X Args: Take flattened (1-D) input vectors arranged in an array Returns: The interconnection mat...
mit
8,020,527,738,780,241,000
29.671053
128
0.577205
false
camptocamp/c2c-rd-addons
account_invoice_2_move/__init__.py
893
1045
# -*- 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
7,825,042,909,428,353,000
46.5
78
0.611483
false
Teino1978-Corp/google-belay
tests/functional/station_tests.py
4
4525
# Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
7,682,995,992,200,077,000
33.807692
97
0.630718
false
theotherjimmy/yotta
yotta/debug.py
4
1081
# Copyright 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import os import logging # validate, , validate things, internal from .lib import validate # CMakeGen, , generate build files, internal from .lib import cmakegen def addOpt...
apache-2.0
7,714,117,005,859,578,000
22
74
0.666975
false
kylebebak/Requester
deps/oauthlib/oauth2/rfc6749/endpoints/authorization.py
10
4666
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals import logging from oauthlib.common import Request from oauthlib.oauth2.rfc6...
mit
7,120,504,050,792,813,000
38.880342
83
0.688384
false
mouseratti/guake
guake/settings.py
4
4359
# -*- coding: utf-8; -*- """ Copyright (C) 2007-2012 Lincoln de Sousa <lincoln@minaslivre.org> Copyright (C) 2007 Gabriel Falcão <gabrielteratos@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundat...
gpl-2.0
-7,614,531,798,055,351,000
38.981651
100
0.687242
false
gylian/Sick-Beard
lib/gntp/notifier.py
122
8299
# Copyright: 2013 Paul Traylor # These sources are released under the terms of the MIT license: see LICENSE """ The gntp.notifier module is provided as a simple way to send notifications using GNTP .. note:: This class is intended to mostly mirror the older Python bindings such that you should be able to replace in...
gpl-3.0
1,198,797,452,550,850,800
30.316981
100
0.735631
false
mariaantoanelam/Licenta
Lib/test/test_gl.py
15
6640
#! /usr/bin/env python """Very simple test script for the SGI gl library extension module taken mostly from the documentation. Roger E. Masse """ from test_support import verbose, TestSkipped import gl, GL, time glattrs = ['RGBcolor', 'RGBcursor', 'RGBmode', 'RGBrange', 'RGBwritemask', '__doc__', '__name__', '...
mit
-4,177,725,287,535,532,500
43.266667
74
0.625301
false
0jpq0/kbengine
kbe/res/scripts/common/Lib/idlelib/RemoteDebugger.py
137
12029
"""Support for remote Python debugging. Some ASCII art to describe the structure: IN PYTHON SUBPROCESS # IN IDLE PROCESS # # oid='gui_adapter' +----------+ # +------------+ ...
lgpl-3.0
1,580,733,348,679,070,700
29.922879
80
0.564802
false
Manazius/blacksmith-bot
extensions/networktime.py
3
1686
# BS mark.1-55 # /* coding: utf-8 */ # BlackSmith plugin # cipher_plugin.py # Author: ferym (ferym@jabbim.org.ru) # http://jabbrik.ru strip_tags = re.compile(r'<[^<>]+>') def handler_msk_time(type, source, body): try: body = re_search(read_url('http://www.zln.ru/time/', 'Mozilla/5.0'), '<div id="servertime" st...
apache-2.0
8,972,820,835,478,182,000
38.74359
250
0.593548
false
cloudbase/nova
nova/cmd/all.py
5
3283
# Copyright 2011 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wi...
apache-2.0
-7,977,294,856,393,936,000
35.076923
79
0.646969
false
plilja/adventofcode
2015/day07/day07.py
1
1315
import sys wires = {} computed = {} for i in range(0, 65536): def f(j): return lambda: j wires[str(i)] = f(i) for line in sys.stdin.readlines(): def cache(key, f): def g(): if key in computed: return computed[key] else: r = f() ...
gpl-3.0
2,617,152,062,792,882,000
24.288462
81
0.467681
false
Distrotech/intellij-community
python/helpers/docutils/readers/pep.py
61
1554
# $Id: pep.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Python Enhancement Proposal (PEP) Reader. """ __docformat__ = 'reStructuredText' from docutils.readers import standalone from docutils.transforms import p...
apache-2.0
-5,672,985,877,778,856,000
31.375
75
0.675032
false
OPM/ResInsight
GrpcInterface/Python/rips/PythonExamples/create_wbs_plot.py
1
1383
import os import grpc # Load ResInsight Processing Server Client Library import rips # Connect to ResInsight instance resInsight = rips.Instance.find() # Get all GeoMech cases cases = resInsight.project.descendants(rips.GeoMechCase) # Get all well paths well_paths = resInsight.project.well_paths() # Ensure there's...
gpl-3.0
-6,299,076,969,842,971,000
26.66
86
0.696312
false
anfedorov/psutil
examples/disk_usage.py
44
2031
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ List all mounted disk partitions a-la "df -h" command. $ python examples/disk_usage.py Device Total Used ...
bsd-3-clause
2,935,869,857,083,852,000
31.238095
78
0.527326
false
dapuck/pyleus
pyleus/storm/__init__.py
7
1740
"""Package containing pyleus implementation of major Storm entities. """ from __future__ import absolute_import from collections import namedtuple DEFAULT_STREAM = "default" LOG_TRACE = 0 LOG_DEBUG = 1 LOG_INFO = 2 LOG_WARN = 3 LOG_ERROR = 4 StormTuple = namedtuple('StormTuple', "id comp stream task values") """Nam...
apache-2.0
5,851,798,981,205,370,000
28
77
0.664368
false
hpssjellis/deeplearnjs-javascript-examples
Unordered-tensorflow-examples/aymericdamien-Examples/examples/linear_regression.py
7
2600
''' A linear regression learning algorithm example using TensorFlow library. Author: Aymeric Damien Project: https://github.com/aymericdamien/TensorFlow-Examples/ ''' import tensorflow as tf import numpy import matplotlib.pyplot as plt rng = numpy.random # Parameters learning_rate = 0.01 training_epochs = 2000 displ...
mit
-3,490,702,574,427,144,000
32.779221
126
0.645769
false
sup95/zulip
confirmation/views.py
31
1660
# -*- coding: utf-8 -*- # Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com> __revision__ = '$Id: views.py 21 2008-12-05 09:21:03Z jarek.zgoda $' from django.shortcuts import render_to_response from django.template import RequestContext from django.conf import settings from django.http import HttpRequest, Htt...
apache-2.0
3,093,074,170,783,195,600
35.086957
85
0.68012
false
amolenaar/gaphor
gaphor/SysML/blocks/block.py
1
4366
from gaphor.core import gettext from gaphor.core.modeling.properties import attribute from gaphor.diagram.presentation import ( Classified, ElementPresentation, from_package_str, ) from gaphor.diagram.shapes import ( Box, EditableText, FontStyle, FontWeight, Text, TextAlign, Vert...
lgpl-2.1
-2,348,856,257,530,684,400
32.584615
87
0.507329
false
aron-bordin/kivy
examples/widgets/textinput.py
81
1860
''' Textinput tests =============== This test is used to demonstrate virtual keyboard according to current configuration. Run this test as:: # use dock virtual keyboard (one instance) python textinput.py -c kivy:keyboard_mode:dock # use multi users virtual keyboard (multiples instance) python textinpu...
mit
-1,216,456,206,137,298,000
30.525424
77
0.68871
false
cathywu/flow
flow/scenarios/loop_merge.py
1
8343
"""Contains the loop merge scenario class.""" from flow.scenarios.base_scenario import Scenario from flow.core.params import InitialConfig from flow.core.params import TrafficLightParams from numpy import pi, sin, cos, linspace ADDITIONAL_NET_PARAMS = { # radius of the loops "ring_radius": 50, # length of...
mit
2,848,723,368,461,185,000
30.247191
79
0.496344
false
h2oai/h2o-dev
h2o-py/tests/testdir_hdfs/pyunit_INTERNAL_HDFS_airlines_glrm_profile.py
4
3636
from __future__ import print_function import sys sys.path.insert(1,"../../") import h2o import time from tests import pyunit_utils from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator #---------------------------------------------------------------------- # Purpose: This test is to run GLRM on airline data ...
apache-2.0
559,071,015,401,855,000
46.233766
124
0.516777
false
jtux270/translate
FreeIPA/freeipa-3.0.0/ipalib/plugins/misc.py
2
4028
# Authors: # Jason Gerard DeRose <jderose@redhat.com> # # Copyright (C) 2008 Red Hat # see file 'COPYING' for use and warranty information # # 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, ei...
gpl-3.0
-2,328,113,311,566,027,000
27.771429
96
0.561569
false
317070/kaggle-heart
configurations/je_ss_lincrps_nrmsc_dropoutput.py
1
8363
"""Single slice vgg with normalised scale. """ import functools import lasagne as nn import numpy as np import theano import theano.tensor as T import data_loader import deep_learning_layers import layers import preprocess import postprocess import objectives import theano_printer import updates # Random params rng ...
mit
-6,100,967,688,279,809,000
43.721925
175
0.704293
false
ntt-sic/heat
heat/tests/test_sqlalchemy_types.py
1
1833
# # 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
-8,350,221,961,829,276,000
32.944444
78
0.683033
false
ingmarschuster/ModelSelection
modsel/scribblings/eval_is_si.py
1
4431
# -*- coding: utf-8 -*- """ Created on Fri Feb 6 09:47:47 2015 @author: Ingmar Schuster """ from __future__ import division, print_function, absolute_import import numpy as np import scipy as sp import scipy.stats as stats from numpy import exp, log, sqrt from scipy.misc import logsumexp from numpy.linalg import i...
gpl-3.0
8,984,795,135,202,438,000
32.824427
181
0.588129
false
gacarrillor/QGIS
python/plugins/db_manager/db_plugins/postgis/plugin_test.py
30
5901
# -*- coding: utf-8 -*- """ *************************************************************************** plugin_test.py --------------------- Date : May 2017 Copyright : (C) 2017, Sandro Santilli Email : strk at kbt dot io ***********************************...
gpl-2.0
-4,635,549,280,802,029,000
36.801282
86
0.577921
false
abdellatifkarroum/odoo
addons/account/account_invoice.py
5
79092
# -*- 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
557,942,516,725,957,760
47.080243
303
0.572877
false
tigerpulma/RASdecoder
Tapaoux.py
6
2292
#!/usr/bin/env python ''' Tapaoux Config Extractor ''' __description__ = 'Tapaoux Config Extractor' __author__ = 'Kevin Breen http://techanarchy.net http://malwareconfig.com' __version__ = '0.1' __date__ = '2015/05/11' import re import sys import string from operator import xor from optparse import OptionParser keys...
gpl-3.0
-1,577,907,023,586,023,400
29.972973
106
0.556719
false
mmiklavc/metron
metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/metron_service.py
9
23287
""" 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 this ...
apache-2.0
-8,788,382,286,941,381,000
35.216174
205
0.617855
false
florianpaquet/sublime-sync
requests/packages/charade/jpcntx.py
151
19323
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Ri...
mit
-920,903,515,337,221,100
86.232877
168
0.516483
false
hdinsight/hue
desktop/core/ext-py/pysaml2-2.4.0/src/saml2/client_base.py
31
32142
#!/usr/bin/env python # -*- coding: utf-8 -*- # """Contains classes and functions that a SAML2.0 Service Provider (SP) may use to conclude its tasks. """ import threading from urllib import urlencode from urlparse import urlparse from saml2.entity import Entity from saml2.mdstore import destinations from saml2.profi...
apache-2.0
-8,789,699,472,282,483,000
38.149817
80
0.54197
false
hdinsight/hue
desktop/core/ext-py/boto-2.38.0/boto/dynamodb/item.py
153
8280
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
apache-2.0
1,864,605,302,368,086,000
39.990099
79
0.636594
false
popazerty/obh-test1
lib/python/Components/Network.py
26
23663
import os import re from socket import * from Components.Console import Console from Components.PluginComponent import plugins from Plugins.Plugin import PluginDescriptor class Network: def __init__(self): self.ifaces = {} self.configuredNetworkAdapters = [] self.NetworkState = 0 self.DnsState = 0 self.name...
gpl-2.0
-3,430,015,482,675,223,600
32.707977
167
0.689811
false
OmarIthawi/edx-platform
lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py
60
6425
# -*- coding: 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 model 'CourseAuthorization' db.create_table('bulk_email_courseauthorization', ( ('id', ...
agpl-3.0
-3,687,015,781,092,074,500
66.642105
182
0.554553
false
weimingtom/python-for-android
python-modules/zope/zope/interface/common/mapping.py
50
3512
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
apache-2.0
6,892,283,234,421,008,000
26.653543
78
0.602221
false
comiconomenclaturist/libretime
python_apps/airtime_analyzer/tests/replaygain_analyzer_tests.py
2
4078
from nose.tools import * from airtime_analyzer.replaygain_analyzer import ReplayGainAnalyzer ''' The tests in here were all tagged with the 'rgain' tag so the can be exluded from being run with nosetest -a '!rgain'. This was needed due to the fact that it is not readily possible to install replaygain on a containerize...
agpl-3.0
955,637,475,163,341,600
41.041237
117
0.753556
false
jeremiahyan/odoo
addons/stock/wizard/stock_scheduler_compute.py
2
1938
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # # Order Point Method: # - Order if the virtual stock of today is below the min of the defined order point # from odoo import api, models, tools import logging import threading _logger = logging.getLogger(__name__...
gpl-3.0
8,666,858,161,158,611,000
39.375
116
0.615583
false