code: def logs(job_id, polling_interval):
      account = ServiceAccount()
      cloudlog = account.cloud_service("logging", "v2")
  
      job_filter = 'resource.labels.job_id = "{}"'.format(job_id)
      last_timestamp = None
      while True:
          filters = [job_filter]
          if last_timestamp:
              filters.append('timestamp > "{}"'.format(last_timestamp))
  
          # Fetch all pages.
          entries = []
          next_page = None
          while True:
              request = cloudlog.entries().list(
                  body={
                      "resourceNames": "projects/{}".format(
                          account.project_id
                      ),
                      "filter": " AND ".join(filters),
                      "pageToken": next_page,
                  }
              )
  
              try:
                  response = request.execute()
                  next_page = response.get("nextPageToken", None)
                  entries.extend(response.get("entries", []))
                  if not next_page:
                      break
              except Exception as err:
                  click.echo(
                      "There was an error fetching the logs. "
                      "Check the details: \n{}".format(
                          err._get_reason()
                      ),
                      err=True,
                  )
                  break
  
          for entry in entries:
              last_timestamp = entry["timestamp"]
  
              if "jsonPayload" in entry:
                  message = entry["jsonPayload"]["message"]
              elif "textPayload" in entry:
                  message = entry["textPayload"]
              else:
                  continue
  
              click.echo(
                  "{:30} :: {:7} :: {}".format(
                      entry["timestamp"],
                      entry["severity"],
                      message.strip(),
                  )
              )
  
          time.sleep(polling_interval)
  
imports: import click
  import json
  import luminoth
  import os
  import shutil
  import subprocess
  import sys
  import tempfile
  import tensorflow
  import time
  from datetime import datetime
  from functools import wraps
  from luminoth.utils.config import get_config, dump_config
  from luminoth.utils.experiments import save_run
label_desc: Use image node_id 9 for calling a global function with example usage: logs(job_id, polling_interval) without return types