repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
viruxel/ansible-modules-extras
cloud/centurylink/clc_loadbalancer.py
43
35413
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
gpl-3.0
vberaudi/scipy
scipy/optimize/tests/test_optimize.py
21
39326
""" Unit tests for optimization routines from optimize.py Authors: Ed Schofield, Nov 2005 Andrew Straw, April 2008 To run it in its simplest form:: nosetests test_optimize.py """ from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy.testing import (a...
bsd-3-clause
yongshengwang/hue
build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/contrib/admin/validation.py
108
23236
from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.fields import FieldDoesNotExist from django.forms.models import BaseModelForm, BaseModelFormSet, _get_foreign_key from django.contrib.admin.util import get_fields_from_path, NotRelationField """ Does basic ModelA...
apache-2.0
tpsatish95/Universal-MultiDomain-Sentiment-Classifier
SentiHandlers/general.py
1
1193
# Author : Satish Palaniappan __author__ = "Satish Palaniappan" import pickle import config import sys sys.path.append(config.basePath+config.SocialFilter) from SocialFilter.Twokenize.twokenize import * import re class extractor(object): def __init__(self): self.path = config.basePath +config.general self.Senti...
apache-2.0
thnee/ansible
lib/ansible/module_utils/network/meraki/meraki.py
10
19085
# -*- coding: utf-8 -*- # This code is part of Ansible, but is an independent component # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own lic...
gpl-3.0
TwinkleChawla/nova
nova/tests/functional/api_sample_tests/test_access_ips.py
16
4156
# Copyright 2012 Nebula, Inc. # 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...
apache-2.0
N-Parsons/exercism-python
exercises/simple-cipher/simple_cipher_test.py
2
2510
import unittest import re from simple_cipher import Cipher # Tests adapted from `problem-specifications//canonical-data.json` @ v2.0.0 class SimpleCipherTest(unittest.TestCase): # Utility functions def setUp(self): try: self.assertRaisesRegex except AttributeError: se...
mit
lorensen/VTKExamples
src/Python/Visualization/ColorSeriesPatches.py
1
7594
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Produce a HTML page called VTKColorSeriesPatches.html showing the available color series in vtkColorSeries. It also shows how to select the text color based on luminance. In this case Digital CCIR601 is used which gives less weight to the red and blue components of ...
apache-2.0
itmanagerro/tresting
qa/rpc-tests/test_framework/mininode.py
1
54396
#!/usr/bin/env python3 # Copyright (c) 2010 ArtForz -- public domain half-a-node # Copyright (c) 2012 Jeff Garzik # Copyright (c) 2010-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. # # mininode.p...
mit
gundalow/ansible
test/units/module_utils/basic/test_get_file_attributes.py
30
2683
# -*- coding: utf-8 -*- # Copyright: # (c) 2017, Pierre-Louis Bonicoli <pierre-louis@libregerbil.fr> # License: GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = ...
gpl-3.0
huangkuan/hack
lib/gcloud/datastore/test_connection.py
7
31745
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
lifei96/Medium-crawler-with-data-analyzer
User_Crawler/medium_users_data_analyzer.py
2
6117
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.patches as mpatches import datetime import os def users_data_parser(): if not os.path.exists('./result'): os.mkdir('./result') file_in = open('./suspended_username_list.txt', 'r') sus...
mit
mdakin/engine
build/util/lib/common/unittest_util.py
29
4933
# 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. """Utilities for dealing with the python unittest module.""" import fnmatch import sys import unittest class _TextTestResult(unittest._TextTestResult): ...
bsd-3-clause
ZombieGroup/WormForZhihu
zhihu.py
2
47123
# -*- coding: utf-8 -*- ''' ;$$; ############# ##########...
mit
gkno/gkno_launcher
src/networkx/algorithms/richclub.py
47
3516
# -*- coding: utf-8 -*- import networkx as nx __author__ = """\n""".join(['Ben Edwards', 'Aric Hagberg <hagberg@lanl.gov>']) __all__ = ['rich_club_coefficient'] def rich_club_coefficient(G, normalized=True, Q=100): """Return the rich-club coefficient of the graph G. The rich-club ...
mit
jk1/intellij-community
python/helpers/py3only/docutils/parsers/rst/directives/images.py
44
6933
# $Id: images.py 7753 2014-06-24 14:52:59Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Directives for figures and simple images. """ __docformat__ = 'reStructuredText' import sys import urllib.error import urllib.parse import urllib.request...
apache-2.0
Nick-OpusVL/odoo
addons/account/account_bank_statement.py
38
56599
# -*- 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
Martinfx/yodaqa
data/ml/fbpath/evaluate_queries_results.py
1
9997
#!/usr/bin/python -u # # Evaluate fbpath-based query performance (on gold standard and as predicted) # # Usage: evaluate_queries_results.py traindata.json valdata.json # # A model is trained on traindata and then its performance is measured # on valdata. (FIXME: Duplicate code with fbpath_train_logistic, instead # of ...
apache-2.0
karanisverma/flasktest
lib/flask/wrappers.py
773
6709
# -*- coding: utf-8 -*- """ flask.wrappers ~~~~~~~~~~~~~~ Implements the WSGI wrappers (request and response). :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase from werkzeug.exce...
apache-2.0
dmnfarrell/peat
PEATDB/Ekin/Dataset.py
1
9801
#!/usr/bin/env python # # Protein Engineering Analysis Tool DataBase (PEATDB) # Copyright (C) 2010 Damien Farrell & Jens Erik Nielsen # # 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 ver...
mit
rickyHong/Tensorflow_modi
tensorflow/python/kernel_tests/bcast_ops_test.py
5
2202
"""Tests for tensorflow.kernels.bcast_ops.""" import tensorflow.python.platform import tensorflow as tf from tensorflow.python.ops.gen_array_ops import _broadcast_gradient_args class BcastOpsTest(tf.test.TestCase): def _GetGradientArgs(self, xs, ys): with self.test_session() as sess: return sess.run(_...
apache-2.0
athompso/ansible
contrib/inventory/vagrant.py
55
3958
#!/usr/bin/env python """ Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and returns it under the host group 'vagrant' Example Vagrant configuration using this script: config.vm.provision :ansible do |ansible| ansible.playbook = "./provision/your_playbook.yml" ...
gpl-3.0
RonnyPfannschmidt/pip
src/pip/_vendor/chardet/latin1prober.py
290
5370
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
mitch-b/web
pelicanconf.py
1
2084
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = u'Mitchell Barry' AUTHOR_EMAIL = u'mitch.barry@gmail.com' ABOUT_AUTHOR = u'Software Developer, Person' SITENAME = u'Mitchell Barry' SITEURL = 'http://localhost:8000' PATH = 'content' THEME = 'notmyidea' THEME = 'themes/pu...
mit
biddisco/VTK
ThirdParty/Twisted/twisted/names/test/test_names.py
4
29371
# -*- test-case-name: twisted.names.test.test_names -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.names. """ import socket, operator, copy from StringIO import StringIO from twisted.trial import unittest from twisted.internet import reactor, defer, error from...
bsd-3-clause
nvoron23/arangodb
3rdParty/V8-4.3.61/build/gyp/test/additional-targets/gyptest-additional.py
139
1530
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies simple actions when using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('all.g...
apache-2.0
NMGRL/pychron
alembic_dvc/env.py
3
2274
from __future__ import with_statement from logging.config import fileConfig from alembic import context from sqlalchemy import engine_from_config, pool # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Pyth...
apache-2.0
syscoin/syscoin
test/functional/feature_notifications.py
1
9586
#!/usr/bin/env python3 # Copyright (c) 2014-2020 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 -alertnotify, -blocknotify and -walletnotify options.""" import os from test_framework.addres...
mit
stonebig/flexx
examples/ui/chatroom.py
20
2212
""" Simple chat web app in less than 80 lines. """ from flexx import app, ui, react nsamples = 16 @react.input def message_relay(msg): """ One global signal to relay messages to all participants. """ return msg + '<br />' class MessageBox(ui.Label): CSS = """ .flx-messagebox { overflow...
bsd-2-clause
josh-willis/pycbc
pycbc/fft/parser_support.py
14
4879
# Copyright (C) 2012 Josh Willis, Andrew Miller # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is d...
gpl-3.0
jlegendary/youtube-dl
youtube_dl/extractor/minhateca.py
127
2519
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( int_or_none, parse_duration, parse_filesize, ) class MinhatecaIE(InfoExtractor): _VALID_URL = r'https?://minhate...
unlicense
cbrewster/servo
tests/heartbeats/characterize.py
56
10667
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import sys import os from os import path import time import datetime import argparse import platf...
mpl-2.0
yeyuguo/pyodbc
tests3/dbapi20.py
44
31431
#!/usr/bin/env python ''' Python DB API 2.0 driver compliance unit test suite. This software is Public Domain and may be used without restrictions. "Now we have booze and barflies entering the discussion, plus rumours of DBAs on drugs... and I won't tell you what flashes through my mind each time I read...
mit
seanwestfall/django
tests/m2m_signals/tests.py
271
15982
""" Testing signals emitted on changing m2m relations. """ from django.db import models from django.test import TestCase from .models import Car, Part, Person, SportsCar class ManyToManySignalsTest(TestCase): def m2m_changed_signal_receiver(self, signal, sender, **kwargs): message = { 'insta...
bsd-3-clause
filias/django
tests/invalid_models_tests/test_relative_fields.py
15
59901
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import warnings from django.core.checks import Error, Warning as DjangoWarning from django.db import models from django.db.models.fields.related import ForeignObject from django.test import ignore_warnings from django.test.testcases import SimpleTestCa...
bsd-3-clause
BubuLK/sfepy
sfepy/version.py
3
1750
# SfePy version __version__ = '2021.2' # "Minimal" supported versions. NUMPY_MIN_VERSION = '1.3' SCIPY_MIN_VERSION = '0.7' MATPLOTLIB_MIN_VERSION = '0.99.0' PYPARSING_MIN_VERSION = '1.5.0' PYTABLES_MIN_VERSION = '2.1.2' MAYAVI_MIN_VERSION = '3.3.0' SYMPY_MIN_VERSION = '0.7.3' IGAKIT_MIN_VERSION = '0.1' PETSC4PY_MIN_VE...
bsd-3-clause
RafaelTorrealba/odoo
addons/event/__openerp__.py
261
2296
# -*- 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
cabaag/serp
serp/app/tmp.py
1
1102
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'form.ui' # # Created: Wed Feb 18 22:38:35 2015 # by: PyQt5 UI code generator 5.3.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form):...
apache-2.0
thjashin/tensorflow
tensorflow/python/training/adadelta.py
16
4468
# 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
jpinedaf/pyspeckit
docs/example_hcop.py
7
1377
import pyspeckit # load a FITS-compliant spectrum spec = pyspeckit.Spectrum('10074-190_HCOp.fits') # The units are originally frequency (check this by printing spec.xarr.units). # I want to know the velocity. Convert! # Note that this only works because the reference frequency is set in the header spec.xarr.convert_t...
mit
ampax/edx-platform
common/test/acceptance/pages/lms/bookmarks.py
28
2384
""" Courseware Boomarks """ from bok_choy.promise import EmptyPromise from .course_page import CoursePage from ..common.paging import PaginatedUIMixin class BookmarksPage(CoursePage, PaginatedUIMixin): """ Courseware Bookmarks Page. """ url = None url_path = "courseware/" BOOKMARKS_BUTTON_SELE...
agpl-3.0
googleapis/googleapis-gen
google/cloud/talent/v4beta1/talent-v4beta1-py/google/cloud/talent_v4beta1/services/completion/transports/__init__.py
2
1158
# -*- coding: utf-8 -*- # Copyright 2020 Google 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...
apache-2.0
sdgathman/cjdns
node_build/dependencies/libuv/build/gyp/test/rename/gyptest-filecase.py
320
1110
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Checks that files whose file case changes get rebuilt correctly. """ import os import TestGyp test = TestGyp.TestGyp() CHDIR = 'fileca...
gpl-3.0
ApsOps/zulip
zproject/settings.py
73
33382
# Django settings for zulip project. ######################################################################## # Here's how settings for the Zulip project work: # # * settings.py contains non-site-specific and settings configuration # for the Zulip Django app. # * settings.py imports local_settings.py, and any site-spec...
apache-2.0
bojanbog/orbital-academy
python_version/simulation.py
1
1942
from body import Body class Simulation(object): MOUNTAIN_HEIGHT = 1E06 # 1000 km def __init__(self, num_random_objs): self.bodies = [] self.selected_body = None if num_random_objs > 0: self.selected_body = 0 self.bodies.append(Body.generate_circular_equatoria...
mit
Neuvoo/legacy-portage
pym/portage/elog/messages.py
2
3849
# elog/messages.py - elog core functions # Copyright 2006-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import portage portage.proxy.lazyimport.lazyimport(globals(), 'portage.output:colorize', 'portage.util:writemsg', ) from portage.const import EBUILD_PHASES from portage...
gpl-2.0
wzbozon/scikit-learn
examples/ensemble/plot_voting_decision_regions.py
230
2386
""" ================================================== Plot the decision boundaries of a VotingClassifier ================================================== Plot the decision boundaries of a `VotingClassifier` for two features of the Iris dataset. Plot the class probabilities of the first sample in a toy dataset pred...
bsd-3-clause
Yubico/yubiauth
yubiauth/core/__init__.py
2
1495
# # Copyright (c) 2013 Yubico AB # 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 above copyright # notice, this list of condi...
bsd-2-clause
hasibi/EntityLinkingRetrieval-ELR
nordlys/retrieval/scorer.py
1
13963
""" Various retrieval models for scoring a individual document for a given query. @author: Faegheh Hasibi (faegheh.hasibi@idi.ntnu.no) @author: Krisztian Balog (krisztian.balog@uis.no) """ from __future__ import division import math from lucene_tools import Lucene class Scorer(object): """Base scorer class.""" ...
mit
jsgf/xen
tools/python/xen/xend/XendProtocol.py
49
7170
#============================================================================ # 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 hope th...
gpl-2.0
ms-iot/python
cpython/Lib/_collections_abc.py
3
25028
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. Unit tests are in test_collections. """ from abc import ABCMeta, abstractmethod import sys __all__ = ["Awaitable", "Coroutine", "AsyncIterable",...
bsd-3-clause
ns950/calibre
src/calibre/web/__init__.py
15
1789
__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' class Recipe(object): pass def get_download_filename_from_response(response): from urlparse import urlparse from urllib2 import unquote as urllib2_unquote filename = last_part_name = '' try: purl = urlp...
gpl-3.0
sameeptandon/sail-car-log
lidar/FrameFinder.py
1
6213
#!/usr/bin/python # -*- coding: utf-8 -*- import bisect import os import sys EXPORT_RDR = True try: import rosbag except ImportError, e: print 'Failed to import rosbag, not exporting radar' EXPORT_RDR = False sys.path.append('../process') from GPSReader import GPSReader class FrameFinder: """ Creat...
bsd-2-clause
quru/rvsr
networkx/generators/stochastic.py
15
1333
"""Stocastic graph.""" import networkx as nx # Copyright (C) 2010 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. __author__ = "Aric Hagberg <hagberg@lanl.gov>" __all__ = ['stochastic_graph'] def stochastic...
mpl-2.0
elkingtonmcb/linux
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
tectronics/mythbox
resources/lib/IMDbPY/setup.py
5
8321
#!/usr/bin/env python import os import sys import ez_setup ez_setup.use_setuptools() import setuptools # version of the software; in the code repository this represents # the _next_ release. setuptools will automatically add 'dev-rREVISION'. version = '4.7' home_page = 'http://imdbpy.sf.net/' long_desc = """IMDbP...
gpl-2.0
magvugr/AT
EntVirtual/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py
3133
34872
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
alex-quiterio/pychess
lib/pychess/widgets/gamewidget.py
20
40406
""" This module handles the tabbed layout in PyChess """ from __future__ import absolute_import from gi.repository import GdkPixbuf from pychess.compat import StringIO from .BoardControl import BoardControl from .ChessClock import ChessClock from .MenuItemsDict import MenuItemsDict from pychess.System import glock, c...
gpl-3.0
tedder/ansible
test/units/modules/network/dellos10/test_dellos10_config.py
68
6392
# # (c) 2016 Red Hat Inc. # # (c) 2017 Dell EMC. # # 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 ve...
gpl-3.0
willingc/oh-mainline
vendor/packages/celery/celery/bin/celeryd.py
18
7813
# -*- coding: utf-8 -*- """celeryd .. program:: celeryd .. cmdoption:: -c, --concurrency Number of child processes processing the queue. The default is the number of CPUs available on your system. .. cmdoption:: -f, --logfile Path to log file. If no logfile is specified, `stderr` is used. .. cmdoption...
agpl-3.0
jhaux/tensorflow
tensorflow/contrib/keras/python/keras/utils/np_utils.py
73
1816
# 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
googleapis/googleapis-gen
google/cloud/translate/v3beta1/translation-v3beta1-py/google/cloud/translate_v3beta1/services/translation_service/pagers.py
1
5924
# -*- coding: utf-8 -*- # Copyright 2020 Google 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...
apache-2.0
liorvh/infernal-twin
build/pillow/Tests/test_file_ppm.py
11
1028
from helper import unittest, PillowTestCase from PIL import Image # sample ppm stream test_file = "Tests/images/hopper.ppm" data = open(test_file, "rb").read() class TestFilePpm(PillowTestCase): def test_sanity(self): im = Image.open(test_file) im.load() self.assertEqual(im.mode, "RGB")...
gpl-3.0
Juniper/tempest
tempest/tests/lib/services/compute/test_baremetal_nodes_client.py
7
2912
# Copyright 2015 NEC Corporation. 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
matt-kwong/grpc
src/python/grpcio_tests/tests/http2/negative_http2_client.py
6
5342
# Copyright 2016 gRPC 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 applicable law or agreed to in writing...
apache-2.0
ptisserand/ansible
lib/ansible/plugins/action/junos.py
7
4677
# # (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 d...
gpl-3.0
fbradyirl/home-assistant
homeassistant/components/wwlln/geo_location.py
1
6590
"""Support for WWLLN geo location events.""" from datetime import timedelta import logging from aiowwlln.errors import WWLLNError from homeassistant.components.geo_location import GeolocationEvent from homeassistant.const import ( ATTR_ATTRIBUTION, CONF_LATITUDE, CONF_LONGITUDE, CONF_RADIUS, CONF_...
apache-2.0
abdoosh00/edx-platform
lms/djangoapps/bulk_email/migrations/0002_change_field_names.py
182
5798
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Renaming field 'CourseEmail.to' db.rename_column('bulk_email_courseemail', 'to', 'to_option') # Renaming field 'CourseEmail.hash' db.r...
agpl-3.0
aselle/tensorflow
tensorflow/python/debug/wrappers/grpc_wrapper.py
29
8652
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Ozmodian/Wordpress_local
eb/linux/python3/scli/operation/version_operations.py
8
5953
#!/usr/bin/env python #============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the...
gpl-2.0
tgrammat/ML-Data_Challenges
Dato-tutorials/anomaly-detection/visualization_helper_functions.py
3
11251
# libraries required import graphlab.aggregate as agg from matplotlib import pyplot as plt import seaborn as sns def item_freq_plot(data_sf, item_column, hue=None, topk=None, pct_threshold=None ,reverse=False, seaborn_style='whitegrid', seaborn_palette='deep', color='b', **kwargs): '''Function ...
apache-2.0
sumanau7/Ele_CC_Sumanau
lib/IPython/core/formatters.py
5
32800
# -*- coding: utf-8 -*- """Display formatters. Inheritance diagram: .. inheritance-diagram:: IPython.core.formatters :parts: 3 """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import abc import inspect import json import sys import traceback import warnings...
apache-2.0
kaksmet/servo
tests/wpt/harness/wptrunner/browsers/firefox.py
24
9200
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import subprocess import sys import mozinfo from mozprocess import ProcessHandler from mozprofile import Fire...
mpl-2.0
espadrine/opera
chromium/src/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py
139
10217
# Copyright 2012, 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
lijiabogithub/QUANTAXIS
QUANTAXIS/QACmd/strategy_sample_simple.py
1
1511
# encoding: UTF-8 import QUANTAXIS as QA from QUANTAXIS.QAFetch.QAQuery import QA_fetch_data from pymongo import MongoClient from QUANTAXIS.QAUtil import QA_util_date_stamp,QA_util_log_info from QUANTAXIS.QAMarket import QA_QAMarket_bid,QA_Market from QUANTAXIS.QABacktest.QABacktest import QA_Backtest from QUANTAXIS.Q...
mit
sahildua2305/eden
modules/s3cfg.py
2
69474
# -*- coding: utf-8 -*- """ Deployment Settings @requires: U{B{I{gluon}} <http://web2py.com>} @copyright: 2009-2013 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (t...
mit
renyi533/tensorflow
tensorflow/python/ops/proto_ops.py
12
1323
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
neurospin/pylearn-epac
epac/tests/utils.py
1
2333
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on 20 June 2013 @author: jinpeng.li@cea.fr @author: edouard.duchesnay@cea.fr @author: benoit.da_mota@inria.fr """ import numpy as np import copy def _is_numeric(obj): return isinstance(obj, (int, long, float, complex)) def _is_dict_or_array_or_list(ob...
bsd-3-clause
guodongxiaren/thrift
contrib/fb303/py/fb303/FacebookBase.py
173
1917
#!/usr/bin/env python # # 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 # "L...
apache-2.0
mae/tech-hive
node_modules/node-gyp/gyp/tools/graphviz.py
2679
2878
#!/usr/bin/env python # 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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
mit
dprince/python-prettytable
prettytable.py
1
44037
#!/usr/bin/env python # # Copyright (c) 2009, Luke Maurits <luke@maurits.id.au> # All rights reserved. # With contributions from: # * Chris Clark # * Klein Stephane # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # ...
bsd-3-clause
DeltaEpsilon-HackFMI2/FMICalendar-REST
venv/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/compiler.py
93
13247
try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest from django.utils.six.moves import zip from django.db.backends.util import truncate_name, typecast_timestamp from django.db.models.sql import compiler from django.db.models.sql.constants import MULTI f...
mit
memsharded/conan
conans/test/integration/test_package_config_test.py
1
5057
import unittest from conans.test.utils.tools import TestClient test_conanfile = """from conans import ConanFile class test_packageConan(ConanFile): name = "conan_test_package" options = {"shared": [True, False]} default_options = "shared=False" def configure(self): self.output.info("shared (...
mit
thomaslundgaard/pimp
src/serverInterface.py
1
14654
# -*- coding: utf-8 -*- # Pimp - A mpd-frontend to be used as a jukebox at parties. # Copyright (C) 2010 Peter Bjørn # Copyright (C) 2010 Thomas Lundgaard # # 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 F...
gpl-3.0
stasiek/robotframework
utest/running/test_handlers.py
18
13066
import unittest import sys import inspect from robot.running.handlers import _PythonHandler, _JavaHandler, DynamicHandler from robot import utils from robot.utils.asserts import * from robot.running.testlibraries import TestLibrary from robot.running.dynamicmethods import ( GetKeywordArguments, GetKeywordDocumenta...
apache-2.0
UCL-INGI/INGInious
inginious/frontend/pages/api/auth_methods.py
1
1476
# -*- coding: utf-8 -*- # # This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for # more information about the licensing of this file. """ Auth methods """ from inginious.frontend.pages.api._api_page import APIPage class APIAuthMethods(APIPage): """ Endpoint /api/v0/auth_methods ...
agpl-3.0
HiSPARC/station-software
user/python/Lib/json/tests/__init__.py
145
2452
import os import sys import json import doctest import unittest from test import test_support # import json with and without accelerations cjson = test_support.import_fresh_module('json', fresh=['_json']) pyjson = test_support.import_fresh_module('json', blocked=['_json']) # create two base classes that will be used...
gpl-3.0
dmordom/nipype
nipype/interfaces/slicer/tests/test_auto_LabelMapSmoothing.py
5
1363
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.slicer.surface import LabelMapSmoothing def test_LabelMapSmoothing_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), gaussianSigm...
bsd-3-clause
ravindrapanda/tensorflow
tensorflow/contrib/timeseries/python/timeseries/state_space_models/varma.py
28
8893
# 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
sameetb-cuelogic/edx-platform-test
common/djangoapps/track/views/tests/test_segmentio.py
13
21647
"""Ensure we can parse events sent to us from the segment.io webhook integration""" from datetime import datetime import json from ddt import ddt, data, unpack from mock import sentinel from django.contrib.auth.models import User from django.test.client import RequestFactory from django.test.utils import override_se...
agpl-3.0
zding5/Microblog-Flask
flask/lib/python2.7/site-packages/migrate/tests/versioning/test_cfgparse.py
63
1112
#!/usr/bin/python # -*- coding: utf-8 -*- from migrate.versioning import cfgparse from migrate.versioning.repository import * from migrate.versioning.template import Template from migrate.tests import fixture class TestConfigParser(fixture.Base): def test_to_dict(self): """Correctly interpret config res...
mit
dahaic/outerspace
server/lib/ige/ospace/IPlanet.py
2
55054
# # Copyright 2001 - 2016 Ludek Smid [http://www.ospace.net/] # # This file is part of Outer Space. # # Outer Space 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 # (...
gpl-2.0
jmachuca77/ardupilot
Tools/autotest/rover.py
1
249268
#!/usr/bin/env python ''' Drive Rover in SITL AP_FLAKE8_CLEAN ''' from __future__ import print_function import copy import math import operator import os import shutil import sys import time from common import AutoTest from pysim import util from common import AutoTestTimeoutException from common import MsgRcvTi...
gpl-3.0
gdowding/pyvmomi
pyVmomi/Iso8601.py
14
12050
# VMware vSphere Python SDK # Copyright (c) 2008-2015 VMware, Inc. 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 # # ...
apache-2.0
fweik/espresso
testsuite/python/widom_insertion.py
2
3926
# # Copyright (C) 2013-2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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
cloudbase/neutron
neutron/services/timestamp/timestamp_db.py
3
4381
# Copyright 2015 HuaWei Technologies. # # 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
bigswitch/nova
nova/virt/hyperv/hostops.py
1
6821
# Copyright 2012 Cloudbase Solutions Srl # 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 r...
apache-2.0
wkeeling/ansible
lib/ansible/plugins/callback/json.py
34
2423
# (c) 2016, Matt Martz <matt@sivel.net> # # 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
OMS-NetZero/FAIR
versioneer.py
386
68611
# Version: 0.18 """The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy * [![Latest Version] ...
apache-2.0
nirmeshk/oh-mainline
vendor/packages/Pygments/pygments/lexers/web.py
42
135416
# -*- coding: utf-8 -*- """ pygments.lexers.web ~~~~~~~~~~~~~~~~~~~ Lexers for web-related languages and markup. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import copy from pygments.lexer import RegexLexer, ExtendedReg...
agpl-3.0