Returns the template variables in key value format

@param array data
@return array
552107
public function getVariables() 
	{
		if(isset($this->attributes['class'])) {
			$this->attributes['class'] = trim($this
			->attributes['class'].' eden-field-tag');
		} else {
			$this->attributes['class'] = 'eden-field-tag';
		}
		
		$variables = parent::getVariables();
		
		$loaded = self::$loaded;
		self::$loaded = true;
		
		$variables['loaded'] = $loaded;
		$variables['options'] = $this->options;
		
		if(count($variables['options']) == 1) {
			$variables['options'] = $variables['options'][0];
		}
		
		return $variables;
	}
669552
protected function getVariables()
    {
        $reflection = new ReflectionClass($this);
        foreach ($reflection->getProperties(
            ReflectionProperty::IS_PROTECTED |
            ReflectionProperty::IS_PRIVATE |
            ReflectionProperty::IS_STATIC
        ) as $property) {
            $ignore[] = $property->name;
        }
        $values = [];
        foreach ($this as $prop => $value) {
            if (!in_array($prop, $ignore)) {
                if (is_object($value)) {
                    if (method_exists($value, 'jsonSerialize')) {
                        $value = $value->jsonSerialize();
                    } elseif (method_exists($value, 'getArrayCopy')) {
                        $value = $value->getArrayCopy();
                    }
                }
                $values[$prop] = $value;
            }
        }
        return $values;
    }
420383
public function variables()
    {
        return array_merge($this->variables, [
            'id'          => $this->id,
            'name'        => $this->elementName ?: $this->formatName($this->column),
            'help'        => $this->help,
            'class'       => $this->getElementClassString(),
            'value'       => $this->value(),
            'label'       => $this->label,
            'viewClass'   => $this->getViewElementClasses(),
            'column'      => $this->column,
            'errorKey'    => $this->getErrorKey(),
            'attributes'  => $this->formatAttributes(),
            'placeholder' => $this->getPlaceholder(),
        ]);
    }
702340
public List<String> getVariables() {
    return this.templateChunks.stream()
        .filter(templateChunk -> Expression.class.isAssignableFrom(templateChunk.getClass()))
        .map(templateChunk -> ((Expression) templateChunk).getName())
        .filter(Objects::nonNull)
        .collect(Collectors.toList());
  }
591772
public function getVariables() 
	{
		$order = null;
		if(!isset($this->query['sort']) || $this->query['sort'] != $this->key) {
			$this->query['sort'] = $this->key;
			$this->query['order'] = self::ASC;
		} else if($this->query['order'] == self::ASC) {
			$order = self::ASC;
			$this->query['order'] = self::DESC;
		} else {
			$order = self::DESC;
			$this->query['order'] = self::ASC;
		}
		
		return array(
			'url'	=> $this->url,
			'query' => $this->query,
			'label' => $this->label,
			'order'	=> strtolower($order),
			'class'	=> $this->className);
	}
1173306
function &get_template_vars($name=null)
	{
		if(!isset($name)) {
			return $this->_tpl_vars;
		} elseif(isset($this->_tpl_vars[$name])) {
			return $this->_tpl_vars[$name];
		} else {
			// var non-existant, return valid reference
			$_tmp = null;
			return $_tmp;
		}
	}
524321
public function getVariables()
    {
        $variables  = app()->make('antares.notifications')->all();
        $extensions = app()->make('antares.memory')->make('component')->get('extensions.active');

        if (empty($variables)) {
            return [];
        }
        $return = [];
        foreach ($variables as $extension => $config) {
            $name = ucfirst($extension == 'foundation' ? $extension : array_get($extensions, $extension . '.name'));
            $vars = $config['variables'];
            if (empty($vars)) {
                continue;
            }
            foreach ($vars as $key => $variable) {
                $return[$name][] = ['name' => $key, 'description' => isset($variable['description']) ? $variable['description'] : ''];
            }
        }
        Event::fire('notifications:' . snake_case(class_basename($this)) . '.variables', [&$return]);

        return $return;
    }
767170
protected function getPageTemplates()
    {
        $choices = [];

        $templates = $this->getContainer()->getParameter('networking_init_cms.page.templates');
        foreach ($templates as $key => $template) {
            $choices[$template['name']] = $key;
        }

        return $choices;
    }
8540
protected function getTwigVariables()
    {
        return array(
            'config' => $this->getConfig(),
            'base_dir' => rtrim($this->getRootDir(), '/'),
            'base_url' => rtrim($this->getBaseUrl(), '/'),
            'theme_dir' => $this->getThemesDir() . $this->getConfig('theme'),
            'theme_url' => $this->getBaseThemeUrl() . $this->getConfig('theme'),
            'site_title' => $this->getConfig('site_title'),
            'meta' => $this->meta,
            'content' => $this->content,
            'pages' => $this->pages,
            'prev_page' => $this->previousPage,
            'current_page' => $this->currentPage,
            'next_page' => $this->nextPage,
            'version' => static::VERSION
        );
    }
1044889
def extract_vars(template):
    
    keys = set()
    for match in re.finditer(r"\{\{ (?P<key>\w+) \}\}", template.getvalue()):
        keys.add(match.groups()[0])
    return sorted(list(keys))
851686
private static function get_key($template)
    {
        static $_is_stringy = array('string' => true, 'eval' => true);
        // calculate Uid if not already done
        if ($template->source->uid == '') {
            $template->source->filepath;
        }
        $key = $template->source->uid;
        if (isset(self::$template_data[$key])) {
            return $key;
        } else {
            if (isset($_is_stringy[$template->source->type])) {
                self::$template_data[$key]['name'] = '\'' . substr($template->source->name, 0, 25) . '...\'';
            } else {
                self::$template_data[$key]['name'] = $template->source->filepath;
            }
            self::$template_data[$key]['compile_time'] = 0;
            self::$template_data[$key]['render_time'] = 0;
            self::$template_data[$key]['cache_time'] = 0;

            return $key;
        }
    }
871509
public function getSuggestionFormat(array $data)
    {
        //if no suggestion format
        if (!isset($this->data['suggestion']) || !trim($this->data['suggestion'])) {
            //use best guess
            $suggestion = null;
            foreach ($data as $key => $value) {
                if (is_numeric($value)
                    || (
                        isset($value[0])
                        && is_numeric($value[0])
                    )
                ) {
                    continue;
                }

                $suggestion = $value;
                break;
            }

            //if still no suggestion
            if (is_null($suggestion)) {
                //just get the first one, i guess.
                foreach ($data as $key => $value) {
                    $suggestion = $value;
                    break;
                }
            }

            return $suggestion;
        }

        $template = cradle('global')->handlebars()->compile($this->data['suggestion']);

        return $template($data);
    }
881351
protected function getJSTemplateVars($vars)
    {
        if (is_array($vars)) {
            return $vars;
        }
        
        if ($this->hasMethod($vars)) {
            return $this->{$vars}();
        }
        
        return [];
    }
619692
public function getTemplates($dc)
	{
		$prefix = '';

		if($dc instanceof \MultiColumnWizard)
		{
			$dc->field = $dc->strField;
			$dc->table = $dc->strTable;
		}

		if(isset($GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templatePrefix']))
		{
			$prefix = $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templatePrefix'];
		}

		$key = null;

		if(isset($GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templateThemeId']))
		{
			$key = $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templateThemeId'];
		}

		$key = $key == '' ? null : $dc->activeRecord->$key;

		return $this->getTemplateGroup($prefix, $key);
	}
1319186
protected function getVariables(): array
    {
        $variables                  = $this->getBasicVariables();
        $variables['request']       = $this->request;
        $variables['className']     = $this->request->getName();

        return $variables;
    }
56740
public List<String> getVariableNames() {

		return variables.asList().stream() //
				.map(TemplateVariable::getName) //
				.collect(Collectors.toList());
	}
1093914
protected function getTemplateStrings()
    {
        $default = 'Expected {{actual}} to have a{{deep}}property {{key}}';
        $negated = 'Expected {{actual}} to not have a{{deep}}property {{key}}';

        if ($this->getValue() && $this->isActualValueSet()) {
            $default = 'Expected {{actual}} to have a{{deep}}property {{key}} of {{value}}, but got {{actualValue}}';
            $negated = 'Expected {{actual}} to not have a{{deep}}property {{key}} of {{value}}';
        }

        $deep = ' ';
        if ($this->isDeep()) {
            $deep = ' deep ';
        }

        return str_replace('{{deep}}', $deep, [$default, $negated]);
    }