<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pop_header(self, hkey, ignore_error=False):
 """ This will remove and return the specified header value. Parameters hkey Header key you wish to pop. You can specify either a key string or an index. ignore_error=False Whether to quietly ignore any errors (i.e., hkey not found). """


        # try the integer approach first to allow negative values
        if type(hkey) is not str:
            try:    
                return self.headers.pop(self.hkeys.pop(hkey))
            except: 
                if not ignore_error:
                    print("ERROR: pop_header() could not find hkey "+str(hkey))
                return None
        else:
            
            try:
                # find the key integer and pop it
                hkey = self.hkeys.index(hkey)
    
                # pop it!
                return self.headers.pop(self.hkeys.pop(hkey))

            except:
                if not ignore_error:
                    print("ERROR: pop_header() could not find hkey "+str(hkey))
                return