<commit_before><?php

require("../vendor/autoload.php");

use CrowdFlower\Account;

$apiKey = '<KEY>';

$crowd = new CrowdFlower\Account($apiKey);

//find recent jobs

// $jobs = $crowd->getJobs();
// print_r($jobs);
// print_r("\n");


//create a job with basic attributes

// $attributes = Array (
//         "title" => "Test Title",
//         "instructions" => "Here are some instructions."
//       );
// $job = $crowd->createJob($attributes);
// print_r($job);

//create a job with no attributes
// try {
//   $job = $crowd->getJob(521091);
//   //print_r($job);
// } catch (Exception $e) {
//   echo 'Caught exception: ',  $e->getMessage(), "\n";
// }
//copy the job
try {

  $basejob = $crowd->getJob('519075');
  $job = $basejob->copy();
  $job2 = $basejob->copy();

} catch (Exception $e) {
  echo 'Caught exception: ',  $e->getMessage(), "\n";
}
//update job with some attributes
try {
  $job2->setAttribute('title', 'test title for job update');
  $job2->setAttribute('instructions', 'test instructions');
  $job2->update();
  print_r($job2);
} catch (Exception $e) {
  echo 'Caught exception: ',  $e->getMessage(), "\n";
}
// delete job2
try {
  $response = $job2->delete();
  print_r($response);
} catch (Exception $e) {
  echo 'Caught exception: ',  $e->getMessage(), "\n";
}
// pause job
try {
  $response = $job->pause();
  print_r($response);
} catch (Exception $e) {
  echo 'Caught exception: ',  $e->getMessage(), "\n";
}
// resume job
try {
  $response = $job->resume();<commit_msg>playing with examples<commit_after><?php

require("../vendor/autoload.php");

use CrowdFlower\Account;

$apiKey = '<KEY>';

$crowd = new CrowdFlower\Account($apiKey);

//find recent jobs

// $jobs = $crowd->getJobs();
// print_r($jobs);
// print_r("\n");


//create a job with basic attributes

// $attributes = Array (
//         "title" => "Test Title",
//         "instructions" => "Here are some instructions."
//       );
// $job = $crowd->createJob($attributes);
// print_r($job);

//create a job with no attributes
// try {
//   $job = $crowd->getJob(521091);
//   //print_r($job);
// } catch (Exception $e) {
//   echo 'Caught exception: ',  $e->getMessage(), "\n";
// }
//copy the job
try {

  $basejob = $crowd->getJob('519075');
  $job = $basejob->copy();
  $job2 = $basejob->copy();

} catch (Exception $e) {
  echo 'Caught exception: ',  $e->getMessage(), "\n";
}
//update job with some attributes
try {
  $attributes['title'] = "test ittle yeah";
  $attributes['instructions'] = "does this work";
  $attributes['cml'] = "<p>what is this</p><cml:textarea
label='what in the world' class='' instructions='this makes no sense'
default='huh' validates='required'/>";
  $job2 = $crowd->createJob($attributes);
  print_r($job2);

} catch (Exception $e) {
  echo 'Caught exception: ',  $e->getMessage(), "\n";
}
// delete job2
try {
  $response = $job2->delete();
  print_r($response);
} catch (Exception $e) {
  echo 'Caught exception: ',  $e->getMessage(), "\n";
}
// pause job
try {
  $response = $job->pause();
  print_r($response);
} catch (Exception $e) {
  echo 'Caught exception: ',  $e->getMessage(), "\n";
}
// resume job
try {
  $response = $job->resume();
{'fraction_non_alphanumeric': 0.2222222222222222, 'fraction_numerical': 0.0113314447592068, 'mean_word_length': 3.4572230014025247, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 44, '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': '6295607', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1129, 'n_words': 274}