Return the value of a parameter, or nil if it doesn't exist.
193841
def _pv_opts_lookup(opts, key)
        if opts.has_key?(key.to_s)
          opts[key.to_s]
        elsif opts.has_key?(key.to_sym)
          opts[key.to_sym]
        else
          nil
        end
      end
699970
def get_by_value(cls, value):
        
        for constant in cls.iterconstants():
            if constant.value == value:
                return constant
        raise ValueError(
            "Constant with value \"{0}\" is not present in \"{1}\""
            .format(value, cls)
        )
293346
def p_optional_value(t):
    """"""
    # return value or None.
    t[0] = t[1]
    # Note this must be unsigned
    value = t[0]
    if value is None or value[0].isdigit():
        return
    msg = ''
    if value[0] == '-':
        msg = "Can't use negative index %s" % value
    elif value not in name_dict:
        msg = "Can't derefence index %s" % value
    else:
        data = name_dict[value]
        if data.type != 'const':
            msg = "Can't use non-constant %s %s as index" % (data.type, value)
        elif not data.positive:
            msg = "Can't use negative index %s" % value
    if msg:
        global error_occurred
        error_occurred = True
        print(u"ERROR - {0:s} near line {1:d}".format(msg, t.lineno(1)))
798280
def get(self, field=None, index=None, lpar=0, prompt=1, native=0, mode="h"):
        """"""

        if field and field != "p_value":
            # note p_value comes back to this routine, so shortcut that case
            return self._getField(field,native=native,prompt=prompt)

        # may prompt for value if prompt flag is set
        if prompt: self._optionalPrompt(mode)

        if index is not None:
            raise SyntaxError("Parameter "+self.name+" is not an array")

        if native:
            rv = self.value
        else:
            rv = self.toString(self.value)
        return rv
1190037
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return Parameter(key)
        if key not in Parameter._member_map_:
            extend_enum(Parameter, key, default)
        return Parameter[key]
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
343022
def param_get(param):
        
        instance = param.effect.instance

        return 'param_get {} {}'.format(instance, param.symbol)
550824
def get(self, field=None, index=None, lpar=0, prompt=1, native=0, mode="h"):
        """"""

        if field: return self._getField(field,native=native,prompt=prompt)

        # may prompt for value if prompt flag is set
        #XXX should change _optionalPrompt so we prompt for each element of
        #XXX the array separately?  I think array parameters are
        #XXX not useful as non-hidden params.

        if prompt: self._optionalPrompt(mode)

        if index is not None:
            sumindex = self._sumindex(index)
            try:
                if native:
                    return self.value[sumindex]
                else:
                    return self.toString(self.value[sumindex])
            except IndexError:
                # should never happen
                raise SyntaxError("Illegal index [" + repr(sumindex) +
                        "] for array parameter " + self.name)
        elif native:
            # return object itself for an array because it is
            # indexable, can have values assigned, etc.
            return self
        else:
            # return blank-separated string of values for array
            return str(self)
608428
def get(self, name, default=None):
        """"""
        value = self.parameters.get(name)
        self._processed_parameters.append(name)
        if value is None:
            return default
        return value
1349248
def value(self):
        
        try:
            return self._value.value()
        except UnresolvedVariableValue:
            raise UnresolvedVariable("<unknown>", self)
        except InvalidLookupConcatenation as e:
            raise InvalidLookupCombination(e.lookup, e.lookups, self)
837912
def get_param(self, number):
        
        logger.debug("retreiving param number %s" % number)
        type_ = param_types[number]
        value = type_()
        code = self.library.Cli_GetParam(self.pointer, c_int(number),
                                         byref(value))
        check_error(code)
        return value.value
56097
def _get_value(obj, key, default=missing):
    
    if "." in key:
        return _get_value_for_keys(obj, key.split("."), default)
    else:
        return _get_value_for_key(obj, key, default)
527711
def _get_value(self, var):
        """"""
        return self._problem._cp.solution.get_values(
            self._problem._variables[var])
449917
def _get_argname_value(self, argname):
        '''
        
        '''
        # Let's see if there's a private function to get the value
        argvalue = getattr(self, '__get_{0}__'.format(argname), None)
        if argvalue is not None and callable(argvalue):
            argvalue = argvalue()
        if argvalue is None:
            # Let's see if the value is defined as a public class variable
            argvalue = getattr(self, argname, None)
        if argvalue is None:
            # Let's see if it's defined as a private class variable
            argvalue = getattr(self, '__{0}__'.format(argname), None)
        if argvalue is None:
            # Let's look for it in the extra dictionary
            argvalue = self.extra.get(argname, None)
        return argvalue
1234777
def get_parameter(self, name, default=None):
        '''
        
        '''
        if hasattr(self, name):
            item = getattr(self, name)
            if isinstance(item, Parameter):
                return item
        return default
258313
def expr_for( predicate, field = nil )
      unless (value = valued_parameters[predicate]).blank?
        to_expr( predicate, value, field )
      end
    end
1118999
def evaluate(self, parameters):
        """"""
        if self.match(parameters):
            if isinstance(self.then, ParameterCondition):
                #recursive parametercondition
                return self.then.evaluate(parameters)
            else:
                return self.then
        elif self.otherwise:
            if isinstance(self.otherwise, ParameterCondition):
                #recursive else
                return self.otherwise.evaluate(parameters)
            else:
                return self.otherwise
        return False