def checkdefs(contents, libf, errs):

    # Check there's only one symbol in the library
    n_defs = re_defs.findall(contents)
    if len(n_defs) > 1:
        errs.append("Found more than one component in library")
    elif len(n_defs) == 0:
        errs.append("Did not find any components in library")

    # Check symbol name matches library name
    partname = n_defs[0][0]
    designator = n_defs[0][1]
    libname = os.path.split(libf)[-1].split(".")[0]
    if partname.lower() != libname:
        errs.append("Part name '{}' does not match library name '{}'"
                    .format(partname, libname))

    return partname, designator
dataset/ETHPy150Open adamgreig/agg-kicad/scripts/check_lib.py/checkdefs/original