docstr: This has a custom implementation because sometimes runsets are missing the project field.
docstr_tok: ["This","has","a","custom","implementation","because","sometimes","runsets","are","missing","the","project","field","."]
code: def from_json(cls, spec: Dict[str, Any]) -> T:
      """This has a custom implementation because sometimes runsets are missing the project field."""
      obj = cls()
      obj._spec = spec
  
      project = spec.get("project")
      if project:
          obj.entity = project.get(
              "entityName", coalesce(PublicApi().default_entity, "")
          )
          obj.project = project.get("name")
      else:
          obj.entity = coalesce(PublicApi().default_entity, "")
          obj.project = None
  
      return obj
  
imports: from typing import Any, Dict, Optional, TypeVar
  from ..public import Api
  from ..public import PythonMongoishQueryGenerator, QueryGenerator, Runs
  from .util import Attr, Base, coalesce, generate_name, nested_get, nested_set
label_desc: Use image node_id 2 for calling the Runset obj's underlying member method code with example usage: obj.from_json(cls, spec) and returns: obj