gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Copyright 2011 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...
# 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...
# 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,...
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de> # # License: Simplified BSD import os.path as op import numpy as np from numpy.testing import (assert_array_almost_equal, assert_allclose, assert_array_less) import pytest...
#!/usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2013--, biocore development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------...
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import json import o...
# # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# -*- coding: utf-8 -*- ''' Connection library for VMWare .. versionadded:: 2015.8.2 This is a base library used by a number of VMWare services such as VMWare ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> Dependencies ~~~~~~~~~~~~ - pyVmomi Python Module - ESXCLI: This dependency ...
import unittest import numpy import chainer from chainer.backends import cuda from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr from chainer.testing import condition def _check_forward(e1, e2, f, y_expect): e1 = chainer.Variable(e1) e2 ...
# Copyright 2018 The Oppia 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 applicable ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import os import pytest import numpy as np from ....tests.helper import assert_quantity_allclose, catch_warnings, remote_data from .. import ier...
import smbus import logging import glob import re logger = logging.getLogger(__name__) class DeviceException(Exception): pass class Registers(object): MODE_1 = 0x00 MODE_2 = 0x01 LED_STRIP_START = 0x06 # LED0 ON Low Byte PRE_SCALE = 0xFE class Mode1(object): RESTART = 7 EXTCLK = 6 AI...
# 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 a...
#!/usr/bin/env python """Copyright (c) 2016, Dilithium Power Systems LLC 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 ...
""" HTML Widget classes """ from __future__ import unicode_literals import copy import datetime import re from itertools import chain from django.conf import settings from django.forms.utils import to_current_timezone from django.templatetags.static import static from django.utils import datetime_safe, formats, six ...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """Tools for the submission of Tasks.""" from __future__ import unicode_literals, division, print_function import os import time import collections import yaml from six.moves import cStringIO from datetime imp...
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Licen...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import os import re import sys import fnmatch import os.path # for command line options and supported environment variables, please # see the end of 'setupinfo.py' if (2, 7) != sys.version_info[:2] < (3, 5): print("This lxml version requires Python 2.7, 3.5 or later.") sys.exit(1) try: from setuptools im...
# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must ret...
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # ---------------------------------------------------------------...
# -*- coding: utf-8 -*- """ Module to handle masks: it defines: - Mask: a mask object with command line methods: addPolygon, etc - makeMaskGui: a GUI based way of creating masks - maskBorder: to mask the borders of an array - maskCenterLines: to mask the central lines (good for multi-panel...
from .base import BaseLibLinear, BaseSVC, BaseLibSVM from ..base import RegressorMixin from ..linear_model.base import LinearClassifierMixin, SparseCoefMixin from ..feature_selection.from_model import _LearntSelectorMixin class LinearSVC(BaseLibLinear, LinearClassifierMixin, _LearntSelectorMixin, Spar...
############################################################################### # general GAMMA utilities # Copyright (c) 2014-2021, the pyroSAR Developers, Stefan Engelhardt. # This file is part of the pyroSAR Project. It is subject to the # license terms in the LICENSE.txt file found in the top-level # directory of...
""" Data structures for sparse float data. Life is made simpler by dealing only with float64 data """ from __future__ import division # pylint: disable=E1101,E1103,W0231,E0202 from pandas.compat import lmap from pandas import compat import numpy as np from pandas.core.dtypes.missing import isna, notna from pandas.cor...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from frappe.utils.minify import JavascriptMinify """ Build the `public` folders and setup languages """ import os, frappe, json, shutil, re # from cssmin import cssmin app_pat...
from .context import get_current_config, connections, log, run_task, metric import time import datetime import gevent import argparse import random import shlex import traceback from collections import defaultdict from bson import ObjectId try: from redis.lock import LuaLock except ImportError: # Change name t...
# Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
# 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 ...
# -*- coding: utf-8 -*- # Copyright (C) 2011 by Researchstudio iSpace # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use,...
import json from semNets.Topology import Topology from semNets.Primitives import Node, Relation, RelationAttributeType, RelationType, Attribute def parseLog(file, parent): counter = 0 current_linenumber = 0 test = "" top = Topology() top.setParent(parent) #### utilities #### utilities = { # counters ...
# 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...
# -*- coding: utf-8 -*- """ Created on Wed Mar 25 10:46:06 2015 @author: Paco """ """Copyleft 2010 Forrest Sheng Bao http://fsbao.net PyEEG, a Python module to extract EEG features, v 0.02_r2 Project homepage: http://pyeeg.org **Data structure** PyEEG only uses standard Python and numpy data structures, so you need t...
from __future__ import absolute_import import Cookie import urllib import urlparse import time import copy from email.utils import parsedate_tz, formatdate, mktime_tz import threading from netlib import http, tcp, http_status import netlib.utils from netlib.odict import ODict, ODictCaseless from .tcp import TCPHandler ...
# An Python interface to the Scintilla control. # # Exposes Python classes that allow you to use Scintilla as # a "standard" MFC edit control (eg, control.GetTextLength(), control.GetSel() # plus many Scintilla specific features (eg control.SCIAddStyledText()) from pywin.mfc import window from pywin import default_sci...
''' Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved. This script tests node delayed rediscovery. This test takes 10 minutes to run and runs against a single node, random or specified via nodeid. Delayed rediscovery will start and script will send command to reboot the node. The test will check to see...
import numpy import unittest import theano from theano.tensor import Tensor, TensorType from theano.compile.sharedvalue import shared from theano.compile.sharedvalue import SharedVariable from theano.compile.sharedvalue import generic class Test_SharedVariable(unittest.TestCase): def test_ctors(self): ...
import unittest from random import randint import urwid as uw from urwid import ExitMainLoop from findtui.model import FindModel from findtui.options import MENUS, OPTIONS from findtui.view import (FindView, exit_on_keys, CLR_RADIO_CHOOSE, JUMP_TO_MENUS, JUMP_TO_COMMAND, JUMP_TO_OPTIONS, ...
from __future__ import absolute_import, unicode_literals import sys import pytest from case import Mock, skip from celery.five import PY3, long_t, python_2_unicode_compatible, string from celery.local import PromiseProxy, Proxy, maybe_evaluate, try_import class test_try_import: def test_imports(self): ...
import pytest import unittest import wtforms import minform class TestBinaryItem(unittest.TestCase): class MyItem(minform.BinaryItem): size = 4 def pack(self, data, order=None): return b'\x01\x02\x03\x04' def unpack(self, buf, order=None): return 0x01020304 ...
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import electrum from electrum.bitcoin import TYPE_ADDRESS from electrum import WalletStorage, Wallet from electrum_gui.kivy.i18n import _ from electrum.paymentrequest import InvoiceStore from electr...
from django.db import connection class DataRelatedToMe(object): def __init__(self, username): self.username = username self.role_lookup = {} # { role_id : name } self.direct_role_assignments = [] self.direct_dvobject_assignments = [] # ----------------------- ...
"""resonance finder """ import argparse import numpy as np import matplotlib.pyplot as plt from scipy.signal import chirp, spectrogram # from scipy.signal import butter, lfilter_zi, lfilter from scipy import signal def main_single(args): # print "args", args plt.ion() # system: very simple resonance mo...
"""Component to integrate the Home Assistant cloud.""" import logging from hass_nabucasa import Cloud import voluptuous as vol from homeassistant.components.alexa import const as alexa_const from homeassistant.components.google_assistant import const as ga_c from homeassistant.const import ( CONF_MODE, CONF_N...
""" Kernel Call Details =================== When calling sas computational kernels with polydispersity there are a number of details that need to be sent to the caller. This includes the list of polydisperse parameters, the number of points in the polydispersity weight distribution, and which parameter is the "theta"...
import settings,facebook,urllib,cgi,datetime from timestack import utils from django.shortcuts import render_to_response, redirect from django.template import RequestContext from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponse, HttpResponse from django.conf import set...
# liblouis Braille Translation and Back-Translation Library # # Copyright (C) 2017 Bert Frees # # This file is part of liblouis. # # liblouis 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 versi...
#!/usr/bin/env python # encoding: utf-8 """The ipcluster application.""" from __future__ import print_function import errno import logging import os import re import signal from subprocess import check_call, CalledProcessError, PIPE import zmq from traitlets.config.application import catch_config_error from IPython....
import sys import os import time from array import array as Array from nysa.host.driver.utils import * from collections import OrderedDict sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) from nysa.host.driver import driver DEVICE_TYPE = "Logic Anal...
# -*- coding: utf-8 -*- import logging import subprocess from pyramid.view import view_config from ..app.sqla import DBSession from .models import Workspace from . import WorkspaceManager from ..maps import MapManager log = logging.getLogger(__name__) class APIWorkspace(object): def __init__(self, request): ...
"""Test zha climate.""" import pytest import zigpy.zcl.clusters from zigpy.zcl.clusters.hvac import Thermostat import zigpy.zcl.foundation as zcl_f from homeassistant.components.climate.const import ( ATTR_CURRENT_TEMPERATURE, ATTR_FAN_MODE, ATTR_FAN_MODES, ATTR_HVAC_ACTION, ATTR_HVAC_MODE, AT...
# Purpose: Convert Veracode XML elements to Python objects. from __future__ import print_function import sys import xml.etree.ElementTree as ETree try: from StringIO import StringIO except ImportError: from io import BytesIO import pytz from dateutil import parser from veracodetocsv.helpers import models fro...
"""fsmonitor_inotify.py FSMonitor subclass for inotify on Linux kernel >= 2.6.13""" __author__ = "Wim Leers (work@wimleers.com)" __version__ = "$Rev$" __date__ = "$Date$" __license__ = "GPL" from fsmonitor import * import pyinotify from pyinotify import WatchManager, \ ThreadedNotifier, \ ...
""" Blaze storage backend, structured collection of unboxed memory. We follow the same conventions as CPython in that we use the arena model of memory. It does the mallocs of data as needed to shuffle blocks efficiently for data that is passed to Numba. It is also one place for safe management of blocks of data from S...
# Copyright 2015: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# License # Copyright (c) 2008, Armin Ronacher All rights reserved. # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # Redistributions of source code must retain the above copyright notice, this list of conditions and the ...
#!/usr/bin/env python ''' Quantile regression model Model parameters are estimated using iterated reweighted least squares. The asymptotic covariance matrix estimated using kernel density estimation. Author: Vincent Arel-Bundock License: BSD-3 Created: 2013-03-19 The original IRLS function was written for Matlab by...
from __future__ import unicode_literals import re from django import forms from django.contrib.auth.forms import ( AuthenticationForm, PasswordChangeForm, PasswordResetForm, ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget, SetPasswordForm, UserChangeForm, UserCreationForm, ) from django.contrib.auth...
"""Let's Encrypt client interfaces.""" import abc import zope.interface # pylint: disable=no-self-argument,no-method-argument,no-init,inherit-non-class # pylint: disable=too-few-public-methods class AccountStorage(object): """Accounts storage interface.""" __metaclass__ = abc.ABCMeta @abc.abstractmetho...
#!/usr/bin/env python #-*- coding:utf-8 -*- import os import sys import logging import binascii import argparse import time import copy import Queue import threading from bson.binary import Binary import rflib.ipc.IPC as IPC import rflib.ipc.IPCService as IPCService from rflib.ipc.RFProtocol import * from rflib.ipc....
#! /usr/bin/env python3 # # Copyright 2017-2020 Linaro Limited # Copyright 2019-2020 Arm Limited # # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
"""Checks use of "too-complex" check""" def f1(): """McCabe rating: 1""" pass def f2(n): """McCabe rating: 1""" k = n + 4 s = k + n return s def f3(n): """McCabe rating: 3""" if n > 3: return "bigger than three" elif n > 4: return "is never executed" else: ...
import functools import inspect import itertools import sys from collections import defaultdict from collections import deque from collections import OrderedDict from typing import Dict from typing import Tuple import attr import py import _pytest from _pytest import nodes from _pytest._code.code import FormattedExci...
#! /usr/bin/env 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. """Instructs Chrome to load series of web pages and reports results. When running Chrome is sandwiched between preprocessed disk cach...
#!/usr/bin/env python -W ignore::DeprecationWarning ''' KPCA based feature engineering for 20-newsgroup document classification with combination of kernels in each layers Author : Akhil P M Kernel used : Arc-cosine Kernel, Gaussian Kernel, Polynomial kernel ''' import kernel from settings import * from umkl_new impo...
from __future__ import absolute_import, division, print_function import os from ...external.qt.QtGui import ( QMainWindow, QMessageBox, QWidget) from ...external.qt.QtCore import Qt from ...core.application_base import ViewerBase from ..decorators import set_cursor from ..layer_artist_model import QtLayerArtis...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import getpass import argparse import readline import json import rlcompleter import atexit import glob # tab completion def complete(text, state): return (glob.glob(text+'*')+[None])[state] readline.set_completer_delims(' \t\n;') readline.parse...
# This file is part of the django-environ. # # Copyright (c) 2021, Serghei Iakovlev <egrep@protonmail.ch> # Copyright (c) 2013-2021, Daniele Faraglia <daniele.faraglia@gmail.com> # # For the full copyright and license information, please view # the LICENSE.txt file that was distributed with this source code. """ Djang...
# Copyright 2019 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, ...
"""Controls robot motion using sensors and simulation data.""" from collections import namedtuple, defaultdict from time import sleep import numpy as np from components.util import within, initialized_coroutine from components.messaging import Signal, Broadcaster from components.concurrency import Reactor from compon...
""" ietf_diffserv_classifier This module contains a collection of YANG definitions for configuring diffserv specification implementations. Copyright (c) 2014 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modific...
import unittest import xo.game as game from xo.error import IllegalStateError from xo.game import Game class InitStateTestCase(unittest.TestCase): def setUp(self): self.game = Game() def test_it_is_in_init_state(self): self.assertEqual(self.game.state, game.STATE_INIT) self.assertIs...
#-*- coding: utf-8 -*- # stino/compiler.py import os import re import threading import subprocess import sublime from . import fileutil from . import textutil from . import constant from . import serial from . import base from . import preprocess from . import sketch from . import console ram_size_dict = {} ram_siz...
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license """Clone of Nmap's first generation OS fingerprinting. This code works with the first-generation OS detection and nmap-o...
# 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...
""" PDF Parser object """ import io from .exc import PdfParseError from .pdf_types import PdfRaw, PdfRawData, PdfDict, PdfObjectReference,\ PdfLiteralString, PdfHexString, PdfComment, \ PdfIndirectObject, PdfArray, PdfName, PdfStream from .misc ...
#!/usr/bin/env python # -*- coding: utf-8 -*- def all_messages(): """ keep all messages in id Returns: all messages in JSON """ return \ { "scan_started": "Mesin Nettacker mulai ...", "options": "python nettacker.py [opsi]", "help_menu": "Tampil...
#!/usr/bin/python # This file is part of DEAP. # # DEAP 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 3 of # the License, or (at your option) any later version. # # DE...
# REST Framework from rest_framework import generics, permissions, status from rest_framework.decorators import api_view from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from rest_framework.test import APIRequestFactory, APITestCase # User class fr...
#!/usr/bin/env python3 # # Tests the noise generators # # This file is part of PINTS (https://github.com/pints-team/pints/) which is # released under the BSD 3-clause license. See accompanying LICENSE.md for # copyright notice and full license details. # import unittest import numpy as np import pints.noise as pn cl...
import math import time class vector: x = 0.0 y = 0.0 def __init__(self): self.X = 0.0 self.y = 0.0 def __str__(self): return '{x:%s, y:%s}' % (self.x, self.y) class car: # given by system id = None token = None # given by system - end # given by use...
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import copy from datetime import datetime, timedelta from dateutil.tz import tzutc import json import itertools import ipaddress import logging import os import random import re import sys import threading import time from urllib import pars...
from __future__ import unicode_literals import re import unicodedata from gzip import GzipFile from io import BytesIO from django.utils.encoding import force_text from django.utils.functional import allow_lazy, SimpleLazyObject from django.utils import six from django.utils.six.moves import html_entities from django....
"""App Spec Model""" # pylint: disable=no-self-argument,no-self-use # standard library from copy import deepcopy from typing import List, Optional # third-party from pydantic import BaseModel, Field, validator from semantic_version import Version # first-party from tcex.app_config.models.install_json_model import ( ...
import os import time import uuid from kafka import * # noqa from kafka.common import * # noqa from kafka.codec import has_gzip, has_snappy from fixtures import ZookeeperFixture, KafkaFixture from testutil import * class TestKafkaProducerIntegration(KafkaIntegrationTestCase): topic = 'produce_topic' @class...
#!/usr/bin/env python # Load common imports and system envs to build the core object import sys, os # For running inside the docker container use: #import matplotlib #matplotlib.use('Agg') # Load the Environment: os.environ["ENV_DEPLOYMENT_TYPE"] = "JustRedis" from src.common.inits_for_python import * ###########...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2010 (ita) """ Classes related to the build phase (build, clean, install, step, etc) The inheritance tree is the following: """ import os, sys, errno, re, shutil try: import cPickle except ImportError: import pickle as cPickle from waflib import Runner, ...
# # Copyright (c) 2014, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of source code must retain the above copyright notice, # this list of condit...
from main import GuessManager def test_init_uppercase(): g = GuessManager('SOMEWORD') assert g.word == 'SOMEWORD' assert g.mask == [False]*8 def test_init_mask(): mask = [True, False, True, False, True, False, True, False] g = GuessManager('SOMEWORD', mask=mask) assert g.word == 'SOMEWORD' ...
# 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...
"""Define tests for the Flux LED/Magic Home config flow.""" from __future__ import annotations from unittest.mock import patch import pytest from homeassistant import config_entries from homeassistant.components import dhcp from homeassistant.components.flux_led.const import ( CONF_CUSTOM_EFFECT_COLORS, CONF...
import ast from pprint import pprint class Traductor(ast.NodeVisitor): def __init__(self): # we store the built prog self.prog = "" self.line = [] def visit_Module(self, node): """Visit the module body Iterate over all ast element in a module """ for ...
# Copyright 2019-present Kensho Technologies, LLC. import bisect from dataclasses import dataclass from typing import Any, Dict, Set, Union from graphql import GraphQLInterfaceType, GraphQLObjectType from ..compiler.compiler_frontend import ast_to_ir from ..compiler.helpers import ( BaseLocation, FoldScopeLoc...
from __future__ import absolute_import, print_function, division import errno import os import sys from theano.compat import PY3 from theano.gof.compilelock import get_lock, release_lock from theano import config from . import cmodule # TODO These two lines may be removed in the future, when we are 100% sure # noone ...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import time from lib.core.common import clearConsoleLine from lib.core.common import dataToStdout from lib.core.common import filterListValue from lib.core.common import getF...
# This file is part of the MapProxy project. # Copyright (C) 2011 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...
import logging.config import random import socket import struct import threading import os from coapthon import defines from coapthon.layers.blocklayer import BlockLayer from coapthon.layers.cachelayer import CacheLayer from coapthon.layers.forwardLayer import ForwardLayer from coapthon.layers.messagelayer import Mes...
# 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 applicab...