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
qsnake/numpy
numpy/core/tests/test_regression.py
1
54601
from StringIO import StringIO import pickle import sys import gc import copy from os import path from numpy.testing import * from numpy.testing.utils import _assert_valid_refcount, WarningManager from numpy.compat import asbytes, asunicode, asbytes_nested import warnings import tempfile import numpy as np if sys.versi...
bsd-3-clause
matthew-morrison/csss-minion
modtools.py
4
5150
import discord from discord.ext import commands AVOID = ['342891382584770560', '300564141096304650', '360722519860445184', '312038519294001152', '321832332279676928'] class Modtools: def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def propagateMute(self, ctx): if self...
mit
naparuba/check-linux-by-ssh
check_cpu_stats_by_ssh.py
1
5589
#!/usr/bin/env python2 # Copyright (C) 2013: # Gabes Jean, naparuba@gmail.com # Pasche Sebastien, sebastien.pasche@leshop.ch # # 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...
mit
dbremner/bite-project
deps/mrtaskman/server/mapreduce/lib/simplejson/scanner.py
77
2263
#!/usr/bin/env python """JSON token scanner """ import re try: from mapreduce.lib.simplejson._speedups import make_scanner as c_make_scanner except ImportError: c_make_scanner = None __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTI...
apache-2.0
FreekingDean/home-assistant
homeassistant/components/automation/event.py
19
1317
""" Offer event listening automation rules. For more details about this automation rule, please refer to the documentation at https://home-assistant.io/components/automation/#event-trigger """ import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.const import CONF_PLATFOR...
mit
HeraclesHX/scikit-learn
sklearn/cluster/tests/test_affinity_propagation.py
341
2620
""" Testing for Clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.cluster.affinity_propagation_ import AffinityPropagation from sklearn.cluster.affinity_propagatio...
bsd-3-clause
mavit/ansible
lib/ansible/modules/network/ironware/ironware_command.py
87
5154
#!/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
40223144/2015cdafinal
static/Brython3.1.1-20150328-091302/Lib/unittest/mock.py
739
71473
# mock.py # Test tools for mocking and patching. # Maintained by Michael Foord # Backport for other versions of Python available from # http://pypi.python.org/pypi/mock __all__ = ( 'Mock', 'MagicMock', 'patch', 'sentinel', 'DEFAULT', 'ANY', 'call', 'create_autospec', 'FILTER_DIR', ...
gpl-3.0
jpeeler/origin
cmd/cluster-capacity/go/src/github.com/kubernetes-incubator/cluster-capacity/vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-e2e/reactive/kubernetes_e2e.py
100
7192
#!/usr/bin/env python # Copyright 2015 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
arichar6/veusz
veusz/widgets/ternary.py
3
20568
# -*- coding: utf-8 -*- # Copyright (C) 2011 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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...
gpl-2.0
USGSDenverPychron/pychron
pychron/experiment/duration_tracker.py
1
4916
# =============================================================================== # Copyright 2016 Jake Ross # # 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...
apache-2.0
dturk3/pingnetics
bin/hyperic-sigar-1.6.4/bindings/python/setup.py
11
1040
#!/usr/bin/env python # # Copyright (c) 2007 Hyperic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
gnowledge/ncert_nroer
objectapp/tests/gbobject.py
3
15360
# Copyright (c) 2011, 2012 Free Software Foundation # 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 vers...
agpl-3.0
garimakhulbe/autorest
src/client/Python/msrest/msrest/version.py
2
1333
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
mit
sankhesh/VTK
Interaction/Style/Testing/Python/TestFlyTo.py
20
1927
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() def GetRGBColor(colorName): ''' Return the red, green and blue components for a color as doubles. ''' rgb = [0.0, 0.0, 0.0] # black vtk.vtkNamedColors...
bsd-3-clause
fzalkow/scikit-learn
sklearn/feature_selection/univariate_selection.py
95
23709
"""Univariate features selection.""" # Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay. # L. Buitinck, A. Joly # License: BSD 3 clause import numpy as np import warnings from scipy import special, stats from scipy.sparse import issparse from ..base import BaseEstimator from ..prepr...
bsd-3-clause
halsafar/PokemonGo-Bot
pokemongo_bot/cell_workers/pokemon_catch_worker.py
2
37664
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import time import json import sys from random import random, randrange, uniform from pokemongo_bot import inventory from pokemongo_bot.base_task import BaseTask from pokemongo_bot.human_behaviour import sleep, action_delay from pokemongo_bot.in...
mit
tanmaykm/edx-platform
openedx/core/djangoapps/course_groups/management/commands/tests/test_post_cohort_membership_fix.py
36
4243
""" Test for the post-migration fix commands that are included with this djangoapp """ from django.core.management import call_command from django.test.client import RequestFactory from nose.plugins.attrib import attr from openedx.core.djangoapps.course_groups.views import cohort_handler from openedx.core.djangoapps.c...
agpl-3.0
sabyasachi087/sp17-i524
project/S17-IO-3012/code/bin/benchmark_shard_mapreduce.py
19
5313
import matplotlib.pyplot as plt import sys import pandas as pd def get_parm(): """retrieves mandatory parameter to program @param: none @type: n/a """ try: return sys.argv[1] except: print ('Must enter file name as parameter') exit() def read_file(filename): """...
apache-2.0
heena23/Millionaire
contrib/zmq/zmq_sub3.4.py
44
3274
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ ZMQ example using python3's asyncio Bitcoin should be started with the command line argument...
mit
dksh/cube-bookstore
cube/users/views.py
3
1765
# Copyright (C) 2010 Trinity Western University from cube.users.forms import UserForm from cube.books.http import HttpResponseNotAllowed from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response as rtr from django.template import loader, RequestContext as RC fr...
gpl-3.0
m0ppers/arangodb
3rdParty/boost/1.61.0/tools/build/test/project_root_constants.py
51
1399
#!/usr/bin/python # Copyright 2003, 2004, 2005 Vladimir Prus # 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) import BoostBuild # Create a temporary working directory. t = BoostBuild.Tester() # Create the needed ...
apache-2.0
burzillibus/RobHome
venv/lib/python2.7/site-packages/gevent/_socket3.py
1
39892
# Port of Python 3.3's socket module to gevent """ Python 3 socket module. """ # Our import magic sadly makes this warning useless # pylint: disable=undefined-variable # pylint: disable=too-many-statements,too-many-branches # pylint: disable=too-many-public-methods,unused-argument from __future__ import absolute_import...
mit
birdonwheels5/p2pool-dgbsha
SOAPpy/SOAPBuilder.py
289
22852
""" ################################################################################ # Copyright (c) 2003, Pfizer # Copyright (c) 2001, Cayce Ullman. # Copyright (c) 2001, Brian Matthews. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provid...
gpl-3.0
bigswitch/nova
nova/api/openstack/compute/legacy_v2/contrib/floating_ip_pools.py
79
2131
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
dajohnso/cfme_tests
utils/virtual_machines.py
4
3674
"""Helper functions related to the creation and destruction of virtual machines and instances """ import pytest from utils.providers import get_crud from fixtures.pytest_store import store from novaclient.exceptions import OverLimit as OSOverLimit from ovirtsdk.infrastructure.errors import RequestError as RHEVRequestE...
gpl-2.0
s20121035/rk3288_android5.1_repo
external/chromium-trace/trace-viewer/third_party/pywebsocket/src/mod_pywebsocket/_stream_base.py
43
5176
# Copyright 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...
gpl-3.0
apyrgio/synnefo
snf-cyclades-gtools/collectd/plugins/ganeti-cpustats.py
3
1059
#!/usr/bin/env python import os import collectd from glob import glob def get_vcpus(pid): """Get a KVM instance vCPU count by looking at its fd's""" vcpus = 0 for fd in glob("/proc/%d/fd/*" % pid): # XXX: sad but trueeeeeeeeeeee if os.readlink(fd) == "anon_inode:kvm-vcpu": vc...
gpl-3.0
kaiserroll14/301finalproject
main/numpy/linalg/tests/test_build.py
131
1822
from __future__ import division, absolute_import, print_function from subprocess import PIPE, Popen import sys import re from numpy.linalg import lapack_lite from numpy.testing import TestCase, dec, run_module_suite from numpy.compat import asbytes_nested class FindDependenciesLdd(object): def __init__(self):...
gpl-3.0
myxemhoho/mutil-cloud-manage-paltform
jumpgate/compute/drivers/sl/volumes.py
3
9741
import json import uuid import six from jumpgate.common import error_handling HTTP = six.moves.http_client # pylint: disable=E1101 # openstack is use uuid.uuid4() to generate UUID. OPENSTACK_VOLUME_UUID_LEN = len(str(uuid.uuid4())) class OSVolumeAttachmentsV2(object): """class OSVolumeAttachmentsV2 supports ...
mit
ConPaaS-team/conpaas
conpaas-services/src/conpaas/services/webservers/manager/autoscaling/monitoring.py
1
26140
""" Monitoring Controller collects all the informantion extracted using Ganglia monitoring system. @author: fernandez """ import sys from subprocess import Popen, PIPE import socket from time import time from os import path, listdir from conpaas.services.webservers.manager.autoscaling.performance import ServicePerfo...
bsd-3-clause
mcdermott-scholars/mcdermott
mcdermott/settings.py
1
5077
""" Django settings for mcdermott project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ import json ...
mit
OneCoin-development/OneCoin
qa/rpc-tests/bipdersig.py
66
3130
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test the BIP66 changeover logic # from test_framework.test_framework import BitcoinTestFramework fro...
mit
cneill/designate-testing
designate/storage/impl_sqlalchemy/migrate_repo/versions/062_placeholder.py
140
1035
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <kiall@hp.com> # # 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/L...
apache-2.0
ankittare/NLP_QuestionGeneration
src/rand_sents.py
1
4273
#!/usr/bin/python # # rand_sents.py # # Utility to pull N random sentences from an article and put them in # a file. (Can be used for testing question generation without having # to manually extract sentences from the articles.) # # Usage: # ./rand_sents.py N article_file.htm output_file.txt # # N is the number ...
mit
themutt/plastex
build/lib.linux-x86_64-2.7/plasTeX/Renderers/PageTemplate/simpletal/sgmlentitynames.py
9
6958
""" simpleTAL Implementation Copyright (c) 2004 Colin Stewart (http://www.owlfish.com/) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the ab...
mit
simonwagner/mergepbx
tools/reloader.py
4
7106
# Python Module Reloader # # Copyright (c) 2009-2014 Jon Parise <jon@indelible.org> # # 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 rig...
gpl-3.0
ChenJunor/hue
apps/jobbrowser/src/jobbrowser/views.py
4
23253
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
ChromiumWebApps/chromium
tools/telemetry/telemetry/__init__.py
2
1886
# Copyright (c) 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. """A library for cross-platform browser tests.""" import inspect import logging import os import sys # Ensure Python >= 2.7 if sys.version_info < (2, ...
bsd-3-clause
jfmartinez64/test
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/xtube.py
16
4566
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_request, compat_urllib_parse, ) from ..utils import ( parse_duration, str_to_int, ) class XTubeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?P<url>xtube\.com/watch\.p...
gpl-3.0
ghedsouza/django
tests/distinct_on_fields/tests.py
31
5713
from django.db.models import Max from django.test import TestCase, skipUnlessDBFeature from .models import Celebrity, Fan, Staff, StaffTag, Tag @skipUnlessDBFeature('can_distinct_on_fields') @skipUnlessDBFeature('supports_nullable_unique_constraints') class DistinctOnTests(TestCase): def setUp(self): t1 ...
bsd-3-clause
iamshang1/Projects
Advanced_ML/Human_Activity_Recognition/LSTM/record_fetcher_within_subject_raw.py
1
9693
import numpy as np import glob import random import sys class record_fetcher(object): ''' creates feature arrays and labels from raw accelerometer/demographic data no test/train splitting is included methods: - fetch(batch_size,binary) separates raw accelerometer/demographic data int...
mit
GauravSahu/odoo
addons/hr_holidays/report/hr_holidays_report.py
341
2369
# -*- 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
abutcher/origin
vendor/github.com/google/certificate-transparency/python/utilities/log_list/cpp_generator.py
17
3757
import datetime import base64 import hashlib import math def _write_cpp_header(f, include_guard): year = datetime.date.today().year f.write(( "// Copyright %(year)d The Chromium Authors. All rights reserved.\n" "// Use of this source code is governed by a BSD-style license" " that can b...
apache-2.0
Dino0631/RedRain-Bot
cogs/lib/pip/_vendor/progress/counter.py
510
1502
# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS P...
gpl-3.0
kn45/LTR-DNN
debug/dbg_metric.py
1
1839
import itertools import numpy as np import sys import tensorflow as tf class LTRDNN(object): def __init__(self): self.labels = tf.placeholder(tf.float32, [None, 1], 'a') self.preds = tf.placeholder(tf.float32, [None, 1], 'b') # accumulated accuracy # re-initialize local variables ...
mit
lynxis/libavg
src/samples/twovideos.py
2
1724
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import libavg from libavg import avg, app, player class HDVideo(app.MainDiv): def onArgvParserCreated(self, parser): parser.set_usage('%prog <video1> <video2>') parser.add_option('--duration', '-d', dest='duration', default=...
lgpl-2.1
Gagaro/django
tests/wsgi/tests.py
147
4142
from __future__ import unicode_literals import unittest from django.core.exceptions import ImproperlyConfigured from django.core.servers.basehttp import get_internal_wsgi_application from django.core.signals import request_started from django.core.wsgi import get_wsgi_application from django.db import close_old_conne...
bsd-3-clause
uclouvain/osis_louvain
base/migrations/0370_message_template_egys_automatic_postponement.py
2
9081
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-10-31 13:01 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('base', '0369_auto_20181017_1215'), ] operations = [ migrations.RunSQL( ...
agpl-3.0
ace0/linux-whirlwind-rng
Documentation/target/tcm_mod_builder.py
868
40692
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
shivaprsdv/pywebview
webview/winforms.py
1
13517
# -*- coding: utf-8 -*- """ (C) 2014-2018 Roman Sirokov and contributors Licensed under BSD license http://github.com/r0x0r/pywebview/ """ import os import sys import logging import json import webbrowser from threading import Event, Semaphore from ctypes import windll import clr clr.AddReference('System.Windows.F...
bsd-3-clause
dpassante/ansible
test/units/config/test_data.py
113
1266
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat import unittest from ansible.config.data import ConfigData from ansible.config.manager import Setting mykey = Setting('mykey', 'myvalue', 'test', 'string') mykey2 = Setting('mykey...
gpl-3.0
zhouzhenghui/python-for-android
python3-alpha/extra_modules/gdata/Crypto/Protocol/Chaffing.py
44
9496
"""This file implements the chaffing algorithm. Winnowing and chaffing is a technique for enhancing privacy without requiring strong encryption. In short, the technique takes a set of authenticated message blocks (the wheat) and adds a number of chaff blocks which have randomly chosen data and MAC fields. This means...
apache-2.0
carangorango/democritus
democritus/converters.py
2
9348
from __future__ import division import numbers import numpy as np import pandas import yaml from scipy import stats from democritus.dynamics import ReplicatorDynamics, BestResponseDynamics, QuantalResponseDynamics from democritus.exceptions import InvalidValueInSpecification, IncompatibilityInSpecification, Specific...
gpl-2.0
nicolargo/intellij-community
python/testData/highlighting/assignmentTargets.py
59
1299
# fail <error descr="Can't assign to function call">int(1)</error> = 1 <error descr="Can't assign to literal">12</error> = 1 <error descr="Can't assign to operator">1 + 21</error> = 12 result = <error descr="Can't assign to operator">a < c and c</error> = 4 <error descr="Can't assign to ()">()</error> = 123 <error...
apache-2.0
varunarya10/tempest
tempest/api/volume/admin/test_volumes_backup.py
8
5559
# Copyright 2014 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
tigersirvine/occtigerscricket
django/contrib/flatpages/tests/views.py
77
6226
import os from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.test import TestCase class FlatpageViewTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): ...
bsd-3-clause
rickerc/nova_audit
nova/tests/virt/baremetal/test_driver.py
7
15658
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # coding=utf-8 # Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 NTT DOCOMO, INC. # Copyright (c) 2011 University of Southern California / ISI # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may ...
apache-2.0
RedHatInsights/insights-core
insights/parsers/qemu_xml.py
1
13011
""" QemuXML - file ``/etc/libvirt/qemu/*.xml`` and ``/var/run/libvirt/qemu/*.xml`` ============================================================================== Parsers provided by this module are: QemuXML - file ``/etc/libvirt/qemu/*.xml`` ------------------------------------------ VarQemuXML - file ``/var/run/lib...
apache-2.0
AkihikoITOH/capybara
capybara/virtualenv/lib/python2.7/site-packages/jinja2/_stringdefs.py
990
404291
# -*- coding: utf-8 -*- """ jinja2._stringdefs ~~~~~~~~~~~~~~~~~~ Strings of all Unicode characters of a certain category. Used for matching in Unicode-aware languages. Run to regenerate. Inspired by chartypes_create.py from the MoinMoin project, original implementation from Pygments. :co...
mit
nyasara/azuremono-docker
IronPython-2.7.4/Lib/asynchat.py
63
11716
# -*- Mode: Python; tab-width: 4 -*- # Id: asynchat.py,v 2.26 2000/09/07 22:29:26 rushing Exp # Author: Sam Rushing <rushing@nightmare.com> # ====================================================================== # Copyright 1996 by Sam Rushing # # All Rights Reserved # # P...
mit
CydarLtd/ansible
lib/ansible/compat/tests/__init__.py
128
1267
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.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 later...
gpl-3.0
ChanderG/scipy
scipy/io/tests/test_netcdf.py
57
9376
''' Tests for netcdf ''' from __future__ import division, print_function, absolute_import import os from os.path import join as pjoin, dirname import shutil import tempfile import warnings from io import BytesIO from glob import glob from contextlib import contextmanager import numpy as np from numpy.testing import a...
bsd-3-clause
kalxas/QGIS
python/plugins/db_manager/db_plugins/info_model.py
33
18079
# -*- 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
Chilledheart/chromium
native_client_sdk/src/build_tools/tests/test_server.py
170
2165
# 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 multiprocessing import os import SimpleHTTPServer class LocalHTTPServer(object): """Class to start a local HTTP server as a child process.""" ...
bsd-3-clause
mschmidt87/python-neo
neo/core/analogsignalarray.py
4
11608
# -*- coding: utf-8 -*- ''' This module implements :class:`AnalogSignalArray`, an array of analog signals. :class:`AnalogSignalArray` derives from :class:`BaseAnalogSignal`, from :module:`neo.core.analogsignal`. :class:`BaseAnalogSignal` inherits from :class:`quantites.Quantity`, which inherits from :class:`numpy.arr...
bsd-3-clause
LumPenPacK/NetworkExtractionFromImages
osx_build/nefi2_osx_amd64_xcode_2015/site-packages/numpy_1.11/numpy/matrixlib/tests/test_defmatrix.py
130
14801
from __future__ import division, absolute_import, print_function import collections import numpy as np from numpy import matrix, asmatrix, bmat from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_raises ) fro...
bsd-2-clause
rbaerzib/xtreemfs
cpp/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/text_format_test.py
48
24654
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
renhaoqi/gem5-stable
ext/ply/example/ansic/cparse.py
164
20153
# ----------------------------------------------------------------------------- # cparse.py # # Simple parser for ANSI C. Based on the grammar in K&R, 2nd Ed. # ----------------------------------------------------------------------------- import sys import clex import ply.yacc as yacc # Get the token map tokens = cl...
bsd-3-clause
dylanlesko/youtube-dl
youtube_dl/extractor/lrt.py
113
2156
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, js_to_json, parse_duration, remove_end, ) class LRTIE(InfoExtractor): IE_NAME = 'lrt.lt' _VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/irasas/(?P<id>...
unlicense
bright-sparks/chromium-spacewalk
third_party/closure_linter/closure_linter/statetracker_test.py
109
3384
#!/usr/bin/env python # # Copyright 2012 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
hpssjellis/forth-tensorflow
aymericdamien-Examples/examples/convolutional_network.py
4
4260
''' A Convolutional Network implementation example using TensorFlow library. This example is using the MNIST database of handwritten digits (http://yann.lecun.com/exdb/mnist/) Author: Aymeric Damien Project: https://github.com/aymericdamien/TensorFlow-Examples/ ''' # Import MINST data import input_data mnist = input_...
mit
feanil/ansible-modules-core
files/xattr.py
134
6197
#!/usr/bin/python # 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 distributed...
gpl-3.0
ABoothInTheWild/baseball-research
true2018PlayoffPreds.py
1
18268
# -*- coding: utf-8 -*- """ Created on Sun Aug 05 22:49:05 2018 @author: Alexander """ #2018 Preseason Playoff Odds import heapq from collections import Counter import pandas as pd import numpy as np from scipy.stats import beta import os #read data os.chdir('C:/Users/abooth/Documents/Python Scripts/...
gpl-3.0
explosion/spaCy
spacy/lang/en/syntax_iterators.py
2
1547
from typing import Union, Iterator from ...symbols import NOUN, PROPN, PRON from ...errors import Errors from ...tokens import Doc, Span def noun_chunks(doclike: Union[Doc, Span]) -> Iterator[Span]: """ Detect base noun phrases from a dependency parse. Works on both Doc and Span. """ labels = [ ...
mit
StructuralNeurobiologyLab/SyConn
syconn/exec/exec_skeleton.py
1
9773
# -*- coding: utf-8 -*- # SyConn - Synaptic connectivity inference toolkit # # Copyright (c) 2016 - now # Max-Planck-Institute of Neurobiology, Munich, Germany # Authors: Philipp Schubert, Alexandra Rother, Joergen Kornfeld import shutil import os import glob from typing import Optional, Union import numpy as np fro...
gpl-2.0
joshmoore/openmicroscopy
components/tools/OmeroWeb/omeroweb/webadmin/templatetags/custom_tags.py
1
4154
#!/usr/bin/env python # # # # Copyright (c) 2008 University of Dundee. # # 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 la...
gpl-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/isis_neighbor_attribute/neighbors/neighbor/subTLVs/subTLVs_/extended_admin_group/state/__init__.py
1
533851
# -*- 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
alexallah/django
django/utils/safestring.py
54
2473
""" Functions for working with "safe strings": strings that can be displayed safely without further escaping in HTML. Marking something as a "safe string" means that the producer of the string has already turned characters that should not be interpreted by the HTML engine (e.g. '<') into the appropriate entities. """ ...
bsd-3-clause
hnakamur/ansible
lib/ansible/plugins/action/__init__.py
3
21405
# (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
joeythesaint/yocto-autobuilder
lib/python2.7/site-packages/zope.interface-3.6.4-py2.7-linux-x86_64.egg/zope/interface/_flatten.py
86
1056
############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
gpl-2.0
tanmaykm/edx-platform
common/djangoapps/track/contexts.py
126
1503
"""Generates common contexts""" import logging from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys.edx.keys import CourseKey from opaque_keys import InvalidKeyError from util.request import COURSE_REGEX log = logging.getLogger(__name__) def course_context_from_url(url): """ Extrac...
agpl-3.0
MrCodeYu/spark
python/pyspark/shell.py
4
2481
# # 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 us...
apache-2.0
fprados/nipype
nipype/interfaces/freesurfer/tests/test_auto_SynthesizeFLASH.py
5
1466
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.freesurfer.preprocess import SynthesizeFLASH def test_SynthesizeFLASH_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), fixed_wei...
bsd-3-clause
ghorn/rawesome
examples/carousel/finalize_trajectory.py
2
11971
# Copyright 2012-2013 Greg Horn # # This file is part of rawesome. # # rawesome 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 Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
lgpl-3.0
jendap/tensorflow
tensorflow/python/data/kernel_tests/shuffle_test.py
6
9716
# 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
sbktechnology/sap_frappe
frappe/website/router.py
27
4725
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, os from frappe.website.utils import can_cache, delete_page_cache from frappe.model.document import get_controller def get_route_info(path): sitemap_options = Non...
mit
mattseymour/django
tests/servers/tests.py
2
4348
""" Tests for django.core.servers. """ import errno import os import socket from urllib.error import HTTPError from urllib.request import urlopen from django.test import LiveServerTestCase, override_settings from django.utils.http import urlencode from .models import Person TEST_ROOT = os.path.dirname(__file__) TEST...
bsd-3-clause
universalcore/springboard
springboard/tools/commands/base.py
1
1240
import sys import yaml from elasticgit.commands.base import ToolCommand, CommandArgument class YAMLFile(object): def __call__(self, file_name): with open(file_name, 'r') as fp: return file_name, yaml.safe_load(fp) class SpringboardToolCommand(ToolCommand): command_arguments = ( ...
bsd-2-clause
r-mibu/ceilometer
ceilometer/hacking/checks.py
8
1717
# Copyright 2015 Huawei Technologies Co., Ltd. # # 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
primiano/depot_tools
third_party/logilab/astroid/brain/pynose.py
56
1977
# copyright 2003-2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid 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 #...
bsd-3-clause
pdxwebdev/yadapy
yada/lib/python2.7/site-packages/setuptools/command/bdist_rpm.py
1049
1508
import distutils.command.bdist_rpm as orig class bdist_rpm(orig.bdist_rpm): """ Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs...
gpl-3.0
ct-23/home-assistant
homeassistant/components/ecobee.py
1
3654
""" Support for Ecobee. For more details about this component, please refer to the documentation at https://home-assistant.io/components/ecobee/ """ import logging import os from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.helpers import ...
apache-2.0
calfonso/ansible
lib/ansible/modules/cloud/amazon/aws_ses_identity_policy.py
78
7303
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: aws_ses_identity_policy s...
gpl-3.0
Novasoft-India/OperERP-AM-Motors
openerp/addons/stock/__init__.py
64
1142
# -*- 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
weitengchu/rt-thread
bsp/realview-a8/rtconfig.py
27
2656
import os # toolchains options ARCH='arm' CPU='realview-a8-vmm' CROSS_TOOL='gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' # EXEC_PATH = r'/opt/arm-2012.09/bin' EXEC_PATH = r'C:\Program Files (x86)\CodeSourcery\Sourcery_CodeBench_Lite_for_ARM_EABI\bin'...
gpl-2.0
dfcf93/RPICS
ArtificialIntelligence/AIPacman/searchAgents.py
1
23290
# searchAgents.py # --------------- # Licensing Information: Please do not distribute or publish solutions to this # project. You are free to use and extend these projects for educational # purposes. The Pacman AI projects were developed at UC Berkeley, primarily by # John DeNero (denero@cs.berkeley.edu) and Dan Klein ...
mit
ovnicraft/odoo_addons
smile_checklist/models/checklist_decorators.py
5
5123
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
2uller/LotF
App/Lib/test/test_zipimport_support.py
4
11100
# This test module covers support in various parts of the standard library # for working with modules located inside zipfiles # The tests are centralised in this fashion to make it easy to drop them # if a platform doesn't support zipimport import test.test_support import os import os.path import sys import tex...
gpl-2.0
rdipietro/tensorflow
tensorflow/contrib/rnn/python/kernel_tests/rnn_test.py
4
18798
# 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