a public method to help report engines to introspect
        a template and find what data it needs and how it will be
        used
        returns a list of user variable names without starting 'py3o.
165837
def get_user_variables(self):
        """'"""
        # TODO: Check if some user fields are stored in other content_trees
        return [
            e.get('{%s}name' % e.nsmap.get('text'))[5:]
            for e in get_user_fields(self.content_trees[0], self.namespaces)
        ]
405318
def instance_variables(self):
        
        p = lambda o: isinstance(o, Variable) and self.module._docfilter(o)
        return filter(p, self.doc_init.values())
597092
def private_name_for(var_name, cls):
    """"""
    if not (isinstance(var_name, string_types) and var_name):
        raise TypeError('var_name must be non-empty string')
    if not (isinstance(cls, type) or isinstance(cls, string_types)):  # pylint: disable=consider-merging-isinstance
        raise TypeError('cls not a class or string')
    if __PRIVATE_NAME_PATTERN.match(var_name):
        class_name = cls.__name__ if isinstance(cls, type) else cls
        return '_%s%s' % (class_name.lstrip('_'), var_name)
    else:
        return var_name
736040
def _list_templates(settings):
    
    for idx, option in enumerate(settings.config.get("project_templates"), start=1):
        puts("  {0!s:5} {1!s:36}".format(
            colored.yellow("[{0}]".format(idx)),
            colored.cyan(option.get("name"))
        ))
        if option.get("url"):
            puts("      {0}\n".format(option.get("url")))
116286
def get(self):
    """"""
    template_values = {
        'back_url': '/',
        'back_msg': 'View Accounts',
        'logout_url': users.create_logout_url('/'),
        'user_nickname': users.get_current_user().nickname()
    }
    try:
      try:
        app_user = InitUser()

        template_values['email'] = app_user.email if app_user.email else ''
        template_values['client_id'] = (app_user.client_id if app_user.client_id
                                        else '')
        template_values['client_secret'] = (app_user.client_secret if
                                            app_user.client_secret else '')
        template_values['refresh_token'] = (app_user.refresh_token if
                                            app_user.refresh_token else '')
        template_values['adwords_manager_cid'] = (
            app_user.adwords_manager_cid if app_user.adwords_manager_cid else ''
        )
        template_values['dev_token'] = (app_user.developer_token if
                                        app_user.developer_token else '')
      except Exception, e:
        template_values['error'] = str(e)
    finally:
      # Use template to write output to the page.
      path = os.path.join(os.path.dirname(__file__),
                          '../templates/show_credentials.html')
      self.response.out.write(template.render(path, template_values))
782579
def get_template_names(self):
        
        if self.request.is_ajax():
            return [self.list_template_name]
        else:
            return super(UserMaps, self).get_template_names()
452665
def get_variables(self, variables=None):
        
        # Global policy variable expansion, we have to carry forward on
        # various filter/action local vocabularies. Where possible defer
        # by using a format string.
        #
        # See https://github.com/capitalone/cloud-custodian/issues/2330
        if not variables:
            variables = {}

        if 'mode' in self.data:
            if 'role' in self.data['mode'] and not self.data['mode']['role'].startswith("arn:aws"):
                self.data['mode']['role'] = "arn:aws:iam::%s:role/%s" % \
                                            (self.options.account_id, self.data['mode']['role'])

        variables.update({
            # standard runtime variables for interpolation
            'account': '{account}',
            'account_id': self.options.account_id,
            'region': self.options.region,
            # non-standard runtime variables from local filter/action vocabularies
            #
            # notify action
            'policy': self.data,
            'event': '{event}',
            # mark for op action
            'op': '{op}',
            'action_date': '{action_date}',
            # tag action pyformat-date handling
            'now': utils.FormatDate(datetime.utcnow()),
            # account increase limit action
            'service': '{service}',
            # s3 set logging action :-( see if we can revisit this one.
            'bucket_region': '{bucket_region}',
            'bucket_name': '{bucket_name}',
            'source_bucket_name': '{source_bucket_name}',
            'target_bucket_name': '{target_bucket_name}',
            'target_prefix': '{target_prefix}',
            'LoadBalancerName': '{LoadBalancerName}'
        })
        return variables
505350
def render_source(self, source, variables=None):
        
        if variables is None:
            variables = {}
        template = self._engine.from_string(source)
        return template.render(**variables)
1077626
def printed_out(self, name):
        
        out = ''
        out += '|\n'
        if self._id_variable:
            subs = '[{}]'.format(self._id_variable)
        else:
            subs = ''
        out += '|---{}{}\n'.format(name, subs)
        if self._description:
            out += '|   |   {}\n'.format(self._description)
        for name, action in self._actions.items():
            out += action.printed_out(name)
        return out
1220494
def get_pwiz_tables(self, engine, database):
        '''
        
        '''
        introspector = pwiz.make_introspector(engine, database.database,
            **database.connect_kwargs)
        out_file = '/tmp/db_models.py'

        with Capturing() as code:
            pwiz.print_models(introspector)
        code = '\n'.join(code)
        # Unfortunately, introspect.getsource doesn't seem to work
        # with dynamically created classes unless it is written out
        # to a file. So write it out to a temporary file
        with open(out_file, 'w') as file_:
            file_.write(code)
        # Load up the DB models as a new module so that we can
        # compare them with those in the model definition
        return imp.load_source('db_models', out_file)
3969
def select_template(template_name_list, using=None):
    
    if isinstance(template_name_list, six.string_types):
        raise TypeError(
            'select_template() takes an iterable of template names but got a '
            'string: %r. Use get_template() if you want to load a single '
            'template by name.' % template_name_list
        )

    engines = _engine_list(using)
    for template_name in template_name_list:
        for engine in engines:
            try:
                return engine.get_template(template_name)
            except TemplateDoesNotExist as e:
                pass

    if template_name_list:
        raise TemplateDoesNotExist(', '.join(template_name_list))
    else:
        raise TemplateDoesNotExist("No template names provided")
956889
def extract_values(self, possible_solution, use_defaults=False):
        
        defaults = self._vardefaults if use_defaults else {}
        values = list(self._template)
        for i, var in enumerate(self._vars):
            values[i] = possible_solution.get(var, defaults.get(var, NilObject()))
        return values
107579
def get_template_names(self):
        
        if self.request.is_ajax():
            return [self.list_template_name]
        else:
            return super(Search, self).get_template_names()
111254
public synchronized List<VariableDescription> getUsedVariableDescriptions(String template) {
		Template templateImpl = getTemplate(template, null);
		return templateImpl.getUsedVariableDescriptions();
	}
83018
def _render_name(self):
        
        if not self.process.data_name or self.named_by_user:  # pylint: disable=no-member
            return

        inputs = copy.deepcopy(self.input)
        hydrate_input_references(inputs, self.process.input_schema, hydrate_values=False)  # pylint: disable=no-member
        template_context = inputs

        try:
            name = render_template(
                self.process,
                self.process.data_name,  # pylint: disable=no-member
                template_context
            )
        except EvaluationError:
            name = '?'

        self.name = name
812867
def copy_public_vars(self):
        
        vars = self.get_vars()
        vars = dict([k for k in list(vars.items()) if not k[0].startswith('_')])
        return deepcopy(vars)
730837
def template_stack(name=None, profile=None):
    '''
    
    '''
    h_client = _auth(profile)

    if not name:
        return {
            'result': False,
            'comment':
                'Parameter name missing or None'
            }
    try:
        get_template = h_client.stacks.template(name)
    except heatclient.exc.HTTPNotFound:
        return {
            'result': False,
            'comment': 'No stack with {0}'.format(name)
            }
    except heatclient.exc.BadRequest:
        return {
            'result': False,
            'comment': 'Bad request fot stack {0}'.format(name)
            }
    if 'heat_template_version' in get_template:
        template = salt.utils.yaml.safe_dump(get_template)
    else:
        template = jsonutils.dumps(get_template, indent=2, ensure_ascii=False)

    checksum = __salt__['hashutil.digest'](template)
    ret = {
        'template': template,
        'result': True,
        'checksum': checksum
    }
    return ret