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
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/ZopeInterface/zope/interface/tests/test_element.py
79
1320
############################################################################## # # Copyright (c) 2003 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-3.0
nemobis/BEIC
METS_fileSec_validator.py
1
1331
#!/usr/bin/python # -*- coding: utf-8 -*- """ Extractor to validate a METS file and check the existence and content of the files linked from each fileSec/fileGrp/file/FLocat tag, assumed to contain an MD5 checksum. The "md5sum" utility is required. """ # # (C) Federico Leva and Fondazione BEIC, 2018 # # Distr...
mit
PlotWatt/sql_query_dict
test.py
1
2835
import pytest import sql_query_dict def test_escape_string_with_single_quote(): assert sql_query_dict.quote_string("'a") == '"\'a"' def test_escape_string_with_double_quote(): assert sql_query_dict.quote_string('"a') == "'\"a'" def test_escape_string_with_single_and_double_quote(): assert sql_query_d...
apache-2.0
wizzomafizzo/flairbot
flairbot.py
1
5950
#!/usr/bin/env python3 """Reddit bot for updating user flairs via PM requests""" import sys import re import os import time import logging import logging.handlers import praw import OAuth2Util from config import cfg def setup_logging(): """Configure logging module for rotating logs and console output""" r...
mit
apark263/tensorflow
tensorflow/contrib/linear_optimizer/python/ops/sparse_feature_column_test.py
14
2330
# 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
chubbymaggie/angr
tests/test_rol.py
5
1328
import nose import angr from angr.calling_conventions import SimCCSystemVAMD64 import logging l = logging.getLogger("angr.tests.test_rol") import os test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests')) def test_rol_x86_64(): binary_path = test_location + "/x86_64...
bsd-2-clause
dllsf/odootest
addons/auth_signup/controllers/main.py
165
6011
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
pkexcellent/luigi
examples/elasticsearch_index.py
57
3399
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
Bismarrck/tensorflow
tensorflow/tools/dist_test/scripts_allreduce/k8s_generate_yaml.py
11
2997
#!/usr/bin/python # 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 r...
apache-2.0
therealfakemoot/collections2
collections2/dicts.py
2
2578
from collections import MutableMapping class OrderedDict(MutableMapping): '''OrderedDict is a mapping object that allows for ordered access and insertion of keys. With the exception of the key_index, insert, and reorder_keys methods behavior is identical to stock dictionary objects.''' def __init__(s...
mit
tysonclugg/django
tests/auth_tests/test_validators.py
25
10145
import os from django.contrib.auth import validators from django.contrib.auth.models import User from django.contrib.auth.password_validation import ( CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator, UserAttributeSimilarityValidator, get_default_password_validators, get_password_v...
bsd-3-clause
shootstar/ctest
ceilometer/agent.py
1
3976
# -*- encoding: utf-8 -*- # # Copyright © 2013 Julien Danjou # # Author: Julien Danjou <julien@danjou.info> # # 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/lice...
apache-2.0
hy-2013/scrapy
scrapy/xlib/tx/_newclient.py
159
55339
# -*- test-case-name: twisted.web.test.test_newclient -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An U{HTTP 1.1<http://www.w3.org/Protocols/rfc2616/rfc2616.html>} client. The way to use the functionality provided by this module is to: - Connect a L{HTTP11ClientProtocol} to an HT...
bsd-3-clause
Changaco/oh-mainline
vendor/packages/Django/django/contrib/formtools/tests/wizard/forms.py
90
7721
from __future__ import unicode_literals from django import forms, http from django.conf import settings from django.db import models from django.test import TestCase from django.template.response import TemplateResponse from django.utils.importlib import import_module from django.contrib.auth.models import User from...
agpl-3.0
prodromou87/gem5
src/mem/ruby/network/BasicRouter.py
53
1825
# Copyright (c) 2011 Advanced Micro Devices, 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...
bsd-3-clause
cmunk/protwis
build/management/commands/find_protein_templates.py
3
5163
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.db import connection from build.management.commands.base_build import Command as BaseBuild from protein.models import (Protein, ProteinConformation, ProteinSequenceType, ProteinSegment, ProteinConformati...
apache-2.0
njvack/ge-mri-rtafni
scanner-console/vendor/dicom/filereader.py
4
30365
# filereader.py """Read a dicom media file""" # Copyright (c) 2008-2012 Darcy Mason # This file is part of pydicom, released under a modified MIT license. # See the file license.txt included with this distribution, also # available at http://pydicom.googlecode.com from __future__ import absolute_import # Need zli...
mit
jctanner/ansible
test/support/integration/plugins/modules/mongodb_parameter.py
49
6737
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Loic Blot <loic.blot@unix-experience.fr> # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ impo...
gpl-3.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.3/Lib/bsddb/test/test_thread.py
3
15518
"""TestCases for multi-threaded access to a DB. """ import os import sys import time import errno import shutil import tempfile from pprint import pprint from whrandom import random try: True, False except NameError: True = 1 False = 0 DASH = '-' try: from threading import Thread, currentThread ...
mit
vipulkanade/EventbriteDjango
lib/python2.7/site-packages/gunicorn/_compat.py
30
8763
import sys from gunicorn import six PY26 = (sys.version_info[:2] == (2, 6)) PY33 = (sys.version_info >= (3, 3)) def _check_if_pyc(fname): """Return True if the extension is .pyc, False if .py and None if otherwise""" from imp import find_module from os.path import realpath, dirname, basename, splite...
mit
richardcs/ansible
lib/ansible/modules/network/cloudengine/ce_dldp_interface.py
7
22686
#!/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 distribut...
gpl-3.0
apache/airflow
tests/providers/google/common/utils/test_id_token_credentials.py
3
6936
# 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
bhairavmehta95/flashcard-helper-alexa-skill
sqlalchemy/__init__.py
10
2217
# sqlalchemy/__init__.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .sql import ( alias, all_, and_, any_, asc, bet...
mit
thisispuneet/potato-blog
django/middleware/gzip.py
321
1455
import re from django.utils.text import compress_string from django.utils.cache import patch_vary_headers re_accepts_gzip = re.compile(r'\bgzip\b') class GZipMiddleware(object): """ This middleware compresses content if the browser allows gzip compression. It sets the Vary header accordingly, so that cac...
bsd-3-clause
peiyuwang/pants
src/python/pants/util/netrc.py
33
1725
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import collections i...
apache-2.0
shawngraham/music-lab-scripts
07_louisiana/louisiana.py
3
11115
# -*- coding: utf-8 -*- ## # TRACK 7 # TOO BLUE # Brian Foo (brianfoo.com) # This file builds the sequence file for use with ChucK from the data supplied ## # Library dependancies import csv import json import math import os import pprint import time # Config BPM = 100 # Beats per minute, e.g. 60, 75, 100, 120, 150 D...
mit
alsrgv/tensorflow
tensorflow/python/platform/self_check.py
6
2436
# 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
EliotBerriot/django
django/contrib/admin/__init__.py
562
1243
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # has been referenced in documentation. from django.contrib.admin.decorators import register from django.contrib.admin.filters import ( AllValuesFieldListFilter, BooleanFieldListFilter, ChoicesFieldListFilter, DateFieldListFilter, Fiel...
bsd-3-clause
wkschwartz/django
tests/string_lookup/tests.py
123
2332
from django.test import TestCase from .models import Article, Bar, Base, Child, Foo, Whiz class StringLookupTests(TestCase): def test_string_form_referencing(self): """ Regression test for #1661 and #1662 String form referencing of models works, both as pre and post reference, o...
bsd-3-clause
naro/django-guardian
guardian/tests/other_test.py
35
12667
import guardian from django.contrib.auth.models import AnonymousUser from django.contrib.auth.models import Group from django.contrib.auth.models import Permission from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError fr...
bsd-2-clause
dagnarf/dagkernel
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 License, or (at your option) # any later version. # # This program i...
gpl-2.0
charukiewicz/beer-manager
venv/lib/python3.4/site-packages/flask/module.py
850
1363
# -*- coding: utf-8 -*- """ flask.module ~~~~~~~~~~~~ Implements a class that represents module blueprints. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os from .blueprints import Blueprint def blueprint_is_module(bp): """Used to figure ou...
mit
DBuildService/atomic-reactor
tests/plugins/test_build_source_container.py
1
8892
""" Copyright (c) 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import os import subprocess import tempfile from flexmock import flexmock import pytest import json import tarfile import re from atomic_rea...
bsd-3-clause
ivanhorvath/openshift-tools
openshift/installer/vendored/openshift-ansible-3.6.173.0.59/roles/lib_openshift/library/oc_label.py
7
59170
#!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ ...
apache-2.0
apache/spark
python/pyspark/sql/functions.py
14
161861
# # 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
vitorespindola/home-assistant
homeassistant/components/light/tellstick.py
4
2926
""" Support for Tellstick lights. """ import logging # pylint: disable=no-name-in-module, import-error from homeassistant.components.light import Light, ATTR_BRIGHTNESS from homeassistant.const import ATTR_FRIENDLY_NAME import tellcore.constants as tellcore_constants def setup_platform(hass, config, add_devices_callb...
mit
cpd4t/CPD4T_Minecraft_Workshop
trafficlights.py
2
1305
# import modules import mcpi.minecraft as minecraft from time import sleep # connect python to minecraft mc = minecraft.Minecraft.create() # create CONSTANTS for block and light colours AIR = 0 STONE = 1 WOOL = 35 BLACK = 15 RED = 14 AMBER = 4 GREEN = 5 # clear area in middle of map and move player there mc.setBlock...
cc0-1.0
crossbario/crossbar-fabric-cli
docs/conf.py
1
5424
# -*- coding: utf-8 -*- ##################################################################################### # # Copyright (c) Crossbar.io Technologies GmbH # # Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g. # you have purchased a commercial license), the license terms below appl...
mit
powlo/script.module.pydevd
lib/tests/check_pydevconsole.py
7
3892
import sys import os #Put pydevconsole in the path. sys.argv[0] = os.path.dirname(sys.argv[0]) sys.path.insert(1, os.path.join(os.path.dirname(sys.argv[0]))) print('Running tests with:', sys.executable) print('PYTHONPATH:') print('\n'.join(sorted(sys.path))) import threading import unittest import pydevconsole fro...
epl-1.0
umkay/zulip
zerver/logging_handlers.py
9
3074
from __future__ import absolute_import from django.conf import settings import logging import traceback import platform from django.core import mail from django.http import HttpRequest from django.utils.log import AdminEmailHandler from django.views.debug import ExceptionReporter, get_exception_reporter_filter from...
apache-2.0
vanzaj/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Chapter3_MCMC/github_pull.py
95
2327
#github data scrapper """ variables of interest: indp. variables - language, given as a binary variable. Need 4 positions for 5 langagues - #number of days created ago, 1 position - has wiki? Boolean, 1 position - followers, 1 position - following, 1 position - constant dep. variab...
mit
yahman72/robotframework
src/robot/output/loggerhelper.py
4
4060
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
Lkhagvadelger/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/performance_tests/perftest.py
115
17075
# Copyright (C) 2012 Google Inc. All rights reserved. # Copyright (C) 2012 Zoltan Horvath, Adobe Systems Incorporated. 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 ...
bsd-3-clause
exploreodoo/datStruct
odoo/openerp/addons/test_impex/tests/test_import.py
231
30712
# -*- coding: utf-8 -*- import openerp.modules.registry import openerp from openerp.tests import common from openerp.tools.misc import mute_logger def ok(n): """ Successful import of ``n`` records :param int n: number of records which should have been imported """ return n, 0, 0, 0 def error(row, me...
gpl-2.0
quiet-oceans/motuclient-setuptools
motu/utils_messages.py
1
2031
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Python motu client # # Motu, a high efficient, robust and Standard compliant Web Server for # Geographic Data Dissemination. # # http://cls-motu.sourceforge.net/ # # (C) Copyright 2009-2010, by CLS (Collecte Localisation Satellites) - # http://www.cls.fr - and Contr...
lgpl-3.0
p0psicles/SickGear
sickbeard/notifiers/plex.py
3
11492
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickGear. # # SickGear 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,...
gpl-3.0
JeremieSamson/jasper
client/vocabcompiler.py
34
19268
# -*- coding: utf-8-*- """ Iterates over all the WORDS variables in the modules and creates a vocabulary for the respective stt_engine if needed. """ import os import tempfile import logging import hashlib import subprocess import tarfile import re import contextlib import shutil from abc import ABCMeta, abstractmetho...
mit
thuswa/subdms
subdms/repository.py
1
5729
#!/usr/bin/env python # -*- coding: utf-8 -*- # $Id$ # Last modified Wed Jul 7 20:53:01 2010 on stalker # update count: 604 # # subdms - A document management system based on subversion. # Copyright (C) 2009 Albert Thuswaldner # # This program is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
gromez/Sick-Beard
lib/imdb/linguistics.py
50
9220
""" linguistics module (imdb package). This module provides functions and data to handle in a smart way languages and articles (in various languages) at the beginning of movie titles. Copyright 2009-2012 Davide Alberani <da@erlug.linux.it> 2012 Alberto Malagoli <albemala AT gmail.com> 2009 H. Turg...
gpl-3.0
brandonrobertz/namecoin-core
contrib/zmq/zmq_sub.py
9
3056
#!/usr/bin/env python3 # Copyright (c) 2014-2017 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
alessandrocamilli/l10n-italy
l10n_it_base_location_geonames_import/geonames_import.py
12
1409
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Agile Business Group (http://www.agilebg.com) # @author Lorenzo Battistini <lorenzo.battistini@agilebg.com> # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
Evervolv/android_external_chromium_org
media/tools/layout_tests/layouttests.py
144
8952
# 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. """Layout tests module that is necessary for the layout analyzer. Layout tests are stored in an SVN repository and LayoutTestCaseManager collects these ...
bsd-3-clause
CydarLtd/ansible
lib/ansible/cli/pull.py
30
12743
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
FlorianLudwig/odoo
addons/account_followup/wizard/account_followup_print.py
217
16379
# -*- 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
appneta/boto
boto/ec2/blockdevicemapping.py
149
6372
# Copyright (c) 2009-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 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 wit...
mit
h3biomed/ansible
lib/ansible/parsing/yaml/constructor.py
28
6151
# (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
DDEFISHER/servo
components/script/dom/bindings/codegen/parser/tests/test_incomplete_types.py
276
1731
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestIncompleteTypes { attribute FooInterface attr1; FooInterface method1(FooInterface arg); }; interface FooInterface { }; """) results = parser.finish() harness.ok(True, "T...
mpl-2.0
Charence/stk-code
tools/batch.py
16
3189
from matplotlib import pyplot from os import listdir def is_numeric(x): try: float(x) except ValueError: return False return True avg_lap_time = {} avg_pos = {} avg_speed = {} avg_top = {} total_rescued = {} tests = len(listdir('../../batch'))-1 for file in listdir('...
gpl-3.0
camilonova/django
tests/model_inheritance/test_abstract_inheritance.py
27
12010
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.checks import Error from django.core.exceptions import FieldDoesNotExist, FieldError from django.db import models from django.test import TestCase from d...
bsd-3-clause
hbhzwj/imalse
tools/ns-allinone-3.14.1/ns-3.14.1/src/csma-layout/bindings/modulegen__gcc_LP64.py
12
456237
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-3.0
engdan77/edoAutoHomeMobile
twisted/internet/test/test_inotify.py
10
16534
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the inotify wrapper in L{twisted.internet.inotify}. """ from twisted.internet import defer, reactor from twisted.python import filepath, runtime from twisted.python.reflect import requireModule from twisted.trial import unittest if...
mit
BlueBrain/deap
deap/tools/indicator.py
10
3372
# Copyright (C) 2010 Simon Wessing # TU Dortmund University # # 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 v...
lgpl-3.0
dulems/hue
desktop/core/ext-py/Paste-1.7.2/paste/wsgilib.py
27
20134
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ A module of many disparate routines. """ # functions which moved to paste.request and paste.response # Deprecated around 15 Dec 2005 from paste.r...
apache-2.0
hltbra/pyhistorian
specs/story.py
1
1089
''' >>> story.run() True >>> print output.getvalue() Story: Faked Story #1 In order to write specifications As a python developer I want to write them in Python language <BLANKLINE> Scenario 1: Fake scenario Given I run it ... OK When I type X ... OK Then it shows me X ... OK <BLANKLINE> Ran 1 scenario with...
mit
lukeiwanski/tensorflow-opencl
tensorflow/contrib/legacy_seq2seq/python/kernel_tests/seq2seq_test.py
5
43745
# 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
Danisan/pyafipws
wsfexv1.py
8
33017
#!/usr/bin/python # -*- coding: latin-1 -*- # 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, or (at your option) any later # version. # # This program is distributed in t...
gpl-3.0
belltailjp/scikit-learn
sklearn/decomposition/base.py
313
5647
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Kyle Kastner <kastnerkyle@gmail.com> # # Licen...
bsd-3-clause
WinterNis/sqlalchemy
test/sql/test_ddlemit.py
27
8886
from sqlalchemy.testing import fixtures from sqlalchemy.sql.ddl import SchemaGenerator, SchemaDropper from sqlalchemy import MetaData, Table, Column, Integer, Sequence, ForeignKey from sqlalchemy import schema from sqlalchemy.testing.mock import Mock class EmitDDLTest(fixtures.TestBase): def _mock_connection(sel...
mit
overtherain/scriptfile
software/googleAppEngine/lib/django_1_3/django/utils/daemonize.py
452
1907
import os import sys if os.name == 'posix': def become_daemon(our_home_dir='.', out_log='/dev/null', err_log='/dev/null', umask=022): "Robustly turn into a UNIX daemon, running in our_home_dir." # First fork try: if os.fork() > 0: sys.exit(0...
mit
jmiseikis/HomeAutomation
node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
2214
1347
#!/usr/bin/env python import re import json # http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
dphiggs01/ask_amy
ask_amy/cli/cli_deploy.py
1
10749
import json from subprocess import Popen, PIPE import os import shutil import sys from ask_amy.cli.code_gen.code_generator import CodeGenerator from time import sleep class DeployCLI(object): def create_template(self, skill_name, aws_role='', intent_schema_nm=None): with open(intent_schema_nm) as json_dat...
apache-2.0
bewest/amforth
core/devices/at90usb647/device.py
5
13009
# Partname: AT90USB647 # generated automatically, do not edit MCUREGS = { 'WDTCSR': '&96', 'WDTCSR_WDIF': '$80', 'WDTCSR_WDIE': '$40', 'WDTCSR_WDP': '$27', 'WDTCSR_WDCE': '$10', 'WDTCSR_WDE': '$08', 'PORTA': '&34', 'DDRA': '&33', 'PINA': '&32', 'PORTB': '&37', 'DDRB': '&36', 'PINB': '&35', 'PORT...
gpl-2.0
debasishm89/OpenXMolar
ExtDepLibs/autoit/__init__.py
1
4371
# -*- coding: utf-8 -*- __author__ = 'Jace Xu' __version__ = "0.3" from .autoit import options, properties, commands from .autoit import AutoItError from .autoit import error from .autoit import auto_it_set_option from .autoit import clip_get from .autoit import clip_put from .autoit import is_admin from .autoit imp...
bsd-3-clause
MartynShaw/audacity
lib-src/lv2/lv2/plugins/eg-midigate.lv2/waflib/Options.py
330
5458
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,tempfile,optparse,sys,re from waflib import Logs,Utils,Context cmds='distclean configure build install clean uninstall check dist distcheck'.split() options={} comma...
gpl-2.0
omazapa/root
interpreter/llvm/src/bindings/python/llvm/tests/test_object.py
95
2143
from .base import TestBase from ..object import ObjectFile from ..object import Relocation from ..object import Section from ..object import Symbol class TestObjectFile(TestBase): def get_object_file(self): source = self.get_test_binary() return ObjectFile(filename=source) def test_create_from...
lgpl-2.1
jngeist/hyde
hyde/tests/ext/test_auto_extend.py
3
2111
# -*- coding: utf-8 -*- """ Use nose `$ pip install nose` `$ nosetests` """ from hyde.fs import File, Folder from hyde.generator import Generator from hyde.site import Site from pyquery import PyQuery from nose.tools import nottest TEST_SITE = File(__file__).parent.parent.child_folder('_test') class TestAutoExtend...
mit
Glasgow2015/team-10
env/lib/python2.7/site-packages/cms/tests/signals.py
23
2433
# -*- coding: utf-8 -*- from __future__ import with_statement from contextlib import contextmanager from django.test import TestCase from cms.api import create_page from cms.signals import urls_need_reloading class SignalTester(object): def __init__(self): self.call_count = 0 self.calls = [] ...
apache-2.0
KitKatXperience/platform_external_chromium_org
win8/util/check_sdk_patch.py
68
1559
#!/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. """Script to check that the Windows 8 SDK has been appropriately patched so that it can be used with VS 2010. In practice, t...
bsd-3-clause
hahalml/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Tool/ifl.py
61
2810
"""SCons.Tool.ifl Tool-specific initialization for the Intel Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The...
apache-2.0
syci/OCB
addons/l10n_sg/__openerp__.py
27
1438
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>) { 'name': 'Singapore - Accounting', 'version': '1.0', 'author': 'Tech Receptives', 'website': 'http://www.techreceptives.com', 'ca...
agpl-3.0
onlyjus/pyqtgraph
doc/extensions/qt_doc.py
28
4791
""" Extension for building Qt-like documentation. - Method lists preceding the actual method documentation - Inherited members documented separately - Members inherited from Qt have links to qt-project documentation - Signal documentation """ def setup(app): # probably we will be making a wrapper around au...
mit
bev-a-tron/pledge_service
lib/validictory/__init__.py
14
2300
#!/usr/bin/env python from validictory.validator import (SchemaValidator, FieldValidationError, ValidationError, SchemaError) __all__ = ['validate', 'SchemaValidator', 'FieldValidationError', 'ValidationError', 'SchemaError'] __version__ = '0.9.3' def validate(data, sch...
apache-2.0
vvw/deep_q_rl
deep_q_rl/ale_data_set.py
4
12078
"""This class stores all of the samples for training. It is able to construct randomly selected batches of phi's from the stored history. It allocates more memory than necessary, then shifts all of the data back to 0 when the samples reach the end of the allocated memory. """ import pyximport import numpy as np pyxi...
bsd-3-clause
hypermindr/barbante
barbante/maintenance/tests/TestTasks.py
1
3272
""" Tests for barbante.maintenance.tasks.py. """ import datetime as dt import nose.tools import barbante.maintenance.tasks as tasks from barbante.maintenance.tests.fixtures.MaintenanceFixture import MaintenanceFixture import barbante.tests as tests class TestTasks(MaintenanceFixture): """ Test class for mainten...
mit
wnoc-drexel/gem5-stable
src/cpu/kvm/BaseKvmCPU.py
39
3087
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
Drooids/odoo
addons/web/doc/conf.py
494
8552
# -*- coding: utf-8 -*- # # OpenERP Technical Documentation configuration file, created by # sphinx-quickstart on Fri Feb 17 16:14:06 2012. # # 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. # #...
agpl-3.0
thiriel/maps
django/contrib/localflavor/pl/pl_administrativeunits.py
433
13194
# -*- coding: utf-8 -*- """ Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski """ ADMINISTRATIVE_UNIT_CHOICES = ( ('wroclaw', u'Wrocław'), ('jeleniagora', u'Jelenia Góra'), ('legnica', u'Legnica'), ('boleslawiecki', u'bolesławiecki'), ('dzierzoniows...
bsd-3-clause
JohnReid/seqan
util/py_lib/seqan/pyclangcheck/simple_checks.py
26
4137
#!/usr/bin/env python """Simple source code checks, e.g. trailing whitespace.""" from __future__ import with_statement import bisect import re import sys import violations RULE_TRAILING_WHITESPACE = 'whitespace.trailing' RULE_TEXT_TRAILING_WHITESPACE = 'Trailing whitespace is not allowed.' RULE_TODO_ONE_SPACE = '...
bsd-3-clause
lidavidm/sympy
sympy/polys/tests/test_densebasic.py
3
21443
"""Tests for dense recursive polynomials' basic tools. """ from sympy.polys.densebasic import ( dup_LC, dmp_LC, dup_TC, dmp_TC, dmp_ground_LC, dmp_ground_TC, dmp_true_LT, dup_degree, dmp_degree, dmp_degree_in, dmp_degree_list, dup_strip, dmp_strip, dmp_validate, dup_reverse, dup...
bsd-3-clause
appneta/boto
boto/ec2/autoscale/activity.py
152
3058
# Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/ # # 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 to use, copy, mod...
mit
h3biomed/ansible
lib/ansible/modules/network/avi/avi_wafprofile.py
31
3819
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ANSIB...
gpl-3.0
vberaudi/scipy
scipy/weave/examples/swig2_example.py
100
1596
"""Simple example to show how to use weave.inline on SWIG2 wrapped objects. SWIG2 refers to SWIG versions >= 1.3. To run this example you must build the trivial SWIG2 extension called swig2_ext. To do this you need to do something like this:: $ swig -c++ -python -I. -o swig2_ext_wrap.cxx swig2_ext.i $ g++ -Wall ...
bsd-3-clause
square/pants
src/python/pants/cache/artifact.py
2
4458
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import errno import ...
apache-2.0
amisrs/one-eighty
venv2/lib/python2.7/site-packages/sqlalchemy/sql/elements.py
15
148811
# sql/elements.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Core SQL expression elements, including :class:`.ClauseElement`, :class:`.ColumnE...
mit
shubhamVerma/code-eval
Category - Easy/multiplicationTablesCodeEval.py
1
1412
''' tableCodeEval.py - Solution to Problem Multiplication Tables (Category - Easy) Copyright (C) 2013, Shubham Verma 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 ...
gpl-3.0
moble/sympy
sympy/plotting/pygletplot/managed_window.py
120
3178
from __future__ import print_function, division from pyglet.gl import * from pyglet.window import Window from pyglet.clock import Clock from threading import Thread, Lock gl_lock = Lock() class ManagedWindow(Window): """ A pyglet window with an event loop which executes automatically in a separate thre...
bsd-3-clause
azureplus/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/db/models/sql/query.py
209
5406
from django.db import connections from django.db.models.query import sql from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.sql import aggregates as gis_aggregates from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField from django.contri...
apache-2.0
AISpace2/AISpace2
aispace2/jupyter/csp/csp_xml_to_python.py
1
3954
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 27 12:21:17 2019 @author: zijiazhang """ import itertools import xml.etree.ElementTree as ET from ast import literal_eval as make_tuple from string import Template def findcontain(elem, tag): for child in elem: if tag in child.tag: ...
gpl-3.0
stefanlaheij/ha-buderus
buderus/__init__.py
1
5715
""" Support to communicate with a Buderus KM200 unit. """ import logging import base64 import json import binascii import urllib.request, urllib.error, urllib.parse import voluptuous as vol from io import StringIO from Crypto.Cipher import AES from homeassistant.helpers import config_validation as cv fr...
gpl-3.0
HybridF5/nova
nova/tests/unit/api/openstack/compute/test_flavors.py
7
25560
# Copyright 2012 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