code: def obtain_credentials(credentials):
      
      if credentials == "-":
          credentials = sys.stdin.readline().strip()
      elif credentials is None:
          credentials = try_getpass(
              "API key (leave empty for anonymous access): ")
      # Ensure that the credentials have a valid form.
      if credentials and not credentials.isspace():
          return Credentials.parse(credentials)
      else:
          return None
docs: Prompt for credentials if possible.
  
      If the credentials are "-" then read from stdin without interactive
      prompting.