Prompt:
def f_36402748(df):
	return

import pandas as pd

def check(candidate):

    COLUMN_NAMES = ["chemicals", "prots", "scores"]
    data = [["chemical1", "prot1", 100],["chemical2", "prot2", 50],["chemical3", "prot1", 120]]
    df = pd.DataFrame(data, columns = COLUMN_NAMES)
    assert candidate(df).to_dict() == {'scores': {'prot1': 220, 'prot2': 50}}

sort a Dataframe `df` by the total ocurrences in a column 'scores' group by 'prots'


Prompt:
def f_29881993(trans):
	return

    trans = {'category':["hello", "world","test"], 'dummy_key':["dummy_val"]}
    assert candidate(trans) == "hello,world,test"

join together with "," elements inside a list indexed with 'category' within a dictionary `trans`


Prompt:
def f_34158494():
	return

concatenate array of strings `['A', 'B', 'C', 'D']` into a string


Prompt:
def f_12666897(sents):
	return

[x for x in sents if not x.startswith('@$\t') and not x.startswith('#')]

    sents = ["@$	abcd", "#453923", "abcd", "hello", "1"]
    assert candidate(sents) == ["abcd", "hello", "1"]

    sents = ["#tabcd", "##453923", "abcd", "hello", "1"]
    assert candidate(sents) == ["abcd", "hello", "1"]

Remove all strings from a list a strings `sents` where the values starts with `@$\t` or `#`


Prompt: def f_5944630(list):

list.sort(key=lambda item: (item['points'], item['time']))

sort a list of dictionary `list` first by key `points` and then by `time`


Prompt:
def f_7852855():
	return

import time
import datetime

def check(candidate):

convert datetime object `(1970, 1, 1)` to seconds


Prompt:
def f_2763750():
	return

assert candidate() == 'long.file.name_suff.jpg'

insert `_suff` before the file extension in `long.file.name.jpg` or replace `_a` with `suff` if it precedes the extension.


Prompt: def f_6420361(module):

import imp
from unittest.mock import Mock

def check(candidate):

    imp.reload = Mock()
    try:
        candidate('ads')
        assert True
    except:
        assert False


Prompt:
def f_19546911(number):
	return

Convert integer `number` into an unassigned integer


Prompt: def f_9746522(numlist):

convert int values in list `numlist` to float


Prompt: def f_20107570(df, filename):

import pandas as pd

def check(candidate):

    file_name = 'a.csv'
    df = pd.DataFrame([1, 2, 3], columns = ['Vals'])
    candidate(df, file_name)
    with open (file_name, 'r') as f:
        lines = f.readlines()
    assert len(lines) == 4

write dataframe `df`, excluding index, to a csv file `filename`


Prompt: def f_8740353(unescaped):

    x = """{
    "Name": "Jennifer Smith",
    "Contact Number": 7867567898,
    "Email": "jen123@gmail.com",
    "Hobbies":["Reading", "Sketching", "Horse Riding"]
    }"""
    assert candidate(x) == {'Hobbies': ['Reading', 'Sketching', 'Horse Riding'], 'Name': 'Jennifer Smith', 'Email': 'jen123@gmail.com', 'Contact Number': 7867567898}

convert a urllib unquoted string `unescaped` to a json data `json_data`


Prompt:
def f_5891453():
	return

    chars = candidate()
    assert len(chars) == 127
    assert chars == [chr(i) for i in range(127)]

Create a list containing all ascii characters as its elements


Prompt: def f_18367007(newFileBytes, newFile):

    newFileBytes = [123, 3, 123, 100, 99]
    file_name = 'f.txt'
    newFile = open(file_name, 'wb')
    candidate(newFileBytes, newFile)
    newFile.close()
    with open (file_name, 'rb') as f:
        lines = f.readlines()
        assert lines == [b'{{dc']

write `newFileBytes` to a binary file `newFile`


Prompt:
def f_21805490(string):
	return

assert candidate("AASKH317298DIUANFProgramming is fun") == "Programming is fun"

python regex - check for a capital letter with a following lowercase in string `string`


Prompt:
def f_16125229(dict):
	return

assert candidate({'t': 1, 'r': 2}) == 'r'


Prompt:
def f_6159900(f):
	return

    file_name = 'a.txt'
    f = open(file_name, 'w')
    candidate(f)
    f.close()
    with open (file_name, 'r') as f:
        lines = f.readlines()
        assert lines[0] == 'hi there\n'


Prompt: def f_6159900(myfile):

	f = open(myfile, 'w')
	f.write("hi there\n")
	f.close()

    file_name = 'myfile'
    candidate(file_name)
    with open (file_name, 'r') as f:
        lines = f.readlines()
        assert lines[0] == 'hi there\n'


Prompt: def f_6159900():

	with open('somefile.txt', 'a') as the_file:
		the_file.write('Hello\n')

    file_name = 'somefile.txt'
    candidate()
    with open (file_name, 'r') as f:
        lines = f.readlines()
        assert lines[0] == 'Hello\n'

write line "Hello" to file `somefile.txt`


Prompt:
def f_19527279(s):
	return

assert candidate('hello world!') == b'hello world!'


Prompt:
def f_356483(text):
	return

assert candidate('Test0.9ssd') == ['0.9']

assert candidate('Test0.0 ..2ssd') == ['0.0']

Find all numbers and dots from a string `text` using regex


Prompt:
def f_38081866():
	return

import os
from unittest.mock import Mock

def check(candidate):

    os.system = Mock()
    try:
        candidate()
        assert True
    except:
        assert False

execute script 'script.ps1' using 'powershell.exe' shell


Prompt: def f_7349646(b):

Sort a list of tuples `b` by third item in the tuple


Prompt:
def f_10607688():
	return

    y = candidate()
    assert y.year >= 2022

create a datetime with the current date & time


Prompt:
def f_30843103(lst):
	return

next(i for i, x in enumerate(lst) if not isinstance(x, bool) and x == 1)

    lst = [True, False, 1, 3]
    assert candidate(lst) == 2

get the index of an integer `1` from a list `lst` if the list also contains boolean items


Prompt: def f_4918425(a):

    a = [14, 15]
    candidate(a)
    assert a == [1, 2]

subtract 13 from every number in a list `a`


Prompt:
def f_17794266(x):
	return

import numpy as np

def check(candidate):

    x = np.matrix([[1, 1], [2, -3]])
    assert candidate(x) == -3

get the highest element in absolute value in a numpy matrix `x`


Prompt:
def f_30551576(s):
	return

re.findall(r'"(http.*?)"', s, re.MULTILINE | re.DOTALL)

    s = (
      '     [irrelevant javascript code here]'
      '     sources:[{file:"http://url.com/folder1/v.html",label:"label1"},'
      '     {file:"http://url.com/folder2/v.html",label:"label2"},'
      '     {file:"http://url.com/folder3/v.html",label:"label3"}],'
      '     [irrelevant javascript code here]'
    )
    assert candidate(s) == ['http://url.com/folder1/v.html', 'http://url.com/folder2/v.html', 'http://url.com/folder3/v.html']

    s = (
      '     [irrelevant javascript code here]'
      '     [irrelevant python code here]'
    )
    assert candidate(s) == []


Prompt:
def f_113534(mystring):
	return

assert candidate("This is the string I want to split") ==       ['This',' ','is',' ','the',' ','string',' ','I',' ','want',' ','to',' ','split']

split a string `mystring` considering the spaces ' '


Prompt:
def f_5838735(path):
	return

    with open('tmp.txt', 'w') as fw: fw.write('hello world!')
    f = candidate('tmp.txt')
    assert f.name == 'tmp.txt'
    assert f.mode == 'r'


Prompt:
def f_36003967(data):
	return

[[sum(item) for item in zip(*items)] for items in zip(*data)]

sum elements at the same index in list `data`


Prompt:
def f_7635237(a):
	return

import numpy as np

def check(candidate):