text stringlengths 3.07k 22.1k |
|---|
import cv2
import imutils
import numpy as np
from argparse import ArgumentParser
import csv
import os
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
parser = ArgumentParser(description='Ground truth data extractor for CPR assistant test videos.')
parser.add_argument('-i', '--input', dest='... |
import os
os.chdir(os.path.dirname(os.path.abspath(__file__)))
common_path = os.path.abspath("../..")
from os.path import expanduser
home_path = expanduser("~") + "/sacluster"
import sys
import json
sys.path.append(common_path + "/lib/others")
from config_function import set_parm, conf_pattern_main, conf_pattern_1,... |
import tensorflow as tf
import pandas as pd
import numpy as np
import gc, os, logging
from datetime import datetime
from .data_loaders import *
from ..align.util import no_weighted_adj, gcn_load_data
from .gcnload4ep import gcn_load_data as ep_load_adjmat
def reset_graph(model):
tf.keras.backend.clear_session()
... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Author : <NAME>
@Contact : <EMAIL>
@File : evaluate.py
@Time : 8/4/19 3:36 PM
@Desc :
@License : This source code is licensed under the license found in the
LICENSE file in the root directory of this source tree.
"""
import os
import... |
# -*- coding: utf-8 -*-
"""Collection of functions for the manipulation of time series."""
from __future__ import absolute_import, division, print_function
import itertools
import warnings
import mando
from mando.rst_text_formatter import RSTHelpFormatter
from tstoolbox import tsutils
from .. import plotutils
warn... |
from __future__ import annotations
from asyncio import sleep
from datetime import datetime
from typing import TYPE_CHECKING, List, NamedTuple, Optional, Union
from ulid import ULID
from .asset import Asset, PartialAsset
from .embed import SendableEmbed, create_embed
if TYPE_CHECKING:
from .file import File
... |
import networkx as nx
import numpy as np
import math
import re
import sys
from parity_game import parity_game
from bdd_provider import make_bdd
import logging
# Explicit parity game class provided by <NAME>. Used to convert from explicit to symbolic.
# This class is used because there is an existing parser for it to r... |
import os
import pytest
import tempfile
import pickle
import numpy as np
import pandas as pd
from ogusa.utils import CPS_START_YEAR
from ogusa.utils import comp_array, comp_scalar, dict_compare
from ogusa.get_micro_data import get_calculator
from ogusa import SS
from ogusa import TPI
TOL = 1e-5
CUR_PATH = os.path.abs... |
import copy
import itertools
import re
from abc import ABC, abstractmethod
from typing import Iterable, Type
from morelia.exceptions import MissingStepError
from morelia.i18n import TRANSLATIONS
PLACEHOLDER_RE = re.compile(r"\<(\w+)\>")
class Visitor(ABC): # pragma: nocover
@abstractmethod
def visit_featur... |
#
# Logging.py
#
# (c) 2020 by <NAME>
# License: BSD 3-Clause License. See the LICENSE file for further details.
#
# Wrapper for the logging sub-system. It provides simpler access as well
# some more usefull output rendering.
#
""" Wrapper class for the logging subsystem. """
import logging, logging.handlers, os, ins... |
#!/usr/bin/env python
from pathlib import Path
import os
import sys
import time
import json
import signal
import shutil
import random
import subprocess
import threading
import musicformat
class PlayerNotFound(Exception):
pass
class ProberNotFound(Exception):
pass
class Player:
def __init__(self, filen... |
import logging
import json
from botocore.exceptions import ClientError
from datetime import datetime, timedelta
from cloud_inquisitor.config import dbconfig
from cloud_inquisitor.plugins.types.accounts import AWSAccount
from cinq_auditor_required_tags.exceptions import ResourceKillError, ResourceStopError, ResourceA... |
import WebMirror.OutputFilters.FilterBase
import WebMirror.OutputFilters.util.MessageConstructors as msgpackers
from WebMirror.OutputFilters.util.TitleParsers import extractTitle
import bs4
import re
import markdown
import time
import datetime
import calendar
import WebRequest
from settings import WATTPAD_REQUIR... |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from collections import OrderedDict
from functools import reduce
from typing import Tuple, Union
import funsor.ops as ops
from funsor.cnf import Contraction, GaussianMixture
from funsor.constant import Constant
from funsor.delta impor... |
from ast import parse
import logging
from pathlib import Path
import pandas as pd
import pytest
from openghg.standardise.surface import parse_gcwerks
from helpers import get_datapath
mpl_logger = logging.getLogger("matplotlib")
mpl_logger.setLevel(logging.WARNING)
@pytest.fixture(scope="session")
def cgo_path():
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: convert_model.py
# Author: <NAME> <<EMAIL>>
# modified from:
# https://github.com/qqwweee/keras-yolo3/blob/master/convert.py
# reference:
# https://github.com/pjreddie/darknet/blob/b13f67bfdd87434e141af532cdb5dc1b8369aa3b/src/parser.c#L958
import io
impor... |
import datetime
from flask import render_template, request, redirect, url_for, flash, session, abort
from flask_login import current_user, login_user, logout_user, login_required
from sqlalchemy.orm import aliased
from werkzeug.security import generate_password_hash
from phonos import app, util, model
def admin_req... |
# coding=utf-8
# 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, software
# distr... |
# -*- coding: utf-8 -*-
import numpy as np
import operator
from collections import Counter
from mla.base import get_split_mask
from mla.base import split_dataset
from mla.base import mean_squared_error
from mla.base import squared_error
from mla.base import pGini
from mla.base import reshape_1d_to_2d
np_unique = np.lib... |
import pickle # 序列化库
import sys
from PyQt5.QtGui import QIcon, QPixmap
from PyQt5.QtWidgets import QApplication, QComboBox, QFileDialog, QLabel, QMessageBox, QProgressBar, QPushButton, \
QLineEdit, QVBoxLayout, QWidget, QHBoxLayout
class Node:
"""节点类"""
def __init__(self, character: int, weight: int):
... |
# -*- coding: utf-8 -*-
"""
Holds functions that compute implication covers for a given context
"""
import copy
import closure_operators
from fca.implication import Implication
import fca
from fca.concept_lattice import ConceptLattice
from fca.association_rule import AssociationRule
from fca.concept_link import Conce... |
import sys
import random
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from tqdm import tqdm
from fairseq.models.roberta import RobertaModel
from fairseq.data.data_utils import collate_tokens
import numpy as np
from sklearn.metrics import accuracy_score
from collections import defaultdict... |
import os
import logging
import hashlib
import requests
from lxml import etree
import common.hooks as hooks
from operations.exceptions import (
DeleteDocFromKernelException,
DocumentToDeleteException,
PutXMLInObjectStoreException,
ObjectStoreError,
RegisterUpdateDocIntoKernelException,
LinkDoc... |
import os
from src.Downloaders import *
def archiveUpdate(dirList=[],keep_text_format=False):
if not dirList:
dirList=os.listdir('./novel_list')
print("list=")
print(dirList)
for novel_folder in dirList:
print()
novelInfo=getNovelInfoFromFolderName(novel_folder)
#chan... |
#!/usr/bin/env python3
import math
from typing import Any, Callable, Tuple
import torch
import torch.nn.functional as F
from torch import Tensor
from ..._utils.common import _format_input, _is_tuple
from ..._utils.typing import TargetType, TensorOrTupleOfTensorsGeneric
from .._utils.attribution import GradientAttribu... |
# Copyright © 2019 Province of British Columbia
#
# 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 agr... |
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
import os
import datetime
import time
import sys
from att_blstm_architecture import BiLSTMAttention
from sklearn.metrics import f1_score
import prepare_data
import warnings
import sklearn.exceptions
warnings.filterwarnings("ignore", category=sklearn.exc... |
# -*- coding: utf-8 -*-
"""Module for tools for easing creating setup files"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from builtins impor... |
import requests
import joblib
import locale
import json
import os
from django.core.management.base import BaseCommand, CommandError
from datetime import datetime as dt
from bs4 import BeautifulSoup
import pandas as pd
from collections import defaultdict
from tqdm import tqdm
from nltk.corpus import stopwords
from accu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2015, <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/LICENSE-2.0
#
# Unless requ... |
import gzip
import os
from pkg_resources import iter_entry_points
from glob2.fnmatch import fnmatch
from .asset_attributes import AssetAttributes
from .assets import build_asset
from .cache import SimpleCache
from .compat import bytes
from .exceptions import FileNotFound
from .manifest import Manifest
from .processors... |
#!/usr/bin/env python3
import datetime
import hashlib
import json
import os
import re
import shutil
import signal
import socket
import sys
import traceback
from argparse import ArgumentParser
from importlib import import_module
from pprint import pprint
from time import sleep
import yaml
from bson.objectid import Obj... |
import nltk
import re
from flask import Flask, render_template, request
from nltk.tokenize import word_tokenize,sent_tokenize
from nltk.corpus import stopwords
import numpy as np
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from itertools import permutations
from sklearn.naive_bayes i... |
# -*- coding: utf-8 -*-
#
# This module is part of the GeoTag-X PyBossa plugin.
#
# Authors:
# - <NAME> (<EMAIL>)
# - <NAME> (<EMAIL>)
#
# Copyright (c) 2016 UNITAR/UNOSAT
#
# The MIT License (MIT)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documenta... |
#====================== BEGIN GPL LICENSE BLOCK ======================
#
# This program 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 2
# of the License, or (at your option) any later vers... |
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Time: 2021-11-19 11:15 上午
Author: huayang
Subject:
"""
import os # noqa
import doctest # noqa
from typing import *
# from itertools import islice
# from collections import defaultdict
from dataclasses import dataclass
# from tqdm import tqdm
import torch
from to... |
from aiogram import Bot, Dispatcher, executor, types
import Token
from threading import Thread
import time
import datetime
import asyncio
import requests
import aioschedule
bot = Bot(token=Token.token) #bot and its atributes declaration
dp = Dispatcher(bot)
usersNotifications = {}
@dp.message_handler(commands=['weath... |
"""Test the analog.utils module."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import datetime
import sys
import tempfile
try:
from unittest import mock
except ImportError:
import mock
import pytest
from analog import analyzer
from analog.excep... |
#==========================================
# Human Feedback Collection class
# Author: <NAME>
# Date: Dec. 2020
#==========================================
import numpy as np
import math
import tensorflow as tf
import tensorflow.contrib.slim as slim
import gym
from time import sleep
from datetime import datetime
im... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : datasets.py
@Time : 2021/05/15 09:28:00
@Author : <NAME>
@Version : 1.0
@Contact : <EMAIL>
@License : (C)Copyright 2021, SiPBA-BioSIP
@Desc : Archivo para cargar datasets a la manera de los chinos.
'''
import random
import os
import n... |
from geographiclib.geodesic import Geodesic
from LatLon23 import string2latlon, LatLon
from geomag import declination
import pandas as pd
from openpyxl import load_workbook
import numpy as np
import config
import pynmea2
import subprocess
import os
import xlrd
def Vector2Polar(N,E):
Mag = np.sqrt(N**2 + E**2)
... |
import os
import serial
import serial.tools.list_ports
from CRC import CRC
class InvalidSerialPort(Exception):
pass
CONTINUE = 2
NEW_DATA = 1
NO_DATA = 0
CRC_ERROR = -1
PAYLOAD_ERROR = -2
STOP_BYTE_ERROR = -3
START_BYTE = 0x7E
STOP_BYTE = 0x81
MAX_PACKET_SIZE = 0xFE
find_start_byte = 0
... |
# -*- coding: utf-8 -*-
from struct import pack
from . import op
from .op import u64
CB = [
u64(0x243f6a88, 0x85a308d3), u64(0x13198a2e, 0x03707344),
u64(0xa4093822, 0x299f31d0), u64(0x082efa98, 0xec4e6c89),
u64(0x452821e6, 0x38d01377), u64(0xbe5466cf, 0x34e90c6c),
u64(0xc0ac29b7, 0xc97c50dd), u64(0... |
import os
from flask import render_template, redirect, url_for, abort, flash, request,\
current_app, make_response
from flask_login import login_required, current_user
from flask_sqlalchemy import get_debug_queries
from werkzeug import secure_filename
from . import main
from .forms import EditProfileForm, EditProfi... |
#!/usr/bin/env python2 --
# -*- coding: utf-8 -*-
"""
Space Station 3-14
A Space Station 13 clone written for a real platform
Copyright (C) 2012, Abendsfrühstücken.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditi... |
import tvm
from graphviz import Digraph
from tvm.tensor_graph.core2.graph.concrete import Tensor, Operator
from tvm.tensor_graph.core2.graph.graph import Graph
class ModelVisualizer(object):
def __init__(self, name="model"):
self.name = name
self.visited = set()
self.graph = Digraph(name=... |
"""
This is the implementation of DeepLabv2 without multi-scale inputs. This implementation uses ResNet-101 by default.
"""
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch
import torch.nn.functional as F
from base import BaseModel
import numpy as np
affine_par = True
from model... |
import random
from functools import partial
from datasets import load_dataset, concatenate_datasets
# TODO: DatastreamGenerator/LifelongStreamer converts a normal dataset to datastream
# TODO: Enforce datastream Features to have context, statement, label
class LifelongDatasetInterface:
path: str
name: str
... |
import math
import torch
import torch.nn as nn
def get_normalization(name, channels):
if name == 'in': return nn.InstanceNorm2d(channels)
if name == 'bn': return nn.BatchNorm2d(channels)
raise Exception(f'no normalization as {name}')
def get_activation(name, inplace=True):
if name == 'lrelu': return ... |
"""
Module in charge of managing templates for submitting the executions
"""
import collections
import re
import glob
import itertools
import string
from os import path
from qmap.globals import QMapError
from qmap.file import jobs as jobs_file
from qmap.utils import read_file
class TemplateError(QMapError):
pass... |
from tabulate import tabulate
from collections import defaultdict
import json
import requests
import enum
class Role(enum.Enum):
OFFENSE = 0
DEFENSE = 1
SUPPORT = 2
TANK = 3
team_names = [
"<NAME>",
"<NAME>",
"<NAME>",
"L<NAME>",
"Los Angeles Gladiators",
"Los Angeles Valiant",
"Florida Mayhem",
"New Yor... |
'''
Created on May 23, 2014
@author: ania.fijarczyk
USAGE:
python mip_dbsnp.py
By default it reads all <name>.fasta and <chrfasta>.fa files in the directory
OUTPUT:
dbSNP.rod
Script reads fasta files with alignments (<file>.fasta) and fasta files with references (<chrfile>.fa) and creates simple dbSNP.rod file nece... |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# PyAgent.py
import Action
import Orientation
from queue import Queue
class Room:
# The agent correctly models the initial probabilities of Pits and Wumpus locations
def __init__(self):
self.pit = 0.2
self.wumpus = 0.06
self.visited = False
def setPit(self, pit):
self.pit =... |
import argparse
import os
import numpy as np
from collections import OrderedDict
import warnings
import shutil
from mypath import Path
from dataloaders import make_data_loader
from utils.calculate_weights import calculate_weigths_labels
from utils.metrics import Evaluator
from dataloaders.utils import decode_seg_map_s... |
#-*- coding:utf-8 -*-
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--
"""
ElasticSearch based search engine plugin.
Depends on a running ElasticSea... |
# ###########################################################################
#
# CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP)
# (C) Cloudera, Inc. 2021
# All rights reserved.
#
# Applicable Open Source License: Apache 2.0
#
# NOTE: Cloudera open source products are modular software products
# made up of hun... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
"""
MLR Curve Fitter.
<NAME>
10 June 2021
"""
import numpy as np
from scipy.optimize import leastsq
from scipy.stats import linregress
from scipy import interpolate, array
__all__ = ['poly2D', 'polyARI', 'do_stats', 'get_outlier',
'fit2D', 'fitARI', 'prep', 'CurveFit',
'poly2ARI', 'ari2Poly', 'Inte... |
"""
Compute global or local influence.
"""
import os
import sys
import time
import joblib
import argparse
import resource
from datetime import datetime
import numpy as np
from sklearn.base import clone
here = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, here + '/../../')
import intent
import util
fro... |
#!/usr/bin/env python
from __future__ import absolute_import
import datetime
import os
import re
import shutil
import sqlite3
import warnings
from subprocess import Popen, PIPE
from textwrap import dedent
from unittest import TestCase, main
import scraperwiki
import six
# scraperwiki.sql._State.echo = True
DB_NAM... |
# Copyright 2020 <NAME>.
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
from __future__ import print_function
import argparse
from parsimonious.grammar import Grammar
from parsimonious.nodes import NodeVisitor
# PEG ru... |
from typing import Tuple, Union, List, Optional, NoReturn
from dataclasses import dataclass
import re
import inspect
def strip(str) -> str:
return inspect.cleandoc(str)
class Scanner:
tokens = {
'keyword': r'IF|ELSE|ELIF|FOR|IN|END|SEPARATOR',
'open': r'(?<!{){(?!{)',
'close': r'(?<!... |
import requests
import datetime
import logging
import re
from lxml import html
from typing import Optional
import findpapers.utils.common_util as common_util
import findpapers.utils.query_util as query_util
from findpapers.models.search import Search
from findpapers.models.paper import Paper
from findpapers.models.publ... |
#
# The MIT License (MIT)
#
# This file is part of pairwiseMKL and RLScore
#
# Copyright (c) 2018 <NAME>, <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, includi... |
# Copyright (c) 2015-2019 by <NAME>
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program is distributed... |
import os
import time
import copy
import argparse
import math
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import SGD, Adam
from torch.optim.lr_scheduler import ReduceLROnPlateau
import torch.utils.data
import torch.backends.... |
from typing import Optional, Tuple
import dataclasses
import pandas as pd
import numpy as np
from covidactnow.datapublic.common_fields import CommonFields
from covidactnow.datapublic.common_fields import PdFields
from libs.datasets import taglib
from libs.datasets import timeseries
from libs.datasets import new_cases... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: leeyoshinari
import os
import json
import time
def generate_test_plan(plans):
var_str = ''
if plans.variables:
for variable in plans.variables:
var_str += '<elementProp name="%s" elementType="Argument"><stringProp name="Ar... |
from user_simulator import UserSimulator
from error_model_controller import ErrorModelController
from dqn_agent import DQNAgent
from state_tracker import StateTracker
import pickle, argparse, json, math
from utils import remove_empty_slots
from user import User
import numpy as np
#import class "UserSimulator"... |
import torch
import torch.nn as nn
import numpy as np
# NYU14_name_list = ['Unknown', 'Bed', 'Books', 'Ceiling', 'Chair',
# 'Floor', 'Furniture', 'Objects', 'Picture',
# 'Sofa', 'Table', 'TV', 'Wall', 'Window'
# ]
# Label11_name_list = ["None", "Ceiling", "Floor",... |
#!/usr/bin/python
'''
Author: <NAME>
Email: <EMAIL>
'''
from __future__ import print_function
from shutil import copyfile
import sys
import os
import struct
import abc
import argparse
import pefile
import pyinstxtractor
import uncompyle6
from unpy2exe import unpy2exe
DEV_NULL = open(os.devnull, "wb")
UNPACKED_FOLDER_... |
# -*- coding: utf-8 -*-
"""モジュール関連APIの実装."""
from typing import TYPE_CHECKING
from uuid import UUID
# community module
from flask import abort, current_app, request
# project module
from circle_core.models import MessageBox, MetaDataSession, Module, NoResultFound
from .api import api
from .utils import respond_failu... |
import sys
import os
import json
import yaml
import shutil
from sprite.atlas import Atlas
from sprite.component import SpriteComponent
from ascension.ascsprite import AscAnimation
from PIL import Image
class AscensionAtlas(Atlas):
def __init__(self, *args, **kwargs):
self.animations = {}
self.feat... |
"""
Pipeline for assigning a proof to a transformed tree and its subtrees.
"""
import pdb
from .mill.types import Type, Atom, Functor, Diamond, Box, Proof, T
from .transformations import DAG, is_ghost, node_to_key, get_material, find_coindexed
from .utils.viz import render
from functools import reduce
from typing... |
"""
Usage: import the module (see Jupyter notebooks for examples), or run from
the command line as such:
# Train a new model starting from pre-trained COCO weights
python3 camusLiteWithEva.py train --dataset=/path/to/camus/dataset --weights=coco
# Resume training a model that you had trained earli... |
import os
import time
import torch
import numpy as np
def env_factory(path, verbose=False, **kwargs):
from functools import partial
"""
Returns an *uninstantiated* environment constructor.
Since environments containing cpointers (e.g. Mujoco envs) can't be serialized,
this allows us to pass the... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from subprocess import check_output
from keras.models import Model
from keras.layers import Dense, Embedding, Input , Activation
from keras.layers import LSTM, Bidirectional, GlobalMaxPool1D, Dropout, GRU
from ker... |
"""
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import numpy as np
from astropy.utils.misc import NumpyRNGContext
__all__ = ('calculate_first_idx_unique_array_vals',
'calculate_last_idx_unique_array_vals', 'sum_in_bins',
'random_indices_within_bin', 'calculate_entry_... |
import os
import sys
import kivy
from kivy.animation import Animation
from kivy.app import App
from kivy.clock import Clock
from kivy.factory import Factory
from kivy.lang import Builder, Parser, ParserException
from kivy.properties import ObjectProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.codeinput... |
# -*- coding: utf-8 -*-
"""
This module defines base classes for desktop notifications. All platform implementations
must inherit from :class:`DesktopNotifierBase`.
"""
# system imports
import logging
from enum import Enum
from collections import deque
from typing import Optional, Dict, Callable, Any, Union, Deque, Li... |
# -*- coding: utf-8 -*-
import re
import statistics
import string
from spacy_affixes.utils import strip_accents
ASSONANT_RHYME = "assonant"
CONSONANT_RHYME = "consonant"
CONSONANTS = r"bcdfghjklmnñpqrstvwxyz"
UNSTRESSED_VOWELS = r"aeiou"
STRESSED_VOWELS = r"áéíóúäëïöü"
WEAK_VOWELS = r"iuïü"
STRONG_VOWELS = r"aeoáéó"
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 20 11:30:15 2020
@author: Chris
"""
import pickle
import numpy as np
from scipy.spatial import KDTree
from scipy.optimize import least_squares, differential_evolution, shgo, dual_annealing, minimize
from scipy import linalg
from mdma import atom... |
import torch
import pickle
import torch.utils.data
import time
import os
import numpy as np
from scipy.spatial.distance import pdist, squareform
import itertools
from torch.utils.data import Dataset
import csv
import dgl
from scipy import sparse as sp
import numpy as np
import networkx as nx
import hashlib
import p... |
import ctypes
import signal
import sys
WINDOW_NAME = "MapleStory2 - A New Beginning"
TRUE = 1
FALSE = 0
WH_KEYBOARD_LL = 13
WM_KEYUP = 0x0101
VK_F10 = 0x79
INPUT_KEYBOARD = 1
KEYEVENTF_SCANCODE = 0x0008
KEYEVENTF_KEYUP = 0x0002
WM_QUIT = 0x0012
DIK_SPACE = 0x39
WORD = ctypes.c_ushort
DWORD = ctypes.c_ulong
UINT = ct... |
import numpy as np
import pandas as pd
pd.set_option('display.max_columns', None)
pd.set_option("display.precision", 2)
import io
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from sklearn.preprocessing import LabelEncoder
from keras.utils import np_utils
import warnings
clas... |
# -*- coding: utf-8 -*-
import torch.nn as nn
import torch
import random
from time import time
import sys
import numpy as np
import cv2
import torch.nn.functional as F
'''
=============================
======= Train utils =========
=============================
'''
def set_requires_grad(nets, requ... |
import os
import pytest
import random
from pathlib import Path
from typing import Dict, Optional
from commodore.inventory import parameters
from commodore.helpers import yaml_dump
GLOBAL_PARAMS = {
"components": {
"tc1": {
"url": "tc1",
"version": "gp",
},
"tc2": {... |
# Virtual memory analysis scripts.
# Developed 2012-2014 by <NAME>, <EMAIL>
# Copyright (c) 2012-2014 <NAME> and University of Washington
from plotting.multiapp_plot_class import *
from util.pjh_utils import *
from plotting.plots_common import *
import trace.vm_common as vm
###########################################... |
# Copyright (c) 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 agreed... |
import torch
from torch.utils.data import TensorDataset, RandomSampler, DataLoader,SequentialSampler
from transformers import BertTokenizer, BertConfig, BertForSequenceClassification, AdamW, get_linear_schedule_with_warmup
from keras.preprocessing.sequence import pad_sequences
from tqdm import tqdm, trange
import os
... |
"""
Scanline Sound Event Detection inference program
Written by <NAME> in 2021
(github.com/bendikbo) (<EMAIL>)
Feel free to reuse, but let a brother get in them mentions
The main idea of the inference stuff is to do n hops per
classifying window. Meaning that each "subwindow" has n
classifications made on it, and then... |
# 본 í”„ë¡œê·¸ëž¨ì€ jetbot ë”¥ëŸ¬ë‹ í•™ìŠµëª¨ë¸ ìˆ˜ì§‘ì„ ìœ„í•´ '임종한(<EMAIL>)'ì´ ê°œë°œí•˜ì˜€ìŠµë‹ˆë‹¤.
# ì´ í”„ë¡œê·¸ëž¨ì˜ ì‹¤í–‰ì—는 2ê°œì˜ ì¹´ë©”ë¼ê°€ 달린 jetbotì— ê°ê°ì˜ 주행 ì˜ìƒì´ 1000ê°œ 달성시 완료가 ë˜ê²Œ ë˜ì–´ 있습니다.
# ì´ ì˜ìƒì˜ 갯수는 tot_count ì—서 수ì ... |
from GNN.layer import *
from GNN.graph import *
from GNN import distributed
from GNN.distributed.sampler import DistributedGraphSageSampler
from athena import ndarray, optimizer
from athena import gpu_ops as ad
from athena import dataloader as dl
from athena.communicator.mpi_nccl_comm import ncclDataType_t, ncclRedOp_... |
import base64
import piqi
# state
#
# TODO, XXX: wrap in a Parser class?
# NOTE: there is no location info in Python's decoded json objects
#
# XXX: provide some other form of context like path, e.g. foo[3].bar ?
class ParseError(Exception):
def __init__(self, error):
self.error = error
# top-level c... |
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License 2.0.
# Copyright 2020 Datadog, Inc. for original work
# Copyright 2021 GraphMetrics for modifications
"""Tests for DDSketch"""
from abc import ABC, abstractmethod
from collections import Counter
from unittest imp... |
#!/usr/local/bin/python2.7
#coding=utf-8
#__author__ = 'wangliang'
from flask import Flask
import re
import urllib2
import json
import time
import cookielib
import traceback
import os
import socket
from flask import Flask
app = Flask(__name__)
timertmp = time
#设置连接超时时间
socket.setdefaulttimeout(5)
#重写重新定向类(禁止重定向)... |
import argparse
import glob
import json
import logging
import math
import os
import time
from collections import OrderedDict
import cv2
import numpy as np
import onnxruntime as nxrun
import torch
import _init_paths
from config import cfg, update_config
from models.decode import multi_pose_decode
from models.model imp... |
import os
# Let's clean it up (or refactor), and create a function to ask for your name and return it.
# This will keep main() as clean as possible.
# New code starts at line 147
#
# Run this code a few times and see what happens with different choices.
# It's good to test all options and see if that's what you expecte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.