inputs stringlengths 312 52k | targets stringlengths 1 3.1k ⌀ | block_type stringclasses 11
values | scenario stringclasses 7
values |
|---|---|---|---|
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... |
return target_type.model_validate(data) | TRY | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... |
return target_type(**data) | TRY | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/trackers/abc_buffered_logger.py<fim_prefix>import json
from abc import abstractmethod
from typing import Dict, Any, Literal
from tanuki.bloom_filter import BloomFilter
from tanuki.constants import EXPECTED_ITEMS, FALSE_POSITIVE_RATE, ALIGN_FILE_EXTENSION, \
POSITIVE_FILE_EXTENSION, N... |
self.ensure_persistence_location_exists() | TRY | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... |
return False | CATCH | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... |
continue | CATCH | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | (ValueError, TypeError):
pass | CATCH | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | Exception as e:
print(e)
return False | CATCH | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | (ValueError, TypeError):
pass | CATCH | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | AttributeError as e:
# backwards compatibility with pydantic < 2
return target_type.parse_obj(data) | CATCH | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | json.JSONDecodeError:
return False | CATCH | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/language_models/openai_api.py<fim_prefix>from typing import List
import logging
import time
# import abstract base class
from openai import OpenAI
from openai.types import CreateEmbeddingResponse
from openai.types.fine_tuning import FineTuningJob
from tanuki.language_models.llm_finetune... | Exception as e:
if ("error" in response and
"code" in response["error"] and
response["error"]["code"] == 'invalid_api_key'):
raise Exception(f"The supplied OpenAI API key {self.api_key} is invalid")
if counter == 5:
... | CATCH | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | ValueError:
raise TypeError(
f"Item of type {type(item).__name__} does not match expected type {item_type[0].__name__}.") | CATCH | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | TypeError:
raise TypeError(f"Failed to instantiate {target_type.__name__} from dictionary.") | CATCH | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | arg in get_args(target_type):
try:
return self.instantiate(data, arg)
except:
continue | FOR | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/bloom_filter.py<fim_prefix>import hashlib
import logging
import math
import numpy as np
from bitarray import bitarray
from tanuki.persistence.filter.bloom_interface import IBloomFilterPersistence
class BloomFilter:
def __init__(self,
persistence: IBloomFilterPers... | seed in range(self.hash_count):
index = (hash1 + seed * hash2) % self.size
self.bit_array[index] = 1
#print(f"Add: Seed={seed}, Digest={index}, BitValue={self.bit_array[index]}") | FOR | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | item in data:
# For each item, validate and instantiate it
instantiated_item = self.instantiate(item, item_type[0])
instantiated_items.add(instantiated_item)
# If the instantiated item does not match the expected type, rai... | FOR | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | i, item in enumerate(data):
# For each item, validate and instantiate it
instantiated_item = self.instantiate(item, item_types[i])
instantiated_items.append(instantiated_item)
# If the instantiated item does not match the ... | FOR | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | item in data:
# For each item, validate and instantiate it
try:
instantiated_item = self.instantiate(item, item_type)
except ValueError:
raise TypeError(
f"Ite... | FOR | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/validator.py<fim_prefix>import abc
from collections import defaultdict
import collections
import typing
from collections import deque
import dataclasses
import inspect
import json
from dataclasses import is_dataclass
from typing import get_origin, get_args, Any, Mapping, MutableMapping, O... | base in target_type.__orig_bases__:
if get_args(base):
return base, get_args(base) | FOR | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>tanuki_py/src/tanuki/language_models/openai_api.py<fim_prefix>from typing import List
import logging
import time
# import abstract base class
from openai import OpenAI
from openai.types import CreateEmbeddingResponse
from openai.types.fine_tuning import FineTuningJob
from tanuki.language_models.llm_finetune... | counter <= 5:
try:
openai_headers = {
"Authorization": f"Bearer {self.api_key}",
"Content-Type": "application/json",
}
response = requests.post(
OPENAI_URL, headers=openai_headers, json=params, timeo... | WHILE | prefix_full_suffix_empty_complete_current_block_no_evidence |
<filename>UHGEval/uhgeval/dataset/truthfulqa.py<fim_prefix># @Author : YeZhaohui Wang
# @Email : wyzh0912@126.com
import csv
import json
import os
import random
from uhgeval.dataset.base import BaseDataset
class TruthfunQAGeneration(BaseDataset):
def __init__(self, path: str, shuffle: bool = False, seed: int =... | = | STATEMENT | complete_current_header_inner_block_completion |
<filename>UHGEval/uhgeval/metric/common.py<fim_prefix># @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:
... | accuracy, precision, recall, | STATEMENT | complete_current_header_inner_block_completion |
<filename>UHGEval/uhgeval/metric/common.py<fim_prefix># @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:
... | 2 * (precision * recall) / | STATEMENT | complete_current_header_inner_block_completion |
<filename>UHGEval/uhgeval/metric/common.py<fim_prefix># @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:
... | sum(1 for a, b in zip(references, predictions) if a == 0 and b == | STATEMENT | complete_current_header_inner_block_completion |
<filename>UHGEval/uhgeval/metric/common.py<fim_prefix># @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:
... | == b) | STATEMENT | complete_current_header_inner_block_completion |
<filename>UHGEval/uhgeval/metric/common.py<fim_prefix># @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:
... | for a, b in zip(references, predictions) if a == 1 | STATEMENT | complete_current_header_inner_block_completion |
<filename>UHGEval/uhgeval/metric/common.py<fim_prefix># @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:
... | / (true_positive + false_positive) if (true_positive + false_positive) > | STATEMENT | complete_current_header_inner_block_completion |
<filename>UHGEval/uhgeval/metric/common.py<fim_prefix># @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:
... | recall == | IF | complete_current_header_inner_block_completion |
<filename>UHGEval/uhgeval/metric/common.py<fim_prefix># @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:
... | Exception | CATCH | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/bbox_iou_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
from typing import List
import numpy as np
import torch
from detectron2.config import configurable
from detectron2.structures import Boxes, Instances
from detec... | += | STATEMENT | complete_current_header_inner_block_completion |
<filename>UniRef/external/davis2017-evaluation/davis2017/metrics.py<fim_prefix>import math
import numpy as np
import cv2
def db_eval_iou(annotation, segmentation, void_pixels=None):
""" Compute region similarity as the Jaccard Index.
Arguments:
annotation (ndarray): binary annotation map.
... | = np.sum((segmentation | STATEMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/layers/losses.py<fim_prefix>import math
import torch
def diou_loss(
boxes1: torch.Tensor,
boxes2: torch.Tensor,
reduction: str = "none",
eps: float = 1e-7,
) -> torch.Tensor:
"""
Distance Intersection over Union Loss (Zhaohui Zheng et. al)
https://arxiv.org/abs/... | = (xkis2[mask] - xkis1[mask]) * (ykis2[mask] | STATEMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/layers/losses.py<fim_prefix>import math
import torch
def diou_loss(
boxes1: torch.Tensor,
boxes2: torch.Tensor,
reduction: str = "none",
eps: float = 1e-7,
) -> torch.Tensor:
"""
Distance Intersection over Union Loss (Zhaohui Zheng et. al)
https://arxiv.org/abs/... | = torch.min(x1, | STATEMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/hungarian_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
import numpy as np
import torch
from detectron2.structures import Boxes, Instances
from .base_tracker import BaseTracker
from scipy.optimize import linear_sum... | = | STATEMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/checkpoint/c2_model_loading.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import re
from typing import Dict, List
import torch
from tabulate import tabulate
def convert_basic_c2_names(original_keys):
"""
Apply some basic name conversion... | = min(names), | STATEMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/structures/masks.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import copy
import itertools
import numpy as np
from typing import Any, Iterator, List, Union
import pycocotools.mask as mask_util
import torch
from torch import device
from detectron2.layers.roi_align import ... | = | STATEMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/layers/losses.py<fim_prefix>import math
import torch
def diou_loss(
boxes1: torch.Tensor,
boxes2: torch.Tensor,
reduction: str = "none",
eps: float = 1e-7,
) -> torch.Tensor:
"""
Distance Intersection over Union Loss (Zhaohui Zheng et. al)
https://arxiv.org/abs/... | + x2g) / | STATEMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/hungarian_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
import numpy as np
import torch
from detectron2.structures import Boxes, Instances
from .base_tracker import BaseTracker
from scipy.optimize import linear_sum... | not | IF | complete_current_header_inner_block_completion |
<filename>UniRef/external/davis2017-evaluation/davis2017/metrics.py<fim_prefix>import math
import numpy as np
import cv2
def db_eval_iou(annotation, segmentation, void_pixels=None):
""" Compute region similarity as the Jaccard Index.
Arguments:
annotation (ndarray): binary annotation map.
... | precision + | IF | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/config/config.py<fim_prefix># -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
import functools
import inspect
import logging
from fvcore.common.config import CfgNode as _CfgNode
from detectron2.utils.file_io import PathManager
class CfgNode(_CfgNode):
"""
... | # forward all | IF | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/bbox_iou_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
from typing import List
import numpy as np
import torch
from detectron2.config import configurable
from detectron2.structures import Boxes, Instances
from detec... | not | IF | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/config/instantiate.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import dataclasses
import logging
from collections import abc
from typing import Any
from detectron2.utils.registry import _convert_target_to_string, locate
__all__ = ["dump_dataclass", "instantiate"]
def... | isinstance(cls, | IF | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/bbox_iou_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
from typing import List
import numpy as np
import torch
from detectron2.config import configurable
from detectron2.structures import Boxes, Instances
from detec... | not | IF | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/structures/instances.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import itertools
from typing import Any, Dict, List, Tuple, Union
import torch
class Instances:
"""
This class represents a list of instances in an image.
It stores the attributes of instances... | == "_fields" or name not | IF | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/bbox_iou_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
from typing import List
import numpy as np
import torch
from detectron2.config import configurable
from detectron2.structures import Boxes, Instances
from detec... | not | IF | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/bbox_iou_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
from typing import List
import numpy as np
import torch
from detectron2.config import configurable
from detectron2.structures import Boxes, Instances
from detec... | is | IF | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/structures/boxes.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import math
import numpy as np
from enum import IntEnum, unique
from typing import List, Tuple, Union
import torch
from torch import device
_RawBoxType = Union[List[float], Tuple[float, ...], torch.Tensor, np.... | consequently confuses | LINE_COMMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/checkpoint/c2_model_loading.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import re
from typing import Dict, List
import torch
from tabulate import tabulate
def convert_basic_c2_names(original_keys):
"""
Apply some basic name conversion... | hidden representation | LINE_COMMENT | complete_current_header_inner_block_completion |
<filename>UniRef/external/davis2017-evaluation/davis2017/metrics.py<fim_prefix>import math
import numpy as np
import cv2
def db_eval_iou(annotation, segmentation, void_pixels=None):
""" Compute region similarity as the Jaccard Index.
Arguments:
annotation (ndarray): binary annotation map.
... | both | LINE_COMMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/checkpoint/c2_model_loading.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import re
from typing import Dict, List
import torch
from tabulate import tabulate
def convert_basic_c2_names(original_keys):
"""
Apply some basic name conversion... | ckpt_key string, | LINE_COMMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/iou_weighted_hungarian_bbox_iou_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
from typing import List
import numpy as np
from .base_tracker import TRACKER_HEADS_REGISTRY
from .vanilla_hungarian_bbox_iou_tracker import Vanilla... | * IoU) for above threshold pairs, algorithms | LINE_COMMENT | complete_current_header_inner_block_completion |
<filename>UniRef/external/davis2017-evaluation/davis2017/metrics.py<fim_prefix>import math
import numpy as np
import cv2
def db_eval_iou(annotation, segmentation, void_pixels=None):
""" Compute region similarity as the Jaccard Index.
Arguments:
annotation (ndarray): binary annotation map.
... | all | LINE_COMMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/checkpoint/c2_model_loading.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import re
from typing import Dict, List
import torch
from tabulate import tabulate
def convert_basic_c2_names(original_keys):
"""
Apply some basic name conversion... | prediction weight for | LINE_COMMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/config/instantiate.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import dataclasses
import logging
from collections import abc
from typing import Any
from detectron2.utils.registry import _convert_target_to_string, locate
__all__ = ["dump_dataclass", "instantiate"]
def... | don't know what | LINE_COMMENT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/structures/masks.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import copy
import itertools
import numpy as np
from typing import Any, Iterator, List, Union
import pycocotools.mask as mask_util
import torch
from torch import device
from detectron2.layers.roi_align import ... | polygons_per_instance | FOR | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/checkpoint/c2_model_loading.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import re
from typing import Dict, List
import torch
from tabulate import tabulate
def convert_basic_c2_names(original_keys):
"""
Apply some basic name conversion... | idx_model, idx_ckpt in | FOR | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/structures/masks.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import copy
import itertools
import numpy as np
from typing import Any, Iterator, List, Union
import pycocotools.mask as mask_util
import torch
from torch import device
from detectron2.layers.roi_align import ... | in | FOR | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/utils.py<fim_prefix>#!/usr/bin/env python3
from detectron2.structures import Instances
import numpy as np
from typing import List
def create_prediction_pairs(
instances: Instances,
prev_instances: Instances,
iou_all: np.ndarray,
threshold: float = 0.5,
) -> List:
... | j in | FOR | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/bbox_iou_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
from typing import List
import numpy as np
import torch
from detectron2.config import configurable
from detectron2.structures import Boxes, Instances
from detec... | j | FOR | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/bbox_iou_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
from typing import List
import numpy as np
import torch
from detectron2.config import configurable
from detectron2.structures import Boxes, Instances
from detec... | bbox_pair in | FOR | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/hungarian_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
import numpy as np
import torch
from detectron2.structures import Boxes, Instances
from .base_tracker import BaseTracker
from scipy.optimize import linear_sum... | i in | FOR | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/bbox_iou_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
from typing import List
import numpy as np
import torch
from detectron2.config import configurable
from detectron2.structures import Boxes, Instances
from detec... | in | FOR | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/tracking/hungarian_tracker.py<fim_prefix>#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import copy
import numpy as np
import torch
from detectron2.structures import Boxes, Instances
from .base_tracker import BaseTracker
from scipy.optimize import linear_sum... | idx | FOR | complete_current_header_inner_block_completion |
<filename>UniRef/external/davis2017-evaluation/davis2017/metrics.py<fim_prefix>import math
import numpy as np
import cv2
def db_eval_iou(annotation, segmentation, void_pixels=None):
""" Compute region similarity as the Jaccard Index.
Arguments:
annotation (ndarray): binary annotation map.
... | y in | FOR | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/config/instantiate.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import dataclasses
import logging
from collections import abc
from typing import Any
from detectron2.utils.registry import _convert_target_to_string, locate
__all__ = ["dump_dataclass", "instantiate"]
def... | omegaconf import | IMPORT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/layers/roi_align.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
from torch import nn
from torchvision.ops import roi_align
# NOTE: torchvision's RoIAlign has a different default aligned=False
class ROIAlign(nn.Module):
def __init__(self, output_size, spatial_scale, sa... | import | IMPORT | complete_current_header_inner_block_completion |
<filename>UniRef/external/davis2017-evaluation/davis2017/metrics.py<fim_prefix>import math
import numpy as np
import cv2
def db_eval_iou(annotation, segmentation, void_pixels=None):
""" Compute region similarity as the Jaccard Index.
Arguments:
annotation (ndarray): binary annotation map.
... | skimage.morphology import | IMPORT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/utils/registry.py<fim_prefix># 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 cal... | import | IMPORT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/config/config.py<fim_prefix># -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
import functools
import inspect
import logging
from fvcore.common.config import CfgNode as _CfgNode
from detectron2.utils.file_io import PathManager
class CfgNode(_CfgNode):
"""
... | .defaults import | IMPORT | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/checkpoint/c2_model_loading.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import re
from typing import Dict, List
import torch
from tabulate import tabulate
def convert_basic_c2_names(original_keys):
"""
Apply some basic name conversion... | match(a, | METHOD | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/config/config.py<fim_prefix># -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
import functools
import inspect
import logging
from fvcore.common.config import CfgNode as _CfgNode
from detectron2.utils.file_io import PathManager
class CfgNode(_CfgNode):
"""
... | wrapped(self, | METHOD | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/structures/masks.py<fim_prefix># Copyright (c) Facebook, Inc. and its affiliates.
import copy
import itertools
import numpy as np
from typing import Any, Iterator, List, Union
import pycocotools.mask as mask_util
import torch
from torch import device
from detectron2.layers.roi_align import ... | np.ndarray]) | METHOD | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/config/config.py<fim_prefix># -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
import functools
import inspect
import logging
from fvcore.common.config import CfgNode as _CfgNode
from detectron2.utils.file_io import PathManager
class CfgNode(_CfgNode):
"""
... | wrapped(*args, | METHOD | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/utils/registry.py<fim_prefix># 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 cal... | ImportError as | CATCH | complete_current_header_inner_block_completion |
<filename>UniRef/detectron2/config/config.py<fim_prefix># -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
import functools
import inspect
import logging
from fvcore.common.config import CfgNode as _CfgNode
from detectron2.utils.file_io import PathManager
class CfgNode(_CfgNode):
"""
... | AttributeError | CATCH | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/spin_math.py<fim_prefix># 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.... | to | BLOCK_COMMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/stepfun.py<fim_prefix># 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.or... | all weight | BLOCK_COMMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/render.py<fim_prefix># 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... | intervals along a conical frustum | BLOCK_COMMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/math.py<fim_prefix># 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/l... | clipped | BLOCK_COMMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/linspline.py<fim_prefix># 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.... | a linear spline | BLOCK_COMMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/ref_utils.py<fim_prefix># 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.... | spherical | BLOCK_COMMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/math.py<fim_prefix># 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/l... | using the gradient | BLOCK_COMMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/render.py<fim_prefix># 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... | cylinder | BLOCK_COMMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/coord.py<fim_prefix># 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/... | the | BLOCK_COMMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/math.py<fim_prefix># 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/l... | `x` from below to | BLOCK_COMMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/coord.py<fim_prefix># 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/... | not | IF | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/stepfun.py<fim_prefix># 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.or... | rng is | IF | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/utils.py<fim_prefix># 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/... | not populating_data | IF | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/coord.py<fim_prefix># 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/... | == | IF | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/utils.py<fim_prefix># 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/... | not populating_data | IF | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/coord.py<fim_prefix># 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/... | is | IF | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/geopoly.py<fim_prefix># 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.or... | is | IF | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/stepfun.py<fim_prefix># 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.or... | = jnp.diff(acc_wq, | STATEMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/geopoly.py<fim_prefix># 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.or... | /= np.sqrt(np.sum(new_verts**2, | STATEMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/linspline.py<fim_prefix># 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.... | :1]), c1], | STATEMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/math.py<fim_prefix># 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/l... | safe_trig_helper(x, | STATEMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/math.py<fim_prefix># 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/l... | = | STATEMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/ref_utils.py<fim_prefix># 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.... | sph_harms * | STATEMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/ref_utils.py<fim_prefix># 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.... | = jnp.concatenate([z**i for i | STATEMENT | complete_current_header_inner_block_completion |
<filename>camp_zipnerf/internal/coord.py<fim_prefix># 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/... | jnp.maximum(1, jnp.sum(z**2, | STATEMENT | complete_current_header_inner_block_completion |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.