neulab/odex huggingface dataset:
# filter rows in pandas starting with alphabet 'f' using regular expression.
def f_15325182(df):
	return df.b.str.contains('^f')

import pandas as pd 

def check(candidate):
    df = pd.DataFrame([[1, 'fat'], [2, 'hip'], [3, 'foo']], columns = ['a', 'b'])
    expected = [True, False, True]
    actual = candidate(df)
    for i in range (0, len(expected)):
        assert expected[i] == actual[i]
# print a 2 dimensional list `tab` as a table with delimiters
def f_583557(tab):
	return '\n'.join('\t'.join(str(col) for col in row) for row in tab)

def check(candidate):
    assert candidate([[1,2,3],[4,5,6]]) == "1\t2\t3\n4\t5\t6"

    assert candidate([[1, 'x' ,3],[4.4,5,"six"]]) == "1\tx\t3\n4.4\t5\tsix"

    assert candidate([]) == ""

    assert candidate([[],[],[]]) == "\n\n"
# pandas: delete rows in dataframe `df` based on multiple columns values
def f_38535931(df, tuples):
	return df.set_index(list('BC')).drop(tuples, errors='ignore').reset_index()

import pandas as pd

def check(candidate):
    df = pd.DataFrame([[3, 4], [4, 5], [-1, -2]], columns = ['B', 'C'])
    tuples = [(3, 4), (-1, -2)]
    expected = pd.DataFrame([[4, 5]], columns = ['B', 'C'])
    actual = candidate(df, tuples)
    assert pd.DataFrame.equals(actual, expected)
# format the variables `goals` and `penalties` using string formatting
def f_13945749(goals, penalties):
	return """({:d} goals, ${:d})""".format(goals, penalties)

def check(candidate):
    assert candidate(0, 0) == "(0 goals, $0)"

    assert candidate(123, 2) == "(123 goals, $2)"
# format string "({} goals, ${})" with variables `goals` and `penalties`
def f_13945749(goals, penalties):
	return """({} goals, ${})""".format(goals, penalties)

def check(candidate):
    assert candidate(0, 0) == "(0 goals, $0)"

    assert candidate(123, "???") == "(123 goals, $???)"

    assert candidate("x", 0.0) == "(x goals, $0.0)"
# convert list of lists `L` to list of integers
def f_18524642(L):
	return [int(''.join(str(d) for d in x)) for x in L]

def check(candidate):
    assert candidate([[1,2], [2,3,4], [1,0,0]]) == [12,234,100]

    assert candidate([[1], [2], [3]]) == [1,2,3]
# convert a list of lists `L` to list of integers
def f_18524642(L):
	L = [int(''.join([str(y) for y in x])) for x in L]
	return L

def check(candidate):
    assert candidate([[1,2], [2,3,4], [1,0,0]]) == [12,234,100]

    assert candidate([[1], [2], [3]]) == [1,2,3]

    assert candidate([[1, 0], [0, 2], [3], [0, 0, 0, 0]]) == [10,2,3, 0]
# write the elements of list `lines` concatenated by special character '\n' to file `myfile`
def f_7138686(lines, myfile):
	myfile.write('\n'.join(lines))
	return 

def check(candidate):
    with open('tmp.txt', 'w') as myfile:
        candidate(["first", "second", "third"], myfile)
    with open('tmp.txt', 'r') as fr: 
        lines = fr.readlines()
    assert lines == ["first\n", "second\n", "third"]
# Remove duplicate words from a string `text` using regex
def f_17238587(text):
	text = re.sub('\\b(\\w+)( \\1\\b)+', '\\1', text)
	return text

import re 

def check(candidate):
    assert candidate("text") == "text"

    assert candidate("text text") == "text"

    assert candidate("texttext") == "texttext"

    assert candidate("text and text") == "text and text"
# count non zero values in each column in pandas data frame `df`
def f_26053849(df):
	return df.astype(bool).sum(axis=1)

import pandas as pd 

def check(candidate):
    df1 = pd.DataFrame([[0,0,0], [0,1,0], [1,1,1]])
    assert candidate(df1).to_list() == [0, 1, 3]

    df2 = pd.DataFrame([[0,0,0], [0,2,0], [1,10,8.9]])
    assert candidate(df1).to_list() == [0, 1, 3]

    df2 = pd.DataFrame([[0,0.0,0], [0,2.0,0], [1,10,8.9]])
    assert candidate(df1).to_list() == [0, 1, 3]

    df = df = pd.DataFrame([[4, 0, 0], [1, 0, 1]])
    expected = [1, 2]
    actual = candidate(df)
    for i in range(0, len(expected)):
        assert expected[i] == actual[i]
# search for string that matches regular expression pattern '(?<!Distillr)\\\\AcroTray\\.exe' in string 'C:\\SomeDir\\AcroTray.exe'
def f_15534223():
	return re.search('(?<!Distillr)\\\\AcroTray\\.exe', 'C:\\SomeDir\\AcroTray.exe')

import re 

def check(candidate):
    result = candidate()
    assert result.span() == (10, 23)
    assert result.string == "C:\SomeDir\AcroTray.exe"
# split string 'QH QD JC KD JS' into a list on white spaces
def f_5453026():
	return """QH QD JC KD JS""".split()

def check(candidate):
    assert candidate() == ["QH", "QD", "JC", "KD", "JS"]
# search for occurrences of regex pattern '>.*<' in xml string `line`
def f_18168684(line):
	return re.search('>.*<', line).group(0)

import re 

def check(candidate):
    assert candidate("hahhdsf>0.0<;sgnd") == ">0.0<"

    assert candidate("hahhdsf>2.34<;xbnfm") == ">2.34<"
# erase all the contents of a file `filename`
def f_4914277(filename):
	return open(filename, 'w').close()

def check(candidate):
    filename = 'tmp.txt'
    with open(filename, 'w') as fw: fw.write("hello world!")
    with open(filename, 'r') as fr: 
        lines = fr.readlines()
        assert len(lines) == 1 and lines[0] == "hello world!"
    candidate(filename)
    with open(filename, 'r') as fr: 
        lines = fr.readlines()
        assert len(lines) == 0
# convert a string `string_date` into datetime using the format '%Y-%m-%d %H:%M:%S.%f'
def f_19068269(string_date):
	return datetime.datetime.strptime(string_date, '%Y-%m-%d %H:%M:%S.%f')

import datetime 

def check(candidate):
    assert candidate('2022-10-22 11:59:59.20') == datetime.datetime(2022, 10, 22, 11, 59, 59, 200000)

    assert candidate('2000-01-01 11:59:59.20') == datetime.datetime(2000, 1, 1, 11, 59, 59, 200000)

    assert candidate('1990-09-09 09:59:59.24') == datetime.datetime(1990, 9, 9, 9, 59, 59, 240000)

    d = candidate('2022-12-14 07:06:00.25')
    assert d == datetime.datetime(2022, 12, 14, 7, 6, 0, 250000)
# find the index of a list with the first element equal to '332' within the list of lists `thelist`
def f_20683167(thelist):
	return [index for index, item in enumerate(thelist) if item[0] == '332']

def check(candidate):
    assert candidate([[0,1,2], ['a','bb','ccc'], ['332',33,2], [33,22,332]]) == [2]

    assert candidate([[0,1,2], ['332'], ['332'], ['332']]) == [1,2,3]

    assert candidate([[0,1,2], [332], [332], [332]]) == []
# lower a string `text` and remove non-alphanumeric characters aside from space
def f_30693804(text):
	return re.sub('[^\\sa-zA-Z0-9]', '', text).lower().strip()

import re

def check(candidate):
    assert candidate('ABjfK329r0&&*#5t') == 'abjfk329r05t'

    assert candidate('jseguwphegoi339yup h') == 'jseguwphegoi339yup h'

    assert candidate('   ') == ''
# remove all non-alphanumeric characters except space from a string `text` and lower it
def f_30693804(text):
	return re.sub('(?!\\s)[\\W_]', '', text).lower().strip()

import re

def check(candidate):
    assert candidate('ABjfK329r0&&*#5t') == 'abjfk329r05t'

    assert candidate('jseguwphegoi339yup h') == 'jseguwphegoi339yup h'

    assert candidate('   ') == ''
# subscript text 'H20' with '2' as subscripted in matplotlib labels for arrays 'x' and 'y'.
def f_17138464(x, y):
	return plt.plot(x, y, label='H\u2082O')

import numpy as np
import matplotlib.pyplot as plt

def check(candidate):
    pic = candidate(np.array([1,2,3]),np.array([4,5,6]))[0]
    assert pic.get_label() == 'H₂O'
    x, y = pic.get_data()
    assert all(x == np.array([1,2,3]))
    assert all(y == np.array([4,5,6]))

    pic = candidate(np.array([6, 7, 899]),np.array([0, 1, 245]))[0]
    assert pic.get_label() == 'H₂O'
    x, y = pic.get_data()
    assert all(x == np.array([6, 7, 899]))
    assert all(y == np.array([0, 1, 245]))
# subscript text 'H20' with '2' as subscripted in matplotlib labels for arrays 'x' and 'y'.
def f_17138464(x, y):
	return plt.plot(x, y, label='$H_2O$')

import numpy as np
import matplotlib.pyplot as plt

def check(candidate):
    pic = candidate(np.array([1,2,3]),np.array([4,5,6]))[0]
    assert pic.get_label() == '$H_2O$'
    x, y = pic.get_data()
    assert all(x == np.array([1,2,3]))
    assert all(y == np.array([4,5,6]))

    pic = candidate(np.array([6, 7, 899]),np.array([0, 1, 245]))[0]
    assert pic.get_label() == '$H_2O$'
    x, y = pic.get_data()
    assert all(x == np.array([6, 7, 899]))
    assert all(y == np.array([0, 1, 245]))
# loop over a list `mylist` if sublists length equals 3
def f_9138112(mylist):
	return [x for x in mylist if len(x) == 3]

def check(candidate):
    assert candidate([[1,2,3], 'abc', [345,53], 'avsvasf']) == [[1,2,3], 'abc']

    assert candidate([[435,654.4,45,2],[34,34,757,65,32423]]) == []
# initialize a list `lst` of 100 objects Object()
def f_1807026():
	lst = [Object() for _ in range(100)]
	return lst

class Object(): 
    def __init__(self): 
        self.name = "object"

def check(candidate):
    lst = candidate()
    assert all([x.name == "object" for x in lst])
# joining data from dataframe `df1` with data from dataframe `df2` based on matching values of column 'Date_Time' in both dataframes
def f_13793321(df1, df2):
	return df1.merge(df2, on='Date_Time')

import pandas as pd

def check(candidate):
    df1 = pd.DataFrame([[1, 2, 3]], columns=["Date", "Time", "Date_Time"])
    df2 = pd.DataFrame([[1, 3],[4, 9]], columns=["Name", "Date_Time"])
    assert candidate(df1, df2).to_dict() == {'Date': {0: 1}, 'Time': {0: 2}, 'Date_Time': {0: 3}, 'Name': {0: 1}}
# use `%s` operator to print variable values `str1` inside a string
def f_3367288(str1):
	return 'first string is: %s, second one is: %s' % (str1, 'geo.tif')

def check(candidate):
    assert candidate("s001") == "first string is: s001, second one is: geo.tif"

    assert candidate("") == "first string is: , second one is: geo.tif"

    assert candidate("  ") == "first string is:   , second one is: geo.tif"
# Split a string '2.MATCHES $$TEXT$$ STRING' by a delimiter '$$TEXT$$'
def f_3475251():
	return [x.strip() for x in '2.MATCHES $$TEXT$$ STRING'.split('$$TEXT$$')]

def check(candidate):
    assert candidate() == ['2.MATCHES', 'STRING']
# check if directory `directory ` exists and create it if necessary
def f_273192(directory):
	if (not os.path.exists(directory)):
	    os.makedirs(directory)
	return 

import os 

def check(candidate):
    candidate("hello")
    assert os.path.exists("hello")

    candidate("_some_dir")
    assert os.path.exists("_some_dir")
# check if a directory `path` exists and create it if necessary
def f_273192(path):
	try:
	    os.makedirs(path)
	except OSError:
	    if (not os.path.isdir(path)):
	        raise
	return 

import os 

def check(candidate):
    candidate("hello")
    assert os.path.exists("hello")

    candidate("_some_dir")
    assert os.path.exists("_some_dir")
# check if a directory `path` exists and create it if necessary
def f_273192(path):
	try:
	    os.makedirs(path)
	except OSError as exception:
	    if (exception.errno != errno.EEXIST):
	        raise
	return 

import os 

def check(candidate):
    candidate("hello")
    assert os.path.exists("hello")

    candidate("_some_dir")
    assert os.path.exists("_some_dir")
# Replace a separate word 'H3' by 'H1' in a string 'text'
def f_18785032(text):
	return re.sub('\\bH3\\b', 'H1', text)

import re

def check(candidate):
    assert candidate("hello world and H3") == "hello world and H1"

    assert candidate("hello world and H1") == "hello world and H1"

    assert candidate("hello world!") == "hello world!"
# substitute ASCII letters in string 'aas30dsa20' with empty string ''
def f_1450897():
	return re.sub('\\D', '', 'aas30dsa20')

import re

def check(candidate):
    assert candidate() == "3020"
# get digits only from a string `aas30dsa20` using lambda function
def f_1450897():
	return """""".join([x for x in 'aas30dsa20' if x.isdigit()])

def check(candidate):
    assert candidate() == "3020"
# access a tag called "name" in beautifulsoup `soup`
def f_14435268(soup):
	return soup.find('name').string

from bs4 import BeautifulSoup

def check(candidate):
    content = "<contact><name>LastName</name><lastName>FirstName</lastName><phone>+90 333 12345</phone></contact>"
    soup = BeautifulSoup(content)
    assert candidate(soup) == "LastName"

    content = "<name>hello world!</name>"
    soup = BeautifulSoup(content)
    assert candidate(soup) == "hello world!"
# Create new matrix object  by concatenating data from matrix A and matrix B
def f_20180210(A, B):
	return np.concatenate((A, B))

import numpy as np 

def check(candidate):
    A = np.array([1,2])
    B = np.array([3,4])
    assert np.allclose(candidate(A, B), np.array([1,2,3,4]))

    A = np.array([[1,2]])
    B = np.array([[3,4]])
    assert np.allclose(candidate(A, B), np.array([[1,2],[3,4]]))

    A = np.array([[1],[2]])
    B = np.array([[3],[4]])
    assert np.allclose(candidate(A, B), np.array([[1],[2],[3],[4]]))

    a = np.array([[1, 3, 4], [4, 5, 6], [6, 0, -1]])
    b = np.array([[5, 6, 1], [0, 2, -1], [9, 4, 1]])
    expected = np.array([[ 1, 3, 4], [ 4, 5, 6],
        [ 6, 0, -1], [ 5, 6, 1], [ 0, 2, -1], [ 9, 4, 1]])
    assert np.array_equal(candidate(a, b), expected)
# concat two matrices `A` and `B` in numpy
def f_20180210(A, B):
	return np.vstack((A, B))

import numpy as np 

def check(candidate):
    A = np.array([1,2])
    B = np.array([3,4])
    assert np.allclose(candidate(A, B), np.array([[1,2],[3,4]]))

    A = np.array([[1,2]])
    B = np.array([[3,4]])
    assert np.allclose(candidate(A, B), np.array([[1,2],[3,4]]))

    A = np.array([[1],[2]])
    B = np.array([[3],[4]])
    assert np.allclose(candidate(A, B), np.array([[1],[2],[3],[4]]))

    a = np.array([[1, 3, 4], [4, 5, 6], [6, 0, -1]])
    b = np.array([[5, 6, 1], [0, 2, -1], [9, 4, 1]])
    expected = np.array([[ 1, 3, 4], [ 4, 5, 6],
        [ 6, 0, -1], [ 5, 6, 1], [ 0, 2, -1], [ 9, 4, 1]])
    assert np.array_equal(candidate(a, b), expected)
# Get the characters count in a file `filepath`
def f_2011048(filepath):
	return os.stat(filepath).st_size

import os

def check(candidate):
    with open("tmp.txt", 'w') as fw: fw.write("hello world!")
    assert candidate("tmp.txt") == 12

    with open("tmp.txt", 'w') as fw: fw.write("")
    assert candidate("tmp.txt") == 0

    with open("tmp.txt", 'w') as fw: fw.write('\n')
    assert candidate("tmp.txt") == 1

    filename = 'o.txt'
    with open (filename, 'w') as f:
        f.write('a')
    assert candidate(filename) == 1
# count the occurrences of item "a" in list `l`
def f_2600191(l):
	return l.count('a')

def check(candidate):
    assert candidate("123456asf") == 1

    assert candidate("123456gyjnccfgsf") == 0

    assert candidate("aA"*10) == 10
# count the occurrences of items in list `l`
def f_2600191(l):
	return Counter(l)

from collections import Counter 

def check(candidate):
    assert dict(candidate("123456asf")) == {'1': 1, '2': 1, '3': 1, '4': 1, '5': 1, '6': 1, 'a': 1, 's': 1, 'f': 1}

    assert candidate("123456gyjnccfgsf") == {'1': 1,'2': 1,'3': 1,'4': 1,'5': 1,'6': 1,'g': 2,'y': 1,'j': 1,'n': 1,'c': 2,'f': 2,'s': 1}

    assert candidate("aA"*10) == {'a': 10, 'A': 10}

    y = candidate([1, 6])
    assert y[1] == 1
    assert y[6] == 1
# count the occurrences of items in list `l`
def f_2600191(l):
	return [[x, l.count(x)] for x in set(l)]

from collections import Counter 

def check(candidate):
    assert sorted(candidate("123456asf")) == [['1', 1],['2', 1],['3', 1],['4', 1],['5', 1],['6', 1],['a', 1],['f', 1],['s', 1]]

    assert sorted(candidate("aA"*10)) == [['A', 10], ['a', 10]]
# count the occurrences of items in list `l`
def f_2600191(l):
	return dict(((x, l.count(x)) for x in set(l)))

from collections import Counter 

def check(candidate):
    assert candidate("123456asf") == {'4': 1, 'a': 1, '1': 1, 's': 1, '6': 1, 'f': 1, '3': 1, '5': 1, '2': 1}

    assert candidate("aA"*10) == {'A': 10, 'a': 10}

    assert candidate([1, 6]) == {1: 1, 6: 1}
# count the occurrences of item "b" in list `l`
def f_2600191(l):
	return l.count('b')

def check(candidate):
    assert candidate("123456abbbsf") == 3

    assert candidate("123456gyjnccfgsf") == 0

    assert candidate("Ab"*10) == 10
# copy file `srcfile` to directory `dstdir`
def f_12842997(srcfile, dstdir):
	shutil.copy(srcfile, dstdir)
	return 

import shutil
from unittest.mock import Mock

def check(candidate):
    shutil.copy = Mock()
    try:
        candidate('opera.txt', '/')
    except:
        return False
# find the key associated with the largest value in dictionary `x` whilst key is non-zero value
def f_1555968(x):
	return max(k for k, v in x.items() if v != 0)

def check(candidate):
    assert candidate({'a': 1, 'b': 2, 'c': 2000}) == 'c'

    assert candidate({'a': 0., 'b': 0, 'c': 200.02}) == 'c'

    assert candidate({'key1': -100, 'key2': 0.}) == 'key1'

    x = {1:"g", 2:"a", 5:"er", -4:"dr"}
    assert candidate(x) == 5
# Put the curser at beginning of the file
def f_17021863(file):
	file.seek(0)
	return 

def check(candidate):
    with open ('a.txt', 'w') as f:
        f.write('kangaroo\nkoala\noxford\n')
    f = open('a.txt', 'r')
    f.read()
    candidate(f)
    assert f.readline() == 'kangaroo\n'
# combine values from column 'b' and column 'a' of dataframe `df`  into column 'c' of datafram `df`
def f_38152389(df):
	df['c'] = np.where(df['a'].isnull, df['b'], df['a'])
	return df

import numpy as np 
import pandas as pd 

def check(candidate):
    df = pd.DataFrame({'a': [1,2,3], 'b': [0,0,0]})
    assert np.allclose(candidate(df), pd.DataFrame({'a': [1,2,3], 'b': [0,0,0], 'c': [0,0,0]}))

    df = pd.DataFrame({'a': [0,2,3], 'b': [4,5,6]})
    assert np.allclose(candidate(df), pd.DataFrame({'a': [0,2,3], 'b': [4,5,6], 'c': [4,5,6]}))
# remove key 'ele' from dictionary `d`
def f_4175686(d):
	del d['ele']
	return d

def check(candidate):
    assert candidate({"ale":1, "ele": 2}) == {"ale": 1}
# merge list `['it']` and list `['was']` and list `['annoying']` into one list
def f_11574195():
	return ['it'] + ['was'] + ['annoying']

def check(candidate):
    assert candidate() == ['it', 'was', 'annoying']
# increment a value with leading zeroes in a number `x`
def f_587647(x):
	return str(int(x) + 1).zfill(len(x))

def check(candidate):
    assert candidate("001") == "002"

    assert candidate("100") == "101"
# check if a pandas dataframe `df`'s index is sorted
def f_17315881(df):
	return all(df.index[:-1] <= df.index[1:])

import pandas as pd 

def check(candidate):
    df1 = pd.DataFrame({'a': [1,2], 'bb': [0,2]})
    assert candidate(df1) == True

    df2 = pd.DataFrame({'a': [1,2,3,4,5], 'bb': [0,3,5,7,9]})
    shuffled = df2.sample(frac=3, replace=True)
    assert candidate(shuffled) == False

    df = pd.DataFrame([[1, 2], [5, 4]], columns=['a', 'b'])
    assert candidate(df)
# Convert tuple `t` to list
def f_16296643(t):
	return list(t)

def check(candidate):
    assert candidate((0, 1, 2)) == [0,1,2]

    assert candidate(('a', [], 100)) == ['a', [], 100]
# Convert list `t` to tuple
def f_16296643(t):
	return tuple(t)

def check(candidate):
    assert candidate([0,1,2]) == (0, 1, 2)

    assert candidate(['a', [], 100]) == ('a', [], 100)
# Convert tuple `level1` to list
def f_16296643(level1):
	level1 = map(list, level1)
	return level1

def check(candidate):
    t = ((1, 2), (3, 4))
    t = candidate(t)
    assert list(t) == [[1, 2], [3, 4]]
# send the output of pprint object `dataobject` to file `logFile`
def f_3880399(dataobject, logFile):
	return pprint.pprint(dataobject, logFile)

import pprint 

def check(candidate):
    f = open('kkk.txt', 'w')
    candidate('hello', f)
    f.close()
    with open('kkk.txt', 'r') as f:
        assert 'hello' in f.readline()
# get index of rows in column 'BoolCol'
def f_21800169(df):
	return df.loc[df['BoolCol']]

import pandas as pd

def check(candidate):
    df = pd.DataFrame([[True, 2, 3], [False, 5, 6]], columns = ['BoolCol', 'a', 'b'])
    y = candidate(df)
    assert y['a'][0] == 2
    assert y['b'][0] == 3
# Create a list containing the indexes of rows where the value of column 'BoolCol' in dataframe `df` are equal to True
def f_21800169(df):
	return df.iloc[np.flatnonzero(df['BoolCol'])]

import numpy as np
import pandas as pd

def check(candidate):
    df = pd.DataFrame([[True, 2, 3], [False, 5, 6]], columns = ['BoolCol', 'a', 'b'])
    y = candidate(df)
    assert y['a'][0] == 2
    assert y['b'][0] == 3
# from dataframe `df` get list of indexes of rows where column 'BoolCol' values match True
def f_21800169(df):
	return df[df['BoolCol'] == True].index.tolist()

import pandas as pd

def check(candidate):
    df = pd.DataFrame([[True, 2, 3], [False, 5, 6]], columns = ['BoolCol', 'a', 'b'])
    y = candidate(df)
    assert y == [0]
# get index of rows in dataframe `df` which column 'BoolCol' matches value True
def f_21800169(df):
	return df[df['BoolCol']].index.tolist()

import pandas as pd

def check(candidate):
    df = pd.DataFrame([[True, 2, 3], [False, 5, 6]], columns = ['BoolCol', 'a', 'b'])
    y = candidate(df)
    assert y == [0]
# change working directory to the directory `owd`
def f_299446(owd):
	os.chdir(owd)
	return 

import os
from unittest.mock import Mock

def check(candidate):
    os.chdir = Mock()
    try:
        candidate('/')
    except:
        assert False
# insert data from a string `testfield` to sqlite db `c`
def f_14695134(c, testfield):
	c.execute("INSERT INTO test VALUES (?, 'bar')", (testfield,))
	return 

import sqlite3

def check(candidate):
    conn = sqlite3.connect('dev.db')
    cur = conn.cursor()
    cur.execute("CREATE TABLE test (x VARCHAR(10), y VARCHAR(10))")
    candidate(cur, 'kang')
    cur.execute("SELECT * FROM test")
    rows = cur.fetchall()
    assert len(rows) == 1
# decode string "\\x89\\n" into a normal string
def f_24242433():
	return b'\\x89\\n'.decode('unicode_escape')

import sqlite3

def check(candidate):
    assert candidate() == '\x89\n'
# convert a raw string `raw_string` into a normal string
def f_24242433(raw_string):
	return raw_string.decode('unicode_escape')

def check(candidate):
    assert candidate(b"Hello") == "Hello"

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

    assert candidate(b". ?? !!x") == ". ?? !!x"
# convert a raw string `raw_byte_string` into a normal string
def f_24242433(raw_byte_string):
	return raw_byte_string.decode('unicode_escape')

def check(candidate):
    assert candidate(b"Hello") == "Hello"

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

    assert candidate(b". ?? !!x") == ". ?? !!x"
# split a string `s` with into all strings of repeated characters
def f_22882922(s):
	return [m.group(0) for m in re.finditer('(\\d)\\1*', s)]

import re 

def check(candidate):
    assert candidate('111234') == ['111', '2', '3', '4']
# scatter a plot with x, y position of `np.random.randn(100)` and face color equal to none
def f_4143502():
	return plt.scatter(np.random.randn(100), np.random.randn(100), facecolors='none')

import numpy as np
import matplotlib.pyplot as plt

def check(candidate):
    assert 'matplotlib' in str(type(candidate()))
# do a scatter plot with empty circles
def f_4143502():
	return plt.plot(np.random.randn(100), np.random.randn(100), 'o', mfc='none')

import numpy as np
import matplotlib.pyplot as plt

def check(candidate):
    assert 'matplotlib' in str(type(candidate()[0]))
# remove a div from `soup` with a id `main-content` using beautifulsoup
def f_32063985(soup):
	return soup.find('div', id='main-content').decompose()

from bs4 import BeautifulSoup

def check(candidate):
    markup = "<a>This is not div <div>This is div 1</div><div id='main-content'>This is div 2</div></a>"
    soup = BeautifulSoup(markup,"html.parser")
    candidate(soup)
    assert str(soup) == '<a>This is not div <div>This is div 1</div></a>'
# filter rows of datafram `df` containing key word `ball` in column `ids`
def f_27975069(df):
	return df[df['ids'].str.contains('ball')]

import pandas as pd

def check(candidate):
    f = pd.DataFrame([["ball1", 1, 2], ["hall", 5, 4]], columns = ['ids', 'x', 'y'])
    f1 = candidate(f)
    assert f1['x'][0] == 1
    assert f1['y'][0] == 2
# convert index at level 0 into a column in dataframe `df`
def f_20461165(df):
	return df.reset_index(level=0, inplace=True)

import pandas as pd

def check(candidate):
    df = pd.DataFrame([[384, 593], [781, 123]], columns = ['gi', 'ptt_loc'])
    candidate(df)
    assert df['index'][0] == 0
    assert df['index'][1] == 1