code: def batch(self, requests):
          
  
          for request in requests:
              if 'body' in request:
                  request['body'] = urlencode(request['body'])
  
          def _grouper(complete_list, n=1):
              """
              Batches a list into constant size chunks.
  
              :param complete_list: A input list (not a generator).
              :param n: The size of the chunk.
  
              Adapted from <http://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-chunks-in-python>
              """
  
              for i in range(0, len(complete_list), n):
                  yield complete_list[i:i + n]
  
          responses = []
  
          # Maximum batch size for Facebook is 50 so split up requests
          # https://developers.facebook.com/docs/graph-api/making-multiple-requests/#limits
          for group in _grouper(requests, 50):
              responses += self.post(
                  batch=json.dumps(group)
              )
  
          for response, request in zip(responses, requests):
  
              # Facilitate for empty Graph API responses.
              #
              # https://github.com/jgorset/facepy/pull/30
              if not response:
                  yield None
                  continue
  
              try:
                  yield self._parse(response['body'])
              except FacepyError as exception:
                  exception.request = request
                  yield exception
docs: Make a batch request.
  
          :param requests: A list of dictionaries with keys 'method', 'relative_url' and optionally 'body'.
  
          Yields a list of responses and/or exceptions.