Create a prompt which implements the `store` feature.

    :param name: name of the generator
    :return: prompt
766530
def create_store_prompt(name):
    
    def _prompt(questions, answers=None, **kwargs):
        stored_answers = _read_stored_answers(name)

        to_store = []
        for q in questions:
            if 'store' in q:
                if q.pop('store'):  # remove it so whaaaaat does not bark
                    to_store.append(q['name'])
                    if q['name'] in stored_answers:
                        q['default'] = stored_answers[q['name']]

        answers = prompt(questions, answers, **kwargs)
        if to_store:
            # save answers for questions flagged with 'store'
            for s in to_store:
                if s in answers:
                    stored_answers[s] = answers[s]
            _store_answers(name, stored_answers)
        return answers
    return _prompt
149693
function(name, options) {
        debug('.getSubGenerator', name);
        var segs = name.split('.');
        var len = segs.length;
        var idx = -1;
        var app = this;

        while (++idx < len) {
          var key = segs[idx];
          app = app.getGenerator(key, options);
          if (!app) {
            break;
          }
        }
        return app;
      }
615029
def store(self, name=None):
        
        if name is None:
            name = self.get_default_driver()

        self._stores[name] = self._get(name)

        return self._stores[name]
1084240
def access_storage_create(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('access:storage:create', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
    })
1135319
def register(self, name):
        
        def register_func(func):
            self.store[name] = func
            return func
        return register_func
982455
def _create_process(self, process, name):
        
        def _run():
            process.initialize()
            try:
                while not self.stop_flag.is_set():
                    process.loop()
            except KeyboardInterrupt:
                pass
            except:
                self._logger.exception('Process %s died!', name)
        return self.environment.create_process(_run, name)
812990
def create_writer(name, *args, format=None, registry=default_registry, **kwargs):
    
    return registry.get_writer_factory_for(name, format=format)(name, *args, **kwargs)
1287371
def set_name(self,name=None):
        
        if name:
            self.name = name[:254]
        else:
            self.name = self.extract_name()[:254]

        self.save()

        return self.name
1239449
def get_named_graph(identifier, store_id=DEFAULT_STORE, create=True):
    
    if not isinstance(identifier, URIRef):
        identifier = URIRef(identifier)

    store = DjangoStore(store_id)
    graph = Graph(store, identifier=identifier)
    if graph.open(None, create=create) != VALID_STORE:
        raise ValueError("The store identified by {0} is not a valid store".format(store_id))
    return graph
1061836
def create(self, name, **kwds):
        
        result = self._client.post("/album/create.json",
                                   name=name, **kwds)["result"]
        return Album(self._client, result)
1327091
def create_item(self, name):
        
        elem = self.controlled_list.create_item(name)
        if elem:
            return TodoElementUX(parent=self, controlled_element=elem)
777134
public void setupOutputPath(String name) {
        // get stream filename generator
        IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils.getScopeService(scope, IStreamFilenameGenerator.class, DefaultStreamFilenameGenerator.class);
        // generate file path
        String filePath = generator.generateFilename(scope, name, ".flv", GenerationType.RECORD);
        this.path = generator.resolvesToAbsolutePath() ? Paths.get(filePath) : Paths.get(System.getProperty("red5.root"), "webapps", scope.getContextPath(), filePath);
        // if append was requested, ensure the file we want to append exists (append==record)
        File appendee = getFile();
        if (IClientStream.MODE_APPEND.equals(mode) && !appendee.exists()) {
            try {
                if (appendee.createNewFile()) {
                    log.debug("New file created for appending");
                } else {
                    log.debug("Failure to create new file for appending");
                }
            } catch (IOException e) {
                log.warn("Exception creating replacement file for append", e);
            }
        }
    }
307864
def _get_generator(self, name):
        
        for ep in pkg_resources.iter_entry_points(self.group, name=None):
            if ep.name == name:
                generator = ep.load()
                return generator
113469
async def create(cls, name: str,
                     default_for_unspecified: int,
                     total_resource_slots: int,
                     max_concurrent_sessions: int,
                     max_containers_per_session: int,
                     max_vfolder_count: int,
                     max_vfolder_size: int,
                     idle_timeout: int,
                     allowed_vfolder_hosts: Sequence[str],
                     fields: Iterable[str] = None) -> dict:
        
        if fields is None:
            fields = ('name',)
        q = 'mutation($name: String!, $input: CreateKeyPairResourcePolicyInput!) {' \
            + \
            '  create_keypair_resource_policy(name: $name, props: $input) {' \
            '    ok msg resource_policy { $fields }' \
            '  }' \
            '}'
        q = q.replace('$fields', ' '.join(fields))
        variables = {
            'name': name,
            'input': {
                'default_for_unspecified': default_for_unspecified,
                'total_resource_slots': total_resource_slots,
                'max_concurrent_sessions': max_concurrent_sessions,
                'max_containers_per_session': max_containers_per_session,
                'max_vfolder_count': max_vfolder_count,
                'max_vfolder_size': max_vfolder_size,
                'idle_timeout': idle_timeout,
                'allowed_vfolder_hosts': allowed_vfolder_hosts,
            },
        }
        rqst = Request(cls.session, 'POST', '/admin/graphql')
        rqst.set_json({
            'query': q,
            'variables': variables,
        })
        async with rqst.fetch() as resp:
            data = await resp.json()
            return data['create_keypair_resource_policy']
255026
def generate_cert(name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': ''}
    cert = "{0}{1}.crt".format(get_certs_path(), name)
    key = "{0}{1}.key".format(get_certs_path(), name)

    # Checking if execution is needed.
    if os.path.isfile(cert) and os.path.isfile(key):
        ret['comment'] = 'No execution needed. Cert: {0} and key: {1} already generated.'.format(cert, key)
        return ret
    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'Certificate and key generation would be executed'
        return ret

    # Executing the command.
    cert_save = __salt__['icinga2.generate_cert'](name)
    if not cert_save['retcode']:
        ret['comment'] = "Certificate and key generated"
        ret['changes']['cert'] = "Executed. Certificate saved: {0}".format(cert)
        ret['changes']['key'] = "Executed. Key saved: {0}".format(key)
    return ret
1319724
def create_snapshot(self, volume, name=None, description=None, force=False):
        
        return self._snapshot_manager.create(volume=volume, name=name,
                description=description, force=force)
1079087
def spawn(name)
      if all_services.include?(name)
        name = name.to_s
        require "geocoder/lookups/#{name}"
        Geocoder::Lookup.const_get(classify_name(name)).new
      else
        valids = all_services.map(&:inspect).join(", ")
        raise ConfigurationError, "Please specify a valid lookup for Geocoder " +
          "(#{name.inspect} is not one of: #{valids})."
      end
    end