'Common method for GetFriendIDs and GetFollowerIDs'

def _GetFriendFollowerIDs(self, url=None, user_id=None, screen_name=None, cursor=None, count=None, stringify_ids=False, total_count=None):

    if ((cursor is not None) or (count is not None)):
        warnings.warn("Use    of    'cursor'    and    'count'    parameters    are    deprecated    as    of    python-twitter    3.0.    Please    use    GetFriendIDsPaged    or    GetFollowerIDsPaged    instead.", DeprecationWarning, stacklevel=2)
    count = 5000
    cursor = (-1)
    result = []
    if total_count:
        try:
            total_count = int(total_count)
        except ValueError:
            raise TwitterError({'message': 'total_count    must    be    an    integer'})
    if (total_count and (total_count < count)):
        count = total_count
    while True:
        if ((total_count is not None) and ((len(result) + count) > total_count)):
            break
        (next_cursor, previous_cursor, data) = self._GetIDsPaged(url, user_id, screen_name, cursor, stringify_ids, count)
        result.extend([x for x in data])
        if ((next_cursor == 0) or (next_cursor == previous_cursor)):
            break
        else:
            cursor = next_cursor
    return result
