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 |
|---|---|---|---|---|---|
alpire/picoCTF-web | unit_tests/common.py | 1 | 2755 | # coding: utf-8
"""
Common Testing Functionality.
"""
import api
from functools import wraps
base_team = {
"team_name": "team¢",
"school": "Test HS",
"password": "much_protected",
"eligible": True
}
new_team_user = {
"username": "valid",
"firstname": "Fred",
"lastname": "Hacker",
"p... | mit |
juicer/juicer | juicer/common/RPM.py | 2 | 1984 | # -*- coding: utf-8 -*-
# Juicer - Administer Pulp and Release Carts
# Copyright © 2012,2013, Red Hat, 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
... | gpl-3.0 |
theflofly/tensorflow | tensorflow/python/training/sync_replicas_optimizer.py | 8 | 21785 | # 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 |
wangjun/odoo | openerp/report/render/rml2txt/rml2txt.py | 442 | 16460 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009, P. Christeas, Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or ... | agpl-3.0 |
RiccardoPecora/MP | Lib/site-packages/numpy/compat/_inspect.py | 94 | 9117 | """Subset of inspect module from upstream python
We use this instead of upstream because upstream inspect is slow to import, and
significanly contributes to numpy import times. Importing this copy has almost
no overhead.
"""
import types
__all__ = ['getargspec', 'formatargspec']
# ----------------------------------... | gpl-3.0 |
zhangxq5012/sky_engine | sky/tools/webkitpy/layout_tests/run_webkit_tests.py | 2 | 22007 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
# Copyright (C) 2011 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | bsd-3-clause |
jrha/aquilon | tests/broker/test_update_address.py | 2 | 7804 | #!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2012,2013 Contributor
#
# 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... | apache-2.0 |
2014c2g2/2014c2 | w2/static/Brython2.0.0-20140209-164925/Lib/xml/etree/__init__.py | 1200 | 1604 | # $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... | gpl-2.0 |
milad-soufastai/ansible-modules-extras | windows/win_owner.py | 63 | 1658 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
#
# 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 ... | gpl-3.0 |
naturalness/unnaturalcode | unnaturalcode/check_eclipse_syntax.py | 2 | 9733 | #!/usr/bin/python
# Copyright 2017 Dhvani Patel
#
# This file is part of UnnaturalCode.
#
# UnnaturalCode 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, either version 3 of the Licen... | agpl-3.0 |
seaotterman/tensorflow | tensorflow/tools/compatibility/tf_upgrade_test.py | 48 | 6045 | # 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 |
bgris/ODL_bgris | lib/python3.5/tkinter/simpledialog.py | 23 | 11424 | #
# An Introduction to Tkinter
#
# Copyright (c) 1997 by Fredrik Lundh
#
# This copyright applies to Dialog, askinteger, askfloat and asktring
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
"""This modules handles dialog boxes.
It contains the following public symbols:
SimpleDialog -- A simple but flexible ... | gpl-3.0 |
mapbased/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py | 116 | 10213 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
setten/pymatgen | pymatgen/alchemy/tests/test_transmuters.py | 4 | 4522 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
'''
Created on Mar 5, 2012
'''
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Sh... | mit |
jostep/tensorflow | tensorflow/contrib/image/python/kernel_tests/image_ops_test.py | 45 | 10515 | # 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 |
yun-percy/Android_Shell_Tools | sublime_text_3/sublime_plugin.py | 10 | 18883 | import sublime
import threading
import imp
import importlib
import os
import sys
import zipfile
import sublime_api
import traceback
api_ready = False
application_command_classes = []
window_command_classes = []
text_command_classes = []
all_command_classes = [application_command_classes, window_command_classes, text... | mit |
niranjfantain/django-obfuscator | django_obfuscator/django_obfuscator/settings.py | 1 | 4350 | """
Copyright 2015, Fantain Sports Private Limited
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 |
python/psf-salt | tasks/salt.py | 1 | 4528 | from __future__ import absolute_import, division, print_function
import os
import invoke
import fabric.api
import fabric.contrib.files
from .utils import cd, ssh_host
SALT_MASTER = "192.168.5.1"
@invoke.task(name="sync-changes")
def sync_changes():
# Push our changes to GitHub
# TODO: Determine what orig... | mit |
kchodorow/tensorflow | tensorflow/contrib/linalg/python/kernel_tests/linear_operator_test.py | 24 | 6943 | # 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 |
kaiix/depot_tools | tests/git_rebase_update_test.py | 5 | 13292 | #!/usr/bin/env python
# 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.
"""Unit tests for git_rebase_update.py"""
import os
import sys
DEPOT_TOOLS_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__f... | bsd-3-clause |
ipazc/oculus-crawl | main/search_engine/howold_images.py | 1 | 2402 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from main.search_engine.search_engine import SEARCH_ENGINES, SearchEngine
import urllib
import logging
from bs4 import BeautifulSoup
__author__ = "Ivan de Paz Centeno"
class HowOldImages(SearchEngine):
"""
Search engine that retrieves information of images in the... | gpl-3.0 |
suncycheng/intellij-community | python/lib/Lib/distutils/command/build_scripts.py | 97 | 5528 | """distutils.command.build_scripts
Implements the Distutils 'build_scripts' command."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: build_scripts.py 59668 2008-01-02 18:59:36Z guido.van.rossum $"
import sys, os, re
from stat import ST_MODE
from distutils import sysconfig
from distu... | apache-2.0 |
francocurotto/GraphSLAM | src/python-helpers/commons/g2o2lab.py | 1 | 1819 | '''
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 hope that it will be useful,
but WITHOUT... | gpl-3.0 |
beiko-lab/gengis | bin/Lib/site-packages/scipy/linalg/tests/test_decomp_cholesky.py | 1 | 7125 | from __future__ import division, print_function, absolute_import
from numpy.testing import TestCase, assert_array_almost_equal
from numpy import array, transpose, dot, conjugate, zeros_like
from numpy.random import rand
from scipy.linalg import cholesky, cholesky_banded, cho_solve_banded, \
cho_factor, ch... | gpl-3.0 |
Gamebasis/3DGamebasisServer | GameData/blender-2.71-windows64/2.71/python/lib/pprint.py | 74 | 14861 | # Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly non-desc... | gpl-3.0 |
bdang2012/taiga-front | scripts/manage_translations.py | 20 | 4103 | #!/usr/bin/env python
#
# NOTE: This script is based on taiga-back manage_translations.py script
# (https://github.com/taigaio/taiga-back/blob/master/scripts/manage_translations.py)
#
# This python file contains utility scripts to manage taiga translations.
# It has to be run inside the taiga-front git root direc... | agpl-3.0 |
lochiiconnectivity/boto | boto/support/layer1.py | 15 | 20582 | # Copyright (c) 2013 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 ... | mit |
prakhya/linux_sai | Documentation/sphinx/kernel_include.py | 949 | 8570 | #!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# pylint: disable=R0903, C0330, R0914, R0912, E0401
u"""
kernel-include
~~~~~~~~~~~~~~
Implementation of the ``kernel-include`` reST-directive.
:copyright: Copyright (C) 2016 Markus Heiser
:license: GPL Version 2, June 1991 see lin... | gpl-2.0 |
digideskio/brackets-shell | gyp/pylib/gyp/generator/gypd.py | 912 | 3325 | # 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... | mit |
LEEClab/LS_METRICS | previous_versions/LSMetrics_v1_0_0_garbage.py | 1 | 28905 | # LSMetrics v 1.0.0 Garbage
#-------------------------------------------
def createBinarios_single(ListMapBins, prepareBIODIM):
"""
This function reclassify an input map into a binary map, according to reclassification rules passed by
a text file
"""
readtxt = selectdirectory()
grass.run_comma... | gpl-2.0 |
mollyproject/mollyproject | molly/apps/search/tests.py | 1 | 6280 | import sys
import inspect
from django.utils import unittest
from django.conf import settings
from django.utils.importlib import import_module
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import NullBreadcrumb
class Argspec(tuple):
args = property(lambda self: self[0])
varargs = propert... | apache-2.0 |
akhmadMizkat/odoo | addons/crm/crm_stage.py | 4 | 2537 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import osv, fields
AVAILABLE_PRIORITIES = [
('0', 'Normal'),
('1', 'Low'),
('2', 'High'),
('3', 'Very High'),
]
class crm_stage(osv.Model):
""" Model for case stages. This models t... | gpl-3.0 |
ajgallegog/gem5_arm | src/arch/x86/isa/insts/x87/control/clear_exceptions.py | 91 | 2159 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
PHOTOX/fuase | ase/ase/test/cmr/reactions_test.py | 6 | 2955 | from ase.test import NotAvailable
import warnings
# cmr calls all available methods in ase.atoms detected by the module inspect.
# Therefore also deprecated methods are called - and we choose to silence those warnings.
warnings.filterwarnings('ignore', 'ase.atoms.*deprecated',)
# if CMR_SETTINGS_FILE is missing, cmr r... | gpl-2.0 |
abaditsegay/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/configHandler.py | 52 | 28969 | """Provides access to stored IDLE configuration information.
Refer to the comments at the beginning of config-main.def for a description of
the available configuration files and the design implemented to update user
configuration information. In particular, user configuration choices which
duplicate the defaults will... | apache-2.0 |
jonathanwcrane/boto | boto/roboto/param.py | 160 | 4529 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# 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
# withou... | mit |
catapult-project/catapult-csm | third_party/gsutil/third_party/boto/boto/ec2/cloudwatch/datapoint.py | 152 | 1668 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | bsd-3-clause |
LettError/MutatorMath | Lib/mutatorMath/test/ufo/data/sources/fixSpacing.py | 2 | 2071 |
for f in AllFonts():
if 'Wide' in f.info.styleName:
wk = 'wide'
else:
wk = 'cond'
if 'Bold' in f.info.styleName:
bk = 'bold'
else:
bk = 'light'
print 'current', wk, bk
groups = {
"L_straight": ['B', 'D', 'E', 'F', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'P... | bsd-3-clause |
fangxingli/hue | apps/hbase/src/hbase/server/hbase_lib.py | 28 | 1441 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
gratipay/gratipay.com | tests/py/test_teams.py | 1 | 15001 | from __future__ import absolute_import, division, print_function, unicode_literals
import json
import pytest
from aspen.testing.client import FileUpload
from gratipay.testing import Harness, IMAGE, D,T
from gratipay.testing.email import QueuedEmailHarness
from gratipay.models.team import Team, slugize, InvalidTeamNam... | mit |
tswast/google-cloud-python | oslogin/synth.py | 2 | 2076 | # Copyright 2018 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 agreed to in writing, s... | apache-2.0 |
Iljalala/AdvancedWebFuzzer | awf/core/comparer.py | 1 | 3335 | class Comparer:
def __init__(self):
self.results = []
def compare_properties(self, old_response, new_response, compared_properties):
""" Сравнивает свойства compared_properties между объектами old_response и new_response
:param old_response: объект ResponseObject, символизирующий "было... | gpl-3.0 |
sahiljain/catapult | third_party/google-endpoints/apitools/base/py/credentials_lib_test.py | 7 | 4432 | #
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | bsd-3-clause |
LAndreas/zulip | puppet/zulip_internal/files/postgresql/pg_backup_and_purge.py | 114 | 1575 | #!/usr/bin/python
import subprocess
import sys
import logging
import dateutil.parser
import pytz
from datetime import datetime, timedelta
logging.basicConfig(format="%(asctime)s %(levelname)s: %(message)s")
logger = logging.getLogger(__name__)
def run(args, dry_run=False):
if dry_run:
print "Would have r... | apache-2.0 |
Jgarcia-IAS/localizacion | openerp/addons-extra/odoo-pruebas/odoo-server/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py | 374 | 2830 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
UCSUR-Pitt/wprdc-etl | test/base.py | 1 | 2458 | import os
import json
import unittest
import sqlite3
from marshmallow import fields
HERE = os.path.abspath(os.path.dirname(__file__))
from pipeline.loaders import Loader
from pipeline.extractors import Extractor
from pipeline.connectors import Connector
from pipeline.schema import BaseSchema
class TestSchema(BaseSch... | mit |
jamesblunt/scrapy | scrapy/contrib/downloadermiddleware/httpcompression.py | 138 | 2278 | import zlib
from scrapy.utils.gz import gunzip, is_gzipped
from scrapy.http import Response, TextResponse
from scrapy.responsetypes import responsetypes
from scrapy.exceptions import NotConfigured
class HttpCompressionMiddleware(object):
"""This middleware allows compressed (gzip, deflate) traffic to be
sent... | bsd-3-clause |
xflin/spark | examples/src/main/python/sql/streaming/structured_network_wordcount.py | 76 | 2534 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
googlefonts/roboto | scripts/lib/fontbuild/features.py | 7 | 7722 | # Copyright 2015 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 ... | apache-2.0 |
switchboardOp/ansible | test/units/modules/network/vyos/test_vyos_config.py | 77 | 3575 | #
# (c) 2016 Red Hat 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 version.
#
# Ansible is d... | gpl-3.0 |
vnsofthe/odoo | addons/hw_screen/__openerp__.py | 25 | 1524 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2015 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 |
iam-TJ/node-gyp | gyp/test/mac/gyptest-app.py | 85 | 1409 | #!/usr/bin/env python
# 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.
"""
Verifies that app bundles are built correctly.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestGyp(fo... | mit |
rlucioni/rotations | rotations/migrations/0001_initial.py | 1 | 2069 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-03 04:49
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import sortedm2m.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
... | mit |
prodromou87/gem5 | tests/configs/arm_generic.py | 10 | 4640 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
pirati-cz/byro | setup.py | 1 | 1665 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import locale
from setuptools import (setup, find_packages)
from byro import (__version__, __author__, __email__, __license__, __doc__)
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
setup(
# Basic
name='Byro',
version=__version__,
packages=find_packages(),
# Entry... | gpl-3.0 |
thenewguy/django-jsonfield | jsonfield/tests.py | 10 | 10231 | from decimal import Decimal
from django.core.serializers import deserialize, serialize
from django.core.serializers.base import DeserializationError
from django.db import models
from django.test import TestCase
try:
import json
except ImportError:
from django.utils import simplejson as json
from .fields import... | mit |
codeforamerica/skillcamp | ENV/lib/python2.7/site-packages/gunicorn/app/pasterapp.py | 24 | 5631 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import os
import pkg_resources
import sys
try:
import configparser as ConfigParser
except ImportError:
import ConfigParser
from paste.deploy import loadapp, loadwsgi
SERVER = loadwsg... | mit |
adelton/django | tests/postgres_tests/fields.py | 302 | 1087 | """
Indirection layer for PostgreSQL-specific fields, so the tests don't fail when
run with a backend other than PostgreSQL.
"""
from django.db import models
try:
from django.contrib.postgres.fields import (
ArrayField, BigIntegerRangeField, DateRangeField, DateTimeRangeField,
FloatRangeField, HSto... | bsd-3-clause |
jborean93/ansible | lib/ansible/modules/validate_argument_spec.py | 18 | 1421 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2021 Red Hat
# 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: validate_argument_spec
short_descript... | gpl-3.0 |
rotofly/odoo | addons/account_payment/__openerp__.py | 261 | 2925 | # -*- 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 |
pforret/python-for-android | python3-alpha/python-libs/gdata/apps_property.py | 150 | 1121 | #!/usr/bin/env python
#
# Copyright (C) 2010 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 ... | apache-2.0 |
garyjyao1/ansible | lib/ansible/modules/core/web_infrastructure/htpasswd.py | 99 | 8780 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Nimbis Services, 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
# (... | gpl-3.0 |
monkeysecurity/npyscreen | npyscreen/compatibility_code/npysNPSTree.py | 21 | 7343 | #!/usr/bin/env python
import weakref
import collections
import operator
class NPSTreeData(object):
CHILDCLASS = None
def __init__(self, content=None, parent=None, selected=False, selectable=True,
highlight=False, expanded=True, ignoreRoot=True, sort_function=None):
self.setParent(pa... | bsd-2-clause |
a-parhom/edx-platform | lms/djangoapps/courseware/tests/test_masquerade.py | 4 | 21981 | # -*- coding: utf-8 -*-
"""
Unit tests for masquerade.
"""
import json
import pickle
from datetime import datetime
import ddt
from django.conf import settings
from django.urls import reverse
from django.test import TestCase
from mock import patch
from pytz import UTC
from capa.tests.response_xml_factory import Option... | agpl-3.0 |
michaelmcandrew/readthedocs.org | readthedocs/rtd_tests/tests/test_redirects.py | 20 | 10441 | from django.test import TestCase
from django.test.utils import override_settings
from django_dynamic_fixture import get
from django_dynamic_fixture import fixture
from readthedocs.builds.constants import LATEST
from readthedocs.projects.models import Project
from readthedocs.redirects.models import Redirect
import l... | mit |
hsluo/youtube-dl | devscripts/generate_aes_testdata.py | 129 | 1136 | from __future__ import unicode_literals
import codecs
import subprocess
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.utils import intlist_to_bytes
from youtube_dl.aes import aes_encrypt, key_expansion
secret_msg = b'Secret message goes here'
... | unlicense |
asser/django | django/core/files/uploadedfile.py | 471 | 4334 | """
Classes representing uploaded files.
"""
import errno
import os
from io import BytesIO
from django.conf import settings
from django.core.files import temp as tempfile
from django.core.files.base import File
from django.utils.encoding import force_str
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryU... | bsd-3-clause |
s-ludwig/FrameworkBenchmarks | frameworks/Python/cherrypy/satool.py | 79 | 1643 | import cherrypy
__all__ = ['SATool']
class SATool(cherrypy.Tool):
def __init__(self):
"""
The SA tool is responsible for associating a SA session
to the SA engine and attaching it to the current request.
Since we are running in a multithreaded application,
we use the scoped... | bsd-3-clause |
disqus/python-phabricator | phabricator/tests/test_phabricator.py | 1 | 5145 | try:
import unittest2 as unittest
except ImportError:
import unittest
import requests
import responses
from pkg_resources import resource_string
import json
import phabricator
phabricator.ARCRC = {} # overwrite any arcrc that might be read
RESPONSES = json.loads(
resource_string(
'phabricator.... | apache-2.0 |
fernand/scipy | scipy/signal/signaltools.py | 13 | 87587 | # Author: Travis Oliphant
# 1999 -- 2002
from __future__ import division, print_function, absolute_import
import warnings
import threading
from . import sigtools
from scipy._lib.six import callable
from scipy._lib._version import NumpyVersion
from scipy import linalg
from scipy.fftpack import (fft, ifft, ifftshift, ... | bsd-3-clause |
pdarragh/Viper | viper/parser/grammar_parsing/production_part.py | 1 | 1856 | class ProductionPart:
def __str__(self):
return repr(self)
class LiteralPart(ProductionPart):
def __init__(self, text: str):
self.text = text
def __repr__(self):
return "'" + self.text + "'"
class SpecialPart(ProductionPart):
def __init__(self, special_token: str):
s... | apache-2.0 |
kaiix/depot_tools | third_party/boto/gs/cors.py | 88 | 7731 | # Copyright 2012 Google Inc.
#
# 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, dis-
# trib... | bsd-3-clause |
cosmo-ethz/hope | hope/_optimizer.py | 1 | 16844 | # Copyright (c) 2014 ETH Zurich, Institute of Astronomy, Lukas Gamper <lukas.gamper@usystems.ch>
# TODO: remove comment!
# replace pow(a, number(int)) by multiplications
# find subexpressions and factor them out => make this blockwise (for that merge 1d expressions into one block)
# 1: merge subexpressions
# 2: creat... | gpl-3.0 |
srm912/servo | tests/wpt/update/update.py | 224 | 1348 | # 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/.
import os
from wptrunner.update.base import Step, StepRunner
from wptrunner.update.update import LoadConfig, SyncFromUp... | mpl-2.0 |
andyh616/mne-python | mne/preprocessing/tests/test_eeglab_infomax.py | 8 | 7738 | import numpy as np
from scipy.linalg import svd
from mne.io import Raw
from mne import pick_types
import scipy.io as sio
from scipy.linalg import pinv
from mne.preprocessing.infomax_ import infomax
from numpy.testing import assert_almost_equal
from mne.utils import random_permutation
from mne.datasets import testing... | bsd-3-clause |
ncdesouza/bookworm | env/lib/python2.7/site-packages/whoosh/util/text.py | 96 | 4372 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | gpl-3.0 |
tkerola/chainer | chainer/functions/normalization/batch_renormalization.py | 2 | 8182 | import warnings
import numpy
from chainer import backend
from chainer.backends import cuda
from chainer import configuration
from chainer import function
from chainer.functions.normalization import batch_normalization
from chainer.utils import type_check
def _xhat(x, mean, std, expander):
x_mu = x - mean[expand... | mit |
asiersarasua/QGIS | src/plugins/grass/scripts/db.connect-login.pg.py | 17 | 3779 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
***************************************************************************
db.connect-login.pg.py - Connect to PostgreSQL
---------------------
Date : July 2009
Copyright : (C) 2009 by Radim Blazek
Email :... | gpl-2.0 |
ianatpn/nupictest | tests/external/py2/testfixture_test.py | 17 | 1769 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
fujunwei/chromium-crosswalk | tools/json_schema_compiler/idl_schema.py | 32 | 20817 | #! /usr/bin/env python
# Copyright (c) 2012 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 itertools
import json
import os.path
import pprint
import re
import sys
from json_parse import OrderedDict
# This file is... | bsd-3-clause |
chjw8016/GreenOdoo7-haibao | openerp/addons/product/product.py | 8 | 48196 | # -*- 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... | mit |
latuannetnam/django-socialauth | myproject/myproject/settings.py | 1 | 4681 | """
Django settings for myproject 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, ...)
... | apache-2.0 |
maryklayne/Funcao | sympy/polys/tests/test_factortools.py | 14 | 21613 | """Tools for polynomial factorization routines in characteristic zero. """
from sympy.polys.rings import ring, xring
from sympy.polys.domains import FF, ZZ, QQ, RR, EX
from sympy.polys import polyconfig as config
from sympy.polys.polyerrors import DomainError
from sympy.polys.polyclasses import ANP
from sympy.polys.s... | bsd-3-clause |
adrienbrault/home-assistant | homeassistant/components/microsoft_face_detect/image_processing.py | 21 | 3340 | """Component that will help set the Microsoft face detect processing."""
import logging
import voluptuous as vol
from homeassistant.components.image_processing import (
ATTR_AGE,
ATTR_GENDER,
ATTR_GLASSES,
CONF_ENTITY_ID,
CONF_NAME,
CONF_SOURCE,
PLATFORM_SCHEMA,
ImageProcessingFaceEnti... | mit |
ybellavance/python-for-android | python3-alpha/python3-src/Lib/ctypes/test/test_python_api.py | 50 | 3066 | from ctypes import *
import unittest, sys
from ctypes.test import is_resource_enabled
################################################################
# This section should be moved into ctypes\__init__.py, when it's ready.
from _ctypes import PyObj_FromPtr
###########################################################... | apache-2.0 |
ojengwa/talk | venv/lib/python2.7/site-packages/pip/cmdoptions.py | 117 | 11475 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parse's general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this d... | mit |
theonion/bulbs2-elasticsearch | setup.py | 1 | 1308 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import sys
version = "0.0.1"
name = "bulbs2-elasticsearch"
package = "bulbs2_elasticsearch"
description = "The Latest in Onion Technical Debt"
url = "https://github.com/t... | mit |
SoLoHiC/mezzanine | mezzanine/accounts/views.py | 21 | 6696 | from __future__ import unicode_literals
from django.contrib.auth import (login as auth_login, authenticate,
logout as auth_logout, get_user_model)
from django.contrib.auth.decorators import login_required
from django.contrib.messages import info, error
from django.core.urlresolvers imp... | bsd-2-clause |
ysasaki6023/NeuralNetworkStudy | cifar06/net7.py | 1 | 2799 | #!/usr/bin/env python
import numpy as np
import chainer
import chainer.links as L
import chainer.functions as F
from chainer.utils import conv
class ImageProcessNetwork(chainer.Chain):
def __init__(self, F_unit):
super(ImageProcessNetwork, self).__init__()
self.IsTrain = True
self.F_unit =... | mit |
jaumemarti/l10n-spain-txerpa | l10n_es_bank_statement/models/__init__.py | 4 | 1259 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) All rights reserved:
# 2013-2014 Servicios Tecnológicos Avanzados (http://serviciosbaeza.com)
# Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
#
# This program is f... | agpl-3.0 |
yjmade/odoo | openerp/addons/test_new_api/models.py | 31 | 7010 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-2014 OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
mzdaniel/oh-mainline | vendor/packages/mechanize/test/test_functional.py | 21 | 29138 | #!/usr/bin/env python
# These tests access the network. python test.py runs a local test server and
# doesn't try to fetch anything over the internet, since the few tests here
# that do that are disabled by default since they have test tag "internet".
# thanks Moof (aka Giles Antonio Radford) for some of these
impo... | agpl-3.0 |
mjirik/teigen | teigen/generators/unconnected_cylinders.py | 1 | 22054 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © %YEAR% %USER% <%MAIL%>
#
# Distributed under terms of the %LICENSE% license.
"""
%HERE%
"""
import logging
logger = logging.getLogger(__name__)
import argparse
import numpy as np
# import ..geometry3 as g3
# from ..geometry3d import plane... | apache-2.0 |
jcupitt/libvips | test/test-suite/test_draw.py | 3 | 2750 | # vim: set fileencoding=utf-8 :
import pytest
import pyvips
class TestDraw:
def test_draw_circle(self):
im = pyvips.Image.black(100, 100)
im = im.draw_circle(100, 50, 50, 25)
pixel = im(25, 50)
assert len(pixel) == 1
assert pixel[0] == 100
pixel = im(26, 50)
... | lgpl-2.1 |
geerlingguy/ansible | test/integration/targets/vault/test-vault-client.py | 139 | 1818 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
import argparse
import sys
# TODO: could read these from the files I suppose...
secrets = {'vault-password': 'test-vault-password',
... | gpl-3.0 |
DCSaunders/tensorflow | tensorflow/contrib/layers/python/layers/summaries.py | 14 | 5345 | # 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 |
KohlsTechnology/ansible | test/units/module_utils/parsing/test_convert_bool.py | 173 | 1924 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017 Ansible Project
# License: GNU General Public License v3 or later (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt )
# Make coding more python3-ish
from __future__ import (absolute_import, division)
__metaclass__ = type
import pytest
from ansible.module_utils.par... | gpl-3.0 |
pigshell/nhnick | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/error_handlers_unittest.py | 122 | 8772 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
rui-castro/Sick-Beard | tests/db_tests.py | 73 | 1415 | # coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 |
blackzw/openwrt_sdk_dev1 | staging_dir/host/lib/python2.7/test/test_fpformat.py | 129 | 2309 | '''
Tests for fpformat module
Nick Mathewson
'''
from test.test_support import run_unittest, import_module
import unittest
fpformat = import_module('fpformat', deprecated=True)
fix, sci, NotANumber = fpformat.fix, fpformat.sci, fpformat.NotANumber
StringType = type('')
# Test the old and obsolescent fpformat mo... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.