def process_attrs(attribute, annotype):
    """
    Description
    -----------
    Processes the attribute field of a feature and builds a dictionary with 
    key value pairs of all the attributes.

    Parameters
    ----------
    attribute : str, The attribute field of a feature in the GFF/GTF file

    annotype : str, Type of the genomic feature file. Either GFF or GTF

    Returns
    -------
    DICT, dictionary with key value pairs of all the attributes
    """
    
    attr_obj = {}
    attributes = attribute.strip().split(";")
    subdelim = " " if annotype=='GTF' else "="
    for a in attributes:
        attr = a.strip().split(subdelim)
        if len(attr) > 1:
            attrName = attr[0].strip()
            attr_obj[attrName] = attr[1].strip()
    return attr_obj