:param scan_id: The scan ID as a string
        :return: A resource containing the scan information
423696
def get_scan(self, scan_id):
        
        url = self.build_full_url('%s%s' % (self.SCANS, scan_id))
        _, json_data = self.send_request(url)
        return Resource(json_data)
1320229
def get_scan_results_xml(self, scan_id, pop_res):
        
        results = Element('results')
        for result in self.scan_collection.results_iterator(scan_id, pop_res):
            results.append(get_result_xml(result))

        logger.info('Returning %d results', len(results))
        return results
644370
def inspect_image(self, image_id):
        
        logger.info("inspecting image '%s'", image_id)
        logger.debug("image_id = '%s'", image_id)
        if isinstance(image_id, ImageName):
            image_id = image_id.to_str()
        image_metadata = self.d.inspect_image(image_id)
        return image_metadata
676909
def delete_scan(self, scan_id):
        

        if self.get_status(scan_id) == ScanStatus.RUNNING:
            return False
        self.scans_table.pop(scan_id)
        if len(self.scans_table) == 0:
            del self.data_manager
            self.data_manager = None
        return True
719018
def get_registration_id_info(self, registration_id):
        
        response = self.registration_info_request(registration_id)
        if response.status_code == 200:
            return response.json()
        return None
1358927
def scan(self, ids=range(254)):
        
        return [id for id in ids if self.ping(id)]
985143
function scan(req, res) {
  var records = []
    , position
    , i
    , key
    , inc
    , map = this.map
    , len = this.cursor + this.count;

  for(i = this.cursor; i < len;i++) {
    if(i === this.target.length) {
      position = 0;
      break;
    }
    key = '' + this.target[i];
    inc = !this.pattern || (this.pattern && this.pattern.test(key));
    if(inc) {
      records.push(key);
      if(map) records.push(this.stringify ? '' + map[key] : map[key]);
    }
    position = i + 1;
  }

  res.send(null, [position, records]);
}
48169
def get_extension_by_id(self, extension_id, version=None, flags=None):
        
        route_values = {}
        if extension_id is not None:
            route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str')
        query_parameters = {}
        if version is not None:
            query_parameters['version'] = self._serialize.query('version', version, 'str')
        if flags is not None:
            query_parameters['flags'] = self._serialize.query('flags', flags, 'str')
        response = self._send(http_method='GET',
                              location_id='a41192c8-9525-4b58-bc86-179fa549d80d',
                              version='5.0-preview.2',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('PublishedExtension', response)
169707
def usable_id(cls, id):
        
        try:
            # id is maybe a sshkey name
            qry_id = cls.from_name(id)
            if not qry_id:
                qry_id = int(id)
        except DuplicateResults as exc:
            cls.error(exc.errors)
        except Exception:
            qry_id = None

        if not qry_id:
            msg = 'unknown identifier %s' % id
            cls.error(msg)

        return qry_id
123923
def calculate_progress(self, scan_id):
        

        t_prog = dict()
        for target in self.get_scan_target(scan_id):
            t_prog[target] = self.get_scan_target_progress(scan_id, target)
        return sum(t_prog.values())/len(t_prog)
1343687
def get_process_by_its_id(self, process_type_id, expand=None):
        
        route_values = {}
        if process_type_id is not None:
            route_values['processTypeId'] = self._serialize.url('process_type_id', process_type_id, 'str')
        query_parameters = {}
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query('expand', expand, 'str')
        response = self._send(http_method='GET',
                              location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af',
                              version='5.0-preview.2',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('ProcessInfo', response)
654572
def scanned(self):
        """"""
        if self.request["Select"] == "COUNT":
            while not self.exhausted:
                next(self, None)
        return self._scanned
915219
def get_doc(self, doc_id):
        
        resp = self._r_session.get('/'.join([self._scheduler, 'docs', '_replicator', doc_id]))
        resp.raise_for_status()
        return response_to_json_dict(resp)
476358
def get_scan_log_lines(self, source_id, scan_id):
        
        return self.client.get_manager(Scan).get_log_lines(source_id=source_id, scan_id=scan_id)
642886
def get_log_lines(self, source_id, scan_id):
        
        target_url = self.client.get_url('SCAN', 'GET', 'log', {'source_id': source_id, 'scan_id': scan_id})
        r = self.client.request('GET', target_url, headers={'Accept': 'text/plain'}, stream=True)
        return r.iter_lines(decode_unicode=True)
914016
def results_iterator(self, scan_id, pop_res):
        
        if pop_res:
            result_aux = self.scans_table[scan_id]['results']
            self.scans_table[scan_id]['results'] = list()
            return iter(result_aux)

        return iter(self.scans_table[scan_id]['results'])
291123
def keep_scan(cls, result_key, token):
        
        def _scan(self):
            return self.get(token)

        cls.scan(result_key, _scan)