def lookup_dashboard(stackdriver, display_name):
  """Find the dashboard definition with the given display_name."""
  parent = 'projects/{0}'.format(stackdriver.project)
  dashboards = stackdriver.stub.projects().dashboards()
  request = dashboards.list(parent=parent)
  while request:
    response = request.execute()
    for elem in response.get('dashboards', []):
      if elem['displayName'] == display_name:
        return elem
      request = dashboards.list_next(request, response)
  return None