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
tyb0807/angr
angr/analyses/disassembly.py
1
21510
import logging from collections import defaultdict from . import Analysis from .disassembly_utils import decode_instruction from ..block import CapstoneInsn l = logging.getLogger("angr.analyses.disassembly") # pylint: disable=unidiomatic-typecheck class DisassemblyPiece(object): addr = None ident = float...
bsd-2-clause
GdZ/scriptfile
software/googleAppEngine/lib/django_1_3/docs/_ext/djangodocs.py
53
8377
""" Sphinx plugins for Django documentation. """ import os import re from docutils import nodes, transforms try: import json except ImportError: try: import simplejson as json except ImportError: try: from django.utils import simplejson as json except ImportError: ...
mit
ByteInternet/python-social-auth
social/backends/gae.py
89
1292
""" Google App Engine support using User API """ from __future__ import absolute_import from google.appengine.api import users from social.backends.base import BaseAuth from social.exceptions import AuthException class GoogleAppEngineAuth(BaseAuth): """GoogleAppengine authentication backend""" name = 'googl...
bsd-3-clause
tommiport5/WatchYourHood
LinkSearch.py
2
3311
'''LinkFinder class Created on 31.10.2015 @author: Dad ''' import re import urllib WWWPrefix = re.compile("www.(.*)",re.IGNORECASE) def normalize(domain): ma = WWWPrefix.match(domain) if ma == None: return domain else: return ma.group(1) class UrlDistance: """The distance to our original domain...
gpl-2.0
lbraginsky/Branching
FastBranching.py
1
7062
''' Created on Sep 3, 2017 @author: lbraginsky ''' import numpy as np class Branching(object): @staticmethod def sparsity_fitness(gen, diameter): from scipy import spatial tree = spatial.cKDTree(gen) f = lambda p: len(tree.query_ball_point(p, r=0.5*diameter)) return np.apply_...
gpl-3.0
pawaranand/phr-frappe
frappe/core/report/todo/todo.py
28
1379
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.widgets.reportview import execute as runreport from frappe.utils import getdate def execute(filters=None): priority_map = {"Hig...
mit
violetqemu/violetqemu
scripts/acpi_extract.py
94
12683
#!/usr/bin/python # Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.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 Foundation; either version 2 of the License, or # (at your option)...
gpl-2.0
surligas/gnuradio
gnuradio-runtime/examples/volk_benchmark/volk_math.py
59
5334
#!/usr/bin/env python from gnuradio import gr from gnuradio import blocks import argparse from volk_test_funcs import * try: from gnuradio import blocks except ImportError: sys.stderr.write("This example requires gr-blocks.\n") def multiply_const_cc(N): k = 3.3 op = blocks.multiply_const_cc(k) tb...
gpl-3.0
cordoval/myhdl-python
myhdl/test/core/test_concat.py
3
8877
# This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2003-2008 Jan Decaluwe # # The myhdl library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # published by t...
lgpl-2.1
20uf/ansible
lib/ansible/playbook/handler.py
237
1957
# (c) 2012-2014, 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 the License, or # (at your option) an...
gpl-3.0
lnielsen/invenio
modules/bibcheck/lib/plugins/doi.py
3
2205
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013 CERN. ## ## Invenio 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) a...
gpl-2.0
landryb/QGIS
python/ext-libs/pygments/lexers/shell.py
71
14782
# -*- coding: utf-8 -*- """ pygments.lexers.shell ~~~~~~~~~~~~~~~~~~~~~ Lexers for various shells. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, inclu...
gpl-2.0
cheungpat/sqlalchemy-utils
tests/test_auto_delete_orphans.py
4
3259
import sqlalchemy as sa from pytest import raises from sqlalchemy_utils import auto_delete_orphans, ImproperlyConfigured from tests import TestCase class TestAutoDeleteOrphans(TestCase): def create_models(self): tagging = sa.Table( 'tagging', self.Base.metadata, sa.Col...
bsd-3-clause
Philippe12/external_chromium_org
chrome/common/extensions/docs/server2/manifest_data_source.py
25
4872
# 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. import json from data_source import DataSource import features_utility from future import Gettable, Future from manifest_features import ConvertDottedKeysTo...
bsd-3-clause
azurestandard/django
django/contrib/admin/tests.py
18
4203
from django.test import LiveServerTestCase from django.utils.importlib import import_module from django.utils.unittest import SkipTest from django.utils.translation import ugettext as _ class AdminSeleniumWebDriverTestCase(LiveServerTestCase): webdriver_class = 'selenium.webdriver.firefox.webdriver.WebDriver' ...
bsd-3-clause
ressu/SickGear
lib/sqlalchemy/ext/declarative/__init__.py
77
47619
# ext/declarative/__init__.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 """ Synopsis ======== SQLAlchemy object-relational configuration involves...
gpl-3.0
keedio/hue
desktop/libs/libopenid/src/libopenid/conf.py
35
2032
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
willprice/weboob
modules/agendadulibre/browser.py
6
2004
# -*- coding: utf-8 -*- # Copyright(C) 2014 Bezleputh # # This file is part of weboob. # # weboob 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 opt...
agpl-3.0
yousafsyed/casperjs
bin/Lib/_markupbase.py
891
14598
"""Shared support for scanning document type declarations in HTML and XHTML. This module is used as a foundation for the html.parser module. It has no documented public API and should not be used directly. """ import re _declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match _declstringlit_match = re.com...
mit
smallredbean/pgctl
tests/conftest.py
1
2521
# -*- coding: utf-8 -*- # pylint:disable=redefined-outer-name,unused-argument from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import os from py._path.local import LocalPath as Path from pytest import yield_fixture as fixture from testing import copy...
mit
Nick-Hall/gramps
gramps/gen/plug/report/_constants.py
7
2026
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2001-2006 Donald N. Allingham # Copyright (C) 2010 Rob G. Healey <robhealey1@gmail.com> # Copyright (C) 2010 Jakim Friant # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public ...
gpl-2.0
geopython/QGIS
python/plugins/MetaSearch/util.py
6
5736
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2010 NextGIS (http://nextgis.org), # Alexander Bruy (alexander.bruy@gmail.com), # Maxim Dubinin (sim@gis-lab.info) # # Copyright (C) 2014 Tom Kralidis (tomkrali...
gpl-2.0
hanlind/nova
nova/virt/xenapi/volume_utils.py
5
14066
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2013 OpenStack Foundation # # 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...
apache-2.0
bytedance/fedlearner
web_console_v2/api/test/fedlearner_webconsole/sparkapp/schema_test.py
1
5523
# Copyright 2021 The FedLearner 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
pszemus/grpc
src/python/grpcio/grpc/_server.py
1
36603
# Copyright 2016 gRPC 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
jiangming1399/xbmc-addons-chinese
plugin.video.bilibili/resources/lib/niconvert.py
7
17804
#!/usr/bin/python # -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Name: niconvert # Desc: 弹幕字幕下载和转换工具 # Usage: ./niconvert -h # ---------------------------------------------------------------------------- import re import json import logging import ...
gpl-2.0
pamfilos/data.cern.ch
tests/integration/test_update_deposit.py
1
14975
# -*- coding: utf-8 -*- # # This file is part of CERN Analysis Preservation Framework. # Copyright (C) 2017 CERN. # # CERN Analysis Preservation Framework is free software; you can redistribute # it and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either...
gpl-2.0
JaneliaSciComp/osgpyplusplus
src/modules/osgFX/generated_code/named_tuple.py
83
1563
# This file has been generated by Py++. # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) class named_tuple(tuple): """Creates tuple, which allows access to stored values b...
bsd-3-clause
xlk521/cloudguantou
django/views/generic/edit.py
159
7457
from django.forms import models as model_forms from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponseRedirect from django.views.generic.base import TemplateResponseMixin, View from django.views.generic.detail import (SingleObjectMixin, SingleObjectTemplateRe...
bsd-3-clause
ArthurGarnier/SickRage
lib/twilio/jwt/__init__.py
23
2517
""" JSON Web Token implementation Minimum implementation based on this spec: http://self-issued.info/docs/draft-jones-json-web-token-01.html """ import base64 import hashlib import hmac from six import text_type, b # default text to binary representation conversion def binary(txt): return txt.encode('utf-8') tr...
gpl-3.0
decarlof/astra-toolbox
python/astra/matrix.py
3
2472
#----------------------------------------------------------------------- #Copyright 2013 Centrum Wiskunde & Informatica, Amsterdam # #Author: Daniel M. Pelt #Contact: D.M.Pelt@cwi.nl #Website: http://dmpelt.github.io/pyastratoolbox/ # # #This file is part of the Python interface to the #All Scale Tomographic Reconstruc...
gpl-3.0
lenstr/rethinkdb
external/v8_3.30.33.16/build/gyp/test/ios/gyptest-per-config-settings.py
193
5219
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that device and simulator bundles are built correctly. """ import plistlib import TestGyp import os import struct import subpr...
agpl-3.0
ampax/edx-platform-backup
lms/djangoapps/instructor_task/views.py
69
10964
import json import logging from django.http import HttpResponse from django.utils.translation import ugettext as _ from celery.states import FAILURE, REVOKED, READY_STATES from instructor_task.api_helper import (get_status_from_instructor_task, get_updated_instructor_task) fr...
agpl-3.0
Caramel/django-storages
storages/tests/hashpath.py
34
1085
import os import shutil from django.test import TestCase from django.core.files.base import ContentFile from django.conf import settings from storages.backends.hashpath import HashPathStorage TEST_PATH_PREFIX = 'django-storages-test' class HashPathStorageTest(TestCase): def setUp(self): self.test_path...
bsd-3-clause
sinkuri256/python-for-android
python-modules/twisted/twisted/test/test_persisted.py
60
8648
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # System Imports import sys from twisted.trial import unittest try: import cPickle as pickle except ImportError: import pickle try: import cStringIO as StringIO except ImportError: import StringIO # Twisted Imports ...
apache-2.0
billyhunt/osf.io
scripts/embargo_registrations.py
4
4392
"""Run nightly, this script will activate any pending embargoes that have elapsed the pending approval time and make public and registrations whose embargo end dates have been passed. """ import datetime import logging import sys from modularodm import Q from framework.transactions.context import TokuTransaction fro...
apache-2.0
vponomaryov/manila
manila/tests/test_service.py
3
7809
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2014 NetApp, Inc. # Copyright 2014 Mirantis, Inc. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this fi...
apache-2.0
mcquay239/cg-lectures
mesh.py
1
4847
#!/usr/bin/env python import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from math import sqrt, fabs from pyhull.convex_hull import ConvexHull class Pole: __slots__ = ("r", "c") def __init__(self, r, c): self.r = r self.c = c class Tria...
mit
drexly/openhgsenti
lib/django/utils/html_parser.py
348
5155
import re import sys from django.utils import six from django.utils.six.moves import html_parser as _html_parser current_version = sys.version_info use_workaround = current_version < (2, 7, 3) try: HTMLParseError = _html_parser.HTMLParseError except AttributeError: # create a dummy class for Python 3.5+ whe...
apache-2.0
TheTimmy/spack
var/spack/repos/builtin/packages/npth/package.py
3
1578
############################################################################## # 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
isrohutamahopetechnik/MissionPlanner
ExtLibs/Mavlink/mavgen_python.py
33
16566
#!/usr/bin/env python ''' parse a MAVLink protocol XML file and generate a python implementation Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' import sys, textwrap, os import mavparse, mavtemplate t = mavtemplate.MAVTemplate() def generate_preamble(outf, msgs, args, xml):...
gpl-3.0
TOMB5/TOMB5
scripts/injectr.py
2
28271
#!/usr/bin/env python # _ _ _ _ # ______| (_)_ __ ___ ___ _ __ ___(_) ___ _ __( )__ # |_ / _` | | '_ ` _ \ / _ \ '_ \/ __| |/ _ \| '_ \/ __| # / / (_| | | | | | | | __/ | | \__ \ | (_) | | | \__ \ # /___\__,_|_|_| |_| |_|\___|_| |...
mit
n4nicolascage/Pokemon-Go-Ubuntu-Bot
tests/update_live_stats_test.py
11
8691
import unittest from sys import platform as _platform from datetime import datetime, timedelta from mock import call, patch, MagicMock from pokemongo_bot.cell_workers.update_live_stats import UpdateLiveStats from tests import FakeBot class UpdateLiveStatsTestCase(unittest.TestCase): config = { 'min_interv...
mit
civisanalytics/ansible
lib/ansible/modules/network/iosxr/iosxr_command.py
7
7192
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
Bitergia/allura
Allura/allura/tests/functional/test_root.py
2
6298
# -*- coding: utf-8 -*- """ Functional test suite for the root controller. This is an example of how functional tests can be written for controllers. As opposed to a unit-test, which test a small unit of functionality, functional tests exercise the whole application and its WSGI stack. Please read http://pythonpaste...
apache-2.0
garyfeng/pybrain
pybrain/tests/unittests/structure/networks/custom/test_capturegame_network.py
25
1368
""" Build a CaptureGameNetwork with LSTM cells >>> from pybrain.structure.networks.custom import CaptureGameNetwork >>> from pybrain import MDLSTMLayer >>> size = 2 >>> n = CaptureGameNetwork(size = size, componentclass = MDLSTMLayer, hsize = 1, peepholes = False) Check it's string representation >...
bsd-3-clause
SCSSG/Odoo-SCS
openerp/report/printscreen/__init__.py
381
1203
# -*- 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...
agpl-3.0
lmtierney/selenium
py/test/selenium/webdriver/firefox/conftest.py
39
1072
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
amardeep434/nkernel
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
willingc/pip
pip/_vendor/html5lib/filters/inject_meta_charset.py
1730
2746
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def __init__(self, source, encoding): _base.Filter.__init__(self, source) self.encoding = encoding def __iter__(self): state = "pre_head" meta_found = (self.enco...
mit
ahhda/sympy
sympy/matrices/immutable.py
60
4889
from __future__ import print_function, division from sympy.core import Basic, Integer, Tuple, Dict, S, sympify from sympy.core.sympify import converter as sympify_converter from sympy.matrices.matrices import MatrixBase from sympy.matrices.dense import DenseMatrix from sympy.matrices.sparse import SparseMatrix, Mutab...
bsd-3-clause
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.6/Lib/plat-netbsd1/IN.py
181
1167
# Generated by h2py from /usr/include/netinet/in.h IPPROTO_IP = 0 IPPROTO_ICMP = 1 IPPROTO_IGMP = 2 IPPROTO_GGP = 3 IPPROTO_IPIP = 4 IPPROTO_TCP = 6 IPPROTO_EGP = 8 IPPROTO_PUP = 12 IPPROTO_UDP = 17 IPPROTO_IDP = 22 IPPROTO_TP = 29 IPPROTO_EON = 80 IPPROTO_ENCAP = 98 IPPROTO_RAW = 255 IPPROTO_MAX = 256 IPPORT_RESERVED ...
mit
HellerCommaA/flask-angular
lib/python2.7/site-packages/sqlalchemy/util/topological.py
18
2656
# util/topological.py # Copyright (C) 2005-2013 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 """Topological sorting algorithms.""" from ..exc import CircularDependencyError f...
mit
sbrookfield/soundblizzard
Test/sphinx/sphinxkeys/sphinxkeys.py
2
12891
#!/usr/bin/python """ Copyright 2011 Eric Worden 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 i...
gpl-3.0
ajylee/gpaw-rtxs
doc/exercises/band_structure/Si_guc.py
2
1475
from gpaw import GPAW from ase.structure import bulk from ase.dft.kpoints import ibz_points, get_bandpath import numpy as np si = bulk('Si', 'diamond', a=5.459) if 1: k = 6 calc = GPAW(kpts=(k, k, k), xc='PBE') si.set_calculator(calc) e = si.get_potential_energy() efermi = calc.get...
gpl-3.0
nazeehshoura/crawler
env/lib/python2.7/site-packages/psycopg2/extensions.py
7
6147
"""psycopg extensions to the DBAPI-2.0 This module holds all the extensions to the DBAPI-2.0 provided by psycopg. - `connection` -- the new-type inheritable connection class - `cursor` -- the new-type inheritable cursor class - `lobject` -- the new-type inheritable large object class - `adapt()` -- exposes the PEP-24...
mit
n1kolaa/android_kernel_samsung_s3ve3g
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
campbe13/openhatch
vendor/packages/Django/tests/urls.py
91
1189
from django.conf.urls import patterns, include urlpatterns = patterns('', # test_client modeltest urls (r'^test_client/', include('modeltests.test_client.urls')), (r'^test_client_regress/', include('regressiontests.test_client_regress.urls')), # File upload test views (r'^file_uploads/', include('...
agpl-3.0
grevutiu-gabriel/freshplayerplugin
3rdparty/angle/src/tests/deqp_tests/generate_deqp_tests.py
24
1253
import os import re import sys def ReadFileAsLines(filename): """Reads a file, removing blank lines and lines that start with #""" file = open(filename, "r") raw_lines = file.readlines() file.close() lines = [] for line in raw_lines: line = line.strip() if len(line) > 0 and not ...
mit
srikantbmandal/ansible
lib/ansible/plugins/cache/redis.py
9
3532
# (c) 2014, Brian Coca, Josh Drake, et al # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
hedaoyuan/Paddle
doc/getstarted/concepts/src/train.py
2
1485
import paddle.v2 as paddle import numpy as np # init paddle paddle.init(use_gpu=False) # network config x = paddle.layer.data(name='x', type=paddle.data_type.dense_vector(2)) y_predict = paddle.layer.fc(input=x, size=1, act=paddle.activation.Linear()) y = paddle.layer.data(name='y', type=paddle.data_type.dense_vector...
apache-2.0
Workday/OpenFrame
tools/json_schema_compiler/h_generator.py
6
15219
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from code import Code from model import PropertyType import cpp_util import schema_util class HGenerator(object): def __init__(self, type_g...
bsd-3-clause
vslutov/LLB3D
llb3d/context.py
1
1923
# -*- coding: utf-8 -*- """Context for llb3d compiler. Global and local Blitz objects. """ import threading class Context: """Context for global and local objects.""" def __init__(self): """See help(type(obj)).""" self.functions = {} self.globals = {} _CURRENT_CONTEXT = threading....
gpl-3.0
elderxavier/sphinx
src/reserved.py
16
2365
# autocheck that reserved keywords match across lexer/parser/sources/docs import re def die(m): print m exit(1) def load(n): f = open(n) v = f.read() f.close() return v def diff(a, b): b = set(b) return [aa for aa in a if aa not in b] # load special tokens from lexer res = [] f = open('sphinxql.l') for lin...
gpl-2.0
CMSS-BCRDB/RDS
trove/network/base.py
12
1681
# Copyright 2014 Hewlett-Packard Development Company, L.P. # 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...
apache-2.0
naslanidis/ansible
lib/ansible/modules/database/vertica/vertica_facts.py
20
9400
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
gpl-3.0
Gybes/pyNES
pynes/sprite.py
28
3724
# -*- coding: utf-8 -*- from collections import OrderedDict palette = [ 0x788084, 0x0000fc, 0x0000c4, 0x4028c4, 0x94008c, 0xac0028, 0xac1000, 0x8c1800, 0x503000, 0x007800, 0x006800, 0x005800, 0x004058, 0x000000, 0x000000, 0x000008, 0xbcc0c4, 0x0078fc, 0x0088fc, 0x6848fc, 0xdc00d4, 0xe40060, 0...
bsd-3-clause
fogbow/fogbow-dashboard
horizon/decorators.py
10
3392
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 CRS4 # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use th...
apache-2.0
vijaylbais/boto
boto/sts/credentials.py
153
8210
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Eucalyptus Systems, Inc. # # 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 # withou...
mit
edxnercel/edx-platform
common/lib/xmodule/xmodule/modulestore/modulestore_settings.py
197
5460
""" This file contains helper functions for configuring module_store_setting settings and support for backward compatibility with older formats. """ import warnings import copy def convert_module_store_setting_if_needed(module_store_setting): """ Converts old-style module_store_setting configuration settings...
agpl-3.0
avedaee/DIRAC
Core/DISET/ThreadConfig.py
11
1439
import threading import functools from DIRAC.Core.Utilities.DIRACSingleton import DIRACSingleton class ThreadConfig( threading.local ): __metaclass__ = DIRACSingleton def __init__( self ): self.reset() def reset( self ): self.__DN = False self.__group = False self.__deco = False self.__set...
gpl-3.0
lechat/CouchPotato
app/lib/provider/movie/sources/imdbWrapper.py
10
1997
from app.config.cplog import CPLog from app.lib.provider.movie.base import movieBase from imdb import IMDb log = CPLog(__name__) class imdbWrapper(movieBase): """Api for theMovieDb""" def __init__(self, config, http = False): log.info('Using IMDB provider.') self.config = config if n...
gpl-3.0
waseem18/oh-mainline
vendor/packages/kombu/kombu/tests/test_compat.py
30
11870
from __future__ import absolute_import from kombu import Connection, Exchange, Queue from kombu import compat from .case import Case, Mock, patch from .mocks import Transport, Channel class test_misc(Case): def test_iterconsume(self): class MyConnection(object): drained = 0 de...
agpl-3.0
BlindHunter/django
tests/template_tests/syntax_tests/test_width_ratio.py
342
6095
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils import six from ..utils import setup class WidthRatioTagTests(SimpleTestCase): libraries = {'custom': 'template_tests.templatetags.custom'} @setup({'widthratio01': '{% widthratio a b 0 %}'}) def test...
bsd-3-clause
lz1988/django-web2015
django/contrib/humanize/tests.py
100
9960
from __future__ import unicode_literals import datetime try: import pytz except ImportError: pytz = None from django.conf import settings from django.contrib.humanize.templatetags import humanize from django.template import Template, Context, defaultfilters from django.test import TestCase from django.test.ut...
bsd-2-clause
opencolorado/OpenColorado-Tools-and-Utilities
Scripts/Harvest/Drcog/bs4/builder/_html5lib.py
119
7746
__all__ = [ 'HTML5TreeBuilder', ] import warnings from bs4.builder import ( PERMISSIVE, HTML, HTML_5, HTMLTreeBuilder, ) from bs4.element import NamespacedAttribute import html5lib from html5lib.constants import namespaces from bs4.element import ( Comment, Doctype, NavigableStr...
apache-2.0
toshywoshy/ansible
test/units/modules/network/check_point/test_cp_mgmt_security_zone_facts.py
19
2864
# Ansible module to manage CheckPoint Firewall (c) 2019 # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dist...
gpl-3.0
ChuckM/micropython
tests/extmod/uctypes_le.py
59
1756
import uctypes desc = { "s0": uctypes.UINT16 | 0, "sub": (0, { "b0": uctypes.UINT8 | 0, "b1": uctypes.UINT8 | 1, }), "arr": (uctypes.ARRAY | 0, uctypes.UINT8 | 2), "arr2": (uctypes.ARRAY | 0, 2, {"b": uctypes.UINT8 | 0}), "bitf0": uctypes.BFUINT16 | 0 | 0 << uctypes.BF_POS | 8 <...
mit
Keleir/django-xadmin
xadmin/views/__init__.py
34
1722
from base import BaseAdminPlugin, BaseAdminView, CommAdminView, ModelAdminView, filter_hook, csrf_protect_m, BaseAdminObject from list import ListAdminView from edit import CreateAdminView, UpdateAdminView, ModelFormAdminView from delete import DeleteAdminView from detail import DetailAdminView from form import FormA...
bsd-3-clause
mach6/selenium
py/docs/source/conf.py
1
9331
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
Svolcano/python_exercise
play/tmp.1.py
1
2896
from tkinter import * import tkinter.filedialog import tkinter.messagebox import os import ctypes import threading import time filename = 'aaa' # notes = [0,523,587,659,698,784,880,988] q = 1.06 # 每阶音的倍数 q2 = q * q dolist = {'C': 523, 'D': 587, 'E': 659, 'F': 698, 'G': 784, 'A': 880, 'B': 988} pitchs = {'l': 0.5, 'm'...
mit
Edeleon4/PoolShark
Python279/Tools/pynche/ListViewer.py
101
6648
"""ListViewer class. This class implements an input/output view on the color model. It lists every unique color (e.g. unique r/g/b value) found in the color database. Each color is shown by small swatch and primary color name. Some colors have aliases -- more than one name for the same r/g/b value. These aliases a...
mit
ShinyROM/android_external_chromium_org
tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
23
4759
# Copyright (c) 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. import logging import os import sys from telemetry.core.backends.chrome import android_browser_finder from telemetry.core.platform import profiler # En...
bsd-3-clause
bitmovin/bitmovin-python
bitmovin/resources/response_error_data.py
1
2365
from typing import List from bitmovin.errors import InvalidTypeError from .link import Link from .response_data import ResponseData from .response_error_data_detail import ResponseErrorDataDetail class ResponseErrorData(ResponseData): def __init__(self, code, message, developer_message, links, details): ...
unlicense
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/dataframe/__init__.py
86
2999
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
gpl-3.0
psrthegreat/heroku-buildpack-python-sklearn
vendor/pip-1.3.1/pip/log.py
143
6371
"""Logging """ import sys import logging from pip import backwardcompat class Logger(object): """ Logging object for use in command-line script. Allows ranges of levels, to avoid some redundancy of displayed information. """ VERBOSE_DEBUG = logging.DEBUG - 1 DEBUG = logging.DEBUG INFO =...
mit
guewen/OpenUpgrade
addons/l10n_syscohada/__openerp__.py
430
1940
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2011 BAAMTU SARL (<http://www.baamtu.sn>). # contact: leadsn@baamtu.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affer...
agpl-3.0
mmnelemane/nova
nova/virt/xenapi/image/utils.py
62
3274
# Copyright 2013 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 requ...
apache-2.0
Fireblend/scikit-learn
sklearn/datasets/mldata.py
309
7838
"""Automatically download MLdata datasets.""" # Copyright (c) 2011 Pietro Berkes # License: BSD 3 clause import os from os.path import join, exists import re import numbers try: # Python 2 from urllib2 import HTTPError from urllib2 import quote from urllib2 import urlopen except ImportError: # Pyt...
bsd-3-clause
ygol/dotfiles
bin/.venv-ansible-venv/lib/python2.6/site-packages/ansible/modules/extras/packaging/os/swdepot.py
57
6126
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2013, Raul Melo # Written by Raul Melo <raulmelo@gmail.com> # Based on yum module written by Seth Vidal <skvidal at fedoraproject.org> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
mit
renesugar/arrow
python/pyarrow/tests/test_memory.py
5
2783
# 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
damellis/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/euckrprober.py
2931
1675
######################## 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...
lgpl-2.1
nhicher/ansible
lib/ansible/modules/cloud/vmware/vmware_vmotion.py
27
11943
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Bede Carroll <bc+github () bedecarroll.com> # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2018, Ansible Project # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __futur...
gpl-3.0
v1bri/gnuradio
gr-filter/python/filter/design/filter_design.py
38
99064
# Copyright 2012 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) # any later version. # # G...
gpl-3.0
bobisme/odoo
addons/product_extended/wizard/__init__.py
374
1078
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
rahul67/hue
apps/oozie/src/oozie/migrations/0005_auto__add_shell.py
40
20977
# encoding: 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 'Shell' db.create_table('oozie_shell', ( ('files', self.gf('django.db.models.fields.Cha...
apache-2.0
minhphung171093/OpenERP_V7
openerp/addons/mail/mail_message_subtype.py
60
2869
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
wevote/WeVoteServer
scheduled_tasks/models.py
1
3706
# scheduled_tasks/models.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from django.db import (models) from exception.models import handle_record_found_more_than_one_exception import wevote_functions.admin from wevote_functions.functions import convert_to_int, positive_value_exists logger = wevote_f...
mit
donald-pinckney/EM-Simulator
EM Sim/EM SimContent/Lib/encodings/iso8859_3.py
593
13345
""" Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.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='...
apache-2.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/test_urllib.py
12
41240
"""Regresssion tests for urllib""" import urllib import httplib import unittest import os import sys import mimetools import tempfile import StringIO from test import test_support from base64 import b64encode def hexescape(char): """Escape char as RFC 2396 specifies""" hex_repr = hex(ord(char))[2:].upper() ...
mit