def get_events(self, limit=<NUM_LIT>, *, query=None, order_by=None, batch=None,<EOL>download_attachments=False, include_recurring=True):
if self.calendar_id is None:<EOL><INDENT>if include_recurring:<EOL><INDENT>url = self.build_url(self._endpoints.get('<STR_LIT>'))<EOL><DEDENT>else:<EOL><INDENT>url = self.build_url(self._endpoints.get('<STR_LIT>'))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if include_recurring:<EOL><INDENT>url = self.build_url(<EOL>self._endpoints.get('<STR_LIT>').format(id=self.calendar_id))<EOL><DEDENT>else:<EOL><INDENT>url = self.build_url(<EOL>self._endpoints.get('<STR_LIT>').format(id=self.calendar_id))<EOL><DEDENT><DEDENT>if limit is None or limit > self.protocol.max_top_value:<EOL><INDENT>batch = self.protocol.max_top_value<EOL><DEDENT>if batch:<EOL><INDENT>download_attachments = False<EOL><DEDENT>params = {'<STR_LIT>': batch if batch else limit}<EOL>if include_recurring:<EOL><INDENT>start = None<EOL>end = None<EOL>if query and not isinstance(query, str):<EOL><INDENT>for query_data in query._filters:<EOL><INDENT>if not isinstance(query_data, tuple):<EOL><INDENT>continue<EOL><DEDENT>attribute = query_data[<NUM_LIT:0>]<EOL>word = query_data[<NUM_LIT:2>][<NUM_LIT:3>]<EOL>if attribute.lower().startswith('<STR_LIT>'):<EOL><INDENT>start = word.replace("<STR_LIT:'>", '<STR_LIT>')  <EOL>query.remove_filter('<STR_LIT:start>')<EOL><DEDENT>if attribute.lower().startswith('<STR_LIT>'):<EOL><INDENT>end = word.replace("<STR_LIT:'>", '<STR_LIT>')  <EOL>query.remove_filter('<STR_LIT:end>')<EOL><DEDENT><DEDENT><DEDENT>if start is None or end is None:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if end < start:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>params[self._cc('<STR_LIT>')] = start<EOL>params[self._cc('<STR_LIT>')] = end<EOL><DEDENT>if order_by:<EOL><INDENT>params['<STR_LIT>'] = order_by<EOL><DEDENT>if query:<EOL><INDENT>if isinstance(query, str):<EOL><INDENT>params['<STR_LIT>'] = query<EOL><DEDENT>else:<EOL><INDENT>params.update(query.as_params())<EOL><DEDENT><DEDENT>response = self.con.get(url, params=params,<EOL>headers={'<STR_LIT>': '<STR_LIT>'})<EOL>if not response:<EOL><INDENT>return iter(())<EOL><DEDENT>data = response.json()<EOL>events = (self.event_constructor(parent=self,<EOL>download_attachments=<EOL>download_attachments,<EOL>**{self._cloud_data_key: event})<EOL>for event in data.get('<STR_LIT:value>', []))<EOL>next_link = data.get(NEXT_LINK_KEYWORD, None)<EOL>if batch and next_link:<EOL><INDENT>return Pagination(parent=self, data=events,<EOL>constructor=self.event_constructor,<EOL>next_link=next_link, limit=limit)<EOL><DEDENT>else:<EOL><INDENT>return events<EOL><DEDENT>
Get events from the this Calendar

        :param int limit: max no. of events to get. Over 999 uses batch.
        :param query: applies a OData filter to the request
        :type query: Query or str
        :param order_by: orders the result set based on this condition
        :type order_by: Query or str
        :param int batch: batch size, retrieves items in
         batches allowing to retrieve more items than the limit.
        :param download_attachments: downloads event attachments
        :param bool include_recurring: whether to include recurring events or not
        :return: list of events in this calendar
        :rtype: list[Event] or Pagination