content
stringlengths
5
1.05M
""" Bot's behaviour """ INTENTS = [ { 'name': 'Date', 'tokens': ('when', 'time', 'date', 'at', '1'), # You can add any key words in the list 'scenario': None, 'answer': 'The conference is being held on May 10, registration will start at 11 am.' }, { 'name': 'Place',...
from rest_framework.exceptions import APIException class CFSSLError(APIException): status_code = 503 default_detail = 'Could not create Docker certificate.' default_code = 'docker_certificate_service_unavailable'
"""Source code for categorical dqn brain class. Author: Yoshinari Motokawa <yoshinari.moto@fuji.waseda.jp> """ from typing import List import torch from omegaconf import DictConfig from torch import nn from .abstract_brain import AbstractBrain from core.agents.models.customs.categorical_dqn import ApplySoftmax cl...
# -*- coding: utf-8 -*- """Model definitions.""" from django.db import models from picklefield.fields import PickledObjectField class Model(models.Model): """GLM model.""" blob = PickledObjectField() def __str__(self): return f'Hello, I am the GLM model #{self.id}'
import anki_vector from anki_vector.util import Pose, degrees def main(): args = anki_vector.util.parse_command_args() with anki_vector.Robot(args.serial, show_3d_viewer=True, enable_nav_map_feed=True) as robot: robot.behavior.drive_off_charger() fixed_object = robot.world.create_custom_fixed_object(P...
# proxy module from __future__ import absolute_import from mayavi.action.filters import *
class Solution: def XXX(self, head: ListNode, n: int) -> ListNode: slow=head fast=head for i in range(n): fast=fast.next if fast==None: return slow.next else: fast=fast.next while fast: fast=fast.next slow=s...
# -*- coding: utf-8 -*- import click import pytest from click.testing import CliRunner from gitlabctl.cli import project_get_env from gitlabctl.cli import run_pipeline __author__ = "Thomas Bianchi" __copyright__ = "Thomas Bianchi" __license__ = "mit" def main_get_env(func_name, id): return [id] def main_run...
from enum import Enum class Status(Enum): Dziecko=1, Nastolatek=2, Dorosly=3 def printFileName(): print("Status")
import logging from typing import Optional, Sequence from hybrid.sites import SiteInfo import PySAM.Singleowner as Singleowner from hybrid.log import hybrid_logger as logger class PowerSource: def __init__(self, name, site: SiteInfo, system_model, financial_model): """ Abstract class for a renewa...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 24 13:41:37 2018 @author: craggles """ import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d import scipy.special import sklearn from matplotlib import cm from matplotlib import rc import matplotlib matplotli...
import os from getpass import getpass from netmiko import ConnectHandler password = os.getenv("PYNET_PASSWORD") if os.getenv("PYNET_PASSWORD") else getpass() net_connect = ConnectHandler( host="cisco3.lasthop.io", username="pyclass", password=password, device_type="cisco_ios", session_log="my_sessi...
from pathlib import Path from yacs.config import CfgNode as CN import os import time import logging import torch.distributed as dist _C = CN() _C.dataset = 'imagenet' _C.data_dir = './data_list/' _C.check_path = './checkpoint' _C.arch = 'resnet50' _C.workers = 32 _C.epochs = 400 _C.defer_epoch = 0 _C.start_epoch = 1...
#!/usr/local/sbin/charm-env python3 # 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 writ...
import sys import re as _re from fclpy.lisptype import LispSymbol class LispStream(): def __init__(self, fh): self.fh = fh self.tokens = [] self.buff = [] def unread_char(self, y): self.buff.append(y) def push_token(self, token): self.tokens.append(to...
""" We have discussed Knight’s tour and Rat in a Maze problems in Set 1 and Set 2 respectively. Let us discuss N Queen as another example problem that can be solved using Backtracking. The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two queens attack each other. For example, follow...
import argparse parser = argparse.ArgumentParser() parser.add_argument("-t", "--text",help="text for the google_speech", action="store") args = parser.parse_args() print () from google_speech import Speech # say "Hello World" text = args.text lang = "en" speech = Speech(text, lang) #speech.pla...
import os import webapp2 import jinja2 import json import cgi import re import hmac import hashlib import random from string import letters from google.appengine.ext import db template_dir = os.path.join(os.path.dirname(__file__), 'templates') jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template...
import logging import os import shutil import sys import time import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class AverageMeter(object): def __init__(self): self.reset() def reset(self): self.avg = 0 self.sum = 0 self.cnt = 0 def up...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Author: Wenbin Li (liwenbin.nju@gmail.com) Date: April 9, 2019 Version: V0 Citation: @inproceedings{li2019DN4, title={Revisiting Local Descriptor based Image-to-Class Measure for Few-shot Learning}, author={Li, Wenbin and Wang, Lei and Xu, Jinglin and Huo, Jing ...
# Copyright 2016 Anselm Binninger, Thomas Maier, Ralph Schaumann # # 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...
import unittest import pyarrow import pymarrow import pandas as pd class TestPyMarrow(unittest.TestCase): def test_add_index(self): batch = pyarrow.RecordBatch.from_arrays([ [5, 4, 3, 2, 1], [1, 2, 3, 4, 5] ], ["a", "b"]) actual = pymarrow.add_index(batch, ["a"]) ...
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from .forms import PDBForm from .runVis import LoadModel, DOPE, HDXRepr, RepLabels, CustomRes import urllib d_obj = { "1":RepLabels, "2":HDXRepr, "3":DOPE, "4":CustomRes } d_desc = { "1":"Selected residu...
#!/usr/bin/env python from webkitpy.benchmark_runner.generic_factory import GenericFactory class HTTPServerDriverFactory(GenericFactory): products = {}
# Copyright (c) 2019-2021, Manfred Moitzi # License: MIT License from typing import TYPE_CHECKING, Iterable, Tuple, Optional, List, Iterator import abc import warnings from ezdxf.math import Vec3, Vec2 if TYPE_CHECKING: from ezdxf.math import Vertex, AnyVec __all__ = ["BoundingBox2d", "BoundingBox", "AbstractBou...
# # Author: Robert Abram <rabram991@gmail.com> # # This file is subject to the terms and conditions defined in the # file 'LICENSE', which is part of this source code package. # # # Signal handlers for model change events, see: proj.settings.appconfig. # These are a great way to log user activity. # from datetime imp...
from common import * import collections import numpy as np def test_astype(ds_local): ds = ds_local ds_original = ds.copy() #ds.columns['x'] = (ds.columns['x']*1).copy() # convert non non-big endian for now ds['x'] = ds['x'].astype('f4') assert ds.x.evaluate().dtype == np.float32 assert ds.x....
""" File: P3_semi_supervised_topic_modeling.py Description: Loads a previously created pre-processed chat corpus, then performs semi-supervised topic modeling utilizing CorEx and GuidedLDA. INPUT FILES: 0) anchors.txt - anchor/seed words each on their own line Previously created preproces...
# ============================================================================== # Imports # ============================================================================== import numpy as np import os, glob from tqdm import tqdm as tqdm import tensorflow.compat.v1 as tf tfq = tf.quantization import tensorflow_probab...
from .features import Dictionary, RegexMatches, Stemmed, Stopwords name = "portuguese" try: import enchant dictionary = enchant.Dict("pt") except enchant.errors.DictNotFoundError: raise ImportError("No enchant-compatible dictionary found for 'pt'. " + "Consider installing 'myspell-p...
# -------------------------------------------------------------------- # Directory syncer by Alexander Sirotin (c) 2016 # Originally created for syncing between home NAS backup and Amazon cloud # Both are mounted on the host machine (Amazon cloud is mounted using acd_cli) # This program comes without any warranty, use ...
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- ''' @author: yuejl @application: @contact: lewyuejian@163.com @file: wechatApiConf.py @time: 2021/7/1 0001 11:32 @desc: ''' class WechatApiConfig: def __init__(self): self.url = None self.init = None
# # Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use...
""" Copyright (C) 2018-2021 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 required by applicable law or agreed to i...
import os.path as osp import pickle from collections import Counter import torch from torch.utils.data import DataLoader import spacy from tqdm import tqdm import lineflow as lf import lineflow.datasets as lfds PAD_TOKEN = '<pad>' UNK_TOKEN = '<unk>' START_TOKEN = '<s>' END_TOKEN = '</s>' IGNORE_INDEX = -100 NL...
import unittest from helpers.queuehelper import QueueName #from backend.fcmapp import InfrastructureService from backend.fcmbus import Bus class TestBus(unittest.TestCase): #@classmethod #def make_bus(self): # return Bus(InfrastructureService('', '', '', '', '', '')) def test_bus_get_name_q(self): ...
import importlib import sys # the following are python opcodes taken from the `opcode` module # these have been constantized for easier access # these are the opcodes used by python # not to be confused with opcodes from neo.VM.OpCode, # which are the opcodes for the neo vm POP_TOP = 1 ROT_TWO = 2 ROT_THREE = 3 DUP_...
from django.contrib import admin from testModel.models import Test,Contact,Tag class TagInline(admin.TabularInline): model =Tag # Register your models here. class ContactAdmin(admin.ModelAdmin): list_display = ('name','age', 'email') search_fields = ('name',) inlines =[TagInline] # fie...
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def buildTree(self, inorder: 'List[int]', postorder: 'List[int]') -> 'TreeNode': if not inorder or not postorder: ret...
import argparse import os.path import numpy as np import torch import torchvision import torchvision.transforms as T from sklearn.model_selection import train_test_split from MIA.Attack.Augmentation import Augmentation from model import CIFAR parser = argparse.ArgumentParser() parser.add_argument("--save_to", defaul...
"""TrackML scoring metric""" __authors__ = ['Sabrina Amrouche', 'David Rousseau', 'Moritz Kiehn', 'Ilija Vukotic'] import numpy import pandas def _analyze_tracks(truth, submission): """Compute the majority particle, hit counts, and weight for each track. Parameters ---------- truth : ...
from crc.api.common import ApiError from crc.scripts.script import Script from crc.services.study_service import StudyService class UpdateStudyAssociates(Script): argument_error_message = "You must supply at least one argument to the " \ "update_study_associates task, an array of obje...
from django.shortcuts import render, redirect from .models import * from django.http import Http404 from django.contrib.auth.models import User from rest_framework import viewsets from .sheet2 import interest_responses, firstapplication_response # from .sheet3 import assesment_responses, score_response # from django.co...
"""The qnap component."""
import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE'] ).get_hosts('all') def test_nginx_service(host): assert host.service("nginx-podman").is_running assert host.service("nginx-podman").is_enabled def test_...
import unittest from typing import List, Optional from swift_cloud_py.common.errors import SafetyViolation from swift_cloud_py.entities.intersection.intersection import Intersection from swift_cloud_py.entities.intersection.traffic_light import TrafficLight from swift_cloud_py.entities.intersection.signalgroup import ...
import cv2 from PIL import Image import argparse import os import glob import time from pathlib import Path import torch from config import get_config from mtcnn import MTCNN import mxnet as mx import numpy as np from Learner import face_learner from utils import load_facebank, draw_box_name, prepare_facebank from face...
class PixelNotChangingError(Exception): pass
__author__ = 'kim' try: import pyfftw print('-------------------') print('| pyFFTW detected |') print('-------------------') except: print('-------------------------------') print('* WARNING: No pyFFTW detected *') print('-------------------------------') from upsilon.utils import utils f...
import mysql.connector from mysql.connector import errorcode from flask import flash try: # Establish a connection with the MySQL database # Password here is hardcoded for simplicity. # For all practical purposes, use environment variables or config files. cnx = mysql.connector.connect(user='test_user'...
""" Django template tags for configurations. """
from services import user_service from viewmodels.shared.viewmodelbase import ViewModelBase class IndexViewModel(ViewModelBase): def __init__(self): super().__init__() self.user = user_service.get_user_by_id(self.user_id) def validate(self): if not self.user_id: self.error...
# coding: utf-8 # In[1]: from flask import Flask,render_template,session,url_for,request,redirect from flask_pymongo import PyMongo from flask_bcrypt import Bcrypt from flask import jsonify,json import os import gspread from oauth2client.service_account import ServiceAccountCredentials import pprint import datetime...
# Copyright (c) The Diem Core Contributors # SPDX-License-Identifier: Apache-2.0 from typing import List, Callable, Optional import requests from .models import ( User, Address, Transaction, Transactions, RequestForQuote, Quote, CreateTransaction, AccountInfo, OffChainSequenceIn...
# -*- coding: utf-8 -*- """ Created on Wed Oct 30 14:05:38 2019 @author: ico """ import numpy as np class MyNeuron: def training(self,X,Y): self.W=np.random.random((X.shape[1]+1,1)) X=np.append(np.ones((X.shape[0],1)),X,axis=1) for j in range(1,21): i=0 ...
#!/usr/bin/env python3 import argparse import random import sys from mpmath import mp from common import print_integral_single_input from common.randomgen import generate_basis_function parser = argparse.ArgumentParser() parser.add_argument("--filename", type=str, required=True, help="Output file name") parser.add...
# coding: utf-8 r"""Distance conversions""" from corelib.units.base import create_code distances = {"mm": 1e-3, "millimeter": 1e-3, "millimeters": 1e-3, "millimetre": 1e-3, "millimetres": 1e-3, "cm": 1e-2, "centimeter": 1e-2, "centimeters": 1e-2, "centimetre": 1e-2, "centimetres": 1e-2, "m"...
kOk = 0 kNoSuchSession = 6 kNoSuchElement = 7 kNoSuchFrame = 8 kUnknownCommand = 9 kStaleElementReference = 10 kElementNotVisible = 11 kInvalidElementState = 12 kUnknownError = 13 kJavaScriptError = 17 kXPathLookupError = 19 kTimeout = 21 kNoSuchWindow = 23 kInvalidCookieDomain = 24 kUnexpectedAlertOpen = 26 kNoAlertOp...
# 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, ...
# terrascript/arukas/d.py
# Simple NTP daemon for MicroPython using asyncio. # Copyright (c) 2020 by Thorsten von Eicken # Based on https://github.com/wieck/micropython-ntpclient by Jan Wieck # See LICENSE file try: import uasyncio as asyncio from sys import print_exception except ImportError: import asyncio import sys, socket, str...
import re import random TOOBIG = -1 TOOSMALL = -2 NOTNEW = -3 EMPTY = -1 class NameJoiner: def __init__(self, str1, str2): words = [str1, str2] random.shuffle(words) self.fullStartName = words[0] self.fullEndName = words[1] self.initVariables() def in...
import sys from PySide2.QtWidgets import QApplication, QWidget, QPushButton, QLineEdit, QTextBrowser, QMainWindow, QTextEdit from PySide2.QtCore import QFile, Slot from ui_mainwindow import Ui_MainWindow class MainWindow(QMainWindow): def __init__(self, filename : str): super(MainWindow, self).__init__() ...
#! usr/bin/activate """AstroThings library: imagination and Universe.""" def main(): pass if __name__ == '__main__': main() __version__ = '0.1.0.dev1'
from unittest import TestCase from tilapia.lib.provider.chains.btc.sdk import transaction class TestTransaction(TestCase): def test_calculate_vsize(self): self.assertEqual(79, transaction.calculate_vsize(["P2WPKH"], [])) self.assertEqual(176, transaction.calculate_vsize(["P2WPKH"], ["P2WPKH", "P2...
from applauncher.event import EventManager, KernelReadyEvent, ConfigurationReadyEvent class TestClass: def test_events(self): em = EventManager() class KernelCounter: c = 0 @staticmethod def inc(event): KernelCounter.c += 1 @static...
from flask_wtf import FlaskForm from wtforms import BooleanField, SelectField, IntegerField from wtforms.validators import Required, Optional from .vcconnect import get_main_area_dropdown, get_service_dropdown, get_client_group_dropdown class OrgSearchForm(FlaskForm): main_area_id = SelectField('Area', ...
from airflow.hooks.base_hook import BaseHook def get_conn(conn_id): # get connection by name from BaseHook conn = BaseHook.get_connection(conn_id) return conn
import sys import torch.nn as nn from net6c import ClusterNet6c, ClusterNet6cTrunk from vgg import VGGNet __all__ = ["ClusterNet6cTwoHead"] class ClusterNet6cTwoHeadHead(nn.Module): def __init__(self, config, output_k, semisup=False): super(ClusterNet6cTwoHeadHead, self).__init__() self.batchn...
import webbrowser import click from ghutil.types import Repository @click.command() @Repository.argument('repo') def cli(repo): """ Open a repository in a web browser """ webbrowser.open_new(repo.data["html_url"])
from __future__ import print_function import os import json from typtop.dbaccess import ( UserTypoDB, get_time, on_wrong_password, on_correct_password, logT, auxT, FREQ_COUNTS, INDEX_J, WAITLIST_SIZE, WAIT_LIST, pkdecrypt, NUMBER_OF_ENTRIES_TO_ALLOW_TYPO_LOGIN, logT, auxT, call_check ) import ty...
#!/usr/bin/env python import argparse import os import sys from functools import partial from glob import iglob as glob from itertools import chain from dautil.IO import makedirs from dautil.util import map_parallel PY2 = sys.version_info[0] == 2 if PY2: import cPickle as pickle else: import pickle __versi...
# -*- coding: utf-8 -*- from scrapy import signals from scrapy.exporters import CsvItemExporter class CompanyListStorePipeline: exporter = None @classmethod def from_crawler(cls, crawler): pipeline = cls() crawler.signals.connect(pipeline.spider_opened, signals.spider_opened) ...
""" :mod:`cookie` ------------- This is a cookie authentication implementation for Pando. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import datetime from .. import auth from ..utils import to_rfc822, utcnow ...
from query_generator.query import Query from utils.contracts import Operator, Schema class UnionOperator(Operator): def __init__(self, schema: Schema, leftSubQuery: Query, rightSubQuery: Query): super().__init__(schema) self._leftSubQuery = leftSubQuery self._rightSubQuery = rightSubQuery ...
#!/usr/bin/python3 from flask import request from modules import simple_jwt from modules.database import get_db_conn # ---------------------------------------- # Check Auth Token before execute request # ---------------------------------------- from server_error import server_error def logged_before_request(): t...
import os import tempfile import re import shutil import requests import io import urllib from mitmproxy.net import tcp from mitmproxy.test import tutils from pathod import language from pathod import pathoc from pathod import pathod from pathod import test from pathod.pathod import CA_CERT_NAME def treader(bytes)...
import zipfile import pandas as pd from datanator_query_python.util import mongo_util from datanator_query_python.config import config as q_conf import os class proteinHalfLives(mongo_util.MongoUtil): def __init__(self, MongoDB, db, collection, username, password, path): super().__init__...
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) h = int(readline()) cnt = 0 if h == 1: print(1) elif h == 2: print(3) else: for i in range(h): if h < 2 ** i: print(cnt) exit() ...
_SCRIPT_VERSION = "Script version: Nuthouse01 - 6/10/2021 - v6.00" # This code is free to use and re-distribute, but I cannot be held responsible for damages that it may or may not cause. ##################### try: # these imports work if running from GUI from . import nuthouse01_core as core from . import nuthou...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name="sio2puppetMaster", version="0.3", packages=find_packages(), install_requires=[], scripts=['scripts/sio2pm-spawndocker'], license="MIT", author="Mateusz Żółtak", author_email="zozlak@zozlak.org" )
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import re, os if not hasattr(__builtins__, 'cmp'): def cmp(a, b): return (a > b) - (a < b) from collections import OrderedDict, namedtuple as NamedTuple from functools import wraps from pkg_resources import parse_version as p...
#!/usr/bin/env python ## # omnibus - deadbits # fullcontact.com ## from http import get from common import get_apikey class Plugin(object): def __init__(self, artifact): self.artifact = artifact self.artifact['data']['fullcontact'] = None self.api_key = get_apikey('fullcontact') s...
NAME='console_broadcast' GCC_LIST=['broadcast']
from pyspark import SparkContext from pyspark.sql import SQLContext from pyspark.sql import SparkSession from pyspark.sql import Row import numpy as np import seaborn as sns import matplotlib.pyplot as plt from pyspark.ml.fpm import FPGrowth if __name__ == "__main__": sc = SparkContext('local', 'arules') s...
#coding:utf-8 #KDD99数据集预处理 #共使用39个特征,去除了原数据集中20、21号特征 import numpy as np import pandas as pd import csv from datetime import datetime from sklearn import preprocessing # 数据标准化处理 #定义KDD99字符型特征转数值型特征函数 def char2num(sourceFile, handledFile): print('START: 字符型特征转数值型特征函数中') data_file=open(handle...
import matplotlib.pyplot as plt import os from pathlib import Path from typing import Union import bilby import redback.get_data from redback.likelihoods import GaussianLikelihood, PoissonLikelihood from redback.model_library import all_models_dict from redback.result import RedbackResult from redback.utils import lo...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads_v4/proto/errors/conversion_action_error.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobu...
#!/usr/bin/env python3 import sys import os import time import docker def error(msg): print(msg, file=sys.stderr) exit(1) def main(): if len(sys.argv) != 2: error(f"{sys.argv[0]} <container_name>") container_name = sys.argv[1] client = docker.from_env() try: container = c...
# ------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # ----------------------------------------------------------------------...
import json from carla.driving_benchmark.results_printer import print_summary with open('../_benchmarks_results/outputs-27/metrics.json') as json_file: metrics_summary = json.load(json_file) train_weathers = [1, 3, 6, 8] test_weathers = [4, 14] print("Printing Data\n") print_summary(metrics_summa...
import json import os.path as osp from glob import glob import numpy as np from nms_cpu import nms_cpu as nms ''' load annotation from BDD format json files ''' def load_annos_bdd(path, folder=True, json_name='*/*_final.json'): print("Loading GT file {} ...".format(path)) if folder: jsonlist = sorted...
import context import sys import pytest from dice import dice from score import scoreCalculate from game.Player import Player from game.score_bracket import score_bracket @pytest.fixture(scope='session') def load_normal_player(): one = score_bracket(250,350,4) two = score_bracket(400,500,3) three = score_b...
import os import random import re import sys DAMPING = 0.85 SAMPLES = 10000 def main(): if len(sys.argv) != 2: sys.exit("Usage: python pagerank.py corpus") corpus = crawl(sys.argv[1]) ranks = sample_pagerank(corpus, DAMPING, SAMPLES) print(f"PageRank Results from Sampling (n = {SAMPLES})") ...
import logging import pandas as pd import numpy as np import glob_utils.file.utils logger = logging.getLogger(__name__) ################################################################################ # Save/Load csv files ################################################################################ def sa...
# Generated by Django 3.1.4 on 2021-05-07 01:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('TFS', '0002_auto_20210507_0656'), ] operations = [ migrations.AlterField( model_name='customerdetail', name='email',...
#-*-coding:utf-8-*- import sys import time from flask import Flask,jsonify app = Flask(__name__) appJSON={ "controller":{ "title":"Speed Dial Squared Up", "rightButton":{ "title":"请求", "click":"${()=>{$dispatch('fetchData')}}" } }, "lifeCircle":{ "vi...
import tensorflow as tf import numpy as np interpreter = tf.lite.Interpreter('models/mobilefacenet.tflite') interpreter.allocate_tensors() def set_input_tensor_face(input): input_details = interpreter.get_input_details()[0] tensor_index = input_details['index'] input_tensor = interpreter.tensor(tensor_ind...
from typing import Sequence from torch import nn class Model(nn.Module): def __init__( self, n_features: int, n_classes: int, units: Sequence[int] = [512], dropout: float = 0.5, ): super().__init__() sizes = [n_features] + list(units) self.hidd...
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2019-02-12 23:07 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): def forwards_func(apps, schema_editor): Menu = apps.get_model("das", "Menu") db_alias = schema_editor.connectio...