human
I wrote the below code

    def apply_fn(results, i, data, kwargs):
        results[i] = fn(data, **kwargs)
    if (thread_count is None):
        results = ([None] * len(data))
        threads = []
        for i in range(len(data)):
            t = threading.Thread(name='threading_and_return', target=apply_fn, args=(results, i, data[i], kwargs))
            t.start()
            threads.append(t)
    else:
        divs = np.linspace(0, len(data), (thread_count + 1))
        divs = np.round(divs).astype(int)
        results = ([None] * thread_count)
        threads = []
        for i in range(thread_count):
            t = threading.Thread(name='threading_and_return', target=apply_fn, args=(results, i, data[divs[i]:divs[(i + 1)]], kwargs))
            t.start()
            threads.append(t)
    for t in threads:
        t.join()
    if (thread_count is None):
        return np.asarray(results)
    else:
        return np.concatenate(results)

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def threading_data(data=None, fn=None, thread_count=None, **kwargs):