def pp2pvs (self, p1, p2):

        (startposs,endposs,vs) = self.pp2cages(p1,p2)
        p1_in_cages = bisect_left(startposs,p1)
        p2_in_cages = bisect_right(endposs,p2)
        output_startpos_list = startposs[p1_in_cages:p2_in_cages]
        output_endpos_list = endposs[p1_in_cages:p2_in_cages]
        output_value_list = vs[p1_in_cages:p2_in_cages]

        # print p1_in_cages,p2_in_cages
        # print vs
        print output_startpos_list
        print output_endpos_list
        print output_value_list

        # check if the bin (p1_in_cages-1) covers p1
        
        if p1_in_cages-1 >= 0 and p1 < self.cage[p1_in_cages-1][1]:
            # add this interval
            output_startpos_list = array(BYTE4,[p1,])+output_startpos_list
            output_endpos_list = array(BYTE4,[self.cage[p1_in_cages-1][1],])+output_endpos_list
            output_value_list = array(BYTE4,[self.cage[p1_in_cages-1][2],])+output_value_list
                

        # check if the bin (p2_in_cages+1) covers p2
        #print p2_in_cages+1,len(self.cage)
        #print p2, self.cage[p2_in_cages+1][0]
        if p2_in_cages+1 < len(self.cage) and p2 > self.cage[p2_in_cages+1][0]:
            # add this interval
            output_startpos_list = output_startpos_list+array(BYTE4,[self.cage[p2_in_cages+1][0],])
            output_endpos_list = output_endpos_list+array(BYTE4,[p2,])
            output_value_list = output_value_list+array(BYTE4,[self.cage[p2_in_cages+1][2],])

        print output_startpos_list
        print output_endpos_list
        print output_value_list

        return zip(output_startpos_list,output_endpos_list,output_value_list)
Given a column type (e.g. 'BLOB', 'VARCHAR'), returns the SQL necessary
dataset/ETHPy150Open taoliu/MACS/MACS2/IO/BinKeeper.py/BinKeeperII.pp2pvs--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/db/backends/__init__.py/BaseDatabaseOperations.field_cast_sql