repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
djhenderson/byterun | byterun/pyvm2.py | 2 | 31221 | """A pure-Python Python bytecode interpreter."""
# Based on:
# pyvm2 by Paul Swartz (z3p), from http://www.twistedmatrix.com/users/z3p/
from __future__ import print_function, division
import dis
import inspect
import linecache
import logging
import operator
import sys
import six
from six.moves import reprlib
PY3, PY... | mit |
rodrigozn/CW-Shop | docs/conf.py | 16 | 9190 | # -*- coding: utf-8 -*-
#
# saleor documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 5 11:54:57 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | bsd-3-clause |
bytor99999/vertx-web | src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py | 163 | 11979 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, fsencode, detect_encoding, ... | apache-2.0 |
shaiguitar/snowclient.py | tests/querybuilder_tests.py | 1 | 2222 | from nose.tools import *
from snowclient.querybuilder import *
import unittest
import tests.test_helpers as test_helpers
class TestSnowClientQuery(unittest.TestCase):
def test_date_range(self):
qb = QueryBuilder()
# snow api sucks balls https://community.servicenow.com/thread/181519
e = "sys_create... | mit |
Pierre-LouisTALBOT/24h_code_6emeEdition_server | App/DefaultData/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | 395 | 65937 | #!/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.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... | apache-2.0 |
DARKPOP/external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/style/checkers/python_unittest.py | 17 | 2572 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
hforge/ikaaro | ikaaro/config_register.py | 2 | 5898 | # -*- coding: UTF-8 -*-
# Copyright (C) 2011 Juan David Ibáñez Palomar <jdavid@itaapy.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... | gpl-3.0 |
cloudera/hue | desktop/core/ext-py/Django-1.11.29/django/db/models/manager.py | 108 | 7232 | import copy
import inspect
from importlib import import_module
from django.db import router
from django.db.models.query import QuerySet
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class BaseManager(object):
# Tracks each time a Manager i... | apache-2.0 |
chrishas35/django-travis-ci | tests/regressiontests/custom_columns_regress/tests.py | 150 | 2686 | from __future__ import absolute_import
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Author, Article
def pks(objects):
""" Return pks to be able to compare lists"""
return [o.pk for o in objects]
class CustomColumnRegression(TestCase):
def setUp(sel... | bsd-3-clause |
maohongyuan/kbengine | kbe/res/scripts/common/Lib/modulefinder.py | 77 | 23421 | """Find modules used by a script, using introspection."""
import dis
import importlib._bootstrap
import importlib.machinery
import marshal
import os
import sys
import types
import struct
import warnings
with warnings.catch_warnings():
warnings.simplefilter('ignore', PendingDeprecationWarning)
import imp
# XXX... | lgpl-3.0 |
SureshMatsui/SaveCoin | share/qt/extract_strings_qt.py | 1 | 1903 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
import os
OUT_CPP="src/qt/SaveCoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format pr... | mit |
dlenwell/Webster | webster/webster.py | 1 | 5000 | #
# Copyright (c) 2012 David Lenwell. 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 requir... | apache-2.0 |
momm3/WelcomeBot | welcomebot/Lib/site-packages/pip/commands/freeze.py | 342 | 2835 | 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 |
melodous/designate | designate/hacking/checks.py | 2 | 3830 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012, Cloudscaling
#
# 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... | apache-2.0 |
nju520/django | tests/test_runner/test_debug_sql.py | 210 | 4048 | import sys
import unittest
from django.db import connection
from django.test import TestCase
from django.test.runner import DiscoverRunner
from django.utils import six
from django.utils.encoding import force_text
from .models import Person
@unittest.skipUnless(connection.vendor == 'sqlite', 'Only run on sqlite so w... | bsd-3-clause |
scalingdata/Impala | tests/query_test/test_local_fs.py | 4 | 1084 | #!/usr/bin/env python
# Copyright (c) 2015 Cloudera, Inc. All rights reserved.
# Validates table stored on the LocalFileSystem.
#
import pytest
from tests.common.impala_test_suite import ImpalaTestSuite
from tests.common.test_dimensions import create_single_exec_option_dimension
class TestLocalFileSystem(ImpalaTestSui... | apache-2.0 |
FujitsuEnablingSoftwareTechnologyGmbH/tempest | tempest/api/volume/test_qos.py | 3 | 7111 | # 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 agreed to in... | apache-2.0 |
yan12125/youtube-dl | youtube_dl/extractor/telewebion.py | 64 | 1843 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class TelewebionIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?telewebion\.com/#!/episode/(?P<id>\d+)'
_TEST = {
'url': 'http://www.telewebion.com/#!/episode/1263668/',
'info_dict': {
... | unlicense |
AnishShah/tensorflow | tensorflow/contrib/learn/python/learn/ops/seq2seq_ops.py | 42 | 6352 | # 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 |
erickt/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/staticfiles/utils.py | 322 | 1973 | import os
import fnmatch
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patter... | apache-2.0 |
Pulshen/XKernel | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
marratj/ansible | lib/ansible/modules/cloud/amazon/ecs_service.py | 29 | 20325 | #!/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 |
agrista/odoo-saas | addons/l10n_nl/__init__.py | 424 | 1413 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Veritos - Jan Verlaan - www.veritos.nl
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# con... | agpl-3.0 |
hkariti/ansible | lib/ansible/plugins/callback/tree.py | 47 | 2337 | # (c) 2012-2014, Ansible, Inc
# (c) 2017 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
DOCUMENTATION = '''
callback: tree
callback_type: notification
requi... | gpl-3.0 |
midnightradio/gensim | gensim/scripts/package_info.py | 4 | 1546 | """Get basic information about gensim & dependencies (useful for bug-reporting).
Examples
--------
You can use it through python
.. sourcecode:: pycon
>>> from gensim.scripts.package_info import package_info
>>>
>>> info = package_info()
or using CLI interface
::
python -m gensim.scripts.package_i... | gpl-3.0 |
jaredsburrows/cplusplus-cmake-template | lib/gmock-1.7.0/gtest/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | apache-2.0 |
bryantdo/PiPID | build/lib.linux-armv7l-2.7/pypid/backend/__init__.py | 3 | 6272 | # Copyright (C) 2011-2012 W. Trevor King <wking@tremily.us>
#
# This file is part of pypid.
#
# pypid 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 la... | gpl-3.0 |
craigcitro/pydatalab | tests/stackdriver/monitoring/utils_tests.py | 3 | 1740 | # Copyright 2016 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 agreed ... | apache-2.0 |
zwily/zulip | bots/irc-mirror.py | 114 | 4288 | #! /usr/bin/env python
#
# EXPERIMENTAL
# IRC <=> Zulip mirroring bot
#
# Setup: First, you need to install python-irc version 8.5.3
# (https://bitbucket.org/jaraco/irc)
import irc.bot
import irc.strings
from irc.client import ip_numstr_to_quad, ip_quad_to_numstr
import zulip
import optparse
IRC_DOMAIN = "irc.example... | apache-2.0 |
rhdedgar/openshift-tools | scripts/monitoring/ops-ec2-check-tags.py | 6 | 4393 | #!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
"""
This is a script that gathers tags from instances and reports the status of the tags to zabbix
Usage:
ops-ec2-check-tags.py --aws-creds-profile profile1 --clusterid=testcluster --region=us-east-1
"""
# Ignoring module name
# pylint: disable=inval... | apache-2.0 |
fbossy/SickRage | lib/ndg/httpsclient/urllib2_build_opener.py | 66 | 2208 | """urllib2 style build opener integrates with HTTPSConnection class from this
package.
"""
__author__ = "P J Kershaw"
__date__ = "21/12/10"
__copyright__ = "(C) 2011 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revis... | gpl-3.0 |
doraak47/applemanorhandmade | lib/werkzeug/local.py | 310 | 14094 | # -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
from werkzeug.wsgi import ClosingIt... | apache-2.0 |
Gui13/CouchPotatoServer | libs/suds/store.py | 204 | 18425 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
tpaszkowski/quantum | quantum/db/migration/alembic_migrations/env.py | 8 | 2967 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/li... | apache-2.0 |
ncbray/pystream | bin/tests/decompilertests/test_call.py | 1 | 2076 | # Copyright 2011 Nicholas Bray
#
# 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 |
zivaharoni/gradual-learning-rnn | tensorflow_impl/utils.py | 1 | 4226 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import ast
import re
import os
import logging
logger = logging.getLogger("logger")
def tvars_num():
logger.info("model variables:")
nvars = 0
for var in ... | mit |
OpenWinCon/OpenWinNet | web-gui/myvenv/lib/python3.4/site-packages/django/core/servers/fastcgi.py | 170 | 6631 | """
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is an adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standal... | apache-2.0 |
yosinski/deep-visualization-toolbox | models/squeezenet/settings_local.template-squeezenet.py | 2 | 2227 | # Define critical settings and/or override defaults specified in
# settings.py. Copy this file to settings_local.py in the same
# directory as settings.py and edit. Any settings defined here
# will override those defined in settings.py
# Set this to point to your compiled checkout of caffe
caffevis_caffe_root =... | mit |
AuyaJackie/odoo | addons/report_intrastat/__openerp__.py | 261 | 1805 | # -*- 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 |
mcfunley/statsdump | statsdump.py | 1 | 1894 | #!/usr/bin/env python
import dpkt
import sys
import socket
from collections import defaultdict
from operator import itemgetter
def parse_ip4_udp(buf):
eth = dpkt.ethernet.Ethernet(buf)
if eth.type != dpkt.ethernet.ETH_TYPE_IP:
raise Exception('unhandled type: %s' % eth.type)
ip = eth.data
... | gpl-3.0 |
TeutoNet-Netzdienste/ansible | lib/ansible/runner/lookup_plugins/file.py | 153 | 2413 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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 lat... | gpl-3.0 |
cleverhans-lab/cleverhans | cleverhans_v3.1.0/examples/multigpu_advtrain/model.py | 1 | 13773 | """
MultiGPU model similar to the one used in model tutorials. The model keeps
one copy of the weights on each device and handles syncing the parameters
across devices.
"""
# pylint: disable=missing-docstring
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
i... | mit |
sulrich/weewx | examples/lowBattery.py | 1 | 8124 | # Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com>
# See the file LICENSE.txt for your rights.
"""Example of how to implement a low battery alarm in weewx.
*******************************************************************************
To use this alarm, add the following somewhere in your configuration... | gpl-3.0 |
jazzmes/ryu | ryu/tests/unit/packet/test_arp.py | 18 | 5312 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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 |
abougouffa/alfanous | src/alfanous/Support/PyArabic/Araby_Statistics.py | 6 | 5422 | # coding: utf-8
'''
Created on 17 avr. 2010
a module to calculate different statistics on coranic text
@author: assem
'''
import re
import araby
__all__ = ['letters', 'diacritics', 'letter_count', 'hamza_count', 'words',
'gwords', 'sunletters', 'moonletters']
gword_pattern = re.compile( u"لله" )
GWORDS_FORMS = ... | agpl-3.0 |
0x0FFF/gpdb | gpMgmt/bin/gppylib/test/behave_utils/gpfdist_utils/fake_url.py | 34 | 1845 | #!/data/home/gpadmin/greenplum-db-devel/ext/python/bin/python
import httplib
import optparse
import string
import sys
import time
class HTTPCli:
@staticmethod
def send_http_request(url_path, data, **headers):
parts = url_path.strip().split('/')
if len(parts) < 2 or parts[0] == '':
r... | apache-2.0 |
opencivicdata/python-opencivicdata-django | opencivicdata/legislative/models/event.py | 2 | 6998 | from django.contrib.gis.db import models
from django.contrib.postgres.fields import ArrayField, JSONField
from opencivicdata.core.models.base import (
OCDBase,
LinkBase,
OCDIDField,
RelatedBase,
RelatedEntityBase,
MimetypeLinkBase,
)
from opencivicdata.core.models import Jurisdiction
from .bill ... | bsd-3-clause |
jkorell/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/shift_jis.py | 61 | 1078 | #
# shift_jis.py: Python Unicode Codec for SHIFT_JIS
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jis')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... | apache-2.0 |
wasade/qiime | qiime/make_otu_heatmap.py | 1 | 7171 | from __future__ import division
__author__ = "Dan Knights"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Dan Knights", "Greg Caporaso", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.8.0-dev"
__maintainer__ = "Dan Knights"
__email__ = "daniel.knights@colorado.edu"
import numpy as np
imp... | gpl-2.0 |
CLVsol/odoo_addons | clv_lab_test/clv_tag/clv_tag.py | 1 | 2044 | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | agpl-3.0 |
lichong012245/django-lfs-0.7.8 | lfs/catalog/admin.py | 5 | 1448 | # django imports
from django.contrib import admin
# lfs imports
from lfs.catalog.models import Category
from lfs.catalog.models import FilterStep
from lfs.catalog.models import Image
from lfs.catalog.models import Product
from lfs.catalog.models import ProductAccessories
from lfs.catalog.models import Property
from lf... | bsd-3-clause |
karlito40/servo | tests/wpt/css-tests/css21_dev/xhtml1print/reference/support/fonts/makegsubfonts.py | 820 | 14309 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
redhat-openstack/manila | manila/tests/api/contrib/test_admin_actions.py | 2 | 11960 | # Copyright 2013 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 by... | apache-2.0 |
Yuudachimoe/HikariChun-RedBot | lib/youtube_dl/extractor/makerschannel.py | 66 | 1593 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class MakersChannelIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?makerschannel\.com/.*(?P<id_type>video|production)_id=(?P<id>[0-9]+)'
_TEST = {
'url': 'http://makerschannel.com/en/zoomin/commu... | gpl-3.0 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/kombu/transport/SQS.py | 2 | 16880 | """Amazon SQS Transport.
Amazon SQS transport module for Kombu. This package implements an AMQP-like
interface on top of Amazons SQS service, with the goal of being optimized for
high performance and reliability.
The default settings for this module are focused now on high performance in
task queue situations where ... | gpl-3.0 |
kmike/scrapy | tests/test_utils_datatypes.py | 10 | 6815 | import copy
import unittest
from collections import Mapping, MutableMapping
from scrapy.utils.datatypes import CaselessDict, SequenceExclude
__doctests__ = ['scrapy.utils.datatypes']
class CaselessDictTest(unittest.TestCase):
def test_init_dict(self):
seq = {'red': 1, 'black': 3}
d = CaselessDic... | bsd-3-clause |
mulkieran/storage_alerts | storage_alerts/_keys.py | 1 | 1928 | # Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be u... | gpl-2.0 |
yatinkumbhare/openstack-nova | nova/tests/unit/virt/test_diagnostics.py | 101 | 10335 | # Copyright (c) 2014 VMware, 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 a... | apache-2.0 |
citrix-openstack-build/glance | glance/cmd/registry.py | 4 | 1910 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | apache-2.0 |
jkleint/blamethrower | blamethrower/reporeaders/git.py | 1 | 3066 | # Copyright 2012 John Kleint
# This is free software, licensed under the MIT License; see LICENSE.txt.
"""
Get line authorship attribution from git.
Here's why this is somewhat challenging: ``git blame`` is designed to work on
one file at a time, with the implication that you know what file it's talking
about, since ... | mit |
cosenal/osf.io | tests/test_transactions.py | 58 | 9120 | # -*- coding: utf-8 -*-
import logging
import mock
import webtest_plus
import unittest
from nose.tools import * # noqa
from tests.base import DbTestCase
from flask import make_response
from pymongo.errors import CollectionInvalid, OperationFailure
from framework.flask import add_handlers
from framework.mongo impor... | apache-2.0 |
jbolinge/keras | examples/cifar10_cnn.py | 35 | 4479 | from __future__ import absolute_import
from __future__ import print_function
from keras.datasets import cifar10
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolutio... | mit |
GiovanniConserva/TestDeploy | venv/Lib/site-packages/django/contrib/gis/geos/prototypes/misc.py | 483 | 1300 | """
This module is for the miscellaneous GEOS routines, particularly the
ones that return the area, distance, and length.
"""
from ctypes import POINTER, c_double, c_int
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_stri... | bsd-3-clause |
aiguofer/bokeh | examples/plotting/file/color_sliders.py | 4 | 4855 | import colorsys
import yaml
from bokeh.layouts import column, row, widgetbox
from bokeh.models import ColumnDataSource, HoverTool, CustomJS, Slider
from bokeh.plotting import figure, output_file, show, curdoc
from bokeh.themes import Theme
# for plot 2: create colour spectrum of resolution N and brightness I, return ... | bsd-3-clause |
StefanoRaggi/Lean | Algorithm.Python/BasicTemplateFuturesHistoryAlgorithm.py | 3 | 3430 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Licen... | apache-2.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/matplotlib/cm.py | 11 | 11669 | """
This module provides a large set of colormaps, functions for
registering new colormaps and for getting a colormap by name,
and a mixin class for adding color mapping functionality.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import o... | mit |
saurabh6790/medsynaptic-app | accounts/report/bank_clearance_summary/bank_clearance_summary.py | 29 | 1385 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _, msgprint
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
data = get_ent... | agpl-3.0 |
josherick/bokeh | examples/glyphs/choropleth.py | 43 | 2358 | from __future__ import print_function
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Patches
from bokeh.models import (
Plot, DataRange1d, ColumnDataSource, ResizeTool
)
from bokeh.resources import INLINE
from bokeh.sampledata... | bsd-3-clause |
varakin/selenium-py-training-varakin | php4dvd/test_bad_data.py | 1 | 3267 | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... | apache-2.0 |
mhbu50/frappe | frappe/config/website.py | 18 | 2113 | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Web Site"),
"icon": "fa fa-star",
"items": [
{
"type": "doctype",
"name": "Web Page",
"description": _("Content web page."),
},
{
"type": "doctype",
"name": "Web Form",
... | mit |
chhe/streamlink | src/streamlink_cli/output.py | 3 | 10135 | import logging
import os
import re
import shlex
import subprocess
import sys
from time import sleep
from streamlink_cli.compat import is_win32, stdout
from streamlink_cli.constants import PLAYER_ARGS_INPUT_DEFAULT, PLAYER_ARGS_INPUT_FALLBACK, SUPPORTED_PLAYERS
from streamlink_cli.utils import ignored
if is_win32:
... | bsd-2-clause |
yewang15215/django | django/contrib/contenttypes/management/__init__.py | 60 | 4919 | from django.apps import apps as global_apps
from django.db import DEFAULT_DB_ALIAS, migrations, router, transaction
from django.db.utils import IntegrityError
from django.utils import six
class RenameContentType(migrations.RunPython):
def __init__(self, app_label, old_model, new_model):
self.app_label = a... | bsd-3-clause |
jjude/euler | 003/soln.py | 1 | 1360 | """
Solution to Project Euler problem by Joseph Jude
Webpage: http://tech.jjude.com/euler
Git Repo: https://github.com/jjude/euler
Problem 003: What is the largest prime factor of the number 600851475143?
WIL: Prime factorization
Ref: https://www.mathsisfun.com/prime-factorization.html
"Prime Factorization" is find... | mit |
wakatime/wakatime | wakatime/packages/py27/pygments/lexers/smv.py | 4 | 2793 | # -*- coding: utf-8 -*-
"""
pygments.lexers.smv
~~~~~~~~~~~~~~~~~~~
Lexers for the SMV languages.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, words
from pygments.token import Comment, Keyword... | bsd-3-clause |
amitsela/incubator-beam | sdks/python/apache_beam/utils/test_stream.py | 6 | 5784 | #
# 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 |
gmarcotte/tbp-scheduler | Imaging-1.1.6/PIL/ImageEnhance.py | 13 | 2788 | #
# The Python Imaging Library.
# $Id: ImageEnhance.py 2134 2004-10-06 08:55:20Z fredrik $
#
# image enhancement classes
#
# For a background, see "Image Processing By Interpolation and
# Extrapolation", Paul Haeberli and Douglas Voorhies. Available
# at http://www.sgi.com/grafica/interp/index.html
#
# History:
# ... | apache-2.0 |
mikewiebe-ansible/ansible | hacking/cgroup_perf_recap_graph.py | 54 | 4384 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2018, Matt Martz <matt@sivel.net>
#
# 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 Licens... | gpl-3.0 |
matthappens/taskqueue | taskqueue/venv_tq/lib/python2.7/site-packages/paramiko/compress.py | 62 | 1245 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 (a... | mit |
bigfootproject/sahara | sahara/plugins/mapr/versions/mapr_spark/spark_engine.py | 10 | 6843 | # Copyright (c) 2015, MapR Technologies
#
# 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 |
oleksa-pavlenko/gae-django-project-template | django/contrib/auth/decorators.py | 38 | 3020 | from functools import wraps
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import PermissionDenied
from django.utils.decorators import available_attrs
from django.utils.six.moves.urllib.parse import urlparse
from django.shortcuts import resolve_url
def... | mit |
agaldona/odoomrp-wip-1 | base_partner_references/models/res_partner.py | 31 | 1381 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
HPENetworking/PYHPEIMC | tests/test_pyhpeimc_plat_netassets.py | 3 | 30488 | # -*- coding: utf-8 -*-
"""
This module is used for testing the functions within the pyhpeimc.plat.netassets module.
"""
from unittest import TestCase
from nose.plugins.skip import SkipTest
from pyhpeimc.plat.netassets import *
from test_machine import *
##### Test get_dev_asset_details function for multiple vend... | apache-2.0 |
googleads/google-ads-python | google/ads/googleads/v6/services/services/customer_client_link_service/transports/__init__.py | 1 | 1095 | # -*- 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 o... | apache-2.0 |
alshedivat/tensorflow | tensorflow/examples/tutorials/mnist/mnist_deep.py | 11 | 6331 | # 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 |
Nowheresly/odoo | addons/mrp_byproduct/mrp_byproduct.py | 26 | 8221 | # -*- 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 |
willingc/zulip | api/integrations/basecamp/zulip_basecamp_config.py | 124 | 2149 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#... | apache-2.0 |
Topher-the-Geek/bazel | tools/build_defs/docker/rewrite_json.py | 2 | 7822 | # 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... | apache-2.0 |
Dino0631/RedRain-Bot | lib/youtube_dl/extractor/syfy.py | 73 | 2046 | from __future__ import unicode_literals
from .adobepass import AdobePassIE
from ..utils import (
update_url_query,
smuggle_url,
)
class SyfyIE(AdobePassIE):
_VALID_URL = r'https?://(?:www\.)?syfy\.com/(?:[^/]+/)?videos/(?P<id>[^/?#]+)'
_TESTS = [{
'url': 'http://www.syfy.com/theinternetruined... | gpl-3.0 |
square/pants | src/python/pants/backend/jvm/tasks/jvm_compile/scala/zinc_utils.py | 2 | 10550 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from contextlib impo... | apache-2.0 |
Vishluck/sympy | sympy/stats/frv_types.py | 42 | 7915 | """
Finite Discrete Random Variables - Prebuilt variable types
Contains
========
FiniteRV
DiscreteUniform
Die
Bernoulli
Coin
Binomial
Hypergeometric
"""
from __future__ import print_function, division
from sympy.core.compatibility import as_int, range
from sympy.core.logic import fuzzy_not, fuzzy_and
from sympy.stat... | bsd-3-clause |
pshen/ansible | lib/ansible/modules/network/f5/bigip_pool_member.py | 65 | 16833 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2013, Matt Hite <mhite@hotmail.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 Licens... | gpl-3.0 |
rishabht1/damnvid | ui/dMainFrame/dMainFrame.py | 12 | 32421 | # -*- coding: utf-8 -*-
from ..dUI import *
from dConverter import *
from dUpdater import *
from ..dPrefEditor import *
from ..dDoneDialog import *
from ..dAddURLDialog import *
from ..dAboutDialog import *
from ..dReportBug import *
from ..dBrowser import *
from ..dVideoHistory import *
from dMenubar import *
from dMa... | gpl-3.0 |
chenpeikai/labelimg | libs/pascal_voc_io.py | 1 | 4886 | #!/usr/bin/env python
# -*- coding: utf8 -*-
import _init_path
import sys
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, SubElement
from lxml import etree
class PascalVocWriter:
def __init__(self, foldername, filename, imgSize, databaseSrc='Unknown', localImgPath=None):
self... | mit |
Itxaka/st2 | st2common/st2common/models/db/action.py | 2 | 3682 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
zulumarketing/geoip-service | src/geoip.py | 3 | 3757 | # -*- coding: utf-8 -*-
"""
geoip-service
~~~~~~~~~~~~~
A simple, free GeoIP REST endpoint.
"""
import os
from itertools import chain
from functools import wraps
from flask import Flask, request, jsonify, current_app
from flask.ext.cache import Cache
from geoip2 import database
from geoip2.errors import AddressNot... | mit |
POFK/utilTool | python/CosmAna/src/cic_de.py | 2 | 2540 | #!/usr/bin/env python
# coding=utf-8
from CosmAna import Pylib
from CosmAna import PS
import numpy as np
from CosmAna import ReadSnapshot
from CosmAna import PCS as Assigment
from CosmAna import MPI_IO
from smooth import Smooth
import os
def checkdir(dirpath):
isExists = os.path.exists(dirpath)
if not isExists... | mit |
hefen1/chromium | build/android/gyp/process_resources.py | 6 | 11832 | #!/usr/bin/env python
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Process Android resources to generate R.java, and prepare for packaging.
This will crunch images and generate v14 compatible ... | bsd-3-clause |
phoebusliang/parallel-lettuce | tests/integration/lib/Django-1.2.5/django/db/backends/mysql/client.py | 524 | 1380 | import os
import sys
from django.db.backends import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'mysql'
def runshell(self):
settings_dict = self.connection.settings_dict
args = [self.executable_name]
db = settings_dict['OPTIONS'].get('db', settings_d... | gpl-3.0 |
idl3r/Ropper | ropperapp/disasm/rop.py | 1 | 7636 | #!/usr/bin/env python2
# coding=utf-8
#
# Copyright 2014 Sascha Schirra
#
# This file is part of Ropper.
#
# Ropper 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 |
allcaps/django-scaffold | demo/demo/settings.py | 1 | 2754 | """
Django settings for demo project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
#... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.