text
stringlengths
6.04k
39.5k
#License #------- #This code is published and shared by Numato Systems Pvt Ltd under GNU GPL #license with the hope that it may be useful. Read complete license at #http://www.gnu.org/licenses/gpl.html or write to Free Software Foundation, #51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #Simplicity and un...
from copy import copy, deepcopy from datetime import datetime import numpy as np from opentamp.src.policy_hooks.sample import Sample from opentamp.src.policy_hooks.utils.policy_solver_utils import * class MixedPolicy: def __init__(self, pol, dU, action_inds, state_inds, opt_traj, opt_strength): self.pol ...
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) import six __license__ = 'GPL v3' __copyright__ = '2020, <NAME>, 2011, <NAME> <<EMAIL>>' __docformat__ = 'restructuredtext en' import logging logger = logging.getLogger(__name__) fr...
# 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 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...
import numpy as np from collections.abc import Iterable from .pulsar import profile_stat, fold_events, z_n, pulse_phase from ..utils import jit, HAS_NUMBA from ..utils import contiguous_regions from astropy.stats import poisson_conf_interval import matplotlib.pyplot as plt __all__ = ['epoch_folding_search', 'z_n_sea...
#!/bin/env python3 from __future__ import print_function from os import listdir from os.path import isfile, join import datetime import os.path import sys import glob import subprocess import hashlib # https://github.com/fedora-modularity/libmodulemd/blob/master/spec.v2.yaml # We need a module.yaml file that we pass...
import os import csv import json import torch import signal import argparse import datetime import numpy as np from multiprocessing import Process, Manager # Some self-defined functions that need to be imported import dataset from model import MLDL_model from loss import MLDL_Loss from utils import * os.environ["CUDA...
import abc import inspect import json import os import multiprocessing import time import numpy as np import pandas as pd import tensorflow as tf2 from tqdm import tqdm from ..feature import features_from_batch_data from ..utils.tf_ops import modify_variable_names from ..utils.misc import time_block, colorize from ..ut...
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2022. # # 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 derivat...
# # Copyright 2018 Analytics Zoo 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 applicable law or agreed to...
############################################################################### # WaterTAP Copyright (c) 2021, The Regents of the University of California, # through Lawrence Berkeley National Laboratory, Oak Ridge National # Laboratory, National Renewable Energy Laboratory, and National Energy # Technology Laboratory ...
import json import tempfile import zipfile from collections import namedtuple from csv import DictWriter from datetime import datetime, timedelta from itertools import groupby from io import StringIO from flask import abort, jsonify, make_response from sqlalchemy.sql import ( and_, between, cast, func, literal, ...
import json import re from datetime import datetime, timezone from functools import lru_cache import logging import os import dataclasses import urllib from jira import JIRA from .entities import Issue, Comment, User, Source, Metadata, CommentMetadata from . import utils __all__ = ["Client", "Formatter", "get_usern...
""" 此模块主要提供了 `CQHttp` 类(类似于 Flask 的 `Flask` 类和 Quart 的 `Quart` 类);除此之外,还从 `message`、`event`、`exceptions` 模块导入了一些常用的类、模块变量和函数,以便于使用。 """ import asyncio import hmac import logging import re from typing import (Dict, Any, Optional, AnyStr, Callable, Union, Awaitable, Coroutine) try: import ujson ...
#!/usr/bin/python # Copyright (c) 2017, 2020 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """Global plugin registry.""" # Standard library imports import logging from typing import Dict, List, Union, Type, Any, Set, Optional, Tuple # Third-party library ...
import numpy as np import pandas as pd from PIL import Image from tqdm import tqdm import os import re from glob import glob import yaml import gdal from shapely.geometry import LineString, MultiLineString from skimage.morphology import skeletonize from scipy import ndimage from scipy.spatial import cKDTree from shape...
# LIBTBX_SET_DISPATCHER_NAME prime.iotacc """ Author : Uervirojnangkoorn, M. Created : 11/25/2014 Description : iotacc selects iota integration results base on CC with ref. set. """ from __future__ import absolute_import, division, print_function import os, sys import numpy as np import math from iotbx import ...
# coding=utf-8 # Copyright 2020 The Google Research 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 applicab...
import math import random from graphics import * ################################ FUNCTIONS ################################ #<return the function value at a given point x># def f0(x): return math.cos(x) def f1(x): return math.sin(x**2) def f2(x): return math.exp(x) def f3(x): return (x**2)+1 def f4(x...
import fastai from fastai.vision import * from fastai.callbacks import * from multiprocessing import Pool import matplotlib.pyplot as plt import numpy as np import PIL import torch import torchvision from torchvision.models import vgg16_bn from skimage.metrics import structural_similarity as ssim import os import sys ...
# 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, ...
from __future__ import absolute_import, division, print_function, unicode_literals from collections import OrderedDict import numbers import torch import torch.nn as nn from torch import Tensor # noqa: F401 from torch import _VF from torch._jit_internal import Tuple, Optional, List # noqa: F401 from torch.nn.utils....
# -*- coding: utf-8 -*- """ Created on Sun Oct 28 20:04:37 2018 @author: samla """ import numpy as np import pandas as pd import datetime as dt import pyaudio, wave #import board, busio #import adafuit_bno055 as bno #from time import sleep #initialize orientation sensor #i2c = busio.I2C(board.SCL, boar...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Python framework for developing neural network emulators of RRTMGP gas optics scheme This program takes existing input-output data generated with RRTMGP and user-specified hyperparameters such as the number of neurons, scales the data if requested, and trains a neur...
from utils.graph_utils import * from copy import deepcopy import random # Generate the mask based on the valences and adjacent matrix so far # For a (node_in_focus, neighbor, edge_type) to be valid, neighbor's color < 2 and # there is no edge so far between node_in_focus and neighbor and it satisfy the valence constr...
# -*- coding: utf-8 -*- """ Module to perform the trigger stage of QuakeMigrate. """ import numpy as np from obspy import UTCDateTime import pandas as pd import QMigrate.io.quakeio as qio import QMigrate.plot.triggered_events as tplot def _contains_nan(a, nan_policy='propagate'): policies = ['propagate', 'raise'...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 The github-release-retry Project 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/licens...
# coding: utf-8 import ctypes from ctypes import c_void_p, c_int, c_char_p, byref, POINTER, c_longlong import numpy as np import os import sys from pathlib import Path from .api import IDLRModel from .compatibility import check_tensorrt_compatibility from .libpath import find_lib_path from .neologger import create_log...
# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates # # 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...
""" Inference video: Extract matting on video. Example: python inference_video.py \ --model-type mattingrefine \ --model-backbone resnet50 \ --model-backbone-scale 0.25 \ --model-refine-mode sampling \ --model-refine-sample-pixels 80000 \ --model-checkpoint "PATH_TO...
#!/usr/bin/env python3 # ---------------------------------------------------------------------------- # Copyright (c) 2020--, <NAME>. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ---------------------------------------------...
import argparse from functools import reduce import logging import operator import os import platform import threading import time import pynmea2 import serial import utm logger = logging.getLogger(__name__) def is_mac(): return "Darwin" == platform.system() class Gps: def __init__(self, serial:str, baudrat...
import logging log = logging.getLogger(__name__) from copy import deepcopy from functools import partial import itertools import pickle as pickle import numpy as np from atom.api import Typed, Bool, Str, observe, Property from enaml.application import deferred_call from enaml.layout.api import InsertItem...
""":mod:`ring.func.asyncio` --- collection of :mod:`asyncio` factory functions. =============================================================================== This module includes building blocks and storage implementations of **Ring** factories for :mod:`asyncio`. """ from typing import Any, Optional, List import as...
# 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 applica...
from abc import ABC, abstractmethod from typing import List, Optional, Pattern, Dict from datetime import datetime, timedelta from collections import namedtuple import regex from recognizers_text.utilities import RegExpUtility, QueryProcessor from recognizers_text.extractor import Extractor, ExtractResult from recogni...
""" NOTE: the lines that relate to the project are lines [161 - 226]** CHANGE THIS AT SUBMISSION: SolveIVP method, the bulk of the problem at hand is in the file ivp.py located in the lib folder. """ ## # @mainpage <h1>Initial Value Calculator</h1><h3>1.0.1</h3> # <p>The application designed to estimate the sol...
import numpy as np import multiprocessing as mp import os import re import subprocess import sys import threading from collections import OrderedDict from io import StringIO, BytesIO from inspect import getfullargspec from shutil import rmtree from tempfile import mkdtemp from time import sleep, time from tqdm import ...
#!/usr/bin/env python # coding: utf8 # # Copyright (c) 2021 Centre National d'Etudes Spatiales (CNES). # # This file is part of demcompare # (see https://github.com/CNES/demcompare). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache...
"""Terraform module.""" import copy import json import logging import os import re import subprocess import sys import warnings from send2trash import send2trash from six import string_types from ..cfngin.lookups.handlers.output import deconstruct from ..env_mgr.tfenv import TFEnvManager from ..util import cached_pro...
from builtins import zip from builtins import range from builtins import object import os import numpy as np import warnings import matplotlib.pyplot as plt import rubin_sim.maf.utils as utils __all__ = ['applyZPNorm', 'PlotHandler', 'BasePlotter'] def applyZPNorm(metricValue, plotDict): if 'zp' in plotDict: ...
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
from ..base import OptionsGroup, TemplatedValue from .logging_loggers import * from .logging_encoders import * from ..utils import listify class Var(TemplatedValue): def __str__(self): return '%(' + super().__str__() + ')' class VarMetric(Var): tpl = 'metric.%s' class VarRequestVar(Var): tp...
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
import traceback, sys, time, signal, importlib, yaml, os, os.path, datetime from pythreader import Task, TaskQueue, Primitive, synchronized, PyThread, LogFile from webpie import Logged, Logger, HTTPServer, RequestProcessor, yaml_expand as expand, init_uid from multiprocessing import Process, Pipe import re, socket se...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, <NAME>PORATION. 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...
# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python # coding: utf-8 # ## import libraries # In[1]: import time import warnings # In[2]: # all the imports needed for this blog import numpy as np import matplotlib.pyplot as plt from itertools import cycle import imageio from io import BytesIO #get_ipython().run_line_magic('matplotlib', 'inlin...
''' Contains a generic algorithm object which can do vanilla ICP Then, create plugin functions which can do naive, simple, and fast PFH ''' import time import numpy as np import matplotlib.pyplot as plt import scipy.special as sp from sklearn.metrics.pairwise import euclidean_distances from . import utils class PFH...
#!/usr/bin/env python3 # # Copyright 2017-2020 GridGain Systems. # # 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...
import argparse import math import os import sys import shutil import random import time from itertools import repeat from multiprocessing import cpu_count from typing import Dict, Tuple import imagesize from tqdm import tqdm from PIL import Image, ImageOps from tqdm.contrib.concurrent import process_map from jinja2 i...
""" Implements validation and conversion for the OCI Manifest JSON. See: https://github.com/opencontainers/image-spec/blob/master/manifest.md Example: { "schemaVersion": 2, "config": { "mediaType": "application/vnd.oci.image.config.v1+json", "size": 7023, "digest": "sha256:b5b2b2c507a0944348e0303114d...
import tensorflow as tf from tensorflow.keras.losses import ( sparse_categorical_crossentropy, binary_crossentropy, ) import logging from logging import handlers from time import perf_counter import os import numpy as np import pandas as pd from xml.etree.ElementTree import SubElement from xml.etree import Elem...
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- import numpy as np from matplotlib.patches import Rectangle import matplotlib....
import argparse import asyncio import grp import logging import os import pwd import random import re import string import sys import urllib from fnmatch import fnmatch from typing import Dict from typing import List from typing import Tuple import aiohttp import yaml from aiohttp import ClientSession from aiohttp imp...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division, absolute_import, print_function import logging from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from flexget import plugin from flexget.event import event from flexget.manager import Session try: # NOTE: Imp...
from collections import deque from typing import Deque from mathutils import Matrix, Vector, Quaternion from ..vs import Vector as SVector, Color from ...logging import BPYLoggingManager, BPYLogger from ....utilities.singleton import SingletonMeta import bpy def get_bone(obj, bone, mode=None): if not isinstanc...
# -*- coding: utf-8 -*- """ Created on Tue Nov 4 17:54:32 2014 @author: cdhagmann """ import random import itertools import os import shutil import pickle from Crispin.bash import id_generator, cat import pdat DISTANCE_IN_MILES = [25, 50, 75, 100, 150, 200, 250, 300, 350, 400, ...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init import random import numpy as np import torch.multiprocessing as mp from torch.multiprocessing import Queue def init_emb2pos_index(walk_length, window_size, batch_size): ''' select embedding of positive nodes from a batch...
# The file is modified from https://github.com/ashkamath/mdetr. """ DETR Transformer class. Copy-paste from torch.nn.Transformer with modifications: * positional encodings are passed in MHattention * extra LN at the end of encoder is removed * decoder returns a stack of activations from all decoding layers...
r""" Named Finitely Presented Groups Construct groups of small order and "named" groups as quotients of free groups. These groups are available through tab completion by typing ``groups.presentation.<tab>`` or by importing the required methods. Tab completion is made available through Sage's :ref:`group catalog <sage....
import json from nltk import word_tokenize from nltk.corpus import stopwords from nltk.stem.porter import PorterStemmer import os import re import math from scipy import sparse import numpy as np from scipy import spatial import time ORIGINAL_ARTICLE_PATH = '../dataset/US_Financial_News_Articles/' EDITED_TEXT_PATH = '...
import cv2 import numpy as np from numpy.linalg import norm import sys import os import json from matplotlib import pyplot as plt SZ = 20 # 训练图片长宽 MAX_WIDTH = 1000 # 原始图片最大宽度 Min_Area = 2000 # 车牌区域允许最大面积 PROVINCE_START = 1000 '''注意OpenCV默认BGR,matplotlib默认RGB''' def imshow(img, name='img'): cv2.imshow(name,...
#!/usr/bin/python # Copyright 2012 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 applic...
# -*- coding: utf-8 -*- from tqdm import tqdm import os import random import torch import torch.nn as nn from sklearn.metrics import precision_recall_fscore_support from apex.parallel import DistributedDataParallel as DDP from torch.utils.data import Dataset, DataLoader from transformers import get_linear_schedule_wi...
import datetime import re from pylons import config import ckan.model as model from ckan.tests import * from ckan.lib.stats import Stats, RevisionStats from ckan.lib import stats from ckan.rating import set_rating from ckan.model.authz import add_user_to_role class TestStats(TestController): @classmethod ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # standard modules import csv import math # third party modules import luigi import matplotlib; matplotlib.use('Agg') import matplotlib.pyplot as plt import dadi import pickle import random # local modules from alleletraj.const import MUTATION_RATE from vcf import Polari...
import numpy as np import itertools from timeit import default_timer as timer import scipy as scp import scipy.stats as ssm import multiprocessing as mp #from matplotlib import pyplot as plt #import matplotlib.animation as animation def NBtorus(X, r = 1): #Might need to be reduced only to focus metabol...
# -*- coding: utf-8 -*- """Parser for Google Chrome and Chromium Cache files.""" import os import construct from dfvfs.resolver import resolver as path_spec_resolver from dfvfs.path import factory as path_spec_factory from plaso.events import time_events from plaso.lib import errors from plaso.lib import eventdata ...
from datetime import date from django.contrib.messages.views import SuccessMessageMixin from django.contrib import messages from django.core.exceptions import ValidationError from django.db.models import Case, Q, When from django.forms import ModelForm from django.http import Http404, HttpResponseRedirect, JsonRespons...
""" Transformer model helper methods """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import os import re import string import unicodedata import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim _NEG_INF = -1e9 d...
""" Collection of functions and classes for testing a naive version of parallel execution for topic model variational inference. Usage ----- From a shell/terminal, use like a standard Python script. $ python TestFiniteTopicModel.py --N 200 --nDoc 500 --K 50 --nWorkers 2 For some keyword args (like N, nDoc, K, nWorker...
# # Collective Knowledge # # See CK LICENSE.txt for licensing details. # See CK Copyright.txt for copyright details. # import sys import os import re import ck.net ############################################################ try: from io import open except ImportError: pass try: from setuptools import se...
import datetime from functools import wraps import json import logging import re import signal import sys import argh import flask import gevent import gevent.backdoor from gevent.pywsgi import WSGIServer import prometheus_client import psycopg2 from psycopg2 import sql import common from common import database from ...
''' Created on 30-Dec-2018 @author: vijay ''' import wx from wx import TreeCtrl from wx.lib.mixins.treemixin import ExpansionState from src.view.util.FileOperationsUtil import FileOperations import logging.config from src.view.constants import LOG_SETTINGS from src.view.other.TreeData import TreeSearch, viewdataList ...
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko.utils ~~~~~~~~~~~~~~ Provides utility classes and functions """ import re import sys import itertools as it import fcntl from riko import __version__ from math import isnan from functools import partial from operator import itemgetter from os import O_NONBLOC...
from __future__ import print_function import datetime import fileinput import glob import os import re import shutil import tarfile import tempfile import time import urllib3 from infrared.core.utils import exceptions from infrared.core.utils import logger LOG = logger.LOG TIME_FORMAT = '%Y-%m-%d_%H-%M-%S' ACTIVE_W...
#!/usr/bin/env python ''' Module : Main Description : The main entry point for the program. Copyright : (c) <NAME>, 2017 License : MIT Maintainer : <NAME> Portability : POSIX The program reads one or more input FASTQ files. For each file it computes a variety of statistics, and then prints a summary of th...
import torch import numpy as np from torch.autograd import Variable from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import StandardScaler import os # restore hamiltonian from nonzeros def restore_h(nonzero, nonzero_loc, dim): data_count = nonzero.shape[0] H = torch.zeros((data_coun...
# Copyright 2019 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.txt" file accom...
from django.contrib import admin from django.utils.html import escape from django.utils.safestring import mark_safe from simple_history.admin import SimpleHistoryAdmin import project_core.models proposal_search_fields = ('proposal__title', 'proposal__applicant__academic_title__title', 'propo...
import pandas as pd import numpy as np import scipy.stats as st import logging import functools import asyncio import rx import datetime as dt import exchange_calendars as ec import plotille as plt import socket import warnings import io import json import locale import os from bs4 import BeautifulSoup from dateutil.tz...
from __future__ import print_function from scipy.optimize import fmin_l_bfgs_b from itertools import chain from subprocess import check_output import warnings from tempfile import NamedTemporaryFile import logging import gzip from base64 import b64encode from six import PY3, text_type import numpy as np from sklear...
# -*- coding: utf-8 -*- from openerp import models,fields,api from openerp.tools.translate import _ import datetime import pytz #def duree(debut): # dt = datetime.datetime.now() - debut # ms = (dt.days * 24 * 60 * 60 + dt.seconds) * 1000 + dt.microseconds / 1000.0 # ms=int(ms) # return ms #def _now(debu...
import unittest import numpy as np from phonopy.api_phonopy import Phonopy from phonopy.spectrum.dynamic_structure_factor import atomic_form_factor_WK1995 from phonopy import load import os data_dir = os.path.dirname(os.path.abspath(__file__)) # <NAME> and <NAME>, Acta Cryst. A51, 416 (1995) # f(Q) = \sum_i a_i \exp...
import math from kraken.core.maths import Vec3 from kraken.core.maths.xfo import Xfo from kraken.core.objects.components.base_example_component import BaseExampleComponent from kraken.core.objects.attributes.attribute_group import AttributeGroup from kraken.core.objects.attributes.scalar_attribute import ScalarAttri...
# Created byMartin.cz # Copyright (c) <NAME>. All rights reserved. import numpy from pero.enums import * from pero.properties import * from pero import Frame from pero import MarkerLegend from . series import Series from . import utils class Rectangles(Series): """ Abstract base class for various types o...
#!/usr/bin/env python """Provides conversion for molecules.""" import openbabel as ob import pybel import networkx as nx import scipy.spatial.distance import numpy as np import subprocess import shlex from eden.util import read import logging logger = logging.getLogger(__name__) def load(fname): """load.""" ...
import discord from discord.ext import commands import mysql.connector import datetime from dateutil.relativedelta import relativedelta class TrainingCommands: def __init__(self,bot): self.bot = bot global hostip hostip = bot.hostip global requestchannel requestchannel = bot...
""" scaffoldgraph tests.prioritization.test_original_rules """ from itertools import chain from rdkit import Chem from rdkit.Chem.Scaffolds.MurckoScaffold import GetScaffoldForMol from scaffoldgraph import tree_frags_from_mol from scaffoldgraph.core import Scaffold, get_next_murcko_fragments, get_all_murcko_fragment...
import sys import textwrap import struct import array from PIL import Image, ImageDraw, ImageFont, ImageFilter, ImageChops import bteve as eve import zlib import wave import binascii def crc(s): # CRC-32 of string s return binascii.crc32(s) & 0xffffffff import common sys.path.append("../textmode") import textm...
# Modified by bacetiner import datetime import os import traceback import torch from torch import nn from torch.utils.data import DataLoader from torchvision import transforms from .efficientdet.dataset import CocoDataset, Resizer, Normalizer, Augmenter, collater from .backbone import EfficientDetBackbone from tensorb...
from dataclasses import dataclass from sys import version_info from warnings import warn import typing as t import types import dis # for linter purpose goto: t.Any = None label: t.Any = None if version_info[:2] >= (3, 10): warn("goto with python >=3.10 is very unstable, make sure all tests passed") elif versi...
#!/usr/bin/env python """ Models declaration for application ``django_mailbox``. """ import gzip from email.encoders import encode_base64 from email.message import Message as EmailMessage from email.utils import formatdate, parseaddr from urllib.parse import parse_qs, unquote, urlparse from quopri import encode as enc...
import re from threading import Thread from time import sleep import logging import collections import copy, json log = logging.getLogger(__name__) # Default namespace for the topics. Will be overwritten with the value in # config pub_topic_namespace="otgw/value" sub_topic_namespace="otgw/set" ha_publish...
# -*- coding: utf-8 -*- # # Copyright 2014 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
""" The Standard Model of fundamental and composite particles. Package: RoadNarrows elemenpy package. File: standardmodel.py Link: https://github.com/roadnarrows-robotics/ Copyright: (c) 2019. RoadNarrows LLC http://www.roadnarrows.com All Rights Reserved License: MIT """ import sys import math from...