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
kenshay/ImageScripter
Script_Runner/PYTHON/Lib/asyncio/format_helpers.py
35
2404
import functools import inspect import reprlib import sys import traceback from . import constants def _get_function_source(func): func = inspect.unwrap(func) if inspect.isfunction(func): code = func.__code__ return (code.co_filename, code.co_firstlineno) if isinstance(func, functools.par...
gpl-3.0
evlyapin/ansible-modules-core
files/stat.py
94
13076
#!/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
funtoo/portage-funtoo
pym/portage/tests/lazyimport/test_lazy_import_portage_baseline.py
17
2349
# Copyright 2010-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import re import portage from portage import os from portage.const import PORTAGE_PYM_PATH from portage.tests import TestCase from portage.util._eventloop.global_event_loop import global_event_loop from _emerge....
gpl-2.0
Fullbiter/EECS-293
pa3/serial_number.py
2
1766
# Kevin Nash (kjn33) # EECS 293 # Assignment 3 from fractions import gcd from product_error import ProductError class SerialNumber: """Store the serial number of an Orange product""" def __init__(self, serial_number): """Initialize the number attribute of this SerialNumber""" self.ser...
gpl-3.0
grengojbo/st2
st2common/st2common/models/api/actionrunner.py
13
1356
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
apache-2.0
Salat-Cx65/python-for-android
python3-alpha/extra_modules/gdata/analytics/__init__.py
261
6995
#!/usr/bin/python # # Original Copyright (C) 2006 Google Inc. # Refactored in 2009 to work for Google Analytics by Sal Uryasev at Juice Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
apache-2.0
alexteodor/odoo
addons/stock_invoice_directly/stock_invoice_directly.py
337
2132
# -*- 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
habnabit/pip
tests/functional/test_install_vcs_svn.py
40
1055
import pytest from mock import patch from pip.vcs.subversion import Subversion @patch('pip.vcs.call_subprocess') @pytest.mark.network def test_obtain_should_recognize_auth_info_url(call_subprocess_mock, script): svn = Subversion(url='svn+http://username:password@svn.example.com/') svn.obtain(script.scratch_pa...
mit
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.5/Lib/distutils/tests/support.py
147
1277
"""Support code for distutils test cases.""" import shutil import tempfile from distutils import log class LoggingSilencer(object): def setUp(self): super(LoggingSilencer, self).setUp() self.threshold = log.set_threshold(log.FATAL) def tearDown(self): log.set_threshold(self.thresho...
mit
denis-pitul/django
django/middleware/security.py
510
1753
import re from django.conf import settings from django.http import HttpResponsePermanentRedirect class SecurityMiddleware(object): def __init__(self): self.sts_seconds = settings.SECURE_HSTS_SECONDS self.sts_include_subdomains = settings.SECURE_HSTS_INCLUDE_SUBDOMAINS self.content_type_no...
bsd-3-clause
python-fedex-devs/python-fedex
tests/test_rate_service.py
2
2051
""" Test module for the Fedex RateService WSDL. """ import unittest import logging import sys sys.path.insert(0, '..') from fedex.services.rate_service import FedexRateServiceRequest # Common global config object for testing. from tests.common import get_fedex_config CONFIG_OBJ = get_fedex_config() logging.getLogg...
bsd-3-clause
chainer/chainer
chainer/functions/connection/deformable_convolution_2d_sampler.py
6
5710
import numpy from chainer import backend from chainer.functions.array import broadcast from chainer.functions.array import concat from chainer.functions.array import pad as pad_module from chainer.functions.array import spatial_transformer_sampler from chainer.functions.math import matmul def deformable_convolution...
mit
ooici/coi-services
ion/services/eoi/table_loader.py
1
13500
#!/usr/bin/python """ A Service to load data products into PostgreSQL and Geoserver """ __author__ = 'abird' from pyon.util.breakpoint import breakpoint from pyon.ion.resource import LCS, LCE, PRED from pyon.util.file_sys import FileSystem, FS import psycopg2 import requests import os from pyon.public import CFG from...
bsd-2-clause
yglazko/socorro
socorro/unittest/app/test_socorro_app.py
10
10471
import mock from nose.tools import eq_, ok_, assert_raises from socorro.unittest.testbase import TestCase from socorro.processor.processor_app import ProcessorApp from configman import ( class_converter, Namespace, command_line, ConfigFileFutureProxy, ) from configman.dotdict import DotDict from socorr...
mpl-2.0
trungkiendt9/PlaformIO
Blynk_SIM808/.pio/libdeps/nanoatmega328/Maker PlayGround Device_ID1529/src/Blynk/tests/pseudo-library.py
6
6163
#!/usr/bin/python ''' This is a pseudo-library implementation Example: ./pseudo-library.py -t b168ccc8c8734fad98323247afbc1113 --dump Author: Volodymyr Shymanskyy License: The MIT license ''' import select, socket, struct import os, sys, time, getopt from threading import Thread # Configuration options #...
gpl-3.0
note35/sinon
sinon/test/TestSinonMatcher.py
1
5492
import sys sys.path.insert(0, '../') import unittest import lib.base as sinon from lib.matcher import SinonMatcher from lib.spy import SinonSpy from lib.stub import SinonStub """ ====================================================== FOR TEST ONLY START ===============================================...
bsd-2-clause
sparkslabs/kamaelia_
Sketches/MPS/Examples/LUGRadio/likefile.py
3
13538
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License...
apache-2.0
nasimrahaman/tracky-mctrackface
tmtf/net.py
1
4380
import theano as th import theano.tensor as T import Antipasti.netkit as nk import Antipasti.netarchs as na import Antipasti.archkit as ak import Antipasti.netools as ntl import Antipasti.netrain as nt import Antipasti.backend as A __doc__ = """Model Zoo""" # Define shortcuts # Convlayer with ELU cl = lambda fmapsin...
mit
collinjackson/mojo
build/win/reorder-imports.py
103
1807
#!/usr/bin/env python # Copyright 2014 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 glob import optparse import os import shutil import subprocess import sys def reorder_imports(input_dir, output_dir, architectu...
bsd-3-clause
noldor/CodeIgniter4
user_guide_src/source/conf.py
4
8558
# -*- coding: utf-8 -*- # # CodeIgniter documentation build configuration file, created by # sphinx-quickstart on Sun Aug 28 07:24:38 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. # #...
mit
ChinaMassClouds/copenstack-server
openstack/src/horizon-2014.2/openstack_dashboard/test/integration_tests/tests/test_dashboard_help_redirection.py
12
1235
# 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 # d...
gpl-2.0
VitalPet/odoo
addons/mail/tests/__init__.py
52
1280
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
keerts/home-assistant
homeassistant/components/notify/command_line.py
12
1583
""" Support for command line notification services. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.command_line/ """ import logging import subprocess import voluptuous as vol from homeassistant.const import (CONF_COMMAND, CONF_NAME) from homeass...
apache-2.0
Edraak/edx-ora2
openassessment/xblock/test/test_save_files_descriptions.py
3
2828
# -*- coding: utf-8 -*- """ Test that the student can save a files descriptions. """ import json import mock from .base import XBlockHandlerTestCase, scenario class SaveFilesDescriptionsTest(XBlockHandlerTestCase): """ Group of tests to check ability to save files descriptions """ @scenario('data/...
agpl-3.0
SNeuhausen/training_management
models/teaching_selection_wizard/teaching_selection_wizard.py
1
3023
# -*- coding: utf-8 -*- from openerp.api import depends, multi from openerp.fields import Many2one, Many2many, Boolean from openerp.models import TransientModel from openerp.addons.training_management.models.model_names import ModelNames from openerp.addons.training_management.utils.action_utils import ActionUtils fr...
gpl-3.0
TeamBasedLearning/Service
pgtbl/accounts/tests/test_model.py
1
2437
from rest_framework.test import APITestCase from accounts.models import User class UserTestCase(APITestCase): """ Unit test case to test user features. """ def setUp(self): """ This method will run before any test. """ self.superuser = User.objects.create_superuser( ...
gpl-3.0
nwinter/bantling
src/lib/werkzeug/debug/__init__.py
81
7867
# -*- coding: utf-8 -*- """ werkzeug.debug ~~~~~~~~~~~~~~ WSGI application traceback debugger. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import mimetypes from os.path import join, dirname, basename, isfile from werkzeu...
mit
l8orre/nxtBridge
werkzeug/http.py
317
33404
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
mit
jeremiah-c-leary/vhdl-style-guide
vsg/rules/generate/rule_400.py
1
1308
from vsg.rules import align_tokens_in_region_between_tokens_when_between_tokens_unless_between_tokens from vsg import token lAlign = [] lAlign.append(token.full_type_declaration.identifier) lAlign.append(token.incomplete_type_declaration.identifier) lAlign.append(token.file_declaration.identifier) lAlign.append(toke...
gpl-3.0
shitolepriya/test-erp
erpnext/hr/doctype/employee/test_employee.py
59
1178
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import unittest import frappe.utils test_records = frappe.get_test_records('Employee') class TestEmployee(unittest.TestCase): def test...
agpl-3.0
cschenck/blender_sim
fluid_sim_deps/blender-2.69/2.69/python/lib/python3.3/stringprep.py
205
12917
# This file is generated by mkstringprep.py. DO NOT EDIT. """Library that exposes various tables found in the StringPrep RFC 3454. There are two kinds of tables: sets, for which a member test is provided, and mappings, for which a mapping function is provided. """ from unicodedata import ucd_3_2_0 as unicodedata ass...
gpl-3.0
pla93/django-mantis-actionables
mantis_actionables/migrations/0010_auto_20150217_2021.py
2
1120
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mantis_actionables', '0009_auto_20150217_0902'), ] operations = [ migrations.AddField( model_name='source', ...
gpl-2.0
DavidLKing/w2v-demo
venv/lib/python3.5/site-packages/pip/commands/list.py
339
11369
from __future__ import absolute_import import json import logging import warnings try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest from pip._vendor import six from pip.basecommand import Command from pip.exceptions import CommandError from pip.index...
gpl-3.0
nuuuboo/odoo
addons/account/res_config.py
200
25453
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
ntt-pf-lab/backup_keystone
keystone/logic/types/fault.py
4
4840
# Copyright (c) 2010-2011 OpenStack, LLC. # # 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 ...
apache-2.0
pandegroup/osprey
osprey/strategies.py
2
12612
from __future__ import print_function, absolute_import, division import sys import inspect import socket import numpy as np from sklearn.utils import check_random_state from sklearn.model_selection import ParameterGrid try: from hyperopt import (Trials, tpe, fmin, STATUS_OK, STATUS_RUNNING, ...
apache-2.0
BorisJeremic/Real-ESSI-Examples
parallel/test_cases/4NodeANDES/circular_plate_clamped/side_length_10/compare_txt.py
637
2094
#!/usr/bin/python import h5py import sys import numpy as np import os import re import random # find the path to my own python function: cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own function for color and comparat...
cc0-1.0
spcui/tp-qemu
qemu/tests/getfd.py
16
2195
import os from autotest.client.shared import error def run(test, params, env): """ Test QEMU's getfd command 1) Boot up a guest 2) Pass file descriptors via getfd 3) Check if qemu process has a copy of the file descriptor :param test: QEMU test object. :param params: Dictionary with th...
gpl-2.0
pschmitt/home-assistant
homeassistant/components/rpi_gpio/__init__.py
8
1332
"""Support for controlling GPIO pins of a Raspberry Pi.""" import logging from RPi import GPIO # pylint: disable=import-error from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP _LOGGER = logging.getLogger(__name__) DOMAIN = "rpi_gpio" def setup(hass, config): """Set up the Ra...
apache-2.0
40223234/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/locale.py
624
1918
def getdefaultlocale(): return __BRYTHON__.language,None def localeconv(): """ localeconv() -> dict. Returns numeric and monetary locale-specific parameters. """ # 'C' locale default values return {'grouping': [127], 'currency_symbol': '', ...
gpl-3.0
kevinjqiu/btsync.py
docs/conf.py
1
7788
# -*- coding: utf-8 -*- # # btsync.py documentation build configuration file, created by # sphinx-quickstart on Wed Oct 9 17:19:48 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
mit
kwikadi/orange3
Orange/tests/test_instance.py
1
14396
from math import isnan import warnings import unittest from unittest.mock import MagicMock import numpy as np from numpy.testing import assert_array_equal from Orange.data import \ Instance, Domain, Unknown, Value, \ DiscreteVariable, ContinuousVariable, StringVariable class TestInstance(unittest.TestCase):...
bsd-2-clause
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/tensorflow/contrib/labeled_tensor/python/ops/_typecheck.py
52
10165
# 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...
gpl-3.0
iradul/qtwebkit
Tools/QueueStatusServer/model/warninglog.py
122
2147
# Copyright (C) 2013 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 ...
gpl-2.0
vadimtk/chrome4sdp
tools/git/mass-rename.py
170
1344
#!/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. """ mass-rename: update source files (gyp lists, #includes) to reflect a rename. Expects "git diff --cached -M" to list a bunch of ren...
bsd-3-clause
yulbryn/armory-leap
python/lib/ws4py/server/geventserver.py
2
3779
# -*- coding: utf-8 -*- __doc__ = """ WSGI entities to support WebSocket from within gevent. Its usage is rather simple: .. code-block: python from gevent import monkey; monkey.patch_all() from ws4py.websocket import EchoWebSocket from ws4py.server.geventserver import WSGIServer from ws4py.server.wsg...
gpl-3.0
nginnever/zogminer
contrib/devtools/security-check.py
28
6511
#!/usr/bin/python2 ''' Perform basic ELF security checks on a series of executables. Exit status will be 0 if successful, and the program will be silent. Otherwise the exit status will be 1 and it will log which executables failed which checks. Needs `readelf` (for ELF) and `objdump` (for PE). ''' from __future__ impor...
mit
bugobliterator/ardupilot-chibios
Tools/scripts/decode_devid.py
8
1865
#!/usr/bin/env python ''' decode a device ID, such as used for COMPASS_DEV_ID, INS_ACC_ID etc To understand the devtype you should look at the backend headers for the sensor library, such as libraries/AP_Compass/AP_Compass_Backend.h ''' import sys import optparse parser = optparse.OptionParser("decode_devid.py") par...
gpl-3.0
google-research/sloe-logistic
sloe_experiments/p_values.py
1
2329
# coding=utf-8 # Copyright 2021 The SLOE Logistic 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
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/selenium/webdriver/ie/service.py
17
3917
#!/usr/bin/python # # Copyright 2012 Webdriver_name committers # Copyright 2012 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 ...
agpl-3.0
callen/Alky-Reborn
Convertor/Targets/Linux/LinuxLinker.py
2
4128
# Copyright 2006 Falling Leaf Systems, LLC. # Refer to LICENSE in the root directory. import os loweralpha = 'abcdefghijklmnopqrstuvwxyz' class LinuxLinker: def __init__(self, source, dest, linkwrapper, converted): self.source = source self.dest = dest self.linkwrapper = linkwrapper self.convert...
lgpl-3.0
arrabito/DIRAC
ResourceStatusSystem/Utilities/CSHelpers.py
1
11101
""" CSHelpers Module containing functions interacting with the CS and useful for the RSS modules. """ import errno from DIRAC import gConfig, gLogger, S_OK, S_ERROR from DIRAC.Core.Utilities.SitesDIRACGOCDBmapping import getGOCSiteName from DIRAC.ResourceStatusSystem.Utilities import Utils from DIRAC.Resources.S...
gpl-3.0
yufengg/tensorflow
tensorflow/python/ops/distributions/kullback_leibler.py
29
5401
# 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
fkorotkov/pants
tests/python/pants_test/java/jar/test_manifest.py
33
1127
# coding=utf-8 # Copyright 2015 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 unittest fro...
apache-2.0
40123148/w17b
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/surface.py
603
3844
from browser import document, html, window from javascript import console, JSConstructor from .rect import Rect #import pygame.rect canvas_ID=1 _canvas_id=None class Surface: def __init__(self, dim=[], depth=16, surf=None): if surf is None: self._depth=depth self._canvas=html.CANVAS(width=...
agpl-3.0
cneill/designate-testing
designate/objects/zone_transfer_request.py
5
2204
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # Author: Graham Hayes <graham.hayes@hp.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/licens...
apache-2.0
rhoscanner-team/pcd-plotter
delaunay_example.py
1
1435
import numpy as np from scipy.spatial import Delaunay points = np.random.rand(30, 2) # 30 points in 2-d tri = Delaunay(points) # Make a list of line segments: # edge_points = [ ((x1_1, y1_1), (x2_1, y2_1)), # ((x1_2, y1_2), (x2_2, y2_2)), # ... ] edge_points = [] edges = set() def ad...
gpl-2.0
bobthekingofegypt/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/test_handshake.py
452
7134
#!/usr/bin/env python # # Copyright 2012, 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...
mpl-2.0
StefanRijnhart/odoo
addons/lunch/tests/__init__.py
172
1107
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
mathieugouin/txtWeb
mailer.py
1
4448
# User libs import mgouinlib as mgl import sendmail as sendmail # System libs import webapp2 #******************************************************************************* # http://localhost:8080/mailer?from=me@acme.com&to=mgouin@gmail.com&message=hello&subject=test&name=Mat%20Gouin&redirect=redir # http://mgouin....
gpl-2.0
nozuono/calibre-webserver
src/calibre/ebooks/oeb/transforms/embed_fonts.py
6
9738
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import logging from collections import defaultdict import cssutils from lxml...
gpl-3.0
jakeshi/python-twitter
twitter/api.py
1
202358
#!/usr/bin/env python # # # Copyright 2007-2016 The Python-Twitter Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
zcbenz/cefode-chromium
chrome/common/extensions/docs/server2/appengine_url_fetcher.py
5
1715
# 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. import base64 from appengine_wrappers import urlfetch from future import Future class _AsyncFetchDelegate(object): def __init__(self, rpc): self....
bsd-3-clause
aaltinisik/OCBAltinkaya
addons/account_followup/report/account_followup_report.py
382
4561
# -*- 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
blaquee/volatility
volatility/plugins/linux/dentry_cache.py
57
2513
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
gpl-2.0
jeremiahmarks/sl4a
python/gdata/src/gdata/tlslite/integration/POP3_TLS.py
271
5466
"""TLS Lite + poplib.""" import socket from poplib import POP3 from gdata.tlslite.TLSConnection import TLSConnection from gdata.tlslite.integration.ClientHelper import ClientHelper # POP TLS PORT POP3_TLS_PORT = 995 class POP3_TLS(POP3, ClientHelper): """This class extends L{poplib.POP3} with TLS support.""" ...
apache-2.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/encodings/iso8859_10.py
272
13589
""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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...
gpl-2.0
Coelhon/MasterRepo.repository
plugin.video.RabbitMovies/resources/lib/sources/disabled/movienight_mv.py
30
3240
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
837468220/python-for-android
python3-alpha/python3-src/Lib/copy.py
51
10331
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
apache-2.0
pplatek/odoo
addons/portal_project/tests/__init__.py
260
1086
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
NewpTone/stacklab-nova
debian/tmp/usr/lib/python2.7/dist-packages/nova/virt/xenapi/vmops.py
4
68206
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2010 OpenStack LLC. # # 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 # # htt...
apache-2.0
mokieyue/mopidy
mopidy/commands.py
4
15539
from __future__ import absolute_import, print_function, unicode_literals import argparse import collections import contextlib import logging import os import signal import sys import pykka from mopidy import config as config_lib, exceptions from mopidy.audio import Audio from mopidy.core import Core from mopidy.inte...
apache-2.0
hainm/pythran
pythran/optimizations/dead_code_elimination.py
4
3556
""" DeadCodeElimination remove useless code. """ from pythran.analyses import PureExpressions, UseDefChain from pythran.openmp import OMPDirective from pythran.passmanager import Transformation import pythran.metadata as metadata import ast class DeadCodeElimination(Transformation): """ Remove useless state...
bsd-3-clause
thundernet8/WRGameVideos-Server
venv/lib/python2.7/site-packages/sqlalchemy/ext/compiler.py
81
15770
# ext/compiler.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Provides an API for creation of custom ClauseElements and compilers. Synopsis ==...
gpl-2.0
sealuzh/ContextBasedAnalytics
model/connection.py
1
1087
class Connection(object): def __init__(self, method, status, url, timestamp): self.method = method self.status = status self.url = url self.timestamp = timestamp self.label = self.assign_label() def assign_label(self): parameter_url_split = self.url.split('?') if len(parameter_url_spli...
apache-2.0
tailorian/Sick-Beard
lib/guessit/language.py
19
13850
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2011 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free...
gpl-3.0
bmanojlovic/ansible
lib/ansible/modules/network/panos/panos_admpwd.py
32
5961
#!/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
jymannob/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ringtv.py
19
1952
from __future__ import unicode_literals import re from .common import InfoExtractor class RingTVIE(InfoExtractor): _VALID_URL = r'(?:http://)?(?:www\.)?ringtv\.craveonline\.com/(?P<type>news|videos/video)/(?P<id>[^/?#]+)' _TEST = { "url": "http://ringtv.craveonline.com/news/310833-luis-collazo-says-...
gpl-3.0
medialab/reanalyse
outside/views.py
1
34992
#!/usr/bin/python # -*- coding: utf-8 -*- import urllib, os from django.core import serializers from django.contrib.auth import login, logout, authenticate from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.models import User from django.conf import settings from...
lgpl-3.0
tealover/nova
nova/tests/unit/fake_server_actions.py
97
4562
# Copyright 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 applicable l...
apache-2.0
johankaito/fufuka
graph-tool/src/graph_tool/topology/__init__.py
2
70368
#! /usr/bin/env python # -*- coding: utf-8 -*- # # graph_tool -- a general graph manipulation python module # # Copyright (C) 2006-2015 Tiago de Paula Peixoto <tiago@skewed.de> # # 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...
apache-2.0
brakhane/panda3d
direct/src/leveleditor/SceneGraphUIBase.py
6
13334
""" Defines Scene Graph tree UI Base """ import wx from pandac.PandaModules import * from .ActionMgr import * from . import ObjectGlobals as OG class SceneGraphUIDropTarget(wx.TextDropTarget): def __init__(self, editor): print("in SceneGraphUIDropTarget::init...") wx.TextDropTarget.__init__(self) ...
bsd-3-clause
PythonScientists/Shape
env/lib/python3.5/site-packages/alembic/testing/env.py
16
7836
#!coding: utf-8 import os import shutil import textwrap from ..util.compat import u from ..script import Script, ScriptDirectory from .. import util from . import engines from . import provision def _get_staging_directory(): if provision.FOLLOWER_IDENT: return "scratch_%s" % provision.FOLLOWER_IDENT ...
apache-2.0
BassantMorsi/finderApp
lib/python2.7/site-packages/django/contrib/auth/views.py
16
23150
import functools import warnings from django.conf import settings # Avoid shadowing the login() and logout() views below. from django.contrib.auth import ( REDIRECT_FIELD_NAME, get_user_model, login as auth_login, logout as auth_logout, update_session_auth_hash, ) from django.contrib.auth.decorators import log...
mit
edfungus/Crouton-Python-Example
env/lib/python2.7/site-packages/setuptools/command/bdist_egg.py
306
17184
"""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 marshal import textwrap from pkg_resources import get_build_platform, Distri...
mit
mxOBS/deb-pkg_trusty_chromium-browser
third_party/protobuf/python/mox.py
603
38237
#!/usr/bin/python2.4 # # Copyright 2008 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 o...
bsd-3-clause
hideshis/scripts_for_research
FOSE2016/file_class_method_link/old/java_class_method_linker.py
2
4103
# -*- coding: utf-8 -*- import os import subprocess import sys import csv import re def class_info_getter(f, directory): class_dict = {} class_dict['name'] = f class_dict['path'] = directory class_dict['full path'] = class_dict['path'] + '/' + class_dict['name'] return class_dict def java_dict_get...
mit
chrisdamba/mining
manage.py
4
3181
#!/usr/bin/env python # -*- coding: utf-8 -*- from gevent import monkey monkey.patch_all() import sys import click from bottle import static_file, Bottle, run, view from bottle import TEMPLATE_PATH as T from bottle.ext.websocket import GeventWebSocketServer from bottle.ext.auth.decorator import login from gevent.pyw...
mit
gaddman/ansible
lib/ansible/modules/network/panos/panos_admin.py
27
5636
#!/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
unnikrishnankgs/va
venv/lib/python3.5/site-packages/pip/_vendor/requests/structures.py
615
3012
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections from .compat import OrderedDict class CaseInsensitiveDict(collections.MutableMapping): """A case-insensitive ``dict``-like object. Implements all methods and operations of `...
bsd-2-clause
cstavr/synnefo
snf-deploy/snfdeploy/context.py
2
4910
# Copyright (C) 2010-2014 GRNET S.A. # # 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 version. # # This program is distributed i...
gpl-3.0
faux123/pantech_vega_racer_2_kernel
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
sjholden/traveller-universe
travelleruniverse/world/world.py
1
1259
''' Created on May 30, 2017 @author: Sam Holden <sholden@holden.id.au> ''' class World(object): ''' classdocs ''' def __init__(self, port, size, atmo, hydro, pop, govt, law, tech, bases=None, extra=None): ''' Constructor ''' self._port = port ...
gpl-3.0
cgsheeh/moz_intern_presentation
node_modules/node-gyp/gyp/gyptest.py
1752
8019
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner(obje...
mit
SickGear/SickGear
lib/dateutil/rrule.py
2
68293
# -*- coding: utf-8 -*- """ The rrule module offers a small, complete, and very fast, implementation of the recurrence rules documented in the `iCalendar RFC <https://tools.ietf.org/html/rfc5545>`_, including support for caching of results. """ import calendar import datetime import heapq import itertools im...
gpl-3.0
simonspa/django-datacollect
datacollect/survey/migrations/0074_auto_20161128_1022.py
1
2106
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-11-28 09:22 from __future__ import unicode_literals from django.db import migrations, models import select_multiple_field.models class Migration(migrations.Migration): dependencies = [ ('survey', '0073_auto_20161123_1720'), ] operations ...
gpl-3.0
eenchev/idea-note-taking-app
env/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/pypostgresql.py
33
2655
# postgresql/pypostgresql.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: postgresql+pypostgresql :name: py-postgresql :db...
mit
linvictor88/vse-lbaas-driver
quantum/plugins/brocade/QuantumPlugin.py
1
19982
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Brocade Communications System, 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 # # ...
apache-2.0
sofianehaddad/ot-svn
python/test/t_ChiSquareFactory_std.py
2
1625
#! /usr/bin/env python from openturns import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: distribution = ChiSquare(0.5) size = 10000 sample = distribution.getSample(size) factory = ChiSquareFactory() estimatedDistribution = factory.build(sample) print "distribution=", repr(distribution) ...
mit
rahuldan/sympy
sympy/physics/tests/test_qho_1d.py
88
1552
from sympy import exp, integrate, oo, Rational, pi, S, simplify, sqrt, Symbol from sympy.core.compatibility import range from sympy.abc import omega, m, x from sympy.physics.qho_1d import psi_n, E_n, coherent_state from sympy.physics.quantum.constants import hbar nu = m * omega / hbar def test_wavefunction(): Ps...
bsd-3-clause