code: def limits(self, low, high):
          
          if self._high_limits is None:
              result = self.call({'action': 'query',
                                  'meta': 'userinfo',
                                  'uiprop': 'rights'})
              self._high_limits = 'apihighlimits' in \
                  result['query']['userinfo']['rights']
          if self._high_limits:
              return high
          else:
              return low
docs: Convenience function for determining appropriate limits in the API. If
          the (usually logged-in) client has the ``apihighlimits`` right, it will
          return *high*; otherwise it will return *low*.
  
          It's generally a good idea to use the highest limit possible; this
          reduces the amount of HTTP requests and therefore overhead. Read the
          API documentation for details on the limits for the function you are
          using.
  
          :param low: value to return if client does not have ``apihighlimits``
          :param high: value to return if client has ``apihighlimits``
          :returns: *low* or *high*