text stringlengths 3.07k 22.1k |
|---|
from jumpscale.loader import j
from jumpscale.packages.auth.bottle.auth import get_user_info
import gevent
def _filter_data(deployment):
status = "Running"
conditions = deployment["status"].get("conditions", [])
for status_obj in conditions:
if status_obj["status"] == "False":
status =... |
# --------------------------------------------------------
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import _init_paths
from torch.utils.data import Dataset, DataLoader
from torchv... |
"""The KVNDB Router coordinates the databases and requestss"""
import struct
import random
from twisted.internet.protocol import Factory
from twisted.internet.defer import inlineCallbacks, Deferred
from twisted.python.failure import Failure
from twisted.python import log
from twisted.protocols.basic import IntNString... |
# custom wrappers around ops
from nvidia.dali import backend as _b
import inspect
def _check_data_batch(data, batch_size, layout):
if isinstance(data, (list, tuple)):
if len(data) != batch_size:
raise RuntimeError("The external source callback returned an unexpected batch "
"size: {... |
import logging
import subprocess
import os
import stat
from dataflows import Flow, load, update_resource, sort_rows, printer
from dataflows.processors.dumpers.to_path import PathDumper
import datetime
from glob import glob
import hashlib
import json
import requests
from ruamel import yaml
HASH_BLOCKSIZE = 65536
HASH_... |
# pylama:skip=D400
#!/usr/bin/env python
"""Utilities for working with Revit shared parameter files
Usage:
rsparam (-h | --help)
rsparam (-V | --version)
rsparam (-W | --writerversion)
rsparam [-q -e <encod>] list [-a -s <sort_by> -c <columns> -o <out_file>] <src_file>
rsparam [-q -e <encod>] list ... |
r"""Structural Similarity (SSIM) and Multi-Scale Structural Similarity (MS-SSIM)
This module implements the SSIM and MS-SSIM in PyTorch.
Wikipedia:
https://en.wikipedia.org/wiki/Structural_similarity
Credits:
Inspired by [pytorch-msssim](https://github.com/VainF/pytorch-msssim)
References:
[1] Image qua... |
# makur, utils
import glob
import os
import random
import numpy as np
import io_util
# import das_util
def shuffle_indices(indice):
indice_tuple_list = []
for k in indice.keys():
for v in indice[k]:
indice_tuple_list.append((k, v))
# data_num = len(indice_tuple_list)
random.shu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020-09-04 9:40
# @Author : NingAnMe <<EMAIL>>
"""
数据解析
数据匹配
回归图
偏差图
分布图
时间序列图
"""
from datetime import datetime
from dateutil.relativedelta import relativedelta
from collections import defaultdict
import os
import numpy as np
import pandas as pd
from lib.v... |
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from fimdpenv.UUVEnv import SingleAgentEnv
from fimdp.core import CounterStrategy
from fimdp.energy_solvers import GoalLeaningES, BasicES
from fimdp.objectives import AS_REACH, BUCHI, MIN_INIT_CONS, POS_REACH, SAFE
import matpl... |
"""
==========================
readthestuff.subscriptions
==========================
Parsing subscriptions from OPML files and storing subscriptions to datastore.
"""
import logging
import operator
import time
from collections import defaultdict
from lxml import etree
from psycopg2 import Error as DatabaseError, P... |
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import backend as K
from keras_cv_attention_models.attention_layers import (
batchnorm_with_activation,
conv2d_no_bias,
depthwise_conv2d_no_bias,
drop_block,
layer_norm,
RelativePositionalEmbedding,
)
def light_multi_he... |
# -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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
#
#... |
import torch
from torch import nn
from torch.nn import functional as F
from torchvision.models.segmentation._utils import _SimpleSegmentationModel
from model.san import Subtraction, Subtraction2, Aggregation, position
__all__ = ["DeepLabV3_SAN"]
class DeepLabV3_SAN(_SimpleSegmentationModel):
"""
Implements D... |
#!/usr/bin/env python
# encoding: utf-8
"""
pyscribe.py
Copyright (c) 2014 <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 u... |
'''
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2017 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
-----------------------------------... |
#!/usr/bin/env python3
import sys
import time
import gzip
import pickle
import trie
import cmd
import os
from subprocess import Popen, PIPE
def zcat(filename):
with Popen("zcat " + filename, shell=True, stdout=PIPE, bufsize=10485760) as pipe:
for line in map(lambda x: x.decode("utf8").strip(), pipe.stdou... |
"""Server-end for the ASR demo."""
import os
import json
import subprocess
import time
import random
import argparse
import functools
from time import gmtime, strftime
import struct
import wave
import paddle.fluid as fluid
import numpy as np
import _init_paths
from data_utils.data import DataGenerator
from model_utils.... |
from enum import unique
from itertools import count
from typing import List
import open3d as o3d
import numpy as np
import cv2
def to_rgb(bgr):
return cv2.cvtColor(bgr, cv2.COLOR_BGR2RGB)
def to_bgr(rgb):
return cv2.cvtColor(rgb, cv2.COLOR_RGB2BGR)
# this format to make open3d objects pickable
zv_ci = dict(... |
#---- Code Surveyor, Copyright 2020 <NAME>, MIT License
'''
ConfigStack
Encapsulation of config file use and caching
'''
import os
from code_surveyor.framework import log # No relative path to share module globals
from . import surveyor_dir
from . import runtime_dir
from . import configentry
from . import co... |
# *=========================================================================
# *
# * Copyright Erasmus MC Rotterdam and contributors
# * This software is licensed under the Apache 2 license, quoted below.
# * Copyright 2019 Erasmus MC Rotterdam.
# * Copyright 2019 <NAME> <<EMAIL>>
# * Licensed under the Apache L... |
from json import encoder
import bs4
import logging
import json
import requests
from requests.api import request
from datetime import date, datetime
import typing
logging.basicConfig(level=logging.DEBUG)
BASE: str = "https://www.vlr.gg/"
MATCHES: str = "matches/"
RANKINGS: str= "rankings/"
NEWS: str = "news/"
FORUMS... |
from __future__ import unicode_literals
import re
import os
from datetime import datetime
from werkzeug.utils import secure_filename
from wtforms import widgets, Field, StringField
from mongoengine import *
from flask_mongoengine.wtf import model_form
from core.constants import STORAGE_ROOT
from core.helpers import ... |
import os
import os.path
from glob import glob
import json
import torch
from .hourglass import hg
from .utils import convert_state_dict
import hashlib
import tempfile
import sys
import shutil
import re
if sys.version_info[0] == 2:
from urlparse import urlparse
from urllib2 import urlopen
else:
... |
from sqlalchemy import *
from sqlalchemy import event
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relation, backref, sessionmaker, scoped_session
from sqlalchemy.ext.associationproxy import association_proxy
import calendar
import numbers
import re
import time
import threading
T... |
import os
import re
import unyt as u
from sympy import sympify
from lxml import etree
from gmso.core.atom_type import AtomType
from gmso.core.bond_type import BondType
from gmso.core.angle_type import AngleType
from gmso.core.dihedral_type import DihedralType
from gmso.exceptions import ForceFieldParseError, ForceFie... |
import contextlib
import json
import logging
import os
import shutil
import subprocess
from datetime import datetime
from cumulusci.core.config import OrgConfig, TaskConfig
from cumulusci.core.runtime import BaseCumulusCI
from cumulusci.oauth.client import OAuth2Client, OAuth2ClientConfig
from cumulusci.oauth.salesfor... |
#!/usr/bin/env python3
"""Firebase Admin SDK ML quickstart example."""
import argparse
from datetime import datetime
from datetime import timezone
from beautifultable import BeautifulTable
import firebase_admin
from firebase_admin import ml
# TODO(user): Configure for your project. (See README.md.)
SERVICE_ACCOUNT_... |
#!/usr/bin/env python3
# Copyright (c) 2021 <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, merg... |
import string
def load_words(file_name):
'''
file_name (string): the name of the file containing
the list of words to load
Returns: a list of valid words. Words are strings of lowercase letters.
Depending on the size of the word list, this function may
take a while to... |
from colors import *
import discord
import sys
import os.path
import random
from os.path import expanduser
import asyncio
from game_carrot import game_carrot
from game import *
import traceback
# fill in your user id here to get stacktraces pinged to you
OWNER_ID = 0000000000000000
# fill in your server id here
SERVE... |
#%%
import streamlit as st
# To make things easier later, we're also importing numpy and pandas for
# working with sample data.
import numpy as np
import torch
import pandas as pd
from pytorch_transformers import BertTokenizer, BertModel
from keras.preprocessing.sequence import pad_sequences
import sys
from nltk.corpu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# viewer.py - View aggregated i2p network statistics.
# Author: <NAME> <<EMAIL>>
# License: This is free and unencumbered software released into the public domain.
#
# NOTE: This file should never write to the database, only read.
import argparse
import datetime
import m... |
# Copyright 2021 IBM 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 agreed t... |
import time
import dateparser
import pytz
import json
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import matplotlib.dates as mdates
import mpl_finance #import candlestick_ohlc
from datetime import datetime
from binance.client import Client
from myBinanceKeys import... |
"""
CISC455 Final Project
Fitness Evaluation Module
<NAME> 20119074
"""
# My module imports
import representation
# Python module imports
import random
import copy
"""
Function for simulating a battle between two individuals and determining the winner.
Params:
-indv0 : Strategy : The first individual competi... |
"""
COPYRIGHT © 2018 BY DATAQ INSTRUMENTS, INC.
!!!!!!!! VERY IMPORTANT !!!!!!!!
!!!!!!!! READ THIS FIRST !!!!!!!!
This program works only with the following models:
DI-1120, -2108, -4108, -4208, AND -4718B
Any other instrument model should be disconnected from the PC
to prevent the progra... |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 ... |
import smart_imports
smart_imports.all()
class CalculatePowerFractionsTests(utils_testcase.TestCase):
def test_no_powers(self):
self.assertEqual(logic.calculate_power_fractions({}), {})
def test_no_negative_powers(self):
self.assertEqual(logic.calculate_power_fractions({1: 10 * 2,
... |
# Cloudera Airflow Provider
# (C) Cloudera, Inc. 2021-2021
# All rights reserved.
# Applicable Open Source License: Apache License Version 2.0
#
# NOTE: Cloudera open source products are modular software products
# made up of hundreds of individual components, each of which was
# individually copyrighted. Each ... |
import numpy as np
import pytest
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from copulae import ClaytonCopula
DP = 3
@pytest.fixture
def copula(residual_data: np.ndarray):
dim = residual_data.shape[1]
cop = ClaytonCopula(dim=dim)
cop.params = 0.3075057
return cop
@pyt... |
from enum import Enum
import torch.nn as nn
import torch.nn.functional as F
import torch
import os
from adv_train.model.dataset import DatasetType
from adv_train.utils import Flatten
class MnistModel(Enum):
MODEL_A = "modelA"
MODEL_B = "modelB"
MODEL_BBis = "modelBBis"
MODEL_C = "modelC"
MODEL_D =... |
"""
Author: <NAME>
Date: May 2018
All the functions required for offline and online training of Deeplab Resnet for MaskTrack method
"""
import numpy as np
import scipy.stats as scipystats
import torch.nn as nn
import torch
import os
import matplotlib.pyplot as plt
import scipy.misc as sm
import cv2
import random
d... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Här längst upp är modellen som använder sig
av SEIR metoden, alltså den vi fick av GS-duden
"""
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt
# describe the model
def deriv(y, t, N, beta, gamma, delta):
S, E,... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import matplotlib.pyplot as plt
class SimulationDatasetHelper(object):
def __init__(self, data):
self.data = data
self.time = 'time'
self.time = 'time'
self.gt_x = '_bicycle_odom_rear_wheel.pose.pose.position.x... |
from helper import *
from run import Runner, Learn
from IPython.core.debugger import set_trace
from torch import tensor, nn, optim
from callback import *
import torch
import torch.nn.functional as F
from mask import randomShape,swastik,star,circle,oval,firstLayerMasking,secondLayerMasking,thirdLayerMasking
from torch.n... |
"""
Created on 8/27/20
@author: <NAME>
"""
from platform import python_version
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import time
import math
import sklearn
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import mean_squared_error
from statistics import mean
import... |
# coding: UTF-8
import os
import json
import re
# in_path = r"D:\work\law_pre\test\in"
# out_path = r"D:\work\law_pre\test\out"
in_path = r"/disk/mysql/law_data/formed_data"
out_path = r"/disk/mysql/law_data/critical_data"
mid_text = u" _(:з」∠)_ "
title_list = ["docId", "caseNumber", "caseName", "spcx", "court", "t... |
import json
import re
from pprint import pprint
from rasa.nlu.model import Interpreter
from LDA.LDA_classifier import LDAClassifier
def calculate_precision_recall_intent(tp_counter_list, fp_counter_list, fn_counter_list):
# precision = tp/(tp+fp)
# recall = tp/(tp+fn)
# f1 = 2 * precision * recall / (pr... |
# Modifications Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# This script reuses code from https://github.com/nlpyang/Presumm
"""
The BertSum models for both extractive and abstractive summarization.
"""
import sys
import copy
import torch
import torch.nn as nn
from transformers import Ber... |
import os
from copy import copy
from functools import partial
from cached_property import cached_property
from tkinter import *
from data.configurations import ConfigurationManager
from graphics.calibrate.screen import CalibrationScreen, \
DifferentialPressureCalibration, OxygenCalibration
from graphics.imageb... |
# Author: <NAME> <<EMAIL>>
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
import pytest
from scipy import signal
from eelbrain import (
NDVar, Case, Scalar, UTS, datasets,
concatenate, convolve, correlation_coefficient, cross_correlation,
cwt_morlet, find_intervals, find_p... |
__copyright__ = "Copyright (C) 2018 CVision AI."
__license__ = "GPLv3"
# This file is part of OpenEM, released under GPLv3.
# OpenEM 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 Lice... |
#!/usr/bin/env python
# GTK Interactive Console
# (C) 2003, <NAME>
# See www.python.org/2.2/license.html for
# license details.
#
import gtk
import gtk.gdk
import code
import os, sys
import pango
import __builtin__
import __main__
banner = """GTK Interactive Python Console
Thanks to <NAME>
%s
""" % sys.version... |
import itertools
import os
from collections import Counter
from multiprocessing import Pool
from dataset.py150.utils import py150_util
from ncc import LOGGER
from ncc import tasks
from ncc.data import (
indexed_dataset,
constants,
)
from ncc.data.completion.completion_binarizer import CompletionBinarizer as Bi... |
import os
import itertools
import operator
import numpy as np
import pickle
import faiss
import datetime
from natsort import natsorted, ns
# internal imports
from . import featurevectors
from . import video_functions
from . import evaluation
def max_two_values(d):
"""
a) create a list of the dict's keys and ... |
# Copyright 2018 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 required by applica... |
"""
====================
Surface registration
====================
Example of a diffeomorphic matching of surfaces using varifolds metrics:
We perform an LDDMM matching of two meshes using the geodesic shooting algorithm.
"""
####################################################################
# Define our dataset
... |
#!/usr/bin/env python3
# Copyright (c) 2019 <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, merg... |
from math import ceil, sqrt
import random
import pdb
import datetime
# User defined imports, import by file-name
# Classes can be imported with Capital letters
from classes_oop import Agent, Circle
import file_one
# Functions
print("Fibobacci series")
def fib(n): # write Fibonacci series up to n
a, b = 0, 1
... |
"""Defines Blink cameras."""
from shutil import copyfileobj
import logging
from blinkpy import api
from blinkpy.helpers.constants import TIMEOUT_MEDIA
_LOGGER = logging.getLogger(__name__)
class BlinkCamera:
"""Class to initialize individual camera."""
def __init__(self, sync):
"""Initiailize Blink... |
"""
Device aliases allow the USB device tree to identify a node with a
label associated with the physical device.
This module provides the capabilities to identify particular
nodes for visualization as well as selection of nodes as
needed for device control.
The selectors implement here are influenced by XPath.
Co... |
# Start a new logging session.
#
# If logger is already running, it offers the option to stop it first.
# If logger memory is not empty, it won't start a new session unless it's wiped.
# If logger memory is empty, it no longer prompt for wiping memory.
# It sets the logger's clock before logging.
#
# TODO:
# get cali... |
################################################################################
# #
# spackle.py #
# thin wrappers around Spack cmd lines to expose operations we need ... |
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import pandas as pd
from anacode.agg import aggregation as agg
@pytest.fixture
def frame_absa():
ent_header = ['doc_id', 'text_order', 'entity_name', 'entity_type',
'surface_string', 'text_span']
ents = pd.DataFrame([
[0, 0, 'L... |
""" Utilities for working with BNGL models
:Author: <NAME> <<EMAIL>>
:Date: 2021-04-05
:Copyright: 2021, Center for Reproducible Biomedical Modeling
:License: MIT
"""
from ...sedml.data_model import ( # noqa: F401
SedDocument, ModelAttributeChange, Variable, Symbol,
Simulation, OneStepSimulation, UniformTime... |
import copy, pickle
from infi.pyutils.enums import Enum, Value, ALL, UnboundException
from .test_utils import TestCase
LATEST = '1000000.0'
class VersionedValueTest(TestCase):
def test_non_versioned_value(self):
versioned_value = Value('avg', ['AVERAGE', 'average', 'Average'])
assert versioned_val... |
# ---------------------------------------------------------------
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the NVIDIA Source Code License for
# CLD-SGM. To view a copy of this license, see the LICENSE file.
# ---------------------------------------------------------... |
import random
from flask import *
from Api import *
from Api.models import Movie, MovieSchema, Data, DataSchema, Friend, Users, Exciting, Store, UserRating
from flask_cors import cross_origin
from functools import wraps
import jwt
from Api.ext import token_required
api = Blueprint('api', __name__)
@api.r... |
import torch
from torch.utils.data import DataLoader
import os
import time
from tqdm import tqdm
from transformers.optimization import AdamW, get_linear_schedule_with_warmup
from . import tokenizer as token_util
import configparser
config = configparser.ConfigParser()
device, max_contexts_length, max_candidate_length,... |
#Version 8/7/20
import pandas as pd
import numpy as np
#Import JDL utility modules
import sys
sys.path.append(sys.path[0])
import pd_util
import util
#graphlet_plot.py
class Graphlet():
"""
Set attributes common to Categorical and Continuous plots. Parent of
GraphletCategorical and GraphletContinuous
... |
"""
Fits many 6D Gaussians to Gaia background catalogue using
a simple Expectation Maximisation algorithm
"""
from __future__ import print_function, division
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import logging
import numpy as np
import pdb
import time
import sys
sys.path.insert(0, ... |
import pytest
import requests
import random
import os
import sys
import json
import queue
import multiprocessing as mp
import pydub
from configparser import ConfigParser
from helpers import MockingFunction
from flask import Flask
my_path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, my_path + '/../')... |
#!/usr/bin/env python3
import math
import numpy as np
from common.numpy_fast import interp
import cereal.messaging as messaging
from common.conversions import Conversions as CV
from common.filter_simple import FirstOrderFilter
from common.realtime import DT_MDL
from selfdrive.modeld.constants import T_IDXS
from selfdr... |
from __future__ import absolute_import, division, print_function
import os
import time
import types
import collections
import cv2
import numpy as np
import pandas as pd
from logzero import logger
import lego
import ikea
from rmexp import client, schema, utils
from rmexp.client import dutycycle
class Sensor(object)... |
# -*- coding: utf-8 -*-
"""
@author: Daan
Analyzes the structure of a MARC thesaurus. Finds invalid 550 tags, the range of dates in which the concepts are created, the duplicate labels and orphan concepts.
Results are exported to a text file, the invalid 550 tags are exported to a csv based on the invalid code.
"""
i... |
#
# anim_svg.py: render/animate PhysiCell .svg files, using left/right arrows on keyboard
#
# Usage:
# python anim_svg.py <show_nucleus start_index axes_min axes_max>
# i.e., the arguments <...> are optional and have defaults.
#
# Keyboard arrows: right/left arrows will single step forward/backward; up/down will ... |
"""Support to interface with the Plex API."""
from __future__ import annotations
import logging
from homeassistant.components.media_player import BrowseMedia
from homeassistant.components.media_player.const import (
MEDIA_CLASS_ALBUM,
MEDIA_CLASS_ARTIST,
MEDIA_CLASS_DIRECTORY,
MEDIA_CLASS_EPISODE,
... |
import copy
import glob
import os
import time
import types
from collections import deque
import gym
import gym_miniworld
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import algo
from arguments import get_args
from envs import make_vec_envs
from mode... |
# Author: <NAME>
# Warsaw University of Technology
# Train on Oxford dataset (from PointNetVLAD paper) using BatchHard hard negative mining.
import os
from datetime import datetime
import numpy as np
import torch
import pickle
import tqdm
import pathlib
from torch.utils.tensorboard import SummaryWriter
from eval.ev... |
"""Flow Graph Transformation
The difference between simplification and transformation is that
transformation is based on annotations; it runs after the annotator
completed.
"""
from rpython.flowspace.model import (
SpaceOperation, Variable, Constant, Link, checkgraph)
from rpython.annotator import model as annmod... |
# Copyright 2020 University of New South Wales, University of Sydney, Ingham Institute
# Licensed under the MIT Licence;
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONIN... |
"""将教务处的表格处理为可供后端调用的 json 文件"""
from __future__ import annotations
import argparse
import json
import re
import xlrd
from typing import List, Set, Dict, Tuple
from collections import defaultdict
class Classroom(object):
def __init__(self, sheet: xlrd.sheet.Sheet, start_row: int):
subtitle = sheet.row_va... |
# -*- coding: utf-8 -*-
from pysignfe.corr_unicode import *
from pysignfe.xml_sped import *
from pysignfe.cte.v300 import ESQUEMA_ATUAL
import os
from .CTe_300 import CTe
DIRNAME = os.path.dirname(__file__)
class InfInutEnviado(XMLNFe):
def __init__(self):
super(InfInutEnviado, self).__init__()
... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import logging
import time
import os
import json
import torch
from tqdm import tqdm
from maskrcnn_benchmark.config import cfg
from maskrcnn_benchmark.data.datasets.evaluation import evaluate
from ..utils.comm import is_main_process, get_world_siz... |
from pytz import timezone
from urlparse import urljoin
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.core.validators import MaxLengthValidator, MinLengthValidator
from d... |
"""
Module to define classes in use by the TCP/IP stack
"""
from struct import unpack
import socket
IP_PROTOCOL = 8
TCP_PROTOCOL = 6
TCP_FLAG_PUSH = 8
OF_HEADER_SIZE = 8
class L1:
"""
Class to dissect L1 fields
"""
def __init__(self):
self.caplen = None
self.truncate = None
... |
# -*- coding: utf-8 -*-
# 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 Apach... |
"""
Windows used with the roster (window displaying the contacts, and the
one showing detailed info on the current selection)
"""
import logging
log = logging.getLogger(__name__)
from datetime import datetime
from typing import Optional, List, Union, Dict
from poezio.windows.base_wins import Win
from poezio import c... |
from collections import Counter
from functools import partial
from random import Random
import pytest
from plenum.common.messages.internal_messages import NeedViewChange
from plenum.common.messages.node_messages import ViewChange, NewView
from plenum.server.consensus.batch_id import BatchID
from plenum.server.consens... |
# coding=utf-8
from django import forms
from django.contrib.auth.models import Group, User
from django.contrib.auth.forms import UserChangeForm
from models import Customer, CustomerIp, CustomerDomain, CustomerMailbox, Cluster, ClusterIp, IpPool, CUSTOMER_STATUS, \
RouteRule, CustomerSetting, MyPermission, ColCusto... |
import sys
import os
sys.path.append('../..')
sys.path.append('../')
import numpy as np
import gpsig
import pandas as pd
from scipy.io import loadmat
from sklearn.preprocessing import StandardScaler, RobustScaler
from sklearn.model_selection import train_test_split
# from tslearn.datasets import UCR_UEA_datasets
# fro... |
import os
import numpy as np
import collections
import matplotlib.pyplot as plt
from shapely.geometry import Polygon
from shapely.validation import make_valid
import csv_utils
import rect
import mask
def bbox_iou(bbox1, bbox2):
"""
calculate the iou between bbox1 and bbox2
arguments:
bbox1: an ar... |
# -*- coding: utf-8 -*-
from django.core import validators
from django.db import models
from django.utils import six
from django.utils.translation import ugettext_lazy
from modelcluster.fields import ParentalKey
from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel, FieldRowPanel, InlinePanel, Stre... |
import numpy as np
import pandas as pd
import copy
import re
from collections import defaultdict
from matplotlib import pyplot as plt
import sklearn
from sklearn.cluster import AgglomerativeClustering, DBSCAN, OPTICS
from sklearn.metrics.pairwise import euclidean_distances
from eval_functions import strdistance, _iou_s... |
#!/usr/bin/python3
import unittest
from freeverse import SpecFor, Should, Expect, It, FlatOutput
from freeverse.freeverse import Verify, Phrase
class ShouldTests(unittest.TestCase):
def test_adds_should_to_beginning_of_test_step_description(self):
should = Should('be true', It.should_be(True))
te... |
import os
import json
from typing import Union, List, Dict
import transformers
import torch
from tqdm.auto import tqdm
from . import utils
def _select_device(device_selection):
selected = device_selection.lower()
if selected == "auto":
device = torch.device("cuda" if torch.cuda.is_available() else "... |
# Licensed to libcloud.org under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-10-07 21:33:18
# @Author : ${<NAME>} (${<EMAIL>})
# @Link :
# @Version : ${1.0.0}
import random
import requests
from pyquery import PyQuery as pq
GET_URL = "http://127.0.0.1:5010/get/"
DELETE_URL = "http://127.0.0.1:5010/delete/?proxy=... |
"""
Code from
"Two-Stream Aural-Visual Affect Analysis in the Wild"
<NAME> and <NAME> and <NAME>
Please see https://github.com/kuhnkeF/ABAW2020TNT
"""
# this script will create a database folder including the
# cropped and aligned, and mask images
# audio files, and a metadata file
# that will be used to output test an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.