from branca.element import Template, MacroElement def temp(): #code copied from: https://nbviewer.org/gist/talbertc-usgs/18f8901fc98f109f2b71156cf3ac81cd template = """ {% macro html(this, kwargs) %} jQuery UI Draggable - Default functionality
{% endmacro %}""" macro = MacroElement() macro._template = Template(template) #map_osm.get_root().add_child(macro) return macro