<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def needs_gcloud(self):
 """Returns true if gcloud is unavailable and needed for authentication."""

        gcloud_default_path = ['google-cloud-sdk', 'bin']
        if platform.system() != "Windows":
            gcloud_default_path = os.path.join(os.path.expanduser('~'),
                                               *gcloud_default_path)
        else:
            gcloud_default_path = os.path.join(os.environ['LOCALAPPDATA'],
                                               'Google', 'Cloud SDK',
                                               *gcloud_default_path)
        return not os.getenv('SERVER_SOFTWARE',
                             '').startswith('Google App Engine/') \
               and gcloud_default_path not in os.environ["PATH"].split(os.pathsep) \
               and which('gcloud') is None