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 |
|---|---|---|---|---|---|
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/distutils/tests/test_unixccompiler.py | 76 | 3715 | """Tests for distutils.unixccompiler."""
import sys
import unittest
from test.test_support import run_unittest
from distutils import sysconfig
from distutils.unixccompiler import UnixCCompiler
class UnixCCompilerTestCase(unittest.TestCase):
def setUp(self):
self._backup_platform = sys.platform
se... | gpl-2.0 |
vinceasza/wordpress | wp-content/themes/play/node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | gpl-2.0 |
liweitianux/atoolbox | astro/radec2deg.py | 1 | 1957 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Aaron LI
# Created: 2015-04-17
# Updated: 2016-06-30
#
"""
Convert the coordinates data in format (??h??m??s, ??d??m??s)
to format (degree, degree).
"""
import os
import sys
import re
import getopt
import math
USAGE = """Usage:
%(prog)s [ -h ] -i coords_file
R... | mit |
willharris/django | tests/utils_tests/test_numberformat.py | 18 | 3517 | from decimal import Decimal
from sys import float_info
from unittest import TestCase
from django.utils.numberformat import format as nformat
class TestNumberFormat(TestCase):
def test_format_number(self):
self.assertEqual(nformat(1234, '.'), '1234')
self.assertEqual(nformat(1234.2, '.'), '1234.2... | bsd-3-clause |
lshain-android-source/external-chromium_org | chrome/tools/build/win/syzygy_instrument.py | 31 | 6519 | #!/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.
"""A utility script to help building Syzygy-instrumented Chrome binaries."""
import glob
import logging
import optparse
import os
... | bsd-3-clause |
maestrano/openerp | openerp/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py | 56 | 6767 | #-*- 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 |
TeamTwisted/hells-Core-N5 | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
syndicate-storage/syndicate-core | tests/gateways/syndicate-write-trunc-read-repl.py | 2 | 5378 | #!/usr/bin/env python
"""
Copyright 2016 The Trustees of Princeton University
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
Unle... | apache-2.0 |
jfantom/incubator-airflow | airflow/contrib/auth/backends/proxied_auth.py | 1 | 3179 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
iut-ibk/DynaMind-ToolBox | DynaMind-ComplexUnitTests/src/gtest-1.6.0/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 |
AlbertoPeon/invenio | modules/bibrank/lib/bibrank_citation_grapher.py | 10 | 6030 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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 t... | gpl-2.0 |
adw0rd/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/comments/signals.py | 425 | 1079 | """
Signals relating to comments.
"""
from django.dispatch import Signal
# Sent just before a comment will be posted (after it's been approved and
# moderated; this can be used to modify the comment (in place) with posting
# details or other such actions. If any receiver returns False the comment will be
# discarded a... | gpl-3.0 |
neerja28/Tempest | tempest/common/generator/base_generator.py | 28 | 6282 | # Copyright 2014 Deutsche Telekom AG
# 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 requi... | apache-2.0 |
CiscoSystems/vespa | neutron/plugins/mlnx/mlnx_plugin.py | 4 | 22576 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Mellanox Technologies, Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | apache-2.0 |
dvklopfenstein/PrincetonAlgorithms | py/AlgsSedgewickWayne/Bag.py | 1 | 2806 | """Bag class is a container for generic items."""
class Bag(object): # <Item> implements Iterable<Item>:
"""The Bag class represents a bag (or multiset) of generic items."""
class _Node(object): # private static class <Item>:
"""helper linked list class"""
def __init__(self, Item, Next):
self._item... | gpl-2.0 |
hgl888/chromium-crosswalk-efl | tools/telemetry/telemetry/core/backends/webdriver/webdriver_desktop_browser_finder.py | 25 | 4101 | # 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.
"""Finds desktop browsers that can be controlled by telemetry."""
import logging
import os
import sys
from telemetry.core import browser
from telemetry.core... | bsd-3-clause |
zdary/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_ws_comma.py | 334 | 1095 | """Fixer that changes 'a ,b' into 'a, b'.
This also changes '{a :b}' into '{a: b}', but does not touch other
uses of colons. It does not touch other uses of whitespace.
"""
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
class FixWsComma(fixer_base.BaseFix):
explicit = True # The use... | apache-2.0 |
austgl/shadowsocks | shadowsocks/shell.py | 270 | 12676 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
mattclay/ansible | lib/ansible/plugins/shell/powershell.py | 29 | 11352 | # Copyright (c) 2014, Chris Church <chris@ninemoreminutes.com>
# Copyright (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 = '''
name: powershell
v... | gpl-3.0 |
alikins/ansible | lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule_member.py | 49 | 9858 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, René Moser <mail@renemoser.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 So... | gpl-3.0 |
timopulkkinen/BubbleFish | chrome/test/functional/tracing/timeline_model.py | 69 | 1823 | # 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.
import json
import os
class TimelineModel(object):
"""A proxy for about:tracing's TimelineModel class.
Test authors should never need to know that... | bsd-3-clause |
siberider/androguard | tests/test_types.py | 38 | 3683 | #!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2010, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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,... | apache-2.0 |
RacerXx/GoAtThrottleUp | ServerRelay/cherrypy/tutorial/tut09_files.py | 33 | 3596 | """
Tutorial: File upload and download
Uploads
-------
When a client uploads a file to a CherryPy application, it's placed
on disk immediately. CherryPy will pass it to your exposed method
as an argument (see "myFile" below); that arg will have a "file"
attribute, which is a handle to the temporary uploaded file.
If... | mit |
GustavoHennig/ansible | test/integration/cleanup_ec2.py | 66 | 6768 | '''
Find and delete AWS resources matching the provided --match string. Unless
--yes|-y is provided, the prompt for confirmation prior to deleting resources.
Please use caution, you can easily delete you're *ENTIRE* EC2 infrastructure.
'''
import os
import re
import sys
import boto
import optparse
import yaml
import ... | gpl-3.0 |
hantek/fuel | tests/test_serialization.py | 25 | 1403 | import os
import tempfile
import numpy
from six.moves import cPickle
from fuel.streams import DataStream
from fuel.datasets import MNIST
from fuel.schemes import SequentialScheme
from tests import skip_if_not_available
def test_in_memory():
skip_if_not_available(datasets=['mnist.hdf5'])
# Load MNIST and get... | mit |
matthewlent/ng-boilerplate-flask | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/sax.py | 1835 | 1661 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... | mit |
joone/chromium-crosswalk | tools/grit/grit/format/policy_templates/writers/adml_writer.py | 41 | 7710 | #!/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.
from xml.dom import minidom
from grit.format.policy_templates.writers import xml_formatted_writer
def GetWriter(config):
'''Fac... | bsd-3-clause |
Parcks/core | test/service/test_post_installation_facade.py | 1 | 3532 | """
Scriptable Packages Installer - Parcks
Copyright (C) 2017 JValck - Setarit
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 option) any later version.... | gpl-2.0 |
M32Media/redash | redash/tasks/queries.py | 1 | 24668 | import json
import time
import logging
import signal
import redis
import re
from celery.result import AsyncResult
from celery.utils.log import get_task_logger
from redash import redis_connection, models, statsd_client, settings, utils
from redash.utils import gen_query_hash
from redash.worker import celery
from redash.... | bsd-2-clause |
dpryan79/tools-iuc | tools/repmatch_gff3/repmatch_gff3.py | 25 | 3106 | # repmatch.py
#
# Replicate matching - matches paired peaks from two or more replicates
#
# Input: one or more gff files (matched_peak output from cwpair2, each a list of paired peaks from a replicate
#
# Output: list of matched groups and list of unmatched peaks
# Files: statistics_table.tabular (file to replicate ID)... | mit |
kenshay/ImageScripter | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/telemetry/internal/platform/win_platform_backend.py | 5 | 15541 | # 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.
from telemetry.internal.util import atexit_with_log
import collections
import contextlib
import ctypes
import logging
import os
import platform
import re
imp... | gpl-3.0 |
mattuuh7/incubator-airflow | airflow/contrib/hooks/datastore_hook.py | 44 | 4342 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
mkrzewic/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/write/RawSpectrumWriter.py | 41 | 3421 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
daliwangi/bitcoin | test/functional/combine_logs.py | 69 | 4611 | #!/usr/bin/env python3
"""Combine logs from multiple bitcoin nodes as well as the test_framework log.
This streams the combined log output to stdout. Use combine_logs.py > outputfile
to write to an outputfile."""
import argparse
from collections import defaultdict, namedtuple
import heapq
import itertools
import os
i... | mit |
kashif/chainer | tests/chainer_tests/initializer_tests/test_init.py | 8 | 1230 | import unittest
from chainer import initializers
from chainer import testing
import numpy
class TestGetInitializer(unittest.TestCase):
def test_scalar(self):
init = initializers._get_initializer(10)
self.assertIsInstance(init, initializers.Constant)
x = numpy.empty((2, 3), dtype=numpy.... | mit |
mancoast/CPythonPyc_test | fail/323_profilee.py | 398 | 3041 | """
Input for test_profile.py and test_cprofile.py.
IMPORTANT: This stuff is touchy. If you modify anything above the
test class you'll have to regenerate the stats by running the two
test files.
*ALL* NUMBERS in the expected output are relevant. If you change
the formatting of pstats, please don't just regenerate t... | gpl-3.0 |
dios-game/dios-cocos | src/oslibs/cocos/cocos-src/tools/cocos2d-console/plugins/plugin_jscompile/__init__.py | 1 | 12716 | #!/usr/bin/python
# ----------------------------------------------------------------------------
# cocos "jscompile" plugin
#
# Copyright 2013 (C) Intel
#
# License: MIT
# ----------------------------------------------------------------------------
'''
"jscompile" plugin for cocos command line tool
'''
__docformat__ =... | mit |
FlaPer87/django-nonrel | django/core/files/temp.py | 536 | 1819 | """
The temp module provides a NamedTemporaryFile that can be re-opened on any
platform. Most platforms use the standard Python tempfile.TemporaryFile class,
but MS Windows users are given a custom class.
This is needed because in Windows NT, the default implementation of
NamedTemporaryFile uses the O_TEMPORARY flag, ... | bsd-3-clause |
wnt-zhp/hufce | django/utils/timezone.py | 81 | 8011 | """Timezone helper functions.
This module uses pytz when it's available and fallbacks when it isn't.
"""
from datetime import datetime, timedelta, tzinfo
from threading import local
import time as _time
try:
import pytz
except ImportError:
pytz = None
from django.conf import settings
__all__ = [
'utc',... | gpl-3.0 |
berrange/nova | nova/tests/api/openstack/compute/extensions/foxinsocks.py | 103 | 2948 | # Copyright 2011 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 |
sujeetv/incubator-hawq | tools/bin/gppylib/operations/hdfs_cmd.py | 9 | 8261 | #!/usr/bin/env python
# encoding: utf-8
'''
This file contains all API for calling hdfs related commands directly
'''
import logging
import os, sys, subprocess
import re
logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler(sys.stdout))
logger.setLevel(logging.DEBUG)
class HDFS_Cmd(object):
... | apache-2.0 |
ravibhure/ansible | lib/ansible/modules/cloud/amazon/cloudfront_distribution.py | 14 | 85861 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module... | gpl-3.0 |
sekikn/incubator-airflow | tests/providers/amazon/aws/operators/test_emr_terminate_job_flow.py | 10 | 1847 | #
# 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... | apache-2.0 |
jdkoreclipse/android_kernel_htc_msm8960 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
deepmind/deepmind-research | ogb_lsc/mag/losses.py | 1 | 6654 | # Copyright 2021 DeepMind Technologies 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | apache-2.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_import.py | 12 | 40219 | # We import importlib *ASAP* in order to test #15386
import importlib
import importlib.util
from importlib._bootstrap import _get_sourcefile
import builtins
import marshal
import os
import platform
import py_compile
import random
import stat
import sys
import unittest
import unittest.mock as mock
import textwrap
import... | gpl-2.0 |
kenshay/ImageScripter | Script_Runner/PYTHON/Lib/lib2to3/fixer_base.py | 41 | 6690 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Base class for fixers (optional, but recommended)."""
# Python imports
import itertools
# Local imports
from .patcomp import PatternCompiler
from . import pygram
from .fixer_util import does_tree_import
class Base... | gpl-3.0 |
dhp-denero/LibrERP | crm_lead_correct/crm_case_stage.py | 2 | 1579 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2013 Didotech SRL (info at didotech.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole re... | agpl-3.0 |
sahiljain/catapult | dashboard/dashboard/benchmark_health_report_test.py | 2 | 5261 | # Copyright 2017 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 datetime
import unittest
import webapp2
import webtest
from google.appengine.ext import ndb
from dashboard import benchmark_health_report
from dash... | bsd-3-clause |
eayunstack/fuel-web | nailgun/nailgun/rpc/__init__.py | 3 | 2731 | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | apache-2.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/host/lib/scons-2.1.0/SCons/Tool/cc.py | 21 | 3747 | """SCons.Tool.cc
Tool-specific initialization for generic Posix C compilers.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ... | gpl-2.0 |
adhocish/MELEEDB | meleedb/main.py | 1 | 1570 | import logging
import datetime
import os
from scrapy.crawler import CrawlerProcess
from scrapy.settings import Settings
from scrapy.utils.log import configure_logging
import spiders
def run():
# Logging settings
configure_logging(install_root_handler=False)
logging.basicConfig(
datefmt='%Y-%m-%d ... | gpl-3.0 |
Botong/Data_Pipeline_Byte1 | lib/flask/exthook.py | 783 | 5087 | # -*- coding: utf-8 -*-
"""
flask.exthook
~~~~~~~~~~~~~
Redirect imports for extensions. This module basically makes it possible
for us to transition from flaskext.foo to flask_foo without having to
force all extensions to upgrade at the same time.
When a user does ``from flask.ext.foo import... | apache-2.0 |
olexiim/edx-platform | lms/djangoapps/django_comment_client/base/tests.py | 12 | 42022 | import logging
import json
from django.test.client import Client, RequestFactory
from django.test.utils import override_settings
from django.contrib.auth.models import User
from django.core.management import call_command
from django.core.urlresolvers import reverse
from mock import patch, ANY, Mock
from nose.tools imp... | agpl-3.0 |
sri85/selenium | py/selenium/webdriver/common/utils.py | 63 | 2090 | # 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 |
gsehub/edx-platform | openedx/core/djangoapps/geoinfo/tests/test_middleware.py | 31 | 5269 | # pylint: disable=no-member
"""
Tests for CountryMiddleware.
"""
from mock import patch
import pygeoip
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase
from django.test.client import RequestFactory
from openedx.core.djangoapps.geoinfo.middleware import CountryMiddlewar... | agpl-3.0 |
ansible/ansible | test/support/integration/plugins/module_utils/aws/s3.py | 60 | 1584 | # Copyright (c) 2018 Red Hat, Inc.
# 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
try:
from botocore.exceptions import BotoCoreError, ClientError
except ImportError:
pass # ... | gpl-3.0 |
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/compute/subcommands/url_maps/add_host_rule.py | 2 | 3707 | # Copyright 2014 Google Inc. All Rights Reserved.
"""Command for adding a host rule to a URL map."""
import copy
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.compute.lib import base_classes
class AddHostRule(base_classes.ReadWriteCommand):
"""Add a rule to a URL map to map hosts to a path ma... | apache-2.0 |
azumimuo/family-xbmc-addon | plugin.video.ZemTV-shani/websocket/tests/test_websocket.py | 57 | 26212 | # -*- coding: utf-8 -*-
#
import six
import sys
sys.path[0:0] = [""]
import os
import os.path
import base64
import socket
try:
from ssl import SSLError
except ImportError:
# dummy class of SSLError for ssl none-support environment.
class SSLError(Exception):
pass
if sys.version_info[0] == 2 and s... | gpl-2.0 |
guludo/ardupilot-1 | Tools/scripts/magfit_flashlog.py | 278 | 4744 | #!/usr/bin/env python
''' fit best estimate of magnetometer offsets from ArduCopter flashlog
using the algorithm from Bill Premerlani
'''
import sys, time, os, math
# command line option handling
from optparse import OptionParser
parser = OptionParser("magfit_flashlog.py [options]")
parser.add_option("--verbose", ac... | gpl-3.0 |
uwescience/pulse2percept | pulse2percept/implants/bvt.py | 1 | 4694 | """`BVT24`"""
import numpy as np
from .base import ProsthesisSystem
from .electrodes import DiskElectrode
from .electrode_arrays import ElectrodeArray
class BVT24(ProsthesisSystem):
"""24-channel suprachoroidal retinal prosthesis
This class creates a 24-channel suprachoroidal retinal prosthesis
[Layton2... | bsd-3-clause |
jemekite/Dougpool | p2pool/util/deferral.py | 233 | 8790 | from __future__ import division
import itertools
import random
import sys
from twisted.internet import defer, reactor
from twisted.python import failure, log
def sleep(t):
d = defer.Deferred(canceller=lambda d_: dc.cancel())
dc = reactor.callLater(t, d.callback, None)
return d
def run_repeatedly(f, *arg... | gpl-3.0 |
wanderknight/tushare | tushare/__init__.py | 1 | 2582 | __version__ = '0.4.1'
__author__ = 'Jimmy Liu'
"""
for trading data
"""
from tushare.stock.trading import (get_hist_data, get_tick_data,
get_today_all, get_realtime_quotes,
get_h_data, get_today_ticks,
get... | bsd-3-clause |
htzy/bigfour | common/djangoapps/track/tests/test_shim.py | 111 | 4737 | """Ensure emitted events contain the fields legacy processors expect to find."""
from mock import sentinel
from django.test.utils import override_settings
from openedx.core.lib.tests.assertions.events import assert_events_equal
from track.tests import EventTrackingTestCase, FROZEN_TIME
LEGACY_SHIM_PROCESSOR = [
... | agpl-3.0 |
belemizz/mimic2_tools | clinical_db/classify_patients.py | 1 | 3203 | """
classify patients based on lab tests
"""
import get_sample.mimic2
from mutil import Graph
import mutil.mycsv
import time
import datetime
import random
import numpy as np
import theano
import theano.tensor as T
import alg.classification
def main( max_id = 2000, target_codes = ['428.0'], show_flag = True):
m... | mit |
Jokeren/neon | tests/serialization/cifar10_conv.py | 2 | 3454 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015-2016 Nervana Systems 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
#... | apache-2.0 |
Erotemic/utool | utool/util_logging.py | 1 | 20540 | # -*- coding: utf-8 -*-
"""
If logging is on, utool will overwrite the print function with a logging function
This is a special module which will not get injected into (should it be internal?)
References:
# maybe we can do something like this Queue to try fixing error when
# when using injected print statment... | apache-2.0 |
rahushen/ansible | lib/ansible/modules/cloud/spotinst/spotinst_aws_elastigroup.py | 45 | 48701 | #!/usr/bin/python
# Copyright (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)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/codecs.py | 84 | 35956 | """ codecs -- Python Codec Registry, API and helpers.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import builtins, sys
### Registry and builtin stateless codec functions
try:
from _codecs import *
except ImportError as why:
raise SystemErro... | lgpl-3.0 |
Stymphalian/sublime-plugins | KeyMapQuery/KeyMapQuery.py | 1 | 8716 | import sublime, sublime_plugin
import re
from collections import namedtuple
import os.path
"""
KeyMapQueryCommand allows you to quickly query if a key-binding is bound.
A combo-box will appear displayings a list of bound key-bindings. Type a key-combination
into the inptu box to narrow the results ( i.e. ctrl+... | mit |
alfredodeza/execnet | execnet/gateway_io.py | 1 | 7538 | # -*- coding: utf-8 -*-
"""
execnet io initialization code
creates io instances used for gateway io
"""
import os
import shlex
import sys
try:
from execnet.gateway_base import Popen2IO, Message
except ImportError:
from __main__ import Popen2IO, Message
from functools import partial
class Popen2IOMaster(Pop... | mit |
lakshayg/tensorflow | tensorflow/contrib/opt/python/training/addsign.py | 55 | 6067 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
melviso/beatle | beatle/app/resources/_file.py | 2 | 3118 | # -*- coding: utf-8 -*-
_file = [
"24 24 114 2",
" c None",
". c #DCDCDC",
"+ c #D5D5D5",
"@ c #D7D7D7",
"# c #D2D2D2",
"$ c #D3D2D3",
"% c #D4D4D5",
"& c #D0D0D0",
"* c #C9C9C9",
"= c #C3C3C3",
"- c #BABABA",
"; c #F3F3F3",
"> c #E3E3E3",
", c #E1E1E1",
"' c #E0E0E0",
") c #E2E2E2",
"! c #E1E0E1",
"... | gpl-2.0 |
ObsidianBlk/GemRB--Unofficial- | gemrb/GUIScripts/iwd2/Sound.py | 5 | 4166 | # GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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 option) any later versi... | gpl-2.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/scipy/sparse/linalg/tests/test_interface.py | 11 | 7922 | """Test functions for the sparse.linalg.interface module
"""
from __future__ import division, print_function, absolute_import
from numpy.testing import TestCase, assert_, assert_equal, \
assert_raises
import numpy as np
import scipy.sparse as sparse
from itertools import product
from scipy.sparse.linalg imp... | mit |
wpjesus/codematch | ietf/secr/proceedings/forms.py | 1 | 6833 | import os
from django import forms
from django.conf import settings
from django.template.defaultfilters import filesizeformat
from ietf.doc.models import Document
from ietf.group.models import Group
from ietf.name.models import DocTypeName
from ietf.meeting.models import Meeting, Session
# -------------------------... | bsd-3-clause |
hyperized/ansible | lib/ansible/modules/cloud/azure/azure_rm_iotdevice_info.py | 21 | 10097 | #!/usr/bin/python
#
# Copyright (c) 2019 Yuwei Zhou, <yuwzho@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
joeythesaint/yocto-autobuilder | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/protocols/gps/rockwell.py | 37 | 11628 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Rockwell Semiconductor Zodiac Serial Protocol
Coded from official protocol specs (Order No. GPS-25, 09/24/1996, Revision 11)
Maintainer: Bob Ippolito
The following Rockwell Zodiac messages are currently understood::
EARTHA\\r\\n (a hack... | gpl-2.0 |
ioffer30/google-blog-converters-appengine | src/blogger2movabletype/b2mt.py | 30 | 6266 | #!/usr/bin/env python
# Copyright 2008 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.txt
#
# Unless required by applica... | apache-2.0 |
hyperspy/hyperspyUI | hyperspyui/plugincreator.py | 3 | 3831 | # -*- coding: utf-8 -*-
# Copyright 2014-2016 The HyperSpyUI developers
#
# This file is part of HyperSpyUI.
#
# HyperSpyUI 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
#... | gpl-3.0 |
75651/kbengine_cloud | kbe/src/lib/python/Lib/pydoc_data/topics.py | 63 | 386447 | # -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Sun Oct 5 19:01:41 2014
topics = {'assert': '\nThe "assert" statement\n**********************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, "as... | lgpl-3.0 |
alaeddine10/ggrc-core | src/ggrc/models/relationship_types.py | 1 | 21783 |
class RelationshipTypes(object):
@classmethod
def types(cls):
types = {}
for k, rt in RELATIONSHIP_TYPES.items():
types[k] = rt.copy()
types[k].update({ 'relationship_type': k })
return types
@classmethod
def get_type(cls, relationship_type_id):
return cls.types().get(relationship_... | apache-2.0 |
hall-lab/bamkit | bamcleanheader.py | 2 | 4109 | #!/usr/bin/env python
import argparse, sys
from argparse import RawTextHelpFormatter
import pysam
__author__ = "Author (email@site.com)"
__version__ = "$Revision: 0.0.1 $"
__date__ = "$Date: 2013-05-09 14:31 $"
# --------------------------------------
# define functions
def get_args():
parser = argparse.Argumen... | mit |
yantrabuddhi/atomspace | tests/python/old/test_fishgram.py | 48 | 6101 | from unittest import TestCase
# uses Python mock, installed with "sudo easy_install mock"
# http://www.voidspace.org.uk/python/mock/
from mock import patch
import os
import tempfile
from opencog.atomspace import AtomSpace, TruthValue, Atom, Handle
from opencog.atomspace import types, is_a, get_type, get_type_name
imp... | agpl-3.0 |
3liz/qgis-wps4server | filters/PyWPS/tests/process_inits.py | 1 | 3027 | import os
import sys
pywpsPath = os.path.abspath(os.path.join(
os.path.split(os.path.abspath(__file__))[0], ".."))
sys.path.append(pywpsPath)
import pywps
import pywps.Process
import unittest
import os
from xml.dom import minidom
class RequestGetTestCase(unittest.TestCase):
inputs = None
getcapabilities... | gpl-3.0 |
alxgu/ansible | lib/ansible/modules/network/fortios/fortios_voip_profile.py | 17 | 52734 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
sudosurootdev/external_chromium_org | third_party/closure_linter/closure_linter/tokenutil_test.py | 109 | 7678 | #!/usr/bin/env python
#
# Copyright 2012 The Closure Linter 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
#
#... | bsd-3-clause |
Southpaw-TACTIC/Team | src/python/Lib/hotshot/log.py | 20 | 6433 | import _hotshot
import os.path
import parser
import symbol
from _hotshot import \
WHAT_ENTER, \
WHAT_EXIT, \
WHAT_LINENO, \
WHAT_DEFINE_FILE, \
WHAT_DEFINE_FUNC, \
WHAT_ADD_INFO
__all__ = ["LogReader", "ENTER", "EXIT", "LINE"]
ENTER = WHAT_ENTER
EXIT = WHAT_EXIT
LI... | epl-1.0 |
dednal/chromium.src | tools/telemetry/telemetry/core/backends/chrome/oobe.py | 15 | 2036 | # Copyright 2014 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 logging
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.core import web_contents
class Oobe(web_contents.WebCo... | bsd-3-clause |
benjaminrigaud/django | tests/migrations/test_autodetector.py | 1 | 81958 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.test import TestCase, override_settings
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.questioner import MigrationQuestioner
from django.db.migrations.state import ProjectState, ModelState
from django.db.... | bsd-3-clause |
lgiommi/root | interpreter/llvm/src/utils/lit/lit/ShUtil.py | 83 | 12179 | from __future__ import absolute_import
import itertools
import lit.util
from lit.ShCommands import Command, Pipeline, Seq
class ShLexer:
def __init__(self, data, win32Escapes = False):
self.data = data
self.pos = 0
self.end = len(data)
self.win32Escapes = win32Escapes
def eat(... | lgpl-2.1 |
bworrell/mixbox | mixbox/parser.py | 1 | 6500 | # Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
from abc import ABCMeta, abstractmethod
from distutils.version import StrictVersion
from .exceptions import ignored
from .xml import get_etree_root, get_schemaloc_pairs
class UnknownVersionError(Exception):
"... | bsd-3-clause |
mancoast/CPythonPyc_test | fail/342_test_range.py | 67 | 23223 | # Python test set -- built-in functions
import test.support, unittest
import sys
import pickle
import itertools
# pure Python implementations (3 args only), for comparison
def pyrange(start, stop, step):
if (start - stop) // step < 0:
# replace stop with next element in the sequence of integers
# ... | gpl-3.0 |
zofuthan/edx-platform | cms/djangoapps/course_creators/tests/test_views.py | 98 | 4497 | """
Tests course_creators.views.py.
"""
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.test import TestCase, RequestFactory
from course_creators.views import add_user_with_status_unrequested, add_user_with_status_granted
from course_creators.views import ge... | agpl-3.0 |
mikulucky/java-design-patterns | _scripts/postPumlsToServer.py | 2 | 2860 | #
# The MIT License
# Copyright (c) 2014 Ilkka Seppälä
#
# 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 use, copy, modify, m... | mit |
urska19/LVR-sat | src/graphColoring.py | 1 | 1511 | #!/usr/bin/env python
from logConstructs import *
def graph_coloring(graph, colors):
if len(graph) < colors:
return False
variables=[[None for i in range(colors)] for j in range(len(graph))]
#construct variables
for i in range(len(graph)):
for j in range(colors):
variable... | bsd-3-clause |
pylixm/sae-django-demo | django1.7-sae/site-packages/django/contrib/admin/helpers.py | 13 | 14132 | from __future__ import unicode_literals
from django import forms
from django.contrib.admin.utils import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.contrib.admin.templatetags.admin_static import static
from django.core.exceptions import ObjectDoesNotExist
... | apache-2.0 |
ryfeus/lambda-packs | LightGBM_sklearn_scipy_numpy/source/sklearn/cluster/dbscan_.py | 18 | 12859 | # -*- coding: utf-8 -*-
"""
DBSCAN: Density-Based Spatial Clustering of Applications with Noise
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Joel Nothman <joel.nothman@gmail.com>
# Lars Buitinck
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from ..base import BaseEst... | mit |
BizShuk/env_setup | pkg/sublime/MarkdownEditing/insert_references.py | 2 | 5385 | # -*- coding: UTF-8 -*-
import sublime
import sublime_plugin
import re
def get_clipboard_if_url():
# If the clipboard contains an URL, return it
# Otherwise, return an empty string
re_match_urls = re.compile(r"""((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+... | gpl-3.0 |
dschien/PyExcelModelingHelper | excel_helper/__init__.py | 1 | 33092 | import csv
import datetime
import importlib
import sys
from abc import abstractmethod
from collections import defaultdict
from typing import Dict, List, Set
import numpy as np
import pandas as pd
from dateutil import relativedelta as rdelta
import logging
from functools import partial
from xlrd import xldate_as_tupl... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.