text
stringlengths
3.07k
22.1k
# pylint:disable=no-name-in-module, import-error, no-member import zarr import javabridge import bioformats import numpy as np import json import xml from app.api import utils_transformations import app.api.classes as classes import skimage from skimage import exposure import os import pickle from pathlib import Path i...
# -*- coding: utf-8 -*- # # murderrl documentation build configuration file, created by # sphinx-quickstart on Thu Mar 3 22:57:26 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
from typing import List import numpy as np class Hypervolume: r"""Hypervolume computation dimension sweep algorithm from [Fonseca2006]_. Adapted from <NAME>'s implementation of the algorithm (Variant 3, Version 1.2) in [Fonseca2006]_ in PyMOO: https://github.com/msu-coinlab/pymoo/blob/master/pymoo/ve...
''' Reshape operation and expr. ''' import itertools import numpy as np import scipy.sparse as sp from traits.api import PythonValue, Instance, Tuple from spartan import rpc from .base import Expr, lazify from .shuffle import target_mapper from ... import master, blob_ctx, util from ...util import is_iterable, Asser...
import collections import sqlalchemy as sa from sqlalchemy.exc import InvalidRequestError from . import json_support from .exceptions import GinoException class ColumnAttribute: """The type of the column wrapper attributes on GINO models. This is the core utility to enable GINO models so that: * Acces...
""" Author: <NAME> GitHub: wafflescore """ import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.ndimage import gaussian_filter from MiscHelpers import search_list import logging import sys logging.basicConfig(format='%(asctime)s | %(levelname)s : %(message)s', level...
import codecs import csv import itertools import os import random import re import unicodedata import torch from .models.voc import Voc ''' Utility functions for corpus preprocessing ''' MAX_LENGTH = 10 # Maximum sentence length to consider MIN_COUNT = 3 # Minimum word count threshold for trimming PAD_token = 0...
import warnings import abc import attr from types import SimpleNamespace from typing import Any, ClassVar, Dict, List, MutableSequence, Optional, Tuple, Type, Union, cast, Iterable from ics.component import Component from ics.contentline import Container from ics.types import ContainerItem, ContextDict, ExtraParams ...
import textwrap from collections import namedtuple import numpy as np from sklearn import datasets from neupy import algorithms, layers from neupy.exceptions import StopTraining from neupy.algorithms.base import (ErrorHistoryList, show_network_options, logging_info_about_the_data, ...
import serial import chardet from enum import Enum # 1 # Communication time out # 2 # Mechanical time out # 3 # Command error or not supported # 4 # Value out of range # 5 # Module isolated # 6 # Module out of isolation # 7 # Initializing error # 8 # Thermal error # 9 # Busy # 10 # Sensor Error (May appear during sel...
#! /usr/bin/env python # -*- coding: UTF-8 -*- # Author : <NAME>, <NAME> # This program is published under a GPLv2 license import re from scapy.packet import Packet, bind_layers from scapy.fields import StrField from scapy.layers.inet import TCP def _canonicalize_header(name): ''' Takes a header key (i.e., "Host...
import math import sys import itertools as it import data_IO import warnings from collections import OrderedDict def isInt(s): try: int(s) return True except ValueError: return False def frange(a, b, inc): if isInt(a) and isInt(b) and isInt(inc): a = int(a) b = int...
from __future__ import division, absolute_import, print_function __copyright__ = "Copyright (C) 2012 <NAME>" __license__ = """ 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,...
import sys import numpy as np import trimesh from src.utils import libmcubes from src.common import make_3d_grid, normalize_coord, add_key, coord2index from src.utils.libmise import MISE import time from src.utils.libmesh import check_mesh_contains import os import open3d as o3d from skimage import measure def make_p...
import torch import numpy as np def soft_update_from_to(source, target, tau): for target_param, param in zip(target.parameters(), source.parameters()): target_param.data.copy_( target_param.data * (1.0 - tau) + param.data * tau ) def copy_model_params_from_to(source, target): for...
import tensorflow as tf import numpy as np def _linear_2d(inputs, output_size, bias, concat=True): input_size = [item.get_shape()[1].value for item in inputs] outputs = [] if concat: total_input_size = 0 # input_size = sum(input_size) for size in input_size: total_input_size += size inp...
# Importing Libraries import time import collections from flask import Flask ,jsonify, request, json from flask_cors import CORS import matplotlib.pyplot as plt import numpy as np import json import cv2 import tensorflow as tf config = tf.compat.v1.ConfigProto() config.gpu_options.allow_growth = True sess =...
from vou.utils import logistic from random import Random from enum import IntEnum, unique from itertools import repeat from collections import deque import numpy as np @unique class BehaviorWhenResumingUse(IntEnum): SAME_DOSE = 0 LOWER_DOSE = 1 @unique class OverdoseType(IntEnum): NON_FATAL = 0 FA...
""" MIT License Copyright (c) 2019 luopeixiang 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, merge, publish, d...
#!/usr/bin/env python # encoding: utf-8 import re import random import datetime from . import data from . import func def generator_address_code(address=None): """ 生成地址码 :param address: :return: """ address_code = '' if address is not None: for key, val in data.get_address_code()....
"""Telegram bot server.""" import functools import itertools import json import asyncio import operator from collections import defaultdict from datetime import datetime, timedelta from logging import getLogger from typing import Dict, Union, Tuple, Iterable, List from aiogram import Bot, Dispatcher from aiogram impor...
# -*- encoding: utf-8 -*- r""" Three-Dimensional Graphics Output Types This module defines the rich output types for 3-d scenes. """ #***************************************************************************** # Copyright (C) 2015 <NAME> <<EMAIL>> # # Distributed under the terms of the GNU General Public Lic...
from skidl import * from UliEngineering.Electronics.Resistors import * # LIBRARIES, FOOTPRINTS, TEMPLATES lib_search_paths[KICAD].append('../libraries') lib = 'morse-blinky' units = { '74HC04': 6, '74HC08': 4, '74HC11': 3, '74HC21': 2, '74HC32': 4 } def skidl_build(nleds, length, connects, ga...
from distutils.core import setup from distutils import spawn from setuptools.command.test import test as _test from setuptools.command.test import test as TestCommand from setuptools import Command from setuptools import Extension import subprocess import os import platform CODE_DIRECTORY = 'posh' DOCS_DIRECTORY = 'do...
from astropy import units as u from astropy import time from perylune.constants import * from perylune.horizons import name_to_horizons_id from poliastro.constants import GM_earth, GM_sun from poliastro.bodies import Earth, Sun from poliastro.ephem import Ephem from poliastro.twobody import Orbit from poliastro.util ...
import ast import math import os import json import logging # load instance data for aws and azure # import redis t_unlimited_price = 0.05 def cheapest_custom_instance(cid, cpu_request, memory_request): max_price = 100000000.0 custom_price = max_price custom_cpus = 10000000000 custom_memory = 100000...
""" Simple library of Cromwell REST API calls for running and querying workflows """ from collections import namedtuple import functools import requests import logging import uuid import json import time import re import os.path as op import os import sys log = logging.getLogger(__name__) class JobStates(object): ...
# -*- coding: utf-8 -*- import json import re from typing import Dict, Optional, Sequence class Dish: def __init__(self, name, price, ingredients, dish_type): self.name = name try: self.price = float(price) except ValueError: self.price = price self.ingredi...
import asyncio import collections import datetime import logging import time import re import aiohttp from dango import dcog, Cog import discord from discord.ext.commands import command from discord.ext.commands import converter from discord.ext.commands import default from discord.ext.commands import errors from disc...
import requests from datetime import datetime import pandas as pd def menu_inicial(n_senha, tam_senha): print('\nSeja bem vindo ao SENAC. Para continuar seu cadastro, escolha uma das opções abaixo:\n ') print('1. Login') print('2. Cadastro de conta') print('3. Esqueci minha senha') print('4. Sair ...
import logging import math import os import pickle import random from enum import Enum from pathlib import Path from queue import Queue import numpy as np import torch from Utils.data_utils import change_win_to_unix_path_if_needed class FileSetIterator: """ An iterator for samples stored in a set of files. ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from functools import wraps import time import threading import uuid from warnings import warn from django.conf import settings from django.core.cache import cache, DEFAULT_CACHE_ALIAS try: from django.core.cache import DefaultCacheProxy Connecti...
import ctypes import ctypes.wintypes from pathlib import Path from qtpy import QtCore, QtGui, QtWidgets from qtpy import PYSIDE, PYSIDE2, PYQT4, PYQT5 def using_pyside(): return PYSIDE or PYSIDE2 def using_pyqt(): return PYQT4 or PYQT5 LASTMAP = None class LASTINPUTINFO(ctypes.Structure): ...
# pylint: disable=invalid-name import tempfile import shutil import os import numpy as np import pytest from perception import hashers, tools, testing def test_deduplicate(): directory = tempfile.TemporaryDirectory() original = testing.DEFAULT_TEST_IMAGES[0] duplicate = os.path.join(directory.name, 'ima...
""" In order to study a model the steps are: 1. Inference samples that we force a style or emotion 2. Compute the wav file with WaveGlow 3. Extract the mel spectrogram with librosa 4. Take the values to the range [0, 1] dividing by 80 and summing 1. 5. Classify the samples with a Classifier trained ...
from uuid import UUID from typing import List from datetime import datetime import logging from fairgraph.base import KGQuery, as_list from fairgraph.brainsimulation import ValidationTestDefinition, ValidationScript from fastapi import APIRouter, Depends, Query, HTTPException, status from fastapi.security import HTTP...
# coding: utf-8 # --- # @File: bl_model.py # @description: baseline 对比实验的模型类 # @Author: <NAME> # @E-mail: <EMAIL> # @Time: 2月26, 2019 # --- import tensorflow as tf import numpy as np import bl_data tf.enable_eager_execution() class XNN(tf.keras.Model): def __init__(self, num_class, rnn_units, drop_rate): ...
## Copyright 2019 <NAME>, <NAME>, <NAME>, <NAME>, and <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...
# coding=utf-8 # flightsim.py # created on 2021/3/6 # author @zoloypzuo # usage: flightsim from cyclone_demo_app import Application from cyclone_demo_common import * def drawAircraft(): # Fuselage glPushMatrix() glTranslatef(-0.5, 0, 0) glScalef(2.0, 0.8, 1.0) glutSolidCube(1.0) glPopMatrix() ...
import os import tensorflow as tf from tensorflow.python.keras.models import Model from tensorflow.python.keras import layers from tensorflow.python.keras.layers import Input from tensorflow.python.keras.layers import Activation from tensorflow.python.keras.layers import Concatenate from tensorflow.python.keras.layers...
import drilling as dri import general as gen import math def angle_averaging(depth, inc_one, inc_two, azi_one, azi_two): north = (depth * (math.sin(math.radians(inc_one + inc_two) / 2)) * (math.cos(math.radians(azi_one + azi_two) / 2))) east = (depth * (math.sin(math.radians(inc_one + inc_two) / ...
""" mcpython - a minecraft clone written in python licenced under the MIT-licence (https://github.com/mcpython4-coding/core) Contributors: uuk, xkcdjerry (inactive) Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence Original game "minecraft" by Mojang Studios (www.m...
import pandas as pd from sys import argv SEARCH_ID_KEY = "search_id" SEQ_POOL_COMP_ID = "sequenced_pool_component_id" VARIANT_S3 = "variants_s3" CONSENSUS_S3 = "consensus_s3" BAM_S3 = "trimmed_bam_s3" SOURCE = "source" SEQ_RUN = "seq_run" OVERALL_FAIL = "overall_fail" SUBMIT_TO_GISAID = "submit_to_gisaid" INDEX_COL_N...
""" Python module that contains functions to manipulate the datasets used to train the models """ import logging import concurrent.futures import numpy as np from sklearn.preprocessing import Binarizer, Normalizer def create_noisy_features( features, labels, experiment_settings, data_parameters, ): ...
import pytest from hypothesis import given import astropy.units as u from astropy.time import TimeDelta import sunpy.net.dataretriever.sources.goes as goes from sunpy.net import Fido from sunpy.net import attrs as a from sunpy.net._attrs import Instrument, Time from sunpy.net.dataretriever.client import QueryResponse...
""" cryptor Utilities for (En|De)crypting. """ __all__ = ['Cryptor', 'Encryptor', 'Decryptor'] import os import binascii from pathlib import Path from getpass import getpass from typing import Optional, Tuple from base64 import urlsafe_b64encode, urlsafe_b64decode from abc import ABCMeta, abstractproperty, abstractme...
import sys import random import re from collections import defaultdict import pyttsx3 # Initial word boundaries are represented by '#', and final word boundaries are represented by '##'. PHONE_LIST = ( '#', 'AA', 'AE', 'AH', 'AO', 'AW', 'AY', 'B', 'CH', 'D', 'DH', 'EH', 'ER', 'EY', 'F', 'G', 'HH', 'IH', 'IY', 'JH...
import itertools from collections import deque class STATUS: READY = 0 COMPLETE = 1 WAIT = 2 class OP: SUM = 1 MUL = 2 INPUT = 3 OUTPUT = 4 JUMP_IF_TRUE = 5 JUMP_IF_FALSE = 6 LESS_THAN = 7 EQUALS = 8 HALT = 99 class MODE: POSITION = 0 IMMEDIATE = 1 class Parameter: def __init__(self, mode, value)...
import sys from eventlet import event from eventlet import greenthread import logging from nile.common import reflection from nile.common import timeutils from nile.common.i18n import _ import inspect import types import six try: _TYPE_TYPE = types.TypeType except AttributeError: _TYPE_TYPE = type LOG = log...
#!/usr/bin/env python3 #-*- coding: utf-8 -*- """ """ import argparse import sys import time import os import glob import traceback import shutil import subprocess from . import get_n_genomes from . import _version # --------------------------- methods --------------------------- # def get_args(test_args=None): ...
""" Graph module for directed graph. Includes the functions implemented in the Jan 21/22 lectures with one key difference. The way the nodes and edges are stored has already been converted to the "adjacency list" representation we will discuss next lecture. More specifically, _alist is a dictionary that maps a node ...
""" MIT License Copyright (c) 2019 ming 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, merge, publish, distribu...
#!/usr/bin/env python # -*- coding: utf-8 -* from __future__ import unicode_literals import sys reload(sys) sys.setdefaultencoding('utf-8') """@Reference: https://github.com/5hirish/adam_qas/blob/master/qas/classifier/question_classifier.py""" #import spacy #import csv import logging from sklearn.naive_bayes import G...
import json from unidecode import unidecode import codecs from elasticsearch import Elasticsearch es=Elasticsearch() import geocoder import folium from geopy.geocoders import Nominatim from geopy.distance import geodesic import os def getmyloc(): g = geocoder.ip('me') #print(g.latlng) # list...
# -*- coding: utf-8 -*- """ /*************************************************************************** qgridder.py Qgridder - A QGIS plugin Plugin main file. Qgridder Builds 2D regular and unstructured grids and comes together with pre- and post-processing capabilities for spati...
# # Copyright (c) 2014 <NAME>. All rights reserved. # # 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, merg...
# Facial landmarks with dlib, OpenCV, and Python # import the necessary packages import datetime, imageio,argparse, imutils, time, dlib, cv2, PIL,os from imutils import face_utils from imutils.video import VideoStream from testing.mark_detector import MarkDetector as mark_detector import numpy as np def draw_individu...
"""Compute statistics of online few-shot episodes. Author: <NAME> (<EMAIL>) """ from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import time from datetime import datetime from fewshot.utils.logger import get as get_logger from fewshot.exp...
import gpflow from likelihoods import SwitchedLikelihoodCoregion from models import SVGPCoregion import numpy as np import matplotlib.pyplot as plt # plt.rcParams['figure.figsize'] = (12, 6) np.random.seed(123) # make a dataset with two outputs, correlated, heavy-tail noise. One has more noise than the other. X1 = np...
# Copyright (c) 2021 Qianyun, Inc. All rights reserved. from cloudchef_integration.tasks.cloud_resources import utils from cloudchef_integration.tasks.cloud_resources.ucloud.constants import UCLOUD_REGION_NAME, UCLOUD_ZONE_NAME from cloudchef_integration.tasks.cloud_resources.commoncloud.utils import format_ins_status...
import logging import pathlib import sys import tempfile from typing import Any, Dict, List, Optional, Tuple, Type, cast import determined as det import determined_common import determined_common.api.authentication as auth from determined import constants, errors, load, workload from determined_common import api, chec...
# module: tokrules.py # author: helq # license: wtfpl # This module contains the type analizer and the interpreter primitives = ['CONS', 'CAR', 'CDR', 'Not', 'ToString'] def isInfacts_list(id, facts_list): lenEnvs = len(facts_list) for i in range(lenEnvs-1,-1,-1): if id in facts_list[i]: r...
import tensorflow as tf from tensorflow.contrib import slim import numpy as np from sklearn.metrics import f1_score spdot = tf.sparse_tensor_dense_matmul dot = tf.matmul def sparse_dropout(x, keep_prob, noise_shape): """Dropout for sparse tensors.""" random_tensor = keep_prob random_tensor += tf.random_un...
import random import numpy as np from midiutil import MIDIFile import midi_scales from midi_scales import * import matplotlib.pyplot as plt class BrownianMidiPart: ''' Generates a random midi part, based on Brownian Motion. number_of_notes: the number of notes to generate key: 'C','C#','Db','D','D#','...
#!/usr/bin/env python # encoding: utf-8 """ @version: ?? @author: muyeby @contact: <EMAIL> @site: http://muyeby.github.io @software: PyCharm @file: MyGAN.py @time: 18-1-27 上午11:10 """ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd ...
""" Static site generator. Copyright (c) 2009 <NAME> Licensed under the terms of the MIT license. """ import codecs import locale import os import re import shutil import sys import time from collections import defaultdict from datetime import datetime from itertools import izip from os import path import dateutil.p...
import pandas as pd from pandas.api.types import CategoricalDtype import numpy as np import os from itertools import product from app_rais.dicts_constants import interest_columns_for_year import app_rais.dicts_constants as dc modulepath = os.path.dirname(__file__) def pretreat_2018(list_ufs, year=2018): for uf ...
from cso_api.models import Graph, Data_Point from cso_api.serializers import GraphSerializer, Data_PointSerializer, GraphPointsSerializer from rest_framework import generics class GraphList(generics.ListCreateAPIView): queryset = Graph.objects.all() serializer_class = GraphSerializer class GraphRegionList(g...
#!/usr/bin/python # coding: utf-8 # Standard libraries import time import threading import logging import signal import sys import select sys.path.append("/home/kristian/pythonlib") # My own standard libraries import pigpio import kdate import button # Foosball libraries import teamscore import goaldetect import act...
import sys import ssl import json import asyncio import aiortc import aiohttp sys.path.append("..") from aiortc.rtp import RtpPacket from rtcbot import RTCConnection, CVCamera from aiortc import RTCConfiguration, RTCIceServer, RTCIceGatherer class RTCPublisher(object): def __init__(self, channel="c0dko1upjh69da...
#!/usr/bin/env python import argparse import boto3 import configparser import datetime import json import sys import time from decimal import Decimal import cbpro import gspread from oauth2client.service_account import ServiceAccountCredentials from retrying import retry DEFAULT_ROWS = "1000" DEFAULT_COLUMNS = "11" D...
""" Vulnerability estimation code. """ import itertools import warnings import numpy as np import pandas as pd from joblib import Parallel, delayed from sklearn.ensemble import GradientBoostingClassifier from utils import log_losses _MSG_ENFORCE_UNIFORM_PRIOR_AND_MICRODATA = ( "enforce_uniform_prior has no eff...
import os import argparse import numpy as np from itertools import cycle import torch import random import pickle from torchvision import datasets from torch.autograd import Variable from torch.distributions import Normal import math from alternate_data_loader import MNIST_Paired from alternate_data_loader import Doub...
#install eventregistry using "pip install eventregistry" - see https://github.com/gregorleban/EventRegistry import sys, os, time, datetime, configparser import pandas as pd from eventregistry import * import urllib.parse import hashlib from bs4 import BeautifulSoup from googletrans import Translator cur_path = os....
"""PPO utilities. """ import numpy as np import torch import torch.nn as nn from gym.spaces import Box from collections import defaultdict from copy import deepcopy from safe_control_gym.math_and_models.neural_networks import MLP, CNN, RNN, init_ from safe_control_gym.math_and_models.distributions import Normal, Cat...
from . import misc_util import numpy as np import cv2 BORDER = 0 CV_FONT = cv2.FONT_HERSHEY_DUPLEX FANCY_FONT = None FONT_SIZE = 18 def draw_contrast_text_cv2(im, text, position, size=None): if size is None: size = im.shape[1] / 320.0 im = cv2.putText(im.copy(), text, position, CV_FONT, size, [0, 0, ...
""" CEASIOMpy: Conceptual Aircraft Design Software Developed for CFS ENGINEERING, 1015 Lausanne, Switzerland The script evaluates the moment of inertia of an unconventional aircraft using the lumped masses method. | Works with Python 2.7 | Author : <NAME> | Date of creation: 2018-09-27 | Last modifiction: 2019-08-29...
import numpy as np import matplotlib.pyplot as plt import lmfit from scipy.interpolate import interp1d def exp(t, amp, tau): s = amp * np.exp(-t/tau) s[t < 0] = 0 return s def offset(t, amp): s = amp * np.ones(t.shape) s[t < 0] = 0 return s def sine(t, amp, f, phi): s = amp * np.sin(2 * ...
#!/usr/bin/env python3 import os import sys import glob import argparse import logging import coloredlogs import datetime import numpy as np from scipy import stats from scipy import integrate import mne import csv from statsmodels.stats.weightstats import ttest_ind # Mutated from mmn_grand_average.py to do statistic...
from __future__ import print_function from __future__ import division import re import sys try: import pyudev except ImportError: # pragma: no cover sys.exit("Failed to import pyudev (https://pyudev.readthedocs.org/):," " install using:\n pip install pyudev") try: import serial except ImportErro...
#!/usr/bin/python # Classification (U) """Program: mongo_db_dump.py Description: The mongo_db_dump program runs dumps against a Mongo database and depending on which type of dump is selected can dump individual databases. Usage: mongo_db_dump.py -c file -d path {-M -o di...
from mathutils import Euler, Vector from torch.utils.data import DataLoader import bpy import math import numpy as np import os import snook.data.blender as blender import snook.data.generator as generator import snook.data.dataset as dataset def assert_vector_eq(a: Vector, b: Vector) -> bool: _a, _b = np.array(...
from collections import OrderedDict import copy import random from unittest import TestCase import pytest import numpy as np from zfit.core.limits import Space, convert_to_space from zfit.util.exception import ConversionError, ObsNotSpecifiedError, AxesNotSpecifiedError, LimitsUnderdefinedError lower1 = (1,), (4,) u...
import numpy as np import torch import torch.nn.functional as F import torchvision from mmcv import color_val, imshow, tensor2imgs import cv2 import mmcv import os # from mmcv.runner import HOOKS, LoggerHook, master_only, TensorboardLoggerHook from mmcv.runner import TensorboardLoggerHook, HOOKS, master_only from mmde...
"""Handle the frontend for Home Assistant.""" import hashlib import logging import os from homeassistant.const import EVENT_HOMEASSISTANT_START from homeassistant.components import api from homeassistant.components.http import HomeAssistantView from .version import FINGERPRINTS DOMAIN = 'frontend' DEPENDENCIES = ['ap...
import os from django.test import SimpleTestCase, TestCase from corehq.apps.receiverwrapper.util import submit_form_locally from corehq.util.test_utils import TestFileMixin from corehq.form_processor.interfaces.processor import FormProcessorInterface from corehq.form_processor.tests.utils import sharded from corehq.fo...
"""Functions to interface with sensors and peripherals""" import time # time.sleep() import types import serial # Pump import analysis import constants import devices.board_mock as board_mock import devices.keypad as keypad # UI import devices.keypad_mock as keypad_mock import devices.lcd as lcd # UI import devi...
from decimal import Decimal import logging import re from flask import Response, jsonify from peewee import * # from peewee import Expression # the building block for expressions try: from .models import User, Order, OrderLine except SystemError: from models import User, Order, OrderLine _logger = logging.g...
class PQueue: def __init__(self): self.size=0 # The below is a list of tuples. In every tuple one value # is the element from list and the second value identifies the list. self.arr = [] def isempty(self): return True if (self.size == 0) else False # Heapify el...
# Software License Agreement (BSD License) # # Copyright (c) 2008, <NAME>, 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 copyri...
from __future__ import print_function import ast import baker import logging import math import numpy as np from sklearn.preprocessing import MaxAbsScaler from tqdm import tqdm import core from core.cascade import load_data, load_data_file, load_costs_data, load_model, save_model, group_counts, group_offsets from co...
from typing import Any, Dict, Iterable, List, Iterator, Tuple, Optional, Set import numpy as np import tensorflow as tf from dpu_utils.utils import RichPath from .graph_dataset import DataFold, GraphSample, GraphBatchTFDataDescription, GraphDataset from .utils import compute_number_of_edge_types, get_tied_edge_types,...
from django.shortcuts import render,get_object_or_404,redirect from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden from django.urls import reverse from django.views.generic.edit import FormMixin from .models import Post, Category, Comment, Tag from django.contrib.auth.forms import UserCre...
'''A pretty printer for Runa CFG nodes. This module implements another CFG walker, which spits out a string represenation of the given CFG object. This is intended as a debugging aid during compiler development, and can be invoked using the compiler driver's `show` command (parametrized with the last pass to run befor...
# coding=utf-8 from __future__ import absolute_import from __future__ import unicode_literals import itertools import os from collections import namedtuple, defaultdict from contextlib import contextmanager from clint.textui import puts from commcare_cloud.cli_utils import has_arg, ask from commcare_cloud.colors impo...
import asyncio from random import randint import sys import time import cozmo from cozmo.util import degrees, distance_mm, speed_mmps #: The name that the owner's face is enrolled as (i.e. your username in the app) #: When that face is seen, Cozmo will assume no other faces currently seen are intruders OWNER_FACE_ENR...
import tensorflow as tf class Autoencoder(tf.keras.models.Model): """Basic autoencoder consisitng of a encoder and a decoder part.""" def __init__(self, encoder, decoder): super().__init__() self.encoder = encoder self.decoder = decoder # Metrics self.metr...
from pypy.objspace.flow.model import Block, Constant, Link, copygraph, Variable from pypy.objspace.flow.model import mkentrymap, c_last_exception from pypy.rpython.lltypesystem import lltype from pypy.translator.llvm.node import FuncNode from pypy.translator.llvm.opwriter import OpWriter from pypy.translator.llvm.log i...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on: 2021/07/22 18:45 @Author: Merc2 ''' import sys from typing import OrderedDict sys.path.append('/home/hu/MultiDiff/') from sklearn import cluster import time from vqgan.modules.vqvae.quantize import VectorQuantizer2 import torch import torch.nn.functional as...
import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim from tensorflow.contrib.layers.python.layers import initializers from tensorflow.contrib.layers import l2_regularizer from tensorflow.python.ops import nn import math DEFAULT_PADDING = 'SAME' def layer(op): '''Decorator for compos...