text stringlengths 3.07k 12.6k |
|---|
#!/usr/bin/env python
"""Run bhm analysis for HD211847."""
import argparse
import sys
import numpy as np
import logging
import simulators
from joblib import Parallel, delayed
from logutils import BraceMessage as __
from mingle.utilities.crires_utilities import barycorr_crires_spectrum
from mingle.utilities.errors impo... |
import pandas as pd
import numpy as np
from utils import import_data, keep_only_one_year_data, clean_crowdtangle_url_data
def filter_accounts_sharing_less_than_x_fake_news(df, x):
value_count = df.drop_duplicates(subset=['account_id', 'url'], keep='first')['account_id'].value_counts()
df_filtered = df[df['ac... |
# Embedded file name: c:\Jenkins\live\output\win_32_static\Release\midi-remote-scripts\Push\HandshakeComponent.py
"""
Component for handling the initialization process of Push.
"""
import Live
from _Framework import Task
from _Framework.ComboElement import ToggleElement
from _Framework.SubjectSlot import subject_slot
f... |
import os
import random
import numpy as np
import torch
from torchvision import transforms
from PIL import Image
class Sample:
"""sample from the dataset
params:
target_text: Str - the text that is shown by the image
file_path: Str - the relative filePath of the image
"""
... |
import os
import re
import sys
import time
import pprint
import ujson as json
import multiprocessing
from pathlib import Path
from contextlib import suppress
from settings import output_file_path
from pipeline.util import CromObjectMerger
from cromulent.model import factory
from cromulent import model, reader, vocab
... |
import io
import json
import math
import os
import re
from abc import ABCMeta
from typing import List, Tuple, Optional, Union, TypeVar, Type
from hbutils.model import get_repr_info
from ...utils import auto_encode_support, auto_decode_support, auto_load_json, JsonLoadError
_auto_encode = auto_encode_support(lambda x... |
# Importing all the necessities
from collections import deque
from threading import Thread
from queue import Queue
import time
import os
import cv2
class KeyClipWriter:
def __init__(self, bufSize=64, timeout=1.0):
# Maximum number of frames to be kept in memory
self.bufSize = bufSize
# Sle... |
"""Implementation of treadmill admin aws user.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import logging
import click
from treadmill import cli
from treadmill import exc
from treadmill_aws import... |
"""
The 2nd generation TOPO APIs
"""
import json
import re
import time
import networkx as nx
from topo.funs import seekFile
def json2jsseries(filename, timeSlice=0):
"""
功能:把json里的数据格式化成echarts的js形式
:param filename: 文件名(预设topo.json, topo66.json)
:param timeSlice: 时间戳,topo.json会用到,没用到的文件默认为0
:r... |
from pygments.lexer import RegexLexer, bygroups, include, words
from pygments.token import *
common_tokens = {
'common': [
(r'\n', Text),
(r'\s+', Text), # whitespaces
(r'\\\n', Text), # line continuations
(r'[^\W\d]\w*', Name),
],
'tla': [
(words(("TRUE", "FALSE"... |
import numpy as np
import math
class MLP:
def __init__(self,units,activs):
self.units = units
self.length = len(units)
self.activations = activs
assert len(units)-1 == len(activs) and set(activs).issubset(set(["noactiv","relu","sigmoid","softmax","tanh"])) and "softmax" not in activs[:-1]
#构造激活函数和激活函数的导数
... |
# This is the code of the worker part of the Sink Operation. Here the user needs to write most of the code in order to
# define the Operation's functionality.
# <editor-fold desc="The following 6 lines of code are required to allow Heron to be able to see the Operation without
# package installation. Do not chan... |
# -*- coding: utf-8 -*-
import numpy as np
from functools import wraps
from africanus.util.docs import DocstringTemplate
from africanus.util.numba import generated_jit, njit
from africanus.calibration.utils import check_type
from africanus.calibration.utils.utils import DIAG_DIAG, DIAG, FULL
def subtract_model_facto... |
from collections import OrderedDict
from pypokerengine.engine.table import Table
from pypokerengine.engine.player import Player
from pypokerengine.engine.round_manager import RoundManager
from pypokerengine.engine.message_builder import MessageBuilder
from pypokerengine.engine.poker_constants import PokerConstants as ... |
# Copyright (C) 2013-2016 <NAME>, CU Denver
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... |
import os
import torch
from prettytable import PrettyTable
from utils.utils import set_seed, \
get_table_stat, model_prefix, get_relation_args, \
load_file, partition, calculate_p, cal_mean_and_std, get_pair, \
read_prompts, store_json_dic, load_json_dic
import numpy as np
from models import build_model_wr... |
# SPDX-License-Identifier: BSD-3-Clause AND Apache-2.0
# Copyright 2018 Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code... |
# Made with python3
# (C) @JoshephX
# Copyright permission under MIT License
# All rights reserved by JoshephX
# License -> https://github.com/Yuziful/S1l4pbot/blob/main/LICENSE
import os
import requests
from pyrogram import Client, filters
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
REMOVEB... |
from django.core.management.color import no_style
from django.db import connections
from tqdm import tqdm
from capdb.models import VolumeMetadata, TrackingToolUser, ProcessStep, TrackingToolLog, BookRequest, Jurisdiction
from tracking_tool.models import BookRequests, Eventloggers, Hollis, Pstep, Users, Volumes
user_... |
from typing import Optional, Tuple
from overrides import overrides
import torch
import torch.nn.functional as F
from torch.nn import Conv1d, Linear, MaxPool1d
from allennlp.modules.seq2vec_encoders.seq2vec_encoder import Seq2VecEncoder
from allennlp.nn import Activation
class MaxPool1dAll(MaxPool1d):
r"""Applie... |
from io import BytesIO
import base64 as b64
from typing import Union, List, Optional
import torch
from torchelie.utils import as_multiclass_shape, experimental
import numpy as np
from PIL import Image
def img2html(img: Union[torch.Tensor, np.ndarray], opts: dict = None) -> str:
"""
Convert an image to a b64... |
from __future__ import division, print_function
import os
import sys
import argparse
import logging
import numpy as np
# For non-interactive plot
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import neon
from neon.util.argparser import NeonArgparser
from neon.data import ArrayIterator
fr... |
"""Meteobridge Weather Integration for Home Assistant"""
import logging
from datetime import timedelta, datetime
import voluptuous as vol
from homeassistant.const import (
TEMP_CELSIUS,
CONF_NAME,
CONF_HOST,
CONF_USERNAME,
CONF_PASSWORD,
CONF_SCAN_INTERVAL,
PRECISION_TENTHS,
PRECISION_W... |
from __future__ import print_function
import time
import torch
import torch.utils.data
from torch import nn, optim
from torch.nn import functional as F
from torch.utils.data import DataLoader, TensorDataset
import matplotlib.pyplot as plt
from tqdm import tqdm
class VAE(nn.Module):
def __init__(self, n_features=2... |
"""
File: boggle.py
Name:
----------------------------------------
TODO:
"""
# This is the file name of the dictionary txt file
# we will be checking if a word exists by searching through it
FILE = 'dictionary.txt'
moveset = [(0, 0), (-1, -1), (0, -1), (1, -1), (-1, 0), (1, 0), (-1, 1), (0, 1), (1, 1)]
START_X = 0
ST... |
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn.functional as F
from torch import nn
######## Method 1 ###########
def get_kernel_gauss(size=5, sigma=1.0, n_channels=1):
if size % 2 != 1:
raise ValueError("kernel size must be uneven")
grid = np.float32(np.mgrid[0:s... |
import io
import sys
import glob
from enum import Enum, auto
class BibParserState(Enum):
SEEK_AT_SIGN = auto()
READ_ENTRY_TYPE = auto()
READ_IDENTIFIER = auto()
SEEK_KEY_OR_END = auto()
READ_KEY = auto()
READ_VALUE = auto()
def is_allowed_in_identifier(ch):
try:
# se... |
# -*- coding: utf-8 -*-
"""
ITU-MiniTwit Simulator API
~~~~~~~~~~~~~~~~~~~~~~~~~~
An API for the simulator for ITU-MiniTwit, a microblogging application
written with Flask and sqlite3.
:copyright: (c) 2019 by HelgeCPH.
:license: BSD, see LICENSE for more details.
"""
import os
import time
imp... |
# Copyright 2021 MIT Probabilistic Computing Project
# Apache License, Version 2.0, refer to LICENSE.txt
import itertools
import json
import math
import os
import random
import tempfile
import numpy as np
from hirm import IRM
from hirm.util_io import from_dict_IRM
from hirm.util_io import from_txt_irm
from hirm.util... |
#!/usr/libexec/platform-python
# 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,... |
import os
import copy
import random
import numpy as np
import open3d as o3d
from skimage import transform
from scipy.spatial.transform import Rotation as R
import pdb
def normalize(v):
v_len = np.linalg.norm(v)
ret = v
if v_len != 0:
ret /= v_len
return ret
def get_light_corners(light_ctr, o... |
"""Test for reader module
Copyright 2018 Spectre Team
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agree... |
import asyncio
import ctypes
import datetime
import itertools
from ipaddress import IPv4Address
from typing import Iterator, List, Tuple
from pymodbus.client.asynchronous.async_io import (
ModbusClientProtocol,
ReconnectingAsyncioModbusTcpClient,
)
from pymodbus.register_read_message import ReadHoldingRegister... |
import numpy as np
import argparse
import composition
import os
import json
import torch
from spinup.algos.pytorch.ppo.core import MLPActorCritic
from spinup.algos.pytorch.ppo.ppo import ppo
from spinup.utils.run_utils import setup_logger_kwargs
def parse_args():
parser = argparse.ArgumentParser()
parser.ad... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
通过配置产生property_condition
"""
from nebula_meta.variable_filter import Filter
from threathunter_common.util import utf8
from ..event_var_data import get_variable_field_type
def gen_ordinary_filter(source_name, field, op, op_value):
"""
根据操作符和操作数产生普通的条件配置
"... |
from model import Comment
from flask import jsonify
import vocab
import chat_util as cu
import turing_bot as tb
def build_message(content):
if content:
return jsonify(
command='msg',
msg_content=content
)
else:
return jsonify(command=None)
def build_message_mu... |
import pickle
import pandas as pd
import datetime as dt
from flask import Flask, jsonify, render_template, current_app
from sqlalchemy import create_engine
import pymysql
import simplejson as json
from pprint import pprint
from app import app
import os
import numpy as np
@app.route('/predict/<station>')
def predict_b... |
import json
import re
import requests
import requests.exceptions
import pytest
from pytest_bdd import scenario, given, then, when, parsers
import kubernetes.client
from kubernetes.client.rest import ApiException
from tests import kube_utils
from tests import utils
# Constants {{{
INGRESS_PORT = 8443
# }}}
# S... |
import logging
from lxml import etree
from urllib.request import urlopen, Request
from scrooge.stores.utils.datastoragemanager import DataStorageManager
logger = logging.getLogger(__name__)
class DataSourceImpl:
def __init__(self, store):
self.store = store
self.ds_manager = DataStorageManager(... |
# part of 2nd place solution: lightgbm model with private score 0.29124 and public lb score 0.28555
import lightgbm as lgbm
from scipy import sparse as ssp
from sklearn.model_selection import StratifiedKFold
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessin... |
#
# Requires GTK3 to RUN
#
import gi
#Setting GI version
gi.require_version("Gtk", "3.0")
#Import GTK For UI
from gi.repository import Gtk
#Class than contains the visualizations for the Calculator
class calculatorDisplay(Gtk.Window):
#Init Tasks
def __init__(self):
Gtk.Window.__init__(self, title=... |
import sys
import json
import subprocess
import mimetypes
from pathlib import Path
import asyncio
from aiohttp import hdrs
from aiohttp.web import HTTPFound
from aiohttp.web_exceptions import HTTPNotFound, HTTPNotModified
import muffin
from muffin.urls import StaticRoute, StaticResource
from mako.template import Templ... |
import torch
import os
from datetime import datetime
import numpy as np
import cv2
# from torchvision.utils import save_image
from tqdm import tqdm
import face_alignment
from matplotlib import pyplot as plt
path_to_mp4 = './voxceleb/dev/mp4'
K = 8
num_vid = 0
device = torch.device('cuda:0')
saves_dir = '... |
"""
This is an implementation of Conv2d layer with Scaled Weight Standardization
which is based on an implementation in pytorch-image-models:
https://github.com/rwightman/pytorch-image-models.
"""
from typing import Tuple, Union
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..functions import... |
import requests
from flask import Flask, request
from telepot.exception import TelegramError
import boto3
import botocore
import traceback
import json
import config
import dsbmobil_scraper
app = Flask(__name__)
def getS3Path(chat_id, filename):
return "data/" + str(chat_id) + "/" + str(filename)
def get_url(meth... |
import json
from datetime import datetime
from enum import IntEnum, auto
from flask import Blueprint, jsonify, request
from flask import current_app as app
from canedge_datasource import cache
from canedge_datasource.enums import CanedgeInterface, CanedgeChannel, SampleMethod
from canedge_datasource.signal import Signa... |
from parsers.config import config
from parsers.utils import export_dataframe, detect_language
import json
import pandas as pd
import logging
from collections import defaultdict
import os
log = logging.getLogger(__name__)
def main(own_name, file_path, max_exported_messages):
global MAX_EXPORTED_MESSAGES
MAX_E... |
import numpy as np
def extractSpadData(data, mode):
"""
Extract data from specific detector elements from SPAD-FCS data
========== ===============================================================
Input Meaning
---------- ---------------------------------------------------------------
d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
: Project - RGANet
: Get adaptive weights for loss functions
: Author - <NAME>
: Institute - University of Kansas
: revised Date - 12/24/2021
: HowTo: Set 'cfg' according to the dataset, only labels are processed
"""
from pathlib import Path
from PIL import Image
from... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Break a SHA-1 keyed MAC using length extension
#
# Secret-prefix SHA-1 MACs are trivially breakable.
#
# The attack on secret-prefix SHA1 relies on the fact that you can take the
# output of SHA-1 and use it as a new starting point for SHA-1, thus taking
# an arbitrary... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import numpy as np
import torch
from torch import nn
from paa_core.layers.misc import interpolate
from paa_core.structures.bounding_box import BoxList
# TODO check if want to return a single BoxList or a composite
# object
class MaskPostProcesso... |
import argparse
import os
import json
import shutil
import platform
import time
import torch
from torch import nn
from torch.autograd import Variable
import numpy as np
import pandas as pd
from models.rnn import RNN_LM
from utils.general_utils import dict_of_lists_to_list_of_dicts
from log import get_logger
from conf... |
"""
Copyright (c) 2019 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 writin... |
import unittest
import torch
import math
from tests.util import create_config, get_dataset_folder
from kge import Dataset
from kge.model import KgeModel
from kge.indexing import KvsAllIndex
# tests for all models
class BaseTestModel:
def __init__(self, model_name, options={}):
self.model_name = model_na... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mining RPCs
- getmininginfo
- getblocktemplate proposal mode
- submitblock"""
import copy
from b... |
"""
===================================================
Faces recognition example using eigenfaces and SVMs
===================================================
The dataset used in this example is a preprocessed excerpt of the
"Labeled Faces in the Wild", aka LFW_:
http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2... |
import pytest
from django.urls import reverse
from django.utils.http import urlencode
from rest_framework import status
from games import views
from games.models import EsrbRating
from games.models import Player
def create_esrb_rating(client, description):
url = reverse(views.EsrbRatingList.name)
esrb_rating_... |
"""COMMAND : .runs , .metoo , .rape , .insult , .pro , .maaki , .gey"""
from telethon import events
import random, re
from uniborg.util import admin_cmd
METOOSTR = [
"`Me too thanks`",
"`Haha yes, me too`",
"`Same lol`",
"`Me irl`",
"`Same here`",
"`Haha yes`",
"`Same pinch bsdk`",
]
RUNSR... |
# -*- coding: utf-8 -*-
from concurrent.futures import ProcessPoolExecutor
from functools import partial
import numpy as np
import os, json
from utils import audio
from text import text_to_sequence
def build_from_path(hparams, in_dir, out_dir, num_workers=1, tqdm=lambda x: x):
"""
Preprocesses the speech dat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/sms.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... |
import json
import pwd
import os
import pathlib
import re
from suntime import Sun, SunTimeException
# aliases for path to use later on
user = pwd.getpwuid(os.getuid())[0]
path = "/home/"+user+"/.config"
def exists():
"""returns True or False wether Config exists or note"""
return os.path.isfile(path+"/yin_ya... |
# -*- coding: utf-8 -*-
import copy
from functools import lru_cache
import numpy as np
from scipy.linalg import inv
from .base import Updater
from .kalman import KalmanUpdater, ExtendedKalmanUpdater
from ..base import Property
from ..functions import cholesky_eps, sde_euler_maruyama_integration
from ..resampler impor... |
from befh.restful_api_socket import RESTfulApiSocket
from befh.exchange import ExchangeGateway
from befh.market_data import L2Depth, Trade
from befh.instrument import Instrument
from befh.util import Logger
import time
import threading
from functools import partial
from datetime import datetime
class ExchGwKrakenRest... |
import numpy as np
import clustering_functions as cf
import sdcode_functions as sdcode
import minhash_functions as minhash
import networkx as nx
import math
class executor:
def __init__(self, data, weber=1, d0=0, alg_name = 'all-connected'):
self.data_num, self.col_num = data.shape
if (self.data_num>3**self.col_nu... |
import hashlib
import os
import shutil
import tempfile
from unittest import TestCase
from ...bencode import bencode, bdecode
from ..rtorrent import RTorrentClient
current_path = os.path.dirname(__file__)
class MockXMLRPCProxy(object):
def __init__(self):
self.system = self
self.torrents = {}
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..registry import LOSSES
def _expand_binary_labels(labels, label_weights, label_channels):
bin_labels = labels.new_full((labels.size(0), label_channels), 0)
inds = torch.nonzero(labels >= 1).squeeze()
if inds.numel() > 0:
bin... |
import sys
import time
import pytest
import yaml
from mininet.net import Mininet
from mininet.link import TCLink
from netaddr import IPNetwork, IPAddress
from dhalsim.python2.topo.simple_topo import SimpleTopo
def test_python_version():
assert sys.version_info.major is 2
assert sys.version_info.minor is 7
... |
#!/usr/bin/env python3
import math
import sys
TOP=0
RIGHT=1
BOTTOM=2
LEFT=3
NESSIE = [" # ", "# ## ## ###", " # # # # # # "]
NESSIE_OFFSETS = [(i, j) for i in range(len(NESSIE)) for j in range(len(NESSIE[0])) if NESSIE[i][j] == '#']
class Tile:
def __init__(self, id):
se... |
#!/usr/bin/env python
import datetime
from distutils.dir_util import mkpath
import json
import os
import time
import socket
import sys
import uuid
import RPi.GPIO as GPIO
from picamera import PiCamera
from pytz import timezone
import ntplib
import lib.ext.dht11 as dht11
import lib.ext.mg811 as mg811
import lib.coll... |
from torch.utils.data import Dataset
from PIL import Image
from torchvision import datasets, transforms
import os
import json
import torch
from random_erasing import RandomErasing
class ImageDataset(Dataset):
def __init__(self, imgs, transform = None):
self.imgs = imgs
self.transform = transform
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 <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... |
"""
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 agree... |
"""
This compat module handles various platform specific calls that do not fall into one
particular category.
"""
from __future__ import absolute_import
import logging
import select
import subprocess
import sys
import warnings
from typing import Optional
from typing import Tuple
from certbot import errors
from certbo... |
# Lint as: python3
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
import requests
import sys
from bs4 import BeautifulSoup
from .logger import Logger
from .cpubenchmark import cpubenchmark_scraper_single, cpubenchmark_scraper_mega
logger = Logger("videocardbenchmark_sraper")
class single_gpu:
def __init__(
self,
id=None,
gpu_name=None,
gpu_mark=... |
# Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# -*- coding: utf-8 -*-
"""Main module. Launch by running python -m rest_uploader.cli"""
import os
import platform
import time
import base64
import mimetypes
import json
import requests
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from .img_process import (
extract_te... |
"""
Support for the Withings API.
For more details about this platform, please refer to the documentation at
"""
from __future__ import annotations
import asyncio
from aiohttp.web import Request, Response
import voluptuous as vol
from withings_api import WithingsAuth
from withings_api.common import NotifyAppli
from... |
choices = ['voc2007_trainval', 'voc2007_test', 'voc2012_trainval', 'voc2012_test', 'coco2014_trainval', 'coco2017_trainval']
__all__ = choices
import os
import pycurl
import tarfile, zipfile
import glob, shutil
import logging
class _Downloader:
def __init__(self, url, compress_ext='tar'):
self.url = url
... |
##############################################################################
#
# Copyright (c) 2006-2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... |
import numpy as np
# random number generator
rng = np.random.default_rng(13)
# two belief distributions for the thresholds of each arm
# the first only reflects decay in the threshold resulting from our
# pulls, whereas the second reflects decay resulting from both our
# pulls and those of the opponent
supports = np.... |
import logging
from pprint import pformat
# from homeassistant.components.extalife import ExtaLifeChannel
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS
from homeassistant.components.climate import ClimateEntity, DOMAIN as DOMAIN_CLIMATE
from homeass... |
import logging
logging.basicConfig(format="[%(asctime)s] %(message)s", datefmt="%m-%d %H:%M:%S")
import os
import time
import numpy as np
import tensorflow as tf
import core.data.cifar_data as cifar
import core.data.mnist_data as mnist
from network import Network
from statistic import Statistic
import utils as util
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'淨界法師'
SITENAME = u'淨界法師'
# leave SITEURL blank when developing
SITEURL = ''
PATH = 'content'
# avoid processing .html files
READERS = {'html': None}
# mix articles and static files in the same place
# @see https://git... |
# coding=utf-8
# Copyright 2021 The Uncertainty Baselines Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
from contextlib import contextmanager, redirect_stdout, redirect_stderr
from io import StringIO
from importlib.machinery import SourceFileLoader
import os
import sys
from tempfile import NamedTemporaryFile
from textwrap import dedent
import unittest
class PhoneticTests(unittest.TestCase):
"""Tests for phonetic.p... |
import BaseHTTPServer,CGIHTTPServer
from threading import Thread
import os,time
import urllib
from os.path import abspath,dirname,join
from troubleshooting.framework.modules.configuration import ConfigManagerInstance
from troubleshooting.framework.libraries.system import copyDir,removeFile
from troubleshooting.framew... |
# Copyright 2019 Xanadu Quantum 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... |
import matplotlib
import matplotlib.cm
import numpy as np
from enum import Enum
from .primitives import arrow, cylinder
import vis.shaders
import pythreejs
import itertools
class DomainType(Enum):
GUESS = 0
PER_TRI = 1
PER_ELEM = 1
PER_VTX = 2
PER_CORNER = 3
class VectorAlignment(Enum):
TAIL... |
import json
from django.shortcuts import render
from django.views import View
from meiduo_mall.utils.categories import get_categories
from .models import GoodsCategory, SKU, GoodsVisitCount
from django.core.paginator import Paginator
from . import constants
from django import http
from meiduo_mall.utils.response_code ... |
# **********************************************************************************************************************
#
# brief: Mask R-CNN
# Configurations and data loading code for the sun rgbd dataset.
# uses rgbd data
# see: https://github.com/matterport/Mask_RCNN/wiki#training-w... |
from meta_mb.baselines.linear_baseline import LinearFeatureBaseline
from meta_mb.meta_algos.ppo_maml import PPOMAML
from meta_mb.samplers.meta_samplers import MAMLSampler
from meta_mb.samplers.maml_sample_processor import MAMLSampleProcessor
from meta_mb.policies.meta_gaussian_mlp_policy import MetaGaussianMLPPolicy
i... |
"""Trello board for recurring tasks."""
import datetime
import enum
import itertools
import logging
import math
import typing as t
import trello # py-trello package
import tzlocal
from .board_cache import BoardCache
WEEK = 7.0
MONTH = 30.4375
YEAR = 365.25
@enum.unique
class Every(enum.Enum):
"""Available fr... |
"""Add section separation line to pytest log
Pytest can output visually outstanding line at the start of test sections like setup, call and teardown. For example:
------------------------------------- live log setup -------------------------------
------------------------------------- live log call ------------------... |
import folium
import geopandas as gpd
import pandas as pd
import streamlit as st
from matplotlib import pyplot as plt
from streamlit_folium import folium_static
# Caching allows to store return variables in memory
# Saving execution time for time costly operations
@st.cache
def load_files():
"""
Loads necessa... |
import datetime
import logging
import shutil
import sys
from random import randint, random
from typing import List, Tuple
import pandas as pd
from sklearn import preprocessing
from dbnd import log_dataframe, log_metric, pipeline, task
from dbnd._core.constants import DbndTargetOperationType
from dbnd._core.paramete... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import json
import frappe
from frappe import _
from frappe.utils import flt, has_common
from frappe.utils.user import is_website_user
def get_list_cont... |
import os
import time
import dateutil.parser
from botocore.exceptions import ClientError
from . import log
def authorize_security_group_ingress(group_id, ec2):
ec2.authorize_security_group_ingress(
GroupId=group_id,
IpPermissions=[
{
"FromPort": 22,
"T... |
from typing import Dict
from polaris.utils import getLogger
from django.utils.translation import gettext as _
from rest_framework.decorators import api_view, renderer_classes
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.renderers import JSONRenderer, Brows... |
import argparse
import time
import numpy as np
import torch
import torchvision
from torchvision import transforms
import cv2
from models.pfld import PFLDInference, AuxiliaryNet
from mtcnn.detector import detect_faces, show_bboxes
class PFLD(object):
def __init__(self,model_path):
checkpoint = torch.loa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.