text
stringlengths
8.04k
46.5k
#!/usr/bin/env python ''' APM DataFlash log file reader Copyright <NAME> 2011 Released under GNU GPL version 3 or later Partly based on SDLog2Parser by <NAME> ''' import struct, time, os from . import mavutil FORMAT_TO_STRUCT = { "b": ("b", None, int), "B": ("B", None, int), "h": ("h", None, int), "...
import numpy as np import os from numba import jit fit_arg,blr,ns=False,0.1,'all' log_path=os.path.join('./logs/avion/vol1/log_real_processed.csv') # les booleans qui déterminent plusieurs comportements, voir coms fit_on_v=fit_arg #est ce qu'on fit sur la vitesse prédite ou sur l'acc used_logged_v_in_m...
from unittest.mock import MagicMock import box import pytest import yaml import prefect from prefect.agent.ecs.agent import ( merge_run_task_kwargs, ECSAgent, DEFAULT_TASK_DEFINITION_PATH, ) from prefect.storage import Local, Docker from prefect.run_configs import ECSRun, LocalRun, UniversalRun from prefe...
""" INDRA has been used to generate and maintain a database of causal relations as INDRA Statements. The contents of the INDRA Database can be accessed programmatically through this API. The API includes three high-level query functions that cover many common use cases: :func:`get_statements`: Get statements ...
# -*- coding: utf-8 -*- """ Created on Tue May 14 19:10:39 2019 @author: Sneha """ # -*- coding: utf-8 -*- """ Created on Sun Apr 21 11:57:42 2019 @author: Sneha """ import random import math import copy import numpy as np import matplotlib.pyplot as plt import time from IPython import get_ipython get_ipython().run...
# Lint as: python2, python3 # Copyright 2019 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 # ...
# coding: utf8 import calendar import csv import os from typing import List, Tuple, Any import matplotlib import matplotlib.pyplot as plt import networkx as nx from PIL import Image, ImageFont, ImageDraw from matplotlib import font_manager import const import util from repository import Repos file_dir = os.path.dirn...
# fmkr.py # Copyright (c) 2006-2021, <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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditi...
#!/usr/bin/python3 -i # # Copyright (c) 2016-2019, 2019 ARM Corporation # # Author: Parker # # The API cost layer works by passing custom format strings to the ApiCostGenerator. These format # strings are C++ code, with 3-ish exceptions: # * Anything beginning with @ will be expanded by the ApiCostGenerator. These ar...
"""Utilities for processing .test files containing test case descriptions.""" import os.path import os import tempfile import posixpath import re import sys from os import remove, rmdir import shutil from abc import abstractmethod import pytest # type: ignore # no pytest in typeshed from typing import List, Tuple, ...
from datetime import datetime import numpy as np import pytest from pandas.core.dtypes.cast import find_common_type, is_dtype_equal import pandas as pd from pandas import DataFrame, Index, MultiIndex, Series import pandas._testing as tm class TestDataFrameCombineFirst: def test_combine_first_mixed(self): ...
"""Functionality to query and extract information from aligned BAM files. """ from __future__ import print_function import collections import os import signal import subprocess import numpy import pybedtools import pysam import toolz as tz from six.moves import zip_longest from bcbio import broad, utils from bcbio.ba...
from __future__ import division, unicode_literals import unittest from itertools import chain import serial import pyfirmata from pyfirmata import mockup from pyfirmata.boards import BOARDS from pyfirmata.util import (break_to_bytes, from_two_bytes, str_to_two_byte_iter, to_two_bytes, ...
""" Reg Replace. Licensed under MIT Copyright (c) 2011 - 2016 <NAME> <<EMAIL>> """ import sublime import sublime_plugin import re from backrefs import bre from RegReplace.rr_notify import error import ast import textwrap USE_ST_SYNTAX = int(sublime.version()) >= 3092 ST_LANGUAGES = ('.sublime-syntax', '.tmLanguage') ...
""" @file @brief Functions implemented einsum computation for two matrices having the same dimensions. """ import numpy def numpy_diagonal(m, axis, axes): """ Extracts diagonal coefficients from an array. :param m: input array :param axis: kept axis among the diagonal ones :param axes: diagonal a...
# Modifed from R2C """ Dataloaders for VCR """ import json import pickle import os from collections import defaultdict import numpy as np import numpy import torch from allennlp.data.dataset import Batch from allennlp.data.fields import TextField, ListField, LabelField, SequenceLabelField, ArrayField, Metad...
import datetime import itertools import textwrap import sys from typing import List import click from sqlalchemy.orm.exc import NoResultFound from sqlalchemy import not_, or_ from pyproj import CRS from pyproj.exceptions import CRSError import fire.cli from fire.cli.utils import klargør_ident_til_søgning from fire.ap...
import concurrent.futures import datetime import math import pathlib import random import shutil import subprocess import threading import time from timeit import default_timer as timer import os import io import boto3 import botocore from botocore.client import Config default_profile = 'default' default_cache_root_...
# Copyright 2019-2021 Cambridge Quantum Computing # # 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 a...
import numpy as np import enterprise.constants as const from enterprise.signals import signal_base from enterprise.signals import utils #import model_constants as mc from enterprise.signals import gp_bases from enterprise.signals import gp_priors import enterprise.signals.parameter as parameter import enterprise.signal...
""" Evaluation Script Support Two Modes: Pooling based inference and sliding based inference """ import os import logging import sys import argparse import re import queue import threading from math import ceil from datetime import datetime from tqdm import tqdm import cv2 from PIL import Image import PIL from torch.b...
from immutabledict import immutabledict import strax import straxen from copy import deepcopy from .rucio import HAVE_ADMIX import os common_opts = dict( register_all=[ straxen.double_scatter, ], # Register all peak/pulse processing by hand as 1T does not need to have # the high-energy plugins....
"""Tests for computational algebraic number field theory. """ from sympy import S, Rational, Symbol, Poly, sin, sqrt, I, oo from sympy.utilities.pytest import raises from sympy.polys.numberfields import ( minimal_polynomial, primitive_element, is_isomorphism_possible, field_isomorphism_pslq, field...
# ActivitySim # See full license in LICENSE.txt. import logging import numpy as np import pandas as pd from activitysim.core.util import reindex logger = logging.getLogger(__name__) def enumerate_tour_types(tour_flavors): # tour_flavors: {'eat': 1, 'business': 2, 'maint': 1} # channels: ['eat1', 'busi...
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # #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 ...
#!/usr/bin/env python2 """ expr_eval.py """ from __future__ import print_function from _devbuild.gen.id_kind_asdl import Id, Kind from _devbuild.gen.syntax_asdl import ( expr_e, expr_t, re, re_e, re_t, class_literal_term, class_literal_term_e, place_expr_e, place_expr_t, ) from _devbuild.gen.runtime_asdl impor...
import math from numpy import ma from numpy.core.getlimits import _register_type from numpy.lib.function_base import cov from transformers import BertTokenizer, BertForMaskedLM from torch.nn import functional as F import torch import scipy.stats as stats from sentence_transformers import SentenceTransformer, util from...
import logging from pathlib import Path import uuid import numpy as np import matplotlib.pyplot as plt from scipy import interpolate from brainbox.core import Bunch import ibllib.exceptions as err import ibllib.plots as plots import ibllib.io.spikeglx import ibllib.dsp as dsp import alf.io from ibllib.io.spikeglx im...
# -*- coding: latin-1 -*- # ----------------------------------------------------------------------------- # Copyright 2012, 2017 <NAME> <<EMAIL>> # # Licensed under the EUPL, Version 1.1 or - as soon they # will be approved by the European Commission - subsequent # versions of the EUPL (the "Licence"); # You may not us...
from abc import ABC, abstractmethod import scipy import numpy as np class Server(ABC): def __init__(self, server_model, merged_update): self.model = server_model self.merged_update = merged_update self.total_weight = 0 @abstractmethod def train_model(self, my_round, num_syncs, cli...
import hmac import json import urllib.parse from .main import ( PullReqState, parse_commands, db_query, INTERRUPTED_BY_HOMU_RE, synchronize, ) from .action import LabelEvent from . import utils from .utils import lazy_debug import github3 import jinja2 import requests import pkg_resources from bottl...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### """ This file is a part of the VeRyPy classical vehicle routing problem heuristic library and provides an implementation of the Christofides, Mingozzi and Toth (1979) two phase heuristic. Also a...
#------------------------------------------------------------------------------- # # Handles the WPS requests to the VirES server # # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # #------------------------------------------------------------------------------- # Copyright (C) 2018 EOX IT Services GmbH # # Per...
import numpy as np import math import tensorflow as tf from operator import itemgetter import pandas as pd from datetime import datetime import pickle from functools import reduce class HParams(): """Inheritable class for the parameter classes Example of how to use hparams = Hparams(**kwargs) ...
import torch import torch.nn as nn from torch.utils import data from torch.optim.lr_scheduler import StepLR import models from utils import constant from utils.main_utils import save_model, load_model, predict, getMetrics, eval_tit_lstm, eval_bert, eval_bert_with_chunked_data, padding_for_bert from utils.data_reader_on...
# std import csv from copy import deepcopy from hashlib import md5 from time import time # ext libs import numpy as np from scipy import stats from graph_tool import Graph, GraphView from graph_tool.topology import shortest_distance, label_largest_component from graph_tool.clustering import global_clustering # local fr...
#-------------------------------------------------------------------------------- # Copyright (c) 2020 <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, i...
"""ダイナミクスを導出""" import sympy as sy #from sympy import sqrt import tqdm import kinematics import utils def operate_T2(A): """T2演算""" return A[0,0] + A[1,1] def operate_V(A): """ベクトル化演算""" V_A = A.reshape(len(A), 1) return V_A def operate_tilde(A): """行列の最後の列を0埋め""" m, _ = A.shape t...
# Based on code from https://github.com/skorch-dev/skorch # BSD 3-Clause License # Copyright (c) 2017, <NAME>, <NAME>, <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 ...
#Auhtor: YP #Created: 2018-07-08 #Last updated: 2019-03-06 #A set of helper functions used by GPS that act as an interface between the redis database and the master and work processes of GPS. #The "cat format" is an update introcued on 2019-03-06. The format refers to taking in arrays of pts (the parameter point values...
# -*- coding: utf-8 -*- # Amara, universalsubtitles.org # # Copyright (C) 2012 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the L...
# coding=utf-8 # # Copyright (c) 2013-2015 First Flamingo Enterprise B.V. # # 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 requi...
# # Copyright (c) 2017-2021 NVIDIA CORPORATION. All rights reserved. # This file is part of the WebDataset library. # See the LICENSE file for licensing terms (BSD-style). # """Train PyTorch models directly from POSIX tar archive. Code works locally or over HTTP connections. """ import itertools as itt import os im...
import numpy as np from configparser import ConfigParser from astropy import units as u DEFAULT_INI = '../set/set_experiment.ini' def is_number(string): try: float(string) return True except ValueError: return False except TypeError: return False def choice_yn(string, de...
# ------------------------------------------------------------- # plotter.py - plots event data # August 2018 - <NAME> # ------------------------------------------------------------- """ Visualiser that can display event data as a line graph. If the connect field of a datum is None, the event will be displayed as sin...
import json import os import re import shutil import subprocess import sys import tempfile import textwrap import time import venv # type: ignore import zipfile from typing import Dict from argparse import ArgumentParser from dataclasses import dataclass from pathlib import Path from urllib.request import urlopen f...
# # Copyright 2019 <NAME> <<EMAIL>> # # This file is part of Salus # (see https://github.com/SymbioticLab/Salus). # # 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/...
"""A library to create YARA rules. """ from builtins import chr from builtins import str from builtins import range from builtins import object import binascii from copy import deepcopy import collections class yara_tools(object): """.""" def __init__(self, name, default_identifier=False, tags=False, default_con...
# TODO # - On print extensions, print the reflected internal representation of the object # - Verify that when mp_obj is given it is indeed the right type (mp_lv_obj_t). Report error if not. can be added to mp_to_lv. # - Implement inheritance instead of embed base methods (how? seems it's not supported, see https://git...
import numpy import geopandas import ogr import shapely import time import folium import selenium.webdriver import requests import os __all__ = [ 'GMLtoGDF', 'fillCity', 'addToCity', 'selectRegion', 'getGDFBounds', 'totalCentroid', 'updateCity', 'getCityByName', 'getCityGroup', ...
""" DistFitting ===== Provides 1. A data Normalizer 2. A data discretizer 3. Goodness of fit tests between two continuous data distributions ---------------------------- Documentation is available at github. """ import pandas as pd import scipy.stats as scp import scipy.stats import scipy import numpy as np i...
#!/usr/bin/python # # Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es) # # 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 (C) 2019 Databricks, 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 i...
import glob, sys, os, pkgutil, ast, multiprocessing, pkg_resources, datetime, psutil, subprocess import PySimpleGUI as sg import matplotlib.pyplot as plt from pathlib import Path import pandas as pd import webbrowser from apscale.b_pe_merging import main as pe_merging_main from apscale.c_primer_trimming import main as ...
import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm import cv2 import os import pickle import json from roipoly.roipoly import RoiPoly, MultiRoi import argparse import datetime import time from threading import Timer, Thread from OPTIMAS.utils.files_handling import images_list, read_fps, \ ...
import os import numpy as np import sys import cStringIO import re import scipy.io as sio import copy def cell2strtable(celltable, delim='\t'): ''' convert a cell table into a string table that can be printed nicely Parameters: celltable - array-like, ndarray with rows and columns in desired order...
"""The module for training ENAS.""" import contextlib import glob import math import os import numpy as np import scipy.signal from tensorboard import TensorBoard import torch from torch import nn import torch.nn.parallel from torch.autograd import Variable import models import utils logger = utils.get_logger() d...
# -*- coding: utf-8 -*- import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc from dash.dependencies import Input, Output from dash.exceptions import PreventUpdate import pandas as pd from app import app import os from plotly.colors import sequential, n_colors im...
# from jumpscale import j from Jumpscale import j '''Definition of several custom types (paths, ipaddress, guid,...)''' import re import struct import builtins from .PrimitiveTypes import String, Integer import copy import time class Guid(String): ''' Generic GUID type stored as binary internally ''...
import math import heapq import numpy as np from itertools import groupby, count import operator from decimal import Decimal, ROUND_UP import utm from itertools import starmap, chain from shapely.geometry.polygon import Polygon from shapely.geometry import Point import matplotlib matplotlib.use('TkAgg') def get_line...
#!/usr/bin/env python3 import pytest import os import pathlib import pandas as pd import numpy as np import matplotlib.pyplot as plt import logging from torch.utils.data import DataLoader from neuralprophet import ( NeuralProphet, df_utils, time_dataset, configure, ) log = logging.getLogger("NP.test")...
""" DIRBS CLI for pruning old monthly_network_triplets data or obsolete classification_state data. Installed by setuptools as a dirbs-prune console script. SPDX-License-Identifier: BSD-4-Clause-Clear Copyright (c) 2018-2019 Qualcomm Technologies, Inc. All rights reserved. Redistribution and use in source and binar...
from __future__ import absolute_import, division, print_function """ Author : Lyubimov, A.Y. Created : 10/10/2014 Last Changed: 10/31/2019 Description : IOTA I/O module. Reads PHIL input, also creates reasonable IOTA and PHIL defaults if selected. PHILFixer can be used to ensure ba...
#!/usr/bin/env python ''' Created in July, 2014 Author: <NAME> E-Mail: <EMAIL> program to calculate ANM and PCA for a given set of proteins in PDB format uses the ProDy library ''' import prody import glob import argparse import numpy as np class PCA_ANM_Analysis: ''' class definition for PCA and ANM analy...
""" Functionals ########### **Summary** Defined grid-based exchange-correlation functionals, fock operator, and potentials for 1D systems. .. moduleauthor:: `<NAME> <<EMAIL>>`_ ORCID: `0000-0002-7228-9478 <https://orcid.org/0000-0002-7228-9478>`_, `<NAME>`, `Chris (Jielun) Chen`, `<NAME>` .....
# -*- coding: utf-8 -*- """The Dimension object: attributes and methods.""" import warnings from copy import deepcopy import numpy as np from .labeled import LabeledDimension # lgtm [py/import-own-module] from .linear import LinearDimension # lgtm [py/import-own-module] from .monotonic import MonotonicDimension # ...
import os import torch.multiprocessing torch.multiprocessing.set_sharing_strategy('file_system') import torch.backends.cudnn as cudnn cudnn.benchmark = False os.environ["CUDA_VISIBLE_DEVICES"] = "0" import sys import os import json import time import argparse import random from decimal import Decimal import numpy as np...
#! /usr/bin/env python # -*- encoding: utf-8 -*- import matplotlib.pyplot as plt import mpl_finance as mpf # 替换 import matplotlib.finance as mpf import numpy as np import pandas as pd # 正常显示画图时出现的中文和负号 from pylab import mpl mpl.rcParams['font.sans-serif'] = ['SimHei'] mpl.rcParams['axes.unicode_minus'] = False # 5....
import math import bpy from bpy.props import IntProperty, FloatProperty, EnumProperty import bmesh from collections import deque import numpy as np import mathutils from bpy.props import (StringProperty, BoolProperty, IntProperty, FloatProperty, ...
# -*- coding: utf-8 -*- # # Syncopy's abstract base class for continuous data + regular children # """Uniformly sampled (continuous data). This module holds classes to represent data with a uniformly sampled time axis. """ # Builtin/3rd party package imports import inspect import numpy as np from abc import ABC from...
#MenuTitle: Insert Instances # -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function __doc__=""" Inserts instances, based on the Luc(as), Pablo, and Maciej algorithms. """ from GlyphsApp import * import vanilla rangemin = 3 rangemax = 11 naturalNames = ( "Hairline", "Thin", "...
from datetime import datetime, date, timedelta import os from sys import exit import pandas as pd import time from selenium import webdriver from datetime import date, timedelta from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.chrome.webdriver import WebDriver from seleni...
from django.db import models from django.contrib.auth.models import User from .utils import ( common_edit_object, common_get_object, generate_uuid_base64, uuid_path, ) from django.conf import settings from django.contrib.postgres.fields import JSONField import math from datetime import datetime import p...
''' Created on Oct 25, 2019 @author: matze ''' from configparser import ConfigParser import locale from os.path import expanduser from subprocess import Popen import subprocess import os,urllib from urllib.parse import urlparse import json import re import time from datetime import timedelta #import threading MODE_V...
import math from functools import reduce import torch import torch.nn as nn import pytorch_acdc as dct from torch.utils.checkpoint import checkpoint class ACDC(nn.Module): """ A structured efficient layer, consisting of four steps: 1. Scale by diagonal matrix 2. Discrete Cosine Transform ...
# ##### 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 socket import asyncio import os import re import http import gzip import select import signal import json import traceback from .timer import Timer from urllib.parse import unquote from .logger import info, error, warning from typing import Any, Union, Tuple, Dict, Callable, Coroutine, List, Iterabl...
# NTNDA_Viewer.py ''' Copyright - See the COPYRIGHT that is included with this distribution. NTNDA_Viewer is distributed subject to a Software License Agreement found in file LICENSE that is included with this distribution. author <NAME> latest date 2020.03.02 original development started 2019.12 ''' ...
# Access control import xpath import base64 import random import time import urllib.parse import jwt import sys import urllib.request, urllib.parse, urllib.error from .vars import * from .capability import * from .checker import * from .consistency import * from .issuer import * _igorSelfToken = IgorAccessToken() _ac...
import os, sys import pandas as pd import numpy as np import random import time from timeit import default_timer as timer import collections sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from .RuleModule import Rule from .ParserModule import Parser from .GeneticAlgorithmModu...
#!/usr/bin/env python3 # Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A script used to manage Google Maven dependencies for Chromium. For each dependency in `build.gradle`: - Download the library ...
# -*-encoding:utf-8-*- from functools import reduce from operator import mul import numpy as np import tensorflow as tf from tensorflow.contrib.crf import crf_log_likelihood from tensorflow.contrib.crf import viterbi_decode from model_utils import result_to_json from bert_model import BertConfig, BertModel def gelu...
#!/usr/bin/env python3 # # Frida-based fuzzer for blackbox fuzzing of network services. # # Author: <NAME> (ERNW GmbH) # <NAME> (ERNW GmbH) from subprocess import check_output import traceback import argparse import frida import socket import ssl import time import shutil import sys import os # frizzer modu...
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # Modified by <NAME> and <NAME> # ------------------------------------------------------------------------------ from __future__ import absolute_imp...
""" Object to manage regular expressions, try to optimize the result: - '(a|b)' => '[ab]' - '(color red|color blue)' => 'color (red|blue)' - '([ab]|c)' => '[abc]' - 'ab' + 'cd' => 'abcd' (one long string) - [a-z]|[b] => [a-z] - [a-c]|[a-e] => [a-z] - [a-c]|[d] => [a-d] - [a-c]|[d-f] => [a-f] Operation: - str(...
############################################################ # -*- coding: utf-8 -*- # # # # # # # #### # ## ## # ## # # # # # # # # # # # ### # # ## # ## ## # # # # # # # #### # # Python-based Tool for interaction with the 10micron mounts # GUI with PyQT5 ...
#!/usr/bin/env python3 # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
import math from detectron2.modeling import BACKBONE_REGISTRY from detectron2.modeling.backbone import Backbone from utils.google_utils import * from utils.layers import * from utils.parse_config import * from utils import torch_utils ONNX_EXPORT = False def create_modules(module_defs, img_size, cfg): # Constr...
#!/usr/bin/env python # # 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.0OA # # Authors: # - <NAME>, <<EMAIL>>, 2020 import copy import datetime impo...
from . import DATA_DIR, INVENTORY_DIR from .clean_datasets import DatabaseCleaner from .data_collection import IAMDataCollection from .electricity import Electricity from .renewables import SolarPV from .inventory_imports import ( CarmaCCSInventory, BiofuelInventory, DACInventory, HydrogenInventory, ...
from problem2 import * import numpy as np import sys from sklearn.datasets import make_classification ''' Unit test 2: This file includes unit tests for problem2.py. You could test the correctness of your code by typing `nosetests -v test2.py` in the terminal. ''' #-----------------------------------------...
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Some extensions to the standard STScI data model which define MIRI flux conversion models. NOTE: After CDP-4, the MIRI imaging mode data models have been replaced by new photometric models contained in miri_photometric_models.py. The old models are defined here for b...
# -*- coding:utf-8 -*- from __future__ import unicode_literals # import getemotion import json import itchat import requests # import platform import os import re import random import threading from beta import wav2text # 登录和初始化 # 设置已回复人员列表,限制刷消息的人 replied = {} userId = '' BASE_DIR = os.path.dirname(os.path.abspath(__...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # #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...
#!/usr/bin/python3 import csv import glob import os import pickle # import shutil import sys import warnings import random from collections import deque, defaultdict from dataclasses import fields import logging import hdbscan import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd imp...
""" Author: <NAME> Modified from https://github.com/gurkirt/realtime-action-detection Licensed under The MIT License [see LICENSE for details] """ import os import torch import torch.nn as nn import torch.optim as optim import torch.nn.init as init import argparse from torch.autograd import Variable import torch.u...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Name: stream/core.py # Purpose: mixin class for the core elements of Streams # # Authors: <NAME> # <NAME> # # Copyright: Copyright © 2008-2015 <NAME> and the music21 Project # Lic...
# Copyright 2021 AIPlan4EU project # # 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 wri...
import bisect import os.path as osp from collections import defaultdict import json import numpy as np import scipy.linalg as LA from scipy.ndimage import binary_dilation, generate_binary_structure import pandas as pd from PIL import Image from tabulate import tabulate from panopticapi.utils import rgb2id from panop...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2020 tecnovert # Distributed under the MIT software license, see the accompanying # file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php. import os import time import shutil import logging import unittest import threading from xmrswap.r...