Get a single external tool.

        Returns the specified external tool.
493446
def get_single_external_tool_courses(self, course_id, external_tool_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # REQUIRED - PATH - external_tool_id
        """ID"""
        path["external_tool_id"] = external_tool_id

        self.logger.debug("GET /api/v1/courses/{course_id}/external_tools/{external_tool_id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/courses/{course_id}/external_tools/{external_tool_id}".format(**path), data=data, params=params, no_data=True)
112107
def get_tool(name): 
    
    tool = name.lower()
    if tool not in __tools__:
        raise ValueError("Tool {0} not found!\n".format(name))

    t = __tools__[tool]()

    if not t.is_installed():
        sys.stderr.write("Tool {0} not installed!\n".format(tool))

    if not t.is_configured():
        sys.stderr.write("Tool {0} not configured!\n".format(tool))

    return t
1363431
private static function get_block_structure() {
        return new external_single_structure(
            array(
                'instanceid'    => new external_value(PARAM_INT, 'Block instance id.'),
                'name'          => new external_value(PARAM_PLUGIN, 'Block name.'),
                'region'        => new external_value(PARAM_ALPHANUMEXT, 'Block region.'),
                'positionid'    => new external_value(PARAM_INT, 'Position id.'),
                'collapsible'   => new external_value(PARAM_BOOL, 'Whether the block is collapsible.'),
                'dockable'      => new external_value(PARAM_BOOL, 'Whether the block is dockable.'),
                'weight'        => new external_value(PARAM_INT, 'Used to order blocks within a region.', VALUE_OPTIONAL),
                'visible'       => new external_value(PARAM_BOOL, 'Whether the block is visible.', VALUE_OPTIONAL),
                'contents'      => new external_single_structure(
                    array(
                        'title'         => new external_value(PARAM_TEXT, 'Block title.'),
                        'content'       => new external_value(PARAM_RAW, 'Block contents.'),
                        'contentformat' => new external_format_value('content'),
                        'footer'        => new external_value(PARAM_RAW, 'Block footer.'),
                        'files'         => new external_files('Block files.'),
                    ),
                    'Block contents (if required).', VALUE_OPTIONAL
                ),
            ), 'Block information.'
        );
    }
553594
public static function update_tool_type_parameters() {
        return new external_function_parameters(
            array(
                'id' => new external_value(PARAM_INT, 'Tool type id'),
                'name' => new external_value(PARAM_RAW, 'Tool type name', VALUE_DEFAULT, null),
                'description' => new external_value(PARAM_RAW, 'Tool type description', VALUE_DEFAULT, null),
                'state' => new external_value(PARAM_INT, 'Tool type state', VALUE_DEFAULT, null)
            )
        );
    }
993805
def _get(self, target, alias):
        
        if target not in self._aliases:
            return
        return self._aliases[target].get(alias)
120696
def get_external_paths(self):
        """"""
        return [to_text_string(self.itemText(i))
                for i in range(EXTERNAL_PATHS, self.count())]
1307316
def external_table(self):
        
        if self._external is None:
            self._external = ExternalTable(self.connection, self.database)
        return self._external
834668
def initialize_external_method(new, old, params, file, comment, token=nil,
                                   internal=nil, nolink=nil)
      return nil unless new || old

      if internal
        external_alias_header = "#{INTERNAL_ALIAS_MES} "
        external_alias_text   = external_alias_header + old 
      elsif file
        external_alias_header = "#{EXTERNAL_ALIAS_MES} "
        external_alias_text   = external_alias_header + file + "#" + old
      else
        return nil
      end
      external_meth = AnyMethod.new(external_alias_text, new)
      external_meth.singleton    = false
      external_meth.params       = params
      external_comment = remove_trailing_alias(comment) + "\n\n" if comment
      external_meth.comment = external_comment || ""
      if nolink && token
        external_meth.start_collecting_tokens
        external_meth.add_token Token.new(1,1).set_text(token)
      else
        external_meth.comment << external_alias_text
      end

      return external_meth
    end
1028155
public static function get_ltis_by_courses_returns() {

        return new external_single_structure(
            array(
                'ltis' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'id' => new external_value(PARAM_INT, 'External tool id'),
                            'coursemodule' => new external_value(PARAM_INT, 'Course module id'),
                            'course' => new external_value(PARAM_INT, 'Course id'),
                            'name' => new external_value(PARAM_RAW, 'LTI name'),
                            'intro' => new external_value(PARAM_RAW, 'The LTI intro', VALUE_OPTIONAL),
                            'introformat' => new external_format_value('intro', VALUE_OPTIONAL),
                            'introfiles' => new external_files('Files in the introduction text', VALUE_OPTIONAL),
                            'timecreated' => new external_value(PARAM_INT, 'Time of creation', VALUE_OPTIONAL),
                            'timemodified' => new external_value(PARAM_INT, 'Time of last modification', VALUE_OPTIONAL),
                            'typeid' => new external_value(PARAM_INT, 'Type id', VALUE_OPTIONAL),
                            'toolurl' => new external_value(PARAM_URL, 'Tool url', VALUE_OPTIONAL),
                            'securetoolurl' => new external_value(PARAM_RAW, 'Secure tool url', VALUE_OPTIONAL),
                            'instructorchoicesendname' => new external_value(PARAM_TEXT, 'Instructor choice send name',
                                                                               VALUE_OPTIONAL),
                            'instructorchoicesendemailaddr' => new external_value(PARAM_INT, 'instructor choice send mail address',
                                                                                    VALUE_OPTIONAL),
                            'instructorchoiceallowroster' => new external_value(PARAM_INT, 'Instructor choice allow roster',
                                                                                VALUE_OPTIONAL),
                            'instructorchoiceallowsetting' => new external_value(PARAM_INT, 'Instructor choice allow setting',
                                                                                 VALUE_OPTIONAL),
                            'instructorcustomparameters' => new external_value(PARAM_RAW, 'instructor custom parameters',
                                                                                VALUE_OPTIONAL),
                            'instructorchoiceacceptgrades' => new external_value(PARAM_INT, 'instructor choice accept grades',
                                                                                    VALUE_OPTIONAL),
                            'grade' => new external_value(PARAM_INT, 'Enable grades', VALUE_OPTIONAL),
                            'launchcontainer' => new external_value(PARAM_INT, 'Launch container mode', VALUE_OPTIONAL),
                            'resourcekey' => new external_value(PARAM_RAW, 'Resource key', VALUE_OPTIONAL),
                            'password' => new external_value(PARAM_RAW, 'Shared secret', VALUE_OPTIONAL),
                            'debuglaunch' => new external_value(PARAM_INT, 'Debug launch', VALUE_OPTIONAL),
                            'showtitlelaunch' => new external_value(PARAM_INT, 'Show title launch', VALUE_OPTIONAL),
                            'showdescriptionlaunch' => new external_value(PARAM_INT, 'Show description launch', VALUE_OPTIONAL),
                            'servicesalt' => new external_value(PARAM_RAW, 'Service salt', VALUE_OPTIONAL),
                            'icon' => new external_value(PARAM_URL, 'Alternative icon URL', VALUE_OPTIONAL),
                            'secureicon' => new external_value(PARAM_URL, 'Secure icon URL', VALUE_OPTIONAL),
                            'section' => new external_value(PARAM_INT, 'course section id', VALUE_OPTIONAL),
                            'visible' => new external_value(PARAM_INT, 'visible', VALUE_OPTIONAL),
                            'groupmode' => new external_value(PARAM_INT, 'group mode', VALUE_OPTIONAL),
                            'groupingid' => new external_value(PARAM_INT, 'group id', VALUE_OPTIONAL),
                        ), 'Tool'
                    )
                ),
                'warnings' => new external_warnings(),
            )
        );
    }
647283
public static function get_available_in_context_returns() {
        return new external_single_structure(
            array(
                'filters' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'contextlevel' => new external_value(PARAM_ALPHA, 'The context level where the filters are:
                                (coursecat, course, module).'),
                            'instanceid' => new external_value(PARAM_INT, 'The instance id of item associated with the context.'),
                            'contextid' => new external_value(PARAM_INT, 'The context id.'),
                            'filter'  => new external_value(PARAM_PLUGIN, 'Filter plugin name.'),
                            'localstate' => new external_value(PARAM_INT, 'Filter state: 1 for on, -1 for off, 0 if inherit.'),
                            'inheritedstate' => new external_value(PARAM_INT, '1 or 0 to use when localstate is set to inherit.'),
                        )
                    ),
                    'Available filters'
                ),
                'warnings' => new external_warnings(),
            )
        );
    }
1354908
def _tools_classpath(self):
    

    javac_classpath = Java.global_javac_classpath(self.context.products)
    if javac_classpath:
      return javac_classpath

    self.set_distribution(jdk=True)
    jars = self.dist.find_libs(['tools.jar'])
    if len(jars) != 1:
      raise TaskError('Expected a single `tools.jar` entry for {}; got: {}'.format(
        self.dist, jars))
    return jars
1238234
public static function get_content_returns() {
        return new external_single_structure(
            array(
                'templates' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'id' => new external_value(PARAM_TEXT, 'ID of the template.'),
                            'html' => new external_value(PARAM_RAW, 'HTML code.'),
                        )
                    ),
                    'Templates required by the generated content.'
                ),
                'javascript' => new external_value(PARAM_RAW, 'JavaScript code.'),
                'otherdata' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'name' => new external_value(PARAM_RAW, 'Field name.'),
                            'value' => new external_value(PARAM_RAW, 'Field value.')
                        )
                    ),
                    'Other data that can be used or manipulated by the template via 2-way data-binding.'
                ),
                'files' => new external_files('Files in the content.'),
                'restrict' => new external_single_structure(
                    array(
                        'users' => new external_multiple_structure(
                            new external_value(PARAM_INT, 'user id'), 'List of allowed users.', VALUE_OPTIONAL
                        ),
                        'courses' => new external_multiple_structure(
                            new external_value(PARAM_INT, 'course id'), 'List of allowed courses.', VALUE_OPTIONAL
                        ),
                    ),
                    'Restrict this content to certain users or courses.'
                )
            )
        );
    }
392056
public static function get_assessment_form_definition_returns() {
        return new external_single_structure(
            array(
                'dimenssionscount' => new external_value(PARAM_INT, 'The number of dimenssions used by the form.'),
                'descriptionfiles' => new external_files('Files in the description text'),
                'options' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'name' => new external_value(PARAM_ALPHANUMEXT, 'Option name.'),
                            'value' => new external_value(PARAM_NOTAGS, 'Option value.')
                        )
                    ), 'The form options.'
                ),
                'fields' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'name' => new external_value(PARAM_ALPHANUMEXT, 'Field name.'),
                            'value' => new external_value(PARAM_RAW, 'Field default value.')
                        )
                    ), 'The form fields.'
                ),
                'current' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'name' => new external_value(PARAM_ALPHANUMEXT, 'Field name.'),
                            'value' => new external_value(PARAM_RAW, 'Current field value.')
                        )
                    ), 'The current field values.'
                ),
                'dimensionsinfo' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'id' => new external_value(PARAM_INT, 'Dimension id.'),
                            'min' => new external_value(PARAM_FLOAT, 'Minimum grade for the dimension.'),
                            'max' => new external_value(PARAM_FLOAT, 'Maximum grade for the dimension.'),
                            'weight' => new external_value(PARAM_TEXT, 'The weight of the dimension.'),
                            'scale' => new external_value(PARAM_TEXT, 'Scale items (if used).', VALUE_OPTIONAL),
                        )
                    ), 'The dimensions general information.'
                ),
                'warnings' => new external_warnings()
            )
        );
    }
206033
def get_tool_class(self, tool):
        
        if isinstance(tool, string_types):
            tool_id = StreamId(tool)
        elif isinstance(tool, StreamId):
            tool_id = tool
        else:
            raise TypeError(tool)

        tool_stream_view = None

        # Look in the main tool channel first
        if tool_id in self.tools:
            tool_stream_view = self.tools[tool_id].window((MIN_DATE, self.tools.up_to_timestamp))
        else:
            # Otherwise look through all the channels in the order they were defined
            for tool_channel in self.tool_channels:
                if tool_channel == self.tools:
                    continue
                if tool_id in tool_channel:
                    # noinspection PyTypeChecker
                    tool_stream_view = tool_channel[tool_id].window((MIN_DATE, tool_channel.up_to_timestamp))

        if tool_stream_view is None:
            raise ToolNotFoundError(tool)

        # TODO: Use tool versions - here we just take the latest one
        last = tool_stream_view.last()
        if last is None:
            raise ToolNotFoundError(tool)

        return tool_stream_view.last().value
1276744
def get_method(self, name, descriptor):
        
        key = name + str(descriptor)
        if key not in self.methods:
            self.methods[key] = ExternalMethod(self.name, name, descriptor)

        return self.methods[key]
691131
public static function get_combined_review_options_returns() {
        return new external_single_structure(
            array(
                'someoptions' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'name' => new external_value(PARAM_ALPHANUMEXT, 'option name'),
                            'value' => new external_value(PARAM_INT, 'option value'),
                        )
                    )
                ),
                'alloptions' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'name' => new external_value(PARAM_ALPHANUMEXT, 'option name'),
                            'value' => new external_value(PARAM_INT, 'option value'),
                        )
                    )
                ),
                'warnings' => new external_warnings(),
            )
        );
    }
616117
def tool(name):
    # type: (str) -> FunctionType
    
    global g_tools

    def decorator(fn):  # pylint: disable=missing-docstring
        # type: (FunctionType) -> FunctionType
        g_tools[name] = fn
        return fn

    return decorator