Returns an array of available kinds, including their group
5830
function(includeClusterScoped) {
    var kinds = [];
    var rejectedKinds = _.map(Constants.AVAILABLE_KINDS_BLACKLIST, function(kind) {
      return _.isString(kind) ?
              { kind: kind, group: '' } :
              kind;
    });

    // ignore the legacy openshift kinds, these have been migrated to api groups
    _.each(_.pickBy(API_CFG, function(value, key) {
      return key !== 'openshift';
    }), function(api) {
      _.each(api.resources.v1, function(resource) {
        if (resource.namespaced || includeClusterScoped) {
          // Exclude subresources and any rejected kinds
          if (_.includes(resource.name, '/') || _.find(rejectedKinds, { kind: resource.kind, group: '' })) {
            return;
          }

          kinds.push({
            kind: resource.kind,
            group:  ''
          });
        }
      });
    });

   // Kinds under api groups
    _.each(APIS_CFG.groups, function(group) {

      // Use the console's default version first, and the server's preferred version second
      var preferredVersion = defaultVersion[group.name] || group.preferredVersion;
      _.each(group.versions[preferredVersion].resources, function(resource) {
        // Exclude subresources and any rejected kinds
        if (_.includes(resource.name, '/') || _.find(rejectedKinds, {kind: resource.kind, group: group.name})) {
          return;
        }


        if(excludeKindFromAPIGroupList(group.name, resource.kind)) {
          return;
        }

        if (resource.namespaced || includeClusterScoped) {
          kinds.push({
            kind: resource.kind,
            group: group.name
          });
        }
      });
    });

    return _.uniqBy(kinds, function(value) {
      return value.group + "/" + value.kind;
    });
  }
700107
def prefix(*kinds):
    """"""
    def wrap(fn):
        try:
            fn.prefix_kinds.extend(kinds)
        except AttributeError:
            fn.prefix_kinds = list(kinds)
        return fn
    return wrap
431692
function (productTypes, department) {

            function sizeMapToArray(sizeMap, departmentName) {
                var ret = [];
                for (var sizeName in sizeMap) {
                    if (sizeMap.hasOwnProperty(sizeName)) {
                        ret.push({
                            name: sizeName,
                            sizeWeight: sizeMap[sizeName].sizeWeight,
                            departmentName: departmentName,
                            productTypes: sizeMap[sizeName].productTypes
                        });
                    }
                }

                ret.sort(function(a, b) {
                    return (a.sizeWeight || 0) - (b.sizeWeight || 0)
                });

                return ret;
            }

            var departmentSizeMap = productTypeDepartmentToSizeMap;

            if (productTypes) {
                var departmentHash,
                    key, departments;

                departmentSizeMap = {};
                productTypes.each(function (productType) {
                    if (department) {
                        departments = [department];
                    } else {
                        departments = productTypeToDepartmentsMap[productType.$.id];
                    }
                    if (departments) {
                        for (var i = 0; i < departments.length; i++) {
                            key = departments[i].$.name;
                            departmentHash = departmentSizeMap[key] = departmentSizeMap[key] || {};
                            if (productType.$.sizes) {
                                productType.$.sizes.each(function (size) {
                                    if (!departmentHash[size.$.name]) {
                                        departmentHash[size.$.name] = {
                                            productTypes: [],
                                            sizeWeight: size.$.weight
                                        };
                                    }
                                    departmentHash[size.$.name].productTypes.push(productType);
                                });
                            }
                        }
                    }
                });
            }
            var groups = [],
                group;
            for (var departmentName in departmentSizeMap) {
                if (departmentSizeMap.hasOwnProperty(departmentName)) {
                    group = {
                        name: departmentName,
                        items: sizeMapToArray(departmentSizeMap[departmentName], departmentName)
                    };
                    groups.push(group);
                }
            }

            return groups;

        }
972322
def get_event_kind(self):
        
        slug = self.kwargs.get('kind_slug', None)
        if slug is None:
            return None  # Front page; showing all Event kinds.
        else:
            slugs_to_kinds = {v:k for k,v in Event.KIND_SLUGS.items()}
            return slugs_to_kinds.get(slug, None)
1259960
def groups_with_resources(cls, instance):
        
        return instance.groups_dynamic.options(
            sa.orm.eagerload(cls.models_proxy.Group.resources)
        )
802599
public static function getTypes()
    {
        $typesList = [];
        foreach (Yii::$app->db->getTableSchema(static::tableName())->columns['type']->enumValues as $type) {
            $typesList[$type] = MeasureHelper::t($type);
        }
        return $typesList;
    }
311451
def returns(self):
        """"""
        kind = "({}) ".format(self.kind) if self.kind is not None else ""      
        mods = ", ".join(self.modifiers) + " "
        dtype = self.dtype if self.dtype is not None else ""
        return "{}{}{}".format(dtype, kind, mods)
333955
function groupBy(f, xs) {
    const groups = [];
    for (const x of xs) {
        if (groups.length !== 0 && f(groups[groups.length - 1][0], x)) {
            groups[groups.length - 1].push(x);
        }
        else {
            groups.push([x]);
        }
    }
    return groups;
}
968835
def format_kinds(raw):
    """"""
    output = ' '.join('{} {}'.format(*kind) for kind in raw if kind)
    return output
756817
def kind(self):
        ''''''
        with self._mutex:
            kind = self._obj.get_kind()
            if kind == RTC.PERIODIC:
                return self.PERIODIC
            elif kind == RTC.EVENT_DRIVEN:
                return self.EVENT_DRIVEN
            else:
                return self.OTHER
805889
function getTypeArray (typeString) {
  const letters = typeString.split('')
  const elements = []
  let acc = ''

  while (letters.length) {
    const letter = letters.shift()
    // Ignore spaces
    if (letter !== ' ') {
      switch (letter) {
        case '[':
        case ']':
        case '/':
          if (acc.length) {
            elements.push(acc)
            acc = ''
          }
          elements.push(letter === '/' ? ' / ' : letter)
          break
        default:
          acc += letter
      }
    }
    continue
  }
  if (acc.length) {
    elements.push(acc)
    acc = ''
  }
  return elements
}
989786
function getAllEntries(groups) {
    return groups.reduce(function(current, group) {
        const theseEntries = group.getEntries();
        const subEntries = getAllEntries(group.getGroups());
        if (theseEntries.length > 0) {
            current = current.concat(theseEntries);
        }
        if (subEntries.length > 0) {
            current = current.concat(subEntries);
        }
        return current;
    }, []);
}
1309137
def _get_side2KerningGroups(self):
        
        found = {}
        for name, contents in self.items():
            if name.startswith("public.kern2."):
                found[name] = contents
        return found
491768
function getEnums(spec_c, bygroup, parent) {
  var spec_js = {};
  var enumGroups = _.find(getChildren(spec_c, 'sectiondef'), function(section) {
    var kind = getAttr(section, 'kind');
    return ((kind == 'enum') || (kind == 'public-type'));
  });
  if (enumGroups) {
    _.each(enumGroups.children, function(enumGroup) {
      var enumGroupName = getText(getChild(enumGroup, 'name'), 'name');
      var enumGroupDescription = getText(getChild(enumGroup, 'detaileddescription'), 'description');
      var enumGroupVals = getChildren(enumGroup, 'enumvalue');
      if (bygroup) {
        spec_js[enumGroupName] = {
          description: enumGroupDescription,
          members: []
        };
      }
      _.each(enumGroupVals, function(e) {
        // TODO: get prefix as option
        var enumName = getText(getChild(e, 'name'), 'name').replace(/^MRAA_/, '');
        var enumDescription = getText(getChild(e, 'detaileddescription'), 'description');
        if (!bygroup) {
          spec_js[enumName] = {
            type: enumGroupName,
            description: enumDescription
          };
        } else {
          spec_js[enumGroupName].members.push(enumName);
        }
      });
    });
  }
  return spec_js;
}
679900
def groups(self, group_type=None, filters=None, params=None):
        
        group = self._tcex.ti.group(group_type)
        for g in self.tc_requests.groups_from_tag(group, self.name, filters=filters, params=params):
            yield g
34199
def _find_types(pkgs):
    ''''''
    return sorted({pkg.split(':', 1)[0] for pkg in pkgs
                   if len(pkg.split(':', 1)) == 2})
1307422
private Token[] match(Token.Kind... kinds) {
		Token[] result = new Token[kinds.length];
		for (int i = 0; i != result.length; ++i) {
			checkNotEof();
			Token token = tokens.get(index++);
			if (token.kind == kinds[i]) {
				result[i] = token;
			} else {
				syntaxError("Expected \"" + kinds[i] + "\" here", token);
			}
		}
		return result;
	}