def _encode_edge_attributes(order, par):
    """ encode bond attributes as an integer (or "color")

    scheme:
        bond order   <=> tens place
        parity       <=> ones place (None->0, False->1, True->2)
    """
    id2 = order
    id1 = 0 if par is None else 1 + int(par)

    color = id2 * 10 + id1 * 1
    return color