text stringlengths 6.04k 39.5k |
|---|
## evoware/py -- python modules for Evoware scripting
## Copyright 2014 - 2019 <NAME>
##
## 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/L... |
import logging
import math
import time
from datetime import date, datetime, timedelta
import numpy as np
import pandas as pd
from investors.models import StockFollowing, TradeStrategy
from scipy import stats
from stockmarket.models import StockNameCodeMap
from .models import StockHistoryDaily, StockStrategyTestLog
fr... |
import os, sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
TOOL_DIR = os.path.dirname(BASE_DIR)
ROOT_DIR = os.path.dirname(TOOL_DIR)
sys.path.append(ROOT_DIR)
import argparse
import tqdm
import pickle
import numpy as np
from PIL import Image
from lib.datasets.kitti_dataset import KittiDataset
from numba impor... |
# coding=utf-8
# Copyright 2020 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... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from beta_rec.models.torch_engine import ModelEngine
from beta_rec.utils.common_util import timeit
class TVBR(nn.Module):
"""TVBR pytorch Module.
Args:
nn ([type]): [descript... |
# Copyright 2020 <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 limitation the rights to
# use, copy, modify, merge, publish, distribute, sub... |
# Copyright 2017 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
from random import choices, sample, shuffle, random
from copy import deepcopy
from typing import List
from models.fixture import Fixture
from models.city import City
from models.team import Team
import statistics
import random
import math
from itertools import groupby
import matplotlib.pyplot as plt
import matplotlib.a... |
'''
@Author: dengzaiyong
@Date: 2021-09-21 15:16:08
@LastEditTime: 2021-09-27 19:37:08
@LastEditors: dengzaiyong
@Desciption: 参考论文从头开始实现Bert模型
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
https://arxiv.org/abs/1810.0480
Attention Is All You Need
... |
import os
import time
from Crypto.Hash import keccak
class FusionFactory:
allele_num = 2
noise_num = 128
bit_per_noise = 2
noise_value_range = 2 ** bit_per_noise
exclusive_attrs_num = 3
bit_per_exclusive_attrs = 4
total_exclusive_attrs_bit_num = exclusive_attrs_num * bit_per_exclusive_a... |
# =================================================================================2
# Copyright (c) 2019-2020 Nokia
# Copyright (c) 2018-2020 AT&T Intellectual Property.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2019 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the ... |
# Copyright (c) 2019-2020 <NAME>
# Direitos Autorais (c) 2019-2020 <NAME>
#
# Jovem Programador
# Estudante de Engenharia de Telecomunicaçoes
# Tecnologia de Informação e de Medicina.
# Foco Fé Força Paciência
# Allah no Comando.
from os import mkdir, path
import datetime
from PyQt5.QtGui import *
from PyQt5.Qt... |
#!/usr/bin/python3
import eth_abi
import eth_event
from hexbytes import HexBytes
import json
import threading
import time
from lib.components import contract
from lib.components.eth import web3
from lib.services.compiler import compile_contracts
from lib.services.datatypes import KwargTuple, format_output
from lib.se... |
# -- coding: utf-8 --
# Copyright 2018 <NAME> <<EMAIL>>
"""
Handle elements to calculate mass, abundance, etc.
"""
from __future__ import absolute_import
import sqlite3
import os
import re
from .constants import me
from .misc import deprecated
def formulafy(x):
"""
Convert the input string x to a Latex rep... |
# from importlib import import_module
# TODO: Multiple Rounds, Joining,
# Comments, Optimization,
# Quitting
# Class representing an instance of a player
class Player(object):
# Member variables:
# droid: Tuple of socket address
# player: String of player's name
# funds: Integer of player's curr... |
import os
import sys
import csv
import json
import yaml
import configparser
import re
from datetime import datetime, timedelta, date
from typing import List, Tuple, Dict, Set
from itertools import cycle
from operator import itemgetter
from collections import Counter
config = configparser.ConfigParser()
config.read(".v... |
import audioop
import logging
import os
import shlex
import subprocess
import sys
import threading
import time
import traceback
from collections import deque
import pyaudio
from src.downloader import DownloaderPool
from src.globals import GV
from src.queues import LockedQueue
from src.song import Song
from src.utils ... |
""" util functions for output driver
"""
import os
import pandas
import ioformat
import automol
from autofile import io_ as io
from mechanalyzer.inf import spc as sinfo
from mechanalyzer.inf import thy as tinfo
from mechanalyzer.inf import rxn as rinfo
from mechlib import filesys
from mechlib.amech_io import printer a... |
#! -*- coding: utf-8 -*-
import os
import MeCab
import neologdn
import subprocess
import json
import re
from pathlib import Path
import site
from collections import defaultdict
class Tokenizer:
def __add_pos(self, is_pos, term, pos):
if term:
if is_pos:
return term + ':' + '-'... |
import os
import argparse
parser = argparse.ArgumentParser(description='Compatible Product Example')
parser.add_argument('--batch-size', type=int, default=128, metavar='N',
help='input batch size (default: 128)')
parser.add_argument('--mix_threshold', type=int, default=4, metavar='N',
... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@date: Sun Dec 20 01:36:34 2020
"""
import numpy as np
import tensorflow as tf
from . import utils
############################################################
# TODO - Proposal Layer
############################################################
def apply_box_deltas_grap... |
"""
Created by <NAME>
Github: https://github.com/josephedradan
Date created: 10/23/19
Purpose:
Test Cooperative Game Theory with Shapley value
Shapely Value - A method of dividing up gains or costs among players according to the value of their individual
contributions
Details:
Description:
You want ... |
import json
import os
import sys
from contextlib import contextmanager
import lmdb
import msgpack
import pandas as pda
from lz4.frame import compress, decompress
from more_itertools import chunked
from torch.utils.data import DataLoader
from transformers import AutoTokenizer
from chengyubert.data.loader import Prefet... |
from runtime import *
from state import *
from lexer import *
import copy
import random
class TrogonObject:
NULL = 0
NUMBER = 1
STRING = 2
BOOL = 3
FUNCTION = 4
TABLE = 5
TYPE = 6
def unary_minus(self):
raise RuntimeException(
f'Unary minus is not supported for type <{typename[self.type]}>')
def call(s... |
import os
import itertools
import torch
import numpy as np
import pandas as pd
import cv2
from sklearn.model_selection import KFold
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
from torch.utils.data.sampler import Sampler
from albumentations.torch.functional import img_to_tensor
from ... |
"""
Epistemic uncertainty query strategy
"""
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import warnings
import numpy as np
from scipy.interpolate import griddata
from scipy.optimize import minimize_scalar, minimize, LinearConstraint
from sklearn.linear_model import LogisticRegression
from sklearn.linear_mod... |
"""
A module for working with Hopsworks datasets.
"""
import re
import os
import ntpath
import math
import json
import time
from hops import constants, util, project
from hops.exceptions import RestAPIError
import logging
log = logging.getLogger(__name__)
class HTTPUpload:
size_last_chunk = 0
DEFAULT_FLOW_S... |
#-*-coding:utf-8-*-
# Tools to work with compressed sensing libraries. This file includes simple and useful
#+functions in order to get compressed sensing algorithms to work.
# By MW, GPLv3+, Mar 2016
# TODO
# - Create a Sphinx or readthedocs documentation
# - Get something that works.
# ==== Importations
from __futu... |
#!/usr/bin/env python3
"""
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
# -*... |
#!/usr/bin/env python
# coding: utf-8
# ## Setup and Initialization
# Let's start by setting up the environment. Specifically, we need to ensure we have a CUDA capable device. If we don't, we can fall back to CPU. Setting the device value here allows us to forcefully override this value if ever required.
# In[1]:
i... |
# Copyright (c) FULIUCANSHENG.
# Licensed under the MIT License.
import os
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
import transformers
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
from transformers import BartModel, BartConfig
from transformers.mod... |
import json
import re
import sys
from datetime import datetime
from typing import Dict, Tuple
import click
import pandas as pd
from sqlalchemy.orm.exc import NoResultFound
import fire.cli
from . import (
ARKDEF_FILOVERSIGT,
ARKDEF_NYETABLEREDE_PUNKTER,
ARKDEF_OBSERVATIONER,
ARKDEF_PUNKTOVERSIGT,
... |
from sklearn.model_selection import train_test_split
from sklearn.utils.extmath import randomized_svd
from scipy.sparse import csr_matrix
from scipy.sparse import load_npz
import numpy as np
import math
import random
import copy
import pickle
import os
import pymysql
import operator
class LFM:
def __init__(self,lf... |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
# #########################################################################
# Copyright (c) 2015, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2015. UChicago Argonne, LLC. Th... |
from PySide2.QtWidgets import QWidget, QFileDialog, QMessageBox, QVBoxLayout
from PySide2.QtCore import Signal
from PySide2.QtCore import QByteArray, Qt
from PySide2.QtCore import QThread
from PySide2.QtGui import QMovie
from PySide2.QtWidgets import (
QFileDialog,
QLabel,
QSizePolicy,
QMessageBox,
)
f... |
# encoding:utf-8
# Copyright 2015 The TensorFlow 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 re... |
from .context import qosy as qy
from .helper import _random_op_string
import numpy as np
import numpy.linalg as nla
import scipy.special as sps
import scipy.sparse as ss
import scipy.sparse.linalg as ssla
def test_to_matrix():
I = np.array([[1., 0.], [0., 1.]], dtype=complex)
X = np.array([[0., 1.], [1., 0.]]... |
# coding: utf-8
# Officially assigned codes ISO 3166-1: 249 (Revised Jan 2016)
class Country(object):
def __init__(self, code_2, code_3, code_n, used, name):
self.code_2 = code_2
self.code_3 = code_3
self.code_n = code_n
self.used = bool(used)
self.name = name
def __re... |
# -*- coding: utf-8 -*-
"""Provides File IO for Sappy.
Attributes
----------
M4A_MAIN : tuple of int
THUMB opcodes for M4A_Main call.
AMT_MAIN : tuple of int
THUMB opcodes for game AMT M4A_Main call.
BMX_MAIN : tuple of int
THUMB opcodes for game BMX M4A_Main call.
M4A_OLD : tuple of int
THUMB opcodes ... |
from __future__ import with_statement
import pytest
import random
from array import array
from whoosh.automata import fst
from whoosh.compat import b, u, xrange, array_tobytes
from whoosh.filedb.filestore import RamStorage
from whoosh.util.testing import TempStorage
def gwrite(keys, st=None):
st = st or RamSto... |
"""
Multiview suncg dataset to train Siamese RelNet.
"""
import os
import os.path as osp
import numpy as np
import collections
import cv2
import scipy.misc
import scipy.linalg
import scipy.io as sio
import scipy.ndimage.interpolation
from absl import flags
import pickle as pkl
import torch
import multiprocessing
from m... |
import torch
import torch.nn as nn
import logging
from torch.hub import load_state_dict_from_url
"""
Some parts of this code, 'resnet', are refered to 'Pytorch Hub'.
If you want to know more about this coder, search from github or google.
"""
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet1... |
"""
***************
*** WARNING ***
***************
This program will potentially:
- Email CDC and the Delphi team!
- Update the Epicast round counter!
- Upload forecast data to FluSight!
===============
=== Purpose ===
===============
Handles everything for our Epicast and Archefilter submissions to CDC's
Flu C... |
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
class BMSHJ2018Prior(tf.keras.Model):
"""
Flexible prior model from appendix of "Variational image compression with a scale hyperprior"
"""
def __init__(self, channels, dims=(3, 3, 3), init_scale=10., **kwargs):
"""
:... |
# Copyright 2019, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
import json
from django.core.exceptions import ValidationError
from django.db.models import Count, Sum, ExpressionWrapper, FloatField
from django.db.models.functions import Coalesce, NullIf
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django_datatables.datatables import Datatable... |
#!/usr/bin/env python3
# Copyright 2017 <NAME>
# License: Apache 2.0.
import os
import argparse
import sys
import math
from collections import defaultdict
sys.stdout = open(1, 'w', encoding='utf-8', closefd=False)
from IPython import embed
import re
parser = argparse.ArgumentParser(description="This script choos... |
import datetime
import re
from flatland import (
Compound,
DateYYYYMMDD,
Dict,
Integer,
JoinedString,
String,
)
from tests._util import assert_raises, eq_, raises
def test_compound_init_sequencing():
class Canary(Exception):
pass
class InitNotCalledAtClassConstruction(C... |
# Authored by <NAME> and <NAME>, 2020
"""
A collection of functions for assembling pulse definitions based on ViPS input.
"""
import numpy as np
import input_handling
import utils
from templates import TemplateIdentifier
def get_next_pulse_id(vips):
"""
Get a unique pulse ID, for use in pulse definition di... |
''''''
'''
@Author: <NAME> (<EMAIL>)
@Date: 2019-09-01
@Copyright: Copyright (C) <NAME> 2020. All rights reserved. Please refer to the license file.
@LastEditTime: 2020-07-07
@LastEditors: <NAME>
@Description: this file contains different correspondence selection methods
'''
import math
import numpy as np
def conver... |
# This file is part of ip_isr.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you can ... |
#! /usr/bin/env python3
## -*- coding: utf-8 -*-
# Distributed under terms of the MIT license.
"""
Extract frame attributes for frames with Neuro-Symbolic Concept Learner.
"""
import pdb
import time
import os.path as osp
import torch.backends.cudnn as cudnn
import torch.cuda as cuda
from jacinle.cli.argument impor... |
import numpy as np
import albumentations as A
import cv2
from src.helpers import *
def custom_image_transform(image):
image = image / 2
return image
"""
Example of custom transformation that can be added to albumentations pipeline.
"""
class CustomTransformation(A.ImageOnlyTransform):
def get_params_d... |
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 26 23:04:37 2016
@author: oacom
"""
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import numpy as np
import dubins
def plotResults(terrain,cameras,normals,camIdx,visStatsInitial,visStatsFinal,flightPath,cfg):
'''
... |
"""Module containing functionality relating to any processing of a signal throughout ViSQOL"""
import numpy as np
import logging
import math
from typing import Callable, Tuple
from .nsim import nsim_map
from scipy.interpolate import RectBivariateSpline
from scipy.signal import hilbert, correlate, correlation_lags
from... |
"""Provide a command-line interface for `~python_venv`:py:mod:."""
import argparse
import os
import re
import sys
try:
import argcomplete
except ModuleNotFoundError:
# Enable running without autocompletion
pass
from . import (
argparsing,
completion,
const,
env,
exceptions,
get_ve... |
#!/usr/bin/env python3
# Copyright 2016 The Fontbakery 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 applica... |
import os, glob, sys
import numpy as np
class HMM(object):
"""
num_s : number of states
num_o : number of observation values
"""
def __init__(self, init_distr, A, B, use_log=False):
super(HMM, self).__init__()
self.init_distr = init_distr ## shape = (num_s, )
self.A = A ## ... |
import string
import textwrap
import theano
import theano.tensor as tt
from copy import copy
from collections import OrderedDict
from theano import gof
from sympy import Array as SympyArray
from sympy.printing import latex as sympy_latex
from . import Observed, NormalRV
from .opt import FunctionGraph
from .rv impo... |
# -*- coding: utf-8 -*-
# author: peilun
# 预处理每个视频中检测到的track
# 修改21, 425, 428
import numpy as np
import os
import cv2
import math
MATCHED = True
NO_MATCHED = False
SIMILAR_TH = 700
SPEED_TH = 450
TRACK_TH = 2
MOVE_TH = 20000
eps = 0.000001
input_dir = "./aic19-track1-mtmc/train"
PAD_SIZE = 10
class Box(object):
... |
import collections.abc
import re
import pandas as pd
PATTERNS = {
"unit_no": [r"G?(\d{4})-?(\d{5})", r"G?(\d{4})-(\d{1,5})"],
"dh_no": [r"(\d{1,6})"],
"obs_no": [r"([a-zA-Z]{3})[ -]?(\d{1,3})"],
}
class UnitNo:
"""Parse a well unit number.
Arguments:
*args (str or int): either the compl... |
import os
import glob
import shutil
import math
import logging
import numpy as np
import pandas as pd
import xml.etree.ElementTree as etree
import sphere.IRDIS as IRDIS
import sphere.IFS as IFS
import sphere.SPARTA as SPARTA
from pathlib import Path
from astropy.io import fits
from astropy.time import Time
_log = lo... |
import unittest
from ethereum import utils
from ethereum.exceptions import InsufficientStartGas
from ethereum.tools.tester import TransactionFailed
import types
from utils.pyethereum_test_utils import PyEthereumHydraDeployment, PyEthereumTestCase, bytes_to_int, int_to_bytes
from utils.deployment import kall # todo cle... |
import discord
import os, os.path
from asyncio import sleep
from discord.errors import DiscordServerError, NotFound
from discord.ext import commands, tasks
from discord.utils import get
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix='.', intents=intents)
TOKEN = os.gete... |
#!/usr/bin/python3
__version__ = '0.0.1' # Time-stamp: <2021-09-26T02:57:23Z>
## Language: Japanese/UTF-8
"""Simulation Buddhism Prototype No.3 x.1 - Priesthood
僧職関連
"""
##
## Author:
##
## JRF ( http://jrf.cocolog-nifty.com/statuses/ (in Japanese))
##
## License:
##
## The author is a Japanese.
... |
# -*- coding: utf-8 -*
'''!
@file DFRobot_ENS160.py
@brief Define infrastructure of DFRobot_ENS160 class
@details This is a Digital Metal-Oxide Multi-Gas Sensor. It can be controlled by I2C and SPI port.
@n Detection of a variety of gases, such as volatile organic compounds (VOCs), including ethanol, ... |
import queue
import socket
import struct
import sys
import time
import threading
import numpy as np
import rclpy
from rclpy.node import Node
from angel_msgs.msg import (
ObjectDetection2dSet,
ObjectDetection3dSet,
SpatialMesh,
HeadsetPoseData
)
from angel_utils.conversion import to_confidence_matrix
fr... |
import argparse
import pickle
import torch.optim as optim
from time import time
from sklearn.externals import joblib
from collections import deque
from src.memory import *
from src.utils import *
from src.models import MDPnet
from src.config import hiv_config
from hiv_domain.fittedQiter import FittedQIteration
from s... |
# Copyright 2021 DeepMind Technologies Limited.
#
# 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 applicable law or agreed... |
#!/usr/bin/env python
#
# 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
# "... |
###############################################################################
# Copyright (c) 2007-2018, National Research Foundation (Square Kilometre Array)
#
# 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 ... |
# coding=utf-8
# Copyright 2021 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... |
'''
Created on Apr 1, 2016
@author: <NAME>
contact: <EMAIL>
'''
from tkinter import Tk, Frame, Canvas
import time
isScore = "null"
prevKey = ""
key = ""
# These two variable ensure that the two keys 'w' ands 's' cannot be pressed at the same time.
# Without these there is a glitch with movement of the paddle
wPres... |
"""Primary script for loading and parsing NTD data"""
import pandas as pd
from numpy import inf
from numpy import nan
from eia import gas_prices
from meta import clean_ta
from maintenance import load_maintenance
from population import get_population
from carto import replace_data
def filterByMode(dframe, modes):
... |
"""
To create a new `Calendar` you need to subclass it, then instanciate it with an `Era`.
A `Calendar` subclass has to have a name, a list of `Month` and an intercalation
method to be valid.
>>> class NewCal(Calendar):
... _name = "My New Calendar"
... _months = [Month(31, 32, "FirstMonth"),
... ... |
import json
import re
from collections import defaultdict
from urllib.parse import unquote
from d3b_utils.requests_retry import Session
def _undefault_dict(d):
if isinstance(d, dict):
d = {k: _undefault_dict(v) for k, v in d.items()}
if isinstance(d, set):
return sorted(d)
return d
clas... |
import psycopg2
import json
from microsetta_private_api.client.fundrazr import FundrazrClient
from microsetta_private_api.repo.base_repo import BaseRepo
from microsetta_private_api.model.campaign import Campaign, payment_from_db
from microsetta_private_api.exceptions import RepoException
class UnknownItem(psycopg2.e... |
import json
from inspect import isclass
from typing import TypeVar, Dict
from ajax_helpers.utils import random_string
from django.db import models
from django.db.models import Sum
from django.views.generic import TemplateView
from django.http import HttpResponse, JsonResponse
from django.template.loader import render_t... |
""" Cisco_IOS_XR_ncs1k_mxp_lldp_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR ncs1k\-mxp\-lldp package operational data.
This module contains definitions
for the following management objects\:
lldp\-snoop\-data\: Information related to LLDP Snoop
Copyright (c) 2013\-2016 by Cisco Sy... |
"""
Created on Mon Mar 11, 2019
Based on @nicola's ZigZag calculator: https://observablehq.com/d/51563fc39810b60d
@author: @redransil
"""
import math
import copy
from dataclasses import dataclass, replace
from util import humanize_bytes, humanize_seconds
KiB = 1024
MiB = 1024 * KiB
GiB = 1024 * MiB
TiB = 1024 * Gi... |
import os.path, json, io
import werkzeug
from flask_restful import Resource, reqparse, request
from app import app, api, geocache_db
from marshmallow import Schema, fields
from gpx import export_gpx, GpxImporter
from geocache_model_sql import Cache, Cacher, CacheType, CacheContainer, CacheCountry, CacheState, UserNote,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script Name: ImageViewer.py
Author: <NAME>/Jimmy - 3D artist.
Description:
This is UI which can view any type of image.
"""
# -------------------------------------------------------------------------------------------------------------
""" Import """
# Python
... |
# Project: hardInfo
# Author: <NAME>
# Date Started: March 18, 2022
# Copyright: (c) Copyright 2022 <NAME>
# Module: hardInfo.py
# Date Started: March 18, 2022
# Purpose: Run Linux commands and collect output into usable Python objects.
# Development:
# 2022-... |
#! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 <NAME> and <NAME>.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this work or any portio... |
import numpy as np
import cv2
import pandas
from os import walk
from os.path import basename, join, abspath, dirname, normpath, splitext
import inspect
from re import search
from .dataset import AbstractDataSet
from ..j_utils import log
from ..j_utils.function import match_params
from ..j_utils.collections import if_n... |
# -*- coding: utf-8 -*-
# Script for training a Neural Network for the framework Oya
import time
import random
import math
import time
import pickle
import json
import logging
import argparse
from NN import *
import torch
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
import bcolz
im... |
"""New syntax test file"""
import copy
from pathlib import Path
from subprocess import CompletedProcess
from typing import Dict, List, Optional
from git import Repo
from .command import run_command
from .file_system import create_file, is_directory_empty
from .formatting import remove_prefix
from .scenario_info impo... |
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import operator
import optparse
import os
import os.path
import sys
import time
import yaml
impor... |
"""
Mask R-CNN
Train on the toy cookies dataset to recognize 'lays' and 'doritos'.
Copyright (c) 2018 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples),... |
from xlcalculator.xlfunctions import engineering
from xlcalculator.xlfunctions.xlerrors import NumExcelError, ValueExcelError
from ..testing import Case, parametrize_cases, assert_equivalent
all_funcs = [
engineering.BIN2OCT,
engineering.BIN2DEC,
engineering.BIN2HEX,
engineering.OCT2BIN,
engineer... |
"""
Copyright @ 2013 <NAME>
The font info reads the .fontinfo and creates the layers, effects, and blends
.. py:attribute:: name = ''
The path of the font file. Relative paths are relative to the .fontinfo file. Supports .ttf files.
For a complete list of supported formats, see `Freetype2 <http://www.freetyp... |
# Copyright (c) 2022 <NAME>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import annotations
from typing import Any, NamedTuple
from abc import ABC,... |
"""
ymmmo `.-::::::-.`
dmmmy` .:////////////--.`
:hdddddddddddyo- dmmmmddddds -//////////////////:
smmmmmmmmmmmmmmmy` dmmmmmmmmmd` .//////::::::-. :////.
ymmmd::::::/smmmmo dmmmh::::-` -///. .///.
ymmmd `hmmmy... |
import discord
from discord.ext import tasks, commands
from dotenv import load_dotenv
from datetime import datetime, timezone
import json
import math
import os
from pathlib import Path
import requests
intents = discord.Intents.default()
intents.members = True
load_dotenv()
def admin_req():
def predicate(ctx):
... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
トーンマッピングの説明用の図を作るなど。
"""
# 外部ライブラリのインポート
import os
import numpy as np
import cv2
import matplotlib.pyplot as plt
from colour.models import eotf_ST2084, eotf_BT1886, oetf_ST2084
from colour.models import BT2020_COLOURSPACE, BT709_COLOURSPACE
from colour import RGB_lumi... |
"""
Module for the saving and loading of different data
"""
from __future__ import print_function, division
import os
import torch
import getpass
import numpy as np
import pickle
from models import ShallowNet
from tensorboardX import SummaryWriter
USE_NEW_NAMING_FORMAT = True
USERNAME = getpass.getuser()
OUTPUT_DIR ... |
"""
The main circular weighing routine and analysis routines and their associated helper functions
"""
import os
from time import perf_counter
from datetime import datetime
import numpy as np
from msl.io import JSONWriter, read
from .. import __version__
from ..routine_classes.circ_weigh_class import CircWeigh
from .... |
#! python3
from PyQt5 import QtGui, QtCore
#import PySide
#from pyqtgraph import QtGui, QtCore
import pyqtgraph as pg
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
app = QtGui.QApplication([])
class Curve():
def __init__ (self, filename):
self.filename = filename
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.