Find the value of the object under the cursor.
19777
def find_value_at_cursor(ast_tree, filename, line, col, root_env=gcl.default_env):
  """"""
  q = gcl.SourceQuery(filename, line, col)
  rootpath = ast_tree.find_tokens(q)
  rootpath = path_until(rootpath, is_thunk)

  if len(rootpath) <= 1:
    # Just the file tuple itself, or some non-thunk element at the top level
    return None

  tup = inflate_context_tuple(rootpath, root_env)
  try:
    if isinstance(rootpath[-1], ast.Inherit):
      # Special case handling of 'Inherit' nodes, show the value that's being
      # inherited.
      return tup[rootpath[-1].name]
    return rootpath[-1].eval(tup.env(tup))
  except gcl.EvaluationError as e:
    return e
559431
def inspect_value(self_,name): # pylint: disable-msg=E0213
        
        cls_or_slf = self_.self_or_cls
        param_obj = cls_or_slf.param.objects('existing').get(name)

        if not param_obj:
            value = getattr(cls_or_slf,name)
        elif hasattr(param_obj,'attribs'):
            value = [cls_or_slf.param.inspect_value(a) for a in param_obj.attribs]
        elif not hasattr(param_obj,'_inspect'):
            value = getattr(cls_or_slf,name)
        else:
            if isinstance(cls_or_slf,type):
                value = param_obj._inspect(None,cls_or_slf)
            else:
                value = param_obj._inspect(cls_or_slf,None)

        return value
1123936
def get_value(self, key, args, kwargs):
        """"""
        if hasattr(self._item, key):
            return getattr(self._item, key)
        return super().get_value(key, args, kwargs)
472029
def findvalue(array, value, compare = lambda x, y: x == y):
    ""
    try:
        return next(x for x in array if compare(x, value))
    except StopIteration:
        raise ValueError('%r not in array'%value)
266745
def get_value(self, **kwargs):
        """"""
        key = tuple(kwargs[group] for group in self.groups)
        if key not in self.data:
            self.data[key] = 0
        return self.data[key]
119014
public T find(V value) {
		checkInit();

		for (T obj : preDefined) {
			if (matches(obj, value)) {
				return obj;
			}
		}
		return null;
	}
826031
def get_value(cls, value):
        ''''''
        if isinstance(value, (basestring, int)):
            value = cls.fetch_by(id=value)
        return value if isinstance(value, cls) else None
804783
def itervalues(obj):
    ""
    return iter(obj.values()) if sys.version_info.major == 3 else obj.itervalues()
1104718
def find_value(self, key):
        """"""
        values = self.values
        if key not in values:
            raise AttributeError("Config has no value for {}".format(key))

        val = values[key]
        if isinstance(val, Default):
            return val.val
        else:
            return val
856154
def get_value(self, key):
        """"""
        for title in _TITLES.get(key, ()) + (key,):
            try:
                value = [entry['lastMeasurement']['value'] for entry in
                         self.data['sensors'] if entry['title'] == title][0]
                return value
            except IndexError:
                pass
        return None
1055250
async def cursor(self) -> Cursor:
        """"""
        return Cursor(self, await self._execute(self._conn.cursor))
523458
def _GetVal(self, obj, key):
    """"""
    if "." in key:
      lhs, rhs = key.split(".", 1)
      obj2 = getattr(obj, lhs, None)
      if obj2 is None:
        return None
      return self._GetVal(obj2, rhs)
    else:
      return getattr(obj, key, None)
648744
def value(self):
        
        if self._wrapped is not self.Null:
            return self._wrapped
        else:
            return self.obj
845329
def _extract_key_value(obj):
    """"""
    key = None; value = None

    # Parse a Value object, which includes Properties
    if isinstance(obj, Value):
        key = _construct_new_key(obj.name, obj.units)
        value = []
        if obj.scalars:
            value = [(val.value if isinstance(val, Scalar) else val)
                     for val in obj.scalars]
        elif obj.vectors and len(obj.vectors) == 1:
            value = [(val.value if isinstance(val, Scalar) else val)
                     for val in obj.vectors[0]]
        if len(value) == 1:
            value = value[0]
        elif len(value) == 0:
            value = None

    # If there is a process step, pul out its name as the value
    # TODO: resolve duplicates
    if isinstance(obj, ProcessStep):
        key = "Processing"
        value = obj.name
        
    return key, value
1261895
def find(self, text):
        """"""
        for key, value in self:
            if (text in key) or (text in value):
                print(key, value)
186389
def get_value(key, obj, default=missing):
    """"""
    if isinstance(key, int):
        return _get_value_for_key(key, obj, default)
    return _get_value_for_keys(key.split('.'), obj, default)
78595
def _get_object_key(self, p_object):
        """"""
        matched_key = None
        matched_index = None

        if hasattr(p_object, self._searchNames[0]):
            return getattr(p_object, self._searchNames[0])

        for x in xrange(len(self._searchNames)):
            key = self._searchNames[x]
            if hasattr(p_object, key):
                matched_key = key
                matched_index = x

        if matched_key is None:
            raise KeyError()

        if matched_index != 0 and self._searchOptimize:
            self._searchNames.insert(0, self._searchNames.pop(matched_index))

        return getattr(p_object, matched_key)