repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
richardfergie/googleads-python-lib | examples/dfp/v201411/custom_targeting_service/get_all_custom_targeting_keys_and_values.py | 4 | 3123 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
jerryjiahaha/rts2 | scripts/rts2saf/unittest/test_ds9region.py | 5 | 2193 | # (C) 2013, Markus Wildi, markus.wildi@bluewin.ch
#
# 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, or (at your option)
# any later version.
#
# This program is distr... | lgpl-3.0 |
xccui/flink | flink-python/pyflink/fn_execution/beam/beam_operations_slow.py | 4 | 4168 | ################################################################################
# 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... | apache-2.0 |
ZuraK/aVarCode | py_prototyping/hex.py | 1 | 7514 | # File:
# Desc:
import math;
# param: hType, hexType, 0 for Flat topped, 30 if Pointy topped
# param: center, Vector2Point, hex center
# param: radius, size of hex
# param: index, indexPoint corner of hex, 0-5
# returns: Vector2Point hex corner
def GeneratePointHEX(hType, center, radius, index):
vec[0];
angle_deg =... | gpl-2.0 |
jessicalucci/NovaOrc | nova/openstack/common/notifier/rabbit_notifier.py | 31 | 1081 | # Copyright 2012 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
alessandrocamilli/l10n-italy | l10n_it_account/__openerp__.py | 4 | 1657 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Abstract srl (<http://www.abstract.it>)
# Copyright (C) 2015 Agile Business Group (<http://www.agilebg.com>)
# Copyright (C) 2015 Link It Spa (<http://www.linkgroup.it/>)
#
# This pr... | agpl-3.0 |
gechong/XlsxWriter | xlsxwriter/test/comparison/test_array_formula02.py | 8 | 1463 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
c0defreak/python-for-android | tools/googlecode_upload.py | 304 | 8912 | #!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | apache-2.0 |
waterblue13/tensor2tensor | tensor2tensor/utils/data_reader_test.py | 1 | 10073 | # coding=utf-8
# Copyright 2017 The Tensor2Tensor 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... | apache-2.0 |
DelazJ/QGIS | python/plugins/grassprovider/ext/r_li_mpa_ascii.py | 45 | 1436 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_mpa_ascii.py
-----------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
************************... | gpl-2.0 |
Gabriel439/pip | pip/_vendor/requests/packages/urllib3/connectionpool.py | 477 | 30319 | import errno
import logging
import sys
import warnings
from socket import error as SocketError, timeout as SocketTimeout
import socket
try: # Python 3
from queue import LifoQueue, Empty, Full
except ImportError:
from Queue import LifoQueue, Empty, Full
import Queue as _ # Platform-specific: Windows
fr... | mit |
iJo09/Hybridmax_Kernel_I9505_Lollipop | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
andybondar/CloudFerry | tests/scheduler/test_task.py | 12 | 3213 | # Copyright (c) 2014 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 writing, so... | apache-2.0 |
brijeshkesariya/odoo | addons/sale_journal/__init__.py | 443 | 1067 | # -*- 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 |
sanket4373/keystone | keystone/tests/unit/common/test_sql_core.py | 4 | 1952 | # 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, software
# distributed under t... | apache-2.0 |
jrha/aquilon | lib/python2.6/aquilon/worker/commands/del_intervention.py | 2 | 1458 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | apache-2.0 |
arraypan/Food-Stickers | FoodStickersMessages/lib/python3.5/site-packages/pip/_vendor/html5lib/_tokenizer.py | 385 | 76580 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import unichr as chr
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, hexDigits, EOF
from .c... | mit |
goddardl/gaffer | python/GafferUI/VectorDataWidget.py | 2 | 41898 | ##########################################################################
#
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | bsd-3-clause |
miguelparaiso/PracticaOdoo | addons/account_payment/__openerp__.py | 261 | 2925 | # -*- 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 |
umitproject/tease-o-matic | pygments/formatter.py | 75 | 2790 | # -*- coding: utf-8 -*-
"""
pygments.formatter
~~~~~~~~~~~~~~~~~~
Base formatter class.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import codecs
from pygments.util import get_bool_opt
from pygments.styles import get_style_by_nam... | bsd-3-clause |
goldcoin/gldcoin | BuildDeps/deps/boost/tools/build/v2/test/stage.py | 20 | 5156 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test staging.
import BoostBuild
t = BoostBuild.Tester()
t.write("j... | mit |
abdelkimo/or-tools | examples/python/crypta.py | 34 | 3413 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... | apache-2.0 |
CLVsol/odoo_addons | clv_medicament_dispensation_ext/res_partner/res_partner.py | 1 | 1905 | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | agpl-3.0 |
christoph-buente/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/config_standalone.py | 125 | 2733 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
danielfreeman11/convex-nets | LaunchScripts/CIFAR10.py | 1 | 29360 | #Imports and model parameters
from __future__ import absolute_import
from __future__ import division
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
#mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
#Simple network: Given three integers a,b,c, ... | mit |
wofanli/trex-core | scripts/external_libs/texttable-0.8.4/setup.py | 6 | 2216 | #!/usr/bin/env python
#
# texttable - module for creating simple ASCII tables
# Copyright (C) 2003-2015 Gerome Fournier <jef(at)foutaise.org>
#
# 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 Foundat... | apache-2.0 |
ashray/VTK-EVM | ThirdParty/ZopeInterface/zope/interface/tests/test_interfaces.py | 30 | 3879 | import unittest
class _SilencePy3Deprecations(unittest.TestCase):
# silence deprecation warnings under py3
def failUnless(self, expr):
# St00pid speling.
return self.assertTrue(expr)
def failIf(self, expr):
# St00pid speling.
return self.assertFalse(expr)
class _Conforms... | bsd-3-clause |
sszlm/MissionPlanner | Lib/lib2to3/fixes/fix_raise.py | 61 | 3024 | """Fixer for 'raise E, V, T'
raise -> raise
raise E -> raise E
raise E, V -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)
raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T -> warns about string exceptions
... | gpl-3.0 |
nacl-webkit/chrome_deps | tools/traceline/traceline/scripts/crit_sec.py | 179 | 1416 | #!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import os
from syscalls import syscalls
def parseEvents(z):
crits = { }
calls = { }
for e in z:
if (e['eve... | bsd-3-clause |
neqelr17/banknotes | banknotes/settings.py | 1 | 3207 | """
Django settings for banknotes project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
... | gpl-3.0 |
berserkerbernhard/Lidskjalv | code/networkmonitor/modules/groups/grouplistmenu.py | 1 | 2968 | import os
import time
import dialog
from modules.sitegrouphosttools import SiteGroupHostTools
from modules.groups.group import Group
from modules.groups.groupform import GroupForm
from modules.groups.groupmenu import GroupMenu
from modules.sitegrouphosttools import get_group_members
class GroupListMenu(SiteGroupHostTo... | gpl-3.0 |
hunter007/wechatpy | tests/test_enterprise_client.py | 4 | 12632 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import six
import unittest
from httmock import urlmatch, HTTMock, response
from wechatpy.enterprise import WeChatClient
from wechatpy.exceptions import WeChatClientException
from wechatpy.utils import json
_TESTS_PATH = os.pa... | mit |
nrmay/hpctardis | tardis/tardis_portal/minidetector/__init__.py | 5 | 2118 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from useragents import search_strings
class Middleware(object):
@staticmethod
def process_request(request):
"""Adds a "mobile" attribute to the request which is True or False
depending on whether the request should be considered to come from a
... | bsd-3-clause |
bielawb/PSConfAsia17-Linux | Scripts/httpsWinRM.py | 1 | 2125 | #!/usr/bin/env python
# coding: utf-8
import getpass
from re import search
from subprocess import Popen, PIPE
from winrm import Session
from sys import exit, argv
if len(argv) < 2 :
exit('Sposób użycia: %s <polecenie>' % argv[0])
polecenie = " ".join(argv[1:])
exitCode = 0
class PowerShellEr... | mit |
mahinthjoe/bedrock | bedrock/facebookapps/tests/test_decorators.py | 25 | 4674 | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import urllib
from django.conf import settings
from django.http import QueryDict
from django.t... | mpl-2.0 |
geraintpalmer/Ciw | ciw/tests/test_scheduling.py | 2 | 12812 | import unittest
import ciw
from decimal import Decimal
class TestScheduling(unittest.TestCase):
def test_change_shift_method(self):
Q = ciw.Simulation(ciw.create_network_from_yml(
'ciw/tests/testing_parameters/params_schedule.yml'))
N = Q.transitive_nodes[0]
N.next_event_date =... | mit |
shail2810/nova | nova/virt/disk/api.py | 35 | 25175 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# Copyright 2011, Piston Cloud Computing, Inc.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in ... | apache-2.0 |
adityagilra/2015_spiking_population_response | ExcInhNetflex.py | 1 | 5096 | # -*- coding: utf-8 -*-
"""
Spiking neural net of LIF/SRM neurons with AI firing
written by Aditya Gilra (c) July 2015.
"""
from brian2 import * # also does 'from pylab import *'
from embedded_consts import *
import random
## Cannot make this network a Class,
## since brian standalone mode wants all Brian ob... | gpl-3.0 |
provaleks/o8 | openerp/sql_db.py | 29 | 24861 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
tuskar/tuskar | tuskar/common/policy.py | 2 | 3972 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 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.a... | apache-2.0 |
arozumenko/locust | locust/serviceutils/unixserviceutil.py | 1 | 13419 | # Copyright (c) 2014 Artem Rozumenko (artyom.rozumenko@gmail.com)
#
# 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 b... | apache-2.0 |
jeremiahmarks/sl4a | python/src/Tools/i18n/makelocalealias.py | 52 | 2007 | #!/usr/bin/env python
"""
Convert the X11 locale.alias file into a mapping dictionary suitable
for locale.py.
Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10.
"""
import locale
# Location of the alias file
LOCALE_ALIAS = '/usr/lib/X11/locale/locale.alias'
def parse(filename):
f = open(fil... | apache-2.0 |
techdragon/django | tests/gis_tests/distapp/models.py | 77 | 1461 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
from ..utils import gisfield_may_be_null
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
... | bsd-3-clause |
adw0rd/lettuce | tests/integration/lib/Django-1.3/tests/modeltests/force_insert_update/tests.py | 92 | 1336 | from django.db import transaction, IntegrityError, DatabaseError
from django.test import TestCase
from models import Counter, WithCustomPK
class ForceTests(TestCase):
def test_force_update(self):
c = Counter.objects.create(name="one", value=1)
# The normal case
c.value = 2
c.save... | gpl-3.0 |
wavesoft/LiveQ | liveq-agent/tests.py | 1 | 2485 | #!/usr/bin/python
################################################################
# LiveQ - An interactive volunteering computing batch system
# Copyright (C) 2013 Ioannis Charalampidis
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as... | gpl-2.0 |
HazenBabcock/brigl | test/driver.py | 1 | 2249 | #!/usr/bin/env python
"""
This returns an automated web browser to use for automated testing. It also
includes some utility functions.
https://www.seleniumhq.org/
http://selenium-python.readthedocs.io/
"""
import time
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCa... | gpl-3.0 |
alexpotter1/QuantumKernel_msm8974_hammerhead | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
Yadnyawalkya/integration_tests | cfme/tests/control/test_import_policies.py | 3 | 1876 | # -*- coding: utf-8 -*-
import pytest
from cfme import test_requirements
from cfme.control import import_export
from cfme.utils.path import data_path
pytestmark = [
test_requirements.control,
pytest.mark.tier(3)
]
@pytest.fixture(scope="module")
def import_policy_file(request):
return data_path.join("ui... | gpl-2.0 |
mapennell/ansible | v1/ansible/module_utils/redhat.py | 324 | 10219 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
seize-the-dave/XlsxWriter | xlsxwriter/test/comparison/test_textbox19.py | 8 | 1259 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
BjoernT/rpc-openstack | releasenotes/source/conf.py | 8 | 9592 | # -*- coding: utf-8 -*-
# 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, software... | apache-2.0 |
jcrugzz/lpvisualization | django/contrib/gis/tests/test_geoforms.py | 240 | 2671 | from django.forms import ValidationError
from django.contrib.gis import forms
from django.contrib.gis.geos import GEOSGeometry
from django.utils import unittest
class GeometryFieldTest(unittest.TestCase):
def test00_init(self):
"Testing GeometryField initialization with defaults."
fld = forms.Geo... | bsd-3-clause |
ctogle/dilapidator | test/geometry/quat_tests.py | 1 | 6809 | from dilap.geometry.quat import quat
from dilap.geometry.vec3 import vec3
import dilap.geometry.tools as dpr
import matplotlib.pyplot as plt
import unittest,numpy,math
import pdb
#python3 -m unittest discover -v ./ "*tests.py"
class test_quat(unittest.TestCase):
def test_av(self):
a = 3*dpr.PI4
... | mit |
dsandeephegde/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptcommandline.py | 5 | 25896 | import argparse
import ast
import os
import sys
from collections import OrderedDict
from distutils.spawn import find_executable
import config
import wpttest
import formatters
def abs_path(path):
return os.path.abspath(os.path.expanduser(path))
def url_or_path(path):
import urlparse
parsed = urlparse.u... | mpl-2.0 |
carlos-jenkins/plantweb | test/sphinxconf/conf.py | 1 | 9536 | # -*- coding: utf-8 -*-
#
# PlantwebTest documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 24 03:02:39 2016.
#
# 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.
... | apache-2.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/tornado/platform/common.py | 16 | 3816 | """Lowest-common-denominator implementations of platform functionality."""
from __future__ import absolute_import, division, print_function
import errno
import socket
import time
from tornado.platform import interface
from tornado.util import errno_from_exception
def try_close(f):
# Avoid issue #875 (race condi... | bsd-2-clause |
sbunatyan/retrylib | retrylib/tests/test_decorators.py | 1 | 7444 | #!/usr/bin/env python
# Copyright (c) 2014 Sergey Bunatyan <sergey.bunatyan@gmail.com>
#
# 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
#
# Un... | apache-2.0 |
musically-ut/numpy | numpy/f2py/tests/test_callback.py | 59 | 2990 | from __future__ import division, absolute_import, print_function
from numpy.testing import *
from numpy import array
import math
import util
import textwrap
class TestF77Callback(util.F2PyTest):
code = """
subroutine t(fun,a)
integer a
cf2py intent(out) a
external fun
call fun(a)
... | bsd-3-clause |
dstftw/youtube-dl | youtube_dl/socks.py | 55 | 8861 | # Public Domain SOCKS proxy protocol implementation
# Adapted from https://gist.github.com/bluec0re/cafd3764412967417fd3
from __future__ import unicode_literals
# References:
# SOCKS4 protocol http://www.openssh.com/txt/socks4.protocol
# SOCKS4A protocol http://www.openssh.com/txt/socks4a.protocol
# SOCKS5 protocol h... | unlicense |
awkspace/ansible | lib/ansible/modules/source_control/gitlab_user.py | 10 | 16965 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
# Copyright: (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, pri... | gpl-3.0 |
CKehl/pylearn2 | pylearn2/models/dbm/sampling_procedure.py | 44 | 8508 | """
Classes that implement different sampling algorithms for DBMs.
"""
__authors__ = ["Ian Goodfellow", "Vincent Dumoulin"]
__copyright__ = "Copyright 2012-2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
from theano.compat.six.moves import xrange
... | bsd-3-clause |
tailhook/sqlparse | sqlparse/engine/filter.py | 87 | 3366 | # -*- coding: utf-8 -*-
from sqlparse.sql import Statement, Token
from sqlparse import tokens as T
class StatementFilter:
"Filter that split stream at individual statements"
def __init__(self):
self._in_declare = False
self._in_dbldollar = False
self._is_create = False
self._... | bsd-3-clause |
django-nonrel/django | tests/many_to_many/tests.py | 109 | 17906 | from __future__ import absolute_import
from django.test import TestCase
from django.utils import six
from .models import Article, Publication
class ManyToManyTests(TestCase):
def setUp(self):
# Create a couple of Publications.
self.p1 = Publication.objects.create(id=None, title='The Python Jour... | bsd-3-clause |
HiSPARC/pysparc | pysparc/util.py | 2 | 1962 | """Unassorted utility functions."""
def clipped_map(value, from_low, from_high, to_low, to_high):
"""Clip a value to fit a domain and then map it to a range.
:param value: value to be clipped and mapped
:param from_low, from_high: domain of the value. If the value is
outside this domain, it will... | gpl-3.0 |
aiyyoi/DevFest-MaxBond | MaxBond/env/lib/python2.7/site-packages/jinja2/optimizer.py | 1401 | 2302 | # -*- coding: utf-8 -*-
"""
jinja2.optimizer
~~~~~~~~~~~~~~~~
The jinja optimizer is currently trying to constant fold a few expressions
and modify the AST in place so that it should be easier to evaluate it.
Because the AST does not contain all the scoping information and the
compiler has to ... | mit |
City-busz/Cinnamon | files/usr/share/cinnamon/cinnamon-settings/bin/Spices.py | 4 | 29430 | try:
from SettingsWidgets import rec_mkdir
import gettext
from gi.repository import Gio, Gtk, GObject, Gdk, GdkPixbuf, GLib
import locale
import tempfile
import os
import sys
import time
import urllib2
import zipfile
import string
import shutil
import cgi
import s... | gpl-2.0 |
darolt/ndnSIMQoS | src/spectrum/bindings/modulegen__gcc_LP64.py | 10 | 459958 | 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-2.0 |
ndimiduk/hbase | hbase-examples/src/main/python/thrift1/DemoClient.py | 6 | 6850 | #!/usr/bin/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
"Li... | apache-2.0 |
westinedu/newertrends | django/contrib/localflavor/fr/fr_department.py | 314 | 3326 | # -*- coding: utf-8 -*-
DEPARTMENT_ASCII_CHOICES = (
('01', '01 - Ain'),
('02', '02 - Aisne'),
('03', '03 - Allier'),
('04', '04 - Alpes-de-Haute-Provence'),
('05', '05 - Hautes-Alpes'),
('06', '06 - Alpes-Maritimes'),
('07', '07 - Ardeche'),
('08', '08 - Ardennes'),
('09', '09 - Ar... | bsd-3-clause |
adrienbrault/home-assistant | tests/components/smart_meter_texas/conftest.py | 15 | 3013 | """Test configuration and mocks for Smart Meter Texas."""
import asyncio
import json
from pathlib import Path
import pytest
from smart_meter_texas.const import (
AUTH_ENDPOINT,
BASE_ENDPOINT,
BASE_URL,
LATEST_OD_READ_ENDPOINT,
METER_ENDPOINT,
OD_READ_ENDPOINT,
)
from homeassistant.components.h... | mit |
MrSwiss/SpockBot | spock/plugins/core/auth.py | 1 | 5050 | """
Provides authorization functions for Mojang's login and session servers
"""
import hashlib
import json
# This is for python2 compatibility
try:
import urllib.request as request
from urllib.error import URLError
except ImportError:
import urllib2 as request
from urllib2 import URLError
import loggin... | mit |
jjscarafia/odoo | openerp/report/render/simple.py | 324 | 3152 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
DirtyUnicorns/android_external_chromium-org | remoting/tools/build/remoting_copy_locales.py | 142 | 5150 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper script to repack paks for a list of locales.
Gyp doesn't have any built-in looping capability, so this just provides a way t... | bsd-3-clause |
vijaysbhat/incubator-airflow | tests/ti_deps/deps/test_not_in_retry_period_dep.py | 31 | 2298 | # -*- coding: utf-8 -*-
#
# 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, software
... | apache-2.0 |
jadonk/debexpo | debexpo/lib/filters.py | 3 | 1798 | # -*- coding: utf-8 -*-
#
# filter.py — Output filters for the template engine
#
# This file is part of debexpo - https://alioth.debian.org/projects/debexpo/
#
# Copyright © 2011 Arno Töll <debian@toell.net>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software an... | mit |
kennedyshead/home-assistant | homeassistant/components/august/binary_sensor.py | 2 | 9418 | """Support for August binary sensors."""
from datetime import datetime, timedelta
import logging
from yalexs.activity import ACTION_DOORBELL_CALL_MISSED, SOURCE_PUBNUB, ActivityType
from yalexs.lock import LockDoorStatus
from yalexs.util import update_lock_detail_from_activity
from homeassistant.components.binary_sen... | apache-2.0 |
cxmo/project-beta | code/utils/tests/test_regression.py | 4 | 1054 | # import numpy as np
# import os
# import sys
# from numpy.testing import assert_almost_equal, assert_array_equal
# __file__ = os.getcwd()
# sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),"../utils/")))
# from regression import *
# n_splits = 10 # number of subdivisions of validation data fo... | bsd-3-clause |
delta2323/chainer | chainer/training/extensions/print_report.py | 10 | 2909 | import os
import sys
from chainer.training import extension
from chainer.training.extensions import log_report as log_report_module
from chainer.training.extensions import util
class PrintReport(extension.Extension):
"""Trainer extension to print the accumulated results.
This extension uses the log accumul... | mit |
bravominski/PennApps2015-HeartMates | venv/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.py | 527 | 1039 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
def code_to_chars(code):
return CSI + str(code) + 'm'
class AnsiCodes(object):
def __... | apache-2.0 |
dushu1203/chromium.src | tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py | 109 | 1401 | #!/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.
# This is used to test the findbugs plugin, it calls
# build/android/pylib/utils/findbugs.py to analyze the classes in
# org.chro... | bsd-3-clause |
britcey/ansible | lib/ansible/modules/network/junos/junos_config.py | 1 | 12228 | #!/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 |
hp-storage/horizon-ssmc-link | horizon_hpe_storage/storage_panel/config/tables.py | 2 | 12289 | # (c) Copyright [2015] Hewlett Packard Enterprise Development LP
#
# 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 |
wengyanqing/incubator-hawq | tools/sbin/gpoperation.py | 12 | 2901 | #!/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
# "Li... | apache-2.0 |
arank/mxnet | example/warpctc/lstm_ocr.py | 15 | 6528 | # pylint: disable=C0111,too-many-arguments,too-many-instance-attributes,too-many-locals,redefined-outer-name,fixme
# pylint: disable=superfluous-parens, no-member, invalid-name
from __future__ import print_function
import sys, random
sys.path.insert(0, "../../python")
import numpy as np
import mxnet as mx
from lstm im... | apache-2.0 |
nathangeffen/tbonline-2 | tbonlineproject/post/migrations/0002_auto__del_orderedimage__add_field_postwithslideshow_gallery__chg_field.py | 2 | 11929 | # 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 model 'OrderedImage'
db.delete_table('post_orderedimage')
# Adding field 'PostWithSlid... | mit |
Tokyo-Buffalo/tokyosouth | env/lib/python3.6/site-packages/twisted/internet/fdesc.py | 62 | 3223 | # -*- test-case-name: twisted.test.test_fdesc -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utility functions for dealing with POSIX file descriptors.
"""
import os
import errno
try:
import fcntl
except ImportError:
fcntl = None
# twisted imports
from twisted.internet.main ... | mit |
jounex/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl3/style.py | 55 | 11943 | # file openpyxl/style.py
# Copyright (c) 2010 openpyxl
#
# 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, modify, ... | apache-2.0 |
evandrix/Splat | doc/pyqt-cookbook/session4/todo.py | 5 | 4069 | # -*- coding: utf-8 -*-
"""A simple backend for a TODO app, using Elixir"""
import os
from elixir import *
dbdir=os.path.join(os.path.expanduser("~"),".pyqtodo")
dbfile=os.path.join(dbdir,"tasks.sqlite")
# It's good policy to have your app use a hidden folder in
# the user's home to store its files. That way, you ... | mit |
mozilla/BanHammer | vendor-local/lib/python/netaddr/ip/nmap.py | 9 | 3765 | #-----------------------------------------------------------------------------
# Copyright (c) 2008-2012, David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""
Routines for deali... | bsd-3-clause |
jbenden/ansible | lib/ansible/modules/cloud/cloudstack/cs_instance_facts.py | 11 | 9513 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
cocktail13/pogom.py | Tools/Hex-Beehive-Generator/location_generator.py | 16 | 1851 | import math
import argparse
import json
parser = argparse.ArgumentParser()
parser.add_argument("-lat", "--lat", help="latitude")
parser.add_argument("-lon", "--lon", help="longitude")
parser.add_argument("-st", "--steps", help="steps")
parser.add_argument("-lp", "--leaps", help="like 'steps' but for workers instead of... | agpl-3.0 |
Shedino/SherpaHighLevel | catkin_ws/src/casy_rover/mavlink/pymavlink/build/lib.linux-x86_64-2.7/pymavlink/generator/gen_MatrixPilot.py | 21 | 7998 | '''
Use mavgen.py matrixpilot.xml definitions to generate
C and Python MAVLink routines for sending and parsing the protocol
This python script is soley for MatrixPilot MAVLink impoementations
Copyright Pete Hollands 2011, 2012
Released under GNU GPL version 3 or later
'''
import os, sys, glob, re
from shutil import ... | bsd-3-clause |
parisk/pyOCD | pyOCD/transport/transport.py | 2 | 1459 | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | apache-2.0 |
MERegistro/meregistro | tests/modeltests/select_related/models.py | 133 | 1643 | """
41. Tests for select_related()
``select_related()`` follows all relationships and pre-caches any foreign key
values so that complex trees can be fetched in a single query. However, this
isn't always a good idea, so the ``depth`` argument control how many "levels"
the select-related behavior will traverse.
"""
fro... | bsd-3-clause |
Alwnikrotikz/paimei | console/modules/_PAIMEIdiff/DiffModules/crc.py | 1 | 2243 | #
# $Id$
#
from defines import *
class crc:
def __init__(self, parent=None):
self.attributes = {} # initialize attributes
self.attributes["Match"] = 1 # Match attribute set to 1 tells the main program we can be used to match
self.attribute... | gpl-2.0 |
alexryndin/ambari | ambari-funtest/src/test/resources/stacks/HDP/2.0.7/services/HIVE/package/scripts/hive_service.py | 10 | 2330 | #!/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 |
kytvi2p/Sigil | 3rdparty/python/Lib/lib2to3/pgen2/grammar.py | 88 | 5366 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... | gpl-3.0 |
Fireblend/scikit-learn | sklearn/decomposition/tests/test_pca.py | 199 | 10949 | import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_rai... | bsd-3-clause |
amosshapira/troposphere | troposphere/validators.py | 20 | 1842 | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
def boolean(x):
if x in [True, 1, '1', 'true', 'True']:
return "true"
if x in [False, 0, '0', 'false', 'False']:
return "false"
raise ValueError
def integer(x):
try:
... | bsd-2-clause |
837468220/python-for-android | python3-alpha/python3-src/Lib/distutils/tests/test_register.py | 46 | 7578 | """Tests for distutils.command.register."""
import sys
import os
import unittest
import getpass
import urllib
import warnings
from test.support import check_warnings, run_unittest
from distutils.command import register as register_module
from distutils.command.register import register
from distutils.core import Distr... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.