text
stringlengths
3.07k
22.1k
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################ # Imports ############################################################ import argparse import asyncio import contextlib import http import os import re import smtplib import sqlite3 import sys from collections...
from __future__ import unicode_literals, absolute_import, print_function import logging import math import tarfile import hashlib # Processing functions, untar, calculating stats etc... # TODO some kind of logging?? # How do we know where the database is??? def process_upload(uploaded_file): from .ResultDataProcess...
""" extra high-level geometry library functions """ import numpy import automol.graph import automol.zmat.base from automol.geom._conv import graph from automol.geom._conv import inchi from automol.geom._conv import x2z_zmatrix from automol.geom._conv import x2z_torsion_coordinate_names from automol.geom.base import sw...
# encoding: UTF-8 from __future__ import print_function import sys import os import logging import signal import multiprocessing import multiprocessing.queues import traceback import json from time import sleep from datetime import datetime, time from urllib.parse import urlparse, urlunparse from vnpy.event import Eve...
#!/usr/bin/python3 import PIL.ImageShow import PIL.Image import PIL.ImageColor import PIL.ImageFilter import sys import math import struct DIAMETER = 136 from palette import COLORS def compute_palette(input_colors): palette = [] for color in input_colors: palette.extend(PIL.ImageColor.getrgb(color))...
# -*- python -*- """@file @brief test for protocol stuff Copyright (c) 2014-2015 <NAME> <<EMAIL>>. All rights reserved. @page License 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...
import traceback import pandas as pd from Recycled import module_manager # ===================================== Plug-in Interface ===================================== class ITickFetcher: pass class IBarFetcher: pass class IFinaFetcher: # In: # stock_code: str -> Stock code # report_typ...
# -*- coding: utf-8 -*- import numpy as np from os import path from typing import * import random import os import time import math os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices' from keras.layers import Dense, Flatten, Conv2D, Input, add, Activation from keras.mod...
# -*- coding: utf-8 -*- # # Copyright (c) 2020 CPV.BY # # For suggestions and questions: # <<EMAIL>> # # LICENSE: Commercial # kassa.py # интерфейс кассы from kivy.uix.relativelayout import RelativeLayout from kivy.uix.scrollview import ScrollView from kivy.uix.gridlayout import GridLayout from libs.base.lbcontrol imp...
""" The pipeline module contains wrapper functions and classes for each of the stages in the eNcore pipeline. Namely: * Receiving (getting data from eStreamer) * Parsing (Binary -> dict) * Decorating (Caching and reading metadata) * Transforming (serialising to output format) * Writing (Transport; to disk / n...
#!/usr/bin/env python # # Copyright 2016 The IskipTests 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 appl...
from mutagen._util import DictMixin, cdata, utf8, insert_bytes, delete_bytes from tests import TestCase, add import random class FDict(DictMixin): def __init__(self): self.__d = {} self.keys = self.__d.keys def __getitem__(self, *args): return self.__d.__getitem__(*args) def __setitem__(s...
import sys import struct import time from smbus2 import SMBus, i2c_msg class TOF: """ Each object corresponds to a VL53L1X sensor on the RPS board """ def __init__(self, bus, sensor_id): self.bus = bus self.sensor_id = sensor_id self.distance = 0 self.is_robot = False ...
import yaml import jinja2 import htmlmin import shutil import distutils.dir_util as dirutil import functools from multiprocessing import Pool from os import path, makedirs from glob import glob from collections import OrderedDict from numbers import Number from yaml.error import YAMLError from bs4 import BeautifulSoup...
# MIT License # # Copyright (c) 2022 <NAME> [srccircumflex] # # 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, modi...
from datetime import date from typing import Any from django.contrib.auth.password_validation import validate_password from django.core.validators import RegexValidator from django.db import transaction from rest_framework import serializers from rest_framework.validators import UniqueTogetherValidator from rest_frame...
""" A set of convenience functions to download datasets for illustrative examples """ import os import os.path as op import sys import itertools import numpy as np from scipy.special import comb from urllib.request import urlretrieve _rgcs_license_text = """ License ------- This tutorial dataset (RGC spikes data) is ...
# DocuSign webhook library # # Set encoding to utf8. See http://stackoverflow.com/a/21190382/64904 import sys; reload(sys); sys.setdefaultencoding('utf8') import os, base64, json, requests, logging from app.lib_master_python import ds_salesforce from app.lib_master_python import ds_recipe_lib from app.lib_master_pytho...
#!/usr/bin/python2.7 # Compresses the core Blockly files into a single JavaScript file. # # Copyright 2012 Google Inc. # https://developers.google.com/blockly/ # # 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 o...
#! /usr/bin/env python3 import time import os.path import tensorflow as tf import warnings import shutil from distutils.version import LooseVersion # Project modules: import helper import project_tests as tests # OUTPUT COLOR FORMATS: REG = "\033[m" BOLD_GREEN = '\033[1;32;m' # Hyper-parameters: LEARN_RATE = 9e-5 ...
import re import numpy as np import pandas as pd diccionario_para_columnas_x = {'SD': 3,'1': 1,'2': 2} diccionario_para_columnas_tip_cas = {'1': 1,'2': 2,'3': 3,'4':4,'5':5,'SD':6} diccionario_para_columnas_x_sin_SD = {3:2,1:1,2:2} columnas_a_mapear_especificas =["acum_liquievento","caida_plaq","fiebre","cefalea","d...
## feff85exafs unit testing system using larch ## see HEADERS/license.h for feff's license information import larch from f85ut import ut larch.use_plugin_path('xafs') from feffdat import feffpath import re from os import getenv from os.path import isfile, isdir, join #folders = ('Copper',) #folders = ('Copper', 'NiO...
"""This module contains various tests for the MTS trainer endpoint module.""" import os import sys import unittest import pytest import yaml from mock import patch from yolov5.trainer_endpoint import ( generate_training_config_yaml, parse_bounding_boxes_encoding, persist_training_data, cleanup, upload_trained_m...
import asyncio import concurrent.futures import csv import json import lzma import operator import sys from glob import glob from hashlib import md5 import pycld2 as cld2 import spacy import typer from bs4 import BeautifulSoup from jsonschema import validate from smart_open import open, register_compressor from patci...
# Copyright 2021 The TensorFlow Ranking Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# -*- coding: utf-8 -*- import numpy as np from graphviz import Source from collections import deque import matplotlib.pyplot as plt from .constants import ErrorAnalyzerConstants from .error_analyzer import ErrorAnalyzer from .error_analysis_utils import format_float plt.rc('font', family="sans-serif") SMALL_SIZE, MED...
''' File name: envs/bridge.py Author: <NAME> Date created: 11/26/2021 ''' import numpy as np from collections import OrderedDict from rlcard.envs import Env from rlcard.games.bridge import Game from rlcard.games.bridge.game import BridgeGame from rlcard.games.bridge.utils.action_event import ActionEvent...
import os import sys import numpy as np import time import datetime use_cntk = True if use_cntk: try: os.environ['CUDA_VISIBLE_DEVICES'] = '0' base_directory = os.path.split(sys.executable)[0] os.environ['PATH'] += ';' + base_directory import cntk os.environ['KERAS_BACKEND'...
import instaloader import csv import os import time import sys from datetime import date def menu(): print("=" * 10 + " MENU " + "=" * 10) print("Press 1: Create list of all followers from {0}\n".format(tarAcc) + "Press 2: Create list of followees from {0}\n".format(tarAcc) + "Press 3: Dow...
""" dynamiccolorbinning.py: a module that provides functionality associated with the Dynamic Color Binning algorithm. Copyright: <NAME> 2016 """ from ast import literal_eval import numpy as np import pandas as pd from matplotlib.colors import rgb2hex import cv2 from colormath.color_conversions import convert_color ...
from __future__ import print_function, division import os import sys sys.path.append(os.path.dirname(sys.path[0])) import warnings import numpy as np from scipy import interpolate from scipy.ndimage import interpolation as spinterp from scipy.stats import threshold import geometry import density def cart2pol(*coor...
import logging import platform import threading import time from enum import Enum # Sphinx is not being run on a RPI, so this package can't be imported when creating the documentation if 'armv7l' in platform.platform(): import RPi.GPIO as GPIO logger = logging.getLogger(__name__) class Direction(Enum): IN...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
import time import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from tensorboardX import SummaryWriter from a2c.utils import mean_std_groups def train(args, net_stri...
# Copyright (c) 2011 Tencent Inc. # All rights reserved. # # Author: Michaelpeng <<EMAIL>> # Date: October 20, 2011 """ This is python targets module which generates python egg, python library, python binary, python test. """ import os import blade import build_rules import console from blade_util import var_...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2019 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. """ Create all plots required in Jupyter notebook. """ import os import logging # logger logger = logging.getLogger("totalvolume.py") logger.setLevel(logging.DEBUG) #...
""" This script receives a BedGraphFile file as input and smoothes it out using convolution with a window of the user's choosing. It also contains supplementary functionality such as changing the loci coordinates of the given BedGraph. """ import pathlib from enum import Enum from typing import Callable, MutableMapping...
""" Bunch of function to: * communicate with coinmarketcap API * communicate with openexchangerates API * Load and dump json files * Compute rates of your portfolio given your quantity of each token """ import json import sys import requests COINMARKETCAP_API_URL = 'https://pro-api.coinmarketcap.com/v1' def _dump(fi...
from ctypes import * import math import random import os import cv2 import numpy as np import time import darknet import pytesseract from skimage import measure import threading from scipy.spatial import distance as dist from collections import OrderedDict from multiprocessing import Process, Lock lic_pl = cv2.imread(...
import numpy as np from olfactory import indicators # ----------------------------------- # # Labels def test_count_within(): count_within = indicators.count_within np.testing.assert_equal( count_within([0, 0, 1, 2, 5, 1, 6], [(1, 3), (5, 7)]), [3, 2], ) np.testing.assert_equal( ...
# <NAME> and <NAME> # Political Appointments and Outcomes in Federal District Courts # Journal of Politics # January 2021 ## Data and supporting materials necessary to reproduce the numerical results ## in the article are available in the Journal of Politics Dataverse ## (https://dataverse.harvard.edu/dataverse/jop) a...
# -*- coding: utf-8 -*- from collections import OrderedDict from itertools import product from fiqs import flatten_result from fiqs.aggregations import Aggregate, ReverseNested from fiqs.exceptions import ConfigurationError from fiqs.fields import Field, GroupedField, NestedField def calc_group_by_keys(group_by_fie...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ File: model_defs.py Author: naught101 Email: <EMAIL> Github: https://github.com/naught101/empirical_lsm Description: Models created programattically """ from collections import OrderedDict import re from sklearn.linear_model import LinearRegression from sklearn.clust...
# ================ IMPORTS ====================== import sys import os import re import string import path import numpy as np import pandas as pd import matplotlib.pyplot as plt import tweepy from colorama import * from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer fro...
#!/usr/bin/env python3 # # Copyright (c) 2016-2021, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # lis...
#!/usr/bin/env python3 # Copyright (c) 2021 <NAME> <<EMAIL>> # # All rights reserved. Use of this source code is governed by a modified BSD # license that can be found in the LICENSE file. from .ABSdata import LVCData, O3InjectionsData import numpy as np #import astropy.units as u import h5py import os impor...
''' code modified from https://github.com/VainF/pytorch-msssim/blob/master/pytorch_msssim/ssim.py ''' import torch import torch.jit import torch.nn.functional as F __all__ = ['ssim', 'ms_ssim', 'SSIM', 'MS_SSIM'] @torch.jit.script def create_window(window_size: int, sigma: float, channel: int): ''' Create ...
#!/usr/bin/env python import weakref class SlotList: def __init__(self): self._slots = [] def __str__(self): return f"SlotList({self._slots}, len={len(self)})" def clear(self): self._slots = [] def __bool__(self): return bool(self._slots) def __len__(self): ...
"""Mappers for Slack users. Notes ----- Calls into the Slack client have to be marked with ``# type: ignore`` currently because the typing of those calls cannot handle the optionality of the async/await interface. """ from __future__ import annotations import asyncio import json import logging from random import Sys...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Dec 8 00:01:10 2018 @author: mimbres NOTE: In advance of using this code, plaease run "preparing_data.py" once. """ import numpy as np from torch.utils.data.dataset import Dataset #from torch.utils.data import DataLoader <--이게 문제가있다고함 from torch.utils...
# tracker.py import requests import json from datetime import datetime import pandas as pd import numpy as np from dotenv import load_dotenv import os import csv load_dotenv() ticker_error = 'Ticker not found! Please try again.' request_error = 'Web Request error! Please try again' API_error = 'You have exceeded your...
from pack import Packer from box import Box from space_holder import Holder from container import Container from coordinate import Coordinate import copy import random import functools # partially matching cross-over # Simple Inversion Mutation class Gene(): def __init__(self, box: Box, orientation...
#!/usr/bin/env python3 # Copyright 2016 The Johns Hopkins University Applied Physics Laboratory # # 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/LI...
import errno import os import requests import json from pathlib import Path import sly_globals as g import supervisely_lib as sly from sly_train_progress import get_progress_cb, reset_progress, init_progress from mmcv.utils.config import Config local_weights_path = None all_cfgs = None img_scale = None img_crop = Non...
__source__ = 'https://leetcode.com/problems/contains-duplicate-iii/description/' # https://github.com/kamyu104/LeetCode/blob/master/Python/contains-duplicate-iii.py # Time: O(n * t) # Space: O(max(k, t)) # # Description: Leetcode # 220. Contains Duplicate III # # Given an array of integers, find out whether there # ar...
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from math import sqrt import random import copy as copy import sys class TspBNB(object): """ The branch and bound TSP object, enabling the setting of positions in the constructor, a method for plotting """ def __init__(self,...
# 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 law or agreed to in writing, softw...
# 3D IoU caculate code for 3D object detection # Kent 2018/12 # https://github.com/AlienCat-K/3D-IoU-Python/blob/master/3D-IoU-Python.py import numpy as np from scipy.spatial import ConvexHull from numpy import * def polygon_clip(subjectPolygon, clipPolygon): """ Clip a polygon with another polygon. ...
import torch.nn as nn import torch from utils.ssd import make_vgg, make_extras, L2Norm, make_loc_conf, DBox # import stuff import os import numpy as np import time import pandas as pd import torch import torch.utils.data as data from itertools import product as product import torch import torch.nn as nn import torch...
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time from datetime import datetime, timedelta import threading import os from settings import MAIL, PASSWORD, GOOGL...
#!/usr/bin/env python3 import RPi.GPIO as gpio from collections import OrderedDict from time import sleep gpio.setwarnings(False) ## ------------------------------------------------------------------------ ## CORE - BINARY def hexp(v): padding = 8 return '0x{0:0{1}X}'.format(v, padding) def binp(v): r...
# -*- coding: utf-8 -*- import pandas as pd import dash #from dash import Dash from dash.dependencies import Input, Output, State import dash_core_components as dcc import dash_html_components as html import colorlover as cl import numpy as np df_targets = pd.read_csv('data_out.csv') def create_traces(df_targets, h...
#!/usr/bin/env python3 import time import os import sys import uuid import json import pprint import argparse from lightning import LightningRpc, Millisatoshi from bannerpunk.pixel import Pixel from bannerpunk.preimage import Preimage from bannerpunk.images import IMAGE_SIZES BANNERPUNK_NODE = "02e389d861acd9d6f5700c...
# CREATED: 10/14/16 12:35 PM by <NAME> <<EMAIL>> ''' Utility functions ================= ''' from contextlib import contextmanager import logging import os import glob from .scaper_exceptions import ScaperError import scipy import numpy as np import soundfile @contextmanager def _close_temp_files(tmpfiles): ''' ...
import numpy as np import networkx as nx import re import os import tsplib95 from itertools import combinations import matplotlib.pyplot as plt import matplotlib as mpl import time from itertools import permutations import sys from py_utils.TSP_loader import TSP_loader class TSP_plotter: def __init__(self) -> Non...
""" Datafree Circle Generator """ import os, sys sys.path.append(os.getcwd()) import numpy as np import matplotlib from matplotlib import pyplot as pyplot matplotlib.use('Agg') import argparse import torch from torch import nn from torch.nn import functional as F import torch.nn.init as init import torchvision impo...
# coding=utf-8 import numpy as np import matplotlib.pyplot as plt from numpy import pi def getU(fieldRes): U = np.zeros([fieldRes[0],fieldRes[1],3]) U[:,:,0] = np.transpose(np.resize( np.linspace(-1,1,fieldRes[0]),[fieldRes[1],fieldRes[0]])) U[:,:,1] = np.resize(np.linspace(-1,1,fieldRes[...
""" DFS solver based on Kernighan-Lin partition algorithm to reduce recursion complexity. """ import pdb import sys import itertools import collections import logging import functools import operator import contextlib import networkx as nx import numpy as np import solverutils as sutils from solverutils import CID ...
from datetime import datetime, timedelta import itertools import netCDF4 import numpy as np import pandas as pd from sklearn.impute import SimpleImputer from sklearn.linear_model import LinearRegression, LogisticRegression from sklearn.model_selection import train_test_split def valid_maxz(maxz, threshold=0.7): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import glob import tarfile import time import json import logging import joblib import subprocess def check_dependencies(): """ Check all dependencies exist and work """ missing=False for program in ['mashtree', 'mash']: t...
"""Wrapper around python-seabreeze library.""" import os import time import logging import numpy as np from datetime import datetime try: import seabreeze.spectrometers as sb from seabreeze.spectrometers import SeaBreezeError except ImportError: pass logger = logging.getLogger(__name__) class Spectromet...
""" Tag FASTQ/FASTA headers with corrected barcodes. ABOUT: First the raw barcodes FASTQ is parser to get a dictionary: raw_barcodes[<HEADER>] = <RAW_BARCODE> Then the corrected barcodes CLSTR file from starcode are parsed to get a dictionary: corrected_barcodes[<RAW_BARCODE>] = <CORRECTED_BARCODE> The fo...
import nn from nn import lecun_uniform, LearnedUpsampling1d, concat_init import utils import torch from torch.nn import functional as F from torch.nn import init import numpy as np class SampleRNN(torch.nn.Module): def __init__(self, frame_sizes, n_rnn, dim, learn_h0, q_levels, weight_norm): ...
import numpy as np from elaugment.transformations import Pipeline from elaugment.random import RandomBinary, Random from elaugment.image import transformations class RandomFlipLr(RandomBinary): """ Randomly apply left-right flips. """ def __init__(self, p=0.5): super(RandomFlipLr, self).__ini...
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://aws.amazon.com/apache2.0 # # or in the "license" file accompa...
import time from base import * from trf.nce import trf from trf.nce.trf import DefaultOps from . import sampler class Config(trf.Config): def __init__(self, data): super().__init__(data) self.noise_sampler = None self.word_average = False self.pi_0 = self.pi_true ...
import os import time import matplotlib.pyplot as plt import matplotlib.image as img from matplotlib_scalebar.scalebar import ScaleBar, SI_LENGTH import numpy as np class OpticalSystem: def __init__(self): self.A = [0, 0, 0] self.A[0] = np.eye(2) self.A[1] = np.eye(2) self.A[2] = ...
#!/usr/bin/env python import logging import mandrill import mimetypes import itertools import argparse import base64 import sys import csv import os import re from collections import namedtuple class Recipient: """Recipient data structure Recipient must have an ``email`` address, other fields are optional. ...
# @Time : 2021/03/18 # @Author : Naunter # @Page : https://github.com/Naunters # @Page : https://github.com/BDO-CnHope/bdocn_client from urllib.request import build_opener,install_opener,urlretrieve,urlopen,Request from re import findall from socket import timeout from tkinter.messagebox import showi...
#!/usr/bin/env python3 from gi.repository import GObject import dbus import dbus.service import dbus.glib import syslog import random syslog.openlog("BlueMock-DBus") session_bus = dbus.SessionBus() service = dbus.service.BusName("org.bluem", bus=session_bus) def _log(text): syslog.syslog(syslog.LOG_ALERT, text)...
# pylint: disable=R0201 # R0201: For testing methods which could be functions are fine. # # $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # Copyright (c) 2003-2011, German Aerospace Center (DLR) # All rights reserved. #Redistribution and use in source and binary forms, with or without...
import hou Primitive = 1 Point = 2 Edge = 4 Vertex = 8 Detail = 4 AllAttribClasses = Primitive | Point | Vertex | Detail AllGroupTypes = Primitive | Point | Edge | Vertex Int = 1 Integer = Int Float = 2 String = 4 DataTypes = { hou.attribData.Int: Int, hou.attribData.Float: Float, hou.attribData.String: St...
# Copyright 2017 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...
import dash import yaml import os import setup from dash import dash_table from dash import dcc from dash import html from pandas import Timestamp as ts from dash.dependencies import Input, Output from datetime import timedelta import plotly.express as px import pandas as pd import plotly.graph_objects as go from plotl...
#!/usr/bin/python3 import datetime import numpy as np import pandas as pd import re import requests from lxml import etree from dev_global.env import TIME_FMT from polaris.mysql8 import (mysqlBase, mysqlHeader) from jupiter.utils import trans __version__ = '1.0.10' class StockBase(object): """ param header...
import pygame import copy import math import random import colorsys from object import GameObject MOVE_SPEED = 300 def sign(x): if x > 0: return 1 if x < 0: return -1 class CaptainViridian(GameObject): def __init__(self,game): self.draw_rect = pygame.rect.Rect(0,0,50,105) ...
# Copyright © 2016-2021 Medical Image Analysis Laboratory, University Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland # # This software is distributed under the open-source license Modified BSD. """PyMIALSRTK utils functions for resource monitoring originated from Nipype. See https://nipype.readt...
"""Interfaces with Alarm.com alarm control panels.""" from __future__ import annotations from collections.abc import Callable import logging import re from homeassistant import config_entries from homeassistant import core from homeassistant.components import alarm_control_panel from homeassistant.components import p...
import re import argparse import yaml import autocleus.cmd as cmd from typing import Optional, Any, Union, Type, Callable, List from operator import itemgetter # globals (for now) levels = ['short', 'long'] def args_to_list(args, exclude=['command', 'help']): """ Parse argument values from argparse namespac...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ------------------------------------------...
#! /usr/bin/env python3 import os, sys, re import json import errno import atexit from pprint import pprint from datetime import datetime import itertools import timeit import string import itertools import functools import operator import collections import array import queue import heapq import pytz import request...
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from carle.env import CARLE from carle.mcl import SpeedDetector from game_of_carle.agents.toggle import Toggle import bokeh from bokeh.io import curdoc import bokeh.io as bio from bokeh.io import output_notebook, show fr...
import os import subprocess import json import re import tempfile from functools import reduce import hashlib from flask import current_app import yaml from shlex import quote from shutil import copyfile, copytree from .database import int_pattern from .files import list_input from .utils import fullresponse from lib.p...
import argparse import json import os import secrets import shlex import socket import subprocess import sys import types from copy import deepcopy from utils import recv_msg, send_msg, AttrDict, path_leaf from encryption_utils import CipherLib from byte_utils import _string_to_bytes, _bytes_to_string # 256 bits = 32...
import os import json import yaml import logging import tempfile import proto.python.ast_pb2 as ast_pb2 from os.path import basename, dirname, abspath, join from proto.python.ast_pb2 import AstLookupConfig, AstNode, FileInfo from proto.python.module_pb2 import ModuleResult, ModuleSummary, ModuleStatic from util.job_ut...
import numpy as np from pylab import delete map_grid = np.zeros((1000, 1000, 1000)) # define drone area with start and end point # 0 shows avaliable waypoints # 1 shows obtacles # 7 is start points # 5 is ends class Jsonable: def json(self): return self.__dict__ class Waypoints(Jsonable): def __in...
import glob import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from collections import defaultdict from multiprocessing import Pool from matplotlib.colors import to_hex from matplotlib import rc from sklearn.feature_extraction.text import TfidfVectorizer from sklearn....
#!/usr/bin/env python """ # Author: ***** # Created Time : Mon 23 Apr # File Name: cal_graph.py # Description:` """ """ test: from cal_graph import graph, combine_graph_dict import scanpy as sc adata = sc.read(data_path) graph_cons = graph(adata.obsm['spatial'], distType='euclidean', k=10)...
# ---------------------------------------------------------------------- # Migrate Interface Classification Rules to labels # ---------------------------------------------------------------------- # Copyright (C) 2007-2021 The NOC Project # See LICENSE for details # -----------------------------------------------------...
from civicboom.lib.base import * from cbutils.misc import make_username from civicboom.controllers.account import AccountController set_persona = AccountController().set_persona from civicboom.model.member import Group, GroupMembership, group_member_roles, group_join_mode, group_member_visibility, group_content_visib...