code: def base64_user_pass(self):
          
          if self._username is None or self._password is None:
              return None
  
          hash_ = base64.urlsafe_b64encode(bytes_("{username}:{password}".format(
              username=self._username,
              password=self._password
          )))
          return "Basic {0}".format(unicode_(hash_))
docs: Composes a basic http auth string, suitable for use with the
          _replicator database, and other places that need it.
  
          :returns: Basic http authentication string