<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mutable_record_transform(cls):
 """Transform mutable records usage by updating locals."""

  if not (len(cls.bases) > 0
          and isinstance(cls.bases[0], astroid.Call)
          and cls.bases[0].func.as_string() == 'mutablerecords.Record'):
    return

  try:
    # Add required attributes.
    if len(cls.bases[0].args) >= 2:
      for a in cls.bases[0].args[1].elts:
        cls.locals[a] = [None]

    # Add optional attributes.
    if len(cls.bases[0].args) >= 3:
      for a,b in cls.bases[0].args[2].items:
        cls.locals[a.value] = [None]

  except:
    raise SyntaxError('Invalid mutablerecords syntax')