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 |
|---|---|---|---|---|---|
ge0rgi/cinder | cinder/tests/unit/volume/drivers/dell_emc/scaleio/test_delete_snapshot.py | 1 | 3977 | # Copyright (c) 2013 - 2015 EMC Corporation.
# 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
#
# Unle... | apache-2.0 |
wildjan/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/jinja2/defaults.py | 659 | 1068 | # -*- coding: utf-8 -*-
"""
jinja2.defaults
~~~~~~~~~~~~~~~
Jinja default filters and tags.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import range_type
from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
# defaults for ... | apache-2.0 |
rafafigueroa/compass-gait | hasimpy.py | 1 | 9216 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: Rafael Figueroa
"""
dp = True
import numpy as np
DEBUG = False
class H:
"""Hybrid Automata Model"""
def __init__(self, Q, Init_X, Init_qID, state_names = None):
self.q = Q #list of q
self.Init_X = Init_X
self.Init_qID = Init_q... | gpl-2.0 |
samdowd/drumm-farm | drumm_env/lib/python2.7/site-packages/django/test/client.py | 132 | 26745 | from __future__ import unicode_literals
import json
import mimetypes
import os
import re
import sys
from copy import copy
from importlib import import_module
from io import BytesIO
from django.apps import apps
from django.conf import settings
from django.core import urlresolvers
from django.core.handlers.base import ... | mit |
allenlavoie/tensorflow | tensorflow/tools/api/generator/create_python_api_test.py | 2 | 2863 | # 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 |
benoitsteiner/tensorflow-xsmm | tensorflow/contrib/data/python/kernel_tests/serialization/ignore_errors_serialization_test.py | 14 | 1862 | # 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 |
gusai-francelabs/datafari | windows/python/Lib/idlelib/PyShell.py | 5 | 58008 | #! /usr/bin/env python
from __future__ import print_function
import os
import os.path
import sys
import string
import getopt
import re
import socket
import time
import threading
import io
import linecache
from code import InteractiveInterpreter
from platform import python_version, system
try:
from Tkinter import... | apache-2.0 |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/matplotlib/offsetbox.py | 10 | 54984 | """
The OffsetBox is a simple container artist. The child artist are meant
to be drawn at a relative position to its parent. The [VH]Packer,
DrawingArea and TextArea are derived from the OffsetBox.
The [VH]Packer automatically adjust the relative postisions of their
children, which should be instances of the OffsetBo... | bsd-3-clause |
mingderwang/angr | angr/surveyors/escaper.py | 9 | 4240 | #!/usr/bin/env python
from ..surveyor import Surveyor
from . import Explorer
import logging
l = logging.getLogger("angr.surveyors.Escaper")
class Escaper(Surveyor):
'''
Escaper implements loop escaping!
normal - any found normal paths from the loop
forced - forced paths from the loop, if a normal wasn't found... | bsd-2-clause |
dmitry-sobolev/ansible | contrib/inventory/vmware_inventory.py | 28 | 26112 | #!/usr/bin/env python
# Requirements
# - pyvmomi >= 6.0.0.2016.4
# TODO:
# * more jq examples
# * optional folder heriarchy
"""
$ jq '._meta.hostvars[].config' data.json | head
{
"alternateguestname": "",
"instanceuuid": "5035a5cd-b8e8-d717-e133-2d383eb0d675",
"memoryhotaddenabled": false,
"guestfullna... | gpl-3.0 |
ramtinms/tokenregex | tokenquery/tests/acceptors/core/vector_opr_test.py | 2 | 1970 | import unittest
from tokenquery.acceptors.vector_opr import change_string_to_vector
from tokenquery.acceptors.vector_opr import vec_cos_sim
from tokenquery.acceptors.vector_opr import vec_cos_dist
from tokenquery.acceptors.vector_opr import vec_man_dist
class TestVectorCoreAcceptorsClass(unittest.TestCase):
def ... | gpl-3.0 |
n0trax/ansible | lib/ansible/modules/windows/win_tempfile.py | 47 | 2164 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017 Dag Wieers <dag@wieers.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
# ... | gpl-3.0 |
drawks/ansible | lib/ansible/plugins/action/dellos6.py | 38 | 4085 | #
# (c) 2016 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# 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 ve... | gpl-3.0 |
Iristyle/ChocolateyPackages | EthanBrown.SublimeText2.WebPackages/tools/PackageCache/Emmet/emmet/file.py | 21 | 3498 | '''
@author Sergey Chikuyonok (serge.che@gmail.com)
@link http://chikuyonok.ru
'''
import sys
import os.path
import re
is_python3 = sys.version_info[0] > 2
try:
if is_python3:
import urllib.request as urllib2
else:
import urllib2
except Exception as e:
pass
def is_url(path):
return re.match(r'^https?://', pa... | mit |
p1c2u/k2 | contact/forms.py | 2 | 11230 | """
A base contact form for allowing users to send email messages through
a web interface, and a subclass demonstrating useful functionality.
"""
from socket import gethostbyaddr
from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.template import loader
from ... | gpl-2.0 |
jennolsen84/PyTables | bench/copy-bench.py | 13 | 1095 | from __future__ import print_function
import tables
import sys
import time
if len(sys.argv) != 3:
print("usage: %s source_file dest_file", sys.argv[0])
filesrc = sys.argv[1]
filedest = sys.argv[2]
filehsrc = tables.open_file(filesrc)
filehdest = tables.open_file(filedest, 'w')
ntables = 0
tsize = 0
t1 = time.time(... | bsd-3-clause |
Versent/ansible | v1/ansible/utils/module_docs.py | 85 | 4484 | #!/usr/bin/env python
# (c) 2012, Jan-Piet Mens <jpmens () 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... | gpl-3.0 |
TOCyna/tabelinha | flask/lib/python2.7/site-packages/werkzeug/contrib/jsrouting.py | 513 | 8564 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.jsrouting
~~~~~~~~~~~~~~~~~~~~~~~~~~
Addon module that allows to create a JavaScript function from a map
that generates rules.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
... | gpl-2.0 |
chrisdroid/nexmon | utilities/aircrack-ng/scripts/airgraph-ng/graphviz/libDumpParse.py | 11 | 6855 | #!/usr/bin/python
#airodump parsing lib
#returns in an array of client and Ap information
#part of the airdrop-ng project
from sys import exit as Exit
class airDumpParse:
def parser(self,file):
"""
One Function to call to parse a file and return the information
"""
self.capr = ... | gpl-3.0 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/xhr_benchmark_handler.py | 76 | 3946 | # Copyright 2014 Google Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the COPYING file or at
# https://developers.google.com/open-source/licenses/bsd
from mod_pywebsocket import util
class XHRBenchmarkHandler(object):
def __init__(self, headers, ... | gpl-3.0 |
OCForks/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/suggestreviewers.py | 125 | 2506 | # 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 ... | bsd-3-clause |
TheTypoMaster/chromium-crosswalk | third_party/android_testrunner/adb_interface.py | 42 | 19302 | #!/usr/bin/python2.4
#
#
# Copyright 2008, The Android Open Source Project
#
# 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 requir... | bsd-3-clause |
CodeJuan/scrapy | tests/test_cmdline/__init__.py | 41 | 1069 | import sys
from subprocess import Popen, PIPE
import unittest
from scrapy.utils.test import get_testenv
class CmdlineTest(unittest.TestCase):
def setUp(self):
self.env = get_testenv()
self.env['SCRAPY_SETTINGS_MODULE'] = 'tests.test_cmdline.settings'
def _execute(self, *new_args, **kwargs):
... | bsd-3-clause |
scribusproject/scribus-tools | md_import.py | 1 | 1176 | run_script = True
import scribus
from tempfile import NamedTemporaryFile
try:
import markdown
except:
scribus.messageBox('python-markdown not installed',
'You need to install python-markdown for this script to work', scribus.ICON_WARNING)
run_script = False
run_script &= bool(scribus.getSelectedObjec... | gpl-3.0 |
tibotic/simple-pokemongo-bot | pokemongo_bot/cell_workers/collect_level_up_reward.py | 16 | 2535 | from pokemongo_bot.base_task import BaseTask
class CollectLevelUpReward(BaseTask):
SUPPORTED_TASK_API_VERSION = 1
current_level = 0
previous_level = 0
def initialize(self):
self.current_level = self._get_current_level()
self.previous_level = 0
def work(self):
self.curren... | mit |
codemac/s3cmd | S3/S3.py | 3 | 64402 | # -*- coding: utf-8 -*-
## Amazon S3 manager
## Author: Michal Ludvig <michal@logix.cz>
## http://www.logix.cz/michal
## License: GPL Version 2
## Copyright: TGRMN Software and contributors
import sys
import os
import time
import errno
import base64
import mimetypes
from xml.sax import saxutils
from logging i... | gpl-2.0 |
mjtamlyn/django | tests/defer_regress/models.py | 21 | 2543 | """
Regression tests for defer() / only() behavior.
"""
from django.db import models
class Item(models.Model):
name = models.CharField(max_length=15)
text = models.TextField(default="xyzzy")
value = models.IntegerField()
other_value = models.IntegerField(default=0)
def __str__(self):
ret... | bsd-3-clause |
rosmo/boto | boto/ec2/__init__.py | 145 | 3100 | # Copyright (c) 2006-2008 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 |
raccoongang/edx-platform | openedx/core/djangoapps/credit/tests/test_signature.py | 36 | 1729 | # coding=utf-8
"""
Tests for digital signatures used to validate messages to/from credit providers.
"""
from nose.plugins.attrib import attr
from django.test import TestCase
from django.test.utils import override_settings
from openedx.core.djangoapps.credit import signature
@attr(shard=2)
@override_settings(CREDI... | agpl-3.0 |
bruderstein/PythonScript | PythonLib/full/distutils/tests/__init__.py | 3 | 1344 | """Test suite for distutils.
This test suite consists of a collection of test modules in the
distutils.tests package. Each test module has a name starting with
'test' and contains a function test_suite(). The function is expected
to return an initialized unittest.TestSuite instance.
Tests for the command classes in... | gpl-2.0 |
pgum/emi1 | lib/python3.5/site-packages/setuptools/package_index.py | 19 | 39541 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
import itertools
from functools import wraps
try:
from urllib.parse import splituser
except ImportError:
from urllib2 import splituser
from setuptools.extern import six
from setupt... | gpl-3.0 |
vprime/puuuu | env/lib/python2.7/site-packages/Crypto/SelfTest/Hash/test_MD2.py | 116 | 2368 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/MD2.py: Self-test for the MD2 hash function
#
# 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 ... | mit |
mancoast/CPythonPyc_test | fail/325_test_code.py | 56 | 3572 | """This module includes tests of the code object representation.
>>> def f(x):
... def g(y):
... return x + y
... return g
...
>>> dump(f.__code__)
name: f
argcount: 1
kwonlyargcount: 0
names: ()
varnames: ('x', 'g')
cellvars: ('x',)
freevars: ()
nlocals: 2
flags: 3
consts: ('None', '<code object g>')... | gpl-3.0 |
jtux270/translate | ovirt/3.6_source/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/fence_kdump_listener/config.py | 8 | 3122 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2014-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
#
# Unl... | gpl-3.0 |
tuxerman/cdn-old | cdn/openstack/common/log.py | 1 | 19790 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... | apache-2.0 |
Code4SA/pmgbilltracker | pmg_scrapers/pmg/scrape_pdf.py | 1 | 2621 | import requests
import json
import os
import tempfile
import re
url = "http://db3sqepoi5n3s.cloudfront.net/files/pmb5_2013.pdf"
url = "http://db3sqepoi5n3s.cloudfront.net/files/130416pmb3-2013.pdf"
url = "http://db3sqepoi5n3s.cloudfront.net/files/131031b18b-2013.pdf"
url = "http://db3sqepoi5n3s.cloudfront.net/files/13... | apache-2.0 |
SM-G920P/Vindicator-S6-Sprint | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
fo2rist/infra-strike | backend/venv/Lib/encodings/raw_unicode_escape.py | 852 | 1208 | """ Python 'raw-unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is ... | lgpl-3.0 |
sgerhart/ansible | test/units/module_utils/urls/test_fetch_url.py | 28 | 7987 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
import socket
from ansible.module_utils.six import StringIO
from ansible.mo... | mit |
johankaito/fufuka | microblog/old-flask/lib/python2.7/site-packages/whoosh/query/nested.py | 30 | 15443 | # Copyright 2012 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | apache-2.0 |
Immortalin/python-for-android | python3-alpha/python3-src/Lib/test/testcodec.py | 203 | 1046 | """ Test Codecs (used by test_charmapcodec)
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def deco... | apache-2.0 |
40223139/39g7test | static/Brython3.1.1-20150328-091302/Lib/threading.py | 730 | 45641 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
import _thread
from time import sleep as _sleep
try:
from time import monotonic as _time
except ImportError:
from time import time as _time
from traceback import format_exc as _format_exc
from _weakrefset import WeakSet
# No... | gpl-3.0 |
xmdy/ibstats | src/stats/models.py | 1 | 1877 | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext as _
import random
def get_random_value(start=100, end=100000):
def get_random():
return random.randint(start, end) * 0.01
return get_random
class Trader(models.Model):
name = model... | gpl-3.0 |
anant-dev/django | tests/select_for_update/tests.py | 123 | 9449 | from __future__ import unicode_literals
import threading
import time
from multiple_database.routers import TestRouter
from django.db import DatabaseError, connection, router, transaction
from django.test import (
TransactionTestCase, override_settings, skipIfDBFeature,
skipUnlessDBFeature,
)
from .models im... | bsd-3-clause |
travisdoor/ArgosRts | engine/thirdparty/yaml-cpp/test/gmock-1.7.0/gtest/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/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 |
sidzan/netforce | netforce_cms/netforce_cms/models/account_invoice.py | 4 | 3563 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | mit |
Ravenm/2143-OOP-NASH | python3env/Lib/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py | 1778 | 5232 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | cc0-1.0 |
dhermes/google-cloud-python | dataproc/google/cloud/dataproc_v1/proto/clusters_pb2_grpc.py | 2 | 7121 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.dataproc_v1.proto import (
clusters_pb2 as google_dot_cloud_dot_dataproc__v1_dot_proto_dot_clusters__pb2,
)
from google.longrunning import (
operations_pb2 as google_dot_longrunning_dot_operations__pb2,
)
clas... | apache-2.0 |
andela-ooladayo/django | django/db/migrations/executor.py | 170 | 12029 | from __future__ import unicode_literals
from django.apps.registry import apps as global_apps
from django.db import migrations
from .loader import MigrationLoader
from .recorder import MigrationRecorder
from .state import ProjectState
class MigrationExecutor(object):
"""
End-to-end migration execution - load... | bsd-3-clause |
0x0mar/androguard | androdd.py | 23 | 9411 | #!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012/2013, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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... | apache-2.0 |
smn/heatherrd | setup.py | 2 | 1220 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('requirements.txt') as req_file:
requirements = req_file.read().split('\n')
with open('... | bsd-3-clause |
jcpeterson/avoidr | player.py | 1 | 3915 | import pygame, os
class Player:
# this takes in screen width/height to calculate the player's starting position (center of screen)
# it also takes in the background color to compute its own color (inverted background color)
def __init__(self, screenWidth, screenHeight):
self.posRangeX = screenWidth
... | gpl-3.0 |
ruuk/script.module.youtube.dl | lib/youtube_dl/extractor/wdr.py | 23 | 12523 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
determine_ext,
ExtractorError,
js_to_json,
strip_jsonp,
try_get,
unified_strdate,
update_url_query,
ur... | gpl-2.0 |
alexallah/django | tests/admin_scripts/tests.py | 18 | 93587 | """
A series of tests to establish that the command-line management tools work as
advertised - especially with regards to the handling of the
DJANGO_SETTINGS_MODULE and default settings.py files.
"""
import codecs
import os
import re
import shutil
import socket
import subprocess
import sys
import tempfile
import unitte... | bsd-3-clause |
jordanemedlock/psychtruths | temboo/core/Library/GitHub/IssuesAPI/Issues/ListIssuesForRepo.py | 4 | 8201 | # -*- coding: utf-8 -*-
###############################################################################
#
# ListIssuesForRepo
# List all issues for a specified repository.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not... | apache-2.0 |
manasi24/tempest | tempest/scenario/test_swift_basic_ops.py | 27 | 3079 | # Copyright 2013 IBM Corp.
# 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 app... | apache-2.0 |
staranjeet/fjord | fjord/redirector/tests/test_dummy.py | 1 | 1413 | from fjord.base.tests import reverse, TestCase
from fjord.redirector import get_redirectors
from fjord.redirector.base import build_redirect_url
from fjord.redirector.providers.dummy import DummyRedirector
from fjord.redirector.tests import RedirectorTestMixin
class DummyRedirectorLoadingTestCase(RedirectorTestMixin,... | bsd-3-clause |
xbmc/atv2 | xbmc/lib/libPython/Python/Tools/scripts/fixcid.py | 4 | 10003 | #! /usr/bin/env python
# Perform massive identifier substitution on C source files.
# This actually tokenizes the files (to some extent) so it can
# avoid making substitutions inside strings or comments.
# Inside strings, substitutions are never made; inside comments,
# it is a user option (off by default).
#
# The su... | gpl-2.0 |
lucidfrontier45/scikit-learn | examples/manifold/plot_manifold_sphere.py | 1 | 4572 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=============================================
Manifold Learning methods on a severed sphere
=============================================
An application of the different :ref:`manifold` techniques
on a spherical data-set. Here one can see the use of
dimensionality reducti... | bsd-3-clause |
shelvenzhou/BTCGPU | test/functional/test_framework/script.py | 2 | 26221 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Functionality to build scripts, as well as SignatureHash().
This file is modified from python-bitcoinl... | mit |
iulian787/spack | var/spack/repos/builtin/packages/linktest/package.py | 2 | 1299 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Linktest(MakefilePackage):
"""Performance tool to generate communication matrix using
parallel ping-pong be... | lgpl-2.1 |
mottosso/mindbender-setup | bin/windows/python36/Lib/ensurepip/__init__.py | 5 | 5824 | import os
import os.path
import pkgutil
import sys
import tempfile
__all__ = ["version", "bootstrap"]
_SETUPTOOLS_VERSION = "28.8.0"
_PIP_VERSION = "9.0.1"
_PROJECTS = [
("setuptools", _SETUPTOOLS_VERSION),
("pip", _PIP_VERSION),
]
def _run_pip(args, additional_paths=None):
# Add our bundled softwar... | mit |
stollcri/UA-3460-635-P2 | code/eigen/debug/gdb/printers.py | 143 | 6360 | # -*- coding: utf-8 -*-
# This file is part of Eigen, a lightweight C++ template library
# for linear algebra.
#
# Copyright (C) 2009 Benjamin Schindler <bschindler@inf.ethz.ch>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
... | mit |
bmanojlovic/ansible | lib/ansible/modules/packaging/os/homebrew_tap.py | 27 | 7348 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Daniel Jaouen <dcj24@cornell.edu>
# (c) 2016, Indrajit Raychaudhuri <irc+code@indrajit.com>
#
# Based on homebrew (Andrew Dunham <andrew@du.nham.ca>)
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the... | gpl-3.0 |
TomAugspurger/pandas | pandas/tests/series/methods/test_rename_axis.py | 4 | 1503 | import pytest
from pandas import Index, MultiIndex, Series
import pandas._testing as tm
class TestSeriesRenameAxis:
def test_rename_axis_mapper(self):
# GH 19978
mi = MultiIndex.from_product([["a", "b", "c"], [1, 2]], names=["ll", "nn"])
ser = Series(list(range(len(mi))), index=mi)
... | bsd-3-clause |
denys-duchier/django | tests/managers_regress/tests.py | 43 | 10902 | from django.db import models
from django.template import Context, Template
from django.test import TestCase, override_settings
from django.test.utils import isolate_apps
from .models import (
AbstractBase1, AbstractBase2, AbstractBase3, Child1, Child2, Child3,
Child4, Child5, Child6, Child7, RelatedModel, Rela... | bsd-3-clause |
gnperumal/exscript | src/Exscript/AccountManager.py | 7 | 6709 | # Copyright (C) 2007-2010 Samuel Abels.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... | gpl-2.0 |
AnishShah/tensorflow | tensorflow/contrib/recurrent/python/ops/functional_rnn.py | 2 | 16152 | # 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 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/matplotlib/tests/test_mlab.py | 5 | 122196 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import tempfile
from numpy.testing import assert_allclose, assert_array_equal
import numpy.ma.testutils as matest
import numpy as np
import datetime as datetime
from nose.tools import (assert_equal... | gpl-3.0 |
nomad-vino/SPSE-1 | Module 5/5.4.py | 1 | 1362 | #!/usr/bin/python
print " __ "
print " |__|____ ___ __ "
print " | \__ \\\\ \/ / "
print " | |/ __ \\\\ / "
print " /\__| (____ /\_/ "
print " \______| \/ "
p... | gpl-3.0 |
mancoast/CPythonPyc_test | fail/313_test_bigmem.py | 1 | 41534 | from test import support
from test.support import bigmemtest, _1G, _2G, _4G, precisionbigmemtest
import unittest
import operator
import sys
import functools
# Bigmem testing houserules:
#
# - Try not to allocate too many large objects. It's okay to rely on
# refcounting semantics, but don't forget that 's = creat... | gpl-3.0 |
1013553207/django | django/core/management/commands/diffsettings.py | 479 | 1565 | from django.core.management.base import BaseCommand
def module_to_dict(module, omittable=lambda k: k.startswith('_')):
"""Converts a module namespace to a Python dictionary."""
return {k: repr(v) for k, v in module.__dict__.items() if not omittable(k)}
class Command(BaseCommand):
help = """Displays diff... | bsd-3-clause |
dwhagar/snowboard | snowboard/connection.py | 1 | 6948 | # This file is part of snowboard.
#
# snowboard 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.
#
# snowboard is distributed in the hop... | gpl-3.0 |
mcanthony/rethinkdb | test/rql_test/connections/http_support/flask/testsuite/signals.py | 554 | 4807 | # -*- coding: utf-8 -*-
"""
flask.testsuite.signals
~~~~~~~~~~~~~~~~~~~~~~~
Signalling.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
class SignalsTestCase(FlaskTestCase):
def ... | agpl-3.0 |
naousse/odoo | addons/calendar/contacts.py | 389 | 1414 | # -*- 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 |
dmccue/ansible | lib/ansible/plugins/callback/context_demo.py | 144 | 1447 | # (C) 2012, 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) any lat... | gpl-3.0 |
Nazninn/edgessh | paramiko/packet.py | 18 | 17271 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 Foundation; either version 2.1 of the License, or (a... | gpl-2.0 |
mancoast/CPythonPyc_test | fail/271_test_dictviews.py | 82 | 6513 | import unittest
from test import test_support
class DictSetTest(unittest.TestCase):
def test_constructors_not_callable(self):
kt = type({}.viewkeys())
self.assertRaises(TypeError, kt, {})
self.assertRaises(TypeError, kt)
it = type({}.viewitems())
self.assertRaises(TypeError... | gpl-3.0 |
StrellaGroup/erpnext | erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.py | 7 | 1036 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data
def execute(filters=None):
columns = ge... | gpl-3.0 |
abdoosh00/edraak | common/lib/capa/capa/tests/test_customrender.py | 57 | 2279 | from lxml import etree
import unittest
import xml.sax.saxutils as saxutils
from . import test_capa_system
from capa import customrender
# just a handy shortcut
lookup_tag = customrender.registry.get_class_for_tag
def extract_context(xml):
"""
Given an xml element corresponding to the output of test_capa_sys... | agpl-3.0 |
microdee/IronHydra | src/IronHydra/Lib/email/generator.py | 106 | 13930 | # Copyright (C) 2001-2010 Python Software Foundation
# Contact: email-sig@python.org
"""Classes to generate plain text from a message object tree."""
__all__ = ['Generator', 'DecodedGenerator']
import re
import sys
import time
import random
import warnings
from cStringIO import StringIO
from email.header import Hea... | mit |
google/material-design-icons | update/venv/lib/python3.9/site-packages/pip/_vendor/requests/cookies.py | 133 | 18430 | # -*- coding: utf-8 -*-
"""
requests.cookies
~~~~~~~~~~~~~~~~
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import copy
import time
import calendar
from ._internal_utils import to_native_string
from .compat import cookiel... | apache-2.0 |
izonder/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/kernel32.py | 102 | 164818 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above... | apache-2.0 |
zarthur/restful-todo | tests/test_integration.py | 1 | 1726 | import re
import threading
import unittest
from selenium import webdriver
from app import create_app, db
from models import Todo
class IntegrationTestCase(unittest.TestCase):
client = None
@classmethod
def setUpClass(cls):
# start Firefox
try:
cls.client = webdriver.Firefox(... | gpl-2.0 |
dimarkov/seaborn | seaborn/tests/test_axisgrid.py | 11 | 42805 | import warnings
import numpy as np
import pandas as pd
from scipy import stats
import matplotlib as mpl
import matplotlib.pyplot as plt
from distutils.version import LooseVersion
import nose.tools as nt
import numpy.testing as npt
from numpy.testing.decorators import skipif
import pandas.util.testing as tm
from .. i... | bsd-3-clause |
bhargav2408/kivy | kivy/input/postproc/calibration.py | 37 | 3137 | '''
Calibration
===========
.. versionadded:: 1.9.0
Recalibrate input device to a specific range / offset.
Let's say you have 3 1080p displays, the 2 firsts are multitouch. By default,
both will have mixed touch, the range will conflict with each others: the 0-1
range will goes to 0-5760 px (remember, 3 * 1920 = 576... | mit |
sebadiaz/rethinkdb | external/re2_20140111/re2/unicode.py | 119 | 7917 | # Copyright 2008 The RE2 Authors. All Rights Reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Parser for Unicode data files (as distributed by unicode.org)."""
import os
import re
import urllib2
# Directory or URL where Unicode tables reside.
_UNICOD... | agpl-3.0 |
Southpaw-TACTIC/Team | src/python/Lib/site-packages/PySide/examples/demos/qtdemo/demotextitem.py | 1 | 2157 | from PySide import QtCore, QtGui
from demoitem import DemoItem
class DemoTextItem(DemoItem):
STATIC_TEXT, DYNAMIC_TEXT = range(2)
def __init__(self, text, font, textColor, textWidth, scene=None,
parent=None, type=STATIC_TEXT, bgColor=QtGui.QColor()):
super(DemoTextItem, self).__init__(sc... | epl-1.0 |
topecz/l10n-spain | l10n_es_aeat_mod303/models/mod303.py | 2 | 9007 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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 Licens... | agpl-3.0 |
RedhawkSDR/integration-gnuhawk | gnuradio/gr-qtgui/apps/usrp_display_qtgui.py | 91 | 12017 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'usrp_display_qtgui.ui'
#
# Created: Thu Jul 16 22:06:24 2009
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(sel... | gpl-3.0 |
chrisgarber/drone_dispatcher | build/lib/drone_dispatcher/drone_dispatcher.py | 2 | 5928 | __version__ = "0.1.0"
import requests
import numpy
import json
import time
earthRadius = 6371 #km
depoLat = -37.8168 #degrees
depoLon = 144.9622 #degrees
droneSpeed = 50 #km/h
# haversine formula
def haversine(theta):
return numpy.sin(theta/2)**2
class location:
def __init__(self, lat, lon)... | gpl-3.0 |
Ichag/odoo | addons/hr_timesheet_invoice/wizard/__init__.py | 433 | 1159 | # -*- 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 |
JCA-Developpement/Odoo | addons/portal_project_issue/__openerp__.py | 375 | 1713 | # -*- 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 |
pramasoul/micropython | examples/network/http_server.py | 15 | 1883 | try:
import usocket as socket
except:
import socket
CONTENT = b"""\
HTTP/1.0 200 OK
Hello #%d from MicroPython!
"""
def main(micropython_optimize=False):
s = socket.socket()
# Binding to all interfaces - server will be accessible to other hosts!
ai = socket.getaddrinfo("0.0.0.0", 8080)
pri... | mit |
teeple/pns_server | work/install/node-v0.10.25/deps/v8/tools/testrunner/objects/testcase.py | 28 | 3512 | # 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
# notice, this list of conditi... | gpl-2.0 |
Jumpscale/core9 | JumpScale9/data/serializers/SerializerYAML.py | 1 | 3063 | import yaml
from collections import OrderedDict
from js9 import j
from .SerializerBase import SerializerBase
testtoml="""
name = 'something'
multiline = '''
these are multiple lines
next line
'''
nr = 87
nr2 = 34.4
"""
# from .PrettyYAMLDumper import PrettyYaml
class SerializerYAML(SerializerBase):
d... | apache-2.0 |
fernandezcuesta/ansible | test/units/module_utils/ec2/test_camel_to_snake.py | 35 | 1301 | # -*- coding: utf-8 -*-
# (c) 2017, Will Thames <will.thames@xvt.com.au>
#
# 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 y... | gpl-3.0 |
smartforceplus/SmartForceplus | addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py | 378 | 2209 | # -*- 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 |
rolandovillca/python_basic_concepts | web/client_get_with_urllib2.py | 4 | 1905 | '''
urllib2 - Library for opening URLs
A library for opening URLs that can be extended by defining custom protocol
handlers.
The urllib2 module defines functions and classes which help in opening URLs
(mostly HTTP) in a complex world - basic and digest authentication,
redirections, cookies and more.
The urllib2 modu... | mit |
jasimpson/gnuradio-jasimpson | gr-trellis/src/examples/test_sccc_turbo1.py | 2 | 3899 | #!/usr/bin/env python
from gnuradio import gr
from gnuradio import trellis
from gnuradio import eng_notation
import math
import sys
import random
import fsm_utils
def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,Es,N0,IT,seed):
tb = gr.top_block ()
# TX
src = gr.lfsr_32k_s... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.