text
stringlengths
475
200k
import logging import traceback import threading from contextlib import contextmanager from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ImproperlyConfigured from sleekxmpp import ClientXMPP from sleekxmpp.exceptions import IqError, IqTimeout from sleekxmp...
from axolotl.state.axolotlstore import AxolotlStore from .liteidentitykeystore import LiteIdentityKeyStore from .liteprekeystore import LitePreKeyStore from .litesessionstore import LiteSessionStore from .litesignedprekeystore import LiteSignedPreKeyStore from .litesenderkeystore import LiteSenderKeyStore import sqlite...
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os import sys from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand from gunicorn import __version__ CLASSIFIERS = [ 'Development S...
# -*- 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...
from io import open import unittest import re import toc from pelican.readers import MarkdownReader from pelican.contents import Article from pelican.tests.support import get_settings class TestToCGeneration(unittest.TestCase): @classmethod def setUpClass(cls): toc.init_default_config(None) ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime import os from unittest import TestCase from django.utils import html from django.utils._os import upath from django.utils.encoding import force_text class TestUtilsHtml(TestCase): def check_output(self, function, val...
#!/usr/bin/env python import json from boto.cloudtrail.layer1 import CloudTrailConnection from tests.unit import AWSMockServiceTestCase class TestDescribeTrails(AWSMockServiceTestCase): connection_class = CloudTrailConnection def default_body(self): return b''' {"trailList": ...
# Copyright (C) 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 or agreed to in writ...
import pytest from api.base.settings.defaults import API_BASE from framework.auth.core import Auth from api_tests.utils import disconnected_from_listeners from website.project.signals import contributor_removed from osf_tests.factories import ( NodeFactory, AuthUserFactory, RegistrationFactory ) @pytest....
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apac...
# -*- coding: utf-8 -*- import os dataPath = "/Users/alasarr/dev/Medinageoportal/data_tools/data/nador" config = { "path_input": os.path.join(dataPath,"input"), "path_output": os.path.join(dataPath,"output"), "shapepath" : "data/nador", "mapfile_output_prefix":"nador_", "date":"01/01/2006", "layers": [ { "...
"""Test discovery helpers.""" from unittest.mock import patch from homeassistant import setup from homeassistant.core import callback from homeassistant.helpers import discovery from homeassistant.helpers.dispatcher import dispatcher_send from homeassistant.util.async_ import run_callback_threadsafe from tests.common...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Asynchronous VO service requests.""" from __future__ import absolute_import, division, print_function, unicode_literals # LOCAL from ...utils.compat.futures import ThreadPoolExecutor from ...utils.decorators import deprecated __all__ = ['AsyncBase'] ...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function INCLUDES = """ #include <openssl/bio.h> """ TYPES = """ typedef struct b...
# -*- encoding: utf-8 -*- import StringIO import xlsxwriter """ Web app module. """ __author__ = 'Bernardo Martínez Garrido' __license__ = 'MIT' __status__ = 'Development' def generate_match_report_excel(matches, filename): output = StringIO.StringIO() workbook = xlsxwriter.Workbook(output, {'in_memory': ...
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for interrupting tests with Control-C. """ from __future__ import absolute_import, division from twisted.python.compat import NativeStringIO from twisted.trial import unittest from twisted.trial import reporter, runner class TrialTe...
# # 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 us...
#!/usr/bin/env python3 """ NumPy is the fundamental package for array computing with Python. It provides: - a powerful N-dimensional array object - sophisticated (broadcasting) functions - tools for integrating C/C++ and Fortran code - useful linear algebra, Fourier transform, and random number capabilities - and muc...
""" Build swig, f2py, pyrex sources. """ from __future__ import division, absolute_import, print_function import os import re import sys import shlex import copy from distutils.command import build_ext from distutils.dep_util import newer_group, newer from distutils.util import get_platform from distutils.errors impo...
#!/usr/bin/env python ''' Video histogram sample to show live histogram of video Keys: ESC - exit ''' import numpy as np import cv2 # built-in modules import sys # local modules import video if __name__ == '__main__': hsv_map = np.zeros((180, 256, 3), np.uint8) h, s = np.indices(hsv_map.shape[:2]...
# Copyright 2012, Intel, 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 agree...
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# Python imports # Don't add any from __future__ imports here. This code should execute # against standard Python. import unittest import time import os # Project imports import sysv_ipc # Hack -- add tests directory to sys.path so Python 3 can find base.py. import sys sys.path.insert(0, os.path.join(os.getcwd(), 'tes...
# coding: utf-8 from django.conf import settings from journalmanager import models from maintenancewindow import models as maintenance_models def dynamic_template_inheritance(request): """ Changes between base_lv0.html e base_lv1.html """ if request.GET.get('popup', None): return {'dynamic_tpl...
# -*- coding: utf-8 -*- from openerp.addons.website_forum.tests.common import KARMA, TestForumCommon from openerp.addons.website_forum.models.forum import KarmaError from openerp.exceptions import Warning, AccessError from openerp.tools import mute_logger class TestForum(TestForumCommon): @mute_logger('openerp....
# -*- 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...
"""Test the test support.""" from __future__ import absolute_import import filecmp import re from os.path import join, isdir from tests.lib import SRC_DIR def test_tmp_dir_exists_in_env(script): """ Test that $TMPDIR == env.temp_path and path exists and env.assert_no_temp() passes (in fast env) """ ...
from __future__ import unicode_literals import datetime from dateutil.parser import parse from decimal import Decimal import re from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.utils import datetime_safe, importlib from django.utils import six from tastypie.bundle import Bundle...
# Chris Riederer # Google, Inc # 2014-08-15 """Record baselines and show improvements for working on magnet""" import test_detect as t import glob cleanedList = t.GetRunDataFromArgs(glob.glob('cleaned/*.json')) snipList = t.GetRunDataFromArgs(glob.glob('snips/*.json')) decalCleanedList = t.GetRunDataFromArgs(glob....
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2012, Afterburn <http://github.com/afterburn> # (c) 2013, Aaron Bull Schaefer <[EMAIL]> # (c) 2015, Jonathan Lestrelin <[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 Gener...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Pattern compiler. The grammer is taken from PatternGrammar.txt. The compiler compiles a pattern to a pytree.*Pattern instance. """ __author__ = "Guido van Rossum <[EMAIL]>" # Python imports import os import Strin...
# -*- coding: utf-8 -*- """ werkzeug.contrib.limiter ~~~~~~~~~~~~~~~~~~~~~~~~ A middleware that limits incoming data. This works around problems with Trac_ or Django_ because those directly stream into the memory. .. _Trac: http://trac.edgewall.org/ .. _Django: http://www.djangoproject.com/ ...
# Copyright (C) 2014 eNovance SAS <[EMAIL]> # # 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vispy: gallery 2, testskip # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Shadertoy demo. You can copy-paste shader code from an example on www.shadertoy.com and get the demo. TODO: support cub...
""" SALTS XBMC Addon Copyright (C) 2014 tknorris 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. T...
# Copyright (C) 2012 Colin Walters <[EMAIL]> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library i...
import warnings from importlib import import_module from django.core.exceptions import ImproperlyConfigured from django.urls import ( LocaleRegexURLResolver, RegexURLPattern, RegexURLResolver, ) from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning __all__ = ['handler400', 'ha...
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup uses a pluggable XML or HTML parser to parse a (possibly invalid) document into a tree representation. Beautiful Soup provides provides methods and Pythonic idioms that make it easy to navigate...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
# Copyright 2013 Canonical 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/LICENSE-2.0 # # Unless required ...
"""SCons.Tool.javac Tool-specific initialization for javac. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Founda...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
# -*- coding: utf-8 -*- # pyswip -- Python SWI-Prolog bridge # Copyright (c) 2007-2012 Yüce Tekol # # 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 ...
#!/usr/bin/env python3 import re from ruamel import yaml class PrefixedUnit(yaml.YAMLObject): PREFIXES = {'k': 1e3, 'M': 1e6, 'G': 1e9, 'T': 1e13, 'P': 1e16, 'E': 1e19, 'Z': 1e21, 'Y': 1e24, '': 1} yaml_loader = yaml.Loader yaml_dumper = yaml.Dumper yaml_tag = u'!prefixed' yaml_...
import os import sys modeules_path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) sys.path.append(modeules_path) from Devices.application import Application test = os.path.split(os.path.dirname(os.path.abspath(__file__)))[-1] print(test) testintex = 2 testscript = os.path.basename(os.path.abspath(__fil...
r""" Ported using Python-Future from the Python 3.3 standard library. XML-RPC Servers. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCServer class. It can also be used to handle XML-RPC requests in a CGI...
from browser import window def _randint(a, b): return int(window.Math.random()*(b-a+1)+a) def _urandom(n): """urandom(n) -> str Return n random bytes suitable for cryptographic use.""" randbytes= [_randint(0,255) for i in range(n)] return bytes(randbytes) class Random: """Random n...
# -*- 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...
import numpy as np import matplotlib.pyplot as plt from math import sqrt, copysign from scipy.optimize import brenth from scipy.optimize import fsolve,fmin_l_bfgs_b,fmin_cg,fminbound """ sign of the number """ def sign(x): if x==0: return 0 else: return copysign(1,x) """ if function f can't b...
import unittest import os import sys import utils TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) sys.path.insert(0, TOPDIR) try: from python_tools import cpp_format finally: del sys.path[0] from pygments import token # Tokens we'd expect to see in an OK header ok_header_tokens = [ ...
#!/usr/bin/python # -*- coding: utf-8 -*- # 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', 'status': ['preview'], ...
# sbaas from .lims_msMethod_postgresql_models import * from SBaaS_base.postgresql_dataType_converter import postgresql_dataType_converter from SBaaS_base.sbaas_base_query_update import sbaas_base_query_update from SBaaS_base.sbaas_base_query_drop import sbaas_base_query_drop from SBaaS_base.sbaas_base_query_initialize...
# -*- coding: utf-8 -*- import random from openerp import SUPERUSER_ID from openerp.osv import osv, orm, fields from openerp.addons.web.http import request class payment_transaction(orm.Model): _inherit = 'payment.transaction' _columns = { # link with the sale order 'sale_order_id': fields.m...
from django.db.models import Q from django.test import TestCase from .models import Issue, User, UnicodeReferenceModel class RelatedObjectTests(TestCase): def test_m2m_and_m2o(self): r = User.objects.create(username="russell") g = User.objects.create(username="gustav") i1 = Issue(num=1) ...
# 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...
#!/usr/bin/env python # 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 import re import subprocess import sys import BaseHTTPServer import SimpleHTTPServer im...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test context-sensitive Parser registry. """ from unittest import TestCase #logging.basicConfig(level=logging.DEBUG) from sneakylang.register import * from sneakylang.macro import Macro from sneakylang.parser import Parser from sneakylang.treebuilder import TreeBuil...
# Copyright 2015 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 agreed to in writing, s...
"""A server that handles a connection with an OpenBCI board and serves that data over both a UDP socket server and a WebSocket server. Requires: - pyserial - asyncio - websockets """ import argparse import cPickle as pickle import json import sys; sys.path.append('..') # help python find open_bci_v3.py relative...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Extract histogram names from the description XML file. For more information on the format of the XML file, which is self-documenting, see histograms.xml;...
# Copyright 2019 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 (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Platform-specific utility methods shared by several scripts.""" import os import subprocess import google.path_utils class PlatformUtility(object)...
# -*- coding: utf-8 -*- """Utilities for application plugin-system. NOTE: for simplicity, language and runner templates are referred to as plug-ins in this file (along with site plug-ins). """ import imp import os import sys import re import requests from string import Template from difflib import SequenceMatche...
# encoding: utf-8 # 2013 © Václav Šmilauer <[EMAIL]> import unittest from minieigen import * import woo._customConverters import woo.core import woo.dem import woo.utils import math from woo.dem import * class TestShapePack(unittest.TestCase): # def setUp(self): def testLoadSampleTxt(self): 'ShapePack: load sampl...
import string # pylint: disable=W0402 import random from django.contrib.auth.models import User from django.test import TestCase from student.models import CourseEnrollment from django_comment_client.permissions import has_permission from django_comment_common.models import Role class PermissionsTestCase(Test...
""" Tests for class dashboard (Metrics tab in instructor dashboard) """ import json from django.core.urlresolvers import reverse from django.test.client import RequestFactory from mock import patch from nose.plugins.attrib import attr from capa.tests.response_xml_factory import StringResponseXMLFactory from coursewa...
# 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...
# # Copyright 2015 Peter Sprygada <[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...
# 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/. from django.conf import settings from django.core.cache import cache import cronjobs import feedparser from bedrock.mo...
# # Copyright 2012 Markus Pielmeier # # This file is part of tagfs. # # tagfs 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. # # tagfs...
""" This module parse an UPnP device's XML definition in an Object. @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{[EMAIL]<mailto:[EMAIL]>} @version: 0.1.0 """ __revision__ = "$id" from xml.dom import minidom import logging # Allowed UPnP services to use when mapping ports/external a...
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
# -*- 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...
#!/usr/bin/env python """ Usage: find-package.py --repourl=<repo-url> --package=<package-name> [--env|--iam] [--debug] [--filter=<filter>] Attributes: --repourl=<repourl> -r Repository URL eg. https://BUCKET_NAME.s3.amazonaws.com/cent6/ --package=<package-name> -p Package name to search for...
### # Copyright (c) 2005, Daniel DiPaolo # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of condition...
#!/usr/bin/python """ Handler for setting radius on the request. """ ## MIT License ## ## Copyright (c) 2017, krishna bhogaonker ## 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 r...
# 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...
from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections class Command(BaseCommand): help = ("Runs the command-line client for specified database, or the " "default database if none is provided.") requires_system_checks = False def add...
# 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...
# Lazygal, a lazy static web gallery generator. # Copyright (C) 2007-2012 Alexandre Rossi <[EMAIL]> # # 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 yo...
from __future__ import absolute_import from __future__ import division import math from p2pool.util import math as math2 class DataViewDescription(object): def __init__(self, bin_count, total_width): self.bin_count = bin_count self.bin_width = total_width/bin_count def _shift(x, shift, pad_item...
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.db.models import Q from...
#!/usr/bin/env python import sys import time import Queue import traceback import multiprocessing from ansible.inventory import Inventory from ansible.inventory.host import Host from ansible.playbook.play import Play from ansible.playbook.task import Task from ansible.executor.connection_info import ConnectionInforma...
import sys import os sys.path.append(os.path.dirname(os.path.dirname(__file__))) from setuptools import setup from common_setup import common_setup classifiers = [ 'License :: OSI Approved :: MIT License', 'Development Status :: 5 - Production/Stable', 'Topic :: Software Development :: Libraries', 'To...
""" Link extractor based on lxml.html """ import re from six.moves.urllib.parse import urlparse, urljoin import lxml.etree as etree from scrapy.selector import Selector from scrapy.link import Link from scrapy.utils.misc import arg_to_iter from scrapy.utils.python import unique as unique_list, str_to_unicode from sc...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <[EMAIL]> # 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', ...
""" Cross-platform color text printing Based on colorama (see pyqtgraph/util/colorama/README.txt) """ import sys, re from .colorama.winterm import WinTerm, WinColor, WinStyle from .colorama.win32 import windll from ..python2_3 import basestring _WIN = sys.platform.startswith('win') if windll is not None: winterm...
import socket import time import httplib from urllib import urlencode from threading import Lock, Event from django.conf import settings from django.core.cache import cache from graphite.node import LeafNode, BranchNode from graphite.intervals import Interval, IntervalSet from graphite.readers import FetchInProgress fr...
""" Continuous to discrete transformations for state-space and transfer function. """ from __future__ import division, print_function, absolute_import # Author: Jeffrey Armstrong <[EMAIL]> # March 29, 2011 import numpy as np from scipy import linalg from .ltisys import tf2ss, ss2tf, zpk2ss, ss2zpk __all__ = ['cont2...
from datetime import date from django.conf import settings from django.utils import six from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.http import base36_to_int, int_to_base36 class PasswordResetTokenGenerator(object): """ Strategy object used to generate and check token...
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import get_params, try_rm import io import xml.etree.ElementTree import youtu...
import time import random import heapq import itertools import signal choice = random.choice now = time.time count = itertools.count().next pop = heapq.heappop from twisted.internet import defer, task, error from twisted.python import log, failure from contrib.procpools.ampoule import commands, main try: DIE = s...
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
#!/usr/bin/env python # # Licensed to Big Data Genomics (BDG) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The BDG licenses this file # to you under the Apache License, Version 2.0 (the # "License"); yo...
from __future__ import print_function # # 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...
import sqlalchemy as sa from .exc import ClassNotVersioned from .expression_reflector import VersionExpressionReflector from .operation import Operation from .table_builder import TableBuilder from .utils import adapt_columns, version_class, option class RelationshipBuilder(object): def __init__(self, versioning...
from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy import cos, sin, pi from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_almost_equal, assert_allclose, assert_ from scipy.integrate import (quadrature, romberg, romb, newton_cote...