Do extra work to fetch a complete set of attributes for this entity.

        For more information, see `Bugzilla #1223540
        <https://bugzilla.redhat.com/show_bug.cgi?id=1223540>`_.
493242
def create(self, create_missing=None):
        
        return DockerComputeResource(
            self._server_config,
            id=self.create_json(create_missing)['id'],
        ).read()
724530
def retrieve_info(self):
        """"""

        scheme = urlparse(self.url).scheme
        netloc = urlparse(self.url).netloc
        query = urlparse(self.url).query

        if scheme not in ('http', 'https'):
            return

        for item in query.split('&'):
            if 'id=' in item:
                ticket_id = item.split('=')[1]
                break
        else:
            return

        bugzilla_url = '%s://%s/%s%s' % (scheme, netloc, _URI_BASE, ticket_id)

        result = requests.get(bugzilla_url)
        self.status_code = result.status_code

        if result.status_code == 200:
            tree = ElementTree.fromstring(result.content)

            self.title = tree.findall("./bug/short_desc").pop().text
            self.issue_id = tree.findall("./bug/bug_id").pop().text
            self.reporter = tree.findall("./bug/reporter").pop().text
            self.assignee = tree.findall("./bug/assigned_to").pop().text
            self.status = tree.findall("./bug/bug_status").pop().text
            self.product = tree.findall("./bug/product").pop().text
            self.component = tree.findall("./bug/component").pop().text
            self.created_at = tree.findall("./bug/creation_ts").pop().text
            self.updated_at = tree.findall("./bug/delta_ts").pop().text
            try:
                self.closed_at = (
                    tree.findall("./bug/cf_last_closed").pop().text
                )
            except IndexError:
                # cf_last_closed is present only if the issue has been closed
                # if not present it raises an IndexError, meaning the issue
                # isn't closed yet, which is a valid use case.
                pass
65247
def fetch_entities(self):
        """"""
        query = text(
            """
            SELECT entity_id
            FROM states
            GROUP BY entity_id
            """
        )
        response = self.perform_query(query)

        # Parse the domains from the entities.
        entities = {}
        domains = set()

        for [entity] in response:
            domain = entity.split(".")[0]
            domains.add(domain)
            entities.setdefault(domain, []).append(entity)

        self._domains = list(domains)
        self._entities = entities
        print("There are {} entities with data".format(len(entities)))
1369904
def attributes(self, params=None):
        
        if params is None:
            params = {}
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        for a in self.tc_requests.attributes(
            self.api_type, self.api_sub_type, self.unique_id, owner=self.owner, params=params
        ):
            yield a
1117282
def list(self, entity=None):
        
        uri = "/%s" % self.uri_base
        if entity:
            uri = "%s?entityId=%s" % (uri, utils.get_id(entity))
        resp, resp_body = self._list(uri, return_raw=True)
        return resp_body
353969
def get_attachments(self, include_fields=None, exclude_fields=None):
        
        if "attachments" in self.__dict__:
            return self.attachments

        data = self.bugzilla.get_attachments([self.bug_id], None,
                include_fields, exclude_fields)
        return data["bugs"][str(self.bug_id)]
826154
def get_comments(bugs)
      params = {}

      if bugs.kind_of?(Array) then
        params['ids'] = bugs
      elsif bugs.kind_of?(Integer) ||
          bugs.kind_of?(String) then
        params['ids'] = [bugs]
      else
        raise ArgumentError, sprintf("Unknown type of arguments: %s", bugs.class)
      end

      result = comments(params)

      # not supporting comment_ids. so drop "comments".
      result['bugs']
    end
1031211
def get_attributes(excluded)
      attribs = attributes.dup
      attribs.delete_if { |key, value|
        (!excluded.nil? and excluded.include?(key)) or key == "id" }
    end
753445
def get_wikidata_qnum(wikiarticle, wikisite):
    
    resp = requests.get('https://www.wikidata.org/w/api.php', timeout=5, params={
        'action': 'wbgetentities',
        'titles': wikiarticle,
        'sites': wikisite,
        'props': '',
        'format': 'json'
    }).json()
    return list(resp['entities'])[0]
292229
def get_attributes(**kwargs):
    

    attrs = db.DBSession.query(Attr).order_by(Attr.name).all()

    return attrs
552530
def __get_entities(self, etype):
        """"""
        r = fapi.get_entities(self.namespace, self.name,
                              etype, self.api_url)
        fapi._check_response_code(r, 200)
        return [Entity(e['entityType'], e['name'], e['attributes'])
                for e in r.json()]
933652
def get_any_entity(self, id=None, uri=None, match=None):
        

        if not id and not uri and not match:
            return None

        if type(id) == type("string"):
            uri = id
            id = None
            if not is_http(uri):
                match = uri
                uri = None
        if match:
            if type(match) != type("string"):
                return []
            res = []
            if ":" in match:  # qname
                for x in self.all_classes:
                    if match.lower() in x.qname.lower():
                        res += [x]
                for x in self.all_properties:
                    if match.lower() in x.qname.lower():
                        res += [x]
            else:
                for x in self.all_classes:
                    if match.lower() in x.uri.lower():
                        res += [x]
                for x in self.all_properties:
                    if match.lower() in x.uri.lower():
                        res += [x]
            return res
        else:
            for x in self.all_classes:
                if id and x.id == id:
                    return x
                if uri and x.uri.lower() == uri.lower():
                    return x
            for x in self.all_properties:
                if id and x.id == id:
                    return x
                if uri and x.uri.lower() == uri.lower():
                    return x
            return None
573969
def get_summary(config, bugnumber):
    """"""

    bugzilla_url_regex = re.compile(
        re.escape("https://bugzilla.mozilla.org/show_bug.cgi?id=") + r"(\d+)$"
    )

    # The user could have pasted in a bugzilla ID or a bugzilla URL
    if bugzilla_url_regex.search(bugnumber.split("#")[0]):
        # that's easy then!
        bugzilla_id, = bugzilla_url_regex.search(bugnumber.split("#")[0]).groups()
        bugzilla_id = int(bugzilla_id)
        summary, url = bugzilla.get_summary(config, bugzilla_id)
        return summary, bugzilla_id, url

    # The user could have pasted in a GitHub issue URL
    github_url_regex = re.compile(r"https://github.com/([^/]+)/([^/]+)/issues/(\d+)")
    if github_url_regex.search(bugnumber.split("#")[0]):
        # that's also easy
        org, repo, id_, = github_url_regex.search(bugnumber.split("#")[0]).groups()
        id_ = int(id_)
        title, url = github.get_title(config, org, repo, id_)
        return title, id_, url

    # If it's a number it can be either a github issue or a bugzilla bug
    if bugnumber.isdigit():
        # try both and see if one of them turns up something interesting

        repo = config.repo
        state = read(config.configfile)
        fork_name = state.get("FORK_NAME", getpass.getuser())
        if config.verbose:
            info_out("Using fork name: {}".format(fork_name))
        candidates = []
        # Looping over the remotes, let's figure out which one
        # is the one that has issues. Let's try every one that isn't
        # your fork remote.
        for origin in repo.remotes:
            if origin.name == fork_name:
                continue
            url = origin.url
            org, repo = parse_remote_url(origin.url)
            github_title, github_url = github.get_title(
                config, org, repo, int(bugnumber)
            )
            if github_title:
                candidates.append((github_title, int(bugnumber), github_url))

        bugzilla_summary, bugzilla_url = bugzilla.get_summary(config, bugnumber)
        if bugzilla_summary:
            candidates.append((bugzilla_summary, int(bugnumber), bugzilla_url))

        if len(candidates) > 1:
            info_out(
                "Input is ambiguous. Multiple possibilities found. "
                "Please re-run with the full URL:"
            )
            for title, _, url in candidates:
                info_out("\t{}".format(url))
                info_out("\t{}\n".format(title))
            error_out("Awaiting your choice")
        elif len(candidates) == 1:
            return candidates[0]
        else:
            error_out("ID could not be found on GitHub or Bugzilla")
        raise Exception(bugnumber)

    return bugnumber, None, None
1012067
def getAnnotations_via_id(self,
                              annotation_ids,
                              LIMIT=25,
                              _print=True,
                              crawl=False):
        """"""
        url_base = self.base_url + \
            '/api/1/term/get-annotation/{id}?key=' + self.api_key
        urls = [
            url_base.format(id=str(annotation_id))
            for annotation_id in annotation_ids
        ]
        return self.get(urls, LIMIT=LIMIT, _print=_print, crawl=crawl)
860083
def wikidata_get(identifier):
    
    url = 'https://www.wikidata.org/wiki/Special:EntityData/{}.json'.format(identifier)
    #logging.info(url)
    return json.loads(requests.get(url).content)
90075
def get_base_attributes(entity):
    
    attributes = {}
    cls = entity.__class__
    for attr, _ in inspect.getmembers(cls, lambda o: not isinstance(o, property) and not inspect.isroutine(o)):
        if not attr.startswith("_"):
            attributes[attr] = getattr(entity, attr)
    return attributes
376408
def get(self, entity, id=None, sub_entity=None, offset=0, limit=20,
            search_terms=None, sync=True):
        
        url = urljoin(self.host, entity.value + '/')
        url = urljoin(url, id + '/') if id else url
        url = urljoin(url, sub_entity.value + '/') if sub_entity else url
        terms = {'sync': str(sync).lower()}
        if search_terms:
            terms.update(search_terms)
        if not id:
            terms.update({'limit': limit, 'offset': offset})
        url = Utils.add_url_parameters(url, terms)
        r = requests.get(url, auth=self.auth, headers=self.headers)
        if sub_entity == Entity.Content:
            return r.content
        elif r.ok:
            j = r.json()

            if 'meta' not in j:
                # TODO: Fix error in API. No meta data returned when getting a
                # single object.
                return {'objects': [j]}

            next_path = j['meta']['next']

            while next_path:
                offset += limit
                url = urljoin(self.host, entity.value + '/')
                url = urljoin(url, id + '/') if id else url
                url = urljoin(
                    url, sub_entity.value + '/') if sub_entity else url
                terms = {'offset': offset}
                url = Utils.add_url_parameters(
                    url, {'offset': offset})
                r = requests.get(url, auth=self.auth, headers=self.headers)
                j['objects'].extend(r.json()['objects'])
                next_path = r.json()['meta']['next']

            return j['objects']
        else:
            raise CoredataError(
                'Error occured! Status code is {code} for {url}'.format(
                    code=r.status_code, url=url))