Get a value from the given context as a basestring instance.
336696
def fetch_string(self, context, name):
        
        val = self.resolve_context(context, name)

        if callable(val):
            # Return because _render_value() is already a string.
            return self._render_value(val(), context)

        if not is_string(val):
            return self.to_str(val)

        return val
679169
def get_value(self, key, args, kwargs):
        """"""
        if (self.tolerant and
                not isinstance(key, basestring) and
                key not in kwargs):
            key = str(key)

        return kwargs[key]
347188
@Override
  public Object getValue(ELContext context, Object base, Object property) {
    return getValue(context, base, property, true);
  }
761005
function baseToString(value) {
  // Exit early for strings to avoid a performance hit in some environments.
  if (typeof value === 'string') {
    return value
  }
  if (isSymbol(value)) {
    return symbolToString ? symbolToString.call(value) : ''
  }
  var result = value + ''
  return result == '0' && 1 / value == -INFINITY ? '-0' : result
}
118139
public Object getValue(ELContext context)
    {
        Object base = this.orig.getValue(context);
        if (base != null)
        {
            context.setPropertyResolved(false);
            return context.getELResolver().getValue(context, base, i);
        }
        return null;
    }
152674
def GetRaw(self, name, context=None, default=utils.NotAValue):
    """"""
    if context is None:
      context = self.context

    # Getting a raw value is pretty cheap so we wont bother with the cache here.
    _, value = self._GetValue(name, context, default=default)
    return value
841510
def from_string(cls, string):
        

        # find enum value
        for attr in dir(cls):
            value = getattr(cls, attr)
            if value == string:
                return value

        # if not found, log warning and return the value passed in
        logger.warning("{} is not a valid enum value for {}.".format(string, cls.__name__))
        return string
343609
def valueFromString(self, value, context=None):
        
        if value == 'now':
            return datetime.datetime.now().time()
        elif dateutil_parser:
            return dateutil_parser.parse(value).time()
        else:
            time_struct = time.strptime(value, self.defaultFormat())
            return datetime.time(time_struct.tm_hour,
                                 time_struct.tm_min,
                                 time_struct.tm_sec)
349838
def coerce(self, value):
        
        if isinstance(value, compat.basestring):

            return value

        return str(value)
761722
def get_value(d, name, field):
    
    multiple = core.is_multiple(field)
    value = d.get(name, core.missing)
    if value is core.missing:
        return core.missing
    if multiple and value is not core.missing:
        return [
            decode_argument(v, name) if isinstance(v, basestring) else v for v in value
        ]
    ret = value
    if value and isinstance(value, (list, tuple)):
        ret = value[0]
    if isinstance(ret, basestring):
        return decode_argument(ret, name)
    else:
        return ret
1336182
def get_value(self, node):
        """"""
        if not isinstance(node, ast.Str):
            raise TypeError("must be a string literal")

        return node.s
90796
def context_value(name):
    

    def context_value(_value, context, **_params):
        return defer.succeed(context[name])

    return context_value
1294653
def _get_context(keyspaces, connections):
    """"""

    if keyspaces:
        if not isinstance(keyspaces, (list, tuple)):
            raise ValueError('keyspaces must be a list or a tuple.')

    if connections:
        if not isinstance(connections, (list, tuple)):
            raise ValueError('connections must be a list or a tuple.')

    keyspaces = keyspaces if keyspaces else [None]
    connections = connections if connections else [None]

    return product(connections, keyspaces)
512934
function get(key, context) {
  if (context === true) context = this.context;
  var parts = key.split(".");
  if (parts.length === 1) {
    // "foo"
    return this._getKey(key, context);
  } else {
    // "foo.bar"
    return this._getPattern(parts, context);
  }
}
224422
def get_parsed_context(context_arg):
    """"""
    if not context_arg:
        logger.debug("pipeline invoked without context arg set. For "
                     "this json parser you're looking for something "
                     "like: "
                     "pypyr pipelinename '{\"key1\":\"value1\","
                     "\"key2\":\"value2\"}'")
        return None

    logger.debug("starting")
    # deserialize the input context string into json
    return json.loads(context_arg)
42177
def value_series(self, key, start=None, end=None, interval=None,
                     namespace=None, cache=None):
        """"""
        return self.make_context(key=key, start=start, end=end,
                                 interval=interval, namespace=namespace,
                                 cache=cache).value_series()
1016026
@SuppressWarnings("unchecked")
    public final static <T extends Object> T getContext(String key) {
        Map<String, Object> ctx = CTX_HOLDER.get();
        if (ctx == null) {
            return null;
        }
        return (T) ctx.get(key);
    }