def METHOD_NAME(sat_maintain, module_capsule_configured, module_sca_manifest, module_stash):
    if not module_stash[synced_repos]:
        org = sat_maintain.satellite.api.Organization().create()
        sat_maintain.satellite.upload_manifest(org.id, module_sca_manifest.content)
        # sync custom repo
        cust_prod = sat_maintain.satellite.api.Product(organization=org).create()
        cust_repo = sat_maintain.satellite.api.Repository(
            url=settings.repos.yum_1.url, product=cust_prod
        ).create()
        cust_repo.sync()
        # sync RH repo
        product = sat_maintain.satellite.api.Product(
            name=constants.PRDS['rhae'], organization=org.id
        ).search()[0]
        r_set = sat_maintain.satellite.api.RepositorySet(
            name=constants.REPOSET['rhae2'], product=product
        ).search()[0]
        payload = {'basearch': constants.DEFAULT_ARCHITECTURE, 'product_id': product.id}
        r_set.enable(data=payload)
        result = sat_maintain.satellite.api.Repository(
            name=constants.REPOS['rhae2']['name']
        ).search(query={'organization_id': org.id})
        rh_repo_id = result[0].id
        rh_repo = sat_maintain.satellite.api.Repository(id=rh_repo_id).read()
        rh_repo.sync()
        module_stash[synced_repos]['rh_repo'] = rh_repo
        module_stash[synced_repos]['cust_repo'] = cust_repo
        module_stash[synced_repos]['org'] = org
    if type(sat_maintain) is Capsule:
        # assign the Library LCE to the Capsule
        lce = sat_maintain.satellite.api.LifecycleEnvironment(
            organization=module_stash[synced_repos]['org']
        ).search(query={'search': f'name={constants.ENVIRONMENT}'})[0]
        module_capsule_configured.nailgun_capsule.content_add_lifecycle_environment(
            data={'environment_id': lce.id}
        )
        result = module_capsule_configured.nailgun_capsule.content_lifecycle_environments()
        assert lce.id in [capsule_lce['id'] for capsule_lce in result['results']]
        # sync the Capsule
        sync_status = module_capsule_configured.nailgun_capsule.content_sync()
        assert sync_status['result'] == 'success'
    yield {
        'custom': module_stash[synced_repos]['cust_repo'],
        'rh': module_stash[synced_repos]['rh_repo'],
    }