code: def _find_instance_in_args(backend: str, args, array_indices, mask):
      """Find the first element in the arguments that is considered to be an
      instance of Array or Container class.
  
      Parameters
      ----------
      args
          Arguments to iterate over
      array_indices
          Indices of arrays that exists in the args
      mask
          Boolean mask for whether the corresponding element in (args) has a
          generated test_flags.native_array as False or test_flags.container as
          true
  
      Returns
      -------
          First found instance in the arguments and the updates arguments not
          including the instance
      """
      i = 0
      for i, a in enumerate(mask):
          if a:
              break
      instance_idx = array_indices[i]
      with BackendHandler.update_backend(backend) as ivy_backend:
          instance = ivy_backend.index_nest(args, instance_idx)
          new_args = ivy_backend.copy_nest(args, to_mutable=False)
          ivy_backend.prune_nest_at_index(new_args, instance_idx)
      return instance, new_args
  
imports: import copy
  import time
  from typing import Union, List, Optional
  import numpy
  import types
  import importlib
  import inspect
  from collections import OrderedDict
  from .globals import mod_backend
  from .pipeline_helper import BackendHandler, BackendHandlerMode, get_frontend_config
  import ivy
  from ivy_tests.test_ivy.helpers.test_parameter_flags import FunctionTestFlags
  import ivy_tests.test_ivy.helpers.test_parameter_flags
  import ivy_tests.test_ivy.helpers.globals
  from ivy.functional.ivy.data_type import _get_function_list, _get_functions_from_string
  from ivy_tests.test_ivy.test_frontends import NativeClass
  from ivy_tests.test_ivy.helpers.structs import FrontendMethodData
  from ivy_tests.test_ivy.helpers.testing_helpers import _create_transpile_report
  from .assertions import value_test, assert_same_type, check_unsupported_dtype
label_desc: Use image node_id 2 for calling a global function with example usage: _find_instance_in_args(backend, args, array_indices, mask) and returns: instance,  new_args