parameters: (stack_id, deployment_only=False)
return_statement: return tags
docstring: Generate tags for project, deployment and gem
docstring_summary: Generate tags for project, deployment and gem
docstring_tokens: Generate tags for project deployment and gem
function: def _generate_table_tags(stack_id, deployment_only=False):
      """Generate tags for project, deployment and gem"""
      stack_manager = stack_info.StackInfoManager()
      stack = stack_manager.get_stack_info(stack_id)
  
      tags = None
  
      if stack.stack_type == stack_info.StackInfo.STACK_TYPE_RESOURCE_GROUP:
          deployment_name = stack.deployment.deployment_name
          resource_group_name = stack.resource_group_name
          tags = [
              {
                  'Key': constant.DEPLOYMENT_TAG,
                  'Value': deployment_name
              },
              {
                  'Key': constant.DEPLOYMENT_GEM_TAG,
                  'Value': resource_group_name
              }
          ]
  
      # Maintain legacy behavior of only generating deployment tags
      if deployment_only and tags is None:
          return tags
  
      tags = tags + [
          {"Key": constant.PROJECT_NAME_TAG, "Value": stack.project_stack.project_name},
          {"Key": constant.STACK_ID_TAG, "Value": stack_id}
      ]
      return tags
function_tokens: def _generate_table_tags ( stack_id , deployment_only = False ) : stack_manager = stack_info . StackInfoManager ( ) stack = stack_manager . get_stack_info ( stack_id ) tags = None if stack . stack_type == stack_info . StackInfo . STACK_TYPE_RESOURCE_GROUP : deployment_name = stack . deployment . deployment_name resource_group_name = stack . resource_group_name tags = [ { 'Key' : constant . DEPLOYMENT_TAG , 'Value' : deployment_name } , { 'Key' : constant . DEPLOYMENT_GEM_TAG , 'Value' : resource_group_name } ] # Maintain legacy behavior of only generating deployment tags if deployment_only and tags is None : return tags tags = tags + [ { "Key" : constant . PROJECT_NAME_TAG , "Value" : stack . project_stack . project_name } , { "Key" : constant . STACK_ID_TAG , "Value" : stack_id } ] return tags