text stringlengths 6.04k 39.5k |
|---|
import functools
import kerastuner
import numpy as np
import tensorflow as tf
from tensorflow.python.util import nest
from autokeras.hypermodel import processor
from autokeras.hypermodel import hyper_node
from autokeras.hypermodel import hyper_head
from autokeras import utils
from autokeras import tuner
from autokera... |
# -*- coding: utf-8 -*-
"""
Author: @gabvaztor
StartDate: 04/03/2017
With this class you can import a lot of labeled data like Kaggle problems.
- This class not preprocessed de data reducing noise.
To select the csv reader we have followed the following benchmark:
http://softwarerecs.stackexchange.com/questions/7463... |
#!/usr/bin/python3
import tkinter as tk
from tkinter import ttk
from prettytable import PrettyTable
from prettytable import ALL
import numpy as np
import scipy.linalg as lg
from time import sleep
# Dummy value, real values used cannot be greater than this one
MAXIMAL_COST = 10000000000
# Must be LESS than MAXIMAL_CO... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# intween.py
#
# Forked from https://github.com/PiPeep/PiTweener
# which was based on caurina Tweener: http://code.google.com/p/tweener/
# which was forked from pyTweener: http://wiki.python-ogre.org/index.php/CodeSnippits_pyTweener
#
# Copyright (c) 2017, Refer accompany... |
import gzip
import pickle
import json
import torch
import numpy as np
import os
from os.path import join
from tqdm import tqdm
from numpy.random import shuffle
from envs import DATASET_FOLDER
IGNORE_INDEX = -100
def get_cached_filename(f_type, config):
assert f_type in ['examples', 'features', '... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
# Copyright 1998-2018 by authors (see AUTHORS.txt)
#
# This file is part of LuxCoreRender.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except i... |
#!/usr/bin/env python
"""
Analyze docstrings to detect errors.
If no argument is provided, it does a quick check of docstrings and returns
a csv with all API functions and results of basic checks.
If a function or method is provided in the form "pandas.function",
"pandas.module.class.method", etc. a list of all error... |
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import collections
import itertools
import re
from . import config
from .htmlhelpers import *
from .messages import *
def loadCSSLexer():
from .lexers import CSSLexer
return CSSLexer()
customLexers = {
"css": loadCSSLexer
}
Colored... |
import pandas as pd
import csv
from decimal import Decimal, DecimalException
from pandas import isnull
from dataactcore.models.lookups import FIELD_TYPE_DICT_ID, FIELD_TYPE_DICT
from dataactvalidator.filestreaming.fieldCleaner import FieldCleaner
from dataactvalidator.validation_handlers.validationError import Validat... |
# 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 ... |
# Copyright 2022 StackHPC
#
# 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... |
import random
import platform
if platform.system() == 'Darwin':
import matplotlib
matplotlib.use('MacOSX')
import matplotlib.pyplot as plt
import networkx
import plotly.graph_objects as go
from matplotlib.collections import LineCollection
from plotly import graph_objects
from plotly.offline import iplot, plo... |
from copy import deepcopy
import numpy as np
from numpy.lib.npyio import _savez
from matplotlib.collections import LineCollection
import matplotlib.pyplot as plt
from seispy.trace import Trace, FourierDomainTrace
from seispy.errors import EmptyStreamError, DataTypeError, \
SamplingError, SamplingRateError, NptsErro... |
import time
import numpy as np
from sklearn.preprocessing import OneHotEncoder, MinMaxScaler
from sklearn.gaussian_process import GaussianProcess
from sklearn.linear_model import Ridge, Lasso
from sklearn.svm import NuSVR, SVR
import scipy
from util import Logger, get_rmse
class Linear():
def __init_... |
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import glob
import sys
import matplotlib.pyplot as plt
import pysam
import collections
import numpy as np
import os
OUTPUT_LOG_FILE_NAME = None
HP_TAG = "HP"
UNCLASSIFIED = 'u'
IN_CIS = 'c'
IN_TRANS = 't'
UNKNOWN = 'k'
def parse_args(args =... |
from sklearn.ensemble import RandomForestRegressor
from sklearn.datasets import make_regression
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
import numpy as np, tensorflow as tf
from sklearn.preprocessing import OneHotEncoder
impor... |
"""
Defines the DataRange1D class.
"""
# Major library imports
from math import ceil, floor, log
import six
import six.moves as sm
from numpy import compress, inf, isinf, isnan, ndarray
# Enthought library imports
from traits.api import Bool, CFloat, Enum, Float, Property, Trait, \
... |
# Copyright 2016 Quantopian, 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 agreed to in writ... |
from PyQt5.QtCore import Qt, QSize, QSettings, QCoreApplication, QProcess, pyqtSignal, pyqtSlot
from PyQt5.QtGui import QPalette, QColor, QFont, QFontDatabase, QIcon
from PyQt5.QtWidgets import (QApplication, QWidget, QStackedWidget, QPushButton,
QLineEdit, QTextEdit, QLabel, QListWidget, QHBoxLayout, QVBoxLayout,... |
#!/usr/local/anaconda3/envs/py36 python
# -*- coding: utf-8 -*-
# Plotting
import matplotlib; matplotlib.use('TkAgg')
import matplotlib.pyplot as pl
import seaborn as sns; sns.set_style('ticks')
import matplotlib as mpl
# from matplotlib.ticker import FormatStrFormatter
params = {
'axes.labelsize': 16,
'font.... |
"""Module for correcting PERKEO data."""
import configparser
import copy
import numpy as np
from panter.base.corrBase import CorrBase
from panter.config import conf_path
from panter.config.params import delt_pmt
from panter.config.params import k_pmt_fix
from panter.data.dataHistPerkeo import HistPerkeo
from panter.... |
import ast
import csv
import io
import json
import logging
import os
from datetime import datetime
from typing import Dict, Any
import xmind
from dateutil.parser import parse as parse_datetime_str
from jinja2 import Template
from .checking import SUPPORTED_IDS
from .result import QueryStatus
from .sites import Maigre... |
import argparse
import os
import torch
import torch.nn as nn
import torch.utils.data
import torch.nn.functional as F
import utils.logger as logger
import torch.backends.cudnn as cudnn
# https://forums.developer.nvidia.com/t/onnx-to-tensorrt-conversion-fails/180953/5
# https://github.com/NVIDIA/TensorRT/issues/805
# --... |
# Copyright (c) 2018 charlysan
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute... |
import os.path
import collections
import sys
import re
import time
import pdb
from ..reremi.classRedescription import Redescription
from ..reremi.classData import Data, DataError, ColM
from ..reremi.classQuery import Query, Literal
from ..reremi.toolICList import ICList
from ..reremi.toolICDict import ICDict
from ..... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Mapping reads to reference genome
1. to spike-in genome
2. to repbase
3. to rRNA, tRNA, MT
4. to genome
Note:
1. filtering unique mapped reads
STAR --outFilterMultimapNmax 1
"""
__author__ = "<NAME> <<EMAIL>>"
__copyright__ = "2018 by <NAME> <<EMAIL>>"
__license__ =... |
"""File import/export functions.
"""
import copy
import datetime
import math
import re
from typing import List, Optional, TextIO, Tuple, Union
from xml.etree import ElementTree
from xml.etree.ElementTree import Element
import click
import numpy as np
import svgpathtools as svg
import svgwrite
from svgwrite.extensions ... |
# Copyright 2016, FBPIC contributors
# Authors: <NAME>, <NAME>
# License: 3-Clause-BSD-LBNL
"""
This file is part of the Fourier-Bessel Particle-In-Cell code (FB-PIC)
It defines a set of generic functions that operate on a GPU.
"""
import warnings
import numba
numba_version = (int(numba.__version__.split('.')[0]),
... |
import json
import os
import shutil
from collections import OrderedDict
import geopandas
import pandas
import yaml
from flask import current_app, request
from flask_restplus import Namespace, Resource, abort
from .databases import DATABASE_NAMES, DATABASES, DATABASES_TYPE_MAP, database_to_dict, database_dict_to_file, ... |
#!/usr/bin/env python
# coding=utf-8
"""
Trees for generating.
"""
from __future__ import unicode_literals
from collections import namedtuple, deque
from pytreex.core.node import T
__author__ = "<NAME>"
__date__ = "2014"
class NodeData(namedtuple('NodeData', ['t_lemma', 'formeme'])):
"""This stores the actual... |
__author__ = '<NAME>'
__copyright__ = 'Oregon State University'
__credits__ = ['<NAME>']
__license__ = 'MIT'
__version__ = '0.1.0'
__maintainer__ = ''
__email__ = ''
__status__ = 'Prototype'
import math
import sys
import time
import CachedMethods
from cache_control_helper import CacheControlHelper
import pickledb
impo... |
# /usr/bin/python3
"""
HemiplasyTool
Authors: <NAME>, <NAME>
Indiana University
"""
import argparse
import time
import sys
import os
import logging as log
import subprocess
from heist import hemiplasytool
from heist import seqtools
from Bio import Phylo
from ete3 import Tree
def newick2ms(*args):
parser = argpar... |
from .agent import Agent
from ..network.network import *
from .mcts import *
from ..utils import *
MIN = -99999999
MAX = 99999999
score_5 = 5
score_4_live = 4.5
score_4_and_3_live = 4.3
score_4 = 4
score_double_3_live = 3.8
score_3_live = 3.5
score_3 = 3
score_double_2_live = 3
score_2_live = 2.5
score_2 = 2
class ... |
from __future__ import print_function, division, absolute_import
import numpy as np
from . import models
import multiprocessing as multi
from collections import MutableMapping
from ..plasma import plasma
########################################
# Physical constants, DO NOT OVERWRITE #
#################################... |
import base64
import time
from datetime import datetime
import re
from hashlib import sha256
from struct import unpack
from ua_parser import user_agent_parser
from ip3country import CountryLookup
class _ConfigEvaluation:
def __init__(self, fetch_from_server=False, boolean_value=False, json_value={}, rule_id="", ... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
#!/usr/bin/env python3
import json
import logging
import random
import datetime
from dateutil.parser import parse
import asyncio
import discord
import tbapy
from discord.ext import commands
from orator import Model, DatabaseManager, Schema, SoftDeletes
from orator.orm import has_many, belongs_to
# Set up automatic m... |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... |
# Author: <NAME>, https://users.soe.ucsc.edu/~cicekm/
from .InputEstimatorABC import InputEstimatorABC
from .FaceDetectors import CVFaceDetector
from .LandmarkDetectors import LandmarkDetector
from ...Paths import CV2Res10SSD_frozen_face_model_path
from abc import ABC, abstractmethod
import numpy as np, math
from pyka... |
import matplotlib as mpl
import matplotlib.pyplot as plt
import datetime
import numpy as np
import pandas as pd
import seaborn as sns
import yaml
import math
import os
from skopt.plots import plot_objective
from fbprophet.plot import add_changepoints_to_plot
# Set some matplotlib parameters
mpl.rcParams['figure.figsiz... |
# coding=utf-8
"""SimpleXnat wrappers for the XNAT REST API"""
import abc
import os
import zipfile
import six
from copyxnat.xnat_backend.lazy_list import LazyList
from copyxnat.xnat_backend.utis import Utils
from copyxnat.xnat_backend.xnat_rest_client import XnatRestClient
@six.add_metaclass(abc.ABCMeta)
class Si... |
# Copyright 2012 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 ... |
import errno
import json
import logging
import logging.config
import os
import os.path
import pkgutil
import select
import signal
import socket
import sys
import threading
import time
import six
import voltron
from flask import Flask, Response, make_response, redirect, render_template, request
from werkzeug.serving imp... |
import numpy as np
import scipy
from ._simsig_tools import _check_list,_rand_uniform
from ._generator_base import generator_base
#------------------------------------------------------------------------------------
__all__=['harmonics','Harmonics']
#------------------------------------------------------------------... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %%
# %matplotlib i... |
r"""*Direct expect-good API tests for* ``sphobjinv``.
``sphobjinv`` is a toolkit for manipulation and inspection of
Sphinx |objects.inv| files.
**Author**
<NAME> (<EMAIL>)
**File Created**
20 Mar 2019
**Copyright**
\(c) <NAME> 2016-2021
**Source Repository**
http://www.github.com/bskinn/sphobjinv
... |
import math
import gtk
import gtk.gtkgl
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
C_DEG2RAD = math.pi / 180.0
def drawText(msg):
for c in msg:
glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN, ord(c))
def showMessage(x, y, msg, scale):
glPushMatrix()
glTranslatef( x, y... |
"""
Performing Range Minimum Queries, Range Maximum Queries, Range Sum Queries in O(log(n)) using a prebuilt structure.
Building a full binary tree and using it for Range Minimum Queries, Range Maximum Queries, Range Sum Queries
(A full binary tree is a tree in which every node has either 0 or 2 children.)
The construc... |
#!/usr/bin/env python
#! -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
import argparse
import pprint
import urllib
import re
import os
import pdb
import sys
import codecs
import json
import typotools
import traceback
import subprocess
import shlex
import datetime
from typ... |
#!/usr/bin/env python
from __future__ import division
from numpy import mean, shape, argsort, sort, sum as nsum, delete
from scipy.stats import ttest_1samp
from time import strftime, strptime, struct_time
__author__ = "<NAME>"
__copyright__ = "Copyright 2013, The American Gut Project"
__credits__ = ["<NAME>"]
__licen... |
#!/usr/bin/env python3
#
# Copyright (c) 2021, The OpenThread Authors.
# All rights reserved.
#
# 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
# ... |
import base64
import json
import os
import xml.etree.ElementTree as ET
import pandas as pd
from baseline.eval_utils import validations as validations, general_utils as general_utils
from baseline_VHR.bounding_box import BoundingBox
from enumerators import BBFormat, BBType, CoordinatesType
def _get_annotation_files(f... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, F5 Networks Inc.
# 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
DOCUMENTATION = r'''
---
module: bigip_device_auth_radiu... |
from ..utils import type_from_ast, is_valid_literal_value
from ..error import GraphQLError
from ..type.definition import is_composite_type, is_input_type, is_leaf_type, GraphQLNonNull
from ..language import ast
from ..language.visitor import Visitor, visit
from ..language.printer import print_ast
class ValidationRule... |
#!/usr/bin/env python
import zmq
import math
import numpy as np
from common.params import Params
from common.numpy_fast import interp
import selfdrive.messaging as messaging
from cereal import car
from common.realtime import sec_since_boot
from selfdrive.swaglog import cloudlog
from selfdrive.config import Conversions... |
# coding: utf8
from pycropml.transpiler.codeGenerator import CodeGenerator
from pycropml.transpiler.rules.pythonRules import PythonRules
from pycropml.transpiler.generators.docGenerator import DocGenerator
import os
from pycropml.render_cyml import signature
from path import Path
from pycropml.transpiler.Parser import ... |
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil Authors. 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
#
# Unles... |
"""Class definitions and methods for the AABB and AABBTree."""
import copy
from collections import deque
__all__ = ['AABB', 'AABBTree']
__author__ = 'Kenneth (<NAME>'
class AABB(object): # pylint: disable=useless-object-inheritance
"""Axis-aligned bounding box (AABB)
The AABB is a d-dimensional box.
... |
"""
Functions to perform normal, weighted and robust fitting.
"""
from __future__ import annotations
import inspect
from typing import Callable, Union, Sized, Optional
import warnings
import numpy as np
import pandas as pd
import scipy.optimize
from xdem.spatialstats import nd_binning
from geoutils.spatial_tools imp... |
# Copyright (c) 2016-2018 <NAME>, <NAME>.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
import pyperclip
import random
import time
from collections import... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appli... |
# -*- coding: utf-8 -*-
'''CNN network for captcha recognition of generated captcha images.
References:
- [Multi-digit Number Recognition from Street View Imagery using
Deep Convolutional Neural Networks]()
'''
import os
# os.environ["CUDA_VISIBLE_DEVICES"]="-1"
import re
import datetime
import numpy as np
... |
import os
import sys
from datetime import datetime
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
# local
def add_path(path):
if path not in sys.path:
sys.path.insert(0, path)
add_path(os.path.abspath('..'))
from pycls.al.ActiveLe... |
import copy
import os
import re
import itertools
from functools import partial
import traceback
import sublime
_ST3 = True
from . import utils
from .cache import LocalCache
from ..external.frozendict import frozendict
from .six import strbase
from .tex_directives import get_tex_root
# because we cannot natively pick... |
import numpy as np
import matplotlib.pyplot as plt
from import_explore import import_csv
from import_explore import normalise
# for performing regression
from regression_models import construct_rbf_feature_mapping
# for plotting results
from regression_plot import plot_train_test_errors
# two new functions for cross ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2016 <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 use, ... |
import os
import sys
from typing import List, Tuple
import numpy as np
from pgdrive.scene_creator.lanes.circular_lane import CircularLane
from pgdrive.scene_creator.lanes.lane import LineType
from pgdrive.scene_creator.lanes.straight_lane import StraightLane
from pgdrive.utils import import_pygame
from pgdrive.utils.... |
"""This module handles the data science operations on email lists."""
import io
import os
import json
import asyncio
from collections import OrderedDict
from datetime import datetime, timedelta, timezone
from billiard import current_process # pylint: disable=no-name-in-module
import requests
from requests.exce... |
import os
import logging
import yaml
import json
import random
from base64 import b64decode
from datetime import datetime
from functools import partial, wraps
from tornado.options import options
from tornado.concurrent import run_on_executor
from tornado.gen import coroutine
from tornado.locks import Event
from torna... |
import argparse
import sys
import os
import shutil
import time
import numpy as np
from random import sample
from sklearn import metrics
import torch
from torch.optim.lr_scheduler import MultiStepLR
from torch.utils.tensorboard import SummaryWriter
from deepKNet.data import get_train_valid_test_loader
from deepKNet.mode... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, <NAME>. 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 t... |
"""
Generate features vectors for atoms and bonds
# Source
This code is adapted from:
- https://github.com/HIPS/neural-fingerprint/blob/2e8ef09/neuralfingerprint/features.py
- https://github.com/HIPS/neural-fingerprint/blob/2e8ef09/neuralfingerprint/util.py
- https://github.com/keiserlab/keras-neural-graph... |
import tensorflow as tf
from lib.ops import *
import cv2 as cv
import collections, os, math
import numpy as np
from scipy import signal
# The inference data loader.
# should be a png sequence
def inference_data_loader(FLAGS):
filedir = FLAGS.input_dir_LR
downSP = False
if (FLAGS.input_dir_... |
"""
This module is used in the implementation of ordering of records in Grist. Order is maintained
using floating-point "positions". E.g. inserting a record will normally add a record with position
being the average of its neighbor's positions.
The difficulty is that it's possible (and sometimes easy) to get floats cl... |
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch
import torch.nn.functional as F
from ops.TCP.TCP_module import TCP
from torch.nn.init import orthogonal_
__all__ = ['Res2Net', 'res2net50']
class MEModule(nn.Module):
""" Motion exciation module
:param reduction=1... |
# encoding: utf-8
"""Unit test suite for `cr.cube.stripe.assembler` module."""
import numpy as np
import pytest
from cr.cube.cube import Cube
from cr.cube.dimension import Dimension, _Element, _OrderSpec, _Subtotal
from cr.cube.enums import COLLATION_METHOD as CM
from cr.cube.stripe.assembler import (
StripeAsse... |
# import glob
import numpy as np
import os.path as osp
from PIL import Image
import random
import struct
from torch.utils import data
import scipy.ndimage as ndimage
import cv2
from skimage.measure import block_reduce
import h5py
import scipy.ndimage as ndimage
import torch
from tqdm import tqdm
import torchvision.tra... |
import os, sys, threading
from collections import deque
from random import randint
from flask import Flask, request, render_template, json
from miphy_resources.miphy_instance import MiphyInstance
from miphy_resources.miphy_common import MiphyValidationError, MiphyRuntimeError
from miphy_resources.phylo import PhyloValu... |
# Copyright 2018, The TensorFlow Federated 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 o... |
import uuid
from collections import defaultdict
from typing import Optional
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from django.utils import timezone
from rest_framework.exceptions import ValidationError
from api.audit_trail.enums import AuditType
from api.cases.enu... |
#
# Normalize YAML reports
#
from datetime import datetime
from itertools import groupby
import functools
import hashlib
import logging
import re
import string
import uuid
import yaml
log = logging.getLogger("normalize")
class UnsupportedTestError(Exception):
pass
test_name_mappings = {
"http_host": "ht... |
#!/usr/bin/env python
'''
inStrain - parse command-line arguemnts
'''
__author__ = "<NAME> and <NAME>"
__license__ = "MIT"
__email__ = "<EMAIL>"
__status__ = "Development"
import os
import sys
import argparse
# Get the version
from ._version import __version__
"""
########################################
# Argu... |
from __future__ import division
import os
import numpy as np
from fdint import fdk, ifd1h
from ifg.units_converter import SiAtomicConverter
from ifg.utils import dump_to_csv
THRESHOLD = 1e10
def _1d_call(func, array, *args, **kwargs):
return func(array.reshape(-1), *args, **kwargs).reshape(array.shape)
def ... |
# -*- encoding: utf-8 -*-
#
#
# Copyright (C) 2002-2012 <NAME> <<EMAIL>>
# Copyright (C) 2003-2004 <NAME> <<EMAIL>>
# Copyright (C) 2002-2012 <NAME> <<EMAIL>>
#
# This file is part of PyX (http://pyx.sourceforge.net/).
#
# PyX is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gener... |
""" Implementation of Cosmic RIM estimator"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
physical_devices = tf.config.experimental.list_physical_devices('GPU')
print(physical_devices)
assert len(physical_devices) > 0, "Not enough... |
#!/usr/bin/python3
import datetime
import math
import sys
import pytz
from waveshare_epd import epd7in5b_V2
# import epd7in5
from PIL import Image, ImageDraw, ImageFont
import ical_worker
from config import *
HOUR_OFFSET = 0
#
# URLS = [
# "webcal://calendar.google.com/calendar/u/2?cid=bWtzcXYwcWpiMmhzbXNyNjR... |
from torch._six import container_abcs
from itertools import repeat
import math
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
__all__ = ['InducedNormLinear', 'InducedNormConv2d']
class InducedNormLinear(nn.Module):
def __init__(
self, in_features, out_fea... |
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
HERO for pretraining
copied/modified from HERO
(https://github.com/linjieli222/HERO)
"""
from collections import defaultdict
import random
import torch
from torch import nn
from torch.nn import functional as F
import horovod.torch as hvd
from ... |
""" Code generation for PyTorch C++ dispatched operators. """
import copy
import dataclasses
import itertools
import logging
import operator
import os
from typing import List, Tuple, Callable, Optional, Dict, Union
import dace.library
import numpy as np
import torch
from dace import dtypes as dt, data
from dace.codege... |
import numpy, os
import tensorflow as tf
from phi.tf.util import *
from phi.control.sequences import *
from phi.control.nets.force.forcenets import forcenet2d_3x_16 as forcenet
def ik(initial_density, target_density, trainable=False):
# conv = conv_function("model", "model/smokeik/sim_000301/checkpoint_00014802/... |
"""
COCOPanda :: Trash Panda COCO Data Manipulation
The goal of this package is to convert the COCO dataset into the
Trash Panda YOLO format (nested class directories).
The code in this file is based on:
- The official COCO Python API: pycocotools
- https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pyc... |
# Copyright 2018 IBM 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 in writing, ... |
# Copyright (c) 2011 - 2017, Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
import hashlib
import json
import os
import re
import time
import uuid
from typing import List, Union, Optional
from urllib.parse import urljoin
from zipfile import ZipFile
from requests import Session, get, Response
from requests.adapters import HTTPAdapter
from requests.cookies import cookiejar_from_dict
from urllib... |
################################## Define Some Useful Functions ###############################
import numpy as np
import torch as t
from decimal import *
import scipy
# import sympy
import math
# from pynverse import inversefunc
# import cvxpy as cp
def indicator(K):
# This function is used to ge... |
# -*- coding: utf-8 -*-
""" library to take autodiff and execute a computation graph """
from __future__ import absolute_import
import numpy as np
from .Node import Op
from .. import ndarray
from ..stream import *
from ..logger import Logger
from .._base import get_array_memory
from .Variable import PlaceholderOp
from ... |
import DataClass as dc
import os
import re
import mass_data as md
import ionization as addion
import time
#This function is used to bulk export a range of isotopes in a given A range.
def datExp(option,UI=False,Filter=False):
#This uses the option from the first GUI to get inputs from the correct GUI. S... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
"""Userbot module containing commands related to android"""
import urllib
import re
import rapidjson as json
from bs4... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Test scripts
If we appear to be running from the development directory, use the scripts in
the top-level folder ``scripts``. Otherwise try and get the scripts from the
path
"""
from __future__ import ... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, List, Optional, Type
import cv2
import numpy as np
from gym import spaces
import habitat
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.