code: def get_jobs(
      job: Union[str, List[str], None],
      tags: List[str],
      *,
      exclude_tags: Optional[List[str]] = None,
      is_master: bool = True,
      is_running: bool = True,
  ) -> List[str]:
      if isinstance(job, str):
          return [job]
      elif job:
          return job
  
      if not tags:
          click.echo("No tags provided")
  
      if exclude_tags is None:
          exclude_tags = ["__hidden__"]
      jobs = JOBS.filter_by_tags(tags)
      jobs = JOBS.filter_out_by_tags(exclude_tags, jobs)
      if is_master:
          master_jobs = JOBS.filter_by_tags(["master"], jobs)
          if 0 < len(master_jobs) < len(jobs):
              click.echo(
                  f"Selecting jobs tagged 'master' {len(master_jobs)}/{len(jobs)}"
              )
              jobs = master_jobs
      if is_running:
          running_jobs = JOBS.filter_running(jobs)
          if 0 < len(running_jobs) < len(jobs):
              click.echo(
                  f"Selecting running jobs {len(running_jobs)}/{len(jobs)}"
              )
              jobs = running_jobs
  
      return [j.job_key for j in jobs]
  
file_path: labml/remote/labml_remote/cli/util.py
imports: from typing import Union, List, Tuple, Optional
  import click
  from labml.logger import Text
  from labml_remote.configs import Configs
  from labml_remote.job import JOBS, Job
  from labml_remote.server import SERVERS
label_desc: Use image node_id 4 for calling a global function with example usage: get_jobs(job, tags) and returns: unknown, list, job