Initializes with a map from value to probability.

        values: map from value to probability
509826
def InitMapping(self, values):
        
        for value, prob in values.iteritems():
            self.Set(value, prob)
946197
@SuppressWarnings("unused")
    public static Map<String, Object> internMapOf(Object... values) {
        if (values == null) {
            return Collections.emptyMap();
        }
        int len = values.length;
        if (len % 2 != 0) {
            throw new IllegalArgumentException("Number of arguments should be an even number representing the keys and values");
        }

        Map<String, Object> answer = new HashMap<>((int) (len / 2 / 0.75));
        int i = 0;
        while (i < values.length - 1) {
            String key = values[i++].toString().intern();
            Object val = values[i++];
            answer.put(key, val);
        }
        return answer;
    }
943650
private LinkedHashMap<String, Num> mapValues(String infix, Object... values) {
        LinkedHashMap<String, Num> vNames = null;
        int remain = 0;
      
        Matcher mat = pVariableNames.matcher(infix);
        while (mat.find()) {
            if (vNames == null)
                vNames = new LinkedHashMap<String, Num>();

            String vName = mat.group();
            if (!vNames.containsKey(vName)) {
                remain++;
                Num num = findValue(vName, true, values);
                vNames.put(vName, num);

                if (num != null)
                    remain--;
            }
        }

        // pair names with values without name
        if (vNames != null) {
            int lastPos = 0;
            for (Entry<String, Num> entry : vNames.entrySet()) {
                if (entry.getValue() == null) {
                    for (int i = lastPos; i < values.length; i++) {
                        Object v = values[i];
                        if (v != null) {
                            if (v instanceof Num) {
                                Num n = (Num) v;
                                if (n.getName() == null)
                                    entry.setValue(n);
                                else if (n.getName().equals(entry.getValue()))
                                    entry.setValue(n);
                            }
                            else
                                entry.setValue(Num.toNum(v));

                            values[i] = null;
                            lastPos = i;
                            remain--;
                        }
                    }
                }
            }
        }

        if (remain > 0 && vNames != null) {
            StringBuilder sb = new StringBuilder();
            int c = 0;
            for (Entry<String, Num> entry : vNames.entrySet()) {
                if (entry.getValue() == null) {
                    if (c++ > 0)
                        sb.append(", ");
                    sb.append(entry.getKey());
                }
            }

            throw new CalculatorException("Undefined values for expression (" + infix + ") variables: " + sb.toString());
        }

        return vNames;
    }
859050
def create_initial(self, address_values):
        

        with self._lock:
            for add, val in address_values:
                self._state[add] = _ContextFuture(address=add, result=val)
91024
public void addValueToIn(Object value, String name, Map<String, Object> map) {
        getMapHelper().addValueToIn(value, name, map);
    }
259547
public static void init(final Map<String, String> _values)
    {
        if (AppConfigHandler.HANDLER == null) {
            AppConfigHandler.HANDLER = new AppConfigHandler(_values);
        }
    }
209290
def fromSet(self, values):
        
        value = 0
        for flag in values:
            value |= self(flag)
        return value
311340
def _init_map(self, record_types=None, **kwargs):
        """"""
        osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
        self._my_map['outputScore'] = self._output_score_default
        self._my_map['gradeSystemId'] = str(kwargs['grade_system_id'])
        self._my_map['inputScoreEndRange'] = self._input_score_end_range_default
        self._my_map['inputScoreStartRange'] = self._input_score_start_range_default
        self._my_map['assignedGradebookIds'] = [str(kwargs['gradebook_id'])]
1102867
private void initializeMapper() {
    if (valueClass == null) {
      valueMapper = CatchAllMapper.getInstance();
    } else {
      try {
        valueMapper = MapperFactory.getInstance().getMapper(valueClass);
      } catch (NoSuitableMapperException exp) {
        valueMapper = CatchAllMapper.getInstance();
      }

    }
  }
381586
def setValue( self, value ):
        
        self._value = value
        
        # map a list of choices to the system
        if ( isinstance(value, list) ):
            self.setText(2, '[%s]' % ','.join(map(str, value)))
        else:
            self.setText(2, nativestring(value))
835228
def _init_map(self, record_types=None, **kwargs):
        """"""
        osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
        self._my_map['assignedObjectiveBankIds'] = [str(kwargs['objective_bank_id'])]
        self._my_map['cognitiveProcessId'] = self._cognitive_process_default
        self._my_map['assessmentId'] = self._assessment_default
        self._my_map['knowledgeCategoryId'] = self._knowledge_category_default
66140
def set(self, locs, values):
        
        try:
            self.values[locs] = values
        except (ValueError):

            # broadcasting error
            # see GH6171
            new_shape = list(values.shape)
            new_shape[0] = len(self.items)
            self.values = np.empty(tuple(new_shape), dtype=self.dtype)
            self.values.fill(np.nan)
            self.values[locs] = values
1020298
def _pfp__set_value(self, value):
        
        if self._pfp__frozen:
            raise errors.UnmodifiableConst()
        if len(value) != len(self._pfp__children):
            raise errors.PfpError("struct initialization has wrong number of members")

        for x in six.moves.range(len(self._pfp__children)):
            self._pfp__children[x]._pfp__set_value(value[x])
1217078
private void init() {
        if (x == null) {
            x = new double[z[0].length];
            for (int i = 0; i < x.length; i++) {
                x[i] = i + 0.5;
            }
        }

        if (y == null) {
            y = new double[z.length];
            for (int i = 0; i < y.length; i++) {
                y[i] = y.length - i - 0.5;
            }
        }

        // In case of outliers, we use 1% and 99% quantiles as lower and
        // upper limits instead of min and max.
        int n = z.length * z[0].length;
        double[] values = new double[n];
        int i = 0;
        for (double[] zi : z) {
            for (double zij : zi) {
                if (!Double.isNaN(zij)) {
                    values[i++] = zij;
                }
            }
        }
        
        if (i > 0) {
            Arrays.sort(values, 0, i);
            min = values[(int)Math.round(0.01 * i)];
            max = values[(int)Math.round(0.99 * (i-1))];
            width = (max - min) / palette.length;
        }
    }
23340
def _init_map(self, record_types=None, **kwargs):
        """"""
        osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
        self._my_map['numericScoreIncrement'] = self._numeric_score_increment_default
        self._my_map['lowestNumericScore'] = self._lowest_numeric_score_default
        self._my_map['basedOnGrades'] = self._based_on_grades_default
        self._my_map['highestNumericScore'] = self._highest_numeric_score_default
        self._my_map['assignedGradebookIds'] = [str(kwargs['gradebook_id'])]
        self._my_map['grades'] = []
770856
public void populate(Map<String, String[]> map)
    {
        for (Entry<String, String[]> entry : map.entrySet())
        {
            String property = entry.getKey();
            if (model.typeMap.containsKey(property))
            {
                String[] values = entry.getValue();
                if (values.length > 1)
                {
                    throw new UnsupportedOperationException(property + " has multivalue " + values);
                }
                if (values.length == 1)
                {
                    set(property, values[0]);
                }
            }
        }
    }
881973
public static TableFactorBuilder fromMap(VariableNumMap variables,
      Map<Assignment, Double> probabilities) {
    TableFactorBuilder builder = new TableFactorBuilder(variables);
    for (Map.Entry<Assignment, Double> outcome : probabilities.entrySet()) {
      builder.setWeight(outcome.getKey(), outcome.getValue());
    }
    return builder;
  }