original_string: public function user_picture(stdClass $user, array $options = null) {
          $userpicture = new user_picture($user);
          foreach ((array)$options as $key=>$value) {
              if (array_key_exists($key, $userpicture)) {
                  $userpicture->$key = $value;
              }
          }
          return $this->render($userpicture);
      }
code: public function user_picture(stdClass $user, array $options = null) {
          $userpicture = new user_picture($user);
          foreach ((array)$options as $key=>$value) {
              if (array_key_exists($key, $userpicture)) {
                  $userpicture->$key = $value;
              }
          }
          return $this->render($userpicture);
      }
code_tokens: public function user_picture ( stdClass $ user , array $ options = null ) { $ userpicture = new user_picture ( $ user ) ; foreach ( ( array ) $ options as $ key => $ value ) { if ( array_key_exists ( $ key , $ userpicture ) ) { $ userpicture -> $ key = $ value ; } } return $ this -> render ( $ userpicture ) ; }
docstring: Returns HTML to display the specified user's avatar.
  
  User avatar may be obtained in two ways:
  <pre>
  // Option 1: (shortcut for simple cases, preferred way)
  // $user has come from the DB and has fields id, picture, imagealt, firstname and lastname
  $OUTPUT->user_picture($user, array('popup'=>true));
  
  // Option 2:
  $userpic = new user_picture($user);
  // Set properties of $userpic
  $userpic->popup = true;
  $OUTPUT->render($userpic);
  </pre>
  
  Theme developers: DO NOT OVERRIDE! Please override function
  {@link core_renderer::render_user_picture()} instead.
  
  @param stdClass $user Object with at least fields id, picture, imagealt, firstname, lastname
  If any of these are missing, the database is queried. Avoid this
  if at all possible, particularly for reports. It is very bad for performance.
  @param array $options associative array with user picture options, used only if not a user_picture object,
  options are:
  - courseid=$this->page->course->id (course id of user profile in link)
  - size=35 (size of image)
  - link=true (make image clickable - the link leads to user profile)
  - popup=false (open in popup)
  - alttext=true (add image alt attribute)
  - class = image class attribute (default 'userpicture')
  - visibletoscreenreaders=true (whether to be visible to screen readers)
  - includefullname=false (whether to include the user's full name together with the user picture)
  - includetoken = false (whether to use a token for authentication. True for current user, int value for other user id)
  @return string HTML fragment
docstring_tokens: Returns HTML to display the specified user s avatar .