text
stringlengths
2
999k
#!/usr/bin/env python3 # Copyright (c) 2013-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import biplist from ds_store import DSStore from mac_alias import Alias import sys output_file = sys.argv...
# -*- coding: utf-8 -*- """Warning : this file has been generated, you shouldn't edit it""" from os import linesep from pyleecan.Classes.check import check_init_dict, check_var, raise_ from pyleecan.Functions.save import save from pyleecan.Classes.frozen import FrozenClass from pyleecan.Classes.check import InitUnKno...
from cbagent.collectors.libstats.remotestats import ( RemoteStats, multi_node_task) class IOstat(RemoteStats): METRICS = ( ("rps", "r/s", 1), ("wps", "w/s", 1), ("rbps", "rkB/s", 1024), # kB -> B ("wbps", "wkB/s", 1024), # kB -> B ("avgqusz", "avgqu-sz", 1), ...
import uvicorn from Blockchain import Blockchain from fastapi import FastAPI, Request, Form, Depends, HTTPException from fastapi.responses import HTMLResponse from fastapi.templating import Jinja2Templates from fastapi.staticfiles import StaticFiles from sqlalchemy.orm import Session from blockchain.database import sc...
from firedrake import * import numpy import random try: import matplotlib.pyplot as plt except: warning("Matplotlib not imported") #== Create mesh == nx, ny = 100, 40 Lx, Ly = 1.0, 0.4 mesh = RectangleMesh(nx,ny,Lx,Ly) #== Function spaces == #---Double porosity/permeability flow problem--- velSpace = VectorFunc...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.contrib.postgres.fields class Migration(migrations.Migration): dependencies = [ ('housing', '0003_auto_20181114_0343'), ] operations = [ migrations.AlterField( ...
import ctapipe import traitlets from ctapipe.io import EventSourceFactory from ctapipe.io import event_source from ctapipe.calib import CameraCalibrator from enum import Enum from ctapipe.visualization import CameraDisplay import time import copy import pickle from matplotlib import pyplot as plt import PreprocessingF...
file = open("Graph.py") lines = file.readlines() for line in lines: pos = line.find(">>>") if pos != -1: print line.rstrip()[pos+4:]
# Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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; either version 3, or (at your option) # any later version...
# PyAlgoSamples # Examples using the PyAlgoTrade Library # # Copyright 2015-2017 Isaac de la Pena # # 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-...
from openwhisk_docker_action import Action app = Action('My Openwhisk Action', methods=['GET']) @app.web def main(params): return 200, 'text/html', "<html><body><h1>Hello World</h1></body></html>"
import numpy as np import pytest import tensorflow as tf from tests.layers.flows.helper import (quadratic_transform, QuadraticFlow, npyops, invertible_flow_standard_check) from tfsnippet.layers import SplitFlow, SequentialFlow, ReshapeFlow class SplitFlowTestCase(tf.test.TestCa...
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 8 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class EventAlertCondition(object...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # Copyright (c) 2008-2020 pyglet contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the follo...
#!/usr/bin/env python import gym import rospy import roslaunch import time import numpy as np from gym import utils, spaces from geometry_msgs.msg import Twist from std_srvs.srv import Empty from gym.utils import seeding from gym.envs.registration import register import copy import math import os from sensor_msgs.msg...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import patterns, url urlpatterns = patterns("spirit.views.admin.user", url(r'^$', 'user_list', name='admin-user'), url(r'^edit/(?P<user_id>\d+)/$', 'user_edit', name='admin-user-edit')...
import pandas as pd import numpy as np from sklearn.utils import shuffle from util.exceptions import DataSplitError, DataFrameTypeError ''' NAME: train_test_split PARAMS: - df: A pandas DataFrame containing the whole data set. - label: A string of the column to use as the label of the classification problem default v...
""" Test the signals module """ # Author: Gael Varoquaux, Alexandre Abraham # License: simplified BSD import os.path import numpy as np from nose.tools import assert_true, assert_false, assert_raises # Use nisignal here to avoid name collisions (using nilearn.signal is # not possible) from nilearn import signal as n...
""" eZmax API Definition (Full) This API expose all the functionnalities for the eZmax and eZsign applications. # noqa: E501 The version of the OpenAPI document: 1.1.7 Contact: support-api@ezmax.ca Generated by: https://openapi-generator.tech """ import sys import unittest import eZmaxApi from...
class Solution: def exist(self, board, word): if not board: return False for i in range(len(board)): for j in range(len(board[0])): if self.dfs(board, i, j, word): return True return False # check whether can find word, start a...
""" Generated by 'django-admin startproject' using Django 3.2.7. """ from pathlib import Path import dj_database_url from decouple import config BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = config("SECRET_KEY", default="changethis") DEBUG = config("DEBUG", default=True, cast=bool) ALLOWED_HOSTS = co...
import os from .client import Client # noqa from .exceptions import ( # noqa HTTPError, BadRequestsError, UnauthorizedError, ForbiddenError, NotFoundError, MethodNotAllowedError, PayloadTooLargeError, UnsupportedMediaTypeError, TooManyRequestsError, InternalServerError, Se...
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2020 Edgewall Software # Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de> # Copyright (C) 2005-2007 Christian Boos <cboos@edgewall.org> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of thi...
# Copyright 2019 BDL Benchmarks 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 applica...
#// Copyright (c) Microsoft Corporation.// Licensed under the MIT license. import json, subprocess, torch, os, time, pdb import numpy as np from knowledge import KnowledgeBase import base64 from flask import Flask, request, render_template from lm import LanguageModel from grounded import ContentTransfer from flask_r...
# 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! *** # Export this package's modules as members: from .cluster import * from .get_cluster import * from ._inputs import * from . import outputs def _regist...
import json from twisted.python.filepath import FilePath from base_plugin import SimpleCommandPlugin from plugin_manager import FatalPluginError class StarboundConfigManager(SimpleCommandPlugin): name = 'starbound_config_manager' depends = ['command_plugin'] def activate(self): super(StarboundC...
import os import glob from moviepy.editor import * from pathlib import Path import json downloads_folder = '/Users/elsa/Downloads/' data_folder = 'SisFall_Videos/' adl_folder = 'ADLs/' fall_folder = 'Falls/' # Path to save the images output_base_path = data_folder # Label files, download them from the dataset's site ...
import itertools import threading from time import sleep import requests from pyopencga.exceptions import OpenCgaInvalidToken, OpenCgaAuthorisationError try: from Queue import Queue except ImportError: from queue import Queue _CALL_BATCH_SIZE = 2000 _NUM_THREADS_DEFAULT = 4 class RESTResponse: def __in...
import torch import numpy as np from misc.replay_memory import ReplayMemory def collect_trajectory(agents, actors, env, args): """Collect batch of trajectories Args: agents (list): Contains agents that act in the environment actors (list): Contains parameters that agents use to select action ...
import queue import threading import time print_lock = threading.Lock() def init_queue(): """ Initialize the Queue """ return queue.Queue() def job(queue_item): """ What is actually being worked on """ with print_lock: print('+ Job:', threading.current_thread().getName()) args = dict(...
from numpy import * from math import * x = 0 y = 0 z = 1 an = 2*pi*3/4 mat1 = mat([[cos(an)+(1-cos(an))*x**2, (1-cos(an))*x*y-sin(an)*z,(1-cos(an))*x*z+sin(an)*y], [(1-cos(an))*x*y+sin(an)*z,cos(an)+(1-cos(an))*y**2,(1-cos(an))*y*z-sin(an)*x], [(1-cos(an))*x*z-sin(an)*y,(1-cos(an))*z*y+sin(an)*x,cos(an)+(1-cos(...
#!/usr/local/bin/python3.7 # -*- coding: utf-8 -*- import collections from typing import List from datatype.tree_node import TreeNode def preorderTraversal(root: TreeNode) -> List[int]: """ 栈:先进后出 入栈顺序:右左, 出站顺序:左右。 """ if not root: return [] res, stack = [], [root] while stack: ...
""" Copyright 2020, The Regents of the University of California. 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, this ...
# -*- coding: utf-8 -*- """Top-level package for python_microservice.""" __author__ = """Luciano Resende""" __email__ = 'lresende@apache.org' __version__ = '0.1.0'
import unittest from Diksha_Reports.usage_by_course.check_course_type_content_play_counts import test_course_based_on_timeperiods from Diksha_Reports.usage_by_course.click_on_homeicon import Diksha_column_homeicon from Diksha_Reports.usage_by_course.click_on_hyperlink import Diksha_column_hyperlink from Diksha_Repor...
# -*- coding: utf-8 -*- # (C) Copyright IBM Corp. 2020. # # 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 l...
# pylint: disable=unused-argument import os import gossip import pytest import slash from slash import plugins from slash.plugins import IncompatiblePlugin, PluginInterface from .utils import NamedPlugin, maybe_decorate def test_registers_on_none(restore_plugins_on_cleanup, checkpoint): @slash.plugins.active ...
#!/usr/bin/env python # sys.path.remove("/opt/ros/kinetic/lib/python2.7/dist-packages") import cv2 import numpy as np import numpy as np import argparse import roi_detect_help import cv2 font = cv2.FONT_HERSHEY_COMPLEX # from cv_bridge import CvBridge, CvBridgeError def kalman_xy(x, P, measurement, R, ...
# -*- coding: iso-8859-15 -*- # *------------------------------------------------------------------ # * cspaxl_User.py # * # * Cisco AXL Python # * # * Copyright (C) 2015 Carlos Sanz <carlos.sanzpenas@gmail.com> # * # * This program is free software; you can redistribute it and/or # * modify it under the terms of the...
# import time # import gdata.spreadsheet.service # import gspread # email = 'embryoclub@gmail.com' # password = 'mbry0pr0' # def save_to_spreadsheet(name,num,bits_id,bits_email): # spreadsheet_key = '1YgpIc-HD2ADndEzgCjn-v8w7hGFbbsuM5exoJmPbouA' # worksheet_id = 'od6' # spr_client = gdata.spreadsheet.service.Spreads...
from django.http import HttpResponse, Http404, HttpResponseRedirect from django.core.exceptions import ObjectDoesNotExist from django.contrib import admin from django.db import models from softdelete.models import * from softdelete.admin.forms import * import logging class SoftDeleteObjectInline(admin.TabularInline): ...
"""WSK utils for WE1S (WhatEvery1Says) """ import csv import datetime import json import logging import os import pprint import re import string import zipfile from bs4 import BeautifulSoup import unidecode from wsk import WSK import config.config as cfg from scrub.scrub import scrub as scrubber def date_validate(...
############################################################################## # # An example of inserting images from a Python BytesIO byte stream into a # worksheet using the XlsxWriter module. # # Copyright 2013-2018, John McNamara, jmcnamara@cpan.org # # Import the byte stream handler. from io import BytesIO # Im...
import matplotlib.pylab as plt from matplotlib.ticker import MaxNLocator import numpy as np def _plot_subset(fs, **kwargs): fig, ax = plt.subplots(1,1) ax.set_title(type(fs).__name__) ax.set_xlabel('# features') ax.set_ylabel('score') forward = getattr(fs, 'forward', True) if not forward...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from numba import f8 from numba import c16 from numba import jit try: from numba import prange except ImportError: prange = range from numpy import zeros __author__ = ['Andrew Liew <liew@arch.et...
"""core URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vi...
from django.shortcuts import render, get_object_or_404 from django.contrib.auth.models import User from .models import UserProfile from django.contrib import auth from .forms import RegistrationForm, LoginForm , ProfileForm, PwdChangeForm from django.http import HttpResponseRedirect from django.urls import reverse from...
""" WSGI config for Comparte Ride project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICAT...
from collections import ( defaultdict, deque ) from itertools import islice from enum import Enum from threading import Lock from fast_autocomplete.lfucache import LFUCache from fast_autocomplete.misc import _extend_and_repeat from fast_autocomplete.normalize import normalize_node_name from Levenshtein import d...
""" This module provides unit tests for the function in ofco.utils. """ import numpy as np from scipy.signal import correlate2d from ofco.utils import * def test_partial_deriv(): """ Tests for the partial derivative function. """ imgs = np.zeros((50, 50, 2)) w = np.zeros(imgs.shape) output0,...
# model settings model = dict( type='CascadeRCNN', num_stages=3, pretrained=None, backbone=dict( type='ResNetDP', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[2...
""" Comments may be attached to any object. See the comment documentation for more information. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): first_name = models.Char...
# Lint as: python2, python3 # Copyright 2018 The TensorFlow 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 # ...
from sklearn.dummy import DummyClassifier, DummyRegressor from sklearn.preprocessing import MinMaxScaler from sklearn.naive_bayes import GaussianNB, MultinomialNB from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor from sklearn.pipeline import make_pipeline from sklearn.linear_model import LogisticRe...
import sys from ._pryssa import pryssa
""" Example demonstrating how to do the key rotation on the ledger. Steward already exists on the ledger and its DID/Verkey are obtained using seed. Trust Anchor's DID/Verkey pair is generated and stored into wallet. Stewards builds NYM request in order to add Trust Anchor to the ledger. Once NYM transaction is done, ...
from PIL import Image ASCII_CHARS = ['#', '?', '%', '.', 'S', '+', '.', '*', ':', ',', '@'] def handle_image_conversion(image_filepath): image = None try: image = Image.open(image_filepath) except Exception as e: print("Unable to open image file {image_filepath}.".format(image_filepath=ima...
# Copyright 2017 Mycroft AI 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 writin...
# coding: utf-8 # ---------------------------------------------------------------------------- # <copyright company="Aspose" file="AiBcrParseStorageRequest.py"> # Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved. # </copyright> # <summary> # Permission is hereby granted, free of charge, to any per...
from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function from builtins import str as unicode from quark_runtime import * _lazyImport.plug("test") import quark.reflect import test.subtest def go(): pass class Test(_QObjec...
import perception, syntax, semantics import numpy as np from copy import deepcopy import sys from func_timeout import func_timeout, FunctionTimedOut from utils import SYMBOLS from collections import Counter from time import time import torch class Node: def __init__(self, symbol, smt): self.symbol = symbol...
''' Exception handling tests for UBXMessage constructor and parse Created on 3 Oct 2020 *** NB: must be saved in UTF-8 format *** @author: semuadmin ''' # pylint: disable=line-too-long, invalid-name, missing-docstring, no-member import unittest from pyubx2 import UBXMessage, UBXTypeError, UBXParseErro...
"""Development settings.""" from .base import * # NOQA from .base import env # Base DEBUG = True # Security SECRET_KEY = env('DJANGO_SECRET_KEY', default='PB35EvTmCkzaLGRAx834aMayKTPTDd5usT8gw4pCmKOk5AlJjh12pTrnNgQyOHCH') ALLOWED_HOSTS = [ "localhost", "0.0.0.0", "127.0.0.1", ] # Cache CACHES = { '...
from distutils.core import setup setup( name="corona-rki-prometheus-exporter", version="1.0", )
from typing import List, Optional, Tuple from pyspark.sql.dataframe import DataFrame from faas.config import Config from faas.config.config import create_etl_config from faas.transformer.lightgbm import ETLWrapperForLGBM def get_trained( conf: Config, df: DataFrame, m: Optional[ETLWrapperForLGBM] = None ) -> ET...
from django.contrib import admin from .models import Api admin.site.register(Api)
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "news_bias_analyzer_website.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
from tso.scheduler import scheduler from tso.scheduler.utils import generate_requests as gr from tso.exporter import exporter config = { 'slew_rate': 0.8, 'filters': { 'filter': {('MSE', 'EXAMPLE'): 10 } } } N_BLOCKS = 5 def main(): print('Inside the main Scheduler Application') requests...
"""Test the reports collection.""" import unittest from unittest.mock import Mock from external.database.reports import metrics_of_subject from ...fixtures import METRIC_ID, METRIC_ID2, SUBJECT_ID class MetricsForSubjectTest(unittest.TestCase): """Unittest for getting all metrics belonging to a single subject....
import sys sys.path.append('../') from extract2blade import ExtractToBlade import unittest import os # https://stackoverflow.com/a/652299/4330182 class Test(object): def __new__(cls, **attrs): result = object.__new__(cls) result.__dict__ = attrs return result class TestPathsMethods(unitt...
n = int(input('Digite um valor:')) a = n - 1 s = n + 1 print('Analisando o valor {}, seu antecessor é {} e o sucessor é {}'.format(n, a, s))
from __future__ import print_function from potentiostat import Potentiostat import sys if len(sys.argv) > 1: port = sys.argv[1] else: port = '/dev/ttyACM0' dev = Potentiostat(port) version = dev.get_firmware_version() print('firmware version: ', version)
try: from local_settings import * except ImportError: pass from azure.devops.connection import Connection from msrest.authentication import BasicAuthentication import threading, queue class QueryResultStatus(): CHECKING = "Checking" BUILD_COMPLETE = "Build Complete" BUILD_IN_PROGRESS = "Building"...
# Copyright 2010-2020 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistrib...
import sys import ivy import jax as _jax # noinspection PyPackageRequirements import jaxlib import jax.numpy as jnp from jaxlib.xla_extension import Buffer # make ivy.Container compatible with jax pytree traversal from jax.tree_util import register_pytree_node from jax.tree_util import tree_flatten, tree_unflatten re...
import unittest from src.spydermodule.FootballMatchEvent import FootballMatchEvent class TestFootballMatchEvent(unittest.TestCase): def setUp(self): self.MyFootballMatchEvent = FootballMatchEvent( 'https://www.python.org/OB_EV18745122', ...
"""Create a map from the input binomials to their ITIS accepted synonyms. """ import pandas as pd from PyFloraBook.in_out.data_coordinator import locate_nomenclature_folder # Globals INPUT_FILE_NAME = "search_results.csv" # Input nomenclature_folder = locate_nomenclature_folder() itis_results = pd.read_csv( str...
import distro import pytest from distutils.version import StrictVersion from dvslib.dvs_common import PollingConfig @pytest.mark.usefixtures("testlog") @pytest.mark.usefixtures('dvs_vlan_manager') @pytest.mark.usefixtures('dvs_lag_manager') class TestVlan(object): def check_syslog(self, dvs, marker, process, err...
class DexException(BaseException): def __init__(self, msg): self.msg = msg def __str__(self): return "dex : " + self.msg class DexcodeException(DexException): """ Base class for an exception from a dexcode problem. """ pass class FileOverwriteError(DexException): pass
from ._private.address import get_bus_address, parse_address from .message import Message from .constants import BusType, MessageFlag, MessageType, ErrorType, NameFlag, RequestNameReply, ReleaseNameReply from .service import ServiceInterface from .validators import assert_object_path_valid, assert_bus_name_valid from ....
from .zomatoWrapper import Zomato
import re import gzip import logging import csv import io import requests from dipper.sources.Source import Source from dipper.models.Model import Model from dipper.models.Dataset import Dataset from dipper.models.assoc.Association import Assoc from dipper.models.assoc.OrthologyAssoc import OrthologyAssoc from dipper....
from dataclasses import dataclass from typing import Optional @dataclass class User: id: int login: str url: str avatar_url: str @dataclass class UserDetail(User): name: str email: Optional[str] @dataclass class Me(UserDetail): total_private_repos: int owned_private_repos: int ...
# Copyright 2020 Alexander Lim # # 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 from .__main__ import *
# -*- coding: utf-8 -*- """ CommandLine: python -m ibeis.gui.inspect_gui --test-test_review_widget --show """ from __future__ import absolute_import, division, print_function, unicode_literals from functools import partial from ibeis.viz import viz_helpers as vh import guitool as gt import numpy as np import utool ...
x = 123.123 print(f'number = {x:0.1f}')
# coding: utf-8 import datetime import decimal import importlib import operator import os import sqlalchemy as sa from sqlalchemy import and_ from sqlalchemy import ARRAY from sqlalchemy import BigInteger from sqlalchemy import bindparam from sqlalchemy import BLOB from sqlalchemy import BOOLEAN from sqlalchemy import...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# ------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # ----------------------------------------------------------------------...
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware import uvicorn from app import db, ml, viz description = """ Deploys model fit on Airbnb databse """ app = FastAPI( title='air bnb API', description=description, docs_url='/', ) app.include_router(db.router, tags=['Database']...
import torch import numpy as np from torch import nn import torch_optimizer as optim from torch.utils.data import DataLoader from torch.nn import Sigmoid from sklearn.model_selection import train_test_split from .utils import MBSplitter class BaseClassifier: def loss(self, y_pred, y_true): total_loss = nn....
# # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
# python Libraries import time from types import IntType, FloatType #apetools Libraries from apetools.baseclass import BaseClass ONE_SECOND = 1 MESSAGE = "Sleeping for {0} seconds" class Sleep(BaseClass): """ The sleep provides a verbose sleep. """ def __init__(self, sleep_time=5, *args, **kwargs)...
import locale import logging import pathlib import random import re from bs4 import BeautifulSoup class ScrapeResult: def __init__(self, r): self.alert_subject = None self.alert_content = None self.price = None self.soup = BeautifulSoup(r.text, 'lxml') self.content = self....
""" .. module: lemur.users.service :platform: Unix :synopsis: This module contains all of the services level functions used to administer users in Lemur :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Kevin Glisson <kglisso...
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:42953") pwd = raw_input("Enter old wallet passphrase: ") pwd2 = raw_input("Enter new wallet passphrase: ") access.walletpassphrasechange(pwd, pwd2)
class IMachineWorker(object): """ Base class for objects that provide pluggable service to others. """ def boot(self, *args): """ Prepare for providing the service. After this call, it may be requested by others. """ pass def run(self): """ Called by reactor's loop when this obj...
# # Copyright (c) 2020, Neptune Labs Sp. z o.o. # # 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...