code: def make_tool(uri,                # type: Union[Text, CommentedMap, CommentedSeq]
                loadingContext      # type: LoadingContext
               ):  # type: (...) -> Process
      
      if loadingContext.loader is None:
          raise ValueError("loadingContext must have a loader")
      resolveduri, metadata = loadingContext.loader.resolve_ref(uri)
  
      processobj = None
      if isinstance(resolveduri, MutableSequence):
          for obj in resolveduri:
              if obj['id'].endswith('#main'):
                  processobj = obj
                  break
          if not processobj:
              raise WorkflowException(
                  u"Tool file contains graph of multiple objects, must specify "
                  "one of #%s" % ", #".join(
                      urllib.parse.urldefrag(i["id"])[1] for i in resolveduri
                      if "id" in i))
      elif isinstance(resolveduri, MutableMapping):
          processobj = resolveduri
      else:
          raise Exception("Must resolve to list or dict")
  
      tool = loadingContext.construct_tool_object(processobj, loadingContext)
  
      if loadingContext.jobdefaults:
          jobobj = loadingContext.jobdefaults
          for inp in tool.tool["inputs"]:
              if shortname(inp["id"]) in jobobj:
                  inp["default"] = jobobj[shortname(inp["id"])]
  
      return tool
docs: Make a Python CWL object.