code: def _validate_feature(feature):
      if feature.get("properties") is None:
          feature["properties"] = {}
      if feature.get("geometry") is None:
          raise InvalidGeoJson(
              "Feature with properties {} does not have a geometry.".format(
                  feature.get("properties")
              )
          )
      return feature
  
imports: import json
  import copy
  import ipywidgets
  from traitlets import Unicode, Dict, List, observe, Float
  import geojson
  from .None import geotraitlets
  from .None import bounds
  from .options import merge_option_dicts, broadcast_if_atomic, broadcast_if_color_atomic
  from .maps import GMapsWidgetMixin
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_feature(feature) and returns: feature