text
stringlengths
3.07k
12.6k
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# Copyright (c) OpenMMLab. All rights reserved. """Check out backbone whether successfully load pretrained checkpoint.""" import copy import os from os.path import dirname, exists, join import pytest from mmcv import Config, ProgressBar from mmcv.runner import _load_checkpoint from mmdet.models import build_detector ...
from io import BytesIO import html from time import sleep from typing import Optional, List from telegram import TelegramError, Chat, Message from telegram import Update, Bot from telegram.error import BadRequest from telegram import ParseMode from telegram.ext import MessageHandler, Filters, CommandHandler from telegr...
"""The tests for the Demo Media player platform.""" import unittest import soco.snapshot from unittest import mock import soco from homeassistant.components.media_player import sonos from tests.common import get_test_home_assistant ENTITY_ID = 'media_player.kitchen' class socoDiscoverMock(): """Mock class for ...
# -*- coding: utf-8 -*- """Optimal Control Pulse Design functions. """ from sigpy import backend from sigpy.mri.rf import slr import numpy as np __all__ = ['optcont1d', 'blochsim', 'deriv'] def optcont1d(dthick, N, os, tb, stepsize=0.001, max_iters=1000, d1=0.01, d2=0.01, dt=4e-6, conv_tolerance=1e-5):...
import numpy as np import spacy import re import ujson as json from statistics import mean from tqdm import tqdm from math import ceil, floor from collections import Counter from args import get_setup_args from utils import data_importer, get_logger def obj_cleaner(obj, counter): ret = [] for line in tqdm(obj...
# Copyright 2013 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. import logging import os import sys _BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) _FIND_RUNTIME_SYMBOLS_PATH = os.path.join(_BASE...
import pandas as pd import numpy as np from PIL import Image, ImageDraw import math import copy from shapely.ops import transform from shapely.geometry import mapping, Polygon, box, shape from skimage.transform import resize from skimage import io, filters, measure, color, morphology from scipy import ndimage from scip...
import regex from itertools import zip_longest from common import bilarasortkey class Num: """ >>> Num(1) Num('1') >>> Num('2a') Num('2a') >>> Num('1-10') Num('1-10') >>> Num('1') - Num('0') Num('1') >>> Num('2a') - Num('1') Num('1') >>> Num('1-10') - Num('0') ...
import signal import pytest import trio from .. import _core from .._util import signal_raise from .._signals import open_signal_receiver, _signal_handler async def test_open_signal_receiver(): orig = signal.getsignal(signal.SIGILL) with open_signal_receiver(signal.SIGILL) as receiver: # Raise it a ...
from __future__ import annotations import discord from datetime import datetime from discord.ext import commands from re import compile, finditer, search from typing import List, Union, Optional, TYPE_CHECKING if TYPE_CHECKING: from kurisu import Kurisu class Season: def __init__(self, start:...
from flask import Flask from flask import render_template from flask import url_for from flask import request from flask import redirect from flask import session from flask_bootstrap import Bootstrap import sqlite3 as sql app = Flask(__name__) # Creates the secret key, should be more secure in production. app.sec...
"""This component provides HA sensor support for Ring Door Bell/Chimes.""" from __future__ import annotations from dataclasses import dataclass from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, ) from homeassistant.const import PERCENTAGE, SIGNAL_STREN...
""" Author: <NAME> License: GPL v3.0\n\n Description: This script will use SWORD to align the assembled contigs from previous step against database of choice from following options 1. Md5nr https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-13-141 and eggNOG annotation http://eggnogdb.embl.de/#/a...
import os import logging import sys from collections import OrderedDict import datetime import cartosql import requests # Constants LATEST_URL = 'https://backend.idmcdb.org/data/idus_view_flat' MIN_PAGES = 15 MAX_PAGES = 400 CLEAR_TABLE_FIRST = True CARTO_TABLE = 'soc_062_internal_displacement' CARTO_SCHEMA = Ordere...
from enum import Enum from queue import Queue, Empty import itertools import operator import numpy as np def input_(stdin): return stdin def output_(input_value): return input_value def jump_if_true(condition, target): if condition != 0: return target else: return None def jump_...
# pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103,W0612 from __future__ import absolute_import, division, print_function import pytest from mock import MagicMock from ..client import Client, BasicClient from ..data import Data from ..data_collection import DataCollection from ..hub import Hub from ..subset impor...
# -*- coding: utf-8 -*- # # Copyright (c) 2017, the cclib development team # # This file is part of cclib (http://cclib.github.io) and is distributed under # the terms of the BSD 3-Clause License. """Test logfiles related to basis sets""" import os import unittest from skip import skipForParser __file...
"""Test XonshLexer for pygments""" import pytest from pygments.token import ( Keyword, Name, String, Error, Number, Operator, Punctuation, Text, Literal, ) from tools import skip_if_on_windows from xonsh.pyghooks import XonshLexer, Color, XonshStyle, on_lscolors_change from xonsh....
#!/usr/bin/python # # Copyright 2018-2020 Polyaxon, 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 ...
import math from datetime import datetime, timedelta from flask import Blueprint from sqlalchemy import or_ from anubis.lms.autograde import autograde, bulk_autograde, bulk_regrade from anubis.lms.courses import assert_course_context from anubis.lms.submissions import init_submission from anubis.models import Assignm...
import os from scipy.io import loadmat import numpy as np import pandas as pd import torch from sklearn.model_selection import train_test_split from datasets.SequenceDatasets import dataset from datasets.sequence_aug import * from tqdm import tqdm from itertools import islice #Digital data was collected...
"""Demo parallel sorting, with no secrecy. This demo shows how parallel computation can be seen as a special case of secure multiparty computation. By setting the threshold for the number of corrupt parties equal to 0, each share of a secret will effectively be a copy of the secret. Hence, the MPyC protocols will not ...
import logging import os import random import discord logger = logging.getLogger('bot') bot_invite_url = "https://discord.com/api/oauth2/authorize?client_id=944989207665967124&permissions=309237738560&scope=bot" bot_repo_url = "https://github.com/shadytradesman/contract-bot" DEFAULT_TOKENS = { "prefix": "!!", "ro...
# -*- coding: utf-8 -*- # Copyright 2020 CERN # # 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...
import json import time import mangadex_py.http as http api_url = "https://api.mangadex.org/chapter/" api_url_manga = "https://api.mangadex.org/manga/" api_url_home = "https://api.mangadex.org/at-home/server/" chapters_fetched, base_url, chapters_images, images_links = list(), str(), list(), list() avail_vol, avail_la...
from .header import * from .base import RetrievalBaseAgent class BERTRetrieval(nn.Module): def __init__(self, model='bert-base-chinese'): super(BERTRetrieval, self).__init__() self.model = BertForSequenceClassification.from_pretrained(model, num_labels=2) def forward(self, inpt, token_type_id...
""" Pydemic Calc Application ======================== This is the main application in the Pydemic UI package. It consists of an epidemic calculator that allows user to choose some region and configure basic epidemiological parameters to make scenarios about how the epidemic spreads in the near future. This app uses c...
"""Commutation functions and actuarial notations The ``LifeTable`` Space provides commutation functions and actuarial notations, such as :math:`D_{x}` and :math:`\\require{enclose}{}_{f|}\\overline{A}_{x}`. Mortality tables are read from *input.xlsx* into an `ExcelRange`_ object. The `ExcelRange`_ object is bound to a...
import wgconfig import wgconfig.wgexec as wgexec import argparse import os.path import json import pandas as pd import subprocess import qlogging log=qlogging.get_logger(level='info') import pydantic import ipaddress import typing import pathlib class WgOpts(pydantic.BaseModel): class Config: validate_al...
# Copyright (c) 2019 SwiftStack, 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 w...
from __future__ import unicode_literals import logging import django.contrib.postgres.fields import mesos_api.api as mesos_api from django.core.exceptions import ValidationError from django.db import models, transaction from django.utils.translation import ugettext as _ from mesos_api.api import MesosError from queu...
# Copyright 2021 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style liense that can be # found in the LICENSE file. """Some utilities for concurrency.""" from collections import deque import contextlib import logging import multiprocessing import sys import threading import...
import numpy as np import meshio from paraview.util.vtkAlgorithm import ( VTKPythonAlgorithmBase, smdomain, smhint, smproperty, smproxy, ) from vtkmodules.numpy_interface import dataset_adapter as dsa from vtkmodules.vtkCommonDataModel import vtkUnstructuredGrid paraview_plugin_version = meshio.__...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible 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 ...
# # Copyright (c) 2021 The GPflux 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 # # Unless required by applicable law or agr...
import heapq import torch import copy from tqdm import tqdm from helper import indexes2sent import numpy as np from metrics import Metrics class BeamNode(): def __init__(self, cur_idx, prob, decoded): self.cur_idx = cur_idx self.prob = prob self.decoded = decoded self.is_finished = F...
# Re-implementation of the old Minecraft auth protocol, as a HTTP proxy server. # Currently only works with clients using Microsoft accounts. import socketserver import http.server import urllib.request import urllib.parse import requests import sqlite3 import traceback import sys import threading database = None serv...
from __future__ import absolute_import, unicode_literals import mock import pytest from six import string_types from arango.database import BatchDatabase from arango.exceptions import ( DocumentInsertError, BatchExecuteError, BatchJobResultError, BatchStateError ) from arango.job import BatchJob from ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <<EMAIL>> # # This file is part of Ansible # # Ansible 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 Softwar...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ____ __ __ # /\ _`\ /\ \__/\ \ # \ \ \L\ \__ __\ \ ,_\ \ \___ ___ ___ # \ \ ,__/\ \/\ \\ \ \/\ \ _ `\ / __`\ /' _ `\ # \ \ \/\...
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. #-----------------------------------------------------...
# -*- coding: utf-8 -*- __author__ = 'ZFTurbo: https://kaggle.com/zfturbo' import numpy as np import gzip import os import glob import time import cv2 import pandas as pd import random from PIL import Image random.seed(2017) np.random.seed(2017) NUM_OF_IMAGES_FROM_TRAIN = 318 INPUT_PATH = '../input/' OUTPUT_PATH = '...
# -*- coding: utf-8 -*- import numpy as np import os # import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.patches as patches SVDSLOGO = plt.imread(os.path.join(os.path.dirname(__file__), 'logo-plot.png')) WIDE=(12, 8) WIDER=(15, 8) import seaborn as sns sns....
"""This module defines the envelope used to wrap asynchronous messages to be sent to a remote MHS.""" import copy from typing import Dict, Tuple, Any, Optional, NamedTuple from xml.etree.ElementTree import Element import utilities.message_utilities as message_utilities from utilities import integration_adaptors_logger...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
#!/usr/bin/env python3 # This script is included in documentation. Adapt line numbers if touched. import arbor import pandas, seaborn from math import sqrt # Run with srun -n NJOBS python network_ring_mpi.py # Construct a cell with the following morphology. # The soma (at the root of the tree) is marked 's', and # t...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # The MIT License # # Copyright (c) 2016 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Soft...
# # Copyright (c) 2022, 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 copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# Owner(s): ["oncall: distributed"] import sys from enum import Enum import torch import torch.nn as nn import torch.optim as optim from torch import distributed as dist from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.nn.parallel import DistributedDataParallel from torch.testing._intern...
#!/usr/bin/python import datetime, bisect def parse_timestamp(raw_str): tokens = raw_str.split() if len(tokens) == 1: if tokens[0].lower() == 'never': return 'never'; else: raise Exception('Parse error in timestamp') ...
from django.shortcuts import render from restaurant.utils import get_compliant_restaurant_list from restaurant.utils import ( get_filtered_restaurants, restaurants_to_dict, ) from user.models import Review, UserActivityLog, Preferences import logging import heapq from datetime import datetime from itertools im...
# Copyright (c) 2016-2021, <NAME> # 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 the foll...
from __future__ import print_function import json, urllib, sys if sys.version_info[0] < 3: from urllib import urlopen, getproxies from urllib2 import HTTPError input = raw_input else: from urllib.error import HTTPError from urllib.request import urlopen, getproxies from os.path import isfile from robinhoo...
"""Evaluating a trained model on the test data """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import datetime import math import time import os import numpy as np import tensorflow as tf import argparse import arch import data_loader impo...
""" Helper functions for automatically setting up computer & code. Helper functions for setting up 1. An AiiDA localhost computer 2. A "diff" code on localhost Note: Point 2 is made possible by the fact that the ``diff`` executable is available in the PATH on almost any UNIX system. """ import tempfile import shu...
import numpy as np import pandas as pd import os import cv2 from tqdm import tqdm import torch.nn as nn import torch.nn.functional as F from torchvision import transforms from torch.utils.data import Dataset, DataLoader import torch from efficientnet_pytorch import EfficientNet import pickle import pydicom import glob ...
# Copyright 2011 OpenStack Foundation # Copyright 2011 <NAME> # 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/LICENS...
''' Code taken from Transformer-XL https://github.com/kimiyoung/transformer-xl ''' import torch from torch import nn import numpy as np class LogUniformSampler(object): def __init__(self, range_max, n_sample): """ Reference : https://github.com/tensorflow/tensorflow/blob/r1.10/tensorflow/python/op...
import inspect import sys as _sys import time import traceback as _traceback from collections import defaultdict from functools import partial from hypernets.conf import configure, Configurable, Dict, String, Bool from . import logging _LOG_LEVEL = 'info' _VALUE_LEN_LIMIT = 10 _COLLECTION_LIMIT = 5 _TIC_TOC_TAG = 't...
#!/usr/bin/env python import sys, os, inspect, argparse, shutil, subprocess from natsort import natsorted currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) import lib.library as lib from Bio import SeqIO #setup m...
import tempfile import os import shutil from keystoneauth1.identity import v3 as keystonev3 from keystoneauth1 import session as keystonesession from osvimdriver.openstack.heat.driver import HeatDriver from osvimdriver.openstack.heat.template import HeatInputUtil from osvimdriver.openstack.neutron.driver import Neutron...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Implementation by <NAME>, # hereby denoted as "the implementer". # # To the extent possible under law, the implementer has waived all copyright # and related or neighboring rights to the source code in this file. # http://creativecommons.org/publicdomain/zero/1.0/ ...
"""Tests Constant.py """ import json import unittest from unittest import mock from unittest.mock import sentinel from requests.exceptions import HTTPError from tridentweb.constant import Constant def mocked_requests_get(*args, **kwargs): """Defines a response suitable for mocking requests responses.""" clas...
# -*- coding: utf-8 -*- """ Various utility functions Note: This was more or less copied over from Spotlight """ import logging import numpy as np from scipy.sparse import coo_matrix from scipy.stats import kendalltau, spearmanr, normaltest import torch _logger = logging.getLogger(__name__) def is_cuda_available(...
"""DryDock cluster specification.""" from .templates import render_nginx_config, TEMPLATES from six.moves.urllib.request import urlopen import yaml class Container(object): """A docker container specification.""" def __init__(self, name, base="ubuntu", exposed_ports=None, external=True, http_...
# Copyright 2015 Observable Networks # # 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 ...
""" Name: ILUT2SQL_bcp.py Purpose: Uses python wrapper for BCP to use Microsoft BCP (bulk copy program) command-line utility to load TSV and CSV ILUT tables into SQL server. NOTE - using this script requires the following installations: -BCP utility, downloadable from https://docs.microsoft.com/en-us/sql/tools/bcp...
import sys import os, os.path import urllib.request import json import shutil import platform import hashlib CONFIG = { "install_path": "./pkg", "catalog_url": "http://txlyre.ml/files/loli/pkg/catalog.json", } CONFIG["catalog_path"] = os.path.join(CONFIG["install_path"], "catalog_local.json") if not...
import os import json import subprocess from hashlib import sha1 import sublime import sublime_plugin package_url = "https://github.com/sptndc/sublime-grunt" class GruntRunner(object): def __init__(self, window): self.window = window self.list_gruntfiles() def list_tasks(self): try:...
# added for application code version: import bottle from bottle import request, route, run import json from math import sqrt import math from random import randint, random from time import time # configure global players, loc, vel, s0, s1, torew, torns = [], [], [], 200, 500, 1000, 1000 # time of last location call ...
# Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import numpy as np import urllib.request from torch import tensor from fastai.metrics import accuracy, error_rate from fastai.vision import ( cnn_learner, DatasetType, ImageList, imagenet_stats, ...
# Copyright © 2022 Intel Corporation. # # This software and the related documents are Intel copyrighted # materials, and your use of them is governed by the express # license under which they were provided to you (License). Unless # the License provides otherwise, you may not use, modify, copy, # publish, distribute...
#!/usr/bin/env python3 test_words = [ ["mistranslate", "mis-trans-late"], ["alphabetical", "al-pha-bet-i-cal"], ["bewildering", "be-wil-der-ing"], ["buttons", "but-ton-s"], ["ceremony", "cer-e-mo-ny"], ["hovercraft", "hov-er-craft"], ["lexicographically", "lex-i-co-graph-i-cal-ly"], ["...
import os import pandas as pd from datetime import datetime, timedelta import geopandas as gpd import numpy as np import itertools def sanitise_time(time, gtfs_day='19700101'): time_list = time.split(':') if int(time_list[0]) >= 24: days = int(time_list[0]) // 24 time_list[0] = int(time_list[0...
#!/usr/local/bin/python3 # next to lines are required for GUI file pickers import tkinter as tk from tkinter import ttk, filedialog # this is the brains of the operation # import Python_Resources.html_chunk_tool_cmd as cmd_version import Python_Resources.html_chunk_tool_cmd_with_class_warning as cmd_version # workin...
#!/usr/bin/env python # -*- coding: utf-8 -*- """APRS Class Definitions""" __author__ = '<NAME> <<EMAIL>>' __license__ = 'Apache License, Version 2.0' __copyright__ = 'Copyright 2015 Orion Labs, Inc.' import logging import logging.handlers import socket import threading import kiss import pynmea2 import requests i...
"""Test that analytical and numerical optical depth calculations agree. Also reproduces a figure from Griffiths et al. astro-ph/9812125v3 (don't use the published version, which contains errors). """ from __future__ import absolute_import, division, print_function import math import numpy import numpy.testing.utils...
# Copyright 2019 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
"""OctreeIntersection class. """ from typing import List, NamedTuple, Tuple import numpy as np from .octree_chunk import OctreeChunk from .octree_level import OctreeLevel from .octree_util import OctreeDisplayOptions class OctreeView(NamedTuple): """A view into the octree. Attributes ---------- cor...
#!/usr/bin/env python3 import subprocess import pyinotify import os import json import time import requests import sys from collections import UserDict import base64 import zlib import pprint wm = pyinotify.WatchManager() mask = pyinotify.IN_CREATE API = '' class ProblemReport(UserDict): def __init__(self, ty...
"""Module for testing seqrepo access class""" import pytest from uta_tools.data_sources import SeqRepoAccess @pytest.fixture(scope="module") def test_seqrepo_access(): """Create SeqRepoAccess test fixture""" return SeqRepoAccess() def test_get_reference_sequence(test_seqrepo_access): """Test that get_r...
import better_exceptions import click from titlecase import titlecase from prompt_toolkit import prompt from tinydb import Query from lilyskel.info import Composer from lilyskel.exceptions import MutopiaError from lilyskel import db_interface from lilyskel.interface.common import * @click.group() @click.option("-p"...
# Copyright 2020 The Bazel 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 la...
#------------------------------------------------------------- # Name: Export Metadata # Purpose: Exports all metadata in a geodatabase out to a text file. # Author: <NAME> (<EMAIL>) # Date Created: 30/06/2014 # Last Updated: 30/06/2014 # Copyright: (c) Eagle Technology # ArcGIS Version: 10.1+ # ...
from itertools import starmap, islice from ringity.methods import draw_diagram from ringity.exceptions import SchroedingersException, TimeParadoxError, BeginningOfTimeError import warnings import numpy as np # ============================================================================= # -------------------------...
# Copyright (c) 2018 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. """Helper library for defining XMethod implementations on C++ classes. Include this library and then define python implementations of C++ methods using ...
""" I/O-modul til håndtering af regneark """ from functools import partial from typing import ( Any, Optional, Union, Mapping, List, Mapping, Union, Callable, BinaryIO, ) import pandas as pd from fire.api.model.punkttyper import ( Koordinat, Punkt, ObservationstypeID,...
#<NAME> #Unit 15 Pygame Controls #ICS4U #Mr. Trink #Date Submitted: 15/06/2017 #imports the pygame and serial libraries import pygame import serial #open the serial port for serial communication #ser = serial.Serial('/dev/ttyUSB0', 9600) ser = serial.Serial("COM5", 9600) #initialize the pygame module...
import os import itertools from glob import glob from django.http import HttpResponse, JsonResponse, HttpResponseNotAllowed, HttpResponseServerError, HttpResponseBadRequest, HttpResponseNotFound from collections import namedtuple from django.shortcuts import render import shutil import tempfile import subprocess from d...
""" ECCV Pix2Surf Initialization with Neurips NOX training """ from .modelbase_v2 import ModelBase from .modelbase_v2 import Network as NetBase from core.net_bank.xnocs_segnet import SegNet from core.net_bank.loss import MaskL2Loss import os import torch from torch import nn class Model(ModelBase): def __init__(...
from typing import List, Any import math from sklearn.preprocessing import RobustScaler import pandas as pd from auto_causality.memoizer import MemoizingWrapper def clean_config(params: dict): if "subforest_size" in params and "n_estimators" in params: params["n_estimators"] = params["subforest_size"] *...
# -*- coding: utf-8 -*- ''' Management of Solaris RBAC :maintainer: <NAME> <<EMAIL>> :maturity: new :depends: rbac_solaris,solaris_user :platform: solaris,illumos .. versionadded:: 2016.11.0 .. code-block:: yaml sjorge: rbac.managed: - roles: - netcfg - profi...
""" Collect data about ceph nodes""" import enum import logging from typing import Dict, cast, List, Set from cephlib import discover from cephlib.discover import OSDInfo from cephlib.common import to_ip from cephlib.node import NodeInfo, IRPCNode from cephlib.ssh import ConnCreds, IP, parse_ssh_uri from cephlib.node_i...
# Functions that handle the form go here import discord import os import json import globals from bot_validation import validate_response # Description: Fetches the current question to create an embedded question message def get_question(cur_index, user_id): user_index = globals.trackers[user_id]["response_index...
from girder_client import GirderClient from docker import DockerClient, APIClient from gwvolman.utils import ContainerConfig import mock import girder_worker import os from gwvolman.tasks import build_tale_image class MockVolume: @property def id(self): return "abc" def remove(self): ret...
# -*- coding: utf-8 -*- """ @brief test log(time=21s) """ import unittest import warnings from logging import getLogger from typing import Any import numpy from sklearn.preprocessing import FunctionTransformer from pyquickhelper.pycode import ExtTestCase, ignore_warnings from mlprodict.onnx_conv import register_re...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import numpy as np import tensorflow as tf import lib.graphprot_dataloader, lib.rna_utils from Model.Joint_ada_sampling_model import JointAdaModel from lib.general_utils import Pool import multiprocessing as mp import pandas as pd tf.logging.set_verbosity(tf.logging.F...
########################################################################### ##file: createWorld_BW.py ##Author: <NAME>, <NAME>, Dr. Rieksts ## *code adapted from Dr. Rieksts "Blocks World" is notated by an (*) ## ##Dependencies: py2neo.py ## ##This file contains all methods to create a blocksWorld(n) config...