text
stringlengths
2
999k
#!/usr/bin/env python3 -B import unittest import os import os.path import hashlib import json import uuid import pprint import inspect from pathlib import Path import warnings from tests import TestSalesPipelineOutput from cromulent import vocab vocab.add_attribute_assignment_check() class PIRModelingTest_Destructio...
class Solution: def countGoodRectangles(self, rectangles: List[List[int]]) -> int: return sorted(Counter([min(l) for l in rectangles]).items(),reverse=True)[0][1]
#!/usr/bin/env python # coding: utf-8 import base64 import datetime import io import logging import os import sys import json import hashlib import unittest import uuid import boto3 import crcmod from botocore.vendored import requests pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # noqa ...
"""Tests for the models in the ``core`` app of the Marsha project.""" from django.core.exceptions import ValidationError from django.test import TestCase from safedelete.models import HARD_DELETE from ..factories import ( ConsumerSiteFactory, ConsumerSiteLTIPassportFactory, PlaylistFactory, PlaylistLT...
############################################################################## # # Copyright (c) 2009 Zope Foundation and Contributors. # All Rights Reserved. # # 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 SOF...
class Article: def __init__(self, url, title, numComments): self.url = url self.title = title self.numComments = numComments self.topComment = '' self.age = 0 self.topCommentNum = 0 self.tag = '' self.img = '' def __init__(self, url): ...
import json import os import pickle import tempfile from contextlib import contextmanager from typing import Any, Generator, Optional, Union import mlflow import numpy as np import pandas as pd import plotly import yaml from matplotlib import pyplot as plt from plotly import graph_objects as go from mlflow_extend imp...
#!/usr/bin/env python3 """Cash donations Read cash donations from a CSV file and write them to the console in Tax Exchange Format (TXF). The requirements of the CSV file are as follows: * The mandatory column names are Date, Payee, and Amount. * Optional column names are Account, Check Number, Memo, and Cate...
#!/usr/bin/env python3 #------------------------------------------------------------- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses t...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
from a10sdk.common.A10BaseClass import A10BaseClass class IpLists(A10BaseClass): """This class does not support CRUD Operations please use parent. :param listname: {"type": "string", "format": "string"} :param hits: {"type": "number", "format": "number"} :param errors: {"type": "number", "format...
#! /usr/bin/python3.7 from src.somfy_controller.somfy.shutter import Shutter
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
# coding: utf-8 """ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ ...
import pyblish.api from reveries import plugins class ValidateMeshNoMoreThan4Sides(pyblish.api.Validator): """Ensure that meshes don't have face that is more than 4 sides To debug the problem on the meshes you can use Maya's modeling tool: "Mesh > Cleanup..." """ order = pyblish.api.ValidatorO...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jun 22 16:54:36 2019 @author: kenny """ import sys sys.path.insert(0, './icface') #from imutils.face_utils import FaceAligner from imutils.face_utils import rect_to_bb import imutils import dlib import cv2 import numpy as np from PIL import Image impor...
# desy_move_verifier.py """Module to implement the DesyMoveVerifier component of the Long Term Archive.""" import asyncio from logging import Logger import logging import os import sys from typing import Any, Dict, Optional from rest_tools.client import RestClient # type: ignore from rest_tools.server import from_en...
import fire import jieba from sacremoses import MosesTokenizer from tqdm import tqdm from transformers import AutoModelForSeq2SeqLM, AutoTokenizer LANG_MAPPING = {"ar": "ara", "vi": "vie", "zh": "cmn_Hant"} NO_PREFIX_LANGS = set(["de", "es", "fr", "hi", "ru"]) def main( infile, model_name="Helsinki-NLP/opus-...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
from Fight import AirTrafficControl as ATC import datetime def main(): roomba_count = 0 end_time = datetime.datetime.now() + datetime.timedelta(minutes=10) t = ATC.Tower() t.initialize(enable_lidar = True, enable_realsense = True) while datetime.datetime.now() < end_time or roomba_count < 10: ...
# Copyright 2017 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 # # Unless required by applica...
#coding:utf-8 # # id: bugs.core_1972 # title: Non-SYSDBA user can change FW mode of database. # decription: # We create common user using Services API and try to establish TWO subsequent connections under his login: # 1) with flag 'forced_write' = 1 and then # ...
import hashlib import threading import string import SocketServer import Crypto.Cipher import Crypto.Random.random import base64 from secret import iv, pk def encrypt(message): return base64.b64encode(Crypto.Cipher.AES.new(pk, Crypto.Cipher.AES.MODE_CFB, iv).encrypt(message)) def check_proof(prefix, proof): ...
""" Check a fasta file to make sure it is correct """ import os import sys import argparse if __name__ == '__main__': parser = argparse.ArgumentParser(description="Check the integrity of a fasta file") parser.add_argument('-f', help='fasta file to check', required=True) parser.add_argument('-o', help='o...
import sys import socket from abc import ABC, abstractmethod from argparse import ArgumentParser from nesta.utils.rabbitmq import RabbitMQClient class Response: def __init__(self, exitcode, data=None, msg=""): assert isinstance(exitcode, int) assert isinstance(msg, str) self.exitcode = exi...
from typing import List, Optional, Type from tortoise.models import Model from tortoise import fields, Tortoise, run_async from tortoise.signals import pre_delete from tg_bot.loader import bot from tg_bot.messages import MESSAGES class Flight(Model): number = fields.CharField(max_length=12, null=True, blank=Tru...
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ..brainsuite import Dfs def test_Dfs_inputs(): input_map = dict( args=dict(argstr='%s', ), curvatureWeighting=dict( argstr='-w %f', usedefault=True, ), environ=dict( nohash=True, ...
from sqlalchemy import exists from starlette import status from common.exceptions import MethodNotAllowedError from common.storage import StorageS3 from common.utils import get_logger from common.views import BaseHTTPEndpoint from modules.podcast import tasks from modules.podcast.episodes import EpisodeCreator from mo...
import scipy.stats as st import numpy as np import pandas as pd class CI: def one_proportion(self, n, phat, conf): z_val = st.norm.ppf(1 - (1 - conf) / 2) # this is two-side # z_val = st.norm.ppf(1 - (1 - conf)) # this is one-side se = np.sqrt(phat*(1-phat)/n) print('z-value=', z_va...
from copy import deepcopy class CSP: def __init__(self, graph): self.graph = graph def checkWholeGraph(self): for node in self.graph: if not self.checkNodeConstraints(node): return False return True def checkNodeConstraints(self, node): constr...
import django_filters from extrequests.models import ( EventRequest, EventSubmission, DCSelfOrganizedEventRequest, ) from workshops.fields import Select2Widget from workshops.filters import ( AMYFilterSet, StateFilterSet, ForeignKeyAllValuesFilter, AllCountriesFilter, ) from workshops.model...
import time import tensorflow as tf physical_devices = tf.config.experimental.list_physical_devices('GPU') if len(physical_devices) > 0: tf.config.experimental.set_memory_growth(physical_devices[0], True) from absl import app, flags, logging from absl.flags import FLAGS import core.utils as utils from core....
from django.contrib import admin from .models import Animal @admin.register(Animal) class AnimalAdmin(admin.ModelAdmin): pass
import _plotly_utils.basevalidators class StreamValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name='stream', parent_name='scatter3d', **kwargs ): super(StreamValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_...
""" Title: Team Lig)htning EV3 Printer Code Generator Author: Ben Dodd (mitgobla) Co-Author: Thomas Woodthorpe (lonewolfdesign) Email: ben-dodd@outlook.com Website: http://www.team-lightning.ga Each position has 4 values: x: the x coordinate y: the y coordinate z: the z coordinate c: z hop 4: ...
''' Copyright (c) 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause ''' import unittest import subprocess from classes.docker_image import DockerImage from utils.container import docker_command from utils.container import pull from utils.container import check_image class TestClassDockerI...
import logging import os import random import subprocess import numpy as np import torch import torch.distributed as dist import torch.multiprocessing as mp from mmcv.runner import get_dist_info def init_dist(launcher, backend='nccl', **kwargs): if mp.get_start_method(allow_none=True) is None: mp.set_sta...
from typing import Any, Sequence, Tuple, cast, TypeVar, Dict from scipy.stats import mode from numpy.typing import NDArray def windowed_mean( array: NDArray[Any], window_size: Tuple[int, ...], **kwargs: Dict[Any, Any] ) -> NDArray[Any]: """ Compute the windowed mean of an array. """ reshaped = res...
"""Utilities to generate or map labels for nodes and graphs.""" from types import FunctionType from ..abstract import AbstractValue from ..info import DebugInfo from ..ir import MetaGraph from ..ir.anf import ANFNode, Graph from ..operations import Operation, Primitive from ..utils import ( EnvInstance, Hand...
from copy import deepcopy import torch from torch import nn from onnx2torch.node_converters.registry import add_converter from onnx2torch.onnx_graph import OnnxGraph from onnx2torch.onnx_node import OnnxNode from onnx2torch.utils.common import OnnxToTorchModule from onnx2torch.utils.common import OperationConverterRe...
# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
#! /usr/bin/env python3 import json def generateGenres(): with open('top_250_by_rating.json', encoding="utf-8") as f: data = json.load(f) genreList = [] counter = 0 for i in data['results']: genreList.append(data['results'][counter]['genres']) counter += 1 newList =...
# #FIRST ITERATION # import csv # # Open and parse CSV file # csvfile = open('/Users/thomasmulhern/new_desk/post_7:6:18/learning/add_learning/jonathan_dinu/\ # data-science-fundamentals/code/data/airbnb/seattle_reviews_01_04_2016.csv', newline='') # csvreader = csv.reader(csvfile) # header = next(csvreader) # records...
import re class Key(object): "Key used in keycards and locks" pass class KeyCard(object): "Keycard used to open a lock" def __init__(self, first_key, second_key): """ Constructs a KeyCard with the given keys Args: first_key: in the keycard to be created ...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
from base64 import * def dec(msg): msg = msg.replace("$eNcRYpt3D$"," ") msg = msg.split(" ") txt = [] for i in (msg): try: txt.append(chr(int(i))) except: continue txt = ''.join(txt) + "=" txt = b64decode(txt) txt = txt[::-1] return txt if __nam...
''' This Package runs the Saachi API ''' from flask import Flask , jsonify , request import stream_tweets import base64 import recognize import os import uuid from werkzeug.datastructures import ImmutableMultiDict from elasticsearch import Elasticsearch from json import dumps from flask_cors import CORS app = Flask...
from setuptools import setup with open("README.md", 'r') as f: long_description = f.read() setup( name='Facextractor', version='1.0.2', description='Facebook Data Extractor, simple tool for read and analyze facebook dump (JSON format)', author='Jakub Janeček', author_email='jakub.janecek@fw-...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="nobel_winners", version="0.0.1", author="Xing Luo", author_email="xing-luo@outlook.com", description="A small example package", long_description=long_description, long_description...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :mod:`gyroscope` ================== Created by hbldh <henrik.blidh@nedomkull.com> Created on 2016-04-26 """ from __future__ import division from __future__ import print_function from __future__ import absolute_import import time from pymetawear.discover import sele...
# -*- coding: utf-8 -*- ''' The networking module for RHEL/Fedora based distros ''' # Import python libs import logging import os.path import os import StringIO # Import third party libs import jinja2 import jinja2.exceptions # Import salt libs import salt.utils import salt.utils.templates import salt.utils.validate...
import numpy as np import torch from torch import nn, optim from torchvision import datasets, transforms, models import argparse resnet50 = models.resnet50(pretrained=True) alexnet = models.alexnet(pretrained=True) vgg16 = models.vgg16(pretrained=True) models = {'resnet': resnet50, 'alexnet': alexnet, 'vgg': vgg16} ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-16 22:59:56 import sys import six import time import logging import traceback logger = logging.getLogger("processor") from six.moves import queue ...
# -*- coding: utf-8 -*- """Enigma Machine This script aims to simulate the old machine used in World War II called Enigma. Enigma was an electromechanical encryption machine with rotors, used both to encrypt and to decrypt war codes, used in various forms in Europe since the 1920s. Its fame comes from having been a...
import numpy as np import pytest from astropy import constants from astropy import units as u from plasmapy.formulary.magnetostatics import ( CircularWire, FiniteStraightWire, GeneralWire, InfiniteStraightWire, MagneticDipole, ) mu0_4pi = constants.mu0 / 4 / np.pi class Test_MagneticDipole: ...
from numpy.testing import * import numpy.core.umath as ncu import numpy as np class TestDivision(TestCase): def test_division_int(self): # int division should return the floor of the result, a la Python x = np.array([5, 10, 90, 100, -5, -10, -90, -100, -120]) assert_equal(x / 100, [0, 0, 0,...
class Solution(object): def isHappy(self, n): x = n inLoop = set() while x not in inLoop : inLoop.add(x) sumX = 0 while x > 0: sumX += (x % 10) ** 2 x //= 10 if sumX == 1 : return True x = sumX ...
__title__ = "Flask-State" __version__ = "1.0.5" __description__ = "A visual plug-in for displaying native state through echarts for browser." __url__ = "https://github.com/yoobool/flask-state" __author__ = "Yoobool" __author_email__ = "yhl@uuchat.io" __maintainer__ = "Yoobool" __license__ = "BSD-3"
# """ """ # end_pymotw_header import zlib original_data = b"This is the original text." template = "{:>15} {:>15}" print(template.format("len(data)", "len(compressed)")) print(template.format("-" * 15, "-" * 15)) for i in range(5): data = original_data * i compressed = zlib.compress(data) highlight = "...
import PIL.Image from cStringIO import StringIO import IPython.display import numpy as np def showarray(a, fmt='png'): a = np.uint8(a) f = StringIO() PIL.Image.fromarray(a).save(f, fmt) IPython.display.display(IPython.display.Image(data=f.getvalue()))
import pytest from inventory_control import storage def get_config(): """ Create my simple localhost config :return: """ config = {'host': 'localhost', 'user': 'wce', 'password': 'thispasswordisobjectivelyterrible', 'db': 'inventory_control'} return config def te...
# Copyright 2015 TellApart, 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 writi...
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # <img align="right" src="images/tf.png" width="150"/>...
from sympy import Rational as frac from ..helpers import book from ._helpers import QuadrilateralScheme, concat, symm_s, symm_s_t citation = book( authors=["Joseph Oscar Irwin"], title="On quadrature and cubature", publisher="Cambridge University Press", year="1923", url="https://books.google.de/b...
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License") as published by the Apache Software Foundation. # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at...
arg_dict = { 'initial_reward' = 0, 'initial_agent_x' = 200, 'initial_agent_y' = 600, 'agent_r' = 40, 'gold_r' = 10, 'initial_gold' = [[600, 300], [603, 307], [595, 301], [597, 296]], 'walls' = [ [0, 0, 50, 800, 0], [0, 0, 800, 50, 0], [0, 800 - 50, 800, 50, 0], # I know it's 750, doing this for clarity [800 - 50, 0, ...
""" Copyright 2020 The OneFlow 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 applicable law or agr...
# -*- coding: utf-8 -*- # # Copyright 2017-2020 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
# -*- coding: utf-8 -*- DATA_BACKEND = 'datastore' PROJECT_ID = 'campus-information-bot'
from django.db import models from datetime import datetime, date class Manufacturer(models.Model): name = models.CharField(max_length=200) country = models.CharField(max_length=10, blank=True, null=True) url = models.CharField(max_length=2000, null=True, blank=True) wiki_url = models.CharField(max_length=2000, bla...
from flask import Blueprint, render_template from config.config import mongo from views.data import DataHarvest, DataContainer from views.figures import ContainerFigures, HarvestFigures dmod = Blueprint('dashboard', __name__) @dmod.route('/') def index(): dh = DataHarvest(mongo.db.harvest) gf = HarvestFigure...
import logging import os import signal import toml from typing import Dict import sys import netCDF4 from lxml import etree from saltswap.wrappers import Salinator from simtk import openmm as mm, unit from tqdm import trange from .. import app from ..app import log, NCMCProtonDrive from ..app.proposals import UniformS...
# Copyright 2019 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, ...
import torch import torchvision from torchvision import transforms import os import numpy as np import argparse def get_relative_path(file): script_dir = os.path.dirname(__file__) # <-- absolute dir the script is in return os.path.join(script_dir, file) def load_dataset(dataset='cifar10', datapath='cifar10/...
""" Script uses custom libraries to download an image from a url (jsonable link) and set as wallpaper for Gnome3 DE. """ import subprocess from os import path import sys from Logger import Logger from utils import utils from image_actions import ImageOps #URL= "https://www.reddit.com/r/ComicWalls.json" #URL = "https:/...
# Python code for Binary Search Tree using Array bst = [None for i in range(10000)] # Empty Array for tree i = 1 # To store index to which data is last inserted # function to add an element def insert(data): global bst # if bst is empty add root node if bst[1] == None: bst[1] = data # Tr...
import boto3 import pandas as pd import numpy as np import os import pickle from sklearn.metrics import accuracy_score import json client = boto3.client('sagemaker-runtime') ENDPOINT_NAME = os.environ.get('ENDPOINT_NAME') CONTENT_TYPE = 'application/python-pickle' test_data = pd.read_csv('./models/test.csv', header...
"""watch URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/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 v...
# Classification (U) """Program: setup.py Description: A setuptools based setup module. """ # Libraries and Global Variables # Standard import os import setuptools # Third-party # Local import version # Read in long description from README file. here = os.path.abspath(os.path.dirname(__file__)) with ope...
from __future__ import absolute_import import hashlib import hmac from django.contrib import messages from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from uuid import uuid1 ...
{% if cookiecutter.plugin_hasCeleryTasks == 'Y' or cookiecutter.plugin_hasCeleryTasks == 'y' -%} from formshare.config.celery_app import celeryApp from formshare.config.celery_class import CeleryTask import time @celeryApp.task(base=CeleryTask) def plugin_task(): time.sleep( 30 ) # Just to test that ...
#!/usr/bin/env python # coding: utf-8 # In[7]: import csv import matplotlib.pyplot as plt import pandas as pd from sqlalchemy import create_engine # In[8]: engine = create_engine('postgres://aruns2@mlpolicylab.db.dssg.io:5432/bills3_database') # In[5]: #test command sql = "SELECT status_id FROM catalogs.bill...
from typing import Dict, Optional from great_expectations.core.expectation_configuration import ExpectationConfiguration from great_expectations.execution_engine import ExecutionEngine from great_expectations.expectations.expectation import TableExpectation from great_expectations.expectations.util import render_evalu...
"""Warnings raised by the library. """ class ProntoWarning(Warning): """The class for all warnings raised by `pronto`. """ pass class NotImplementedWarning(ProntoWarning, NotImplementedError): """Some part of the code is yet to be implemented. """ pass class UnstableWarning(ProntoWarning...
############################################################################### # # Relationships - A class for writing the Excel XLSX Worksheet file. # # Copyright 2013-2021, John McNamara, jmcnamara@cpan.org # # Package imports. from . import xmlwriter # Long namespace strings used in the class. schema_root = 'http...
""" Modify the tips example to make it robust to outliers. Try with one shared for all groups and also with one per group. Run posterior predictive checks to assess these three models. """ import pandas as pd import random from pandas import DataFrame, Series import matplotlib.pyplot as plt import arviz as az import py...
import numpy as np import torch import torchvision.transforms as transforms from PIL import Image from attrdict import AttrDict from sklearn.externals import joblib from torch.utils.data import Dataset, DataLoader from imgaug import augmenters as iaa from functools import partial from itertools import product import mu...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 Rackspace Hosting # 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.apach...
''' Project: SSITH CyberPhysical Demonstrator Name: beamng_outgauge_to_arduino_speedometer.py Author: Kristofer Dobelstein Date: 18 August 2020 Python: 3.8.3 O/S: Windows 10 This routine is a bridge between BeamNG's Outgauge socket and an Arduino Micro- based Smartcar speedometer. It provides the following functional...
# Copyright 2019 The Android Open Source Project # # 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 ag...
import requests import json from briefmetrics.lib.http import assert_response COLLECT_URL = 'https://heapanalytics.com/api/track' COLLECT_SESSION = requests.Session() def collect(app_id, identity=None, event=None, properties=None, http_session=COLLECT_SESSION): """ $ curl \ -X POST \ -H "Con...
# from resolve import resolve #################################### #################################### # 以下にプラグインの内容をペーストする # import sys from io import StringIO import unittest class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys.stdin sys.stdout...
import pickle from typing import List import pytest from pydantic import BaseModel class Model(BaseModel): a: float b: int = 10 def test_simple_construct(): m = Model.construct(dict(a=40, b=10), {'a', 'b'}) assert m.a == 40 assert m.b == 10 def test_construct_missing(): m = Model.constru...
from scp import user import os __PLUGIN__ = 'DirectLink' __DOC__ = str( user.md.KanTeXDocument( user.md.Section( 'upload files to anonfiles.com', user.md.SubSection( 'upload a file', user.md.Code('(*prefix)uploadFile {replyMedia}'), ), ...
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
""" free mt_services """ from typing import Dict FREEMT_SERVICES = dict( sogou_tr="sogou_tr", bing_tr="bing_tr", google_tr="google_tr", # github version based on gltr xiaoniu_tr="xiaoniu_tr", # googlecn='googlecntr', # gapis='googleapis_translate', # ** tier 2 ** promt_tr="promt_tr", ...
# -*- coding: utf-8 -*- """ =============================================== D02 - Burning Ship arbitrary-precision explorer =============================================== This is a template to explore the Burning Ship set with arbitrary precision through a GUI. It features the main postprocessing options (continuous ...
from rest_framework.renderers import JSONRenderer from rest_framework.views import exception_handler import logging from django.db import DatabaseError from redis.exceptions import RedisError from rest_framework.response import Response from rest_framework import status as s logger = logging.getLogger('djlogger') d...
class Solution(object): def maxProfit(self, prices): """ :type prices: List[int] :rtype: int """ max_profit = 0 min_price = 200000 for value in prices: if value - min_price > max_profit: max_profit = value - min_price if...