code
stringlengths
87
55.2k
code_codestyle
int64
0
349
style_context
stringlengths
135
49.1k
style_context_codestyle
int64
0
349
label
int64
0
1
from ...configuration_utils import PretrainedConfig class A ( UpperCAmelCase__ ): '''simple docstring''' A__ = '''bert-generation''' def __init__(self : Dict , _UpperCAmelCase : Optional[int]=5_0358 , _UpperCAmelCase ...
305
def UpperCamelCase ( __magic_name__ : str ) -> list: """simple docstring""" if n_term == "": return [] lowercase__ = [] for temp in range(int(__magic_name__ ) ): series.append(f'''1/{temp + 1}''' if series else """1""" ) return series ...
305
1
def UpperCamelCase ( __magic_name__ : int = 10 , __magic_name__ : int = 1000 , __magic_name__ : bool = True ) -> int: """simple docstring""" assert ( isinstance(__magic_name__ , __magic_name__ ) and isinstance(__magic_name...
305
import gc import random import unittest import numpy as np import torch from transformers import CLIPImageProcessor, CLIPVisionConfig, CLIPVisionModel from diffusers import HeunDiscreteScheduler, PriorTransformer, ShapEImgaImgPipeline from diffusers.pipelines.shap_e import ShapERenderer from diffusers...
305
1
import itertools import math def UpperCamelCase ( __magic_name__ : int ) -> bool: """simple docstring""" if 1 < number < 4: # 2 and 3 are primes return True elif number < 2 or number % 2 == 0 or number % 3 == 0: # Negatives, 0, 1, all even number...
305
import requests from bsa import BeautifulSoup def UpperCamelCase ( __magic_name__ : str = "AAPL" ) -> str: """simple docstring""" lowercase__ = f'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}''' lowercase__ = BeautifulSoup(requests.ge...
305
1
import os import tempfile import unittest from transformers import NezhaConfig, is_torch_available from transformers.models.auto import get_values from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device from ...generation.test_utils import GenerationTesterMixin from ...
305
from ...configuration_utils import PretrainedConfig from ...utils import logging A : List[str] = logging.get_logger(__name__) A : Any = { 'tiiuae/falcon-40b': 'https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json', 'tiiuae/falcon-7b': 'https://huggingface.co...
305
1
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, torch_device from trans...
305
import json import os import shutil import tempfile import unittest import numpy as np import pytest from transformers import BertTokenizer, BertTokenizerFast from transformers.models.bert.tokenization_bert import VOCAB_FILES_NAMES from transformers.testing_utils import require_vision from transform...
305
1
import numpy as np import torch from torch.utils.data import Dataset from utils import logger class A ( UpperCAmelCase__ ): '''simple docstring''' def __init__(self : Optional[int] , _UpperCAmelCase : str , _UpperCAmelCase...
305
import unittest from transformers.testing_utils import CaptureStdout from transformers.tools.python_interpreter import evaluate def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" return x + 2 class A...
305
1
import inspect import os import unittest from pathlib import Path import torch import accelerate from accelerate.test_utils import execute_subprocess_async from accelerate.test_utils.testing import run_command class A ( unittest.TestCase ): '''simple docstring''' ...
305
class A : '''simple docstring''' def __init__(self : List[str] ) -> Tuple: """simple docstring""" lowercase__ = 0 lowercase__ = 0 lowercase__ = {} def lowerCamelCase__ (self : ...
305
1
from typing import Dict, List, Optional, Tuple, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import ( center_crop, get_resize_output_image_size, normalize, rescale, resize, to_channel_di...
305
def UpperCamelCase ( __magic_name__ : int , __magic_name__ : int ) -> int: """simple docstring""" return int((input_a, input_a).count(1 ) != 0 ) def UpperCamelCase ( ) -> None: """simple docstring""" assert or_gate(0 ...
305
1
from ...configuration_utils import PretrainedConfig from ...utils import logging A : Dict = logging.get_logger(__name__) A : Optional[Any] = { 'microsoft/trocr-base-handwritten': ( 'https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json' ...
305
import argparse from torch import nn # transformers_old should correspond to branch `save_old_prophetnet_model_structure` here # original prophetnet_checkpoints are saved under `patrickvonplaten/..._old` respectively from transformers_old.modeling_prophetnet import ( ProphetNetForConditionalGeneratio...
305
1
from sklearn.metrics import matthews_corrcoef import datasets A : Dict = '\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 classifications. It takes\ninto account true ...
305
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from .tokenization_gpta import GPTaTokenizer class A ( tf.keras.layers.Layer ): '''simple docstring''' ...
305
1
import os import zipfile import pytest from datasets.utils.extract import ( BzipaExtractor, Extractor, GzipExtractor, LzaExtractor, SevenZipExtractor, TarExtractor, XzExtractor, ZipExtractor, ZstdExtractor, ) from .utils import require_lza, require_pyazr, re...
305
from __future__ import annotations from functools import lru_cache from math import ceil A : Optional[int] = 1_0_0 A : int = set(range(3, NUM_PRIMES, 2)) primes.add(2) A : int for prime in range(3, ceil(NUM_PRIMES**0.5), 2): if prime not in primes: continue pri...
305
1
from collections.abc import Callable import numpy as np def UpperCamelCase ( __magic_name__ : Callable , __magic_name__ : float , __magic_name__ : float , __magic_name__ : float , __magic_name__ : float ) -> np.a...
305
def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" lowercase__ = [0] * len(__magic_name__ ) lowercase__ = [] lowercase__ = [1] * len(__magic_name__ ) for values in graph.values(): for i in v...
305
1
import pandas as pd from matplotlib import pyplot as plt from sklearn.linear_model import LinearRegression # Splitting the dataset into the Training set and Test set from sklearn.model_selection import train_test_split # Fitting Polynomial Regression to the dataset from sklearn.preprocessing import Poly...
305
# Copyright 2023 The HuggingFace 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-2.0 # # Unless require...
305
1
import warnings 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 A ( UpperCAmelCase__ ...
305
def UpperCamelCase ( __magic_name__ : str ) -> int: """simple docstring""" assert column_title.isupper() lowercase__ = 0 lowercase__ = len(__magic_name__ ) - 1 lowercase__ = 0 while index >= 0: lowercase__ = (ord(column_tit...
305
1
def UpperCamelCase ( __magic_name__ : Optional[int] , __magic_name__ : int , __magic_name__ : Any , __magic_name__ : Optional[int] ) -> str: """simple docstring""" lowercase__ = [False] * len(__magic_name__ ) lowerc...
305
import numpy as np import pandas as pd from sklearn.preprocessing import Normalizer from sklearn.svm import SVR from statsmodels.tsa.statespace.sarimax import SARIMAX def UpperCamelCase ( __magic_name__ : list , __magic_name__ : list , __magic_name__ : ...
305
1
import warnings 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 A ( UpperCAmelCase__ ...
305
import os import textwrap import pyarrow as pa import pytest from datasets import ClassLabel, Features, Image from datasets.packaged_modules.csv.csv import Csv from ..utils import require_pil @pytest.fixture def UpperCamelCase ( __magic_name__ : Optional[Any] ) -> L...
305
1
# Lint as: python3 import sys from collections.abc import Mapping from typing import TYPE_CHECKING import numpy as np import pyarrow as pa from .. import config from ..utils.py_utils import map_nested from .formatting import TensorFormatter if TYPE_CHECKING: import torch class A ...
305
from typing import TYPE_CHECKING from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available, is_vision_available from ...utils import OptionalDependencyNotAvailable A : int = {'configuration_dpt': ['DPT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DPTConfig']} try: if not is_...
305
1
from sympy import diff, lambdify, symbols from sympy.functions import * # noqa: F403 def UpperCamelCase ( __magic_name__ : str , __magic_name__ : complex , __magic_name__ : str = "x" , __magic_name__ : float = 10**-10 , __magic_na...
305
from __future__ import annotations def UpperCamelCase ( __magic_name__ : list[float] , __magic_name__ : list[float] ) -> float: """simple docstring""" lowercase__ = sorted(numsa + numsa ) lowercase__ , lowercase__ = divmod(l...
305
1
import argparse from transformers import TaConfig, TaForConditionalGeneration, load_tf_weights_in_ta from transformers.utils import logging logging.set_verbosity_info() def UpperCamelCase ( __magic_name__ : Optional[Any] , __magic_name__ : List[Any] , __m...
305
A : Union[str, Any] = {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []} A : List[Any] = {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]} def UpperCamelCase ( __magic_name__ : dict[int, list[int]] , __magic_name__ : int , __magic_name__ ...
305
1
import warnings from ...utils import logging from .image_processing_beit import BeitImageProcessor A : Union[str, Any] = logging.get_logger(__name__) class A ( UpperCAmelCase__ ): '''simple docstring''' def __init__(self : int ...
305
import gc import random import tempfile import unittest import numpy as np import torch from PIL import Image from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMInverseScheduler, DDIMScheduler, DPMSolverMultistepInverseS...
305
1
import inspect import unittest from transformers import YolosConfig 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_configuration_common import ConfigTester from ...
305
from __future__ import annotations import math def UpperCamelCase ( __magic_name__ : list , __magic_name__ : list ) -> list: """simple docstring""" if len(__magic_name__ ) != 2 or len(a[0] ) != 2 or len(__magic_name__ ) != 2 or len(b[...
305
1
import argparse import os import re import torch from flax.traverse_util import flatten_dict from tax import checkpoints from transformers import ( AutoTokenizer, PixaStructConfig, PixaStructForConditionalGeneration, PixaStructImageProcessor, PixaStructProcessor, PixaStruct...
305
import unittest import numpy as np from transformers import BertConfig, is_flax_available from transformers.testing_utils import require_flax, slow from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask if is_flax_available(): from transfor...
305
1
import unittest from transformers.testing_utils import CaptureStdout from transformers.tools.python_interpreter import evaluate def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" return x + 2 class A...
305
def UpperCamelCase ( __magic_name__ : str ) -> list: """simple docstring""" if n_term == "": return [] lowercase__ = [] for temp in range(int(__magic_name__ ) ): series.append(f'''1/{temp + 1}''' if series else """1""" ) return series ...
305
1
import logging import math from functools import partial from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Union import torch from .tensor_utils import tensor_tree_map, tree_map def UpperCamelCase ( __magic_name__ : Union[dict, list, tuple, tor...
305
import gc import random import unittest import numpy as np import torch from transformers import CLIPImageProcessor, CLIPVisionConfig, CLIPVisionModel from diffusers import HeunDiscreteScheduler, PriorTransformer, ShapEImgaImgPipeline from diffusers.pipelines.shap_e import ShapERenderer from diffusers...
305
1
def UpperCamelCase ( __magic_name__ : str ) -> int: """simple docstring""" assert column_title.isupper() lowercase__ = 0 lowercase__ = len(__magic_name__ ) - 1 lowercase__ = 0 while index >= 0: lowercase__ = (ord(column_tit...
305
import requests from bsa import BeautifulSoup def UpperCamelCase ( __magic_name__ : str = "AAPL" ) -> str: """simple docstring""" lowercase__ = f'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}''' lowercase__ = BeautifulSoup(requests.ge...
305
1
import io import itertools import json from dataclasses import dataclass from typing import Optional import pyarrow as pa import pyarrow.json as paj import datasets from datasets.table import table_cast from datasets.utils.file_utils import readline A : str = datasets.utils.logging.g...
305
from ...configuration_utils import PretrainedConfig from ...utils import logging A : List[str] = logging.get_logger(__name__) A : Any = { 'tiiuae/falcon-40b': 'https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json', 'tiiuae/falcon-7b': 'https://huggingface.co...
305
1
import argparse import json import os import pickle import shutil import numpy as np import torch from distiller import Distiller from lm_seqs_dataset import LmSeqsDataset from transformers import ( BertConfig, BertForMaskedLM, BertTokenizer, DistilBertConfig, DistilBertForMa...
305
import json import os import shutil import tempfile import unittest import numpy as np import pytest from transformers import BertTokenizer, BertTokenizerFast from transformers.models.bert.tokenization_bert import VOCAB_FILES_NAMES from transformers.testing_utils import require_vision from transform...
305
1
from __future__ import annotations import numpy as np def UpperCamelCase ( __magic_name__ : np.ndarray ) -> tuple[np.ndarray, np.ndarray]: """simple docstring""" lowercase__ , lowercase__ = np.shape(__magic_name__ ) if rows != columns: lowe...
305
import unittest from transformers.testing_utils import CaptureStdout from transformers.tools.python_interpreter import evaluate def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" return x + 2 class A...
305
1
from collections.abc import Generator from math import sin def UpperCamelCase ( __magic_name__ : bytes ) -> bytes: """simple docstring""" if len(__magic_name__ ) != 32: raise ValueError("""Input must be of length 32""" ) lowercase__ = B""...
305
class A : '''simple docstring''' def __init__(self : List[str] ) -> Tuple: """simple docstring""" lowercase__ = 0 lowercase__ = 0 lowercase__ = {} def lowerCamelCase__ (self : ...
305
1
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 A : Optional[Any] = logging.get_logger(__name__) A : int = { 'g...
305
def UpperCamelCase ( __magic_name__ : int , __magic_name__ : int ) -> int: """simple docstring""" return int((input_a, input_a).count(1 ) != 0 ) def UpperCamelCase ( ) -> None: """simple docstring""" assert or_gate(0 ...
305
1
A : Union[str, Any] = {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []} A : List[Any] = {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]} def UpperCamelCase ( __magic_name__ : dict[int, list[int]] , __magic_name__ : int , __magic_name__ ...
305
import argparse from torch import nn # transformers_old should correspond to branch `save_old_prophetnet_model_structure` here # original prophetnet_checkpoints are saved under `patrickvonplaten/..._old` respectively from transformers_old.modeling_prophetnet import ( ProphetNetForConditionalGeneratio...
305
1
import json import os import shutil import tempfile import unittest import numpy as np import pytest from transformers import BertTokenizer, BertTokenizerFast from transformers.models.bert.tokenization_bert import VOCAB_FILES_NAMES from transformers.testing_utils import require_vision from transform...
305
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from .tokenization_gpta import GPTaTokenizer class A ( tf.keras.layers.Layer ): '''simple docstring''' ...
305
1
from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_torch_available, is_vision_available, ) A : Optional[Any] = {'configuration_beit': ['BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'BeitConfig', 'BeitOnnx...
305
from __future__ import annotations from functools import lru_cache from math import ceil A : Optional[int] = 1_0_0 A : int = set(range(3, NUM_PRIMES, 2)) primes.add(2) A : int for prime in range(3, ceil(NUM_PRIMES**0.5), 2): if prime not in primes: continue pri...
305
1
import math from ...configuration_utils import PretrainedConfig from ...utils import logging A : Any = logging.get_logger(__name__) A : List[Any] = { 'facebook/data2vec-base-960h': 'https://huggingface.co/facebook/data2vec-audio-base-960h/resolve/main/config.json', # ...
305
def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" lowercase__ = [0] * len(__magic_name__ ) lowercase__ = [] lowercase__ = [1] * len(__magic_name__ ) for values in graph.values(): for i in v...
305
1
from ...utils import is_torch_available, is_transformers_available if is_transformers_available() and is_torch_available(): from .pipeline_vq_diffusion import LearnedClassifierFreeSamplingEmbeddings, VQDiffusionPipeline
305
# Copyright 2023 The HuggingFace 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-2.0 # # Unless require...
305
1
from ...configuration_utils import PretrainedConfig from ...utils import logging A : List[str] = logging.get_logger(__name__) A : Any = { 'tiiuae/falcon-40b': 'https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json', 'tiiuae/falcon-7b': 'https://huggingface.co...
305
def UpperCamelCase ( __magic_name__ : str ) -> int: """simple docstring""" assert column_title.isupper() lowercase__ = 0 lowercase__ = len(__magic_name__ ) - 1 lowercase__ = 0 while index >= 0: lowercase__ = (ord(column_tit...
305
1
from math import factorial A : dict[str, int] = {str(digit): factorial(digit) for digit in range(1_0)} def UpperCamelCase ( __magic_name__ : int ) -> int: """simple docstring""" if not isinstance(__magic_name__ , __magic_name__ ): rais...
305
import numpy as np import pandas as pd from sklearn.preprocessing import Normalizer from sklearn.svm import SVR from statsmodels.tsa.statespace.sarimax import SARIMAX def UpperCamelCase ( __magic_name__ : list , __magic_name__ : list , __magic_name__ : ...
305
1
# flake8: noqa # Lint as: python3 from typing import Dict, List, Optional, Type from .. import config from ..utils import logging from .formatting import ( ArrowFormatter, CustomFormatter, Formatter, PandasFormatter, PythonFormatter, TensorFormatter, format_table, ...
305
import os import textwrap import pyarrow as pa import pytest from datasets import ClassLabel, Features, Image from datasets.packaged_modules.csv.csv import Csv from ..utils import require_pil @pytest.fixture def UpperCamelCase ( __magic_name__ : Optional[Any] ) -> L...
305
1
def UpperCamelCase ( __magic_name__ : Any ) -> Union[str, Any]: """simple docstring""" lowercase__ = [] lowercase__ = set({"""(""", """[""", """{"""} ) lowercase__ = set({""")""", """]""", """}"""} ) lowercase__ = {"""{""": """}"...
305
from typing import TYPE_CHECKING from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available, is_vision_available from ...utils import OptionalDependencyNotAvailable A : int = {'configuration_dpt': ['DPT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DPTConfig']} try: if not is_...
305
1
from typing import Dict, Optional import numpy as np import datasets A : Optional[Any] = '\nIoU is the area of overlap between the predicted segmentation and the ground truth divided by the area of union\nbetween the predicted segmentation and the ground truth. For binary (two classes) or m...
305
from __future__ import annotations def UpperCamelCase ( __magic_name__ : list[float] , __magic_name__ : list[float] ) -> float: """simple docstring""" lowercase__ = sorted(numsa + numsa ) lowercase__ , lowercase__ = divmod(l...
305
1
from typing import List, Optional, Tuple from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging from .tokenization_herbert import HerbertTokenizer A : Any = logging.get_logger(__name__) A : Any = {'vocab_file': 'vocab.json', 'merges_file': ...
305
A : Union[str, Any] = {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []} A : List[Any] = {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]} def UpperCamelCase ( __magic_name__ : dict[int, list[int]] , __magic_name__ : int , __magic_name__ ...
305
1
import os import sys import warnings from dataclasses import dataclass, field from io import BytesIO from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Union import numpy as np import pyarrow as pa from .. import config from ..download.streaming_download_manager import xopen from...
305
import gc import random import tempfile import unittest import numpy as np import torch from PIL import Image from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMInverseScheduler, DDIMScheduler, DPMSolverMultistepInverseS...
305
1
import gc import random import tempfile import unittest import numpy as np import torch from PIL import Image from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMInverseScheduler, DDIMScheduler, DPMSolverMultistepInverseS...
305
from __future__ import annotations import math def UpperCamelCase ( __magic_name__ : list , __magic_name__ : list ) -> list: """simple docstring""" if len(__magic_name__ ) != 2 or len(a[0] ) != 2 or len(__magic_name__ ) != 2 or len(b[...
305
1
import json import os from pathlib import Path from shutil import copyfile from typing import Any, Dict, List, Optional, Tuple, Union import sentencepiece from ...tokenization_utils import PreTrainedTokenizer from ...utils import logging A : str = logging.get_logger(__name__) A ...
305
import unittest import numpy as np from transformers import BertConfig, is_flax_available from transformers.testing_utils import require_flax, slow from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask if is_flax_available(): from transfor...
305
1
def UpperCamelCase ( __magic_name__ : Dict , __magic_name__ : Dict ) -> Any: """simple docstring""" lowercase__ = [0 for i in range(r + 1 )] # nc0 = 1 lowercase__ = 1 for i in range(1 , n + 1 ): # to compute current ro...
305
def UpperCamelCase ( __magic_name__ : str ) -> list: """simple docstring""" if n_term == "": return [] lowercase__ = [] for temp in range(int(__magic_name__ ) ): series.append(f'''1/{temp + 1}''' if series else """1""" ) return series ...
305
1
def UpperCamelCase ( __magic_name__ : int ) -> int: """simple docstring""" if not isinstance(__magic_name__ , __magic_name__ ): raise TypeError("""Input value must be an 'int' type""" ) lowercase__ = 0 while number: position += 1 num...
305
import gc import random import unittest import numpy as np import torch from transformers import CLIPImageProcessor, CLIPVisionConfig, CLIPVisionModel from diffusers import HeunDiscreteScheduler, PriorTransformer, ShapEImgaImgPipeline from diffusers.pipelines.shap_e import ShapERenderer from diffusers...
305
1
from ...configuration_utils import PretrainedConfig from ...utils import logging A : Dict = logging.get_logger(__name__) A : str = { 'weiweishi/roc-bert-base-zh': 'https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/config.json', } class A ( ...
305
import requests from bsa import BeautifulSoup def UpperCamelCase ( __magic_name__ : str = "AAPL" ) -> str: """simple docstring""" lowercase__ = f'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}''' lowercase__ = BeautifulSoup(requests.ge...
305
1
from math import pi, sqrt, tan def UpperCamelCase ( __magic_name__ : float ) -> float: """simple docstring""" if side_length < 0: raise ValueError("""surface_area_cube() only accepts non-negative values""" ) return 6 * side_length**2 def U...
305
from ...configuration_utils import PretrainedConfig from ...utils import logging A : List[str] = logging.get_logger(__name__) A : Any = { 'tiiuae/falcon-40b': 'https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json', 'tiiuae/falcon-7b': 'https://huggingface.co...
305
1
import argparse import torch from transformers import ( UniSpeechSatConfig, UniSpeechSatForAudioFrameClassification, UniSpeechSatForSequenceClassification, UniSpeechSatForXVector, WavaVecaFeatureExtractor, logging, ) logging.set_verbosity_info() A : List[str] =...
305
import json import os import shutil import tempfile import unittest import numpy as np import pytest from transformers import BertTokenizer, BertTokenizerFast from transformers.models.bert.tokenization_bert import VOCAB_FILES_NAMES from transformers.testing_utils import require_vision from transform...
305
1
import logging from dataclasses import dataclass, field from pathlib import Path from typing import Optional, Union from .generation.configuration_utils import GenerationConfig from .training_args import TrainingArguments from .utils import add_start_docstrings A : List[str] = logging.get...
305
import unittest from transformers.testing_utils import CaptureStdout from transformers.tools.python_interpreter import evaluate def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" return x + 2 class A...
305
1
import faiss # noqa: F401 # Here to have a nice missing dependency error message early on import numpy # noqa: F401 # Here to have a nice missing dependency error message early on import requests # noqa: F401 # Here to have a nice missing dependency error message early on import sklearn # noqa: F401 # Here...
305
class A : '''simple docstring''' def __init__(self : List[str] ) -> Tuple: """simple docstring""" lowercase__ = 0 lowercase__ = 0 lowercase__ = {} def lowerCamelCase__ (self : ...
305
1
import os import unittest from transformers.models.cpmant.tokenization_cpmant import VOCAB_FILES_NAMES, CpmAntTokenizer from transformers.testing_utils import require_jieba, tooslow from ...test_tokenization_common import TokenizerTesterMixin @require_jieba class A ( UpperCAmelCase...
305
def UpperCamelCase ( __magic_name__ : int , __magic_name__ : int ) -> int: """simple docstring""" return int((input_a, input_a).count(1 ) != 0 ) def UpperCamelCase ( ) -> None: """simple docstring""" assert or_gate(0 ...
305
1
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 A : Any = logging.get_logger(__name__) A ...
305
import argparse from torch import nn # transformers_old should correspond to branch `save_old_prophetnet_model_structure` here # original prophetnet_checkpoints are saved under `patrickvonplaten/..._old` respectively from transformers_old.modeling_prophetnet import ( ProphetNetForConditionalGeneratio...
305
1
from __future__ import annotations import unittest from transformers import EsmConfig, is_tf_available from transformers.testing_utils import require_tf, slow from ...test_configuration_common import ConfigTester from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor, rand...
305
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from .tokenization_gpta import GPTaTokenizer class A ( tf.keras.layers.Layer ): '''simple docstring''' ...
305
1
def UpperCamelCase ( __magic_name__ : int , __magic_name__ : int ) -> int: """simple docstring""" return int((input_a, input_a).count(1 ) != 0 ) def UpperCamelCase ( ) -> None: """simple docstring""" assert or_gate(0 ...
305
from __future__ import annotations from functools import lru_cache from math import ceil A : Optional[int] = 1_0_0 A : int = set(range(3, NUM_PRIMES, 2)) primes.add(2) A : int for prime in range(3, ceil(NUM_PRIMES**0.5), 2): if prime not in primes: continue pri...
305
1
from __future__ import annotations import collections import pprint from pathlib import Path def UpperCamelCase ( __magic_name__ : str ) -> str: """simple docstring""" return "".join(sorted(__magic_name__ ) ) def UpperCamelCase ( __ma...
305
def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" lowercase__ = [0] * len(__magic_name__ ) lowercase__ = [] lowercase__ = [1] * len(__magic_name__ ) for values in graph.values(): for i in v...
305
1
# Copyright 2023 The HuggingFace 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-2.0 # # Unless require...
305
# Copyright 2023 The HuggingFace 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-2.0 # # Unless require...
305
1
import logging import torch from accelerate import Accelerator from arguments import EvaluationArguments from datasets import load_dataset from torch.utils.data import IterableDataset from torch.utils.data.dataloader import DataLoader from transformers import AutoModelForCausalLM, AutoTokenizer, HfArgu...
305
def UpperCamelCase ( __magic_name__ : str ) -> int: """simple docstring""" assert column_title.isupper() lowercase__ = 0 lowercase__ = len(__magic_name__ ) - 1 lowercase__ = 0 while index >= 0: lowercase__ = (ord(column_tit...
305
1
from collections import OrderedDict from typing import Any, Mapping, Optional from ... import PreTrainedTokenizer from ...configuration_utils import PretrainedConfig from ...file_utils import TensorType, is_torch_available from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeqaSeqConfigWithPast from ...
305
import numpy as np import pandas as pd from sklearn.preprocessing import Normalizer from sklearn.svm import SVR from statsmodels.tsa.statespace.sarimax import SARIMAX def UpperCamelCase ( __magic_name__ : list , __magic_name__ : list , __magic_name__ : ...
305
1
import gc import importlib.metadata import tempfile import unittest from packaging import version from transformers import ( AutoModel, AutoModelForCausalLM, AutoModelForSeqaSeqLM, AutoModelForSequenceClassification, AutoTokenizer, BitsAndBytesConfig, pipeline, ) from...
305
import os import textwrap import pyarrow as pa import pytest from datasets import ClassLabel, Features, Image from datasets.packaged_modules.csv.csv import Csv from ..utils import require_pil @pytest.fixture def UpperCamelCase ( __magic_name__ : Optional[Any] ) -> L...
305
1
import argparse import os import torch from transformers import FlavaImageCodebook, FlavaImageCodebookConfig def UpperCamelCase ( __magic_name__ : List[str] , __magic_name__ : Tuple , __magic_name__ : Union[str, Any] , __magic_name__ : ...
305
from typing import TYPE_CHECKING from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available, is_vision_available from ...utils import OptionalDependencyNotAvailable A : int = {'configuration_dpt': ['DPT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DPTConfig']} try: if not is_...
305
1
import gc import random import unittest import numpy as np import torch from transformers import CLIPImageProcessor, CLIPVisionConfig, CLIPVisionModel from diffusers import HeunDiscreteScheduler, PriorTransformer, ShapEImgaImgPipeline from diffusers.pipelines.shap_e import ShapERenderer from diffusers...
305
from __future__ import annotations def UpperCamelCase ( __magic_name__ : list[float] , __magic_name__ : list[float] ) -> float: """simple docstring""" lowercase__ = sorted(numsa + numsa ) lowercase__ , lowercase__ = divmod(l...
305
1
import unittest from pathlib import Path from tempfile import TemporaryDirectory from transformers import AutoConfig, TFAutoModel, is_tensorflow_text_available, is_tf_available from transformers.models.bert.tokenization_bert import BertTokenizer from transformers.testing_utils import require_tensorflow_tex...
305
A : Union[str, Any] = {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []} A : List[Any] = {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]} def UpperCamelCase ( __magic_name__ : dict[int, list[int]] , __magic_name__ : int , __magic_name__ ...
305
1
from __future__ import annotations A : Any = '#' class A : '''simple docstring''' def __init__(self : int ) -> None: """simple docstring""" lowercase__ = {} def lowerCamelCase__ (self : ...
305
import gc import random import tempfile import unittest import numpy as np import torch from PIL import Image from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMInverseScheduler, DDIMScheduler, DPMSolverMultistepInverseS...
305
1
from math import isqrt def UpperCamelCase ( __magic_name__ : int ) -> list[int]: """simple docstring""" lowercase__ = [True] * max_number for i in range(2 , isqrt(max_number - 1 ) + 1 ): if is_prime[i]: for j in range(i**2 , ...
305
from __future__ import annotations import math def UpperCamelCase ( __magic_name__ : list , __magic_name__ : list ) -> list: """simple docstring""" if len(__magic_name__ ) != 2 or len(a[0] ) != 2 or len(__magic_name__ ) != 2 or len(b[...
305
1
import gc import random import unittest import numpy as np import torch from PIL import Image from diffusers import ( DDIMScheduler, KandinskyVaaInpaintPipeline, KandinskyVaaPriorPipeline, UNetaDConditionModel, VQModel, ) from diffusers.utils import floats_tensor, load_image, ...
305
import unittest import numpy as np from transformers import BertConfig, is_flax_available from transformers.testing_utils import require_flax, slow from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask if is_flax_available(): from transfor...
305
1
import os import time from dataclasses import dataclass, field from enum import Enum from typing import Dict, List, Optional, Union import torch from filelock import FileLock from torch.utils.data import Dataset from ...models.auto.modeling_auto import MODEL_FOR_QUESTION_ANSWERING_MAPPING from ...tok...
305
def UpperCamelCase ( __magic_name__ : str ) -> list: """simple docstring""" if n_term == "": return [] lowercase__ = [] for temp in range(int(__magic_name__ ) ): series.append(f'''1/{temp + 1}''' if series else """1""" ) return series ...
305
1
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, get_resize_output_image_size, normalize, rescale, resize, to_channel_dimension...
305
import gc import random import unittest import numpy as np import torch from transformers import CLIPImageProcessor, CLIPVisionConfig, CLIPVisionModel from diffusers import HeunDiscreteScheduler, PriorTransformer, ShapEImgaImgPipeline from diffusers.pipelines.shap_e import ShapERenderer from diffusers...
305
1
import argparse import json import os import tensorstore as ts import torch from flax import serialization from flax.traverse_util import flatten_dict, unflatten_dict from tensorflow.io import gfile from transformers.modeling_utils import dtype_byte_size from transformers.models.switch_transformers.c...
305
import requests from bsa import BeautifulSoup def UpperCamelCase ( __magic_name__ : str = "AAPL" ) -> str: """simple docstring""" lowercase__ = f'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}''' lowercase__ = BeautifulSoup(requests.ge...
305
1
from collections.abc import Callable class A : '''simple docstring''' def __init__(self : List[str] , _UpperCAmelCase : Callable | None = None ) -> None: """simple docstring""" lowercase__ = [] # ...
305
from ...configuration_utils import PretrainedConfig from ...utils import logging A : List[str] = logging.get_logger(__name__) A : Any = { 'tiiuae/falcon-40b': 'https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json', 'tiiuae/falcon-7b': 'https://huggingface.co...
305
1
import argparse import torch from transformers import ( SpeechTaConfig, SpeechTaFeatureExtractor, SpeechTaForSpeechToSpeech, SpeechTaForSpeechToText, SpeechTaForTextToSpeech, SpeechTaProcessor, SpeechTaTokenizer, logging, ) from transformers.tokenization_utils impor...
305
import json import os import shutil import tempfile import unittest import numpy as np import pytest from transformers import BertTokenizer, BertTokenizerFast from transformers.models.bert.tokenization_bert import VOCAB_FILES_NAMES from transformers.testing_utils import require_vision from transform...
305
1
from __future__ import annotations A : Optional[Any] = 1.6_0_2_1e-1_9 # units = C def UpperCamelCase ( __magic_name__ : float , __magic_name__ : float , __magic_name__ : float , ) -> tuple[str, float]: """simple docstring""" ...
305
import unittest from transformers.testing_utils import CaptureStdout from transformers.tools.python_interpreter import evaluate def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" return x + 2 class A...
305
1
import argparse from collections import defaultdict import yaml A : int = 'docs/source/en/_toctree.yml' def UpperCamelCase ( __magic_name__ : Union[str, Any] ) -> List[str]: """simple docstring""" lowercase__ = defaultdict(__magic_name_...
305
class A : '''simple docstring''' def __init__(self : List[str] ) -> Tuple: """simple docstring""" lowercase__ = 0 lowercase__ = 0 lowercase__ = {} def lowerCamelCase__ (self : ...
305
1
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from .tokenization_gpta import GPTaTokenizer class A ( tf.keras.layers.Layer ): '''simple docstring''' ...
305
def UpperCamelCase ( __magic_name__ : int , __magic_name__ : int ) -> int: """simple docstring""" return int((input_a, input_a).count(1 ) != 0 ) def UpperCamelCase ( ) -> None: """simple docstring""" assert or_gate(0 ...
305
1
from __future__ import annotations import pandas as pd def UpperCamelCase ( __magic_name__ : list[int] , __magic_name__ : list[int] , __magic_name__ : int ) -> list[int]: """simple docstring""" lowercase__ = [0] * no_of_pr...
305
import argparse from torch import nn # transformers_old should correspond to branch `save_old_prophetnet_model_structure` here # original prophetnet_checkpoints are saved under `patrickvonplaten/..._old` respectively from transformers_old.modeling_prophetnet import ( ProphetNetForConditionalGeneratio...
305
1
import argparse import requests import torch from PIL import Image from transformers import CLIPProcessor, GroupViTConfig, GroupViTModel def UpperCamelCase ( __magic_name__ : int ) -> str: """simple docstring""" if "img_encoder.pos_embed" in name: lowe...
305
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from .tokenization_gpta import GPTaTokenizer class A ( tf.keras.layers.Layer ): '''simple docstring''' ...
305
1
from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available A : Any = {'tokenization_herbert': ['HerbertTokenizer']} try: if not is_tokenizers_available(): raise OptionalDependencyNotAvailable() except OptionalDependencyNo...
305
from __future__ import annotations from functools import lru_cache from math import ceil A : Optional[int] = 1_0_0 A : int = set(range(3, NUM_PRIMES, 2)) primes.add(2) A : int for prime in range(3, ceil(NUM_PRIMES**0.5), 2): if prime not in primes: continue pri...
305
1
from dataclasses import dataclass, field from typing import ClassVar, Dict from ..features import Features, Value from .base import TaskTemplate @dataclass(frozen=UpperCAmelCase__ ) class A ( UpperCAmelCase__ ): '''simple docstring''' A__ = field(...
305
def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" lowercase__ = [0] * len(__magic_name__ ) lowercase__ = [] lowercase__ = [1] * len(__magic_name__ ) for values in graph.values(): for i in v...
305
1
import os import pickle import unittest from transformers import AutoTokenizer from transformers.models.bert.tokenization_bert import BertTokenizer from transformers.models.bert_japanese.tokenization_bert_japanese import ( VOCAB_FILES_NAMES, BertJapaneseTokenizer, CharacterTokenizer, Ju...
305
# Copyright 2023 The HuggingFace 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-2.0 # # Unless require...
305
1
import math def UpperCamelCase ( __magic_name__ : list , __magic_name__ : int ) -> int: """simple docstring""" lowercase__ = len(__magic_name__ ) lowercase__ = int(math.floor(math.sqrt(__magic_name__ ) ) ) lower...
305
def UpperCamelCase ( __magic_name__ : str ) -> int: """simple docstring""" assert column_title.isupper() lowercase__ = 0 lowercase__ = len(__magic_name__ ) - 1 lowercase__ = 0 while index >= 0: lowercase__ = (ord(column_tit...
305
1
import torch def UpperCamelCase ( ) -> List[Any]: """simple docstring""" if torch.cuda.is_available(): lowercase__ = torch.cuda.device_count() else: lowercase__ = 0 print(f'''Successfully ran on {num_gpus} GPUs''' ) if __name__ == "__main...
305
import numpy as np import pandas as pd from sklearn.preprocessing import Normalizer from sklearn.svm import SVR from statsmodels.tsa.statespace.sarimax import SARIMAX def UpperCamelCase ( __magic_name__ : list , __magic_name__ : list , __magic_name__ : ...
305
1
import argparse import os from pathlib import Path import torch from bark.generation import _load_model as _bark_load_model from huggingface_hub import hf_hub_download from transformers import EncodecConfig, EncodecModel, set_seed from transformers.models.bark.configuration_bark import ( BarkCoars...
305
import os import textwrap import pyarrow as pa import pytest from datasets import ClassLabel, Features, Image from datasets.packaged_modules.csv.csv import Csv from ..utils import require_pil @pytest.fixture def UpperCamelCase ( __magic_name__ : Optional[Any] ) -> L...
305
1
def UpperCamelCase ( __magic_name__ : Optional[int] , __magic_name__ : int ) -> List[str]: """simple docstring""" lowercase__ = [1] for i in range(2 , __magic_name__ ): factorials.append(factorials[-1] * i ) assert 0 <= k < facto...
305
from typing import TYPE_CHECKING from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available, is_vision_available from ...utils import OptionalDependencyNotAvailable A : int = {'configuration_dpt': ['DPT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DPTConfig']} try: if not is_...
305
1
# using dfs for finding eulerian path traversal def UpperCamelCase ( __magic_name__ : str , __magic_name__ : int , __magic_name__ : Union[str, Any] , __magic_name__ : Tuple=None ) -> Optional[Any]: """simple docstring""" ...
305
from __future__ import annotations def UpperCamelCase ( __magic_name__ : list[float] , __magic_name__ : list[float] ) -> float: """simple docstring""" lowercase__ = sorted(numsa + numsa ) lowercase__ , lowercase__ = divmod(l...
305
1
from typing import List, Optional, Union from ...configuration_utils import PretrainedConfig from ...utils import logging A : Tuple = logging.get_logger(__name__) A : Optional[Any] = { 'huggingface/informer-tourism-monthly': ( 'https://huggingface.co/huggingface/i...
305
A : Union[str, Any] = {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []} A : List[Any] = {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]} def UpperCamelCase ( __magic_name__ : dict[int, list[int]] , __magic_name__ : int , __magic_name__ ...
305
1
import itertools from dataclasses import dataclass from typing import List, Optional import pyarrow as pa import pyarrow.parquet as pq import datasets from datasets.table import table_cast A : Any = datasets.utils.logging.get_logger(__name__) @dataclass class A ( ...
305
import gc import random import tempfile import unittest import numpy as np import torch from PIL import Image from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMInverseScheduler, DDIMScheduler, DPMSolverMultistepInverseS...
305
1
import math A : Optional[Any] = 1_0 A : List[str] = 7 A : str = BALLS_PER_COLOUR * NUM_COLOURS def UpperCamelCase ( __magic_name__ : int = 20 ) -> str: """simple docstring""" lowercase__ = math.comb(__magic_name__ ...
305
from __future__ import annotations import math def UpperCamelCase ( __magic_name__ : list , __magic_name__ : list ) -> list: """simple docstring""" if len(__magic_name__ ) != 2 or len(a[0] ) != 2 or len(__magic_name__ ) != 2 or len(b[...
305
1
import argparse import torch from ...utils import logging from . import AlbertConfig, AlbertForPreTraining, load_tf_weights_in_albert logging.set_verbosity_info() def UpperCamelCase ( __magic_name__ : Dict , __magic_name__ : Union[str, Any] , __magic_n...
305
import unittest import numpy as np from transformers import BertConfig, is_flax_available from transformers.testing_utils import require_flax, slow from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask if is_flax_available(): from transfor...
305
1
def UpperCamelCase ( __magic_name__ : str ) -> list: """simple docstring""" if n_term == "": return [] lowercase__ = [] for temp in range(int(__magic_name__ ) ): series.append(f'''1/{temp + 1}''' if series else """1""" ) return series ...
305
def UpperCamelCase ( __magic_name__ : str ) -> list: """simple docstring""" if n_term == "": return [] lowercase__ = [] for temp in range(int(__magic_name__ ) ): series.append(f'''1/{temp + 1}''' if series else """1""" ) return series ...
305
1
from __future__ import annotations from collections import namedtuple from dataclasses import dataclass @dataclass class A : '''simple docstring''' A__ = 42 A__ = None A__ = None A : Union[str, Any] = namedtuple('CoinsDistrib...
305
import gc import random import unittest import numpy as np import torch from transformers import CLIPImageProcessor, CLIPVisionConfig, CLIPVisionModel from diffusers import HeunDiscreteScheduler, PriorTransformer, ShapEImgaImgPipeline from diffusers.pipelines.shap_e import ShapERenderer from diffusers...
305
1
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 from ..models.auto.modeling_tf_auto imp...
305
import requests from bsa import BeautifulSoup def UpperCamelCase ( __magic_name__ : str = "AAPL" ) -> str: """simple docstring""" lowercase__ = f'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}''' lowercase__ = BeautifulSoup(requests.ge...
305
1
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 ( ConditionalDetrConfig, ConditionalDetrForObjectDetection, ConditionalDetrFor...
305
from ...configuration_utils import PretrainedConfig from ...utils import logging A : List[str] = logging.get_logger(__name__) A : Any = { 'tiiuae/falcon-40b': 'https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json', 'tiiuae/falcon-7b': 'https://huggingface.co...
305
1
import torch from diffusers import DDPMParallelScheduler from .test_schedulers import SchedulerCommonTest class A ( UpperCAmelCase__ ): '''simple docstring''' A__ = (DDPMParallelScheduler,) def lowerCamelCase__ (self : str , ...
305
import json import os import shutil import tempfile import unittest import numpy as np import pytest from transformers import BertTokenizer, BertTokenizerFast from transformers.models.bert.tokenization_bert import VOCAB_FILES_NAMES from transformers.testing_utils import require_vision from transform...
305
1
import math import qiskit def UpperCamelCase ( __magic_name__ : int = 1 , __magic_name__ : int = 1 , __magic_name__ : int = 1 ) -> qiskit.result.counts.Counts: """simple docstring""" if ( isinstance(__magic_name__ , _...
305
import unittest from transformers.testing_utils import CaptureStdout from transformers.tools.python_interpreter import evaluate def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" return x + 2 class A...
305
1
import requests from bsa import BeautifulSoup def UpperCamelCase ( __magic_name__ : str = "AAPL" ) -> str: """simple docstring""" lowercase__ = f'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}''' lowercase__ = BeautifulSoup(requests.ge...
305
class A : '''simple docstring''' def __init__(self : List[str] ) -> Tuple: """simple docstring""" lowercase__ = 0 lowercase__ = 0 lowercase__ = {} def lowerCamelCase__ (self : ...
305
1
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_...
305
def UpperCamelCase ( __magic_name__ : int , __magic_name__ : int ) -> int: """simple docstring""" return int((input_a, input_a).count(1 ) != 0 ) def UpperCamelCase ( ) -> None: """simple docstring""" assert or_gate(0 ...
305
1
def UpperCamelCase ( ) -> Optional[int]: """simple docstring""" for n in range(1 , 100_0000 ): yield n * (n + 1) // 2 def UpperCamelCase ( __magic_name__ : List[str] ) -> Optional[Any]: """simple docstring""" lowercase__ ...
305
import argparse from torch import nn # transformers_old should correspond to branch `save_old_prophetnet_model_structure` here # original prophetnet_checkpoints are saved under `patrickvonplaten/..._old` respectively from transformers_old.modeling_prophetnet import ( ProphetNetForConditionalGeneratio...
305
1
import baseaa import io import json import os from copy import deepcopy from ..optimizer import AcceleratedOptimizer from ..scheduler import AcceleratedScheduler class A : '''simple docstring''' def __init__(self : Optional[Any] , _UpperCAmelCase ...
305
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from .tokenization_gpta import GPTaTokenizer class A ( tf.keras.layers.Layer ): '''simple docstring''' ...
305
1
def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" lowercase__ = [0] * len(__magic_name__ ) lowercase__ = [] lowercase__ = [1] * len(__magic_name__ ) for values in graph.values(): for i in v...
305
from __future__ import annotations from functools import lru_cache from math import ceil A : Optional[int] = 1_0_0 A : int = set(range(3, NUM_PRIMES, 2)) primes.add(2) A : int for prime in range(3, ceil(NUM_PRIMES**0.5), 2): if prime not in primes: continue pri...
305
1
import unittest import numpy as np import torch from diffusers import PNDMPipeline, PNDMScheduler, UNetaDModel from diffusers.utils.testing_utils import enable_full_determinism, require_torch, slow, torch_device enable_full_determinism() class A ( unittest.TestCase ): ...
305
def UpperCamelCase ( __magic_name__ : List[Any] ) -> Optional[int]: """simple docstring""" lowercase__ = [0] * len(__magic_name__ ) lowercase__ = [] lowercase__ = [1] * len(__magic_name__ ) for values in graph.values(): for i in v...
305
1