def label_from_bin(buf):
 mpls_label = type_desc.Int3.to_user(six.binary_type(buf))
 return ((mpls_label >> 4), (mpls_label & 1))

def label_from_bin ( buf ) : mpls_label = type_desc . Int3 . to_user ( six . binary_type ( buf ) ) return ( ( mpls_label >> 4 ) , ( mpls_label & 1 ) )
converts binary representation label to integer .