<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def FetchURNsForAllSignedBinaries(token ):
 """Returns URNs for all signed binaries in the datastore. Args: token: ACL token to use with the legacy (non-relational) datastore. """

  if _ShouldUseLegacyDatastore():
    urns = []
    aff4_roots = [GetAFF4PythonHackRoot(), GetAFF4ExecutablesRoot()]
    for _, descendant_urns in aff4.FACTORY.RecursiveMultiListChildren(
        aff4_roots):
      urns.extend(descendant_urns)
    aff4_streams = aff4.FACTORY.MultiOpen(
        urns, aff4_type=collects.GRRSignedBlob, mode="r", token=token)
    return [stream.urn for stream in aff4_streams]
  else:
    return [
        _SignedBinaryURNFromID(i)
        for i in data_store.REL_DB.ReadIDsForAllSignedBinaries()
    ]