code: def validate_edge_direction(edge_direction):
      
      if not isinstance(edge_direction, six.string_types):
          raise TypeError(u'Expected string edge_direction, got: {} {}'.format(
                          type(edge_direction), edge_direction))
  
      if edge_direction not in ALLOWED_EDGE_DIRECTIONS:
          raise ValueError(u'Unrecognized edge direction: {}'.format(edge_direction))
docs: Ensure the provided edge direction is either "in" or "out".