id
stringlengths
19
21
content
stringlengths
722
86.7k
evocodebench_data_1
""" Common utilities. """ from asyncio import AbstractEventLoop import json import logging import logging.handlers import os import platform import sys from typing import AsyncGenerator, Generator import warnings import requests from chat.constants import LOGDIR handler = None visited_loggers = set() def build_lo...
evocodebench_data_2
"""Tools module""" # Copyright (c) 2023 # Author: Hugo Delatte <delatte.hugo@gmail.com> # License: BSD 3 clause # Implementation derived from: # Riskfolio-Lib, Copyright (c) 2020-2023, Dany Cajas, Licensed under BSD 3 clause. # Statsmodels, Copyright (C) 2006, Jonathan E. Taylor, Licensed under BSD 3 clause. from enu...
evocodebench_data_3
# 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_4
import sqlite3 import hashlib import json import functools ## Originally from https://www.kevinkatz.io/posts/memoize-to-sqlite def memoize_to_sqlite(func_name: str, filename: str = "cache.db"): """ Memoization decorator that caches the output of a method in a SQLite database. """ def decorator(fun...
evocodebench_data_5
from typing import Any, Callable, Dict, Iterable, List import numpy as np from pydantic import fields # ----- validators ----- def is_odd(cls: type, v: int, field: fields.ModelField) -> int: """Check that kernel size are odd numbers. Args: cls (type): Class type. v (int): Value to check. ...
evocodebench_data_6
# 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_7
# Copyright The Lightning AI team. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
evocodebench_data_8
"""Tools module""" # Copyright (c) 2023 # Author: Hugo Delatte <delatte.hugo@gmail.com> # License: BSD 3 clause # Implementation derived from: # scikit-learn, Copyright (c) 2007-2010 David Cournapeau, Fabian Pedregosa, Olivier # Grisel Licensed under BSD 3 clause. from collections.abc import Callable, Iterator from e...
evocodebench_data_9
import json import numpy as np from agents.microagent import MicroAgent class AgentSerializer: @staticmethod def to_dict(agent): """ Serialize the MicroAgent object to a dictionary for persistence. """ purpose_embedding = agent.purpose_embedding if isinstance(purpose_emb...
evocodebench_data_10
# 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_11
# 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_12
# formatting done while cleaning def connect(prev, curr): has_space = prev.endswith(" ") has_hyphen = prev.endswith("-") if has_hyphen: result = prev[0:-1] + curr return result result = prev + ("" if has_space else " ") + curr return result def fix_mixedcase_words(word): # if l...
evocodebench_data_13
from typing import Any, Callable, Dict, Iterable, List import numpy as np from pydantic import fields # ----- validators ----- def is_odd(cls: type, v: int, field: fields.ModelField) -> int: """Check that kernel size are odd numbers. Args: cls (type): Class type. v (int): Value to check. ...
evocodebench_data_14
# 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_15
import ast import asyncio import functools import itertools import logging import os import re import string from copy import deepcopy from typing import List, Callable, Dict, Optional, Any, Collection import pandas as pd logger = logging.getLogger("AutoRAG") def fetch_contents(corpus_data: pd.DataFrame, ids: List[...
evocodebench_data_16
# 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_17
import os from contextlib import redirect_stdout import argparse from copy import deepcopy from XAgent.config import CONFIG, ARGS from command import CommandLine, CommandLineParam def parse_args() -> argparse.Namespace: """ Parse the command line arguments and return them as an argparse.Namespace object. ...
evocodebench_data_18
from typing import Any, Callable, Dict, Iterable, List import numpy as np from pydantic import fields # ----- validators ----- def is_odd(cls: type, v: int, field: fields.ModelField) -> int: """Check that kernel size are odd numbers. Args: cls (type): Class type. v (int): Value to check. ...
evocodebench_data_19
import dataclasses import datetime import inspect import json import typing from typing import get_args, Literal import string import types def json_default(thing): try: return dataclasses.asdict(thing) except TypeError: pass if isinstance(thing, datetime.datetime): return thing.iso...
evocodebench_data_20
# 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_21
# Copyright The Lightning AI team. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
evocodebench_data_22
# 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_23
# 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_24
# 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_25
from typing import Any, Callable, Dict, Iterable, List import numpy as np from pydantic import fields # ----- validators ----- def is_odd(cls: type, v: int, field: fields.ModelField) -> int: """Check that kernel size are odd numbers. Args: cls (type): Class type. v (int): Value to check. ...
evocodebench_data_26
# 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_27
# 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_28
# @Author : Shichao Song # @Email : song.shichao@outlook.com from typing import Callable import evaluate import jieba from loguru import logger from text2vec import Similarity def catch_all_exceptions(func): def wrapper(*args, **kwargs): try: result = func(*args, **kwargs) retu...
evocodebench_data_29
# 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_30
# 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_31
# Copyright The Lightning AI team. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
evocodebench_data_32
# 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_33
import json import numpy as np from agents.microagent import MicroAgent class AgentSerializer: @staticmethod def to_dict(agent): """ Serialize the MicroAgent object to a dictionary for persistence. """ purpose_embedding = agent.purpose_embedding if isinstance(purpose_emb...
evocodebench_data_34
from collections import defaultdict from typing import Any, Dict, List, Tuple def _pack_greedily(items: List[Any], weights: List[int], num_bins: int) -> Tuple[Dict[int, List[Any]], Dict[int, int]]: """Greedily pack items with given weights into bins such that the total weight of each bin is roughly equally di...
evocodebench_data_35
import sqlite3 import hashlib import json import functools ## Originally from https://www.kevinkatz.io/posts/memoize-to-sqlite def memoize_to_sqlite(func_name: str, filename: str = "cache.db"): """ Memoization decorator that caches the output of a method in a SQLite database. """ def decorator(fun...
evocodebench_data_36
import math from typing import Dict, Tuple import numpy as np def area(array: np.ndarray) -> float: """Shoelace formula for simple polygon area calculation. WARNING: This formula only works for simple polygons, i.e planar polygon without self-intersection nor holes. These conditions are not checked with...
evocodebench_data_37
from typing import Callable, List import cv2 import numpy as np from pydantic import NonNegativeFloat from iris.io.class_configs import Algorithm from iris.io.dataclasses import GeometryMask, GeometryPolygons from iris.io.errors import VectorizationError from iris.utils.math import area def filter_polygon_areas( ...
evocodebench_data_38
# Copyright The Lightning AI team. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
evocodebench_data_39
import functools import time from typing import List, Iterable, Tuple, Any, Optional, Callable import pandas as pd def measure_speed(func, *args, **kwargs): """ Method for measuring execution speed of the function. """ start_time = time.time() result = func(*args, **kwargs) end_time = time.ti...
evocodebench_data_40
import math from typing import Dict, Tuple import numpy as np def area(array: np.ndarray) -> float: """Shoelace formula for simple polygon area calculation. WARNING: This formula only works for simple polygons, i.e planar polygon without self-intersection nor holes. These conditions are not checked with...
evocodebench_data_41
import torch from typing import Tuple, Callable, List def matchup_channels(t: torch.Tensor, w: torch.Tensor): if t.ndim == w.ndim + 1: t = t[..., 0] # remove last dimension if t.shape[-1] != w.shape[-1] + 1: t = torch.cat([t, torch.ones_like(t[..., -1:])], dim=-1) # 65 return t, w @tor...
evocodebench_data_42
# 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_43
# 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_44
_FORMAT_TO_RATIO = { "kb": 1000, "mb": 1000**2, "gb": 1000**3, "tb": 1000**4, } def _convert_bytes_to_int(bytes_str: str) -> int: """Convert human-readable byte format to an integer.""" for suffix in _FORMAT_TO_RATIO: bytes_str = bytes_str.lower().strip() if bytes_str.lower().e...
evocodebench_data_45
from typing import Any, Callable, Dict, Iterable, List import numpy as np from pydantic import fields # ----- validators ----- def is_odd(cls: type, v: int, field: fields.ModelField) -> int: """Check that kernel size are odd numbers. Args: cls (type): Class type. v (int): Value to check. ...
evocodebench_data_46
# 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_47
# @Author : Shichao Song # @Email : song.shichao@outlook.com from typing import Callable import evaluate import jieba from loguru import logger from text2vec import Similarity def catch_all_exceptions(func): def wrapper(*args, **kwargs): try: result = func(*args, **kwargs) retu...
evocodebench_data_48
# Copyright (c) Facebook, Inc. and its affiliates. from typing import Any import pydoc from fvcore.common.registry import Registry # for backward compatibility. """ ``Registry`` and `locate` provide ways to map a string (typically found in config files) to callable objects. """ __all__ = ["Registry", "locate"] de...
evocodebench_data_49
# Copyright (c) Facebook, Inc. and its affiliates. import io import numpy as np import torch from detectron2 import model_zoo from detectron2.config import CfgNode, instantiate from detectron2.data import DatasetCatalog from detectron2.data.detection_utils import read_image from detectron2.modeling import build_model ...
evocodebench_data_50
from typing import Tuple, List import pandas as pd from autorag.nodes.retrieval import retrieval_node @retrieval_node def hybrid_cc( ids: Tuple, scores: Tuple, top_k: int, weights: Tuple = (0.5, 0.5)) -> Tuple[List[List[str]], List[List[float]]]: """ Hybrid CC function. C...
evocodebench_data_51
"""Tools module""" # Copyright (c) 2023 # Author: Hugo Delatte <delatte.hugo@gmail.com> # License: BSD 3 clause # Implementation derived from: # scikit-learn, Copyright (c) 2007-2010 David Cournapeau, Fabian Pedregosa, Olivier # Grisel Licensed under BSD 3 clause. from collections.abc import Callable, Iterator from e...
evocodebench_data_52
import concurrent import json import logging import os import random import shutil import signal import tempfile import traceback import types from abc import abstractmethod from dataclasses import dataclass from multiprocessing import Process, Queue from pathlib import Path from queue import Empty from time import sle...
evocodebench_data_53
# 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_54
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_55
"""Tools module""" # Copyright (c) 2023 # Author: Hugo Delatte <delatte.hugo@gmail.com> # License: BSD 3 clause # Implementation derived from: # Riskfolio-Lib, Copyright (c) 2020-2023, Dany Cajas, Licensed under BSD 3 clause. # Statsmodels, Copyright (C) 2006, Jonathan E. Taylor, Licensed under BSD 3 clause. from enu...
evocodebench_data_56
from copy import deepcopy from dataclasses import dataclass, field from typing import Callable, Dict from autorag.support import get_support_modules @dataclass class Module: module_type: str module_param: Dict module: Callable = field(init=False) def __post_init__(self): self.module = get_su...
evocodebench_data_57
# -*- coding: utf-8 -*- # Copyright (c) Facebook, Inc. and its affiliates. """ Common data processing utilities that are used in a typical object detection data pipeline. """ import logging import numpy as np from typing import List, Union import pycocotools.mask as mask_util import torch from PIL import Image from d...
evocodebench_data_58
# 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_59
import logging from integrations.openaiwrapper import OpenAIAPIWrapper from agents.parallel_agent_executor import ParallelAgentExecutor from prompt_management.prompts import ( REACT_STEP_POST, REACT_STEP_PROMPT, REACT_SYSTEM_PROMPT, REACT_PLAN_PROMPT, STATIC_PRE_PROMPT, STATIC_PRE_PROMPT_PRIME, REACT_STEP_PROMPT_PR...
evocodebench_data_60
# -*- coding: utf-8 -*- # Copyright (c) Facebook, Inc. and its affiliates. """ Common data processing utilities that are used in a typical object detection data pipeline. """ import logging import numpy as np from typing import List, Union import pycocotools.mask as mask_util import torch from PIL import Image from d...
evocodebench_data_61
"""Datasets module.""" # Copyright (c) 2023 # Author: Hugo Delatte <delatte.hugo@gmail.com> # License: BSD 3 clause # Implementation derived from: # scikit-portfolio, Copyright (c) 2022, Carlo Nicolini, Licensed under MIT Licence. # scikit-learn, Copyright (c) 2007-2010 David Cournapeau, Fabian Pedregosa, Olivier # Gr...
evocodebench_data_62
"""Tools module""" # Copyright (c) 2023 # Author: Hugo Delatte <delatte.hugo@gmail.com> # License: BSD 3 clause # Implementation derived from: # Riskfolio-Lib, Copyright (c) 2020-2023, Dany Cajas, Licensed under BSD 3 clause. # Statsmodels, Copyright (C) 2006, Jonathan E. Taylor, Licensed under BSD 3 clause. from enu...
evocodebench_data_63
# Copyright (c) Facebook, Inc. and its affiliates. import os import sys import tempfile from contextlib import ExitStack, contextmanager from copy import deepcopy from unittest import mock import torch from torch import nn # need some explicit imports due to https://github.com/pytorch/pytorch/issues/38964 import dete...
evocodebench_data_64
from typing import Any, Callable, Dict, Iterable, List import numpy as np from pydantic import fields # ----- validators ----- def is_odd(cls: type, v: int, field: fields.ModelField) -> int: """Check that kernel size are odd numbers. Args: cls (type): Class type. v (int): Value to check. ...
evocodebench_data_65
from copy import deepcopy from typing import Union, List, Dict, Tuple, Any from autorag import embedding_models def cast_metrics(metrics: Union[List[str], List[Dict]]) -> Tuple[List[str], List[Dict[str, Any]]]: """ Turn metrics to list of metric names and parameter list. :param metrics: List of string ...
evocodebench_data_66
# 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_67
# 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_68
# 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_69
from typing import Tuple, List import pandas as pd from autorag.nodes.retrieval import retrieval_node @retrieval_node def hybrid_cc( ids: Tuple, scores: Tuple, top_k: int, weights: Tuple = (0.5, 0.5)) -> Tuple[List[List[str]], List[List[float]]]: """ Hybrid CC function. C...
evocodebench_data_70
# 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_71
"""Tools module""" # Copyright (c) 2023 # Author: Hugo Delatte <delatte.hugo@gmail.com> # License: BSD 3 clause # Implementation derived from: # scikit-learn, Copyright (c) 2007-2010 David Cournapeau, Fabian Pedregosa, Olivier # Grisel Licensed under BSD 3 clause. from collections.abc import Callable, Iterator from e...
evocodebench_data_72
"""Tools module""" # Copyright (c) 2023 # Author: Hugo Delatte <delatte.hugo@gmail.com> # License: BSD 3 clause # Implementation derived from: # Riskfolio-Lib, Copyright (c) 2020-2023, Dany Cajas, Licensed under BSD 3 clause. # Statsmodels, Copyright (C) 2006, Jonathan E. Taylor, Licensed under BSD 3 clause. from enu...
evocodebench_data_73
# 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_74
from typing import Any, Callable, Dict, Iterable, List import numpy as np from pydantic import fields # ----- validators ----- def is_odd(cls: type, v: int, field: fields.ModelField) -> int: """Check that kernel size are odd numbers. Args: cls (type): Class type. v (int): Value to check. ...
evocodebench_data_75
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from easyvolcap.utils.egl_utils import create_opengl_context, eglContextManager # must be imported before OpenGL.GL from easyvolcap.runners.volumetric_video_viewer import VolumetricVideoViewer import os import sys import glm...
evocodebench_data_76
import re from collections import OrderedDict import torch import torch.nn.functional as F from transformers import BertConfig, GPT2Config, PretrainedConfig from .configuration_nomic_bert import NomicBertConfig def bert_config_to_nomic_config(bert_config: BertConfig) -> NomicBertConfig: return NomicBertConfig( ...
evocodebench_data_77
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from easyvolcap.utils.egl_utils import create_opengl_context, eglContextManager # must be imported before OpenGL.GL from easyvolcap.runners.volumetric_video_viewer import VolumetricVideoViewer import os import sys import glm...
evocodebench_data_78
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from easyvolcap.utils.egl_utils import create_opengl_context, eglContextManager # must be imported before OpenGL.GL from easyvolcap.runners.volumetric_video_viewer import VolumetricVideoViewer import os import sys import glm...
evocodebench_data_79
# Feature Cloud Sequence utilities # This files builds the components for the feature cloud sequence sampler import torch from typing import List, Dict, Union from easyvolcap.utils.console_utils import * from easyvolcap.utils.base_utils import dotdict from easyvolcap.utils.raster_utils import get_ndc_perspective_matr...
evocodebench_data_80
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from easyvolcap.utils.egl_utils import create_opengl_context, eglContextManager # must be imported before OpenGL.GL from easyvolcap.runners.volumetric_video_viewer import VolumetricVideoViewer import os import sys import glm...
evocodebench_data_81
# Feature Cloud Sequence utilities # This files builds the components for the feature cloud sequence sampler import torch from typing import List, Dict, Union from easyvolcap.utils.console_utils import * from easyvolcap.utils.base_utils import dotdict from easyvolcap.utils.raster_utils import get_ndc_perspective_matr...
evocodebench_data_82
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from easyvolcap.utils.egl_utils import create_opengl_context, eglContextManager # must be imported before OpenGL.GL from easyvolcap.runners.volumetric_video_viewer import VolumetricVideoViewer import os import sys import glm...
evocodebench_data_83
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import torchvision.models.vgg as vgg from collections import namedtuple from easyvolcap.utils.prop_utils import searchsorted, matchup_channels from enum import Enum, auto class ElasticLossReduceType(Enum): WEIGHT = auto() M...
evocodebench_data_84
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import torchvision.models.vgg as vgg from collections import namedtuple from easyvolcap.utils.prop_utils import searchsorted, matchup_channels from enum import Enum, auto class ElasticLossReduceType(Enum): WEIGHT = auto() M...
evocodebench_data_85
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import torchvision.models.vgg as vgg from collections import namedtuple from easyvolcap.utils.prop_utils import searchsorted, matchup_channels from enum import Enum, auto class ElasticLossReduceType(Enum): WEIGHT = auto() M...
evocodebench_data_86
import torch from typing import Tuple, Callable, List def matchup_channels(t: torch.Tensor, w: torch.Tensor): if t.ndim == w.ndim + 1: t = t[..., 0] # remove last dimension if t.shape[-1] != w.shape[-1] + 1: t = torch.cat([t, torch.ones_like(t[..., -1:])], dim=-1) # 65 return t, w @tor...
evocodebench_data_87
import torch from typing import Tuple, Callable, List def matchup_channels(t: torch.Tensor, w: torch.Tensor): if t.ndim == w.ndim + 1: t = t[..., 0] # remove last dimension if t.shape[-1] != w.shape[-1] + 1: t = torch.cat([t, torch.ones_like(t[..., -1:])], dim=-1) # 65 return t, w @tor...
evocodebench_data_88
import torch from typing import Tuple, Callable, List def matchup_channels(t: torch.Tensor, w: torch.Tensor): if t.ndim == w.ndim + 1: t = t[..., 0] # remove last dimension if t.shape[-1] != w.shape[-1] + 1: t = torch.cat([t, torch.ones_like(t[..., -1:])], dim=-1) # 65 return t, w @tor...
evocodebench_data_89
import torch from typing import Tuple, Callable, List def matchup_channels(t: torch.Tensor, w: torch.Tensor): if t.ndim == w.ndim + 1: t = t[..., 0] # remove last dimension if t.shape[-1] != w.shape[-1] + 1: t = torch.cat([t, torch.ones_like(t[..., -1:])], dim=-1) # 65 return t, w @tor...
evocodebench_data_90
import torch from typing import Tuple, Callable, List def matchup_channels(t: torch.Tensor, w: torch.Tensor): if t.ndim == w.ndim + 1: t = t[..., 0] # remove last dimension if t.shape[-1] != w.shape[-1] + 1: t = torch.cat([t, torch.ones_like(t[..., -1:])], dim=-1) # 65 return t, w @tor...
evocodebench_data_91
import os import re import cv2 import h5py import torch import struct import asyncio import subprocess import numpy as np from PIL import Image from io import BytesIO from typing import overload from functools import lru_cache # from imgaug import augmenters as iaa from typing import Tuple, Union, List, Dict from to...
evocodebench_data_92
import math import torch from typing import Callable, Tuple from easyvolcap.utils.console_utils import * def chunkify(chunk_size=1024, key='ray_o', pos=0, dim=-2, merge_dims: bool = False, ignore_mismatch: bool = False, # ignore mismatch in batch dims ...
evocodebench_data_93
import os import re import cv2 import h5py import torch import struct import asyncio import subprocess import numpy as np from PIL import Image from io import BytesIO from typing import overload from functools import lru_cache # from imgaug import augmenters as iaa from typing import Tuple, Union, List, Dict from to...
evocodebench_data_94
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from imgui_bundle import imgui from easyvolcap.runners.volumetric_video_viewer import VolumetricVideoViewer import glm import torch import numpy as np from os.path import join from scipy import interpolate from copy import c...
evocodebench_data_95
from agents.agent_serializer import AgentSerializer from integrations.memoize import memoize_to_sqlite from integrations.sqlite_agent_persistence import SQLiteAgentPersistence class AgentPersistenceManager: def __init__(self, db_filename="agents.db"): self.persistence = SQLiteAgentPersistence(db_filename)...
evocodebench_data_96
import logging import numpy as np from typing import List, Tuple, Optional from sklearn.metrics.pairwise import cosine_similarity from integrations.openaiwrapper import OpenAIAPIWrapper logger = logging.getLogger() class Agent: def __init__(self, purpose: str): self.purpose = purpose self.purpose...
evocodebench_data_97
import logging from typing import List from agents.microagent import MicroAgent from integrations.openaiwrapper import OpenAIAPIWrapper from agents.agent_similarity import AgentSimilarity from agents.agent_persistence_manager import AgentPersistenceManager from numpy import ndarray from prompt_management.prompts import...
evocodebench_data_98
from agents.agent_serializer import AgentSerializer from integrations.memoize import memoize_to_sqlite from integrations.sqlite_agent_persistence import SQLiteAgentPersistence class AgentPersistenceManager: def __init__(self, db_filename="agents.db"): self.persistence = SQLiteAgentPersistence(db_filename)...
evocodebench_data_99
from agents.agent_serializer import AgentSerializer from integrations.memoize import memoize_to_sqlite from integrations.sqlite_agent_persistence import SQLiteAgentPersistence class AgentPersistenceManager: def __init__(self, db_filename="agents.db"): self.persistence = SQLiteAgentPersistence(db_filename)...
evocodebench_data_100
import logging from typing import List from agents.microagent import MicroAgent from integrations.openaiwrapper import OpenAIAPIWrapper from agents.agent_similarity import AgentSimilarity from agents.agent_persistence_manager import AgentPersistenceManager from numpy import ndarray from prompt_management.prompts import...