text
stringlengths
3.07k
12.6k
# Copyright 2020 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, ...
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: hello_world Description : Author : zdf's desktop date: 2020/5/25 ------------------------------------------------- Change Activity: 2020/5/25:18:23 ------------------------------...
# -*- coding: utf-8 -*- # Copyright 2020 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
""" TO-DO: 1. Get all features data sets [X] 2. Add labels to the data sets[X] 3. Obtain results of the training ( of all three algos)[X] 4. Obtain the plots and confussion matrix[] """ from pathlib import Path import warnings warnings.filterwarnings("ignore") import pandas as pd import numpy as np impo...
"""Mixture model for matrix completion""" from typing import Tuple import numpy as np from scipy.special import logsumexp from common import GaussianMixture def estep(X: np.ndarray, mixture: GaussianMixture) -> Tuple[np.ndarray, float]: """E-step: Softly assigns each datapoint to a gaussian component Args: ...
# -Function that updates the lake storage and lake level given a measured lake level. If no lake # level is measured, then the actual storage is not updated with a measured level. The function # returns the updated storage and lake level def UpdateLakeHStore(self, pcr, pcrm): # -buffer actual storage OldStorage...
import argparse import configparser import sys import logging import os from bitbucket.client import Client from git import Repo from git import RemoteProgress from prompt_toolkit import prompt from prompt_toolkit.styles import Style from prompt_toolkit.formatted_text import FormattedText from prompt_toolkit import pr...
# pylint: disable=unsubscriptable-object import os import argparse import numpy as np import tensorflow as tf from sklearn.datasets import load_iris def quantize_data(header, dtypes, X): for i, (h, dtype) in enumerate(zip(header, dtypes)): if h[0] != 'f' or dtype != np.int32: continue ...
import pe from pe.operators import ( Literal, Class, Regex, Sequence, Choice, Nonterminal, Capture, ) from pe._grammar import Grammar from pe._parse import loads from pe._optimize import optimize def gload(s, inline=False, common=False, regex=False): start, defmap = loads(s) retur...
import sys import os import socket import shutil import argparse import numpy as np import random import cv2 import moviepy.editor as mpy from PIL import Image, ImageDraw, ImageFont from libDonkeyCar.datastore import Tub from libPlotter.testVideoHelper import TestVideoHelper #path = 'C:\\Projects\\Robotics\\Donkey...
#!/usr/bin/env python ######################################################################################### # # Concatenate transformations. This function is a wrapper for isct_ComposeMultiTransform # # --------------------------------------------------------------------------------------- # Copyright (c) 2014 Poly...
#-*-coding:utf-8-*- import tensorflow as tf #输入数据 from tensorflow.examples.tutorials.mnist import input_data #mnist =input_data.read_data_sets("/tmp/data/mnist",one_hot=True) #本地路径 MNIST_data_folder="/home/syx/PycharmProjects/NN_Rep/data/mnist" mnist=input_data.read_data_sets(MNIST_data_folder,one_hot=True) #定义网络超参数 ...
"""" Based on the good work from @JayBlackedOut https://github.com/JayBlackedOut/hass-nhlapi/blob/master/README.md """ import logging from datetime import timedelta, datetime as dt import random import requests import voluptuous as vol import json from typing import Optional from dataclasses import dataclass from ho...
# 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, ...
#!/usr/bin/env python # coding: utf-8 # generak import pandas as pd import numpy as np from pandas import to_datetime # plot libarys import seaborn as sns import matplotlib.pyplot as plt # Model preperation from sklearn.model_selection import train_test_split from sklearn.model_selection import train_test_split, Ra...
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYING file. """Automatic testing for handling archives """ import os import zipfile import pytest import qisys from qisys.archive import extract, guess_algo ...
# # steuermann remote execution daemon - use this when you can't use # something better (like ssh) to get your commands running in the # other machine. # # Copyright 2012 Association of Universities for Research in Astronomy (AURA) # import os import time import CGIHTTPServer import BaseHTTPServer import SocketServer...
#!/usr/bin/env python3 from collections import OrderedDict import math from operator import getitem import os import json import requests import sys import time import yaml BASE = "https://api.github.com" here = os.path.dirname(os.path.abspath(__file__)) def write_yaml(yaml_dict, filename): """write a dictionar...
# -*- coding: utf-8 -*- """ Created on Wed Sep 15 08:44:55 2021 @author: User """ #Ejercicio 6.1: Propagar por vecinos ''' El siguiente código propaga el fuego de cáda fósforo encendido a sus vecinos inmediatos (si son fósforos nuevos) a lo largo de toda la lista. Y repite esta operación mientras sea necesario. ¿Te...
#!/usr/bin/env python import click from colorama import Fore, Style import logging import os import systemd_watchdog from typing import Tuple, Optional, List from influxdb_logger import InfluxdbLogger from pms7003 import PMS7003, PMSData, SearchResult def get_aqi(pm25: float) -> str: """return the aqi for the pm...
import vgg_network import tensorflow as tf import numpy as np from sys import stdout from functools import reduce class StyleTransfer: CONTENT_LAYER = 'relu4_2' STYLE_LAYERS = ('relu1_1', 'relu2_1', 'relu3_1', 'relu4_1', 'relu5_1') def __init__(self, vgg_path, content, style, content_w...
#!/usr/bin/env python3 # 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 asyncio import base64 import json import logging import os import random import sys from contextlib import async...
#!/usr/bin/env python from datetime import datetime from subprocess import call, CalledProcessError from tool import BaseCommand, CommandError, Tool import os import shutil import sys class Wheelbarrow(Tool): def __init__(self, backup_path, plone_path, **options): """Plone backup tool Argument...
"""GSSAPI linebased client/server protocol. # # Usage: # # Server: # # class Echo(gssapiprotocol.GSSAPILineServer): # def got_line(self, line): # self.write('echo: ' + line) # # class EchoFactory(protocol.Factory): # def buildProtocol(self, addr): # pylint: disable=C0103 # ...
from queue import Queue from queue import LifoQueue ''' Simple implementation of a graph class that encompasses unweighted/weighted and directed/undirected graphs Uses a dictionary of dictionaries to represent the adjacency list. EXAMPLE 1 is connected to 2 with weight 5 3 is connected to 1 with weight 10 Adjacency...
#!/opt/nfv/bin/python3.8 from classes.CampusStudents import Students from classes.CampusTeachers import Teachers import csv import os from datetime import datetime import logging now = datetime.now() campus = Students() logname = f"{now}.log" loglocation = os.path.join(os.path.dirname(__file__), "hmhsam", f"{logname...
import numpy as np import cv2 import matplotlib.pyplot as plt from PIL import Image, ImageOps from scipy import ndimage, misc, signal import PIL from skimage.transform import probabilistic_hough_line from skimage.transform import hough_line, hough_line_peaks from skimage.feature import canny from skimage import data fr...
import argparse import pickle from os import mkdir, listdir from os.path import exists, isfile, join from shutil import copyfile import numpy as np import tensorflow as tf from tensorflow.contrib.cudnn_rnn.python.ops import cudnn_rnn_ops from docqa.data_processing.qa_training_data import ParagraphAndQuestionSpec, Par...
#!/usr/bin/env python3 import imagehash import os import PIL.Image import PIL.ImageGrab import pynput import random import re import schedule import subprocess import time # === Configuration options === # Time in milliseconds to display notifications for notification_duration = 15 * 1000 # Time in seconds before c...
#!/usr/bin/env python # coding: utf-8 get_ipython().system('pip install -U --pre tensorflow=="2.*"') get_ipython().system('pip install pycocotools') import os import pathlib if "models" in pathlib.Path.cwd().parts: while "models" in pathlib.Path.cwd().parts: os.chdir('..') elif not pathlib.Path('models').e...
#!/usr/bin/env python3 import numpy as np import bluebell as bb import unittest def get_random_mu_and_C(D): mu = np.random.uniform(low=-1., high=1., size=(D)) C = np.random.uniform(low=-1., high=1., size=(D,D)) C = C@C.T # positive symmetric return mu, C class TestBluebell(unittest.TestCase): def...
import datetime import os, sys import inspect from typing import Union, Optional # local try: # need when 「python3 gfzs/utils/logger.py」 if __name__ == "__main__": # https://codechacha.com/ja/how-to-import-python-files/ sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))...
import numpy as np import pandas as pd # Test data download requirements: import requests import os URL_DATA = "https://raw.githubusercontent.com/open2c/cooltools/pileup-update/datasets/external_test_files.tsv" def assign_supports(features, supports, labels=False, suffix=""): """ Assign support regions to a ...
""" Discovery --------- Functions used to render and return discovery responses to Envoy proxies. The templates are configurable. `todo See ref:Configuration#Templates` """ import yaml from yaml.parser import ParserError, ScannerError # type: ignore from enum import Enum from typing import List, Dict, Any, Optional ...
# Copyright 2021-2022 Huawei Technologies Co., Ltd # # 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 agre...
""" Helper methods for dealing with openshift template """ import os import json import logging import re from .utils import oc, parse_restype, get_cfg_files_in_dir, load_cfg_file log = logging.getLogger(__name__) def get_templates_in_dir(path): """ Given a directory path, returns a dict with keys: templat...
import tempfile import os import subprocess import shutil from itertools import product import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np from sklearn.datasets import fetch_20newsgroups from sklearn.model_selection import train_test_split from sklearn.preprocessing import Lab...
# # Collective Knowledge (dataset features) # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: <NAME>, <EMAIL>, http://fursin.net # cfg={} # Will be updated by CK (meta description of this module) work={} # Will be updated by CK (temporal data) ck=None # Will be u...
import math from typing import List import numpy as np from PyQt5 import QtSvg from PyQt5.QtCore import Qt, QPoint, QRect, QRectF from PyQt5.QtGui import QPen, QPainter, QColor, QFont, QBrush from pedrec.models.constants.action_mappings import ACTION from pedrec.models.constants.class_mappings import COCO_CLASSES fro...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
from models.site import SiteModel from uuid import uuid4 from flask_restful import Resource, reqparse from models.hotel import HotelModel import datetime from flask_jwt_extended.view_decorators import jwt_required def normalize_path_params(location=None, min_stars=0, max_stars=5, min_daily=0, ...
#!/usr/bin/env python3 """ This class is to be inherited by all the pic4rl enviornments """ import rclpy from rclpy.node import Node import random from gazebo_msgs.srv import DeleteEntity, SpawnEntity from std_srvs.srv import Empty import numpy as np import time from rclpy.executors import MultiThreadedExecutor...
#! /usr/bin/env python -u # coding=utf-8 import logging import os import platform import stat import subprocess import zipfile from io import BytesIO from pathlib import Path import requests import rpy2.robjects.packages as rpackages from rpy2.robjects.packages import importr from genoml.utils import DescriptionLoade...
# MIT License # # Copyright (c) 2018 Facebook # Copyright 2020 ROS-Industrial Consortium Asia Pacific # # 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 ...
import base64 import copy import hashlib import os import polib import shutil from io import BytesIO from django.core import management from django.core.management import BaseCommand, call_command from django.utils.encoding import force_bytes from django.utils.module_loading import import_string from ...tools import ge...
""" This program is designed to start a number of new EC2 instances. Usage: swarm start <options> <number> where <options> is zero or more of: -a <auth> set path to key directory (default ~/.ssh) -c <config> set the config file to use -f <flavour> set the image flavour -h pri...
""" dealing with hosts (Host records in our database) """ from datetime import datetime from django.core.management.base import BaseCommand from django.db import transaction from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from nsupdate.main.models import Host from nsupdate.u...
import os import tempfile import numpy as np import pytest import tensorboardX from numpy.testing import assert_almost_equal from tbparse import SummaryReader from torch.utils.tensorboard import SummaryWriter R = 5 N_STEPS = 100 @pytest.fixture def prepare(testdir): # Use torch for main tests, logs for tensorboa...
#!/home/programadorjoao/.virtualenvs/founse/bin/python # QUANDO TERMINAR HTML O ESTILO DA PÁGINA E ESSAS COISAS, VOU MELHORAR O CÓDIGO from quart import Quart, render_template, redirect, url_for, request, session, flash, get_flashed_messages from secrets import token_urlsafe import json app = Quart('Founse-improved',...
""" Views to display Metric data. Note on Implementation: Since this app doesn't really use django's Models, the views here are extended from ``TemplateView`` in order to keep things simple. """ from __future__ import unicode_literals from datetime import datetime from django.contrib.auth.decorators import user_pass...
#!/usr/bin/env python3 import os import time from textwrap import dedent import inquirer from click import Path, argument, group, option from colorama import Fore, Style, init as colorama_init from git import Repo, exc from rich import print as rprint from rich.console import RenderGroup from rich.panel import Panel ...
# -*- coding: utf-8 -*- """ Generates correlation matrices using two of the approaches described in: Hardin & Garcia (2013). A method for generating realistic correlation matrices. Created on Wed Jun 19 13:56:24 2013 Copyright (c) 2013-2014, CEA/DSV/I2BM/Neurospin. All rights reserved. @author: <NAME> @ema...
from .DataHub.DataAgent import * from .Utility.resource_task import * from .Utility.time_utility import * from .DataHubEntry import DataHubEntry from .AnalyzerEntry import StrategyEntry, AnalysisResult from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor, Executor class SasUpdateTask(ResourceTask): ...
import unittest import tests.uvlm.static.polars.generate_wing as gw import os import glob import configobj import numpy as np from sharpy.aero.utils.utils import local_stability_axes import sharpy.utils.algebra as algebra class InfiniteWing: area = 90000000.0 chord = 3 def force_coef(self, rho, uinf): ...
import logging import time from flask import request from flask_restx import Resource from jobtech.common.rest.decorators import check_api_key_and_return_metadata from sokannonser import settings from sokannonser.rest import ns_platsannons from sokannonser.rest.model.queries import annons_complete_query, pb_query, load...
from database import db_session, init_db from models import ArticleMetadata, CodeFirstPass, CodeSecondPass from sqlalchemy import func from datetime import datetime import random import pandas as pd import numpy as np today_str = datetime.today().strftime('%Y-%m-%d') ## get the database of variables df_db = pd.DataFr...
import numpy as np # binomial expansion for ARFIMA models def _calc_arfima_binomial(n, nterms): # switch equation side n = -n bc = np.zeros([nterms, 1]) bc[0] = 1 # generate coefficients for i in range(1, nterms): bc[i] = abs(bc[i - 1] * (n - (i - 1)) / i) return bc def ARFIMA_si...
# Copyright (c) 2010-2011 Lazy 8 Studios, LLC. # All rights reserved. from front import Constants from front.lib import db, get_uuid, utils from front.models.mission import make_mission_id # TODO: Consider additional optimizations for these queries that would not require large # portions of the gamestate to be built. ...
#!/usr/bin/env python3 import sys import pygame import random import time # import json from engine import * from engine.utils import vector2 sheet = None class Blocker(Entity): def __init__(self): super(Blocker, self).__init__(load_json_file("blockers.json")) self.anim.set_active_sequence("b1") ...
import arcpy from arcpy import env from arcpy.sa import * import os.path import glob import csv # --- PARAMS AND SETUP --------------------------------------------------------- workingTempDirName = "WorkingTemp" workingDirName = "Working" resultDirName = "Results" tempFolderName = "temp" inputFolderName = "Input" arc...
''' This is a build project for Lambda School CS Unit. I am implementing a k-means clustering algorithm from scratch. ''' # Imports import matplotlib.pyplot as plt import numpy as np import random # Distance between two points function using Euclidean geometry def distance(x, y): return np.sqrt(np.sum((x-y)**2))...
import csv, json, datetime as dt, time from pprint import pprint from tensorflow.keras.preprocessing.text import text_to_word_sequence as ttws csv.field_size_limit(500000) #https://github.com/first20hours/google-10000-english/blob/master/20k.txt #dataSource = "source/requests_data.csv" dataSource = "../data/LastMonthR...
#!/usr/bin/env python3 # # Copyright 2018 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import numpy as np import pickle import os from pathlib import Path from sacred import Experiment from sacred.observers import FileStorageObserver from data.pipeline import get_data_features from core.kernel import get_kernel, optimize_kernel_binsearch_only from core.reward_calculation import get_v, shapley, ...
# The MIT License (MIT) # # Copyright (c) 2016 <NAME> for Adafruit Industries # Copyright (c) 2019 <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 with...
# -*- coding: utf-8 -*- import numpy as np import pandas as pd def sigmoid(z): return 1 / (1 + np.exp(-z)) def forward_propagates(X, theta): a = [] z = [] a.append(X) # a[0].shape = (m, n) for i in range(len(theta)): a[i] = np.insert(a[i], 0, values=1, axis=1) # a[0].shape = (m, n+1 or hi...
from __future__ import division import time import Adafruit_PCA9685 class Servomotor: # Tamanho mínimo e máximo do pulso do PCA9685 servo_min_pulse_length = 150 # Min pulse length out of 4096 servo_max_pulse_length = 600 # Max pulse length out of 4096 servo_PIN = 0 servo_last_posit...
import logging import enum import webbrowser import xmltodict from requests_oauthlib import OAuth1Session from oauthlib.common import add_params_to_uri from .account import Account ETRADE_LOGIN_URL = "https://us.etrade.com/e/t/etws/authorize" OAUTH_BASE_URL = "https://api{}.etrade.com/oauth/" API_BASE_URL = "https://...
# Copyright © 2019 Province of British Columbia # # 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 agr...
''' Interface between native messages and get_iplayer and other system commands ''' import subprocess import utils.messages as msg DL_BBC_RADIO_PRESET = 'dl-bbc-radio' class RecordingMessageHandler: ''' Converts output from the get_iplayer recording command to a status update object for the frontend. ''' ...
import requests from time import sleep from random import randint,choice from bs4 import BeautifulSoup import sys import os import json import math help_options = ["Answer few of your questions.", "Roll a dice.", "Toss a coin", "Subtract number", "Add numbers" , "find factorial",'riddle'] def find_database_path(): ...
import scrapy import os import json import re from pprint import pprint ROOT_DIR = os.path.dirname(__file__) SETTING_PATH = os.path.join(ROOT_DIR, 'conf', 'qidian.json') web_settings = json.load(open(SETTING_PATH, 'r')) cate_mapping = {ca: c for c in web_settings['category'] for ca in web_settings['category'][c]} de...
"""Fetch transmitter and elevation data.""" import argparse import itertools import pathlib import requests import zipfile from tqdm.auto import tqdm from rasp import logger from rasp import CACHE_DIR, SRTM_DIR from ..utils import geodesy from ..constants import DEG_PER_RAD, π __all__ = ["tafl", "baserad", "siteda...
import random import urllib import requests from libtrustbridge.websub.domain import Pattern from src import repos from src.loggers import logging logger = logging.getLogger(__name__) class PostNotificationUseCase: """ Base use case to send message for notification """ def __init__(self, notificati...
# -*- coding: utf-8 -*- """ Created on Fri Aug 14 17:51:53 2015 @author: piotr at nicecircuits.com """ from libraryManager.library import libraryClass from libraryManager.part import part from libraryManager.footprintPrimitive import * from libraryManager.defaults import * from libraryManager.common import * from sym...
""" Least-squares fitting and nearest rotation matrix """ import numpy as np import scipy.linalg as la from .trafo import Transformation from .rotation import Rotation, Quaternion, map_to_quat def qfit(target, source): """Least-squares fitting of source onto target using unit quaternions. Parameters --...
import json from notebook.utils import url_path_join from notebook.base.handlers import IPythonHandler from tornado import web from tornado import gen from tornado.web import MissingArgumentError from tornado.escape import json_decode from sparkmagic.kernels.kernelmagics import KernelMagics import sparkmagic.utils.con...
""" Base module for filters. """ from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import logging import numpy as np from six import string_types class FilterResult(object): """ Result object returned by a filter. """ def __ini...
# all the imports import sqlite3 from flask import Flask, request, session, g, redirect, url_for, \ abort, render_template, flash, Request, Response from contextlib import closing from datetime import datetime # configuration DATABASE = '/tmp/flaskr.db' DEBUG = False SECRET_KEY = 'development key' USERNAME = 'adm...
"""General validator utilities.""" from __future__ import annotations import re from typing import Any, Callable, cast import voluptuous as vol # type: ignore # Validation Helpers BITS_VALUES = { "8bits": 0xFF, "16bits": 0xFFFF, "24bits": 0xFFFFFF, "32bits": 0xFFFFFFFF, "40bits": 0xFFFFFFFFFF,...
# _____ __ __ ___________ ____ # / ___// /____ ____ / |/ / _/ __ \/ _/ # \__ \/ __/ _ \/ __ \/ /|_/ // // / / // / # ___/ / /_/ __/ /_/ / / / // // /_/ // / # /____/\__/\___/ .___/_/ /_/___/_____/___/ # /_/ # StepMIDI by @sugoku #...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ [1] <NAME>, http://www.multiresolutions.com/sparsesignalrecipes/software.html [2] <NAME>, https://github.com/broxtronix/pymultiscale/ [3] <NAME>, <NAME> and <NAME>, "Wavelets, Ridgelets, and Curvelets for Poisson Noise Removal," in IEEE Transactions on Image Processin...
''' views.py contains the get and post handler logic. ''' import json from django.template import RequestContext from django.shortcuts import render from django.http import Http404, HttpResponse, HttpResponseBadRequest, HttpResponseForbidden from django.utils.translation import ugettext_lazy as _ from django.forms.fo...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import numpy as np from tqdm import tqdm from utils import (read_meta, write_meta, build_knns, labels2clusters, clusters2labels, BasicDataset, Timer) from proposals import super_vertex, filter_clusters, save_proposals def pa...
#!/usr/bin/env python3 import argparse import pickle import sys from copy import copy from pathlib import Path def nullfunc(*args, **kwargs): pass vprint = nullfunc def parse_perfest(fpath): text = fpath.read_text() return float(text.strip()) def parse_errorprop(fpath): text = fpath.read_text().sp...
from typing import List, Tuple, Union from dataclasses import dataclass from dataclasses_json import dataclass_json import torch from torch.utils.tensorboard import SummaryWriter from tqdm import tqdm from pathlib import Path from gpytorch.mlls import ExactMarginalLogLikelihood @dataclass_json @dataclass class GPT...
# -*- coding: utf-8 -*- import datetime import re from pprint import pformat import GetOldTweets3 as got import pandas as pd from src.utils import Timer, load_csv, paths USE_TWEETS_COLS = ["username", "formatted_date", "cleaned_text", "text"] PRE_PROCESSING_OPTIONS = { # custom "lower_string": True, ...
import argparse from typing import Dict, Hashable, Any, Tuple, List, Optional, Union from edgePy.data_import.mongodb.mongo_wrapper import MongoWrapper from edgePy.data_import.mongodb.gene_functions import get_canonical_rpkm from edgePy.data_import.mongodb.gene_functions import get_canonical_raw from edgePy.data_import...
""" AVL Node """ class avlnode: """ Constructor """ def __init__(self, value): self.left = None self.right = None self.value = value def __str__(self): return str(self.value) def __repr__(self): return str(self.value) """ AVL Tree """ class avltr...
"""Define classes and functions for interfacing with SageMaker Ground Truth object detection. """ import os import imageio import matplotlib.pyplot as plt import numpy as np class BoundingBox: """Bounding box for an object in an image.""" def __init__(self, image_id=None, boxdata=None): self.image_...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ magnetCalibration.py Author: <NAME>, <NAME> Last Edited: 06.12.2018 Python Version: 3.6.5 Script to read the magnetic field generated in relation to the voltage applied from the DAQ measurement card. Generated Calibration File. Structure of this module: 1) Imports...
import requests from django.conf import settings from django.db import models from django.urls import reverse_lazy from UserManagement.models import Attendent, ExpertProfile, Team # Import for Google Maps Plugin from django_google_maps import fields as map_fields from django.utils.text import slugify from datetime imp...
""" Flow: 1. use region clustering to identify main regions 2. identify useful segments of the image -> cut up each image into sub images 3. cross-correlate between the 2 image segments, and if there is image segment that is both (i) significant portion of the screen & (ii) high image similarity, then it must have been...
# Standard library imports. from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import json import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText # Related third party imports. from rasa_sdk import Action from rasa_...
""" initialize_memory.py is a Python routine that reads the data and stores the resulting run variables as pickle files of <NAME>, <NAME>, and <NAME>, "Leading-order nonlinear gravitational waves from reheating magnetogeneses". The function run() executes the code. """ import os import numpy as np # get working dire...
############################################################################## # # Copyright (c) 2001 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
import pickle from multiprocessing import Process, freeze_support import os import shutil from classifier import get_dict_of_top_extensions from shutil import copy, move counter_limit = 1000 how_deep = 15 threads_num = 8 distributing_files_root_dir = 'temp_languages' file_list_dump = 'dump_file_list_temp_languages' ...
import numpy as np import networkx as nx from scipy import spatial import matplotlib.colors as colors import matplotlib.pyplot as plt import pykoda import tqdm """ In this example we are going to divide Stockholm in zones , and create a connectivity network between zones. We will then perform spectral analysis to s...
#!/usr/bin/env python3 import argparse import json import socket import sys import time from web3 import Web3, exceptions from contract import pricefeed, wrb from config import load_config # Post a data request to the post_dr method of the WRB contract def handle_requestUpdate(w3, pricefeedcontract, account_addr, gas,...
#!/usr/bin/env python # # Copyrite (c) 2014 SecurityKISS Ltd (http://www.securitykiss.com) # # This file is part of rfw # # The MIT License (MIT) # # Yes, Mr patent attorney, you have nothing to do here. Find a decent job instead. # Fight intellectual "property". # # Permission is hereby granted, free of charge, to ...