define an action to load quote data
164296
async function loadQuote(store, quoteId) {
  const quote = await fetchQuote(quoteId)
  await store.update(state => {
    if (!state.quotes) {
      state.quotes = {}
    }
    state.quotes[quoteId] = quote
  })
  return { quoteId }
}
1068831
private static int quote(final StringBuilder target, final String string, final int start) {
        int i = quoteSingle(target, string, start);
        if (i < 0) i = quoteBlock(target, string, start, -i);
        return i;
    }
82995
private static void maybeQuote(StringBuilder buff, String value) {
        // PK48169 - handle a null value as well as an empty one
        if (null == value || 0 == value.length()) {
            buff.append("\"\"");
        } else if (needsQuote(value)) {
            buff.append('"');
            buff.append(value);
            buff.append('"');
        } else {
            buff.append(value);
        }
    }
1368833
def _set_data(self, action):
        
        data = self._load_response(action)

        self._handle_continuations(data, 'category')

        if action == 'category':
            members = data.get('query').get('categorymembers')
            if members:
                self._add_members(members)

        if action == 'random':
            rand = data['query']['random'][0]
            data = {'pageid': rand.get('id'),
                    'title': rand.get('title')}
            self.data.update(data)
            self.params.update(data)
890586
def execute(global_options,options,arguments) 
      get_action(arguments).call(global_options,options,arguments)
    end
101417
function applyQuotes( $text, &$parameter, $onlyQuote = false )
    {
        $quote = "\"";
        if ( $parameter != null )
        {
            $val = eZTemplateNodeTool::elementConstantValue( $parameter );
            if ( $val == 'single' )
                $quote = "'";
            else if ( $val == 'no' )
                $quote = false;
        }

        if ( $onlyQuote )
        {
            return $quote;
        }

        $http = eZHTTPTool::instance();

        if ( isset( $http->UseFullUrl ) and $http->UseFullUrl
                                        and strncasecmp( $text, '/' , 1 ) === 0 ) // do not prepend the site path if it's not a http url
        {
            $text = $http->createRedirectUrl( $text, array( 'pre_url' => false ) );
        }
        if ( $quote !== false )
            return $quote . $text . $quote;

        return $text;
    }
499474
def item_extra_kwargs(self, action):
        
        item = self.format(action)
        item.pop('title', None)
        item['uri'] = item.pop('url')
        item['activity:verb'] = item.pop('verb')
        return item
1341395
def _set_data(self, action):
        
        if action == 'siteinfo':
            self._set_siteinfo()
        elif action == 'sitematrix':
            self._set_sitematrix()
        elif action == 'sitevisitors':
            self._set_sitevisitors()
251514
def quote(query):
    ''''''
    if query.startswith('\'') is not True:
        query = '\'' + query

    if query.endswith('\'') is not True:
        query = query + '\''

    return query
991754
def get_es_action_item(data_item, action_settings, es_type, id_field=None):
    '''  '''

    action_item = dict.copy(action_settings)
    if id_field is not None:
        id_val = first(list(get_dict_key(data_item, id_field)))
        if id_val is not None:
            action_item['_id'] = id_val
    elif data_item.get('id'):
        if data_item['id'].startswith("%s/" % action_settings['_index']):
            action_item['_id'] = "/".join(data_item['id'].split("/")[2:])
        else:
            action_item['_id'] = data_item['id']
    if data_item.get('data'):
        action_item['_source'] = data_item['data']
    else:
        action_item['_source'] = data_item
    action_item['_type'] = es_type
    return action_item
1127687
function quote(inst, list, argv, event, fin) {
    // Remember to charge for the 'quote' function as a transaction
    if (!ok(inst, inst.options.quoteTransaction)) return exit(inst, list, fin);
    var entity = list[list.length - 1];
    if (_isValue(entity)) return fin(null, entity);
    var quotation = {};
    quotation[RUNIQ_QUOTED_ENTITY_PROP_NAME] = entity;
    return fin(null, quotation);
}
195430
def build_action(self, action):
        
        try:
            self.action = Action.from_string(action)
        except ValueError:
            raise

        return self
280603
async function prevQuote(store) {
  await store.update(state => {
    state.quoteId = state.quoteId - 1
    if (state.quoteId <= 0) {
      state.quoteId = MAX_QUOTE_ID
    }
  })
}
804114
def on_quote_changed(self, tiny_quote):
        """"""

        # TinyQuoteData
        if tiny_quote.symbol != self.symbol_ref:
            return

        # 减少计算频率，每x秒一次
        dt_now = time.time()
        if dt_now - self._last_dt_process < 2:
            return
        self._last_dt_process = dt_now

        # 执行策略
        self._process_cta(self.cta_call)
        self._process_cta(self.cta_put)
54378
def load(self, text,
         lineterminator='\r\n',
         quotechar='"',
         delimiter=",",
         escapechar=escapechar,
         quoting=csv.QUOTE_MINIMAL):
    """"""

    f = io.StringIO(text)

    if not quotechar:
        quoting = csv.QUOTE_NONE

    reader = csv.DictReader(
        f,
        delimiter=delimiter,
        quotechar=quotechar,
        quoting=quoting,
        lineterminator=lineterminator)

    if reader.fieldnames:
        reader.fieldnames = [field.strip() for field in reader.fieldnames]

    try:
        self.primitive = next(reader)
    except StopIteration:
        self.primitive = {}
1121778
function quote(s) {
    if (typeof(s) === 'string') {
        return "'" + s.replace(/'/g, "''") + "'";
    } else if (s instanceof Array) {
        return _.map(s, quote).join(', ');
    }

    return s;
}
995828
def reference(cls, value):
        
        from sqlpuzzle._common.utils import force_text
        value = force_text(value)
        parts = re.split(r'{quote}([^{quote}]+){quote}|\.'.format(quote=cls.reference_quote), value)
        parts = ('{quote}{i}{quote}'.format(quote=cls.reference_quote, i=i) if i != '*' else i for i in parts if i)
        return '.'.join(parts)