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
openstack/keystone
keystone/tests/unit/assignment/role_backends/test_sql.py
2
5010
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
the-adrian/KernotekV2.0
venv/lib/python2.7/site-packages/pip/_vendor/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
jlcarmic/producthunt_simulator
venv/lib/python2.7/site-packages/pip/_vendor/ipaddress.py
170
79904
# Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """A fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. """ from __future__ import unicode_literals import itertools import struct __version...
mit
willzhang05/postgrestesting1
postgrestesting1/lib/python3.5/site-packages/django/db/backends/oracle/base.py
104
25266
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ from __future__ import unicode_literals import datetime import decimal import os import platform import sys import warnings from django.conf import settings from django.db import utils from django.db.backends.base.base ...
mit
flaviovdf/tag_assess
src/scripts/old/DumpProbs.py
1
3249
#-*- coding: utf8 ''' For a given annotation table in the database, a smooth function and a lambda value; this will compute the probability of the item on a given tag and insert it on a Mongo database. ''' from __future__ import division, print_function __authors__ = ['Flavio Figueiredo - flaviovdf <at> gmail <dot-n...
bsd-3-clause
s20121035/rk3288_android5.1_repo
external/chromium_org/third_party/cython/src/Cython/StringIOTree.py
109
3095
from cStringIO import StringIO class StringIOTree(object): """ See module docs. """ def __init__(self, stream=None): self.prepended_children = [] if stream is None: stream = StringIO() self.stream = stream self.write = stream.write self.markers = [] ...
gpl-3.0
linjoahow/2015cdaa-w11
static/Brython3.1.1-20150328-091302/Lib/genericpath.py
727
3093
""" Path operations common to more than one OS Do not use directly. The OS specific modules import the appropriate functions from this module themselves. """ import os import stat __all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime', 'getsize', 'isdir', 'isfile'] # Does a path exist? #...
gpl-3.0
dhruvagarwal/django
tests/postgres_tests/test_hstore.py
70
8340
import json from django.core import exceptions, serializers from django.forms import Form from . import PostgreSQLTestCase from .models import HStoreModel try: from django.contrib.postgres import forms from django.contrib.postgres.fields import HStoreField from django.contrib.postgres.validators import K...
bsd-3-clause
buguelos/odoo
addons/mrp/__init__.py
437
1165
# -*- 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
Big-B702/python-for-android
python-build/python-libs/gdata/tests/gdata_tests/blogger_test.py
128
3855
#!/usr/bin/python # # Copyright (C) 2008 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 ...
apache-2.0
darktears/chromium-crosswalk
tools/valgrind/scan-build.py
70
7453
#!/usr/bin/env python # Copyright (c) 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 argparse import errno import json import os import re import sys import urllib import urllib2 # Where all the data lives. R...
bsd-3-clause
trondeau/gnuradio
gr-trellis/examples/python/test_tcm.py
45
4831
#!/usr/bin/env python from gnuradio import gr from gnuradio import trellis, digital, blocks from gnuradio import eng_notation import math import sys import random from gnuradio.trellis import fsm_utils from gnuradio.eng_option import eng_option from optparse import OptionParser import numpy try: from gnuradio imp...
gpl-3.0
cjayb/mne-python
mne/viz/tests/test_montage.py
14
2773
# Authors: Denis Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Teon Brooks <teon.brooks@gmail.com> # # License: Simplified BSD # Set our plotters to test mode import os.path as op import numpy as np import pytest import matplotlib.pyplot as plt from mne.ch...
bsd-3-clause
dmarteau/QGIS
python/plugins/processing/algs/qgis/SelectByAttribute.py
15
7154
# -*- coding: utf-8 -*- """ *************************************************************************** SelectByAttribute.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com *******************...
gpl-2.0
cddjr/BitcoinUnlimited
qa/rpc-tests/test_framework/test_framework.py
4
9806
#!/usr/bin/env python3 # Copyright (c) 2014-2015 The Bitcoin Core developers # Copyright (c) 2015-2017 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Base class for RPC testing # Add python-bit...
mit
pycket/pycket
pycket/pycket_json.py
1
6641
from rpython.rlib.objectmodel import specialize, we_are_translated, compute_hash from rpython.tool.pairtype import extendabletype # Union-Object to represent a json structure in a static way class JsonBase(object): __metaclass__ = extendabletype is_string = is_int = is_float = is_bool = is_object = is_array =...
mit
repsac/threeio
addons/io_three/logger.py
121
1589
import os import logging import tempfile from . import constants LOG_FILE = None LOGGER = None LEVELS = { constants.DEBUG: logging.DEBUG, constants.INFO: logging.INFO, constants.WARNING: logging.WARNING, constants.ERROR: logging.ERROR, constants.CRITICAL: logging.CRITICAL } def init(filename, l...
mit
victos/busuu_anki
anki/template/view.py
1
3397
import os.path import re from anki.template import Template class View(object): # Path where this view's template(s) live template_path = '.' # Extension for templates template_extension = 'mustache' # The name of this template. If none is given the View will try # to infer it based on the ...
agpl-3.0
sserrot/champion_relationships
venv/Lib/site-packages/ipython_genutils/path.py
20
5386
# encoding: utf-8 """ Utilities for path handling. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import os import sys import errno import shutil import random from . import py3compat fs_encoding = sys.getfilesystemencoding() def filefind(filename, path_d...
mit
noslenfa/tdjangorest
uw/lib/python2.7/site-packages/django/middleware/common.py
101
7433
import hashlib import logging import re from django.conf import settings from django import http from django.core.mail import mail_managers from django.utils.http import urlquote from django.utils import six from django.core import urlresolvers logger = logging.getLogger('django.request') class CommonMiddleware(ob...
apache-2.0
kerr-huang/SL4A
python/src/Lib/test/test_call.py
90
3124
import unittest from test import test_support # The test cases here cover several paths through the function calling # code. They depend on the METH_XXX flag that is used to define a C # function, which can't be verified from Python. If the METH_XXX decl # for a C function changes, these tests may not cover the righ...
apache-2.0
zack3241/incubator-airflow
airflow/operators/hive_to_mysql.py
15
4158
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
haad/ansible-modules-extras
cloud/openstack/os_user_facts.py
60
4940
#!/usr/bin/python # Copyright (c) 2016 Hewlett-Packard Enterprise Corporation # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
gpl-3.0
tboyce021/home-assistant
homeassistant/components/miflora/sensor.py
8
7952
"""Support for Xiaomi Mi Flora BLE plant sensor.""" from datetime import timedelta import logging import btlewrap from btlewrap import BluetoothBackendException from miflora import miflora_poller # pylint: disable=import-error import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from...
apache-2.0
gitgitcode/myflask
venv/lib/python2.7/site-packages/werkzeug/wrappers.py
84
82986
# -*- coding: utf-8 -*- """ werkzeug.wrappers ~~~~~~~~~~~~~~~~~ The wrappers are simple request and response objects which you can subclass to do whatever you want them to do. The request object contains the information transmitted by the client (webbrowser) and the response object contains al...
mit
frippe12573/geonode
geonode/maps/admin.py
9
1487
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 versio...
gpl-3.0
Endika/connector-magento
magentoerpconnect/product.py
8
25521
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier, David Beal # Copyright 2013 Camptocamp SA # Copyright 2013 Akretion # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
mikrosimage/rez
src/rez/tests/data/builds/packages/foo/1.1.0/rezbuild.py
8
1318
from build_util import build_directory_recurse, check_visible import os.path def build(source_path, build_path, install_path, targets): # build requirement 'floob' should be visible check_visible("foo", "floob") import floob print floob.hello() # do the build if "install" not in (targets or ...
lgpl-3.0
scalable-networks/gnuradio-3.7.2.1
gr-blocks/python/blocks/qa_affinity.py
57
1481
#!/usr/bin/env python # # Copyright 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 option) # ...
gpl-3.0
erikdejonge/youtube-dl
youtube_dl/extractor/dhm.py
64
2091
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import parse_duration class DHMIE(InfoExtractor): IE_DESC = 'Filmarchiv - Deutsches Historisches Museum' _VALID_URL = r'https?://(?:www\.)?dhm\.de/filmarchiv/(?:[^/]+/)+(?P<id>[^/]+)' _TESTS = [{ 'url': 'http:...
unlicense
alexanderturner/ansible
lib/ansible/modules/windows/win_package.py
9
5063
#!/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
MiLk/ansible
lib/ansible/modules/cloud/google/gcspanner.py
4
10266
#!/usr/bin/python # Copyright 2017 Google Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
gpl-3.0
WillieMaddox/numpy
numpy/distutils/fcompiler/compaq.py
82
4151
#http://www.compaq.com/fortran/docs/ from __future__ import division, absolute_import, print_function import os import sys from numpy.distutils.fcompiler import FCompiler from numpy.distutils.compat import get_exception from distutils.errors import DistutilsPlatformError compilers = ['CompaqFCompiler'] if os.name !...
bsd-3-clause
tombstone/models
research/object_detection/predictors/heads/class_head.py
1
12829
# 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
pam-bot/SMSBeds
lib/twilio/rest/__init__.py
4
7032
import logging import os import platform from ..exceptions import TwilioException from .. import __version__ as LIBRARY_VERSION from .resources import ( make_request, Accounts, Applications, AuthorizedConnectApps, CallerIds, Calls, Conferences, ConnectApps, Connection, MediaList,...
gpl-2.0
nikolas/readthedocs.org
readthedocs/search/views.py
10
3105
from pprint import pprint import collections import os import json import logging import mimetypes import md5 from django.core.urlresolvers import reverse from django.conf import settings from django.contrib.auth.models import User from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcu...
mit
jdevera/subdue
test/test.py
1
5322
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import sys import os import subdue import subdue.core import subdue.sub from .utils import SubdueTestCase, TemporaryDirectory, OutStreamCheckedCapture class TestMain(SubdueTestCase): def test_noa...
mit
percyfal/snakemake-rules
tests/test_rules_ngsfixtures.py
2
4710
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import re from os.path import basename, realpath import logging import pytest from snakemake_rules.core import ruleinfo from helpers import utils from helpers.fixture import set_inputmap, set_output logging.basicConfig(level=logging.INFO) logger = logging.getLog...
mit
ian-garrett/meetMe
env/lib/python3.4/site-packages/pip/req/req_set.py
246
27444
from __future__ import absolute_import from collections import defaultdict import functools import itertools import logging import os from pip._vendor import pkg_resources from pip._vendor import requests from pip.download import (url_to_path, unpack_url) from pip.exceptions import (InstallationError, BestVersionAlr...
artistic-2.0
kellinm/blivet
tests/formats_test/init_test.py
6
1455
import copy import unittest import blivet.formats as formats class FormatsTestCase(unittest.TestCase): def testFormatsMethods(self): ## ## get_device_format_class ## format_pairs = { None : formats.DeviceFormat, "bogus" : None, "biosboot" : formats...
gpl-2.0
U-MA/mal
python/step8_macros.py
42
4847
import sys, traceback import mal_readline import mal_types as types import reader, printer from env import Env import core # read def READ(str): return reader.read_str(str) # eval def is_pair(x): return types._sequential_Q(x) and len(x) > 0 def quasiquote(ast): if not is_pair(ast): return types._...
mpl-2.0
HEG-Arc/Appagoo
appagoo/allauth/socialaccount/templatetags/socialaccount.py
4
2567
from django.template.defaulttags import token_kwargs from django import template from allauth.socialaccount import providers register = template.Library() class ProviderLoginURLNode(template.Node): def __init__(self, provider_id, params): self.provider_id_var = template.Variable(provider_id) sel...
bsd-3-clause
JianyuWang/nova
nova/tests/unit/virt/libvirt/fake_libvirt_utils.py
28
3248
# Copyright (c) 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
ity/pants
tests/python/pants_test/backend/jvm/tasks/test_check_published_deps.py
10
3985
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from textw...
apache-2.0
ehdr/luigi
luigi/contrib/hdfs/__init__.py
27
3126
# -*- 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
servo/servo
tests/wpt/web-platform-tests/webdriver/tests/element_click/shadow_dom.py
16
4420
import pytest from tests.support.asserts import assert_error, assert_success def element_click(session, element): return session.transport.send( "POST", "session/{session_id}/element/{element_id}/click".format( session_id=session.session_id, element_id=element.id)) @pytest.fixtur...
mpl-2.0
linkcheck/linkchecker
tests/htmllib.py
1
2076
# Copyright (C) 2000-2014 Bastian Kleineidam # # 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. # # This program is distr...
gpl-2.0
eaplatanios/tensorflow
tensorflow/python/keras/_impl/keras/datasets/__init__.py
22
1349
# 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
gurneyalex/OpenUpgrade
openerp/addons/base/ir/ir_mail_server.py
38
25751
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011-2012 OpenERP S.A (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
abdullah2891/remo
vendor-local/lib/python/tablib/packages/xlwt/ExcelFormula.py
87
1385
# -*- coding: windows-1252 -*- import ExcelFormulaParser, ExcelFormulaLexer import struct from antlr import ANTLRException class Formula(object): __slots__ = ["__init__", "__s", "__parser", "__sheet_refs", "__xcall_refs"] def __init__(self, s): try: self.__s = s lexer = Exc...
bsd-3-clause
koehlermichael/olympia
apps/users/tests/test_tasks.py
15
1968
import os import shutil import tempfile from django.conf import settings from django.core.files.storage import default_storage as storage import pytest from nose.tools import eq_ from PIL import Image from amo.tests.test_helpers import get_image_path from users.tasks import delete_photo, resize_photo pytestmark =...
bsd-3-clause
tedder/ansible
lib/ansible/modules/cloud/openstack/os_coe_cluster.py
31
8797
#!/usr/bin/python # Copyright (c) 2018 Catalyst IT Ltd. # 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': ['pr...
gpl-3.0
jpshort/odoo
addons/account_budget/report/budget_report.py
360
8549
# -*- 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
owlabs/incubator-airflow
airflow/executors/sequential_executor.py
14
2113
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
thwindbell/pox
pox/lib/packet/arp.py
45
6290
# Copyright 2011 James McCauley # Copyright 2008 (C) Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
apache-2.0
rismalrv/edx-platform
cms/djangoapps/contentstore/tasks.py
150
4926
""" This file contains celery tasks for contentstore views """ import json import logging from celery.task import task from celery.utils.log import get_task_logger from datetime import datetime from pytz import UTC from django.contrib.auth.models import User from contentstore.courseware_index import CoursewareSearchI...
agpl-3.0
eckucukoglu/arm-linux-gnueabihf
lib/python2.7/test/test_univnewlines.py
134
4079
# Tests universal newline support for both reading and parsing files. # NOTE: this file tests the new `io` library backported from Python 3.x. # Similar tests for the builtin file object can be found in test_univnewlines2k.py. from __future__ import print_function from __future__ import unicode_literals import io im...
gpl-2.0
jostep/tensorflow
tensorflow/python/kernel_tests/fractional_avg_pool_op_test.py
107
21031
# 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
steventimberman/masterDebater
env/lib/python2.7/site-packages/django/views/decorators/vary.py
586
1200
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-langu...
mit
klahnakoski/SpotManager
vendor/pyLibrary/aws/__init__.py
1
6676
# encoding: utf-8 # # # 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 file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import, divisi...
mpl-2.0
agry/NGECore2
scripts/mobiles/tatooine/dune_beetle.py
2
1568
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
lgpl-3.0
apache/incubator-mxnet
python/mxnet/notebook/callback.py
22
14081
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
Pixomondo/rez
src/rez/vendor/colorama/initialise.py
9
1382
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import atexit import sys from .ansitowin32 import AnsiToWin32 orig_stdout = sys.stdout orig_stderr = sys.stderr wrapped_stdout = sys.stdout wrapped_stderr = sys.stderr atexit_done = False def reset_all(): AnsiToWin32(orig_stdout).rese...
lgpl-3.0
itkvideo/ITK
Wrapping/WrapITK/Languages/SwigInterface/pygccxml-1.0.0/pygccxml/declarations/calldef.py
13
21338
# Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) """ defines classes, that describes "callable" declarations This modules contains definition for next C++ declarations: - ...
apache-2.0
galak/zephyr
doc/_extensions/zephyr/html_redirects.py
5
2490
# Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD # # SPDX-License-Identifier: Apache-2.0 # 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
rfguri/vimfiles
bundle/ycm/third_party/ycmd/third_party/python-future/docs/3rd-party-py3k-compat-code/statsmodels_py3k.py
15
1826
""" Python 3 compatibility tools. """ __all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar', 'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested', 'asstr', 'open_latin1'] import sys if sys.version_info[0] >= 3: import io bytes = bytes unicode = str asuni...
mit
karthik-suresh/horizon
horizon/utils/file_discovery.py
8
4168
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
MridulS/sympy
sympy/matrices/expressions/tests/test_determinant.py
17
1138
from sympy.core import Lambda, S, symbols from sympy.functions import adjoint, conjugate, transpose from sympy.matrices import eye, Matrix, ShapeError from sympy.matrices.expressions import ( Adjoint, Identity, FunctionMatrix, MatrixExpr, MatrixSymbol, Determinant, det, ZeroMatrix, Transpose ) from sympy.utilit...
bsd-3-clause
farooqsheikhpk/Aspose.BarCode-for-Cloud
SDKs/Aspose.BarCode-Cloud-SDK-for-Python/tests/test_BarcodeApi.py
3
4848
import unittest import os.path import json import inspect import requests import asposebarcodecloud from asposebarcodecloud.BarcodeApi import BarcodeApi from asposebarcodecloud.BarcodeApi import ApiException from asposebarcodecloud.models import BarcodeResponseList from asposebarcodecloud.models import SaaSposeRespons...
mit
trietptm/volatility
volatility/plugins/addrspaces/crash.py
44
3315
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (C) 2005,2006,2007 4tphi Research # # Authors: # {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters) # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the...
gpl-2.0
Armored-Dragon/goldmine
default_cogs/utils/checks.py
1
2639
import discord from discord.ext import commands import discord.utils # # This is a modified version of checks.py, originally made by Rapptz # # https://github.com/Rapptz/RoboDanny/tree/async # def is_owner_check(ctx): return ctx.author.id == ctx.bot.owner_user.id def is_owner(): return commands.chec...
mit
dgarros/ansible
lib/ansible/utils/module_docs_fragments/postgres.py
143
2774
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
brandt/openconnect
www/html.py
1
5241
#!/usr/bin/env python3 # # Simple XML to HTML converter. # # (C) 2005 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys im...
lgpl-2.1
kantlove/flask-simple-page
Lib/site-packages/flask/testsuite/regression.py
563
3198
# -*- coding: utf-8 -*- """ flask.testsuite.regression ~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests regressions. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import gc import sys import flask import threading import unittest from werkzeug.exceptions impor...
mit
apeterson91/Chess_Game
components/Chess_Piece.py
1
9030
""" Text-Based Chess --Adam Peterson """ from data import * class Chess_Piece: """ Parent Class for all Chess Pieces contains color, position, letter, etc. """ def __init__(self,color,position,letter): self._color = color self._position = position self._letter = letter ...
mit
HwisooSo/gemV-update
configs/example/hmctest.py
7
5841
import optparse import sys import subprocess import m5 from m5.objects import * from m5.util import addToPath addToPath('../') from common import MemConfig from common import HMC parser = optparse.OptionParser() # Use a HMC_2500_1x32 (1 channel, 32-bits wide) by default parser.add_option("--mem-type", type = "choi...
bsd-3-clause
siavooshpayandehazad/ScheduleAndDepend
src/main/python/SystemHealthMonitoring/TestSchedulingUnit.py
2
8181
# Copyright (C) 2015 Siavoosh Payandeh Azad # This part of the project is based on 1967 research paper: # "On the Connection Assignment Problem of Diagnosable Systems", by # FRANCO P. PREPARATA, GERNOT METZE AND ROBERT T. CHIEN # all the variable names are the same as in the paper... import networkx from fractions i...
gpl-2.0
TEAM-Gummy/platform_external_chromium_org
third_party/tlslite/tlslite/utils/RSAKey.py
253
8575
"""Abstract class for RSA.""" from cryptomath import * class RSAKey: """This is an abstract base class for RSA keys. Particular implementations of RSA keys, such as L{OpenSSL_RSAKey.OpenSSL_RSAKey}, L{Python_RSAKey.Python_RSAKey}, and L{PyCrypto_RSAKey.PyCrypto_RSAKey}, inherit from this. ...
bsd-3-clause
ffu/DSA-3.2.2
gr-wxgui/src/python/fftsink2.py
92
1429
# # Copyright 2008,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version...
gpl-3.0
royragsdale/picoCTF
scripts/load-deployment.py
2
2047
#!/usr/bin/env python3 """ ./load-deployment.py Loads a deployment from a previously configured shell server. """ import api import argparse import os import sys def main(args): server = None all_servers = api.shell_servers.get_all_servers() for s in all_servers: if s["name"] == args.name: ...
mit
DoWhatILove/turtle
programming/python/data_visualization/world_population.py
1
2044
import json import os from pygal_maps_world import maps from pygal.style import RotateStyle as RS, LightColorizedStyle as LCS from country_codes import get_country_code data_dir = os.path.join(os.path.dirname(__file__), 'data') filename = os.path.join(data_dir, 'population_data.json') year = '2009' def get_code_popu...
mit
sixty-north/structurizr-python
structurizr/model/element.py
1
4443
from abc import abstractmethod from orderedset import OrderedSet from structurizr.model.taggable import Taggable def is_well_formed_url(url): # TODO: A reasonable implementation is required here return True CANONICAL_NAME_SEPARATOR = '/' class Element(Taggable): def __init__(self): super()....
apache-2.0
iansf/sky_engine
third_party/re2/re2/make_unicode_groups.py
219
2849
#!/usr/bin/python # 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. """Generate C++ tables for Unicode Script and Category groups.""" import sys import unicode _header = """ // GENERATED BY make_unicode_groups...
bsd-3-clause
lucamaraschi/node-gyp
gyp/pylib/gyp/generator/gypsh.py
2779
1665
# Copyright (c) 2011 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. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
mit
damirda/ansible-modules-core
system/ping.py
59
1964
#!/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
frodopwns/readthedocs.org
readthedocs/rtd_tests/tests/test_redirects.py
10
9785
from django.test import TestCase from django.test.utils import override_settings from builds.models import Version from projects.models import Project from redirects.models import Redirect import logging class RedirectTests(TestCase): fixtures = ["eric", "test_data"] def setUp(self): logging.disabl...
mit
vitiral/micropython
tests/pyb/modtime.py
93
2570
import time DAYS_PER_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] def is_leap(year): return (year % 4) == 0 def test(): seconds = 0 wday = 5 # Jan 1, 2000 was a Saturday for year in range(2000, 2034): print("Testing %d" % year) yday = 1 for month in range(1, ...
mit
googleads/google-ads-python
google/ads/googleads/v8/services/types/batch_job_service.py
1
9360
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
BruceDLong/CodeDog
Scons/scons-local-4.1.0.post1/SCons/Tool/qt.py
4
14335
"""SCons.Tool.qt Tool-specific initialization for Qt. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of ...
gpl-2.0
DataONEorg/d1_python
utilities/src/d1_util/display_node_status.py
1
7312
#!/usr/bin/env python # This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (t...
apache-2.0
reiaaoyama/contrail-controller
src/config/svc-monitor/svc_monitor/services/loadbalancer/drivers/ha_proxy/driver.py
5
10838
# # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # import uuid import svc_monitor.services.loadbalancer.drivers.abstract_driver as abstract_driver from vnc_api.vnc_api import ServiceInstance, ServiceInstanceType from vnc_api.vnc_api import ServiceScaleOutType, ServiceInstanceInterfaceType from vnc_...
apache-2.0
azureplus/hue
desktop/core/ext-py/cx_Oracle-5.1.2/test/uCursorVar.py
34
1892
"""Module for testing cursor variables.""" import struct import sys class TestCursorVar(BaseTestCase): def testBindCursor(self): "test binding in a cursor" cursor = self.connection.cursor() self.failUnlessEqual(cursor.description, None) self.cursor.execute(u""" beg...
apache-2.0
Bulochkin/tensorflow_pack
tensorflow/tools/compatibility/testdata/test_file_v0_11.py
130
8773
# 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
ehashman/oh-mainline
vendor/packages/twisted/twisted/test/test_process.py
18
79566
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test running processes. """ import gzip import os import sys import signal import StringIO import errno import gc import stat import operator try: import fcntl except ImportError: fcntl = process = None else: from twisted.internet...
agpl-3.0
rcalland/chainer-ADDA
train.py
1
7302
import argparse import os from matplotlib import pyplot as plt import copy import chainer from chainer import optimizers, serializers from chainer.functions.evaluation import accuracy from chainer.training import extensions from chainer.datasets import tuple_dataset from chainercv.datasets import TransformDataset from...
mit
syphar/django
tests/gis_tests/geoapp/test_functions.py
8
23409
from __future__ import unicode_literals import re from decimal import Decimal from django.contrib.gis.db.models import functions from django.contrib.gis.geos import LineString, Point, Polygon, fromstr from django.contrib.gis.measure import Area from django.db import connection from django.db.models import Sum from dj...
bsd-3-clause
cloudmesh/book
examples/physics/calculated-dice-roll/higgs_classIV-seeds.py
2
2609
'''This file contains code for a the Unit "A Calculated Dice Roll. It explains random number generation''' import numpy as np import matplotlib.pyplot as plt import pylab plt.show() ''' Create two sets of random numbers with the same seed(1234567) and plot them on top of each other. As identical sets of random number...
apache-2.0
jamespcole/home-assistant
homeassistant/components/ipma/weather.py
3
6651
"""Support for IPMA weather service.""" import logging from datetime import timedelta import async_timeout import voluptuous as vol from homeassistant.components.weather import ( WeatherEntity, PLATFORM_SCHEMA, ATTR_FORECAST_CONDITION, ATTR_FORECAST_PRECIPITATION, ATTR_FORECAST_TEMP, ATTR_FORECAST_TEMP_LO...
apache-2.0
mikewiebe-ansible/ansible
lib/ansible/modules/system/group.py
3
18535
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.com> # 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': ...
gpl-3.0
faun/django_test
django/conf/locale/nn/formats.py
236
1277
DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j. F' SHORT_DATE_FORMAT = 'd.m.Y' SHORT_DATETIME_FORMAT = 'd.m.Y H:i' FIRST_DAY_OF_WEEK = 1 # Monday DATE_INPUT_FORMATS = ( '%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10...
bsd-3-clause