Perform a full-table scan

        This uses the older version of the DynamoDB API.
        See also: :meth:`~.scan2`.

        Parameters
        ----------
        tablename : str
            Name of the table to scan
        attributes : list
            If present, only fetch these attributes from the item
        count : bool, optional
            If True, return a count of matched items instead of the items
            themselves (default False)
        limit : int, optional
            Maximum number of items to return
        return_capacity : {NONE, INDEXES, TOTAL}, optional
            INDEXES will return the consumed capacity for indexes, TOTAL will
            return the consumed capacity for the table and the indexes.
            (default NONE)
        filter_or : bool, optional
            If True, multiple filter kwargs will be OR'd together. If False,
            they will be AND'd together. (default False)
        exclusive_start_key : dict, optional
            The ExclusiveStartKey to resume a previous query
        **kwargs : dict, optional
            Filter arguments (examples below)

        Examples
        --------
        You may pass in constraints using the Django-style '__' syntax. For
        example:

        .. code-block:: python

            connection.scan('mytable', tags__contains='searchtag')
            connection.scan('mytable', name__eq='dsa')
            connection.scan('mytable', action__in=['wibble', 'wobble'])

def scan(self, tablename, attributes=None, count=False, limit=None,
             return_capacity=None, filter_or=False, exclusive_start_key=None,
             **kwargs):
        """
        Perform a full-table scan

        This uses the older version of the DynamoDB API.
        See also: :meth:`~.scan2`.

        Parameters
        ----------
        tablename : str
            Name of the table to scan
        attributes : list
            If present, only fetch these attributes from the item
        count : bool, optional
            If True, return a count of matched items instead of the items
            themselves (default False)
        limit : int, optional
            Maximum number of items to return
        return_capacity : {NONE, INDEXES, TOTAL}, optional
            INDEXES will return the consumed capacity for indexes, TOTAL will
            return the consumed capacity for the table and the indexes.
            (default NONE)
        filter_or : bool, optional
            If True, multiple filter kwargs will be OR'd together. If False,
            they will be AND'd together. (default False)
        exclusive_start_key : dict, optional
            The ExclusiveStartKey to resume a previous query
        **kwargs : dict, optional
            Filter arguments (examples below)

        Examples
        --------
        You may pass in constraints using the Django-style '__' syntax. For
        example:

        .. code-block:: python

            connection.scan('mytable', tags__contains='searchtag')
            connection.scan('mytable', name__eq='dsa')
            connection.scan('mytable', action__in=['wibble', 'wobble'])

        """
        keywords = {
            'TableName': tablename,
            'ReturnConsumedCapacity': self._default_capacity(return_capacity),
        }
        if attributes is not None:
            keywords['AttributesToGet'] = attributes
        if exclusive_start_key is not None:
            keywords['ExclusiveStartKey'] = \
                self.dynamizer.maybe_encode_keys(exclusive_start_key)
        if kwargs:
            keywords['ScanFilter'] = encode_query_kwargs(
                self.dynamizer, kwargs)
            if len(kwargs) > 1:
                keywords['ConditionalOperator'] = 'OR' if filter_or else 'AND'
        if not isinstance(limit, Limit):
            limit = Limit(limit)
        if count:
            keywords['Select'] = COUNT
            return self._count('scan', limit, keywords)
        else:
            return ResultSet(self, limit, 'scan', **keywords)