text
stringlengths
3.07k
12.6k
## UI ## from cube_functions.constantes import * from cube_functions.fonctions_logique import * def afficher_rubik(rubik): """ Prints the rubik's cube in the console Parameters ---------- rubik : list The rubik's cube (list of lists of lists) """ # Space Mid Tab definition spc = 1 tab = TAILLE mid = T...
import requests import pandas as pd import codecs import numpy as np import re from bs4 import BeautifulSoup from konlpy.tag import Twitter from collections import Counter from com_blacktensor.ext.db import db, openSession from sqlalchemy import func import json from sqlalchemy import Column, Integer, String, Date fro...
#!/usr/bin/env python3 import os import io import argh def get_abspath(path, cwd=None): if os.path.isabs(path): return path else: cwd = cwd or '.' if not os.path.isabs(cwd): cwd = os.path.abspath(cwd) return os.path.abspath( os.path.join(cwd, path) ...
"""Helpers for vizualization.""" import pandas as pd import numpy as np from sklearn.metrics import confusion_matrix from ..embedding import Embedding from . import deprecated @deprecated( "plot_confusion_matrix is deprecated and will be remove in 0.4.0; " "please use sklearn confusion_matrix and ConfusionMat...
import json import os import requests import traceback import src.clients.ldh as ldh from src.helpers.variant_helpers.variant_title import preferred_title_for from src.helpers.variant_helpers.hgvs_notation import get_hgvs_notation from src.clients import ensembl_vep_client, clinvar_client def find(id, compute_preferr...
# import the necessary packages import os import time import face_recognition import pickle import numpy import cv2 from utils import fr_utils as utils def predict_name_from_embedding(embedding,data,tolerance=0.8): # given the face image embedding and the data of all the embeddings, # predicts the na...
import pytest import numpy as np from numpy.testing import assert_allclose from iminuit import Minuit from iminuit.cost import ( UnbinnedNLL, BinnedNLL, ExtendedUnbinnedNLL, ExtendedBinnedNLL, LeastSquares, ) stats = pytest.importorskip("scipy.stats") norm = stats.norm @pytest.fixture def unbinne...
import sys from util.primitives.funcs import Delegate from gui.native import notImplemented from gui.toolbox import Monitor from logging import getLogger; log = getLogger('dock') import wx from wx.lib.pubsub import Publisher AUTOHIDE_TIMER_MS = 300 ANIMATE_DELTA = 6 DOCK_NONE = 0 DOCK_RIGHT = 1 DOCK_LEFT = 2 DOCK_...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import sys import re import os from oscrypto import tls, errors as oscrypto_errors, version from asn1crypto.util import OrderedDict if sys.version_info < (3,): from urlparse import urlparse str_cls = unicode #...
# import for python 2.7 #from io import open # import itertools import scipy.sparse as sparse from MemNN.common import split_line, clean_words def process_fact(line): # Arg: "entity \t rel \t obj1 obj2 ob3 ..." # Return: (entity rel obj1 obj2 obj3 ....) [entity, rel, obj] = line.rstrip().split('\t') re...
#!/usr/bin/python # This file is included by CMakeLists.txt. #[[ import importlib import glob import os import subprocess import sys from test_case import TestCase class Generator(object): def __init__(self, dirname, filename, fail=False): self.dirname = dirname self.category = dirname.replace(...
# -*- coding: utf-8 -*- # Copyright (c) 2014-2019, Camptocamp SA # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this #...
from cornice.resource import resource from functools import partial from logging import getLogger from re import compile from couchdb import ResourceConflict from dateorro import calc_datetime, calc_normalized_datetime, calc_working_datetime from datetime import timedelta, datetime, time from gevent import sleep from ...
import os import re import json import tqdm import time import pickle import argparse from multiprocessing import Process, Array, Semaphore from multiprocessing import JoinableQueue, Queue from threading import Thread from itertools import chain, product def analyze_experiment(kind, experiment, *, device): # us...
import os import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms.functional as transform_func import yaml import cv2 import numpy as np from typing import List, Union from .model import ft_net, ft_net_dense, PCB, PCB_test class Config(object): pass def create_model(na...
from ..utilities import client, command, reply, set_buttons, clear_buttons def v_iter(array): for x, col in enumerate(array): out = [] for y, piece in enumerate(col): out.append((piece, x, y)) yield out def h_iter(array): array = zip(*array) for y, row in enumerate(arra...
import wget import os.path import sys import pandas as pd from collections import Counter def pull_PATRIC_ftp(): """ Gets new AMR and metadata information from the PATRIC ftp server """ # do not write test for, file size is 50MB + 200MB PATRIC_url = "ftp://ftp.patricbrc.org/RELEASE_NOTES/PATRIC_gen...
import os import cv2 import torch from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils import torch.backends.cudnn as cudnn from torchlib.datasets import tgsdata from torchlib.segneuralnet import SegmentationNeuralNet from pytvision.transforms import transforms as mtrans from p...
# Copyright (c) 2016 Uber Technologies, Inc. # # 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, merge, publ...
# -*- coding: utf-8 -*- # Copyright 2018 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. # pylint: disable=line-too-long """Generate LUCI Scheduler config file. This generates the LUCI Scheduler configuration file for ...
"""Module with tests for the date based REST API source""" from datetime import date, timedelta from typing import Optional, Dict, Any from unittest import TestCase, main from unittest.mock import patch, call import requests from pydantic import BaseModel from judah.sources.rest_api.date_based import DateBasedRestAPI...
import sys import numpy as np from time import time #sys.tracebacklimit = 0 # Considerations for improvement # ----------------------------------------------------------- # Why shouldn't we check a particular row/col for multiple 0s - Answer: that pretty much does not matter... unfortunately sys.setrecursionlimit(1...
''' Batched Room-to-Room navigation environment ''' import sys sys.path.append('buildpy36') import MatterSim import csv import numpy as np import math import base64 import utils import json import os import random import networkx as nx from param import args from speaker import Speaker import pdb from utils import lo...
import json import re import pandas as pd from sqlalchemy import create_engine import requests import param import parambokeh import holoviews as hv import geoviews as gv import datashader as ds import dask.dataframe as dd from cartopy import crs from bokeh.models import WMTSTileSource from holoviews.operation.datas...
import re # This file contains rules for building regular inflections based on the word type. # The rules come from 'The SPECIALIST Lexicon.pdf' def useDoublingMethod(base): ''' Make a guess if a word follows the "doubled" inflection rules This method is experimental. Some words that fit this pattern may ...
#!/usr/bin/env python3 # 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. """ Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Original Paper: https://arxiv.org/abs/2005.11401 ...
import greenhouse_clock import data_sourcing import data_splitting import data_preprocessing import feature_engineering import eda_monitoring import modeling import performance_monitoring from prefect import Flow, task, context import pandas as pd # Pandas options for better shell display pd.set_option("display.max_...
# Copyright (C) 2021 GanstaKingofSA (Hanaka) # Copyright 2004-2021 <NAME> <<EMAIL>> # 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 righ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # For printing to stderr from __future__ import print_function import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) import urllib import json import time import utm # https://pypi.org/project/gpxpy/ import gpxpy import gpxpy.gpx import HTMLP...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import sys import zmq import time import signal import yaml from threading import Thread, Event, Lock class Subscriber(Thread): def __init__(self, app, address, topic, callback): super().__init__() self.app_ = app self.address_ =...
"""Representation of an evergreen patch.""" from __future__ import absolute_import from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set from evergreen.base import _BaseEvergreenObject, evg_attrib, evg_datetime_attrib if TYPE_CHECKING: from evergreen.api import EvergreenApi from evergreen.version ...
__title__ = 'pyrhyme' __version__ = '0.1' __author__ = '<NAME>' __license__ = 'MIT' __copyright__ = 'Copyright 2019 <NAME>' import warnings import requests from functools import partial RHYMEBRAIN_API_ENDPOINT = 'http://rhymebrain.com' DEFAULT_LANG = 'de' class RhymeBrainApiException(Exception...
# adapted from https://github.com/MSC-BUAA/Keras-progressive_growing_of_gans import numpy as np from keras.optimizers import Adam from keras import backend as K from models import Generator, Discriminator, GAN from tensorboardX import SummaryWriter from utils import iterate_minibatches, log_images, log_loss...
''' This part is to transform all the textual context in parameter value vector line to numerical data, in order to make that parameters suitable to analyse for LSTM network ''' import pandas as pd import re from keras.preprocessing.text import Tokenizer from pandas import Series import joblib # module to process the...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import math # from random import uniform, randint import pygame # from enum import Enum import time import rospy from sensor_msgs.msg import PointCloud2 import sensor_msgs.point_cloud2 as pc2 # 定义全局变量:地图中节点的像素大小 CELL_WIDTH = 25 # 单元格宽度 CELL_HEIGHT = 25 # 单元格长度 BORDER_WI...
from bs4 import BeautifulSoup import shutil import markdown from .fs import save_report from .errors import UrlDiff, MdDiff, UrlOccurencyDiff class HtmlReporter(object): report_template = """ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transiti...
from decimal import Decimal as D from collections import defaultdict, OrderedDict from dateutil.relativedelta import relativedelta from accounting.apps.books.models import Invoice, Bill from accounting.apps.books.calculators import ProfitsLossCalculator from accounting.libs.intervals import TimeInterval class BaseR...
import unittest from tramp.channels import ( AbsChannel, SgnChannel, ReluChannel, LeakyReluChannel, HardTanhChannel ) import numpy as np def empirical_second_moment(tau_z, channel): """ Estimate second_moment by sampling. """ noise = np.random.standard_normal(size=1000 * 1000) Z = np.sqrt(tau_...
from __future__ import division from __future__ import print_function import sys import numpy as np import BestPath import PrefixSearch import BeamSearch import TokenPassing import LanguageModel import BKTree import Loss import LexiconSearch # specify if GPU should be used (via OpenCL) useGPU = len(sys.argv) > 1 and...
# Copyright 2020 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import numpy as np import torch from torch.autograd import Variable from .Attacker import Attacker from .WhiteBoxAttacker import PGDAttack from ..models.PixelLevelTransferN import PixelLevelTransferN from ..utils import clamp_to_valid_img, tform1, tform2, retrieve_image class BlackBoxAttacker(Attacker): de...
from echo import CallbackProperty, delay_callback from glue.core.state_objects import State from glue.viewers.matplotlib.mouse_mode import MouseMode __all__ = ['NavigateMouseMode', 'RangeMouseMode'] COLOR = (0.0, 0.25, 0.7) class NavigationModeState(State): x = CallbackProperty(None) class NavigateMouseMode(...
# # 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...
# -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2019, <NAME> <<EMAIL>> 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...
import pandas as pd import yaml import os import dill import numpy as np import scipy as sp from tqdm import tqdm from datetime import datetime from joblib import load from tensorflow.keras.models import load_model from src.data.preprocess import preprocess from src.interpretability.lime_explain import predict_and_expl...
import gc import json import warnings import flask_restful from eventlet import greenthread from injector import CallableProvider, inject from flask import Blueprint, Flask from flask.templating import render_template_string from flask.views import View from nose.tools import eq_ from flask_injector import request, F...
import base64 from cgi import parse_header from copy import copy from io import BytesIO from typing import Any, Dict from urllib.parse import quote_plus from chocs.http.http_headers import HttpHeaders from chocs.http.http_query_string import HttpQueryString from chocs.http.http_request import HttpRequest from chocs.ht...
#!/usr/bin/env python # -*- coding: utf-8 -*- from collections import namedtuple from enum import Enum from .grid import Direction class InstructionType(Enum): '''Represents the various types of SpaceChem instruction.''' START = 'S' INPUT = 'i' OUTPUT = 'o' GRAB_DROP = 'g-d' GRAB = 'grb' ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created 2022 @author: <NAME> """ import pandas as pd from sklearn.model_selection import train_test_split from nt_augment import * print('Now Executing GB1 Train/Val/Test Splitting...') gb1_path = '../data/gb1/' #truncate full gb1 3 vs Rest data set to just the 4 va...
import logging import asyncio import os import inject from enum import Enum from typing import List, AsyncIterator from datetime import datetime from collections import deque from threading import Thread from dataclasses import dataclass from mycloud.constants import CHUNK_SIZE from mycloud.mycloudapi.helper import gen...
# pybtex_astro.py: Astro labeling and reference formatting import re from collections import Counter import string from pybtex.style.formatting.unsrt import Style as UnsrtStyle from pybtex.style.formatting import toplevel from pybtex.style.labels import BaseLabelStyle from pybtex.style.sorting.author_year_title \ i...
# -*- coding: utf-8 -*- # Common import numpy as np # Library-specific from . import _utils _LTYPES = [int, float, np.int_, np.float_] # ############################################################################# # ############################################################################# # Gener...
######################################################### # # # This file contains an Validator to check # # Entities of the Pinger-package agains their # # definitions. # # ...
import torch import numpy as np import torch.optim as optim from torch.optim.lr_scheduler import StepLR, ReduceLROnPlateau from torchsummary import summary import torch.nn as nn import matplotlib.pyplot as plt from torchvision import transforms import matplotlib.pyplot as plt from sklearn.metrics import confusion_matri...
import os import numpy as np import pandas as pd import z5py from segmentation_impl import segment_with_affinities, segment_with_boundaries def compute_summaries(metric): def _summarize(ap=1, iouThr=None, areaRng='all', maxDets=100): p = metric.params aind = [i for i, aRng in enumerate(p.areaRngLb...
from loomenv import loom_env, LOOM_TESTPROG, LOOM_TEST_DATA_DIR, cleanup # noqa import loom.client.tasks as tasks # noqa from datetime import datetime import os FILE1 = os.path.join(LOOM_TEST_DATA_DIR, "file1") FILE2 = os.path.join(LOOM_TEST_DATA_DIR, "file2") loom_env # silence flake8 def pytestprog(sleep, op=...
#!/usr/bin/env python __author__ = 'SLZ' import re, logging, mimetypes, os, types, importlib from .errors import notfound, badrequest def _static_file_generator(fpath): BLOCK_SIZE = 8192 with open(fpath, 'rb') as f: block = f.read(BLOCK_SIZE) while block: yield block ...
# encoding:utf-8 from .base import C, G, P from .draw import new,line,rect,circle,elli,text,show,mp4,gif class Line(G): def __init__(self, p1, p2, c=(0,0,0), sl=1, sc=(0,0,0)): super().__init__(p1, p2, c, sl, sc) def __str__(self): return f'Line({self.p1}, {self.p2}, {self.c}, {self.sl}, {self.sc}, {self.dp}, {...
import sys import os import trio from glom import glom import hypercorn import hypercorn.trio import quart from quart import request from quart_trio import QuartTrio import gidgethub from .db import PersistentStringSet from .gh import GithubApp # we should stash the delivery id in a contextvar and include it in loggi...
import os import numpy as np import cv2 import torch from tqdm import tqdm, trange from ssim import SSIM, MS_SSIM from inception import InceptionV3 from fid import calculate_frechet_distance as cfd from torch.nn.functional import adaptive_avg_pool2d os.environ['CUDA_VISIBLE_DEVICES'] = '3' DEV = torch.device('cuda'...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Find the global maximum on ackley function ''' from math import sin, cos, pi, pow, exp import math from gaft import GAEngine from gaft.components import BinaryIndividual from gaft.components import Population from gaft.operators import TournamentSelectio...
from __future__ import absolute_import, unicode_literals import pytest from six import string_types from c8.fabric import TransactionFabric from c8.exceptions import ( TransactionStateError, TransactionExecuteError, TransactionJobResultError ) from c8.job import TransactionJob from tests.helpers import cl...
#!/usr/bin/env python3 # Build the Debian packages using Docker images. # # This script builds the Docker images and then executes them sequentially, each # one building a Debian package for the targeted operating system. It is # designed to be a "single command" to produce all the images. # # By default, builds for a...
import itertools from abc import abstractmethod from enum import Enum from typing import Collection, Dict, FrozenSet, Generator, Iterator, List, Optional, Union from packaging.version import Version # TODO(amp): Remove special cases for these throughout the system. This should probably be configurable. class OutputF...
# stdlib import inspect import tempfile from email.parser import HeaderParser from operator import itemgetter from typing import List, Set # 3rd party import handy_archives import pytest from apeye.requests_url import RequestsURL from domdf_python_tools.paths import PathPlus from first import first from shippinglabel....
import src.utils.loadsave as ls import numpy as np import pandas as pd from collections import Counter from copy import deepcopy from pprint import pprint import os def checkImportancesUnion(): importancesList = ls.load_obj("importancesList") importancesKeySetList = [] for importances in importancesList: i...
"""Finds the next holiday. May be useful for e.g. controlling programmable holiday lights or changing music, etc.""" from __future__ import annotations import datetime import voluptuous as vol from homeassistant.components.sensor import SensorEntity from homeassistant.core import HomeAssistant from homeassistant.he...
# Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from ..params import NonNullParameter # Templates (may be used optionally) COLOR = { # primary colours 'red': (255, 0, 0), 'green': (0, 255, 0), 'blue': (0, 0, 255), 'cyan': (0, 255, 255), 'magenta': (255, 0, 255), 'yellow': (255, 255, 0), # woods 'wood_light': (235, 152, 78), ...
# Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!python3 # Written by <NAME> from card import Card import random, time # Function to remove one card from playing deck and add to dead pile def hitFunc(deck, hand, ddeck): ddeck.append(deck.pop(0)) hand.append(ddeck[len(ddeck) - 1]) return hand, ddeck # Function to determine the worth of a par...
from typing import Tuple, NoReturn, Dict from shutil import copyfile, rmtree from fplpandas import FPLPandas import logging import tempfile import pandas as pd import datetime as dt from datadict import DataDict import numpy as np from .s3store import S3Store from .export import export_dfs, add_data_sets_stats, export...
from some import * from readCSV import * from config import * from discretization import * def variance(i): i = [x[1] for x in i] arr = [i.count(0), i.count(1)] if arr[0] == 0 or arr[1] == 0: return 0 e = 0 for v in arr: p= v/len(i) # probability of wanting it w= math....
""" Palette for browsing actions that can be added to a blueprint. """ import logging import os from functools import partial import maya.cmds as cmds from .core import BlueprintUIModel, PulseWindow from .utils import createHeaderLabel from ..buildItems import getRegisteredActionConfigs from ..vendor.Qt import QtCor...
import numpy as np import tensorflow as tf from tensorflow.contrib import rnn class FeatureNet(object): def __init__(self, state_shape, network, special=None): self.special = special or {} self.state_shape = state_shape self.states = tf.placeholder(shape=(None,) + state_shape, dtype=tf.fl...
import os import os.path import sys import time import tempfile import numpy as np import ase.io from PIL import Image, ImageOps from aiida_gaussian.utils.cube import Cube # PYMOL asynchronous mode (pymolwiki.org/index.php/Jupyter) import pymol # pylint: disable=import-error,useless-suppression _stdouterr = sys....
import sys import random import numpy as np from keras.models import Sequential from keras.layers import Conv2D, BatchNormalization from keras.utils import to_categorical from PIL import Image from othello_ml import Othello, Action from othello_ml.visualizer import Visualizer class MLRenderer: def __init__(sel...
from PIL import Image import numpy as np import imageio # -*- coding: utf-8 -*- # revitToEquirectangular.py # # Takes a panoramic image exported from Revit and converts it into an equirectangular image for use in virtual reality applications # Works with both panoramic images and combined stereo panoramic images # # ...
""" Transforms a Polyhedron by running k rounds of Sherali-Adams hierarchy. """ import numpy as np import itertools #from math import comb #from scipy.special import comb #from cvxopt import matrix #import sage #from sage.all import matrix from functools import reduce import operator as op def comb(n, r): if r > n...
import os from PIL import Image from pylab import * # 0 是掌心 # 1-3 是大拇指上的点 # 4-6 是食指上的点 # 7-9 是中指上的点 # 10-12 是无名指指上的点 # 13-15 是大拇指上的点 import numpy as np def read_img(file_name): img = Image.open(file_name) img = img.convert('RGB') img_array = np.array(img) return img_array def make_directory(dir_na...
# coding: utf-8 # 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"...
import os import sys import time from circus.process import Process from circus.tests.support import (TestCircus, skipIf, EasyTestSuite, DEBUG, poll_for, IS_WINDOWS, PYTHON, SLEEP) import circus.py3compat from circus.py3compat import StringIO, PY2 RLIMIT = """\ import resource, sys ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from astropy.io import fits import argparse def parse_args(): parser = argparse.ArgumentParser(description='Etienne super ring code') parser.add_argument('--box_width', dest='box_width', type=int, ...
from typing import Optional, Union from django.template import Context, RequestContext from django.template.base import NodeList from .helpers import format_attributes, format_value __all__ = [ 'BaseContext', 'Context', 'TagContext', 'ComponentContext' ] class BaseContext: """ Context wrapp...
import logging import logging.config import os import pandas as pd import requests import xml.etree.ElementTree as ET from dotenv import load_dotenv from requests.exceptions import HTTPError from xml.dom import minidom load_dotenv() logging.config.fileConfig('logging.conf', disable_existing_loggers=False) logger = lo...
import argparse import hashlib import logging import os import subprocess import sys import tempfile import urlparse import ujson as json import uuid from rtree.index import Index as RTreeIndex from openvenues.extract.blacklist import * from openvenues.format.geojson import * from openvenues.extract.util import * lo...
from prettytable import PrettyTable from textwrap import fill, TextWrapper import frontmatter import re from .storage import configStorage as config # For recursive display of a discussion thread (--comments + --parents) currentThreadDepth = 0 def markdownify(t): width = 120 def mdCodeBlock(t): retu...
from __future__ import print_function import argparse import importlib from tensorboardX import SummaryWriter import torch from torch.optim.lr_scheduler import ReduceLROnPlateau from utils import evaluate, get_lr, load_checkpoint, save_checkpoint, train, test from loader.MSVD import MSVD from loader.MSRVTT import MSR...
from torchvision import models import torch from torch import nn, optim import torchvision as tv import numpy as np from PIL import Image import glob import tqdm from torch.utils.data import Dataset, DataLoader from torchvision import transforms as transform # Classes = ['GFI1-1', 'O622-8', 'GFI1-2', 'XGI2', 'E1-63'...
import numpy as np import scipy.linalg as spl def planetodetic_to_pcpf(lon, lat, h = 0.0, a = 6378137.0, b = 6356752.314245): """Convert planetodetic coordinates (longitude, latitude, and height above the ellipsoid) into planet-centered...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the 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. import math import types import ti...
import uuid from enum import Enum from functools import reduce import pygame from views.sprite_views.attack_sprite import AttackSprite from views.sprite_views.movement_sprite import State, Direction class ComboAttack(Enum): SHOT = 1 class PlayerSprite(AttackSprite): def __init__(self, start_position, bound...
#!/usr/bin/env python # # Public Domain 2014-2018 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 compil...
import os import cv2 import argparse import glob import numpy as np import torch import torch.nn as nn from torch.autograd import Variable from models import CNN_Model from util import Kernels, batch_PSNR os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" parser = argparse.ArgumentParser(description="DeblurringTest") p...
#!/usr/bin/env python # coding: utf-8 # In[1]: import lxml.etree as ET import os.path xml_filename = os.path.abspath('..\data\\') + "authexport_TOPIC_20181213.xml" dom = ET.parse(xml_filename) # In[2]: def get_last_modified_date(root): # returns a tuple with (yyyy, mm, dd, hh, mm, ss) return tuple([root...
# coding: utf-8 # Copyright (c) 2019-2020 Latona. All rights reserved. from asyncio import sleep import logging from multiprocessing import Process from custom_logger import init_logger from rabbitmq_client import RabbitmqClient import gi gi.require_version('Gst', '1.0') # noqa gi.require_version('GstRtspServer',...
from collections import defaultdict from kivy.app import App from kivy.lang import Builder from kivy.metrics import dp from kivy.uix.boxlayout import BoxLayout from kivy.uix.behaviors.button import ButtonBehavior from kivy.properties import ObjectProperty, StringProperty, ListProperty, NumericProperty from kivyic im...
from typing import List from opentrons.drivers import utils from opentrons.hardware_control.modules import ThermocyclerStep from . import types as command_types def magdeck_engage() -> command_types.MagdeckEngageCommand: text = "Engaging Magnetic Module" return {"name": command_types.MAGDECK_ENGAGE, "payloa...
import os import sys from os.path import join, dirname sys.path.insert(0, join(dirname(__file__), '..')) import simulator simulator.load('/home/wang/CARLA_0.9.9.4') from simulator import config import carla import numpy as np import argparse import time import cv2 from tqdm import tqdm from ff_collect_pm_data import...
import subprocess from textwrap import dedent from hashlib import sha1 import re # version x6 - table, select, drop, limit, where, quote, escape, null_value, escape_quotes, quote_all # version x5 - py3, config, sep, remove output before run, multiline sql, df_aux # version x4 - header, app_name, echo def pipe(*cmds, ...