gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
# Function to scan for pseudolandmarks along the x-axis import cv2 import os import numpy as np from plantcv.plantcv import plot_image from plantcv.plantcv import print_image from plantcv.plantcv import params from plantcv.plantcv import outputs from plantcv.plantcv import fatal_error def x_axis_pseudolandmarks(img,...
# Copyright (c) 2015 Thales Services SAS # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
"""Utility meter from sensors providing raw data.""" from datetime import date, timedelta from decimal import Decimal, DecimalException import logging from homeassistant.const import ( ATTR_UNIT_OF_MEASUREMENT, CONF_NAME, EVENT_HOMEASSISTANT_START, STATE_UNAVAILABLE, STATE_UNKNOWN, ) from homeassis...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, print_function import os import sys from contextlib import contextmanager from distutils import sysconfig from site import USER_SITE import pkg_re...
import mimetypes from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth import login, logout, updat...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
"""Support for Tado to create a climate device for each zone.""" import logging from typing import List, Optional from homeassistant.components.climate import ClimateDevice from homeassistant.components.climate.const import ( CURRENT_HVAC_COOL, CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, CURRENT_HVAC_OFF, ...
""" Platform that supports scanning iCloud. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.icloud/ """ import logging import random import os import voluptuous as vol from homeassistant.const import CONF_USERNAME, CONF_PASSWORD from home...
# Copyright (c) 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
# -*- coding: utf-8 -*- """ Public Python API to create CMS contents. WARNING: None of the functions defined in this module checks for permissions. You must implement the necessary permission checks in your own code before calling these methods! """ import datetime from cms.utils.conf import get_cms_setting from djang...
# Copyright 2015 iWeb Technologies Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
''' Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved. Author(s): Norton Luo This test validate the system level function of RackHD image-service. This test include VMware ESXi install and node rediscover.It use image server to store ESXi image and microkernel used for RackHD discovery. You need put a...
# 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...
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList', 'UserString', 'Counter', 'OrderedDict', 'ChainMap'] # For backwards compatibility, continue to make the collections ABCs # available through the collections module. from _collections_abc import * import _collections_abc __all__ += _co...
""" OriginalPostSearcher bot """ import herokuDB import ignoredSubs import praw import time from sqlalchemy import create_engine from sqlalchemy import text REDDIT_CLIENT = praw.Reddit(user_agent="OriginalPostSearcher 2.0.0") REDDIT_CLIENT.login(disable_warning=True) # a list of words that might be an "xpost" X_POST...
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
"""Integration providing core pieces of infrastructure.""" import asyncio import itertools as it import logging import voluptuous as vol from homeassistant.auth.permissions.const import CAT_ENTITIES, POLICY_CONTROL import homeassistant.config as conf_util from homeassistant.const import ( ATTR_ENTITY_ID, ATTR...
"""Support for Insteon Thermostats via ISY994 Platform.""" from __future__ import annotations from pyisy.constants import ( CMD_CLIMATE_FAN_SETTING, CMD_CLIMATE_MODE, PROP_HEAT_COOL_STATE, PROP_HUMIDITY, PROP_SETPOINT_COOL, PROP_SETPOINT_HEAT, PROP_UOM, PROTO_INSTEON, ) from homeassist...
# -*- coding: utf-8 -*- # Copyright 2022 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...
from __future__ import print_function import ipywidgets as widgets from IPython.display import HTML, Javascript, display from string import Template from traitlets import Unicode, Bool, Int # NOT FINISHED. DO NOT USE # https://ace.c9.io/build/kitchen-sink.html js_load = """ <script> requirejs.config({ paths: { ...
from __future__ import absolute_import import sys from six import StringIO from mock import patch from .testcases import DockerClientTestCase from fig.cli.main import TopLevelCommand class CLITestCase(DockerClientTestCase): def setUp(self): super(CLITestCase, self).setUp() self.old_sys_exit = sy...
"""Loads dodo file (a python module) and convert them to 'tasks' """ import os import sys import inspect import importlib from collections import OrderedDict from .exceptions import InvalidTask, InvalidCommand, InvalidDodoFile from .task import DelayedLoader, Task, dict_to_task # Directory path from where doit was ...
import sys import time sys.stdout=sys.stderr import numpy as np import tensorflow as tf from tensorflow.python.client import timeline from language_model import LM from common import CheckpointLoader,print_debug def run_train(dataset, hps, logdir, ps_device, task=0, master=""): with tf.variable_scope("model"): ...
# 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...
# -*- coding: utf-8 -*- #This code is adaped from # https://github.com/dfm/corner.py # git hash 5c2cd63 on May 25 # Modifications by John Baker NASA-GSFC (2016-18) #Copyright (c) 2013-2016 Daniel Foreman-Mackey #All rights reserved. # #Redistribution and use in source and binary forms, with or without #modification, a...
import glob import pandas as pd import numpy as np pd.set_option('display.max_columns', 50) # print all rows import os os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files") normalB = glob.glob("binary_position_RRBS_normal_B_cell*") mcell = glob.glob("binary_position_RRBS_NormalBCD19pCD27...
#bjShuffleStart.py #mcvan #16/Sept/14 from random import * import pygame DECKS = 1 playerHand = [] dealerHand = [] dealerScore = 0 playerScore = 0 doReset = False CARDPOINTS = {'AD': 11, 'AH': 11, 'AC': 11, 'AS': 11, 'KD': 10, 'KH': 10, 'KC': 10, 'KS': 10, 'QD': 10, 'QH': 10, 'QC': 10, 'Q...
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
from __future__ import print_function import os import subprocess import tempfile import shutil import logging from nose.tools import assert_equal, assert_true, assert_false ENVIRONMENT_CORRECT = False try: from dls_ade import vcs_git from dls_ade import Server from dls_ade import bytes_to_string except...
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import (assert_equal, assert_allclose, assert_raises, assert_) from scipy._lib._numpy_compat import suppress_warnings import pytest from scipy.interpolate import (BSpline, BPoly, PPoly, make_interp_spline, ...
import logging import os import shutil import signal import sys import threading import time from distutils.dir_util import copy_tree from subprocess import Popen import plac import pymysql import psycopg2 from elasticsearch import Elasticsearch from scrapy.utils.log import configure_logging cur_path = os.path.dirnam...
# 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 use ...
""" Functions for moksha-ctl """ import decorator import subprocess import os import sys import shutil import psutil # Local imports import config import colors as c import utils ctl_config = config.load_config() pid_files = ['paster.pid', 'orbited.pid', 'moksha-hub.pid'] PRETTY_PREFIX = "[" + c.magenta("moksha-ctl...
import os from django.utils import six from datetime import datetime, date import logging from django.utils.html import strip_tags from django.utils.safestring import mark_safe from django.conf import settings from django.contrib.staticfiles.finders import find from django.core.cache import cache from django.core.exce...
from contextlib import contextmanager from .operations import Operations from .migration import MigrationContext from . import util class EnvironmentContext(object): """Represent the state made available to an ``env.py`` script. :class:`.EnvironmentContext` is normally instantiated by the commands presen...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# # Copyright 2013 Radware LTD. # # 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 agr...
from migen import * from migen.genlib.coding import Decoder as OneHotDecoder from litex.soc.interconnect import stream from litex.soc.interconnect.csr import AutoCSR, CSRStorage, CSRStatus, CSR from litex.soc.integration.doc import AutoDoc, ModuleDoc from litedram.frontend.dma import LiteDRAMDMAReader, LiteDRAMDMAWr...
""" Module containing the definition of the generic interface of Kernel objects """ import numpy as np from .utils import center_gram, center_rows, safe_len, mpmap DTYPE = np.float64 class AbstractClassError(Exception): pass class GenericKernel(object): """ Abstract class for kernel operations between ...
# Copyright (c) 2012 OpenStack Foundation. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
#!/usr/bin/python # Copyright [yyyy] [name of copyright owner] # # 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...
#!/usr/bin/python3 """ This is a blame game simulator (also known as swarte piet or Schwarzer Peter). To run it just call it with a list of names and watch the game: blamegame.py John Marry Joe If you want to speed up or slow down the game, set a delay value (default is 1 second) with the -d option: blameg...
import codecs import logging import os import re import sys from xml.dom import minidom import gflags from bibtexparser.bparser import BibTexParser gflags.DEFINE_string('mindmap_file', None, 'the mindmap filename') gflags.DEFINE_boolean('use_absolute_paths_for_images', False, 'when set, will use...
# -*- test-case-name: xmantissa.test.test_websession -*- # Copyright 2005 Divmod, Inc. See LICENSE file for details """ Sessions that persist in the database. Every L{SESSION_CLEAN_FREQUENCY} seconds, a pass is made over all persistent sessions, and those that are more than L{PERSISTENT_SESSION_LIFETIME} seconds ol...
""" Copyright 2017 Ismail Deganii Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
import unittest import time import json import redis from redset import SortedSet, TimeSortedSet, ScheduledSet from redset.interfaces import Serializer class SortedSetTest(unittest.TestCase): def setUp(self): self.key = 'ss_test' self.ss = SortedSet(redis.Redis(), self.key) def tearDown(se...
#!/usr/bin/env python # @HEADER # ************************************************************************ # # TriBITS: Tribal Build, Integrate, and Test System # Copyright 2013 Sandia Corporation # # Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, # the U.S. Govern...
# 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 u...
# First the monkeypatch stuff import sys import os import pkg_resources from pip.exceptions import InstallationError from pip.log import logger from pip.backwardcompat import HTTPError from pip.index import Link from pip.req import InstallRequirement from pip.util import display_path from pip.download import url_to_pa...
import pygame import time from pygame.locals import * background_color = (248, 248, 248) speednumber_position = (170, 120) def position_in_rect(position, rectangle): return rectangle.collidepoint(position) def speed_position(text, font, right_upper_coordinates): """" Gives the position for screen.blib() starti...
import logging import os import warnings import six from .. import auth, errors, utils from ..constants import INSECURE_REGISTRY_DEPRECATION_WARNING log = logging.getLogger(__name__) class ImageApiMixin(object): @utils.check_resource def get_image(self, image): """ Get a tarball of an imag...
#!/usr/bin/env python import math import sys import roslib; roslib.load_manifest('bugs') import rospy import tf.transformations as transform from geometry_msgs.msg import Twist from sensor_msgs.msg import LaserScan from nav_msgs.msg import Odometry from location import Location, necessary_heading from dist import Di...
# -*- coding: utf-8 -*- # Copyright 2022 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...
"""Helpers for tests.""" import json from unittest.mock import patch import pytest from homeassistant.config_entries import ENTRY_STATE_LOADED from .common import MQTTMessage from tests.common import MockConfigEntry, load_fixture from tests.components.light.conftest import mock_light_profiles # noqa: F401 @pytes...
########################################################## ## QueryParser.py ## Purpose: script parses and converts SPARQL query text ## version 1.2.0 ## date: 07.09.2017 ########################################################## ## import module/script dependencies import re import os def TripleType(triple_list):...
# -*- coding: utf-8 -*- # Copyright 2022 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...
# -*- coding: utf-8 -*- """ This code is originally from parser.py. This file is not meant to by used by itself. This is for JunOS like ACLs #Constants junos_match_types rules - this is really from the grammar.py # Classes Policer PolicerGroup QuotedString # Functions braced_list keyword_m...
# Copyright 2012 Anton Beloglazov # # 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 math import nltk import time import sys # Constants to be used by you when you fill the functions START_SYMBOL = '*' STOP_SYMBOL = 'STOP' MINUS_INFINITY_SENTENCE_LOG_PROB = -1000 log2 = lambda x: math.log(x, 2) # TODO: IMPLEMENT THIS FUNCTION # Calculates unigram, bigram, and trigram probabilities given a tra...
"""This module contains the general information for StorageLocalDisk ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class StorageLocalDiskConsts: ADMIN_ACTION_DISABLE_SED_FOREIGN_DRIVES = "disable-sed-foreign-drives" A...
import model as Model import string import math import sys ################################################################################################### def solve(problem): nodes = nodes_by_max_size(problem) computers = computers_by_capacity(problem) allocation = Model.Allocation() ...
from main import db from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() coauthors = db.Table('coauthor', db.Column('author_id', db.Integer, db.ForeignKey('author.id')), db.Column('coauthor_id', db.Integer, ...
# Copyright (c) 2013 Mirantis Inc. # Copyright (c) 2013 Hortonworks, 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...
""" Band Selective Homonuclear CP calculator Created on 22.05.2014 Modified 02.07.2014 W.T. Franks FMP Berlin @author: Venita Daebel @copyright: Bruker Biospin Corporation """ # Import Important stuff import de.bruker.nmr.mfw.root as root import os, re, string, math, sys, copy sys.path.append(root.UtilPath.getTopspi...
# extdiff.py - external diff program support for mercurial # # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''command to allow external programs to compare revisions The ex...
import pandas as pd from collections import defaultdict import math from scipy import stats import numpy as np import matplotlib.pyplot as plt import os #SDSS MOC4 data file path = 'ADR4.dat' #solar colors (reverse calculated from Carvano) #reference to g solar_color_ug = 3.81 solar_color_rg = 2.04 solar_color_ig = 1...
# Copyright 2019, OpenCensus 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 w...
# encoding=utf-8 # Generated by cpy # 2015-04-20 14:38:56.338378 import os, sys from sys import stdin, stdout import socket class SSDB_Response(object): pass def __init__(this, code='', data_or_message=None): pass this.code = code this.data = None this.message = None if code=='ok': pass this.data ...
""" Collection of functions to to simulate the dynamics of water penetration into a multi-layer package. The user input (typically from a GUI) defines the types of layers, such as bottle, bag, drum, ...etc. and the components inside each layer such as desiccant (e.g. slica), tablets, powder, ...etc. The module looks ...
# # The Python Imaging Library. # $Id$ # # optional color managment support, based on Kevin Cazabon's PyCMS # library. # # History: # 2009-03-08 fl Added to PIL. # # Copyright (C) 2002-2003 Kevin Cazabon # Copyright (c) 2009 by Fredrik Lundh # # See the README file for information on usage and redistribution. See # ...
""" Support for interfacing to the Logitech SqueezeBox API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.squeezebox/ """ import asyncio import json import logging import urllib.parse import aiohttp import async_timeout import voluptuous a...
#!/usr/bin/env python """ runtests.py [OPTIONS] [-- ARGS] Run tests, building the project first. Examples:: $ python runtests.py $ python runtests.py -s {SAMPLE_SUBMODULE} $ python runtests.py -t {SAMPLE_TEST} $ python runtests.py --ipython $ python runtests.py --python somescript.py $ python...
import requests import json import base64 import datetime import collections import re # Local imports import sabre_utils import sabre_exceptions from sabre_endpoints import sabre_endpoints class SabreDevStudio(object): def __init__(self, environment='test', return_obj=True): self.auth_headers = None ...
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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 # # ...
#Boa:Frame:frmQueryBuilder import wx import wx.richtext def create(parent): return frmQueryBuilder(parent) [wxID_FRMQUERYBUILDER, wxID_FRMQUERYBUILDERBTNALL, wxID_FRMQUERYBUILDERBTNAND, wxID_FRMQUERYBUILDERBTNAPPLY, wxID_FRMQUERYBUILDERBTNCANCEL, wxID_FRMQUERYBUILDERBTNCLEAR, wxID_FRMQUERYBUILDERBTNEQUAL, ...
import fnmatch import glob import os import re import tempfile from datetime import datetime from gppylib import gplog from gppylib.commands.base import WorkerPool, Command, REMOTE from gppylib.commands.unix import Scp from gppylib.db import dbconn from gppylib.db.dbconn import execSQL from gppylib.gparray import GpArr...
from __future__ import absolute_import, unicode_literals from datetime import date from django import forms from django.conf import settings from django.contrib.admin.options import (ModelAdmin, TabularInline, HORIZONTAL, VERTICAL) from django.contrib.admin.sites import AdminSite from django.contrib.admin.valida...
# Copyright 2015, 2017 IBM Corp. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
# Copyright (c) 2012 Citrix Systems, 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 ...
# -*- coding: utf-8 -*- ''' Created on 2014-3-5 @author: CL.lam ''' from cgi import FieldStorage from tg import flash, redirect, expose from tg.decorators import paginate from repoze.what import authorize from sqlalchemy.sql.expression import and_, desc from rpac.lib.base import BaseController from rpac.util.common ...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
#!/usr/bin/python # -*- coding: utf-8 -*- """ KiwiMarkup Test Unit Run using 'python test.py' """ # Standard library imports import imp import re # Application specific imports # Because Kiwimark is not installed into the Python library we need to load it # manually. scriptfile, pathname, description = imp.find_mo...
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. import datetime import json import traceback import unittest from unittest import TestCase from decimal import D...
# 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. # libcloud.org licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not...
#!/usr/bin/python # The following is so that insights-client continues to work normally in places where # Docker is not installed. # # Note that this is actually testing if the python docker client is importable (is installed), # and if the docker server on this machine is accessable, which isn't exactly the # same th...
""" Test Suites ----------- Provides a LazySuite, which is a suite whose test list is a generator function, and ContextSuite,which can run fixtures (setup/teardown functions or methods) for the context that contains its tests. """ from __future__ import generators import logging import sys import unittest from nose....
"""Utility functions for the plugins table.""" import difflib import random import re import sys import rethinkdb as r from slugify import slugify import db.util r_conn = db.util.r_conn class RequiredProperty(object): pass _ROW_SCHEMA = { # Primary key. Human-readable permalink for a plugin. Eg. 'pytho...
import datetime import hashlib import heapq import math import os import random import re import sys import threading import zlib try: from collections import Counter except ImportError: Counter = None try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse try: fro...
#!/usr/bin/env python # This tool dumps imported Swift APIs to help validate changes in the # Clang importer and its heuristics. One can execute it to dump the # API of a given module within a particular SDK, e.g., UIKit from the # iOS SDK as seen in Swift 3 after the "grand renaming": # # /path/to/bin/dir/swift-api...
# -*- coding: utf-8 -*- # Author: Jev Kuznetsov <jev.kuznetsov@gmail.com> # License: BSD """ Toolset working with yahoo finance data Module includes functions for easy access to YahooFinance data """ from datetime import datetime, date import urllib.request from pandas import DataFrame, Index, HDFStore, Panel imp...
'''Dependency checking functionality for Library, Designer and Smartgrid Actions. Created on May 16, 2013 @author: Cam Moore ''' from apps.widgets.smartgrid_library.models import LibraryAction from apps.widgets.smartgrid_design.models import DesignerAction, DesignerGrid from apps.managers.smartgrid_mgr.gcc_model impor...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8899") else: access = Ser...
from pandac.PandaModules import * from direct.distributed.DistributedObject import DistributedObject from direct.task.Task import Task from toontown.minigame import CannonGameGlobals from toontown.minigame.CannonGameGlobals import * from toontown.parties.Cannon import Cannon from toontown.parties.CannonGui import Canno...
# Created by Pearu Peterson, June 2003 import numpy as np from numpy.testing import (assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_allclose, suppress_warnings) from pytest import raises as assert_raises from numpy import array, diff, linspace, meshgrid, ones, pi, shap...
#!/usr/bin/env python # 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 # # Unle...
import hashlib import os from tempfile import NamedTemporaryFile import numpy as np from cnntools.caffefileproc import parse_model_definition_file from cnntools.common_utils import ensuredir, safe_save_content from cnntools.models import CaffeCNNSnapshot, CaffeCNNTrainingRun from cnntools.utils import (add_caffe_to_p...
# =========================================================================== import swap import numpy as np import pylab as plt from subject import Ntrajectory # ====================================================================== class Collection(object): """ NAME Collection PURPOSE ...
""" ******************************************************************************** * Name: tethys_gizmos.py * Author: Nathan Swain * Created On: 2014 * Copyright: (c) Brigham Young University 2014 * License: BSD 2-Clause ******************************************************************************** """ import os im...
# 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 use ...