text
stringlengths
3.07k
22.1k
""" Modul, welches die Pillow Image Funktionen zum Erstellen und Bearbeiten von Bildern beinhaltet. """ import numbers from PIL import Image from visuanalytics.analytics.control.procedures.step_data import StepData from visuanalytics.analytics.processing.image.pillow.draw import DRAW_TYPES from visuanalytics.analytic...
import random from typing import List from typing import Tuple from typing import Union def sim_point(p_s: float) -> bool: """Simulate point in tennis by drawing from uni dist Args: p_s (float): probability server wins point Returns: bool: True if server won, False if not """ ret...
import math import numpy as np import tensorflow as tf import torch from torch import nn import torch.nn.functional as F import math from tener.misc.pretty_print import print_info def get_angles(pos, i, d_model): angle_rates = 1 / np.power(10000, (2 * (i//2)) / np.float32(d_model)) return pos * angle_rates...
#!/usr/bin/env python """ This script uses a pre-trained model called VGG16 as a feature extractor and trains simple neural network classifier on the impressionist paintings. """ # basic modules import numpy as np import matplotlib.pyplot as plt import matplotlib matplotlib.use("Agg") from matplotlib.ticker import Ma...
import logging import os import threading import traceback import re import waitress from paste.translogger import TransLogger from .http import HTTPInterface from .locast import Geo, LocastService from .ssdp import SSDPServer from .utils import Configuration, LoggingHandler class DVR(LoggingHandler): def __init...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ============================================================================= # Script on Retinotopy for the IBC project # # Author: <NAME> # Contributor: <NAME> # # email: <EMAIL> # ============================================================================= import n...
from functools import lru_cache from typing import List, Set, Tuple, TYPE_CHECKING, Union import numpy as np from numpy import int64, ndarray from sc2.position import Point2 from scipy.ndimage import center_of_mass if TYPE_CHECKING: from MapAnalyzer import MapData, Region class Buildables: """ Represen...
#!/usr/bin/env python """ wpal (workout pal is command-line tool to generate different exercises based on user input. It serves (or will serve) as a quick inventory of exercises for: 1. body-weight exercises 2. resistance band exercises 3. weighted exercises """ import sys TRICEPS = [ # TRICEPS[0] = resistance b...
import random import pandas as pd from collections import Counter from django.contrib.auth.models import User, Group from django.db.models import Q from psycopg2._psycopg import IntegrityError from api.sms import send_sms from broker.models import Broker, BrokerVehicle from owner.models import Vehicle from restapi.h...
import copy import json import logging import time from .params import ParameterCollection, Parameter logger = logging.getLogger(__name__) class TaskBase(type): """Parameter metaclass, used to register parameter classes for lookup by name.""" _tasks_by_name = {} def __new__(cls, name, bases, attrs): ...
from datetime import datetime from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, HttpRequest, Http404, HttpResponseRedirect from django.core.urlresolvers import reverse from django.views import generic from django import forms from django.conf import settings from django.core.f...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from moebot import MwApi import json import re import datetime from shutil import copyfile import requests import schedule import time import argparse import sys import traceback import copy import yaml config = yaml....
#!/usr/bin/env python3 # -*- encoding=utf8 -*- # Author : <NAME> # Date : October 11, 2018 # Organization : NMA, Geodetic Institute prolog = """ **PROGRAM** klobuchar_model.py **PURPOSE** compute the ionospheric time-delay correction for the single-frequency by broadcast model (klob...
#!/usr/bin/env python # # Simple script which generates corpus files. import argparse import logging import os import sys import corpus log = logging.getLogger(__name__) def generate_corpus(options): sys.path.append(options.curl_test_dir) import curl_test_data td = curl_test_data.TestData(os.path.join(o...
#!/usr/bin/env python3 import argparse import sqlite3 import sys from collections import namedtuple from datetime import datetime from pathlib import Path from textwrap import dedent, indent app_name = "export_firefox_data.py" run_dt = datetime.now() outpath = Path.cwd() / "output" Bookmark = namedtuple("Bookmar...
""" Created on Thu Sep 29 18:07:07 2020 @author: <NAME> (<EMAIL>) """ import numpy as np import matplotlib.pyplot as plt import parser import tkinter as tk import tkinter.font as font from collections import defaultdict import sympy class GenerateSymbols(defaultdict): def __missing__(self, key): ...
import datetime import logging from .constants import * from django.urls import reverse_lazy from django.db import models from django.conf import settings from django.utils.safestring import mark_safe from fantasy_sports.models import ( AbstractManager, # AbstractTournament, AbstractPlayer, Abstrac...
import numpy as np import time import scipy.weave as weave from scipy.weave import converters from sigvisa import Sigvisa from sigvisa.infer.correlations.ar_correlation_model import estimate_ar, ar_advantage, iid_advantage from sigvisa.utils.array import index_to_time, time_to_index def compute_atime_posteriors(s...
#!/usr/bin/env python # coding: utf-8 """ Extract data from Excel spreadsheets (.xls and .xlsx) Import the csv file that I want as an output, need to convert the xls format to csv format To create the csv outputs (per sheet) in a folder called CSV files """ import xlrd import csv import os import sys def main(input_w...
#!/usr/bin/env python # #Copyright 2019 <NAME>. #This file is part of Mi3-GPU. #Mi3-GPU is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, version 3 of the License. #Mi3-GPU is distributed in the hope that it wi...
# Copyright 2011 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 a...
#!/usr/bin/env python # encoding=utf8 from django.contrib.auth import authenticate from django.contrib.auth.decorators import login_required, user_passes_test from django.contrib.auth.models import Group from django.contrib.auth.models import User from django.core.mail import EmailMessage from django.forms import form...
''' Copyright (c) 2017 <NAME> This file is part of mac_apt (macOS Artifact Parsing Tool). Usage or distribution of this software/code is subject to the terms of the MIT License. terminalstate.py --------------- This plugin reads Terminal Saved State information which includes full text content...
#!/usr/bin/env python3.8 # -*- coding: UTF-8 -*- # 生成用于README.md文件的解法文件目录 # 通过扫描src的子文件夹,解析文件名,生成Markdown规范的文件 import abc import datetime import enum import hashlib import re import sys from contextlib import contextmanager from typing import * import git def info(message, *args): print(message % args, file=sy...
from sneakysnek.recorder import Recorder from sneakysnek.keyboard_keys import KeyboardKey from sneakysnek.mouse_buttons import MouseButton from sneakysnek.keyboard_event import KeyboardEvent, KeyboardEvents from sneakysnek.mouse_event import MouseEvent, MouseEvents import ctypes from ctypes import windll, wintypes ...
#!/usr/bin/env python from __future__ import print_function import warnings import pandas as pd from tabulate import tabulate from matplotlib import pyplot as plt import matplotlib import numpy as np import cPickle ###################################### warnings.filterwarnings('ignore') pd.options.display.max_colum...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # os.environ['CUDA_VISIBLE_DEVICES'] = '-1' import time import heapq import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import argparse import pickle import pdb from scipy.special import expit from sklearn.metrics import confusion_matrix from te...
import traceback import json from functools import reduce from django.core.cache import cache from berkeleytime.utils import render_to_json, render_to_empty_json from berkeleytime.settings import CURRENT_SEMESTER, CURRENT_YEAR, CURRENT_SEMESTER_DISPLAY from catalog.models import Section, Course from catalog.utils imp...
""" A exponential moving average that updates values based on time since last update. """ # The MIT License (MIT) # Copyright © 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 wit...
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from collections import OrderedDict import torch import torch.nn as nn import torch.nn.functional as F from nni.retiarii.nn.pytorch import LayerChoice, InputChoice from .base_lightning import BaseOneShotLightningModule class DartsLayerChoice(n...
import os import io from collections import OrderedDict import torch from torch.nn.init import normal_, zeros_ from torchvision.utils import make_grid import math import bezier import numpy as np from PIL import Image from tqdm import tqdm import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt de...
from stable_baselines.bench import Monitor from stable_baselines.common.vec_env import SubprocVecEnv, VecNormalize from stable_baselines.common import set_global_seeds from stable_baselines import PPO2 from gym_fixed_wing.fixed_wing import FixedWingAircraft from pyfly.pid_controller import PIDController import tensorfl...
""" Various functions to interface with chemprop. """ import json import os import numpy as np from nff.utils import bash_command, fprint def get_cp_cmd(script, config_path, data_path, dataset_type): """ Get the string for a ChemProp command. Args: scri...
#!/usr/bin/env python # coding: utf-8 # In[1]: """ COMS 4733 Fall 2021 Homework 4 Scaffolding code for localization using an extended Kalman filter Inspired by a similar example on the PythonRobotics project https://pythonrobotics.readthedocs.io/en/latest/ """ import math import matplotlib.pyplot as plt import nump...
# UniCon: United Connections (for databases) import json import pymysql from .UniLog import UniLog, NoopLog class UniDefaultInvoker(object): def __init__(self): pass def get_names(self, instance_name, db_name): return instance_name, db_name class UniTransaction(object): def __init__(sel...
# Copyright 2020 XAMES3. 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...
# Copyright 2017 SAP SE # # 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 appl...
""" This file should implement the procedures detailed in the stale news paper. Code originally by <NAME>, Optimized by <NAME>. Summary: The methods below apply the stale news procedure outline in the paper "When Can the Market Identify Stale News? " by <NAME> and <NAME>. The procedure goes through each article in ...
import os from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive def get_drive(): try: gauth = GoogleAuth() gauth.LocalWebserverAuth() drive = GoogleDrive(gauth) return drive except: return None def get_folder_id(folder_name, drive=None, f_id='root'...
from django.db import models from django.conf import settings from django.forms import ModelForm from django.core.validators import MinValueValidator, MaxValueValidator, RegexValidator from django.core.validators import * from datetime import datetime from django.utils import timezone from django.contrib.postgres.field...
import numpy as np from scipy.signal import medfilt from scipy.spatial import ConvexHull, Delaunay from . import helper as h class DepthImage: def __init__(self, dimg, in_meters=False): """ Class to hold onto depth images and convert them to point clouds. The in_meters parameter is used t...
# Copyright 2021 Xilinx Inc. # # 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,...
#!/usr/bin/env python """ <NAME> Ruffus pipeline for simple bowtie alignment """ from ruffus import * from bowtie_extras import BowtieExtras import ruffus.cmdline as cmdline import subprocess import logging import os import pprint import re import time # EMAIL import smtplib from email.MIMEMultipart import MIMEMulti...
from intent.fishauction import FishAuction, FA_tests from intent.fishauctionlight import FishMarketLight from intent.stateencoders import StateEncoder,StateEncoderArray,StateFormat, FML_State from intent.TQ import TillQueue import gym from gym.spaces import Space, MultiBinary, Discrete, Box import numpy as np from coll...
## Copyright 2017 Knossos authors, see NOTICE file ## ## 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...
from direct.gui.OnscreenImage import OnscreenImage from direct.gui.DirectGui import * from direct.gui.OnscreenText import OnscreenText from panda3d.core import * import sys,os MAINDIR = Filename.from_os_specific(os.path.abspath(sys.path[0])).getFullpath() class Console: def __init__(self): return None ...
""" PgmBTE do FW/BW message passing over a tree - bucket tree, mini-bucket tree, join tree - summation, maximization, marginal map (no BW implemented is it as simple as elim max? -- check if needed) - Pgm assumes all functions are multiplicative """ from typing import Iterable, Tuple, List, Union from copy ...
# from profilehooks import profile import time import json from batchq.core.stack import current_machine from batchq.core.batch import Shell from batchq.decorators.cache import simple_cacheable, simple_class_cacheable, simple_call_cache, clear_simple_call_cache import random # TODO: Fetch all PIDs at once and make a ca...
import functools import pytest from derivater import (eq_and_hash, MathObject, Symbol, SymbolFunction, Add, Mul, Pow, mathify, ln) from derivater.__main__ import x, y, z, a, b, f, g, f_, g_, half h = functools.partial(SymbolFunction, 'h') h_ = functools.partial(h, derivative_count=1) def tes...
#encoding:utf-8 from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from QUANTAXIS.QAFetch.QAQuery import QA_fetch_stock_block from QUANTAXIS_Monitor_GUI.ProgressDlgs.ProgressDlg_WithThreading import * from QUANTAXIS_Monitor_GUI.TasksByThreading.QThread_CheckStockBlock_DB_Task impo...
""" Components/BottomNavigation2 ============================ .. rubric:: Another type of navigation bar where badges can be added to each icon Example ------- .. rubric:: Navigation bar without any badges on each icon .. code-block:: python from kivy.lang import Builder from kivymd.app import MDApp im...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """A plugin for organizing, analyzing, and selecting tests. This plugin provides the mark ``pytest.mark.lisa``, aliased as :py:func:`LISA`, for marking up tests metadata beyond that which Pytest provides by default. See the :py:data:`lisa_schema`...
from lightweaver.fal import Falc82 from lightweaver.rh_atoms import H_6_atom, H_6_CRD_atom, H_3_atom, C_atom, O_atom, OI_ord_atom, Si_atom, Al_atom, CaII_atom, Fe_atom, FeI_atom, He_9_atom, He_atom, He_large_atom, MgII_atom, N_atom, Na_atom, S_atom import lightweaver as lw import matplotlib.pyplot as plt import time im...
# -*- coding: utf-8 -*- from enum import Enum import json import tornado from tornado.queues import Queue from callisto import get_logger from callisto.libs.protocol import jlabs as jlabs_protocol from callisto.service.dlna import Action as DlnaAction, CommunicationData as DlnaCommuData logger = get_logger(__name__)...
import os import logging import threading import base64 import pkgutil import time import re import deluge.configmanager import deluge.component as component from deluge.common import is_url from deluge.event import DelugeEvent from deluge.core.rpcserver import export from deluge.plugins.pluginbase import CorePluginBa...
import logging import os import sys import json import asyncio import time import spamwatch import telegram.ext as tg from inspect import getfullargspec from aiohttp import ClientSession from Python_ARQ import ARQ from telethon import TelegramClient from telethon.sessions import StringSession from telethon.sessions imp...
import torch import torch.utils.data as data_utl from torch.utils.data.dataloader import default_collate import numpy as np import json import csv import h5py from tqdm import tqdm import os import os.path as osp import cv2 def video_to_tensor(pic): """Convert a ``numpy.ndarray`` to tensor. Converts a numpy...
#!/usr/bin/env python # Created by zahza at 3/11/20 import pickle import os import tqdm from detector import GuiDetector import cv2 as cv from audio import AudioStream import socket from PIL import Image import webbrowser SEPARATOR = "<SEPARATOR>" BUFFER_SIZE = 4096 class ServerHandler: """ The ServerHandler cla...
# # See LICENSE for licensing: https://unlicense.org # It starts with: "This is free and unencumbered software released into the public domain." # import json import logging import logging.config import os import pathlib import re import subprocess import sys import threading import uuid import zlib import arrow impor...
# Authors: <NAME> <<EMAIL>> # # Copyright (C) 2006 Red Hat # see file 'COPYING' for use and warranty information # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; version 2 only # # This program...
import platform import socket import ssl import subprocess from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network, ip_address, ip_network from typing import List, Optional, Union from privex.helpers import settings from privex.helpers.common import empty_if, byteify, is_true, stringify from privex.hel...
# -*- coding: utf-8 -*- from collections import Counter from itertools import chain import io import codecs import sys import pathlib import torch import torchtext from onmt.Utils import aeq from onmt.io.TextDataset import TextDataset from onmt.io.DatasetBase import (ONMTDatasetBase, UNK_WORD, ...
import math import torch from torch.optim import Optimizer from torch.optim.optimizer import required class SGD(Optimizer): r"""Implements stochastic gradient descent (optionally with momentum). Nesterov momentum is based on the formula from `On the importance of initialization and momentum in deep learni...
from typing import Sequence import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import seaborn as sns import datetime as dt from pathlib import Path import logging import sys from sklearn.metrics import roc_curve, auc logger = logging.getLogger(__name__) logging...
import argparse import os import numpy as np import json import cv2 from skvideo import io from stray_visualize import DEPTH_WIDTH, DEPTH_HEIGHT, _resize_camera_matrix FRAME_WIDTH = 1920 FRAME_HEIGHT = 1440 OUT_WIDTH = 1920 OUT_HEIGHT = 1440 from scipy.spatial.transform import Rotation import itertools import open3d ...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging from django.conf import settings from ralph_scrooge.models import ( AssetInfo, DailyAssetInfo, DailyUsage, PRICI...
from django import forms from .models import LeafPack, LeafPackType, Macroinvertebrate, LeafPackBug, LeafPackSensitivityGroup from dataloaderinterface.models import SiteRegistration from django.core.exceptions import ObjectDoesNotExist class MDLCheckboxSelectMultiple(forms.CheckboxSelectMultiple): template_name =...
import os, errno, numpy, torch, csv, re, shutil, os, zipfile from collections import OrderedDict from torchvision.datasets.folder import default_loader from torchvision import transforms from scipy import ndimage from urllib.request import urlopen class BrodenDataset(torch.utils.data.Dataset): ''' A multicateg...
"""Main module for running code. Creates image from a ndarray, arranges the panels, refreshes (updates) the image and adds widgets. """ import argparse import logging import sys # Module for parsing geometry file and determining size of the # image after panel arrangement. from cfelpyutils.crystfel_utils import load_c...
import re from unittest import mock import httpretty import pytest import sqlalchemy from factory.alchemy import SQLAlchemyModelFactory from pyramid import testing from pyramid.request import apply_request_extensions from lms.models import ApplicationSettings from lms.services.application_instance_getter import Appli...
import time import glob import os import sys import matplotlib.pyplot as plt import numpy as np import importlib import re # Don't generate pyc codes sys.dont_write_bytecode = True def tic(): StartTime = time.time() return StartTime def toc(StartTime): return time.time() - StartTime d...
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ # %% Import packages from sklearn import tree, feature_selection from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import RandomizedSearchCV, GridSearchCV, RepeatedStratifiedKFold from sklearn.feature_selecti...
# Copyright (C) 2018 by eHealth Africa : http://www.eHealthAfrica.org # # See the NOTICE file distributed with this work for additional information # regarding copyright ownership. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with # the License. Y...
import asyncio import logging import os import sys from datetime import datetime, timedelta # Using https://github.com/sbidy/pywizlight from pywizlight import wizlight, PilotBuilder, discovery, exceptions from random import sample from systemd.journal import JournalHandler # TODO: Add typing # TODO: How to see logs f...
import networkx as nx import numpy as np import pandas as pd import config as cfg # NetworkX Graph Utility Functions def adjacency_matrix_to_graph(adjacency, labels, label_name, prune=False): G = nx.DiGraph() G = nx.from_numpy_array(adjacency, create_using=G) node_idx = np.arange(adjacency.shape[0]) ...
import torch import numpy as np from torch import nn from einops import rearrange, reduce, repeat from einops.layers.torch import Rearrange from tqdm import tqdm import torch.nn.functional as F import random import os class NTXentLoss(torch.nn.Module): def __init__(self, temperature = 0.5, use_cosine_similarity ...
# Copyright (c) 2020-present, Baidu, 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. # # # Acknowledgement: The code is modified based on Facebook AI's XLM. # # This source code is licensed under the license f...
import bpy from bpy import context from math import * #import sun_utils #from sun_utils import * import datetime sce = bpy.context.scene bl_info = { "name": "Binary Sundial", "description": "", "author": '<NAME> (KvanTTT)', "category": "Add Mesh" } class AltitudeAzimuth: def __init__(self, altit...
import copy import re from preprocess import find_parameter from preprocess import find_struct from preprocess import preprocess from utils import (fetch_api, underscore) def _retrive_structs(key, all_models): s = all_models[key] r = {key: s} for p in s: dt = p["datatype"] if dt in all_...
from app import db from flask_login import UserMixin import datetime from sqlalchemy import Column, Integer, String, DateTime, Text # from cryptography.fernet import Fernet # from app.config import Config class User(db.Model, UserMixin): __tablename__ = 'user' id = Column(Integer, primary_key=True) use...
#!/usr/bin/python from _datetime import datetime import argparse from collections import Counter from collections import OrderedDict import whois import time DESCRIPTION = """ Find how long the update time for DNSKEY or domains are. """ def arg_parse() -> argparse: parser = argparse.ArgumentParser(description=...
import pickle import numpy as np import utils from pathlib import Path import pandas as pd from itertools import combinations, product import seaborn as sns import matplotlib.pyplot as plt from matplotlib.colors import TwoSlopeNorm from itertools import groupby def add_line(ax, xpos, ypos, horizontal): if horizon...
import pygame, sys, random, time from pygame.locals import * # BLOCK_SIZE is the size of each cell in the grid. Used for position calculations. BLOCK_SIZE = 600//10 # RGB Colors for players - Black, Red, Green, Blue COLORS = ((0, 0, 0), (255, 0, 0), (0, 100, 0), (0, 0, 255)) # Snakes' and ladders' positions where ke...
from kivymd.app import MDApp from kivy.uix.floatlayout import FloatLayout from kivy.lang import Builder from kivy.uix.boxlayout import BoxLayout from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition from kivymd.uix.label import MDLabel from kivy.properties import StringProperty from kivy.prope...
### 選曲用関数 import random import math # テスト用 # 現在の時刻(開始時刻からの経過時間) now = 54 from datetime import datetime # テスト用 textTime = datetime.now() textStartTime = 1571516344.799226 # timestampをunixtimeに変換 def timeChanger(textTime): return textTime.timestamp() # 経過時間を演算 def ElapsedTime(now): retu...
import serial import numpy as np import matplotlib.pyplot as plt from drawnow import * import sys from datetime import datetime import os # runtime variables plotLiveGraph = False serialPort = "com20" # to be redefined according to the actual port used visibleDataPoints = 50 # Create arrays for both readings, to be ...
import bpy from ..const import ALPHA_NODES, NODE_TAG, NORMAL_INPUTS from ..nodes.duplicate import duplicate_nodes from ..nodes.new import new_mixrgb_node, new_rgb_node from ..nodes.node import (get_all_nodes_linked_from, is_mixnode_in_node_tree, ...
#### Import all the supporting classes import argparse import os from cn_variants import LAN, GCN, GAT from data import load_data from encoder import GRUEncoder from utils import * os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "0" import torch torch.backends.cudnn.enabled = Fal...
import json import maidenhead as mh import re import requests import sqlite3 gsi_endpoint = { 'geocode': 'https://msearch.gsi.go.jp/address-search/AddressSearch', 'revgeocode': 'https://mreversegeocoder.gsi.go.jp/reverse-geocoder/LonLatToAddress', 'elevation': 'https://cyberjapandata2.gsi.go....
from model import create_model from utility.utility import load_training_data, load_validation_data from utility.language_encoder import LanguageEncoder import numpy as np from matplotlib import pyplot as plt from keras.callbacks import TensorBoard import keras.backend as K from scipy.misc import imresize import skima...
# Import libraries import cv2 import numpy as np import scipy.spatial.distance as ssd from sklearn.mixture import GaussianMixture # Import common lab functions. from common_lab_utils import SegmentationLabGui, \ get_sampling_rectangle, draw_sampling_rectangle, extract_training_samples def run_segmentation_soluti...
from enum import Enum from pathlib import Path import json import numpy as np from api.storage import Dataset ############################################################################### # Classes ############################################################################### class EvaluationMode(Enum): """ ...
import os from django.db import models from django.utils.translation import ugettext as _ #from django_extensions.db.fields import AutoSlugField class BaseModel(models.Model): created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) class Meta(object): abst...
import sys from inventory import * import time from file_manipulation import * """ Presentation of program contains main(), menu(), rent(), return(), ceo(), rerun() Each function takes in user input that either calculates or writes data into files """ week_format = datetime.datetime.now().strftime("%Y-%m-%d --- Re...
from modeling.baselines import ConnMaxEntModel, MajorityBaseline import sys import argparse import json import numpy as np import pandas as pd sys.path.append('..') from processing.postprocessing import load_word_order, find_lst_el dim2emo = {0: 'anger', 1: 'anticip', 2: 'disgust', 3: 'fear', 4: 'joy', 5: '...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # checkplotserver.py - <NAME> (<EMAIL>) - Nov 2016 '''`checkplotserver` is a Tornado web-server for visualizing the information stored in checkplot pickles, editing them, and exporting information to a variable star classification pipeline. This is the main module used t...
# -*- coding: utf-8 -*- """Data providers. This module provides classes for loading datasets and iterating over batches of data points. """ import os import numpy as np DEFAULT_SEED = 1337 class DataProvider(object): """Generic data provider.""" def __init__(self, inputs, targets, batch_size, max_num_batch...
import os import re import json import errno import codecs _SEMANTIC_VERSION = "2.0.0" """ Simple assert utils to make sure that an object matches some specified type or the items in an iterable match some specified type The main difference between using this function and using assert isinstance(...) is that it prov...
import json import pytz import os.path import tarfile import datetime import cStringIO import urllib from . import base from . import validators from . import util from . import config log = config.log def _filter_check(property_filter, property_values): minus = set(property_filter.get('-', [])) plus = set...