{"action":"created","comment":{"url":"https://api.github.com/repos/sigopt/sigopt-python/pulls/comments/52819748","id":52819748,"diff_hunk":"@@ -0,0 +1,57 @@\n+import argparse\n+import os\n+from subprocess import PIPE, Popen\n+\n+# insert your client_token into sigopt_creds.py\n+# otherwise you'll see \"This endpoint requires an authenticated user\" errors\n+from sigopt_creds import client_token\n+\n+from sigopt.interface import Connection\n+\n+class SubProcessEvaluator(object):\n+  def __init__(self, filename):\n+    assert os.path.isfile(filename)\n+    self.filename = filename\n+\n+  # Take a suggestion from sigopt and evaluate your function\n+  # Sends command line arguments to your executable file with the same names as the\n+  # parameters of your experiment. Expected output is one line containing a float that\n+  # is your function evaluated at the suggested assignments.\n+  # For example, if your filename is test and you have one double parameter with suggested\n+  # value 11.05, this script will run\n+  #         ./test --x=11.05\n+  def evaluate_metric(self, assignments):\n+    arguments = [\n+      '--{}={}'.format(param_name, assignment)\n+      for param_name, assignment\n+      in assignments.to_json().iteritems()\n+    ]\n+    process = Popen(['./{}'.format(self.filename)] + arguments, stdout=PIPE)\n+    (stdoutdata,stderrdata) = process.communicate()","path":"examples/other_languages.py","position":null,"original_position":30,"commit_id":"1e6a00b4a29cffb622154a8d177831bd1ef78191","original_commit_id":"d831e715bfe188dc4472f0274ea2082f4daa1363","user":{"login":"alexandraj777","id":913838,"avatar_url":"https://avatars.githubusercontent.com/u/913838?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandraj777","html_url":"https://github.com/alexandraj777","followers_url":"https://api.github.com/users/alexandraj777/followers","following_url":"https://api.github.com/users/alexandraj777/following{/other_user}","gists_url":"https://api.github.com/users/alexandraj777/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandraj777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandraj777/subscriptions","organizations_url":"https://api.github.com/users/alexandraj777/orgs","repos_url":"https://api.github.com/users/alexandraj777/repos","events_url":"https://api.github.com/users/alexandraj777/events{/privacy}","received_events_url":"https://api.github.com/users/alexandraj777/received_events","type":"User","site_admin":false},"body":"yeah","created_at":"2016-02-13T01:30:55Z","updated_at":"2016-02-13T01:30:55Z","html_url":"https://github.com/sigopt/sigopt-python/pull/29#discussion_r52819748","pull_request_url":"https://api.github.com/repos/sigopt/sigopt-python/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/sigopt/sigopt-python/pulls/comments/52819748"},"html":{"href":"https://github.com/sigopt/sigopt-python/pull/29#discussion_r52819748"},"pull_request":{"href":"https://api.github.com/repos/sigopt/sigopt-python/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/sigopt/sigopt-python/pulls/29","id":59248623,"html_url":"https://github.com/sigopt/sigopt-python/pull/29","diff_url":"https://github.com/sigopt/sigopt-python/pull/29.diff","patch_url":"https://github.com/sigopt/sigopt-python/pull/29.patch","issue_url":"https://api.github.com/repos/sigopt/sigopt-python/issues/29","number":29,"state":"open","locked":false,"title":"Subprocess evaluator","user":{"login":"alexandraj777","id":913838,"avatar_url":"https://avatars.githubusercontent.com/u/913838?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandraj777","html_url":"https://github.com/alexandraj777","followers_url":"https://api.github.com/users/alexandraj777/followers","following_url":"https://api.github.com/users/alexandraj777/following{/other_user}","gists_url":"https://api.github.com/users/alexandraj777/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandraj777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandraj777/subscriptions","organizations_url":"https://api.github.com/users/alexandraj777/orgs","repos_url":"https://api.github.com/users/alexandraj777/repos","events_url":"https://api.github.com/users/alexandraj777/events{/privacy}","received_events_url":"https://api.github.com/users/alexandraj777/received_events","type":"User","site_admin":false},"body":"cc @pfhayes @sc932 \r\nMaking it easier to people to write files in other languages.","created_at":"2016-02-13T00:01:16Z","updated_at":"2016-02-13T01:30:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5d5668fdae616ece49e30f1b7f0d4c0799b30e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sigopt/sigopt-python/pulls/29/commits","review_comments_url":"https://api.github.com/repos/sigopt/sigopt-python/pulls/29/comments","review_comment_url":"https://api.github.com/repos/sigopt/sigopt-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sigopt/sigopt-python/issues/29/comments","statuses_url":"https://api.github.com/repos/sigopt/sigopt-python/statuses/1e6a00b4a29cffb622154a8d177831bd1ef78191","head":{"label":"sigopt:subprocess-evaluator","ref":"subprocess-evaluator","sha":"1e6a00b4a29cffb622154a8d177831bd1ef78191","user":{"login":"sigopt","id":8949269,"avatar_url":"https://avatars.githubusercontent.com/u/8949269?v=3","gravatar_id":"","url":"https://api.github.com/users/sigopt","html_url":"https://github.com/sigopt","followers_url":"https://api.github.com/users/sigopt/followers","following_url":"https://api.github.com/users/sigopt/following{/other_user}","gists_url":"https://api.github.com/users/sigopt/gists{/gist_id}","starred_url":"https://api.github.com/users/sigopt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigopt/subscriptions","organizations_url":"https://api.github.com/users/sigopt/orgs","repos_url":"https://api.github.com/users/sigopt/repos","events_url":"https://api.github.com/users/sigopt/events{/privacy}","received_events_url":"https://api.github.com/users/sigopt/received_events","type":"Organization","site_admin":false},"repo":{"id":28167955,"name":"sigopt-python","full_name":"sigopt/sigopt-python","owner":{"login":"sigopt","id":8949269,"avatar_url":"https://avatars.githubusercontent.com/u/8949269?v=3","gravatar_id":"","url":"https://api.github.com/users/sigopt","html_url":"https://github.com/sigopt","followers_url":"https://api.github.com/users/sigopt/followers","following_url":"https://api.github.com/users/sigopt/following{/other_user}","gists_url":"https://api.github.com/users/sigopt/gists{/gist_id}","starred_url":"https://api.github.com/users/sigopt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigopt/subscriptions","organizations_url":"https://api.github.com/users/sigopt/orgs","repos_url":"https://api.github.com/users/sigopt/repos","events_url":"https://api.github.com/users/sigopt/events{/privacy}","received_events_url":"https://api.github.com/users/sigopt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sigopt/sigopt-python","description":"Simple Python interface for the SigOpt API","fork":false,"url":"https://api.github.com/repos/sigopt/sigopt-python","forks_url":"https://api.github.com/repos/sigopt/sigopt-python/forks","keys_url":"https://api.github.com/repos/sigopt/sigopt-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sigopt/sigopt-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sigopt/sigopt-python/teams","hooks_url":"https://api.github.com/repos/sigopt/sigopt-python/hooks","issue_events_url":"https://api.github.com/repos/sigopt/sigopt-python/issues/events{/number}","events_url":"https://api.github.com/repos/sigopt/sigopt-python/events","assignees_url":"https://api.github.com/repos/sigopt/sigopt-python/assignees{/user}","branches_url":"https://api.github.com/repos/sigopt/sigopt-python/branches{/branch}","tags_url":"https://api.github.com/repos/sigopt/sigopt-python/tags","blobs_url":"https://api.github.com/repos/sigopt/sigopt-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sigopt/sigopt-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sigopt/sigopt-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/sigopt/sigopt-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sigopt/sigopt-python/statuses/{sha}","languages_url":"https://api.github.com/repos/sigopt/sigopt-python/languages","stargazers_url":"https://api.github.com/repos/sigopt/sigopt-python/stargazers","contributors_url":"https://api.github.com/repos/sigopt/sigopt-python/contributors","subscribers_url":"https://api.github.com/repos/sigopt/sigopt-python/subscribers","subscription_url":"https://api.github.com/repos/sigopt/sigopt-python/subscription","commits_url":"https://api.github.com/repos/sigopt/sigopt-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/sigopt/sigopt-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/sigopt/sigopt-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/sigopt/sigopt-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/sigopt/sigopt-python/contents/{+path}","compare_url":"https://api.github.com/repos/sigopt/sigopt-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sigopt/sigopt-python/merges","archive_url":"https://api.github.com/repos/sigopt/sigopt-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sigopt/sigopt-python/downloads","issues_url":"https://api.github.com/repos/sigopt/sigopt-python/issues{/number}","pulls_url":"https://api.github.com/repos/sigopt/sigopt-python/pulls{/number}","milestones_url":"https://api.github.com/repos/sigopt/sigopt-python/milestones{/number}","notifications_url":"https://api.github.com/repos/sigopt/sigopt-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sigopt/sigopt-python/labels{/name}","releases_url":"https://api.github.com/repos/sigopt/sigopt-python/releases{/id}","deployments_url":"https://api.github.com/repos/sigopt/sigopt-python/deployments","created_at":"2014-12-18T04:16:14Z","updated_at":"2016-02-03T08:31:15Z","pushed_at":"2016-02-13T01:30:14Z","git_url":"git://github.com/sigopt/sigopt-python.git","ssh_url":"git@github.com:sigopt/sigopt-python.git","clone_url":"https://github.com/sigopt/sigopt-python.git","svn_url":"https://github.com/sigopt/sigopt-python","homepage":null,"size":88,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":8,"default_branch":"master"}},"base":{"label":"sigopt:master","ref":"master","sha":"98400a0292ff85f501a69aae40f07bb252a796fa","user":{"login":"sigopt","id":8949269,"avatar_url":"https://avatars.githubusercontent.com/u/8949269?v=3","gravatar_id":"","url":"https://api.github.com/users/sigopt","html_url":"https://github.com/sigopt","followers_url":"https://api.github.com/users/sigopt/followers","following_url":"https://api.github.com/users/sigopt/following{/other_user}","gists_url":"https://api.github.com/users/sigopt/gists{/gist_id}","starred_url":"https://api.github.com/users/sigopt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigopt/subscriptions","organizations_url":"https://api.github.com/users/sigopt/orgs","repos_url":"https://api.github.com/users/sigopt/repos","events_url":"https://api.github.com/users/sigopt/events{/privacy}","received_events_url":"https://api.github.com/users/sigopt/received_events","type":"Organization","site_admin":false},"repo":{"id":28167955,"name":"sigopt-python","full_name":"sigopt/sigopt-python","owner":{"login":"sigopt","id":8949269,"avatar_url":"https://avatars.githubusercontent.com/u/8949269?v=3","gravatar_id":"","url":"https://api.github.com/users/sigopt","html_url":"https://github.com/sigopt","followers_url":"https://api.github.com/users/sigopt/followers","following_url":"https://api.github.com/users/sigopt/following{/other_user}","gists_url":"https://api.github.com/users/sigopt/gists{/gist_id}","starred_url":"https://api.github.com/users/sigopt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigopt/subscriptions","organizations_url":"https://api.github.com/users/sigopt/orgs","repos_url":"https://api.github.com/users/sigopt/repos","events_url":"https://api.github.com/users/sigopt/events{/privacy}","received_events_url":"https://api.github.com/users/sigopt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sigopt/sigopt-python","description":"Simple Python interface for the SigOpt API","fork":false,"url":"https://api.github.com/repos/sigopt/sigopt-python","forks_url":"https://api.github.com/repos/sigopt/sigopt-python/forks","keys_url":"https://api.github.com/repos/sigopt/sigopt-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sigopt/sigopt-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sigopt/sigopt-python/teams","hooks_url":"https://api.github.com/repos/sigopt/sigopt-python/hooks","issue_events_url":"https://api.github.com/repos/sigopt/sigopt-python/issues/events{/number}","events_url":"https://api.github.com/repos/sigopt/sigopt-python/events","assignees_url":"https://api.github.com/repos/sigopt/sigopt-python/assignees{/user}","branches_url":"https://api.github.com/repos/sigopt/sigopt-python/branches{/branch}","tags_url":"https://api.github.com/repos/sigopt/sigopt-python/tags","blobs_url":"https://api.github.com/repos/sigopt/sigopt-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sigopt/sigopt-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sigopt/sigopt-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/sigopt/sigopt-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sigopt/sigopt-python/statuses/{sha}","languages_url":"https://api.github.com/repos/sigopt/sigopt-python/languages","stargazers_url":"https://api.github.com/repos/sigopt/sigopt-python/stargazers","contributors_url":"https://api.github.com/repos/sigopt/sigopt-python/contributors","subscribers_url":"https://api.github.com/repos/sigopt/sigopt-python/subscribers","subscription_url":"https://api.github.com/repos/sigopt/sigopt-python/subscription","commits_url":"https://api.github.com/repos/sigopt/sigopt-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/sigopt/sigopt-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/sigopt/sigopt-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/sigopt/sigopt-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/sigopt/sigopt-python/contents/{+path}","compare_url":"https://api.github.com/repos/sigopt/sigopt-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sigopt/sigopt-python/merges","archive_url":"https://api.github.com/repos/sigopt/sigopt-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sigopt/sigopt-python/downloads","issues_url":"https://api.github.com/repos/sigopt/sigopt-python/issues{/number}","pulls_url":"https://api.github.com/repos/sigopt/sigopt-python/pulls{/number}","milestones_url":"https://api.github.com/repos/sigopt/sigopt-python/milestones{/number}","notifications_url":"https://api.github.com/repos/sigopt/sigopt-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sigopt/sigopt-python/labels{/name}","releases_url":"https://api.github.com/repos/sigopt/sigopt-python/releases{/id}","deployments_url":"https://api.github.com/repos/sigopt/sigopt-python/deployments","created_at":"2014-12-18T04:16:14Z","updated_at":"2016-02-03T08:31:15Z","pushed_at":"2016-02-13T01:30:14Z","git_url":"git://github.com/sigopt/sigopt-python.git","ssh_url":"git@github.com:sigopt/sigopt-python.git","clone_url":"https://github.com/sigopt/sigopt-python.git","svn_url":"https://github.com/sigopt/sigopt-python","homepage":null,"size":88,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sigopt/sigopt-python/pulls/29"},"html":{"href":"https://github.com/sigopt/sigopt-python/pull/29"},"issue":{"href":"https://api.github.com/repos/sigopt/sigopt-python/issues/29"},"comments":{"href":"https://api.github.com/repos/sigopt/sigopt-python/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/sigopt/sigopt-python/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/sigopt/sigopt-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sigopt/sigopt-python/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/sigopt/sigopt-python/statuses/1e6a00b4a29cffb622154a8d177831bd1ef78191"}}}}