original_string: public static function get_user_dates($contextid, $contextlevel, $instanceid, $timestamps) {
          $params = self::validate_parameters(
              self::get_user_dates_parameters(),
              [
                  'contextid' => $contextid,
                  'contextlevel' => $contextlevel,
                  'instanceid' => $instanceid,
                  'timestamps' => $timestamps,
              ]
          );
  
          $context = self::get_context_from_params($params);
          self::validate_context($context);
  
          $formatteddates = array_map(function($timestamp) {
              return userdate($timestamp['timestamp'], $timestamp['format']);
          }, $params['timestamps']);
  
          return ['dates' => $formatteddates];
      }
code: public static function get_user_dates($contextid, $contextlevel, $instanceid, $timestamps) {
          $params = self::validate_parameters(
              self::get_user_dates_parameters(),
              [
                  'contextid' => $contextid,
                  'contextlevel' => $contextlevel,
                  'instanceid' => $instanceid,
                  'timestamps' => $timestamps,
              ]
          );
  
          $context = self::get_context_from_params($params);
          self::validate_context($context);
  
          $formatteddates = array_map(function($timestamp) {
              return userdate($timestamp['timestamp'], $timestamp['format']);
          }, $params['timestamps']);
  
          return ['dates' => $formatteddates];
      }
code_tokens: public static function get_user_dates ( $ contextid , $ contextlevel , $ instanceid , $ timestamps ) { $ params = self :: validate_parameters ( self :: get_user_dates_parameters ( ) , [ 'contextid' => $ contextid , 'contextlevel' => $ contextlevel , 'instanceid' => $ instanceid , 'timestamps' => $ timestamps , ] ) ; $ context = self :: get_context_from_params ( $ params ) ; self :: validate_context ( $ context ) ; $ formatteddates = array_map ( function ( $ timestamp ) { return userdate ( $ timestamp [ 'timestamp' ] , $ timestamp [ 'format' ] ) ; } , $ params [ 'timestamps' ] ) ; return [ 'dates' => $ formatteddates ] ; }
docstring: Format an array of timestamps.
  
  @param int|null $contextid The contenxt id
  @param string|null $contextlevel The context level
  @param int|null $instanceid The instnace id for the context level
  @param array $timestamps Timestamps to format
  @return array
docstring_tokens: Format an array of timestamps .