repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
robovm/robovm-studio | plugins/hg4idea/testData/bin/mercurial/hgweb/wsgicgi.py | 96 | 2796 | # hgweb/wsgicgi.py - CGI->WSGI translator
#
# Copyright 2006 Eric Hopper <hopper@omnifarious.org>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
#
# This was originally copied from the public domain code at
# http://www.python.org... | apache-2.0 |
stablecoin/stablecoin | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
brandon-rhodes/numpy | numpy/random/info.py | 110 | 5116 | """
========================
Random Number Generation
========================
==================== =========================================================
Utility functions
==============================================================================
random_sample Uniformly distributed floats over ``[0, 1)`... | bsd-3-clause |
efortuna/AndroidSDKClone | ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/unittest/test/test_result.py | 104 | 19064 | import sys
import textwrap
from StringIO import StringIO
from test import test_support
import traceback
import unittest
class Test_TestResult(unittest.TestCase):
# Note: there are not separate tests for TestResult.wasSuccessful(),
# TestResult.errors, TestResult.failures, TestResult.testsRun or
# TestRes... | apache-2.0 |
roselleebarle04/django | tests/validation/test_unique.py | 337 | 7108 | from __future__ import unicode_literals
import datetime
import unittest
from django.apps.registry import Apps
from django.core.exceptions import ValidationError
from django.db import models
from django.test import TestCase
from .models import (
CustomPKModel, FlexibleDatePost, ModelToValidate, Post, UniqueErrors... | bsd-3-clause |
lchao-bit/linaro-kernel | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
hlin117/statsmodels | statsmodels/tools/tests/test_data.py | 36 | 1758 | import pandas
import numpy as np
from statsmodels.tools import data
def test_missing_data_pandas():
"""
Fixes GH: #144
"""
X = np.random.random((10,5))
X[1,2] = np.nan
df = pandas.DataFrame(X)
vals, cnames, rnames = data.interpret_data(df)
np.testing.assert_equal(rnames.tolist(), [0,2,... | bsd-3-clause |
aspectron/jsx | extern/boost/tools/build/src/tools/make.py | 45 | 2025 | # Status: ported.
# Base revision: 64068
# Copyright 2003 Dave Abrahams
# Copyright 2003 Douglas Gregor
# Copyright 2006 Rene Rivera
# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/... | mit |
TemplateVoid/mapnik | scons/scons-local-2.3.1/SCons/Tool/dvips.py | 8 | 3512 | """SCons.Tool.dvips
Tool-specific initialization for dvips.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 201... | lgpl-2.1 |
metamarcdw/PyBitmessage-I2P | src/api.py | 4 | 54027 | # Copyright (c) 2012-2014 Jonathan Warren
# Copyright (c) 2012-2014 The Bitmessage developers
comment= """
This is not what you run to run the Bitmessage API. Instead, enable the API
( https://bitmessage.org/wiki/API ) and optionally enable daemon mode
( https://bitmessage.org/wiki/Daemon ) then run bitmessagemain.py.... | mit |
lecaoquochung/ddnb.django | django/contrib/gis/tests/gis_migrations/test_operations.py | 6 | 3842 | from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.db import connection, migrations, models
from django.db.migrations.migration import Migration
from django.db.migrations.state import ProjectState
from django.test import Transa... | bsd-3-clause |
praekelt/portia | portia/tests/test_protocol.py | 1 | 7254 | import json
import pkg_resources
import phonenumbers
from datetime import datetime
from dateutil.parser import parse
from twisted.trial.unittest import TestCase
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, maybeDeferred, Deferred
from twisted.test.proto_helpers import Strin... | bsd-3-clause |
nagyistoce/edx-platform | common/djangoapps/student/migrations/0016_auto__add_field_courseenrollment_date__chg_field_userprofile_country.py | 188 | 10960 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseEnrollment.date'
db.add_column('student_courseenrollment', 'date',
... | agpl-3.0 |
datea/datea-api | datea_api/apps/follow/migrations/0001_initial.py | 2 | 1483 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.AUTH_USER_... | agpl-3.0 |
hydroffice/hyo_ssp | hydroffice/ssp/server.py | 1 | 17102 | from __future__ import absolute_import, division, print_function, unicode_literals
import time
import os
import logging
log = logging.getLogger(__name__)
from .ssp_dicts import Dicts
from .helper import SspError
class Server(object):
def __init__(self, prj):
self.prj = prj
se... | lgpl-3.0 |
applicationdevm/XlsxWriter | xlsxwriter/test/comparison/test_chart_axis20.py | 8 | 1665 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
msabramo/kallithea | kallithea/tests/functional/test_pullrequests.py | 2 | 4767 | from kallithea.tests import *
from kallithea.tests.fixture import Fixture
from kallithea.model.meta import Session
from kallithea.controllers.pullrequests import PullrequestsController
fixture = Fixture()
class TestPullrequestsController(TestController):
def test_index(self):
self.log_user()
res... | gpl-3.0 |
linkinwong/word2vec | src/crf-paper-script/preprocessor5_step1_GetSsrFeature.py | 1 | 6556 | # coding: utf-8
__author__ = 'linlin'
import os
import logging
import re
import pdb
import string
logger = logging.getLogger(__name__)
################################################################
root_dir = '/home/linlin/time/0903_classify_false_start/1003_raw_features/'
separator = '\t\t'
#######################... | apache-2.0 |
pybrain2/pybrain2 | pybrain/rl/learners/directsearch/reinforce.py | 31 | 1304 | __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.rl.learners.directsearch.policygradient import PolicyGradientLearner
from scipy import mean, ravel, array
class Reinforce(PolicyGradientLearner):
""" Reinforce is a gradient estimator technique by Williams (see
"Simple Statistical Gradien... | bsd-3-clause |
abaditsegay/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/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 |
cmusatyalab/openface | demos/web/create-unknown-vectors.py | 11 | 2595 | #!/usr/bin/env python2
#
# Copyright 2015-2016 Carnegie Mellon 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 require... | apache-2.0 |
procangroup/edx-platform | common/lib/capa/capa/tests/response_xml_factory.py | 20 | 35840 | from lxml import etree
from abc import ABCMeta, abstractmethod
class ResponseXMLFactory(object):
""" Abstract base class for capa response XML factories.
Subclasses override create_response_element and
create_input_element to produce XML of particular response types"""
__metaclass__ = ABCMeta
@a... | agpl-3.0 |
Geode/geonode | geonode/upload/forms.py | 10 | 8221 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
rcocetta/kano-toolset | kano/network.py | 1 | 26209 | #!/usr/bin/env python
# network.py
#
# Copyright (C) 2014 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
# This script benefits from the great work by Ovidiu Ciule, ovidiu.ciule@gmail.com
# PyWilist, a Python class module to parse wireless scanning
# informatio... | gpl-2.0 |
citrix-openstack-build/nova | nova/tests/api/openstack/compute/contrib/test_console_output.py | 10 | 6791 | # Copyright 2011 Eldar Nugaev
# 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 ... | apache-2.0 |
hnakamur/django | django/db/migrations/autodetector.py | 39 | 56352 | from __future__ import unicode_literals
import datetime
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOpti... | bsd-3-clause |
hsaputra/tensorflow | tensorflow/contrib/learn/python/learn/utils/__init__.py | 112 | 1300 | # 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 |
khalibartan/Antidote-DM | Antidotes DM/youtube_dl/extractor/newgrounds.py | 150 | 1261 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
class NewgroundsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newgrounds\.com/audio/listen/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.newgrounds.com/audio/listen/549479',
'md5': 'fe6033d2... | gpl-2.0 |
is210-2015-fall-02/is210-week-07-synthesizing | authentication/hashlib.py | 7 | 7942 | # pylint: disable=I0011, W9903, C0301, W0622, C0111, W0702, E1101, E0611, E1321, W0612, W0631, C0103, E0603
# $Id$
#
# Copyright (C) 2005 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
__doc__ = """hashlib module - A common interface to many hash functions.
new(name, string=... | mpl-2.0 |
pixelrebel/st2 | st2actions/st2actions/container/service.py | 11 | 2160 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 |
flaviogrossi/billiard | billiard/semaphore_tracker.py | 1 | 4846 | #
# On Unix we run a server process which keeps track of unlinked
# semaphores. The server ignores SIGINT and SIGTERM and reads from a
# pipe. Every other process of the program has a copy of the writable
# end of the pipe, so we get EOF when all other processes have exited.
# Then the server process unlinks any remai... | bsd-3-clause |
endolith/scipy | benchmarks/benchmarks/go_benchmark_functions/go_funcs_D.py | 21 | 17840 | # -*- coding: utf-8 -*-
import numpy as np
from numpy import abs, cos, exp, arange, pi, sin, sqrt, sum, zeros, tanh
from numpy.testing import assert_almost_equal
from .go_benchmark import Benchmark
class Damavandi(Benchmark):
r"""
Damavandi objective function.
This class defines the Damavandi [1]_ global... | bsd-3-clause |
j-carpentier/nova | nova/tests/unit/api/openstack/compute/test_multiple_create.py | 18 | 22754 | # Copyright 2013 IBM Corp.
# 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 app... | apache-2.0 |
ChrisYammine/ChrisYammine.github.io | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/native.py | 364 | 1938 | # -*- coding: utf-8 -*-
"""
pygments.styles.native
~~~~~~~~~~~~~~~~~~~~~~
pygments version of my "native" vim theme.
: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 |
ProjectSWGCore/NGECore2 | scripts/mobiles/corellia/rogue_corsec_trooper33.py | 2 | 1981 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
kyle1986/robortframe | utest/utils/test_robottime.py | 20 | 17099 | import unittest
import re
import time
import datetime
from robot.utils.asserts import (assert_equal, assert_raises_with_msg,
assert_true, assert_not_none)
from robot.utils.robottime import (timestr_to_secs, secs_to_timestr, get_time,
parse_time, form... | apache-2.0 |
hectord/lettuce | tests/integration/lib/Django-1.3/django/core/management/commands/makemessages.py | 154 | 16507 | import fnmatch
import glob
import os
import re
import sys
from itertools import dropwhile
from optparse import make_option
from subprocess import PIPE, Popen
from django.core.management.base import CommandError, NoArgsCommand
from django.utils.text import get_text_list
pythonize_re = re.compile(r'(?:^|\n)\s*//')
plur... | gpl-3.0 |
Drooids/odoo | 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 |
madsbk/bohrium | bridge/npbackend/bohrium/array_manipulation.py | 5 | 18853 | """
Array manipulation routines
===========================
"""
from copy import deepcopy
from . import array_create
import numpy_force as numpy
from . import bhary
from . import _util
from .bhary import fix_biclass_wrapper
from . import numpy_backport
from . import loop
@fix_biclass_wrapper
def flatten(ary, order='C... | apache-2.0 |
zafar-hussain/or-tools | examples/python/jobshop_ft06_distance.py | 32 | 3927 | # Copyright 2010-2014 Google
# 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, so... | apache-2.0 |
rbb/scripts | kmldecimate.py | 1 | 11963 | import argparse
import datetime
import sys
parser = argparse.ArgumentParser(description='decimate (and retime) a folder or track from a kml file')
#parser.add_argument('-i', '--ifile', metavar='F', type=str, action='store', default = "20170527 Corral couloir.kml",
parser.add_argument('-i', '--ifile', metavar='F', type... | gpl-2.0 |
denisff/python-for-android | python3-alpha/python3-src/Lib/imghdr.py | 57 | 3531 | """Recognize image file formats based on their first few bytes."""
__all__ = ["what"]
#-------------------------#
# Recognize image headers #
#-------------------------#
def what(file, h=None):
if h is None:
if isinstance(file, str):
f = open(file, 'rb')
h = f.read(32)
els... | apache-2.0 |
uber/pyro | pyro/distributions/testing/rejection_gamma.py | 1 | 8619 | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import torch
from pyro.distributions.rejector import Rejector
from pyro.distributions.score_parts import ScoreParts
from pyro.distributions.torch import Beta, Dirichlet, Gamma, Normal
from pyro.distributions.util import copy_docs_... | apache-2.0 |
Ormod/Diamond | src/collectors/udp/test/testudp.py | 30 | 2265 | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
try:
from cStringIO import StringIO
except ImportError:
... | mit |
lucashmorais/x-Bench | mozmill-env/python/Lib/distutils/msvc9compiler.py | 148 | 31018 | """distutils.msvc9compiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.
The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
"""
# Written by Perry Stoll
# hacked by Robin B... | mit |
sander76/home-assistant | homeassistant/components/sms/__init__.py | 4 | 1880 | """The sms component."""
import asyncio
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_DEVICE
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from .const import DOMAIN, SMS_GATEWA... | apache-2.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/lepl/matchers/monitor.py | 2 | 2548 |
# The contents of this file are subject to the Mozilla Public License
# (MPL) Version 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# b... | agpl-3.0 |
r39132/airflow | tests/operators/test_redshift_to_s3_operator.py | 8 | 3787 | # -*- 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 |
linjoahow/w17g | static/Brython3.1.0-20150301-090019/Lib/xml/dom/xmlbuilder.py | 873 | 12377 | """Implementation of the DOM Level 3 'LS-Load' feature."""
import copy
import xml.dom
from xml.dom.NodeFilter import NodeFilter
__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"]
class Options:
"""Features object that has variables set for each DOMBuilder feature.
The DOMBuilder class uses a... | gpl-3.0 |
joopert/home-assistant | homeassistant/components/xiaomi_miio/fan.py | 2 | 36922 | """Support for Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier."""
import asyncio
from enum import Enum
from functools import partial
import logging
import voluptuous as vol
from miio import ( # pylint: disable=import-error
AirFresh,
AirHumidifier,
AirPurifier,
Device,
DeviceException,
)
from... | apache-2.0 |
AnotherIvan/calibre | src/calibre/ebooks/pml/__init__.py | 24 | 2692 | # -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
# Uncommon Characters supported by PML. \\a tag codes
A_CHARS = range(160, 256) + range(130, 136) + range(138, 141) + \
range(145, 152) + range(153, 157) + [159]
# E... | gpl-3.0 |
renyi533/tensorflow | tensorflow/python/training/tracking/base_test.py | 16 | 3895 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
souravbadami/zulip | zerver/tests/test_external.py | 25 | 5105 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.conf import settings
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from django.test import TestCase
from zerver.forms import email_is_not_mit_mailing_list
from zerver.lib.rate_limiter import (
add_... | apache-2.0 |
jimi-c/ansible | lib/ansible/config/manager.py | 2 | 19900 | # Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import io
import os
import os.path
import sys
import stat
import tempfile
import traceback
from co... | gpl-3.0 |
pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/pip/utils/appdirs.py | 174 | 7896 | """
This code was taken from https://github.com/ActiveState/appdirs and modified
to suit our purposes.
"""
from __future__ import absolute_import
import os
import sys
from pip.compat import WINDOWS, expanduser
def user_cache_dir(appname):
r"""
Return full path to the user-specific cache dir for this applica... | gpl-2.0 |
fserena/agora-scholar | agora/scholar/actions/query.py | 1 | 10251 | """
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
This file is part of the Smart Developer Hub Project:
http://www.smartdeveloperhub.org
Center for Open Middleware
http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=... | apache-2.0 |
nomaro/SickBeard_Backup | lib/imdb/_compat.py | 128 | 2753 | """
_compat module (imdb package).
This module provides compatibility functions used by the imdb package
to deal with unusual environments.
Copyright 2008-2010 Davide Alberani <da@erlug.linux.it>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License... | gpl-3.0 |
Charlotte-Morgan/inasafe | safe/common/parameters/test/example.py | 6 | 1728 | # coding=utf-8
"""Example usage of custom parameters."""
import sys
from safe.definitions.constants import INASAFE_TEST
from safe.test.utilities import get_qgis_app
QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app(qsetting=INASAFE_TEST)
from qgis.PyQt.QtWidgets import QApplication, QWidget, QGridLayout # NOQA
from ... | gpl-3.0 |
deadman96385/android_kernel_asus_Z00A | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
apavlenko/opencv | modules/ts/misc/run.py | 2 | 39829 | #!/usr/bin/env python
import sys, os, platform, xml, re, tempfile, glob, datetime, getpass, shutil
from optparse import OptionParser
from subprocess import Popen, PIPE
hostos = os.name # 'nt', 'posix'
hostmachine = platform.machine() # 'x86', 'AMD64', 'x86_64'
errorCode = 0
SIMD_DETECTION_PROGRAM="""
#if __SSE5__
#... | bsd-3-clause |
ElArtista/AssetLoader | deps/Freetype/src/tools/glnames.py | 40 | 105237 | #!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2016 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to u... | mit |
jamespcole/home-assistant | tests/components/file/test_notify.py | 8 | 3297 | """The tests for the notify file platform."""
import os
import unittest
from unittest.mock import call, mock_open, patch
from homeassistant.setup import setup_component
import homeassistant.components.notify as notify
from homeassistant.components.notify import (
ATTR_TITLE_DEFAULT)
import homeassistant.util.dt as... | apache-2.0 |
xrmx/django | tests/model_regress/test_pickle.py | 271 | 3804 | import datetime
import os
import pickle
import subprocess
import sys
import warnings
from django.core.files.temp import NamedTemporaryFile
from django.db import DJANGO_VERSION_PICKLE_KEY, models
from django.test import TestCase, mock
from django.utils._os import npath, upath
from django.utils.encoding import force_tex... | bsd-3-clause |
thedep2/CouchPotatoServer | couchpotato/core/media/movie/providers/info/_modifier.py | 79 | 3850 | import copy
import traceback
from CodernityDB.database import RecordNotFound
from couchpotato import get_db
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.variable import mergeDicts, randomString
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import P... | gpl-3.0 |
ebolyen/qiime2 | qiime2/core/testing/transformer.py | 1 | 4262 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
mspark93/VTK | ThirdParty/Twisted/twisted/internet/test/test_win32events.py | 38 | 6470 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorWin32Events}.
"""
from thread import get_ident
try:
import win32event
except ImportError:
win32event = None
from zope.interface.verify import verifyObject
from twisted.python.failure import Fa... | bsd-3-clause |
KaptenJon/calvin-base | calvin/tutorial/dist-1.py | 1 | 1458 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | apache-2.0 |
spbguru/repo1 | examples/opf/experiments/params/test_all.py | 15 | 2904 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# 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 ... | gpl-3.0 |
asanfilippo7/osf.io | scripts/dataverse/migrate_demo_host.py | 27 | 1867 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script to migrate dataverse ExternalAccounts connected to the dataverse demo server.
"""
import sys
import logging
from modularodm import Q
from website.app import init_app
from scripts import utils as script_utils
from framework.transactions.context import TokuTrans... | apache-2.0 |
timmyshen/Guide_To_Data_Mining | Chapter2/recommender.py | 1 | 8748 | import codecs
from math import sqrt
users = {"Angelica": {"Blues Traveler": 3.5, "Broken Bells": 2.0,
"Norah Jones": 4.5, "Phoenix": 5.0,
"Slightly Stoopid": 1.5,
"The Strokes": 2.5, "Vampire Weekend": 2.0},
"Bill": {"Blues Traveler": 2.0, "Br... | mit |
20uf/ansible | v1/ansible/runner/lookup_plugins/lines.py | 176 | 1432 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
rworkman/blueman | blueman/main/Services.py | 1 | 5435 | # coding=utf-8
import os
import logging
import importlib
from blueman.gui.GenericList import GenericList
from blueman.Functions import check_single_instance
import blueman.plugins.services
from blueman.plugins.ServicePlugin import ServicePlugin
from blueman.main.Config import Config
import gi
gi.require_version("Gtk",... | gpl-3.0 |
thjashin/tensorflow | tensorflow/examples/tutorials/mnist/mnist_softmax.py | 30 | 2744 | # Copyright 2015 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 |
soldag/home-assistant | homeassistant/components/mqtt/fan.py | 6 | 15823 | """Support for MQTT fans."""
import logging
import voluptuous as vol
from homeassistant.components import fan, mqtt
from homeassistant.components.fan import (
ATTR_SPEED,
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM,
SPEED_OFF,
SUPPORT_OSCILLATE,
SUPPORT_SET_SPEED,
FanEntity,
)
from homeassista... | apache-2.0 |
figue/chroma_kernel_mako | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
jarped/QGIS | python/plugins/db_manager/db_plugins/spatialite/plugin.py | 2 | 10900 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
emilio/servo | tests/wpt/web-platform-tests/webdriver/tests/element_send_keys/scroll_into_view.py | 26 | 2762 | from tests.support.asserts import assert_success
from tests.support.helpers import is_element_in_viewport
from tests.support.inline import inline
def element_send_keys(session, element, text):
return session.transport.send(
"POST", "/session/{session_id}/element/{element_id}/value".format(
sess... | mpl-2.0 |
nikolajbaer/django-reportengine | example/example_reports/reports.py | 4 | 2982 | import reportengine
from django.contrib.auth.models import User
from reportengine.filtercontrols import StartsWithFilterControl
from reportengine.outputformats import *
class UserReport(reportengine.ModelReport):
"""An example of a model report"""
verbose_name = "User Report"
slug = "user-report"
nam... | bsd-3-clause |
slevenhagen/odoo-npg | openerp/fields.py | 20 | 74394 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-2014 OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
thesuperzapper/tensorflow | tensorflow/python/ops/weights_broadcast_ops.py | 36 | 7118 | # 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 |
joseedu/joroscha-byte1 | lib/werkzeug/_compat.py | 448 | 6184 | import sys
import operator
import functools
try:
import builtins
except ImportError:
import __builtin__ as builtins
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
int_to_byte = c... | apache-2.0 |
WhireCrow/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/encodings/cp720.py | 417 | 13694 | """Python Character Mapping Codec cp720 generated on Windows:
Vista 6.0.6002 SP2 Multiprocessor Free with the command:
python Tools/unicode/genwincodec.py 720
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,error... | gpl-2.0 |
lyndon160/REF | ministack/spec.py | 2 | 1146 |
# class Spec(object):
# external_network = None
# management_network = None
# keypair = None
# networks = []
# hosts = []
#
# class NetSpec(object):
# name = None
# subnet = None
# gw = None
# class HostSpec(object):
# name = None
# image = None
# flavor = None
# nets... | apache-2.0 |
gausspy/gausspy | gausspy/__init__.py | 1 | 1258 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# Packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from ._astropy_init import * # noqa
# -----------------------------------... | mit |
zhmstar0310/kernel_LG_LTE | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
godfreyy/scrapy | tests/__init__.py | 95 | 1154 | """
tests: this package contains all Scrapy unittests
see http://doc.scrapy.org/en/latest/contributing.html#running-tests
"""
import os
# ignore system-wide proxies for tests
# which would send requests to a totally unsuspecting server
# (e.g. because urllib does not fully understand the proxy spec)
os.environ['http... | bsd-3-clause |
ChenJunor/hue | desktop/libs/liboozie/src/liboozie/conf.py | 12 | 3521 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
utilite2/linux-kernel | 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 |
hynnet/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/json/__init__.py | 27 | 13834 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`json` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of the :m... | gpl-2.0 |
zooba/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pythonwin/pywin/scintilla/scintillacon.py | 24 | 45122 | # Generated by h2py from Include\scintilla.h
# Included from BaseTsd.h
def HandleToUlong(h): return HandleToULong(h)
def UlongToHandle(ul): return ULongToHandle(ul)
def UlongToPtr(ul): return ULongToPtr(ul)
def UintToPtr(ui): return UIntToPtr(ui)
INVALID_POSITION = -1
SCI_START = 2000
SCI_OPTIONAL_START = 3000
SCI... | apache-2.0 |
cglewis/ink | ink/api.py | 1 | 1174 | """
This module is the web server for running the REST API of ink.
Created on 13 February 2014
@author: Charlie Lewis
"""
import sys
import web
class main(object):
"""
This class is responsible for initializing the urls and web server.
"""
# need __new__ for tests, but fails to call __init__ when act... | apache-2.0 |
fangeugene/the-blue-alliance | bootstrap.py | 1 | 8435 | import getpass
import urllib2
import datetime
import argparse
import json
import datetime
import sys
try:
import dev_appserver
dev_appserver.fix_sys_path()
sys.path.insert(1, 'lib')
except ImportError:
print('Please make sure the App Engine SDK is in your PYTHONPATH.')
raise
from google.appengi... | mit |
nrwahl2/ansible | test/units/modules/monitoring/test_circonus_annotation.py | 25 | 6393 | # -*- coding: utf-8 -*-
import io
import json
import re
import uuid
from urllib3.response import HTTPResponse
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
from ansible.modules.monitoring imp... | gpl-3.0 |
AladdinSonni/youtube-dl | youtube_dl/extractor/teamcoco.py | 114 | 6633 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
import binascii
import re
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
qualities,
determine_ext,
)
from ..compat import compat_ord
class TeamcocoIE(InfoExtractor):
_VALID_URL = r'http... | unlicense |
willingc/zulip | zerver/context_processors.py | 125 | 1465 | from __future__ import absolute_import
from django.conf import settings
import ujson
from zproject.backends import password_auth_enabled, dev_auth_enabled, google_auth_enabled
def add_settings(request):
realm = request.user.realm if hasattr(request.user, "realm") else None
return {
# We use the not_vo... | apache-2.0 |
mahmoodkhan/ranewal | htdocs/epro/fields.py | 2 | 2553 | from decimal import Decimal
from django.core.validators import MinValueValidator
from django.db import models
from django.db.models import IntegerField, DecimalField
from django import forms
from django.forms.utils import ValidationError
from django.utils.translation import ugettext_lazy as _
from .widgets import A... | gpl-3.0 |
cristian99garcia/pilas-activity | pilas/test/test_actores.py | 1 | 1566 | import pilas
def test_posicion_de_los_actores():
pilas.iniciar()
mono = pilas.actores.Mono()
# el actor comienza en el centro de la ventana
assert mono.x == 0
assert mono.y == 0
# un cambio de posicion sencillo
mono.x = 100
mono.y = 100
assert mono.x == 100
assert mono.y == 10... | gpl-3.0 |
ScienceStacks/JViz | mysite/scisheets/helpers/test_command_dict.py | 2 | 1074 | '''Tests for CommandDict.'''
from command_dict import CommandDict, _extractDataFromRequest
import scisheets.core.helpers.cell_types as cell_types
from django.test import TestCase, RequestFactory
from helpers_test import HelperHTTP
NCOL = 3
NROW = 4
BASE_URL = "http://localhost:8000/scisheets/"
IGNORE_TEST = False
TAB... | apache-2.0 |
feroda/odoo | addons/auth_openid/__openerp__.py | 313 | 1628 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
reminisce/mxnet | tests/python/unittest/test_tvm_op.py | 1 | 2826 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.