code: def _region_from_key_id(key_id, default_region=None):
      
      try:
          region_name = key_id.split(":", 4)[3]
      except IndexError:
          if default_region is None:
              raise UnknownRegionError(
                  "No default region found and no region determinable from key id: {}".format(key_id)
              )
          region_name = default_region
      return region_name
docs: Determine the target region from a key ID, falling back to a default region if provided.
  
      :param str key_id: AWS KMS key ID
      :param str default_region: Region to use if no region found in key_id
      :returns: region name
      :rtype: str
      :raises UnknownRegionError: if no region found in key_id and no default_region provided