Generate a flat map of classes
552479
function generateClasses({ clrs, scale, typeScale, rem, borderWidth }) {
  return {
    ...colors(clrs),
    ...whitespace(scale),
    ...typography(typeScale),
    ...flexbox,
    ...dimensions(rem),
    ...border(rem, borderWidth),
    ...absolute(rem),
  };
}
555723
def map(self, options=None):
        """"""
        for path, data in self.paths.items():
            for obj in self.create_class(data, options=options):
                self.add_object(obj)
1143147
def generate_flat_data(self):
    
    # Construct the string statements.
    all_statements = []
    all_targets = []
    self.sequence_sizes_in = []
    self.sequence_sizes_out = []
    for _ in six.moves.range(self._batch_size):
      length, nest = self.curriculum_obj.fetch()
      seq_size_in = self._max_seq_length
      # Generate batch within max length.
      is_valid_sample = False
      tries_remaining = 10
      while not is_valid_sample:
        value, code = generate_code(length, nest, self._ops)
        tokens_in, seq_size_in = self.tokenize(
            code, self._max_seq_length, self._token_by_char)
        tokens_out, seq_size_out = self.tokenize(
            value, self._max_seq_length, self._token_by_char)
        is_valid_sample = self._max_seq_length >= seq_size_in
        if is_valid_sample:
          self.sequence_sizes_in.append(seq_size_in)
          self.sequence_sizes_out.append(seq_size_out)
        if tries_remaining == 0:
          raise ValueError("Could not generate a sample below the allowable "
                           "maximum, consider reducing either max_length or "
                           "max_nest.")
        else:
          tries_remaining -= 1
      all_statements += tokens_in
      all_targets += tokens_out
    # Store the flattened data.
    self.flat_data = np.array(all_statements, dtype=np.int64)
    self.num_tokens = self.flat_data.shape[0]
    self.flat_targets = np.array(all_targets, dtype=np.int64)
    self.num_tokens_target = self.flat_targets.shape[0]
    self.start_token = np.array(self.tokenize(
        [get_start_token()], 1)[0], dtype=np.int64)
    self.end_token = np.array(self.tokenize(
        [get_end_token()], 1)[0], dtype=np.int64)
529278
function GENERATE_CLASSES(classes, parent) {
  return _.reduce(classes, function(memo, classSpec, className) {
    return memo
      + GENERATE_CLASS(className, classSpec.description, parent, classSpec.parent)
      + _.reduce(classSpec.methods, function(memo, methodSpec, methodName) {
        return memo += GENERATE_METHOD(methodName, methodSpec, className);
      }, '') 
      + _.reduce(classSpec.variables, function(memo, variableSpec, variableName) {
        return memo += GENERATE_VAR(variableName, variableSpec, className);
      }, '')
      + _.reduce(classSpec.enums, function(memo, enumSpec, enumName) {
        return memo += GENERATE_ENUM(enumName, enumSpec, className);
      }, '');
  }, '');
}
1321881
private void generateUMLClass(ClassDoc[] classes, String pkgname) throws IOException {
        for (int i=0; i<classes.length; i++) {
            ClassDoc c = classes[i];
            out.println("    <UML:Class stereotype=\"\" " +
                                     "package=\"" + pkgname + "\" " +
                                     "xmi.id=\"" + i + "\" " +
                                     "abstract=\"0\" " +
                                     "documentation=\"\" " +
                                     "name=\"" + c.name() + "\" " +
                                     "scope=\"200\">");
            MethodDoc[] methods = c.methods();
            for (int j=0; j<methods.length; j++) {
                MethodDoc md = methods[j];
                out.println("     <UML:Operation stereotype=\"\" " +
                                                "xmi.id=\"" + (1000*i + j) + "\" " +
                                                "type=\"void\" " +
                                                "abstract=\"0\" " +
                                                "documentation=\"\" " +
                                                "name=\"" + md.name() + "\" " +
                                                "scope=\"200\" />");
            }
            out.println("    </UML:Class>");
        }
    }
349133
private void createDefaultMappers() {
    BooleanMapper booleanMapper = new BooleanMapper();
    CharMapper charMapper = new CharMapper();
    ShortMapper shortMapper = new ShortMapper();
    IntegerMapper integerMapper = new IntegerMapper();
    LongMapper longMapper = new LongMapper();
    FloatMapper floatMapper = new FloatMapper();
    DoubleMapper doubleMapper = new DoubleMapper();

    cache.put(boolean.class, booleanMapper);
    cache.put(Boolean.class, booleanMapper);
    cache.put(char.class, charMapper);
    cache.put(Character.class, charMapper);
    cache.put(short.class, shortMapper);
    cache.put(Short.class, shortMapper);
    cache.put(int.class, integerMapper);
    cache.put(Integer.class, integerMapper);
    cache.put(long.class, longMapper);
    cache.put(Long.class, longMapper);
    cache.put(float.class, floatMapper);
    cache.put(Float.class, floatMapper);
    cache.put(double.class, doubleMapper);
    cache.put(Double.class, doubleMapper);
    cache.put(String.class, new StringMapper());
    cache.put(BigDecimal.class, new BigDecimalMapper());
    cache.put(byte[].class, new ByteArrayMapper());
    cache.put(char[].class, new CharArrayMapper());
    cache.put(Date.class, new DateMapper());
    cache.put(Calendar.class, new CalendarMapper());
    cache.put(GeoLocation.class, new GeoLocationMapper());
    cache.put(DatastoreKey.class, new KeyMapper());
    cache.put(LocalDate.class, new LocalDateMapper());
    cache.put(LocalTime.class, new LocalTimeMapper());
    cache.put(LocalDateTime.class, new LocalDateTimeMapper());
    cache.put(OffsetDateTime.class, new OffsetDateTimeMapper());
    cache.put(ZonedDateTime.class, new ZonedDateTimeMapper());
  }
340263
function buildClasses (db) {
  const classes = data.findClasses(db).order('name')

  return classes.map(function (klass) {
    const fns = data
      .findChildFunctions(db, [klass])
      .order('name')
      .map(copyFunction)

    return copyClass(klass, fns)
  })
}
155054
def generate_classes(self, items):
        ""
        classes = super().generate_classes([o[1] for o in items])
        classes = ['background'] + list(classes)
        return classes
463956
def _flatten_subclass_tree(cls):
    
    subclasses = frozenset(cls.__subclasses__())
    children = frozenset(toolz.concat(map(_flatten_subclass_tree, subclasses)))
    return frozenset({cls}) | subclasses | children
1343534
def css_classes_for_map(classname, mapping)
      css = mapping[classname]
      css.class == String ? css_classes_for_map(css, mapping) : (css || [])
    end
637545
def obj_classes_from_module(module):
    """"""
    for name in dir(module):
        if not name.startswith('_'):
            cls = getattr(module, name)
            if getattr(cls, 'classID', None):
                yield (name, cls)
927247
def all_subclasses(cls):
    """"""
    for subcls in cls.__subclasses__():
        yield subcls
        for subsubcls in all_subclasses(subcls):
            yield subsubcls
1229664
def visit_class(rec, cls, op):
    # type: (Any, Iterable, Union[Callable[..., Any], partial[Any]]) -> None
    """"""

    if isinstance(rec, MutableMapping):
        if "class" in rec and rec.get("class") in cls:
            op(rec)
        for d in rec:
            visit_class(rec[d], cls, op)
    if isinstance(rec, MutableSequence):
        for d in rec:
            visit_class(d, cls, op)
788966
def _generate_net(cls, flatterm: FlatTerm, final_label: T) -> _State[T]:
        """"""
        # Capture the last sequence wildcard for every level of operation nesting on a stack
        # Used to add backtracking edges in case the "match" fails later
        last_wildcards = [None]
        # Generate a fail state for every level of nesting to backtrack to a sequence wildcard in a parent Expression
        # in case no match can be found
        fail_states = [None]
        operand_counts = [0]
        root = state = _State()
        states = {root.id: root}

        for term in flatterm:
            if operand_counts[-1] >= 0:
                operand_counts[-1] += 1

            # For wildcards, generate a chain of #min_count Wildcard edges
            # If the wildcard is unbounded (fixed_size = False),
            # add a wildcard self loop at the end
            if isinstance(term, Wildcard):
                # Generate a chain of #min_count Wildcard edges
                for _ in range(term.min_count):
                    state = cls._create_child_state(state, Wildcard)
                    states[state.id] = state
                # If it is a sequence wildcard, add a self loop
                if not term.fixed_size:
                    state[Wildcard] = state
                    last_wildcards[-1] = state
                    operand_counts[-1] = -1
            else:
                state = cls._create_child_state(state, term)
                states[state.id] = state
                if is_operation(term):
                    fail_state = None
                    if last_wildcards[-1] or fail_states[-1]:
                        last_fail_state = (
                            fail_states[-1]
                            if not isinstance(fail_states[-1], list) else fail_states[-1][operand_counts[-1]]
                        )
                        if term.arity.fixed_size:
                            fail_state = _State()
                            states[fail_state.id] = fail_state
                            new_fail_states = [fail_state]
                            for _ in range(term.arity.min_count):
                                new_fail_state = _State()
                                states[new_fail_state.id] = new_fail_state
                                fail_state[Wildcard] = new_fail_state
                                fail_state = new_fail_state
                                new_fail_states.append(new_fail_state)
                            fail_state[OPERATION_END] = last_wildcards[-1] or last_fail_state
                            fail_state = new_fail_states
                        else:
                            fail_state = _State()
                            states[fail_state.id] = fail_state
                            fail_state[OPERATION_END] = last_wildcards[-1] or last_fail_state
                            fail_state[Wildcard] = fail_state
                    fail_states.append(fail_state)
                    last_wildcards.append(None)
                    operand_counts.append(0)
                elif term == OPERATION_END:
                    fail_states.pop()
                    last_wildcards.pop()
                    operand_counts.pop()

            if last_wildcards[-1] != state:
                if last_wildcards[-1]:
                    state[EPSILON] = last_wildcards[-1]
                elif fail_states[-1]:
                    last_fail_state = (
                        fail_states[-1]
                        if not isinstance(fail_states[-1], list) else fail_states[-1][operand_counts[-1]]
                    )
                    state[EPSILON] = last_fail_state

        state.payload = [final_label]

        return cls._convert_nfa_to_dfa(root, states)
778400
def flat(l):
    
    newl = []
    for i in range(len(l)):
        for j in range(len(l[i])):
            newl.append(l[i][j])
    return newl
1301098
def result_tree_flat(context, cl, request):
    

    return {
        #'filtered': is_filtered_cl(cl, request),
        'results': (th_for_result(cl, res) for res in list(cl.result_list)),
    }
310337
function generateClassNameSubstitutions(tokens, substitutionPattern, substitutions) {
  tokens.forEach((tokenList)=> {
    var token = tokenList[0];
    generateSubstitution(token, substitutionPattern, substitutions);
  });
}