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 |
|---|---|---|---|---|---|
emmanuelle/scikits.image | doc/examples/plot_swirl.py | 2 | 2572 | r"""
=====
Swirl
=====
Image swirling is a non-linear image deformation that creates a whirlpool
effect. This example describes the implementation of this transform in
``skimage``, as well as the underlying warp mechanism.
Image warping
`````````````
When applying a geometric transformation on an image, we typically... | bsd-3-clause |
rockyzhang/zhangyanhit-python-for-android-mips | python3-alpha/python3-src/Lib/cgi.py | 46 | 34484 | #! /usr/local/bin/python
# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
# intentionally NOT "/usr/bin/env python". On many systems
# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
# scripts, and /usr/local/bin is the default directory where Python is
# installed, so /usr/bin/env w... | apache-2.0 |
codasus/django-blogages | blogages/django/views/generic/simple.py | 245 | 2319 | from django.template import loader, RequestContext
from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone
from django.utils.log import getLogger
import warnings
warnings.warn(
'Function-based generic views have been deprecated; use class-based views instead.',
... | mit |
gpotter2/scapy | scapy/contrib/pnio_rpc.py | 2 | 34909 | # This file is part of Scapy
# Scapy 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
# any later version.
#
# Scapy is distributed in the hope that it will be useful,
# but ... | gpl-2.0 |
Alexander-M-Waldman/local_currency_site | lib/python2.7/site-packages/django/utils/regex_helper.py | 432 | 12673 | """
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
from __future__ import unicode_literals
... | gpl-3.0 |
repotvsupertuga/repo | plugin.video.TVsupertuga/resources/lib/zmodules/youtube.py | 2 | 5547 | # -*- coding: utf-8 -*-
import re,json
from resources.lib.zmodules import client
from resources.lib.zmodules import workers
class youtube(object):
def __init__(self, key=''):
self.list = [] ; self.data = []
self.base_link = 'http://www.youtube.com'
self.key_link = '&key=%s' % key
... | gpl-2.0 |
youprofit/kivy | kivy/modules/_webdebugger.py | 36 | 205684 | # -*- coding: utf-8 -*-
import threading
import json
from gc import get_objects, garbage
from kivy.clock import Clock
from kivy.cache import Cache
from collections import OrderedDict
from kivy.logger import Logger
try:
from flask import Flask, render_template_string, make_response
except ImportError:
Logger.e... | mit |
mtnman38/Aggregate | Executables/Aggregate 0.8.6 for Macintosh.app/Contents/Resources/lib/python2.7/requests/status_codes.py | 695 | 3136 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | gpl-2.0 |
soarpenguin/ansible | lib/ansible/modules/crypto/openssl_csr.py | 6 | 16372 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, Yanis Guenane <yanis+ansible@guenane.org>
# 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': ... | gpl-3.0 |
rubikloud/scikit-learn | sklearn/covariance/graph_lasso_.py | 6 | 26343 | """GraphLasso: sparse inverse covariance estimation with an l1-penalized
estimator.
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
# Copyright: INRIA
import warnings
import operator
import sys
import time
import numpy as np
from scipy import linalg
from .empirical_covariance_ im... | bsd-3-clause |
Ramoonus/git | contrib/hooks/multimail/git_multimail.py | 186 | 110172 | #! /usr/bin/env python2
# Copyright (c) 2015 Matthieu Moy and others
# Copyright (c) 2012-2014 Michael Haggerty and others
# Derived from contrib/hooks/post-receive-email, which is
# Copyright (c) 2007 Andy Parkins
# and also includes contributions by other authors.
#
# This file is part of git-multimail.
#
# git-mult... | gpl-2.0 |
rvalyi/geraldo | site/newsite/django_1_0/django/contrib/sessions/middleware.py | 11 | 1794 | import time
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils.http import cookie_date
TEST_COOKIE_NAME = 'testcookie'
TEST_COOKIE_VALUE = 'worked'
class SessionMiddleware(object):
def process_request(self, request):
engine = __import__(settings.SESSION... | lgpl-3.0 |
jubatus/jubakit | jubakit/test/wrapper/test_regression.py | 1 | 6315 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from unittest import TestCase
try:
import numpy as np
except ImportError:
pass
from jubakit.wrapper.regression import LinearRegression, NearestNeighborsRegression
from . import requireEmbedded
class Line... | mit |
dariemp/odoo | addons/hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py | 337 | 1728 | # -*- 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 |
nathanbjenx/cairis | cairis/gui/SecurityPatternEnvironmentDialog.py | 1 | 1949 | # 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... | apache-2.0 |
foundit/Piped | doc/tutorials/distributing/4/rpc_tutorial/test_client.py | 6 | 1395 | import json
from zope import interface
from twisted.internet import defer
from piped.plugins.status_testing import statustest, processors
from piped import processing
class TestClientProcessor(processors.StatusTestProcessor):
interface.classProvides(processing.IProcessor)
name = 'test-client'
class Tes... | mit |
jgonthier/psi4 | psi4/driver/procrouting/wrappers_cfour.py | 3 | 36345 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2019 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
azoft-dev-team/imagrium | env/Lib/test/test_zipfile64.py | 158 | 4421 | # Tests of the full ZIP64 functionality of zipfile
# The test_support.requires call is the only reason for keeping this separate
# from test_zipfile
from test import test_support
# XXX(nnorwitz): disable this test by looking for extra largfile resource
# which doesn't exist. This test takes over 30 minutes to run in ... | mit |
shikhardb/scikit-learn | sklearn/naive_bayes.py | 11 | 27998 | # -*- coding: utf-8 -*-
"""
The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These
are supervised learning methods based on applying Bayes' theorem with strong
(naive) feature independence assumptions.
"""
# Author: Vincent Michel <vincent.michel@inria.fr>
# Minor fixes by Fabian Pedre... | bsd-3-clause |
ehirt/odoo | addons/analytic_contract_hr_expense/__init__.py | 432 | 1091 | # -*- 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 |
sumedh123/debatify | venv/lib/python2.7/site-packages/setuptools/package_index.py | 17 | 39985 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
import itertools
from functools import wraps
try:
from urllib.parse import splituser
except ImportError:
from urllib2 import splituser
from setuptools.extern import six
from setupt... | mit |
ujjwalwahi/odoo | addons/point_of_sale/report/pos_receipt.py | 380 | 3100 | # -*- 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 |
horance-liu/tensorflow | tensorflow/python/debug/lib/grpc_debug_server.py | 18 | 17653 | # 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 |
Jgarcia-IAS/Fidelizacion_odoo | openerp/extras/jasper_reports/JasperReports/BrowseDataGenerator.py | 1 | 19813 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L.
# http://www.NaN-tic.com
# Copyright (c) 2012 Omar Castiñeira Saavedra <omar@pexego.es>
# Pexego Sis... | agpl-3.0 |
lsinfo/odoo | addons/point_of_sale/report/pos_invoice.py | 317 | 2393 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
ejjeong/rust | src/etc/make-win-dist.py | 51 | 4357 | # Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or ht... | apache-2.0 |
goddardl/gaffer | python/GafferUI/ContextVariablesUI.py | 2 | 2139 | ##########################################################################
#
# Copyright (c) 2015, Image Engine Design 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:
#
# * Redistrib... | bsd-3-clause |
isandlaTech/cohorte-3rdparty | pelix/src/test/python/tests/ipopo/test_utils.py | 1 | 4537 | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Tests the iPOPO utility methods.
:author: Thomas Calmant
"""
# Tests
from tests.ipopo import install_ipopo
# Pelix
from pelix.framework import FrameworkFactory
import pelix.framework as pelix
# iPOPO
import pelix.ipopo.constants as constants
# Standard libr... | apache-2.0 |
valentin-krasontovitsch/ansible | lib/ansible/modules/network/panos/_panos_nat_policy.py | 32 | 10437 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
damdam-s/OpenUpgrade | addons/google_drive/__openerp__.py | 320 | 1872 | # -*- 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 |
floresconlimon/qutebrowser | scripts/dev/ci_install.py | 4 | 3845 | #!/usr/bin/env python2
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | gpl-3.0 |
thinkerou/grpc | src/python/grpcio_tests/tests/unit/_metadata_test.py | 8 | 8359 | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
kohnle-lernmodule/exeLearningPlus1_04 | twisted/test/test_ssl.py | 14 | 14244 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import nested_scopes
from twisted.trial import unittest
from twisted.internet import protocol, reactor, interfaces, defer
from twisted.protocols import basic
from twisted.python import util, components, log
from twisted.... | gpl-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.5/Lib/plat-aix3/IN.py | 81 | 2765 | # Generated by h2py from /usr/include/netinet/in.h
# Included from net/nh.h
# Included from sys/machine.h
LITTLE_ENDIAN = 1234
BIG_ENDIAN = 4321
PDP_ENDIAN = 3412
BYTE_ORDER = BIG_ENDIAN
DEFAULT_GPR = 0xDEADBEEF
MSR_EE = 0x8000
MSR_PR = 0x4000
MSR_FP = 0x2000
MSR_ME = 0x1000
MSR_FE = 0x0800
MSR_FE0 = 0x0800
MSR_SE = ... | mit |
fernandezcuesta/ansible | lib/ansible/modules/network/lenovo/cnos_bgp.py | 59 | 19250 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
xrmx/django | tests/auth_tests/test_handlers.py | 328 | 2868 | from __future__ import unicode_literals
from django.contrib.auth.handlers.modwsgi import (
check_password, groups_for_user,
)
from django.contrib.auth.models import Group, User
from django.contrib.auth.tests.custom_user import CustomUser
from django.test import TransactionTestCase, override_settings
# This must ... | bsd-3-clause |
mwx1993/TACTIC | src/pyasm/prod/biz/asset.py | 6 | 15231 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
gabelula/b-counted | django/db/backends/sqlite3/introspection.py | 65 | 5857 | import re
from django.db.backends import BaseDatabaseIntrospection
# This light wrapper "fakes" a dictionary interface, because some SQLite data
# types include variables in them -- e.g. "varchar(30)" -- and can't be matched
# as a simple dictionary lookup.
class FlexibleFieldLookupDict:
# Maps SQL types to Django... | apache-2.0 |
mbauskar/tele-erpnext | erpnext/stock/doctype/material_request/test_material_request.py | 29 | 15551 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# ERPNext - web based ERP (http://erpnext.com)
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, unittest
from frappe.utils import flt
... | agpl-3.0 |
hynekcer/django | django/core/files/base.py | 487 | 5717 | from __future__ import unicode_literals
import os
from io import BytesIO, StringIO, UnsupportedOperation
from django.core.files.utils import FileProxyMixin
from django.utils import six
from django.utils.encoding import (
force_bytes, force_str, python_2_unicode_compatible, smart_text,
)
@python_2_unicode_compat... | bsd-3-clause |
erikedin/aoc2016 | aoc2016/day6.py | 1 | 1195 | from collections import Counter
def parse(lines):
return [x.strip() for x in lines]
def step1(input):
"""
>>> step1([ \
"eedadn", \
"drvtee", \
"eandsr", \
"raavrd", \
"atevrs", \
"tsrnev", \
"sdttsa", \
"rasrtv", \
"nssdts", \
... | mit |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/numpy/distutils/misc_util.py | 6 | 85331 | import os
import re
import sys
import imp
import copy
import glob
import atexit
import tempfile
import subprocess
import shutil
import distutils
from distutils.errors import DistutilsError
try:
set
except NameError:
from sets import Set as set
from numpy.distutils.compat import get_exception
__all__ = ['Con... | agpl-3.0 |
snar5/Responder | fingerprint.py | 2 | 2522 | #!/usr/bin/env python
# This file is part of Responder, a network take-over set of tools
# created and maintained by Laurent Gaffie.
# email: laurent.gaffie@gmail.com
# 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... | gpl-3.0 |
danielharbor/openerp | addons/account/edi/__init__.py | 450 | 1062 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
geetarista/google-python-exercises | copyspecial/solution/copyspecial.py | 206 | 2584 | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
import os
import shutil
import commands
"""Copy Special exercise
"""
#... | apache-2.0 |
Pablo126/SSBW | Tarea4/tarea4/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py | 514 | 4531 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
from __future__ import absolute_import
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from nt... | gpl-3.0 |
163gal/Time-Line | libs/wx/lib/pubsub/core/__init__.py | 7 | 2792 | '''
Core package of pubsub, holding the publisher, listener, and topic
object modules. Functions defined here are used internally by
pubsub so that the right modules can be found later, based on the
selected messaging protocol.
Indeed some of the API depends on the messaging
protocol used. For instance sendMessage(), ... | gpl-3.0 |
ChristosChristofidis/django-analytical | analytical/tests/__init__.py | 4 | 1185 | """
Tests for django-analytical.
"""
from analytical.tests.test_tag_analytical import *
from analytical.tests.test_tag_chartbeat import *
from analytical.tests.test_tag_clickmap import *
from analytical.tests.test_tag_clicky import *
from analytical.tests.test_tag_crazy_egg import *
from analytical.tests.test_tag_gaug... | mit |
zstars/weblabdeusto | server/src/test/unit/weblab/data/dto/test_users.py | 2 | 1047 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | bsd-2-clause |
amrdraz/brython | www/src/Lib/test/test_importlib/import_/test_api.py | 28 | 2191 | from .. import util as importlib_test_util
from . import util
import imp
import sys
import unittest
class BadLoaderFinder:
bad = 'fine.bogus'
@classmethod
def find_module(cls, fullname, path):
if fullname == cls.bad:
return cls
@classmethod
def load_module(cls, fullname):
... | bsd-3-clause |
voidfiles/ansible-1 | lib/ansible/plugins/lookup/first_found.py | 118 | 7029 | # (c) 2013, seth vidal <skvidal@fedoraproject.org> red hat, inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... | gpl-3.0 |
googleapis/google-api-php-client-services | generator/tests/utilities/json_with_comments_test.py | 3 | 1623 | #!/usr/bin/python2.7
# 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 requi... | apache-2.0 |
miurahr/qemu-kvm | scripts/qapi-types.py | 61 | 6861 | #
# QAPI types generator
#
# Copyright IBM, Corp. 2011
#
# Authors:
# Anthony Liguori <aliguori@us.ibm.com>
#
# This work is licensed under the terms of the GNU GPLv2.
# See the COPYING.LIB file in the top-level directory.
from ordereddict import OrderedDict
from qapi import *
import sys
import os
import getopt
impor... | gpl-2.0 |
ric2b/Vivaldi-browser | chromium/native_client_sdk/src/build_tools/sdk_tools/sdk_update.py | 160 | 4382 | #!/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.
"""Shim script for the SDK updater, to allow automatic updating.
The purpose of this script is to be a shim which automatically up... | bsd-3-clause |
WayneKeenan/picraftzero | picraftzero/thirdparty/pimoroni/explorerhat/pins.py | 1 | 4064 | import threading
class StoppableThread(threading.Thread):
"""Basic Stoppable Thread Wrapper
Adds event for stopping the execution
loop and exiting cleanly."""
def __init__(self):
threading.Thread.__init__(self, name= __class__)
self.stop_event = threading.Event()
self.daemon =... | mit |
ldsiosdev/python-lds-scriptures | scriptures/tests/test_universal_url.py | 2 | 5341 | import unittest
import scriptures
class TestUniversalURL(unittest.TestCase):
def test_no_verses(self):
uri = '/scriptures/ot/isa/40'
universal_url = 'https://www.churchofjesuschrist.org/study/scriptures/ot/isa/40'
self.assertEqual(scriptures.ref(uri).universal_url(), universal_url)
de... | mit |
umitanuki/chainer | chainer/functions/sigmoid.py | 13 | 2477 | import ctypes
import numpy
from chainer import cuda
from chainer import function
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cudnn.cudnn
_mode = libcudnn.CUDNN_ACTIVATION_SIGMOID
class Sigmoid(function.Function):
"""Logistic sigmoid function."""
de... | mit |
shepdelacreme/ansible | lib/ansible/modules/cloud/amazon/elb_application_lb_facts.py | 22 | 10396 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
goblinr/omim | 3party/jansson/doc/ext/refcounting.py | 95 | 1715 | """
refcounting
~~~~~~~~~~~
Reference count annotations for C API functions. Has the same
result as the sphinx.ext.refcounting extension but works for all
functions regardless of the signature, and the reference counting
information is written inline with the documentation instead of a
sepa... | apache-2.0 |
CCI-MOC/GUI-Backend | scripts/admin_clean_provider_machine.py | 1 | 6509 | #!/usr/bin/env python
import argparse
import subprocess
import logging
from django.utils.timezone import datetime, utc
from service.driver import get_account_driver
from core.models import Provider, Identity, MachineRequest, Application, ProviderMachine
from core.models.application import _generate_app_uuid
def main... | apache-2.0 |
meahmadi/nsun | ir/ac/iust/me_ahmadi/multiProcessMind/mdatetime.py | 1 | 2578 | from datetime import timedelta,datetime
import copy
import time
class MDateTime(object):
def __init__(self,dtime=None,delta=None):
basetime = dtime
if basetime is None:
basetime = datetime.now()
if delta is not None:
basetime += delta
self.year = basetime.yea... | gpl-2.0 |
kpayson64/grpc | src/python/grpcio_tests/tests/unit/beta/test_utilities.py | 27 | 1498 | # Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
pozytywnie/RouterOS-api | tests/test_api_communicator.py | 3 | 3394 | from unittest import TestCase
try:
from unittest import mock
except ImportError:
import mock
from routeros_api import exceptions
from routeros_api import api_communicator
class TestCommunicator(TestCase):
def test_login_call(self):
base = mock.Mock()
base.receive_sentence.return_value = [... | mit |
chriscallan/Euler | Probs_1_to_50/018_MaximumPathSumI.py | 1 | 2360 | # Problem 18
# By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
#
# 3
# 7 4
# 2 4 6
# 8 5 9 3
#
# That is, 3 + 7 + 4 + 9 = 23.
#
# Find the maximum total from top to bottom of the triangle below... | gpl-3.0 |
mattharden/vitess | test/utils.py | 2 | 41854 | #!/usr/bin/env python
# Copyright 2017 Google 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... | bsd-3-clause |
srvg/ansible-modules-extras | cloud/profitbricks/profitbricks_datacenter.py | 11 | 7990 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
danielmagnussons/orgmode | resolver/prompt.py | 2 | 2641 |
import re
import sys
import subprocess
import sublime
from .abstract import AbstractRegexLinkResolver
DEFAULT_OPEN_PROMPT_LINK_COMMANDS = dict(
darwin=['open', '-a', 'Terminal'],
win32=['cmd'],
linux=['gnome-terminal'],
)
PATTERN_SETTING = 'orgmode.open_link.resolver.prompt.pattern'
PATTERN_DEFAULT = r'... | mit |
annarev/tensorflow | tensorflow/python/kernel_tests/extract_volume_patches_grad_test.py | 9 | 3881 | # 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 |
mas-dse-greina/neon | unet/keras_unet_lung_transposed.py | 1 | 9062 | #!/usr/bin/env python
'''
BEGIN - Limit Tensoflow to only use specific GPU
'''
import os
gpu_num = 2
os.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID' # see issue #152
os.environ['CUDA_VISIBLE_DEVICES'] = '{}'.format(gpu_num)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # Supress Tensforflow debug messages
import tensor... | apache-2.0 |
Daniel-CA/odoo | addons/website_partner/__openerp__.py | 383 | 1498 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
opennetworkinglab/spring-open-cli | cli/desc/version200/tacacs_model.py | 4 | 1385 | #
# Copyright (c) 2013 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
#
# Unless required by applicable l... | epl-1.0 |
BitcoinUnlimited/BitcoinUnlimited | qa/rpc-tests/sighashmatch.py | 2 | 3816 | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# parts taken from weirdtx.py
import test_framework.loginit
import time
import sys
if sys.version_... | mit |
pdellaert/ansible | lib/ansible/modules/network/cloudengine/ce_bgp.py | 6 | 81201 | #!/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 |
sgiavasis/nipype | nipype/interfaces/diffusion_toolkit/base.py | 10 | 1341 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""The dtk module provides basic functions for interfacing with
Diffusion Toolkit tools.
Currently these tools are supported:
* TODO
Examples
--------
See the docstrings for the individual classes fo... | bsd-3-clause |
Venturi/cms | env/lib/python2.7/site-packages/django/utils/termcolors.py | 260 | 7480 | """
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... | gpl-2.0 |
birocorneliu/youtube-dl | youtube_dl/extractor/tenplay.py | 114 | 3653 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
float_or_none,
)
class TenPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ten(play)?\.com\.au/.+'
_TEST = {
'url': 'http://tenplay.com.au/ten-insider/extra/sea... | unlicense |
sysbot/CouchPotatoServer | couchpotato/core/providers/torrent/iptorrents/main.py | 5 | 4511 | from bs4 import BeautifulSoup
from couchpotato.core.helpers.encoding import tryUrlencode, toSafeString
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.torrent.base import TorrentProvider
import traceback
log = CPLog(__name__)
class IPTorr... | gpl-3.0 |
sanjuro/RCJK | vendor/django/contrib/localflavor/fi/fi_municipalities.py | 42 | 13054 | # -*- coding: utf-8 -*-
"""
An alphabetical list of Finnish municipalities for use as `choices` in a
formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
MUNICIPALITY_CHOICES = (
('akaa', u"Akaa"),
('alaharma', u"Alahärmä"),
('alajarvi', u"Alajä... | apache-2.0 |
tartavull/pyalienfx | usb/_debug.py | 10 | 3004 | # Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | gpl-3.0 |
alistairlow/tensorflow | tensorflow/python/keras/_impl/keras/layers/pooling_test.py | 32 | 6390 | # 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 |
shenson/cobbler | cobbler/utils.py | 1 | 65922 | """
Misc heavy lifting functions for cobbler
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
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... | gpl-2.0 |
virtool/virtool | tests/indexes/test_api.py | 2 | 13487 | import pytest
from aiohttp.test_utils import make_mocked_coro
async def test_find(mocker, snapshot, spawn_client, static_time):
client = await spawn_client(authorize=True)
await client.db.indexes.insert_many([
{
"_id": "bar",
"version": 1,
"created_at": static_time... | mit |
ZachRiegel/scriptbin | pypyjs/modules/test/buffer_tests.py | 125 | 10576 | # Tests that work for both bytes and buffer objects.
# See PEP 3137.
import struct
import sys
class MixinBytesBufferCommonTests(object):
"""Tests that work for both bytes and buffer objects.
See PEP 3137.
"""
def marshal(self, x):
"""Convert x into the appropriate type for these tests."""
... | gpl-3.0 |
mgaitan/scipy | scipy/fftpack/helper.py | 88 | 1358 | from __future__ import division, print_function, absolute_import
__all__ = ['fftshift', 'ifftshift', 'fftfreq', 'rfftfreq']
from numpy import arange
from numpy.fft.helper import fftshift, ifftshift, fftfreq
def rfftfreq(n, d=1.0):
"""DFT sample frequencies (for usage with rfft, irfft).
The returned float a... | bsd-3-clause |
abdhaleegit/avocado-misc-tests | cpu/numatop.py | 2 | 3407 | #!/usr/bin/env python
#
# 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 distributed in the hope that... | gpl-2.0 |
mathspace/libcloud | libcloud/compute/providers.py | 9 | 6567 | # 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 use ... | apache-2.0 |
katstalk/android_external_chromium_org | third_party/jinja2/environment.py | 614 | 47244 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import BLOCK_S... | bsd-3-clause |
SawyerHood/mal | rpython/step6_file.py | 47 | 4495 | import sys, traceback
import mal_readline
import mal_types as types
from mal_types import (MalSym, MalInt, MalStr,
nil, true, false, _symbol, _keywordu,
MalList, _list, MalVector, MalHashMap, MalFunc)
import reader, printer
from env import Env
import core
# read
def READ(s... | mpl-2.0 |
pombreda/re2 | re2/make_unicode_groups.py | 121 | 2867 | #!/usr/bin/python
# Copyright 2008 The RE2 Authors. All Rights Reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Generate C++ tables for Unicode Script and Category groups."""
import sys
import unicode
_header = """
// GENERATED BY make_unicode_groups... | bsd-3-clause |
arenadata/ambari | ambari-server/src/test/resources/TestAmbaryServer.samples/dummy_stack/HIVE/package/scripts/hive_server.py | 20 | 1711 | #!/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
"License");... | apache-2.0 |
viger/docker | proxy/proxy/code/default/python27/1.0/lib/encodings/iso8859_14.py | 593 | 13908 | """ Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.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_table)
def decode(self,input,errors... | mit |
yask123/scikit-learn | sklearn/linear_model/tests/test_ridge.py | 68 | 23597 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
anzev/rdm | rdm/wrappers/security.py | 2 | 6035 | import time
import re
import os
import sys
from subprocess import Popen, PIPE
import threading
illegal_predicates = [
('library(?!\(myddas\))', 'library'), ('use_module(?!\(library\(myddas\)\))', 'use_module'), ('\[.+\]', '[]'), \
'abort', 'absolute_file_name', 'access', 'access_file', 'add_to_path', 'alarm', ... | mit |
gavinandresen/bitcoin-git | qa/rpc-tests/pruning.py | 8 | 16516 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test pruning code
# ********
# WARNING:
# This test uses 4GB of disk space.
# This test takes 30 mins... | mit |
Dhivyap/ansible | lib/ansible/plugins/action/raw.py | 152 | 1823 | # (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 |
cldershem/osf.io | scripts/migrate_unregistered.py | 61 | 4757 | #!/usr/bin/env
# -*- coding: utf-8 -*-
"""Migrates old-style unregistered users (dictionaries in Node#contributor_list)
to actual User records.
"""
import logging
from modularodm.exceptions import ValidationValueError
from website import app, models
from framework import auth
from framework.auth import Auth
from tests... | apache-2.0 |
Big-B702/python-for-android | python-modules/twisted/twisted/python/lockfile.py | 61 | 6409 | # -*- test-case-name: twisted.test.test_lockfile -*-
# Copyright (c) 2005 Divmod, Inc.
# Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Filesystem-based interprocess mutex.
"""
__metaclass__ = type
import errno, os
from time import time as _uniquefloat
def unique():
return str(l... | apache-2.0 |
rwl/muntjac | muntjac/demo/sampler/features/layouts/SplitPanelBasicExample.py | 1 | 2214 |
from muntjac.api import \
(VerticalLayout, VerticalSplitPanel, Label, HorizontalSplitPanel,
CheckBox)
from muntjac.ui.button import IClickListener
from muntjac.terminal.sizeable import ISizeable
class SplitPanelBasicExample(VerticalLayout):
brownFox = ('The quick brown fox jumps over the lazy dog. '
... | apache-2.0 |
dturner-tw/pants | tests/python/pants_test/tasks/task_test_base.py | 2 | 9841 | # 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 os
import sub... | apache-2.0 |
akarambir/python-koans | python3/runner/sensei.py | 45 | 9911 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import re
import sys
import os
import glob
from . import helper
from .mockable_test_result import MockableTestResult
from runner import path_to_enlightenment
from libs.colorama import init, Fore, Style
init() # init colorama
class Sensei(MockableTestResu... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.