How to use meta method in ng-mocks

Best JavaScript code snippet using ng-mocks

getTheme.mjs

Source:getTheme.mjs Github

copy

Full Screen

1export default colors => ({2 $schema: 'vscode://schemas/color-theme',3 name: 'Lucy Theme',4 type: 'dark',5 colors: {6 focusBorder: colors.dim2,7 foreground: colors.pure2,8 'widget.shadow': colors.background1,9 'selection.background': colors.background4,10 descriptionForeground: colors.dim3,11 errorForeground: colors.base1,12 'textBlockQuote.background': colors.background4,13 'textBlockQuote.border': colors.background4,14 'textCodeBlock.background': colors.background4,15 'textLink.activeForeground': colors.pure2,16 'textLink.foreground': colors.base2,17 'textPreformat.foreground': colors.pure2,18 'textSeparator.foreground': colors.dim2,19 'button.background': colors.background4,20 'button.foreground': colors.dim3,21 'button.hoverBackground': colors.background3,22 'dropdown.background': colors.background3,23 'dropdown.listBackground': colors.background4,24 'dropdown.border': colors.background3,25 'dropdown.foreground': colors.dim3,26 'input.background': colors.background4,27 'input.border': colors.background4,28 'input.foreground': colors.pure2,29 'input.placeholderForeground': colors.dim1,30 'inputOption.activeBorder': colors.dim1,31 'inputValidation.errorBackground': colors.background4,32 'inputValidation.errorBorder': colors.base1,33 'inputValidation.infoBackground': colors.background4,34 'inputValidation.infoBorder': colors.accent1,35 'inputValidation.warningBackground': colors.background4,36 'inputValidation.warningBorder': colors.accent2,37 'scrollbar.shadow': colors.background3,38 'scrollbarSlider.activeBackground': colors.translucent9,39 'scrollbarSlider.background': colors.translucent9,40 'scrollbarSlider.hoverBackground': colors.translucent9,41 'badge.foreground': colors.background3,42 'badge.background': colors.base2,43 'progressBar.background': colors.background4,44 'list.activeSelectionBackground': colors.background3,45 'list.activeSelectionForeground': colors.base2,46 'list.errorForeground': colors.base1,47 'list.warningForeground': colors.accent2,48 'list.dropBackground': colors.translucent,49 'list.focusBackground': colors.background3,50 'list.focusForeground': colors.pure2,51 'list.highlightForeground': colors.pure2,52 'list.hoverBackground': colors.background2,53 'list.hoverForeground': colors.pure2,54 'list.inactiveSelectionBackground': colors.background3,55 'list.inactiveSelectionForeground': colors.base2,56 'list.inactiveFocusBackground': colors.base2,57 'list.invalidItemForeground': colors.base1,58 'activityBar.background': colors.background1,59 'activityBar.dropBackground': colors.translucent,60 'activityBar.foreground': colors.dim3,61 'activityBar.border': colors.background1,62 'activityBarBadge.background': colors.base2,63 'activityBarBadge.foreground': colors.background3,64 'sideBar.background': colors.background2,65 'sideBar.foreground': colors.dim3,66 'sideBar.border': colors.background1,67 'sideBar.dropBackground': colors.translucent,68 'sideBarTitle.foreground': colors.dim1,69 'sideBarSectionHeader.background': colors.background2,70 'sideBarSectionHeader.foreground': colors.dim2,71 'editorGroup.background': colors.background1,72 'editorGroup.border': colors.background2,73 'editorGroup.dropBackground': colors.translucent,74 'editorGroupHeader.noTabsBackground': colors.background3,75 'editorGroupHeader.tabsBackground': colors.background3,76 'editorGroupHeader.tabsBorder': colors.background3,77 'tab.activeBackground': colors.background3,78 'tab.activeForeground': colors.base2,79 'tab.border': colors.background3,80 'tab.activeBorder': colors.base2,81 'tab.unfocusedActiveBorder': colors.dim3,82 'tab.inactiveBackground': colors.background3,83 'tab.inactiveForeground': colors.dim3,84 'tab.unfocusedActiveForeground': colors.dim4,85 'tab.unfocusedInactiveForeground': colors.dim3,86 'tab.hoverBackground': colors.background3,87 'tab.unfocusedHoverBackground': colors.background3,88 'tab.hoverBorder': colors.dim1,89 'tab.unfocusedHoverBorder': colors.background3,90 'editor.background': colors.background3,91 'editor.foreground': colors.pure2,92 'editorLineNumber.foreground': colors.dim1,93 'editorLineNumber.activeForeground': colors.dim4,94 'editorCursor.background': colors.translucent8,95 'editorCursor.foreground': colors.pure2,96 'editor.selectionBackground': colors.background4,97 'editor.inactiveSelectionBackground': colors.translucent3,98 'editor.selectionHighlightBackground': colors.translucent2,99 'editor.selectionHighlightBorder': colors.translucent8,100 'editor.wordHighlightBackground': colors.translucent2,101 'editor.wordHighlightBorder': colors.translucent8,102 'editor.wordHighlightStrongBackground': colors.translucent2,103 'editor.wordHighlightStrongBorder': colors.translucent8,104 'editor.findMatchBackground': colors.translucent2,105 'editor.findMatchBorder': colors.base2,106 'editor.findMatchHighlightBackground': colors.translucent2,107 'editor.findMatchHighlightBorder': colors.translucent8,108 'editor.findRangeHighlightBackground': colors.translucent3,109 'editor.findRangeHighlightBorder': colors.translucent8,110 'editor.hoverHighlightBackground': colors.translucent3,111 'editor.lineHighlightBackground': colors.translucent3,112 'editor.lineHighlightBorder': colors.translucent8,113 'editorLink.activeForeground': colors.accent1,114 'editor.rangeHighlightBackground': colors.background4,115 'editor.rangeHighlightBorder': colors.background4,116 'editorWhitespace.foreground': colors.dim1,117 'editorIndentGuide.background': colors.background4,118 'editorRuler.foreground': colors.dim1,119 'editorCodeLens.foreground': colors.dim2,120 'editorBracketMatch.background': colors.background3,121 'editorBracketMatch.border': colors.dim2,122 'editorError.foreground': colors.base1,123 'editorError.border': colors.translucent8,124 'editorWarning.foreground': colors.accent2,125 'editorWarning.border': colors.translucent8,126 'editorInfo.foreground': colors.accent1,127 'editorInfo.border': colors.background3,128 'editorHint.foreground': colors.const,129 'editorHint.border': colors.background3,130 'editorGutter.background': colors.background3,131 'editorGutter.modifiedBackground': colors.accent2,132 'editorGutter.addedBackground': colors.call,133 'editorGutter.deletedBackground': colors.base1,134 'diffEditor.insertedTextBackground': colors.translucent4,135 'diffEditor.insertedTextBorder': colors.translucent8,136 'diffEditor.removedTextBackground': colors.translucent6,137 'diffEditor.removedTextBorder': colors.translucent8,138 'editorWidget.background': colors.background4,139 'editorWidget.border': colors.background4,140 'editorSuggestWidget.background': colors.background4,141 'editorSuggestWidget.border': colors.background4,142 'editorSuggestWidget.foreground': colors.dim4,143 'editorSuggestWidget.highlightForeground': colors.pure2,144 'editorSuggestWidget.selectedBackground': colors.dim2,145 'editorHoverWidget.background': colors.background4,146 'editorHoverWidget.border': colors.background3,147 'debugExceptionWidget.background': colors.background4,148 'debugExceptionWidget.border': colors.background3,149 'editorMarkerNavigation.background': colors.background4,150 'editorMarkerNavigationError.background': colors.base1,151 'editorMarkerNavigationWarning.background': colors.accent2,152 'editorMarkerNavigationInfo.background': colors.accent1,153 'peekView.border': colors.background3,154 'peekViewEditor.background': colors.background4,155 'peekViewEditorGutter.background': colors.background4,156 'peekViewEditor.matchHighlightBackground': colors.dim1,157 'peekViewResult.background': colors.background4,158 'peekViewResult.fileForeground': colors.dim3,159 'peekViewResult.lineForeground': colors.dim3,160 'peekViewResult.matchHighlightBackground': colors.dim1,161 'peekViewResult.selectionBackground': colors.background4,162 'peekViewResult.selectionForeground': colors.pure2,163 'peekViewTitle.background': colors.background4,164 'peekViewTitleDescription.foreground': colors.dim3,165 'peekViewTitleLabel.foreground': colors.pure2,166 'merge.currentHeaderBackground': colors.translucent7,167 'merge.currentContentBackground': colors.translucent6,168 'merge.incomingHeaderBackground': colors.translucent5,169 'merge.incomingContentBackground': colors.translucent4,170 'merge.border': colors.background3,171 'merge.commonHeaderBackground': colors.translucent2,172 'merge.commonContentBackground': colors.translucent3,173 'editorOverviewRuler.border': colors.background3,174 'editorOverviewRuler.currentContentForeground': colors.background4,175 'editorOverviewRuler.incomingContentForeground': colors.background4,176 'editorOverviewRuler.findMatchForeground': colors.translucent2,177 'editorOverviewRuler.rangeHighlightForeground': colors.translucent2,178 'editorOverviewRuler.selectionHighlightForeground': colors.translucent2,179 'editorOverviewRuler.wordHighlightForeground': colors.translucent2,180 'editorOverviewRuler.wordHighlightStrongForeground': colors.translucent2,181 'editorOverviewRuler.modifiedForeground': colors.accent2,182 'editorOverviewRuler.addedForeground': colors.call,183 'editorOverviewRuler.deletedForeground': colors.base1,184 'editorOverviewRuler.errorForeground': colors.base1,185 'editorOverviewRuler.warningForeground': colors.accent2,186 'editorOverviewRuler.infoForeground': colors.accent1,187 'panel.background': colors.background4,188 'panel.border': colors.background3,189 'panel.dropBackground': colors.translucent,190 'panelTitle.activeBorder': colors.base2,191 'panelTitle.activeForeground': colors.base2,192 'panelTitle.inactiveForeground': colors.dim3,193 'statusBar.background': colors.background2,194 'statusBar.foreground': colors.dim2,195 'statusBar.border': colors.background1,196 'statusBar.debuggingBackground': colors.dim2,197 'statusBar.debuggingForeground': colors.pure2,198 'statusBar.debuggingBorder': colors.background2,199 'statusBar.noFolderBackground': colors.background2,200 'statusBar.noFolderForeground': colors.dim2,201 'statusBar.noFolderBorder': colors.background1,202 'statusBarItem.activeBackground': colors.background3,203 'statusBarItem.hoverBackground': colors.background3,204 'statusBarItem.prominentBackground': colors.background4,205 'statusBarItem.prominentHoverBackground': colors.background4,206 'titleBar.activeBackground': colors.background2,207 'titleBar.activeForeground': colors.dim3,208 'titleBar.inactiveBackground': colors.background2,209 'titleBar.inactiveForeground': colors.dim1,210 'titleBar.border': colors.background1,211 'notificationCenter.border': colors.background4,212 'notificationCenterHeader.foreground': colors.dim3,213 'notificationCenterHeader.background': colors.background4,214 'notificationToast.border': colors.background4,215 'notifications.foreground': colors.dim4,216 'notifications.background': colors.background4,217 'notifications.border': colors.background4,218 'notificationLink.foreground': colors.base2,219 'extensionButton.prominentForeground': colors.pure2,220 'extensionButton.prominentBackground': colors.background4,221 'extensionButton.prominentHoverBackground': colors.dim1,222 'pickerGroup.border': colors.background3,223 'pickerGroup.foreground': colors.dim1,224 'terminal.background': colors.background4,225 'terminal.foreground': colors.pure2,226 'terminal.ansiBlack': colors.background4,227 'terminal.ansiBlue': colors.accent2,228 'terminal.ansiBrightBlack': colors.dim2,229 'terminal.ansiBrightBlue': colors.accent2,230 'terminal.ansiBrightCyan': colors.accent1,231 'terminal.ansiBrightGreen': colors.call,232 'terminal.ansiBrightMagenta': colors.const,233 'terminal.ansiBrightRed': colors.base1,234 'terminal.ansiBrightWhite': colors.pure2,235 'terminal.ansiBrightYellow': colors.base2,236 'terminal.ansiCyan': colors.accent1,237 'terminal.ansiGreen': colors.call,238 'terminal.ansiMagenta': colors.const,239 'terminal.ansiRed': colors.base1,240 'terminal.ansiWhite': colors.pure2,241 'terminal.ansiYellow': colors.base2,242 'terminal.selectionBackground': colors.translucent2,243 'terminalCursor.background': colors.translucent8,244 'terminalCursor.foreground': colors.pure2,245 'debugToolBar.background': colors.background4,246 'welcomePage.buttonBackground': colors.background4,247 'welcomePage.buttonHoverBackground': colors.dim1,248 'walkThrough.embeddedEditorBackground': colors.background2,249 'gitDecoration.modifiedResourceForeground': colors.call,250 'gitDecoration.deletedResourceForeground': colors.base1,251 'gitDecoration.untrackedResourceForeground': colors.accent2,252 'gitDecoration.ignoredResourceForeground': colors.dim1,253 'gitDecoration.conflictingResourceForeground': colors.accent2254 },255 tokenColors: [256 {257 scope: [258 'comment',259 'comment keyword',260 'comment markup.underline.link',261 'comment string',262 'comment punctuation.definition',263 'comment punctuation',264 'comment text'265 ],266 settings: {267 fontStyle: 'italic',268 foreground: colors.dim2269 }270 },271 {272 scope: '\n\t\tcomment storage.type\n\t',273 settings: {274 foreground: colors.dim2275 }276 },277 {278 scope: '\n\t\tcomment entity.name.type\n\t',279 settings: {280 foreground: colors.dim4281 }282 },283 {284 scope: ['comment variable', 'comment variable.other'],285 settings: {286 foreground: colors.dim4287 }288 },289 {290 scope: '\n\t\tcomment keyword.codetag.notation\n\t',291 settings: {292 foreground: colors.const293 }294 },295 {296 scope: '\n\t\tcomment.git-status.header.remote\n\t',297 settings: {298 foreground: colors.base1299 }300 },301 {302 scope: '\n\t\tcomment.git-status.header.local\n\t',303 settings: {304 foreground: colors.accent1305 }306 },307 {308 scope: '\n\t\tcomment.other.git-status.head\n\t',309 settings: {310 foreground: colors.pure2311 }312 },313 {314 scope: 'constant',315 settings: {316 foreground: colors.const317 }318 },319 {320 scope: 'constant.other',321 settings: {322 foreground: colors.pure2323 }324 },325 {326 scope: 'constant.other.property',327 settings: {328 foreground: colors.const329 }330 },331 {332 scope: 'constant.other.color',333 settings: {334 foreground: colors.const335 }336 },337 {338 scope: 'constant.other.character-class.escape',339 settings: {340 foreground: colors.const341 }342 },343 {344 scope: 'constant.other.key',345 settings: {346 foreground: colors.const347 }348 },349 {350 scope: 'constant.other.symbol',351 settings: {352 foreground: colors.accent2353 }354 },355 {356 scope: 'constant.numeric',357 settings: {358 foreground: colors.const359 }360 },361 {362 scope: 'constant.language',363 settings: {364 foreground: colors.const365 }366 },367 {368 scope: 'constant.character.escape',369 settings: {370 foreground: colors.const371 }372 },373 {374 scope: 'constant.numeric.line-number.find-in-files',375 settings: {376 foreground: colors.dim1377 }378 },379 {380 scope: 'constant.numeric.line-number.match.find-in-files',381 settings: {382 foreground: colors.base2383 }384 },385 {386 scope: 'entity.name.section',387 settings: {388 foreground: colors.base2389 }390 },391 {392 scope: 'entity.name',393 settings: {394 foreground: colors.call395 }396 },397 {398 scope: 'entity.name.class',399 settings: {400 foreground: colors.accent1401 }402 },403 {404 scope: 'entity.name.constant',405 settings: {406 foreground: colors.const407 }408 },409 {410 scope: 'entity.name.namespace',411 settings: {412 foreground: colors.pure2413 }414 },415 {416 scope: 'entity.other.inherited-class',417 settings: {418 fontStyle: 'italic',419 foreground: colors.accent1420 }421 },422 {423 scope: 'entity.name.function',424 settings: {425 foreground: colors.call426 }427 },428 {429 scope: [430 'entity.name.tag',431 'entity.name.tag.js.jsx support.class.component.js.jsx'432 ],433 settings: {434 foreground: colors.base1435 }436 },437 {438 scope: 'entity.other.attribute-name',439 settings: {440 fontStyle: 'italic',441 foreground: colors.accent1442 }443 },444 {445 scope: [446 'entity.other.attribute-name.class.css',447 'entity.other.attribute-name.parent-selector-suffix.css',448 'entity.other.attribute-name.parent-selector-suffix.css punctuation.definition.entity.css'449 ],450 settings: {451 foreground: colors.call452 }453 },454 {455 scope: 'entity.other.attribute-name.id.css',456 settings: {457 foreground: colors.accent2458 }459 },460 {461 scope:462 '\n\t\tentity.other.attribute-name.pseudo-class.css\n\t\tentity.other.pseudo-class.css\n\t',463 settings: {464 fontStyle: 'italic',465 foreground: colors.accent1466 }467 },468 {469 scope: ['entity.name.function', 'support.function'],470 settings: {471 foreground: colors.call472 }473 },474 {475 scope: '\n\t\tentity.other.git-status.hex\n\t',476 settings: {477 foreground: colors.const478 }479 },480 {481 scope: 'invalid',482 settings: {483 fontStyle: 'italic'484 }485 },486 {487 scope: 'keyword',488 settings: {489 foreground: colors.base1490 }491 },492 {493 scope: 'keyword.control',494 settings: {495 foreground: colors.base1496 }497 },498 {499 scope: 'keyword.operator',500 settings: {501 foreground: colors.base1502 }503 },504 {505 scope: 'keyword.other.substitution',506 settings: {507 foreground: colors.dim3508 }509 },510 {511 scope:512 '\n\t\tkeyword.other.template.begin\n\t\tkeyword.other.template.end\n\t',513 settings: {514 foreground: colors.base1515 }516 },517 {518 scope: [519 'keyword.operator.heading.restructuredtext',520 'keyword.operator.table.row.restructuredtext',521 'keyword.operator.table.data.restructuredtext'522 ],523 settings: {524 foreground: colors.dim3525 }526 },527 {528 scope: 'markup.italic',529 settings: {530 fontStyle: 'italic'531 }532 },533 {534 scope: 'markup.bold',535 settings: {536 fontStyle: 'bold'537 }538 },539 {540 scope: 'markup.heading',541 settings: {542 foreground: colors.base2543 }544 },545 {546 scope: 'markup.raw',547 settings: {548 foreground: colors.accent2549 }550 },551 {552 scope: 'markup.underline',553 settings: {554 fontStyle: 'underline'555 }556 },557 {558 scope: 'markup.underline.link',559 settings: {560 foreground: colors.call561 }562 },563 {564 scope: [565 'markup.inserted',566 'markup.inserted punctuation.definition.inserted'567 ],568 settings: {569 foreground: colors.call570 }571 },572 {573 scope: [574 'markup.deleted',575 'markup.deleted punctuation.definition.deleted'576 ],577 settings: {578 foreground: colors.base1579 }580 },581 {582 scope: [583 'markup.changed',584 'markup.changed punctuation.definition.changed'585 ],586 settings: {587 foreground: colors.base1588 }589 },590 {591 scope: [592 'markup.ignored',593 'markup.ignored punctuation.definition.ignored'594 ],595 settings: {596 foreground: colors.dim3597 }598 },599 {600 scope: 'markup.untracked',601 settings: {602 foreground: colors.dim3603 }604 },605 {606 scope: 'markup.quote',607 settings: {608 fontStyle: 'italic'609 }610 },611 {612 scope: [613 'meta.brace.round',614 'meta.brace.square',615 'meta.brace.curly',616 'meta.delimiter.comma.js',617 'meta.function-call.without-arguments.js',618 'meta.function-call.method.without-arguments.js'619 ],620 settings: {621 foreground: colors.dim3622 }623 },624 {625 scope: [626 'meta.function-call',627 'meta.function-call.arguments meta.function-call'628 ],629 settings: {630 foreground: colors.call631 }632 },633 {634 scope: [635 'meta.function-call meta.function-call.arguments',636 'meta.function-call meta.arguments',637 'meta.function-call meta.group'638 ],639 settings: {640 foreground: colors.pure2641 }642 },643 {644 scope: 'meta.instance.constructor',645 settings: {646 foreground: colors.call647 }648 },649 {650 scope: 'meta.attribute-with-value.class string',651 settings: {652 foreground: colors.call653 }654 },655 {656 scope: 'meta.attribute-with-value.id string',657 settings: {658 foreground: colors.accent2659 }660 },661 {662 scope: [663 'source.json meta.structure.dictionary',664 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',665 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',666 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',667 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',668 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',669 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',670 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',671 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',672 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',673 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',674 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',675 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',676 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',677 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',678 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary',679 'source.json meta.structure.dictionary string',680 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',681 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',682 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',683 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',684 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',685 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',686 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',687 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',688 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',689 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',690 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',691 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',692 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',693 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string',694 'source.json meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary string'695 ],696 settings: {697 foreground: colors.pure2698 }699 },700 {701 scope: [702 'source.json meta.structure.dictionary.value string',703 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',704 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',705 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',706 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',707 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',708 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',709 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',710 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',711 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',712 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',713 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',714 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',715 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',716 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string',717 'source.json meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value meta.structure.dictionary meta.structure.dictionary.value string'718 ],719 settings: {720 foreground: colors.base1721 }722 },723 {724 scope: 'meta.object.member',725 settings: {726 foreground: colors.pure2727 }728 },729 {730 scope: 'meta.property-list.css variable.other',731 settings: {732 foreground: colors.accent2733 }734 },735 {736 scope: ['entity.name.constant.preprocessor', 'meta.preprocessor'],737 settings: {738 foreground: colors.const739 }740 },741 {742 scope: '\n\t\tmeta.diff.git-diff.header\n\t',743 settings: {744 foreground: colors.base1745 }746 },747 {748 scope: 'punctuation',749 settings: {750 foreground: colors.dim3751 }752 },753 {754 scope: [755 'punctuation.definition.tag',756 'punctuation.definition.tag source',757 'punctuation.definition.group.begin.ruby',758 'punctuation.definition.group.end.ruby'759 ],760 settings: {761 foreground: colors.dim3762 }763 },764 {765 scope: 'punctuation.definition.group',766 settings: {767 foreground: colors.pure2768 }769 },770 {771 scope: 'punctuation.definition.comment',772 settings: {773 foreground: colors.dim2774 }775 },776 {777 scope: [778 'punctuation.definition.variable',779 'punctuation.definition.keyword.scss',780 'punctuation.definition.entity.css'781 ],782 settings: {783 foreground: colors.dim4784 }785 },786 {787 scope: [788 'punctuation.section.embedded',789 'punctuation.section.embedded entity.name.tag',790 'punctuation.section.embedded constant.other',791 'punctuation.section.embedded source'792 ],793 settings: {794 foreground: colors.accent2795 }796 },797 {798 scope: [799 'punctuation.template-string.element.begin',800 'punctuation.template-string.element.end',801 'punctuation.definition.string.template.begin',802 'punctuation.definition.string.template.end',803 'string.quoted.template punctuation.definition.string.begin',804 'string.quoted.template punctuation.definition.string.end'805 ],806 settings: {807 foreground: colors.base1808 }809 },810 {811 scope: [812 'meta.paragraph.markdown meta.dummy.line-break',813 'meta.paragraph.markdown meta.hard-line-break.markdown'814 ],815 settings: {816 background: colors.const817 }818 },819 {820 scope: 'region.redish',821 settings: {822 foreground: colors.base1823 }824 },825 {826 scope: 'region.orangish',827 settings: {828 foreground: colors.accent2829 }830 },831 {832 scope: 'region.yellowish',833 settings: {834 foreground: colors.base2835 }836 },837 {838 scope: 'region.greenish',839 settings: {840 foreground: colors.call841 }842 },843 {844 scope: 'region.bluish',845 settings: {846 foreground: colors.accent1847 }848 },849 {850 scope: 'region.purplish',851 settings: {852 foreground: colors.const853 }854 },855 {856 scope: 'region.pinkish',857 settings: {858 foreground: colors.base1859 }860 },861 {862 scope: 'region.whitish',863 settings: {864 foreground: colors.pure1865 }866 },867 {868 scope: 'source',869 settings: {870 foreground: colors.pure2871 }872 },873 {874 scope: ['source.scss', 'source.sass'],875 settings: {876 foreground: colors.dim3877 }878 },879 {880 scope: [881 'source.sass variable.other',882 'source.sass variable.sass',883 'source.scss variable.other',884 'source.scss variable.scss',885 'source.scss variable.sass',886 'source.css variable.other',887 'source.css variable.scss',888 'source.less variable.other',889 'source.less variable.other.less',890 'source.less variable.declaration.less'891 ],892 settings: {893 fontStyle: 'italic',894 foreground: colors.accent2895 }896 },897 {898 scope: '\n\t\tsource.git-show.commit.sha\n\t',899 settings: {900 foreground: colors.const901 }902 },903 {904 scope: [905 'source.git-show.author',906 'source.git-show.date',907 'source.git-diff.command',908 'source.git-diff.command meta.diff.git-diff.header.from-file',909 'source.git-diff.command meta.diff.git-diff.header.to-file'910 ],911 settings: {912 foreground: colors.dim3913 }914 },915 {916 scope: [917 'source.git-show meta.diff.git-diff.header.extended.index.from-sha',918 'source.git-show meta.diff.git-diff.header.extended.index.to-sha'919 ],920 settings: {921 foreground: colors.const922 }923 },924 {925 scope: '\n\t\tsource.git-show meta.diff.range.unified\n\t',926 settings: {927 foreground: colors.accent2928 }929 },930 {931 scope: [932 'source.git-show meta.diff.header.from-file',933 'source.git-show meta.diff.header.to-file'934 ],935 settings: {936 foreground: colors.dim3937 }938 },939 {940 scope: 'storage',941 settings: {942 foreground: colors.base1943 }944 },945 {946 scope: 'storage.type',947 settings: {948 fontStyle: 'italic',949 foreground: colors.accent1950 }951 },952 {953 scope: 'storage.type.extends',954 settings: {955 fontStyle: 'normal',956 foreground: colors.base1957 }958 },959 {960 scope: 'storage.type.function.arrow',961 settings: {962 fontStyle: 'normal',963 foreground: colors.base1964 }965 },966 {967 scope: 'storage.modifier',968 settings: {969 fontStyle: 'italic',970 foreground: colors.base1971 }972 },973 {974 scope: 'storage.class.restructuredtext.ref',975 settings: {976 foreground: colors.const977 }978 },979 {980 scope: 'string',981 settings: {982 foreground: colors.base2983 }984 },985 {986 scope: 'string.unquoted.label',987 settings: {988 foreground: colors.pure2989 }990 },991 {992 scope: 'string source',993 settings: {994 foreground: colors.pure2995 }996 },997 {998 scope: 'string source punctuation.section.embedded',999 settings: {1000 foreground: colors.dim31001 }1002 },1003 {1004 scope: ['string.other.link.title', 'string.other.link.description'],1005 settings: {1006 foreground: colors.base11007 }1008 },1009 {1010 scope: 'string.other.link.description.title',1011 settings: {1012 foreground: colors.accent11013 }1014 },1015 {1016 scope: [1017 'string.regexp punctuation.definition.string.begin',1018 'string.regexp punctuation.definition.string.end'1019 ],1020 settings: {1021 foreground: colors.base11022 }1023 },1024 {1025 scope: ['string.other.ref', 'string.other.restructuredtext.ref'],1026 settings: {1027 foreground: colors.call1028 }1029 },1030 {1031 scope: '\n\t\tstring.other.git-status.help.key\n\t',1032 settings: {1033 foreground: colors.dim41034 }1035 },1036 {1037 scope: '\n\t\tstring.other.git-status.remote\n\t',1038 settings: {1039 foreground: colors.base11040 }1041 },1042 {1043 scope: 'support.constant',1044 settings: {1045 foreground: colors.accent11046 }1047 },1048 {1049 scope: 'support.constant.handlebars',1050 settings: {1051 foreground: colors.dim31052 }1053 },1054 {1055 scope: 'support.function',1056 settings: {1057 foreground: colors.call1058 }1059 },1060 {1061 scope: ['support.type', 'entity.name.type.object.console'],1062 settings: {1063 fontStyle: 'italic',1064 foreground: colors.accent11065 }1066 },1067 {1068 scope: 'support.variable',1069 settings: {1070 foreground: colors.accent11071 }1072 },1073 {1074 scope: 'support.type.property-name',1075 settings: {1076 fontStyle: 'normal',1077 foreground: colors.pure21078 }1079 },1080 {1081 scope: 'support.class',1082 settings: {1083 foreground: colors.accent11084 }1085 },1086 {1087 scope: 'text',1088 settings: {1089 foreground: colors.pure21090 }1091 },1092 {1093 scope: 'text.find-in-files',1094 settings: {1095 foreground: colors.pure21096 }1097 },1098 {1099 scope: ['variable', 'variable.other'],1100 settings: {1101 foreground: colors.pure21102 }1103 },1104 {1105 scope: ['variable.parameter', 'parameters variable.function'],1106 settings: {1107 fontStyle: 'italic',1108 foreground: colors.accent21109 }1110 },1111 {1112 scope: [1113 'variable.language',1114 'variable.parameter.function.language.special.self.python'1115 ],1116 settings: {1117 fontStyle: 'italic',1118 foreground: colors.dim41119 }1120 },1121 {1122 scope: 'variable.language.arguments',1123 settings: {1124 foreground: colors.const1125 }1126 },1127 {1128 scope: 'variable.other.class',1129 settings: {1130 foreground: colors.accent11131 }1132 },1133 {1134 scope: 'variable.other.constant',1135 settings: {1136 foreground: colors.const1137 }1138 },1139 {1140 scope: 'variable.other.member',1141 settings: {1142 foreground: colors.pure21143 }1144 },1145 {1146 scope: 'variable.function',1147 settings: {1148 foreground: colors.call1149 }1150 },1151 {1152 scope: 'variable.other.substitution',1153 settings: {1154 foreground: colors.accent21155 }1156 },1157 {1158 scope: [1159 'source.ruby variable.other.readwrite.instance.ruby',1160 'source.ruby variable.other.readwrite.class.ruby'1161 ],1162 settings: {1163 foreground: colors.const1164 }1165 }1166 ]...

Full Screen

Full Screen

meta_graph_test.py

Source:meta_graph_test.py Github

copy

Full Screen

1# Copyright 2016 The TensorFlow Authors. All Rights Reserved.2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# See the License for the specific language governing permissions and13# limitations under the License.14# =============================================================================15"""Tests for tensorflow.python.framework.meta_graph.py."""16from __future__ import absolute_import17from __future__ import division18from __future__ import print_function19import math20import os.path21import random22import shutil23import tensorflow as tf24from tensorflow.core.framework import graph_pb225from tensorflow.python.framework import function26from tensorflow.python.framework import meta_graph27from tensorflow.python.ops import control_flow_ops28from tensorflow.python.platform import gfile29# pylint: disable=invalid-name30def _TestDir(test_name):31 test_dir = os.path.join(tf.test.get_temp_dir(), test_name)32 if os.path.exists(test_dir):33 shutil.rmtree(test_dir)34 gfile.MakeDirs(test_dir)35 return test_dir36# pylint: enable=invalid-name37class SimpleMetaGraphTest(tf.test.TestCase):38 def testNoVariables(self):39 test_dir = _TestDir("no_variables")40 filename = os.path.join(test_dir, "metafile")41 input_feed_value = -10 # Arbitrary input value for feed_dict.42 orig_graph = tf.Graph()43 with self.test_session(graph=orig_graph) as sess:44 # Create a minimal graph with zero variables.45 input_tensor = tf.placeholder(tf.float32, shape=[], name="input")46 offset = tf.constant(42, dtype=tf.float32, name="offset")47 output_tensor = tf.add(input_tensor, offset, name="add_offset")48 # Add input and output tensors to graph collections.49 tf.add_to_collection("input_tensor", input_tensor)50 tf.add_to_collection("output_tensor", output_tensor)51 output_value = sess.run(output_tensor, {input_tensor: input_feed_value})52 self.assertEqual(output_value, 32)53 # Generates MetaGraphDef.54 meta_graph_def, var_list = meta_graph.export_scoped_meta_graph(55 filename=filename,56 graph_def=tf.get_default_graph().as_graph_def(add_shapes=True),57 collection_list=["input_tensor", "output_tensor"],58 saver_def=None)59 self.assertEqual({}, var_list)60 # Create a clean graph and import the MetaGraphDef nodes.61 new_graph = tf.Graph()62 with self.test_session(graph=new_graph) as sess:63 # Import the previously export meta graph.64 meta_graph.import_scoped_meta_graph(filename)65 # Re-exports the current graph state for comparison to the original.66 new_meta_graph_def, _ = meta_graph.export_scoped_meta_graph(67 filename + "_new")68 self.assertProtoEquals(meta_graph_def, new_meta_graph_def)69 # Ensures that we can still get a reference to our graph collections.70 new_input_tensor = tf.get_collection("input_tensor")[0]71 new_output_tensor = tf.get_collection("output_tensor")[0]72 # Verifies that the new graph computes the same result as the original.73 new_output_value = sess.run(74 new_output_tensor, {new_input_tensor: input_feed_value})75 self.assertEqual(new_output_value, output_value)76 def testStrippedOpListNestedFunctions(self):77 with self.test_session():78 # Square two levels deep79 @function.Defun(tf.int32)80 def f0(x):81 return tf.square(x)82 @function.Defun(tf.int32)83 def f1(x):84 return f0(x)85 # At this point we've defined two functions but haven't called them, so86 # there should be no used ops.87 op_list = tf.contrib.util.stripped_op_list_for_graph(88 tf.get_default_graph().as_graph_def())89 self.assertEqual(len(op_list.op), 0)90 # If we call the function on a constant, there should be two ops91 _ = f1(tf.constant(7))92 op_list = tf.contrib.util.stripped_op_list_for_graph(93 tf.get_default_graph().as_graph_def())94 self.assertEqual(["Const", "Square"], [op.name for op in op_list.op])95 def testStrippedOpListRecursiveFunctions(self):96 # The function module doesn't support recursive functions, so we build a97 # recursive function situation by ourselves: A calls B calls A and Const.98 graph = graph_pb2.GraphDef()99 a = graph.library.function.add()100 b = graph.library.function.add()101 a.signature.name = "A"102 b.signature.name = "B"103 a.node.add().op = "B"104 b.node.add().op = "Const"105 b.node.add().op = "A"106 # Use A in the graph107 graph.node.add().op = "A"108 # The stripped op list should contain just Const.109 op_list = tf.contrib.util.stripped_op_list_for_graph(graph)110 self.assertEqual(["Const"], [op.name for op in op_list.op])111class ScopedMetaGraphTest(tf.test.TestCase):112 def _testScopedExport(self, test_dir, exported_filenames):113 graph = tf.Graph()114 with graph.as_default():115 # Creates an inference graph.116 # Hidden 1117 colocate_constraint = tf.constant(1.2, name="constraint")118 images = tf.constant(1.2, tf.float32, shape=[100, 28], name="images")119 with tf.name_scope("hidden1"):120 with graph.colocate_with(colocate_constraint.op):121 weights1 = tf.Variable(122 tf.truncated_normal([28, 128],123 stddev=1.0 / math.sqrt(float(28))),124 name="weights")125 # The use of control_flow_ops.cond here is purely for adding test126 # coverage the save and restore of control flow context (which doesn't127 # make any sense here from a machine learning perspective). The typical128 # biases is a simple Variable without the conditions.129 biases1 = tf.Variable(130 control_flow_ops.cond(tf.less(random.random(), 0.5),131 lambda: tf.ones([128]),132 lambda: tf.zeros([128])),133 name="biases")134 hidden1 = tf.nn.relu(tf.matmul(images, weights1) + biases1)135 # Hidden 2136 with tf.name_scope("hidden2"):137 weights2 = tf.Variable(138 tf.truncated_normal([128, 32],139 stddev=1.0 / math.sqrt(float(128))),140 name="weights")141 # The use of control_flow_ops.while_loop here is purely for adding test142 # coverage the save and restore of control flow context (which doesn't143 # make any sense here from a machine learning perspective). The typical144 # biases is a simple Variable without the conditions.145 def loop_cond(it, _):146 return it < 2147 def loop_body(it, biases2):148 biases2 += tf.constant(0.1, shape=[32])149 return it + 1, biases2150 _, biases2 = control_flow_ops.while_loop(151 loop_cond, loop_body,152 [tf.constant(0), tf.Variable(tf.zeros([32]), name="biases")])153 hidden2 = tf.nn.relu(tf.matmul(hidden1, weights2) + biases2)154 # Linear155 with tf.name_scope("softmax_linear"):156 weights3 = tf.Variable(157 tf.truncated_normal([32, 10],158 stddev=1.0 / math.sqrt(float(32))),159 name="weights")160 biases3 = tf.Variable(tf.zeros([10]), name="biases")161 logits = tf.matmul(hidden2, weights3) + biases3162 tf.add_to_collection("logits", logits)163 # Exports each sub-graph.164 # Exports the first one with unbound_inputs_col_name set to default.165 orig_meta_graph1, var_list = meta_graph.export_scoped_meta_graph(166 filename=os.path.join(test_dir, exported_filenames[0]),167 graph=tf.get_default_graph(), export_scope="hidden1")168 self.assertEqual(["biases:0", "weights:0"], sorted(var_list.keys()))169 var_names = [v.name for _, v in var_list.items()]170 self.assertEqual(["hidden1/biases:0", "hidden1/weights:0"],171 sorted(var_names))172 # Exports the rest with no unbound_inputs_col_name.173 orig_meta_graph2, _ = meta_graph.export_scoped_meta_graph(174 filename=os.path.join(test_dir, exported_filenames[1]),175 graph=tf.get_default_graph(), export_scope="hidden2",176 unbound_inputs_col_name=None)177 orig_meta_graph3, _ = meta_graph.export_scoped_meta_graph(178 filename=os.path.join(test_dir, exported_filenames[2]),179 graph=tf.get_default_graph(), export_scope="softmax_linear",180 unbound_inputs_col_name=None)181 return [orig_meta_graph1, orig_meta_graph2, orig_meta_graph3]182 def _testScopedImport(self, test_dir, exported_filenames):183 graph = tf.Graph()184 # Create all the missing inputs.185 with graph.as_default():186 new_image = tf.constant(1.2, tf.float32, shape=[100, 28],187 name="images")188 with self.assertRaisesRegexp(ValueError, "Graph contains unbound inputs"):189 meta_graph.import_scoped_meta_graph(190 os.path.join(test_dir, exported_filenames[0]), graph=graph,191 import_scope="new_hidden1")192 with self.assertRaisesRegexp(ValueError, "Graph contains unbound inputs"):193 meta_graph.import_scoped_meta_graph(194 os.path.join(test_dir, exported_filenames[0]), graph=graph,195 input_map={"image:0": new_image},196 import_scope="new_hidden1")197 # Verifies we can import the original "hidden1" into "new_hidden1".198 var_list = meta_graph.import_scoped_meta_graph(199 os.path.join(test_dir, exported_filenames[0]), graph=graph,200 input_map={"$unbound_inputs_images": new_image},201 import_scope="new_hidden1")202 self.assertEqual(["biases:0", "weights:0"], sorted(var_list.keys()))203 new_var_names = [v.name for _, v in var_list.items()]204 self.assertEqual(["new_hidden1/biases:0", "new_hidden1/weights:0"],205 sorted(new_var_names))206 # Verifies we can import the original "hidden2" into "new_hidden2".207 hidden1 = tf.identity(graph.as_graph_element("new_hidden1/Relu:0"),208 name="hidden1/Relu")209 var_list = meta_graph.import_scoped_meta_graph(210 os.path.join(test_dir, exported_filenames[1]), graph=graph,211 input_map={"$unbound_inputs_hidden1/Relu": hidden1},212 import_scope="new_hidden2", unbound_inputs_col_name=None)213 self.assertEqual(["biases:0", "weights:0"], sorted(var_list.keys()))214 new_var_names = [v.name for _, v in var_list.items()]215 self.assertEqual(["new_hidden2/biases:0", "new_hidden2/weights:0"],216 sorted(new_var_names))217 # Verifies we can import the original "softmax_linear" into218 # "new_softmax_linear".219 hidden2 = tf.identity(graph.as_graph_element("new_hidden2/Relu:0"),220 name="hidden2/Relu")221 var_list = meta_graph.import_scoped_meta_graph(222 os.path.join(test_dir, exported_filenames[2]), graph=graph,223 input_map={"$unbound_inputs_hidden2/Relu": hidden2},224 import_scope="new_softmax_linear", unbound_inputs_col_name=None)225 self.assertEqual(["biases:0", "weights:0"], sorted(var_list.keys()))226 new_var_names = [v.name for _, v in var_list.items()]227 self.assertEqual(["new_softmax_linear/biases:0",228 "new_softmax_linear/weights:0"],229 sorted(new_var_names))230 # Exports the scoped meta graphs again.231 new_meta_graph1, var_list = meta_graph.export_scoped_meta_graph(232 graph=graph, export_scope="new_hidden1")233 self.assertEqual(["biases:0", "weights:0"], sorted(var_list.keys()))234 new_meta_graph2, var_list = meta_graph.export_scoped_meta_graph(235 graph=graph, export_scope="new_hidden2",236 unbound_inputs_col_name=None)237 self.assertEqual(["biases:0", "weights:0"], sorted(var_list.keys()))238 new_meta_graph3, var_list = meta_graph.export_scoped_meta_graph(239 graph=graph, export_scope="new_softmax_linear",240 unbound_inputs_col_name=None)241 self.assertEqual(["biases:0", "weights:0"], sorted(var_list.keys()))242 return [new_meta_graph1, new_meta_graph2, new_meta_graph3]243 # Verifies that we can export the subgraph under each layer and import244 # them into new layers in a new graph.245 def testScopedExportAndImport(self):246 test_dir = _TestDir("scoped_export_import")247 filenames = ["exported_hidden1.pbtxt", "exported_hidden2.pbtxt",248 "exported_softmax_linear.pbtxt"]249 orig_meta_graphs = self._testScopedExport(test_dir, filenames)250 new_meta_graphs = self._testScopedImport(test_dir, filenames)251 # Delete the unbound_inputs to allow directly calling ProtoEqual.252 del orig_meta_graphs[0].collection_def["unbound_inputs"]253 del new_meta_graphs[0].collection_def["unbound_inputs"]254 for a, b in zip(orig_meta_graphs, new_meta_graphs):255 self.assertProtoEquals(a, b)256 def _testScopedExportWithQueue(self, test_dir, exported_filename):257 graph = tf.Graph()258 with graph.as_default():259 with tf.name_scope("queue1"):260 input_queue = tf.FIFOQueue(10, tf.float32)261 enqueue = input_queue.enqueue((9876), name="enqueue")262 close = input_queue.close(name="close")263 qr = tf.train.QueueRunner(input_queue, [enqueue], close)264 tf.train.add_queue_runner(qr)265 input_queue.dequeue(name="dequeue")266 orig_meta_graph, _ = meta_graph.export_scoped_meta_graph(267 filename=os.path.join(test_dir, exported_filename),268 graph=tf.get_default_graph(), export_scope="queue1")269 return orig_meta_graph270 def _testScopedImportWithQueue(self, test_dir, exported_filename,271 new_exported_filename):272 graph = tf.Graph()273 meta_graph.import_scoped_meta_graph(274 os.path.join(test_dir, exported_filename),275 graph=graph,276 import_scope="new_queue1")277 graph.as_graph_element("new_queue1/dequeue:0")278 graph.as_graph_element("new_queue1/close")279 with graph.as_default():280 new_meta_graph, _ = meta_graph.export_scoped_meta_graph(281 filename=os.path.join(test_dir, new_exported_filename),282 graph=graph, export_scope="new_queue1")283 return new_meta_graph284 # Verifies that we can export the subgraph containing a FIFOQueue under285 # "queue1" and import it into "new_queue1" in a new graph.286 def testScopedWithQueue(self):287 test_dir = _TestDir("scoped_with_queue")288 orig_meta_graph = self._testScopedExportWithQueue(289 test_dir, "exported_queue1.pbtxt")290 new_meta_graph = self._testScopedImportWithQueue(291 test_dir, "exported_queue1.pbtxt", "exported_new_queue1.pbtxt")292 self.assertProtoEquals(orig_meta_graph, new_meta_graph)293 # Verifies that we can export a subgraph in a nested name scope containing a294 # "hidden1/hidden2" and import it into "new_hidden1/new_hidden2" in a new295 # graph.296 def testExportNestedNames(self):297 graph1 = tf.Graph()298 with graph1.as_default():299 with tf.name_scope("hidden1/hidden2/hidden3"):300 images = tf.constant(1.0, tf.float32, shape=[3, 2], name="images")301 weights1 = tf.Variable([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],302 name="weights")303 biases1 = tf.Variable([0.1] * 3, name="biases")304 tf.nn.relu(tf.matmul(images, weights1) + biases1, name="relu")305 orig_meta_graph, var_list = meta_graph.export_scoped_meta_graph(306 export_scope="hidden1/hidden2", graph=graph1)307 var_names = [v.name for _, v in var_list.items()]308 self.assertEqual(["hidden3/biases:0", "hidden3/weights:0"],309 sorted(var_list.keys()))310 self.assertEqual(["hidden1/hidden2/hidden3/biases:0",311 "hidden1/hidden2/hidden3/weights:0"],312 sorted(var_names))313 for node in orig_meta_graph.graph_def.node:314 self.assertTrue(node.name.startswith("hidden3"))315 graph2 = tf.Graph()316 new_var_list = meta_graph.import_scoped_meta_graph(317 orig_meta_graph, import_scope="new_hidden1/new_hidden2",318 graph=graph2)319 self.assertEqual(["hidden3/biases:0", "hidden3/weights:0"],320 sorted(new_var_list.keys()))321 new_var_names = [v.name for _, v in new_var_list.items()]322 self.assertEqual(["new_hidden1/new_hidden2/hidden3/biases:0",323 "new_hidden1/new_hidden2/hidden3/weights:0"],324 sorted(new_var_names))325 nodes = ["new_hidden1/new_hidden2/hidden3/biases/Assign",326 "new_hidden1/new_hidden2/hidden3/weights/Assign"]327 expected = [b"loc:@new_hidden1/new_hidden2/hidden3/biases",328 b"loc:@new_hidden1/new_hidden2/hidden3/weights"]329 for n, e in zip(nodes, expected):330 self.assertEqual([e], graph2.get_operation_by_name(n).get_attr("_class"))331 def testPotentialCycle(self):332 graph1 = tf.Graph()333 with graph1.as_default():334 a = tf.constant(1.0, shape=[2, 2])335 b = tf.constant(2.0, shape=[2, 2])336 matmul = tf.matmul(a, b)337 with tf.name_scope("hidden1"):338 c = tf.nn.relu(matmul)339 d = tf.constant(3.0, shape=[2, 2])340 matmul = tf.matmul(c, d)341 orig_meta_graph, _ = meta_graph.export_scoped_meta_graph(342 export_scope="hidden1", graph=graph1)343 graph2 = tf.Graph()344 with graph2.as_default():345 with self.assertRaisesRegexp(ValueError, "Graph contains unbound inputs"):346 meta_graph.import_scoped_meta_graph(347 orig_meta_graph, import_scope="new_hidden1")348 meta_graph.import_scoped_meta_graph(349 orig_meta_graph, import_scope="new_hidden1",350 input_map={"$unbound_inputs_MatMul": tf.constant(4.0, shape=[2, 2])})351 def testClearDevices(self):352 graph1 = tf.Graph()353 with graph1.as_default():354 with tf.device("/device:CPU:0"):355 a = tf.Variable(tf.constant(1.0, shape=[2, 2]), name="a")356 with tf.device("/job:ps/replica:0/task:0/gpu:0"):357 b = tf.Variable(tf.constant(2.0, shape=[2, 2]), name="b")358 with tf.device("/job:localhost/replica:0/task:0/cpu:0"):359 tf.matmul(a, b, name="matmul")360 self.assertEqual("/device:CPU:0", str(graph1.as_graph_element("a").device))361 self.assertEqual("/job:ps/replica:0/task:0/device:GPU:0",362 str(graph1.as_graph_element("b").device))363 self.assertEqual("/job:localhost/replica:0/task:0/device:CPU:0",364 str(graph1.as_graph_element("matmul").device))365 # Verifies that devices are cleared on export.366 orig_meta_graph, _ = meta_graph.export_scoped_meta_graph(367 graph=graph1, clear_devices=True)368 graph2 = tf.Graph()369 with graph2.as_default():370 meta_graph.import_scoped_meta_graph(orig_meta_graph, clear_devices=False)371 self.assertEqual("", str(graph2.as_graph_element("a").device))372 self.assertEqual("", str(graph2.as_graph_element("b").device))373 self.assertEqual("", str(graph2.as_graph_element("matmul").device))374 # Verifies that devices are cleared on export when passing in graph_def.375 orig_meta_graph, _ = meta_graph.export_scoped_meta_graph(376 graph_def=graph1.as_graph_def(), clear_devices=True)377 graph2 = tf.Graph()378 with graph2.as_default():379 meta_graph.import_scoped_meta_graph(orig_meta_graph, clear_devices=False)380 self.assertEqual("", str(graph2.as_graph_element("a").device))381 self.assertEqual("", str(graph2.as_graph_element("b").device))382 self.assertEqual("", str(graph2.as_graph_element("matmul").device))383 # Verifies that devices are cleared on import.384 orig_meta_graph, _ = meta_graph.export_scoped_meta_graph(385 graph=graph1, clear_devices=False)386 graph2 = tf.Graph()387 with graph2.as_default():388 meta_graph.import_scoped_meta_graph(orig_meta_graph, clear_devices=True)389 self.assertEqual("", str(graph2.as_graph_element("a").device))390 self.assertEqual("", str(graph2.as_graph_element("b").device))391 self.assertEqual("", str(graph2.as_graph_element("matmul").device))392if __name__ == "__main__":...

Full Screen

Full Screen

ghost_head.js

Source:ghost_head.js Github

copy

Full Screen

1// # Ghost Head Helper2// Usage: `{{ghost_head}}`3//4// Outputs scripts and other assets at the top of a Ghost theme5//6// We use the name ghost_head to match the helper for consistency:7// jscs:disable requireCamelCaseOrUpperCaseIdentifiers8var hbs = require('express-hbs'),9 moment = require('moment'),10 _ = require('lodash'),11 Promise = require('bluebird'),12 config = require('../config'),13 filters = require('../filters'),14 api = require('../api'),15 urlHelper = require('./url'),16 meta_description = require('./meta_description'),17 meta_title = require('./meta_title'),18 excerpt = require('./excerpt'),19 tagsHelper = require('./tags'),20 imageHelper = require('./image'),21 blog,22 ghost_head;23function getImage(ops, context, contextObject) {24 if (context === 'home' || context === 'author') {25 contextObject.image = contextObject.cover;26 }27 ops.push(imageHelper.call(contextObject, {hash: {absolute: true}}));28 if (context === 'post' && contextObject.author) {29 ops.push(imageHelper.call(contextObject.author, {hash: {absolute: true}}));30 }31 return ops;32}33function getPaginationUrls(pagination, relativeUrl, secure, head) {34 var trimmedUrl, next, prev,35 trimmedUrlpattern = /.+(?=\/page\/\d*\/)/,36 tagOrAuthorPattern = /\/(tag)|(author)\//;37 trimmedUrl = relativeUrl.match(trimmedUrlpattern);38 if (pagination.prev) {39 prev = (pagination.prev > 1 ? '/page/' + pagination.prev + '/' : '/');40 prev = (trimmedUrl) ? trimmedUrl + prev : prev;41 head.push('<link rel="prev" href="' +42 config.urlFor({relativeUrl: prev, secure: secure}, true) + '" />'43 );44 }45 if (pagination.next) {46 next = '/page/' + pagination.next + '/';47 if (trimmedUrl) {48 next = trimmedUrl + next;49 } else if (tagOrAuthorPattern.test(relativeUrl)) {50 next = relativeUrl.slice(0, -1) + next;51 }52 head.push('<link rel="next" href="' +53 config.urlFor({relativeUrl: next, secure: secure}, true) + '" />'54 );55 }56 return head;57}58function addContextMetaData(context, data, metaData) {59 // escaped data60 metaData.metaTitle = hbs.handlebars.Utils.escapeExpression(metaData.metaTitle);61 metaData.metaDescription = metaData.metaDescription ? hbs.handlebars.Utils.escapeExpression(metaData.metaDescription) : null;62 if (context === 'author') {63 metaData.authorUrl = hbs.handlebars.Utils.escapeExpression(blog.url + '/author/' + data.author.slug);64 metaData.ogType = 'profile';65 } else if (context === 'post') {66 metaData.publishedDate = moment(data.post.published_at).toISOString();67 metaData.modifiedDate = moment(data.post.updated_at).toISOString();68 metaData.authorUrl = hbs.handlebars.Utils.escapeExpression(blog.url + '/author/' + data.post.author.slug);69 metaData.ogType = 'article';70 }71 return metaData;72}73function initMetaData(context, data, results) {74 var metaData = {75 url: results[0].value(),76 metaDescription: results[1].value() || null,77 metaTitle: results[2].value(),78 coverImage: results.length > 3 ? results[3].value() : null,79 authorImage: results.length > 4 ? results[4].value() : null,80 publishedDate: null,81 modifiedDate: null,82 tags: null,83 card: 'summary',84 authorUrl: null,85 ogType: 'website',86 keywords: null,87 blog: blog,88 title: blog.title89 };90 if (!metaData.metaDescription) {91 if (context === 'post') {92 metaData.metaDescription = excerpt.call(data.post, {hash: {words: '40'}}).string + '...';93 } else if (context === 'tag') {94 metaData.metaDescription = data.tag.description ? data.tag.description : null;95 }96 }97 return addContextMetaData(context, data, metaData);98}99function getStructuredData(metaData) {100 var structuredData;101 if (metaData.coverImage) {102 metaData.card = 'summary_large_image';103 }104 structuredData = {105 'og:site_name': metaData.title,106 'og:type': metaData.ogType,107 'og:title': metaData.metaTitle,108 'og:description': metaData.metaDescription,109 'og:url': metaData.url,110 'og:image': metaData.coverImage,111 'article:published_time': metaData.publishedDate,112 'article:modified_time': metaData.modifiedDate,113 'article:tag': metaData.tags,114 'twitter:card': metaData.card,115 'twitter:title': metaData.metaTitle,116 'twitter:description': metaData.metaDescription,117 'twitter:url': metaData.url,118 'twitter:image:src': metaData.coverImage119 };120 return structuredData;121}122// Creates the final schema object with values that are not null123function trimSchema(schema) {124 var schemaObject = {};125 _.each(schema, function (value, key) {126 if (value !== null && value !== undefined) {127 schemaObject[key] = value;128 }129 });130 return schemaObject;131}132function getPostSchema(metaData, data) {133 var schema = {134 '@context': 'http://schema.org',135 '@type': 'Article',136 publisher: metaData.title,137 author: {138 '@type': 'Person',139 name: data.post.author.name,140 image: metaData.authorImage,141 url: metaData.authorUrl,142 sameAs: data.post.author.website || null,143 description: data.post.author.bio || null144 },145 headline: metaData.metaTitle,146 url: metaData.url,147 datePublished: metaData.publishedDate,148 dateModified: metaData.modifiedDate,149 image: metaData.coverImage,150 keywords: metaData.keywords,151 description: metaData.metaDescription152 };153 return trimSchema(schema);154}155function getTagSchema(metaData, data) {156 var schema = {157 '@context': 'http://schema.org',158 '@type': 'Series',159 publisher: metaData.title,160 url: metaData.url,161 image: metaData.coverImage,162 name: data.tag.name,163 description: metaData.metaDescription164 };165 return trimSchema(schema);166}167function getAuthorSchema(metaData, data) {168 var schema = {169 '@context': 'http://schema.org',170 '@type': 'Person',171 sameAs: data.author.website || null,172 publisher: metaData.title,173 name: data.author.name,174 url: metaData.authorUrl,175 image: metaData.coverImage,176 description: metaData.metaDescription177 };178 return trimSchema(schema);179}180function getHomeSchema(metaData) {181 var schema = {182 '@context': 'http://schema.org',183 '@type': 'Website',184 publisher: metaData.title,185 url: metaData.url,186 image: metaData.coverImage,187 description: metaData.metaDescription188 };189 return trimSchema(schema);190}191function chooseSchema(metaData, context, data) {192 if (context === 'post') {193 return getPostSchema(metaData, data);194 } else if (context === 'home') {195 return getHomeSchema(metaData);196 } else if (context === 'tag') {197 return getTagSchema(metaData, data);198 } else if (context === 'author') {199 return getAuthorSchema(metaData, data);200 }201}202function finaliseStructuredData(structuredData, tags, head) {203 var type;204 _.each(structuredData, function (content, property) {205 if (property === 'article:tag') {206 _.each(tags, function (tag) {207 if (tag !== '') {208 tag = hbs.handlebars.Utils.escapeExpression(tag.trim());209 head.push('<meta property="' + property + '" content="' + tag + '" />');210 }211 });212 head.push('');213 } else if (content !== null && content !== undefined) {214 type = property.substring(0, 7) === 'twitter' ? 'name' : 'property';215 head.push('<meta ' + type + '="' + property + '" content="' + content + '" />');216 }217 });218 return head;219}220function finaliseSchema(schema, head) {221 head.push('<script type="application/ld+json">\n' + JSON.stringify(schema, null, ' ') +222 '\n </script>\n'223 );224 return head;225}226ghost_head = function (options) {227 // create a shortcut for theme config228 blog = config.theme;229 /*jshint unused:false*/230 var self = this,231 useStructuredData = !config.isPrivacyDisabled('useStructuredData'),232 head = [],233 safeVersion = this.safeVersion,234 ops = [],235 structuredData,236 schema,237 title = hbs.handlebars.Utils.escapeExpression(blog.title),238 context = self.context ? self.context[0] : null,239 contextObject = self[context] || blog;240 // Push Async calls to an array of promises241 ops.push(urlHelper.call(self, {hash: {absolute: true}}));242 ops.push(meta_description.call(self, options));243 ops.push(meta_title.call(self, options));244 ops = getImage(ops, context, contextObject);245 // Resolves promises then push pushes meta data into ghost_head246 return Promise.settle(ops).then(function (results) {247 if (context) {248 var metaData = initMetaData(context, self, results),249 tags = tagsHelper.call(self.post, {hash: {autolink: 'false'}}).string.split(',');250 // If there are tags - build the keywords metaData string251 if (tags[0] !== '') {252 metaData.keywords = hbs.handlebars.Utils.escapeExpression(tagsHelper.call(self.post,253 {hash: {autolink: 'false', separator: ', '}}254 ).string);255 }256 // head is our main array that holds our meta data257 head.push('<link rel="canonical" href="' + metaData.url + '" />');258 head.push('<meta name="referrer" content="origin" />');259 // Generate context driven pagination urls260 if (self.pagination) {261 getPaginationUrls(self.pagination, self.relativeUrl, self.secure, head);262 }263 // Test to see if we are on a post page and that Structured data has not been disabled in config.js264 if (context !== 'paged' && context !== 'page' && useStructuredData) {265 // Create context driven OpenGraph and Twitter meta data266 structuredData = getStructuredData(metaData);267 // Create context driven JSONLD object268 schema = chooseSchema(metaData, context, self);269 head.push('');270 // Formats structured data and pushes to head array271 finaliseStructuredData(structuredData, tags, head);272 head.push('');273 // Formats schema script/JSONLD data and pushes to head array274 finaliseSchema(schema, head);275 }276 }277 head.push('<meta name="generator" content="Ghost ' + safeVersion + '" />');278 head.push('<link rel="alternate" type="application/rss+xml" title="' +279 title + '" href="' + config.urlFor('rss', null, true) + '" />');280 }).then(function () {281 return api.settings.read({key: 'ghost_head'});282 }).then(function (response) {283 head.push(response.settings[0].value);284 return filters.doFilter('ghost_head', head);285 }).then(function (head) {286 var headString = _.reduce(head, function (memo, item) { return memo + '\n ' + item; }, '');287 return new hbs.handlebars.SafeString(headString.trim());288 });289};...

Full Screen

Full Screen

test_schema.py

Source:test_schema.py Github

copy

Full Screen

...19 'i_3001a.ntf')20 cls._meta = geoutils.Metadata()21 nitf = geoutils.NITF(source_filename=cls._file)22 nitf.open()23 cls._meta.extract_meta(dataset=nitf.dataset)24 def setUp(self):25 self._schema = geoutils.Schema()26 def test_init(self):27 """Initialise a geoutils.Schema object.28 """29 msg = 'Object is not a geoutils.Schema'30 self.assertIsInstance(self._schema, geoutils.Schema, msg)31 def test_callable(self):32 """Invoke the geoutils.Schema object instance.33 """34 self._schema.source_id = 'i_3001a'35 self._schema.shard_id = 's01'36 received = self._schema()37 expected = {'row_id': 'i_3001a',38 'shard_id': 's01',39 'tables': {}}40 msg = 'geoutils.Schema callable error'41 self.assertDictEqual(received, expected, msg)42 def test_build_meta_data_structure(self):43 """Build the metadata ingest data structure.44 """45 self._schema.build_meta('meta_library', self._meta)46 received = self._schema.data['tables']['meta_library']['cf']47 expected = SCHEMA_DATA_01['tables']['meta_library']['cf']48 msg = 'Metadata data structure result error'49 self.assertDictEqual(received, expected, msg)50 def test_build_meta_data_structure_missing_geogcs(self):51 """Build the metadata ingest data structure: missing GEOGCS.52 """53 file_no_geogcs = os.path.join('geoutils',54 'tests',55 'files',56 'i_6130e.ntf')57 nitf = geoutils.NITF(source_filename=file_no_geogcs)58 nitf.open()59 meta = geoutils.Metadata()60 meta.extract_meta(dataset=nitf.dataset)61 self._schema.build_meta('meta_library', meta)62 received = self._schema.data['tables']['meta_library']['cf']63 expected = SCHEMA_DATA_02['tables']['meta_library']['cf']64 msg = 'Metadata data structure result error'65 self.assertDictEqual(received, expected, msg)66 def test_build_document_map(self):67 """Build a document map.68 """69 meta_dict = SCHEMA_DATA_01['tables']['meta_library']['cf']['cq']70 received = self._schema.build_document_map(meta_dict)71 expected = ['00000',72 '1024x1024',73 '19961217102630',74 '19971217102630',75 '5458',...

Full Screen

Full Screen

test_metadata.py

Source:test_metadata.py Github

copy

Full Screen

1# pylint: disable=R0904,C01032""":class:`geoutils.model.Metadata` tests.3"""4import unittest25import os6import geoutils7import geolib_mock8from geoutils.tests.files.ingest_data_01 import DATA as DATA_019from geoutils.tests.files.ingest_data_02 import DATA as DATA_0210class TestModelMetadata(unittest2.TestCase):11 """:class:`geoutils.model.Metadata` test cases.12 """13 @classmethod14 def setUpClass(cls):15 """Attempt to start the Accumulo mock proxy server.16 """17 cls.maxDiff = None18 conf = os.path.join('geoutils',19 'tests',20 'files',21 'proxy.properties')22 cls._mock = geolib_mock.MockServer(conf)23 cls._mock.start()24 cls._meta_table_name = 'meta_library'25 cls._image_spatial_index_table_name = 'image_spatial_index'26 def setUp(self):27 self._ds = geoutils.Datastore()28 self._meta = geoutils.model.Metadata(connection=self._ds.connect(),29 name=self._meta_table_name)30 self._meta.coord_cols = [['coord=0'],31 ['coord=1'],32 ['coord=2'],33 ['coord=3']]34 def test_init(self):35 """Initialise a :class:`geoutils.model.Metadata` object.36 """37 msg = 'Object is not a geoutils.model.Metadata'38 self.assertIsInstance(self._meta, geoutils.model.Metadata, msg)39 def test_name(self):40 """Check the default table name.41 """42 msg = 'Default table name error'43 self.assertEqual(self._meta.name, 'meta_library', msg)44 def test_query_metadata_no_data(self):45 """Query the metadata component from an empty datastore.46 """47 self._ds.init_table(self._meta_table_name)48 received = self._meta.query_metadata(key='i_3001a')49 expected = {}50 msg = 'Scan across empty table should return 0 cells'51 self.assertDictEqual(received, expected, msg)52 # Clean up.53 self._ds.delete_table(self._meta_table_name)54 def test_query_metadata_with_data(self):55 """Attempt to query the metadata component from the datastore.56 """57 self._ds.init_table(self._meta_table_name)58 self._ds.ingest(DATA_01)59 received = self._meta.query_metadata(key='i_3001a')60 from geoutils.tests.results.meta_01 import META61 expected = META62 msg = 'Scan across table should return cells'63 self.assertDictEqual(received, expected, msg)64 # Clean up.65 self._ds.delete_table(self._meta_table_name)66 def test_query_metadata_with_data_missing_row_id(self):67 """Query metadata from the datastore: missing row_id.68 """69 self._ds.init_table(self._meta_table_name)70 self._ds.ingest(DATA_01)71 received = self._meta.query_metadata(key='dodgy')72 from geoutils.tests.results.meta_01 import META73 expected = {}74 msg = 'Scan across metadata table against dodgy row_id error'75 self.assertDictEqual(received, expected, msg)76 # Clean up.77 self._ds.delete_table(self._meta_table_name)78 def test_query_metadata_with_data_jsonify(self):79 """Query the metadata component from the datastore: jsonify.80 """81 self._ds.init_table(self._meta_table_name)82 self._ds.ingest(DATA_01)83 received = self._meta.query_metadata(key='i_3001a',84 jsonify=True)85 results_file = os.path.join('geoutils',86 'tests',87 'results',88 'ingest_data_01.txt')89 results_fh = open(results_file)90 expected = results_fh.readline().rstrip()91 msg = 'JSON results from metadata scan error'92 self.assertEqual(received, expected, msg)93 # Clean up.94 self._ds.delete_table(self._meta_table_name)95 def test_query_coords(self):96 """Scan the metadata datastore table.97 """98 self._ds.init_table(self._meta_table_name)99 self._ds.ingest(DATA_01)100 received = self._meta.query_coords(jsonify=True)101 results_file = os.path.join('geoutils',102 'tests',103 'results',104 'coords01.txt')105 results_fh = open(results_file)106 expected = results_fh.readline().rstrip()107 msg = 'Image coordinates scan should return results'108 self.assertEqual(received, expected, msg)109 # Clean up.110 self._ds.delete_table(self._meta_table_name)111 def test_query_coords_missing_geogcs(self):112 """Scan the metadata datastore table: missing GEOGCS.113 """114 self._ds.init_table(self._meta_table_name)115 self._ds.ingest(DATA_02)116 received = self._meta.query_coords(jsonify=False)117 expected = {}118 msg = 'Image coords scan should return no results: no GEOGCS'119 self.assertDictEqual(received, expected, msg)120 # Clean up.121 self._ds.delete_table(self._meta_table_name)122 def test_query_points(self):123 """Scan the metadata spatial index table.124 """125 self._ds.init_table(self._image_spatial_index_table_name)126 self._ds.ingest(DATA_01)127 point = (32.9831944444, 85.0001388889)128 received = self._meta.query_points(point)129 expected = {'center_point_match': ['i_3001a']}130 msg = 'Image points scan should return results'131 self.assertDictEqual(received, expected, msg)132 # Shift the grid up around 110KM.133 point = (34.0, 85.0001388889)134 received = self._meta.query_points(point)135 expected = {'center_point_match': []}136 msg = 'Image points scan should not return results'137 self.assertDictEqual(received, expected, msg)138 # Clean up.139 self._ds.delete_table(self._meta_table_name)140 def test_query_bbox_points(self):141 """Scan the metadata spatial index table: bbox.142 """143 self._ds.init_table(self._image_spatial_index_table_name)144 self._ds.ingest(DATA_01)145 point = (32.0, 84.0, 34.0, 86.0)146 received = self._meta.query_bbox_points(point)147 expected = {'center_point_match': ['i_3001a']}148 msg = 'Image points scan should return results'149 self.assertDictEqual(received, expected, msg)150 # Shift the boundary box.151 point = (12.0, 84.0, 14.0, 86.0)152 received = self._meta.query_bbox_points(point)153 expected = {'center_point_match': []}154 msg = 'Image points scan should not return results'155 self.assertDictEqual(received, expected, msg)156 # Clean up.157 self._ds.delete_table(self._meta_table_name)158 def test_scan_metadata_no_data(self):159 """Chained meta scans: no data.160 """161 self._ds.init_table(self._meta_table_name)162 kwargs = {'metadata=NITF_IREP': ['MONO'],163 'metadata=NITF_FTITLE': ['Airfield', 'Checks an']}164 received = self._meta.scan_metadata(search_terms=kwargs)165 expected = {'metas': []}166 msg = 'Chained meta scans should return no results'167 self.assertDictEqual(received, expected, msg)168 # Clean up.169 self._ds.delete_table(self._meta_table_name)170 def test_scan_metadata(self):171 """Chained meta scans.172 """173 self._ds.init_table(self._meta_table_name)174 self._ds.ingest(DATA_01)175 self._ds.ingest(DATA_02)176 # Single result.177 kwargs = {'metadata=NITF_IREP': ['MONO'],178 'metadata=NITF_FTITLE': ['Airfield', 'Checks an']}179 received = self._meta.scan_metadata(search_terms=kwargs)180 expected = {'metas': ['i_3001a']}181 msg = 'Chained meta scans should return single result'182 self.assertDictEqual(received, expected, msg)183 # Multiple results.184 kwargs = {'metadata=NITF_IREP': ['MONO']}185 received = self._meta.scan_metadata(search_terms=kwargs)186 expected = {'metas': ['i_3001a', 'i_6130e']}187 msg = 'Chained meta scans should return multiple results'188 self.assertDictEqual(received, expected, msg)189 # Clean up.190 self._ds.delete_table(self._meta_table_name)191 def tearDown(self):192 self._meta = None193 del self._meta194 self._ds = None195 del self._ds196 @classmethod197 def tearDownClass(cls):198 """Shutdown the Accumulo mock proxy server (if enabled)199 """200 cls._mock.stop()201 del cls._meta_table_name...

Full Screen

Full Screen

test_graphCreator.py

Source:test_graphCreator.py Github

copy

Full Screen

1import os2import unittest3import openbiolink.graphProperties as graphProp4from openbiolink import globalConfig5from openbiolink.graph_creation.graphCreation import Graph_Creation6from openbiolink.graph_creation.metadata_db_file import *7class TestGraphCreation(unittest.TestCase):8 def test_graph_creation(self):9 # creates test graph from test o_files and compares against true reference test graph10 # tests directed and undirected version of graph (and TN-graph)11 # well as the output into a single as well as in separate files12 # globalConfig = __import__('../../src/openbiolink/graphCreation.py')13 # graphProp = __import__('../../src/openbiolink/globalConfig.py')14 # graphProp = __import__('../../src/graph_creation/graphCreation.py')15 # graphProp = __import__('../../src/openbiolink/graphCreation.py')16 manual_db_file_metadata = []17 # EDGES --------------------------------------------------18 dbMetaEdgeBgeeDiffExpr = DbMetaEdgeBgeeDiffExpr19 dbMetaEdgeBgeeDiffExpr.OFILE_NAME = "BGEE_overexpr.tsv"20 manual_db_file_metadata.append(dbMetaEdgeBgeeDiffExpr)21 dbMetaEdgeBgeeExpr = DbMetaEdgeBgeeExpr22 dbMetaEdgeBgeeExpr.OFILE_NAME = "BGEE_expr_calls.tsv"23 manual_db_file_metadata.append(dbMetaEdgeBgeeExpr)24 dbMetaEdgeCdtPath = DbMetaEdgeCtdPath25 dbMetaEdgeCdtPath.OFILE_NAME = "CDT_gene_pathway.tsv"26 manual_db_file_metadata.append(dbMetaEdgeCdtPath)27 dbMetaEdgeDisGeNet = DbMetaEdgeDisGeNet28 dbMetaEdgeDisGeNet.OFILE_NAME = "DisGeNet_gene_disease.tsv"29 manual_db_file_metadata.append(dbMetaEdgeDisGeNet)30 dbMetaEdgeDrugCentral = DbMetaEdgeDrugCentral31 dbMetaEdgeDrugCentral.OFILE_NAME = "drugcentral_dump.sql"32 manual_db_file_metadata.append(dbMetaEdgeDrugCentral)33 dbMetaEdgeGo = DbMetaEdgeGo34 dbMetaEdgeGo.OFILE_NAME = "GO_annotations.gaf"35 manual_db_file_metadata.append(dbMetaEdgeGo)36 dbMetaEdgeHpoDis = DbMetaEdgeHpoDis37 dbMetaEdgeHpoDis.OFILE_NAME = "HPO_disease_phenotype.tab"38 manual_db_file_metadata.append(dbMetaEdgeHpoDis)39 dbMetaEdgeTnHpoDis = DbMetaEdgeTnHpoDis40 dbMetaEdgeTnHpoDis.OFILE_NAME = "HPO_TN_disease_phenotype.tab"41 manual_db_file_metadata.append(dbMetaEdgeTnHpoDis)42 dbMetaEdgeHpoGene = DbMetaEdgeHpoGene43 dbMetaEdgeHpoGene.OFILE_NAME = "HPO_gene_phenotype.tsv"44 manual_db_file_metadata.append(dbMetaEdgeHpoGene)45 dbMetaEdgeSiderSe = DbMetaEdgeSiderSe46 dbMetaEdgeSiderSe.OFILE_NAME = "SIDER_se.tsv"47 manual_db_file_metadata.append(dbMetaEdgeSiderSe)48 dbMetaEdgeStitch = DbMetaEdgeStitch49 dbMetaEdgeStitch.OFILE_NAME = "STITCH_gene_drug.tsv"50 manual_db_file_metadata.append(dbMetaEdgeStitch)51 dbMetaEdgeString = DbMetaEdgeString52 dbMetaEdgeString.OFILE_NAME = "STRING_gene_gene.txt"53 manual_db_file_metadata.append(dbMetaEdgeString)54 dbMetaEdgeStitchAction = DbMetaEdgeStitchAction55 dbMetaEdgeStitchAction.OFILE_NAME = "STITCH_gene_drug_actions.tsv"56 manual_db_file_metadata.append(dbMetaEdgeStitchAction)57 dbMetaEdgeStringAction = DbMetaEdgeStringAction58 dbMetaEdgeStringAction.OFILE_NAME = "STRING_gene_gene_actions.tsv"59 manual_db_file_metadata.append(dbMetaEdgeStringAction)60 # MAPPINGS --------------------------------------------------61 dbMetaMapDisGeNet = DbMetaMapDisGeNet62 dbMetaMapDisGeNet.OFILE_NAME = "DisGeNet_mapping_disease_umls_do.tab"63 manual_db_file_metadata.append(dbMetaMapDisGeNet)64 dbMetaMapString = DbMetaMapString65 dbMetaMapString.OFILE_NAME = "String_mapping_gene_ncbi_string.tsv"66 manual_db_file_metadata.append(dbMetaMapString)67 dbMetaMapUnipro = DbMetaMapUniprot68 dbMetaMapUnipro.OFILE_NAME = "Uniprot_mapping_gene.tab"69 manual_db_file_metadata.append(dbMetaMapUnipro)70 # ONTO --------------------------------------------------71 dbMetaOntoDo = DbMetaOntoDo72 dbMetaOntoDo.OFILE_NAME = "DO_ontology.obo"73 manual_db_file_metadata.append(dbMetaOntoDo)74 dbMetaOntoGo = DbMetaOntoGo75 dbMetaOntoGo.OFILE_NAME = "GO_ontology.obo"76 manual_db_file_metadata.append(dbMetaOntoGo)77 dbMetaOntoHpo = DbMetaOntoHpo78 dbMetaOntoHpo.OFILE_NAME = "HPO_ontology.obo"79 manual_db_file_metadata.append(dbMetaOntoHpo)80 dbMetaOntoUberon = DbMetaOntoUberon81 dbMetaOntoUberon.OFILE_NAME = "UBERON_ontology.obo"82 manual_db_file_metadata.append(dbMetaOntoUberon)83 current_folder = os.path.dirname(os.path.realpath(__file__))84 test_folder = os.path.abspath(os.path.join(current_folder, os.pardir))85 test_data_folder = os.path.join(test_folder, "test_data")86 output_data_folder = os.path.join(test_data_folder, "graph_files")87 true_ref_folder = os.path.join(test_data_folder, "TR_files")88 # global variables89 graphProp.QUALITY = None90 globalConfig.INTERACTIVE_MODE = False91 globalConfig.SKIP_EXISTING_FILES = False92 directed_tuple = True, "TR_DIR_"93 undirected_tuple = False, "TR_NOT_"94 cases = [directed_tuple, undirected_tuple]95 for case in cases:96 graph_is_directed, true_ref_file_prefix = case97 print("\n##########################################")98 print("GRAPH IS DIRECTED: " + str(graph_is_directed) + "\n")99 with self.subTest(graph_is_directed=graph_is_directed):100 graphProp.DIRECTED = graph_is_directed101 graph_creator = Graph_Creation(test_data_folder, manual_db_file_metadata)102 graph_creator.create_input_files()103 graph_creator.create_graph(one_file_sep="\t", multi_file_sep="\t")104 true_ref_files = [105 f for f in os.listdir(true_ref_folder) if f.startswith(true_ref_file_prefix)106 ] # os.path.isfile(f) ]107 missing_elements = []108 for ref_file_name in true_ref_files:109 with self.subTest(ref_file_name=ref_file_name):110 all_lines_in_comp_file = True111 with open(os.path.join(true_ref_folder, ref_file_name)) as f:112 ref_file = f.readlines()113 with open(os.path.join(output_data_folder, ref_file_name[7:])) as f:114 comp_file = f.readlines()115 comp_dict = {}116 j = 0117 for row in comp_file:118 comp_dict[j] = row119 j += 1120 i = 0121 for row in ref_file:122 if row not in comp_dict.values():123 all_lines_in_comp_file = False124 missing_elements.append(row)125 i += 1126 if not all_lines_in_comp_file:127 print(ref_file_name)128 print("missing elements:", missing_elements)129 assert j == i...

Full Screen

Full Screen

__init__.py

Source:__init__.py Github

copy

Full Screen

1from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDisDrug import EdgeMetaDisDrug2from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDisPheno import EdgeMetaDisPheno3from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDrugActivationGene import EdgeMetaDrugActivationGene4from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDrugBindActGene import EdgeMetaDrugBindActGene5from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDrugBindInhGene import EdgeMetaDrugBindInhGene6from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDrugBindingGene import EdgeMetaDrugBindingGene7from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDrugCatalysisGene import EdgeMetaDrugCatalysisGene8from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDrugExpressionGene import EdgeMetaDrugExpressionGene9from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDrugInhibitionGene import EdgeMetaDrugInhibitionGene10from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDrugPheno import EdgeMetaDrugPheno11from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDrugPredBindGene import EdgeMetaDrugPredBindGene12from openbiolink.graph_creation.metadata_edge.edge.edgeMetaDrugReactionGene import EdgeMetaDrugReactionGene13from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneActivationGene import EdgeMetaGeneActivationGene14from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneAna import EdgeMetaGeneAna15from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneBindActGene import EdgeMetaGeneBindActGene16from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneBindInhGene import EdgeMetaGeneBindInhGene17from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneBindingGene import EdgeMetaGeneBindingGene18from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneCatalysisGene import EdgeMetaGeneCatalysisGene19from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneDis import EdgeMetaGeneDis20from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneDrug import EdgeMetaGeneDrug21from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneExpressionGene import EdgeMetaGeneExpressionGene22from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneGene import EdgeMetaGeneGene23from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneGo import EdgeMetaGeneGo24from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneInhibitionGene import EdgeMetaGeneInhibitionGene25from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneOverAna import EdgeMetaGeneOverAna26from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGenePath import EdgeMetaGenePath27from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGenePheno import EdgeMetaGenePheno28from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGenePtmodGene import EdgeMetaGenePtmodGene29from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneReactionGene import EdgeMetaGeneReactionGene30from openbiolink.graph_creation.metadata_edge.edge.edgeMetaGeneUnderAna import EdgeMetaGeneUnderAna31from openbiolink.graph_creation.metadata_edge.edge.tnEdgeMetaDisDrug import TnEdgeMetaDisDrug32from openbiolink.graph_creation.metadata_edge.edge.tnEdgeMetaDisPheno import TnEdgeMetaDisPheno33from openbiolink.graph_creation.metadata_edge.edge.tnEdgeMetaGeneAna import TnEdgeMetaGeneAna34from openbiolink.graph_creation.metadata_edge.edge.tnEdgeMetaGeneOverAna import TnEdgeMetaGeneOverAna...

Full Screen

Full Screen

meta.js

Source:meta.js Github

copy

Full Screen

1/**2 * @ngdoc service3 * @name $$mdMeta4 * @module material.core.meta5 *6 * @description7 *8 * A provider and a service that simplifies meta tags access9 *10 * Note: This is intended only for use with dynamic meta tags such as browser color and title.11 * Tags that are only processed when the page is rendered (such as `charset`, and `http-equiv`)12 * will not work since `$$mdMeta` adds the tags after the page has already been loaded.13 *14 * ```js15 * app.config(function($$mdMetaProvider) {16 * var removeMeta = $$mdMetaProvider.setMeta('meta-name', 'content');17 * var metaValue = $$mdMetaProvider.getMeta('meta-name'); // -> 'content'18 *19 * removeMeta();20 * });21 *22 * app.controller('myController', function($$mdMeta) {23 * var removeMeta = $$mdMeta.setMeta('meta-name', 'content');24 * var metaValue = $$mdMeta.getMeta('meta-name'); // -> 'content'25 *26 * removeMeta();27 * });28 * ```29 *30 * @returns {$$mdMeta.$service}31 *32 */33angular.module('material.core.meta', [])34 .provider('$$mdMeta', function () {35 var head = angular.element(document.head);36 var metaElements = {};37 /**38 * Checks if the requested element was written manually and maps it39 *40 * @param {string} name meta tag 'name' attribute value41 * @returns {boolean} returns true if there is an element with the requested name42 */43 function mapExistingElement(name) {44 if (metaElements[name]) {45 return true;46 }47 var element = document.getElementsByName(name)[0];48 if (!element) {49 return false;50 }51 metaElements[name] = angular.element(element);52 return true;53 }54 /**55 * @ngdoc method56 * @name $$mdMeta#setMeta57 *58 * @description59 * Creates meta element with the 'name' and 'content' attributes,60 * if the meta tag is already created than we replace the 'content' value61 *62 * @param {string} name meta tag 'name' attribute value63 * @param {string} content meta tag 'content' attribute value64 * @returns {function} remove function65 *66 */67 function setMeta(name, content) {68 mapExistingElement(name);69 if (!metaElements[name]) {70 var newMeta = angular.element('<meta name="' + name + '" content="' + content + '"/>');71 head.append(newMeta);72 metaElements[name] = newMeta;73 }74 else {75 metaElements[name].attr('content', content);76 }77 return function () {78 metaElements[name].attr('content', '');79 metaElements[name].remove();80 delete metaElements[name];81 };82 }83 /**84 * @ngdoc method85 * @name $$mdMeta#getMeta86 *87 * @description88 * Gets the 'content' attribute value of the wanted meta element89 *90 * @param {string} name meta tag 'name' attribute value91 * @returns {string} content attribute value92 */93 function getMeta(name) {94 if (!mapExistingElement(name)) {95 throw Error('$$mdMeta: could not find a meta tag with the name \'' + name + '\'');96 }97 return metaElements[name].attr('content');98 }99 var module = {100 setMeta: setMeta,101 getMeta: getMeta102 };103 return angular.extend({}, module, {104 $get: function () {105 return module;106 }107 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { meta } from 'ng-mocks';2import { MockBuilder } from 'ng-mocks';3import { MockRender } from 'ng-mocks';4import { MockedComponent } from 'ng-mocks';5import { MockedDirective } from 'ng-mocks';6import { MockedPipe } from 'ng-mocks';7import { MockedService } from 'ng-mocks';8import { MockedType } from 'ng-mocks';9import { MockInstance } from 'ng-mocks';10import { MockProvider } from 'ng-mocks';11import { MockRender } from 'ng-mocks';12import { MockedComponent } from 'ng-mocks';13import { MockedDirective } from 'ng-mocks';14import { MockedPipe } from 'ng-mocks';15import { MockedService } from 'ng-mocks';16import { MockedType } from 'ng-mocks';17import { MockInstance } from 'ng-mocks';18import { MockProvider } from 'ng-mocks';19import { MockRender } from 'ng-mocks';20import { MockedComponent } from 'ng-mocks';21import { MockedDirective } from 'ng-mocks';22import { MockedPipe } from 'ng-mocks';23import { MockedService } from 'ng-mocks';24import { MockedType } from 'ng-mocks';25import { MockInstance } from 'ng-mocks';26import { MockProvider } from 'ng-mocks';27import {

Full Screen

Using AI Code Generation

copy

Full Screen

1import { meta } from 'ng-mocks';2import { createComponent } from 'ng-mocks';3import { mockInstance } from 'ng-mocks';4import { mockProvider } from 'ng-mocks';5describe('AppComponent', () => {6 beforeEach(async(() => {7 TestBed.configureTestingModule({8 mockProvider(ExampleService, {9 getExample: () => 'Mocked Service'10 })11 }).compileComponents();12 }));13 it('should create the app', () => {14 const fixture = TestBed.createComponent(AppComponent);15 const app = fixture.debugElement.componentInstance;16 expect(app).toBeTruthy();17 });18 it('should render title in a h1 tag', () => {19 const fixture = TestBed.createComponent(AppComponent);20 fixture.detectChanges();21 const compiled = fixture.debugElement.nativeElement;22 expect(compiled.querySelector('h1').textContent).toContain('Welcome to ng-mocks!');23 });24 it('should render service value in a p tag', () => {25 const fixture = TestBed.createComponent(AppComponent);26 fixture.detectChanges();27 const compiled = fixture.debugElement.nativeElement;28 expect(compiled.querySelector('p').textContent).toContain('Mocked Service');29 });30});31import { Component } from '@angular/core';32import { TestBed } from '@angular/core/testing';33import { ExampleService } from './example.service';34@Component({35 <h1> {{ title }} </h1>36 <p> {{ exampleService.getExample() }} </p>37})38class AppComponent {39 title = 'ng-mocks';40 constructor(public exampleService: ExampleService) {}41}42import { Injectable } from '@angular/core';43@Injectable({44})45export class ExampleService {46 constructor() { }47 getExample() {48 return 'Example Service';49 }50}51import { Component } from '@angular/core';52import { TestBed } from '@angular/core/testing';53import { ExampleService } from './example.service';54@Component({

Full Screen

Using AI Code Generation

copy

Full Screen

1import { meta } from 'ng-mocks';2import { MyComponent } from './my.component';3describe('MyComponent', () => {4 it('should have a selector', () => {5 expect(meta(MyComponent).selector).toEqual('my-component');6 });7});8import { Component } from '@angular/core';9@Component({10})11export class MyComponent {}12import { ComponentFixture, TestBed } from '@angular/core/testing';13import { MyComponent } from './my.component';14describe('MyComponent', () => {15 let fixture: ComponentFixture<MyComponent>;16 beforeEach(() => {17 fixture = TestBed.configureTestingModule({18 }).createComponent(MyComponent);19 });20 it('should render', () => {21 fixture.detectChanges();22 expect(fixture.nativeElement).toMatchSnapshot();23 });24});25import { ComponentFixture, TestBed } from '@angular/core/testing';26import { MyComponent } from './my.component';27describe('MyComponent', () => {28 let fixture: ComponentFixture<MyComponent>;29 beforeEach(() => {30 fixture = TestBed.configureTestingModule({31 }).createComponent(MyComponent);32 });33 it('should render', () => {34 fixture.detectChanges();35 expect(fixture.nativeElement).toMatchSnapshot();36 });37});38import { ComponentFixture, TestBed } from '@angular/core/testing';39import { MyComponent } from './my.component';40describe('MyComponent', () => {41 let fixture: ComponentFixture<MyComponent>;42 beforeEach(() => {43 fixture = TestBed.configureTestingModule({44 }).createComponent(MyComponent);45 });46 it('should render', () => {47 fixture.detectChanges();48 expect(fixture.nativeElement).toMatchSnapshot();49 });50});51import { ComponentFixture, TestBed } from '@angular/core/testing';52import { MyComponent } from './my.component';53describe('MyComponent', () => {54 let fixture: ComponentFixture<MyComponent>;55 beforeEach(() => {56 fixture = TestBed.configureTestingModule({57 }).createComponent(MyComponent);58 });59 it('should render',

Full Screen

Using AI Code Generation

copy

Full Screen

1import { meta } from 'ng-mocks';2import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';3import { TestBed } from '@angular/core/testing';4import { AppComponent } from './app.component';5describe('AppComponent', () => {6 beforeEach(() => MockBuilder(AppComponent));7 it('should create the app', () => {8 const fixture = MockRender(AppComponent);9 const app = fixture.point.componentInstance;10 expect(app).toBeTruthy();11 });12 it(`should have as title 'ng-mocks'`, () => {13 const fixture = MockRender(AppComponent);14 const app = fixture.point.componentInstance;15 expect(app.title).toEqual('ng-mocks');16 });17 it('should render title in a h1 tag', () => {18 const fixture = MockRender(AppComponent);19 fixture.detectChanges();20 const compiled = fixture.debugElement.nativeElement;21 expect(compiled.querySelector('h1').textContent).toContain(22 );23 });24 it('should render title in a h1 tag using ng-mocks', () => {25 const fixture = MockRender(AppComponent);26 fixture.detectChanges();27 const compiled = ngMocks.find('h1');28 expect(compiled.textContent).toContain('Welcome to ng-mocks!');29 });30 it('should render title in a h1 tag using meta', () => {31 const fixture = MockRender(AppComponent);32 fixture.detectChanges();33 const compiled = meta('h1').debugElement.nativeElement;34 expect(compiled.textContent).toContain('Welcome to ng-mocks!');35 });36 it('should render title in a h1 tag using TestBed', () => {37 const fixture = TestBed.createComponent(AppComponent);38 fixture.detectChanges();39 const compiled = fixture.debugElement.nativeElement;40 expect(compiled.querySelector('h1').textContent).toContain(41 );42 });43});44import { Component } from '@angular/core';45@Component({46})47export class AppComponent {48 title = 'ng-mocks';49}50<h1>Welcome to {{ title }}!</h1>

Full Screen

Using AI Code Generation

copy

Full Screen

1import { meta } from 'ng-mocks';2const { declarations, imports, providers } = meta(TestModule);3meta(TestModule, {4 imports: [MockModule],5});6meta(TestModule, {7 imports: [MockModule],8});9meta(TestModule, {10 imports: [MockModule],11});12import { MockBuilder, MockRender } from 'ng-mocks';13import { AppModule } from './app.module';14import { AppComponent } from './app.component';15describe('AppComponent', () => {16 beforeEach(() => MockBuilder(AppComponent, AppModule));17 it('should create the app', () => {18 const fixture = MockRender(AppComponent);19 const app = fixture.point.componentInstance;20 expect(app).toBeTruthy();21 });22});23import { NgModule } from '@angular/core';24import { CommonModule } from '@angular/common';25import { AppComponent } from './app.component';26@NgModule({27 imports: [CommonModule],28})29export class AppModule {}30import { Component } from '@angular/core';31@Component({32})33export class AppComponent {34 title = 'app';35}36import { MockBuilder, MockRender } from 'ng-mocks';37import { AppComponent } from './app.component';38import { AppModule } from './app.module';39describe('AppComponent', () => {40 beforeEach(() => MockBuilder(AppComponent, AppModule));41 it('should create the app', () => {42 const fixture = MockRender(AppComponent);43 const app = fixture.point.componentInstance;44 expect(app).toBeTruthy();45 });46});47import { MockBuilder, MockRender } from 'ng-mocks';48import { AppModule } from './app.module';49import { AppComponent } from './app.component';50describe('AppComponent', () => {51 beforeEach(() => MockBuilder(AppComponent,

Full Screen

Using AI Code Generation

copy

Full Screen

1import { meta } from 'ng-mocks';2const component = meta(TestComponent).controller;3import { Component } from '@angular/core';4@Component({5})6export class TestComponent {7 constructor() {}8}9import { meta } from 'ng-mocks';10const component = meta(TestComponent).controller;11import { Component } from '@angular/core';12@Component({13})14export class TestComponent {15 constructor() {}16}17import { meta } from 'ng-mocks';18const component = meta(TestComponent).controller;19import { Component } from '@angular/core';20@Component({21})22export class TestComponent {23 constructor() {}24}25import { meta } from 'ng-mocks';26const component = meta(TestComponent).controller;27import { Component } from '@angular/core';28@Component({29})30export class TestComponent {31 constructor() {}32}33import { meta } from 'ng-mocks';34const component = meta(TestComponent).controller;35import { Component } from '@angular/core';36@Component({37})38export class TestComponent {39 constructor() {}40}41import { meta } from 'ng-mocks';42const component = meta(TestComponent).controller;43import { Component } from '@angular/core';44@Component({45})46export class TestComponent {47 constructor() {}48}49import { meta } from 'ng-mocks';50const component = meta(TestComponent).controller;

Full Screen

Using AI Code Generation

copy

Full Screen

1import { meta } from 'ng-mocks';2import { MyComponent } from './my-component';3describe('MyComponent', () => {4 const component = meta(MyComponent);5 it('should be defined', () => {6 expect(component).toBeDefined();7 });8 it('should have a selector', () => {9 expect(component.selector).toBeDefined();10 });11 it('should have a template', () => {12 expect(component.template).toBeDefined();13 });14 it('should have a template', () => {15 expect(component.template).toBeDefined();16 });17 it('should have a template', () => {18 expect(component.template).toBeDefined();19 });20});21import { Component, Input } from '@angular/core';22@Component({23})24export class MyComponent {25 @Input() public myInput: string;26}27import { ComponentFixture, TestBed } from '@angular/core/testing';28import { MyComponent } from './my-component';29describe('MyComponent', () => {30 let component: MyComponent;31 let fixture: ComponentFixture<MyComponent>;32 beforeEach(async () => {33 await TestBed.configureTestingModule({34 }).compileComponents();35 });36 beforeEach(() => {37 fixture = TestBed.createComponent(MyComponent);38 component = fixture.componentInstance;39 fixture.detectChanges();40 });41 it('should create', () => {42 expect(component).toBeTruthy();43 });44});45import { ComponentFixture, TestBed } from '@angular/core/testing';46import { MyComponent } from './my-component';47describe('MyComponent', () => {48 let component: MyComponent;49 let fixture: ComponentFixture<MyComponent>;50 beforeEach(async () => {51 await TestBed.configureTestingModule({52 }).compileComponents();53 });54 beforeEach(() => {55 fixture = TestBed.createComponent(MyComponent

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run ng-mocks automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful