<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cover(self, pageid):
 """ Get a cover image given a page id. :param str pageid: The pageid for the light novel you want a cover image for :return str: the image url """

        r = requests.get(self.api,
                         params={'action': 'query', 'prop': 'pageimages', 'pageids': pageid, 'format': 'json'},
                         headers=self.header)
        jsd = r.json()
        image = "File:" + jsd['query']['pages'][str(pageid)]['pageimage']
        r = requests.get(self.api,
                         params={'action': 'query', 'prop': 'imageinfo', 'iiprop': 'url', 'titles': image,
                                 'format': 'json'},
                         headers=self.header)
        jsd = r.json()
        return jsd['query']['pages'][list(jsd['query']['pages'].keys())[0]]['imageinfo'][0]['url']