text
stringlengths
3.07k
22.1k
"""Graphical visualisation support for prov.model. This module produces graphical visualisation for provenanve graphs. Requires pydot module and Graphviz. References: * pydot Homepage: http://code.google.com/p/pydot/ * Graphviz: http://www.graphviz.org/ * DOT Language: http://www.graphviz.org/doc/info/lang.h...
import os import math import time import math import numpy as np import pandas as pd import argparse import matplotlib.pyplot as plt from ggplot import * from pdb import set_trace as bp from sklearn.manifold import TSNE from mpl_toolkits.axes_grid1 import ImageGrid parser = argparse.ArgumentParser(description='Restri...
""" Copyright 2020 UofT-EcoSystem Copyright 2018 <NAME> 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 la...
import sys def warn(msg): sys.stderr.write('{}\n'.format(msg)) def tokenize(line): res = [] whitespaces = [' ', '\t'] current_token = '' string_state = 'out' for c in line: if c in whitespaces: if string_state == 'in': current_token += c elif current_token != '': res.append(current_token) c...
import torch from functools import reduce from torchtext import data from tqdm.autonotebook import tqdm from abc import ABC, abstractmethod import logging import os.path import json import csv from transformers import BertTokenizer, BertModel logging.basicConfig(level=logging.DEBUG) module_logger = logging.getLogger('...
from abc import ABC, abstractmethod from collections import namedtuple import datetime import functools from pathlib import Path import sqlite3 from typing import Any, Callable, TypeVar, cast, Dict, Type, Optional from trinity._utils.logging import HasExtendedDebugLogger from p2p.kademlia import Node from p2p.excepti...
import os.path as osp from functools import partial import mmcv import numpy as np import pytest import torch from mmdet import digit_version from mmdet.models.dense_heads import RetinaHead, YOLOV3Head from .utils import (WrapFunction, convert_result_list, ort_validate, verify_model) data_path = ...
# -*- coding: utf-8 -*- """ Created on Fri Jan 7 19:14:22 2022 @author: aoust """ import pandas import matplotlib.pyplot as plt import scipy.stats import numpy as np d_3_RH = pandas.read_csv("../output/output_heur3_1.500000.csv",sep = ";",header=2) d_3_RH["Instance name "] = d_3_RH["Instance name "] + "_3channels" ...
""" Helper functions for ``image_bbox_slicer``. """ import os import glob import warnings import numpy as np from PIL import Image from enum import Enum from itertools import compress import matplotlib.pyplot as plt import matplotlib.patches as patches import xml.etree.ElementTree as ET from math import sqrt, ceil, flo...
import threading from contextlib import contextmanager import pytest from tornado import ioloop, web from dummyserver.handlers import TestingApp from dummyserver.proxy import ProxyHandler from dummyserver.server import ( DEFAULT_CERTS, HAS_IPV6, SocketServerThread, run_loop_in_thread, run_tornado_...
import numpy as np from typing import Union """Functions to encode R_base to R_fac.""" def onset_to_onset_attributes(onset, eo=0): """ Convert an array of onsets (o) to factorized (o_bt, o_sub). - eo is a random int in range(0, 4), making the encoding stochastic. """ def o_to_o_bt(o, eo): ...
import pytest from awx.api.versioning import reverse @pytest.fixture def organization_resource_creator(organization, user): def rf(users, admins, job_templates, projects, inventories, teams): # Associate one resource of every type with the organization for i in range(users): member_u...
# Copyright 2016 - Nokia # 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 wr...
#!/bin/env python # # AutoPyfactory batch status plugin for Condor # import subprocess import logging import time import threading import traceback import xml.dom.minidom from autopyfactory.info import SiteInfo from autopyfactory.interfaces import WMSStatusInterface, _thread from libfactory.htcondorlib import HTCond...
# pyOCD debugger # Copyright (c) 2006-2021 Arm Limited # Copyright (c) 2020 <NAME> # Copyright (c) 2021 mentha # Copyright (c) <NAME> # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
# -*- coding: utf-8 -*- # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """VM-related helper functions/classes.""" from __future__ import print_function import os import shutil import time from c...
from itertools import product from string import ascii_uppercase import pandas as pd from pandas.tseries.offsets import MonthBegin from .futures import CMES_CODE_TO_MONTH def make_rotating_equity_info(num_assets, first_start, frequency, ...
# -------------------------------------------------------------------- # ansilog.py: Smart and colorful logging, output, and basic terminal control. # # Author: <NAME> (lainproliant) # Date: Feb 1 2018 # # `screen.getch()` courtesy of https://code.activestate.com/recipes/134892/ # `screen.set_echo()` courtesy of https:...
import tensorflow as tf # uncomment this for using GPU import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "0" config = tf.ConfigProto() config.gpu_options.allow_growth = True sess = tf.Session(config=config) import math import json import sys import keras from keras.layers...
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from enum import Enum from typing import Tuple import torch TORCH_VERSION: Tuple[int, ...] = tuple( # Versions could be in the following formats: # - 1.9, 1.10 etc. # - torch.deploy-1.9, torch.deploy-1.10, etc....
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import datetime import logging import re import urllib.parse from flask import Blueprint, current_app, escape from lando...
''' show_authentication_sessions.py IOSXE parsers for the following show commands: * show authentication sessions * show authentication sessions interface {intf} * show authentication sessions interface {intf} details ''' # Python import re # Metaparser from genie.metaparser import MetaParser from genie....
# python mnist_experiment_global.py [--test] import os, sys sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..") import time import numpy as np import cv2 from models.MNISTGenerator import MNISTGenerator from GlobalOptimizer.SLSOptimizer import SLSOptimizer from GlobalOptimizer.JacobianOp...
import numpy as np import cv2 import rasterio as ro import matplotlib.pyplot as plt from skimage.measure import block_reduce from simplekml import (Kml, OverlayXY, ScreenXY, Units, RotationXY, AltitudeMode, Camera) """Import functions""" def img_to_arr(filepath, xq=False, yq=False): if '.npy...
import re import os import sys import pandas as pd import numpy as np import spacy from spacy.lang.en.stop_words import STOP_WORDS as stopwords from bs4 import BeautifulSoup import unicodedata from textblob import TextBlob nlp = spacy.load('en_core_web_sm') def _get_wordcounts(x): length = len(str(x).split()) retu...
from __future__ import division import numpy as np import pandas as pd from matplotlib.colors import to_rgb import warnings from logomaker.src.error_handling import check from logomaker.src.matrix import ALPHABET_DICT # Sets default color schemes specified sets of characters CHARS_TO_COLORS_DICT = { tuple('ACGT'):...
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Created by: <NAME> ## ECE Department, Rutgers University ## Email: <EMAIL> ## Copyright (c) 2017 ## ## This source code is licensed under the MIT-style license found in the ## LICENSE file in the root directory of this source tree ##++++++++...
#coding:utf-8 # # PROGRAM/MODULE: firebird-driver # FILE: firebird/driver/config.py # DESCRIPTION: Driver configuration # CREATED: 1.6.2020 # # The contents of this file are subject to the MIT License # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software...
from flask import current_app import psutil import os import subprocess import statistics from time import time, sleep # https://stackoverflow.com/questions/44434838/how-to-run-psutil-inside-a-docker-container def format_float(value, rounding=2): """default formatting operation for establishing a consistent ...
#!/usr/bin/env python import sys if sys.version_info < (3, 5): print('Python >= 3.5 is required to build') sys.exit(1) # Import setuptools before distutils because setuptools monkey patches # distutils. import setuptools import atexit import distutils.command.build import os import platform import subprocess ...
import os import re import sys import time from datetime import datetime import frontmatter def constructIdentifier(author, slug): return "@%s/%s" % (author, slug) rus_d = { 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ё': 'e', 'ж': 'zh', 'з': 'z', 'и': 'i', 'й': 'ij', 'к': 'k', 'л'...
import torch import disprcnn.modeling.sassd_module.ops.iou3d.iou3d_cuda as iou3d_cuda import math def limit_period(val, offset=0.5, period=math.pi): return val - torch.floor(val / period + offset) * period def boxes3d_to_near_torch(boxes3d): rboxes = boxes3d[:, [0, 1, 3, 4, 6]] """convert rotated bbox to ...
"""Tests for common methods of DataseIndex and FilesIndex classes. """ # pylint: disable=missing-docstring # pylint: disable=protected-access # pylint: disable=redefined-outer-name import os import shutil import pytest import numpy as np from batchflow import DatasetIndex, FilesIndex @pytest.fixture(scope='module')...
from noloco.constants import ( BOOLEAN, DATE, DECIMAL, DURATION, INTEGER, MANY_TO_MANY, MANY_TO_ONE, MULTIPLE_OPTION, ONE_TO_MANY, ONE_TO_ONE, SINGLE_OPTION, TEXT) from noloco.exceptions import ( NolocoDataTypeNotFoundError, NolocoQueryNotSupportedError) from pyda...
# This file is part of beets. # Copyright 2015, <NAME> # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, m...
import os import re import io import sys import json import argparse import unittest from datetime import date from getpass import getpass try: import github3 except ImportError: print('To run release tool you need to install github3.py:') print('') print(' $ pip install github3.py') print('') ...
import datetime as dt import logging from multiprocessing import Process, Queue import numpy as np import pandas as pd from pandas_datareader import DataReader from algorithm import Algorithm from portfolio import Portfolio class OrderApi: def __init__(self): self._slippage_std = .01 self._prob_...
# Chapter 2 Exercises # Review Questions (True/False) # 1. False. Writing a program requires a systematic approach with the following steps: problem analysis (defining the # problem), problem specification (deciding what the program will do), design (writing a pseudocode for the algorithm), # implementation (writing t...
#!/usr/bin/python # (c) 2016, <NAME> <<EMAIL>> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: lambda_event version_added: 1.0.0 short_description: Create...
import torch import torch.nn as nn import numpy as np import math import os def generate_noise(size,num_samp=1,device='cuda',type='gaussian', scale=1): if type == 'gaussian': noise = torch.randn(num_samp, size[0], round(size[1]/scale), round(size[2]/scale), device=device) noise = upsampling(noise,s...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2019 Rapptz 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...
from __future__ import print_function from __future__ import division import numpy as np import transformations as trans def skew(x): """ skew-symmetric matrix, that represent cross products as matrix multiplications. Args: x (numpy.ndarray): 3D vector. Returns: 3x3 skew-symmetric...
import pytest import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import numpy.testing as npt from .. import rcmod, palettes, utils from ..conftest import has_verdana class RCParamTester: def flatten_list(self, orig_list): iter_list = map(np.atleast_1d, orig_list) flat_l...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import sys import termios import time from contextlib import contextmanager from typing import Callable from pants.base.exception_sink import ExceptionSink from pants.base.exite...
#!/usr/bin/env python ''' play back a mavlink log as a FlightGear FG NET stream, and as a realtime mavlink stream Useful for visualising flights ''' import sys, time, os, struct import Tkinter from pymavlink import fgFDM from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_a...
from collections import OrderedDict import json def succeed(*cmds): """Returns the concatenated output of all cmds""" return machine.succeed(*cmds) def assert_matches(cmd, regexp): out = succeed(cmd) if not re.search(regexp, out): raise Exception(f"Pattern '{regexp}' not found in '{out}'") ...
import inspect from . import base from .. import characters import random from .. import chargen from .. import namegen from .. import context from .. import stats from .. import items from . import treasuretype from . import abilities from .. dialogue import voice from . import animals from . import aquan from . impo...
#!/usr/bin/env python import argparse import os parser = argparse.ArgumentParser() parser.add_argument('--gpu_id', default='0', help='Visible GPU id') parser.add_argument('--model_version', default='DHGNN_v1', help='DHGNN model version, acceptable: DHGNN_v1, DHGNN_v2') args = parser.parse_args() os.environ['CUDA_VISIB...
# coding=utf-8 import os import errno import socket import random import logging import platform import threading UI16MAXVAL = (1 << 16) - 1 logger = logging.getLogger(__name__) class PortManagerException(Exception): pass class PortManager(object): """ See documentation here https://wiki.yandex-t...
# pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103 from .. import qtutil from ...external.qt import QtGui from ...external.qt.QtCore import Qt from mock import MagicMock, patch from ..qtutil import GlueDataDialog from ..qtutil import pretty_number, GlueComboBox from glue.config import data_factory from glue.core im...
__author__ = "<EMAIL>" __version__ = '7.3.2' # Python 3.7 syntax! """ Lightweight filtering of SQANTI by using .classification.txt output Only keep Iso-Seq isoforms if: The isoform is FSM, ISM, or NIC and (does not have intrapriming or has polyA_motif) The isoform is NNC, does not have intrapriming/or polyA motif,...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# pylint: disable=redefined-outer-name from copy import deepcopy import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal import pytest from scipy.stats import linregress from xarray import Dataset, DataArray from ..data import load_arviz_data, from_dict, convert_to_inference_data, ...
import os from flask import Flask, Response, jsonify, abort from flask_restplus import Api, Resource, fields, reqparse from flask_cors import CORS, cross_origin import json import pandas as pd from GasExposureAnalytics import GasExposureAnalytics from dotenv import load_dotenv import time import atexit from apscheduler...
"""Run DAWNet benchmarks described in YAML/JSON files """ import logging import datetime import os from os import urandom from base64 import b32encode import errno import subprocess import json from ruamel.yaml import YAML from ruamel.yaml.error import YAMLError import sys try: # >3.2 from configparser import ...
# -*- coding: utf-8 -*- """ Sahana Eden Fire Models @copyright: 2009-2013 (c) Sahana Software Foundation @license: MIT 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...
from datetime import timedelta, timezone as tz, datetime as dt from functools import partial from utils import * import discord from discord.ext import commands # hackathon time zone cst = tz(timedelta(hours=-5)) # cst is 5h behind utc # hackathon start and end times start = dt.fromtimestamp(1635613200, tz=cst) #...
# Copyright (c) 2020, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
#!/usr/bin/python3 # set your own path # execute the program by: # python3 lm_query.py [path] [k] [y/n] [list of keywords] """ Goal of this program: Implement and document programs in your favourite programming language to score documents with respect to a keyword query, read from the command line, using a language...
# Copyright 2018 The Lucid 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 l...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ JPEG codestream-parser (All-JPEG Codestream/File Format Parser Tools) See LICENCE.txt for copyright and licensing conditions. """ from __future__ import print_function import struct import sys class JP2Error(Exception): def __init__(self, reason): super(J...
""" This module contains all the functions that user can use """ from . import objects as obj import matplotlib.pyplot as plt import numpy as np import os from PIL import Image from shutil import copyfile import itertools import scipy.stats as stats def add_margin(pil_img, top, right, bottom, left, color): width,...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 """ Formatting functions for printing pipes """ from __future__ import annotations from meerschaum.utils.typing import PipesDict, Dict def pprint_pipes(pipes : PipesDict) -> None: """ Print a stylized tree of a Pipes dictionary. Supports ANS...
from datetime import date, datetime from functools import partial import sqlalchemy as sa from sqlalchemy import desc, String from sqlalchemy.orm import class_mapper, load_only, RelationshipProperty from sqlalchemy.sql.expression import func, cast from sqlalchemy.exc import DataError, StatementError, IntegrityError fr...
import os import re import yaml from yaml.loader import Reader, Scanner, Parser, Composer, SafeConstructor, Resolver from glob import glob from urllib.request import urlopen from selectolax.parser import HTMLParser # import for pdf to text import io from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter ...
from typing import Iterable from plenum.common.util import max_3PC_key, getNoInstances, getMaxFailures from plenum.server.node import Node from plenum.test import waits from plenum.test.delayers import vcd_delay, icDelay, cDelay, pDelay from plenum.test.helper import sdk_send_random_request, sdk_get_reply, \ waitF...
from configparser import ConfigParser, ExtendedInterpolation from pathlib import Path default_snet_folder = Path("~").expanduser().joinpath(".snet") class Config(ConfigParser): def __init__(self, _snet_folder=default_snet_folder): super(Config, self).__init__(interpolation=ExtendedInterpolation(), delimi...
"""Component to integrate ambilight for TVs exposing the Joint Space API.""" from __future__ import annotations from typing import Any from haphilipsjs import PhilipsTV from haphilipsjs.typing import AmbilightCurrentConfiguration from homeassistant import config_entries from homeassistant.components.light import ( ...
import tempfile import shutil import os magic = b'polytaxis00' size_size = 10 size_limit = 10 ** size_size sep = b'=' sep2 = b'\n' unsized_mark = b'<<<<\n' def _encode_part(text): return ''.join({ '=': '\\=', '\n': '\\\n', '\\': '\\\\', }.get(char, char) for char in text).encode('utf...
# # 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 us...
"""! @brief Examples of usage and demonstration of abilities of Local Excitatory Global Inhibitory Oscillatory Network (LEGION). @authors <NAME> (<EMAIL>) @date 2014-2020 @copyright BSD-3-Clause """ from pyclustering.utils import draw_dynamics; from pyclustering.nnet.legion import legion_network, legio...
import MySQLdb import sys extensionDict = { '1' : '.crc', '2' : '.hash', '3' : '.scan', '4' : '.fwl', '5' : '.hdr', '6' : '.skr', '7' : '.av', '8' : '.vspam', '9' : '.vwarez', '10' : '.vddos', '11' : '.vcol', '12' : '.vbrk', '13' : '.exp', ...
import os from bfc.IR import * from bfc.Options import * from bfc.x64_linux.AsmGenerator import * class BrainfuckLinuxX64: CELL_SIZE_ALIAS = { MemoryCellSize.Byte: AsmPointerType.Byte, MemoryCellSize.Word: AsmPointerType.Word, MemoryCellSize.DWord: AsmPointerType.DWord, } def __in...
#!/usr/bin/python3.9 """ filename: RemoteCommunication.py author: <NAME> <<EMAIL>> version: 16/08/2021 This python script allows us to establish a remote bidirection communication between two microcontroller running our morse pipeline. Therefore we simply read words from serial and upload them into the other boards...
# Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. from mixbox import entities from mixbox import fields from mixbox.vendor import six from mixbox.vendor.six import u import cybox.bindings.cybox_common as common_binding from cybox.common import HexBinary, String, V...
import os from Cython.TestUtils import TransformTest from Cython.Compiler.ParseTreeTransforms import * from Cython.Compiler.Nodes import * from Cython.Compiler import Main, Symtab, Options class TestNormalizeTree(TransformTest): def test_parserbehaviour_is_what_we_coded_for(self): t = self.fragment(u"if ...
# Copyright 2017 IoT-Lab Team # Contributor(s) : see AUTHORS file # # 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 a...
from pytest_bdd import scenarios, when, then, given, parsers from ebu_tt_live.errors import ExtentMissingError from ebu_tt_live.documents.ebutt3 import EBUTT3Document import xml.etree.ElementTree as ET import pytest scenarios('features/styles/ebuttd_style_references.feature') scenarios('features/unit_conversion/ebuttd...
#!/usr/bin/env python3 from local import * import time import argparse import torch import numpy as np import torch.nn as nn import torch.nn.init as init import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable import torchvision.transforms as transforms from torch.utils.data...
''' Created on Dec 22, 2014 @author: <NAME> <<EMAIL>> ''' from __future__ import division import logging import numpy as np import cv2 import matplotlib.pyplot as plt from matplotlib import patches, widgets, ticker from utils.plotting import backend from video import debug # @UnusedImport class Kymograph(obj...
import pygame from isomyr import physics from isomyr.config import Keys from isomyr.event import ( notify, PlayerDropItemEvent, PlayerPickUpItemEvent, PlayerUsingItemEvent) from isomyr.gui.view import View from isomyr.skin import ExaminableSkin class Responder(object): """ This is used by the Engine obje...
# (c) This file is part of the course # Mathematical Logic through Programming # by Gonczarowski and Nisan. # File name: propositions/semantics.py """Semantic analysis of propositional-logic constructs.""" from typing import AbstractSet, Iterable from prop_logic.formula import * Model = Mapping[str, bool] def is_m...
from __future__ import print_function import os import six import unittest from unittest.mock import patch, MagicMock import pandas as pd import numpy as np from dataprofiler.profilers import utils from dataprofiler.tests.profilers import utils as test_utils from dataprofiler.profilers.base_column_profilers import B...
# 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 app...
# -*- coding:utf-8 -*- from django import forms from django.contrib.auth.models import Group # from django.contrib.auth.forms import UserChangeForm, UserCreationForm from django.contrib.auth.forms import UsernameField from django.contrib.auth import authenticate, get_user_model, password_validation from app.core.models...
from geojson_to_pixel_arr import geojson_to_pixel_arr from plot_truth_coords import plot_truth_coords from create_building_mask import create_building_mask from create_dist_map import create_dist_map from plot_dist_transform import plot_dist_transform import matplotlib.pyplot as plt import numpy as np from osgeo impor...
#!/usr/bin/env python r"""Test runner for typeshed. Depends on mypy and pytype being installed. If pytype is installed: 1. For every pyi, do nothing if it is in pytype_blacklist.txt. 2. If the blacklist line has a "# parse only" comment run "pytd <foo.pyi>" in a separate process. 3. If the file is n...
import itertools import numba import threading import queue import numpy as np from scipy.spatial.distance import cdist from scipy.spatial.distance import minkowski def accuracy(Y_true: np.array, Y_predicted: np.array): assert Y_true.shape[0] == Y_predicted.shape[0] return np.mean(Y_predicted == Y_true) def m...
import json import re import sys import traceback from datetime import datetime, timedelta from distutils.version import LooseVersion from django.utils.translation import ugettext_lazy as _ from memoized import memoized from requests import RequestException from urllib3.exceptions import HTTPError from couchforms.si...
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Chemical structure entity classes. """ import re from everest.entities.base import Entity from everest.entities.utils import get_root_aggregate from everest...
"""Support for the (unofficial) Tado API.""" import asyncio from datetime import timedelta import logging from .PyTado.interface import Tado from requests import RequestException import requests.exceptions import voluptuous as vol from homeassistant.components.climate.const import PRESET_AWAY, PRESET_HOME from homeas...
#!/usr/bin/venv python3 # -*- coding: utf-8 -*- """ Created on Fri Apr 10 13:43:12 2020 @author: <NAME> """ import os import pandas as pd import secrets import hashlib from PyQt5 import QtWidgets, QtCore class ChooseFile(QtWidgets.QWizardPage): def __init__(self, parent=None): super(C...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache 2.0 License. import io # Default implementation has buggy interaction between read_bytes and tell, so use fallback import msgpack.fallback as msgpack # type: ignore import struct import os from loguru import logger as LOG # type...
""" Module to screen smile by functional group and other properties. API --- .. autofunction:: split_filter_in_batches .. autofunction:: apply_filters """ import argparse import logging import sys from functools import partial from multiprocessing import Pool from pathlib import Path from typing import Any, FrozenSe...
#!/usr/bin/env python ###################################################### # # The amazing image labeler - img labeling in Python. # Written by <NAME> (<EMAIL>) # ###################################################### import argparse from collections import namedtuple import csv from functools import partial impo...
from hashlib import sha256 import json import time from flask import Flask, request, render_template import requests class Block: def __init__(self, index, senderHash, reciver, amount, timestamp, previous_hash): self.index = index self.senderHash = senderHash self.reciver = reciver ...
from enum import IntFlag from typing import Optional, Union from .operation import Operation from .utils import check_ed25519_public_key from .. import xdr as stellar_xdr from ..keypair import Keypair from ..signer import Signer from ..strkey import StrKey __all__ = ["AuthorizationFlag", "SetOptions"] class Authori...
from abc import ABC, abstractmethod import pathlib from sklearn import base import _pickle as cPickle import numpy as np import pandas as pd import os from enum import Enum from typing import Tuple from py_neuromodulation import \ (nm_projection, nm_rereference, nm_run_analysis, nm_features, nm_res...
import logging import os import time from threading import Thread from ray.tune.automlboard.common.exception import CollectorError from ray.tune.automlboard.common.utils import parse_json, \ parse_multiple_json, timestamp2date from ray.tune.automlboard.models.models import JobRecord, \ TrialRecord, ResultReco...