<commit_before># -*- coding: utf-8 -*-
"""

Conversion utilities for igraph

"""

try:
   import igraph as ig
except Exception as error:   
   print(str(error))
   print("py2cytoscape: Error importing igraph. You won't be able to import from igraph.")
   ig = None

DEF_SCALING = 100.0


def from_igraph(igraph_network, layout=None, scale=DEF_SCALING):
   if ig == None:
      raise ImportError('igraph not found')
    
    new_graph = {}
    network_data = {}
    elements = {}
    nodes = []
    edges = []

    # Convert network attributes
    network_attr = igraph_network.attributes()
    for key in network_attr:
        network_data[key] = igraph_network[key]

    # get network as a list of edges
    edges_original = igraph_network.es
    nodes_original = igraph_network.vs

    node_attr = igraph_network.vs.attributes()<commit_msg>correct indentation errors<commit_after># -*- coding: utf-8 -*-
"""

Conversion utilities for igraph

"""

try:
    import igraph as ig
except Exception as error:
    print(str(error))
    print("py2cytoscape: Error importing igraph. You won't be able to import from igraph.")
    ig = None

DEF_SCALING = 100.0


def from_igraph(igraph_network, layout=None, scale=DEF_SCALING):
    if ig is None:
        raise ImportError('igraph not found')

    new_graph = {}
    network_data = {}
    elements = {}
    nodes = []
    edges = []

    # Convert network attributes
    network_attr = igraph_network.attributes()
    for key in network_attr:
        network_data[key] = igraph_network[key]

    # get network as a list of edges
    edges_original = igraph_network.es
    nodes_original = igraph_network.vs

    node_attr = igraph_network.vs.attributes()
{'fraction_non_alphanumeric': 0.09899823217442545, 'fraction_numerical': 0.007071302298173247, 'mean_word_length': 3.15158924205379, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5302923', 'n_tokens_mistral': 552, 'n_tokens_neox': 522, 'n_words': 148}