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
xshotD/pyglet
contrib/scene2d/scene2d/textsprite.py
29
4507
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from ctypes import * from pyglet.gl import * from scene2d.sprite import Sprite from pyglet.font import GlyphString # TODO: inherit from Sprite class TextSprite(object): _layout_width = None # Width to layout text to _tex...
bsd-3-clause
courtf/YouCompleteMe
install.py
6
1389
#!/usr/bin/env python3 from __future__ import print_function from __future__ import division from __future__ import unicode_literals from __future__ import absolute_import import os import subprocess import sys import os.path as p import glob version = sys.version_info[ 0 : 3 ] if version < ( 3, 6, 0 ): sys.exit( ...
gpl-3.0
rbnvrw/semtracking
semtracking/report.py
1
3303
import numpy from pandas import DataFrame import pandas as pd from os import path, makedirs, sep import os import re def prepare_dataframe(data_frame, microns_per_pixel): # drop unneeded columns allowed_cols = ['r', 'dev', 'x', 'y'] cols = [c for c in data_frame.columns if c in allowed_cols] data_fra...
mit
thresholdsoftware/asylum-v2.0
openerp/addons/base/module/module.py
20
35678
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
pquentin/django
django/contrib/gis/gdal/driver.py
526
3260
from ctypes import c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi from django.utils import six from django.utils.encoding import force_bytes, force_text class Driver(GDALBas...
bsd-3-clause
NookieDevs/android_kernel_bn_encore
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
lbk0116/NTDP
openerp/report/custom.py
338
25091
# -*- 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...
apache-2.0
kyokley/MediaViewer
mediaviewer/log.py
2
1037
import logging from logging.handlers import RotatingFileHandler from mysite.settings import loglevel, LOG_FILE_NAME class LogFile(object): logger = None _instance = None def __new__(cls, *args, **kwargs): if not cls._instance: cls._instance = super(LogFile, cls).__new__( ...
mit
shaunstanislaus/PeachPy
peachpy/util.py
6
2482
# This file is part of Peach-Py package and is licensed under the Simplified BSD license. # See license.rst for the full text of the license. import six def int_size(n): assert is_int64(n) if is_int8(n): return 1 elif is_int16(n): return 2 elif is_int32(n): return 4 els...
bsd-2-clause
tschuy/cinch-lang
cinch/parser.py
2
7406
import sys from cinch_types import (Operator, If, While, IntegerLiteral, FunctionCall, FunctionDef, Identifier, IdentifierList, StatementList, ExpressionList, Operators, Return) # Now this is where things get complicated. The parser takes in an array of # tokens and ...
mit
hasinitg/airavata
airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/thrift/transport/TZlibTransport.py
7
8112
# # 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
dol-sen/portage
pym/portage/tests/dep/test_best_match_to_list.py
16
2774
# test_best_match_to_list.py -- Portage Unit Testing Functionality # Copyright 2010-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from itertools import permutations from portage.tests import TestCase from portage.dep import Atom, best_match_to_list class Test_best_match_to...
gpl-2.0
galaxy-team/website
newrelic/api/application.py
1
3247
from __future__ import with_statement import threading import warnings import newrelic.core.config import newrelic.core.agent class Application(object): _lock = threading.Lock() _instances = {} _delayed_callables = {} @staticmethod def _instance(name): if name is None: name...
agpl-3.0
KrzysztofStachanczyk/Sensors-WWW-website
www/env/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/operations.py
28
10604
""" SQL functions reference lists: http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html https://web.archive.org/web/20130407175746/http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html """ import re import sys from django.contrib.gis.db....
gpl-3.0
JetChars/vim
vim/bundle/python-mode/pymode/libs2/rope/base/ast.py
33
2221
import _ast from _ast import * from rope.base import fscommands def parse(source, filename='<string>'): # NOTE: the raw string should be given to `compile` function if isinstance(source, unicode): source = fscommands.unicode_to_file_data(source) if '\r' in source: source = source.replace(...
apache-2.0
lsinfo/odoo
addons/mail/mail_followers.py
168
12482
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-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
yewang15215/django
tests/migrations/test_executor.py
7
32166
from django.apps.registry import apps as global_apps from django.db import connection from django.db.migrations.exceptions import InvalidMigrationPlan from django.db.migrations.executor import MigrationExecutor from django.db.migrations.graph import MigrationGraph from django.db.migrations.recorder import MigrationReco...
bsd-3-clause
anand-c-goog/tensorflow
tensorflow/python/kernel_tests/padding_fifo_queue_test.py
14
55072
# 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
carlb15/Python
binary_search.py
1
2502
"""Binary Search Implementations.""" def binarySearch(alist, item, start, end): """ Recursive Binary Search. O(log(n)) time complexity. :type alist of ordered values. :type item to find :type starting index :type ending index """ if start > end: return False mid = (start + end) // 2 if alist...
mit
madan96/sympy
sympy/core/mod.py
38
4488
from __future__ import print_function, division from sympy.core.numbers import nan from .function import Function class Mod(Function): """Represents a modulo operation on symbolic expressions. Receives two arguments, dividend p and divisor q. The convention used is the same as Python's: the remainder a...
bsd-3-clause
nmayorov/scikit-learn
sklearn/gaussian_process/tests/test_gpc.py
28
6061
"""Testing for Gaussian process classification """ # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Licence: BSD 3 clause import numpy as np from scipy.optimize import approx_fprime from sklearn.gaussian_process import GaussianProcessClassifier from sklearn.gaussian_process.kernels import RBF, Constant...
bsd-3-clause
citrix-openstack-build/nova
nova/tests/virt/libvirt/test_libvirt_vif.py
7
25494
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 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 #...
apache-2.0
vleo/vleo-notebook
test_python/setupcon.py
1
2447
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import codecs import copy import logging #: Is ANSI printing available ansi = not sys.platform.startswith("win") def setup_console(sys_enc='utf-8', use_colorama=True): """ Set sys.defaultencoding to `sys_enc` and update stdout/stderr writers to corresponding enco...
gpl-3.0
juanalfonsopr/odoo
addons/purchase/edi/__init__.py
448
1069
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
astifter/kphotoalbum-astifter-branch
script/focal-length-hist.py
4
1851
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A simple script showing ASCII-art histogram of lens focal lengths """ # Copyright (C) 2009 Jan Kundrát <jkt@flaska.net> # # 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...
gpl-2.0
sio2project/oioioi
oioioi/ipdnsauth/management/commands/ipdnsauth.py
1
4211
import csv from django.contrib.auth.models import User from django.core.management.base import BaseCommand from oioioi.ipdnsauth.models import DnsToUser, IpToUser class Command(BaseCommand): help = ( "Manages ipdnsauth module.\n" "First argument specifies, which bindings should be handled.\n" ...
gpl-3.0
dokipen/whoosh
scripts/release.py
3
2319
import sys, os.path from ConfigParser import ConfigParser from optparse import OptionParser from os import system # Script to build and upload a release of Whoosh to PyPI and build # and upload the def build_docs(): system("python setup.py build_sphinx") def upload_docs(user, server, base, version, build=True, ...
apache-2.0
atosorigin/ansible
test/sanity/code-smell/deprecated-config.py
55
3151
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) 2018, Matt Martz <matt@sivel.net> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
gpl-3.0
skitlab/kernel-source-dm8168-3.2.y
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
KevinMidboe/statusHandler
flask/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py
3121
45978
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
PymientoProject/acien101
SQLPython/SQLClass.py
1
1111
import MySQLdb class SQLClass: def __init__(self, DB_HOST, DB_USER, DB_PASS, DB_NAME): datos = [DB_HOST, DB_USER, DB_PASS, DB_NAME] self.conn = MySQLdb.connect(*datos) # Conectar a la base de datos def getNumTweets(self): cursor = self.conn.cursor() cursor.execute("SELECT *...
mit
HBEE/odoo-addons
inter_company_move/models/inter_company_invoice.py
2
8566
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp.osv import osv from openerp import mo...
agpl-3.0
Kashomon/online-ratings
web/scripts/parsing.py
2
3212
from datetime import datetime from pyparsing import alphanums, Combine, Literal, nums, oneOf, Optional, ParseException, Regex, Suppress, Word """Definition of parsers to pull data out of AGAGD SQL dumps.""" _header = Literal('INSERT INTO `games` (`Game_ID`, `Tournament_Code`, ' '`Game_Date`, `Round`...
mit
cloudera/hue
desktop/core/ext-py/pycryptodomex-3.9.7/src/test/make_tests_addmul128.py
2
2122
"""Make unit test for addmul128() in multiply_32.c""" from common import counter, make_main, split64 def make_test(t, a, b0, b1): if b0 == -1: b0 = 0xFFFFFFFF if b1 == -1: b1 = 0xFFFFFFFF # What we expect the function to compute result = t + a*(b0 + (b1 << 64)) # Turn a[] and t[...
apache-2.0
SonyCSL/KadecotPepperSample
KadecotSamples/lib/requests/api.py
92
5400
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :par...
mit
globocom/database-as-a-service
dbaas/tsuru/views.py
1
28004
# -*- coding: utf-8 -*- import re import logging import requests from slugify import slugify from django.core.exceptions import MultipleObjectsReturned from django.db.models import Q from django.core.exceptions import ObjectDoesNotExist from rest_framework import status from rest_framework.views import APIView from re...
bsd-3-clause
pirati-cz/byro
tests/test_utils.py
1
2470
import unittest import datetime import locale from urllib.request import urlopen from byro.utils import Utils class IntervalCzech(unittest.TestCase): def setUp(self): locale.setlocale(locale.LC_ALL, "cs_CZ.utf8") def tearDown(self): pass def test_interval_leden(self): real = Utils.define_interval('leden'...
gpl-3.0
samabhi/pstHealth
venv/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/schema.py
333
3091
from django.db.backends.postgresql.schema import DatabaseSchemaEditor class PostGISSchemaEditor(DatabaseSchemaEditor): geom_index_type = 'GIST' geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND' rast_index_wrapper = 'ST_ConvexHull(%s)' sql_add_spatial_index = "CREATE INDEX %(index)s ON %(table)s USING %(inde...
mit
makinacorpus/ionyweb
ionyweb/bin/quickstart.py
2
2879
#!/usr/bin/python # -*- coding: utf-8 -*- import sys try: import django assert django.VERSION[0:2] == (1, 4) except: print >> sys.stderr, "Don't forget to install Django-1.4\n pip install Django" sys.exit(4) try: import jinja2 except: print >> sys.stderr, "Don't forget to install python-ji...
bsd-3-clause
roopali8/keystone
keystone/credential/backends/sql.py
8
3858
# Copyright 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-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
joelddiaz/openshift-tools
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_utils/src/class/repoquery.py
16
6334
# pylint: skip-file # flake8: noqa class Repoquery(RepoqueryCLI): ''' Class to wrap the repoquery ''' # pylint: disable=too-many-arguments,too-many-instance-attributes def __init__(self, name, query_type, show_duplicates, match_version, ignore_excluders, verbose): ''' Construc...
apache-2.0
hectord/lettuce
tests/integration/lib/Django-1.2.5/tests/modeltests/many_to_one/tests.py
39
18563
from datetime import datetime from django.test import TestCase from django.core.exceptions import FieldError from models import Article, Reporter class ManyToOneTests(TestCase): def setUp(self): # Create a few Reporters. self.r = Reporter(first_name='John', last_name='Smith', email='john@example.c...
gpl-3.0
victorzhao/miniblink49
v8_4_5/build/landmine_utils.py
45
3005
# Copyright 2014 the V8 project 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 functools import logging import os import shlex import sys def memoize(default=None): """This decorator caches the return value of a parameterl...
gpl-3.0
CoderBotOrg/coderbot
camera.py
1
16190
############################################################################ # CoderBot, a didactical programmable robot. # Copyright (C) 2014, 2015 Roberto Previtera <info@coderbot.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
gpl-2.0
zubintt1/CrazyMonkey
Init_Work.py
1
1424
import os from Models.Users import User import datetime from Models.User_Data import User_Data from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import pymysql class Initialize_Project(): def __init__(self): self.engine = create_engine('mysql+pymysql://cmdd_admin:cmdd@2017@loca...
gpl-3.0
andrewhart098/Lean
Algorithm.Python/UserDefinedUniverseAlgorithm.py
7
2152
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Licen...
apache-2.0
PeterPetrik/QGIS
python/plugins/processing/script/CreateNewScriptAction.py
45
1518
# -*- coding: utf-8 -*- """ *************************************************************************** CreateNewScriptAction.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************...
gpl-2.0
fernandezcuesta/ansible
lib/ansible/modules/cloud/openstack/os_keystone_service.py
29
6477
#!/usr/bin/python # Copyright 2016 Sam Yaple # # 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 version. # # This software is distr...
gpl-3.0
kursitet/edx-platform
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py
23
108271
""" Test split modulestore w/o using any django stuff. """ from mock import patch import datetime from importlib import import_module from path import Path as path import random import re import unittest import uuid import ddt from contracts import contract from nose.plugins.attrib import attr from django.core.cac...
agpl-3.0
indictranstech/trufil-erpnext
erpnext/setup/setup_wizard/sample_data.py
17
3295
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils.make_random import add_random_children import frappe.utils import random def make_sample_data(): """Create a few oppo...
agpl-3.0
vicky2135/lucious
lib/python2.7/site-packages/pip/_vendor/appdirs.py
327
22368
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2005-2010 ActiveState Software Inc. # Copyright (c) 2013 Eddy Petrișor """Utilities for determining application-specific dirs. See <http://github.com/ActiveState/appdirs> for details and usage. """ # Dev Notes: # - MSDN on where to store app data files: # ...
bsd-3-clause
hbredin/pyannote-generators
pyannote/generators/_version.py
2
15789
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
mit
Frenda/shadowsocks
shadowsocks/daemon.py
694
5602
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # 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 requi...
apache-2.0
techdragon/django
django/contrib/auth/management/commands/createsuperuser.py
116
8709
""" Management utility to create superusers. """ from __future__ import unicode_literals import getpass import sys from django.contrib.auth import get_user_model from django.contrib.auth.management import get_default_username from django.contrib.auth.password_validation import validate_password from django.core impor...
bsd-3-clause
40223203/2015cdb_g3_40223203_0622
static/Brython3.1.1-20150328-091302/Lib/zipfile.py
620
66368
""" Read and write ZIP files. XXX references to utf-8 need further investigation. """ import io import os import re import imp import sys import time import stat import shutil import struct import binascii try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib =...
gpl-3.0
haoyutan/MSA-Framework
modules/msa/msa/contrib/uniqauth/serializers.py
1
3589
import json from django.core.exceptions import ObjectDoesNotExist from rest_framework import serializers from .exceptions import * from .static import * from .models import * # Model serializers class JSONField(serializers.Field): def _loads_data(self, data): try: value = json.loads(data) ...
mit
varuntiwari27/rally
rally/plugins/openstack/wrappers/glance.py
2
7311
# Copyright 2016: Mirantis 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 b...
apache-2.0
LilithWittmann/froide
froide/account/south_migrations/0006_auto__add_field_user_organization__add_field_user_organization_url__ad.py
6
5973
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from froide.helper.auth_migration_util import USER_DB_NAME class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'User.organization' db.add_column...
mit
TheMOOCAgency/edx-platform
openedx/core/djangoapps/ccxcon/api.py
39
5208
""" Module containing API functions for the CCXCon """ import logging import urlparse from django.core.validators import URLValidator from django.core.exceptions import ValidationError from django.http import Http404 from oauthlib.oauth2 import BackendApplicationClient from requests_oauthlib import OAuth2Session from...
agpl-3.0
dvitme/vertical-hotel
__unported__/hotel_reservation/__openerp__.py
3
1955
# -*- encoding: 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 t...
agpl-3.0
atsaki/ansible
lib/ansible/plugins/lookup/sequence.py
59
7077
# (c) 2013, Jayson Vantuyl <jayson@aggressive.ly> # # 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 v...
gpl-3.0
gregswift/ansible
lib/ansible/utils/path.py
13
1595
# (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
wyc/django
tests/runtests.py
35
17165
#!/usr/bin/env python import atexit import logging import os import shutil import subprocess import sys import tempfile import warnings from argparse import ArgumentParser import django from django.apps import apps from django.conf import settings from django.db import connection, connections from django.test import T...
bsd-3-clause
rallylee/gem5
src/arch/x86/isa/insts/general_purpose/data_conversion/extract_sign_mask.py
91
2286
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
imankulov/sentry
src/sentry/debug/utils/patch_context.py
16
1070
from __future__ import absolute_import from sentry.utils.imports import import_string class PatchContext(object): def __init__(self, target, callback): target, attr = target.rsplit('.', 1) target = import_string(target) self.func = getattr(target, attr) self.target = target ...
bsd-3-clause
cedk/odoo
openerp-wsgi.py
363
1811
# WSGI Handler sample configuration file. # # Change the appropriate settings below, in order to provide the parameters # that would normally be passed in the command-line. # (at least conf['addons_path']) # # For generic wsgi handlers a global application is defined. # For uwsgi this should work: # $ uwsgi_python --...
agpl-3.0
alfredodeza/boto
boto/ec2/launchspecification.py
170
3829
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software wit...
mit
lz1988/company-site
django/contrib/localflavor/pl/pl_administrativeunits.py
110
12858
# -*- coding: utf-8 -*- """ Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski """ from __future__ import unicode_literals ADMINISTRATIVE_UNIT_CHOICES = ( ('wroclaw', 'Wrocław'), ('jeleniagora', 'Jelenia Góra'), ('legnica', 'Legnica'), ('boleslawiecki', ...
bsd-3-clause
RPI-OPENEDX/edx-platform
cms/djangoapps/contentstore/courseware_index.py
52
27599
""" Code to allow module store to interface with courseware index """ from __future__ import absolute_import from abc import ABCMeta, abstractmethod from datetime import timedelta import logging import re from six import add_metaclass from django.conf import settings from django.utils.translation import ugettext_lazy,...
agpl-3.0
aeppert/py-cifsdk
test/email/t2.py
1
14936
# -*- coding: utf-8 -*- msg = """ Received: from ironport.csirtgadgets.org (192.168.1.26) by mail01.csirtgadgets.org (192.168.1.39) with Microsoft SMTP Server id 14.3.224.2; Fri, 17 Apr 2015 12:04:26 -0600 X-SBRS: 5.3 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CXDwCsSjFVmScBe4FZBA6CN4EZUAEBD7...
lgpl-3.0
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/numpy/core/tests/test_nditer.py
30
105099
from __future__ import division, absolute_import, print_function import sys import warnings import numpy as np from numpy import array, arange, nditer, all from numpy.compat import asbytes, sixu from numpy.core.multiarray_tests import test_nditer_too_large from numpy.testing import ( run_module_suite, assert_, as...
mit
flyingfish007/tempest
tempest/services/compute/json/servers_client.py
2
20636
# Copyright 2012 OpenStack Foundation # Copyright 2013 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 # # ht...
apache-2.0
Knownly/Cactus
cactus/tests/test_cli.py
1
3369
#coding:utf-8 import sys import os import subprocess from cactus.tests import BaseTestCase from cactus.utils.filesystem import fileList class CliTestCase(BaseTestCase): def find_cactus(self): """ Locate a Cactus executable and ensure that it'll run using the right interpreter. This is mean...
bsd-3-clause
mlassnig/pilot
saga/utils/contrib/urlparse25.py
3
12330
__author__ = "Ole Weidner" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" """Parse (absolute and relative) URLs. See RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June 1995. """ __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag", "u...
apache-2.0
ashemedai/ansible
lib/ansible/modules/network/nxos/nxos_ping.py
78
7715
#!/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
yoava333/servo
tests/wpt/css-tests/tools/webdriver/webdriver/driver.py
105
6734
"""Entry point for WebDriver.""" import alert import command import searchcontext import webelement import base64 class WebDriver(searchcontext.SearchContext): """Controls a web browser.""" def __init__(self, host, required, desired, mode='strict'): args = { 'desiredCapabilities': desired } ...
mpl-2.0
puttarajubr/commcare-hq
corehq/apps/app_manager/translations.py
1
30198
from collections import OrderedDict from django.utils.html import escape from lxml import etree import copy import re from openpyxl.shared.exc import InvalidFileException from corehq.apps.app_manager.exceptions import ( FormNotFoundException, ModuleNotFoundException, XFormException) from corehq.apps.app_ma...
bsd-3-clause
craigderington/studentloan5
studentloan5/Lib/site-packages/django/contrib/gis/db/backends/base/features.py
93
3542
from functools import partial from django.contrib.gis.db.models import aggregates class BaseSpatialFeatures(object): gis_enabled = True # Does the database contain a SpatialRefSys model to store SRID information? has_spatialrefsys_table = True # Does the backend support the django.contrib.gis.utils...
bsd-3-clause
dydek/django
tests/get_earliest_or_latest/tests.py
326
7008
from __future__ import unicode_literals from datetime import datetime from django.test import TestCase from .models import Article, IndexErrorArticle, Person class EarliestOrLatestTests(TestCase): """Tests for the earliest() and latest() objects methods""" def tearDown(self): """Makes sure Article...
bsd-3-clause
alexforencich/xfcp
lib/eth/lib/axis/tb/test_arbiter.py
5
4341
#!/usr/bin/env python """ Copyright (c) 2014-2018 Alex Forencich 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,...
mit
aleksandra-tarkowska/django
django/db/backends/postgresql_psycopg2/creation.py
57
3837
from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.utils import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can contain format strings; they'll ...
bsd-3-clause
bodi000/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/LoginTest.py
384
1320
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
defionscode/ansible-modules-core
network/nxos/nxos_vpc.py
25
21022
#!/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
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/errors/types/errors.py
1
61840
# -*- coding: utf-8 -*- # Copyright 2020 Google 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
igorgatis/hadoop-tools
python/hadoop/io/__init__.py
1
1157
#!/usr/bin/env python # ======================================================================== # 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 l...
mit
OpenUpgrade-dev/OpenUpgrade
addons/pos_restaurant/__openerp__.py
311
2001
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
ultilix/catawampus
platform/gfmedia/gfibertv.py
6
7964
#!/usr/bin/python # Copyright 2012 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 appli...
apache-2.0
nick-parker/python3Dplay
Shift Method/Basics.py
4
11455
import scipy as sp import math #Points are 3x1 matrices, vectors are 3x2. Row 2 of vectors are their origin points. Below are the 3 unit vectors. vi = sp.array([[1,0,0],[0,0,0]]) vj = sp.array([[0,1,0],[0,0,0]]) vk = sp.array([[0,0,1],[0,0,0]]) def unit(vector): #Takes a vector and returns its unit vector with or...
gpl-3.0
aabbox/kbengine
kbe/src/lib/python/Lib/test/test_slice.py
80
8259
# tests for slice objects; in particular the indices method. import unittest from test import support from pickle import loads, dumps import itertools import operator import sys def evaluate_slice_index(arg): """ Helper function to convert a slice argument to an integer, and raise TypeError with a suita...
lgpl-3.0
SergiuMir/python-phonenumbers
python/phonenumbers/data/region_979.py
11
1579
"""Auto-generated file, do not edit by hand. 979 metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_979 = PhoneMetadata(id='001', country_code=979, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='\\d{9}', possible_number_pattern='\\d...
apache-2.0
alexryndin/ambari
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py
15
7734
#!/usr/bin/env python """ 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")...
apache-2.0
alfayez/gnuradio
gr-wxgui/src/python/histo_window.py
24
4936
# # Copyright 2009 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. # #...
gpl-3.0
simone-f/compare-to-osm
comparators/highwaysgeometryspatialite.py
1
6644
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright Simone F. <groppo8@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
gpl-3.0
davidvon/pipa-pay-server
site-packages/sqlalchemy/types.py
3
84413
# sqlalchemy/types.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 """defines genericized SQL types, each represented by a subclass of :class:`~sqlal...
apache-2.0
commun108/dca_master
single_file_gen/scripts/read_ipwin_gen_full_spreadsheet_input.py
2
5549
# Import the needed modules import numpy as np def read_ipwin_func(path, folder_out, offset_e1=0): """ Read the data from the syscal output file (*.txt), -> generate a output file which contains: A B M N Resistance [Ohm] Integral Chargeability [mV/V] devR [] Voltage [mV] Current [mA] Window Chargea...
gpl-2.0
Botong/songtaste
lib/werkzeug/debug/console.py
314
5557
# -*- coding: utf-8 -*- """ werkzeug.debug.console ~~~~~~~~~~~~~~~~~~~~~~ Interactive console support. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import sys import code from types import CodeType from werkzeug.utils import escape from werkzeug.loca...
apache-2.0
hilgroth/fiware-IoTAgent-Cplusplus
third_party/gmock-1.7.0/gtest/test/gtest_env_var_test.py
2408
3487
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
agpl-3.0
goFrendiAsgard/kokoropy
kokoropy/packages/beaker/container.py
9
23351
"""Container and Namespace classes""" import beaker.util as util if util.py3k: try: import dbm as anydbm except: import dumbdbm as anydbm else: import anydbm import cPickle import logging import os import time from beaker.exceptions import CreationAbortedError, MissingCacheParameter from b...
mit
dgzurita/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
hybrid-storage-dev/cinder-fs-111t-hybrid-cherry
brick/executor.py
11
1248
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 re...
apache-2.0