text
stringlengths
6.04k
39.5k
"""Code that evaluates the quality of products generated by the drizzlepac package. The JSON files generated here can be converted directly into a Pandas DataFrame using the syntax: >>> import json >>> import pandas as pd >>> with open("<rootname>_astrometry_resids.json") as jfile: >>> resids = json.load(jfile) >...
import kindred import re import html aminoAcidInfo = [('ALA','A'),('ARG','R'),('ASN','N'),('ASP','D'),('CYS','C'),('GLU','E'),('GLN','Q'),('GLY','G'),('HIS','H'),('ILE','I'),('LEU','L'),('LYS','K'),('MET','M'),('PHE','F'),('PRO','P'),('SER','S'),('THR','T'),('TRP','W'),('TYR','Y'),('VAL','V'),('ALANINE','A'), ('CYSTEI...
import unittest import dbt.main as dbt import os, shutil import yaml import random import time import json from functools import wraps from nose.plugins.attrib import attr import dbt.flags as flags from dbt.adapters.factory import get_adapter, reset_adapters from dbt.clients.jinja import template_cache from dbt.conf...
import copy import inspect import itertools import os import sys import networkx as nx # import pickle from functools import reduce curr_dir = os.path.dirname(inspect.getfile(inspect.currentframe())) base_dir = os.path.dirname(curr_dir) sys.path.append(base_dir) sys.path.append(os.path.join(base_dir, "ggsolver")) fro...
# coding: utf-8 import json import logging import os import re from datetime import datetime import rest_framework.request from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.files.storage import FileSystemStorage from ...
# Copyright (c) 2017-2020 <NAME>. # Author: <NAME> # Email: <EMAIL> # Update: 2020 - 2 - 7 import logging from concurrent import futures import numpy as np from PIL import Image from psutil import virtual_memory from .Crop import RandomCrop from .Dataset import Container, Dataset from .Transform import Bicubic, ...
"""Run BERT on CoQA, adapted from Google's run_Squad.py""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import json import os from absl import app from absl import flags from absl import logging import tensorflow as tf # pylint: disab...
from __future__ import print_function import tensorflow as tf import numpy as np import keras from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img from keras.models import Sequential from keras.layers import Activation, Dropout, Flatten, Dense, LSTM, Activation, Dense, Dropout...
#!/bin/env python # # File: RDKitAlignMolecules.py # Author: <NAME> <<EMAIL>> # # Copyright (C) 2020 <NAME>. All rights reserved. # # The functionality available in this script is implemented using RDKit, an # open source toolkit for cheminformatics developed by <NAME>. # # This file is part of MayaChemTools. # # MayaC...
import sys import types from enum import Enum, auto from functools import partial from traceback import extract_tb, format_list from typing import Any, List, Optional, Union import regex as re from attr import NOTHING, attrib, attrs, evolve, fields_dict, make_class from attr._make import _CountingAttr from attr.setter...
# This is the code for result visualization and model analysis. # Please run this code only after you've got the models trained and dumped. # Kindly notice that all the plots are default to save directly, it will not show out during the process. import json import math import os import pickle import warnings from stat...
import json import requests import base64 import zlib import sqlite3 import time import random import queue #this url has json formated challenge data that is encrypted with zlib than base64 challengeDataUrl = 'https://static-api.nkstatic.com/appdocs/11/es/challenges/' websiteUrl = 'http://4tccc.mooo.com/' conn = sq...
import os import shutil import unittest from io import BytesIO from os import path as osp from posixpath import join as pjoin import pytest import ibis import ibis.util as util from ibis.filesystems import HDFS from ibis.impala.tests.conftest import IbisTestEnv pytest.importorskip('hdfs') ENV = IbisTestEnv() pytes...
import math, sys, random from pprint import pprint from enum import Enum RANDOM_WORDS = ["altar", "corpse", "monster", "fire", "lightning", "water", "lava", "garbage", "venom", "gas", "ice", "power", "scrolls", "potions", "weapons", "statuses", "friendship", "persuasion", "tree", "stone", "void", "sand", "wind", "dire...
from types import SimpleNamespace from fontTools import unicodedata from fontTools.misc.fixedTools import otRound from ufo2ft.featureWriters import BaseFeatureWriter, ast from ufo2ft.util import classifyGlyphs SIDE1_PREFIX = "public.kern1." SIDE2_PREFIX = "public.kern2." # In HarfBuzz the 'dist' feature is automati...
from collections import OrderedDict import torch from torch import nn import torch.nn.functional as F from einops import rearrange from exp import ex from tensor_utils import onehot from loss.base import SmoothLoss from run_transformer import transformer_embed from .transformer_dis import TransformerDis from .module...
import pytest from skidl import * from .setup_teardown import * def test_svg_1(): """Test SVG generation.""" l1 = Part("Device", "L") r1, r2 = Part("Device", "R", dest=TEMPLATE, value="200.0") * 2 q1 = Part("Device", "Q_NPN_CBE") c1 = Part("Device", "C", value="10pF") r3 = r2(value="1K") ...
# Copyright (c) 2015, VMRaid Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import vmraid import sys from six.moves import html_parser as HTMLParser import smtplib, quopri, json from vmraid import msgprint, _, safe_decode, safe_encode, enqueue from vmraid...
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
""" This module is an abstraction on top of the low-level 7k records, which allows the user to work in terms of "pings" with associated data, instead of thinking in the traditional 7k records. Expected order of records for a ping: 7000, 7503, 1750, 7002, 7004, 7017, 7006, 7027, 7007, 7008, 7010, 7011, 7012, 7013, 7018...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
import multiprocessing as mp import signal import time import pytricia import redis import requests import ujson as json from artemis_utils import get_ip_version from artemis_utils import get_logger from artemis_utils.constants import CONFIGURATION_HOST from artemis_utils.constants import DATABASE_HOST from artemis_ut...
import torch from torch import nn, optim from torch.utils.data import DataLoader, sampler from tqdm import tqdm from argument import get_args from backbone import vovnet39, vovnet57, resnet50, resnet101 from utils.dataset import COCODataset, collate_fn from model import ATSS,Efficientnet_Bifpn_ATSS from utils import t...
#!/usr/bin/env python3.7 # Copyright (c) 2020 Performance Portability authors # SPDX-License-Identifier: MIT from matplotlib import pylab as plt from scipy.special import erf import matplotlib.patches as mpatches import matplotlib.gridspec as gridspec from scipy.integrate import simps import numpy as np from pathlib i...
""" Monte Carlo Sampling Benchmark Program via Amplitude Estimation- Qiskit """ import copy import functools import sys import time import numpy as np from numpy.polynomial.polynomial import Polynomial from numpy.polynomial.polynomial import polyfit from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegiste...
import requests from bs4 import BeautifulSoup as bs import time from datetime import datetime import pandas as pd import os def gshp_link_by_query(query): # Find a researcher's Google Scholar homepage link by a query kw = '+'.join(query.split()) search_link = 'https://scholar.google.com/citations?hl=en&vi...
import logging import numpy as np import pandas as pd from activitysim.core import chunk from activitysim.core import config from activitysim.core import expressions from activitysim.core import inject from activitysim.core import logit from activitysim.core import pipeline from activitysim.core import simulate from ...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import distutils.version import fnmatch import glob import json import logging import mmap import os im...
import numpy as np import math import random import sys import pickle import csv import os import time import matplotlib.pyplot as plt import cv2 import copy class DataLoader: def __init__(self, base_path, dataset_name): self.base_path = base_path self.dataset_name = dataset_name self.d...
# Note: These views are viewable only by people in the analyzers # group. They should all have the analyzer_required decorator. # # Also, because we have this weird thing with new users, # they should also have the check_new_user decorator. # # Thus each view should be structured like this: # # @check_new_user # ...
from re import findall from math import ceil from xml.etree import ElementTree as ET from dashlivesim.dashlib.dash_proxy import DEFAULT_MINIMUM_UPDATE_PERIOD from dashlivesim.dashlib import mpdprocessor from dashlivesim.dashlib.timeformatconversions import make_timestamp, seconds_to_iso_duration def get_mpd(dashProv...
import random import math #-------------------------------------------# # Elementary Number Theory Functions # #-------------------------------------------# ######## Greatest Common Divisior ######## def gcd(a, b): if a == 0: return b else: return gcd(b % a, a) ###...
import re, requests, cfscrape, traceback, validators from itertools import cycle from lxml.html import fromstring import concurrent.futures from bs4 import BeautifulSoup from urllib import parse proxies_switch = True def search(url:str): return replyLinks(url, saucenao=True, google=True, yandex=True, tineye=True,...
import cupy import cupyx.scipy.fft from cupy import _core from cupy._core import _routines_math as _math from cupy._core import fusion from cupy.lib import stride_tricks import numpy _dot_kernel = _core.ReductionKernel( 'T x1, T x2', 'T y', 'x1 * x2', 'a + b', 'y = a', '0', 'dot_product'...
from pycocotools.coco import COCO from pycocotools.mask import area,encode from asn.utils import load_pickle, save_pickle import numpy as np from copy import deepcopy from scipy.ndimage import zoom from scipy.misc import logsumexp from scipy.io import loadmat import skimage.io as io import tensorflow as tf from scipy....
# # vcr.py # - Configures the environment for running the Viral Assembly (vir-assembly-pipeline.sh) and VIGOR (VIGOR3.pl) pipelines (creating directory structure and installs software). # import os.path, re from fabric.api import cd, env, hide, local, run, settings, sudo, task from fabric.network import disconnect_a...
# Scientific Library import numpy as np import pandas as pd from scipy import stats from scipy.stats import norm as sp_norm from scipy.stats.distributions import chi2 as sp_chi2 # Standard Library from dataclasses import asdict, dataclass, field from importlib.metadata import version import importlib.resources as impo...
import numpy as np import cv2 from pycalib.util import * from skimage.transform import SimilarityTransform, EuclideanTransform def undistort_points(pt2d, cameraMatrix, distCoeffs): return cv2.undistortPoints(pt2d, cameraMatrix, distCoeffs, P=cameraMatrix) def distort_points(pt2d, cameraMatrix, distCoeffs): a...
from pioneer.common import times from pioneer.common.logging_manager import LoggingManager from pioneer.common.gui import Array from pioneer.common.gui import utils from future.utils import viewitems from inspect import currentframe, getframeinfo from OpenGL import GL from operator import attrgetter from PyQt5.QtQuick...
from __future__ import print_function from __future__ import division from collections import Counter import logging import numpy as np import torch import torch.nn as nn import torch.nn.functional as F __all__ = ['DistanceWeightedSampler', 'EasyPeasyPairsSampler', 'FlexibleTripletSampler', ...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init import math import os class MeanShift(nn.Conv2d): def __init__(self, rgb_range, rgb_mean, rgb_std, sign=-1): super(MeanShift, self).__init__(3, 3, kernel_size=1) std = torch.Tensor(rgb_std) self....
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2018 <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to u...
from typing import Dict, List, Any, Tuple, Optional, Union, TypeVar, Callable, NoReturn import time import pygame import game_error as err import game import pokemon.pokemon_type as pokemon_type import pokemon.player_pokemon as player_pokemon import main import numpy as np color_t = Union[tuple[int, int, int], tuple[i...
import json import binascii import struct import random from io import BytesIO import sys from operator import itemgetter class Item(): def __init__(self, name, index, quantity, rate): self.name = name self.index = index self.quantity = quantity self.rate = rate def __repr__(self): return ...
#!/usr/bin/python """ (C) Copyright 2018-2019 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.apache.org/licenses/LICENSE-2.0 Unless required by appli...
# coding: utf-8 # # Face Generation # In this project, you'll use generative adversarial networks to generate new images of faces. # ### Get the Data # You'll be using two datasets in this project: # - MNIST # - CelebA # # Since the celebA dataset is complex and you're doing GANs in a project for the first time, we ...
import numpy as np import io import os import psycopg2 import flask from flask import Flask, request, jsonify, render_template, Response from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from sklearn.ensemble import RandomForestRegressor from sklea...
#!/usr/bin/python3 import sys from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * import cv2 as cv from adafruit_servokit import ServoKit import numpy as np import jetson.inference import jetson.utils from components.segnet_utils import * from pyqt5Custom import ToggleSwitch from compone...
""" BD of two homologously-linked linear Rouse polymers. See `homolog_points_to_loops_list` for a description of how the homologous network structure is handled. """ from ..plot import PolymerViewer from .rouse import recommended_dt from .init_beads import init_homolog_rouse_conf from .forces import f_conf_ellipse, f_...
#!/usr/bin/env python import os from os.path import dirname, abspath, join, basename, exists import json import subprocess import sys import tempfile import webbrowser from inspect import isclass # The ConfigParser module has been renamed to configparser in Python 3.0 try: import ConfigParser except ImportError: ...
from systemtools.basics import * from systemtools.system import * from systemtools.printer import * from systemtools.duration import * def generateMultiLabelDataset(nbLabels=4, nbSamples=10000, balance=[0.6, 0.4, 0.8, 0.2]): assert len(balance) == nbLabels dataset = [] if balance is None: balance = [0.65] * nb...
#!/usr/bin/env python import serial import math import time import threading from evdev import InputDevice, categorize, ecodes, KeyEvent import pantilthat # hardcoeded first input event0 = InputDevice('/dev/input/event0') # vars # center ~34000 should be 32768 31000&37000 nullzone # debug log to console # >10: l...
import os import re import tempfile import urllib.request import hashlib import logging import shutil from pathlib import Path from importlib.resources import read_text from typing import Optional, List, Union, Iterable, BinaryIO, Dict, Any import boto3 import requests import github import internetarchive from jinja2 i...
from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional from typing_extensions import Literal from rotkehlchen.accounting.structures import Balance from rotkehlchen.assets.asset import Asset, EthereumToken from rotkehlchen.chain.ethereum.utils import token_normalized_...
""" This module contains tools for processing and dealing with some data liaised to this framework. Created on Sat Feb 22, 2020 @author: <NAME> (jcrvz.github.io), e-mail: <EMAIL> """ import random import os import json from subprocess import call import numpy as np from tqdm import tqdm import pandas as pd import sci...
import logging.handlers import argparse import botocore import boto3 import json from operator import itemgetter import sys logging.getLogger('botocore').setLevel(logging.CRITICAL) def _get_instances_in_cluster(cluster_name, next_token=None, status=None): '''Get instances in the given cluster''' result = [] ...
#################################### # Author: <NAME> # Date: September 2016 # Project: Document Summarization # H2020 Summa Project #################################### """ Document Summarization Modules and Models """ from __future__ import absolute_import from __future__ import division from __future__ import pri...
import json import os import pickle import re import traceback import importlib from termcolor import colored from datetime import datetime from vk_api import VkApi from vk_api.utils import get_random_id from vk_api.bot_longpoll import VkBotEvent from schedule import Scheduler _native_mention_regex_0 = r"\[id(\d+)\|(...
############################################################################## # Copyright (c) 2021 <NAME> and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at #...
import sys import os import cgu def display_help(): print("stub format help:") print(" -help (display this dialog)") print(" -i <input file>") print(" -o <output file>") print(" -w <overwrite input file in place>") print(" -p (print result to console)") print(" -stub (gen...
# Copyright (c) 2019, The GoKi Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. from gi import go, gi, giv, kit, units from enum import Enum class ClassViewObj(object): """ ClassViewObj is the base class for Python-defined clas...
# EPAN_NI.py (flowsa) # !/usr/bin/env python3 # coding=utf-8 """ Projects / FLOWSA / Years = 2012 Eliminated all columns with fraction in the title. """ import io import pandas as pd import xml.etree.ElementTree as ET from esupy.remote import make_url_request def url_file(url): url_array = url.split("get/") u...
import pandas as pd import re import pdb from data.data import * from dataProcessing.meanVariance import loadMeanVariance from dataProcessing.angDivisor import loadAngDivisor from tqdm import tqdm import json import pickle as pkl import numpy as np import nltk from nltk.stem import WordNetLemmatizer import string im...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> # import os # os.makedirs("./ckpt_test") # <codecell> import tensorflow as tf import numpy as np import math from datetime import datetime from datetime import timedelta ## ======== file path ============= ## checkpointdir = "./ckpt_L1_test/" checkpoi...
import sys import json import pathlib import itertools import collections import attr from csvw.metadata import TableGroup, Table, Column, Link, Schema from csvw.dsv import iterrows from clldutils.path import git_describe, walk from clldutils.misc import log_or_raise from clldutils import jsonlib from pycldf.sources ...
import pandas as pd import numpy as np import random as rd from pathlib import Path from datetime import datetime as dt import tensorflow as tf import tensorflow.keras.optimizers as opt from tensorflow.keras import Input from tensorflow.keras import backend as K from tensorflow.keras.models import Sequential, load_mod...
# Copyright (c) 2020, Xilinx # 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 # list of conditions and the follow...
"""Calculation for MagCrystal. Functions --------- - calc_b_iso_beta - calc_f_nucl - calc_f_mag """ import numpy from cryspy.A_functions_base.function_3_mcif import \ calc_full_sym_elems, calc_multiplicity, calc_moment_by_sym_elem from cryspy.A_functions_base.function_2_crystallography_base import \ ...
""" Module to load and handle the train and test data """ import concurrent.futures import os from collections import namedtuple import cv2 import h5py import matplotlib import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import cameras import data_utils from top_vae_3d_pose import bones from...
import os import numpy as np import torch import torch.utils.data from sklearn.metrics import mean_absolute_error from sklearn.metrics import mean_squared_error from .metrics import masked_mape_np from scipy.sparse.linalg import eigs import pickle def load_pickle(pickle_file): try: with open(pickle_file,...
import numpy as np import pandas as pd import scipy.signal import obspy from obspy.taup import TauPyModel from obspy import UTCDateTime import os class Event(): def __init__(self,event_path,oned_model):#event path will specify directory corresponding to that event's data, ''' __init__ function for...
"""Hold Evaluator class. Holds the Evaluator class which is used for evaluating the Abstract Syntax Tree created by the parser. """ from nem.exceptions import EvaluatorException import nem.interpreter import nem.nodes as ast import nem.types_ as value class Evaluator: """Evaluate the AST. Used for evalua...
import tkinter as tk import numpy as np import time import pandas as pd import json class DdrFile: # holds the notes in sequence with uldr = 1234, and indexed with subdivision number # has methods used to set/create a ddrfile and can be saved. def __init__(self, transcript, bpm=100, divisions_per_beat=4, ...
from copy import deepcopy import numpy as np from ..meg import make_meta_epochs def get_diagonal_ypred(gat): return _get_diagonal(gat.y_pred_, gat.train_times_['times'], gat.test_times_['times'], gat.train_times_['step']) def get_diagona...
from stix_shifter.stix_translation import stix_translation from stix_shifter_utils.utils.error_response import ErrorCode import unittest import random DEFAULT_LIMIT = 10000 DEFAULT_TIMERANGE = 5 protocols = { "tcp": "6", "udp": "17", "icmp": "1", "idpr-cmtp": "38", "ipv6": "40", "rsvp": "46",...
import sklearn import random from nltk.corpus import names from sklearn.naive_bayes import * from sklearn.tree import * from sklearn.svm import * import matplotlib.pyplot as plt import csv import PCMFeature import numpy as np from os import listdir class MLExample: def __init__(self): """__init__ sh...
#!/usr/bin/env python from __future__ import print_function import os import parsec_trace_tables as ptt import pbt2ptt import numpy as np import time import pandas import operator class Timer: def __enter__(self): self.start = time.time() return self def __exit__(self, *args): self.e...
from Hyperspectra_grids import sliding_window, extract_grids, WindowSize from models import LoadModel import torch.utils.data as utils import torch.nn as nn import torch import numpy as np import ast import random import math import os os.environ['CUDA_LAUNCH_BLOCKING'] = "1" from Dataloaders.Pavia_datal...
#!/usr/bin/env python3 # Copyright 2019 IBM Corp. # # 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...
#!/usr/bin/env python3 from git import Repo import os import re import sys import subprocess from pprint import pprint DIR_PATH = os.path.dirname(os.path.realpath(__file__)) # max size of a patch in bytes - bigger than that and we get issues with delivery to mailing lists MAX_PATCH_SIZE = 200000 SIGNOFF='<NAME> <<E...
import pandas as pd import numpy as np import types import math import datetime from dataclasses import dataclass from types import SimpleNamespace from typing import MutableSet, Mapping, Optional, Union, Any class ContractGroup: '''A way to group contracts for figuring out which indicators, rules and signals to ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ from __future__ import print_function import matplotlib.pyplot as plt import pickle import sys import pandas as pd import numpy as np import time import random import yaml import argparse from functools import partial...
import yaml import os from copy import copy, deepcopy from typing import List, Optional, Tuple, Union from ..character.characterKernel import GearedCharacter, JobGenerator from ..gear import Gear, GearBuilder, GearType, GearPropType, Scroll, eval_set_item_effect from ..jobs import job_branch_list from ..kernel.core.mo...
# -*- coding: utf-8 -*- """ Program main interface. ------------------------------------------------------------------------------ This file is part of grepros - grep for ROS bag files and live topics. Released under the BSD License. @author <NAME> @created 23.10.2021 @modified 04.02.2022 ----------------...
#v0.9 - Alpha 1 #v0.8 #import socket, videosocket import socket import errno from threading import Thread, Event from videofeed import VideoFeed from cv2 import cv2 import logging import numpy as np import zlib HEADER_LENGTH = 10 NP_ROW_CHARS_SIZE = 4 NP_COL_CHARS_SIZE = 4 NP_DIM_CHARS_SIZE = 4 client_...
from flask import Flask, request from flask_restful import Resource, Api, reqparse from flask_jwt import JWT, jwt_required, current_identity # from security import authenticate, identity app = Flask(__name__) app.config['PROPAGATE_EXCEPTIONS'] = True # To allow flask propagating exception even if debug is set to fals...
import argparse import subprocess import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from datetime import datetime import json import os import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) sys.path.append(os.path.dirname(BASE_DIR)) import provider # DEFAUL...
import nthmc, ftr import tensorflow as tf from numpy import inf class LossFun: def __init__(self, action, betaMap=0.0, cNorm2=1.0, cNormInf=1.0): tf.print('LossFun init with action', action, summarize=-1) self.action = action self.plainAction = None self.setBetaMap(betaMap) ...
""" Classes and functions for displaying anything on anything (in theory). """ # ====================================================================== from abc import ABC, abstractmethod from PIL import Image from typing import Tuple import logging import math import numpy # ===========================...
# -*- coding: utf-8 -*- """ @author: <NAME> The algorithm was implemented using Python 3.6.6, Keras 2.2.2 and TensorFlow 1.10.1. More details can be found in our KDD19 paper. <NAME>, <NAME>, and <NAME>. 2019. Deep Anomaly Detection with Deviation Networks. In The 25th ACM SIGKDDConference on Knowledge Discovery and D...
#!/bin/python3 ''' This starts the socket server to which things connect to play the game ''' import socketserver import socket # pylint: disable=unused-import import threading import time import random import sys import logging import os.path try: import ujson as json except: import json import battlecode as ...
import sublime import sublime_plugin import datetime import re from pathlib import Path import os import fnmatch import OrgExtended.orgparse.node as node from OrgExtended.orgparse.sublimenode import * import OrgExtended.orgutil.util as util from OrgExtended.orgutil.util import * import OrgExtended.orgutil.navigation...
# Requires Python 3.10 to operate import os import re import time from datetime import date smdDoc = '' newFileName = '' textDoc = '' def GetFile(fileName, directory): for root, dir, files in os.walk(directory): if fileName in files: return True return False command = input('Would yo...
""" Functions and classes to handle command line options of the main piquant script. Exports: execute_for_mqr_option_sets: Execute a piquant command for multiple option sets. get_value_names: Translate option values for plot titles and legends. get_run_name: Get the name of a read simulation or quantification run. """...
""" sphinxcontrib.autojsdoc ~~~~~~~~~~~~~~~~~~~~~~~ Automatically insert docstrings for JS functions, classes or whole modules into the doctree. - use JSDOC to build a structure.json file of your whole project. jsdoc -X -r src_dir > doc_src/jsdoc/structure.json - add to your conf.py ...
import pandas as pd import textacy import textblob import en_core_web_sm nlp = en_core_web_sm.load() # Multiprocessing Imports from dask import dataframe as dd from dask.multiprocessing import get from multiprocessing import cpu_count # Sentiment Imports from vaderSentiment.vaderSentiment import SentimentIntensityAn...
from __future__ import annotations import asyncio import copy import random from collections.abc import Iterator from functools import cache, cached_property, partial from itertools import starmap from typing import Any, Literal, Optional, TypeVar, Union, overload import discord from discord.ext import commands, menu...
import os import re from core import ( checks, constants, host_helpers, utils, ) from core.ycheck.events import YEventCheckerBase from core.cli_helpers import get_ps_axo_flags_available from core.cli_helpers import CLIHelper from core.plugins.storage import StorageBase from core.searchtools import ( ...
# ====================================================================== # # <NAME>, U.S. Geological Survey # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://geodynamics.org). # # Copyright (c) 2010-2017 University of California, Davis # # See COPYING for license informat...
import sys,os import onnx import numpy as np import struct from onnx import shape_inference from onnx import numpy_helper, ValueInfoProto, AttributeProto, GraphProto, NodeProto, TensorProto, TensorShapeProto from typing import Any, Text, Iterable, List, Dict, Sequence, Optional, Tuple, Union from typing_extensions impo...