code: def name_replace(records, search_regex, replace_pattern):
      
      regex = re.compile(search_regex)
      for record in records:
          maybe_id = record.description.split(None, 1)[0]
          if maybe_id == record.id:
              record.description = regex.sub(replace_pattern, record.description)
              record.id = record.description.split(None, 1)[0]
          else:
              record.id = regex.sub(replace_pattern, record.id)
              record.description = regex.sub(replace_pattern, record.description)
          yield record
docs: Given a set of sequences, replace all occurrences of search_regex
      with replace_pattern. Ignore case.
  
      If the ID and the first word of the description match, assume the
      description is FASTA-like and apply the transform to the entire
      description, then set the ID from the first word. If the ID and
      the first word of the description do not match, apply the transform
      to each individually.