code
stringlengths
10
805k
def_use_chains
listlengths
0
667
# 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...
[ [ [ 5282, 5296 ], [ 7243, 7257 ], [ 8138, 8152 ], [ 9063, 9077 ] ], [ [ 5319, 5326 ], [ 60781, 60788 ] ], [ [ 5334, 5350 ], [ 6070, 6072 ], [ ...
"""Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'translate.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: ...
[ [ [ 69, 71 ], [ 137, 139 ] ], [ [ 79, 82 ], [ 593, 596 ] ], [ [ 89, 93 ], [ 636, 640 ] ] ]
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Dusan Klinec, ph4r05, 2018 import binascii from binascii import unhexlify import unittest import aiounittest from monero_glue.xmr import common, crypto from monero_glue.xmr.core import ec_py class CryptoTest(aiounittest.AsyncTestCase): """Simple tests""" ...
[ [ [ 91, 99 ], [ 3874, 3882 ], [ 9105, 9113 ] ], [ [ 121, 130 ], [ 1373, 1382 ], [ 1841, 1850 ], [ 1974, 1983 ], [ 2294, 2303 ], [ 2427, ...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import hashlib from ccxt.base.errors import ExchangeError from ccxt.base.errors impor...
[ [ [ 226, 234 ], [ 984, 992 ] ], [ [ 242, 249 ], [ 173881, 173888 ] ], [ [ 279, 292 ], [ 26805, 26818 ], [ 27390, 27403 ], [ 27513, 27526 ], [ ...
from prometheus_client import CollectorRegistry from asyncworker.conf import settings from asyncworker.metrics.collectors.gc import GCCollector from asyncworker.metrics.collectors.platform import PlatformCollector from asyncworker.metrics.collectors.process import ProcessCollector NAMESPACE = ( f"{settings.METRIC...
[ [ [ 30, 47 ], [ 453, 470 ] ], [ [ 78, 86 ], [ 370, 378 ], [ 305, 313 ], [ 334, 342 ], [ 409, 417 ] ], [ [ 133, 144 ], [ 663, 674 ...
from typing import Dict, Optional, Union from ...error import GraphQLError from ...language import ( OperationTypeDefinitionNode, OperationType, SchemaDefinitionNode, SchemaExtensionNode, ) from ...type import GraphQLObjectType from . import SDLValidationContext, SDLValidationRule __all__ = ["UniqueOp...
[ [ [ 19, 23 ], [ 667, 671 ], [ 782, 786 ] ], [ [ 25, 33 ], [ 815, 823 ] ], [ [ 35, 40 ], [ 1206, 1211 ] ], [ [ 63, 75 ], [ 1583, ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from enum import Enum __all__ = [ 'CostAllocationPolicyType', 'CostAllocationResourceType', 'RuleStatus', ] class CostAllocationPolicyTy...
[ [ [ 186, 190 ], [ 328, 332 ], [ 475, 479 ], [ 627, 631 ] ], [ [ 192, 199 ] ], [ [ 298, 322 ] ], [ [ 443, 469 ] ], [ [ 611, 621 ] ] ]
import os import numpy as np import torch import torch.nn.functional as F from lib.utils.bbox_transform import decode_bbox_target from tools.kitti_object_eval_python.evaluate import evaluate as kitti_evaluate from lib.config import cfg import lib.utils.kitti_utils as kitti_utils import lib.utils.iou3d.iou3d_utils as i...
[ [ [ 7, 9 ], [ 1175, 1177 ], [ 2222, 2224 ], [ 2275, 2277 ], [ 2427, 2429 ], [ 2502, 2504 ], [ 2577, 2579 ], [ 2632, 2634 ], [ 2683, 2685 ...
from math import log10 from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import Matern import numpy as np from .utils import create_rng class BO: """ Bayesian Optimization framework """ def __init__(self, k, hidden_dim=(100, 10000), s...
[ [ [ 17, 22 ], [ 3747, 3752 ], [ 3788, 3793 ] ], [ [ 60, 84 ], [ 2140, 2164 ] ], [ [ 130, 136 ], [ 2172, 2178 ] ], [ [ 144, 155 ], [ 39...
# coding=utf-8 # Copyright 2022 The Deeplab2 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 law ...
[ [ [ 666, 668 ], [ 1777, 1779 ] ], [ [ 687, 692 ], [ 824, 829 ] ], [ [ 718, 731 ], [ 878, 891 ], [ 907, 920 ] ], [ [ 739, 755 ], [ 860,...
from rip_pages import rip_pages from read_pages import read_pages from format_csv import format_csv # STEP 1: CONFIG VARIABLES SOURCE_DOC = '114sdoc7' FILE_NAME = "GPO-CDOC-" + SOURCE_DOC + ".pdf" OUT_FILE = 'senate_data.csv' MISSING_FILE = 'missing_data.json' START_PAGE = 17 END_PAGE = 2259 # STEP 2: Rip text, read ...
[ [ [ 22, 31 ], [ 341, 350 ] ], [ [ 55, 65 ], [ 384, 394 ] ], [ [ 89, 99 ], [ 441, 451 ] ], [ [ 128, 138 ], [ 178, 188 ], [ 452, 4...
my_list = [1, 2, 2, 4, 6] #print reverse print(my_list[::-1]) student = {'user': 'Lubo', 'pass': 'admin', 'course': ['C# Fundamentals', 'C# ASP', 'Algorithms']} for key in student: print(key) for kvp in student.items(): print(f'the key is: {kvp[0]}, and values are: {kvp[1]} ') print(s...
[ [ [ 0, 7 ], [ 47, 54 ] ], [ [ 63, 70 ], [ 196, 203 ], [ 232, 239 ], [ 319, 326 ], [ 342, 349 ], [ 403, 410 ], [ 506, 513 ], [ ...
import datetime from dateutil.relativedelta import relativedelta print("Programa para calcular o prazo de exame de ultrassom...\nO mesmo deve ser feito entre 22 e 24 semanas de gestação") print("você deverá informar com quantas semanasa de gestação a paciente se encontra, no formato aaaa/mm/dd") semanas = int(input("C...
[ [ [ 7, 15 ], [ 456, 464 ], [ 531, 539 ] ], [ [ 51, 64 ], [ 479, 492 ], [ 555, 568 ] ], [ [ 298, 305 ], [ 401, 408 ], [ 427, 434 ...
from __future__ import annotations from typing import Generator, NoReturn class StdReader: def __init__( self, ) -> NoReturn: import sys self.buf = sys.stdin.buffer self.lines = self.async_readlines() self.chunks: Generator def async_readlines( self, ...
[ [ [ 23, 34 ] ], [ [ 55, 64 ], [ 266, 275 ], [ 325, 334 ], [ 460, 469 ] ], [ [ 66, 74 ], [ 135, 143 ] ], [ [ 83, 92 ], [ 1064, 10...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Tests for the astropylibrarian.reducers.utils module. """ from __future__ import annotations from typing import TYPE_CHECKING from astropylibrarian.reducers.utils import iter_sphinx_sections if TYPE_CHECKING: from .conftest import HtmlTestData ...
[ [ [ 149, 160 ] ], [ [ 181, 194 ], [ 265, 278 ] ], [ [ 240, 260 ], [ 768, 788 ], [ 2541, 2561 ] ], [ [ 306, 318 ], [ 374, 386 ] ], [ [ ...
# 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 applica...
[ [ [ 769, 784 ] ], [ [ 808, 816 ] ], [ [ 840, 854 ] ], [ [ 863, 868 ], [ 14912, 14917 ], [ 15671, 15676 ] ], [ [ 901, 907 ], [ 12686, 12692 ]...
__all__ = ["ChangeScene", "Runner", "WindowRunner", "NonInteractiveRunner", "newRunner"] from .. import config, render, Logger from ..events import EventLoopManager, WaitForUpdate, WaitForFixedUpdate, WaitForRender from ..errors import PyUnityException import copy import os class ChangeScene(Exception): pass cla...
[ [ [ 0, 7 ] ], [ [ 105, 111 ], [ 2163, 2169 ], [ 2983, 2989 ], [ 3894, 3900 ] ], [ [ 113, 119 ], [ 2263, 2269 ], [ 2343, 2349 ], [ 2569, ...
""" Sphinx plugins for RapidSMS documentation. """ try: import json except ImportError: try: import simplejson as json except ImportError: try: from django.utils import simplejson as json except ImportError: json = None from sphinx import addnodes, roles fro...
[ [ [ 68, 72 ] ], [ [ 117, 135 ] ], [ [ 210, 228 ] ], [ [ 269, 273 ] ], [ [ 301, 309 ], [ 1533, 1541 ] ], [ [ 311, 316 ], [ 1764, 1769 ] ...
#!/usr/bin/env python3 # pylint: disable=unused-import import collections import functools import io import itertools import operator as op import re import timeit import numpy as np import aocd YEAR = 2021 DAY = 11 def step(grid): grid += 1 flash = np.zeros_like(grid, dtype=bool) while np.any(grid[~fl...
[ [ [ 63, 74 ] ], [ [ 82, 91 ] ], [ [ 99, 101 ] ], [ [ 109, 118 ], [ 1302, 1311 ] ], [ [ 126, 140 ] ], [ [ 148, 150 ] ], [ [ 158, 164 ...
import unittest.mock as mock import pytest import requests_mock from openeo.rest.auth.auth import NullAuth, BearerAuth from openeo.rest.connection import Connection, RestApiConnection, connect, OpenEoApiError API_URL = "https://oeo.net/" @pytest.mark.parametrize( ["base", "paths", "expected_path"], [ ...
[ [ [ 7, 28 ], [ 2044, 2048 ], [ 2391, 2395 ], [ 2408, 2412 ], [ 2423, 2427 ], [ 2487, 2491 ], [ 2831, 2835 ], [ 2848, 2852 ], [ 2863, 2867 ...
import asyncio import json import logging from datetime import datetime from typing import Any, Dict, Iterable, List, Optional, Set, Union import httpx import websockets from websockets import exceptions logger = logging.getLogger("yufuquantsdk") class WebsocketAPIClient: def __init__(self, uri: str, ws: websoc...
[ [ [ 7, 14 ], [ 601, 608 ], [ 580, 587 ], [ 661, 668 ], [ 640, 647 ], [ 732, 739 ], [ 712, 719 ], [ 3578, 3585 ], [ 4725, 4732 ], [ ...
import discord from discord.ext import commands import os intents = discord.Intents.default() intents.members = True testing = False client = commands.Bot(command_prefix = "-", case_insensitive = True, intents=intents) client.remove_command('help') for filename in os.listdir('./cogs'): if filenam...
[ [ [ 7, 14 ], [ 73, 80 ] ], [ [ 40, 48 ], [ 154, 162 ] ], [ [ 57, 59 ], [ 283, 285 ] ], [ [ 63, 70 ], [ 100, 107 ], [ 222, 229 ...
# -*- coding: utf-8 -*- import logging import math import os import random import shutil import tensorflow as tf from jack import readers from jack.core.tensorflow import TFReader from jack.eval import evaluate_reader, pretty_print_results from jack.util.hooks import LossHook, ExamplesPerSecHook, ETAHook logger = l...
[ [ [ 32, 39 ], [ 319, 326 ] ], [ [ 47, 51 ], [ 2901, 2905 ] ], [ [ 59, 61 ], [ 2589, 2591 ], [ 6663, 6665 ], [ 3747, 3749 ], [ 7807, ...
#!/usr/bin/env python3 # Copyright 2019 Christian Henning # # 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...
[ [ [ 2305, 2309 ], [ 19821, 19825 ] ], [ [ 2318, 2323 ], [ 9674, 9679 ], [ 9696, 9701 ], [ 9932, 9937 ], [ 10076, 10081 ], [ 22271, 22276 ], [ ...
# 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 applica...
[ [ [ 739, 754 ] ], [ [ 778, 786 ] ], [ [ 810, 824 ] ], [ [ 857, 863 ], [ 6389, 6395 ], [ 6634, 6640 ], [ 7423, 7429 ], [ 12281, 12287 ], [ ...
from typing import List, Dict, Any import torch import trtorch._C from trtorch import _types def _supported_input_size_type(input_size: Any) -> bool: if isinstance(input_size, torch.Size): return True elif isinstance(input_size, tuple): return True elif isinstance(input_size, list): ...
[ [ [ 19, 23 ], [ 593, 597 ], [ 584, 588 ] ], [ [ 25, 29 ], [ 3731, 3735 ], [ 5862, 5866 ] ], [ [ 31, 34 ], [ 138, 141 ], [ 2125, 2128...
from django.conf.urls import patterns, url urlpatterns = patterns('appointments.views', url(r'^appointment/(?P<practice_id>\d+)/$', 'appointment_form', name='appointment_form'), url(r'^appointment/created/(?P<practice_id>\d+)/$', 'appointment_created', name='appointment_created'), )
[ [ [ 29, 37 ], [ 59, 67 ] ], [ [ 39, 42 ], [ 94, 97 ], [ 188, 191 ] ], [ [ 45, 56 ] ] ]
from PIL import Image from PIL import ImageDraw from PIL import ImageFont from rotary_class import RotaryEncoder class Display(): def __init__(self, disp): self.disp = disp self.dimensions = (disp.width, disp.height) self.image = Image.new('1', self.dimensions) self.draw = ImageDraw...
[ [ [ 16, 21 ], [ 259, 264 ] ], [ [ 38, 47 ], [ 311, 320 ] ], [ [ 64, 73 ], [ 358, 367 ] ], [ [ 99, 112 ], [ 1888, 1901 ] ], [ [ 120...
from tests.analyzer.utils import UnusedTestCase from unimport.statement import Import, ImportFrom class AsImportTestCase(UnusedTestCase): def test_as_import_all_unused_all_cases(self): self.assertSourceAfterScanningEqualToExpected( """\ from x import y as z import x ...
[ [ [ 33, 47 ], [ 123, 137 ] ], [ [ 79, 85 ], [ 757, 763 ], [ 2596, 2602 ], [ 3428, 3434 ] ], [ [ 87, 97 ], [ 519, 529 ], [ 923, 933 ...
import os from .takeout_sqlite3 import SQLite3 import multiprocessing CONTACTS = 'Contacts' + os.sep + 'All Contacts' + os.sep + 'All Contacts.vcf' DRIVE = 'Drive' MY_ACTIVITY_ASSISTANT_PATH = 'My Activity' + os.sep + 'Assistant' + os.sep + 'MyActivity.html' MY_ACTIVITY_GMAIL_PATH = 'My Activity' + os.sep + 'Gmail' +...
[ [ [ 7, 9 ], [ 95, 97 ], [ 121, 123 ], [ 211, 213 ], [ 234, 236 ], [ 302, 304 ], [ 321, 323 ], [ 400, 402 ], [ 430, 432 ], [ 50...
from __future__ import print_function import os import pickle import time from gym_puyopuyo import register import gym import numpy as np import neat import visualize piece_shape = (3, 2) DRAW_NETS = False NUM_COLORS = 3.0 # 3 colors in the small env mode # TODO: could probably read color number from observation da...
[ [ [ 23, 37 ] ], [ [ 46, 48 ], [ 1108, 1110 ], [ 1152, 1154 ] ], [ [ 56, 62 ], [ 1026, 1032 ] ], [ [ 70, 74 ], [ 1637, 1641 ] ], [ [ ...
import uuid from app import db from app.dao.dao_utils import transactional from app.models import ( BroadcastMessage, BroadcastEvent, BroadcastProvider, BroadcastProviderMessage, BroadcastProviderMessageNumber, BroadcastProviderMessageStatus ) def dao_get_broadcast_message_by_id_and_service_i...
[ [ [ 7, 11 ], [ 1402, 1406 ] ], [ [ 29, 31 ], [ 1639, 1641 ], [ 1676, 1678 ], [ 1925, 1927 ], [ 1973, 1975 ] ], [ [ 62, 75 ], [ 1286, ...
# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2020 www.open3d.org # # Permission is her...
[ [ [ 1480, 1489 ], [ 1589, 1592 ] ], [ [ 1509, 1522 ], [ 1527, 1540 ] ], [ [ 1643, 1644 ] ], [ [ 1704, 1705 ] ] ]
import os def to_bool(value): return ( value is True or (isinstance(value, str) and value.lower() in ['true', 'yes']) or (isinstance(value, (int, float)) and value > 0) ) bind = '0.0.0.0:{}'.format(os.getenv('GUNICORN_PORT', '8000')) max_requests = int(os.getenv('GUNICORN_MAX_REQUEST...
[ [ [ 7, 9 ], [ 234, 236 ], [ 289, 291 ], [ 360, 362 ], [ 417, 419 ], [ 468, 470 ], [ 529, 531 ], [ 636, 638 ], [ 686, 688 ] ], [ ...
import pytest from skidl import * from .setup_teardown import * def test_pin_names_1(): codec = Part("xess.lib", "ak4520a") assert codec["ain"] == codec.n["ain"] assert codec[1:4] == codec.p[1:4] def test_pin_names_2(): codec = Part("xess.lib", "ak4520a") codec[4].name = "A1" codec[8].name...
[ [ [ 7, 13 ] ], [ [ 33, 34 ] ], [ [ 64, 65 ], [ 104, 108 ], [ 250, 254 ] ], [ [ 72, 88 ] ], [ [ 218, 234 ] ] ]
from dataclasses import dataclass from dataclasses import field from typing import Any from typing import Callable from typing import Mapping from typing import Optional from typing import Sequence from typing import Type from svarog import forge from svarog import register_forge from svarog.types import Forge JSONMa...
[ [ [ 24, 33 ], [ 434, 443 ], [ 544, 553 ], [ 1927, 1936 ], [ 2619, 2628 ], [ 2754, 2763 ], [ 3100, 3109 ], [ 3254, 3263 ], [ 3393, 3402 ]...
# -*- encoding: utf-8 -*- # Module iaframe from numpy import * def iaframe(f, WT=1, HT=1, DT=0, k1=None, k2=None): from ia870 import iaunion, iaintersec,ialimits if k1 is None: k1 = ialimits(f)[1] if k2 is None: k2 = ialimits(f)[0] assert len(f.shape)==2,'Supports 2D only' y = iaintersec(f,k2) ...
[ [ [ 62, 63 ] ], [ [ 69, 76 ] ] ]
import jwt from contextlib import contextmanager from datetime import datetime, timedelta from sqlalchemy import Column, Integer, String, DateTime, Boolean from sqlalchemy import ForeignKey, func from sqlalchemy.orm import relationship from saraki.auth import _request_ctx_stack, User, Org from saraki.model import Bas...
[ [ [ 7, 10 ], [ 3015, 3018 ] ], [ [ 34, 48 ], [ 3084, 3098 ] ], [ [ 70, 78 ], [ 2727, 2735 ] ], [ [ 80, 89 ], [ 2761, 2770 ] ], [ [ ...
from multiprocessing import Pool import argparse import glob import os import io import time import logging import gluonnlp as nlp import tokenizer as tokenization parser = argparse.ArgumentParser(description='BERT tokenizer') parser.add_argument('--input_files', type=str, default='wiki_*.doc', hel...
[ [ [ 28, 32 ], [ 1851, 1855 ] ], [ [ 40, 48 ], [ 174, 182 ] ], [ [ 56, 60 ], [ 564, 568 ] ], [ [ 68, 70 ], [ 574, 576 ] ], [ [ 78, ...
import sys; from more_itertools import windowed, first_true orig_data = list(map(int, open('d9.txt'))) data = orig_data[:] target = 32321523 for i, e in enumerate(data): if i == 0: continue data[i] = data[i - 1] + data[i] for i in range(len(data)): for j in range(i): if data[i] - data[j] == target:...
[ [ [ 7, 10 ], [ 435, 438 ] ], [ [ 39, 47 ] ], [ [ 49, 59 ] ], [ [ 60, 69 ], [ 110, 119 ], [ 380, 389 ], [ 404, 413 ] ], [ [ 103, ...
"""Xiaomi aqara single key switch device.""" import logging from zigpy.profiles import zha from zigpy.zcl.clusters.general import ( AnalogInput, Basic, Groups, Identify, MultistateInput, OnOff, Ota, Scenes, ) from .. import ( LUMI, XIAOMI_NODE_DESC, BasicCluster, Xiaomi...
[ [ [ 52, 59 ], [ 980, 987 ] ], [ [ 88, 91 ], [ 2487, 2490 ], [ 3401, 3404 ], [ 4090, 4093 ], [ 4606, 4609 ], [ 5359, 5362 ], [ 5747, 5750...
""" Problem: The function 'doubler' takes a word as input. It should create and print a string, where each character in the string is doubled, for example: "test" -> "tteesstt" Tests: >>> doubler("test") tteesstt >>> doubler("original") oorriiggiinnaall >>> doubler("hihihi") hhiihhi...
[ [ [ 337, 344 ], [ 366, 373 ] ], [ [ 349, 358 ], [ 499, 508 ] ], [ [ 401, 408 ] ] ]
import binascii import sys import Adafruit_PN532 as PN532 # Setup how the PN532 is connected to the Raspbery Pi/BeagleBone Black. # It is recommended to use a software SPI connection with 4 digital GPIO pins. # Configuration for a Raspberry Pi: CS = 8 #pn532_nss----->rpi_ce0:8 MOSI = 9 #pn532_mosi---->rpi__m...
[ [ [ 8, 16 ], [ 1277, 1285 ] ], [ [ 24, 27 ] ], [ [ 36, 59 ], [ 561, 566 ] ], [ [ 250, 252 ], [ 576, 578 ] ], [ [ 287, 291 ], [ 596...
from macaque import cli def test_cli_template(): assert cli.cli() is None
[ [ [ 20, 23 ], [ 61, 64 ] ], [ [ 29, 46 ] ] ]
# Antes de mais nada install o flask = pip install flask from flask import Flask app = Flask(__name__) @app.route('/') def homepage(): return 'Essa é minha HomePage' @app.route('/contatos') def contatos(): return 'Essa são os meus contatos' app.run()
[ [ [ 75, 80 ], [ 88, 93 ] ], [ [ 82, 85 ], [ 106, 109 ], [ 174, 177 ], [ 253, 256 ] ], [ [ 125, 133 ] ], [ [ 201, 209 ] ] ]
from itertools import zip_longest DAY = 'day' HOUR = 'hour' NAME = 'name' class Formatter: def __init__(self, indent=5 * ' '): self.indent = indent def append(self, text, tag=None): raise NotImplementedError('Must override append() in derived class') def println(self, *args): se...
[ [ [ 22, 33 ], [ 1091, 1102 ] ], [ [ 35, 38 ], [ 748, 751 ] ], [ [ 47, 51 ], [ 858, 862 ], [ 1045, 1049 ] ], [ [ 61, 65 ], [ 872, ...
__all__ = [ "prototype", ] import sys from inspect import ( signature, ) from typing import ( TypeVar, Callable, ) from .exceptions import ( PrototypeError, ) if sys.version_info >= (3, 10): from typing import ParamSpec else: from typing_extensions import ParamSpec # pragma: no cover ...
[ [ [ 0, 7 ] ], [ [ 39, 42 ], [ 187, 190 ] ], [ [ 70, 79 ], [ 1478, 1487 ], [ 1524, 1533 ] ], [ [ 109, 116 ], [ 370, 377 ] ], [ [ 12...
import PIL.Image from io import BytesIO from IPython.display import clear_output, Image, display import numpy as np def showarray(a, fmt='jpeg'): a = np.uint8(np.clip(a, 0, 255)) f = BytesIO() PIL.Image.fromarray(a).save(f, fmt) display(Image(data=f.getvalue())) def showtensor(a): mean = np.arra...
[ [ [ 7, 16 ], [ 207, 210 ] ], [ [ 32, 39 ], [ 193, 200 ] ], [ [ 68, 80 ], [ 547, 559 ] ], [ [ 82, 87 ], [ 255, 260 ] ], [ [ 89, ...
import mimetypes from pathlib import Path from appdirs import user_config_dir from tqdm import tqdm NAME = "novelsave" AUTHOR = "Mensch272" # base project directory BASE_DIR = Path(__file__).resolve().parent.parent STATIC_DIR = BASE_DIR / "novelsave/resources" # operating system specific configuration file # confi...
[ [ [ 7, 16 ], [ 873, 882 ] ], [ [ 37, 41 ], [ 179, 183 ], [ 382, 386 ], [ 692, 696 ] ], [ [ 63, 78 ], [ 387, 402 ] ], [ [ 96, 100...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os import sys import click from newschimp import renderer, sender from newschimp.social import fb, gg, lanyrd from newschimp.cli import cli_group from newschimp.utils import ComplexCLI, load_settings LOGGER = logging.getLogger(__name__) def create...
[ [ [ 53, 60 ], [ 280, 287 ] ], [ [ 68, 70 ], [ 475, 477 ], [ 1212, 1214 ] ], [ [ 78, 81 ], [ 591, 594 ] ], [ [ 90, 95 ], [ 1407, ...
try: from setuptools import setup except ImportError: from distutils.core import setup PACKAGE = "flightaware" NAME = "flightaware" DESCRIPTION = "A python REST interface for flightaware data" AUTHOR = "Fred Palmer" AUTHOR_EMAIL = "fred.palmer@gmail.com" URL = "https://github.com/fredpalmer/flightaware" confi...
[ [ [ 32, 37 ], [ 1028, 1033 ] ], [ [ 89, 94 ], [ 1028, 1033 ] ], [ [ 96, 103 ], [ 954, 961 ] ], [ [ 120, 124 ], [ 997, 1001 ] ], [ [ ...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 30, transform = "Quantization", sigma = 0.0, exog_count = 20, ar_order = 12);
[ [ [ 7, 37 ] ], [ [ 45, 95 ], [ 100, 103 ] ] ]
# # (C) Copyright IBM Corp. 2020 # # 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 writi...
[ [ [ 589, 591 ], [ 5786, 5788 ], [ 6574, 6576 ], [ 6632, 6634 ], [ 6673, 6675 ] ], [ [ 599, 603 ], [ 2518, 2522 ], [ 2661, 2665 ], [ 3241, ...
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> 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...
[ [ [ 1144, 1156 ], [ 4127, 4139 ] ], [ [ 1183, 1191 ], [ 5536, 5544 ] ], [ [ 1200, 1211 ] ] ]
"""Base class for inventory interactive/stdout tests. """ import difflib import json import os import pytest from ....defaults import FIXTURES_DIR from ..._common import fixture_path_from_request from ..._common import update_fixtures from ..._interactions import SearchFor from ..._interactions import Step from ..._t...
[ [ [ 65, 72 ], [ 5210, 5217 ] ], [ [ 80, 84 ], [ 5092, 5096 ] ], [ [ 92, 94 ], [ 372, 374 ], [ 470, 472 ], [ 558, 560 ], [ 3085, 3087...
# -*- coding: utf-8 -*- ''' Apache Libcloud Load Balancer State =================================== Manage load balancers using libcloud :codeauthor: ``Anthony Shaw <anthonyshaw@apache.org>`` Apache Libcloud load balancer management for a full list of supported clouds, see http://libcloud.readthedocs.io/en/lates...
[ [ [ 1244, 1259 ] ], [ [ 1261, 1277 ] ], [ [ 1279, 1293 ] ], [ [ 1301, 1308 ], [ 1361, 1368 ] ], [ [ 1336, 1353 ], [ 1452, 1456 ] ], [ [ 1355, ...
import pathlib from silex_client.utils.log import logger class AnyParameter(object): def __new__(cls, value): return value class CommandParameterMeta(type): def __new__(cls, name: str, bases: tuple, dct: dict): def serialize(): return { "name": "parameter", ...
[ [ [ 7, 14 ], [ 5761, 5768 ], [ 5151, 5158 ] ], [ [ 51, 57 ], [ 4461, 4467 ] ], [ [ 66, 78 ] ], [ [ 146, 166 ], [ 611, 631 ], [ 1049, ...
N = input() L = len(N) K = int(input()) dp = [[[0] * 2 for _ in range(K + 1)] for _ in range(L + 1)] dp[0][0][1] = 1 for i, x in zip(range(L), map(int, N)): for k in range(K): dp[i+1][k][0] += dp[i][k][0] # d == 0 if x == 0: dp[i+1][k][1] += dp[i][k][1] elif x > 0: d...
[ [ [ 0, 1 ], [ 20, 21 ], [ 152, 153 ] ], [ [ 12, 13 ], [ 93, 94 ], [ 139, 140 ] ], [ [ 23, 24 ], [ 70, 71 ], [ 176, 177 ], [ ...
config = { "username": 'slask', "icon": ":poop:", }
[ [ [ 0, 6 ] ] ]
# Copyright (c) Aishwarya Kamath & Nicolas Carion. Licensed under the Apache License 2.0. All Rights Reserved """ COCO dataset which returns image_id for evaluation. Mostly copy-paste from https://github.com/ashkamath/mdetr/blob/main/datasets/gqa.py """ import json from pathlib import Path import torch import torchvi...
[ [ [ 262, 266 ], [ 987, 991 ], [ 1110, 1114 ] ], [ [ 287, 291 ], [ 3392, 3396 ], [ 3812, 3816 ], [ 4329, 4333 ], [ 4556, 4560 ], [ 4936, ...
from assertpy import assert_that from httmock import HTTMock from sahyun_bot.commands.admin import Index, Rank from sahyun_bot.users_settings import UserRank from tests.mock_customsforge import customsforge def test_require_admin(commander, hook): for command in ['!lock', '!index', '!rank']: with command...
[ [ [ 21, 32 ], [ 1741, 1752 ], [ 2164, 2175 ] ], [ [ 53, 60 ], [ 960, 967 ], [ 1099, 1106 ] ], [ [ 100, 105 ], [ 983, 988 ], [ 1122, ...
import os import base64 from simpleutil.utils import digestutils from goperation.filemanager import LocalFile from goperation.manager.rpc.agent.application.taskflow.middleware import EntityMiddleware from goperation.manager.rpc.agent.application.taskflow.database import Database from goperation.manager.rpc.agent.appl...
[ [ [ 7, 9 ], [ 1552, 1554 ], [ 1768, 1770 ], [ 2471, 2473 ] ], [ [ 17, 23 ], [ 1832, 1838 ], [ 2036, 2042 ] ], [ [ 54, 65 ], [ 1877, ...
#!/usr/bin/env python3 # XML API, for dealing with XML strings # -*- coding: utf-8 -*- __all__ = ['parseargs', 'collect'] '<users>\n\t<user>\n\t\t<id>1</id>\n\t\t<name>Fred</name>\n\t\t<salary>500000</salary>\n\t</user>\n\t<user>\n\t\t<id>1</id>\n\t\t<name>ScienceCat</name>\n\t\t<salary>500000</salary>\n\t</user>\n\t...
[ [ [ 88, 95 ] ], [ [ 416, 421 ] ], [ [ 668, 673 ] ], [ [ 788, 797 ], [ 2303, 2312 ], [ 2395, 2404 ] ], [ [ 1749, 1756 ] ] ]
import json import logging from sqlalchemy import Column, Integer, String, Float, DateTime, Boolean, func from iotfunctions import bif from ai.functions import SimpleAnomaly from iotfunctions.metadata import EntityType from iotfunctions.db import Database from iotfunctions.enginelog import EngineLogging from custom imp...
[ [ [ 7, 11 ], [ 765, 769 ] ], [ [ 19, 26 ], [ 374, 381 ] ], [ [ 50, 56 ], [ 1690, 1696 ], [ 1743, 1749 ], [ 1794, 1800 ], [ 1842, 184...
# -*- coding: utf-8 -*- """Amavis factories.""" from __future__ import unicode_literals import datetime import time import factory from . import models from .utils import smart_bytes SPAM_BODY = """X-Envelope-To: <{rcpt}> X-Envelope-To-Blocked: <{rcpt}> X-Quarantine-ID: <nq6ekd4wtXZg> X-Spam-Flag: YES X-Spam-Scor...
[ [ [ 73, 89 ] ], [ [ 98, 106 ], [ 3354, 3362 ] ], [ [ 114, 118 ], [ 3284, 3288 ] ], [ [ 127, 134 ], [ 2472, 2479 ], [ 2636, 2643 ], [ 2...
#!/usr/bin/env python from __future__ import print_function, division import os, sys import matplotlib.pyplot as plt import numpy as np import argparse from astropy import log from os import path from glob import glob from subprocess import check_call import shutil from astropy.table import Table from astropy.io import...
[ [ [ 45, 59 ] ], [ [ 61, 69 ] ], [ [ 77, 79 ], [ 847, 849 ], [ 1191, 1193 ], [ 1224, 1226 ], [ 1356, 1358 ], [ 532, 534 ] ], [ [ 81, ...
import os from datetime import datetime from flask import Flask, render_template, flash, safe_join, send_file from flask_user import login_required, current_user from werkzeug.utils import secure_filename from pygate_grpc.client import PowerGateClient from deplatformr.models.filecoin_models import Ffs, Files, Logs from...
[ [ [ 7, 9 ], [ 1330, 1332 ], [ 1369, 1371 ], [ 1505, 1507 ], [ 1609, 1611 ], [ 1647, 1649 ], [ 1768, 1770 ], [ 1828, 1830 ], [ 1870, 1872 ...
from setuptools import find_packages, setup with open("README.md", "r") as fh: long_description = fh.read() setup( name='msnexport', version='0.1', license="MIT", classifiers=["Programming Language :: Python :: 3.7"], author='Charles Marceau', author_email='charlesmarceau3@gmail.com', ...
[ [ [ 23, 36 ], [ 534, 547 ] ], [ [ 38, 43 ], [ 114, 119 ] ], [ [ 76, 78 ], [ 103, 105 ] ], [ [ 84, 100 ], [ 396, 412 ] ] ]
from mythic_payloadtype_container.MythicCommandBase import * import json from mythic_payloadtype_container.MythicRPC import * import base64 class InjectArguments(TaskArguments): def __init__(self, command_line): super().__init__(command_line) self.args = { "template": CommandParameter(...
[ [ [ 59, 60 ] ], [ [ 68, 72 ] ], [ [ 124, 125 ], [ 163, 176 ], [ 863, 874 ], [ 303, 319 ], [ 350, 363 ], [ 497, 513 ], [ 531, 544 ...
import numpy as np from .base import Price class GBM(Price): """Brownian motion.""" def __init__(self, T=1., sigma1=0.02, sigma2=0.01, s1=1., s2=1., drift1=0., drift2=0., n=100): self.sigma1 = sigma1 self.sigma2 = sigma2 self.drift1 = drift1 self.drift2 = drift...
[ [ [ 7, 18 ], [ 540, 542 ], [ 552, 554 ], [ 567, 569 ], [ 619, 621 ], [ 631, 633 ], [ 646, 648 ], [ 700, 702 ], [ 706, 708 ], [ ...
import json import os, errno import sys import time import shutil import subprocess from subprocess import Popen, PIPE EXECUTABLE = 'hcbr_learning' BUILD_FOLDER = '../build' DATA_FOLDER = '../data' KFOLD_SCRIPT = 'kfold_validation.py' ACCURACY_ROW = 4 #METAOPTIMIZATION = '../tuning/hyperopt_wrapper.py' #METAOPTIMIZAT...
[ [ [ 7, 11 ], [ 4054, 4058 ], [ 5531, 5535 ], [ 6622, 6626 ], [ 8971, 8975 ], [ 9597, 9601 ] ], [ [ 19, 21 ], [ 1206, 1208 ], [ 2043, 204...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: DIYer22@github @mail: ylxx@live.com Created on Thu Jan 16 18:17:20 2020 """ from boxx import * from boxx import deg2rad, np, pi import bpy import random def set_cam_pose(cam_radius=1, cam_deg=45, cam_x_deg=None, cam=None): cam_rad = deg2rad(cam_deg) ...
[ [ [ 154, 155 ] ], [ [ 173, 180 ], [ 301, 308 ], [ 403, 410 ] ], [ [ 182, 184 ], [ 443, 445 ], [ 515, 517 ], [ 546, 548 ] ], [ [ 186, ...
# # # Copyright (C) University of Melbourne 2013 # # # #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...
[ [ [ 1256, 1271 ], [ 6423, 6438 ], [ 9145, 9160 ], [ 9365, 9380 ] ], [ [ 1273, 1286 ], [ 4673, 4686 ], [ 4806, 4819 ] ], [ [ 1295, 1299 ] ], [ ...
import pandas as pd from .entity import CatalogEntity from .repository.dataset_repo import get_dataset_repo from .repository.variable_repo import get_variable_repo from .repository.constants import VARIABLE_FILTER from .summary import variable_describe, head, tail, counts, quantiles, top_values, histogram _DESCRIPTI...
[ [ [ 7, 19 ], [ 4241, 4243 ] ], [ [ 41, 54 ], [ 358, 371 ] ], [ [ 92, 108 ], [ 1522, 1538 ] ], [ [ 147, 164 ], [ 1121, 1138 ] ], [ [ ...
from libcrypto import hamming_distance from libcrypto import split_blocks from libcrypto import xor from libcrypto import freq_score from base64 import b64decode from operator import itemgetter def main(): file64 = "" for line in open("../assets/inputS1C6.txt","r"): file64 += line.rstrip() file...
[ [ [ 22, 38 ], [ 645, 661 ] ], [ [ 61, 73 ], [ 941, 953 ] ], [ [ 96, 99 ], [ 1407, 1410 ], [ 1861, 1864 ] ], [ [ 122, 132 ], [ 1571, ...
# Copyright 2015 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...
[ [ [ 774, 789 ] ], [ [ 813, 821 ] ], [ [ 845, 859 ] ], [ [ 868, 870 ], [ 5633, 5635 ], [ 8224, 8226 ], [ 8399, 8401 ] ], [ [ 894, 900 ], ...
# A simple CLI runner for slurm that can be used when running Galaxy from a # non-submit host and using a Slurm cluster. from logging import getLogger try: from galaxy.model import Job job_states = Job.states except ImportError: # Not in Galaxy, map Galaxy job states to Pulsar ones. from pulsar.util im...
[ [ [ 141, 150 ], [ 456, 465 ] ], [ [ 186, 189 ], [ 207, 210 ] ], [ [ 194, 204 ], [ 3387, 3397 ], [ 4284, 4294 ], [ 4325, 4335 ], [ 4369, ...
"""DenseNet models for Keras. # Reference paper - [Densely Connected Convolutional Networks] (https://arxiv.org/abs/1608.06993) (CVPR 2017 Best Paper Award) # Reference implementation - [Torch DenseNets] (https://github.com/liuzhuang13/DenseNet/blob/master/models/densenet.lua) - [TensorNets] (https://gith...
[ [ [ 415, 430 ] ], [ [ 455, 463 ] ], [ [ 488, 502 ] ], [ [ 513, 515 ], [ 890, 892 ], [ 6998, 7000 ] ], [ [ 535, 547 ], [ 2917, 2918 ], [ ...
''' Система линейных уравнений - 2 ''' a = float(input()) b = float(input()) c = float(input()) d = float(input()) e = float(input()) f = float(input()) if a == 0 and b == 0 and c == 0 and d == 0 and e == 0 and f == 0: print(5) elif a * d == b * c and a * f != c * e: print(0) elif a == 0 and b == 0 and e != 0: ...
[ [ [ 39, 40 ], [ 156, 157 ], [ 237, 238 ], [ 256, 257 ], [ 290, 291 ], [ 386, 387 ], [ 464, 465 ], [ 498, 499 ], [ 517, 518 ], [ ...
# -*- coding: utf-8 -*- """ Author ------ Bo Zhang Email ----- bozhang@nao.cas.cn Created on ---------- - Fri Jul 3 13:13:06 2015 read_spectrum Modifications ------------- - Fri Nov 20 10:16:59 2015 reformatting code - Sun Feb 28 14:39:16 2016 migrated to bopy.spec.lamost - Fri Jul 15 16:08:00 2016 mig...
[ [ [ 465, 467 ], [ 1877, 1879 ], [ 1913, 1915 ], [ 2087, 2089 ], [ 2328, 2330 ], [ 3940, 3942 ], [ 3976, 3978 ], [ 4146, 4148 ], [ 4376, 4378...
class BaseDownsizing: def __init__(self, raw_file_f, raw_file_r=None): self.raw_file_f = raw_file_f self.raw_file_f = raw_file_f self._downsized_f = None if raw_file_r: self.raw_file_r = raw_file_r self.raw_file_r = raw_file_r self._downsized_r = ...
[ [ [ 6, 20 ] ] ]
from collections import OrderedDict from django.conf import settings from django.db.models import Count, F from django.http import HttpResponseForbidden, HttpResponse from django.shortcuts import get_object_or_404 from drf_yasg import openapi from drf_yasg.openapi import Parameter from drf_yasg.utils import swagger_au...
[ [ [ 24, 35 ], [ 13978, 13989 ] ], [ [ 61, 69 ], [ 14101, 14109 ], [ 14145, 14153 ], [ 14194, 14202 ], [ 14964, 14972 ] ], [ [ 99, 104 ], [ ...
# --------------------------------------------------------------------- # Angtel.Topaz.get_interface_status # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- ...
[ [ [ 345, 347 ], [ 620, 622 ], [ 763, 765 ], [ 778, 780 ] ], [ [ 396, 406 ], [ 492, 502 ] ], [ [ 457, 476 ], [ 568, 587 ] ], [ [ 485, ...
# -*- coding: utf-8 -*- """ pygments.lexers.diff ~~~~~~~~~~~~~~~~~~~~ Lexers for diff/patch formats. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups from pygments.tok...
[ [ [ 242, 244 ], [ 3710, 3712 ], [ 3725, 3727 ] ], [ [ 273, 283 ], [ 469, 479 ], [ 1286, 1296 ], [ 3287, 3297 ] ], [ [ 285, 292 ], [ 2994, ...
from disco import Disco class Config: def __init__(self): self._numero_discos = int(input("\nInforme a quantidade de discos: ")) def adiciona_discos(self, torre_inicial): discos = self.add_disco() for ix in range(self._numero_discos): torre_inicial.empilha(discos[ix]) ...
[ [ [ 18, 23 ], [ 460, 465 ] ], [ [ 31, 37 ] ] ]
import os import platform import socket import copy import json import numpy as np from datetime import datetime import time from .metadata import acdd import flopy # globals FILLVALUE = -99999.9 ITMUNI = { 0: "undefined", 1: "seconds", 2: "minutes", 3: "hours", 4: "days", 5: "years", } PRECISI...
[ [ [ 7, 9 ], [ 430, 432 ], [ 4753, 4755 ], [ 4876, 4878 ], [ 14922, 14924 ], [ 17006, 17008 ], [ 23256, 23258 ] ], [ [ 17, 25 ], [ 23185, ...
# -*- coding: utf-8 -*- from .Enviopack import Enviopack from .Auth.Auth import Auth from .Quote.Quote import Quote from .Pickings.Pickings import Pickings from .Orders.Orders import Orders __version__ = "0.4.6" __author__ = "Federico Gobea"
[ [ [ 47, 56 ] ], [ [ 80, 84 ] ], [ [ 110, 115 ] ], [ [ 147, 155 ] ], [ [ 183, 189 ] ], [ [ 191, 202 ] ], [ [ 213, 223 ] ] ]
""" WSGI config for billsengine_31836 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJ...
[ [ [ 240, 242 ], [ 295, 297 ] ], [ [ 273, 293 ], [ 388, 408 ] ], [ [ 374, 385 ] ] ]
import requests import threading import random import json usernames = json.loads(open("usernames.json", "r").read()) password = '%4B%65%6E%79%6F%6E%35%25' # A hex encoded password siteurl = '192.168.122.61' def run(): username = random.choice(usernames) token = requests.get('http://' + siteurl + '/login/toke...
[ [ [ 7, 15 ], [ 273, 281 ] ], [ [ 23, 32 ], [ 559, 568 ] ], [ [ 40, 46 ], [ 236, 242 ] ], [ [ 54, 58 ], [ 72, 76 ] ], [ [ 60, ...
import pytest from autogluon.core.space import Categorical from autogluon.vision._gluoncv import ObjectDetection def get_dataset(path): return ObjectDetection.Dataset.from_voc(path) @pytest.mark.skip(reason="ObjectDetector is not stable to test, and fails due to transient errors occasionally.") def test_object...
[ [ [ 7, 13 ], [ 192, 198 ], [ 755, 761 ] ], [ [ 48, 59 ], [ 1182, 1193 ] ], [ [ 98, 113 ], [ 150, 165 ], [ 551, 566 ], [ 1123, 1138 ...
#!/usr/bin/python # -*- coding: UTF-8 -*- import asyncio import pyppeteer import time import os import random from exe_js import js1, js3, js4, js5 # http://www.mamicode.com/info-detail-2302923.html # https://segmentfault.com/a/1190000011627343 """ { proxy: "127.0.0.1:1234", proxy-auth: "userx:passx", prox...
[ [ [ 49, 56 ], [ 1593, 1600 ] ], [ [ 64, 73 ], [ 520, 529 ] ], [ [ 81, 85 ] ], [ [ 93, 95 ], [ 453, 455 ] ], [ [ 103, 109 ], [ 376,...
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api_yamdb.settings') application = get_wsgi_application()
[ [ [ 7, 9 ], [ 62, 64 ] ], [ [ 40, 60 ], [ 147, 167 ] ], [ [ 133, 144 ] ] ]
""" Django settings for bingo project. Generated by 'django-admin startproject' using Django 3.0.5. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # B...
[ [ [ 313, 315 ], [ 400, 402 ], [ 416, 418 ], [ 432, 434 ], [ 475, 477 ], [ 521, 523 ], [ 564, 566 ], [ 2690, 2692 ] ], [ [ 389, 397 ]...
from zenml.steps import BaseStepConfig class PreTrainingConfigs(BaseStepConfig): # The configuration for the pre-training of the agent ENV_NAME: str = "BreakoutDeterministic-v4" WRITE_TENSORBOARD: bool = True TENSORBOARD_DIR: str = "tensorboard/" LEARNING_RATE: float = 0.00001 INP...
[ [ [ 24, 38 ], [ 69, 83 ] ], [ [ 50, 68 ] ] ]
import educative.course1.stacks_queues.stack as s input_data = [23, 60, 12, 42, 4, 97, 2] expected_output_data = [2, 4, 12, 23, 42, 60, 97] # This solution uses a second stack # 1. until input stack is not empty, we pop the top value and compare it # with the top value of the second stack # 2. if value > top of s...
[ [ [ 7, 49 ], [ 757, 758 ], [ 1193, 1194 ], [ 1326, 1327 ] ], [ [ 51, 61 ], [ 1205, 1215 ], [ 1285, 1295 ] ], [ [ 91, 111 ], [ 1338, ...
from __future__ import print_function from __future__ import division
[ [ [ 23, 37 ] ], [ [ 62, 70 ] ] ]
# Author: Denys Makogon # # 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 t...
[ [ [ 630, 652 ], [ 2231, 2243 ] ], [ [ 680, 687 ], [ 1184, 1191 ] ], [ [ 714, 721 ], [ 1286, 1293 ] ], [ [ 749, 773 ], [ 1430, 1444 ] ], [ ...
from abc import abstractmethod from .apr_fetcher import APRFetcher from typing import Dict, List, Union, Any from .dapp_apr_fetcher import DappAPRFetcher from .utils.utils import ( calculate_lp_token_price, get_block_average_time, get_token_price_from_dexs, open_contract, usdt_address, platform_...
[ [ [ 16, 30 ], [ 499, 513 ], [ 590, 604 ], [ 687, 701 ], [ 824, 838 ], [ 921, 935 ], [ 1018, 1032 ] ], [ [ 56, 66 ] ], [ [ 86, 90 ...
from django.test import TestCase from django.urls import reverse from rest_framework import status from rest_framework.test import APIClient QUIZZES_URL = reverse('questionary:quiz-list') class PublicQuizzesApiTests(TestCase): """Test the publicly available tags API""" def setUp(self): self.client ...
[ [ [ 24, 32 ], [ 220, 228 ] ], [ [ 57, 64 ], [ 157, 164 ] ], [ [ 93, 99 ], [ 518, 524 ] ], [ [ 132, 141 ], [ 322, 331 ] ], [ [ 143,...
############################################################################### # Author: CallMeCCLemon # Date: 2019 # Copyright: 2019 Thomas Littlejohn (@CallMeCCLemon) - Modified BSD License ############################################################################### from enum import Enum from Py...
[ [ [ 305, 309 ], [ 807, 811 ] ], [ [ 356, 369 ], [ 1220, 1233 ] ], [ [ 425, 449 ], [ 3582, 3606 ] ], [ [ 493, 502 ], [ 922, 931 ] ], [ [ ...