text stringlengths 8.04k 46.5k |
|---|
# coding: utf-8
# Copyright (c) MoGroup at UMD.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import numpy as np
from monty.json import MSONable
from scipy import stats
from scipy.optimize import curve_fit
from pymatgen.io.vasp.outputs import Vasprun
from pymatgen.... |
'''
************************************************************************
FOR THE TIME BEING WHATEVER MODIFICATIONS ARE APPLIED TO THIS FILE
SHOULD ALSO BE APPLIED TO sdk_diag IN ANY OTHER PARTNER REPOS
************************************************************************
'''
import collections
import json
impor... |
#!/usr/bin/env python2
from __future__ import print_function
"""
wild_report.py
"""
import json
import optparse
import os
import sys
import jsontemplate
# JSON Template Evaluation:
#
# - {.if}{.or} is confusing
# I think there is even a bug with {.if}{.else}{.end} -- it accepts it but
# doesn't do the right thing!
#... |
import unittest
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import IntegrityError
from django.test import TestCase
from django.test.client import Client
from django.utils.translation import ugettext as _
from wouso.core... |
import logging
import numpy as np
from . import IRCdata, IRCfollowing, addIntcos, convcheck, hessian, history, intcosMisc
from . import optparams as op
from . import stepAlgorithms, testB
from .exceptions import AlgError, IRCendReached, OptError
from .linearAlgebra import lowest_eigenvector_symm_mat, symm_mat_inv, sy... |
"""A simple configuration system."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import argparse
import copy
import json
import os
import re
import sys
import typing as t
import warnings
from traitlets.traitlets import Any, Container, Dict, HasTraits, List, Un... |
from __future__ import absolute_import
import collections
import gzip
import logging
import os
import sys
import multiprocessing
import threading
import numpy as np
import pandas as pd
from itertools import cycle, islice
from sklearn.preprocessing import Imputer
from sklearn.preprocessing import StandardScaler, Min... |
####################################
# Author: <NAME>
# Date: September 2016
# Project: Document Summarization
# H2020 Summa Project
####################################
"""
Document Summarization Model Utilities
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_f... |
'''
====================================================================
Copyright (c) 2018 <NAME>. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
==================================================================... |
#!/usr/bin/env python3
# This Python file uses the following encoding: utf-8
"""Copyright 2012-2013
Eindhoven University of Technology
<NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, e... |
# PyeNalysis
__author__ = "<NAME>"
import copy
import numpy
from scipy.interpolate import interp1d
# DEBUG #
#from matplotlib import pyplot
# # # # #
def interpolate_blink(signal, mode='auto', velthresh=5, maxdur=500, margin=10, invalid=-1, edfonly=False):
"""Returns signal with interpolated results, based on ... |
from typing import Union, Dict, Tuple
import json
import pytest
from jina.helper import Namespace
from jina.hubble import HubExecutor
from jina.hubble.hubio import HubIO
from jina.parsers import set_pod_parser, set_gateway_parser
from jina.peapods.networking import K8sGrpcConnectionPool
from jina.peapods.pods.config.k... |
import os
import struct
from contextlib import contextmanager
from ctypes import *
from datetime import datetime
from colorama import Fore
from unicorn import UcError
from unipacker_ucl.pe_structs import (_IMAGE_DATA_DIRECTORY, _IMAGE_DOS_HEADER,
_IMAGE_FILE_HEADER, _IMAGE_OPTIONAL_H... |
""" The main edgex_access file that has all the classes used in this
module.
"""
from datetime import datetime
import os
import json
import random
import asyncio
import aiobotocore
import time
from logzero import logger
from .edgex_exceptions import *
from .edgex_base import *
from .edgex_fs import *
from .edge... |
from qtpy.QtCore import QObject
from qtpy import QtWidgets
from pathlib import Path
from pyqtgraph.parametertree import Parameter, ParameterTree
from pymodaq.daq_utils.parameter import pymodaq_ptypes
from pypret.frequencies import om2wl, wl2om, convert
from pypret import FourierTransform, Pulse, PNPS, lib, MeshData
i... |
from enum import Enum, unique
import logging
import math
import nlopt
import numpy as np
from PyQt5 import QtCore
from ..geometry.mesh import MeshGroup
from ..math.constants import VECTOR_EPS
from ..math.matrix import Matrix44
from ..math.misc import trunc
from ..math.transform import (rotation_btw_vectors, angle_axis_... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json, logging, os, pprint
from django.test import TestCase
from rapid_app import settings_app
from rapid_app.lib.processor import HoldingsDctBuilder, RapidFileProcessor, RowFixer, Utf8Maker, TitleMaker
from rapid_app.lib.ss_builder import SSBuilder... |
## Added by Rami >> ##
## << Added by Rami ##
# Imports
## Basic Python Imports
from copy import deepcopy
import itertools
import time
## ML & RL Impoorts
import numpy as np
import torch
from torch.optim import Adam # {Adanm, SGD, RMSprop, ...}
import gym
## Added by Rami >> ##
# PyBullet Imports
# import pybullet_... |
import os
import time
from copy import deepcopy
import torch
import torch.nn as nn
import numpy as np
import numpy.random as rd
import gym
class ActorPPO(nn.Module):
def __init__(self, mid_dim, state_dim, action_dim):
super().__init__()
self.net = nn.Sequential(nn.Linear(state_dim, mid_dim), nn.Re... |
import os
import sys
import datetime
import tkinter as tk
from tkinter import filedialog, messagebox
import decimal
import xml.etree.ElementTree as ET
import pygubu
import configparser
PROJECT_PATH = os.path.abspath(getattr(sys, '_MEIPASS', os.path.dirname(__file__)))
PROJECT_UI = os.path.join(PROJECT_PATH, 'ksaow.ui'... |
# -*- coding: utf-8 -*-
"""
Functions for annotating / selecting microarray probes
"""
import functools
import gzip
from io import StringIO
import itertools
import logging
from pkg_resources import resource_filename
import numpy as np
import pandas as pd
from scipy import stats as sstats
from . import datasets, io, ... |
from functools import partial
import numpy as np
import paddle.fluid as fluid
import paddle.fluid.layers as layers
from config import *
def position_encoding_init(n_position, d_pos_vec):
"""
Generate the initial values for the sinusoid position encoding table.
"""
channels = d_pos_vec
position =... |
'''
Created on Jan 2, 2018
@author: Nick
'''
from pip._vendor.distlib.compat import raw_input
import random
import sqlite3
'''First, for machine learning to work, we must have a database
that we are connecting to in order to store the data. For this reason
we use conn as our connecting variable and cur as ... |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
#!/usr/bin/env python
# Copyright 2019 <NAME>
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
Spatial feature transform (for Speech Separation & Enhancement), using enh.py for abbreviation
"""
import math
import torch as th
import torch.nn as nn
from typing import Union, List, Optional, Tuple
... |
import logging
import sys
from collections import namedtuple
import numpy as np
import pytest
from affine import Affine
from hypothesis import given, assume, settings, HealthCheck
from hypothesis.strategies import floats, integers
import rasterio
from rasterio.errors import RasterioDeprecationWarning, WindowError
fro... |
# -*- coding: utf-8 -*-
"""
A Python implementation of the Twee compiler.
This code was written by <NAME> <<EMAIL>>
It is licensed under the GNU General Public License v2
http://creativecommons.org/licenses/GPL/2.0/
This file defines two classes: Tiddler and TiddlyWiki. These match what
you'd normally see in a Tiddly... |
import json
import glob
import os
import subprocess
from subprocess import call
try:
from urllib.parse import unquote
except ImportError:
from urllib import unquote
import warnings
from datetime import datetime
import git
import tornado
from notebook.base.handlers import IPythonHandler
from notebook .utils i... |
#
# Author: <NAME>
# Copyright 2015-present, NASA-JPL/Caltech
#
import os
import glob
import logging
import datetime
import numpy as np
import isceobj
from isceobj.Alos2Proc.Alos2ProcPublic import create_xml
logger = logging.getLogger('isce.alos2insar.runFrameMosaic')
def runFrameMosaic(self):
'''mosaic frames
... |
"""
color_scheme_matcher.
Licensed under MIT.
Copyright (C) 2012 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to... |
# coding=utf-8
# Copyright 2018 <NAME>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer... |
import numpy.random as rnd
from sklearn.utils import check_random_state
import tensorflow as tf
from ..common.gen_samples import *
from .simple_gcn import *
def find_insts(x, x_range, y_range):
""" Returns indexes of instances which lie within the input ranges"""
insts = np.where(np.all(np.vstack([x[:, 0] >=... |
#!/usr/bin/env python
import os, sys # system functions
import nipype.interfaces.io as nio # Data i/o
from nipype.interfaces.io import DataSink
import nipype.interfaces.fsl as fsl # fsl
import nipype.interfaces.ants as ants
import nipype.pipeline.engine as pe # pypeline engine
import nipype.interfaces.utility as u... |
import re
import string
from collections import OrderedDict
from typing import Any, Collection, List, Optional, Sequence, TypeVar, Union
from ..generator import Generator
from ..utils.distribution import choices_distribution, choices_distribution_unique
_re_hash = re.compile(r"#")
_re_perc = re.compile(r"%")
_re_exc... |
import os
import time
import torch
import random
import numpy as np
# from model.seq_tagger import BertSeqTagger
from model.mix_seq_tagger import BertSeqTagger
from config.conf import args_config, data_config
from utils.dataset import DataLoader, BucketDataLoader, BatchWrapper
from utils.datautil import load_data, crea... |
from collections import Counter
import dateutil
from nltk import sent_tokenize, word_tokenize
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import pandas as pd
import numpy as np
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import CountVec... |
import discord
import json
import asyncio
from discord.ext import commands
from filehandler import FileHandler
from jsonhandler import JsonHandler
fh = FileHandler()
jh = JsonHandler()
class ReactBuy(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.load_data()
def load_data(self)... |
# -*- coding: utf-8 -*-
"""
Created on Dec 12 2020
Code to run MCMC (with fast-burn in) for PICO NR study, WIMP sensitivity
version with "horizontal re-seeding"
parallelization done with python library Multiprocessing
Inputs are (in order):
- directory to find data in
- Period of MCMC run
- epoch_nstep
- bin_num... |
# -*- coding: UTF-8 -*-
import os
import re
import regex
import argparse
import time
import multiprocessing
from multiprocessing import Pool, TimeoutError
import time
import os
import random
import math
from lxml import etree
import lxml
# https://lxml.de/apidoc/lxml.htmlhttps://lxml.de/tutorial.html
# https://lxml.de... |
"""ThreatConnect Batch Import Module"""
# standard library
import json
import uuid
from typing import Callable, Optional
from ..utils import Utils
from .attribute import Attribute
from .security_label import SecurityLabel
from .tag import Tag
# import local modules for dynamic reference
module = __import__(__name__)
... |
# Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from __future__ import annotations
import logging
from asyncio import iscoroutinefunction, ensure_future, create_task, get_event_loop
from collections import defaultdict
from functools import partial
from importlib impor... |
from __future__ import unicode_literals
import time
from datetime import datetime, timedelta
import json
import requests
import calendar
import difflib
import hashlib
from random import uniform
from operator import itemgetter, methodcaller
from itertools import izip
from pokemongo_bot import inventory
from pokemongo_... |
#!/usr/bin/python
import click
import json
import numpy as np
import os
import random
import yaml
from tqdm import tqdm
from data_utils import combine_source_and_rendered_data, get_best_inside_legend_position, hex_to_rgb
from questions.categorical import generate_bar_graph_questions, generate_pie_chart_questions
from... |
#!/usr/bin/env python
"""
@package ion.agents.platform.rsn.rsn_platform_driver
@file ion/agents/platform/rsn/rsn_platform_driver.py
@author <NAME>
@brief The main RSN OMS platform driver class.
"""
__author__ = '<NAME>'
__license__ = 'Apache 2.0'
from pyon.public import log, CFG
from pyon.core.exception impor... |
from shutil import copyfile
import yaml
import datetime
import os
import argparse
""""
Testbed Processing
Requirement:
python version: 2.X
python package: PyYAML 3.12 (or later)
PyYaml Install Instructions:
[1] Download PyYAML from https://pyyaml.org/wiki/PyYAML
[2] Unpack the archive
[3] Install... |
import numpy as np
import mxnet as mx
from mxnet.gluon import nn, HybridBlock
from mxnet.util import use_np
from autogluon_contrib_nlp.layers import get_activation, get_norm_layer
from autogluon_contrib_nlp.models.transformer import TransformerEncoder
from .. import constants as _C
from ..config import CfgNode
@use_n... |
#!/usr/bin/python3
import os
import sys
import copy
from collections import OrderedDict
import argparse
import multiprocessing as mp
import numpy as np
import h5py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import colors
from cycler import cycler
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2013, <NAME>
#
# 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 ... |
from torch.nn.functional import conv2d, pad
from e2cnn.nn import init
from e2cnn.nn import FieldType
from e2cnn.nn import GeometricTensor
from e2cnn.gspaces import *
from ..equivariant_module import EquivariantModule
from .basisexpansion import BasisExpansion
from .basisexpansion_blocks import BlocksBasisExpansion
... |
from django.shortcuts import render, redirect
from django.template import RequestContext, Context, loader
from django.http import (
HttpResponse,
HttpResponseNotFound,
HttpResponseForbidden)
from datasets.models import Dataset, Document, Term, Modality
from models.models import ArtmModel, Topic
from django.... |
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import argparse
from tensorflow.python.ipu.config import IPUConfig
import numpy as np
import tensorflow.compat.v1 as tf
from functools import partial
from packaging import version
import time
import os
import random
from threading import Thread
from tensorflow.k... |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function, unicode_literals
from future import standard_library
from builtins import open, str
import os
import warnings
import simplejson as json
import... |
"""gridworld interface"""
from __future__ import absolute_import
import ctypes
import os
import importlib
import numpy as np
from .c_lib import _LIB, as_float_c_array, as_int32_c_array
from .environment import Environment
class GridWorld(Environment):
# constant
OBS_INDEX_VIEW = 0
OBS_INDEX_HP = 1
... |
"""
YoloV5 code adapted from https://github.com/ultralytics/yolov5/blob/master/models/yolo.py
"""
import math
from typing import Union, Type, List
import torch
import torch.nn as nn
from super_gradients.training.models.detection_models.csp_darknet53 import Conv, CSPDarknet53, get_yolo_version_params
from super_gradien... |
import openpyxl
import pandas as pd
from datetime import datetime, timedelta
import xlsxwriter
now = datetime.now()
date_time = now.strftime("%m_%d_%Y %I_%M_%p")
federal_tax_rate_path = "./federaltaxrates.csv"
state_tax_rate_path = "./statetaxrates.csv"
city_tax_rate_path = "./NYCtaxrates.csv"
# calculate social s... |
import torch
import torch.nn as nn
from torch.nn import init
import torchvision
import functools
import torch.nn.functional as F
from torch.optim import lr_scheduler
###############################################################################
# Helper Functions
######################################################... |
import msgpack, math, pdb, os, inspect, sys, time, datetime
import torch
import numpy as np
from torch.autograd import Variable
import models
from dataloader import Dataloader
# import visdom
from argparse import ArgumentParser
from torch.nn.utils import clip_grad_norm
from utils import settings, gprint, label_set, ... |
import glob
import os
import copy
import time
from functools import lru_cache
import pickle
import numpy as np
from astropy.table import Table
from astropy.time import Time
from astropy import log
from nuclockutils.nustarclock import NUSTAR_MJDREF, get_bad_points_db
from nuclockutils.nustarclock import temperature_cor... |
import numpy as np
import pandas as pd
import scipy
import matplotlib.pyplot as plt
import math
from .lookup_function import LookupFunction, VoxelLookupFunction
import collections
import warnings
from functools import reduce
class SparseHistogram(object):
"""
Base class for sparse-based histograms.
Parame... |
"""
This module contains a Trainer class for quickly and easily building
VAE or FeedForward property predictors from the extracted structural protein
features.
"""
import sys
sys.path.append("/gscratch/pfaendtner/Chowdhury/cnns4qspr")
import time
import os
import copy
import torch
import torch.nn as nn
import torch.ut... |
# Copyright 2015 0xc0170
#
# 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, soft... |
"""
Distributed grid search meta-estimators
"""
import time
import numbers
import numpy as np
from joblib import Parallel, delayed
from sklearn.model_selection._search import (
ParameterGrid, BaseSearchCV,
GridSearchCV, RandomizedSearchCV,
ParameterSampler
)
from sklearn.model_selection._split import... |
"""
Title: Feature Engineering Module
Project: CSI4900 Honours Project
Created: Feb 2020
Last modified: 06 May 2020
Author: <NAME>
Status: In Progress
Description: This module take the pre-processed data and uses it to extract expanded (engineered features) to be used
in the classifier.
"""
import csv
import pand... |
#!/usr/bin/env python
r"""
This module provides command execution functions such as cmd_fnc and cmd_fnc_u.
"""
import os
import sys
import subprocess
import collections
import signal
import time
import re
import inspect
import gen_print as gp
import gen_valid as gv
import gen_misc as gm
robot_env = gp.robot_env
if... |
"""The higher-level objects API."""
import datetime
from collections import OrderedDict
from decimal import Decimal
from typing import TYPE_CHECKING, Callable, ClassVar, Iterable, List, Optional
from typing import OrderedDict as OrderedDictType
from typing import TypeVar, Union, cast
from attrs import Factory, define... |
import os
from collections import OrderedDict
from astropy.coordinates import BaseRADecFrame
from astropy.wcs.utils import wcs_to_celestial_frame
from glue.config import qt_fixed_layout_tab
from glue.core.data_combo_helper import ComponentIDComboHelper
from glue.core.message import (EditSubsetMessage, SettingsChangeMe... |
##############################################################################
#
# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
#!/usr/bin/env python
# coding: utf-8
# # GrowthViz - Pediatrics
#
# ## Background - growthcleanr
#
# [growthcleanr](https://github.com/carriedaymont/growthcleanr) is an automated method for identifying implausible values in anthropometric data from EHRs. It is available as open source software. It was originally de... |
# upgrade.py - functions for in place upgrade of Mercurial repository
#
# Copyright (c) 2016-present, <NAME>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import stat
import tempfile
from... |
from numpy import exp,concatenate,array,float,r_
from pylab import plot,ylabel,xlabel,gca,draw,legend,subplot,show,text,gcf,rand
from numpy import zeros,arange,ones,convolve,floor
import numpy as np
import matplotlib as mpl
mpl.rcParams['lines.linewidth'] = 3
mpl.rcParams['figure.figsize'] = (10,8)
mpl.rcParams['axes.... |
# -*- coding: utf-8 -*-
import json
import random
from io import BytesIO
import pytest
from PIL import Image, ImageFilter, ImageEnhance
import iscc
TEXT_A = u"""
Their most significant and usefull property of similarity-preserving
fingerprints gets lost in the fragmentation of individual, propietary and
us... |
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O ... |
import argparse
import os
import pprint
import time
import traceback
from collections import defaultdict
from copy import deepcopy
from datetime import datetime
from functools import partial
import dgl
import numpy as np
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
import data
import set... |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 23 21:56:24 2020
@author: Mitchell
"""
"""network.py
~~~~~~~~~~~~~~
This file contains a set of classes and modules that can be used for building
and training fully connected feedforward neural networks. Each network is
trained using the stochastic gradient descent learn... |
from collections import defaultdict
from itertools import groupby, product
import numpy as np
import pandas as pd
from scipy.stats import hmean, spearmanr
from statsmodels.stats.proportion import proportion_confint
import wordfreq
from conceptnet5.util import get_support_data_filename
from conceptnet5.vectors import ... |
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the author be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistri... |
#!/usr/bin/env python3
''' Functions used for calculating the Riemannian features'''
import numpy as np
from collections import OrderedDict
from pyriemann.utils import mean, base
from tqdm import tqdm
from multiprocessing import Pool
from functools import partial
from filters import butter_fir_filter
from utilities ... |
# Copyright 2018-2020 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... |
import torch
import numpy as np
from torch.utils.data import Dataset
import os, glob
import re
import cv2
import math
from random import shuffle
import torch.nn.functional as F
from torchvision import transforms
from tqdm import tqdm
from PIL import Image
import scipy.io as io
import matplotlib.pyplot as plt
import m... |
from http.client import HTTPException
import random
import discord
from discord.errors import ClientException
from discord.commands import slash_command, SlashCommandGroup, Option
from discord.ext import commands, pages # Bot Commands Frameworkのインポート
from multiprocessing import Process
from cogs.recserver import RECSE... |
"""
Linear exponential smoothing models
Author: <NAME>
License: BSD-3
"""
import numpy as np
import pandas as pd
from statsmodels.base.data import PandasData
from statsmodels.genmod.generalized_linear_model import GLM
from statsmodels.tools.validation import (array_like, bool_like, float_like,
... |
import re
import csv
from enum import Enum
import pykicadlib
import pykicadlib.config
class symbol(object):
'''KiCAD symbol class'''
def __init__(self, name, reference, footprint, document, alias = ''): #, offset = 0, fields = [], elements = []):
self.name = name
self.reference = reference
... |
# coding: utf-8
import math
import sys
import gzip
from collections import defaultdict
import datetime
from itertools import product
import jieba
import csv
import pandas as pd
import json
import os
class Struct(object):
def __init__(self, word, sentiment, pos, value, class_value):
self.word = word
... |
# Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... |
import vedo
from vedo import load, show
import torch
import numpy as np
import sys
sys.path.append("/home/heygears/jinhai_zhou/work/package/hgapi")
import hgapi
# ---- hgapi ----
# 模型摆正
def stlHandlerRead(fName):
# 一、找出最大面后旋转,找出正面方向
mesh = hgapi.Mesh()
stlHandler = hgapi.STLFileHandler()
print("stlHa... |
import torch
import numpy as np
import skimage
import os
import torchvision.utils as utils
from skimage import color
import mermaid.image_sampling as py_is
from mermaid.data_wrapper import AdaptVal,MyTensor
from .net_utils import gen_identity_map
from .net_utils import Bilinear
import mermaid.utils as py_utils
import m... |
# coding=utf-8
# Copyright 2021 The Meta-Dataset Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
# import modules
import os
import numpy as np
import torch, torchvision
import torch.nn as nn
import torch.nn.functional as F
import subprocess
from collections import defaultdict, Counter
from tqdm import tqdm
import math
# import mmcv functionalities
from mmdet.models import build_detector
from mmcv.runner import lo... |
#!/usr/bin/env python3
import collections
import platform
import re
import sys
machine = platform.uname().machine
def usage():
print('usage: {} script-args -- program [program args..]'.format(sys.argv[0]))
def main():
if 'x86_64' != machine or 'x86_64' != platform.uname().processor:
print("non-amd... |
# -*- encoding: utf-8
"""
Curses user interface.
"""
import os
import sys
import logging
from platform import system
from wcwidth import wcswidth
from .prompt import Prompt, PromptBool, PromptFiltered, PromptFile, PromptAutocmp
from .key_mappings import key_map
# Curses can't be imported yet but we'll
# predefine it... |
# coding: utf-8
"""
Copyright (C) 2016, <NAME>
E-mail: DavisT -at- cardiff.ac.uk
Updated versions of the software are available through github:
https://github.com/TimothyADavis/KinMSpy
If you have found this software useful for your research,
I would appreciate an acknowledgment to the use of the
"KINematic Molecula... |
from typing import Tuple, Dict, List, NamedTuple, IO
import logging
import json
from kloppy.domain import (
EventDataset,
Team,
Period,
Point,
BallState,
DatasetFlag,
Orientation,
Provider,
PassEvent,
ShotEvent,
TakeOnEvent,
CarryEvent,
GenericEvent,
PassResult,
... |
"""
Utility methods.
"""
import os
import sys
import shutil
import logging
import hashlib
import numpy as np
from catboost import CatBoostRegressor
from catboost import CatBoostClassifier
from lightgbm import LGBMRegressor
from lightgbm import LGBMClassifier
from sklearn.experimental import enable_hist_gradient_boosti... |
# this script requires python 3.7+
import datetime, calendar, math # calculating dates
import json, urllib.request # getting and parsing sunrise/set data
import sys # for logging to stdout
import os # caching sunrise/set data
import logging ... |
"""
Processing raw data, building and training models, suggesting closest projects.
"""
import os
from collections import Counter, defaultdict
from math import log
from operator import itemgetter
from typing import Dict, List, Tuple, Union
import faiss
import matplotlib.pyplot as plt
import numpy as np
import require... |
# 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 use ... |
#! python3
# -*- coding: utf-8 -*-
"""PyJEM facade of the Poor man's PyJEM
Author: <NAME> <<EMAIL>>
"""
from collections import OrderedDict
import time
import numpy as np
from numpy import inf
from .temisc import mrange
from .temisc import FLHex, OLHex
from .legacy import info, cmdl, cntf
from .legacy import LensSyst... |
import py, os, sys
from pytest import raises
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy
currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("datatypesDict"))
def setup_module(mod):
setup_make("datatypes")
class TestLOWLEVEL:
def setup_class(cls):
imp... |
'''
(explanation as of Sept. 4th, 2019. Code by Ajay)
flags control all parameters of an experiment that are not part of the imaging data itself,
and the preferences for how to analyze the data,
e.g. what kind of data, what kind of calc methods, which filters, etc.
flags are given in a .yml file, that is located in t... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.