text
stringlengths
3.07k
22.1k
from __future__ import print_function, unicode_literals import traceback from itertools import product from socket import ( error as socket_error, timeout as timeout_error, ) import click import gevent import six from paramiko import SSHException import pyinfra from pyinfra import logger from pyinfra.prog...
""" """ __author__ = 'donal' __project__ = 'ribcage' from datetime import datetime from functools import wraps from urlparse import urlparse, urljoin from flask import render_template, redirect, url_for, flash, \ current_app, request, abort, jsonify from flask.ext.login import login_user, logout_user, login_requi...
""" train_deeplab.py @author: <NAME> Train the DeepLabV3+ network to segment buildings """ import os import pickle import pprint from os import path as op from functools import partial from datetime import datetime as dt import yaml import numpy as np import tensorflow as tf from keras import backend as K from kera...
from clvm import KEYWORD_TO_ATOM from clvm_tools.pattern_match import match from clvm_tools.binutils import assemble from clvm_tools.NodePath import NodePath, LEFT, RIGHT from .helpers import quote QUOTE_ATOM = KEYWORD_TO_ATOM["q"] APPLY_ATOM = KEYWORD_TO_ATOM["a"] FIRST_ATOM = KEYWORD_TO_ATOM["f"] REST_ATOM = KEYWO...
# -*- coding: utf-8 -*- """ This module handles communication with NYPL Platform and BPL Solr. It is used to check status of records in Sierra between WorldCat queries so fully cataloged or deleted bibs are dropped from the process. """ import logging import os from typing import Optional from bookops_nypl_platform i...
# ================================================================= # # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # Copyright (c) 2017 <NAME> # Copyright (c) 2017 <NAME> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files...
# Copyright 2020 ABSA Group Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
#!/usr/bin/env python # coding: utf-8 # # `espresso.py` Module # Standard library imports: import atexit from contextlib import contextmanager import os import platform import re from shlex import split import subprocess import time # Third-party imports: # None # Local application imports: # None def _OS_check...
import numpy as np from scipy.optimize import curve_fit, minimize import matplotlib.pyplot as plt import emcee from scipy.stats import chisquare import pylab from collections import OrderedDict from matplotlib import rc import matplotlib as mpl # mpl.use('GTK3AGG') rc('text', usetex=False) # rc('axes', unicode_minus=Tr...
import __clrclasses__.System.Runtime.Serialization.Formatters as Formatters from __clrclasses__.System import Type as _n_0_t_0 from __clrclasses__.System import Array as _n_0_t_1 from __clrclasses__.System import TypeCode as _n_0_t_2 from __clrclasses__.System import Byte as _n_0_t_3 from __clrclasses__.System import C...
#! /usr/bin/env python import copy from copy import deepcopy import rospy import threading import quaternion import numpy as np from geometry_msgs.msg import Point from visualization_msgs.msg import * #from interactive_markers.interactive_marker_server import * from franka_interface import ArmInterface from panda_robot...
""" Count the frequencies of words in Yelp reviews. """ import spacy import unidecode import re from collections import Counter from collections import defaultdict import pandas as pd import json import generate_synonyms as gs nlp = spacy.load('en_core_web_sm') def normalize_text(text): """ Normalize the...
import pandas as pd import numpy as np from .cleanning import getVarTypes from .bivariate import bivariate from scipy.stats import chi2 as c # Splitting Dataframe by expect-train ratio or size def splitDF(df, size=None, ratio=None, random_state=None): if size == ratio == None: ratio = 0.5 train =...
from datetime import datetime from itertools import count from logging import getLogger import os import sys import inspect from yoyo.compat import reraise, exec_, ustr from yoyo.exceptions import DatabaseError from yoyo.utils import plural logger = getLogger(__name__) default_migration_table = '_yoyo_migration' _ste...
import functools import random import time import sys from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException, WebDriverException from selenium.webdriver.remote.command import Command from SRC.common.config import EasyConfig from SRC.common.const import RunResult from SRC.common.ex...
# -*- coding: utf-8 -*- """ backend/interface_template_fields.py - last updated 2021-05-22 Controller/dispatcher for the template-filler module. ============================== Copyright 2021 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance w...
import argparse import torch from torch import optim import torch.nn.functional as F import Models import Dataset import cv2 as cv import torch.nn as nn import os import glob def save_image(label, image, idx, target_set): image = image.cpu().squeeze().permute(1, 2, 0).numpy() path = target_set + str(label.cp...
# # Copyright (c) 2018 Intel Corporation # # 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...
''' Travl is a travel plan storage website that I'm using to practice my web development skills. It was built using the Flask framework, Boostrap and MySQL. I used the example code from bradtraversy's myflaskapp for a lot of the format It can be found here: https://github.com/bradtraversy/myflaskapp ''' from fla...
import sys, os sys.path.append(os.pardir) import numpy as np from lib.functions import sigmoid, softmax, cross_entropy class MatMulLayer(): def __init__(self): self.X = None self.W = None def forward(self, X, W): Y = np.dot(X, W) self.X = X self.W = W return Y ...
import numpy as np import torch import torch.nn.functional as F from ignite.engine import Engine, Events from nnsum.metrics import PerlRouge #from ignite.metrics import Metric import tempfile import logging import sys import os from collections import defaultdict import rouge_papier def compute_class_weights(...
import torch from torch.utils import data import pickle import gzip import numpy as np from torch.nn import CosineSimilarity from torch.utils.data.dataloader import default_collate import torch from datetime import datetime import random import torch.nn.functional as F class ReviewDataset(data.Dataset): def __ini...
# -*- coding: utf-8 -*- import _io import configparser import json import re from abc import ABCMeta, abstractmethod from xml.etree import ElementTree class Constants: """Constants for slurpers""" STRIP = 1 """Strip illegal characters in a tag name: 'birth-date' -> 'birthdate'""" REPLACE_WITH_UNDERSC...
from typing import List import numpy as np from stat_histogram import histogramdd_indexes from opendp.meas import make_base_geometric def release_hierarchical_histogramdd_indexes( x: np.ndarray, category_lengths: List[int], hierarchy ) -> List[np.ndarray]: """Release histogram estimates at different levels o...
#!/eecs/research/asr/mingbin/python-workspace/hopeless/bin/python """ Author : <NAME> (<EMAIL>) Filename : skipgram-trainer.py Last Update : Mar 25, 2016 Description : A wrapper of skip-gram from gensim Website : https://wiki.eecs.yorku.ca/lab/MLL/ History 20160325 regex added to handle general number...
import utils from train import * import time import dill import torch.multiprocessing as mp import os import sys import traceback def get_cuda_devices(): return [torch.device(f'cuda:{i}') for i in range(torch.cuda.device_count())] def get_devices(use_gpu=True): return get_cuda_devices() if (use_gpu and torc...
import asyncio from asyncio.tasks import wait_for import discord from discord import channel from discord.ext import commands import json import time import os import re import json import requests from urllib.parse import urlparse # Get configuration.json with open("config.json", "r") as config: data = json.load(co...
# _ # _ooOoo_ # o8888888o # 88" . "88 # (| -_- |) # O\ = /O # ____/`---'\____ # .' \\| |// `. # ...
""" This Module defines the basic models for all annotations available in the 300W-LP dataset and creates their data model through python classes. """ from __future__ import annotations from typing import Dict, List import math import numpy as np from data.datatool_api.data_validation.base_model import BaseModel from...
import os import shutil import numpy as np import glob import pandas as pd import xml.etree.ElementTree as ET from functools import reduce from .generate_tfrecord import genTfr import subprocess from .util import vocTrainTestSplit, xml_to_df import pdb import sys import signal MODEL_FILE_PLACEHOLDER = 'YOUR_MODEL_FILE...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 11 10:31:47 2021 @author: nd """ import sys import re from .build_struts import * # add file names here ## origin file #file_in = sys.argv[1] ## output file file_out = "_output.txt" # read in file def file_read(file_in): ...
""" Contains the base class and some enums that are shared across all GPIO modules. """ # IDEA: Possible implementations -@flyte at 23/02/2021, 21:37:43 # Decide which executor we should use for async functions. # https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor # Should we use the...
from __future__ import division import time import torch import torch.nn as nn from torch.autograd import Variable import numpy as np import sys root_dir = "/home/songanz/Documents/Git_repo/fusion/" # change this for your own usage sys.path.append(root_dir) ros_path = '/opt/ros/kinetic/lib/python2.7/dist-packages' ...
#!/usr/bin/env python ''' CEM counter plot.py: A program measuring the count rate from the channel eletron multiplier and plotting it in real time. <NAME>, November 2018 #################################################################################################### Largely built from previous code; however a us...
# -*- coding: utf-8 -*- """ Created on Fri Aug 9 16:50:02 2019 @author: V2 """ from qcodes import MultiParameter import matplotlib.pyplot as plt import numpy as np import time class fake_digitizer(MultiParameter): """docstring for fake_digitizer""" def __init__(self, name): super().__init...
# -*- coding: utf-8 -*- """ :synopsis: ROS-connected HAL pin objects for use in :py:mod:`hal_hw_interface.ros_hal_component` .. moduleauthor:: <NAME> <<EMAIL>> .. inheritance-diagram:: hal_hw_interface.ros_hal_pin.RosHalPin hal_hw_interface.ros_hal_pin.RosHalPinPublisher hal_hw_...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Oct 30 20:52:00 2017 @author: ldy """ import numpy as np import tensorflow as tf import tensorlayer as tl from tensorlayer.layers import * from utils import * def generator_simplified_api(inputs, is_train=True, reuse=False): image_size = 256 ...
from django.db.models import Q, Count from django.http import JsonResponse from asgiref.sync import async_to_sync import channels.layers from main.views import not_found_view from utils.views import allow_methods, validate_body from ..models import Tournament, Player, Race, Result from ..schedule import schedule from...
import numpy as np import pandas as pd # eps = np.finfo(float).eps # from numpy import log2 as log # import pprint class Node: def __init__(self): self.split = None # which feature will be splitted on (Taste) self.feature_values = None # feature values to be considered while splitting the node (...
#!/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...
__version__ = '3.9.7' __author__ = 'Sr.Gambiarra | HeitorTasso' __about__ = ''' Esse programa serve para facilitar o desenvolvimento de apps feito com Kivy ou KivyMD. - Como ele faz isso? Com o KivyMaker podemos atualizar o nosso App, sem ter que reiniciar o script pelo terminal ou IDE. ...
from statsmodels.compat.python import range import numpy as np from scipy.stats import f as fdist from scipy.stats import t as student_t from scipy import stats from statsmodels.tools.tools import clean0, fullrank from statsmodels.compat.numpy import np_matrix_rank #TODO: should this be public if it's just a containe...
""" Copyright <NAME> College MIT License Fall 2019 Lab 3 - Depth Camera """ ################################################################################ # Imports ################################################################################ import sys sys.path.insert(0, "../../library") from racecar_core imp...
# VIMBUFSYNC, original version by <NAME> <frederic.bour _ lakaban.net> # Released under the terms of the WTFPL license. See below. # # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # Version 2, December 2004 # # Copyright (C) 2004 <NAME> <<EMAIL>> # # Everyone is permitted to copy and distr...
''' Datastore methods for saving a macro. ''' import re import logging import urllib import os from google.appengine.api import memcache from google.appengine.ext import db from macro.util import encode from macro.exceptions import InvalidSearchErr...
"""Plotting functions for integration lecture.""" from functools import partial import chaospy as cp import matplotlib.pyplot as plt import numpy as np import pandas as pd from integration_algorithms import monte_carlo_naive_one from integration_algorithms import quadrature_gauss_legendre_one from integration_algorith...
import argparse import logging import math import os from glob import glob import torch import torch.nn.functional as F import torchvision from PIL import Image from tqdm import tqdm import utils.options as option import utils from data.image_corruptor import ImageCorruptor from trainer.ExtensibleTrainer import Exte...
import os import matplotlib.pyplot as plt import numpy as np # linear algebra import pydicom import scipy.ndimage from skimage import measure def load_scan(path): slices = [pydicom.read_file(os.path.join(path, s)) for s in os.listdir(path) if os.path.isdir(path)] slices.sort(key=lambda x: float(x.ImagePositi...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
from brats.config import config, config_unet, config_dict from unet3d.utils.path_utils import make_dir from unet3d.utils.path_utils import get_filename_without_extension from unet3d.utils.path_utils import get_shape_from_string from unet3d.utils.path_utils import get_training_h5_paths from unet3d.utils.path_utils impor...
import praw import prawcore import sqlite3 from time import sleep from datetime import datetime FOOTER = '''___\n\n ^^[About](https://redd.it/7kfrvj) ^^| ^^[Feedback/Test](/r/goalbot) ^^| ^^[Donate](https://www.reddit.com/r/goalbot/wiki/donate)''' def authenticate(): print('Authenticating') reddit = praw.Re...
import copy import logging from contextlib import contextmanager from typing import Any, Dict, Generator, List, Optional, Tuple import numpy as np import qcodes as qc from qcodes import validators as vals from qcodes.dataset.experiment_container import (load_experiment, ...
#!/usr/bin/env python3 ''' VDB: VCF commands ''' import sys import gzip import uuid import shutil import inspect import argparse import tempfile import subprocess import multiprocessing from pathlib import Path import orjson as json import pyarrow.parquet as pq import biograph.vdb as vdb import biograph.vdb.athena a...
from operator import attrgetter from datetime import datetime class LazyObjectWrapper(object): def __init__(self, fn): self.__fn = fn self.__setup = False self.__obj = None def __ensure_setup(self): if not self.__setup: self.__obj = self.__fn() self.__s...
from typing import List, Optional, NamedTuple, Callable import io import re from ..clang import cindex from ..parser.type_context import TypeContext from ..parser.struct_cursor import WrapFlags from ..parser.function_cursor import FunctionCursor from .basetype import BaseType from .definition import StructType,...
#!/usr/bin/env python """Local path planner using pure-pursuit. Subscribed Topics: path - (nav_msgs/Path) The path to follow. odom - (nav_msgs/Odometry) Odom messages are used to estimate the robot's current speed, which is needed to determine steering angles for pure pursuit. scan - (sen...
#!/usr/bin/env python3 import argparse import datetime import hashlib import io import json import os import pathlib import random import socket import time from urllib.parse import quote import lorem import requests keystone_url_template = "http://{host}:{port}/v3".format swift_url_template = "http://{host}:{port}/...
import io import json from pathlib import Path from typing import Optional import signal import sys import traceback import time import types import contextlib from pydantic import ValidationError import redis import requests from .redis_log_capture import capture_log from ..predictor import BasePredictor, get_input_...
#!/usr/bin/env python """ Usage: vocab.py [options] TRAIN_FILE VOCAB_FILE Options: -h --help Show this screen. --use-bpe Use bpe --size=<int> vocab size [default: 10000] --freq-cutoff=<int> frequency cutoff [default: 2] --user-tokens=<strin...
import copy import errno import functools import logging import os import pkg_resources import platform import re import socket import sys import threading import traceback import munch from oslo_utils import reflection from oslo_utils import strutils import six from tabulate import tabulate from webob import exc from...
""" Tagulous test of serializers, dumpdata and loaddata Modules tested: tagulous.serializers.* """ # There were originally separate tests for loaddata and dumpdata, but have been # combined because in Django 1.4-1.8 serializer order is not deterministic, ie # order of keys in dicts can change, causing output order...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Contributors: <NAME> <<EMAIL>> # # Distributed under terms of the BSD 3-Clause license. """ Plot topography and flow depth """ import os import numpy import matplotlib from matplotlib import pyplot from clawpack.geoclaw import topotools from clawpack...
"""Test :class:`qibo.abstractions.gates.M` as standalone and as part of circuit.""" import pytest import numpy as np from qibo import models, gates, K def assert_result(result, decimal_samples=None, binary_samples=None, decimal_frequencies=None, binary_frequencies=None): if decimal_frequencies i...
# -*- coding: utf-8 -*- """ Created on Mon Jan 29 11:56:46 2018 This module is an implementation of the (M)ingle (O)bjective (C)ontinuous (G)enetic (A)lgorithm. Using uon-dominated sorting, archive and crowding. @author: sreimond """ import numpy as np from copy import deepcopy import itertools class Population( ...
from django.views import View from django.views.generic.base import TemplateView from django.shortcuts import render from django.shortcuts import redirect from django.shortcuts import get_object_or_404 from django.contrib.auth.mixins import LoginRequiredMixin from django.core.exceptions import PermissionDenied from dja...
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=wrong-import-position, wildcard-import """ Extract positional and calibration info for DOMs and save the resulting dict in a pkl file for later use """ from __future__ import absolute_import, division, print_function __all__ = ['N_STRINGS', 'N_DOMS', 'e...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import numpy as np import argparse import random import torch import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.utils.data import torchvision.transforms as transforms from torch.autograd import Variable import utils from util...
"""Xception。""" import functools from .. import keras, K, ndimage, hvd def xception(weights="imagenet", input_tensor=None, input_shape=None, for_small=False): """Xception。 padding="same"にしたりinitializer, regularizerを指定したりしたもの。 feature map例: - model.get_layer("block1_conv2_act").output # 1/2 ...
import numpy as np import sharpy.utils.generator_interface as generator_interface import sharpy.utils.settings as settings @generator_interface.generator class ModifyStructure(generator_interface.BaseGenerator): """ ``ModifyStructure`` generator. This generator allows the user to modify structural parame...
# Copyright 2014-2018 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
import re from validator import decorator from validator.constants import * OPTIONS_TYPE_VALUES = ("1", "2", "3") @decorator.register_test(tier=1) def test_install_rdf_params(err, xpi_package=None): """Tests to make sure that some of the values in install.rdf are not gummed up.""" if not err.get_resou...
import sys import wx #import wx.lib.agw.ultimatelistctrl as ULC from ObjectListView import ObjectListView, ColumnDefn import wx.lib.mixins.gridlabelrenderer as glr from src.wizard.controller.frmVirtualList import VirtualList from src.wizard.controller.frmVirtualGrid import VirtualGrid, GridBase #from lib.ObjectListView...
# # This file is part of openCARP # (see https://www.openCARP.org). # # The openCARP project licenses this file to you 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/lice...
#!/usr/bin/env python3 """ Pegasus Metadata is a tool to query metadata collected by Pegasus workflows. Usage: pegasus-metadata [-h] [-v] [-c] {task,file,workflow} ... submit_dir """ ## # Copyright 2007-2012 University Of Southern California # # Licensed under the Apache License, Version 2.0 (the "License"); # yo...
import os import subprocess import os.path import urllib import zipfile import time import signal import sys import multiprocessing import tempfile import re import posixpath def find_program(program, path, withext=True): exts = [""] if sys.platform.startswith("win"): exts += [".exe", "...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import super from builtins import str from builtins import int from future import standard_library standard_library.install_aliases() from avatar.emulators.s...
# -*- coding: utf-8 -*- # # Tencent is pleased to support the open source community by making QT4C available. # Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. # QT4C is licensed under the BSD 3-Clause License, except for the third-party components listed below. # A copy of the BSD ...
import numpy as np import threading import time """ Usefull link: https://www.geeksforgeeks.org/crossover-in-genetic-algorithm/ """ """ Element class, contain a possible solution """ class Element: def __init__(self, idd, geracao, genome): self.idd = idd self.geracao = geracao ...
import flask import os import subprocess import werkzeug.exceptions from datetime import date from functools import lru_cache from psycopg2.extras import NumericRange from ..authenticated_blueprint_preparator import AuthenticatedBlueprintPreparator from ..postgres_rest_api.decorators import rest_endpoint from ..postgre...
import cv2, argparse import numpy as np def makeCartoon(original): # Make a copy of the origianl image to work with img = np.copy(original) # Convert image to grayscale imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # Apply gaussian filter to the grayscale image imgGray = cv2.GaussianBlur(i...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from cms.admin.placeholderadmin import PlaceholderAdminMixin from parler.models import TranslationDoesNotExist from parler.admin import TranslatableAdmin from aldryn_apphooks_config.admin import BaseAppHookConfig, ModelAppHookConfig from aldryn_translati...
import os import csv from annogesiclib.gff3 import Gff3Parser import numpy as np import copy import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.style.use('ggplot') def import_uniprot_data(entry, name_list, feature): '''import uniprot to dict''' ref_name = entry.attributes[feature] ...
""" tesseract.py is a wrapper for google's Tesseract-OCR ( http://code.google.com/p/tesseract-ocr/ ). USAGE: > from PIL import Image > from pyocr.tesseract import image_to_string > print(image_to_string(Image.open('test.png'))) > print(image_to_string(Image.open('test-european.jpg'), lang='fra')) COPYRIGHT: PyOCR...
import auctions from django.contrib.auth import authenticate, login, logout from django.db import IntegrityError from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from django.contrib.auth.decorators import login_required from .models import *...
import sys import os import torch import torch.utils.data as du from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import util from util import * from drugcell_nn_2_inputs_ft_activation import * import argparse import numpy as np import time import gc import matplotlib.pyplot as p...
import matplotlib matplotlib.rcParams.update({'figure.max_open_warning': 0}) import warnings warnings.filterwarnings("ignore", module="matplotlib") import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np from plotting_tools import base_plotter, plotter_3d from index_dicts import creat...
# Copyright 2022 The EvoJAX 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 in w...
import functools import flask from sqlalchemy.exc import IntegrityError from sqlalchemy.orm import joinedload import robostat.db as model from robostat.web.glob import db from robostat.web.login import check_admin, UnauthorizedError from robostat.web.logging import request_logger from robostat.web.views.api import ApiE...
# # Copyright 2019 <NAME> # 2018-2019 <NAME> # # ### MIT license # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # t...
### These functions are used for the Bayesian inference ### in the main jupyter notebook. Note that for all following ### implementations, clarity was preferred over computational efficiency ### or numerical stability. The functions presented here are meant ### to reflect the equations in the main text, i.e. if a certa...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from dist...
from __future__ import division from cctbx.array_family import flex import sys from libtbx import adopt_init_args from cctbx import maptbx import libtbx.phil from libtbx.str_utils import format_value from mmtbx.refinement import print_statistics peak_search_params_str = """ peak_search_level = 1 .type=int max_peaks ...
import ast from importlib import import_module import inspect import multiprocessing from pathlib import Path import re from africanus.experimental.rime.fused.terms.core import Term from africanus.experimental.rime.fused.terms.phase import Phase from africanus.experimental.rime.fused.terms.brightness import Brightness...
from logging import debug, warning from time import time from typing import Dict, Optional from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import AbstractBaseUser from django.core.exceptions import SuspiciousOperation from django.urls...
import random, math import items, util ''' Enemy's possible actions should be written here. That is, enemy must determine which attack and how much damage it will do in this module. However, note that actions are executed on the tile.py. => Make a 'corresponding tile' in order to place the enemy mobs! ''' ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import django_tables2 as tables from django.contrib.auth.decorators import user_passes_test from django.http import JsonResponse from django.shortcuts import redirect, render from django.template.loader import render_to_string from django....
#Notes: #-------------------------- #Element Type: Identifier #-------------------------- #Line 3 #Triangle 5 #Quadrilateral 9 #Tetrahedral 10 #Hexahedral 12 #Wedge 13 #Pyramid 14 #-------------------------- import bpy import bmesh def read_su2_file(context, filepath, ...
""" AllenNLP just uses `PyTorch learning rate schedulers <http://pytorch.org/docs/master/optim.html#how-to-adjust-learning-rate>`_, with a thin wrapper to allow registering them and instantiating them ``from_params``. The available learning rate schedulers are * `"step" <http://pytorch.org/docs/master/optim.html#torc...
from __future__ import (absolute_import, division, print_function) from builtins import * import struct import array import json from .client import PCICV3Client class PCICFormatRecord: def __init__(self, recordId): self.recordMap = {} self.recordMap["type"] = "records" self.recordMap["id"] = str(recordId) s...
# Make a simple text-based graph of prices (or anything else) import formatting_helpers def add_y_axis_labels(table_text, min_value, max_value, first_label_overhang): min_value = formatting_helpers.prettify_decimals(min_value) max_value = formatting_helpers.prettify_decimals(max_value) label_text_length ...