text stringlengths 6.04k 39.5k |
|---|
import os
import json
import pickle
import random
import copy
import h5py
import numpy as np
from PIL import Image
from datetime import datetime
cifar_color_class = {'automobile', 'cat', 'dog', 'horse', 'truck'}
cifar_gray_class = {'airplane', 'bird', 'deer', 'frog', 'ship'}
cifar_class_dict = {'airplane': 0, 'automob... |
#
### to change the scene/resolution, edit scene.txt
#
# GPL Notice:
#
# 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 any later version.
#
# This program is ... |
############################import libraries#############
import streamlit as st
import yfinance as yf
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import urllib
from keras.models import load_model
# import Image from pillow to open images
from PIL imp... |
#!/usr/bin/env python
import click
import re
import os
import glob
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import uncertainties
import pyhf
pattern = re.compile("(\d+(?:p[05])?)_(\d+(?:p[05])?)")
@click.command()
@click.option(
"--group",
default="1Lbb",
type=click.... |
import argparse
import re
import sys
import multiprocessing as mp
import numpy as np
import time
import math
start = time.process_time()
def get_cell_pin_info(parasitic_netlist_path):
"""
Get the pin locations of each logic cell
:param parasitic_netlist_path: the path to the parasitic netlist used to crea... |
import copy
import pytest
import torch
import torch_sparse
from torch_geometric.data import HeteroData
from torch_geometric.data.storage import EdgeStorage
x_paper = torch.randn(10, 16)
x_author = torch.randn(5, 32)
x_conference = torch.randn(5, 8)
idx_paper = torch.randint(x_paper.size(0), (100, ), dtype=torch.lon... |
from datetime import timezone
from time import sleep
import traceback
import pytz
import requests
from bs4 import BeautifulSoup
from dateutil.parser import parse as parsedate
from chart_data_functions import *
from constants import age_groups
from constants import counties
from constants import county_mapping
from co... |
# -*- coding: utf-8 -*- #
# Copyright 2016 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... |
from __future__ import print_function
import farmfs
from farmfs import getvol
from docopt import docopt
from functools import partial
from farmfs import cwd
from farmfs.util import empty_default, fmap, ffilter, pipeline, concat, identify, uncurry, count, groupby, consume, concatMap, zipFrom, safetype, ingest, first, ma... |
from loguru import logger
from saving_utils import generate_experiment_ids, convert_results_to_csv, save_results
from arguments import Arguments
from dataloaders import load_data_loader, generate_data_loaders_from_distributed_dataset
from clients import create_clients, Global_Client
import data_distribution
from utilit... |
"""
The MIT License (MIT)
Copyright (c) 2020 NVIDIA Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, ... |
import random
import os
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from collections import deque
from torch.distributions import Categorical
import matplotlib.pyplot as plt
from score_keeper import return_number_games, save_timesteps
from captum.attr import Integrated... |
import os,sys
"""
PARALLELISM
"""
import queue
import threading
import time
import sys
import os
import multiprocessing
import pickle
from pathos import multiprocessing as mp
import itertools
import uuid
class MyProcessPool(mp.ProcessPool):
def __init__(self, procs=4):
super(MyProcessPool, self).__i... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: <NAME>
# Creation date: 2018-02-17 (year-month-day)
"""
Python implementations of common optimization test functions, as well as dictionaries storing their properties.
"""
import numpy as np
class ObjectiveFunction:
def __init__(self, function_token):
self.... |
#!/usr/bin/env python
# Run most of AmberTools serial tests
''' Require: AMBERHOME
You need to call amber.setup_test_folders first (only do once)
amber.setup_test_folders
Then run test (anywhere)
amber.run_tests
Adjust the test by updating env TEST_TASK (please lookt at the code)
'''
from time import tim... |
#!/usr/bin/env python 3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 PanXu, Inc. All Rights Reserved
#
"""
基于 <<Chinese NER Using Lattice LSTM>> 论文
论文地址: https://www.aclweb.org/anthology/P18-1144/
实现 lattice lstm 模型
相关说明文档参考:
docs/ner/Chinese NER Using Lattice LSTM.md
Authors: PanXu
Date: 2021/01/20 19:48:00
"... |
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import tensorflow as tf
import numpy as np
from glob import glob
from itertools import cycle
import re
import json
with open('mels-male-v2.json') as fopen:
files = json.load(fopen)
reduction_factor = 1
maxlen = 904
minlen = 32
pad_to = 2
data_min = 1e-2
_pad =... |
"""This module handles the creation of `cross_experiment_key` s and `hyperparameter_key` s for
:class:`hyperparameter_hunter.environment.Environment`, and
:class:`hyperparameter_hunter.experiments.BaseExperiment`, respectively. It also handles the
treatment of complex-typed inputs and their storage in the 'KeyAttribute... |
import torch
from torch import Tensor
import numpy as np
import logging
from typing import Optional, Union, Tuple
# get logger
FORMAT = '[%(asctime)s [%(name)s][%(levelname)s]: %(message)s'
logging.basicConfig(format=FORMAT, datefmt='%Y-%m-%d %H:%M:%S')
LOG = logging.getLogger('Utils')
def count_parameters(model):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
SHORT_VOWELS = ['a', 'E', 'I', 'i', 'O', 'Y', 'u', '9', 'ai', 'ei', 'Ou', '9Y']
LONG_VOWELS = ['a:', 'E:', 'I:', 'i:', 'O:', 'Y:', 'u:', '9:', 'ai:', 'ei:', 'Ou:', '9Y:']
# These mappings are mostly not generally valid, but only in certain contexts. They are ... |
import shlex
import subprocess
import sys
import re
import json
import logging
"""
Copyright 2020 Netskope, Inc.
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 copyri... |
'''
scripts for rendering. must use blender-2.71.
'''
import os, sys
import numpy as np
import pickle
import datetime
import shutil
from multiprocessing.dummy import Pool
from functools import partial
from subprocess import call
import _pickle as cPickle
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__fi... |
"""
Description:
Scale up REST API functional tests to performance tests using threading.
Note:
requests module is synchronous and does not support asyncio to await for responses.
Another option is to use aiohttp module, which uses asyncio for asynchrony. This option requires re-writing
the API test functions, thou... |
import os
import sys
import tempfile
import requests
import base64
import time
import json
import fnmatch
from pathlib import Path
import click
from evolvcli.sdk.evolvclient.config import EvolvConfig
from evolvcli.sdk.evolvclient.client import EvolvClient
APPLICATION_JSON = 'application/json'
APPLICATION_YAML = 'a... |
#!/usr/bin/env python
__author__ = '<NAME>'
__date__ = '2020-03-13'
__version__ = '0.0.1'
import argparse
import os
import random
import numpy as np
import pandas as pd
import scanpy as sc
import itertools
import matplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib import gridspec
import warnings... |
from __future__ import absolute_import, print_function
import datetime
import mimetypes
import os
import posixpath
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db import transaction
from django.utils.encoding import python_2_unicode_... |
import wget
import gzip
import os
import json
import numpy as np
import collections
import shutil
from datasets import Dataset, DatasetDict, load_dataset, load_metric
from sklearn.model_selection import train_test_split
from sklearn.datasets import fetch_20newsgroups
from sklearn.preprocessing import LabelEncoder
impor... |
# -*- coding: utf-8 -*-
"""
zine.plugins.legacy_api
~~~~~~~~~~~~~~~~~~~~~~~
This plugin adds support for various legacy APIs. Currently the
following APIs are at least partially supported:
- WordPress
- MetaWeblog
- Blogger *
- MovableType *
APIs marked with a star are not really... |
import __init__paths
import attr
import spacy
from nltk.corpus import wordnet as wn
from tools import str2seq, read_text_test_data
from config import config_device, config_pwws_use_NE, \
config_data, config_dataset, model_path, config_pww_NNE_attack, BertConfig
import numpy as np
from get_NE_list import NE_list
fro... |
# Copyright Contributors to the Testing Farm project.
# SPDX-License-Identifier: Apache-2.0
import os
import re
import stat
import subprocess
import tempfile
import six
import gluetool
from gluetool.action import Action
from gluetool.utils import Command, from_json
from gluetool.log import format_blob, log_blob, log_... |
#!/usr/bin/env python3
"""
Classes and functions for defining categories.
.. _enum.Enum: https://docs.python.org/3/library/enum.html
.. _enum.EnumMeta: https://docs.python.org/3/library/enum.html#how-are-enums-different
.. _portion.interval.Interval: https://pypi.org/project/portion/#documentation--usage
.. _`s... |
# pylint: disable=E1101, dangerous-default-value
"""
Classes to handle alignments in the SAM format.
Reader -> Sam -> Writer
"""
import sys
try:
from collections import OrderedDict
except ImportError: #python 2.6 or 3.6+
if sys.version_info >= (3,6):
OrderedDict = dict
else:
from ordereddi... |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 10:38:48 2019
@author: Daniel
"""
from numpy import zeros, pi, array as arr, sin, exp, prod, linspace, newaxis, kron
from numpy.linalg import det
import matplotlib.pyplot as plt
from time import clock
def ind_draw(o,m,n):
if n>=0:
if n == 0... |
import os
from external_cmd import TimedExternalCmd
from defaults import *
from utils import *
import csv
# %(asctime)-15s 15 characters total
FORMAT = '%(levelname)s %(asctime)-15s %(name)-20s %(message)s'
logFormatter = logging.Formatter(FORMAT)
logger = logging.getLogger(__name__)
consoleHandler = logging.StreamHand... |
# UI
# Author : <NAME>
# Created 5:00 PM 7/16/15
# Last Updated 11:15 PM 12/4/16
# Version 2.76
import excel
from openpyxl import *
from os.path import exists
corpora = []
max_index = 0
output = 0
sort_type = 0
dual = False
menu = """
Enter a command:
output change type of output between shell te... |
import logging
import numpy as np
from pgdrive.component.vehicle_module.PID_controller import PIDController
from pgdrive.policy.base_policy import BasePolicy
from pgdrive.utils.math_utils import not_zero, wrap_to_pi, point_distance
from pgdrive.utils.scene_utils import is_same_lane_index, is_following_lane_index
cl... |
#Code made by::
#<NAME> --> Ci: 26.781.211
#<NAME> --> Ci: 26.900.042
#<NAME> --> Ci: 27.242.594
from panda3d.core import *
from direct.showbase.ShowBase import ShowBase
from direct.interval.IntervalGlobal import LerpHprInterval, Func, Sequence
from direct.gui.OnscreenText import OnscreenText
from direct.gu... |
import torch
import clip
from PIL import Image
import json
import cv2
import numpy as np
from tqdm import tqdm
import math
from math import log
from torch.nn.utils.rnn import pad_sequence
import sys
import time
import os
from collections import defaultdict, Counter
from multiprocessing import Pool
from functools import... |
import re
import datetime
import pandas as pd
import importlib
import calendar
import os
import slack
from google_play.google_play_pilot import GooglePlayPilot
from google_play.google_play_processor import GooglePlayProcessor
from raspador import Maneuver, OrdnanceManeuver, NavigationManeuver, SequenceManeuver, Upload... |
#
# Evaluates electrostatics corrections to free energy changes
#
import os,sys, random
import math
import mdtraj
from Sire.Tools.OpenMMMD import *
from Sire.Tools import Parameter, resolveParameters
# from Sire.Tools.LJcutoff import getFreeEnergy, resample
solvent_residues = ["WAT","ZBK","ZBT","CYC"]
ion_residues = [... |
#libraries for transformers training (text)
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from tqdm import tqdm, trange
from transformers import AutoConfig, AutoTokenizer
from arguments import args
from dataset import TextDataset
from evaluate import e... |
#This code is based on the implementation of calibration functions available here: https://github.com/dirichletcal/experiments_neurips/blob/master/calib/utils/functions.py
import numpy as np
from scipy.stats import rankdata
from scipy.stats import friedmanchisquare
from scipy.stats import wilcoxon
from scipy.stats impo... |
import os
import argparse
import copy
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from qdmr2sparql.grounding_utils import stem_match, measure_similarity
from qdmr2sparql.datasets import DatasetBreak
from qdmr2sparql.structures import GroundingKey, GroundingIndex, QdmrInstance
from qdmr2... |
from functools import partial
from typing import Any
from typing import Callable
from typing import Dict
from typing import Iterator
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import numpy as np
from sklearn.base import BaseEstimator
from recommender_metrics.... |
"""
Performs type inferencing on the given tree
Also performs type checking on conditionals to make sure they are Boolean
"""
from lark import Lark, v_args, Tree, Token
from lark.visitors import Visitor_Recursive
import sys
import logging
import log_helper
import copy
from default_class_map import default_class_map
... |
import numpy as np
def calculate_map_main(gt_results, pred_results, iou_gt_thr=0.5, class_num=5):
'''
说明: 此函数用于计算目标检测中的mAP
输入:
gt_results: list, 每一个元素对应一个样本中的所有目标的真实值
如gt_gt_result[0] = [
[xmin, ymin, xmax, ymax, label],
... |
#!/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 random
import parlai.utils.logging as logging
from typing import Any, Dict, Optional
from parlai.core.agents imp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This code provides data and converts to base features and forked from
https://www.kaggle.com/jsaguiar/updated-0-792-lb-lightgbm-with-simple-features
some data processing copied from the Dromosys kernel:
https://www.kaggle.com/dromosys/fork-of-fork-lightgbm-with-simple-... |
"""mfdn_v14.py -- driver module for MFDn v14.
<NAME>
University of Notre Dame
- 03/22/17 (pjf): Created, split from __init__.py.
- 04/06/17 (pjf): Correctly reference config submodule (mfdn.config).
- 04/07/17 (pjf):
+ Update for mcscript namespace changes.
+ Fix format call for ndiag.
- 04/11/17 (pjf): Fix broke... |
import multiprocessing as mp
import multiprocessing.managers as managers
import time
import numpy as np
import pandas as pd
import utils
import datasets
import os
import errno
import signal
from collections import Sequence
from itertools import product
import progressbar
##############################
# Experiment... |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import sys
import re
from copy import copy
from random import randint, shuffle
from itertools import izip_longest, takewhile
sentinel = object()
space = ' '
nl = '\n'
class InvalidCode(Exception):
def __init__(self, val) : self.val = val
def __str__(... |
# encoding: utf-8
"""
The main CheXNet model implementation.
"""
import re
import sys
import os
import cv2
import time
import numpy as np
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.optim import lr_scheduler
import torch.optim as optim
import torchvision
import torchvision.transf... |
from __future__ import division
import time
from util import *
from darknet import Darknet
from preprocess import prep_image, inp_to_image, letterbox_image
import argparse
from deep_sort import DeepSort
from collections import deque
from backbone.base import Base as BackboneBase
from config.train_config import TrainC... |
import numpy as np
import data_utils
import utils_hw
import os
import argparse
"""
Preprocessing functions. Note that all functions take a *dataset* dictionary, which is prepared by json_to_numpy.py
script and return the processed data in the same format.
You can run the following command to apply pre-processing:
-d... |
try:
from bs4 import BeautifulSoup
except ImportError:
print("[!_!]ERROR INFO: You have to install bs4 module.")
exit()
try:
import requests
except ImportError:
print("[!_!]ERROR INFO: You have to install requests module.")
exit()
try:
import ngender
except ImportError:
print("[!_!]ERR... |
#!/usr/bin/env python3
import json
import os
import argparse
import uuid
import sys
import textwrap
import yaml
sys.path.append("../utils")
import utils
from apiclient.discovery import *
from six.moves import input
# from params import *
from gs_params import *
from az_params import *
from ConfigUtils import *
ver... |
"""
Imports and extends the ``sympy`` library for symbolic mathematics.
Contains tools for converting Sympy expressions to Python modules and functions.
"""
import re
from typing import Callable, Optional, Union, Literal
from functools import lru_cache
import numpy as np
import sympy as sp
from sympy.utilities.lambdi... |
# -*- coding: UTF-8 -*-
from __future__ import print_function
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import os
import json
matplotlib.use('Agg')
def reset_style():
from matplotlib import rcParams
rcParams['font.family'] = 'serif'
r... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
dynahost : Administration d'hôtes ayant une adresse IP dynamique
================================================================
"""
import os
import hashlib
import argparse, textwrap
from dynahost.__init__ import __version__
from werkzeug.wrappers import Request, R... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Measure image properties.
"""
from __future__ import print_function, division
import numpy as np
from gammapy.image.utils import coordinates
__all__ = ['BoundingBox',
'bbox',
'find_max',
'lookup',
'lookup_ma... |
#C1949699
#
#
import math
import random
import re
import time
from turtle import numinput
from cv2 import INTER_AREA, INTER_BITS, INTER_CUBIC, INTER_LANCZOS4, INTER_LINEAR, INTER_LINEAR_EXACT, INTER_MAX, imread, imshow, waitKey
import numpy as np
import cv2
import os
from multiprocessing import Process, Manager
data_p... |
from bdb import set_trace
import imp
from operator import is_
import os
from re import I
import time
import csv
import numpy as np
from path import Path
import argparse
import matplotlib.pyplot as plt
from tensorboardX import SummaryWriter
import cv2
import torch
import torch.nn.functional as F
from core... |
#!/usr/bin/env python
#Copyright (C) 2013 by <NAME>
#
#Released under the MIT license, see LICENSE.txt
"""Creating bed tracks and lifted-over bed tracks for the hubs
"""
import os, re, time
from sonLib.bioio import system
from jobTree.scriptTree.target import Target
from optparse import OptionGroup
from hal.assembl... |
import discord
from discord import channel
from discord.ext import commands
from discord.utils import valid_icon_size
from gtts import gTTS
from pydub import AudioSegment
import youtube_dl
import os, random
import asyncio
import urllib.request
import uuid
from functions.join import __join
from functions.leave import _... |
# Basic arcade drawing
# Draw smiley face
import arcade
import random
import math
import os
SCREEN_WIDTH = 1950
SCREEN_HEIGHT = 950
SCREEN_TITLE = "Basic Drawing"
RADIUS = 150
HEALTHBAR_WIDTH = 50
HEALTHBAR_HEIGHT = 6
HEALTHBAR_OFFSET_Y = -10
class Health_Sprite(arcade.Sprite):
'''Health Sprite'''
def __i... |
# This rather messy code converts our datasets into a format that DeepSDF can use.
# To use it on your own data you may need to change some hard-coded paths and constants in the main.
# Also, you need meshlabserver for some mesh cleaning.
import os
import trimesh
import trimesh.repair
import numpy as np
from source i... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from .analysis_gauss_numerical_integration import gauss_numerical_integration
from .exoplanet_orbit import exoplanet_orbit
def integral_r_claret(limb_darkening_coefficients, r):
a1, a2... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
import numpy as np
from scipy.cluster.hierarchy import linkage, dendrogram
def _plot_rectangle(frameloc, color='k', linewidth... |
"""Character knowledge.
This module collects all character knowledge that we need to parse the
Lakhnawi PDF and makes it available to programs.
It contains definitions for things as character classes,
e.g. *symbols*, *presentational characters*, *punctuation*,
*bracket-like characters*, etc.
See `UChar` below.
"""
... |
#!/usr/bin/env python3.5
# -*- coding: utf-8 -*-
"""
__author__ = xyy
__mtime__ = 2016/8/10
"""
from datetime import datetime, timedelta
from ..models.model import *
from ..common.dateutils import date_now, date_pattern1
from ..service.booking_service import add_booking, update_booking
from ..service.meeting_service i... |
# Copyright 2021 Telstra Open Source
#
# 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 o... |
import json
import os
import packaging.version
import re
import shlex
import subprocess
import typing
from .. import api
from .._version import __version__
from ..shared import async_utils, constants
_ROOT_USER_STRS = {"", "0", "root"}
async def text_for_install(
image, install_pip, install_packages, install_d... |
# Copyright 2020 Google LLC
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
"""
Created on Fri Nov 12 12:32:51 2021
@author: DW
"""
class ORR_determine_Jcorr_zero:
def __init__(self, swgrp, set_jcorr_col="Jcorr_minus_factor"):
self.swgrp = swgrp
self.set_jcorr_col = set_jcorr_col
def _find_hor_stretch(self):
swgrp, _hor_mean, _horizontal_res, _overall_lin_pa... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from haul.utils import *
from haul.builder import *
from haul.langs.py.reader_py import *
from haul.langs.java.writer_java import *
import time # For waiting in between emu polls
def put(txt):
print('HAULBuilder_android:\t' + str(txt))
class HAULBuil... |
import os
from math import ceil, floor
import imageio
import random
from PIL import Image, ImageDraw
import numpy as np
from scipy import stats
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision.utils import make_grid, save_image
TRAIN_FILE = "train_losses.log"
DECIMAL_... |
# Standard library
import pickle
# Third-party
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import binned_statistic_2d
import yaml
# Joaquin
from joaquin import Joaquin
from joaquin.data import JoaquinData
from joaquin.config import Config
from joaquin.logger import logger
from joaquin.plot imp... |
import multiprocessing as mp
import logging
import warnings
import sys
import re
import numpy as np
import subprocess
import os
from datetime import datetime
import time
import argparse
import pkg_resources
import gc
def configure_logger(output_dir=None, mpi=False):
"""
Configure DegNorm logger. Save log to f... |
"""
Orders from production data to be temporary downloadable with a zip file
# order a zip @async
POST /api/order/<OID>
pids=[PID1, PID2, ...]
# creates the iticket/link to download
PUT /api/order/<OID> -> return iticket_code
# download the file
GET /api/order/<OID>?code=<iticket_code>
# remove the zip and the ... |
from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
from ray.rllib.models import ModelCatalog
from ray.rllib.utils.annotations import override
from ray.rllib.utils import try_import_torch
torch, nn = try_import_torch()
# class ResidualBlock(nn.Module):
# def __init__(self, channels):
# super()._... |
import argparse
import re
import csv
from math import floor, fabs
from lotto import times2int, german_price2float, month_day
parser = argparse.ArgumentParser(description='Read Lotto Numbers from year')
# parser.add_argument('year', help='The year of the data')
args = parser.parse_args()
cardinal_pattern = re.compi... |
"""
The ORM mappings for both Joomla's MySQL and the member registry's Postgres
databases and related functions.
"""
# imports
from datetime import (date, datetime, timedelta)
import pickle
import sys
from sqlalchemy import (Column, ForeignKey, String, DateTime, Integer, Text,
Numeric)
from sq... |
import os
from decimal import Decimal, ROUND_HALF_UP
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
year = 2015
targets = [811, 815, 823, 911]
observatories = ["Fukuoka", "Ohashi"]
analyses = ["FNL", "ERA", "GPV"]
variables = {"WindSpeed": "W... |
import torch
import numpy as np
import os
from datetime import datetime
import data
import metrics
import plots
from pytorch_spa_nn import SpaNn
torch.set_printoptions(linewidth=180, precision=8, edgeitems=12)
np.set_printoptions(linewidth=180)
def continue_training_from_checkpoint(checkpoint, max_epochs, new_check... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar'
import cv2
import time
import shutil
import os
import math
from scipy import ndimage
import matplotlib.pyplot as plt
import skimage.io as skio
import skimage.transform as sktf
import skimage.morphology as skmorph
import skimage.exposure as skexp
import numpy ... |
import copy
import glob
import os
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
from arguments import get_args
from common.vec_env.s... |
import numpy as np
import os
import scipy.io as sio
import plotly.graph_objects as go
import time
HW8_data_file_dir = os.path.join("Data-Part-B","Data-Problem-8")
Dataset_file = os.path.join(HW8_data_file_dir,"dataset.dat")
joint_file = os.path.join(HW8_data_file_dir,"joint.dat")
# assign numbers sequ
name_of_nodes ... |
import os
import flags_parser
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import tbase.utils as utils
from collections import OrderedDict
from tabulate import tabulate
from models import compute_bone_lengths_np
from models import VanillaAutoencoder
from tbase.normalizers import Normalize... |
from multiprocessing import Pool
import numpy as np
import pandas as pd
import traceback
import matplotlib.pyplot as plt
from copy import deepcopy
def feature_importance(x, y, model, metric_function, x_columns=None, permutations=30, processes=1,
col_start="perm_", seed=8272):
"""
Calcul... |
# Standard library
import os, abc
import numpy as np
from copy import deepcopy
# Third-party
from scipy.interpolate import interp1d
from astropy.table import Table
from astropy import units as u
# Project
from ..util import check_random_state, check_units, MIST_PATH
from ..log import logger
from ..filters import *
f... |
from machine import Pin, Map, LCD # include Pin, Map and LCD functions from machine module
import time # include time module
BUZZER = Pin(Map.WIO_BUZZER, Pin.OUT) # set Buzzer Pin as OUTPUT
# button pin configurations
Button_A = Pin(Map.WIO_KEY_A, Pin.IN) # set button pin as INPUT
Button_B = Pin(Map.WIO_KEY_... |
import psi4
import resp
import ele
import numpy as np
import yaml
import os
import shutil
from rdkit import Chem
from rdkit.Chem import AllChem
from pathlib import Path
from iteround import saferound
from rdkit.Geometry.rdGeometry import Point3D
from scipy.spatial.transform import Rotation
from .utils import canonic... |
import numpy as np
import pandas as pd
from pandas.core.groupby.generic import DataFrameGroupBy, SeriesGroupBy
from sklearn.preprocessing import StandardScaler, PolynomialFeatures
import matplotlib.pyplot as plt
from sklearn.utils import resample
import copy
import os
def to_numpy(arr):
try:
return arr.dat... |
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2019 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... |
import os
import yaml
import torch
import torch.nn as nn
from copy import deepcopy
from collections import deque
class Controller:
"""
Hydra's block controller. Stores information about its index in the
blocks list, the execution chain (blocks that should be executed in
order before this block), and t... |
# lyft dataset process module
# modiflied from nuscenes_dataset.py
import json
import pickle
import time
import random
from copy import deepcopy
from functools import partial
from pathlib import Path
import subprocess
import fire
import numpy as np
from second.core import box_np_ops
from second.core import preproce... |
"""
Work in progress: This module contains functions to perform feature grouping
between multiple ms-runs/specfiles and the class Fgi and FgiContainer to
represent and store such groups.
"""
# Copyright 2015-2017 <NAME>, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... |
#!/usr/bin/env python3
# -*- encoding: utf-8
# SPDX-License-Identifier: MIT
# Copyright (c) 2021 - 2021, <EMAIL>
__banner__ = r""" (
______ ____ _____ _______ _ _ /\ ____
_ | ____| / __ \ | __ \ |__ __| | | | | |/\| |___ \ _
(_) | |__ | | | | | |__) | | | | |__|... |
# Copyright 2020-2021
# Author: <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 required by applicable law or ... |
import os
import errno
import math
import numpy as np
from functools import partial
from astropy.table import Table, QTable
import astropy.units as u
from astropy.io import fits
from astropy.io.fits import PrimaryHDU, ImageHDU, CompImageHDU
from astropy.wcs import WCS, NoConvergence
from astropy.wcs.utils import wcs_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.