<commit_before>#!/bin/sh

set -e

  widgets=( "{\"product_id\":\"RTHGP1FCGN\",\"name\":\"Reflupper\",\"color\":\"Red\",\"size\":\"Large\",\"price\":30,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/RTHGP1FCGN.png\"}"
  "{\"product_id\":\"SVHXPAWEOD\",\"name\":\"Voonex\",\"color\":\"Green\",\"size\":\"Medium\",\"price\":12,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/SVHXPAWEOD.png\"}"
  "{\"product_id\":\"GKO1SFX04M\",\"name\":\"Jukelox\",\"color\":\"Blue\",\"size\":\"Small\",\"price\":7,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/GKO1SFX04M.png\"}"
  "{\"product_id\":\"3YIRGZ6TDW\",\"name\":\"Groopster\",\"color\":\"Yellow\",\"size\":\"Large\",\"price\":35,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/3YIRGZ6TDW.png\"}"
  "{\"product_id\":\"4OZNPBMIDR\",\"name\":\"Fapster\",\"color\":\"Orange\",\"size\":\"Medium\",\"price\":10,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/4OZNPBMIDR.png\"}"
  "{\"product_id\":\"6T2HC5MIZ9\",\"name\":\"Chaintwist\",\"color\":\"Purple\",\"size\":\"Tiny\",\"price\":3,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/6T2HC5MIZ9.png\"}"
  "{\"product_id\":\"ERZ1RMJFR3\",\"name\":\"Glozzom\",\"color\":\"Tan\",\"size\":\"Huge\",\"price\":50,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/ERZ1RMJFR3.png\"}"
  "{\"product_id\":\"0BVCLPDZ42\",\"name\":\"Chaintwist\",\"color\":\"Blue\",\"size\":\"Medium\",\"price\":12,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/0BVCLPDZ42.png\"}"
  "{\"product_id\":\"N43WV5234S\",\"name\":\"Zapster\",\"color\":\"Green\",\"size\":\"Tiny\",\"price\":3,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/N43WV5234S.png\"}"
  "{\"product_id\":\"N212QZOD9B\",\"name\":\"Pentwist\",\"color\":\"Gray\",\"size\":\"Huge\",\"price\":75,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/N212QZOD9B.png\"}"
  "{\"product_id\":\"9D76X1X0LQ\",\"name\":\"Dododox\",\"color\":\"Pink\",\"size\":\"Small\",\"price\":4,\"inventory\":5,\"preview\":\"https://s3.amazonaws.com/widgets-microservice-demo/9D76X1X0LQ.png\"}"
)

for widget in ${widgets[@]}
do
  curl -S -s -H "Content-Type: application/json" \
    -X POST -d ${widget} \
    "http://${WIDGET_SERVICE:localhost}:8030/widgets" \
    > /dev/null
    echo "new widget posted..."
done

echo "Script completed..."<commit_msg>Refactoring for Consul<commit_after>#!/bin/sh

# Create (11) new widget documents into the widget collection of the widgets database
# Script expects the WIDGET_SERVICE environment variable to be set, or defaults to localhost
# WIDGET_SERVICE a hostname or IP address of a running instance of the widget service

set -e

widgets=(
  "{\"product_id\":\"RTHGP1FCGN\",\"name\":\"Reflupper\",\"color\":\"Red\",\"size\":\"Large\",\"price\":30,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
  "{\"product_id\":\"SVHXPAWEOD\",\"name\":\"Voonex\",\"color\":\"Green\",\"size\":\"Medium\",\"price\":12,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
  "{\"product_id\":\"GKO1SFX04M\",\"name\":\"Jukelox\",\"color\":\"Blue\",\"size\":\"Small\",\"price\":7,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
  "{\"product_id\":\"3YIRGZ6TDW\",\"name\":\"Groopster\",\"color\":\"Yellow\",\"size\":\"Large\",\"price\":35,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
  "{\"product_id\":\"4OZNPBMIDR\",\"name\":\"Fapster\",\"color\":\"Orange\",\"size\":\"Medium\",\"price\":10,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
  "{\"product_id\":\"6T2HC5MIZ9\",\"name\":\"Chaintwist\",\"color\":\"Purple\",\"size\":\"Tiny\",\"price\":3,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
  "{\"product_id\":\"ERZ1RMJFR3\",\"name\":\"Glozzom\",\"color\":\"Tan\",\"size\":\"Huge\",\"price\":50,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
  "{\"product_id\":\"0BVCLPDZ42\",\"name\":\"Chaintwist\",\"color\":\"Blue\",\"size\":\"Medium\",\"price\":12,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
  "{\"product_id\":\"N43WV5234S\",\"name\":\"Zapster\",\"color\":\"Green\",\"size\":\"Tiny\",\"price\":3,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
  "{\"product_id\":\"N212QZOD9B\",\"name\":\"Pentwist\",\"color\":\"Gray\",\"size\":\"Huge\",\"price\":75,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
  "{\"product_id\":\"9D76X1X0LQ\",\"name\":\"Dododox\",\"color\":\"Pink\",\"size\":\"Small\",\"price\":4,\"inventory\":5,\"preview\":\"<no_preview_available>\"}"
)

for widget in ${widgets[@]}
do
  curl -S -s -H "Content-Type: application/json" \
    -X POST -d ${widget} \
    "http://${WIDGET_SERVICE:localhost}:8030/widgets" \
    > /dev/null
    echo "New widget posted..."
done

echo "Script completed..."
{'fraction_non_alphanumeric': 0.33883964544722, 'fraction_numerical': 0.0346494762288477, 'mean_word_length': 4.528953229398664, 'pattern_counts': {'":': 154, '<': 14, '<?xml version=': 0, '>': 16, 'https://': 11, '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': '6454199', 'n_tokens_mistral': 1968, 'n_tokens_neox': 1892, 'n_words': 121}