from typing import Any
from typing import Dict

# third party
from pandas import DataFrame

# syft relative
from ...messages.user_messages import CreateUserMessage
from ...messages.user_messages import DeleteUserMessage
from ...messages.user_messages import GetUserMessage
from ...messages.user_messages import GetUsersMessage
from ...messages.user_messages import UpdateUserMessage
from .request_api import GridRequestAPI


class UserRequestAPI(GridRequestAPI):
    response_key = "user"

    def __init__(self, send):
        super().__init__(
            create_msg=CreateUserMessage,
            get_msg=GetUserMessage,
            get_all_msg=GetUsersMessage,
            update_msg=UpdateUserMessage,
            delete_msg=DeleteUserMessage,
            send=send,
            response_key=UserRequestAPI.response_key,
        )

    def __getitem__(self, key):
        return self.get(user_id=key)

    def __delitem__(self, key):
        self.delete(user_id=key)

from typing import Any
from typing import Callable

# syft relative
from ...messages.user_messages import CreateUserMessage
from ...messages.user_messages import DeleteUserMessage
from ...messages.user_messages import GetUserMessage
from ...messages.user_messages import GetUsersMessage
from ...messages.user_messages import UpdateUserMessage
from .request_api import GridRequestAPI


class UserRequestAPI(GridRequestAPI):
    response_key = "user"

    def __init__(self, send: Callable):
        super().__init__(
            create_msg=CreateUserMessage,
            get_msg=GetUserMessage,
            get_all_msg=GetUsersMessage,
            update_msg=UpdateUserMessage,
            delete_msg=DeleteUserMessage,
            send=send,
            response_key=UserRequestAPI.response_key,
        )

    def __getitem__(self, key: int) -> Any:
        return self.get(user_id=key)

    def __delitem__(self, key: int) -> None:
        self.delete(user_id=key)

Update User API - ADD type hints - Remove unused imports
Update User API
- ADD type hints
- Remove unused imports

  from typing import Any
- from typing import Dict
+ from typing import Callable
- 
- # third party
- from pandas import DataFrame
  
  # syft relative
  from ...messages.user_messages import CreateUserMessage
  from ...messages.user_messages import DeleteUserMessage
  from ...messages.user_messages import GetUserMessage
  from ...messages.user_messages import GetUsersMessage
  from ...messages.user_messages import UpdateUserMessage
  from .request_api import GridRequestAPI
  
  
  class UserRequestAPI(GridRequestAPI):
      response_key = "user"
  
-     def __init__(self, send):
+     def __init__(self, send: Callable):
          super().__init__(
              create_msg=CreateUserMessage,
              get_msg=GetUserMessage,
              get_all_msg=GetUsersMessage,
              update_msg=UpdateUserMessage,
              delete_msg=DeleteUserMessage,
              send=send,
              response_key=UserRequestAPI.response_key,
          )
  
-     def __getitem__(self, key):
+     def __getitem__(self, key: int) -> Any:
          return self.get(user_id=key)
  
-     def __delitem__(self, key):
+     def __delitem__(self, key: int) -> None:
          self.delete(user_id=key)
  
Update User API - ADD type hints - Remove unused imports
## Code Before:
from typing import Any
from typing import Dict

# third party
from pandas import DataFrame

# syft relative
from ...messages.user_messages import CreateUserMessage
from ...messages.user_messages import DeleteUserMessage
from ...messages.user_messages import GetUserMessage
from ...messages.user_messages import GetUsersMessage
from ...messages.user_messages import UpdateUserMessage
from .request_api import GridRequestAPI


class UserRequestAPI(GridRequestAPI):
    response_key = "user"

    def __init__(self, send):
        super().__init__(
            create_msg=CreateUserMessage,
            get_msg=GetUserMessage,
            get_all_msg=GetUsersMessage,
            update_msg=UpdateUserMessage,
            delete_msg=DeleteUserMessage,
            send=send,
            response_key=UserRequestAPI.response_key,
        )

    def __getitem__(self, key):
        return self.get(user_id=key)

    def __delitem__(self, key):
        self.delete(user_id=key)

## Instruction:
Update User API - ADD type hints - Remove unused imports
## Code After:
from typing import Any
from typing import Callable

# syft relative
from ...messages.user_messages import CreateUserMessage
from ...messages.user_messages import DeleteUserMessage
from ...messages.user_messages import GetUserMessage
from ...messages.user_messages import GetUsersMessage
from ...messages.user_messages import UpdateUserMessage
from .request_api import GridRequestAPI


class UserRequestAPI(GridRequestAPI):
    response_key = "user"

    def __init__(self, send: Callable):
        super().__init__(
            create_msg=CreateUserMessage,
            get_msg=GetUserMessage,
            get_all_msg=GetUsersMessage,
            update_msg=UpdateUserMessage,
            delete_msg=DeleteUserMessage,
            send=send,
            response_key=UserRequestAPI.response_key,
        )

    def __getitem__(self, key: int) -> Any:
        return self.get(user_id=key)

    def __delitem__(self, key: int) -> None:
        self.delete(user_id=key)
