PATH:
usr
/
lib64
/
python3.6
"""Bisection algorithms.""" def insort_right(a, x, lo=0, hi=None): """Insert item x in list a, and keep it sorted assuming a is sorted. If x is already in a, insert it to the right of the rightmost x. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. """ if lo < 0: raise ValueError('lo must be non-negative') if hi is None: hi = len(a) while lo < hi: mid = (lo+hi)//2 if x < a[mid]: hi = mid else: lo = mid+1 a.insert(lo, x) insort = insort_right # backward compatibility def bisect_right(a, x, lo=0, hi=None): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, a.insert(x) will insert just after the rightmost x already there. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. """ if lo < 0: raise ValueError('lo must be non-negative') if hi is None: hi = len(a) while lo < hi: mid = (lo+hi)//2 if x < a[mid]: hi = mid else: lo = mid+1 return lo bisect = bisect_right # backward compatibility def insort_left(a, x, lo=0, hi=None): """Insert item x in list a, and keep it sorted assuming a is sorted. If x is already in a, insert it to the left of the leftmost x. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. """ if lo < 0: raise ValueError('lo must be non-negative') if hi is None: hi = len(a) while lo < hi: mid = (lo+hi)//2 if a[mid] < x: lo = mid+1 else: hi = mid a.insert(lo, x) def bisect_left(a, x, lo=0, hi=None): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e < x, and all e in a[i:] have e >= x. So if x already appears in the list, a.insert(x) will insert just before the leftmost x already there. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. """ if lo < 0: raise ValueError('lo must be non-negative') if hi is None: hi = len(a) while lo < hi: mid = (lo+hi)//2 if a[mid] < x: lo = mid+1 else: hi = mid return lo # Overwrite above definitions with a fast C implementation try: from _bisect import * except ImportError: pass
[+]
..
[-] __phello__.foo.py
[edit]
[-] zipfile.py
[edit]
[-] _dummy_thread.py
[edit]
[-] signal.py
[edit]
[-] tabnanny.py
[edit]
[-] cmd.py
[edit]
[-] cProfile.py
[edit]
[-] tempfile.py
[edit]
[-] argparse.py
[edit]
[-] platform.py
[edit]
[-] binhex.py
[edit]
[-] antigravity.py
[edit]
[+]
curses
[-] _compat_pickle.py
[edit]
[-] statistics.py
[edit]
[-] inspect.py
[edit]
[-] ipaddress.py
[edit]
[-] sunau.py
[edit]
[-] imghdr.py
[edit]
[-] random.py
[edit]
[-] macpath.py
[edit]
[-] hmac.py
[edit]
[-] base64.py
[edit]
[-] cgitb.py
[edit]
[-] stringprep.py
[edit]
[-] ast.py
[edit]
[-] textwrap.py
[edit]
[-] enum.py
[edit]
[-] _compression.py
[edit]
[-] dis.py
[edit]
[+]
venv
[-] chunk.py
[edit]
[-] this.py
[edit]
[-] py_compile.py
[edit]
[-] fnmatch.py
[edit]
[+]
xml
[-] opcode.py
[edit]
[+]
site-packages
[-] sre_compile.py
[edit]
[-] _pyio.py
[edit]
[-] pty.py
[edit]
[-] datetime.py
[edit]
[-] macurl2path.py
[edit]
[+]
lib2to3
[+]
wsgiref
[-] heapq.py
[edit]
[-] keyword.py
[edit]
[-] codecs.py
[edit]
[+]
ensurepip
[-] pickletools.py
[edit]
[-] compileall.py
[edit]
[-] nturl2path.py
[edit]
[-] warnings.py
[edit]
[-] shutil.py
[edit]
[-] socket.py
[edit]
[-] pdb.py
[edit]
[-] zipapp.py
[edit]
[-] formatter.py
[edit]
[-] _sitebuiltins.py
[edit]
[-] _markupbase.py
[edit]
[-] types.py
[edit]
[-] runpy.py
[edit]
[-] uu.py
[edit]
[-] typing.py
[edit]
[-] pathlib.py
[edit]
[-] _threading_local.py
[edit]
[-] mailcap.py
[edit]
[-] bisect.py
[edit]
[-] linecache.py
[edit]
[-] colorsys.py
[edit]
[-] glob.py
[edit]
[-] sndhdr.py
[edit]
[-] ssl.py
[edit]
[-] _strptime.py
[edit]
[-] _sysconfigdata_m_linux_x86_64-linux-gnu.py
[edit]
[-] imp.py
[edit]
[-] contextlib.py
[edit]
[-] copyreg.py
[edit]
[-] filecmp.py
[edit]
[+]
logging
[-] operator.py
[edit]
[-] token.py
[edit]
[-] gzip.py
[edit]
[-] string.py
[edit]
[-] genericpath.py
[edit]
[-] _osx_support.py
[edit]
[-] stat.py
[edit]
[-] lzma.py
[edit]
[-] __future__.py
[edit]
[+]
distutils
[-] dummy_threading.py
[edit]
[+]
asyncio
[-] webbrowser.py
[edit]
[-] symtable.py
[edit]
[+]
lib-dynload
[-] getopt.py
[edit]
[-] wave.py
[edit]
[-] codeop.py
[edit]
[-] _sysconfigdata_dm_linux_x86_64-linux-gnu.py
[edit]
[-] abc.py
[edit]
[+]
config-3.6m-x86_64-linux-gnu
[+]
pydoc_data
[-] telnetlib.py
[edit]
[+]
unittest
[-] fileinput.py
[edit]
[-] ftplib.py
[edit]
[+]
ctypes
[-] _bootlocale.py
[edit]
[-] pipes.py
[edit]
[-] aifc.py
[edit]
[-] pprint.py
[edit]
[-] queue.py
[edit]
[-] difflib.py
[edit]
[+]
__pycache__
[-] uuid.py
[edit]
[-] reprlib.py
[edit]
[-] threading.py
[edit]
[+]
http
[-] sre_parse.py
[edit]
[-] subprocess.py
[edit]
[+]
importlib
[-] selectors.py
[edit]
[-] getpass.py
[edit]
[-] trace.py
[edit]
[-] struct.py
[edit]
[-] tracemalloc.py
[edit]
[-] plistlib.py
[edit]
[-] asynchat.py
[edit]
[-] fractions.py
[edit]
[-] shlex.py
[edit]
[-] bdb.py
[edit]
[-] locale.py
[edit]
[-] calendar.py
[edit]
[-] poplib.py
[edit]
[-] posixpath.py
[edit]
[-] imaplib.py
[edit]
[+]
concurrent
[-] pickle.py
[edit]
[-] timeit.py
[edit]
[+]
json
[-] traceback.py
[edit]
[+]
multiprocessing
[-] shelve.py
[edit]
[-] csv.py
[edit]
[-] tarfile.py
[edit]
[-] numbers.py
[edit]
[-] optparse.py
[edit]
[-] cgi.py
[edit]
[-] pstats.py
[edit]
[-] crypt.py
[edit]
[+]
collections
[-] site.py
[edit]
[-] pkgutil.py
[edit]
[-] re.py
[edit]
[-] pyclbr.py
[edit]
[-] socketserver.py
[edit]
[-] _pydecimal.py
[edit]
[-] pydoc.py
[edit]
[-] sre_constants.py
[edit]
[-] xdrlib.py
[edit]
[-] nntplib.py
[edit]
[-] mimetypes.py
[edit]
[+]
email
[-] quopri.py
[edit]
[-] doctest.py
[edit]
[-] profile.py
[edit]
[-] sched.py
[edit]
[-] hashlib.py
[edit]
[+]
urllib
[-] secrets.py
[edit]
[-] functools.py
[edit]
[-] smtplib.py
[edit]
[-] copy.py
[edit]
[+]
dbm
[-] tty.py
[edit]
[-] os.py
[edit]
[-] _collections_abc.py
[edit]
[-] configparser.py
[edit]
[-] _weakrefset.py
[edit]
[-] netrc.py
[edit]
[-] code.py
[edit]
[-] asyncore.py
[edit]
[-] tokenize.py
[edit]
[+]
encodings
[-] io.py
[edit]
[-] smtpd.py
[edit]
[-] sysconfig.py
[edit]
[-] decimal.py
[edit]
[+]
sqlite3
[-] rlcompleter.py
[edit]
[-] ntpath.py
[edit]
[+]
test
[-] weakref.py
[edit]
[-] symbol.py
[edit]
[-] modulefinder.py
[edit]
[+]
xmlrpc
[-] bz2.py
[edit]
[-] gettext.py
[edit]
[-] mailbox.py
[edit]
[+]
html