Get our projectId from the ``GOOGLE_APPLICATION_CREDENTIALS`` creds
        JSON file.

        :return: project ID
        :rtype: str
424513
def _get_project_id(self):
        
        fpath = os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', None)
        if fpath is None:
            raise Exception('ERROR: No project ID specified, and '
                            'GOOGLE_APPLICATION_CREDENTIALS env var is not set')
        fpath = os.path.abspath(os.path.expanduser(fpath))
        logger.debug('Reading credentials file at %s to get project_id', fpath)
        with open(fpath, 'r') as fh:
            cred_data = json.loads(fh.read())
        return cred_data['project_id']
485002
def get_project(self, project_id):
        
        try:
            result = self._request('/getproject/',
                                   {'projectid': project_id})
            return TildaProject(**result)
        except NetworkError:
            return []
604779
def get_project(id=None, name=None):
    
    content = get_project_raw(id, name)
    if content:
        return utils.format_json(content)
329593
def _GetInstanceConfig(self):
    
    try:
      instance_data = self.metadata_dict['instance']['attributes']
    except KeyError:
      instance_data = {}
      self.logger.warning('Instance attributes were not found.')

    try:
      project_data = self.metadata_dict['project']['attributes']
    except KeyError:
      project_data = {}
      self.logger.warning('Project attributes were not found.')

    return (instance_data.get('google-instance-configs')
            or project_data.get('google-instance-configs'))
675039
def get_credentials(self):
        
        creds_mgr = CredentialsManager(self)
        creds = creds_mgr.get_credentials_from_upload_api()
        return {
            'aws_access_key_id': creds['access_key'],
            'aws_secret_access_key': creds['secret_key'],
            'aws_session_token': creds['token'],
            'expiry_time': creds['expiry_time']
        }
30213
def _GetAccountsData(self, metadata_dict):
    
    instance_data, project_data = self._GetInstanceAndProjectAttributes(
        metadata_dict)
    valid_keys = [instance_data.get('sshKeys'), instance_data.get('ssh-keys')]
    block_project = instance_data.get('block-project-ssh-keys', '').lower()
    if block_project != 'true' and not instance_data.get('sshKeys'):
      valid_keys.append(project_data.get('ssh-keys'))
      valid_keys.append(project_data.get('sshKeys'))
    accounts_data = '\n'.join([key for key in valid_keys if key])
    return self._ParseAccountsData(accounts_data)
1119630
def get_details(app='groupproject', env='dev', region='us-east-1'):
    
    url = '{host}/applications/{app}'.format(host=API_URL, app=app)

    request = requests.get(url, verify=GATE_CA_BUNDLE, cert=GATE_CLIENT_CERT)

    if not request.ok:
        raise SpinnakerAppNotFound('"{0}" not found.'.format(app))

    app_details = request.json()

    LOG.debug('App details: %s', app_details)
    group = app_details['attributes'].get('repoProjectKey')
    project = app_details['attributes'].get('repoSlug')
    generated = gogoutils.Generator(group, project, env=env, region=region, formats=APP_FORMATS)

    LOG.debug('Application details: %s', generated)
    return generated
752561
def _get_gce_credentials(request=None):
    """"""
    # Ping requires a transport, but we want application default credentials
    # to require no arguments. So, we'll use the _http_client transport which
    # uses http.client. This is only acceptable because the metadata server
    # doesn't do SSL and never requires proxies.

    # While this library is normally bundled with compute_engine, there are
    # some cases where it's not available, so we tolerate ImportError.
    try:
        from google.auth import compute_engine
        from google.auth.compute_engine import _metadata
    except ImportError:
        return None, None

    if request is None:
        request = google.auth.transport._http_client.Request()

    if _metadata.ping(request=request):
        # Get the project ID.
        try:
            project_id = _metadata.get_project_id(request=request)
        except exceptions.TransportError:
            project_id = None

        return compute_engine.Credentials(), project_id
    else:
        return None, None
42786
def get_project(self, project_id):
        ''''''
        project_response = self.get_request('projects/%s' % project_id)
        return Project(self, project_response['project'])
569169
def get_loaded_project(self, project_id):
        
        project = self.get_project(project_id)
        yield from project.wait_loaded()
        return project
94251
def get_id(self):
        '''
        
        '''
        if self._dxid is not None:
            return self._dxid
        else:
            return 'app-' + self._name + '/' + self._alias
1285555
def retrieve_client_credentials(self):
        
        client_id = self.params.get('client_id')
        client_secret = self.params.get('client_secret')
        return (client_id, client_secret)
66362
def retrieve(self, request, project, pk=None):
        
        log = JobLog.objects.get(id=pk)
        return Response(self._log_as_dict(log))
804361
private static String getRegistrationId(Context context) {
        final SharedPreferences prefs = getGcmPreferences(context);
        String registrationId = prefs.getString(PROPERTY_REG_ID, "");
        if (registrationId.isEmpty()) {
            return "";
        }
        // Check if app was updated; if so, it must clear the registration ID
        // since the existing regID is not guaranteed to work with the new
        // app version.
        int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);
        int currentVersion = getAppVersion(context);
        if (registeredVersion != currentVersion) {
            return "";
        }

        if (OrtcClient.getOnRegistrationId() != null){
            OrtcClient.getOnRegistrationId().run(registrationId);
        }

        return registrationId;
    }
734086
def getID(code_file):
	""""""
	json_path = ghostfolder+'/'+json_file
	if os.path.exists(json_path):
		pass
	else:
		download_file('https://ghostbin.com/languages.json')

	lang = detect_lang(code_file)

	json_data = json.load(file(json_path))#don't think i need this though
	ID = ''
	for  i in range(len(json_data)):
		temp = len(json_data[i]['languages'])
		for j in range(temp):	
			if json_data[i]['languages'][j]['name'].lower() == lang.lower():
				ID = json_data[i]['languages'][j]['id']
				print('Gotten language ID from \'languages.json\': {0}'.format(ID))
				return ID
629437
def get(project, credentials=None):
        """"""
        user, oauth_access_token = parsecredentials(credentials)
        if not Project.exists(project, user):
            return withheaders(flask.make_response("Project " + project + " was not found for user " + user,404) ,headers={'allow_origin': settings.ALLOW_ORIGIN})#404
        else:
            #if user and not Project.access(project, user) and not user in settings.ADMINS:
            #    return flask.make_response("Access denied to project " +  project + " for user " + user, 401) #401
            datafile = os.path.join(Project.path(project,credentials),'clam.xml')
            statuscode, statusmsg, statuslog, completion = Project.status(project, user) #pylint: disable=unused-variable
            if statuscode == clam.common.status.DONE and os.path.exists(datafile):
                f = io.open(datafile,'r',encoding='utf-8')
                xmldata = f.read(os.path.getsize(datafile))
                f.close()
                data = clam.common.data.CLAMData(xmldata, None,False, Project.path(project,credentials), loadmetadata=False)
                return Project.response(user, project, settings.PARAMETERS,"",False,oauth_access_token,','.join([str(x) for x in data.program.matchedprofiles]) if data.program else "", data.program) #200
            else:
                #HTTP request parameters may be used to pre-set global parameters when starting a project (issue #66)
                for parametergroup, parameterlist in settings.PARAMETERS: #pylint: disable=unused-variable
                    for parameter in parameterlist:
                        value = parameter.valuefrompostdata(flask.request.values)
                        if value is not None:
                            parameter.set(value)
                return Project.response(user, project, settings.PARAMETERS,"",False,oauth_access_token)
8648
def get_project(self, project_name):
        
        headers = {}
        params = {}
        resource = "/"

        (resp, header) = self._send("GET", project_name, None, resource, params, headers)
        return GetProjectResponse(resp, header)