<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_sgraph(filename, format='binary', delimiter='auto'):
 """ Load SGraph from text file or previously saved SGraph binary. Parameters filename : string Location of the file. Can be a local path or a remote URL. format : {'binary', 'snap', 'csv', 'tsv'}, optional Format to of the file to load. - 'binary': native graph format obtained from `SGraph.save`. - 'snap': tab or space separated edge list format with comments, used in the `Stanford Network Analysis Platform <http://snap.stanford.edu/snap/>`_. - 'csv': comma-separated edge list without header or comments. - 'tsv': tab-separated edge list without header or comments. delimiter : str, optional Specifying the Delimiter used in 'snap', 'csv' or 'tsv' format. Those format has default delimiter, but sometimes it is useful to overwrite the default delimiter. Returns ------- out : SGraph Loaded SGraph. See Also -------- SGraph, SGraph.save Examples -------- Save and load in binary format. """



    if not format in ['binary', 'snap', 'csv', 'tsv']:
        raise ValueError('Invalid format: %s' % format)

    with cython_context():
        g = None
        if format is 'binary':
            proxy = glconnect.get_unity().load_graph(_make_internal_url(filename))
            g = SGraph(_proxy=proxy)
        elif format is 'snap':
            if delimiter == 'auto':
                delimiter = '\t'
            sf = SFrame.read_csv(filename, comment_char='#', delimiter=delimiter,
                                 header=False, column_type_hints=int)
            g = SGraph().add_edges(sf, 'X1', 'X2')
        elif format is 'csv':
            if delimiter == 'auto':
                delimiter = ','
            sf = SFrame.read_csv(filename, header=False, delimiter=delimiter)
            g = SGraph().add_edges(sf, 'X1', 'X2')
        elif format is 'tsv':
            if delimiter == 'auto':
                delimiter = '\t'
            sf = SFrame.read_csv(filename, header=False, delimiter=delimiter)
            g = SGraph().add_edges(sf, 'X1', 'X2')
        g.summary()  # materialize
        return g