:type logs str[]
    :type _map (list) -> str
    :type _reduce (list) -> obj
540257
def logs_map_and_reduce(logs, _map, _reduce):
    
    keys = []
    mapped_count = Counter()
    mapped = defaultdict(list)

    # first map all entries
    for log in logs:
        key = _map(log)
        mapped[key].append(log)
        mapped_count[key] += 1

        if key not in keys:
            keys.append(key)

    # the most common mapped item
    top_count = mapped_count.most_common(1).pop()[1]

    # now reduce mapped items
    reduced = []

    # keep the order under control
    for key in keys:
        entries = mapped[key]
        # print(key, entries)

        # add "value" field to each reduced item (1.0 will be assigned to the most "common" item)
        item = _reduce(entries)
        item['value'] = 1. * len(entries) / top_count

        reduced.append(item)

    # print(mapped)
    return reduced
27419
function getIndexLogTranslations(type = TYPE_WIDGETS) {
  const params = { type: t(`TYPE_${type}`) };

  return {
    logStart: `  ${t('INDEXING_TYPE', params)}`,
    logEnd: `  ${t('INDEXED_TYPE', params)}`,
    logNotFound: `  ${t('NO_EXTENSIONS_FOUND_FOR_TYPE', params)}`,
  };
}
991881
function detect_list(type, doc_map) {
    if (doc_map[type])
      return _.flatten(_.map(doc_map[type], function(d) { d[type] }));
    else
      return null;
}
872706
def convert_type_list_elements(
    list_object  = None,
    element_type = str
    ):
    
    if element_type is str:
        return [str(element) if not isinstance(element, list) else convert_type_list_elements(
            list_object  = element,
            element_type = str
        ) for element in list_object]
437958
function _Type(
    type,       // :: String
    name,       // :: String
    url,        // :: String
    arity,      // :: NonNegativeInteger
    format,
    // :: Nullable ((String -> String, String -> String -> String) -> String)
    supertypes, // :: Array Type
    test,       // :: Any -> Boolean
    tuples      // :: Array (Array3 String (a -> Array b) Type)
  ) {
    var t = Object.create (Type$prototype);
    t._test = test;
    t._extractors = tuples.reduce (function(_extractors, tuple) {
      _extractors[tuple[0]] = tuple[1];
      return _extractors;
    }, {});
    t.arity = arity;  // number of type parameters
    t.extractors = Z.map (B (toArray), t._extractors);
    t.format = format || function(outer, inner) {
      return Z.reduce (function(s, tuple) {
        return s +
               outer (' ') +
               when (tuple[2].arity > 0)
                    (parenthesize (outer))
                    (inner (tuple[0]) (show (tuple[2])));
      }, outer (name), tuples);
    };
    t.keys = tuples.map (function(tuple) { return tuple[0]; });
    t.name = name;
    t.supertypes = supertypes;
    t.type = type;
    t.types = tuples.reduce (function(types, tuple) {
      types[tuple[0]] = tuple[2];
      return types;
    }, {});
    t.url = url;
    return t;
  }
693403
function log (state, type, namespace, message) {
  const level = levels[ type ]
  _.each(state.loggers, function (logger) {
    logger.log({
      type: type,
      level: level,
      namespace: namespace,
      message: message
    })
  })
}
137305
function(type) {
            var name = type;
            this[type] = _.bind(function() {
                var args = Array.prototype.slice.call(arguments, 0);
                args.splice(0, 0, type);
                return this.printLog.apply(this, args);
            }, this);
            return this[type];
        }
1174963
def types(self):
        
        data = clips.data.DataObject(self._env)

        lib.EnvSlotTypes(self._env, self._cls, self._name, data.byref)

        return tuple(data.value) if isinstance(data.value, list) else ()
1033015
def sigloss(logfile):
    ''''''
    print("Processing log %s" % filename)
    mlog = mavutil.mavlink_connection(filename,
                                      planner_format=args.planner,
                                      notimestamps=args.notimestamps,
                                      robust_parsing=args.robust)

    last_t = 0

    types = args.types
    if types is not None:
        types = types.split(',')

    while True:
        m = mlog.recv_match(condition=args.condition)
        if m is None:
            return
        if types is not None and m.get_type() not in types:
            continue
        if args.notimestamps:
            if not 'usec' in m._fieldnames:
                continue
            t = m.usec / 1.0e6
        else:
            t = m._timestamp
        if last_t != 0:
            if t - last_t > args.deltat:
                print("Sig lost for %.1fs at %s" % (t-last_t, time.asctime(time.localtime(t))))
        last_t = t
639469
def log(self, *args):
        '''
        
        '''
        if len(args):
            self._log = args[0]
        else:
            return self._log
27989
private void log(ArrayList<PrintWriter> writers, RecordTypes recordType,
                   Keys[] keys, String[] values) {
    log(writers, recordType, keys, values, false);
  }
703899
def get_worker_log(self, log_id, log_type, size=0):
        
        params = OrderedDict([('log', ''), ('id', log_id)])
        if log_type is not None:
            log_type = log_type.lower()
            if log_type not in LOG_TYPES_MAPPING:
                raise ValueError('log_type should choose a value in ' +
                                 ' '.join(six.iterkeys(LOG_TYPES_MAPPING)))
            params['logtype'] = LOG_TYPES_MAPPING[log_type]
        if size > 0:
            params['size'] = str(size)
        resp = self._client.get(self.resource(), params=params)
        return resp.text
343592
function logger(type) {
    var args = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
    }
    var msg = args.shift();
    var fn = chek_1.isFunction(chek_1.last(args)) ? args.pop() : chek_1.noop;
    var meta = chek_1.isPlainObject(chek_1.last(args)) ? args.pop() : null;
    var obj = {
        type: type,
        msg: null,
        meta: meta
    };
    var formatters = chek_1.isString(msg) ? msg.match(/%/g) : null;
    if (formatters && formatters.length)
        msg = util_1.format.apply(void 0, [msg].concat(args));
    else
        msg = [msg].concat(args).join(' ');
    if (type === 'error' && !(msg instanceof Error)) {
        msg = new Error(msg);
        var stack = msg.stack.split('\n');
        var tmpMsg = stack.shift();
        stack.shift();
        stack.unshift(tmpMsg);
        msg.stack = stack.join('\n');
    }
    // If any error just throw it.
    if (msg instanceof Error) {
        if (fn)
            fn(msg, obj);
        msg.stack = msg.stack.split('\n').map(function (s, i) {
            if (i === 0)
                return colurs.applyAnsi('[error]', _log.colors.error) + ' ' + (msg.name || 'Error') + ': ' + msg.message;
            return s;
        }).join('\n');
        throw msg;
    }
    obj.msg = msg;
    fn(msg, obj);
    if (meta) {
        meta = util_1.inspect(meta, null, null, true);
        msg += ('\n' + meta);
    }
    if (type && _log.colors[type])
        msg = colurs.applyAnsi('[' + type + ']: ', _log.colors[type]) + msg;
    process.stderr.write(msg + '\n');
    return _log;
}
956357
def restore_type(self, type):
        

        # All dialects
        mapping = {
            ARRAY: 'array',
            sa.Boolean: 'boolean',
            sa.Date: 'date',
            sa.DateTime: 'datetime',
            sa.Float: 'number',
            sa.Integer: 'integer',
            JSONB: 'object',
            JSON: 'object',
            sa.Numeric: 'number',
            sa.Text: 'string',
            sa.Time: 'time',
            sa.VARCHAR: 'string',
            UUID: 'string',
        }

        # Get field type
        field_type = None
        for key, value in mapping.items():
            if isinstance(type, key):
                field_type = value

        # Not supported
        if field_type is None:
            message = 'Type "%s" is not supported'
            raise tableschema.exceptions.StorageError(message % type)

        return field_type
1373982
def typelogged_func(func):
    
    if not pytypes.typelogging_enabled:
        return func
    if hasattr(func, 'do_logging'):
        func.do_logging = True
        return func
    elif hasattr(func, 'do_typecheck'):
        # actually shouldn't happen
        return _typeinspect_func(func, func.do_typecheck, True)
    else:
        return _typeinspect_func(func, False, True)
156714
def log(type, str)
      case type
      when :connect
        @logger << Colors.green(str)
      when :close
        @logger << Colors.red(str)
      when :read
        @logger << Colors.gold(str)
      when :write
        @logger << Colors.white(str)
      else
        raise "unknown event type: #{type.inspect}"
      end
    end
469093
function listToGraphQLEnumType(list, name) {
  const values = reduce(list, (values, val) => {
    values[val] = { value: val };
    return values;
  }, {});
  return new GraphQLEnumType({ name, values });
}