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
zhukaixy/kbengine
kbe/res/scripts/common/Lib/idlelib/ParenMatch.py
113
6713
"""ParenMatch -- An IDLE extension for parenthesis matching. When you hit a right paren, the cursor should move briefly to the left paren. Paren here is used generically; the matching applies to parentheses, square brackets, and curly braces. """ from idlelib.HyperParser import HyperParser from idlelib.configHandler...
lgpl-3.0
wraiden/spacewalk
backend/satellite_tools/exporter/xmlWriter.py
10
4603
# -*- coding: ISO-8859-1 -*- # # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE....
gpl-2.0
technologiescollege/Blockly-rduino-communication
scripts_XP/Lib/site-packages/prompt_toolkit/completion.py
20
5723
""" """ from __future__ import unicode_literals from abc import ABCMeta, abstractmethod from six import with_metaclass __all__ = ( 'Completion', 'Completer', 'CompleteEvent', 'get_common_complete_suffix', ) class Completion(object): """ :param text: The new string that will be inserted into t...
gpl-3.0
googleapis/googleapis-gen
google/cloud/videointelligence/v1p1beta1/videointelligence-v1p1beta1-py/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/grpc_asyncio.py
1
12936
# -*- coding: utf-8 -*- # Copyright 2020 Google 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...
apache-2.0
yephper/django
tests/model_options/test_tablespaces.py
1
5517
from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.db import connection from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from .models.tablespaces import ( Article, ArticleRef, Authors, Reviewers, Scientist, ScientistRef, ...
bsd-3-clause
zulip/django
django/contrib/messages/storage/session.py
478
1714
import json from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.cookie import ( MessageDecoder, MessageEncoder, ) from django.utils import six class SessionStorage(BaseStorage): """ Stores messages in the session (that is, django.contrib.sessions). """ ...
bsd-3-clause
chen0510566/MissionPlanner
Lib/site-packages/numpy/f2py/tests/test_return_real.py
59
5140
from numpy.testing import * from numpy import array import math import util class TestReturnReal(util.F2PyTest): def check_function(self, t): if t.__doc__.split()[0] in ['t0','t4','s0','s4']: err = 1e-5 else: err = 0.0 assert abs(t(234)-234.0)<=err assert abs...
gpl-3.0
openstack/neutron
neutron/tests/unit/objects/port/extensions/test_uplink_status_propagation.py
2
1302
# 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
justincassidy/scikit-learn
examples/mixture/plot_gmm_pdf.py
284
1528
""" ============================================= Density Estimation for a mixture of Gaussians ============================================= Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians with different centers and covariance matrices. """ import numpy as np import ma...
bsd-3-clause
mancoast/CPythonPyc_test
cpython/277_test_capi.py
15
4750
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. from __future__ import with_statement import sys import time import random import unittest from test import test_support try: import thread import threading excep...
gpl-3.0
bioinform/somaticseq
somaticseq/vcfModifier/modify_JointSNVMix2.py
1
3347
#!/usr/bin/env python3 import argparse import somaticseq.genomicFileHandler.genomic_file_handlers as genome def run(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) # Variant Call Type, i.e., snp or indel parser.add_argument('-infile', '--input-vcf', type=str...
bsd-2-clause
faassen/morepath
morepath/tests/test_publish.py
1
8911
import dectate import morepath from morepath.app import App from morepath.publish import publish, resolve_response from morepath.request import Response from morepath.view import render_json, render_html from webob.exc import HTTPNotFound, HTTPBadRequest, HTTPFound, HTTPOk import webob from webtest import TestApp as Cl...
bsd-3-clause
GiovanniConserva/TestDeploy
venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py
3133
34872
######################## 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...
bsd-3-clause
phenoxim/nova
nova/notifications/objects/instance.py
1
25085
# 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
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.2/Lib/distutils/command/check.py
1
5369
"""distutils.command.check Implements the Distutils 'check' command. """ __revision__ = "$Id: check.py 85197 2010-10-03 14:18:09Z tarek.ziade $" from distutils.core import Command from distutils.errors import DistutilsSetupError try: # docutils is installed from docutils.utils import Reporter from docuti...
mit
mapycz/mapnik
scons/scons-local-2.5.1/SCons/Scanner/IDL.py
3
1838
"""SCons.Scanner.IDL This module implements the dependency scanner for IDL (Interface Definition Language) files. """ # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Softw...
lgpl-2.1
morrisonwudi/zipline
tests/test_pickle_serialization.py
20
1652
# # Copyright 2015 Quantopian, 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 wr...
apache-2.0
AutorestCI/azure-sdk-for-python
azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display.py
2
1519
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
MartinHjelmare/home-assistant
homeassistant/components/proximity/__init__.py
7
9206
"""Support for tracking the proximity of a device.""" import logging import voluptuous as vol from homeassistant.const import ( CONF_DEVICES, CONF_UNIT_OF_MEASUREMENT, CONF_ZONE) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.event i...
apache-2.0
suneeth51/neutron
neutron/tests/unit/agent/common/test_config.py
56
1577
# Copyright 2012 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
cbrunker/quip
lib/Handlers.py
1
11422
# # Response handlers for P2P Server # import asyncio import logging from functools import partial from hashlib import sha1, sha384 from uuid import uuid4 from os import path from lib.Database import getFriendRequests, getSigningKeys, setUidMask, storeAuthority, setFriendAuth, getMessageKeys, \ setAddress, getFil...
gpl-3.0
dreamsxin/kbengine
kbe/src/lib/python/Lib/test/test_os.py
67
95658
# As a test suite for the os module, this is woefully inadequate, but this # does add tests for a few functions which have been determined to be more # portable than they had been thought to be. import os import errno import unittest import warnings import sys import signal import subprocess import time import shutil ...
lgpl-3.0
sebrandon1/tempest
tempest/lib/common/api_version_utils.py
8
5399
# Copyright 2015 NEC Corporation. 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 ...
apache-2.0
t-hey/QGIS-Original
python/plugins/processing/algs/qgis/ExtendLines.py
1
2995
# -*- coding: utf-8 -*- """ *************************************************************************** ExtendLines.py -------------------- Date : October 2016 Copyright : (C) 2016 by Nyall Dawson Email : nyall dot dawson at gmail dot com ******************...
gpl-2.0
studywolf/blog
InvKin/Arm.py
1
7959
''' Copyright (C) 2013 Travis DeWolf 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 in the hope t...
gpl-3.0
Mansilla1/Sistema-SEC
apps/usuarios/views.py
1
14404
#!/usr/bin/env python # -*- coding: utf-8 -*- # Código desarrollado por Daniel Mansilla from django.shortcuts import render, render_to_response, redirect from django.views.generic import ListView, CreateView, DetailView, DeleteView, UpdateView, TemplateView from django.http import HttpResponse, HttpResponseRedirect, Ht...
apache-2.0
svenstaro/python-web-boilerplate
boilerplateapp/models/user.py
1
2930
"""Module containing the `User` model.""" import uuid import secrets import string from datetime import datetime from sqlalchemy.dialects.postgresql import UUID from sqlalchemy_utils.models import Timestamp from flask import current_app from boilerplateapp.extensions import db, passlib class User(db.Model, Timesta...
mit
the100rabh/Barcamp-Bangalore-Android-App
gcm_flask/werkzeug/urls.py
73
18959
# -*- coding: utf-8 -*- """ werkzeug.urls ~~~~~~~~~~~~~ This module implements various URL related functions. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import urlparse from werkzeug._internal import _decode_unicode fr...
apache-2.0
mattclarkdotnet/haleasy
test/test_haltalk.py
1
4074
from unittest import TestCase from haleasy import HALEasy import responses class TestHaleasyHaltalk(TestCase): haltalk_root = '''{ "_links": { "self": { "href":"/" }, "curies": [ { "name": "ht", "hr...
mit
gtko/Sick-Beard
lib/hachoir_parser/image/common.py
90
1433
from lib.hachoir_core.field import FieldSet, UserVector, UInt8 class RGB(FieldSet): color_name = { ( 0, 0, 0): "Black", (255, 0, 0): "Red", ( 0, 255, 0): "Green", ( 0, 0, 255): "Blue", (255, 255, 255): "White", } static_size = 24 def createFields(...
gpl-3.0
fdslight/fdslight
pywind/web/handlers/websocket.py
1
8933
#!/usr/bin/env python3 import pywind as tcp_handler import pywind.web.lib.websocket as websocket import pywind.web.lib.httputils as httputils import socket, time class ws_listener(tcp_handler.tcp_handler): def init_func(self, creator, listen, is_ipv6=False): if is_ipv6: fa = socket.AF_INET6 ...
bsd-2-clause
johren/RackHD
test/tests/redfish10/test_redfish10_api_systems.py
1
17067
''' Copyright 2016, EMC, Inc. Author(s): George Paulos ''' import fit_path # NOQA: unused import import os import sys import subprocess import fit_common import flogging log = flogging.get_loggers() # Local methods NODECATALOG = fit_common.node_select() def _delete_active_tasks(node): for dummy in range(1,10...
apache-2.0
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/structured/labs/serving/application/lib/jinja2/idtracking.py
90
9197
from jinja2.visitor import NodeVisitor from jinja2._compat import iteritems VAR_LOAD_PARAMETER = 'param' VAR_LOAD_RESOLVE = 'resolve' VAR_LOAD_ALIAS = 'alias' VAR_LOAD_UNDEFINED = 'undefined' def find_symbols(nodes, parent_symbols=None): sym = Symbols(parent=parent_symbols) visitor = FrameSymbolVisitor(sym)...
apache-2.0
iSECPartners/android-ssl-bypass
AndroidSSLBypass/jythonconsole/jythonconsole-0.0.7/popup.py
9
5809
from java.lang import Character from javax.swing import JWindow, JList, JScrollPane from java.awt import Color, Dimension from java.awt.event import KeyEvent import sys __author__ = "Don Coleman <dcoleman@chariotsolutions.com>" __cvsid__ = "$Id: popup.py,v 1.9 2003/05/01 03:43:53 dcoleman Exp $" class Popup(JWindow):...
mit
halberom/ansible
lib/ansible/utils/module_docs_fragments/mysql.py
168
2909
# -*- coding: utf-8 -*- # Copyright (c) 2015 Jonathan Mainguy <jon@soh.re> # # 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...
gpl-3.0
chouseknecht/openshift-restclient-python
openshift/test/test_v1beta2_daemon_set_condition.py
1
4323
# coding: utf-8 """ OpenShift API (with Kubernetes) OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is...
apache-2.0
broomyocymru/ditto
ditto/core/cache.py
1
1389
import glob import os import shutil import uuid from os.path import expanduser import requests from ditto.core import logger def setup(): global session_uuid session_uuid = str(uuid.uuid1()) def cleanup(): shutil.rmtree(get_cache_dir(), True) def get_session_uuid(): return session_uuid def get...
mit
GhostThrone/django
tests/introspection/models.py
216
1112
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Reporter(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) email = models.EmailField(...
bsd-3-clause
chronicwaffle/PokemonGo-DesktopMap
app/pylibs/win32/Cryptodome/Protocol/SecretSharing.py
2
11355
# # SecretSharing.py : distribute a secret amongst a group of participants # # =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification...
mit
sopier/django
tests/admin_custom_urls/tests.py
276
6381
from __future__ import unicode_literals import datetime from django.contrib.admin.utils import quote from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.template.response import TemplateResponse from django.test import TestCase, override_settings from .models import A...
bsd-3-clause
oew1v07/scikit-image
skimage/viewer/plugins/crop.py
45
1379
from .base import Plugin from ..canvastools import RectangleTool from ...viewer.widgets import SaveButtons, Button __all__ = ['Crop'] class Crop(Plugin): name = 'Crop' def __init__(self, maxdist=10, **kwargs): super(Crop, self).__init__(**kwargs) self.maxdist = maxdist self.add_widg...
bsd-3-clause
jonathanlurie/Tubular
lib/python/gooey/gui/windows/basic_config_panel.py
2
1436
''' Created on Dec 9, 2013 @author: Chris ''' import wx from gooey.gui.lang import i18n from gooey.gui.option_reader import OptionReader class BasicConfigPanel(wx.Panel, OptionReader): def __init__(self, parent, **kwargs): wx.Panel.__init__(self, parent, **kwargs) self.header_msg = None ...
mit
beni55/dipy
dipy/align/tests/test_expectmax.py
5
16936
import numpy as np from dipy.align import floating import dipy.align.expectmax as em from numpy.testing import (assert_equal, assert_array_equal, assert_array_almost_equal, assert_raises) def test_compute_em_demons_step_2d(): r""" ...
bsd-3-clause
alex/solum
solum/openstack/common/db/sqlalchemy/migration_cli/ext_migrate.py
7
2321
# 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
IsmoilovMuhriddin/allgo
comp/picam_calibration.py
6
1633
""" Reference: OpenCV-Python Tutorials - Camera Calibration and 3D Reconstruction http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html """ import cv2 import numpy as np import glob # termination criteria criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITER...
mit
noironetworks/nova
nova/tests/unit/pci/test_utils.py
44
7119
# Copyright (c) 2013 Intel, Inc. # Copyright (c) 2012 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.apache.org/li...
apache-2.0
def-/commandergenius
project/jni/python/src/Lib/xml/sax/__init__.py
60
3587
"""Simple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modu...
lgpl-2.1
nateprewitt/pipenv
pipenv/patched/pip/_vendor/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## 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 ...
mit
jef-n/QGIS
tests/src/python/test_qgsconditionalstyle.py
41
7102
# -*- coding: utf-8 -*- """QGIS Unit tests for the memory layer provider. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later ver...
gpl-2.0
gojira/tensorflow
tensorflow/contrib/tensorboard/plugins/projector/__init__.py
97
2351
# 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
alexryndin/ambari
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_utils.py
16
1157
#!/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
yuanming-hu/taichi
tests/python/test_bitmasked.py
1
4777
import taichi as ti def archs_support_bitmasked(func): return ti.archs_excluding(ti.opengl, ti.cc)(func) @archs_support_bitmasked def test_basic(): x = ti.field(ti.i32) c = ti.field(ti.i32) s = ti.field(ti.i32) bm = ti.root.bitmasked(ti.ij, (3, 6)).bitmasked(ti.i, 5) bm.place(x) ti.root...
mit
pombreda/raft
ui/AnalysisConfig.py
11
6742
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'AnalysisConfig.ui' # # Created: Mon Aug 1 23:29:09 2011 # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except ...
gpl-3.0
tquilian/exeNext
exe/idevices/__init__.py
14
1025
# =========================================================================== # __init__.py # Copyright 2004, University of Auckland # # This is a placeholder # # 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 Fre...
gpl-2.0
Multimac/ansible-modules-extras
system/ohai.py
86
1695
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
gpl-3.0
t0mk/ansible
lib/ansible/modules/monitoring/airbrake_deployment.py
48
4021
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Bruce Pennypacker <bruce@pennypacker.org> # # 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...
gpl-3.0
moypray/flocker
flocker/ca/_ca.py
10
25667
# Copyright ClusterHQ Inc. See LICENSE file for details. """ Low-level logic for a certificate authority. We have three categories of certificates: 1. Control service, used by AMP and REST API servers. Needs to be validated over HTTP by 3rd party clients, as well as by AMP clients. 2. Node agents, used by AMP cl...
apache-2.0
rogerwang/chromium
third_party/simplejson/encoder.py
62
13024
""" Implementation of JSONEncoder """ import re try: from simplejson import _speedups except ImportError: _speedups = None ESCAPE = re.compile(r'[\x00-\x19\\"\b\f\n\r\t]') ESCAPE_ASCII = re.compile(r'([\\"/]|[^\ -~])') ESCAPE_DCT = { # escape all forward slashes to prevent </script> attack '/': '\\/', ...
bsd-3-clause
mrfuxi/django
django/utils/tree.py
372
4883
""" A class for storing a tree graph. Primarily used for filter constructs in the ORM. """ import copy class Node(object): """ A single internal node in the tree graph. A Node should be viewed as a connection (the root) with the children being either leaf nodes or other Node instances. """ # ...
bsd-3-clause
eric-stanley/youtube-dl
youtube_dl/extractor/yahoo.py
65
12164
# coding: utf-8 from __future__ import unicode_literals import itertools import json import re from .common import InfoExtractor, SearchInfoExtractor from ..compat import ( compat_urllib_parse, compat_urlparse, ) from ..utils import ( clean_html, unescapeHTML, ExtractorError, int_or_none, ...
unlicense
pajowu/nostradamIQ
NLP/TwitterSearch/TwitterSearch/TwitterUserOrder.py
8
4733
# -*- coding: utf-8 -*- import datetime from .TwitterSearchException import TwitterSearchException from .TwitterOrder import TwitterOrder from .utils import py3k try: from urllib.parse import parse_qs, quote_plus, unquote # python3 except ImportError: from urlparse import parse_qs from urllib import quot...
gpl-3.0
jemofthewest/GalaxyMage
src/Sound.py
1
2427
# Copyright (C) 2005 Colin McMillen <mcmillen@cs.cmu.edu> # # This file is part of GalaxyMage. # # GalaxyMage 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 opti...
gpl-2.0
vlachoudis/sl4a
python/src/Lib/test/test_memoryio.py
55
14313
"""Unit tests for memory-based file-like objects. StringIO -- for unicode strings BytesIO -- for bytes """ from __future__ import unicode_literals import unittest from test import test_support import io import sys import array try: import _bytesio has_c_implementation = True except ImportError: has_c_im...
apache-2.0
metacloud/python-novaclient
novaclient/v3/availability_zones.py
5
1052
# Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # 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/LIC...
apache-2.0
JohanComparat/pySU
galaxy/python/lineListAir.py
1
4082
""" Script loading the atomic properties from the pyNEB package. Mostly line transitions. Input to the line fitting procedures """ import numpy as n from scipy.interpolate import interp1d import pyneb as pn # Conversion from Morton (1991, ApJS, 77, 119) wavelength in Angstrom # SDSS spectra are in the vacuum, ther...
cc0-1.0
black-knight/magic_lamp
Server/src/board/markers/marker.py
1
2739
import cv2 from board.board_descriptor import BoardDescriptor class Marker(object): def __init__(self, marker_id): """ :param marker_id: Marker ID """ self.marker_id = marker_id def preferred_input_image_resolution(self): """ Returns the preferred input resolu...
apache-2.0
gechong/XlsxWriter
xlsxwriter/test/comparison/test_set_column06.py
8
1868
############################################################################### # # 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
klahnakoski/MySQL-to-S3
vendor/jx_python/flat_list.py
3
4542
# encoding: 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/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import unicode_literals from _...
mpl-2.0
JulyJ/MindBot
mindbot/router.py
1
2824
""" Module designed to route messages based on strategy pattern. This module includes class mapper tuple to correlate received from telegram user command with target command class to run. Additionally, this module generates help message based on command list. """ from typing import Any, Dict from .co...
mit
drpngx/tensorflow
tensorflow/python/util/decorator_utils.py
27
3614
# 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
mattattack7/canvas-contrib
API_Examples/bulk_migration/python/course_migrations.py
4
7997
#!/usr/bin/env python import json,csv,os import time import requests from multiprocessing import Pool """ You will need to edit several variables here at the top of this script. token = the access token from Canvas workingPath = the full working path to where the csv files are created. This is where the logs a...
agpl-3.0
marcoantoniooliveira/labweb
oscar/lib/python2.7/site-packages/IPython/nbconvert/exporters/exporter.py
2
19301
"""This module defines Exporter, a highly configurable converter that uses Jinja2 to export notebook files into different formats. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD L...
bsd-3-clause
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons/sale_crm/wizard/__init__.py
443
1077
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
akhilari7/pa-dude
lib/python2.7/site-packages/nltk/tokenize/util.py
3
3056
# Natural Language Toolkit: Tokenizer Utilities # # Copyright (C) 2001-2015 NLTK Project # Author: Steven Bird <stevenbird1@gmail.com> # URL: <http://nltk.sourceforge.net> # For license information, see LICENSE.TXT from re import finditer def string_span_tokenize(s, sep): r""" Return the offsets of the tokens...
mit
broferek/ansible
lib/ansible/plugins/action/vyos.py
3
3426
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
althalus/knotcrafters
knotdirectory/knotdirectory/knots/models.py
1
2886
from django.db import models from taggit.managers import TaggableManager from django.core.urlresolvers import reverse from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.contrib.auth import get_user_model User = get_user_model() class Knot(models.Mo...
mit
ns950/calibre
src/calibre/utils/fonts/sfnt/common.py
14
7862
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
SebasSBM/django
tests/requests/tests.py
87
34512
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import time from datetime import datetime, timedelta from io import BytesIO from itertools import chain from django.core.exceptions import SuspiciousOperation from django.core.handlers.wsgi import LimitedStream, WSGIRequest from django.http import ( ...
bsd-3-clause
pramasoul/micropython
examples/switch.py
15
1032
""" switch.py ========= Light up some leds when the USR switch on the pyboard is pressed. Example Usage:: Micro Python v1.0.1 on 2014-05-12; PYBv1.0 with STM32F405RG Type "help()" for more information. >>> import switch >>> switch.run_loop() Loop started. Press Ctrl+C to break out of the loop...
mit
7WebPages/django-allauth
allauth/socialaccount/providers/stackexchange/tests.py
71
1518
from allauth.socialaccount.tests import create_oauth2_tests from allauth.tests import MockedResponse from allauth.socialaccount.providers import registry from .provider import StackExchangeProvider class StackExchangeTests(create_oauth2_tests(registry.by_id(StackExchangeProvider.id))): def get_mocked_response(sel...
mit
LogikSim/LogikSimPython
src/debug/pyside_bugs/nonimplemented_virtual_methods.py
1
1739
#!/usr/bin/python # -*- coding: utf-8 -*- """ Copyright 2014 The LogikSim Authors. All rights reserved. Use of this source code is governed by the GNU GPL license that can be found in the LICENSE.txt file. Nonimplemented virtual methods can lead to event handling Problems. Run the script as it is and you will observ...
gpl-3.0
constKutsy/GeoWiki
.compit/lib/python3.6/site-packages/tornado/test/httpclient_test.py
18
27293
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import base64 import binascii from contextlib import closing import copy import functools import sys import threading import datetime from io import BytesIO from tornado.escape import utf8, native_str from tornado import gen from ...
unlicense
Silmathoron/nest-simulator
pynest/examples/spatial/grid_iaf_irr.py
20
1453
# -*- coding: utf-8 -*- # # grid_iaf_irr.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, o...
gpl-2.0
atsaki/ansible-modules-extras
packaging/os/pkg5_publisher.py
78
5662
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014 Peter Oliver <ansible@mavit.org.uk> # # 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 o...
gpl-3.0
britcey/ansible
lib/ansible/modules/network/avi/avi_pool.py
24
18173
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
mexeniz/django-oscar
tests/integration/payment/model_tests.py
40
1412
from decimal import Decimal as D import datetime from django.test import TestCase from oscar.apps.payment.models import Bankcard from oscar.test import factories class TestAPaymentSource(TestCase): def setUp(self): order = factories.create_order() self.source = factories.SourceFactory(order=ord...
bsd-3-clause
DevOps4Networks/ansible
lib/ansible/inventory/group.py
66
4669
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
jdemel/gnuradio
grc/tests/test_yaml_checker.py
3
1458
# Copyright 2016 Free Software Foundation, Inc. # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later # import yaml from grc.core.schema_checker import Validator, BLOCK_SCHEME BLOCK1 = """ id: block_key label: testname parameters: - id: vlen label: Vec Length dtype: int defa...
gpl-3.0
JMMolenaar/cadnano2.5
cadnano/document.py
1
19668
#!/usr/bin/env python # encoding: utf-8 from operator import itemgetter import cadnano.util as util import cadnano.preferences as prefs from cadnano.cnproxy import ProxyObject, ProxySignal from cadnano.cnproxy import UndoStack, UndoCommand from cadnano.strand import Strand from cadnano.oligo import Oligo from cadna...
mit
CrystallineEntity/bulbs
bulbs/views/home.py
1
1916
from pyramid.view import view_config from bulbs.components.subcategory import number_of_threads, number_of_posts, last_post from bulbs.components import db def catinfo(cat): keys = "id", "title", "desc", "slug" keys_values = zip(keys, cat) return dict(keys_values) def categories(): """Return a dict c...
mit
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/end_to_end_ml/solutions/serving/application/lib/werkzeug/local.py
10
14456
# -*- coding: utf-8 -*- """ werkzeug.local ~~~~~~~~~~~~~~ This module implements context-local objects. :copyright: 2007 Pallets :license: BSD-3-Clause """ import copy from functools import update_wrapper from ._compat import implements_bool from ._compat import PY2 from .wsgi import ClosingItera...
apache-2.0
pnedunuri/scikit-learn
sklearn/preprocessing/_function_transformer.py
163
2407
from ..base import BaseEstimator, TransformerMixin from ..utils import check_array def _identity(X): """The identity function. """ return X class FunctionTransformer(BaseEstimator, TransformerMixin): """Constructs a transformer from an arbitrary callable. A FunctionTransformer forwards its X (a...
bsd-3-clause
bluesea/zulip
zerver/management/commands/expunge_logs.py
115
2233
from __future__ import absolute_import import os import sys import datetime import tempfile import traceback import ujson from django.core.management.base import BaseCommand from zerver.retention_policy import should_expunge_from_log now = datetime.datetime.now() def copy_retained_messages(infile, outfile): ...
apache-2.0
Callwoola/tornado
tornado/test/netutil_test.py
88
7164
from __future__ import absolute_import, division, print_function, with_statement import os import signal import socket from subprocess import Popen import sys import time from tornado.netutil import BlockingResolver, ThreadedResolver, is_valid_ip, bind_sockets from tornado.stack_context import ExceptionStackContext f...
apache-2.0
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/network/vyos/vyos_l3_interface.py
8
7039
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
bsd-3-clause
meteorcloudy/tensorflow
tensorflow/contrib/distributions/python/ops/half_normal.py
13
6070
# 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
flagpoonage/strapon
strapon/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/ordered_dict.py
2354
10366
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
gpl-2.0
silkyar/570_Big_Little
tests/quick/se/50.memtest/test.py
90
1633
# Copyright (c) 2006-2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
40223119/2015w13
static/Brython3.1.0-20150301-090019/Lib/sre_compile.py
630
16898
# # Secret Labs' Regular Expression Engine # # convert template to internal format # # Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" import sys import _sre import sre_parse from sre_constan...
gpl-3.0
repotvsupertuga/tvsupertuga.repository
script.module.cryptolib/lib/Crypto/PublicKey/RSA.py
1
2753
#!/usr/bin/env python from __future__ import absolute_import import binascii import struct from rsa import PublicKey, PrivateKey from Crypto.Math.Numbers import Integer def import_key(extern_key, passphrase=None): """Import an RSA key (public or private half), encoded in standard form. :Parameter extern_...
gpl-2.0