neuroscout/utils/db.py
def dump_predictor_events(predictor_ids, run_ids=None, stimulus_timing=False):
    """ Query & serialize PredictorEvents, for both Raw and Extracted
    Predictors (which require creating PEs from EEs)
    """

    # Query Predictors
    all_preds = Predictor.query.filter(Predictor.id.in_(predictor_ids))

    # Separate raw and extracted predictors
    raw_pred_ids = [p.id for p in all_preds.filter_by(ef_id=None)]
    ext_preds = Predictor.query.filter(
        Predictor.id.in_(set(predictor_ids) - set(raw_pred_ids)))

    # Query & dump raw PEs
    pes = PredictorEvent.query.filter(
        (PredictorEvent.predictor_id.in_(raw_pred_ids)))
    if run_ids is not None:
        pes = pes.filter((PredictorEvent.run_id.in_(run_ids)))

    pes = dump_pe(pes)

    # Create & dump Extracted PEs
    pes += create_pes(ext_preds, run_ids, stimulus_timing=stimulus_timing)
    return pes
 Query & serialize PredictorEvents, for both Raw and Extracted
    Predictors (which require creating PEs from EEs)
    
Query & serialize PredictorEvents, for both Raw and Extracted
Predictors (which require creating PEs from EEs)
Query & serialize PredictorEvents for both Raw and Extracted Predictors ( which require creating PEs from EEs )
def dump_predictor_events(predictor_ids, run_ids=None, stimulus_timing=False):
    all_preds = Predictor.query.filter(Predictor.id.in_(predictor_ids))
    raw_pred_ids = [p.id for p in all_preds.filter_by(ef_id=None)]
    ext_preds = Predictor.query.filter(
        Predictor.id.in_(set(predictor_ids) - set(raw_pred_ids)))
    pes = PredictorEvent.query.filter(
        (PredictorEvent.predictor_id.in_(raw_pred_ids)))
    if run_ids is not None:
        pes = pes.filter((PredictorEvent.run_id.in_(run_ids)))
    pes = dump_pe(pes)
    pes += create_pes(ext_preds, run_ids, stimulus_timing=stimulus_timing)
    return pes
def dump_predictor_events ( predictor_ids , run_ids = None , stimulus_timing = False ) : all_preds = Predictor . query . filter ( Predictor . id . in_ ( predictor_ids ) ) raw_pred_ids = [ p . id for p in all_preds . filter_by ( ef_id = None ) ] ext_preds = Predictor . query . filter ( Predictor . id . in_ ( set ( predictor_ids ) - set ( raw_pred_ids ) ) ) pes = PredictorEvent . query . filter ( ( PredictorEvent . predictor_id . in_ ( raw_pred_ids ) ) ) if run_ids is not None : pes = pes . filter ( ( PredictorEvent . run_id . in_ ( run_ids ) ) ) pes = dump_pe ( pes ) pes += create_pes ( ext_preds , run_ids , stimulus_timing = stimulus_timing ) return pes
Query & serialize PredictorEvents, for both Raw and Extracted
Predictors (which require creating PEs from EEs)
Query & serialize PredictorEvents for both Raw and Extracted Predictors ( which require creating PEs from EEs )
""" Query & serialize PredictorEvents, for both Raw and Extracted
    Predictors (which require creating PEs from EEs)
    """ # Query Predictors # Separate raw and extracted predictors # Query & dump raw PEs # Create & dump Extracted PEs
predictor_ids
run_ids
stimulus_timing