code: def impersonate(self, name=None, lifetime=None, mechs=None,
                      usage='initiate'):
          
  
          if rcred_s4u is None:
              raise NotImplementedError("Your GSSAPI implementation does not "
                                        "have support for S4U")
  
          res = rcred_s4u.acquire_cred_impersonate_name(self, name,
                                                        lifetime, mechs,
                                                        usage)
  
          return type(self)(base=res.creds)
docs: Impersonate a name using the current credentials
  
          This method acquires credentials by impersonating another
          name using the current credentials.
  
          :requires-ext:`s4u`
  
          Args:
              name (Name): the name to impersonate
              lifetime (int): the desired lifetime of the new credentials,
                  or None for indefinite
              mechs (list): the desired :class:`MechType` OIDs for the new
                  credentials
              usage (str): the desired usage for the new credentials -- either
                  'both', 'initiate', or 'accept'.  Note that some mechanisms
                  may only support 'initiate'.
  
          Returns:
              Credentials: the new credentials impersonating the given name