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
sb1705/AdversarialAutoencoder
adversarialAE/aae_train.py
1
5675
import matplotlib as mpl # This line allows mpl to run with no DISPLAY defined mpl.use('Agg') import sys from keras.models import Model from keras.optimizers import Adam import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' #for tensorflow to work properly #import keras.backend as K import tensorflow as tf import pandas as ...
mit
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/PIL/ExifTags.py
71
5092
# # The Python Imaging Library. # $Id$ # # EXIF tags # # Copyright (c) 2003 by Secret Labs AB # # See the README file for information on usage and redistribution. # ## # This module provides constants and clear-text names for various # well-known EXIF tags. ## ## # Maps EXIF tags to tag names. TAGS = { # possib...
agpl-3.0
felipenaselva/felipe.repository
script.module.urllib3/lib/urllib3/connection.py
137
13003
from __future__ import absolute_import import datetime import logging import os import sys import socket from socket import error as SocketError, timeout as SocketTimeout import warnings from .packages import six from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection from .packages.six.moves.http...
gpl-2.0
ameihm0912/MozDef
lib/utilities/dict2List.py
1
1344
def dict2List(inObj): '''given a dictionary, potentially with multiple sub dictionaries return a list of the dict keys and values ''' if isinstance(inObj, dict): for key, value in inObj.iteritems(): if isinstance(value, dict): for d in dict2List(value): ...
mpl-2.0
pilou-/ansible
lib/ansible/modules/notification/office_365_connector_card.py
57
9491
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Marc Sensenich <hello@marc-sensenich.com> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = t...
gpl-3.0
ishikota/PyPokerEngine
tests/pypokerengine/engine/dealer_message_summarizer_test.py
2
6990
import sys try: from StringIO import StringIO except ImportError: from io import StringIO from tests.base_unittest import BaseUnitTest from pypokerengine.engine.dealer import MessageSummarizer class MessageSummarizerTest(BaseUnitTest): def setUp(self): self.summarizer = MessageSummarizer(verbose=...
mit
linglung/ytdl
youtube_dl/extractor/sohu.py
9
6765
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse_urlencode, ) from ..utils import ExtractorError class SohuIE(InfoExtractor): _VALID_URL = r'https?://(?P<mytv>my\.)?tv\.sohu\.com/.+?/(?(mytv)|n)(?P<...
unlicense
lujinda/cheat
cheat/sheets.py
1
3053
from cheat import cheatsheets from cheat.utils import * import os # @kludge: it breaks the functional paradigm to a degree, but declaring this # var here (versus within get()) gives us a "poor man's" memoization on the # call to get(). This, in turn, spares us from having to call out to the # filesystem more than once...
gpl-3.0
shangwuhencc/shogun
examples/undocumented/python_modular/transfer_multitask_logistic_regression.py
17
1288
#!/usr/bin/env python from numpy import array,hstack from numpy.random import seed, rand from tools.load import LoadMatrix lm=LoadMatrix() traindat = lm.load_numbers('../data/fm_train_real.dat') testdat = lm.load_numbers('../data/fm_test_real.dat') label_traindat = lm.load_labels('../data/label_train_twoclass.dat') p...
gpl-3.0
frt-arch/taiga-back
taiga/projects/history/api.py
3
4482
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
agpl-3.0
kevin-intel/scikit-learn
sklearn/externals/_pilutil.py
15
17784
""" A collection of image utilities using the Python Imaging Library (PIL). This is a local version of utility functions from scipy that are wrapping PIL functionality. These functions are deprecated in scipy 1.0.0 and will be removed in scipy 1.2.0. Therefore, the functionality used in sklearn is copied here. This fi...
bsd-3-clause
cloudera/hue
desktop/core/ext-py/pytest-4.6.11/src/_pytest/mark/__init__.py
3
5297
# -*- coding: utf-8 -*- """ generic mechanism for marking and selecting python functions. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from .legacy import matchkeyword from .legacy import matchmark from .structures import EMPTY_PARAMETERSET_OPTION fro...
apache-2.0
mindw/numpy
tools/test-installed-numpy.py
106
2385
#!/usr/bin/env python from __future__ import division, absolute_import, print_function # A simple script to test the installed version of numpy by calling # 'numpy.test()'. Key features: # -- convenient command-line syntax # -- sets exit status appropriately, useful for automated test environments # It would be b...
bsd-3-clause
verma-varsha/zulip
tools/tests/test_css_parser.py
1
8085
from __future__ import absolute_import from __future__ import print_function from typing import cast, Any import sys import unittest try: from tools.lib.css_parser import ( CssParserException, CssSection, parse, handle_prefluff, handle_postfluff ) except ImportError: ...
apache-2.0
leapcode/soledad
tests/server/test__server_info.py
1
1527
# -*- coding: utf-8 -*- # test__server_info.py # Copyright (C) 2017 LEAP # # 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 versio...
gpl-3.0
sloe/metric
languages/default.py
180
4428
# coding: utf8 { '!langcode!': 'en-us', '!langname!': 'English (US)', '%s %%(shop)': '%s %%(shop)', '%s %%(shop[0])': '%s %%(shop[0])', '%s %%{quark[0]}': '%s %%{quark[0]}', '%s %%{shop[0]}': '%s %%{shop[0]}', '%s %%{shop}': '%s %%{shop}', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '@markmin\x01*...
apache-2.0
xwolf12/scikit-learn
examples/model_selection/plot_train_error_vs_test_error.py
349
2577
""" ========================= Train error vs Test error ========================= Illustration of how the performance of an estimator on unseen data (test data) is not the same as the performance on training data. As the regularization increases the performance on train decreases while the performance on test is optim...
bsd-3-clause
owlzhou/ttornado
env/Lib/encodings/cp866.py
593
34652
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
apache-2.0
saltstar/spark
examples/src/main/python/ml/isotonic_regression_example.py
71
1770
# # 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
dghubble/pyrepo
pyrepo/repo.py
1
8085
# -*- coding: utf-8 -*- """ This module provides a Repository abstraction to allow a file repository to be managed on-disk, via a Pythonic API. """ from . import hosts from . import commands import re # TODO: accept a custom RepoImporter class Repository(object): """ Representation of a repository wh...
mit
EvanK/ansible
lib/ansible/plugins/doc_fragments/vca.py
6
1931
# -*- coding: utf-8 -*- # Copyright: (c) 2016, Charles Paul <cpaul@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Parameters for VCA modules DOCUMENTATION = r''' options: username: description: - T...
gpl-3.0
jgrocha/QGIS
tests/src/python/test_qgsfontutils.py
45
4611
# -*- coding: utf-8 -*- """QGIS Unit tests for core QgsFontUtils class From build dir: ctest -R PyQgsFontUtils -V .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the Li...
gpl-2.0
jhona22baz/blog-flask
python2.7/lib/python2.7/site-packages/jinja2/testsuite/ext.py
402
18086
# -*- coding: utf-8 -*- """ jinja2.testsuite.ext ~~~~~~~~~~~~~~~~~~~~ Tests for the extensions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment, DictLoader...
mit
rileychapman/roscopter-1
mavlink/pymavlink/generator/lib/minixsv/minixsvWrapper.py
79
2400
#!/usr/local/bin/python import sys import getopt from ..genxmlif import GenXmlIfError from xsvalErrorHandler import ErrorHandler, XsvalError from ..minixsv import * from pyxsval import parseAndValidate ########################################## # minixsv Wrapper for calling mi...
bsd-3-clause
andyofmelbourne/crappy_crystals
tests/gpu.py
2
11963
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import afnumpy import afnumpy.fft import numpy as np import crappy_crystals def cpu_3Dflip(a): b = np.empty_like(a) b[:, 0, :] = a[:, 0, :] b[:, 1:, :] = ...
gpl-3.0
grap/stock-logistics-workflow
__unported__/stock_obsolete/wizard/wizard_product_obsolescence.py
19
3472
# -*- coding: utf-8 -*- ############################################################################## # # Author: Joël Grand-Guillaume, Matthieu Dietrich # Copyright 2008-2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gener...
agpl-3.0
geodrinx/gearthview
ext-libs/twisted/web/domhelpers.py
60
8562
# -*- test-case-name: twisted.web.test.test_domhelpers -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A library for performing interesting tasks with DOM objects. """ import StringIO from twisted.web import microdom from twisted.web.microdom import getElementsByTagName, escape, unesc...
gpl-3.0
autosportlabs/RaceCapture_App
settingsview.py
1
5299
# # Race Capture App # # Copyright (C) 2014-2017 Autosport Labs # # This file is part of the Race Capture App # # This 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 ...
gpl-3.0
chetan51/nupic
examples/opf/experiments/opfrunexperiment_test/checkpoints/a/description.py
17
2323
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progr...
gpl-3.0
emory-libraries/eulcore-history
test/test_xmlmap/test_tei.py
1
4530
#!/usr/bin/env python import unittest from os import path from eulcore.xmlmap import load_xmlobject_from_file, NodeListField from eulcore.xmlmap import teimap from testcore import main class ExtendedTei(teimap.Tei): # additional mappings for testing figure = NodeListField('//tei:figure', teimap.TeiFigure) ...
apache-2.0
neumerance/cloudloon2
.venv/lib/python2.7/site-packages/django/contrib/localflavor/nl/forms.py
100
2867
""" NL-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.nl.nl_provinces import PROVINCE_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, Select from djang...
apache-2.0
indico/indico
indico/modules/events/editing/controllers/backend/service.py
4
4520
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from uuid import uuid4 from flask import jsonify from webargs import fields from webargs.flaskparser impo...
mit
pwhelan/djshouts
django/contrib/staticfiles/storage.py
154
2080
import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import FileSystemStorage from django.utils.importlib import import_module from django.contrib.staticfiles import utils class StaticFilesStorage(FileSystemStorage): """ Standard fi...
bsd-3-clause
eiri/echolalia-prototype
echolalia.py
2
2318
#!/usr/bin/env python # coding: utf-8 """ Generate random data for your application """ import argparse, logging, importlib from echolalia.generator import Generator def add_args(): parser = argparse.ArgumentParser( description='Generate random data for your application') parser.add_argument('-w', '--writer'...
mit
megalan247/HexoPod
Controller/sixaxis.py
1
6378
import sys import os import threading joy = { 'leftx': 0.0, 'lefty': 0.0, 'rightx': 0.0, 'righty': 0.0, 'trig0': False, 'trig1': False, 'trig2': False, 'trig3': False, 'buttonup': False, 'buttondown': False, 'buttonleft': False, 'buttonright': False, 'triangle': False, 'circle': False, 'cross...
mit
dongjoon-hyun/neon
examples/babi/train.py
3
4038
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems 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 # # ...
apache-2.0
AntonioMtn/NZBMegaSearch
mechanize/_pullparser.py
134
14352
"""A simple "pull API" for HTML parsing, after Perl's HTML::TokeParser. Examples This program extracts all links from a document. It will print one line for each link, containing the URL and the textual description between the <A>...</A> tags: import pullparser, sys f = file(sys.argv[1]) p = pullparser.PullParser(f...
gpl-2.0
Yukarumya/Yukarum-Redfoxes
testing/talos/talos/test.py
1
24657
import os from talos import filter, utils """ test definitions for Talos """ _TESTS = {} # internal dict of Talos test classes def register_test(): """Decorator to register Talos test classes""" def wrapper(klass): assert issubclass(klass, Test) assert klass.name() not in _TESTS _T...
mpl-2.0
NikolaYolov/invenio_backup
modules/bibformat/lib/elements/bfe_plots_thumb.py
17
2581
# -*- coding: utf-8 -*- ## ## $Id: bfe_CERN_plots.py,v 1.3 2009/03/17 10:55:15 jerome Exp $ ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011 CERN. ## ## Invenio 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 Soft...
gpl-2.0
cyrustabatab/mptcp
utils/python-unit-tests.py
155
6316
import unittest from ns.core import Simulator, Seconds, Config, int64x64_t import ns.core import ns.network import ns.internet import ns.mobility import ns.csma import ns.applications class TestSimulator(unittest.TestCase): def testScheduleNow(self): def callback(args): self._args_received = ...
gpl-2.0
frreiss/tensorflow-fred
tensorflow/python/layers/utils_test.py
15
4880
# 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
ZuluPro/moto
tests/test_kinesis/test_kinesis.py
3
20122
from __future__ import unicode_literals import boto.kinesis from boto.kinesis.exceptions import ResourceNotFoundException, InvalidArgumentException import boto3 import sure # noqa import datetime import time from moto import mock_kinesis, mock_kinesis_deprecated @mock_kinesis_deprecated def test_create_cluster(): ...
apache-2.0
0-wiz-0/audacity
lib-src/lv2/lv2/plugins/eg-metro.lv2/waflib/extras/doxygen.py
176
4926
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from fnmatch import fnmatchcase import os,os.path,re,stat from waflib import Task,Utils,Node,Logs from waflib.TaskGen import feature DOXY_STR='${DOXYGEN} - ' DOXY_FMTS='html l...
gpl-2.0
gavinp/chromium
tools/licenses.py
8
12218
#!/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. """Utility for checking and processing licensing information in third_party directories. Usage: licenses.py <command> Commands: ...
bsd-3-clause
SpectreJan/gnuradio
gr-digital/examples/example_timing.py
49
9180
#!/usr/bin/env python # # Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
gpl-3.0
Gitlab11/odoo
addons/email_template/__init__.py
381
1144
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
masamichi/bite-project
deps/gdata-python-client/samples/apps/marketplace_sample/gdata/apps/data.py
104
1863
#!/usr/bin/python # # Copyright 2010 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 ...
apache-2.0
ForkedReposBak/mxnet
example/gluon/style_transfer/option.py
48
7063
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
dmpayton/foaas-python
foaas.py
1
4997
import random import requests from optparse import OptionParser try: from urllib import quote except ImportError: from urllib.parse import quote __AUTHOR__ = 'Derek Payton <derek.payton@gmail.com>' __LICENSE__ = 'MIT' __VERSION__ = '0.2.0' class FuckingResponse(object): ''' Takes care of making the actu...
mit
omni5cience/django-inlineformfield
.tox/py27/lib/python2.7/site-packages/IPython/testing/iptest.py
7
18568
# -*- coding: utf-8 -*- """IPython Test Suite Runner. This module provides a main entry point to a user script to test IPython itself from the command line. There are two ways of running this script: 1. With the syntax `iptest all`. This runs our entire test suite by calling this script (with different arguments)...
mit
exploreodoo/datStruct
odoo/addons/procurement_jit_stock/procurement_jit_stock.py
130
2001
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
gpl-2.0
jambolo/bitcoin
test/lint/check-doc.py
7
2817
#!/usr/bin/env python3 # Copyright (c) 2015-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' This checks if all command line args are documented. Return value is 0 to indicate no error. Author:...
mit
shahankhatch/scikit-learn
sklearn/preprocessing/_function_transformer.py
163
2407
from ..base import BaseEstimator, TransformerMixin from ..utils import check_array def _identity(X): """The identity function. """ return X class FunctionTransformer(BaseEstimator, TransformerMixin): """Constructs a transformer from an arbitrary callable. A FunctionTransformer forwards its X (a...
bsd-3-clause
tmurph/todo-sync
todo_sync/backends/asana.py
1
19461
import collections import todo_sync.node as node import todo_sync.source as source import todo_sync.helpers as lib DEFAULT_PROJECT_NAME = 'Default Project from Todo-Sync' DEFAULT_TASK_NAME = 'Default Task from Todo-Sync' class RootNode(node.RootNode): def external_remove_child(self, child_node): pass ...
gpl-3.0
exoanalytic/python-skyfield
skyfield/documentation/conf.py
2
7888
# -*- coding: utf-8 -*- # # Skyfield documentation build configuration file, created by # sphinx-quickstart on Sun Feb 17 11:09:09 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
mit
dntt1/youtube-dl
youtube_dl/extractor/pornoxo.py
168
2128
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( str_to_int, ) class PornoXOIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?pornoxo\.com/videos/(?P<id>\d+)/(?P<display_id>[^/]+)\.html' _TEST = { 'url': 'http://www.pornoxo.com/videos/7...
unlicense
wukan1986/kquant_data
kquant_data/processing/merge.py
1
6765
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 指定数据目录,生成对应的合约行业数据 """ import os import numpy as np import pandas as pd from ..api import all_instruments, get_datetime from ..config import __CONFIG_H5_STK_DIR__, __CONFIG_H5_STK_SECTOR_DIR__, __CONFIG_H5_STK_FACTOR_DIR__, \ __CONFIG_H5_STK_WEIGHT_DIR__ from .ut...
bsd-2-clause
devclone/enigma2-9f38fd6
lib/python/Components/config.py
5
55032
from enigma import getPrevAsciiCode from Tools.NumericalTextInput import NumericalTextInput from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists from Components.Harddisk import harddiskmanager from copy import copy as copy_copy from os import path as os_path from time import localtime, strftime # Co...
gpl-2.0
2uller/LotF
App/Lib/site-packages/scipy/linalg/benchmarks/bench_basic.py
4
4065
from __future__ import division, print_function, absolute_import import sys from numpy.testing import * import numpy.linalg as linalg def random(size): return rand(*size) class TestSolve(TestCase): def bench_random(self): basic_solve = linalg.solve print() print(' Solving system...
gpl-2.0
Wafflespeanut/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_pdb.py
170
9594
import sys import _pytest._code def runpdb_and_get_report(testdir, source): p = testdir.makepyfile(source) result = testdir.runpytest_inprocess("--pdb", p) reports = result.reprec.getreports("pytest_runtest_logreport") assert len(reports) == 3, reports # setup/call/teardown return reports[1] cl...
mpl-2.0
souravbadami/zulip
zerver/views/registration.py
5
19453
# -*- coding: utf-8 -*- from __future__ import absolute_import from typing import Any, List, Dict, Optional, Text from django.utils.translation import ugettext as _ from django.conf import settings from django.contrib.auth import authenticate, login, get_backends from django.core.urlresolvers import reverse from djang...
apache-2.0
mapr/impala
thirdparty/thrift-0.9.0/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
171
5961
#!/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
MoamerEncsConcordiaCa/tensorflow
tensorflow/python/kernel_tests/reader_ops_test.py
37
28302
# 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
RaoUmer/django
tests/modeltests/m2m_intermediary/models.py
114
1262
""" 9. Many-to-many relationships via an intermediary table For many-to-many relationships that need extra fields on the intermediary table, use an intermediary model. In this example, an ``Article`` can have multiple ``Reporter`` objects, and each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position`...
bsd-3-clause
alexlib/openptv
py_bind/test/test_img_coord.py
3
2533
import unittest from optv.imgcoord import flat_image_coordinates, image_coordinates from optv.parameters import ControlParams, MultimediaParams from optv.calibration import Calibration import numpy as np class Test_image_coordinates(unittest.TestCase): def setUp(self): self.control = ControlParams(4) ...
lgpl-3.0
mikewiebe-ansible/ansible
lib/ansible/modules/cloud/univention/udm_dns_zone.py
37
6855
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright: (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type...
gpl-3.0
manipopopo/tensorflow
tensorflow/contrib/slim/python/slim/learning_test.py
21
38639
# 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
nitishr/PyHamcrest
tests/hamcrest_unit_test/text/stringmatches_test.py
2
2295
if __name__ == "__main__": import sys sys.path.insert(0, '..') sys.path.insert(0, '../..') from hamcrest.library.text.stringmatches import * from hamcrest_unit_test.matcher_test import MatcherTest import re try: import unittest2 as unittest except ImportError: import unittest __author__ = "Chris ...
bsd-3-clause
mpeuster/son-emu
src/emuvim/api/openstack/__init__.py
15
1158
# Copyright (c) 2015 SONATA-NFV and Paderborn University # 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 re...
apache-2.0
googleads/googleads-python-lib
examples/ad_manager/v202102/creative_service/copy_image_creatives.py
1
2147
#!/usr/bin/env python # # Copyright 2017 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 requir...
apache-2.0
lumig242/Hue-Integration-with-CDAP
desktop/core/ext-py/boto-2.38.0/boto/rds/optiongroup.py
180
15665
# 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
onewaterdrop/reviewcenter
bower_components/bootstrap/test-infra/s3_cache.py
1700
3523
#!/usr/bin/env python2.7 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, remove as _delete_file from os.path import isfile, dirname, basename, abspath from hashlib import sha256 from subprocess import check_call as run from boto.s3....
mit
archf/ansible
lib/ansible/modules/system/runit.py
26
8577
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Brian Coca <bcoca@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
kathryncrouch/Axelrod
axelrod/tests/unit/test_classification.py
3
4859
"""Tests for the classification""" import unittest import axelrod class TestClassification(unittest.TestCase): def test_known_classifiers(self): # A set of dimensions that are known to have been fully applied known_keys = ['stochastic', 'memory_depth', ...
mit
q1ang/scikit-learn
sklearn/decomposition/sparse_pca.py
284
9424
"""Matrix factorization with Sparse PCA""" # Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort # License: BSD 3 clause import numpy as np from ..utils import check_random_state, check_array from ..utils.validation import check_is_fitted from ..linear_model import ridge_regression from ..base import BaseEstimat...
bsd-3-clause
iksaif/biggraphite
tests/test_settings.py
3
1548
#!/usr/bin/env python # Copyright 2018 Criteo # # 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
eerimoq/asn1tools
tests/files/3gpp/lpp_14_3_0.py
1
574359
EXPECTED = {'LPP-PDU-Definitions': {'extensibility-implied': False, 'imports': {}, 'object-classes': {}, 'object-sets': {}, 'tags': 'AUTOMATIC', 'types': {'A-GNSS-Error': {'members': [{'name': 'l...
mit
jeromecn/caravel_viz_full
caravel/migrations/versions/956a063c52b3_adjusting_key_length.py
17
4649
"""adjusting key length Revision ID: 956a063c52b3 Revises: f0fbf6129e13 Create Date: 2016-05-11 17:28:32.407340 """ # revision identifiers, used by Alembic. revision = '956a063c52b3' down_revision = 'f0fbf6129e13' from alembic import op import sqlalchemy as sa def upgrade(): with op.batch_alter_table('cluster...
apache-2.0
jimmy-ren/RPN2T
external/_caffe/tools/extra/resize_and_crop_images.py
6
4602
#!/usr/bin/env python from mincepie import mapreducer, launcher import gflags import os import cv2 from PIL import Image # gflags gflags.DEFINE_string('image_lib', 'opencv', 'OpenCV or PIL, case insensitive. The default value is the faster OpenCV.') gflags.DEFINE_string('input_folder', '', ...
mit
RackSec/ansible
contrib/inventory/ssh_config.py
117
4050
#!/usr/bin/env python # (c) 2014, Tomas Karasek <tomas.karasek@digile.fi> # # 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 # (a...
gpl-3.0
oscarlazoarjona/fast
examples/doctest_08___Three_level_atom_V_symbolic.py
1
72342
# -*- coding: utf-8 -*- # Copyright (C) 2017 Oscar Gerardo Lazo Arjona # mailto: oscar.lazo@correo.nucleares.unam.mx __doc__ = r""" >>> from fast import * >>> from matplotlib import pyplot >>> from sympy import sin,cos,exp,sqrt,pi,zeros,I >>> from numpy import array >>> init_printing() >>> print_ascii = True >>> # p...
gpl-3.0
pulsar-chem/Pulsar-Core
lib/systems/c184.py
1
10334
import pulsar as psr def load_ref_system(): """ Returns c184 as found in the IQMol fragment library. All credit to https://github.com/nutjunkie/IQmol """ return psr.make_system(""" C 6.13980 0.91989 0.91989 C 6.13980 -0.91989 -0.91989 C ...
bsd-3-clause
OmeGak/indico
indico/modules/events/papers/operations.py
2
17816
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals import mimetypes from operator import attrgetter from flask impo...
mit
Workday/OpenFrame
third_party/typ/typ/runner.py
33
32645
# 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 ag...
bsd-3-clause
dednal/chromium.src
tools/code_coverage/croc_scan.py
178
4383
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Crocodile source scanners.""" import re class Scanner(object): """Generic source scanner.""" def __init__(self): """Constructor.""" ...
bsd-3-clause
samim23/python-goose
goose/extractors/metas.py
14
4542
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
apache-2.0
diogommartins/ryu
ryu/lib/ofctl_v1_0.py
6
15984
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
zturchan/CMPUT410-Lab6
v1/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py
60
6183
"""Base Command class, and related routines""" import os import socket import sys import traceback import time from pip import commands from pip.log import logger from pip.baseparser import parser, ConfigOptionParser, UpdatingDefaultsHelpFormatter from pip.download import urlopen from pip.exceptions import (BadComman...
apache-2.0
open-homeautomation/home-assistant
tests/components/media_player/test_yamaha.py
16
2880
"""The tests for the Yamaha Media player platform.""" import unittest import xml.etree.ElementTree as ET import rxv def sample_content(name): """Read content into a string from a file.""" with open('tests/components/media_player/yamaha_samples/%s' % name, encoding='utf-8') as content: r...
apache-2.0
2013Commons/hue
desktop/core/ext-py/Django-1.4.5/django/contrib/comments/forms.py
92
8086
import time from django import forms from django.forms.util import ErrorDict from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.comments.models import Comment from django.utils.crypto import salted_hmac, constant_time_compare from django.utils.encoding import...
apache-2.0
romonzaman/newfies-dialer
newfies/apirest/dnc_contact_serializers.py
4
3203
# -*- coding: utf-8 -*- # # Newfies-Dialer License # http://www.newfies-dialer.org # # 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/. # # Copyright (C) 2011-2015 Star2Bi...
mpl-2.0
andela-bojengwa/talk
venv/lib/python2.7/site-packages/markdown/extensions/fenced_code.py
12
3895
""" Fenced Code Extension for Python Markdown ========================================= This extension adds Fenced Code Blocks to Python-Markdown. See <https://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html> for documentation. Original code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/)....
mit
skoppisetty/idigbio-appliance
testing/TestResultGenerator.py
3
2283
#!/usr/bin/env python # # Copyright (c) 2013 Liu, Yonggang <myidpt@gmail.com>, University of Florida # # This software may be used and distribted according to the terms of the # MIT license: http://www.opensource.org/licenses/mit-license.php # Test functions in result_generator. import sys, os, unittest, tempfile, da...
gpl-3.0
kustodian/ansible
lib/ansible/modules/cloud/openstack/os_network.py
25
8857
#!/usr/bin/python # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSI...
gpl-3.0
natetrue/ReplicatorG
skein_engines/skeinforge-31/skeinforge_application/skeinforge_plugins/craft_plugins/lash.py
2
6958
""" This page is in the table of contents. Lash is a script to partially compensate for the backlash of the tool head. The lash manual page is at: http://www.bitsfrombytes.com/wiki/index.php?title=Skeinforge_Lash The lash tool is ported from Erik de Bruijn's 3D-to-5D-Gcode php GPL'd script at: http://objects.reprap.o...
gpl-2.0
gratipay/gratipay.com
bin/masspay.py
1
10656
#!/usr/bin/env python """This is a script for managing MassPay each week. See documentation here: http://inside.gratipay.com/howto/run-masspay """ from __future__ import absolute_import, division, print_function, unicode_literals import csv import datetime import getpass import os import sys from decimal import...
mit
sdgdsffdsfff/youku-lixian
sohu.py
8
1068
#!/usr/bin/env python __all__ = ['sohu_download'] from common import * def real_url(host, prot, file, new): url = 'http://%s/?prot=%s&file=%s&new=%s' % (host, prot, file, new) start, _, host, key, _, _ = get_html(url).split('|') return '%s%s?key=%s' % (start[:-1], new, key) def sohu_download(url, merge=True): v...
mit
azureplus/hue
desktop/core/ext-py/Django-1.6.10/tests/forms_tests/tests/test_fields.py
46
70057
# -*- coding: utf-8 -*- """ ########## # Fields # ########## Each Field class does some sort of validation. Each Field has a clean() method, which either raises django.forms.ValidationError or returns the "clean" data -- usually a Unicode object, but, in some rare cases, a list. Each Field's __init__() takes at least...
apache-2.0
fboers/jumeg
examples/plot_simulated_connectivity.py
3
5630
#!/usr/bin/env python '''Simple implementations of connectivity measures.''' # Authors : pravsripad@gmail.com # daniel.vandevelden@yahoo.de import sys import numpy as np import matplotlib.pyplot as pl import matplotlib.mlab as mlab n_epochs = 120 sfreq, duration = 1000., 1000 times = np.arange(0, duration...
bsd-3-clause
yannickcr/Sick-Beard
sickbeard/clients/requests/packages/charade/euckrfreq.py
3121
45978
######################## 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