其他字段层级化 `note` `support` `importent` etc
352340
function handleFieldsTree (api) {
            // 排除名单
            var ex = ['function', 'desc', 'param', 'example'];
            if ( api && typeof api === 'object' ) {
                for ( var i in api ) {
                    if ( ex.indexOf(i) === -1 ) {
                    // grunt.log.writeln(i)
                        var field = api[i];
                        // console.log(field)
                        var tmp = [];
                        // grunt.log.writeflags(field)
                        if ( field && field.forEach ) {
                            field.forEach(function (item, k) {
                                if ( item.belong ) {
                                    tmp.push(k);
                                    handleFieldBelong(i, item.belong.split('.'), api.param, item)
                                }
                            });
                            if ( tmp.length ) {
                                for ( var m = tmp.length; m-- ; m >= 0 ) {
                                    // console.log(tmp[m])
                                    field.splice(tmp[m],1)
                                }
                            }
                            // clear
                            if ( !field.length ) delete api[i];

                        }
                    }
                }
            }
        }
1128567
function patch(entry) {
  var description = entry.note
  var source = entry.source
  var result = {
    id: null,
    type: entry.type,
    apostrophe: entry.apostrophe ? true : undefined,
    categories: entry.categories,
    considerate: entry.considerate,
    inconsiderate: entry.inconsiderate,
    condition: entry.condition
  }

  if (source) {
    if (description) {
      description += ' (source: ' + source + ')'
    } else {
      description = 'Source: ' + source
    }
  }

  result.note = description
  result.id = getPatternId(result)

  return result
}
891463
def _import_symbol(import_path, setting_name):
    
    mod_name, class_name = import_path.rsplit('.', 1)

    # import module
    try:
        mod = import_module(mod_name)
        cls = getattr(mod, class_name)
    except ImportError as e:
        __, __, exc_traceback = sys.exc_info()
        frames = traceback.extract_tb(exc_traceback)
        if len(frames) > 1:
            raise   # import error is a level deeper.

        raise ImproperlyConfigured("{0} does not point to an existing class: {1}".format(setting_name, import_path))
    except AttributeError:
        raise ImproperlyConfigured("{0} does not point to an existing class: {1}".format(setting_name, import_path))

    return cls
1095397
function writeNotes() {
  let output = '';
  let compatNotes = collectCompatNotes();
  for (let note of compatNotes) {
    let noteIndex = compatNotes.indexOf(note);
    output += `<p id=compatNote_${noteIndex+1}>${noteIndex+1}. ${note}</p>`;
  }
  return output;
}
986581
def _format_notes(self, record):
        
        notes = []

        if "notes" in record:
            for note in record["notes"]:
                self._append_note_dict_to_list(notes, "general", note)

        if "language_and_script_notes" in record:
            self._append_note_dict_to_list(
                notes, "language_and_script", record["language_and_script_notes"]
            )

        if "publication_notes" in record:
            self._append_note_dict_to_list(
                notes, "publication_notes", record["publication_notes"]
            )

        if "physical_characteristics_and_technical_requirements" in record:
            self._append_note_dict_to_list(
                notes,
                "physical_condition",
                record["physical_characteristics_and_technical_requirements"],
            )

        return notes
884700
function (source, options, verbose) {
    /* Single file import */
    if ( 'string' == typeof source ) {
        return imports(source, options, verbose);
    }

    /* Multiple files import */
    else if ( 'object' == typeof source ) {
        /* Creating scripts holder */
        var scripts = '', result;

        /* Files in array */
        if ( Array.isArray(source) ) {
            source.forEach(function (file, i) {
                var scr = imports(file, options, verbose);

                if ( scr ) {
                    scripts += scr.text;

                    if ( i == 0 ) {
                        result = scr;
                    }
                }
            });

            if ( result ) {
                return result;
            }
        }

        /* Files in object */
        else {
            var start = 0;

            source.forEach(function (file, options) {
                var scr = imports(file, options, verbose);

                if ( scr ) {
                    scripts += scr.text;

                    if ( start == 0 ) {
                        result = scr;
                    }
                }

                start++;
            });

            if ( result ) {
                return result;
            }
        }
    }
}
187670
def comment_import(r, unused_dot_list):
    """"""
    unused_dot_str = ".".join(unused_dot_list)
    for n in r("ImportNode"):
        if n.names()[0] == unused_dot_str:
            # The "!" is inserted so that this line doesn't show up when searching for
            # the comment pattern in code.
            n.replace("#{}# {}".format("!", str(n)))
            break
717255
function tryConsumeImport() {
            var token = scanner.getToken();
            if (token === 89 /* ImportKeyword */) {
                token = nextToken();
                if (token === 9 /* StringLiteral */) {
                    // import "mod";
                    recordModuleName();
                    return true;
                }
                else {
                    if (token === 69 /* Identifier */ || ts.isKeyword(token)) {
                        token = nextToken();
                        if (token === 136 /* FromKeyword */) {
                            token = nextToken();
                            if (token === 9 /* StringLiteral */) {
                                // import d from "mod";
                                recordModuleName();
                                return true;
                            }
                        }
                        else if (token === 56 /* EqualsToken */) {
                            if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) {
                                return true;
                            }
                        }
                        else if (token === 24 /* CommaToken */) {
                            // consume comma and keep going
                            token = nextToken();
                        }
                        else {
                            // unknown syntax
                            return true;
                        }
                    }
                    if (token === 15 /* OpenBraceToken */) {
                        token = nextToken();
                        // consume "{ a as B, c, d as D}" clauses
                        // make sure that it stops on EOF
                        while (token !== 16 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) {
                            token = nextToken();
                        }
                        if (token === 16 /* CloseBraceToken */) {
                            token = nextToken();
                            if (token === 136 /* FromKeyword */) {
                                token = nextToken();
                                if (token === 9 /* StringLiteral */) {
                                    // import {a as A} from "mod";
                                    // import d, {a, b as B} from "mod"
                                    recordModuleName();
                                }
                            }
                        }
                    }
                    else if (token === 37 /* AsteriskToken */) {
                        token = nextToken();
                        if (token === 116 /* AsKeyword */) {
                            token = nextToken();
                            if (token === 69 /* Identifier */ || ts.isKeyword(token)) {
                                token = nextToken();
                                if (token === 136 /* FromKeyword */) {
                                    token = nextToken();
                                    if (token === 9 /* StringLiteral */) {
                                        // import * as NS from "mod"
                                        // import d, * as NS from "mod"
                                        recordModuleName();
                                    }
                                }
                            }
                        }
                    }
                }
                return true;
            }
            return false;
        }
804378
def _onImport( self, name, line, pos, absPosition ):
        "  "
        if self.__lastImport is not None:
            self.imports.append( self.__lastImport )
        self.__lastImport = Import( name, line, pos, absPosition )
        return
949203
def place_notes_at(self, notes, at):
        """"""
        for x in self.bar:
            if x[0] == at:
                x[0][2] += notes
731190
def _make_pretty_note(note):
    

    if note != "":
        note = "\n".join(map(lambda n: n[4:], note.split("\n")))
        return "**Note:**\n%s\n" % note
915540
def add_private_note(self, note, source=None):
        
        note = {
            'value': note,
        }
        if source:
            note['source'] = source
        self._append_to('_private_notes', note)
599259
def add_note(self, body):
        
        from highton.models.note import Note
        created_id = self._post_request(
            endpoint=self.ENDPOINT + '/' + str(self.id) + '/' + Note.ENDPOINT,
            data=self.element_to_string(
                Note(body=body).encode()
            )
        ).headers.get('Location').replace('.xml', '').split('/')[-1]
        return Note.get(created_id)
494564
function writeSupportInfo(supportData, browserId, compatNotes) {
  let output = '';

  // browsers are optional in the data, display them as "?" in our table
  if (!supportData) {
    output += getVersionString(null);
  // we have support data, lets go
  } else {
    output += getVersionString(supportData.version_added);

    if (supportData.version_removed) {
      // We don't know when
      if (typeof(supportData.version_removed) === 'boolean' && supportData.version_removed) {
        output += '&nbsp;—?'
      } else { // We know when
        output += '&nbsp;— ' + supportData.version_removed;
      }
    }

    // Add prefix
    if (supportData.prefix) {
      output += `<span title="prefix" class="inlineIndicator prefixBox prefixBoxInline">
      <a title="The name of this feature is prefixed with '${supportData.prefix}' as this
      browser considers it experimental" href="/en-US/docs/Web/Guide/Prefixes">${supportData.prefix}
      </a></span>`;
    }

    // Add note anchors
    // There are three types of notes (notes, flag notes, and alternative names).
    // Collect them and order them, before adding them to the cell
    let noteAnchors = [];

    // Generate notes, if any
    if (supportData.notes) {
      if (Array.isArray(supportData.notes)) {
        for (let note of supportData.notes) {
          let noteIndex = compatNotes.indexOf(note);
          noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`);
        }
      } else {
        let noteIndex = compatNotes.indexOf(supportData.notes);
        noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`);
      }
    }

    // there is a flag and it needs a note, too
    if (supportData.flag) {
      let flagNote = writeFlagsNote(supportData, browserId);
      let noteIndex = compatNotes.indexOf(flagNote);
      noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`);
    }

    // add a link to the alternative name note, if there is one
    if (supportData.alternative_name) {
      let altNameNote = writeAlternativeNameNote(supportData.alternative_name);
      let noteIndex = compatNotes.indexOf(altNameNote);
      noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`);
    }

    noteAnchors = noteAnchors.sort();
    if ((supportData.partial_support || noteAnchors.length > 0) && aggregateMode) {
      output += ' *';
    } else {
      output += noteAnchors.join(' ');
    }
  }
  return output;
}
230885
def create_default(cls, package):
        
        notes_master_part = cls._new(package)
        theme_part = cls._new_theme_part(package)
        notes_master_part.relate_to(theme_part, RT.THEME)
        return notes_master_part
213451
def _import(self, path, name):
        # type: (Text, Text) -> Text
        
        imp = path.replace('/', '.')
        self.imports[imp].add(name)
        return name
655668
function generateImportDeclaration(stmt, semicolon) {
        var result, cursor;

        // If no ImportClause is present,
        // this should be `import ModuleSpecifier` so skip `from`
        // ModuleSpecifier is StringLiteral.
        if (stmt.specifiers.length === 0) {
            // import ModuleSpecifier ;
            return [
                'import',
                space,
                // ModuleSpecifier
                generateExpression(stmt.source, {
                    precedence: Precedence.Sequence,
                    allowIn: true,
                    allowCall: true
                }),
                semicolon
            ];
        }

        // import ImportClause FromClause ;
        result = [
            'import'
        ];
        cursor = 0;

        // ImportedBinding
        if (stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier) {
            result = join(result, [
                    generateExpression(stmt.specifiers[cursor], {
                        precedence: Precedence.Sequence,
                        allowIn: true,
                        allowCall: true
                    })
            ]);
            ++cursor;
        }

        if (stmt.specifiers[cursor]) {
            if (cursor !== 0) {
                result.push(',');
            }

            if (stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier) {
                // NameSpaceImport
                result = join(result, [
                        space,
                        generateExpression(stmt.specifiers[cursor], {
                            precedence: Precedence.Sequence,
                            allowIn: true,
                            allowCall: true
                        })
                ]);
            } else {
                // NamedImports
                result.push(space + '{');

                if ((stmt.specifiers.length - cursor) === 1) {
                    // import { ... } from "...";
                    result.push(space);
                    result.push(generateExpression(stmt.specifiers[cursor], {
                        precedence: Precedence.Sequence,
                        allowIn: true,
                        allowCall: true
                    }));
                    result.push(space + '}' + space);
                } else {
                    // import {
                    //    ...,
                    //    ...,
                    // } from "...";
                    withIndent(function (indent) {
                        var i, iz;
                        result.push(newline);
                        for (i = cursor, iz = stmt.specifiers.length; i < iz; ++i) {
                            result.push(indent);
                            result.push(generateExpression(stmt.specifiers[i], {
                                precedence: Precedence.Sequence,
                                allowIn: true,
                                allowCall: true
                            }));
                            if (i + 1 < iz) {
                                result.push(',' + newline);
                            }
                        }
                    });
                    if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {
                        result.push(newline);
                    }
                    result.push(base + '}' + space);
                }
            }
        }

        result = join(result, [
            'from' + space,
            // ModuleSpecifier
            generateExpression(stmt.source, {
                precedence: Precedence.Sequence,
                allowIn: true,
                allowCall: true
            }),
            semicolon
        ]);
        return result;
    }