human
I found an interesting problem on https://codeforces.com/problemset/problem/600/B:
You are given two arrays of integers a and b. For each element of the second array b_{j} you should find the number of elements in array a that are less than or equal to the value b_{j}.

-----Input-----

The first line contains two integers n, m (1 ≤ n, m ≤ 2·10^5) — the sizes of arrays a and b.

The second line contains n integers — the elements of array a ( - 10^9 ≤ a_{i} ≤ 10^9).

The third line contains m integers — the elements of array b ( - 10^9 ≤ b_{j} ≤ 10^9).

-----Output-----

Print m integers, separated by spaces: the j-th of which is equal to the number of such elements in array a that are less than or equal to the value b_{j}.

-----Examples-----
Input
5 4
1 3 5 7 9
6 4 2 8

Output
3 2 1 4

Input
5 5
1 2 1 2 5
3 1 4 1 5

Output
4 2 4 2 5

I tried it in Python, but could not do it. Can you solve it?

 ... Give me a Python code to find the number of elements in array a that are less than or equal to the value b_{j}?
assistant
#Here is Python code to find the number of elements in array a that are less than or equal to the value b_{j}.

#!/usr/bin/env python3
# 600B_query.py - Codeforces.com/problemset/problem/600/B by Sergey 2015

import unittest
import sys

###############################################################################
# Query Class (Main Program)
###############################################################################

def rbound(v, n):
    b = 0
    e = len(v)
    while b != e:
        mid = (b + e + 1) // 2
        if v[mid - 1] <= n:
            b = mid
        else:
            e = mid - 1
    return b

class Query:
    """ Query representation """

    def __init__(self, test_inputs=None):
        """ Default constructor """

        it = iter(test_inputs.split("\n")) if test_inputs else None

        def uinput():
            return next(it) if it else sys.stdin.readline().rstrip()

        # Reading single elements
        [self.n, self.m] = list(map(int, uinput().split()))

        # Reading a single line of multiple elements
        self.numa = list(map(int, uinput().split()))
        self.numb = list(map(int, uinput().split()))

        self.snuma = sorted(self.numa)

    def calculate(self):
        """ Main calcualtion function of the class """

        result = []
        for n in self.numb:
            result.append(rbound(self.snuma, n))

        return str(" ".join(map(str, result)))

###############################################################################
# Unit Tests
###############################################################################

class unitTests(unittest.TestCase):

    def test_single_test(self):
        """ Query class testing """

        # Constructor test
        test = "5 4\n1 3 5 7 9\n6 4 2 8"
        d = Query(test)
        self.assertEqual(d.n, 5)
        self.assertEqual(d.m, 4)

        # Sample test
        self.assertEqual(Query(test).calculate(), "3 2 1 4")

        # Sample test
        test = "5 5\n1 2 1 2 5\n3 1 4 1 5"
        self.assertEqual(Query(test).calculate(), "4 2 4 2 5")

        # Sample test
        test = ""
        #...