text stringlengths 8.04k 46.5k |
|---|
import collections
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from realcomp.task import config
from torch.distributions import Normal
# from matplotlib import pyplot as plt
class ModelActor(nn.Module):
def __init__(self,
size_obs=13,
num... |
# -*- coding: utf-8 -*-
""" Deeplabv3+ model for Keras.
This model is based on:
https://github.com/bonlime/keras-deeplab-v3-plus
# Reference
- [Encoder-Decoder with Atrous Separable Convolution
for Semantic Image Segmentation](https://arxiv.org/pdf/1802.02611.pdf)
- [Xception: Deep Learning with Depthw... |
import warnings
warnings.filterwarnings('ignore')
import keras
import math
import pandas as pd
from keras.models import Sequential
from keras.layers import Dense, Dropout
import numpy as np
from sklearn.preprocessing import LabelEncoder
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import L... |
# Use utf-8 encoding
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Agenium Scale
#
# 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... |
import numpy as np
import copy
from proteus.Profiling import logEvent
from proteus import TransportCoefficients
from proteus.mprans import MeshSmoothing as ms
from proteus.mprans import cMoveMeshMonitor as cmm
class Coefficients(TransportCoefficients.PoissonEquationCoefficients):
"""
Coefficients for deforming... |
# -*- coding: utf-8 -*
import colorsys
import datetime
import difflib
import itertools
import json
import logging
import re
import tagging
from actstream import action
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentTyp... |
#!/usr/bin/env python
import os
import sys
from subprocess import check_call, call, Popen, PIPE
from time import time, sleep
import logging
import platform
import json
import multiprocessing
sys.path.append('..')
from ext import baker
if platform.system() == 'Darwin':
TIME_EXE = 'gtime' # requires installation o... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import sys
import numpy as np
from sklearn.model_selection import KFold
from tensorflow.python.ops import control_flow_ops
from nets import nets_factory
from auxiliary import losses
fro... |
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
"""
Matrix utility module based on numpy
"""
import math
import numpy
import scipy.linalg
from . import subblocked, blocked
class Matrix(numpy.ndarray):
"""
A subclass of numpy.ndarray for matrix syntax and better printing
"""
fmt = "%14.8f"
order = "F"
def __new__(cls, shape, fmt=None):
... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""The Odoo API module defines Odoo Environments and method decorators.
.. todo:: Document this module
"""
__all__ = [
'Environment',
'Meta',
'model',
'constrains', 'depends', 'onchange', 'returns',
... |
""" This module contains the main routines to load processes, specify the
physical conditions and solve the Boltzmann equation.
The data and calculations are encapsulated into the :class:`BoltzmannSolver`
class, which you have to instantiate with a :class:`grid.Grid` instance.
Use :func:`BoltzmannSolver.load_colli... |
#!/usr/bin/env python3
# usage: compile and launch MQsolver according to the parameters.
# Run -h for details
import argparse
import sys
import subprocess
import os
import time
import itertools
import shutil
start_stamp = time.time()
def print_stamp(*arg, file=sys.stdout):
stamp = time.time() - start_stamp
p... |
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import math
import cv2
import jigsaw
import sys
from itertools import chain
class Quad:
pass
class xjigsaw:
pass
debug = False
debugPreProcessing = False
debugGeometry = False
conernsoverride = False
allowedOrein... |
"""Train the movenet model."""
import json
import gc
import math
import logging
import os
import shutil
from dataclasses import dataclass, asdict, field
from dataclasses_json import dataclass_json, config
from pathlib import Path
from time import time
from typing import Optional
import librosa
import torch
import tor... |
# (c) 2012-2014, <NAME> <<EMAIL>>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansi... |
from __future__ import annotations
import re
from abc import abstractmethod
from ctypes import *
from enum import IntEnum, unique
from typing import Any, Dict, Generator, Iterable, List, Literal, Optional, \
Protocol, Tuple, Union, runtime_checkable
from .utils import FIFOQueue, chakra_core
def walk... |
# -*- coding: utf-8 -*-
u"""Run jobs in Docker
Locking is very tricky, because there are many long running operations. We
try to release locks when possible when talking to docker daemons, for example.
Always grab `Job.lock` then `_SlotManager.__lock`, and try to avoid holding
both locks.
:copyright: Copyright (c) 2... |
# -*- coding: utf-8 -*-
# Copyright 2009-2013, <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 required by applica... |
import numpy as np
import xarray as xr
from numba import vectorize, guvectorize, float64, boolean, complex128
from xsar.utils import timing
from xsarsea import gmfs, gmfs_methods
from xsarsea.gmfs import gmf_ufunc_co_inc
from config import *
from gmfs_methods import cmod5
lut_cr_spd = inversion_parameters["lut_cr_dict... |
from enum import IntEnum
import gzip
import hashlib
import io
from itertools import chain
import os
import re
import tempfile
import shutil
import struct
try:
import bz2
except ImportError:
bz2 = None
try:
import lzma
except ImportError:
lzma = None
from . import Task, TaskVar
from ..utils import Ta... |
#!/usr/bin/env python3
import numpy as np
from matplotlib import pyplot as plt
import torch
from torch import nn
from torch.autograd import Function
# import emd
class LaserScan:
"""Class that contains LaserScan with x,y,z,r"""
EXTENSIONS_SCAN = ['.bin']
def __init__(self, project=False, H=64, W=1024, fov_up=3... |
# -*- coding: utf-8 -*-
#
# profiler : a Wi-Fi client capability analyzer tool
# Copyright : (c) 2020-2021 <NAME>
# License : BSD-3-Clause
# Maintainer : <EMAIL>
"""
profiler.interface
~~~~~~~~~~~~~~~~~~
wlan interface data class
"""
# standard library imports
import inspect
import logging
import os
from collections... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from libcity.model.abstract_traffic_state_model import AbstractTrafficStateModel
class GCNLayer(nn.Module):
def __init__(self, num_of_features, num_of_filter):
"""
One layer of GCN
Arguments:
num_of_features ... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... |
# -*- coding: utf-8 -*-
import json
import logging
import logging.config
import os
import sys
import threading
import warnings
from concurrent.futures import ThreadPoolExecutor
import six
from requests import ConnectionError as RequestsConnectionError
import brewtils
from brewtils.errors import ValidationError, Requ... |
"""
runmodule
=========
Provides functions for manipulating strings, directories and
SHEMAT-Suite input files.
"""
import subprocess
import os
import shlex
import string
import shutil
import numpy as np
import pskf.tools.run.pythonmodule as pm
#############################################################
# ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# 2017 vby
############################ vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
"""
"""
import pdb
import collections
import os, errno
import math
import subprocess
import json
"""
Only symbols within a task.
No scoping
"""
class symbol_table_entry(objec... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 23 23:02:12 2020
@author: Connor
This file will be my CFB risk modules.
"""
#
# Imports
#
import requests as reqs
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erf
_BASE ="https://collegefootballrisk.com/api"
_SEASON = 1
plt.style.use("b... |
# [Super SloMo]
##High Quality Estimation of Multiple Intermediate Frames for Video Interpolation
from comet_ml import Experiment, ExistingExperiment
import argparse
import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional a... |
import asyncio
import typing
import re
import time
import datetime
import discord
from discord.ext import commands, tasks
from discord_components import Button, ButtonStyle
from _Util import Checks, RED, GREEN
def parse_punishment(argument):
"""Converts a punishment name to its code"""
punishments = {
... |
# encoding: utf-8
"""
@author: liaoxingyu
@contact: <EMAIL>
"""
import copy
import torch
from torch import nn
from .backbones.resnet import ResNet, BasicBlock, Bottleneck
from .backbones.resnet import resnet18, resnet50, resnet34,resnet101
import torch.nn.functional as F
from .backbones.resnet_ibn_a import resnet50_ib... |
import sys
from collections import defaultdict
from pysam import CINS, CDEL, CSOFT_CLIP
from dark.cigar import (
cigarTuplesToOperations, softClippedOffset, insertionOffset)
from dark.dna import Bases
from dark.progress import maybeProgressBar
from dark.reads import DNARead
from dark.sam import (
samfile, getR... |
"""
pygemfxns_preprocessing.py is a list of the model functions that are used to preprocess the data into the proper format.
"""
# Built-in libraries
import os
import gdal
import argparse
# External libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#from scipy import interp... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
import os
import pydart2 as pydart
import numpy as np
from math import exp, pi, log
from PyCommon.modules.Math import mmMath as mm
from random import randrange, random
import gym
import gym.spaces
from gym.utils import seeding
import PyCommon.modules.Resource.ysMotionLoader as yf
def exp_reward_term(w, exp_w, v):
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 <NAME> <<EMAIL>>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 withou... |
import pygame, sys
from pygame.locals import *
from enums import *
from fileio import *
from util import *
from dialogs import *
class Plane(pygame.sprite.Sprite):
def __init__(self,src,dest):
pygame.sprite.Sprite.__init__(self)
self.baseImage = pygame.image.load('tiles/plane.png').convert_alpha()
self.image =... |
from os.path import join
import re
import pkg_resources
from bob.io.base import create_directories_safe
from .common import swan_file_metadata
def create_subparser(subparsers):
parser = subparsers.add_parser(
'create', help="Creates the PAD file lists of the dataset.")
parser.set_defaults(func=_create... |
# -*- coding: utf-8 -*-
# Code by <NAME>, 2017
# Teaching the game of Tic Tac Toe to a computer using Reinforcement Learning
import numpy as np
import random as rm
from termcolor import colored
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~... |
"""Contains signal probability functions"""
import math
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
import b_meson_fit.breit_wigner as bmfbw
import b_meson_fit.integrate as bmfi
tf.enable_v2_behavior()
q2_min = tf.constant(1.0) # 1 (GeV/c^2)^2
q2_max = tf.constant(8.0) # 8 (GeV/c^2)^2
ma... |
# -*- coding: utf-8 -*-
"""Missing batteries for functools.
Some features modelled after Racket's builtins for handling procedures.
https://docs.racket-lang.org/reference/procedures.html
Memoize is typical FP (Racket has it in mischief), and flip comes from Haskell.
"""
__all__ = ["memoize", "curry", "iscurried",
... |
import os
import traceback
import time
import json
import pandas
import redis
import mitmproxy.io as mitmio
from mitmproxy.exceptions import FlowReadException
from typing import (Dict, List, Optional, BinaryIO)
from gtmcore.activity import ActivityType
from gtmcore.activity.monitors.activity import ActivityMonitor
fr... |
import collections
import functools
import logging
import operator
from haoda import ir
from haoda import util
from haoda.ir import visitor
_logger = logging.getLogger().getChild(__name__)
def _print_interface(printer, kernel_name, inputs, outputs, super_source):
"""Prints the top-level module for the given argume... |
# standard library imports
import os
# third party
import itertools
# local application imports
from atoms import get_maximal_valance
from geom import get_neighbour_list
from geom import get_points_on_sphere
from graph import get_bond_type_list
from graph import get_fbonds
from graph import is_isomorphic
... |
# Copyright (c) 2019 zfit
from collections import OrderedDict
from contextlib import ExitStack
from typing import List, Tuple, Union, Dict, Mapping
import warnings
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
import uproot
import numpy as np
import ... |
"""Auxiliary functions for the pounders algorithm."""
from functools import partial
import numpy as np
from scipy.linalg import qr_multiply
from scipy.optimize import Bounds
from scipy.optimize import minimize
def update_initial_residual_model(
initial_residual_model, x_candidate, residuals_candidate
):
"""U... |
#!/usr/bin/env python3
from mako.template import Template
import re
import os
import socket
import platform
import subprocess
import argparse
import json
import yaml
import glob
import distro
import shlex
def empty_string_if_failure(function):
def new_func(*args, **kwargs):
try:
return functio... |
###############################################
# import required module
import sys
from PyQt5.QtWidgets import *
from PyQt5.Qt import *
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import random
import time
from module.LRUCache import *
from module.astro_secret import *
import m... |
import json
import csv
import re
import spacy
import neuralcoref
from nltk.wsd import lesk
from nltk.tokenize import sent_tokenize
from nltk.stem import PorterStemmer
nlp = spacy.load('en_core_web_md')
neuralcoref.add_to_pipe(nlp)
stemmer = PorterStemmer()
def read_text(filename):
raw_text = ''
with open(f... |
from pprint import pprint
from random import random
from random import choice
from concept_formation.preprocessor import Flattener
from concept_formation.preprocessor import Tuplizer
from concept_formation.structure_mapper import rename_flat
from apprentice.agents.base import BaseAgent
# from apprentice.learners.When... |
import os
import numpy as np
import torch
from tensorboardX import SummaryWriter
import distributed
# import onmt
import torch.nn as nn
from models.reporter import ReportMgr
from models.stats import Statistics
from others.logging import logger
from others.utils import test_rouge, rouge_results_to_str
import torch.nn... |
#!/usr/bin/env python
"""
Establishes a correlation between a light microscopy (LM) image and EM stage
coordinates and correlates positions of objects of interest (targets) between
EM and LM.
In order to facilitate establishing a correlation between LM and EM stage,
EM overview is added as an intermediate system. ... |
from telegram import ForceReply, InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler)
import telegram
import logging
import persistence
import socket
import subprocess
import os
import sys
import requests
import configparser
from pa... |
"""Welcome to the restaurant offer...."""
"""This is created by <NAME>"""
#make it cool
# start from here
from tkinter import *
from tkinter import colorchooser
from tkinter import messagebox as mes
from pygame import mixer
import random
from PIL import ImageTk,Image
import time
extra=[] #for food st... |
from .align import align
import docopt
import re
import collections
import os
import sys
import numpy as np
import pandas as pd
from Bio import SeqIO
import seaborn as sns
import matplotlib.pyplot as plt
def determine_thresholds():
"""
Run routine to determine the positive pair thresholds for all given opening... |
#
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: <NAME>, <EMAIL>, http://fursin.net
#
import os
obligatory_properties_filename = 'source.properties' # assume it *must* be present in the distribution's... |
def initialize(graph, source):
d = {} # Stands for destination
p = {} # Stands for predecessor
for node in graph:
d[node] = float('Inf') # We start assuming that the rest of nodes are unreachable
p[node] = None
d[source] = 0 # For the source we know how to reach
return d, p
def... |
# LEDENET
#
# Description:
# All text / settings are in dutch, If you want it translated, feel free to do so :)
# Plugin connects to Ledenet / UFOlight RGB(W) controller (https://www.amazon.com/LEDENET-Controller-Android-Smartphone-Control/dp/B00MDKOSN0)
# It gives RGBW sliders, on/off switch and an 'autolight' f... |
"""
vae.py: Variational autoencoder to develop a multi-layer perceptron
The variational auto-encoder code is based on the implementation by
https://github.com/y0ast/VAE-TensorFlow
For compatibility with VAMP-methods, this uses ReLU activation functions.
This file requires tensorflow installed.
"""
from __fu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2018-2019 Nekoka.tt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without li... |
"""
This is the main file of this project.
It contains the training function as well as the testing routine.
This file uses all the other files, such as AE.py, FlatAE.py and files from the folder utils
If you encounter any problems/bugs/issues please contact me on github
or by emailing me at <EMAIL> for any bug repo... |
import cv2
import glob
import random
from torch.utils.data.dataset import Dataset
import pandas as pd
import os
import skimage.io as io
import numpy as np
import torch
import torchvision.transforms as transforms
import PIL.Image
import matplotlib.pyplot as plt
trainRatio = 0.7 # There are 70% imgaes in dataset are tr... |
# Copyright 2020-2022 <NAME> Multimedia GmbH
#
# 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 ... |
# -*- coding: utf-8 -*-
import sys
import click
import cv2
from .api import (
adjust_brightness,
adjust_contrast,
auto_clean,
binarize_image,
color_reduction,
denoise_image,
dilate_image,
extract_edges,
histogram_equalization,
histogram_image,
histogram_palette,
match_t... |
import os
from typing import Callable, Dict, List, Optional, Tuple, Union, Set
import pandas as pd
from numpy import exp, log2
# ----------------------------------------------------------------------------------------------------------------
# [1]: Used for create multi-fingerprint feature
DATA_FRAMEWORK: Dict[... |
import torch
from torch.distributions.normal import Normal
import torch.nn.functional as F
from torch.distributions.kl import kl_divergence
import numpy as np
class VAE(torch.nn.Module):
def __init__(self, **kwargs):
super(VAE, self).__init__()
self.hidden_size = 64
self.laten... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
#!/usr/bin/env python
import os
import sys
# When attacking the labels
import numpy as np
import scipy as sp
# for randomized svd
from sklearn.utils.extmath import randomized_svd
from utils.data_loader import *
from utils.metrics import *
from utils.tr_solver import trust_region_solver
from utils.spca_solver import sp... |
'''
by Einsbon (<NAME>)
- GitHub: https://github.com/Einsbon
- Youtube: https://www.youtube.com/channel/UCt7FZ-8uzV_jHJiKp3NlHvg
- Blog: https://blog.naver.com/einsbon
Robot's forward is direction X +
left is Y+
up is Z +
'''
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as m... |
import math
from matrix import Matrix
from tabulate import tabulate
import random
class TargetFunction:
"""Function class used for optimization, counts calls and saves calculated results
"""
def __init__(self, f):
self.f = f
self.results = {}
self.no_calls = 0
def __call__(se... |
# Copyright (c) 2021, University of Washington
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of condi... |
import logging
from abc import ABC, abstractmethod
from typing import List, Union, Tuple
import numpy as np
import torch as th
from torch import nn
from torch.nn import functional as F
import torch.distributions as dist
from type_checks import check_valid
from utils import SamplingContext
logger = logging.getLogger(... |
import numpy as np
from scipy.optimize import fsolve
import matplotlib.pyplot as plt
conserved_variables = ('Depth', 'Momentum')
primitive_variables = ('Depth', 'Velocity')
left, middle, right = (0, 1, 2)
def pospart(x):
return np.maximum(1.e-15,x)
def primitive_to_conservative(h, u):
hu = h*u
return h, ... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import collections
import datetime
import backtrader as bt
MAINSIGNALS = collections.OrderedDict(
(('longshort', bt.SIGNAL_LONGSHORT),
('longonly', bt.SIGNAL_LONG),
('shortonly', bt.SIGNAL_SHORT... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Updates LLVM_NEXT_HASH and uprevs the build of a package or packages.
For each package, a temporary rep... |
# -*- coding: utf-8 -*-
#
# Step 6 action script
#
import tensorflow as tf
from tensorflow import keras
import numpy as np
import os, re, json
divisor = 4;
def read_npz(fn):
with np.load(fn) as data:
wav_data = data["wav"];
wav_data = np.swapaxes(wav_data, 2, 3);
ticks = data["ticks"];
... |
# coding=utf-8
# Copyright 2019 The Interval Bound Propagation 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 ... |
import time
import functools
import math
import logging
import itertools
from datetime import datetime
from subprocess import Popen, PIPE
import json
import pprint
import queue
import multiprocessing as mp
from pathos.pools import ProcessPool, ParallelPool
import copy
def factorization(x):
if x == 0:
raise... |
from __future__ import print_function, division, absolute_import
import multiprocessing
import dask.array as da
import os
import dask
import dask.distributed as dd
import struct
import numpy as np
import h5py
import stemtool as st
import glob
from collections import OrderedDict
class Frms6Reader(object):
"""This ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import asyncio
import functools
import inspect
import logging
import os
import platform
import urllib.parse
from io import StringIO
from pathlib import Path
from typing import (
Any,
AsyncIterable,
AsyncIterator,... |
import unittest
import unittest.mock as mock
from pathlib import Path
import numpy as np
import transforms3d as t3
from arvet.metadata.image_metadata import MaskedObject, EnvironmentType, LightingLevel, TimeOfDay, LightingModel
from arvet.metadata.camera_intrinsics import CameraIntrinsics
from arvet.util.test_helpers i... |
# -*- coding: utf-8 -*-
import asyncio
import datetime
import json
import logging
import os
import re
import sys
import subprocess
import urllib.request
from collections import OrderedDict
from html.parser import HTMLParser
import helpers
from constants import (ENUM_INDEX, ENUM_POST, ENUM_COM, ENUM_ASYNC_TASK_STATUS... |
import idc
import idautils
import ida_struct
import ida_typeinf
from bip.py3compat.py3compat import *
from .bipidb import BipIdb
from .biptype import BipType
from .bipelt import BipRefElt
from .biperror import BipError
class BipStruct(BipRefElt):
"""
Class for representing and manipulating a structure in... |
#
# =================================================================
# =================================================================
"""
For IBM PowerVC:
This is a set of query functions for persistent Nova resources
"""
import copy
from nova.openstack.common.db import api as common_db
from nova.db import api as ... |
import math
import os
import os.path as osp
import random
import sys
from datetime import datetime
import numpy as np
import time
import torch
import torch.nn as nn
import torch.autograd as autograd
import torch.optim as optim
import torch.utils.data as tordata
import torch.nn.functional as F
import pickle
from .utils... |
#!/home/guanchenye/thirdparty/preda/envs/apolloscape/bin/python
"""
Brief: Evaluation of 3D Detection/Tracking
Date: 2019/6/1
"""
# import remoteDebug
import sys
import logging
import argparse
import os
import numpy as np
import functools
import queue
import threading
if sys.version_info[0] < 3:
raise Exc... |
import re
from collections import defaultdict
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import streamlit as st
import yaml
from pydantic import BaseModel, Field
class Config(BaseModel):
common_names: List... |
from __future__ import annotations
from warnings import warn
import napari
from napari.utils.notifications import Notification, notification_manager
from napari.utils import history
from napari.layers import Image, Shapes, Points, Labels, Tracks
import magicgui
from functools import wraps
from qtpy.QtWidgets import QFi... |
import copy
from tqdm import tqdm
from scoop import futures
import rouge_functions
from absl import flags
from absl import app
import convert_data
import time
import subprocess
import itertools
import glob
import numpy as np
import data
import os
import sys
from collections import defaultdict
import uti... |
"""
RECURSIVE MODEL CHANNEL FOR VISIBLE LIGHT COMMUNICATION
<NAME>
<EMAIL>
This software includes the following improvements:
- Using of the fast euclidean distance function
- Add a new dimension to the array_points, a wall label
- The array_parameter is computed only with half matrix
- Was created a general reports ... |
import datetime
from calendar import HTMLCalendar
from collections import namedtuple
from employees.selectors import get_employee
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.db import connection, IntegrityError
from django.http import JsonResponse, HttpResp... |
"""
Module for Tokenizer
SentencePieceTokenizer wrapped in fastai Tokenizer()
"""
## TODO: CLEANUP ONLY NEEDED OBJECTS
#%%
import os
import pandas as pd
from typing import List
from pathlib import Path
from functools import partial
from sentencepiece import SentencePieceTrainer, SentencePieceProcessor
from conte... |
import math
import time
import json
import sys
from algorithm.cMMAC import *
from algorithm.GPG import *
from env.platform import *
from env.env_run import *
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
def flatten(list):
return [y for x in list for y in x]
def calculate_reward(master1, master2, cu... |
from __future__ import absolute_import
import time
import random
import urllib.parse
import re
from datetime import datetime
from oslo_log import log
import tobiko
from tobiko.shell import sh
from tobiko.openstack import glance
from tobiko.openstack import tests
from tobiko.openstack import topology
from tobiko.tri... |
#!/usr/bin/env python
#-*- coding: utf-8 -*
#
# Copyright 2011 shuotao.me
# by <EMAIL>
# 2011-10-9
#
# Sputnik Cache
# 把python对象转换成一个可以作为cache存储的value
# lru_list thread-safe
# ToDoList:
#
import re
import time
import heapq
import redis
import threading
import SpuUtil as util
import SpuException
from SpuDebug impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.