text stringlengths 8.04k 46.5k |
|---|
import numpy as np
import time
from utils import flatten, Cost
from ce import ActionExtractor
from rule_miner import FeatureDiscretizer, FrequentRuleMiner
from utils import LimeEstimator
class Node():
def __init__(self, parent, branch=None):
self.parent = parent
self.branch = branch
self.de... |
import context
import os
import copy
import torch
import argparse
import config as cfg
from su2sym.ipeps_su2 import *
from ctm.one_site_c4v.env_c4v import *
from ctm.one_site_c4v import ctmrg_c4v
from ctm.one_site_c4v.rdm_c4v import rdm2x1_sl
from ctm.one_site_c4v import transferops_c4v
from models import j1j2
import t... |
import sys
import torch
from torch.optim import Adam
from adabelief_pytorch import AdaBelief
import math
import gym
import safety_gym
# from safety_gym.envs.engine import Engine
from utils import *
from ppo_algos import *
from agent_types import *
import pickle
import wandb
import numpy as np
from utils import *
... |
#
# Copyright 2016 the original author or 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 law or... |
import urdfpy
import math
import numpy as np
import os
import torch
import random
import xml.etree.ElementTree as ET
import dflex as df
def set_np_formatting():
np.set_printoptions(edgeitems=30, infstr='inf',
linewidth=4000, nanstr='nan', precision=2,
suppress=Fa... |
from waflib.TaskGen import feature
from waflib.Configure import conf
from waflib import Context, TaskGen, Build
import os, sys, random, time
from xml.dom.minidom import Document
x = 2000
y = 10500999
def new_xcode_id():
global x, y
y = y + 1
return "%04X%04X%04X%012d" % (0, x, 0, y)
class XmlNode:
... |
#!/usr/local/lib/mailinabox/env/bin/python
# Utilities for installing and selecting SSL certificates.
import os, os.path, re, shutil, subprocess, tempfile
from utils import shell, safe_domain_name, sort_domains
import idna
# SELECTING SSL CERTIFICATES FOR USE IN WEB
def get_ssl_certificates(env):
# Scan all of the... |
import random
import argparse
from time import gmtime
from typing import Union, Tuple
import numpy as np
import pandas as pd
import csv
import sys
import os
# os.environ['CUDA_VISIBLE_DEVICES'] = '6'
import __init__
from utils.dataloader import DataLoader
import torch
import torch.nn as nn
import torch.nn.functional as... |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
import collections
import math
import numbers
import random
import cv2
import numpy as np
import torch
from PIL import Image, ImageEnhance
try:
import accimage
except ImportError:
accimage = None
MEAN_STATISTICS = {
'imagenet': [0.485, 0.456, 0.406],
'kinetics': [0.434, 0.405, 0.378],
'activityne... |
# -*- coding: utf-8 -*-
"""
The core of the Microdata->RDF conversion, a more or less verbatim implementation of the
U{W3C IG Note<http://www.w3.org/TR/microdata-rdf/>}. Because the implementation was also used to check
the note itself, it tries to be fairly close to the text.
@organization: U{World Wide Web Consort... |
from . import H5Gizmos
#from . import gz_resources
from aiohttp import web
#import aiohttp
import asyncio
#import weakref
import mimetypes
import os
import sys
import contextlib
# Max size for posts -- really big
DEFAULT_MAX_SIZE = 1000 * 1000 * 1000 * 1000 * 100
PROCESS_SHARED_GIZMO_SERVER = None
def get_or_creat... |
"""
CBMA methods from the activation likelihood estimation (ALE) family
"""
import os
import logging
import multiprocessing as mp
import nibabel as nib
import numpy as np
import pandas as pd
from scipy import ndimage
from tqdm.auto import tqdm
from .. import references
from ..base import CBMAEstimator, PairwiseCBMAEs... |
from abc import ABC, abstractmethod
from enum import Enum, unique
import math
import numpy as np
from PyQt5 import QtCore, QtGui, QtWidgets
from sscanss.core.math import Vector3, clamp
class GraphicsView(QtWidgets.QGraphicsView):
"""Provides container for graphics scene
:param scene: scene
:type scene: G... |
# Copyright 2022 Sony Semiconductors Israel, 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 b... |
"""
This script contains functions to create the necessary inputs used by
the software erzsol3. It also contains functions to convert erzsol3s binary
outputs to and hdf5 database.
Contains the following functions:
model2Erzsol3mod: Generate erzsol model
write2dst: Write .dst file (range & ... |
from abc import abstractmethod, ABC
import inspect
from iminuit import Minuit
from scipy.optimize import minimize
from scipy.interpolate import interp1d
import numpy as np
import matplotlib.pyplot as plt
from copy import copy
import astropy.units as u
from ctapipe.reco.reco_algorithms import Reconstructor
from lstcha... |
import os, sys
sys.path.append(os.path.dirname(__file__))
from common import *
from dataset.reader import *
from net.layer.box.process import *
def check_valid(proposal, width, height):
num_proposal = len(proposal)
keep=[]
for n in range(num_proposal):
b,x0,y0,x1,y1,score,label,aux = proposal[n... |
#!/usr/bin/env python3
# run_coursemap.py
#
# script for running course map in 3D.
# plotting 3D course from .fit or .gpx file
#
# usage: run_coursemap.py data.fit
#
# <NAME>, Tsukimidai Communications Syndicate 2021
# Version 0.14 14-March-2021
# Copyright (c) 2021 <NAME>
# Released under the MIT license
# https... |
import argparse
import collections
import os
import re
import time
from collections import OrderedDict
from distutils.util import strtobool
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats
import sklearn.metrics as metrics
import torch
import torch.nn as nn
import torchvision
from torch._six impor... |
'''The Hivemind'''
import queue
import time
import numpy as np
from rlbot.botmanager.agent_metadata import AgentMetadata
from rlbot.botmanager.bot_helper_process import BotHelperProcess
from rlbot.utils.logging_utils import get_logger
from rlbot.utils.structures.bot_input_struct import PlayerInput
from rlbot.utils.st... |
import numba
import torch
import numpy as np
from torch import nn
import torchvision
from math import sqrt as sqrt
from utils import *
import time
from scipy import stats as stats
from torch.nn import functional as F
""" 使用numba将python函数编译为机器代码加速计算 """
@numba.jit(nopython=True)
def make_input_tensor(input_tensor, new_... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy import stats,integrate
import matplotlib.pyplot as plt
from datetime import datetime
import logging # error reporting
import calc as cl
def example_2x2_vfe(savefig=False):
"""
savefig: (boolean) save the figure to an external PNG file
... |
"""
Main tool.
"""
import collections
import json
import shlex
from io import StringIO
from shells_kitchen import (
Interpreter, argument, command, group, topic,
filter_completion,
QUIT, IGNORE, HISTORY,
)
from .. import VERSION
from ..config import (
default_config,
get_rl_history_filename,
... |
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
import xml.etree.ElementTree as ET
from base64 import b64encode
from datetime import datetime, timedelta
from functools import partial
from os import environ, path
from sys import modules
import matplotlib.pyplot as plt
import numpy as np
im... |
#!/usr/bin/env python
'''
C++ code generation for Modified Denavit-Hartenberg parameters and URDF files
python dh_code.py file.yml (from yaml file)
python dh_code.py file.urdf base effector (from URDF file)
author: <NAME>, ICube Laboratory
'''
import yaml
from lxml import etree
import sys, os
import sympy
from sy... |
from helpers.preprocess import enrich_graph_with_numeric_features, enrich_graph_with_onehot_features, enrich_graph_with_str_features, enrich_graph_with_str_arr_features
from pathlib import Path
import pandas as pd
import numpy as np
import torch
import dgl
from dgl.data.utils import save_graphs
onet_out_file = Path(_... |
import pygame
import time
import random
import math
pygame.init()
pygame.mixer.music.load("beat1814.wav")
display_width = 800
display_height = 600
black = (0, 0, 0)
white = (255, 255, 255)
bluespace = (14, 31, 191)
red = (200, 0, 0)
bright_red = (255, 0, 0)
redtext = (181, 16, 11)
redtextbutton = (161, 16, 11)
lime... |
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import math
import copy
import functools
from collections import OrderedDict
import veriloggen.core.vtypes as vtypes
from veriloggen.core.module import Module
from veriloggen.seq.seq import Seq
from . import visitor
fro... |
import argparse
import json
import os
import sys
from copy import deepcopy
from datetime import datetime
from re import I
from typing import Any, Dict
import regex as re
from sentsplit.config import en_config
from sentsplit.segment import SentSplit
import streamlit as st
from annotated_text import annotated_text
INT... |
import calendar
import json
import logging
import mimetypes
import pathlib
import shutil
import tempfile
import time
from collections import OrderedDict
from contextlib import contextmanager
from contextlib import nullcontext
from dataclasses import dataclass
from datetime import datetime
from datetime import timezone
... |
# merge counts files into a data table, combine reads from multiple sequencing runs,
# filter by read counts, generate phenotype scores, average replicates
import pandas as pd
import os
import sys
import numpy as np
import scipy as sp
from scipy import stats
import fnmatch
import argparse
from expt_config_parser imp... |
#
#
# Title: translation_strings_tool.py
# Updated: 20-04-2018
# Version: v2.0.1
# Author: bRiggin
#
#
#
# imports
#
import openpyxl
import logging
import argparse
import sys
import os
import traceback
import math
import xml.etree.ElementTree as elementTree
import xml.dom.minidom as minidom
fro... |
# -*- coding: utf-8 -*-
"""
tools
=====
Functions that USERS will possibly want access to.
"""
from __future__ import absolute_import
import json
import warnings
import six
import re
import os
from plotly import exceptions, optional_imports
from plotly.files import PLOTLY_DIR
DEFAULT_PLOTLY_COLORS = [
"rgb(3... |
#!/usr/bin/env python
'''Build/run ubxlib for STM32Cube IDE and report results.'''
import os
from time import sleep, time
from multiprocessing import Process # To launch swo_decoder.py
from xml.etree import ElementTree
import socket
import subprocess
import u_monitor
import u_connection
import u_report
import u_uti... |
import numpy as np
from landlab import Component
_VALID_METHODS = set(["Grid"])
def assert_method_is_valid(method):
if method not in _VALID_METHODS:
raise ValueError("%s: Invalid method name" % method)
class Vegetation(Component):
"""Landlab component that simulates net primary productivity, bioma... |
import multiprocessing
import os
import random
import shlex
import shutil
import threading
import time
import traceback
import json
import re
from urllib.parse import urlparse
from botocore.exceptions import ClientError
import boto3
import requests
from idseq_dag.engine.pipeline_step import PipelineStep
from idseq_da... |
import re
import requests
import json
import utils.sentry as sentry
from django.db import transaction, IntegrityError
from django.http import QueryDict
from django.db.models import Sum
import rest_framework.serializers as serializers
from bullet_point.serializers import BulletPointTextOnlySerializer
from discussion.... |
"""Pipeline nodes for transforming match data."""
from typing import List, Tuple
from functools import partial, reduce, update_wrapper
import math
import re
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder
from mypy_extensions import TypedDict
from augury.settings import (
FO... |
"""
Several webhooks servers & tunnels supported out of the box.
"""
import asyncio
import base64
import contextlib
import functools
import ipaddress
import json
import logging
import os
import pathlib
import socket
import ssl
import tempfile
import urllib.parse
from typing import TYPE_CHECKING, AsyncIterator, Collecti... |
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from escher.quick_server import serve_and_open
from escher.urls import get_url, root_directory
from escher.appdirs import user_cache_dir
from escher.generate_index import generate_index
from escher.version import __schema_version__, __map... |
import json
import netaddr
import re
import requests
import rrdtool
import time
import whisper
from django.contrib.auth.models import User
from pysnmp.hlapi import (
getCmd, nextCmd,
CommunityData, ContextData,
ObjectIdentity, ObjectType,
SnmpEngine,
UdpTransportTarget,
)
from secrets.models impo... |
from collections import defaultdict
import logging
import time
from typing import (
Dict, List, Set, Tuple
)
from django.db import models
from django.conf import settings
from django.db.models import Max, Q
from django.db.models import ObjectDoesNotExist
LOGGER = logging.getLogger(__name__)
class ArticleDetail... |
# coding: utf-8
"""
Mixin classes providing common functionality.
"""
__all__ = [
"CopyMixin", "AuxDataMixin", "TagMixin", "DataSourceMixin", "SelectionMixin", "LabelMixin",
"ColorMixin", "CopySpec",
]
import re
import copy
import collections
import six
from order.util import (
ROOT_DEFAULT, typed, m... |
##############################################################################
# pymbar: A Python Library for MBAR
#
# Copyright 2016-2017 University of Colorado Boulder
# Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center
# Portions of this software are Copyright 2010-2016 University of Virginia
#
# Authors: <... |
"""Generates simulated data and model to test mihifepe algorithm"""
import argparse
from collections import namedtuple
import csv
import functools
import itertools
import os
import pickle
import sys
from unittest.mock import patch
import anytree
from anytree.importer import JsonImporter
import h5py
import numpy as np... |
class LanguagePackEN:
Menu = {}
Menu['File'] = "File"
Menu['Load'] = "Load - Ctrl+L"
Menu['Save'] = "Save - Ctrl+S"
Menu['LoadDictionary'] = "Load Dictionary"
Menu['LoadException'] = "Load Exception"
Menu['LoadTM'] = "Load TM"
Menu['CreateTM'] = "Create TM"
Menu['Exit'] = "Exit"
Menu['Help'] = "Help"
Menu... |
import os
import argparse
import shutil
import torch
import torch.nn as nn
import torchvision
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
from numpy import linalg as LA
import math
import sys
import datetime
np.set_printoptions(threshold=sys.maxsize)
from lib import Constant
from li... |
import argparse
import sys
import codecs
import re
from pathlib import Path
import keras
from keras.models import *
from keras.layers import *
from keras import *
from utils import *
import os
import numpy
import json
from keras.applications.vgg16 import VGG16
def unescaped_str(arg_str):
return codecs.decode(str(... |
import torch
import torch.nn as nn
from torch.autograd import Function
import torch.nn.functional as F
import copy
import math
from centroid import Centroid
from itertools import permutations
from itertools import combinations
# definition of Gradient Reversal Layer
class GradRevLayer(Function):
@staticmethod
... |
import math, scipy, cvxpy, pprint, itertools, string
import numpy as np
from scipy import spatial
# from fillplots import plot_regions
from mpl_toolkits import mplot3d
from plot_utils import *
from conf_gen import *
from log_utils import *
from popularity import *
# ######################################## ConfInsp... |
# Copyright (c) 2014 Red Hat, 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 require... |
import copy
import json
import os
import warnings
from dataclasses import dataclass
from typing import Optional, Union
import numpy as np
import tiledb
from tiledb import TileDBError, libtiledb
def check_dataframe_deps():
pd_error = """Pandas version >= 1.0 required for dataframe functionality.
... |
from loguru import logger
from lxml.html.clean import Cleaner
import sys
import requests
import time
import os
from dputils.utils import timezone_timestamp, month_aware_time_stamp
from errors_module.errors import APIBadRequest, DuplicateEntryError
import pytz
from asyncinit import asyncinit
import time
import hashlib
... |
"""Example Gym environment for the RRC 2021 Phase 2."""
import enum
import typing
import gym
import numpy as np
import time
import robot_fingers
import rrc_example_package.trifinger_simulation.python.trifinger_simulation as trifinger_simulation
import rrc_example_package.trifinger_simulation.python.trifinger_simulati... |
#!/usr/bin/env python3
"""Where library module including functions for GNSS modeling
Example:
--------
from where.lib import gnss
...
Description:
------------
This module will provide functions for GNSS modeling.
TODO: How to move routines to Midgard?
========================================
check_satell... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import PySpin
import scipy.misc as misc
import numpy as np
import rw_config as cfg
from multiprocessing import Queue
#from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
#from matplotlib.figure import Figure
def PIL2ar... |
from pythreader import TaskQueue, Task, DEQueue, PyThread, synchronized, ShellCommand
import re, json, os, os.path, traceback
import subprocess, time
from part import PartitionedList
from py3 import to_str
from stats import Stats
Version = "2.0"
GB = 1024*1024*1024
try:
import tqdm
Use_tqdm = True
except:
... |
from django.db import transaction
from django.shortcuts import render
from django.http import JsonResponse
from django.core import serializers
from django.utils import timezone
from basic.models import Competition, Group, CStage, GStage, ReviewMeta, Notice, Vote
from useraction.models import User
from match.models impo... |
# Copyright (c) 2018, <NAME>
import csv
from absl import app, flags
from matplotlib.patches import Patch
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from utils import plot_box_and_whiskers, plot_cdf, plot_timeline, generate_tic... |
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import scipy
import torch
import torch.nn as nn
from mmgen.models.builder import MODULES
from mmgen.ops import bias_act, conv2d_gradfix, filtered_lrelu
def modulated_conv2d(
x,
w,
s,
demodulate=True,
padding=0,
input_gain=None... |
from imutils import paths
from sklearn.model_selection import train_test_split
from datetime import datetime
from object_detection.dataset_tools import tf_record_creation_util
from object_detection.utils import dataset_util
import os
import shutil
import hashlib
import io
import logging
import contextlib2
import numpy ... |
import numpy as np
from lifelines.utils import concordance_index
import pandas as pd
import pickle
import sys, os, warnings
import pandas as pd
from scipy import stats
from sklearn.preprocessing import OneHotEncoder
def make_censored_oh(Y, C, K):
"""
Helper function that zeros out Y (after it has been digi... |
import subprocess
import random
import re
import numpy as np
import logging
from offsetbasedgraph import Block, Position,\
DirectedInterval, GraphWithReversals
from offsetbasedgraph.interval import IntervalCollection
from graph_peak_caller import CallPeaks, ExperimentInfo, Configuration
from graph_peak_caller.lega... |
###############################################################################
# Copyright 2015-2020 University of Florida. All rights reserved.
# This file is part of UF CTS-IT's NACCulator project.
# Use of this source code is governed by the license found in the LICENSE file.
#######################################... |
import argparse
import codecs
import json
import logging
import os
import time
from typing import Optional, Mapping, Iterable, Dict, Union
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from sklearn.model_selection import KFold
from common import ControllerBase, NeuralCoreferencePai... |
__author__ = 'max'
import numpy as np
import theano
from alphabet import Alphabet
from lasagne_nlp.utils import utils as utils
root_symbol = "##ROOT##"
root_label = "<ROOT>"
word_end = "##WE##"
MAX_LENGTH = 130
MAX_CHAR_LENGTH = 45
logger = utils.get_logger("LoadData")
def read_conll_sequence_labeling(path, word_a... |
# (c) 2019 by Authors
# This file is a part of centroFlye program.
# Released under the BSD license (see LICENSE file)
from collections import defaultdict, Counter
from itertools import groupby
import os
import subprocess
import statistics
import networkx as nx
import numpy as np
from utils.bio import read_bio_seq, ... |
# -*- coding: utf-8 -*-
import copy
import numpy as np
import tensorflow as tf
from gntp.base import ProofState, NTPParams
from gntp.indices import SymbolIndices
from gntp.util import is_variable, is_tensor
from gntp.tfutil import tile_left, tile_right
from gntp.util import tile_left_np
from typing import List, Op... |
# Copyright 2017 NREL
# 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, software distribu... |
# Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright... |
# coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# 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 th... |
import torch
import qelos_core as q
from torch import nn
import numpy as np
import re
import math
EPS = 1e-6
class Penalty(torch.nn.Module):
""" Reference implementation only, doesn't take into account ignoremasks or other masks.
To use penalties, must do gather_penalties() first and enable penalties
... |
#!/usr/bin/python
#
# This file is part of Mitsuba, a physically based rendering system.
#
# Copyright (c) 2007-2014 by <NAME> and others.
#
# Mitsuba is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 3
# as published by the Free Software Foundation.
... |
r"""
Elements of bounded height in number fields
Sage functions to list all elements of a given number field with height less
than a specified bound.
AUTHORS:
- <NAME> (2013): initial version
- <NAME> (2013): initial version
- TJ Combs (2018): added Doyle-Krumm algorithm - 4
- <NAME> (2018): added Doyle-Krumm alg... |
import discord
from discord.ext import commands
from discord.ext.commands import TextChannelConverter
from contextlib import redirect_stdout
from ext.utility import load_json
from urllib.parse import quote as uriquote
from mtranslate import translate
from lxml import etree
from ext import fuzzy
from ext import embedtob... |
#!/bin/python
# Take GWAS summary statistics file -->
# 1) run plink clump
# 2) bin all gwas variants by different levels of LD
#
#
# DEPENDENCIES
# 1) check whether the p-value in gwas input file is in scientific e notation only!
#
#
#
#
# <NAME>
# created on: 2018-08-26 15:14:16
# mo... |
"""
Author: <NAME> <<EMAIL>>
Date: 2019-06-22
Function: Encapsulates RESTful API logic.
"""
import random
import requests
from requests.exceptions import HTTPError
from urllib.parse import urlencode
import numpy as np
import pandas as pd
from io import StringIO
from .common import (
halt,
... |
#!/usr/bin/env python3
import argparse
import os
import serial
import serial.tools.list_ports
import struct
import sys
import threading
import time
from collections import deque
from datetime import datetime
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
# Victron packages
sys.path.insert(... |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 1 15:12:20 2015
@author: МакаровАС
"""
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import QAbstractItemModel, QModelIndex, QSize, QRect, Qt, QPoint
from PyQt4.QtGui import QStyleOptionHeader, QHeaderView, QPainter, QWidget, QStyle, QMatrix, QFont, QFontMetrics, QPa... |
import torch
import torch.nn as nn
import pytorch_lightning as pl
import hydra
import random
import wandb
import math
from urllib.parse import urlparse
from typing import List, Dict, Tuple, Optional
from omegaconf import DictConfig, OmegaConf
from hydra.utils import instantiate, to_absolute_path
from pytorch_lightning... |
import json
import unittest
from datetime import datetime,timedelta
from mock import patch
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test.client import Client, RequestFactory
from django.utils.translation import ugettext as _
from wouso.core.qpool.models import... |
# Copyright 2021-2022 The Kubeflow 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 law or agreed ... |
##
# Many of my features are taken from or inspired by public kernels. The
# following is a probably incomplete list of these kernels:
# - https://www.kaggle.com/ggeo79/j-coupling-lightbgm-gpu-dihedral-angle for
# the idea to use dihedral angles on 3J couplings.
# - https://www.kaggle.com/titericz/giba-r-data-tab... |
from alerts.messages import ErrorFieldRequiredMessage, ErrorFieldTooLong, NHS_NUMBER_ERROR, INVALID_DATE, \
DEATH_IS_NOT_AFTER_BIRTH, api_error_messages, DEATH_DATE_MISSING_WHEN_TIME_GIVEN, NO_GENDER, DOB_IN_FUTURE, \
DOD_IN_FUTURE, ME_OFFICE
from medexCms.api import enums
from medexCms.utils import NONE_DATE, ... |
from datetime import datetime
import numpy as np
import numpy.testing as npt
import pandas as pd
import pytest
from plotnine import ggplot, aes, geom_point, expand_limits, theme
from plotnine import geom_col, geom_bar, lims, element_text, annotate
from plotnine.scales import scale_color, scale_color_manual
from plotn... |
"""
Train a CP3D model.
"""
import os
import argparse
import json
import sys
import copy
import pickle
import torch
from torch.utils.data import DataLoader
from torch.optim import Adam
from nff.data import Dataset, split_train_validation_test, collate_dicts
from nff.data.loader import ImbalancedDatasetSampler
from nf... |
# -*- coding: utf-8 -*-
from enum import Enum, unique
from operator import attrgetter
from functools import lru_cache
from glob import glob
from itertools import islice, product, chain, combinations
from pathlib import Path
import numpy as np
from spglib import (
get_error_message,
get_spacegroup_type,
get... |
import copy
import datetime
import logging
from .config import config
from .fetch.federal_holidays import FederalHolidays
from .fetch.fixed_feasts import FixedFeasts
from .fetch.floating_feasts import FloatingFeasts
from .fetch.moveable_feasts import MoveableFeasts
from .season import YearIterator
from .static import ... |
# -*- coding:iso-8859-1 -*-
"""
This module offers a generic date/time string parser which is able to parse
most known formats to represent a date and/or time.
"""
from __future__ import unicode_literals
import datetime
import string
import time
import collections
from io import StringIO
from six import text_type, bi... |
#!/usr/bin/env python
import json
import multiprocessing
import os
import random
import threading
import webbrowser
# third-party imports
import tornado.ioloop
import tornado.web
import tornado.websocket
import tornado.httpclient
import tornado.gen
# local imports
import settings
import LikedSavedDatabase
from downl... |
import os
import shutil
import rawpy
import random
from PIL import Image
import tifffile as tiff
import zipfile
import numpy as np
import pandas as pd
from torch.utils.data import Dataset, DataLoader, TensorDataset
from sklearn.model_selection import StratifiedShuffleSplit
if not os.path.exists('README.md'): # set ... |
# https://github.com/Josef-Friedrich/send_nsca/commit/f2a1ba12f923cb820457a8c9c8bd3415c8358966
"""
send_nsca.py: A replacement for the C-based send_nsca, able
to be run in pure-python. Depends on PyCrypto and Python >= 2.6.
Heavily inspired by (and protocol-compatible with) the original send_nsca,
written by <NAME> <<... |
import numpy as np
import rlkit.torch.pytorch_util as ptu
import torch
from gym import spaces
import matplotlib
matplotlib.use('Agg')
# import utils
class Relabeler(object):
def __init__(self,
discount=0.99,
relabel=True,
use_adv=False,
cache=Fal... |
import matplotlib
matplotlib.use('Agg')
import pylab as plt
import os
from scipy.ndimage.morphology import *
from scipy.ndimage.measurements import *
from scipy.ndimage.filters import *
from scipy.interpolate import RectBivariateSpline
import fitsio
from astrometry.util.fits import *
from astrometry.util.plotutils i... |
##############################################################################
#
# Copyright (c) 2009 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
# vim: set fileencoding=utf-8 :
# Mon 23 May 2011 14:36:14 CEST
import numpy
import warnings
def log_values(min_step=-4, counts_per_step=4):
"""Computes log-scaled values between :math:`10^{M}` and 1
This function computes log-scaled values between :math:`10^{M}` and 1
(including), where ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 28 16:13:36 2019
This script is used for reading video frames with temporal information
The input frames are loaded with a stride, i.e.,
if there are 6 input frames with a stride 2, then the input frames indices will be
0, 2, 4, 6, 8, 10. The output ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 25 16:43:20 2018
version: v0.5
p.s: 1. 用之前修改一下停用词库stopwords的文本路径
2. 用之前修改一下中文wordnet数据库zh_wordnet的文本路径
3. 用之前修改一下标签词集label_dict的文本路径
bug: 1. similarity出现了负数
2. cut大文件的时候好像会让电脑崩溃,不知道是我的电脑问题还是怎么样。
@author: HP
"""
import os
import jieba
import logging
... |
import ctypes
import json
import os
import pathlib
import re
import transcribedit.PySimpleGUIQt as sg
import transcribedit.manage_token as mt
from transcribedit.set_settings import set_settings
import transcribedit.tokenize_text as tt
def get_settings(main_dir: str):
try:
with open(f'{main_dir}/resources/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.