content
stringlengths
5
1.05M
"""PGU is a collection of modules for writing games with PyGame. * gui - A module for creating widget-based interfaces """ __version__ = '0.16'
import pygame from engine.app import get_screen from engine.cache import get_sheet, get_sheet_name, get_mask from engine.utils import Rect, Point, parse_rect, parse_float from engine.subsheet import Subsheet import json import os #EXPORT class Sprite(object): def __init__(self, surface, rect, duration=0.0): ...
class BrandNotFound(Exception): pass
#!/usr/bin/env python # -*- coding: utf-8 -*- import re regexes = { re.compile("(?<!album)artist"): "artist", # artist but not albumartist re.compile("title"): "title", re.compile("album(?!artist)"): "album", # album but not albumartist re.compile("genre"): "genre", re.compile("((?<!tagging)(?<!ri...
import jwt from core import config def jwt_decoder(token: str) -> dict: decode_token = jwt.decode(jwt=token, key=config.JWT_SECRET_KEY, algorithms=config.JWT_ALGORITHM) return decode_token
# 3. Реализовать программу работы с органическими клетками, состоящими из ячеек. Необходимо создать класс Клетка. # В его конструкторе инициализировать параметр, соответствующий количеству ячеек клетки (целое число). В классе должны # быть реализованы методы перегрузки арифметических операторов: сложение (add()), вычит...
import numpy as np def disp(D, L, u, t): """ Calculate the 1-D continuum dispersion model for RTD. Parameters ---------- D = dispersion coefficient L = characteristic mixing length u = average fluid velocity t = time vector Returns ------- et = residence time distribution...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import unittest try: import contracts have_contracts = True except ImportError: have_contracts = False import pure_contracts if have_contracts: class IPlant(pure_contracts.Contrac...
#!/usr/bin/env python # helpers for test commands from random import * import os import sys import time from pprint import pprint def generate_output(sample_text_file, prefix, sleep) : """ a test command that generates a know output with random delays between lines so that process switching can happen" """ d...
from werkzeug.routing import BaseConverter from flask import request from flask import session from flask import url_for def test_custom_converters(app, client): class ListConverter(BaseConverter): def to_python(self, value): return value.split(",") def to_url(self, value): ...
# -*- coding: utf-8 -*- import logging from django.test.client import Client from networkapi.test.test_case import NetworkApiTestCase log = logging.getLogger(__name__) class EnvironmentTestCase(NetworkApiTestCase): def setUp(self): self.client = Client() def tearDown(self): pass def ...
import matplotlib.pyplot as plt import location_data_query as ldq def main(): end = ldq.now_ms() start = end - (8 * 60 * 60 * 1000) tag_id = 20001 # apply a moving average window to each axis then sum the each averaged axis back into one point moving_average = False # the window size of the...
class Solution: def gcdOfStrings(self, str1: str, str2: str) -> str: if len(str1) < len(str2): str1, str2 = str2, str1 m = len(str1) n = len(str2) if n == 0 or str1[0] != str2[0]: return '' def gcd(a, b): r = a % b if r == 0: ...
# coding=utf-8 from django import forms """This is the form users can fill out to send a help email. """ class HelpEmailForm(forms.Form): PROBLEM_CHOICES = ( ('EMR Help: Medical Question', 'Tengo una pregunta médica'), ('EMR Help: Program Question', 'Tengo una pregunta sobre este pro...
""" When this program starts, Python first imports the random muodule. The the getAnswer() function is defined. Because this function is being defined (and not called), the execution skips over the code in it. Next, the random.randint() function is called with two arguments, 1 and 9. It evaluates to a random integer be...
# -*- coding: utf-8 -*- """plx module.""" from __future__ import unicode_literals import os import re import pydoc from pyloco.task import Task from pyloco.error import UsageError from pyloco.util import parse_param_option, pyloco_formatter, system, pyloco_import from pyloco.base import pyloco_builtins _pat_section...
# https://nanonets.com/blog/ocr-with-tesseract/ import cv2 import pytesseract image = cv2.imread('image_texto_teste.png') (h,w) = image.shape[:2] string= pytesseract.image_to_string(image) print(f'String in image:\n{string}') boxes = pytesseract.image_to_boxes(image) # Detection characteres # for box in boxes.split...
__all__ = [ "AppConfig", "Lockfile", "Counter", "Timer", "IntervalTimer", "LogDBHandler", "SubProcess" ] from .AppConfig import AppConfig from .Counter import Counter from .IntervalTimer import IntervalTimer from .Lockfile import Lockfile from .LogDBHandler import LogDBHandle...
# Generated by Django 2.1.7 on 2019-06-25 00:58 from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("app", "0010_auto_20190625_0053"), ] operations =...
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 ...
class Ninja: def __init__(self, rival='TOASTY'): self.costume_color = 'red' self.ability_type = 'telekinesis' self.fatality = "telekinetic desintegration" self.special = "error macros" def describe_fighter(self): print("Ninja in", self.costume_color.upper(), "is ready to...
import sys import paho.mqtt.client as mqtt import datetime import json import binascii import struct VERSION_MAINPROG = 'V0.32--20190930--config-mqtt-topic' show_mesg = [ VERSION_MAINPROG, 'V0.32--20190927--locate-bems', 'V0.31--20190923--{}.format()', 'V0.30--20190922--print 5 value', "=20190921= V0.3 subscreen", ...
from behave import * from e2e.common.tools import * from lto.transactions import Anchor import random def anchor(context, user="", hash="", sponsor="", version=None): if not user: account = ROOT_ACCOUNT else: account = context.users[user] if not hash: hash = ''.join(random.choice(...
import numpy as np import pandas as pd def merge_consortia(data): """ :param data: pandas.DataFrame. The intermediate astrometric data for a Hipparcos 1 source. :return: merged_data: pandas.DataFrame. The input data with merged residuals, errors, sin(scan_angle), cos(scan_angle), epochs etc. The r...
class Solution: def generateMatrix(self, n): """ :type n: int :rtype: List[List[int]] """ layers = (n + 1) // 2 result = [[0 for _ in range(n)] for _ in range(n)] num = 1 for l in range(layers): # top for i in range(l, n-l-1):...
#!/usr/bin/python3 ''' (C) Copyright 2018-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent ''' from cart_utils import CartTest class CartRpcOneNodeTest(CartTest): # pylint: disable=too-few-public-methods """Run basic CaRT RPC tests. :avocado: recursive """ def test_cart_...
from django.core.management.base import BaseCommand from imageXback.models import Image class Command(BaseCommand): def handle(self, *args, **options): Image.objects.all().delete()
# -*- coding: utf-8 -*- """ This package implements various parameterisations of properties from the litterature with relevance in chemistry. """ from __future__ import (absolute_import, division, print_function)
from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect, get_host from django.template import RequestContext from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from djang...
from discord.ext import commands import random import discord class smile: def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def smile(self, context, member: discord.Member): """smile for everyone!""" author = context.message.author.menti...
from . import mixins from . import jwt from rest_framework import viewsets, status, mixins as mx from rest_framework.response import Response from rest_framework.decorators import action from algolab_class_API import models, serializers from django.contrib.auth.models import User class CourseAdminViewSet(mixins.Ver...
# Copyright 2022 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, ...
import datetime,time,os,sys,requests,json if (sys.platform.lower().startswith('linux')): OS_TYPE = 'linux' elif (sys.platform.lower().startswith('mac')): OS_TYPE = 'macintosh' elif (sys.platform.lower().startswith('win')): OS_TYPE = 'windows' else: OS_TYPE = 'invalid' # Get our current directory OUTPU...
# Copyright (c) 2016-2021 The Regents of the University of Michigan # This file is part of the General Simulation Data (GSD) project, released under # the BSD 2-Clause License. """The GSD main module. The main package :py:mod:`gsd` is the root package. It holds submodules and does not import them. Users import the mo...
from setuptools import setup, find_packages with open("README.md", "r") as fp: long_description = fp.read() setup( name='cpyke', version='1.0', url='https://github.com/tbennun/cpyke', author='Tal Ben-Nun', author_email='tbennun@gmail.com', description='Easy integrated Python scripting embe...
import torch from tsl.nn.layers.graph_convs.diff_conv import DiffConv from tsl.nn.blocks.encoders.gcrnn import _GraphGRUCell, _GraphRNN class DCRNNCell(_GraphGRUCell): """ Diffusion Convolutional Recurrent Cell. Args: input_size: Size of the input. output_size: Number of units in the h...
# -*- coding: utf-8 -*- import os import unittest import codecs import datetime from decimal import Decimal CURRENT_DIR = os.path.dirname(__file__) class TVATestCase(unittest.TestCase): def test_solde_comptes_de_tva(self): from colbert.tva import solde_comptes_de_tva # Produits divers pour équi...
import logging import treefiles as tf from MeshObject import Mesh from FractalTree.network import PurkinjeMesh def main(): m = Mesh.Sphere(theta_res=5, phi_res=5) m = PurkinjeMesh(m.data) d = m.compute_distances() m.addPointData(d, "distances") m.plot(scalars="distances") if d[0] == 0 and d[...
import sqlite3 from features.support.simple_result import SimpleResult from features.support.query_result import QueryResult class Sqlite: connection_pool = {} def __init__(self): self.database_filename = '' self.sql = '' self.field_name = '' def query(self, field_name=''): ...
#!/usr/bin/pyton # Copyright 2011 Lockheed Martin ''' Created on Mar 10, 2011 Base model class for learning registry data model @author: jpoyau ''' from base_model import createBaseModel, ModelParser, \ defaultCouchServer, appConfig from pylons import * import datetime, logging lo...
"""Osparc Control.""" from .core import PairedTransmitter from .models import CommandManifest from .models import CommandParameter from .models import CommandRequest from .models import CommandType __all__ = [ "PairedTransmitter", "CommandManifest", "CommandParameter", "CommandRequest", "CommandTyp...
import argparse import fileinput import io import json import logging import math import os import re import time from monero_poc.tools.mem_cmp import MemReader import coloredlogs logger = logging.getLogger(__name__) coloredlogs.CHROOT_FILES = [] coloredlogs.install(level=logging.INFO, use_chroot=False) TICKS_PER_...
# Copyright 2010-2019 Dan Elliott, Russell Valentine # # 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...
"""Handle Home Assistant requests.""" import logging from typing import Dict, Optional, Generator import requests from .options import Options _LOGGER = logging.getLogger(__name__) class HomeAssistant: """Handle Home Assistant API requests.""" def __init__(self, options: Options): """Initialize Ho...
import sys from abc import ABC from functools import lru_cache from mlib.boot.crunch import PipelineSection from mlib.boot.lang import listkeys from mlib.boot.mlog import err from mlib.caches import permacache from mlib.obj import SuperRunner from mlib.shell import input_while class ShellProject(SuperRunner, ABC): ...
import sys from bvTree import bvNode class bvNodeTest(bvNode) : def __init__(self, func): super(bvNode, self).__init__(func) def testAddAnimations(self): self.addChildLast(singleAnimation1) self.addChildLast(singleAnimation2) self.addChildLast(singleAnimation3) sel...
from Tkinter import * from ttk import Style, Label # own files from main import * from my_globals import my_globals as gbl class error_window(Frame): def __init__(self, parent): Frame.__init__(self, parent) self.parent = parent self.initUI(parent) def initUI(self,parent): self.style = Style () se...
from abc import ABCMeta, abstractmethod from calchas_datamodel import AbstractExpression from calchas_datamodel.dummy import DummyGen class Transformation(metaclass=ABCMeta): @abstractmethod def set_pre_and_suffix(self, dummy_gen: DummyGen): pass @abstractmethod def apply(self, tree: Abstract...
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from tensorflow.contrib.tpu.profiler import tpu_profiler_pb2 as tensorflow_dot_contrib_dot_tpu_dot_profiler_dot_tpu__profiler__pb2 class TPUProfilerStub(object): """The TPUProfiler service retrieves performance information about th...
# @package sbol # A Python wrapper for libSBOLc, a module for reading, writing, and constructing # genetic designs according to the standardized specifications of the Synthetic Biology Open Language # # @file sbol.py # Implements a high-level, Pythonic interface for the SWIG-Python classes in libsbol # # @namespace sbo...
#!/usr/bin/env python3 # Copyright 2018 Cheonbok Park """ @title :utils/self_attention_layer.py @author :ch @contact :henningc@ethz.ch @created :02/21/2019 @version :1.0 @python_version :3.6.6 This function was copied from https://github.com/heykeetae/Self-Attention-GA...
#2 # # nosetests --with-coverage --cover-erase --cover-package=flask_encryptedsession --cover-html # nosetests -v
"""IO Functions for tables_io""" import os from collections import OrderedDict import numpy as np from .lazy_modules import pd, pq, h5py, apTable, fits from .lazy_modules import HAS_TABLES, HAS_HDF5 from .arrayUtils import getGroupInputDataLength from .types import ASTROPY_FITS, ASTROPY_HDF5, NUMPY_HDF5, NUMPY_FIT...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import sys import torch import torch.nn as nn import torch.nn.functional as F class MLECriterion(nn.Module): ''' Class to define loss give input, model output and groundtruth ''' def __init__(self, opt, module): supe...
# run on your system # new file #test import socket import requests import threading import json import datetime import time import netifaces as ni import random import pymongo import hashlib from blockchain import Blockchain import sys import _thread ip = "http://192.168.43.168:5000" page = "/ul" login_p = '/logi'...
from policies import * from endpoint_waker import EndpointWaker POLICIES = ['round robin', 'weighted round robin', 'least connection', 'weighted least connection', 'fixed weighting', 'randomized static'] MAX_ARGUMENTS = 2 NUMBER_OF_REQUESTS_IDX = 1 class LoadBalancer(): def __init__(self, cfg): self.host ...
from pathlib import Path from evaluate.utils import * def test_stripExtensions_noExtensionsReturnsSameAsInput(): path = Path("path/to/foo") actual = strip_extensions(path) expected = path assert actual == expected def test_stripExtensions_oneExtensionReturnsInputWithoutExtension(): path = Path...
import datetime import os import sys import time from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys date = datetime.datetime.now().strftime("%Y%m%d%H%M%S%f") # Do an action on the app's landing page options = Options() options.add_argu...
""" :codeauthor: Rupesh Tare <rupesht@saltstack.com> """ import os.path import salt.modules.devmap as devmap from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, patch from tests.support.unit import TestCase class DevMapTestCase(TestCase, LoaderModuleMockMixin): ...
import asyncio from functools import partial, wraps from typing import Any, Callable, Dict, List def async_function(func: Callable[..., Any]) -> Callable[..., Any]: @wraps(func) async def run(*args: List[Any], **kwargs: Dict[str, Any]) -> Any: loop = asyncio.get_event_loop() pfunc = partial(fu...
/usr/lib64/python3.4/fnmatch.py
""" File: mouse_draw.py Name: ------------------------ This file shows how to use campy mouse event to draw GOval """ from campy.graphics.gobjects import GOval from campy.graphics.gwindow import GWindow from campy.gui.events.mouse import onmousedragged, onmouseclicked # This constant controls the size of the pen stro...
from .classifier_config import * from .regressor_config import * from .time_config import * from .tuner import *
import shlex from nephele import epic_games_store, kijiji, telegram, textnow from nephele.command import Command def handler(event, context=None): try: command = shlex.split(event["text"])[0] except Exception: telegram.send_invalid_command_message(event) raise if event.get("is_sc...
import I2CMultiplexer import VL53L1X import time def multi_i2c_test(): #Create an I2C Multiplexer object, the address of I2C Multiplexer is 0X70 I2CMulti = I2CMultiplexer.I2CMultiplexer(0x70) #I2CMulti.selectPort(2) tof = VL53L1X.VL53L1X() #print("Sensor N has address: 0x29") for i in [0,1,2,3,7]: I2CMulti...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from open_spiel.python.games.optimal_stopping_game_config import OptimalStoppingGameConfig from open_spiel.python.games.optimal_stopping_game_observation_type import OptimalStoppingGameObserv...
# -*- coding: utf-8 -*- # (c) 2017 Andreas Motl <andreas@ip-tools.org> import celery from uspto.oac.client import UsptoOfficeActionCitationsClient from uspto.util.tasks import GenericDownloadTask, AsynchronousDownloader class UsptoOfficeActionCitationsDownloadTask(GenericDownloadTask): name = 'uspto.oac.tasks.Uspt...
from struct import pack, unpack from enum import IntEnum from ..command_packet import CommandPacket class HCI_LE_Set_Address_Resolution_Enable(CommandPacket): class EnableStatus(IntEnum): Disable = 0 Enable = 1 def __init__(self): # TODO generate cmd super().__init__() ...
# Draw a spirograph pattern # converted from version at: # www.101computing.net/python-turtle-spirograph/ from ifm import * from math import cos,sin,pi def get_rots(nR,nr): # Calculate number of rotations of # inner circle around large circle n=1 while n*nR/nr!=int(n*nR/nr): n+=1 return ...
# ======================================================================== # Copyright 2018 ELIT # # 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 csvinput import CSVInput from image import read_png
########################################################################## # # Copyright (c) 2019, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Aug 31 20:03:16 2020 @author: G.S. Verhoeven """ import numpy as np class Beleidsmedewerker: """ Exercise Classes & Inheritance. 1. Maak een class Beleidsmedewerker, met attributen naam, leeftijd, en afdeling. 2. Maak een method verjaardag() die d...
""" Hekr Protocol - Python Bindings """ from .command import * from .const import * from .device import * from .exceptions import * from .protocol import *
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sponsor', '0012_auto_20160203_0051'), ] operations = [ migrations.RenameField( model_name='sponsoring', ...
class NativeWindow(MarshalByRefObject, IWin32Window): """ Provides a low-level encapsulation of a window handle and a window procedure. NativeWindow() """ def AssignHandle(self, handle): """ AssignHandle(self: NativeWindow,handle: IntPtr) Assigns a handle to this window. ...
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tests control of OMAP Muxes for beaglebone devices.""" import __builtin__ import mox import os import unittest import bbmux_controller FAKE_MUX_F...
# MIT License # # Copyright (c) 2018 Airthings AS # # 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 limitation the rights # to use, copy, modify, merge,...
import time from queue import Queue from threading import Thread from ctools.utils import LockContext, LockContextType class Cache: r""" Overview: data cache for reducing concurrent pressure, with timeout and full queue eject mechanism Interface: __init__, push_data, get_cached_data_iter,...
#Author: Miguel Molero <miguel.molero@gmail.com> from matplotlib import mlab from scipy.interpolate import griddata def natural_neighbor(x,y,z,xi,yi): """ Natural Neighbor Interpolation Method. Natural neighbor interpolation is a method of spatial interpolation, developed by Robin Sibson. The method...
import numpy as np import pandas as pd import hydrostats.data as hd import hydrostats.visual as hv import HydroErr as he import matplotlib.pyplot as plt import os from netCDF4 import Dataset # ***************************************************************************************************** # **************ERA Inte...
#!/bin/python from __future__ import print_function import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from operator import itemgetter from os import listdir from os.path import isfile, join latencyLogger = "fi.aalto.dmg.statistics.Latency" # "HH:mm:ss,SSS" to milliseconds def to_millis...
from kivy.uix.screenmanager import Screen from kivy.lang import Builder from kivy.properties import ObjectProperty, NumericProperty from kivy.uix.gridlayout import GridLayout from kivy.uix.label import Label from kivy.uix.image import Image from kivy.metrics import sp from kivy.app import App from kivy.utils import pla...
#importing module import sys from os import system from time import sleep from random import choice from pyfiglet import figlet_format from termcolor import colored #arguments config_arg = sys.argv[1] config_type = sys.argv[2] config_value = sys.argv[3] count_arg = (len(sys.argv)-1) #config [Change this] name = "feli" ...
import threading import mathutils import time import serial import bpy from bpy_extras import view3d_utils from bpy.props import * #https://www.blender.org/api/blender_python_api_2_63_17/bpy.ops.html #CmdActions.parse("rotate_0_0.1") #bpy.ops.transform.rotate("INVOKE_DEFAULT") #bpy.ops.transform.rotate...
import os from twisted.python import usage, runtime, filepath, log from twisted.application import service from twisted.internet import defer, reactor, protocol from foolscap.api import Referenceable class BadServiceArguments(Exception): pass class UnknownServiceType(Exception): pass class BaseOptions(usage....
import numpy as np from ..Tools.Downloading._DeleteDate import _DeleteDate from . import _SST def DeleteDate(Date,sc,Prod,L,Confirm=True): ''' delete all of the files from a given date ''' idxfname = _SST.idxfname.format(Prod,L,sc) datapath = _SST.datapath.format(Prod,L,sc) _DeleteDate(Date,idxfname,datapath,...
import pandas as pd from pandas_ta import percent_return from sklearn.model_selection import train_test_split import yfinance as yf from catch22 import catch22_all from tuneta.tune_ta import TuneTA if __name__ == "__main__": # Download data set from yahoo X = yf.download("SPY", period="10y", interval="1d", au...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^checkusername/(?P<username>\w+)/$', views.username_exists, name = "checkusername"), url(r'^createuser/$', views.create_user, name = "createuser"), url(r'^createcharacter/$', views.create_character, name = "createcharacter"), ur...
from .core import MouseV1Dataset
from pyblizzard.starcraft2 import starcraft2 __all__ = ['starcraft2']
import os import subprocess path = 'src' include = 'include' brotli = 'brotli/c/include/' brotlibin = 'brotli/bin/obj/em/' files = [] # r=root, d=directories, f = files bzList = [] print("Starting emscripten build") for r, d, f in os.walk(path): for file in f: if 'woff2_compress.cc' in file or 'woff2_de...
from oelint_adv.cls_rule import Rule from oelint_parser.cls_item import Variable class VarSectionLowercase(Rule): def __init__(self): super().__init__(id='oelint.vars.sectionlowercase', severity='warning', message='\'SECTION\' should only lowercase charact...
import os from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from _pytest.fixtures import fixture from ..fixtures.cci import enable_browser_stack @fixture(scope="session", autouse=True) def driver(request, api_client): is_headless = request.config.getoption("--headless") ...
''' Vehicle class implemets the car following model. ''' import numpy as np class Vehicle: def __init__(self, id, x, l=5, v=0, a=1, b=4, v_max=20, g_min=4, tau=2.05, stop_x=500, model='k'): ''' id - vehicle number x - position in meters l - car length in meters a - ...
""" Background It is possible for a participant to have multiple records of Physical Measurements. This typically occurs when earlier entries are incorrect. Data quality would improve if these earlier entries were removed. Scope: Develop a cleaning rule to remove all but the most recent of each Physical Measurement f...
#!/usr/bin/python3 """ Json conversion module functions: from_json_string: converts json to string """ import json def from_json_string(my_str): """ Converts to string return: json loaded to object """ return json.loads(my_str)
from django.conf.urls import patterns, url, include from rest_framework.urlpatterns import format_suffix_patterns urlpatterns = patterns('', url(r'^assessment/?', include('assessments.urls', namespace='assessments')), url(r'^grading/?', include('grading.urls', namespace='grading')), url(r'^learning/?', inc...
def get_bigger(number1, number2): if number1 > number2: return number1 elif number2 > number1: return number2 else: print('Numbers are Equal') return number1 n1 = int(input("Enter your number1: ")) n2 = int(input('ENter your number2: ')) bigger_one = get_bigger(n1, n2) prin...
'''from telethon import events @borg.on(events.NewMessage(chats=-1001128441021)) async def handler(event): await borg.forward_messages("@dwnmp3Bot", event.message)'''