code
stringlengths
82
54.1k
code_codestyle
int64
0
699
style_context
stringlengths
111
35.6k
style_context_codestyle
int64
0
699
label
int64
0
1
'''simple docstring''' import inspect import unittest from huggingface_hub import hf_hub_download from transformers import ConvNextConfig, UperNetConfig from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device from transformers.u...
26
'''simple docstring''' import doctest import logging import os import unittest from pathlib import Path from typing import List, Union import transformers from transformers.testing_utils import require_tf, require_torch, slow __UpperCamelCase = logging.getLogger() ...
26
1
'''simple docstring''' import importlib import sys from argparse import REMAINDER, ArgumentParser from pathlib import Path import torch_xla.distributed.xla_multiprocessing as xmp def _a ( ) -> Any: """simple docstring""" __snake_case ...
26
'''simple docstring''' import inspect from typing import Callable, List, Optional, Union import torch from transformers import ( CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, WhisperForConditionalGeneration, WhisperProcessor, ) from diffusers import ( ...
26
1
'''simple docstring''' import copy from collections import OrderedDict from typing import Mapping from packaging import version from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig from ...utils import logging from ..auto import CONFIG_MAPPING __Upp...
26
'''simple docstring''' import os from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home __UpperCamelCase = HUGGINGFACE_HUB_CACHE __UpperCamelCase = "config.json" __UpperCamelCase = "diffusion_pytorch_model.bin" __UpperCamelCase ...
26
1
'''simple docstring''' import unittest from transformers import XLMConfig, is_torch_available from transformers.testing_utils import require_torch, slow, torch_device from ...generation.test_utils import GenerationTesterMixin from ...test_configuration_common import ConfigTester from ....
26
'''simple docstring''' import argparse import json import re from pathlib import Path import requests import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import ( MobileNetVaConfig, MobileNetVaForImageClassification, Mobile...
26
1
'''simple docstring''' import pytest import requests from datasets.utils.file_utils import http_head from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline @pytest.mark.integration def _a ( ) -> Tuple: """simple d...
26
'''simple docstring''' from sklearn.metrics import recall_score import datasets __UpperCamelCase = "\nRecall is the fraction of the positive examples that were correctly labeled by the model as positive. It can be computed with the equation:\nRecall = TP / (TP + FN)\nWhere TP is...
26
1
'''simple docstring''' class _A : def __init__( self : str ) -> List[Any]: """simple docstring""" __snake_case : Optional[Any] = 0 __snake_case : List[Any] = 0 __snake_case : List[Any...
26
'''simple docstring''' from sklearn.metrics import matthews_corrcoef import datasets __UpperCamelCase = "\nCompute the Matthews correlation coefficient (MCC)\n\nThe Matthews correlation coefficient is used in machine learning as a\nmeasure of the quality of binary and multiclass...
26
1
'''simple docstring''' def _a ( _lowerCamelCase ) -> int: """simple docstring""" __snake_case : List[str] = 0 while num > 0: digit_sum += num % 10 num //= 10 return digit_sum def _a ( ...
26
'''simple docstring''' import json import os from pathlib import Path import pytest from datasets.download.download_config import DownloadConfig from datasets.download.download_manager import DownloadManager from datasets.utils.file_utils import hash_url_to_filename __UpperCamelC...
26
1
'''simple docstring''' import argparse from collections import OrderedDict from pathlib import Path import requests import torch from PIL import Image from transformers import GLPNConfig, GLPNForDepthEstimation, GLPNImageProcessor from transformers.utils import logging logging.s...
26
'''simple docstring''' def _a ( _lowerCamelCase = 100 ) -> int: """simple docstring""" __snake_case : Any = n * (n + 1) * (2 * n + 1) / 6 __snake_case : List[Any] = (n * (n + 1) / 2) ** 2 return int(s...
26
1
'''simple docstring''' from __future__ import annotations class _A : def __init__( self : int , __magic_name__ : str , __magic_name__ : str ) -> Any: """simple docstring""" __snake_case , __snake_case : ...
26
'''simple docstring''' from __future__ import annotations from typing import Any class _A : def __init__( self : str , __magic_name__ : int , __magic_name__ : int , __magic_name__ : float = 0 ) -> None: """simple d...
26
1
'''simple docstring''' def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase ) -> int: """simple docstring""" def update_area_of_max_square(_lowerCamelCase , _lowerCamelCase ) -> int: # BASE CASE if row >= rows or col >= cols: ...
26
'''simple docstring''' import argparse import json import os import torch from torch import nn from transformers import NllbMoeConfig, NllbMoeModel from transformers.modeling_utils import dtype_byte_size from transformers.utils import WEIGHTS_INDEX_NAME, WEIGHTS_NAME d...
26
1
'''simple docstring''' import argparse import os import jax as jnp import numpy as onp import torch import torch.nn as nn from music_spectrogram_diffusion import inference from tax import checkpoints from diffusers import DDPMScheduler, OnnxRuntimeModel, SpectrogramDiffusionPipeline...
26
'''simple docstring''' import cva import numpy as np class _A : def __init__( self : Any , __magic_name__ : float , __magic_name__ : int ) -> Optional[int]: """simple docstring""" if k in (0.04, 0.06): __snake_c...
26
1
'''simple docstring''' from __future__ import annotations def _a ( _lowerCamelCase , _lowerCamelCase = None , _lowerCamelCase = None ) -> None: """simple docstring""" if start is None: __snake_case : Optional[Any] ...
26
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class _A ( __lowercase ): lowercase__: Any = ['''image_processor''', '''tokenizer'''] lowercase__: Any = ''...
26
1
'''simple docstring''' from __future__ import annotations def _a ( _lowerCamelCase , _lowerCamelCase ) -> int: """simple docstring""" if len(_lowerCamelCase ) < k or k < 0: raise ValueError("""Invalid Input""" ) __snake_case ...
26
'''simple docstring''' import datasets import faiss import numpy as np import streamlit as st import torch from elasticsearch import Elasticsearch from elia_utils import ( embed_questions_for_retrieval, make_qa_sas_model, qa_sas_generate, query_es_index, query_qa_...
26
1
'''simple docstring''' from __future__ import annotations import math def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase ) -> int: """simple docstring""" if depth < 0: raise V...
26
'''simple docstring''' import warnings from ...utils import logging from .image_processing_owlvit import OwlViTImageProcessor __UpperCamelCase = logging.get_logger(__name__) class _A ( __lowercase ): def __init__( self : int , *__magic_name__ ...
26
1
'''simple docstring''' import argparse import torch from transformers import BertConfig, BertForPreTraining, load_tf_weights_in_bert from transformers.utils import logging logging.set_verbosity_info() def _a ( _lowerCamelCase , _lowerCamelCase , ...
26
'''simple docstring''' import argparse import torch from transformers import BlenderbotConfig, BlenderbotForConditionalGeneration from transformers.utils import logging logging.set_verbosity_info() __UpperCamelCase = logging.get_logger(__name__) __UpperCamelCase ...
26
1
'''simple docstring''' import json import os import re import unittest from transformers import CodeGenTokenizer, CodeGenTokenizerFast from transformers.models.codegen.tokenization_codegen import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, slow from ....
26
'''simple docstring''' import argparse import os import re import packaging.version __UpperCamelCase = "examples/" __UpperCamelCase = { "examples": (re.compile(R"^check_min_version\(\"[^\"]+\"\)\s*$", re.MULTILINE), "check_min_version(\"VERSION\")\n"), "init...
26
1
'''simple docstring''' from ...utils import is_torch_available, is_transformers_available if is_transformers_available() and is_torch_available(): from .pipeline_vq_diffusion import LearnedClassifierFreeSamplingEmbeddings, VQDiffusionPipeline
26
'''simple docstring''' from unittest import TestCase from datasets import Sequence, Value from datasets.arrow_dataset import Dataset class _A ( __lowercase ): def lowercase__ ( self : Any ) -> str: """simple docstring""" return [ ...
26
1
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available __UpperCamelCase = { "configuration_rag": ["RagConfig"], "retrieval_rag": ["RagRetriever"], "tokenization_...
26
'''simple docstring''' import inspect import unittest import torch import torch.nn as nn from accelerate.hooks import ( AlignDevicesHook, ModelHook, SequentialHook, add_hook_to_module, attach_align_device_hook, remove_hook_from_module, remove_hook_from...
26
1
'''simple docstring''' import multiprocessing import os from typing import BinaryIO, Optional, Union import fsspec from .. import Dataset, Features, NamedSplit, config from ..formatting import query_table from ..packaged_modules.json.json import Json from ..utils import logging from...
26
'''simple docstring''' from __future__ import annotations __UpperCamelCase = [ [-1, 0], # left [0, -1], # down [1, 0], # right [0, 1], # up ] def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCas...
26
1
'''simple docstring''' import io import json import fsspec import pytest from datasets import Dataset, DatasetDict, Features, NamedSplit, Value from datasets.io.json import JsonDatasetReader, JsonDatasetWriter from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_mem...
26
'''simple docstring''' def _a ( _lowerCamelCase ) -> int: """simple docstring""" if not isinstance(_lowerCamelCase , _lowerCamelCase ): raise TypeError("""only integers accepted as input""" ) else: __snake_case : List[Any] ...
26
1
'''simple docstring''' import glob import os import random from string import ascii_lowercase, digits import cva __UpperCamelCase = "" __UpperCamelCase = "" __UpperCamelCase = "" __UpperCamelCase = 1 # (0 is vertical, 1 is horizontal) de...
26
'''simple docstring''' from __future__ import annotations import math def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase ) -> int: """simple docstring""" if depth < 0: raise V...
26
1
'''simple docstring''' from __future__ import annotations import random # Maximum size of the population. Bigger could be faster but is more memory expensive. __UpperCamelCase = 200 # Number of elements selected in every generation of evolution. The selection takes # place fro...
26
'''simple docstring''' from __future__ import annotations def _a ( _lowerCamelCase , _lowerCamelCase = None , _lowerCamelCase = None ) -> None: """simple docstring""" if start is None: __snake_case : Optional[Any] ...
26
1
'''simple docstring''' import unittest from pathlib import Path from shutil import copyfile from transformers import SPIECE_UNDERLINE, is_sentencepiece_available from transformers.models.speech_to_text import SpeechaTextTokenizer from transformers.models.speech_to_text.tokenization_speec...
26
'''simple docstring''' import doctest import logging import os import unittest from pathlib import Path from typing import List, Union import transformers from transformers.testing_utils import require_tf, require_torch, slow __UpperCamelCase = logging.getLogger() ...
26
1
'''simple docstring''' import math from enum import Enum from typing import Optional, Union from torch.optim import Optimizer from torch.optim.lr_scheduler import LambdaLR from .utils import logging __UpperCamelCase = logging.get_logger(__name__) class _A ( _...
26
'''simple docstring''' import inspect from typing import Callable, List, Optional, Union import torch from transformers import ( CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, WhisperForConditionalGeneration, WhisperProcessor, ) from diffusers import ( ...
26
1
'''simple docstring''' def _a ( _lowerCamelCase , _lowerCamelCase ) -> list[str]: """simple docstring""" return [sentence[i : i + ngram_size] for i in range(len(_lowerCamelCase ) - ngram_size + 1 )] if __name__ == "__main__": from doctest import te...
26
'''simple docstring''' import os from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home __UpperCamelCase = HUGGINGFACE_HUB_CACHE __UpperCamelCase = "config.json" __UpperCamelCase = "diffusion_pytorch_model.bin" __UpperCamelCase ...
26
1
'''simple docstring''' import datasets import faiss import numpy as np import streamlit as st import torch from elasticsearch import Elasticsearch from elia_utils import ( embed_questions_for_retrieval, make_qa_sas_model, qa_sas_generate, query_es_index, query_qa_...
26
'''simple docstring''' import argparse import json import re from pathlib import Path import requests import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import ( MobileNetVaConfig, MobileNetVaForImageClassification, Mobile...
26
1
'''simple docstring''' import os from argparse import ArgumentParser, Namespace from ..data import SingleSentenceClassificationProcessor as Processor from ..pipelines import TextClassificationPipeline from ..utils import is_tf_available, is_torch_available, logging from . import BaseTran...
26
'''simple docstring''' from sklearn.metrics import recall_score import datasets __UpperCamelCase = "\nRecall is the fraction of the positive examples that were correctly labeled by the model as positive. It can be computed with the equation:\nRecall = TP / (TP + FN)\nWhere TP is...
26
1
'''simple docstring''' import argparse import json import re from pathlib import Path import requests import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import ( MobileNetVaConfig, MobileNetVaForImageClassification, Mobile...
26
'''simple docstring''' from sklearn.metrics import matthews_corrcoef import datasets __UpperCamelCase = "\nCompute the Matthews correlation coefficient (MCC)\n\nThe Matthews correlation coefficient is used in machine learning as a\nmeasure of the quality of binary and multiclass...
26
1
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_speech_available, is_tf_available, is_torch_available, ) __UpperCamelCase = { "configura...
26
'''simple docstring''' import json import os from pathlib import Path import pytest from datasets.download.download_config import DownloadConfig from datasets.download.download_manager import DownloadManager from datasets.utils.file_utils import hash_url_to_filename __UpperCamelC...
26
1
'''simple docstring''' from collections import OrderedDict from typing import TYPE_CHECKING, Any, List, Mapping, Optional from packaging import version if TYPE_CHECKING: from ... import PreTrainedTokenizer, TensorType from ...configuration_utils import PretrainedConfig from ...on...
26
'''simple docstring''' def _a ( _lowerCamelCase = 100 ) -> int: """simple docstring""" __snake_case : Any = n * (n + 1) * (2 * n + 1) / 6 __snake_case : List[Any] = (n * (n + 1) / 2) ** 2 return int(s...
26
1
'''simple docstring''' import json import os import sys import tempfile import unittest from pathlib import Path from shutil import copyfile from huggingface_hub import HfFolder, Repository, create_repo, delete_repo from requests.exceptions import HTTPError import transformers fro...
26
'''simple docstring''' from __future__ import annotations from typing import Any class _A : def __init__( self : str , __magic_name__ : int , __magic_name__ : int , __magic_name__ : float = 0 ) -> None: """simple d...
26
1
'''simple docstring''' import json import os import tempfile from transformers.testing_utils import check_json_file_has_correct_format class _A : lowercase__: int = None def lowercase__ ( self : Any ) -> Any: """simple docstring...
26
'''simple docstring''' import argparse import json import os import torch from torch import nn from transformers import NllbMoeConfig, NllbMoeModel from transformers.modeling_utils import dtype_byte_size from transformers.utils import WEIGHTS_INDEX_NAME, WEIGHTS_NAME d...
26
1
'''simple docstring''' from collections.abc import Iterable from typing import Any class _A : def __init__( self : Optional[int] , __magic_name__ : int | None = None ) -> Any: """simple docstring""" __snake_case : str ...
26
'''simple docstring''' import cva import numpy as np class _A : def __init__( self : Any , __magic_name__ : float , __magic_name__ : int ) -> Optional[int]: """simple docstring""" if k in (0.04, 0.06): __snake_c...
26
1
'''simple docstring''' from collections import OrderedDict from typing import TYPE_CHECKING, Any, List, Mapping, Optional, Union from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig from ...utils import TensorType, logging if TYPE_CHECKING: from ...onn...
26
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class _A ( __lowercase ): lowercase__: Any = ['''image_processor''', '''tokenizer'''] lowercase__: Any = ''...
26
1
'''simple docstring''' def _a ( _lowerCamelCase = 10 , _lowerCamelCase = 1000 , _lowerCamelCase = True ) -> int: """simple docstring""" assert ( isinstance(_lowerCamelCase , _lowerCamelCase ) and isinstance(_lowerCamelCase , _lowe...
26
'''simple docstring''' import datasets import faiss import numpy as np import streamlit as st import torch from elasticsearch import Elasticsearch from elia_utils import ( embed_questions_for_retrieval, make_qa_sas_model, qa_sas_generate, query_es_index, query_qa_...
26
1
'''simple docstring''' import copy from ...configuration_utils import PretrainedConfig from ...utils import logging __UpperCamelCase = logging.get_logger(__name__) class _A ( __lowercase ): lowercase__: Any = '''encoder-decoder''' lowercase__: ...
26
'''simple docstring''' import warnings from ...utils import logging from .image_processing_owlvit import OwlViTImageProcessor __UpperCamelCase = logging.get_logger(__name__) class _A ( __lowercase ): def __init__( self : int , *__magic_name__ ...
26
1
'''simple docstring''' import argparse import shutil from pathlib import Path from tqdm import tqdm from transformers import AutoTokenizer def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase=1024 ) -> List[str]: ...
26
'''simple docstring''' import argparse import torch from transformers import BlenderbotConfig, BlenderbotForConditionalGeneration from transformers.utils import logging logging.set_verbosity_info() __UpperCamelCase = logging.get_logger(__name__) __UpperCamelCase ...
26
1
'''simple docstring''' def _a ( _lowerCamelCase = 400_0000 ) -> int: """simple docstring""" __snake_case : str = [0, 1] __snake_case : Optional[int] = 0 while fib[i] <= n: fib.append(fib[i] + f...
26
'''simple docstring''' import argparse import os import re import packaging.version __UpperCamelCase = "examples/" __UpperCamelCase = { "examples": (re.compile(R"^check_min_version\(\"[^\"]+\"\)\s*$", re.MULTILINE), "check_min_version(\"VERSION\")\n"), "init...
26
1
'''simple docstring''' def _a ( _lowerCamelCase ) -> float: """simple docstring""" __snake_case : Tuple = 0 while len(_lowerCamelCase ) > 1: __snake_case : List[str] = 0 # Consider two files...
26
'''simple docstring''' from unittest import TestCase from datasets import Sequence, Value from datasets.arrow_dataset import Dataset class _A ( __lowercase ): def lowercase__ ( self : Any ) -> str: """simple docstring""" return [ ...
26
1
'''simple docstring''' def _a ( _lowerCamelCase , _lowerCamelCase ) -> List[Any]: """simple docstring""" __snake_case : Optional[Any] = [0 for i in range(r + 1 )] # nc0 = 1 __snake_case : Optional[Any] ...
26
'''simple docstring''' import inspect import unittest import torch import torch.nn as nn from accelerate.hooks import ( AlignDevicesHook, ModelHook, SequentialHook, add_hook_to_module, attach_align_device_hook, remove_hook_from_module, remove_hook_from...
26
1
'''simple docstring''' from __future__ import annotations import numpy as np def _a ( _lowerCamelCase ) -> tuple[np.ndarray, np.ndarray]: """simple docstring""" __snake_case , __snake_case : Optional[Any] = ...
26
'''simple docstring''' from __future__ import annotations __UpperCamelCase = [ [-1, 0], # left [0, -1], # down [1, 0], # right [0, 1], # up ] def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCas...
26
1
'''simple docstring''' def _a ( _lowerCamelCase = 1000 ) -> int: """simple docstring""" __snake_case : List[str] = -1 __snake_case : List[str] = 0 for a in range(1 , n // 3 ): # Solving the ...
26
'''simple docstring''' def _a ( _lowerCamelCase ) -> int: """simple docstring""" if not isinstance(_lowerCamelCase , _lowerCamelCase ): raise TypeError("""only integers accepted as input""" ) else: __snake_case : List[Any] ...
26
1
'''simple docstring''' import enum import warnings from ..tokenization_utils import TruncationStrategy from ..utils import add_end_docstrings, is_tf_available, is_torch_available, logging from .base import PIPELINE_INIT_ARGS, Pipeline if is_tf_available(): import tensorflow as tf ...
26
'''simple docstring''' from __future__ import annotations import math def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase ) -> int: """simple docstring""" if depth < 0: raise V...
26
1
'''simple docstring''' from transformers import HfArgumentParser, TensorFlowBenchmark, TensorFlowBenchmarkArguments def _a ( ) -> Dict: """simple docstring""" __snake_case : int = HfArgumentParser(_lowerCamelCase ) ...
26
'''simple docstring''' from __future__ import annotations def _a ( _lowerCamelCase , _lowerCamelCase = None , _lowerCamelCase = None ) -> None: """simple docstring""" if start is None: __snake_case : Optional[Any] ...
26
1
'''simple docstring''' import comet # From: unbabel-comet import torch import datasets __UpperCamelCase = datasets.logging.get_logger(__name__) __UpperCamelCase = "\\n@inproceedings{rei-EtAl:2020:WMT,\n author = {Rei, Ricardo and Stewart, Craig and Farinha,...
26
'''simple docstring''' import doctest import logging import os import unittest from pathlib import Path from typing import List, Union import transformers from transformers.testing_utils import require_tf, require_torch, slow __UpperCamelCase = logging.getLogger() ...
26
1
'''simple docstring''' def _a ( _lowerCamelCase ) -> bool: """simple docstring""" __snake_case : str = (1 + 24 * n) ** 0.5 return ((1 + root) / 6) % 1 == 0 def _a ( _lowerCamelCase = 5000 ) -> in...
26
'''simple docstring''' import inspect from typing import Callable, List, Optional, Union import torch from transformers import ( CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, WhisperForConditionalGeneration, WhisperProcessor, ) from diffusers import ( ...
26
1
'''simple docstring''' import json import os import unittest from transformers.models.ctrl.tokenization_ctrl import VOCAB_FILES_NAMES, CTRLTokenizer from ...test_tokenization_common import TokenizerTesterMixin class _A ( __lowercase , unittest.TestCase ): lowe...
26
'''simple docstring''' import os from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home __UpperCamelCase = HUGGINGFACE_HUB_CACHE __UpperCamelCase = "config.json" __UpperCamelCase = "diffusion_pytorch_model.bin" __UpperCamelCase ...
26
1
'''simple docstring''' from typing import TYPE_CHECKING from ..utils import _LazyModule __UpperCamelCase = { "config": [ "EXTERNAL_DATA_FORMAT_SIZE_LIMIT", "OnnxConfig", "OnnxConfigWithPast", "OnnxSeq2SeqConfigWithPast", "Patchin...
26
'''simple docstring''' import argparse import json import re from pathlib import Path import requests import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import ( MobileNetVaConfig, MobileNetVaForImageClassification, Mobile...
26
1
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_tf_available, is_tokenizers_available, is_torch_available, is_vision_available, ) __UpperCamelCase ...
26
'''simple docstring''' from sklearn.metrics import recall_score import datasets __UpperCamelCase = "\nRecall is the fraction of the positive examples that were correctly labeled by the model as positive. It can be computed with the equation:\nRecall = TP / (TP + FN)\nWhere TP is...
26
1
'''simple docstring''' import argparse import json from pathlib import Path import requests import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import ViTConfig, ViTForImageClassification, ViTImageProcessor, ViTModel from transformers.uti...
26
'''simple docstring''' from sklearn.metrics import matthews_corrcoef import datasets __UpperCamelCase = "\nCompute the Matthews correlation coefficient (MCC)\n\nThe Matthews correlation coefficient is used in machine learning as a\nmeasure of the quality of binary and multiclass...
26
1
'''simple docstring''' from sympy import diff, lambdify, symbols from sympy.functions import * # noqa: F403 def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase = "x" , _lowerCamelCase = 10**-10 , _lowerCamelCase = 1 , ) -> complex: ...
26
'''simple docstring''' import json import os from pathlib import Path import pytest from datasets.download.download_config import DownloadConfig from datasets.download.download_manager import DownloadManager from datasets.utils.file_utils import hash_url_to_filename __UpperCamelC...
26
1
'''simple docstring''' import unittest from accelerate import debug_launcher from accelerate.test_utils import require_cpu, test_ops, test_script @require_cpu class _A ( unittest.TestCase ): def lowercase__ ( self : Tuple ) -> List[str]: ...
26
'''simple docstring''' def _a ( _lowerCamelCase = 100 ) -> int: """simple docstring""" __snake_case : Any = n * (n + 1) * (2 * n + 1) / 6 __snake_case : List[Any] = (n * (n + 1) / 2) ** 2 return int(s...
26
1
'''simple docstring''' import shutil import tempfile import unittest import numpy as np import pytest from transformers.testing_utils import require_vision from transformers.utils import is_vision_available if is_vision_available(): from PIL import Image from transformers i...
26
'''simple docstring''' from __future__ import annotations from typing import Any class _A : def __init__( self : str , __magic_name__ : int , __magic_name__ : int , __magic_name__ : float = 0 ) -> None: """simple d...
26
1
'''simple docstring''' import json import multiprocessing import os import re from collections import defaultdict import torch from accelerate import Accelerator from accelerate.utils import set_seed from arguments import HumanEvalArguments from datasets import load_dataset, load_met...
26
'''simple docstring''' import argparse import json import os import torch from torch import nn from transformers import NllbMoeConfig, NllbMoeModel from transformers.modeling_utils import dtype_byte_size from transformers.utils import WEIGHTS_INDEX_NAME, WEIGHTS_NAME d...
26
1
'''simple docstring''' import argparse import json import os import fairseq import torch from fairseq.data import Dictionary from transformers import ( WavaVecaConfig, WavaVecaCTCTokenizer, WavaVecaFeatureExtractor, WavaVecaForCTC, WavaVecaForPreTraining, ...
26
'''simple docstring''' import cva import numpy as np class _A : def __init__( self : Any , __magic_name__ : float , __magic_name__ : int ) -> Optional[int]: """simple docstring""" if k in (0.04, 0.06): __snake_c...
26
1
'''simple docstring''' def _a ( _lowerCamelCase , _lowerCamelCase = False ) -> bool: """simple docstring""" if n == 2: return True if not n % 2 or n < 2: return False if n > 5 and n % 10 not in (1, 3, 7, 9): # can quickly check last...
26
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class _A ( __lowercase ): lowercase__: Any = ['''image_processor''', '''tokenizer'''] lowercase__: Any = ''...
26
1
'''simple docstring''' import logging import torch from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from transformers.file_utils import add_start_docstrings, add_start_docstrings_to_model_forward from transformers.models.bert.modeling_bert import ( BERT_INPUTS_D...
26
'''simple docstring''' import datasets import faiss import numpy as np import streamlit as st import torch from elasticsearch import Elasticsearch from elia_utils import ( embed_questions_for_retrieval, make_qa_sas_model, qa_sas_generate, query_es_index, query_qa_...
26
1
'''simple docstring''' import os import re import warnings from shutil import copyfile from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple import sentencepiece as spm from ...tokenization_utils import PreTrainedTokenizer if TYPE_CHECKING: from ...tokenization_uti...
26
'''simple docstring''' import warnings from ...utils import logging from .image_processing_owlvit import OwlViTImageProcessor __UpperCamelCase = logging.get_logger(__name__) class _A ( __lowercase ): def __init__( self : int , *__magic_name__ ...
26
1
'''simple docstring''' import inspect import unittest import torch import torch.nn as nn from accelerate.hooks import ( AlignDevicesHook, ModelHook, SequentialHook, add_hook_to_module, attach_align_device_hook, remove_hook_from_module, remove_hook_from...
26
'''simple docstring''' import argparse import torch from transformers import BlenderbotConfig, BlenderbotForConditionalGeneration from transformers.utils import logging logging.set_verbosity_info() __UpperCamelCase = logging.get_logger(__name__) __UpperCamelCase ...
26
1
'''simple docstring''' import unittest from datasets import load_dataset from transformers import BloomTokenizerFast from transformers.testing_utils import require_tokenizers from ...test_tokenization_common import TokenizerTesterMixin @require_tokenizers class _A ( __l...
26
'''simple docstring''' import argparse import os import re import packaging.version __UpperCamelCase = "examples/" __UpperCamelCase = { "examples": (re.compile(R"^check_min_version\(\"[^\"]+\"\)\s*$", re.MULTILINE), "check_min_version(\"VERSION\")\n"), "init...
26
1
import random from typing import Any def __lowercase ( snake_case ): """simple docstring""" for _ in range(len(snake_case ) ): __magic_name__ :Optional[int] = random.randint(0, len(snake_case ) - 1 ) __magic_name__ :Union[str, Any] = random.rand...
0
'''simple docstring''' from unittest import TestCase from datasets import Sequence, Value from datasets.arrow_dataset import Dataset class _A ( __lowercase ): def lowercase__ ( self : Any ) -> str: """simple docstring""" return [ ...
26
0
from . import ( albert, align, altclip, audio_spectrogram_transformer, auto, autoformer, bark, bart, barthez, bartpho, beit, bert, bert_generation, bert_japanese, bertweet, big_bird, bigbird_pegasus, biogpt, bit, b...
1
'''simple docstring''' import inspect import unittest import torch import torch.nn as nn from accelerate.hooks import ( AlignDevicesHook, ModelHook, SequentialHook, add_hook_to_module, attach_align_device_hook, remove_hook_from_module, remove_hook_from...
26
0
UpperCAmelCase_ = [sum(int(c, 1_0) ** 2 for c in i.__str__()) for i in range(1_0_0_0_0_0)] def SCREAMING_SNAKE_CASE_ ( _snake_case :int ) -> int: _A = 0 while number: # Increased Speed Slightly by checking every 5 digits together. sum_of_digits_squared +=...
2
'''simple docstring''' from __future__ import annotations __UpperCamelCase = [ [-1, 0], # left [0, -1], # down [1, 0], # right [0, 1], # up ] def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCas...
26
0
'''simple docstring''' import argparse import json from collections import OrderedDict from pathlib import Path import requests import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import PoolFormerConfig, PoolFormerForImageClassification, PoolFormerImageProces...
3
'''simple docstring''' def _a ( _lowerCamelCase ) -> int: """simple docstring""" if not isinstance(_lowerCamelCase , _lowerCamelCase ): raise TypeError("""only integers accepted as input""" ) else: __snake_case : List[Any] ...
26
0
"""simple docstring""" def _SCREAMING_SNAKE_CASE (): return [list(range(1000 - i , -1000 - i , -1 ) ) for i in range(1000 )] __UpperCamelCase : Union[str, Any] = generate_large_matrix() __UpperCamelCase : Tuple = ( [[4, 3, 2, -1], [3, 2, 1, -1...
4
'''simple docstring''' from __future__ import annotations import math def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase ) -> int: """simple docstring""" if depth < 0: raise V...
26
0
'''simple docstring''' # limitations under the License. from typing import Optional, Tuple, Union import torch from diffusers import DiffusionPipeline, ImagePipelineOutput class UpperCAmelCase_ ( _SCREAMING_SNAKE_CASE ): '''simple docstring''' def __init__( self ...
5
'''simple docstring''' from __future__ import annotations def _a ( _lowerCamelCase , _lowerCamelCase = None , _lowerCamelCase = None ) -> None: """simple docstring""" if start is None: __snake_case : Optional[Any] ...
26
0
import numpy as np from numpy import ndarray from scipy.optimize import Bounds, LinearConstraint, minimize def SCREAMING_SNAKE_CASE__ ( UpperCamelCase__: ndarray ): return np.dot(UpperCamelCase__ , UpperCamelCase__ ) class UpperCamelCase_ : def __init__( ...
6
'''simple docstring''' import doctest import logging import os import unittest from pathlib import Path from typing import List, Union import transformers from transformers.testing_utils import require_tf, require_torch, slow __UpperCamelCase = logging.getLogger() ...
26
0
"""simple docstring""" import gc import unittest import numpy as np import torch from transformers import CLIPTextConfig, CLIPTextModelWithProjection, CLIPTokenizer from diffusers import HeunDiscreteScheduler, PriorTransformer, ShapEPipeline from diffusers.pipelines.shap_e import ShapERenderer from diffusers.ut...
7
'''simple docstring''' import inspect from typing import Callable, List, Optional, Union import torch from transformers import ( CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, WhisperForConditionalGeneration, WhisperProcessor, ) from diffusers import ( ...
26
0
'''simple docstring''' from dataclasses import dataclass, field from typing import ClassVar, Dict from ..features import Features, Value from .base import TaskTemplate @dataclass(frozen=a__ ) class SCREAMING_SNAKE_CASE (a__ ): # `task` is not a ClassVar since we wa...
8
'''simple docstring''' import os from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home __UpperCamelCase = HUGGINGFACE_HUB_CACHE __UpperCamelCase = "config.json" __UpperCamelCase = "diffusion_pytorch_model.bin" __UpperCamelCase ...
26
0
import inspect from typing import Callable, List, Optional, Union import torch from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer from diffusers import DiffusionPipeline from diffusers.models import AutoencoderKL, UNetaDConditionModel from diffusers.pipelines.stable_diffusion import StableD...
9
'''simple docstring''' import argparse import json import re from pathlib import Path import requests import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import ( MobileNetVaConfig, MobileNetVaForImageClassification, Mobile...
26
0
import argparse import tensorflow as tf import torch from transformers import BertConfig, BertForMaskedLM from transformers.models.bert.modeling_bert import ( BertIntermediate, BertLayer, BertOutput, BertPooler, BertSelfAttention, BertSelfOutput, ) from transformers.utils import logging logg...
10
'''simple docstring''' from sklearn.metrics import recall_score import datasets __UpperCamelCase = "\nRecall is the fraction of the positive examples that were correctly labeled by the model as positive. It can be computed with the equation:\nRecall = TP / (TP + FN)\nWhere TP is...
26
0
'''simple docstring''' import random import unittest import torch from diffusers import IFInpaintingSuperResolutionPipeline from diffusers.utils import floats_tensor from diffusers.utils.import_utils import is_xformers_available from diffusers.utils.testing_utils import skip_mps, torch_device from ..pipelin...
11
'''simple docstring''' from sklearn.metrics import matthews_corrcoef import datasets __UpperCamelCase = "\nCompute the Matthews correlation coefficient (MCC)\n\nThe Matthews correlation coefficient is used in machine learning as a\nmeasure of the quality of binary and multiclass...
26
0
from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig from ...utils import logging lowerCamelCase__ : List[Any] = logging.get_logger(__name__) lowerCamelCase__ : Union[str, Any] = { "...
12
'''simple docstring''' import json import os from pathlib import Path import pytest from datasets.download.download_config import DownloadConfig from datasets.download.download_manager import DownloadManager from datasets.utils.file_utils import hash_url_to_filename __UpperCamelC...
26
0
'''simple docstring''' import flax.linen as nn import jax import jax.numpy as jnp class UpperCAmelCase_ (nn.Module ): """simple docstring""" lowerCamelCase : int lowerCamelCase : jnp.dtype = jnp.floataa def lowercase_ ( self ) -...
13
'''simple docstring''' def _a ( _lowerCamelCase = 100 ) -> int: """simple docstring""" __snake_case : Any = n * (n + 1) * (2 * n + 1) / 6 __snake_case : List[Any] = (n * (n + 1) / 2) ** 2 return int(s...
26
0
import json import logging import os import sys from time import time from unittest.mock import patch from transformers.testing_utils import TestCasePlus, require_torch_tpu logging.basicConfig(level=logging.DEBUG) a__ = logging.getLogger() def __UpperCAmelCase ( __a...
14
'''simple docstring''' from __future__ import annotations from typing import Any class _A : def __init__( self : str , __magic_name__ : int , __magic_name__ : int , __magic_name__ : float = 0 ) -> None: """simple d...
26
0
import copy import re class A : '''simple docstring''' A__ = '''hp''' A__ = {} A__ = None @classmethod def lowerCamelCase__ (cls : str , _UpperCAmelCase : Any , _UpperCAmelCase : List[str] ...
15
'''simple docstring''' import argparse import json import os import torch from torch import nn from transformers import NllbMoeConfig, NllbMoeModel from transformers.modeling_utils import dtype_byte_size from transformers.utils import WEIGHTS_INDEX_NAME, WEIGHTS_NAME d...
26
0
from typing import Any import numpy as np def __a ( A__ : np.ndarray ): return np.array_equal(A__ , matrix.conjugate().T ) def __a ( A__ : np.ndarray , A__ : np.ndarray ): SCREAMING_SNAKE_CASE = v.conjugate().T S...
16
'''simple docstring''' import cva import numpy as np class _A : def __init__( self : Any , __magic_name__ : float , __magic_name__ : int ) -> Optional[int]: """simple docstring""" if k in (0.04, 0.06): __snake_c...
26
0
import numpy as np class lowerCamelCase_ : def __init__( self : Union[str, Any] ): __A : Union[str, Any] = (0, 0) __A : Optional[Any] = None __A : int = 0 __A : List[Any] = 0 __A : Any = 0 def __eq__( self : ...
17
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class _A ( __lowercase ): lowercase__: Any = ['''image_processor''', '''tokenizer'''] lowercase__: Any = ''...
26
0
'''simple docstring''' def __a(SCREAMING_SNAKE_CASE_ : list , SCREAMING_SNAKE_CASE_ : int = 0 ): '''simple docstring''' _lowerCAmelCase = length or len(SCREAMING_SNAKE_CASE_ ) _lowerCAmelCase = False for i in range(length - 1 ...
18
'''simple docstring''' import datasets import faiss import numpy as np import streamlit as st import torch from elasticsearch import Elasticsearch from elia_utils import ( embed_questions_for_retrieval, make_qa_sas_model, qa_sas_generate, query_es_index, query_qa_...
26
0
"""simple docstring""" from typing import List, Optional, Tuple, Union import PIL import torch from torchvision import transforms from diffusers.pipeline_utils import DiffusionPipeline, ImagePipelineOutput from diffusers.schedulers import DDIMScheduler from diffusers.utils import randn_tensor ...
19
'''simple docstring''' import warnings from ...utils import logging from .image_processing_owlvit import OwlViTImageProcessor __UpperCamelCase = logging.get_logger(__name__) class _A ( __lowercase ): def __init__( self : int , *__magic_name__ ...
26
0
import unittest from transformers import is_torch_available from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow if is_torch_available(): import torch from transformers import XLMRobertaModel @require_sentencepiece @require_tokenizers @require_torch class ...
20
'''simple docstring''' import argparse import torch from transformers import BlenderbotConfig, BlenderbotForConditionalGeneration from transformers.utils import logging logging.set_verbosity_info() __UpperCamelCase = logging.get_logger(__name__) __UpperCamelCase ...
26
0
import torch import torch.nn as nn from transformers.modeling_utils import ModuleUtilsMixin from transformers.models.ta.modeling_ta import TaBlock, TaConfig, TaLayerNorm from ...configuration_utils import ConfigMixin, register_to_config from ...models import ModelMixin class __A ( Upp...
21
'''simple docstring''' import argparse import os import re import packaging.version __UpperCamelCase = "examples/" __UpperCamelCase = { "examples": (re.compile(R"^check_min_version\(\"[^\"]+\"\)\s*$", re.MULTILINE), "check_min_version(\"VERSION\")\n"), "init...
26
0
'''simple docstring''' import unittest from transformers import LiltConfig, is_torch_available from transformers.testing_utils import require_torch, slow, torch_device from ...generation.test_utils import GenerationTesterMixin from ...test_configuration_common import ConfigTester from ...test_mo...
22
'''simple docstring''' from unittest import TestCase from datasets import Sequence, Value from datasets.arrow_dataset import Dataset class _A ( __lowercase ): def lowercase__ ( self : Any ) -> str: """simple docstring""" return [ ...
26
0
import argparse import glob import logging import os import sys import time from collections import defaultdict from pathlib import Path from typing import Dict, List, Tuple import numpy as np import pytorch_lightning as pl import torch from callbacks import SeqaSeqLoggingCallback, get_check...
23
'''simple docstring''' import inspect import unittest import torch import torch.nn as nn from accelerate.hooks import ( AlignDevicesHook, ModelHook, SequentialHook, add_hook_to_module, attach_align_device_hook, remove_hook_from_module, remove_hook_from...
26
0
'''simple docstring''' from typing import Optional from torch import nn from .transformer_ad import TransformeraDModel, TransformeraDModelOutput class lowerCAmelCase ( nn.Module): def __init__( self , __SCREAMING_SNAKE_CASE = 16 , __SCREAMING_SNAKE_CASE = 88 , __SCREAMING_SNAK...
24
'''simple docstring''' from __future__ import annotations __UpperCamelCase = [ [-1, 0], # left [0, -1], # down [1, 0], # right [0, 1], # up ] def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCas...
26
0
import os from shutil import copyfile from typing import List, Optional, Tuple from ...tokenization_utils import AddedToken from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import is_sentencepiece_available, logging if is_sentencepiece_available(): from .tokenization_big_bird import ...
25
'''simple docstring''' def _a ( _lowerCamelCase ) -> int: """simple docstring""" if not isinstance(_lowerCamelCase , _lowerCamelCase ): raise TypeError("""only integers accepted as input""" ) else: __snake_case : List[Any] ...
26
0
import argparse import hashlib # hashlib is only used inside the Test class import struct class lowerCamelCase: '''simple docstring''' def __init__( self , snake_case_ ): _A = data _A = [0X6745_2301, 0XEFCD_AB89, ...
27
'''simple docstring''' from __future__ import annotations import math def _a ( _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase , _lowerCamelCase ) -> int: """simple docstring""" if depth < 0: raise V...
26
0
'''simple docstring''' from __future__ import annotations def lowercase__( __UpperCamelCase: list[int] ): # This function is recursive """simple docstring""" SCREAMING_SNAKE_CASE : Optional[int] = len(__UpperCamelCase ) # If...
28
'''simple docstring''' from __future__ import annotations def _a ( _lowerCamelCase , _lowerCamelCase = None , _lowerCamelCase = None ) -> None: """simple docstring""" if start is None: __snake_case : Optional[Any] ...
26
0
"""simple docstring""" import torch from transformers import AutoModel class __lowerCamelCase ( torch.nn.Module ): def __init__( self , UpperCAmelCase="sayef/fsner-bert-base-uncased" ): super(UpperCAmelCase , self ).__init__() lowerCamelCase_ = AutoMo...
29
'''simple docstring''' import doctest import logging import os import unittest from pathlib import Path from typing import List, Union import transformers from transformers.testing_utils import require_tf, require_torch, slow __UpperCamelCase = logging.getLogger() ...
26
0
from __future__ import annotations def lowerCamelCase__ ( _lowercase ): '''simple docstring''' UpperCAmelCase_ : Optional[int] = 0.00 UpperCAmelCase_ : Tuple = 0 for resistor in resistors: if resistor <= 0: UpperCAmelCase_ : ...
30
'''simple docstring''' import inspect from typing import Callable, List, Optional, Union import torch from transformers import ( CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, WhisperForConditionalGeneration, WhisperProcessor, ) from diffusers import ( ...
26
0
import torch from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from transformers.file_utils import add_start_docstrings, add_start_docstrings_to_model_forward from transformers.models.bert.modeling_bert import ( BERT_INPUTS_DOCSTRING, BERT_START_DOCSTRING, BertEmbeddings, BertLay...
31
'''simple docstring''' import os from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home __UpperCamelCase = HUGGINGFACE_HUB_CACHE __UpperCamelCase = "config.json" __UpperCamelCase = "diffusion_pytorch_model.bin" __UpperCamelCase ...
26
0
import functools import operator from ...configuration_utils import PretrainedConfig from ...utils import logging UpperCAmelCase_ = logging.get_logger(__name__) UpperCAmelCase_ = { "microsoft/wavlm-base": "https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json", # See...
32
'''simple docstring''' import argparse import json import re from pathlib import Path import requests import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import ( MobileNetVaConfig, MobileNetVaForImageClassification, Mobile...
26
0
from ...configuration_utils import PretrainedConfig from ...utils import logging lowerCamelCase__ : Union[str, Any] = logging.get_logger(__name__) lowerCamelCase__ : Optional[int] = { """microsoft/trocr-base-handwritten""": ( """https://huggin...
33
'''simple docstring''' from sklearn.metrics import recall_score import datasets __UpperCamelCase = "\nRecall is the fraction of the positive examples that were correctly labeled by the model as positive. It can be computed with the equation:\nRecall = TP / (TP + FN)\nWhere TP is...
26
0
"""simple docstring""" import os import tempfile import unittest import numpy as np from diffusers.utils import is_flax_available from diffusers.utils.testing_utils import require_flax, slow if is_flax_available(): import jax import jax.numpy as jnp from flax.jax_utils import replicate from flax...
34
'''simple docstring''' from sklearn.metrics import matthews_corrcoef import datasets __UpperCamelCase = "\nCompute the Matthews correlation coefficient (MCC)\n\nThe Matthews correlation coefficient is used in machine learning as a\nmeasure of the quality of binary and multiclass...
26
0
import sys def a ( A__ ) -> Any: '''simple docstring''' SCREAMING_SNAKE_CASE__ : int = len(A__ ) SCREAMING_SNAKE_CASE__ : Tuple = [[0 for x in range(A__ )] for x in range(A__ )] SCREAMING_SNAKE_CASE__ : str...
35
'''simple docstring''' import json import os from pathlib import Path import pytest from datasets.download.download_config import DownloadConfig from datasets.download.download_manager import DownloadManager from datasets.utils.file_utils import hash_url_to_filename __UpperCamelC...
26
0
from typing import Dict, List, Optional, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import ( center_crop, convert_to_rgb, get_resize_output_image_size, normalize, rescale, resize, to_channel_dime...
36
'''simple docstring''' def _a ( _lowerCamelCase = 100 ) -> int: """simple docstring""" __snake_case : Any = n * (n + 1) * (2 * n + 1) / 6 __snake_case : List[Any] = (n * (n + 1) / 2) ** 2 return int(s...
26
0
from collections import defaultdict from graphs.minimum_spanning_tree_prims import prisms_algorithm as mst def UpperCamelCase_ ( ) -> Optional[Any]: a__, a__ : Tuple = 9, 14 # noqa: F841 a__ : int = [ [0, 1, 4], [0, 7, 8], [1, 2, 8], [7, ...
37
'''simple docstring''' from __future__ import annotations from typing import Any class _A : def __init__( self : str , __magic_name__ : int , __magic_name__ : int , __magic_name__ : float = 0 ) -> None: """simple d...
26
0
'''simple docstring''' def UpperCamelCase__ ( ) -> Union[str, Any]: '''simple docstring''' snake_case__ : Any = [] snake_case__ : Tuple = 1 while len(__magic_name__ ) < 1E6: constant.append(str(__magic_name__ ) ) i += 1 snake_case__ ...
38
'''simple docstring''' import argparse import json import os import torch from torch import nn from transformers import NllbMoeConfig, NllbMoeModel from transformers.modeling_utils import dtype_byte_size from transformers.utils import WEIGHTS_INDEX_NAME, WEIGHTS_NAME d...
26
0
import math import numpy as np import qiskit from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute def __SCREAMING_SNAKE_CASE (SCREAMING_SNAKE_CASE__ = 3 ): if isinstance(SCREAMING_SNAKE_CASE__ , SCREAMING_SNAKE_CASE__ ): raise TypeError(...
39
'''simple docstring''' import cva import numpy as np class _A : def __init__( self : Any , __magic_name__ : float , __magic_name__ : int ) -> Optional[int]: """simple docstring""" if k in (0.04, 0.06): __snake_c...
26
0
import json import os from typing import Optional, Tuple from ...tokenization_utils import PreTrainedTokenizer from ...utils import logging __UpperCAmelCase = logging.get_logger(__name__) __UpperCAmelCase = {'''vocab_file''': '''vocab.json'''} __UpperCAmelCase = { '''vocab_file''': { ...
40
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class _A ( __lowercase ): lowercase__: Any = ['''image_processor''', '''tokenizer'''] lowercase__: Any = ''...
26
0