text
stringlengths
1
927k
"""Module containing the tests for the default scenario.""" # Standard Python Libraries import os # Third-Party Libraries import pytest import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ["MOLECULE_INVENTORY_FILE"] ).get_hosts("all") def test_package...
# 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...
# # Python Macro Language for Dragon NaturallySpeaking # (c) Copyright 1999 by Joel Gould # Portions (c) Copyright 1999 by Dragon Systems, Inc. # # _glogals.py # Sample macro file which is active all the time (not application specific). # # April 25, 1999 # - packaged for external release # # March 3, 1999 # ...
# 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...
# -*- coding: utf-8 -*- """ demeter init author:rabin """ __version__ = '1.0.0'
# To use this code, make sure you # # import json # # and then, to convert JSON from a string, do # # result = group_joined_event_from_dict(json.loads(json_string)) from dataclasses import dataclass from typing import Any, Optional, TypeVar, Type, cast T = TypeVar("T") def from_str(x: Any) -> str: asse...
# -*- coding: utf-8 -*- from typing import Optional, Tuple import numpy from overloads import bind_checker, dyn_typing from overloads.shortcuts import assertNoInfNaN, assertNoNaN from overloads.typedefs import ndarray def noCheck(_: bool) -> None: pass def constraint_check( constraints: Tuple[ndarray, n...
# Copyright 2020 The PyMC Developers # # 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...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of command_runner module """ Versioning semantics: Major version: backward compatibility breaking changes Minor version: New functionality Patch version: Backwards compatible bug fixes """ __intname__ = 'tests.ofunctions.file_utils' __...
#!/usr/bin/env python3 # 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...
# Licensed to Elasticsearch B.V under one or more agreements. # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information import base64 import gzip import json from abc import ABC from typing import Sequence, Dict, Any, Optional def add_...
""" test_matrix =========== Tests for the scoring matrices of the `malign` package. """ # TODO: add test for identity matrix # TODO: add test for initialization only from sparse subdomain # TODO: add test providing domains # TODO: add, in general, tests where there is disagreement between scores/subm/domain # TODO: r...
import os import numpy as np import matplotlib.pyplot as plt import seaborn import sys keras_dir = '../../example/vgg16/keras/output/' cqt_dir = '../../example/vgg16/c_fix/output/' qp_file = '../../examplevgg16/c_fix/weight/' fix16mode = True def layer_dump(i, q, fnum = 3): """ 引数で指定されたレイヤーの、Keras出力と、コキュートス出...
import ast import os import sys from setuptools import ( find_packages, setup, ) def get_version(): path = os.path.join(os.path.dirname(__file__), 'threema', 'gateway', '__init__.py') with open(path) as file: for line in file: if line.startswith('__version__'): _, ...
# coding=utf-8 # Copyright 2021 DeepMind Technologies Limited. # # 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 applic...
import numpy as np import tensorflow as tf import h5py import json import re from .data import UnicodeCharsVocabulary, Batcher DTYPE = 'float32' DTYPE_INT = 'int64' class BidirectionalLanguageModel(object): def __init__( self, options_file, weight_file, use_charac...
""" .. codeauthor:: Your Name <your.name@ni.com> This module is responsible for uploading data and/or files to a given SystemLink service via HTTP operations. **Instructions** * If you're reading this from the template: * Create a copy of the _template folder and rename it to the name of your ...
# Copyright 2012 OpenStack Foundation # # 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...
from os.path import splitext import sys from msvcrt import getch import traceback class InvalidPatternException(Exception): def __init__(self, msg): super().__init__(msg) print('4K2Taiko v1.0.1') print('by Jakads\n') # need exactly one .osu file dragged in if len(sys.argv) != 2: print('drag single fi...
import gym from gym.spaces import Discrete, MultiDiscrete import numpy as np import tree from ray.rllib.utils.framework import try_import_tf tf1, tf, tfv = try_import_tf() def convert_to_non_tf_type(stats): """Converts values in `stats` to non-Tensor numpy or python types. Args: stats (any): Any (p...
# -*- coding: utf-8 -*- # The MIT License (MIT) - Copyright (c) 2016-2021 Dave Vandenbout. """ This package contains the handler functions for various EDA tools. """ from __future__ import ( # isort:skip absolute_import, division, print_function, unicode_literals, ) import os import os.path import ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file). """ Test Bar """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import prin...
""" MIT License Copyright (c) 2021 TheHamkerCat 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, copy, modify, merge, publish, ...
#!/usr/bin/python3 # # Copyright (c) 2013-2019 The Khronos Group 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...
# 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 ...
#! /usr/bin/env python3 # # Copyright 2018 California Institute of Technology # # 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...
''' OSPF Genie Ops Object Outputs for IOSXR. ''' class OspfOutput(object): ############################################################################ # OSPF INFO OUTPUTS ############################################################################ # 'show protocols afi-al...
from typing import Any, Dict, Protocol, Tuple from django.db import models from examples.models import Example from labels.models import Category, Relation, Span, TextLabel from projects.models import Project DATA = "data" class ExportedExampleManager(models.Manager): def confirmed(self, project: Project, user...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # "Tracking Bugs" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Tracking.html # Last change: 2021-05-12 17:37:52+02:00 # # Copyright (c) 2021 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University...
# -*- coding: utf-8 -*- import json import os import time from typing import Callable, Dict, NamedTuple, Union import yaml from attacut import logger log = logger.get_logger(__name__) class ModelParams(NamedTuple): name: str params: str class Timer: def __init__(self, name: str): self.name = ...
# jitsi shortcuts for keybow 2040 # based on the hid-keys-simple.py example by Sandy Macdonald # drop the keybow2040.py file into your `lib` folder on your `CIRCUITPY` drive. # NOTE! requires the adafruit_hid CircuitPython library also! import board from keybow2040 import Keybow2040 import usb_hid from adafruit_hid...
import requests import stickerify from credentials import CREDENTIALS from errors import NoFace AZURE_LINK = CREDENTIALS["AZURE_LINK"] def get_image_info(url): r = requests.post(AZURE_LINK + url) return r.json() def get_sticker_from_photo(url): image_info = get_image_info(url) if ('emotion' in imag...
class SpacingRenderMixin: def render(self, context, instance, placeholder): if not instance.space_device or instance.space_device == "xs": instance.add_classes( f"{instance.space_property}{instance.space_sides}-{instance.space_size}" ) else: instan...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and DMLC. # # 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 req...
from django.contrib import admin from .models import Item class ItemAdmin(admin.ModelAdmin): list_display = ['title', 'amount'] admin.site.register(Item, ItemAdmin)
import cv2 import numpy as np import argparse import csv import os import glob ap = argparse.ArgumentParser() ap.add_argument("-c", "--csv", help="Path to the CSV file holding the 2D data for the video.") ap.add_argument("-v", "--video", help="Path to the video file.") args = vars(ap.parse_args()) dir_name = args["cs...
# -*- coding: utf-8 -*- ''' 1つのLEDを点滅させるプログラム ''' import RPi.GPIO as GPIO import time PIN=10 #毎回するおまじない GPIO.setmode(GPIO.BCM) #GPIOのセットアップをBCMモード GPIO.setup(PIN,GPIO.OUT) #ピン10を出力するように設定 GPIO.output(PIN,GPIO.HIGH) # ピン10に電流を流す(HIGH) time.sleep(2) # 2秒待つ GPIO.output(PIN,GPIO.LOW) # ピン10に流れる電流を0にする(LOW...
from urllib.request import urlopen from urllib.request import FancyURLopener from bs4 import BeautifulSoup import pandas as pd import os import _proj_functions as proj import _lookups as lookups import re outdir = '../output' ##### cal ################# school = 'cal' url_template = 'http://calbears.com/roster.aspx?p...
__version__ = "3.1.3"
from typing import List from rich import box from rich.panel import Panel from rich.table import Table from vaccibot.models import AppointmentMatch # ----- Data ----- # COLUMNS_SETTINGS = { "CENTER": dict( justify="left", header_style="bold", style="bold", ), # no_wrap=True), "C...
from common import SushiError, read_all_text def parse_scxvid_keyframes(text): return [i-3 for i,line in enumerate(text.splitlines()) if line and line[0] == 'i'] def parse_keyframes(path): text = read_all_text(path) if '# XviD 2pass stat file' in text: frames = parse_scxvid_keyframes(text) el...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# -*- python -*- # Copyright (C) 2009-2020 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later versio...
# encoding: utf-8 """ Test suite for pptx.dml.line module """ from __future__ import absolute_import, print_function, unicode_literals import pytest from pptx.dml.color import ColorFormat from pptx.dml.fill import FillFormat from pptx.dml.line import LineFormat, LineStyle from pptx.enum.dml import MSO_FILL, MSO_LIN...
def _impl(ctx): # https://github.com/bazelbuild/rules_scala/pull/286/files ctx.actions.run( inputs = [ctx.attr.lib.java.outputs.native_headers], tools = [ctx.executable._zipper], outputs = ctx.outputs.outs, executable = ctx.executable._zipper.path, arguments = ["vxf", ctx...
from unittest.mock import patch import numpy as np import os import pytest import time import torch import torch.nn as nn import torch.distributed as dist from torch.utils.data import DataLoader import ray from ray import tune from ray.util.sgd.torch import TorchTrainer from ray.util.sgd.torch.training_operator import...
import ocl import pyocl import camvtk import time import vtk import datetime import math if __name__ == "__main__": print ocl.version() myscreen = camvtk.VTKScreen() a=ocl.Point(1,0,0) myscreen.addActor(camvtk.Point(center=(1,0,0), color=(1,0,1))); b=ocl.Point(0,1,0) myscreen.addActo...
# Copyright (c) 2016 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
import unittest as ut import comtypes.client from comtypes import COSERVERINFO from ctypes import POINTER, byref # create the typelib wrapper and import it comtypes.client.GetModule("scrrun.dll") from comtypes.gen import Scripting import comtypes.test comtypes.test.requires("ui") class Test(ut.TestCase): def tes...
from touchingperimeter import Rect def test_tl_inside(): assert sorted(Rect(2, 5, 12, 8).substracted(Rect(7, 6, 12, 8))) == [ Rect(2, 5, 12, 1), Rect(2, 5, 5, 8), ] def test_tr_inside(): assert sorted(Rect(5, 7, 13, 8).substracted(Rect(3, 9, 6, 18))) == [ Rect(5, 7, 13, 2), ...
# Generated by Django 2.2.10 on 2020-04-03 11:06 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('mindapp', '0030_auto_20200403_1527'), ] operations = [ migrations.AlterField( model_name='situ...
# -*- coding: utf-8 -*- import datetime import logging import os import random import time from tkinter import END import cv2 import numpy import numpy as np import pyautogui from PIL import ImageGrab from matplotlib import pyplot as plt pyautogui.FAILSAFE = False logging.basicConfig(format="%(asctime)s :%(levelname)...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import time import numpy import tensorflow as tf import jax.numpy as np from jax import jit, jacfwd, jacrev import time import numpy numpy.random.seed(0) @jit def model(x, layers): for i in range(len(layers)): x = np.dot(x, layers[i]) return x @ji...
''' Created on Dec 18, 2018 Tensorflow Implementation of Knowledge Graph Attention Network (KGAT) model in: Wang Xiang et al. KGAT: Knowledge Graph Attention Network for Recommendation. In KDD 2019. @author: Xiang Wang (xiangwang@u.nus.edu) ''' import argparse def parse_args(): parser = argparse.ArgumentParser(des...
""" MIT License Copyright (c) 2017 Roni Eliezer """ import logger import json import yaml class File(object): """ Implement a text file methods e.g.: read, write, etc... Args: file_path: full path to file """ #==========================================================...
import os import time import urllib import dsf def download_file(url, target_file, cwd=None, cache=360): with dsf.core.fs.pushd(cwd): # is the file too new to download? if os.path.isfile(target_file): details = os.stat(target_file) if details.st_mtime > time.time() - cache: return # download the fil...
import os import datetime from nose.exc import SkipTest from nose.tools import eq_ import mock from django.conf import settings import amo import amo.tests from addons import cron from addons.models import Addon, AppSupport from django.core.management.base import CommandError from files.models import File, Platform ...
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Redistrib...
from openslides_backend.permissions.management_levels import ( CommitteeManagementLevel, OrganizationManagementLevel, ) from tests.system.action.base import BaseActionTestCase class UserCreateActionTest(BaseActionTestCase): def permission_setup(self) -> None: self.create_meeting() self.use...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== # TODO: This does not work yet, need to figure out the right pattern. import numpy...
# Generated by Django 2.2.15 on 2020-08-22 01:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0005_auto_20200822_0053'), ] operations = [ migrations.AlterField( model_name='track', name='apple_music_id...
from PyQt5 import QtWidgets from PyQt5.QtWidgets import QApplication from gui_client.gui import MainWindow import constants import fire from gui_client.current_state import CurrentState from gui_client.gui_utils import ProgressDialog,show_info_dialog from gui_client.work_thread import InitDictThread from gui_client.gui...
from identifyPropositions import config def test_config_get_existing(): assert config.get("model_name") == "en_core_web_sm" def test_config_get_missing(): assert config.get("i_do_not_exist") is None
#!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NetCDF driver support. # Author: Frank Warmerdam <warmerdam@pobox.com> # ############################################################################### # Co...
from pathlib import PurePath from typing import Tuple, List, Callable import numpy as np from tensorflow.keras.utils import Sequence from imagededup.utils.image_utils import load_image class DataGenerator(Sequence): """Class inherits from Keras Sequence base object, allows to use multiprocessing in .fit_generat...
# -*- coding: utf-8 -*- from .misc import * def catlr(e_esp, Mp_esp, Mp_folga, ts_esp, polos_MA, zeros_MA, Kp_MA, gaindc, pos_polo_c=-0.01): """ e_esp : erro esperado em regime permanente Mp_esp : Overshoot máximo esperado Mp_folga : Folga dada ao overshoot maximo esperado ->...
import asyncio import pytest from hat.event import common import hat.event.client @pytest.mark.asyncio async def test_connect(create_event_server): backend_conf = {'module': 'hat.event.server.backends.dummy'} modules_conf = [] with create_event_server(backend_conf, modules_conf) as srv: srv.wait...
#!/usr/bin/env python3 #%% Plotting import matplotlib matplotlib.use('agg') import os import time import argparse import numpy as np import torch import torch.nn as nn import torch.optim as optim # Internal imports from utils.data import load_dataset, meta_pairs from models.basic import GatedMLP, GatedCNN, construct_e...
import sys import math TARGET_SCORE = 101 def simulate(shoots): rounds, throws, misses, score = 1, 0, 0, 0 prev_round_score = 0 prev_shot = '' for shot in shoots.split(): throws += 1 if 'X' in shot: misses += 1 score -= 20 if prev_shot == 'X': scor...
# -*- coding: utf-8 -*- from ogs5py import OGS model = OGS( task_root='Diff_HTO_test_root', task_id='Diff_HTO_test', output_dir='out', ) model.msh.read_file('Diff_HTO_test.msh') model.gli.read_file('Diff_HTO_test.gli') model.pcs.add_block( main_key='PROCESS', PCS_TYPE='LIQUID_FLOW', NUM_TYPE='N...
from netmiko import ConnectHandler # Key file is now encrypted cisco3 = { "device_type": "cisco_ios", "host": "cisco3.lasthop.io", "username": "testuser", "use_keys": True, "key_file": "~/.ssh/test_rsa_encr", "allow_agent": True, } with ConnectHandler(**cisco3) as net_connect: output = net...
# -*- coding: utf-8 -*- """Public section, including homepage and signup.""" from collections import Counter, defaultdict import operator import re import itertools import math from flask import Blueprint, flash, redirect, render_template, request, url_for from flask import current_app from nltk.corpus import stopwo...
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
from src.video.insertor import Inserter from src.helper.video_file import * if (__name__== "__main__" ): path = 'sample/video/ex3.avi' message_path = 'sample/text/short.txt' key = 'irfan' insert = Inserter(path, message_path, key) inserted_frames = insert.insert_message( is_encrypt = False...
import json import os from botocore.exceptions import ClientError from config.settings import Settings from modules.entities.account import Account from modules.entities.instance import Instance from modules.exceptions import exception from modules.models.instances import Instances from modules.models.owners import O...
from JumpScale import j from .Netconfig import Netconfig j.system.netconfig=Netconfig()
# -*- coding: utf-8 -*- """ pygments.lexers.resource ~~~~~~~~~~~~~~~~~~~~~~~~ Lexer for resource definition files. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, words from ...
# Copyright 2019 The KerasTuner Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
# -*- coding: utf-8 -*- """ Created on Sun Sep 23 2018 @author: Emily """ import http.server as https import logging import json import api_token def parseCeleryScript(contentDict): return None def apiHandleCeleryScript(httpHandler): requestContent = httpHandler.getRequestContent() logging.getLogger(...
#!/usr/bin/python # Copyright 2012 Google Inc. All Rights Reserved. """Sign bootloader/kernel image with RSA signature for secure boot. The signed image conforms to the header defined in repack.py. """ __author__ = 'smcgruer@google.com (Stephen McGruer)' import math from optparse import OptionParser import os impor...
from rest_framework.pagination import PageNumberPagination from rest_framework.response import Response class PageNumberPaginationDataOnly(PageNumberPagination): def get_paginated_response(self, data): return Response(data)
# ============================================================================= # imports # ============================================================================= import os import sys os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) t...
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, copy, modify, merge, publish, ...
import configparser from os import makedirs from os.path import exists from faasmcli.util.env import FAASM_CONFIG_FILE, FAASM_HOME def get_faasm_config(): if not exists(FAASM_HOME): makedirs(FAASM_HOME, exist_ok=True) config = configparser.ConfigParser() if not exists(FAASM_CONFIG_FILE): ...
# coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import pytest import platform import functools from azure.core.exceptions import HttpResponseError, ClientAuthenticationError from azure.core.credential...
import errno import queue import socket import sys import threading import time import asyncio import xml.etree.ElementTree as ET from . import log class ConnectionHandler: """Handles read and write operations to a given socket.""" def __init__(self, socket, address): """Accept the socket used for r...
# -*- coding: utf-8 -*- """ keyesext_compat ~~~~~~~~~~~~~~~ Implements the ``keyes.ext`` virtual package for versions of keyes older than 0.7. This module is a noop if keyes 0.8 was detected. Usage:: import keyesext_compat keyesext_compat.activate() from keyes.ext import ...
import spacy, numpy, random, pickle, pandas, sys import sklearn.neighbors as nbs from spacy.lookups import load_lookups MIN_PROB = -18 #load NLP tool spaCy print("Loading spaCy...") nlp=spacy.load("en_core_web_lg") print("spaCy loaded.") #load lexeme probability table lookups = load_lookups("en", ["lexeme_prob"]) n...
from setuptools import setup setup(name='popcorn', version='0.0.1', description='Tomographic reconstruction tools, phase_contrast and spectral imaging', url='https://github.com/DoctorEmmetBrown/popcorn', author='Emmanuel Brun', author_email='emmanuel.brun@inserm.fr', license='MIT', ...
# Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides classes to store, generate, and manipulate material interfaces. """ from itertools import product from typing import Iterator, Optional, Tuple, Union import numpy as np from scipy.linalg import polar ...
# -*- coding: utf-8 -*- # Copyright 2016 Jordi Sánchez # # 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...
import xml.etree.ElementTree as ET import json from urllib.request import urlopen data = urlopen('https://lenta.ru/rss').read().decode('utf8') root = ET.fromstring(data) news = [] for event in root.findall(r'./channel/item'): event_dict = {} for child in event: event_dict[child.tag] = child.text n...
import numpy as np import matplotlib.pyplot as plt from matplotlib import colors import gym from gym import spaces from gym.utils import seeding from gym_track2d.envs.generators import RandomMazeGenerator, RandomBlockMazeGenerator from gym_track2d.envs.navigator import Navigator, RamAgent class Track1v1Env(gym.Env): ...
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild from pkg_resources import parse_version import kaitaistruct from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO from enum import Enum import collections if parse_version(kaitaistruct.__version__) < parse_versi...
"""This module contains the general information for NfsMountInst ManagedObject.""" from ...ucsmo import ManagedObject from ...ucscoremeta import MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class NfsMountInstConsts: ADMIN_STATE_MOUNT = "mount" ADMIN_STATE_NONE = "none" ADMIN_STATE_REMOUNT = ...
import gym from gym_minigrid.minigrid import OBJECT_TO_IDX, COLOR_TO_IDX from multiprocessing import Process, Pipe def get_global(env, obs): # get global view grid = env.grid # position agent x, y = env.agent_pos # rotate to match agent's orientation for i in range(env.agent_dir + 1):...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
from __future__ import absolute_import, unicode_literals from django.utils.translation import ugettext_lazy as _ from mayan.apps.common.apps import MayanAppConfig from mayan.apps.common.classes import MissingItem from mayan.apps.common.html_widgets import TwoStateWidget from mayan.apps.common.menus import ( menu_...
import re from typing import Union from .validator import Validator, ValidationError, StopValidation class Boolean(Validator): true_types = (True, "true", 1, "1",) false_types = (False, "false", 0, "0") def __init__(self, message: Union[str, None] = None, parse: bool = True) -> None: self.parse =...
class BaseClient: def send_message(self, text=None, urls=None): pass @staticmethod def get_client_name(): pass def is_threadable(self) -> bool: pass def run_client(self, *args): pass def get_run_args(self): pass