示例#1
0
import pandas
import pandas as pd
import sklearn
from backend import db_connection2 as db
from backend import db_connection2
import sys

conn, meta, session = db.connect("postgres", "1234",
                                 db="luther_survey")  #temp2

all = session.query(db.Process_Rate_Flex_Test_User).all()
process1 = all[1]
t_p_o = all[1].task_parameters_obj
print t_p_o.body_of_task
print t_p_o.result
evaluated_content = process1.get_content_produced_by_this_process()
content = []
for i in evaluated_content:
    if i.associated_user == None:
        continue
    if len(i.results) > 0:

        print i
        #print i.associated_user.name
        print i.associated_user.alias
        print i.associated_user.password
        if process1.is_user_content_acceptable(i) == True:
            result = 0
            if i.results == "Issue":
                result = -2
            else:
示例#2
0
import pandas
import pandas as pd
import sklearn
from backend import db_connection2 as db
from backend import db_connection2
import sys

conn, meta, session = db.connect("postgres", "1234", db="match_girl") #temp2

all_text_manipulations=session.query(db.Process_Text_Manipulation).all()

top_level=session.query(db.Process_Text_Manipulation).filter(db.Process_Text_Manipulation.id==90).all()
#get result - result.result
result=top_level.get_final_results()[0]
right_node=top_level.task_parameters_obj.context
p_id=top_level.task_parameters_obj.context.process_that_selected_this_content_id
next_level=session.query(db.Process_Text_Manipulation).filter(db.Process_Text_Manipulation.id==p_id).all()[0]

next_right_node=next_level.task_parameters_obj.context
from python_query_aws import script_current_task_results
from python_query_aws import script_turk_performance
from sqlalchemy import desc
from backend import db_connection2 as db
from class_turk_performance_default import Turk_Performance_Default
from python_query_aws.env_info import Environment_Info
import boto3

db_name = "Task_Crowd_Source_Test"


conn, meta, session = db.connect("postgres", "1234", db=db_name)

keys = Environment_Info.static_get_special_code()
endpoint_type = "live"
client_session_turk = boto3.Session(profile_name=None)

client = client_session_turk.client(
    service_name='mturk',
    region_name='us-east-1',
    endpoint_url=Environment_Info.environments[endpoint_type]['endpoint'],
    aws_access_key_id=keys["aws_access_key_id"],
    aws_secret_access_key=keys["aws_secret_access_key"]
)

results = script_current_task_results.get_active_users_in_latest_task(0, endpoint_type)

recent_performance= script_turk_performance.get_recently_submitted_results(session, results, max_results=2, time_offset=14395.592572)


name=recent_performance[0]["user"]
示例#4
0
import pandas
import pandas as pd
import sklearn
from backend import db_connection2 as db
from backend import db_connection2
import sys

conn, meta, session = db.connect("postgres", "1234", db="sedaris_2")  #temp2

all_text_manipulations = session.query(db.Process_Text_Manipulation).all()

top_level = session.query(db.Process_Text_Manipulation).filter(
    db.Process_Text_Manipulation.id == 127).all()[0]
#get result - result.result
result = top_level.get_final_results()[0]
right_node = top_level.task_parameters_obj.context
p_id = top_level.task_parameters_obj.context.process_that_selected_this_content_id
next_level = session.query(db.Process_Text_Manipulation).filter(
    db.Process_Text_Manipulation.id == p_id).all()[0]

next_right_node = next_level.task_parameters_obj.context

top_level = session.query(db.Process_Text_Manipulation).filter(
    db.Process_Text_Manipulation.id == 127).all()[0]

base_case = []
base_case.append(top_level)
all_levels = []
current_case = base_case
while len(current_case) > 0:
    all_levels.append(current_case)