text
stringlengths
2
999k
# Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import from .upload_pretrained import UploadPretrainedModelTask from .caffe_upload import CaffeUploadTask from .torch_upload import TorchUploadTask from .mxnet_upload import MxnetUploadTask __all__ = [ 'UploadPret...
import tensorflow as tf import numpy as np import os import sys from window_cell import WindowCell np.set_printoptions(threshold=sys.maxsize) class AttentionMDN(object): ''' Contains useful methods for training, testing, and validating a mixture density network. ''' def __init__(self, session...
import os, sys, argparse, time import json from tqdm import tqdm import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch_geometric.data import DataLoader from tensorboardX import SummaryWriter sys.path.append('..') from models.ddi_predictor import DDIPredictor from mode...
from __future__ import division import binascii import base64 from six import int2byte, b, integer_types, text_type class UnexpectedDER(Exception): pass def encode_constructed(tag, value): return int2byte(0xa0+tag) + encode_length(len(value)) + value def encode_integer(r): assert r >= 0 # can't supp...
print "Hello world in PYTHON"
# 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. # C...
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
import logging import secrets import asyncio from concurrent.futures import Future as ThreadFuture from aiohttp.web import Application, run_app, Response from .message import ActorMessage, ContentEncoding, ActorMessageDecodeError, UnsupportContentEncodingError from .queue import ActorMessageQueue from .registery impo...
import sys import time import requests from piws_api import config, db LOGGER = config.LOGGER def run(): """Control module to run the program to check for new observations to send to API. """ LOGGER.info('Running PiWS API ( `send_data.run()` )') while True: try: process_observ...
# Copyright 2014-present PlatformIO <contact@platformio.org> # # 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 applicabl...
#!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.response.AlipayResponse import AlipayResponse class SsdataDataserviceRiskAntimarketcheatQueryResponse(AlipayResponse): def __init__(self): super(SsdataDataserviceRiskAntimarketcheatQueryResponse, self).__init__()...
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
from .roi_align import RoIAlign __all__ = ['RoIAlign']
''' /django_api/vol/views.py ------------------------- Organize the views of Vol ''' import json from django.http import JsonResponse from django_api.vol.models import Vol def all_scores(request): if request.method == 'GET': all_vols = list(Vol.objects.all()) scores = [] for i in all_vols...
# -*- coding: utf-8 -*- # The Computer Language Benchmarks Game # http://shootout.alioth.debian.org/ # # contributed by Kevin Carson # modified by Tupteq, Fredrik Johansson, and Daniel Nanz import time def combinations(l): result = [] for x in xrange(len(l) - 1): for j in xrange(x+1, len(l)): ...
# -*- coding: utf-8 -*- # Copyright (c) 2019, CRS4 # # 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,...
""" pygslib: GSLIB in python Copyright 2020, Adrian Martinez Vargas. Licensed under MIT. """ import setuptools #required to build wheels import sys import os # get version from package exec(open('pygslib/version.py').read()) version = __version__ description = 'Python module for mineral resource est...
# coding: utf-8 # In[1]: def pd_bninception_v3(): import torch model_name = 'pd_bninception_v3' device = 'cuda:0' torch.backends.cudnn.benchmark = True # In[2]: import numpy as np import pandas as pd from sklearn.model_selection import KFold, StratifiedKFold from sklearn.u...
# Copyright (c) 2021 PaddlePaddle 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 app...
import argparse import time import torchvision import torch from torchvision import transforms as T from PIL import Image import importlib.util import tensorflow_datasets as tfds import tensorflow_hub as hub import sys import os import yaml import re import numpy as np import subprocess import random # import tensor...
# Copyright 2018 jem@seethis.link # Licensed under the MIT license (http://opensource.org/licenses/MIT) from hid_keycodes import * lang = 'Latvian' country = 'Latvia' scancode_map = { KC_0: ('0', ')', '', '0', ')', ''), KC_1: ('1', '!', '', '1', '!', ''), KC_2: ('2', '@', '', '2', '«', ''), KC_3: ('3', ...
""" Evaluation of single result file. Yu Fang - March 2019 """ import os, glob, sys import xml.dom.minidom # from functools import cmp_to_key from itertools import groupby from table_evaluation.data_structure import * from os.path import join as osj class eval: STR = "-str" REG = "-reg" DEFAULT_ENCODING ...
# Pansharpened Image Process using Rasterio # Landsat Util # License: CC0 1.0 Universal from __future__ import print_function, division, absolute_import import sys import subprocess from termcolor import colored class VerbosityMixin(object): """ Verbosity Mixin that generates beautiful stdout outputs. "...
from torchvision.datasets.utils import download_and_extract_archive vizdoom_url = 'https://docs-assets.developer.apple.com/ml-research/datasets/gsn/vizdoom.zip' data_dir = '/media/data1/visdoom/' download_and_extract_archive(url=vizdoom_url, download_root=data_dir)
"""Core views, including the main homepage, post-commit build hook, documentation and header rendering, and server errors. """ from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, Http404, ...
from tfrecord_tj import tools from tfrecord_tj import torch from tfrecord_tj import example_pb2 from tfrecord_tj import iterator_utils from tfrecord_tj import reader from tfrecord_tj import writer from tfrecord_tj.iterator_utils import * from tfrecord_tj.reader import * from tfrecord_tj.writer import *
import math import pytest from nlp_profiler.core import NOT_APPLICABLE, spelling_quality_score, \ spelling_quality, spelling_quality_summarised # noqa good_spelling_text = 'People live in this area. It is not a good area. People live in this area. It is not a good area. 2833047 people live in this area. It is n...
# -------------------------------------------------------- # Decoupled Classification Refinement # Copyright (c) 2018 University of Illinois # Licensed under The MIT License [see LICENSE for details] # Modified by Bowen Cheng # -------------------------------------------------------- # Based on: # Deformable Convolutio...
from . import detector
plants = [] people = input() starting_fruits = input() for i in range(starting_fruits): plants.append(0) week = 1 while True: if reduce(lambda x, y: x + y, plants) >= people: print week break plants = map(lambda x: x+1, plants) for i in range(reduce(lambda x, y: x + y, plants)): ...
from operator import getitem from functools import partial import pytest from dask.utils_test import add, inc from dask.core import get_dependencies from dask.optimize import (cull, fuse, inline, inline_functions, functions_of, fuse_getitem, fuse_selections, fuse_linear) def double(x): ...
import click @click.group("keys", short_help="Manage your keys") @click.pass_context def keys_cmd(ctx: click.Context): """Create, delete, view and use your key pairs""" from pathlib import Path root_path: Path = ctx.obj["root_path"] if not root_path.is_dir(): raise RuntimeError("Please initia...
from __future__ import print_function import os try: # Needed for Python 2.6 compatibility import unittest2 as unittest except ImportError: import unittest import tempfile from desktopmagic.screengrab_win32 import getDisplayRects, saveRectToBmp, getRectAsImage, GrabFailed try: # Pillow or PIL from PIL import Im...
import pickle def load(filename): with open(filename, 'rb') as f: return pickle.load(f) def dump(obj, filename): with open(filename, 'wb') as f: return pickle.dump(obj, f)
import os import json import requests if __name__ == '__main__': url = 'http://localhost:8080/remote/object/call' script_file = os.path.abspath(os.path.join(os.path.dirname(__file__), './scripts/integrate.py')) data = { "objectPath": "/Script/PythonScriptPlugin.Default__PythonScriptLibrary", ...
# 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 applica...
indices_get_response = { 'index-000005': {}, 'index-000004': {}, 'index-000003': {}, 'index-000002': {}, 'index-000001': {}, } indices_aggregation_response = { 'took': 6, 'timed_out': False, '_shards': {'total': 5, 'successful': 5, 'skipped': 0, 'failed': 0}, 'hits': { 'tota...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='cl2nc', version='3.3.1', description='Convert Vaisala CL51 and CL31 dat files to NetCDF', author='Peter Kuma', author_email='peter@peterkuma.net', license='MIT', py_modules=['cl2nc'], entry_points={ ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals # Real data - cp tests import os import re import unittest from sys import version_info if version_info < (3, ): import unicodecsv as csv else: import csv import hgvs.dataproviders.uta import hgvs.vari...
import io import numpy import wand.image import wand.color from PIL import Image def get_pdf_background(pdf_file_path: str, page_number: int) -> Image.Image: """ Create a screenshot of this PDF page using Ghostscript, to use as the background for the matplotlib chart. """ # Appending e.g. [0] to ...
import subprocess filename = 'bot.py' while True: p = subprocess.Popen('python '+filename, shell=True).wait() if p != 0: continue else: break
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # Modifications copyright (c) 2020 Computing Systems Group. # # 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.ap...
# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project au...
import contextlib import os from typing import List from unittest.mock import Mock, patch import pytest import torch from ludwig.utils.torch_utils import ( _get_torch_init_params, _set_torch_init_params, initialize_pytorch, sequence_length_2D, sequence_length_3D, ) @pytest.mark.parametrize("inpu...
# Copyright 2019 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. """Ensure servo v4 manufacturing script is robust.""" import unittest import mfg_servo_v4 as mfg class TestMfgServoV4(unittest.TestCase): def setUp...
# -*- coding: utf-8 -*- """0902_rand_cnn.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1p6_O9ie0cDHaiKxQBn935uTVwj85cEz9 """ ''' pilab seawavve random cnn 2020.05.20~ Acc: 91.28% Epoch:75 ****PATCH NOTE**** 0520 cnn network구성 0000 EarlyStop...
# -*- test-case-name: twisted.conch.test.test_cftp -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implementation module for the I{cftp} command. """ import os, sys, getpass, struct, tty, fcntl, stat import fnmatch, pwd, glob from twisted.conch.client import connect, default, options ...
"""copy of Ratchet lined with try-catch blocks to minimize risk of failure during main tournament""" from space import Space, SpaceType #custom space class containing information about a given board position import utilities as util#several misc functions that are unrelated to functionality or not specific to AI def c...
# Generated by Django 3.2.4 on 2021-06-07 10:32 from django.db import migrations, models import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Service', fields=[ ('id', model...
import datetime import freezegun from zeep import cache def test_sqlite_cache(tmpdir): c = cache.SqliteCache(path=tmpdir.join("sqlite.cache.db").strpath) c.add("http://tests.python-zeep.org/example.wsdl", b"content") result = c.get("http://tests.python-zeep.org/example.wsdl") assert result == b"con...
import sys, getopt from nwafu_login import NwafuLogin def guide(argv): print("Usage:\n"+argv+" -u <username> -p <password> \n"+argv+" --username=<username> --password=<password>\n") def main(argv): username = '' passwd = '' try: opts, args = getopt.getopt(argv, "hu:p:", ["username=", "password...
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") def google_java_format_jar(version = "1.9", sha256 = "1d98720a5984de85a822aa32a378eeacd4d17480d31cba6e730caae313466b97"): """Downloads the google-java-format JAR""" http_file( name = "google-java-format-jar", urls = [ ...
#!/usr/bin/env python # -*- coding=utf-8 -*- import enum import sys import binascii import hashlib import hmac import time import random import json import requests import warnings from base import BaseMonitorDimension from cbs import CbsModule from snapshot import SnapModule from ccr import CcrModule from base import ...
from unittest import TestCase from unittest.mock import patch from xrpl.constants import CryptoAlgorithm from xrpl.core import keypairs from xrpl.core.keypairs.exceptions import XRPLKeypairsException _DUMMY_BYTES = b"\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10" class TestMain(TestCase): # unfortu...
import torch import math from . import Encoder, Decoder, STFTFB # noqa from .stft_fb import perfect_synthesis_window from . import transforms from ..dsp.consistency import mixture_consistency def griffin_lim(mag_specgram, stft_enc, angles=None, istft_dec=None, n_iter=6, momentum=0.9): """Estimates matching phas...
#!/usr/bin/python # # This file is part of Ansible # # Ansible 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) any later version. # # Ansible is distribut...
import unittest, doctest import pyzmail from pyzmail.parse import * class Msg: """mimic a email.Message""" def __init__(self, value): self.value=value def get_all(self, header_name, default): if self.value: return [self.value, ] else: return [] cla...
class ObjectView(dict): def __init__(self, *args, **kwargs): super(ObjectView, self).__init__(**kwargs) for arg in args: if not arg: continue elif isinstance(arg, dict): for key, val in arg.items(): self[key] = val ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'app.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow...
from class_gto import * from scipy import * from scipy import linalg from scipy import interpolate import sys import time def extract_sig(Sigma,oms_f_log,oms_f,outputname="SigGW.out"): data = zeros((len(oms_f),3),float) data[:,0] = oms_f Sig = Spline_Complex(Sigma, oms_f_log,oms_f) data[:,1] = real(Sig) data[:,2...
""" Classes for interpolating values. """ from __future__ import division, print_function, absolute_import __all__ = ['interp1d', 'interp2d', 'spline', 'spleval', 'splmake', 'spltopp', 'lagrange', 'PPoly', 'BPoly', 'NdPPoly', 'RegularGridInterpolator', 'interpn'] import itertools import warnin...
# -*- coding: utf-8 -*- import os import sys import sphinx_rtd_theme sys.path.insert(0, os.path.abspath('.')) # -- Project information ----------------------------------------------------- project = 'GitBuilder' copyright = '2018, Roie R. Black' author = 'Roie R. Black' version = '0.0.1' release = '0.0.1' language...
import re from six import string_types class Nullify(object): def __init__(self): self.need_underscore = re.compile(r'^_*NULL$') self.has_underscore = re.compile(r'^_(_*NULL)$') pass def stringy(self, value): return isinstance(value, string_types) def encode_null(self, v...
import copy import json import jsonpatch from collections import deque from enum import Enum from .gu_common import OperationWrapper, OperationType, GenericConfigUpdaterError, \ JsonChange, PathAddressing, genericUpdaterLogging class Diff: """ A class that contains the diff info between ...
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GLES2 import _types as _cs # End users want this... from OpenGL.raw.GLES2._types import * from OpenGL.raw.GLES2 import _errors from OpenGL.constant import Constant as _C ...
"""Initial migration Revision ID: 8ac3f3913194 Revises: Create Date: 2018-06-25 14:51:26.251450 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '8ac3f3913194' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto ...
import pandas as pd from sklearn.model_selection import train_test_split class DataLoader: def __init__(self): self.dataset = None self.sensor = None self.target = None def load(self,file,isTest=False): if not isTest: print("loading") self.dataset = pd.r...
import gc import platform import time import threading import pytest from kafka import KafkaConsumer, KafkaProducer, TopicPartition from kafka.producer.buffer import SimpleBufferPool from test.conftest import version from test.testutil import random_string def test_buffer_pool(): pool = SimpleBufferPool(1000, 1...
#!/usr/bin/env python3 # _*_ coding: utf-8 _*_ """Top-level code :author: Shay Hill :created: 7/2/2019 """ from pathlib import Path from typing import Optional, Union from warnings import warn from .docx_output import DocxContent from .docx_reader import DocxReader def docx2python( docx_filename: Union[str, Pat...
#!/usr/bin/python """ Compare Omega_HI, b_HI, and T_b for different models. """ import numpy as np import pylab as P from rfwrapper import rf from radiofisher import experiments as e z = np.linspace(0., 5., 1000) def poly(p, x): print "y =", for i in range(p.size): print "%4.4e x^%d +" % (p[i], i), ...
# Copyright DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
""" Provides Office 365 graph web API User Operations See: https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations """ # noqa from restclients.o365 import O365 from restclients.models.o365 import User as UserModel from urlparse import urlparse, parse_qs class User(O365): def __init__(self, *...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # Copyright (c) 2021 Microsoft Corporation. Licensed under the MIT license. # Set up custom environment before nearly anything else is imported # NOTE: this should be the first import (no not reorder) import sys import os sys.path.append(os.getcwd...
from slackviewer.app import app as application from slackviewer.archive import extract_archive from slackviewer.reader import Reader from slackviewer.appconfig import set_env_params import os try: from flask import _app_ctx_stack as stack except ImportError: from flask import _request_ctx_stack as stack set_...
# Copyright 2018 Open Source Robotics Foundation, 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...
import kufar from regions import * import telegram #var = telegram.loop_updates_handler() var = kufar.loop_updates_handler()
from .exceptions import AlreadyRegistered, NotRegistered from .signals import content_required, existence_required, source_saved from .utils import autodiscover, call_strategy_method class GeneratorRegistry: """ An object for registering generators. This registry provides a convenient way for a distributa...
# coding=utf-8 """ Extended API commands encapsulate the core commands and provide additional functionality such as address generation and signatures. References: - https://github.com/iotaledger/wiki/blob/master/api-proposal.md """ from __future__ import absolute_import, division, print_function, \ unicode_litera...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import AbstractUser from django.contrib.auth.base_user import BaseUserManager import uuid class UserManager(BaseUserManager): use_in_migrations = True def _create_user(self, username, emai...
from .ppo_controller import PPOMAC from .sac_controller import SACMAC from .basic_controller import VectorMAC REGISTRY = {} REGISTRY["vectormac"] = VectorMAC REGISTRY["sacmac"] = SACMAC REGISTRY["ppomac"] = PPOMAC
# The MIT License (MIT) # # gTTS: Copyright © 2014-2018 Pierre Nicolas Durette # https://github.com/pndurette/gTTS # # This code was modified by Aculeasis, 2020 import re import base64 import gtts import requests import urllib3 from gtts.tts import log, gTTSError from .proxy import proxies # TODO: Следить за актуа...
import nltk nltk.download('sentiwordnet') nltk.download('wordnet') nltk.download('averaged_perceptron_tagger') nltk.download('stopwords') nltk.download('punkt') from textblob import TextBlob from nltk.corpus import wordnet as wn import pandas as pd import numpy as np from nltk.stem import WordNetLemmatizer import nlt...
from __future__ import annotations from typing import Optional from datetime import datetime from pydantic import * class HospReservationBase(BaseModel): pass class HospReservationCreate(HospReservationBase): user_id: int date: datetime class HospReservation(HospReservationBase): id: int user_...
# -*- coding: utf-8 -*- # # 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 #...
# Copyright 2012 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 requ...
import os import numpy as np import keras.backend as K from keras import layers from keras import metrics from keras.layers import Input from keras.layers import Activation from keras.layers import Conv2D from keras.layers import MaxPooling2D from keras.layers import ZeroPadding2D from keras.layers import BatchNormali...
# -*- coding: utf-8 -*- # # Copyright (C) 2022 Chris Caron <lead2gold@gmail.com> # All rights reserved. # # This code is licensed under the MIT License. # # 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 th...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018 Kyoto University (Hirofumi Inaguma) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """Evaluate ASR model.""" import copy import logging import os import sys import time from neural_sp.bin.args_asr import parse_args_eval from neural_sp.bin...
# Generated by Django 4.0.2 on 2022-02-27 10:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('portfolio', '0001_initial'), ] operations = [ migrations.AddField( model_name='location', name='slug', f...
class Solution(object): def findSpecialInteger(self, arr): """ :type arr: List[int] :rtype: int """ t = len(arr) // 4 + 1 prev, c = arr[0], 1 for i in range(1, len(arr) - 1): if arr[i] == prev: c += 1 if c >= t: ...
# -*- coding: utf-8 -*- # Copyright (C) 2018 Nippon Telegraph and Telephone 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 # #...
from __future__ import print_function import sys import random import os from builtins import range import time sys.path.insert(1, "../../../") import h2o from tests import pyunit_utils from h2o.estimators.random_forest import H2ORandomForestEstimator from h2o.grid.grid_search import H2OGridSearch class Test_rf_gri...
from fuzzconfig import FuzzConfig from interconnect import fuzz_interconnect import re cfg = FuzzConfig(job="PLCROUTE", device="LFCPNX-100", sv="../shared/route_100.v", tiles=["R16C22:PLC"]) def main(): cfg.setup() r = 16 c = 22 nodes = ["R{}C{}_J*".format(r, c)] extra_sources = [] extra_sourc...
# Generated by Django 3.1.8 on 2021-05-21 10:08 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('course', '0008_auto_20210511_0235'), ('users', '0001_initial'), ] operations = [ migrations.AlterUniqueTogether( name='courseass...
from pykeepass import PyKeePass, create_database def load_db(path, pas): """ :param path: путь к файлу :param pas: пароль :return: объект PyKeePass по указанным параметрам """ kp = PyKeePass(path, password=pas) return kp def load_group(kp, name='Root'): """ :param kp: объект PyK...
# -*- coding: utf-8 -* import os from dotenv import load_dotenv dotenv_path = os.path.join(os.path.dirname(__file__), '.env') if os.path.exists(dotenv_path): load_dotenv(dotenv_path) from tingtushuo import create_app app = create_app(os.getenv('FLASK_ENV') or 'development') if __name__ == '__main__': app.ru...
""" The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total Hamming distance between all pairs of the given numbers. Example: Input: 4, 14, 2 Output: 6 Explanation: In binary representation, the 4 is 0100, 14 is 1110,...
# Copyright 2012 OpenStack Foundation # # 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 ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class Accoun...