from typing import Any, Callable, Iterable, Optional, Type

from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField

__all__ = ["UploadedFile"]


class UploadedFile(DjangoUploadedFile):
    @classmethod
    def __get_validators__(cls: Type["UploadedFile"]) -> Iterable[Callable[..., Any]]:
        yield cls._validate

    @classmethod
    def _validate(cls: Type["UploadedFile"], v: Any) -> Any:
        if not isinstance(v, DjangoUploadedFile):
            raise ValueError(f"Expected UploadFile, received: {type(v)}")
        return v

    @classmethod
    def __modify_schema__(cls, field_schema, field: Optional[ModelField]):
        field_schema.update(type="string", format="binary")

from typing import Any, Callable, Dict, Iterable, Optional, Type

from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField

__all__ = ["UploadedFile"]


class UploadedFile(DjangoUploadedFile):
    @classmethod
    def __get_validators__(cls: Type["UploadedFile"]) -> Iterable[Callable[..., Any]]:
        yield cls._validate

    @classmethod
    def _validate(cls: Type["UploadedFile"], v: Any) -> Any:
        if not isinstance(v, DjangoUploadedFile):
            raise ValueError(f"Expected UploadFile, received: {type(v)}")
        return v

    @classmethod
    def __modify_schema__(cls, field_schema: Dict[str, Any], field: Optional[ModelField]):
        field_schema.update(type="string", format="binary")

Add missing type hint for field_schema parameter
Add missing type hint for field_schema parameter
- from typing import Any, Callable, Iterable, Optional, Type
+ from typing import Any, Callable, Dict, Iterable, Optional, Type
  
  from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
  from pydantic.fields import ModelField
  
  __all__ = ["UploadedFile"]
  
  
  class UploadedFile(DjangoUploadedFile):
      @classmethod
      def __get_validators__(cls: Type["UploadedFile"]) -> Iterable[Callable[..., Any]]:
          yield cls._validate
  
      @classmethod
      def _validate(cls: Type["UploadedFile"], v: Any) -> Any:
          if not isinstance(v, DjangoUploadedFile):
              raise ValueError(f"Expected UploadFile, received: {type(v)}")
          return v
  
      @classmethod
-     def __modify_schema__(cls, field_schema, field: Optional[ModelField]):
+     def __modify_schema__(cls, field_schema: Dict[str, Any], field: Optional[ModelField]):
          field_schema.update(type="string", format="binary")
  
Add missing type hint for field_schema parameter
## Code Before:
from typing import Any, Callable, Iterable, Optional, Type

from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField

__all__ = ["UploadedFile"]


class UploadedFile(DjangoUploadedFile):
    @classmethod
    def __get_validators__(cls: Type["UploadedFile"]) -> Iterable[Callable[..., Any]]:
        yield cls._validate

    @classmethod
    def _validate(cls: Type["UploadedFile"], v: Any) -> Any:
        if not isinstance(v, DjangoUploadedFile):
            raise ValueError(f"Expected UploadFile, received: {type(v)}")
        return v

    @classmethod
    def __modify_schema__(cls, field_schema, field: Optional[ModelField]):
        field_schema.update(type="string", format="binary")

## Instruction:
Add missing type hint for field_schema parameter
## Code After:
from typing import Any, Callable, Dict, Iterable, Optional, Type

from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField

__all__ = ["UploadedFile"]


class UploadedFile(DjangoUploadedFile):
    @classmethod
    def __get_validators__(cls: Type["UploadedFile"]) -> Iterable[Callable[..., Any]]:
        yield cls._validate

    @classmethod
    def _validate(cls: Type["UploadedFile"], v: Any) -> Any:
        if not isinstance(v, DjangoUploadedFile):
            raise ValueError(f"Expected UploadFile, received: {type(v)}")
        return v

    @classmethod
    def __modify_schema__(cls, field_schema: Dict[str, Any], field: Optional[ModelField]):
        field_schema.update(type="string", format="binary")
