How to make the "return statement-related" code to become a parameter value of a function?

Here is the working code with some lines omitted for brevity.

class DataGenerator():
    def __init__(self):
        self.unique_id_list = []
        self.demographic_list = []
        self.output_list = []

    # .. some code omitted

    def create_row(self, creation_label, criteria_func, n_row_range_list):
        output_placeholder = []

        for curr_id in self.unique_id_list:
            for curr_dict in self.demographic_list:
                if curr_dict['ID'] == curr_id:
                    extracted_demographic = curr_dict

            n_iter = random.randint(n_row_range_list[0], n_row_range_list[1])

            for n in range(n_iter):
                single_output = criteria_func()
                merged_dicts = dict(extracted_demographic, **single_output)
                output_placeholder.append(merged_dicts)

        return output_placeholder

class GeneratePcRow():
    def __init__(self, icd_9_gen, service_code_gen, atc_gen):
        self.icd_9_gen = icd_9_gen
        self.service_code_gen = service_code_gen
        self.atc_gen = atc_gen

    def generate_pc_row(self):
        fake = random_setup()
        icd9_obj = self.icd_9_gen
        serviceCode_obj = self.service_code_gen
        atc_obj = self.atc_gen

        return {'PERS_CAPB_PRVD_SPEC_AD': np.random.choice(['GP', 'PSYC', 'UROL'], p=[0.4, 0.5, 0.1]),
                                                'START_DT': fake.date_between(start_date='-2y', end_date='-1y'),
                                                'END_DT': fake.date_between(start_date='-2y', end_date='-1y'),
                                                'DELV_SITE_FUNCTR_TYPE_CODE': np.random.choice(['POFF', 'IPSR', 'AMBU'], p=[0.333, 0.333, 0.334]),
                                                'ICD9': icd9_obj.create_icd9(),
                                                'SERVICE_CODE': serviceCode_obj.create_service_code(),
                                                'ATC': atc_obj.create_atc(),
                                                }   

def random_setup():
    seed = None
    random.seed(seed)
    np.random.seed(seed)
    Faker.seed(seed)
    fake = Faker()
    return fake

# Main
dg_obj = DataGenerator()
pc_gen_obj = GeneratePcRow(
                            icd_9_gen = Icd9Generator(p_three_digit_code=0.3, p_four_digit_code=0.3, p_five_digit_code=0.3, p_v_code=0.1,
                                inclusion_list=[], exclusion_list=[]),
                            service_code_gen = ServiceCodeGenerator(p_service=0.9, p_lab=0.1, exclusion_list=[12415125]),
                            atc_gen = AtcGenerator(exclusion_list=[12415125]))
pc_data_part1 = dg_obj.create_row(creation_label='PC data part 1',
                                    criteria_func=pc_gen_obj.generate_pc_row,
                                    n_row_range_list=[1, 1],
                                    )

print(pc_data_part1)

However, ideally to avoid duplication, I want to somehow move the return-context code {'PERS_CAPB_PRVD_SPEC_AD': np.random.choice(['GP', 'PSYC', 'UROL'], p=[0.4, 0.5, 0.1]), 'START_DT': fake.date_between(start_date='-2y', end_date='-1y'), 'END_DT': fake.date_between(start_date='-2y', end_date='-1y'), 'DELV_SITE_FUNCTR_TYPE_CODE': np.random.choice(['POFF', 'IPSR', 'AMBU'], p=[0.333, 0.333, 0.334]), 'ICD9': icd9_obj.create_icd9(), 'SERVICE_CODE': serviceCode_obj.create_service_code(), 'ATC': atc_obj.create_atc(), } from inside the generate_pc_row(self) function to the interface layer. I showed what I want to do below, but it's incorrect. Namely, I added another function parameter (gen_criteria) for GeneratePcRow(), so that I can later specify the gen_criteria value for other use case.

class DataGenerator():
    def __init__(self):
        self.unique_id_list = []
        self.demographic_list = []
        self.output_list = []

    # .. some code omitted

    def create_row(self, creation_label, criteria_func, n_row_range_list):
        output_placeholder = []

        for curr_id in self.unique_id_list:
            for curr_dict in self.demographic_list:
                if curr_dict['ID'] == curr_id:
                    extracted_demographic = curr_dict

            n_iter = random.randint(n_row_range_list[0], n_row_range_list[1])

            for n in range(n_iter):
                single_output = criteria_func()
                merged_dicts = dict(extracted_demographic, **single_output)
                output_placeholder.append(merged_dicts)

        return output_placeholder

class GeneratePcRow():
    def __init__(self, icd_9_gen, service_code_gen, atc_gen, gen_criteria):
        self.icd_9_gen = icd_9_gen
        self.service_code_gen = service_code_gen
        self.atc_gen = atc_gen

    def generate_pc_row(self):
        fake = random_setup()
        icd9_obj = self.icd_9_gen
        serviceCode_obj = self.service_code_gen
        atc_obj = self.atc_gen

        return gen_criteria

def random_setup():
    seed = None
    random.seed(seed)
    np.random.seed(seed)
    Faker.seed(seed)
    fake = Faker()
    return fake

# Main
dg_obj = DataGenerator()
pc_gen_obj = GeneratePcRow(
                            icd_9_gen = Icd9Generator(p_three_digit_code=0.3, p_four_digit_code=0.3, p_five_digit_code=0.3, p_v_code=0.1,
                                inclusion_list=[], exclusion_list=[]),
                            service_code_gen = ServiceCodeGenerator(p_service=0.9, p_lab=0.1, exclusion_list=[12415125]),
                            atc_gen = AtcGenerator(exclusion_list=[12415125]),
                            gen_criteria = {'PERS_CAPB_PRVD_SPEC_AD': np.random.choice(['GP', 'PSYC', 'UROL'], p=[0.4, 0.5, 0.1]),
                                            'START_DT': fake.date_between(start_date='-2y', end_date='-1y'),
                                            'END_DT': fake.date_between(start_date='-2y', end_date='-1y'),
                                            'DELV_SITE_FUNCTR_TYPE_CODE': np.random.choice(['POFF', 'IPSR', 'AMBU'], p=[0.333, 0.333, 0.334]),
                                            'ICD9': icd9_obj.create_icd9(),
                                            'SERVICE_CODE': serviceCode_obj.create_service_code(),
                                            'ATC': atc_obj.create_atc(),
                                            }   )
pc_data_part1 = dg_obj.create_row(creation_label='PC data part 1',
                                    criteria_func=pc_gen_obj.generate_pc_row,
                                    n_row_range_list=[1, 1],
                                    )

print(pc_data_part1)

The error (NameError: name 'fake' is not defined) says it can't find the references to fake and icd9_obj, which is not unexpected, but I am a little confused how to reference them in my case.