<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2019, Ilya Etingof &lt;etingof@gmail.com&gt;
# License: http://snmplabs.com/pyasn1/license.html
#
from sys import version_info

if version_info[0:2] &lt; (2, 6):
    def bin(value):
        bitstring = []

        if value &gt; 0:
            prefix = '0b'
        elif value &lt; 0:
            prefix = '-0b'
            value = abs(value)
        else:
            prefix = '0b0'

        while value:
            if value &amp; 1 == 1:
                bitstring.append('1')
            else:
                bitstring.append('0')

            value &gt;&gt;= 1

        bitstring.reverse()

        return prefix + ''.join(bitstring)
else:
    bin = bin
</pre></body></html>