neulab/odex huggingface dataset:
# Add indexes in a data frame `df` to a column `index1`
def f_20461165(df):
	df['index1'] = df.index
	return 

import pandas as pd

def check(candidate):
    df = pd.DataFrame([[384, 593], [781, 123]], columns = ['gi', 'ptt_loc'])
    candidate(df)
    assert df['index1'][0] == 0
    assert df['index1'][1] == 1
# convert pandas index in a dataframe `df` to columns
def f_20461165(df):
	return df.reset_index(level=['tick', 'obs'])

import pandas as pd

def check(candidate):
    df = pd.DataFrame([['2016-09-13', 'C', 2, 0.0139], ['2016-07-17', 'A', 2, 0.5577]], columns = ['tick', 'tag', 'obs', 'val'])
    df = df.set_index(['tick', 'tag', 'obs'])
    df = candidate(df)
    assert df['tick']['C'] == '2016-09-13'
# Get reverse of list items from list 'b' using extended slicing
def f_4685571(b):
	return [x[::-1] for x in b]

def check(candidate):
    b = [('spam',0), ('eggs',1)]
    b1 = candidate(b)
    assert b1 == [(0, 'spam'), (1, 'eggs')]
# join each element in array `a` with element at the same index in array `b` as a tuple
def f_17960441(a, b):
	return np.array([zip(x, y) for x, y in zip(a, b)])

import numpy as np

def check(candidate):
    a = np.array([[9, 8], [7, 6]])
    b = np.array([[7, 1], [5, 2]])
    c = candidate(a, b)
    expected = [(9, 7), (8, 1)]
    ctr = 0
    for i in c[0]:
        assert i == expected[ctr]
        ctr += 1
# zip two 2-d arrays `a` and `b`
def f_17960441(a, b):
	return np.array(list(zip(a.ravel(),b.ravel())), dtype=('i4,i4')).reshape(a.shape)

import numpy as np

def check(candidate):
    a = np.array([[9, 8], [7, 6]])
    b = np.array([[7, 1], [5, 2]])
    c = candidate(a, b)
    e = np.array([[(9, 7), (8, 1)], [(7, 5), (6, 2)]], dtype=[('f0', '<i4'), ('f1', '<i4')])
    assert np.array_equal(c, e)
# convert list `list_of_ints` into a comma separated string
def f_438684(list_of_ints):
	return """,""".join([str(i) for i in list_of_ints])

def check(candidate):
    list_of_ints = [8, 7, 6]
    assert candidate(list_of_ints) == '8,7,6'

    list_of_ints = [0, 1, 6]
    assert candidate(list_of_ints) == '0,1,6'
# Send a post request with raw data `DATA` and basic authentication with `username` and `password`
def f_8519922(url, DATA, HEADERS_DICT, username, password):
	return requests.post(url, data=DATA, headers=HEADERS_DICT, auth=(username, password))

import requests
from unittest.mock import Mock

def check(candidate):
    url='https://www.google.com'
    HEADERS_DICT = {'Accept':'text/json'}
    requests.post = Mock()
    try:
        candidate(url, "{'name': 'abc'}", HEADERS_DICT, 'admin', 'admin123')
    except:
        assert False
# Find last occurrence of character '}' in string "abcd}def}"
def f_26443308():
	return 'abcd}def}'.rfind('}')

def check(candidate):
    assert candidate() == 8
# Iterate ove list `[1, 2, 3]` using list comprehension
def f_22365172():
	return [item for item in [1, 2, 3]]

def check(candidate):
    assert candidate() == [1,2,3]
# extract all the values with keys 'x' and 'y' from a list of dictionaries `d` to list of tuples
def f_12300912(d):
	return [(x['x'], x['y']) for x in d]

def check(candidate):
    data = [{'x': 1, 'y': 10}, {'x': 3, 'y': 15}, {'x': 2, 'y': 1}]
    res = candidate(data)
    assert res == [(1, 10), (3, 15), (2, 1)]
# get the filename without the extension from file 'hemanth.txt'
def f_678236():
	return os.path.splitext(os.path.basename('hemanth.txt'))[0]

import os 

def check(candidate):
    assert candidate() == "hemanth"
# create a list containing flattened list `[['A', 'B', 'C'], ['D', 'E', 'F'], ['G', 'H', 'I']]`
def f_7895449():
	return sum([['A', 'B', 'C'], ['D', 'E', 'F'], ['G', 'H', 'I']], [])

def check(candidate):
    assert candidate() == ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']
# select rows in a dataframe `df` column 'closing_price' between two values 99 and 101
def f_31617845(df):
	df = df[(df['closing_price'] >= 99) & (df['closing_price'] <= 101)]
	return df

import pandas as pd

def check(candidate):
    df = pd.DataFrame([67, 68, 69, 70, 99, 100, 101, 102], columns = ['closing_price'])
    assert candidate(df).shape[0] == 3
# replace all occurences of newlines `\n` with `<br>` in dataframe `df`
def f_25698710(df):
	return df.replace({'\n': '<br>'}, regex=True)

import pandas as pd

def check(candidate):
    df = pd.DataFrame(['klm\npqr', 'wxy\njkl'], columns = ['val'])
    expected = pd.DataFrame(['klm<br>pqr', 'wxy<br>jkl'], columns = ['val'])
    assert pd.DataFrame.equals(candidate(df), expected)
# replace all occurrences of a string `\n` by string `<br>` in a pandas data frame `df`
def f_25698710(df):
	return df.replace({'\n': '<br>'}, regex=True)

import pandas as pd

def check(candidate):
    df = pd.DataFrame(['klm\npqr', 'wxy\njkl'], columns = ['val'])
    expected = pd.DataFrame(['klm<br>pqr', 'wxy<br>jkl'], columns = ['val'])
    assert pd.DataFrame.equals(candidate(df), expected)
# create a list containing each two adjacent letters in string `word` as its elements
def f_41923858(word):
	return [(x + y) for x, y in zip(word, word[1:])]

def check(candidate):
    assert candidate('abcdef') == ['ab', 'bc', 'cd', 'de', 'ef']

    assert candidate(["hello", "world", "!"]) == ["helloworld", "world!"]
# Get a list of pairs from a string `word` using lambda function
def f_41923858(word):
	return list(map(lambda x, y: x + y, word[:-1], word[1:]))

def check(candidate):
    assert candidate('abcdef') == ['ab', 'bc', 'cd', 'de', 'ef']
# extract a url from a string `myString`
def f_9760588(myString):
	return re.findall('(https?://[^\\s]+)', myString)

import re

def check(candidate):
    assert candidate("This is a link http://www.google.com") == ["http://www.google.com"]

    assert candidate("Please refer to the website: http://www.google.com") == ["http://www.google.com"]
# extract a url from a string `myString`
def f_9760588(myString):
	return re.search('(?P<url>https?://[^\\s]+)', myString).group('url')

import re

def check(candidate):
    assert candidate("This is a link http://www.google.com") == "http://www.google.com"

    assert candidate("Please refer to the website: http://www.google.com") == "http://www.google.com"
# remove all special characters, punctuation and spaces from a string `mystring` using regex
def f_5843518(mystring):
	return re.sub('[^A-Za-z0-9]+', '', mystring)

import re

def check(candidate):
    assert candidate('Special $#! characters   spaces 888323') == 'Specialcharactersspaces888323'
# create a DatetimeIndex containing 13 periods of the second friday of each month starting from date '2016-01-01'
def f_36674519():
	return pd.date_range('2016-01-01', freq='WOM-2FRI', periods=13)

import pandas as pd
import datetime

def check(candidate):
    actual = candidate() 
    expected = [[2016, 1, 8], [2016, 2, 12],
                [2016, 3, 11], [2016, 4, 8],
                [2016, 5, 13], [2016, 6, 10],
                [2016, 7, 8], [2016, 8, 12],
                [2016, 9, 9], [2016, 10, 14],
                [2016, 11, 11], [2016, 12, 9],
                [2017, 1, 13]]
    for i in range(0, len(expected)):
        d = datetime.date(expected[i][0], expected[i][1], expected[i][2])
        assert d == actual[i].date()
# Create multidimensional array `matrix` with 3 rows and 2 columns in python
def f_508657():
	matrix = [['a', 'b'], ['c', 'd'], ['e', 'f']]
	return matrix

def check(candidate):
    matrix = candidate()
    assert len(matrix) == 3
    assert all([len(row)==2 for row in matrix])
# replace spaces with underscore in string `mystring`
def f_1007481(mystring):
	return mystring.replace(' ', '_')

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

    assert candidate(' _ ') == '___'

    assert candidate('') == ''

    assert candidate('123123') == '123123'

    assert candidate('\_ ') == '\__'
# split string `my_string` on white spaces
def f_1249786(my_string):
	return """ """.join(my_string.split())

def check(candidate):
    assert candidate('hello   world ') == 'hello world'

    assert candidate('') == ''

    assert candidate('    ') == ''

    assert candidate('  hello') == 'hello'

    assert candidate(' h  e  l  l  o   ') == 'h e l l o'
# get filename without extension from file `filename`
def f_4444923(filename):
	return os.path.splitext(filename)[0]

import os

def check(candidate):
    assert candidate('/Users/test/hello.txt') == '/Users/test/hello'

    assert candidate('hello.txt') == 'hello'

    assert candidate('hello') == 'hello'

    assert candidate('.gitignore') == '.gitignore'
# get a list containing the sum of each element `i` in list `l` plus the previous elements
def f_13728486(l):
	return [sum(l[:i]) for i, _ in enumerate(l)]

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

    assert candidate([]) == []

    assert candidate([1]) == [0]
# split a string `Docs/src/Scripts/temp` by `/` keeping `/` in the result
def f_9743134():
	return """Docs/src/Scripts/temp""".replace('/', '/\x00/').split('\x00')

def check(candidate):
    assert candidate() == ['Docs/', '/src/', '/Scripts/', '/temp']

    assert candidate() != ['Docs', 'src', 'Scripts', 'temp']
# shuffle columns of an numpy array 'r'
def f_20546419(r):
	return np.random.shuffle(np.transpose(r))

import numpy as np

def check(candidate):
    a1 = np.array([[ 1, 20], [ 2, 30]])
    candidate(a1)
    assert np.array_equal(a1, np.array([[ 1, 20],[ 2, 30]])) or np.array_equal(a1, np.array([[ 20, 1], [ 30, 2]]))

    a2 = np.array([[ 1], [ 2]])
    candidate(a2)                       
    assert np.array_equal(a2,np.array([[ 1], [ 2]]) )

    a3 = np.array([[ 1,2,3]])
    candidate(a3)
    assert np.array_equal(a3,np.array([[ 1,2,3]])) or np.array_equal(a3,np.array([[ 2,1,3]]))           or np.array_equal(a3,np.array([[ 1,3,2]]))            or np.array_equal(a3,np.array([[3,2,1]])) or np.array_equal(a3,np.array([[3,1,2]]))            or np.array_equal(a3,np.array([[2,3,1]])) 

    a4 = np.zeros(shape=(5,2))
    candidate(a4)
    assert np.array_equal(a4, np.zeros(shape=(5,2)))
# copy all values in a column 'B' to a new column 'D' in a pandas data frame 'df'
def f_32675861(df):
	df['D'] = df['B']
	return df

import pandas as pd

def check(candidate):
    df_1 = pd.DataFrame({'A': [1,2,3], 'B': ['a', 'b', 'c']})
    candidate(df_1)
    assert (df_1['D'] == df_1['B']).all()

    df_2 = pd.DataFrame({'A': [1,2,3], 'B': [1, 'A', 'B']})
    candidate(df_2)
    assert (df_2['D'] == df_2['B']).all()

    df_3 = pd.DataFrame({'B': [1]})
    candidate(df_3)
    assert df_3['D'][0] == 1

    df_4 = pd.DataFrame({'B': []})
    candidate(df_4)
    assert len(df_4['D']) == 0
# find a value within nested json 'data' where the key inside another key 'B' is unknown.
def f_14227561(data):
	return list(data['A']['B'].values())[0]['maindata'][0]['Info']

import json

def check(candidate):
    s1 = '{"A":{"B":{"unknown":{"1":"F","maindata":[{"Info":"TEXT"}]}}}}'
    data = json.loads(s1)
    assert candidate(data) == 'TEXT'

    s2 = '{"A":{"B":{"sample1":{"1":"F","maindata":[{"Info":"TEXT!"}]}}}}'
    data = json.loads(s2)
    assert candidate(data) == 'TEXT!'

    s3 = '{"A":{"B":{"sample_weird_un":{"1":"F","maindata":[{"Info":"!"}]}}}}'
    data = json.loads(s3)
    assert candidate(data) == '!'

    s4 = '{"A":{"B":{"sample_weird_un":{"1":"F","maindata":[{"Info":""}]}}}}'
    data = json.loads(s4)
    assert candidate(data) == ''
# check characters of string `string` are true predication of function `predicate`
def f_14858916(string, predicate):
	return all(predicate(x) for x in string)

def check(candidate):
    def predicate(x):
        if x == 'a':
            return True
        else:
            return False
    assert candidate('aab', predicate) == False

    def predicate(x):
        if x == 'a':
            return True
        else:
            return False
    assert candidate('aa', predicate) == True

    def predicate(x):
        if x == 'a':
            return True
        else:
            return False
    assert candidate('', predicate) == True

    def predicate(x):
        if x.islower():
            return True
        else:
            return False
    assert candidate('abc', predicate) == True

    def predicate(x):
        if x.islower():
            return True
        else:
            return False
    assert candidate('Ab', predicate) == False

    def predicate(x):
        if x.islower():
            return True
        else:
            return False
    assert candidate('ABCD', predicate) == False
# determine number of files on a drive with python
def f_574236():
	return os.statvfs('/').f_files - os.statvfs('/').f_ffree

import os 

def check(candidate):
    assert candidate() == (os.statvfs('/').f_files - os.statvfs('/').f_ffree)
# how to get a single result from a SQLite query from `cursor`
def f_7011291(cursor):
	return cursor.fetchone()[0]

import sqlite3

def check(candidate):
    conn = sqlite3.connect('main')
    cursor = conn.cursor()
    cursor.execute("CREATE TABLE student (name VARCHAR(10))")
    cursor.execute("INSERT INTO student VALUES('abc')")
    cursor.execute("SELECT * FROM student")
    assert candidate(cursor) == 'abc'
# convert string `user_input` into a list of integers `user_list`
def f_6378889(user_input):
	user_list = [int(number) for number in user_input.split(',')]
	return user_list

def check(candidate):
    assert candidate('0') == [0]

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

    assert candidate('12,33,223') == [12, 33, 223]
# Get a list of integers by splitting  a string `user` with comma
def f_6378889(user):
	return [int(s) for s in user.split(',')]

def check(candidate):
    assert candidate('0') == [0]

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

    assert candidate('12,33,223') == [12, 33, 223]
# Sorting a Python list `list` by the first item ascending and last item descending
def f_5212870(list):
	return sorted(list, key=lambda x: (x[0], -x[1]))

def check(candidate):
    list = [(9, 0), (9, 1), (9, -1), (8, 5), (4, 5)]
    assert candidate(list) == [(4, 5), (8, 5), (9, 1), (9, 0), (9, -1)]
# sort a list of objects `ut`, based on a function `cmpfun` in descending order
def f_403421(ut, cmpfun):
	ut.sort(key=cmpfun, reverse=True)
	return ut

def check(candidate):
    assert candidate([], lambda x: x) == []

    assert candidate(['a', 'b', 'c'], lambda x: x) == ['c', 'b', 'a']

    assert candidate([2, 1, 3], lambda x: -x) == [1, 2, 3]
# reverse list `ut` based on the `count` attribute of each object
def f_403421(ut):
	ut.sort(key=lambda x: x.count, reverse=True)
	return ut

class Tag: 
    def __init__(self, name, count): 
        self.name = name 
        self.count = count 

    def __str__(self):
        return f"[{self.name}]-[{self.count}]"

def check(candidate):
    result = candidate([Tag("red", 1), Tag("blue", 22), Tag("black", 0)])
    assert (result[0].name == "blue") and (result[0].count == 22)
    assert (result[1].name == "red") and (result[1].count == 1)
    assert (result[2].name == "black") and (result[2].count == 0)
# cast an int `i` to a string and concat to string 'ME'
def f_3944876(i):
	return 'ME' + str(i)

def check(candidate):
    assert candidate(100) == "ME100"

    assert candidate(0.22) == "ME0.22"

    assert candidate("text") == "MEtext"
# Sorting data in Pandas DataFrame `df` with columns 'System_num' and 'Dis'
def f_40903174(df):
	return df.sort_values(['System_num', 'Dis'])

import pandas as pd 

def check(candidate):
    df1 = pd.DataFrame([[6, 1, 1], [5, 1, 1], [4, 1, 1], [3, 2, 1], [2, 2, 1], [1, 2, 1]], columns = ['Dis', 'System_num', 'Energy'])
    df_ans1 = pd.DataFrame([[4, 1, 1], [5, 1, 1], [6, 1, 1], [1, 2, 1], [2, 2, 1], [3, 2, 1]], columns = ['Dis', 'System_num', 'Energy'])
    assert (df_ans1.equals(candidate(df1).reset_index(drop = True))) == True

    df2 = pd.DataFrame([[6, 3, 1], [5, 2, 1], [4, 1, 1]], columns = ['Dis', 'System_num', 'Energy'])
    df_ans2 = pd.DataFrame([[4, 1, 1], [5, 2, 1], [6, 3, 1]], columns = ['Dis', 'System_num', 'Energy'])
    assert (df_ans2.equals(candidate(df2).reset_index(drop = True))) == True

    df3 = pd.DataFrame([[1, 3, 1], [3, 3, 1], [2, 3, 1], [6, 1, 1], [4, 1, 1], [5, 2, 1], [3, 2, 1]], columns = ['Dis', 'System_num', 'Energy'])
    df_ans3 = pd.DataFrame([[4, 1,1], [6, 1, 1], [3, 2, 1], [5, 2, 1], [1, 3, 1], [2, 3, 1], [3, 3, 1]], columns = ['Dis', 'System_num', 'Energy'])
    assert (df_ans3.equals(candidate(df3).reset_index(drop = True))) == True 

    df4 = pd.DataFrame([[1, 2, 3], [1, 2, 3], [4, 1, 3]], columns = ['Dis', 'System_num', 'Energy'])
    df_ans4 = pd.DataFrame([[1, 2, 3], [1, 2, 3], [4, 1, 3]])
    assert (df_ans4.equals(candidate(df4).reset_index(drop = True))) == False
# prepend the line '#test firstline\n' to the contents of file 'infile' and save as the file 'outfile'
def f_4454298(infile, outfile):
	open(outfile, 'w').write('#test firstline\n' + open(infile).read())
	return 

import filecmp

def check(candidate): 
    open('test1.txt', 'w').write('test1')
    candidate('test1.txt', 'test1_out.txt')
    open('test1_ans.txt', 'w').write('#test firstline\ntest1')
    assert filecmp.cmp('test1_out.txt', 'test1_ans.txt') == True

    open('test2.txt', 'w').write('\ntest2\n')
    candidate('test2.txt', 'test2_out.txt')
    open('test2_ans.txt', 'w').write('#test firstline\n\ntest2\n')
    assert filecmp.cmp('test2_out.txt', 'test2_ans.txt') == True

    open('test3.txt', 'w').write(' \n \n')
    candidate('test3.txt', 'test3_out.txt')
    open('test3_ans.txt', 'w').write('#test firstline\n \n \n')
    assert filecmp.cmp('test3_out.txt', 'test3_ans.txt') == True

    open('test4.txt', 'w').write('hello')
    candidate('test4.txt', 'test4_out.txt')
    open('test4_ans.txt', 'w').write('hello')
    assert filecmp.cmp('test4_out.txt', 'test4_ans.txt') == False
# sort a list `l` by length of value in tuple
def f_19729928(l):
	l.sort(key=lambda t: len(t[1]), reverse=True)
	return l

def check(candidate): 
    assert candidate([("a", [1]), ("b", [1,2]), ("c", [1,2,3])]) ==         [("c", [1,2,3]), ("b", [1,2]), ("a", [1])]

    assert candidate([("a", [1]), ("b", [2]), ("c", [1,2,3])]) ==         [("c", [1,2,3]), ("a", [1]), ("b", [2])]

    assert candidate([("a", [1]), ("b", [2]), ("c", [3])]) ==         [("a", [1]), ("b", [2]), ("c", [3])]
# split string `s` by words that ends with 'd'
def f_31371879(s):
	return re.findall('\\b(\\w+)d\\b', s)

import re

def check(candidate): 
    assert candidate("this is good") == ["goo"]

    assert candidate("this is interesting") == []

    assert candidate("good bad dd") == ["goo", "ba", "d"]
# return `True` if string `foobarrrr` contains regex `ba[rzd]`
def f_9012008():
	return bool(re.search('ba[rzd]', 'foobarrrr'))

import re

def check(candidate): 
    assert candidate() == True
# Removing duplicates in list `t`
def f_7961363(t):
	return list(set(t))

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

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

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

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

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

    assert candidate([]) == [] 

    assert candidate([None]) == [None]
# Removing duplicates in list `source_list`
def f_7961363(source_list):
	return list(set(source_list))

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

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

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

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

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

    assert candidate([]) == [] 

    assert candidate([None]) == [None]
# Removing duplicates in list `abracadabra`
def f_7961363():
	return list(OrderedDict.fromkeys('abracadabra'))

from collections import OrderedDict

def check(candidate):
    assert candidate() == ['a', 'b', 'r', 'c', 'd']
# Convert array `a` into a list
def f_5183533(a):
	return numpy.array(a).reshape(-1).tolist()

import numpy

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

    assert candidate(['a', 'aa', 'abc']) == ['a', 'aa', 'abc']
# Convert the first row of numpy matrix `a` to a list
def f_5183533(a):
	return numpy.array(a)[0].tolist()

import numpy

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

    assert candidate(['a', 'aa', 'abc']) == 'a'
# In `soup`, get the content of the sibling of the `td`  tag with text content `Address:`
def f_5999747(soup):
	return soup.find(text='Address:').findNext('td').contents[0]

from bs4 import BeautifulSoup

def check(candidate):
    assert candidate(BeautifulSoup("<td><b>Address:</b></td><td>My home address</td>")) == "My home address"

    assert candidate(BeautifulSoup("<td><b>Address:</b></td><td>This is my home address</td><td>Not my home address</td>")) == "This is my home address"

    assert candidate(BeautifulSoup("<td><b>Address:</b></td><td>My home address<li>My home address in a list</li></td>")) == "My home address"
# convert elements of each tuple in list `l` into a string  separated by character `@`
def f_4284648(l):
	return """ """.join([('%d@%d' % t) for t in l])

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

    assert candidate([(10, 11), (12, 13)]) == "10@11 12@13"

    assert candidate([(10.2, 11.4), (12.14, 13.13)]) == "10@11 12@13"
# convert each tuple in list `l` to a string with '@' separating the tuples' elements
def f_4284648(l):
	return """ """.join([('%d@%d' % (t[0], t[1])) for t in l])

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

    assert candidate([(10, 11), (12, 13)]) == "10@11 12@13"

    assert candidate([(10.2, 11.4), (12.14, 13.13)]) == "10@11 12@13"
# Get all matches with regex pattern `\\d+[xX]` in list of string `teststr`
def f_29696641(teststr):
	return [i for i in teststr if re.search('\\d+[xX]', i)]

import re

def check(candidate):
    assert candidate(['1 FirstString', '2x Sec String', '3rd String', 'x forString', '5X fifth']) == ['2x Sec String', '5X fifth']

    assert candidate(['1x', '2', '3X', '4x random', '5X random']) == ['1x', '3X', '4x random', '5X random']

    assert candidate(['1x', '2', '3X', '4xrandom', '5Xrandom']) == ['1x', '3X', '4xrandom', '5Xrandom']
# select values from column 'A' for which corresponding values in column 'B' will be greater than 50, and in column 'C' - equal 900 in dataframe `df`
def f_15315452(df):
	return df['A'][(df['B'] > 50) & (df['C'] == 900)]

import pandas as pd

def check(candidate):
    df = pd.DataFrame({'A': [7, 7, 4, 4, 7, 7, 3, 9, 6, 3], 'B': [20, 80, 90, 30, 80, 60, 80, 40, 40 ,10], 'C': [300, 700, 100, 900, 200, 800, 900, 100, 100, 600]})
    assert candidate(df).to_dict() == {6: 3}

    df1 = pd.DataFrame({'A': [9, 9, 5, 8, 7, 9, 2, 2, 5, 7], 'B': [40, 70, 70, 80, 50, 30, 80, 80, 80, 70], 'C': [300, 700, 900, 900, 200, 900, 700, 400, 300, 800]})
    assert candidate(df1).to_dict() == {2: 5, 3: 8}

    df2 = pd.DataFrame({'A': [3, 4, 5, 6], 'B': [-10, 50, 20, 10], 'C': [900, 800, 900, 900]})
    assert candidate(df2).to_dict() == {}
# Sort dictionary `o` in ascending order based on its keys and items
def f_4642501(o):
	return sorted(o.items())

import pandas as pd

def check(candidate):
    assert candidate({1:"abc", 5:"klm", 2:"pqr"}) == [(1, "abc"), (2, "pqr"), (5, "klm")]

    assert candidate({4.221:"uwv", -1.009:"pow"}) == [(-1.009, 'pow'), (4.221, 'uwv')]

    assert candidate({"as2q":"piqr", "#wwq":"say", "Rwc":"koala", "35":"kangaroo"}) == [('#wwq', 'say'), ('35', 'kangaroo'), ('Rwc', 'koala'), ('as2q', 'piqr')]
# get sorted list of keys of dict `d`
def f_4642501(d):
	return sorted(d)

def check(candidate):
    assert candidate({1:"abc", 5:"klm", 2:"pqr"}) == [1, 2, 5]

    assert candidate({4.221:"uwv", -1.009:"pow"}) == [-1.009, 4.221]

    assert candidate({"as2q":"piqr", "#wwq":"say", "Rwc":"koala", "35":"kangaroo"}) == ['#wwq', '35', 'Rwc', 'as2q']
# sort dictionaries `d` by keys
def f_4642501(d):
	return sorted(d.items())

def check(candidate):
    d = {'a': [1, 2, 3], 'c': ['one', 'two'], 'b': ['blah', 'bhasdf', 'asdf'], 'd': ['asdf', 'wer', 'asdf', 'zxcv']}
    assert candidate(d) == [('a', [1, 2, 3]), ('b', ['blah', 'bhasdf', 'asdf']), ('c', ['one', 'two']), ('d', ['asdf', 'wer', 'asdf', 'zxcv'])]
# convert string "1" into integer
def f_642154():
	return int('1')

def check(candidate):
    assert candidate() == 1

    assert candidate() + 1 == 2