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
waynemoore/django-httpstatus
src/httpstatus/__init__.py
2
1099
from django.http import HttpResponsePermanentRedirect, HttpResponseRedirect, \ HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed, \ HttpResponseGone class HTTPStatusException(Exception): pass class Http301(HTTPStatusException): def __init__(self, path): self.path = path ...
bsd-3-clause
davidmueller13/android_kernel_samsung_lt03lte-5
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
MoamerEncsConcordiaCa/tensorflow
tensorflow/python/debug/lib/debug_utils.py
29
11009
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
dfunke/root
interpreter/llvm/src/bindings/python/llvm/tests/test_core.py
97
4675
from .base import TestBase from ..core import MemoryBuffer from ..core import PassRegistry from ..core import Context from ..core import Module from ..core import Enums from ..core import OpCode from ..bit_reader import parse_bitcode class TestCore(TestBase): def test_enumerations(self): for enum_cls, enum...
lgpl-2.1
helix84/activae
src/CTK_trunk/CTK/ToggleButton.py
1
4484
# -*- coding: utf-8 -*- # # Copyright (C) 2010 CENATIC: Centro Nacional de Referencia de # Aplicacion de las TIC basadas en Fuentes Abiertas, Spain. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # Redistribution...
bsd-3-clause
mcking49/apache-flask
Python/Lib/lib2to3/fixes/fix_imports.py
326
5693
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', 'c...
mit
valentin-krasontovitsch/ansible
test/units/modules/monitoring/test_pagerduty_alert.py
45
2033
from units.compat import unittest from ansible.modules.monitoring import pagerduty_alert from ansible.module_utils.six.moves.urllib.parse import urlparse, urlencode, urlunparse class PagerDutyAlertsTest(unittest.TestCase): def _assert_incident_api(self, module, url, method, headers): self.assertTrue('htt...
gpl-3.0
alanswanson/webserver
admin/SystemInfo.py
5
5111
# -*- coding: utf-8 -*- # # Cherokee-admin # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2001-2014 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free S...
gpl-2.0
kapilt/ansible
setup.py
33
1980
#!/usr/bin/env python import os import sys sys.path.insert(0, os.path.abspath('lib')) from ansible import __version__, __author__ try: from setuptools import setup, find_packages except ImportError: print("Ansible now needs setuptools in order to build. Install it using" " your package manager (us...
gpl-3.0
diogommartins/pox
pox/info/switch_info.py
46
2469
# Copyright 2013 James McCauley # # 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 writi...
apache-2.0
bcornwellmott/frappe
frappe/desk/report_dump.py
8
2868
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from six.moves import range import frappe import json import copy @frappe.whitelist() def get_data(doctypes, last_modified): data_map = {} for dump_report_map in frappe.get_ho...
mit
eeshangarg/oh-mainline
vendor/packages/whoosh/src/whoosh/qparser/__init__.py
117
1640
# Copyright 2010 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...
agpl-3.0
pocin/kbc-mailchimp-writer
tests/test_cleaning_tags.py
1
2758
import pytest from mcwriter.exceptions import MissingFieldError, CleaningError from mcwriter.cleaning import clean_and_validate_tags_data, _clean_tags_options def test_cleaning_tags_minimal_example(): data = { 'name': 'My custom tag', 'list_id': 'abc01234', 'type': 'text', } expect...
mit
common-workflow-language/cwltool
tests/test_udocker.py
1
3095
"""Test optional udocker feature.""" import copy import os import subprocess import sys from pathlib import Path import pytest from _pytest.tmpdir import TempPathFactory from .util import get_data, get_main_output, working_directory LINUX = sys.platform in ("linux", "linux2") @pytest.fixture(scope="session") def u...
apache-2.0
tobias-d-oe/plugin.program.tvhighlights
default.py
1
21271
#!/usr/bin/python ########################################################################### # # FILE: plugin.program.tvhighlights/default.py # # AUTHOR: Tobias D. Oestreicher # # LICENSE: GPLv3 <http://www.gnu.org/licenses/gpl.txt> # VERSION: 0.1.5 # CREATED: 05.02.2016 # ######...
gpl-3.0
hughdbrown/QSTK-nohist
src/qstkfeat/featutil.py
1
18051
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on Nov 7, 2011 @author: John Cornwell @contact: JohnWCornwellV@gmail.com @summary: Contains utility functions...
bsd-3-clause
GdZ/scriptfile
software/googleAppEngine/lib/django_1_2/django/core/serializers/pyyaml.py
204
1948
""" YAML serializer. Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__. """ from StringIO import StringIO import decimal import yaml from django.db import models from django.core.serializers.python import Serializer as PythonSerializer from django.core.serializers.python import Deserializer as...
mit
radish-bdd/radish
src/radish/hookregistry.py
1
12567
""" radish ~~~~~~ The root from red to green. BDD tooling for Python. :copyright: (c) 2019 by Timo Furrer <tuxtimo@gmail.com> :license: MIT, see LICENSE for more details. """ import inspect import bisect import tagexpressions from radish.errors import HookExecError class HookImpl: """Represent a single Hook ...
mit
fortes/Rfugee
lib/requests-2.7.0-py2.7.egg/requests/packages/urllib3/__init__.py
482
2055
""" urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' __license__ = 'MIT' __version__ = '1.10.4' from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import en...
mit
gpanders/Janitor
src/pushbroom/console.py
1
4525
""" Pushbroom entry point """ import argparse import configparser import fnmatch import logging import os import re import sys from pathlib import Path from typing import Dict from pushbroom import __version__, sweep def run() -> None: """Main entry point""" args = parse_args() setup_logging(args) co...
mit
jamescallmebrent/dagny
setup.py
2
1477
#!/usr/bin/env python # -*- coding: utf-8 -*- import glob import os import re from distribute_setup import use_setuptools; use_setuptools() from setuptools import setup, find_packages rel_file = lambda *args: os.path.join(os.path.dirname(os.path.abspath(__file__)), *args) def read_from(filename): fp = open(fil...
unlicense
snnn/tensorflow
tensorflow/python/debug/lib/debug_data_test.py
74
11784
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
tombstone/models
research/skip_thoughts/skip_thoughts/vocabulary_expansion.py
1
7375
# 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
liosha2007/temporary-groupdocs-python-sdk
groupdocs/models/AddCollaboratorResponse.py
1
1165
#!/usr/bin/env python """ Copyright 2012 GroupDocs. 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...
apache-2.0
shoyer/xray
xarray/core/utils.py
1
18865
"""Internal utilties; not for external use """ import contextlib import functools import itertools import os.path import re import warnings from collections import OrderedDict from typing import ( AbstractSet, Any, Callable, Container, Dict, Hashable, Iterable, Iterator, Mapping, MutableMapping, MutableSet, Opt...
apache-2.0
palashahuja/myhdl
example/manual/rs232.py
9
2811
from __future__ import generators import sys from random import randrange from myhdl import Signal, Simulation, StopSimulation, \ intbv, delay, negedge, join T_9600 = int(1e9 / 9600) T_10200 = int(1e9 / 10200) def rs232_tx(tx, data, duration=T_9600): """ Simple rs232 transmitter procedure...
lgpl-2.1
tinloaf/home-assistant
tests/components/test_input_boolean.py
12
4648
"""The tests for the input_boolean component.""" # pylint: disable=protected-access import asyncio import logging from homeassistant.core import CoreState, State, Context from homeassistant.setup import async_setup_component from homeassistant.components.input_boolean import ( is_on, CONF_INITIAL, DOMAIN) from hom...
apache-2.0
dmitriy-serdyuk/blocks-examples
reverse_words/__main__.py
6
1753
#!/usr/bin/env python """Learn to reverse the letters in each word in text In this demo, a recurrent network equipped with an attention mechanism learns to reverse each word (on a character-by-character basis) in its input text. The default training data is the Google Billion Word corpus, which you should download a...
mit
BackupGGCode/python-for-android
python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/Cryptlib_TripleDES.py
359
1408
"""Cryptlib 3DES implementation.""" from cryptomath import * from TripleDES import * if cryptlibpyLoaded: def new(key, mode, IV): return Cryptlib_TripleDES(key, mode, IV) class Cryptlib_TripleDES(TripleDES): def __init__(self, key, mode, IV): TripleDES.__init__(self, key, mode,...
apache-2.0
BigDataforYou/movie_recommendation_workshop_1
big_data_4_you_demo_1/venv/lib/python2.7/site-packages/numpy/core/tests/test_errstate.py
146
1588
from __future__ import division, absolute_import, print_function import platform import numpy as np from numpy.testing import TestCase, assert_, run_module_suite, dec class TestErrstate(TestCase): @dec.skipif(platform.machine() == "armv5tel", "See gh-413.") def test_invalid(self): with np.errstate(a...
mit
lightopa/Aiopa-Battles
lib/requests/packages/urllib3/contrib/ntlmpool.py
514
4531
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ from __future__ import absolute_import try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection from logging import getLogger from nt...
mit
ritchyteam/odoo
addons/warning/__openerp__.py
113
1686
# -*- 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
saturday-shi/spark
python/pyspark/ml/clustering.py
35
41548
# # 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...
apache-2.0
cyrta/sandbox
ml/pytorch/two_layer_net_custom_function.py
1
2350
# Code in file autograd/two_layer_net_custom_function.py import torch from torch.autograd import Variable class MyReLU(torch.autograd.Function): """ We can implement our own custom autograd Functions by subclassing torch.autograd.Function and implementing the forward and backward passes which operate on Tensor...
unlicense
jenalgit/django
django/template/base.py
69
39012
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
bsd-3-clause
boegel/easybuild-easyblocks
easybuild/easyblocks/e/esmf.py
1
4996
## # Copyright 2013-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
YOTOV-LIMITED/kuma
vendor/packages/picklefield/fields.py
37
7706
"""Pickle field implementation for Django.""" from copy import deepcopy from base64 import b64encode, b64decode from zlib import compress, decompress import six import django from django.db import models from picklefield import DEFAULT_PROTOCOL from picklefield.compat import force_text, loads, dumps class PickledObj...
mpl-2.0
korepwx/tfsnippet
tfsnippet/examples/utils/jsonutils.py
1
5598
import json from base64 import b64encode, b64decode from datetime import datetime import numpy as np import six __all__ = [ 'JsonBinary', 'JsonEncoder', 'JsonDecoder', ] class JsonBinary(object): """ Wrapper class for binary objects. In Python2, ordinary strings are binary strings, thus we cannot e...
mit
GDGLima/contentbox
third_party/django/contrib/gis/db/backends/spatialite/operations.py
63
15295
import re import sys from decimal import Decimal from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter from django.contrib.gis.geometry.backe...
apache-2.0
johngian/remo
remo/base/utils.py
3
5355
import calendar import datetime import math from django.conf import settings from django.contrib.auth.management import create_permissions from django.contrib.auth.models import Group, Permission from django.core.exceptions import ValidationError from django.core.mail.backends.smtp import EmailBackend as SMTPBackend f...
bsd-3-clause
abusse/cinder
cinder/openstack/common/scheduler/filters/json_filter.py
8
4914
# Copyright (c) 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
hthompson6/a10-neutron-lbaas
a10_neutron_lbaas/plumbing/wrappers.py
2
11396
# Copyright (c) 2018 A10 Networks # # Heavily inspired by networking-arista # Source at https://github.com/openstack/networking-arista # 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 # # htt...
apache-2.0
utcoupe/coupe18
ros_ws/src/processing_belt_interpreter/src/belt_parser.py
1
2839
#!/usr/bin/env python import xml.etree.ElementTree as ET import rospy class BeltParser(object): """Class used to parse the definition XML""" def __init__(self, file): super(BeltParser, self).__init__() rospy.logdebug("Parsing belt definition...") root = ET.parse(file).getroot() ...
gpl-3.0
rrampage/rethinkdb
external/v8_3.30.33.16/testing/gmock/gtest/test/gtest_xml_test_utils.py
1815
8876
#!/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...
agpl-3.0
spencerpomme/coconuts-on-fire
DSA/ArrayQueue.py
1
2810
# python implemented queue ADT # A new exception class defined for handling empty errors class Empty(Exception): ''' Error attempting to access an element from an empty container. ''' pass class ArrayQueue: '''FIFO queue implementation using a python list as underlying storage.''' DEFAULT_CAPA...
apache-2.0
schleichdi2/OPENNFR-6.1-CORE
bitbake/lib/toaster/orm/management/commands/lsupdates.py
2
11561
# # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Toaster Implementation # # Copyright (C) 2016 Intel Corporation # # 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 # pub...
gpl-2.0
renatosamperio/context_task_queue
Tools/create_service.py
1
21855
#!/usr/bin/env python # -*- coding: latin-1 -*- import sys, os from optparse import OptionParser, OptionGroup import xml.etree.ElementTree as ET ## Importing Utils from parent path file_path = os.path.dirname(__file__) join_path = os.path.join(file_path, '../Utils') abs_path = os.path.abspath(join_path) sys.path.app...
gpl-3.0
Distrotech/scons
bootstrap/src/engine/SCons/Tool/rpmutils.py
2
16581
"""SCons.Tool.rpmutils.py RPM specific helper routines for general usage in the test framework and SCons core modules. Since we check for the RPM package target name in several places, we have to know which machine/system name RPM will use for the current hardware setup. The following dictionaries and functions try t...
mit
rojinva/Email-classifier
Text classification with probability.py
1
2058
__author__="rojin.varghese" __date__ ="$Nov 8, 2013 8:48:18 PM$" import os from xlrd import open_workbook import re import xlwt j = os.path.join def train(text): c = {} lastword = "" line = re.sub('[\-#*>]', '', text) line = re.sub('[\n]', '', line) for word in line.split(): word = word.l...
unlicense
GoogleCloudPlatform/gke-gobang-app-example
backend-smart/src/library.py
3
2589
# Copyright 2016 Google 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 writi...
apache-2.0
bob-the-hamster/commandergenius
project/jni/python/src/Tools/faqwiz/faqw.py
32
1089
#! /usr/local/bin/python """FAQ wizard bootstrap.""" # This is a longer version of the bootstrap script given at the end of # faqwin.py; it prints timing statistics at the end of the regular CGI # script's output (so you can monitor how it is doing). # This script should be placed in your cgi-bin directory and made ...
lgpl-2.1
begeekmyfriend/yasea
library/src/main/cpp/libx264/tools/test_x264.py
138
16077
#!/usr/bin/env python import operator from optparse import OptionGroup import sys from time import time from digress.cli import Dispatcher as _Dispatcher from digress.errors import ComparisonError, FailedTestError, DisabledTestError from digress.testing import depends, comparer, Fixture, Case from digress.comparer...
mit
mark-up/django-autoslug
doc/conf.py
1
6508
# -*- coding: utf-8 -*- # # Django Autoslug documentation build configuration file, created by # sphinx-quickstart on Tue Jul 21 22:35:51 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
lgpl-3.0
wolverineav/horizon
horizon/templatetags/form_helpers.py
15
2099
# 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 # d...
apache-2.0
shivaenigma/electrum
setup-release.py
20
2827
""" py2app/py2exe build script for Electrum Usage (Mac OS X): python setup.py py2app Usage (Windows): python setup.py py2exe """ from setuptools import setup import os import re import shutil import sys from lib.util import print_error from lib.version import ELECTRUM_VERSION as version name = "Electrum...
gpl-3.0
rrrene/django
tests/template_tests/syntax_tests/test_if_changed.py
170
10452
from django.template import Context, Engine from django.test import SimpleTestCase from ..utils import setup class IfChangedTagTests(SimpleTestCase): libraries = {'custom': 'template_tests.templatetags.custom'} @setup({'ifchanged01': '{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% endfor %}'})...
bsd-3-clause
huertatipografica/huertatipografica-fl-scripts
AT_Compatibility/AT_Compatible.py
1
1585
#FLM: AT Compatibility check #Check compatibility of selected glyphs between the current font and declared fontCompare (Postcrit Full Name) # By Andres Torresi # http://www.huertatipografica.com #fullName of font you want to compare with current font fontCompare='ABBvoice Bold'; colorCompatible=150 colorIncompatible=...
apache-2.0
atsao72/sympy
sympy/physics/quantum/tensorproduct.py
64
13572
"""Abstract tensor product.""" from __future__ import print_function, division from sympy import Expr, Add, Mul, Matrix, Pow, sympify from sympy.core.compatibility import u, range from sympy.core.trace import Tr from sympy.printing.pretty.stringpict import prettyForm from sympy.physics.quantum.qexpr import QuantumEr...
bsd-3-clause
vortex-ape/scikit-learn
conftest.py
2
2347
# Even if empty this file is useful so that when running from the root folder # ./sklearn is added to sys.path by pytest. See # https://docs.pytest.org/en/latest/pythonpath.html for more details. For # example, this allows to build extensions in place and run pytest # doc/modules/clustering.rst and use sklearn from th...
bsd-3-clause
Lujeni/ansible
test/units/modules/network/fortios/test_fortios_system_replacemsg_ec.py
21
8357
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
jzahedieh/django-tennis-ladder
tennis/settings.py
1
6946
# Django settings for tennis project. import os SETTINGS_DIR = os.path.abspath(os.path.dirname(__file__)) DEBUG = os.environ.get("DEBUG_VALUE") == 'True' ADMINS = ( ('Admin User', 'admin@highgate-ladder.co.uk'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', ...
mit
adrn/gala
gala/io.py
2
1187
# Third-party import astropy.units as u def quantity_from_hdf5(dset): """ Return an Astropy Quantity object from a key in an HDF5 file, group, or dataset. This checks to see if the input file/group/dataset contains a ``'unit'`` attribute (e.g., in `f.attrs`). Parameters ---------- dset : :...
mit
SnappleCap/oh-mainline
vendor/packages/oauthlib/tests/oauth2/rfc6749/clients/test_mobile_application.py
25
3833
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os from mock import patch from oauthlib import signals from oauthlib.oauth2 import MobileApplicationClient from ....unittest import TestCase @patch('time.time', new=lambda: 1000) class MobileApplicationClientTest(TestCase): ...
agpl-3.0
CCI-MOC/nova
nova/tests/functional/api_sample_tests/test_floating_ips.py
17
4483
# Copyright 2014 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/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
vadimtk/chrome4sdp
tools/telemetry/third_party/gsutilz/third_party/boto/tests/integration/datapipeline/test_cert_verification.py
121
1524
# Copyright (c) 2014 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 right...
bsd-3-clause
cctaylor/googleads-python-lib
examples/dfp/v201411/workflow_request_service/trigger_workflow_external_condition_requests.py
4
3480
#!/usr/bin/python # # Copyright 2014 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...
apache-2.0
CloudWareChile/OpenChile
openerp/addons/fetchmail_crm/__openerp__.py
3
1451
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP S.A. (<http://www.openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
ShinyROM/android_external_chromium_org
native_client_sdk/src/build_tools/sdk_tools/third_party/fancy_urllib/__init__.py
155
14277
#!/usr/bin/env python # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Python Software # Foundation; All Rights Reserved """A HTTPSConnection/Handler with additional proxy and cert validation features. In particular, monkey patches in Python r74203 to provide support for CONNECT proxies and adds SSL cert va...
bsd-3-clause
BrianH2244/meansc
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
899
2768
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
mit
thedrow/django-downloadview
demo/demoproject/nginx/tests.py
3
1674
import os from django.core.files.base import ContentFile from django.core.urlresolvers import reverse import django.test from django_downloadview.nginx import assert_x_accel_redirect from demoproject.nginx.views import storage, storage_dir def setup_file(): if not os.path.exists(storage_dir): os.makedi...
bsd-3-clause
hackerkid/zulip
zerver/lib/management.py
3
5615
# Library code for use in management commands import signal from argparse import ArgumentParser, RawTextHelpFormatter from typing import Any, Dict, List, Optional from django.conf import settings from django.core.exceptions import MultipleObjectsReturned from django.core.management.base import BaseCommand, CommandErro...
apache-2.0
nagyistoce/edx-platform
common/lib/xmodule/xmodule/assetstore/__init__.py
124
11966
""" Classes representing asset metadata. """ from datetime import datetime import dateutil.parser import pytz import json from contracts import contract, new_contract from opaque_keys.edx.keys import CourseKey, AssetKey from lxml import etree new_contract('AssetKey', AssetKey) new_contract('CourseKey', CourseKey) ne...
agpl-3.0
sbyoun/i-mapreduce
src/contrib/hod/hodlib/Common/miniHTMLParser.py
182
1402
#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 use thi...
apache-2.0
percyfal/luigi
examples/elasticsearch_index.py
57
3399
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
robhaverkort/clanmanager
vendor/doctrine/orm/docs/en/conf.py
2448
6497
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
mit
blakerohde/sidewalk
setup.py
1
1124
import os from distutils.core import setup import sidewalk setup( name='sidewalk', version=sidewalk.__version__, url= 'http://www.blakerohde.com/projects/sidewalk', author='Blake Rohde', author_email='blake@blakerohde.com', description='The Simple Activity Aggregator.', long_description=open('README.rst').rea...
isc
ProfessionalIT/maxigenios-website
sdk/google_appengine/google/appengine/datastore/datastore_pbs.py
3
56850
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
mit
drewokane/xray
xarray/core/groupby.py
1
20086
import functools import numpy as np import pandas as pd from . import ops from .combine import concat from .common import ( ImplementsArrayReduce, ImplementsDatasetReduce, _maybe_promote, ) from .pycompat import zip from .utils import peek_at, maybe_wrap_array, safe_cast_to_index from .variable import as_variable,...
apache-2.0
browseinfo/7.0-web
addons/web/tests/test_serving_base.py
138
1031
# -*- coding: utf-8 -*- import random import unittest2 from ..controllers.main import module_topological_sort as sort def sample(population): return random.sample( population, random.randint(0, min(len(population), 5))) class TestModulesLoading(unittest2.TestCase): def setUp(self): ...
agpl-3.0
aequitas/home-assistant
tests/components/rfxtrx/test_light.py
12
11924
"""The tests for the Rfxtrx light platform.""" import unittest import pytest from homeassistant.setup import setup_component from homeassistant.components import rfxtrx as rfxtrx_core from tests.common import get_test_home_assistant, mock_component @pytest.mark.skipif("os.environ.get('RFXTRX') != 'RUN'") class Tes...
apache-2.0
movmov/cc
vendor/Twisted-10.0.0/twisted/trial/__init__.py
61
2063
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # # Maintainer: Jonathan Lange """ Asynchronous unit testing framework. Trial extends Python's builtin C{unittest} to provide support for asynchronous tests. Maintainer: Jonathan Lange Trial strives to be compatible with other Python ...
apache-2.0
markharwood/elasticsearch
dev-tools/download-s3.py
236
2295
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
apache-2.0
qedsoftware/commcare-hq
corehq/ex-submodules/couchforms/management/commands/submit_form.py
3
2033
from django.core.management.base import CommandError, BaseCommand from optparse import make_option import os from dimagi.utils.post import post_data class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--method', action='store', dest='method', default='cur...
bsd-3-clause
forkbong/qutebrowser
qutebrowser/config/configexc.py
1
5505
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
ramadhane/odoo
addons/l10n_multilang/l10n_multilang.py
378
8428
# -*- 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
savoirfairelinux/stock-logistics-workflow
__unported__/stock_filter_none_zero_qty/product.py
23
3682
# -*- coding: utf-8 -*- ############################################################################# # # Copyright (c) 2010-2012, OPENTIA Group (<http://opentia.com>) # The word "OPENTIA" is an European Community Trademark property # of the Opentia Group # # @author: Opentia "Happy Hacking" Team # @e-ma...
agpl-3.0
NL66278/odoo
addons/payment_adyen/models/adyen.py
136
7759
# -*- coding: utf-'8' "-*-" import base64 try: import simplejson as json except ImportError: import json from hashlib import sha1 import hmac import logging import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_adyen.controllers.main import Adye...
agpl-3.0
thinkopensolutions/geraldo
site/newsite/site-geraldo/django/utils/simplejson/decoder.py
26
11251
""" Implementation of JSONDecoder """ import re import sys from django.utils.simplejson.scanner import Scanner, pattern try: from django.utils.simplejson._speedups import scanstring as c_scanstring except ImportError: pass FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): import struct...
lgpl-3.0
panda4life/idpserver
mysite/idp/plotting.py
1
3702
# -*- coding: utf-8 -*- """ Created on Wed Apr 30 16:43:00 2014 @author: jahad """ import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties import os def phasePlot(fp,fm,seqname,saveAs): if(os.path.exists(saveAs)): os.remove(saveAs) for x,y,label in zip(fp,fm,seqname): ...
gpl-3.0
naturali/tensorflow
tensorflow/contrib/framework/python/ops/ops.py
74
2164
# 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
tumbl3w33d/ansible
lib/ansible/modules/network/check_point/cp_mgmt_application_site_facts.py
20
4333
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
gpl-3.0
acshan/odoo
addons/product_expiry/__openerp__.py
260
1788
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
endolith/pyeq2
Examples/Simple/FitUserDefinedFunction_2D.py
3
1381
from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import import os, sys, inspect # ensure pyeq2 can be imported if -1 != sys.path[0].find('pyeq2-master'):raise Exception('Please rename git checkout directory from "pyeq2-master" to "pyeq2"') exampleFileDirect...
bsd-2-clause
mzszym/oedes
oedes/__init__.py
1
1135
# -*- coding: utf-8; -*- # # oedes - organic electronic device simulator # Copyright (C) 2017-2018 Marek Zdzislaw Szymanski (marek@marekszymanski.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License, version 3, # as published by the ...
agpl-3.0
adamtiger/tensorflow
tensorflow/python/training/supervisor_test.py
120
35351
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
akash1808/nova
nova/tests/unit/servicegroup/test_zk_driver.py
59
4183
# Copyright (c) AT&T 2012-2013 Yun Mao <yunmao@gmail.com> # Copyright 2012 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/LICENS...
apache-2.0
iut-ibk/P8-WSC-GUI
3dparty/Editra/tests/unittests/testSyntaxDataBase.py
1
2697
############################################################################### # Name: testSyntaxDataBase.py # # Purpose: Unit tests for syntax.syndata Base Class # # Author: Cody Precord <cprecord@editra.org> # ...
gpl-2.0
yatinkumbhare/openstack-nova
nova/network/opts.py
51
1529
# 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 the Li...
apache-2.0
dakcarto/QGIS
python/plugins/processing/modeler/CalculatorModelerAlgorithm.py
4
6119
# -*- coding: utf-8 -*- """ *************************************************************************** CalculatorModelerAlgorithm.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ************...
gpl-2.0
dakcarto/QGIS
python/ext-libs/jinja2/testsuite/regression.py
414
8382
# -*- coding: utf-8 -*- """ jinja2.testsuite.regression ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests corner cases and bugs. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Template, Enviro...
gpl-2.0