original_string: public static function is_anonymous_user($user) {
          if (preg_match('/^anon\d*$/', $user->username)) {
              $match = preg_match('/^anonfirstname\d*$/', $user->firstname);
              $match = $match && preg_match('/^anonlastname\d*$/', $user->lastname);
              // Check .com for backwards compatibility.
              $emailmatch = preg_match('/^anon\d*@doesntexist\.com$/', $user->email) ||
                  preg_match('/^anon\d*@doesntexist\.invalid$/', $user->email);
              if ($match && $emailmatch) {
                  return true;
              }
          }
          return false;
      }
code: public static function is_anonymous_user($user) {
          if (preg_match('/^anon\d*$/', $user->username)) {
              $match = preg_match('/^anonfirstname\d*$/', $user->firstname);
              $match = $match && preg_match('/^anonlastname\d*$/', $user->lastname);
              // Check .com for backwards compatibility.
              $emailmatch = preg_match('/^anon\d*@doesntexist\.com$/', $user->email) ||
                  preg_match('/^anon\d*@doesntexist\.invalid$/', $user->email);
              if ($match && $emailmatch) {
                  return true;
              }
          }
          return false;
      }
code_tokens: public static function is_anonymous_user ( $ user ) { if ( preg_match ( '/^anon\d*$/' , $ user -> username ) ) { $ match = preg_match ( '/^anonfirstname\d*$/' , $ user -> firstname ) ; $ match = $ match && preg_match ( '/^anonlastname\d*$/' , $ user -> lastname ) ; // Check .com for backwards compatibility. $ emailmatch = preg_match ( '/^anon\d*@doesntexist\.com$/' , $ user -> email ) || preg_match ( '/^anon\d*@doesntexist\.invalid$/' , $ user -> email ) ; if ( $ match && $ emailmatch ) { return true ; } } return false ; }
docstring: Determine if the given user is an 'anonymous' user, based on their username, firstname, lastname
  and email address.
  @param stdClass $user the user record to test
  @return bool true if this is an 'anonymous' user
docstring_tokens: Determine if the given user is an anonymous user based on their username firstname lastname and email address .