original_string: protected final function any_log($contextid, $user) {
          if (empty($this->activitylogs[$contextid])) {
              return false;
          }
  
          // Someone interacted with the activity if there is no user or the user interacted with the
          // activity if there is a user.
          if (empty($user) ||
                  (!empty($user) && !empty($this->activitylogs[$contextid][$user->id]))) {
              return true;
          }
  
          return false;
      }
code: protected final function any_log($contextid, $user) {
          if (empty($this->activitylogs[$contextid])) {
              return false;
          }
  
          // Someone interacted with the activity if there is no user or the user interacted with the
          // activity if there is a user.
          if (empty($user) ||
                  (!empty($user) && !empty($this->activitylogs[$contextid][$user->id]))) {
              return true;
          }
  
          return false;
      }
code_tokens: protected final function any_log ( $ contextid , $ user ) { if ( empty ( $ this -> activitylogs [ $ contextid ] ) ) { return false ; } // Someone interacted with the activity if there is no user or the user interacted with the // activity if there is a user. if ( empty ( $ user ) || ( ! empty ( $ user ) && ! empty ( $ this -> activitylogs [ $ contextid ] [ $ user -> id ] ) ) ) { return true ; } return false ; }
docstring: Do activity logs contain any log of user in this context?
  
  If user is empty we look for any log in this context.
  
  @param int $contextid
  @param \stdClass|false $user
  @return bool
docstring_tokens: Do activity logs contain any log of user in this context?