<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def layer_from_element(element, style_function=None):
 """Return Leaflet layer from shape. Parameters element : telluric.vectors.GeoVector, telluric.features.GeoFeature, telluric.collections.BaseCollection Data to plot. """

    # This import is here to avoid cyclic references
    from telluric.collections import BaseCollection

    if isinstance(element, BaseCollection):
        styled_element = element.map(lambda feat: style_element(feat, style_function))

    else:
        styled_element = style_element(element, style_function)

    return GeoJSON(data=mapping(styled_element), name='GeoJSON')