Returns (codename, name) for all tools.
960096
def _get_all_permissions(opts, tools):
    """"""
    perms = []
    for tool in tools:
        perms.append((_get_permission_codename(tool, opts), 'Can %s %s' % \
                (tool.name, opts.verbose_name_plural)))
    return perms
738487
def _get_all_scanner_ids(zap_helper):
    """"""
    scanners = zap_helper.zap.ascan.scanners()
    return [s['id'] for s in scanners]
1154204
def get_tool(name, context=None, default=_marker):
    

    # Try first with the context
    if context is not None:
        try:
            context = get_object(context)
            return getToolByName(context, name)
        except (APIError, AttributeError) as e:
            # https://github.com/senaite/bika.lims/issues/396
            logger.warn("get_tool::getToolByName({}, '{}') failed: {} "
                        "-> falling back to plone.api.portal.get_tool('{}')"
                        .format(repr(context), name, repr(e), name))
            return get_tool(name, default=default)

    # Try with the plone api
    try:
        return ploneapi.portal.get_tool(name)
    except InvalidParameterError:
        if default is not _marker:
            return default
        fail("No tool named '%s' found." % name)
1339022
def _all_feature_names(name):
    # type: (Union[str, bytes, List[Dict]]) -> List[str]
    
    if isinstance(name, bytes):
        return [name.decode('utf8')]
    elif isinstance(name, list):
        return [x['name'] for x in name]
    else:
        return [name]
824539
def msg_name(code):
    """"""
    ids = {v: k for k, v in COMMANDS.items()}
    return ids[code]
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
1133964
def _determine_tool(files):
    """"""
    for file in files:
        linker_ext = file.split('.')[-1]
        if "sct" in linker_ext or "lin" in linker_ext:
            yield (str(file),"uvision")
        elif "ld" in linker_ext:
            yield (str(file),"make_gcc_arm")
        elif "icf" in linker_ext:
            yield (str(file),"iar_arm")
1013864
def name(self):
        """"""
        return self.TYPES.get(self._type, self.TYPES[idaapi.o_idpspec0])
1215221
def GetNames(cls):
    
    names = []
    for plugin_class in cls._plugins.values():
      name = getattr(plugin_class, 'ARTIFACT_DEFINITION_NAME', None)
      if name:
        names.append(name)

    return names
723596
def get_methods_by_name(self, name):
        

        return (m for m in self.methods if m.get_name() == name)
34639
def name(self):
        """"""
        return str(conf.lib.clang_getCString(conf.lib.clang_getFileName(self)))
406709
def getMethName(meth):
    '''
    
    '''
    item = meth.__self__
    mname = item.__module__
    cname = item.__class__.__name__
    fname = meth.__func__.__name__
    return '.'.join((mname, cname, fname))
179221
function getTools(config) {
      var tools = {};

      config.openRequests = config.openRequests || {};

      tools.noop = Function();
      tools.id = function(d) { return d; }

      tools.argArray = function(args) {
        return Array.prototype.slice.call(args, 0);
      }

      tools.join = function() {
        var query = '',
            arr = tools.argArray(arguments).map(function(d) {
              var d = typeof d == 'object' ? '?' + tools.serialize(d) : d,
                  s;

              s = (d && String(d) || '').split('?');
              if (s.length == 1) return d;
              if (query) query += '&';
              query += s[1];
              return s[0];
            }).filter(tools.id);

        return arr.join('/').replace(/\/+/g, '/') + (query ? '?' + query : '')
                  .replace(/&&/g, '&').replace(/&$/, '');
      }

      tools.serialize = function(obj, prefix) {
        var str = [], p, k;
        for (p in obj) {
          if (obj.hasOwnProperty(p)) {
            k = prefix ? prefix + '[' + p + ']' : p, v = obj[p];
            if (v instanceof Date) v = JSON.stringify(v);
            str.push(typeof v == 'object'
                      ? tools.serialize(v, k)
                      : encodeURIComponent(k) + '=' + encodeURIComponent(v));
          }
        }
        return str.join('&');
      }

      tools.merge = function(a, b) {
        for (var k in b) a[k] = b[k];
        return a;
      }

      tools.xhrargs = function(d, cb) {
        if (typeof (d) === 'function') return { data: {}, cb: d };
        else return { data: d || {}, cb: cb };
      }

      tools.uuid = function() {
        function s4() {
          return Math.floor((1 + Math.random()) * 0x10000)
                     .toString(16)
                     .substring(1);
        };

        return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
               s4() + '-' + s4() + s4() + s4();
      };

      tools.request = function(method, url, data, cb, context) {
        var req = typeof (XMLHttpRequest) != 'undefined'
                    ? new XMLHttpRequest()
                    : new ActiveXObject('Microsoft.XMLHTTP'),
            isjson = typeof (FormData) === 'undefined' ||
                          !(data instanceof FormData),
            reqId = tools.uuid();

        config.openRequests[reqId] = true;

        // If is blocking and blocked, silently go away
        if (context.isBlocking && config.blockers[context.path]) return;

        // Else block the next guy
        else if (context.isBlocking) config.blockers[context.path] = true;

        if (config.credentials) req.withCredentials = true;
        req.open(method, url, true);

        if (isjson) req.setRequestHeader('Content-type', 'application/json');
        req.onreadystatechange = function() {
          var status, data, error, meta;

          // Unlblock in config.blockingDelay time if isBlocking
          if (context.isBlocking) {
            setTimeout(function() {
              config.blockers[context.path] = false;
            }, config.blockingDelay);
          };

          if (req.readyState == 4) {  // done
            status = req.status;
            if (status >= 200 && status < 300) {
              try {
                data = JSON.parse(req.responseText || '{}');
                error = config.getError(data);
                if (!req.responseText) error = 'Empty response';
                meta = config.getMetadata(data);
                data = config.getData(data);
              } catch (e) { error = 'invalid json response' };
            } else {
              error = { code: status, message: 'invalid status code' };
            }

            if (config.openRequests[reqId]) {
              delete config.openRequests[reqId];
              return cb && cb(error, data, meta);
            }
          }
        }
        if (!isjson) req.send(data);
        else if (data) req.send(JSON.stringify(data));
        else req.send();
      };

      tools.forEach = function(obj, fn) {
        var k;

        if (obj instanceof Array) {
          obj.forEach(fn);
        } else for (k in obj) fn(obj[k], k);
      };

      tools.defineProperty = function(obj, key, val) {
        if (!(obj instanceof Object)) return;
        try {
          Object.defineProperty(obj, key, {
            enumerable: false,
            value: val
          });
        } catch (e) {  // fallback
          obj[key] = val;
        }
      };

      return tools;
    }
436457
def get_tools_paths(self):
        """"""
        if settings.DEBUG or is_testing():
            return list(get_apps_tools().values())

        else:
            tools_root = settings.FLOW_TOOLS_ROOT
            subdirs = next(os.walk(tools_root))[1]

            return [os.path.join(tools_root, sdir) for sdir in subdirs]
1102373
def names(self):
        """"""
        if getattr(self, 'key', None) is None:
            result = []
        else:
            result = [self.key]
        if hasattr(self, 'aliases'):
            result.extend(self.aliases)
        return result
863527
def list_tools(self):
        
        tools = []
        exists, sections = self.sections()
        if exists:
            for section in sections:
                options = {'section': section,
                           'built': None,
                           'version': None,
                           'repo': None,
                           'branch': None,
                           'name': None,
                           'groups': None,
                           'image_name': None}
                for option in list(options.keys()):
                    exists, value = self.option(section, option)
                    if exists:
                        options[option] = value
                if 'core' not in options['groups'] and 'hidden' not in options['groups']:
                    tools.append(options)
        return tools
37282
public static function get_name($tool) {
        $name = null;

        if (empty($tool->name)) {
            $toolcontext = \context::instance_by_id($tool->contextid);
            $name = $toolcontext->get_context_name();
        } else {
            $name = $tool->name;
        };

        return $name;
    }