repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
marcosmodesto/django-testapp
django/contrib/gis/geoip/prototypes.py
200
3730
from ctypes import c_char_p, c_float, c_int, string_at, Structure, POINTER from django.contrib.gis.geoip.libgeoip import lgeoip, free #### GeoIP C Structure definitions #### class GeoIPRecord(Structure): _fields_ = [('country_code', c_char_p), ('country_code3', c_char_p), ('country...
bsd-3-clause
ryfeus/lambda-packs
Lxml_requests/source/pip/_vendor/requests/packages/chardet/sjisprober.py
1777
3764
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Rights Reserved. # # Con...
mit
edx/ecommerce
ecommerce/extensions/voucher/migrations/0001_initial.py
1
3161
# -*- coding: utf-8 -*- from decimal import Decimal from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('order', '0001_initial'), ('offer', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER...
agpl-3.0
krikru/tensorflow-opencl
tensorflow/python/debug/debug_data.py
11
41977
# 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
Jgarcia-IAS/ReporsitorioVacioOdoo
openerp/addons/hr_contract/base_action_rule.py
389
2646
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
arj1231/kernel_lge_msm8226
tools/perf/scripts/python/net_dropmonitor.py
1258
1562
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
Tatsh-ansible/ansible-modules-core
utilities/helper/_fireball.py
12
1343
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@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...
gpl-3.0
nielsvanoch/django
tests/model_regress/tests.py
39
9289
from __future__ import unicode_literals import datetime from operator import attrgetter import sys import unittest from django.core.exceptions import ValidationError from django.test import TestCase, skipUnlessDBFeature from django.utils import six from django.utils.timezone import get_fixed_timezone from django.db i...
bsd-3-clause
tensorflow/tfx
tfx/examples/mnist/mnist_pipeline_native_keras_e2e_test.py
1
5568
# Copyright 2019 Google 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
GlobalBoost/GlobalBoost-Y
test/functional/test_framework/netutil.py
12
5103
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Linux network utilities. Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-10...
mit
AlfioEmanueleFresta/practical-ecb-lib
cp_ecb/image.py
1
4402
from PIL import Image class InMemoryImage: """ A very simple class to represent an image. """ def __init__(self, w, h, c=3, b=b'', encrypted=False): """ Instantiate a new image. :param w: The width of the image (px). :param h: The height of the image (...
gpl-3.0
boegel/easybuild-framework
easybuild/tools/parallelbuild.py
2
8609
# # # Copyright 2012-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (...
gpl-2.0
pranjalpatil/scrapy
scrapy/core/downloader/webclient.py
115
5048
from time import time from six.moves.urllib.parse import urlparse, urlunparse, urldefrag from twisted.web.client import HTTPClientFactory from twisted.web.http import HTTPClient from twisted.internet import defer from scrapy.http import Headers from scrapy.utils.httpobj import urlparse_cached from scrapy.responsetype...
bsd-3-clause
wyc/django
tests/migrations/test_multidb.py
366
6909
import unittest from django.db import connection, migrations, models from django.db.migrations.state import ProjectState from django.test import override_settings from .test_operations import OperationTestBase try: import sqlparse except ImportError: sqlparse = None class AgnosticRouter(object): """ ...
bsd-3-clause
BrotherPhil/django
django/contrib/contenttypes/migrations/0002_remove_content_type_name.py
582
1168
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def add_legacy_name(apps, schema_editor): ContentType = apps.get_model('contenttypes', 'ContentType') for ct in ContentType.objects.all(): try: ct.name = apps.get_model(ct.app_label, c...
bsd-3-clause
akamel001/Sick-Beard
sickbeard/history.py
9
2862
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
cluckmaster/MissionPlanner
Lib/site-packages/numpy/f2py/common_rules.py
51
4709
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" """ Build common block mechanism for f2py2e. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the Num...
gpl-3.0
pvagner/orca
test/keystrokes/firefox/line_nav_lists.py
1
9203
#!/usr/bin/python """Test of HTML list presentation.""" from macaroon.playback import * import utils sequence = MacroSequence() # Work around some new quirk in Gecko that causes this test to fail if # run via the test harness rather than manually. sequence.append(KeyComboAction("<Control>r")) sequence.append(utils...
lgpl-2.1
Ever-Never/androguard
elsim/elsim/similarity/simhash.py
44
2143
""" Implementation of Charikar similarity hashes in Python. Most useful for creating 'fingerprints' of documents or metadata so you can quickly find duplicates or cluster items. Part of python-hashes by sangelone. See README and LICENSE. """ from hashtype import hashtype class simhash(hashtype): def create_hash...
apache-2.0
deepakantony/sms-tools
lectures/06-Harmonic-model/plots-code/predominantmelody.py
3
3124
import sys, csv, os from essentia import * from essentia.standard import * from pylab import * from numpy import * sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import stft as STFT filename = '../../../sounds/carnatic.wav' hopSize = 128 frameSize = 2048 sampleR...
agpl-3.0
JioCloud/python-heatclient
heatclient/tests/test_shell.py
2
55063
# 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 the...
apache-2.0
pythonchelle/opencomparison
apps/accounts/urls.py
1
1313
from django.conf import settings from django.conf.urls.defaults import patterns, include, url from django.views.generic.simple import direct_to_template from registration.views import activate from registration.views import register from accounts.forms import RegistrationForm urlpatterns = patterns('', url(...
mit
Benrflanders/Pytris
pyglet/pyglet/graphics/__init__.py
22
26048
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
mit
mnahm5/django-estore
Lib/site-packages/boto/regioninfo.py
128
6214
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # 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 res...
mit
colinmcd94/kickdata
lib/bs4/oldbs4/tests/test_builder_registry.py
2
4954
"""Tests of the builder registry.""" import unittest from bs4 import BeautifulSoup from bs4.builder import ( builder_registry as registry, HTMLParserTreeBuilder, LXMLTreeBuilderForXML, LXMLTreeBuilder, TreeBuilderRegistry, ) try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT =...
apache-2.0
zetalog/linux
drivers/comedi/drivers/ni_routing/tools/csv_collection.py
548
1272
# SPDX-License-Identifier: GPL-2.0+ # vim: ts=2:sw=2:et:tw=80:nowrap import os, csv, glob class CSVCollection(dict): delimiter=';' quotechar='"' source_column_name = 'Sources / Destinations' """ This class is a dictionary representation of the collection of sheets that exist in a given .ODS file. """ ...
gpl-2.0
TimBuckley/effective_django
django/contrib/gis/geos/linestring.py
105
5813
from django.contrib.gis.geos.base import numpy from django.contrib.gis.geos.coordseq import GEOSCoordSeq from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.point import Point from django.contrib.gis.geos import prototypes as cap...
bsd-3-clause
battlecat/Spirit
spirit/category/admin/views.py
11
1660
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from django.contrib import messages from django.utils.translation import ugettext as _ from ...c...
mit
kawasaki2013/python-for-android-x86
python3-alpha/python3-src/Lib/encodings/shift_jis_2004.py
816
1059
# # shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jis_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEnc...
apache-2.0
kose-y/pylearn2
pylearn2/scripts/dbm/show_samples.py
37
8032
#!/usr/bin/env python """ Usage: python show_samples <path_to_a_saved_DBM.pkl> Displays a batch of data from the DBM's training set. Then interactively allows the user to run Gibbs steps starting from that seed data to see how the DBM's MCMC sampling changes the data. """ from __future__ import print_function __autho...
bsd-3-clause
ismail-s/warehouse
tests/unit/test_config.py
1
15964
# 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 the Li...
apache-2.0
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/lib/mpl_toolkits/axisartist/angle_helper.py
6
14365
from __future__ import print_function from math import floor import numpy as np import math A = np.array from mpl_toolkits.axisartist.grid_finder import ExtremeFinderSimple def select_step_degree(dv): degree_limits_ = [1.5, 3, 7, 13, 20, 40, 70, 120, 270, 520] degree_steps_ = [ 1, 2, 5, 10, 15, 30, 45, ...
mit
gangadharkadam/johnfrappe
frappe/core/doctype/customize_form/test_customize_form.py
18
6744
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, unittest, json from frappe.test_runner import make_test_records_for_doctype test_dependencies = ["Custom Field", "Property Setter"] class TestCustomizeForm(unit...
mit
michalwerner/django-filebrowser-tinymce4
tests/test_sites.py
2
13320
# coding: utf-8 from __future__ import with_statement import os import json import shutil from django.core.urlresolvers import reverse try: from django.utils.six.moves.urllib.parse import urlencode except: from django.utils.http import urlencode from mock import patch from filebrowser.settings import VERSIONS...
bsd-3-clause
av8ramit/tensorflow
tensorflow/contrib/boosted_trees/python/ops/split_handler_ops.py
78
1122
# 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
okwow123/djangol2
example/env/lib/python2.7/site-packages/allauth/socialaccount/adapter.py
6
7658
from __future__ import absolute_import from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from . import app_settings from ..account import app_settings as account_settings from ..account.adapter import get_adapter as get_account_adapter from ..account.app_settin...
mit
elijah513/django
django/utils/translation/__init__.py
108
7111
""" Internationalization support. """ from __future__ import unicode_literals import re from django.utils import six from django.utils.decorators import ContextDecorator from django.utils.encoding import force_text from django.utils.functional import lazy __all__ = [ 'activate', 'deactivate', 'override', 'deacti...
bsd-3-clause
piyush8311/ns3-arp
waf-tools/clang_compilation_database.py
99
1830
#!/usr/bin/env python # encoding: utf-8 # Christoph Koke, 2013 """ Writes the c and cpp compile commands into build/compile_commands.json see http://clang.llvm.org/docs/JSONCompilationDatabase.html Usage: def configure(conf): conf.load('compiler_cxx') ... conf.load('clang_compilation_data...
gpl-2.0
grandquista/rethinkdb
test/common/http_support/werkzeug/local.py
147
14094
# -*- coding: utf-8 -*- """ werkzeug.local ~~~~~~~~~~~~~~ This module implements context-local objects. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from functools import update_wrapper from werkzeug.wsgi import ClosingIt...
apache-2.0
code-sauce/tensorflow
tensorflow/python/kernel_tests/concat_op_test.py
27
27222
# Copyright 2015 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
vitorio/bite-project
deps/gdata-python-client/samples/apps/marketplace_sample/gdata/tlslite/utils/Cryptlib_TripleDES.py
359
1408
"""Cryptlib 3DES implementation.""" from cryptomath import * from TripleDES import * if cryptlibpyLoaded: def new(key, mode, IV): return Cryptlib_TripleDES(key, mode, IV) class Cryptlib_TripleDES(TripleDES): def __init__(self, key, mode, IV): TripleDES.__init__(self, key, mode,...
apache-2.0
Simage/shinken
test/test_regenerator.py
14
7568
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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 F...
agpl-3.0
NickelMedia/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/download.py
113
18403
# Copyright (c) 2009, 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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...
bsd-3-clause
pwong-mapr/private-hue
desktop/core/ext-py/Django-1.4.5/django/core/paginator.py
94
5058
from math import ceil class InvalidPage(Exception): pass class PageNotAnInteger(InvalidPage): pass class EmptyPage(InvalidPage): pass class Paginator(object): def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True): self.object_list = object_list self.per_pa...
apache-2.0
tsdmgz/ansible
lib/ansible/modules/network/ios/ios_interface.py
19
14246
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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
jamesblunt/IbPy
ib/ext/Execution.py
9
2355
#!/usr/bin/env python """ generated source for module Execution """ # # Original file copyright original author(s). # This file copyright Troy Melhase, troy@gci.net. # # WARNING: all changes to this file will be lost. from ib.lib.overloading import overloaded # # * Execution.java # * # # package: com.ib.client cl...
bsd-3-clause
edespino/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/filerep/Filerep_Resync/fault/genFault.py
7
4002
""" Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the 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....
apache-2.0
jamesiter/JimV-N
models/event_process.py
1
9567
#!/usr/bin/env python # -*- coding: utf-8 -*- import libvirt from models.initialize import guest_event_emit from models import Guest __author__ = 'James Iter' __date__ = '2017/6/15' __contact__ = 'james.iter.cn@gmail.com' __copyright__ = '(c) 2017 by James Iter.' class EventProcess(object): conn = None g...
gpl-3.0
bunop/pyEnsemblRest
ensemblrest/exceptions.py
2
2231
""" This file is part of pyEnsemblRest. Copyright (C) 2013-2016, Steve Moss pyEnsemblRest 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 opti...
gpl-3.0
night-ghost/ardupilot
Tools/scripts/configure_all.py
7
1110
#!/usr/bin/env python """ script to run configre for all hwdef.dat, to check for syntax errors """ import os import shutil import subprocess import sys import fnmatch board_pattern = '*' # allow argument for pattern of boards to build if len(sys.argv)>1: board_pattern = sys.argv[1] os.environ['PYTHONUNBUFFERED...
gpl-3.0
tjamet/dotfiles
vim/eclim/autoload/eclim/python/rope/contrib/fixmodnames.py
91
2256
"""Fix the name of modules This module is useful when you want to rename many of the modules in your project. That can happen specially when you want to change their naming style. For instance:: fixer = FixModuleNames(project) changes = fixer.get_changes(fixer=str.lower) project.do(changes) Here it renames a...
gpl-3.0
petrvanblokland/Xierpa3
xierpa3/sites/examples/helloworldblueprint/make.py
1
9548
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # -----------------------------------------------------------...
mit
DhruvSarma/retrogamelib
BubbMan/gamelib/objects.py
3
10795
import pygame import os import sys import math sys.path.insert(0, "..") from retrogamelib import gameobject from retrogamelib import button from retrogamelib.constants import * from retrogamelib.util import * class Collidable(gameobject.Object): def __init__(self): gameobject.Object.__init__(self, se...
lgpl-2.1
BigBrother1984/android_external_chromium_org
chrome/tools/build/win/create_installer_archive.py
34
25393
#!/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. """Script to create Chrome Installer archive. This script is used to create an archive of all the files required for a Chrome ...
bsd-3-clause
michaelgallacher/intellij-community
python/lib/Lib/string.py
92
16675
"""A collection of string operations (most are no longer used). Warning: most of the code you see here isn't normally used nowadays. Beginning with Python 1.6, many of these functions are implemented as methods on the standard string object. They used to be implemented by a built-in module called strop, but strop is n...
apache-2.0
blademainer/intellij-community
python/helpers/docutils/parsers/rst/directives/images.py
51
6348
# $Id: images.py 5952 2009-05-19 08:45:27Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Directives for figures and simple images. """ __docformat__ = 'reStructuredText' import sys from docutils import nodes, utils from docutils.parsers.rst i...
apache-2.0
ericmoritz/requests_debug
test.py
1
6351
import threading import Queue from wsgiref.simple_server import make_server from functools import partial from pprint import pprint from requests_debug import debug as requests_debug import requests import time from testfixtures import compare from contextlib import contextmanager import logging logging.basicConfig(lev...
mit
bd-j/magellanic
magellanic/sfhs/prediction_scripts/predicted_total.py
1
5894
import sys, pickle, copy import numpy as np import matplotlib.pyplot as pl import astropy.io.fits as pyfits import magellanic.regionsed as rsed import magellanic.mcutils as utils from magellanic.lfutils import * try: import fsps from sedpy import observate except ImportError: #you wont be able to predict...
gpl-2.0
bccp/abopt
abopt/legacy/tests/test_vmad.py
1
2670
from __future__ import print_function from abopt.legacy.vmad import VM, microcode, programme, Zero, Tape from numpy.testing import assert_raises, assert_array_equal, assert_allclose import numpy class TestVM(VM): @microcode(ain=['x'], aout=['y']) def unitary(self, x, y, factor): y[...] = x * factor ...
gpl-3.0
minghuascode/pyj
examples/misc/flaskexamples/flaskcelery/public/services/jsonrpc/cgihandler.py
17
2170
""" Copyright (c) 2006 Jan-Klaas Kollhof This file is part of jsonrpc. jsonrpc is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later ...
apache-2.0
forge33/CouchPotatoServer
couchpotato/core/plugins/base.py
3
15178
import threading from urllib import quote from urlparse import urlparse import glob import inspect import os.path import re import time import traceback from couchpotato.core.event import fireEvent, addEvent from couchpotato.core.helpers.encoding import ss, toSafeString, \ toUnicode, sp from couchpotato.core.helpe...
gpl-3.0
repotvsupertuga/tvsupertuga.repository
script.module.resolveurl/lib/resolveurl/lib/CustomProgressDialog.py
3
3627
""" ResolveURL Addon for Kodi Copyright (C) 2016 t0mm0, tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later...
gpl-2.0
blackmiaool/js-beautify
python/jsbeautifier/unpackers/evalbased.py
221
1171
# # Unpacker for eval() based packers, a part of javascript beautifier # by Einar Lielmanis <einar@jsbeautifier.org> # # written by Stefano Sanfilippo <a.little.coder@gmail.com> # # usage: # # if detect(some_string): # unpacked = unpack(some_string) # """Unpacker for eval() based packers: runs JS code and retu...
mit
reverse-CSE-591/reverse
driver.py
1
19133
#!/usr/bin/python -tt ##################################################################################################################### # CSE 591: Security and Vulnerability Analysis # # Team 5: # # Kartheek Nallepalli # Bhargavi Rajagopalan # Priya Pipada # Ayush Maheshwari # Nikhil Aourpally # # # This is the dr...
mit
gtolan/mrkttrdr
node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
1558
4945
# Copyright (c) 2011 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. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
mollstam/UnrealPy
UnrealPyEmbed/Source/Python/Lib/python27/distutils/command/build_py.py
74
16338
"""distutils.command.build_py Implements the Distutils 'build_py' command.""" __revision__ = "$Id$" import os import sys from glob import glob from distutils.core import Command from distutils.errors import DistutilsOptionError, DistutilsFileError from distutils.util import convert_path from distutils import log c...
mit
GGXH/python_koans
python2/koans/about_methods.py
2
5757
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Partially based on AboutMethods in the Ruby Koans # from runner.koan import * def my_global_function(a, b): return a + b class AboutMethods(Koan): def test_calling_a_global_function(self): self.assertEqual(5, my_global_function(2, 3)) # NOTE: ...
mit
gusDuarte/sugar
extensions/cpsection/aboutme/model.py
4
4041
# Copyright (C) 2008 One Laptop Per Child # # 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 program is distribu...
gpl-2.0
supriyantomaftuh/django
tests/gis_tests/rasterapp/test_rasterfield.py
241
3424
import json from unittest import skipIf from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.shortcuts import numpy from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from ..data.rasters.textrasters import JSON_RASTER from...
bsd-3-clause
xuleiboy1234/autoTitle
tensorflow/tensorflow/contrib/saved_model/python/__init__.py
136
1173
# 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...
mit
particl/particl-core
test/functional/test_framework/script_util.py
29
3452
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Useful Script constants and utils.""" from test_framework.script import CScript, hash160, sha256, OP_0,...
mit
woelfware/BluMote
test/button_tx.py
1
1963
#!/usr/bin/env python # Copyright (C) 2011 Woelfware from bluetooth import * import blumote import cPickle from glob import glob import os import sys import time class Blumote_Client(blumote.Services): def __init__(self): blumote.Services.__init__(self) self.addr = None def find_blumote_pods(self, pod_name = N...
gpl-3.0
nzlosh/st2
st2common/st2common/validators/api/misc.py
3
1383
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
apache-2.0
TalShafir/ansible
lib/ansible/modules/cloud/ovirt/ovirt_snapshot_facts.py
55
3817
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # 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': ['preview'], 'supported_by': 'community'} DOCUM...
gpl-3.0
timhuanggithub/pox_load_balancing
pox/openflow/flow_table.py
25
9857
# Copyright 2011,2012,2013 Colin Scott # # This file is part of POX. # # POX 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. # # POX is...
gpl-3.0
VcamX/grpc
src/python/grpcio/grpc/framework/alpha/_face_utilities.py
1
7822
# Copyright 2015-2016, 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 of conditions and ...
bsd-3-clause
SmithsonianEnterprises/django-threadedcomments
setup.py
3
2570
#!/usr/bin/env python from setuptools import setup, find_packages from os import path import codecs import os import re import sys # When creating the sdist, make sure the django.mo file also exists: if 'sdist' in sys.argv or 'develop' in sys.argv: os.chdir('threadedcomments') try: from django.core im...
bsd-3-clause
earshel/PokeyPySnipe
POGOProtos/Data/Logs/CatchPokemonLogEntry_pb2.py
5
4809
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Data/Logs/CatchPokemonLogEntry.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.pr...
mit
ovnicraft/openerp-server
openerp/addons/base/module/wizard/base_update_translations.py
1
2901
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
Lujeni/ansible
test/units/modules/network/fortios/test_fortios_wireless_controller_hotspot20_anqp_network_auth_type.py
21
9129
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
wscullin/spack
lib/spack/spack/platforms/bgq.py
3
2163
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
intgr/django
django/db/backends/mysql/base.py
7
14150
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/ """ import re from django.core.exceptions import ImproperlyConfigured from django.db import utils from django.db.backends import utils as backend_utils from django.db.backends.base.base import BaseDatabaseWrapper fr...
bsd-3-clause
yrobla/nova
nova/api/openstack/compute/contrib/cells.py
7
10153
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011-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-2.0
brian-yang/mozillians
vendor-local/lib/python/django_browserid/tests/__init__.py
11
2935
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from django.utils.functional import wraps from mock import patch def fake_create_user(email): pass class mock_br...
bsd-3-clause
citrix-openstack-build/python-openstackclient
openstackclient/tests/common/test_clientmanager.py
1
1180
# Copyright 2012-2013 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 ...
apache-2.0
ted-gould/nova
nova/api/openstack/compute/legacy_v2/contrib/aggregates.py
51
11505
# Copyright (c) 2012 Citrix Systems, 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 ...
apache-2.0
craneworks/debisogen
debisogen/iso.py
3
4389
"""Utilities and shell command to bundle a preseed file inside a Debian ISO.""" import glob import os import re import shutil from utils import use_temp_dir, replace_in_file, execute_command, download_file def download_iso_file(source, destination): """Download system installer image from source to destination."...
bsd-3-clause
plxaye/chromium
src/tools/valgrind/suppressions.py
61
34532
#!/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. # suppressions.py """Post-process Valgrind suppression matcher. Suppressions are defined as follows: # optional one-line comment...
apache-2.0
PageArkanis/StEVE
steve/constellation.py
1
1217
from steve.backend.sqlitedb import SDB from steve.system import System class Constellation(object): def __init__(self, universe, data): self.universe = universe self.regionID = data[0] self.uid = data[1] self.name = data[2] self.x ...
agpl-3.0
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/reportlab/graphics/charts/lineplots.py
9
46974
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/lineplots.py __version__=''' $Id$ ''' __doc__="""This module defines a very preliminary Line Plot example.""" import string, time fr...
agpl-3.0
jsteemann/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/command/build_scripts.py
50
4692
"""distutils.command.build_scripts Implements the Distutils 'build_scripts' command.""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: build_scripts.py 69599 2009-02-13 23:02:44Z tarek.ziade $" import os, re from stat import ST_MODE from distutils import sysconfig from distutils.core ...
apache-2.0
hcarvalhoalves/duplicity
duplicity/path.py
2
26431
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <ben@emerose.org> # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License...
gpl-2.0
blueyed/coveragepy
tests/test_templite.py
1
10970
# coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.templite.""" import re from coverage.templite import Templite, TempliteSyntaxError, TempliteValueError from tests.coveraget...
apache-2.0
siliconsmiley/QGIS
python/plugins/fTools/tools/doSubsetSelect.py
11
4818
# -*- coding: utf-8 -*- #----------------------------------------------------------- # # fTools # Copyright (C) 2008-2011 Carson Farmer # EMAIL: carson.farmer (at) gmail.com # WEB : http://www.ftools.ca/fTools.html # # A collection of data management and analysis tools for vector data # #-----------------------------...
gpl-2.0
ktnyt/chainer
tests/chainer_tests/datasets_tests/test_concatenated_dataset.py
13
1854
import numpy as np import six import unittest from chainer.datasets import ConcatenatedDataset from chainer import testing @testing.parameterize( # basic usage {'datasets': ( np.random.uniform(size=(5, 3, 48, 32)), np.random.uniform(size=(15, 3, 64, 48)), )}, # more than two datasets...
mit
kivra/slackbot
tests/functional/test_functional.py
13
5260
#!/usr/bin/env python """This function tests would start a slackbot, and use slack web api to drive the tests agains the bot. """ import os import subprocess import pytest from os.path import join, abspath, dirname, basename from tests.functional.driver import Driver from tests.functional.settings import ( testbo...
mit
AOKP/kernel_sony_apq8064
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
kerr-huang/SL4A
python/src/Lib/test/test_filecmp.py
77
5389
import os, filecmp, shutil, tempfile, shutil import unittest from test import test_support class FileCompareTestCase(unittest.TestCase): def setUp(self): self.name = test_support.TESTFN self.name_same = test_support.TESTFN + '-same' self.name_diff = test_support.TESTFN + '-diff' da...
apache-2.0
agentr13/python-phonenumbers
python/phonenumbers/pb2/__init__.py
5
2788
"""Translate python-phonenumbers PhoneNumber to/from protobuf PhoneNumber Examples of use: >>> import phonenumbers >>> from phonenumbers.pb2 import phonenumber_pb2, PBToPy, PyToPB >>> x_py = phonenumbers.PhoneNumber(country_code=44, national_number=7912345678) >>> print x_py Country Code: 44 National Number: 79123456...
apache-2.0
andgoldschmidt/iEBE
EBE-Node/iSS/for_paraview/lib/RectilinearGrid.py
9
2857
#!/usr/bin/env python """ RectilinearGrid """ """ Copyright 2001 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the LGPL. See http://www.fsf.org NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK....
gpl-3.0