Return a string representation for reasonFlag bit 'reason'.
14103
private static String reasonToString(int reason) {
        if ((reason > 0) && (reason < REASON_STRINGS.length)) {
            return REASON_STRINGS[reason];
        }
        return "Unknown reason " + reason;
    }
995587
public boolean recordDeprecationReason(String reason) {
    if (currentInfo.setDeprecationReason(reason)) {
      populated = true;
      return true;
    } else {
      return false;
    }
  }
324562
def to_string(self):
        """"""
        root = etree.Element('urlset', nsmap={None: SITEMAP_NS})
        for url in self.urls:
            url.generate(root)
        return etree.tostring(root, pretty_print=True, xml_declaration=True,
                              encoding='utf-8')
506404
private static function buildMessage($data, string $reason): string
    {
        $template = self::getTemplate();

        $message = beautify_parse($template, [
            'value' => $data,
            'not_valid' => 'NOT VALID',
            'reason' => $reason,
        ]);

        return $message;
    }
699146
def one_symbol_ops_str(self) -> str:
        """"""
        return re.escape(''.join((key for key in self.ops.keys() if len(key) == 1)))
603800
def get_string(self, key):
        """"""

        # Massive hack, lol
        if key.startswith("lambda."):
            key = "lambda.items.{0}".format(key[7:])
        if key.startswith("apigateway."):
            key = "apigateway.items.{0}".format(key[11:])

        # Make sure key is in all_options
        if key not in self.all_options:
            kwargs = {}
            if len(self.chain) > 1:
                kwargs['source'] = Meta(self.all_options, self.chain[-2]).source
            raise BadOptionFormat("Can't find key in options", key=key, chain=self.chain, **kwargs)

        return super(MergedOptionStringFormatter, self).get_string(key)
280991
def to_string(self, metadata=False):
        """"""
        return "\n".join(rec.get_message(metadata=metadata) for rec in self)
916484
def get_error_message(status_code):
    """"""
    errmsg = ctypes.create_string_buffer(1024)
    nican.ncStatusToString(status_code, len(errmsg), errmsg)
    return errmsg.value.decode("ascii")
830661
def str_rel_short(self, goobj):
        """"""
        if not goobj.relationship:
            return ''
        rel_cur = goobj.relationship
        return "".join([self.rel2chr.get(r, '?') for r in self.rels if r in rel_cur])
635279
def _asString(self, value):
        """"""
        if sys.version_info[0] == 3:
            if isinstance(value, str):
                return value
            elif isinstance(value, bytes):
                return value.decode('utf-8')
        elif sys.version_info[0] == 2:
            return value.encode('ascii')
592305
def get_string():
    """"""
    keycodes = _get_keycodes()
    initial_code, codes = keycodes[0], keycodes[1:]
    initial_char = chr(initial_code)
    if initial_code == 27:
        initial_char = '\\e'
    elif not ascii.isgraph(initial_char):
        initial_char = '\\x%x' % initial_code
    chars = ''.join([chr(c) for c in codes])
    return ''.join((initial_char, chars))
1277929
def process_reason(reason)
      case reason
        when "00"
          logger.error("Reason specified for abort: Reason not specified")
        when "01"
          logger.error("Reason specified for abort: Unrecognized PDU")
        when "02"
          logger.error("Reason specified for abort: Unexpected PDU")
        when "04"
          logger.error("Reason specified for abort: Unrecognized PDU parameter")
        when "05"
          logger.error("Reason specified for abort: Unexpected PDU parameter")
        when "06"
          logger.error("Reason specified for abort: Invalid PDU parameter value")
        else
          logger.error("Reason specified for abort: Unknown reason (Error code: #{reason})")
      end
    end
892422
def _get_error_reason(response):
        
        try:
            body = response.json()
            if body and 'reason' in body:
                return body['reason']
        except ValueError:
            pass
        return response.content
1057240
def FormatProblem(self, d=None):
    
    if not d:
      d = self.GetDictToFormat()

    output_error_text = self.__class__.ERROR_TEXT % d
    if ('reason' in d) and d['reason']:
      return '%s\n%s' % (output_error_text, d['reason'])
    else:
      return output_error_text
227188
def str_def(self):
        
        return "classname={!r}; read_timeout={!r}; read_retries={!r}; " \
            "message={!r};". \
            format(self.__class__.__name__, self.read_timeout,
                   self.read_retries, self.args[0])
1211801
def to_s
			str = super() + "\n"
			str += "\tAppaleable? #{appaleable}\n" if appaleable
			str += "\tDisapproved text: #{disapproved_text}\n" if disapproved_text
			str += "\tLocation: #{location}\n" if location
			str += "\tDisapproved text: #{disapproved_text}\n" if disapproved_text
			str += "\tReason code: #{reason_code} (see: http://msdn.microsoft.com/en-US/library/bing-ads-editorialfailurereasoncodes.aspx)\n" if reason_code

		end
730861
def str_arg(d):
    """"""
    if not d:
        return None
    if isinstance(d, dict):
        if len(d) == 2 and d.get('type') == 'text' and 'value' in d:
            return str_arg(d['value'])
        if len(d) == 2 and d.get('type') == 'text' and 'subkey' in d:
            return ".%s" % d['subkey']
        if d.get('type') == 'module':
            return None
        return "{%s}" % str_args(d.items())
    if isinstance(d, list):
        if len(d) == 1:
            return str_arg(d[0])
        return "[%s]" % ", ".join(str_arg(elem) for elem in d)
    if isinstance(d, unicode):
        return '"%s"' % d

    return repr(d)