'Search user_id or user_name, if you don\'t have it.'

def search_user(self, user_id=None, user_name=None):

    self.user_id = (user_id or False)
    self.user_name = (user_name or False)
    if ((not self.user_id) and (not self.user_name)):
        return False
    elif self.user_id:
        search_url = (self.url_list[self.i_a]['search_id'] % self.user_id)
    elif self.user_name:
        search_url = (self.url_list[self.i_a]['search_name'] % self.user_name)
    else:
        return True
    search = self.s.get(search_url)
    if (search.status_code == 200):
        r = json.loads(search.text)
        if self.user_id:
            self.user_name = r['data']['username']
        else:
            for u in r['data']:
                if (u['username'] == self.user_name):
                    t = u['id'].split('-')
                    self.user_id = t[1]
        return True
    return False
