gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" Support for installing and building the "wheel" binary package format. """ from __future__ import absolute_import import compileall import csv import errno import functools import hashlib import logging import os import os.path import re import shutil import stat import sys import tempfile import warnings from ba...
# coding: utf-8 """ Wavefront REST API Documentation <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W...
# # This source file is part of appleseed. # Visit https://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2016-2019 Esteban Tovagliari, The appleseedhq Organization # # Permission is hereby granted, free of charge, to any person obtaini...
""" Attempt to implement a reactive system in Python. With that I mean a system in which signals are bound implicitly, as in Shiny. The Signal is the core element here. It is like the Property in HasProps. A function can easily be turned into a Signal object by decorating it. Other than Properties, signals have a fun...
''' Created on 1 Feb 2013 @author: Kieran Finn ''' import pylab as p import urllib2 import sys import json from glob import glob import pickle from functions import * from random import random from collections import defaultdict import webbrowser import os #folder='D:/Documents/Planet_hunters/results/01_Feb_2013_11_1...
# # FitsImageCanvasTypesGtk.py -- drawing classes for FitsImageCanvas widget # # Eric Jeschke ([email protected]) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. import math import gtk, re import cairo f...
"""Contains AssetManager, AssetLoader, and Asset parent classes""" # assets.py # Mission Pinball Framework # Written by Brian Madden & Gabe Knuth # Released under the MIT License. (See license info at the end of this file.) # Documentation and more info at http://missionpinball.com/mpf import logging import os import...
import glob import sys import os import sphinx_bootstrap_theme import skbio # NOTE: parts of this file were taken from scipy's doc/source/conf.py. See # scikit-bio/licenses/scipy.txt for scipy's license. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.p...
# 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...
""" Mike Eller UVML July 2017 """ import os import matplotlib.pyplot as plt import numpy as np import csv from statsmodels.nonparametric.smoothers_lowess import lowess from shutil import copyfile plt.style.use('bmh') # helper function to print polynomial fit def print_polynomial(p): s = '$' for coef in rang...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # coding=utf-8 # Copyright (c) 2011-2013 University of Southern California / ISI # 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 ...
BASE = 9 BLOCK_HEIGHT = 3 BLOCK_WIDTH = 3 field = [ [1, 2, 3, 4, 5, 6, 7, 8, 9], [4, 5, 6, 7, 8, 9, 1, 2, 3], [7, 8, 9, 1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7, 8, 9, 1], [5, 6, 7, 8, 9, 1, 2, 3, 4], [8, 9, 1, 2, 3, 4, 5, 6, 7], [3, 4, 5, 6, 7, 8, 9, 1, 2], [6, 7, 8, 9, 1, 2, 3, 4, 5], [9, 1, 2, 3, 4, 5, 6, 7, 8] ] def ...
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
import numpy as np from numba import jit, njit, errors from numba.extending import register_jitable from numba.tests import usecases import unittest X = np.arange(10) def global_ndarray_func(x): y = x + X.shape[0] return y # Create complex array with real and imaginary parts of distinct value cplx_X = np.a...
# Copyright 2013 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 ...
""" scaling images """ from __future__ import print_function, unicode_literals, absolute_import, division import logging logger = logging.getLogger(__name__) import os import numpy as np import warnings from gputools import OCLArray, OCLImage, OCLProgram from gputools.core.ocltypes import cl_buffer_datatype_dict fr...
""" terminal reporting of the full testing process. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import os import sys import textwrap import pluggy import py import pytest from _pytest.main import EXIT_NOTESTSCOLLECTED from _pytes...
from django.conf import settings from django.db import connection, router, transaction from django.db.backends import util from django.db.models import signals, get_model from django.db.models.fields import (AutoField, Field, IntegerField, PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist) from dja...
# -*- coding: utf-8 -*- # # Copyright (c) 2010, Monash e-Research Centre # (Monash University, Australia) # Copyright (c) 2010, VeRSI Consortium # (Victorian eResearch Strategic Initiative, Australia) # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are per...
"""Kernel Principal Components Analysis""" # Author: Mathieu Blondel <[email protected]> # License: BSD 3 clause import numpy as np from scipy import linalg from ..base import BaseEstimator, TransformerMixin from ..exceptions import NotFittedError from ..metrics.pairwise import pairwise_kernels from ..preprocessi...
"""Define a config flow manager for AirVisual.""" import asyncio from pyairvisual import CloudAPI, NodeSamba from pyairvisual.errors import ( AirVisualError, InvalidKeyError, NodeProError, NotFoundError, ) import voluptuous as vol from homeassistant import config_entries from homeassistant.const impor...
# 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...
import datetime import sys import logging from collections import Counter from pyevolve import GSimpleGA from pyevolve.G1DList import G1DList from pyevolve.Initializators import G1DBinaryStringInitializator t = datetime.time log = logging.getLogger(__name__) class Activity: ALL = {} def __init__(self, na...
import os from distill.sessions import UnencryptedLocalSessionStorage try: import testtools as unittest except ImportError: import unittest import json from distill.decorators import before, after from distill.exceptions import HTTPNotFound, HTTPBadRequest, HTTPErrorResponse, HTTPInternalServerError from disti...
# 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 2020 gRPC 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 agreed to in writing...
import pylab as pyl from astLib import astStats from sklearn.metrics import median_absolute_error, mean_squared_error import h5py as hdf from matplotlib.ticker import AutoMinorLocator def calc_err(pred, true): return (pred - true) / true golden_mean = (pyl.sqrt(5.) - 1.0) / 2.0 f = pyl.figure(1, figsize=(10, 1...
import logging from datetime import datetime from typing import Any, Dict, List, Optional, Tuple from urllib.parse import urljoin from django.http import HttpRequest, HttpResponse from zerver.decorator import webhook_view from zerver.lib.exceptions import UnsupportedWebhookEventType from zerver.lib.request import REQ...
# Copyright 2011 Andrew Bogott for the Wikimedia 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-...
#!/usr/bin/env python # # Copyright 2010 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 require...
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Calculate what workon packages have changed since the last build. A workon package is treated as changed if any of the below are true: 1) The pa...
# program template for Spaceship import simplegui import math import random # globals for user interface WIDTH = 800 HEIGHT = 600 score = 0 lives = 3 time = 0.5 class ImageInfo: def __init__(self, center, size, radius = 0, lifespan = None, animated = False): self.center = center self.size = size ...
# Copyright 2010 Jacob Kaplan-Moss # Copyright 2011 OpenStack Foundation # Copyright 2013 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 ...
"""Test spherical harmonic models and the tools associated with those models""" import numpy as np import numpy.linalg as npl from nose.tools import assert_equal, assert_raises, assert_true from numpy.testing import assert_array_equal, assert_array_almost_equal import numpy.testing as npt from scipy.special import sph...
import mock import os import unittest import testutils from bin.commands import settings class TestSettings(unittest.TestCase): @mock.patch('bin.commands.utils.directories.is_git_repository') @mock.patch('bin.commands.utils.messages.error') def test__validateConfig_valid_notLocal(self, mock_error, mock_...
import curses from curses import cbreak, echo, endwin, initscr, nocbreak, noecho import logging from os import chdir, environ, getcwd from subprocess import check_output, CalledProcessError, Popen, PIPE from time import sleep from threading import Thread from queue import Queue class History: def __init__(self):...
"""Tests for 1-Wire config flow.""" from unittest.mock import patch from pyownet import protocol from homeassistant.components.onewire.const import ( CONF_MOUNT_DIR, CONF_TYPE_OWSERVER, CONF_TYPE_SYSBUS, DEFAULT_SYSBUS_MOUNT_DIR, DOMAIN, ) from homeassistant.config_entries import SOURCE_USER from ...
# 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 agreed to in writing, ...
""" MP4 Parser based on: http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf @author: Alastair McCormack @license: MIT License """ import bitstring from datetime import datetime from collections import namedtuple import logging import six log = logging.getLogger(__name__) #log.addHandler(logging.Nu...
# This file is part of the bapsflib package, a Python toolkit for the # BaPSF group at UCLA. # # http://plasma.physics.ucla.edu/ # # Copyright 2017-2018 Erik T. Everson and contributors # # License: Standard 3-clause BSD; see "LICENSES/LICENSE.txt" for full # license terms and contributor agreement. # """ Module cont...
# Copyright (C) 2015-2021 Regents of the University of California # # 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 app...
# -*- coding: utf-8 -*- """Module containing various line searches. Line searches are at the heart of many optimizers. After finding a suitable search direction (e.g. the steepest descent direction) we are left with a one-dimensional optimization problem, which can then be solved by a line search. """ # TODO: this m...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nicira Networks, 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.apach...
# Poloniex API wrapper tested on Python 2.7.6 & 3.4.3 # https://github.com/s4w3d0ff/python-poloniex # BTC: 1A7K4kgXLSSzvDRjvoGwomvhrNU4CKezEp # TODO: # [x] PEP8ish # [ ] Add better logger access # [x] Improve logging output # [ ] Add Push Api application wrapper # # Copyright (C) 2016 https://github.com/s4w...
from __future__ import print_function import itertools import numba.unittest_support as unittest from numba.controlflow import CFGraph, ControlFlowAnalysis from numba.compiler import compile_isolated, Flags from numba import types, errors from numba.bytecode import FunctionIdentity, ByteCode from numba.utils import I...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of commands, run ``$ invoke --list``. """ import os import sys import json import platform import subprocess import logging import sqlite3 import invoke from invoke import Collection from website i...
#!/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")...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Train an Auxiliary Classifier Generative Adversarial Network (ACGAN) on the MNIST dataset. See https://arxiv.org/abs/1610.09585 for more details. You should start to see reasonable images after ~5 epochs, and good images by ~15 epochs. You should use a GPU, as the conv...
from __future__ import unicode_literals import re from django.template import Library from django.template.loader import get_template from django.utils import six from django.utils.encoding import force_text try: from django.template.base import TemplateDoesNotExist except ImportError: from django.template.exc...
import mock import libvirt import difflib import unittest from see.context.resources import lxc def compare(text1, text2): """Utility function for comparing text and returining differences.""" diff = difflib.ndiff(text1.splitlines(True), text2.splitlines(True)) return '\n' + '\n'.join(diff) class Domai...
import asyncio from aiohttp import web from aiohttp.web_exceptions import HTTPBadRequest, HTTPNoContent import virtool.http.routes import virtool.otus.db import virtool.otus.isolates import virtool.otus.sequences import virtool.references.db import virtool.validators from virtool.api.response import InsufficientRight...
from datetime import datetime import operator import os import re import string import random from django import template from django.conf import settings from django.template import Template from django.template.loader import render_to_string from django.template.defaultfilters import truncatewords_html, stringfilter...
# 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...
import datetime import mock from rdr_service import clock from rdr_service.dao.genomics_dao import GenomicSetDao, GenomicSetMemberDao from rdr_service.dao.participant_dao import ParticipantDao from rdr_service.dao.participant_summary_dao import ParticipantSummaryDao from rdr_service.genomic.validation import validate...
""" block56.py class Sprite Block Arrow Warp function buildUserBlocks wipe """ import pygame import interface56 import scroller56 import dinosInSpace import radar56 import soundFx56 import math import bounceMask class Block(pygame.sprite.Sp...
import json import os import tempfile from django.contrib.auth.models import User from django.template.defaultfilters import slugify from django.test import ( TestCase as BaseTestCase, Client as BaseClient ) import factory from django_nose.tools import assert_equal from factory import LazyAttribute, Sequence,...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
from util import * from google.protobuf import text_format import convnet_config_pb2 def ChooseEdge(edge_proto): if edge_proto.edge_type == convnet_config_pb2.Edge.CONVOLUTIONAL: return ConvEdge(edge_proto) elif edge_proto.edge_type == convnet_config_pb2.Edge.CONV_ONETOONE: return ConvOneToOneEdge(edge_pro...
# subprocess - Subprocesses with accessible I/O streams # # For more information about this module, see PEP 324. # # This module should remain compatible with Python 2.2, see PEP 291. # # Copyright (c) 2003-2005 by Peter Astrand <[email protected]> # # Licensed to PSF under a Contributor Agreement. # See http://ww...
__doc__="""An experimental SVG renderer for the ReportLab graphics framework. This will create SVG code from the ReportLab Graphics API (RLG). To read existing SVG code and convert it into ReportLab graphics objects download the svglib module here: http://python.net/~gherman/#svglib """ import math, string, types,...
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/python # # Copyright (C) 2007 SIOS Technology, 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 appli...
# Copyright (C) 2001 Python Software Foundation # Author: [email protected] (Barry Warsaw) """Classes to generate plain text from a message object tree. """ import time import re import random from types import ListType, StringType from cStringIO import StringIO # Intrapackage imports import Message import Errors EMP...
"""Support for displaying weather info from Ecobee API.""" from datetime import datetime from pyecobee.const import ECOBEE_STATE_UNKNOWN from homeassistant.components.weather import ( ATTR_FORECAST_CONDITION, ATTR_FORECAST_TEMP, ATTR_FORECAST_TEMP_LOW, ATTR_FORECAST_TIME, ATTR_FORECAST_WIND_BEARIN...
__author__ = "Andre Merzky, Ashley Z, Ole Weidner" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" # TODO: Create function to check for all the iRODS error codes and give # a better error readout? # TODO: Look into feasibility of having this access remote resources # if ...
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
from util import memoize, run_search_function from util import INFINITY import time ######################################## ########## SUMMARY OF CHANGES ########## ######################################## # # basic_evaluate has been modified to return # -INFINITY instead of -1000 to make it consistent # with the oth...
#!/usr/bin/env python __author__ = 'waroquiers' import unittest from pymatgen.analysis.chemenv.utils.coordination_geometry_utils import Plane import numpy as np import itertools from pymatgen.util.testing import PymatgenTest class PlanesUtilsTest(PymatgenTest): def setUp(self): #Test of plane 4x + 2y -...
# -*- coding: utf-8 -*- # 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 require...
#!/usr/bin/env python """A vtctld webdriver test.""" import logging import os from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from selenium.common.exceptions import NoSuchElementException import unittest f...
# -*- coding: utf-8 -*- """ S3 Synchronization @copyright: 2011-13 (c) Sahana Software Foundation @license: MIT 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 re...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
#!/usr/bin/python # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the ab...
import json from datetime import datetime, timedelta from django.conf import settings from django.core.cache import cache from django.core.urlresolvers import reverse import mock from cache_nuggets.lib import Token from nose.tools import eq_, ok_ from test_utils import RequestFactory import amo import mkt.regions fr...
# -*- coding: utf-8 -*- ''' Manage glusterfs pool. ''' # Import python libs from __future__ import generators from __future__ import absolute_import import logging import socket # Import salt libs import salt.utils.cloud as suc from salt.exceptions import SaltCloudException log = logging.getLogger(__name__) RESULT_...
#------------------------------------------------------------------------------ # Copyright 2014 Esri # 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/LICEN...
####################################################################### # This file is part of Pyblosxom. # # Copyright (C) 2003-2011 by the Pyblosxom team. See AUTHORS. # # Pyblosxom is distributed under the MIT license. See the file # LICENSE for distribution details. ###############################################...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
# Copyright 2011 Fluidinfo 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, ...
# -*- coding: utf-8 -*- import json import unittest import urlparse from pale import Endpoint from pale.arguments import (BaseArgument, BooleanArgument, JsonDictArgument, FloatArgument, IntegerArgument, ListArgument, ScopeArgument, StringArgument, StringListArgument, URLArgument) from pale.errors impor...
""" It usually takes about 29,180 seconds (8 hours). """ import os import math import copy import cPickle as pickle import numpy as np from data import model from sklearn import mixture def discretize_elems_in_list(df, l, key): """ It converts categorical values to integer values, so you need to care whe...
# encoding: utf-8 """ Objects related to mouse click and hover actions on a shape or text. """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) from .enum.action import PP_ACTION from .opc.constants import RELATIONSHIP_TYPE as RT from .shapes import Subshape from .util impor...
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
#!/usr/bin/python # Copyright 2016 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. ''' This script provides tools to map BattOrs to phones. Phones are identified by the following string: "Phone serial number" - Serial n...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
# Copyright 2015 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...
# Copyright 2013-2016 DataStax, 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 writi...
import urllib.request from bs4 import BeautifulSoup from time import sleep, time import pickle import queue import threading import math HYPER_EXPANSION_LIMIT = 2 # How many levels of links is it allowed to follow HYPER_DEFAULT_LINK = "https://en.wikipedia.org/wiki/Vitamin_A" HYPER_DEFAULT_SEARCH = "Vitamin A" HYPER_D...
# -*- coding: utf-8 -*- # # Copyright (C)2005-2010 Edgewall Software # Copyright (C) 2005 Christopher Lenz <[email protected]> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.e...
import os from collections import namedtuple from collections.abc import Sequence from urllib.parse import urlparse, urlunparse import ipaddress import markdown from mkdocs import utils, theme, plugins from mkdocs.config.base import Config, ValidationError class BaseConfigOption: def __init__(self): sel...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base...
# Copyright 2018 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...
# test_multibytecodec_support.py # Common Unittest Routines for CJK codecs # import codecs import os import re import sys import unittest from httplib import HTTPException from test import test_support from StringIO import StringIO class TestBase: encoding = '' # codec name codec = None #...
""" Note: ntlm3 was obtained from here: https://github.com/trustrachel/python-ntlm3 """ import datetime import urllib2 from urlparse import urlparse, urlunparse try: import arcpy arcpyFound = True except: arcpyFound = False try: from ntlm3 import HTTPNtlmAuthHandler hasNTLM = True except: hasNT...
""" Tools for working with streams. """ from collections import deque from zlib import decompressobj from zlib import MAX_WBITS __all__ = ("BufferedIStream", "FilteredIStream", "FilteredOStream", "GzippedIStream") class _StreamAdaptor(object): """ Abstract base class for a stream adaptor. ""...
from __future__ import print_function from __future__ import absolute_import from builtins import next from builtins import str from builtins import range from past.builtins import basestring import tensorflow as tf import numpy as np import os import shutil import time from .layers import * from .classes import * f...
#!/usr/bin/python3 # # Copyright (C) 2010, 2011, 2012 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright notice, #...
#!/usr/bin/python2 """ dynamicEndpoints.py: make cjdns reliably connect to remote nodes with dynamic IP addresses, identified by a DNS name. Requires a config file with a section for each dynamic-IP node, like this: [lhjs0njqtvh1z4p2922bbyp2mksmyzf5lb63kvs3ppy78y1dj130.k] hostname: verge.info.tm port: 632...
""" Helper functions for writing to terminals and files. """ import sys, os, unicodedata import py py3k = sys.version_info[0] >= 3 py33 = sys.version_info >= (3, 3) from py.builtin import text, bytes win32_and_ctypes = False colorama = None if sys.platform == "win32": try: import colorama except Im...
# Copyright 2014 Open Source Robotics Foundation, 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...