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
alien4cloud/alien4cloud-cloudify3-provider
alien4cloud-cloudify3-provider/src/test/resources/outputs/blueprints/openstack/tomcat/device-mapping-scripts/mapping.py
16
7152
def parse_output(output): # by convention, the last output is the result of the operation last_output = None outputs = {} pattern = re.compile('EXPECTED_OUTPUT_(\w+)=(.*)') for line in output.splitlines(): match = pattern.match(line) if match is None: last_output = line ...
apache-2.0
vwvww/servo
tests/wpt/web-platform-tests/infrastructure/assumptions/tools/ahem-generate-table.py
58
2992
from __future__ import print_function, unicode_literals import itertools import unicodedata from fontTools.ttLib import TTFont try: chr(0x100) except ValueError: chr = unichr def grouper(n, iterable): """ >>> list(grouper(3, 'ABCDEFG')) [['A', 'B', 'C'], ['D', 'E', 'F'], ['G']] """ itera...
mpl-2.0
CameronTEllis/brainiak
brainiak/hyperparamopt/hpo.py
5
11683
# Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
technoapurva/css
spkm.py
2
4158
#!/usr/bin/env python """ @package css @file css/spkm.py @author Edward Hunter @brief Spherical k-means core algorithm and support routines. """ # Copyright and licence. """ Copyright (C) 2014 Edward Hunter edward.a.hunter@gmail.com 840 24th Street San Diego, CA 92102 This program is free software: you can redistrib...
gpl-3.0
philipgian/pre-commit
tests/make_archives_test.py
1
1979
from __future__ import absolute_import from __future__ import unicode_literals import os.path import tarfile import mock import pytest from pre_commit import make_archives from pre_commit.util import cmd_output from pre_commit.util import cwd from testing.fixtures import git_dir from testing.util import get_head_sha...
mit
svagionitis/youtube-dl
youtube_dl/extractor/gameone.py
6
3870
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( xpath_with_ns, parse_iso8601 ) NAMESPACE_MAP = { 'media': 'http://search.yahoo.com/mrss/', } # URL prefix to download the mp4 files directly instead of streaming via rtmp # Credits g...
unlicense
Ledoux/ShareYourSystem
Pythonlogy/ShareYourSystem/Standards/Tutorials/_Drafts/Distance/__init__.py
1
4579
#<ImportSpecificModules> import ShareYourSystem as SYS import numpy as np import scipy.stats from tables import * import time import operator import os #</ImportSpecificModules> #<DefineLocals> #</DefineLocals> #<DefineClass> class DistanceClass(SYS.ObjectsClass): #<DefineHookMethods> def initAfter(self): #<Def...
mit
slimta/python-slimta
slimta/util/__init__.py
1
4971
# Copyright (c) 2016 Ian C. Good # # 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, publish, distrib...
mit
XiaosongWei/crosswalk-test-suite
wrt/wrt-manifest2-android-tests/manifest2/name_null_value.py
4
2252
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
bsd-3-clause
Azure/azure-sdk-for-python
sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/_configuration.py
1
3204
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
jeromecc/doctoctocbot
src/crowdfunding/migrations/0013_tiers.py
1
1118
# Generated by Django 2.0.13 on 2019-02-25 05:21 from decimal import Decimal from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('crowdfunding', '0012_auto_20190224_0523'), ] operations = [ migrations.CreateM...
mpl-2.0
zack3241/incubator-airflow
airflow/migrations/versions/1507a7289a2f_create_is_encrypted.py
46
1959
# -*- 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
yanni4night/ursa-django
app/settings.py
1
2208
""" Django settings for ursa-django project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
mit
bodi000/odoo
addons/portal_project/tests/__init__.py
170
1124
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
kho0810/likelion_Web
lib/jinja2/testsuite/core_tags.py
412
11858
# -*- coding: utf-8 -*- """ jinja2.testsuite.core_tags ~~~~~~~~~~~~~~~~~~~~~~~~~~ Test the core tags like for and if. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment...
apache-2.0
adviti/melange
thirdparty/google_appengine/lib/django_1_2/tests/modeltests/model_inheritance_same_model_name/tests.py
54
1510
from django.test import TestCase from modeltests.model_inheritance.models import Title class InheritanceSameModelNameTests(TestCase): def setUp(self): # The Title model has distinct accessors for both # model_inheritance.Copy and model_inheritance_same_model_name.Copy # models. sel...
apache-2.0
luzpaz/QGIS
tests/src/python/test_qgslinesegment.py
45
5434
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLineSegment2D. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ ...
gpl-2.0
slightlymadphoenix/activityPointsApp
activitypoints/lib/python3.5/site-packages/wheel/pep425tags.py
70
5760
"""Generate and work with PEP 425 Compatibility Tags.""" import distutils.util import platform import sys import sysconfig import warnings def get_config_var(var): try: return sysconfig.get_config_var(var) except IOError as e: # pip Issue #1074 warnings.warn("{0}".format(e), RuntimeWarning) ...
mit
sarantapichos/faircoop-market
addons/account/account_analytic_line.py
304
7914
# -*- 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
AccelAI/accel.ai
flask-aws/lib/python2.7/site-packages/requests/exceptions.py
352
2776
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request.""...
mit
jart/tensorflow
tensorflow/python/training/checkpointable/tracking_test.py
2
6361
# 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
thelazier/dash
qa/rpc-tests/bip68-112-113-p2p.py
40
27355
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from...
mit
balister/GNU-Radio
gr-digital/python/digital/qa_costas_loop_cc.py
12
4967
#!/usr/bin/env python # # Copyright 2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your opt...
gpl-3.0
Mtax/xadmin
xadmin/views/list.py
6
25794
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist from django.core.paginator import InvalidPage, Paginator from django.db import models from django.http import HttpResponseRedirect from django.template.response import SimpleTemplateResponse, TemplateResponse from django.utils.datastructures import...
bsd-3-clause
charbeljc/hr
__unported__/hr_public_holidays/__openerp__.py
18
1366
# -*- coding:utf-8 -*- # # # Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation...
agpl-3.0
lmprice/ansible
lib/ansible/modules/source_control/gitlab_project.py
50
14738
#!/usr/bin/python # (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) # 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', ...
gpl-3.0
fluxcapacitor/source.ml
jupyterhub.ml/notebooks/train_deploy/zz_under_construction/zz_old/TensorFlow/GoogleTraining/workshop_sections/transfer_learning/TF_Estimator/transfer_learning.py
3
33478
# 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
chiefspace/udemy-rest-api
udemy_rest_api_section6/env/lib/python3.4/site-packages/setuptools/tests/test_dist_info.py
452
2615
"""Test .dist-info style distributions. """ import os import shutil import tempfile import unittest import textwrap try: import ast except: pass import pkg_resources from setuptools.tests.py26compat import skipIf def DALS(s): "dedent and left-strip" return textwrap.dedent(s).lstrip() class TestDist...
gpl-2.0
alexgleith/Quantum-GIS
tests/src/python/test_qgsblendmodes.py
2
7485
# -*- coding: utf-8 -*- """ *************************************************************************** test_qgsblendmodes.py --------------------- Date : May 2013 Copyright : (C) 2013 by Nyall Dawson, Massimo Endrighi Email : nyall dot dawson at gmail.com ...
gpl-2.0
iotaledger/iota.lib.py
iota/multisig/commands/prepare_multisig_transfer.py
1
5102
from typing import List, Optional import filters as f from iota import Address, ProposedTransaction from iota.commands import FilterCommand, RequestFilter from iota.commands.core import GetBalancesCommand from iota.exceptions import with_context from iota.filters import Trytes from iota.multisig.transaction import Pr...
mit
sahiljain/catapult
telemetry/telemetry/testing/progress_reporter_unittest.py
31
1547
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.testing import progress_reporter class TestFoo(unittest.TestCase): # Test method doesn't have test- prefix intentionally....
bsd-3-clause
google-research/google-research
smu/parser/smu_utils_lib_test.py
1
35529
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
sonaht/ansible
lib/ansible/modules/cloud/amazon/s3_lifecycle.py
71
15738
#!/usr/bin/python # # This is a 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 Ansible library is distributed in the hope that i...
gpl-3.0
jchevin/MissionPlanner-master
packages/IronPython.StdLib.2.7.4/content/Lib/token.py
178
2944
#! /usr/bin/env python """Token constants (from "token.h").""" # This file is automatically generated; please don't muck it up! # # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # # python Lib/token.py #--start constants-- ENDM...
gpl-3.0
alexis-roche/nipy
nipy/testing/__init__.py
2
1369
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The testing directory contains a small set of imaging files to be used for doctests only. More thorough tests and example data will be stored in a nipy data packages that you can download separately. ....
bsd-3-clause
pgmillon/ansible
lib/ansible/modules/network/meraki/meraki_syslog.py
10
9172
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.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 ANSIBLE_METADATA = { ...
gpl-3.0
exercism/python
exercises/practice/bank-account/bank_account_test.py
4
4133
import sys import threading import time import unittest from bank_account import BankAccount class BankAccountTest(unittest.TestCase): def test_newly_opened_account_has_zero_balance(self): account = BankAccount() account.open() self.assertEqual(account.get_balance(), 0) def test_can_...
mit
openstack/mistral
mistral/api/controllers/v2/execution.py
1
17181
# Copyright 2013 - Mirantis, Inc. # Copyright 2015 - StackStorm, Inc. # Copyright 2015 Huawei Technologies Co., Ltd. # Copyright 2016 - Brocade Communications Systems, Inc. # Copyright 2018 - Extreme Networks, Inc. # Copyright 2019 - NetCracker Technology Corp. # # Licensed under the Apache License, Version 2.0 (the...
apache-2.0
zeroc0d3lab/centos-ruby
rootfs/usr/lib/python2.7/dist-packages/powerline/ipython.py
14
1687
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) from powerline import Powerline from powerline.lib.dict import mergedicts from powerline.lib.unicode import string class IPythonInfo(object): def __init__(self, shell): self._shell = shell @propert...
gpl-2.0
wwj718/edx-platform
lms/djangoapps/teams/management/commands/tests/test_reindex_course_team.py
33
3091
""" Tests for course_team reindex command """ import ddt import mock from mock import patch from django.core.management import call_command, CommandError from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from opaque_keys.edx.keys import CourseKey from ....tests.factories import CourseTeamFac...
agpl-3.0
DinoCow/airflow
tests/providers/google/cloud/operators/test_cloud_build_system.py
10
2023
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
fjferrer/angr
angr/analyses/vsa_ddg.py
9
6157
from .datagraph_meta import DataGraphMeta, DataGraphError import logging import networkx import collections import simuvex l = logging.getLogger(name="angr.analyses.vsa_ddg") class VSA_DDG(DataGraphMeta): """ A Data dependency graph based on VSA states. That means we don't (and shouldn't) expect any symb...
bsd-2-clause
madrang/pyTSon-AudioBot
requests/utils.py
17
27595
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import cgi import codecs import collections import contextlib import io import os import platform import re import socket import struct imp...
gpl-3.0
mozilla/inventory
truth/models.py
3
1262
from django.db import models from systems.models import ScheduledTask from django.db import IntegrityError import pdb # Create your models here. class Truth(models.Model): name = models.CharField(max_length=128) description = models.CharField(max_length=128) def __unicode__(self): return self.nam...
bsd-3-clause
kgullikson88/TS23-Scripts
CheckSyntheticTemperature.py
1
14868
import os import re from collections import defaultdict from operator import itemgetter import logging import pandas from scipy.interpolate import InterpolatedUnivariateSpline as spline from george import kernels import matplotlib.pyplot as plt import numpy as np import george import emcee import StarData import Spect...
gpl-3.0
codester2/devide.johannes
install_packages/ip_matplotlib.py
5
5932
# Copyright (c) Charl P. Botha, TU Delft. # All rights reserved. # See COPYRIGHT for details. import config from install_package import InstallPackage import os import shutil import sys import utils from distutils import sysconfig MPL_VER = "1.1.0" if os.name == 'posix': MPL_ARCHIVE = "matplotlib-%s.tar.gz" % (M...
bsd-3-clause
laiqiqi886/kbengine
kbe/src/lib/python/Lib/test/test_ossaudiodev.py
97
7216
from test import support support.requires('audio') from test.support import findfile ossaudiodev = support.import_module('ossaudiodev') import errno import sys import sunau import time import audioop import unittest # Arggh, AFMT_S16_NE not defined on all platforms -- seems to be a # fairly recent addition to OSS. ...
lgpl-3.0
jhd/spunout
flask/lib/python2.7/site-packages/pip/_vendor/requests/auth.py
294
6173
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import logging from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import pars...
gpl-3.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/oauth2client/oauth2client/gce.py
12
3515
# 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 by applicable law or ...
bsd-3-clause
eriser/marsyas
scripts/large-evaluators/eval_manager.py
5
1222
#!/usr/bin/env python import multiprocessing class EvalManager(): def __init__(self, num_processes=4): """ Sets up infrastructure with the desired number of processes.""" self.pool = multiprocessing.Pool(processes=num_processes) self.manager = multiprocessing.Manager() self...
gpl-2.0
fjbatresv/odoo
addons/account/edi/__init__.py
450
1062
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
wong2/sentry
src/sentry/event_manager.py
2
19299
""" sentry.event_manager ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import logging import math import six from datetime import datetime, timedelta from django....
bsd-3-clause
MattDevo/edk2
BaseTools/Source/Python/Workspace/MetaFileTable.py
1
16975
## @file # This file is used to create/update/query/erase a meta file table # # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribu...
bsd-2-clause
SUSE/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/containerservice/v2017_01_31/models/container_service.py
2
5339
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
ssharpjr/taskbuster-boilerplate
taskbuster/apps/taskmanager/models.py
1
2262
# -*- coding: utf-8 -*- from django.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.dispatch import receiver from django.db.models.signals import post_save from django.core.validators import RegexValidator from . import managers class Profile(mode...
mit
pothosware/gnuradio
gr-filter/python/filter/optfir.py
45
12761
# # Copyright 2004,2005,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 ve...
gpl-3.0
eerorika/ansible
lib/ansible/utils/module_docs_fragments/nxos.py
6
3368
# # (c) 2015, Peter Sprygada <psprygada@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 # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
unindented/streamcode
client/static/jsrepl/extern/python/reloop-closured/lib/python2.7/email/mime/application.py
414
1256
# Copyright (C) 2001-2006 Python Software Foundation # Author: Keith Dart # Contact: email-sig@python.org """Class representing application/* type MIME documents.""" __all__ = ["MIMEApplication"] from email import encoders from email.mime.nonmultipart import MIMENonMultipart class MIMEApplication(MIMENonMultipart)...
mit
zhanghenry/stocks
tests/introspection/models.py
103
1079
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Reporter(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) email = models.EmailField(...
bsd-3-clause
darionyaphet/flink
flink-python/pyflink/table/sources.py
17
4602
################################################################################ # 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...
apache-2.0
jeffstaley/cyflash
cyflash/cyacd_test.py
1
1628
from cStringIO import StringIO import unittest import cyacd class BootloaderRowTest(unittest.TestCase): def testParseRow(self): rowdata = ":000018008000100020110C0000E92D0000E92D000008B5024B83F3088802F0E8F800100020F8B572B6002406236343704D0134EE187279707831793778B3781202F67800020A4338431904084337063843002103F09FF8...
bsd-2-clause
ArcherCraftStore/ArcherVMPeridot
Python/Lib/encodings/shift_jis_2004.py
816
1059
# # shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jis_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEnc...
apache-2.0
ashmastaflash/gwdetect
dependencies/netaddr-0.7.10/build/lib/netaddr/tests/__init__.py
9
2319
#!/usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2008-2012, David P. D. Moss. All rights reserved. # # Released under the BSD license. See the LICENSE file for details. #----------------------------------------------------------------------------- ...
mit
chouseknecht/openshift-restclient-python
openshift/test/test_v1_service_account_restriction.py
1
4339
# coding: utf-8 """ OpenShift API (with Kubernetes) OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is...
apache-2.0
mjfarmer/scada_py
env/lib/python2.7/site-packages/pip/__init__.py
19
12070
#!/usr/bin/env python import os import optparse import sys import re import errno # Upstream pip vendorizes a bunch of its dependencies. Debian de-vendorizes # (unbundles) these dependencies to be compliant with Debian policy. Instead, # these dependencies are packaged as wheel (.whl) files in a known location. # W...
gpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Tools/pybench/With.py
43
4137
from __future__ import with_statement from pybench import Test class WithFinally(Test): version = 2.0 operations = 20 rounds = 80000 class ContextManager(object): def __enter__(self): pass def __exit__(self, exc, val, tb): pass def test(self): cm ...
mit
CitoEngine/cito_engine
app/cito_engine/actions/json_formatter.py
1
1266
"""Copyright 2014 Cyrus Dasadia 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 distr...
apache-2.0
ymcagodme/Norwalk-Judo
django/contrib/gis/gdal/feature.py
321
3998
# The GDAL C library, OGR exception, and the Field object from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException, OGRIndexError from django.contrib.gis.gdal.field import Field from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType from django.contrib.gi...
bsd-3-clause
mdibaiee/servo
tests/wpt/css-tests/tools/html5lib/html5lib/filters/lint.py
979
4306
from __future__ import absolute_import, division, unicode_literals from gettext import gettext _ = gettext from . import _base from ..constants import cdataElements, rcdataElements, voidElements from ..constants import spaceCharacters spaceCharacters = "".join(spaceCharacters) class LintError(Exception): pass ...
mpl-2.0
quantumlib/Cirq
dev_tools/profiling/benchmark_serializers.py
1
4296
# Copyright 2020 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
onitake/ansible
test/units/modules/network/netscaler/test_netscaler_gslb_site.py
68
24193
# Copyright (c) 2017 Citrix Systems # # 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. # # ...
gpl-3.0
LarsMq73/Greenfield
src/client/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/eclipse.py
437
11894
# 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. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
mit
tungvx/deploy
.google_appengine/lib/django_0_96/django/db/backends/mysql_old/base.py
32
7830
""" MySQL database backend for Django. Requires MySQLdb: http://sourceforge.net/projects/mysql-python """ from django.db.backends import util try: import MySQLdb as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured, "Error loading MySQLdb mo...
apache-2.0
Chetox/RCode
Cannon_Avanzado/client.py
1
2002
#!/usr/bin/python # -*- coding:utf-8; tab-width:4; mode:python -*- import sys import Ice Ice.loadSlice('-I {} cannon.ice'.format(Ice.getSliceDir())) import Cannon import time from matrix_utils import matrix_multiply def load_matrix_from_file(filename): with file(filename) as f: rows = f.readlines() ...
apache-2.0
Dhivyap/ansible
test/units/modules/network/fortios/test_fortios_wireless_controller_wtp_profile.py
20
17499
# 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
aselle/tensorflow
tensorflow/contrib/kinesis/__init__.py
31
1069
# Copyright 2018 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
doronkatz/firefox-ios
scripts/clean-xliff.py
41
2284
#! /usr/bin/env python # # clean-xliff.py <l10n_folder> # # Remove targets from a locale, remove target-language attribute # from glob import glob from lxml import etree import argparse import os NS = {'x':'urn:oasis:names:tc:xliff:document:1.2'} def indent(elem, level=0): # Prettify XML output # http://eff...
mpl-2.0
crazy-canux/django
django/contrib/messages/storage/cookie.py
471
6545
import json from django.conf import settings from django.contrib.messages.storage.base import BaseStorage, Message from django.http import SimpleCookie from django.utils import six from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.safestring import SafeData, mark_safe class Message...
bsd-3-clause
yongshengwang/hue
build/env/lib/python2.7/site-packages/logilab_common-1.0.2-py2.7.egg/logilab/common/tasksqueue.py
93
2987
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
apache-2.0
bitcraze/crazyflie-lib-python
test/crtp/test_crtpstack.py
1
2875
# -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) Bitcraze AB # # Crazyfl...
gpl-2.0
dednal/chromium.src
tools/telemetry/telemetry/value/__init__.py
35
11178
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ The Value hierarchy provides a way of representing the values measurements produce such that they can be merged across runs, grouped by page, and output t...
bsd-3-clause
csixteen/HackerRank_Python
Algorithms/magic_square.py
1
1071
class Solution(object): MAGIC_SQUARES = [ [4, 9, 2, 3, 5, 7, 8, 1, 6], [2, 9, 4, 7, 5, 3, 6, 1, 8], [8, 3, 4, 1, 5, 9, 6, 7, 2], [4, 3, 8, 9, 5, 1, 2, 7, 6], [6, 1, 8, 7, 5, 3, 2, 9, 4], [8, 1, 6, 3, 5, 7, 4, 9, 2], [6, 7, 2, 1, 5, 9, 8, 3, 4], [2, 7, ...
mit
Nu3001/external_chromium_org
tools/telemetry/telemetry/page/actions/seek.py
23
2205
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A Telemetry page_action that performs the "seek" action on media elements. Action attributes are: - seek_time: The media time to seek to. Test fails if n...
bsd-3-clause
alexpap/exareme
exareme-tools/madis/src/functionslocal/aggregate/approximatedmedian.py
1
2110
import inspect import math import random import numpy from fractions import Fraction import sys import json from array import * class approximatedmedian: registered = True #Value to define db operator def __init__(self): self.n = 0 self.totalnums = 0 self.numberofcolumns = 5 ...
mit
kunaltyagi/nsiqcppstyle
rules/RULE_4_1_B_locate_each_enum_item_in_seperate_line.py
1
3034
""" Locate the each enum item in seperate lines. == Violation == enum A { A_A, A_B <== Violation } == Good == enum A { A_A, <== Good A_B } """ from nsiqunittest.nsiqcppstyle_unittestbase import * from nsiqcppstyle_rulehelper import * from nsiqcppstyle_...
gpl-2.0
colmmacc/s2n
tests/integrationv2/processes.py
3
14984
import time import os import select import selectors import subprocess import threading from common import Results, TimeoutException from time import monotonic as _time _PopenSelector = selectors.PollSelector _PIPE_BUF = getattr(select, 'PIPE_BUF', 512) class _processCommunicator(object): """ This class al...
apache-2.0
i17c/selenium
py/selenium/webdriver/safari/service.py
71
2879
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
Tejal011089/fbd_erpnext
erpnext/stock/doctype/stock_entry/test_stock_entry.py
6
22688
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, unittest import frappe.defaults from frappe.utils import flt, nowdate, nowtime from erpnext.stock.doctype.serial_no.serial_no import * fr...
agpl-3.0
zhuanxuhit/deep-learning
embeddings/utils.py
150
2194
import re from collections import Counter def preprocess(text): # Replace punctuation with tokens so we can use them in our model text = text.lower() text = text.replace('.', ' <PERIOD> ') text = text.replace(',', ' <COMMA> ') text = text.replace('"', ' <QUOTATION_MARK> ') text = text.replace(...
mit
MOSAIC-UA/802.11ah-ns3
ns-3/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Tools/cxx.py
20
1217
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file from waflib import TaskGen,Task from waflib.Tools import c_preproc from waflib.Tools.ccroot import link_task,stlink_task @TaskGen.extension('.cpp','.cc','.cxx','.C','.c++') def cxx_hook(self,node): ...
gpl-2.0
noba3/KoTos
addons/script.module.youtube.dl/lib/youtube_dl/extractor/zdf.py
12
6292
# coding: utf-8 from __future__ import unicode_literals import functools import re from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, OnDemandPagedList, xpath_text, ) def extract_from_xml_url(ie, video_id, xml_url): doc = ie._download_xml( xml_url, vide...
gpl-2.0
bruderstein/PythonScript
PythonLib/full/unittest/test/testmock/testmagicmethods.py
6
16243
import math import unittest import os from asyncio import iscoroutinefunction from unittest.mock import AsyncMock, Mock, MagicMock, _magics class TestMockingMagicMethods(unittest.TestCase): def test_deleting_magic_methods(self): mock = Mock() self.assertFalse(hasattr(mock, '__getitem__')) ...
gpl-2.0
TNick/pylearn2
pylearn2/utils/utlc.py
49
7347
"""Several utilities for experimenting upon utlc datasets""" # Standard library imports import logging import os import inspect import zipfile from tempfile import TemporaryFile # Third-party imports import numpy import theano from pylearn2.datasets.utlc import load_ndarray_dataset, load_sparse_dataset from pylearn2.u...
bsd-3-clause
QuLogic/vispy
vispy/app/_default_app.py
21
2422
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from .application import Application # Initialize default app # Only for use within *this* module. # One should always call use_app() to obtain the default app. default_app =...
bsd-3-clause
fishtown-analytics/dbt
test/integration/041_presto_test/test_simple_presto_view.py
1
2230
from test.integration.base import DBTIntegrationTest, FakeArgs, use_profile import random import time class TestBasePrestoRun(DBTIntegrationTest): @property def schema(self): return "presto_test_41" @property def models(self): return "models" @property def project_config(sel...
apache-2.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/numpy-1.9.2/numpy/lib/arrayterator.py
52
7282
""" A buffered iterator for big arrays. This module solves the problem of iterating over a big file-based array without having to read it into memory. The `Arrayterator` class wraps an array object, and when iterated it will return sub-arrays with at most a user-specified number of elements. """ from __future__ impor...
mit
nihlaeth/Nagios_check_slackpkg
check_slackpkg_nonpriv.py
1
1673
#!/usr/bin/env python """Nagios module for monitoring available updates via slackpkg.""" import subprocess import sys import os # pylint: disable=invalid-name # run check-updates to poll mirror for changes result = [] try: result = subprocess.check_output("myslackpkg check-updates", shell=True).split("\n") excep...
gpl-3.0
vshtanko/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
258
4609
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
haphaeu/yoshimi
sql/data_analysis/database.py
1
3122
from os import path from sqlalchemy import (create_engine, Column, String, Integer, Boolean, Table, ForeignKey) from sqlalchemy.orm import sessionmaker, relationship from sql...
lgpl-3.0
cherusk/ansible
lib/ansible/executor/playbook_executor.py
57
12811
# (c) 2012-2014, 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) an...
gpl-3.0