text
stringlengths
3.07k
22.1k
#!/usr/bin/env python #-*- coding: utf-8 -*- """ xmind.core.topic ~~~~~~~~~~~~~~~~ :copyright: :license: """ __author__ = "<EMAIL> <<NAME>>" from . import const from .mixin import WorkbookMixinElement from .title import TitleElement from .position import PositionElement from .no...
""" lib/assess/metrics3d.py (Author: <NAME>, 2021) Most commonly used segmentation metrics (or the ones I need for med-im projects. Huge help from MONAI: https://www.github.com/Project-MONAI/MONAI Usage Philosophy: - Can take either detached cpu tensors or numpy arrays - Returns all information (per example &...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# coding: utf-8 # # Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
""" Script file: sensor.py Created on: Oct 19, 2021 Last modified on: Nov 8, 2021 Comments: Support for KCS TraceME N1Cx sensor """ import logging from datetime import datetime, timedelta from homeassistant.helpers.entity import Entity from homeassistant.helpers.update_coordinator import DataUpdateCoordinator f...
import tkinter as tk from matplotlib.backends.backend_tkagg import ( FigureCanvasTkAgg, NavigationToolbar2Tk) # Implement the default Matplotlib key bindings. from matplotlib.backend_bases import key_press_handler from matplotlib.figure import Figure import numpy as np import matplotlib.pyplot as plt from mpl_toolk...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Ansible by Red Hat, inc # 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', ...
# Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0 # # or in the "l...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/gaogaotiantian/viztracer/blob/master/NOTICE.txt import unittest import subprocess import os import sys import json import shutil from .util import get_json_file_path file_fib = \ """ def fib(n): if n...
import os import sys import glob import gzip import json import argparse import numpy as np import scipy.sparse as sp from sklearn.linear_model import LogisticRegression def load_sparse_embeddings(path, words_to_keep=None, max_words=-1): """ Reads in the sparse embedding file. Parameters ---------- ...
# Copyright 2016 Google Inc. 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 agree...
#!/bin/python # -*- coding: utf-8 -*- import numpy as np import pandas as pd import os import time import tqdm from datetime import datetime from .mpile import get_par def mcmc( self, p0=None, nsteps=3000, nwalks=None, tune=None, moves=None, temp=False, seed=None, backend=True, ...
#!/usr/bin/env python3 # Et eksempelprogram som viser integrasjon med ID-porten og # APIer fra skatteetaten. import base64 import webbrowser import random import time import json from urllib.parse import urlparse, parse_qs, quote from base64 import urlsafe_b64encode, urlsafe_b64decode from hashlib import sha256 from ...
# -*- coding: utf-8 -*- import json from collections import OrderedDict from domain.blockedtimeutil import BlockedTimeUtil import os from isodate import parse_date, parse_time from datetime import datetime, timedelta from flask import current_app, request from flask.ext.restful import marshal from flask.ext.bouncer im...
#!/usr/bin/env python3 ######################################################################## # Generates a new release. ######################################################################## import sys import re import subprocess import io import os import fileinput if sys.version_info < (3, 0): sys.stdout.wri...
from sancty.deps_types import Optional, Terminal, tm, wcswidth, Protocol, Callable class ReplaceRender: new_render: list new_paragraphs: list def __init__(self, ren, par): self.new_render = ren self.new_paragraphs = par default_replace_dict = { "clr": (-1, "Clears all text"), "h...
""" Copyright 2019 Samsung SDS 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 ...
import itertools from itertools import product from typing import List, Tuple, Union import numpy as np from scipy.linalg import block_diag from quara.objects.state import State from quara.objects.povm import Povm from quara.objects.mprocess import MProcess from quara.objects.qoperation import QOperation from quara.o...
"""Dyson device.""" from abc import abstractmethod import json import logging import threading from typing import Any, Optional import paho.mqtt.client as mqtt from .const import ( ENVIRONMENTAL_FAIL, ENVIRONMENTAL_INIT, ENVIRONMENTAL_OFF, MessageType, ) from .exceptions import ( DysonConnectionRe...
import argparse import os.path import re import shlex import shutil import uuid import pathlib from typing import Optional, Any, List, Dict from urllib import parse import pulumi from pulumi.dynamic import CreateResult, CheckResult, ReadResult, CheckFailure, \ UpdateResult, DiffResult from nginx_plus_args import...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 8 11:54:39 2018 @author: esteban """ # Libraries import numpy as np import solver as sol import matplotlib as mpl import matplotlib.pyplot as plt from numpy.linalg import norm from matplotlib.gridspec import GridSpec # Numbers size in graphs label...
#!/usr/bin/python # -*- coding:UTF-8 -*- from __future__ import division import os, cv2, sys, shutil import numpy as np from xml.dom.minidom import Document rootdir = "../../../dataset/facedata" convet2yoloformat = False convert2vocformat = True # 最小取20大小的脸,并且补齐 minsize2select = 10 usepadding = True datasetprefix = ...
#!/usr/bin/env python3 # Copyright 2021 Stanford University # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import os import typing import warnings from msrest.authentication import Authentication, BasicAuthentication from vsts.build.v4_1.build_client import BuildClient from vsts.build.v4_1.models import ( BuildDefinition, BuildDefinitionReference, SourceRepositories, SourceRepository, ) from vsts.service_en...
#!/usr/bin/env python #-*- encoding: UTF-8-*- """ * Copyright © https://github.com/jarry All rights reserved. * @author: <EMAIL> * @version: 1.0 """ import time # 1. 桶排序代码简版,负数全放在第1桶 def bucket_sort1(arr): max_value = max(arr) min_value = min(arr) min_value = 1 if min_value <= 0 else min_value # 设置...
#!/usr/bin/env python3 import pyrebase import sys import time import select import signal import requests import os from requests import Session from requests.exceptions import HTTPError def exit_app(): global my_stream global db global uid global uuid global user if (my_stream!=None): #update last connectio...
# ======================================================================# # Process Hi-C data to make links # Last edition : 2019/02/28 # ======================================================================# import sys import numpy as np # ======================================================================# # ...
#! /usr/bin/python # -*- coding: utf8 -*- import os, time, logging import tensorflow as tf import tensorlayer as tl import math as ma from model_DPA import * from utils import * from config import config from skimage.measure import compare_psnr, compare_ssim logging.getLogger().setLevel(logging.INFO) block_size = con...
import unittest from unittest import TestCase import curlify import pytest import requests import json import logging import socket import os ## Global variables and functions from pytest import fail scores = {} logs_directory = '/home/ubuntu/' def check_server(address, port): # Create a TCP socket s = sock...
import shutil import numpy as np import luigi import yaml import warnings from astropy.table import Table from stingray.pulse.pulsar import get_model from stingray.pulse.pulsar import fftfit # from stingray.events import EventList import matplotlib.pyplot as plt from .utils.crab import get_crab_ephemeris from .utils im...
import multiprocessing import os import subprocess import sys import time from PySide import QtCore, QtGui __version__ = "0.2.0" def replace_slash(string): return string.replace('/', '\\') class WorkerThread(QtCore.QThread): def __init__(self, bin, to_run, count, running, completed): super(Worke...
# -*- coding: utf-8 -*- import nvdbapi import nvdb2geojson import json from warnings import warn # from qgis.core import * import qgis """ Kommandolinjeverktøy for import av NVDB vegnett og fagdata til QGIS Bruker nvdb2geojson og mellomlagrer geojson som fil. Argumentet er nvdbapi.py er en av klasene nvdb...
# -*- coding: utf-8 -*- import operator from django.db import models from django.db.models import Q from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError from django.core.cache import cache from django.utils import timezone from django.conf import settings from djan...
from . import get_stdlib from .context import Context from .error import DuplicatedOutput, InferError from .symbol import Symbol from .tape import Tape from collections import OrderedDict import uuid import weakref class Model(list): def __init__(self): self._vin = [] self._vout = [] self...
import os from tempfile import NamedTemporaryFile from .simulator import CircuitSimulator, ExecutionState from ..backend import coreir_ from ..scope import Scope from ..ref import DefnRef, ArrayRef, TupleRef from ..array import ArrayType from ..tuple import TupleType from ..bitutils import int2seq from ..clock import ...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import math import torch import t...
from os.path import join import numpy as np import pandas as pd import seaborn as sns import shapely as shp from cartopy import crs as ccrs from cartopy import feature as cfeature from matplotlib import patches as mpatches from matplotlib import pyplot as plt from matplotlib import rcParams from mosaiks import config ...
""" Sanic `provides a pattern <https://sanicframework.org/guide/best-practices/exceptions.html#using-sanic-exceptions>`_ for providing a response when an exception occurs. However, if you do no handle an exception, it will provide a fallback. There are three fallback types: - HTML - *default* - Text - JSON Setting ``...
#-*- coding: utf-8 -*- #! /usr/bin/env python ''' filename: run_tf_basic_lenet5_mnist.py description: simple end-to-end LetNet5 implementation - For the purpose of EverybodyTensorFlow tutorial - - training with Mnist data set from Yann's website. - the benchmark test error r...
import json import datetime import subprocess import os.path import contextlib from behave.log_capture import capture import docker import requests import time _THIS_DIR = os.path.dirname(os.path.abspath(__file__)) _REPO_DIR = os.path.dirname(os.path.dirname(_THIS_DIR)) # The following API endpoint is used to check ...
# 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 to in writing, ...
# ##### BEGIN MIT LICENSE BLOCK ##### # # MIT License # # Copyright (c) 2021 <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 rig...
# AVL Trees, by <NAME> # Was unable to complete this file. from BST import BSTNode, BinarySearchTree class AVLNode(BSTNode): def __init__(self, key, left=None, right=None, parent=None): BSTNode.__init__(self, key, left, right, parent) self.height = self.node_height() def node_height(self): ...
"""Provides flywheel-sdk implementations of common abstract classes""" import copy import flywheel import json import logging import os import requests import sys from .importers import Uploader, ContainerResolver CONFIG_PATH = '~/.config/flywheel/user.json' config = None TICKETED_UPLOAD_PATH = '/{ContainerType}/{Co...
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- """ MakeHuman plugin for estimating the weight of the model using BSA (body surface are) based metrics. **Project Name:** MakeHuman **Product Home Page:** http://www.makehuman.org/ **Code Home Page:** https://bitbucket.org/MakeHuman/makehuman/ **Authors:** ...
#!/usr/bin/env python # Copyright (c) 2012 Lanyrd Ltd. # Copyright (c) 2018 Adeprimo AB # # 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 abo...
from django.db import models from user_account.models import myUser #from MpesaPayments.models import * # plots table class Plot(models.Model): types = ( ('single', 'single'), ('multi_unit', 'multi_unit'), ) plot_owner = models.ForeignKey(myUser, on_delete=models.CASCADE) property_type = models.CharF...
""" Ez egy segédfájl ami átláthatóbbá teszi az Mrcnn háló ( https://github.com/matterport/Mask_RCNN/tree/master/mrcnn ) hasznlatát. """ from traffic.utils import * from traffic.consts import * from mrcnn.model import MaskRCNN from mrcnn.utils import download_trained_weights from coco import CocoConfig class MrcnnCate...
# -*- test-case-name: twisted.test.test_persisted -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Different styles of persisted objects. """ # System Imports import types import copy_reg import copy import inspect import sys try: import cStringIO as StringIO except ImportError: ...
# -*- coding: utf-8 -*- """RWC Popular Dataset Loader """ import csv import librosa import logging import numpy as np import os import mirdata.utils as utils import mirdata.download_utils as download_utils # these functions are identical for all rwc datasets from mirdata.rwc_classical import _load_beats, _load_sectio...
# ckwg +29 # Copyright 2019 by Kitware, Inc. # 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 list of condition...
# Copyright 2010 <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, softwar...
""" Functions to help interface with GEE, in particular to download images. """ import os import shutil from datetime import datetime from geetools import cloud_mask import cv2 as cv import ee ee.Initialize() from .file_utils import download_and_unzip if os.name == "posix": TMPDIR = "/tmp/" else: TMPDIR = ...
#!/usr/bin/env python3 # Reverse-engineering by Laurent Clevy (@lclevy) # from https://github.com/lclevy/firepwd/blob/master/firepwd.py """ The MIT License (MIT) Copyright (c) 2018 <NAME> <<EMAIL>> <NAME> (@lorenzo2472) # from https://github.com/lclevy/firepwd/blob/master/firepwd.py \x1B[34m\033[F\033[F ffpass can i...
import numpy as np import matplotlib.pyplot as plt import scipy.constants as const import sys if not '../aux/' in sys.path: sys.path.append('../aux/') import importlib import auxplt import paths importlib.reload(auxplt) importlib.reload(paths) def P(A, mu): P = 0.0 for i, a in enumerate(A): P +=...
#!/usr/bin/env python3 import logging import math from ast import literal_eval import torch import torch.nn as nn import torch.nn.functional as F from fairseq.models import ( FairseqEncoder, register_model, register_model_architecture, transformer as fairseq_transformer, ) from fairseq.modules import ...
""" (C) Copyright 2021 IBM Corp. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software d...
#!/usr/bin/env python # # Copyright 2017 Google Inc. 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...
# Software License Agreement (BSD License) # # Copyright (c) 2019, iRobot ROS # All rights reserved. # # This file is part of ros2-performance, which is released under BSD-3-Clause. # You may use, distribute and modify this code under the BSD-3-Clause license. # #!/usr/bin/env python # Plot the results of...
import pytest from datetime import datetime, timedelta from fv3config.config import nudging import fv3config @pytest.fixture def test_config(c12_config): return c12_config @pytest.mark.parametrize( "start_time, interval, expected", [ (datetime(2016, 1, 1), timedelta(hours=6), datetime(2016, 1, ...
import math import json MAX_TICKETS_PER_CHALLENGE = 25 DEBUG = True FIRST = "🥇" SECOND = "🥈" THIRD = "🥉" CHALLENGE_IDS = { "day_1": "0de9e913-ef14-44c5-ae5a-51b89c12e7df", "day_2": "e1236e67-975e-4f47-bc67-26fd61e8dc0c", "day_3": "e8f81c6a-3251-4abb-9bdb-a6e5a8d0b23b", "day_4": "19fb1e52-a764-474...
################################################################################# # Copyright (c) 2018-2021, Texas Instruments Incorporated - http://www.ti.com # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditio...
""" :Author: Vitae :Create: 2020/7/5 11:19 :Methed: Using the fast-rcnn method to identify the special ball. All of those use the zed2 data. Copyright (c) 2020, Vitae Group All Rights Reserved. """ import numpy as np import os import six.moves.urllib as urllib import sys import tensorflow as tf import collections im...
import json import models.ModelAdapter from process import feature_builder from models import SegmentModel import tensorflow as tf import matplotlib.pyplot as plt import seaborn as sns from prepare import prepare_form_config flags = tf.flags FLAGS = flags.FLAGS flags.DEFINE_string("pretrain_dir", None, "") def ma...
import pyttsx3 #pip install pyttsx3 import speech_recognition as sr #pip install speechRecognition import datetime import wikipedia #pip install wikipedia import webbrowser import os import smtplib # packge use to send an email from gmail, default intalled with python setup from selenium import webdriver driv...
# Copyright 2020 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 required by applicable law or a...
import pyautogui from copy import deepcopy from collections import deque from Toolset import MemberLoader from Macro import Imaging, stoppable_sleep from Macro.Bases import Base, ClickMixin, ScreenAreaMixin, ImageMixin, VariableMixin class Click(Base, ClickMixin, ScreenAreaMixin): """ Interface of Simple Cli...
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # 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...
###################################################################### # Author: <NAME> # Username: lazaridoue # # Purpose: To create a map of locations # where the user is originally from or has visited, # and to use tuples and lists correctly. ############################################...
from os import times def get_centres(p1): import numpy as np return np.transpose(np.array([p1[:, 0] + p1[:, 2]/2, p1[:, 1] + p1[:, 3]/2])) def distance(p1, p2): import numpy as np p1 = np.expand_dims(p1, 0) if p2.ndim == 1: p2 = np.expand_dims(p2, 0) c1 = get_centres(p1) c2 = ge...
import logging import os import pickle import numpy as np import torch from torch.utils.data import DataLoader, Dataset from IPython.core.debugger import Pdb import scipy.sparse as sp import utils #DEFAULT_VALUE = 0 def get_data_loaders(args): #need to change ys to account for args.exclude_t_ids stats_file =...
"""Configuration parsing module. """ import argparse import logging import os import yaml log_levels = {'critical': logging.CRITICAL, 'error': logging.ERROR, 'warning': logging.WARNING, 'info': logging.INFO, 'debug': logging.DEBUG, 'notset': logging.NOTSET} def _parse_cli(): """Parse...
#!/usr/bin/env python3 import fnmatch import optparse import os import psb import global_vars def load_from_psb(psb_filename): if not options.quiet: print("Reading '%s'" % psb_filename) # Read in the encrypted/compressed psb data psb_data2 = bytearray(open(psb_filename, 'rb').read()) # Decrypt the psb data...
''' python3 code for dodecahedron''' # #!/usr/bin/env python3 import itertools as it import numpy as np from numpy import linalg as LA from mpl_toolkits.mplot3d.art3d import Poly3DCollection import matplotlib.pyplot as plt # from tempfile import TemporaryFile scale_fac = 16.18033988749895 # default is 1, scale it to m...
# -*- coding: utf-8 -*- # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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 require...
# SPDX-License-Identifier: BSD-3-Clause # Depthcharge: <https://github.com/nccgroup/depthcharge> """ Definitions corresponding to U-Boot's exported Jump Table """ import os from .. import log from ..operation import OperationFailed def exports(sys_malloc_simple=False) -> list: """ Return a list of function...
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- # SPDX-License-Identifier: BSD-3-Clause-Clear # # Copyright (c) 2017 ARM Limited # All rights reserved # Authors: <NAME> import ttk from Tkinter import * from base import * class DPU_UI(): # Creates the options for DPU ATP files def create_dpu_options(self)...
#!/usr/bin/python3 import json import fileinput def printAsset(asset): #decs = 10 ** asset['decs'] #return "%.*f %s" % (asset['decs'], asset['amount']/decs, asset['sym']) return asset def cyberToken_issue(action): args = action['args'] return "(%s) ---> %s // %s" % (printAsset(args['quantity']...
# -*- coding: utf-8 -*- """ This module add HTTPS proxies support to requests. The HTTPS implementation supports the full range of requests features. """ import ssl import logging from socket import error as SocketError, timeout as SocketTimeout from functools import partial import tlslite from urllib3.poolmanager im...
''' Example code showing different options for fits to exponential data ''' import numpy as np from matplotlib import pyplot as plt import scipy.stats from scipy.optimize import curve_fit plt.ion() plt.clf() ''' Our standard curve-fitting tools always require you to write a function containing your model. In sci...
from copy import deepcopy from distutils.util import strtobool import logging import os import warnings from box import Box from contextlib2 import ExitStack import pytest from tavern.schemas.files import wrapfile from .plugins import get_expected, get_extra_sessions, get_request_type, get_verifiers from .util impor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jun 15 10:46:38 2020 @author: adonay """ import os.path as op import numpy as np import pandas as pd import pickle import matplotlib.pyplot as plt import utils_io as uio import utils_signal_processing as sig_proc import utils_visualization as viz import...
import tensorflow as tf from kgcnn.layers.base import GraphBaseLayer from kgcnn.layers.modules import LazyMultiply, DenseEmbedding, LazyAdd from kgcnn.layers.pooling import PoolingLocalEdges from kgcnn.layers.gather import GatherNodesOutgoing @tf.keras.utils.register_keras_serializable(package='kgcnn', name='SchNetC...
#!/usr/bin/env python """Tests for grr.client.client_actions.grr_rekall.""" import functools import gzip import json import os from grr import config from grr.client import comms from grr.client.client_actions import tempfiles from grr.client.components.rekall_support import grr_rekall from grr.client.components.r...
import os import nipype.pipeline.engine as pe from pyminc.volumes.factory import * import nipype.interfaces.io as nio import nipype.interfaces.utility as niu import nipype.algorithms.misc as misc from nipype.interfaces.utility import Function from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPath...
import pyxel import math SPEED = 0.4 DEBUG = None def lerp(a, b, t): """lerp = linear interpolation. Returns a value between a and b, based on the value of t When t=0, a is returned. When t=1, b is returned. When t is between 0 and 1, a value mixed between a and b is returned. For example, lerp(10...
from multiprocessing import cpu_count import utils import pandas as pd from multiprocessing import Process import argparse CPU_CORE_NUMS = cpu_count() def subset_featuras(subset,idx): avg_sigval= subset['signalValue'].mean() max_sigval = subset['signalValue'].max() min_sigval = subset['signalValue'].m...
# Copyright 2012-2014 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 ac...
# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 # Author (©): <NAME> import logging import math from mcpi.vec3 import Vec3 import mcpi.block from mcthings.utils import size_region, find_min_max_cuboid_vertex class BlockMemory: def __init__(self, block_id, block_data, pos): self...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 7 10:57:56 2019 @authors: <NAME>, <NAME> """ import openpyxl import os from bs4 import BeautifulSoup import requests import pandas as pd ''' fantasy points calculation by position and returns the total calculated for each game Since items ...
""" The analytic potential of the galaxy so it can be used in Bridge as an external potentail. Most equations are taken from B&T: Binney and Tremaine, Galactic Dynamics, Second Edition """ import numpy from amuse.units import units, constants, quantities from amuse.datamodel import Particle, Particles from ...
# -*- coding: utf-8 -*- """ Created on Mon Feb 18 10:48:56 2019 @author: Kain Include ability to plot the timing of multiple points on the light curve by making an array of initialPoints, each corresponding to a title and then given by a legend...? Could be good... """ import numpy as np import wx #from PyAst...
""" This module implements the telnet protocol. This depends on a generic session module that implements the actual login procedure of the game, tracks sessions etc. """ import re from twisted.internet import protocol from twisted.internet.task import LoopingCall from twisted.conch.telnet import Telnet, StatefulTeln...
from code import interact import argparse import os import sys import textwrap import pkg_resources from pyramid.compat import configparser from pyramid.compat import exec_ from pyramid.util import DottedNameResolver from pyramid.paster import bootstrap from pyramid.settings import aslist from pyramid.scripts.common...
import cv2 import numpy as np # import time import torch from torch.nn import functional as F import torch.nn as nn def encode_segmentation_rgb(segmentation, no_neck=True): parse = segmentation face_part_ids = [1, 2, 3, 4, 5, 6, 10, 12, 13] if no_neck else [1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14] mouth_...
#Custom convolution filtering import cv2 import numpy as np # image = cv2.imread('images/susan_input1.png', 0) image = cv2.resize(image,(800,800)) #Custom convolution kernel # Robertsedge operator kernel_Roberts_x = np.array([ [1, 0], [0, -1] ]) kernel_Roberts_y = np.array([ [0, -1], [1, 0] ...
import os import cv2 import numpy as np import plotly from plotly.graph_objs import Scatter from plotly.graph_objs.scatter import Line import torch from torch.nn import functional as F from typing import Iterable from torch.nn import Module # Plots min, max and mean + standard deviation bars of a population over time...
# -*- coding: utf-8 -*- ''' Created on Mar 22, 2011 @author: mhaa ''' from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() from builtins import * from ...
"""Depth and outlyingness ABCs and implementations for multivariate data.""" from __future__ import annotations import abc import math from typing import Generic, Optional, TypeVar import numpy as np import scipy.stats import sklearn from scipy.special import comb from typing_extensions import Literal T = TypeVar("...
''' CFFI-Wrapper for YAJL C library version 2.x. ''' from cffi import FFI import functools import sys from ijson import common, backends, compat from ijson.compat import b2s ffi = FFI() ffi.cdef(""" typedef void * (*yajl_malloc_func)(void *ctx, size_t sz); typedef void (*yajl_free_func)(void *ctx, void * ptr); type...