def OpenClient(client_id=None, token=None):
  if not token:
    try:
      token = ApprovalFind(client_id, token=token)
    except access_control.UnauthorizedAccess as e:
      logging.debug("No authorization found for access to client: %s", e)

  try:
    # Try and open with the token we managed to retrieve or the default.
    client = aff4.FACTORY.Open(rdfvalue.RDFURN(client_id), mode="r",
                               token=token)
    return client, token
  except access_control.UnauthorizedAccess:
    logging.warning("Unable to find a valid reason for client %s. You may need "
                    "to request approval.", client_id)
    return None, None
Read size bytes of data. Always strip off the last record and
dataset/ETHPy150Open google/grr/grr/lib/console_utils.py/OpenClient--crossover with--dataset/ETHPy150Open FishPi/FishPi-POCV---Command---Control/external/pynmea/streamer.py/NMEAStream._read