def ensure_dict(param, default_value, default_key=None):
 if (not param):
  param = default_value
 if (not isinstance(param, dict)):
  if param:
   default_value = param
  return ({default_key: param}, default_value)
 return (param, default_value)

def ensure_dict ( param , default_value , default_key = None ) : if ( not param ) : param = default_value if ( not isinstance ( param , dict ) ) : if param : default_value = param return ( { default_key : param } , default_value ) return ( param , default_value )
retrieves a dict and a default value from given parameter .