text
stringlengths
6.04k
39.5k
# -*- coding: utf-8 -*- #! Python3 #? @author: <NAME> #? @github: https://github.com/rfelipesilva import PIL from PIL import Image,ImageTk import cv2 import time import numpy as np from fuzzywuzzy import fuzz, process import tkinter as tk import tkinter.ttk as ttk from tkinter import filedialog, messa...
#!/usr/bin/env python3 import os import os.path import sys elasticNodeMiddleware = False if len(sys.argv) >= 3 and str(sys.argv[2]) == "ElasticNodeMiddlewareProject": elasticNodeMiddleware = True def create_workspace_content(project_name, use_comm_lib=False): content = """workspace( name = "{project_na...
from django.contrib.gis.db import models from django.core.validators import RegexValidator from django.utils.safestring import mark_safe from django.utils.text import slugify from wagtail.snippets.models import register_snippet from wagtail.admin.edit_handlers import FieldPanel from wagtail.search import index from wag...
#!/usr/bin/env python3 # # (C) Copyright 2020 Hewlett Packard Enterprise Development LP. # Licensed under the Apache v2.0 license. # import os import sys import time import json import socket import textwrap import argparse import requests import curses from http import HTTPStatus WIDTH = 130 HEIGHT = 46 WHITE ...
# -*- coding: utf-8 -*- """ .. invisible: _ _ _____ _ _____ _____ | | | | ___| | | ___/ ___| | | | | |__ | | | |__ \ `--. | | | | __|| | | __| `--. \ \ \_/ / |___| |___| |___/\__/ / \___/\____/\_____|____/\____/ Created on Mar 20, 2013 All-to-all perceptron layers: simple (:...
""" Contains a CLICommand that implements ping test functionality. Uses the following from :py:class:`swiftly.cli.context.CLIContext`: =============== ==================================================== client_manager For connecting to Swift. concurrency The number of concurrent actions that can be ...
import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from scipy.stats import spearmanr from matplotlib.lines import Line2D from tqdm.notebook import tqdm from PIL import Image def Custom_Legend(ax, labels: "List[String]", colors : "List of color names", ncol = 1, fonts...
# -*- coding: utf-8 -*- import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd import glob from src.util.log_util import set_logger from logging import StreamHandler, Formatter, getLogger, FileHandler, DEBUG, INFO, ERROR from sklearn.preprocessing import StandardScaler from src.data.m...
import sys import os, errno, stat from io import BytesIO from .virtualizedproc import signature, sigerror from .sandboxio import NULL from ._commonstruct_cffi import ffi, lib MAX_PATH = 256 UID = 1000 GID = 1000 INO_COUNTER = 0 class FSObject(object): read_only = True def stat(self): try: ...
""" Automate your weekly reporting using the template class and function below. You can have this set to a cron job and have the output emailed or sent to a Google Sheet """ # local classes from .ga import GoogleAnalytics from .gsc import GoogleSearchConsole from .sheets import GoogleSheets # standard library impor...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest import django from django.db.models.sql import compiler import re NEEDS_AGGREGATES_FIX = django.VERSION[:...
#!/usr/bin/env python3 import polars as pl import argparse import sys import glob from typing import List, Dict, Union def parse_args(args=None): parser = argparse.ArgumentParser(description='Read and format scoring files') parser.add_argument('-d', '--dataset', dest='dataset', required=True, ...
from __future__ import absolute_import, division, print_function, unicode_literals from six import StringIO import textwrap from stone.backend import CodeBackend from stone.backends.python_helpers import ( check_route_name_conflict, class_name_for_annotation_type, class_name_for_data_type, emit_pass_...
#!/usr/bin/env python # # Copyright 2007 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 o...
# Copyright 2008-2016 by <NAME>. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Multiple sequence alignment input/output as alignment objects. The Bio.AlignIO interface is ...
import sys import os import ast import re from anytree import Node, PreOrderIter import time from datetime import datetime, date from utils.import_checker import import_check from utils.github_search import search_github from utils.utils import * # NOTE TO MYSELF: # Difference between this file and constant_input_main...
#!/usr/bin/env python # # Copyright (c) 2019, The OpenThread Authors. # 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 # ...
# # 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 us...
import base64 import logging import os import queue import time import typing as t import zlib from collections import OrderedDict from concurrent.futures.thread import ThreadPoolExecutor from dataclasses import dataclass from sqlalchemy import orm from sqlalchemy.orm import sessionmaker from watchdog.events import Fi...
# -*- coding: utf-8 -*- # flake8: noqa # disable flake check on this file because some constructs are strange # or redundant on purpose and can't be disable on a line-by-line basis from __future__ import absolute_import from __future__ import division from __future__ import print_function import ast import inspect imp...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import functools import logging import os import pathlib import sys import sysconfig from typing import Any, Dict, Iterator, List, Optional, Tuple from pip._internal.models.scheme import SCHEME_KEYS, Scheme from pip._internal.utils.compat import WINDOWS from pip._internal.utils.deprecation import deprecated from pip._...
"""Implements just intonation arbitrary and tetrachordal scales.""" from itertools import permutations, product from .intervals import JustInterval from .primes import is_prime __version__ = '0.0.1' class JustScale(): """This class implements arbitrary just intonation scales.""" def __init__(self, tones=...
from yahoo_oauth import OAuth2 import json from json import dumps, loads from datetime import datetime from pathlib import Path class Yahoo_Api(): def __init__(self, consumer_key, consumer_secret, access_key): self._consumer_key = consumer_key self._consumer_secret = consumer_secret...
__all__ = [ 'factorize_array', 'factorize_dataframe', 'factorize_ndarray', 'fast_zip_arrays', 'fast_zip_dataframe_columns', 'get_dataframe', 'get_dtypes_and_required_cols', 'get_ids', 'get_json', 'get_timestamp', 'get_utctimestamp', 'merge_dataframes', 'PANDAS_BASIC_D...
import os import cv2 import time import random import pickle import numpy as np from PIL import Image from distutils.version import LooseVersion from sacred import Experiment from sacred.observers import FileStorageObserver from easydict import EasyDict as edict import torch from torch.utils import data from torch.opti...
__all__ = ('TypingGameApp', 'TypingDropDown',) import pygame from pygame import Surface from typing import Generator import random from pathlib import Path from .api.utils import SafeMember, after_end from .api.mixins.colors import TypingGameColorMixin from .api.mixins import typings from .api.generics import RGBCo...
# TODO: # * modify exports using lief # * zero out rich header (if it exists) --> requires updating OptionalHeader's checksum ("Rich Header" only in Microsoft-produced executables) # * tinker with resources: https://lief.quarkslab.com/doc/tutorials/07_pe_resource.html import lief # pip install https://github.com/lief...
# .-------------------. # | imports | # '-------------------' from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.metrics import dp from kivy.network.urlrequest import UrlRequest from kivy.properties import NumericProperty from kivy.uix.image import AsyncImage from k...
""" ``patterns`` module. """ from inspect import getfullargspec from time import sleep, time from wheezy.caching.dependency import CacheDependency from wheezy.caching.utils import total_seconds class Cached(object): """Specializes access to cache by using a number of common settings for various cache operat...
import random import itertools import numpy as np from gym import spaces from traffic.traffic_env import TrafficEnv from traffic.road import Road, RoadSegment from traffic.car import Car from traffic.drivers.driver import Driver, XYSeperateDriver from traffic.drivers.oned_drivers import IDMDriver, PDDriver from traffi...
# Copyright 2020 The SQLFlow 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 law o...
""" An input processor for the SIGNOR database: a database of causal relationships between biological entities. See publication: Perfetto et al., "SIGNOR: a database of causal relationships between biological entities," Nucleic Acids Research, Volume 44, Issue D1, 4 January 2016, Pages D548-D554. https://doi.org/10.1...
import os from abc import ABC, abstractmethod from typing import Dict, List, Optional, Tuple, Type from django.conf import settings from django.http import HttpRequest from zerver.lib.exceptions import RateLimited from zerver.lib.redis_utils import get_redis_client from zerver.lib.utils import statsd from zerver.mod...
# author: github/zabir-nabil # relevant imports import os import cv2 import pydicom import pandas as pd import numpy as np # import tensorflow as tf # import matplotlib.pyplot as plt # torch dataset import torch from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils import ra...
from pbxproj.pbxsections import * from pbxproj import PBXList class TreeType: ABSOLUTE = u'<absolute>' GROUP = u'<group>' BUILT_PRODUCTS_DIR = u'BUILT_PRODUCTS_DIR' DEVELOPER_DIR = u'DEVELOPER_DIR' SDKROOT = u'SDKROOT' SOURCE_ROOT = u'SOURCE_ROOT' @classmethod def options(cls): ...
""" This project is a template to predict time series via a neural network. Therefore training time series of the input data and the desired output have to be loaded. The neural network is created with keras (https://keras.io/) and a tensorflow backend (https://www.tensorflow.org/). The parameters to set up the...
#!/usr/bin/env python3 # -*- CoDing: utf-8 -*- """ CreateD on WeD OCt 17 12:25:24 2018 Last Update May 22 2019 @author: simonvanvliet Department of Zoology University of Britisch Columbia <EMAIL> This code implements the two species (helper and neutral cells) model """ import mls_general_code as mlsg import numpy as ...
# Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import errno import fcntl import functools import logging import os import shutil import subprocess from contextlib import contextmanager from time ...
import calendar import time from collections import OrderedDict from anchore_engine.services.policy_engine.engine.feeds import DataFeeds from anchore_engine.services.policy_engine.engine.policy.gate import Gate, BaseTrigger from anchore_engine.services.policy_engine.engine.vulnerabilities import have_vulnerabilities_f...
import datetime from django.http import JsonResponse from django.db.models import Q, Count, Sum from core.models import Entity, Biocarburant, MatierePremiere, Depot, Pays, LotTransaction from certificates.models import ISCCCertificate, DBSCertificate, REDCertCertificate, SNCertificate from core.models import Control, C...
# https://wiki.xxiivv.com/site/varvara.html # https://wiki.xxiivv.com/site/uxntal.html # https://wiki.xxiivv.com/site/uxntal_cheatsheet.html # https://wiki.xxiivv.com/site/uxntal_reference.html # https://wiki.xxiivv.com/site/uxntal_stacking.html # https://wiki.xxiivv.com/site/uxntal_macros.html from rich.console impo...
# coding=utf-8 # Copyright 2019 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...
''' Multi-period inventory management <NAME>, <NAME>, <NAME> 4/14/2020 ''' import gym import itertools import numpy as np from scipy.stats import * from or_gym.utils import assign_env_config from collections import deque class InvManagementMasterEnv(gym.Env): ''' The supply chain environment is structured as ...
import torch import torch.nn as nn import torch.nn.functional as F class ConvBlock(torch.nn.Module): def __init__(self, input_size, output_size, kernel_size=3, stride=1, padding=1, bias=True, activation='prelu', norm=None): super(ConvBlock, self).__init__() self.conv = torch.nn.Conv2d(input_size, o...
#copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # #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 l...
# 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 asyncio import contextlib import io import os import sys import threading import time from collections import ChainMap from http.server import BaseHTTPRequestHandler, HTTPServer import pytest import fsspec.asyn import fsspec.utils fsspec.utils.setup_logging(logger_name="fsspec.http") requests = pytest.import...
#!/usr/bin/env python """ Utility functions that don't really belong anywhere else Axes: +X is east -X is west +Y is south -Y is north +Z is up -Z is down Possible Vector128 dtype: d = np.dtype((np.float128, np.dtype({"names": list("xyzw"), "formats": [np.float32]*4}))) a = np.array([0], dtype=d) a[0] = ...
import random import math from unittest import result from PIL import Image from main import console, spinner_choice from moviepy.editor import * import moviepy.video.fx.all as vfx import pytube import urllib.parse import urllib.request import numpy as np from moviepy.audio import fx from config import * from images im...
import math import struct # Python 2 compat try: int_types = (int, long,) byte_iter = bytearray except NameError: int_types = (int,) byte_iter = lambda x: x try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest from fitparse.utils import ...
import collections.abc import os import pickle import re import string import sys from copy import copy, deepcopy from typing import Callable, Dict, List, NewType, Tuple, TypeVar, Union import pytest from pkg_resources import safe_version from typing_extensions import Annotated, Literal from pydantic import VERSION, ...
# future from __future__ import annotations # stdlib from copy import deepcopy import functools import operator from typing import Any from typing import Callable from typing import Dict from typing import List from typing import Optional from uuid import UUID # third party from google.protobuf.reflection import Gene...
#!/usr/bin/python3 import json import time import warnings from collections import OrderedDict from pathlib import Path from threading import Lock, Thread from typing import Callable, Dict, Iterator, List, Optional, Sequence, Tuple, Union, ValuesView import eth_event from eth_event import EventError from web3._utils ...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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...
""" babel.messages.pofile ~~~~~~~~~~~~~~~~~~~~~ Reading and writing of files in the ``gettext`` PO (portable object) format. :copyright: (c) 2013-2022 by the Babel Team. :license: BSD, see LICENSE for more details. """ import os import re from babel.messages.catalog import Catalog, Message f...
""" Run PSF estimation. """ from __future__ import print_function, absolute_import, division import sys import os import re import time import argparse import numpy as np import ctypes as ct from ctypes.util import find_library from astropy.io import fits from desiutil.log import get_logger def parse(options=None...
import argparse import collections import enum import linecache import os.path from pathlib import Path import shutil import sys import textwrap import time import traceback from typing import ( Counter, Dict, Iterable, List, MutableMapping, Optional, Sequence, Tuple, Union, ) from t...
""" Geopy can calculate geodesic distance between two points using the `geodesic distance <https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid>`_ or the `great-circle distance <https://en.wikipedia.org/wiki/Great-circle_distance>`_, with a default of the geodesic distance available as the function ``geopy.distance....
# 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...
import os import hashlib import binascii from ._libsecp256k1 import ffi, lib EC_COMPRESSED = lib.SECP256K1_EC_COMPRESSED EC_UNCOMPRESSED = lib.SECP256K1_EC_UNCOMPRESSED FLAG_SIGN = lib.SECP256K1_CONTEXT_SIGN FLAG_VERIFY = lib.SECP256K1_CONTEXT_VERIFY ALL_FLAGS = FLAG_SIGN | FLAG_VERIFY NO_FLAGS = lib.SECP256K1_CONT...
# setup.py - distutils packaging # # Copyright (C) 2003-2010 <NAME> <<EMAIL>> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
import asyncio import json from lbry.wallet import ENCRYPT_ON_DISK from lbry.error import InvalidPasswordError from lbry.testcase import CommandTestCase from lbry.wallet.dewies import dict_values_to_lbc class WalletCommands(CommandTestCase): async def test_wallet_create_and_add_subscribe(self): session ...
from keras.models import Model import tensorflow as tf from keras.layers import Reshape, Activation, Conv2D, Input, MaxPooling2D, BatchNormalization, Flatten, Dense, Lambda from keras.layers.advanced_activations import LeakyReLU from keras.layers.merge import concatenate from keras.applications.mobilenet import MobileN...
# -*- coding: utf-8 -*- """ IDL Ref: https://google.github.io/flatbuffers/flatbuffers_grammar.html """ import collections import os import sys import types from ply import lex, yacc from fbs._compat import urlopen, urlparse from fbs.fbs import FBSPayload, FBSType, gen_init from .exc import FbsGrammerError, Fb...
from __future__ import division from __future__ import print_function import time import argparse import pickle import os import datetime import torch.optim as optim from torch.optim import lr_scheduler from utils import * from modules import * parser = argparse.ArgumentParser() parser.add_argument('--no-cuda', act...
from abc import ABCMeta, abstractmethod import tensorflow.compat.v1 as tf tf.disable_v2_behavior() from tensorflow.python.client import timeline import numpy as np from tqdm import tqdm import os.path as osp import itertools from superpoint.utils.tools import dict_update class Mode: TRAIN = 'train' EVAL = 'e...
import numpy as np housekeeping_template = np.dtype([ ("housekeeping_packet_id", "i"), # This is to be filled just prior to writing into file ("buffer_id","i"), ("buffer_sec", "i"), ("buffer_ns", "i"), ("buffer_index","u2"), ("incomplete_packet", "u2"), ("hz_elem_0_voltage","f"), ("hz_e...
import numpy as np import scipy.sparse as sp import torch import torch.utils.data import typing as _typing import torch_geometric from . import target_dependant_sampler class _LayerDependentImportanceSampler( target_dependant_sampler.BasicLayerWiseTargetDependantSampler ): """ Obsolete implementation, unu...
import argparse import numpy as np import cv2 import os import glob import torch cv2.setNumThreads(0) from tqdm import tqdm from torch.utils import data from typing import Dict, List, Union # import some common detectron2 utilities from detectron2 import model_zoo from detectron2.config import get_cfg from detectron...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jul 17 09:11:58 2020 @author: ets """ import datetime as dt import logging import re import warnings from pathlib import Path from typing import List, Tuple # import climpred import numpy as np import pandas as pd import xarray as xr from climpred imp...
from argparse import ArgumentParser import os from docutils import nodes from docutils.statemachine import StringList from docutils.parsers.rst.directives import flag, unchanged from docutils.parsers.rst import Parser, Directive from docutils.utils import new_document from docutils.frontend import OptionParser from sp...
from __future__ import annotations import logging import hmac from math import exp from typing import Dict, Optional from datetime import datetime, timezone, timedelta from sqlalchemy.dialects import postgresql as pg from sqlalchemy.sql.expression import func, true, null, or_, and_ from swpt_creditors.extensions import...
# -*- coding: utf-8 -*- from django.contrib.auth.mixins import UserPassesTestMixin from django.http import HttpResponse, Http404, JsonResponse from django.views.generic import TemplateView, View import json import hashlib import httplib from mimetypes import MimeTypes import os import csv import StringIO i...
""" color.py ------------- Hold and deal with visual information about meshes. There are lots of ways to encode visual information, and the goal of this architecture is to make it possible to define one, and then transparently get the others. The two general categories are: 1) colors, defined for a face, vertex, or ...
# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # type: ignore from io import StringIO from typing import Mapping, Optional, Sequence, Union import warnings from .. import LOG from ..damlast import daml_types as daml from ..d...
import numpy as np import math from python_qt_binding.QtCore import Qt, QMetaType, QDataStream, QVariant, pyqtSignal from python_qt_binding import loadUi from rqt_gui_py.plugin import Plugin from python_qt_binding.QtWidgets import QWidget, QTreeWidget, QTreeWidgetItem,QListWidgetItem, \ QSlider, QGroupBox, QVBoxLay...
from numpy.lib.function_base import average, interp import torch from torch import nn from PCONV_operator import EntropyContextNew, EntropyConv2Batch, EntropyCtxPadRun2 from PCONV_operator import DExtract2, DInput2, PseudoFillV2, DExtract2Batch,MultiProject from PCONV_operator import EntropyAdd, EntropyBatchGmmTable,Ps...
import warnings import numpy as np import pandas as pd from statsmodels.base import model import statsmodels.base.wrapper as wrap from statsmodels.tools.sm_exceptions import ConvergenceWarning class _DimReductionRegression(model.Model): """ A base class for dimension reduction regression methods. """ ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 17 18:10:44 2020 @author: yujia """ import torch import torch.nn.functional as F from torch.autograd import Function import numpy as np def sinkhorn_forward(C, mu, nu, epsilon, max_iter): bs, n, m = C.size() v = torch.ones([bs, 1, m])/...
import collections import io import itertools import json import textwrap from braces.views import JSONResponseMixin, PermissionRequiredMixin from django.contrib.contenttypes.models import ContentType from django.db.models import Count from django.db.utils import ProgrammingError from django.http import HttpResponse f...
import pandas as pd import feather import numpy as np import os import requests import json import seaborn from matplotlib import pyplot as plt import blitzgsea as blitz import scipy.stats as stats def nes(signature, gene_set): gs = set(gene_set) hits = [i for i,x in enumerate(signature.index) if x in gs] ...
"""Module for lemmatizing Latin—includes several classes for different lemmatizing approaches--based on training data, regex pattern matching, etc. These can be chained together using the backoff parameter. Also, includes a pre-built chain that uses models in latin_models_cltk repo called BackoffLatinLemmatizer. The ...
import stripe import stripe.error import subscriptions # Next line is so these functions can be used by django_stripe user without needing to import from subscriptions from subscriptions import cancel_subscription, cancel_subscription_for_product, delete_customer from subscriptions.types import PaymentMethodType from...
''' This reporter exposes Buildbot metrics to Prometheus. A configuration block such as the following example should be added to the Prometheus configuration file to instruct it to scrape the buildbot metrics exporter. .. code-block:: yaml scrape_configs: - job_name: 'buildbot' target_groups:...
import numpy as np import pandas as pd import warnings from typing import Optional, Callable from scipy.integrate import trapezoid import matplotlib.pyplot as plt from Evaluations.custom_types import Numeric, NumericArrayLike from Evaluations.util import check_and_convert from Evaluations.util import predict_mean_surv...
from __future__ import absolute_import, division, print_function # LIBTBX_SET_DISPATCHER_NAME phenix.model_vs_map from scitbx.array_family import flex import iotbx.pdb from libtbx.utils import Sorry from libtbx.str_utils import make_sub_header from cctbx import maptbx from cctbx import miller import mmtbx.utils import...
#!/usr/bin/env python3 #-*- coding: utf-8 -*- # Copyright 2017, National University of Ireland and The James Hutton Insitute # Author: <NAME> # # This code is part of the riboSeed package, and is governed by its licence. # Please see the LICENSE file that should have been included as part of # this package. """ """ i...
import torch import numpy as np import torch.nn as nn from copy import deepcopy import torch.optim as optim from RodentNavigation.Networks.network_modules_torch import NetworkConnectivityModule # plastic LSTM, with neuromod take in (x_n, v_t - v_t-1) # train using recurrent SAC, burn in period # modulate lower level...
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2019 New Vector Ltd # Copyright 2020 The Matrix.org Foundation C.I.C. # # 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 ...
import numpy as np import ubelt as ub import scipy import scipy.ndimage import netharn as nh import scipy def g(f, σ, **kw): truncate = kw.get('truncate', 6.0) # overkill if len(f.shape) == 1: sigma = σ elif len(f.shape) == 3: sigma = (σ, σ, 0) else: sigma = (σ, σ) return ...
# Copyright (c) 2021 zfit import numpy as np import pytest import tensorflow as tf import zfit.core.basepdf import zfit.models.dist_tfp import zfit.settings from zfit import z from zfit.core.loss import UnbinnedNLL from zfit.core.space import Space from zfit.minimize import Minuit from zfit.pdf import Gauss from zfit...
# -*- coding: utf-8 -*- # @Author: <NAME> # @Date: 2018-11-09 10:06:59 # @Last Modified by: <NAME> # @Last Modified time: 2018-11-23 17:26:44 import os import os.path as osp import random import time import sys; sys.path.append('../') import torch import torch.nn as nn import numpy as np import torch.nn.parallel i...
from .EmbConstant import * from .EmbThreadPec import get_thread_set from .PecWriter import write_pec from .WriteHelper import write_string_utf8, write_int_32le, write_int_16le, write_int_8, write_float_32le SEQUIN_CONTINGENCY = CONTINGENCY_SEQUIN_JUMP FULL_JUMP = True MAX_JUMP_DISTANCE = 2047 MAX_STITCH_DISTANCE = 20...
import os import tempfile import pandas as pd import csv from patsy.highlevel import dmatrices from nidm.experiment.Query import GetProjectsUUID import click from nidm.experiment.tools.click_base import cli from nidm.experiment.tools.rest import RestParser import numpy as np import matplotlib.pyplot as plt import seabo...
import contextlib import functools import logging import typing from typing import Any, Type import attr import six from dbnd._core.configuration import get_dbnd_project_config from dbnd._core.configuration.environ_config import ( in_tracking_mode, is_databand_enabled, ) from dbnd._core.constants import ( ...
from viz.utils import * #styling external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css', 'https://codepen.io/chriddyp/pen/brPBPO.css'] thread_id='' # Layout def generate_layout(thread_id): dlayout = html.Div([ # DATA STORES dcc.Store(id='ts-graph-file'), dcc.Store(id='ts-grap...
from maslite import Agent, AgentMessage, Scheduler from collections import defaultdict __author__ = ["<EMAIL>"] __description__ = """ INTRODUCTION This demo illustrates how to solve the assignment problem using OutScale and Dmitry Bertsekas Distributed Assignment Solving algorithm from 1979. It u...
"""Grammar and methods for parsing the configuration file""" from .printing import PybnfError, print1 from .config import Configuration from string import punctuation import logging import pyparsing as pp import re logger = logging.getLogger(__name__) numkeys_int = ['verbosity', 'parallel_count', 'delete_old_fi...
#系統元件 from flask import Flask, jsonify, request, render_template,session,redirect,url_for,flash,Blueprint import redis import os import json import pymongo import pandas as pd import datetime import hashlib from datetime import timedelta import time import numpy as np # line bot 相關元件 from linebot import LineBotApi fro...