parameters: (json_flow, flow=None)
return_statement: return json_flow
docstring: Fixes duplicate rule UUIDs
docstring_summary: Fixes duplicate rule UUIDs
docstring_tokens: Fixes duplicate rule UUIDs
function: def migrate_to_version_11_8(json_flow, flow=None):
      """
      Fixes duplicate rule UUIDs
      """
      seen_uuids = set()
  
      for rs in json_flow.get("rule_sets", []):
          for rule in rs.get("rules"):
              if rule.get("uuid") in seen_uuids or not rule.get("uuid"):
                  rule["uuid"] = str(uuid4())
              seen_uuids.add(rule["uuid"])
  
      return json_flow
function_tokens: def migrate_to_version_11_8 ( json_flow , flow = None ) : seen_uuids = set ( ) for rs in json_flow . get ( "rule_sets" , [ ] ) : for rule in rs . get ( "rules" ) : if rule . get ( "uuid" ) in seen_uuids or not rule . get ( "uuid" ) : rule [ "uuid" ] = str ( uuid4 ( ) ) seen_uuids . add ( rule [ "uuid" ] ) return json_flow