KrossKinetic/odex-en huggingface dataset:
# check if all elements in list `myList` are identical
def f_3844801(myList):
	return all(x == myList[0] for x in myList)

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


    assert candidate([1,1,1,1,1,1]) == True


    assert candidate([1]) == True


    assert candidate(['k','k','k','k','k']) == True


    assert candidate([None,'%$#ga',3]) == False
# convert a string `d` from CP-1251 to UTF-8
def f_7555335(d):
	return d.decode('cp1251').encode('utf8')

def check(candidate):
    assert candidate('hello world!'.encode('cp1251')) == b'hello world!'


    assert candidate('%*(^O*'.encode('cp1251')) == b'%*(^O*'


    assert candidate(''.encode('cp1251')) == b''


    assert candidate('hello world!'.encode('cp1251')) != 'hello world!'
# get rid of None values in dictionary `kwargs`
def f_2544710(kwargs):
	return {k: v for k, v in list(kwargs.items()) if v is not None}

def check(candidate):
    assert candidate({i: None for i in range(10)}) == {}


    assert candidate({i: min(i,4) for i in range(6)}) == {0:0,1:1,2:2,3:3,4:4,5:4}


    assert candidate({'abc': 'abc'})['abc'] == 'abc'


    assert candidate({'x': None, 'yy': 234}) == {'yy': 234}
# get rid of None values in dictionary `kwargs`
def f_2544710(kwargs):
	return dict((k, v) for k, v in kwargs.items() if v is not None)

def check(candidate):
    assert candidate({i: None for i in range(10)}) == {}


    assert candidate({i: min(i,4) for i in range(6)}) == {0:0,1:1,2:2,3:3,4:4,5:4}


    assert candidate({'abc': 'abc'})['abc'] == 'abc'


    assert candidate({'x': None, 'yy': 234}) == {'yy': 234}
# concatenate a list of strings `['a', 'b', 'c']`
def f_6726636():
	return """""".join(['a', 'b', 'c'])

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


    assert candidate() == 'a' + 'b' + 'c'
# find intersection data between series `s1` and series `s2`
def f_18079563(s1, s2):
	return pd.Series(list(set(s1).intersection(set(s2))))

import pandas as pd

def check(candidate):
    x1, x2 = pd.Series([1,2]), pd.Series([1,3])
    assert candidate(x1, x2).equals(pd.Series([1]))


    x1, x2 = pd.Series([1,2]), pd.Series([1,3, 10, 4, 5, 9])
    assert candidate(x1, x2).equals(pd.Series([1]))


    x1, x2 = pd.Series([1,2]), pd.Series([1,2, 10])
    assert candidate(x1, x2).equals(pd.Series([1, 2]))
# Format a datetime string `when` to extract date only
def f_26153795(when):
	return datetime.datetime.strptime(when, '%Y-%m-%d').date()

import datetime

def check(candidate):
    assert candidate('2013-05-07') == datetime.date(2013, 5, 7)


    assert candidate('2000-02-29') == datetime.date(2000, 2, 29)


    assert candidate('1990-01-08') == datetime.date(1990, 1, 8)


    assert candidate('1990-1-08') == datetime.date(1990, 1, 8)


    assert candidate('1990-1-8') == datetime.date(1990, 1, 8)


    assert candidate('1990-01-8') == datetime.date(1990, 1, 8)
# split a multi-line string `inputString` into separate strings
def f_172439(inputString):
	return inputString.split('\n')

def check(candidate):
    assert candidate('line a\nfollows by line b	...bye\n') ==         ['line a', 'follows by line b	...bye', '']


    assert candidate('no new line in this sentence. ') == ['no new line in this sentence. ']


    assert candidate('a	bfs hhhdf	sfdas') == ['a	bfs hhhdf	sfdas']


    assert candidate('') == ['']
# concatenate elements of list `b` by a colon ":"
def f_13954222(b):
	return """:""".join(str(x) for x in b)

def check(candidate):
    assert candidate(['x','y','zzz']) == 'x:y:zzz'


    assert candidate(['111','22','3']) == '111:22:3'


    assert candidate(['']) == ''


    assert candidate([':',':']) == ':::'


    assert candidate([',','#','#$%']) == ',:#:#$%'


    assert candidate(['a','b','c']) != 'abc'
# Calculate sum over all rows of 2D numpy array `a`
def f_13567345(a):
	return a.sum(axis=1)

import numpy as np 

def check(candidate):
    a1 = np.array([[i for i in range(3)] for j in range(5)])
    assert np.array_equal(candidate(a1), np.array([3, 3, 3, 3, 3]))


    a2 = np.array([[i+j for i in range(3)] for j in range(5)])
    assert np.array_equal(candidate(a2), np.array([ 3,  6,  9, 12, 15]))


    a3 = np.array([[i*j for i in range(3)] for j in range(5)])
    assert np.array_equal(candidate(a3), np.array([ 0,  3,  6,  9, 12]))
# concatenate items of list `l` with a space ' '
def f_13550423(l):
	return ' '.join(map(str, l))

def check(candidate):
    assert candidate(['x','y','zzz']) == 'x y zzz'


    assert candidate(['111','22','3']) == '111 22 3'


    assert candidate(['']) == ''


    assert candidate([':',':']) == ': :'


    assert candidate([',','#','#$%']) == ', # #$%'


    assert candidate(['a','b','c']) != 'abc'
# convert a string `my_string` with dot and comma into a float number `my_float`
def f_6633523(my_string):
	my_float = float(my_string.replace(',', ''))
	return my_float

def check(candidate):
    assert (candidate('1,234.00') - 1234.0) < 1e-6


    assert (candidate('0.00') - 0.00) < 1e-6


    assert (candidate('1,000,000.00') - 1000000.00) < 1e-6


    assert (candidate('1,000,000.00') - 999999.98) > 1e-6


    assert (candidate('1') - 1.00) < 1e-6
# download a file `url` over HTTP
def f_22676(url):
	return requests.get(url)

import requests 

def check(candidate):
    assert candidate("https://github.com/").url == "https://github.com/"


    assert candidate("https://google.com/").url == "https://www.google.com/"
# remove key 'c' from dictionary `d`
def f_17665809(d):
	return {i: d[i] for i in d if i != 'c'}

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


    assert candidate({'c': None}) == {}


    assert candidate({'a': 1 , 'b': 2, 'c': 3}) != {'a': 1 , 'b': 2, 'c': 3}


    assert candidate({'c': 1, 'cc': 2, 'ccc':3}) == {'cc': 2, 'ccc':3}


    assert 'c' not in candidate({'c':i for i in range(10)})
# Split a string `s` by space with `4` splits
def f_10697757(s):
	return s.split(' ', 4)

def check(candidate):
    assert candidate('1 0 A10B 100 Description: This is a description with spaces') ==         ['1', '0', 'A10B', '100', 'Description: This is a description with spaces']


    assert candidate('this-is-a-continuous-sequence') == ['this-is-a-continuous-sequence']


    assert candidate('') == ['']


    assert candidate('	') == ['	']
# python save list `mylist` to file object 'save.txt'
def f_40133826(mylist):
	pickle.dump(mylist, open('save.txt', 'wb'))
	return 

import pickle

def check(candidate):
    candidate([i for i in range(10)])
    data = pickle.load(open('save.txt', 'rb'))
    assert data == [i for i in range(10)]


    candidate(["hello", "world", "!"])
    data = pickle.load(open('save.txt', 'rb'))
    assert data == ["hello", "world", "!"]
# cut off the last word of a sentence `content`
def f_6266727(content):
	return """ """.join(content.split(' ')[:-1])

def check(candidate):
    assert candidate('test') == ''


    assert candidate('this is an example content') == 'this is an example'


    assert candidate('  ') == ' '


    assert candidate('') == ''


    assert candidate('blank and tab	') == 'blank and'
# convert scalar `x` to array
def f_30385151(x):
	x = np.asarray(x).reshape(1, -1)[(0), :]
	return x

import numpy as np

def check(candidate):
    assert all(candidate(1.) == np.asarray(1.))


    assert all(candidate(123) == np.asarray(123))


    assert all(candidate('a') == np.asarray('a'))


    assert all(candidate(False) == np.asarray(False))
# sum all elements of nested list `L`
def f_15856127(L):
	return sum(sum(i) if isinstance(i, list) else i for i in L)

def check(candidate):
    assert candidate([1,2,3,4]) == 10


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


    assert candidate([1,1,1,1]) == 4


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


    assert candidate([]) == 0


    assert candidate([[], []]) == 0
# convert hex string '470FC614' to a float number
def f_1592158():
	return struct.unpack('!f', bytes.fromhex('470FC614'))[0]

import struct 

def check(candidate):
    assert (candidate() - 36806.078125) < 1e-6


    assert (candidate() - 32806.079125) > 1e-6
# Multiple each value by `2` for all keys in a dictionary `my_dict`
def f_5010536(my_dict):
	my_dict.update((x, y * 2) for x, y in list(my_dict.items()))
	return my_dict

def check(candidate):
    assert candidate({'a': [1], 'b': 4.9}) == {'a': [1, 1], 'b': 9.8}


    assert candidate({1:1}) == {1:2}


    assert candidate({(1,2):[1]}) == {(1,2):[1,1]}


    assert candidate({'asd':0}) == {'asd':0}


    assert candidate({}) == {}
# Join elements of list `l` with a comma `,`
def f_44778(l):
	return """,""".join(l)

def check(candidate):
    assert candidate(['a','b','c']) == 'a,b,c'


    assert candidate(['a','b']) == 'a,b'


    assert candidate([',',',',',']) == ',,,,,'


    assert candidate([' ','  ','c']) == ' ,  ,c'


    assert candidate([]) == ''
# make a comma-separated string from a list `myList`
def f_44778(myList):
	myList = ','.join(map(str, myList))
	return myList

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


    assert candidate([1,2,'a']) == '1,2,a'


    assert candidate([]) == ''


    assert candidate(['frg',3253]) == 'frg,3253'
# reverse the list that contains 1 to 10
def f_7286365():
	return list(reversed(list(range(10))))

def check(candidate):
    assert candidate() == [9,8,7,6,5,4,3,2,1,0]


    assert len(candidate()) == 10


    assert min(candidate()) == 0


    assert type(candidate()) == list


    assert type(candidate()[-2]) == int
# Reverse the order of words, delimited by `.`, in string `s`
def f_4357787(s):
	return """.""".join(s.split('.')[::-1])

def check(candidate):
    assert candidate('apple.orange.red.green.yellow') == 'yellow.green.red.orange.apple'


    assert candidate('apple') == 'apple'


    assert candidate('apple.orange') == 'orange.apple'


    assert candidate('123.456') == '456.123'


    assert candidate('.') == '.'
# convert epoch time represented as milliseconds `s` to string using format '%Y-%m-%d %H:%M:%S.%f'
def f_21787496(s):
	return datetime.datetime.fromtimestamp(s).strftime('%Y-%m-%d %H:%M:%S.%f')

import time
import datetime

def check(candidate): 
    assert candidate(1236472) == '1970-01-15 07:27:52.000000'


    assert candidate(0) == '1970-01-01 00:00:00.000000'


    assert candidate(5.3) == '1970-01-01 00:00:05.300000'
# get the date 7 days before the current date
def f_20573459():
	return (datetime.datetime.now() - datetime.timedelta(days=7)).date()

import datetime

def check(candidate): 
    assert datetime.datetime.now().date() - candidate() < datetime.timedelta(days = 7, seconds = 1)


    assert datetime.datetime.now().date() - candidate() >= datetime.timedelta(days = 7)
# sum elements at index `column` of each list in list `data`
def f_15352457(column, data):
	return sum(row[column] for row in data)

def check(candidate): 
    assert candidate(1, [[1,2,3], [4,5,6]]) == 7


    assert candidate(0, [[1,1,1], [0,1,1]]) == 1


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


    assert candidate(0, [[1],[2],[3],[4]]) == 10
# sum columns of a list `array`
def f_15352457(array):
	return [sum(row[i] for row in array) for i in range(len(array[0]))]

def check(candidate): 
    assert candidate([[1,2,3], [4,5,6]]) == [5, 7, 9]


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


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


    assert candidate([[1],[2],[3],[4]]) == [10]
# combine list of dictionaries `dicts` with the same keys in each list to a single dictionary
def f_11533274(dicts):
	return dict((k, [d[k] for d in dicts]) for k in dicts[0])

def check(candidate): 
    assert candidate([{'cat': 1, 'dog': 3}, {'cat' : 2, 'dog': ['happy']}]) ==         {'cat': [1, 2], 'dog': [3, ['happy']]}


    assert candidate([{'cat': 1}, {'cat' : 2}]) != {'cat': 3}
# Merge a nested dictionary `dicts` into a flat dictionary by concatenating nested values with the same key `k`
def f_11533274(dicts):
	return {k: [d[k] for d in dicts] for k in dicts[0]}

def check(candidate): 
    assert candidate([{'cat': 1, 'dog': 3}, {'cat' : 2, 'dog': ['happy']}]) ==         {'cat': [1, 2], 'dog': [3, ['happy']]}


    assert candidate([{'cat': 1}, {'cat' : 2}]) != {'cat': 3}
# identify duplicate values in list `mylist`
def f_11236006(mylist):
	return [k for k, v in list(Counter(mylist).items()) if v > 1]

from collections import Counter

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


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


    assert candidate([]) == []


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


    assert candidate([1.,1.,1.]) == [1.]
# flatten list `list_of_menuitems`
def f_406121(list_of_menuitems):
	return [image for menuitem in list_of_menuitems for image in menuitem]

from collections import Counter

def check(candidate):
    assert candidate([[1,2],[3,4,5]]) == [1,2,3,4,5]


    assert candidate([[],[]]) == []


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


    assert candidate([['1'],['2']]) == ['1','2']
# append elements of a set `b` to a list `a`
def f_4741537(a, b):
	a.extend(b)
	return a

def check(candidate):
    assert candidate([1, 2, 2, 3], {4, 5, 2}) == [1, 2, 2, 3, 2, 4, 5]


    assert candidate([], {4,5,2}) == [2,4,5]


    assert candidate([1,2,3,4],{2}) == [1,2,3,4,2]


    assert candidate([1], {'a'}) == [1, 'a']
# Split a string `x` by last occurrence of character `-`
def f_15851568(x):
	return x.rpartition('-')[0]

def check(candidate):
    assert candidate('djhajhdjk-dadwqd-dahdjkahsk') == 'djhajhdjk-dadwqd'


    assert candidate('/-/') == '/'


    assert candidate('---') == '--'


    assert candidate('') == ''
# get the last part of a string before the character '-'
def f_15851568(x):
	return x.rsplit('-', 1)[0]

def check(candidate):
    assert candidate('2022-03-01') == '2022-03'


    assert candidate('2020-2022') == '2020'
# print a list `l` and move first 3 elements to the end of the list
def f_34280147(l):
	return l[3:] + l[:3]

def check(candidate):
    assert candidate("my-string") == "stringmy-"


    assert candidate("my ") == "my "


    assert candidate("n;ho0-4w606[q") == "o0-4w606[qn;h"
# 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"
# 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]
# 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 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<"
# 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]]) == []
# 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"
# 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!"
# 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)