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 |
|---|---|---|---|---|---|
TNosredna/CouchPotatoServer | libs/pyutil/test/out_of_shape/test_strutil.py | 106 | 1713 | #!/usr/bin/env python
# Copyright (c) 2004-2009 Zooko "Zooko" Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import unittest
from pyutil.assertutil import _assert
from pyutil import strutil
class Teststrutil(unittest.TestCase):
def test_short_input(self):
self.failUnl... | gpl-3.0 |
lgierth/cjdns | node_build/dependencies/libuv/build/gyp/test/subdirectory/gyptest-top-default.py | 261 | 1363 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... | gpl-3.0 |
iconmix/skins-addons | script.iconmixtools/resources/lib/unidecode/xd7.py | 252 | 4559 | data = (
'hwen', # 0x00
'hwenj', # 0x01
'hwenh', # 0x02
'hwed', # 0x03
'hwel', # 0x04
'hwelg', # 0x05
'hwelm', # 0x06
'hwelb', # 0x07
'hwels', # 0x08
'hwelt', # 0x09
'hwelp', # 0x0a
'hwelh', # 0x0b
'hwem', # 0x0c
'hweb', # 0x0d
'hwebs', # 0x0e
'hwes', # 0x0f
'hwess', #... | gpl-3.0 |
joachimneu/pelican-plugins | liquid_tags/b64img.py | 312 | 3085 | """
Image Tag
---------
This implements a Liquid-style image tag for Pelican,
based on the liquid img tag which is based on the octopress image tag [1]_
Syntax
------
{% b64img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %}
Examples
--------
{% b64img /images/ni... | agpl-3.0 |
mhugent/Quantum-GIS | python/plugins/processing/algs/qgis/ftools/PointDistance.py | 2 | 8193 | # -*- coding: utf-8 -*-
"""
***************************************************************************
PointDistance.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | gpl-2.0 |
IT-Department-Projects/OOAD-Project | Flask_App/oakcrest/lib/python2.7/site-packages/requests/packages/chardet/langhebrewmodel.py | 2763 | 11318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | mit |
liamgh/liamgreenhughes-sl4a-tf101 | python/src/Mac/Demo/resources/listres.py | 39 | 1598 | # List all resources
from Carbon import Res
from Carbon.Resources import *
def list1resources():
ntypes = Res.Count1Types()
for itype in range(1, 1+ntypes):
type = Res.Get1IndType(itype)
print "Type:", repr(type)
nresources = Res.Count1Resources(type)
for i in range(1, 1 + nres... | apache-2.0 |
jawrainey/sris | settings.py | 1 | 1602 | import os
class Config(object):
"""
The shared configuration settings for the flask app.
"""
# Service settings
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__)))
SERVICE_ONTOLOGY = PROJECT_ROOT + '/sris/config/ontology.json'
# Database settings
CLIENT_NAME = 'cli... | mit |
gaddman/ansible | test/units/module_utils/network/slxos/test_slxos.py | 45 | 4718 | #
# (c) 2018 Extreme Networks 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.
#
# Ans... | gpl-3.0 |
eg-zhang/h2o-2 | py/testdir_ec2_only/test_GBM_manyfiles_s3n.py | 9 | 7490 | import unittest
import random, sys, time, re
sys.path.extend(['.','..','../..','py'])
import h2o_browse as h2b, h2o_gbm
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm, h2o_util, h2o_rf, h2o_jobs as h2j
doPredict = False
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sand... | apache-2.0 |
kostya0shift/SyncToGit | synctogit/Config.py | 1 | 1728 | from __future__ import absolute_import
try:
import configparser
except:
import ConfigParser as configparser
class _NotSet(object):
pass
class ConfigException(Exception):
pass
class Config:
def __init__(self, conffile):
self.conffile = conffile
self.conf = configparser.ConfigP... | mit |
openthread/openthread | tools/harness-automation/cases_R140/ed_6_5_2.py | 18 | 2051 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | bsd-3-clause |
jaidevd/scikit-learn | sklearn/cluster/bicluster.py | 26 | 19870 | """Spectral biclustering algorithms.
Authors : Kemal Eren
License: BSD 3 clause
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.sparse import dia_matrix
from scipy.sparse import issparse
from . import KMeans, MiniBatchKMeans
from ..base import BaseEstimator, BiclusterMixin
from ..external... | bsd-3-clause |
EliasTouil/simpleBlog | simpleBlog/Lib/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py | 515 | 5599 | from __future__ import absolute_import
# Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError(HTTPError):
"Base exception for errors caused within a pool."
def __init__(se... | gpl-3.0 |
Achuth17/scikit-bio | skbio/tree/tests/test_tree.py | 3 | 40995 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | bsd-3-clause |
grandcat/robotics_g7 | explorer/src/explorer/msg/_Stop_EKF.py | 1 | 3225 | """autogenerated by genpy from explorer/Stop_EKF.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Stop_EKF(genpy.Message):
_md5sum = "08f794ec9172dc90262fcf16b6e9022c"
_type = "explorer/Stop_EKF"
_has_header = False #flag to mark the prese... | gpl-2.0 |
coursemdetw/2014c2 | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/_sysconfigdata.py | 731 | 18167 | build_time_vars={'HAVE_SYS_WAIT_H': 1, 'HAVE_UTIL_H': 0, 'HAVE_SYMLINKAT': 1, 'HAVE_LIBSENDFILE': 0, 'SRCDIRS': 'Parser Grammar Objects Python Modules Mac', 'SIZEOF_OFF_T': 8, 'BASECFLAGS': '-Wno-unused-result', 'HAVE_UTIME_H': 1, 'EXTRAMACHDEPPATH': '', 'HAVE_SYS_TIME_H': 1, 'CFLAGSFORSHARED': '-fPIC', 'HAVE_HYPOT': 1... | gpl-2.0 |
halvertoluke/edx-platform | lms/djangoapps/certificates/urls.py | 12 | 1331 | """
URLs for the certificates app.
"""
from django.conf.urls import patterns, url
from django.conf import settings
from certificates import views
urlpatterns = patterns(
'',
# Certificates HTML view end point to render web certs by user and course
url(
r'^user/(?P<user_id>[^/]*)/course/{course_i... | agpl-3.0 |
lupyuen/RaspberryPiImage | home/pi/GrovePi/Software/Python/others/temboo/Library/Basecamp/GetAllListItems.py | 5 | 3833 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetAllListItems
# Retrieves all items in a specified To-do list.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... | apache-2.0 |
kennedyshead/home-assistant | tests/components/elgato/test_init.py | 2 | 1137 | """Tests for the Elgato Key Light integration."""
import aiohttp
from homeassistant.components.elgato.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from tests.components.elgato import init_integration
from tests.test_util.aiohttp import Aioh... | apache-2.0 |
foomango/linux-3.7.1 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # 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 system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
aimas/TuniErp-8.0 | addons/stock_account/stock_account.py | 89 | 19895 | # -*- 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 |
MpApQ/kernel_huawei | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
charbeljc/OCB | openerp/addons/test_inherit/tests/test_inherit.py | 118 | 3182 | # -*- coding: utf-8 -*-
from openerp.tests import common
class test_inherits(common.TransactionCase):
def test_00_inherits(self):
""" Check that a many2one field with delegate=True adds an entry in _inherits """
daughter = self.env['test.inherit.daughter']
self.assertEqual(daughter._inher... | agpl-3.0 |
gchaimovitz/CouchPotatoServer | libs/tornado/curl_httpclient.py | 64 | 20382 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | gpl-3.0 |
Ryex/airtime | python_apps/media-monitor/mm2/media/monitor/handler.py | 10 | 2337 | # -*- coding: utf-8 -*-
from pydispatch import dispatcher
import abc
from log import Loggable
from ..saas.thread import getsig
import pure as mmp
# Defines the handle interface
class Handles(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def handle(self, sender, event, *args, **kwargs): pass
# ... | agpl-3.0 |
wwj718/edx-platform | lms/djangoapps/mobile_api/video_outlines/serializers.py | 46 | 8899 | """
Serializer for video outline
"""
from rest_framework.reverse import reverse
from xmodule.modulestore.mongo.base import BLOCK_TYPES_WITH_CHILDREN
from xmodule.modulestore.django import modulestore
from courseware.access import has_access
from courseware.courses import get_course_by_id
from courseware.model_data imp... | agpl-3.0 |
FiveEye/ml-notebook | dlp/ch6_2_pretrained_embedding.py | 1 | 2633 | import os
imdb_dir = '/home/han/code/data/aclImdb'
train_dir = os.path.join(imdb_dir, 'train')
# Processing the labels of the raw IMDB data
labels = []
texts = []
for label_type in ['neg', 'pos']:
dir_name = os.path.join(train_dir, label_type)
for fname in os.listdir(dir_name):
if fname[-4:] == '.t... | mit |
mbernasocchi/inasafe | safe/common/parameters/resource_parameter.py | 8 | 2162 | # coding=utf-8
"""Resource Parameter."""
import os
import sys
PARAMETERS_DIR = os.path.abspath(
os.path.join(
os.path.dirname(__file__), '..', '..', '..', 'safe_extras',
'parameters'))
if PARAMETERS_DIR not in sys.path:
sys.path.append(PARAMETERS_DIR)
from parameters.float_parameter import Flo... | gpl-3.0 |
mano3m/CouchPotatoServer | libs/dateutil/tz.py | 217 | 32988 | """
Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__license__ = "Simplified BSD"
from six import string_types, PY3
import datetime
import struct
import time
import sys
import os
relativedelta = None
parser = None
rrule = No... | gpl-3.0 |
facebookexperimental/eden | eden/scm/edenscm/hgext/hggit/__init__.py | 2 | 16871 | # git.py - git server bridge
#
# Copyright 2008 Scott Chacon <schacon at gmail dot com>
# also some code (and help) borrowed from durin42
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
"""push and pull from a Git server
Thi... | gpl-2.0 |
yongshengwang/hue | build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/contrib/gis/gdal/driver.py | 221 | 2469 | # prerequisites imports
from ctypes import c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException
from django.contrib.gis.gdal.prototypes import ds as capi
from django.utils import six
from django.utils.encoding import force_bytes
# For more information, see ... | apache-2.0 |
sgiavasis/nipype | nipype/interfaces/freesurfer/tests/test_auto_Apas2Aseg.py | 6 | 1063 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..utils import Apas2Aseg
def test_Apas2Aseg_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,... | bsd-3-clause |
tavendo/AutobahnPython | autobahn/xbr/_eip712_channel_open.py | 3 | 5767 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit |
varunnaganathan/django | tests/template_tests/test_library.py | 413 | 3753 | from django.template import Library
from django.template.base import Node
from django.test import TestCase
class FilterRegistrationTests(TestCase):
def setUp(self):
self.library = Library()
def test_filter(self):
@self.library.filter
def func():
return ''
self.ass... | bsd-3-clause |
pikeBishop/OMP_gpxReport | geotiler/tests/cache/test_redis.py | 1 | 3155 | #
# GeoTiler - library to create maps using tiles from a map provider
#
# Copyright (C) 2014 by Artur Wroblewski <wrobell@pld-linux.org>
#
# 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 ... | gpl-2.0 |
fanjunwei/depot_tools | third_party/logilab/common/ureports/docbook_writer.py | 93 | 5706 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | bsd-3-clause |
pandegroup/vs-utils | vs_utils/utils/tests/test_image_utils.py | 3 | 2212 | """
Tests for image utilities.
"""
import numpy as np
from PIL import Image
import tempfile
import unittest
from vs_utils.utils import image_utils
class TestImageUtils(unittest.TestCase):
"""
Test image_utils.
"""
def setUp(self):
"""
Set up tests.
"""
pixels = np.rand... | gpl-3.0 |
seanfisk/buzzword-bingo-server | djangorestframework/status.py | 1 | 1455 | """
Descriptive HTTP status codes, for code readability.
See RFC 2616 - Sec 10: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Also see django.core.handlers.wsgi.STATUS_CODE_TEXT
"""
HTTP_100_CONTINUE = 100
HTTP_101_SWITCHING_PROTOCOLS = 101
HTTP_200_OK = 200
HTTP_201_CREATED = 201
HTTP_202_ACCEPTED = 202
HTT... | bsd-3-clause |
captiosus/treadmill | treadmill/infra/utils/cli_callbacks.py | 2 | 1663 | from treadmill.infra import vpc
import click
import re
import pkg_resources
_IPA_PASSWORD_RE = re.compile('.{8,}')
def convert_to_vpc_id(ctx, param, value):
"""Returns VPC ID from Name"""
if not value:
return value
return vpc.VPC.get_id_from_name(value)
def validate_vpc_name(ctx, param, value)... | apache-2.0 |
charris/numpy | numpy/lib/tests/test_mixins.py | 17 | 7030 | import numbers
import operator
import numpy as np
from numpy.testing import assert_, assert_equal, assert_raises
# NOTE: This class should be kept as an exact copy of the example from the
# docstring for NDArrayOperatorsMixin.
class ArrayLike(np.lib.mixins.NDArrayOperatorsMixin):
def __init__(self, value):
... | bsd-3-clause |
dlebauer/plantcv | lib/plantcv/dev/roi_multi_objects.py | 1 | 3484 | import cv2
import numpy as np
from plantcv import print_image
### Find Objects Partially Inside Region of Interest or Cut Objects to Region of Interest
def roi_objects(img,roi_type,roi_contour, roi_hierarchy,object_contour, obj_hierarchy, device, debug=False):
# img = img to display kept objects
# roi_type = 'cutto'... | gpl-2.0 |
subodhchhabra/airflow | airflow/hooks/__init__.py | 8 | 3247 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
guition/Nocturn-RS4L | Live/src/__init__.py | 1 | 1246 | #
# Copyright (C) 2009 Guillermo Ruiz Troyano
#
# This file is part of Nocturn Remote Script for Live (Nocturn RS4L).
#
# Nocturn RS4L 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 ... | gpl-3.0 |
jeffFranklin/iam-resttools | resttools/dao_implementation/nws.py | 1 | 2539 | """
Contains NWS DAO implementations.
"""
from resttools.mock.mock_http import MockHTTP
import re
from resttools.dao_implementation.live import get_con_pool, get_live_url
from resttools.dao_implementation.mock import get_mockdata_url
import logging
logger = logging.getLogger(__name__)
class File(object):
"""
... | apache-2.0 |
dpshelio/sunpy | sunpy/net/dataretriever/tests/test_eve.py | 2 | 3757 | import pytest
from sunpy.time import parse_time
from sunpy.time.timerange import TimeRange
from sunpy.net.vso import VSOClient
from sunpy.net.vso.attrs import Time, Instrument, Source, Level
from sunpy.net.dataretriever.client import QueryResponse
import sunpy.net.dataretriever.sources.eve as eve
from sunpy.net.fido_f... | bsd-2-clause |
sh4wn/vispy | vispy/scene/widgets/viewbox.py | 20 | 6727 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
import numpy as np
from .widget import Widget
from ..subscene import SubScene
from ..cameras import make_camera, BaseCamera
from ...ext.six i... | bsd-3-clause |
djnugent/ardupilot | mk/PX4/Tools/genmsg/src/genmsg/srvs.py | 216 | 3017 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... | gpl-3.0 |
SujaySKumar/django | tests/i18n/patterns/tests.py | 256 | 14326 | from __future__ import unicode_literals
import os
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import clear_url_caches, reverse, translate_url
from django.http import HttpResponsePermanentRedirect
from django.middleware.locale import LocaleMiddleware
from django.template impor... | bsd-3-clause |
keflavich/scikit-image | skimage/util/tests/test_apply_parallel.py | 15 | 1847 | from __future__ import absolute_import
import numpy as np
from numpy.testing import assert_array_almost_equal
from skimage.filters import threshold_adaptive, gaussian_filter
from skimage.util.apply_parallel import apply_parallel
def test_apply_parallel():
# data
a = np.arange(144).reshape(12, 12).astype(flo... | bsd-3-clause |
hojel/calibre | src/calibre/gui2/preferences/search.py | 14 | 10956 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt5.Qt import QApplication
from calibre.gui2.preferences import ConfigWidgetBase, test_widget, \
CommaSepa... | gpl-3.0 |
melviso/beatle | beatle/model/py/Argument.py | 2 | 3649 | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 22 22:31:28 2013
@author: mel
"""
from beatle.model import TComponent
from beatle import tran
class Argument(TComponent):
"""Implements argument representation"""
context_container = True
#visual methods
@tran.TransactionalMethod('move argument {0}')
... | gpl-2.0 |
HalcyonChimera/osf.io | website/registries/utils.py | 3 | 1344 | REG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'registered_report': 'Registered Report Protocol Preregistration',
}
def get_campaign_schema(campaign):
from osf.models import RegistrationSchema
if campaign not in REG_CAMPAIGNS:
raise ValueError('campaign must be one of: {}'.format(', '.join(REG... | apache-2.0 |
rahul67/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/de_CH/formats.py | 118 | 1448 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DA... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/internet/test/test_udp.py | 11 | 15641 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorUDP} and the UDP parts of
L{IReactorSocket}.
"""
from __future__ import division, absolute_import
__metaclass__ = type
import socket
from zope.interface import implementer
from zope.interface.verify i... | mit |
glwu/python-for-android | python3-alpha/python3-src/Lib/test/test_contextlib.py | 55 | 10288 | """Unit tests for contextlib.py, and other context managers."""
import sys
import tempfile
import unittest
from contextlib import * # Tests __all__
from test import support
try:
import threading
except ImportError:
threading = None
class ContextManagerTestCase(unittest.TestCase):
def test_contextmanage... | apache-2.0 |
vongazman/libcloud | libcloud/test/compute/test_deployment.py | 3 | 20466 | # -*- coding: utf-8 -*-
# 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 "Li... | apache-2.0 |
anaruse/chainer | chainer/links/connection/deformable_convolution_2d.py | 1 | 5529 | from chainer.functions import deformable_convolution_2d_sampler
from chainer import initializers
from chainer.initializers import constant
from chainer import link
from chainer.links.connection.convolution_2d import Convolution2D
from chainer import variable
class DeformableConvolution2D(link.Chain):
"""Two-dimen... | mit |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/zope.interface-4.1.2/src/zope/interface/interfaces.py | 49 | 43112 | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | mit |
rue89-tech/edx-platform | cms/djangoapps/contentstore/tests/test_orphan.py | 77 | 4598 | """
Test finding orphans via the view and django config
"""
import json
from contentstore.tests.utils import CourseTestCase
from student.models import CourseEnrollment
from contentstore.utils import reverse_course_url
class TestOrphanBase(CourseTestCase):
"""
Base class for Studio tests that require orphaned ... | agpl-3.0 |
agermanidis/Pattern | graph/__init__.py | 1 | 46675 | #### PATTERN | GRAPH #################################################################################
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
##################################... | bsd-3-clause |
edlabh/SickRage | lib/github/StatsPunchCard.py | 74 | 2341 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | gpl-3.0 |
mj10777/QGIS | tests/src/python/test_qgssearchwidgettoolbutton.py | 45 | 7453 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSearchWidgetToolButton.
.. note:: 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 vers... | gpl-2.0 |
ephes/scikit-learn | sklearn/__init__.py | 154 | 3014 | """
Machine learning module for Python
==================================
sklearn is a Python module integrating classical machine
learning algorithms in the tightly-knit world of scientific Python
packages (numpy, scipy, matplotlib).
It aims to provide simple and efficient solutions to learning problems
that are acc... | bsd-3-clause |
manishpatell/erpcustomizationssaiimpex123qwe | addons/hw_posbox_upgrade/__init__.py | 1894 | 1075 | # -*- 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 |
txemagon/1984 | modules/Telegram-bot-python/build/lib/telegram/vendor/ptb_urllib3/urllib3/response.py | 150 | 22662 | from __future__ import absolute_import
from contextlib import contextmanager
import zlib
import io
import logging
from socket import timeout as SocketTimeout
from socket import error as SocketError
from ._collections import HTTPHeaderDict
from .exceptions import (
BodyNotHttplibCompatible, ProtocolError, DecodeErr... | gpl-3.0 |
vitan/hue | desktop/core/ext-py/python-ldap-2.3.13/Tests/t_search.py | 40 | 2986 | import ldap, unittest
import slapd
from ldap.ldapobject import LDAPObject
server = None
class TestSearch(unittest.TestCase):
def setUp(self):
global server
if server is None:
server = slapd.Slapd()
server.start()
base = server.get_dn_suffix()
# in... | apache-2.0 |
direvus/ansible | lib/ansible/modules/cloud/amazon/ec2_asg_facts.py | 69 | 14012 | #!/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 |
hanvo/MusicCloud | Crawler/Install Files/pygame/test/run_tests__tests/failures1/fake_3_test.py | 270 | 1136 | if __name__ == '__main__':
import sys
import os
pkg_dir = (os.path.split(
os.path.split(
os.path.split(
os.path.abspath(__file__))[0])[0])[0])
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
... | bsd-3-clause |
40223139/39g7test | static/Brython3.1.3-20150514-095342/Lib/_collections.py | 603 | 19111 | # "High performance data structures
# "
# copied from pypy repo
#
# Copied and completed from the sandbox of CPython
# (nondist/sandbox/collections/pydeque.py rev 1.1, Raymond Hettinger)
#
# edited for Brython line 558 : catch ImportError instead of AttributeError
import operator
#try:
# from thread import get_i... | gpl-3.0 |
pragle/craft | web/model/db_model.py | 1 | 1193 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Michal Szczepanski'
from sqlalchemy.sql.schema import Column, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Integer, String, Boolean, Binary
Base = declarative_base()
clas... | bsd-3-clause |
lewiskan/heron | heron/tools/tracker/src/python/handlers/clustershandler.py | 10 | 1130 | # Copyright 2016 Twitter. 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 agree... | apache-2.0 |
PeterWangIntel/chromium-crosswalk | third_party/closure_linter/closure_linter/requireprovidesorter.py | 84 | 11383 | #!/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 |
ecolitan/fatics | venv/lib/python2.7/site-packages/twisted/mail/test/test_pop3.py | 38 | 30556 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for Ltwisted.mail.pop3} module.
"""
import StringIO
import hmac
import base64
import itertools
from zope.interface import implements
from twisted.internet import defer
from twisted.trial import unittest, util
from twisted import... | agpl-3.0 |
madelynfreed/rlundo | venv/lib/python2.7/site-packages/setuptools/package_index.py | 301 | 38760 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
from functools import wraps
from pkg_resources import (
CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST,
require, Environment, find_distributions, safe_name, s... | gpl-3.0 |
chubbymaggie/claripy | tests/test_expression.py | 2 | 16903 | import claripy
import nose
def test_smudging():
x = claripy.BVS('x', 32)
y = x+1
nose.tools.assert_true(isinstance(y.args[1], claripy.ast.BV))
nose.tools.assert_equal(y.args[1].args[0], 1)
nose.tools.assert_equal(y.args[1].args[1], 32)
x = claripy.BVS('x', 32)
y = x*1
z = y+1
nose.... | bsd-2-clause |
seem-sky/kbengine | kbe/src/lib/python/Lib/asyncio/base_events.py | 61 | 40585 | """Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a c... | lgpl-3.0 |
sstoma/CellProfiler | cellprofiler/cpmath/tests/test_fastemd.py | 2 | 5347 | """test_fastemd.py test the FastEMD library wrapper
CellProfiler is distributed under the GNU General Public License,
but this file is licensed under the more permissive BSD license.
See the accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2015 Br... | gpl-2.0 |
NewUnsigned/TeamTalk | win-client/3rdParty/src/json/devtools/batchbuild.py | 132 | 11585 | import collections
import itertools
import json
import os
import os.path
import re
import shutil
import string
import subprocess
import sys
import cgi
class BuildDesc:
def __init__(self, prepend_envs=None, variables=None, build_type=None, generator=None):
self.prepend_envs = prepend_envs or [] # [ { "var":... | apache-2.0 |
dongjiaqiang/thrift | test/py/TSimpleJSONProtocolTest.py | 69 | 4068 | #!/usr/bin/env python
#
# 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
# "L... | apache-2.0 |
cloxp/cloxp-install | win/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 604 | 3207 | #!/usr/bin/env python
# Copyright 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
fangxingli/hue | desktop/core/ext-py/Pygments-1.3.1/pygments/styles/default.py | 75 | 2532 | # -*- coding: utf-8 -*-
"""
pygments.styles.default
~~~~~~~~~~~~~~~~~~~~~~~
The default highlighting style.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Com... | apache-2.0 |
edureis95/xbmc | tools/EventClients/examples/python/example_button2.py | 228 | 2074 | #!/usr/bin/python
# This is a simple example showing how you can send a key press event
# to XBMC in a non-queued fashion to achieve a button pressed down
# event i.e. a key press that repeats.
# The repeat interval is currently hard coded in XBMC but that might
# change in the future.
# NOTE: Read the comments in '... | gpl-2.0 |
h3biomed/ansible-modules-core | cloud/azure/azure_rm_storageaccount_facts.py | 50 | 6444 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 Soft... | gpl-3.0 |
wasade/picrust | picrust/ace.py | 1 | 3860 | #!/usr/bin/env python
# Author: Morgan Langille (morgan.g.i.langille@gmail.com)
# count_wagner.py
""" Application controller for the `ace' function within the R package `ape`.
File created on Feb 2012.
"""
from __future__ import division
from cogent.util.table import Table
from os.path import split, splitext
from os... | gpl-3.0 |
frederick623/HTI | fa_util_py/HTI_ExportSIToMSS.py | 1 | 16771 | import ael
import acm
import time
import datetime
import os
import stat
import smtplib
import shutil
import string
#import HTI_DB_Functions
from datetime import date
from datetime import datetime
import shlex
#import HTI_MailFunction
import os
SEQNBR = 0
TRDNBR = 1
SETTTYPE = 2
VALUEDAY = 3
TEXT1 = 4
PRFID = 5
AMOUNT ... | apache-2.0 |
zhoulingjun/zipline | zipline/assets/assets.py | 8 | 34670 | # Copyright 2015 Quantopian, 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... | apache-2.0 |
idrogeno/FusionOE | tools/host_tools/FormatConverter/lamedb.py | 78 | 2262 | from datasource import datasource
class lamedb(datasource):
def __init__(self, filename = "lamedb"):
datasource.__init__(self)
self.setFilename(filename)
def setFilename(self, filename):
self.filename = filename
def getName(self):
return "lamedb"
def getCapabilities(self):
return [("read file", self.r... | gpl-2.0 |
jamielennox/keystone | keystone/contrib/federation/migrate_repo/versions/001_add_identity_provider_table.py | 14 | 1536 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
lightmare/mapnik | scons/scons-local-4.1.0/SCons/Tool/suncxx.py | 4 | 4879 | """SCons.Tool.sunc++
Tool-specific initialization for C++ on SunOS / Solaris.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person... | lgpl-2.1 |
blink1073/pexpect | examples/monitor.py | 20 | 7437 | #!/usr/bin/env python
''' This runs a sequence of commands on a remote host using SSH. It runs a
simple system checks such as uptime and free to monitor the state of the remote
host.
./monitor.py [-s server_hostname] [-u username] [-p password]
-s : hostname of the remote server to login to.
-u : username to ... | isc |
edx/edx-platform | openedx/features/lti_course_tab/tests.py | 5 | 1590 | """
Tests for LTI Course tabs.
"""
from unittest.mock import Mock, patch
from lms.djangoapps.courseware.tests.test_tabs import TabTestCase
from openedx.features.lti_course_tab.tab import DiscussionLtiCourseTab
class DiscussionLtiCourseTabTestCase(TabTestCase):
"""Test cases for LTI Discussion Tab."""
def ch... | agpl-3.0 |
Endika/brotli | python/bro.py | 88 | 4909 | #! /usr/bin/env python
"""bro %s -- compression/decompression utility using the Brotli algorithm."""
from __future__ import print_function
import argparse
import sys
import os
import brotli
import platform
# default values of encoder parameters
DEFAULT_PARAMS = {
'mode': brotli.MODE_GENERIC,
'quality': 11,
... | apache-2.0 |
blaze/partd | partd/dict.py | 5 | 1701 | from .core import Interface
from threading import Lock
class Dict(Interface):
def __init__(self):
self.lock = Lock()
self.data = dict()
Interface.__init__(self)
def __getstate__(self):
return {'data': self.data}
def __setstate__(self, state):
Interface.__setstate_... | bsd-3-clause |
graphite-project/graphite-web | webapp/graphite/composer/views.py | 4 | 2742 | """Copyright 2008 Orbitz WorldWide
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | apache-2.0 |
awesto/django-shop | shop/views/auth.py | 1 | 8484 | from django.contrib.auth import logout, get_user_model
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.tokens import default_token_generator
from django.core.exceptions import NON_FIELD_ERRORS
from django.utils.encoding import force_str
from django.utils.translation import gettext_lazy as ... | bsd-3-clause |
kawamuray/ganeti | lib/uidpool.py | 6 | 11942 | #
#
# Copyright (C) 2010, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distri... | gpl-2.0 |
frappe/erpnext | erpnext/tests/utils.py | 2 | 2180 | # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import copy
from contextlib import contextmanager
import frappe
def create_test_contact_and_address():
frappe.db.sql('delete from tabContact')
frappe.db.sql('delete from `tabContact Email`... | gpl-3.0 |
thinkgen/thirdparty | plugin.video.GOtv/default.py | 1 | 171848 | # -*- coding: utf-8 -*-
'''
GOtv XBMC Addon
Copyright (C) 2014 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any... | gpl-2.0 |
charlesthk/django-nightmare-pdf | nightmare_pdf/generators.py | 1 | 2545 | import subprocess
import os
from django.core.validators import URLValidator
from nightmare_pdf.settings import pdf_settings
from django.http import (
HttpResponse,
Http404
)
from django.core.files.base import ContentFile
from .models import PdfDoc
from .utils import get_random_filename
validate_url = URLValidator(s... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.