repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
Francis-Liu/animated-broccoli | nova/api/openstack/compute/schemas/cloudpipe.py | 80 | 1472 | # Copyright 2014 IBM Corporation. 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 ... | apache-2.0 |
theoryno3/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 13 | 43295 | import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... | bsd-3-clause |
jarped/QGIS | python/plugins/MetaSearch/dialogs/maindialog.py | 12 | 35391 | # -*- coding: utf-8 -*-
###############################################################################
#
# CSW Client
# ---------------------------------------------------------
# QGIS Catalogue Service client.
#
# Copyright (C) 2010 NextGIS (http://nextgis.org),
# Alexander Bruy (alexander.bruy@gma... | gpl-2.0 |
Theb-1/home-assistant | homeassistant/components/media_player/firetv.py | 2 | 5545 | """
homeassistant.components.media_player.firetv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to interact with FireTV devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.firetv/
"""
import logging
import requests
... | mit |
zsiciarz/django | django/conf/locale/nl/formats.py | 65 | 4405 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '20 januari 2009'
TIME_FORMAT = 'H:i' # '15:23'
DATET... | bsd-3-clause |
bhavin04890/finaldashboard | modules/eden/layouts.py | 7 | 13494 | # -*- coding: utf-8 -*-
""" Sahana Eden GUI Layouts (HTML Renderers)
@copyright: 2012 (c) Sahana Software Foundation
@license: MIT
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 Soft... | mit |
eestay/edx-platform | common/lib/xmodule/xmodule/video_module/video_utils.py | 18 | 2177 | # -*- coding: utf-8 -*-
"""
Module contains utils specific for video_module but not for transcripts.
"""
import json
import logging
import urllib
import requests
from requests.exceptions import RequestException
log = logging.getLogger(__name__)
def create_youtube_string(module):
"""
Create a string of Youtu... | agpl-3.0 |
romanz/electrum | plugins/digitalbitbox/qt.py | 1 | 1522 | from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
from .digitalbitbox import DigitalBitboxPlugin
from electrum.i18n import _
from electrum.plugins import hook
from electrum.wallet import Standard_Wallet
class Plugin(DigitalBitboxPlugin, QtPluginBase):
icon_unpaired = ":icons/digitalbitbox_unpaired.png"
... | mit |
meirwah/st2contrib | packs/lastline/actions/lib/analysis_apiclient.py | 10 | 79266 | #!/usr/bin/python
# flake8: noqa
# pylint: skip-file
"""
This is a Python client for the Lastline Analyst API.
The :py:class:`AnalysisClient` class implements
the client side of the Lastline Analyst API methods.
It can be imported into Python client code
that uses the API.
The client is available at
https://analysis.... | apache-2.0 |
msiedlarek/grpc | src/python/grpcio/tests/unit/framework/interfaces/face/_service.py | 4 | 11546 | # Copyright 2015, 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... | bsd-3-clause |
eonpatapon/rally | tests/unit/plugins/openstack/context/nova/test_flavors.py | 6 | 3957 | # Copyright 2014: Mirantis 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 b... | apache-2.0 |
402231444/c2g16 | w2/static/Brython2.0.0-20140209-164925/Lib/unittest/test/test_result.py | 788 | 19069 | import io
import sys
import textwrap
from test import support
import traceback
import unittest
class Test_TestResult(unittest.TestCase):
# Note: there are not separate tests for TestResult.wasSuccessful(),
# TestResult.errors, TestResult.failures, TestResult.testsRun or
# TestResult.shouldStop because t... | gpl-2.0 |
wolverineav/neutron | neutron/tests/unit/services/bgp/driver/ryu/test_driver.py | 3 | 12381 | # Copyright 2016 Huawei Technologies India Pvt. Ltd.
#
# 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 |
Nick-OpusVL/odoo | addons/mail/tests/__init__.py | 261 | 1173 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
illicitonion/buck | third-party/py/argparse/setup.py | 35 | 1372 | import sys, os
from setuptools import setup, find_packages
import argparse
long_description = open('README.txt').read()
setup_args = dict(
name="argparse",
version=argparse.__version__,
description='Python command-line parsing library',
long_description=long_description,
author="Thomas Waldmann... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/tap/ftp.py | 67 | 2002 | # -*- test-case-name: twisted.test.test_ftp_options -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
I am the support module for making a ftp server with twistd.
"""
from twisted.application import internet
from twisted.cred import portal, checkers, strcred
from twisted.protocols impor... | mit |
zaina/nova | nova/tests/unit/image/fake.py | 22 | 9432 | # Copyright 2011 Justin Santa Barbara
# Copyright 2012 OpenStack 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/l... | apache-2.0 |
ExCiteS/geokey-dataimports | geokey_dataimports/tests/test_views.py | 1 | 108533 | """All tests for views."""
import os
import json
from django.core.files import File
from django.core.urlresolvers import reverse
from django.http import HttpRequest
from django.template.loader import render_to_string
from django.test import TestCase, RequestFactory
from django.contrib.messages import get_messages
fro... | mit |
alazaro/tennis_tournament | django/contrib/flatpages/tests/templatetags.py | 228 | 5965 | import os
from django.conf import settings
from django.contrib.auth.models import AnonymousUser, User
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase
class FlatpageTemplateTagTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.te... | gpl-3.0 |
chadmv/cmt | scripts/cmt/rig/swingtwist.py | 1 | 14549 | """Creates a node network to extract swing/twist rotation of a transform to drive
another transforms offsetParentMatrix.
The network calculates the local rotation swing and twist offset around the specified
twist axis relative to the local rest orientation. This allows users to specify how
much swing and twist they w... | mit |
thundernet8/WRGameVideos-Server | venv/lib/python2.7/site-packages/setuptools/command/rotate.py | 461 | 2038 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
import os
from setuptools import Command
from setuptools.compat import basestring
class rotate(Command):
"""Delete older distributions"""
description = "delete older distributions, keeping N n... | gpl-2.0 |
TurkuNLP/SRNNMT | old_/big_run.py | 1 | 12851 | from keras.models import Sequential, Graph, Model, model_from_json
from keras.layers import Dense, Dropout, Activation, Merge, Input, merge, Flatten
from keras.layers.recurrent import GRU
from keras.callbacks import Callback,ModelCheckpoint
from keras.layers.embeddings import Embedding
import numpy as np
import sys
imp... | apache-2.0 |
caisq/tensorflow | tensorflow/python/estimator/export/export_test.py | 11 | 30792 | # 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 |
aisipos/django | tests/serializers/models/data.py | 26 | 7738 | """
******** Models for test_data.py ***********
The following classes are for testing basic data marshalling, including
NULL values, where allowed.
The basic idea is to have a model for each Django data type.
"""
from __future__ import unicode_literals
from django.contrib.contenttypes.fields import (
GenericForei... | bsd-3-clause |
mdibaiee/servo | tests/wpt/harness/wptrunner/manifestexpected.py | 91 | 7384 | # 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
import urlparse
from wptmanifest.backends import static
from wptmanifest.backends.static import ManifestItem
... | mpl-2.0 |
warrenspe/hconf | hconf/Config.py | 1 | 6230 | """
Copyright (C) 2016 Warren Spencer warrenspencer27@gmail.com
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 vers... | gpl-3.0 |
quanvm009/codev7 | openerp/addons/membership/wizard/__init__.py | 432 | 1071 | # -*- 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 |
hujiajie/chromium-crosswalk | tools/site_compare/drivers/win32/keyboard.py | 173 | 6934 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""SiteCompare module for simulating keyboard input.
This module contains functions that can be used to simulate a user
pressing k... | bsd-3-clause |
mgagne/nova | nova/openstack/common/report/generators/version.py | 29 | 1648 | # Copyright 2013 Red Hat, 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 agre... | apache-2.0 |
Xykon/pycom-micropython-sigfox | esp32/get_idf_libs.py | 2 | 2254 | import os
import sys
import argparse
import shutil
def main():
cmd_parser = argparse.ArgumentParser(description='Get the precompiled libs from the IDF')
cmd_parser.add_argument('--idflibs', default=None, help='the path to the idf libraries')
cmd_args = cmd_parser.parse_args()
src = cmd_args.idflibs
... | mit |
w1ll1am23/home-assistant | homeassistant/components/rocketchat/notify.py | 21 | 2362 | """Rocket.Chat notification service."""
import logging
from rocketchat_API.APIExceptions.RocketExceptions import (
RocketAuthenticationException,
RocketConnectionException,
)
from rocketchat_API.rocketchat import RocketChat
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
... | apache-2.0 |
vidbina/ansible | lib/ansible/inventory/ini.py | 11 | 14176 | # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | gpl-3.0 |
etherkit/OpenBeacon2 | client/macos/venv/lib/python3.8/site-packages/pip/_vendor/html5lib/treewalkers/dom.py | 510 | 1413 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import Node
from . import base
class TreeWalker(base.NonRecursiveTreeWalker):
def getNodeDetails(self, node):
if node.nodeType == Node.DOCUMENT_TYPE_NODE:
return base.DOCTYPE, node.name, node.publicId, node.syste... | gpl-3.0 |
vbannai/neutron | neutron/tests/unit/linuxbridge/test_linuxbridge_plugin.py | 12 | 5015 | # Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 |
ShpuntiK/lens_alert_proto | lins_alert/settings.py | 2 | 5285 | # Django settings for lins_alert project.
import os
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATE_INPUT_FORMATS = ('%d.%m.%Y',)
DATETIME_INPUT_FORMATS = ('%d.%m.%Y %H:%M:%S',)
TIME_INPUT_FORMATS = ('%H:%M',)
ADMINS = (
# ('Your Name', 'your_email@example.com')... | mit |
tgcmteam/tgcmlinux | src/tgcm/contrib/freedesktopnet/networkmanager/activeconnection.py | 1 | 2450 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Martin Vidner
#
#
# Authors:
# Martin Vidner <martin at vidnet.net>
#
# 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 |
tunneff/tef | deps/boost_1_63_0/tools/build/src/build/property_set.py | 15 | 17169 | # Status: ported.
# Base revision: 40480
# Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its s... | lgpl-3.0 |
OnlyInAmerica/django-basic-apps | basic/groups/tests.py | 10 | 4894 | from django.test import TestCase
from django.core import management
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from basic.groups.models import *
class GroupTestCase(TestCase):
fixtures = ['groups.json', 'users.json']
def setUp(self):
self.user1 = User.ob... | bsd-3-clause |
gannetson/django | tests/template_tests/syntax_tests/test_load.py | 475 | 3378 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class LoadTagTests(SimpleTestCase):
libraries = {
'subpackage.echo': 'template_tests.templatetags.subpackage.echo',
'testtags': 'template_tests.templatetags.testtags',
}
@setu... | bsd-3-clause |
derekgreene/twitter-jsonl-tools | jsonl-tweet-export.py | 1 | 2962 | #!/usr/bin/env python
"""
A very simple script to export tweets from a JSONL file in CSV format.
Sample usage:
python jsonl-tweet-export.py sample/sample-tweets-500.jsonl -o sample/sample-tweets.csv
"""
import sys, fileinput, codecs, re
from datetime import datetime
from optparse import OptionParser
import logging as ... | apache-2.0 |
a-sevin/freeopcua | tests/gmock/gtest/test/gtest_help_test.py | 9 | 5876 | #!/usr/bin/env python
#
# Copyright 2009, 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... | lgpl-3.0 |
GunoH/intellij-community | python/helpers/sphinxcontrib/napoleon/__init__.py | 64 | 13805 | # -*- coding: utf-8 -*-
# Copyright 2014 Rob Ruana
# Licensed under the BSD License, see LICENSE file for details.
"""Sphinx napoleon extension -- support for NumPy and Google style docstrings.
"""
import sys
from six import iteritems
from sphinxcontrib.napoleon.docstring import GoogleDocstring, NumpyDocstring
from ... | apache-2.0 |
BhallaLab/moose | moose-core/tests/python/Rallpacks/moose_vs_neuron/rallpack3/profile_rallapck.py | 3 | 3449 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""profile_rallapck.py:
Last modified: Sat Jan 18, 2014 05:01PM
"""
from __future__ import print_function
__author__ = "Dilawar Singh"
__copyright__ = "Copyright 2013, NCBS Bangalore"
__credits__ = ["NCBS Bangalore", "Bhalla Lab"]
__license__ ... | gpl-3.0 |
alianmohammad/pd-gem5-latest | src/python/m5/internal/params.py | 76 | 1827 | # Copyright (c) 2010 The Hewlett-Packard Development Company
# 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... | bsd-3-clause |
2014c2g18/c2g18 | wsgi/static/Brython2.1.0-20140419-113919/Lib/io.py | 58 | 9385 | import builtins
open = builtins.open
# for seek()
SEEK_SET = 0
SEEK_CUR = 1
SEEK_END = 2
r"""File-like objects that read from or write to a string buffer.
This implements (nearly) all stdio methods.
f = StringIO() # ready for writing
f = StringIO(buf) # ready for reading
f.close() # explicitly rel... | gpl-2.0 |
liorvh/raspberry_pwn | src/pentest/sqlmap/plugins/dbms/postgresql/takeover.py | 7 | 3426 | #!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
from lib.core.common import Backend
from lib.core.common import randomStr
from lib.core.data import kb
from lib.core.data import logger
from lib.core.data import pa... | gpl-3.0 |
AlexStarov/Shop | applications/delivery2/urls.py | 1 | 1073 | # -*- coding: utf-8 -*-
from django.conf.urls import url
from applications.delivery2 import views
__author__ = 'AlexStarov'
urlpatterns = [
# aaa=re.compile(r'^\?(?P<key>[a-zA-Z0-9]{64,64})$')
# print re.match(aaa, '?naJX2WhVXlGtXlg0NFhbY1hqXu51M8MyUzwxpLm1SBvdcWerdNDRJPmtXmZYR0qe').group('key')
# url(regex=r'^\?... | apache-2.0 |
timothycrosley/webelements_site | pygments/styles/bw.py | 26 | 1355 | # -*- coding: utf-8 -*-
"""
pygments.styles.bw
~~~~~~~~~~~~~~~~~~
Simple black/white only style.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, Strin... | mit |
gkadillak/rockstor-core | src/rockstor/fs/btrfs.py | 1 | 31825 | """
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gpl-3.0 |
HeraclesHX/scikit-learn | doc/tutorial/machine_learning_map/pyparsing.py | 258 | 137838 | # module pyparsing.py
#
# Copyright (c) 2003-2008 Paul T. McGuire
#
# 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 u... | bsd-3-clause |
mekinik232/ambipi | lib/gtest/test/gtest_color_test.py | 3259 | 4911 | #!/usr/bin/env python
#
# Copyright 2008, 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... | gpl-2.0 |
nevins-b/lemur | lemur/plugins/lemur_kubernetes/plugin.py | 1 | 5423 | """
.. module: lemur.plugins.lemur_kubernetes.plugin
:platform: Unix
:copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
The plugin inserts certificates and the private key as Kubernetes secret that
can later be used to secure service endpoin... | apache-2.0 |
jfinkels/turingmachine | test_turingmachine.py | 1 | 11279 | # test_turingmachine.py - tests for turingmachine.py
#
# Copyright 2014 Jeffrey Finkelstein.
#
# This file is part of turingmachine.
#
# turingmachine 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 ver... | gpl-3.0 |
FujitsuEnablingSoftwareTechnologyGmbH/tempest | tempest/api/monitoring/test_monitoring_alarming_api.py | 1 | 38475 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
andresailer/DIRAC | StorageManagementSystem/Agent/RequestFinalizationAgent.py | 12 | 7247 | __RCSID__ = "$Id$"
from DIRAC import S_OK, gLogger
from DIRAC.Core.Base.AgentModule import AgentModule
from DIRAC.StorageManagementSystem.Client.StorageManagerClient import StorageManagerClient
from DIRAC.Core.DISET.RPCClient import RPCClient
AGENT_NAME... | gpl-3.0 |
Vvucinic/Wander | venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/auth/checks.py | 374 | 2098 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.core import checks
def check_user_model(**kwargs):
errors = []
cls = apps.get_model(settings.AUTH_USER_MODEL)
# Check that REQUIRED_FIELDS is a list
if not isins... | artistic-2.0 |
michigraber/scikit-learn | sklearn/datasets/mldata.py | 309 | 7838 | """Automatically download MLdata datasets."""
# Copyright (c) 2011 Pietro Berkes
# License: BSD 3 clause
import os
from os.path import join, exists
import re
import numbers
try:
# Python 2
from urllib2 import HTTPError
from urllib2 import quote
from urllib2 import urlopen
except ImportError:
# Pyt... | bsd-3-clause |
z-e-r-o/plugin.video.osn | resources/lib/dns/rrset.py | 8 | 5896 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation 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 "... | gpl-3.0 |
beiko-lab/gengis | bin/Lib/test/test_argparse.py | 2 | 156515 | # Author: Steven J. Bethard <steven.bethard@gmail.com>.
import codecs
import inspect
import os
import shutil
import stat
import sys
import textwrap
import tempfile
import unittest
import argparse
from StringIO import StringIO
class StdIOBuffer(StringIO):
pass
from test import test_support
c... | gpl-3.0 |
tensorflow/datasets | tensorflow_datasets/structured/dart/dart.py | 1 | 4869 | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... | apache-2.0 |
Mitali-Sodhi/CodeLingo | Dataset/python/multi_interface.py | 1 | 6077 | import re
import time
import sys
import os
import copy
PARAMS = {}
NAME_PREFIX = 'vm_'
METRICS = {
'time' : 0,
'data' : {}
}
LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_MAX = 5
INTERFACES = []
descriptors = []
stats_tab = {
"rx_bytes" : 0,
"rx_pkts" : 1,
"rx_errs" : 2,
"rx_drop... | mit |
40223101/w16b_test | static/Brython3.1.1-20150328-091302/Lib/unittest/signals.py | 1016 | 2403 | import signal
import weakref
from functools import wraps
__unittest = True
class _InterruptHandler(object):
def __init__(self, default_handler):
self.called = False
self.original_handler = default_handler
if isinstance(default_handler, int):
if default_handler == signal.SIG_D... | agpl-3.0 |
jhajek/euca2ools | euca2ools/commands/autoscaling/disablemetricscollection.py | 6 | 1966 | # Copyright 2013 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 t... | bsd-2-clause |
szeged/servo | tests/wpt/web-platform-tests/webdriver/tests/get_element_rect/user_prompts.py | 24 | 4081 | # META: timeout=long
import pytest
from tests.support.asserts import assert_error, assert_success, assert_dialog_handled
from tests.support.helpers import element_rect
from tests.support.inline import inline
def get_element_rect(session, element_id):
return session.transport.send(
"GET",
"sessio... | mpl-2.0 |
markope/AutobahnPython | examples/twisted/websocket/echo_variants/server.py | 6 | 2189 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
luistorresm/odoo | addons/l10n_tr/__init__.py | 429 | 1050 | # -*- 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... | agpl-3.0 |
public-ink/public-ink | server/appengine-staging/lib/unidecode/x08e.py | 252 | 4659 | data = (
'Chu ', # 0x00
'Jing ', # 0x01
'Nie ', # 0x02
'Xiao ', # 0x03
'Bo ', # 0x04
'Chi ', # 0x05
'Qun ', # 0x06
'Mou ', # 0x07
'Shu ', # 0x08
'Lang ', # 0x09
'Yong ', # 0x0a
'Jiao ', # 0x0b
'Chou ', # 0x0c
'Qiao ', # 0x0d
'[?] ', # 0x0e
'Ta ', # 0x0f
'Jian ', # 0x10... | gpl-3.0 |
samba-team/samba | third_party/waf/waflib/extras/use_config.py | 49 | 5657 | #!/usr/bin/env python
# coding=utf-8
# Mathieu Courtois - EDF R&D, 2013 - http://www.code-aster.org
"""
When a project has a lot of options the 'waf configure' command line can be
very long and it becomes a cause of error.
This tool provides a convenient way to load a set of configuration parameters
from a local file ... | gpl-3.0 |
bq/Ultimaker-Cura | plugins/3MFReader/ThreeMFReader.py | 2 | 6020 | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Mesh.MeshReader import MeshReader
from UM.Mesh.MeshData import MeshData
from UM.Logger import Logger
from UM.Math.Matrix import Matrix
from UM.Math.Vector import Vector
from UM.Scene.SceneNode import SceneNode
from ... | agpl-3.0 |
waheedahmed/edx-platform | openedx/core/djangoapps/user_api/preferences/views.py | 60 | 10869 | """
NOTE: this API is WIP and has not yet been approved. Do not use this API
without talking to Christina or Andy.
For more information, see:
https://openedx.atlassian.net/wiki/display/TNL/User+API
"""
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import stat... | agpl-3.0 |
sarvex/tensorflow | tensorflow/python/eager/imperative_grad.py | 18 | 3057 | # 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 |
saisai/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/statusserver_mock.py | 125 | 2788 | # Copyright (C) 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... | bsd-3-clause |
krsreenatha/xhtml2pdf | test/visualdiff.py | 154 | 3375 | # Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | apache-2.0 |
nhomar/odoo | addons/account_chart/__openerp__.py | 313 | 1451 | # -*- 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 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/pip/req/req_uninstall.py | 249 | 7135 | from __future__ import absolute_import
import logging
import os
import sys
import tempfile
from pip.compat import uses_pycache, WINDOWS, cache_from_source
from pip.exceptions import UninstallationError
from pip.utils import (rmtree, ask, is_local, dist_is_local, renames,
normalize_path)
from pi... | agpl-3.0 |
SubhrajyotiSen/HelioxKernelHarpia | gcc-linaro/share/gdb/python/gdb/function/strfns.py | 26 | 2684 | # Useful gdb string convenience functions.
# Copyright (C) 2012-2016 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at you... | gpl-2.0 |
shsingh/ansible | lib/ansible/modules/network/fortios/fortios_system_vxlan.py | 7 | 11968 | #!/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 |
Beyond-Imagination/BlubBlub | RaspberryPI/django-env/bin/miniterm.py | 1 | 35109 | #!/home/pi/Django/bin/python3
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading
import serial
from serial.tools.list_po... | gpl-3.0 |
Mirantis/tempest | tempest/api/compute/v3/servers/test_multiple_create.py | 6 | 2323 | # Copyright 2013 IBM Corp
# 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 appl... | apache-2.0 |
shivaenigma/pycoin | tests/bip32_test.py | 1 | 15806 | import unittest
from pycoin.key.BIP32Node import BIP32Node
from pycoin.serialize import h2b
class Bip0032TestCase(unittest.TestCase):
def test_vector_1(self):
master = BIP32Node.from_master_secret(h2b("000102030405060708090a0b0c0d0e0f"))
self.assertEqual(
master.wallet_key(as_private=... | mit |
k0ste/ansible | test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/utils/utils.py | 47 | 5828 | # -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# utils
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils.six import iteritems
from ansible_collections.ansible.... | gpl-3.0 |
sivertkh/gtrackcore | gtrackcore/test/track_operations/operations/FilterTest.py | 1 | 10998 | import unittest
import numpy as np
from gtrackcore.metadata import GenomeInfo
from gtrackcore.track.core.GenomeRegion import GenomeRegion
from gtrackcore.track_operations.operations.Filter import Filter
from gtrackcore.test.track_operations.TestUtils import \
createSimpleTestTrackContent
class FilterTest(unitte... | gpl-3.0 |
jchevin/MissionPlanner-master | Lib/email/errors.py | 468 | 1628 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""email package exception classes."""
class MessageError(Exception):
"""Base class for errors in the email package."""
class MessageParseError(MessageError):
"""Base class for message parsing erro... | gpl-3.0 |
openmotics/gateway | src/gateway/group_action_controller.py | 1 | 2954 | # Copyright (C) 2020 OpenMotics BV
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribu... | agpl-3.0 |
paboldin/rally | rally/task/sla.py | 10 | 4319 | # Copyright 2014: Mirantis 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 b... | apache-2.0 |
kmspriyatham/symath | scipy/scipy/signal/tests/test_filter_design.py | 4 | 5659 | from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import TestCase, assert_array_almost_equal, \
assert_array_equal, assert_raises, assert_equal, assert_, \
run_module_suite
from scipy.signal import tf2zpk, zpk2tf, BadCoefficients, f... | apache-2.0 |
saradbowman/osf.io | website/util/rubeus.py | 10 | 11923 | # -*- coding: utf-8 -*-
"""Contains helper functions for generating correctly
formatted hgrid list/folders.
"""
import logging
from django.utils import timezone
from framework import sentry
from framework.auth.decorators import Auth
from django.apps import apps
from django.db.models import Exists, OuterRef, Case, Wh... | apache-2.0 |
CraigHarris/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/utilities/recoverseg/gprecoverseg_tests/fault/genFault.py | 9 | 13598 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | apache-2.0 |
SymbiFlow/edalize | tests/test_vunit/run.py | 1 | 1483 | # Auto generated by Edalize
def load_module_from_file(name, python_file):
import importlib.util
spec = importlib.util.spec_from_file_location(name, python_file)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
def load_runner_hooks(python_file = r''):
... | bsd-2-clause |
seanwestfall/django | tests/inspectdb/tests.py | 89 | 12808 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from unittest import skipUnless
from django.core.management import call_command
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
from django.utils.six import PY3, StringIO
from .models import ColumnTypes... | bsd-3-clause |
acshan/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py | 293 | 4469 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2013 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
endere/Data-structures-2nd-half | src/hash.py | 1 | 2101 | """Hash tables."""
import bst
class HashTable(object):
"""Class object for our Hash Table."""
def __init__(self, bucket_number, function='fnv'):
"""Init for our hash.
Accepts a string to determine which hash the table uses.
"""
self.bucket_list = []
self.function = fu... | mit |
40223136/-2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/sre_compile.py | 630 | 16898 | #
# Secret Labs' Regular Expression Engine
#
# convert template to internal format
#
# Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
import sys
import _sre
import sre_parse
from sre_constan... | gpl-3.0 |
sumanau7/Ele_CC_Sumanau | lib/IPython/core/magic.py | 5 | 26508 | # encoding: utf-8
"""Magic functions for InteractiveShell.
"""
from __future__ import print_function
#-----------------------------------------------------------------------------
# Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
# Copyright (C) 2001 Fernando Perez <fperez@colorado.edu>
# Copyright (C) 2008... | apache-2.0 |
haste/ivar2 | tools/irssilogparser.py | 2 | 6777 | #!/usr/bin/env python
# A script to parse irssi log files and put URLs into postgresql
# supports two codecs, utf-8 and iso-8859-1.
# supports norwegian and us local for day changed messages
# author: xt <xt@bash.no>
import codecs
import sys
import psycopg2
import re
verbose = False
maxlinelength = 2000
linenumber = ... | mit |
shubhamgupta123/erpnext | erpnext/crm/report/lead_conversion_time/lead_conversion_time.py | 4 | 2916 | # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import date_diff, flt
def execute(filters=None):
if not filters: filters = {}
communication_l... | gpl-3.0 |
knittledan/imageResizer | PIL/linux/PIL/_binary.py | 19 | 1575 | #
# The Python Imaging Library.
# $Id$
#
# Binary input/output support routines.
#
# Copyright (c) 1997-2003 by Secret Labs AB
# Copyright (c) 1995-2003 by Fredrik Lundh
# Copyright (c) 2012 by Brian Crowell
#
# See the README file for information on usage and redistribution.
#
if bytes is str:
def i8(c):
... | mit |
zhenkyn/vkfeedd | PyRSS2Gen/example.py | 18 | 1526 | # An example of how to generate a feed by hand.
import datetime
import PyRSS2Gen
rss = PyRSS2Gen.RSS2(
title = "Andrew's PyRSS2Gen feed",
link = "http://www.dalkescientific.com/Python/PyRSS2Gen.html",
description = "The latest news about PyRSS2Gen, a "
"Python library for generating RSS2... | bsd-2-clause |
ezequielpereira/Time-Line | libs_arm/wx/lib/embeddedimage.py | 3 | 2376 | #----------------------------------------------------------------------
# Name: wx.lib.embeddedimage
# Purpose: Defines a class used for embedding PNG images in Python
# code. The primary method of using this module is via
# the code generator in wx.tools.img2py.
#
# Author: An... | gpl-3.0 |
alexlo03/ansible | lib/ansible/modules/network/avi/avi_actiongroupconfig.py | 20 | 5478 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.