<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def filter_annotations_by_ptype(function, ptype):
    '''Filter an annotation by only leaving the parameters of type "ptype".'''
    ret = {}
    for k, v in function.__annotations__.items():
        if k == 'return':
            continue
        pt, _ = v
        if pt == ptype:
            ret[k] = v
    return ret