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
olivierlemasle/murano
murano/engine/system/test_fixture.py
3
1723
# Copyright (c) 2015 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
demis001/bio_pieces
bio_pieces/group_references.py
3
2678
''' Usage: group_references <samfile> [--outdir <DIR>] Options: --outdir=<DIR>,-o=<DIR> output directory [Default: group_references_out] Create separate fastq files for each reference in a samfile. ''' from docopt import docopt import pandas as pd from schema import Schema, Use import sys import os import sh i...
gpl-2.0
doduytrung/odoo-8.0
addons/anonymization/anonymization.py
25
28636
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
wylie99998/OSUCS419RTS
node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
1788
1435
#!/usr/bin/env python import re import json # https://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
davidobrien1985/ansible-modules-extras
packaging/os/slackpkg.py
131
6382
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kim Nørgaard # Written by Kim Nørgaard <jasen@jasen.dk> # Based on pkgng module written by bleader <bleader@ratonland.org> # that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com> # that was based on pacman module written by Afterburn <htt...
gpl-3.0
nvazquez/Turtlebots
util/odf/meta.py
98
2136
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
mit
allmyservos/allmyservos
contrib/AllMyServos/PreFlight/TkPreFlightManager.py
1
18278
#!/usr/bin/python ####################################################################### # AllMyServos - Fun with PWM # Copyright (C) 2015 Donate BTC:14rVTppdYQzLrqay5fp2FwP3AXvn3VSZxQ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
gpl-2.0
will-moore/openmicroscopy
components/tools/OmeroPy/src/omero/util/import_candidates.py
15
2312
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Utility method for calling the equivalent of "bin/omero import -f". Results are parsed when using as_dictionary. Copyright 2009 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import omero from omer...
gpl-2.0
photoninger/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_host.py
34
4115
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.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
hchen1202/django-react
virtualenv/lib/python3.6/site-packages/django/core/cache/backends/db.py
480
8628
"Database cache backend." import base64 from datetime import datetime from django.conf import settings from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.db import DatabaseError, connections, models, router, transaction from django.utils import six, timezone from django.utils.encoding i...
mit
nathanaevitas/odoo
openerp/addons/l10n_co/__openerp__.py
256
1794
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) David Arnold (devCO). # Author David Arnold (devCO), dar@devco.co # Co-Authors Juan Pablo Aries (devCO), jpa@devco.co # Hector Ivan ...
agpl-3.0
mozilla/git-repo
subcmds/cherry_pick.py
40
3432
# # Copyright (C) 2010 The Android Open Source Project # # 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 la...
apache-2.0
alikins/ansible
lib/ansible/modules/cloud/vultr/vr_account_facts.py
39
3338
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, René Moser <mail@renemoser.net> # 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
j5shi/Thruster
pylibs/test/test_syntax.py
12
19310
"""This module tests SyntaxErrors. Here's an example of the sort of thing that is tested. >>> def f(x): ... global x Traceback (most recent call last): SyntaxError: name 'x' is local and global (<doctest test.test_syntax[0]>, line 1) The tests are all raise SyntaxErrors. They were created by checking ...
gpl-2.0
capybaralet/keras
keras/layers/core.py
1
6052
# -*- coding: utf-8 -*- from __future__ import absolute_import, division import theano import theano.tensor as T from .. import activations, initializations from ..utils.theano_utils import shared_zeros, floatX from ..utils.generic_utils import make_tuple from theano.sandbox.rng_mrg import MRG_RandomStreams as Rando...
mit
strongholder/celery-haystack
docs/conf.py
7
7529
# -*- coding: utf-8 -*- # # celery-haystack documentation build configuration file, created by # sphinx-quickstart on Sat Sep 17 14:02:10 2011. # # 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....
bsd-3-clause
bobthekingofegypt/servo
tests/wpt/css-tests/tools/wptserve/tests/functional/test_response.py
299
1931
import os import unittest import urllib2 import json import time from types import MethodType import wptserve from base import TestUsingServer, doc_root def send_body_as_header(self): if self._response.add_required_headers: self.write_default_headers() self.write("X-Body: ") self._headers_complet...
mpl-2.0
windskyer/nova
nova/tests/unit/scheduler/test_caching_scheduler.py
3
7409
# Copyright (c) 2014 Rackspace Hosting # 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 req...
gpl-2.0
cherrydocker/minos
owl/owl/settings.py
5
7208
# Django settings for owl project. import os, django # calculated paths for django and the site # used as starting points for various other paths DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__)) SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) DEBUG = False TEMPLATE_DEBUG = DEBUG ALLOWED_HOSTS ...
apache-2.0
LonamiWebs/Telethon
readthedocs/conf.py
2
6243
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Telethon documentation build configuration file, created by # sphinx-quickstart on Fri Nov 17 15:36:11 2017. # # 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 # a...
mit
badbytes/pymeg
mswtools/pysel.py
1
2412
#!/usr/bin/python # pysel import os import wx class MyTextDropTarget(wx.TextDropTarget): def __init__(self, object): wx.TextDropTarget.__init__(self) self.object = object def OnDropText(self, x, y, data): self.object.InsertStringItem(0, data) return data class DragDrop(wx.F...
gpl-3.0
erreur404/Gnubiquity
robot/server_setup/naoQiFramework/naoqi.py
4
12681
import os import sys import ctypes import weakref import logging import inspect import qi def load_inaoqi_deps(): """ Helper to laod _inaoqi.so deps on linux """ deps = [ "libboost_python.so", "libboost_system.so", "libboost_chrono.so", "libboost_program_options....
gpl-2.0
thjashin/tensorflow
tensorflow/python/training/gradient_descent_test.py
81
11045
# 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
Coaxis-ASP/open-printing-tunnel
daemon/api/tests/test_config_editor.py
2
9401
import os import tempfile import unittest from config_editor import ConfigEditor if 'IN_DOCKER' in os.environ: TEMPLATE_PATH = os.path.join('/etc', 'mast', 'template') else: working_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEMPLATE_PATH = os.path.join(working_dir, '..', 'template'...
gpl-3.0
jankoslavic/numpy
numpy/f2py/cfuncs.py
23
42766
#!/usr/bin/env python """ C declarations, CPP macros, and C functions for f2py2e. Only required declarations/macros/functions will be used. Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumP...
bsd-3-clause
UXE/local-edx
lms/djangoapps/shoppingcart/views.py
2
33239
import logging import datetime import decimal import pytz from django.conf import settings from django.contrib.auth.models import Group from django.http import ( HttpResponse, HttpResponseRedirect, HttpResponseNotFound, HttpResponseBadRequest, HttpResponseForbidden, Http404 ) from django.utils.translation impor...
agpl-3.0
kelvan/gotoVienna
gotovienna/tests/realtime.py
1
4692
# -*- coding: utf-8 -*- from nose.tools import assert_equal, assert_true, assert_false, assert_is_instance import sys import os from datetime import datetime sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) DATAPATH = os.path.join(os.path.dirname(__file__), 'data') # bananas for the monkey class datetim...
gpl-3.0
hurricup/intellij-community
python/helpers/pycharm_generator_utils/module_redeclarator.py
2
50987
import keyword from pycharm_generator_utils.util_methods import * from pycharm_generator_utils.constants import * class emptylistdict(dict): """defaultdict not available before 2.5; simplest reimplementation using [] as default""" def __getitem__(self, item): if item in self: return dict...
apache-2.0
fairbird/OpenPLI-TSimage
lib/python/Components/Language.py
2
4664
import gettext import os from Tools.Directories import SCOPE_LANGUAGE, resolveFilename, fileExists import language_cache Translation = [['English', 'en', 'EN'], ['German', 'de', 'DE'], ['Arabic', 'ar', 'AE'], ['Brazilian Portuguese', 'pt_BR', 'BR'], ['Catalan', 'ca', 'AD'], ['Croatian', 'hr', 'HR'], ['Czech', 'cs...
gpl-2.0
fjbatresv/odoo
addons/mrp_operations/report/mrp_wc_barcode.py
381
1501
# -*- 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...
agpl-3.0
ivanalejandro0/leap_vpn
src/leap/vpn/windowsvpnlauncher.py
1
2411
# -*- coding: utf-8 -*- # windowsvpnlauncher.py # Copyright (C) 2013 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 versi...
gpl-3.0
e0ne/cinder
cinder/openstack/common/service.py
6
14889
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
yatinkumbhare/openstack-nova
nova/compute/manager.py
1
287383
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
nzlosh/st2
st2api/tests/unit/controllers/v1/test_rule_enforcement_views.py
3
5011
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
nrwahl2/ansible
lib/ansible/modules/windows/win_say.py
47
4581
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # # 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, eith...
gpl-3.0
Averroes/raft
core/workers/DomFuzzerThread.py
11
18496
# # Author: Gregory Fleischer (gfleischer@gmail.com) # # Copyright (c) 2011 RAFT Team # # This file is part of RAFT. # # RAFT 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...
gpl-3.0
eduNEXT/edunext-platform
common/djangoapps/util/keyword_substitution.py
4
2345
""" keyword_substitution.py Contains utility functions to help substitute keywords in a text body with the appropriate user / course data. Supported: LMS: - %%USER_ID%% => anonymous user id - %%USER_FULLNAME%% => User's full name - %%COURSE_DISPLAY_NAME%% => display name of the course ...
agpl-3.0
alexandreleroux/mayavi
mayavi/components/glyph_source.py
3
9623
"""A component that allows creates the source for the glyphs and handle transformation. """ # Author: KK Rai (kk.rai [at] iitb.ac.in) # R. Ambareesha (ambareesha [at] iitb.ac.in) # Prabhu Ramachandran <prabhu_r@users.sf.net> # Enthought library imports. from traits.api import (Instance, List, Trait, Bo...
bsd-3-clause
pbrod/scipy
scipy/sparse/linalg/isolve/minres.py
128
9207
from __future__ import division, print_function, absolute_import from numpy import sqrt, inner, finfo, zeros from numpy.linalg import norm from .utils import make_system from .iterative import set_docstring __all__ = ['minres'] header = \ """Use MINimum RESidual iteration to solve Ax=b MINRES minimizes norm(A*x -...
bsd-3-clause
mfazekas/safaridriver
selenium/src/py/lib/docutils/languages/sk.py
5
1977
# :Author: Miroslav Vasko # :Contact: zemiak@zoznam.sk # :Revision: $Revision: 2224 $ # :Date: $Date: 2004-06-05 21:40:46 +0200 (Sat, 05 Jun 2004) $ # :Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutil...
apache-2.0
pombredanne/grr
gui/plugins/usage.py
6
13216
#!/usr/bin/env python """GUI elements to display usage statistics.""" import operator from grr.gui import renderers from grr.gui.plugins import semantic from grr.gui.plugins import statistics from grr.lib import aff4 from grr.lib import config_lib from grr.lib import flow as lib_flow from grr.lib import rdfvalue fro...
apache-2.0
cyb0/volatility
volatility/plugins/dlldump.py
44
4929
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # # Additional Authors: # Mike Auty <mike.auty@gmail.com> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of...
gpl-2.0
Spoken-tutorial/spoken-website
certificate/migrations/0004_auto_20160818_1609.py
1
2044
# -*- coding: utf-8 -*- # Third Party Stuff from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('certificate', '0003_auto_20160816_1148'), ] operations = [ migrations.DeleteModel( name='Dwsim_participant', ), mig...
gpl-3.0
crs4/omero.biobank
bl/vl/app/snp_manager/convert_sam.py
1
5388
# BEGIN_COPYRIGHT # END_COPYRIGHT """ Parse a `SAM <http://samtools.sourceforge.net/>`_ file and output alignment info in one of the following formats: * tabular, suitable for processing by the marker alignment importer * tabular, suitable for processing by the `Galaxy <http://galaxyproject.org/>`_ DNA extractor E...
gpl-2.0
richardingham/octopus
octopus/transport/phidgets.py
1
1869
# Twisted Imports from twisted.internet import reactor, defer, task from twisted.internet.interfaces import IAddress from twisted.python import log # Zope Imports from zope.interface import implementer # Phidget Imports from Phidgets.PhidgetException import PhidgetErrorCodes, PhidgetException # System Imports import...
mit
b-dev/django-cms-storelocator
store_locator/migrations/0006_auto__del_field_storelocator_longitude__del_field_storelocator_address.py
2
4669
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'StoreLocator.longitude' db.delete_column('cmsplugin_storelocator', 'longitude') ...
bsd-3-clause
lilredindy/selenium
py/test/selenium/webdriver/common/select_class_tests.py
51
15528
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
like9729/interactive-tutorials
ideone/__init__.py
5
10775
from suds.client import Client from suds.xsd.doctor import ImportDoctor, Import import difflib class Status(object): AWAITING_COMPILATION = -1 DONE = 0 COMPILING = 1 RUNNING = 3 class Result(object): NOT_RUN = 0 COMPILATION_ERROR = 11 RUNTIME_ERROR = 12 TIME_LIMIT_EXCEEDED = 13 SUC...
apache-2.0
rahul67/hue
desktop/core/ext-py/kazoo-2.0/kazoo/tests/test_lock.py
36
16235
import uuid import threading from nose.tools import eq_, ok_ from kazoo.exceptions import CancelledError from kazoo.exceptions import LockTimeout from kazoo.testing import KazooTestCase from kazoo.tests.util import wait class KazooLockTests(KazooTestCase): def setUp(self): super(KazooLockTests, self).se...
apache-2.0
dadiletta/Saber
venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/charade/langhebrewmodel.py
2763
11318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
mit
nvoron23/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/smtpd.py
142
18050
#! /usr/bin/env python """An RFC 2821 smtp proxy. Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]] Options: --nosetuid -n This program generally tries to setuid `nobody', unless this flag is set. The setuid call will fail if this program is not run as root (in ...
apache-2.0
dotcool/zulip
zerver/lib/bugdown/codehilite.py
116
8441
""" CodeHilite Extension for Python-Markdown ======================================== Adds code/syntax highlighting to standard Python-Markdown code blocks. Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/). Project website: <http://packages.python.org/Markdown/extensions/code_hilite.html> Contact: markdo...
apache-2.0
missionpinball/mpf
mpf/tests/test_Dmd.py
1
1332
from mpf.tests.MpfBcpTestCase import MpfBcpTestCase from mpf.tests.MpfTestCase import test_config class TestDmd(MpfBcpTestCase): def get_machine_path(self): return 'tests/machine_files/dmd/' @test_config("testDmd.yaml") def testDmd(self): self.machine.dmds["test_dmd"].update(b'12345') ...
mit
cwu2011/scikit-learn
examples/ensemble/plot_forest_importances.py
241
1761
""" ========================================= Feature importances with forests of trees ========================================= This examples shows the use of forests of trees to evaluate the importance of features on an artificial classification task. The red bars are the feature importances of the forest, along wi...
bsd-3-clause
sventech/YAK-server
test_project/test_app/migrations/0004_auto_20150605_2118.py
2
1386
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.auth.models class Migration(migrations.Migration): dependencies = [ ('test_app', '0003_article'), ] operations = [ migrations.AlterModelManagers( na...
mit
catapult-project/catapult-csm
third_party/google-endpoints/setuptools/command/upload_docs.py
62
7234
# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). """ from base64 import standard_b64encode from distutils import log from distutils.errors import DistutilsOptionError import os import socket import zipfile import tempfile import ...
bsd-3-clause
Depado/pexpect
examples/monitor.py
20
7437
#!/usr/bin/env python ''' This runs a sequence of commands on a remote host using SSH. It runs a simple system checks such as uptime and free to monitor the state of the remote host. ./monitor.py [-s server_hostname] [-u username] [-p password] -s : hostname of the remote server to login to. -u : username to ...
isc
chouseknecht/ansible
lib/ansible/modules/database/postgresql/postgresql_membership.py
3
6248
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> # 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 =...
gpl-3.0
MonetaryUnit/MUE-Src
contrib/pyminer/pyminer.py
3
6494
#!/usr/bin/python # # Copyright (c) 2009-2015 Bitcoin Developers # Copyright (c) 2014-2015 MonetaryUnit Developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import s...
mit
siosio/intellij-community
python/helpers/coveragepy/coverage/pytracer.py
40
6089
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Raw data collector for coverage.py.""" import dis import sys from coverage import env # We need the YIELD_VALUE opcode below, in a comparison-friendly form. Y...
apache-2.0
OpenPymeMx/OCB
addons/base_action_rule/base_action_rule.py
4
13868
# -*- 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
zanderle/django
tests/csrf_tests/tests.py
152
19350
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.conf import settings from django.http import HttpRequest, HttpResponse from django.middleware.csrf import ( CSRF_KEY_LENGTH, CsrfViewMiddleware, get_token, ) from django.template import RequestContext, Template from django....
bsd-3-clause
OpusVL/odoo
addons/l10n_ma/l10n_ma.py
8
1885
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
gotostack/swift
test/unit/common/middleware/test_slo.py
2
65372
# -*- coding: utf-8 -*- # Copyright (c) 2013 OpenStack Foundation # # 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 appl...
apache-2.0
Tokyo-Buffalo/tokyosouth
env/lib/python3.6/site-packages/twisted/conch/client/default.py
1
11148
# -*- test-case-name: twisted.conch.test.test_knownhosts,twisted.conch.test.test_default -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Various classes and functions for implementing user-interaction in the command-line conch client. You probably shouldn't use anything in this module ...
mit
shanemcd/ansible
lib/ansible/modules/cloud/univention/udm_user.py
29
21233
#!/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
strogo/djpcms
djpcms/admin.py
1
5098
# # TO USE WITH DJANGO. # # A bit outdated really but still works fine. # # # from django import template, http from django.forms.forms import pretty_name from django.contrib import admin from django.contrib.sites.models import Site from django.shortcuts import get_object_or_404, render_to_response from django.utils.en...
bsd-3-clause
ddub/lint-review
tests/test_github.py
2
2712
import lintreview.github as github from . import load_fixture from mock import call from mock import patch from mock import Mock from nose.tools import eq_ from pygithub3 import Github from requests.models import Response config = { 'GITHUB_URL': 'https://api.github.com/', 'GITHUB_USER': 'octocat', 'GITH...
mit
magvugr/AT
EntVirtual/lib/python2.7/site-packages/django/contrib/flatpages/views.py
199
2747
from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.shortcuts import get_current_site from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404 from django.template import loader from django.uti...
gpl-3.0
havard024/prego
venv/lib/python2.7/site-packages/sphinx/apidoc.py
8
14005
# -*- coding: utf-8 -*- """ sphinx.apidoc ~~~~~~~~~~~~~ Parses a directory tree looking for Python modules and packages and creates ReST files appropriately to create code documentation with Sphinx. It also creates a modules index (named modules.<suffix>). This is derived from the "sphinx-aut...
mit
anubhav929/eden
modules/tests/inv/receive_item.py
1
3670
""" Sahana Eden Module Automated Tests - INV002 Receive Items @copyright: 2011-2012 (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 (the "Software"), to deal in the Softwar...
mit
bolkedebruin/airflow
airflow/contrib/operators/emr_terminate_job_flow_operator.py
1
1245
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
liberatorqjw/scikit-learn
examples/semi_supervised/plot_label_propagation_structure.py
247
2432
""" ============================================== Label Propagation learning a complex structure ============================================== Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and the inner circle "blue". Be...
bsd-3-clause
agiliq/django
django/contrib/redirects/middleware.py
109
1861
from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.contrib.redirects.models import Redirect from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured from django import http class RedirectFallback...
bsd-3-clause
lzambella/Qyoutube-dl
youtube_dl/extractor/gamespot.py
105
3168
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_urlparse, ) from ..utils import ( unescapeHTML, ) class GameSpotIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?gamespot\.com/.*-(?P<id>\d+)/?...
gpl-3.0
birdonwheels5/p2pool-dgbScrypt
nattraverso/pynupnp/soap.py
288
3547
""" This module is a SOAP client using twisted's deferreds. It uses the SOAPpy package. @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" import SOAPpy, logging from SOAPpy.Config import Config from...
gpl-3.0
graphql-python/graphene
graphene/types/objecttype.py
1
5873
from .base import BaseOptions, BaseType, BaseTypeMeta from .field import Field from .interface import Interface from .utils import yank_fields_from_attrs try: from dataclasses import make_dataclass, field except ImportError: from ..pyutils.dataclasses import make_dataclass, field # type: ignore # For static ...
mit
mdavid/horizon
openstack_dashboard/dashboards/identity/users/tests.py
14
28137
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
Lh4cKg/kivy
kivy/input/providers/mouse.py
3
7801
''' Mouse provider implementation ============================= On linux system, mouse provider can be annoying when used with another multitouch provider (hidinput or mtdev.). Mouse can conflict with them: a single touch can generate one event from mouse provider and from multitouch provider. To avoid this behavior,...
lgpl-3.0
gavioto/tapiriik
tapiriik/requests_lib.py
12
1609
# For whatever reason there's no built-in way to specify a global timeout for requests operations. # socket.setdefaulttimeout doesn't work since requests overriddes the default with its own default. # There's probably a better way to do this in requests 2.x, but... def patch_requests_with_default_timeout(timeout): im...
apache-2.0
karllessard/tensorflow
tensorflow/python/debug/cli/analyzer_cli.py
14
58700
# 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
fibbo/DIRAC
ConfigurationSystem/test/test_Resources.py
7
2535
import unittest from DIRAC.Core.Base import Script from DIRAC.ConfigurationSystem.Client.Helpers.Resources import Resources class ResourcesTestCase( unittest.TestCase ): def setUp( self ): Script.disableCS( ) Script.parseCommandLine() self.resources = Resources() def test_getSites( self ): ...
gpl-3.0
miguelfervi/SSBW-Restaurantes
restaurantes/lib/python2.7/site-packages/django/conf/locale/de/formats.py
504
1100
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
gpl-3.0
svilaa/item_database
item_database/iitem_database/urls.py
1
2533
from django.conf.urls import patterns, include, url from rest_framework.urlpatterns import format_suffix_patterns from iitem_database.views import APIUserList, APIUserDetail from iitem_database.views import APIItemList, APIItemDetail from iitem_database.views import APIItemClassList, APIItemClassDetail from iitem_datab...
gpl-3.0
bertucho/epic-movie-quotes-quiz
dialogos/build/Twisted/twisted/conch/scripts/ckeygen.py
8
7540
# -*- test-case-name: twisted.conch.test.test_ckeygen -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implementation module for the `ckeygen` command. """ import sys, os, getpass, socket if getpass.getpass == getpass.unix_getpass: try: import termios # hack around broken te...
mit
ned14/BEurtle
Installer/test/ZSI-2.1-a1/test/wsdl2py/test_Manufacturer.py
2
1475
#!/usr/bin/env python ############################################################################ # Joshua R. Boverhof, LBNL # See LBNLCopyright for copyright notice! ########################################################################### import os, sys, unittest from ServiceTest import main, ServiceTestCase, Serv...
lgpl-2.1
beacloudgenius/edx-platform
cms/djangoapps/contentstore/views/import_export.py
16
19272
""" These views handle all actions in Studio related to import and exporting of courses """ import base64 import logging import os import re import shutil import tarfile from path import path from tempfile import mkdtemp from django.conf import settings from django.contrib.auth.decorators import login_required from dj...
agpl-3.0
neilzim/SCDA
old_notebooks/test_ampl_wrapper_irisao.py
1
1359
#!/usr/bin/env python3 """ Test the functionaility of the core SCDA 02/14/2016 -- created by NTZ """ import scda import numpy as np import matplotlib.pyplot as plt import os import sys if __name__ == "__main__": scda.configure_log("wrapper_test.log") test_dir = "test_scda_aplc" # nominal destination for n...
mit
rtruxal/metagoofil
hachoir_parser/misc/ttf.py
95
9417
""" TrueType Font parser. Documents: - "An Introduction to TrueType Fonts: A look inside the TTF format" written by "NRSI: Computers & Writing Systems" http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=IWS-Chapter08 Author: Victor Stinner Creation date: 2007-02-08 """ from hachoir_parser import...
gpl-2.0
jcoady9/python-for-android
python-modules/twisted/twisted/conch/test/test_helper.py
61
18258
# -*- test-case-name: twisted.conch.test.test_helper -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.conch.insults import helper from twisted.conch.insults.insults import G0, G1, G2, G3 from twisted.conch.insults.insults import modes, privateModes from twisted.conch.i...
apache-2.0
xdje42/gdb
gdb/testsuite/dg-extract-results.py
70
23573
#!/usr/bin/python # # Copyright (C) 2014 Free Software Foundation, Inc. # # This script 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. import sys im...
gpl-2.0
jlegendary/PyTeaser
goose/network.py
4
1564
# -*- 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...
mit
koorukuroo/networkx_for_unicode
build/lib/networkx/generators/tests/test_random_graphs.py
8
4381
#!/usr/bin/env python from nose.tools import * from networkx import * from networkx.generators.random_graphs import * class TestGeneratorsRandom(): def smoke_test_random_graph(self): seed = 42 G=gnp_random_graph(100,0.25,seed) G=binomial_graph(100,0.25,seed) G=erdos_renyi_graph(100,...
bsd-3-clause
BizzyBane/qBittorrent
src/searchengine/nova3/engines/piratebay.py
5
7593
#VERSION: 2.11 #AUTHORS: Fabien Devaux (fab@gnux.info) #CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org) # Arthur (custparasite@gmx.se) # Diego de las Heras (ngosang@hotmail.es) # Redistribution and use in source and binary forms, with or without # modification, are permitted provided t...
gpl-2.0
stewartsmith/bzr
bzrlib/tests/blackbox/test_bound_branches.py
2
14399
# Copyright (C) 2005-2012 Canonical Ltd # # 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 is distribute...
gpl-2.0
zasdfgbnm/tensorflow
tensorflow/python/training/training.py
1
10683
# 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
catroll/clipboard
aes.py
1
1422
# -*- coding: utf-8 -*- import base64 from Crypto import Random from Crypto.Cipher import AES class AESCipher: def __init__(self, key): self.bs = 32 if len(key) >= 32: self.key = key[:32] else: self.key = self._pad(key) def encrypt(self, raw): raw = se...
mit
Antiun/odoo
addons/sale_crm/wizard/crm_make_sale.py
223
7199
# -*- 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
sandsmark/kate
addons/pate/src/plugins/libkatepate/errors.py
3
5817
# -*- coding: utf-8 -*- # Copyright (c) 2013 by Pablo Martín <goinnn@gmail.com> # # This software is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) a...
lgpl-2.1
bjornlevi/5thpower
afmaeli/env/lib/python3.6/site-packages/setuptools/command/bdist_egg.py
140
17178
"""setuptools.command.bdist_egg Build .egg distributions""" from distutils.errors import DistutilsSetupError from distutils.dir_util import remove_tree, mkpath from distutils import log from types import CodeType import sys import os import textwrap import marshal from setuptools.extern import six from pkg_resource...
mit