()
return stat_dict
Initializes a dictionary which will hold statistics about compositions.

  Returns:
    A dictionary containing the appropriate fields initialized to 0 or an
    empty list.
Initializes a dictionary which will hold statistics about compositions.
Initializes a dictionary which will hold statistics about compositions .
def initialize_stat_dict():
  """Initializes a dictionary which will hold statistics about compositions.

  Returns:
    A dictionary containing the appropriate fields initialized to 0 or an
    empty list.
  """
  stat_dict = dict()

  for lag in [1, 2, 3]:
    stat_dict['autocorrelation' + str(lag)] = []

  stat_dict['notes_not_in_key'] = 0
  stat_dict['notes_in_motif'] = 0
  stat_dict['notes_in_repeated_motif'] = 0
  stat_dict['num_starting_tonic'] = 0
  stat_dict['num_repeated_notes'] = 0
  stat_dict['num_octave_jumps'] = 0
  stat_dict['num_fifths'] = 0
  stat_dict['num_thirds'] = 0
  stat_dict['num_sixths'] = 0
  stat_dict['num_seconds'] = 0
  stat_dict['num_fourths'] = 0
  stat_dict['num_sevenths'] = 0
  stat_dict['num_rest_intervals'] = 0
  stat_dict['num_special_rest_intervals'] = 0
  stat_dict['num_in_key_preferred_intervals'] = 0
  stat_dict['num_resolved_leaps'] = 0
  stat_dict['num_leap_twice'] = 0
  stat_dict['num_high_unique'] = 0
  stat_dict['num_low_unique'] = 0

  return stat_dict
def initialize_stat_dict ( ) : stat_dict = dict ( ) for lag in [ 1 , 2 , 3 ] : stat_dict [ 'autocorrelation' + str ( lag ) ] = [ ] stat_dict [ 'notes_not_in_key' ] = 0 stat_dict [ 'notes_in_motif' ] = 0 stat_dict [ 'notes_in_repeated_motif' ] = 0 stat_dict [ 'num_starting_tonic' ] = 0 stat_dict [ 'num_repeated_notes' ] = 0 stat_dict [ 'num_octave_jumps' ] = 0 stat_dict [ 'num_fifths' ] = 0 stat_dict [ 'num_thirds' ] = 0 stat_dict [ 'num_sixths' ] = 0 stat_dict [ 'num_seconds' ] = 0 stat_dict [ 'num_fourths' ] = 0 stat_dict [ 'num_sevenths' ] = 0 stat_dict [ 'num_rest_intervals' ] = 0 stat_dict [ 'num_special_rest_intervals' ] = 0 stat_dict [ 'num_in_key_preferred_intervals' ] = 0 stat_dict [ 'num_resolved_leaps' ] = 0 stat_dict [ 'num_leap_twice' ] = 0 stat_dict [ 'num_high_unique' ] = 0 stat_dict [ 'num_low_unique' ] = 0 return stat_dict