docstr: Check if the order of the nodes is the same order as `sm.nodes`, which in turn is the same order as the
  adjacency matrix.
  
  To do so, we create graphs with degree in {0,1} by doing permutations on identity.
  The edge values are always 100 and the noise is 1, so we expect `edge_from` < `edge_to` in absolute value
  almost every time.
docstr_tok: ["Check","if","the","order","of","the","nodes","is","the","same","order","as","`","sm.nodes","`",",","which","in","turn","is","the","same","order","as","the","adjacency","matrix",".","To","do","so",",","we","create","graphs","with","degree","in","{","0,1","}","by","doing","permutations","on","identity",".","The","edge","values","are","always","100","and","the","noise","is","1",",","so","we","expect","`","edge_from","`","<","`","edge_to","`","in","absolute","value","almost","every","time","."]
code: def test_order_is_correct(self, graph_gen, num_nodes, seed):
      """
      Check if the order of the nodes is the same order as `sm.nodes`, which in turn is the same order as the
      adjacency matrix.
  
      To do so, we create graphs with degree in {0,1} by doing permutations on identity.
      The edge values are always 100 and the noise is 1, so we expect `edge_from` < `edge_to` in absolute value
      almost every time.
      """
      sm = graph_gen(num_nodes=num_nodes, seed=seed, weight=None)
      nodes = sm.nodes()
      node_seq = {node: ix for ix, node in enumerate(sm.nodes())}
  
      data = generate_binary_data(
          sm,
          n_samples=10000,
          distribution="normal",
          seed=seed,
          noise_scale=0.1,
          intercept=False,
      )
      tol = 0.15
      # since we dont have an intercept, the mean proba for the parent is 0.5,
      # which has the highest possible std for a binary feature (std= p(1-p)),
      # hence, any child necessarily has a lower probability.
      assert (
          data[:, node_seq["aa"]].std() > data[:, node_seq["ab"]].std()
      )
  
      for node in nodes:
          if node == "aa":
              continue
          joint_proba, factored_proba = calculate_proba(
              data, node_seq["aa"], node_seq[node]
          )
          if node == "ab":
              # this is the only link
              assert not np.isclose(
                  joint_proba, factored_proba, rtol=tol, atol=0
              )
          else:
              assert np.isclose(
                  joint_proba, factored_proba, rtol=tol, atol=0
              )
  
imports: import re
  import string
  from itertools import product
  import numpy
  import pandas
  import pytest
  from scipy import stats
  from sklearn.gaussian_process.kernels import RBF
  from causalnex.structure import StructureModel
  from causalnex.structure.data_generators import gen_stationary_dyn_net_and_df, generate_binary_data, generate_binary_dataframe, generate_categorical_dataframe, generate_continuous_data, generate_continuous_dataframe, generate_count_dataframe, generate_dataframe_dynamic, generate_structure, generate_structure_dynamic
  from tests.structure.data_generators.test_core import calculate_proba
label_desc: Use image node_id 8 for calling the TestGenerateBinaryData obj's underlying member method code with example usage: obj.test_order_is_correct(graph_gen, num_nodes, seed) without return types