repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
girving/tensorflow | tensorflow/python/framework/errors_test.py | 16 | 5501 | # 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 |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_isn/state/__init__.py | 1 | 98243 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 |
joshbohde/scikit-learn | examples/document_clustering.py | 1 | 3008 | """
===============================================
Clustering text documents using MiniBatchKmeans
===============================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store ... | bsd-3-clause |
direvus/ansible | lib/ansible/plugins/action/netconf.py | 19 | 3542 | #
# Copyright 2018 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.
#
# Ansibl... | gpl-3.0 |
idaholab/raven | framework/UI/SensitivityView.py | 2 | 21972 | # Copyright 2017 Battelle Energy Alliance, LLC
#
# 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 t... | apache-2.0 |
knoguchi/kenix-scm | server/lib/boto/dynamodb2/layer1.py | 11 | 81650 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 rights ... | apache-2.0 |
jordiclariana/ansible | lib/ansible/plugins/lookup/lastpass.py | 122 | 2519 | # (c) 2016, Andrew Zenk <azenk@umn.edu>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... | gpl-3.0 |
MortimerGoro/servo | components/script/dom/bindings/codegen/parser/tests/test_securecontext_extended_attribute.py | 113 | 16702 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
[SecureContext]
interface TestSecureContextOnInterface {
const octet TEST_CONSTANT = 0;
readonly attribute byte testAttribute;
void testMethod(byte foo);
};
partial interface TestSecureCont... | mpl-2.0 |
sysadmin75/ansible | lib/ansible/playbook/attribute.py | 68 | 4639 | # (c) 2012-2014, 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 the License, or
# (at your option) an... | gpl-3.0 |
iansealy/projecteuler | 71.py | 1 | 1392 | #!/usr/bin/env python
"""This script solves the Project Euler problem "Ordered fractions". The
problem is: By listing the set of reduced proper fractions for d <= 1,000,000
in ascending order of size, find the numerator of the fraction immediately to
the left of 3/7.
"""
from __future__ import division
import argpars... | gpl-3.0 |
scottcunningham/ansible | v1/ansible/runner/connection_plugins/fireball.py | 110 | 4841 | # (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 the License, or
# (at your option) any lat... | gpl-3.0 |
davidcusatis/horizon | openstack_dashboard/dashboards/project/instances/console.py | 27 | 2562 | #
# 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 |
pycomlink/pycomlink | pycomlink/util/temporal.py | 2 | 2643 | import pandas as pd
def aggregate_df_onto_DatetimeIndex(
df, new_index, method, label="right", new_index_tz="utc"
):
"""
Aggregate a DataFrame or Series using a given DatetimeIndex
Parameters
----------
df : pandas.DataFrame
The dataframe that should be reindexed
new_index : panda... | bsd-3-clause |
gacarrillor/QGIS | python/plugins/processing/algs/qgis/HubDistanceLines.py | 26 | 6712 | # -*- coding: utf-8 -*-
"""
***************************************************************************
HubDistanceLines.py
---------------------
Date : May 2010
Copyright : (C) 2010 by Michael Minn
Email : pyqgis at michaelminn dot com
********************... | gpl-2.0 |
updownlife/multipleK | dependencies/biopython-1.65/Scripts/xbbtools/xbb_search.py | 1 | 5183 | #!/usr/bin/env python
# Created: Sun Dec 3 13:38:52 2000
# Last changed: Time-stamp: <01/09/04 09:51:21 thomas>
# thomas@cbs.dtu.dk, http://www.cbs.dtu.dk/thomas
# File: xbb_search.py
import os
import re
import sys
sys.path.insert(0, '.')
try:
from Tkinter import * # Python 2
except ImportError:
from tkinter... | gpl-2.0 |
wandec/grr | parsers/linux_file_parser_test.py | 5 | 5155 | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Unit test for the linux file parser."""
import os
import StringIO
from grr.lib import config_lib
from grr.lib import flags
from grr.lib import parsers
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib import utils
from grr.parsers... | apache-2.0 |
mldbai/mldb | testing/MLDBFB-724_classifier_exp_segfault_test.py | 1 | 2094 | #
# MLDB-xxx-explain.py
# Mich, 2016-12-07
# This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved.
#
from mldb import mldb, MldbUnitTest, ResponseException
class Mldbfb724ClassifierExpSegfaultTest(MldbUnitTest): # noqa
def test_it(self):
ds = mldb.create_dataset({'id' : 'ds', 'type... | apache-2.0 |
mandeepdhami/nova | nova/api/openstack/compute/plugins/v3/virtual_interfaces.py | 30 | 2733 | # Copyright (C) 2011 Midokura KK
# 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 ... | apache-2.0 |
sdkottegoda/andes | modules/andes-core/common/templating.py | 25 | 3016 | #
# 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... | apache-2.0 |
wbsavage/shinken | test/test_properties.py | 1 | 7769 | #!/usr/bin/env python
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affer... | agpl-3.0 |
mattharrison/pygrametl | pygrametl/steps.py | 1 | 20832 | """This module contains classes for making "steps" in an ETL flow.
Steps can be connected such that a row flows from step to step and
each step does something with the row.
"""
# Copyright (c) 2009, 2010, Christian Thomsen (chr@cs.aau.dk)
# All rights reserved.
# Redistribution and use in source anqd binary for... | bsd-2-clause |
afilipovich/graphite-web | webapp/graphite/metrics/views.py | 1 | 9842 | """Copyright 2009 Chris Davis
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
dist... | apache-2.0 |
inasafe/inasafe | safe_extras/raven/transport/base.py | 12 | 1219 | """
raven.transport.base
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
# Helper for external transports
has_newstyle_transports = True
class Transport(object):
"""
All ... | gpl-3.0 |
florianholzapfel/home-assistant | homeassistant/components/cover/tellduslive.py | 16 | 1213 | """
Support for Tellstick covers using Tellstick Net.
This platform uses the Telldus Live online service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.tellduslive/
"""
import logging
from homeassistant.components.cover import CoverDevice
from ... | mit |
mattrobenolt/AutobahnTestSuite | autobahntestsuite/autobahntestsuite/caseset.py | 4 | 5558 | ###############################################################################
##
## Copyright (C) 2013 Tavendo GmbH
##
## 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 |
icomms/wqmanager | reportlab/graphics/charts/barcharts.py | 4 | 53674 | #Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/barcharts.py
__version__=''' $Id: barcharts.py 3604 2009-11-27 16:35:29Z meitham $ '''
__doc__="""This module defines a variety of Bar ... | bsd-3-clause |
provaleks/o8 | addons/account_analytic_plans/__openerp__.py | 264 | 3114 | # -*- 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 |
AndyPeterman/mrmc | lib/libUPnP/Neptune/Extras/Scripts/GenErrorMap.py | 265 | 4805 | #! /usr/bin/python
import os
import os.path
import re
import sys
ErrorPattern = re.compile('([A-Z]{3}_ERROR_[A-Z_0-9]+)\s+=?\s*\(?([A-Z_0-9-][A-Z_0-9-+ ]+[A-Z_0-9])')
FilePatternH = re.compile('^.*\.h$')
FilePatternC = re.compile('^.*\.(c|cpp)$')
Errors = {}
Codes = {}
ERROR_MAP_HEADER = """/***********************... | gpl-2.0 |
lepture/flask-storage | flask_storage/_base.py | 4 | 3064 | # coding: utf-8
"""
flask_storage._base
~~~~~~~~~~~~~~~~~~~~
Common utilities for flask storage.
:copyright: (c) 2013 Hsiaoming Yang.
"""
import os
import logging
from werkzeug import FileStorage
from ._compat import urljoin
__all__ = (
'TEXT', 'DOCUMENTS', 'IMAGES', 'AUDIO', 'DATA', 'SCRIPTS',... | bsd-3-clause |
davidmueller13/L900_3.9_Experiment | 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 |
jenalgit/django | tests/utils_tests/test_tree.py | 429 | 1951 | import copy
import unittest
from django.utils.tree import Node
class NodeTests(unittest.TestCase):
def setUp(self):
self.node1_children = [('a', 1), ('b', 2)]
self.node1 = Node(self.node1_children)
self.node2 = Node()
def test_str(self):
self.assertEqual(str(self.node1), "(DE... | bsd-3-clause |
techdragon/django | tests/forms_tests/tests/test_input_formats.py | 26 | 39313 | from datetime import date, datetime, time
from django import forms
from django.test import SimpleTestCase, override_settings
from django.utils.translation import activate, deactivate
@override_settings(TIME_INPUT_FORMATS=["%I:%M:%S %p", "%I:%M %p"], USE_L10N=True)
class LocalizedTimeTests(SimpleTestCase):
def se... | bsd-3-clause |
HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/Twisted/twisted/test/test_stringtransport.py | 33 | 10694 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.test.proto_helpers}.
"""
from zope.interface.verify import verifyObject
from twisted.internet.interfaces import (ITransport, IPushProducer, IConsumer,
IReactorTCP, IReactorSSL, IReactorUNIX, IAddress, IListeningPort,
... | gpl-3.0 |
bazzinotti/mitmproxy | libmproxy/exceptions.py | 2 | 1097 | """
We try to be very hygienic regarding the exceptions we throw:
Every Exception mitmproxy raises shall be a subclass of ProxyException.
See also: http://lucumr.pocoo.org/2014/10/16/on-error-handling/
"""
from __future__ import (absolute_import, print_function, division)
class ProxyException(Exception):
"""
... | mit |
Nu3001/external_chromium_org | chrome/common/extensions/docs/server2/samples_data_source_test.py | 25 | 1064 | #!/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.
import json
import os
import sys
import unittest
from samples_data_source import SamplesDataSource
from servlet import Request
cl... | bsd-3-clause |
hrjn/scikit-learn | sklearn/externals/joblib/func_inspect.py | 46 | 13254 | """
My own variation on function-specific inspect-like features.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
from itertools import islice
import inspect
import warnings
import re
import os
from ._compat import _basestrin... | bsd-3-clause |
bdero/edx-platform | lms/djangoapps/verify_student/tests/test_integration.py | 2 | 4457 | """
Integration tests of the payment flow, including course mode selection.
"""
from lxml.html import soupparser
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.tests.factories import C... | agpl-3.0 |
GenericStudent/home-assistant | homeassistant/components/notion/__init__.py | 6 | 8987 | """Support for Notion."""
import asyncio
from datetime import timedelta
import logging
from aionotion import async_get_client
from aionotion.errors import InvalidCredentialsError, NotionError
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import A... | apache-2.0 |
jporradre/Useful-scripts | xls_to_csv.py | 1 | 1752 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Copyright (C) 2016 Juan Pablo Orradre
#
# xls_to_csv.py : Python script useful to convert an Excel file to a CSV file.
#
# Use: python xls_to_csv.py source_xls_file destiny_csv_file
#
# Notes:
# - Converts an Excel file to a CSV file.
# - If the excel file h... | gpl-3.0 |
emperrors/fetchLinuxIDC | wx_py/panel/LeftWorkSpace.py | 1 | 4770 | #! /usr/bin/python
# -*- coding: gb2312 -*-
# import wx_py.WorkSpace as WorkSpace
from WorkSpace import *
from FolderItem import *
from ArrowCallBack import *
from CommonDefs import *
import wx
MAX_FOLDER_ITEM_COUNT = 7
class LeftWorkSpace(WorkSpace, ArrowCallBack):
def __init__(self, parent, id, pos, size, sty... | gpl-3.0 |
tfiedor/perun | perun/cli_groups/config_cli.py | 1 | 7641 | """Group of CLI commands used for manipulation with config"""
import click
import perun.logic.commands as commands
import perun.utils.cli_helpers as cli_helpers
import perun.utils.log as perun_log
from perun.utils.exceptions import NotPerunRepositoryException, MissingConfigSectionException, \
ExternalEditorErrorE... | gpl-3.0 |
GAXUSXX/G935FGaXusKernel3 | 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 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/debug_toolbar/panels/profiling.py | 4 | 4988 | from __future__ import absolute_import, division, unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
from debug_toolbar.panels import Panel
from debug_toolbar import settings as dt_settings
import cProfile
from pstats import Stats
from colorsys impor... | agpl-3.0 |
philoniare/horizon | horizon/loaders.py | 14 | 2355 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
balloob/home-assistant | homeassistant/components/vallox/__init__.py | 26 | 8917 | """Support for Vallox ventilation units."""
from datetime import timedelta
import ipaddress
import logging
from vallox_websocket_api import PROFILE as VALLOX_PROFILE, Vallox
from vallox_websocket_api.constants import vlxDevConstants
from vallox_websocket_api.exceptions import ValloxApiException
import voluptuous as v... | apache-2.0 |
tnemisteam/cdf-steps | school/views/school_upgradation_views.py | 1 | 4461 | from django.views.generic import ListView, DetailView, CreateView, \
DeleteView, UpdateView, \
ArchiveIndexView, DateDetailView, \
DayArchiveView, MonthArchiveView, \
TodayArchiveView, Wee... | mit |
s-hertel/ansible | test/support/integration/plugins/filter/json_query.py | 197 | 1857 | # (c) 2015, Filipe Niero Felisbino <filipenf@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
borjam/exabgp | src/exabgp/bgp/message/open/__init__.py | 2 | 3257 | # encoding: utf-8
"""
__init__.py
Created by Thomas Mangin on 2009-11-05.
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
from struct import unpack
from exabgp.bgp.message.message import Message
from exabgp.bgp.message.notification import Notify
from ex... | bsd-3-clause |
SmartXiaoMing/clean_openwrt_sdk | staging_dir/host/lib/scons-2.1.0/SCons/Builder.py | 21 | 33982 | """SCons.Builder
Builder object subsystem.
A Builder object is a callable that encapsulates information about how
to execute actions to create a target Node (file) from source Nodes
(files), and how to create those dependencies for tracking.
The main entry point here is the Builder() factory method. This provides
a... | gpl-2.0 |
rwl/PyDyn | pydyn/solvers/ModifiedEuler2.py | 1 | 4185 | # Copyright (C) 2009 Stijn Cole
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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 |
nikesh-mahalka/nova | nova/objects/__init__.py | 4 | 3006 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
jinie/sublime-wakatime | packages/wakatime/packages/pygments_py3/pygments/lexers/nix.py | 72 | 4031 | # -*- coding: utf-8 -*-
"""
pygments.lexers.nix
~~~~~~~~~~~~~~~~~~~
Lexers for the NixOS Nix language.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include
from pygments.token impor... | bsd-3-clause |
zijistark/ck2utils | esc/province_setup.py | 1 | 2392 | #!/usr/bin/env python3
# USAGE:
# log_province_setup.py
# mkdir -p $REPO_ROOT/SWMH-BETA/SWMH/localisation/customizable_localisation
# cp $REPO_ROOT/{EMF/EMF,SWMH-BETA/SWMH}/localisation/customizable_localisation/emf_debug_custom_loc.txt
# cp $REPO_ROOT/{EMF/EMF,SWMH-BETA/SWMH}/localisation/1_emf_debug.csv
# rm $REPO_... | gpl-2.0 |
niboshi/chainer | chainerx/testing/array.py | 8 | 6059 | import numpy.testing
import chainerx
# NumPy-like assertion functions that accept both NumPy and ChainerX arrays
def _as_numpy(x):
if isinstance(x, chainerx.ndarray):
return chainerx.to_numpy(x)
assert isinstance(x, numpy.ndarray) or numpy.isscalar(x)
return x
def _check_dtype_and_strides(x, y... | mit |
VShangxiao/zhihu-python | test.py | 24 | 9440 | # -*- coding: utf-8 -*-
'''
$$
$$$ &&&&$$$$##$$$$$$$$$$$$$$$$$$#$$$
$$$ $$$$$$$$$$$$$$$ ##$$$$$$$$$$$$$$$$$$o; ; ... | mit |
yuanzhao/gpdb | src/test/tinc/tincrepo/resource_management/memory_accounting/too_many_exec_accounts/test_exec_accounts.py | 15 | 2189 | import tinctest
from mpp.models import SQLTestCase
from gppylib.commands.base import Command
from mpp.lib.PSQL import PSQL
def _set_VLIM(vlimMB):
# Set up GUCs for VLIM (gp_vmem_protect_limit), SLIM (gp_vmem_limit_per_query) and RQT activation percent (runaway_detector_activation_percent)
tinctest.logger.inf... | apache-2.0 |
hzruandd/AutobahnPython | autobahn/wamp/test/test_component.py | 10 | 7873 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software with... | mit |
h2oloopan/easymerge | EasyMerge/tests/reddit/r2/r2/models/gold.py | 1 | 19762 | # The contents of this file are subject to the Common Public Attribution
# License Version 1.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://code.reddit.com/LICENSE. The License is based on the Mozilla Public
# License Version 1.1, ... | mit |
LLNL/spack | var/spack/repos/builtin/packages/optional-lite/package.py | 5 | 1888 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from shutil import copytree
class OptionalLite(CMakePackage):
"""
A single-file header-only ... | lgpl-2.1 |
DataDog/monitor | docs/_sphinx/pygments/styles/simple.py | 2 | 1788 | # -*- coding: utf-8 -*-
"""
pygments.styles.eigengo
~~~~~~~~~~~~~~~~~~~~~~~~
Simple style for Scala highlighting.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace
class SimpleStyle(Style):
"""
Simp... | apache-2.0 |
drmrd/ansible | test/units/modules/network/nxos/test_nxos_bgp_neighbor.py | 39 | 2505 | # (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 |
smaccm/python-capdl-tool | capdl/__init__.py | 1 | 1096 | #
# Copyright 2014, NICTA
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(NICTA_BSD)
#
from Cap import Cap
from ELF import ELF
from Object import Frame, PageTable, PageDirectory, AS... | bsd-2-clause |
cosenal/osf.io | website/addons/forward/tests/test_views.py | 44 | 1162 | from nose.tools import *
from website.addons.forward.tests.utils import ForwardAddonTestCase
class TestForwardLogs(ForwardAddonTestCase):
def setUp(self):
super(TestForwardLogs, self).setUp()
self.app.authenticate(*self.user.auth)
def test_change_url_log_added(self):
log_count = len... | apache-2.0 |
snailhu/myself-Repository | SmartDataApp/pusher/push_api.py | 1 | 1326 | #coding:utf-8
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.db import transaction
import simplejson
from SmartDataApp.controller.admin import return_error_response
from SmartDataApp.views import convert_session_id_to_user
from SmartDataApp.models import ProfileDe... | apache-2.0 |
BigBrother1984/android_external_chromium_org | tools/perf/benchmarks/robohornet_pro.py | 24 | 1290 | # 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.
"""Runs Microsoft's RoboHornet Pro benchmark."""
import os
from telemetry import test
from telemetry.core import util
from telemetry.page import page_m... | bsd-3-clause |
SNAPPETITE/backend | flask/lib/python2.7/site-packages/whoosh/lang/snowball/finnish.py | 96 | 10074 | from .bases import _StandardStemmer
from whoosh.compat import u
class FinnishStemmer(_StandardStemmer):
"""
The Finnish Snowball stemmer.
:cvar __vowels: The Finnish vowels.
:type __vowels: unicode
:cvar __restricted_vowels: A subset of the Finnish vowels.
:type __restricted_vowels: unicode
... | mit |
xindus40223115/w17_test | static/Brython3.1.3-20150514-095342/Lib/textwrap.py | 745 | 16488 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
# Hardcode the recognized whitespace characters to the US-ASCII
# whit... | gpl-3.0 |
micwypych/github-cmake-project-checker | project_checker/tests/checkhomeworkfromconfig.py | 1 | 1133 | from unittest import TestCase
from unittest.mock import MagicMock
from project_checker.checker.pull_all_links import check_homework_by_configuration
from project_checker.checker.project.config import Config
class StubConfig(Config):
def __init__(self, lines):
self.load = lambda *args: None
projec... | mit |
flar2/m8-GPE-4.4.3 | tools/perf/util/setup.py | 4998 | 1330 | #!/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 |
CapOM/ChromiumGStreamerBackend | testing/scripts/checklicenses.py | 76 | 1036 | #!/usr/bin/env python
# Copyright 2015 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 json
import os
import sys
import common
def main_run(args):
with common.temporary_file() as tempfile_path:
rc = common... | bsd-3-clause |
sou81821/chainer | examples/modelzoo/download_model.py | 28 | 1047 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import six
parser = argparse.ArgumentParser(
description='Download a Caffe reference model')
parser.add_argument('model_type', choices=('alexnet', 'caffenet', 'googlenet'),
help='Model type (alexnet, caffenet, googlen... | mit |
loulich/Couchpotato | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/adultswim.py | 22 | 6720 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
xpath_text,
float_or_none,
)
class AdultSwimIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?adultswim\.com/videos/(?P<is_playlist>playlists/)?(?P... | gpl-3.0 |
liorvh/infernal-twin | airgraph-ng/graphviz/libDumpParse.py | 78 | 6884 | #!/usr/bin/python
#airodump parsing lib
#returns in an array of client and Ap information
#part of the airdrop-ng project
from sys import exit as Exit
class airDumpParse:
def parser(self,file):
"""
One Function to call to parse a file and return the information
"""
self.capr = ... | gpl-3.0 |
wpjesus/codematch | ietf/meeting/tests_views.py | 1 | 16225 | import os
import shutil
import datetime
import urlparse
from django.core.urlresolvers import reverse as urlreverse
from django.conf import settings
from pyquery import PyQuery
from ietf.doc.models import Document
from ietf.meeting.models import Session, TimeSlot
from ietf.meeting.test_data import make_meeting_test_d... | bsd-3-clause |
mjirayu/sit_academy | lms/djangoapps/courseware/features/lti.py | 56 | 14199 | # pylint: disable=missing-docstring
import datetime
import os
import pytz
from django.conf import settings
from mock import patch
from pytz import UTC
from splinter.exceptions import ElementDoesNotExist
from selenium.common.exceptions import NoAlertPresentException
from nose.tools import assert_true, assert_equal, asse... | agpl-3.0 |
rcook/ptool-templates | python-game/setup.py | 1 | 1446 | {{py_copyright}}
import os
import re
from setuptools import find_packages, setup
def _read_properties():
init_path = os.path.abspath(os.path.join("{{module_name}}", "__init__.py"))
regex = re.compile("^\\s*__(?P<key>.*)__\\s*=\\s*\"(?P<value>.*)\"\\s*$")
with open(init_path, "rt") as f:
props = {}... | mit |
dmeulen/home-assistant | tests/components/test_input_slider.py | 17 | 2031 | """The tests for the Input slider component."""
# pylint: disable=protected-access
import unittest
from tests.common import get_test_home_assistant
from homeassistant.bootstrap import setup_component
from homeassistant.components.input_slider import (DOMAIN, select_value)
class TestInputSlider(unittest.TestCase):
... | mit |
Chiroptera/QCThesis | MyML/cluster/Horn.py | 3 | 8889 | import numpy as np
from sklearn import preprocessing
from datetime import datetime
def _corr(C):
R=np.empty_like(C)
#compute correlation from covariance
for i,ci in enumerate(C):
for j,cij in enumerate(ci):
R[i,j] = cij / np.sqrt(C[i,i] * C[j,j])
return R
def pcaFun(x, whiten=False,e=0, type='cov', method='s... | mit |
sheldonkhall/MITA-model | axisymm_mwa.py | 1 | 36082 | ## Python Module: axisymm_mwa
## Author: Sheldon Hall
## Email: sheldon.hall@eng.ox.ac.uk
##
## This module contains functions for predicting the outcomes of
## minimally invasive cancer treatments (MICTs). Namely: RFA,
## MWA, CA, IRE. The main focus of this code is to perform
## sensitivity analyses on representative... | gpl-3.0 |
lunarca/fngrpt | libs/LoggingHelpers.py | 2 | 1793 | # -*- coding: utf-8 -*-
'''
@author: moloch
Copyright 2013
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 b... | apache-2.0 |
tplavcic/percona-xtrabackup | storage/innobase/xtrabackup/test/python/testtools/testresult/real.py | 42 | 21672 | # Copyright (c) 2008 testtools developers. See LICENSE for details.
"""Test results and related things."""
__metaclass__ = type
__all__ = [
'ExtendedToOriginalDecorator',
'MultiTestResult',
'TestResult',
'ThreadsafeForwardingResult',
]
import datetime
import sys
import unittest
from testtools.co... | gpl-2.0 |
hyperdriveguy/pyUpdate | pyUpdate.py | 1 | 1574 | #!/usr/bin/python3
# Import modules
from os import system as do
from time import sleep
# Set Variables
upCache = " "
upSys = " "
remAuto = " "
# define how to get config
def getConfig(filename):
import imp
f = open(filename)
global data
data = imp.load_source('data', '', f)
f.close()
# path to "... | mit |
chrisvans/roastdoge | profiling/tests.py | 1 | 13749 | # Django
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.core.urlresolvers import reverse
from django.http import JsonResponse
from django.template.loader import render_to_string
from django.test import TestCase, Client, RequestFactory
# Ours
from coffee.factories import CoffeeFacto... | mit |
kinnngg/knightofsorrow.tk | crowbar-master/lib/core/threadpool.py | 5 | 1322 |
try:
import sys
from Queue import Queue
from threading import Thread
from lib.core.exceptions import CrowbarExceptions
except Exception, err:
from lib.core.exceptions import CrowbarExceptions
raise CrowbarExceptions(str(err))
class Worker(Thread):
def __init__(self, tasks):
Thread.__init__(se... | mit |
DutchDanny/kernel_kk443_sense_m8ace | tools/perf/util/setup.py | 4998 | 1330 | #!/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 |
Stanford-Online/edx-platform | common/djangoapps/student/tests/test_credit.py | 13 | 9724 | """
Tests for credit courses on the student dashboard.
"""
import datetime
import unittest
import ddt
import pytz
from django.conf import settings
from django.urls import reverse
from django.test.utils import override_settings
from mock import patch
from openedx.core.djangoapps.credit import api as credit_api
from op... | agpl-3.0 |
flccrakers/dj-tango | bin/correct-tangos.py | 1 | 1733 | #!/usr/bin/python3
# -*- coding:Utf-8 -*
import os
import time
from djtango.data import djDataConnection
from djtango.tangosong import TangoSong
inputFile = './tango-a-corriger.csv'
def loadcsv(file):
ret=[]
inF = open(file, "r") #opens file with name of "test.txt"
for line in inF :
res = line.strip().split(";... | gpl-3.0 |
VDBWRAIR/bio_pieces | bio_bits/fasta.py | 2 | 4383 | from __future__ import print_function
import sys
import argparse
import string
import functools
from Bio.SeqIO import parse, FastaIO
from Bio.Data import IUPACData
from . import util
from . import ctleptop
# Maximum amount of permutations for ambiguous sequences that will
# be generated
MAX_PERMS = 100
def parse_a... | gpl-2.0 |
pjg101/SickRage | lib/past/builtins/misc.py | 62 | 2500 | from __future__ import unicode_literals
import sys
import inspect
from collections import Mapping
from future.utils import PY3, exec_
if PY3:
import builtins
def apply(f, *args, **kw):
return f(*args, **kw)
from past.builtins import str as oldstr
def chr(i):
"""
Return a by... | gpl-3.0 |
erkrishna9/odoo | addons/base_gengo/__init__.py | 377 | 1122 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
benkonrath/transip-api | tests/service_tests/test_domain.py | 1 | 11788 | import unittest
from transip.client import MODE_RO, MODE_RW
from transip.service import DomainService
from transip.service.objects import DnsEntry
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import patch, Mock
class TestDomainService(unittest.TestCase):
@patch('transip.clie... | mit |
ezc/protobuf | python/setup.py | 32 | 7877 | #! /usr/bin/python
#
# See README for usage instructions.
import sys
import os
import subprocess
# We must use setuptools, not distutils, because we need to use the
# namespace_packages option for the "google" package.
try:
from setuptools import setup, Extension
except ImportError:
try:
from ez_setup import u... | bsd-3-clause |
dariemp/odoo | addons/website_sale/controllers/main.py | 32 | 42618 | # -*- coding: utf-8 -*-
import werkzeug
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
from openerp.addons.website.models.website import slug
from openerp.addons.web.controllers.main import login_redirect
PPG = 20 # Products Per Page
PP... | agpl-3.0 |
AdeshAtole/coala | coalib/tests/parsing/GlobbingTest.py | 9 | 11091 | """
Tests Globbing and related functions
Test Files are local and permanent and organized as follows:
GlobTestDir
├── SubDir1
│ ├── File11.py
│ └── File12.py
│ SubDir2
│ ├── File(with)parentheses.txt
│ └── File[with]brackets.txt
├── File1.x
├── File2.y
└── File3.z
"""
import os
import unittest
from coalib.pa... | agpl-3.0 |
keithroe/vtkoptix | ThirdParty/Twisted/twisted/internet/_win32stdio.py | 32 | 3161 | # -*- test-case-name: twisted.test.test_stdio -*-
"""
Windows-specific implementation of the L{twisted.internet.stdio} interface.
"""
import win32api
import os, msvcrt
from zope.interface import implements
from twisted.internet.interfaces import IHalfCloseableProtocol, ITransport, IAddress
from twisted.internet.int... | bsd-3-clause |
Sabayon/entropy | matter/matter/spec.py | 1 | 18129 | # -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Matter TinderBox Toolkit}.
"""
import os
import shlex
from _entropy.matter.utils import convert_to_unicode, get_stringtype
class GenericSpecFunctio... | gpl-2.0 |
askulkarni2/ansible | lib/ansible/inventory/vars_plugins/noop.py | 317 | 1632 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2014, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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 Foundat... | gpl-3.0 |
pronto/dotfiles | .vim/pylibs/logilab/astng/raw_building.py | 2 | 13555 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# copyright 2003-2010 Sylvain Thenault, all rights reserved.
# contact mailto:thenault@gmail.com
#
# This file is part of logilab-astng.
#
# logilab-astng is free software: you can redi... | bsd-2-clause |
bastiak/dnssyncd | dnssyncdlib/zonesync.py | 1 | 21561 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import copy
import traceback
from multiprocessing import Process
from dnssyncdlib.data import DNSDataPackage
from dnssyncdlib.dnsdiff import DNSDiff, derelativize_data
from dnssyncdlib.messages import (StatusMsg, TerminateMsg, DoSyncMsg, NotifyRecordMsg,
... | gpl-3.0 |
CapOM/ChromiumGStreamerBackend | tools/telemetry/telemetry/web_perf/metrics/timeline_based_metric_unittest.py | 77 | 1129 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import telemetry.web_perf.metrics.timeline_based_metric as tbm_module
class TimelineBasedMetricTest(unittest.TestCase):
# pylint: disab... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.