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 |
|---|---|---|---|---|---|
openbudgets/openbudgets | openbudgets/apps/transport/incoming/resolvers/__init__.py | 4 | 11919 | from django.conf import settings
from openbudgets.apps.transport.incoming.parsers import ITEM_SEPARATOR
from openbudgets.apps.transport.incoming.errors import DataAmbiguityError, ParentScopeError,\
InverseScopesError, InverseNodeNotFoundError
class PathResolver(object):
#PATH_DELIMITER = settings.OPENBUDGETS... | bsd-3-clause |
nbargnesi/tornado | tornado/httpclient.py | 104 | 26658 | """Blocking and non-blocking HTTP client interfaces.
This module defines a common interface shared by two implementations,
``simple_httpclient`` and ``curl_httpclient``. Applications may either
instantiate their chosen implementation class directly or use the
`AsyncHTTPClient` class from this module, which selects an... | apache-2.0 |
JianyuWang/nova | nova/db/sqlalchemy/migrate_repo/versions/228_add_metrics_in_compute_nodes.py | 81 | 1236 | # Copyright 2013 Intel Corporation
#
# 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 ... | apache-2.0 |
ahuarte47/QGIS | tests/src/python/test_qgsogcutils.py | 45 | 17768 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsOgcUtils.
From build dir, run: ctest -R PyQgsOgcUtils -V
.. 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,... | gpl-2.0 |
SHAFNehal/Course | tf-hands-on/slim/python/slim/queues.py | 35 | 2087 | # 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 applicable ... | apache-2.0 |
craftytrickster/servo | tests/wpt/harness/wptrunner/update/update.py | 118 | 5053 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import sys
from metadata import MetadataUpdateRunner
from sync import SyncFromUpstreamRunner
from tree import... | mpl-2.0 |
Shopify/dd-agent | tests/core/test_autorestart.py | 38 | 3219 | # stdlib
import os
import shlex
import signal
import subprocess
import time
import unittest
# 3p
from nose.plugins.attrib import attr
@attr(requires='core_integration')
class TestAutoRestart(unittest.TestCase):
""" Test the auto-restart and forking of the agent """
def setUp(self):
self.agent_foregro... | bsd-3-clause |
GitHublong/hue | desktop/core/ext-py/Paste-2.0.1/paste/proxy.py | 50 | 10192 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
An application that proxies WSGI requests to a remote server.
TODO:
* Send ``Via`` header? It's not clear to me this is a Via in the
style of ... | apache-2.0 |
chemelnucfin/tensorflow | tensorflow/python/kernel_tests/map_fn_test.py | 14 | 8821 | # 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 |
flybird119/voltdb | build.py | 5 | 13379 | #!/usr/bin/env python
import os, sys, commands, string
from buildtools import *
# usage:
# The following all work as you might expect:
# python build.py
# ./build.py debug
# python build.py release
# python build.py test
# ./build.py clean
# ./build.py release clean
# python build.py release test
# The command line ... | agpl-3.0 |
CLVsol/odoo_addons | clv_medicament/clv_annotation/clv_annotation.py | 1 | 2262 | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | agpl-3.0 |
jimklo/LearningRegistry | LR/lr/controllers/services.py | 2 | 3121 | # Copyright 2011 Department of Defence
# 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 agr... | apache-2.0 |
eestay/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/factories.py | 16 | 15607 | import pprint
import threading
from uuid import uuid4
from decorator import contextmanager
import pymongo.message
from factory import Factory, Sequence, lazy_attribute_sequence, lazy_attribute
from factory.containers import CyclicDefinitionError
from mock import Mock, patch
from nose.tools import assert_less_equal, as... | agpl-3.0 |
dstanek/keystone | keystone/tests/unit/test_backend_sql.py | 1 | 40921 | # -*- coding: utf-8 -*-
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 |
leighpauls/k2cro4 | third_party/python_26/Lib/test/test_cmath.py | 55 | 18774 | from test.test_support import run_unittest
from test.test_math import parse_testfile, test_file
import unittest
import os, sys
import cmath, math
from cmath import phase, polar, rect, pi
INF = float('inf')
NAN = float('nan')
complex_zeros = [complex(x, y) for x in [0.0, -0.0] for y in [0.0, -0.0]]
complex_infinities ... | bsd-3-clause |
raboof/supybot | plugins/Nickometer/plugin.py | 9 | 9274 | ###
# Copyright (c) 2004, William Robinson.
# Derived from work (c) 1998, Adam Spiers <adam.spiers@new.ox.ac.uk>
# 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 c... | bsd-3-clause |
republic-analytics/luigi | test/contrib/hive_test.py | 5 | 15200 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify 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 law... | apache-2.0 |
ncliam/serverpos | openerp/tools/test_config.py | 456 | 1418 | # -*- coding: utf-8 -*-
""" Tests for the configuration file/command-line arguments. """
# This test should be run from its directory.
# TODO A configmanager object cannot parse multiple times a config file
# and/or the command line, preventing to 'reload' a configuration.
import os
import config
config_file_00 =... | agpl-3.0 |
havard024/prego | venv/lib/python2.7/site-packages/coffin/views/generic/dates.py | 3 | 1957 | from coffin.views.generic.detail import SingleObjectTemplateResponseMixin
from coffin.views.generic.list import MultipleObjectTemplateResponseMixin
import django.views.generic.dates as _generic_dates
class ArchiveIndexView(MultipleObjectTemplateResponseMixin, _generic_dates.BaseArchiveIndexView):
"""
Equ... | mit |
Arzaroth/virtualnetwork | network/mapParser.py | 1 | 4727 | #!/usr/bin/python3.3 -O
from pyrser import grammar,meta
from pyrser.directives import ignore
from network import Host, Router
import sys
def insensitiveCase(s):
return "[" + " ".join("['" + "'|'".join(x) + "']" for x in map((lambda each: [each.lower(), each.upper()]), s)) + "]"
class MapParser(grammar.Grammar):
... | gpl-3.0 |
michaelni/audacity | lib-src/lv2/lv2/plugins/eg03-metro.lv2/waflib/Tools/kde4.py | 275 | 2007 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,re
from waflib import Options,TaskGen,Task,Utils
from waflib.TaskGen import feature,after_method
@feature('msgfmt')
def apply_msgfmt(self):
for lang in self.to_... | gpl-2.0 |
kennethlove/django | django/db/models/related.py | 102 | 3162 | from django.utils.encoding import smart_unicode
from django.db.models.fields import BLANK_CHOICE_DASH
class BoundRelatedObject(object):
def __init__(self, related_object, field_mapping, original):
self.relation = related_object
self.field_mappings = field_mapping[related_object.name]
def templ... | bsd-3-clause |
luiscarlosgph/nas | env/lib/python2.7/site-packages/django/contrib/messages/storage/fallback.py | 704 | 2172 | from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import CookieStorage
from django.contrib.messages.storage.session import SessionStorage
class FallbackStorage(BaseStorage):
"""
Tries to store all messages in the first backend, storing any unstored
me... | mit |
dgjustice/ansible | lib/ansible/modules/database/mysql/mysql_user.py | 13 | 24121 | #!/usr/bin/python
# (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.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... | gpl-3.0 |
thnee/ansible | lib/ansible/plugins/connection/local.py | 14 | 6967 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015, 2017 Toshio Kuratomi <tkuratomi@ansible.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
co... | gpl-3.0 |
alexus37/AugmentedRealityChess | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/raw/GL/AMD/occlusion_query_event.py | 9 | 1147 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | mit |
faux123/htc-m7 | 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 |
Workday/OpenFrame | tools/grit/grit/format/resource_map_unittest.py | 26 | 10570 | #!/usr/bin/env python
# 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.
'''Unit tests for grit.format.resource_map'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.pa... | bsd-3-clause |
yyzybb537/libgo | third_party/boost.context/tools/build/test/implicit_dependency.py | 44 | 1345 | #!/usr/bin/python
# Copyright (C) Vladimir Prus 2006.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test the <implicit-dependency> is respected even if the target referred to is
# not built itself, but only re... | mit |
Immortalin/python-for-android | python-modules/twisted/twisted/web/_auth/digest.py | 53 | 1700 | # -*- test-case-name: twisted.web.test.test_httpauth -*-
# Copyright (c) 2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation of RFC2617: HTTP Digest Authentication
@see: U{http://www.faqs.org/rfcs/rfc2617.html}
"""
from zope.interface import implements
from twisted.cred import credentials... | apache-2.0 |
BeyondTheClouds/nova | nova/scheduler/filters/trusted_filter.py | 14 | 9323 | # Copyright (c) 2012 Intel, Inc.
# Copyright (c) 2011-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.o... | apache-2.0 |
alhashash/yowsup | yowsup/layers/protocol_profiles/layer.py | 31 | 2304 | from yowsup.layers import YowProtocolLayer
from .protocolentities import *
from yowsup.layers.protocol_iq.protocolentities import ErrorIqProtocolEntity, ResultIqProtocolEntity
class YowProfilesProtocolLayer(YowProtocolLayer):
def __init__(self):
handleMap = {
"iq": (self.recvIq, self.sendIq)
... | gpl-3.0 |
Jovy23/N900TUVUDNF4_KK_Kernel | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
qma/pants | src/python/pants/backend/jvm/tasks/resources_task.py | 1 | 3335 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from abc import abst... | apache-2.0 |
shingonoide/odoo | addons/l10n_be_intrastat/wizard/xml_decl.py | 32 | 17798 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2014-2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
ar45/django | django/contrib/postgres/fields/ranges.py | 124 | 5609 | import json
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range
from django.contrib.postgres import forms, lookups
from django.db import models
from django.utils import six
from .utils import AttributeSetter
__all__ = [
'RangeField', 'IntegerRangeField', 'BigIntegerRangeField',
'Floa... | bsd-3-clause |
myerpengine/odoo | install/win32/setup.py | 105 | 2541 | # -*- 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 |
valentin-krasontovitsch/ansible | lib/ansible/plugins/connection/persistent.py | 15 | 5762 | # 2017 Red Hat Inc.
# (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
DOCUMENTATION = """
author: Ansible Core Team
connection: persistent
short_description: Us... | gpl-3.0 |
JosmanPS/scikit-learn | sklearn/datasets/lfw.py | 141 | 19372 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | bsd-3-clause |
janncker/createrepo_c | tests/python/tests/test_crfile.py | 2 | 3467 | import unittest
import shutil
import tempfile
import os.path
import createrepo_c as cr
from fixtures import *
class TestCaseCrFile(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp(prefix="createrepo_ctest-")
def tearDown(self):
shutil.rmtree(self.tmpdir)
def test_crfi... | gpl-2.0 |
opennode/waldur-mastermind | src/waldur_core/structure/managers.py | 1 | 4844 | from django.db import models
from waldur_core.core.managers import GenericKeyMixin
def get_permission_subquery(permissions, user):
subquery = models.Q()
for entity in ('customer', 'project'):
path = getattr(permissions, '%s_path' % entity, None)
if not path:
continue
if p... | mit |
pytorch/fairseq | tests/test_online_backtranslation.py | 1 | 7650 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import tempfile
import unittest
from pathlib import Path
from typing import Any, Dict, Sequence
import fairseq.data.indexed_dataset as indexe... | mit |
jerryjiahaha/rts2 | scripts/rts2saf/unittest/test_db.py | 3 | 4371 | # (C) 2014, Markus Wildi, markus.wildi@bluewin.ch
#
# 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, or (at your option)
# any later version.
#
# This program is distr... | lgpl-3.0 |
rothnic/bokeh | scripts/interactive_tester.py | 43 | 9271 | from __future__ import print_function
import argparse
import importlib
import os
from shutil import rmtree
from six.moves import input
import sys
import textwrap
import time
import json
# TODO:
# catch and log exceptions in examples files that fail to open
DIRECTORIES = {
'file' : '../../examples/plottin... | bsd-3-clause |
claritylab/sirius | lucida/commandcenter/controllers/ConfigChecker.py | 3 | 1570 | from Config import *
# Check Config.py.
if MAX_DOC_NUM_PER_USER <= 0:
print 'MAX_DOC_NUM_PER_USER must be non-negative'
exit()
if not (TRAIN_OR_LOAD == 'train' or TRAIN_OR_LOAD == 'load'):
print 'TRAIN_OR_LOAD must be either train or load'
exit()
for service_name, service_obj in SERVICES.iteritems():
if not servi... | bsd-3-clause |
mkocka/galaxytea | modeling/domcek/plots.py | 1 | 4294 | import matplotlib.pyplot as plt
from numpy import *
###List of variables
# r_in [10**10 cm] innder radius
# r_out [10**10 cm] outer radius
# step [10**10 cm] step of plot
# alfa [] parameter of accretion
# M_16 [10**16 g.s**(-1)] accretion flow
# m_1 [solar mass] mass of compact object
# R_hv [10**1... | mit |
DCSaunders/tensorflow | tensorflow/contrib/learn/python/learn/estimators/stability_test.py | 20 | 4977 | # 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 |
creasyw/IMTAphy | documentation/toolchain/Pygments-0.11.1-py2.5.egg/pygments/cmdline.py | 19 | 12149 | # -*- coding: utf-8 -*-
"""
pygments.cmdline
~~~~~~~~~~~~~~~~
Command line interface.
:copyright: 2006-2008 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import sys
import getopt
from textwrap import dedent
from pygments import __version__, __author__, highlight
from pygments.... | gpl-2.0 |
jimi-c/ansible | lib/ansible/module_utils/network/enos/enos.py | 68 | 5474 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by
# Ansible still belong to the author of the module, and may assign their own
# license to the complete wo... | gpl-3.0 |
silenceli/nova | nova/scheduler/weights/metrics.py | 38 | 4448 | # Copyright (c) 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 |
yungyuc/solvcon | solvcon/parcel/vewave/tests/test_package.py | 2 | 2317 | # -*- coding: UTF-8 -*-
#
# Copyright (c) 2013, Yung-Yu Chen <yyc@solvcon.net>
#
# 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 copyrigh... | bsd-3-clause |
tvtsoft/odoo8 | addons/l10n_es/__openerp__.py | 3 | 1878 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2008-2010 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Jordi Esteve <jesteve@zikzakmedia.com>
# Copyright (c) 2012-2013, Grupo OPENTIA (<http://opentia.com>) Re... | agpl-3.0 |
wronk/mne-python | examples/forward/plot_left_cerebellum_volume_source.py | 27 | 3245 | """
==============================================
Generate a left cerebellum volume source space
==============================================
Generate a volume source space of the left cerebellum and plot its vertices
relative to the left cortical surface source space and the freesurfer
segmentation file.
"""
# A... | bsd-3-clause |
allenlavoie/tensorflow | tensorflow/contrib/data/python/ops/sliding.py | 6 | 3761 | # Copyright 2018 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 |
MobSF/Mobile-Security-Framework-MobSF | mobsf/StaticAnalyzer/views/ios/view_source.py | 1 | 5000 | # -*- coding: utf_8 -*-
"""iOS View Source."""
import io
import json
import logging
import ntpath
import os
from pathlib import Path
import biplist
from django.conf import settings
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.utils.html import escape
from mobsf.MobSF.f... | gpl-3.0 |
alexandrevicenzi/pycompat | tests/test.py | 1 | 2225 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# These tests run only under Linux and Python 2.x +
# This is the Travis CI environment.
#
from pycompat import python as py
from pycompat import system
import sys
import unittest
class TestPyCompat(unittest.TestCase):
def test_python_is_64bits(self):
se... | mit |
djvoleur/test | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/testing/test_env.py | 96 | 3084 | #!/usr/bin/env python
# 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.
"""Sets environment variables needed to run a chromium unit test."""
import os
import stat
import subprocess
import sys
# This is... | apache-2.0 |
viggates/nova | nova/servicegroup/drivers/mc.py | 2 | 4126 | # Service heartbeat driver using Memcached
# Copyright (c) 2013 Akira Yoshiyama <akirayoshiyama at gmail dot com>
#
# This is derived from nova/servicegroup/drivers/db.py.
# Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | apache-2.0 |
foxish/test-infra | gubernator/github/main_test.py | 3 | 5228 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
victoredwardocallaghan/pygments-main | tests/test_perllexer.py | 30 | 5337 | # -*- coding: utf-8 -*-
"""
Pygments regex lexer tests
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import time
import unittest
from pygments.token import String
from pygments.lexers.agile import PerlLexer
... | bsd-2-clause |
JonGal/appengine-ml-demo | app/lib/rsa/util.py | 96 | 3059 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... | apache-2.0 |
himleyb85/django | django/db/backends/sqlite3/base.py | 17 | 18191 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends import utils ... | bsd-3-clause |
srimai/odoo | addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py | 337 | 3655 | # -*- 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 |
privateip/ansible-modules-core | source_control/subversion.py | 2 | 8872 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | gpl-3.0 |
mitsuhiko/zine | zine/utils/exceptions.py | 1 | 1632 | # -*- coding: utf-8 -*-
"""
zine.utils.exceptions
~~~~~~~~~~~~~~~~~~~~~
Exception utility module.
:copyright: (c) 2010 by the Zine Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from zine.i18n import _
class ZineException(Exception):
"""Baseclass for all... | bsd-3-clause |
kasperschmidt/TDOSE | tdose_extract_spectra.py | 1 | 43824 | # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
import numpy as np
import sys
import astropy.io.fits as afits
import collections
import tdose_utilities as tu
import tdose_extract_spectra as tes
import tdose_build_mock_cube as tbmc
import pdb
import scipy.ndi... | mit |
imtapps/django-imt-fork | tests/regressiontests/model_formsets_regress/tests.py | 44 | 16775 | from __future__ import absolute_import, unicode_literals
from django import forms
from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME
from django.forms.util import ErrorDict, ErrorList
from django.forms.models import modelform_factory, inlineformset_factory, modelformset_factory, BaseModelFormSet
from d... | bsd-3-clause |
geekboxzone/mmallow_external_skia | tools/find_bad_images_in_skps.py | 172 | 7405 | #!/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.
"""
This script will take as an argument either a list of skp files or a
set of directories that contains skp files. It will then test each
skp... | bsd-3-clause |
wilvk/ansible | test/units/modules/network/eos/eos_module.py | 73 | 3143 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
rgerkin/inspyred | examples/advanced/tsp_ec_example.py | 4 | 1716 | from random import Random
from time import time
import math
import inspyred
def main(prng=None, display=False):
if prng is None:
prng = Random()
prng.seed(time())
points = [(110.0, 225.0), (161.0, 280.0), (325.0, 554.0), (490.0, 285.0),
(157.0, 443.0), (283.0, 379.... | gpl-3.0 |
waseem18/oh-mainline | vendor/packages/python-social-auth/social/tests/backends/test_yahoo.py | 76 | 2535 | import json
import requests
from httpretty import HTTPretty
from social.p3 import urlencode
from social.tests.backends.oauth import OAuth1Test
class YahooOAuth1Test(OAuth1Test):
backend_path = 'social.backends.yahoo.YahooOAuth'
user_data_url = 'https://social.yahooapis.com/v1/user/a-guid/profile?' \
... | agpl-3.0 |
bmcfee/gordon | scripts/mbrainz_import.py | 1 | 6643 | #! /usr/bin/env python
# Copyright (C) 2010 Douglas Eck
#
# This file is part of Gordon.
#
# Gordon 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 l... | gpl-3.0 |
mcardillo55/django | tests/user_commands/tests.py | 205 | 7165 | import os
from django.apps import apps
from django.core import management
from django.core.management import BaseCommand, CommandError, find_commands
from django.core.management.utils import find_command, popen_wrapper
from django.db import connection
from django.test import SimpleTestCase, ignore_warnings, override_s... | bsd-3-clause |
totallybradical/temp_servo2 | tests/wpt/web-platform-tests/tools/pytest/doc/en/genapi.py | 203 | 1131 | import textwrap
import inspect
class Writer:
def __init__(self, clsname):
self.clsname = clsname
def __enter__(self):
self.file = open("%s.api" % self.clsname, "w")
return self
def __exit__(self, *args):
self.file.close()
print "wrote", self.file.name
def line... | mpl-2.0 |
tboyce021/home-assistant | tests/components/config/test_automation.py | 1 | 5030 | """Test Automation config panel."""
import json
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
from tests.async_mock import patch
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa
async def test_get_device_config(hass, hass_client)... | apache-2.0 |
mbeyeler/pulse2percept | examples/implants/plot_custom_electrode_array.py | 1 | 6434 | """
============================================================================
Creating your own electrode array
============================================================================
This example shows how to create a new
:py:class:`~pulse2percept.implants.ElectrodeArray` object.
As the base class for all el... | bsd-3-clause |
mbr0wn/gnuradio | gr-digital/examples/narrowband/benchmark_add_channel.py | 6 | 3590 | #!/usr/bin/env python
#
# Copyright 2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import channels, gr
from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse imp... | gpl-3.0 |
cloudera/hue | desktop/core/ext-py/protobuf-3.13.0/google/protobuf/test_messages_proto2_pb2.py | 3 | 135641 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/test_messages_proto2.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message a... | apache-2.0 |
MaxVanDeursen/tribler | Tribler/Test/Core/Modules/RestApi/test_torrents_endpoint.py | 2 | 7299 | import json
import time
from twisted.internet.defer import inlineCallbacks
from Tribler.Core.TorrentChecker.torrent_checker import TorrentChecker
from Tribler.Core.Utilities.network_utils import get_random_port
from Tribler.Core.simpledefs import NTFY_CHANNELCAST, NTFY_TORRENTS
from Tribler.Test.Core.Modules.RestApi.b... | lgpl-3.0 |
romain-dartigues/ansible | lib/ansible/modules/packaging/os/swupd.py | 5 | 8754 | #!/usr/bin/python
# (c) 2017, Alberto Murillo <alberto.murillo.silva@intel.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
DONIKAN/django | django/core/serializers/python.py | 140 | 7685 | """
A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from django.apps import apps
from django.conf impor... | bsd-3-clause |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/sklearn/manifold/spectral_embedding_.py | 10 | 19912 | """Spectral Embedding"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse
from scipy.linalg import eigh
from scipy.sparse.linalg import lobpcg
from ..base import BaseEstimator
from ..ext... | gpl-2.0 |
tectronics/mythbox | resources/lib/zope.interface/zope/interface/declarations.py | 11 | 40956 | ##############################################################################
# Copyright (c) 2003 Zope Corporation 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 SOFT... | gpl-2.0 |
darkleons/BE | addons/website_customer/controllers/main.py | 64 | 4267 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.website.models.website import unslug
from openerp.tools.translate import _
from openerp.addons.web.http import request
import werkzeug.urls
class WebsiteCustomer(http.Controller):
_refere... | agpl-3.0 |
phantomnat/crazy-bike-client | lib/cfclient/utils/guiconfig.py | 24 | 2174 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___... | gpl-2.0 |
tpodowd/boto | tests/integration/route53/test_alias_resourcerecordsets.py | 113 | 4876 | # Copyright (c) 2014 Netflix, Inc. Stefan Praszalowicz
# Copyright (c) 2014 42Lines, Inc. Jim Browne
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without... | mit |
asterix135/whoshouldivotefor | explorer/migrations/0008_auto_20170627_0253.py | 1 | 1741 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-27 06:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('explorer', '0007_auto_20170626_0543'),
]
operation... | mit |
suiyuan2009/tensorflow | tensorflow/contrib/tpu/python/tpu/tpu_feed.py | 15 | 25641 | # 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 |
stverhae/incubator-airflow | airflow/operators/check_operator.py | 42 | 9423 | # -*- coding: utf-8 -*-
#
# 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 |
JerryWong0119/CocosBuilder-3.0-alpha5 | CocosBuilder/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 107 | 43862 | # Copyright (c) 2012 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.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | mit |
diagramsoftware/odoo | addons/l10n_ch/__init__.py | 424 | 1212 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Financial contributors: Hasa SA, Open Net SA,
# Prisme Solutions Informatique SA, Quod SA
#
# Translation contributors: brain-te... | agpl-3.0 |
ryfeus/lambda-packs | pytorch/source/numpy/polynomial/__init__.py | 18 | 1134 | """
A sub-package for efficiently dealing with polynomials.
Within the documentation for this sub-package, a "finite power series,"
i.e., a polynomial (also referred to simply as a "series") is represented
by a 1-D numpy array of the polynomial's coefficients, ordered from lowest
order term to highest. For example, a... | mit |
Geoportail-Luxembourg/geoportailv3 | geoportal/geoportailv3_geoportal/scripts/db2es.py | 1 | 3233 | # -*- coding: utf-8 -*-
from pyramid.paster import bootstrap
import psycopg2
from psycopg2.extras import DictCursor
import sys
import getopt
import json
from elasticsearch import helpers
from elasticsearch.helpers import BulkIndexError
from elasticsearch.exceptions import ConnectionTimeout
from geoportailv3_geoportal.... | mit |
Jgarcia-IAS/localizacion | openerp/addons-extra/odoo-pruebas/odoo-server/addons/web/doc/conf.py | 494 | 8552 | # -*- coding: utf-8 -*-
#
# OpenERP Technical Documentation configuration file, created by
# sphinx-quickstart on Fri Feb 17 16:14:06 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | agpl-3.0 |
hradec/gaffer | python/GafferImageTest/ImageTestCase.py | 2 | 6622 | ##########################################################################
#
# Copyright (c) 2015, 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 |
boa19861105/Butterfly-Kernel | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
dlsun/symbulate | symbulate/index_sets.py | 1 | 1353 | import numbers
class IndexSet(object):
def __init__(self):
return
def __getitem__(self, t):
if t in self:
return t
else:
raise KeyError("Time %.2f not in index set." % t)
def __contains__(self, value):
return False
def __eq__(self, other):
... | mit |
kurikaesu/arsenalsuite | cpp/lib/PyQt4/pyuic/uic/exceptions.py | 27 | 2169 | #############################################################################
##
## Copyright (C) 2011 Riverbank Computing Limited.
## Copyright (C) 2006 Thorsten Marek.
## All right reserved.
##
## This file is part of PyQt.
##
## You may use this file under the terms of the GPL v2 or the revised BSD
## license as fol... | gpl-2.0 |
regisf/Strawberry | strawberrylib/blueprints/__init__.py | 1 | 1171 | # -*- coding: utf-8 -*-
# Strawberry Blog Engine
#
# Copyright (c) 2014 Regis FLORET
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the ri... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.