text
stringlengths
1
927k
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
##### # # Les 12 - Make the "Guess the secret number" game more modular # # Use functions to make the game more modular. Also try to add another while loop so the user can play # many rounds of the game without having to re-run the program each time. # # You can let the user choose the level of the game: 'Easy' of 'Har...
# vim: ft=python fileencoding=utf-8 sw=4 et sts=4 """Contains custom exceptions used by vimiv.""" class NoSearchResultsError(Exception): """Raised when a search result is accessed although there are no results.""" class StringConversionError(ValueError): """Raised when a setting or argument could not be con...
#!/usr/bin/env python3 # # This file is part of https://github.com/martinruenz/maskfusion # # This program 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 of the License, or # (at your option)...
import collections import copy import itertools import os import sys from sphinx.errors import ExtensionError, SphinxError, SphinxWarning from dfhack.util import DFHACK_ROOT, DOCS_ROOT CHANGELOG_PATHS = ( 'docs/changelog.txt', 'scripts/changelog.txt', 'library/xml/changelog.txt', ) CHANGELOG_PATHS = (os....
import argparse from os import listdir, mkdir from os.path import isfile, join from nltk import sent_tokenize def main(org, dest): with open(org, 'r') as o: corpus = o.read() sent_corpus = sent_tokenize(corpus) with open(dest, 'w') as d: for sent in sent_corpus: d.write(sent + '\n') if __name__ == "__m...
# Main dashboard screen # importing libraries import dash from dash import dcc from dash import html from dash.dependencies import Input, Output, State # dash app app = dash.Dash(__name__) # Dash layout app.layout = html.Div( children=[ html.H1( children='Spotify Analysis' ), ...
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE import pytest # noqa: F401 import numpy as np # noqa: F401 import awkward as ak # noqa: F401 pyarrow = pytest.importorskip("pyarrow") pytest.importorskip("awkward._v2._connect.pyarrow") to_list = ak._v2.operations.to_list de...
# Copyright 2018-present Facebook, 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 i...
# 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...
""" This handles the communication to an infinoted server """ from twisted.internet import reactor from twisted.internet.defer import Deferred from twisted.names.srvconnect import SRVConnector from twisted.words.xish import domish from twisted.words.protocols.jabber import xmlstream, client from twisted.words.protocol...
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7 from KratosDEMApplication import * from KratosMultiphysics import _ImportApplication application = KratosDEMApplication() application_name = "KratosDEMApplication" _ImportApplication(...
# Copyright (C) 2014 Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
# -*- coding: utf-8 -*- # # zope.configuration documentation build configuration file, created by # sphinx-quickstart on Sat May 5 13:59:34 2012. # # 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 fi...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from future.utils import viewkeys from multiprocessing import Process, Queue import numpy as np import os import shutil import tempfile import unittest import time from mock import Mock from hypothesis import a...
# Copyright 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 in wr...
# -*- coding: utf-8 -*- # Scrapy settings for XiaocaiCrawler project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en...
import os import logging import numpy as np import sklearn.preprocessing import h5py import random from itertools import product from pymilvus import DataType from milvus_benchmark import config logger = logging.getLogger("milvus_benchmark.runners.utils") DELETE_INTERVAL_TIME = 2 VECTORS_PER_FILE = 1000000 SIFT_VEC...
# Python Essential Libraries by Joe Marini course example # Example file for the Requests library import requests from requests.auth import HTTPDigestAuth # define user and password values user = "theuser" passwd = "thepass" # TODO: use the basic authentication method url = "https://httpbin.org/basic-auth/theusr/thep...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Shapefile driver testing. # Author: Frank Warmerdam <warmerdam@pobox.com> # ###############################################################...
# Make sure Python loads the modules of this package via absolute paths. from os.path import abspath as _abspath from qautils.gppylib import gplog __path__[0] = _abspath(__path__[0]) logger = gplog.get_default_logger() class Operation(object): """ An Operation (abstract class) is one atomic unit of work. ...
#!/usr/bin/python from wsgiref.handlers import CGIHandler from application import app CGIHandler().run(app)
"""Improved Training of Wasserstein GANs. Papers: https://arxiv.org/abs/1701.07875 https://arxiv.org/abs/1704.00028 Created on Tue Oct 26 15:17:08 2021 @author: gonzo """ import torch import torch.nn as nn import torch.optim as optim from torch.optim.lr_scheduler import CosineAnnealingLR from torch.utils...
"""Module for testing Amino Acid DelIns Classifier.""" import unittest from variation.classifiers import AminoAcidDelInsClassifier from .classifier_base import ClassifierBase class TestAminoAcidDelInsClassifier(ClassifierBase, unittest.TestCase): """A class to test the Amino Acid DelIns Classifier.""" def cl...
#Copyright 2014 Center for Internet Security - Computer Emergency Response Team (CIS-CERT) #This is part of the CIS Enumeration and Scanning Program (CIS-ESP) # #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 th...
""" cant start a number with 0 we can have multiple characters without numbers iterate over each element on abbr always compare current i with the string if they are not equal we have a number, word[i] == abr[i] convert the string to number and find if the value i position exist is the same """ class Solution: de...
import sys import typing import bpy_types import rna_prop_ui class TEXTURE_MT_context_menu(bpy_types.Menu, bpy_types._GenericUI): COMPAT_ENGINES = None ''' ''' bl_label = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def append(self, draw_func): ''' ...
class C(object): def __enter__(self): return self class D(C): def foo(self): pass with D() as cm: cm.foo() # pass
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import http.client import locale import logging import os import sys from contextlib import contextmanager from io import BufferedReader, TextIOWrapper from logging import Formatter, LogRe...
"""Console script for calh.""" import sys import click import click_spinner @click.group(invoke_without_command=True) @click.option("-v", "--version", is_flag=True, default=False) def cli(version): if version: import calh click.echo(f"Version: {calh.__version__}") @cli.command() @click.option(...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from logging import Logger from typing import Any, Dict, List, Optional, Type import torch from ax.core.data import Da...
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
from FINE.component import Component, ComponentModel from FINE import utils import pyomo.environ as pyomo import warnings import pandas as pd class Storage(Component): """ A Storage component can store a commodity and thus transfers it between time steps. """ def __init__(self, esM, name, commodity, c...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
from mimesis.providers.base import BaseProvider from .helpers import generate class MPANProvider(BaseProvider): class Meta: name = "mpan" @staticmethod def generate() -> str: return generate()
import json import urllib.request class GoogleGeocodeAPI: def __init__(self, api_key): self.API_KEY = api_key self.url = "https://maps.googleapis.com/maps/api/geocode/json" def get_geocode(self, latitude, longitude): url = f'{self.url}?latlng={latitude},{longitude}' return sel...
from unittest import TestCase from unittest.mock import Mock, patch import numpy as np import pandas as pd from copulas import get_qualified_name from copulas.multivariate.gaussian import GaussianMultivariate from copulas.univariate import GaussianUnivariate class TestGaussianMultivariate(TestCase): def setUp(...
import cv2 import mediapipe as mp import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from scipy.spatial import distance from scipy.signal import find_peaks from celluloid import Camera from tqdm import tqdm class Doridori: def __init__(self,filepath): self.cap = cv...
##################### # Dennis MUD # # sit.py # # Copyright 2020 # # Michael D. Reiley # ##################### # ********** # 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 Softwa...
# Copyright 2016 AC Technologies LLC. 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages with open('README.md') as readme_file: readme = readme_file.read() setup_requirements = ['pytest-runner'] with open('requirements.txt') as f: requirements = list(f.readlines()) test_requiremen...
from django.urls import path, include from rest_framework.routers import DefaultRouter from . import views router = DefaultRouter() router.include_root_view = False # 打印员 router.register('printer', views.DeliveryPrinterViewSet) # 账号管理 router.register('account', views.DeliveryAccountViewSet) # 发件人地址管理 router.regist...
from django.contrib import admin from .models import Comment # Register your models here. admin.site.register(Comment)
import numpy as np import matplotlib.pyplot as plt import urllib.request import os import time def download(root_path,filename): if not os.path.exists(root_path): os.mkdir(root_path) if not os.path.exists(os.path.join(root_path,filename)): url = "http://elib.zib.de/pub/mp-testdata/tsp/tsplib/tsp...
"""Contains a class which extracts the needed arguments of an arbitrary methode/function and wraps them for future usage. E.g correctly choosing the needed arguments and passing them on to the original function. """ import inspect import copy import torch from ..problem.spaces.points import Points class UserFunct...
from setuptools import setup setup( name='monstercatFM', packages=['monstercatFM'], version='v1.1.3', description='Unofficial shitty API wrapper to get information about the monstercat live stream', author='Zenrac', author_email='zenrac@outlook.fr', url='https://github.com/Zenrac/monstercat...
# # @lc app=leetcode id=297 lang=python3 # # [297] Serialize and Deserialize Binary Tree # # https://leetcode.com/problems/serialize-and-deserialize-binary-tree/description/ # # algorithms # Hard (51.39%) # Likes: 4821 # Dislikes: 214 # Total Accepted: 480.7K # Total Submissions: 935.3K # Testcase Example: '[1,2...
import json import time from contextlib import contextmanager from multiprocessing import Process import pytest import requests import responses from flask import Flask, request from requests import HTTPError from urlobject import URLObject from ..test_utils import silence from ...base import get_host_ip, success_res...
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='Repo containing codefiles developed for the case-study.', author='Gokul S Kumar, IIDS, ISB', license='BSD-3', )
import six.moves.urllib.request as urlreq from six import PY3 import dash import dash_bio as dashbio import dash_html_components as html import dash_core_components as dcc from dash_bio_utils import xyz_reader external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Dash(__name__, external_st...
# Copyright 2017 The Forseti Security 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 ap...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # Copyright (c) 2008-2019 pyglet contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the follo...
import sqlite3 import click from flask import current_app, g from flask.cli import with_appcontext def get_db(): if 'db' not in g: g.db = sqlite3.connect( 'database.db', detect_types=sqlite3.PARSE_DECLTYPES ) g.db.row_factory = sqlite3.Row return g.db def cl...
import logging import os import sys # Add lib to path. libs_dir = os.path.join(os.path.dirname(__file__), 'lib') if libs_dir not in sys.path: logging.debug('Adding lib to path.') sys.path.insert(0, libs_dir) import webapp2 url_map = [ ('.*/mybook', 'mybook.MainPage'), ] app = webapp2.WSGIApplication(url...
from topaz.astcompiler import SymbolTable from topaz.module import ClassDef from topaz.objects.objectobject import W_Object class W_BindingObject(W_Object): classdef = ClassDef("Binding", W_Object.classdef) _immutable_fields_ = ["names[*]", "cells[*]", "w_self", "lexical_scope"] def __init__(self, space,...
# -*- coding: utf-8 -*- """ Testing of uptime command. """ __author__ = 'Marcin Usielski' __copyright__ = 'Copyright (C) 2018-2019, Nokia' __email__ = 'marcin.usielski@nokia.com' import pytest from moler.exceptions import CommandFailure from moler.exceptions import CommandTimeout def test_calling_uptime_returns_resu...
""" ``fn.monad.Option`` represents optional values, each instance of ``Option`` can be either instance of ``Full`` or ``Empty``. It provides you with simple way to write long computation sequences and get rid of many ``if/else`` blocks. See usage examples below. Assume that you have ``Request`` class that gives you pa...
import json import time from datetime import datetime, timedelta from unittest import mock from django.conf import settings from django.core import mail from olympia import amo from olympia.abuse.models import AbuseReport from olympia.access.models import Group, GroupUser from olympia.addons.models import AddonApprova...
# Copyright 2021 The Pigweed Authors # # 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 ...
import numpy as np from scipy.optimize import fmin_l_bfgs_b import time import argparse import cv2 from tensorflow.keras.models import load_model import numpy as np import csv import sys from matplotlib import pyplot as plt from PIL import Image from keras.preprocessing.image import img_to_array img = cv2.imread('po...
# -*- coding: utf-8 -*- """provides sequencing fetching from NCBI and Ensembl """ from __future__ import absolute_import, division, print_function, unicode_literals import logging import os import re import bioutils.seqfetcher from ..exceptions import HGVSDataNotAvailableError _logger = logging.getLogger(__name__...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
from fireworks import Workflow, Firework class SwarmFlow(Workflow): def __init__(self, fireworks, links_dict=None, name=None, metadata=None, created_on=None, updated_on=None, fw_states=None, sf_id=None): """ Args: fireworks ([Firework]): all FireWorks in this SwarmFlo...
import logging import re import traceback from typing import Dict, List, Set, Tuple, Union import numpy as np from lasso.dyna.ArrayType import ArrayType from lasso.femzip.femzip_api import FemzipAPI, FemzipFileMetadata, VariableInfo from lasso.femzip.fz_config import (FemzipArrayType, FemzipVariableCategory, ...
import os from contextlib import contextmanager @contextmanager def change_dir(destination): # Allows for temporary change of working directory when used with a with statement try: cwd = os.getcwd() os.chdir(destination) yield finally: os.chdir(cwd)
# 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 # # Unless required by applicable ...
import torch from torch import nn from torch.nn import Sequential #model definition class Unet1D(nn.Module): def __init__(self): super(Unet1D, self).__init__() ch = 32 self.maxpool = nn.MaxPool2d((1,2)) self.unpool = nn.Upsample(scale_factor=(1,2)) self.startLayer =...
from django.conf import settings as django_settings from django.core.mail import EmailMultiAlternatives, EmailMessage from django.template import loader from rest_framework import response, status try: from django.contrib.sites.shortcuts import get_current_site except ImportError: from django.contrib.sites.mod...
""" GazePal Application Author: Rishi Rangarajan Year: 2021 File: GazePal_PC.py Info: GazePal_PC class definition """ # Imports import csv import os import pyautogui import time import torch import torchvision import cv2 as cv import numpy as np import torchvision.transforms as transforms from collections import Cou...
import io import sqlite3 def Reader( f, url, stream=False, tag=None ): db = sqlite3.connect( url ) c = db.cursor() rows = c.execute("select * from wikipedia") return rows
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 29 09:23:17 2017 Annotations plugin for pysigview Ing.,Mgr. (MSc.) Jan Cimbálník Biomedical engineering International Clinical Research Center St. Anne's University Hospital in Brno Czech Republic & Mayo systems electrophysiology lab Mayo Clinic 20...
import prodtest import produce import time class KillTest(prodtest.ProduceTestCase): """ Tests that a single recipe failing causes immediate abort and cleanup. """ def test(self): self.assertDirectoryContents(['produce.ini']) with self.assertRaises(produce.ProduceError): s...
from datetime import datetime, time, timedelta from typing import Union import warnings import numpy as np from pytz import utc from pandas._libs import lib, tslib from pandas._libs.tslibs import ( NaT, Timestamp, ccalendar, conversion, fields, iNaT, normalize_date, resolution as libre...
import attr import contextlib import json import os import shutil import sys @attr.dataclass class Data: load_kwds: dict = attr.Factory(dict) dump_kwds: dict = attr.Factory(dict) binary: bool = False backup: bool = True write: bool = False loader: object = json output_file: object = sys.st...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyBandit(PythonPackage): """Security oriented static analyser for python code.""" hom...
# coding: utf-8 from __future__ import unicode_literals import pytest # fmt: off TEST_CASES = [ (["Galime", "vadinti", "gerovės", "valstybe", ",", "turime", "išvystytą", "socialinę", "apsaugą", ",", "sveikatos", "apsaugą", "ir", "prieinamą", "švietimą", "."], ["galėti", "vadintas", "gerovė", "valstybė"...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
# Copyright 2004 by Iddo Friedberg. # All rights reserved. # # This file is part of the Biopython distribution and governed by your # choice of the "Biopython License Agreement" or the "BSD 3-Clause License". # Please see the LICENSE file that should have been included as part of this # package. """Reduced alphabets wh...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from . import FairseqLRScheduler, register_lr_scheduler import torch @register_lr_scheduler('inverse_sqrt_decay') class InverseSquareRootDeca...
# Copyright (C) 2014 Google Inc. 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 a...
from api import token from telegram import InlineKeyboardButton, InlineKeyboardMarkup from telegram.ext import Updater, CommandHandler, CallbackQueryHandler import logging logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLog...
from corehq.apps.app_manager.suite_xml.sections.entries import EntriesHelper from corehq.apps.cloudcare import CLOUDCARE_DEVICE_ID from corehq.apps.users.models import CouchUser from corehq.form_processor.interfaces.dbaccessors import CaseAccessors DELEGATION_STUB_CASE_TYPE = "cc_delegation_stub" class BaseSessionDa...
import typing as t import ssl from motor.motor_asyncio import AsyncIOMotorClient from starlette.middleware.base import BaseHTTPMiddleware from starlette.requests import Request from starlette.responses import JSONResponse, Response from backend.constants import DATABASE_URL, DOCS_PASSWORD, MONGO_DATABASE class Data...
from regression_tests import * class TestInnoSetupDetection(Test): settings = TestSettings( tool='fileinfo', input='inno.exe' ) def test_detected_inno(self): assert self.fileinfo.succeeded assert self.fileinfo.output.contains(r'.*Inno Setup \(5.4.0 - 5.5.1\)')
# 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, ...
# Configuration file # Bot token bot_token = 'bot token here' botAdminID = 123456789 # Orario list_url = 'https://gestionedidattica.unipd.it/PortaleStudenti/combo_call.php' orario_url = 'https://gestionedidattica.unipd.it/PortaleStudenti/grid_call.php' # File locations global_path = '/path/to/this/folder/' db_path =...
"""Unicode code points and alt codes for code page 437. this module defines: class CharCode(IntEnum) -- an enum of the unicode code points. CharCode.altcode -- the alt code of the character, for convenience. altcodes -- a mapping from code points to alt codes. """ from enum import IntEnum class Cha...
# coding=utf-8 # ============================================================================= # Copyright (c) 2001-2021 FLIR Systems, Inc. All Rights Reserved. # # This software is the confidential and proprietary information of FLIR # Integrated Imaging Solutions, Inc. ("Confidential Information"). You # shall not di...
import copy import logging import time from opensfm import dataset from opensfm import exif logger = logging.getLogger(__name__) logging.getLogger("exifread").setLevel(logging.WARNING) class Command: name = 'extract_metadata' help = "Extract metadata from images' EXIF tag" def add_arguments(self, pars...
# -*- coding: utf-8 -*- """ mplbasewidget.py Base class for matplotlib widget for PyQt. Copyright (C) 2018 Tong Zhang <zhangt@frib.msu.edu> This program 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 ve...
from math import gcd t = list(range(1, 21)) print(t) ans = 1 for i in t: if ans % i: ans = (ans * i) // gcd(ans, i) print(ans)
from setuptools import setup setup( name='Animeinfo', author='João Martins', author_email='jgmartinsss@hotmail.com', description='An API to know everything about your favorite anime', url='https://github.com/jgmartinss/animeinfo', )
from django import template register = template.Library() @register.filter(name='add_class') def add_class(field, classname): existing_classes = field.field.widget.attrs.get('class', None) if existing_classes: if existing_classes.find(given_class) == -1: classes = existing_classes + ' ' +...
""" @package: - @script: firebase.py @purpose: This application is a firebase integration @created: Mon 27, 2020 @author: <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior @mailto: yorevs@hotmail.com @site: https://github.com/yorevs/homesetup @license: Please refer to <https://opensource.or...
"""test_project 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-...
import sys import mock from iml_common.test.command_capture_testcase import ( CommandCaptureTestCase, CommandCaptureCommand, ) from iml_common.lib.firewall_control import FirewallControlEL7 from iml_common.lib.service_control import ServiceControlEL7 from iml_common.lib.agent_rpc import agent_result_ok class...
from __future__ import annotations from typing import FrozenSet, Optional from pysmt.environment import Environment as PysmtEnv from pysmt.fnode import FNode from pysmt.typing import PySMTType from utils import to_next class RankFun(): """Represents a ranking function. `expr` that can decrease of `delta` a ...
import array import asyncio import contextvars import functools import io import os import queue import socket import traceback import warnings from collections import deque from time import sleep import pytest from tornado.ioloop import IOLoop import dask from distributed.compatibility import MACOS, WINDOWS from di...
import pandas as pd from app import db, app from app.fetcher.fetcher import Fetcher from app.models import OckovaniSpotreba, OckovaciMisto class UsedFetcher(Fetcher): """ Class for updating used vaccines table. """ USED_CSV = 'https://onemocneni-aktualne.mzcr.cz/api/v2/covid-19/ockovani-spotreba.csv...
import numpy as np import rosbag import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from tf.transformations import euler_from_quaternion # Read bag file bag = rosbag.Bag('2021-09-21-19-57-22.bag') x = [] y = [] z = [] roll = [] pitch = [] yaw = [] time = [] cycles = [] cycle_time = [] init_time ...