text
stringlengths
3.07k
22.1k
import os import shutil from django.test import TestCase, tag from unittest.mock import patch from data_refinery_common.models import ( SurveyJob, Batch, BatchKeyValue, BatchStatuses, File, ProcessorJob, ) from data_refinery_workers.processors import salmon, utils from data_refinery_common.loggi...
import time import base64 from datetime import datetime as dt from datetime import timedelta as td from algosdk.future import transaction from algosdk import account, mnemonic, logic from algosdk.v2client import algod from pyteal import * from pyteal.ast import app ''' ***************************WARNING**************...
#!/usr/bin/env python3 """ Detect the cells in each frame using one of the CNNs Requires the image contrast be corrected using ``extract_frames.py`` Training the net for 50,000 iterations on the AI-L-GFP dataset .. code-block:: bash ./detect_cells.py \\ --overwrite \\ --composite-mode peak \\ ...
import zmq import time import pytest from queue import Queue from threading import Thread, Event, Condition from teos.chain_monitor import ChainMonitor, ChainMonitorStatus from test.teos.conftest import generate_blocks, generate_blocks_with_delay from test.teos.unit.conftest import get_random_value_hex, bitcoind_feed...
import json import os import geocoder import pandas as pd import plotly.express as px from plotly.colors import label_rgb as rgb import streamlit as st st.title('Oldways Data Analyzer') mode_selection = st.sidebar.selectbox('App Mode:', ('Filtered Analysis', 'Automatic Analysis')) '### Inputs' excel_file = st.file_u...
import configparser import datetime import json from math import floor, ceil import os import requests from IO.locationData import LocationData from utils_intern.messageLogger import MessageLogger from utils_intern.timeSeries import TimeSeries logger = MessageLogger.get_logger_parent() # Date = Date & time (UTC)...
#!/usr/bin/env python """ fabfile.py ============================== Spyce local tasks .. todo:: Convert script to module, & use classes. Tutorial_ .. _Tutorial: https://inb.readthedocs.io/en/latest/concepts/library.html .. todo:: Figure out a way to include function docstrings in docs .. tod...
""" Implementations of lineouts specific to the tcvx21 analysis """ import numpy as np import warnings from pathlib import Path from numpy.polynomial import Polynomial import matplotlib.pyplot as plt import xarray as xr import pint from .lineout_m import Lineout, on_grid_interpolator from tcvx21.analysis.contour_findi...
""" Genevieve-style notes views. In theory GenNotes supports various ways of variant annotation -- flexibly allowing arbitrary tags, like OpenStreetMap. However, the original use case is Genevieve, and it's possible this is the only use GenNotes ever sees. So we'll support this natively, enabling editing within GenNo...
import subprocess from pathlib import Path import logging from argparse import ArgumentParser from io import BytesIO import base64 from copy import copy from lxml import etree as ET from svgpathtools import parse_path, Path as SVGPath, Line, CubicBezier from svgpathtools.parser import parse_transform from svgpathtools...
import numpy as np from functools import partial NG_EXACT = 'exact' NG_BD = 'block_diagonal' NG_BTD = 'block_tri_diagonal' NG_KFAC = 'kfac' __all__ = [ 'init_ntk_mlp', 'forward_and_backward', 'empirical_kernel', 'gradient_mse', 'natural_gradient_mse', 'exact_natural_gradient_mse', 'block_wise_natural_g...
import numpy as np import tensorflow as tf from hailo_model_zoo.core.preprocessing.affine_utils import transform_preds def _nms(heatmap): heatmap_padded = tf.pad(heatmap, [[0, 0], [1, 1], [1, 1], [0, 0]]) pooled_heatmap = tf.nn.max_pool(heatmap_padded, [1, 3, 3, 1], [1, 1, 1, 1], 'VALID') keep = tf.cast(t...
""" The MIT License (MIT) Copyright (c) 2014 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publi...
from decimal import Decimal, InvalidOperation from django.utils.translation import ugettext as _ from corehq.apps.commtrack.dbaccessors import get_supply_point_case_by_location from dimagi.utils.decorators.memoized import memoized from corehq.apps.consumption.shortcuts import get_default_consumption, set_default_cons...
import time import cv2 import face_recognition import pymysql import numpy as np from PIL import ImageDraw, ImageFont, Image from face_recognition import load_image_file from spyder.widgets.findinfiles import FILE_PATH FILE_PATH1 = "/Users/zhaxiaohui/pyseeta/pic/obama.jpg" FILE_PATH2 = "/Users/zhaxiaohui/pyseeta/pic/l...
#Types. from typing import Dict, Set, List, Tuple, Any #Transactions classes. from e2e.Classes.Transactions.Transaction import Transaction from e2e.Classes.Transactions.Claim import Claim from e2e.Classes.Transactions.Send import Send from e2e.Classes.Transactions.Data import Data #Consensus classes. from e2e.Classes...
# Importing the necessary libraries import matplotlib.pyplot as plt import dlib import matplotlib.patches as mpatches from skimage import io, transform import numpy as np import cv2 import easyocr import csv import spacy # Using DLIB for face detection detector = dlib.get_frontal_face_detector() image = i...
# -*- coding: utf-8 -*- """ NLTK WordNet wrapper API here is exactly the same as NLTK WordNet API, except that lang (language) argument will be "tha" (Thai) by default. For more on usage, see NLTK Howto: https://www.nltk.org/howto/wordnet.html """ import nltk try: nltk.data.find("corpora/omw") except LookupError...
""" v1 vs v: + decode ab truoc + phong lon bang x_bact + moi ghep vao --> gia su y_image co dang (h, w, nb_q) --> gia su y_bact co dang (batch, h, w, nb_q) """ import numpy as np, cv2, os import matplotlib.pyplot as plt import scipy.ndimage.interpolation as sni from .utils import read_image import tqdm __all__ = ["de...
#!/usr/bin/env python # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4: import cv2 import numpy as np import tensorflow as tf import csv import os import sklearn from keras.models import Sequential from keras.layers import Flatten, Dense, Lambda, Cropping2D, Dropout, Conv2D from keras.layers.pooling import MaxPoo...
import os import sys if os.path.realpath(os.getcwd()) != os.path.dirname(os.path.realpath(__file__)): sys.path.append(os.getcwd()) import deephar from deephar.config import mpii_dataconf from deephar.config import pennaction_dataconf from deephar.config import ModelConfig from deephar.data import MpiiSinglePers...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import torch from .raw_audio_dataset import FileAudioDataset import numpy import scipy import soundfile as sf import librosa ...
#!/usr/bin/python3.6 import os, sys, time, json from configparser import ConfigParser from datetime import datetime # pylint: disable=F0401 from tqdm import tqdm # get config cfg = ConfigParser() cfg.read('config.ini') # root directory of the maildir account directory of thunderbird maildir = cfg.get('email', 'Thunder...
import pytest from numpy import random from numpy import percentile from numpy import bitwise_and from numpy import testing from accumulation_tree import AccumulationTree from tdigest.tdigest import TDigest, Centroid def RBTree(data): t = AccumulationTree(lambda centroid: centroid.count) for k, v in data: ...
""" This file contains the default config data for the reports system On start-up thirtybirds loads config data. It loads default configs from config/ unless otherwise specified. New config data can be loaded dynamically at runtime. Typical usage example: from config import reports foo = ClassFoo(reports.foo_conf...
# -*- coding: utf-8 -*- import base64 import codecs import decimal import hashlib import json import os import re import tempfile import time import uuid from datetime import timedelta, datetime from random import Random import xlrd __author__ = 'yezang' class DataResult(object): message = "" success = Fals...
""" Copyright 2016, EMC, Inc. """ from on_http_api2_0 import ApiApi as Api from on_http_api2_0.rest import ApiException from config.api2_0_config import config from json import loads from common.fit_common import fitargs import flogging logs = flogging.get_loggers() HTTP_NOT_FOUND = 404 def __fitargs_get(key): ...
import argparse import os import json from google.protobuf import json_format from grpc_server.__main__ import Openapi from snappi import otg_pb2 SETTINGS_FILE = 'settings.json' TESTS_FOLDER = 'tests' MOCK_GRPC_SERVER_CONTEXT = "test" def get_root_dir(): return os.path.dirname( os.path.dirname(os.path....
#!/bin/env python3 # -*- coding: utf-8 -*- import os import sys import time import datetime import signal import subprocess import glob import Mobigen.Common.Log_PY3 as Log import math import shutil #import Mobigen.Utils.LogClient as c_log def handler(sigNum, frame): sys.stderr.write('Catch Signal Number : %s \n' % ...
import gc from pypy.rpython.extregistry import ExtRegistryEntry # ____________________________________________________________ # General GC features collect = gc.collect def set_max_heap_size(nbytes): """Limit the heap size to n bytes. So far only implemented by the Boehm GC and the semispace/generation GCs. ...
import os import pytest from webbpsf import wfirst, measure_fwhm from numpy import allclose MASKED_FLAG = "COLD_PUPIL" UNMASKED_FLAG = "UNMASKED" AUTO_FLAG = "AUTO" def test_WFI_psf(): """ Just test that instantiating WFI works and can compute a PSF without raising any exceptions """ wi = wfirst.W...
import numpy as np from scipy.interpolate import CloughTocher2DInterpolator import logging from numba import njit logger = logging.getLogger(__name__) @njit def _get_nearby_good_pixels(bad_msk, nbad, buff, iso_buff): """ get the set of good pixels surrounding bad pixels. Parameters ---------- b...
from sample_players import DataPlayer, BasePlayer import math import random from isolation import Isolation class Stats: def __init__(self, state: Isolation, player_id: int, visit_count=0, win_score=0): self.state = state self.player_id = player_id self.visit_count = visit_count se...
# std import warnings from collections import defaultdict # third-party import numpy as np from scipy.signal import get_window from astropy.stats import sigma_clipped_stats # relative from recipes.array import fold from .spectral import resolve_overlap # TODO: OCSVM, Tietjen-Moore, Topological Anomaly detection ...
import numpy as np from rpn.utils.torch_utils import to_tensor, to_numpy import torch try: from torch_geometric.data import Data, batch except ImportError as e: print('Warning: cannot import torch_geometric. This does not affect the core functionality of this repo.') def add_supernodes(node_index, edge_index...
#Author: <NAME> #Email: <EMAIL> """ This code is to simulate a MRI signal and its noise. It also plots a figure of how it looks like with different parameters. """ import numpy as np import seaborn as sns import matplotlib.pyplot as plt import os def Simulate_Signal1D(size_array,delta_time,T2,freq,real=True): """...
import math import torch import torch.nn as nn import torch.nn.functional as F import partialsmiles as ps from rdkit import Chem from utilities import ops class Vae(nn.Module): def __init__(self, vocab, vocab_size, embedding_size, dropout, padding_idx, sos_idx, unk_idx, max_len, n_layers, hidden_size,...
import numpy as np import keras from keras import backend as K ############################################################################### ## VGG-19 network ############################################################################### def VGG19(input_tensor=None, input_shape=None, avgPooling=False): """ ...
#!/usr/bin/env python3 #This program computes azimuth FM rate using frame pickle file. #The computed azimuth FM rate and range sample number (start with index 0) #are fitted to a second polynomial. #The coefficents of the polynomial is saved to the frame. #The old frame file is then replaced with the new frame file. ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Preprocess ieee-fraud-detection dataset. (https://www.kaggle.com/c/ieee-fraud-detection). Train shape:(590540,394),identity(144233,41)--isFraud 3.5% Test shape:(506691,393),identity(141907,41) ############### TF Version: 1.13.1/Python Version: 3.7 ############### """ imp...
from PySide2 import QtWidgets, QtCore, QtGui from PySide2.QtCore import QPropertyAnimation, QRectF, QSize, Qt, Property from PySide2.QtGui import QPainter, QColor, QPalette from PySide2.QtWidgets import ( QAbstractButton, QApplication, QHBoxLayout, QSizePolicy, QWidget, ) import time class Ui_Go...
import os import re import subprocess import shutil from contextlib import suppress from warnings import warn import pendulum import pendulum.exceptions import numpy as np from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from astropy.wcs import WCS from ...
import typing as t from datetime import date, datetime, timedelta from django.conf import settings from django.db import models from django.db.models.expressions import ExpressionWrapper as E from django.utils import timezone from django_fsm import FSMIntegerField, can_proceed, transition from django_fsm_log.decorator...
# 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 -*- import numpy as np import scipy.special import warnings import smuthi.memoizing as memo import sys import sympy import math from sympy.physics.quantum.spin import Rotation def legendre_normalized(ct, st, lmax): r"""Return the normalized associated Legendre function :math:`P_l^m(\cos\theta)...
import math import cv2 import numpy as np previous_position = [] theta, phi = 3.1415/4, -3.1415/6 should_rotate = False scale_dx = 800 scale_dy = 800 class Plotter3d: # Re Ordered the position for Unity3D SKELETON_EDGES_FOR_UNITY = np.array([[6, 12], # Hips [6, ...
# Copyright 2019 TerraPower, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
# This macro can load CSV files from Denso programs in RoboDK. # Supported types of files are: # 1-Tool data : Tool.csv # 2-Work object data: Work.csv # 3-Target data: P_Var.csv (will look for Tool.csv and Work.csv in the same folder) # This macro can also filter the P_Var.csv file for improved accuracy # # Type hel...
#!/usr/bin/env python3 # # Weeb a Word # # A Fediverse phrase bot generating random otaku culture inspired phrases. # # Copyright (c) 2020-21, redneonglow # All rights reserved. # # Includes code from Dark Web Mystery Bot v4 stable (20200403) # Copyright (c) 2019-20, redneonglow # All rights reserved. # # Redistributio...
#!/usr/bin/env python # -*- coding: utf-8 -*- from pDESy.model.base_team import BaseTeam from pDESy.model.base_factory import BaseFactory from pDESy.model.base_organization import BaseOrganization from pDESy.model.base_worker import BaseWorker from pDESy.model.base_facility import BaseFacility, BaseFacilityState from ...
# -*- coding: utf-8 -*- from tests.test_stack import TestConfig, app_from_config from tg.util import no_warn from tg._compat import u_ def setup_noDB(html_flash=False): config = {'use_sqlalchemy': False, 'use_toscawidgets': False, 'use_toscawidgets2': False, 'ignore_parame...
#!/usr/bin/python ''' July 2021 @author: <NAME> Blake's nested LSTM encoder-decoder but one that has been adapted to use integer-encoded words instead of onehot encoings ''' import numpy as np import sys import pickle, random, string import matplotlib.pyplot as plt import tensorflow.keras as keras import tensorflow a...
""" Cisco_IOS_XR_infra_alarm_logger_oper This module contains a collection of YANG definitions for Cisco IOS\-XR infra\-alarm\-logger package operational data. This module contains definitions for the following management objects\: alarm\-logger\: Alarm Logger operational data Copyright (c) 2013\-2016 by Cisco Sy...
from udp import UDPsocket import socket BUF_SIZE = 2048 class socket2(UDPsocket): def __init__(self): super().__init__() self.setblocking(False) def connect(self, address) -> bool: SEQ0 = 514 _SEQ1 = 0 while 1: try: pkt = RDTPacket() ...
# Copyright (C) 2018-2021 # Author: <NAME> # Contact: <EMAIL> """Provides classes that are fundamental to the design of the Java programming language. """ from __future__ import print_function __all__ = [ "Exception", "IllegalArgumentException", "Object", "RuntimeException", "Thread", "Throwa...
help = ''' Author: Brilian Target: Pytorch tutorial data augmentation Chapter 9 How to use it: - Go to the main folder (pytorch_tutorial folder) - open cmd in that folder (or you could win+R -> cmd -> go to this folder) - Type python mixup_segmentation.py {training or mixup_augmentation} #withou...
import argparse import os import time from loguru import logger import json import cv2 from lxml import etree import torch import yolox from yolox.data.data_augment import ValTransform from yolox.data.datasets import NILAR_CLASSES from yolox.exp import get_exp from yolox.tools.demo import Predictor, image_demo from ...
import os import csv from csv import reader import codecs import random import matplotlib.pyplot as plt import argparse from bs4 import BeautifulSoup import requests # read + return raw data from files def data_func(filename): base_path = os.path.abspath(os.path.dirname(__file__)) full_path = os.path.join(base...
import itertools import collections import hashlib from PyQt5.QtCore import ( QObject, QThread, QTimer, QPoint, QRect, QSize, Qt, pyqtSignal, QMimeData, QEvent, ) from PyQt5.QtGui import ( QIcon, QPainter, QDrag, ) from PyQt5.QtWidgets import ( QApplication, ...
# definition GRU Netwrok # import relevant libraries import torch import torch.nn as nn import torch.optim as optim import matplotlib import numpy as np import trajectories import loader import argparse import gc import logging import os import sys import time import matplotlib.pyplot as plt # build argparser parser...
from os import path import pytest from tools.paths import MACROS_CONTRACT_PATH, CONTRACT_PATH, all_contracts from tools.utils import assert_run_script_failwith, \ assert_transfer_failwith, init_with_transfer, bake, \ assert_storage_contains BAKE_ARGS = ['--minimal-timestamp'] @pytest.mark.contract class Test...
# Copyright (c) 2013-2015 by California Institute of Technology # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice,...
import re import functools import jsl import json import jsonschema import pyparsing as pp import math import operator from sqlalchemy.sql import and_, or_ class FormularEvaluationException(Exception): def __init__(self, message): self.message = message # The Expression Parser for mathematical formular...
from random import randint class DisjointSet(object): def __init__(self, size): self.size = size self.set_list = [-1] * size def find_root(self, node): if self.set_list[node] < 0: return node else: ...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import os from datetime import datetime import reframe as rfm import reframe.utility.sanity as sn from reframe.core.backends ...
#! /usr/bin/env python """Module for dealing with JWST DMS Engineering Database mnemonics. This module provides ``jwql`` with convenience classes and functions to retrieve and manipulate mnemonics from the JWST DMS EDB. It uses the ``engdb_tools`` module of the ``jwst`` package to interface the EDB directly. Authors...
#!/usr/bin/env python3 # module checking try: import os import sys import argparse except: print("Missing modules detected!") sys.exit(1) # Testing puremagic existence try: import puremagic as pr except: print("Error: >puremagic< module not found.") sys.exit(1) # Testing colorama exis...
#!/usr/bin/env python3 # coding: utf-8 """ Tools to deal with configuration files, in the YAML format """ from pathlib import Path from . import params from .data import get_data_file from .readers import interpret_file from ..utils.downloads import download from ..utils.mapping import dict_deep_update from ..utils ...
from django.contrib import admin from django.utils.html import format_html from django.urls import reverse from .models import ( Player, PlayerScorecard, Showcase, Club, Team, Director, Coach, Station, FieldLayout, ScoringCriteria ) admin.site.register(Showcase) admin.site.reg...
import os, glob from functools import reduce import pandas as pd from sklearn.preprocessing import MinMaxScaler from keras.models import Sequential from keras.layers import LSTM, Dense, Dropout, RepeatVector, TimeDistributed, Activation from keras import metrics import argparse import plotly.graph_objects as go from ke...
# Copyright 2018 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, ...
from DataHandler.putAndGetData import get_multifeature_data, create_timeseries from keras.callbacks import TensorBoard from keras.models import Sequential from keras.layers import LSTM, Dense, Dropout, TimeDistributed from keras.preprocessing.sequence import pad_sequences from sklearn.preprocessing import MinMaxScaler ...
import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation import matplotlib.animation as animation import cv2 import numpy as np import os from numpy.ma import masked_array def animate(tensor, valve=None, name=None): fig, ax = plt.subplots(figsize=(8, 8)) def update(j): ax.imshow...
""" Stores custom optimizer classes as well as a custom optimizer creation utility as a handy wrapper b""" import typing import mesh_tensorflow as mtf import tensorflow as tf2 from .backend import import_mtf, import_float, get_var, variable from .backend import variable from .context import OptimizerCtx from .contex...
import logging import os import numpy as np import torch from torch.utils.data import DataLoader from tqdm import tqdm import json import config from model import YOLOv2 from loss import VehicleLoss from dataset import VehicleDataset from utils import load_checkpoint, save_checkpoint, get_evaluation_bboxes, calculate...
import logging import typing from collections import defaultdict from typing import Union, List, Optional, Dict from rx.subjects import Subject from twisted.internet import reactor from twisted.internet.defer import Deferred, DeferredList, succeed from twisted.python.failure import Failure from txwebsocket.txws import...
#! /usr/bin/python CLASSIFIER_COMMENT = """ Euro Coin Detector Classifier Created by <NAME> (http://chenyumin.com) //////////////////////////////////////////////////////////////////////////////// This software is provided by the copyright holders and contributors 'as is' and any express or implied warranties,...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import codecs import imageio import matplotlib.pyplot as plt from wordcloud import WordCloud, STOPWORDS import plotly.offline as py import plotly.graph_objs as go import pandas as pd import tweepy import locale import emoji import sys import re import string import os def get_user_tweets(api, userna...
__author__ = "geduldig" __date__ = "June 7, 2013" __license__ = "MIT" from .BearerAuth import BearerAuth as OAuth2 from .constants import * from datetime import datetime from requests.exceptions import ConnectionError, ReadTimeout, SSLError from requests.packages.urllib3.exceptions import ReadTimeoutError, ProtocolEr...
# -*- coding: utf-8 -*- import math import numpy as np import pickle import os.path from PIL import Image import cv2 from skimage.draw import circle from skimage.draw import line defocusKernelDims = [3,5,7,9] def DefocusBlur_random(img): kernelidx = np.random.randint(0, len(defocusKernelDims)) kerneldim ...
#!/usr/bin/python # Tool to provide dedicated variables for cross-compilation __author__ = __maintainer__ = "<NAME> <<EMAIL>>" __copyright__ = "<NAME>, 2014" """ This tool allows to use environment variables to define cross-compilation variables intended for build variants. The variables are obtained from the enviro...
"""It is elements' responsibilities to handle event in order to call launch and unlaunch. However a default behaviour can be set using launch().""" from pygame import event from thorpy.miscgui import constants, functions, parameters from thorpy.miscgui.reaction import Reaction, ConstantReaction from thorpy.elements.b...
""" Worm Algorithm for 2D Ising model. By <NAME>. Written in Python 2.7. Algorithm adapted from: http://www.sciencedirect.com/science/article/pii/S0550321308005609 Original Paper: http://journals.aps.org/prl/pdf/10.1103/PhysRevLett.87.160601 Other references: Slides - http://pitp.physics.ubc.ca/confs/sherbrooke/ar...
# coding:utf-8 ''' R-env(連舞)からV-Sidoでロボットを動かすサンプル Copyright (c) 2015 <NAME> This software is released under the MIT License. http://opensource.org/licenses/mit-license.php ''' import os import sys import time import json import threading import tornado.ioloop import tornado.web import tornado.websocket from ws4py.cl...
# -*- coding: utf-8 -*- """ Base classes for SIEM interface objects and generic definitions. Define `NitroObject`, `NitroDict` and `NitroList`. """ import logging import json import abc import collections import json import collections import tqdm import csv import concurrent.futures import prettytable from prettyta...
from nose_parameterized import parameterized from core import models from core.models.enums import LevelType from core.entity.entity_exceptions import EntityOperationNotPermitted from core.entity.entity_sets.access_level_set import AccessLevelSet from core.entity.entity_sets.project_set import ProjectSet from core.ent...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
import datetime import json from django.db.models import Q from django.views.generic import View # Create your views here. from IHome.utils.response_code import RET from IHome.utils.views import LoginRequiredJSONMixin from django import http import logging from house.models import House from order.models import Order...
#!/usr/bin/env python ## ## Copyright 2009 <NAME> & <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 applic...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Authors : <NAME> (<EMAIL>) & <NAME> (<EMAIL>) # @Paper : Rethinking Graph Autoencoder Models for Attributed Graph Clustering # @License : MIT License import torch import numpy as np import sys import pickle as pkl import networkx as nx import scipy.sparse as sp import...
''' Query REST api for PDC files of interest Saves them to local data directory ''' import requests import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from scipy.stats import zscore def query_pdc(query): ''' Primary query functionality from PDC website ''' # PDC A...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime from django.shortcuts import render from django.http import HttpResponse from rango.models import Category, Page from rango.forms import CategoryForm, PageForm, UserForm, UserProfileForm from django.contrib.auth import authen...
import urllib import os import time import errno import weakref import base64 import json import socket #ASYNC import asyncio import aiohttp from aiohttp import web from urllib.parse import unquote """ HTTP Server interface """ def _get_viewer(ref): #Get from weak reference, if deleted raise exception lv = ...
import re import datetime import click import typing from pathlib import Path from dataclasses import dataclass from collections import defaultdict, Counter from openstates import metadata from enum import Enum, auto from pydantic import ValidationError from .retire import retire_file from .general import ( dump_ob...
import torch import torch.nn as nn import torch.nn.functional as F from config import Config import math EPS = 1e-8 LOG_STD_MAX = 2 LOG_STD_MIN = -10 CONST_GAUSSIAN = math.log(math.pi * 2) class GraphLinear(nn.Module): def __init__(self, in_size, out_size, activate=True): super().__init__() self....
import numpy as np import warnings from daal.data_management import (HomogenNumericTable,convertToHomogen_Float64,readOnly,BlockDescriptor_Float64, MergedNumericTable, \ FileDataSource, DataSource, DataSourceIface, InputDataArchive, OutputDataArchive, \ ...
# Copyright (c) Facebook, Inc. and its affiliates. import os import numpy as np import cv2 import matplotlib.pyplot as plt import torch from pytorch3d.transforms import ( so3_relative_angle, euler_angles_to_matrix ) from scipy.spatial.distance import cdist import json from utils import ( load_motion, ) impo...