text
stringlengths
6.04k
39.5k
# -*- coding: utf-8 -*- # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import shutil import sqlite3 import tempfile from squint._compatibility.builtins import * from squint._compatibility.collections import namedtuple from .common import ( StringIO, unittest, ) from squint.select import Select from squint.se...
#!/usr/bin/env python # # Public Domain 2014-present MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a com...
# -*- coding: utf-8 -*- """ Name : grdio.py Created on : 2018/11/24 08:57 Author : <NAME> <<EMAIL>> Affiliation : Institute of Geophysics, CEA. Version : 0.1.0 Copyright : Copyright (C) 2018-2020 GEOIST Development Team. All Rights Reserved. License : Distributed under the MIT License. See...
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
''' Copyright 2021 The Microsoft DeepSpeed Team ''' # The file has been adapted from https://github.com/NVIDIA/Megatron-LM and retains the following license from the original file # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you ...
#!/usr/bin/env python # coding: utf-8 import sys import os import datetime import logging import configparser from collections import defaultdict from dateutil.tz import tzlocal CONFIG_ENV = "AMULOG_CONFIG" DEFAULT_CONFIG = "/".join((os.path.dirname(os.path.abspath(__file__)), "data/config....
"""To add a popup window to the Mahlo HMI PC at the laminators. Designed to be called from the command line over ssl.""" import datetime import json import tkinter import tkinter as tk from tkinter import ttk from dev_common import add_show_messages_button, blank_up, dt_to_shift, exception_one_line, recurse_hover, \ ...
""" This module is a part of system for the automatic enrichment of a WordNet-like taxonomy. Copyright 2020 <NAME>, <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...
""" Test query of case recorder file. """ import glob import os.path import unittest from math import isnan from openmdao.main.api import Assembly, Component, VariableTree, set_as_top from openmdao.main.datatypes.api import Array, Float, VarTree from openmdao.lib.casehandlers.api import CaseDataset, \ ...
""" Devices controlled my the ISY are represented as "nodes" on the ISY device and with Node Objects in the API There are three types of Node Object: * IsyNode - Node Object Represent lights, switches, motion sensors * IsyScene - Scene Object Represents Scenes contains Nodes that comprise a "...
import collections import numpy as np from copy import copy from robosuite.utils import RandomizationError from robosuite.utils.transform_utils import quat_multiply from robosuite.models.objects import MujocoObject class ObjectPositionSampler: """ Base class of object placement sampler. Args: n...
#todo: fix the on_add_to_grid function. Also figure out what is going on between Grid and AdvancedGrid. #For making a grid #a Wall or wall consists of the length of the x Wall and the length of the y Wall. #MyGrid.add_wall(0,10, 10,10) #the first two numbers are saying that our x Wall is from 0 to 10 on the grid. that ...
# -*- coding: utf-8 -*- from __future__ import division from functools import wraps import numpy as np from pandas import DataFrame, Series #from pandas.stats import moments import pandas as pd def simple_moving_average(prices, period=26): """ :param df: pandas dataframe object :param period: periods fo...
from ..base import * class PivotAxis: def __init__(self, pivot_gizmo, axis, picking_col_id): self._pivot_gizmo = pivot_gizmo self.axis = axis self.picking_color_id = picking_col_id def __del__(self): Notifiers.obj.debug('PivotAxis garbage-collected.') def get_toplevel_...
#!/usr/bin/python # (c) 2020, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = """ --- module: na_santricity_mgmt_interface short_description: NetApp E-Series ...
''' Created on Sep 30, 2016 @author: nicolas ''' import os.path import time import pytest from lemoncheesecake.suite import load_suite_from_class from lemoncheesecake import reporting from lemoncheesecake.session import Session from lemoncheesecake.reporting import Report, ReportStats, Result, SuiteResult, TestRes...
import copy as cp from skmultiflow.core.base_object import BaseObject from skmultiflow.lazy.distances import mixed_distance, euclidean_distance from skmultiflow.utils.utils import * class KDTree(BaseObject): """ A K-dimensional tree implementation, adapted for k dimensional problems. Parameters -----...
import collections import copy import logging import typing import pathlib from urllib import parse as url_parse import pandas import numpy from d3m import container, exceptions, utils from d3m.metadata import base as metadata_base logger = logging.getLogger(__name__) def get_columns_to_use( metadata: metadata...
# code for a spectral model, i.e. predicting the spectrum of a single star in normalized space. from __future__ import absolute_import, division, print_function # python2 compatibility import numpy as np from scipy import interpolate from scipy import signal from scipy.stats import norm #==============================...
import csv import json import logging import traceback import typing import urllib from datetime import timedelta from io import StringIO, BytesIO from urllib.parse import urlparse import requests from decouple import config, Csv from pycounter import sushi from pycounter import report from requests import Response im...
#!/usr/bin/env python # encoding: utf-8 ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2009-2011 by the RMG Team (<EMAIL>) # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this softwa...
# -*- coding: utf-8 -*- """ Created on Thu Jul 23 16:44:22 2020 @author: Administrator """ import numpy as np import tensorflow as tf import os import shutil import random import math import scipy.io as sio import time from skimage import measure import binvox_rw import argparse import trimesh from im2mesh.utils im...
# MIT License # Copyright (c) 2021 Netherlands Film Academy # 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 argparse import numpy as np import os # use GPU or not # if network is small and shallow, CPU may be faster than GPU os.environ["CUDA_VISIBLE_DEVICES"]="-1" import tensorflow as tf import time import pickle import maddpg.common.tf_util as U from maddpg.trainer.maddpg import MADDPGAgentTrainer import tensorflow...
#!/usr/bin/env python """Generate guider and spectrograph ICS sequences for running telescope dither tests. Can run in two modes: 1. rastermode, which will move the telescope boresight given a tile ID and step size. One can specify an offset of the raster center from the current location; the script will return to the...
import sys import os import re import collections import itertools import bcolz import pickle import numpy as np import pandas as pd import gc import random import smart_open import h5py import csv import tensorflow as tf import gensim import datetime as dt from tqdm import tqdm_notebook as tqdm # import multiproce...
import torch import torch.nn as nn import torchvision import torchvision.datasets as datasets import torchvision.transforms as transforms import utils import os from PIL import Image class ResnetGenerator(nn.Module): """ Generator class utilizing resnets""" def __init__(self, input_channels, output_channels...
""" Functions used by the dyn_model """ # Modules # ------------------------------------------------------------------------------ import ipdb import matplotlib.pyplot as plt import numpy as np from scipy.optimize import fminbound, nnls, minimize_scalar from scipy.signal import dlsim, dlti from models import ModelDyn...
import matplotlib.pyplot as plt from __future__ import print_function import numpy as np import umap import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader import torch.optim as optim import torchvision.datasets as datasets import torchvision.transforms as transf...
#!/usr/bin/env python3 # ------------------------------------------ # -- Simple Login Tool using Qt # -- Created by: <NAME> # -- License : MIT # ------------------------------------------ import json import os import sys from os.path import expanduser try: from PySide2.QtGui import QColor, QIcon from PySi...
# -*- coding: utf-8 -*- """ @author: <NAME> <<EMAIL>> @brief: for parallel processing: In notebook can't h """ import csv from importlib.machinery import SourceFileLoader import nltk import regex import numpy as np import pandas as pd import multiprocessing from bs4 import BeautifulSoup from collections ...
''' Copyright (c) 2020 <NAME> (Kevin) Dong, <NAME> @file retrieveblock.py @date 2020/05/15 @brief Autonomous object recognition and retrieval with Baron robot @license This project is released under the BSD-3-Clause license. ''' import RPi.GPIO as gpio import serial import time import numpy as np i...
"""Events for keystrokes and other input events""" import sys import time import encodings import codecs from functools import wraps from .termhelpers import Termmode from typing import Text, Optional, List, Union PY3 = sys.version_info[0] >= 3 if PY3: raw_input = input unicode = str chr_byte = lambda i...
import networkx as nx import numpy as np import os from os.path import join as pjoin import copy import torch from .graph_subsampling import graph_dataset_subsampling from .graph_node_random_walk import get_node_random_walk """ References: https://github.com/bknyaz/graph_nn """ class DataReader(): ''' Clas...
import argparse import copy import io import json import logging import logging.handlers import multiprocessing import os import shutil import subprocess import sys import tempfile from enum import Flag, auto from functools import reduce from itertools import groupby, product from logging.handlers import TimedRotatingF...
# coding: utf-8 # ## Project Traffic Sign Classification # ### 1. Load The German Traffic Sign Dataset, but with the images already resized to 32x32. # In[1]: # Load pickled data import pickle import tensorflow as tf training_file = "traffic-signs-data/train.p" validation_file= "traffic-signs-data/valid.p" tes...
# this runs rountines to identify contaminant contigs # which are presumably sequences that were not screened out # in the filter step. # vector library UniVec and known or user specified contaminanting # sequences (by GenBank accession number) can be provided for # additional cleanup # default lirbaries screen are lo...
from Bio import pairwise2 from Bio.SubsMat.MatrixInfo import blosum62 import numpy as np import scipy import pandas as pd import regex as re import pickle def sub_pivot_df(pps, sdf, group=True): """function takes a long form datatable of extracts and peaks (input sdf), filters for peptide plasmids of interest...
#!/usr/bin/python # -*- coding: utf-8 -* import sys, os, re, string, random, time, urllib from time import strftime, gmtime from operator import itemgetter import argparse import json #import commands import csv from rdkit import Chem from extn_coeff_fasta import calc_extn_coeff from pI_fasta import calc_pI_fasta fr...
""" This package deals with parsing output from command line utilities, including command executed on a remote device. The primary interaction with devices is conducted through adb (a command line utility), and progres and status is received as part of the standard output of such commands. The core class for parsing t...
#!/usr/bin/env python3 #-*- encoding:utf8 -*- # # MIT License # # Copyright (c) 2020 micha # # 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 ...
""" TODO: Vertex Color Tangent Space V Flip Normalize Bone Weights Specify Axis Change """ import bpy import struct from enum import Enum class VertexAttributeUsage(Enum): POSITION = 0 TEXTURE_COORDINATE = 1 NORMAL = 2 COLOR = 3 BINORMAL = 4 TANGENT = 5 BONE_WEIGHTS = 6 BONE_INDICE...
"""Helpers for testing. """ from contextlib import contextmanager import itertools import json import unittest from os.path import dirname, join, realpath import html5lib from pando.utils import utcnow from pando.testing.client import Client from psycopg2 import IntegrityError, InternalError import stripe from liber...
#!/usr/bin/env python3 import os,sys import ctypes import time from smvScope import lib61850 import json from datetime import datetime import types from flask import Flask, Response, render_template, request import socket from struct import unpack import threading import binascii application = Flask(__name__) con...
#!/usr/bin/env python3 import os import sys import copy from pycrate_asn1c.utils import * from pycrate_asn1c.glob import * from pycrate_asn1c.setobj import * from pycrate_asn1c.refobj import * from pycrate_asn1c.asnobj import get_asnobj, ASN1Obj, INT, OID from pycrate_asn1c.asnproc import compile_text # # Li...
# -*- coding: utf-8 -*- # ===============LICENSE_START======================================================= # Acumos Apache-2.0 # =================================================================================== # Copyright (C) 2017-2018 AT&T Intellectual Property & Tech Mahindra. All rights reserved. # ===========...
# Copyright (c) 2014, <NAME> # Released subject to the New BSD License # Please see http://en.wikipedia.org/wiki/BSD_licenses from __future__ import unicode_literals import itertools import socket import sys from datetime import datetime from mock import patch, sentinel, Mock from imapclient import six from imapclie...
#!/usr/bin/env python # coding: utf-8 import os import matplotlib.tri as tri import h5py import pandas as pd import numpy as np import matplotlib.pyplot as plt import scipy.stats as st import pickle import time import seaborn as sns from astropy.visualization import hist from copy import deepcopy # from awkde import...
import json import os import random import re import string import tempfile from hashlib import sha256 from urlparse import urlparse from cyclone.web import RequestHandler, Application, HTTPError from cyclone.web import asynchronous from twisted.internet import protocol, defer, reactor from twisted.internet.endpoints ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2017 www.drcubic.com, Inc. All Rights Reserved # """ File: prepare_data.py Author: shileicao(<EMAIL>) Date: 2017/5/21 11:39 1. create vocabulary python prepare_data.py -create_vocabulary -entity_intent ../data/entity_intent_types.txt \ -vocabulary_fil...
# -*- coding: utf-8 -*- from django.db import models from django.core.exceptions import ValidationError from choices_functional_trait import * from choices_models import CHOICES_ALL_COUNTRIES, CHOICES_georefMethod from choices_taxonomy import * from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsRetur...
# ---------------------------------------------------------------------- # inv.reportmaxmetrics # ---------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # ---------------------------------------------------------------------- # Python ...
# pylint: disable=non-parent-init-called # -*- coding: utf-8 -*- # # ramstk.views.gtk3.widgets.dialog.py is part of the RAMSTK Project # # All rights reserved. # Copyright 2007 - 2019 <NAME> doyle.rowland <AT> reliaqual <DOT> com """RAMSTK Dialog Module.""" # Standard Library Imports import os from datetime impo...
import random import copy from assignment.assign import frank_wolfe,FW_main from assignment.graph import * from assignment.line import * import set_input import time #Step 0:Initialization #sequence SEQ=[] #initially every element in the two matrices is assigned the value ‘1’ #transition_matrix TM={ 'L0': {...
# Copyright 2012 OpenStack Foundation # 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 requ...
from datetime import datetime from typing import Dict from typing import Iterable from typing import List from typing import Optional from typing import Sequence from typing import Union import pandas as pd from etna import SETTINGS from etna.datasets import TSDataset from etna.models.base import PerSegmentModel from...
import torch import numpy as np import pandas as pd import os import sys import torch.nn as nn from collections import OrderedDict import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt matplotlib.style.use('ggplot') import seaborn as sns sns.set(font_scale=3, rc={'text.usetex' : False}) sns.set_theme(...
import math from typing import List, NamedTuple, Optional, Tuple, Union from opt_einsum_fx import jitable, optimize_einsums_full import torch from torch import fx import e3nn from e3nn import o3 from e3nn.util import prod from e3nn.util.codegen import CodeGenMixin from e3nn.util.jit import compile_mode from ._tensor...
# Copyright 2017 <NAME>. and # Cable Television Laboratories, 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 appli...
import csv import os import random as random1 import shutil import sys import ELA_Training_Module_Final import VGG16_Training_Module_Final import VGG19_Training_Module_Final from PyQt5 import QtCore from PyQt5 import QtGui from PyQt5.QtCore import * from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets imp...
import json import os import cv2 import numpy as np import paddle import copy from paddle.io import Dataset __all__ = ["XFUN"] class XFUN(Dataset): """ Example: print("=====begin to build dataset=====") from paddlenlp.transformers import LayoutXLMTokenizer tokenizer = LayoutXLMTokeniz...
import re import bempp.api import os import numpy as np import time import pbj.mesh.mesh_tools as mesh_tools import pbj.mesh.charge_tools as charge_tools import pbj.electrostatics.pb_formulation.formulations as pb_formulations import pbj.electrostatics.utils as utils class Solute: """The basic Solute object T...
import math import os import sys from ConfigParser import RawConfigParser DEFAULT_SIZE = 400 BOARD_SIZE = 8 CHECKER_SIZE = 30 MAX_VALID_SQ = 32 MOVE = 0 JUMP = 1 OCCUPIED = 0 BLACK = 1 WHITE = 2 MAN = 4 KING = 8 FREE = 16 COLORS = BLACK | WHITE TYPES = OCCUPIED | BLACK | WHITE | MAN | KING | FREE...
"""Simulation of stems on a 2D plane. TODO: more information here. """ import json import math from os import sys import kdtree from matplotlib import pyplot as plt import matplotlib import matplotlib.patches from mpl_toolkits.mplot3d import Axes3D import numpy as np from drop import Drop from util import * import...
# Copyright 2017 Neural Networks and Deep Learning lab, MIPT # # 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...
"""Implements the Synthetic-Aperture Radar (SAR) extension. https://github.com/stac-extensions/sar """ from typing import Any, Dict, Generic, Iterable, List, Optional, TypeVar, cast, Union import pystac from pystac.serialization.identify import STACJSONDescription, STACVersionID from pystac.summaries import RangeSum...
import apiclient from apiclient.discovery import build from httplib2 import Http from oauth2client import file, client, tools from oauth2client.clientsecrets import InvalidClientSecretsError from webbrowser import open_new_tab, Error import os import base64 import src.configuration_files.keys as keys import unicodedata...
# Copyright (c) 2006-2009 The Trustees of Indiana University. # All rights reserved. # # Redistribution and use in source and binary forms, with or without ...
# Return a boolean "is_numeric" def is_numeric(obj): try: abs((.3*obj + 1*obj) - .3*obj) return True except: return False # Store the standard library hash function. stdlib_hash = hash # Generate hash values using a near-zero probability of conflict # hashing mechanism that can handle non-has...
""" 每天定时给多个女友发给微信暖心话 核心代码。 """ import os import time from datetime import datetime import itchat from itchat.content import TEXT import requests import yaml from apscheduler.schedulers.blocking import BlockingScheduler from bs4 import BeautifulSoup from simplejson import JSONDecodeError import threading import city_di...
import argparse import os import time as t import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from data.coco_train_dataset import TrainCOCO from data.coco_eval_dataset import EvalCOCO from utils import * from commons import * from modules import fpn def parse_arguments(): pa...
import os, sys, time, json, glob import falcon from falcon_cors import CORS from logzero import logger as log from wsgiref import simple_server from watchdog.observers.polling import PollingObserver from watchdog.events import FileSystemEventHandler from threading import Event, Thread import vsc class VSCUpdater(obje...
# -*- coding: utf-8 -*- ''' This modules contains functions necessary for applying OWL or group OWL to the parameters 1. reg_params_init 2. apply_growl 3. apply_owl_prox 4. update_mask 5. measure_compression 6. adjust_learning_rate 7. preprocess_hparams 8. set_param_share ''' from __future__ import div...
import copy import logging import os import tempfile import time from functools import reduce import yaml from tinydb import TinyDB, Query from tinydb.middlewares import CachingMiddleware from tinydb.storages import MemoryStorage from toscaparser.tosca_template import ToscaTemplate from werkzeug.datastructures import ...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
from collections import defaultdict import pandas as pd from studies.age_structure.TN_CMIE.commons import * from studies.age_structure.TN_CMIE.epi_simulations import * from tqdm.std import tqdm """ Calculate WTP, VSLY, and other policy evaluation metrics """ src = mkdir(data/f"sim_metrics{num_sims}") dst = mkdir(da...
# Deep Learning optimization functions # # <NAME>, 2021 # <EMAIL> import torch import uproot import numpy as np import sklearn import psutil from termcolor import colored,cprint from matplotlib import pyplot as plt import pdb from tqdm import tqdm, trange import torch.optim as optim from torch.autograd import Va...
import argparse import collections import fileinput import json import os from packaging import version import re import subprocess import sys from urllib.parse import urljoin import stm32wrapper from stm32common import createFolder, deleteFolder, copyFolder, genSTM32List if sys.platform.startswith("win32"): from ...
from datetime import timedelta from django import forms from django.contrib import admin from django.contrib.auth.admin import UserAdmin as AuthUserAdmin from django.contrib.auth.models import Group as DjangoGroup from django.contrib.sessions.models import Session as DjangoSession from django.utils import timezone fro...
#!/usr/bin/env python # adds a number of bases to both ends of a fasta file import argparse import sys import os import pandas as pd from collections import OrderedDict, defaultdict import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import seaborn as sns #########################################...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 29 14:18:31 2020 @author: gtsal """ # %% Libraries from WoodProblemDefinition import Stock, Order1, Order2, Order3 import time import os import numpy as np import matplotlib.pyplot as plt from datetime import datetime import shapely import shapely...
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# Copyright 2017 <NAME>. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
from typing import Dict from datetime import datetime from os.path import join, dirname, basename from decimal import Decimal from collections import namedtuple, defaultdict from functools import lru_cache from pytezos.encoding import parse_address, parse_public_key, forge_public_key, forge_address from pytezos.michel...
import tensorflow as tf from lingvo import model_imports from lingvo import model_registry import numpy as np import scipy.io.wavfile as wav import generate_masking_threshold as generate_mask from tool import Transform, create_features, create_inputs import time from lingvo.core import cluster_factory from absl import ...
import numpy as np import tensorflow as tf from tensorflow.keras.layers import Conv2D, Dense from tensorflow.keras.layers import Dropout from tensorflow.keras.layers import Input from tensorflow.keras.layers import MaxPooling2D from tensorflow.keras.models import Model from examples.frustum_pointnet.dataset_utils impo...
import torch import torch.nn as nn import numpy as np from torch.autograd import Variable import torch.nn.functional as F import scipy.sparse as sp class AttrProxy(object): """ Translates index lookups into attribute lookups. To implement some trick which able to use list of nn.Module in a nn.Module se...
import csv import os from pathlib import Path from timeit import default_timer as timer import torch import torch.nn.parallel from easydict import EasyDict from torch.nn import functional as F import utils from loss import ContrastiveLoss, CycleConsistencyLoss from model import CootModel from optimizer import get_opt...
# -*- coding: utf-8; -*- # # The MIT License (MIT) # # Copyright (c) 2014 <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...
# -*- coding:utf-8 -*- __author__ = 'yangjian' from ..core import Callback, EarlyStoppingCallback """ """ import abc import time import os from datetime import datetime from collections import OrderedDict from threading import Thread, RLock import math from typing import Type import pandas as pd import numpy as np ...
#!/usr/bin/env python import rospy from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped, Pose from styx_msgs.msg import TrafficLightArray, TrafficLight from styx_msgs.msg import Lane from sensor_msgs.msg import Image from cv_bridge import CvBridge from light_classification.tl_classifier import TLCla...
import numpy as np from pyGeoMagApex.coordinate import cartesian2geocentric, geocentric2cartesian,\ geodetic2geocentric, rotateVector, geocentric2geodetic from pyIGRF.calculate import igrf12syn from pyIGRF.loadCoeffs import getCoeffs FACT = 180./np.pi R = 6371.2 delta = 0.000002 def itrace(Y, YOLD, YAPX, YP, BX...
""" https://github.com/OpenNMT/OpenNMT-py/blob/master/onmt/translate/beam_search.py References: Copyright (c) 2017 <NAME> Licensed under The MIT License, see https://choosealicense.com/licenses/mit/ @inproceedings{klein-etal-2017-opennmt, title = "{O}pen{NMT}: Open-Source Toolkit for Neural ...
###### IMPORTS ###### # General import os import sys import cv2 import glob import json import pickle import argparse import numpy as np import pandas as pd from datetime import datetime # Plotting import seaborn as sns import matplotlib.pyplot as plt import matplotlib.patches as mpatches sns.set(style="ticks") plt.rc...
#!/usr/bin/env python3 # <NAME> # <NAME> import sys import numpy as np content_file = sys.argv[1] out_path = sys.argv[2] cutoff = float(sys.argv[3]) genome_file = sys.argv[4] refine = sys.argv[5] minimum_read_count = 3 minimum_read_coverage = 2 splice_site_width = 5 def scan_for_best_bin(entry, distance_range, iter...
""" Extends Sphinx to easily write documentation. See the LICENSE file in the project root for more information. """ import sphinx from docutils.statemachine import StringList from pyquickhelper.sphinxext.sphinx_runpython_extension import RunPythonDirective from csharpy.sphinxext import RunCSharpDirective import os im...
import os import sys import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration from core.logging import UserLogFormatter from .env import env BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) APPS_DIR = os.path.join(BASE_DIR, "dit_helpdesk") # SECURITY WARN...
#!/usr/bin/env python3 # extract srt form of subtitles from dji movie (caption setting needs # to be turned on when movie is recorded) # # ffmpeg -txt_format text -i input_file.MOV output_file.srt import argparse import cv2 import datetime import skvideo.io # pip3 install scikit-video import math import...
# ----------------------------------------------------------- # hexalattice module creates and prints hexagonal lattices # # (C) 2020 <NAME>, # Released under MIT License # email <EMAIL> # Full documentation: https://github.com/alexkaz2/hexalattice # ----------------------------------------------------------- import ...