<commit_before>#!/usr/bin/python2.5

# Test the examples to make sure they are not broken

import os
import re
import transitfeed
import unittest
import urllib
import util

class WikiExample(util.TempDirTestCaseBase):
  # Download example from wiki and run it
  def runTest(self):
    wiki_source = urllib.urlopen(
        'http://googletransitdatafeed.googlecode.com/svn/wiki/TransitFeed.wiki'
        ).read()
    m = re.search(r'{{{(.*import transitfeed.*)}}}', wiki_source, re.DOTALL)
    if not m:
      raise Exception("Failed to find source code on wiki page")
    wiki_code = m.group(1)
    exec wiki_code


class shuttle_from_xmlfeed(util.TempDirTestCaseBase):
  def runTest(self):
    self.CheckCallWithPath(
        [self.GetExamplePath('shuttle_from_xmlfeed.py'),<commit_msg>Fix failing unit test due to change in example source code location.<commit_after>#!/usr/bin/python2.5

# Test the examples to make sure they are not broken

import os
import re
import transitfeed
import unittest
import urllib
import util

class WikiExample(util.TempDirTestCaseBase):
  # Download example from wiki and run it
  def runTest(self):
    wiki_source = urllib.urlopen(
      'https://raw.githubusercontent.com/wiki/google/transitfeed/TransitFeed.md'
    ).read()
    m = re.search(r'```\s*(import transitfeed.*)```', wiki_source, re.DOTALL)
    if not m:
      raise Exception("Failed to find source code on wiki page")
    wiki_code = m.group(1)
    print wiki_code
    exec wiki_code


class shuttle_from_xmlfeed(util.TempDirTestCaseBase):
  def runTest(self):
    self.CheckCallWithPath(
        [self.GetExamplePath('shuttle_from_xmlfeed.py'),
{'fraction_non_alphanumeric': 0.10200364298724955, 'fraction_numerical': 0.0036429872495446266, 'mean_word_length': 3.993939393939394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5408469', 'n_tokens_mistral': 544, 'n_tokens_neox': 521, 'n_words': 142}