def get_parent(inst, rel_type='cloudify.relationships.contained_in'):
    """
        Gets the parent of an instance

    :param `cloudify.context.NodeInstanceContext` inst: Cloudify instance
    :param string rel_type: Relationship type
    :returns: Parent context
    :rtype: :class:`cloudify.context.RelationshipSubjectContext` or None
    """
    for rel in inst.relationships:
        if rel_type in rel.type_hierarchy:
            return rel.target
    return None