def parse(text, format=None, dictionarytype=dict, parsertype='normal'):
    """Parses the Xcode project as binary text
    and creates the tree of nested dicts, arrays and strings
    that represents the original structure.

    :param text: the content of a project.pbxproj.
    :param format: one of 'xcode', 'xml', 'json' or None for automatic detection.
    :param dictionarytype: should be dict or OrderedDict.
    :param parsertype: normal: parse plists via syntax transformation by the fast JSON parser
                               and use the classic parser if the JSON parser failed.
                       fast: only parse with the fast JSON parser.
                       classic: only parse plists with the classic parser.
    :return: the tuple (rootnode, parseinfo).
    """
    text = unistr(text)

    root, parseinfo = None, None
    can_only_be_xml = text.startswith('<?xml')
    if format == 'xml' or (format is None and can_only_be_xml):
        return parse_xcodeproject_xml(text, dictionarytype=dictionarytype)

    if format in [None, 'json']:
        root, parseinfo = parse_xcodeproject_json(text, dictionarytype=dictionarytype)
        if root is not None or format == 'json':
            return root, parseinfo

    prev_parseinfo = parseinfo
    root, parseinfo = parse_xcodeproject_plist(text, dictionarytype=dictionarytype, parsertype=parsertype)
    if prev_parseinfo is not None:
        parseinfo['prev_parseinfo'] = prev_parseinfo
    return root, parseinfo
dataset/ETHPy150Open mikr/xcodeprojer/xcodeprojer.py/parse/original