class_docstr: The schema for predictions or labels when doing classification, object detection or instance segmentation 
class_docstr_tok: ["The","schema","for","predictions","or","labels","when","doing","classification",",","object","detection","or","instance","segmentation"]
docstr: Returns the dictionary representation of the model
docstr_tok: ["Returns","the","dictionary","representation","of","the","model"]
code: def to_dict(self, by_alias: bool = False):
      """Returns the dictionary representation of the model"""
      _dict = self.dict(
          by_alias=by_alias, exclude={}, exclude_none=True
      )
      # override the default output from pydantic by calling `to_dict()` of each item in categories (list)
      _items = []
      if self.categories:
          for _item in self.categories:
              if _item:
                  _items.append(_item.to_dict(by_alias=by_alias))
          _dict["categories" if by_alias else "categories"] = _items
      return _dict
  
file_path: lightly/lightly/openapi_generated/swagger_client/models/prediction_task_schema_simple_all_of.py
imports: from __future__ import annotations
  import pprint
  import re
  import json
  from typing import List
  from pydantic import Extra, BaseModel, Field, conlist
  from lightly.openapi_generated.swagger_client.models.prediction_task_schema_category import PredictionTaskSchemaCategory
label_desc: Use image node_id 4 for calling the PredictionTaskSchemaSimpleAllOf obj's underlying member method code with example usage: obj.to_dict(by_alias) and returns: _dict