gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# 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 # # http://www.apache.org...
"""GATK variant calling -- MuTect2. """ from distutils.version import LooseVersion import os import shutil import numpy as np import toolz as tz from bcbio import bam, broad, utils from bcbio.bam import is_paired from bcbio.log import logger from bcbio.distributed.transaction import file_transaction from bcbio.pipeli...
# Copyright 2014 Cloudera 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, so...
"""Support code for distutils test cases.""" import os import sys import shutil import tempfile import unittest import sysconfig from copy import deepcopy from distutils import log from distutils.log import DEBUG, INFO, WARN, ERROR, FATAL from distutils.core import Distribution class LoggingSilencer(object): de...
import numpy import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') import matplotlib.pyplot as plt bigfont = 12 medfont = 10 # fontsize smallfont = 7 def write_stats4(file, args, epochs, hours, cost_tr_full, cost_noreg, acc_labfus, sparsity, seg_stats, class_stats, invalid_upd...
"""Defines GLWidgetPlugin, GLMultiViewportProgram, and CachedGLObject, which are used by the core visualization module. They may be useful for writing your own GLPluginInterface classes, too. """ from glinterface import GLPluginInterface from glprogram import GLProgram,GLPluginProgram import math from OpenGL.GL impo...
from __future__ import division from builtins import range from past.utils import old_div from proteus import (Comm, Profiling, Quadrature) from proteus.Profiling import logEvent import os import sys comm = Comm.get() Profiling.procID = comm.rank() Profiling.logFile = sys.stdout Profiling.logLevel = 2 Profiling.verbos...
# -*- 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 #...
import random import matplotlib import matplotlib.pyplot as plt import time ## MUST BEAT these! ''' The question is, can we find a simple variable change where there is both lower risk, and higher profit... and soon, is this the case accross an average of 1 million samples. ''' lower_bust = 31.235 higher_profit = 6...
# -*- coding: utf-8 -*- """ https://tools.ietf.org/html/draft-sweet-rfc2910bis-07 Internet Printing Protocol/1.1: Encoding and Transport 3.1.1. Request and Response An operation request or response is encoded as follows: ----------------------------------------------- | ...
# coding: utf-8 from rest_framework import status from rest_framework.response import Response from rest_framework.reverse import reverse from rest_framework.authentication import TokenAuthentication from rest_framework.permissions import IsAuthenticated import ast from rest_framework.decorators import ( api_view,...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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) 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/LICEN...
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import functools import gc import os import sys import shutil import warnings import unittest import nose import numpy as np import matplotlib as mpl import matplotlib.st...
#!/usr/bin/env python3 # Copyright (c) 2015-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test processing of unrequested blocks. Setup: two nodes, node0+node1, not connected to each other. Nod...
# CmdVM functions for Systems Management Ultra Thin Layer # # Copyright 2017 IBM Corp. # # 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/LICE...
"""Tests for certbot.plugins.webroot.""" from __future__ import print_function import argparse import errno import os import shutil import stat import tempfile import unittest import mock import six from acme import challenges from acme import jose from certbot import achallenges from certbot import errors from ce...
# Copyright 2016 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 writin...
# Maildir repository support # Copyright (C) 2002-2015 John Goerzen & contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your op...
from datetime import datetime from collections import OrderedDict from django.core.urlresolvers import resolve, reverse import furl import pytz import jsonschema from framework.auth.core import Auth from osf.models import BaseFileNode, OSFUser, Comment, Preprint, AbstractNode from rest_framework import serializers as...
import numpy as np import cv2 import os import vidviz.effects as effects import vidviz.auto as auto import vidviz.utils as utils class WindowServer(object): """ WindowServer object controls loading/generation of source frame, processes the frame, and then returns the frame as a numpy array to be ren...
import os os.chdir('C:/Users/JohnnyG/Documents/PythonCode/ternaryplot') from myternaryutility import TernaryPlot import matplotlib.cm as cm import numpy, operator import pylab, h5py from matplotlib.ticker import FuncFormatter p='C:/Users/JohnnyG/Documents/PythonCode/Vlassak/NanoCalorimetry/AuSiCu_pnsc_all.h5' def mye...
# 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 # ...
#!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL2Tiles, Google Summer of Code 2007 & 2008 # Global Map Tiles Classes # Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326, # generate a simple HTML viewers b...
#!/usr/bin/env python # TODO add onos-app-fwd to features # TODO check if service is running... i think this might already be done by mn from mininet.node import Controller, OVSSwitch, CPULimitedHost, RemoteController from mininet.net import Mininet from mininet.cli import CLI from mininet.topo import LinearTopo, Top...
import hashlib from io import BytesIO import logging import os from typing import Any, cast, Dict, List, Optional, Sequence, Type, TYPE_CHECKING, Union from pkg_resources import parse_version import wandb from wandb import util from ._private import MEDIA_TMP from .base_types.media import BatchableMedia, Media from ....
""" Copyright (c) 2014, Samsung Electronics Co.,Ltd. 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, this list of conditions and...
from collections import namedtuple import contextlib import itertools import math import sys import ctypes as ct import numpy as np from numba.core.compiler import compile_isolated, Flags from numba import jit, typeof, njit, literal_unroll, literally import unittest from numba import testing from numba.core import typ...
""" Pygame + Atari_Py """ import sys sys.path.insert(0, '../') # NOTE: set where atati_py is try: import atari_py except ImportError as e: raise error.DependencyNotInstalled("{}. (HINT: you can install Atari dependencies by running 'pip install gym[atari]'.)".format(e)) # from gym.envs.atari_env ACTION_MEA...
# -*- coding: utf-8 -*- """ @author: Oladimeji Salau Purpose: A python code containing useful functions for managing files and directories. How to use it ============== Save the code as dfmtool.py and run it on your system's terminal. Requirements ============ Ensure relevant python modules as noted below are instal...
import pytest from elasticmagic import ( Document, Field, ) from elasticmagic.agg import ( TopHits, TopHitsResult, ) from elasticmagic.compiler import ( CompilationError, Compiler_1_0, Compiler_2_0, Compiler_5_0, Compiler_5_6, Compiler_6_0, Compiler_7_0, ) from elasticmagic....
# encoding: utf-8 # Copyright 2013 maker # License """ Core Mail Framework """ from maker.core.conf import settings import re import time import base64 import smtplib import imaplib, email, poplib from datetime import datetime from email.MIMEText import MIMEText from email.header import decode_header from email....
## @package sparse_lookup # Module caffe2.python.layers.sparse_lookup from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python.helpers.arg_scope import get_current_scope from caffe2.python import schema from ...
# # This file is part of KoreanCodecs. # # Copyright(C) 2002-2003 Hye-Shik Chang <perky@FreeBSD.org>. # # KoreanCodecs 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...
"""Bagging meta-estimator.""" # https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/ensemble/bagging.py # Author: Gilles Louppe <g.louppe@gmail.com> # License: BSD 3 clause from __future__ import division import itertools import numbers import numpy as np from abc import ABCMeta, abstractmethod from ins...
""" Support to interface with Sonos players (via SoCo). For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.sonos/ """ import asyncio import datetime import functools as ft import logging from os import path import socket import urllib import vo...
"""Search (Chapters 3-4) The way to use this code is to subclass Problem to create a class of problems, then create problem instances and solve them with calls to the various search functions.""" from utils import ( is_in, argmin, argmax, argmax_random_tie, probability, weighted_sample_with_replacement, memoi...
# 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...
import pytest from tests import utils from unittest import mock from tests.utils import async from waterbutler.core import metadata from waterbutler.core import exceptions @pytest.fixture def provider1(): return utils.MockProvider1({'user': 'name'}, {'pass': 'word'}, {}) @pytest.fixture def provider2(): re...
# Hidden Markov Model Implementation import pylab as pyl import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy as scp import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import rospy #import hrl_lib.mayavi2_util as mu import hrl_lib.viz ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals, division from sc2reader.utils import Length from sc2reader.events.base import Event from sc2reader.log_utils import loggable from itertools import chain @loggable class GameEvent(Event): """ This is the base cl...
""" Provides functions for syncing entities and their relationships to the Entity and EntityRelationship tables. """ import logging from time import sleep import wrapt from collections import defaultdict from activatable_model import model_activations_changed from django import db from django.contrib.contenttypes.mod...
# 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 import os import os.path import re import shutil import subprocess import tempfile from collections import namedtuple from .linters import LINTERS try: raw_input except NameError: raw_input = input class HookParserException(Exception): pass Push = namedtuple('Push', ['changes', '...
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Top-level presubmit script for Chromium. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presu...
# 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...
# # GtkHelp.py -- customized Gtk widgets # # Eric Jeschke (eric@naoj.org) # # 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 time import gtk import gobject from ginga.misc import Bunch, Callback ...
# -*- coding: utf-8 -*- import sys, os, threading, codecs, logging, getpass #import glib import gi try: gi.require_version('Gtk', '3.0') gi.require_version('WebKit', '3.0') from gi.repository import Gtk, Gdk, GObject, GdkPixbuf, Gio, WebKit except: sys.exit(1) try: gi.require_version('AppIndicat...
# 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 ...
# coding: utf-8 # # Check the first available appointment date of CA DMV offices # @author williamchai # @version Aug 24, 2014 import urllib,urllib2,re,time import cPickle as pickle class Result(object): def __init__(self,oId,oName,firstDate,expire): self.officeId=oId self.officeName=oName ...
# coding: utf-8 """ AST to code converter base class """ import ast class AstToCode(object): """ converts an AST to code """ property_accessor_op = '.' """ Default property accessor operator for OOP """ constant_accessor_op = '.' """ Default constant accessor operator for OOP """ instance_v...
from datetime import date from unittest import mock, TestCase from bankline_parser.data_services import parse from bankline_parser.data_services.models import DataRecord from mtp_transaction_uploader import upload class CreditReferenceParsingTestCase(TestCase): successful = { 'correct_format_1': ('A1234...
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
""" Copyright 2015-2017 Red Hat, Inc. and/or its affiliates and other contributors. 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 ...
""" Created on Tue Oct 14 18:52:01 2014 @author: Wasit """ import numpy as np import os from PIL import Image from scipy.ndimage import filters try: import json except ImportError: import simplejson as json rootdir="../dataset" mrec=64 mtran=64 margin=mrec+mtran class dataset: def __init__(self): '...
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2010-2015, Michigan State University. # Copyright (C) 2015-2016, The Regents of the University of California. # Copyright (C) 2016, Google, Inc # # Redistribution and use in source and binary forms, with or without # modification, a...
from __future__ import absolute_import import datetime import unittest import numpy as np import pandas as pd from copy import copy import pytest from bokeh.core.properties import (field, value, NumberSpec, ColorSpec, Bool, Int, Float, Complex, String, Regex, Seq, List, Dict, Tuple, Instance, Any, Interval, ...
"""Common IO api utilities""" import os import csv import codecs import mmap from contextlib import contextmanager, closing from pandas.compat import StringIO, BytesIO, string_types, text_type from pandas import compat from pandas.io.formats.printing import pprint_thing from pandas.core.common import AbstractMethodEr...
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# import miscClin import miscMath import miscMatrix import miscTCGA import plotMatrix import tsvIO import itertools import numpy import random import sys # -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# NA...
""" Renderers are used to serialize a response into specific media types. They give us a generic way of being able to handle various media types on the response, such as JSON encoded data or HTML output. REST framework also provides an HTML renderer the renders the browsable API. """ from __future__ import unicode_li...
""" NumPy ===== Provides 1. An array object of arbitrary homogeneous items 2. Fast mathematical operations over arrays 3. Linear Algebra, Fourier Transforms, Random Number Generation How to use the documentation ---------------------------- Documentation is available in two forms: docstrings provided with the c...
# This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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...
# # 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...
from django.shortcuts import render_to_response from django.utils.safestring import mark_safe from django.db import transaction from djangosphinx.apis.api278 import * from search.models import File from browseNet.models import Path from stats.models import Status, Log import re, time from datetime import datetime ...
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2020-05-09 13:38 import logging import math import os.path from typing import Optional, Callable, Union, List, Dict import torch from hanlp_common.configurable import AutoConfigurable from hanlp_common.constant import HANLP_VERBOSE from hanlp_trie.trie import Trie from t...
# 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 -*- """flask-restful validators that extend https://github.com/flask-restful/flask-restful/blob/0.3.3/flask_restful/inputs.py See: - http://flask-restful.readthedocs.org/en/latest/extending.html#custom-fields-inputs - https://github.com/wtforms/wtforms/blob/master/wtforms/validators.py """ from w...
""" Cisco_IOS_XR_ha_eem_cfg This module contains a collection of YANG definitions for Cisco IOS\-XR ha\-eem package configuration. This module contains definitions for the following management objects\: event\-manager\: Event manager configuration Copyright (c) 2013\-2016 by Cisco Systems, Inc. All rights reserve...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import inspect import math import os import socket import subprocess import sys import time import typing from . import capabilities, enco...
# This is a helper file to fdp.py and lombardi.py # Author: Roman Chernobelskiy, romanc@email.arizona.edu (University of Arizona) # Developed on Python 2.5 from __future__ import division import math as m import re adjMat = {} nodeList = [] nodeDict = {} edgeList = [] def nodes(): for x in nodeList: yield x def ed...
#!/usr/bin/env python """These flows are system-specific GRR cron flows.""" import bisect import time import logging from grr.endtoend_tests import base from grr.lib import access_control from grr.lib import aff4 from grr.lib import config_lib from grr.lib import data_store from grr.lib import export_utils from grr...
from unittest.mock import Mock, MagicMock from kombu.asynchronous.aws.sqs.connection import ( AsyncSQSConnection ) from kombu.asynchronous.aws.ext import boto3 from kombu.asynchronous.aws.sqs.message import AsyncMessage from kombu.asynchronous.aws.sqs.queue import AsyncQueue from kombu.utils.uuid import uuid from...
from bge import logic as G from bge import events import mathutils import math import Rasterizer stats = None keyboardLayout = None anim = None camera = None motion = None def init(cont): global stats, keyboardLayout, anim, camera, char_motion box = cont.owner for ob in box.children: if 'col_empty' in ob: col...
#!/usr/bin/env python # -*- coding: utf-8 -*- # combine of all of Dhiru Kholia pcap convert utilities # into a single program. The pcap2john.readme lists # all of the original license statements. This merge was # done by JimF, Nov 2014, somewhat as a learning experience # for python. # The code itself is still a fabr...
# -*- coding: utf-8 -*- """Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the readme.MD file for mo...
import imp import os import sys import subprocess from distutils.version import LooseVersion from SCons.Script import BoolVariable, Dir, Environment, Variables if os.name == 'nt': from . import mono_reg_utils as monoreg def find_file_in_dir(directory, files, prefix='', extension=''): if not extension.starts...
# Copyright 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 writing,...
"""Tests for color_extractor component service calls.""" import base64 import io import aiohttp import pytest from voluptuous.error import MultipleInvalid from homeassistant.components.color_extractor import ( ATTR_PATH, ATTR_URL, DOMAIN, SERVICE_TURN_ON, ) from homeassistant.components.light import (...
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
# -*- coding: utf-8 -*- from datetime import date, timedelta from django.conf import settings from nose.tools import eq_ from kitsune.dashboards.cron import ( cache_most_unhelpful_kb_articles, _get_old_unhelpful, _get_current_unhelpful, update_l10n_coverage_metrics, update_l10n_contributor_metrics) from ...
# -*- coding: utf-8 -*- """ Data transformations ==================== The statistics of intermittent precipitation rates are particularly non-Gaussian and display an asymmetric distribution bounded at zero. Such properties restrict the usage of well-established statistical methods that assume symmetric or Gaussian dat...
class Room: """ Class detailing a single room. Inputs of note: location: coordinates [[xmin,xmax],[ymin,ymax]] describing where the room is located Attributes: name: the name of the room aliases: names the room can be called. Case doesn"t matter desc: the description of...
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu), # Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) # # ...
# Hidden Markov Models # # Author: Ron Weiss <ronweiss@gmail.com> # and Shiqiao Du <lucidfrontier.45@gmail.com> # API changes: Jaques Grobler <jaquesgrobler@gmail.com> """ The :mod:`sklearn.hmm` module implements hidden Markov models. **Warning:** :mod:`sklearn.hmm` is orphaned, undocumented and has known numerical s...
#! /usr/bin/env python3.3 # -*- coding: utf-8 -*- """ hex_parser - (will be) a simple tool to parse hex files """ import sys import os HEX_DATA = 0 HEX_EOF = 1 HEX_EXTENDED_SEGMENT_ADDRESS = 2 HEX_EXTENDED_LINEAR_ADDRESS = 4 hex_record_types = { HEX_DATA: 'data record', HEX_EOF: 'end of file record', HEX...
#!/usr/bin/env python # # Copyright 2006, 2007 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for ...
"""Test the various means of instantiating and invoking tools.""" import gzip import sys import unittest import io from cherrypy._cpcompat import copyitems, itervalues from cherrypy._cpcompat import IncompleteRead, ntob, ntou, xrange import time timeout = 0.2 import types import six import cherrypy from cherrypy im...
"""Manage Network Application files.""" import json import logging import shutil import urllib from pathlib import Path from kytos.core.napps import NApp log = logging.getLogger(__name__) class NAppsManager: """Deal with NApps at filesystem level and ask Kytos to (un)load NApps.""" def __init__(self, contr...
"""Controls activity related to RGB color sensor.""" import time from i2c_device.i2c_device import I2CDevice import bbb.gpio as gpio_mod import bbb.pwm as pwm_mod import bot.lib.lib as lib class ColorSensor(I2CDevice): """Wrapper class for TCS3472 I2C-based color sensor.""" # TODO: Make these config item...
import io import os import pytest from dvc.command.experiments.init import CmdExperimentsInit from dvc.exceptions import DvcException from dvc.main import main from dvc.repo.experiments.init import init from dvc.stage.exceptions import DuplicateStageName # the tests may hang on prompts on failure pytestmark = pytest...
# Copyright 2012 Nebula, 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...
from django.utils.text import slugify from data_importers.ems_importers import BaseHalaroseCsvImporter ABERDEENSHIRE_EXCLUDE_STATIONS = ( "1-dyce-community-centre", "1-houldsworth-institute", "10-beacon-sports-centre", "10-fleming-hall", "100-aberdeen-citadel-salvation-army-building", "101-st-...
import environment import lazy_generator class Entry(object): node = -1 anchor = -1 cluster = -1 def new_node(self): Entry.node += 1 return "node_sym{}".format(Entry.node) def new_anchor(self): Entry.anchor += 1 return "anchor_sym{}".format(Entry.anchor) def new_cluster(self): Entry.clu...
"""Tests for emulated_kasa library bindings.""" import math from unittest.mock import AsyncMock, Mock, patch from homeassistant.components import emulated_kasa from homeassistant.components.emulated_kasa.const import ( CONF_POWER, CONF_POWER_ENTITY, DOMAIN, ) from homeassistant.components.fan import ( ...
from django.db import models from django.db.models.signals import pre_save, post_save, post_delete from django.dispatch import receiver from django.template.defaultfilters import slugify from django.conf import settings from django.contrib.auth.models import User from guardian.shortcuts import assign_perm, remove_perm...
#!/usr/bin/env python import wx import random import os import sys try: dirName = os.path.dirname(os.path.abspath(__file__)) except: dirName = os.path.dirname(os.path.abspath(sys.argv[0])) bitmapDir = os.path.join(dirName, 'bitmaps') sys.path.append(os.path.split(dirName)[0]) try: import agw.shapedbutt...
# 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 # distributed under th...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'ProducerProduct.default_quantity' #db.delete_column('distribution_producerproduct', 'def...
""" Support for the LIFX platform that implements lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.lifx/ """ import asyncio from datetime import timedelta from functools import partial import logging import math import sys import voluptuous ...
#!/usr/bin/python # Copyright 2018 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 agr...