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
andyxhadji/incubator-airflow
tests/contrib/operators/test_hipchat_operator.py
15
2458
# -*- 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
thanhuwng/namebench
libnamebench/url_map.py
175
1680
# Copyright 2009 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 ...
apache-2.0
eeshangarg/zulip
zerver/migrations/0328_migrate_to_edit_topic_policy.py
3
1449
# Generated by Django 3.2.2 on 2021-05-26 09:43 from django.db import migrations from django.db.backends.postgresql.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps def migrate_to_edit_topic_policy(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: Realm = apps.get_...
apache-2.0
debugger06/MiroX
lib/iteminfocache.py
3
11491
# Miro - an RSS based video player application # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Participatory Culture Foundation # # 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; eithe...
gpl-2.0
twoporeguys/librpc
tools/rpcdoc/librpc_doc/__init__.py
1
4832
#!/usr/bin/env python3 # # Copyright 2017 Two Pore Guys, Inc. # All rights reserved # # Redistribution and use in source and binary forms, with or without # modification, are permitted providing that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, thi...
bsd-2-clause
TakayukiSakai/tensorflow
tensorflow/python/kernel_tests/control_flow_ops_py_test.py
2
57570
# 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
thjashin/tensorflow
tensorflow/python/saved_model/builder.py
126
1271
# 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
dyhpoon/shadowsocks
tests/test.py
26
2032
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import signal import select import time from subprocess import Popen, PIPE sys.path.insert(0, './') if sys.argv[-3] == '-c': client_config = sys.argv[-1] server_config = sys.argv[-2] elif sys.argv[-2] == '-c': client_config = sys.argv[-1] ...
mit
ellisztamas/faps
tests/test_sires.py
1
1472
from faps.sibshipCluster import sibshipCluster import numpy as np import pandas as pd import faps as fp ndraws=1000 np.random.seed(867) allele_freqs = np.random.uniform(0.3,0.5,50) adults = fp.make_parents(100, allele_freqs, family_name='a') def test_sires(): # Example with a single family progeny = fp.make_s...
mit
rs2/bokeh
bokeh/client/tests/test_states.py
2
4393
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
bsd-3-clause
Distrotech/libreoffice
solenv/gdb/libreoffice/util/uno.py
10
16697
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # # This file is part of the LibreOffice project. # # 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/. # ...
gpl-3.0
lu-ci/apex-sigma-plugins
utilities/misc/other/randombetween.py
3
1073
import secrets import discord async def randombetween(cmd, message, args): if args: if len(args) == 2: try: min_num = int(args[0]) max_num = int(args[1]) except ValueError: min_num = None max_num = None if...
gpl-3.0
sudosurootdev/external_chromium_org
tools/deep_memory_profiler/lib/dump.py
64
2298
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os LOGGER = logging.getLogger('dmprof') class Dump(object): """Represents a heap profile dump.""" def __init__(self): pass ...
bsd-3-clause
PongPi/isl-odoo
addons/account_bank_statement_extensions/report/bank_statement_balance_report.py
378
2723
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
azime/navitia
source/monitor/monitor_kraken/app.py
1
3527
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
pybursa/homeworks
aa_example/hw2/hw2_starter.py
1
1394
#!/usr/bin/env python # -*- coding: utf-8 -*- u""" Основной скрипт запуска ДЗ#2. Данный скрипт призван запускать на выполнение домашнее задание #2 путем импортирования решений из соответствующих модулей. Также выполняется комплекс тестов из модуля набора тестов. """ __author__ = "a_kosse" __email__ = "kosse@mail.me"...
gpl-2.0
40423112/2017springcd_hw
plugin/liquid_tags/graphviz.py
245
3198
""" GraphViz Tag --------- This implements a Liquid-style graphviz tag for Pelican. You can use different Graphviz programs like dot, neato, twopi etc. [1] [1] http://www.graphviz.org/ Syntax ------ {% graphviz <program> { <DOT code> } %} Examples -------- {% graphviz dot { digraph graph...
agpl-3.0
Mhynlo/SickRage
lib/unidecode/x08a.py
253
4647
data = ( 'Yan ', # 0x00 'Yan ', # 0x01 'Ding ', # 0x02 'Fu ', # 0x03 'Qiu ', # 0x04 'Qiu ', # 0x05 'Jiao ', # 0x06 'Hong ', # 0x07 'Ji ', # 0x08 'Fan ', # 0x09 'Xun ', # 0x0a 'Diao ', # 0x0b 'Hong ', # 0x0c 'Cha ', # 0x0d 'Tao ', # 0x0e 'Xu ', # 0x0f 'Jie ', # 0x10 'Yi...
gpl-3.0
mariosky/evo-drawings
venv/lib/python2.7/site-packages/numpy/polynomial/laguerre.py
51
55347
""" Objects for dealing with Laguerre series. This module provides a number of objects (mostly functions) useful for dealing with Laguerre series, including a `Laguerre` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in th...
agpl-3.0
JioCloud/ironic
ironic/openstack/common/rpc/amqp.py
2
23624
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 - 2012, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance w...
apache-2.0
TuSimple/mxnet
example/ssd/dataset/pascal_voc.py
42
10238
# 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
eyp-developers/statistics
statistics/tests/test_home.py
1
4180
from django.test import TestCase from django.urls import reverse from django.contrib.auth.models import User from statistics.views import home from ..models import Session, Committee from .helpers import create_session, create_committee, create_user_max class HomeViewTests(TestCase): def setUp(self): se...
gpl-3.0
analyseuc3m/ANALYSE-v1
lms/djangoapps/courseware/tests/test_microsites.py
12
11377
""" Tests related to the Microsites feature """ from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from nose.plugins.attrib import attr from courseware.tests.helpers import LoginEnrollmentTestCase from course_modes.models import CourseMode from...
agpl-3.0
Arcanemagus/SickRage
lib/sqlalchemy/testing/plugin/bootstrap.py
156
1634
""" Bootstrapper for nose/pytest plugins. The entire rationale for this system is to get the modules in plugin/ imported without importing all of the supporting library, so that we can set up things for testing before coverage starts. The rationale for all of plugin/ being *in* the supporting library in the first pla...
gpl-3.0
waprin/gcloud-python
gcloud/bigtable/_generated_v2/bigtable_table_admin_pb2.py
5
37797
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/bigtable/admin/v2/bigtable_table_admin.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from googl...
apache-2.0
crazyAxe/tp-libvirt
libvirt/tests/src/nwfilter/nwfilter_edit_uuid.py
4
2265
import logging import aexpect from autotest.client.shared import error from virttest import virsh from virttest import libvirt_xml from virttest import remote from provider import libvirt_version def run(test, params, env): """ Test virsh nwfilter-edit with uuid. 1) Prepare parameters. 2) Run nwf...
gpl-2.0
rob-hills/Booktype
tests/selenium_settings.py
2
6919
import os import django from unipath import Path BASE_DIR = Path(os.path.abspath(__file__)) # PROFILE PROFILE_ACTIVE = 'test' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' TEST_DISCOVER_TOP_LEVEL = BASE_DIR.parent.parent.child('lib') TEST_DISCOVER_PATTERN = 'seltest*.py' ...
agpl-3.0
krsjoseph/youtube-dl
youtube_dl/extractor/youtube.py
9
92023
# coding: utf-8 from __future__ import unicode_literals import itertools import json import os.path import re import time import traceback from .common import InfoExtractor, SearchInfoExtractor from ..jsinterp import JSInterpreter from ..swfinterp import SWFInterpreter from ..compat import ( compat_chr, com...
unlicense
CodeforHawaii/froide
froide/publicbody/south_migrations/0015_auto__chg_field_publicbody_url.py
6
10401
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from froide.helper.auth_migration_util import USER_DB_NAME APP_MODEL, APP_MODEL_NAME = 'account.User', 'account.user' class Migration(SchemaMigration): def forwards(self, orm): ...
mit
daenamkim/ansible
test/units/modules/network/f5/test_bigip_configsync_actions.py
57
4293
# -*- coding: utf-8 -*- # # Copyright 2017 F5 Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) a...
gpl-3.0
kool79/intellij-community
python/lib/Lib/site-packages/django/utils/unittest/compatibility.py
575
2096
import os import sys try: from functools import wraps except ImportError: # only needed for Python 2.4 def wraps(_): def _wraps(func): return func return _wraps __unittest = True def _relpath_nt(path, start=os.path.curdir): """Return a relative version of a path""" if...
apache-2.0
reyoung/Paddle
python/paddle/dataset/tests/voc2012_test.py
6
1359
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
mabushadi/dpxdt
config.py
1
1514
#!/usr/bin/env python # Copyright 2013 Brett Slatkin # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
mattsnow/gr-ogn
docs/doxygen/doxyxml/text.py
333
1832
# # Copyright 2010 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. # #...
mit
evgeni/dak
daklib/lintian.py
10
4430
#!/usr/bin/python """ Utility functions for lintian checks in dak @contact: Debian FTPMaster <ftpmaster@debian.org> @copyright: 2009, 2010 Joerg Jaspert <joerg@debian.org> @copyright: 2009 Chris Lamb <lamby@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you...
gpl-2.0
rothadamg/UPSITE
Utils/InteractionXML/MixSets.py
2
2053
import sys, os thisPath = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.abspath(os.path.join(thisPath,"../.."))) try: import xml.etree.cElementTree as ET except ImportError: import cElementTree as ET import Utils.ElementTreeUtils as ETUtils import RecalculateIds def mixSets(input, output, ...
mit
wazeerzulfikar/scikit-learn
sklearn/cluster/bicluster.py
11
20245
"""Spectral biclustering algorithms. Authors : Kemal Eren License: BSD 3 clause """ from abc import ABCMeta, abstractmethod import numpy as np from scipy.linalg import norm from scipy.sparse import dia_matrix, issparse from scipy.sparse.linalg import eigsh, svds from . import KMeans, MiniBatchKMeans from ..base im...
bsd-3-clause
icoxfog417/enigma_abroad
pola/machine/topic_model/gtopic_model.py
1
1937
import numpy as np from collections import namedtuple from gensim import models from pola.machine.topic_model.model import Model class GTopicModel(Model): def __init__(self, topic_count, doc, resource, **kwargs): super(GTopicModel, self).__init__(topic_count, doc, resource, **kwargs) def build(self)...
mit
helenst/django
django/core/context_processors.py
27
2462
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ from __future__ i...
bsd-3-clause
google/google-ctf
third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_zipfile.py
7
54480
# We can test part of the module without zlib. try: import zlib except ImportError: zlib = None import os import io import sys import time import shutil import struct import zipfile import unittest from StringIO import StringIO from tempfile import TemporaryFile from random import randint, ra...
apache-2.0
shaunstanislaus/PeachPy
test/x86_64/encoding/test_generic.py
6
129270
# This file is auto-generated by /codegen/x86_64_test_encoding.py # Reference opcodes are generated by: # GNU assembler (GNU Binutils) 2.25 from peachpy.x86_64 import * import unittest class TestADD(unittest.TestCase): def runTest(self): self.assertEqual(bytearray([0x04, 0x02]), ADD(al, 2).encode()) ...
bsd-2-clause
b1r3k/algorithms-design-and-analysis
part-one/programming-questions/001-number-of-inversions/solution.py
1
2094
# -*- coding: utf-8 -*- def merge_and_count_split_inv(B, C): """ >>> merge_and_count_split_inv([1, 3, 5], [2, 4, 6]) ([1, 2, 3, 4, 5, 6], 3) >>> merge_and_count_split_inv([1, 3, 5], [2, 4, 6, 7]) ([1, 2, 3, 4, 5, 6, 7], 3) >>> merge_and_count_split_inv([1, 3, 5, 6], [2, 4, 7]) ([1, 2, 3,...
mit
qrqiuren/sms-tools
software/models_interface/sineModel_function.py
21
2749
# function to call the main analysis/synthesis functions in software/models/sineModel.py import numpy as np import matplotlib.pyplot as plt from scipy.signal import get_window import os, sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/')) import utilFunctions as UF import sineM...
agpl-3.0
tectronics/peertool
languages/pt.py
2
6216
# coding: utf8 { ' days ago': ' days ago', ' hours ago': ' hours ago', ' minutes ago': ' minutes ago', ' months ago': ' months ago', ' seconds ago': ' seconds ago', ' weeks ago': ' weeks ago', ' years ago': ' years ago', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the res...
agpl-3.0
ArthurGarnier/SickRage
lib/tornado/process.py
19
12762
#!/usr/bin/env python # # Copyright 2011 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
gpl-3.0
camptocamp/QGIS
python/plugins/GdalTools/tools/doTileIndex.py
7
4271
# -*- coding: utf-8 -*- """ *************************************************************************** doTileIndex.py --------------------- Date : February 2011 Copyright : (C) 2011 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com ************...
gpl-2.0
stbarnabas/mezzanine
setup.py
1
3030
from __future__ import with_statement import os import sys exclude = ["mezzanine/project_template/dev.db", "mezzanine/project_template/local_settings.py"] if sys.argv == ["setup.py", "test"]: exclude = [] exclude = dict([(e, None) for e in exclude]) for e in exclude: if e.endswith(".py"): ...
bsd-2-clause
PennartLoettring/Poettrix
rootfs/usr/lib/python3.4/encodings/cp500.py
266
13121
""" Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
gpl-2.0
proxysh/Safejumper-for-Mac
buildlinux/env64/lib/python2.7/site-packages/twisted/words/protocols/oscar.py
9
43194
# -*- test-case-name: twisted.words.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An implementation of the OSCAR protocol, which AIM and ICQ use to communcate. Maintainer: Paul Swartz """ import struct import string import socket import random import re from hashlib import md5...
gpl-2.0
citrix-openstack-build/nova
nova/openstack/common/rpc/common.py
4
18521
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not...
apache-2.0
Lothiraldan/ZeroServices
tests/backend/__init__.py
1
11511
import asyncio from asyncio import coroutine from zeroservices import BaseService from zeroservices.resources import NoActionHandler from ..utils import test_medium, TestCase, _async_test, _create_test_resource_service try: from unittest.mock import Mock except ImportError: from mock import Mock class _Base...
mit
jmartinm/InvenioAuthorLists
modules/bibclassify/lib/bibclassify_config.py
8
9775
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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 ...
gpl-2.0
xhteam/external-chromium
testing/gmock/scripts/generator/cpp/gmock_class.py
135
6565
#!/usr/bin/env python # # Copyright 2008 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 requi...
bsd-3-clause
kaiweifan/neutron
neutron/agent/metadata/agent.py
1
8624
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 New Dream Network, LLC (DreamHost) # # 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/li...
apache-2.0
gautam1858/tensorflow
tensorflow/contrib/memory_stats/python/ops/memory_stats_ops.py
69
1531
# 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
NirBenTalLab/proorigami-cde-package
cde-root/usr/lib64/python2.4/site-packages/numpy/oldnumeric/typeconv.py
101
1622
__all__ = ['oldtype2dtype', 'convtypecode', 'convtypecode2', 'oldtypecodes'] import numpy as np oldtype2dtype = {'1': np.dtype(np.byte), 's': np.dtype(np.short), # 'i': np.dtype(np.intc), # 'l': np.dtype(int), # 'b': np.dtype(np.ubyte), ...
mit
dpetzold/django
django/contrib/humanize/templatetags/humanize.py
526
9442
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import re from datetime import date, datetime from decimal import Decimal from django import template from django.conf import settings from django.template import defaultfilters from django.utils.encoding import force_text from django.utils.formats imp...
bsd-3-clause
Ghini/ghini.desktop
bauble/plugins/garden/test.py
1
100444
# -*- coding: utf-8 -*- # # Copyright 2008-2010 Brett Adams # Copyright 2015,2017 Mario Frasca <mario@anche.no>. # Copyright 2017 Jardín Botánico de Quito # # This file is part of ghini.desktop. # # ghini.desktop is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
gpl-2.0
RaspberryCoin/RaspberryCoinCore
contrib/seeds/generate-seeds.py
71
4378
#!/usr/bin/python # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the directory tha...
mit
toshywoshy/ansible
lib/ansible/modules/network/check_point/cp_mgmt_multicast_address_range_facts.py
20
4254
#!/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
Tehsmash/networking-cisco
networking_cisco_tempest_plugin/plugin.py
2
1113
# Copyright 2017 Cisco Systems # 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...
apache-2.0
openstack/magnum
magnum/tests/unit/db/test_x509keypair.py
2
4403
# Copyright 2015 NEC 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 required b...
apache-2.0
deevarvar/myLab
baidu_code/soap_mockserver/spyne/test/model/test_primitive.py
1
25489
#!/usr/bin/env python # coding=utf-8 # # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your optio...
mit
klenks/jobsportal
venv/lib/python2.7/site-packages/pip/_vendor/progress/__init__.py
916
3023
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE A...
mit
sivel/ansible
examples/scripts/my_test.py
29
4168
#!/usr/bin/python # Copyright: (c) 2018, Terry Jones <terry.jones@example.org> # 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 DOCUMENTATION = r''' --- module: my_test short_descriptio...
gpl-3.0
ThomasMarcel/webapp-course
resources/gae-boilerplate/bp_includes/external/requests/packages/chardet/langcyrillicmodel.py
2762
17725
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
apache-2.0
yg257/Pangea
templates/root/ec2/lib/boto-2.34.0/boto/cloudsearch2/domain.py
153
21247
# 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 rights ...
apache-2.0
fintanr/genguidepages
genGuidePages.py
1
2606
#!/usr/bin/python # import json import argparse import re def updateConfig(gp, op, configJson): for guide in configJson['guides']: inFile = gp + "/" + guide['indir'] + "/README.md" inImage = gp + "/" + guide['image'] outFile = op + "/" + guide['outfile'] outImage = op + "/" + gu...
apache-2.0
harlowja/networkx
networkx/algorithms/bipartite/tests/test_matrix.py
45
3199
#!/usr/bin/env python from nose.tools import * from nose import SkipTest import networkx as nx from networkx.algorithms import bipartite from networkx.testing.utils import assert_edges_equal class TestBiadjacencyMatrix: @classmethod def setupClass(cls): global np, sp, sparse, np_assert_equal tr...
bsd-3-clause
apple/llvm-project
llvm/bindings/python/llvm/tests/test_object.py
36
2201
from numbers import Integral from .base import TestBase from ..object import ObjectFile from ..object import Relocation from ..object import Section from ..object import Symbol class TestObjectFile(TestBase): def get_object_file(self): source = self.get_test_binary() return ObjectFile(filename=sou...
apache-2.0
Lh4cKg/kivy
examples/RST_Editor/main.py
20
1631
#!/usr/bin/env python from kivy.app import App from kivy.uix.floatlayout import FloatLayout from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.uix.popup import Popup import os class LoadDialog(FloatLayout): load = ObjectProperty(None) cancel = ObjectProperty(None) class Sa...
lgpl-3.0
talau/ns-3-tcp-red
bindings/python/apidefs/gcc-ILP32/ns3_module_flow_monitor.py
3
26117
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() ## histogram.h: ns3::Histogram [class] module.add_class('Histogram') ## simple-ref-count.h: ns3::SimpleRefCount<ns3::FlowClassifier, ns3::empty, ns3::Defaul...
gpl-2.0
GreenLunar/Bookie
bookie/tests/test_auth/test_model.py
6
9325
"""Test the Auth model setup""" from unittest import TestCase from pyramid import testing from datetime import ( datetime, timedelta, ) from bookie.models import DBSession from bookie.models.auth import Activation from bookie.models.auth import User from bookie.models.auth import UserMgr from bookie.tests im...
agpl-3.0
chouseknecht/openshift-restclient-python
openshift/test/test_authorization_openshift_io_api.py
1
4236
# 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
amir-qayyum-khan/edx-platform
lms/djangoapps/verify_student/management/commands/set_software_secure_status.py
63
2223
""" Manually set Software Secure verification status. """ import sys from django.core.management.base import BaseCommand from lms.djangoapps.verify_student.models import ( SoftwareSecurePhotoVerification, VerificationCheckpoint, VerificationStatus ) class Command(BaseCommand): """ Command to trigger the...
agpl-3.0
JohnnyKing94/pootle
pootle/apps/virtualfolder/migrations/0002_set_unit_priorities.py
8
1820
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.exceptions import FieldError from django.db import models, migrations def forwards_units(apps, schema_editor): Unit = apps.get_model("pootle_store", "Unit") VirtualFolder = apps.get_model("virtualfolder", "VirtualFolder") db...
gpl-3.0
sajeeshcs/nested_quota
nova/tests/api/openstack/compute/contrib/test_neutron_security_groups.py
6
38529
# Copyright 2013 Nicira, 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 a...
apache-2.0
fladi/django-downloadview
demo/demoproject/apache/tests.py
3
1430
import os from django.core.files.base import ContentFile from django.core.urlresolvers import reverse import django.test from django_downloadview.apache import assert_x_sendfile from demoproject.apache.views import storage, storage_dir def setup_file(): if not os.path.exists(storage_dir): os.makedirs(s...
bsd-3-clause
ChrisSwanson/NetDiag
scan/core.py
1
1643
import Queue import threading import sys import netaddr import nmap class Scanner(object): """Multi-threaded python script to scan multiple netblocks using nmap.""" def __init__(self, nmap_args='-T4 -F', subnets=None, threads=10): self.q = Queue.Queue() self.results = Queue.Queue() se...
apache-2.0
petrutlucian94/nova_dev
nova/tests/api/openstack/compute/contrib/test_server_password.py
41
2958
# Copyright 2012 Nebula, 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 ...
apache-2.0
mrquim/mrquimrepo
repo/script.module.youtube.dl/lib/youtube_dl/extractor/rai.py
11
16660
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urlparse, compat_str, ) from ..utils import ( ExtractorError, determine_ext, find_xpath_attr, fix_xml_ampersands, GeoRestrictedError, int_or_none, parse_duration, s...
gpl-2.0
normanmaurer/autobahntestsuite-maven-plugin
src/main/resources/twisted/mail/test/test_mail.py
3
71738
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for large portions of L{twisted.mail}. """ import os import errno import shutil import pickle import StringIO import rfc822 import tempfile import signal from hashlib import md5 from zope.interface.verify import verifyClass from zope.i...
apache-2.0
ujenmr/ansible
lib/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py
5
10704
#!/usr/bin/python # # Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.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': '1.1', ...
gpl-3.0
thomastu/django-wiki
wiki/plugins/links/mdx/urlize.py
16
3384
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals """ Code modified from: https://github.com/r0wb0t/markdown-urlize A more liberal autolinker Inspired by Django's urlize function. Positive examples: >>> import markdown >>> md = markdown.Markdown(extensions=['urli...
gpl-3.0
lgarren/spack
var/spack/repos/builtin/packages/pocl/package.py
1
4901
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Learningtribes/edx-platform
common/djangoapps/embargo/tests/test_forms.py
132
4829
# -*- coding: utf-8 -*- """ Unit tests for embargo app admin forms. """ from django.test import TestCase from opaque_keys.edx.locator import CourseLocator # Explicitly import the cache from ConfigurationModel so we can reset it after each test from config_models.models import cache from embargo.models import IPFilte...
agpl-3.0
gmacchi93/serverInfoParaguay
apps/venv/lib/python2.7/site-packages/django/conf/urls/i18n.py
113
1193
import warnings from django.conf import settings from django.conf.urls import patterns, url from django.core.urlresolvers import LocaleRegexURLResolver from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning from django.views.i18n import set_language def i18n_patterns(prefix, *args...
apache-2.0
richardliaw/ray
rllib/examples/policy/random_policy.py
2
2192
import random import numpy as np from gym.spaces import Box from ray.rllib.policy.policy import Policy from ray.rllib.utils.annotations import override from ray.rllib.utils.typing import ModelWeights class RandomPolicy(Policy): """Hand-coded policy that returns random actions.""" def __init__(self, *args, ...
apache-2.0
youprofit/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/__init__.py
552
8263
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
thomasrstorey/recipesfordisaster
actions/lay.py
1
3723
''' lay.py Takes a list of input ingredient names. Rotates and/or shifts each ingredient slightly, importing it to the scene if it is not already there. Thomas Storey 2016 ''' import sys import argparse import bpy import numpy as np import os import bmesh from math import * from mathutils import * import random de...
mit
tempbottle/kbengine
kbe/src/lib/python/Tools/scripts/analyze_dxp.py
122
4183
""" Some helper functions to analyze the output of sys.getdxp() (which is only available if Python was built with -DDYNAMIC_EXECUTION_PROFILE). These will tell you which opcodes have been executed most frequently in the current process, and, if Python was also built with -DDXPAIRS, will tell you which instruction _pair...
lgpl-3.0
JBonsink/GSOC-2013
tools/ns-allinone-3.14.1/ns-3.14.1/src/internet/bindings/callbacks_list.py
24
2249
callback_classes = [ ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ipv4Address', 'unsigned char', 'unsigned char', 'unsigned char', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ...
gpl-3.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/models/cognitive_mapping_and_planning/tfcode/cmp_utils.py
14
6936
# 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 applicab...
bsd-2-clause
mcus/SickRage
sickbeard/providers/bitcannon.py
3
4559
# -*- coding: utf-8 -*- # Author: miigotu <miigotu@gmail.com> # URL: http://github.com/SiCKRAGETV/SickRage # # This file is part of SickRage. # # SickRage 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...
gpl-3.0
rymate1234/rymate-blog
rymate_blog/settings.py
5
1323
# -*- coding: utf-8 -*- import os class Config(object): SECRET_KEY = 'shhhh' # TODO: Change me APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir)) BCRYPT_LOG_ROUNDS = 13 ASSETS_DEBUG = False DEBUG_TB_ENABLED =...
bsd-3-clause
syci/OCB
openerp/tools/translate.py
4
47731
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import codecs import csv import fnmatch import inspect import locale import os import openerp.sql_db as sql_db import re import logging import tarfile import tempfile import threading from babel.messages import extract f...
agpl-3.0
nirmeshk/oh-mainline
vendor/packages/Django/tests/regressiontests/expressions_regress/tests.py
46
15966
""" Spanning tests for all the operations that F() expressions can perform. """ from __future__ import absolute_import import datetime from django.db import connection from django.db.models import F from django.test import TestCase, Approximate, skipUnlessDBFeature from .models import Number, Experiment class Expr...
agpl-3.0
trondeau/gnuradio
gr-filter/python/filter/qa_hilbert.py
47
2208
#!/usr/bin/env python # # Copyright 2004,2007,2010,2012,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...
gpl-3.0
gangadharkadam/contributionerp
erpnext/selling/doctype/sales_order/test_sales_order.py
7
12306
# 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 from frappe.utils import flt, add_days import frappe.permissions import unittest from erpnext.selling.doctype.sales_order.sales_order \ im...
agpl-3.0
mvdriel/ansible-modules-core
cloud/openstack/_nova_compute.py
66
22440
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # (c) 2013, John Dewey <john@dewey.ws> # # 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 Li...
gpl-3.0