text stringlengths 3.07k 12.6k |
|---|
class IntegrityError(RuntimeError):
"""Error to raise whenever an integrity error is encountered."""
pass
class BaseClient(object):
"""Base class to build a file store client off of.
You should build your secure client implementation in ``client.py``,
subclassing off of this base class.
"""
... |
import argparse
import os
import sys
import threading
from litex.soc.tools.remote import RemoteServer
from litex.soc.tools.remote import RemoteClient
from litex.soc.tools.remote import CommUART
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
from make import make_args, make_testdir
class ServerProxy... |
# Copyright (c) 2015 Mirantis 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 to in writing, so... |
from datetime import timedelta
from typing import Callable, Dict, Optional
from airflow import DAG
from airflow.operators.dagrun_operator import DagRunOrder, TriggerDagRunOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
from airflow.operat... |
# coding: utf-8
import pandas as pd
import numpy as np
import cv2 # Used to manipulated the images
seed = 1207
np.random.seed(seed)
# Import Keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Activation
from keras.layers import Conv2D, MaxPooling2D
from keras.callb... |
"""Add retention time related features to rescoring."""
import logging
import os
from typing import Optional, Union
import click
import pandas as pd
from ms2rescore.peptide_record import PeptideRecord
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
logger = logging.getLogger(__name__)
class RetentionTimeIntegration:
... |
"""
Copyright (c) 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicen... |
"""
Interface script to a subsystem of I/O operations
Facade defines a higher-level interface that makes te Error Classifier easier
to use.
"""
import os, sys, random, collections, logging, cv2
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from PIL import Image
# from tensorflow.keras.models im... |
from __future__ import print_function
import qt
import shutil
import sys
import os
import time
import matplotlib.pyplot as plt
from constants import *
def bandwidth(power):
if power<=-55 and power>=-60:
return 3
elif power<=-50 and power>-55:
return 5
elif power<=-45 and p... |
#!/usr/bin/env python3
# Copyright 2017 <NAME>
# 2017 <NAME>
# 2017 <NAME>
# 2018 <NAME>
""" This script converts images to Kaldi-format feature matrices. The input to
this script is the path to a data directory, e.g. "data/train". This script
reads the im... |
import contextlib
import pytest
import random
import time
import tempfile
from scapy.all import sniff
from ptf import testutils
from tests.common.config_reload import config_reload
from tests.common.dualtor.mux_simulator_control import mux_server_url # lgtm[py/unused-import]
from tes... |
import requests
import urllib
import time
import hashlib
import hmac
import itertools
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .api import Base
from .errors import ApiError, ArgumentError
def check_values(value, arg, arg_value):
if type(value) == type:... |
"""Module for matrix/vector plotting.
This module provides simple functions to build matrix/vector
representations for Matplotlib.
Methods
-------
plot_cmat
Plots a red-blue heatmap of a C-like matrix.
plot_jmat
Plots a black-white heatmap of a J-like matrix.
plot_kvec
Plots a horizontal bar chart to re... |
from cloudant import Cloudant
from flask import Flask, render_template, request, jsonify
import atexit
import requests
import os
import json
import copy
app = Flask(__name__, static_url_path='',
static_folder='front-end/build/',
template_folder='front-end/build/')
db_... |
"""
Copyright 2018-present, Facebook, 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 to in writing,... |
from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "f 10 0.033, s, f 20 0.033, s, f 30 0.033, s, f 30 0.033, s, f 30 0.033, s, q"
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... |
# -*- coding: utf-8 -*-
from collections import namedtuple
import logging
from gevent.queue import Full
from h import realtime
from h.realtime import Consumer
from memex import presenters
from memex import storage
from memex.links import LinksService
from memex.resources import AnnotationResource
from h.auth.util im... |
'''
JSONDateDecimalEncoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: JSONDateDecimalEncoder
:members:
:member-order: bysource
date_decimal_hook
~~~~~~~~~~~~~~~~~~~~~~~~
.. autofunction:: date_decimal_hook
flat_to_nested
~~~~~~~~~~~~~~~~~~~~~~
.. autofunction:: flat_to_nested
addmul_number_dicts
~~~~~~~~~~~~... |
"""classicML中树结构的生成器."""
import pandas as pd
from classicML import _cml_precision
from classicML.backend.training import get_criterion
class _TreeNode(object):
"""树的结点.
Attributes:
num_of_leaves: int, default=None,
叶结点的数量, None表示没有叶结点, 即本身就是叶结点.
leaf: bool, default=False,
... |
"""
Scheduler service, to run specific tasks at specific times
"""
import json
import os
from typing import List
import arrow
from arrow.arrow import Arrow
from json_minify import json_minify
from yellowbot.loggingservice import LoggingService
from yellowbot.surfaces.surfacemessage import SurfaceMessage
class Sched... |
import functools
import subprocess
from abc import abstractmethod
from typing import Optional, Union
import yaml
import torch
import numpy as np
from omegaconf import DictConfig, MISSING
def get_git_hash() -> Optional[str]:
"""
Safely retrieves the hash of the last commit
If any failure, returns None
... |
import torch.utils.data as data
import os
import random
import os.path
import numpy as np
import torch
from scipy.linalg import sqrtm
from scipy.stats import pearsonr
import matplotlib.pylab as plt
import seaborn as sns
import pdb
def subjects_error_list(subjects, data_path, empty_list):
def zero_row_col(matrix... |
#!/usr/bin/env python
#
# Copyright (c) 2017, Massachusetts Institute of Technology 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 must retain the above copyright... |
#!/usr/bin/env python3
"""
Generate powers of a given radix for the Bellerophon algorithm.
Specifically, computes and outputs (as Rust code) a table of 10^e for some
range of exponents e. The output is one array of 128 bit significands.
The base two exponents can be inferred using a logarithmic slope
of the decimal e... |
import json
import os
from pathlib import Path
from typing import List, AnyStr, Callable
from tinydb import TinyDB, Query
from typing_extensions import get_type_hints
from typeguard import typechecked, check_type
from pacu.settings import app_dir
DEFAULTS = {
'namespace': 'default',
'regions': [
... |
# Copyright 2019 Systems & Technology Research, LLC
# Use of this software is governed by the license.txt file.
import os.path
import torch
import PIL
import numpy as np
import pdb
import uuid
import pandas as pd
import skimage
import skimage.morphology
import six
import itertools
import matplotlib.pyplot as plt
i... |
from __future__ import absolute_import
import os, glob
from utils.config import opt
from data import Polypcoco_anchorfree
from data.dataset import Dataset, TestDataset, inverse_normalize
from model import FasterRCNNVGG16
from torch.utils import data as data_
from trainer import FasterRCNNTrainer
from metric_polyp_backu... |
import functools
import time
from typing import List, Dict, Any, Iterable, Set, Tuple, Optional
from dbt.logger import (
GLOBAL_LOGGER as logger,
TextOnly,
HookMetadata,
UniqueID,
TimestampNamed,
DbtModelState,
)
from dbt.exceptions import InternalException
from dbt.node_types import NodeType, ... |
#!/usr/bin/env python
# coding: utf-8
#
# Author: <NAME>
# URL: http://kazuto1011.github.io
# Created: 2017-11-15
import re
from collections import OrderedDict
import click
import numpy as np
import torch
from libs import caffe_pb2
from libs.models import DeepLabV2_ResNet101_MSC
def parse_caffemodel(mode... |
import clr # pylint: disable=all; noqa .net system
import codecs
import json
import os
import sys
import datetime
import time
class ChronoGGParser(object):
"""
Because I hate coding with only functions and using Global variables.
Here is the chrono gg deal parser.
This will download chrono GG deal in... |
import matplotlib.pyplot as plt
from solver import *
import numpy as np
import os.path
import pickle
import seaborn as sns
import pandas as pd
import multiprocessing
from random import randint
from model_clb import model_clb, param_references
def getParamDistrib(number_points = 0, file_name = ""): ... |
#! /usr/bin/python
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import seaborn as sns
import sys
from pbcore.io import FastaReader,FastqReader
YLABEL = 'CCS Reads'
DEFAULTBIN = 1
DEFAULTBW = 3
def main(parser):
args = parser.parse_args()
fx = args.inFastx if ar... |
import boto3
import configparser
import sys
import dateutil
import argparse
from os.path import expanduser
from datetime import datetime
DEFAULT_SESSION_DURATION = 3600
def get_credentials(profile, output_profile, mfa_token):
try:
profile_config_id = "profile {}".format(profile)
config = get_conf... |
from argparse import ArgumentParser
from aegan.aegan import AEGAN
from aegan.stat import TrainInfoDumper, TrainInfo
import torch
import matplotlib.pyplot as plt
import numpy as np
import torchvision as tv
from torchvision.datasets import ImageFolder
from torch.utils.data import DataLoader
from PIL import Image
impo... |
# -*- coding:utf-8 -*-
"""
获取彩虹屁语录
cheat man https://lovelive.tools/
chp https://chp.shadiao.app/
"""
import requests
from selenium import webdriver
# from pyquery import PyQuery
import time
from random import random
import os
from selenium.webdriver.chrome.options import Options
import numpy
class Quotat... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
import asyncio
import re
from aiohttp import web
from aiohttp.web import Response, json_response
async def mandrill_send_view(request):
data = await request.json()
message = data.get('message') or {}
if message.get('subject') == '__slow__':
await asyncio.sleep(30)
elif message.get('subject') ... |
import re
from easydbo.output.print_ import SimplePrint as SP
from .sql import execute_query
_VIEW_PREFIX = '__easydbo_tmpview'
# NOTE: This is a simple algorithm
def _guess_tables(tableop, str_):
tname1d = tableop.get_tnames() # Table names list
col2d = tableop.get_columns(full=True) # Columns list... |
# -*- coding: utf-8 -*-
import io
import os
import versioneer
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
import subprocess
import sys
import re
import tarfile
import platform
import shlex
from wheel.bdist_wheel import bdist_wheel
try:
from urllib2 import urlopen
exc... |
#!/usr/bin/env python3
# ##### 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 version.
#
# ... |
# Copyright 2016 F5 Networks 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 to in writi... |
from pathlib import Path
import shutil
import tempfile
import traceback
# from nbclient import execute as executenb
# TODO nbclient is giving hanging warnings:
# [IPKernelApp] WARNING | Parent appears to have exited, shutting down.
from nbconvert.preprocessors.execute import executenb
# from jupyter_client.kernelspec... |
import datetime as dt
import pytest
import pytz
import stix2
from .constants import (
IDENTITY_ID, INDICATOR_ID, LOCATION_ID, SIGHTING_ID, SIGHTING_KWARGS,
)
EXPECTED_SIGHTING = """{
"type": "sighting",
"spec_version": "2.1",
"id": "sighting--bfbc19db-ec35-4e45-beed-f8bde2a772fb",
"created": "20... |
import io, os, sys, csv
def numMismatch(target1, target2):
return sum([x != y for (x,y) in zip(target1, target2)])
def longestMatch(seq1, seq2):
nm, max_nm, mh_end = 0, -1, -1
for i, (x,y) in enumerate(zip(seq1, seq2)):
if x != y: nm = 0
else:
nm += 1
if nm > max_n... |
from mission.framework.search import SpiralSearch
from mission.framework.helpers import ConsistencyCheck
from mission.missions.old.bins import BinsTask as Bins
from mission.missions.old.recovery import OptimalRecovery as Recovery
from mission.framework.task import Task
from mission.missions.old.torpedoes import LocateB... |
#%%
import os
import sys
os.chdir("/home/i53/student/rohit_sonker/action-conditional-rkn")
# sys.path.append('../experiments/Franka')
# sys.path.append('..')
import argparse
import torch
import numpy as np
from data.frankaData_Seq_Inv import frankaArmSeq
# from rkn.acrkn.AcRknInv import AcRknInv
# from rkn_cell.ac... |
def read_dmap(lines):
lines2 = []
append_flag = False
for line in lines:
line = line.strip()
if line == '$':
continue
elif len(line) == 0:
continue
if line.endswith(','):
lines2.append(line)
append_flag = True
elif app... |
import os
import sys
import pytest
sys.path.append(
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
)
import tools
from fixtures import (
fixture_registry_url,
fixture_client,
fixture_repository,
fixture_tags,
)
from dregcli.dregcli import DRegCliException, Client, Image
clas... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2016 <NAME> <<EMAIL>>
#
# 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... |
# -*- coding: utf-8 -*-
"""test_energycondensation.py
py Test:
Energy condensation on multi-group maco- and micro- parameters.
The condensation procedure can be applied on vectors, such as absorption xs,
as well as on scattering matrices.
Created on Mon Apr 11 11:00:00 2022 @author: <NAME>
Last updated on Mon Apr 11... |
from __future__ import print_function
import argparse
from math import log10
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
from torch.utils.data import DataLoader
from rbpn import Net as RBPN
from data import get_traini... |
# Copyright 2020 The PyMC Developers
#
# 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 ag... |
from common_fixtures import * # NOQA
from cattle import ApiError
from test_volume import create_mount
def test_snapshot_lifecycle(context, client, super_client):
driver = 'driver-' + random_str()
name = random_str()
vol = client.create_volume(name=name, driver=driver)
enable_snapshot(vol, super_clien... |
# -*- coding: utf-8 -*-
"""
Terminal-related utilities
--------------------------
"""
from __future__ import absolute_import, division, print_function
import os
import sys
from plumbum import local
from .progress import Progress
from .termsize import get_terminal_size
__all__ = (
"readline",
"ask",
"ch... |
import json
import trt_pose.coco
import trt_pose.models
import torch
import torch2trt
from torch2trt import TRTModule
import time, sys
import cv2
import torchvision.transforms as transforms
import PIL.Image
from trt_pose.draw_objects import DrawObjects
from trt_pose.parse_objects import ParseObjects
import argparse
imp... |
import numpy as np
def rank(A):
'''
Computes the rank of matrix A
:param list A: list of lists, representing matrix assumed to be in reduced
row-echelon form
:return int: rank of the input matrix
'''
# return 0 for empty list input
if A is None:
return 0
# otherwise, c... |
from glob import glob
import sys
import argparse
from utilities.evaluation import *
from sleep_stage_config import Config
def get_ensemble_nndf(folder, nn_type, feature_type, num_classes, modality, hrv_win_len,
base_columns=['mesaid', 'linetime', 'activity', 'stages', 'gt_sleep_block']):
"""... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import subprocess
import shlex
from logging import getLogger
logger = getLogger("wrap")
from ykdl.compact import compact_tempfile
from .html import fake_headers
posix = os.name == 'posix'
# The maximum length o... |
from .utils import *
def print_results(tool, results, run_times, time_spec, individual_stats, runs):
"""Prints the results and statistics to the command line
Arguments:
tool (string): hashcat or john
results (list): tool's collected output
... |
from django.db import transaction
from intentions_page.forms import IntentionEditForm, NoteEditForm, IntentionsDraftEditForm
from intentions_page.models import Intention, Note, IntentionsDraft
import django.utils.timezone as timezone
from django.shortcuts import render, redirect
from django.contrib.auth.decorators imp... |
import shutil
from typing import Any
from os.path import join, isfile
import torch
from fastai.callbacks import (
CSVLogger, Callback, TrackerCallback, LearnerCallback, add_metrics)
from fastai.basic_train import Learner
from mlx.filesystem.utils import (sync_to_dir)
class SyncCallback(Callback):
"""A callba... |
# Copyright 2020 The SQLFlow Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
import asyncio
import time
from cmyui.logging import Ansi
from cmyui.logging import log
from objects.score import Score
from circleguard import Circleguard
from circleguard import ReplayString
import packets
from constants.privileges import Privileges
from objects import glob
from cmyui.discord import Webhook
from cm... |
# Copyright 2020 <NAME> <<EMAIL>>
# 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... |
from click.types import FloatRange, IntRange
from PyInquirer import style_from_dict, Token, prompt, Separator
import click
from pymongo import MongoClient
import gridfs
from PIL import Image
import io
import os
def connect_to_db():
cluster = MongoClient('mongodb+srv://zkwhTxLjojbghd24jSuxiLk8GXcdL3L1c:'+str(os.en... |
"""An extension to add Prometheus logging to your Quart application."""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Union
from prometheus_client import CONTENT_TYPE_LATEST, REGISTRY, Counter, Histogram, generate_latest
from quart import Response, ... |
#!/usr/bin/python3
"""Automated plotting using the plot_variables module
This script automatically creates and save plots of the specified file type,
with the option to save CSV corresponding to the data of each plot as well.
"""
# Standard Packages
import sys; sys.path.insert(0, '../'); sys.path.insert(0, '../../')... |
"""
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 python3
# Copyright (c) 2010 <NAME>
# All rights reserved.
#
# License: BSD
import sys, os, string, re
from ..PluginBase import PluginFeatureBase, ProjectBase, ConfigBase, QueryBase
from ..PluginBase import PluginProcess
from ..CtagsCache import CtagsThread
class IdutilsFeature(PluginFeatureBase):
... |
import tkinter as tk
from tkinter import Tk, Label, Canvas, Entry, Button, BooleanVar, Checkbutton
from State import State
from Action import Action
import Backward_search as bs
import Forward_search as fs
import Test as test
import time as tm
from time import time
initial_state = []
target = []
actions = set()
data =... |
# -*- coding: utf-8 -*-
"""**Lightly Upload:** Upload images to the Lightly platform.
This module contains the entrypoint for the **lightly-upload**
command-line interface.
"""
# Copyright (c) 2020. Lightly AG and its affiliates.
# All Rights Reserved
import csv
import json
import os
from datetime import datetime
im... |
#!/usr/bin/env python3
#
# worktipsnet runtime wrapper
#
from ctypes import *
import configparser
import signal
import time
import threading
import os
import sys
import requests
from pyworktipsnet import rc
lib_file = os.path.join(os.path.realpath('.'), 'libworktipsnet-shared.so')
def log(msg):
sys.stderr.writ... |
import os.path as osp
import warnings
import numpy as np
from functools import reduce
import pycocotools.mask as maskUtils
from pathlib import Path
from copy import deepcopy
from det3d import torchie
from det3d.core import box_np_ops
import pickle
import os
from ..registry import PIPELINES
def _dict_select(dict_, ... |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... |
from skimage.feature import canny
import scipy.ndimage as ndimage
import cv2
import gdal
import numpy as np
from skimage.morphology import skeletonize
from skimage import measure
from skimage.measure import regionprops
from multiprocessing import pool, cpu_count
from multiprocessing.dummy import Pool as ThreadPool
#d... |
from os.path import join
import numpy as np
import plotly.graph_objs as go
import plotly.offline as py
from scipy.ndimage import gaussian_filter1d
from tqdm import tqdm
from astropy import units as u
from ..solver.bayes import BayesSolver
from ..solver.linear import LinearSolver
from ..solver.spline import SplineSolv... |
"""
Lexicon Zonomi and Rimuhosting Provider
Author: <NAME>, 2017
Zonomi API Docs: https://zonomi.com/app/dns/dyndns.jsp
Rimuhosting API Docs: https://rimuhosting.com/dns/dyndns.jsp
Implementation notes:
* Lots of tricks taken from the PowerDNS API
* The Zonomi API does not assign a unique identifier to each record i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Filename: tasplot.py
############################################################################
#
# COPYRIGHT: (C) 2015 <NAME> / @volcan01010
# <NAME>
# WEBSITE: http://all-geo.org/volcan01010
#
# This program is free software; you can redist... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
"""Module contains the class to create filepath prompt and filepath completer class."""
import os
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Generator
from prompt_toolkit.completion import Completer, Completion
from prompt_toolkit.completion.base import ThreadedCompleter
from InquirerPy... |
'''Collection of utility functions used by PRIM module
'''
from enum import Enum
import math
import numpy as np
from . import scenario_discovery_util as sdutil
from ..util.ema_logging import (get_module_logger)
_logger = get_module_logger(__name__)
# Created on 6 Feb 2019
#
# .. codeauthor:: jhkwakkel <j.h.kwa... |
import json
import os
import subprocess
import textwrap
from typing import Any, Callable, List, Mapping, Optional
from dagster import OpDefinition, Output, SolidExecutionContext, check
from dagster.core.asset_defs import AssetIn, asset
def _load_manifest_for_project(
project_dir: str, profiles_dir: str, target_d... |
import theano
import theano.tensor as T
from theano.ifelse import ifelse
import numpy as np
from neupy.core.properties import (ChoiceProperty, NumberProperty,
WithdrawProperty)
from neupy.algorithms.gd import StepSelectionBuiltIn
from neupy.algorithms.utils import parameter_values, s... |
import numpy as np
import tensorflow as tf
import AdamOpt
from parameters import *
import go_stim as stimulus
import os, sys, time
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # so the IDs match nvidia-smi
print('TensorFlow version:\t', tf.__version__, '\n')
class Model:
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 15 17:14:51 2020
@author: xuhuiying
"""
import numpy as np
import matplotlib.pyplot as plt
import plotHistory as ph
# transform the action index to action y
def action2y(action,actionNumber,y_min,y_max):#把动作的编号转换成对应的动作值y
y = y_min + (y_max - y_... |
# Copyright 2021 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
from __future__ import absolute_import
from huskar_sdk_v2.consts import (
SERVICE_SUBDOMAIN, SWITCH_SUBDOMAIN, CONFIG_SUBDOMAIN)
from huskar_api.service.service import ServiceLink
from huskar_api.models.exceptions import DataConflictError
from huskar_api.models.route import RouteManagement
from huskar_api.models ... |
import base64
import codecs
import datetime
import random
import socket
import string
import json
import traceback
import functools
import logging
import pkg_resources
from twisted.python.failure import Failure
from twisted.internet import defer
from lbryschema.claim import ClaimDict
from lbrynet.core.cryptoutils impor... |
# vim: set fileencoding=utf-8 :
from __future__ import absolute_import, print_function, unicode_literals
import arrow
import logbook
import stethoscope.configurator
import stethoscope.plugins.sources.jamf.utils as jutils
import stethoscope.utils
import stethoscope.validation
logger = logbook.Logger(__name__)
def... |
import streamlit as st
import pandas as pd
import json
import os
from datetime import datetime
from sklearn.metrics import (accuracy_score, auc, f1_score, precision_score, recall_score,
mean_absolute_error, mean_squared_error, r2_score)
st.set_option('deprecation.showfileUploaderEncoding', ... |
# Copyright 2021 Collate
# 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... |
"""Support for Sonarr sensors."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Any
from sonarr import Sonarr, SonarrConnectionError, SonarrError
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
from homeassistant.config_entries i... |
import re
from typing import Annotated, Dict, List, Optional, Tuple
import discord
from cogs.validation.logging import log_death, log_problem
from discord.ext import commands
from fuzzywuzzy import process
from .validation_error import ValidationError
# Groups:
# 1: The name of the choice
# 2: The current number for... |
# This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
"""Key-based clustering methods. Computes a different representation (key) for
each value and clusters val... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bz2 import BZ2File
from gzip import GzipFile
import os
from translate.misc import wStringIO
from translate.storage import factory
from translate.storage.directory import Directory
def classname(filename):
"""returns the classname to ease testing"""
classins... |
import json
from cumulusci.cli.ui import CliTable
from cumulusci.core.exceptions import CumulusCIException
from cumulusci.core.utils import process_list_arg
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class AssignPermissionSets(BaseSalesforceApiTask):
task_docs = """
Assigns Permission Sets whos... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.