Get the current app id.
430976
def get_current_app(self):
        """"""
        self.request(EP_GET_CURRENT_APP_INFO)
        return None if self.last_response is None else self.last_response.get('payload').get('appId')
738146
private function getAppKey(): string
    {
        $appUUID = $this
            ->getRepositoryReference()
            ->getAppUUID();

        return $appUUID instanceof AppUUID
            ? $appUUID->getId()
            : '';
    }
447511
def get_request_id(self, renew=False):
        
        if not AppRequest.__request_id or renew:
            self.set_request_id(uuid.uuid1())
        return AppRequest.__request_id
633091
def from_current(cls):
        
        if properties.application_id is None:
            raise context.ValueError("Not running inside a container")

        return cls(properties.appmaster_address,
                   properties.application_id,
                   security=Security.from_default())
90518
def get_possible_app_ids():
    

    try:
        req = requests.get(
            "https://clients3.google.com/cast/chromecast/device/baseconfig")
        data = json.loads(req.text[4:])

        return [app['app_id'] for app in data['applications']] + \
            data["enabled_app_ids"]

    except ValueError:
        # If json fails to parse
        return []
274853
def get_id(self):
        
        if self._id is None:
            # FIXME: provide a better error message when key is not defined
            self._id = self.inspect(refresh=False)["Id"]
        return self._id
1013207
def get_device_id(self, use_cached=True):
        """"""
        device_json = self.get_device_json(use_cached)
        return device_json["id"].get("devId")
1005224
def get_app_info(app_id):
    
    try:
        conn = get_conn()
        c = conn.cursor()
        c.execute("SELECT name,source_id,region,state,create_at,change_at FROM app WHERE id='{0}' ".format(app_id))
        app_info = c.fetchone()
        c.execute("SELECT app_data FROM app WHERE id='{0}' ".format(app_id))
        app_data = c.fetchone()
        c.execute("SELECT id,name,app_id FROM container WHERE app_id='{0}' ".format(app_id))
        container_rlt = c.fetchall()
        conn.close()
        return (app_info, app_data, container_rlt)
    except Exception,e:
        raise RuntimeError('get app info failed! %s' % e)
499846
def find_application(options = {})
      raise "Expecting :application_id" unless options[:application_id]
      
      if @current_application && @current_application.application_id != options[:application_id]
        @current_application = KynetxAmApi::Application.new(self, options[:application_id])
      else
        @current_application ||= KynetxAmApi::Application.new(self, options[:application_id])
      end
      return @current_application
    end
289634
def get_client_id(self):
        
        self._client_id = predix.config.get_env_value(predix.app.Manifest, 'client_id')
        return self._client_id
135981
def id(self):
        """"""
        id = ''
        if (self.server_and_prefix is not None and
                self.server_and_prefix != ''):
            id += self.server_and_prefix + '/'
        if (self.identifier is not None):
            id += self.identifier
        return id
1131467
def get_id(self):
        """"""
        if self._id_attr is None or not hasattr(self, self._id_attr):
            return None
        return getattr(self, self._id_attr)
1265210
def get_app_guid(self, app_name):
        
        summary = self.space.get_space_summary()
        for app in summary['apps']:
            if app['name'] == app_name:
                return app['guid']
520883
def id(self):
        
        if not hasattr(self, '_id'):
            self._id = str(threading.current_thread().ident + id(self))[-6:]
        return self._id
470542
def current_app(self):
        
        # try: adb shell dumpsys activity top
        _activityRE = re.compile(r'ACTIVITY (?P<package>[^/]+)/(?P<activity>[^/\s]+) \w+ pid=(?P<pid>\d+)')
        m = _activityRE.search(self.shell('dumpsys', 'activity', 'top'))
        if m:
            return dict(package=m.group('package'), activity=m.group('activity'), pid=int(m.group('pid')))

        # try: adb shell dumpsys window windows
        _focusedRE = re.compile('mFocusedApp=.*ActivityRecord{\w+ \w+ (?P<package>.*)/(?P<activity>.*) .*')
        m = _focusedRE.search(self.shell('dumpsys', 'window', 'windows'))
        if m:
            return dict(package=m.group('package'), activity=m.group('activity'))
        raise RuntimeError("Couldn't get focused app")
52619
def show(cls, app_id):
        
        conn = Qubole.agent()
        return conn.get(cls.element_path(app_id))
881061
def id(self) -> typing.Union[str, None]:
        """"""
        return self._project.id if self._project else None