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 |
|---|---|---|---|---|---|
kubeflow/kfp-tekton-backend | sdk/python/tests/compiler/testdata/withparam_output_dict.py | 1 | 2310 | # 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, ... | apache-2.0 |
softDi/clusim | ns3/bake/generate-binary.py | 3 | 3346 | ###############################################################################
# Copyright (c) 2013 INRIA
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# This program is distr... | apache-2.0 |
tintinweb/scapy-ssl_tls | utils/fetch_iana_tls_registry.py | 1 | 4752 | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
# Author : tintinweb@oststrom.com <github.com/tintinweb>
"""
Create python dictionary from IANA only TLS registry
requires Python 2.7 (xml.etree.ElementTree)
"""
from __future__ import print_function
import sys
import os
import datetime
import urllib2
import re
import xm... | gpl-2.0 |
jkandasa/integration_tests | cfme/cloud/tenant.py | 1 | 12959 | """ Page functions for Tenant pages
"""
import attr
from navmazing import NavigateToSibling, NavigateToAttribute
from widgetastic.exceptions import NoSuchElementException
from widgetastic.utils import VersionPick
from widgetastic.widget import View
from widgetastic_patternfly import BootstrapNav, Button, Dropdown, Flas... | gpl-2.0 |
Ademan/NumPy-GSoC | numpy/lib/stride_tricks.py | 7 | 3972 | """
Utilities that manipulate strides to achieve desirable effects.
An explanation of strides can be found in the "ndarray.rst" file in the
NumPy reference guide.
"""
import numpy as np
__all__ = ['broadcast_arrays']
class DummyArray(object):
""" Dummy object that just exists to hang __array_interface__ diction... | bsd-3-clause |
mcking49/apache-flask | Python/Lib/site-packages/pip/commands/freeze.py | 143 | 2774 | from __future__ import absolute_import
import sys
import pip
from pip.compat import stdlib_pkgs
from pip.basecommand import Command
from pip.operations.freeze import freeze
from pip.wheel import WheelCache
DEV_PKGS = ('pip', 'setuptools', 'distribute', 'wheel')
class FreezeCommand(Command):
"""
Output ins... | mit |
3dfxsoftware/cbss-addons | sale/res_partner.py | 94 | 1964 | # -*- 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... | gpl-2.0 |
liqingzhu/mobile-chrome-apps | chrome-cordova/gcmServer/xmpp/features.py | 199 | 8578 | ## features.py
##
## Copyright (C) 2003-2004 Alexey "Snake" Nezhdanov
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later versio... | bsd-3-clause |
leilihh/nova | nova/api/metadata/base.py | 5 | 19319 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
petrjasek/superdesk-ntb | server/ntb/io/feed_parsers/ntb_newsml.py | 3 | 1341 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2018 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from superdesk.io.... | agpl-3.0 |
hachihub/ubuntu-init | python/src/where.py | 2 | 1627 | #!/usr/bin/env python3
#purpose:
#o take a note of every dir that I have been to.
#o `cd ori xx' should list the dirs that match these tokens,
#o better yet, it should allow me to choose which one and the change into it.
#o The dir history should be in the order that's last visited.
#cd ori ext
import os
from pkg.o... | apache-2.0 |
allenl203/tornado | tornado/test/auth_test.py | 7 | 23437 | # These tests do not currently do much to verify the correct implementation
# of the openid/oauth protocols, they just exercise the major code paths
# and ensure that it doesn't blow up (e.g. with unicode/bytes issues in
# python 3)
import unittest
from tornado.auth import (
OpenIdMixin,
OAuthMixin,
OAuth... | apache-2.0 |
MIPS/external-chromium_org | remoting/tools/native_messaging_host_test.py | 147 | 3918 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Interactive test script for the Chromoting host native messaging component.
import json
import readline
import struct
import subproc... | bsd-3-clause |
marcore/edx-platform | common/test/acceptance/fixtures/certificates.py | 47 | 2075 | """
Tools for creating certificates config fixture data.
"""
import json
from common.test.acceptance.fixtures import STUDIO_BASE_URL
from common.test.acceptance.fixtures.base import StudioApiFixture
class CertificateConfigFixtureError(Exception):
"""
Error occurred while installing certificate config fixtur... | agpl-3.0 |
playm2mboy/edx-platform | common/lib/xmodule/xmodule/fields.py | 144 | 8932 | import time
import logging
import re
from xblock.fields import JSONField
import datetime
import dateutil.parser
from pytz import UTC
log = logging.getLogger(__name__)
class Date(JSONField):
'''
Date fields know how to parse and produce json (iso) compatible formats. Converts to tz aware datetimes.
'''
... | agpl-3.0 |
Vishluck/sympy | sympy/integrals/deltafunctions.py | 57 | 6212 | from __future__ import print_function, division
from sympy.core import Mul
from sympy.functions import DiracDelta, Heaviside
from sympy.core.compatibility import default_sort_key
def change_mul(node, x):
"""change_mul(node, x)
Rearranges the operands of a product, bringing to front any simple
Dira... | bsd-3-clause |
dmuhs/falcon-stats | tests/test_middleware.py | 1 | 4166 | import logging
import falcon
from falcon import testing
from falconstats import FalconStatsMiddleware, models
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
logging.basicConfig(level=logging.DEBUG)
# Illegal methods are PUT, HEAD, PATCH, DELETE
test_resource = testing.SimpleTestResource... | mit |
open-research/sumatra | sumatra/dependency_finder/r.py | 5 | 3930 | """
:copyright: Copyright 2006-2015 by the Sumatra team, see doc/authors.txt
:license: BSD 2-clause, see LICENSE for details.
"""
from __future__ import unicode_literals
import subprocess
import pkg_resources
from sumatra.dependency_finder import core
package_split_str = 'pkg::\n'
element_split_str = '\n'
name_valu... | bsd-2-clause |
shrimpboyho/git.js | emscript/python/2.7.5.1_32bit/Lib/test/test_abc.py | 119 | 7715 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Unit tests for abc.py."""
import unittest, weakref
from test import test_support
import abc
from inspect import isabstract
class TestABC(unittest.TestCase):
def test_abstractmethod_basics(self):
@abc... | gpl-2.0 |
ales-erjavec/orange | Orange/OrangeWidgets/plot/owaxis.py | 6 | 13112 | """
The Axis class display an axis on a graph
The axis contains a line with configurable style, possible arrows, and a title
.. attribute:: line_style
The LineStyle with which the axis line is drawn
.. attribute:: title
The string to be displayed alongside the axis
... | gpl-3.0 |
mkennedy04/knodj | env/Lib/site-packages/django/contrib/staticfiles/storage.py | 103 | 14788 | from __future__ import unicode_literals
import hashlib
import json
import os
import posixpath
import re
from collections import OrderedDict
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.cache import (
InvalidCacheBackendError, cache... | mit |
rafaelmartins/g-octave | g_octave/log.py | 2 | 1796 | # -*- coding: utf-8 -*-
"""
log.py
~~~~~~
a simple Python module to deal with g-octave logging stuff.
:copyright: (c) 2010 by Rafael Goncalves Martins
:license: GPL-2, see LICENSE for more details.
"""
from __future__ import print_function, absolute_import
__all__ = ['Log']
import logg... | gpl-2.0 |
SylvainCecchetto/plugin.video.catchuptvandmore | plugin.video.catchuptvandmore/resources/lib/channels/wo/rt.py | 1 | 14625 | # -*- coding: utf-8 -*-
"""
Catch-up TV & More
Copyright (C) 2019 SylvainCecchetto
This file is part of Catch-up TV & More.
Catch-up TV & More 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 Foundat... | gpl-2.0 |
caktus/ibid | ibid/source/pb.py | 2 | 1593 | # Copyright (c) 2009-2010, Michael Gorven
# Released under terms of the MIT/X/Expat Licence. See COPYING for details.
import logging
from twisted.spread import pb
from twisted.application import internet
from twisted.internet import reactor
import ibid
from ibid.source import IbidSourceFactory
from ibid.config impor... | gpl-3.0 |
newerthcom/savagerebirth | libs/python-2.72/Lib/test/test_profile.py | 133 | 8031 | """Test suite for the profile module."""
import sys
import pstats
import unittest
from StringIO import StringIO
from test.test_support import run_unittest
import profile
from test.profilee import testfunc, timer
class ProfileTest(unittest.TestCase):
profilerclass = profile.Profile
methodnames = ['print_sta... | gpl-2.0 |
klaus385/openpilot | selfdrive/locationd/ublox.py | 2 | 31596 | #!/usr/bin/env python
'''
UBlox binary protocol handling
Copyright Andrew Tridgell, October 2012
Released under GNU GPL version 3 or later
WARNING: This code has originally intended for
ublox version 7, it has been adapted to work
for ublox version 8, not all functions may work.
'''
import struct
import time, os
# ... | mit |
pkuyym/Paddle | python/paddle/fluid/recordio_writer.py | 3 | 1646 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | apache-2.0 |
denisff/python-for-android | python-modules/twisted/twisted/names/dns.py | 49 | 53596 | # -*- test-case-name: twisted.names.test.test_dns -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DNS protocol implementation.
Future Plans:
- Get rid of some toplevels, maybe.
@author: Moshe Zadka
@author: Jean-Paul Calderone
"""
__all__ = [
'IEncodable', 'IRecord'... | apache-2.0 |
cherrydocker/minos | supervisor/supervisor/medusa/monitor.py | 5 | 11120 | # -*- Mode: Python -*-
# Author: Sam Rushing <rushing@nightmare.com>
#
# python REPL channel.
#
RCS_ID = '$Id: monitor.py,v 1.5 2002/03/23 15:08:06 amk Exp $'
import md5
import socket
import string
import sys
import time
VERSION = string.split(RCS_ID)[2]
import asyncore_25 as asyncore
import asynchat_25 as a... | apache-2.0 |
elky/django | tests/auth_tests/test_decorators.py | 68 | 4129 | from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import login_required, permission_required
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.test.client impo... | bsd-3-clause |
raiabril/arduino_logger | altgraph-0.12-py2.7.egg/altgraph/Dot.py | 27 | 9782 | '''
altgraph.Dot - Interface to the dot language
============================================
The :py:mod:`~altgraph.Dot` module provides a simple interface to the
file format used in the `graphviz <http://www.research.att.com/sw/tools/graphviz/>`_
program. The module is intended to offload the most tedious part of th... | gpl-2.0 |
double12gzh/nova | nova/cmd/cert.py | 22 | 1293 | # Copyright 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 ... | apache-2.0 |
airspeed-velocity/asv | test/test_benchmarks.py | 3 | 10841 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import sys
import shutil
from os.path import join, dirname
import pytest
import six
import textwrap
from hashl... | bsd-3-clause |
pgdr/ert | python/python/ert_gui/ide/keywords/definitions/string_argument.py | 5 | 1217 | import re
from ert_gui.ide.keywords.definitions import ArgumentDefinition
class StringArgument(ArgumentDefinition):
NOT_A_VALID_STRING = "The argument must be a valid string."
PATTERN = re.compile("^[\S]+$")
PATTERN_WITH_SPACE = re.compile("^[\S| ]+$")
def __init__(self, allow_space=False, **kwarg... | gpl-3.0 |
richardotis/scipy | scipy/sparse/csgraph/__init__.py | 20 | 7254 | r"""
==============================================================
Compressed Sparse Graph Routines (:mod:`scipy.sparse.csgraph`)
==============================================================
.. currentmodule:: scipy.sparse.csgraph
Fast graph algorithms based on sparse matrix representations.
Contents
========
..... | bsd-3-clause |
peterbraden/tensorflow | tensorflow/contrib/layers/python/layers/optimizers.py | 2 | 6727 | # 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 law or a... | apache-2.0 |
witwall/gyp | test/mac/gyptest-framework-headers.py | 344 | 1103 | #!/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 mac_framework_headers works properly.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
# TODO(thakis): Make... | bsd-3-clause |
jayflo/scikit-learn | examples/decomposition/plot_pca_3d.py | 354 | 2432 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Principal components analysis (PCA)
=========================================================
These figures aid in illustrating how a point cloud
can be very flat in one direction--which is where PCA
comes in to ch... | bsd-3-clause |
mshahbaz/exabgp | lib/exabgp/configuration/json.py | 5 | 3611 | # encoding: utf-8
"""
json.py
Created by Thomas Mangin on 2013-07-01.
Copyright (c) 2009-2012 Exa Networks. All rights reserved.
"""
from decimal import Decimal
from exabgp.util import coroutine
class JSONError(Exception):
pass
class UnexpectedData(JSONError):
def __init__(self, line, position, token):
super(U... | bsd-3-clause |
janisstreib/nan-hotline | phoneBackend/main.py | 1 | 1729 | import sys
import pjsua as pj
import _pjsua
import threading
from serverconfig import *
from telegram import TelegramComm
from config import *
from conversation import Conversation
from supporting import SupporterManager
import control_socket
def log_cb(level, str, len):
print str,
class MyAccountCallback(pj.A... | mit |
annatisch/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureResource/autorestresourceflatteningtestservice/models/flattened_product.py | 16 | 1970 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
leedm777/AutobahnPython | autobahn/autobahn/xormasker.py | 20 | 2828 | ###############################################################################
##
## Copyright 2012-2013 Tavendo GmbH
##
## 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
##
## ... | apache-2.0 |
SmartPeople/zulip | zerver/views/muting.py | 14 | 1592 | from __future__ import absolute_import
from django.http import HttpResponse, HttpRequest
from typing import List, Text
import ujson
from django.utils.translation import ugettext as _
from zerver.decorator import authenticated_json_post_view
from zerver.lib.actions import do_set_muted_topics, do_update_muted_topic
fr... | apache-2.0 |
tango-cs/PyTango | tango/group.py | 4 | 29645 | # ------------------------------------------------------------------------------
# This file is part of PyTango (http://pytango.rtfd.io)
#
# Copyright 2006-2012 CELLS / ALBA Synchrotron, Bellaterra, Spain
# Copyright 2013-2014 European Synchrotron Radiation Facility, Grenoble, France
#
# Distributed under the terms of ... | lgpl-3.0 |
NHellFire/kmotion | change_login_pw.py | 2 | 4582 | #!/usr/bin/env python
# Copyright 2008 David Selby dave6502googlemail.com
# This file is part of kmotion.
# kmotion 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 ... | gpl-3.0 |
kustodian/ansible | lib/ansible/modules/network/netvisor/pn_vrouter_pim_config.py | 35 | 4973 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# 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': ['... | gpl-3.0 |
qnib/qcollect | resources/diamond/collectors/cephstats/test/test_ceph.py | 33 | 1041 | #!/usr/bin/env python
import os
import sys
curdir = os.path.dirname(os.path.abspath(__file__))
os.chdir(curdir)
sys.path.insert(0, '../')
import unittest
import re
def get_ceph_info(info):
# pattern for ceph information
pattern = re.compile(r'\bclient io .*')
ceph_info = pattern.search(info).group()
... | apache-2.0 |
whn09/tensorflow | tensorflow/contrib/metrics/__init__.py | 43 | 6076 | # 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 |
SecondLiners/GO2 | sendgrid/helpers/inbound/parse.py | 3 | 3267 | """Parse data received from the SendGrid Inbound Parse webhook"""
import base64
import email
import mimetypes
from six import iteritems
from werkzeug.utils import secure_filename
class Parse(object):
def __init__(self, config, request):
self._keys = config.keys
self._request = request
req... | gpl-3.0 |
bigswitch/nova | nova/api/openstack/compute/server_migrations.py | 9 | 7257 | # Copyright 2016 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/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
rruebner/odoo | openerp/report/printscreen/__init__.py | 381 | 1203 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
JeonginKim/TizenRT | external/iotivity/iotivity_1.2-rel/tools/scons/Configure.py | 61 | 2955 | # -*- coding: utf-8 -*-
# *********************************************************************
#
# Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
#
# *********************************************************************
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | apache-2.0 |
geometalab/OSM-Crosswalk-Detection | src/data/osm/street_loader.py | 2 | 1749 | import logging
from src.base.node import Node
from src.base.street import Street
from src.base.tag import Tag
from src.data.osm.overpass_api import OverpassApi
logger = logging.getLogger(__name__)
class StreetLoader:
street_categories = [
'road',
'trunk',
'primary',
'secondary',
... | mit |
anewmark/galaxy_dark_matter | not currently in use/callclump.py | 1 | 2439 | print('Please for the love of God work.')
import os, sys
import astropy.table as table
from defclump import *
from defcuts import *
from defflags import *
indir='/Users/amandanewmark/repositories/galaxy_dark_matter/GAH/'
filename='LOWZ_HSCGAMA15_apmgs.fits'
outdir='/Users/amandanewmark/repositories/galaxy_dark_matter... | mit |
phalax4/CarnotKE | jyhton/Lib/pawt/colors.py | 112 | 4500 | from java.awt import Color
aliceblue = Color(240, 248, 255)
antiquewhite = Color(250, 235, 215)
aqua = Color(0, 255, 255)
aquamarine = Color(127, 255, 212)
azure = Color(240, 255, 255)
beige = Color(245, 245, 220)
bisque = Color(255, 228, 196)
black = Color(0, 0, 0)
blanchedalmond = Color(255, 235, 205)
blue = Color(0... | apache-2.0 |
chrisfilda/edx_platform | i18n/converter.py | 15 | 2551 | import re
import itertools
class Converter(object):
"""Converter is an abstract class that transforms strings.
It hides embedded tags (HTML or Python sequences) from transformation
To implement Converter, provide implementation for inner_convert_string()
Strategy:
1. extract tags e... | agpl-3.0 |
whs/django | django/contrib/syndication/views.py | 57 | 8617 | from calendar import timegm
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import Http404, HttpResponse
from django.template import TemplateDoesNotExist, loader
from django.utils i... | bsd-3-clause |
runjmc/maraschino | lib/sqlalchemy/dialects/mysql/zxjdbc.py | 23 | 3887 | # mysql/zxjdbc.py
# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the MySQL database via Jython's zxjdbc JDBC connector.
JDBC Driver
---... | mit |
aspidites/django | django/core/cache/backends/memcached.py | 320 | 6970 | "Memcached cache backend"
import pickle
import time
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.utils import six
from django.utils.encoding import force_str
from django.utils.functional import cached_property
class BaseMemcachedCache(BaseCache):
def __init__(self, server, ... | bsd-3-clause |
thecableguy11492/pynet_practice | class7/eapi_vlan_exercise_2.py | 1 | 2448 | #!/usr/bin/env python
import argparse
import pyeapi
def get_results(command):
return command[0]['result']
'''This evaluates True if the value exists and false if it does not exist'''
def check_vlan(connection, vlan_id):
vlan_id = str(vlan_id)
command = 'show vlan id {}'.format(vlan_id)
tr... | apache-2.0 |
ArthurGarnier/SickRage | lib/github/Download.py | 10 | 10579 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
ksrajkumar/openerp-6.1 | openerp/addons/purchase_analytic_plans/__openerp__.py | 9 | 1842 | # -*- 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 |
js0701/chromium-crosswalk | tools/perf/profile_creators/small_profile_extender.py | 31 | 1424 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import page_sets
from profile_creators import fast_navigation_profile_extender
class SmallProfileExtender(
fast_navigation_profile_extender.FastNaviga... | bsd-3-clause |
thezawad/ModemManager | test/disable.py | 4 | 1088 | #!/usr/bin/python
# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your ... | gpl-2.0 |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/asyncio/windows_utils.py | 11 | 5073 | """Various Windows specific bits and pieces."""
import sys
if sys.platform != 'win32': # pragma: no cover
raise ImportError('win32 only')
import _winapi
import itertools
import msvcrt
import os
import subprocess
import tempfile
import warnings
__all__ = 'pipe', 'Popen', 'PIPE', 'PipeHandle'
# Constants/glob... | gpl-3.0 |
vveliev/selenium | py/selenium/webdriver/chrome/webdriver.py | 25 | 3632 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
veritas-shine/minix3-rpi | external/bsd/llvm/dist/clang/tools/clang-format/clang-format.py | 6 | 2971 | # This file is a minimal clang-format vim-integration. To install:
# - Change 'binary' if clang-format is not on the path (see below).
# - Add to your .vimrc:
#
# map <C-I> :pyf <path-to-this-file>/clang-format.py<CR>
# imap <C-I> <ESC>:pyf <path-to-this-file>/clang-format.py<CR>i
#
# The first line enables clang-f... | apache-2.0 |
dmitry-sobolev/ansible | lib/ansible/modules/cloud/rackspace/rax_mon_check.py | 70 | 11319 | #!/usr/bin/python
# 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 distributed... | gpl-3.0 |
askomics/askomics | askomics/test/tripleStoreExplorer_test.py | 2 | 5844 | # import unittest
# import os
# import tempfile,shutil,copy
# from pyramid import testing
# from pyramid.paster import get_appsettings
# from askomics.libaskomics.TripleStoreExplorer import TripleStoreExplorer
# import json
# from interface_tps_db import InterfaceTpsDb
# class tripleStoreExplorerTests(unittest.TestC... | agpl-3.0 |
ryfeus/lambda-packs | Tensorflow_OpenCV_Nightly/source/tensorflow/contrib/labeled_tensor/python/ops/test_util.py | 139 | 1741 | # 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... | mit |
MakersF/cassiopeia | cassiopeia/type/api/store.py | 1 | 12543 | import cassiopeia.type.dto.common
import cassiopeia.type.core.common
if cassiopeia.type.dto.common.sqlalchemy_imported:
import sqlalchemy
import sqlalchemy.orm
class DataStore(object):
"""A place to store data. Used for caching/storing data from API calls"""
def has_all(self, class_):
... | mit |
milkpku/BetaElephant | policy_experiment/policy.non-constrain/model.py | 1 | 2320 | #!/usr/bin/python3
#-*-coding:utf-8-*-
#$File: model.py
#$Date: Sat May 7 10:59:45 2016
#$Author: Like Ma <milkpku[at]gmail[dot]com>
from config import Config
import tensorflow as tf
import functools
from util.model import Model, conv2d
def get_model(name):
name = functools.partial('{}-{}'.format, name)
s... | mit |
AWFU/bottle | test/test_router.py | 30 | 6661 | # -*- coding: utf-8 -*-
import unittest
import bottle
class TestRouter(unittest.TestCase):
CGI = False
def setUp(self):
self.r = bottle.Router()
def add(self, path, target, method='GET', **ka):
self.r.add(path, method, target, **ka)
def match(self, path, method='GET'):
... | mit |
gechong/XlsxWriter | xlsxwriter/test/comparison/test_chart_display_units02.py | 8 | 1414 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
nibanks/openthread | tools/harness-automation/cases/commissioner_8_1_6.py | 16 | 1887 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread 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:
# 1. Redistributions of source code must retain the above copyright
# notic... | bsd-3-clause |
SteveHNH/ansible | lib/ansible/module_utils/docker_common.py | 27 | 18294 | #
# Copyright 2016 Red Hat | Ansible
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | gpl-3.0 |
lukecwik/incubator-beam | sdks/python/apache_beam/io/aws/clients/s3/fake_client.py | 3 | 7782 | #
# 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 |
sjl767/woo | scripts/test-OLD/flat-collider.py | 2 | 1025 | from woo import log,utils,pack,timing
#log.setLevel('FlatGridCollider',log.TRACE)
#O.bodies.append([ utils.sphere((0.2,0,0),.5,dynamic=False), utils.sphere((0.2,0.0,1.01),.5), ])
O.bodies.append(pack.regularHexa(pack.inAlignedBox((0,0,0),(10,10,1)),radius=.5,gap=0,dynamic=False))
O.bodies.append(pack.regularOrtho(pa... | gpl-2.0 |
svastm/mbed | tools/host_tests/host_registry.py | 122 | 1214 | """
mbed SDK
Copyright (c) 2011-2013 ARM 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 or agreed to in wr... | apache-2.0 |
tinytux/sensor | micropython/humiditytemperature.py | 1 | 1494 | #
# Driver for the Adafruit HIH6130 Humidity Sensor Breakout on Micro Python PYB v1.0
#
from pyb import I2C
class HumidityTemperature(object):
"""Adafruit HIH6130 humidity sensor driver for Micro Python PYB v1.0."""
def __init__(self, i2c, addr=0x27):
"""I2C interface and sensor device address to be... | mit |
ABaldwinHunter/flask-clone-classic | examples/flaskr/test_flaskr.py | 157 | 2059 | # -*- coding: utf-8 -*-
"""
Flaskr Tests
~~~~~~~~~~~~
Tests the Flaskr application.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import os
import flaskr
import tempfile
@pytest.fixture
def client(request):
db_fd, flaskr.app.config['... | bsd-3-clause |
40223232/final-test-6-22 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/display.py | 603 | 25179 | #!/usr/bin/env python
'''Pygame module to control the display window and screen.
This module offers control over the pygame display. Pygame has a single display
Surface that is either contained in a window or runs full screen. Once you
create the display you treat it as a regular Surface. Changes are not
immediately ... | gpl-3.0 |
amith01994/intellij-community | python/lib/Lib/shelve.py | 91 | 7565 | """Manage shelves of pickled objects.
A "shelf" is a persistent, dictionary-like object. The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle. This includes most class instances, recursive data
type... | apache-2.0 |
bbansalWolfPack/servo | tests/wpt/web-platform-tests/annotation-model/tools/make_tests.py | 87 | 2765 | # Copyright (c) 2016 W3C
# Released under the W3C Test Suite License: see LICENSE.txt
# This tool creates .html test files for the WPT harness from corresponding .test
# files that it finds in the tree for this test collection.
import re
import time
import json
import fnmatch
import os
import shutil
import sys
impor... | mpl-2.0 |
jiangzhonghui/viewfinder | marketing/tornado/test/netutil_test.py | 23 | 2781 | from __future__ import absolute_import, division, print_function, with_statement
import socket
from tornado.netutil import BlockingResolver, ThreadedResolver, is_valid_ip
from tornado.testing import AsyncTestCase, gen_test
from tornado.test.util import unittest
try:
from concurrent import futures
except ImportEr... | apache-2.0 |
lfairchild/PmagPy | dialogs/thellier_gui_lib.py | 1 | 14923 | #!/usr/bin/env python
#---------------------------------------------------------------------------
# Author: Ron Shaar
# Revision notes
#
# Rev 1.0 Initial revision August 2012
# Rev 2.0 November 2014
#---------------------------------------------------------------------------
import matplotlib
import pylab,scipy
from... | bsd-3-clause |
springmeyer/djmapnik | examples/geoadmin/world/admin.py | 1 | 3892 | # admin.py
# This file controls the look and feel of the models within the Admin App
# They appear in the admin app once they are registered at the bottom of
# this code (same goes for the databrowse app)
from django.conf import settings # needed if we use the GOOGLE_MAPS_API_KEY from settings
# Import the admin si... | bsd-3-clause |
python-rope/rope | rope/refactor/rename.py | 3 | 9382 | import warnings
from rope.base import (exceptions, pyobjects, pynames, taskhandle,
evaluate, worder, codeanalyze, libutils)
from rope.base.change import ChangeSet, ChangeContents, MoveResource
from rope.refactor import occurrences
class Rename(object):
"""A class for performing rename refa... | lgpl-3.0 |
Maximilian-Reuter/SickRage-1 | lib/pgi/clib/gir/gistructinfo.py | 20 | 1954 | # Copyright 2012 Christoph Reiter
#
# 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 option) any later version.
from .._compat import xran... | gpl-3.0 |
reinout/ansible | lib/ansible/module_utils/urls.py | 125 | 31558 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
ArtsiomCh/tensorflow | tensorflow/python/training/adadelta_test.py | 87 | 6527 | # 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 |
googleapis/googleapis-gen | google/cloud/vision/v1p2beta1/vision-v1p2beta1-py/google/cloud/vision_v1p2beta1/types/text_annotation.py | 1 | 12514 | # -*- coding: utf-8 -*-
# Copyright 2020 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... | apache-2.0 |
cesargtz/YecoraOdoo | addons/subscription/__openerp__.py | 261 | 1885 | # -*- 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 |
350dotorg/Django | tests/regressiontests/one_to_one_regress/models.py | 92 | 1180 | from django.db import models
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
def __unicode__(self):
return u"%s the place" % self.name
class Restaurant(models.Model):
place = models.OneToOneField(Place)
serves_hot_dogs = models.B... | bsd-3-clause |
clemkoa/scikit-learn | sklearn/neural_network/rbm.py | 26 | 12280 | """Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from scipy.special import expit # logistic function
from ..base im... | bsd-3-clause |
Sorsly/subtle | google-cloud-sdk/lib/surface/meta/render_markdown.py | 6 | 1339 | # 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 law or ag... | mit |
fitermay/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/se/utils.py | 108 | 2426 | import re
import datetime
def id_number_checksum(gd):
"""
Calculates a Swedish ID number checksum, using the
"Luhn"-algoritm
"""
n = s = 0
for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']):
tmp = ((n % 2) and 1 or 2) * int(c)
if tmp > 9:
tmp = sum([int(... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/266_test_copy_reg.py | 82 | 4260 | import copy_reg
import unittest
from test import test_support
from test.pickletester import ExtensionSaver
class C:
pass
class WithoutSlots(object):
pass
class WithWeakref(object):
__slots__ = ('__weakref__',)
class WithPrivate(object):
__slots__ = ('__spam',)
class WithSingleString(object):
... | gpl-3.0 |
kjagoo/wger_stark | wger/core/management/commands/update-user-cache.py | 1 | 1413 | # -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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 ... | agpl-3.0 |
diego-plan9/beets | test/test_embyupdate.py | 16 | 10149 | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function
from test.helper import TestHelper
from beetsplug import embyupdate
import unittest
import responses
class EmbyUpdateTest(unittest.TestCase, TestHelper):
def setUp(self):
self.setup_beets()
self.load_plugins... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.