original_string: public static function create_from_user(\stdClass $user, $forgottenreset = false) {
          $data = array(
              'context' => \context_user::instance($user->id),
              'relateduserid' => $user->id,
              'other' => array('forgottenreset' => $forgottenreset),
          );
          $event = self::create($data);
          $event->add_record_snapshot('user', $user);
          return $event;
      }
code: public static function create_from_user(\stdClass $user, $forgottenreset = false) {
          $data = array(
              'context' => \context_user::instance($user->id),
              'relateduserid' => $user->id,
              'other' => array('forgottenreset' => $forgottenreset),
          );
          $event = self::create($data);
          $event->add_record_snapshot('user', $user);
          return $event;
      }
code_tokens: public static function create_from_user ( \ stdClass $ user , $ forgottenreset = false ) { $ data = array ( 'context' => \ context_user :: instance ( $ user -> id ) , 'relateduserid' => $ user -> id , 'other' => array ( 'forgottenreset' => $ forgottenreset ) , ) ; $ event = self :: create ( $ data ) ; $ event -> add_record_snapshot ( 'user' , $ user ) ; return $ event ; }
docstring: Create event for user password changing and resetting.
  
  @param \stdClass $user
  @param bool $forgottenreset true if reset via recovery link
  @return user_password_updated
docstring_tokens: Create event for user password changing and resetting .