text
stringlengths
6.04k
39.5k
"""Plot scalar and vector fields.""" from itertools import chain import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.patches as mpat from mpl_toolkits.axes_grid1 import make_axes_locatable from . import conf, phyvars, _helpers from .error import NotAvailableError from .stagy...
#-*-coding:utf-8-*- ''' DpCas-Light |||| ||||| |||| || ||||||| || || || || || || |||| || || || || || || || || || || || || || || || || ||====|| |||||| || || ||||| || || ||======|| || || || || |...
# Copyright 2022 Mithril Security. 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...
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
# -*- coding: utf-8 -*- # 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...
""" DB Benchmarking Application =========================== Main.py This file houses the core of the application, and is where all of the read/write commands are issued from, timed, and all data is analyzed. Results from the trials are printed to the console by default, and are also printed to a markdown file to kee...
#Dash components import dash import dash_html_components as html import dash_core_components as dcc import dash_bootstrap_components as dbc import dash_table from dash.dependencies import Input, Output #Graphing components import altair as alt import pandas as pd alt.data_transformers.disable_max_rows() #Disable max r...
import numpy as np import scipy from filters import SamplingFilter,s_exp def lpw(f=0,d=.5): p = 0 while 1: e1 = 1-p e2 = (d-p)%1 if e1 > e2: e1,e2 = e2,e1 v = (p<d) if e1<f: if e2<f: r = (e2-e1)/f else: ...
# Developed since: Sep 2015 import unittest import numpy from upy2.typesetting.numbers import get_position_of_leftmost_digit from upy2.typesetting.numbers import NumberTypesetter from upy2.typesetting.rules import LeftRule, RightRule, CentreRule from upy2.typesetting.scientific import \ TypesetNumberRule, Scientif...
import logging import datetime from fuzzywuzzy import fuzz, process from django.conf import settings from django.utils import timezone from pathlib import Path from backend.models import FacebookUser, Wiki, Push, Info from ..fb import (send_buttons, button_postback, send_text, quick_reply, send_generic, ...
import numpy as np from qtpy import QtGui, QtCore, QtWidgets import sharppy.sharptab as tab from sharppy.sharptab.constants import * import platform ## routine written by <NAME> ## <EMAIL> __all__ = ['backgroundFire', 'plotFire'] class backgroundFire(QtWidgets.QFrame): ''' Handles drawing the background fram...
#!/usr/bin/env python3 # ============================================================================== # Copyright (C) 2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # ============================================================================== from tools.build_utils import * # grappler related defa...
import os import h5py import numpy as np import torch import torch.utils.data as data from .base import BaseDataLoader from .utils import ProgressBar from .encodings import binary_search_array class Frames: """ Utility class for reading the APS frames encoded in the HDF5 files. """ def __init__(se...
""" Contains the MapView, which automatically grabs the correct tiles based on the current zoom level. """ import enum import functools import logging import os import multiprocessing.pool import queue import threading import PIL.Image import mercantile import numpy as np import vispy from vispy import scene from vis...
from argparse import ArgumentParser from mido import MidiFile import re import io from pico_connection import PicoConnection parser = ArgumentParser(description='Convert MIDI file for pico_player') parser.add_argument('infile', type=str, help='input midi file') parser.add_argument('-p', '--prioritize-channels', type=i...
_view='''[ "NAME:options", "MajorSize:=" , "10mm", "MinorSize:=" , "1mm", "MajorColor:=" , 16772075, "MinorColor:=" , 16774645, "ShowGrid:=" , True, "PageExtent:=" , [-0.1,-0.1,0.1,0.1], "background color:=" , 16777215, "DefaultToSketchMode:=" , False, "fillMode:=" , False, "DocVisibilityFlag:=" , 962...
''' Excited States software: qFit 3.0 Contributors: <NAME>, <NAME>, and <NAME>. Contact: <EMAIL> Copyright (C) 2009-2019 Stanford University 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 withou...
import os.path import torch import warnings import numpy as np import torch.nn as nn import torch.nn.functional as F from tqdm import tqdm from data import German from args import argument_parser from model import GCN, Encoder, Predictor, Classifier from utils import stat_parity_and_equal, sim_loss, sp2sptensor from...
import copy import warnings import weakref from collections import namedtuple from collections.abc import Mapping, MutableMapping, Sequence from typing import (Any, Callable, Dict, Iterable, List, NamedTuple, Optional, Tuple, Union) import torch from torch import Tensor from torch_sparse import Spa...
import argparse import getpass import json import io import os import sys import tarfile import traceback import shutil from collections import OrderedDict if sys.version_info[0] == 2: print("This script does not work in python2, please run with python3") sys.exit(1) from django.utils import timezone sys.pat...
# coding: utf-8 import os #import cPickle as pickle import pickle import numpy as np from nn1_stress_test import * from scipy import sparse import argparse parser = argparse.ArgumentParser(description='PyTorch test with the model from Sen') parser.add_argument("--seed", type=int, default=1) parser.add_argument("--nhi...
#!/bin/env python3 import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) import os import json import ast import re from ARAX_response import ARAXResponse sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/../NodeSynonymizer") from node_synonymizer import NodeSynonymizer sys.path...
# Developer: <NAME>; <EMAIL> # Botien Driver Installer # Botien Driver Installer Description # =================================== # Botien Driver Installer is a windows OS based software that saves you from that headache of installing device drivers manually # by automating the whole process fo you. You just ha...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License import re import numpy as np import warnings from monty.io import zopen from collections import defaultdict from pymatgen.electronic_structure.core import Spin, Orbital from pymatgen.io.vasp.outputs import Vas...
# -*- coding:utf-8 -*- ''' @file DFRobot_SCW8916B.py @brief Define the basic structure of the DFRobot_SCW8916B class and the implementation of the basic methods. @n Non-contact liquid level sensor python driver library for Raspberry Pi. @n Features: @n 1. Space detection thickness: <= 2mm. @n 2. Support tw...
import math import subprocess import threading import os import sys import time import pickle import numpy as np from itertools import product from .acc import pdt from ..utils.utils_pssm import sep_file, produce_all_frequency from ..utils.utils_words import convert_tng_to_fasta def pdt_profile(inputfile, n, lamada...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import os import torch from PIL import Image, ImageFile from torchvision import transforms import torchvision.datasets.folder from torch.utils.data import TensorDataset, ConcatDataset, Dataset from torchvision.datasets import MNIST, ImageFolder fro...
import time import numpy as np import matplotlib.pyplot as plt from joblib import Parallel, delayed import corner from astropy.io import fits ''' Assuming zero covariances between data, this script computes the bestfit/ 1dmax/mean/median parameter values for each pixel in the galaxy image. Maps are saved as numpy ar...
import logging import base64 import datetime as dt import http.cookies import ipaddress import os import time import socket import uuid from urllib.parse import urlparse, urlunparse from google.cloud import storage from pycurl import error as pycurl_error from apimetrics_agent import VERSION from .pycurl_wrapper import...
import tensorflow as tf from keras import backend as K from keras.models import Model from keras.layers import Conv2D, BatchNormalization, ReLU, DepthwiseConv2D, Activation, Input, Add, UpSampling2D, Concatenate from keras.layers import GlobalAveragePooling2D, Reshape, Dense, multiply, Softmax, Flatten # ** to updat...
# Copyright (c) Gorilla-Lab. All rights reserved. import os import h5py import numpy as np from typing import List, Union from torch.utils.data import Dataset from gorilla import to_float32, find_vcs_root _DEFAULT_H5_FOLDER = os.path.join(find_vcs_root(__file__), "data", "shapenet", "...
import argparse import subprocess import sys from simulation import get_launch_snippet from simulation import get_vehicle_pose from simulation import get_vehicle_pose_from_file from simulation import delete_model from simulation import spawn_model from simulation import VEHICLE_BASE_PORT, VEHICLE_TCP_BASE_PORT from si...
import json from base64 import b64encode from datetime import timedelta from urlparse import urlparse, parse_qs from django.contrib import messages from django.contrib.auth import get_user_model from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import resolve, reverse from django.h...
# # Copyright (c) nexB Inc. and others. All rights reserved. # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. # See https://github.com/nexB/scancode-toolkit for support or download. # See https://aboutcode.org for more in...
# Part of mcresources by <NAME> # Work under copyright. Licensed under MIT # For more information see the project LICENSE file from mcresources.type_definitions import Json, JsonObject, ResourceIdentifier, ResourceLocation, T, K, V, DefaultValue, MapValue, VerticalAnchor from typing import List, Tuple, Dict, Seque...
''' Project: games Created Date: Tuesday, January 29th 2019, 9:23:42 pm Author: <NAME> <<EMAIL>> ----- Copyright (c) 2019 TBD Do whatever you want ''' import sys import random import pygame from pygame.constants import K_UP, K_DOWN, K_SPACE from ple.games.utils.vec2d import vec2d #import base from ple.games.base.pyg...
# Copyright 2020 Xilinx 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,...
""" Job Submitter ------------- The ``job_submitter`` allows to execute a parametric study using a script mask and a `dictionary` of parameters to replace in this mask, from the command line. These parameters must be present in the given mask in the ``%(PARAMETER)s`` format (other types apart from string are al...
#!/usr/bin/env python3 version = 0.994 import sys, os, shelve, subprocess, time import curses #from time import sleep from picamera import PiCamera from picamera import Color os.system("clear") os.system("setleds -D +num") #resuls = subprocess.Popen(['fbset -s'], shell=True, stdout=subprocess.PIPE).communicate()[0...
import ray import cv2 import glob import yaml import lmdb import numpy as np import torch from torch.utils.data import Dataset from common.augmenter import augment from pathlib import Path from utils import filter_sem # CHANNELS = [ # 4, # Pedestrians # 6, # Road lines # 7, # Road masks # 8, # ...
import os import pprint import re import click import yaml from flask.cli import FlaskGroup from networkx import draw, has_path from g2p import make_g2p from g2p._version import VERSION from g2p.api import update_docs from g2p.app import APP, network_to_echart from g2p.exceptions import MappingMissing from g2p.log im...
# -*- coding: utf-8 -*- """ Created on Tue Feb 23 21:32:43 2021 @author: leyuan reference: https://github.com/ShangtongZhang/reinforcement-learning-an-introduction/blob/master/chapter02/ten_armed_testbed.py """ import matplotlib.pyplot as plt import numpy as np # ============= figure 2.1 ============== bandit_a...
""" R*-Tree implementation, as described in this paper: https://infolab.usc.edu/csci599/Fall2001/paper/rstar-tree.pdf """ import math from typing import List, TypeVar, Iterable, Callable, Any, Dict, Optional from ..rtree import RTreeBase, RTreeEntry, RTreeNode, DEFAULT_MAX_ENTRIES, EPSILON, EntryDivision, EntryOrderin...
import os import numpy as np import itertools import matplotlib as mpl mpl.use('agg') # order of magnitude faster than tkagg import matplotlib.pyplot as plt from fair_hmumu import defs mpl.rcParams['font.size'] = 13 def losses(losses, run_conf, loc, unique_id): # determine the training steps at which the losses...
import csv import logging import re import sys from collections import defaultdict, OrderedDict from contextlib import contextmanager from functools import partial from itertools import chain from six.moves.urllib.parse import unquote from couchdbkit.exceptions import ResourceNotFound from django.core.management impo...
import streamlit as st import json import requests import sys import os import pandas as pd import numpy as np import re import matplotlib.pyplot as plt import altair as alt from datetime import datetime as dt def black_marks(): return { 'config': { 'view': { 'height': 600, ...
""" Created on Thu Nov 7, 2019 @author: <NAME> """ import serial # `pyserial` package; NOT `serial` package import warnings import pandas as pd import numpy as np import time import os import sys from datetime import datetime try: from serial.tools import list_ports IMPORTED_LIST_PORTS = True except ValueE...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ **Project Name:** MakeHuman **Product Home Page:** http://www.makehumancommunity.org/ **Github Code Home Page:** https://github.com/makehumancommunity/ **Authors:** <NAME> **Copyright(c):** MakeHuman Team 2001-2019 **Licensing:** AG...
### # Copyright 2015-2021, Institute for Systems Biology # # 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...
# -*- coding: utf-8 -*- import sys import datetime import sys import re import pandas as pd import statistics def s_rim_calculator_us(df, expected_income_ratio, current_price): print("current_price = {}".format(current_price)) try: #print (df.loc[0]) bps = float(df.loc[2][1]) # Book-value ...
# -*- coding: utf-8 -*- import json import random from odoo import api, fields, models from odoo.exceptions import MissingError from odoo.tools.safe_eval import safe_eval class MusicPlaylist(models.Model): _name = "oomusic.playlist" _description = "Music Playlist" _inherit = ["oomusic.download.mixin"] ...
""" This module contains the |Experiment| class and associated helper functions. Public objects are imported in ``__init__.py``. """ import os import pickle import inspect from logging import getLogger from importlib import import_module from contextlib import contextmanager, ExitStack from datetime import datetime fr...
import math from unittest import TestCase from x7.geom import transform from x7.geom.transform import * from x7.geom.geom import * from x7.lib.annotations import tests from x7.geom.testing import TestCaseGeomExtended @tests(EmptyStackError) class TestEmptyStackError(TestCase): pass class TransformerDummy(Trans...
# -*- coding: utf-8 -*- import datetime import os import random import re import string import uuid from decimal import Decimal from mockups.helpers import get_mockup # backporting os.path.relpath, only availabe in python >= 2.6 try: relpath = os.path.relpath except AttributeError: def relpath(path, start=os....
# python3.7 """Contains the implementation of discriminator described in StyleGAN. Paper: https://arxiv.org/pdf/1812.04948.pdf Official TensorFlow implementation: https://github.com/NVlabs/stylegan """ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F __all__ = ['StyleGANDiscrim...
#!/usr/bin/env python3 """ sha2 - Pure Python implementation of SHA-2 family of secure hash algorithms MIT License Copyright (c) 2020 <NAME> 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 witho...
""" Wiki: https://wiki.axiodl.com/w/MREA_(Metroid_Prime_2) """ import copy import io import typing from enum import IntEnum from typing import Iterator, Optional import construct from construct import Struct, PrefixedArray, Int32ub, If, Aligned from construct.core import ( Array, Computed, Const, Enum,...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 <NAME> # # 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 ...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Utility methods related to string paths """ from __future__ import print_function, division, absolute_import import os import stat import string import shutil import logging import tempfile import traceback import contextlib from tpDcc.libs.python import name, fol...
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
""" This module contains a validator class that can be pointed at an OPTiMaDe implementation and validated against the pydantic models in this package. """ import time import requests import sys import logging import json import traceback from typing import Union from pydantic import ValidationError from starlette....
""" inference_utils.py Collection of helper methods to use for running inference on trained model. """ from __future__ import absolute_import, division, print_function, annotations import os import time from typing import Any from pathlib import Path from collections import namedtuple import tensorflow as tf impor...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal #...
#!/usr/bin/env python3 # tools/minidumpserver.py # # 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 Lice...
import torch import torch.nn as nn import torch.nn.functional as F from logging import getLogger from libcity.model.abstract_traffic_state_model import AbstractTrafficStateModel from libcity.model import loss import numpy as np import scipy.sparse as sp from scipy.sparse import linalg def sym_adj(adj): """Symmetr...
# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2022 Scipp contributors (https://github.com/scipp) # @file # @author <NAME> import platform import numpy as np import pytest import scipp as sc def representation_of_native_int(): if platform.system() == 'Windows': return sc.DType.int32 return...
#!/usr/bin/python3 # -*- coding: utf-8 -*- ##===-----------------------------------------------------------------------------*- Python -*-===## ## _ ## | | ## __| | __ ___ ___ ___ ## ...
# # Copyright 2019 The FATE 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 appli...
# Copyright 2021 Infoblox 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...
# Импорт import discord import asyncio import random import sqlite3 import datetime import requests import json from discord.ext import commands # Код class Fun(commands.Cog): def __init__(self, bot): self.bot = bot self._last_member = None self.cog_name = ["Фановые"] @commands.comman...
import logging import os.path as osp import queue import time from copy import deepcopy import cloudpickle import easy_tf_log import numpy as np from numpy.testing import assert_equal import tensorflow as tf import cv2 from drlhp.deprecated.a2c import logger from drlhp.deprecated.a2c.utils import (discount_with_dones...
import numpy as np import scipy as sp import scipy.linalg import numba import time from .tree import Tree import sys @numba.njit(parallel=True) def distribute(ucs, temp, pi, li, li2): for i in numba.prange(pi.size): if li[i] >= 0: ucs[li2[pi[i]]] = temp[li[i]] @numba.njit(parallel=True) def bu...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ECCO v4 Python: Utililites This module includes utility routines that operate on the Dataset or DataArray Objects .. _ecco_v4_py Documentation : https://github.com/ECCO-GROUP/ECCOv4-py """ from __future__ import division, print_function import numpy as np import ...
""" A minimalistic local planning environment, in which there is only one "corner" obstacle. """ from __future__ import division from __future__ import absolute_import import attr import numpy as np from bc_gym_planning_env.robot_models.tricycle_model import TricycleRobot from bc_gym_planning_env.robot_models.robot_d...
"""Database tools. """ import io import logging import os from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple, Union import skytools from .basetypes import Connection, Cursor __all__ = ( "fq_name_parts", "fq_name", "get_table_oid", "get_table_pkeys", "get_table_columns", "exists_schema", ...
import enum import functools import json import os import itertools import datetime import numexpr from PyQt5 import QtCore, QtWidgets from PyQt5.QtWidgets import QFileDialog, QLineEdit, QDialog import data2eeprom_ui import programming_ui from BootFormat import BootFormat from IntelHexExtended import IntelHex from da...
#!/usr/bin/env python import numpy as np import h5py import rospy import time # import tensorflow_model_is_gripping.aolib.img as ig, tensorflow_model_is_gripping.aolib.util as ut import cv2 import KinectB_hd from std_msgs.msg import Empty from sensor_msgs.msg import JointState class DataRecorder_TorqueController: ...
#!/usr/bin/python # coding=utf-8 import numpy as np from scipy.interpolate import Rbf import matplotlib.pyplot as plt import sys from math import pi, sqrt, degrees, acos import os import pandas as pd import warnings from scipy.constants import physical_constants from shapely.geometry import LineString, Point m_p = p...
# functions and fundamental values defined here! import matplotlib.pyplot as plt import numpy as np import pandas as pd from astropy.timeseries import LombScargle import lightkurve as lk from astropy.convolution import convolve, Box1DKernel # for boxcar smoothing from scipy.optimize import leastsq from lightkurve.c...
#!/usr/bin/python """ UpBack: synchronize (both ways) two filesystem branches using rclone, so that you can sync local and remote file systems on Amazon Cloud Drive, Google Drive, Dropbox, etc... """ import os import json import logging import collections import fnmatch from .rclone import RClone from .configuration ...
import random import logging from collections import namedtuple from multiprocessing.pool import ThreadPool, Pool import time from game.tichu.handcardsnapshot import HandCardSnapshot from .baseagent import DefaultAgent from ..cards import Card, Cards, ImmutableCards from ..tichu_actions import PassAction, Combinatio...
import sys,os import re from typing import Dict, List, Optional, Set, Callable from collections import defaultdict, Counter RE_TAGGING = re.compile(r'^(O|B(o|b(i[_~])+|I[_~])*(I[_~])+)+$') # don't support plain I and i STRENGTH = {'I_': '_', 'I~': '~', 'i_': '_', 'i~': '~', 'B': None, 'b': None, 'O': None, 'o': None}...
from typing import List, Tuple, Dict, Set from math import sqrt from random import shuffle, choice, sample, randint, uniform from copy import deepcopy from itertools import product import csp def construct_sudoku_problem(file_name: str) -> csp.ConstraintProblem: grid = _parse_sudoku(file_name) name_to_var_map...
import numpy as np import h5py import time import numexpr as ne import os from timeit import default_timer as timer from multiprocessing import Pool, cpu_count from .stripe_removal_original import remove_all_stripe as srm1 os.nice(60) h5fname_in = '/tomodata/tomobank/tomo_00001/tomo_00001.h5' chunks = 16 rot_center =...
""" PDBBind dataset loader. """ from __future__ import division from __future__ import unicode_literals import logging import multiprocessing import os import re import time import deepchem import numpy as np import pandas as pd import tarfile from deepchem.splits import Splitter from deepchem.utils import rdkit_ut...
import os from typing import List, Tuple, Union import urllib.parse try: import simplejson as json except ImportError: import json import ipywidgets as ipw import requests import traitlets from optimade.models import LinksResourceAttributes, LinksResource from optimade.models.links import LinkType from aiid...
import sys import argparse from collections import Counter, defaultdict import operator import itertools import warnings import traceback import os.path import multiprocessing import pysam import HTSeq class UnknownChrom(Exception): pass def invert_strand(iv): iv2 = iv.copy() if iv2.strand == "+": ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from collections import deque # import subprocess import re import pandas as pd import copy import os import numpy as np import pickle from pymatgen.core.structure import Structure import matplotlib.pyplot as plt from scipy.optimize import fsolve kB = 8.6173303E-5 # eV ...
import mock # for the mock.call method, importing it without a namespace breaks python3 import os import psycopg2 import shutil import unittest from six.moves import builtins from mock import Mock, MagicMock, PropertyMock, patch, mock_open from patroni.dcs import Cluster, Leader, Member from patroni.exceptions import...
"""Miscellaneous utilities""" # Python modules import os import uuid as uuid_module import sys import re # 3rd party imports import pkg_resources # Beware -- lots of other Vespa modules import this one. If you import # other Vespa modules here you will almost certainly create circular imports! # The _EOL_REGEX mat...
import datetime import logging import os import json from google.appengine.api import taskqueue from google.appengine.ext import ndb from google.appengine.ext import webapp from google.appengine.ext.webapp import template from consts.district_type import DistrictType from consts.event_type import EventType from da...
import argparse import ast import importlib.util import os import sys import time from collections import OrderedDict import googletrans SRC_DIR = os.path.join(os.path.split(os.path.abspath(sys.path[0]))[0], 'src') LNG_DIR = os.path.join(SRC_DIR, 'languages') DST_FILE = os.path.join(LNG_DIR, 'ru.py') EXT = '.py' WALK...
"""Tests of the transform module.""" from array import array import logging from affine import Affine import pytest import numpy import rasterio from rasterio import transform from rasterio.env import GDALVersion from rasterio.transform import ( get_transformer, xy, rowcol, AffineTransformer, G...
import pdb from tqdm import tqdm import types from itertools import combinations, permutations from scipy.spatial.distance import cosine import numpy as np from numpy.linalg import norm from numpy.random import shuffle, choice from numpy.testing import assert_array_equal import pandas as pd from matplotlib import py...
mat = [[0 for x in range(9)] for y in range(9)] correct = [[0 for x in range(9)] for y in range(9)] notes = [[[0 for z in range(10)] for x in range(9)] for y in range(9)] line_borders_3x3 = [[0 for x in range(9)] for y in range(9)] column_borders_3x3 = [[0 for x in range(9)] for y in range(9)] def add_...
# Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # import collections import copy import editdistance import logging import numpy as np import os import string import subprocess # nosec import tempfile from mmcv.utils import print_log from pycocotools.cocoeval import COCOeval from tqdm...
# Copyright (C) 2013 Google 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 conditions and the ...
import json import os import pickle import random import numpy as np import pandas as pd from scipy.stats import truncnorm from forecasting.utils import map_to_date, split_historic_forecast from hospital.people import Patient DIRNAME = os.path.dirname(__file__) _MAP_SPECIALTIES = { "Trauma & Orthopaedic": "tra...
# -*- coding: UTF-8 -*- """ .. --------------------------------------------------------------------- ___ __ __ __ ___ / | \ | \ | \ / the automatic \__ |__/ |__/ |___| \__ annotation and \ | | | | \ ...
# # Copyright 2021 Splunk 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...