original_string: private function is_preference_enabled($name) {
          $processor = $this->processor;
          $preferences = $this->preferences;
          $defaultpreferences = get_message_output_default_preferences();
  
          $checked = false;
          // See if user has touched this preference.
          if (isset($preferences->{$name})) {
              // User has some preferences for this state in the database.
              $checked = isset($preferences->{$name}[$processor->name]);
          } else {
              // User has not set this preference yet, using site default preferences set by admin.
              $defaultpreference = 'message_provider_'.$name;
              if (isset($defaultpreferences->{$defaultpreference})) {
                  $checked = (int)in_array($processor->name, explode(',', $defaultpreferences->{$defaultpreference}));
              }
          }
  
          return $checked;
      }
code: private function is_preference_enabled($name) {
          $processor = $this->processor;
          $preferences = $this->preferences;
          $defaultpreferences = get_message_output_default_preferences();
  
          $checked = false;
          // See if user has touched this preference.
          if (isset($preferences->{$name})) {
              // User has some preferences for this state in the database.
              $checked = isset($preferences->{$name}[$processor->name]);
          } else {
              // User has not set this preference yet, using site default preferences set by admin.
              $defaultpreference = 'message_provider_'.$name;
              if (isset($defaultpreferences->{$defaultpreference})) {
                  $checked = (int)in_array($processor->name, explode(',', $defaultpreferences->{$defaultpreference}));
              }
          }
  
          return $checked;
      }
code_tokens: private function is_preference_enabled ( $ name ) { $ processor = $ this -> processor ; $ preferences = $ this -> preferences ; $ defaultpreferences = get_message_output_default_preferences ( ) ; $ checked = false ; // See if user has touched this preference. if ( isset ( $ preferences -> { $ name } ) ) { // User has some preferences for this state in the database. $ checked = isset ( $ preferences -> { $ name } [ $ processor -> name ] ) ; } else { // User has not set this preference yet, using site default preferences set by admin. $ defaultpreference = 'message_provider_' . $ name ; if ( isset ( $ defaultpreferences -> { $ defaultpreference } ) ) { $ checked = ( int ) in_array ( $ processor -> name , explode ( ',' , $ defaultpreferences -> { $ defaultpreference } ) ) ; } } return $ checked ; }
docstring: Check if the given preference is enabled or not.
  
  @param string $name preference name
  @return bool
docstring_tokens: Check if the given preference is enabled or not .