code: def _get_startup_script(
      self,
      resources_needed,
      queue_name,
      autoscaling_group=None,
      timeout=300,
  ):
      if self.auth_cookie is not None:
          auth_key = os.path.basename(self.auth_cookie)
          with open(self.auth_cookie, "r") as f:
              auth_data = f.read()
      else:
          auth_key = None
          auth_data = None
  
      credentials = ""
  
      if "GOOGLE_APPLICATION_CREDENTIALS" in os.environ.keys():
          with open(
              os.environ["GOOGLE_APPLICATION_CREDENTIALS"], "r"
          ) as f:
              credentials = f.read()
      else:
          self.logger.info("credentials NOT found")
  
      with open(self.startup_script_file) as f:
          startup_script = f.read()
  
      with open(self.install_studio_script) as f:
          install_studio_script = f.read()
  
      startup_script = startup_script.replace(
          "{install_studio}", install_studio_script
      )
  
      startup_script = startup_script.format(
          auth_key=auth_key if auth_key else "",
          queue_name=queue_name,
          auth_data=base64.b64encode(auth_data.encode("utf-8")).decode(
              "utf-8"
          )
          if auth_data
          else "",
          google_app_credentials=base64.b64encode(
              credentials.encode("utf-8")
          ).decode("utf-8"),
          aws_access_key=self.client._request_signer._credentials.access_key,
          aws_secret_key=self.client._request_signer._credentials.secret_key,
          autoscaling_group=autoscaling_group
          if autoscaling_group
          else "",
          region=self.region,
          use_gpus=0 if resources_needed["gpus"] == 0 else 1,
          timeout=timeout,
          repo_url=self.repo_url,
          studioml_branch=self.branch,
      )
  
      startup_script = insert_user_startup_script(
          self.user_startup_script, startup_script, self.logger
      )
  
      self.logger.info("Startup script:")
      self.logger.info(startup_script)
  
      return startup_script
  
imports: import uuid
  import os
  import base64
  import json
  import yaml
  import six
  import filelock
  import hashlib
  import pickle
  from studio import git_util
  from studio.util import logs
  from studio.storage import storage_util
  from studio.util.gpu_util import memstr2int
  from .cloud_worker_util import insert_user_startup_script
label_desc: Use image node_id 6 for calling the EC2WorkerManager obj's underlying member method code with example usage: obj._get_startup_script(resources_needed, queue_name, autoscaling_group, timeout) and returns: startup_script