<commit_before>#!/bin/bash

DRAIN_ENDPOINT=<%= p('broker.drain_endpoint') %>
CELL_GUID=<%= spec.networks.send(spec.networks.methods(false).first).ip %>

if [[ -n ${DRAIN_ENDPOINT} ]]; then
  curl ${DRAIN_ENDPOINT}/admin/cells/${CELL_GUID}/demote -XPOST >/dev/null
fi

# Drain script requires printing 0 to stdout followed by a newline
echo 0
echo<commit_msg>Use spec.address in demote-cell.sh to identify cell_guid<commit_after>#!/bin/bash

DRAIN_ENDPOINT=<%= p('broker.drain_endpoint') %>
CELL_GUID=<%= spec.address %>

if [[ -n ${DRAIN_ENDPOINT} ]]; then
  curl ${DRAIN_ENDPOINT}/admin/cells/${CELL_GUID}/demote -XPOST >/dev/null
fi

# Drain script requires printing 0 to stdout followed by a newline
echo 0
echo
{'fraction_non_alphanumeric': 0.15406162464985995, 'fraction_numerical': 0.0056022408963585435, 'mean_word_length': 5.327433628318584, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3630259', 'n_tokens_mistral': 280, 'n_tokens_neox': 265, 'n_words': 61}