def get_core_overrides_data(
    environment: "Environment",
    *,
    skip_identity_overrides: bool = False,
) -> OverridesData:
    """
    Get the number of identity / segment overrides in a given environment for each feature in the
    project.

    :param environment: the environment to get the overrides data for
    :return OverridesData: dictionary of {feature_id: EnvironmentFeatureOverridesData}
    """
    environment_feature_states_list = get_environment_flags_list(environment)
    all_overrides_data: OverridesData = {}

    for feature_state in environment_feature_states_list:
        env_feature_overrides_data = all_overrides_data.setdefault(
            feature_state.feature_id, EnvironmentFeatureOverridesData()
        )
        if feature_state.feature_segment_id:
            env_feature_overrides_data.num_segment_overrides += 1
        elif skip_identity_overrides:
            continue
        elif feature_state.identity_id:
            env_feature_overrides_data.add_identity_override()  # type: ignore[no-untyped-call]

    return all_overrides_data

    Get the number of identity / segment overrides in a given environment for each feature in the
    project.

    :param environment: the environment to get the overrides data for
    :return OverridesData: dictionary of {feature_id: EnvironmentFeatureOverridesData}
    
api/features/features_service.py