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
jeroanan/Aquarius
tests/TestAquarius.py
1
4439
import unittest from unittest.mock import Mock from aquarius.Aquarius import Aquarius from aquarius.Harvester import Harvester from aquarius.Interactor import Interactor from aquarius.InteractorFactory import InteractorFactory from aquarius.interactors.AddBookInteractor import AddBookInteractor from aquarius.interacto...
gpl-3.0
jimsimon/sky_engine
build/gyp_environment.py
101
1320
# 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. """ Sets up various automatic gyp environment variables. These are used by gyp_chromium and landmines.py which run at different stages of runhooks. To make s...
bsd-3-clause
paulrouget/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/tests/test_wpttest.py
6
7222
import pytest import sys from io import BytesIO from mock import Mock from manifest import manifest as wptmanifest from manifest.item import TestharnessTest from .. import manifestexpected, wpttest dir_ini_0 = """\ prefs: [a:b] """ dir_ini_1 = """\ prefs: [@Reset, b:c] max-asserts: 2 min-asserts: 1 tags: [b, c] """ ...
mpl-2.0
Mandelag/util
AGSMSLayerDownloader/consolidator.py
1
1493
import os, sys, arcpy, json def consolidate(directory, output, output_name): #import pdb scriptpath = sys.path[0] inputdir = os.path.join(scriptpath, directory) outputdir = os.path.join(scriptpath, output) files = os.listdir(inputdir) n_files = len(files) jsons = [] features = {} ...
gpl-3.0
goddino/libjingle
trunk/tools/gyp/test/lib/TestCommon.py
307
21397
""" TestCommon.py: a testing framework for commands and scripts with commonly useful error handling The TestCommon module provides a simple, high-level interface for writing tests of executable commands and scripts, especially commands and scripts that interact with the file system. All methods throw...
bsd-3-clause
eddyb/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/_code/_py2traceback.py
192
2887
# copied from python-2.7.3's traceback.py # CHANGES: # - some_str is replaced, trying to create unicode strings # import types def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_va...
mpl-2.0
stuartarchibald/numba
numba/core/types/abstract.py
5
14721
from abc import ABCMeta, abstractmethod, abstractproperty from typing import Dict as ptDict, Type as ptType import itertools import weakref import numpy as np from numba.core.utils import cached_property # Types are added to a global registry (_typecache) in order to assign # them unique integer codes for fast match...
bsd-2-clause
boztalay/MeshnetTest
node.py
1
7721
from Tkinter import * from basics import * NODE_RADIUS = 5 NODE_COLOR = "green" NODE_PENDING_COLOR = "purple" CONNECTION_COLOR = "yellow" PACKETS_SENT_MAX = 100 class NodeError(Exception): pass class Node: def __init__(self, location): self.location = location self.connections = [] s...
mit
devendermishrajio/nova_test_latest
nova/objects/cell_mapping.py
30
3752
# 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...
apache-2.0
vmax-feihu/hue
desktop/core/ext-py/python-openid-2.2.5/openid/test/test_server.py
65
83484
"""Tests for openid.server. """ from openid.server import server from openid import association, cryptutil, oidutil from openid.message import Message, OPENID_NS, OPENID2_NS, OPENID1_NS, \ IDENTIFIER_SELECT, no_default, OPENID1_URL_LIMIT from openid.store import memstore import cgi import unittest import warnings...
apache-2.0
zhester/hzpy
examples/parseriff.py
1
2368
#!/usr/bin/env python """ Example RIFF (WAV contents) Data Parser Sample data is written to a CSV file for analysis. If matplotlib and numpy are available, signal plots (DFTs) are generated. """ import math import os import struct import wave try: import matplotlib.pyplot as plot import numpy import nu...
bsd-2-clause
AnnaWyszomirska/lesson1_1
tests/test_remove_contact_from_group.py
1
1949
from model.contact import Contact from model.group import Group import random def test_remove_contact_from_group(app, db, orm): if len(db.get_group_list()) == 0: app.group.create(Group(name="New one")) if len(db.get_contact_list()) == 0: app.contact.add(Contact(firstname="Anna", middlename="Jo...
apache-2.0
Mattze96/youtube-dl
youtube_dl/extractor/nextmedia.py
84
6336
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import parse_iso8601 class NextMediaIE(InfoExtractor): IE_DESC = '蘋果日報' _VALID_URL = r'http://hk.apple.nextmedia.com/[^/]+/[^/]+/(?P<date>\d+)/(?P<id>\d+)' _TESTS = [{ 'url': 'http://hk.apple.ne...
unlicense
tkajtoch/python-social-auth
social/backends/qq.py
9
2198
""" Created on May 13, 2014 @author: Yong Zhang (zyfyfe@gmail.com) """ import json from social.utils import parse_qs from social.backends.oauth import BaseOAuth2 class QQOAuth2(BaseOAuth2): name = 'qq' ID_KEY = 'openid' AUTHORIZE_URL = 'https://graph.qq.com/oauth2.0/authorize' ACCESS_TOKEN_URL = 'h...
bsd-3-clause
JohnDenker/brython
www/src/Lib/test/test_trace.py
109
14823
import os import io import sys from test.support import (run_unittest, TESTFN, rmtree, unlink, captured_stdout) import unittest import trace from trace import CoverageResults, Trace from test.tracedmodules import testmod #------------------------------- Utilities ---------------------...
bsd-3-clause
srpepperoni/libGDX
extensions/gdx-freetype/jni/freetype-2.5.5/src/tools/docmaker/docbeauty.py
877
2642
#!/usr/bin/env python # # DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org> # # This program is used to beautify the documentation comments used # in the FreeType 2 public headers. # from sources import * from content import * from utils import * import utils import sys, os, time, string, getopt ...
apache-2.0
tomer8007/kik-bot-api-unofficial
kik_unofficial/protobuf/entity/v1/entity_service_pb2.py
1
65624
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: entity/v1/entity_service.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import ref...
mit
ext/slideshow-frontend
slideshow/lib/queue.py
1
3299
#!/usr/bin/env python # -*- coding: utf-8 -*- from slideshow.lib.slide import Slide from slideshow.settings import Settings import slideshow.event as event import cherrypy def div_id(id): if id >= 0: return 'queue_%d' % id elif id == -1: return 'queue_int' else: raise ValueError, '...
agpl-3.0
marklar/fowles
py/ids_ventilator.py
1
1430
import re import time import zmq # # The input file is expected to have on each line: # 1. a video_id # 2. a tab # 3. a channel_id # The provided file (below: INPUT_FILE) matches that format. # # cfg INPUT_FILE = "py/10_pairs_of_vid_and_chan_ids.txt" PORT = 5557 # globals context = None pusher = None def m...
mit
mitchrule/Miscellaneous
Django_Project/django/Lib/site-packages/django/core/cache/backends/memcached.py
82
7200
"Memcached cache backend" import pickle import time from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.utils import six from django.utils.deprecation import ( RemovedInDjango19Warning, RenameMethodsBase, ) from django.utils.encoding import force_str from django.utils.functional imp...
mit
zenmanenergy/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py
426
2174
"""The match_hostname() function from Python 3.2, essential when using SSL.""" import re __version__ = '3.2.2' class CertificateError(ValueError): pass def _dnsname_to_pat(dn): pats = [] for frag in dn.split(r'.'): if frag == '*': # When '*' is a fragment by itself, it matches a non-...
lgpl-2.1
weiting-chen/manila
manila/network/linux/interface.py
4
7230
# Copyright 2014 Mirantis 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
groschovskiy/lerigos_music
Server/API/lib/Crypto/SelfTest/PublicKey/__init__.py
114
1842
# -*- coding: utf-8 -*- # # SelfTest/PublicKey/__init__.py: Self-test for public key crypto # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedic...
apache-2.0
yaojingwu1992/XlsxWriter
xlsxwriter/test/comparison/test_chart_axis03.py
8
2245
############################################################################### # # 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
mcollins12321/anita
venv/lib/python2.7/site-packages/requests/packages/chardet/gb2312freq.py
3132
36011
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
iabdalkader/micropython
tests/perf_bench/bm_fft.py
15
2107
# Copyright (c) 2019 Project Nayuki. (MIT License) # https://www.nayuki.io/page/free-small-fft-in-multiple-languages import math, cmath def transform_radix2(vector, inverse): # Returns the integer whose value is the reverse of the lowest 'bits' bits of the integer 'x'. def reverse(x, bits): y = 0 ...
mit
StempG/jstorm
bin/jstorm.py
19
16272
#!/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 # "...
apache-2.0
daniponi/django
django/contrib/gis/management/commands/ogrinspect.py
48
6020
import argparse from django.contrib.gis import gdal from django.core.management.base import BaseCommand, CommandError from django.utils.inspect import get_func_args class LayerOptionAction(argparse.Action): """ Custom argparse action for the `ogrinspect` `layer_key` keyword option which may be an integer...
bsd-3-clause
termie/nova-migration-demo
nova/api/ec2/metadatarequesthandler.py
2
2711
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
paulsmith/geodjango
tests/regressiontests/forms/localflavor/fi.py
20
21360
# -*- coding: utf-8 -*- # Tests for the contrib/localflavor/ FI form fields. tests = r""" # FIZipCodeField ############################################################# FIZipCodeField validates that the data is a valid FI zipcode. >>> from django.contrib.localflavor.fi.forms import FIZipCodeField >>> f = FIZipCodeFie...
bsd-3-clause
roadmapper/ansible
lib/ansible/modules/cloud/kubevirt/kubevirt_rs.py
21
6703
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, 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', ...
gpl-3.0
ThomasSweijen/TPF
doc/sphinx/conf.py
1
28022
# -*- coding: utf-8 -*- # # Yade documentation build configuration file, created by # sphinx-quickstart on Mon Nov 16 21:49:34 2009. # # 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. # # All co...
gpl-2.0
TonnyXu/Zxing
cpp/scons/scons-time.py
34
50485
#!/usr/bin/env python # # scons-time - run SCons timings and collect statistics # # A script for running a configuration through SCons with a standard # set of invocations to collect timing and memory statistics and to # capture the results in a consistent set of output files for display # and analysis. # # # Copyrigh...
apache-2.0
JazzeYoung/VeryDeepAutoEncoder
pylearn2/pylearn2/testing/cost.py
34
3350
""" Simple costs to be used for unit tests. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from functools import wraps from pylearn2.costs....
bsd-3-clause
2ndQuadrant/ansible
test/units/modules/network/cnos/test_cnos_command.py
45
4330
# 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 # (at your option) any later version. # # Ansi...
gpl-3.0
tectronics/rebuildingtogethercaptain
rest/__init__.py
2
112205
#!/usr/bin/env python # # Copyright (c) 2012 Boomi, 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 l...
apache-2.0
armikhael/software-center
test/gtk3/test_views.py
1
1845
#!/usr/bin/python from gi.repository import Gtk, GObject import sys import unittest sys.path.insert(0,"../..") sys.path.insert(0,"..") #from mock import Mock TIMEOUT=300 import softwarecenter.paths softwarecenter.paths.datadir = "../data" class TestViews(unittest.TestCase): def test_viewswitcher(self): ...
gpl-3.0
MatthewWilkes/django
django/contrib/gis/gdal/datasource.py
357
4777
""" DataSource is a wrapper for the OGR Data Source object, which provides an interface for reading vector geometry data from many different file formats (including ESRI shapefiles). When instantiating a DataSource object, use the filename of a GDAL-supported data source. For example, a SHP file or a TIGER/Line...
bsd-3-clause
digdoritos/gimp
plug-ins/pygimp/gimpplugin.py
17
1993
# Gimp-Python - allows the writing of Gimp plugins in Python. # Copyright (C) 1997 James Henstridge <james@daa.com.au> # # 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 versio...
gpl-3.0
mlaitinen/odoo
openerp/addons/base/res/__init__.py
384
1261
# -*- 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 GNU...
agpl-3.0
jbigham1/shpescape
shapeft/models.py
18
1495
import random import md5 from django.db import models from ft_auth.models import OAuthAccessToken STATUS_CODES = { 1 : 'In Queue (%s ahead of you)', 2 : 'Initial Processing', 3 : 'Importing into Fusion Tables', 4 : 'Complete', 6 : 'Error' } class shapeUpload(models.Model): """An upload -- includes location ...
apache-2.0
ViralLeadership/numpy
numpy/doc/structured_arrays.py
72
11442
""" ================= Structured Arrays ================= Introduction ============ Numpy provides powerful capabilities to create arrays of structured datatype. These arrays permit one to manipulate the data by named fields. A simple example will show what is meant.: :: >>> x = np.array([(1,2.,'Hello'), (2,3.,"Wo...
bsd-3-clause
vsajip/django
django/contrib/gis/db/backends/spatialite/creation.py
7
5703
import os from django.conf import settings from django.core.cache import get_cache from django.core.cache.backends.db import BaseDatabaseCache from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.creation import DatabaseCreation class SpatiaLiteCreation(DatabaseCreation): def cr...
bsd-3-clause
David-Levinthal/gooda
gooda-analyzer/gooda_sum.py
2
8855
#!/usr/bin/python """Copyright 2012 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 by applicable la...
apache-2.0
kerneltask/micropython
tests/extmod/uasyncio_event.py
16
2217
# Test Event class try: import uasyncio as asyncio except ImportError: try: import asyncio except ImportError: print("SKIP") raise SystemExit async def task(id, ev): print("start", id) print(await ev.wait()) print("end", id) async def task_delay_set(t, ev): await...
mit
berezovskyi/nikola
nikola/data/themes/base/messages/messages_sv.py
8
1564
# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { "%d min remaining to read": "%d minuter kvar att läsa", "(active)": "(aktiv)", "Also available in:": "Även tillgänglig på:", "Archive": "Arkiv", "Authors": "", "Categories": "Kategorier", "Comments": "Kommentarer"...
mit
raycarnes/stock-logistics-workflow
__unported__/stock_move_backdating/__openerp__.py
14
1703
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012+ BREMSKERL-REIBBELAGWERKE EMMERLING GmbH & Co. KG # Author Marco Dieckhoff # Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) # # This program is free software...
agpl-3.0
supermarcos/log2bq
mapreduce/test_support.py
25
4065
#!/usr/bin/env python # # Copyright 2010 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...
apache-2.0
zhanghui9700/eonboard
eoncloud_web/biz/account/views.py
1
16684
#-*-coding-utf-8-*- import logging from datetime import datetime from rest_framework import generics from rest_framework import status from rest_framework.response import Response from rest_framework.decorators import api_view from django.conf import settings from django.contrib.auth.models import User from django.u...
apache-2.0
martindisch/Arduino
Watering/logger.py
1
1285
import os, serial, time, numpy watchTime = 3600 measureInterval = 5 calcTime = 1.5 def receiving(ser): global last_received buffer_string = '' while True: buffer_string = buffer_string + ser.read(ser.inWaiting()) if '\n' in buffer_string: lines = buffer_string.split('\n') # Gua...
mit
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib64/scons-2.1.0/SCons/Scanner/Dir.py
21
3810
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # 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 # with...
gpl-2.0
NL66278/odoo
addons/hr_timesheet_sheet/report/__init__.py
342
1074
# -*- 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
Meriipu/quodlibet
gdist/search_provider.py
4
1904
# Copyright 2013-2016 Christoph Reiter # # 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, merge, publish, #...
gpl-2.0
vjmac15/Lyilis
lib/youtube_dl/extractor/voxmedia (VJ Washington's conflicted copy 2017-08-29).py
42
6525
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote class VoxMediaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?:theverge|vox|sbnation|eater|polygon|curbed|racked)\.com/(?:[^/]+/)*(?P<id>[^/?]+)' _TESTS = [{ ...
gpl-3.0
kjw0106/boto
tests/db/test_sequence.py
136
4065
# Copyright (c) 2010 Chris Moyer http://coredumped.org/ # # 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, ...
mit
Intel-bigdata/SSM
supports/integration-test/test_s3.py
2
1750
import argparse import unittest from util import * # To run this script, HDFS should be installed locally and configured for S3 support. # Please refer to s3-suppport.md in SSM repo's doc directory. DEST_DIR = "s3a://xxxctest" class TestS3(unittest.TestCase): # copy to S3 def test_s3(self): file_p...
apache-2.0
fahhem/plumbum
plumbum/commands/modifiers.py
1
12344
import os from select import select from subprocess import PIPE import sys from itertools import chain from plumbum.commands.processes import run_proc, ProcessExecutionError from plumbum.commands.base import AppendingStdoutRedirection, StdoutRedirection from plumbum.lib import read_fd_decode_safely class Future(obje...
mit
chauhanhardik/populo_2
lms/djangoapps/courseware/features/conditional.py
102
4723
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, steps from nose.tools import assert_in, assert_true # pylint: disable=no-name-in-module from common import i_am_registered_for_the_course, visit_scenario_item from problems_setup import add_problem_to_course, answer...
agpl-3.0
feend78/evennia
evennia/server/inputfuncs.py
1
15810
""" Functions for processing input commands. All global functions in this module whose name does not start with "_" is considered an inputfunc. Each function must have the following callsign: inputfunc(session, *args, **kwargs) Where "options" is always one of the kwargs, containing eventual protocol-options. Th...
bsd-3-clause
williballenthin/ida-netnode
netnode/test_netnode.py
1
4807
import random import string import logging import contextlib import idaapi from netnode import netnode # get the IDA version number ida_major, ida_minor = list(map(int, idaapi.get_kernel_version().split("."))) using_ida7api = (ida_major > 6) TEST_NAMESPACE = '$ some.namespace' def get_random_data(N): ''' ...
apache-2.0
pshen/ansible
lib/ansible/modules/network/iosxr/iosxr_config.py
32
11013
#!/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
aneeshusa/android-quill
jni/libhpdf-2.3.0RC2/if/python/hpdf_consts.py
32
19968
### ## * << Haru Free PDF Library 2.0.8 >> -- hpdf_consts.h ## * ## * URL http://libharu.org/ ## * ## * Copyright (c) 1999-2006 Takeshi Kanno ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that...
gpl-3.0
rebeling/pattern
pattern/server/cherrypy/cherrypy/lib/xmlrpcutil.py
123
1606
import sys import cherrypy from cherrypy._cpcompat import ntob def get_xmlrpclib(): try: import xmlrpc.client as x except ImportError: import xmlrpclib as x return x def process_body(): """Return (params, method) from request body.""" try: return get_xmlrpclib().loads(cher...
bsd-3-clause
dbentley/pants
tests/python/pants_test/tasks/test_execution_graph.py
23
10773
# 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
FlintHill/SUAS-Competition
env/lib/python3.7/site-packages/pip/_internal/req/constructors.py
8
9573
"""Backing implementation for InstallRequirement's various constructors The idea here is that these formed a major chunk of InstallRequirement's size so, moving them and support code dedicated to them outside of that class helps creates for better understandability for the rest of the code. These are meant to be used...
mit
tredavis/SoundprintOS
node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
2214
1347
#!/usr/bin/env python import re import json # http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
andurilhuang/Movie_Income_Prediction
paper/historycode/IMDbPY-5.1.1/imdb/linguistics.py
76
9353
""" linguistics module (imdb package). This module provides functions and data to handle in a smart way languages and articles (in various languages) at the beginning of movie titles. Copyright 2009-2012 Davide Alberani <da@erlug.linux.it> 2012 Alberto Malagoli <albemala AT gmail.com> 2009 H. Turg...
mit
sbidoul/buildbot
master/buildbot/test/unit/test_data_changes.py
6
15376
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
rahuldan/sympy
sympy/polys/tests/test_solvers.py
88
13327
"""Tests for low-level linear systems solver. """ from sympy.polys.rings import ring from sympy.polys.fields import field from sympy.polys.domains import ZZ, QQ from sympy.polys.solvers import solve_lin_sys def test_solve_lin_sys_2x2_one(): domain, x1,x2 = ring("x1,x2", QQ) eqs = [x1 + x2 - 5, 2*x...
bsd-3-clause
Freso/picard
test/test_util_filenaming.py
2
5602
# -*- coding: utf-8 -*- import os import os.path import unittest import sys from picard.util.filenaming import make_short_filename class ShortFilenameTest(unittest.TestCase): def __init__(self, *args, **kwargs): self.maxDiff = None self.root = os.path.join(sys.platform == "win32" and "X:\\" or "...
gpl-2.0
RafaelTorrealba/odoo
addons/project_issue/project_issue.py
217
29319
#-*- 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
atomic83/youtube-dl
youtube_dl/extractor/karrierevideos.py
115
3200
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( fix_xml_ampersands, float_or_none, xpath_with_ns, xpath_text, ) class KarriereVideosIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?karrierevideo...
unlicense
rangadi/incubator-beam
sdks/python/apache_beam/io/filesystems_test.py
6
8510
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "L...
apache-2.0
rbenjamin/namebench
nb_third_party/dns/tsigkeyring.py
248
1658
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
Toshakins/wagtail
wagtail/wagtailimages/migrations/0002_initial_data.py
13
2304
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import VERSION as DJANGO_VERSION from django.db import migrations def add_image_permissions_to_admin_groups(apps, schema_editor): ContentType = apps.get_model('contenttypes.ContentType') Permission = apps.get_model('auth.Permission')...
bsd-3-clause
tjanez/ansible
lib/ansible/modules/packaging/os/apt_rpm.py
25
5328
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2013, Evgenii Terechkov # Written by Evgenii Terechkov <evg@altlinux.org> # Based on urpmi module written by Philippe Makowski <philippem@mageia.org> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publi...
gpl-3.0
hasteur/g13bot_tools_new
scripts/maintenance/compat2core.py
1
7684
#!/usr/bin/python # -*- coding: utf-8 -*- """ A helper script to convert compat 1.0 scripts to the new core 2.0 framework. NOTE: Please be aware that this script is not able to convert your codes completely. It may support you with some automatic replacements and it gives some warnings and hints for converting. Please...
mit
osinstom/onos
tools/test/topos/default.py
6
6825
#!/usr/bin/env python """ """ from mininet.topo import Topo class AttMplsTopo( Topo ): "Internet Topology Zoo Specimen." def addSwitch( self, name, **opts ): kwargs = { 'protocols' : 'OpenFlow13' } kwargs.update( opts ) return super(AttMplsTopo, self).addSwitch( name, **kwargs ) ...
apache-2.0
shyamjvs/test-infra
jenkins/bootstrap.py
2
43714
#!/usr/bin/env python # Copyright 2016 The Kubernetes 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 appli...
apache-2.0
jspargo/AneMo
thermo/flask/lib/python2.7/site-packages/pip/_vendor/html5lib/trie/py.py
1323
1775
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError...
gpl-2.0
hsum/sqlalchemy
test/sql/test_unicode.py
28
6087
# coding: utf-8 """verrrrry basic unicode column name testing""" from sqlalchemy import * from sqlalchemy.testing import fixtures, engines, eq_ from sqlalchemy import testing from sqlalchemy.testing.schema import Table, Column from sqlalchemy.util import u, ue class UnicodeSchemaTest(fixtures.TestBase): __requir...
mit
ActiveState/code
recipes/Python/170995_Manipulating_infinite_lists_implemented/recipe-170995.py
1
3490
"""Collection of useful functions which work on infinite lists. The infinite lists are actually the generator objects. Note that the functions will have side effects on the passed-in gLists. """ from __future__ import generators def gInfinite(obj): """Return infinite list of repeated objects obj""" while 1: ...
mit
jiriprochazka/lnst
obsolete/netconfig.py
1
6220
#! /usr/bin/env python """ Netconfig tool Copyright 2011 Red Hat, Inc. Licensed under the GNU General Public License, version 2 as published by the Free Software Foundation; see COPYING for details. """ __author__ = """ jpirko@redhat.com (Jiri Pirko) """ import getopt import sys import logging import re import os fr...
gpl-2.0
napalm-automation/napalm
napalm/base/netmiko_helpers.py
1
1807
# The contents of this file are 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, softw...
apache-2.0
zstackio/zstack-woodpecker
integrationtest/vm/multihosts/migrate/test_migrate_vm_console_access.py
1
1292
''' New Integration test for testing console access after vm migration between hosts. @author: Quarkonics ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.account_operations as acc_ops vm = None test_stub = test_lib.lib_ge...
apache-2.0
fujunwei/chromium-crosswalk
tools/metrics/common/diff_util.py
103
1626
# 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. """Utility functions for prompting user if changes automatically applied to some user-managed files are correct. """ import logging import os import webbrow...
bsd-3-clause
KousikaGanesh/purchaseandInventory
openerp/addons/document_webdav/__init__.py
58
1119
# -*- 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
xray/xray
xarray/core/options.py
1
5201
import warnings DISPLAY_WIDTH = "display_width" ARITHMETIC_JOIN = "arithmetic_join" ENABLE_CFTIMEINDEX = "enable_cftimeindex" FILE_CACHE_MAXSIZE = "file_cache_maxsize" WARN_FOR_UNCLOSED_FILES = "warn_for_unclosed_files" CMAP_SEQUENTIAL = "cmap_sequential" CMAP_DIVERGENT = "cmap_divergent" KEEP_ATTRS = "keep_attrs" DIS...
apache-2.0
2uller/LotF
App/Lib/idlelib/OutputWindow.py
2
4725
from Tkinter import * from idlelib.EditorWindow import EditorWindow import re import tkMessageBox from idlelib import IOBinding class OutputWindow(EditorWindow): """An editor window that can serve as an output file. Also the future base class for the Python shell window. This class has no inpu...
gpl-2.0
katiecheng/Bombolone
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/sjisprober.py
1182
3734
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
bsd-3-clause
jelugbo/ddi
lms/djangoapps/courseware/tests/test_submitting_problems.py
8
47651
# -*- coding: utf-8 -*- """ Integration tests for submitting problem responses and getting grades. """ # text processing dependencies import json import os from textwrap import dedent from mock import patch from django.conf import settings from django.contrib.auth.models import User from django.test.client import Req...
agpl-3.0
bsipocz/astropy
astropy/wcs/docstrings.py
4
66390
# Licensed under a 3-clause BSD style license - see LICENSE.rst # It gets to be really tedious to type long docstrings in ANSI C # syntax (since multi-line string literals are not valid). # Therefore, the docstrings are written here in doc/docstrings.py, # which are then converted by setup.py into docstrings.h, which ...
bsd-3-clause
sdague/home-assistant
homeassistant/components/starline/binary_sensor.py
19
1776
"""Reads vehicle status from StarLine API.""" from homeassistant.components.binary_sensor import ( DEVICE_CLASS_DOOR, DEVICE_CLASS_LOCK, DEVICE_CLASS_POWER, DEVICE_CLASS_PROBLEM, BinarySensorEntity, ) from .account import StarlineAccount, StarlineDevice from .const import DOMAIN from .entity import...
apache-2.0
ChinaQuants/bokeh
tests/integration/webserver.py
21
3888
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
bsd-3-clause
nathanielvarona/airflow
airflow/contrib/operators/file_to_gcs.py
3
1728
# # 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...
apache-2.0
girving/tensorflow
tensorflow/python/debug/lib/debug_gradients_test.py
30
15730
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
mammique/django
tests/regressiontests/defer_regress/tests.py
25
10261
from __future__ import absolute_import from operator import attrgetter from django.contrib.contenttypes.models import ContentType from django.contrib.sessions.backends.db import SessionStore from django.db.models import Count from django.db.models.loading import cache from django.test import TestCase from .models im...
bsd-3-clause
nowls/gnuradio
gr-analog/python/analog/qa_pll_carriertracking.py
40
6967
#!/usr/bin/env python # # Copyright 2004,2007,2010-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at ...
gpl-3.0
Innovahn/odoo.old
openerp/addons/base/__init__.py
379
1134
# -*- 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
andreparrish/python-for-android
python3-alpha/python3-src/Lib/test/test_pkg.py
55
9399
# Test packages (dotted-name import) import sys import os import tempfile import textwrap import unittest from test import support # Helpers to create and destroy hierarchies. def cleanout(root): names = os.listdir(root) for name in names: fullname = os.path.join(root, name) if os.path.isdir...
apache-2.0