<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check(branch: str = 'master'):
 """ Detects the current CI environment, if any, and performs necessary environment checks. :param branch: The branch that should be the current branch. """

    if os.environ.get('TRAVIS') == 'true':
        travis(branch)
    elif os.environ.get('SEMAPHORE') == 'true':
        semaphore(branch)
    elif os.environ.get('FRIGG') == 'true':
        frigg(branch)
    elif os.environ.get('CIRCLECI') == 'true':
        circle(branch)
    elif os.environ.get('GITLAB_CI') == 'true':
        gitlab(branch)
    elif 'BITBUCKET_BUILD_NUMBER' in os.environ:
        bitbucket(branch)