def label_to_bin(mpls_label, is_bos=True):
 return type_desc.Int3.from_user(((mpls_label << 4) | is_bos))

def label_to_bin ( mpls_label , is_bos = True ) : return type_desc . Int3 . from_user ( ( ( mpls_label << 4 ) | is_bos ) )
converts integer label to binary representation .