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
enzovici/PoC-TruthChain
setup.py
2
2007
""" BigchainDB: A Scalable Blockchain Database For full docs visit https://bigchaindb.readthedocs.org """ from setuptools import setup, find_packages tests_require = [ 'pytest', 'coverage', 'pep8', 'pyflakes', 'pylint', 'pytest', 'pytest-cov', 'pytest-xdist', 'pytest-flask', ] de...
apache-2.0
eblossom/gnuradio
gr-digital/python/digital/qa_pfb_clock_sync.py
31
4759
#!/usr/bin/env python # # Copyright 2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your opt...
gpl-3.0
legend18/dragonBonesCpp-2.x
external/emscripten/third_party/ply/test/yacc_badprec2.py
174
1501
# ----------------------------------------------------------------------------- # yacc_badprec2.py # # Bad precedence # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens # Parsin...
mit
edisonlz/fruit
web_project/base/site-packages/django/views/decorators/vary.py
329
1197
from functools import wraps from django.utils.cache import patch_vary_headers from django.utils.decorators import available_attrs def vary_on_headers(*headers): """ A view decorator that adds the specified headers to the Vary header of the response. Usage: @vary_on_headers('Cookie', 'Accept-languag...
apache-2.0
Ballz0fSteel/Umeko
lib/urllib3/util/retry.py
137
14601
from __future__ import absolute_import import time import logging from collections import namedtuple from itertools import takewhile import email import re from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, InvalidHeader, ) from ..pack...
gpl-3.0
rseubert/scikit-learn
sklearn/metrics/tests/test_ranking.py
11
37239
from __future__ import division, print_function import numpy as np from itertools import product import warnings from sklearn import datasets from sklearn import svm from sklearn import ensemble from sklearn.datasets import make_multilabel_classification from sklearn.random_projection import sparse_random_matrix fro...
bsd-3-clause
40223250/lego
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_skipping.py
744
5173
import unittest from .support import LoggingResult class Test_TestSkipping(unittest.TestCase): def test_skipping(self): class Foo(unittest.TestCase): def test_skip_me(self): self.skipTest("skip") events = [] result = LoggingResult(events) test = Foo("t...
agpl-3.0
balbinot/genkai
sandbox/bmf.py
1
4478
#!/usr/bin/env python #-*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division import numpy as np from scipy.misc import factorial import matplotlib.pyplot as p from gencmd.model import SSP from gencmd.util.phot_sys import col_dict, ecoeff import emcee from triangle import corner def...
bsd-3-clause
landryb/QGIS
python/plugins/db_manager/db_plugins/data_model.py
7
11370
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
tejaswanjari/SMR_FS-EXT4
kernel/scripts/gdb/linux/utils.py
630
4267
# # gdb helper commands and functions for Linux kernel debugging # # common utilities # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb class CachedType: def __init__(self, name): s...
gpl-2.0
risent/unidecode
unidecode/x031.py
252
4125
data = ( '[?]', # 0x00 '[?]', # 0x01 '[?]', # 0x02 '[?]', # 0x03 '[?]', # 0x04 'B', # 0x05 'P', # 0x06 'M', # 0x07 'F', # 0x08 'D', # 0x09 'T', # 0x0a 'N', # 0x0b 'L', # 0x0c 'G', # 0x0d 'K', # 0x0e 'H', # 0x0f 'J', # 0x10 'Q', # 0x11 'X', # 0x12 'ZH', # 0x13 ...
gpl-2.0
zero1hac/humanityadm
register/models.py
1
3370
from django.db import models from django.contrib.auth.models import User # Create your models here. def get_file_name(intext,filename): ext = filename.split(".")[-1] class UserDetails(models.Model): full_name = models.CharField(max_length=200,null=True,blank=True) father_name = models.CharField(max_length=...
mit
Chris7/django-djangui
djangui/tests/scripts/heatmap.py
6
1803
#!/usr/bin/env python __author__ = 'chris' import argparse import os import sys import pandas as pd import seaborn as sns import numpy as np parser = argparse.ArgumentParser(description="Create a heatmap from a delimited file.") parser.add_argument('--tsv', help='The delimited file to plot.', type=argparse.FileType('...
gpl-3.0
FreddieShoreditch/precisely
nodejs_server/node_modules/bootstrap/test-infra/s3_cache.py
2166
5734
#!/usr/bin/env python2.7 # pylint: disable=C0301 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, chdir, remove as _delete_file from os.path import dirname, basename, abspath, realpath, expandvars from hashlib import sha256 from subpr...
apache-2.0
ramondelafuente/ansible-modules-extras
cloud/vmware/vmware_vm_shell.py
55
6464
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, 2016 Ritesh Khadgaray <khadgaray () 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...
gpl-3.0
mikeireland/pyhermes
hermes.py
1
83192
"""This module contains the HERMES data reduction class. """ #Example setup analysis for all channels: #import hermes #hermes.go_all('/Users/mireland/data/hermes/140310/data/', '/Users/mireland/tel/hermes/140310/', '/Users/mireland/python/pyhermes/cal/') #Example setup analysis for a full night: blue #hm = he...
mit
rzr/iotivity
tools/scons/URLDownload.py
3
7632
# -*- coding: utf-8 -*- # -- Dual Licence ---------------------------------------------------------- ############################################################################ # GPL License # # ...
apache-2.0
stephanerobert/fake-switches
tests/juniper/juniper_base_protocol_with_commit_delay_test.py
4
2507
# Copyright 2016 Internap. # # 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, so...
apache-2.0
telelaci/distcc
bench/benchmark.py
28
8293
#! /usr/bin/python # benchmark -- automated system for testing distcc correctness # and performance on various source trees. # Copyright (C) 2002, 2003, 2004 by Martin Pool # Copyright 2008 Google Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Pub...
gpl-2.0
nwjs/chromium.src
mojo/public/tools/bindings/pylib/mojom_tests/support/run_bindings_generator.py
2
1544
# Copyright 2014 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.path from subprocess import check_call import sys def RunBindingsGenerator(out_dir, root_dir, mojom_file, extra_flags=None): out_dir = os.path....
bsd-3-clause
rochacbruno/python-pagseguro
examples/flask/flask_seguro/cart.py
1
1715
""" The file is responsable for cart in flask-webpage """ from flask import current_app as app from flask_seguro.products import Products class Cart(object): """ The classe is responsable for cart in webpage """ def __init__(self, cart_dict=None): """ Initializing class """ cart_dict = cart...
mit
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.1/Lib/test/test_reprlib.py
5
11455
""" Test cases for the repr module Nick Mathewson """ import sys import os import shutil import unittest from test.support import run_unittest from reprlib import repr as r # Don't shadow builtin repr from reprlib import Repr def nestedTuple(nesting): t = () for i in range(nesting): t = (t,) ...
mit
kvar/ansible
lib/ansible/modules/cloud/amazon/aws_direct_connect_link_aggregation_group.py
8
18135
#!/usr/bin/python # 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'} DOCUMENTATION = """ --- module...
gpl-3.0
gurneyalex/odoo
addons/l10n_latam_invoice_document/__manifest__.py
4
1918
# Part of Odoo. See LICENSE file for full copyright and licensing details. { "name": "LATAM Document", "version": "1.0", "author": "ADHOC SA", "category": "Localization", "summary": "LATAM Document Types", 'description': """ Functional ---------- In some Latinamerica countries, including Argent...
agpl-3.0
aheadley/Minecraft-Overviewer
setup.py
5
11264
#!/usr/bin/env python import sys import traceback # quick version check if not (sys.version_info[0] == 2 and sys.version_info[1] >= 6): print("Sorry, the Overviewer requires at least Python 2.6 to run") if sys.version_info[0] >= 3: print("and will not run on Python 3.0 or later") sys.exit(1) from...
gpl-3.0
hknyldz/pisitools
pisilinux/pisilinux/actionsapi/perlmodules.py
1
3763
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2010 TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # ...
gpl-3.0
affo/nova
nova/db/sqlalchemy/migrate_repo/versions/254_add_request_id_in_pci_devices.py
27
1694
# Copyright (c) 2014 Cisco Systems, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
apache-2.0
victorbergelin/scikit-learn
sklearn/linear_model/tests/test_randomized_l1.py
214
4690
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.linear_model.randomized_l1 i...
bsd-3-clause
pdellaert/ansible
test/units/modules/network/cnos/test_cnos_vlag.py
23
2287
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.cnos import cnos_vlag from units.modules.utils import set_module_args from .cnos_module import TestCnosModule, load_fixture class TestCnosVlagModule(TestCnosModule)...
gpl-3.0
jshaffstall/PyPhysicsSandbox
py2d/Math/Polygon.py
1
23397
import itertools from py2d.Math.Vector import * from py2d.Math.Operations import * def tip_decorator_pointy(a,b,c,d,is_cw): intersection = intersect_line_line(a,b,c,d) return [intersection] def tip_decorator_flat(a,b,c,d,is_cw): return [] class Polygon(object): """Class for 2D Polygons. A Polgon behaves like ...
mit
iceroad/baresoil-benchmark-image-resizer
lambda/src/PIL/ImageMath.py
16
7449
# # The Python Imaging Library # $Id$ # # a simple math add-on for the Python Imaging Library # # History: # 1999-02-15 fl Original PIL Plus release # 2005-05-05 fl Simplified and cleaned up for PIL 1.1.6 # 2005-09-12 fl Fixed int() and float() for Python 2.4.1 # # Copyright (c) 1999-2005 by Secret Labs AB # Copy...
apache-2.0
saada/ansible
lib/ansible/plugins/lookup/pipe.py
69
1940
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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) any lat...
gpl-3.0
nathanial/lettuce
tests/integration/lib/Django-1.3/django/db/models/base.py
55
40137
import types import sys from itertools import izip import django.db.models.manager # Imported to register signal handler. from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned, FieldError, ValidationError, NON_FIELD_ERRORS from django.core import validators from django.db.models.fields imp...
gpl-3.0
malishevg/edugraph
common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py
34
6187
# This class gives a common interface for logging into the grading controller import json import logging import requests from dogapi import dog_stats_api from requests.exceptions import RequestException, ConnectionError, HTTPError from .combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError from...
agpl-3.0
sch3m4/sysproof
sysproof.py
1
6135
#!/usr/bin/env python # # SysProof - Encrypts all incoming/outgoing emails by using # the parameters stored in the LDAP server. # # Written by Chema Garcia (aka sch3m4) # chema@safetybits.net || http://safetybits.net # @sch3m4 # import sys import ldap import gnupg import syslog import emai...
bsd-3-clause
hazelnusse/sympy-old
sympy/mpmath/tests/test_convert.py
4
6969
import random from sympy.mpmath import * from sympy.mpmath.libmpf import * def test_basic_string(): """ Test basic string conversion """ mp.dps = 15 assert mpf('3') == mpf('3.0') == mpf('0003.') == mpf('0.03e2') == mpf(3.0) assert mpf('30') == mpf('30.0') == mpf('00030.') == mpf(30.0) for ...
bsd-3-clause
WangRobo/rosbridge_suite
rosbridge_server/src/tornado/platform/caresresolver.py
90
3016
from __future__ import absolute_import, division, print_function, with_statement import pycares import socket from tornado import gen from tornado.ioloop import IOLoop from tornado.netutil import Resolver, is_valid_ip class CaresResolver(Resolver): """Name resolver based on the c-ares library. This is a non...
bsd-3-clause
multikatt/CouchPotatoServer
libs/enzyme/mp4.py
97
16165
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2007 Thomas Schueppel <stain@acm.org> # Copyright 2003-2007 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or mod...
gpl-3.0
froyobin/horizon
openstack_dashboard/dashboards/admin/networks/ports/forms.py
10
5468
# Copyright 2012 NEC 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
campbe13/openhatch
vendor/packages/Django/tests/regressiontests/model_fields/imagefield.py
48
15918
from __future__ import absolute_import import os import shutil from django.core.files import File from django.core.files.images import ImageFile from django.test import TestCase from django.utils._os import upath from django.utils.unittest import skipIf from .models import Image if Image: from .models import (P...
agpl-3.0
jbfavre/python-vertica
vertica_python/tests/basic_tests.py
3
12619
import unittest import logging import tempfile from .test_commons import conn_info import vertica_python from vertica_python import errors logger = logging.getLogger('vertica') def init_table(cur): # clean old table cur.execute('DROP TABLE IF EXISTS vertica_python_unit_test;') # create test table ...
mit
Comunitea/alimentacion
full_stock_traceability/product.py
5
4371
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 Pexego (<www.pexego.es>). All Rights Reserved # $Omar Castiñeira Saavedra$ # # This program is free software: you can redistribute it ...
agpl-3.0
Yahvuh/Eliza
Flask/Lib/site-packages/werkzeug/contrib/testtools.py
295
2449
# -*- coding: utf-8 -*- """ werkzeug.contrib.testtools ~~~~~~~~~~~~~~~~~~~~~~~~~~ This module implements extended wrappers for simplified testing. `TestResponse` A response wrapper which adds various cached attributes for simplified assertions on various content types. :copyright:...
gpl-2.0
ESOedX/edx-platform
openedx/core/djangoapps/lang_pref/middleware.py
2
3796
""" Middleware for Language Preferences """ from __future__ import absolute_import from django.conf import settings from django.utils.translation import LANGUAGE_SESSION_KEY from django.utils.translation.trans_real import parse_accept_lang_header from openedx.core.djangoapps.lang_pref import COOKIE_DURATION, LANGUAGE...
agpl-3.0
josherick/bokeh
bokeh/util/version.py
42
1250
""" Provide a version for the Bokeh library. This module uses `versioneer`_ to manage version strings. During development, `versioneer`_ will compute a version string from the current git revision. For packaged releases based off tags, the version string is hard coded in the files packaged for distribution. Attribute...
bsd-3-clause
kemalakyol48/python-for-android
python3-alpha/python3-src/Lib/test/test_locale.py
46
15924
from test.support import run_unittest, verbose from platform import linux_distribution import unittest import locale import sys import codecs enUS_locale = None def get_enUS_locale(): global enUS_locale if sys.platform == 'darwin': import os tlocs = ("en_US.UTF-8", "en_US.ISO8859-1", "en_US") ...
apache-2.0
Arvedui/i3pystatus
i3pystatus/pulseaudio/pulse.py
22
10457
# generation commands # h2xml.py -I $PWD -c -o pa.xml pulse/mainloop-api.h pulse/sample.h pulse/def.h pulse/operation.h pulse/context.h pulse/channelmap.h pulse/volume.h pulse/stream.h pulse/introspect.h pulse/subscribe.h pulse/scache.h pulse/version.h pulse/error.h pulse/xmalloc.h pulse/utf8.h pulse/thread-mainloop.h ...
mit
vrieni/orange
Orange/clustering/kmeans.py
6
21404
""" ******************************* K-means clustering (``kmeans``) ******************************* .. index:: single: clustering, kmeans .. index:: agglomerative clustering .. autoclass:: Orange.clustering.kmeans.Clustering(data=None, centroids=3, maxiters=None, minscorechange=None, stopchanges=0, nstart=1, init...
gpl-3.0
mensler/ansible
test/units/playbook/test_attribute.py
219
1824
# (c) 2015, Marius Gedminas <marius@gedmin.as> # # 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 vers...
gpl-3.0
ToontownUprising/src
toontown/building/DistributedBoardingParty.py
3
27101
from direct.directnotify import DirectNotifyGlobal from direct.distributed import DistributedObject from direct.gui.DirectGui import * from direct.interval.IntervalGlobal import * from pandac.PandaModules import * import BoardingGroupShow from toontown.building import BoardingPartyBase from toontown.chat.ChatGlobals i...
mit
sivel/ansible-modules-extras
windows/win_package.py
14
3964
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Trond Hindenes <trond@hindenes.com>, and others # # 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 versio...
gpl-3.0
jarv/cmdchallenge-site
lambda_src/runcmd/docker/utils/ports.py
43
2847
def add_port_mapping(port_bindings, internal_port, external): if internal_port in port_bindings: port_bindings[internal_port].append(external) else: port_bindings[internal_port] = [external] def add_port(port_bindings, internal_port_range, external_range): if external_range is None: ...
mit
yongni/grpc
tools/run_tests/artifacts/package_targets.py
3
4820
#!/usr/bin/env python # 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 o...
apache-2.0
gunicorn/gunicorn
examples/frameworks/pylonstest/pylonstest/config/middleware.py
29
2436
"""Pylons middleware initialization""" from beaker.middleware import CacheMiddleware, SessionMiddleware from paste.cascade import Cascade from paste.registry import RegistryManager from paste.urlparser import StaticURLParser from paste.deploy.converters import asbool from pylons import config from pylons.middleware imp...
mit
NorfairKing/sus-depot
shared/shared/vim/dotvim/bundle/YouCompleteMe/python/ycm/tests/base_test.py
1
9044
# coding: utf-8 # # Copyright (C) 2013 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opti...
gpl-2.0
Jgarcia-IAS/SITE
openerp/addons/base/workflow/workflow.py
74
9947
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
huang4fstudio/django
tests/http_utils/tests.py
304
2247
from __future__ import unicode_literals import gzip import io from django.http import HttpRequest, HttpResponse, StreamingHttpResponse from django.http.utils import conditional_content_removal from django.test import SimpleTestCase # based on Python 3.3's gzip.compress def gzip_compress(data): buf = io.BytesIO(...
bsd-3-clause
JAOSP/aosp_platform_external_chromium_org
chrome/common/extensions/docs/server2/instance_servlet_test.py
24
1988
#!/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 unittest from empty_dir_file_system import EmptyDirFileSystem from instance_servlet import InstanceServlet from servlet import ...
bsd-3-clause
jnerin/ansible
test/integration/targets/module_precedence/lib_with_extension/ping.py
320
2144
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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...
gpl-3.0
thomas1206/azure-linux-extensions
CustomScript/azure/servicebus/__init__.py
46
33795
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apac...
apache-2.0
gifnksm/rust
src/etc/snapshot.py
37
8006
# Copyright 2011-2015 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or ht...
apache-2.0
mayblue9/scikit-learn
sklearn/externals/funcsigs.py
118
29982
# Copyright 2001-2013 Python Software Foundation; All Rights Reserved """Function signature objects for callables Back port of Python 3.3's function signature tools from the inspect module, modified to be compatible with Python 2.6, 2.7 and 3.2+. """ from __future__ import absolute_import, division, print_function imp...
bsd-3-clause
ujenmr/ansible
lib/ansible/modules/cloud/rackspace/rax_meta.py
102
4782
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
eduNEXT/edx-platform
lms/djangoapps/support/views/enrollments.py
3
11159
""" Support tool for changing course enrollments. """ from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.db import transaction from django.db.models import Q from django.http import HttpResponseBadRequest from django.urls import reverse from django.utils.decorat...
agpl-3.0
sashapekh/MicroSite
micro_blog/templatetags/blog_tags.py
1
1192
from django import template import datetime from micro_blog.models import Post register = template.Library() @register.assignment_tag(takes_context=True) def get_archives(context): archives = [] dates = [] for each_object in Post.objects.filter(status='P').order_by('created_on').values('created_on'): ...
gpl-2.0
mith1979/ansible_automation
applied_python/applied_python/lib64/python2.7/site-packages/Crypto/SelfTest/Cipher/__init__.py
117
2401
# -*- coding: utf-8 -*- # # SelfTest/Cipher/__init__.py: Self-test for cipher modules # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication ...
apache-2.0
psyhofreak/ft-engine
mysql-test/suite/tokudb/t/change_column_char_charbinary.py
56
1349
#!/usr/bin/env python import sys def gen_test(n): print "CREATE TABLE t (a CHAR(%d));" % (n) print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" print "--error ER_UNSUPPORTED_EXTENSION" print "ALTER TABLE t CHANGE COLUMN a a CHAR(%d) BINARY;" % (n) if n+1 < 256: print "--replace_regex /MariaD...
gpl-2.0
ossanna16/django-rest-framework
tests/test_routers.py
1
16158
from __future__ import unicode_literals from collections import namedtuple import pytest from django.conf.urls import url from django.core.exceptions import ImproperlyConfigured from django.db import models from django.test import TestCase, override_settings from rest_framework import permissions, serializers, views...
bsd-2-clause
google/flight-lab
controller/utils/light.py
1
4885
# Copyright 2018 Flight Lab 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
exiahuang/SalesforceXyTools
requests/packages/urllib3/filepost.py
713
2320
from __future__ import absolute_import import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_b...
apache-2.0
eddiel/Play
gluon/contrib/stripe.py
19
9350
import urllib import simplejson from hashlib import sha1 class Stripe: """ Usage: key='<api key>' d = Stripe(key).charge( amount=100, # 1 dollar!!!! currency='usd', card_number='4242424242424242', card_exp_month='5', card_exp_ye...
gpl-2.0
hhursev/recipe-scraper
tests/test_melskitchencafe.py
1
2938
from recipe_scrapers.melskitchencafe import MelsKitchenCafe from tests import ScraperTest class TestMelsKitchenCafeScraper(ScraperTest): scraper_class = MelsKitchenCafe def test_host(self): self.assertEqual("melskitchencafe.com", self.harvester_class.host()) def test_canonical_url(self): ...
mit
caisq/tensorflow
tensorflow/contrib/boosted_trees/python/ops/training_ops.py
78
1160
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
CYBAI/servo
tests/wpt/web-platform-tests/webdriver/tests/element_clear/user_prompts.py
16
4374
# META: timeout=long import pytest from tests.support.asserts import assert_dialog_handled, assert_error, assert_success def element_clear(session, element): return session.transport.send( "POST", "/session/{session_id}/element/{element_id}/clear".format( session_id=session.session_id, ...
mpl-2.0
mattcaldwell/boto
boto/manage/volume.py
70
16323
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.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, modi...
mit
huongttlan/bokeh
examples/plotting/file/texas.py
35
1576
from collections import OrderedDict from bokeh.sampledata import us_counties, unemployment from bokeh.plotting import figure, show, output_file, ColumnDataSource from bokeh.models import HoverTool state = "tx" county_xs=[ us_counties.data[code]['lons'] for code in us_counties.data if us_counties.data[code]['...
bsd-3-clause
gstarnberger/paasta
paasta_tools/marathon_tools.py
1
52444
# Copyright 2015-2016 Yelp Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
jtyr/ansible
test/lib/ansible_test/_internal/target.py
19
22831
"""Test target identification, iteration and inclusion/exclusion.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import collections import os import re import itertools import abc from . import types as t from .encoding import ( to_bytes, ) from .io import ( read_...
gpl-3.0
dcroc16/skunk_works
google_appengine/lib/django-1.5/tests/regressiontests/generic_views/base.py
42
14853
from __future__ import absolute_import import time from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.test import TestCase, RequestFactory from django.utils import unittest from django.views.generic import View, TemplateView, RedirectView from . import views cla...
mit
40223123/finaltestone
static/Brython3.1.3-20150514-095342/Lib/xml/sax/xmlreader.py
824
12612
"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers should be based on this code. """ from . import handler from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException # ===== XMLREADER ===== class XMLReader: """Interface for reading an XML document using callbacks. XMLReade...
agpl-3.0
t-ichii/pyIncomingSlack
pyIncomingSlack/pyIncomingSlack.py
1
2839
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Takeru Ichii' import requests import json import argparse class pyIncomingSlack: def __init__(self, token_url, user_name, icon = ''): self.token_url = token_url self.user_name = user_name self.icon = icon def send(self, ...
mit
olt/mapproxy
mapproxy/test/system/test_renderd_client.py
2
11819
# This file is part of the MapProxy project. # Copyright (C) 2010-2012 Omniscale <http://omniscale.de> # # 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/LI...
apache-2.0
NixaSoftware/CVis
venv/lib/python2.7/site-packages/numpy/linalg/linalg.py
11
77339
"""Lite version of scipy.linalg. Notes ----- This module is a lite version of the linalg.py module in SciPy which contains high-level Python interface to the LAPACK library. The lite version only accesses the following LAPACK functions: dgesv, zgesv, dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr...
apache-2.0
zmike/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_stream.py
496
2872
#!/usr/bin/env python # # Copyright 2011, 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...
mpl-2.0
nmathewson/pynchon-gate
src/maas/maas.py
1
8574
#!/usr/bin/python # Maas is Copyright 2011 by Nick Mathewson. ____/|/| # This is free software; see LICENSE at end of file for more info. O \|\| import os import hashlib import binascii import struct import M2Crypto.RSA as RSA import M2Crypto.BIO as BIO from cStringIO import StringIO # Pa...
mit
MSylvia/pyNES
pynes/tests/rol_test.py
28
3652
# -*- coding: utf-8 -*- ''' ROL, Rotate Left Test This is an Bit Manipulation of the 6502. ''' import unittest from pynes.compiler import lexical, syntax, semantic class RolTest(unittest.TestCase): def test_rol_imm(self): tokens = list(lexical('ROL #$10')) self.assertEquals(2, len(tokens)) ...
bsd-3-clause
swvanderlaan/slideToolkit
utilities/slideCopy.py
1
1929
# imports import os import shutil import argparse import textwrap import datetime NOWTIME = datetime.datetime.now() # print NOWTIME.year, NOWTIME.month, NOWTIME.day, NOWTIME.hour, NOWTIME.minute, NOWTIME.second # evaluate arguments parser = argparse.ArgumentParser( prog='slideCopy', description='This script co...
mit
shepdelacreme/ansible
lib/ansible/modules/network/slxos/slxos_linkagg.py
83
9756
#!/usr/bin/python # # (c) 2018 Extreme Networks 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 late...
gpl-3.0
gijs/inasafe
realtime/make_map.py
2
4917
""" InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - **Functionality related to shake data files.** Contact : ole.moller.nielsen@gmail.com .. note:: 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 ...
gpl-3.0
silenci/neutron
neutron/agent/ovsdb/native/idlutils.py
34
6020
# Copyright (c) 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
allangarcia/sisproc-tg1app
sisproc/controllers/evento.py
1
11578
# -*- coding: utf-8 -*- from turbogears import controllers, expose, paginate from turbogears import redirect, url from turbogears import validate, validators, error_handler from turbogears import widgets from turbogears import flash from turbogears import identity from datetime import datetime from sqlobject.sqlbuil...
gpl-3.0
youfoh/webkit-efl
Tools/Scripts/webkitpy/tool/grammar_unittest.py
19
1964
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
lgpl-2.1
harvard-lil/nuremberg
nuremberg/documents/search_indexes.py
1
3550
from haystack import indexes from nuremberg.documents.models import Document from nuremberg.transcripts.models import TranscriptPage class DocumentIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) material_type = indexes.CharField(default='Document', face...
mit
ttm/oscEmRede
venv/lib/python2.7/site-packages/requests/packages/chardet/mbcssm.py
982
19608
######################## 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-3.0
skim1420/spinnaker
testing/citest/spinnaker_testing/front50.py
7
1935
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
cloudera/recordservice
tests/query_test/test_scanners.py
2
18441
# Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # This test suite validates the scanners by running queries against ALL file formats and # their permutations (e.g. compression codec/compression type). This works by exhaustively # generating the table format test vectors for this specific test suite. This way...
apache-2.0
fqez/JdeRobot
src/tools/colorTuner_py/gui/hsvWidget.py
2
10418
import sys from PyQt5.QtWidgets import QApplication, QWidget, QLabel,QMainWindow from PyQt5.QtGui import QIcon, QPixmap,QPainter, QColor, QPen,QMouseEvent from PyQt5.Qt import Qt from PyQt5 import QtCore from PyQt5.QtCore import QSize, pyqtSignal import numpy as np from math import sin,cos,radians,sqrt,degrees,atan,aco...
gpl-3.0
adieu/django-nonrel
django/contrib/comments/feeds.py
310
1439
from django.conf import settings from django.contrib.syndication.views import Feed from django.contrib.sites.models import Site from django.contrib import comments from django.utils.translation import ugettext as _ class LatestCommentFeed(Feed): """Feed of latest comments on the current site.""" def title(sel...
bsd-3-clause
bop/hybrid
lib/python2.6/site-packages/django/contrib/localflavor/cn/forms.py
110
6512
# -*- coding: utf-8 -*- """ Chinese-specific form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.cn.cn_provinces import CN_PROVINCE_CHOICES from django.forms import ValidationError from django.forms.fields import CharField, RegexField, Select from djang...
gpl-2.0
samskeller/zeroclickinfo-fathead
lib/fathead/UNCLEAN/parse_gwt.py
1
5804
import os import re from BeautifulSoup import BeautifulSoup import sys import string def findindex(haystack,needle): count = 0 for line in haystack: if needle in line: return count count += 1 def getsection(file,start,end): html = '' for i in file[start:end]: html = "%s\r\n%s"%(html,i) ret...
apache-2.0