repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
iambibhas/django
django/contrib/gis/db/backends/postgis/adapter.py
143
1558
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from __future__ import unicode_literals from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom): "Initializes on the geometry." # Getting the WKB...
bsd-3-clause
madmax983/h2o-3
py2/testdir_rapids/test_rapids_basic_with_funs_pick5.py
21
11375
import unittest, random, sys, time, re sys.path.extend(['.','..','../..','py']) import h2o2 as h2o import h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i, h2o_cmd from h2o_test import dump_json, verboseprint initList = [ '(+ (* #2 #2) (* #5 #5))', '(* #1 (+ (* #2 #2) (* #5 #5)))', '(= !x...
apache-2.0
twamarc/schemaorg
lib/html5lib/treewalkers/__init__.py
133
2416
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
apache-2.0
acsone/alfodoo
cmis_web_proxy/controllers/cmis.py
1
18684
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import json import logging import urlparse import werkzeug from odoo import _, http from odoo.http import request from odoo.exceptions import AccessError from odoo.addons.web.controllers import main ...
agpl-3.0
degenhard/pyazure
pyazure/tests/test_blob.py
4
1073
from StringIO import StringIO from unittest import TestCase from django.conf import settings from pyazure.storage import BlobStorage from pyazure.tests.utils import clear_storage class SaveTestCase(TestCase): def setUp(self): self.blob = BlobStorage(settings.AZURE_FILES['account_name'], ...
gpl-3.0
largelymfs/w2vtools
build/scipy/scipy/fftpack/basic.py
6
19767
""" Discrete Fourier Transforms - basic.py """ # Created by Pearu Peterson, August,September 2002 from __future__ import division, print_function, absolute_import __all__ = ['fft','ifft','fftn','ifftn','rfft','irfft', 'fft2','ifft2'] from numpy import zeros, swapaxes import numpy from . import _fftpack im...
mit
timduru/platform-external-chromium_org
chrome/test/functional/infobars.py
60
13277
#!/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. import logging import os import re import pyauto_functional # Must be imported before pyauto import pyauto import test_utils class ...
bsd-3-clause
rouault/mapnik
scons/scons-local-2.3.4/SCons/Tool/tar.py
9
2473
"""SCons.Tool.tar Tool-specific initialization for tar. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to...
lgpl-2.1
tsabi/Odoo-tsabi-fixes
addons/crm/crm.py
14
7926
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-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
nthiep/global-ssh-server
lib/python2.7/site-packages/setuptools/depends.py
462
6370
import sys import imp import marshal from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN from distutils.version import StrictVersion from setuptools import compat __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building or inst...
agpl-3.0
mfjb/scikit-learn
sklearn/decomposition/tests/test_nmf.py
130
6059
import numpy as np from scipy import linalg from sklearn.decomposition import nmf from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import raises from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_gr...
bsd-3-clause
weebygames/boto
tests/unit/glacier/test_utils.py
114
6952
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
mit
noba3/KoTos
addons/script.module.requests/lib/requests/packages/chardet/sjisprober.py
1777
3764
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-2.0
andymckay/django
django/contrib/gis/db/backends/postgis/introspection.py
514
4385
from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection from django.contrib.gis.gdal import OGRGeomType class GeoIntrospectionError(Exception): pass class PostGISIntrospection(DatabaseIntrospection): # Reverse dictionary for PostGIS geometry types not populated until # intro...
bsd-3-clause
lablup/backend.ai-manager
src/ai/backend/manager/api/session_template.py
1
14992
import json import logging from typing import ( Any, List, Mapping, TYPE_CHECKING, Tuple, ) import uuid from aiohttp import web import aiohttp_cors import sqlalchemy as sa import trafaret as t import yaml from ai.backend.common import validators as tx from ai.backend.common.logging import BraceSty...
lgpl-3.0
IsCoolEntertainment/debpkg_python-boto
boto/ecs/item.py
10
5152
# Copyright (c) 2010 Chris Moyer http://coredumped.org/ # # 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
zerc/django
tests/m2m_intermediary/models.py
282
1292
""" Many-to-many relationships via an intermediary table For many-to-many relationships that need extra fields on the intermediary table, use an intermediary model. In this example, an ``Article`` can have multiple ``Reporter`` objects, and each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position`` f...
bsd-3-clause
trailofbits/codereason
gtest-1.6.0/test/gtest_xml_test_utils.py
398
8029
#!/usr/bin/env python # # Copyright 2006, 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...
mit
ThinkOpen-Solutions/odoo
addons/account/edi/__init__.py
450
1062
# -*- 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
matthewfranglen/spark
examples/src/main/python/ml/count_vectorizer_example.py
122
1548
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
mit
mustafat/odoo-1
addons/point_of_sale/report/__init__.py
381
1238
# -*- 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
rachidoulasri/django_projectwebpage
v0/urls.py
1
1118
"""v0 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based v...
mit
sundeep-co-in/zanata-python-client
zanataclient/zanatalib/statservice.py
2
2397
# vim:set et sts=4 sw=4: # # Zanata Python Client # # Copyright (c) 2015 Sundeep Anand <suanand@redhat.com> # Copyright (c) 2015 Red Hat, Inc. # # This 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 the Free Software Founda...
lgpl-2.1
lunafeng/django
tests/fixtures/models.py
230
3335
""" Fixtures. Fixtures are a way of loading data into the database in bulk. Fixure data can be stored in any serializable format (including JSON and XML). Fixtures are identified by name, and are stored in either a directory named 'fixtures' in the application directory, or in one of the directories named in the ``FIX...
bsd-3-clause
domain51/d51.django.apps.blogs
d51/django/apps/blogs/models.py
1
1309
from django.db import models from django.contrib.auth.models import User from django.core.urlresolvers import reverse class RichTextField(models.TextField): pass class Post(models.Model): internal_title = models.CharField(max_length=255) display_title = models.CharField(null=True, blank=True, max_length=2...
gpl-3.0
MiLk/ansible
lib/ansible/inventory/helpers.py
116
1131
# (c) 2017, Ansible by RedHat Inc, # # 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. # # Ans...
gpl-3.0
mujiansu/arangodb
3rdParty/V8-4.3.61/tools/android-run.py
95
4155
#!/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...
apache-2.0
fls-bioinformatics-core/RnaChipIntegrator
rnachipintegrator/Features.py
1
19026
#!/bin/env python # # Features.py: classes for handling feature data # Copyright (C) University of Manchester 2011-2019 Peter Briggs, Leo Zeef # & Ian Donaldson # """ Features.py Classes for handling feature data. """ import logging import io from .distances import closestDistanceToRegion from .utils imp...
artistic-2.0
quxiaolong1504/dpark
examples/cos_c.py
16
1057
import logging from context import SparkContext import gc gc.disable() spark = SparkContext() name = 'rating.txt' name = 'rating.txt.medium' name = 'rating.txt.large' def parse(line): try: sid, uid, r, f = line.split('\t') defaults = {'F':4.5, 'P':3.7, 'N':4.0} if r == 'None': ...
bsd-3-clause
Vishluck/sympy
examples/galgebra/simple_check_latex.py
66
1160
#!/usr/bin/env python from __future__ import print_function from sympy.galgebra import xdvi, Get_Program, Print_Function from sympy.galgebra import MV, Format def basic_multivector_operations_3D(): Print_Function() (ex, ey, ez) = MV.setup('e*x|y|z') print('g_{ij} =', MV.metric) A = MV('A', 'mv') ...
bsd-3-clause
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/stat/cmp/cmp_stats.py
1
23212
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
wingtk/gtk-win32
gvsbuild/utils/base_builders.py
2
7056
# Copyright (C) 2016 - Yevgen Muntyan # Copyright (C) 2016 - Ignacio Casal Quinteiro # Copyright (C) 2016 - Arnavion # # 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 t...
gpl-2.0
agonzalezro/flocker
flocker/common/functional/test_ipc.py
15
6789
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Functional tests for IPC. """ from twisted.internet.threads import deferToThread from twisted.python.filepath import FilePath from twisted.trial.unittest import TestCase from .. import ProcessNode from ..test.test_ipc import make_inode_tests from ...te...
apache-2.0
seb-elico/website
website_menu_by_user_status/__openerp__.py
8
1578
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
agpl-3.0
vmax-feihu/hue
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Protocol/test_rfc1751.py
132
2208
# # Test script for Crypto.Util.RFC1751. # # Part of the Python Cryptography Toolkit # # Written by Andrew Kuchling and others # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is ...
apache-2.0
partofthething/home-assistant
homeassistant/components/devolo_home_control/light.py
10
3032
"""Platform for light integration.""" from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, LightEntity, ) from homeassistant.config_entries import ConfigEntry from homeassistant.helpers.typing import HomeAssistantType from .const import DOMAIN from .devolo_multi_level_switch im...
mit
mrwags/python-social-auth
social/tests/backends/test_stocktwits.py
91
1658
import json from social.tests.backends.oauth import OAuth2Test class StocktwitsOAuth2Test(OAuth2Test): backend_path = 'social.backends.stocktwits.StocktwitsOAuth2' user_data_url = 'https://api.stocktwits.com/api/2/account/verify.json' expected_username = 'foobar' access_token_body = json.dumps({ ...
bsd-3-clause
InfectedPacket/resyst
setup.py
1
8840
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import imp import subprocess ## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill! if 'check_output' not in dir(subprocess): def check_output(cmd_args, *args, **kwargs): proc = subprocess.Popen( ...
gpl-2.0
anthraxx/fips
yaml/yaml3/reader.py
272
6854
# This module contains abstractions for the input stream. You don't have to # looks further, there are no pretty code. # # We define two classes here. # # Mark(source, line, column) # It's just a record and its only use is producing nice error messages. # Parser does not use it for any other purposes. # # Reader(so...
mit
gpaw789/wolfbot-lex
WolfBot_History/yahoo_finance/__init__.py
3
10875
import yahoo_finance.yql import yahoo_finance.gp from datetime import datetime, timedelta import pytz __author__ = 'Lukasz Banasiak' __version__ = '1.4.0' __all__ = ['Currency', 'Share'] def edt_to_utc(date, mask='%m/%d/%Y %I:%M%p'): """ Convert EDT (Eastern Daylight Time) to UTC :param date: EDT date ...
gpl-3.0
marcoantoniooliveira/labweb
oscar/lib/python2.7/site-packages/werkzeug/testsuite/urls.py
145
15382
# -*- coding: utf-8 -*- """ werkzeug.testsuite.urls ~~~~~~~~~~~~~~~~~~~~~~~ URL helper tests. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug.datastructures import OrderedMultiD...
bsd-3-clause
compiteing/flask-ponypermission
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py
3132
36011
######################## 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
tjanez/ansible
lib/ansible/modules/cloud/docker/docker_image.py
13
21881
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # # 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 la...
gpl-3.0
maksimbulva/chesshive
Bee/src/externals/googletest/test/gtest_uninitialized_test.py
372
2482
#!/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...
apache-2.0
pbasov/fuel-extension-cpu-pinning
fuel_extension_cpu_pinning/validators.py
1
1623
from fuel_extension_cpu_pinning.models import CpuPinOverride from nailgun.api.v1.validators.base import BasicValidator from nailgun.errors import errors from nailgun.logger import logger class CpuPinningValidator(BasicValidator): schema = { "$schema": "http://json-schema.org/draft-04/schema#", "ti...
apache-2.0
j-faria/OPEN
scons/scons-local-2.3.4/SCons/Tool/sgicc.py
9
1819
"""SCons.Tool.sgicc Tool-specific initialization for MIPSPro cc on SGI. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, fr...
mit
nparley/mylatitude
lib/urllib3/connection.py
24
14485
from __future__ import absolute_import import datetime import logging import os import sys import socket from socket import error as SocketError, timeout as SocketTimeout import warnings from .packages import six from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection from .packages.six.moves.http...
mit
akvo/butler
setup.py
1
2525
# -*- coding: UTF-8 -*- from distutils.command.install import INSTALL_SCHEMES from distutils.core import setup from setuptools import find_packages import os import re import time _version = "0.1.%sdev0" % int(time.time()) _packages = find_packages('butler', exclude=["*.tests", "*.tests.*", "tests.*", "tests"]) # m...
agpl-3.0
ewdurbin/sentry
src/sentry/api/serializers/models/group.py
5
5876
from __future__ import absolute_import, print_function from collections import defaultdict from datetime import timedelta from django.core.urlresolvers import reverse from django.utils import timezone from sentry.api.serializers import Serializer, register, serialize from sentry.app import tsdb from sentry.models imp...
bsd-3-clause
Qalthos/ansible
lib/ansible/modules/cloud/ovirt/ovirt_affinity_group.py
54
11759
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCU...
gpl-3.0
rdo-management/heat
heat/tests/test_scaling_template.py
6
4060
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
vatsalgit/Deep-Learning-
assignment1/data/deep/lib/python3.4/site-packages/pip/_vendor/webencodings/tests.py
340
6562
# coding: utf8 """ webencodings.tests ~~~~~~~~~~~~~~~~~~ A basic test suite for Encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_literals from . import (lookup, LABELS, decode, encode, iter_decode, iter_encode, ...
gpl-3.0
ChrisGoedhart/Uforia
source/django/contrib/gis/sitemaps/views.py
84
4413
from django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import get_current_site from django.core import urlresolvers from django.core.paginator import EmptyPage, PageNotAnInteger from django.contrib.gis.db.models.fields import GeometryField from django.db import...
gpl-2.0
rschnapka/bank-statement-import
account_bank_statement_import_camt/camt.py
3
9810
# -*- coding: utf-8 -*- """Class to parse camt files.""" ############################################################################## # # Copyright (C) 2013-2015 Therp BV <http://therp.nl> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General ...
agpl-3.0
tobiasmcnulty/django-cache-machine
caching/backends/locmem.py
3
1121
from __future__ import unicode_literals import django from django.core.cache.backends import locmem from caching.compat import DEFAULT_TIMEOUT, FOREVER if django.VERSION[:2] >= (1, 6): Infinity = FOREVER else: class _Infinity(object): """Always compares greater than numbers.""" def __radd__...
bsd-3-clause
MechCoder/sympy
sympy/physics/mechanics/kane.py
40
35784
from __future__ import print_function, division __all__ = ['KanesMethod'] from sympy import zeros, Matrix, diff, solve_linear_system_LU, eye from sympy.core.compatibility import range from sympy.utilities import default_sort_key from sympy.physics.vector import (ReferenceFrame, dynamicsymbols, ...
bsd-3-clause
n3wb13/OpenNfrGui-5.0-1
lib/python/Plugins/Extensions/NFR4XBoot/ubi_reader/ui/common.py
5
3812
import os from ubi_io import leb_virtual_file from ubifs import ubifs, walk, output from ubifs.defines import PRINT_UBIFS_KEY_HASH, PRINT_UBIFS_COMPR from ubi.defines import PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORESIZE_FLG output_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'output'...
gpl-2.0
rosenvladimirov/addons
sale_partial_invoicing/tests/test_sale_partial_invoicing.py
1
14964
# -*- coding: utf-8 -*- # ############################################################################## # # Authors: Adrien Peiffer # Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
agpl-3.0
DS-CM/live-slides
src/GetImage.py
1
1282
import http.client, urllib.request, urllib.parse, urllib.error, base64, json from pprint import pprint class GetImage: def __init__(self, key): self.key = key def getImage(self, keywords): search_string = "" for x in keywords: search_string = search_string + " " + x ...
apache-2.0
mzdaniel/oh-mainline
vendor/packages/gdata/tests/gdata_tests/health_test.py
127
7162
#!/usr/bin/python # # Copyright 2009 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 b...
agpl-3.0
baylee/django
tests/admin_inlines/admin.py
15
5462
from django import forms from django.contrib import admin from .models import ( Author, BinaryTree, CapoFamiglia, Chapter, ChildModel1, ChildModel2, Consigliere, EditablePKBook, ExtraTerrestrial, Fashionista, Holder, Holder2, Holder3, Holder4, Inner, Inner2, Inner3, Inner4Stacked, Inner4Tabular, NonAut...
bsd-3-clause
paypal/keystone
keystone/common/sql/migrate_repo/versions/016_normalize_domain_ids.py
1
19579
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/...
apache-2.0
sensysnetworks/uClinux
user/python/Lib/distutils/command/build_py.py
5
15114
"""distutils.command.build_py Implements the Distutils 'build_py' command.""" # created 1999/03/08, Greg Ward __revision__ = "$Id: build_py.py,v 1.33 2000/10/02 02:19:04 gward Exp $" import sys, string, os from types import * from glob import glob from distutils.core import Command from distutils.errors import * ...
gpl-2.0
codevlabs/ssbc
workers/simMetadata.py
26
3963
#!/usr/bin/env python # encoding: utf-8 import socket import math from struct import pack, unpack from socket import inet_ntoa from threading import Timer, Thread from time import sleep, time from hashlib import sha1 from simdht_worker import entropy from bencode import bencode, bdecode BT_PROTOCOL = "BitTorrent pro...
gpl-2.0
EricMuller/mynotes-backend
requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/names/test/test_util.py
13
3915
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Utilities for Twisted.names tests. """ from __future__ import division, absolute_import from random import randrange from zope.interface import implementer from zope.interface.verify import verifyClass from twisted.internet.address import ...
mit
xfournet/intellij-community
python/helpers/typeshed/tests/pytype_test.py
1
7684
#!/usr/bin/env python r"""Test runner for typeshed. Depends on mypy and pytype being installed. If pytype is installed: 1. For every pyi, do nothing if it is in pytype_blacklist.txt. 2. If the blacklist line has a "# parse only" comment run "pytd <foo.pyi>" in a separate process. 3. If the file is n...
apache-2.0
wa1tnr/ainsuSPI
0-Distribution.d/circuitpython-master/tests/pyb/i2c_error.py
30
1128
# test I2C errors, with polling (disabled irqs) and DMA import pyb from pyb import I2C # init accelerometer pyb.Accel() # get I2C bus i2c = I2C(1, I2C.MASTER, dma=True) # test polling mem_read pyb.disable_irq() i2c.mem_read(1, 76, 0x0a) # should succeed pyb.enable_irq() try: pyb.disable_irq() i2c.mem_read(1...
mit
betoesquivel/fil2014
build/django/build/lib.linux-x86_64-2.7/django/contrib/gis/geos/prototypes/geom.py
214
4428
from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_minus_one, check_sized_string, check_string, check_zero) from django.contrib.gis.geos.prototypes.threadsafe import G...
mit
Bysmyyr/chromium-crosswalk
tools/perf/page_sets/memory_infra_top_10_mobile_story.py
14
1201
# 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 logging from page_sets import top_10_mobile from telemetry import story DUMP_WAIT_TIME = 3 class MemoryInfraTop10MobilePage(top_10_mobile.Top10Mo...
bsd-3-clause
stormi/weblate
weblate/trans/tests/test_markup_checks.py
11
1699
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
gpl-3.0
hpc/hypnotoad
hypnotoad/plugins/datamodels/ldap/ldap_plugin.py
1
3400
# # An ldap data model plugin for hypnotoad. # import ldap import logging from hypnotoad.core import plugin LOG = logging.getLogger('root') class ldap_plugin(plugin.data_model_plugin): def setup(self, config, model_version): """Called before the plugin is asked to do anything.""" if config.ge...
bsd-3-clause
hanelsofterp/green-hanel
purchase_landed_cost_assigning_before_receiving/wizard/wizard_import.py
1
1127
__author__ = 'trananhdung' from openerp import models, fields, api class extendPickingImportWizard(models.TransientModel): _inherit = 'picking.import.wizard' pickings = fields.Many2many( comodel_name='stock.picking', relation='distribution_import_picking_rel', column1='wizard_id', ...
gpl-3.0
RR2DO2/breathe
tests/test_utils.py
3
3101
from unittest import TestCase from xml.dom import minidom from breathe.renderer.rst.doxygen.compound import get_param_decl, get_definition_without_template_args from breathe.parser.doxygen.compoundsuper import memberdefType from breathe.directives import PathHandler class TestUtils(TestCase): def test_param_dec...
bsd-3-clause
joergdietrich/astropy
astropy/utils/tests/test_metadata.py
2
5923
import abc from collections import OrderedDict from ..metadata import MetaData, MergeConflictError, merge, enable_merge_strategies from ...utils import metadata from ...tests.helper import pytest from ...io import fits class OrderedDictSubclass(OrderedDict): pass class MetaBaseTest(object): __metaclass__...
bsd-3-clause
RPG-18/yang
3rdparty/gtest/test/gtest_help_test.py
2968
5856
#!/usr/bin/env python # # Copyright 2009, 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...
mit
ncultra/linux-stable
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
rambler-digital-solutions/aioriak
aioriak/datatypes/datatype.py
1
4884
from . import TYPES from aioriak.error import ContextRequired class Datatype: ''' Base class for all convergent datatype wrappers. You will not use this class directly, but it does define some methods are common to all datatype wrappers. ''' #: The string "name" of this datatype. Each datatyp...
mit
crawlers1977/plugin.video.SportsDevil
lib/utils/xbmcUtils.py
8
2569
# -*- coding: latin-1 -*- import xbmcgui, xbmc, xbmcplugin enable_debug = True ####################################### # Xbmc Helpers ####################################### def select(title, menuItems): select = xbmcgui.Dialog().select(title, menuItems) if select == -1: return None else: ...
gpl-2.0
Letractively/kay-framework
kay/tests/auth_test.py
3
4974
import os from werkzeug import ( BaseResponse, Request ) from kay.utils.test import Client from kay.utils import url_for from kay.app import get_application from kay.conf import LazySettings from kay.ext.testutils.gae_test_base import GAETestBase class GoogleBackendTestCase(GAETestBase): KIND_NAME_UNSWAPPED = F...
bsd-3-clause
livioferrante/my-final-project
.mywaflib/waflib/extras/eclipse.py
6
11362
#! /usr/bin/env python # encoding: utf-8 # Eclipse CDT 5.0 generator for Waf # Richard Quirk 2009-1011 (New BSD License) # Thomas Nagy 2011 (ported to Waf 1.6) """ Usage: def options(opt): opt.load('eclipse') $ waf configure eclipse """ import sys, os from waflib import Utils, Logs, Context, Options, Build, TaskGe...
bsd-3-clause
shahmishal/swift
utils/swift_build_support/tests/test_cmake.py
8
20659
# test_cmake.py - Unit tests for swift_build_support.cmake -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for...
apache-2.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-0.96/django/contrib/csrf/middleware.py
33
3607
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ from django.conf import settings from django.http import HttpResponseForbidden import md5 import re import itertools _ERROR_MSG = '<html xmlns="http://www.w3.org/19...
bsd-3-clause
inaz2/deluge-hack
deluge/ui/gtkui/filtertreeview.py
2
14729
# # filtertreeview.py # # Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com> # Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com> # # Deluge is free software. # # You may redistribute it and/or modify it under the terms of the # GNU General Public License, as published by the Free Software # Foundation; eithe...
gpl-3.0
mrbox/django
tests/auth_tests/urls.py
80
4661
from django.conf.urls import url from django.contrib import admin from django.contrib.auth import views from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.urls import urlpatterns as auth_urlpatterns from django.contrib.messages.api...
bsd-3-clause
raghavaggarwal/moose
framework/contrib/nsiqcppstyle/rules/RULE_4_5_A_brace_for_namespace_should_be_located_in_seperate_line.py
43
2374
""" Braces for namespace should be located in the seperate line. == Violation == namespace AA { <== ERROR } == Good == namespace { } """ from nsiqcppstyle_rulehelper import * from nsiqcppstyle_reporter import * from nsiqcppstyle_rulehelper import * from nsiqcppstyle_reporter import * from ...
lgpl-2.1
numenta/htmresearch
projects/kdimgrid/measure_unique_sidelength.py
3
5879
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, 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 progra...
agpl-3.0
gdreich/geonode
geonode/services/views.py
6
51645
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
saurabhbajaj207/CarpeDiem
venv/Lib/site-packages/pip/_vendor/html5lib/_utils.py
329
4096
from __future__ import absolute_import, division, unicode_literals import sys from types import ModuleType from pip._vendor.six import text_type try: import xml.etree.cElementTree as default_etree except ImportError: import xml.etree.ElementTree as default_etree __all__ = ["default_etree", "MethodDispatche...
mit
nschaetti/pyTweetBot
pyTweetBot/tweet/RSSHunter.py
1
2080
#!/usr/bin/env python # -*- coding: utf-8 -*- # import feedparser from .Hunter import Hunter from .Tweet import Tweet import logging from textblob import TextBlob # Find new tweets from RSS streams class RSSHunter(Hunter): """ Find new tweets from RSS streams """ # Constructor def __init__(self,...
gpl-3.0
spektom/incubator-airflow
airflow/sensors/web_hdfs_sensor.py
5
1162
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
gnuradio/pybombs
pybombs/main.py
3
1386
#!/usr/bin/env python # # Copyright 2015-2016 Free Software Foundation, Inc. # # This file is part of PyBOMBS # # PyBOMBS 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
nvoron23/avos
horizon/utils/csvbase.py
41
4807
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
4degrees/mill
source/sawmill/handler/stream.py
2
1260
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. from .base import Handler class Stream(Handler): '''Output log records to stream.''' def __init__(self, stream, *args, **kw): '''Initialise handler with target *stream*. .. note:: ...
apache-2.0
ttiurani/gsutil
gslib/tests/test_ls.py
21
18314
# -*- coding: utf-8 -*- # 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 require...
apache-2.0
sbalde/edxplatform
common/lib/xmodule/xmodule/vertical_block.py
56
5689
""" VerticalBlock - an XBlock which renders its children in a column. """ import logging from copy import copy from lxml import etree from xblock.core import XBlock from xblock.fragment import Fragment from xmodule.mako_module import MakoTemplateBlockBase from xmodule.progress import Progress from xmodule.seq_module im...
agpl-3.0
3dfxsoftware/cbss-addons
hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
44
3003
# -*- 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...
gpl-2.0
Dymaxion00/KittenGroomer
fs/opt/groomer/functions_pier9.py
1
2525
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from helpers import FileBase, KittenGroomerBase, main printers = ['.STL', '.obj'] cnc = ['.nc', '.tap', '.gcode', '.dxf', '.stl', '.obj', '.iges', '.igs', '.vrml', '.vrl', '.thing', '.step', '.stp', '.x3d'] shopbot = ['.ai', '.svg', '.dxf', '.dwg', '.eps...
bsd-3-clause
benoitsteiner/tensorflow-opencl
tensorflow/python/kernel_tests/parsing_ops_test.py
75
56359
# 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
ga7g08/sympy
sympy/series/tests/test_lseries.py
121
1670
from sympy import sin, cos, exp, tanh, E, S, Order from sympy.abc import x, y def test_sin(): e = sin(x).lseries(x) assert next(e) == x assert next(e) == -x**3/6 assert next(e) == x**5/120 def test_cos(): e = cos(x).lseries(x) assert next(e) == 1 assert next(e) == -x**2/2 assert next...
bsd-3-clause
zqfan/leetcode
algorithms/227. Basic Calculator II/solution.py
1
1095
class Solution(object): def calculate(self, s): """ :type s: str :rtype: int """ queue = collections.deque() method = { "+": operator.add, "-": operator.sub, "*": operator.mul, "/": operator.div } pri = {...
gpl-3.0