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 |
|---|---|---|---|---|---|
spennihana/h2o-3 | py2/testdir_single_jvm/test_split_frame.py | 19 | 2309 | import unittest, time, sys, random
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_cmd, h2o_glm, h2o_import as h2i, h2o_jobs, h2o_exec as h2e
from h2o_test import dump_json, OutputObj, verboseprint
DO_POLL = False
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbo... | apache-2.0 |
ChameleonCloud/horizon | openstack_dashboard/test/unit/api/test_neutron.py | 1 | 76571 | # Copyright 2012 NEC 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 applicable law or ag... | apache-2.0 |
mgugino-upstream-stage/ansible-modules-core | network/netvisor/pn_ospf.py | 29 | 8829 | #!/usr/bin/python
""" PN-CLI vrouter-ospf-add/remove """
#
# 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 |
yngtodd/tanuki | .ropeproject/config.py | 33 | 4089 | # The default ``config.py``
# flake8: noqa
def set_prefs(prefs):
"""This function is called before opening the project"""
# Specify which files and folders to ignore in the project.
# Changes to ignored resources are not added to the history and
# VCSs. Also they are not returned in `Project.get_fil... | mit |
awsdocs/aws-doc-sdk-examples | python/example_code/iotthingsgraph/ms.py | 1 | 6258 | #
# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# This file is... | apache-2.0 |
ericgriffin/metasort | lib/boost/tools/build/v2/tools/midl.py | 18 | 5657 | # Copyright (c) 2005 Alexey Pakhunov.
# Copyright (c) 2011 Juraj Ivancic
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
# Microsoft Interface Definition Language (MIDL) related routines
fro... | apache-2.0 |
BU-PyCon/Meeting-2 | Programs/PyPlot.py | 1 | 18763 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.patches import *
import pdb
print("""
MatPlotLib Advanced Tutorial
----------------------------
This is a tutorial covering the features and usage of the matplotlib package
in more detail. In truth, no... | mit |
brian-l/django-1.4.10 | django/dispatch/saferef.py | 86 | 10503 | """
"Safe weakrefs", originally from pyDispatcher.
Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
import traceback
import weakref
def safeRef(target, onDelete = None):
"""Return a *safe* weak reference to a callable target
target... | bsd-3-clause |
fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractJingletranslationsWordpressCom.py | 1 | 1391 | def extractJingletranslationsWordpressCom(item):
'''
Parser for 'jingletranslations.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Breaking Off the Engagement… Bring it on!', ... | bsd-3-clause |
browseinfo/odoo_saas3_nicolas | addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py | 5 | 2395 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
alexsandrohaag/odoo-website-addons | website_crm_lead_creation/__openerp__.py | 2 | 1917 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2015 TrustCode - www.trustcode.com.br #
# ... | agpl-3.0 |
oliora/couched | setup.py | 1 | 1040 | from setuptools import setup
import sys
if sys.version < "2.7":
raise Exception("Couched needs Python 2.7 or above")
LONG_DESCRIPTION = open('README.txt').read()
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Opera... | mit |
tmrowco/electricitymap | parsers/lib/validation.py | 1 | 5884 | #!/usr/bin/env python3
"""Centralised validation function for all parsers."""
from logging import getLogger
def has_value_for_key(datapoint, key, logger):
"""checks that the key exists in datapoint and that the corresponding value
is not None"""
if datapoint['production'].get(key, None) is None:
... | gpl-3.0 |
data-exp-lab/girder | girder/api/v1/resource.py | 3 | 18165 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | apache-2.0 |
Eureka22/ASM_xf | PythonD/site_python/twisted/test/test_roots.py | 2 | 2491 | # Twisted, the Framework of Your Internet
# Copyright (C) 2001 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in t... | gpl-2.0 |
hdeeco/stb-gui | lib/python/Components/SetupDevices.py | 21 | 1533 | from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigText
from Components.Timezones import timezones
from Components.Language import language
from Components.Keyboard import keyboard
def InitSetupDevices():
def timezoneNotifier(configElement):
timezones.activateTimezone(configElement.in... | gpl-2.0 |
MarcosCommunity/odoo | addons/product_extended/__init__.py | 374 | 1068 | ##############################################################################
#
# 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 GNU Affero General Publ... | agpl-3.0 |
eino-makitalo/odoo | addons/account/wizard/account_state_open.py | 341 | 1785 | # -*- 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 |
ivano666/tensorflow | tensorflow/examples/skflow/text_classification_character_rnn.py | 9 | 2530 | # Copyright 2015-present The Scikit Flow 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 require... | apache-2.0 |
tazo90/pulsar | pulsar/utils/websocket.py | 5 | 12387 | # -*- coding: utf-8 -*-
'''WebSocket_ Protocol is implemented via the :class:`Frame` and
:class:`FrameParser` classes.
To obtain a frame parser one should use the :func:`frame_parser` function.
frame parser
~~~~~~~~~~~~~~~~~~~
.. autofunction:: frame_parser
Frame
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: Frame
... | bsd-3-clause |
openrtc/OpenHRIVoice | examples/festivalrtc/ConsoleIn.py | 2 | 5366 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- Python -*-
from __future__ import print_function
import sys
import readline
import RTC
import OpenRTM_aist
consolein_spec = ["implementation_id", "ConsoleIn",
"type_name", "ConsoleIn",
"description", "Console input ... | epl-1.0 |
memtoko/django | tests/m2m_and_m2o/tests.py | 383 | 2711 | from django.db.models import Q
from django.test import TestCase
from .models import Issue, UnicodeReferenceModel, User
class RelatedObjectTests(TestCase):
def test_related_objects_have_name_attribute(self):
for field_name in ('test_issue_client', 'test_issue_cc'):
obj = User._meta.get_field(... | bsd-3-clause |
Carmezim/tensorflow | tensorflow/python/saved_model/signature_def_utils_test.py | 86 | 7419 | # 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 |
unreal666/outwiker | plugins/markdown/markdown/markdown_plugin_libs/pygments/lexers/python.py | 6 | 42545 | # -*- coding: utf-8 -*-
"""
pygments.lexers.python
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Python and related languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, bygro... | gpl-3.0 |
neweagle/ns-3_multisim | pybindgen/pybindgen/cppexception.py | 5 | 6129 |
import settings
import utils
class CppException(object):
def __init__(self, name, parent=None, outer_class=None, custom_name=None,
foreign_cpp_namespace=None, message_rvalue=None):
"""
:param name: exception class name
:param parent: optional parent class wrapper
... | gpl-2.0 |
frac/celery | contrib/release/sphinx-to-rst.py | 44 | 1900 | #!/usr/bin/env python
import os
import re
import sys
dirname = ""
RE_CODE_BLOCK = re.compile(r'.. code-block:: (.+?)\s*$')
RE_INCLUDE = re.compile(r'.. include:: (.+?)\s*$')
RE_REFERENCE = re.compile(r':(.+?):`(.+?)`')
def include_file(lines, pos, match):
global dirname
orig_filename = match.groups()[0]
... | bsd-3-clause |
gurpinars/hash-generator | hashGenerator.py | 1 | 3997 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'hashGenerator.ui'
#
# Created: Tue Dec 18 00:25:17 2012
# by: PyQt4 UI code generator 4.9.3
#
# WARNING! All changes made in this file will be lost!
#
# Author:M. Sami GÜRPINAR
# Email :sami.gurpinar@gmail.com
#
from PyQt4 import ... | gpl-3.0 |
kbrebanov/ansible | lib/ansible/inventory/data.py | 3 | 9749 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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) an... | gpl-3.0 |
jobiols/server-tools | module_prototyper/wizard/module_prototyper_module_export.py | 26 | 4774 | # -*- encoding: utf-8 -*-
# #############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2010 - 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modif... | agpl-3.0 |
eduNEXT/edunext-platform | cms/djangoapps/contentstore/tests/test_import.py | 4 | 12258 | # -*- coding: utf-8 -*-
# pylint: disable=protected-access
"""
Tests for import_course_from_xml using the mongo modulestore.
"""
import copy
from uuid import uuid4
import ddt
import six
from django.conf import settings
from django.test.client import Client
from django.test.utils import override_settings
from mock im... | agpl-3.0 |
dut3062796s/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/linecache.py | 80 | 4099 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globals=N... | apache-2.0 |
Nepherhotep/django | django/contrib/gis/geos/mutable_list.py | 238 | 10705 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Released under the New BSD license.
"""
This module contains a base type which provides list-style mutations
without specific data storage methods.
See also http://static.aryehleib.com/oldsite/MutableLists.html
Author: Aryeh Leib Taurog.
"""
from fun... | bsd-3-clause |
MLAB-project/pymlab | examples/rps01_example.py | 2 | 1675 | #!/usr/bin/python
# Python library for RPS01A MLAB module with AS5048B I2C Magnetic position sensor.
#uncomment for debbug purposes
#import logging
#logging.basicConfig(level=logging.DEBUG)
import time
import datetime
import sys
from pymlab import config
#### Script Arguments ######################################... | gpl-3.0 |
anistark/mozillians | vendor-local/lib/python/tablib/packages/xlrd/xldate.py | 73 | 6481 | # -*- coding: cp1252 -*-
# No part of the content of this file was derived from the works of David Giffin.
##
# <p>Copyright © 2005-2008 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under a BSD-style licence.</p>
#
# <p>Provides function(s) for dealing with M... | bsd-3-clause |
valkjsaaa/sl4a | python/src/Tools/webchecker/wsgui.py | 92 | 7034 | #! /usr/bin/env python
"""Tkinter-based GUI for websucker.
Easy use: type or paste source URL and destination directory in
their respective text boxes, click GO or hit return, and presto.
"""
from Tkinter import *
import websucker
import os
import threading
import Queue
import time
VERBOSE = 2
try:
class Canc... | apache-2.0 |
thodoris/djangoPharma | djangoPharma/env/Lib/site-packages/django/forms/renderers.py | 45 | 2048 | import os
from django.conf import settings
from django.template.backends.django import DjangoTemplates
from django.template.loader import get_template
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.functional import cached_property
from django.utils.module_loading import import... | apache-2.0 |
mith1979/ansible_automation | applied_python/applied_python/lib/python2.7/site-packages/django/contrib/gis/geos/coordseq.py | 83 | 5462 | """
This module houses the GEOSCoordSeq object, which is used internally
by GEOSGeometry to house the actual coordinates of the Point,
LineString, and LinearRing geometries.
"""
from ctypes import byref, c_double, c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.base import... | apache-2.0 |
carlmw/oscar-wager | django/contrib/gis/gdal/tests/test_ds.py | 233 | 10504 | import os, os.path, unittest
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
from django.contrib.gis.gdal.field import OFTReal, OFTInteger, OFTString
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS
# List of acceptable data sources.... | bsd-3-clause |
omnirom/android_external_chromium-org | tools/perf_expectations/make_expectations.py | 67 | 12562 | #!/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.
# For instructions see:
# http://www.chromium.org/developers/tree-sheriffs/perf-sheriffs
import hashlib
import math
import optpars... | bsd-3-clause |
kemalakyol48/python-for-android | python3-alpha/python3-src/Lib/encodings/big5hkscs.py | 816 | 1039 | #
# big5hkscs.py: Python Unicode Codec for BIG5HKSCS
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_hk, codecs
import _multibytecodec as mbc
codec = _codecs_hk.getcodec('big5hkscs')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.Multib... | apache-2.0 |
ppietrasa/grpc | src/python/grpcio_tests/tests/qps/client_runner.py | 16 | 3474 | # Copyright 2016, 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 |
yade/trunk | py/FEMxDEM/msFEM2D.py | 2 | 10839 | from __future__ import print_function
from builtins import input
from builtins import zip
from builtins import range
from builtins import object
__author__="Ning Guo, ceguo@connect.ust.hk"
__supervisor__="Jidong Zhao, jzhao@ust.hk"
__institution__="The Hong Kong University of Science and Technology"
""" 2D model for m... | gpl-2.0 |
dscdac/Proyecto-IV | lib/python2.7/site-packages/pip/_vendor/html5lib/filters/lint.py | 250 | 4062 | from __future__ import absolute_import, division, unicode_literals
from gettext import gettext
_ = gettext
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
... | gpl-2.0 |
edhuckle/statsmodels | statsmodels/sandbox/regression/tests/test_gmm_poisson.py | 31 | 13338 | '''
TestGMMMultTwostepDefault() has lower precision
'''
from statsmodels.compat.python import lmap
import numpy as np
from numpy.testing.decorators import skipif
import pandas
import scipy
from scipy import stats
from statsmodels.regression.linear_model import OLS
from statsmodels.sandbox.regression import gmm
fro... | bsd-3-clause |
Just-D/chromium-1 | third_party/pycoverage/coverage/debug.py | 211 | 1706 | """Control of and utilities for debugging."""
import os
# When debugging, it can be helpful to force some options, especially when
# debugging the configuration mechanisms you usually use to control debugging!
# This is a list of forced debugging options.
FORCED_DEBUG = []
class DebugControl(object):
"""Contro... | bsd-3-clause |
mattrobenolt/django | tests/custom_managers/tests.py | 53 | 22317 | from __future__ import unicode_literals
from django.db import models
from django.test import TestCase
from django.utils import six
from .models import (
Book, Car, CustomManager, CustomQuerySet, DeconstructibleCustomManager,
FunPerson, OneToOneRestrictedModel, Person, PersonManager,
PublishedBookManager, ... | bsd-3-clause |
wrwcmaster/Shadowsocks | utils/autoban.py | 1033 | 2156 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# 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... | apache-2.0 |
lipixun/pytest | rabbitmq/geventmultimsg/client.py | 1 | 2058 | #!/usr/bin/env python
# encoding=utf8
# The gevent test client
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import gevent
from gevent import monkey
monkey.patch_all()
from haigha.connections.rabbit_connection import RabbitConnection
from haigha.message import Message
class Client(object):
"""The RPC Cl... | gpl-2.0 |
jazzband/django-pipeline | tests/tests/test_compiler.py | 3 | 9132 | import sys
from unittest import skipIf, skipUnless
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.test import TestCase
from django.test.client import RequestFactory
from pipeline.collector import default_collector
from pipeline.compilers import Compiler... | mit |
RylanGotto/web-dash | websterton/settings.py | 1 | 1382 | # -*- coding: utf-8 -*-
import os
os_env = os.environ
class Config(object):
SECRET_KEY = os_env.get('WEBSTERTON_SECRET', 'secret-key') # TODO: Change me
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
BCRYPT_LOG_R... | bsd-3-clause |
google/capirca | tests/lib/paloaltofw_test.py | 1 | 32418 | # Copyright 2012 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 |
hickford/youtube-dl | youtube_dl/extractor/streamcz.py | 106 | 3322 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import hashlib
import time
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
int_or_none,
)
def _get_api_key(api_path):
if api_path.endswith('?'):
api_path = api_path[:-1]
a... | unlicense |
Villoid/PynamoDB | pynamodb/tests/test_model.py | 1 | 80527 | """
Test model API
"""
import random
import json
import copy
from datetime import datetime
import six
from botocore.client import ClientError
from pynamodb.compat import CompatTestCase as TestCase
from pynamodb.tests.deep_eq import deep_eq
from pynamodb.throttle import Throttle
from pynamodb.connection.util import py... | mit |
mestihudson/selenium | py/test/selenium/webdriver/common/api_example_tests.py | 58 | 11686 | # 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 |
Andr3iC/courtlistener | cl/users/tests.py | 2 | 6020 | # coding=utf-8
from datetime import timedelta
from django.contrib.auth.tokens import default_token_generator
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
from django.utils.timezone import now
from django.utils.http import urlsafe_base64_encode
from... | agpl-3.0 |
kellrott/gopy | _examples/named/test.py | 2 | 2706 | # Copyright 2015 The go-python Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
## py2/py3 compat
from __future__ import print_function
import named
### test docs
print("doc(named): %r" % (named.__doc__,))
print("doc(named.Float): %r... | bsd-3-clause |
josh-willis/pycbc | pycbc/pool.py | 4 | 5402 | """ Tools for creating pools of worker processes
"""
from __future__ import absolute_import
import multiprocessing.pool
import functools
from multiprocessing import TimeoutError
import types
import signal
import atexit
import logging
def is_main_process():
""" Check if this is the main control process and may hand... | gpl-3.0 |
75651/kbengine_cloud | kbe/res/scripts/common/Lib/distutils/tests/test_bdist_wininst.py | 105 | 1040 | """Tests for distutils.command.bdist_wininst."""
import unittest
from test.support import run_unittest
from distutils.command.bdist_wininst import bdist_wininst
from distutils.tests import support
class BuildWinInstTestCase(support.TempdirManager,
support.LoggingSilencer,
... | lgpl-3.0 |
Alwnikrotikz/los-cocos | tools/gentileset.py | 6 | 2752 | '''Cocos tileset generator
Usage: gentileset.py <image_name> <tile_width> <tile_height> [<output.xml>]
This script generates a tileset xml file from a givend image, tile width and
height. If an output parameter is provided the generated xml is printed to
this file, if it's not the output is written to the standard o... | bsd-3-clause |
DustinTriplett/godot | platform/iphone/detect.py | 20 | 6999 | import os
import sys
def is_active():
return True
def get_name():
return "iOS"
def can_build():
import sys
if sys.platform == 'darwin':
return True
return False
def get_opts():
return [
('IPHONEPLATFORM', 'name of the iphone platform', 'iPhoneOS'),
('IPHONEPATH', 'the path to iphone toolchain', '/Ap... | mit |
cbertinato/pandas | pandas/tests/plotting/test_backend.py | 1 | 1151 | import pytest
import pandas
def test_matplotlib_backend_error():
msg = ('matplotlib is required for plotting when the default backend '
'"matplotlib" is selected.')
try:
import matplotlib # noqa
except ImportError:
with pytest.raises(ImportError, match=msg):
pandas... | bsd-3-clause |
lthurlow/Boolean-Constrained-Routing | networkx-1.8.1/networkx/generators/classic.py | 30 | 15942 | """
Generators for some classic graphs.
The typical graph generator is called as follows:
>>> G=nx.complete_graph(100)
returning the complete graph on n nodes labeled 0,..,99
as a simple graph. Except for empty_graph, all the generators
in this module return a Graph class (i.e. a simple, undirected graph).
"""
# ... | mit |
leggitta/mne-python | examples/realtime/ftclient_rt_compute_psd.py | 17 | 2460 | """
==============================================================
Compute real-time power spectrum density with FieldTrip client
==============================================================
Please refer to `ftclient_rt_average.py` for instructions on
how to get the FieldTrip connector working in MNE-Python.
This e... | bsd-3-clause |
kalepeterson/ghdata | docs/python/conf.py | 2 | 5037 | # -*- coding: utf-8 -*-
#
# GHData documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 20 10:26:03 2017.
#
# 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... | mit |
pku9104038/edx-platform | lms/djangoapps/shoppingcart/processors/CyberSource.py | 28 | 18668 | ### Implementation of support for the Cybersource Credit card processor
### The name of this file should be used as the key of the dict in the CC_PROCESSOR setting
### Implementes interface as specified by __init__.py
import time
import hmac
import binascii
import re
import json
from collections import OrderedDict, de... | agpl-3.0 |
jaalto/httping | plot-json.py | 2 | 1581 | #! /usr/bin/python
import sys
import json
import os
import math
fin = sys.argv[1]
print "Loading from %s" % (fin)
fh = open(fin)
json_data = json.load(fh)
print "Number of rows: %d" % (len(json_data))
fdata = fin + ".dat"
print "Writing data to %s" % (fdata)
data_fh = open(fdata, "w")
host='?'
total=0
total_sd... | gpl-2.0 |
remb0/CouchPotatoServer | libs/werkzeug/serving.py | 13 | 25224 | # -*- coding: utf-8 -*-
"""
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standa... | gpl-3.0 |
tszym/ansible | lib/ansible/plugins/terminal/aruba.py | 31 | 1669 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
j-bennet/mycli | tests/test_naive_completion.py | 14 | 1653 | from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import mycli.sqlcompleter as sqlcompleter
return sqlcompleter.SQLCompleter(smart_completion=False)
@pytest.fixture
def complete_e... | bsd-3-clause |
mediafactory/yats | modules/yats/__init__.py | 1 | 1499 | # -*- coding: utf-8 -*-
from django.conf import settings
from sys import version_info
from yats.api import *
def update_permissions_after_migration(app,**kwargs):
"""
Update app permission just after every migration.
This is based on app django_extensions update_permissions management command.
"""
... | mit |
L33tCh/afj-flask | manage.py | 1 | 1644 | # manage.py
import os
import unittest
import coverage
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from project.server import app, db, models
COV = coverage.coverage(
branch=True,
include='project/*',
omit=[
'project/tests/*',
'project/server/config... | mit |
lbartoletti/QGIS | python/processing/__init__.py | 45 | 1256 | # -#- coding: utf-8 -#-
###########################################################################
# __init__.py
# ---------------------
# Date : November 2018
# Copyright : (C) 2018 by Nathan Woodrow
# Email : woodrow dot nathan at gmail dot com
##############... | gpl-2.0 |
ChanderG/scikit-learn | sklearn/manifold/tests/test_isomap.py | 226 | 3941 | from itertools import product
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from sklearn import datasets
from sklearn import manifold
from sklearn import neighbors
from sklearn import pipeline
from sklearn import preprocessing
from sklearn.utils.testing import assert_less
... | bsd-3-clause |
dek-odoo/python-samples | python exercises/dek_program017.py | 1 | 1356 | #!/user/bin/python
# -*- coding: utf-8 -*-
# Author : (DEK) Devendra Kavthekar
# program# : Name
# =>
# Write a program that computes the net amount of a bank account
# based a transaction log from console input. The transaction log
# format is shown as following:
# D 100
# W 200
# ��
# D means deposit while W means ... | apache-2.0 |
srlobo/slutils | slutils/sqlalchemy/group_concat.py | 1 | 1779 | # -*- coding: utf-8 -*-
# Añade la funcionalidad group_concat de mysql al sqlalchemy
from sqlalchemy.ext import compiler
from sqlalchemy.sql import ColumnElement
from sqlalchemy.orm.attributes import InstrumentedAttribute
class group_concat(ColumnElement):
def __init__(self, col1, col2=None, separator=None):
... | gpl-2.0 |
rszalski/python-gae-spike | lib/itsdangerous.py | 626 | 31840 | # -*- coding: utf-8 -*-
"""
itsdangerous
~~~~~~~~~~~~
A module that implements various functions to deal with untrusted
sources. Mainly useful for web applications.
:copyright: (c) 2014 by Armin Ronacher and the Django Software Foundation.
:license: BSD, see LICENSE for more details.
"""
imp... | apache-2.0 |
nikesh-mahalka/cinder | cinder/volume/drivers/zfssa/restclient.py | 28 | 12485 | # Copyright (c) 2014, 2015, Oracle and/or its affiliates. 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
... | apache-2.0 |
mosquito/lumper | lumper/modes/worker.py | 1 | 1481 | #!/usr/bin/env python
# encoding: utf-8
from crew.worker import Listener, Context, NODE_UUID, UUID
from pika import PlainCredentials
from crew.worker import context
import logging
import docker
import docker.tls
import lumper.worker
def run(args):
log = logging.getLogger("main")
if args.docker_tls:
t... | lgpl-3.0 |
mohsinjuni/androguard | androguard/core/binaries/idapipe.py | 45 | 6602 | # This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... | apache-2.0 |
stormandco/aiohttp_debugtoolbar | aiohttp_debugtoolbar/main.py | 1 | 3654 | import os
import jinja2
import aiohttp_jinja2
from . import views
from . import panels
from .middlewares import middleware
from .utils import APP_KEY, TEMPLATE_KEY, STATIC_ROUTE_NAME, hexlify, \
ToolbarStorage, ExceptionHistory
from .views import ExceptionDebugView
default_panel_names = [
panels.HeaderDebugPa... | apache-2.0 |
2014c2g23/w16b_test | static/Brython3.1.3-20150514-095342/Lib/stat.py | 765 | 4304 | """Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
"""
# Indices for stat struct members in the tuple returned by os.stat()
ST_MODE = 0
ST_INO = 1
ST_DEV = 2
ST_NLINK = 3
ST_UID = 4
ST_GID = 5
ST_SIZE = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9
... | agpl-3.0 |
luotao1/Paddle | python/paddle/fluid/tests/unittests/test_parallel_executor_feed_persistable_var.py | 2 | 3119 | # Copyright (c) 2019 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 appli... | apache-2.0 |
erickt/hue | desktop/core/ext-py/Paste-1.7.2/paste/debug/wdg_validate.py | 13 | 4160 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Middleware that tests the validity of all generated HTML using the
`WDG HTML Validator <http://www.htmlhelp.com/tools/validator/>`_
"""
from cStri... | apache-2.0 |
danlrobertson/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/python_api.py | 32 | 24587 | import math
import sys
import py
from six.moves import zip, filterfalse
from more_itertools.more import always_iterable
from _pytest.compat import isclass
from _pytest.compat import Mapping, Sequence
from _pytest.compat import STRING_TYPES
from _pytest.outcomes import fail
import _pytest._code
BASE_TYPE = (type, S... | mpl-2.0 |
nanolearningllc/edx-platform-cypress-2 | openedx/core/djangoapps/user_api/legacy_urls.py | 146 | 1461 | """
Defines the URL routes for this app.
"""
from django.conf import settings
from django.conf.urls import include, patterns, url
from rest_framework import routers
from . import views as user_api_views
from .models import UserPreference
USER_API_ROUTER = routers.DefaultRouter()
USER_API_ROUTER.register(r'users', us... | agpl-3.0 |
jbd/treewatcher | setup.py | 1 | 1411 | #!/usr/bin/env python
# check Python's version
import sys
if sys.version < '2.4':
sys.stderr.write('This module requires at least Python 2.5\n')
sys.exit(1)
# import statements
import platform
from setuptools import setup, Command
# debug
DISTUTILS_DEBUG = False
# check linux platform
if not platform.system... | gpl-3.0 |
aljscott/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/pulseaudio_sanitizer_mock.py | 125 | 1666 | # Copyrigth (C) 2013 Zan Dobersek <zandobersek@gmail.com>
#
# 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 ... | bsd-3-clause |
borg-project/cargo | src/python/cargo/random.py | 1 | 1157 | """
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
from __future__ import absolute_import
import numpy
def get_random_random(random = numpy.random):
"""
Get a randomly-initialized PRNG.
"""
from numpy.random import RandomState
return RandomState(random.randint(numpy.iinfo(int).max))
def r... | mit |
huggingface/transformers | src/transformers/models/retribert/tokenization_retribert.py | 2 | 1884 | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 |
leiferikb/bitpop | src/third_party/webdriver/pylib/selenium/webdriver/common/utils.py | 32 | 1518 | # Copyright 2008-2011 WebDriver committers
# Copyright 2008-2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | gpl-3.0 |
ADicksonLab/wepy | tasks/modules/docs.py | 1 | 16705 | from invoke import task
# from ..config import ()
import os
import os.path as osp
from pathlib import Path
import shutil as sh
from warnings import warn
## Paths for the different things
DOCS_TEST_DIR = "tests/test_docs/_tangled_docs"
DOCS_EXAMPLES_DIR = "tests/test_docs/_examples"
DOCS_TUTORIALS_DIR = "tests/test_... | mit |
nikolay-fedotov/tempest | tempest/api/compute/v3/servers/test_delete_server.py | 2 | 7150 | # 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 |
dpmatthews/cylc | lib/cylc/tests/test_time_parser.py | 2 | 9471 | #!/usr/bin/env python3
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors.
#
# 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... | gpl-3.0 |
hitdong/pyvision | src/pyvision/optimize/__init__.py | 35 | 1558 | # PyVision License
#
# Copyright (c) 2006-2008 David S. Bolme
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, thi... | bsd-3-clause |
mandli/multilayer-examples | 2d/plane_wave/setrun.py | 1 | 15949 | """
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import numpy as numpy
import clawpack.geoclaw.multilayer.data as multilayer
import clawpack.geoclaw.surge.data as surge
import clawpack.geocla... | mit |
ovpn-to/oVPN.to-Client-Software | else/python/hooks.py | 1 | 17289 | # -*- coding: utf-8 -*-
#
# Hooks module for py2exe.
# Inspired by cx_freeze's hooks.py, which is:
#
# Copyright © 2007-2013, Anthony Tuininga.
# Copyright © 2001-2006, Computronix (Canada) Ltd., Edmonton, Alberta, Canada.
# All rights reserved.
#
import os, sys
# Exclude modules that the standard library imp... | gpl-2.0 |
TestInABox/stackInABox | tests/util/httpretty/test_decorator.py | 2 | 6522 | """
Stack-In-A-Box: Basic Test
"""
import collections
import sys
import types
import unittest
import requests
from stackinabox.util.httpretty import decorator
from tests.util import base
from tests.utils.services import AdvancedService
from tests.utils.hello import HelloService
@unittest.skipIf(sys.version_info >=... | apache-2.0 |
agacek/jkindRegression | unit_test/tc_xml_read.py | 2 | 9310 |
import os
import unittest
from jktest.jkind import JKind
from jktest.results import JKindResult
from jktest.results import ResultList
class TC_XmlRead( unittest.TestCase ):
def setUp( self ):
self.testFile = './unit_test/test_files/tc_xml_read.xml'
# Instantiate the JKind class.
self.jk... | bsd-3-clause |
tangfeixiong/nova | nova/virt/vmwareapi/host.py | 60 | 3232 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 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/lic... | apache-2.0 |
FurCode/RoboCop | plugins/geoip.py | 5 | 1667 | import os.path
import json
import gzip
from StringIO import StringIO
import pygeoip
from util import hook, http
# load region database
with open("./plugins/data/geoip_regions.json", "rb") as f:
regions = json.loads(f.read())
if os.path.isfile(os.path.abspath("./plugins/data/GeoLiteCity.dat")):
# initialise... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.