code
stringlengths
86
54.5k
code_codestyle
int64
0
371
style_context
stringlengths
87
49.2k
style_context_codestyle
int64
0
349
label
int64
0
1
"""simple docstring""" from manim import * class _lowercase ( __a ): """simple docstring""" def UpperCAmelCase_ ( self : Union[str, Any] ) -> Union[str, Any]: '''simple docstring''' __UpperC...
85
"""simple docstring""" import json import os import shutil import tempfile import unittest from multiprocessing import get_context from pathlib import Path import datasets import numpy as np from datasets import load_dataset from parameterized import parameterized from transformers import AutoProcesso...
85
1
"""simple docstring""" import json import sys def lowerCAmelCase (__UpperCamelCase : List[Any] , __UpperCamelCase : Union[str, Any] ): """simple docstring""" with open(__UpperCamelCase , encoding='''utf-8''' ) as f: __UpperCamelCase =json.load(__Upper...
85
"""simple docstring""" from __future__ import annotations from collections.abc import Iterator from typing import Any class _lowercase : """simple docstring""" def __init__( self : int , UpperCamelCase__ : Any ) -> Optional...
85
1
"""simple docstring""" import io import json import unittest from parameterized import parameterized from transformers import FSMTForConditionalGeneration, FSMTTokenizer from transformers.testing_utils import get_tests_dir, require_torch, slow, torch_device from utils import calculate_bleu __lowercase...
85
"""simple docstring""" import os import time import pytest from datasets.utils.filelock import FileLock, Timeout def lowerCAmelCase (__UpperCamelCase : int ): """simple docstring""" __UpperCamelCase =FileLock(str(tmpdir / '''foo.lock''' ) ) __UpperCamelCase =F...
85
1
"""simple docstring""" import inspect import unittest from transformers import BitConfig from transformers.testing_utils import require_torch, require_vision, slow, torch_device from transformers.utils import cached_property, is_torch_available, is_vision_available from ...test_backbone_common import Backbo...
85
"""simple docstring""" import argparse import logging import os import datasets import tensorflow as tf from transformers import AutoTokenizer __lowercase = logging.getLogger(__name__) def lowerCAmelCase (): """simple docstring""" __UpperCamelCase =argparse.Arg...
85
1
"""simple docstring""" import argparse from pathlib import Path import torch from transformers import OPTConfig, OPTModel from transformers.utils import logging logging.set_verbosity_info() __lowercase = logging.get_logger(__name__) def lowerCAmelCase (__UpperCamelCase : Optional[in...
85
"""simple docstring""" import os import unittest from transformers.models.bartpho.tokenization_bartpho import VOCAB_FILES_NAMES, BartphoTokenizer from transformers.testing_utils import get_tests_dir from ...test_tokenization_common import TokenizerTesterMixin __lowercase = get_tests_dir('''fix...
85
1
"""simple docstring""" import gc import unittest import numpy as np import torch from diffusers import ( AudioDiffusionPipeline, AutoencoderKL, DDIMScheduler, DDPMScheduler, DiffusionPipeline, Mel, UNetaDConditionModel, UNetaDModel, ) from diffusers.utils import slow...
85
"""simple docstring""" import json from typing import TYPE_CHECKING, List, Optional, Tuple from tokenizers import pre_tokenizers from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging if TYPE_CHECKING: from transformers.pipelines.conversational import Conversati...
85
1
"""simple docstring""" import argparse import json from typing import List from ltp import LTP from transformers import BertTokenizer def lowerCAmelCase (__UpperCamelCase : int ): """simple docstring""" if ( (cp >= 0X4e00 and cp <= 0X9fff) or (cp >= 0X340...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 3 , __UpperCamelCase : int = 7 , __UpperCamelCase : int = 1_0_0_0_0_0_0 ): """simple docstring""" __UpperCamelCase =0 __UpperCamelCase =1 for current_denominator in range(1 ...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 1_0 ): """simple docstring""" if not isinstance(__UpperCamelCase , __UpperCamelCase ) or n < 0: raise ValueError('''Invalid input''' ) __UpperCamelCase =1_0**n __UpperCamelCase ...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 1_0_0_0 ): """simple docstring""" __UpperCamelCase =-1 __UpperCamelCase =0 for a in range(1 , n // 3 ): # Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c ...
85
1
"""simple docstring""" import json import os from typing import Optional import numpy as np from ...feature_extraction_utils import BatchFeature from ...processing_utils import ProcessorMixin from ...utils import logging from ...utils.hub import get_file_from_repo from ..auto import AutoTokenizer __...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : str ): """simple docstring""" __UpperCamelCase =0 # if input_string is "aba" than new_input_string become "a|b|a" __UpperCamelCase ='''''' __UpperCamelCase ='''''' # append eac...
85
1
"""simple docstring""" from __future__ import annotations import math def lowerCAmelCase (__UpperCamelCase : list , __UpperCamelCase : list ): """simple docstring""" if len(__UpperCamelCase ) != 2 or len(a[0] ) != 2 or len(__UpperCamelCase ) != 2 or len(b[0] ) != 2: ...
85
"""simple docstring""" from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig __lowercase = { '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''', '''albert-...
85
1
"""simple docstring""" import unittest from transformers import DebertaConfig, is_torch_available from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device from ...test_configuration_common import ConfigTester from ...test_modeling_common import Model...
85
"""simple docstring""" from queue import PriorityQueue from typing import Any import numpy as np def lowerCAmelCase (__UpperCamelCase : dict , __UpperCamelCase : str , __UpperCamelCase : set , __UpperCamelCase : set , __UpperCamelCase : dict , __UpperCamelCase ...
85
1
"""simple docstring""" import shutil import tempfile import unittest from unittest.mock import patch from transformers import ( DefaultFlowCallback, IntervalStrategy, PrinterCallback, ProgressCallback, Trainer, TrainerCallback, TrainingArguments, is_torch_available, ) ...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available __lowercase = {'''configuration_ibert''': ['''IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''IBertConfig''', '''IBertOnnxConfig''']} try: if not is_torch_...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : List[Any] ): """simple docstring""" if not head: return True # split the list to two parts __UpperCamelCase , __UpperCamelCase =head.next, head while fast and fast.next: ...
85
"""simple docstring""" from dataclasses import dataclass from typing import Dict, Optional, Union import torch import torch.nn.functional as F from torch import nn from ..configuration_utils import ConfigMixin, register_to_config from ..utils import BaseOutput from .attention import BasicTransformerBlock ...
85
1
"""simple docstring""" from __future__ import annotations import copy import inspect import json import math import os import tempfile import unittest from importlib import import_module import numpy as np from transformers import ViTMAEConfig from transformers.file_utils import cached_property, is_...
85
"""simple docstring""" import os from pathlib import Path def lowerCAmelCase (): """simple docstring""" from torch.utils.cpp_extension import load __UpperCamelCase =Path(__UpperCamelCase ).resolve().parent.parent.parent / '''kernels''' / '''deformable_detr''' __Uppe...
85
1
"""simple docstring""" import logging from pathlib import Path import numpy as np import pytorch_lightning as pl import torch from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint from pytorch_lightning.utilities import rank_zero_only from utils_rag import save_json def lowerCAmelCase...
85
"""simple docstring""" import itertools import json import os import unittest from transformers import AddedToken, LongformerTokenizer, LongformerTokenizerFast from transformers.models.longformer.tokenization_longformer import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, slow ...
85
1
"""simple docstring""" from __future__ import annotations import collections import pprint from pathlib import Path def lowerCAmelCase (__UpperCamelCase : str ): """simple docstring""" return "".join(sorted(__UpperCamelCase ) ) def lowerCAmelCase (__UpperCamelCase : str )...
85
"""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.utils import logging ...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : Dict , __UpperCamelCase : Optional[Any] ): """simple docstring""" __UpperCamelCase =[0 for i in range(r + 1 )] # nc0 = 1 __UpperCamelCase =1 for i in range(1 , n + 1 ): ...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : Dict , __UpperCamelCase : Optional[Any] ): """simple docstring""" __UpperCamelCase =[0 for i in range(r + 1 )] # nc0 = 1 __UpperCamelCase =1 for i in range(1 , n + 1 ): ...
85
1
"""simple docstring""" import inspect import unittest from transformers import MobileViTVaConfig from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device from transformers.utils import cached_property, is_torch_available, is_vision_available from ...t...
85
"""simple docstring""" import argparse import json import requests import timm import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import AutoImageProcessor, SwinConfig, SwinForImageClassification def lowerCAmelCase (__UpperCamelCase : Tuple ): ...
85
1
"""simple docstring""" from ...utils import ( OptionalDependencyNotAvailable, is_torch_available, is_transformers_available, is_transformers_version, ) try: if not (is_transformers_available() and is_torch_available()): raise OptionalDependencyNotAvailable() except OptionalDe...
85
"""simple docstring""" import os from pathlib import Path from unittest.mock import patch import pytest import zstandard as zstd from datasets.download.download_config import DownloadConfig from datasets.utils.file_utils import ( OfflineModeIsEnabled, cached_path, fsspec_get, fsspec_hea...
85
1
"""simple docstring""" from __future__ import annotations from collections.abc import Iterator from typing import Any class _lowercase : """simple docstring""" def __init__( self : int , UpperCamelCase__ : Any ) -> Optional...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available from ...utils import OptionalDependencyNotAvailable __lowercase = {'''configuration_gpt_neox''': ['''GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GPTNeoXConfi...
85
1
"""simple docstring""" import json import os import shutil import tempfile import unittest from multiprocessing import get_context from pathlib import Path import datasets import numpy as np from datasets import load_dataset from parameterized import parameterized from transformers import AutoProcesso...
85
"""simple docstring""" # Copyright 2023 The HuggingFace Inc. team. 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...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int , __UpperCamelCase : int ): """simple docstring""" return int((input_a, input_a).count(1 ) != 0 ) def lowerCAmelCase (): """simple docstring""" assert or_gate(0 , 0 ) == 0 assert...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available __lowercase = { '''configuration_conditional_detr''': [ '''CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''C...
85
1
"""simple docstring""" import gc import unittest import numpy as np import torch from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMScheduler, PNDMScheduler, StableDiffusionLDMaDPipeline, UNetaDConditionModel, ) from di...
85
"""simple docstring""" import json import os import shutil import tempfile import unittest from multiprocessing import get_context from pathlib import Path import datasets import numpy as np from datasets import load_dataset from parameterized import parameterized from transformers import AutoProcesso...
85
1
"""simple docstring""" import json from typing import List, Optional, Tuple from tokenizers import normalizers from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging from .tokenization_squeezebert import SqueezeBertTokenizer __lowercase = logging.get_logge...
85
"""simple docstring""" from __future__ import annotations from collections.abc import Iterator from typing import Any class _lowercase : """simple docstring""" def __init__( self : int , UpperCamelCase__ : Any ) -> Optional...
85
1
"""simple docstring""" from ...configuration_utils import PretrainedConfig from ...utils import logging __lowercase = logging.get_logger(__name__) __lowercase = { '''funnel-transformer/small''': '''https://huggingface.co/funnel-transformer/small/resolve/main/config.json''', '''...
85
"""simple docstring""" import os import time import pytest from datasets.utils.filelock import FileLock, Timeout def lowerCAmelCase (__UpperCamelCase : int ): """simple docstring""" __UpperCamelCase =FileLock(str(tmpdir / '''foo.lock''' ) ) __UpperCamelCase =F...
85
1
"""simple docstring""" import unittest from transformers import ( MODEL_FOR_OBJECT_DETECTION_MAPPING, AutoFeatureExtractor, AutoModelForObjectDetection, ObjectDetectionPipeline, is_vision_available, pipeline, ) from transformers.testing_utils import ( is_pipeline_test, ne...
85
"""simple docstring""" import argparse import logging import os import datasets import tensorflow as tf from transformers import AutoTokenizer __lowercase = logging.getLogger(__name__) def lowerCAmelCase (): """simple docstring""" __UpperCamelCase =argparse.Arg...
85
1
"""simple docstring""" import os import unittest from huggingface_hub.utils import are_progress_bars_disabled import transformers.models.bart.tokenization_bart from transformers import logging from transformers.testing_utils import CaptureLogger, mockenv, mockenv_context from transformers.utils.logging imp...
85
"""simple docstring""" import os import unittest from transformers.models.bartpho.tokenization_bartpho import VOCAB_FILES_NAMES, BartphoTokenizer from transformers.testing_utils import get_tests_dir from ...test_tokenization_common import TokenizerTesterMixin __lowercase = get_tests_dir('''fix...
85
1
"""simple docstring""" import unittest from transformers import load_tool from .test_tools_common import ToolTesterMixin class _lowercase ( unittest.TestCase , __a ): """simple docstring""" def UpperCAmelCase_ ( self : Union[str, An...
85
"""simple docstring""" import json from typing import TYPE_CHECKING, List, Optional, Tuple from tokenizers import pre_tokenizers from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging if TYPE_CHECKING: from transformers.pipelines.conversational import Conversati...
85
1
"""simple docstring""" from __future__ import annotations __lowercase = 8.988e9 # units = N * m^s * C^-2 def lowerCAmelCase (__UpperCamelCase : float , __UpperCamelCase : float , __UpperCamelCase : float , __UpperCamelCase : float ): """simple docstring""" ...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 3 , __UpperCamelCase : int = 7 , __UpperCamelCase : int = 1_0_0_0_0_0_0 ): """simple docstring""" __UpperCamelCase =0 __UpperCamelCase =1 for current_denominator in range(1 ...
85
1
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available __lowercase = { '''configuration_rag''': ['''RagConfig'''], '''retrieval_rag''': ['''RagRetriever'''], '''tokenization_rag''':...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 1_0_0_0 ): """simple docstring""" __UpperCamelCase =-1 __UpperCamelCase =0 for a in range(1 , n // 3 ): # Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c ...
85
1
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_tf_available, is_torch_available, ) __lowercase = {'''configuration_encoder_decoder''': ['''EncoderDecoderConfig''']} try: ...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : str ): """simple docstring""" __UpperCamelCase =0 # if input_string is "aba" than new_input_string become "a|b|a" __UpperCamelCase ='''''' __UpperCamelCase ='''''' # append eac...
85
1
"""simple docstring""" __lowercase = [4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5] __lowercase = [3, 7, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5] __lowercase = { 0: '''Sunday''', 1: '''Monday''', 2: '''Tuesday''', 3: '''Wednesday''', 4: '''Thursday''', 5: '''Friday''', 6...
85
"""simple docstring""" from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig __lowercase = { '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''', '''albert-...
85
1
"""simple docstring""" import builtins import sys from ...utils.imports import _is_package_available from . import cursor, input from .helpers import Direction, clear_line, forceWrite, linebreak, move_cursor, reset_cursor, writeColor from .keymap import KEYMAP __lowercase = False try: __l...
85
"""simple docstring""" from queue import PriorityQueue from typing import Any import numpy as np def lowerCAmelCase (__UpperCamelCase : dict , __UpperCamelCase : str , __UpperCamelCase : set , __UpperCamelCase : set , __UpperCamelCase : dict , __UpperCamelCase ...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 5_0 ): """simple docstring""" __UpperCamelCase =[1] * (length + 1) for row_length in range(3 , length + 1 ): for block_length in range(3 , row_length + 1 ): for ...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available __lowercase = {'''configuration_ibert''': ['''IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''IBertConfig''', '''IBertOnnxConfig''']} try: if not is_torch_...
85
1
"""simple docstring""" import os import posixpath import uuid from dataclasses import dataclass from typing import TYPE_CHECKING, Iterable, List, Optional, Tuple, Union import numpy as np import pyarrow as pa import datasets from datasets.arrow_writer import ArrowWriter, ParquetWriter from datasets.conf...
85
"""simple docstring""" from dataclasses import dataclass from typing import Dict, Optional, Union import torch import torch.nn.functional as F from torch import nn from ..configuration_utils import ConfigMixin, register_to_config from ..utils import BaseOutput from .attention import BasicTransformerBlock ...
85
1
"""simple docstring""" import inspect from typing import Optional, Union import numpy as np import PIL import torch from torch.nn import functional as F from torchvision import transforms from transformers import CLIPFeatureExtractor, CLIPModel, CLIPTextModel, CLIPTokenizer from diffusers import ( A...
85
"""simple docstring""" import os from pathlib import Path def lowerCAmelCase (): """simple docstring""" from torch.utils.cpp_extension import load __UpperCamelCase =Path(__UpperCamelCase ).resolve().parent.parent.parent / '''kernels''' / '''deformable_detr''' __Uppe...
85
1
"""simple docstring""" from maths.is_square_free import is_square_free from maths.prime_factors import prime_factors def lowerCAmelCase (__UpperCamelCase : int ): """simple docstring""" __UpperCamelCase =prime_factors(__UpperCamelCase ) if is_square_free(__UpperCamelCase ...
85
"""simple docstring""" import itertools import json import os import unittest from transformers import AddedToken, LongformerTokenizer, LongformerTokenizerFast from transformers.models.longformer.tokenization_longformer import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, slow ...
85
1
"""simple docstring""" import os from shutil import copyfile from typing import List, Optional, Tuple import sentencepiece as spm from ...tokenization_utils import PreTrainedTokenizer from ...utils import logging __lowercase = logging.get_logger(__name__) __lowercase = {'''vocab_...
85
"""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.utils import logging ...
85
1
"""simple docstring""" from statistics import mean, stdev def lowerCAmelCase (__UpperCamelCase : list , __UpperCamelCase : int = 3 ): """simple docstring""" __UpperCamelCase =min(__UpperCamelCase ) __UpperCamelCase =max(__UpperCamelCase ) # normalize...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : Dict , __UpperCamelCase : Optional[Any] ): """simple docstring""" __UpperCamelCase =[0 for i in range(r + 1 )] # nc0 = 1 __UpperCamelCase =1 for i in range(1 , n + 1 ): ...
85
1
"""simple docstring""" from math import ceil def lowerCAmelCase (__UpperCamelCase : List[str] , __UpperCamelCase : Union[str, Any] ): """simple docstring""" __UpperCamelCase =list(range(0 , __UpperCamelCase ) ) __UpperCamelCase =[item for sublist in l...
85
"""simple docstring""" import argparse import json import requests import timm import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import AutoImageProcessor, SwinConfig, SwinForImageClassification def lowerCAmelCase (__UpperCamelCase : Tuple ): ...
85
1
"""simple docstring""" import random import unittest import torch from diffusers import IFInpaintingPipeline 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 ..pipeline_params im...
85
"""simple docstring""" import os from pathlib import Path from unittest.mock import patch import pytest import zstandard as zstd from datasets.download.download_config import DownloadConfig from datasets.utils.file_utils import ( OfflineModeIsEnabled, cached_path, fsspec_get, fsspec_hea...
85
1
"""simple docstring""" from typing import TYPE_CHECKING from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available from ...utils import OptionalDependencyNotAvailable __lowercase = {'''configuration_gpt_neox''': ['''GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GPTNeoXConfi...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available from ...utils import OptionalDependencyNotAvailable __lowercase = {'''configuration_gpt_neox''': ['''GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GPTNeoXConfi...
85
1
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available __lowercase = { '''configuration_maskformer''': ['''MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MaskFormerConfig'''], '''co...
85
"""simple docstring""" # Copyright 2023 The HuggingFace Inc. team. 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...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : str ): """simple docstring""" return credit_card_number.startswith(('''34''', '''35''', '''37''', '''4''', '''5''', '''6''') ) def lowerCAmelCase (__UpperCamelCase : str ): """simple docstring""" __Up...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available __lowercase = { '''configuration_conditional_detr''': [ '''CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''C...
85
1
"""simple docstring""" import math def lowerCAmelCase (__UpperCamelCase : int = 1_0_0 ): """simple docstring""" __UpperCamelCase =sum(i * i for i in range(1 , n + 1 ) ) __UpperCamelCase =int(math.pow(sum(range(1 , n + 1 ) ) , 2 ) ) return squar...
85
"""simple docstring""" import json import os import shutil import tempfile import unittest from multiprocessing import get_context from pathlib import Path import datasets import numpy as np from datasets import load_dataset from parameterized import parameterized from transformers import AutoProcesso...
85
1
"""simple docstring""" from __future__ import annotations from collections.abc import Sequence from typing import Literal def lowerCAmelCase (__UpperCamelCase : str , __UpperCamelCase : str ): """simple docstring""" __UpperCamelCase =list(__UpperCamelCase ) __...
85
"""simple docstring""" from __future__ import annotations from collections.abc import Iterator from typing import Any class _lowercase : """simple docstring""" def __init__( self : int , UpperCamelCase__ : Any ) -> Optional...
85
1
"""simple docstring""" import logging import os import sys from pathlib import Path from unittest.mock import patch from parameterized import parameterized from run_eval import run_generate from run_eval_search import run_search from transformers.testing_utils import CaptureStdout, TestCasePlus, slow fr...
85
"""simple docstring""" import os import time import pytest from datasets.utils.filelock import FileLock, Timeout def lowerCAmelCase (__UpperCamelCase : int ): """simple docstring""" __UpperCamelCase =FileLock(str(tmpdir / '''foo.lock''' ) ) __UpperCamelCase =F...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : str = "The quick brown fox jumps over the lazy dog" , ): """simple docstring""" __UpperCamelCase =set() # Replace all the whitespace in our sentence __UpperCamelCase =input_str.replace(''' ''' ...
85
"""simple docstring""" import argparse import logging import os import datasets import tensorflow as tf from transformers import AutoTokenizer __lowercase = logging.getLogger(__name__) def lowerCAmelCase (): """simple docstring""" __UpperCamelCase =argparse.Arg...
85
1
"""simple docstring""" from dataclasses import dataclass from typing import Dict, Optional, Union import torch import torch.nn.functional as F from torch import nn from ..configuration_utils import ConfigMixin, register_to_config from ..utils import BaseOutput from .attention import BasicTransformerBlock ...
85
"""simple docstring""" import os import unittest from transformers.models.bartpho.tokenization_bartpho import VOCAB_FILES_NAMES, BartphoTokenizer from transformers.testing_utils import get_tests_dir from ...test_tokenization_common import TokenizerTesterMixin __lowercase = get_tests_dir('''fix...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : str , __UpperCamelCase : int ): """simple docstring""" __UpperCamelCase =word.split() def justify(__UpperCamelCase : list , __UpperCamelCase : int , __UpperCamelCase : int ) -> str: ...
85
"""simple docstring""" import json from typing import TYPE_CHECKING, List, Optional, Tuple from tokenizers import pre_tokenizers from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging if TYPE_CHECKING: from transformers.pipelines.conversational import Conversati...
85
1
"""simple docstring""" from __future__ import annotations def lowerCAmelCase (__UpperCamelCase : int , __UpperCamelCase : int ): """simple docstring""" __UpperCamelCase =[] create_all_state(1 , __UpperCamelCase , __UpperCamelCase , [] , __Upper...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 3 , __UpperCamelCase : int = 7 , __UpperCamelCase : int = 1_0_0_0_0_0_0 ): """simple docstring""" __UpperCamelCase =0 __UpperCamelCase =1 for current_denominator in range(1 ...
85
1
"""simple docstring""" import argparse import json import numpy import torch from transformers.models.xlm.tokenization_xlm import VOCAB_FILES_NAMES from transformers.utils import CONFIG_NAME, WEIGHTS_NAME, logging logging.set_verbosity_info() def lowerCAmelCase (__UpperCamelCase : int , ...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 1_0_0_0 ): """simple docstring""" __UpperCamelCase =-1 __UpperCamelCase =0 for a in range(1 , n // 3 ): # Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c ...
85
1
"""simple docstring""" __lowercase = { '''Pillow''': '''Pillow<10.0.0''', '''accelerate''': '''accelerate>=0.20.3''', '''av''': '''av==9.2.0''', '''beautifulsoup4''': '''beautifulsoup4''', '''black''': '''black~=23.1''', '''codecarbon''': '''codecarbon==1.2.0''', '''cooki...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : str ): """simple docstring""" __UpperCamelCase =0 # if input_string is "aba" than new_input_string become "a|b|a" __UpperCamelCase ='''''' __UpperCamelCase ='''''' # append eac...
85
1
"""simple docstring""" from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig from ...utils import logging __lowercase = logging.get_logger(__name__) __lowercase = { '''junnyu/roformer_ch...
85
"""simple docstring""" from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig __lowercase = { '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''', '''albert-...
85
1
"""simple docstring""" import platform from argparse import ArgumentParser import huggingface_hub from .. import __version__ as version from ..utils import is_accelerate_available, is_torch_available, is_transformers_available, is_xformers_available from . import BaseDiffusersCLICommand def lowerCAmel...
85
"""simple docstring""" from queue import PriorityQueue from typing import Any import numpy as np def lowerCAmelCase (__UpperCamelCase : dict , __UpperCamelCase : str , __UpperCamelCase : set , __UpperCamelCase : set , __UpperCamelCase : dict , __UpperCamelCase ...
85
1
"""simple docstring""" from typing import Any, Dict, Optional import torch import torch.nn.functional as F from torch import nn from ..utils import maybe_allow_in_graph from .activations import get_activation from .attention_processor import Attention from .embeddings import CombinedTimestepLabelEmbedding...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available __lowercase = {'''configuration_ibert''': ['''IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''IBertConfig''', '''IBertOnnxConfig''']} try: if not is_torch_...
85
1
"""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 _lowercase ( __a ): """simple docstring""" lowercase__...
85
"""simple docstring""" from dataclasses import dataclass from typing import Dict, Optional, Union import torch import torch.nn.functional as F from torch import nn from ..configuration_utils import ConfigMixin, register_to_config from ..utils import BaseOutput from .attention import BasicTransformerBlock ...
85
1
"""simple docstring""" from __future__ import annotations import numpy as np def lowerCAmelCase (__UpperCamelCase : list[float] ): """simple docstring""" return np.maximum(0 , __UpperCamelCase ) if __name__ == "__main__": print(np.array(relu([-1, 0, 5]))) # --> [0, 0,...
85
"""simple docstring""" import os from pathlib import Path def lowerCAmelCase (): """simple docstring""" from torch.utils.cpp_extension import load __UpperCamelCase =Path(__UpperCamelCase ).resolve().parent.parent.parent / '''kernels''' / '''deformable_detr''' __Uppe...
85
1
"""simple docstring""" import logging import os from dataclasses import dataclass, field from typing import Dict, Optional import numpy as np from utils_multiple_choice import MultipleChoiceDataset, Split, processors import transformers from transformers import ( AutoConfig, AutoModelForMultiple...
85
"""simple docstring""" import itertools import json import os import unittest from transformers import AddedToken, LongformerTokenizer, LongformerTokenizerFast from transformers.models.longformer.tokenization_longformer import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, slow ...
85
1
"""simple docstring""" # Copyright 2023 The HuggingFace Inc. team. 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...
85
"""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.utils import logging ...
85
1
"""simple docstring""" import os from pathlib import Path def lowerCAmelCase (): """simple docstring""" from torch.utils.cpp_extension import load __UpperCamelCase =Path(__UpperCamelCase ).resolve().parent.parent.parent / '''kernels''' / '''deformable_detr''' __Uppe...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : Dict , __UpperCamelCase : Optional[Any] ): """simple docstring""" __UpperCamelCase =[0 for i in range(r + 1 )] # nc0 = 1 __UpperCamelCase =1 for i in range(1 , n + 1 ): ...
85
1
"""simple docstring""" import shutil import tempfile import unittest from transformers import SPIECE_UNDERLINE, BatchEncoding, MBartTokenizer, MBartTokenizerFast, is_torch_available from transformers.testing_utils import ( get_tests_dir, nested_simplify, require_sentencepiece, require_token...
85
"""simple docstring""" import argparse import json import requests import timm import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import AutoImageProcessor, SwinConfig, SwinForImageClassification def lowerCAmelCase (__UpperCamelCase : Tuple ): ...
85
1
"""simple docstring""" import os import unittest from transformers.models.bartpho.tokenization_bartpho import VOCAB_FILES_NAMES, BartphoTokenizer from transformers.testing_utils import get_tests_dir from ...test_tokenization_common import TokenizerTesterMixin __lowercase = get_tests_dir('''fix...
85
"""simple docstring""" import os from pathlib import Path from unittest.mock import patch import pytest import zstandard as zstd from datasets.download.download_config import DownloadConfig from datasets.utils.file_utils import ( OfflineModeIsEnabled, cached_path, fsspec_get, fsspec_hea...
85
1
"""simple docstring""" __lowercase = 0 # The first color of the flag. __lowercase = 1 # The second color of the flag. __lowercase = 2 # The third color of the flag. __lowercase = (red, white, blue) def lowerCAmelCase (__UpperCamelCase : list ): """simpl...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available from ...utils import OptionalDependencyNotAvailable __lowercase = {'''configuration_gpt_neox''': ['''GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GPTNeoXConfi...
85
1
"""simple docstring""" import os from pathlib import Path from unittest.mock import patch import pytest import zstandard as zstd from datasets.download.download_config import DownloadConfig from datasets.utils.file_utils import ( OfflineModeIsEnabled, cached_path, fsspec_get, fsspec_hea...
85
"""simple docstring""" # Copyright 2023 The HuggingFace Inc. team. 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...
85
1
"""simple docstring""" import heapq import sys import numpy as np __lowercase = tuple[int, int] class _lowercase : """simple docstring""" def __init__( self : List[str] ) -> List[str]: '''simple docstring''' ...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available __lowercase = { '''configuration_conditional_detr''': [ '''CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''C...
85
1
"""simple docstring""" from collections import namedtuple __lowercase = namedtuple('''from_to''', '''from_ to''') __lowercase = { '''cubicmeter''': from_to(1, 1), '''litre''': from_to(0.0_01, 1_000), '''kilolitre''': from_to(1, 1), '''gallon''': from_to(0.0_04_54, 2_64.1...
85
"""simple docstring""" import json import os import shutil import tempfile import unittest from multiprocessing import get_context from pathlib import Path import datasets import numpy as np from datasets import load_dataset from parameterized import parameterized from transformers import AutoProcesso...
85
1
"""simple docstring""" # Author: OMKAR PATHAK, Nwachukwu Chidiebere # Use a Python dictionary to construct the graph. from __future__ import annotations from pprint import pformat from typing import Generic, TypeVar __lowercase = TypeVar('''T''') class _lowercase ( Generic...
85
"""simple docstring""" from __future__ import annotations from collections.abc import Iterator from typing import Any class _lowercase : """simple docstring""" def __init__( self : int , UpperCamelCase__ : Any ) -> Optional...
85
1
"""simple docstring""" from heapq import heappop, heappush import numpy as np def lowerCAmelCase (__UpperCamelCase : np.ndarray , __UpperCamelCase : tuple[int, int] , __UpperCamelCase : tuple[int, int] , __UpperCamelCase : bool , ): """simple docstring""" ...
85
"""simple docstring""" import os import time import pytest from datasets.utils.filelock import FileLock, Timeout def lowerCAmelCase (__UpperCamelCase : int ): """simple docstring""" __UpperCamelCase =FileLock(str(tmpdir / '''foo.lock''' ) ) __UpperCamelCase =F...
85
1
"""simple docstring""" import unittest from .lib import ( Matrix, Vector, axpy, square_zero_matrix, unit_basis_vector, zero_vector, ) class _lowercase ( unittest.TestCase ): """simple docstring""" def UpperCAmelCase_ (...
85
"""simple docstring""" import argparse import logging import os import datasets import tensorflow as tf from transformers import AutoTokenizer __lowercase = logging.getLogger(__name__) def lowerCAmelCase (): """simple docstring""" __UpperCamelCase =argparse.Arg...
85
1
"""simple docstring""" from typing import List, Optional, Tuple from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging from .tokenization_herbert import HerbertTokenizer __lowercase = logging.get_logger(__name__) __lowercase = {'''vocab_file''': '...
85
"""simple docstring""" import os import unittest from transformers.models.bartpho.tokenization_bartpho import VOCAB_FILES_NAMES, BartphoTokenizer from transformers.testing_utils import get_tests_dir from ...test_tokenization_common import TokenizerTesterMixin __lowercase = get_tests_dir('''fix...
85
1
"""simple docstring""" import numpy as np import torch import torch.nn as nn from transformers import CLIPConfig, CLIPVisionModelWithProjection, PreTrainedModel from ...utils import logging __lowercase = logging.get_logger(__name__) class _lowercase ( __a ): ...
85
"""simple docstring""" import json from typing import TYPE_CHECKING, List, Optional, Tuple from tokenizers import pre_tokenizers from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging if TYPE_CHECKING: from transformers.pipelines.conversational import Conversati...
85
1
"""simple docstring""" import sys import webbrowser import requests from bsa import BeautifulSoup from fake_useragent import UserAgent if __name__ == "__main__": print('''Googling.....''') __lowercase = '''https://www.google.com/search?q=''' + ''' '''.join(sys.argv[1:]) __lowercase ...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 3 , __UpperCamelCase : int = 7 , __UpperCamelCase : int = 1_0_0_0_0_0_0 ): """simple docstring""" __UpperCamelCase =0 __UpperCamelCase =1 for current_denominator in range(1 ...
85
1
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available __lowercase = { '''configuration_xlm''': ['''XLM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''XLMConfig''', '''XLMOnnxConfig'''], '''tokeni...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 1_0_0_0 ): """simple docstring""" __UpperCamelCase =-1 __UpperCamelCase =0 for a in range(1 , n // 3 ): # Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c ...
85
1
"""simple docstring""" import random from .binary_exp_mod import bin_exp_mod def lowerCAmelCase (__UpperCamelCase : Optional[Any] , __UpperCamelCase : List[Any]=1_0_0_0 ): """simple docstring""" if n < 2: return False if n % 2 == 0: re...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : str ): """simple docstring""" __UpperCamelCase =0 # if input_string is "aba" than new_input_string become "a|b|a" __UpperCamelCase ='''''' __UpperCamelCase ='''''' # append eac...
85
1
"""simple docstring""" import unittest from accelerate import debug_launcher from accelerate.test_utils import require_cpu, test_ops, test_script @require_cpu class _lowercase ( unittest.TestCase ): """simple docstring""" def UpperCAmelCase_ ( ...
85
"""simple docstring""" from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig __lowercase = { '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''', '''albert-...
85
1
"""simple docstring""" import copy import os import tempfile from unittest import TestCase from unittest.mock import patch import numpy as np import pyarrow as pa import pyarrow.parquet as pq import pytest from datasets.arrow_writer import ArrowWriter, OptimizedTypedSequence, ParquetWriter, TypedSequenc...
85
"""simple docstring""" from queue import PriorityQueue from typing import Any import numpy as np def lowerCAmelCase (__UpperCamelCase : dict , __UpperCamelCase : str , __UpperCamelCase : set , __UpperCamelCase : set , __UpperCamelCase : dict , __UpperCamelCase ...
85
1
"""simple docstring""" import argparse import logging import os from pathlib import Path from typing import Any, Dict import pytorch_lightning as pl from pytorch_lightning.utilities import rank_zero_info from transformers import ( AdamW, AutoConfig, AutoModel, AutoModelForPreTraining, ...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available __lowercase = {'''configuration_ibert''': ['''IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''IBertConfig''', '''IBertOnnxConfig''']} try: if not is_torch_...
85
1
"""simple docstring""" import itertools import json import os import unittest from transformers import AddedToken, LongformerTokenizer, LongformerTokenizerFast from transformers.models.longformer.tokenization_longformer import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, slow ...
85
"""simple docstring""" from dataclasses import dataclass from typing import Dict, Optional, Union import torch import torch.nn.functional as F from torch import nn from ..configuration_utils import ConfigMixin, register_to_config from ..utils import BaseOutput from .attention import BasicTransformerBlock ...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : list[list[int | float]] ): """simple docstring""" __UpperCamelCase =len(__UpperCamelCase ) __UpperCamelCase =len(matrix[0] ) __UpperCamelCase =min(__UpperCamelCase , __UpperCamelCase ) ...
85
"""simple docstring""" import os from pathlib import Path def lowerCAmelCase (): """simple docstring""" from torch.utils.cpp_extension import load __UpperCamelCase =Path(__UpperCamelCase ).resolve().parent.parent.parent / '''kernels''' / '''deformable_detr''' __Uppe...
85
1
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_sentencepiece_available, is_tf_available, is_tokenizers_available, is_torch_available, ) __lowercase = {'''configurat...
85
"""simple docstring""" import itertools import json import os import unittest from transformers import AddedToken, LongformerTokenizer, LongformerTokenizerFast from transformers.models.longformer.tokenization_longformer import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, slow ...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 5_0 ): """simple docstring""" __UpperCamelCase =[[0] * 3 for _ in range(length + 1 )] for row_length in range(length + 1 ): for tile_length in range(2 , 5 ): for tile...
85
"""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.utils import logging ...
85
1
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : Optional[int] ): """simple docstring""" __UpperCamelCase =len(__UpperCamelCase ) while cur > 1: # Find the maximum number in arr __UpperCamelCase =arr.index(max(arr[0:cur] ) ) ...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : Dict , __UpperCamelCase : Optional[Any] ): """simple docstring""" __UpperCamelCase =[0 for i in range(r + 1 )] # nc0 = 1 __UpperCamelCase =1 for i in range(1 , n + 1 ): ...
85
1
"""simple docstring""" import unittest from transformers import ( MODEL_FOR_CAUSAL_LM_MAPPING, TF_MODEL_FOR_CAUSAL_LM_MAPPING, TextGenerationPipeline, logging, pipeline, ) from transformers.testing_utils import ( CaptureLogger, is_pipeline_test, require_accelerate, r...
85
"""simple docstring""" import argparse import json import requests import timm import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import AutoImageProcessor, SwinConfig, SwinForImageClassification def lowerCAmelCase (__UpperCamelCase : Tuple ): ...
85
1
"""simple docstring""" import inspect import unittest from huggingface_hub import hf_hub_download from transformers import ASTConfig from transformers.testing_utils import require_torch, require_torchaudio, slow, torch_device from transformers.utils import cached_property, is_torch_available, is_torchaudio_...
85
"""simple docstring""" import os from pathlib import Path from unittest.mock import patch import pytest import zstandard as zstd from datasets.download.download_config import DownloadConfig from datasets.utils.file_utils import ( OfflineModeIsEnabled, cached_path, fsspec_get, fsspec_hea...
85
1
"""simple docstring""" import inspect import unittest import numpy as np from tests.test_modeling_common import floats_tensor from transformers import DetrConfig, MaskFormerConfig, SwinConfig, is_torch_available, is_vision_available from transformers.testing_utils import require_torch, require_torch_multi_g...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available from ...utils import OptionalDependencyNotAvailable __lowercase = {'''configuration_gpt_neox''': ['''GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GPTNeoXConfi...
85
1
"""simple docstring""" # NOTE: This file is deprecated and will be removed in a future version. # It only exists so that temporarely `from diffusers.pipelines import DiffusionPipeline` works from ...utils import deprecate from ..controlnet.multicontrolnet import MultiControlNetModel # noqa: F401 from ..controln...
85
"""simple docstring""" # Copyright 2023 The HuggingFace Inc. team. 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...
85
1
"""simple docstring""" from math import sqrt import numpy as np from sympy import symbols # Coefficient # Speed of light (m/s) __lowercase = 299_792_458 # Symbols __lowercase , __lowercase , __lowercase , __lowercase = symbols('''ct x y z''') def lowerCAmelCase (__UpperCamelCas...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available __lowercase = { '''configuration_conditional_detr''': [ '''CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''C...
85
1
"""simple docstring""" from maths.prime_factors import prime_factors def lowerCAmelCase (__UpperCamelCase : int ): """simple docstring""" if not isinstance(__UpperCamelCase , __UpperCamelCase ): __UpperCamelCase =F"""Input value of [number={number}] must be an ...
85
"""simple docstring""" import json import os import shutil import tempfile import unittest from multiprocessing import get_context from pathlib import Path import datasets import numpy as np from datasets import load_dataset from parameterized import parameterized from transformers import AutoProcesso...
85
1
"""simple docstring""" from __future__ import annotations from collections import namedtuple from dataclasses import dataclass @dataclass class _lowercase : """simple docstring""" lowercase__ = 42 lowercase__ = None lowercase__ = ...
85
"""simple docstring""" from __future__ import annotations from collections.abc import Iterator from typing import Any class _lowercase : """simple docstring""" def __init__( self : int , UpperCamelCase__ : Any ) -> Optional...
85
1
"""simple docstring""" from typing import List, Optional, Union from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy from ...utils import TensorType class _lowercase ( __a ...
85
"""simple docstring""" import os import time import pytest from datasets.utils.filelock import FileLock, Timeout def lowerCAmelCase (__UpperCamelCase : int ): """simple docstring""" __UpperCamelCase =FileLock(str(tmpdir / '''foo.lock''' ) ) __UpperCamelCase =F...
85
1
"""simple docstring""" 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 ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_fea...
85
"""simple docstring""" import argparse import logging import os import datasets import tensorflow as tf from transformers import AutoTokenizer __lowercase = logging.getLogger(__name__) def lowerCAmelCase (): """simple docstring""" __UpperCamelCase =argparse.Arg...
85
1
"""simple docstring""" import inspect import unittest from datasets import load_dataset from packaging import version from transformers import BeitConfig from transformers.models.auto import get_values from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torc...
85
"""simple docstring""" import os import unittest from transformers.models.bartpho.tokenization_bartpho import VOCAB_FILES_NAMES, BartphoTokenizer from transformers.testing_utils import get_tests_dir from ...test_tokenization_common import TokenizerTesterMixin __lowercase = get_tests_dir('''fix...
85
1
"""simple docstring""" import tempfile import torch from diffusers import ( DEISMultistepScheduler, DPMSolverMultistepScheduler, DPMSolverSinglestepScheduler, UniPCMultistepScheduler, ) from .test_schedulers import SchedulerCommonTest class _lowercase ( __a ):...
85
"""simple docstring""" import json from typing import TYPE_CHECKING, List, Optional, Tuple from tokenizers import pre_tokenizers from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging if TYPE_CHECKING: from transformers.pipelines.conversational import Conversati...
85
1
"""simple docstring""" from collections import deque from .hash_table import HashTable class _lowercase ( __a ): """simple docstring""" def __init__( self : Dict , *UpperCamelCase__ : str , **UpperCamelCase__ : Any ) ...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 3 , __UpperCamelCase : int = 7 , __UpperCamelCase : int = 1_0_0_0_0_0_0 ): """simple docstring""" __UpperCamelCase =0 __UpperCamelCase =1 for current_denominator in range(1 ...
85
1
"""simple docstring""" import copy from ...configuration_utils import PretrainedConfig from ...utils import logging from ..auto.configuration_auto import CONFIG_MAPPING __lowercase = logging.get_logger(__name__) class _lowercase ( __a ): """simple docstring...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : int = 1_0_0_0 ): """simple docstring""" __UpperCamelCase =-1 __UpperCamelCase =0 for a in range(1 , n // 3 ): # Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c ...
85
1
"""simple docstring""" import shutil import tempfile import unittest import numpy as np import pytest from transformers import is_speech_available, is_vision_available from transformers.testing_utils import require_torch if is_vision_available(): from transformers import TvltImageProcessor if ...
85
"""simple docstring""" def lowerCAmelCase (__UpperCamelCase : str ): """simple docstring""" __UpperCamelCase =0 # if input_string is "aba" than new_input_string become "a|b|a" __UpperCamelCase ='''''' __UpperCamelCase ='''''' # append eac...
85
1
"""simple docstring""" import warnings from functools import wraps from typing import Callable def lowerCAmelCase (__UpperCamelCase : Callable ): """simple docstring""" @wraps(__UpperCamelCase ) def _inner_fn(*__UpperCamelCase : Any , **__UpperCamelCase : List[Any...
85
"""simple docstring""" from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig __lowercase = { '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''', '''albert-...
85
1
"""simple docstring""" import argparse import collections import json import os import re import string import sys import numpy as np __lowercase = re.compile(r'''\b(a|an|the)\b''', re.UNICODE) __lowercase = None def lowerCAmelCase (): """simple docstring""" ...
85
"""simple docstring""" from queue import PriorityQueue from typing import Any import numpy as np def lowerCAmelCase (__UpperCamelCase : dict , __UpperCamelCase : str , __UpperCamelCase : set , __UpperCamelCase : set , __UpperCamelCase : dict , __UpperCamelCase ...
85
1
"""simple docstring""" import os import unicodedata from shutil import copyfile from typing import Any, Dict, List, Optional, Tuple import sentencepiece as spm from ...tokenization_utils import AddedToken, PreTrainedTokenizer from ...utils import SPIECE_UNDERLINE, logging __lowercase = loggi...
85
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available __lowercase = {'''configuration_ibert''': ['''IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''IBertConfig''', '''IBertOnnxConfig''']} try: if not is_torch_...
85
1