text
stringlengths
2
999k
class Endpoint(object): def __init__(self,server_config: str): self.config = server_config def processImage(self,*args): return NotImplementedError() def processVideo(self,*args): return NotImplementedError() def processCamera(self, *args): return NotImplementedErr...
# utils.py -- Test utilities for Dulwich. # Copyright (C) 2010 Google, Inc. # # 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; version 2 # of the License or (at your option) any later version of ...
"""Git repository information consists of: 1. Files in the `.git` repository directory 2. Files in the working tree Backing up a git repository means persisting it in a way so it can be recovered later. There are several possible approaches, with different trade-offs: 1. `git bundle create` - the resulting bundle do...
from __future__ import annotations from typing import TYPE_CHECKING from selenium.common.exceptions import WebDriverException from selenium.webdriver.common.keys import Keys from selenium.webdriver.remote.webelement import WebElement as RemoteWebElement from sylenium.element.locatable import Locatable if TYPE_CHECK...
def activate_gitignore(os): os.rename("gitignore", ".gitignore") def initialize_local_repo(os, repo, initial_commit_msg): print("initializing local git repository") activate_gitignore(os) local_repo = repo.init(os.getcwd()) local_repo.git.add(A=True) local_repo.index.commit(initial_commit_msg...
# Date: 05/03/2018 # Author: Pure-L0G1C # Description: Proxy scraper from requests import get from bs4 import BeautifulSoup as bs class Queue(object): def __init__(self): self.queue = [] def put(self, item): if not item in self.queue: self.queue.append(item) def get(self): if self.qsize: return s...
import logging from aiogram.types import ContentTypes, Message from services.dialog.avatar_picture_dialog import AvatarDialog from services.dialog.inline_bot_handler import InlineBotHandlerDialog from services.dialog.main_menu import MainMenuDialog from services.dialog.metrics_menu import MetricsDialog from services....
from ...commands.cooldowns import *
# -*- coding: utf-8 -*- # Used for screenshots that match size of current screenshots in GooglePlay if 0: from kivy.config import Config Config.set('graphics', 'width', '410') Config.set('graphics', 'height', '700') from kivy.app import App from kivy.uix.button import Button from kivy.animation import Ani...
import numpy as np from scipy.linalg import toeplitz from .Templates import Estimator_mimo, Descriptor from training_CNN_mimo import pilot_matrix class DiscreteMMSE(Estimator_mimo, Descriptor): _object_counter = 1 def __init__(self, channel, snr, n_antennas_BS, n_antennas_MS, n_samples, n_pilots, name=None): ...
import re from collections import defaultdict from pyinfra.api import FactBase, MaskString, QuoteString, StringCommand from pyinfra.api.util import try_int from .util.databases import parse_columns_and_rows def make_mysql_command( database=None, user=None, password=None, host=None, port=None, ...
t = int(input()) for _ in range(t): a = input() if a[0] == a[-1]: print("NO") continue l1 = {a[0]: 1, a[-1]: 0} l2 = {a[0]: 1, a[-1]: 0} for char in ["A", "B", "C"]: if char not in l1: l1[char] = 0 l2[char] = 1 case1 = 0 for i in range(len(a)):...
from vbench.benchmark import Benchmark from datetime import datetime common_setup = """from .pandas_vb_common import * try: from pandas import date_range except ImportError: def date_range(start=None, end=None, periods=None, freq=None): return DatetimeIndex(start, end, periods=periods, offset=freq) "...
import sys import argparse import pprint import os import json from kazoo.client import KazooClient import errno import logging import cmd_memcached import cmd_db import cmd_client import cmd_attr import cmd_import import cmd_alg import cmd_model import cmd_pred import cmd_keys import cmd_api import cmd_rpc import cmd...
import decimal import numbers import random import sys import numpy as np from pandas.core.dtypes.base import ExtensionDtype import pandas as pd from pandas.core.arrays import ExtensionArray, ExtensionScalarOpsMixin class DecimalDtype(ExtensionDtype): type = decimal.Decimal name = 'decimal' na_value = ...
import pytest from typing import Iterable, Union, Optional, List, Callable, Dict, Any from types import GeneratorType from pydantic import BaseModel, StrictBool, StrictFloat, PositiveInt, constr import catalogue import thinc.config from thinc.config import ConfigValidationError from thinc.types import Generator, Ragged...
# -*- coding: utf-8 -*- # Copyright (C) 2017 NetworkX Developers # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # Loïc Séguin-C. <loicseguin@gmail.com> # All rights reserved. # BSD license. """ Algorithms for calculating min/max spanning trees/f...
# Generated by Django 3.1.3 on 2020-12-23 15:07 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ("base", "0012_auto_20201020_1830"), ("insights", "0001_initial"), ] operations ...
""" Story generation """ import cPickle as pkl import numpy import random import copy import sys import skimage.transform import skipthoughts import decoder import embedding import config import lasagne from lasagne.layers import InputLayer, DenseLayer, NonlinearityLayer, DropoutLayer from lasagne.layers import MaxP...
"""Phonon thermal properties at constant volume.""" # Copyright (C) 2011 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of s...
# # Copyright 2013 The py-lmdb authors, all rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted only as authorized by the OpenLDAP # Public License. # # A copy of this license is available in the file LICENSE in the # top-level directory of the distribut...
"""shyguy URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.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') Clas...
# @Title: 缺失的第一个正数 (First Missing Positive) # @Author: KivenC # @Date: 2019-02-25 12:45:35 # @Runtime: 48 ms # @Memory: 6.5 MB class Solution: def firstMissingPositive(self, nums: 'List[int]') -> 'int': l = len(nums) x = 0 for i in nums: if 0 < i <= l and not x & (1 << (i - 1))...
#!/usr/bin/env python3 # Copyright 2019 Kubos Corporation # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. import app_api import argparse import logging from sub import sub import sys def main(): logger = app_api.logging_setup("python-proj") parser = argparse.ArgumentPar...
from tool.runners.python import SubmissionPy from collections import defaultdict class YouyounSubmission(SubmissionPy): def run(self, s): # :param s: input in string format # :return: solution flag # Your code goes here orbits = [x.split(")") for x in s.splitlines()] orbit...
# Converted from CloudFront_S3.template located at: # http://aws.amazon.com/cloudformation/aws-cloudformation-templates/ from troposphere import GetAtt, Join, Output from troposphere import Parameter, Ref, Template from troposphere.cloudfront import Distribution, DistributionConfig from troposphere.cloudfront import O...
"""Constants for the Wyze Home Assistant Integration integration.""" DOMAIN = "wyzeapi" CONF_CLIENT = "wyzeapi_client"
import os import gdata import gdata.photos.service import gdata.media import gdata.geo import gdata.gauth import webbrowser import httplib2 from datetime import datetime, timedelta from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage import getpass import os.path install_dir =...
from .helper import PillowTestCase, hopper from PIL import GribStubImagePlugin, Image TEST_FILE = "Tests/images/WAlaska.wind.7days.grb" class TestFileGribStub(PillowTestCase): def test_open(self): # Act im = Image.open(TEST_FILE) # Assert self.assertEqual(im.format, "GRIB") ...
from datetime import datetime, timedelta import time import unittest from altimeter.qj import schemas from altimeter.qj.crud.crud_job import CRUDJob from altimeter.qj.crud.crud_result_set import CRUDResultSet from altimeter.qj.exceptions import ( ActiveJobVersionNotFound, JobInvalid, JobNotFound, JobQu...
import pandas as pd import re roster_file = "/Users/laurahughes/GitHub/cvisb_data/sample-viewer-api/src/static/data/2019-01-31_patients_PRIVATE.csv" new_id_file = "/Users/laurahughes/GitHub/cvisb_data/sample-viewer-api/src/static/data/input_data/patient_rosters/survivor_IDdict_v1_2012-02-27_PRIVATE.xlsx" # import new...
from typing import List import argparse from .unit import request_unit from .customrequests import customrequest from .transformer import datatransformer from .cli.apisimdashboard import dashboard from .db.db import query from .util.util import Settings, helpers class apisim: def __init__(self, print_steps, table...
# GENERATED BY KOMAND SDK - DO NOT EDIT from .action import CreateGlobalAclRule
from typing import Dict, List, Optional, Union from psqlextra.types import PostgresPartitioningMethod, SQLWithParams class PostgresPartitionedModelOptions: """Container for :see:PostgresPartitionedModel options. This is where attributes copied from the model's `PartitioningMeta` are held. """ d...
import numpy as np from scipy.stats import mstats from sklearn import utils def balanced_resample(data, labels): """Do a balanced resampling of data and labels, returning them See the test routine at the bottom for an example of behavior """ most_common, num_required = mstats.mode(labels) possible...
# Time: O(p), p is the number of ops # Space: O(1) class Solution(object): def maxCount(self, m, n, ops): """ :type m: int :type n: int :type ops: List[List[int]] :rtype: int """ for op in ops: m = min(m, op[0]) n = min(n...
import os import unittest import soundfile from .cheetah import Cheetah class CheetahTestCase(unittest.TestCase): def test_transcribe(self): def _abs_path(rel_path): return os.path.join(os.path.dirname(__file__), rel_path) cheetah = Cheetah( library_path=_abs_path('../.....
def interlock(word1, word2, word3): if (not word1) or (not word2) or (not word3): return False interlocked = "" for i in range(len(min([word1, word2], key=len))): interlocked += (word1[i] + word2[i]) if word3 == (interlocked + max([word1, word2], key=len)[len(min([word1, word2], key=l...
import dash import dash_core_components as dcc import dash_html_components as html import pandas as pd from sqlalchemy import create_engine # Create a simple database engine = create_engine('sqlite:///sample.db') df = pd.DataFrame({ 'a': [1, 2, 3, 4, 5, 6], 'b': ['x', 'y', 'x', 'x', 'z', 'y'] }) df.to_sql('da...
# 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 (t...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
#!/usr/bin/env python2.7 # Copyright 2015 gRPC 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
import logging from copy import deepcopy from django.utils.translation import ugettext as _ from rest_framework import serializers from rest_framework.fields import empty from oscar.core.loading import get_model from oscarapi.utils.exists import bound_unique_together_get_or_create_multiple from oscarapi.utils.loadin...
# Copyright 2016 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 ...
"""\ Run Diffusion maps using the adaptive anisotropic kernel """ from typing import Optional, List import pandas as pd from anndata import AnnData from ... import logging as logg def palantir( adata: AnnData, n_components: int = 10, knn: int = 30, alpha: float = 0, use_adjacency_matrix: bool = ...
#!/usr/bin/env python """ patrol_tree.py - Version 1.0 2013-03-18 Navigate a series of waypoints while monitoring battery levels. Uses the pi_trees package to implement a behavior tree task manager. Created for the Pi Robot Project: http://www.pirobot.org Copyright (c) 2013 Patrick Goebel...
from __future__ import absolute_import, division, print_function from wxtbx.phil_controls import text_base from wxtbx import phil_controls import wxtbx.icons from libtbx.utils import Sorry, to_unicode, to_str from libtbx import Auto import wx import os import sys WXTBX_PHIL_PATH_SAVE = 1 WXTBX_PHIL_PATH_DIRECTORY = 2 ...
from torch.utils.data import Dataset import os, time import pandas as pd import numpy as np import torch import random import scipy.spatial import scipy.io import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D dim = 3 plt.rcParams['font.sans-serif'] = ["SimHei"] # 防止 - 号出错,和上一行同时解注 plt.rcParams["ax...
# Copyright (c) 2013 OpenStack Foundation # 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 ...
# -*- coding: utf-8 -*- # Copyright (c) 2004-2014 Alterra, Wageningen-UR # Allard de Wit (allard.dewit@wur.nl), April 2014 from ..traitlets import Float, Int, Instance, Dict, AfgenTrait from ..decorators import prepare_rates, prepare_states from ..base_classes import ParamTemplate, SimulationObject class WOFOST...
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
# Lint as: python2, python3 # Copyright 2018 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
import re RE_INSTRUCTION = r"([\w]{3}) ([+\-\d]+)" def execute_code(instructions): executed = set() accumulator = 0 idx = 0 while True: if idx in executed: return False if idx >= len(instructions): print(f"Accumulator value after program termination: {accumul...
import sys from ursina.entity import Entity from panda3d.core import PerspectiveLens, OrthographicLens, LensNode, NodePath from panda3d.core import Camera as PandaCamera from panda3d.core import Texture as PandaTexture from panda3d.core import Shader from direct.filter.FilterManager import FilterManager from ursina imp...
import tensorflow as tf import numpy as np import os,glob,cv2 import sys,argparse parser = argparse.ArgumentParser() parser.add_argument("--filepath",help="image file path for prediction purposes...") parser.add_argument("--trainpath",help="directory where training data is stored...") args=parser.parse_args() # First,...
#!/usr/bin/python import argparse import sys from ldif import LDIFParser, LDIFWriter class ActiveDirectoryDefaultUserSetup(LDIFParser): password = "" def __init__(self, input, output, password): LDIFParser.__init__(self, input) self.writer = LDIFWriter(output) self.password = passwor...
import itertools import enum from usfm_utils.elements.abstract_elements import Element, KindedElement, MaybeIntroductoryElement,\ ParentElement, WeightedElement from usfm_utils.elements.footnote_utils import FootnoteLabel from usfm_utils.elements.paragraph_utils import LeftAligned class Text(Element): def _...
import sys import typing from dataclasses import dataclass, is_dataclass, fields from inspect import signature, getmodule, isclass from typing import Dict, NamedTuple, Tuple, Type, Any, Optional from wired import ServiceContainer from wired_injector.field_info import ( function_field_info_factory, dataclass_fi...
# Copyright 2015 Florian Ludwig # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
from dace.config import Config Config.set("compiler", "cpu", "libs", value="papi",autosave=True)
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
"""This file holding some environment constant for sharing by other files.""" import os.path as osp import subprocess import sys from collections import defaultdict import cv2 import torch import rflib def get_build_config(): return torch.__config__.show() def collect_env(): """Collect the information of t...
def error_message() -> str: """Error message for invalid input""" return 'Invalid input. Use !help for a list of commands.'
""" Onmt NMT Model base class definition """ import torch.nn as nn class NMTModel(nn.Module): """ Core trainable object in OpenNMT. Implements a trainable interface for a simple, generic encoder + decoder model. Args: encoder (onmt.encoders.EncoderBase): an encoder object decoder (onmt.de...
import re def printNames(dict): for Name in sorted (dict.keys()) : for i in range(len(dict[Name])): print(Name) if __name__ == '__main__': N = int(input().strip()) dict = {} for N_itr in range(N): first_multiple_input = input().rstrip().split() firstName = firs...
from tkinter import filedialog import os import glob import re import NMEA_cell_gp_parse # 각각 0, 30, 60, 90 도 time_divide_by_deg = ["005920.00,010350.00", "164800.00,165500.00", "165800.00,170500.00"] # "164800.00,165500.00", # "165800.00,170500.00"] #'60', '90'] degree_li...
import contextlib import os from collections import Counter from copy import deepcopy import numpy as np import torch import torch.nn.functional as F from sklearn.metrics import * from torch.cuda.amp import GradScaler, autocast from train_utils import Bn_Controller, EMA, ce_loss, wd_loss from .pseudolabel_utils impor...
import datetime import functools import operator import os import tensorflow as tf from .base import GANModel from .blocks import BasicGenerator, BasicDiscriminator from ..ops import dragan_perturb from ..train import IncrementalAverage class DiscoGAN(GANModel): def __init__(self, sess, ...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
heroesAndVillains = { 'kb': ''' Hero(Batman) Hero(WonderWoman) Hero(Flash) Hero(Superman) Hero(GreenLantern) Villain(LexLuther) Villain(DoomsDay) Villain(Penguin) Villain(Joker) Villain(Sinestro) Villain(Zoom) Sidekick(Robin, Batman) SideKick(PieFace, GreenLantern) Sidekick(CommisionerGordon, Batman) Sidekick(Harle...
import pandas as pd import streamlit as st import plotly.express as px @st.cache def get_data(): return pd.read_csv("http://data.insideairbnb.com/united-states/ny/new-york-city/2021-04-07/visualisations/listings.csv") # not avaliable anymore # df = get_data() df = pd.read_csv("listings.csv") st.title("Streamlit ...
import random from .base import Generator class Boolean(Generator): def get_arguments(self, ratio=0.5, **kwargs): super(Boolean, self).get_arguments(**kwargs) self.ratio = ratio def generate(self): while True: yield random.random() <= self.ratio
# Originally contributed by Sjoerd Mullender. # Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>. """Fraction, infinite-precision, real numbers.""" from decimal import Decimal import math import numbers import operator import re import sys __all__ = ['Fraction', 'gcd'] def gcd(a, b): """Calcu...
import logging import os from common.utils import OUTPUTS_DIR LOGGER = logging.getLogger('Main') LOGGER.setLevel(logging.INFO) file_handler = logging.FileHandler(filename=os.path.join(OUTPUTS_DIR, 'classifier_outputs.txt'), encoding='utf-8') formatter = logging.Formatter(u"%(message)s") file_handler.setFormatter(form...
from sklearn.metrics.pairwise import pairwise_distances from loaddataset import loaddataset, savedataset from collections import Counter from functools import partial from fastdtw import fastdtw from dtw_mean import ssg import numpy as np import argparse import time import math import os SEED = 0 np.random.seed = SEED...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # #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 __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import pandas as pd from xarray import Dataset, DataArray, Variable from xarray.core import indexing from . import TestCase, ReturnItem class TestIndexers(TestCase): def set_to_zero(sel...
import dataclasses import urllib.parse from os import stat from typing import ( Any, Dict, List, Literal, NoReturn, Optional, Tuple, TypedDict, cast, ) from rest_framework.exceptions import ValidationError from rest_framework.utils.serializer_helpers import ReturnList from ee.click...
""" pyexcel.plugin.renderers.excel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into excel files :copyright: (c) 2015-2020 by Onni Software Ltd. :license: New BSD License """ from pyexcel.renderer import AbstractRenderer from pyexcel.constants import DEFAULT_SHEET_NAME import pyexcel_io.mana...
#!/usr/bin/env python import sys import logging logging.basicConfig(format='[%(module)s] %(filename)s:%(lineno)s %(asctime)s %(levelname)s %(message)s', stream=sys.stdout) from optparse import OptionParser import pprint from libsolace.SolaceAPI import SolaceAPI from libsolace.SolaceXMLBuilder impor...
"""Command proxies.""" from __future__ import annotations from mcipc.rcon.functions import until_none from mcipc.rcon.client import Client __all__ = ['CommandProxy'] class CommandProxy: # pylint: disable=R0903 """A basic command proxy.""" __slots__ = ('_client', '_args') def __init__(self, clien...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the syslog parser.""" import unittest from plaso.parsers import syslog from tests.parsers import test_lib class SyslogParserTest(test_lib.ParserTestCase): """Tests for the syslog parser.""" # pylint: disable=protected-access def testEnablePlugins(...
# # ------------------------------------------------------------------------- # Copyright (c) 2015-2017 AT&T Intellectual Property # # 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 # # ...
# Generated by Django 2.1 on 2018-12-05 16:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mainapp', '0004_auto_20181205_2056'), ] operations = [ migrations.RemoveField( model_name='product', name='image_5', ...
import re from collections import OrderedDict from .enums import Locale from .utils import ElementTree class Dbf: @classmethod def load(cls, filename): ret = cls() with open(filename, "r") as f: ret.populate(f) return ret def __init__(self): self.name = None self.records = [] self.columns = Ordered...
# Time: O(nlogn) # Space: O(1) class Solution(object): def findBestValue(self, arr, target): """ :type arr: List[int] :type target: int :rtype: int """ arr.sort(reverse=True) max_arr = arr[0] while arr and arr[-1]*len(arr) <= target: targ...
class FindGuild: def __init__(self, data: dict) -> None: """ Parameters ---------- data: dict The JSON data received from the Hypixel API. """ self.id = data["guild"] def __str__(self) -> str: return self.id def __repr__(self) -> str: ...
from gluon.storage import Storage settings = Storage() settings.migrate = True settings.title = 'Flota' settings.subtitle = 'powered by web2py' settings.author = 'wasuaje' settings.author_email = 'wasuaje@hotmail.com' settings.keywords = '' settings.description = '' #settings.layout_theme = 'Spaced' #settings.database...
# -*- coding:utf-8 -*- import tools from scrapy.exceptions import DropItem import re import urllib import time import exceptions import socket from scrapy import log import os from xml.dom.minidom import Document class FilterCityItemsPipeline(object): def __init__(self): #self.file = open('citylist', 'a')...
from django.contrib.auth import get_user_model from django.urls import reverse from django.test import TestCase from rest_framework import status from rest_framework.test import APIClient from core.models import Tag, Recipe from recipe.serializers import TagSerializer TAGS_URL = reverse('recipe:tag-list') class ...
from typing import Optional, Union from watchmen_model.common import GraphicRect def construct_rect(rect: Optional[Union[dict, GraphicRect]]) -> Optional[GraphicRect]: if rect is None: return None elif isinstance(rect, GraphicRect): return rect else: return GraphicRect(**rect)
import unittest from robot.model import Message from robot.utils.asserts import assert_equal, assert_raises class TestHtmlMessage(unittest.TestCase): def test_empty(self): assert_equal(Message().html_message, '') assert_equal(Message(html=True).html_message, '') def test_no_html(self): ...
# -*- coding: utf-8 -*- """ Created on Mon May 18 14:56:53 2020 @author: Dainean """ #Prepare the python system import pandas as pd import numpy as np import fnmatch #For filtering import os #move around in our OS from astropy.io import fits #Working with fits from astropy.cosmology import WMAP9 as cosmo #C...
# coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # --------------------------------------------------------------------...
#!/usr/bin/env python3 # Copyright (c) 2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test fee filters during and after IBD.""" from decimal import Decimal from test_framework.messages import ...
#!/usr/bin/env python from hand_eye_calibration.time_alignment import ( calculate_time_offset, compute_aligned_poses, FilteringConfig) from hand_eye_calibration.quaternion import Quaternion from hand_eye_calibration.csv_io import ( write_time_stamped_poses_to_csv_file, read_time_stamped_poses_from_csv_file)...
VERSION = '0.1.4'
import raven import os import inspect import settings if settings.USE_SENTRY: sentry_client = raven.Client(settings.SENTRY_URL, refs=[{ "commit": raven.fetch_git_sha(os.getcwd()), "repository": settings.SENT...
from .client import Client, Params # noqa # alias Param = Params # noqa from .stream import StreamConn # noqa __version__ = '0.15'
# coding=utf-8 """This module help produce the output containing a transformation through auto timestamp / date detection by reading the ingested dataframe from source. As a part of generation of the auto detection output, there are various functions created such as - - regex_date_time_parser - ts_loop_cols_pre - ts...