code: def _SignedBinaryIDFromURN(binary_urn
                            ):
    
    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)
docs: Converts an AFF4 URN for a signed binary to a SignedBinaryID.