from typing import Mapping


def _is_codeship(environ: Mapping) -> bool:
    """
    Use environ to determine whether it is running in CodeShip.
    According to the doc,
    https://docs.cloudbees.com/docs/cloudbees-codeship/latest/basic-builds-and-configuration/set-environment-variables
    > CI_NAME                # Always CodeShip. Ex: codeship

    to handle both "CodeShip" and "codeship," here the string is converted to lower case first.

    Parameters
    ----------
    environ

    Returns
    -------
    bool
        whether the env is CodeShip
    """
    ci_name: str = environ.get("CI_NAME", "").lower()
    return ci_name == "codeship"