code: def create_cacheable_default_azure_credentials(*args, **kwargs):
      """azure.identity.DefaultAzureCredential is not readily cacheable in a dictionary
      because it does not have a content based hash and equality implementations.
  
      We implement a subclass CacheableDefaultAzureCredential to add them.
  
      We need this because credentials will be part of the cache key in _ClientCache.
      """
      from azure.identity import DefaultAzureCredential
  
      class CacheableDefaultAzureCredential(DefaultAzureCredential):
          def __init__(self, *args, **kwargs):
              super(CacheableDefaultAzureCredential, self).__init__(
                  *args, **kwargs
              )
              # Just hashing all the kwargs works because they are all individually
              # hashable as of 7/15/2022.
              #
              # What if Azure adds unhashable things to kwargs?
              # - We will have CI to catch this (it will always install the latest Azure SDKs)
              # - In Metaflow usage today we never specify any kwargs anyway. (see last line
              #   of the outer function.
              self._hash_code = hash(
                  (args, tuple(sorted(kwargs.items())))
              )
  
          def __hash__(self):
              return self._hash_code
  
          def __eq__(self, other):
              return hash(self) == hash(other)
  
      return CacheableDefaultAzureCredential(*args, **kwargs)
  
file_path: metaflow/metaflow/plugins/azure/azure_utils.py
imports: import sys
  import time
  from metaflow.plugins.azure.azure_exceptions import MetaflowAzureAuthenticationError, MetaflowAzureResourceError, MetaflowAzurePackageError
  from metaflow.exception import MetaflowInternalError, MetaflowException
label_desc: Use image node_id 6 for calling a global function with example usage: create_cacheable_default_azure_credentials() and returns: CacheableDefaultAzureCredential, self, unknown