tools/traffic_annotation/scripts/generator_utils.py
def map_annotations(tsv_contents):
  """Creates a mapping between the unique_id of a given annotation and its
  relevant attributes, e.g. description, trigger, data, etc.

  Args:
    tsv_contents: List[List]
      Table of loaded annotations.

  Returns:
    unique_id_rel_attributes_map: <Dict[str, TrafficAnnotation]>
  """
  unique_id_rel_attributes_map = {}
  for annotation_row in tsv_contents:
    unique_id = annotation_row[0].encode("utf-8")
    description = annotation_row[3].encode("utf-8")
    trigger = annotation_row[4].encode("utf-8")
    data = annotation_row[5].encode("utf-8")
    settings = annotation_row[9].encode("utf-8")
    policy = annotation_row[10].encode("utf-8")
    payload = [unique_id, description, trigger, data, settings, policy]

    unique_id_rel_attributes_map[unique_id] = TrafficAnnotation._make(payload)
  return unique_id_rel_attributes_map
Creates a mapping between the unique_id of a given annotation and its
  relevant attributes, e.g. description, trigger, data, etc.

  Args:
    tsv_contents: List[List]
      Table of loaded annotations.

  Returns:
    unique_id_rel_attributes_map: <Dict[str, TrafficAnnotation]>
  
Creates a mapping between the unique_id of a given annotation and its
relevant attributes, e.g. description, trigger, data, etc.
Creates a mapping between the unique_id of a given annotation and its relevant attributes e . g . description trigger data etc .
def map_annotations(tsv_contents):
  unique_id_rel_attributes_map = {}
  for annotation_row in tsv_contents:
    unique_id = annotation_row[0].encode("utf-8")
    description = annotation_row[3].encode("utf-8")
    trigger = annotation_row[4].encode("utf-8")
    data = annotation_row[5].encode("utf-8")
    settings = annotation_row[9].encode("utf-8")
    policy = annotation_row[10].encode("utf-8")
    payload = [unique_id, description, trigger, data, settings, policy]
    unique_id_rel_attributes_map[unique_id] = TrafficAnnotation._make(payload)
  return unique_id_rel_attributes_map
def map_annotations ( tsv_contents ) : unique_id_rel_attributes_map = { } for annotation_row in tsv_contents : unique_id = annotation_row [ 0 ] . encode ( "utf-8" ) description = annotation_row [ 3 ] . encode ( "utf-8" ) trigger = annotation_row [ 4 ] . encode ( "utf-8" ) data = annotation_row [ 5 ] . encode ( "utf-8" ) settings = annotation_row [ 9 ] . encode ( "utf-8" ) policy = annotation_row [ 10 ] . encode ( "utf-8" ) payload = [ unique_id , description , trigger , data , settings , policy ] unique_id_rel_attributes_map [ unique_id ] = TrafficAnnotation . _make ( payload ) return unique_id_rel_attributes_map
Creates a mapping between the unique_id of a given annotation and its
relevant attributes, e.g.
Creates a mapping between the unique_id of a given annotation and its relevant attributes e . g .
"""Creates a mapping between the unique_id of a given annotation and its
  relevant attributes, e.g. description, trigger, data, etc.

  Args:
    tsv_contents: List[List]
      Table of loaded annotations.

  Returns:
    unique_id_rel_attributes_map: <Dict[str, TrafficAnnotation]>
  """
None
unique_id_rel_attributes_map
tsv_contents
List[List]
Table of loaded annotations.
List [ List ] Table of loaded annotations .