text stringlengths 3.07k 22.1k |
|---|
# pylint: disable=no-self-use
import re
import pytest
from .test_treegroup import TestTreeGroup
@pytest.fixture(scope="function")
@pytest.mark.usefixtures("dbsession", "transact")
def theme_test_data(dbsession, transact):
del transact
from c2cgeoportal_commons.models.main import (
Functionality,
... |
"""
Run ETL routines
"""
import click
import logging
from math import ceil
from typing import Any, Optional
from id3c.db.session import DatabaseSession
from id3c.db.datatypes import Json
from id3c.cli import cli
from id3c.db.types import MinimalSampleRecord
LOG = logging.getLogger(__name__)
@cli.group("etl", help =... |
################################################################################
# Copyright (c) 2020, National Research Foundation (SARAO)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http... |
import logging
import multiprocessing
import numpy as np
import traceback
from jiminy.gym import spec
from jiminy.gym import spaces
from jiminy.vectorized import core
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
class Error(Exception):
pass
def display_name(exception):
prefix = ''
... |
import re
from numpy import array, clip, dot, float32
from numpy.linalg import inv
from vispy.app import Canvas, run, Timer, use_app
from vispy.gloo import Program
from vispy.visuals import LinePlotVisual, TextVisual
from functions import functions
from newton_method import newton_method
def unpack_double(double):
... |
#!/usr/bin/env python3
import pystan
import numpy as np
import json
import requests
import pandas as pd
import matplotlib.pyplot as plt
config = []
r=requests.get("https://covidtracking.com/api/states/daily")
state_data = pd.DataFrame(r.json())
def load_config(file,data):
"""
This loads a config file for a ... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2014 <NAME>
#
# This file is part of py-zabbix.
#
# Py-zabbix 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) an... |
#*****************************************************************************#
#* Copyright (c) 2004-2008, SRI International. *#
#* All rights reserved. *#
#* ... |
# galaxy.py
# <NAME> (<EMAIL>)
"""Define the Galaxy_Model class"""
__all__ = ['CustomGalaxy', 'SSPSimple', 'TauSimple',
'NonParamSimple', 'TauFull', 'NonParamFull']
import numpy as np
from ..sampling import priors
from .metalmodels import (BaseMetalModel, get_metal_model)
from .sfhmodels import (BaseSFHMo... |
import numpy as np
import random
import matplotlib.pyplot as plt
import os
import pickle
import json
import sys
import time
import seaborn as sns
from scipy import stats
sys.path.append("..")
from utils import core_gene_utils, diversity_utils, HGT_utils
import config
'''
Need to know the cutoffs for same clade snp... |
import random
import torch
import numpy as np
import scipy
import pygsp
import graph_utils
import graph_construction
import normalization
import matplotlib.pyplot as plt
def nearest_mean_classifier(train_set, train_labels, test_set, test_labels):
# Compute the means of the feature vectors of the same classes
n... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import copy
import six
import numpy as np
from numpy.testing import assert_array_equal
from matplotlib.path import Path
from matplotlib.patches import Polygon
from nose.tools import assert_raises, assert_equ... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from typing import Dict, List, NamedTuple, Optional
import torch
import torch.nn as nn
from fairseq.data.dictionary import Dictionary
from pytext.common.constants import SpecialTokens, Token
from pytext.data.bert_tensorizer ... |
import argparse
import os
import sys
import time
import logging
import numpy as np
from pathlib import Path
import csv
__dir__ = os.path.dirname(os.path.abspath(__file__))
sys.path.append(__dir__)
sys.path.append(os.path.abspath(os.path.join(__dir__, '..')))
import paddle
import paddle.inference as paddle_infer
from ... |
"""
Functions to extract information from local data.
"""
import pathlib
import re
from typing import Union
import fiona
import geopandas as gpd
import numpy as np
import pandas as pd
def _extract_year(x: Union[str, pathlib.Path]) -> int:
"""
Extracts a four-digit valid year (1900-2099) from a string or path... |
import logging
import re
from collections import namedtuple
from temboardagent.spc import pg_escape, error
from temboardagent.errors import HTTPError, NotificationError
from temboardagent.tools import validate_parameters
from temboardagent.notification import NotificationMgmt, Notification
from .types import (
T_P... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
from cassandra_storage.cassandra_util import *
import json
import sys
import time
import datetime
import operator
import posixpath
import pysolr
from users.middleware import remove_file_upload, save_file_upload
from django.conf import settings
from celery.execute import send_task
SOLR_URL = getattr(settings, 'SOLR_REA... |
import os
import sys
from typing import List, Any
sys.path.append(os.getcwd())
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from restools.timeintegration_builders import get_ti_builder
from restools.flow_stats import Ensemble, BadEnsemble
from restools.plotting import label... |
import numpy as np
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
from scipy.stats import kurtosis
from sklearn.svm import LinearSVC
from sklearn.feature_selection import SelectFromModel, VarianceThreshold, SelectKBest
from sklearn.preprocessing import StandardScaler, RobustScaler, QuantileTra... |
"""Plugin to provide accurate types for some parts of the ctypes module."""
from typing import List, Optional
# Fully qualified instead of "from mypy.plugin import ..." to avoid circular import problems.
import mypy.plugin
from mypy import nodes
from mypy.maptype import map_instance_to_supertype
from mypy.messages im... |
""" CS4277/CS5477 Lab 2: Camera Calibration.
See accompanying Jupyter notebook (lab2.ipynb) for instructions.
Name: <NAME>
Email: <EMAIL>
Student ID: A0215003A
"""
import cv2
import numpy as np
from scipy.optimize import least_squares
"""Helper functions: You should not have to touch the following functions.
"""
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
# The MIT License
# Copyright (c) 2017 - 2018 <NAME>, <EMAIL>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"... |
"""
Clocks for the simulator.
"""
__docformat__ = "restructuredtext en"
import numpy as np
from brian2.utils.logger import get_logger
from brian2.core.names import Nameable
from brian2.core.variables import Variables
from brian2.groups.group import VariableOwner
from brian2.units.fundamentalunits import check_units,... |
"""Provides data for models of prediction phenotype from genotype."""
from microbepy.common import constants as cn
from microbepy.common import util
from microbepy.common.isolate import Isolate
from microbepy.common.study_context import StudyContext
from microbepy.data import util_data as ud
from microbepy.data.predi... |
import errno
import gc
import micropython
import urequests
from uhashlib import sha256
from ubinascii import hexlify
from configuration import Configuration
class Authorization ():
def __init__(self, config=Configuration(), status_led=None):
self.led = status_led
self.config = config
sel... |
import argparse
import math
import time
import torch
import torch.nn as nn
from net import gtnet
import numpy as np
import importlib
from util import *
from trainer import Optim
def evaluate(data, X, Y, model, evaluateL2, evaluateL1, batch_size):
model.eval()
total_loss = 0
total_loss_l1 = 0
n_sampl... |
import os
import glob
import numpy as np
import math
import _pickle as cPickle
pred_data = "eval_results/TEST_"
pred_list = [1] # eval_id list, if you want to test the mean score of TEST_1 and TEST_2, change to [1,2]
data_dir = "My_NOCS"
synset_names = ['BG',
'bottle',
'bowl',
... |
"""
Copyright (c) 2022 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 agreed to in writin... |
import os
import sys
import csv
import logging
import datetime
import configparser
from py_jama_rest_client.client import JamaClient
from py_jama_rest_client.client import APIException
logger = logging.getLogger(__name__)
# maintain a global unique item id map so that we dont redo any redundant API calls.
unique_ite... |
#!/usr/bin/env python3
"""
logistic regression
"""
import numpy as np
from loguru import logger
from scipy.optimize import minimize
from sklearn.utils.extmath import safe_sparse_dot
from scipy.special import logsumexp
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import LabelEncoder, LabelBinar... |
import cv2
import random
import numpy as np
from scipy.stats import pearsonr, spearmanr, kendalltau, zscore
from dnnbrain.dnn.core import Mask
def get_frame_time_info(vid_file, original_onset, interval=1, before_vid=0, after_vid=0):
"""
Extract frames of interest from a video with their onsets and durations,... |
# WWII Pacific Front - main.py
# (C) 2021 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
'''
This module is the entry point for the game client.
'''
#this program should run a single-player battleship game against the computer
#needs to be tested with other modules to debug
import random
from .gamemodels import Ship
# TODO:... |
"""
Copyright 2018 Amazon.com, Inc. and its affiliates. All Rights Reserved.
Licensed under the MIT License. See the LICENSE accompanying this file
for the specific language governing permissions and limitations under
the License.
"""
import os
import json
import hmac, base64, hashlib, re
import bo... |
"""
Legalese
--------
Copyright (c) 2015, 2016 Genome Research Ltd.
Author: <NAME> <<EMAIL>>
This file is part of HGI's common Python library
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; ... |
import os
import sys
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from torch.utils.data import Dataset
from sklearn.model_selection import train_test_split
import torch
def get_data_into_loaders(data_x, data_y, batch_size, DataSetClass, rand_... |
"""
Compute the colexification graph
"""
import csv
from collections import defaultdict
import networkx as nx
from clldutils.clilib import Table, add_format
def register(parser):
add_format(parser, default="simple")
parser.add_argument(
"--show",
help="Number of most common colexifications t... |
from .p1000 import StationAP1000
from .reload import StationAReloadMixin
from .copan_24 import Copan24Specs
from .copan_48 import copan_48_corrected_specs
from typing import Tuple, Optional
class StationATechnogenetics(StationAP1000):
def __init__(self,
beads_mix_repeats: int = 2,
beads_mix_volume... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.distribute import distribution_strategy_context
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.... |
from collections import OrderedDict
from datetime import datetime, timedelta
from typing import cast, Dict, List, NamedTuple, Optional
from google.appengine.ext import ndb
from backend.common.consts import comp_level
from backend.common.consts.alliance_color import AllianceColor
from backend.common.consts.event_type ... |
import numpy as np
import os
import sys
import time
import shutil
import datetime
import torch
import torch.nn.functional as torch_F
import ipdb
import types
import termcolor
import socket
import contextlib
from easydict import EasyDict as edict
from ipdb import set_trace
from im_util.transforms import quat_and_transl... |
# VideoCropper
# <NAME>, Oct 2018
import argparse
import cv2
import numpy as np
import os.path
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='VideoCropper is a mini program for helping computer vision '
'researchers to conveniently hand-cr... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
---------------------------------------------... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import fft
import cv2
import imutils
import math
cap = cv2.VideoCapture('Tag1.mp4')
#cap = cv2.VideoCapture('Tag0.mp4')
#cap = cv2.VideoCapture('Tag2.mp4')
out = cv2.VideoWriter('Testudo.avi',cv2.VideoWriter_fourcc(*'XVID'), 30, (400,300))
# FFT to subra... |
#!/usr/bin/env python
# coding: utf-8
#Takes in clusterings and sends the predicted outputs to csv.
#File requires the DatatoClusters file to be run, so that
#DTW_Clustering.csv, NYT_daily_Filled.csv, NYT_daily_Warped.csv,
#JHU_daily.csv, NYT_daily_Warp_Death.txt, NYT_daily_Death_Filled.txt
#and JHU_daily_death.txt ... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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
#
# Unless requi... |
import os
import omegaconf as oconf
import deepdiff as dd
import hydra
import logging
import itertools
import rich
from rich.console import Console
from rich import box
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
def get_conf(path: str) -> oconf.OmegaConf:
if os.path.splitext(path)[1] != '.yaml'... |
from dataclasses import dataclass
from typing import Dict, List, Optional
import jiant.proj.main.components.task_sampler as jiant_task_sampler
import jiant.shared.caching as caching
import jiant.tasks as tasks
import jiant.utils.python.io as py_io
from jiant.utils.python.datastructures import ExtendedDataClassMixin
... |
import torch
import torch.nn as nn
class ResDoubleConv(nn.Module):
'''Basic DoubleConv of a ResNetV2'''
def __init__(self, in_channels, out_channels):
super(ResDoubleConv, self).__init__()
self.double_conv = nn.Sequential(
nn.BatchNorm2d(in_channels),
nn.ReLU(inplace=... |
# coding=utf-8
# Copyright 2019 The Tensor2Tensor 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... |
#
# 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... |
"""
Kubernetes watching/streaming and the per-object queueing system.
The framework can handle multiple resources at once.
Every custom resource type is "watched" (as in ``kubectl get --watch``)
in a separate asyncio task in the never-ending loop.
The events for this resource type (of all its objects) are then pushed... |
# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from typing import Generic, Optional, TypeVar
from .daml_lf_1 import (
Binding,
Block,
BuiltinFunction,
Case,
Expr,
FieldWithExpr,
FieldWithType,
... |
#!/usr/bin/env python
#
# analytics_perftest.py
#
# System tests for analytics
#
# Created by <NAME> on 05/16/2013
#
# Copyright (c) 2013, Contrail Systems, Inc. All rights reserved.
#
import os
import sys
from gevent import monkey; monkey.patch_all()
import subprocess
import shutil
import glob
import unittest
import... |
# Copyright (c) 2021 PaddlePaddle 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
#
# Unless required by app... |
import transformers
from tokenizers.implementations import SentencePieceUnigramTokenizer, BaseTokenizer
from tokenizers.processors import TemplateProcessing
from tokenizers.models import Unigram, BPE
from tokenizers import decoders
from tokenizers import Tokenizer, Regex
from tokenizers.normalizers import (
StripAc... |
import logging
from django.conf import settings
from django.http import (HttpResponse)
from stagecraft.apps.dashboards.models.dashboard import Dashboard
from stagecraft.apps.organisation.models import Node
from stagecraft.libs.validation.validation import is_uuid
from stagecraft.libs.views.resource import ResourceVie... |
from os import path
import json
NODE_CORE_MODULES = {
'assert',
'assert/strict',
'async_hooks',
'buffer',
'child_process',
'cluster',
'console',
'constants',
'crypto',
'dgram',
'dns',
'dns/promises',
'domain',
'events',
'fs',
'fs/promises',
'http',
... |
from snovault import upgrade_step
from .shared import ENCODE2_AWARDS, REFERENCES_UUID
from pyramid.traversal import find_root
import re
@upgrade_step('antibody_characterization', '', '3')
@upgrade_step('biosample_characterization', '', '3')
def characterization_0_3(value, system):
# http://redmine.encodedcc.org/i... |
#!/usr/bin/env python3
# Copyright <NAME>, under MIT license, see LICENSE at github.com/diafygi/acme-tiny
import argparse
import base64
import hashlib
import json
import logging
import os
import re
import sys
import textwrap
import time
import urllib.request
import azure.identity
import azure.mgmt.dns
import cryptogr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Line too long - pylint: disable=C0301
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
""" Unittesting for gplog module
"""
import os
from gppylib.gparray import GpArray, Segment, createSegmentRows, get_gparray_from_config
from gppylib import gplog
from gp_... |
from __future__ import division
import math
import torch
from collections import defaultdict
import onmt
from onmt.speech.Augmenter import Augmenter
class Batch(object):
# An object to manage the data within a minibatch
def __init__(self, src_data, tgt_data=None,
src_type='text',
... |
import json
import re
from .utils import get_page
from pyquery import PyQuery as pq
class ProxyMetaclass(type):
def __new__(cls, name, bases, attrs):
count = 0
attrs['__CrawlFunc__'] = []
for k, v in attrs.items():
if 'crawl_' in k:
attrs['__CrawlFunc__'].append... |
"""Swap edges in a graph.
"""
import math
from networkx.utils import py_random_state
import networkx as nx
__all__ = ["double_edge_swap", "connected_double_edge_swap"]
@py_random_state(3)
def double_edge_swap(G, nswap=1, max_tries=100, seed=None):
"""Swap two edges in the graph while keeping the node degrees f... |
"""
.. module: dispatch.plugins.dispatch_slack.messaging
:platform: Unix
:copyright: (c) 2019 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
import logging
from typing import List, Optional
from jinja2 import Template
from dispatch.messaging.strings import (
I... |
import atexit
import logging
import os.path
import platform
import re
import signal
import sys
import time
import traceback
from multiprocessing import Process, Manager
from threading import Thread, Event
from uuid import UUID
from iottalkpy.color import DAIColor
from iottalkpy.dan import Client, DeviceFeature, NoDat... |
"""
Support pre-0.12 series pickle compatibility.
"""
import contextlib
import copy
import io
import pickle as pkl
from typing import TYPE_CHECKING, Optional
import warnings
from pandas import Index
from pandas.tseries.offsets import DateOffset
if TYPE_CHECKING:
from pandas import Series, DataFrame
def load_r... |
from collections import defaultdict
import argparse
from torchvision import transforms
from PIL import Image
import h5py
import numpy as np
import torch
from text_recognizer.data.util import BaseDataset, convert_strings_to_labels
from text_recognizer.data.base_data_module import BaseDataModule, load_and_print_info
fr... |
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
from django.views.generic import View
from django.db.models import Q
from pure_pagination import Paginator, PageNotAnInteger
from organization.models import CourseOrg, CityDict, Teacher
from organization.forms import Us... |
from __future__ import print_function
CopyRight = '''
/*
* Copyright 2015 Advanced Micro Devices, Inc.
*
* 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 w... |
from __future__ import unicode_literals
from __future__ import division
from past.utils import old_div
from builtins import object
import six
from datetime import timedelta
from numbers import Number
from .exceptions import CaptionReadError, CaptionReadTimingError
# `und` a special identifier for an undetermined lang... |
from sympy import cos, expand, Matrix, sin, symbols, tan
from sympy.physics.mechanics import (dynamicsymbols, ReferenceFrame, Point,
RigidBody, Kane, inertia, Particle)
def test_one_dof():
# This is for a 1 dof spring-mass-damper case.
# It is described in more detail in th... |
# Copyright 2015 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 a... |
# coding=UTF-8
'''
Copyright (c) 2010 openpyxl
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, publ... |
from typing import Callable, TYPE_CHECKING, Optional, Union
import os
from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from decimal import Decimal
from kivy.clock import Clock
from electrum_dsv.util import InvalidPassword
from electrum_... |
import math
from abc import ABCMeta, abstractmethod
from river.drift import ADWIN
from river.utils.skmultiflow_utils import check_random_state, normalize_values_in_dict
from .._tree_utils import do_naive_bayes_prediction
from .base import FoundNode, SplitNode
from .htc_nodes import LearningNodeNBA
class AdaNode(met... |
# coding=utf-8
from abc import ABC, abstractmethod
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from PIL import Image
from PIL import ImageDraw
import os.path as osp
import numpy as np
import json
from util import segment_cloths_from_image
class CpVtonDataset(ABC, data.D... |
"""
hyperspectral_classification.py
Classification using hyperspectral remote sensing data.
Author: <NAME>
<EMAIL>
www.namanji.wixsite.com/naman/
"""
#---------------------------------------------------------------------------------------------------
import os
import gdal, ogr, osr
import numpy as np
fr... |
"""
Environment for 2D car driving.
You can customize this script in a way you want.
View more on [莫烦Python] : https://morvanzhou.github.io/tutorials/
Requirement:
pyglet >= 1.2.4
numpy >= 1.12.1
"""
import numpy as np
import pyglet
pyglet.clock.set_fps_limit(10000)
class CarEnv(object):
n_sensor = 5
act... |
# Copyright (c) 2018-2021, <NAME>
# License: MIT License
from typing import Any, TextIO, TYPE_CHECKING, Union, List, Iterable, BinaryIO
import abc
from .types import TAG_STRING_FORMAT, cast_tag_value, DXFVertex
from .types import BYTES, INT16, INT32, INT64, DOUBLE, BINARY_DATA
from .tags import DXFTag, Tags
from .const... |
import calendar
import time
from dataclasses import dataclass
from typing import Any, Dict, List, Optional, Tuple
from django.conf import settings
from django.http import HttpRequest
from django.utils import translation
from two_factor.utils import default_device
from version import ZULIP_MERGE_BASE
from zerver.conte... |
import json
from collections import namedtuple
import logging
from typing import Any, Callable, Dict, Generator, Iterable, List, Text, Union, cast
import six
from schema_salad.sourceline import SourceLine, cmap, strip_dup_lineno, indent, bullets
import schema_salad.validate as validate
from .process import shortname
... |
from typing import Iterable, Union
import numpy as np
from scipy.linalg import block_diag, eigh
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils.validation import check_is_fitted
from cca_zoo.models import rCCA
from cca_zoo.utils.check_values import _process_parameter, _check_views
class MCC... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import cv2
import torch
from torchvision import transforms as T
from torchvision.transforms import functional as F
from maskrcnn_benchmark.modeling.detector import build_detection_model
from maskrcnn_benchmark.utils.checkpoint import DetectronCheck... |
# MIT License
#
# Copyright (c) 2020-2021 CNRS
#
# 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, pu... |
import glob
import math
import os
import random
import time
import re
import cv2
import numpy as np
import copy
from torchvision.datasets import VisionDataset
from lib.utils.image import gaussian_radius, draw_umich_gaussian, draw_msra_gaussian
from lib.utils.utils import xyxy2ctwh
from lib.datasets.jde import letterb... |
"""
Loss Functions
Author: <NAME>
Loss functions to use for training. Some are adapted from Lar's Blog,
https://lars76.github.io/neural-networks/object-detection/losses-for-segmentation/
"""
from tensorflow.keras.losses import binary_crossentropy
import tensorflow.keras.backend as K
import tensorflow as tf
import num... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2017 <NAME> (plugin.video.netflix)
Functions for starting the addon
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from functools import wraps
from xbmc import getCondVisibility, Monitor, getInfoLabel
from resources.lib.common.exce... |
import sdi_utils.gensolution as gs
import sdi_utils.set_logging as slog
import sdi_utils.textfield_parser as tfp
import pandas as pd
import io
import re
EXAMPLE_ROWS = 5
try:
api
except NameError:
class api:
class Message:
def __init__(self, body=None, attributes=""):
self... |
# Code Taken from https://github.com/LYH-YF/MWPToolkit
# -*- encoding: utf-8 -*-
# @Author: <NAME>
# @Time: 2021/08/18 11:35:21
# @File: multi_equation_dataloader.py
import math
from configuration import Config
from dataset.multi_equation_dataset import MultiEquationDataset
from utils.enum_type import FixType,Specia... |
"""config"""
import errno
import json
import os
import types
from werkzeug.utils import import_string
from __compat import string_types, iteritems
class Config(dict):
"""Works exactly like a dict but provides ways to fill it from files
or special dictionaries. There are two common patterns to populate the
... |
import dgl
from dgl.data.utils import split_dataset
from dgl.nn.pytorch import SAGEConv, GATConv
import argparse
import numpy as np
import networkx as nx
from tqdm import tqdm
from sklearn.metrics import roc_auc_score
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import D... |
"""Extract, format and print information about Python stack traces."""
import linecache
import sys
import types
__all__ = ['extract_stack', 'extract_tb', 'format_exception',
'format_exception_only', 'format_list', 'format_stack',
'format_tb', 'print_exc', 'format_exc', 'print_exception',
... |
import frappe
from frappe import _
from erpnext.hr.doctype.leave_application.leave_application import get_leave_balance_on, get_leave_allocation_records, get_leave_details
from datetime import date
import datetime
import collections
from one_fm.api.tasks import get_action_user,get_notification_user
@frappe.whitelist()... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
try:
from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import (
AnsibleArgSpecValidator,
)
except ImportError:
ANSIBLE_UTILS_IS_INST... |
#
# These functions allow various properties of the expansion of the Universe to be calculated:
# e.g. OmegaM/OmegaL/OmegaR/OmegaK for any redshift, growth rate and growth factor, sigma8, and
# RhoCrit and RhoMean. They use curvature correctly, calculated internally using the relation
# OmegaM+OmegaL+OmegaR+OmegaK=1, b... |
#!/usr/bin/env python
import argparse
import distutils.version
import logging
import os
import signal
import sys
import time
import go_vncdriver
import tensorflow as tf
from a3c import A3C
from envs import create_env
from hparams import add_hparams, get_hparams
## Imports for catastrophe/blocking wrappers
from humanr... |
"""
These classes are light wrappers around Django's database API that provide
convenience functionality and permalink functions for the databrowse app.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils import formats
from django.utils.text import capfirst
from django.utils.enc... |
from enum import Enum
import ibm_boto3
import ibm_botocore
from ibm_botocore.credentials import DefaultTokenManager
from ibm_botocore.exceptions import ClientError, CredentialRetrievalError
from ibm_botocore.client import Config
from lithopscloud.modules.api_key import ApiKeyConfig
from lithopscloud.modules.utils impo... |
# Copyright (c) 2015. Mount Sinai School of Medicine
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.