text
stringlengths
3.07k
22.1k
"""RefineNet-LightWeight RefineNet-LigthWeight PyTorch for non-commercial purposes Copyright (c) 2018, <NAME> (<EMAIL>) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code...
"""Steps used for sidebar item list handling in various GUI testing scenarios """ __author__ = "<NAME>" __copyright__ = "Copyright (C) 2016 ACK CYFRONET AGH" __license__ = "This software is released under the MIT license cited in " \ "LICENSE.txt" import time from tests.gui.utils.generic import parse_s...
""" File: my_drawing.py Name: <NAME> ---------------------- TODO: """ from campy.graphics.gobjects import GOval, GRect, GPolygon, GArc, GLabel, GLine from campy.graphics.gtypes import GPoint from campy.graphics.gwindow import GWindow from campy.gui.events.mouse import onmouseclicked from campy.graphics.gimage import G...
# -*- encoding=utf-8 -*- # author: <EMAIL> from utils import PY3k, elapsedtime, YamlConfig, logger, gethtml, mkdirp, outputformat import os import sys from pyquery import PyQuery as pq import re import argparse import math import unicodecsv as csv import json from io import open STOREDPATH='./htmlsamples/btyunso' mkdi...
__all__ = [ 'Matrix5x5', # Single matrix 'ExLaplacian1', 'ExLaplacian2', 'ExLaplacian3', 'ExLaplacian4', 'LoG', # Euclidian distance 'ExPrewitt', 'ExSobel', 'FDoG', 'FDoGTCanny', 'DoG', 'Farid', # Max 'ExKirsch' ] from abc import ABC from typing import Sequence import v...
# -*- coding: utf-8 -*- import re import numpy as np from datetime import datetime from matplotlib import pyplot as plt from .utils import rgb_dist, detect_consecutive_false, to_gray from .utils import str_to_num_rank, num_to_str_rank from .colors import BEIGE, GRAY, DGRAY, LGRAY, GREEN, BLACK from .classifiers imp...
""" Train a network.""" from typing import Union, Callable import logging import argparse import yaml # This is a weird hack to avoid Intel MKL issues on the cluster when this is called as a subprocess of a process that has itself initialized PyTorch. # Since numpy gets imported later anyway for dataset stuff, this sh...
import glob import os import sys import unittest import shutil import subprocess import logging as logger import argparse class test_requirements(unittest.TestCase): """ Ensuring the correct tools are present """ def test_check_requirements(self): if not shutil.which("art_illumina"): lo...
""" The Response class is the result of network request maden with Grab instance. """ import re from copy import copy import logging import email try: from urllib2 import Request except ImportError: from urllib.request import Request import os import json try: from urlparse import urlsplit, parse_qs except ...
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
import sys, os import pkgutil, importlib import cbpos, cbmod logger = cbpos.get_logger(__name__) cbpos.config.set_default('mod', 'disabled_modules', list()) cbpos.config.set_default('mod', 'modules_path', list()) class BaseModuleLoader(object): """ Abstract module loader from which all modules sho...
import datetime # This is a pain: in the db, the field that holds the project name is called # "project", but that is the idiom that code/yaml uses for the whole object. # Too risky to change the db, too likely to cause bugs to change the code # idiom just for this one object, so handling both keys PROJ_NAME_KEY = 'pr...
#!/usr/bin/python3 # Copyright (c) 2021 <NAME> # # Based on: # 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 # to use, copy, modi...
import sys import logging import argparse from . import Manticore from .utils import log, config # XXX(yan): This would normally be __name__, but then logger output will be pre- # pended by 'm.__main__: ', which is not very pleasing. hard-coding to 'main' logger = logging.getLogger('manticore.main') consts = config...
import os import csv import torch import argparse import linecache import numpy as np import operator from lstm import Seq2Seq from lazy_dataset import LazyDataset from bucket_sampler import BucketBatchSampler from utils import prep_eval_batch, get_prev_params, sort_batch, epoch_time from torchtext.data.metrics import...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # # Copyright (c) 2018 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # i...
import asyncio import logging from os import getenv import discord from discord.ext import commands from database.tournaments import Tournament from services.tournamentservice import TournamentService from utils.person import id_from_mention from utils import checks class TournamentCog(commands.Cog, name="Tournamen...
import pytest import tensorflow as tf import numpy as np import zfit.core.basepdf from zfit.core.limits import Space, ANY_UPPER import zfit.models.dist_tfp from zfit.models.dist_tfp import Gauss from zfit.core.parameter import Parameter from zfit.models.functor import ProductPDF from zfit.models.special import SimpleP...
import numpy as np import torch import torch.nn as nn import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) # add parent path import torch.optim as optim import matplotlib.pyplot as plt from sim...
import functools import math import torch from einops import rearrange from opt_einsum import contract class Diffeo(torch.nn.Module): """Randomly apply a diffeomorphism to the image(s). The image should be a Tensor and it is expected to have [..., n, n] shape, where ... means an arbitrary number of leadin...
import inspect import os import time import xlrd # 读取excel文件 import xlwt # 写入excel文件 from xlutils.copy import copy from xlwt import XFStyle from logrecord.WriteLog import WriteLog class TrafficInformationWriteOperation: """ Class:交通信息执行操作 """ def __init__(self, RoadNameList): ...
#pylint: disable=too-many-function-args,missing-docstring import operator from collections import namedtuple from contextlib import suppress, nullcontext from .base import context from .. import objects from ..ast import elements from ..exceptions import RollitTypeError, NoSuchLoopError, RollitReferenceError, CannotRe...
# coding=utf-8 import sys import petsc4py petsc4py.init(sys.argv) import numpy as np # from time import time # from scipy.io import loadmat # from src.stokes_flow import problem_dic, obj_dic from src.geo import * from petsc4py import PETSc from src import stokes_flow as sf from src.myio import * from src.StokesFlowM...
""" " support.py " " Desc: INI: Creates context, message body and sends " LOG: Writes data to a log file " SMTP: Creates context, message body and sends email alerts " TEST: Tests different function defintions " " Author: <NAME> " Ver: 1.0 " Log: [20190320] Initial Versi...
import random from collections import deque import pygame import os from PIL import Image from scipy.misc import imsave from tensorflow.python.keras import Input, Model from tensorflow.python.keras.layers import Conv2D, Flatten, Dense, Concatenate, Lambda, Conv2DTranspose, Reshape from tensorflow.python.keras.activati...
import os import sys sys.path.append('/home/kaveh/Development/eclipse/neos/pyneos/') from circuit import * import random, argparse, pickle import numpy as np from sklearn import linear_model from sklearn.metrics import accuracy_score from sklearn.linear_model import SGDRegressor from sklearn.pipeline import make_p...
import copy from collections import defaultdict import numpy as np from ..base import BaseEstimator from ..options import OPTIONS class BootstrapRunner: def __init__(self, model, n_samples=1000, random_state=None, save_models=False): if not model._fitted: raise ValueError("...
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: cucker0 ## ali DNS 云解析API # https://help.aliyun.com/document_detail/29744.html?spm=a2c4g.11186623.6.617.5d0672edaYqfa7 import hashlib import requests import hmac import time import base64 import json import uuid from urllib import parse class S...
import json import logging import os import secrets import time import urllib from binascii import unhexlify from datetime import timedelta from urllib.parse import urlencode import jwt from django.contrib import messages from django.contrib.auth import login from django.contrib.sites.shortcuts import get_current_site...
# -*- coding: utf-8 -*- """ Download EPG data from Horizon and output XMLTV stuff """ import logging import time import json import http.client def debug(msg): logging.debug(msg) def debug_json(data): debug(json.dumps(data, sort_keys=True, indent=4)) def warning(msg): logging.warning(msg) class Horizo...
# coding: utf-8 # Copyright (c) 2010, 2011 <NAME> <<EMAIL>>. All rights reserved. """ python-ihelp: i18n version of help(). Nameing convention of language pack: ihelp_<language>__<package_name> """ import __builtin__ import hashlib, inspect, locale, logging, operator, os, re, sys, warnings # logger settings DEBUG =...
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------# # Imports #----------------------------------------------------------------------------# from flask import Flask, render_template, request, jsonify # from flask.ext.sqlalchemy import SQLAlchemy import logging from lo...
# ============================================================================== # Copyright 2019 - <NAME> # # NOTICE: 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, ...
#!/usr/bin/env python import numpy as np import math import random import rospy import tensorflow as tf from Wanderer import Wanderer from utils import bcolors, action2Twist """ Train a Q value neural network to navigate the wanderer back to map origin from any location """ # Reinforement learning environment related...
#!/usr/bin/env python3 """Generates LaTeX, markdown, and plaintext copies of my cv.""" __author__ = [ '<NAME> <http://bamos.github.io>', '<NAME> <http://ellismichael.com>', ] import argparse import copy import os import re import sys import yaml from bibtexparser.customization import * from bibtexparser.bpa...
from datetime import datetime import re import json from sqlite3 import IntegrityError from logging import getLogger _log = getLogger(__name__) bool_to_int = {'true': 1, 'false': 0, True: 1, False: 0, 'True': 1, 'False': 0, 'on': 1, 'off': 0, 'On': 1, 'Off': 0, 'ON': 1, 'OF...
import json import os import requests #import pandas #import numpy from datetime import date from dateutil.parser import parse def extract_age(resource_array): age = {} for resource in resource_array: if resource['resourceType']=='Patient': if 'birthDate' in resource: age['r...
# Copyright 2020 The T5 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 writi...
import argparse import operator import os import hashlib from _collections import defaultdict from Thing import Thing from pathlib import Path parser = argparse.ArgumentParser() fdgroup = parser.add_mutually_exclusive_group() # -f and -d options are mutually exclusive fdgroup.add_argument('-f', action='st...
import sys import os if 'FACTMINE_HOME' in os.environ: pyfunctor_path = os.path.join(os.environ['FACTMINE_HOME'], 'third/pyfunctor') sys.path.append(pyfunctor_path) else: sys.exit("please declara environment variable 'FACTMINE_HOME'") import csv_handler as csv_handler import transform as transform import n...
from django.conf.urls import url from django.shortcuts import HttpResponse,render,redirect from django.utils.safestring import mark_safe from django.urls import reverse from stark.utils.my_page import Pagination from django.db.models import Q class ShowList(object): def __init__(self,config_obj,queryset,request):...
import torch import torch.nn as nn import torch.nn.functional as functional from src.lap_solvers.sinkhorn import Sinkhorn from src.build_graphs import reshape_edge_feature from src.feature_align import feature_align from src.factorize_graph_matching import construct_aff_mat from models.NGM.gnn import GNNLayer from mod...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Dec 4 16:04:44 2020 @author: daiwei """ ######################################## # This part generates the contour plot # ######################################## import numpy as np import matplotlib.pyplot as plt from scipy.ndimage.filters i...
import json import plotly from plotly.graph_objs import Bar from flask import Flask from flask import render_template, request, jsonify from sklearn.externals import joblib from sqlalchemy import create_engine import sys, os # import libraries import nltk nltk.download(['punkt', 'wordnet', 'averaged_perceptron_tagger'...
from tkinter import * from tkinter import filedialog import torch from torchvision import transforms from PIL import Image, ImageTk from models import Encoder, Decoder, Model import numpy as np import sqlite3 def main(): root = Tk() conn = sqlite3.connect('Hospital_image.db') cur = conn.cursor() ...
import argparse import torch import datetime import os import pickle import tqdm import sys from pathlib import Path import numpy as np import logging import re from itertools import chain from torch.utils import data import torch.nn.functional as F import torchvision from cswm import utils from cswm.models.modules ...
import json import copy from json import JSONEncoder dict = {} outerList = [] conList = [] counter = 0 lastNode = None selected = None joinIsSet = False lastDict = {} lastOuterList = [] lastConList = [] lastCounter = 0 lastLastNode = None undoable = False inNode = False inType = False operators = ['=', '<>', '<', '...
import matplotlib.pyplot as plt from matplotlib import ticker import numpy as np from divHretention import Exposition correspondance_dict = { "arc_length": { "label": "Distance along divertor (m)" }, "ion_energy": { "yscale": "log", "label": "Incident energy (eV)", "linesty...
#!/usr/bin/env python """ @author <NAME> """ import ropy as rp import spatialmath as sm import numpy as np import time import random import qpsolvers as qp class Exp(object): def __init__(self): # Make Robots self.rQ = rp.UR5() self.rQ.name = 'Quad UR5' self.rR = rp.UR5() ...
import os import hashlib from pathlib import Path from typing import List, Tuple, Dict def algorithm_manager_factory(alg_dict, name): """ Returns new class deriving after AlgorithmManager. :param alg_dict: the new manager will use algorithms from this dict :param name: the name of the new ma...
# # An attempt to translate the main functionality my main # R radio signal packages gursipr and stuffr to python. # Nothing extremely complicated, just conveniece functions # # import numpy import math import matplotlib import matplotlib.cbook import matplotlib.pyplot as plt import datetime import time, re import pick...
from . import mincfg def test_to_CNF(): g1 = [ (-1, [-1, -1]), (-1, ['(', -1, ')']), (-1, ['']), ] g1 = mincfg.to_cnf(g1) assert(len(g1) == 4) assert((-1, [-1, -1]) in g1) assert((-1, ['(', -2]) in g1) assert((-1, ['(', ')']) in g1) assert((-2,...
import sys import os import numpy as np import acl import cv2 import glob path = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path, "..")) sys.path.append(os.path.join(path, "../../../../common/")) sys.path.append(os.path.join(path, "../../../../common/acllite")) from acllite_resource impo...
# CUDA_VISIBLE_DEVICES='' python3 test_planetoid.py --svd_k=100 --dropout_levels=0 --slice_on_u=0 --dataset ind.citeseer --svd_iters=20 --layers=15 # Test w VS w/o dropout import collections import json import os import pickle import sys import time import numpy as np import scipy.sparse import sklearn.decompositio...
import random import numpy as np import toolz from dask.distributed import Future from distributed.utils_test import cluster, gen_cluster, loop # noqa: F401 from sklearn.cluster import MiniBatchKMeans from sklearn.linear_model import SGDClassifier from sklearn.model_selection import ParameterGrid, ParameterSampler fr...
#!/usr/bin/env python # -*- coding: latin-1 -*- # 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 3 of the License, or # (at your option) any later version. # # This program is dis...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 <NAME> <<EMAIL>> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import os import os.path import tempfile ...
#!/usr/bin/env python # optimal control problem to maximize visible task area while taking task # performer occlusion into account # # <NAME> # October 2016 import numpy as np import math from matplotlib import collections as mc import visibility import pylab as pl import shapely from shapely import affinity, geomet...
################# #### Imports #### ################# import os import subprocess from libqtile import qtile, bar, layout, widget, hook from libqtile.config import Click, Drag, Group, Key, Match, Screen from libqtile.command import lazy from libqtile.lazy import lazy from libqtile.utils import guess_terminal mod = "mod...
# coding=utf-8 import numpy as np import pandas as pd from terminaltables import AsciiTable from tqdm import tqdm as tqdm from Qfx import QfxCommon from Qfx import QfxMySql from Qfx import QfxDecomposer from Qfx import QfxPriceConfig from Qfx import QfxPriceHistory from Qfx import QfxPriceResid from Qfx import QfxPrice...
""" Copyright 2021 Comcast Cable Communications Management, 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 agre...
"""Users api""" from collections import namedtuple import csv from datetime import datetime, timedelta from functools import reduce import logging import re import operator import pytz from django.db import transaction from django.db.models import Q from django.core.exceptions import ValidationError from django.core.v...
#v2.1 #importing the Needed modules import time as t from datetime import datetime import getpass, os, ctypes, socket import random as ran import webbrowser as web #import locale as loc logg="true" #if the errors should appear on an log file. logg_makefile="true" #if an log file is wanted. dl_link="ht...
#!/usr/bin/env python # Randomize the test environment and then launch from __future__ import print_function, division import os import sys import shlex import argparse import subprocess import collections import numpy as np import rospkg # Import isolation try: import isolation except ImportError as e: sy...
""" :mod:`main` =========== Defines the main ``Actor`` class and ``@concurrent`` decorator for using arq from within your code. Also defines the ``@cron`` decorator for declaring cron job functions. """ import asyncio import inspect import logging from datetime import datetime from typing import Any, Callable, Dict, ...
import glob import os import re import ntpath import logging import json import time import psutil from sklearn.metrics import classification_report from src.helpers.dataframe_helper import df_get, load_data from src.helpers.file_helper import mk_dir, write_json_file from src.helpers.model_helper import load_model, sc...
import ast import os import uuid from os.path import abspath, join import stegbench.utils.filesystem as fs # TOP DIRECTORY stegbench_tld = 'stegbench_assets' #SUB-DIRECTORY TYPES# embeddor = 'embeddor' detector = 'detector' db = 'db' embeddor_dir = join(stegbench_tld, embeddor) detector_dir = join(stegbench_tld, de...
# coding=utf-8 import argparse import httplib import itertools import logging import socket import sqlite3 import time from decimal import Decimal from functools import wraps from operator import itemgetter import arrow import httplib2 import pygsheets import requests from OpenSSL import SSL from retry import retry i...
#!/usr/bin/env python3 import unittest import sys, os from tempfile import mkdtemp from shutil import rmtree, copytree import subprocess import time """This Python tool grabs updated sample sheets from the LIMS. It does this simply by looking for matching files in the SMB share. It's also responsible for renami...
# Princeton University 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/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writ...
import requests from rest_framework import status from presqt.targets.figshare.utilities.validation_check import validation_check from presqt.targets.figshare.utilities.get_figshare_project_data import ( get_figshare_project_data, get_search_project_data) from presqt.targets.figshare.utilities.helpers.get_figshare...
""" Non-Local Spatial Propagation Network for Depth Completion <NAME>, <NAME>, <NAME>, <NAME> and <NAME> European Conference on Computer Vision (ECCV), Aug 2020 Project Page : https://github.com/zzangjinsun/NLSPN_ECCV20 Author : <NAME> (<EMAIL>) ===============================================...
#!/usr/bin/env python """ Created by howie.hu at 2021/4/12. Description:分发到企业微信终端 Changelog: all notable changes to this file will be documented """ import json import time import requests from src.config import Config from src.sender.base import SenderBase from src.sender.utils import send_post_request ...
""" Utility functions for handling terminal colors """ import os from typing import Iterable, List, Mapping, NamedTuple, Tuple, no_type_check import colorama from .consts import ANSI_COLORS, ANSI_RGB class Style(NamedTuple): open: str close: str _Rgb = Tuple[int, int, int] _Hsv = Tuple[float, float, float...
""" Draw Figures - Chapter 6 This script generates all of the figures that appear in Chapter 6 of the textbook. Ported from MATLAB Code <NAME> 25 March 2021 """ import utils import matplotlib.pyplot as plt import numpy as np import seaborn as sns def make_all_figures(close_figs=False): """ Call all the fi...
# -*- coding: utf-8 -*- """ Functions for fetching analogy datasets """ from collections import defaultdict import glob import os import numpy as np from sklearn.utils import check_random_state from sklearn.datasets.base import Bunch from .utils import _fetch_file, _change_list_to_np from ..utils import standardiz...
# coding: utf-8 """ This module contains all data objects getted from forum and wiki API. These API provides JSON data, and this module enhances data model by mirroring data attributes to data model. Here is an exemple : .. code-block:: python from campbot import CampBot bot = CampBot(use_demo=True) ...
import pandas as pd import numpy as np import confidence as cf import matplotlib.pyplot as plt import matplotlib as mpl import os import json from matplotlib.ticker import ScalarFormatter from scipy.optimize import OptimizeResult from scipy.optimize import least_squares from scipy.linalg import svd import matplotlib.ti...
from __future__ import unicode_literals,print_function import numpy as np import matplotlib.pylab as plt import matplotlib as mpl from tinydb import TinyDB,where import math import time import sys import copy import list_dict_DB;reload(list_dict_DB) list_dict_DB = list_dict_DB.list_dict_DB import pandas as pd impo...
import glob import os import json import numpy as np import trimesh import imageio import openmesh import cv2 from tqdm import tqdm import pickle import time, threading import scipy.spatial.transform image_data_root = "/raid/celong/FaceScape/fsmview_images" landmark_root = "/raid/celong/FaceScape/fsmview_landmarks" m...
# -*- coding: UTF-8 -*- from collections import namedtuple import collections import re from argparse import Namespace import tensorflow as tf from tensorflow.contrib import layers from util import diagnose from model import pooling try: SparseTensor = tf.sparse.SparseTensor to_dense = tf.sparse.to_dense exce...
# Authors: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD 3 clause import ipyvuetify as v from .pylbmwidget import out, debug_widget import re import enum from traitlets import List, UseEnum, Unicode from .dialog_form import Form, Item, Dialog, add_rule class SaveType(enum.E...
import io import os import sys import unittest class Test_TestProgram(unittest.TestCase): def test_discovery_from_dotted_path(self): loader = unittest.TestLoader() tests = [self] expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__)) self.wasRun = False ...
#!/usr/bin/python3 from pysimbotlib.core import PySimbotApp, Simbot, Robot, Util from kivy.logger import Logger from kivy.config import Config import random import csv import os import copy # # Force the program to show user's log only for "info" level or more. The info log will be disabled. # Config.s...
# Create your views here. import os import operator from django.shortcuts import render from django.views.generic import ( TemplateView, ListView, FormView, DetailView ) from django.conf import settings from django.http import HttpResponse class SPECParseReportsView(TemplateView): template_name = "reports/t...
""" Lovasz-Softmax and Jaccard hinge loss in PyTorch <NAME> 2018 ESAT-PSI KU Leuven (MIT License) Taken from https://github.com/bermanmaxim/LovaszSoftmax/ """ from __future__ import print_function, division import torch from torch.autograd import Variable import torch.nn.functional as F import numpy as np try: fr...
######################################################### ### DNA variant annotation tool ### Version 1.0.0 ### By <NAME> ### <EMAIL> ######################################################### import pandas as pd import numpy as np import allel import argparse import subprocess import sys import os.path import pickle...
""" This library helps populate a series of JSON files from a running Zulip instance. Conceptually it just moves data in one direction: Zulip -> file system (JSON files) This is probably the most technical part of the archive codebase for now. Conceptually, it's just connecting to Zulip with the Python API for ...
from Bio.PDB import PDBParser, PDBIO, NeighborSearch, Selection, rotaxis from Bio.PDB.vectors import Vector import numpy as np import os, argparse import time import pele_platform.Errors.custom_errors as cs def calculate_com(structure): structure_mass = 0.0 com = np.zeros(3) for atom in structure.get_atoms...
# -- Import -- # from __future__ import print_function # Python 2.6+ or 3.0+ import configparser import csv import os import sys import time import itertools import pygame import simpleaudio import tqdm # Deal with py Version skew if sys.version[0] == "3": raw_input = input # -- End Import -- # # -- Classes ...
import argparse import copy import random import numpy as np import torch import torch.nn.functional as F from sklearn.model_selection import StratifiedKFold from tqdm import tqdm from cogdl.data import Data, DataLoader from cogdl.datasets import build_dataset from cogdl.models import build_model from cogdl.utils imp...
#!/usr/bin/env python3 # Copyright (c) 2019 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merg...
#!/usr/bin/env python3 import argparse import logging as l from pathlib import Path import e2e.channel as channel import e2e.client as client import e2e.connection as connection import e2e.packet as packet import e2e.relayer as relayer from e2e.cmd import Config from e2e.common import * def loop(c: Config): IB...
# Copyright (c) 2014-present PlatformIO <<EMAIL>> # # 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 ag...
import torch.nn as nn import math import torch.utils.model_zoo as model_zoo import torch import numpy as np from model.blurpool import BlurPool affine_par = True def outS(i): i = int(i) i = (i + 1) / 2 i = int(np.ceil((i + 1) / 2.0)) i = (i + 1) / 2 return i def conv3x3(in_planes, out_planes, s...
from __future__ import print_function import subprocess import sys from commcare_cloud.cli_utils import print_command from commcare_cloud.commands.command_base import CommandBase, Argument from commcare_cloud.environment.main import get_environment from .getinventory import get_server_address, get_monolith_address fro...
import requests import re import os import csv import time ############################################################################### # Najprej definirajmo nekaj pomožnih orodij za pridobivanje podatkov s spleta. ############################################################################### # definira...
import math import random import shutil import numpy import onnx import torch import torch.backends.cudnn from PIL import Image, ImageOps, ImageEnhance from caffe2.proto import caffe2_pb2 from caffe2.python import core, workspace, model_helper from caffe2.python.onnx.backend import Caffe2Backend from torchvision.trans...
"nuget rules" load("@io_bazel_rules_dotnet//dotnet/private:providers.bzl", "DotnetLibraryInfo") load("@io_bazel_rules_dotnet//dotnet/platform:list.bzl", "DOTNET_CORE_FRAMEWORKS", "DOTNET_CORE_NAMES") def _dotnet_nuget_impl( ctx, build_file = None, build_file_content = None): """dotnet_nuge...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import ray from ray.rllib.evaluation.postprocessing import compute_advantages from ray.rllib.evaluation.tf_policy_graph import TFPolicyGraph, \ LearningRateSchedule from ray.rllib.m...