def get_has_default(stmt: AssignmentStmt) -> bool:
        """Returns a boolean indicating whether the field defined in `stmt` is a required field."""
        expr = stmt.rvalue
        if isinstance(expr, TempNode):
            # TempNode means annotation-only, so has no default
            return False
        if isinstance(expr, CallExpr) and isinstance(expr.callee, RefExpr) and expr.callee.fullname == FIELD_FULLNAME:
            # The "default value" is a call to `Field`; at this point, the field has a default if and only if:
            # * there is a positional argument that is not `...`
            # * there is a keyword argument named "default" that is not `...`
            # * there is a "default_factory" that is not `None`
            for arg, name in zip(expr.args, expr.arg_names):
                # If name is None, then this arg is the default because it is the only positional argument.
                if name is None or name == 'default':
                    return arg.__class__ is not EllipsisExpr
                if name == 'default_factory':
                    return not (isinstance(arg, NameExpr) and arg.fullname == 'builtins.None')
            return False
        # Has no default if the "default value" is Ellipsis (i.e., `field_name: Annotation = ...`)
        return not isinstance(expr, EllipsisExpr)
Returns a boolean indicating whether the field defined in `stmt` is a required field.
pydantic/mypy.py