'Obtain the lists the specified user is a member of. If no user_id or
screen_name is specified, the data returned will be for the
authenticated user.
Returns a maximum of 20 lists per page by default.
Args:
user_id (int, optional):
The ID of the user for whom to return results for.
screen_name (str, optional):
The screen name of the user for whom to return
results for.
count (int, optional):
The amount of results to return per page.
No more than 1000 results will ever be returned in a single page.
Defaults to 20.
cursor (int, optional):
The "page" value that Twitter will use to start building the list
sequence from. Use the value of -1 to start at the beginning.
Twitter will return in the result the values for next_cursor and
previous_cursor.
filter_to_owned_lists (bool, optional):
Set to True to return only the lists the authenticating user
owns, and the user specified by user_id or screen_name is a
member of. Default value is False.
Returns:
list: A list of twitter.List instances, one for each list in which
the user specified by user_id or screen_name is a member'

def GetMemberships(self, user_id=None, screen_name=None, count=20, cursor=(-1), filter_to_owned_lists=False):

    url = ('%s/lists/memberships.json' % self.base_url)
    parameters = {}
    if (cursor is not None):
        parameters['cursor'] = enf_type('cursor', int, cursor)
    if (count is not None):
        parameters['count'] = enf_type('count', int, count)
    if filter_to_owned_lists:
        parameters['filter_to_owned_lists'] = enf_type('filter_to_owned_lists', bool, filter_to_owned_lists)
    if (user_id is not None):
        parameters['user_id'] = enf_type('user_id', int, user_id)
    elif (screen_name is not None):
        parameters['screen_name'] = screen_name
    resp = self._RequestUrl(url, 'GET', data=parameters)
    data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))
    return [List.NewFromJsonDict(x) for x in data['lists']]
