text
stringlengths
3.07k
22.1k
import sys import os import subprocess import struct import threading from http.server import HTTPServer, BaseHTTPRequestHandler from os import listdir, environ from dataclasses import dataclass from urllib.parse import parse_qs, urlparse from galaxy.api.plugin import Plugin, create_and_run_plugin from galaxy.api....
# coding=utf-8 # Copyright 2018 The TF-Agents 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...
from webbrowser import get from flask import Blueprint, render_template, redirect, url_for, flash, request from werkzeug.urls import url_parse from flask_login import login_user, logout_user, current_user from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, SubmitField fr...
from IS import * #testing framework import SSstache import sys import plumbum from plumbum import local from plumbum.cmd import touch, ls, pwd from plumbum.cmd import open as pbOpen #so as not to conflict with python's open from plumbum.path.utils import copy #watch out for conflict with python's copy from plumbum.pa...
import sys import copy import random import numpy as np from tqdm import tqdm from collections import defaultdict from multiprocessing import Process, Queue def random_neq(l, r, s): t = np.random.randint(l, r) while t in s: t = np.random.randint(l, r) return t def computeRePos(time_seq, time_span)...
from __future__ import print_function, division import sys import time import struct import random import i2cdriver import unittest DUT = "dut" # grn0 AGG = "agg" # blk1 def bit(b, x): return 1 & (x >> b) def byte(x): return struct.pack("B", x) class TestDUT(unittest.TestCase): def setUp(self): ...
#!/usr/bin/env python import click import logging import os import sys import webbrowser import numpy as np import pandas as pd from ad_examples.common.utils import configure_logger from ad_examples.common.gen_samples import get_synthetic_samples from ad_examples.aad import aad_globals from ad_examples.aad.aad_globa...
import typing from decimal import Decimal import pydantic import stackprinter stackprinter.set_excepthook(style="darkbg2") from crypto_dom.definitions import TIMESTAMP_MS from crypto_dom.binance.definitions import RECV_WINDOW, ASSET # ============================================================ # ALL COINS INFORMAT...
import os.path import sys try: from wand.image import Image from wand.color import Color from wand.drawing import Drawing wand_available = True except ImportError: wand_available = False def assert_wand_available(): if not wand_available: raise ImportError('MagickWand shared library not found.\n' ...
''' Fournit des classes utiles à l'étude d'une table de données de trajectométrie. Définit la classe Person qui décrit une ligne de la base de données.''' import os import sqlite3 as sq import warnings # Tableaux de correspondance entre indexs utilisés et valeurs dans la BDD MAP = [101, 102, 103, 104, 105, 106, 107,...
# coding: utf-8 import json from base64 import b64encode from hashlib import md5 from random import random from django.conf import settings from django.contrib.auth.models import User from django.test import Client as TestClient from django.test import TestCase from django.test.client import RequestFactory from djoau...
# -*- coding: utf-8 -*- """ Tools for generating coil sensitivities and phantoms """ import numpy as np from ismrmrdtools import transform def sample_data(img_obj, csm, acc=1, ref=0, sshift=0): #% Samples the k-space of object provided in 'img_obj' after first applying #% coil sensitivity maps in 'csm' and Fourier t...
import os from io import BytesIO from pathlib import Path from typing import List, Dict, BinaryIO from .data import GundamDataFile LANGUAGES = ["english", "japanese", "korean", "schinese", "tchinese/hk", "tchinese/tw"] def write_byte_dict(data: Dict[str, bytes], base_path: str): for file_path, byte_string in da...
"""ACME Identifier Validation Challenges.""" import binascii import functools import hashlib import logging import os import socket from cryptography.hazmat.backends import default_backend from cryptography import x509 import OpenSSL import requests from acme import errors from acme import crypto_util from acme impor...
import torch from torch import nn from torch.nn import functional as F from torch.utils.data import DataLoader from torch.utils.data import random_split from torchvision.datasets import MNIST from torchvision import transforms import pytorch_lightning as pl from torch_geometric.nn import MessagePassing, RGCNCon...
""" Test main functionality `tpljson` """ import pytest import unittest from io import StringIO from tpljson import loads, load, dumps, dump import json class TestJsonFunctionality(unittest.TestCase): """Test basic json functionality""" input1, result1 = ('{"one": 1, "two": "two", "l": [1,2,3]}', {'one': 1,...
#///////////////////////////////////////////////////////////////# #///////////////////////////////////////////////////////////////# #%% # Import Libraries. # Torch. import torch import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as optim # Torchvision. import torchvision.transf...
#!/usr/bin/python3 from database import Connection # db = Connection("", 'localhost', 27017) import hashlib from flask import Flask, render_template, redirect, url_for, request, session, make_response, flash from werkzeug.utils import secure_filename from opengraph import OpenGraph import json import prediction_models...
import hashlib import importlib import json import os import subprocess import tempfile from .api import API from . import buildroot from . import objectstore from . import remoteloop from . import sources RESET = "\033[0m" BOLD = "\033[1m" def cleanup(*objs): """Call cleanup method for all objects, filters N...
import itertools import pynder import robobrowser import re import time import requests import json import imagecompare import os MOBILE_USER_AGENT = r"Mozilla/5.0 (Linux; U; en-gb; KFTHWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.16 Safari/535.19" FB_AUTH = "https://m.facebook.com/v2.6/dialog/oauth?...
"""GMM VAE for NLP.""" from typing import Tuple, Dict from dataclasses import dataclass import torch import pytorch_lightning as pl import torch.nn as nn import torch.nn.functional as F from torch.optim import Adam from torch.optim.lr_scheduler import ReduceLROnPlateau @dataclass class Config: vocab_size: int ...
import os import sys import time import argparse from yolo import YOLO, detect_video from PIL import Image import numpy as np import cv2 import numpy as np FLAGS = None TEST_VIDEO = '/media/bernal-tensor/520_1140_raw/520_1140.mp4' TEST_DIR = '/home/pdevine/keras-yolo3-v1/webclip_509/' OUTPUT_CSV = 'submit/5517_1150.c...
import unittest import copy try: from itertools import izip # Python 2 except ImportError: izip = zip TOL = 1E-13 DIGITS = 13 from GTC.vector import ( Vector, scale_vector, extend_vector, merge_weighted_vectors, merge_vectors, is_ordered ) from testing_tools import...
# -*- coding: utf-8 -*- import os import math import numpy as np np.set_printoptions(suppress=True) import scipy import scipy.stats from scipy.fftpack import fft, ifft from scipy import optimize as opti from scipy.signal import convolve import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_a...
""" Created on Thu Jun 3 18:50:28 2021 Graphy 4.0.1 @author: <NAME> """ """Updated Version of Graphly , now adding values will be easier. Tried to put altogether in a single file. Try the GUI and send feedbacks. """ # Libraries --------------------------------------------------------------------------...
import sys sys.path.insert(1, '/data/s2675544/git/neural_deprojection/') from neural_deprojection.models.Simple_complete_model.autoencoder_3d import DiscreteVoxelsVAE from neural_deprojection.models.Simple_complete_model.autoencoder_2d import DiscreteImageVAE from neural_deprojection.models.Simple_complete_model.autor...
from moto.core import get_account_id, CloudFormationModel from ..exceptions import InvalidNetworkAttachmentIdError, InvalidNetworkInterfaceIdError from .core import TaggedEC2Resource from .security_groups import SecurityGroup from ..utils import ( random_eni_id, generate_dns_from_ip, random_mac_address, ...
#!/usr/bin/env python # imports import copy import sys import races import classes import subclasses import backgrounds import weapons import armor # class class mycharacter: def __init__(self, playername, charname, level, sex, alignment): self.playername = playername self.charname = charname ...
# Implements the evolutionary program for space allocation problem # proposed by Rodrigues, E. et. al (2013). # # Author: <NAME> # # Current Version: 1.0.0 # Release Date: WIP - 03/13/2022 import os import sys import ezdxf from compas.geometry import Point, Polyline from compas.colors import Color fr...
import os import numpy as np import json from PIL import Image from numpy import unravel_index from red_light_detector import * import matplotlib.pyplot as plt def pad_with(vector, pad_width, iaxis, kwargs): pad_value = kwargs.get('padder', 0) vector[:pad_width[0]] = pad_value vector[-pad_width[1]:] = pad_...
import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec from matplotlib import rc from astropy.stats import LombScargle def _spectrum(x, slope): y = x ** slope return y def _timmerlc(slope, nt='None', dt='None', mean='None', sigma='None', seed='None'): if dt == ...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python # coding: utf-8 # In[ ]: import os import sys import json import time import bencode import socket import binascii import psycopg2 import hashlib from datetime import datetime # In[ ]: CONFIG = '/mnt/data/script/config.json' EXT_HANDSHAKE = 0 EXT_METADATA = 2 META_REQUEST = 0 META_DATA = 1...
import argparse import json from tqdm import tqdm import soundfile as sf import numpy as np import os import pyloudnorm from scipy.signal import resample_poly import pandas as pd parser = argparse.ArgumentParser() parser.add_argument("--json", default="/home/fei/SparseLibriMix/metadata/sparse_5_0.2/metadata.json") #...
""" (c) 2019-2020 <NAME>. Copywright: Ask for permission writing to <EMAIL>. """ import numpy as np import matplotlib.pyplot as plt from autologging import logged, traced from fullwavepy.generic.system import bash, exists from fullwavepy.generic.parse import kw, strip # ---------------------------------------------...
import torch import torch.nn as nn import utils.ilt_utils as ilt from torch.autograd import Function import lithosim.lithosim_cuda as litho from utils.epe_checker import report_epe_violations, get_epe_checkpoints import numpy as np import os class ilt_loss_function(Function): r""" The forward/backward implemen...
import re import timeit from sys import exit import pandas as pd def main(): city, month, day = starting_program() print("\nJust one moment... loanding the data\n") filename = citys_data[city][0] df = pd.read_csv(filename) print("Data loaded. Now applying filters...\n") # Convert column St...
import torch from .base import Manifold from .. import linalg import torch.jit from ..tensor import ManifoldTensor from ..utils import make_tuple, size2shape __all__ = ["BirkhoffPolytope"] class BirkhoffPolytope(Manifold): r""" Birkhoff Polytope Manifold. Manifold induced by the Doubly Stochastic matri...
import PIL from PIL import ImageFont from PIL.ImageDraw import * from collections import Sequence, Mapping from numbers import Number from ..helpers.method_hijacker import Interface, NOT_RECOMMENDED \ , create_abstract_class, create_proxy_class from ..helpers.thingsregistry import ThingsRegistry CONSTANTS = Thi...
import sys import units.unit as unit #sys.path.insert(1, '../') #from preprocessing.schemas.image_list import ImageList import pandas import numpy as np #cimport numpy as np import schemas.image_list as i import utils import math import time import cython import imageio import os import ntpath import r...
""" This file is part of medutils. Copyright (C) 2019 <NAME> <hammernik at icg dot tugraz dot at> Institute of Computer Graphics and Vision, Graz University of Technology https://www.tugraz.at/institute/icg/research/team-pock/ """ import numpy as np import matplotlib.pyplot as plt import scipy.signal import imageio i...
"""Define CLI endpoints for downloading data.""" import datetime import logging from pathlib import Path import sys from typing import List import click import numpy as np import pandas as pd from ..endpoints import AllPlayers, Scoreboard from ..endpoints.parameters import ParameterValues, SEASONS, CURRENT_SEASON fr...
"""Helpful utilities for building analysis pipelines. """ import os import tempfile import time import shutil import contextlib import itertools import functools import ConfigParser try: import multiprocessing from multiprocessing.pool import IMapIterator except ImportError: multiprocessing = None import co...
"""Define Pytest Hooks that run AFLuent.""" import json from time import time import coverage # type: ignore[import] import pytest # type: ignore[import] from console import bg, fg, fx # type: ignore[import] from afluent import spectrum_parser WARNING = fx.bold + fg.white + bg.orange ERROR = fx.bold + fg.white ...
""" Implementation for Advent of Code Day 24. https://adventofcode.com/2018/day/24 """ from __future__ import print_function import re from collections import defaultdict from functools import reduce _TEAM_REGEX = re.compile(r'^([A-Za-z ]+):$') _GROUP_REGEX = re.compile( r'^(\d+) units each with (\d+) hit point...
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=too-many-instance-attributes """ Hive-Reporting provides easy to read case metrics supporting team contirubtions and frequency without the need to access or create custom report in The Hive Dashboard """ from __future__ import print_function from __future...
# coding=utf-8 from __future__ import absolute_import from .discord import Hook import json import octoprint.plugin import octoprint.settings import requests from datetime import timedelta from PIL import Image from io import BytesIO import subprocess import os class OctorantPlugin(octoprint.plugin.EventHandlerPlugi...
import torch import torch.utils.data as data import os import pickle import numpy as np from data_loader.utils.vocab import Vocab from sklearn.model_selection import train_test_split import random class ClassificationDataset(data.Dataset): def __init__(self, data_path, text, batch_size, y_label='los', train=True, ...
import torch.nn as nn import math import torch.nn as nn import torch import torch.nn.functional as F class conv_bn_act(nn.Module): def __init__(self, inchannels, outchannels, kernelsize, stride=1, dilation=1, groups=1, bias=False, bn_momentum=0.99): super().__init__() self.block = nn.Sequential(...
""" Classes for exporting associations. """ import re import datetime import json import logging from typing import List from ontobio import ecomap from ontobio.io import assocparser logger = logging.getLogger(__name__) external_taxon = re.compile("taxon:([0-9]+)") internal_taxon = re.compile("NCBITaxon:([0-9]+)")...
#!/usr/bin/env python3 import rospy from enum import Enum from igvc_msgs.msg import EKFState, velocity, gps, deltaodom from nav_msgs.msg import OccupancyGrid, Path from sensor_msgs.msg import Image from std_msgs.msg import Int16, Bool from math import sin, cos from datetime import datetime import sys import PyQt5 as ...
""" Organize Data This is where the code for the organization of data for phenophase classification will reside. Three important parts of this: (1) finding average transition dates for each site and each year (2) storing this data in a readable JSON format ...
import os from copy import deepcopy import numpy as np from combine2d.core import gis from combine2d.core.data_manipulation import add_bed_measurements from combine2d.core.data_manipulation import add_noise_to_first_guess from combine2d.core.data_manipulation import create_perlin_noise, \ add_surface_noise from c...
from math import inf from hypothesis import assume, given from hypothesis.strategies import composite, integers, lists, permutations from algorithms.structures.tree.avl_tree import AVLTree from algorithms.structures.tree.binary_search_tree import BinarySearchTree from algorithms.structures.tree.red_black_tree import ...
#! /usr/bin/env python3 """ Entry point for Postkutsche. """ import os import sys import zlib import shutil import asyncio import logging import subprocess from os import listdir from os.path import isfile, isdir, join, exists import onlinebrief24 from guy import Guy from guy import http from jinja2 import Environme...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from torch.autograd import Variable import random import numpy as np class SASREC_ScaledDotProductAttention(nn.Module): ''' Scaled Dot-Product Attention ''' de...
#/u/GoldenSights import datetime import math import praw import random import sqlite3 import time USERAGENT = "" try: import bot USERAGENT = bot.aG except ImportError: pass print('Connecting (unauthenticated).') r = praw.Reddit(USERAGENT) sql = sqlite3.connect('D:/T3/t3.db') cur = sql.cursor() cur.execu...
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
# <NAME> Student ID:261016919 import random import requests import json def get_grams(text, k): ''' (str,num) --> dict This function will return dictionary of k grams based on markovs model, here k will be the second parameter and it will be judged using the string given >>> get_grams('gagggagaggc...
from .handler_decorator import * import jedi from uuid import uuid4 from collections import OrderedDict import re SPHINX = re.compile(r"\s*:param\s+(?P<param>\w+):\s*(?P<doc>[^\n]+)") EPYDOC = re.compile(r"\s*@param\s+(?P<param>\w+):\s*(?P<doc>[^\n]+)") GOOGLE = re.compile(r"\s*[*]{0,2}(?P<param>\w+).*:\s*(?...
''' In this script we do projections of the impact of support bubble policies by doing a 2D parameter sweep''' from argparse import ArgumentParser from os import mkdir from os.path import isdir, isfile from pickle import load, dump from copy import deepcopy from multiprocessing import Pool from numpy import append, ...
""" This is specifically named 'starsystem' rather than 'system' for reasons that should be obvious. Copyright (c) 2017 The Fuel Rats Mischief, All rights reserved. Licensed under the BSD 3-Clause License. See LICENSE.md """ import ratlib import ratlib.api import ratlib.api.http import functools from sopel.module i...
"""This module handles decoding routines.""" import os import numpy as np import scipy.stats import mne class LFPDecoder(object): """ Decode a dependent var x from indep LFP features. In general, this should be performed as 1. Compute features from LFP 2. Select the dependent variable (e.g. tria...
import pygame import time import random pygame.init() ##Setting up background music pygame.mixer.music.load('Blue_music.mp3') pygame.mixer.music.play(-1) ### Display size of pygame screen display_width = 900 display_height = 1000 gameDisplay = pygame.display.set_mode((display_width,display_height)) pygame.display.s...
#!/usr/bin/env python3 # -*- coding : utf-8 -*- from dateutil.parser import parse import os import tempfile import zipfile import locale from ebooklib import epub from blog2epub.Cover import Cover class Book(object): """Book class used in blog2epub class.""" style = """ @namespace epub "http://www.idpf....
import freenect import numpy as np import cv2 import os import sys import signal import random import time if __package__: from Sensor.Image_processing import Image_processing else: from Image_processing import Image_processing from contextlib import contextmanager accept_color = { "OFF":0,...
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC. 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 requir...
"""Logsforhumans pretends logs all models changes to human beings.""" # coding: utf-8 import threading from django.conf import settings from django.contrib.auth import get_user_model from django.db import models from django.db.models.fields.related import ManyToManyField from django.db.models.signals import post_delet...
import copy from collections.abc import Mapping, MutableSequence # TODO: register this together with the artists _DEFAULT_LEGEND_TYPES = { "line": "line", "text": "simple", "fillbetween": "patches", "intervals": "patches", "markers": "simple", "dummy": "dummy", } _DEFAULT_DATA_SOURCES = { ...
import sys import os import math import functools import numpy as np class WordFreq: def __init__(self, word, id, freq): self.word = word self.id = id self.freq = freq class Vocabulary: """Build word vocabulary with frequency""" def __init__(self, name): self.name = name self.size = 0 se...
import json import random import pdb import numpy as np import torch.nn as nn import torch import torch.nn.functional as F import argparse import math from collections import defaultdict from sklearn.metrics import f1_score def Frobenius(mat): size = mat.size() if len(size) == 3: # batched matrix ret ...
## test_attack.py -- sample code to test attack procedure ## ## Copyright (C) 2016, <NAME> <<EMAIL>>. ## ## This program is licenced under the BSD 2-Clause licence, ## contained in the LICENCE file in this directory. import tensorflow as tf import numpy as np import time from PIL import Image import matplotlib.pyplot ...
from picoweb import WebApp, start_response from ubinascii import a2b_base64 from gc import collect from hcontroll import config, bool_to_str, str_to_bool, read_write_root, read_write_config, update_config from ubinascii import hexlify from uhashlib import sha256 app = WebApp(__name__) http_head = """<!DOCTYPE html> ...
# -*- coding: utf-8 -*- import sys import os import chardet import random import MeCab from pyjtalk.pyjtalk import PyJtalk import concurrent.futures import xml.etree.ElementTree as ET from xml.etree.ElementTree import * import requests from bs4 import BeautifulSoup import csv # 字幕データを入れるディレクトリ # なかったら作成する txt_path...
# coding=utf-8 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
""" Copyright 2020 The OneFlow 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 or agr...
import logging from retrying import retry from redistrib.connection import Connection, pack_command from redistrib.clusternode import ClusterNode from hiredis import ReplyError from config import REDIS_CONNECT_TIMEOUT as CONNECT_TIMEOUT import auto_balance from models.stats_base import RedisStatsBase, ProxyStatsBase f...
from collections import OrderedDict import json from flask import render_template, flash, current_app, Markup from werkzeug.local import LocalProxy import requests from . import app # Convenient reference to scrapyd server. scrapyd_server = LocalProxy(lambda: current_app.config['SCRAPYD_SERVER']) # Convenient refere...
#!/usr/bin/env python3 """ Copyright (C) 2018-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 applic...
import discord from discord.ext import commands class MembersCog: def __init__(self, bot): self.bot = bot @commands.command() @commands.guild_only() async def joined(self, ctx, *, member: discord.Member): """Says when a member joined.""" await ctx.send(f'{member.display_name} j...
import asyncio import io import json import os.path import random import time import grpc from github.com.metaprov.modelaapi.pkg.apis.data.v1alpha1.generated_pb2 import Dataset as MDDataset from github.com.metaprov.modelaapi.services.dataset.v1.dataset_pb2_grpc import DatasetServiceStub from github.com.metaprov.modela...
''' Implementations of built-in functions in Pascal-86. ''' from __future__ import absolute_import, print_function from frontend import typesys from frontend import log import llvmlite.ir as ir builtin = {} def def_ord(mod): ret = ir.IntType(32) args = [ir.IntType(8)] fnty = ir.FunctionType(ret, args)...
# Copyright (c) 2011 <NAME>. # See LICENSE for details. """ Adapter for working with NT users. """ from __future__ import with_statement from __future__ import print_function from __future__ import division from __future__ import absolute_import from win32com.shell import shell, shellcon from zope.interface import imp...
''' ############################################################################### BINNER MODULE ############################################################################### Routines in this module: Mappings -------- > w2f(x) > dw2f(x,dx) > freqspace(w0,sigma) > two_photon_frequency_grid(wi0,ws0,sigma_i,sigma_s) ...
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # Author: # <NAME> (https://github.com/jkozerski) # This draws plots (of temp, humid, dp and pressure) for prevoius month. # Plots are kept in files: # yyyy.mm.dataName.png import dateutil.parser import datetime # datetime and timedelta structures import time import m...
""" This script was made to anaylse the matches between comission and coautors. (In terms of departaments!) VERY IMPORTANT: The citation database was partly created out of this python project. We googled the paper and save the quantity of citation in a excel file that is now located on "dados" file. """ import os im...
from xml.dom import minidom import xml.etree.ElementTree as ET import platform import os def convert_to_macro(macro_dict): """Convert dict to KLayout macro Parameters ---------- macro_dict : dict Keys = subelement tags. Values = subelement text. The macro dict contains key-value pa...
#! /usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================== # IMPORTS # ============================================================================== from bulbs.model import Node from graphalchemy.repository impo...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import get_fullname, flt, cstr from frappe.model.document import Document from erpnext.hr.utils imp...
""" (c) 2019-2020 <NAME>. Copywright: Ask for permission writing to <EMAIL>. """ import numpy as np import matplotlib.pyplot as plt from autologging import logged, traced import cmocean #from ipywidgets import interact, interactive, fixed, interact_manual from fullwavepy.generic.parse import kw, del_kw from fullwave...
import http from typing import Optional from fastapi import APIRouter from pydantic import BaseModel from sqlalchemy.orm import Session from starlette.requests import Request from starlette.responses import Response, RedirectResponse from raconteur.models.base import get_session from raconteur.plugins.character.model...
from os.path import isfile from os import listdir from typing import List, Dict, Union, Any from ast import literal_eval import yaml from time import strftime import numpy as np import pandas as pd from osgeo import ogr, osr import geokit as gk import glaes as gl import multiprocessing as mp import progressbar as pg...
from leer.core.storage.merkle_storage import MMR from secp256k1_zkp import PedersenCommitment, PublicKey from leer.core.storage.default_paths import txo_storage_path from leer.core.lubbadubdub.ioput import IOput import os import hashlib def _hash(data): #TODO move to utils m=hashlib.sha256() ...
import json import re from django.core.serializers.json import DjangoJSONEncoder from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from adm.forms import EquipmentUpdateForm, EquipmentCreateForm from adm.models import EquipmentType, Customer, Equipment, ServiceInfo, Supplier f...
# coding: UTF-8 import time import torch import numpy as np from importlib import import_module import argparse from utils import build_dataset, build_iterator, get_time_dif import horovod.torch as hvd import torch.nn as nn import torch.nn.functional as F from sklearn import metrics from pytorch_pretrained...
"""Learning module importer tests.""" import click import pytest from bs4 import BeautifulSoup import learning_importer def html_to_markdown(html): """Convert HTML to Markdown.""" md_converter = learning_importer.MHRAMarkdownConverter( content_prefix="/content/", asset_prefix="/asset/" ) ret...
# -*- coding: utf-8 -*- import os import pickle import yaml import json import jieba.posseg as pseg import nltk import numpy as np from retrieval_documents import BuildIndex from tf_idf import TrainTfIdf from config import config # pickle origin_corpus of conversations must exist, config.file_dict and config.inde...
"""Support for Ubiquiti's Unifi Protect NVR.""" from __future__ import annotations import logging from typing import Optional from homeassistant.components.camera import SUPPORT_STREAM, Camera from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant, callback from homeassistan...
import unittest from measure import * from measure.commons import * class PrimitiveUnitsTests(unittest.TestCase): def test_create(self): Population = BasicMeasure('population', person=1, couple=2, minyan=10, team=5, play=(2, 'team')) self.assertEqual(Population['team'] * 2, Population['m...
""" Collection ---------------------- Advanced tfs reading and writing functionality. :author: Jaime :module: collection """ import pathlib from pandas import DataFrame from tfs.handler import read_tfs, write_tfs, TfsDataFrame class _MetaTfsCollection(type): """ Metaclass for TfsCollection. It takes the ...