def get_parent_build(build):
  """Returns the parent build for a triggered build."""
  parent_buildername = build.properties_as_dict['parent_buildername']
  parent_builder = build.builders[parent_buildername]
  return parent_builder.builds[build.properties_as_dict['parent_buildnumber']]