code: def validate_edge_walk(self, g, walk, start, length, mode="out"):
      self.assertEqual(len(walk), length)
  
      prev_vertices = None
      for edgeid in walk:
          vertices = g.es[edgeid].tuple
          if prev_vertices is not None:
              self.assertTrue(
                  vertices[0] in prev_vertices
                  or vertices[1] in prev_vertices
              )
          else:
              self.assertTrue(start in vertices)
          prev_vertices = vertices
  
file_path: python-igraph/tests/test_walks.py
imports: import random
  import unittest
  from igraph import Graph, InternalError
label_desc: Use image node_id 3 for calling the RandomWalkTests obj's underlying member method code with example usage: obj.validate_edge_walk(g, walk, start, length, mode) without return types