Retrieve variableTypes or taskCategories.
502324
@Override
    @Path("/{dataType}")
    public JSONObject get(String path, Map<String,String> headers) throws ServiceException, JSONException {
        String dataType = getSegment(path, 1);
        if (dataType == null)
            throw new ServiceException("Missing path segment: {dataType}");
        try {
            BaselineData baselineData = DataAccess.getBaselineData();
            if (dataType.equals("VariableTypes")) {
                List<VariableType> variableTypes = baselineData.getVariableTypes();
                JSONArray jsonArray = new JSONArray();
                for (VariableType variableType : variableTypes)
                    jsonArray.put(variableType.getJson());
                return new JsonArray(jsonArray).getJson();
            }
            else if (dataType.equals("TaskCategories")) {
                List<TaskCategory> taskCats = new ArrayList<TaskCategory>();
                taskCats.addAll(baselineData.getTaskCategories().values());
                Collections.sort(taskCats);
                JSONArray jsonArray = new JSONArray();
                for (TaskCategory taskCat : taskCats)
                    jsonArray.put(taskCat.getJson());
                return new JsonArray(jsonArray).getJson();
            }
            else {
                throw new ServiceException("Unsupported dataType: " + dataType);
            }
        }
        catch (Exception ex) {
            throw new ServiceException(ex.getMessage(), ex);
        }
    }
748782
def _get_types(type_):
    

    return list(
        itertools.chain.from_iterable(
            map(lambda x: TYPE_MAPPINGS[x].get(type_, []), TYPE_MAPPINGS)
        )
    )
1356598
def get_doctypes(self, default_doctypes=DEFAULT_DOCTYPES):
        """"""
        for action, value in reversed(self.steps):
            if action == 'doctypes':
                return list(value)

        if self.type is not None:
            return [self.type.get_mapping_type_name()]

        return default_doctypes
971630
def _get_avaliable_tasks(self):
        """"""
        base_task = posixpath.join(self._queue_path, self.TASK_PREFIX)
        tasks = self._client.kv.find(prefix=base_task)
        return sorted(tasks.items())
406568
def variables(self):
        
        p = lambda o: isinstance(o, Variable) and self._docfilter(o)
        return sorted(filter(p, self.doc.values()))
1051975
def _get_type(cls, ptr):
        """"""

        # fall back to the base class if unknown
        return cls.__types.get(lib.g_base_info_get_type(ptr), cls)
22663
def vals(self, var_type):
        
        return {x: y for x, y in self.items() if y.has_value_of_type(var_type)}
319211
def variables(self):
        """"""
        variables = set([])
        for node in self.nodes:
            variables.add(node.variable)
        return sorted(variables)
866994
def get_field_type(f):
    """"""
    types = (t[5:] for t in dir(f) if t[:4] == 'TYPE' and
             getattr(f, t) == f.type)
    return next(types)
872748
def _get_category_from_pars_var(template_var, context):
    '''
    
    '''
    cat = template_var.resolve(context)
    if isinstance(cat, basestring):
        cat = Category.objects.get_by_tree_path(cat)
    return cat
1176416
def get_variables(expression, variables=None):
    """"""
    if variables is None:
        variables = set()
    if hasattr(expression, 'variable_name') and expression.variable_name is not None:
        variables.add(expression.variable_name)
    if isinstance(expression, Operation):
        for operand in op_iter(expression):
            get_variables(operand, variables)
    return variables
1181616
def get_tasks():
    """"""
    from paver.tasks import environment
    for tsk in environment.get_tasks():
        print(tsk.shortname)
515194
def variables(
            self,
            name=None,
            function=None,
            decl_type=None,
            header_dir=None,
            header_file=None,
            recursive=None,
            allow_empty=None):

        """"""
        return (
            self._find_multiple(
                self._impl_matchers[
                    scopedef_t.variable],
                name=name,
                function=function,
                decl_type=decl_type,
                header_dir=header_dir,
                header_file=header_file,
                recursive=recursive,
                allow_empty=allow_empty)
        )
80383
private void readTaskCustomPropertyDefinitions(Tasks gpTasks)
   {
      for (Taskproperty definition : gpTasks.getTaskproperties().getTaskproperty())
      {
         //
         // Ignore everything but custom values
         //
         if (!"custom".equals(definition.getType()))
         {
            continue;
         }

         //
         // Find the next available field of the correct type.
         //
         String type = definition.getValuetype();
         FieldType fieldType = TASK_PROPERTY_TYPES.get(type).getField();

         //
         // If we have run out of fields of the right type, try using a text field.
         //
         if (fieldType == null)
         {
            fieldType = TASK_PROPERTY_TYPES.get("text").getField();
         }

         //
         // If we actually have a field available, set the alias to match
         // the name used in GanttProject.
         //
         if (fieldType != null)
         {
            CustomField field = m_projectFile.getCustomFields().getCustomField(fieldType);
            field.setAlias(definition.getName());
            String defaultValue = definition.getDefaultvalue();
            if (defaultValue != null && defaultValue.isEmpty())
            {
               defaultValue = null;
            }
            m_taskPropertyDefinitions.put(definition.getId(), new Pair<FieldType, String>(fieldType, defaultValue));
         }
      }
   }
459315
def types(self):
        
        output = set()
        for var in self.values():
            if var.has_value():
                output.update(var.types())
        return list(output)
1262286
def get_doctypes(self, default_doctypes=None):
        """"""
        doctypes = self.type.get_mapping_type_name()
        if isinstance(doctypes, six.string_types):
            doctypes = [doctypes]
        return super(S, self).get_doctypes(default_doctypes=doctypes)
215293
def subsystems(self):
    """"""
    ret = set()
    for task_type in self.task_types():
      ret.update([dep.subsystem_cls for dep in task_type.subsystem_dependencies_iter()])
    return ret