code: def test_geteitherattr(output, key, default):
      @dataclass
      class MockObject:
          my_key = "MockValue"
  
      _self = MockObject()
  
      try:
          value = geteitherattr(
              _self=_self, output=output, key=key, default=default
          )
          if key == "not_my_key":
              if default == NotNone:
                  assert value == _self.my_key
              else:
                  assert value == default
          else:
              value = geteitherattr(
                  _self=_self, output=output, key=key, default=default
              )
  
              assert value == output["my_key"]
      except Exception as error:
          assert isinstance(error, AttributeError)
  
imports: from dataclasses import dataclass
  from types import FunctionType
  from typing import Callable
  from typing import Optional
  from pydantic import EmailError
  from pydantic import EmailStr
  import pytest
  from syft.types.transforms import NotNone
  from syft.types.transforms import TransformContext
  from syft.types.transforms import add_credentials_for_key
  from syft.types.transforms import add_node_uid_for_key
  from syft.types.transforms import drop
  from syft.types.transforms import generate_id
  from syft.types.transforms import geteitherattr
  from syft.types.transforms import keep
  from syft.types.transforms import make_set_default
  from syft.types.transforms import rename
  from syft.types.transforms import validate_email
  from syft.types.transforms import validate_url
  from syft.types.uid import UID
label_desc: Use image node_id 2 for calling a global function with example usage: test_geteitherattr(output, key, default) without return types