text stringlengths 3.07k 22.1k |
|---|
from __future__ import print_function
import argparse
import os
import shutil
import warnings
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from python.torx.module.layer import crxb_Conv2d, crxb_Conv2d_dw
from python.torx.m... |
import gevent
import gevent.monkey
gevent.monkey.patch_all()
import pytest
from cookielib import CookieJar
from urllib2 import Request
import string
import random
import time
from geventhttpclient.response import HTTPResponse
from geventhttpclient.header import Headers
MULTI_COOKIE_RESPONSE = """
HTTP/1.1 200 OK
Se... |
#
# Copyright (c) 2018 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... |
# You need a player to find a thing but you'd rather subcontract out the finding bits.
from pbge.plots import Plot, PlotState
from game.content import plotutility, gharchitecture, ghwaypoints, ghcutscene
import gears
import pbge
from game import teams
import random
import game.content.plotutility
import game.content.gh... |
#!/usr/bin/env python3
import random
import sys
import traceback
from collections import defaultdict
COLOURS = ['green', 'blue', 'orange', 'yellow', 'white']
COLOUR_MAP = {
'g': 'green',
'b': 'blue',
'o': 'orange',
'y': 'yellow',
'w': 'white',
}
MAX_SQUARE_DIST = 4
MAX_POS = 0
MAX_SQUARES = 4
ROL... |
"""
{
'Index': '1',
'PROVINCE_N': 'Eastern',
'DISTRICT_N': 'Ampara',
'Polling_D': 'Potuvil',
'DSD_N': 'Addalachchenai',
'Local_Gov': 'Addalachchenai PS',
'Ward': 'Arafa',
'Type_Ward': '',
'GND_N': 'Addalachchenai 01',
'GND_NO': 'AD/33',
'Votes': '772',
'TOT_POP': '1108',... |
"""
Mappings that tell the _JsonEngine the user facing attribute names and the
steps needed to get there in a JSON dictionary
"""
from __future__ import annotations
from abc import ABC
from collections import deque
from copy import deepcopy
from typing import Dict, List, Union
# pylint: disable=used-befo... |
# The MIT License (MIT)
# Copyright (c) 2016 satojkovic
# 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, m... |
import base64
import json
import plistlib
import glob
import os
import os.path
from types import SimpleNamespace
import shutil
import sys
import click
import nacl.pwhash
import nacl.secret
import nacl.exceptions
import passlib.totp
from PyInquirer import prompt
import pyperclip
from rich import print
from .ios_backup... |
# -*- coding: utf-8 -*-
# File: keras.py
import tensorflow as tf
import six
from tensorflow import keras
from tensorflow.python.keras import metrics as metrics_module
from ..models.regularize import regularize_cost_from_collection
from ..train import Trainer, SimpleTrainer, SyncMultiGPUTrainerParameterServer
from ..t... |
# HQ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# HQ X
# HQ X quippy: Python interface to QUIP atomistic simulation library
# HQ X
# HQ X Portions of this code were written by
# HQ X <NAME>, <NAME>
# HQ X
# HQ X Copyright 2019
# HQ X
# HQ X These portions of the source code... |
"""
Copyright 2018 Duo Security
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 following
disclaimer.
2. Redistribut... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
#
# check-html-ids.py - Catch and fix id= errors. Makes life easier
# inserting new Navigation Bars without having to renumber dozens of
# existing sections below.
#... |
############################################################################
#
# AppLauncher - Application Launcher for SAGE
# Copyright (C) 2006 Electronic Visualization Laboratory,
# University of Illinois at Chicago
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# mo... |
import logging
import os
import re
import voluptuous as vol
from esphome import automation, pins
import esphome.config_validation as cv
from esphome.const import ARDUINO_VERSION_ESP32_DEV, ARDUINO_VERSION_ESP8266_DEV, \
CONF_ARDUINO_VERSION, CONF_BOARD, CONF_BOARD_FLASH_MODE, CONF_BRANCH, CONF_BUILD_PATH, \
C... |
'''
By <NAME> (<EMAIL>)
- Oct 26, 2018
'''
from bs4 import BeautifulSoup
import requests
from urllib.request import urlretrieve
from datetime import datetime as dt
import os, re
from pathlib import Path
import codecs
# f=codecs.open("./data/AAPL/20151028.htm", 'r')
data_format = '10-k'
DOMIN = 'https://www.sec... |
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Stitch four camera images to form the 360 surround view
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import numpy as np
import cv2
import yaml
import os
from paramsettings import *
W, H = 640, 480
work_dir = "./yaml"
car_image = os.path.join(w... |
# Generated file, please do not change!!!
import datetime
import enum
import typing
from ._abstract import _BaseType
from .common import TaskStatusEnum
if typing.TYPE_CHECKING:
from .common import LocalizedString, Money, ProductReference, TaskStatusEnum
__all__ = [
"ProductSetSelector",
"SimilarProduct"... |
#code to average data and graph averaged data
#to install dependencies: conda install selenium phantomjs pillow
import csv, urllib.request, codecs, datetime
import numpy as np
from bokeh.plotting import figure, show, output_file, save, ColumnDataSource
from bokeh.plotting.figure import Figure
from bokeh.models import... |
import datetime as dt
import json
from urllib.parse import urlparse
import pytz
import vobject
from django.template.loader import get_template
from django.utils.functional import cached_property
from i18nfield.utils import I18nJSONEncoder
from pretalx import __version__
from pretalx.common.exporter import BaseExporte... |
"""Climate support for Shelly."""
from __future__ import annotations
import asyncio
import logging
from types import MappingProxyType
from typing import Any, Final, cast
from aioshelly.block_device import Block
import async_timeout
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN, ClimateEntity
... |
#!/usr/bin/env python
import os
from shutil import copy2
from distutils.dir_util import copy_tree
from argparse import ArgumentParser
import xml.etree.cElementTree as ET
import json
#./generate-quick3d-project.py -o Q:\Code\temp -b Q:\Code\qt5-5.15-msvc2019\qtbase\bin\balsam.exe -i 2.0
def generate_ios_bundle_data(ou... |
import os
import gym
import gym_kuka_mujoco
import numpy as np
import argparse
import commentjson
from stable_baselines import PPO2, SAC
from stable_baselines.common.vec_env import DummyVecEnv, SubprocVecEnv, VecNormalize
from stable_baselines.common.policies import MlpPolicy as AC_MlpPolicy
from stable_baselines.sac.... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Red Hat, 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 applicab... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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... |
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
# DB Server http://192.168.0.154:8080
import face_recognition_api
import cv2
import os
import pickle
import datetime
import cx_Oracle
import pandas as pd
import csv
def getTime(type_print):
if type_print == 1:
return datetime.datetime.now().strftime('%Y-%m-%d %H-%M')
else:
return datetime.datet... |
import numbers
from typing import Optional, Union, Any, Callable, Sequence
import torch
from ignite.metrics import Metric, MetricsLambda
from ignite.exceptions import NotComputableError
from ignite.metrics.metric import sync_all_reduce, reinit__is_reduced
__all__ = ["ConfusionMatrix", "mIoU", "IoU", "DiceCoefficient... |
from __future__ import with_statement, unicode_literals
import os
import re
try:
from bs4 import BeautifulSoup
except ImportError:
from BeautifulSoup import BeautifulSoup
from django.utils import six
from django.core.cache.backends import locmem
from django.test import SimpleTestCase
from django.test.utils im... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import glob
import os
from scipy import stats
import tensorflow as tf
import math
import random
# matplotlib inline
# plt.style.use('ggplot')
normalization_coef = 9
batch_size = 10
kernel_size = 30
depth = 20
num_hidden = 100
num_channels = 3
l... |
# coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from contextlib import closing
import mysql.connector
import sqlite3
from progress.bar import IncrementalBar
from clasificador.herramientas.define import DB_HOST, DB_USER, DB_PASS, DB_NAME, SUFIJO_PROGRESS_BAR, DB_ENGINE... |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
if sys.version_info[0] < 3:
from builtins import input
import os
import sys
import tempfile
import six
package_root = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
sys.path.insert(0, package_root)
from payfacM... |
# ######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... |
import argparse
import numpy as np
import matplotlib
from matplotlib import pyplot
from glob import glob
import os
from collections import OrderedDict
import seaborn
seaborn.set()
parser = argparse.ArgumentParser("Plot set of evaluation results.")
parser.add_argument('results', help="Log files to plot", n... |
#!/usr/bin/python
# Copyright (C) 2013 <NAME>, FoldedSoft e.U.
#
# 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... |
# -*- coding: utf-8 -*-
#
# Represents a file that can be signed. A file that
# conforms to the Mach-O ABI.
#
# Executable, dylib, or framework.
#
from abc import ABCMeta
from codesig import (Codesig,
EntitlementsSlot,
ResourceDirSlot,
RequirementsSlot,
... |
"""
audio feature extract
"""
# coding: utf-8
import os
import numpy as np
import pickle
import mfcc.vgg_params as vgg_params
def frame(data, window_length, hop_length):
"""
frame
"""
num_samples = data.shape[0]
#print("window_length , hop_length", window_length, hop_length)
#print("num_sample... |
import logging
import os
import sys
import threading
import urllib.parse
import pyls_jsonrpc.dispatchers
import pyls_jsonrpc.endpoint
import pyls_jsonrpc.streams
from collections import defaultdict
from dataclasses import dataclass
from functools import wraps
from pathlib import Path, PurePath
from typing import (
... |
import numpy as np
import torch
from torch.nn import Module, Sequential, Linear, Tanh, Parameter, Embedding
from torch.distributions import Categorical, MultivariateNormal
import rsa.utils.pytorch_utils as ptu
class GAIL(Module):
def __init__(
self,
state_dim,
action_dim,
... |
from __future__ import absolute_import, unicode_literals
from mopidy import compat
from mopidy.models import fields
from mopidy.models.immutable import ImmutableObject, ValidatedImmutableObject
from mopidy.models.serialize import ModelJSONEncoder, model_json_decoder
__all__ = [
'ImmutableObject', 'Ref', 'Image', ... |
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import editdistance as ed
# CreateOnehotVariable function
# *** DEV NOTE : This is a workaround to achieve one, I'm not sure how this function affects the training speed ***
# This is a function to generate an one-hot encoded t... |
#!/usr/bin/env python2.7
# Amazon FPGA Hardware Development Kit
#
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of the License is
# located at
#
# htt... |
# -*- coding: utf-8 -*-
# @Time : 2020/5/30 4:22 下午
# @Author : Qingduo-Feng
# @File : FeatureCalculation.py
# @Function:
import numpy as np
import pandas as pd
import math
def eduDis(a, b):
dis = np.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
return dis
def straightline(point2, point1):
k = (point2... |
"""
Mostly equivalent to the views from django.contrib.auth.views, but
implemented as class-based views.
"""
from __future__ import unicode_literals
import warnings
from django.conf import settings
from django.contrib.auth import (
get_user_model, update_session_auth_hash,
REDIRECT_FIELD_NAME, login as auth_lo... |
#!/usr/bin/env python
import numpy as np
import os
def read_column(file, firstline):
"""read a column from first line (e.g. n01c001) to *eof"""
column = list()
line = firstline
# register methods for faster evaluation
f_readline = file.readline
column_append = column.append
# r... |
"""
Copyright (c) 2021 Intel Corporation
\file distgnn/partition/main_Libra.py
\brief Libra - Vertex-cut based graph partitioner for distirbuted training
\author <NAME> <<EMAIL>>,
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>,
<NAME> <<EMAIL>>,
<NAME> <<EMAIL>>
<NAME> <<EMAI... |
import dash
import dash_html_components as html
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import altair as alt
import pandas as pd
from dash.dependencies import Input, Output
from vega_datasets import data
#Dash App Initialize
app = dash.Dash(__name__, external_stylesheets = ['https:/... |
# 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 not u... |
#!/usr/bin/env python2
import logging
import multiprocessing
import os
import signal
import subprocess
import sys
import requests
processes = []
logging.basicConfig()
logger = logging.getLogger('bootstrap')
def bootstrap(_return=0):
"""
Initialize role of running docker container.
master: web interfa... |
import pandas as pd
import numpy as np
from sklearn.base import TransformerMixin, BaseEstimator
from sklearn.feature_extraction import DictVectorizer
from sklearn.preprocessing import FunctionTransformer, StandardScaler, RobustScaler
from sklearn.preprocessing import Imputer, MultiLabelBinarizer
from sklearn.impute imp... |
# Copyright (c) 2015 Cisco 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 law or agreed to i... |
"""
Title: Image segmentation with a U-Net-like architecture
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2019/03/20
Last modified: 2020/04/20
Description: Image segmentation model trained from scratch on the Oxford Pets dataset.
"""
"""
## Download the data
"""
"""shell
curl -O https://www.robots.ox... |
"""WHR Wiener process model"""
# Copyright Contributors to the Climbing Ratings project
#
# 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
#
#... |
import json
import os
import shutil
from flask import request
from assemblyline.common.codec import decode_file
from assemblyline.common.dict_utils import flatten
from assemblyline_ui.api.base import api_login, make_api_response, make_subapi_blueprint
from assemblyline_ui.config import TEMP_SUBMIT_DIR, STORAGE, confi... |
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import preprocessing
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report,accuracy_score
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier,GradientBoostingClassifier
im... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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... |
import logging
import sys
import time
from collections import defaultdict
from typing import Dict
from dagster import DagsterEvent, DagsterEventType
from dagster import _check as check
from dagster.core.events.log import EventLogEntry
from dagster.core.instance import DagsterInstance
from dagster.core.storage.pipeline... |
'''
sqlhelpers
==========
This module provides functions for SQL string manipulation that I need often.
Most importantly, creating the right number of ? for binding insert / update
statements.
'''
import re
import types
def delete_filler(pairs):
'''
Manually aligning the bindings for DELETE statements is anno... |
import chemdataextractor as cde
from chemdataextractor import Document
from chemdataextractor.reader import acs,base,cssp,HtmlReader,NlmXmlReader,PdfReader,RscHtmlReader,XmlReader
from chemdataextractor.model import Compound, UvvisSpectrum, UvvisPeak, BaseModel, StringType, ListType, ModelType
from chemdataextractor.pa... |
# -------------------------------------------------------------------------
# Copyright (c) <NAME>. All rights reserved.
# Licensed under the Apache License, Version 2.0. See
# License.txt in the project root for license
# information.
# ---------------
"""
The sync selection is used to prepare one or more directories... |
from picamera.array import PiRGBArray
from picamera import PiCamera
from time import sleep
import time
import _datetime
import numpy as np
import os
import matplotlib.pyplot as plt
import cv2
from imageio import imread
from scipy.spatial import distance
from keras.models import load_model
import pandas as pd
from tqdm ... |
#!/usr/bin/env python
###
# File Created: Wednesday, February 6th 2019, 9:05:13 pm
# Author: <NAME> <EMAIL>
# Modified By: <NAME>
# Last Modified: Friday, February 8th 2019, 1:06:21 pm
###
import os
from os.path import isfile, join, split
import glob
import pandas as pd
# Timeseries data
import datetime
import numpy ... |
from pathlib import Path
import click
import pandas as pd
from covid_model_seiir_pipeline.lib import (
cli_tools,
static_vars,
)
from covid_model_seiir_pipeline.pipeline.forecasting import model
from covid_model_seiir_pipeline.pipeline.forecasting.specification import ForecastSpecification
from covid_model_se... |
#!/usr/bin/env python
import time
import datetime
try:
import unicornhathd as unicorn
print("unicorn hat hd detected")
except ImportError:
from unicorn_hat_sim import unicornhathd as unicorn
unicorn.rotation(180)
unicorn.brightness(0.5)
secondsProgressRow = 10
# There are 4 different types of patterns ... |
"""
Copyright 2018 EPAM 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 law or agreed... |
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Perfectly random domino tiling of a rectangle using
Propp-Wilson's "coupling from the past" algorithm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import random
from .cftp import MonotoneMarkovChain
def generate_path(k, n, offset=0, flip=False):
r... |
"""Matplotlib based plotting of quantum circuits.
Todo:
* Optimize printing of large circuits.
* Get this to work with single gates.
* Do a better job checking the form of circuits to make sure it is a Mul of
Gates.
* Get multi-target gates plotting.
* Get initial and final states to plot.
* Get measurements to plo... |
# 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... |
# Copyright (c) <2016> <<NAME>>. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or a... |
import numpy as np
import torch
import torch.nn.functional as F
import torchvision
from sklearn.cluster import KMeans
from proj.utils.cluster.data import _cifar100_to_cifar20, \
_create_dataloaders, _create_mapping_loader
from proj.utils.cluster.eval_metrics import _hungarian_match, _acc
from proj.utils.cluster.tr... |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2021, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... |
"""Module for calling mdslides as an executable."""
import pathlib
from pathlib import Path
import argparse
import shutil
import re
from .pdf import export as pdf_export
DATA_WORD = "DATA"
TITLE_WORD = "TITLE"
OPTIONS_WORD = "Reveal.initialize({"
THEME_WORD = '<link rel="stylesheet" href="dist/theme'
CODE_THEME_WORD =... |
import collections
import json
import os
from typing import Dict, Optional, Any, Union
from packaging import version
import torch
from torch import nn
import torch.nn.functional as F
from torch.utils.data.dataloader import DataLoader
from torch.utils.data.dataset import Dataset
from torch.utils.data.distributed import... |
#!/usr/bin/env pyhton
# -*- coding: UTF-8 -*-
__author__ = '<NAME>'
__date__ = '06/02/2021'
__version__ = '1.0'
r'''
This script predicts output MSP using a trained regression model and performs:
1. Sensitivity analysis with one query input;
2. Response analysis with two query inputs;
3. Monte Carlo simulation with... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from dataclasses import dataclass
from enum import Enum
from typing import TYPE_CHECKING, Iterable, Optional, Tuple, Union
# Re-export GlobMatchErrorBehavior here as part of the public Pl... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... |
import logging
import torch
import torch.nn as nn
from torch.nn import functional as F
import numpy as np
import pykp
from pykp.modules import RNNEncoder, RNNDecoder
class Seq2SeqModel(nn.Module):
"""Container module with an encoder, deocder, embeddings."""
def __init__(self, opt):
"""Initialize mode... |
from collections import namedtuple
# Module with all the conversion functions used for registers
#
# All conversion functions follow an upper case convention to differentiate them
# from other regular functions.
class Result(namedtuple("Result", ["register", "unit", "value"])):
"""
@type register: integer
... |
# -*- coding: utf-8 -*-
"""
:Created: 3/12/14
:Author: timic
"""
import datetime
import os
from lxml import etree
from .._base import BaseSmev, BaseSmevWsdl
from .._utils import EmptyCtx, el_name_with_ns
from .. fault import ApiError as _ApiError
from .. import _xmlns as ns
from model import MessageType, ServiceTyp... |
"""Databases Utilities."""
import logging
from typing import Any, Dict, Generator, Iterator, List, NamedTuple, Optional, Tuple, Union, cast
import boto3
import pandas as pd
import pyarrow as pa
from awswrangler import _data_types, _utils, exceptions, secretsmanager
from awswrangler.catalog import get_connection
_lo... |
import numpy as np
import struct
from collections import namedtuple
from itertools import chain
from typing import Iterator, Tuple, Optional, List, Iterable
from typing import TYPE_CHECKING
from aim.storage.context import Context
from aim.sdk import Run
from aim.sdk.sequences.metric import Metric
from aim.sdk.objects... |
#!/usr/bin/env python
# Copyright 2019, 2021 Hewlett Packard Enterprise Development LP
#
# 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
# th... |
#!/usr/bin/env python3
from xdg.BaseDirectory import xdg_config_home
from enum import Enum
import subprocess
import platform
import distro
import json
import re
import os
import wmctrl
colors = [
# Regular colors.
"\u001b[30m",
"\u001b[31m",
"\u001b[32m",
"\u001b[33m",
"\u001b[34m",
"\u001... |
from os import listdir, stat
from os.path import isfile, join, relpath
from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin
from django.core.paginator import Paginator
from django.htt... |
import torch
import torch.nn as nn
from .rgb import linear_rgb_to_rgb, rgb_to_linear_rgb
from .xyz import rgb_to_xyz, xyz_to_rgb
"""
The RGB to Lab color transformations were translated from scikit image's rgb2lab and lab2rgb
https://github.com/scikit-image/scikit-image/blob/a48bf6774718c64dade4548153ae16065b595ca9/... |
from flask import jsonify, request, current_app
from marshmallow import missing, EXCLUDE, ValidationError, fields
import collections
from functools import wraps
import inspect
# Find the stack on which we want to store the database connection.
# Starting with Flask 0.9, the _app_ctx_stack is the correct one,
# before... |
import pdfrw
from pdf2image import convert_from_path # Needs conda install -c conda-forge poppler
from PIL import Image
from collections import OrderedDict
ANNOT_KEY = '/Annots' # key for all annotations within a page
ANNOT_FIELD_KEY = '/T' # Name of field. i.e. given ID of field
ANNOT_FORM_... |
# -*- coding: utf-8 -*-
"""
Scan all existing and not dead IP addresses from specified networks,
environments or data centers. This Scan tries to extract all possible data
from all available plugins. It also calculates checksum from plugins results.
This checksum is usefull to detect possible changes on devices.
"""
... |
import logging
import struct
from typing import (
Iterable,
List,
Optional,
Set,
Tuple,
)
from arcade import (
Sprite,
Point,
rotate_point,
are_polygons_intersecting,
get_distance_between_sprites,
is_point_in_polygon,
get_window,
)
from .sprite_list import SpriteList
L... |
import logging
import os
from functools import partial
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import zarr
from PIL import Image
from numcodecs import Blosc
import models
import utils
seg_model_types = {"UNetNoBridge": models.UNetNoBridge, "UNet": models.UNet, ... |
import hashlib
import os
import os.path as osp
import re
from datetime import datetime
import h5py
import numpy as np
import pandas as pd
from mne import get_config, set_config
from mne.datasets.utils import _get_path
from sklearn.base import BaseEstimator
def get_string_rep(obj):
if issubclass(type(obj), BaseEs... |
'''we take the SAN backbone as an ablation study,
and use the same object features with UpDn for simplicity.'''
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
from language_model import WordEmbedding, QuestionEmbedding
from classifier import SimpleClassifier, PaperC... |
from bottle import run, get
from bs4 import BeautifulSoup
import requests
import json
# from pytube import YouTube
import pafy
from sqlalchemy import Column, ForeignKey, Integer, String, create_engine, update
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, sessionmaker
f... |
#!/usr/bin/env python
# coding: utf-8
# In[7]:
import pandas as pd
import numpy as np
from os.path import dirname, join
from bokeh.io import show, output_notebook,output_file, show, save, curdoc, output_notebook, export_png
from bokeh.plotting import figure, output_file, show,save
from bokeh.models.widgets import P... |
# -*- coding: utf-8 -*-
import os
import timeit
from contextlib import contextmanager
import numpy as np
from scipy.io import wavfile
from scipy import linalg, fftpack, signal
import librosa
from librosa import feature as acoustic_feature
from path import FSDD_PATH
def read_audio_files():
"""
Return
------
... |
import time
from functools import wraps
from urllib.parse import urlencode
from django import forms
from django.forms.utils import flatatt
from django.urls import reverse
from django.utils.encoding import force_str
from django.utils.html import escape, format_html
from django.utils.safestring import mark_safe
from dja... |
# -*- coding: utf-8 -*-
# @Time : 5/25/2018 10:48 AM
# @Author : sunyonghai
# @File : crop_commdity.py
# @Software: ZJ_AI
import argparse
import json
import os
from multiprocessing import Process, Pool,cpu_count
import PIL.Image
import cv2
import xml.etree.ElementTree as ET
import time
import io_utils
def g... |
# Copyright (c) 2021 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... |
#!/usr/bin/python
#
# x2z2
# BT Nodes for Testing, ID, Solving
#
# Solve using the x^2 + y^2 method Craig uses
# for puma joint 2 (eqn 4.65 p 118)
#
# BH 2/2/17
#
# BH : Dec-21: SIMPLIFY! After squaring and summing,
# if a one-unk equation is identified, just add
# it to the list ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.