def _transform_to_thrift_code(f):
  """
  TODO: Fix MH importer or CombineEventAndSnapshot.
  This is a bit of tech debt that should be addressed at some point. The MH importer expects
  a Thrift code, and the CombineEventAndSnapshot outputs a string. This function ensures that
  all strings are correctly converted.
  """
  if f in c.enrollmentStateToThrift:
    return c.enrollmentStateToThrift[f]
  return f

  TODO: Fix MH importer or CombineEventAndSnapshot.
  This is a bit of tech debt that should be addressed at some point. The MH importer expects
  a Thrift code, and the CombineEventAndSnapshot outputs a string. This function ensures that
  all strings are correctly converted.
  
sourcecode/scoring/contributor_state.py