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 |
|---|---|---|---|---|---|
prutseltje/ansible | lib/ansible/modules/network/aci/aci_interface_policy_leaf_policy_group.py | 4 | 18307 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.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_... | gpl-3.0 |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/vta/tests/python/integration/test_benchmark_gemm.py | 2 | 12873 | # 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 |
adedayo/intellij-community | python/lib/Lib/site-packages/django/template/loader_tags.py | 73 | 10511 | from django.template.base import TemplateSyntaxError, TemplateDoesNotExist, Variable
from django.template.base import Library, Node, TextNode
from django.template.context import Context
from django.template.defaulttags import token_kwargs
from django.template.loader import get_template
from django.conf import settings
... | apache-2.0 |
Lokke/eden | tests/unit_tests/modules/s3/s3gis/GeoRSSLayer.py | 43 | 2220 |
s3gis_tests = load_module("tests.unit_tests.modules.s3.s3gis")
def test_GeoRSSLayer():
# use debug to show up errors
# without debug, errors get to be turned into session warnings
# and the layer skipped altogether. No datastructure.
url = "test://test_GeoRSS"
current.request.utcnow = datetime.dat... | mit |
cloudbase/nova | nova/tests/unit/api/openstack/compute/test_limits.py | 3 | 9591 | # Copyright 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 requ... | apache-2.0 |
SnappleCap/oh-mainline | vendor/packages/Django/django/core/management/commands/testserver.py | 307 | 2006 | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noinput', action='store_false', dest='interactive', default=True,
help='Tells Django to NOT prompt the user for input of any... | agpl-3.0 |
Timmenem/micropython | ports/cc3200/tools/update-wipy.py | 67 | 7022 | #!/usr/bin/env python
"""
The WiPy firmware update script. Transmits the specified firmware file
over FTP, and then resets the WiPy and optionally verifies that software
was correctly updated.
Usage:
./update-wipy.py --file "path_to_mcuimg.bin" --verify
Or:
python update-wipy.py --file "path_to_mcuimg.bin"... | mit |
linsalrob/EdwardsLab | mongodb/load_models.py | 1 | 1140 | """
Create a mongo database if it doesn't exist and load a bunch of data into it.
We need a directory with one or more JSON files in it. We look for JSON on the end of the filename.
e.g. python load_models.py -d /data/Genotype-Phenotype-Modeling/models/Citrobacter/Citrobacter/models/ -n fba_models -c citrobacter
"""
... | mit |
neuhofmo/RecBlast | RecBlastUtils.py | 1 | 10025 | #! /usr/bin/env python2
# A set of tools, functions, aliases and more used in RecBlast.
import os
import tarfile
import zipfile
from time import strftime, sleep
import re
import subprocess
from Bio import Entrez
import shutil
Entrez.email = "recblast@gmail.com"
Entrez.tool = "RecBlast"
TEMP_FILES_PATH = os.getcwd()
... | mit |
andrei-karalionak/ggrc-core | src/ggrc_workflows/migrations/versions/20160104135243_13e52f6a9deb_add_finished_verified_dates_to_cycle_.py | 7 | 1120 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Add finished/verified dates to cycle tasks
Revision ID: 13e52f6a9deb
Revises: 18bdb0671010
Create Date: 2016-01-04 13:52:43.017848
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dia... | apache-2.0 |
seanfisk/lsf-ibutils | docs/source/conf.py | 1 | 8703 | # -*- coding: utf-8 -*-
#
# This file is based upon the file generated by sphinx-quickstart. However,
# where sphinx-quickstart hardcodes values in this file that you input, this
# file has been changed to pull from your module's metadata module.
#
# This file is execfile()d with the current directory set to its contai... | mit |
chitr/neutron | neutron/db/migration/alembic_migrations/versions/1955efc66455_weight_scheduler.py | 47 | 1036 | # Copyright 2015 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 applicable law ... | apache-2.0 |
lkl/lkl-linux-2.6 | tools/perf/scripts/python/syscall-counts-by-pid.py | 944 | 1744 | # 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
import sys
sys.path.append(... | gpl-2.0 |
vmpstr/trace-viewer | third_party/closure_linter/closure_linter/common/simplefileflags.py | 285 | 5107 | #!/usr/bin/env python
#
# Copyright 2008 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 |
bettiolo/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/__init__.py | 137 | 17502 | #!/usr/bin/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.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
# Default debug modes for GYP
debug = {}
# List ... | bsd-3-clause |
XperiaSTE/android_external_bluetooth_bluez | test/bluezutils.py | 90 | 1567 | import dbus
SERVICE_NAME = "org.bluez"
ADAPTER_INTERFACE = SERVICE_NAME + ".Adapter1"
DEVICE_INTERFACE = SERVICE_NAME + ".Device1"
def get_managed_objects():
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("org.bluez", "/"),
"org.freedesktop.DBus.ObjectManager")
return manager.GetManagedObjects(... | gpl-2.0 |
TeachAtTUM/edx-platform | lms/djangoapps/courseware/access_response.py | 17 | 4973 | """
This file contains all the classes used by has_access for error handling
"""
from django.utils.translation import ugettext as _
from xmodule.course_metadata_utils import DEFAULT_START_DATE
class AccessResponse(object):
"""Class that represents a response from a has_access permission check."""
def __init... | agpl-3.0 |
brint/cloud-init | cloudinit/distros/gentoo.py | 7 | 5468 | # vi: ts=4 expandtab
#
# Copyright (C) 2014 Rackspace, US Inc.
#
# Author: Nate House <nathan.house@rackspace.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
#... | gpl-3.0 |
dcroc16/skunk_works | google_appengine/lib/django-1.3/django/contrib/webdesign/lorem_ipsum.py | 439 | 4872 | """
Utility functions for generating "lorem ipsum" Latin text.
"""
import random
COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo con... | mit |
SA313161/ardupilot | mk/PX4/Tools/genmsg/test/test_genmsg_gentools.py | 215 | 9526 | #!/usr/bin/env python
# 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... | gpl-3.0 |
samkariu/voicex | voicex/migrations/0001_initial.py | 2 | 7576 | # -*- 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 model 'Post'
db.create_table('posts', (
('id', self.gf('django.db.models.fields.AutoFie... | mit |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/univention/udm_user.py | 29 | 21233 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# Copyright (c) 2016, Adfinis SyGroup AG
# Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch>
# 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
... | bsd-3-clause |
tobyclemson/terraform-aws-vpc-auto-peering | lambdas/auto_peering/auto_peering/vpc_peering_routes.py | 1 | 4260 | from botocore.exceptions import ClientError
class VPCPeeringRoutes(object):
def __init__(self, vpc1, vpc2,
vpc_peering_relationship,
ec2_gateways, logger):
self.vpc1 = vpc1
self.vpc2 = vpc2
self.vpc_peering_relationship = vpc_peering_relationship
s... | mit |
PopCap/GameIdea | Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/makegw/makegw.py | 18 | 16995 | """Utility functions for writing out gateway C++ files
This module will generate a C++/Python binding for a specific COM
interface.
At this stage, no command line interface exists. You must start Python,
import this module, change to the directory where the generated code should
be written, and run the... | bsd-2-clause |
IAmWave/trinerdi-icpc | lib/googletest/test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mit |
instinct-vfx/rez | src/rez/vendor/packaging/utils.py | 62 | 1520 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import re
from .version import InvalidVersion, Version
_canonicalize_re... | lgpl-3.0 |
fzheng/codejam | lib/python2.7/site-packages/pygments/lexers/theorem.py | 22 | 19030 | # -*- coding: utf-8 -*-
"""
pygments.lexers.theorem
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for theorem-proving languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, default, words
from py... | mit |
mcus/SickRage | sickbeard/providers/bluetigers.py | 3 | 6075 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Author: echel0n <sickrage.tv@gmail.com>
# URL: http://www.github.com/sickragetv/sickrage/
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | gpl-3.0 |
odooindia/odoo | addons/crm_helpdesk/crm_helpdesk.py | 8 | 7478 | # -*- 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 |
Kalyzee/edx-platform | cms/djangoapps/contentstore/views/tests/test_credit_eligibility.py | 121 | 2954 | """
Unit tests for credit eligibility UI in Studio.
"""
import mock
from contentstore.tests.utils import CourseTestCase
from contentstore.utils import reverse_course_url
from xmodule.modulestore.tests.factories import CourseFactory
from openedx.core.djangoapps.credit.api import get_credit_requirements
from openedx.c... | agpl-3.0 |
indictranstech/buyback-erp | erpnext/controllers/buying_controller.py | 7 | 13466 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt, rounded
from erpnext.setup.utils import get_company_currency
from erpnext... | agpl-3.0 |
Wattpad/dd-agent | tests/core/test_service_discovery.py | 4 | 27446 | # stdlib
import copy
import mock
import unittest
# 3p
from nose.plugins.attrib import attr
# project
from utils.service_discovery.config_stores import get_config_store
from utils.service_discovery.consul_config_store import ConsulStore
from utils.service_discovery.etcd_config_store import EtcdStore
from utils.service... | bsd-3-clause |
billy-inn/scikit-learn | examples/linear_model/lasso_dense_vs_sparse_data.py | 348 | 1862 | """
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | bsd-3-clause |
stephen144/odoo | openerp/addons/base/ir/ir_ui_menu.py | 30 | 14357 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import operator
import re
import threading
import openerp
from openerp.osv import fields, osv
from openerp import api, tools
from openerp.http import request
from openerp.tools.safe_eval import safe_eval a... | agpl-3.0 |
mweisman/QGIS | python/plugins/db_manager/db_manager.py | 5 | 13145 | # -*- 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 |
klickagent/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/factory_unittest.py | 118 | 3965 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
firerszd/kbengine | kbe/res/scripts/common/Lib/test/test_multibytecodec.py | 72 | 9977 | #
# test_multibytecodec.py
# Unit test for multibytecodec itself
#
from test import support
from test.support import TESTFN
import unittest, io, codecs, sys, os
import _multibytecodec
ALL_CJKENCODINGS = [
# _codecs_cn
'gb2312', 'gbk', 'gb18030', 'hz',
# _codecs_hk
'big5hkscs',
# _codecs_jp
'cp932', 'shi... | lgpl-3.0 |
openhatch/oh-mainline | mysite/search/migrations/0021_remove_icon_for_profile_since_we_realized_we_do_not_need_it.py | 17 | 3787 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | agpl-3.0 |
broxtronix/distributed | distributed/tests/test_joblib.py | 2 | 1853 | from __future__ import print_function, division, absolute_import
import pytest
from random import random
from time import sleep
from distributed.utils_test import inc, cluster, loop
backend = pytest.importorskip('distributed.joblib')
joblibs = [backend.joblib, backend.sk_joblib]
def slow_raise_value_error(conditio... | bsd-3-clause |
chrish42/pylearn | pylearn2/sandbox/cuda_convnet/tests/test_common.py | 49 | 2802 | __authors__ = "Ian Goodfellow, David Warde-Farley"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow, David Warde-Farley"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
from pylearn2.testing.skip import skip_if_no_gpu
skip_if_... | bsd-3-clause |
sdh11/gnuradio | grc/converter/block.py | 3 | 8171 | # Copyright 2016 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# GNU Radio Companion 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) a... | gpl-3.0 |
trevorlinton/skia | bench/bench_util.py | 29 | 11022 | '''
Created on May 19, 2011
@author: bungeman
'''
import re
import math
# bench representation algorithm constant names
ALGORITHM_AVERAGE = 'avg'
ALGORITHM_MEDIAN = 'med'
ALGORITHM_MINIMUM = 'min'
ALGORITHM_25TH_PERCENTILE = '25th'
# Regular expressions used throughout.
PER_SETTING_RE = '([^\s=]+)(?:=(\S+))?'
SETTI... | bsd-3-clause |
dumengnanbuaa/awesome-python-webapp | www/config.py | 17 | 1202 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Configuration
'''
__author__ = 'Michael Liao'
import config_default
class Dict(dict):
'''
Simple dict but support access as x.y style.
'''
def __init__(self, names=(), values=(), **kw):
super(Dict, self).__init__(**kw)
for k, v in zip... | gpl-2.0 |
LuoZijun/uOffice | temp/pydocxx/tests/oxml/unitdata/text.py | 10 | 3187 | # encoding: utf-8
"""
Test data builders for text XML elements
"""
from ...unitdata import BaseBuilder
from .shared import CT_OnOffBuilder, CT_StringBuilder
class CT_BrBuilder(BaseBuilder):
__tag__ = 'w:br'
__nspfxs__ = ('w',)
__attrs__ = ('w:type', 'w:clear')
class CT_EmptyBuilder(BaseBuilder):
_... | gpl-3.0 |
temasek/android_external_chromium_org | chrome/common/extensions/docs/server2/features_utility_test.py | 26 | 2661 | #!/usr/bin/env python
# Copyright 2013 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.
import unittest
from features_utility import Parse, Filtered, MergedWith
class FeaturesUtilityTest(unittest.TestCase):
def testFrom... | bsd-3-clause |
diascreative/opencore | opencore/views/files.py | 4 | 2160 | # Copyright (C) 2008-2009 Open Society Institute
# Thomas Moroz: tmoroz.org
# 2010-2011 Large Blue
# Fergus Doyle: fergus.doyle@largeblue.com
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License Version ... | gpl-2.0 |
yg257/Pangea | templates/root/ec2/lib/boto-2.34.0/boto/ses/__init__.py | 131 | 2013 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Harry Marr http://hmarr.com/
#
# 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
# wit... | apache-2.0 |
dhoffman34/django | django/template/defaulttags.py | 1 | 52686 | """Default tags used by the template system, available to all templates."""
from __future__ import unicode_literals
import os
import sys
import re
from datetime import datetime
from itertools import groupby, cycle as itertools_cycle
import warnings
from django.conf import settings
from django.template.base import (No... | bsd-3-clause |
mgit-at/ansible | lib/ansible/modules/network/onyx/onyx_magp.py | 66 | 7830 | #!/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 |
pshen/ansible | test/runner/lib/cloud/aws.py | 58 | 3311 | """AWS plugin for integration tests."""
from __future__ import absolute_import, print_function
import os
from lib.util import (
ApplicationError,
display,
is_shippable,
)
from lib.cloud import (
CloudProvider,
CloudEnvironment,
)
from lib.core_ci import (
AnsibleCoreCI,
)
class AwsCloudPro... | gpl-3.0 |
kamalx/edx-platform | common/djangoapps/student/roles.py | 30 | 11451 | """
Classes used to model the roles used in the courseware. Each role is responsible for checking membership,
adding users, removing users, and listing members
"""
from abc import ABCMeta, abstractmethod
from django.contrib.auth.models import User
import logging
from student.models import CourseAccessRole
from xmodu... | agpl-3.0 |
mattcongy/itshop | docker-images/taigav2/taiga-back/taiga/events/events.py | 1 | 3483 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | mit |
kivymd/KivyMD | kivymd/uix/banner.py | 1 | 11889 | """
Components/Banner
=================
.. seealso::
`Material Design spec, Banner <https://material.io/components/banners>`_
.. rubric:: A banner displays a prominent message and related optional actions.
.. image:: https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/banner.png
:align: c... | mit |
HadiOfBBG/pegasusrises | gdata/tlslite/integration/HTTPTLSConnection.py | 271 | 6668 | """TLS Lite + httplib."""
import socket
import httplib
from gdata.tlslite.TLSConnection import TLSConnection
from gdata.tlslite.integration.ClientHelper import ClientHelper
class HTTPBaseTLSConnection(httplib.HTTPConnection):
"""This abstract class provides a framework for adding TLS support
to httplib."""
... | apache-2.0 |
sfagmenos/ker | tools/perf/util/setup.py | 766 | 1540 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
mpattyn/fumiste | prototypePython/steamapi/requests/adapters.py | 10 | 14863 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib3.response impo... | mit |
shesselba/linux-berlin | tools/perf/scripts/python/futex-contention.py | 1997 | 1508 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/testfixtures/tests/test_roundcomparison.py | 2 | 5182 | # Copyright (c) 2014 Simplistix Ltd
# See license.txt for license details.
from decimal import Decimal
from testfixtures import RoundComparison as R, compare, ShouldRaise
from unittest import TestCase
from ..compat import PY2, PY3
class Tests(TestCase):
def test_equal_yes_rhs(self):
self.assertTrue(0.12... | agpl-3.0 |
40223210/w16b_test | static/Brython3.1.1-20150328-091302/Lib/collections/__init__.py | 625 | 25849 | #__all__ = ['deque', 'defaultdict', 'Counter']
from _collections import deque, defaultdict
#from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
'UserString', 'Counter', 'OrderedDict']
# For bootstrapping re... | gpl-3.0 |
woodpecker1/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/server_process_unittest.py | 121 | 5514 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
itkvideo/ITK | Modules/Nonunit/IntegratedTest/test/itkCurvatureFlowTestPython2.py | 41 | 3475 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | apache-2.0 |
csieg/ardupilot | libraries/AP_Math/tools/geodesic_grid/geodesic_grid.py | 89 | 8697 | #!/usr/bin/python
# Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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 v... | gpl-3.0 |
chfoo/wpull | wpull/application/plugin_test.py | 1 | 1250 | import unittest
from wpull.application.plugin import WpullPlugin, hook, event, InterfaceRegistry, \
event_interface, PluginClientFunctionInfo, PluginFunctionCategory
class MockPlugin(WpullPlugin):
@hook('hook_thing')
def my_hook_callback(self):
pass
@event('event_thing')
def my_event_cal... | gpl-3.0 |
Rademade/taiga-back | taiga/base/api/templatetags/api.py | 3 | 9932 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | agpl-3.0 |
facebookresearch/fastText | python/doc/examples/bin_to_vec.py | 1 | 1120 | #!/usr/bin/env python
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_fu... | mit |
haeusser/tensorflow | tensorflow/python/kernel_tests/dynamic_stitch_op_test.py | 77 | 6501 | # 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 |
tersmitten/ansible | test/units/modules/storage/netapp/test_na_ontap_qos_policy_group.py | 45 | 12789 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... | gpl-3.0 |
whausen/part | src/adhocracy/lib/text/mdx_showmore.py | 1 | 2762 | """Showmore extension for Markdown.
To hide something with [more...], surround the corresponding text with triple
parentheses, e.g. (((text_to_be_hidden))).
In order to show the text, you have to include the following Javascript in your
code, which depends on the availability of jquery.
$('.showmore').each(funct... | agpl-3.0 |
bobthekingofegypt/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/etree.py | 658 | 4613 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import gettext
_ = gettext.gettext
import re
from six import text_type
from . im... | mpl-2.0 |
dcsquared13/Diamond | src/collectors/interrupt/test/testsoft.py | 31 | 3042 | #!/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:
fr... | mit |
chdecultot/erpnext | erpnext/patches/v11_0/change_healthcare_desktop_icons.py | 4 | 2450 | import frappe
from frappe import _
change_icons_map = [
{
"module_name": "Patient",
"color": "#6BE273",
"icon": "fa fa-user",
"doctype": "Patient",
"type": "link",
"link": "List/Patient",
"label": _("Patient")
},
{
"module_name": "Patient Encounter",
"color": "#2ecc71",
"icon": "fa fa-stethoscop... | gpl-3.0 |
jszymon/pacal | pacal/__init__.py | 1 | 3420 | """PaCal, the probabilistic calculator."""
from __future__ import print_function
from . import params
import numpy as _np
from pylab import show
_np.seterr(all="ignore")
from .utils import Inf
from .distr import DiscreteDistr
from .distr import exp, log, atan, min, max, sqrt, sign, sin, cos, tan, tanh, sigmoid
f... | gpl-3.0 |
arhik/nupic | src/nupic/frameworks/opf/opfhelpers.py | 39 | 3728 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
yvaucher/vertical-ngo | logistic_requisition/wizard/assign_line.py | 3 | 1508 | # -*- coding: utf-8 -*-
#
#
# Copyright 2013-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any... | agpl-3.0 |
omnirom/android_external_chromium-org | tools/code_coverage/croc_scan.py | 178 | 4383 | # Copyright (c) 2011 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.
"""Crocodile source scanners."""
import re
class Scanner(object):
"""Generic source scanner."""
def __init__(self):
"""Constructor."""
... | bsd-3-clause |
arborh/tensorflow | tensorflow/python/training/session_manager.py | 4 | 22050 | # 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 |
andreparames/odoo | addons/hr_timesheet_invoice/report/report_analytic.py | 299 | 5164 | # -*- 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 |
xtiankisutsa/MARA_Framework | tools/androwarn/androwarn/core/core.py | 1 | 16646 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of Androwarn.
#
# Copyright (C) 2012, Thomas Debize <tdebize at mail.com>
# All rights reserved.
#
# Androwarn is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Fr... | lgpl-3.0 |
Mhynlo/SickRage | lib/github/Label.py | 72 | 4251 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
florentchandelier/zipline | tests/data/bundles/test_csvdir.py | 1 | 5092 | from __future__ import division
import numpy as np
import pandas as pd
from zipline.utils.calendars import get_calendar
from zipline.data.bundles import ingest, load, bundles
from zipline.testing import test_resource_path
from zipline.testing.fixtures import ZiplineTestCase
from zipline.testing.predicates import asse... | apache-2.0 |
rafaelolg/django-guardian | guardian/migrations/0004_auto__del_field_groupobjectpermission_object_id__del_unique_groupobjec.py | 31 | 8186 | # encoding: 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):
# Changing field 'GroupObjectPermission.object_pk'
db.alter_column('guardian_groupobjectpermission', 'obje... | bsd-2-clause |
lunafeng/django | django/db/backends/postgresql/operations.py | 207 | 10109 | from __future__ import unicode_literals
from psycopg2.extras import Inet
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def unification_cast_sql(self, output_field):
internal_type = output_field.get... | bsd-3-clause |
fxia22/ASM_xf | PythonD/site_python/twisted/protocols/oscar.py | 2 | 43247 | # Twisted, the Framework of Your Internet
# Copyright (C) 2001 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the... | gpl-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/lib2to3/fixes/fix_intern.py | 315 | 1405 | # Copyright 2006 Georg Brandl.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for intern().
intern(s) -> sys.intern(s)"""
# Local imports
from .. import pytree
from .. import fixer_base
from ..fixer_util import Name, Attr, touch_import
class FixIntern(fixer_base.BaseFix):
BM_compatible = True
or... | mit |
EricMuller/mynotes-backend | requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/test/iosim.py | 12 | 17684 | # -*- test-case-name: twisted.test.test_amp,twisted.test.test_iosim -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utilities and helpers for simulating a network
"""
from __future__ import absolute_import, division, print_function
import itertools
try:
from OpenSSL.SSL import Er... | mit |
longmen21/edx-platform | common/djangoapps/third_party_auth/admin.py | 14 | 5780 | # -*- coding: utf-8 -*-
"""
Admin site configuration for third party authentication
"""
from django import forms
from django.contrib import admin
from config_models.admin import ConfigurationModelAdmin, KeyedConfigurationModelAdmin
from .models import (
OAuth2ProviderConfig,
SAMLProviderConfig,
SAMLConfig... | agpl-3.0 |
milankl/swm | calc/misc/c_diss_plot.py | 1 | 3966 | from __future__ import print_function
path = '/home/mkloewer/python/swm/'
import os; os.chdir(path) # change working directory
import numpy as np
from scipy import sparse
import time as tictoc
from netCDF4 import Dataset
import glob
import matplotlib.pyplot as plt
# OPTIONS
runfolder = [2,3]
## read data
for r,i in z... | gpl-3.0 |
ArthurGarnier/SickRage | lib/sqlalchemy/dialects/mysql/types.py | 8 | 25137 | # mysql/types.py
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import datetime
from ... import exc, util
from ... import types as sqltypes
class _... | gpl-3.0 |
geoffreyporto/radartec | node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # Copyright (c) 2011 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | agpl-3.0 |
apache/thrift | lib/py/src/transport/TSocket.py | 7 | 9123 | #
# 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 |
h-matsuo/memTracker | lib/track.py | 1 | 8958 | #!/usr/bin/python
# coding: UTF-8
"""
Implementation of command: track
"""
__author__ = "Hiroyuki Matsuo <h-matsuo@ist.osaka-u.ac.jp>"
# ===== Configuration ==========================================================
# ----- Disk I/O tracking ------------------------------------------------------
#DEVICE_NAME = "mm... | mit |
broferek/ansible | test/lib/ansible_test/_data/sanity/pylint/plugins/deprecated.py | 17 | 3851 | # (c) 2018, Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from distutils.version import LooseVersion
import astroid
from pylint.in... | gpl-3.0 |
salamer/django | tests/extra_regress/models.py | 281 | 1401 | from __future__ import unicode_literals
import copy
import datetime
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class RevisionableModel(models.Model):
base = models.ForeignKey('self', models.S... | bsd-3-clause |
amar266/puppet-rjil | files/tests/ceph_health.py | 31 | 4048 | #!/usr/bin/env python
#
# Copyright (c) 2013 SWITCH http://www.switch.ch
#
# 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 re... | apache-2.0 |
bruecksen/isimip | isi_mip/climatemodels/migrations/0088_attachment.py | 1 | 1304 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-26 14:51
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import isi_mip.climatemodels.models
class Migration(migrations.Migration):
dependencies = [
('climatemodels', '0087_... | mit |
stelfrich/openmicroscopy | components/tools/OmeroCpp/ext/gtest-1.7.0/test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 |
pratikmallya/hue | desktop/core/ext-py/elementtree/elementtree/XMLTreeBuilder.py | 107 | 3744 | #
# ElementTree
# $Id: XMLTreeBuilder.py 2305 2005-03-01 17:43:09Z fredrik $
#
# an XML tree builder
#
# history:
# 2001-10-20 fl created
# 2002-05-01 fl added namespace support for xmllib
# 2002-07-27 fl require expat (1.5.2 code can use SimpleXMLTreeBuilder)
# 2002-08-17 fl use tag/attribute name memo cache
#... | apache-2.0 |
anthonydillon/horizon | openstack_dashboard/dashboards/admin/metering/tables.py | 13 | 3288 | # 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
# d... | apache-2.0 |
HackerBaloo/SublimeOpenInTotalCommander | Open in Total Commander.py | 1 | 2176 | import os
import os.path
import subprocess
import sublime
import sublime_plugin
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
def which(program):
fpath, fname = os.path.split(program)
if fpath:
if is_exe(program):
return program
e... | mit |
dparnell/rethinkdb | external/gtest_1.7.0/test/gtest_color_test.py | 3259 | 4911 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.