text
stringlengths
475
200k
""" ---------------------------------------------------------------------------- Copyright © 2001-2020 Python Software Foundation; All Rights Reserved This file is distributed under the terms of this license: https://docs.python.org/3/license.html -----------------------------------------------------------------...
# 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...
from __future__ import absolute_import # The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # u...
# Copyright (c) 2013 VMware, 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...
try: import unittest2 as unittest except ImportError: import unittest import collections try: from unittest import mock except ImportError: import mock from pymongo.cursor import Cursor from simon import connection, query from simon._compat import range from .utils import AN_OBJECT_ID, ModelFactory...
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2011, Kovid Goyal <[EMAIL]>' __docformat__ = 'restructuredtext en' import os, re, cPickle, traceback from functools import partial from collections import defaultdict from copy import deepcopy from cali...
""" =========================================== Spectral clustering for image segmentation =========================================== In this example, an image with connected circles is generated and spectral clustering is used to separate the circles. In these settings, the :ref:`spectral_clustering` approach solve...
#---------------------------------------------------------------------- # Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA # and Andrew Kuchling. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following c...
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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 t...
# -*- coding: utf-8 -*- # Copyright (C) 2015 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in th...
# Copyright 2014 - Red Hat, 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 ag...
import sys import os file_path = os.path.abspath(__file__) dir_path = os.path.dirname(file_path) lib_path = os.path.join(dir_path, "lib") sys.path.insert(0, lib_path) import pymongo # connnecto to the db on standard port connection = pymongo.MongoClient("mongodb://localhost") db = connection.students ...
#!/usr/bin/python """ takes templated file .xxx.src and produces .xxx file where .xxx is .i or .c or .h, using the following template rules /**begin repeat -- on a line by itself marks the start of a repeated code segment /**end repeat**/ -- on a line by itself marks it's end After the /**begin ...
from __future__ import unicode_literals from datetime import date from django.test import ignore_warnings, override_settings from django.utils.deprecation import RemovedInDjango110Warning from .base import SitemapTestsBase @override_settings(ROOT_URLCONF='sitemaps_tests.urls.https') class HTTPSSitemapTests(Sitemap...
# Copyright 2016 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 law or ag...
"""Implements (a subset of) Sun XDR -- eXternal Data Representation. See: RFC 1014 """ import struct try: from cStringIO import StringIO as _StringIO except ImportError: from StringIO import StringIO as _StringIO __all__ = ["Error", "Packer", "Unpacker", "ConversionError"] # exceptions class Error(Exceptio...
# Copyright (c) 2012-2014 The GPy authors (see AUTHORS.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np from scipy import stats, special from . import link_functions from .likelihood import Likelihood from .gaussian import Gaussian from ..core.parameterization import Param from param...
#!/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. """ Verify that building an object file correctly depends on running actions in dependent targets, but not the targets themselves. """ impo...
# Copyright (C) 2006, 2008-2011 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is dist...
# -*- coding: utf-8 -*- #---------------------------------------------------------------------------- # A timing and scheduling module for modRana. #---------------------------------------------------------------------------- # Copyright 2007, Oliver White # # This program is free software: you can redistribute it and/...
#! /usr/bin/env python # Copyright (c) 2011 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementatio...
from setuptools.command.easy_install import easy_install from distutils.util import convert_path from pkg_resources import Distribution, PathMetadata, normalize_path from distutils import log from distutils.errors import * import sys, os, setuptools, glob class develop(easy_install): """Set up package for developm...
# -*- encoding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier # Copyright Camptocamp SA 2011 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can red...
# -*- coding: utf-8 -*- import re from ..internal.SimpleCrypter import SimpleCrypter class CryptCat(SimpleCrypter): __name__ = "CryptCat" __type__ = "crypter" __version__ = "0.04" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?crypt\.cat/\w+' __config__ = [("activated", "bool", "...
#squid.py Library import RPi.GPIO as GPIO import time WHITE = (30, 30, 30) OFF = (0, 0, 0) RED = (100, 0, 0) GREEN = (0, 100, 0) BLUE = (0, 0, 100) YELLOW = (50, 50, 0) PURPLE = (50, 0, 50) CYAN = (0, 50, 50) class Squid: RED_PIN = 0 GREEN_PIN = 0 BLUE_PIN = 0 red_pwm = 0 green_pwm = 0 blu...
#!/usr/bin/env python # # Copyright 2011, 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...
#!/usr/bin/env python # (c) 2012, Michael DeHaan <[EMAIL]> # # This file is part of the Ansible Documentation # # 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 # (...
from .. import NextGenInstanceResource, NextGenListResource class Voice(object): """Holds references to the Voice pricing resources.""" name = "Voice" key = "voice" def __init__(self, base_uri, auth, timeout): self.uri = "%s/Voice" % base_uri self.countries = VoiceCountries(self.uri,...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import oscar.models.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = ...
""" <Started> July 2013 <Author> Savvas Savvides <[EMAIL]> <Purpose> Acts as the parent for all parsers. Defines some abstract methods required by all parsers and some helper methods that can be used by any parser. """ import pickle class Parser(): def __init__(self, trace_path): """ ...
from __future__ import print_function, division from sympy.core import Mul, sympify from sympy.strategies import unpack, flatten, condition, exhaust, do_one from sympy.matrices.expressions.matexpr import MatrixExpr, ShapeError def hadamard_product(*matrices): """ Return the elementwise (aka Hadamard) product...
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Modifications: # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Parser driver. This provides a high-level interface to parse a file into a synta...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2007 Donald N. Allingham # Copyright (C) 2011 Tim G L Lyons # # 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 ve...
##################################################################################### # # Copyright (C) Tavendo GmbH # # Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you # have purchased a commercial license), the license terms below apply. # # Should you enter into a separate licen...
import matplotlib as mpl mpl.use('Agg') from matplotlib import pyplot as plt import argparse import mxnet as mx from mxnet import gluon from mxnet.gluon import nn from mxnet import autograd import numpy as np import logging from datetime import datetime import os import time def fill_buf(buf, i, img, shape): n = ...
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division import numpy as np import random import first import normal import th...
""" This page is in the table of contents. Coil is a script to coil wire or filament around an object. ==Operation== The default 'Activate Coil' checkbox is on. When it is on, the functions described below will work, when it is off, the functions will not be called. ==Settings== ===Minimum Tool Distance=== Default i...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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.mozilla.org/MPL/ # # Softwa...
from __future__ import absolute_import, unicode_literals import os import mock import tornado.testing import tornado.web import tornado.websocket import mopidy from mopidy.http import handlers class StaticFileHandlerTest(tornado.testing.AsyncHTTPTestCase): def get_app(self): return tornado.web.Applic...
""" ======================== Random Number Generation ======================== ==================== ========================================================= Utility functions ============================================================================== random Uniformly distributed values of a given sha...
""" .. _tut-head-pos: ================================================ Extracting and visualizing subject head movement ================================================ Continuous head movement can be encoded during MEG recordings by use of HPI coils that continuously emit sinusoidal signals. These signals can then b...
import os import re from webob import Request, Response from webob import exc from tempita import HTMLTemplate VIEW_TEMPLATE = HTMLTemplate("""\ <html> <head> <title>{{page.title}}</title> </head> <body> <h1>{{page.title}}</h1> {{if message}} <div style="background-color: #99f">{{message}}</div> {{endif}} <div>{...
# # 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...
from __future__ import absolute_import from django.conf import settings import logging import traceback import platform from django.core import mail from django.http import HttpRequest from django.utils.log import AdminEmailHandler from django.views.debug import ExceptionReporter, get_exception_reporter_filter from...
import unittest as real_unittest from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models import get_app, get_apps from django.test import _doctest as doctest from django.test.utils import setup_test_environment, teardown_test_environment from django.test.testcases...
#!/usr/bin/env python # encoding: utf-8 """ gtest is a Waf tool for test builds in Ardupilot """ from waflib import Utils from waflib.Configure import conf import boards def configure(cfg): cfg.env.HAS_GTEST = False if cfg.options.disable_tests: return board = cfg.get_board() if isinstance(...
# These are some strings that we need for successful extraction. They come from # Django and is not included in our POT file otherwise. This file itself is not # used for a running Pootle. # Don't change any of these strings unless they changed in Django. The adding # of extra comments to help translators is fine. _(...
# Copyright (c) 2009 Bea Lam. All rights reserved. # # This file is part of LightBlue. # # LightBlue 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...
""" Support for MQTT Template lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.mqtt_template/ """ import logging import voluptuous as vol import homeassistant.components.mqtt as mqtt from homeassistant.components.light import ( ATTR_BRI...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2017-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Add new columns on SessionActivity.""" import sqlalchemy as sa from alembic impor...
# # Copyright 2008 Google Inc. All Rights Reserved. """ The acl module contains the objects and methods used to manage ACLs in Autotest. The valid actions are: add: adds acl(s), or users or hosts to an ACL remove: deletes acl(s), or users or hosts from an ACL list: lists acl(s) The common options are: --...
#!/usr/bin/env python # # Copyright 2016 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 requir...
import tensorflow as tf def get_width_upright(bboxes): with tf.name_scope('BoundingBoxTransform/get_width_upright'): bboxes = tf.cast(bboxes, tf.float32) x1, y1, x2, y2 = tf.split(bboxes, 4, axis=1) width = x2 - x1 + 1. height = y2 - y1 + 1. # Calculate up right point of b...
# # Copyright (C) 2017 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 ver...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns() last_col = len(col...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/python # wbx.py - dump MikroTik winbox addresses.wbx file format # Mon Oct 13 10:03:26 SAST 2008 import sys def munge_pair(pair): """ Convert integer values to integers """ name, value, offset = pair if name in ['secure-mode', 'keep-pwd']: value = ord(value) return (name, value, off...
# sympy/galgebra/debug.py from __future__ import print_function from itertools import islice def ostr(obj, dict_mode=False): """ Recursively convert iterated object (list/tuple/dict/set) to string. """ def ostr_rec(obj, dict_mode): global ostr_s if isinstance(obj, tuple): ...
# 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 unittest from memory_inspector.classification import mmap_classifier from memory_inspector.core import memory_map _TEST_RULES = """ [ { 'name': '...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2006 Google Inc. # Copyright (C) 2009 Umeå University # # 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.apa...
# BEGIN_COPYRIGHT # # Copyright 2009-2021 CRS4. # # 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 ...
# coding=utf-8 # Copyright 2019 The SEED Authors # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
# # This file is part of the LibreOffice project. # # 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/. # # This file incorporates work covered by the following license noti...
#encoding=utf-8 import os, zipfile, sys BASEDIR = os.path.split(os.path.abspath(__file__))[0] class UpgradeEnv(object): def __init__(self, basedir): self.basedir = basedir def upgradeFromZip(self, filename): with zipfile.ZipFile(filename) as fs: try: with fs.open('...
import numpy def vl_xyz2lab(I,il='E'): # VL_XYZ2LAB Convert XYZ color space to LAB # J = VL_XYZ2LAB(I) converts the image from XYZ format to LAB format. # # VL_XYZ2LAB(I,IL) uses one of the illuminants A, B, C, E, D50, D55, # D65, D75, D93. The default illuminant is E. # # See also:: VL_XYZ2LUV(), VL_HELP(). ...
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/python # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1'} DOCUMENTATION = ''' --- modul...
# 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...
# Copyright 2017, 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 agreed to in writing, ...
"""A Python 3 script to write a file with a specified number of keypairs, using bigchaindb.crypto.generate_key_pair() The written file is always named keypairs.py and it should be interpreted as a Python 2 script. Usage: $ python3 write_keypairs_file.py num_pairs Using the list in other Python scripts: # in a...
import numpy as np def windowed_sum_slow(arrays, span, t=None, indices=None, tpowers=0, period=None, subtract_mid=False): """Compute the windowed sum of the given arrays. This is a slow function, used primarily for testing and validation of the faster version of ``windowed_sum()`` ...
#!/usr/bin/env python # coding=utf-8 # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of c...
#!/usr/bin/env python #enchoding: utf8 import sys, rospy, math from pimouse_ros_2.msg import MotorFreqs from geometry_msgs.msg import Twist from std_srvs.srv import Trigger, TriggerResponse class Motor(): def __init__(self): if not self.set_power(False): sys.exit(1) rospy.on_shutdown(self.set_power) sel...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
"""Configuration manager for reading and writing SC configuration files.""" import simplejson as json import os import rdflib __author__ = 'cwilli34' # noinspection PyBroadException,PyBroadException class ConfigManager(object): """ Configuration File Creator """ def __init__(self, filename='sc.config'): ...
# -*- coding: utf-8 -*- """ flask.blueprints ~~~~~~~~~~~~~~~~ Blueprints are the recommended way to implement larger or more pluggable applications in Flask 0.7 and later. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import update_wrap...
"""Test file for syntax highlighting of editors. Meant to cover a wide range of different types of statements and expressions. Not necessarily sensical or comprehensive (assume that if one exception is highlighted that all are, for instance). Extraneous trailing whitespace can't be tested because of svn pre-commit ho...
#!/usr/bin/env python # -*- coding: utf-8 -*- # test tokengroups attribute against internal token calculation import optparse import sys import os sys.path.insert(0, "bin/python") import samba from samba.tests.subunitrun import SubunitOptions, TestProgram import samba.getopt as options from samba.auth import syste...
import os import sys import shutil import string import random import tempfile import unittest from imp import cache_from_source from test.support import run_unittest class TestImport(unittest.TestCase): def __init__(self, *args, **kw): self.package_name = 'PACKAGE_' while self.package_name in sy...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ========================================================================= Program: Visualization Toolkit Module: TestNamedColorsIntegration.py Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www....
""" "Rel objects" for related fields. "Rel objects" (for lack of a better name) carry information about the relation modeled by a related field and provide some utility functions. They're stored in the ``remote_field`` attribute of the field. They also act as reverse fields for the purposes of the Meta API because th...
# 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. """Chrome-specific options for configuring a ChromeDriver instance.""" import base64 class ChromeOptions(object): """Chrome-specific options for con...
#!/usr/bin/env python # # Copyright (c) 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. import collections import copy import json import os import pipes import re import subprocess import sys import bb_utils sys.pa...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # # 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. ...
from __future__ import division, absolute_import, print_function import sys import gzip import os import threading from tempfile import NamedTemporaryFile import time import warnings import gc from io import BytesIO from datetime import datetime import numpy as np import numpy.ma as ma from numpy.lib._iotools import ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os, unittest, shutil import zipfile from StringIO import StringIO from cuddlefish import initializer from cuddlef...
from __future__ import absolute_import, print_function import pprint from mercurial import ( minirst, ) def debugformat(text, form, **kwargs): if form == 'html': print("html format:") out = minirst.format(text, style=form, **kwargs) else: print("%d column format:" % form) ou...
# Status: ported # Base revision: 64432. # Copyright 2005-2010 Vladimir Prus. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Defines main target 'cast', used to change type for target. For example, in Qt # libra...
""" Wrapper to the Yahoo's new PlaceFinder API. (doc says that the API RELEASE 1.0 (22 JUNE 2010)) """ import xml.dom.minidom from geopy import util from geopy import Point from urllib import urlencode from urllib2 import urlopen from geopy.geocoders.base import Geocoder try: import json except ImportError: try...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited SPDX-License-Identifier: Apache-2.0 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 ...
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import os import shutil from setuptools.extern import six from setuptools import Command class rotate(Command): """Delete older distributions""" description = "delete older distributions, kee...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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 requ...
''' topology_helpers_unittest.py ''' # pylint: disable=missing-docstring import unittest2 as unittest from heron.common.src.python import constants from heron.tools.tracker.src.python import topology_helpers from mock_proto import MockProto class TopologyHelpersTest(unittest.TestCase): def setUp(self): self.moc...
# hesapmak1 print("\nSürüm kontrolü yapıldı, 3.X sürümü kullanılıyor\n") karşılama = open("karşılama.txt","r") print("\n",karşılama.read()) karşılama.close() def kimlik(): #KİMLİK FONKSİYONU print("1.) Merhabalar Yeni Kullanıcı Detaylı Kimlik Kartını Oluşturmak\n\ ister misin? Evet için 'E', Hayır içi...
# Copyright (C) 2001,2002 Python Software Foundation # Author: [EMAIL] (Barry Warsaw) """Class representing message/* MIME documents. """ from email import Message from email.MIMENonMultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class representing message/* MIME documents.""" d...
""" Selectors tests, specific for libxml2 backend """ import unittest from scrapy.http import TextResponse, HtmlResponse, XmlResponse from scrapy.selector.libxml2sel import XmlXPathSelector, HtmlXPathSelector, \ XPathSelector from scrapy.selector.document import Libxml2Document from scrapy.utils.test import libxm...
"""Core implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing ver...