def make_geojson(contents):
if isinstance(contents, six.string_types):<EOL><INDENT>return contents<EOL><DEDENT>if hasattr(contents, '<STR_LIT>'):<EOL><INDENT>features = [_geo_to_feature(contents)]<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>feature_iter = iter(contents)<EOL><DEDENT>except TypeError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>features = []<EOL>for i, f in enumerate(feature_iter):<EOL><INDENT>if not hasattr(f, '<STR_LIT>'):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(i))<EOL><DEDENT>features.append(_geo_to_feature(f))<EOL><DEDENT><DEDENT>data = {'<STR_LIT:type>': '<STR_LIT>', '<STR_LIT>': features}<EOL>return json.dumps(data)<EOL>
Return a GeoJSON string from a variety of inputs.
See the documentation for make_url for the possible contents
input.

Returns
-------
GeoJSON string