Read values.

        Args:
            vals (list): list of strings representing values
498452
def read(self, vals):
        
        i = 0
        count = int(vals[i])
        i += 1
        for _ in range(count):
            obj = DataPeriod()
            obj.read(vals[i:i + obj.field_count])
            self.add_data_period(obj)
            i += obj.field_count
439233
public static boolean contains(String[] vals, String value) {
        for (int i = 0; i < vals.length; i++) {
            if (vals[i].equals(value)) {
                return true;
            }
        }
        return false;
    }
31862
func ReadValues(data []byte) (vals Values, err error) {
	err = yaml.Unmarshal(data, &vals)
	if len(vals) == 0 {
		vals = Values{}
	}
	return
}
777402
def _ctorCmprRange(self, vals):
        '''
        
        '''

        if not isinstance(vals, (list, tuple)):
            raise s_exc.BadCmprValu(valu=vals, cmpr='*range=')

        if len(vals) != 2:
            raise s_exc.BadCmprValu(valu=vals, cmpr='*range=')

        tick, tock = self.getTickTock(vals)

        if tick > tock:
            # User input has requested a nullset
            def cmpr(valu):
                return False

            return cmpr

        def cmpr(valu):
            return tick <= valu <= tock

        return cmpr
881449
def _check_values(in_values):
        
        out_values = []
        for value in in_values:
            # if isinstance(value, (dict, list)):
            #     out_values.append(json.dumps(value))
            # else:
            out_values.append(value)

        return tuple(out_values)
360354
def join(self, vals):
        
        if len(vals) == 1:
            return vals[0]
        raise Exception(
            "Too many values for {}:{}".format(self._component_name, self._key)
        )
709147
function list(val) {
  if (!val) {
    return [];
  } else if (Array.isArray(val)) {
    return val;
  } else if (typeof val === "string") {
    return val.split(",");
  } else {
    return [val];
  }
}
22663
def vals(self, var_type):
        
        return {x: y for x, y in self.items() if y.has_value_of_type(var_type)}
446350
def interpret(self, values={}, functions={}):
        
        return self.expr.evaluate(Environment(values, functions))
1315284
def parse_value(self, val, display, rawdict = 0):

        
        ret = {}
        vno = 0
        for f in self.static_fields:
            # Fields without names should be ignored, and there should
            # not be any length or format fields if this function
            # ever gets called.  (If there were such fields, there should
            # be a matching field in var_fields and then parse_binary
            # would have been called instead.

            if not f.name:
                pass

            elif isinstance(f, LengthField):
                pass

            elif isinstance(f, FormatField):
                pass

            # Value fields
            else:
                # If this field has a parse_value method, call it, otherwise
                # use the unpacked value as is.
                if f.structvalues == 1:
                    field_val = val[vno]
                else:
                    field_val = val[vno:vno+f.structvalues]

                if f.parse_value is not None:
                    field_val = f.parse_value(field_val, display, rawdict=rawdict)
                ret[f.name] = field_val

            vno = vno + f.structvalues

        if not rawdict:
            return DictWrapper(ret)
        return ret
561028
def process_values(self):
        """"""

        if self.padding>0:
            channels = np.zeros((self.vals.shape[0], self.vals.shape[1]+self.padding))
            channels[:, 0:self.vals.shape[0]] = self.vals
        else:
            channels = self.vals
        vals_mat = self.skel.to_xyz(channels.flatten())
        self.vals = np.zeros_like(vals_mat)
        # Flip the Y and Z axes
        self.vals[:, 0] = vals_mat[:, 0].copy()
        self.vals[:, 1] = vals_mat[:, 2].copy()
        self.vals[:, 2] = vals_mat[:, 1].copy()
1310295
def _read_values(self, file, number_values):
        """"""

        if self.data_type.nptype is not None:
            dtype = (np.dtype(self.data_type.nptype).newbyteorder(
                self.endianness))
            return fromfile(file, dtype=dtype, count=number_values)
        elif self.data_type == types.String:
            return read_string_data(file, number_values, self.endianness)
        data = self._new_segment_data()
        for i in range(number_values):
            data[i] = self.data_type.read(file, self.endianness)
        return data
929091
def read(self, vals):
        
        i = 0
        count = int(vals[i])
        i += 1
        for _ in range(count):
            obj = GroundTemperature()
            obj.read(vals[i:i + obj.field_count])
            self.add_ground_temperature(obj)
            i += obj.field_count
1336853
def values(self, desc = None):
        ''''''
        if self._ts:
            res = asarray(self._ts)
            if desc == True:
                return reversed(res)
            else:
                return res
        else:
            return ndarray([0,0])
333809
def _find_error(vals):
    

    err_vals = []
    for en in vals:
        c = en[2]
        conc = [float(i)/sum(c) for i in c]

        err = abs(en[0]-en[1])

        err_vals.append([conc,err])

    return err_vals
799240
def unpack_hyperopt_vals(vals):
    
    assert isinstance(vals, dict), "Parameter must be given as dict."
    ret = {}
    for k, v in list(vals.items()):
        try:
            ret[k] = v[0]
        except (TypeError, IndexError):
            ret[k] = v
    return ret
844076
def _extract_values(values_list):
        
        values = []
        # check if file or list of values to iterate
        if isinstance(values_list, str):
            with open(values_list) as ff:
                reading = csv.reader(ff)
                for j in reading:
                    values.append(j[0])
        elif isinstance(values_list, list):
            values = values_list
        else:
            raise Exception("input datatype not supported.")
        return values