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 |
|---|---|---|---|---|---|
hakatashi/youtube-dl | youtube_dl/extractor/blinkx.py | 12 | 3217 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
remove_start,
int_or_none,
)
class BlinkxIE(InfoExtractor):
_VALID_URL = r'(?:https?://(?:www\.)blinkx\.com/#?ce/|blinkx:)(?P<id>[^?]+)'
IE_NAME = 'blinkx'
_TEST = {
'url': 'http:... | unlicense |
cryptobanana/ansible | lib/ansible/modules/cloud/amazon/cloudtrail.py | 3 | 23696 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
dabiboo/youtube-dl | youtube_dl/extractor/xhamster.py | 24 | 6400 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate,
str_to_int,
int_or_none,
parse_duration,
)
class XHamsterIE(InfoExtractor):
_VALID_URL = r'(?P<proto>https?)://(?:.+?\.)?xhamster\.com/movies/(?P<id>[0-9]+)/(?P<seo>.+?)\.ht... | unlicense |
dnozay/lettuce | tests/integration/lib/Django-1.3/django/contrib/sites/tests.py | 153 | 2147 | from django.conf import settings
from django.contrib.sites.models import Site, RequestSite, get_current_site
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpRequest
from django.test import TestCase
class SitesFrameworkTests(TestCase):
def setUp(self):
Site(id=settings.SI... | gpl-3.0 |
andresguisado/andresguisado.github.io | node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/colorful.py | 364 | 2778 | # -*- coding: utf-8 -*-
"""
pygments.styles.colorful
~~~~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by CodeRay.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, ... | mit |
cedriclaunay/gaffer | python/GafferSceneTest/ShaderTest.py | 1 | 3822 | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | bsd-3-clause |
sixuanwang/SAMSaaS | wirecloud-develop/src/wirecloud/commons/utils/wgt.py | 2 | 5872 | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud 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 v... | gpl-2.0 |
chromium/chromium | tools/binary_size/libsupersize/ninja_parser.py | 8 | 5118 | #!/usr/bin/env python3
# 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.
"""Extract source file information from .ninja files."""
import argparse
import logging
import os
import re
import sys
# E.g.:
# bui... | bsd-3-clause |
chovanecm/sacredboard | sacredboard/tests/test_bootstrap.py | 1 | 2528 | # coding=utf-8
import pytest
import sacredboard.bootstrap as bootstrap
@pytest.fixture
def app():
return bootstrap.Flask(__name__)
@pytest.fixture()
def app_config():
return {
"http.serve_on_endpoint": "/",
"http.port": 5000,
"debug": False
}
@pytest.mark.parametrize("config_st... | mit |
zuntrax/schedule-ng | hacks.py | 2 | 1054 | from logging import Logger, getLogger
from typing import Callable
def noexcept(log: Logger = getLogger(__name__)):
"""
Grab all uncaught exceptions and log them with the logger
of the module implementing the decorated function.
:param log: logger of module using this.
:return: False
"""
de... | gpl-3.0 |
xi/ldif3 | setup.py | 1 | 1063 | #!/usr/bin/env python
import os
import re
from setuptools import setup
DIRNAME = os.path.abspath(os.path.dirname(__file__))
rel = lambda *parts: os.path.abspath(os.path.join(DIRNAME, *parts))
README = open(rel('README.rst')).read()
MAIN = open(rel('ldif3.py')).read()
VERSION = re.search("__version__ = '([^']+)'", MA... | bsd-2-clause |
heke123/chromium-crosswalk | tools/perf/page_sets/text_selection_sites.py | 25 | 6888 | # 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.
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
class SimplePage(page_module.Page):
... | bsd-3-clause |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_gdb.py | 8 | 36777 | # Verify that gdb can pretty-print the various PyObject* types
#
# The code for testing gdb was adapted from similar work in Unladen Swallow's
# Lib/test/test_jit_gdb.py
import os
import re
import pprint
import subprocess
import sys
import sysconfig
import unittest
import locale
# Is this Python configured to support... | gpl-2.0 |
HKUST-SING/tensorflow | tensorflow/python/debug/cli/readline_ui_test.py | 81 | 5646 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
EricMuller/mynotes-backend | requirements/twisted/Twisted-17.1.0/src/twisted/logger/test/test_logger.py | 13 | 6922 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.logger._logger}.
"""
from twisted.trial import unittest
from .._levels import InvalidLogLevelError
from .._levels import LogLevel
from .._format import formatEvent
from .._logger import Logger
from .._global import g... | mit |
Udzu/pudzu | dataviz/flagsaverage.py | 1 | 2847 | from pudzu.charts import *
from pudzu.sandbox.bamboo import *
flags = pd.read_csv("datasets/countries.csv")[lambda df: df.code != "EUU"].split_columns(('nationality', 'tld', 'country'), "|").explode('country').set_index('country').drop_duplicates(subset='flag', keep='first')
bg = "#EEEEEE"
def image_flag(c):
... | mit |
JianfengXu/crosswalk-test-suite | wrt/wrt-googleplay-android-tests/inst.apk.py | 1996 | 3186 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | bsd-3-clause |
rblalock/titanium_mobile | node_modules/ioslib/node_modules/node-ios-device/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | apache-2.0 |
coberger/DIRAC | AccountingSystem/Client/Types/SRMSpaceTokenDeployment.py | 9 | 1378 | # $HeadURL$
__RCSID__ = "$Id$"
from DIRAC.AccountingSystem.Client.Types.BaseAccountingType import BaseAccountingType
class SRMSpaceTokenDeployment( BaseAccountingType ):
def __init__( self ):
BaseAccountingType.__init__( self )
self.definitionKeyFields = [ ( 'Site' , "VARCHAR(64)" ),
... | gpl-3.0 |
yasoob/youtube-dl-GUI | youtube_dl/extractor/slutload.py | 23 | 2350 | from __future__ import unicode_literals
from .common import InfoExtractor
class SlutloadIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?slutload\.com/(?:video/[^/]+|embed_player|watch)/(?P<id>[^/]+)'
_TESTS = [{
'url': 'http://www.slutload.com/video/virginie-baisee-en-cam/TD73btpBqSxc/',
... | mit |
Alex-Ian-Hamilton/sunpy | examples/gallery/map_from_numpy_array.py | 1 | 1364 | # -*- coding: utf-8 -*-
"""
=========================================
Generating a Map From Data
=========================================
A simple demonstration of creating a map from a numpy array of data.
"""
##############################################################################
# Start by importing the ne... | bsd-2-clause |
faneshion/MatchZoo | matchzoo/contrib/layers/spatial_gru.py | 1 | 10175 | """An implementation of Spatial GRU Layer."""
import typing
import tensorflow as tf
from keras import backend as K
from keras.engine import Layer
from keras.layers import Permute
from keras.layers import Reshape
from keras import activations
from keras import initializers
class SpatialGRU(Layer):
"""
Spatial ... | apache-2.0 |
UnderGreen/ansible-modules-extras | notification/osx_say.py | 161 | 2108 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, 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 ... | gpl-3.0 |
mglukhikh/intellij-community | python/lib/Lib/encodings/cp737.py | 593 | 34937 | """ Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.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_map)
def decode(self,input,errors='strict... | apache-2.0 |
qvazzler/Flexget | flexget/plugins/modify/plugin_rutracker.py | 1 | 5223 | # coding=utf-8
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import json
import logging
from time import sleep
from datetime import datetime, timedelta
from sqlalchemy import Column, Unicode, Integer, DateTime
from sqlalch... | mit |
hbldh/bankkonto | bankkonto/account.py | 1 | 7719 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`account`
=======================
List of bank account number formats from `Bankgirot
<https://www.bankgirot.se/globalassets/dokument/anvandarmanualer/bankernaskontonummeruppbyggnad_anvandarmanual_sv.pdf>`_.
.. moduleauthor:: hbldh <henrik.blidh@swedwise.com>
Cre... | mit |
tximikel/kuma | kuma/core/tests/test_taggit_extras.py | 29 | 2546 | from django.test import TestCase
from .taggit_extras.models import Food
class NamespacedTaggableManagerTest(TestCase):
food_model = Food
def assert_tags_equal(self, qs, tags, sort=True, attr="name"):
got = map(lambda tag: getattr(tag, attr), qs)
if sort:
got.sort()
ta... | mpl-2.0 |
kiddinn/plaso | tests/parsers/sqlite.py | 3 | 5508 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the SQLite database parser."""
import unittest
from plaso.parsers import sqlite
# Register all plugins.
from plaso.parsers import sqlite_plugins # pylint: disable=unused-import
from tests.parsers import test_lib
class SQLiteDatabaseTest(test_lib.ParserTe... | apache-2.0 |
matthew-robertson/vore-tracker | tests/commands/test_removebancommand.py | 1 | 4391 | import unittest
from unittest.mock import patch, Mock
import discord
import datetime
from commands import RemoveBanCommand
from serverobjects.server import DiscordServer
class TestRemoveBanCommand(unittest.TestCase):
def setUp(self):
self.command = RemoveBanCommand()
def test_is_command_authorized__no_permission... | mit |
uclouvain/osis | osis_role/contrib/permissions.py | 1 | 4063 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
mrquim/mrquimrepo | script.module.youtube.dl/lib/youtube_dl/extractor/promptfile.py | 52 | 2425 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
urlencode_postdata,
)
class PromptFileIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?promptfile\.com/l/(?P<id>[0-9A-Z\-]+)'
_TEST = {
... | gpl-2.0 |
matthijsvk/multimodalSR | code/Experiments/neon-master/examples/nmt/train.py | 1 | 6439 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 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
#
# ... | mit |
anryko/ansible | lib/ansible/plugins/doc_fragments/netconf.py | 44 | 2657 | # -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r'''
options:
host:
description:
- Specifies the DNS host name or address for connecting t... | gpl-3.0 |
niftynei/zulip | contrib_bots/lib/help.py | 25 | 1148 | # See readme.md for instructions on running this code.
class HelpHandler(object):
def usage(self):
return '''
This plugin will give info about Zulip to
any user that types a message saying "help".
This is example code; ideally, you would flesh
this out for m... | apache-2.0 |
LinuxChristian/home-assistant | tests/conftest.py | 14 | 3245 | """Setup some common test helper things."""
import asyncio
import functools
import logging
import os
from unittest.mock import patch, MagicMock
import pytest
import requests_mock as _requests_mock
from homeassistant import util, setup
from homeassistant.util import location
from homeassistant.components import mqtt
... | apache-2.0 |
chuan9/chromium-crosswalk | third_party/typ/typ/runner.py | 25 | 31522 | # Copyright 2014 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... | bsd-3-clause |
wrenchzc/photomanager | photomanager/utils/imageutils.py | 1 | 5894 | import exifread
import os
import uuid
from PIL import Image
from photomanager.lib.pmconst import SUPPORT_EXTS, SKIP_LIST, PATH_SEP
from photomanager.lib.helper import get_file_md5, get_timestamp_from_str
from photomanager.utils.logger import logger
class ImageInfo:
def __init__(self, filename):
self.fil... | mit |
Affix/fas | fas/tgcaptcha2/plugins/image/vanasco_dowty/__init__.py | 1 | 1183 | import captcha
from turbogears import config
import random
import os.path
from pkg_resources import resource_filename
plugin_name = 'fas.tgcaptcha2.plugin.vanasco_dowty.'
width = int(config.get(plugin_name + 'width', 300))
height = int(config.get(plugin_name + 'height', 100))
bg_color = config.get(plugin_name + 'bg_c... | gpl-2.0 |
ahsanali/expense-tracker | tracker/forms/expenses.py | 1 | 1193 | from flask.ext.wtf import Form
from wtforms_alchemy import model_form_factory
from wtforms import StringField, DateField, IntegerField
from wtforms.validators import DataRequired
from tracker.extensions import db
from tracker.models import Expense
BaseModelForm = model_form_factory(Form)
class ModelForm(BaseMod... | apache-2.0 |
curiosityio/taiga-docker | taiga-back/taiga-back/tests/integration/test_importer_api.py | 1 | 55263 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | mit |
sam-m888/gramps | gramps/gen/filters/rules/family/_memberbase.py | 10 | 2013 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 you... | gpl-2.0 |
unixunion/python-libsolace | libsolace/settingsloader.py | 1 | 2455 | import yaml
import os
import logging
import sys
__author__ = 'johlyh'
primary_config = 'libsolace.yaml',
try:
primary_config = os.environ['LIBSOLACE_CONFIG']
except Exception, e:
pass
__yamlfiles__ = [
"%s" % primary_config,
'/etc/libsolace/libsolace.yaml',
'/opt/libsolace/libsolace.yaml'
]
__do... | mit |
davidyezsetz/kuma | vendor/packages/sqlalchemy/lib/sqlalchemy/dialects/firebird/base.py | 17 | 26177 | # firebird.py
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Support for the Firebird database.
Connectivity is usually supplied via the kint... | mpl-2.0 |
DarioGT/OMS-PluginXML | org.modelsphere.sms/lib/jython-2.2.1/Lib/test/string_tests.py | 1 | 11250 | """Common tests shared by test_string and test_userstring"""
import string
from test_support import verify, verbose, TestFailed, have_unicode
transtable = '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;... | gpl-3.0 |
adityacs/ansible | lib/ansible/modules/clustering/consul.py | 25 | 20671 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@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... | gpl-3.0 |
anand-c-goog/tensorflow | tensorflow/contrib/distributions/python/ops/dirichlet_multinomial.py | 7 | 11100 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
jacegem/lotto-store | lib/future/moves/urllib/request.py | 70 | 3525 | from __future__ import absolute_import
from future.standard_library import suspend_hooks
from future.utils import PY3
if PY3:
from urllib.request import *
# This aren't in __all__:
from urllib.request import (getproxies,
pathname2url,
proxy_b... | apache-2.0 |
mrquim/repository.mrquim | repo/plugin.video.LiveTV/resources/lib/acestream.py | 21 | 4639 | # -*- coding: utf-8 -*-
""" Plexus (c) 2015 enen92
This file contains the function that brigdes the addon to the acecore.py file
Functions:
load_local_torrent() -> Load a local .torrent file
acestreams(name,iconimage,chid) -> Function that interprets the received url (acestream://,*.aceliv... | gpl-2.0 |
fedora-conary/conary | conary/cmds/clone.py | 2 | 8091 | #
# Copyright (c) SAS Institute 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 w... | apache-2.0 |
SDM-OS/playlist | cherrymusicserver/database/__init__.py | 1 | 5561 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# CherryMusic - a standalone music server
# Copyright (c) 2012 Tom Wallroth & Tilman Boerner
#
# Project page:
# http://fomori.org/cherrymusic/
# Sources on github:
# http://github.com/devsnd/cherrymusic/
#
# CherryMusic is based on
# jPlayer (GPL/MIT license) http://w... | gpl-3.0 |
kdwink/intellij-community | python/helpers/py2only/docutils/parsers/rst/languages/de.py | 57 | 3262 | # $Id: de.py 5174 2007-05-31 00:01:52Z wiemann $
# Authors: Engelbert Gruber <grubert@users.sourceforge.net>;
# Lea Wiemann <LeWiemann@gmail.com>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.... | apache-2.0 |
bigmlcom/bigmler | bigmler/options/export.py | 1 | 2037 | # -*- coding: utf-8 -*-
#
# Copyright 2017-2021 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
redpath11/phy981_thr | projects/proj2/shell_model.py | 1 | 3917 | import numpy as np
from decimal import Decimal
import os
from scipy.misc import comb
from numpy import linalg as LA
import itertools
# bitCount() counts the number of bits set (not an optimal function)
def bitCount(int_type):
""" Count bits set in integer """
count = 0
while(int_type):
int_type &... | apache-2.0 |
ashhher3/invenio | modules/bibformat/lib/elements/bfe_affiliation.py | 19 | 2664 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 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 the
## Licens... | gpl-2.0 |
40223119/2015w13-1 | static/Brython3.1.3-20150514-095342/Lib/_sre.py | 622 | 51369 | # NOT_RPYTHON
"""
A pure Python reimplementation of the _sre module from CPython 2.4
Copyright 2005 Nik Haldimann, licensed under the MIT license
This code is based on material licensed under CNRI's Python 1.6 license and
copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB
"""
MAXREPEAT = 2147483648
#import ar... | gpl-3.0 |
PALab/PLACE | place/plugins/ds345_function_gen/ds345_driver.py | 1 | 13211 | """Driver module for Stanford Research Systems DS345 Function Generator."""
import serial
class DS345Driver:
#pylint: disable=too-many-public-methods
"""Class for low-level access to the function generator settings."""
def __init__(self, serial_port):
self._serial_port = str(serial_port)
# FUNC... | lgpl-3.0 |
CG-F16-24-Rutgers/steersuite-rutgers | steerstats/tools/deap/tests/test_pickle.py | 9 | 4499 |
import sys
import unittest
import array
import pickle
import operator
from test import test_support
sys.path.append("..")
import numpy
import creator
import base
import gp
import tools
def func():
return "True"
class Pickling(unittest.TestCase):
def setUp(self):
creator.create("FitnessMax", base.... | gpl-3.0 |
elkingtonmcb/shogun | examples/undocumented/python_modular/kernel_comm_ulong_string_modular.py | 26 | 1450 | #!/usr/bin/env python
from tools.load import LoadMatrix
lm=LoadMatrix()
traindat =lm.load_dna('../data/fm_train_dna.dat')
testdat = lm.load_dna('../data/fm_test_dna.dat')
parameter_list = [[traindat,testdat,3,0,False ],[traindat,testdat,4,0,False]]
def kernel_comm_ulong_string_modular (fm_train_dna=traindat,fm_test_... | gpl-3.0 |
dpwrussell/openmicroscopy | components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py | 6 | 9679 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2009-2013 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
pytest fixtures used as defined in conftest.py:
- gatewaywrapper
- author_testimg
"""
import omero
import Ice
from omero.gateway.sc... | gpl-2.0 |
leereilly/django-1 | django/utils/tree.py | 103 | 5755 | """
A class for storing a tree graph. Primarily used for filter constructs in the
ORM.
"""
import copy
class Node(object):
"""
A single internal node in the tree graph. A Node should be viewed as a
connection (the root) with the children being either leaf nodes or other
Node instances.
"""
# S... | bsd-3-clause |
twobob/buildroot-kindle | output/build/host-python-2.7.2/Tools/scripts/pysource.py | 94 | 3846 | #!/usr/bin/env python
"""\
List python source files.
There are three functions to check whether a file is a Python source, listed
here with increasing complexity:
- has_python_ext() checks whether a file name ends in '.py[w]'.
- look_like_python() checks whether the file is not binary and either has
the '.py[w]' e... | gpl-2.0 |
eMerzh/Diamond-1 | src/collectors/example/test/testexample.py | 38 | 1240 | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import patch
from diamond.collector import Collector
from example import ExampleCollector
####... | mit |
schlueter/ansible | test/units/modules/network/netscaler/test_netscaler_nitro_request.py | 57 | 12941 |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# ... | gpl-3.0 |
ywcui1990/nupic | tests/swarming/nupic/swarming/experiments/dummyV2/permutations.py | 10 | 3634 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
Emergya/icm-openedx-educamadrid-platform-basic | common/test/acceptance/tests/studio/test_studio_acid_xblock.py | 130 | 6909 | """
Acceptance tests for Studio related to the acid xblock.
"""
from bok_choy.web_app_test import WebAppTest
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.studio.overview import CourseOutlinePage
from ...pages.xblock.acid import AcidView
from ...fixtures.course import CourseFixture, XBlockFixtureDes... | agpl-3.0 |
diegojromerolopez/djanban | src/djanban/apps/repositories/pylinter.py | 1 | 2199 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import os
import re
from pylint import epylint as lint
from djanban.apps.repositories.cloc import Cloc
# Pylinter for directories
class PythonDirectoryAnalyzer(object):
def __init__(self, dir_path):
self.dir_path = dir_path
... | mit |
Bitcoin-com/BUcash | qa/rpc-tests/replace-by-fee.py | 8 | 21940 | #!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test replace by fee code
#
from test_fram... | mit |
wenhuizhang/neutron | neutron/plugins/nuage/plugin.py | 48 | 1051 | # Copyright 2014 Alcatel-Lucent USA 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 l... | apache-2.0 |
eul721/The-Perfect-Pokemon-Team-Balancer | libs/env/Lib/site-packages/pip/_vendor/requests/packages/charade/sbcsgroupprober.py | 2936 | 3291 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-2.0 |
liangazhou/django-rdp | packages/eclipse/plugins/org.python.pydev.jython_4.4.0.201510052309/Lib/encodings/gb2312.py | 816 | 1027 | #
# gb2312.py: Python Unicode Codec for GB2312
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_cn, codecs
import _multibytecodec as mbc
codec = _codecs_cn.getcodec('gb2312')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | apache-2.0 |
jaharkes/home-assistant | homeassistant/components/sensor/command_line.py | 5 | 3568 | """
Allows to configure custom shell commands to turn a value for a sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.command_line/
"""
import logging
import subprocess
from datetime import timedelta
import voluptuous as vol
from homeassist... | mit |
eddieantonio/imgcat | libexec/gen_img.py | 1 | 2780 | #!/usr/bin/env python
# Copyright (c) 2014–2018, Eddie Antonio Santos <easantos@ualberta.ca>
#
# Permission to use, copy, modify, and/or distribute this software 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 ... | isc |
daizhengy/RDS | trove/db/__init__.py | 5 | 3592 | # Copyright 2010-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... | apache-2.0 |
rahuldhote/odoo | addons/website_customer/__openerp__.py | 313 | 1571 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | agpl-3.0 |
nmercier/linux-cross-gcc | linux/lib/python2.7/dist-packages/PIL/IptcImagePlugin.py | 19 | 6977 | #
# The Python Imaging Library.
# $Id$
#
# IPTC/NAA file handling
#
# history:
# 1995-10-01 fl Created
# 1998-03-09 fl Cleaned up and added to PIL
# 2002-06-18 fl Added getiptcinfo helper
#
# Copyright (c) Secret Labs AB 1997-2002.
# Copyright (c) Fredrik Lundh 1995.
#
# See the README file for information on usa... | bsd-3-clause |
louietsai/python-for-android | python-modules/twisted/twisted/conch/test/test_openssh_compat.py | 60 | 3381 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.openssh_compat}.
"""
import os
from twisted.trial.unittest import TestCase
from twisted.python.filepath import FilePath
from twisted.python.compat import set
try:
import Crypto.Cipher.DES3
import ... | apache-2.0 |
mag6367/Cracking_the_Coding_Interview_Python_Solutions | chapter2/quest2_4.py | 1 | 1881 | # question 2.4 from cracking the code interview 4th ed.
# Look at LinkedList.py to understand the implementation of Linked List
'''
You have two numbers represented by a linked list, where each node contains a single digit.
The digits are stored in reverse order, such that the 1’s digit is at the head of the list.
Wri... | mit |
UASLab/ImageAnalysis | video/archive/deprecated_cam_calib.py | 1 | 3390 | import numpy as np
# set camera calibration from some hard coded options
def set_camera_calibration(value):
if value == 0:
name = "Mobius 1920x1080 (Curt)"
K = np.array( [[1362.1, 0.0, 980.8],
[ 0.0, 1272.8, 601.3],
[ 0.0, 0.0, 1.0]] )
... | mit |
safwanrahman/kitsune | authority/templatetags/permissions.py | 5 | 15494 | from django import template
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.contrib.auth.models import AnonymousUser
from authority import get_check
from authority import permissions
from authority.compat import get_user_model
from authority.models impor... | bsd-3-clause |
pku9104038/edx-platform | common/djangoapps/terrain/browser.py | 7 | 7617 | """
Browser set up for acceptance tests.
"""
#pylint: disable=E1101
#pylint: disable=W0613
from lettuce import before, after, world
from splinter.browser import Browser
from logging import getLogger
from django.core.management import call_command
from django.conf import settings
from selenium.common.exceptions import... | agpl-3.0 |
lucadealfaro/crowdranker | models/keystore.py | 1 | 2062 | # -*- coding: utf-8 -*-
# Implementation of a key-value store API.
db.define_table('key_value_store',
Field('content', 'text'))
def keystore_write(v):
"""Writes a new string v to the key-value store, returning the string key."""
id = db.key_value_store.insert(content = v)
logger.info("inserting keys... | bsd-3-clause |
suqinhuang/tp-qemu | qemu/tests/unittest_kvmctl.py | 16 | 1028 | import os
from autotest.client import utils
from autotest.client.shared import error
def run(test, params, env):
"""
This is kvm userspace unit test, use kvm test harness kvmctl load binary
test case file to test various functions of the kvm kernel module.
The output of all unit tests can be found in ... | gpl-2.0 |
jaechankim/namebench | nb_third_party/dns/rdtypes/ANY/CNAME.py | 248 | 1092 | # 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 |
ferabra/edx-platform | cms/djangoapps/contentstore/tests/test_crud.py | 60 | 6006 | import unittest
from xmodule import templates
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE
from xmodule.course_module import CourseDescriptor... | agpl-3.0 |
Open-Source-Coins/mry | contrib/pyminer/pyminer.py | 385 | 6434 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | mit |
sathnaga/virt-test | qemu/tests/pxe_query_cpus.py | 2 | 4098 | import time, logging
from autotest.client.shared import error, utils
from virttest import utils_test, env_process, utils_misc
class Modprobe(object):
prog = "/sbin/modprobe"
def __init__(self, name):
self.name = name
def get_parm(self, parm):
"""
Read parm value from sys file sy... | gpl-2.0 |
mspringett/namebench | nb_third_party/jinja2/ext.py | 199 | 21800 | # -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from collections impor... | apache-2.0 |
lg-devs/android_kernel_lge_msm8610 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
devlin85/p2pool | p2pool/bitcoin/worker_interface.py | 230 | 5901 | from __future__ import division
import StringIO
import json
import random
import sys
from twisted.internet import defer
import p2pool
from p2pool.bitcoin import data as bitcoin_data, getwork
from p2pool.util import expiring_dict, jsonrpc, pack, variable
class _Provider(object):
def __init__(self, parent, long_p... | gpl-3.0 |
ycaihua/kbengine | kbe/src/lib/python/Lib/selectors.py | 75 | 16460 | """Selectors module.
This module allows high-level and efficient I/O multiplexing, built upon the
`select` module primitives.
"""
from abc import ABCMeta, abstractmethod
from collections import namedtuple, Mapping
import math
import select
import sys
# generic events, that must be mapped to implementation-specific... | lgpl-3.0 |
tulsawebdevs/django-multi-gtfs | examples/explore/exploreapp/urls.py | 1 | 5061 | from django.conf.urls import url
from django.views.generic import DetailView, ListView
from multigtfs.models import (
Agency, Block, Fare, FareRule, Feed, FeedInfo, Route, Service, ServiceDate,
Shape, ShapePoint, Stop, StopTime, Trip, Zone)
from exploreapp.views import (
ByFeedListView, FareRuleByFareListV... | apache-2.0 |
spirrello/spirrello-pynet-work | applied_python/lib64/python2.7/site-packages/wrapt/wrappers.py | 7 | 32340 | import sys
import functools
import operator
import weakref
import inspect
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str,
else:
string_types = basestring,
def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
return meta("NewBase", bas... | gpl-3.0 |
PaulWay/insights-core | insights/parsers/tests/test_tuned.py | 1 | 2414 | import unittest
from insights.parsers.tuned import Tuned
from insights.tests import context_wrap
TUNED_OUTPUT = '''
Available profiles:
- balanced
- desktop
- latency-performance
- network-latency
- network-throughput
- powersave
- throughput-performance
- virtual-guest
- virtual-host
Current active profile: virtual-g... | apache-2.0 |
ajestu/python.training | model/contact.py | 1 | 1179 | from sys import maxsize
class Contact:
def __init__(self, firstname= None, lastname= None, id= None,
homephone= None, mobilephone= None, workphone= None, secondphone= None , all_phones_from_homepage=None,
address=None, email=None, email2=None, email3=None, all_emails=None):
... | apache-2.0 |
402231466/2015cd_midterm | gear.py | 11 | 19446 | #@+leo-ver=5-thin
#@+node:office.20150407074720.1: * @file gear.py
#@@language python
#@@tabwidth -4
#@+<<declarations>>
#@+node:office.20150407074720.2: ** <<declarations>> (application)
#@@language python
import cherrypy
import os
import sys
# 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite
# 導入 pybean 模組與所要使用的 Store 及 S... | gpl-3.0 |
orione7/Italorione | servers/fileflyer.py | 20 | 2254 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para fileflyer
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core imp... | gpl-3.0 |
kurikuri99/xen_study | tools/python/xen/xend/tests/test_XendConfig.py | 49 | 2017 | import unittest
import xen.xend.XendConfig as XendConfig
class test_XendConfig(unittest.TestCase):
def testParseFromSXP(self):
cfg = XendConfig.XendConfig(
sxp_obj = (
['vm',
['bootloader_args', '-q --default_args="root=/dev/sda1 ro" --extra_args="quiet" /images/VM1.... | gpl-2.0 |
scotthartbti/android_external_chromium_org | base/PRESUBMIT.py | 58 | 1853 | # 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.
"""Chromium presubmit script for src/base.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit... | bsd-3-clause |
kubernetes-client/python | kubernetes/client/models/v1_fc_volume_source.py | 1 | 7243 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | apache-2.0 |
mayblue9/bokeh | bokeh/server/tests/wsmanager_test.py | 29 | 2390 | from __future__ import absolute_import
from bokeh import protocol
from bokeh import session
from . import test_utils
from ..app import bokeh_app
ws_address = "ws://localhost:5006/bokeh/sub"
class TestSubscribeWebSocket(test_utils.BokehServerTestCase):
def test_basic_subscribe(self):
self.sess1 = session... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.