def METHOD_NAME(self,
           payload,  # type: Union[Dict, bytes]
           key,  # type: str
           algorithm='HS256',  # type: str
           headers=None,  # type: Optional[Dict]
           json_encoder=None  # type: Optional[Type[json.JSONEncoder]]
           ):
    # Check that we get a mapping
    if not isinstance(payload, Mapping):
        raise TypeError('Expecting a mapping object, as JWT only supports '
                        'JSON objects as payloads.')
    # Payload
    for time_claim in ['exp', 'iat', 'nbf']:
        # Convert datetime to a intDate value in known time-format claims
        if isinstance(payload.get(time_claim), datetime):
            payload[time_claim] = timegm(payload[time_claim].utctimetuple())  # type: ignore
    json_payload = json.dumps(
        payload,
        separators=(',', ':'),
        cls=json_encoder
    ).METHOD_NAME('utf-8')
    return super(PyJWT, self).METHOD_NAME(
        json_payload, key, algorithm, headers, json_encoder
    )