Wrap payload in ``os_default_template``
        relates to `Redmine #21169`_.

        .. _Redmine #21169: http://projects.theforeman.org/issues/21169
502202
def update_payload(self, fields=None):
        
        payload = super(OSDefaultTemplate, self).update_payload(fields)
        return {'os_default_template': payload}
544618
def os_requires_version(ostack_release, pkg):
    
    def wrap(f):
        @wraps(f)
        def wrapped_f(*args):
            if os_release(pkg) < ostack_release:
                raise Exception("This hook is not supported on releases"
                                " before %s" % ostack_release)
            f(*args)
        return wrapped_f
    return wrap
318538
function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters,
                     $placement )
    {
        $digestData = $operatorValue;
        switch ( $operatorName )
        {
            // Calculate and return crc32 polynomial.
            case $this->Crc32Name:
            {
                $operatorValue = eZSys::ezcrc32( $digestData );
            }break;

            // Calculate the MD5 hash.
            case $this->Md5Name:
            {
                $operatorValue = md5( $digestData );
            }break;

            // Calculate the SHA1 hash.
            case $this->Sha1Name:
            {
                $operatorValue = sha1( $digestData );
            }break;

            // Preform rot13 transform on the string.
            case $this->Rot13Name:
            {
                $operatorValue = str_rot13( $digestData );
            }break;

            // Default case: something went wrong - unknown things...
            default:
            {
                $tpl->warning( $operatorName, "Unknown input type '$operatorName'", $placement );
            } break;
        }
    }
153741
function default_1(opts = {}) {
    return Object.assign({}, ['get', 'head'].reduce((prev, cur) => (prev[cur] = ({ name, meta, url, options }) => request(Object.assign({}, opts, { url, method: cur.toUpperCase(), options })), prev), {}), ['post', 'put', 'patch', 'delete', 'options'].reduce((prev, cur) => (prev[cur] = ({ name, meta, url, body, options, type }) => request(Object.assign({}, opts, { url,
        type,
        options, method: cur.toUpperCase(), data: body })), prev), {}));
}
72961
def render_default_template(workitem)

      workitem = workitem.to_h if workitem.respond_to?(:to_h)

      s = []
      s << "workitem for #{workitem['participant_name']}"
      s << ''
      s << Rufus::Json.pretty_encode(workitem['fei'])
      s << ''
      workitem['fields'].keys.sort.each do |key|
        s << " - '#{key}'  ==>  #{Rufus::Json.encode(workitem['fields'][key])}"
      end
      s.join("\n")
    end
501619
def site_payload
      @cached_payload = begin
        payload = old_site_payload

        site_hooks.each do |hook|
          p = hook.merge_payload(payload, self)
          next unless p && p.is_a?(Hash)
          payload = Jekyll::Utils.deep_merge_hashes(payload, p)
        end
        payload
      end
    end
515629
def template_str(tem, queue=False, **kwargs):
    '''
    
    '''
    conflict = _check_queue(queue, kwargs)
    if conflict is not None:
        return conflict

    opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)

    try:
        st_ = salt.state.State(opts,
                               proxy=__proxy__,
                               initial_pillar=_get_initial_pillar(opts))
    except NameError:
        st_ = salt.state.State(opts, initial_pillar=_get_initial_pillar(opts))
    ret = st_.call_template_str(tem)
    _set_retcode(ret)
    return ret
1319779
def call_template_str(self, template):
        '''
        
        '''
        high = compile_template_str(template,
                                    self.rend,
                                    self.opts['renderer'],
                                    self.opts['renderer_blacklist'],
                                    self.opts['renderer_whitelist'])
        if not high:
            return high
        high, errors = self.render_template(high, '<template-str>')
        if errors:
            return errors
        return self.call_high(high)
387730
def template(basedir, text, vars, lookup_fatal=True, expand_lists=False):
    '''  '''

    try:
        text = text.decode('utf-8')
    except UnicodeEncodeError:
        pass # already unicode
    text = varReplace(basedir, unicode(text), vars, lookup_fatal=lookup_fatal, expand_lists=expand_lists)
    return text
1263826
def create_payload(self):
        """"""

        payload = super(JobTemplate, self).create_payload()
        effective_user = payload.pop(u'effective_user', None)
        if effective_user:
            payload[u'ssh'] = {u'effective_user': effective_user}

        return {u'job_template': payload}
1303763
def cmd_retr(param)
      send_unauthorised and return unless logged_in?
      send_param_required and return if param.nil?

      path = build_path(param)

      @driver.get_file(path) do |data|
        if data
          send_response "150 Data transfer starting #{data.size} bytes"
          send_outofband_data(data, @restart_pos || 0)
        else
          send_response "551 file not available"
        end
      end
    end
730001
def _generate_payload(author_icon, title, report):
    '''
    
    '''

    title = _sprinkle(title)

    unchanged = {
        'color': 'good',
        'title': 'Unchanged: {unchanged}'.format(unchanged=report['unchanged'].get('counter', None))
    }

    changed = {
        'color': 'warning',
        'title': 'Changed: {changed}'.format(changed=report['changed'].get('counter', None))
    }

    if report['changed'].get('tasks'):
        changed['fields'] = list(
            map(_format_task, report['changed'].get('tasks')))

    failed = {
        'color': 'danger',
        'title': 'Failed: {failed}'.format(failed=report['failed'].get('counter', None))
    }

    if report['failed'].get('tasks'):
        failed['fields'] = list(
            map(_format_task, report['failed'].get('tasks')))

    text = 'Function: {function}\n'.format(function=report.get('function'))
    if report.get('arguments'):
        text += 'Function Args: {arguments}\n'.format(
            arguments=str(list(map(str, report.get('arguments')))))

    text += 'JID: {jid}\n'.format(jid=report.get('jid'))
    text += 'Total: {total}\n'.format(total=report.get('total'))
    text += 'Duration: {duration:.2f} secs'.format(
        duration=float(report.get('duration')))

    payload = {
        'attachments': [
            {
                'fallback': title,
                'color': "#272727",
                'author_name': _sprinkle('{id}'),
                'author_link': _sprinkle('{localhost}'),
                'author_icon': author_icon,
                'title': 'Success: {success}'.format(success=str(report.get('success'))),
                'text': text
            },
            unchanged,
            changed,
            failed
        ]
    }

    return payload
232936
def _create_payload(payload):
        
        blocks, remainder = divmod(len(payload), BLOCKSIZE)
        if remainder > 0:
            payload += (BLOCKSIZE - remainder) * NUL
        return payload
780183
def monkey_patch_migration_template(self, app, fixture_path):
        
        self._MIGRATION_TEMPLATE = writer.MIGRATION_TEMPLATE
        module_split = app.module.__name__.split('.')

        if len(module_split) == 1:
            module_import = "import %s\n" % module_split[0]
        else:
            module_import = "from %s import %s\n" % (
                '.'.join(module_split[:-1]),
                module_split[-1:][0],
            )

        writer.MIGRATION_TEMPLATE = writer.MIGRATION_TEMPLATE\
            .replace(
                '%(imports)s',
                "%(imports)s" + "\nfrom django_migration_fixture import fixture\n%s" % module_import
            )\
            .replace(
                '%(operations)s', 
                "        migrations.RunPython(**fixture(%s, ['%s'])),\n" % (
                    app.label,
                    os.path.basename(fixture_path)
                ) + "%(operations)s\n" 
            )
564434
def default_payload
      {
        app_name: config.app_name,
        deployment_remote: deployment_remote,
        force_push: config.force_push,
        reference_point: source_control.reference_point,
      }
    end
212263
def _get_template_for_given_resolution(self, res, return_):
        """"""
        path = self._layer_files[self._res_indices[res][0]]
        if return_ == "path":
            return_value = path
        else:
            with rasterio.open(str(path)) as src:
                if return_ == "meta":
                    return_value = src.meta
                elif return_ == "windows":
                    return_value = tuple(src.block_windows())
                else:
                    raise ValueError("'return_' must be 'path', meta' or 'windows'.")
        return return_value
183977
def update_payload(self, fields=None):
        """"""
        org_payload = super(Organization, self).update_payload(fields)
        payload = {u'organization': org_payload}
        if 'redhat_repository_url' in org_payload:
            rh_repo_url = org_payload.pop('redhat_repository_url')
            payload['redhat_repository_url'] = rh_repo_url
        return payload