TODO not correctly formulated doc
324091
protected <T> T parseBody(Class<T> clazz) throws ParsableException, MediaTypeException {
        String contentType = context.requestContentType();
        
        // if the content type header was not provided, we throw
        if (contentType == null || contentType.isEmpty()) {
            throw new MediaTypeException("Missing media type header");
        }
        
        // extract the actual content type in case charset is also a part of the string
        contentType = HttpHeaderUtil.getContentTypeFromContentTypeAndCharacterSetting(contentType);
        
        ParserEngine engine = injector.getInstance(ParserEngineManager.class).getParserEngineForContentType(contentType);
        
        if (engine == null) {
            throw new MediaTypeException("An engine for media type ("+contentType+") was not found");
        }
        
        try {
            return engine.invoke(context.requestInputStream(), clazz);
        } catch (IOException e) {
            throw new ParsableException(e);
        }
    }
786304
function formErrorText (info, msg) {
  const hr = '----------'

  return addPlatformInformation(info)
  .then((obj) => {
    const formatted = []

    function add (msg) {
      formatted.push(
        stripIndents(msg)
      )
    }

    add(`
      ${obj.description}

      ${obj.solution}

    `)

    if (msg) {
      add(`
        ${hr}

        ${msg}

      `)
    }

    add(`
      ${hr}

      ${obj.platform}
    `)

    if (obj.footer) {
      add(`

        ${hr}

        ${obj.footer}
      `)
    }

    return formatted.join('\n\n')
  })
}
1003011
def _reformat_docstring(doc, format_fn, code_newline=""):
    
    out = []
    status = {"listing": False, "add_line": False, "eat_line": False}
    code = False
    for line in doc:
        if status["add_line"]:
            out.append("\n")
        status["add_line"] = False
        if status["eat_line"]:
            status["eat_line"] = False
            if line.strip() == "":
                continue
        # check for start/end of code block
        if line.strip() == "```":
            code = not code
            out.append(line + code_newline)
            continue
        if not code:
            # if we are in a block listing a blank line ends it
            if line.rstrip() == "":
                status["listing"] = False
            # format the line
            line = format_fn(line, status)
            # see if block start
            if re_listing.match(line):
                status["listing"] = True
        out.append(line.rstrip() + "\n")
    return out
1061122
def _composed_doc(fs):
    
    if not fs:
        # Argument name for the docstring.
        return 'n'

    return '{f}({g})'.format(f=fs[0].__name__, g=_composed_doc(fs[1:]))
726349
function() {

			this.$("#todo-list").html('');

			switch(window.app.TodoFilter){
				case "active":
					_.each(window.app.Todos.remaining(), this.addOne);
					break;
				case "completed":
					_.each(window.app.Todos.completed(), this.addOne);
					break;
				default:
					window.app.Todos.each(this.addOne, this);
					break;
			}

		}
657002
function doc() {
    return gulp.src(srcFiles)
    .pipe(gulpTypedoc({
        name: name,
        readme: "src/documentation.md",
        theme: "src/theme",
        mode: "file",
        target: "es6",
        module: "commonjs",
        out: docsDir,
        excludeExternals: true,
        excludePrivate: true,
        hideGenerator: true,
        toc: docsToc
    }))
    .on("error", handleError);
}
1191859
def fix_docs(cls):
    
    import inspect
    public_undocumented_members = {name: func for name, func in inspect.getmembers(cls)
                                   if not name.startswith('_') and func.__doc__ is None}

    for name, func in public_undocumented_members.items():
        for parent in cls.__mro__[1:]:
            parfunc = getattr(parent, name, None)
            if parfunc and getattr(parfunc, '__doc__', None):
                if isinstance(func, property):
                    # copy property, since its doc attribute is read-only
                    new_prop = property(fget=func.fget, fset=func.fset,
                                        fdel=func.fdel, doc=parfunc.__doc__)
                    setattr(cls, name, new_prop)
                else:
                    if hasattr(func, '__func__'):  # handle instancemethods
                        func.__func__.__doc__ = parfunc.__doc__
                    else:
                        func.__doc__ = parfunc.__doc__
                break
    return cls
1092045
function prepareDom(doc, cfg = {}) {
    if (!(doc instanceof Document)) {
        console.warn('Cannnot prepare, the provided element is not a document.');
        return;
    }
    // apply defaults
    _.defaults(cfg, defaults);
    // append any default styles
    appendStyle(cfg.style, doc);
    // attach event handlers
    Handler.addAll(doc, cfg);

    return doc;
}
733312
function addTodo(text) {
    var todo = {
      _id: new Date().toISOString(),
      title: text,
      completed: false
    };
    db.put(todo, function callback (err, result) {
      if (!err) {
        console.log('Successfully posted a todo!');
      }
    });
  }
240699
function (todo) {
      model.remove(todo.id, function () {
        todos.splice(todos.indexOf(todo), 1);
        if (todo.completed) {
          completedCount--;
        } else {
          itemsLeft--;
          checkedAll = completedCount === todos.length;
        }
      });
    }
740075
def filter(self, p_todo_str, p_todo):
        
        if config().colors():
            p_todo_str = TopydoString(p_todo_str, p_todo)

            priority_color = config().priority_color(p_todo.priority())

            colors = [
                (r'\B@(\S*\w)', AbstractColor.CONTEXT),
                (r'\B\+(\S*\w)', AbstractColor.PROJECT),
                (r'\b\S+:[^/\s]\S*\b', AbstractColor.META),
                (r'(^|\s)(\w+:){1}(//\S+)', AbstractColor.LINK),
            ]

            # color by priority
            p_todo_str.set_color(0, priority_color)

            for pattern, color in colors:
                for match in re.finditer(pattern, p_todo_str.data):
                    p_todo_str.set_color(match.start(), color)
                    p_todo_str.set_color(match.end(), priority_color)

            p_todo_str.append('', AbstractColor.NEUTRAL)

        return p_todo_str
358027
function cleanUpNodeJSDoc(
  node,
  JSDocCommentValue = getJSDocCommentValue(node),
) {
  t.removeComments(node);
  t.addComment(node, 'leading', createJSDocCommentValue(JSDocCommentValue));
}
1035499
function toRawDoc(typeInfo, obj) {
    obj = extend(true, {}, obj);
    var doc = {};

    if (obj.rev) {
      doc._rev = obj.rev;
      delete obj.rev;
    }

    if (obj.attachments) {
      doc._attachments = obj.attachments;
      delete obj.attachments;
    }

    var id = obj.id || uuid();
    delete obj.id;
    doc._id = serialize(typeInfo.documentType, id);

    if (typeInfo.relations) {
      Object.keys(typeInfo.relations).forEach(function (field) {
        var relationDef = typeInfo.relations[field];
        var relationType = Object.keys(relationDef)[0];

        if (relationType === 'belongsTo') {
          if (obj[field] && typeof obj[field].id !== 'undefined') {
            obj[field] = obj[field].id;
          }
        } else { // hasMany
          var relatedType = relationDef[relationType];
          if (relatedType.options && relatedType.options.queryInverse) {
            delete obj[field];
            return;
          }
          if (obj[field]) {
            var dependents = obj[field].map(function (dependent) {
              if (dependent && typeof dependent.id !== 'undefined') {
                return dependent.id;
              }
              return dependent;
            });
            obj[field] = dependents;
          } else {
            obj[field] = [];
          }
        }
      });
    }

    doc.data = obj;

    return doc;
  }
1126550
def docroutine(self, object, name, mod=None,
                   funcs={}, classes={}, methods={}, cl=None):
        """"""

        anchor = (cl and cl.__name__ or '') + '-' + name
        note = ''

        title = '<a name="%s"><strong>%s</strong></a>' % (
            self.escape(anchor), self.escape(name))

        if inspect.ismethod(object):
            args = inspect.getfullargspec(object)
            # exclude the argument bound to the instance, it will be
            # confusing to the non-Python user
            argspec = inspect.formatargspec (
                    args.args[1:],
                    args.varargs,
                    args.varkw,
                    args.defaults,
                    annotations=args.annotations,
                    formatvalue=self.formatvalue
                )
        elif inspect.isfunction(object):
            args = inspect.getfullargspec(object)
            argspec = inspect.formatargspec(
                args.args, args.varargs, args.varkw, args.defaults,
                annotations=args.annotations,
                formatvalue=self.formatvalue)
        else:
            argspec = '(...)'

        if isinstance(object, tuple):
            argspec = object[0] or argspec
            docstring = object[1] or ""
        else:
            docstring = pydoc.getdoc(object)

        decl = title + argspec + (note and self.grey(
               '<font face="helvetica, arial">%s</font>' % note))

        doc = self.markup(
            docstring, self.preformat, funcs, classes, methods)
        doc = doc and '<dd><tt>%s</tt></dd>' % doc
        return '<dl><dt>%s</dt>%s</dl>\n' % (decl, doc)
854232
function merge(docs){
  var byFullId = {};

  docs.forEach(function(doc) {
    byFullId[doc.section + '/' + doc.id] = doc;
  });

  for(var i = 0; i < docs.length;) {
    if (findParent(docs[i], 'method') || findParent(docs[i], 'property') || findParent(docs[i], 'event')) {
      docs.splice(i, 1);
    } else {
      i++;
    }
  }

  function findParent(doc, name) {
    var parentName = doc[name + 'Of'];
    if (!parentName) return false;

    var parent = byFullId[doc.section + '/' + parentName];
    if (!parent)
      throw new Error("No parent named '" + parentName + "' for '" +
        doc.name + "' in @" + name + "Of.");

    var listName = (name + 's').replace(/ys$/, 'ies');
    var list = parent[listName] = (parent[listName] || []);
    list.push(doc);
    list.sort(orderByName);
    return true;
  }

  function orderByName(a, b){
    return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0);
  }
}
767407
def _cleanup(self):
        """"""
        if self.todolist.exists():
            try:
                saved_todo = iter(open(self.todolist, encoding="utf-8"))
                int(next(saved_todo).strip())
                for line in saved_todo:
                    _, serial = line.strip().split()
                    int(serial)
            except (StopIteration, ValueError):
                # The todo list was inconsistent. This may happen if we get
                # killed e.g. by the timeout wrapper. Just remove it - we'll
                # just have to do whatever happened since the last successful
                # sync.
                logger.info("Removing inconsistent todo list.")
                self.todolist.unlink()
890272
function Header(props, context) {
	const { todos } = props;
	const remainingText = `${ todos.incompleteSize } ${ pluralize("item", todos.incompleteSize ) } remaining`;

	return <h1>
			F.lux Todos <small>{ remainingText }</small>
		</h1>
}