src/pybel/io/gpickle.py
def to_bytes_gz(graph: BELGraph, protocol: int = pickle.HIGHEST_PROTOCOL) -> bytes:
    """Convert a graph to gzipped bytes with pickle.

    :param graph: A BEL graph
    :param protocol: Pickling protocol to use. Defaults to ``HIGHEST_PROTOCOL``.
    """
    io = BytesIO()
    with gzip.open(io, mode='wb') as file:
        pickle.dump(graph, file, protocol=protocol)
    return io.getvalue()
Convert a graph to gzipped bytes with pickle.

    :param graph: A BEL graph
    :param protocol: Pickling protocol to use. Defaults to ``HIGHEST_PROTOCOL``.
    
Convert a graph to gzipped bytes with pickle.
Convert a graph to gzipped bytes with pickle .
def to_bytes_gz(graph: BELGraph, protocol: int = pickle.HIGHEST_PROTOCOL) -> bytes:
    io = BytesIO()
    with gzip.open(io, mode='wb') as file:
        pickle.dump(graph, file, protocol=protocol)
    return io.getvalue()
def to_bytes_gz ( graph : BELGraph , protocol : int = pickle . HIGHEST_PROTOCOL ) -> bytes : io = BytesIO ( ) with gzip . open ( io , mode = 'wb' ) as file : pickle . dump ( graph , file , protocol = protocol ) return io . getvalue ( )
Convert a graph to gzipped bytes with pickle.
Convert a graph to gzipped bytes with pickle .
"""Convert a graph to gzipped bytes with pickle.

    :param graph: A BEL graph
    :param protocol: Pickling protocol to use. Defaults to ``HIGHEST_PROTOCOL``.
    """
graph
BELGraph
A BEL graph
A BEL graph
protocol
int
Pickling protocol to use. Defaults to ``HIGHEST_PROTOCOL``.
Pickling protocol to use . Defaults to ` ` HIGHEST_PROTOCOL ` ` .