def IsPrefixLeDecoder(prefix, decoder, name_fcn):
  """Returns true if the prefix is less than or equal to the
     corresponding prefix length of the decoder name."""
  decoder_name = name_fcn(decoder)
  prefix_len = len(prefix)
  decoder_len = len(decoder_name)
  decoder_prefix = (decoder_name[0:prefix_len]
                     if prefix_len < decoder_len
                     else decoder_name)
  return prefix <= decoder_prefix