text stringlengths 3.07k 22.1k |
|---|
# Copyright (c) 2016-2017, <NAME>
#
# All rights reserved.
#
# The MIT License (MIT)
#
# 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 ... |
from __future__ import absolute_import, division, print_function
from builtins import range
from libtbx.test_utils import approx_equal
def exercise_integer():
from libtbx.math_utils import iround, iceil, ifloor, nearest_integer
assert iround(0) == 0
assert iround(1.4) == 1
assert iround(-1.4) == -1
assert ir... |
#loading dataset
import pickle
x = open('/content/gdrive/MyDrive/covidban/COVID-19 Radiography Database/Xray.pickle','rb')
x_train = pickle.load(x)
y = open('/content/gdrive/MyDrive/covidban/COVID-19 Radiography Database/yray.pickle','rb')
y_train = pickle.load(y)
#import libraries
import tensorflow as tf
from sklearn... |
#!/usr/bin/python3
import base64
import hmac
import json
import re
import sys
import urllib.request
from urllib.parse import quote
from _sha1 import sha1
import time
from datetime import datetime
import sys
import os
aliddnsipv6_ak = "AccessKeyId"
aliddnsipv6_sk = "Access Key Secret"
aliddnsipv6_name1 = 'subDomain... |
import numpy as np
import random
#n= 0, r =1, rr=2, rrr=3, g = 4, gb=5, bg = 6, b=7
#N=0, R=1, B=2, G=3
num_obs = 8
num_act = 4
NUM_TRACES = 200
'''
File is used to procedurally generate action trace files for the Block Stacking dataset
'''
def gen_path(length=10):
act = np.zeros(length, dtype=np.int)
# ge... |
#!/usr/bin/python
import sys
import argparse
sys.path.append('silos') # NOQA
import json
import argparse
import logging
import logging.config
import yaml
import jax
import civic
import oncokb
import cgi_biomarkers
import molecularmatch
import molecularmatch_trials
import pmkb
import drug_normalizer
import disease_no... |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# 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... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import panel as pn
pn.extension()
import hvplot.pandas
import datetime
# # 1 load data
# In[2]:
folder_path = './data/'
# Load data from each csv and assign to variable data_****"
data_net_zero = pd.read_csv(folder_path + 'net_zero.csv', parse_... |
# -*- coding: utf-8 -*-
"""
This script converts the "wide" data in `data-wide` into "tidy" CSVs in `data`.
--------------------------------
Disaggregation naming convention
--------------------------------
While this script can simply create single aggregate series, it also has the
capability of creating any number ... |
# -*- coding: utf-8 -*-
__all__ = ('GCovCollector',)
from typing import FrozenSet, Mapping, Any, Set, Dict, Optional, ClassVar
import os
import typing
import xml.etree.ElementTree as ET
from loguru import logger
import attr
from .collector import CoverageCollector, CoverageCollectorConfig
from ..core import FileLine... |
import cupy
from cupy import _core
from cupy._core import fusion
from cupy import _util
from cupy._core import _routines_indexing as _indexing
from cupy._core import _routines_statistics as _statistics
def argmax(a, axis=None, dtype=None, out=None, keepdims=False):
"""Returns the indices of the maximum along an ... |
"""
---
title: Gated Linear Units and Variants
summary: >
Train an auto-regressive transformer with Gated Linear Units and variants
for the position-wise feedforward network (FFN).
---
# Gated Linear Units and Variants
This trains a simple [transformer](../../) model for auto-regression.
We try different variants... |
from __future__ import print_function, unicode_literals
from getpass import getpass
from os import path
from socket import (
error as socket_error,
gaierror,
)
import click
from paramiko import (
AuthenticationException,
DSSKey,
ECDSAKey,
Ed25519Key,
MissingHostKeyPolicy,
PasswordRequ... |
#!/usr/bin/env python3
"""
usage: bash.py [-h] [-i]
chat with people: prompt, then listen, then speak, and repeat
optional arguments:
-h, --help show this help message and exit
-i, --interact ask more questions
quirks:
returns exit status 0 after printing usage, if called with no arguments
returns exi... |
import json
from collections import defaultdict
from pprint import pformat
import boto3
import botocore
import pydash as pydash
from botocore.exceptions import WaiterError
from infra_buddy.utility import print_utility
from infra_buddy.utility.exception import NOOPException
from infra_buddy.utility.waitfor import wait... |
# pyOCD debugger
# Copyright (c) 2016 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
# ... |
# 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 u... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) 2019 Red Hat Inc.
# Copyright (C) 2019 Western Telematic Inc.
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PAR... |
import os
import random
import string
import threading
import time
from queue import Queue
import platform
import requests
from colorama import Fore, init
intro = """
Ye ganduwo ki ma chodi jati hai
✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅
"""
print(intro)
if platform.system() == "Windows": #checking OS
clear = "cls"
else:
clear = "... |
################################### SERVER'S SIDE ###################################
#const
mask = 0xffffffff
#bitwise operations have the least priority
#Note 1: all variables are unsigned 32-bit quantities and wrap modulo 2**32 when calculating, except for
#ml, message length: 64-bit quantity, and
... |
from ontorunner.post.util import filter_synonyms, consolidate_rows
import pandas as pd
# from nltk.corpus.reader.wordnet import NOUN, VERB
from nltk.stem.wordnet import WordNetLemmatizer
# from nltk import ngrams, FreqDist
# from textdistance.algorithms.edit_based import Levenshtein
import csv
import os
from glob im... |
# -*- coding: utf-8 -*-
import numpy as np
# References
# [1] <NAME>., Modi,... & <NAME>. (2007).
# How state preparation can affect a quantum experiment:
# Quantum process tomography for open systems.
# Physical Review A, 76(4), 1–12. https://doi.org/10.1103/PhysRevA.76.042113
# [2] Ordered Dict:
# In Python 3.7.0 ... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Metrics that allow to retrieve curves of partial results.
Typically used to retrieve partial learning curves of M... |
#
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
# 2007-09-12 fl fix... |
from sstcam_sandbox import get_data
from CHECLabPy.utils.files import create_directory
import numpy as np
import pandas as pd
import os
from target_calib import Mapping
def create_new_mapping(input_path, output_path):
"""
Create a TargetCalib Mapping file with the latest pixel positions,
but the prod3 pix... |
import datetime
import itertools
import warnings
from six import text_type
from ..xml import OUT
from ..users import SharePointUser
from ..utils import decode_entities
from . import moderation
empty_values = ('', None)
class FieldDescriptor(object):
def __init__(self, field, immutable=False):
self.fiel... |
import json
import os
import traceback
from pathlib import Path
from pprint import pprint
import sys
import time
import basedosdados as bd
import yaml
from basedosdados import Dataset, Storage
from basedosdados.upload.base import Base
from basedosdados.upload.metadata import Metadata
def tprint(title=""):
if not... |
from binaryninja.interaction import (
show_message_box,
get_int_input,
get_choice_input
)
from binaryninjaui import (
DockHandler,
DockContextHandler,
getMonospaceFont,
UIActionHandler
)
from PySide2 import QtCore
from PySide2.QtCore import Qt, QMimeData
from PySide2.QtGui import QBrush, QCo... |
import uuid
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.core import validators
from django.core.mail import send_mail
from django.conf import settings
from django.db import models
from django.db.models import Q
from django.db.models.signals import post_save
from d... |
import os
from typing import List, Tuple, Dict
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import tellurium as te
from tellurium.roadrunner.extended_roadrunner import ExtendedRoadRunner
from sres import SRES
# roadrunner.Logger.disableConsoleLogging()
# roadrunne... |
from six import text_type
from typing import Dict, Tuple, Any, Optional, MutableMapping, Mapping
from datetime import datetime
from .exceptions import UnknownUpdateCardAction
from .templates import TRELLO_SUBJECT_TEMPLATE, TRELLO_MESSAGE_TEMPLATE
SUPPORTED_CARD_ACTIONS = [
u'updateCard',
u'createCard',
u'a... |
# Importing modules.
from os import path, remove
from sys import stdout
from base64 import urlsafe_b64encode
from hashlib import sha512, sha256
from cryptography.fernet import Fernet
from cryptography.hazmat.primitives.hashes import SHA256
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
cla... |
from selenium import webdriver
from selenium.webdriver.support.select import Select
from ics import Calendar, Event
from selenium.common.exceptions import NoSuchElementException
from datetime import date, datetime
from twitter_get import importer
import sys
import arrow
def main():
if len(sys.argv) != 5:
... |
from __future__ import print_function
from ggplot import *
import os
import string
import datetime
import pandas as pd
import numpy as np
import random
np.random.seed(10)
random.seed(10)
html = """
<html>
<head>
<style>
img {
max-width: 40%;
}
</style>
... |
"""Exception classes thrown by filesystem operations.
Errors relating to the underlying filesystem are translated in
to one of the following exceptions.
All Exception classes are derived from `~fs.errors.FSError`
which may be used as a catch-all filesystem exception.
"""
from __future__ import unicode_literals
from... |
import os
from functools import reduce
import cv2
import keras
import matplotlib.pyplot as plt
import numpy as np
import scipy.signal
from PIL import Image
def compose(*funcs):
if funcs:
return reduce(lambda f, g: lambda *a, **kw: g(f(*a, **kw)), funcs)
else:
raise ValueError('Composition of e... |
# The MIT License (MIT)
# Copyright (c) 2020 by Brockmann Consult GmbH and contributors
#
# 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... |
import os, sys, argparse, json, glob
from os.path import dirname, join, abspath
sys.path.insert(0, abspath(join(dirname(__file__), '..')))
from DataProcess.Preprocess import main as Preprocess
from DataProcess.makeJson import main as makeJson
from DataProcess.addAnnots import main as addAnnots
from Experiments.Experime... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from time import sleep, time
from threading import Thread, RLock, Event
from queue import Queue, Empty
import logging
from epics import PV
from epics.ca import CAThread
from pypvserver import PypvServer, PyPV
logger = logging.getLogger(__name__)
class ADPluginServer:
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
from contextlib import contextmanager
import pytest
from mando import Program
program = Program('example.py', '1.0.10')
def NoopCompleter(prefix, **kwd):
return []
program.option(
"-f", "--foo", dest='foo', default='bar', completer=NoopCompleter,
help="Real programmers don't comment their code. \
... |
# Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import datetime
import h5py as h5py
import re
import numpy as np
from mne.io.pick import _picks_to_idx
# The currently-implemented spec can be found here:
# https://github.com/fNIRS/snirf/blob/52de9a6724ddd0c9dcd36d8d11007895fed74205/snirf_specification.md
SPE... |
# Copyright (c) 2017-2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
from __future__ import print_function
import numpy as np
from scipy.stats import multivariate_normal
import pytest
from numpy.testing import assert_allclose
EPS = 1e-8
class Gauss(object):
'''
'''
def __init__(self, dim, mean=None, cov=None):
self.dim = dim
if mean is None:
... |
import nltk
import io
import csv
import base64
import math
import json
import random
from typing import Iterator, Tuple, List, Dict
__en_dataset = "./running_data/cmn-en.txt"
__cn_dataset = "./running_data/cmn-cn.txt"
__en_tokens = "./running_data/en_tokens"
__cn_tokens = "./running_data/cn_tokens"
__en_length_inf... |
import numpy as np
from collections import deque
import os
import process_data.points_utils as pc_utils
from typing import Tuple
from constants import EPSILON
V = np.array
class MeshWrap:
def __init__(self, data):
self.data = data
def __getitem__(self, item):
return self.data[item]
de... |
import copy
from typing import Tuple, Union, List
import numpy as np
from pgdrive.scene_creator.blocks.constants import BlockDefault
from pgdrive.scene_creator.lane.abs_lane import LineColor, AbstractLane, LineType
from pgdrive.scene_creator.lane.circular_lane import CircularLane
from pgdrive.scene_creator.lane.strai... |
# -*- coding: utf-8 -*-
import logging
import numpy as np
logger = logging.getLogger(__name__)
def get_width_controller(decay_rate=0.95, apply_every_n_iterations=1):
""" Get a simple width controller that exponentially decreases the width
every nth iteration.
Args:
decay_rate: `float` indicating... |
from typing import (
TypeVar,
Generic,
AsyncGenerator,
Callable,
Optional,
Union,
Any,
Awaitable,
Deque,
overload,
)
from functools import wraps
from collections import deque
from functools import partial
import sys
from ._typing import Protocol, AsyncContextManager, ContextMana... |
import numpy
# CSEP Imports
from csep.utils.time_utils import datetime_to_utc_epoch, epoch_time_to_utc_datetime
from csep.utils import plots
class Simulation:
"""
View of CSEP Experiment. Contains minimal information required to perform evaluations of
CSEP Forecasts
"""
def __init__(self, filenam... |
"""
Shallow water test cases on the sphere by <NAME> al. (1992) and
Läuter et al (2005).
[1] Williamson et al., 1992. A standard test set for numerical approximations
to the shallow water equations in spherical geometry. Journal of
Computational Physics, (1):211–224.
https://doi.org/10.1016/S0021-9991(05)8... |
from numpy.core.fromnumeric import transpose
import yfinance as yf
import xlwings as xw
from datetime import datetime
from IPython.display import clear_output
import pandas as pd
from pandas import json_normalize
import functools
import threading
import time
import schedule
import requests
import json
from fii impo... |
'''
Description:
Author: voicebeer
Date: 2020-09-14 01:01:51
LastEditTime: 2021-02-22 08:46:32
'''
# standard
import argparse
import torch
import torch.nn.functional as F
import torch.nn as nn
import numpy as np
import copy
import random
import time
import math
from torch.utils.tensorboard import SummaryWriter
#
imp... |
#!/usr/bin/python
# -*-coding: utf-8 -*-
# Author: <NAME>
# Email : <EMAIL>
"""
A range of functions to compute bootstraps for the mean difference
between two groups.
"""
def create_jackknife_indexes(data):
"""
Given an array-like, creates a jackknife bootstrap.
For a given set of data Y, the jackknife b... |
# Copyright (c) 2019 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... |
#!/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... |
# Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.
import warnings
from abc import abstractmethod
from typing import Optional
import networkx as nx
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils.validation import check_is_fitted
from ..utils import... |
import os, subprocess, argparse
import logging
import pickle
import tensorflow as tf
import numpy as np
import sentencepiece as spm
from lm_keras_generators import KerasLMSentenceLevelBatchGenerator
"""
Train an LSTM-based language model on texts pretokenized with SPM.
Sample usage:
python 03_train.py --corpus-path ... |
#
# Copyright 2017 Pixar Animation Studios
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... |
######################################
# #
# 4. #
# configurator layer #
# #
######################################
'''
For different MOs (Management Objects) different config... |
'''
Based on https://github.com/jwineinger/django-inotifier, added Celery usage
Copyright (c) 2017 <NAME>
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 li... |
# -*- coding: utf-8 -*-
__author__ = 'Rimco'
import sys
import os
import subprocess
import shutil
from ospy import i18n
from ospy.helpers import print_report
def yes_no(msg):
response = ''
while response.lower().strip() not in ['y', 'yes', 'n', 'no']:
response = raw_input('%s [y/yes/n/no]\n' % msg.e... |
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.transforms as transforms
import numpy as np
from scipy import stats
__all__ = ["blandaltman"]
class _BlandAltman(object):
"""Internal class for drawing a Bland-Altman plot"""
def __init__(self, method1, method2,
x_title, y_... |
#!/usr/bin/env python3
# Copyright 2017 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 ... |
# C O D E A Z / Samil
import os
from telethon.tl.types import InputMessagesFilterDocument
from userbot.events import register
from userbot import BOT_USERNAME, PATTERNS, CMD_HELP, PLUGIN_CHANNEL_ID
import userbot.cmdhelp
from userbot.cmdtr import CmdTr
from random import choice, sample
import importlib
import re
# ██... |
from cryptography.exceptions import InvalidTag
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305
from cryptography.hazmat.primitives.... |
from collections import defaultdict
from functools import wraps
from typing import List, Any, Union, Callable, Tuple
import numpy as np
from ..base import TrainableBase, CompositionalTrainableBase
from ..proto import gnes_pb2, blob2array
from ..score_fn.base import get_unary_score, ModifierScoreFn
class BaseIndexe... |
######################################################################
# Copyright
# <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file LICENSE.txt, which
# you should have received as part of this distribution.
#
############################################################... |
import re
from importlib import import_module
from typing import Any, Optional
from pytest import fixture, mark, raises
from omegaconf import (
DictConfig,
IntegerNode,
Node,
OmegaConf,
ValidationError,
_utils,
flag_override,
)
from omegaconf._utils import _is_optional, get_ref_type
from o... |
#******************************************************************************
#
# Keras Gems
# Copyright 2018 <NAME>, <NAME> and <NAME>
#
# output dataset properties (min, max, percentiles, ...) of all fields
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exc... |
# RT Dashboard - Setting
from __future__ import annotations
from typing import Union, Optional, Literal, overload, get_origin, get_args
from asyncio import Event, wait_for, TimeoutError as AioTimeoutError
from datetime import datetime
from discord.ext import commands
import discord
from pytz import utc
from aioht... |
# Copyright 2021 The TensorFlow Probability 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... |
#!/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 __future__ import annotations
import json
from copy import deepcopy
from typing import List, Optional, Tuple
imp... |
# Copyright (c) 2012-2016 Seafile Ltd.
import hashlib
import re
import logging
from datetime import datetime
from importlib import import_module
from constance import config
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404
from django.... |
# based on lincs_experiment.py
from ossaudiodev import SNDCTL_COPR_RCVMSG
import sys
#from tkinter.filedialog import SaveFileDialog
from unicodedata import name
sys.path.append('..')
import argparse
import torch
from networks import RNNEncoder, FinetunedEncoder
from networks import FCDiscriminator
from datasets im... |
#!/usr/bin/env python3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2010 California Institute of Technology. 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... |
#!/usr/bin/env python
# coding: utf-8
#
# Author: <NAME>
# URL: http://kazuto1011.github.io
# Created: 2017-05-18
from __future__ import print_function
import copy
import os.path as osp
import click
import cv2
import matplotlib.cm as cm
import numpy as np
import torch
import torch.nn.functional as F
from tor... |
import warnings
from itertools import groupby
from typing import List
import numpy as np
from pydantic import Field
from pymatgen.analysis.xas.spectrum import XAS, site_weighted_spectrum
from pymatgen.core.periodic_table import Element
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from emmet.core.feff.tas... |
from TdP_collections.graphs.dfs import DFS_complete
from TdP_collections.graphs.graph import Graph
import random
import time
"""
Preso in input un oggetto MyGraph G, restituisce un bridge di G oppure None se il grafo è biconnesso
"""
class MyGraph (Graph):
def remove_edge(self, u, v, x=None):
if self.get... |
# server_async.py
#
# Copyright 2018-2019 Geaaru <<EMAIL>>
import asyncio
import logging
import traceback
from abc import abstractmethod, ABCMeta
from enum import Enum
from datetime import datetime
from pyrad.packet import Packet, AccessAccept, AccessReject, \
AccountingRequest, AccountingResponse, \
Disconne... |
"""
Task
=====
The basic class of task.
User define task by inherit the ``Task`` class and overwrite ``load`` and ``train`` methods.
"""
__all__ = [
"Task",
"TaskStatus"
]
import abc
import enum
import logging
import multiprocessing
import os
import threading
import time
import traceback
import uuid
from t... |
#!/usr/bin/env python
"""
bulk-process
Invoke capa recursively against a directory of samples
and emit a JSON document mapping the file paths to their results.
By default, this will use subprocesses for parallelism.
Use `-n/--parallelism` to change the subprocess count from
the default of current CPU count.... |
import os
import logging
import importlib
import json
from billy.scrape.validator import DatetimeValidator
from billy.core import settings
from billy.utils import JSONEncoderPlus
import scrapelib
class ScrapeError(Exception):
"""
Base class for scrape errors.
"""
def __init__(self, msg, orig_except... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... |
from .ransac import ransac
from .utils import dist_matrix, orientation_diff
import numpy as np
import torch
def select_seeds(dist1, R1, scores1, n1, fnn12, mnn):
im1neighmap = dist1 < R1 ** 2 # (n1, n1)
# find out who scores higher than whom
im1scorescomp = scores1.unsqueeze(1) > scores1.unsqueeze(0) # ... |
from django import forms
from django_summernote.widgets import SummernoteInplaceWidget
from socket import if_nameindex
from netaddr import IPAddress, IPNetwork
from netaddr.core import AddrFormatError
from subprocess import PIPE, run as s_run
from re import search as search_regex
from random import randrange
from .mode... |
"""
Interface item implementation. There are several notations supported
- class box with interface stereotype
- folded interface
- ball is drawn to indicate provided interface
- socket is drawn to indicate required interface
Interface item can act as icon of assembly connector, see
`gaphor.diagram.connector`... |
import logging
import time
import winsound
from datetime import datetime
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException, TimeoutException, StaleElementReferenceException, \
UnexpectedAlertPresentException, ElementClickInterceptedException, WebDriverException
from selen... |
"""
Copyright (c) 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"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribut... |
"""
training script for the proposed model.
author: <NAME>
date: 2020-04-29
"""
import os
import argparse
import time as t
import datetime as dt
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
import utils.misc as misc
from datahandler.LITIV import LITIV
from datahandl... |
import functools
from os.path import expanduser
import os
import ipfshttpclient
import requests
import re
# Datetime conversion to rfc1123
import locale
import datetime
import logging
import platform
from urllib.request import urlopen
from urllib.error import URLError
import json
from .__init__ import __version__ ... |
import audiofile
import numpy as np
import numpy.lib.stride_tricks as npst
import matplotlib.pyplot as plt
from scipy import signal, fft
import glob, os, random
import xcorr
import scikit_talkbox_lpc as scilpc
import filterbanks
def read_wavfile(path):
"""
Read a given wav audio file and return the signal of ... |
#!/usr/bin/env python
import argparse
import logging
import sys
from enum import Enum
import serial
import serial.threaded
class DeviceIdentifier(Enum):
ALPHA = 1
BETA = 2
class ProxyProtocolFactory:
def __init__(self, dev_id, pass_through=True, data_pass_through_callback=None, data_received_callback=N... |
# Copyright 2020 MONAI Consortium
# 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... |
try:
# Python2
import Tkinter as tk
import ttk
except ImportError:
# Python3
import tkinter as tk
import tkinter.ttk as ttk
from Stepper import stepper
from picamera import PiCamera
from time import sleep
import numpy as np
#from skimage.io import imread, imsave
import time
#stepper variables
... |
import logging
import torch.nn as nn
from ..utils import conv1x1_group, conv3x3_group, \
norm_layer, kaiming_init, constant_init, load_checkpoint
from ..registry import BACKBONES
class Conv_dw_pw(nn.Module):
def __init__(self,
inplanes,
planes,
stride=1,
... |
# Copyright (c) ZenML GmbH 2020. 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:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete ... |
# Copyright (c) 2016-2018. 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 ... |
#!/usr/bin/env python3
"""
Networks and Network Security
Lab 5
Name: <NAME>
UvAnetID: 11752262
This program contains functions that can operate on networks represented
by the NetworkX module. The most important part is the implementation of a
shortest path algorithm (Dijkstra). Using this algorithm there are ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.