text stringlengths 3.07k 22.1k |
|---|
import os
import numpy
import time
from abstract_merge_template import AbstractMergeTemplate, BadFieldDataArguments
from reportlab.pdfgen import canvas
from io import BytesIO
from reportlab.lib.pagesizes import letter
from reportlab.lib.pagesizes import inch
import json
class MergeFieldDef(object):
def __init__... |
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""This is the interface for managing the GRR configuration."""
import StringIO
from google.protobuf import message
from grr.gui import renderers
from grr.gui.plugins import fileview
from grr.gui.plugins import semantic
from grr.lib import access_contr... |
import importlib
import sys
import traceback
from traitlets.config import LoggingConfigurable
from traitlets import (
HasTraits,
Dict,
Unicode,
Bool,
Any,
Instance,
default,
observe,
validate,
)
from .config import ExtensionConfigManager
from .utils import (
ExtensionMetadataE... |
'''
go to line mode where the labels are at the begining of line
and it's something like the relative number mode in vim
1. Add relative line mode.
2. draw labels at the begining of lines in reverse orders.
'''
import sublime
import sublime_plugin
from .motion import LabelObject
from .motion import BufferUndoComm... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""\
usage: ntplogtemp [-h] [-l LOGFILE] [-o] [-q] [-v] [-w WAIT] [-V]
Program to log system temperatures
optional arguments:
-h, --help show this help message and exit
-l LOGFILE, --logfile LOGFILE
append log data to LOGFILE instea... |
import torch
import torchvision
# import some common detectron2 utilities
from detectron2 import model_zoo
from detectron2.engine import (
DefaultPredictor,
DefaultTrainer,
default_argument_parser,
default_setup,
hooks,
launch
)
from detectron2.config import get_cfg
from detectron2.utils.visu... |
# -*- coding: utf-8 -*-
# ==========================================
# Interactive Command Line Interface of CaCo
'''
Canopy Cover (CaCo) V0.1
===========================================================
An objective image analysis method for estimation of canopy
attributes from digital cover photography
* author: ... |
#!/usr/bin/env python
# Copyright (c) 2020 - for information on the respective copyright owner
# see the NOTICE file and/or the repository
# <https://github.com/boschresearch/amira-blender-rendering>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... |
from itertools import permutations
import torch
from torch import nn
from scipy.optimize import linear_sum_assignment
class PITLossWrapper(nn.Module):
r"""Permutation invariant loss wrapper.
Args:
loss_func: function with signature (est_targets, targets, **kwargs).
pit_from (str): Determines ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import unicodedata
import six
from util.util_filepath import *
def convert_to_unicode(text):
"""
将文本转化为utf-8的统一编码,可输出到控制台或日志中的形式
判断python版本以及文本格式并进行处理
:param text: str
... |
#!/usr/bin/env python3
import getopt
import sys
from concurrent.futures import ThreadPoolExecutor, as_completed
import json
import os
from exceptions.api_exception import ApiException
from procedure.hello_world import HelloWorld
from procedure.http_server import HttpServer
from procedure.db_read import DatabaseRead
f... |
# Created by <NAME> at Dec 5 23:33:39 CST 2021
# Life first, G2 second, Code third, LECLERC forth
import os.path
from model import ConvNet, wasteModel_CNN, ResNet, ResBlock
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import Su... |
import decimal
import datetime
class DataTransportTemplate(object):
TYPE_CHECK_MATRIX = None
REQUIRED_ARGS = None
errors = []
def __init__(self, *args, **kwargs):
if not self.TYPE_CHECK_MATRIX:
raise RuntimeError("No data translation matrix !")
for k,v in self.TY... |
from time import time
import numpy as np
from numpy import flatnonzero as find
import copy
import matplotlib.pyplot as plt
def myfun(x):
return sum(x**2 - 10 * np.cos(2*np.pi*x) + 10)
class AFSIndividual:
"""class for AFSIndividual"""
def __init__(self, vardim, bound):
'''
vardim: dim... |
#!/usr/bin/python3
# Copyright 2019 Adobe. All rights reserved.
# This file is licensed to you 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 requir... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 3 of the Lic... |
import json
import os
from pprint import pprint
import pytest
from thumbtack import utils
def test_find_library_support(test_client):
"""
GIVEN a Thumbtack Flask application client
WHEN the '/supported' page is requested (GET)
THEN check that the page shows which libraries it can check
"""
... |
import os.path
import tensorflow as tf
import helper_original
import warnings
from distutils.version import LooseVersion
import project_tests as tests
import math
from glob import glob
from sklearn.model_selection import train_test_split
# Check TensorFlow Version
assert LooseVersion(tf.__version__) >= LooseVersion('1... |
# Copyright (c) 2016-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... |
"""
Primitive operations for 3x3 orthonormal and 4x4 homogeneous matrices.
Python implementation by: <NAME> and <NAME>.
Based on original Robotics Toolbox for Matlab code by <NAME>.
Permission to use and copy is granted provided that acknowledgement of
the authors is made.
@author: <NAME> and <NAME>
@revisor: Avelino... |
"""
Pairs Trading with Kalman Filters
Credit: Quantopian
"""
import numpy as np
import pandas as pd
from pykalman import KalmanFilter
import statsmodels.api as sm
def initialize(context):
# Quantopian backtester specific variables
set_slippage(slippage.FixedSlippage(spread=0))
set_commi... |
from operator import attrgetter
import click
import yaml
from tabulate import tabulate
import ce_api
from ce_api.models import DatasourceCreate, DatasourceCommitCreate
from ce_cli.cli import cli, pass_info
from ce_cli.utils import check_login_status, api_client, api_call, declare, \
format_uuid, find_closest_uuid... |
import threading
import time
import ray
import torch
import torch.nn as nn
import torch.nn.functional as F
from six.moves.queue import Queue
import utils.some_loss as some_loss
import utils.some_trace as some_trace
import gym
from functools import partial
from utils.atari_wrapper import make_atari_by_id, wrap_deepmind... |
# coding=utf-8
import sqlite3
from json import dumps,loads
from datetime import date as time_date
from random import randint
from os.path import realpath,dirname,exists,isfile,abspath
from sys import path
from os import remove,mkdir,rename
from hashlib import sha256
from zipfile import ZipFile
from shutil import rmtree... |
"""Implements access to the DCM Snapshot API"""
from mixcoatl.resource import Resource
from mixcoatl.decorators.lazy import lazy_property
from mixcoatl.decorators.validations import required_attrs
from mixcoatl.utils import camelize, camel_keys, uncamel_keys
from mixcoatl.admin.job import Job
import json
class Snapsh... |
#!/usr/bin/env python
"""
searches for tests for packages in the bioconda-recipes repo and on Anaconda, looking in different file locations. If no test can be found for the specified version, it will look for tests for other versions of the same package.
A shallow search (default for singularity and conda generation ... |
import pandas as pd
import numpy as np
import itertools,os
import networkx as nx
from itertools import permutations
import seaborn as sns
# from sklearn.metrics import jaccard_similarity_score
from sklearn.metrics import pairwise_distances
from sklearn.cluster import AgglomerativeClustering
from ast import literal_eva... |
"""Has binance enums."""
from typing import Final, Literal
class BinanceOrderType:
"""Binance order types."""
LIMIT: Final[Literal["LIMIT"]] = "LIMIT"
MARKET: Final[Literal["MARKET"]] = "MARKET"
STOP_LOSS: Final[Literal["STOP_LOSS"]] = "STOP_LOSS"
STOP_LOSS_LIMIT: Final[Literal["STOP_LOSS_LIMIT"... |
#!/usr/bin/env python
"""Helper tools for reading and writing a config file """
########################################################################
# File: config_helpers.py
# executable: config_helpers.py
#
# Author: <NAME>
# History: 04/01/19 Created
#############################################################... |
from argparse import ArgumentParser
import csv
import sys
from tqdm import tqdm
from genienlp.util import detokenize
import random
import os
import re
import nltk
nltk.download('averaged_perceptron_tagger')
csv.field_size_limit(sys.maxsize)
def is_english(s):
try:
s.encode(encoding='utf-8').decode('ascii'... |
from __future__ import unicode_literals
import re
from .mtv import MTVServicesInfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse,
)
from ..utils import (
ExtractorError,
float_or_none,
unified_strdate,
)
class ComedyCentralIE(MTVServicesInfoExtractor):
_VALID_URL = r'''(?x)... |
# Copyright 2019 Cambridge Quantum Computing
#
# 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 agree... |
# -*- coding: utf-8 -*-
"""
lantz.messagebased
~~~~~~~~~~~~~~~~~~
Implementes base class for message based drivers using PyVISA under the hood.
:copyright: 2015 by Lantz Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from collections import ChainMap
import... |
"""Platform to locally control Tuya-based fan devices."""
import logging
import math
from functools import partial
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.components.fan import (
DIRECTION_FORWARD,
DIRECTION_REVERSE,
DOMAIN,
SUPPORT_DIRECTION,
... |
import libHercMatrix
import scipy
import numpy
import scipy.io
from numpy.lib.recfunctions import append_fields
import traceback
import pprint
import os
import logging
## @package libBXF
#
# Provides IO for BXF format files
## read a BXF file
#
# Supports all versions of the BXF file format, including HERCM, BXF, an... |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from random import getrandbits
from typing import List, Optional, Tuple, cast
from attrdict import AttrDict # type: ignore
from riscvmodel.model import (Model, State, #... |
# Copyright (c) 2019 PaddlePaddle 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 appli... |
from pandas import ExcelWriter
from sqlite3 import Error
from struct import *
import sqlite3
import argparse
import os
import pandas as pd
import numpy as np
OFF = 0
ON = 1
def data_type_info(data_type):
any_value = None
if data_type == np.uint8:
any_value = 0x7F
elif data_type... |
import multiprocessing as mp
import os
from functools import partial
import ee
import numpy as np
import pandas as pd
def tree_to_string(estimator, feature_names, labels=None, output_mode="INFER"):
"""Function to convert a sklearn decision tree object to a string format that EE can interpret
args:
e... |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import util
# %% basic functions
#import profiling.load_configurations as load_configurations
#import profiling.get_profile_bound_acc as get_profile_bound_acc
def load_configurations(file):
if not file.endswith('.npz'):
file += '.... |
from datetime import datetime
import unittest
from scheduler import Scheduler
from rules import *
#TODO: test tz-aware datetime strings
class TestBasicCronRule(unittest.TestCase):
def test_parse_field(self):
strs = {
"5": [5],
"2-9": xrange(2, 10),
"20-30": xrange(2... |
import numpy as np
from datetime import datetime
import os
import subprocess
import time
import tensorflow as tf
import traceback
import argparse
from tacotron.feeder import Feeder
from hparams import hparams, hparams_debug_string
from tacotron.models import create_model
from tacotron.utils.text import sequence_to_t... |
import logging
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly
import plotly.express as px
import plotly.graph_objects as go
import plotly.offline as po
import plotly.io as pio
logger = logging.getLogger(__name__)
def init_logger(log_filename):
logger.... |
#!/usr/bin/python
from __future__ import print_function
from __future__ import absolute_import
import argparse
import time
import logging
import traceback
import openshift as oc
from contextlib import contextmanager
def report_progress(msg):
logging.info('PROGRESS: {}'.format(msg))
def report_verified(msg):
... |
# Copyright 2021, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
import warnings
import datetime
import os
import pickle
import pandas as pd
import numpy as np
from sklearn.metrics import accuracy_score, explained_variance_score
import seaborn as sns
import matplotlib.pyplot as plt
def save_obj(obj, path):
with open(path, "wb") as f:
pickle.dump(obj, f, pickle.HIGHEST_... |
# Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import pandas as pd
import plotly.graph_objs as go
# Imports from this application
from app import app
url = 'https:/... |
"""
Script to solve a sudoku puzzle.
The algorithm will work by first finding low hanging fruit
and if no obvious moves available use a standard backtracking algorithm
The sudoku board will be 9x9 list inside a list.
First index is row and second index is column
0 represents empty square
"""
class GameOfSudoku(obj... |
"""
Copyright (c) YugaByte, Inc.
This module provides utility and helper functions to work with a remote server through SSH.
"""
import json
import os
import shlex
import subprocess
import time
import logging
REMOTE_BUILD_HOST_ENV_VAR = 'YB_REMOTE_BUILD_HOST'
DEFAULT_BASE_BRANCH = 'origin/master'
CONFIG_FILE_PATH = ... |
import tensorflow as tf
def activation(x):
return x * tf.math.sigmoid(x)
def softmax(x, axis=-1):
ex = tf.exp(x - tf.reduce_max(x, axis=axis, keepdims=True))
return ex / tf.reduce_sum(ex, axis=axis, keepdims=True)
class embed(tf.keras.layers.Layer):
def __init__(self, num_vocab, num_hidden, name, w_i... |
from enum import Enum
from pyomo.kernel import *
import pyomo.core.kernel as pck
from collections import defaultdict
import math
# Note to future self, we're doing this as ugly and fast as possible to start with
# Completely going for pure filth to just get this done asap, please forgive me
class State(Enum):
ST... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json, logging, os, pprint
from django.conf import settings
from django.contrib.auth import authenticate
from django.http import HttpResponse
from iip_processing_app.models import Status
log = logging.getLogger(__name__)
class UserGrabber(objec... |
"""This module handles copying the Electron Cash data dir
to the Electrum ABC data path if it does not already exists.
The first time a user runs this program, if he already uses Electron Cash,
he should be able to see all his BCH wallets and have some of the
settings imported.
"""
import logging
import os
import shut... |
import numpy as np
import time
from astropy import wcs
from tabulate import tabulate
import astropy.io.fits as fits
import pandas as pd
def setdiff_nd(a1, a2):
"""
python 使用numpy求二维数组的差集
:param a1:
:param a2:
:return:
"""
# a1 = index_value
# a2 = np.array([point_ii_xy]... |
# -*- coding: utf-8 -*-
import os
import cv2
import random
import shutil
import numpy as np
import torch
import torch.backends.cudnn as cudnn
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
... |
import json
import pandas as pd
import numpy as np
from agent_adp import ActiveDynamicalProspectionAgent
from environment import Env
from collections import defaultdict
from datetime import datetime
from time import time
import matplotlib.animation as manimation
import matplotlib.pyplot as plt
from constants import M... |
import importlib
import json
import logging
import os.path
import re
from abc import ABC, abstractmethod
from glob import glob
from typing import Any, Dict, Generator, List, Tuple, Union, cast
from unittest.mock import call, patch
import pytest
from _pytest.mark.structures import ParameterSet
from ethereum import rlp... |
#
# 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
# ... |
# Copyright (c) 2021, <NAME>
# 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 conditions and the foll... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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... |
"""
Standard functions available in shaders. This module allows users to discover
the functions, read their docs, and keep flake8 happy.
"""
import math
NI = "Only works in the shader."
tex_functions = {"imageLoad", "read", "imageStore", "write", "sample"}
def read(texture, tex_coords): # noqa: N802
"""Load... |
# Service creators for SystemD, macOS, Windows
import logging
from pathlib import Path
from Utils import Utils
from SubProcessor import SubProcessor
logger = logging.getLogger(__name__)
utils = Utils
subprocessor = SubProcessor()
class SystemD(object):
def __init__(self, service_mode, service_name, description,... |
# pylint: disable=C0301
"""
This modules implements the reader for the ERG binary file type generate by
IPG CarMaker.
"""
import re
import sys
from collections import OrderedDict
import numpy as np
import pandas as pd
import datetime
from asammdf import Signal, MDF
from asammdf import __version__ as asammdf_version
... |
import shutil
import warnings
from abc import ABC
import json
from pathlib import Path
from typing import Dict, Union, Type
import cpuinfo
import numpy as np
import tensorflow as tf
import torch
from nebullvm.config import OPENVINO_FILENAMES
from nebullvm.inference_learners.base import (
BaseInferenceLearner,
... |
from bs4 import BeautifulSoup
import helpers
import copy
import requests
import re
import nltk
from datetime import datetime, time
import random
import os
import urllib.parse
tasks = input("Enter your tasks for the day (Ex. Meditation, Jog, Workout, Study) : ")
sleep_schedule = input("Enter you Sleep schedule (Ex. ... |
"""
Plotting helpers for combining model outputs.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
import matplotlib as mpl
from mainmodel.helper_compute import *
from thex_data.data_consts import *
import pickle
LSST_COLOR = "#80ccff"
THEX_COLOR = "#006600"
def load_prev_exp(exp_d... |
#!/usr/bin/env python3
import sys
import os
import re
import string
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import ssl
import socket
class indicator():
def __init__(self):
self.causes = []
self.score = 0
self.causesdict = {"body" :... |
#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
r"""Parses cdc report and dump filtered messages in hjson format.
"""
import argparse
import logging as log
import re
import sys
import os
import hjso... |
import uuid
import json
import os.path as path
import IPython
web_assets_dir = path.join(path.dirname(path.realpath(__file__)), 'web_assets')
def _valid_limit(limit):
return (
isinstance(limit, list) and
len(limit) == 2 and
(limit[0] is None or isinstance(limit[0], (float, int))) and
... |
from flask import Flask, request, abort
import requests
import re
import random
import configparser
import urllib3
from bs4 import BeautifulSoup
from initialization import Initialization
import json
import pandas as pd
import csv
from db import DbHelper
'''import linebot sdk'''
from linebot import (
LineBotApi, W... |
import os
from datetime import datetime
from uuid import uuid4
import pandas as pd
from h2o_wave import ui, Q, app, main
from rainforest.config import N_SPECIES
from rainforest.pann import load_pretrained_model, get_model_predictions_for_clip
from rainforest.utils import show_references, get_candidates, get_annotatio... |
"""
Actions
-------
These classes intepret policy manager output to produce instructions for Postfix."""
import functools
from chapps.config import config
from chapps.policy import GreylistingPolicy
class PostfixActions:
"""Superclass for Postfix action adapters"""
@staticmethod
def dunno(*args, **kwarg... |
"Docstring-parsing methods"
import re
import inspect
import ast
import numpy as np
def expected_unbounded(instance, doc):
"Gets expected-unbounded variables from a string"
# pylint: disable=too-many-locals,too-many-nested-blocks
exp_unbounded = set()
for direction in ["upper", "lower"]:
flag =... |
import os
import pytest
import torch
import torch.distributed as dist
from ignite.distributed.comp_models import has_native_dist_support
if not has_native_dist_support:
pytest.skip("Skip if no native dist support", allow_module_level=True)
else:
from ignite.distributed.comp_models.native import _NativeDistMo... |
# -*- coding: utf-8 -*-
# Copyright (C) 2016 UKP lab
#
# Author: <NAME> (ukp.tu-darmstadt.de/ukp-home/)
#
# Note: Throughout the code we refer to a conjunction of relations in the same sentence as '(relation) graph'
import numpy as np
kbid_numerical = "_NUMERICAL"
kbid_date = "_DATE"
kbid_empty = "_EMPTY"
LEGACY_MOD... |
#!/usr/bin/env python
"""
Pulls all messages from the 'index' queue, creating a list of WARCs for all
jobs therein. Submits a CDX-indexing job to Hadoop, outputting to
/wayback/cdx-index/.
"""
import os
import sys
import glob
import pika
import logging
import webhdfs
import tempfile
import subprocess
from sipverify i... |
from pathlib import Path
from typing import List, Tuple, Dict
import h5py
import torch
import pandas as pd
import numpy as np
from tqdm import tqdm
from torch.utils.data import Dataset
from .datautils import (load_discharge,
load_forcings_lumped,
load_static_attributes,... |
"""
Jira Ticket Number(s): DEV-2116
DEV-2116 is about integrating Broker's new subaward table into USAspending.
Expected CLI:
$ python usaspending_api/database_scripts/job_archive/reset_awards_subaward_rollups.py
Purpose:
As part of DEV-2116, we will need to fully reload the subaward table. It
was... |
import datetime
import inspect
import os
from pysc2.agents.myAgent.myAgent_4.decisionMaker.DQN import DQN
import pysc2.agents.myAgent.myAgent_4.smart_actions as sa
import pysc2.agents.myAgent.myAgent_4.macro_operation as mo
import numpy as np
from pysc2.env.environment import StepType
from pysc2.lib import actions
m... |
import random
import time
from datetime import timedelta
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from django.utils import timezone
from faker import Factory
from ....categories.models import Category
from ....core.pgutils import chunk_queryset
from ....thread... |
#!/usr/bin/env python3
""" Convert from pre-trained models. """
import argparse
import math
import os
import sys
from collections import OrderedDict
from dataclasses import dataclass
from typing import Dict
import numpy as np
import onnx
import toml
from onnx import shape_inference
from pydeacon.graph import (
D... |
# -*- coding: utf-8 -*-
"""
Utilities that assist in building ancillary USID datasets manually.
Formerly known as "write_utils"
Created on Thu Sep 7 21:14:25 2017
@author: <NAME>, <NAME>
"""
from __future__ import division, print_function, unicode_literals, absolute_import
import sys
import numpy as np
from sidpy.b... |
# -*- coding: utf-8 -*-
import re
import time
import pytest
from PIL import Image, ImageStat
from plexapi.exceptions import BadRequest, NotFound
from plexapi.server import PlexServer
from plexapi.utils import download
from requests import Session
from . import conftest as utils
def test_server_attr(plex, account):
... |
from discord import Embed, Member, Status
from discord.ext.commands import Cog, command, group, Greedy
from typing import Union
from cogs.converters import CommandConverter
from cogs.errors import get_error_message, NotAGuildManager, NotInGuild, NOT_A_GUILD_MANAGER_ERROR, NOT_IN_GUILD_ERROR
from cogs.predicates import... |
"""Vizio SmartCast API protocol constants and get and set functions."""
import json
from logging import Logger, getLogger
from typing import Any, Dict
from aiohttp import ClientResponse, ClientSession, ClientTimeout
from aiohttp.client import DEFAULT_TIMEOUT as AIOHTTP_DEFAULT_TIMEOUT
import jsonpickle
from pyvizio.... |
"""The Camera Module used to create camera models
As the book goes, we can create a camera with a total of 11
intrinsic and extrinsic parameters. If some parameters are not
available, you can make them variable and change them during the
calibration process.
"""
import warnings
import numpy as np
from ..utils import t... |
import copy
from collections import namedtuple
from collections import OrderedDict
import utils
import typ as typ_m
PreTs1Res = namedtuple('PreTs1Res', ['sym', 'sub'])
Ts1Res = namedtuple('Ts1Res', ['sym', 'sub', 'n'])
# PreTsRes = namedtuple('PreTsRes', ['tree', 'sub'])
TsRes = namedtuple('TsRes', ['tree', 'sub', '... |
from pathlib import Path
import subprocess
import re
import os
import signal
import time
own_diff_executable_sequential_measure_snakes = (
Path(__file__).parent / "../bin/own-diff-sequential-measure-snakes.out"
)
diffutils_executable = Path(__file__).parent / "../bin/diffutils.out"
def _add_missing_fields_of_pro... |
"""
iamgeset.py
Written by <NAME>, 2019
Apache License
Implements a dataset for images of a single resolution
"""
import math
import os
import os.path as p
import cv2
import numpy as np
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
import config.config as config
def creat... |
import subprocess
import numpy as np
import pandas as pd
import mydatapreprocessing
import mypythontools
mypythontools.paths.PROJECT_PATHS.add_ROOT_PATH_to_sys_path()
from conftest import validate_result
import predictit
from predictit import config
def test_default_config_and_outputs():
config.reset()
r... |
from sqlalchemy import create_engine, Column, Table, ForeignKey, MetaData
from sqlalchemy.orm import relationship # , foreign
from sqlalchemy.ext.declarative import declarative_base # DeclarativeBase
from sqlalchemy import (
Integer, String, Date, DateTime, Float, Boolean, Text)
from scrapy.utils.project import g... |
# -*- coding: utf-8 -*-
"""Extensions to the PyBEL manager to support PyBEL-Web."""
import datetime
import itertools as itt
import logging
import time
from collections import defaultdict
from typing import Dict, Iterable, List, Mapping, Optional, Set, Tuple
import werkzeug.datastructures
from flask_security import S... |
import appdaemon.plugins.hass.hassapi as hass
import struct
import binascii
import codecs
class Climate(hass.Hass):
ir_topic = "home/remote/rm2/code/set"
split_state = "None"
timer = None
fan_speed = "4"
def initialize(self):
self.listen_event_handle_list = []
if "ha_panel" not in self.args or "door... |
from typing import Optional
import torch
import torch.autograd as autograd
import torch.distributed as distributed
from torch.autograd.function import once_differentiable
from . import _backend
def _activation_from_name(activation):
if activation == "leaky_relu":
return _backend.Activation.LeakyReLU
... |
"""Fundamental dtypes for use in strax.
Note that if you change the dtype titles (comments), numba will crash if
there is an existing numba cache. Clear __pycache__ and restart.
TODO: file numba issue.
"""
import numpy as np
import typing as ty
import numba
__all__ = ('interval_dtype raw_record_dtype record_dtype hi... |
from collections import deque
import collections.abc
from typing import IO, Mapping, Sequence, Union
from . import serialization
@serialization.serializable
class TrieNode:
def __init__(self, value=None, sources=None, _children=None):
if _children is None:
self._children: Mapping[object, Trie... |
#!/usr/bin/env python3
# md_lj_module.py
#------------------------------------------------------------------------------------------------#
# This software was written in 2016/17 #
# by <NAME> <<EMAIL>>/<<EMAIL>> #
# and <NAME> <<EMAIL>> ... |
import datetime
import shutil
import services.inventory
import workflow
import pandas as pd
import os
import file_system
import file_system.images as images
import json
from file_system.file_system_object import FileSystemObject
from services import inventory, library
from tabulate import tabulate
import cv2
TEMP_FOL... |
"""This module defines the base Packet class and helper functions."""
import enum
import inspect
from copy import copy
from typing import Iterable, Dict, Union, Any, Callable, List, Type
from kifurushi.utils.network import hexdump
from .abc import Field, CommonField
from .fields import BitsField, FieldPart, Conditiona... |
# The purpose of this script is to collect all the station data into a single data structure.
# This will require regular expressions to find things like station changes.
#the hope is that we can simply export this single data structure to a single file is whatever format we want.
# Need to figure out how to deal ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.