code: def _capabilities_dict(envs, tags):
      
      capabilities = {
          'browserName': envs['SELENIUM_BROWSER'],
          'acceptInsecureCerts': bool(envs.get('SELENIUM_INSECURE_CERTS', False)),
          'video-upload-on-pass': False,
          'sauce-advisor': False,
          'capture-html': True,
          'record-screenshots': True,
          'max-duration': 600,
          'public': 'public restricted',
          'tags': tags,
      }
  
      # Add SauceLabs specific environment vars if they are set.
      if _use_remote_browser(SAUCE_ENV_VARS):
          sauce_capabilities = {
              'platform': envs['SELENIUM_PLATFORM'],
              'version': envs['SELENIUM_VERSION'],
              'username': envs['SAUCE_USER_NAME'],
              'accessKey': envs['SAUCE_API_KEY'],
          }
  
          capabilities.update(sauce_capabilities)
  
      # Optional: Add in Jenkins-specific environment variables
      # to link Sauce output with the Jenkins job
      if 'JOB_NAME' in envs:
          jenkins_vars = {
              'build': envs['BUILD_NUMBER'],
              'name': envs['JOB_NAME'],
          }
  
          capabilities.update(jenkins_vars)
  
      return capabilities
docs: Convert the dictionary of environment variables to
      a dictionary of desired capabilities to send to the
      Remote WebDriver.
  
      `tags` is a list of string tags to apply to the SauceLabs job.