repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
statico/friend-rescue | backend/simplejson/decoder.py | 65 | 11225 | """
Implementation of JSONDecoder
"""
import re
import sys
from simplejson.scanner import Scanner, pattern
try:
from simplejson._speedups import scanstring as c_scanstring
except ImportError:
pass
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
import struct
import sys
_BYTES... | mit |
BinRoot/TensorFlow-Book | ch04_classification/logistic_2d.py | 1 | 1737 | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
learning_rate = 0.1
training_epochs = 2000
def sigmoid(x):
return 1. / (1. + np.exp(-x))
x1_label1 = np.random.normal(3, 1, 1000)
x2_label1 = np.random.normal(2, 1, 1000)
x1_label2 = np.random.normal(7, 1, 1000)
x2_label2 = np.random.nor... | mit |
hazrpg/calibre | src/calibre/gui2/store/stores/amazon_uk_plugin.py | 3 | 5362 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import (unicode_literals, division, absolute_import,
print_function)
store_version = 11 # Needed for dynamic plugin loading
from contextlib import closing
im... | gpl-3.0 |
saiwing-yeung/scikit-learn | examples/decomposition/plot_pca_vs_fa_model_selection.py | 70 | 4523 | """
===============================================================
Model selection with Probabilistic PCA and Factor Analysis (FA)
===============================================================
Probabilistic PCA and Factor Analysis are probabilistic models.
The consequence is that the likelihood of new data can be u... | bsd-3-clause |
Balachan27/django | tests/swappable_models/tests.py | 339 | 2130 | from __future__ import unicode_literals
from swappable_models.models import Article
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core import management
from django.test import TestCase, override_settings
from django.utils.six import StringIO
... | bsd-3-clause |
andante20/volatility | volatility/plugins/vboxinfo.py | 45 | 1725 | # Volatility
# Copyright (C) 2009-2012 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
chinmaygarde/mojo | third_party/cython/src/Cython/Plex/Lexicons.py | 102 | 6291 | #=======================================================================
#
# Python Lexical Analyser
#
# Lexical Analyser Specification
#
#=======================================================================
import types
import Actions
import DFA
import Errors
import Machines
import Regexps
# debug_flags for ... | bsd-3-clause |
strint/tensorflow | tensorflow/contrib/tensor_forest/python/ops/data_ops.py | 36 | 6976 | # 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 |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtNetwork/QNetworkSession.py | 1 | 4868 | # encoding: utf-8
# module PyQt4.QtNetwork
# from /usr/lib/python3/dist-packages/PyQt4/QtNetwork.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
class QNetworkSession(__PyQt4_QtCore.QObject):
""" QNetworkSession(QNetworkConfiguration, QObject parent=N... | gpl-2.0 |
mozilla/kitsune | kitsune/sumo/tests/test_views.py | 1 | 2202 | from django.contrib.sites.models import Site
from django.http import HttpResponsePermanentRedirect, HttpResponseRedirect
from django.test import override_settings
from django.test.client import RequestFactory
from unittest import mock
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.sumo.midd... | bsd-3-clause |
111pontes/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_policy_repository_cfg.py | 1 | 68395 |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | apache-2.0 |
felipenaselva/repo.felipe | plugin.video.arquivobrasil/resources/lib/UniversalAnalytics/Tracker.py | 11 | 18661 | ###############################################################################
# Universal Analytics for Python
# Copyright (c) 2013, Analytics Pros
#
# This project is free software, distributed under the BSD license.
# Analytics Pros offers consulting and integration services if your firm needs
# assistance in st... | gpl-2.0 |
ybellavance/python-for-android | python3-alpha/extra_modules/gdata/exif/__init__.py | 45 | 6980 | # -*-*- encoding: utf-8 -*-*-
#
# This is gdata.photos.exif, implementing the exif namespace in gdata
#
# $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $
#
# Copyright 2007 Håvard Gulldahl
# Portions copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not... | apache-2.0 |
aronparsons/spacewalk | backend/server/rhnSQL/sql_lib.py | 7 | 2062 | #
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
alon/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/example/echo_wsh.py | 494 | 2197 | # 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 |
goulu/networkx | networkx/algorithms/hierarchy.py | 10 | 1777 | # -*- coding: utf-8 -*-
"""
Flow Hierarchy.
"""
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__authors__ = "\n".join(['Ben Edwards (bedwards@cs.unm.edu)'])
_... | bsd-3-clause |
bitesofcode/projexui | projexui/widgets/xorbschemabox.py | 2 | 4667 | """ Defines a combo box for selecting orb schemas """
# define authorship information
__authors__ = ['Eric Hulser']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2011, Projex Software'
__license__ = 'LGPL'
# maintenance information
... | lgpl-3.0 |
erkrishna9/odoo | addons/sale_stock/company.py | 384 | 1524 | # -*- 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 |
nelsonsar/ansible | lib/ansible/galaxy/role.py | 33 | 12340 | ########################################################################
#
# (C) 2015, Brian Coca <bcoca@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... | gpl-3.0 |
nitzmahone/ansible | lib/ansible/modules/cloud/cloudstack/cs_portforward.py | 5 | 12346 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.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 = {'metadata_version': '1.1',
... | gpl-3.0 |
bh107/bohrium | bridge/npbackend/bohrium/concatenate.py | 5 | 13321 | """
Array concatenate functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from . import array_create
def atleast_1d(*arys):
"""
Convert inputs to arrays with at least one dimension.
Scalar inputs are converted to 1-dimensional arrays, whilst
higher-dimensional inputs are preserved.
Parameters
--------... | apache-2.0 |
837468220/python-for-android | python3-alpha/python3-src/Lib/lib2to3/tests/test_pytree.py | 131 | 17346 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Unit tests for pytree.py.
NOTE: Please *don't* add doc strings to individual test methods!
In verbose mode, printing of the module, class and method name is much
more helpful than printing of (the first line of) the... | apache-2.0 |
SCSSG/Odoo-SCS | addons/account/wizard/account_report_print_journal.py | 378 | 3440 | # -*- 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 |
shamangeorge/beets | beetsplug/unimported.py | 6 | 2147 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2019, Joris Jensen
#
# 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 ... | mit |
gundalow/ansible | test/units/modules/test_yum.py | 35 | 9941 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat import unittest
from ansible.modules.yum import YumModule
yum_plugin_load_error = """
Plugin "product-id" can't be imported
Plugin "search-disabled-repos" can't be imported
Plugin "subsc... | gpl-3.0 |
unofficial-opensource-apple/llvmgcc42 | llvmCore/utils/lit/lit/Test.py | 32 | 2299 | import os
# Test results.
class TestResult:
def __init__(self, name, isFailure):
self.name = name
self.isFailure = isFailure
PASS = TestResult('PASS', False)
XFAIL = TestResult('XFAIL', False)
FAIL = TestResult('FAIL', True)
XPASS = TestResult('XPASS', True)
UNRESOLVED ... | gpl-2.0 |
piotroxp/scibibscan | scib/lib/python3.5/site-packages/setuptools/sandbox.py | 259 | 13925 | import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import contextlib
import pickle
import pkg_resources
if sys.platform.startswith('java'):
import org.python.modules.posix.PosixModule as _os
else:
_os = sys.modules[os.name]
try:
_file = file
except NameError:
... | mit |
JacobCallahan/robottelo | tests/foreman/ui/test_computeresource_ec2.py | 2 | 6885 | """Test for Compute Resource UI
:Requirement: Computeresource RHV
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: ComputeResources-EC2
:Assignee: lhellebr
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
from fauxfactory import gen_string
from nailgun import entities... | gpl-3.0 |
x10an14/overtime-calculator | overtime_calculator/__init__.py | 1 | 1295 | from functools import wraps
import logging
import jwt
default_parse_fmt = "%d-%m-%Y %H:%M:%S"
def get_secret():
return 'sflkjsdjkfd'
def token_verify(token):
secret = get_secret()
try:
return jwt.decode(token, secret, algorithm='HS256')
except jwt.DecodeError:
return False
def lo... | mit |
akostrikov/hadoop-1.2.1-in-action | src/contrib/hod/hodlib/GridServices/mapred.py | 182 | 8167 | #Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use thi... | apache-2.0 |
gauribhoite/personfinder | env/google_appengine/lib/django-1.5/django/contrib/markup/tests.py | 102 | 4306 | # Quick tests for the markup templatetags (django.contrib.markup)
import re
import warnings
from django.template import Template, Context
from django import test
from django.utils import unittest
from django.utils.html import escape
try:
import textile
except ImportError:
textile = None
try:
import markd... | apache-2.0 |
philanthropy-u/edx-platform | cms/djangoapps/contentstore/views/tests/test_import_export.py | 4 | 38740 | """
Unit tests for course import and export
"""
import copy
import json
import logging
import os
import shutil
import tarfile
import tempfile
from uuid import uuid4
import ddt
import lxml
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from django.test.utils import override_set... | agpl-3.0 |
kawamon/hue | desktop/core/ext-py/SQLAlchemy-1.3.17/test/ext/declarative/test_basic.py | 2 | 71852 | import sqlalchemy as sa
from sqlalchemy import CheckConstraint
from sqlalchemy import event
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import ForeignKeyConstraint
from sqlalchemy import Index
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import MetaData
... | apache-2.0 |
tiagocardosos/stoq | stoqlib/gui/test/test_sellablecategoryeditor.py | 3 | 1701 | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2012 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## 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 Foundati... | gpl-2.0 |
PaulPetring/zulip | zerver/lib/avatar.py | 124 | 1765 | from __future__ import absolute_import
from django.conf import settings
import hashlib
from zerver.lib.utils import make_safe_digest
def gravatar_hash(email):
"""Compute the Gravatar hash for an email address."""
# Non-ASCII characters aren't permitted by the currently active e-mail
# RFCs. However, the I... | apache-2.0 |
thaumos/ansible | lib/ansible/plugins/action/cli_config.py | 42 | 1287 | #
# Copyright 2018 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.
#
# Ansibl... | gpl-3.0 |
coala/coala | coalib/testing/LocalBearTestHelper.py | 1 | 19188 | import logging
import queue
import unittest
from contextlib import contextmanager, ExitStack
from unittest.mock import patch
from coalib.bearlib.abstractions.LinterClass import LinterClass
from coalib.testing.BearTestHelper import generate_skip_decorator
from coalib.bears.LocalBear import LocalBear
from coala_utils.Co... | agpl-3.0 |
dmitrijus/hltd | lib/urllib3-1.10/urllib3_hltd/__init__.py | 2 | 1867 | """
urllib3_hltd - Thread-safe connection pooling and re-using.
"""
__author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'
__license__ = 'MIT'
__version__ = '1.10'
from .connectionpool import (
HTTPConnectionPool,
HTTPSConnectionPool,
connection_from_url
)
from . import exceptions
from .filepost import... | lgpl-3.0 |
x2Ident/x2Ident_test | mitmproxy/mitmproxy/protocol/http1.py | 2 | 2732 | from __future__ import absolute_import, print_function, division
from mitmproxy import models
from mitmproxy.protocol import http
from netlib.http import http1
class Http1Layer(http._HttpTransmissionLayer):
def __init__(self, ctx, mode):
super(Http1Layer, self).__init__(ctx)
self.mode... | gpl-3.0 |
lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/sympy/physics/quantum/qft.py | 3 | 6205 | """An implementation of qubits and gates acting on them.
Todo:
* Update docstrings.
* Update tests.
* Implement apply using decompose.
* Implement represent using decompose or something smarter. For this to
work we first have to implement represent for SWAP.
* Decide if we want upper index to be inclusive in the co... | gpl-3.0 |
fxfitz/ansible | lib/ansible/modules/network/onyx/onyx_l3_interface.py | 41 | 9721 | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
lnielsen/zenodo | tests/unit/deposit/test_api_metadata.py | 3 | 10518 | # -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 CERN.
#
# Zenodo 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 v... | gpl-2.0 |
joopert/home-assistant | homeassistant/components/deconz/__init__.py | 4 | 2685 | """Support for deCONZ devices."""
import voluptuous as vol
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from .config_flow import get_master_gateway
from .const import CONF_BRIDGEID, CONF_MASTER_GATEWAY, CONF_UUID, DOMAIN
from .gateway import DeconzGateway, get_gateway_from_config_entry
from .services impo... | apache-2.0 |
chauhanhardik/populo_2 | common/lib/xmodule/xmodule/assetstore/tests/test_asset_xml.py | 113 | 3631 | """
Test for asset XML generation / parsing.
"""
from path import Path as path
from lxml import etree
from contracts import ContractNotRespected
import unittest
from opaque_keys.edx.locator import CourseLocator
from xmodule.assetstore import AssetMetadata
from xmodule.modulestore.tests.test_assetstore import AssetSto... | agpl-3.0 |
marqueedev/django | django/conf/locale/id/formats.py | 504 | 2135 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j N Y'
DATETIME_FORMAT = "j N Y, ... | bsd-3-clause |
chiefspace/udemy-rest-api | udemy_rest_api_section5/env/lib/python3.4/site-packages/setuptools/compat.py | 331 | 2556 | import sys
import itertools
if sys.version_info[0] < 3:
PY3 = False
basestring = basestring
import __builtin__ as builtins
import ConfigParser
from StringIO import StringIO
BytesIO = StringIO
execfile = execfile
func_code = lambda o: o.func_code
func_globals = lambda o: o.func_glob... | gpl-2.0 |
aesteve/vertx-web | vertx-web/src/test/sockjs-protocol/unittest2/case.py | 4 | 55983 | """Test case implementation"""
import sys
import collections
import contextlib
import difflib
import logging
import pprint
import re
import traceback2 as traceback
import types
import unittest
import warnings
import six
from six.moves import range
from unittest2 import result
from unittest2.util import (
safe_re... | apache-2.0 |
sstoma/CellProfiler | cellprofiler/cpmath/tests/test_threshold.py | 1 | 7992 | '''test_threshold - test the threshold module
CellProfiler is distributed under the GNU General Public License,
but this file is licensed under the more permissive BSD license.
See the accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2015 Broad In... | gpl-2.0 |
paulot/NodeVector | node-0.12.0/deps/v8/test/webkit/testcfg.py | 53 | 6231 | # Copyright 2013 the V8 project authors. 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 conditi... | mit |
scrollback/kuma | vendor/packages/GitPython/lib/git/blob.py | 32 | 5305 | # blob.py
# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import mimetypes
import os
import re
import time
from actor import Actor
from commit import Commit
clas... | mpl-2.0 |
DanielSBrown/osf.io | admin_tests/metrics/test_utils.py | 11 | 6284 | from nose import tools as nt
from datetime import timedelta, datetime
from tests.base import AdminTestCase
from tests.factories import (
AuthUserFactory, NodeFactory, ProjectFactory, RegistrationFactory
)
from website.project.model import Node, User
from framework.auth import Auth
from admin.metrics.utils import... | apache-2.0 |
defionscode/ansible | lib/ansible/modules/network/onyx/onyx_bgp.py | 66 | 8971 | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
Curious72/sympy | sympy/polys/domains/pythonrationalfield.py | 117 | 2234 | """Implementation of :class:`PythonRationalField` class. """
from __future__ import print_function, division
from sympy.polys.domains.rationalfield import RationalField
from sympy.polys.domains.groundtypes import PythonInteger, PythonRational, SymPyRational
from sympy.polys.polyerrors import CoercionFailed
from symp... | bsd-3-clause |
pmghalvorsen/gramps_branch | gramps/plugins/quickview/reporef.py | 3 | 2581 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2006-2007 Alex Roitman
# Copyright (C) 2007-2009 Jerome Rapinat
#
# 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
... | gpl-2.0 |
garrettcap/Bulletproof-Backup | Python2.7/lib/python2.7/site-packages/setuptools/tests/test_develop.py | 286 | 3605 | """develop tests
"""
import sys
import os, shutil, tempfile, unittest
import tempfile
import site
from distutils.errors import DistutilsError
from setuptools.command.develop import develop
from setuptools.command import easy_install as easy_install_pkg
from setuptools.compat import StringIO
from setuptools.dist import... | gpl-2.0 |
bdoner/SickRage | lib/github/tests/GitTree.py | 39 | 3310 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
mrquim/mrquimrepo | repo/script.module.youtube.dl/lib/youtube_dl/extractor/playwire.py | 64 | 2408 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
dict_get,
float_or_none,
)
class PlaywireIE(InfoExtractor):
_VALID_URL = r'https?://(?:config|cdn)\.playwire\.com(?:/v2)?/(?P<publisher_id>\d+)/(?:videos/v2|embed|config)/(?P<id>\d+)'
_TESTS = [... | gpl-2.0 |
humanoid-path-planner/hpp-corbaserver | src/hpp/corbaserver/robot.py | 1 | 22688 | #!/usr/bin/env python
# Copyright (c) 2014 CNRS
# Author: Florent Lamiraux
#
# This file is part of hpp-corbaserver.
# hpp-corbaserver 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
# 3 ... | lgpl-3.0 |
dmnfarrell/peat | Protool/analyse_structure.py | 1 | 5888 | #!/usr/bin/env python
#
# # Protool - Python class for manipulating protein structuress
# Copyright (C) 2010 Jens Erik Nielsen
#
# 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 ... | mit |
auready/django | tests/template_tests/filter_tests/test_rjust.py | 521 | 1030 | from django.template.defaultfilters import rjust
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class RjustTests(SimpleTestCase):
@setup({'rjust01': '{% autoescape off %}.{{ a|rjust:"5" }}. .{{ b|rjust:"5" }}.{% endautoescape %}'})
def test_rju... | bsd-3-clause |
umlsynco/umlsync | django_server/easynav/settings.py | 1 | 5589 | # Django settings for easynav project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NA... | gpl-2.0 |
Vajnar/linux-stable-hx4700 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
aragilar/h5preserve | tests/test_roundtrip.py | 2 | 4749 | import pytest
import h5py
from h5preserve import open as hp_open, H5PreserveFile
@pytest.mark.roundtrip
def test_roundtrip(tmpdir, obj_registry):
tmpfile = str(tmpdir.join("test_roundtrip.h5"))
with hp_open(tmpfile, registries=obj_registry["registries"], mode='x') as f:
f["first"] = obj_registry["dump... | bsd-3-clause |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/docutils/examples.py | 180 | 3959 | # $Id: examples.py 7320 2012-01-19 22:33:02Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This module contains practical examples of Docutils client code.
Importing this module from client code is not recommended; its contents are
subject to c... | gpl-3.0 |
aperigault/ansible | lib/ansible/modules/cloud/azure/azure_rm_servicebus.py | 24 | 6521 | #!/usr/bin/python
#
# Copyright (c) 2018 Yuwei Zhou, <yuwzho@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 |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_xdrlib.py | 94 | 1597 | from test import test_support
import unittest
import xdrlib
class XDRTest(unittest.TestCase):
def test_xdr(self):
p = xdrlib.Packer()
s = 'hello world'
a = ['what', 'is', 'hapnin', 'doctor']
p.pack_int(42)
p.pack_int(-17)
p.pack_uint(9)
p.pack_bool(True)
... | gpl-2.0 |
nolanliou/tensorflow | tensorflow/contrib/tensor_forest/python/tensor_forest_test.py | 10 | 5506 | # 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 |
mabotech/mabozen | mabozen/conf/logging_config.py | 3 | 2630 | # -*- coding: utf-8 -*-
LOGGING = {
'version': 1,
#'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(asctime)s [%(levelname)s] %(process)d, %(thread)d, %(name)s, %(module)s:%(lineno)s:%(message)s'
},
'performance': ... | mit |
imtapps/django-admin-ext | example/sample/tests.py | 1 | 9590 | from functools import wraps
from django.contrib.auth.models import User
from django.test.testcases import TestCase
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium.common.exceptions import TimeoutException, NoSuchElementException, StaleElementReferenceException
from selenium import ... | bsd-2-clause |
lhellebr/spacewalk | backend/satellite_tools/xmlDiskSource.py | 6 | 9005 | #
# Abstraction for an XML importer with a disk base
#
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# F... | gpl-2.0 |
noironetworks/nova | nova/tests/functional/api_sample_tests/test_hypervisors.py | 17 | 6546 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
d-nox/iHummeln | iHummeln/www/js/OpenLayers/tools/BeautifulSoup.py | 1 | 69013 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-formed X... | mit |
freedomtan/tensorflow | tensorflow/python/data/experimental/kernel_tests/optimization/choose_fastest_dataset_test.py | 11 | 4211 | # Copyright 2019 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 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/numpy/distutils/mingw32ccompiler.py | 57 | 22435 | """
Support code for building Python extensions on Windows.
# NT stuff
# 1. Make sure libpython<version>.a exists for gcc. If not, build it.
# 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
# 3. Force windows to use g77
"""
from __future__ import division, absolute_import, p... | gpl-3.0 |
NeuralEnsemble/neuroConstruct | lib/jython/Lib/test/test_zlib_jy.py | 23 | 1039 | """Misc zlib tests
Made for Jython.
"""
import unittest
import zlib
from array import array
from test import test_support
class ArrayTestCase(unittest.TestCase):
def test_array(self):
self._test_array(zlib.compress, zlib.decompress)
def test_array_compressobj(self):
def compress(value):
... | gpl-2.0 |
akarol/cfme_tests | cfme/common/__init__.py | 1 | 21569 | # -*- coding: utf-8 -*-
from navmazing import NavigateToSibling
from widgetastic.exceptions import NoSuchElementException, RowNotFound
from widgetastic_patternfly import BootstrapSelect, Button, CheckableBootstrapTreeview
from widgetastic.widget import Table, Text, View
from cfme.base.login import BaseLoggedInPage
fro... | gpl-2.0 |
guillaume-philippon/aquilon | lib/aquilon/worker/commands/update_parameter_definition_feature.py | 1 | 2498 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | apache-2.0 |
abadger/ansible | test/lib/ansible_test/_internal/commands/sanity/import.py | 13 | 9115 | """Sanity test for proper import exception handling."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ... import types as t
from . import (
SanityMultipleVersion,
SanityMessage,
SanityFailure,
SanitySuccess,
SanitySkipped,
SANITY_ROOT,
... | gpl-3.0 |
lu-ci/apex-sigma-plugins | minigames/professions/upgrades.py | 3 | 1781 | import discord
from .nodes.upgrades import upgrade_list
def calculate_upgrade(up_id, level):
up_table = {
'stamina': {
'amount': -(60 - (int(60 - ((60 / 100) * (level * 0.5))))),
'end': 'Seconds'
},
'luck': {
'amount': level * 250,
'end': 'B... | gpl-3.0 |
nugget/home-assistant | tests/components/sensor/test_moon.py | 4 | 1666 | """The test for the moon sensor platform."""
import unittest
from datetime import datetime
from unittest.mock import patch
import homeassistant.util.dt as dt_util
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
DAY1 = datetime(2017, 1, 1, 1, tzinfo=dt_util.UTC)
DAY2 =... | apache-2.0 |
kwade00/xbmc | lib/libUPnP/Neptune/Extras/Scripts/CodeScanner.py | 264 | 4286 | #! /usr/bin/python
import os
import os.path
import re
import sys
ErrorPattern = re.compile('([A-Z]{3}_ERROR_[A-Z_0-9]+)\s+=?\s*\(?([A-Z_0-9-][A-Z_0-9-+ ]+[A-Z_0-9])')
LoggerPattern = re.compile('NPT_SET_LOCAL_LOGGER\s*\([ "]*(\S+)[ "]*\)')
NakedErrorPattern = re.compile('return.*[ \(]..._FAILURE')
FilePatternH = re.c... | gpl-2.0 |
theflofly/tensorflow | tensorflow/python/data/experimental/kernel_tests/prefetch_to_device_test.py | 3 | 8640 | # 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 |
liangjiaxing/sympy | sympy/core/tests/test_eval_power.py | 45 | 12209 | from sympy.core import (
Rational, Symbol, S, Float, Integer, Number, Pow,
Basic, I, nan, pi, symbols, oo, zoo)
from sympy.core.tests.test_evalf import NS
from sympy.functions.elementary.miscellaneous import sqrt, cbrt
from sympy.functions.elementary.exponential import exp, log
from sympy.functions.elementary.t... | bsd-3-clause |
hkawasaki/kawasaki-aio8-2 | lms/envs/aws.py | 3 | 18142 | """
This is the default template for our main set of AWS servers. This does NOT
cover the content machines, which use content.py
Common traits:
* Use memcached, and cache-backed sessions
* Use a MySQL 5.1 database
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables fro... | agpl-3.0 |
polyaxon/polyaxon | core/polyaxon/polypod/compiler/converters/service.py | 1 | 3141 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 |
bdcht/amoco | amoco/arch/z80/spec_gb.py | 2 | 11709 | # -*- coding: utf-8 -*-
# This code is part of Amoco
# Copyright (C) 2012 Axel Tillequin (bdcht3@gmail.com)
# published under GPLv2 license
# spec_xxx files are providers for instruction objects.
# These objects are wrapped and created by disasm.py.
from amoco.logger import Log
logger = Log(__name__)
logger.debug("... | gpl-2.0 |
bparees/kubernetes | hack/verify-publishing-bot.py | 32 | 4816 | #!/usr/bin/env python
# Copyright 2019 The Kubernetes 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 appli... | apache-2.0 |
JakeBrand/CMPUT410-E4 | lab4/lib/python2.7/site-packages/jinja2/exceptions.py | 977 | 4428 | # -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import imap, text_type, PY2, implements_to_string
class TemplateError(Exception):
"""Baseclass for al... | apache-2.0 |
impowski/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_pdb.py | 170 | 9594 | import sys
import _pytest._code
def runpdb_and_get_report(testdir, source):
p = testdir.makepyfile(source)
result = testdir.runpytest_inprocess("--pdb", p)
reports = result.reprec.getreports("pytest_runtest_logreport")
assert len(reports) == 3, reports # setup/call/teardown
return reports[1]
cl... | mpl-2.0 |
mbox/django | tests/file_storage/tests.py | 3 | 25486 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import errno
import os
import shutil
import sys
import tempfile
import time
import unittest
from datetime import datetime, timedelta
try:
import threading
except ImportError:
import dummy_threading as threading
from django.core.cache import cach... | bsd-3-clause |
deepsrijit1105/edx-platform | lms/djangoapps/verified_track_content/forms.py | 28 | 1617 | """
Forms for configuring courses for verified track cohorting
"""
from django import forms
from django.utils.translation import ugettext as _
from xmodule.modulestore.django import modulestore
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from verified_track_content.models impor... | agpl-3.0 |
BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pandas/io/tests/parser/skiprows.py | 1 | 2376 | # -*- coding: utf-8 -*-
"""
Tests that skipped rows are properly handled during
parsing for all of the parsers defined in parsers.py
"""
from datetime import datetime
import numpy as np
import pandas.util.testing as tm
from pandas import DataFrame
from pandas.compat import StringIO, range, lrange
class SkipRowsT... | mit |
rrampage/rethinkdb | external/v8_3.30.33.16/build/gyp/test/additional-targets/gyptest-additional.py | 139 | 1530 | #!/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 simple actions when using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('all.g... | agpl-3.0 |
teosz/servo | tests/wpt/css-tests/tools/sslutils/openssl.py | 253 | 13023 | import functools
import os
import shutil
import subprocess
import tempfile
from datetime import datetime
class OpenSSL(object):
def __init__(self, logger, binary, base_path, conf_path, hosts, duration,
base_conf_path=None):
"""Context manager for interacting with OpenSSL.
Creates a... | mpl-2.0 |
mxamin/youtube-dl | youtube_dl/extractor/mixcloud.py | 16 | 11671 | from __future__ import unicode_literals
import base64
import functools
import itertools
import re
from .common import InfoExtractor
from ..compat import (
compat_chr,
compat_ord,
compat_urllib_parse_unquote,
compat_urlparse,
)
from ..utils import (
clean_html,
ExtractorError,
OnDemandPaged... | unlicense |
jhawkesworth/ansible | lib/ansible/modules/network/fortios/fortios_vpn_ipsec_phase1_interface.py | 21 | 54728 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
tafaRU/odoo | addons/account_bank_statement_extensions/report/__init__.py | 415 | 1128 | # -*- 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
# i... | agpl-3.0 |
kaichogami/scikit-learn | sklearn/tests/test_learning_curve.py | 59 | 10869 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ... | bsd-3-clause |
alistairlow/tensorflow | tensorflow/contrib/learn/python/learn/estimators/metric_key.py | 89 | 1569 | # 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 |
mindw/pywinauto | pywinauto/unittests/test_menuwrapper.py | 3 | 2569 | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# 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 opti... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.