# Path: tests/utils.py
# @contextmanager
# def temporary_file(content=None, mode=None, binary=False):
#     tmpf, tmpfname = tempfile.mkstemp()
#     os.close(tmpf)
# 
#     if mode is None:
#         if content is None:
#             mode = "rb"
#         else:
#             mode = "wb"
# 
#     tmpf = open(tmpfname, mode)
#     if content is not None:
#         if hasattr(content, "encode") and not binary:
#             tmpf.write(dedent(content).encode("utf8"))
#         else:
#             tmpf.write(content)
# 
#     tmpf.close()
#     yield tmpfname
#     try:
#         os.unlink(tmpfname)
#     except Exception:
#         # ignore exceptions; it happens sometimes on Windows in the CI environment
#         # that it cannot remove the temporary file because another process (?) is
#         # using it...
#         pass


import gzip
import io
import unittest
import warnings
    import networkx as nx
    import graph_tool as gt
    import pandas as pd
from igraph import Graph, InternalError
from .utils import temporary_file
        from pandas import DataFrame
            10,
            113,
            1,
            40,
            75,
            3,
            93,
            113,
            2,
            75,
            1,
            75,
            2,
            134,
            113,
            3,
            97,
            137,
            125,
            125,
            125,
            116,
            82,
            113,
            4,
            125,
            98,
            46,
        ]
        pickle = bytes(pickle)

# Path: tests/utils.py
# @contextmanager
# def temporary_file(content=None, mode=None, binary=False):
#     tmpf, tmpfname = tempfile.mkstemp()
#     os.close(tmpf)
# 
#     if mode is None:
#         if content is None:
#             mode = "rb"
#         else:
#             mode = "wb"
# 
#     tmpf = open(tmpfname, mode)
#     if content is not None:
#         if hasattr(content, "encode") and not binary:
#             tmpf.write(dedent(content).encode("utf8"))
#         else:
#             tmpf.write(content)
# 
#     tmpf.close()
#     yield tmpfname
#     try:
#         os.unlink(tmpfname)
#     except Exception:
#         # ignore exceptions; it happens sometimes on Windows in the CI environment
#         # that it cannot remove the temporary file because another process (?) is
#         # using it...
#         pass


# Path: tests/test_foreign.py
import gzip
import io
import unittest
import warnings
    import networkx as nx
    import graph_tool as gt
    import pandas as pd
from igraph import Graph, InternalError
from .utils import temporary_file
        from pandas import DataFrame

            10,
            113,
            1,
            40,
            75,
            3,
            93,
            113,
            2,
            75,
            1,
            75,
            2,
            134,
            113,
            3,
            97,
            137,
            125,
            125,
            125,
            116,
            82,
            113,
            4,
            125,
            98,
            46,
        ]
        pickle = bytes(pickle)

        with temporary_file(pickle, "wb", binary=True) as tmpfname: