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 |
|---|---|---|---|---|---|
Jackeriss/Companions | shell/demos/servers/column_provider.py | 37 | 3886 | # A sample shell column provider
# Mainly ported from MSDN article:
# Using Shell Column Handlers for Detailed File Information,
# Raymond Chen, Microsoft Corporation, February 2000
#
# To demostrate:
# * Execute this script to register the namespace.
# * Open Windows Explorer
# * Right-click an explorer column head... | mit |
WillChilds-Klein/mistress-mapreduce | build/lib.linux-x86_64-2.7/mrs/master.py | 4 | 34507 | # Mrs
# Copyright 2008-2012 Brigham Young 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
#
# Unless required by applicable law o... | apache-2.0 |
ropik/androguard | demos/androguard_ANALYSIS.py | 22 | 3607 | #!/usr/bin/env python
import sys, hashlib
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "./")
from androguard.core.androgen import AndroguardS
from androguard.core.analysis import analysis
OUTPUT = "./output/"
#TEST = 'examples/java/test/orig/Test1.class'
#TEST = 'examples/java/Demo1/orig/DES.class'
#TEST = ... | apache-2.0 |
daxxi13/CouchPotatoServer | libs/tmdb3/tmdb_api.py | 17 | 32680 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: tmdb_api.py Simple-to-use Python interface to TMDB's API v3
# Python Library
# Author: Raymond Wagner
# Purpose: This Python library is intended to provide a series of classes
# and methods for search and retrieval of text metada... | gpl-3.0 |
nwjs/chromium.src | tools/perf/cli_tools/soundwave/worker_pool.py | 10 | 2508 | # Copyright 2018 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.
"""
Use a pool of workers to concurrently process a sequence of items.
Example usage:
from soundwave import worker_pool
def MyWorker(args):
... | bsd-3-clause |
zorojean/zulip | api/setup.py | 97 | 2426 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import itertools
def version():
version_py = os.path.join(os.path.dirname(__file__), "zulip", "__init__.py")
with open(version_py) as in_handle:
version_line = itertools.dropwhile(lambda x: not x.startswith("__version__"),
... | apache-2.0 |
sunsong/obfsproxy | obfsproxy/test/test_aes.py | 18 | 3375 | import unittest
from Crypto.Cipher import AES
from Crypto.Util import Counter
import obfsproxy.common.aes as aes
import twisted.trial.unittest
class testAES_CTR_128_NIST(twisted.trial.unittest.TestCase):
def _helper_test_vector(self, input_block, output_block, plaintext, ciphertext):
self.assertEqual(lon... | bsd-3-clause |
projectcalico/calico-neutron | neutron/plugins/cisco/cfg_agent/device_drivers/csr1kv/csr1kv_routing_driver.py | 8 | 29729 | # Copyright 2014 Cisco Systems, 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 requir... | apache-2.0 |
mgagne/nova | nova/tests/unit/api/openstack/compute/contrib/test_quota_classes.py | 1 | 6260 | # 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 |
MarkTseng/django-farmersale | farmersale-env/lib/python2.7/site-packages/django/contrib/flatpages/tests/test_csrf.py | 56 | 3486 | import os
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase, Client
from django.test import override_settings
@override_settings(
LOGIN_URL='/accounts/login/',
MIDDLEWARE_CLASSES=(
'django.middleware.common.CommonM... | mit |
lostdj/Jaklin-OpenJFX | modules/web/src/main/native/Tools/QueueStatusServer/handlers/updatebase.py | 143 | 1902 | # Copyright (C) 2010 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... | gpl-2.0 |
szrlee/AIPS | RouteApp.py | 1 | 1995 | #!/usr/bin python2
# -*- coding: UTF-8 -*- #
"""def get_tree_graph():
#return graph
pass
According to POX wiki ,method spanning_tree returns it as dictionary like
{s1:([(s2,port1),(s3,port2),...]),s2:([(s1,port),...]),...}
#port refers to the port of s1 which connects to s2
A graph example for path searc... | apache-2.0 |
Crystalnix/house-of-life-chromium | third_party/psutil/test/test_memory_leaks.py | 3 | 4750 | #!/usr/bin/env python
#
# $Id: test_memory_leaks.py 777 2010-11-08 18:29:13Z g.rodola $
#
"""
Note: this is targeted for python 2.x.
To run it under python 3.x you need to use 2to3 tool first:
$ 2to3 -w test/test_memory_leaks.py
"""
import os
import gc
import sys
import unittest
import psutil
from test_psutil impo... | bsd-3-clause |
ingmar-k/Buffalo-Linkstation-Kirkwood-Kernel | scripts/analyze_suspend.py | 445 | 49020 | #!/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 |
nobooya/e975-kk-kernel | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
fintech-circle/edx-platform | common/test/acceptance/pages/lms/discussion.py | 11 | 28988 | from contextlib import contextmanager
from bok_choy.javascript import wait_for_js
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from common.test.acceptance.pages.common.utils import hover
from common.test.acceptance.pages.lms.course_page import CoursePage
from common.test.accep... | agpl-3.0 |
sdeepanshu02/microblog | flask/Lib/site-packages/markupsafe/_native.py | 1243 | 1187 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... | bsd-3-clause |
cloudbase/nova | nova/tests/functional/notification_sample_tests/test_service_update.py | 14 | 2786 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
bpgc-cte/python2017 | Week 7/django/lib/python3.6/site-packages/django/db/migrations/operations/base.py | 127 | 4888 | from __future__ import unicode_literals
from django.db import router
class Operation(object):
"""
Base class for migration operations.
It's responsible for both mutating the in-memory model state
(see db/migrations/state.py) to represent what it performs, as well
as actually performing it agains... | mit |
valdur55/py3status | py3status/modules/keyboard_locks.py | 1 | 2349 | r"""
Display NumLock, CapsLock, and ScrLock keys.
Configuration parameters:
cache_timeout: refresh interval for this module (default 1)
format: display format for this module
*(default '[\?if=num_lock&color=good NUM|\?color=bad NUM] '
'[\?if=caps_lock&color=good CAPS|\?color=bad CAPS] '
... | bsd-3-clause |
linglung/ytdl | youtube_dl/extractor/hellporno.py | 53 | 2411 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
js_to_json,
remove_end,
determine_ext,
)
class HellPornoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hellporno\.(?:com/videos|net/v)/(?P<id>[^/]+)'
_TESTS = [{
'url': 'http:/... | unlicense |
LLNL/spack | var/spack/repos/builtin/packages/py-sympy/package.py | 5 | 1048 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PySympy(PythonPackage):
"""SymPy is a Python library for symbolic mathematics."""
home... | lgpl-2.1 |
spallavolu/scikit-learn | sklearn/utils/sparsetools/_graph_validation.py | 364 | 2407 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.sparse import csr_matrix, isspmatrix, isspmatrix_csc
from ._graph_tools import csgraph_to_dense, csgraph_from_dense,\
csgraph_masked_from_dense, csgraph_from_masked
DTYPE = np.float64
def validate_graph(csgraph, direc... | bsd-3-clause |
google-code-export/exposong | lib/exposong/plugins/pres.py | 3 | 50403 | #
# vim: ts=4 sw=4 expandtab ai:
#
# Copyright (C) 2008-2011 Exposong.org
#
# ExpoSong is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# at your option) any later version.
#... | gpl-3.0 |
jgraham/treeherder | tests/client/test_treeherder_client.py | 4 | 18084 | from __future__ import unicode_literals
import json
import os
import unittest
import requests
from mock import patch
from treeherder.client import (TreeherderArtifact,
TreeherderArtifactCollection, TreeherderAuth,
TreeherderClient, TreeherderClientError,
... | mpl-2.0 |
susansalkeld/discsongs | discsongs/lib/python2.7/site-packages/sqlalchemy/inspection.py | 33 | 3093 | # sqlalchemy/inspect.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The inspection module provides the :func:`.inspect` function,
which deliver... | mit |
MaxIV-KitsControls/netspot | netspot/ts_lib.py | 1 | 5698 | #!/usr/bin/python -tt
"""Junos Interface Troubleshooting library."""
import re
import warnings
import helpers
from napalm import get_network_driver
from jnpr.junos.exception import ConnectRefusedError, ConnectAuthError
# JUNOS MAC table RE
RE_VLAN = r'\s+([\w\d-]+)\s+'
RE_MAC = r'\s?([*\w\d:]+)\s+'
RE_TYPE = r'\s?(... | mit |
scto/android_kernel_jide_sk1wg | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
jcpowermac/ansible | test/units/modules/network/f5/test_bigip_vcmp_guest.py | 11 | 5697 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks 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
import os
import json
import pytest
import sys
from nose.plugins.skip imp... | gpl-3.0 |
mach0/QGIS | python/core/additions/validitycheck.py | 51 | 3120 | # -*- coding: utf-8 -*-
"""
***************************************************************************
validitycheck.py
---------------------
Date : January 2019
Copyright : (C) 2019 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
***************... | gpl-2.0 |
ndaniels/Ammolite | scripts/figure-generators/smsdIsoCompare.py | 1 | 1534 | import matplotlib.pyplot as plt
from pylab import polyfit, poly1d, show, savefig
import sys
def isNumber( s):
try:
float(s)
return True
except ValueError:
return False
def makeGraph(X,Y, xName, yName, name="NoName"):
fig = plt.figure()
ax = fig.add_subplot(111)
superName = "Comparison of {} and {}".format(... | gpl-2.0 |
bhmm/bhmm | devtools/travis-ci/push-docs-to-s3.py | 9 | 1410 | #!/usr/bin/env python
"""
Must have the vollowing environment variables defined:
* BUCKET_NAME : AWS bucket name
* PREFIX : 'latest' or other version number
"""
import os
import pip
import tempfile
import subprocess
import thermopyl.version
BUCKET_NAME = 'thermopyl.org'
if not thermopyl.version.release:
PREFIX... | lgpl-3.0 |
anryko/ansible | lib/ansible/modules/network/netvisor/pn_switch_setup.py | 49 | 13294 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['... | gpl-3.0 |
HydrelioxGitHub/home-assistant | homeassistant/components/homematicip_cloud/light.py | 2 | 8342 | """Support for HomematicIP Cloud lights."""
import logging
from homeassistant.components.homematicip_cloud import (
DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice)
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_COLOR_NAME, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,... | apache-2.0 |
erilyth/sugar | src/jarabe/frame/clipboardmenu.py | 10 | 8775 | # Copyright (C) 2007, One Laptop Per Child
#
# 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.
#
# This program is distrib... | gpl-2.0 |
waterponey/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 159 | 7852 | import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metrics import Dista... | bsd-3-clause |
cmorgan/pybrain | pybrain/tools/customxml/networkreader.py | 25 | 3676 | from __future__ import print_function
__author__ = 'Tom Schaul, tom@idsia.ch'
from .handling import XMLHandling
# those imports are necessary for the eval() commands to find the right classes
import pybrain #@UnusedImport
from scipy import array #@UnusedImport
try:
import arac.pybrainbridge #@UnusedImport
exc... | bsd-3-clause |
jacshfr/mozilla-bedrock | bedrock/settings/newsletters.py | 12 | 2196 | # If basket isn't responding, use this dictionary of our main newsletters as our
# newsletter list until basket starts working again.
# It would be a good idea to update this now and then from the data in basket.
DEFAULT_NEWSLETTERS = {
u'about-mozilla': {
u'active': True,
u'confirm_message': u'',
... | mpl-2.0 |
mcanthony/rethinkdb | test/rql_test/connections/http_support/werkzeug/testsuite/compat.py | 146 | 1117 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.compat
~~~~~~~~~~~~~~~~~~~~~~~~~
Ensure that old stuff does not break on update.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import warnings
from werkzeug.testsuite import WerkzeugTestCase
... | agpl-3.0 |
Frencil/box-python-sdk | test/unit/object/test_events.py | 1 | 8316 | # coding: utf-8
from __future__ import unicode_literals
from itertools import chain
import json
from mock import Mock
import pytest
from requests.exceptions import Timeout
from six.moves import map # pylint:disable=redefined-builtin
from six.moves.urllib.parse import urlencode, urlunsplit # pylint:disable=import-... | apache-2.0 |
alexisVallet/anime-bgrm | objectSegmentation.py | 1 | 3095 | import disjointSetForest as dsj
import cv2
import numpy as np
def toRowMajor(cols, i, j):
return i * cols + j
def fromRowMajor(cols, idx):
return (idx / cols, idx % cols)
class ObjectsSegmentation:
""" Disjoint set forest, with the additional semantic element of an image to segment
into backgroun... | gpl-2.0 |
tashaxe/Red-DiscordBot | lib/youtube_dl/extractor/firstpost.py | 60 | 1787 | from __future__ import unicode_literals
from .common import InfoExtractor
class FirstpostIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?firstpost\.com/[^/]+/.*-(?P<id>[0-9]+)\.html'
_TEST = {
'url': 'http://www.firstpost.com/india/india-to-launch-indigenous-aircraft-carrier-monday-1025403.html... | gpl-3.0 |
jian929/stagefright | vp9/omx-components/videocodec/libvpx_internal/libvpx/tools/all_builds.py | 94 | 2053 | #!/usr/bin/python
import getopt
import subprocess
import sys
LONG_OPTIONS = ["shard=", "shards="]
BASE_COMMAND = "./configure --enable-internal-stats --enable-experimental"
def RunCommand(command):
run = subprocess.Popen(command, shell=True)
output = run.communicate()
if run.returncode:
print "Non-zero ret... | gpl-2.0 |
hguemar/cinder | cinder/utils.py | 1 | 26017 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
mhostetter/gnuradio | gr-analog/python/analog/qa_simple_squelch.py | 47 | 1937 | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | gpl-3.0 |
rjsproxy/wagtail | wagtail/wagtailsnippets/permissions.py | 16 | 1091 | from django.contrib.auth import get_permission_codename
from django.contrib.contenttypes.models import ContentType
from wagtail.wagtailsnippets.models import get_snippet_models
def get_permission_name(action, model):
return "%s.%s" % (model._meta.app_label, get_permission_codename(action, model._meta))
def use... | bsd-3-clause |
crypto101/arthur | arthur/test/test_util.py | 1 | 4581 | from arthur.util import MultiDeferred
from twisted.internet import defer
from twisted.trial import unittest
class MultiDeferredTests(unittest.SynchronousTestCase):
"""
Tests for L{defer.MultiDeferred}, except now in Arthur.
See tm.tl/6365.
"""
def setUp(self):
self.multiDeferred = MultiDe... | isc |
OffenesJena/JenLoRa | LoPy/LoAirRohr01/lib/DHT22RinusW.py | 1 | 2355 | from machine import enable_irq, disable_irq
import time
# this onewire protocol code tested with Pycom LoPy device and AM2302/DHT22 sensor
def getval(pin):
ms = [1]*700 # needs long sample size to grab all the bits from the DHT
time.sleep(1)
pin(0)
time.sleep_us(10000)
pin(1)
irqf = dis... | apache-2.0 |
joariasl/odoo | addons/l10n_de/__init__.py | 693 | 1057 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
awkspace/ansible | lib/ansible/modules/network/f5/bigip_monitor_tcp.py | 14 | 20510 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
theheros/kbengine | kbe/res/scripts/common/Lib/encodings/koi8_r.py | 37 | 14086 | """ Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.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... | lgpl-3.0 |
Ilias95/lib389 | lib389/tests/dseldif_test.py | 1 | 4107 | # --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2017 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
#
import logging
import pytest
from lib389._constants import *
from lib389.dseldif import DSEldif
from lib389.topologies ... | gpl-3.0 |
CubicERP/geraldo | site/newsite/django_1_0/tests/regressiontests/serializers_regress/models.py | 11 | 7213 | """
A test spanning all the capabilities of all the serializers.
This class sets up a model for each model field type
(except for image types, because of the PIL dependency).
"""
from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
# ... | lgpl-3.0 |
DanielSBrown/osf.io | api_tests/logs/views/test_log_params.py | 12 | 2793 | # -*- coding: utf-8 -*-
import httplib as http
from framework.auth.core import Auth
from nose.tools import * # noqa
from test_log_detail import LogsTestCase
from tests.factories import (
ProjectFactory,
PrivateLinkFactory
)
from api.base.settings.defaults import API_BASE
# TODO add tests for other log para... | apache-2.0 |
usersource/tasks | tasks_phonegap/Tasks/plugins/io.usersource.anno/tools/copytool2/oauth2client/django_orm.py | 261 | 3833 | # Copyright (C) 2010 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 required by applicable law or agreed to in writ... | mpl-2.0 |
darbaga/simple_compiler | virtual_machine.py | 1 | 2139 | class VirtualMachine:
def __init__(self, ram_size=512, executing=True):
self.data = {i: None for i in range(ram_size)}
self.stack = []
self.executing = executing
self.pc = 0
self.devices_start = 256
def push(self, value):
"""Push something onto the stack."""
... | bsd-3-clause |
naresh21/synergetics-edx-platform | common/djangoapps/student/management/tests/test_manage_user.py | 20 | 8115 | """
Unit tests for user_management management commands.
"""
import itertools
import ddt
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import Group, User
from django.core.management import call_command, CommandError
from django.test import TestCase
TEST_EMAIL = 'test@example.com... | agpl-3.0 |
jdugge/QGIS | python/plugins/processing/algs/grass7/ext/r_rgb.py | 25 | 2518 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_rgb.py
--------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
******************************************... | gpl-2.0 |
gladgod/zhiliao | zhiliao/twitter/defaults.py | 1 | 2296 | """
Default settings for the ``mezzanine.twitter`` app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
... | bsd-3-clause |
nmmmnu/MessageQueue | protocols/memcachedhandler.py | 1 | 4321 | #
# Memcached protocol implementation
# Nikolay Mihaylov nmmm@nmmm.nu
#
# For Memcached telnet protocol see:
# http://blog.elijaa.org/?post/2010/05/21/Memcached-telnet-command-summary
import asynchat
import time
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class Memca... | gpl-3.0 |
RPGOne/Skynet | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/sklearn/neighbors/tests/test_dist_metrics.py | 48 | 4949 | import itertools
import numpy as np
from numpy.testing import assert_array_almost_equal
import scipy
from scipy.spatial.distance import cdist
from sklearn.neighbors.dist_metrics import DistanceMetric
from nose import SkipTest
def cmp_version(version1, version2):
version1 = tuple(map(int, version1.split('.')[:2]... | bsd-3-clause |
lucashmorais/x-Bench | mozmill-env/linux/python-lib/mercurial/httpconnection.py | 91 | 10916 | # httpconnection.py - urllib2 handler for new http support
#
# Copyright 2005, 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
# Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br>
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
# Copyright 2011 Google, Inc.
#
# This software may be used and distribu... | mit |
OpenNewsLabs/pybossa | test/test_repository/test_user_repository.py | 6 | 8682 | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | agpl-3.0 |
zengenti/ansible | lib/ansible/parsing/utils/jsonify.py | 109 | 1292 | # (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 |
nuuuboo/odoo | addons/association/__init__.py | 886 | 1054 | # -*- 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... | agpl-3.0 |
kynikos/wiki-scripts | tests/local_mediawiki/client/test_connection.py | 2 | 1986 | #! /usr/bin/env python3
import pytest
import ws.client.connection
from ws.client.connection import APIWrongAction, APIError, APIExpandResultFailed
class test_connection:
"""
Tests :py:class:`ws.client.connection` methods on :py:obj:`api` fixture.
TODO:
- cookies
- set_argparser, from_arg... | gpl-3.0 |
erikr/django | django/contrib/postgres/utils.py | 60 | 1230 | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.utils.functional import SimpleLazyObject
from django.utils.text import format_lazy
def prefix_validation_error(error, prefix, code, params):
"""
Prefix a validation error message while maintaining the exist... | bsd-3-clause |
lupyuen/RaspberryPiImage | home/pi/GrovePi/Software/Python/others/temboo/Library/SendGrid/NewsletterAPI/Newsletter/ListAllNewsletters.py | 5 | 3941 | # -*- coding: utf-8 -*-
###############################################################################
#
# ListAllNewsletters
# Get a list of all newsletters in this account.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may... | apache-2.0 |
huangweiqing80/u-boot-2014.04.tq210 | tools/patman/commit.py | 11 | 2164 | # Copyright (c) 2011 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
import re
# Separates a tag: at the beginning of the subject from the rest of it
re_subject_tag = re.compile('([^:\s]*):\s*(.*)')
class Commit:
"""Holds information about a single commit/patch in the series.
Args:
... | gpl-3.0 |
vianuevm/Webparser | ENV/Lib/site-packages/pip/_vendor/html5lib/constants.py | 963 | 87346 | from __future__ import absolute_import, division, unicode_literals
import string
import gettext
_ = gettext.gettext
EOF = None
E = {
"null-character":
_("Null character in input stream, replaced with U+FFFD."),
"invalid-codepoint":
_("Invalid codepoint in stream."),
"incorrectly-placed-so... | gpl-2.0 |
AICP/kernel_motorola_msm8992 | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
40223112/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/http/cookies.py | 735 | 20810 | #!/usr/bin/env python3
#
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in... | gpl-3.0 |
confpack/runtime | vendor/jinja2/_compat.py | 310 | 3109 | # -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... | apache-2.0 |
quickresolve/accel.ai | flask-aws/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/information_schema.py | 32 | 6418 | # mssql/information_schema.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
# TODO: should be using the sys. catalog with SQL Server, not informatio... | mit |
vabs22/zulip | zerver/webhooks/pagerduty/view.py | 5 | 5880 | # Webhooks for external integrations.
from __future__ import absolute_import
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
from zerver.models import Client, UserProfile
from django.http ... | apache-2.0 |
joonas-fi/sumatrapdf | scripts/buildbot-obsolete.py | 14 | 22374 | """
Builds sumatra and uploads results to s3 for easy analysis, viewable at:
http://kjkpub.s3.amazonaws.com/sumatrapdf/buildbot/index.html
"""
import sys
import os
# assumes is being run as ./scripts/buildbot.py
efi_scripts_dir = os.path.join("tools", "efi")
sys.path.append(efi_scripts_dir)
import shutil
im... | gpl-3.0 |
arameshkumar/nuxeo-drive | nuxeo-drive-client/nxdrive/client/common.py | 3 | 2976 | """Common utilities for local and remote clients."""
import re
import os
import stat
class BaseClient(object):
@staticmethod
def set_path_readonly(path):
current = os.stat(path).st_mode
if os.path.isdir(path):
# Need to add
right = (stat.S_IXUSR | stat.S_IRGRP | stat.S... | lgpl-2.1 |
edx/xblock-sdk | sample_xblocks/basic/content.py | 2 | 8847 | """Content-oriented XBlocks."""
from string import Template
from lxml import etree
from web_fragments.fragment import Fragment
from xblock.core import Scope, String, XBlock
class HelloWorldBlock(XBlock):
"""A simple block: just show some fixed content."""
def fallback_view(self, view_name, context=None):... | apache-2.0 |
mzueger/linux-colibri-imx6 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
Diapostrofo/instabot | instabot/bot/bot.py | 2 | 15988 | import datetime
import atexit
import signal
from ..api import API
from .bot_get import get_media_owner, get_your_medias, get_user_medias
from .bot_get import get_timeline_medias, get_hashtag_medias, get_user_info
from .bot_get import get_geotag_medias, get_timeline_users, get_hashtag_users
from .bot_get import get_me... | apache-2.0 |
sudheesh001/RFID-DBSync | venv/lib/python2.7/site-packages/werkzeug/testsuite/urls.py | 145 | 15382 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.urls
~~~~~~~~~~~~~~~~~~~~~~~
URL helper tests.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.datastructures import OrderedMultiD... | gpl-2.0 |
Zhongqilong/mykbengineer | kbe/src/lib/python/Lib/test/test_gzip.py | 75 | 20139 | """Test script for the gzip module.
"""
import unittest
from test import support
import os
import io
import struct
gzip = support.import_module('gzip')
data1 = b""" int length=DEFAULTALLOC, err = Z_OK;
PyObject *RetVal;
int flushmode = Z_FINISH;
unsigned long start_total_out;
"""
data2 = b"""/* zlibmodule.c ... | lgpl-3.0 |
zhukaixy/kbengine | kbe/res/scripts/common/Lib/lib2to3/fixes/fix_ws_comma.py | 204 | 1090 | """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... | lgpl-3.0 |
hydrospanner/DForurm | DForurm/env/Lib/site-packages/setuptools/command/alias.py | 455 | 2426 | from distutils.errors import DistutilsOptionError
from setuptools.extern.six.moves import map
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in '"', "'", "\\", "#":
if c in arg:
... | mit |
pandysong/dxf2kicad_mod | dxf2kicad_mod.py | 1 | 4880 | # refer to http://pythonhosted.org/dxfgrabber/#
# Note that there must not a line or shape overlapped
import sys
import math
import functools
from itertools import groupby
import dxfgrabber
import kicad_mod_format as kf
def _arc_point(center, radius, angle_degree):
'''
point defined by arc cen... | gpl-3.0 |
cidles/poio-api | src/poioapi/io/graf.py | 1 | 18028 | # -*- coding: utf-8 -*-
#
# Poio Tools for Linguists
#
# Copyright (C) 2009-2013 Poio Project
# Author: António Lopes <alopes@cidles.eu>
# URL: <http://media.cidles.eu/poio/>
# For license information, see LICENSE.TXT
""" This document contain the responsible
methods to write and parse the GrAF files.
The p... | apache-2.0 |
shashank971/edx-platform | cms/djangoapps/contentstore/features/video_handout.py | 116 | 1458 | # -*- coding: utf-8 -*-
# disable missing docstring
# pylint: disable=missing-docstring
from lettuce import world, step
from nose.tools import assert_true # pylint: disable=no-name-in-module
from video_editor import RequestHandlerWithSessionId, success_upload_file
@step('I (?:upload|replace) handout file(?: by)? "(... | agpl-3.0 |
bhanvadia/lge-kernel-p990 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
vilorious/pyload | module/plugins/crypter/Go4UpCom.py | 11 | 1969 | # -*- coding: utf-8 -*-
import re
import urlparse
from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
import json
class Go4UpCom(SimpleCrypter):
__name__ = "Go4UpCom"
__type__ = "crypter"
__version__ = "0.14"
__status__ = "testing"
__pattern__ = r'http://go4up... | gpl-3.0 |
treeio/treeio | treeio/messaging/tests.py | 3 | 12038 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Messaging: test suites
"""
from unittest import skip
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models i... | mit |
dpiers/coderang-meteor | public/jsrepl/extern/python/unclosured/lib/python2.7/email/mime/message.py | 573 | 1286 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Class representing message/* MIME documents."""
__all__ = ['MIMEMessage']
from email import message
from email.mime.nonmultipart import MIMENonMultipart
class MIMEMessage(MIMENonMultipart):
"""Class... | mit |
stevenaubertin/showsServer | lib/werkzeug/testsuite/multipart/collect.py | 248 | 1584 | #!/usr/bin/env python
"""
Hacky helper application to collect form data.
"""
from werkzeug.serving import run_simple
from werkzeug.wrappers import Request, Response
def copy_stream(request):
from os import mkdir
from time import time
folder = 'request-%d' % time()
mkdir(folder)
environ = request.e... | apache-2.0 |
mattclark/osf.io | api_tests/nodes/views/test_node_linked_nodes.py | 10 | 24248 | import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf_tests.factories import (
NodeFactory,
OSFGroupFactory,
AuthUserFactory,
NodeRelationFactory,
)
from osf.utils.permissions import WRITE, READ
from website.project.signals import contributor_remove... | apache-2.0 |
brain-research/mirage-rl-qprop | sandbox/rocky/tf/q_functions/continuous_mlp_q_function.py | 1 | 6100 | from sandbox.rocky.tf.q_functions.base import QFunction
import numpy as np
from rllab.core.serializable import Serializable
from sandbox.rocky.tf.core.layers_powered import LayersPowered
from sandbox.rocky.tf.core.layers import batch_norm
from sandbox.rocky.tf.policies.base import StochasticPolicy
from sandbox.rocky.t... | mit |
Pajinek/spacewalk | client/rhel/rhn-client-tools/test/testRhnChannel.py | 36 | 1826 | #!/usr/bin/python
import sys
import settestpath
from up2date_client import rhnChannel
# lots of useful util methods for building/tearing down
# test enviroments...
import testutils
import unittest
def write(blip):
sys.stdout.write("\n|%s|\n" % blip)
class testRhnChannel(unittest.TestCase):
def setUp(sel... | gpl-2.0 |
blockstack/blockstack-server | integration_tests/blockstack_integration_tests/scenarios/name_import_expire_pre_reg_expire_pay2ns_multi.py | 1 | 8928 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Blockstack
~~~~~
copyright: (c) 2014-2015 by Halfmoon Labs, Inc.
copyright: (c) 2016 by Blockstack.org
This file is part of Blockstack
Blockstack is free software: you can redistribute it and/or modify
it under the terms of the GNU General... | gpl-3.0 |
jetskijoe/SickGear | lib/feedparser/urls.py | 43 | 4592 | from __future__ import absolute_import, unicode_literals
import re
try:
import urllib.parse as urlparse
except ImportError:
import urlparse as urlparse
from .html import _BaseHTMLProcessor
# If you want feedparser to allow all URL schemes, set this to ()
# List culled from Python's urlparse documentation at... | gpl-3.0 |
diefenbach/django-cba | cba/layouts.py | 1 | 1576 | from . base import Component
class Grid(Component):
"""A CSS grid layout.
A grid consists arbitrary rows and 16 columns per row. see http://semantic-ui.com/collections/grid.html
for more.
"""
template = "cba/layouts/grid.html"
class Column(Component):
"""A column of a grid.
width
... | bsd-3-clause |
lmazuel/azure-sdk-for-python | azure-mgmt-reservations/azure/mgmt/reservations/models/catalog.py | 2 | 2286 | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------... | mit |
JioEducation/edx-platform | common/djangoapps/microsite_configuration/tests/factories.py | 19 | 2431 | """
Factories module to hold microsite factories
"""
import factory
from factory.django import DjangoModelFactory
from django.contrib.sites.models import Site
from microsite_configuration.models import (
Microsite,
MicrositeOrganizationMapping,
MicrositeTemplate,
)
class SiteFactory(DjangoModelFactory):... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.