<commit_before>import qualified Consumer                 as C
import           Control.Concurrent.Async
import           Data.Bits
import           Data.Int
import           Examples
import           Ops
import           Prelude
import qualified Producer                 as P
import           System.Environment
import           TestUtils

--Debug
import           System.Random

usage :: IO()
usage = putStrLn "Enter producer or consumer"

doArgs :: [String] -> IO()
doArgs ("producer":_) = do
    res <- P.doWithoutSocket (test8, testb8) (myEditDist 4 1)
    print res
doArgs ("consumer":_) = do
    res <- C.doWithoutSocket (test8, testb8) (myEditDist 4 1)
    print res
doArgs ("both":a) = do
    hcsoc <- async C.getSocket
    hpsoc <- async P.getSocket
    csoc <- wait hcsoc
    psoc <- wait hpsoc
    let test = jbDist
    case a of
      [] -> printTest (csoc, psoc) (1::Int8,3::Int8) (test 2 2)
      [x] -> printTest (csoc, psoc) (1::Int8,3::Int8) (test (read x)  (read x))
      x:y:_ -> printTest (csoc, psoc) (1::Int8,3::Int8) (test (read x) (read y))

doArgs _ = usage

main :: IO()
main = do
    args <- getArgs
    doArgs args
<commit_msg>removed random<commit_after>import qualified Consumer                 as C
import           Control.Concurrent.Async
import           Data.Bits
import           Data.Int
import           Examples
import           Ops
import           Prelude
import qualified Producer                 as P
import           System.Environment
import           TestUtils


usage :: IO()
usage = putStrLn "Enter producer or consumer"

doArgs :: [String] -> IO()
doArgs ("producer":_) = do
    res <- P.doWithoutSocket (test8, testb8) (myEditDist 4 1)
    print res
doArgs ("consumer":_) = do
    res <- C.doWithoutSocket (test8, testb8) (myEditDist 4 1)
    print res
doArgs ("both":a) = do
    hcsoc <- async C.getSocket
    hpsoc <- async P.getSocket
    csoc <- wait hcsoc
    psoc <- wait hpsoc
    let test = jbDist
    case a of
      [] -> printTest (csoc, psoc) (1::Int8,3::Int8) (test 2 2)
      [x] -> printTest (csoc, psoc) (1::Int8,3::Int8) (test (read x)  (read x))
      x:y:_ -> printTest (csoc, psoc) (1::Int8,3::Int8) (test (read x) (read y))

doArgs _ = usage

main :: IO()
main = do
    args <- getArgs
    doArgs args

{'fraction_non_alphanumeric': 0.11741424802110818, 'fraction_numerical': 0.019349164467897976, 'mean_word_length': 2.204225352112676, 'pattern_counts': {'":': 6, '<': 17, '<?xml version=': 0, '>': 11, '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': '5182813', 'n_tokens_mistral': 781, 'n_tokens_neox': 748, 'n_words': 242}