text
stringlengths
6.04k
39.5k
#!/usr/bin/python # Copyright (c) 2018, NVIDIA CORPORATION. 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 l...
# sparse.py - functionality for sparse checkouts # # Copyright 2014 Facebook, Inc. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import import collections import hashlib import os from .i18n imp...
import traceback from collections import namedtuple, defaultdict import inspect import itertools import logging import textwrap from os import path from shutil import get_terminal_size from .abstract import Callable, DTypeSpec, Dummy, Literal, Type, weakref from .common import Opaque from .misc import unliteral from n...
import time from collections import defaultdict from contextlib import contextmanager from functools import partial from urllib.parse import urlsplit import gevent import pytest from gevent import Timeout from matrix_client.errors import MatrixRequestError from raiden.constants import DeviceIDs from raiden.network.tr...
import socket, random import threading import pickle import sys import time import hashlib import os from collections import OrderedDict # Default values if command line arguments not given IP = "127.0.0.1" PORT = 2000 buffer = 4096 MAX_BITS = 10 # 10-bit MAX_NODES = 2 ** MAX_BITS # Takes key string, uses SHA-1...
import sys import os import shutil import gzip import json import requests import uuid import subprocess import argparse import time from concurrent.futures import ThreadPoolExecutor from random import randint, choices from tqdm import tqdm from zipfile import ZipFile # support for S3 import S3 # support for SWIFT ob...
import cv2 import numpy as np import pycocotools.mask as mask_util import torch from utils.data.structures.bounding_box import BoxList from utils.data.structures.boxlist_ops import cat_boxlist, boxlist_nms, \ boxlist_ml_nms, boxlist_soft_nms, boxlist_box_voting from utils.data.structures.parsing import f...
# -*- coding: utf-8 -*- from logging import getLogger from datetime import datetime, date, timedelta from time import sleep, strftime from dbaas.celery import app from dbaas_credentials.models import CredentialType from drivers.errors import ConnectionError from notification.models import TaskHistory from physical.mode...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Object oriented interface to NIVA Thing universe """ __all__ = ["Thing", "Platform", "Vessel", "Sensor", "TimeSeries", "FlagTimeSeries", "GPSTrack", "ThingError"] from dateutil.parser import parse from .metaflow import get_thing as meta_get_thing from .me...
import urllib3 import certifi import os from lxml import etree as et from math import ceil from time import sleep from hashlib import sha256 from functools import lru_cache import datetime import logging from typing import Iterable from sqlalchemy.exc import OperationalError from eurlex2lexparency.celex_manager.celex...
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
import multiprocessing as mp mp.set_start_method('spawn', force=True) import argparse import os import time import yaml import numpy import logging from easydict import EasyDict import pprint from tensorboardX import SummaryWriter import torch import torch.nn as nn import torch.backends.cudnn as cudnn import torch.opt...
import torch import time import matplotlib.pyplot as plt import torch import torch.nn as nn import numpy as np from joblib import load def split_train_eval_test(ids,train_scenes,test_scenes, eval_prop = 0.8): test_ids,train_ids,eval_ids = [],[],[] train = {} for id_ in ids: scene = id_.split("_")...
from sklearn.model_selection import StratifiedKFold, KFold, train_test_split from sklearn.metrics import roc_auc_score, make_scorer, average_precision_score, precision_recall_curve, accuracy_score, \ f1_score, auc, mean_squared_error from sklearn.linear_model import RidgeCV, LassoCV, ElasticNet, SGDClassifier, SGDR...
""" License ------- Copyright (C) 2021 - <NAME> You can use this software, redistribute it, and/or modify it under the terms of the Creative Commons Attribution 4.0 International Public License. Explanation --------- This module contains the statistical model of the COVID-19 vaccination campaign described in a...
import numpy as np from matplotlib import __version__ as mpl_version from matplotlib import get_backend from matplotlib.path import Path from matplotlib.pyplot import close, subplots from matplotlib.widgets import LassoSelector from numpy import asanyarray, asarray, max, min, swapaxes from packaging import version fro...
import logging import logging.config import re from random import randint from typing import Callable, Dict, List, Optional, Tuple import pydicom from pydicom.errors import InvalidDicomError from .dicomfields import ACTION_TO_TAG_LIST from .format_tag import tag_to_hex_strings from .utils import ActionsDict, Path_Str...
#!/usr/bin/env python3 import os import re import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import numpy as np import pandas as pd import seaborn as sns from itertools import cycle from scipy.cluster.hierarchy import dendrogram, linkage # Adjust matplotlib backend for snakemake/cluster try: ...
import torch import torch.nn as nn import torch.nn.functional as F class ConvBNReLU(nn.Module): def __init__(self, in_chan, out_chan, ks=3, stride=1, padding=1, dilation=1, groups=1, bias=False): super(ConvBNReLU, self).__init__() self.conv = nn.Conv2d( in_chan, ...
#Diversas librerias, y parámetros de estas, importadas import pygame from pygame.locals import * from pygame.constants import RESIZABLE from PIL import Image import sys import math from copy import deepcopy #Importación de otros scripts import pieces import chess_notations class Menu(): def __init__(self, screen)...
# adapted from https://github.com/JTT94/filterflow/blob/master/scripts/stochastic_volatility.py import enum import os import sys import time from datetime import datetime import random sys.path.append('../') import matplotlib.pyplot as plt import numpy as np import pandas as pd import tensorflow as tf from absl impor...
#!/usr/bin/python # -*- coding: UTF-8 -*- """ @file : __init__.py.py @Time : 2020/12/3 14:43 @Author: Tao.Xu @Email : <EMAIL> """ import ast import os import sys import shutil import unittest # CASE_DIR = r'cases' REPORT_DIR = r"C:\workspace\pyrobot\report" CASE_DIR = r"C:\workspace\pyrobot\cases\ha" CASE_GEN_DIR =...
""" """ import math import random from PySide2.QtCore import QTimer, QSize, QRect from PySide2.QtGui import QPainter, QPen, QColor from PySide2.QtWidgets import QApplication, QWidget, QHBoxLayout, QFormLayout, QPushButton, QSpinBox, QDoubleSpinBox, \ QCheckBox TOTAL_BOIDS = 150 DEFAULT_MAX_SPEED = 9.0 DEFAULT_MA...
import matplotlib.pyplot as plt import numpy as np import os import torchvision from joblib import load from settings import DIR_DATA, DIR_OUTPUT, SYNTHETIC_DIM, SYNTHETIC_SAMPLES, SYNTHETIC_NOISE_VALID, \ SYNTHETIC_DATASPLIT, MNIST_BINARIZATION_CUTOFF, PATTERN_THRESHOLD, K_PATTERN_DIV """ noise 'symmetric': the ...
import os import astropy.time import matplotlib.pyplot as plt import matplotlib import numpy as np import pickle import re import pandas as pd import radvel from astroquery.simbad import Simbad import wget, zipfile, shutil from . import config norm_mean = lambda x: x/np.nanmean(x) def pickle_dump(filename,obj): ...
""" @file @brief Modification to doxypy.py (which you can found here: http://code.foosel.org/doxypy). The main tweaks are: - the documentation is not moved before the function or class definition - it uses a function to modify every line of documentation to use rst syntax. """ from __future__ import print_function i...
import binascii import array from functools import reduce import time import serial PN532_PREAMBLE = 0x00 PN532_STARTCODE1 = 0x00 PN532_STARTCODE2 = 0xFF PN532_POSTAMBLE = 0x00 PN532_HOSTTOPN532 = 0xD4 PN532_PN532TOHOST = 0xD5 # PN532 Commands PN532_COMMAND_DIAGNOSE = 0x00 PN532_COMMAND_GETFIRMWAREVERSION = 0x02 PN5...
import time, machine, struct, math, socket #hard-coded registers: MPU6050_RA_PWR_MGMT_1 = const(0x6B) MPU6050_RA_CONFIG = const(0x1A) ACCEL_XOUT_H = const(0x3B) GYRO_XOUT_H = const(0x43) MPU = const(0x68) MS_TO_S = const(10**3) RAD_TO_DEG = 180 / math.pi #initialize variables fusion_ypr = [0.0, 0.0, 0.0] ta...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, <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 Lic...
#!/usr/bin/env python import bottle from collections import defaultdict from concurrent import futures from datetime import datetime, timezone, timedelta import math import pysolar import time import config import db_access app = bottle.Bottle() executor = futures.ThreadPoolExecutor(max_workers=40) class BackendLa...
"""Version 2.x of the API. Relies on functions in API v1. """ import logging from collections import Counter import pytz from django.http import JsonResponse from dateutil.parser import parse from django.views.decorators.csrf import csrf_exempt from bmsapp import models from bmsapp.data_util import weighted_resample...
import pandas as pd from . import register_class, EXP_NAMESPACE from ..container import Table, Row, Container, AbstractContainer from ..utils import docval, popargs class KeyTable(Table): """ A table for storing keys used to reference external resources """ __defaultname__ = 'keys' __columns__ ...
import boto3 import json import sys import time from botocore.config import Config def get_aws_region(client): regions = client.describe_regions() selected = False while selected == False: i = 1 for key in regions['Regions']: print(str(i) + ". "+ key['RegionName']) ...
""" Solvers ------- This part of the package provides wrappers around Assimulo solvers. """ from assimulo.problem import Explicit_Problem import numpy as np import sys from means.simulation import SensitivityTerm from means.simulation.trajectory import Trajectory, TrajectoryWithSensitivityData import inspect from mean...
""" Collect worldbank ================= Collect worldbank sociodemographic data by country. """ import requests from retrying import retry import json from collections import defaultdict import re import math import pandas as pd WORLDBANK_ENDPOINT = "http://api.worldbank.org/v2/{}" DEAD_RESPONSE = (None, None) # tu...
# -*- coding: utf-8 -*- import os import jwt import pytz from restapi.rest.definition import EndpointResource from restapi import decorators from restapi.exceptions import RestApiException from restapi.services.detect import detector from restapi.services.mail import send_mail, send_mail_is_active from restapi.confs ...
# -*- coding:utf-8 -*- import os import random import matplotlib.pyplot as plt import numpy as np import pandas as pd import sentencepiece as spm import tensorflow as tf import tensorflow.keras.backend as K import wget os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' random_seed = 1234 random.seed(random_seed) np.random.see...
# Copyright (c) <NAME>, TU Delft # All rights reserved. # See COPYRIGHT for details. import vtk from module_kits.misc_kit.mixins import SubjectMixin from devide_canvas_object import DeVIDECanvasGlyph import operator import wx # we're going to use this for event handling from module_kits.misc_kit import dprint # thi...
""" NCP connection ============== .. currentmodule:: ncplib :term:`NCP` connections are used by the :doc:`client` and :doc:`server` to represent each side of a connection. Overview -------- Getting started ^^^^^^^^^^^^^^^ - :doc:`NCP client documentation <client>`. - :doc:`NCP server documentation <client>`. ...
#!/usr/bin/env python3 # Copyright 2019, <NAME> <<EMAIL>>, <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause # Plot resource affinity triangle # Prepare triangle plot and add points # Executed as standalone script it plots the triangle for a task. import random import sys import time import math import funct...
# # Copyright 2015-2019 University of Southern California # Distributed under the Apache License, Version 2.0. See LICENSE for more info. # """Core service logic and dispatch rules for Hatrac REST API """ import re import logging from logging.handlers import SysLogHandler import web import json from collections imp...
import time import Tkinter from PIL import ImageGrab from interstellar import audio, util, resource, sprite, mechanism class SceneError(RuntimeError): """ A scene specific runtime error """ class Scene(object): """ An object that manages and creates objects in a game """ def __init__(self...
import pickle import numpy as np import pandas as pd from src.src_vvCV_MDMP.vv_CV_MDMP import * from South_Function.South_function_trainer import * ## # Example for vv_CV_MDMP def my_func_1(X): return 1 + X+ X**2 + torch.sin(X * math.pi) * torch.exp(-1.* X.pow(2)) def my_func_2(X): return 1.5 + X+ 1.5*(X**2...
#! python # -*- coding: utf-8 -*- # $Id: gl.py 146 2006-11-07 07:44:29Z sgrayban $ g_strtable = -1 language_code = __name__.split('.')[-1] def add(label, txt): global g_strtable g_strtable.AddText(language_code, label, txt) def AddStrings(strtable): global g_strtable g_strtable = strtable ###########...
""" Utility functions for generating math-related strings. """ import fractions def str_number(a, latex_fraction=False, prettify_fractions=True, n=10): r""" Convert a number to string. :param a: Number we want to convert to string. :param bool latex_fraction: If the number is a fraction, whether or ...
#!/usr/bin/env python3 from collections import defaultdict import itertools import json class Morpheme: def __init__(self): self.fields = [] self.prefix = '' self.suffix = '' MORPHEME_SEPARATORS = '<>/-=' def split_morph(s): ls = [] cur = '' for c in s: if c in MORPHE...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright: (c) 2020, Red Hat, Inc. # SPDX-License-Identifier: MIT """This script is used to: * Check all of the roles for new versions, and update `collection_release.yml` with the updated `ref` fields. * Convert the roles to collection using [lsr_role2collection.py](#...
import numpy as np import BPNN_model, KNN_sequence_Model import RNN_models, CNN_models, AttentionModel, Incremental_Learning_models import configparser import json import time def rnn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids, cell_type, random_seed=None): p...
# -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------ WARPNet Messages ------------------------------------------------------------------------------ Authors: <NAME> (chunter [at] mangocomm.com) <NAME> (murphpo [at] mangocomm.com) <NAME> (wels...
import sys import math import copy import functools from scipy.stats import binom import numpy as np import matplotlib.pyplot as plt import collections as col import scipy.optimize nan = float("nan") minf = float("-inf") def is_smth_near(profile, v1, rng=2): """ Return index of something near if something e...
# This file is part of Flask-Multipass-CERN. # Copyright (C) 2020 - 2021 CERN # # Flask-Multipass-CERN is free software; you can redistribute # it and/or modify it under the terms of the MIT License; see # the LICENSE file for more details. import logging from datetime import datetime from functools import wraps from ...
import bluetooth import struct import time from ble_advertising import decode_services, decode_name from micropython import const # _IRQ_CENTRAL_CONNECT = const(1) # _IRQ_CENTRAL_DISCONNECT = const(2) # _IRQ_GATTS_WRITE = const(3) # _IRQ_GATTS_READ_REQUEST = const(4) _IRQ_SCAN_RESULT = const(5) _IRQ_SCAN_DONE = cons...
from typing import List import time import sys import os import argparse import curses import psutil from psutil import AccessDenied from psutil import NoSuchProcess try: from signal import SIGWINCH except ImportError: pass class Screen(): __version__ = 0.1 __author__ = '<NAME>' def __i...
from sly import Lexer, Parser from os import path from defs import * global curr_file, curr_text, error_occurred, curr_namespace, reserved_names def syntax_error(line, msg=''): global error_occurred error_occurred = True print() if msg: print(f"Syntax Error in file {curr_file} line {line}:")...
from __future__ import print_function import os import argparse import torch import torch.backends.cudnn as cudnn import numpy as np from prior_box import PriorBox import cv2 from models.retinaface import RetinaFace from utils.box_utils import * import time import sys os.environ['CUDA_VISIBLE_DEVICES'] = '1' sys.path....
import math from tqdm import tqdm def sram_traffic( dimension_rows=4, dimension_cols=4, ifmap_h=7, ifmap_w=7, filt_h=3, filt_w=3, num_channels=3, strides=1, num_filt=8, ofmap_base=2000000, filt_base=1000000, ifmap_base=0, sram_read_trace_file="sram_read...
# Copyright (c) 2015--2016 King's College London # Created by the Software Development Team <http://soft-dev.org/> # # 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, inclu...
# Copyright 2020 Google Research. 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...
import numpy as np import tensorflow as tf from ammf.utils.wavedata.tools.core import geometry_utils from ammf.core import box_3d_encoder from ammf.core import format_checker """Box4c Encoder Converts boxes between the box_3d and box_4c formats. - box_4c format: [x1, x2, x3, x4, z1, z2, z3, z4, h1, h2] - corners are...
# Copyright (C) 2020 Zurich Instruments # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. import numpy as np import matplotlib.pyplot as plt import textwrap import time def write_crosstalk_matrix(daq, device, matrix): """ Writes the give...
import base64 import copy import inspect import json import logging import os import re import warnings from collections import OrderedDict from typing import Optional from urllib.parse import urlparse try: from azure.identity import DefaultAzureCredential from azure.keyvault.secrets import SecretClient except...
"""CFNgin build action.""" import logging from ..exceptions import (CancelExecution, MissingParameterException, StackDidNotChange, StackDoesNotExist) from ..hooks import utils from ..plan import Graph, Plan, Step from ..providers.base import Template from ..status import (COMPLETE, INTERRUPTE...
"Provides basic training and validation with `Learner`" from .torch_core import * from .basic_data import * from .callback import * __all__ = ['Learner', 'LearnerCallback', 'Recorder', 'fit', 'loss_batch', 'train_epoch', 'validate', 'get_preds', 'default_lr', 'default_wd'] default_lr = slice(3e-3) default_...
# Copyright 2014-2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you # may not use this file except in compliance with the License. You # may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2021 Hathor Labs # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2017 <NAME> # """The script for the initial setup of a freshly installed Linux.""" import apt import os import os.path import pwd import shutil import subprocess from getpass import getpass softlist_common = 'ttf-mscorefonts-installer mc vim htop vlc ...
############################################################################# # Planar is Copyright (c) 2010 by <NAME> # 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 sour...
# Copyright (c) 2012 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. """This module uprevs Chrome for cbuildbot. After calling, it prints outs CHROME_VERSION_ATOM=(version atom string). A caller could then use this at...
import pdb import numpy as np import ConfigParser import os import logging import pprint import astropy.cosmology as ac from astropy.cosmology import Planck15 as cosmo from astropy.cosmology import Planck15, z_at_value import astropy.units as u #import NDpredict from utils import string_is_true #from astropy.cosmology ...
# -*- coding: utf-8 -*- """ Workflow and workflow proxy base class definitions. """ __all__ = ["BaseWorkflow", "workflow_property", "cached_workflow_property"] import sys import functools import logging from collections import OrderedDict from abc import abstractmethod import luigi import six from law.task.base ...
import os, datetime, gc, warnings, glob from natsort import natsorted import numpy as np import cv2 import tifffile import logging from .. import utils, plot, transforms from ..io import imread, imsave, outlines_to_text import omnipose try: from PyQt5.QtWidgets import QFileDialog GUI = True except: GUI = ...
#! /usr/bin/env python # Mathematica nb from Alex & Laurent # <EMAIL> major reorg as LG++ 2018 01 # python3 required (int( (len(coeffs) -1)/2 )) because of float int/int result change from python2 import numpy as np import scipy.special import numpy.linalg as linalg import sys from scipy.special import comb import ...
import os import sys import sqlite3 import pandas as pd from matplotlib import pyplot as plt from multiprocessing import Process, Queue sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from utility.setting import db_tick, db_backtest from utility.static import now, strf_time, strp_time, time...
#------------------------------------------------------------------------------- # This file is part of PyMad. # # Copyright (c) 2011, CERN. 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...
# coding=utf-8 import logging from future.utils import python_2_unicode_compatible from six import string_types from .util import create_element, xml_to_str, value_to_xml_text, is_iterable from .version import EXCHANGE_2010 log = logging.getLogger(__name__) @python_2_unicode_compatible class Q(object): # Conne...
import argparse import logging import os import re import sys import traceback from datetime import datetime from pathlib import Path from .bamCLIP import bamCLIP from .countCLIP import countCLIP from .createMatrix import MatrixConverter from .gffCLIP import FeatureOrderException, gffCLIP ''' -----------------------...
import time import telebot import config import json from datetime import date from datetime import datetime # telegram bot = telebot.TeleBot(config.TOKEN) with open("config.json", "r") as f: config_json = json.load(f) keyboard_start = telebot.types.ReplyKeyboardMarkup(resize_keyboard=True).add('М...
"""This module contains the general information for StorageFlexFlashCard ManagedObject.""" import sys, os from ...ucsmo import ManagedObject from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class StorageFlexFlashCardConsts(): BLOCK_SIZE_UNKNOWN = "unknown" CARD...
# -*- coding: utf-8 -*- from reportlab.graphics.barcode import createBarcodeDrawing from reportlab.lib.pagesizes import A4 from reportlab.lib.units import inch, mm from reportlab.platypus.doctemplate import NextPageTemplate, FrameBreak from reportlab.platypus.flowables import Spacer, HRFlowable, PageBreak, Flowable fro...
# -*- coding: utf-8 -*- """ Utility functions for welly. :copyright: 2016 Agile Geoscience :license: Apache 2.0 """ from __future__ import division import re import glob import numpy as np import matplotlib.pyplot as plt def deprecated(instructions): """ Flags a method as deprecated. This decorator can be ...
""" Base class for Filters, Factors and Classifiers """ from abc import ABCMeta, abstractproperty from bisect import insort from collections import Mapping from weakref import WeakValueDictionary from numpy import ( array, dtype as dtype_class, ndarray, searchsorted, ) from six import with_metaclass f...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import unittest import os from robot.utils.argumentparser import ArgumentParser from robot.utils.asserts import (assert_equals, assert_raises, assert_raises_with_msg, assert_true) from robot.errors import Information, DataError, FrameworkError from robot.version import get_full_version...
import os import time import h5py import math import pickle import numpy as np import pandas as pd import cv2 import threading import queue import matplotlib.pyplot as plt import seaborn as sns from scipy import misc, ndimage from sklearn import model_selection, preprocessing, metrics from sklearn.utils import shuffle ...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
""" File: list_manipulation.py Project: analysis Last Modified: 2022-7-2 Created Date: 2022-7-2 Copyright (c) 2021 Author: AHMA project (Univ Rennes, CNRS, Inria, IRISA) """ ################################################################################ import argparse import numpy as np imp...
# Copyright 2014->future! <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
"""Implement functions which are used in the code decompiled of IDA.""" from .types import (Int8, Int16, Int32, UInt8, UInt16, UInt32, UInt64, IntVar, IntType) from .utils import get_type BIG_ENDIAN = 'big' LITTLE_ENDIAN = 'little' # Default use little endian. BYTE_ORDER = LITTLE_ENDIAN # Refer ...
""" Implementation of: $ plomber install This command runs a bunch of pip/conda commands (depending on what's available) and it does the *right thing*: creating a new environment if needed, and locking dependencies. """ import sys import json import os import shutil from pathlib import Path from contextlib import con...
# Copyright (c) 2018, Arm Limited and affiliates. # SPDX-License-Identifier: Apache-2.0 # # 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 # # ...
# Copyright 2015 The Tornado Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
## By <NAME> ## Created 2018. Edited AS 2019. Edited AJ 2020 import sys import argparse import gzip import pandas as pd import os import multiprocessing as mp import re from traceback import print_exc def revComp(my_seq): ## obtain reverse complement of a sequence base_comp = {'A':'T', 'C':'G','G':...
''' WeatherBar MacOS Copyright (c) 2020 <NAME> ''' import datetime import os import webbrowser import ssl import logging import rumps import requests import geopy from geopy.geocoders import Nominatim from error import LocationNotFoundError from climacell import ClimaCell, APIKeyError from ip_api import get_ip_locat...
from __future__ import division from __future__ import print_function import time import argparse import pickle import os import datetime import torch.optim as optim from torch.optim import lr_scheduler from utils import * from modules import * parser = argparse.ArgumentParser() parser.add_argument('--no-cuda', act...
##################################################################### # # # /labscript_devices/IMAQdxCamera/blacs_workers.py # # # # Copyright 2019, Monash University and ...
# -*- coding: iso-8859-1 -*- from __future__ import print_function, division import sys if( sys.version_info[0] == 2 ): range = xrange import math import qm3.utils import qm3.problem def distribute( nodes, guess ): """ guess vector MUST constain at least 2 points: CRD0 and CRDf """ size = len( ...
#!/usr/bin/env python2.7 import sys import bitarray import copy from bitarray import bitarray #Each fragment is simply two vectors of bits, for edges and boundary nodes class AMRFragment(object): def __init__(self, n_edges, n_nodes, graph): self.edges = bitarray(n_edges) if self.edges.count() != 0: ...
# pylint: disable=too-many-arguments, too-many-locals, too-many-instance-attributes """ `ParallLossModule` is a container module that chains a number of modules for part of fc weight, it plays as a role of layer for model parallel on multi context @author: <NAME> """ import logging import copy import math import mxn...
import asyncio import os import subprocess import sys import time from datetime import datetime, timedelta from pathlib import Path from time import sleep import chat_exporter import discord from discord.ext import commands from discord_sentry_reporting import use_sentry from dotenv import load_dotenv from tqdm import...