Execute hiera and return the data
760482
def ext_pillar(minion_id,  # pylint: disable=W0613
               pillar,  # pylint: disable=W0613
               conf):
    '''
    
    '''
    cmd = 'hiera -c {0}'.format(conf)
    for key, val in six.iteritems(__grains__):
        if isinstance(val, six.string_types):
            cmd += ' {0}=\'{1}\''.format(key, val)
    try:
        data = salt.utils.yaml.safe_load(__salt__['cmd.run'](cmd))
    except Exception:
        log.critical('Hiera YAML data failed to parse from conf %s', conf)
        return {}
    return data
59891
def execute(self, input_data):
        '''  '''
        raw_bytes = input_data['sample']['raw_bytes']

        # Have the PE File module process the file
        try:
            pefile_handle = pefile.PE(data=raw_bytes, fast_load=False)
        except (AttributeError, pefile.PEFormatError), error:
            return {'error':  str(error), 'match_list': []}

        # Now get information from PEID module
        peid_match = self.peid_features(pefile_handle)
        return {'match_list': peid_match}
586378
def execute(self):
    

    jvm_resolve_subsystem = JvmResolveSubsystem.global_instance()
    if jvm_resolve_subsystem.get_options().resolver != 'coursier':
      return

    # executor = self.create_java_executor()
    classpath_products = self.context.products.get_data('compile_classpath',
                                                        init_func=ClasspathProducts.init_func(
                                                          self.get_options().pants_workdir))
    executor = self.create_java_executor()
    self.resolve(self.context.targets(), classpath_products, sources=False, javadoc=False, executor=executor)
906893
@Override
	public void execute() {
		// save archive dir of the outer module so it can be reset later
		String previousArchiveDir = archiveDirProvider.get().getPath();

		try {
			// make sure archive dirs are within that of the container module
			moduleArchiveDir = moduleArchiveDirProvider.get().getPath();
			config.put(JFunkConstants.ARCHIVE_DIR, moduleArchiveDir);

			for (ModuleWithCallbacks moduleWithCallbacks : modulesWithCallbacks) {
				TestModule testModule = moduleWithCallbacks.testModule;

				Runnable beforeModuleCallback = moduleWithCallbacks.beforeModuleCallback;
				if (beforeModuleCallback != null) {
					beforeModuleCallback.run();
				}

				scriptContext.run(testModule);

				Runnable afterModuleCallback = moduleWithCallbacks.afterModuleCallback;
				if (afterModuleCallback != null) {
					afterModuleCallback.run();
				}
			}
		} finally {
			// reset for outer module, so property is correctly archived
			config.put(JFunkConstants.ARCHIVE_DIR, previousArchiveDir);

			// it does not make sense to archive datasets in the container module,
			// these would be those of the test module executed last
			config.put(JFunkConstants.ARCHIVE_DATASETS, "false");
		}
	}
502340
def hgetall(self, name):
        
        with self.pipe as pipe:
            f = Future()
            res = pipe.hgetall(self.redis_key(name))

            def cb():
                data = {}
                m_decode = self.memberparse.decode
                v_decode = self._value_decode
                for k, v in res.result.items():
                    k = m_decode(k)
                    v = v_decode(k, v)
                    data[k] = v
                f.set(data)

            pipe.on_execute(cb)
            return f
1289629
def execute(self, input_data):
        '''  '''
        input_data = input_data['help_base']
        type_tag = input_data['type_tag']

        # Standard help text
        if type_tag == 'help':
            output = '%s%s%s' % (color.LightBlue, input_data['help'], color.Normal)

        # Worker
        elif type_tag == 'worker':
            output = '%s%s' % (color.Yellow, input_data['name'])
            output += '\n    %sInput: %s%s%s' % (color.LightBlue, color.Green, input_data['dependencies'], color.Normal)
            output += '\n    %s%s' % (color.Green, input_data['docstring'])

        # Command
        elif type_tag == 'command':
            output = '%s%s%s %s' % (color.Yellow, input_data['command'], color.LightBlue, input_data['sig'])
            output += '\n    %s%s%s' % (color.Green, input_data['docstring'], color.Normal)

        # WTF: Alert on unknown type_tag and return a string of the input_data
        else:
            print 'Alert: help_formatter worker received malformed object: %s' % str(input_data)
            output = '\n%s%s%s' % (color.Red, str(input_data), color.Normal)

        # Return the formatted and colored help
        return {'help': output}
692960
def execute(self, i, o):
        
        config = self._get_config(i)
        self._resolver = DatabaseManager(config)
520725
def do_execute(self):
        
        relname = self.resolve_option("name")
        if isinstance(self.input.payload, Instance):
            self.input.payload.dataset.relationname = relname
        else:
            self.input.payload.relationname = relname
        self._output.append(self.input)
        return None
330030
def execute(self):
    
    if JvmResolveSubsystem.global_instance().get_options().resolver != 'ivy':
      return

    compile_classpath = self.context.products.get_data('compile_classpath',
        init_func=ClasspathProducts.init_func(self.get_options().pants_workdir))

    targets = self.context.targets()
    if all(not isinstance(target, JarLibrary) for target in targets):
      if self._report:
        self.context.log.info("Not generating a report. No resolution performed.")
      return

    executor = self.create_java_executor()
    results = self.resolve(executor=executor,
                                      targets=targets,
                                      classpath_products=compile_classpath,
                                      confs=self.get_options().confs,
                                      extra_args=self._args)
    if self._report:
      results_with_resolved_artifacts = [r for r in results if r.has_resolved_artifacts]

      if not results_with_resolved_artifacts:
        self.context.log.info("Not generating a report. No resolution performed.")
      else:
        for result in results_with_resolved_artifacts:
          self._generate_ivy_report(result)
30025
def run(data):
    
    bwakit_dir = os.path.dirname(os.path.realpath(utils.which("run-bwamem")))
    hla_fqs = tz.get_in(["hla", "fastq"], data, [])
    if len(hla_fqs) > 0:
        hla_base = os.path.commonprefix(hla_fqs)
        while hla_base.endswith("."):
            hla_base = hla_base[:-1]
        out_file = hla_base + ".top"
        if not utils.file_exists(out_file):
            cmd = "{bwakit_dir}/run-HLA {hla_base}"
            do.run(cmd.format(**locals()), "HLA typing with bwakit")
            out_file = _organize_calls(out_file, hla_base, data)
        data["hla"].update({"call_file": out_file,
                            "hlacaller": "bwakit"})
    return data
280760
def do_execute(self):
        
        data = self.input.payload
        search = self.config["search"].shallow_copy()
        evl = self.config["eval"].shallow_copy()
        asel = attsel.AttributeSelection()
        asel.search(search)
        asel.evaluator(evl)
        asel.select_attributes(data)
        cont = AttributeSelectionContainer(
            original=data,
            reduced=asel.reduce_dimensionality(data),
            num_atts=asel.number_attributes_selected,
            selected=asel.selected_attributes,
            results=asel.results_string)
        self._output.append(Token(cont))
        return None
129998
async def main():
    """"""
    redis = await aioredis.create_redis(
        'redis://localhost')

    await redis.mset('key:1', 'value1', 'key:2', 'value2')
    cur = b'0'  # set initial cursor to 0
    while cur:
        cur, keys = await redis.scan(cur, match='key:*')
        print("Iteration results:", keys)

    redis.close()
    await redis.wait_closed()
521298
def execute(self, ignore_cache=False, raise_on_error=True):
        
        if ignore_cache or not hasattr(self, '_response'):
            es = connections.get_connection(self._using)

            responses = es.msearch(
                index=self._index,
                body=self.to_dict(),
                **self._params
            )

            out = []
            for s, r in zip(self._searches, responses['responses']):
                if r.get('error', False):
                    if raise_on_error:
                        raise TransportError('N/A', r['error']['type'], r['error'])
                    r = None
                else:
                    r = Response(s, r)
                out.append(r)

            self._response = out

        return self._response
335014
def execute(self, input_data):
        '''  '''
        raw_bytes = input_data['sample']['raw_bytes']
        zipfile_output = zipfile.ZipFile(StringIO(raw_bytes))
        payload_md5s = []
        for name in zipfile_output.namelist():
            filename = os.path.basename(name)
            payload_md5s.append(self.workbench.store_sample(zipfile_output.read(name), name, 'unknown'))
        return {'payload_md5s': payload_md5s}
106892
def __execute_queries(self):
        """"""

        def func(item):
            or_check = False
            for queries in self._queries:
                and_check = True
                for query in queries:
                    and_check &= self._matcher._match(
                        item.get(query.get('key'), None),
                        query.get('operator'),
                        query.get('value')
                    )
                or_check |= and_check
            return or_check

        self._json_data = list(filter(lambda item: func(item), self._json_data))
321251
public function execute()
    {
        $request       = $this->_request;
        $iTotalRecords = $this->_queryBuilder->getTotalRecords();
        list($data, $objects) = $this->_queryBuilder->getData();
        $id_index      = array_search('_identifier_', array_keys($this->getFields()));
        $ids           = array();
        array_walk($data, function($val, $key) use ($id_index, &$ids) {
            $ids[$key] = $val[$id_index];
        });
        if (!is_null($this->_fixed_data))
        {
            $this->_fixed_data = array_reverse($this->_fixed_data);
            foreach ($this->_fixed_data as $item)
            {
                array_unshift($data, $item);
            }
        }
        if (!is_null($this->_renderer))
        {
            array_walk($data, $this->_renderer);
        }
        if (!is_null($this->_renderer_obj))
        {
            $this->_renderer_obj->applyTo($data, $objects);
        }
        if (!empty($this->_multiple))
        {
            array_walk($data, function($val, $key) use(&$data, $ids) {
                array_unshift($val, "<input type='checkbox' name='dataTables[actions][]' value='{$ids[$key]}' />");
                $data[$key] = $val;
            });
        }
        $output = array(
            "sEcho"                => intval($request->get('sEcho')),
            "iTotalRecords"        => $iTotalRecords,
            "iTotalDisplayRecords" => $iTotalRecords,
            "aaData"               => $data
        );
        return new JsonResponse($output);
    }
513018
def get(path: nil, headers: {}, query: {})
      execute(method: :get, path: path, query: query, headers: headers)
    end