text
stringlengths
8.04k
46.5k
import argparse import collections import json import math import os from datetime import datetime import torchvision from allennlp.modules.vision.region_detector import RegionDetectorOutput from torch import Tensor from torchvision.models.detection.roi_heads import maskrcnn_inference from torchvision.transforms impor...
#!/usr/bin/env python """ Tools to manipulate data """ from collections import Counter from functools import partial from typing import Union, List import pandas as pd import numpy as np from .logging import get_logger logger = get_logger('{pkg}.utils.pandas') def nan_str(x): if isinstance(x, float): ...
# -*- coding: utf-8 -*- """ requests.compat ~~~~~~~~~~~~~~~ This module handles import compatibility issues between Python 2 and Python 3. """ # === exceptions === import calendar import codecs import copy import threading import time try: import chardet except ImportError: import charset_normalizer as char...
#!/usr/bin/python import web import os #import gc #gc.set_debug(gc.DEBUG_STATS) import logging logging.basicConfig(level=logging.ERROR) #import logging.handlers import json import time import base64 import gzip # own modules import tk_web from datalogger import DataLoggerRawFileMissing as DataLoggerRawFileMissing from...
import numpy as np import matplotlib import matplotlib.pyplot as plt import skimage.io as io import skimage.filters as flt #%matplotlib inline # since we can't use imports import numpy as np import scipy.ndimage.filters as flt import warnings from sklearn.mixture import GaussianMixture as GM from scipy import interpo...
""" Double-entry Bookkeeping System Copyright (c) 2021 <NAME> MIT License """ from collections import namedtuple from urllib.parse import parse_qs from datetime import date from html import escape import os try: from pysqlcipher3 import dbapi2 as sqlite3 except ImportError: import sqlite3 from math import ceil...
__author__ = 'saeedamen' # <NAME> / <EMAIL> # # Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians # # 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/li...
#!/usr/bin/env python """ Extracts data from XNAT archive folders into a few well-known formats. Usage: dm_xnat_extract.py [options] <study> [-t <tag>]... dm_xnat_extract.py [options] <study> <session> [-t <tag>]... Arguments: <study> Nickname of the study to process <session> Full...
import spacy #################################################### ################# HELPER MODULES ################### #################################################### def descendants(sentence, ancestor, ignoreFirst, *includes): ''' Returns descendants of a node in-order ''' sent = sentence if ancestor == Non...
import random from code.tools.xml import XMLNode from code.utils.common import log, log2, logn, xml_encode, xml_decode class Conversation: def __init__(self): self.id = "" # A conversation will have at least one branch: root. It may have additional # branches (dependent responses) tha...
from elevate import elevate elevate() from PyQt5.QtWidgets import QMainWindow, QApplication from PyQt5 import QtWidgets, QtGui, QtCore from PyQt5 import uic from pxpowersh import PxPowershell import hjson import sys import os from collections import OrderedDict from random import randrange from threading imp...
from discord.ext import commands from utils import FactionUpgrades, NaWSearch import datetime import discord alias = { "upgrade": ["upg", "up", "u"], "challenge": ["ch", "c"], "research": ["res", "r"], "lineage": ["line", "l"], "artifact": ["art", "a"], "bloodline": ["bl", "b"], "set": ["s...
import glob import json import os import queue import random import threading import time from ctypes import * import cv2 import matplotlib as mpl import matplotlib.cm as cm import numpy as np import PIL.Image as pil import torch from torchvision import transforms import camera_parameters as params import darknet.dar...
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC. 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 requir...
# -*- coding: utf-8 -*- # coding: utf-8 # ----------------------------------------------------------------------------- # Copyright 2012-2017 <NAME>. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obta...
from __future__ import division, print_function, absolute_import import argparse import functools import json import logging import math import os import random import numpy as np import pandas as pd import sklearn.metrics as sm import tensorflow as tf import tqdm try: tf.compat.v1.logging.set_verbosity(tf.compa...
import matplotlib matplotlib.use('Agg') # set the backend before importing pyplot import pandas as pd import numpy as np import pyper as pr import rpy2.robjects as robj from rpy2.robjects import pandas2ri from rpy2.robjects import FloatVector as rfc from rpy2.robjects import StrVector as rsc from rpy2.robjects impor...
import torch import itertools from util.image_pool import ImagePool #from .base_model import BaseModel from new_multi import networks5_ds from new_multi.networks5_ds import init_net, init_weights,get_masks import torch.nn as nn import os import util.util as util from collections import OrderedDict import functools impo...
import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.backends.backend_pdf import PdfPages from numpy import mean, std from scipy import ndimage as ndi from scipy.optimize import curve_fit import scipy.ndimage import itertools as it from math impor...
# -*- coding: utf-8 -*- ''' ------------------------------------------------------------------------------------------------- This code accompanies the paper titled "Human injury-based safety decision of automated vehicles" Author: <NAME>, <NAME>, <NAME>, <NAME> Corresponding author: <NAME> (<EMAIL>) ------------------...
import tensorflow as tf from MCQ.Consts import Consts class MultiHeadAttention(tf.keras.layers.Layer): def __init__(self, numHeads: int): """Multi head attention. Args: numHeads (int): Number of heads. logitsOnly (bool, optional): Only return logits for query @ key. Defau...
from dataclasses import dataclass, field from enum import Enum, auto from fractions import Fraction from typing import List, Sequence, Optional, Any, Iterator, cast import re import numpy as np from scipy.interpolate import interp1d import constants as Const from utils import gaunt_bf from atomic_table import AtomicT...
from __future__ import annotations import collections import functools import pickle import sys from abc import ABC, abstractmethod from concurrent.futures.thread import ThreadPoolExecutor from typing import Callable, Dict, Union, Any, List, Sequence, Optional import json import logging import re import threading fro...
import asyncio import signal import aiohttp from logging import Logger, basicConfig, getLogger from typing import Any, Callable, Coroutine, List, Optional, Union, Dict from .api.cache import Cache, Item from .api.exceptions import * from .api.gateway import DiscordWebSocket, ReconnectWebSocket from .api.http import HT...
from django.shortcuts import render,redirect from django.db.models import Count,Q from .models import Exam,Question,Result,MyAdmin from django.contrib import messages from django.core import serializers import json import datetime,time import pytz from plyer import notification from functools import reduce # auth from ...
#!/usr/bin/env python ''' Mosaicking and subsetting tool for Global Coherence and Backscatter Data Set Author: <NAME> (c) 2021, Earth Big Data LLC ''' import fsspec import shutil import os,sys from math import ceil,floor from osgeo import gdal import subprocess as sp import concurrent.futures as cf from multiproce...
#! /usr/bin/env python """ Set a register preset to test different configurations on YM2612 chip """ from __future__ import print_function import sys import time import serial import rtmidi # Defined constants YM_MAX_NUM_USER_PRESETS = 8 YM_MAX_NUM_DEFAULT_PRESETS = 8 # Num voices YM_MAX_VOICES = 6 # Num operators Y...
from bson import ObjectId, DBRef import pytest from datetime import datetime from dateutil.tz.tz import tzutc, tzoffset from marshmallow import ValidationError from uuid import UUID from umongo.data_proxy import data_proxy_factory from umongo import Document, EmbeddedDocument, Schema, EmbeddedSchema, fields, Reference...
#! /usr/bin/python3 ''' Checks humanity module on different errors. If we know, that in some method must be an error - we can use @unittest.expectedFailure decorator. Revision: 8 ''' import unittest from humanity import * testclass_variants = 'list', 'tuple', 'str' # we'll create TestHumlist, TestHumtuple, etc ...
import discord from discord.ext import commands from __main__ import settings, botdata, invite_link, httpgetter from cogs.utils.helpers import * from cogs.utils.botdata import UserInfo from cogs.utils import checks, botdatatypes from cogs.audio import AudioPlayerNotFoundError from sqlalchemy import func import cogs.uti...
# Copyright 2019 Jetperch 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,...
__author__ = '<NAME>' try: import openeye.oechem as oechem except ImportError: pass import warnings import numpy as np import itertools from math import radians, degrees import copy from . import utils, chemi from cmiles.utils import mol_to_smiles, has_atom_map, get_atom_map from .utils import BOHR_2_ANGSTROM...
# coding=utf-8 # Copyright 2021 The Meta-Dataset 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 ...
import pandas as pd from bayespy.network import Discrete import bayespy.network import numpy as np from collections import Counter import bayespy.data import bayespy.jni from bayespy.jni import jp class _AutoInsight: def __init__(self, network, target, logger): self._network = network self._logge...
""" test parquet compat """ import datetime from distutils.version import LooseVersion import os from warnings import catch_warnings import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm from pandas.io.parquet import ( FastParquetImpl, Py...
#=============================================================================== # Copyright 2014-2021 Intel Corporation # # 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.apa...
#!/usr/bin/env python3 ## -*- coding: utf-8 -*- from __future__ import print_function from triton import * from unicorn import * from unicorn.arm_const import * import pprint import random import struct import sys ADDR = 0x100000 ADDR2 = 0x300000 STACK = 0x500000 HEAP = 0x600000...
import copy import datetime import hashlib import logging import pickle import random import warnings from functools import partial from io import BytesIO from typing import Any, Callable, Iterable, List, Optional, Tuple, Union import pandas as pd import great_expectations.exceptions as ge_exceptions from great_expec...
''' Created on Oct 17, 2010 @author: Mark V Systems Limited (c) Copyright 2010 Mark V Systems Limited, All rights reserved. ''' from collections import defaultdict from math import (log10, isnan, isinf, fabs, trunc, fmod, floor, pow) import decimal try: from regex import compile as re_compile except ImportError: ...
# coding=utf-8 # Copyright 2020 The Google Research 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 applicab...
# Copyright 2019 YugaByte, Inc. and Contributors # # Licensed under the Polyform Free Trial License 1.0.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://github.com/YugaByte/yugabyte-db/blob/master/licenses/POLYFORM-FREE-TRIAL-LIC...
# coding=utf8 # -------------------------------------------------------- # Scene Graph Generation by Iterative Message Passing # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- import argparse, json, string from collections import ...
# Authors: <NAME> <<EMAIL>> # License: BSD 3 clause import pytest import numpy as np from numpy.testing import assert_allclose from scipy import sparse from sklearn.base import BaseEstimator from sklearn.dummy import DummyClassifier from sklearn.model_selection import LeaveOneOut, train_test_split from sklearn.utils...
import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from cv2 import * import cv2 import threading import time from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QWidget,QSplashScreen, QApplication, QGroupBox, QPushButton, QLabel, QHBoxLayout, QVBoxLayout, QGridLayout f...
# -*- coding: utf-8 -*- ########################################################################### ## Python code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) ## http://www.wxformbuilder.org/ ## ## PLEASE DO *NOT* EDIT THIS FILE! ###########################################################################...
import os from pathlib import Path import joblib import pandas as pd import numpy as np from multiprocessing import Pool from collections import defaultdict import functools import re import sys sys.path.insert(0, './code') from utils import DataLogger # noqa: E402 class DataNotFoundException(Exception): pa...
# -*- coding: utf-8 -*- """ Copyright (c) 2015, 2018, 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import print_function, unicode_literals, absolute_import import json import logging impo...
#!/usr/bin/env python3 # ## Licensed to the .NET Foundation under one or more agreements. ## The .NET Foundation licenses this file to you under the MIT license. # ## # Title : jitrollingbuild.py # # Notes: # # Script to upload and manage rolling build clrjit and the rolling build storage location # #####...
import tkinter as tk from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure import matplotlib.patches as patches import numpy as np # PLOT SHAPE --------------------------------------------------------------------------------------------------------------------------------...
import threading import logging import vnet import re import time import json import os import wmi import pythoncom import winreg import platform import configparser import requests import hashlib from requests.auth import HTTPBasicAuth from time import sleep from vnet.route_fix import VNETRouterFix from ping3 import p...
"""Core routines for PDF extraction.""" import itertools import logging import os from datetime import datetime from pathlib import Path from typing import List, Optional from libpdf import parameters from libpdf import process as pro from libpdf.apiobjects import ApiObjects from libpdf.catalog import catalog, extract...
# coding:utf-8 from email import message_from_string from contextlib import closing from cStringIO import StringIO from nose.tools import eq_, ok_, assert_false, assert_raises, assert_less from flanker.mime.create import multipart, text from flanker.mime.message.scanner import scan from flanker.mime.message.errors im...
#! /usr/bin/env python """ Version: 1.0.0 (Jan 10, 2019) Author: <NAME> - <EMAIL> """ import os import sqlite3 import argparse import random import numpy as np import re from multiprocessing import Pool, cpu_count from tqdm import tqdm from toolbox import tools, downloader, crawler, alphabet, transformer DEPRECAT...
import os,re,calendar from datetime import datetime import random import itertools from pathlib import Path import json from uuid import getnode as get_mac from flask import Flask, render_template, redirect, request, url_for, flash from flask import current_app, session, send_from_directory, jsonify from flask_login im...
""" Program to make an contour plot from a contour data file generated by the Perple_X program WERAMI, for data file format see: http://www.perplex.ethz.ch/faq/Perple_X_tab_file_format.txt """ # author: <NAME> # website: petrol.natur.cuni.cz/~ondro # last edited: April 16, 2014 import sys import os import pickle impor...
''' Created on june 12, 2018 author: Edmond ''' from __future__ import print_function, division, absolute_import, unicode_literals import os import shutil import numpy as np from collections import OrderedDict import logging from time import time import tensorflow as tf import util from layers import (weight_variabl...
# Required imported python libraries # Python default libraries, no need to install import os import sys import datetime import logging import argparse # Data manipulation libraries import numpy as np import pandas as pd # Graphing libraries import plotly import plotly.graph_objs as go import plotly.io as pio # Statist...
""" Primality testing """ from __future__ import print_function, division from sympy.core.compatibility import as_int from mpmath.libmp import bitcount as _bitlength def _int_tuple(*i): return tuple(int(_) for _ in i) def is_euler_pseudoprime(n, b): """Returns True if n is prime or an Euler pseudoprime ...
""" Construct a dataset with (multiple) source and target domains, adapted from https://github.com/criteo-research/pytorch-ada/blob/master/adalib/ada/datasets/multisource.py """ import logging import os from enum import Enum from typing import Any, Callable, cast, Dict, List, Optional, Tuple import numpy as np import...
#!/usr/bin/env python3 '''__main__.py''' # Internal Libraries import os import sys import tempfile from shutil import rmtree version = '21w11a dev' def file_type(file: str) -> str: if(not os.path.isfile(file)): print('Auto-Editor could not find the file: ' + file, file=sys.stderr) sys.exit(1) ...
# # Metrix++, Copyright 2009-2019, Metrix++ Project # Link: https://github.com/metrixplusplus/metrixplusplus # # This file is a part of Metrix++ Tool. # import logging import sys from metrixpp.mpp import api from metrixpp.mpp import utils from metrixpp.mpp import cout from metrixpp.mpp i...
from collections import defaultdict import numpy as np from cycgkit.cgtypes import * from cycgkit.boundingbox import BoundingBox from numpy import arccos, arctan2, array, float32, ndarray, pi, sqrt, uint32 from ..commonValues import scaleNumber class UVCalculationTypeEnum(object): noUVs = 'noUVs' spherical ...
from __future__ import unicode_literals import imaplib import json import logging import os import poplib import subprocess import yaml from django.core.exceptions import ValidationError from django.core.files import File from django.core.files.base import ContentFile from django.db import models, transaction from d...
import logging import rex.crash import rex.exploit.cgc.type2.cgc_type2_general from rex import Vulnerability from rex.exploit import CannotExploit from ..technique import Technique import claripy import angr l = logging.getLogger("rex.exploit.techniques.explore_for_exploit") l.setLevel("DEBUG") class WriteInfo(obj...
# # This file is part of pySMT. # # Copyright 2014 <NAME> and <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 ...
"""Imports""" import json import tempfile import pytest import os from tempfile import mkdtemp import demistomock as demisto from EDL import DONT_COLLAPSE, initialize_edl_context IOC_RES_LEN = 38 '''Tests''' class TestRequestArguments: from EDL import RequestArguments context_json = { RequestArgume...
import asyncio import re import warnings from contextlib import suppress from math import sqrt from html import unescape from base64 import b64decode from urllib.parse import unquote, urlparse import aiohttp import async_timeout from .errors import BadStatusError from .utils import log, get_headers, IPPattern, IPPor...
#!/usr/bin/python # # Copyright (c) 2013-2018, Intel 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 # ...
from __future__ import unicode_literals from decimal import Decimal import contextlib import glob import io import json import os import re import subprocess import sys if sys.version_info[:2] < (2, 7): # pragma: no cover import unittest2 as unittest else: import unittest try: from unittest import mock e...
# --------------------------------------------------------------------------------- # # PYPROGRESS wxPython IMPLEMENTATION # # <NAME>, @ 03 Nov 2006 # Latest Revision: 19 Dec 2012, 21.00 GMT # # # TODO List # # 1. Do we support all the styles of wx.ProgressDialog in indeterminated mode? # # 2. Other ideas? # # # For Al...
"""Plotting helper functions.""" # pylint: disable=too-many-arguments # pylint: disable=invalid-name from __future__ import annotations from typing import Sequence, Union, Optional from collections.abc import Iterable from numbers import Number import os.path import itertools import math import numpy as np import pa...
#-*- coding: utf-8 -*- ''' Created on 16 déc. 2013 @author: <NAME> All controls operations : return true if control ok ''' import os import errno from datetime import date,datetime,timedelta import ogr,osr import re import gdal import numpy as np import subprocess import shutil import math import scipy.ndimage as nd...
#!/usr/bin/python3 ################################################################################ # license # # license.py # Written by <NAME> # April 6 2014 # # This program will place license agreement information at the top of source # code files It reads your information from a config file, or requests your # in...
from collections import defaultdict from dataclasses import dataclass, replace from enum import Enum from functools import lru_cache from typing import ( AbstractSet, Any, Callable, Collection, Dict, List, Mapping, Optional, Pattern, Sequence, Set, Tuple, Type, Ty...
# encoding: utf-8 """ Copyright (c) 2014 <NAME> and contributors http://github.com/telegraphic/hickle Regarding to license, see LICENSE_hickle. # hickle.py Created by <NAME> 2016-02-03. Hickle is a HDF5 based clone of Pickle. Instead of serializing to a pickle file, Hickle dumps to a HDF5 file. It is designed to ...
# Copyright 2016 PerfKitBenchmarker 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 appli...
# Copyright 2017 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...
"""Functional Data Boxplot Module. This module contains the classes to construct the functional data boxplot and visualize it. """ from abc import ABC, abstractmethod import math import matplotlib import matplotlib.pyplot as plt import numpy as np from ..depth import ModifiedBandDepth from ..outliers import _envel...
""" GAIL file """ import numpy as np import torch from torch import nn # from torch.nn import utils import torch.nn.functional as f import random from policy import MlpNetwork, SoftQLearning from grid_mdp import GridMDP, MazeWorld, WindyMazeWorld, ToroidWorld from rnd import RND import matplotlib.pyplot as plt from buf...
import logging import os import sys import traceback import threading import asyncio import time import traceback import numpy as np import torch import ray from collections import namedtuple, defaultdict from concurrent.futures import ThreadPoolExecutor from readerwriterlock import rwlock from torch._C import dtype ...
# -*- coding: utf-8 -*- # # Copyright (c) 2015, ParaTools, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # (1) Redistributions of source code must retain the above copyright notice, # t...
from collections import OrderedDict import os import json import re import sys import pytest import yaml from conda_build import api, exceptions, variants from conda_build.utils import package_has_file, FileNotFoundError thisdir = os.path.dirname(__file__) recipe_dir = os.path.join(thisdir, 'test-recipes', 'variants...
import copy import pdb import numpy as np from scipy import signal from sklearn.preprocessing import normalize from wfdb.processing.basic import get_filter_gain from wfdb.processing.peaks import find_local_peaks from wfdb.io.record import Record class XQRS(object): """ The QRS detector class for the XQRS algo...
import os import shutil import numpy as np from collections import namedtuple import glob import time import datetime import pickle import torch import matplotlib.pyplot as plt from termcolor import cprint from navpy import lla2ned from collections import OrderedDict from dataset import BaseDataset from utils_torch_fil...
# Copyright The PyTorch Lightning team. # # 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...
from PyQt5 import QtGui, QtCore, QtWidgets import time import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Categorical, Normal import numpy as np import scipy.signal from utils import utils, logx def parse_args(parser): parser.add_argument( '--epochs', ...
""" 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. """ import json import os import pathlib from argparse import ArgumentParser from datetime import datetime import matplotlib.pyplot as plt impor...
import sqlite3 import time from json_abs import * from cep import * import gd import discord from discord.ext import commands client = gd.Client() class MMLevel: def __init__(self, lID: int, lName="", lAuthor="", lDifficulty=0, lDemon=0, lLength=-2, lRqS=-1, lIsRated=False, lastRequest=0, timesSent=0, timesRequeste...
#!/usr/bin/env python3 # # Copyright (c) <NAME> and the University of Texas MD Anderson Cancer Center # Distributed under the terms of the 3-clause BSD License. # # NOTE: for some namespace reason, this test can only be tested using # nose. import asyncio import atexit import os import re import time from textwrap imp...
# Read Epanet File import os def LoadFile(inp): global inpname, mm mm=[] #getPathPlugin = os.path.dirname(os.path.realpath(__file__))+"\\" #inpname = getPathPlugin + inp inpname = inp def BinUpdateClass(): global mm mm = getBinInfo() return mm ## get Info def getBinNodeReservoirIndex()...
#coding=utf8 import sys reload(sys) sys.setdefaultencoding('utf8') from flask import Flask, render_template, request, jsonify, redirect, url_for # To Paginate from flask_sqlalchemy import SQLAlchemy #from flask_paginate import Pagination, get_page_parameter # For Rendering from flask_bootstrap import Bootstrap #%pi...
import sys from collections import defaultdict import numpy as np from ..dimension import dimension_name from ..util import isscalar, unique_iterator, pd, unique_array from .interface import DataError, Interface from .multipath import MultiInterface, ensure_ring from .pandas import PandasInterface class SpatialPan...
import re import warnings import datajoint as dj import numpy as np import pynwb from .common_device import Probe # noqa: F401 from .common_filter import FirFilter from .common_interval import IntervalList # noqa: F401 # SortInterval, interval_list_intersect, interval_list_excludes_ind from .common_nwbfile import A...
# Copyright (C) 2012 Midokura Japan K.K. # Copyright (C) 2013 Midokura PTE LTD # 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.or...
# -*- coding: utf-8 -*- """This module defines input and output functions.""" import os from os.path import abspath, join, isfile, isdir, split, splitext import numpy as np from prody import LOGGER, SETTINGS, PY3K from prody.atomic import Atomic, AtomSubset from prody.proteins import alignChains from prody.utilities...
""" preproc.py ====== Helper functions for prerocessing training/validation data. Created by <NAME> (email: <EMAIL>) """ from typing import Tuple, Optional, Union, List, Type import warnings import numpy as np import torch from sklearn.model_selection import train_test_split def num_classes_from_labels(labels: np...
""" Helper functions commonly used in tests. """ from __future__ import print_function from __future__ import division from builtins import zip from builtins import str from builtins import range from builtins import object from past.utils import old_div import os import sys import csv import inspect import pickle imp...
# -*- coding:utf-8 -*- # # Copyright (C) 2019-2020, <NAME> <<EMAIL>> from __future__ import annotations import dataclasses as d import typing as t import dataclasses import fractions from .. import model from ..model import actions, expressions, types, properties, operators from . import lexer _IGNORE = {lexer.T...
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import boto3 from boto3 import resource from botocore.client import ClientError from aws_xray_sdk.core import xray_recorder from aws_xray_sdk.core import patch_all import uuid import logging import os #from...
""" Environment wrappers + functionality. """ import pickle from typing import Dict, Tuple, List, Any, Callable import numpy as np import torch import gym from gym import Env from gym.spaces import Box, Discrete, Space from baselines import bench from baselines.common.running_mean_std import RunningMeanStd from basel...