id
stringlengths
19
21
content
stringlengths
722
86.7k
evocodebench_data_201
# @Author : Shichao Song # @Email : song.shichao@outlook.com import json import os import random from uhgeval.dataset.base import BaseDataset class XinhuaHallucinations(BaseDataset): def __init__(self, path: str, shuffle: bool = False, seed: int = 22): self.data = [] if os.path.isfile(path): ...
evocodebench_data_202
# Copyright (c) OpenMMLab. All rights reserved. import warnings from mmcv.cnn import MODELS as MMCV_MODELS from mmcv.utils import Registry from mmdet.models.builder import BACKBONES as MMDET_BACKBONES from mmdet.models.builder import DETECTORS as MMDET_DETECTORS from mmdet.models.builder import HEADS as MMDET_HEADS f...
evocodebench_data_203
# Copyright (c) OpenMMLab. All rights reserved. import warnings from mmcv.cnn import MODELS as MMCV_MODELS from mmcv.utils import Registry from mmdet.models.builder import BACKBONES as MMDET_BACKBONES from mmdet.models.builder import DETECTORS as MMDET_DETECTORS from mmdet.models.builder import HEADS as MMDET_HEADS f...
evocodebench_data_204
# Copyright (c) OpenMMLab. All rights reserved. import warnings from mmcv.cnn import MODELS as MMCV_MODELS from mmcv.utils import Registry from mmdet.models.builder import BACKBONES as MMDET_BACKBONES from mmdet.models.builder import DETECTORS as MMDET_DETECTORS from mmdet.models.builder import HEADS as MMDET_HEADS f...
evocodebench_data_205
# Copyright (c) OpenMMLab. All rights reserved. import warnings from mmcv.cnn import MODELS as MMCV_MODELS from mmcv.utils import Registry from mmdet.models.builder import BACKBONES as MMDET_BACKBONES from mmdet.models.builder import DETECTORS as MMDET_DETECTORS from mmdet.models.builder import HEADS as MMDET_HEADS f...
evocodebench_data_206
# Copyright (c) OpenMMLab. All rights reserved. import warnings from mmcv.cnn import MODELS as MMCV_MODELS from mmcv.utils import Registry from mmdet.models.builder import BACKBONES as MMDET_BACKBONES from mmdet.models.builder import DETECTORS as MMDET_DETECTORS from mmdet.models.builder import HEADS as MMDET_HEADS f...
evocodebench_data_207
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch from mmcv.utils import print_log from terminaltables import AsciiTable def average_precision(recalls, precisions, mode='area'): """Calculate average precision (for single or multiple scales). Args: recalls (np.ndarray): R...
evocodebench_data_208
# Copyright (c) OpenMMLab. All rights reserved. from logging import warning import numpy as np import torch from mmdet3d.core.utils import array_converter @array_converter(apply_to=('val', )) def limit_period(val, offset=0.5, period=np.pi): """Limit the value into a period for periodic function. Args: ...
evocodebench_data_209
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_210
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_211
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_212
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_213
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_214
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_215
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_216
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_217
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_218
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_219
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_220
import io import random import re import subprocess import tempfile import tokenize from collections import defaultdict from dataclasses import dataclass, field from enum import StrEnum from pathlib import Path from typing import ClassVar, Optional, TypeAlias ROOT_DIR = Path(__file__).parent.parent class Level(StrEn...
evocodebench_data_221
import os import io import json import httpx import binascii import platform import urllib.parse from os import PathLike from pathlib import Path from hashlib import sha256 from base64 import b64encode, b64decode from typing import Any, AnyStr, Union, Optional, Sequence, Mapping, Literal import sys if sys.version_in...
evocodebench_data_222
import contextlib import packaging.version from functorch.compile import (aot_function, aot_module) import torch @contextlib.contextmanager def no_fake_tensor(): if packaging.version.parse( torch.__version__) >= packaging.version.parse("2.0.0"): from torch._functorch import config use...
evocodebench_data_223
import logging import os import uuid from copy import deepcopy from typing import Optional, Dict, List import pandas as pd import uvicorn import yaml from fastapi import FastAPI from pydantic import BaseModel from autorag.support import get_support_modules from autorag.utils.util import load_summary_file logger = lo...
evocodebench_data_224
import logging import inspect import functools import threading import torch from sfast.utils import flat_tensors from sfast.utils.copy import tree_copy from sfast.hooks.module_jit_hook import (apply_to_all_modules, apply_to_module) from .utils import better_trace logger = logging.getLogger() def trace_with_kwargs(f...
evocodebench_data_225
import logging import os import uuid from copy import deepcopy from typing import Optional, Dict, List import pandas as pd import uvicorn import yaml from fastapi import FastAPI from pydantic import BaseModel from autorag.support import get_support_modules from autorag.utils.util import load_summary_file logger = lo...
evocodebench_data_226
import logging import os import pathlib from typing import List, Callable, Dict, Tuple import pandas as pd from autorag.evaluate import evaluate_retrieval from autorag.strategy import measure_speed, filter_by_threshold, select_best_average from autorag.utils.util import load_summary_file logger = logging.getLogger("...
evocodebench_data_227
import logging import os import pathlib from typing import List, Callable, Dict, Optional from copy import deepcopy import pandas as pd from autorag.nodes.retrieval.run import evaluate_retrieval_node from autorag.strategy import measure_speed, filter_by_threshold, select_best_average from autorag.utils.util import ma...
evocodebench_data_228
import os import pathlib from copy import deepcopy from typing import List, Callable, Dict, Optional, Union import pandas as pd from autorag.evaluate import evaluate_generation from autorag.evaluate.util import cast_metrics from autorag.strategy import measure_speed, filter_by_threshold, select_best_average from auto...
evocodebench_data_229
import itertools import logging from copy import deepcopy from dataclasses import dataclass, field from typing import Dict, List, Callable, Tuple import pandas as pd from autorag.schema.module import Module from autorag.support import get_support_nodes from autorag.utils.util import make_combinations, explode logger...
evocodebench_data_230
import functools import os from typing import List, Optional import evaluate import sacrebleu from llama_index.core.embeddings import BaseEmbedding from openai import OpenAI from autorag import embedding_models from autorag.evaluate.metric.util import calculate_cosine_similarity def generation_metric(func): @fu...
evocodebench_data_231
from __future__ import annotations import logging import os import torch from modules import ( devices, errors, face_restoration, face_restoration_utils, modelloader, shared, ) logger = logging.getLogger(__name__) model_url = "https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFP...
evocodebench_data_232
from __future__ import annotations import logging import torch from modules import ( devices, errors, face_restoration, face_restoration_utils, modelloader, shared, ) logger = logging.getLogger(__name__) model_url = 'https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.p...
evocodebench_data_233
from __future__ import annotations import logging import os import torch from modules import ( devices, errors, face_restoration, face_restoration_utils, modelloader, shared, ) logger = logging.getLogger(__name__) model_url = "https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFP...
evocodebench_data_234
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_235
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_236
import tqdm import tiktoken import numpy as np from scipy.special import logsumexp import math from functools import partial, reduce from operator import or_ as union from typing import Literal, Optional from concurrent.futures import ThreadPoolExecutor from openlogprobs.models import Model from openlogprobs.utils im...
evocodebench_data_237
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_238
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_239
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_240
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_241
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_242
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_243
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_244
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_245
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_246
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_247
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_248
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_249
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_250
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_251
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_252
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_253
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_254
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_255
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_256
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_257
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_258
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_259
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_260
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_261
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_262
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_263
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_264
# coding=utf-8 # Copyright 2023 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
evocodebench_data_265
import logging import re from collections import Counter from collections import defaultdict from . import formatter from . import line_parser from . import patterns from nlm_ingestor.ingestor_utils import spell_utils from nlm_ingestor.ingestor_utils.utils import sent_tokenize logger = logging.getLogger(__name__) log...
evocodebench_data_266
import json import re import numpy as np from nltk import load from nltk import PunktSentenceTokenizer nltk_abbs = load("tokenizers/punkt/{}.pickle".format("english"))._params.abbrev_types class NpEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, np.integer): return int(...
evocodebench_data_267
"""Tokenized, searchable text as a pandas dtype.""" import pandas as pd import numbers from pandas.api.extensions import ExtensionDtype, ExtensionArray, register_extension_dtype from pandas.api.types import is_list_like from pandas.api.extensions import take import json from collections import Counter import warnings i...
evocodebench_data_268
"""Utility functions for Solr users of searcharray.""" import re import pandas as pd import numpy as np from typing import List, Optional, Dict, Tuple from searcharray.postings import SearchArray from searcharray.similarity import Similarity, default_bm25 def parse_min_should_match(num_clauses: int, spec: str) -> int...
evocodebench_data_269
"""Tokenized, searchable text as a pandas dtype.""" import pandas as pd import numbers from pandas.api.extensions import ExtensionDtype, ExtensionArray, register_extension_dtype from pandas.api.types import is_list_like from pandas.api.extensions import take import json from collections import Counter import warnings i...
evocodebench_data_270
"""Tokenized, searchable text as a pandas dtype.""" import pandas as pd import numbers from pandas.api.extensions import ExtensionDtype, ExtensionArray, register_extension_dtype from pandas.api.types import is_list_like from pandas.api.extensions import take import json from collections import Counter import warnings i...
evocodebench_data_271
import threading from deluder.common import * from deluder.interceptor import MessageInterceptor from deluder.interceptors.proxifier.strategy import * from deluder.interceptors.proxifier.connection import DEFAULT_CONNECTION_ID, Connection from deluder.interceptors.proxifier.server import Server class ProxifierMess...
evocodebench_data_272
"""Naive popcount implementation until such time that's exposed in numpy (SOON!).""" import numpy as np m1 = np.uint64(0x5555555555555555) m2 = np.uint64(0x3333333333333333) m3 = np.uint64(0x0F0F0F0F0F0F0F0F) m4 = np.uint64(0x0101010101010101) mask = np.uint64(-1) s55 = np.uint64(m1 & mask) # Add more digits for 1...
evocodebench_data_273
"""Utility functions for Solr users of searcharray.""" import re import pandas as pd import numpy as np from typing import List, Optional, Dict, Tuple from searcharray.postings import SearchArray from searcharray.similarity import Similarity, default_bm25 def parse_min_should_match(num_clauses: int, spec: str) -> int...
evocodebench_data_274
import threading from deluder.common import * from deluder.interceptor import MessageInterceptor from deluder.interceptors.proxifier.strategy import * from deluder.interceptors.proxifier.connection import DEFAULT_CONNECTION_ID, Connection from deluder.interceptors.proxifier.server import Server class ProxifierMess...
evocodebench_data_275
import threading from deluder.common import * from deluder.interceptor import MessageInterceptor from deluder.interceptors.proxifier.strategy import * from deluder.interceptors.proxifier.connection import DEFAULT_CONNECTION_ID, Connection from deluder.interceptors.proxifier.server import Server class ProxifierMess...