Takes portion of the byte array and passes it to the function for transformation.
    Result is replaced in the byte string, new one is created.
    :param byte_str:
    :param start_idx:
    :param stop_idx:
    :param fction:
    :return:
970356
def bytes_transform(byte_str, start_idx, stop_idx, fction):
    
    return bytes_replace(byte_str, start_idx, stop_idx, fction(byte_str[start_idx:stop_idx]))
773291
public static String formatBytes(byte[] data, int start, int count) {
    if(isTracing())
      return SibTr.formatBytes(data, start, count);
    else
      return "";
  }
1323422
def getbyteslice(self, start, end):
        """"""
        c = self._rawarray[start:end]
        return c
498748
private String zeroEndByteArrayToString(byte[] bytes) throws IOException
    {
        int i = 0;
        
        for ( i = 0; i < bytes.length && bytes[i] != 0; i++ );
        
        return new String( bytes, 0, i );
        
    }
317054
private void skip(boolean stopAtImport, boolean stopAtMemberDecl, boolean stopAtIdentifier, boolean stopAtStatement) {
         while (true) {
             switch (token.kind) {
                case SEMI:
                    nextToken();
                    return;
                case PUBLIC:
                case FINAL:
                case ABSTRACT:
                case MONKEYS_AT:
                case EOF:
                case CLASS:
                case INTERFACE:
                case ENUM:
                    return;
                case IMPORT:
                    if (stopAtImport)
                        return;
                    break;
                case LBRACE:
                case RBRACE:
                case PRIVATE:
                case PROTECTED:
                case STATIC:
                case TRANSIENT:
                case NATIVE:
                case VOLATILE:
                case SYNCHRONIZED:
                case STRICTFP:
                case LT:
                case BYTE:
                case SHORT:
                case CHAR:
                case INT:
                case LONG:
                case FLOAT:
                case DOUBLE:
                case BOOLEAN:
                case VOID:
                    if (stopAtMemberDecl)
                        return;
                    break;
                case UNDERSCORE:
                case IDENTIFIER:
                   if (stopAtIdentifier)
                        return;
                    break;
                case CASE:
                case DEFAULT:
                case IF:
                case FOR:
                case WHILE:
                case DO:
                case TRY:
                case SWITCH:
                case RETURN:
                case THROW:
                case BREAK:
                case CONTINUE:
                case ELSE:
                case FINALLY:
                case CATCH:
                    if (stopAtStatement)
                        return;
                    break;
            }
            nextToken();
        }
    }
265669
public byte[] toByteArray(int start, int end) {
        return Arrays.copyOfRange(value, start + offset, end + offset);
    }
480509
public static int bytesToInt(byte[] bytes, int start)
    {
        int num = bytes[start] & 0xFF;
        num |= ((bytes[start + 1] << 8) & 0xFF00);
        num |= ((bytes[start + 2] << 16) & 0xFF0000);
        num |= ((bytes[start + 3] << 24) & 0xFF000000);
        return num;
    }
895955
void tos_into_slot( int d, int n, String id ) {
    // In a copy-on-modify language, only update the local scope, or return val
    assert d==0 || (d==1 && _display[_tod]==n+1);
    int idx = _display[_tod-d]+n;
    // Temporary solution to kill a UDF from global name space. Needs to fix in the future.
    if (_tod == 0) ASTOp.removeUDF(id);
    subRef(_ary[idx], _key[idx]);
    subRef(_fcn[idx]);
    Frame fr =                   _ary[_sp-1];
    _ary[idx] = fr==null ? null : addRef(new Frame(fr));
    _d  [idx] =                  _d  [_sp-1] ;
    _str[idx] =                  _str[_sp-1] ;
    _fcn[idx] =           addRef(_fcn[_sp-1]);
    _key[idx] = d==0 && fr!=null ? id : null;
    // Temporary solution to add a UDF to global name space. Needs to fix in the future.
    if (_tod == 0 && _fcn[_sp-1] != null) ASTOp.putUDF(_fcn[_sp-1], id);
    assert _ary[0]== null || check_refcnt(_ary[0].anyVec());
  }
1020906
private static byte[] extractBytes(
      String str, 
      int startIndex, 
      int endIndex,
      char[] charArray, 
      boolean canFastConvert) throws UnsupportedEncodingException {
    if (canFastConvert) {
      // fast conversion, just copy the raw bytes
      final int len = endIndex - startIndex;
      byte[] strBytes = new byte[len];
      for (int i = 0; i < len; i++) {
        strBytes[i] = (byte) charArray[startIndex + i];
      }
      return strBytes;
    } 
    // otherwise, do expensive conversion
    return str.substring(startIndex, endIndex).getBytes(utf8charsetName);
  }
953827
public static int bytesHighFirstToInt(byte[] bytes, int start)
    {
        int num = bytes[start + 3] & 0xFF;
        num |= ((bytes[start + 2] << 8) & 0xFF00);
        num |= ((bytes[start + 1] << 16) & 0xFF0000);
        num |= ((bytes[start] << 24) & 0xFF000000);
        return num;
    }
402299
def zrevrange(self, key, start, stop, withscores=False, encoding=_NOTSET):
        
        if not isinstance(start, int):
            raise TypeError("start argument must be int")
        if not isinstance(stop, int):
            raise TypeError("stop argument must be int")
        if withscores:
            args = [b'WITHSCORES']
        else:
            args = []
        fut = self.execute(b'ZREVRANGE', key, start, stop, *args,
                           encoding=encoding)
        if withscores:
            return wait_convert(fut, pairs_int_or_float)
        return fut
903870
public static ByteBuffer copy(ByteBuffer src, int start, int end) {
		return copy(src, ByteBuffer.allocate(end - start));
	}
888917
public static byte[] getIncreasingByteArray(int start, int len) {
    byte[] ret = new byte[len];
    for (int k = 0; k < len; k++) {
      ret[k] = (byte) (k + start);
    }
    return ret;
  }
875020
def terminate_bits(self, payload):
        
        data_capacity = tables.data_capacity[self.version][self.error][0]

        if len(payload) > data_capacity:
            raise ValueError('The supplied data will not fit '
                             'within this version of a QR code.')

        #We must add up to 4 zeros to make up for any shortfall in the
        #length of the data field.
        if len(payload) == data_capacity:
            return None
        elif len(payload) <= data_capacity-4:
            bits = self.binary_string(0,4)
        else:
            #Make up any shortfall need with less than 4 zeros
            bits = self.binary_string(0, data_capacity - len(payload))

        return bits
117087
def splice(self, new_str, start, end=None):
        
        if len(new_str) == 0:
            return self
        new_fs = new_str if isinstance(new_str, FmtStr) else fmtstr(new_str)
        assert len(new_fs.chunks) > 0, (new_fs.chunks, new_fs)
        new_components = []
        inserted = False
        if end is None:
            end = start
        tail = None

        for bfs, bfs_start, bfs_end in zip(self.chunks,
                                           self.divides[:-1],
                                           self.divides[1:]):
            if end == bfs_start == 0:
                new_components.extend(new_fs.chunks)
                new_components.append(bfs)
                inserted = True

            elif bfs_start <= start < bfs_end:
                divide = start - bfs_start
                head = Chunk(bfs.s[:divide], atts=bfs.atts)
                tail = Chunk(bfs.s[end - bfs_start:], atts=bfs.atts)
                new_components.extend([head] + new_fs.chunks)
                inserted = True

                if bfs_start < end < bfs_end:
                    tail = Chunk(bfs.s[end - bfs_start:], atts=bfs.atts)
                    new_components.append(tail)

            elif bfs_start < end < bfs_end:
                divide = start - bfs_start
                tail = Chunk(bfs.s[end - bfs_start:], atts=bfs.atts)
                new_components.append(tail)

            elif bfs_start >= end or bfs_end <= start:
                new_components.append(bfs)

        if not inserted:
            new_components.extend(new_fs.chunks)
            inserted = True

        return FmtStr(*[s for s in new_components if s.s])
406297
def get_output(self, idx=-1):
        
        buff = ""

        data = self.get_data()

        buff += repr(data) + " | "
        for i in range(0, len(data)):
            buff += "\\x%02x" % data[i]

        return buff
997817
def _first_stoppoint(self, irsb, extra_stop_points=None):
        
        if self._stop_points is None and extra_stop_points is None and self.project is None:
            return None

        first_imark = True
        for stmt in irsb.statements:
            if type(stmt) is pyvex.stmt.IMark:  # pylint: disable=unidiomatic-typecheck
                addr = stmt.addr + stmt.delta
                if not first_imark:
                    if self.is_stop_point(addr, extra_stop_points):
                        # could this part be moved by pyvex?
                        return addr
                    if stmt.delta != 0 and self.is_stop_point(stmt.addr, extra_stop_points):
                        return addr

                first_imark = False
        return None