<commit_before>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "targetFileName = \"SHOW_ENTITY_TEST_CASE_1.txt\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    ""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2.0
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}<commit_msg>Show entity module : show entity tags value<commit_after>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "targetFileName = \"SHOW_ENTITY_TEST_CASE_1.txt\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "total 16\r\n-rw-r--r--  1 stories2  staff  1068 Jul 15 12:29 LICENSE\r\n-rw-r--r--  1 stories2  staff  2031 Jul 15 12:28 README.md\r\ndrwxr-xr-x  6 stories2  staff   204 Jul 16 10:19 \u001b[34mTests\u001b[m\u001b[m/\r\n"
     ]
    }
   ],
   "source": [
    "ls -l"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "hearthStoneLogFile = open(\"Tests/Data/\" + targetFileName)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "showEntityDetected = False\n",
    "NOT_AVAILABLE = -1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tag =  PREMIUM value =  0\ntag =  DAMAGE value =  0\ntag =  HEALTH value =  7\ntag =  ATK value =  6\ntag =  COST value =  6\ntag =  ZONE value =  H\ntag =  CONTROLLER value =  1\ntag =  ENTITY_ID value =  2\ntag =  SILENCED value =  0\ntag =  WINDFURY value =  0\ntag =  TAUNT value =  0\ntag =  STEALTH value =  0\ntag =  DIVINE_SHIELD value =  0\ntag =  CHARGE value =  0\ntag =  CARDTYPE value =  M\ntag =  RARITY value =  F\ntag =  FROZEN value =  0\ntag =  ZONE_POSITION value =  0\ntag =  NUM_ATTACKS_THIS_TURN value =  0\ntag =  FORCED_PLAY value =  0\ntag =  TO_BE_DESTROYED value =  0\ntag =  POISONOUS value =  0\ntag =  CUSTOM_KEYWORD_EFFECT value =  0\ntag =  EXTRA_ATTACKS_THIS_TURN value =  0\ntag =  TAG_LAST_KNOWN_COST_IN_HAND value =  6\ntag =  478 value =  1\ntag =  479 value =  6\n"
     ]
    }
   ],
   "source": [
    "while True:\n",
    "    indexOfLog = hearthStoneLogFile.readline()\n",
    "    \n",
    "    if not indexOfLog :\n",
    "        break\n",
    "        \n",
    "    if showEntityDetected == True:\n",
    "        \n",
    "        if indexOfLog.find(\" -         tag=\") == NOT_AVAILABLE:\n",
    "            showEntityDetected = False\n",
    "        \n",
    "    if showEntityDetected == True:\n",
    "        foundedGroup = re.search(\"tag=(.+?) value=(.+?)\", indexOfLog)\n",
    "        if foundedGroup:\n",
    "            print \"tag = \", foundedGroup.group(1), \"value = \", foundedGroup.group(2)\n",
    "        \n",
    "    if indexOfLog.find(\"SHOW_ENTITY\") != NOT_AVAILABLE:\n",
    "        showEntityDetected = True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "hearthStoneLogFile.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    ""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2.0
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
{'fraction_non_alphanumeric': 0.19541509014021813, 'fraction_numerical': 0.02626307589583797, 'mean_word_length': 2.3562359970126963, 'pattern_counts': {'":': 95, '<': 3, '<?xml version=': 0, '>': 3, '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': '903305', 'n_tokens_mistral': 1907, 'n_tokens_neox': 1805, 'n_words': 324}