Return a text string describing the context
507378
def FormatContext(self):
    """"""
    text = ''
    if hasattr(self, 'feed_name'):
      text += "In feed '%s': " % self.feed_name
    if hasattr(self, 'file_name'):
      text += self.file_name
    if hasattr(self, 'row_num'):
      text += ":%i" % self.row_num
    if hasattr(self, 'column_name'):
      text += " column %s" % self.column_name
    return text
193790
def context(self, name):
        
        data = self._context(name)
        context = data.get("context")
        if context:
            return context

        assert self.load_path
        context_path = os.path.join(self.load_path, "contexts", "%s.rxt" % name)
        context = ResolvedContext.load(context_path)
        data["context"] = context
        data["loaded"] = True
        return context
1358987
@Override
	public String getContextDescription() {
		String msg = String.format("In method '%s.%s'", getParent().getElement().getSimpleName().toString(), getElement().getSimpleName().toString());

		return msg;
	}
675669
def gettext(ui_file_path):
    
    with open(ui_file_path, 'r') as fin:
        content = fin.read()

    # replace ``_translate("context", `` by ``_(``
    content = re.sub(r'_translate\(".*",\s', '_(', content)
    content = content.replace(
        '        _translate = QtCore.QCoreApplication.translate', '')

    with open(ui_file_path, 'w') as fout:
        fout.write(content)
749795
def get_context_data(self, **kwargs):
        """"""
        
        context = super(AnimalListAlive, self).get_context_data(**kwargs)
        context['list_type'] = 'Alive'
        return context
909264
def evaluate(self, context):
        
        html = self._source.format(**context)
        parts = {"text/html": html, "text/plain": textFromHTML(html)}
        return {}, parts
370683
def context(self):
        
        return {
            'code': self.code,
            'msg': self.msg,
            'IssueInstant': timezone.now().isoformat(),
            'ResponseID': utils.gen_saml_id()
        }
508539
def get_description(self):
        
        return DisplayText({'text': profile.DESCRIPTION,
                            'languageTypeId': profile.LANGUAGETYPEID,
                            'scriptTypeId': profile.SCRIPTTYPEID,
                            'formatTypeId': profile.FORMATTYPEID})
1039587
def help_text(self):
    """"""
    result = []
    for name in sorted(self._declarations.keys()):
      result.append(name)
      result.append('-' * len(name))
      decl = self._declarations[name]
      if decl.description:
        result.append(decl.description.strip())
      else:
        result.append('(no description found)')
      if decl.has_default:
        result.append('')
        quotes = '"' if type(decl.default_value) is str else ''
        result.append('  default_value={quotes}{val}{quotes}'.format(
            quotes=quotes, val=decl.default_value))
      result.append('')
      result.append('')
    return '\n'.join(result)
171557
def get_context(self, name, value, attrs):
        """"""
        context = {}
        context['widget'] = {
            'name': name,
            'type': 'text',
            'is_hidden': self.is_hidden,
            'required': self.is_required,
            'value': self.format_value(value),
            'attrs': {**self.attrs, **(attrs or {})},
            'template_name': self.template_name,
        }
        return context
1324898
def context(self, identifier=None, meta=None):
        
        return Context(self, identifier=identifier, meta=meta)
595762
def contexts(self):
        
        if not hasattr(self, "_contexts"):
            cs = {}
            for cr in self.doc["contexts"]:
                cs[cr["name"]] = copy.deepcopy(cr["context"])
            self._contexts = cs
        return self._contexts
28735
def context_info(zap_helper, context_name):
    """"""
    with zap_error_handler():
        info = zap_helper.get_context_info(context_name)

    console.info('ID: {}'.format(info['id']))
    console.info('Name: {}'.format(info['name']))
    console.info('Authentication type: {}'.format(info['authType']))
    console.info('Included regexes: {}'.format(info['includeRegexs']))
    console.info('Excluded regexes: {}'.format(info['excludeRegexs']))
667664
def get_attr_text(self):
        """"""
        return ' '.join([
            '{}="{}"'.format(key, value)
            for key, value in self.attr.items()
        ])
1263545
def summary_str(self) -> str:
        """"""
        return '{}\n'.format(self) + '\n'.join(
            '{}: {}'.format(label, value)
            for label, value in self._describe_list()
        )
315165
def get_context():
    """"""
    if not local_context._options:
        raise TelluricContextError("TelluricContext context not exists")
    else:
        log.debug("Got a copy of context %r options", local_context._options)
        return local_context._options.copy()
747558
def get_context(self, context):
        """"""
        # forward pass
        i = 0
        while i < len(self.tagList):
            tag = self.tagList[i]

            # skip application stuff
            if tag.tagClass == Tag.applicationTagClass:
                pass

            # check for context encoded atomic value
            elif tag.tagClass == Tag.contextTagClass:
                if tag.tagNumber == context:
                    return tag

            # check for context encoded group
            elif tag.tagClass == Tag.openingTagClass:
                keeper = tag.tagNumber == context
                rslt = []
                i += 1
                lvl = 0
                while i < len(self.tagList):
                    tag = self.tagList[i]
                    if tag.tagClass == Tag.openingTagClass:
                        lvl += 1
                    elif tag.tagClass == Tag.closingTagClass:
                        lvl -= 1
                        if lvl < 0: break

                    rslt.append(tag)
                    i += 1

                # make sure everything balances
                if lvl >= 0:
                    raise InvalidTag("mismatched open/close tags")

                # get everything we need?
                if keeper:
                    return TagList(rslt)
            else:
                raise InvalidTag("unexpected tag")

            # try the next tag
            i += 1

        # nothing found
        return None