<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _SignedBinaryIDFromURN(binary_urn ):
 """Converts an AFF4 URN for a signed binary to a SignedBinaryID."""

  if binary_urn.RelativeName(GetAFF4PythonHackRoot()):
    return rdf_objects.SignedBinaryID(
        binary_type=rdf_objects.SignedBinaryID.BinaryType.PYTHON_HACK,
        path=binary_urn.RelativeName(GetAFF4PythonHackRoot()))
  elif binary_urn.RelativeName(GetAFF4ExecutablesRoot()):
    return rdf_objects.SignedBinaryID(
        binary_type=rdf_objects.SignedBinaryID.BinaryType.EXECUTABLE,
        path=binary_urn.RelativeName(GetAFF4ExecutablesRoot()))
  else:
    raise ValueError("Unable to determine type of signed binary: %s." %
                     binary_urn)