text
stringlengths
2
999k
# Copyright (c) 2019, Piet Hein Schouten. All rights reserved. # Licensed under the terms of the MIT license. from django.test import tag from django import urls from django.core.serializers.json import DjangoJSONEncoder from . import utils import json @tag('card-api', 'integration') class CardApiTests(utils.CardA...
import sys if sys.version_info[0] >= 3: INT_TYPES = (int,) else: INT_TYPES = (int, long) def pow2_check (n): return n > 0 and (n & (n - 1)) == 0 def pow2_round_down (n, p): assert pow2_check(p) return n & ~(p - 1) def pow2_round_up (n, p): assert pow2_check(p) return (n + p - 1) & ~(p - ...
from setuptools import setup setup( name = "cui", version = "0.0.1", author = "Christoph Landgraf", author_email = "christoph.landgraf@googlemail.com", description = "A Text UI Framework for Python", license = "BSD", url = "http...
#!/usr/bin/env python3 from random import randint import cv2 import numpy as np from time import sleep def novoGrid(geracaoAtual): aux = [] novaGeracao = [] # Gera uma matriz vazia que sera atualizada depois de contar os vizinhos for k in range(0, quant_arrays): for j in range(0, quant_items...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Vers...
import os import string import hashlib import tempfile import logging from . import ExplorationTechnique from .common import condition_to_lambda l = logging.getLogger(name=__name__) class Cacher(ExplorationTechnique): """ An exploration technique that caches states during symbolic execution. DO NOT US...
"""GitLab unused jobs collector.""" from typing import cast from dateutil.parser import parse from collector_utilities.functions import days_ago from collector_utilities.type import Job from .base import GitLabJobsBase class GitLabUnusedJobs(GitLabJobsBase): """Collector class to get unused job counts from Gi...
""" Topological Sort Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v in the ordering. Topological Sorting for a graph is not possible if the graph is not a DAG. """ def topological_sort(graph): """ topological sort...
import json import pytest from mythx_models.exceptions import ValidationError from mythx_models.request import DetectedIssuesRequest from . import common as testdata def test_analysis_issues_request_from_valid_json(): req = DetectedIssuesRequest.from_json( json.dumps(testdata.DETECTED_ISSUES_REQUEST_DI...
import numpy as np import pyqmc import pandas as pd from pyscf.pbc import gto, scf from pyqmc.reblock import reblock from pyqmc.supercell import get_supercell from pyscf.pbc.dft.multigrid import multigrid from pyscf.scf.addons import remove_linear_dep_ import time import uuid def cubic_with_ecp(kind=0, nk=(1, 1, 1)):...
import csv import importlib import json import os import sys import types from typing import Tuple, Dict, Union, Text, List, Callable import yaml from loguru import logger from pydantic import ValidationError from yaml.loader import FullLoader from httprunner import builtin, utils from httprunner import exceptions fr...
# -*- coding: utf-8 -*- """ Created on Fri Oct 30 10:37:16 2015 @author: smudd """ from __future__ import absolute_import, division, print_function, unicode_literals from .LSDMap_BasicPlotting import * from .LSDMap_GDALIO import * from .LSDMap_BasicManipulation import * from .LSDMap_PointTools import * from .LSDMap_...
import tensorflow as tf import numpy as np def generator(project_shape, filters_list, name="generator"): model = tf.keras.Sequential(name=name) model.add(tf.keras.layers.Dense( units=np.prod(project_shape), input_shape=[100], use_bias=False, kernel_initializer='glorot...
import os import importlib import argparse import numpy as np from typing import Optional from torchvision import transforms import pytorch_lightning.loggers as pl_loggers from pytorch_lightning import Trainer from pytorch_lightning.callbacks import LearningRateMonitor, ModelCheckpoint from novel_view_data import CLE...
# 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...
#!/usr/bin/env python3 # Copyright (c) 2014-2017 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 the wallet.""" from test_framework.test_framework import BitcoinTestFramework from test_framework....
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name='aws-cli-utils', version='1.0.0', author="Albert Quiroga", author_email="albertquirogabertolin@gmail.com", description="CLI utilities to manage AWS resources", long_descr...
# Author: Xiangtai Li # Email: lxtpku@pku.edu.cn # Pytorch Implementation Of MSFNet: Real-Time Semantic Segmentation via Multiply Spatial Fusion Network(face++) # I didn't include the boundaries information import torch import torch.nn as nn class MSFNet(nn.Module): def __init__(self): super(MSFNet, sel...
'''------------------------------------------------------------------------------- Tool Name: AddSPTFields.py Source Name: AddSPTFields Version: ArcGIS 10.3 Author: Alan D. Snow, US Army ERDC Updated by: Description: Add fields to drainage line required for Streamflow Prediciton Tool History: In...
"""Job runner used to execute Galaxy jobs through Pulsar. More information on Pulsar can be found at https://pulsar.readthedocs.io/ . """ import errno import logging import os import re import subprocess from time import sleep import packaging.version import pulsar.core import yaml from pulsar.client import ( bu...
# orm/query.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """The Query class and support. Defines the :class:`_query.Query` class, the central c...
#!/usr/bin/env python import os from setuptools import setup # paths directory = os.path.abspath(os.path.dirname(__file__)) readme_path = os.path.join(directory, 'README.rst') try: long_description = open(readme_path, 'r').read() except IOError: long_description = '' setup(name='koodous', packages=['...
import pytest import networkx as nx from networkx.utils import edges_equal def test_tensor_product_raises(): with pytest.raises(nx.NetworkXError): P = nx.tensor_product(nx.DiGraph(), nx.Graph()) def test_tensor_product_null(): null = nx.null_graph() empty10 = nx.empty_graph(10) K3 = nx.compl...
import requests import base64 def medical_record_number_list(): """ Get the list of all patients' MRI list The function sends a 'GET' request to the server, get a string that includes all patient's MRI information as well as other unnecessary signals and punctuaions. Then it filters out only digi...
#!/usr/bin/env python # Copyright (c) 2013-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from __future__ import division,print_function,unicode_literals import biplist from ds_store import DSStore...
file1 = open('test.txt', 'a') file1.write('student') # 'w' write - записать # 'r' read - прочитать
"""Functions needed for the CKM matrix as well as for frequently used combinations of CKM elements. See the documentation of the ckmutil package for details on some of the functions: https://davidmstraub.github.io/ckmutil/ """ from math import cos,sin from cmath import exp,sqrt,phase import numpy as np from functool...
# The MIT License (MIT) # # Copyright (c) 2021 NVIDIA CORPORATION # # 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...
# flopy version file automatically created using...pre-commit.py # created on...October 19, 2018 18:28:49 major = 3 minor = 2 micro = 10 build = 0 commit = 2892 __version__ = '{:d}.{:d}.{:d}'.format(major, minor, micro) __build__ = '{:d}.{:d}.{:d}.{:d}'.format(major, minor, micro, build) __git_commit__ = '{:d}'.forma...
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: pirates.effects.VoodooShieldBlast from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.particles i...
from hp_procurvearuba import HP import yaml with open('devices.yml', 'r') as f: device_data = yaml.safe_load(f) device_data = device_data.pop('devices') device_data = device_data def main(): for device in device_data: hp_obj = HP(**device) hp_obj.find_switch_serial_number() hp_...
#!/usr/bin/env python # -*- coding: utf-8 -* from lib import * import encode encRunes = [x.decode("utf-8") for x in encRunes] runeDict = {} for c in range(0, len(encRunes)): runeDict[encRunes[c]] = pairs[c] def shortestDistance(firstRune, secondRune): l = key firstIndex = l.index(firstRune) secondIndex = l.inde...
#!/usr/bin/env python """ This tool takes a MySQL dump of the Robinhood ``entries`` table and generates a per-inode-type size histogram directly. It also optionally dumps the raw collection of (inode type, inode size) tuples for every inode in the entries table into a CSV file. """ import os import csv import sys imp...
from collections import OrderedDict from utility.printable import Printable class Transaction(Printable): """A transaction which can be added to a block in the blockchain. Attributes: :sender: The sender of the coins. :recipient: The recipient of the coins. :signature: The signature o...
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
# -*- coding: utf-8 -*- """ :copyright: Copyright 2020 Sphinx Confluence Builder Contributors (AUTHORS) :license: BSD-2-Clause (LICENSE) """ from sphinxcontrib.confluencebuilder.logger import ConfluenceLogger import mimetypes """ dictionary of deprecated configuration entries and associated message """ DEPRECATED_CON...
# -*- coding: utf-8 -*- from __future__ import print_function from pathlib import Path from setuptools import setup from setuptools import find_packages HERE = Path(__file__).parent NAME = 'jupyter_tools' ABOUT = dict() exec(Path(HERE, NAME, '__about__.py').read_text(), ABOUT) README: str = Path(HERE, "README.rs...
"""Compute regression statistics without measurement error. The regression outputs include measurement error, which will pull down correlation statistics. """ import argparse from collections import defaultdict import gzip import numpy as np import scipy.stats def parse_args(): """Parse arguments. Returns...
from murt import Tracer my_tracer = Tracer() tx_pos = [0, 15, 0] rx_pos = [-30, 1.5, 45] tx_freq = 2.4e9 scene_permitivity = 5.3 # Concrete result = [(2, [(-19.24, 8.56, 28.86)]), (3, (-28.94, 4.22, 62.39)), (3, (-70.80, 7.04, 15.22))] losses = my_tracer.get_total_loss( tx_pos, rx_pos, res...
import csv import datetime import io import logging import re import zipfile import dateutil.parser from dateutil.tz import tzutc from parsel import Selector from brightsky.utils import cache_path, download logger = logging.getLogger(__name__) class Parser: DEFAULT_URL = None def __init__(self, path=Non...
import torch import numpy as np from copy import deepcopy from typing import Any, Dict, Tuple, Optional from tianshou.policy import DDPGPolicy from tianshou.data import Batch, ReplayBuffer from tianshou.exploration import BaseNoise, GaussianNoise class TD3Policy(DDPGPolicy): """Implementation of TD3, arXiv:1802....
# encoding: utf-8 """ bgp.py Created by Thomas Mangin on 2009-08-30. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ import os import sys import stat import platform import syslog import string from exabgp.util.dns import warn from exabgp.logger import L...
# 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 use ...
# -*- coding: utf-8 -*- # # This class was auto-generated from the API references found at # https://support.direct.ingenico.com/documentation/api/reference/ # from ingenico.direct.sdk.data_object import DataObject from ingenico.direct.sdk.domain.additional_order_input import AdditionalOrderInput from ingenico.direct.s...
# For n = 5, print the following pattern: ''' * * * * * * * * * * * * * * * ''' # The pattern should grow for various values of n, and should be symmetrical. # n should be a positive value. def print_pattern(n): for i in range(n): for j in range(i + 1): print("*", end=" ") print() # ...
from setuptools import setup, find_packages import codecs import os import re import sys here = os.path.abspath(os.path.dirname(__file__)) # Read the version number from a source file. # Why read it, and not import? # see https://groups.google.com/d/topic/pypa-dev/0PkjVpcxTzQ/discussion def find_version(*file_paths):...
import bluetooth import time #values to send to wii fit board(hex) source: https://github.com/skorokithakis/gr8w8upd8m8/blob/master/gr8w8upd8m8.py CONTINUOUS_REPORTING = "04" #command values for ligts, registering, reading, reporting COMMAND_LIGHT = 11 COMMAND_REPORTING = 12 COMMAND_REQUEST_STATUS = 15 COMMAND_REGI...
import importlib import importlib.util import logging import os import sys from enum import Enum from typing import List, Set, Generator from moonspec import _MOONSPEC_RUNTIME_STATE from moonspec.output import Output from moonspec.state import SpecCaseDefinition LOGGER = logging.getLogger('moonspec') class SpecResu...
# 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 u...
import os import random import string from telegram import Bot, ReplyKeyboardMarkup, ParseMode from telegram.ext import Dispatcher, Updater, MessageHandler, Filters, CommandHandler from telegram.update import Update from words import words PASSWORDS_COUNT = 5 BOT_TOKEN = os.environ['BOT_TOKEN'] HELP_MESSAGE = '''...
""" Django settings for crawler project. Generated by 'django-admin startproject' using Django 1.11.6. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os...
import os.path import unittest import tempfile import cStringIO import sys from Bio.Nexus import Nexus, Trees class NexusTest1(unittest.TestCase): def setUp(self): self.testfile_dir = "Nexus" self.handle = open(os.path.join(self.testfile_dir, "test_Nexus_input.nex")) def tearDow...
from distutils.core import setup setup( name = 'equalstrue', # How you named your package folder (MyLib) packages = ['equalstrue'], # Chose the same as "name" version = '0.1', # Start with a small number and increase it with every change you make license='MIT', # Chose a license from here:...
# proxy module from __future__ import absolute_import from mayavi.tools.data_wizards.data_source_factory import *
import random, base64, copy import numpy as np from src.helper.file import File from src.helper.video_file import * from src.helper.cipher import decrypt_vigenere class Extractor: def __init__(self, file_dir, key): # Extract video video_file = VideoFile(file_dir) self.frames = c...
from jdaviz.core.helpers import ConfigHelper from ..default.plugins.line_lists.line_list_mixin import LineListMixin class CubeViz(ConfigHelper, LineListMixin): """CubeViz Helper class""" _default_configuration = 'cubeviz' @property def fitted3d(self): """ Returns the 3D fitted model p...
import sys import pandas as pd import numpy as np from sklearn.preprocessing import Binarizer, MaxAbsScaler, MinMaxScaler from sklearn.preprocessing import Normalizer, PolynomialFeatures, RobustScaler, StandardScaler from sklearn.decomposition import FastICA, PCA from sklearn.kernel_approximation import RBFSampler, Ny...
#!/usr/bin/env python from __future__ import division import sys, os, subprocess,inspect, multiprocessing, shutil, argparse, time, csv, glob from Bio import SeqIO from natsort import natsorted currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir)...
import re from pathlib import Path import xlrd def currency_to_float(value): """Converte de R$ 69.848,70 (str) para 69848.70 (float).""" try: cleaned_value = value.replace("R$", "").replace(".", "").replace(",", ".") return float(cleaned_value) except ValueError: return def extr...
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
import datetime import urllib.request, urllib.parse, urllib.error import re import os from http.cookiejar import CookieJar from .central import CentralBase from ..utils import utils class DelhiWeekly(CentralBase): def __init__(self, name, storage): CentralBase.__init__(self, name, storage) self.ba...
from django.shortcuts import render from django.contrib.auth.models import User, Group from rest_framework import viewsets from employee.models import AppoveGroup, Department, Profile, Positions, Prename from employee.serializers import GroupSerializer, UserSerializer, AppoveGroupSerializer from employee.serializers im...
import pkgutil from importlib import import_module from django.conf import settings from django.core.exceptions import ImproperlyConfigured # For backwards compatibility with Django < 3.2 from django.utils.connection import ConnectionDoesNotExist # NOQA: F401 from django.utils.connection import BaseConnectionHandler ...
_base_ = './mask_rcnn_r50_fpn_sample1e-3_mstrain_2x_lvis.py' model = dict( pretrained='open-mmlab://resnext101_32x4d', backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_...
import typing # HLD class HeavyLightDecomposition: def __init__(self, G: list) -> None: self.G = G self.n = len(G) self.par = [-1] * self.n self.size = [1] * self.n self.head = [0] * self.n self.preord = [0] * self.n self.k = 0 for v in range(self.n): if self.par[v] == -1: self.dfs_sz(v) se...
# Python import pytest from unittest import mock from contextlib import contextmanager from awx.main.models import Credential from awx.main.tests.factories import ( create_organization, create_job_template, create_instance, create_instance_group, create_notification_template, create_survey_spe...
""" Uzupełnij klasę Calculator o obsługę wyjątków (1pkt). Podnoszone wyjątki: - błędna operacja - WrongOperation - błędne argumenty (nie liczba) - NotNumberArgument - pusta pamięć (zarówno przy pytaniu o pamięć jak i operację z argumentem domyślnym) - EmptyMemory - dzielenie przez zero jest przekształcane w CalculatorE...
#! /usr/bin/python # -*- coding: utf-8 -*- __author__ = "Osman Baskaya" """ """ import sys import re from collections import defaultdict as dd # add.v.1 path = sys.argv[1] regex = re.compile('<((\w+\.\w)\.(\d+))>') # for s10, s13 if path.startswith('s07-test'): regex = re.compile('<((\w+\.\w)\.(.*))>') # fo...
import pykka import logging import thread import threading from datetime import datetime, timedelta from email.utils import parsedate_tz from mopidy import core from twython import TwythonStreamer from mopidy.audio import PlaybackState def to_datetime(datestring): time_tuple = parsedate_tz(datestring.strip()) ...
''' Leetcode problem No 110 Balanced Binary Tree ''' class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def height(self, root): if not root: return 0 else: return 1 + max(self.height(root.left), self.height(root.right)) def isBala...
""" Copyright (2018) Chris Scuderi 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, softwar...
# -*- coding: utf-8 -*- ############################################################################### # # PackageServicesRequest # Request USPS Parcel Post, Bound Printed Matter, Library Mail, or Media Mail shipping information for a given origin and destination. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014,...
# Copyright 2013 IBM 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 copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
# for n in range(400,500): # i = n // 100 # j = n // 10 % 10 # k = n % 10 # if n == i ** 3 + j ** 3 + k ** 3: # print(n) # 第一道题(16) # input("请输入(第一次):") # s1 = input("请输入(第二次):") # l1 = s1.split(' ') # l2 = [] # for i in l1: # if i.isdigit(): # l2.append(int(i)) # for i in l2: # ...
# coding=utf-8 # 管道对象 class Pipeline: '''完成对管道对象的封装''' def process_item(self, item): ''' 实现对item对象的处理 :param item: item对象 :return: ''' print("item:", item.data)
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as SsnProvider from faker.generator import random from faker.providers.date_time import Provider as DateProvider from faker.providers import BaseProvider """ For more info on rijksregisternummer, see https://nl.wikipedia.org/wiki/Rijksregi...
""" Constructs for grouping tool parameters """ import logging import os import unicodedata from six import ( StringIO, text_type ) from galaxy.datatypes import sniff from galaxy.exceptions import ( AdminRequiredException, ConfigDoesNotAllowException, ) from galaxy.util import ( inflector, rel...
#!/usr/bin/env python ############################################################################### ## Databrowse: An Extensible Data Management Platform ## ## Copyright (C) 2012-2016 Iowa State University Research Foundation, Inc. ## ## All rights reserved. ...
# -*- coding: utf-8 -*- # Copyright 2020 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...
# This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
from flask_restful import Resource from api.access_control import login_required from app import app_main from constants.constants import BIND_USERS, BIND_MOVIES def create_test_app(user_db_path, movie_db_path): test_app = app_main.create_app() test_app.config.update( SQLALCHEMY_BINDS={ B...
# SCH1101.SH --> JB_BOOKINGS_REJ_TRUNCATE #************************************************************************************************************** # # Created by : Vinay Kumbakonam # Modified by : bibin # Version : 1.2 # # Description : # 1. Truncates the 'BOOKINGS_REJ' table based on Oracle proce...
import torch from torch_geometric.utils import degree, to_undirected from pGRACE.utils import compute_pr, eigenvector_centrality def drop_feature(x, drop_prob): drop_mask = torch.empty((x.size(1),), dtype=torch.float32, device=x.device).uniform_(0, 1) < drop_prob x = x.clone() x[:, drop_mask] = 0 re...
"""Tests for AmazonRow.""" from datetime import datetime import pytest from tests.testlibraries.instance_resource import InstanceResource from zaimcsvconverter.inputcsvformats.amazon_201911 import ( Amazon201911DiscountRow, Amazon201911PaymentRow, Amazon201911RowData, Amazon201911RowFactory, Amazo...
# 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. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# skipcq: PTC-W6004 """Tests for stain normalization code.""" import pathlib import numpy as np import pytest from click.testing import CliRunner from tiatoolbox import cli from tiatoolbox.data import _local_sample_path, stain_norm_target from tiatoolbox.tools import stainextract from tiatoolbox.tools.stainnorm impo...
'''https://practice.geeksforgeeks.org/problems/merge-two-sorted-arrays5135/1 Merge Without Extra Space Hard Accuracy: 36.41% Submissions: 93026 Points: 8 Given two sorted arrays arr1[] of size N and arr2[] of size M. Each array is sorted in non-decreasing order. Merge the two arrays into one sorted array in non-decrea...
import dataclasses import inspect from datetime import datetime, timedelta from functools import lru_cache from hashlib import md5 from typing import Any, List, Optional from fastapi import APIRouter, Depends, HTTPException, Query, Request, Response from pydantic import BaseSettings from .. import __version__ from . ...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Machinecoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import MachinecoinTestFramework from test_framework.util import * ...
""" Define a region of interest (ROI) in color, magnitude, and direction space. The ROI is divided into 3 regions: 1) The 'target' region: The region occuping the likelihood-scale healpix pixel over which the likelihood is evaluated. (Size controlled by 'nside_likelihood') 2) The 'interior' region: The region wh...
# coding=utf-8 # Copyright 2020 The Google Research 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 applicab...
import pandas as pd import numpy as np import os import glob import math from pystatplottools.utils.multiple_inheritance_base_class import MHBC class ConfigurationLoader(MHBC): def __init__(self, **kwargs): # For child classes with more than one parent class super().__init__(**kwargs) s...
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. """ Detection Training Script. This scripts reads a given config file and runs the training or evaluation. It is an entry point that is made to train standard models in detectron2. In order to let one script support training of many models, this...
# -*- coding: utf-8 -*- """ Django settings for kolibri project. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ from __future__ import absolute_import from __fut...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Setup file for siftsite. This file was generated with PyScaffold 2.5.7, a tool that easily puts up a scaffold for your new Python project. Learn more under: http://pyscaffold.readthedocs.org/ """ import sys from setuptools import setup def setup_pack...
import os import cv2 as cv import numpy as np DIR = os.path.dirname(os.path.abspath(__file__)) DATA_PATH = os.path.join(os.path.dirname(DIR), 'Data', 'cats_and_dogs_small') model_path = os.path.join(DIR, 'models') test_dir = os.path.join(DATA_PATH, 'test') i = 1500 image_1 = os.path.join(test_dir, 'cats', f'cat.{i}.jp...
from django import template register = template.Library() @register.filter def subtract(value, arg): return value - arg
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator import os import sys OUT_CPP="qt/lkcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' form...
import codecs import os import re import sys import time from typing import IO, AnyStr, Optional, Union from cibuildwheel.util import CIProvider, detect_ci_provider DEFAULT_FOLD_PATTERN = ("{name}", "") FOLD_PATTERNS = { "azure": ("##[group]{name}", "##[endgroup]"), "travis": ("travis_fold:start:{identifier}\...
#!/usr/bin/env python3 import re class Error(Exception): """Base class for exceptions in this module.""" pass def count_space(s): space = 0 for i in s: if i == ' ': space += 1 else: break return space def order_key(a, b): idx_dict = {} idx_dict["all...