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 |
|---|---|---|---|---|---|
lightbulb-framework/lightbulb-framework | libs/threading.py | 13 | 31569 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
try:
import thread
except ImportError:
del _sys.modules[__name__]
raise
import warnings
from time import time as _time, sleep as _sleep
from traceback import format_exc as _format_exc
from collections import deque
# No... | mit |
mancoast/CPythonPyc_test | fail/335_test_winsound.py | 4 | 9075 | # Ridiculously simple test of the winsound module for Windows.
import unittest
from test import support
support.requires('audio')
import time
import os
import subprocess
winsound = support.import_module('winsound')
ctypes = support.import_module('ctypes')
import winreg
def has_sound(sound):
"""Find out if a part... | gpl-3.0 |
ramitsurana/boto | scripts/rebuild_endpoints.py | 79 | 1281 | import json
from pyquery import PyQuery as pq
import requests
class FetchError(Exception):
pass
def fetch_endpoints():
# We utilize what the Java SDK publishes as a baseline.
resp = requests.get('https://raw2.github.com/aws/aws-sdk-java/master/src/main/resources/etc/regions.xml')
if int(resp.status... | mit |
eval1749/elang | build/android/devil/android/sdk/gce_adb_wrapper.py | 12 | 4853 | # Copyright 2015 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.
"""Provides a work around for various adb commands on android gce instances.
Some adb commands don't work well when the device is a cloud vm, namely
'push' ... | apache-2.0 |
JackieXie168/rethinkdb | test/common/http_support/jinja2/testsuite/debug.py | 415 | 1935 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.debug
~~~~~~~~~~~~~~~~~~~~~~
Tests the debug system.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase, filesystem_loader
from jinja2 import Environment,... | apache-2.0 |
XXLRay/libreshot | build/lib.linux-x86_64-2.7/libreshot/classes/timeline.py | 2 | 1380 | # LibreShot Video Editor is a program that creates, modifies, and edits video files.
# Copyright (C) 2009 Jonathan Thomas
#
# This file is part of LibreShot Video Editor (http://launchpad.net/openshot/).
#
# LibreShot Video Editor is free software: you can redistribute it and/or modify
# it under the terms of the GN... | gpl-3.0 |
vbelakov/h2o | py/testdir_single_jvm/test_exec2_cmp_many_cols.py | 9 | 5275 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e
print "Many cols, compare two data frames using exec =="
def write_syn_dataset(csvPathname, rowCount, colCount, SEED):
# 8 random generatators, 1 per column
r1... | apache-2.0 |
iphoting/healthchecks | hc/front/tests/test_pause.py | 2 | 2485 | from datetime import timedelta as td
from django.utils.timezone import now
from hc.api.models import Check
from hc.test import BaseTestCase
class PauseTestCase(BaseTestCase):
def setUp(self):
super().setUp()
self.check = Check.objects.create(project=self.project, status="up")
self.url = "... | bsd-3-clause |
MartinHjelmare/home-assistant | homeassistant/components/modbus/binary_sensor.py | 7 | 2062 | """Support for Modbus Coil sensors."""
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_SLAVE
from homeassistant.helpers import config_validation as ... | apache-2.0 |
campaul/photoshell | photoshell/image.py | 3 | 1343 | from gi.repository import GdkPixbuf
from gi.repository import Gtk
import wand.image
class Image(object):
def __init__(self, image_path, datetime):
self.image_path = image_path
self.datetime = datetime
self._width = None
self._height = None
def width(self):
if not se... | mit |
Papa2k15/flask | tests/test_blueprints.py | 143 | 18147 | # -*- coding: utf-8 -*-
"""
tests.blueprints
~~~~~~~~~~~~~~~~
Blueprints (and currently modules)
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
from flask._compat import text_type
from werkzeug.http import parse_cache_control_... | bsd-3-clause |
cwisecarver/osf.io | osf/utils/caching.py | 29 | 2114 | """
A property cache mechanism.
The cache is stored on the model as a protected attribute. Expensive
property lookups, such as database access, can therefore be sped up
when accessed multiple times in the same request.
The property can also be safely set and deleted without interference.
NOTE: Properties will *not* be... | apache-2.0 |
myfreecomm/fixofx | test/ofxtools_qif_converter.py | 1 | 9183 | # Copyright 2005-2010 Wesabe, 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 agreed to in ... | apache-2.0 |
XiaodunServerGroup/ddyedx | common/djangoapps/terrain/steps.py | 7 | 6704 | #pylint: disable=C0111
#pylint: disable=W0621
# Disable the "wildcard import" warning so we can bring in all methods from
# course helpers and ui helpers
#pylint: disable=W0401
# Disable the "Unused import %s from wildcard import" warning
#pylint: disable=W0614
# Disable the "unused argument" warning because lettuce... | agpl-3.0 |
szeged/servo | tests/wpt/web-platform-tests/tools/third_party/h2/h2/events.py | 27 | 21277 | # -*- coding: utf-8 -*-
"""
h2/events
~~~~~~~~~
Defines Event types for HTTP/2.
Events are returned by the H2 state machine to allow implementations to keep
track of events triggered by receiving data. Each time data is provided to the
H2 state machine it processes the data and returns a list of Event objects.
"""
im... | mpl-2.0 |
simsong/grr-insider | lib/artifact.py | 1 | 15969 | #!/usr/bin/env python
"""Base classes for artifacts."""
import logging
from grr.lib import aff4
from grr.lib import artifact_lib
from grr.lib import config_lib
from grr.lib import flow
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib import utils
class AFF4ResultWriter(object):
"""A wrapper ... | apache-2.0 |
adaussy/eclipse-monkey-revival | plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/test/test_parser.py | 38 | 20214 | import parser
import unittest
import sys
from test import test_support
#
# First, we test that we can generate trees from valid source fragments,
# and that these valid trees are indeed allowed by the tree-loading side
# of the parser module.
#
class RoundtripLegalSyntaxTestCase(unittest.TestCase):
def roundt... | epl-1.0 |
phra/802_21 | boost_1_49_0/tools/build/v2/tools/rc.py | 32 | 7115 | # Status: being ported by Steven Watanabe
# Base revision: 47077
#
# Copyright (C) Andre Hentz 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and wi... | gpl-2.0 |
silenci/neutron | neutron/tests/unit/ipam/drivers/neutrondb_ipam/test_db_api.py | 15 | 7533 | # Copyright 2015 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 req... | apache-2.0 |
makermade/arm_android-19_arm-linux-androideabi-4.8 | lib/python2.7/encodings/mac_farsi.py | 593 | 15426 | """ Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,err... | gpl-2.0 |
klock-android/linux | scripts/analyze_suspend.py | 1537 | 120394 | #!/usr/bin/python
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This prog... | gpl-2.0 |
tuxxi/OpenBurn | openburn/ui/mainwindow.py | 1 | 3263 | from qtpy.QtWidgets import (QWidget, QFrame, QMainWindow, QMenuBar, QStatusBar, QAction, QApplication,
QTabWidget, QVBoxLayout)
from qtpy.QtGui import QIcon
from openburn import RESOURCE_PATH
from openburn.ui.dialogs.about import AboutDialog
from openburn.ui.designtab import DesignTab
cl... | gpl-3.0 |
dpatrickx/course-ucore-lab | related_info/ostep/ostep4-paging-linear-translate.py | 54 | 6658 | #! /usr/bin/env python
import sys
from optparse import OptionParser
import random
import math
def mustbepowerof2(bits, size, msg):
if math.pow(2,bits) != size:
print 'Error in argument: %s' % msg
sys.exit(1)
def mustbemultipleof(bignum, num, msg):
if (int(float(bignum)/float(num)) != (int(big... | gpl-2.0 |
ekalosak/server | docs/source/conf.py | 5 | 9261 | # -*- coding: utf-8 -*-
#
# GA4GH documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 1 14:35:20 2015.
#
# 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.
#
# All... | apache-2.0 |
rbrito/pkg-youtube-dl | youtube_dl/extractor/bet.py | 64 | 2783 | from __future__ import unicode_literals
from .mtv import MTVServicesInfoExtractor
from ..utils import unified_strdate
class BetIE(MTVServicesInfoExtractor):
_VALID_URL = r'https?://(?:www\.)?bet\.com/(?:[^/]+/)+(?P<id>.+?)\.html'
_TESTS = [
{
'url': 'http://www.bet.com/news/politics/2014/... | unlicense |
Facetracker-project/facetracker-core | lib/youtube-dl/test/test_age_restriction.py | 171 | 1379 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import try_rm
from youtube_dl import YoutubeDL
def _download_restricted(url, filename, age):
... | gpl-2.0 |
kbrebanov/ansible | lib/ansible/modules/cloud/amazon/lambda_policy.py | 7 | 13778 | #!/usr/bin/python
# Copyright (c) 2016, Pierre Jodouin <pjodouin@virtualcomputing.solutions>
# 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 = {'status': ['preview'],
'supported_by': 'community',
... | gpl-3.0 |
nicproulx/mne-python | mne/time_frequency/tests/test_psd.py | 2 | 7360 | import numpy as np
import os.path as op
from numpy.testing import assert_array_almost_equal, assert_raises
from nose.tools import assert_true
from mne import pick_types, Epochs, read_events
from mne.io import RawArray, read_raw_fif
from mne.utils import requires_version, slow_test, run_tests_if_main
from mne.time_freq... | bsd-3-clause |
ThirdProject/android_external_chromium_org | third_party/closure_linter/closure_linter/javascriptlintrules.py | 108 | 23113 | #!/usr/bin/env python
#
# Copyright 2011 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 |
candy7393/VTK | ThirdParty/Twisted/twisted/internet/iocpreactor/tcp.py | 23 | 18235 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
TCP support for IOCP reactor
"""
import socket, operator, errno, struct
from zope.interface import implements, classImplements
from twisted.internet import interfaces, error, address, main, defer
from twisted.internet.abstract import _LogOw... | bsd-3-clause |
aminert/scikit-learn | sklearn/feature_extraction/tests/test_image.py | 205 | 10378 | # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import numpy as np
import scipy as sp
from scipy import ndimage
from nose.tools import assert_equal, assert_true
from numpy.testing import assert_raises
from sklearn... | bsd-3-clause |
dmeulen/home-assistant | homeassistant/components/switch/transmission.py | 29 | 3112 | """
Support for setting the Transmission BitTorrent client Turtle Mode.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.transmission/
"""
import logging
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA
from hom... | mit |
civato/CivZ-SnapKat-SM_9005-900T | 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 |
manaschaturvedi/oscarbuddy | requests/status_codes.py | 926 | 3200 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | mit |
ewongbb/stem | stem/prereq.py | 1 | 4914 | # Copyright 2012-2017, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Checks for stem dependencies. We require python 2.6 or greater (including the
3.x series), but note we'll be bumping our requirements to python 2.7 in stem
2.0. Other requirements for complete functionality are...
* ... | lgpl-3.0 |
timothsp/where2ate | venv/lib/python3.3/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.py | 2930 | 11275 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | cc0-1.0 |
wangxiangyu/horizon | openstack_dashboard/dashboards/identity/projects/tests.py | 15 | 80359 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
wfxiang08/django190 | tests/utils_tests/test_html.py | 34 | 10708 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from datetime import datetime
from django.test import SimpleTestCase, ignore_warnings
from django.utils import html, safestring, six
from django.utils._os import upath
from django.utils.deprecation import RemovedInDjango20Warning
from django.ut... | bsd-3-clause |
js0701/chromium-crosswalk | tools/telemetry/telemetry/internal/platform/power_monitor/sysfs_power_monitor_unittest.py | 14 | 9018 | # 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 unittest
from telemetry.internal.platform import android_platform_backend
from telemetry.internal.platform.power_monitor import sysfs_power_monitor
... | bsd-3-clause |
Endika/pos-addons | pos_debt_notebook/models.py | 9 | 2190 | # -*- coding: utf-8 -*-
from openerp import models, fields, api
import openerp.addons.decimal_precision as dp
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.multi
def _get_debt(self):
debt_account = self.env.ref('pos_debt_notebook.debt_account')
debt_journal = self.env.ref(... | lgpl-3.0 |
ferrants/ansible-modules-core | system/user.py | 13 | 70584 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Stephen Fromm <sfromm@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 Lice... | gpl-3.0 |
ME-ICA/me-ica | meica.libs/mdp/parallel/pp_support.py | 1 | 13771 | """
Adapters for the Parallel Python library (http://www.parallelpython.com).
The PPScheduler class uses an existing pp scheduler and is a simple adapter.
LocalPPScheduler includes the creation of a local pp scheduler.
NetworkPPScheduler includes the management of the remote slaves via SSH.
"""
from __future__ impor... | lgpl-2.1 |
nikolay-fedotov/networking-cisco | networking_cisco/tests/unit/ml2/drivers/cisco/nexus/test_cisco_nexus.py | 1 | 7977 | # Copyright (c) 2013 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 |
edhuckle/statsmodels | statsmodels/tsa/tests/results/arima111nc_css_results.py | 36 | 43835 | import numpy as np
llf = np.array([-242.89663276735])
nobs = np.array([ 202])
k = np.array([ 3])
k_exog = np.array([ 1])
sigma = np.array([ .8053519404535])
chi2 = np.array([ 15723.381396967])
df_model = np.array([ 2])
k_ar = np.array([ 1])
k... | bsd-3-clause |
sinhrks/numpy | numpy/distutils/command/config.py | 11 | 15829 | # Added Fortran compiler support to config. Currently useful only for
# try_compile call. try_run works but is untested for most of Fortran
# compilers (they must define linker_exe first).
# Pearu Peterson
from __future__ import division, absolute_import, print_function
import os, signal
import warnings
import sys
fr... | bsd-3-clause |
AnotherIvan/calibre | src/calibre/utils/ipc/worker.py | 8 | 7329 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, cPickle, sys, importlib
from multiprocessing.connection import Client
fro... | gpl-3.0 |
houst0nn/external_skia | tools/reformat-json.py | 208 | 1741 | #!/usr/bin/python
'''
Copyright 2013 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
'''
Rewrites a JSON file to use Python's standard JSON pretty-print format,
so that subsequent runs of rebaseline.py will generate useful diffs
(only the actual check... | bsd-3-clause |
waltBB/neutron_read | neutron/agent/l3/namespaces.py | 6 | 3002 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 |
hickford/cython | tests/run/pyclass_scope_T671.py | 28 | 1624 | # mode: run
# ticket: 671
A = 1234
class SimpleAssignment(object):
"""
>>> SimpleAssignment.A
1234
"""
A = A
class SimpleRewrite(object):
"""
>>> SimpleRewrite.A
4321
"""
A = 4321
A = A
def simple_inner(a):
"""
>>> simple_inner(4321).A
1234
"""
A = a
... | apache-2.0 |
aparo/django-nonrel | django/contrib/gis/tests/distapp/models.py | 406 | 1832 | from django.contrib.gis.db import models
class SouthTexasCity(models.Model):
"City model on projected coordinate system for South Texas."
name = models.CharField(max_length=30)
point = models.PointField(srid=32140)
objects = models.GeoManager()
def __unicode__(self): return self.name
class SouthTe... | bsd-3-clause |
alfa-addon/addon | plugin.video.alfa/lib/python_libtorrent/python_libtorrent/functions.py | 1 | 10908 | #-*- coding: utf-8 -*-
'''
python-libtorrent for Kodi (script.module.libtorrent)
Copyright (C) 2015-2016 DiMartino, srg70, RussakHH, aisman
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 t... | gpl-3.0 |
Sorsly/subtle | google-cloud-sdk/lib/surface/compute/instances/suspend.py | 3 | 2970 | # 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 ag... | mit |
h4ck3rm1k3/ansible | v2/ansible/parsing/mod_args.py | 1 | 10144 | # (c) 2014 Michael DeHaan, <michael@ansible.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 later ve... | gpl-3.0 |
konstruktoid/ansible-upstream | lib/ansible/modules/messaging/rabbitmq_queue.py | 23 | 9734 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Manuel Sousa <manuel.sousa@gmail.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 |
sgraham/nope | tools/telemetry/telemetry/value/__init__.py | 1 | 12490 | # 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.
"""
The Value hierarchy provides a way of representing the values measurements
produce such that they can be merged across runs, grouped by page, and output
t... | bsd-3-clause |
mfisher31/libjuce | waflib/Tools/gxx.py | 56 | 4064 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2018 (ita)
# Ralf Habacker, 2006 (rh)
# Yinon Ehrlich, 2009
"""
g++/llvm detection.
"""
from waflib.Tools import ccroot, ar
from waflib.Configure import conf
@conf
def find_gxx(conf):
"""
Finds the program g++, and if present, try to detect its version nu... | gpl-2.0 |
QLGu/Django-facebook | docs/docs_env/Lib/encodings/cp1255.py | 593 | 12722 | """ Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | bsd-3-clause |
nunogt/tempest | tempest/api/compute/floating_ips/test_floating_ips_actions.py | 9 | 5803 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
loadimpact/loadimpact-server-metrics | li_metrics_agent_service.py | 1 | 2556 | #!/usr/bin/env python
# coding=utf-8
"""
Copyright 2012 Load Impact
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 la... | apache-2.0 |
alexliyu/CDMSYSTEM | firewall.py | 1 | 1273 | #!/usr/bin/python
# -*- coding:utf-8 -*-
"""
主程序入口
@author:alex
@date:15-2-13
@time:上午11:44
@contact:alexliyu2012@gmail.com
"""
__author__ = 'alex'
import sys
import os
import ConfigParser
import uuid
from subprocess import Popen, PIPE
from utils.heartbeat import HeartBeatManager
from utils.tools import *
... | mit |
Grirrane/odoo | addons/account_payment/account_payment.py | 4 | 19120 | # -*- 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 |
RadonX-ROM/external_skia | platform_tools/android/gyp_gen/gypd_parser.py | 144 | 5764 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Functions for parsing the gypd output from gyp.
"""
import os
def parse_dictionary(var_dict, d, current_target_name, dest_dir):
"""Helper function to get the ... | bsd-3-clause |
hrishioa/Navo | Raspi-Code/Lib/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py | 484 | 10037 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning
SSLContext = None
HAS_SNI = False
create_default_context = None
import errno
import warnings
try: # Test for SSL features
import ssl
from ssl import wrap_socket, CERT_NO... | gpl-2.0 |
jadecastro/LTLMoP | src/lib/handlers/motionControl/RRTController.py | 1 | 37133 | #!/usr/bin/env python
"""
===================================================================
RRTController.py - Rapidly-Exploring Random Trees Motion Controller
===================================================================
Uses Rapidly-exploring Random Tree Algorithm to generate paths given the starting p... | gpl-3.0 |
pechatny/basic-flask-app | src/app/flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
yinquan529/platform-external-chromium_org | chrome/test/pyautolib/plugins_info.py | 69 | 3510 | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Python representation for Chromium Plugins info.
This is the info available at about:plugins.
Obtain one of these from PyUITestSuite::GetPluginsInfo(... | bsd-3-clause |
vmamidi/trafficserver | tests/gold_tests/cont_schedule/thread_affinity.test.py | 6 | 1791 | '''
'''
# 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");... | apache-2.0 |
gauribhoite/personfinder | tools/setup_pf.py | 4 | 8995 | # Copyright 2009-2010 by Ka-Ping Yee
#
# 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 w... | apache-2.0 |
MartinEnder/erpnext-de | erpnext/selling/doctype/product_bundle/product_bundle.py | 25 | 1166 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class ProductBundle(Document):
def autoname(self):
self.name = self.... | agpl-3.0 |
Shrhawk/edx-platform | lms/startup.py | 14 | 4770 | """
Module for code that should run during LMS startup
"""
# pylint: disable=unused-argument
from django.conf import settings
# Force settings to run so that the python path is modified
settings.INSTALLED_APPS # pylint: disable=pointless-statement
from openedx.core.lib.django_startup import autostartup
import edxm... | agpl-3.0 |
conda/kapsel | examples/quote_api/quote.py | 1 | 4575 | from argparse import ArgumentParser
import falcon
import gunicorn.app.base
import json
import multiprocessing
import sys
# A Falcon resource that returns the same quote every time
class QuoteResource(object):
def on_get(self, req, resp):
"""Handles GET requests"""
quote = {'quote': 'I\'ve always b... | bsd-3-clause |
ychen820/microblog | y/google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/boto/kinesis/layer1.py | 10 | 33127 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | bsd-3-clause |
Vishluck/sympy | sympy/physics/quantum/tests/test_represent.py | 124 | 5124 | from sympy import Float, I, Integer, Matrix
from sympy.external import import_module
from sympy.utilities.pytest import skip
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.represent import (represent, rep_innerproduct,
rep_expectation, enumerate_... | bsd-3-clause |
tqnghiep/sp | simplesaml/vendor/openid/php-openid/admin/packagexml.py | 56 | 4603 | #!/usr/bin/python
import os
import os.path
def makeMaintainerXML(leads):
maintainer_template = """
<maintainer>
<user>%(user)s</user>
<name>%(name)s</name>
<email>%(email)s</email>
<role>lead</role>
</maintainer>
"""
return "<maintainers>" + \
"".join([maintainer_template % l for... | gpl-2.0 |
parpg/parpg | tools/utilities/convert_dialogue.py | 1 | 3506 | #!/usr/bin/env python
"""Convert YAML dialogue files from the Techdemo1 format to the new Techdemo2
format.
@author: M. George Hansen <technopolitica@gmail.com>
"""
import os.path
import sys
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__),
os.... | gpl-3.0 |
hoaibang07/Webscrap | transcripture/sources/crawler_chuongthieu.py | 1 | 7017 | # -*- encoding: utf-8 -*-
import io
from bs4 import BeautifulSoup
from bs4 import SoupStrainer
import urllib2
import urlparse
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expecte... | gpl-2.0 |
edumatos/namebench | nb_third_party/dns/rdtypes/ANY/X25.py | 248 | 2123 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
apocalypsebg/odoo | openerp/addons/test_exceptions/models.py | 336 | 3186 | # -*- coding: utf-8 -*-
import openerp.exceptions
import openerp.osv.orm
import openerp.osv.osv
import openerp.tools.safe_eval
class m(openerp.osv.osv.Model):
""" This model exposes a few methods that will raise the different
exceptions that must be handled by the server (and its RPC layer)
and the... | agpl-3.0 |
andrewpaulreeves/soapy | soapy/wfs/wfs.py | 2 | 20129 | #Copyright Durham University and Andrew Reeves
#2014
# This file is part of soapy.
# soapy 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 optio... | gpl-3.0 |
choderalab/pymbar | setup.py | 2 | 5204 | """
The pymbar package contains the pymbar suite of tools for the analysis of
simulated and experimental data with the multistate Bennett acceptance
ratio (MBAR) estimator.
"""
from distutils.core import setup
from setuptools import setup, Extension
import numpy
import os
import subprocess
import six
################... | mit |
akatsoulas/mozillians | mozillians/phonebook/validators.py | 2 | 3254 | import re
from django.apps import apps
from django.core.validators import EmailValidator, URLValidator
from django.forms import ValidationError
from django.utils.translation import ugettext as _
def validate_twitter(username):
"""Return a twitter username given '@' or http(s) strings."""
if username:
... | bsd-3-clause |
tonnrueter/pymca_devel | PyMca/EPDL97/GenerateEADLShellNonradiativeRates.py | 1 | 6235 | __doc__= "Generate specfiles with EADL97 shell transition probabilities"
import os
import sys
import EADLParser
Elements = ['H', 'He',
'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne',
'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar',
'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe',
... | gpl-2.0 |
cloudbase/nova-virtualbox | nova/tests/unit/virt/hyperv/test_basevolumeutils.py | 67 | 7839 | # Copyright 2014 Cloudbase Solutions Srl
#
# 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... | apache-2.0 |
mangaki/mangaki | mangaki/mangaki/factories.py | 1 | 1591 | import factory
from factory.django import DjangoModelFactory, mute_signals
from .models import Profile, Work, Category
from django.contrib.auth.models import User
from django.db.models.signals import post_save
class ProfileFactory(DjangoModelFactory):
class Meta:
model = Profile
user = factory.SubFac... | agpl-3.0 |
Vixionar/django | tests/expressions/tests.py | 171 | 36421 | from __future__ import unicode_literals
import datetime
import uuid
from copy import deepcopy
from django.core.exceptions import FieldError
from django.db import DatabaseError, connection, models, transaction
from django.db.models import TimeField, UUIDField
from django.db.models.aggregates import (
Avg, Count, M... | bsd-3-clause |
Azure/azure-sdk-for-python | sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_jobs_operations.py | 1 | 4882 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
lanbing510/GTDWeb | django/contrib/gis/geos/point.py | 103 | 4401 | from ctypes import c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.utils import six
from django.utils.six.moves import range
class Point(GEOSGeometry):
_minlength = 2
_m... | gpl-2.0 |
Reepca/YAHRP | deps/collada/scene.py | 2 | 36365 | ####################################################################
# #
# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INC... | gpl-3.0 |
romain-li/edx-platform | lms/djangoapps/courseware/tests/test_video_xml.py | 17 | 3114 | # -*- coding: utf-8 -*-
# pylint: disable=protected-access
"""Test for Video Xmodule functional logic.
These test data read from xml, not from mongo.
We have a ModuleStoreTestCase class defined in
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py.
You can search for usages of this in the cms and lms tests ... | agpl-3.0 |
j91321/rext | modules/exploits/allegrosoft/misfortune_auth_bypass.py | 1 | 22767 | # Name:Misfortune Cookie vulnerability authentication bypass
# File:misfortune_auth_bypass.py
# Author:Ján Trenčanský
# License: GNU GPL v3
# Created: 22.9.2016
# Description: PoC based on 31C3 presentation,
# exploit based on Marcin Bury and Milad Doorbash routersploit module.
import core.Exploit
import interface.uti... | gpl-3.0 |
willthames/ansible | test/units/modules/network/nxos/test_nxos_vlan.py | 47 | 3851 | # (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 dis... | gpl-3.0 |
sahiljain/catapult | telemetry/telemetry/timeline/tab_id_importer_unittest.py | 6 | 2948 | # 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 unittest
from telemetry.timeline import model as timeline_model
from telemetry.timeline import tab_id_importer
from tracing.trace_data import trace_d... | bsd-3-clause |
sparkslabs/kamaelia | Sketches/RJL/Util/PureTransformer.py | 3 | 2018 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | apache-2.0 |
Ebag333/Pyfa | eos/db/gamedata/effect.py | 1 | 2320 | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos 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, ... | gpl-3.0 |
mhue/scikit-learn | benchmarks/bench_mnist.py | 154 | 6006 | """
=======================
MNIST dataset benchmark
=======================
Benchmark on the MNIST dataset. The dataset comprises 70,000 samples
and 784 features. Here, we consider the task of predicting
10 classes - digits from 0 to 9 from their raw images. By contrast to the
covertype dataset, the feature space is... | bsd-3-clause |
sdopoku/flask-hello-world | venv/lib/python2.7/site-packages/flask/globals.py | 783 | 1137 | # -*- coding: utf-8 -*-
"""
flask.globals
~~~~~~~~~~~~~
Defines all the global objects that are proxies to the current
active context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import partial
from werkzeug.local import LocalStack, ... | gpl-2.0 |
40023247/2015cd_0505 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/_test_warnings.py | 858 | 2304 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... | agpl-3.0 |
dwayne-randle-sr/various-snippets | centos/6/usr/local/bin/ps_mem.py | 1 | 17569 | #!/usr/bin/env python
# Try to determine how much RAM is currently being used per program.
# Note per _program_, not per process. So for example this script
# will report RAM used by all httpd process together. In detail it reports:
# sum(private RAM for program processes) + sum(Shared RAM for program processes)
# The... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/testbase/azure-mgmt-testbase/azure/mgmt/testbase/aio/operations/_test_summaries_operations.py | 1 | 9021 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
ArdaFu/rt-thread | bsp/stm32/stm32l476-st-nucleo/rtconfig.py | 7 | 4069 | import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.