<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_complex(self) -> bool: """ Whether the field is "complex" eg. env variables should be parsed as JSON. """

        from .main import BaseModel  # noqa: F811

        return (
            self.shape != Shape.SINGLETON
            or lenient_issubclass(self.type_, (BaseModel, list, set, dict))
            or hasattr(self.type_, '__pydantic_model__')  # pydantic dataclass
        )