Skip to content

Instantly share code, notes, and snippets.

@lilac
Last active March 30, 2023 06:19
Show Gist options
  • Save lilac/fd6b648f48f4bec4b371e3f357c714bd to your computer and use it in GitHub Desktop.
Save lilac/fd6b648f48f4bec4b371e3f357c714bd to your computer and use it in GitHub Desktop.
DAG for home page recommendation
# builtin functions
# graph is a builtin module exposed by the host environment
# graph.nodes = {}
# graph.edges = []
def node(name, operation, conf={}, predicate=None):
"""
:rtype: str the node name is returned
:param name: string unique name of the node
:param operation: string | (ctx, conf) -> any
:param conf: object, the configuration for the operation
:param predicate: (ctx, inputs) -> boolean, a predicate
"""
n = {
"name": name,
"operation": operation,
"conf": conf,
"predicate": predicate
}
message = "node {}".format(n)
print(message)
graph.nodes[name] = n
return name
# predicates
# A predicate is of type (ctx, inputs) -> boolean
def is_runnable(ctx, inputs):
"""
Whether a node is runnable
:param ctx: the pipeline context
:param inputs: the results of all dependency nodes
"""
# The first input is a FetchRanking node, and the result is a Ranking object.
return inputs[0].size > 0
def edge(src, dst):
message = "{} -> {}".format(src, dst)
print(message)
graph.edges.append((src, dst))
def sequence(*nodes):
size = len(nodes)
last = None
for i in range(0, size):
src = nodes[i]
apply = node("{src}:apply".format(src=src), 'apply', None, is_runnable)
edge(src, apply)
last = apply
if i < size - 1:
dst = nodes[i + 1]
edge(apply, "{}:apply".format(dst))
return last
def before(source, *nodes):
size = len(nodes)
last = None
for i in range(0, size):
src = nodes[i]
edge(source, src)
last = src
return last
Display the source blob
Display the rendered blob
Raw
<svg id="mermaid" width="1240.892578125" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" role="img" aria-labelledby="chart-title-mermaid chart-desc-mermaid" height="1746" viewBox="0 0 1240.892578125 1746"><title id="chart-title-mermaid"></title><desc id="chart-desc-mermaid"></desc><style>#mermaid {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid .error-icon{fill:#552222;}#mermaid .error-text{fill:#552222;stroke:#552222;}#mermaid .edge-thickness-normal{stroke-width:2px;}#mermaid .edge-thickness-thick{stroke-width:3.5px;}#mermaid .edge-pattern-solid{stroke-dasharray:0;}#mermaid .edge-pattern-dashed{stroke-dasharray:3;}#mermaid .edge-pattern-dotted{stroke-dasharray:2;}#mermaid .marker{fill:#333333;stroke:#333333;}#mermaid .marker.cross{stroke:#333333;}#mermaid svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid .cluster-label text{fill:#333;}#mermaid .cluster-label span{color:#333;}#mermaid .label text,#mermaid span{fill:#333;color:#333;}#mermaid .node rect,#mermaid .node circle,#mermaid .node ellipse,#mermaid .node polygon,#mermaid .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid .node .label{text-align:center;}#mermaid .node.clickable{cursor:pointer;}#mermaid .arrowheadPath{fill:#333333;}#mermaid .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid .flowchart-link{stroke:#333333;fill:none;}#mermaid .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid .cluster text{fill:#333;}#mermaid .cluster span{color:#333;}#mermaid div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid .none&gt;*{fill:white!important;stroke:lightblue!important;stroke-width:2px!important;}#mermaid .none span{fill:white!important;stroke:lightblue!important;stroke-width:2px!important;}#mermaid .running&gt;*{fill:white!important;stroke:lime!important;stroke-width:2px!important;}#mermaid .running span{fill:white!important;stroke:lime!important;stroke-width:2px!important;}#mermaid .error&gt;*{fill:white!important;stroke:red!important;stroke-width:2px!important;}#mermaid .error span{fill:white!important;stroke:red!important;stroke-width:2px!important;}#mermaid .cancel&gt;*{fill:white!important;stroke:pink!important;stroke-width:2px!important;}#mermaid .cancel span{fill:white!important;stroke:pink!important;stroke-width:2px!important;}#mermaid .done&gt;*{fill:white!important;stroke:green!important;stroke-width:2px!important;}#mermaid .done span{fill:white!important;stroke:green!important;stroke-width:2px!important;}#mermaid .skipped&gt;*{fill:white!important;stroke:gray!important;stroke-width:2px!important;}#mermaid .skipped span{fill:white!important;stroke:gray!important;stroke-width:2px!important;}</style><g transform="translate(0, 0)"><marker id="flowchart-pointEnd" class="marker flowchart" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker><marker id="flowchart-pointStart" class="marker flowchart" viewBox="0 0 10 10" refX="0" refY="5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 0 5 L 10 10 L 10 0 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker><marker id="flowchart-circleEnd" class="marker flowchart" viewBox="0 0 10 10" refX="11" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></circle></marker><marker id="flowchart-circleStart" class="marker flowchart" viewBox="0 0 10 10" refX="-1" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></circle></marker><marker id="flowchart-crossEnd" class="marker cross flowchart" viewBox="0 0 11 11" refX="12" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"></path></marker><marker id="flowchart-crossStart" class="marker cross flowchart" viewBox="0 0 11 11" refX="-1" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"></path></marker><g class="root"><g class="clusters"></g><g class="edgePaths"><path d="M672.292661516854,47L662.5837283473783,51.166666666666664C652.8747951779027,55.333333333333336,633.4569288389513,63.666666666666664,623.7479956694757,72C614.0390625,80.33333333333333,614.0390625,88.66666666666667,614.0390625,92.83333333333333L614.0390625,97" id="L-request_validation-container_recall-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-request_validation LE-container_recall" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M763.168275983146,47L772.8772091526216,51.166666666666664C782.5861423220973,55.333333333333336,802.0040086610487,63.666666666666664,811.7129418305243,72C821.421875,80.33333333333333,821.421875,88.66666666666667,821.421875,92.83333333333333L821.421875,97" id="L-request_validation-container_pinning_i18n-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-request_validation LE-container_pinning_i18n" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M614.0390625,136L614.0390625,140.16666666666666C614.0390625,144.33333333333334,614.0390625,152.66666666666666,623.7479956694757,161C633.4569288389513,169.33333333333334,652.8747951779027,177.66666666666666,662.5837283473783,181.83333333333334L672.292661516854,186" id="L-container_recall-container_recall:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_recall LE-container_recall:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M821.421875,136L821.421875,140.16666666666666C821.421875,144.33333333333334,821.421875,152.66666666666666,811.7129418305243,161C802.0040086610487,169.33333333333334,782.5861423220973,177.66666666666666,772.8772091526216,181.83333333333334L763.168275983146,186" id="L-container_pinning_i18n-container_recall:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_pinning_i18n LE-container_recall:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M629.1953125,212.29873609706775L547.369140625,218.58228008088977C465.54296875,224.8658240647118,301.890625,237.43291203235592,220.064453125,247.88312268284463C138.23828125,258.3333333333333,138.23828125,266.6666666666667,138.23828125,270.8333333333333L138.23828125,275" id="L-container_recall:apply-aggregate_ranking_trending-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_recall:apply LE-aggregate_ranking_trending" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M629.1953125,218.17776786163205L592.1569010416666,223.4814732180267C555.1184895833334,228.78517857442137,481.0416666666667,239.39258928721065,444.0032552083333,252.112961310272C406.96484375,264.8333333333333,406.96484375,279.6666666666667,406.96484375,294.5C406.96484375,309.3333333333333,406.96484375,324.1666666666667,406.96484375,335.75C406.96484375,347.3333333333333,406.96484375,355.6666666666667,406.96484375,359.8333333333333L406.96484375,364" id="L-container_recall:apply-featured_rank_default-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_recall:apply LE-featured_rank_default" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M663.5303283005618,225L651.9491017088015,229.16666666666666C640.3678751170412,233.33333333333334,617.2054219335206,241.66666666666666,605.6241953417604,253.25C594.04296875,264.8333333333333,594.04296875,279.6666666666667,594.04296875,294.5C594.04296875,309.3333333333333,594.04296875,324.1666666666667,594.04296875,339C594.04296875,353.8333333333333,594.04296875,368.6666666666667,594.04296875,383.5C594.04296875,398.3333333333333,594.04296875,413.1666666666667,594.04296875,424.75C594.04296875,436.3333333333333,594.04296875,444.6666666666667,594.04296875,448.8333333333333L594.04296875,453" id="L-container_recall:apply-content_recall_genesis-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_recall:apply LE-content_recall_genesis" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M745.0787394662922,225L750.9223870552436,229.16666666666666C756.7660346441947,233.33333333333334,768.4533298220973,241.66666666666666,774.2969774110487,253.25C780.140625,264.8333333333333,780.140625,279.6666666666667,780.140625,294.5C780.140625,309.3333333333333,780.140625,324.1666666666667,780.140625,339C780.140625,353.8333333333333,780.140625,368.6666666666667,780.140625,383.5C780.140625,398.3333333333333,780.140625,413.1666666666667,780.140625,428C780.140625,442.8333333333333,780.140625,457.6666666666667,780.140625,472.5C780.140625,487.3333333333333,780.140625,502.1666666666667,780.140625,513.75C780.140625,525.3333333333334,780.140625,533.6666666666666,780.140625,537.8333333333334L780.140625,542" id="L-container_recall:apply-content_rank_default-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_recall:apply LE-content_rank_default" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M806.265625,221.60642680911204L832.2783203125,226.3386890075934C858.291015625,231.07095120607468,910.31640625,240.53547560303733,936.3291015625,252.68440446818533C962.341796875,264.8333333333333,962.341796875,279.6666666666667,962.341796875,294.5C962.341796875,309.3333333333333,962.341796875,324.1666666666667,962.341796875,339C962.341796875,353.8333333333333,962.341796875,368.6666666666667,962.341796875,383.5C962.341796875,398.3333333333333,962.341796875,413.1666666666667,962.341796875,428C962.341796875,442.8333333333333,962.341796875,457.6666666666667,962.341796875,472.5C962.341796875,487.3333333333333,962.341796875,502.1666666666667,962.341796875,517C962.341796875,531.8333333333334,962.341796875,546.6666666666666,962.341796875,561.5C962.341796875,576.3333333333334,962.341796875,591.1666666666666,962.341796875,602.75C962.341796875,614.3333333333334,962.341796875,622.6666666666666,962.341796875,626.8333333333334L962.341796875,631" id="L-container_recall:apply-content_rank_context-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_recall:apply LE-content_rank_context" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M806.265625,214.69766089870734L862.9013671875,220.58138408225614C919.537109375,226.4651072658049,1032.80859375,238.23255363290244,1089.4443359375,251.53294348311792C1146.080078125,264.8333333333333,1146.080078125,279.6666666666667,1146.080078125,294.5C1146.080078125,309.3333333333333,1146.080078125,324.1666666666667,1146.080078125,339C1146.080078125,353.8333333333333,1146.080078125,368.6666666666667,1146.080078125,383.5C1146.080078125,398.3333333333333,1146.080078125,413.1666666666667,1146.080078125,428C1146.080078125,442.8333333333333,1146.080078125,457.6666666666667,1146.080078125,472.5C1146.080078125,487.3333333333333,1146.080078125,502.1666666666667,1146.080078125,517C1146.080078125,531.8333333333334,1146.080078125,546.6666666666666,1146.080078125,561.5C1146.080078125,576.3333333333334,1146.080078125,591.1666666666666,1146.080078125,606C1146.080078125,620.8333333333334,1146.080078125,635.6666666666666,1146.080078125,650.5C1146.080078125,665.3333333333334,1146.080078125,680.1666666666666,1146.080078125,691.75C1146.080078125,703.3333333333334,1146.080078125,711.6666666666666,1146.080078125,715.8333333333334L1146.080078125,720" id="L-container_recall:apply-content_rank_specific-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_recall:apply LE-content_rank_specific" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M138.23828125,314L138.23828125,318.1666666666667C138.23828125,322.3333333333333,138.23828125,330.6666666666667,138.23828125,339C138.23828125,347.3333333333333,138.23828125,355.6666666666667,138.23828125,359.8333333333333L138.23828125,364" id="L-aggregate_ranking_trending-aggregate_ranking_trending:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-aggregate_ranking_trending LE-aggregate_ranking_trending:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M138.23828125,403L138.23828125,407.1666666666667C138.23828125,411.3333333333333,138.23828125,419.6666666666667,150.81911282771534,428C163.39994440543072,436.3333333333333,188.5616075608614,444.6666666666667,201.14243913857675,448.8333333333333L213.72327071629212,453" id="L-aggregate_ranking_trending:apply-featured_rank_default:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-aggregate_ranking_trending:apply LE-featured_rank_default:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M406.96484375,403L406.96484375,407.1666666666667C406.96484375,411.3333333333333,406.96484375,419.6666666666667,394.38401217228466,428C381.8031805945693,436.3333333333333,356.6415174391386,444.6666666666667,344.0606858614232,448.8333333333333L331.4798542837079,453" id="L-featured_rank_default-featured_rank_default:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-featured_rank_default LE-featured_rank_default:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M272.6015625,492L272.6015625,496.1666666666667C272.6015625,500.3333333333333,272.6015625,508.6666666666667,284.336954295412,517C296.07234609082394,525.3333333333334,319.54312968164794,533.6666666666666,331.2785214770599,537.8333333333334L343.0139132724719,542" id="L-featured_rank_default:apply-content_recall_genesis:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-featured_rank_default:apply LE-content_recall_genesis:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M594.04296875,492L594.04296875,496.1666666666667C594.04296875,500.3333333333333,594.04296875,508.6666666666667,575.6808505969101,517C557.3187324438203,525.3333333333334,520.5944961376405,533.6666666666666,502.23237798455057,537.8333333333334L483.87025983146066,542" id="L-content_recall_genesis-content_recall_genesis:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_recall_genesis LE-content_recall_genesis:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M397.935546875,581L397.935546875,585.1666666666666C397.935546875,589.3333333333334,397.935546875,597.6666666666666,409.5167734667603,606C421.09800005852065,614.3333333333334,444.2604532420412,622.6666666666666,455.8416798338015,626.8333333333334L467.4229064255618,631" id="L-content_recall_genesis:apply-content_rank_default:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_recall_genesis:apply LE-content_rank_default:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M780.140625,581L780.140625,585.1666666666666C780.140625,589.3333333333334,780.140625,597.6666666666666,754.9801432291666,606.1643403268334C729.8196614583334,614.6620139870003,679.4986979166666,623.3240279740004,654.3382161458334,627.6550349675005L629.177734375,631.9860419610006" id="L-content_rank_default-content_rank_default:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_rank_default LE-content_rank_default:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M521.623046875,670L521.623046875,674.1666666666666C521.623046875,678.3333333333334,521.623046875,686.6666666666666,533.0559603230337,695C544.4888737710675,703.3333333333334,567.3547006671348,711.6666666666666,578.7876141151686,715.8333333333334L590.2205275632023,720" id="L-content_rank_default:apply-content_rank_context:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_rank_default:apply LE-content_rank_context:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M962.341796875,670L962.341796875,674.1666666666666C962.341796875,678.3333333333334,962.341796875,686.6666666666666,927.4078776041666,695.7124453149105C892.4739583333334,704.7582239631544,822.6061197916666,714.5164479263088,787.6722005208334,719.3955599078859L752.73828125,724.2746718894631" id="L-content_rank_context-content_rank_context:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_rank_context LE-content_rank_context:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M643.7265625,759L643.7265625,763.1666666666666C643.7265625,767.3333333333334,643.7265625,775.6666666666666,655.2351869733146,784C666.7438114466291,792.3333333333334,689.7610603932584,800.6666666666666,701.2696848665731,804.8333333333334L712.7783093398876,809" id="L-content_rank_context:apply-content_rank_specific:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_rank_context:apply LE-content_rank_specific:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M1146.080078125,759L1146.080078125,763.1666666666666C1146.080078125,767.3333333333334,1146.080078125,775.6666666666666,1101.03515625,785.1160963381616C1055.990234375,794.5655260096564,965.900390625,805.1310520193128,920.85546875,810.4138150241412L875.810546875,815.6965780289694" id="L-content_rank_specific-content_rank_specific:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_rank_specific LE-content_rank_specific:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M813.3405898876405,848L823.3196321980337,852.1666666666666C833.2986745084269,856.3333333333334,853.2567591292135,864.6666666666666,863.2358014396068,873C873.21484375,881.3333333333334,873.21484375,889.6666666666666,873.21484375,893.8333333333334L873.21484375,898" id="L-content_rank_specific:apply-content_promotion-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_rank_specific:apply LE-content_promotion" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M719.9367538623595,848L709.9577115519663,852.1666666666666C699.9786692415731,856.3333333333334,680.0205846207865,864.6666666666666,670.0415423103933,876.25C660.0625,887.8333333333334,660.0625,902.6666666666666,660.0625,917.5C660.0625,932.3333333333334,660.0625,947.1666666666666,660.0625,962C660.0625,976.8333333333334,660.0625,991.6666666666666,660.0625,1006.5C660.0625,1021.3333333333334,660.0625,1036.1666666666667,660.0625,1047.75C660.0625,1059.3333333333333,660.0625,1067.6666666666667,660.0625,1071.8333333333333L660.0625,1076" id="L-content_rank_specific:apply-container_rank_default-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_rank_specific:apply LE-container_rank_default" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M873.21484375,937L873.21484375,941.1666666666666C873.21484375,945.3333333333334,873.21484375,953.6666666666666,873.21484375,962C873.21484375,970.3333333333334,873.21484375,978.6666666666666,873.21484375,982.8333333333334L873.21484375,987" id="L-content_promotion-content_promotion:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_promotion LE-content_promotion:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M660.0625,1115L660.0625,1119.1666666666667C660.0625,1123.3333333333333,660.0625,1131.6666666666667,670.0415423103933,1140C680.0205846207865,1148.3333333333333,699.9786692415731,1156.6666666666667,709.9577115519663,1160.8333333333333L719.9367538623595,1165" id="L-container_rank_default-container_rank_default:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_rank_default LE-container_rank_default:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M873.21484375,1115L873.21484375,1119.1666666666667C873.21484375,1123.3333333333333,873.21484375,1131.6666666666667,863.2358014396068,1140C853.2567591292135,1148.3333333333333,833.2986745084269,1156.6666666666667,823.3196321980337,1160.8333333333333L813.3405898876405,1165" id="L-content_holdback-container_rank_default:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_holdback LE-container_rank_default:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M873.21484375,1026L873.21484375,1030.1666666666667C873.21484375,1034.3333333333333,873.21484375,1042.6666666666667,873.21484375,1051C873.21484375,1059.3333333333333,873.21484375,1067.6666666666667,873.21484375,1071.8333333333333L873.21484375,1076" id="L-content_promotion:apply-content_holdback-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_promotion:apply LE-content_holdback" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M766.638671875,1204L766.638671875,1208.1666666666667C766.638671875,1212.3333333333333,766.638671875,1220.6666666666667,766.638671875,1229C766.638671875,1237.3333333333333,766.638671875,1245.6666666666667,766.638671875,1249.8333333333333L766.638671875,1254" id="L-container_rank_default:apply-matrix_bd_levers-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_rank_default:apply LE-matrix_bd_levers" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M766.638671875,1293L766.638671875,1297.1666666666667C766.638671875,1301.3333333333333,766.638671875,1309.6666666666667,766.638671875,1318C766.638671875,1326.3333333333333,766.638671875,1334.6666666666667,766.638671875,1338.8333333333333L766.638671875,1343" id="L-matrix_bd_levers-container_floating_i18n-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-matrix_bd_levers LE-container_floating_i18n" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M730.5785639044943,1382L722.8734126287453,1386.1666666666667C715.1682613529962,1390.3333333333333,699.7579588014981,1398.6666666666667,692.052807525749,1410.25C684.34765625,1421.8333333333333,684.34765625,1436.6666666666667,684.34765625,1451.5C684.34765625,1466.3333333333333,684.34765625,1481.1666666666667,684.34765625,1496C684.34765625,1510.8333333333333,684.34765625,1525.6666666666667,684.34765625,1540.5C684.34765625,1555.3333333333333,684.34765625,1570.1666666666667,684.34765625,1581.75C684.34765625,1593.3333333333333,684.34765625,1601.6666666666667,684.34765625,1605.8333333333333L684.34765625,1610" id="L-container_floating_i18n-image_rank_specific-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_floating_i18n LE-image_rank_specific" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M802.6987798455057,1382L810.4039311212547,1386.1666666666667C818.1090823970038,1390.3333333333333,833.5193849485019,1398.6666666666667,841.224536224251,1407C848.9296875,1415.3333333333333,848.9296875,1423.6666666666667,848.9296875,1427.8333333333333L848.9296875,1432" id="L-container_floating_i18n-container_truncate-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_floating_i18n LE-container_truncate" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M848.9296875,1471L848.9296875,1475.1666666666667C848.9296875,1479.3333333333333,848.9296875,1487.6666666666667,848.9296875,1496C848.9296875,1504.3333333333333,848.9296875,1512.6666666666667,848.9296875,1516.8333333333333L848.9296875,1521" id="L-container_truncate-content_truncate-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-container_truncate LE-content_truncate" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M848.9296875,1560L848.9296875,1564.1666666666667C848.9296875,1568.3333333333333,848.9296875,1576.6666666666667,848.9296875,1585C848.9296875,1593.3333333333333,848.9296875,1601.6666666666667,848.9296875,1605.8333333333333L848.9296875,1610" id="L-content_truncate-dedupe-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-content_truncate LE-dedupe" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M684.34765625,1649L684.34765625,1653.1666666666667C684.34765625,1657.3333333333333,684.34765625,1665.6666666666667,692.052807525749,1674C699.7579588014981,1682.3333333333333,715.1682613529962,1690.6666666666667,722.8734126287453,1694.8333333333333L730.5785639044943,1699" id="L-image_rank_specific-image_rank_specific:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-image_rank_specific LE-image_rank_specific:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path><path d="M848.9296875,1649L848.9296875,1653.1666666666667C848.9296875,1657.3333333333333,848.9296875,1665.6666666666667,841.224536224251,1674C833.5193849485019,1682.3333333333333,818.1090823970038,1690.6666666666667,810.4039311212547,1694.8333333333333L802.6987798455057,1699" id="L-dedupe-image_rank_specific:apply-0" class=" edge-thickness-normal edge-pattern-dotted flowchart-link LS-dedupe LE-image_rank_specific:apply" style="fill:none;stroke-width:2px;stroke-dasharray:3;" marker-end="url(#flowchart-pointEnd)"></path></g><g class="edgeLabels"><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g></g><g class="nodes"><g class="node default none clickable" id="flowchart-request_validation-1718" transform="translate(717.73046875, 27.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-74.30859375" y="-19.5" width="148.6171875" height="39"></rect><g class="label" style="" transform="translate(-66.80859375, -12)"><foreignObject width="133.6171875" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">request_validation</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-container_recall-1719" transform="translate(614.0390625, 116.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-66.17578125" y="-19.5" width="132.3515625" height="39"></rect><g class="label" style="" transform="translate(-58.67578125, -12)"><foreignObject width="117.3515625" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">container_recall</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-container_pinning_i18n-1722" transform="translate(821.421875, 116.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-91.20703125" y="-19.5" width="182.4140625" height="39"></rect><g class="label" style="" transform="translate(-83.70703125, -12)"><foreignObject width="167.4140625" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">container_pinning_i18n</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-container_recall:apply-1725" transform="translate(717.73046875, 205.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-88.53515625" y="-19.5" width="177.0703125" height="39"></rect><g class="label" style="" transform="translate(-81.03515625, -12)"><foreignObject width="162.0703125" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">container_recall:apply</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-aggregate_ranking_trending-1730" transform="translate(138.23828125, 294.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-107.87890625" y="-19.5" width="215.7578125" height="39"></rect><g class="label" style="" transform="translate(-100.37890625, -12)"><foreignObject width="200.7578125" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">aggregate_ranking_trending</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-featured_rank_default-1733" transform="translate(406.96484375, 383.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-88.48828125" y="-19.5" width="176.9765625" height="39"></rect><g class="label" style="" transform="translate(-80.98828125, -12)"><foreignObject width="161.9765625" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">featured_rank_default</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_recall_genesis-1736" transform="translate(594.04296875, 472.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-89.8203125" y="-19.5" width="179.640625" height="39"></rect><g class="label" style="" transform="translate(-82.3203125, -12)"><foreignObject width="164.640625" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_recall_genesis</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_rank_default-1739" transform="translate(780.140625, 561.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-85.1953125" y="-19.5" width="170.390625" height="39"></rect><g class="label" style="" transform="translate(-77.6953125, -12)"><foreignObject width="155.390625" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_rank_default</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_rank_context-1742" transform="translate(962.341796875, 650.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-86.65234375" y="-19.5" width="173.3046875" height="39"></rect><g class="label" style="" transform="translate(-79.15234375, -12)"><foreignObject width="158.3046875" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_rank_context</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_rank_specific-1745" transform="translate(1146.080078125, 739.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-86.8125" y="-19.5" width="173.625" height="39"></rect><g class="label" style="" transform="translate(-79.3125, -12)"><foreignObject width="158.625" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_rank_specific</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-aggregate_ranking_trending:apply-1748" transform="translate(138.23828125, 383.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-130.23828125" y="-19.5" width="260.4765625" height="39"></rect><g class="label" style="" transform="translate(-122.73828125, -12)"><foreignObject width="245.4765625" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">aggregate_ranking_trending:apply</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-featured_rank_default:apply-1751" transform="translate(272.6015625, 472.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-110.84765625" y="-19.5" width="221.6953125" height="39"></rect><g class="label" style="" transform="translate(-103.34765625, -12)"><foreignObject width="206.6953125" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">featured_rank_default:apply</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_recall_genesis:apply-1756" transform="translate(397.935546875, 561.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-112.1796875" y="-19.5" width="224.359375" height="39"></rect><g class="label" style="" transform="translate(-104.6796875, -12)"><foreignObject width="209.359375" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_recall_genesis:apply</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_rank_default:apply-1761" transform="translate(521.623046875, 650.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-107.5546875" y="-19.5" width="215.109375" height="39"></rect><g class="label" style="" transform="translate(-100.0546875, -12)"><foreignObject width="200.109375" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_rank_default:apply</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_rank_context:apply-1766" transform="translate(643.7265625, 739.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-109.01171875" y="-19.5" width="218.0234375" height="39"></rect><g class="label" style="" transform="translate(-101.51171875, -12)"><foreignObject width="203.0234375" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_rank_context:apply</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_rank_specific:apply-1771" transform="translate(766.638671875, 828.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-109.171875" y="-19.5" width="218.34375" height="39"></rect><g class="label" style="" transform="translate(-101.671875, -12)"><foreignObject width="203.34375" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_rank_specific:apply</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_promotion-1776" transform="translate(873.21484375, 917.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-76.30859375" y="-19.5" width="152.6171875" height="39"></rect><g class="label" style="" transform="translate(-68.80859375, -12)"><foreignObject width="137.6171875" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_promotion</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-container_rank_default-1779" transform="translate(660.0625, 1095.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-91.6171875" y="-19.5" width="183.234375" height="39"></rect><g class="label" style="" transform="translate(-84.1171875, -12)"><foreignObject width="168.234375" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">container_rank_default</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_promotion:apply-1782" transform="translate(873.21484375, 1006.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-98.66796875" y="-19.5" width="197.3359375" height="39"></rect><g class="label" style="" transform="translate(-91.16796875, -12)"><foreignObject width="182.3359375" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_promotion:apply</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-container_rank_default:apply-1785" transform="translate(766.638671875, 1184.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-113.9765625" y="-19.5" width="227.953125" height="39"></rect><g class="label" style="" transform="translate(-106.4765625, -12)"><foreignObject width="212.953125" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">container_rank_default:apply</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_holdback-1788" transform="translate(873.21484375, 1095.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-71.53515625" y="-19.5" width="143.0703125" height="39"></rect><g class="label" style="" transform="translate(-64.03515625, -12)"><foreignObject width="128.0703125" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_holdback</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-matrix_bd_levers-1793" transform="translate(766.638671875, 1273.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-69.5703125" y="-19.5" width="139.140625" height="39"></rect><g class="label" style="" transform="translate(-62.0703125, -12)"><foreignObject width="124.140625" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">matrix_bd_levers</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-container_floating_i18n-1796" transform="translate(766.638671875, 1362.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-92.7109375" y="-19.5" width="185.421875" height="39"></rect><g class="label" style="" transform="translate(-85.2109375, -12)"><foreignObject width="170.421875" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">container_floating_i18n</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-image_rank_specific-1799" transform="translate(684.34765625, 1629.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-80.61328125" y="-19.5" width="161.2265625" height="39"></rect><g class="label" style="" transform="translate(-73.11328125, -12)"><foreignObject width="146.2265625" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">image_rank_specific</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-container_truncate-1802" transform="translate(848.9296875, 1451.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-76.54296875" y="-19.5" width="153.0859375" height="39"></rect><g class="label" style="" transform="translate(-69.04296875, -12)"><foreignObject width="138.0859375" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">container_truncate</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-content_truncate-1805" transform="translate(848.9296875, 1540.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-70.12109375" y="-19.5" width="140.2421875" height="39"></rect><g class="label" style="" transform="translate(-62.62109375, -12)"><foreignObject width="125.2421875" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">content_truncate</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-dedupe-1808" transform="translate(848.9296875, 1629.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-33.96875" y="-19.5" width="67.9375" height="39"></rect><g class="label" style="" transform="translate(-26.46875, -12)"><foreignObject width="52.9375" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">dedupe</span></div></foreignObject></g></g><g class="node default none clickable clickable" id="flowchart-image_rank_specific:apply-1811" transform="translate(766.638671875, 1718.5)"><rect class="basic label-container" style="" rx="5" ry="5" x="-102.97265625" y="-19.5" width="205.9453125" height="39"></rect><g class="label" style="" transform="translate(-95.47265625, -12)"><foreignObject width="190.9453125" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">image_rank_specific:apply</span></div></foreignObject></g></g></g></g></g></svg>
load("internal/pipeline/data/dag.star", "node", "edge", "is_runnable", "sequence", "before")
load("internal/pipeline/data/ops.star", "content_holdback", "ranking", "batch_ranking", "realtime_ranking",
"container_pinning", "apply_node")
load("internal/pipeline/data/predicates.star", "is_returning_user", "is_new_user")
def container_pinning_i18n_predicate(req):
return req.first_seen - time.now() > time.day(3)
def main(args):
request_validation = node("request_validation", "validation")
container_recall = realtime_ranking("container_recall",
"container_recall_only_recommender",
app="CONTAINER_RECALL",
predicate=lambda req: len(req.containers) > 40)
container_pin = container_pinning("container_pinning_i18n", ["featured", "recommended_for_you"], container_pinning_i18n_predicate)
apply_container_recall = apply_node("container_recall")
before(request_validation, container_recall, container_pin)
edge(container_recall, apply_container_recall)
edge(container_pin, apply_container_recall)
stage1 = apply_container_recall
aggregate_ranking_trending = realtime_ranking("aggregate_ranking_trending", "aggregate_ranking_trending")
featured_rank_default = realtime_ranking("featured_rank_default", "new_user_default_featured_recommender")
content_recall_genesis = realtime_ranking("content_recall_genesis", "GENESIS")
content_rank_default = realtime_ranking("content_rank_default", "content_rank_default")
content_rank_context = realtime_ranking("content_rank_context", "new_user_content_recommender")
content_rank_specific = realtime_ranking("content_rank_specific", "returning_user_content_recommender")
before(stage1, aggregate_ranking_trending, featured_rank_default, content_recall_genesis, content_rank_default,
content_rank_context, content_rank_specific)
stage2 = sequence(aggregate_ranking_trending, featured_rank_default, content_recall_genesis, content_rank_default,
content_rank_context, content_rank_specific)
promoter = node("content_promotion", "promoter")
container_rank_default = realtime_ranking("container_rank_default", "container_rank_default")
# sequence(promoter, container_rank_default)
apply_promoter = apply_node(promoter)
apply_container_rank = apply_node(container_rank_default)
before(stage2, promoter, container_rank_default)
edge(promoter, apply_promoter)
edge(container_rank_default, apply_container_rank)
content_holdback = node("content_holdback", "content_holdback", ["0123"])
bd_levers = node("matrix_bd_levers", "bd_levers")
container_float = node("container_floating_i18n", "container_floating")
# edge(stage2, "content_promotion:apply")
edge("content_promotion:apply", content_holdback)
edge(content_holdback, "container_rank_default:apply")
edge("container_rank_default:apply", bd_levers)
edge(bd_levers, container_float)
stage3 = container_float
image_rank = realtime_ranking("image_rank_specific", "cb_image_rank_with_stats_v2_recommender")
container_truncate = node("container_truncate", "container_truncate")
content_truncate = node("content_truncate", "content_truncate")
dedupe = node("dedupe", "dedupe")
apply_image_rank = apply_node(image_rank)
before(stage3, image_rank)
edge(image_rank, apply_image_rank)
edge(stage3, container_truncate)
edge(container_truncate, content_truncate)
edge(content_truncate, dedupe)
edge(dedupe, apply_image_rank)
return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment