Return entry value addressed by the receiver + its schema node.

        Args:
            val: Current value (array).
            sn:  Current schema node.
357804
def peek_step(self, val: ArrayValue,
                  sn: "DataNode") -> Tuple[Value, "DataNode"]:
        
        try:
            return (val[val.index(self.parse_value(sn))], sn)
        except ValueError:
            return None, sn
894658
def dump_edn_val(v):
  " "
  if isinstance(v, (str, unicode)): 
    return json.dumps(v)
  elif isinstance(v, E):            
    return unicode(v)
  else:                             
    return dumps(v)
363490
def value=(val)
      case val
      when ::String     then @value = val.to_s
      when ::Hash       then @value = val
      when ::Array      then @value = val
      when ::OpenStruct then @value = val
      when ::DateTime   then @value = val.strftime XS_DATETIME_FORMAT
      when ::Time       then @value = val.strftime XS_DATETIME_FORMAT
      when ::Date       then @value = val.strftime XS_DATETIME_FORMAT
      else
        if val.respond_to?(:to_datetime)
          @value = val.to_datetime
        elsif val.respond_to?(:call)
          @value = val.call
        elsif val.nil?
          @value = nil
        else
          @value = val.to_s
        end
      end
    rescue => e
      @value = val.to_s
    end
950379
def _get_val(val, full=False):
    
    try:
        val = val.strip()
    except:
        pass

    logging.debug("%s, type=%s", val, type(val))

    if isinstance(val, float):
        return val

    if isinstance(val, int):
        return val


    if isinstance(val, np.ndarray):
        return list(val)

    try:
        val = float(val)
        return val
    except:
        pass

    try:
        val = int(val)
        return val
    except:
        pass

    if type(val) == pd.DataFrame:

        if full:
            return val

        newval = []
        values = val.values
        for v in values:
            newv = _get_val(v)
            if type(newv) == list:
                newval.extend(newv)
            else:
                newval.append(newv)
        val = newval

    elif type(val) == dict:

        if full:
            return val

        newval = []
        for v in val.values():
            newv = _get_val(v)
            if type(newv) == list:
                newval.extend(newv)
            else:
                newval.append(newv)
        val = newval

    elif type(val) == list or type(val) == np.ndarray:
        newval = []
        for arr_val in val:
            v = _get_val(arr_val)
            newval.append(v)
        val = newval
    return val
1022998
def get_field_entry_key(node: FieldNode) -> str:
    """"""
    return node.alias.value if node.alias else node.name.value
1163219
protected Val nextSimpleValue() throws IOException {
      switch (currentValue.getKey()) {
         case NULL:
         case STRING:
         case BOOLEAN:
         case NUMBER:
            Val object = currentValue.v2;
            consume();
            return object;
         default:
            throw new IOException("Expecting VALUE, but found " + jsonTokenToStructuredElement(null));
      }
   }
496710
def val_factory(val, datatypes):
    
    exceptions = []
    for dt in datatypes:
        try:
            if isinstance(val, dt):
                return val
            return type_handler_object(val, dt)
        except Exception as e:
            exceptions.append(str(e))
    # if we get here, we never found a valid value. raise an error
    raise ValueError('val_factory: Unable to instantiate {val} from types {types}. Exceptions: {excs}'.
                     format(val=val, types=datatypes, excs=exceptions))
1203344
def get_value(self, i=None, unit=None,
                  uncover=None, trail=None,
                  linebreak=None, sort_by_indep=None,
                  attr='_value'):
        

        value = getattr(self, attr)  # could be self._value or self._error
        if value is None:
            return None

        if uncover is None:
            uncover = self.call.uncover

        if trail is None:
            trail = self.call.trail

        if linebreak is None:
            linebreak = self.call.linebreak

        if sort_by_indep is None:
            # TODO: make this a property of the call?
            sort_by_indep = True

        if isinstance(value, str) or isinstance(value, float):
            if i is None:
                return self._to_unit(value, unit)
            elif isinstance(self.call.i.value, float):
                # then we still want to "select" based on the value of i
                if self._filter_at_i(i):
                    return value
                else:
                    return None
            else:
                # then we should show either way.  For example - a color or
                # axhline even with i given won't change in i
                return self._to_unit(value, unit)

        # from here on we're assuming the value is an array, so let's just check
        # to be sure
        if not isinstance(value, np.ndarray):
            raise NotImplementedError("value/error must be a numpy array")


        if linebreak is not False:
            return self._do_linebreak(func='get{}'.format(attr),
                                      i=i,
                                      unit=unit,
                                      uncover=uncover,
                                      trail=trail,
                                      linebreak=linebreak,
                                      sort_by_indep=sort_by_indep)

        if sort_by_indep is not False:
            # if we've made it here, linebreak should already be False (if
            # linebreak was True, then we'd be within _do_linebreak and those
            # get_value calls pass linebreak=False)
            return self._sort_by_indep(func='get{}'.format(attr),
                                       i=i,
                                       unit=unit,
                                       uncover=uncover,
                                       trail=trail,
                                       linebreak=False,
                                       sort_by_indep=sort_by_indep)

        # from here on, linebreak==False and sort_by_indep==False (if either
        # were True, then we're within those functions and asking for the original
        # array)
        if i is None:
            if len(value.shape)==1:
                return self._to_unit(value, unit)
            else:
                if isinstance(self.call, Plot):
                    return self._to_unit(value.T, unit)
                else:
                    return self._to_unit(value, unit)

        # filter the data as necessary
        filter_ = self._filter_at_i(i, uncover=uncover, trail=trail)

        if isinstance(self.call.i.value, float):
            if filter_:
                return self._to_unit(value, unit)
            else:
                return None

        if len(value.shape)==1:
            # then we're dealing with a flat 1D array
            if attr == '_value':
                if trail is not False:
                    trail_i = self._get_trail_min(i)
                    first_point = self.interpolate_at_i(trail_i)


                if uncover:
                    last_point = self.interpolate_at_i(i)
            else:
                first_point = np.nan
                last_point = np.nan

            if uncover and trail is not False:
                concat = (np.array([first_point]),
                          value[filter_],
                          np.array([last_point]))
            elif uncover:
                concat = (value[filter_],
                          np.array([last_point]))

            elif trail:
                concat = (np.array([first_point]),
                          value[filter_])
            else:
                return self._to_unit(value[filter_], unit)

            return self._to_unit(np.concatenate(concat), unit)

        else:
            # then we need to "select" based on the indep and the value
            if isinstance(self.call, Plot):
                return self._to_unit(value[filter_].T, unit)
            else:
                return self._to_unit(value[filter_], unit)
122686
def val(self, name):
        
        v = getattr(self, name)
        if hasattr(v, 'retrieve_value'):
            v = v.retrieve_value(self.__dict__)
        return v
708232
function (val) {
  return (!behavior.enableUndefined || typeof val !== 'undefined')
    && (!behavior.enableNull || val !== null)
    && (!behavior.enableFalse || val !== false)
    && (!behavior.enableNaN || !Number.isNaN(val));
}
1052265
public void addNextValue(Object val) {
    String valCountStr = val.toString();
    int pos = valCountStr.lastIndexOf("\t");
    String valStr = valCountStr;
    String countStr = "1";
    if (pos >= 0) {
      valStr = valCountStr.substring(0, pos);
      countStr = valCountStr.substring(pos + 1);
    }
    
    Long count = (Long) this.items.get(valStr);
    long inc = Long.parseLong(countStr);

    if (count == null) {
      count = inc;
    } else {
      count = count.longValue() + inc;
    }
    items.put(valStr, count);
  }
1221464
def _key_values(self, sn: "SequenceNode") -> Union[EntryKeys, EntryValue]:
        """"""
        try:
            keys = self.up_to("/")
        except EndOfInput:
            keys = self.remaining()
        if not keys:
            raise UnexpectedInput(self, "entry value or keys")
        if isinstance(sn, LeafListNode):
            return EntryValue(unquote(keys))
        ks = keys.split(",")
        try:
            if len(ks) != len(sn.keys):
                raise UnexpectedInput(self, f"exactly {len(sn.keys)} keys")
        except AttributeError:
            raise BadSchemaNodeType(sn.qual_name, "list")
        sel = {}
        for j in range(len(ks)):
            knod = sn.get_data_child(*sn.keys[j])
            val = unquote(ks[j])
            sel[(knod.name, None if knod.ns == sn.ns else knod.ns)] = val
        return EntryKeys(sel)
1060402
def get(self, key, *val):
        
        data = self.get_data()
        if data is not None:
            return data.get(key, *val)
        if val:
            return val[0]
        raise KeyError(key)
495241
def dynamize_value(self, val):
        
        def _str(val):
            """
            DynamoDB stores booleans as numbers. True is 1, False is 0.
            This function converts Python booleans into DynamoDB friendly
            representation.
            """
            if isinstance(val, bool):
                return str(int(val))
            return str(val)

        dynamodb_type = self.get_dynamodb_type(val)
        if dynamodb_type == 'N':
            val = {dynamodb_type : _str(val)}
        elif dynamodb_type == 'S':
            val = {dynamodb_type : val}
        elif dynamodb_type == 'NS':
            val = {dynamodb_type : [ str(n) for n in val]}
        elif dynamodb_type == 'SS':
            val = {dynamodb_type : [ n for n in val]}
        return val
627988
def _parse_address(self, val):
        

        ret = {
            'type': None,
            'value': None
        }

        try:

            ret['type'] = val[1]['type']

        except (KeyError, ValueError, TypeError):

                pass

        try:

            ret['value'] = val[1]['label']

        except (KeyError, ValueError, TypeError):

            ret['value'] = '\n'.join(val[3]).strip()

        try:

            self.vars['address'].append(ret)

        except AttributeError:

            self.vars['address'] = []
            self.vars['address'].append(ret)
261075
def _is_present(val):
    
    if val is None:
      return False
    if isinstance(val, str):
      return len(val) > 0
    return True
279320
def pack_value(self, val):
        """"""
        if isinstance(val, bytes):
            val = list(iterbytes(val))

        slen = len(val)

        if self.pad:
            pad = b'\0\0' * (slen % 2)
        else:
            pad = b''

        return struct.pack('>' + 'H' * slen, *val) + pad, slen, None