original_docstring: 
      Visualize a frequency directly-follows graph
  
      Parameters
      -----------------
      dfg
          Frequency Directly-follows graph
      log
          (if provided) Event log for the calculation of statistics
      activities_count
          (if provided) Dictionary associating to each activity the number of occurrences in the log.
      soj_time
          (if provided) Dictionary associating to each activity the average sojourn time
      parameters
          Variant-specific parameters
  
      Returns
      -----------------
      gviz
          Graphviz digraph
      
docstring: Visualize a frequency directly-follows graph
  Parameters
  
  dfg
  Frequency Directly-follows graph
  log
  (if provided) Event log for the calculation of statistics
  activities_count
  (if provided) Dictionary associating to each activity the number of occurrences in the log.
  soj_time
  (if provided) Dictionary associating to each activity the average sojourn time
  parameters
  Variant-specific parameters
  
  Returns
  
  gviz
  Graphviz digraph
docstring_tokens: Visualize a frequency directly - follows graph Parameters dfg Frequency Directly - follows graph log ( if provided ) Event log for the calculation of statistics activities_count ( if provided ) Dictionary associating to each activity the number of occurrences in the log . soj_time ( if provided ) Dictionary associating to each activity the average sojourn time parameters Variant - specific parameters Returns gviz Graphviz digraph
code: def apply(dfg: Dict[Tuple[str, str], int], log: EventLog = None, parameters: Optional[Dict[Any, Any]] = None, activities_count : Dict[str, int] = None, soj_time: Dict[str, float] = None) -> Digraph:
      """
      Visualize a frequency directly-follows graph
  
      Parameters
      -----------------
      dfg
          Frequency Directly-follows graph
      log
          (if provided) Event log for the calculation of statistics
      activities_count
          (if provided) Dictionary associating to each activity the number of occurrences in the log.
      soj_time
          (if provided) Dictionary associating to each activity the average sojourn time
      parameters
          Variant-specific parameters
  
      Returns
      -----------------
      gviz
          Graphviz digraph
      """
      if parameters is None:
          parameters = {}
  
      activity_key = exec_utils.get_param_value(Parameters.ACTIVITY_KEY, parameters, xes.DEFAULT_NAME_KEY)
      image_format = exec_utils.get_param_value(Parameters.FORMAT, parameters, "png")
      max_no_of_edges_in_diagram = exec_utils.get_param_value(Parameters.MAX_NO_EDGES_IN_DIAGRAM, parameters, 100000)
      start_activities = exec_utils.get_param_value(Parameters.START_ACTIVITIES, parameters, {})
      end_activities = exec_utils.get_param_value(Parameters.END_ACTIVITIES, parameters, {})
      font_size = exec_utils.get_param_value(Parameters.FONT_SIZE, parameters, 12)
      font_size = str(font_size)
      activities = dfg_utils.get_activities_from_dfg(dfg)
      bgcolor = exec_utils.get_param_value(Parameters.BGCOLOR, parameters, "transparent")
      stat_locale = exec_utils.get_param_value(Parameters.STAT_LOCALE, parameters, None)
      if stat_locale is None:
          stat_locale = {}
  
      if activities_count is None:
          if log is not None:
              activities_count = attr_get.get_attribute_values(log, activity_key, parameters=parameters)
          else:
              # 11/09/2021: if we have the specification of the start activities,
              # we can compute the activities count without the log in a smarter way.
              if type(start_activities) is dict and start_activities:
                  activities_count = {key: 0 for key in set(activities).union(set(start_activities))}
                  for act in start_activities:
                      activities_count[act] += start_activities[act]
                  for el in dfg:
                      activities_count[el[1]] += dfg[el]
              else:
                  activities_count = {key: 1 for key in activities}
  
      if soj_time is None:
          if log is not None:
              soj_time = soj_time_get.apply(log, parameters=parameters)
          else:
              soj_time = {key: 0 for key in activities}
  
      return graphviz_visualization(activities_count, dfg, image_format=image_format, measure="frequency",
                                    max_no_of_edges_in_diagram=max_no_of_edges_in_diagram,
                                    start_activities=start_activities, end_activities=end_activities, 
                                    soj_time=soj_time, font_size=font_size, bgcolor=bgcolor, stat_locale=stat_locale)
code_tokens: def apply ( dfg : Dict [ Tuple [ str , str ] , int ] , log : EventLog = None , parameters : Optional [ Dict [ Any , Any ] ] = None , activities_count : Dict [ str , int ] = None , soj_time : Dict [ str , float ] = None ) -> Digraph : if parameters is None : parameters = { } activity_key = exec_utils . get_param_value ( Parameters . ACTIVITY_KEY , parameters , xes . DEFAULT_NAME_KEY ) image_format = exec_utils . get_param_value ( Parameters . FORMAT , parameters , "png" ) max_no_of_edges_in_diagram = exec_utils . get_param_value ( Parameters . MAX_NO_EDGES_IN_DIAGRAM , parameters , 100000 ) start_activities = exec_utils . get_param_value ( Parameters . START_ACTIVITIES , parameters , { } ) end_activities = exec_utils . get_param_value ( Parameters . END_ACTIVITIES , parameters , { } ) font_size = exec_utils . get_param_value ( Parameters . FONT_SIZE , parameters , 12 ) font_size = str ( font_size ) activities = dfg_utils . get_activities_from_dfg ( dfg ) bgcolor = exec_utils . get_param_value ( Parameters . BGCOLOR , parameters , "transparent" ) stat_locale = exec_utils . get_param_value ( Parameters . STAT_LOCALE , parameters , None ) if stat_locale is None : stat_locale = { } if activities_count is None : if log is not None : activities_count = attr_get . get_attribute_values ( log , activity_key , parameters = parameters ) else : if type ( start_activities ) is dict and start_activities : activities_count = { key : 0 for key in set ( activities ) . union ( set ( start_activities ) ) } for act in start_activities : activities_count [ act ] += start_activities [ act ] for el in dfg : activities_count [ el [ 1 ] ] += dfg [ el ] else : activities_count = { key : 1 for key in activities } if soj_time is None : if log is not None : soj_time = soj_time_get . apply ( log , parameters = parameters ) else : soj_time = { key : 0 for key in activities } return graphviz_visualization ( activities_count , dfg , image_format = image_format , measure = "frequency" , max_no_of_edges_in_diagram = max_no_of_edges_in_diagram , start_activities = start_activities , end_activities = end_activities , soj_time = soj_time , font_size = font_size , bgcolor = bgcolor , stat_locale = stat_locale )
short_docstring: Visualize a frequency directly-follows graph
  Parameters
short_docstring_tokens: Visualize a frequency directly - follows graph Parameters
comment: """
      Visualize a frequency directly-follows graph
  
      Parameters
      -----------------
      dfg
          Frequency Directly-follows graph
      log
          (if provided) Event log for the calculation of statistics
      activities_count
          (if provided) Dictionary associating to each activity the number of occurrences in the log.
      soj_time
          (if provided) Dictionary associating to each activity the average sojourn time
      parameters
          Variant-specific parameters
  
      Returns
      -----------------
      gviz
          Graphviz digraph
      """$SEP$# 11/09/2021: if we have the specification of the start activities,$SEP$# we can compute the activities count without the log in a smarter way.