def dict_to_pyxb(rp_dict):
    """Convert dict to ReplicationPolicy PyXB object.

    Args:
      rp_dict: Native Python structure representing a Replication Policy.

    Example::

      {
        'allowed': True,
        'num': 3,
        'blockedMemberNode': {'urn:node:NODE1', 'urn:node:NODE2', 'urn:node:NODE3'},
        'preferredMemberNode': {'urn:node:NODE4', 'urn:node:NODE5'},
      }

    Returns:
      ReplicationPolicy PyXB object.

    """
    rp_pyxb = d1_common.types.dataoneTypes.replicationPolicy()
    rp_pyxb.replicationAllowed = rp_dict['allowed']
    rp_pyxb.numberReplicas = rp_dict['num']
    rp_pyxb.blockedMemberNode = rp_dict['block']
    rp_pyxb.preferredMemberNode = rp_dict['pref']
    normalize(rp_pyxb)
    return rp_pyxb
Convert dict to ReplicationPolicy PyXB object.

    Args:
      rp_dict: Native Python structure representing a Replication Policy.

    Example::

      {
        'allowed': True,
        'num': 3,
        'blockedMemberNode': {'urn:node:NODE1', 'urn:node:NODE2', 'urn:node:NODE3'},
        'preferredMemberNode': {'urn:node:NODE4', 'urn:node:NODE5'},
      }

    Returns:
      ReplicationPolicy PyXB object.