text stringlengths 6.04k 39.5k |
|---|
import logging
import jsonpickle
import nipyapi
import pygraphviz as pgv
from nipyapi.nifi import ProcessGroupsEntity
def _add_mock_info(
do_mock, mock_info_data, function_name, nifi_id=None, args=None, data=None
):
"""
Populate the mocking information
:param do_mock: is true mocking data is being tr... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# dataStruct.py
#逐笔成交
import numpy as np
import datetime
import copy
#-----------------------------
#标准解压结构体
#-----------------------------
#单笔逐笔成交
AD_Transaction = {
"idx" : 0, #在包中的编号
"chSecurityCode" : "00000000", #证券代码
"b_isHistoryData" : True,
"nCurDate" : 0,
"... |
from Constants import ALL_LEVELS, CAP_LEVELS, MISSION_LEVELS, BOWSER_STAGES, LVL_BOB, SPECIAL_LEVELS, LVL_MAIN_SCR, LVL_CASTLE_GROUNDS, BEHAVIOUR_NAMES
from randoutils import format_binary
import random
import sys
import numpy as np
from Entities.Object3D import Object3D
import logging
#from Parsers.LevelScript import ... |
import numpy as np
from nipy.testing import assert_true, assert_equal, assert_raises, \
assert_false, assert_array_equal, parametric
from nipy.core.reference.coordinate_map import CoordinateMap, Affine, \
compose, CoordinateSystem, reorder_input, reorder_output, product, \
replicate, linearize, drop_io_dim... |
from tweepy import API, OAuthHandler, Stream, StreamListener
from time import sleep
from dotenv import load_dotenv
from threading import Thread
import os
import mysql.connector
import random
load_dotenv('.env')
# Go to http://apps.twitter.com and create an app.
# The consumer key and secret will be generated for you ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 07 11:48:53 2017
@author: <NAME>
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import h5py
import numpy as np
from collections import Iterable
from pyUSID.io.hdf_utils import create_results_group, write_main_dataset, write_simple_a... |
""" rdfframework module for generating rdfproperties. """
import pdb
import types
# pdb.set_trace()
# import rdfframework.rdfclass as rdfclass
from rdfframework.utilities import (find_values,
make_doc_string,
LABEL_FIELDS,
... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
import random
import datetime
from datetime import datetime
from datetime import timedelta
import time
from scipy.signal import savgol_filter
from definitions_for_artifact_recognition import label_artifact_data
from definition... |
# 8TeenBoy
import re, os, platform, urllib
from difflib import SequenceMatcher
import certifi
import requests
PLUGIN_LOG_TITLE = '8TeenBoy' # Log Title
VERSION_NO = '2019.07.23.11'
# Delay used when requesting HTML, may be good to have to prevent being
# banned from the site
REQUEST_DELAY = 0
# URLS
BASE_URL = 'ht... |
from logging import Logger
from os.path import join, exists
from chun_codes import random_pdf, compute_onesig_pdf
from astropy.io import ascii as asc
from astropy.table import Table, hstack
import numpy as np
from ..column_names import filename_dict, temp_metal_names0, npz_filename_dict, \
bin_names0, bin_ratios... |
import pickle as pkl
import sys
import networkx as nx
import numpy as np
import pandas as pd
import scipy.sparse as sp
from scipy.sparse.linalg.eigen.arpack import eigsh
def parse_index_file(filename):
"""Parse index file."""
index = []
for line in open(filename):
index.append(int(line.strip()))
... |
import os
from datetime import datetime
from flask import Flask, render_template, request, url_for
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import cv2
import imageio
import scipy.ndimage as ndi
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from... |
#coding:utf-8
from itertools import repeat, chain
from itertools import takewhile
from operator import itemgetter
from random import sample
from typing import Iterable, List, Dict, Tuple, Iterator, Optional as Opt, Sequence as Seq, Mapping as Map
from torch import stack
from torch.nn.utils.rnn import pack_padded_seque... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
catalogs - Tools for working with lists of stars
================================================
.. autosummary::
:toctree: generated/
brightest
faintest
find_offset
project_catalog
nearest_match
triangles
triangle_match
""... |
from .memory import *
from .number import Number
from ..lexical_analysis.lexer import Lexer
from ..lexical_analysis.token_type import *
from ..syntax_analysis.parser import Parser
from ..syntax_analysis.tree import *
from ..semantic_analysis.analyzer import SemanticAnalyzer
from ..common.utils import get_functions, get... |
from collections import OrderedDict
import math
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from megatron import get_args, get_tokenizer
from megatron import get_timers
from megatron import mpu
from megatron import print_rank_0
from megatron.checkpointing im... |
from __future__ import print_function
from __future__ import division
import os
import sys
import time
import datetime
import argparse
import os.path as osp
import numpy as np
import random
import cv2
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.utils.data import DataLoader
from ... |
"""
mnist using o2u-net to specify noisy samples
"""
import argparse
import logging
import os
import time
# from torchvision.models import resnet18, resnet34, resnet50
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.optim as optim
from torch.utils.data import DataLoader, Subset
from torchv... |
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
import math
#from ICP_With_SIFT import *
import ICP_With_SIFT
import time
import math
import random
import pyrealsense2 as rs
#>>>>> Descrition of this script
# This script is for exporting and importing description data for a specific ... |
import math
from .. import veros_method
from . import utilities, advection
@veros_method
def init_eke(vs):
"""
Initialize EKE
"""
if vs.enable_eke_leewave_dissipation:
vs.hrms_k0[...] = np.maximum(vs.eke_hrms_k0_min, 2 / vs.pi * vs.eke_topo_hrms**2
/ np... |
from __future__ import print_function
import numpy as np
import cv2
import sys
import os
sys.path.append('./agent')
from agent.doom_simulator import DoomSimulator
import feedforward_closedloop_learning
import threading
from matplotlib import pyplot as plt
from datetime import datetime
import random
width = 160
widthI... |
import os
import pickle
import tarfile
import numpy as np
import torch
import torch.utils.data
from torchvision import datasets, transforms
from skimage.color import rgb2lab, rgb2gray
from PIL import Image
def files_are_present(dataset_path, num_files=None):
if not os.path.exists(dataset_path): # can be either ... |
import numpy as np
import IPython
def log_epsilon(x, epsilon=1e-10):
return np.log(np.maximum(x, epsilon))
def calculate_probability(patterns):
"""
Returns the probability from a list of patterns to be learned
:param patterns: list of patterns to be learned
:return:
"""
p = np.zeros(pa... |
# -*- coding: utf-8 -*-
'''
--------------------------------------------------------------
tests of orbit_cheby's base class
../tests/test_orbit_cheby_creation
Just focusing on tests of the MSC/MSC_Loader instantiation and
population-with-data
Tests of other detailed functionality & a... |
from copy import deepcopy
from scipy.sparse import *
class Grammar:
def __init__(self):
self.grammar = {}
self.nonterminal_alphabet = []
self.start = 'S'
def nonterminal_alphabet_init(self):
for (nt, rules) in self.grammar.items():
if nt not in self.nonterminal_alp... |
# -*- coding: utf-8 -*-
import os
import shutil
import random
import math
import copy
def get_file_list(path, ext, wo_ext=False):
all_files = os.listdir(os.path.abspath(path))
data_files = [data_file[:-len(ext)] if wo_ext else data_file for data_file in list(filter(lambda file: file.endswith(ext), all_files))... |
import bottleneck as bn
import numpy as np
from photutils import (DAOStarFinder, aperture_photometry, CircularAperture,
CircularAnnulus, centroid_sources)
from astropy.coordinates import SkyCoord
from astropy.table import vstack
from astropy import units as u
from astropy.time import Time
from ... |
import enum
import collections
from typing import Dict, DefaultDict, List, Callable
import int256
# Machine State: (g, pc, m, i, s)
# g - Gas available,
# pc - Program counter (256 bit)
# m - memory contents -> series of zeros with size 2**256
# i - active number of memory contents (counting from index 0)
# s - ... |
# Author: <NAME>
# Date: 15/03/2019
# Project: featurizers
try: from featurizers.utils import *
except: from utils import *
class Featurize_1D:
def __init__(self, signal, sampling_frequency=1):
# Signal properties
self.signal = np.asarray(signal)
self.frequency = sampling_frequency
... |
import random
from utils import inrange
from tickerfinder import get_tickers_hw
from tesseract import TesseractOCR
"""
File for reading news stories from sliding video tickers.
"""
def get_frame_list(video, jump_size = 6, **kwargs):
"""
Returns list of frame numbers including first and last frame.
"""
... |
import logging
import requests
import json
import hashlib
from operator import attrgetter
import html2text
import os
import model
import utils
requests.packages.urllib3.disable_warnings()
class ZendeskRequest(object):
_default_url = 'https://{}/api/v2/help_center/' + utils.to_zendesk_locale(model.DEFAULT_LOCALE... |
from baopig.pybao.objectutilities import PrefilledFunction, Object, TypedDeque
from baopig._lib import *
from .text import Text, _LineSelection
# TODO : LineEntry (with select_all_on_focus and exec_on_defocus)
# TODO : solve arrows
# TODO : presentation text when nothing is in the text ?
class TextEdit(Text, Selec... |
# ******************************************************************************
# Copyright 2017-2018 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... |
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from utils import *
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Highway(nn.Module):
"""
Highway Network.
"""
def __init__(self, size, num_layers=1, dropout=0.5)... |
import os
import urllib.parse
import logging
import pandas as pd
import numpy as np
import os
import dash
import dash_bootstrap_components as dbc
from dash import dcc
from dash import html
from dash import dash_table
from dash.dependencies import Input, Output, State, MATCH
from dash.exceptions import PreventUpdate
im... |
import sys
import os
from PyQt5.QtWidgets import QDialog, QApplication, QPushButton, QGridLayout, QTableWidget, QTableWidgetItem, QLineEdit, QProgressBar, QFileDialog
from PyQt5.QtCore import QThread, QObject, pyqtSignal, pyqtSlot
import joblib
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as Figure... |
from conv_net import ConvNet
from torchvision import datasets, transforms
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
import json
import matplotlib.pyplot as plt
import numpy as np
import os
import seaborn as sns
import torch
sns.set... |
# Pymatgen
from pymatgen.io.vasp.outputs import Vasprun, Outcar
from pymatgen.analysis.local_env import CrystalNN
# Misc
import os
import pandas as pd
import numpy as np
import warnings
import functools
import itertools
import multiprocessing
import copy
from sklearn.linear_model import LinearRegression
import json
#... |
import pandas as pd
import numpy as np
import sys
import os
import re
import random
import matplotlib.pyplot as plt
from multiprocessing import Pool
from copy import deepcopy
from glob import glob
from dateutil import parser
from datetime import timedelta
###################################################
#### GLOB... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
import os
import mne
import scipy.sparse as sparse
import warnings
import numpy as np
import pandas as pd
from IPython import embed
from math import sqrt
from sklearn.feature_extraction.image import grid_to_graph
from mne.stats import permutation_cluster_test, spatio_temporal_cluster_test
from scipy.stats import t, t... |
from shapely.geometry import Point, Polygon
from matplotlib import pyplot as plt
from math import sin, cos, sqrt, atan2, radians
# !pip install gmaps
import shapely
import pickle
import random
import numpy as np
import gmaps, os
import tensorflow as tf
from tensorflow.keras.preprocessing.image import load_img
from ten... |
'''
注释:
参考对应版本的trt样例代码,修改成属于自己的代码
'''
import cv2
import math
import copy
from math import ceil
import numpy as np
from PIL import Image
from itertools import product
# 读取标签
def load_label_categories(label_file_path):
categories = [line.rstrip('\n') for line in open(label_file_path)]
return categories
# yo... |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# from urllib.parse import urlencode
# from urllib.request import urlopen
from urllib import urlopen
from urllib import urlencode
import time
import sys
import json
import datetime
import argparse
from xml.etree.ElementTree import Element, SubElement, Comment, tostri... |
# -*- coding: utf-8 -*-
"""Card view instance with more information about each instance.
Instances are grouped under groups. Groups are defined by `creator_label`
attribute on instance (Group defined by creator).
Only one item can be selected at a time.
```
<i> : Icon. Can have Warning icon when context is not right... |
import xgboost as xgb
from sklearn.feature_extraction.text import CountVectorizer,TfidfTransformer
import numpy as np
import os
import pickle,re,subprocess
from sklearn import metrics
from sklearn.model_selection import train_test_split,cross_val_score
from sklearn.metrics import classification_report
from skle... |
import torch
import torch.nn as nn
from torch.hub import load_state_dict_from_url
from torch.autograd import Variable
def DepthwiseConv2D(in_channels,stride,padding):
return nn.Conv2d(in_channels=in_channels,out_channels=in_channels,kernel_size=3,stride=stride,padding=padding,groups=in_channels,bias=False)
... |
import os
import time
import csv
import datetime
import math
from fractions import *
try:
import urllib.parse as urllib
except ImportError:
import urllib
from _login import Downloader
def collectTrends(username, password, terms, startDt, endDt, granularity='d',
geo='', cat='', gprops='', tz='', sum=False... |
import os
import re
import discord
from discord.ext import commands
from BB.conf import Conf
class Perms: #this also includes other things like musicplayer and uno permissions, etc
#EZ Mod check: commands.has_permissions(manage_messages=True)
#EZ Admin check: commands.has_permissions(manage_server=True... |
# references:
# https://github.com/una-dinosauria/3d-pose-baseline/blob/master/src/data_utils.py
import copy
import os
from glob import glob
import h5py
import numpy as np
from .camera_utils import project_to_camrea
from .camera_utils import transform_world_to_camera as transform_world_to_camera_base
# Human3.6m ID... |
from . import *
__all__ = [
'yearly_counts_grid','matrix','key2name','yearly_counts_table',
'author_pub_table'
]
def key2name(tname, truncate=None):
tstr = tname.split("|")
if len(tstr) == 3:
tstr = "%s (%s)" % (tstr[0], tstr[1])
else:
tstr = "%s %s" % (tstr[0], tstr[1])
tstr =... |
from collections.abc import Callable, Iterable, Mapping
from graph_algorithms import topological_sort
from neuwon.database import memory_spaces
from neuwon.database.doc import Documentation
from neuwon.database.dtypes import *
import itertools
import numpy as np
import textwrap
import weakref
class Database:
def _... |
""""Spatial joins for GeoPandas
The general algorithm for these spatial join functions is:
1. Use a spatial index (rtree in the current implementation) to roughly compute
the results. Because rtree operates on bounding boxes, this result is not final
and must be refined, but refines the search to a much small... |
from tkinter import (
Tk,
Frame,
LabelFrame,
Label,
Entry,
Button,
Radiobutton,
IntVar,
END,
)
from tkinter import ttk
from formulas import (
male_bmr,
female_bmr,
male_calories,
female_calories,
male_body_fat,
female_body_fat,
bmi_formula,
)
def calcul... |
"""Helpers for managing Python package requirements."""
from __future__ import absolute_import
import enum
import io
import itertools
import optparse
import os
import pathlib
import shlex
import typing
import atomicwrites
import ordered_set
import pip.basecommand
import pip.cmdoptions
import pip.download
import pip.e... |
from telegram.ext import Updater, Filters, MessageHandler, CommandHandler, CallbackQueryHandler
import os
from Server import Server
import telegram
import Database
import re
import math
import time
import requests
import io
import shutil
ADMINS = [651421362,742523989,85438832]
USERS = [651421362,742523989,85438832]
c... |
import sys
import string # punctuation
from textwrap import dedent
from nose.tools import *
from .context import textanalysis
from textanalysis import *
'''
To do:
* fix find_start_last test on line 320 when using re (remove subtraction)
Done:
* add test for curly quotes in substring in find_start_end
* ... |
import datetime
import json
class Uporabniki:
def __init__(self, uporabnisko_ime, geslo, potovanje):
self.uporabnisko_ime = uporabnisko_ime
self.geslo = geslo
self.potovanje = potovanje
def preveri_geslo(self, geslo):
if self.geslo != geslo:
raise Val... |
import hashlib
import hmac
import json
import logging
import re
import time
from abc import ABC
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Text
from urllib.parse import parse_qs
import rasa.shared.utils.io
from rasa.core.channels.channel import InputChannel, OutputChannel, UserMessage
fr... |
#!/usr/bin/env python3
import glob
import os
import ntpath
from datetime import datetime, timedelta
import time
import dateutil.parser
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
plt.switch_backend('agg')
from astropy.io import fits
from astropy.time import Time
import astropy.coordinates as... |
# Copyright 2019 snkas
#
# 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, softwa... |
import decimal
from django import test
from indicators.export_renderers import (
IPTTExcelRenderer,
)
tva = False
SPECIAL_CHARS = "Spécîal Chårs"
class FakePeriod:
def __init__(self, **kwargs):
self.header = kwargs.get('header')
self.subheader = kwargs.get('subheader')
self.count = kw... |
import logging
import pickle
import re
from copy import deepcopy
from pathlib import Path
import numpy as np
import scipy.sparse
import scipy.stats
import sklearn.datasets
import torch
import torch.utils.data
from scipy import stats
from scipy.spatial import distance
from sklearn.model_selection import StratifiedKFold... |
# https://cocalc.com
# %matplotlib inline
# import math
# from matplotlib import pyplot as plt
# from matplotlib import image
import math
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import image
BLANC_TRANSPARENT = [1.0, 1.0, 1.0, 0.0]
def image_vide(_x, _y):
"Une image transparente"
... |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import itertools
import numpy as np
import pickle
import sys
import scraper
from k_means import *
import progressbar
def func(x, *args):
"""
func gives a polynomial, to be used during the fitting procedure.
... |
import sys
import os
import category as Category
import shutil
sbhl = __import__("sbhighlight")
label_suffix = 0
def sbsyntax(code):
global label_suffix
list = sbhl.make_list(code)
if len(list)>1:
label_suffix += 1
return sbhl.html(code)+'''<input type="checkbox" id="syntax%d"><label for="syntax%d">show all f... |
# transaction.py - simple journaling scheme for mercurial
#
# This transaction scheme is intended to gracefully handle program
# errors and interruptions. More serious failures like system crashes
# can be recovered with an fsck-like tool. As the whole repository is
# effectively log-structured, this should amount to s... |
import tensorflow as tf
import numpy as np
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)
def bias_variable(shape):
initial = tf.constant(0.0, shape=shape)
return tf.Variable(initial)
def conv2d(x, W, s):
return tf.nn.conv2d(x, W, strid... |
import os
from flask import Flask, render_template, g, request, redirect, flash, send_file, session, url_for
from werkzeug.utils import secure_filename
from werkzeug.security import generate_password_hash, check_password_hash
# Support for mongodb+srv:// URIs requires dnspython:
#!pip install dnspython pymongo
... |
#!/usr/bin/python3
import random
import os
import subprocess
import json #Make sure it is simplejson - Needed to parse Decimal("####.########")
import logging
import time
from decimal import Decimal
import decimal
#Set this to your raven-cli program
cli = "raven-cli"
#mode = "-testnet"
mode = ""
rpc_port = 8766
#Se... |
import os
import pickle
import numpy as np
import json
# import shutil
from sklearn.preprocessing import StandardScaler
from kgcnn.data.qm import QMDataset
from kgcnn.mol.methods import ExtensiveMolecularScaler
from kgcnn.mol.convert import parse_mol_str
from kgcnn.utils.adj import add_edges_reverse_indices
class QM9... |
# <pep8-80 compliant>
from math import pi
import bpy
import bgl
import blf
import bmesh
import mathutils
from mathutils import Vector, Matrix
from bpy_extras import view3d_utils
from bpy.props import *
from collections import namedtuple
__author__ = "Nutti <<EMAIL>>, tetii"
__status__ = "Production"
__version__ = "... |
import numpy
import re
import sys
import datetime
import os
import glob
import pdb
from readData import readSequence
from run_mine import mine_seqs
from classPatterns import Pattern, PatternCollection, DataSequence
CMP_OUT_CODES = ["Perfect match",
"Patts cover match, same code length",
... |
# -*- coding: future_fstrings -*-
#!/usr/bin/env python2
from __future__ import division
from __future__ import print_function
if 1: # Set path
import sys, os
ROOT = os.path.dirname(
os.path.abspath(__file__)) + "/../" # root of the project
sys.path.append(ROOT)
import numpy as np
import time
im... |
# Copyright 2011 梅濁酒(umedoblock)
import math
import copy
import struct
import pprint
from sys import modules
import os
import pickle
import hashlib
try:
import _par2
from _par2 import _Par2
from _par2 import Par2Error
except ImportError as e:
print('cannot import _Par2')
print('reason: ', e.args[... |
import os
import sys
file_dir = os.path.dirname(__file__)
sys.path.append(file_dir)
import requests
import pprint
import pprint
import re
import json
import get_pdfs
from retrying import retry
import math
import pull_missing_docs
# End user will be able to import this module and create instances of the Docket class to... |
"""Tests for cvejob.version_utils module."""
import pytest
from cvejob.version_utils import (
get_configuration_nodes, VersionOperator, VersionSpec, VersionRange,
classify_versions, get_affected_ranges, get_safe_ranges, ClassifiedVersion,
get_upstream_versions, get_ranges_from_cve, get_version_ranges
)
d... |
#!/usr/bin/python3
# Copyright 2019 Adobe. All rights reserved.
# This file is licensed to you 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... |
# Copyright 2018, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
"""
This is companion code to Project 4 for CSEP576au21
(https://courses.cs.washington.edu/courses/csep576/21au/)
Instructor: <NAME>
"""
# ======================================================================
# Copyright 2021 <NAME> https://corvidim.net/ablavsky/
#
# Permission is hereby granted, free of charge, to ... |
# Advanced Multi-Mission Operations System (AMMOS) Instrument Toolkit (AIT)
# Bespoke Link to Instruments and Small Satellites (BLISS)
#
# Copyright 2017, by the California Institute of Technology. ALL RIGHTS
# RESERVED. United States Government Sponsorship acknowledged. Any
# commercial use must be negotiated with the... |
# -*- coding: utf-8 -*-
"""
Load SQuAD dataset.
"""
import random
import torch
import spacy
import numpy as np
import ujson as json
from tqdm import tqdm
from codecs import open
from collections import Counter
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
from .config import *
from file_u... |
from src.coronaSEIR import base_seir_model
from src.esmda import InversionMethods
from src.io_func import load_data, load_config, hospital_forecast_to_txt, save_results, save_input_data, \
add_hammer_to_results
from src.parse import parse_config, reshape_prior, get_mean
import sys
import numpy as np
import matplotl... |
# -*- coding: utf-8 -*-
"""This module defines the :class:`Request` class, that specifies
how tasks are executed."""
from __future__ import absolute_import, unicode_literals
import logging
import sys
from datetime import datetime
from weakref import ref
from billiard.common import TERM_SIGNAME
from kombu.utils.encod... |
#CLS:xkozak15
import re
import sys
import xml.dom.minidom as minidom
from copy import copy, deepcopy
from lxml import etree
from pprint import pprint
from globals import InheritanceType
from exceptions import BaseClsException
class Method:
def __init__(self):
self.is_virtual = False
self.is_pur... |
#!/usr/bin/env python
#encoding:utf-8
#
# Copyright (c) 2015 Ministerio de Fomento
# Instituto de Ciencias de la Construcción E<NAME> (IETcc-CSIC)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), t... |
"""General utilities."""
import functools
import operator
import re
import typing
import numpy as np
from jinja2 import (
Environment, PackageLoader, ChoiceLoader, DictLoader
)
from numpy.polynomial import Polynomial
from sympy import Symbol, Integer, Mul, poly_from_expr, Number, Poly, Expr
from drudge import pr... |
#!/usr/bin/env python3
import argparse
import json
import numpy
import os
import random
import re
import subprocess
import sys
import time
args = None
logFile = None
unlockTimeout = 999999999
fastUnstakeSystem = './fast.refund/aacio.system/aacio.system.wasm'
systemAccounts = [
'aacio.bpay',
'aacio.msig',
... |
#!/usr/bin/env python
#
# path.py - Utility functions for working with file/directory paths.
#
# Author: <NAME> <<EMAIL>>
#
"""This module contains a few utility functions for working with file system
paths.
.. autosummary::
:nosignatures:
deepest
shallowest
allFiles
hasExt
addExt
removeExt
g... |
import sys
import numpy as np
import torch
import trimesh
from timeit import default_timer as timer
import open3d as o3d
T_opengl_cv = np.array([
[1.0, 0.0, 0.0],
[0.0, -1.0, 0.0],
[0.0, 0.0, -1.0]
])
T_opengl_cv_homogeneous = np.array([
[1.0, 0.0, 0.0, 0.0],
[0.0, -1.0, 0.0, 0.0],
[0.0... |
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
import re
import os, sys
import argparse
from collections import defaultdict
sys.path.append('..')
import settings
import utils
import export_metadata
# def get_record_ids_from_fpaths(ser_fpaths):
# """
# using the df from the cal... |
"""Compute optimal buy amounts for a set of orders between two tokens.
Given an array YB of maximum sell amounts for all orders,
and an exchange rate xrate, solves the following optimization problem:
X* = argmax_{X} f(X, xrate)
where X is an array of buy amounts.
See https://github.com/gnosis/dex-open-solver/blob/... |
from ctypes import Structure, POINTER, c_int, c_char_p, c_void_p, c_float, \
c_double
from .dll import _bind
from .stdinc import Uint8, Uint32, SDL_bool
from .blendmode import SDL_BlendMode
from .rect import SDL_Point, SDL_FPoint, SDL_Rect, SDL_FRect
from .surface import SDL_Surface
from .video import SDL_Window
_... |
#! usr/bin/env python3
# -*- coding:utf-8 -*-
"""
@Author:kaiyinzhou
@Tensorflow 2.0
All of the following Code was follow Google BERT!
"""
from __future__ import absolute_import, division, print_function
import math
import tensorflow as tf
from fennlp.tools import create_initializer, reshape_to_matrix, get_shape_list
... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ ... |
import numpy as np
import tensorflow as tf
import json
import baseline
import os
from tensorflow.python.framework.errors_impl import NotFoundError
import mead.utils
import mead.exporters
from mead.tf.signatures import SignatureInput, SignatureOutput
from mead.tf.preprocessor import PreprocessorCreator
from baseline.uti... |
# Copyright (c) 2019, NVIDIA 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 applicable law or agreed to... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2017-03
from typing import Optional, Tuple, List, Dict
import simplejson
import binascii
import unicodedata
from decimal import Decimal
from mnemonic import Mnemonic
from trezorlib.client import TextUIMixin as trezor_TextUIMixin, Protoco... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# Import requires libraries
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim.lr_scheduler as lr_scheduler
import matplotlib.pyplot as plt
import os
import random
import nibabel as nib
from monai import transforms
from torch.utils.data import Dataset, DataLoader
im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.