text
stringlengths
6.04k
39.5k
import traceback from io import StringIO from logging import getLogger, Logger from typing import Type, Dict, Any, Set, Tuple, List from warnings import warn from copy import deepcopy from parsyfiles.log_utils import default_logger from parsyfiles.converting_core import JOKER from parsyfiles.filesystem_mapping import...
import unittest import cpmpy as cp from cpmpy.transformations.flatten_model import * from cpmpy.expressions.variables import _IntVarImpl, _BoolVarImpl class TestFlattenModel(unittest.TestCase): def setUp(self): self.ivars = cp.intvar(1, 10, (5,)) self.bvars = cp.boolvar((2,)) #self.constrai...
from PIL import Image import PIL import PIL.ImageOps import PIL.ImageFilter import pytesseract import os import datetime from difflib import SequenceMatcher try: from .SongListCorrector import SongListCorrector except ImportError: from SongListCorrector import SongListCorrector def check_known_seq(check_strin...
"""This module handles observation modes that are defined in graph tables. **Global Variables** * ``pysynphot.observationmode.rootdir`` - Same as ``pysynphot.locations.rootdir``. * ``pysynphot.observationmode.datadir`` - Same as ``pysynphot.locations.specdir``. * ``pysynphot.observationmode.wavecat`` - Same as ...
import os import os.path import glob import re import sys import gzip import io import logging import logging.config import urllib.parse import configparser import mimetypes import chardet from flask import Flask, make_response, request, abort, render_template, send_file, send_from_directory import subprocess import ti...
#! /usr/bin/env python import click import os import logging logger = logging.getLogger(__name__) @click.group() @click.version_option() @click.option('--debug', 'debug_mode', is_flag=True) def cli(debug_mode): """ A toolset for investigating the interactions between circRNA, miRNA, and mRNA. """ r...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # 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/LICEN...
#!/usr/bin/python # -*- coding: UTF-8 -*- import os import subprocess import socket import datetime import time import ctypes import platform NO_PROCESS = 0 NO_CONF = 1 NO_LOG = 2 SUCCESS = 6 def make_dirs(dir_list): ''' Create diretories ''' for file_path in dir_list: if not os.path.exists(fil...
# version code a87747696b8c coursera = 1 # Please fill out this stencil and submit using the provided submission script. from GF2 import one from math import sqrt, pi from matutil import coldict2mat from solver import solve from vec import Vec from vecutil import list2vec ## 1: (Problem 1) Span of Vectors over R, A...
import os import glob import re import itertools import json import numpy as np import pandas as pd import seaborn as sns import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.colors import to_hex from conf import drivers_path def config_params(font_size=7): mpl.rcParams.update(mpl.rcParamsD...
## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c # $Id$ # # Copyright (C) 2001-2008 <NAME> and Rational Discovery LLC # All Rights Reserved # """ various statistical operations on data """ import numpy def StandardizeMatrix(mat): """ This is the standard *subtract off the average and divide b...
""" Filename: plot_zonal_water_budget_change.py Author: <NAME>, <EMAIL> Description: """ # Import general Python modules import sys, os, pdb, glob import argparse import itertools import numpy import iris from iris.experimental.equalise_cubes import equalise_attributes import iris.plot as iplt import mat...
import logging import pygame import src.blocks as blocks import src.virus as viruses import src.world as world from src.turn_simulation import simulate_turn from src.virus import Virus from src.world import World, INDUSTRIES log = logging.getLogger("main.game") log.setLevel(logging.INFO) log.info("game logger initia...
# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the deploy module.""" from __future__ import print_function import json import multiprocessing import os from chromite.cli import com...
#!/usr/bin/python # -*- coding: utf-8 -*- # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------...
from sys import exit, argv from gettext import gettext as _ from typing import Optional import logging import argparse from argparse import * import functools import inspect logger = logging.getLogger(__name__) HELP_OPTIONS = ["-h", "--help"] SUBCOMMAND = "_subcommand_dest_for_clappy" if len(argv) == 2 and argv[1].l...
from fileinput import filename import io import os import sys # parent_dir=os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # sys.path.append(parent_dir) import getopt import enum from typing import Any import logging from logging.handlers import RotatingFileHandler from typing import List, Tuple, Dict ...
# -*- coding: utf-8 -*- from __future__ import absolute_import import numpy as np from sklearn.base import BaseEstimator, RegressorMixin from sklearn.pipeline import Pipeline from sklearn.linear_model import ( ElasticNet, # includes Lasso, MultiTaskElasticNet, etc. ElasticNetCV, HuberRegressor, Lars,...
import json import logging from copy import deepcopy from urllib3 import Retry from binascii import unhexlify try: from json.decoder import JSONDecodeError except ImportError: JSONDecodeError = ValueError import requests import datetime as dt from dateutil import parser from future.utils import raise_from from...
from keras import backend as K from keras import layers from keras.layers import Lambda from keras.layers import Add, Activation, BatchNormalization, Conv2D, Dense, GlobalAveragePooling2D, Input, MaxPooling2D, Multiply, SeparableConv2D, UpSampling2D from keras.initializers import glorot_uniform from keras import Model ...
"""Learn to play Wythoff's with a DQN, using a (x,y) board representation.""" import os import csv import sys import errno from copy import deepcopy from collections import namedtuple from collections import defaultdict import torch import torch.optim as optim import torch.nn.functional as F import random import torch...
# Copyright 2022 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 model.candidate_box_process import * def abs_smooth(x): absx = tf.abs(x) minx = tf.minimum(absx, 1) r = 0.5 * ((absx - 1) * minx + absx) return r def get_shape(x, rank=None): if x.get_shape().is_fully_defined(): return x.get_shape().as_list() else: static_shape = x.get_sh...
import os import datetime import numpy as np from argparse import Namespace from copy import deepcopy # For OpticFlow (RAFT) import torch from RAFT.core.raft import RAFT from RAFT.core.utils import flow_viz # from RAFT.core.utils.utils import InputPadder # For DeepDream import zipfile import tensorflow as tf import t...
import os import time import argparse import datetime import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import DataLoader from torch.optim import lr_scheduler from model import DRL, RnnEncoder, ConvEncoder, RnnEncoder_2, criticAttent...
# -*- coding:utf-8 -*- """ :author: <NAME> :copyright: © 2019 <NAME> :time: 2019/11/10 15:45 """ from pathlib import Path from typing import List, Tuple import arrow from flask import ( render_template, redirect, request, url_for, jsonify, current_app, abort, ) from flask_login ...
# Training functions and definitions # # This contains all we need to train. # Import as follows: # # > from lib_train import * # from common import * import os from ext.random_eraser import get_random_eraser from ext.mixup_generator import MixupGenerator from ext.balanced_mixup_generator import BalancedMixupGenerator...
""" This module contains class for ETF trick generation and futures roll function, described in <NAME>'s book 'Advances in Financial Machine Learning' ETF trick class can generate ETF trick series either from .csv files or from in memory pandas DataFrames """ # Imports import warnings import pandas as pd import numpy ...
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. """Netlink Module netli...
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
""" Contracts and helper functions/classes for dealing with ASAs. """ import abc import binascii import enum import json import base64 import hashlib import logging from collections import OrderedDict from typing import Dict, List import pyteal import algosdk.logic from algosdk.future import transaction from algosdk.v...
import numpy as np import math class Quaternion_attitude(object): def __init__(self): pass def get_error_norm(self,relative_attitude): target_attitude1 = np.asarray([1.,0.,0.,0.]) target_attitude2 = -target_attitude1 att_error = np.minimum( np.li...
from curveCreator.py23 import * from curveCreator.qt_util import * import os, glob, warnings, webbrowser from functools import partial from curveCreator import mayaWidget from curveCreator import captureWindow from curveCreator import mayaUtils __VERSION__ = "3.0.20211220" _DIR = os.path.dirname(__file__)...
from __future__ import annotations from typing import List, Callable, Optional, Tuple from dataclasses import dataclass from enum import Enum import random import sys import numpy as np import numpy.linalg import scipy.optimize, scipy.linalg import math class BoardSolver(Enum): # Fastest solver # avg 14.1ms ...
# Copyright 2015, 2016 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
""" An IR builder for MLIR. """ ########### # Imports # ########### import jinja2 import mlir import functools import itertools from contextlib import contextmanager from collections import OrderedDict from .sparse_utils import MLIRSparseTensor from .engine import parse_mlir_functions, MlirJitEngine from .types impor...
""" Generator of mesh entities and tags """ import numpy as np from pymoab import types, rng, topo_util from ..geoUtil import geoTools as gtool from .get_item import GetItem class MeshEntities(object): def __init__(self, core, entity_type): # Main MOAB structures. self.mb = core.mb self.m...
import json import logging from collections import namedtuple from pathlib import Path from datetime import datetime, timedelta import requests from vintage_stats.constants import VERSIONS from vintage_stats.utility import WLRecord, get_days_since_date logging.basicConfig(level=logging.ERROR) hero_map = None clas...
#! /usr/bin/python # Python ctypes bindings for VLC # # Copyright (C) 2009-2012 the VideoLAN team # $Id: $ # # Authors: <NAME> <olivier.aubert at liris.cnrs.fr> # <NAME> <MrJean1 at gmail.com> # <NAME> <geoff.salmon at gmail.com> # # This library is free software; you can redistribute it and/or modif...
# Copyright 2022 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, ...
"""Code to interface with the SMA inverters and return the results.""" import os import asyncio import datetime import time import logging from pprint import pprint from dateutil import tz from astral.sun import sun, elevation, azimuth from astral import LocationInfo, now import clearsky import version from invert...
# -*- coding: utf-8 -*- """Created on Thu Jan 7 17:20:34 2021. @author: oebbe """ import logging import numbers import os import sys import flopy import numpy as np import xarray as xr from .. import mdims from . import recharge logger = logging.getLogger(__name__) def sim_tdis_gwf_ims_from_model_ds(model_ds, ...
# This is all based on ntm.py found in the seya-repository of EderSantana, # https://github.com/EderSantana/seya/blob/master/seya/layers/ntm.py # as (git clone)'d on 2017-07-12 or something like that. # # It was then, syntactically (and for large parts even semtantically) completely rewritten. # But the core idea, to u...
# Copyright (C) 2021 Xilinx, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
""" MODIFICATIONS 2015.12.03 final_gal is removed as non-main-progenitors are also analized, there is no 1:1 correlation between final galaxies and earlier galaxies. 2015.12.21 Galaxies are saved in HDF format at selected nouts. (for example, nouts_d...
import os import logging from itertools import islice import numpy as np from pystella.util.phys_var import phys # from pystella.rf import rad_func as rf __author__ = 'bakl' logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) LEGEND_MASK_None = 0x00 LEGEND_MASK_Rho = 0x01 LEGEND_MASK_Vars = 0x10 c...
# Copyright (c) 2019 PaddlePaddle 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 app...
__all__ = ['to_itk_image', 'to_point_set', 'to_geometry'] import itk import numpy as np def is_arraylike(arr): return hasattr(arr, 'shape') and \ hasattr(arr, 'dtype') and \ hasattr(arr, '__array__') and \ hasattr(arr, 'ndim') have_imagej = False try: import imagej have_imagej = T...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import copy from abc import abstractmethod from multiprocessing import Lock, RLock, freeze_support import numpy as np from pathos.pools import ProcessPool from pylfi.utils import (advance_PRNG_state, check_and_set_jobs, distribute_workload, gener...
#!/usr/bin/env python import argparse import sys import os import re from collections import OrderedDict from lxml import etree as ET class AuxInfo(object): nodes_filepath = None nets_filepath = None weghts_filepath = None placement_filepath = None scl_filepath = None lib_filepath = None cl...
# spikein_utils.py # Single Cell Sequencing Quality Assessment: scqua # # Copyright 2018 <NAME> <<EMAIL>> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Lice...
from collections import OrderedDict from functools import partial from classytags.utils import flatten_context from django.contrib.sites.models import Site from django.template import Context from django.utils.functional import cached_property from django.utils.module_loading import import_string from django.utils.s...
from MyFactory import MyFactory from player import * from data import character_props as props from data import features from random import shuffle import time ################################################ """Beschreibung: Kleines Spiel Das Spiel befindet sich noch in der Entwicklung, allerdings kann ma...
# -*- coding: utf-8 -*- import enum import logging import time import pandas as pd from zvt.api.common import get_one_day_trading_minutes, get_close_time, get_data from zvt.api.technical import get_securities from zvt.domain import TradingLevel, get_db_session, Provider, SecurityType, get_store_category from zvt.util...
from __future__ import unicode_literals from PyQt4 import QtGui, QtCore from PyQt4.QtGui import QWidget, QPainter, QVBoxLayout, \ QColor, QPen, QFrame from qrutilities.imageutils import ImageUtils from qrutilities.numberutils import NumberUtils from db.core.log.logdao import LogDao from gui.util.qt.widgetutils im...
from main import * from numpy.linalg import norm import pytest from itk import RTK as rtk import configparser import numpy as np def wiki_example_RTK(configFile): """ Simulates a cone-beam illumination of an ellipse. Taken from RTK's wiki, see the following page: http://wiki.openrtk.org/in...
# -*- coding: utf-8 -*- # ============================================================================== # This source file is part of SBEMimage (github.com/SBEMimage) # (c) 2018-2020 <NAME> Institute for Biomedical Research, Basel, # and the SBEMimage developers. # This software is licensed under the terms of...
import copy import json import os import time from datetime import datetime, timedelta from urllib.parse import urlparse import requests from xrdsst.controllers.base import BaseController from xrdsst.controllers.client import ClientController from xrdsst.controllers.status import ServerStatus from xrdsst.core.api_util...
import sys sys.path.append('../CGvsPhoto') import image_loader as il from dsift import DsiftExtractor # import pandas as pd import matplotlib.pyplot as plt import numpy as np # from sklearn.neural_network import MLPClassifier from sklearn.svm import LinearSVC from sklearn.metrics import accuracy_score from sklea...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import ast import collections import time import numpy as np import scipy.stats as stats from scipy.stats import norm import os.path def parametric_circle(t,xc,yc,R): x = xc + R*np.cos(t) y = yc + R*np.sin(t) return x,y def inv_parametric_ci...
import os import sys import numpy as np import tensorflow as tf import glob sys.path.append("/../lib") import dataio, custom_metrics from tensorflow import keras from tensorflow.python.keras import layers from tensorflow.python.keras import losses from tensorflow.python.keras import models from tensorflow.python.kera...
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General...
from PyQt5 import QtGui, QtWidgets, QtCore from PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QHBoxLayout, QRadioButton, QButtonGroup, QLabel, QLineEdit, QFormLayout, QMessageBox from PyQt5.QtGui import QIcon, QPainter, QColor, QPen, QImage, QPalette, QBrush, QPixmap from PyQt5.QtCore import QSize, Qt,...
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.template.defaultfilters import truncatewords from django.utils.translation import ugettext_...
""" plot_helpers.py Contains helper functions for plotting metrics. """ # pylint:disable=missing-function-docstring,invalid-name from __future__ import absolute_import, annotations, division, print_function import os from dataclasses import dataclass, is_dataclass from pathlib import Path from typing import Any, Call...
# Copyright 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
#!/usr/bin/python3 # created by cicek on May 09, 2020 06:38 import matplotlib.pyplot as plt import numpy as np from collections import Counter ''' kaynak: https://www.python-course.eu/naive_bayes_classifier_introduction.php ''' # grafik için bakınız: ./figure_male-female.png ''' ./data.txt : boy, ağırlık, cinsiyet...
import os import sys import torch from glob import glob import tensorflow as tf from shutil import rmtree from functools import wraps from itertools import product from traceback import print_exc import network_moments.torch.gaussian as gnm from argparse import Namespace, ArgumentParser from collections import namedtup...
# Copyright 2020 ByteDance 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 writin...
""" Bundled media type transcoders. - :class:`.JSONTranscoder` implements JSON encoding/decoding - :class:`.MsgPackTranscoder` implements msgpack encoding/decoding - :class:`.FormUrlEncodedTranscoder` implements the venerable form encoding """ from __future__ import annotations import base64 import dataclasses impor...
import datetime import io import pickle import base64 from PIL import Image from functools import wraps import streamlit as st import streamlit.components.v1 as componentsv1 import feedparser import pandas as pd import numpy as np import pydub import xlsxwriter import feedparser from urllib.request impo...
import sys import re import os import subprocess import configparser as cp import getopt import csv import os.path import xml.etree.ElementTree as ET import queue import itertools import copy from shutil import copyfile import time import datetime from functools import reduce import uuid print("---START("+str(datetime...
# coding=utf-8 from tqdm import tqdm import Terry_toolkit as tkit # from sqlitedict import SqliteDict import threading import time from tqdm import tqdm import os """ 知识保存到数据库 """ class Kg: def __init__(self,db="tadta/kg.db"): self.db =tkit.Db(dbpath=db) self.tdb=tkit.LDB(path="tdata/lvkg.db"...
'''This code quantitatively measure how user differs from each other. To measure user differences, we approximate this question by meansuring differences across different user groups. We first group the users across their purchasing habbit. ''' import os, sys import json import pickle from collections import OrderedD...
''' * Copyright (C) 2019-2020 Intel Corporation. * * SPDX-License-Identifier: MIT License * ***** * * MIT License * * Copyright (c) Microsoft Corporation. * * 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...
#!/usr/bin/env python # vim: set fileencoding=utf-8 ts=4 sts=4 sw=4 et tw=80 : # # Find stars on the specified image, extract X/Y/flux, and perform # initial match against Gaia source list using image-provided WCS. # # <NAME> # Created: 2019-09-09 # Last modified: 2019-10-29 #-------------------------------------...
""" Polygons and triangles in hyperbolic geometry AUTHORS: - <NAME> (2011-08) - <NAME> (2014-11) """ # ***************************************************************************** # Copyright (C) 2011 <NAME> <<EMAIL>>, # 2014 <NAME> <<EMAIL>>, # 2015 <NAME> <<EMAIL>> # ...
import os import numpy as np import heapq from jinja2 import Environment, FileSystemLoader def contains_float(tree): """Returns True if the given tree contains any floating point splits. Args: tree (Tree): The tree. Returns: bool: True if any split in tree is floating point, else False ...
"""Applies model to a single test scene and exports results. (Note: uses matlab to convert predicted complete dfs to meshes.) """ import os import numpy as np import tensorflow as tf import constants import model import util flags = tf.flags FLAGS = flags.FLAGS flags.DEFINE_string('base_dir', '', ...
import sys, keras, re, os import numpy as np import matplotlib.pyplot as plt from pattern.en import lemma from keras import * from keras.layers import * from keras.models import * from keras.preprocessing import * from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img fr...
# -*- coding: utf-8 -*- """ Created on Tue Aug 13 16:30:16 2019 @author: <NAME> """ ### Program for controlling BK8542B DC Electronic Load for IV curve measurement of solar panel ### import serial, time, csv, os import pandas as pd import itertools as it from time import strftime from array import array...
from __future__ import annotations from math import pow from datetime import datetime, timedelta, timezone from functools import cached_property import json from typing import NamedTuple, Union, Tuple import numpy as np from passpredict._time import jday2datetime_us, epoch_to_jd class Orbit: def __init__(self, ...
""" get trajectory related information """ import os import sys from collections import defaultdict, OrderedDict import numpy as np from copy import deepcopy from scipy.interpolate import CubicSpline from scipy.interpolate import interp1d import scipy.optimize as opt import parse_spe_reaction_info as psri import inter...
from genericpath import getsize from os import close, write import os.path def readContacts(): # Function to display the Contact(s) choice=int(input("\nPress 1 to show ENTIRE contact list\nPress 2 to SEARCH for a contact\n\nEnter your choice: ")) print("\n") if(choice==1): # Display the entir...
import main_pipelines as mp import ctypes from pathlib import Path import subprocess import sys import os import argparse import configparser import json import shutil import vector_analysis import data_rep #ConfigParser support https://docs.python.org/3/library/configparser.html#supported-ini-file-structure parser = ...
"""! @brief Phase oscillatory network for patten recognition based on modified Kuramoto model. @details Implementation based on paper @cite article::nnet::syncpr::1. @authors <NAME> (<EMAIL>) @date 2014-2020 @copyright BSD-3-Clause """ import math import cmath import numpy from pyclustering.nnet import solve_type,...
""" .. currentmodule:: neet.boolean.randomnet .. testsetup:: randomnet import numpy as np from neet.boolean.examples import * from neet.boolean.randomnet import * def neighbors_in(net): return [net.neighbors_in(node) for node in range(net.size)] def neighbors_out(net): return [net....
from copy import copy import numpy as np import matplotlib.pyplot as plt from scipy import linalg as LA from scipy.sparse import linalg as las from opentorsion.disk_element import Disk from opentorsion.shaft_element import Shaft from opentorsion.gear_element import Gear from opentorsion.induction_motor import Inducti...
from __future__ import division, print_function from __future__ import absolute_import from __future__ import unicode_literals import json from os import path from numpy import floor from sympy import Symbol from IPython.display import display import ipywidgets as widgets from pysces import ModelMap from d3networkx_p...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ This file is to simulate "generator" in fairseq """ import os, tempfile, shutil, glob import time import torch import numpy as np import ...
#!/usr/bin/env python3 # # Copyright 2017-2022 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 r...
from fractions import Fraction from amalgam.amalgams import ( Atom, Failure, FailureStack, Function, Numeric, Quoted, SExpression, String, Symbol, Vector, ) from amalgam.engine import Engine from amalgam.environment import Environment from amalgam.primordials import ( _add, ...
import torch import torch.nn as nn import Utils2.utils as utils import torch.nn.functional as F from GNN.GCN import GCN import numpy as np from losses import poly_mathcing_loss device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") def uniformsample_batch(batch, num): final = [] for i in batc...
#!/bin/env python # coding: utf8 # # WhatIsMySchema # # Copyright (c) 2018 <NAME> # # from decimal import * from datetime import datetime import time # strpdate fallback for older Python versions import itertools try: from itertools import zip_longest as zip_longest except: from itertools import izip_longest a...
import sys import numpy as np import os import pylab as pl import seaborn as sns sns.set() # import matplotlib.pyplot as mt # sys.path.append(r"C:\Users\Bob\engert_lab\free_swimming_4fish_setup\modules") # # from shared import Shared from Eye_model_function_curve import * import pandas as pd from openpyx...
# coding=utf-8 from utils import load_vocab, read_corpus, load_model, save_model,Tjson from tqdm import tqdm # # return ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "[CLS]","[SEP]"] # return ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "X","[CLS]","[SEP]"] import Terry_tool...
from annoying.functions import get_object_or_None from django.contrib import messages from django.core.urlresolvers import reverse from django.db import transaction from django.db.models import Q from django.http.response import JsonResponse from django.http import HttpResponseRedirect from django.shortcuts import get_...
# -*- coding: utf-8 -*- # import base64 import calendar import copy import datetime import hashlib import logging import os import re import sys import threading import time import uuid from collections import OrderedDict from email.utils import formatdate from functools import wraps from itertools import chain from ur...
#!/usr/bin/env python3 """ Lincensed under the MIT License. See LICENSE file for more information. """ import json import re import sys import unicodedata from pathlib import Path from zipfile import ZipFile import requests import tbapy # # Define constants that the program uses # # Load the auth key AUTH_PATH = Pa...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import os import shutil import subprocess import sys from pathlib import Path from unittest import mock import git import pybtex.style.formatting import pybtex.style.formatting.unsrt import pybtex.style.template from pybtex.plugin import ...