def import_library(view, edit, library_path):
    arduino_info = st_base.get_arduino_info()
    target_arch = arduino_info.get_target_board_info().get_target_arch()
    library = pyarduino.arduino_library.Library(library_path)
    h_files = library.list_h_files(target_arch)

    region = sublime.Region(0, view.size())
    src_text = view.substr(region)
    headers = pyarduino.arduino_src.list_headers_from_src(src_text)
    h_files = [f for f in h_files if not f.get_name() in headers]

    includes = ['#include <%s>' % f.get_name() for f in h_files]
    text = '\n'.join(includes)
    if text:
        text += '\n'
    view.insert(edit, 0, text)
dataset/ETHPy150Open Robot-Will/Stino/stino/main.py/import_library/original