original_string: public static function get_lock_configuration_from_data($plugin, $data) {
          global $CFG;
          $file = $CFG->dirroot.'/cache/locks/'.$plugin.'/lib.php';
          if (!file_exists($file)) {
              throw new coding_exception('Invalid cache plugin provided. '.$file);
          }
          require_once($file);
          $class = 'cachelock_'.$plugin;
          if (!class_exists($class)) {
              throw new coding_exception('Invalid cache plugin provided.');
          }
          if (array_key_exists('cache_is_configurable', class_implements($class))) {
              return $class::config_get_configuration_array($data);
          }
          return array();
      }
code: public static function get_lock_configuration_from_data($plugin, $data) {
          global $CFG;
          $file = $CFG->dirroot.'/cache/locks/'.$plugin.'/lib.php';
          if (!file_exists($file)) {
              throw new coding_exception('Invalid cache plugin provided. '.$file);
          }
          require_once($file);
          $class = 'cachelock_'.$plugin;
          if (!class_exists($class)) {
              throw new coding_exception('Invalid cache plugin provided.');
          }
          if (array_key_exists('cache_is_configurable', class_implements($class))) {
              return $class::config_get_configuration_array($data);
          }
          return array();
      }
code_tokens: public static function get_lock_configuration_from_data ( $ plugin , $ data ) { global $ CFG ; $ file = $ CFG -> dirroot . '/cache/locks/' . $ plugin . '/lib.php' ; if ( ! file_exists ( $ file ) ) { throw new coding_exception ( 'Invalid cache plugin provided. ' . $ file ) ; } require_once ( $ file ) ; $ class = 'cachelock_' . $ plugin ; if ( ! class_exists ( $ class ) ) { throw new coding_exception ( 'Invalid cache plugin provided.' ) ; } if ( array_key_exists ( 'cache_is_configurable' , class_implements ( $ class ) ) ) { return $ class :: config_get_configuration_array ( $ data ) ; } return array ( ) ; }
docstring: Gets configuration data from a new lock instance form.
  
  @param string $plugin
  @param stdClass $data
  @return array
  @throws coding_exception
docstring_tokens: Gets configuration data from a new lock instance form .