original_docstring:  For MLC storage, pack adjacency matrix according to MLC settings
  
    :param M: adjacency matrix representing stored graph
    :param bpc: bits-per-cell for MLC storage format
    
docstring: For MLC storage, pack adjacency matrix according to MLC settings
docstring_tokens: For MLC storage pack adjacency matrix according to MLC settings
code: def pack_bits(M, bpc=2): #pack multiple bits per entry according to storage density
    """ For MLC storage, pack adjacency matrix according to MLC settings
  
    :param M: adjacency matrix representing stored graph
    :param bpc: bits-per-cell for MLC storage format
    """
    entries = int(np.ceil(len(M)/bpc))
    M_pack = np.zeros((len(M), entries))
    for n in range(len(M)):
      for e in range(entries): #iterate over each entry of the packed M
        for b in range(bpc): #extract and append a bit according to cfg
          dst = e*(bpc)+b
          #print(n, e, M_pack[n][e], n, dst, M[n][dst])
          if (dst) >= len(M):
            continue #if out of range of number of nodes, don't add
          if M[n][dst] > 0:
            M_pack[n][e] += 2**(b)
  
    #print(M_pack)
    return M_pack
code_tokens: def pack_bits ( M , bpc = 2 ) : entries = int ( np . ceil ( len ( M ) / bpc ) ) M_pack = np . zeros ( ( len ( M ) , entries ) ) for n in range ( len ( M ) ) : for e in range ( entries ) : for b in range ( bpc ) : dst = e * ( bpc ) + b if ( dst ) >= len ( M ) : continue if M [ n ] [ dst ] > 0 : M_pack [ n ] [ e ] += 2 ** ( b ) return M_pack
short_docstring: For MLC storage, pack adjacency matrix according to MLC settings
short_docstring_tokens: For MLC storage pack adjacency matrix according to MLC settings
comment: #pack multiple bits per entry according to storage density$SEP$""" For MLC storage, pack adjacency matrix according to MLC settings
  
    :param M: adjacency matrix representing stored graph
    :param bpc: bits-per-cell for MLC storage format
    """$SEP$#iterate over each entry of the packed M$SEP$#extract and append a bit according to cfg$SEP$#print(n, e, M_pack[n][e], n, dst, M[n][dst])$SEP$#if out of range of number of nodes, don't add$SEP$#print(M_pack)