repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
beni55/scrapy
tests/mockserver.py
9
6572
from __future__ import print_function import sys, time, random, urllib, os, json import six from subprocess import Popen, PIPE from twisted.web.server import Site, NOT_DONE_YET from twisted.web.resource import Resource from twisted.internet import reactor, defer, ssl from scrapy import twisted_version if twisted_vers...
bsd-3-clause
catapult-project/catapult-csm
tracing/PRESUBMIT.py
2
2468
# 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. import sys def _RunArgs(args, input_api): p = input_api.subprocess.Popen(args, stdout=input_api.subprocess.PIPE, stderr=i...
bsd-3-clause
RapidApplicationDevelopment/tensorflow
tensorflow/python/ops/linalg_grad.py
5
8371
# 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
asoc/python-daemon
setup.py
1
1985
# -*- coding: utf-8 -*- # setup.py # Part of python-daemon, an implementation of PEP 3143. # # Copyright 2008-2010 Ben Finney <ben+python@benfinney.id.au> # Copyright 2008 Robert Niederreiter, Jens Klein # # This is free software: you may copy, modify, and/or distribute this work # under the terms of the Python Softwa...
gpl-2.0
xaviercobain88/framework-python
build/lib.linux-i686-2.7/openerp/addons/web/tests/test_dataset.py
28
1410
# -*- coding: utf-8 -*- import mock import unittest2 import openerp.addons.web.controllers.main class TestDataSetController(unittest2.TestCase): def setUp(self): self.dataset = openerp.addons.web.controllers.main.DataSet() self.request = mock.Mock() self.read = self.request.session.model()....
agpl-3.0
sid79master/Plugin.video.blacksid
vipracing.py
186
18923
import math import urllib, urllib2 import re def vip_unlockmeta(meta): d='' for i in range(0, len(meta)): if (i % 3 == 0): d += "%"; else: d += meta[i]; return urllib.unquote(d); def get_html(meta,data): meta_un=vip_unlockmeta(meta) # print meta_un; # return oo='' x=data l = len(x) b = 1024.0 i, j,...
gpl-2.0
sklnet/openatv-enigma2
lib/python/Screens/RdsDisplay.py
66
8287
from enigma import iPlayableService, iRdsDecoder from Screens.Screen import Screen from Components.ActionMap import NumberActionMap from Components.ServiceEventTracker import ServiceEventTracker from Components.Pixmap import Pixmap from Components.Label import Label from Components.Sources.StaticText import StaticText ...
gpl-2.0
dcbishop/TPG-checkusage
checkusage.py
1
5710
#!/usr/bin/env python # TPG Usage Checker - Retrieves the data quota usage from the TPG website. # # Written in 2010 by David C. Bishop <david@davidbishop.org> # # To the extent possible under law, the author(s) have dedicated all copyright # and related and neighboring rights to this software to the public domain # w...
cc0-1.0
pgmillon/ansible
lib/ansible/modules/cloud/amazon/iam_mfa_device_info.py
11
3623
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
marcpuig/ardupilot
Tools/autotest/fakepos.py
239
2731
#!/usr/bin/env python import socket, struct, time, errno from math import * class udp_out(object): '''a UDP output socket''' def __init__(self, device): a = device.split(':') if len(a) != 2: print("UDP ports must be specified as host:port") sys.exit(1) self.port...
gpl-3.0
wemanuel/smry
smry/server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/protorpc/protorpc/protorpc_test_pb2.py
26
15959
# Generated by the protocol buffer compiler. DO NOT EDIT (except the imports)! # Replace auto generated imports with .non_sdk_imports manually! # Do the replacement and copy this comment everytime! from .non_sdk_imports import descriptor from .non_sdk_imports import message from .non_sdk_imports import reflection fro...
apache-2.0
kamyu104/django
tests/gis_tests/distapp/tests.py
84
33555
from __future__ import unicode_literals from django.contrib.gis.db.models.functions import ( Area, Distance, Length, Perimeter, Transform, ) from django.contrib.gis.geos import GEOSGeometry, LineString, Point from django.contrib.gis.measure import D # alias for Distance from django.db import connection from djang...
bsd-3-clause
Stargrazer82301/CAAPR
CAAPR/CAAPR_AstroMagic/PTS/pts/eagle/plotgreybodyfit.py
1
4909
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
mit
Pluto-tv/blink-crosswalk
Tools/Scripts/webkitpy/style/checker_unittest.py
48
32167
# -*- coding: utf-8; -*- # # Copyright (C) 2009 Google Inc. All rights reserved. # Copyright (C) 2009 Torch Mobile Inc. # Copyright (C) 2009 Apple Inc. All rights reserved. # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) # # Redistribution and use in source and binary forms, with or without # modificatio...
bsd-3-clause
Keleir/django-xadmin
xadmin/plugins/comments.py
42
3845
import xadmin from xadmin.layout import * from xadmin.util import username_field from django.conf import settings from django.contrib.comments.models import Comment from django.utils.translation import ugettext_lazy as _, ungettext from django.contrib.comments import get_model from django.contrib.comments.views.moder...
bsd-3-clause
paulgb/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Chapter4_TheGreatestTheoremNeverTold/top_pic_comments.py
95
1161
import sys import numpy as np from IPython.core.display import Image import praw reddit = praw.Reddit("BayesianMethodsForHackers") subreddit = reddit.get_subreddit( "pics" ) top_submissions = subreddit.get_top() n_pic = int( sys.argv[1] ) if sys.argv[1] else 1 i = 0 while i < n_pic: top_submission = top_su...
mit
kuri65536/python-for-android
python-build/python-libs/gdata/build/lib/gdata/tlslite/integration/HTTPTLSConnection.py
271
6668
"""TLS Lite + httplib.""" import socket import httplib from gdata.tlslite.TLSConnection import TLSConnection from gdata.tlslite.integration.ClientHelper import ClientHelper class HTTPBaseTLSConnection(httplib.HTTPConnection): """This abstract class provides a framework for adding TLS support to httplib.""" ...
apache-2.0
Thanathan-k/EyeWitness
modules/rdp_module.py
1
8689
import sys import os try: import rdpy.core.log as log from PyQt4 import QtGui from rdpy.protocol.rdp import rdp from rdpy.ui.qt4 import RDPBitmapToQtImage from rdpy.core.error import RDPSecurityNegoFail from PIL import Image import pytesseract except ImportError: print '[*] RDP librari...
gpl-3.0
lowitty/zacademy
tmp/bracket/BracketTest.py
1
6856
# -*- coding: utf-8 -*- ''' Created on 2016年3月16日 @author: lowitty ''' s = '' def getSingleNum(i): if i < 10: print i else: print i % 10 getSingleNum(i / 10) def int2chars(i): global s if i < 26: a = chr(i + 97) print a s += a else: a = c...
mit
CEG-FYP-OpenStack/scheduler
nova/objects/block_device.py
6
16228
# Copyright 2013 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
lukasjuhrich/pycroft
tests/fixtures/dummy/host.py
1
2511
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. from fixture import DataSet from ipaddr import IPv4Address, IPv6Address from tests.fixtures.dummy.facilities im...
apache-2.0
KellyChan/python-examples
javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/utils/unittest/case.py
103
42486
"""Test case implementation""" import sys import difflib import pprint import re import unittest import warnings from django.utils.unittest import result from django.utils.unittest.util import\ safe_repr, safe_str, strclass,\ unorderable_list_difference from django.utils.unittest.compatibility import wraps ...
mit
coldmind/django
tests/urlpatterns_reverse/tests.py
6
49598
# -*- coding: utf-8 -*- """ Unit tests for reverse URL lookups. """ from __future__ import unicode_literals import sys import unittest from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.conf.urls import include, url from django.contrib.auth.models import User from django...
bsd-3-clause
zycdragonball/tensorflow
tensorflow/contrib/ndlstm/python/__init__.py
135
1103
# 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 applicable ...
apache-2.0
weixsong/algorithm
leetcode/56.py
1
1040
# -*- encoding: utf-8 -*- ''' Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. ''' # Definition for an interval. class Interval(object): def __init__(self, s=0, e=0): self.start = s self.end = e class Sol...
mit
Mlieou/leetcode_python
leetcode/python/ex_291.py
3
1080
class Solution(object): def wordPatternMatch(self, pattern, str): """ :type pattern: str :type str: str :rtype: bool """ match_dict = {} dups = set() return self.match(pattern, str, match_dict, dups, 0, 0) def match(self, pattern, string, matc...
mit
ModestoCabrera/is210-week-04-synthesizing
task_01.py
1
1130
#!/usr/bin/env python # -*- coding: utf-8 -*- """NEW PAINT COLOR SCHEME FOR ROOM IN HOME""" BASE1 = 'Seattle Gray' BASE2 = 'Manatee' ACCENT_SAGE = 'Ceramic Glaze' ACCENT_MANATEE = 'Platinum Mist' BASEQ1 = 'Which accent color, "Ceramic Glaze" or "Cumulus Nimbus"?: ' HIGHLIGHTQ = 'Which Highlight color, "Basically White...
mpl-2.0
jonathanverner/brython
www/src/Lib/encodings/iso8859_6.py
37
11140
""" Python Character Mapping Codec iso8859_6 generated from 'MAPPINGS/ISO8859/8859-6.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,i...
bsd-3-clause
kimvais/cryptography
src/cryptography/hazmat/primitives/kdf/concatkdf.py
58
4109
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import struct from cryptography import utils from cryptography.exception...
bsd-3-clause
nilqed/root
interpreter/llvm/src/utils/release/findRegressions-simple.py
123
4045
#!/usr/bin/env python import re, string, sys, os, time, math DEBUG = 0 (tp, exp) = ('compile', 'exec') def parse(file): f = open(file, 'r') d = f.read() # Cleanup weird stuff d = re.sub(r',\d+:\d', '', d) r = re.findall(r'TEST-(PASS|FAIL|RESULT.*?):\s+(.*?)\s+(.*?)\r*\n', d) test = {} fname = '' ...
lgpl-2.1
openhatch/oh-mainline
vendor/packages/django-extensions/django_extensions/tests/encrypted_fields.py
21
2728
import unittest from django.db import connection from django.conf import settings from django.core.management import call_command from django.db.models import loading # Only perform encrypted fields tests if keyczar is present # Resolves http://github.com/django-extensions/django-extensions/issues/#issue/17 try: ...
agpl-3.0
LumPenPacK/NetworkExtractionFromImages
osx_build/nefi2_osx_amd64_xcode_2015/site-packages/numpy_1.11/numpy/distutils/line_endings.py
256
2053
""" Functions for converting from DOS to UNIX line endings """ from __future__ import division, absolute_import, print_function import sys, re, os def dos2unix(file): "Replace CRLF with LF in argument files. Print names of changed files." if os.path.isdir(file): print(file, "Directory!") ret...
bsd-2-clause
mhuwiler/rootauto
tutorials/pyroot/parse_CSV_file_with_TTree_ReadStream.py
30
5361
## \file ## \ingroup tutorial_pyroot ## This function provides an example of how one might ## massage a csv data file to read into a ROOT TTree ## via TTree::ReadStream. This could be useful if the ## data read out from some DAQ program doesn't 'quite' ## match the formatting expected by ROOT (e.g. comma- ## separated...
lgpl-2.1
lkarsten/fdxread
setup.py
2
3950
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspa...
gpl-2.0
timstoop/python-beaver
beaver/transports/kinesis_transport.py
3
4180
# -*- coding: utf-8 -*- import boto.kinesis import boto.kinesis.layer1 import uuid from beaver.transports.base_transport import BaseTransport from beaver.transports.exception import TransportException class KinesisTransport(BaseTransport): def __init__(self, beaver_config, logger=None): super(KinesisTra...
mit
apark263/tensorflow
tensorflow/contrib/checkpoint/python/containers.py
3
3045
"""Checkpointable data structures.""" # Copyright 2017 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/LICE...
apache-2.0
ENCODE-DCC/dna-me-pipeline
dnanexus/older/trim-pe/resources/usr/bin/mott-trim.py
3
5028
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014 Junko Tsuji # This script computes scores based on running sum # algorithm (mott trimming algorithm) to trim 3' # ends of reads, with the score below threshould. from itertools import izip from optparse import OptionParser import sys, os.path, re nPat ...
mit
rahulraj/Vim-Files
bundle/conque_2.1/autoload/conque_term/conque_screen.py
2
7357
# FILE: autoload/conque_term/conque_screen.py # AUTHOR: Nico Raffo <nicoraffo@gmail.com> # WEBSITE: http://conque.googlecode.com # MODIFIED: 2011-04-04 # VERSION: 2.1, for Vim 7.0 # LICENSE: # Conque - Vim terminal/console emulator # Copyright (C) 2009-2011 Nico Raffo # # MIT License # # Permission is hereby gr...
mit
hale36/SRTV
lib/sqlalchemy/dialects/mssql/zxjdbc.py
79
2184
# mssql/zxjdbc.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mssql+zxjdbc :name: zxJDBC for Jython :dbapi: zxjdbc :con...
gpl-3.0
sajeeshcs/nested_quota
nova/openstack/common/timeutils.py
118
6305
# Copyright 2011 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 req...
apache-2.0
wdmchaft/taskcoach
tests/unittests/guiTests/ReminderFrameDialog.py
1
1931
''' Task Coach - Your friendly task manager Copyright (C) 2004-2010 Task Coach developers <developers@taskcoach.org> Task Coach 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 Licens...
gpl-3.0
peiyuwang/pants
tests/python/pants_test/backend/jvm/tasks/test_classpath_products.py
6
28980
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pant...
apache-2.0
rabipanda/tensorflow
tensorflow/contrib/kfac/python/ops/layer_collection_lib.py
6
1738
# Copyright 2017 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
lepistone/odoo
openerp/tools/which.py
456
6884
#!/usr/bin/env python """ Which - locate a command * adapted from Brian Curtin's http://bugs.python.org/file15381/shutil_which.patch * see http://bugs.python.org/issue444582 * uses ``PATHEXT`` on Windows * searches current directory before ``PATH`` on Windows, but not before an explicitly passed ...
agpl-3.0
ds-hwang/chromium-crosswalk
chrome/common/extensions/docs/server2/cache_chain_object_store_test.py
154
8532
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from cache_chain_object_store import CacheChainObjectStore from test_object_store import TestObjectStore import unittest class CacheCh...
bsd-3-clause
hbrunn/OpenUpgrade
addons/purchase/partner.py
112
2552
# -*- 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...
agpl-3.0
leorochael/odoo
addons/edi/models/edi.py
277
31944
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2014 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
roadmapper/ansible
lib/ansible/modules/cloud/opennebula/one_image.py
52
11657
#!/usr/bin/python # -*- coding: utf-8 -*- # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type """ (c) 2018, Milan Ilic <milani@nordeus.com> This file is part of Ansible Ansible is free software: you can redistribute it and/or modify it under the ter...
gpl-3.0
AtsushiHashimoto/fujino_mthesis
tools/dot/generate_dot_from_flow.py
1
2068
# _*_ coding: utf-8 -*- """ 入力: (predict-mst).csv 出力: dot """ import os import csv import argparse def parse(): parser = argparse.ArgumentParser() parser.add_argument('flow_path', help=u'flow.csv') parser.add_argument('output_dir', help=u'output directory') params = parser.parse_args() retur...
bsd-2-clause
dbrgn/heroku-npscipy
vendor/pip-1.3.1/setup.py
37
2242
import codecs import os import re import sys import textwrap from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): # intentionally *not* adding an encoding option to open # see here: https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 return codecs...
mit
ashwinirudrappa/zulip
zerver/migrations/0002_django_1_8.py
125
2229
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.auth.models class Migration(migrations.Migration): dependencies = [ ('zerver', '0001_initial'), ] operations = [ migrations.AlterModelManagers( name...
apache-2.0
BiznetGIO/horizon
openstack_dashboard/api/rest/swift.py
5
9164
# Copyright 2015, Rackspace, US, 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 or agreed to in w...
apache-2.0
michaeljohn32/odoomrp-wip
stock_picking_package_info/__openerp__.py
14
1620
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) # 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com) # 2015 AvanzOsc (http://www.avanzosc.es) # # This program is free software: you can redistribute it and/or modi...
agpl-3.0
azatoth/scons
test/scons-time/run/option/quiet.py
5
2673
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, modify, merge, publish, ...
mit
Eagles2F/sync-engine
inbox/models/transaction.py
4
3486
from sqlalchemy import (Column, Integer, String, ForeignKey, Index, Enum, inspect) from sqlalchemy.orm import relationship from inbox.models.base import MailSyncBase from inbox.models.mixins import HasPublicID, HasRevisions from inbox.models.namespace import Namespace class Transaction(MailSy...
agpl-3.0
cristian69/KernotekV3
venv/lib/python2.7/site-packages/werkzeug/datastructures.py
314
86050
# -*- coding: utf-8 -*- """ werkzeug.datastructures ~~~~~~~~~~~~~~~~~~~~~~~ This module provides mixins and classes with an immutable interface. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import sys import cod...
gpl-3.0
maxolasersquad/ninja-ide
ninja_ide/gui/dialogs/preferences/preferences.py
6
5899
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
gpl-3.0
jjhelmus/scipy
scipy/optimize/setup.py
63
3267
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join from scipy._build_utils import numpy_nodepr_api def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_i...
bsd-3-clause
tobegit3hub/deep_cnn
java_predict_client/src/main/proto/tensorflow/contrib/session_bundle/example/export_half_plus_two.py
12
5670
# 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
trdean/grEME
gr-digital/python/digital/constellation_map_generator.py
7
1992
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) ...
gpl-3.0
agiovann/Constrained_NMF
use_cases/granule_cells/prepare_nice_image.py
2
39221
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Sun Jul 24 17:06:17 2016 @author: agiovann """ from __future__ import division from __future__ import print_function #%% from builtins import str from builtins import range from past.utils import old_div try: get_ipython().magic('load_ext autoreload')...
gpl-2.0
pgleeson/TempRepo3
lib/jython/Lib/encodings/palmos.py
647
2936
""" Python Character Mapping Codec for PalmOS 3.5. Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,inp...
gpl-2.0
TEAM-Gummy/platform_external_chromium_org
third_party/bintrees/bintrees/walker.py
156
6288
#!/usr/bin/env python #coding:utf-8 # Author: mozman # Purpose: tree walker # Created: 07.05.2010 # Copyright (c) 2010-2013 by Manfred Moitzi # License: MIT License from operator import attrgetter, lt, gt class Walker(object): __slots__ = ['_node', '_stack', '_tree'] def __init__(self, tree): self....
bsd-3-clause
routeflow/AutomaticConfigurationRouteFlow
POX_CONTROLLER/pox/lib/packet/icmp.py
2
6933
# Copyright 2011 James McCauley # Copyright 2008 (C) Nicira, 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 ap...
apache-2.0
sinkpoint/dipy
dipy/data/__init__.py
2
12450
""" Read test or example data """ from __future__ import division, print_function, absolute_import import sys import json from nibabel import load from dipy.io.bvectxt import read_bvec_file from os.path import join as pjoin, dirname if sys.version_info[0] < 3: import cPickle def loads_compat(bytes): ...
bsd-3-clause
mick-d/nipype
nipype/interfaces/freesurfer/tests/test_auto_ParcellationStats.py
1
2184
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from __future__ import unicode_literals from ..utils import ParcellationStats def test_ParcellationStats_inputs(): input_map = dict(args=dict(argstr='%s', ), aseg=dict(mandatory=True, ), brainmask=dict(mandatory=True, ), copy_inputs=dic...
bsd-3-clause
zaafar/bcc
tools/tcpconnect.py
1
7419
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # tcpconnect Trace TCP connect()s. # For Linux, uses BCC, eBPF. Embedded C. # # USAGE: tcpconnect [-h] [-t] [-p PID] # # All connection attempts are traced, even if they ultimately fail. # # This uses dynamic tracing of kernel functions, ...
apache-2.0
pbrod/numpy
numpy/lib/arraypad.py
11
31226
""" The arraypad module contains a group of functions to pad values onto the edges of an n-dimensional array. """ import numpy as np from numpy.core.overrides import array_function_dispatch from numpy.lib.index_tricks import ndindex __all__ = ['pad'] ################################################################...
bsd-3-clause
stevehof/CouchPotatoServer
libs/suds/client.py
150
25971
# 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 ...
gpl-3.0
KaranToor/MA450
google-cloud-sdk/platform/gsutil/third_party/oauth2client/tests/contrib/test_multistore_file.py
5
13206
# Copyright 2015 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 ...
apache-2.0
0jpq0/kbengine
kbe/src/lib/python/Lib/ctypes/test/test_buffers.py
97
2284
from ctypes import * from ctypes.test import need_symbol import unittest class StringBufferTestCase(unittest.TestCase): def test_buffer(self): b = create_string_buffer(32) self.assertEqual(len(b), 32) self.assertEqual(sizeof(b), 32 * sizeof(c_char)) self.assertIs(type(b[0]), bytes)...
lgpl-3.0
strange/django-simple-comments
example/settings.py
1
1112
import os DEBUG = True TEMPLATE_DEBUG = DEBUG DEBUG_PROPAGATE_EXCEPTIONS = DEBUG USE_I18N = True DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = ':memory:' # DATABASE_NAME = 'test.db' TIME_ZONE = 'UTC' SITE_ID = 1 SECRET_KEY = '00000000000000000000000000000000000000000000000000' ROOT_URLCONF = 'example.ur...
bsd-3-clause
fauferoth/assignment
.mywaflib/waflib/extras/review.py
5
9080
#!/usr/bin/env python # encoding: utf-8 # Laurent Birtz, 2011 # moved the code into a separate tool (ita) """ There are several things here: - a different command-line option management making options persistent - the review command to display the options set Assumptions: - configuration options are not always added ...
bsd-3-clause
SylvainCorlay/PyDev.Debugger
pydevd_attach_to_process/winappdbg/event.py
102
67241
#!~/.wine/drive_c/Python25/python.exe # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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 ...
epl-1.0
robobrobro/terminus
site_scons/site_tools/resource_serializer.py
1
2403
from SCons.Action import Action from SCons.Builder import Builder from SCons.Defaults import Copy from SCons.Util import is_List import os, struct, subprocess def serialize_resource(target, source, env): # Convert source to a list of SCons Files if not is_List(source): source = [env.File(source).srcnod...
mit
krtkmj/zulip
zerver/lib/queue.py
5
12396
from __future__ import absolute_import from django.conf import settings import pika from pika.adapters.blocking_connection import BlockingChannel from pika.spec import Basic import logging import ujson import random import time import threading import atexit from collections import defaultdict from zerver.lib.utils i...
apache-2.0
nekulin/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/ScrolledList.py
160
3995
from Tkinter import * class ScrolledList: default = "(None)" def __init__(self, master, **options): # Create top frame, with scrollbar and listbox self.master = master self.frame = frame = Frame(master) self.frame.pack(fill="both", expand=1) self.vbar = vbar = Scrollba...
apache-2.0
sxpert/ansible-modules-core
cloud/openstack/os_image.py
109
6129
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either vers...
gpl-3.0
tourlines/cmsplugin-html
cmsplugin_javascript/migrations/0002_auto__add_gridpluginmodel__add_itemgridpluginmodel.py
1
15868
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models # FIXME: É nescessario repensar esta estrutura para biblioteca externas # O ideal era tornar esta biblioteca uma externa para que possamos dividir o # se...
apache-2.0
ajoaoff/django
django/contrib/redirects/middleware.py
383
1810
from __future__ import unicode_literals from django import http from django.apps import apps from django.conf import settings from django.contrib.redirects.models import Redirect from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured class RedirectFallback...
bsd-3-clause
rhyolight/NAB
setup.py
7
3234
# ---------------------------------------------------------------------- # Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/...
agpl-3.0
wweiradio/django
tests/postgres_tests/models.py
231
3562
from django.db import connection, models from .fields import ( ArrayField, BigIntegerRangeField, DateRangeField, DateTimeRangeField, FloatRangeField, HStoreField, IntegerRangeField, JSONField, ) class PostgreSQLModel(models.Model): class Meta: abstract = True required_db_vendor = 'postgre...
bsd-3-clause
pculture/unisubs
apps/teams/experience.py
1
2297
# Amara, universalsubtitles.org # # Copyright (C) 2018 Participatory Culture Foundation # # 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 op...
agpl-3.0
trondhindenes/ansible
lib/ansible/modules/network/cnos/cnos_config.py
17
11557
#!/usr/bin/python # -*- coding: utf-8 -*- # # (C) 2017 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE...
gpl-3.0
rememberlenny/google-course-builder
tests/suite.py
6
10249
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
leiferikb/bitpop
src/v8/tools/presubmit.py
3
13359
#!/usr/bin/env python # # Copyright 2012 the V8 project authors. 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 # noti...
gpl-3.0
sdague/home-assistant
homeassistant/components/freebox/device_tracker.py
15
4452
"""Support for Freebox devices (Freebox v6 and Freebox mini 4K).""" from datetime import datetime from typing import Dict from homeassistant.components.device_tracker import SOURCE_TYPE_ROUTER from homeassistant.components.device_tracker.config_entry import ScannerEntity from homeassistant.config_entries import Config...
apache-2.0
szha/mxnet
example/gluon/embedding_learning/model.py
23
8175
# 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
hainm/scikit-learn
examples/ensemble/plot_partial_dependence.py
249
4456
""" ======================== Partial Dependence Plots ======================== Partial dependence plots show the dependence between the target function [1]_ and a set of 'target' features, marginalizing over the values of all other features (the complement features). Due to the limits of human perception the size of t...
bsd-3-clause
adam111316/SickGear
lib/chardet/latin1prober.py
4
5496
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer....
gpl-3.0
deyton/swift
utils/pass-pipeline/src/passes.py
22
3095
from pass_pipeline import Pass # TODO: This should not be hard coded. Create a tool in the compiler that knows # how to dump the passes and the pipelines themselves. AADumper = Pass('AADumper') ABCOpt = Pass('ABCOpt') AddressLowering = Pass('AddressLowering') AllocBoxToStack = Pass('AllocBoxToStack') CFGPrinter = Pas...
apache-2.0
vitan/hue
desktop/core/ext-py/Django-1.6.10/tests/syndication/urls.py
58
1084
from __future__ import absolute_import from django.conf.urls import patterns from . import feeds urlpatterns = patterns('django.contrib.syndication.views', (r'^syndication/complex/(?P<foo>.*)/$', feeds.ComplexFeed()), (r'^syndication/rss2/$', feeds.TestRss2Feed()), (r'^syndication/rss2/guid_ispermalink_...
apache-2.0
Moriadry/tensorflow
tensorflow/python/layers/convolutional.py
10
66594
# 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
jakev/dtf
python-dtf/dtf/core/compat.py
2
1187
# Android Device Testing Framework ("dtf") # Copyright 2013-2017 Jake Valletta (@jake_valletta) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
apache-2.0
mwmuni/LIGGGHTS_GUI
OpenGL/GL/NV/framebuffer_multisample_coverage.py
9
1856
'''OpenGL extension NV.framebuffer_multisample_coverage This module customises the behaviour of the OpenGL.raw.GL.NV.framebuffer_multisample_coverage to provide a more Python-friendly API Overview (from the spec) This extension extends the EXT_framebuffer_multisample specification by providing a new function, ...
gpl-3.0
tonnrueter/pymca_devel
PyMca/StackPluginResultsWindow.py
1
9157
#/*########################################################################## # Copyright (C) 2004-2012 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. # # This toolkit is free software; you can redistribute it and/or m...
gpl-2.0
bonitadecker77/python-for-android
python3-alpha/python3-src/Lib/test/test_threaded_import.py
57
7247
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
apache-2.0
bjennin/StarduPlane
Tools/scripts/frame_sizes.py
351
1117
#!/usr/bin/env python import re, sys, operator, os code_line = re.compile("^\s*\d+:/") frame_line = re.compile("^\s*\d+\s+/\* frame size = (\d+) \*/") class frame(object): def __init__(self, code, frame_size): self.code = code self.frame_size = int(frame_size) frames = [] def process_lst(filena...
gpl-3.0
tedder/ansible-modules-core
cloud/openstack/_quantum_floating_ip.py
41
10556
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # This module 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-3.0
bjwbell/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_parser.py
451
3612
from __future__ import absolute_import, division, unicode_literals import os import sys import traceback import warnings import re warnings.simplefilter("error") from .support import get_data_files from .support import TestData, convert, convertExpected, treeTypes from html5lib import html5parser, constants # Run t...
mpl-2.0