code "import re def f(x): x = re.split(' *==>', x) res_dict = {} for i in range(1, len(x)): res_dict.setdefault(x[i].split()[0], x[i - 1].split()[-1]) return res_dict def main(x): return f(x)" "def main(inp): outp = dict() blocks = inp.split('.') del blocks[-1] for i in range(len(blocks)): var = blocks[i].split('->')[1].replace('', '').strip() data = [element.strip() for element in blocks[i][blocks[i].index('{') + 1:blocks[i].index('}')].split(';')] outp[var] = data return outp" "import re def main(input): exr = '\\.do\\s+option\\s*{\\s*([^}]*)\\s*}\\s*->\\s*q\\(([A-Za-z0-9_-]*)\\)' matches = re.findall(exr, input) output = {} for match in matches: values = [e.strip() for e in match[0].split('.')] key = match[1] output[key] = values return output" "import re def main(text): keys = re.findall('@""[a-zA-Z0-9_]+""', text) values = re.findall('q\\([a-zA-Z0-9_]+\\)', text) return dict(zip([data[2:-1] for data in keys], [data[2:-1] for data in values]))" "import re def main(text): res = {} text = ''.join(text.split()) vals = text.split('dovar`') for val in vals: if '' not in val: data = re.sub(""\\|>'|'\\..*"", ' ', val).split(' ') res[data[1]] = data[0] return res" "import re def main(x): x = re.split(' *=', x) res_dict = {} for i in range(1, len(x)): res_dict.setdefault(x[i - 1].split()[-1][2:-1:1], int(re.findall('-*\\d+', x[i].split()[0].split()[0])[0])) return res_dict" "def main(data): data = data.replace('\n', ' ') a = data.split(sep='.end.') a.pop() res = {} for x in a: key = x[x.find('(') + 1:x.find(')')] value = [int(d) for d in x[x.rfind('(') + 1:x.rfind(')')].split(sep=' ') if d != ''] res[key] = value return res" "def main(listt=''): listt = listt.split(';') ans = {} for i in range(0, len(listt) - 1, +2): ans[listt[i][listt[i].find('==>') + 3:].strip()] = int(listt[i][listt[i].find('#') + 1:listt[i].find('==>')].strip()) return ans" "def main(input): while ' ' in input: input = input.replace(' ', ' ') input = input[input.find('.do') + 3:input.find('.end')] input = input.replace('>><<', '\x00').replace('>> <<', '\x00') input = input.replace('>>', '').replace('<<', '').strip() rawSplit1 = input.split('\x00') for i in range(len(rawSplit1)): rawSplit1[i] = rawSplit1[i].strip() rawSplit2 = [] for s in rawSplit1: rawSplit2.append(s.split('::=')) rawSplit2[len(rawSplit2) - 1][0] = rawSplit2[len(rawSplit2) - 1][0][3:].strip() rawSplit2[len(rawSplit2) - 1][1] = rawSplit2[len(rawSplit2) - 1][1][7:].replace(' ', '') rawSplit2[len(rawSplit2) - 1][1] = rawSplit2[len(rawSplit2) - 1][1].replace(')', '') rawSplit2[len(rawSplit2) - 1][1] = rawSplit2[len(rawSplit2) - 1][1].replace('#', '') rawSplit2[len(rawSplit2) - 1][1] = rawSplit2[len(rawSplit2) - 1][1].split('.') for i in range(len(rawSplit2[len(rawSplit2) - 1][1])): rawSplit2[len(rawSplit2) - 1][1][i] = int(rawSplit2[len(rawSplit2) - 1][1][i]) result = {} for s in rawSplit2: result[s[0]] = s[1] return result" "def main(x): keys = [] values = [] result = {} buffer = x.split(';') for i in buffer: if '}}' in i: break if 'glob' in i: values += [''.join(str(i[i.find('glob') + 4:i.find('=>')]))] if '=>' in i: keys += [''.join(str(i[i.find('=>') + 2:i.find('.')]))] values = [x.strip(' ') for x in values] keys = [x.strip(' ') for x in keys] values = [x.strip('\n') for x in values] for key in keys: for value in values: result[key] = value values.remove(value) break return result" "def main(x): dict = {} list = x[6:-7].strip().split('.')[:-1] for item in list: item_dict = item.split('==>') dict[item_dict[1].strip()] = item_dict[0].strip() return dict" "def main(s): s = s.replace('[', '', 2) s = s.replace(']', '', 2) dictionary = dict() while s != '': index_of_d = s[s.find('`') + 1:s.find('<')].strip() element_of_d = s[s.find(""'"") + 1:s.find('.') - 1].strip() dictionary[index_of_d] = element_of_d s = s.replace(s[0:s.find('done') + len('done')], '') if s.find('done') == -1: s = '' return dictionary" "def main(str): replaced = str.replace('
', '').replace('make', '').replace('
', '').replace('{', '').replace('}', '').replace('\n', '').replace('`', '') mappedItems = map(lambda x: x.strip(), replaced.split(';')) items = list(filter(lambda x: x != '', mappedItems)) res = {} for item in items: [value, key] = list(map(lambda x: x.strip(), item.split('=:'))) res[key] = value return res" "import re def main(text): d = re.findall('do\\s*option\\s*[#]([-]?\\d+)\\s*==>\\s*([\\w]+);', text) return {key: int(value) for (value, key) in d}" "import re def main(x): keys = re.findall('""(.*?)""', x) values = re.findall('opt[\n ]+(-?\\d+)', x) return dict(zip(keys, [int(number) for number in values]))" "def main(x): x = x.replace('', '').replace('#', '') x = x.replace('', '').replace('\n', '').split(';') res = dict() for j in x[:-1]: li = j[j.find('(') + 1:j.find(')')].replace('\n', '').split('.') res[j.split('==>')[1].replace(' ', '')] = list(map(int, li)) return res" "def main(f): newf = f.split('`') newf.pop(0) dictionary = {} for i in range(len(newf)): str1 = '' str2 = [] for j in range(len(newf[i])): str1 += newfunc1(newf[i][j]) if newf[i][j] == ' ' and len(str1) != 0: str2.append(str1) str1 = '' elif newf[i][j] == '=' and len(str1) != 0: str2.append(str1) str1 = '' elif newf[i][j] == ';' and len(str1) != 0: str2.append(str1) str1 = '' break dictionary.update({str2[1]: str2[0]}) return dictionary def newfunc1(x): if x.isalpha(): return x elif x.isdigit(): return x elif x == '_': return x else: return ''" "import re def main(code): ret = {} s = '' num = 0 for i in re.findall('[ \n]?do[ \n]?data[ \n]?([a-z_0-9]+)[ \n]?::=[ \n]?([-]?[0-9]*).[ \n]?done;[ \n]?', code): for j in i: if re.fullmatch('(-)?(0|([1-9][0-9]*))', j) is not None: num = j else: s = j ret[s] = int(num) return ret" "def main(s): import re w = 'q\\(([^)]+)\\)' e = 'var[\\W]*(\\S+)' le = [] for i in re.finditer('var', s): le.append(i.start()) le.append(len(s)) m = {} for i in range(1, len(le)): u = s[le[i - 1]:le[i]] t = re.search(e, u).group(1) if t[0] == 'n': t = t[1:] m[t] = [] for j in re.findall(w, u): m[t].append(j) return m" "import re def main(s: str) -> dict: a = s.split('}}') a.pop() a = [re.search('(auto |auto\n).*""', elem).group().replace('""', '').replace('.', '').replace('@', '').replace('auto ', '').replace('auto\n', '').replace('\n', '').replace(' ', '') for elem in a] return {elem.split(':')[0]: elem.split(':')[1] for elem in a}" "import re def main(string): dict = {} list_of_names = [] list_of_keys = re.findall(""'([^']*)'"", string) name = False word = '' help1 = [m.start() for m in re.finditer('==', string)] for elem in help1: word = '' for i in range(1, elem): if len(word) == 0 and (string[elem - i] == ' ' or string[elem - i] == '\n'): continue if string[elem - i] == ' ' or string[elem - i] == '\n': break else: word += string[elem - i] list_of_names.append(word[::-1]) dict[list_of_keys[len(list_of_names) - 1]] = list_of_names[len(list_of_names) - 1] return dict" "VAR = 'def' FIELD_SEP = '||' def main(string_to_parse): result = dict() fields = string_to_parse.split(FIELD_SEP) for field in fields: if VAR not in field: continue tokens = field.split() name = tokens[1] value = int(tokens[2][:-1]) result[name] = value return result" "import re def main(str): d1 = dict() while len(str) > 0: res = re.search('\\w+_*[0-9]*', str) res1 = res.group(0) str = str[res.end():] res = re.search('\\w+_*[0-9]*', str) res2 = res.group(0) str = str[res.end():] d1[res1] = res2 if re.search('\\w+_*[0-9]*', str) is None: break return d1" "import re def main(s): regex = '#(.*?) *\\|> *`(.*?)\\.+' parsed_s = re.findall(regex, s.replace('\n', '')) result = {} for (value, key) in parsed_s: result[key] = int(value) return result" "import re def main(text): keys = re.findall('""(.*?)""', text) values = re.findall(' -?\\d+ ', text) for i in range(len(values)): j = values[i].replace(' ', '') values[i] = int(j) temp = dict(zip([data for data in keys], [data for data in values])) return temp" "import json BR_START = '<:' BR_END = ':>' SECT_START = '
' GLOBAL = 'global' SECT_END = '
' DELIM = ';' def var1(msg: str) -> dict: msg = msg.replace(BR_START, '{') msg = msg.replace(BR_END, '}') msg = msg.replace('\n', '') msg = msg.replace(GLOBAL, '') while ""'"" in msg: msg = msg.replace(""'"", '"":""', 1) msg = msg.replace(""'"", '', 1) msg = msg.replace(SECT_START, '""') msg = msg.replace(SECT_END, '""') msg = msg.replace(DELIM, ',') msg = msg.replace(' ', '') msg = msg[::-1].replace(',', '', 1)[::-1] res = json.loads(msg) return res def main(msg: str) -> dict: return var1(msg)" "def main(s): items = s.split(';') d = dict() for item in items: f_index = item.find(""@'"") if f_index == -1: continue e_index = item.find(""'"", f_index + 2) key = item[f_index + 2:e_index] f_index = item.find('q(') e_index = item.find(')', f_index + 2) value = item[f_index + 2:e_index] d.setdefault(key, value) return d" "def main(S): S = S.replace('\n', '') S = S.replace('\\', '') S = S.replace(' ', '') S = S.replace('begin<:', '') S = S.replace(':>.end', '') S = S.split(':>.<:') L = [] for e in S: L.append(e.replace(';', '').replace('def', '')) L0 = [] L1 = [] for e in L: L0.append(e.split('|>')[0]) L1.append(e.split('|>')[1]) return dict(zip(L1, L0))" "import re def main(s): lt = {} for section in re.findall('
[a-zA-Z_0-9(`.)\\s]+
', s): kname = re.findall('`[a-zA-Z0-9_]+[\\s<\\n]', section).pop(0) kname = kname[1:len(kname) - 1] vlist = [] section = section.replace(' ', '').replace('\n', '') subsect = re.findall('\\(.*\\)', section).pop(0) for val in re.findall('[a-zA-Z0-9_]+[.)]', subsect[1:len(subsect)]): vlist.append(val[0:len(val) - 1]) lt[kname] = vlist return lt" "def main(x): x = x.replace('do', ' ').replace('{', ' ').replace('}', ' ').replace('\n', ' ').replace('\t', ' ').replace('`', ' ').replace('#', ' ').replace(' equ ', ' ').replace(' is ', ' ').replace(',', ' ').replace('.', ' ').replace(' end ', ' ') + ' ' x_parts = x.split() result = {p1: int(p2) for (p1, p2) in zip(x_parts[::2], x_parts[1::2])} return result" "def main(string): dictionary = {} main_list = string[2:-2].strip().split('.')[:-1] for item in main_list: items_dict = item.split('::=') items_dict[0] = items_dict[0][8:-1].replace('""', '') items_dict[1] = items_dict[1][:-2] dictionary[items_dict[0].strip()] = int(items_dict[1].strip()) return dictionary" "import re def main(str): str = re.split('[<>@""(;)./#\n ]+', str) d = {} one = '' two = [] b = False for i in range(len(str)): if str[i] == 'end': break if str[i] == 'block' and str[i - 1] != 'begin' and (str[i - 1] != 'block'): b = False d[one] = two one = '' two = [] if str[i - 1] == 'block' and str[i] != 'block': one = str[i] if b: two.append(int(str[i])) if str[i - 1] == 'is': b = True two.append(int(str[i])) return d" "def main(x): x = x.replace(' ', '').replace('\n', '').replace('\t', '')[1:-1] x_parts = x.split(';')[:-1] result = dict() for part in x_parts: part = part[6:-8].replace('var@', '') (key, value) = part.split('=') result[key[1:-1]] = value return result" "def main(s: str) -> dict[str, int]: block_start = s.find('') block_end = s.find('', len('')) s = s[block_start + len(''):block_end].strip() s = ''.join(s.split('\n')) dos = [do.strip() for do in s.split('end') if do.strip() != ''] result = {} for do in dos: assignment = ''.join(do[len('do variable'):].split()) (value, variable) = assignment.split('==>') variable_name = ''.join([v for v in variable if v != ""'"" and v != '@']) result[variable_name] = int(value) return result" "import re def main(string): dict = {} string = string.replace('\n', '').replace(' ', '') list_of_things = re.findall('#\\((.*?)\\s*->([^.]*?)\\.', string) for i in range(len(list_of_things)): dict[list_of_things[i][1]] = re.findall('q\\((.*?)\\)', list_of_things[i][0]) return dict" "import re def main(str): str = str.replace('\n', ' ') pattern = re.compile('\\\\begin option array\\(([^()]+)\\)\\s?=>\\s?`([^.]+)\\.\\s?\\\\end') patternForElements = re.compile(""\\'([^']+)\\'"") array = pattern.findall(str) map = {} for MapElement in array: elements = patternForElements.findall(MapElement[0]) map[MapElement[1]] = elements return map" "def main(s): x = {} ind = '' val = '' for i in range(len(s) - 1): if (s[i] == 'q') & (s[i + 1] == '('): for j in range(i + 2, len(s)): if s[j] == ')': break ind += s[j] if (s[i] == ':') & (s[i + 1] == '='): for j in range(i + 2, len(s)): if s[j] == '.': break val += s[j] x[ind] = int(val) ind = '' val = '' return x" "from re import search, split, purge def main(s): dic = {} purge() s1 = search('do([^$.]*),\\s*end', s).group(1) purge() s2 = split(',', s1) purge() s3 = [] opt = [] to = [] for i in s2: s3.append(search('{([^$.]*)}', i).group(1)) purge() for i in s3: opt = int(search('opt\\s*#(\\-?[0-9]+)', i).group(1)) purge() to = search(""to\\s*\\'([^$.]*)\\'"", i).group(1) purge() dic[to] = opt return dic" "import re def main(string): list_of_things = re.findall('opt\\s*(.*?)\\sis\\s*\\""(.*?)\\""', string) return dict(list_of_things)" "import re def main(x): dict = {} val = re.findall('\\-?\\d+(?=\\s?\\=\\=\\>)', x) var = re.findall('\\w+(?=\\.)', x) for i in range(len(val)): d = {var[i]: int(val[i])} dict.update(d) return dict" "import re def main(s): pattern1 = re.compile('{[,\\s\\w]*}') result1 = pattern1.findall(s) pattern2 = re.compile('""[,\\s\\w]*""') result2 = pattern2.findall(s) pat = re.compile('[\\n\\s{1,1}{]?[\\w]+[\\s{1,1}},\\n]?') for i in range(len(result1)): b = [] res = pat.findall(result1[i]) for j in res: if j[0] == ' ' or j[0] == '{' or j[0] == ',' or (j[0] == '\n'): b.append(j[1:-1]) else: b.append(j[:-1]) result1[i] = b for i in range(len(result2)): result2[i] = result2[i][1:-1] a = {} for i in range(len(result2)): a[result2[i]] = result1[i] return a" "def main(x): x = x.replace(' ', '').replace('\n', '').replace('\t', '').replace('<:', '')[:-6] x_parts = x.split(':>') result = dict() list = [] for part in x_parts: pparts = part.split('->') for p in pparts: if len(list) % 2 == 0: p = p.replace('glob#(', '').replace(')', '') list.append(p.split('.')) else: p = p.replace('@""', '').replace('"".', '') list.append(p) for i in range(0, len(list) - 1, 2): result[list[i + 1]] = list[i] return result" "import re def main(text): match_1 = re.findall('[var]\\s(\\w+)[ \\n<]', text) match_2 = re.findall('<\\|[ \\n]*(.\\d+)\\.', text) z = 0 for _ in match_2: z += 1 di = {match_1[i]: int(match_2[i]) for i in range(z)} return di" "def main(a): ans = {} a = a[3:-4] b = a.split('.') j = 0 for elem in b: if len(elem) < 10: continue number = 0 key = '' i = elem.find('q') elem = elem[i + 2:] i = len(elem) - 1 mn = 1 while elem[i] != '#': if elem[i] == '-': number *= -1 else: number += int(elem[i]) * mn mn *= 10 i -= 1 i = 0 while elem[i] != ')': key += elem[i] i += 1 ans[key] = number return ans" "import re def main(data): Arr = {} group = '' for i in re.findall(""('[a-zA-Z_0-9]+')|([a-zA-Z_0-9]+)"", data): if i[1] in ['define', 'is', 'list', 'sect']: continue if i[0]: group = i[0][1:-1] Arr[group] = [] else: Arr[group].append(i[1]) return Arr" "import re def main(s): pattern = '(?:q\\([\\w ]+\\)\\s*=:\\s*@[\'""][\\w ]+[\'""])' parsed_s = re.findall(pattern, s.replace('\n', '')) result = {} for s in parsed_s: s = s.replace('q(', '').replace(')', '').replace(""@'"", '').replace(""'"", '').replace(' ', '').split('=:') result[s[1]] = s[0] return result" "import re def main(y): d = {} y = y.replace('\x08egin data array', '') y = y.replace('\n', '') y = y.replace('{', '') y = y.replace('}', '') y = y.replace(' ', '') y = y.split('\\end') for el in y: if el: lis = [] k = re.findall('[=:].*', el) if k: ky = str(k[0]) ky = ky.replace('=:', '') val = re.findall('[q][(].*[)]', el) val = str(val[0]) val = val.split(';') for v in val: v = str(v) v = v.replace('q(', '') v = v.replace(')', '') lis.append(v) d[ky] = lis return d" "def main(input_str: str) -> dict: res = {} var_word = 'variable' size_var_word = len(var_word) for variable in input_str.split(';'): pos_start = variable.find(var_word) + size_var_word if pos_start != size_var_word - 1: pos_mid = variable.find('<', pos_start) key = variable[pos_start:pos_mid].replace(' ', '').replace('\n', '') value = int(variable[pos_mid + 2:]) res.update({key: value}) return res" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('do', '') s = s.replace('od', '') s = s.replace(""decllist(@'"", '') s = s.replace('', '') s = s.replace('==>q(', ""'"") s = s.replace(""')'"", ')') counter = 0 for el in s.split(')'): if counter == 2: res[key] = value counter = 0 if '@' in el: value = list(map(str, el.split(""'@'""))) counter += 1 else: key = el counter += 1 return res" "def main(string): dictionary = {} x = y = z = 0 strek = '' for i in range(string.count(',')): start = string.find(""'"") end = string[start + 1:].find(""'"") y = string.find('==>') z = string.find('.') strek = string[start + 1:start + end + 1].strip() dictionary[string[y + 3:z].strip()] = strek string = string[z + 1:] return dictionary" "def main(x): x = x[2:-2].replace('\n', ' ').replace('\t', ' ').strip() x_parts = x.split(']') result = dict() for part in x_parts: if part == '': break part = part.replace('store ', '').replace('<=', '') (key, values) = part.split('[') result[key.strip()] = [int(i) for i in values.split()] return result" "import re def main(input_str): c = 0 values = [int(x.replace('#', '')) for x in re.findall('\\#-?\\d+ ', input_str)] keys = [x.replace('""', '') for x in re.findall('""\\w+""', input_str)] res_list = {} for key in keys: res_list[key] = values[c] c += 1 return res_list" "def main(x): x = x.replace('\n', ' ').replace('\t', '')[2:-2] x_parts = x.split('.') result = dict() for path in x_parts: k = path.find(':=') if path.find(':=') != -1: key = path[path.rfind(' ', 0, k - 1) + 1:k] key = key.replace(' ', '') value = path[path.find('q(', k) + 2:path.find(')', k)] result[key] = value return result s = '[[begin define quinra_57:= q(beisxe). end begin define amaabe\n:=q(laar). end begin define edla:= q(tiza_703). end ]]' main(s)" "import re def main(s): D = {} s = s.replace('\n', ' ') d = re.findall('(.*?)<\\/sect>', s) for i in d: prt = re.sub('\\D?local', string=i, repl='') key = re.findall('\\""(.*?)\\""', prt)[0] value = re.findall('\\s?(.*?)\\s?=\\D?>\\D?@', prt)[0] value = value.replace(' ', '') D[key] = value return D" "def main(line): lst = [] line = line[5:-5].replace('\n', '').replace(' ', '').split(',') for s in line: s = s.strip('').strip(';')[:-1] for i in a: (val, k) = i.split('=:') k = k.split(""'"")[1] val = val.split('(')[1].split(')')[0].split(';') val = [j.replace('`', '').strip() for j in val] d[k] = val return d" "import re def main(s): s = re.sub('[\\n:]', ' ', s) result = re.findall('\\[.*?\\]', s) text = s.split() dict = {} keys = [] value = [] for i in range(len(text) - 1): if text[i] == 'store' and i != len(text) - 1: text[i + 1] = re.sub('[:\\[ \\];]', '', text[i + 1]) keys.append(text[i + 1]) for i in result: i = re.sub('[:\\[\\] ]', '', i) base = i.split(';') t = [] for b in base: t.append(int(b)) value.append(t) for i in range(len(keys)): dict.update({keys[i]: value[i]}) return dict" "def main(row): row = row.replace(',', '') row = row.replace('\n', '') row = row.replace(';', '') row = row.replace(' ', '') row = row.replace('.end', '') result = {} row = row.split('') del row[0] for i in row: kek = i.split('==>') result |= {kek[1]: kek[0]} return result" "def main(s: str) -> dict: s = s.replace(' ', '').replace('\n', '') output_dict = {} while s.find(';|;') > 0: key = s[s.find('glob') + 4:s.find('<|')] value = s[s.find('<|') + 2:s.find(';')] output_dict[key] = int(value) s = s[s.find(';|;') + 3:] return output_dict" "def main(data): data = data.replace('\n', '') data = data.replace('\\begin', '') data = data.replace('|\\end', '') data = data.replace('|', '') data = data.replace(':', ' ') data = data.replace('list(', ' ') data = data.replace(')', ' ) ') data = data.replace('#', '') data = data.replace('.', ' ') sp = data.split() ans = {} keys = [] nam = '' for i in range(len(sp)): if sp[i].lstrip('-').isnumeric(): keys.append(int(sp[i])) elif sp[i] == ')': ans |= {nam: keys.copy()} keys.clear() else: nam = sp[i] return ans" "def main(S): res = S.replace('
', '').replace('
;', '') res = res.replace('||', '').replace('', '').replace('declare', '') res = res.replace(' ', '').replace('.', '=:').replace('\n', '') res = res[:len(res) - 2] res = res.split('=:') answ = {res[i * 2 + 1]: int(a) for (i, a) in enumerate(res[::2])} return answ" "import re def main(input_str): c = 0 input_str = re.sub('\\n', ' ', input_str) values = [re.sub('\\blist\\b|[""()@=> ]', '', x).split(',') for x in re.findall('list\\( ?.{1,70} ?\\)', input_str)] keys = [re.sub('[=> \\\\.]', '', x) for x in re.findall('=> ?\\w+\\.', input_str)] res_list = {} for key in keys: res_list[key] = values[c] c += 1 return res_list" "import re def main(s): D = {} s = s.replace('\n', ' ') d = re.findall('(.*?)<\\/sect>', s) for i in d: prt = re.sub('\\D?var', string=i, repl='') key = re.findall('\\[(.*?)\\]', prt) for j in key: keys = re.findall('\\((.*?)\\)', j) values = re.findall('\\s?(.*?)\\s?<\\D?|', prt)[0] D[values] = keys return D" "def main(a): a = a.split() b = dict() for i in range(len(a)): if '=' in a[i]: if len(a[i]) > 1: if a[i][0] == '=': word = a[i - 1] num = int(a[i][2:-1]) elif a[i][-1] == '=': word = a[i][:-1] num = int(a[i + 1][1:-1]) else: w_n = a[i].split('=') word = w_n[0] num = int(w_n[1][1:-1]) else: word = a[i - 1] num = int(a[i + 1][1:-1]) b[word] = num return b" "from typing import Dict def get_number(string) -> str: numbers = '1234567890' number = '' for symbol in string: if symbol in numbers + '+-': number += symbol else: return number return number def get_name(string) -> str: name = '' start = False for symbol in string: if symbol == ""'"": if start is False: start = True else: return name elif start: name += symbol def main(string: str) -> Dict: result: Dict = {} selected_number = None selected_name = None while string: symbol = string[0] if symbol == '#': string = string[1:] number = get_number(string) string = string[len(number) - 1:] selected_number = number elif symbol == '=': string = string[2:] name = get_name(string) string = string[len(name):] selected_name = name if selected_name is not None and selected_number is not None: result[selected_name] = int(selected_number) selected_number = None selected_name = None string = string[1:] return result" "import re def main(x): slovar = {} x = re.split('var', x) for i in range(0, len(x) - 1): if len(x[i]) < 4: del x[i] for i in range(0, len(x)): result = re.split('<=', x[i]) znach = re.findall('[-+]?\\d+', result[1]) res = re.findall('\\S', result[0]) slov = '' for i in range(0, len(res)): slov += res[i] slovar[slov] = [int(item) for item in znach] return slovar" "def main(line): list_line = line.split('.') list_line.pop(len(list_line) - 1) _dict = {} for line in list_line: line = line[line.find('""') + 1:] key = line[:line.find('""')] value = line[line.find(':') + 1:line.find(';')] value = value.strip() _dict[key] = value return _dict" "def main(x): x = x.split('.end') lib = {} for elem in x[:-1]: lib[elem[elem.find('(') + 1:elem.find(')')]] = list(map(int, elem[elem.find('{') + 1:elem.find('}')].split(';'))) return lib" "import re def main(s): D = {} s = s.replace('\n', ' ') for match in re.finditer('\\.begin loc(.*?)=>(.*?)\\.end', s): D[match.group(2).strip()] = int(match.group(1).strip()) return D" "def main(x): splitted = x.split() res = {} i = -1 for word in splitted: i += 1 if 'local' in word: name = splitted[i + 1].replace('=', '') if splitted[i + 2] != '=' and splitted[i + 2] != 'do': val = splitted[i + 2].replace('#', '').replace('=', '') val = val.replace(';', '') elif splitted[i + 2] == 'do': s2 = splitted[i + 1].split('=') val = s2[1].replace('#', '').replace(';', '') name = s2[0] else: val = splitted[i + 3].replace('#', '').replace('=', '') val = val.replace(';', '') val = val.replace('end', '') val = int(val) res[name] = val return res" "def main(x): strs = x.strip('{}').split(',') dictionary = {} for item in strs: strs2 = item.strip('{}').split('<|') if len(strs2) >= 2: string_list = [] for item in strs2[1][1:len(strs2[1]) - 1].split('.'): string_list.append(item.strip('{}').strip().strip('""')) dictionary[strs2[0].replace('new', '').strip().strip('{}').strip()] = string_list return dictionary" "import re def main(input): pattern1 = re.compile('\\(.*?\\)') pattern2 = re.compile('\\"".*?\\""') keys = re.findall(pattern1, input) values = re.findall(pattern2, input) keys = map(lambda x: x.strip('()'), keys) values = map(lambda x: x.strip('""'), values) return dict(zip(keys, values))" "import re def main(input_str): c = 0 values = [int(re.sub('[\\\\#;]', '', x)) for x in re.findall('\\#-?\\d+;', input_str)] keys = [x.replace('""', '') for x in re.findall('""\\w+""', input_str)] res_list = {} for key in keys: res_list[key] = values[c] c += 1 return res_list" "import re def main(string): sub_maps = string.split(';') result = {} for i in range(len(sub_maps) - 1): mapping = sub_maps[i].split('@') for j in range(len(mapping)): if mapping[j].startswith(""'"") and mapping[j].endswith(""'""): mapping[j] = mapping[j][1:-1] else: mapping[j] = mapping[j][1:] mapping[j] = ''.join(re.findall('\\w+', mapping[j])) result[mapping[-1]] = mapping[1:-1] return result" "def main(s): s = s.replace('\\', '') s = s.replace(' ', '') s = s[13:-6] s = s.replace('(', '') s = s.replace(')', '') s = s.replace('@', '') s = s.replace('`', ""'"") s = s.replace('\n', '') s = s.replace(' ', '') list1 = s.split(""'"") s1 = list1[0::3] s2 = list1[1::3] dict1 = {} for i in range(len(s1)): dict1.update({s1[i]: s2[i]}) return dict1" "import re def main(s): s = ''.join(s.split()) some = dict() for j in range(len(s)): if s[j] == '[' or s[j] == ']': s = s[:j] + ':' + s[j + 1:] elif s[j] == '.': s = s[:j] + ';' + s[j + 1:] b = re.compile('var:(.*?):').findall(s) c = re.compile('to(.*?);').findall(s) for j in range(len(b)): b[j] = b[j].split('`') for j in range(len(b)): b[j].remove('') for i in range(len(c)): some.setdefault(c[i], []) for j in range(len(b[i])): some[str(c[i])].append(b[i][j]) return some" "import re def main(s): s = s.replace(' ', '').replace('\n', '').lower() keys = re.findall('=>[a-z]+[_]*\\d*;', s) values = re.findall('def#[-]?\\d+', s) keys = [re.search('[a-z]+[_]*\\d*', el).group() for el in keys] values = [int(re.search('[-]?\\d+', el).group()) for el in values] res = {key: value for (key, value) in zip(keys, values)} return res" "import re def main(s): pattern = 'define[\\w\\s\\\\n:#-]*;' res = re.findall(pattern, s) bb = [] for i in res: cc = [] pat1 = '\\s[\\w]*[\\s:]?' res1 = re.search(pat1, i) strp = res1.group(0).split() strp = strp[0].split(':') cc.append(strp[0]) pat2 = '#[-\\w]*;' res2 = re.search(pat2, i) stri = res2.group(0).split() cc.append(stri[0][1:-1]) bb.append(cc) d = {} for i in range(len(bb)): d[bb[i][0]] = int(bb[i][1]) return d" "import re def main(string): arr = [int(word.replace('=', '')) for word in re.findall('[-]?[0-9]{1,}[ \n]?=', string)] arr2 = [word.replace('@', '').replace('""', '') for word in re.findall('@""[a-zA-Z_0-9]*""', string)] return dict(zip(arr2, arr))" "def main(x): x = x.replace('\\begin', ' ').replace('.\\end', ' ').replace('. \\end', ' ').replace('#', ' ').replace('variable', ' ').replace('(', ' ').replace(')', ' ').replace(';', ' ').replace('\n', ' ') x_parts = x.split('.') x_parts1 = [i.split('<==') for i in x_parts] dict1 = {} for i in range(len(x_parts1)): suka = x_parts1[i][1].split() for j in range(len(suka)): suka[j] = int(suka[j]) blyat = x_parts1[i][0].replace(' ', '') dict1[blyat] = suka return dict1" "import re def main(x): x = re.split(' *<\\| *', x) res_dict = {} for i in range(1, len(x)): res_dict.setdefault(x[i - 1].split()[-1].strip('`'), int(x[i].split()[0])) return res_dict" "def var_name(x, i): var = str() while x[i] != ' ' and x[i] != '<': var = var + x[i] i += 1 return (var, i) def assignment_skip(x, i): k = 0 while k < 2: if x[i] == '=': k += 1 i += 1 if x[i] == ' ': i += 1 return i def get_val(x, i): val = str() k = 0 while k < 2: if x[i] == '""': k += 1 if x[i] != '@' and x[i] != '""': val = val + x[i] i += 1 return (val, i) def parser(x): ans = dict() tmp = -1 while True: tmp = x.find('val', tmp + 1) if tmp == -1: break i = tmp + 4 (var, i) = var_name(x, i) i = assignment_skip(x, i) (val, i) = get_val(x, i) ans[var] = val return ans def main(x): x = x.replace('\n', ' ') return parser(x)" "def main(x): x = x[2:-4] x = x.split(',') dictionary = {} for i in x: key = i[i.rfind('declare') + 8:i.find('<-')].strip() value = i[i.find('@') + 2:i.find('.') - 1].strip() dictionary.update({key: value}) return dictionary" "def main(x): if x.find('do') != -1: dict = {} end = False while end is False: index1 = x.find('(') + 1 index2 = x.find(')') string = x[index1:index2] string = string.replace(' ', '') string = string.replace('#', '') string = string.split('.') list = [] for i in range(len(string)): list.append(int(string[i])) x = x[index2:len(x)] name1 = x.find('->') + 2 name2 = x.find('.') name = x[name1:name2] name = name.replace(' ', '') name = name.replace('\n', '') dict[name] = list x = x[name2 + 2:len(x)] if len(x) < 10: break return dict" "import re def main(string): array = re.split('\\s|\\n', string) array.pop() del array[0] set = [] for element in array: if element != 'to': set.append(element) dict = {} for i in range(1, len(set), 2): dict[str(set[i])] = set[i - 1] return dict" "def main(x): a = [] a.extend(x) for i in range(len(a)): if a[i] == '>' and a[i + 1] != ' ': a.insert(i + 1, ' ') x = ''.join(a) d = {} m = x.split(';') x = ' '.join(m) m = x.split() for i in range(len(m)): if m[i] == '->': d[m[i + 1]] = m[i - 1] return d" "import re def main(x): mydict = {} list1 = [] result = re.findall('\\w+', x) for i in range(1, len(result) - 1): list1.append(result[i]) for i in range(0, len(list1)): if i % 3 == 1: str = list1[i] if i % 3 == 2: mydict[list1[i]] = str str = '' return mydict" "def main(s: str): import re s = s.replace('\n', ' ') s = s.replace('
', '') s = s.replace('
', '') s = s.replace('[', '') s = s.replace(']', '') s = s.replace(';', '') s = s.split('set') clear_s = [] for elem in s: if elem.strip(): clear_s.append(elem) dict_ = {} for elem in clear_s: key_value_arr = re.split(' +', elem) clear_key_value_arr = [] for i in key_value_arr: if i.strip(): clear_key_value_arr.append(i) dict_[clear_key_value_arr[0]] = clear_key_value_arr[1] return dict_" "import re def f(s): s = s.replace('\n', '') s = s.replace(')', ')\n') keys = re.findall(""@\\'(.*)\\'"", s) lists = re.findall('list\\((.*)\\)', s) keys = [key for key in keys] lists = [lst.split('.') for lst in lists] for i in range(len(lists)): for j in range(len(lists[i])): lists[i][j] = int(lists[i][j]) result = {} for i in range(min(len(keys), len(lists))): result[keys[i]] = lists[i] return result def main(s): return f(s)" "import re def main(st): lib = {} match = re.findall('[a-zA-z][0-9a-zA-Z_]* *:= *[a-zA-z][0-9a-zA-Z_]*', st) for i in match: i = i[1:].split(':=') lib[i[0].strip()] = i[1].strip() return lib" "import re def main(x): regex = re.search('begin(.|\\n)*end', x) values = {} if regex is not None: pattern = '\\\\begin\\s*auto\\s*(\\w+)\\s*<=\\s*(\\w+)\\.\\s*\\\\end\\.' matches = re.findall(pattern, x) for match in matches: values[match[0]] = match[1] return values" "def main(inp): cnt1 = 0 strs = [] for i in range(len(inp)): if inp[i] == '@': a = i if inp[i] == '""': cnt1 += 1 if cnt1 == 4: b = i cnt1 = 0 strs.append(inp[a:b + 1]) cnt2 = 0 d = {} c = [] for j in range(len(strs)): for k in range(len(strs[j])): if strs[j][k] == '""': cnt2 += 1 c.append(k) dvalue = strs[j][c[0] + 1:c[1]] dkey = strs[j][c[2] + 1:c[3]] d[dkey] = dvalue c = [] return d" "import re def main(x): slovar = {} x = re.split('glob', x) for i in range(0, len(x) - 1): if len(x[i]) < 8: del x[i] for i in range(0, len(x)): result = re.split('>', x[i]) znach = re.findall('\\w', result[0]) res = re.findall('\\w', result[1]) slov = '' slov2 = '' for i in range(0, len(res)): slov += res[i] for i in range(0, len(znach)): slov2 += znach[i] slovar[slov] = slov2 return slovar" "def main(str): str = str.replace(' ', '') str = str.replace('\n', '') result = {} i = 0 k = 0 while i < len(str): resource = '' if str[i] == '>' and str[i + 1] == 'd': i += 4 while str[i] != '=': resource += str[i] i += 1 if str[i] == '=' and str[i + 1] == '>': i += 2 key = '' while str[i] != '.': key += str[i] i += 1 result[key] = int(resource) k += 1 i += 1 return result" "import re def main(s): def lm(_a): return re.split('\\s+' if re.search('\\s', _a) else '::=', _a)[1] st = re.findall('store\\s+\\w+', s) st = list(map(lm, st)) ts = re.findall('::=\\s*\\w+', s) ts = list(map(lm, ts)) dc = {} for (j, i) in enumerate(st): dc[i] = ts[j] return dc" "import re def main(s): pattern = '#(.*?) *==> *(.*?) *\\)' parsed_s = re.findall(pattern, s.replace('\n', '')) return {key: int(value) for (value, key) in parsed_s}" "import re def main(str): pattern = '(?<=[#]).*?(?=[.][:][>])' result = {} str = str.replace(' ', '') str = str.replace('\n', '') access = re.findall(pattern, str) for i in access: txt = i.split('->') result[txt[1]] = int(txt[0]) return result" "import re def main(string): key = re.findall('{ *\\n*\\w*', string) code = re.findall(""\\'\\w*\\'"", string) for i in range(len(key)): key[i] = key[i].replace('{', '') key[i] = key[i].replace(' ', '') key[i] = key[i].replace('\n', '') code[i] = code[i].replace(""'"", '') d = {key[i]: code[i] for i in range(len(key))} return d" "import re def main(string): key = re.findall('{ *new *\\n*\\w*', string) code = re.findall('<- *\\n*\\w*', string) for i in range(len(key)): key[i] = key[i].replace('{', '') key[i] = key[i].replace(' ', '') key[i] = key[i].replace('new', '') key[i] = key[i].replace('\n', '') code[i] = code[i].replace('<-', '') code[i] = code[i].replace('\n', '') code[i] = code[i].replace(' ', '') d = {key[i]: code[i] for i in range(len(key))} return d" "import re def main(s): empty = re.sub('[@|#|{|}|=|<|.| ]', '', s) withoutdecl = empty.replace('decl', '') list = withoutdecl.split(chr(34)) list.remove('') lw = list[0::2] lch = list[1::2] nlch = [int(item) for item in lch] return dict(zip(lw, nlch))" "def remove_extra_symbols(str): str = str.replace('done', '') str = str.replace('do', '') str = str.replace('declare', '') str = str.replace('>>.', '') str = str.replace('<<', '') str = str.replace('::=', ':') str = str.replace('\n', '') return str def split_into_dict(str): dct = {} str = str.split('.') for s in str: s = s.replace(' ', '') vals = s.split(':') if len(vals) == 2: dct[vals[0]] = vals[1] return dct def main(str): str = remove_extra_symbols(str) d = split_into_dict(str) return d" "def main(x): i = 0 x = x.replace(' ', '') x = x.replace('\n', '') x = x.replace('\r', '') x = x.replace('begin', '') x = x.replace('decl', '') x = x.replace('end.', '') x = x.replace('<==', '') x = x.lstrip('do') dict = {} s = '' num = 0 check = 1 while x[i:i + 4] != 'done': if x[i] == '""' and x[i + 1].isalpha(): i += 1 while x[i] != '""': s += x[i] i += 1 i += 1 if x[i].isdigit() or x[i] == '-': if x[i] == '-': check = -1 i += 1 while x[i].isdigit(): num = num * 10 + int(x[i]) i += 1 dict[s] = num * check s = '' num = 0 check = 1 i += 1 return dict" "import re def main(st): lib = {} a = '[a-zA-z][0-9a-zA-Z_]*[ \n]*:= *[a-zA-z][0-9a-zA-Z_]*' match = re.findall(a, st) for i in match: i = i.split(':=') lib[i[0].strip()] = i[1].strip() return lib" "def main(data): data = data.replace('\n', ' ') data = data.lstrip('do do local array') data = data.strip('od end').strip().strip('.') data = data.split('. od do local array') dictionary = {} for line in data: (values, key) = line.split('=>') values = values.strip() values = values.lstrip('(') values = values.rstrip(')') values = values.split(';') values = list(map(lambda x: int(x.strip()), values)) key = key.strip() dictionary[key] = values return dictionary" "import re def main(s): D = {} s = s.replace('\n', ' ') d = re.findall('(.*?)<\\/data>', s) for i in d: key = re.findall('glob (.*?)<', i)[0] key = key.replace(' ', '') value = re.findall('{(.*?)}', i)[0] value = value.replace(""'"", '') value = value.replace(' ', '') value = value[1:].split('@') D[key] = value return D" "import re def main(s): D = {} s = s.replace('\n', ' ') d = re.findall('\\|\\|\\s?define\\s?(.*?)\\s?\\|\\|', s) for i in d: key = re.findall('\\s?(.*?)<', i)[0] key = key.replace(' ', '') value = re.findall('\\[(.*?)\\]', i)[0] value = value.replace(""'"", '') value = value.replace(' ', '') value = value.split('.') D[key] = value return D" "def main(s): d = dict() s = s.split('.') for i in range(len(s) - 1): k = s[i].split(' ') (key, num) = (None, None) for z in range(len(k)): try: num = int(k[z]) except Exception: pass pass if num is None: for n in range(len(k)): try: end = k[n].index('\n') num = int(k[n][0:end]) except ValueError: pass try: start = k[n].index('\n') num = int(k[n][start + 1:len(k[n])]) except ValueError: pass pass pass for z in range(len(k)): try: start = k[z].index('""', 0) end = k[z].index('""', start + 1) key = k[z][start + 1:end] except Exception: pass pass d[key] = num pass return d" "import re def main(inp): regex_num = re.findall('""\\w+""\\D*<=[ ]*[-]?\\d+', inp) d = {} for item in regex_num: name = re.search('""\\w+""', item)[0].replace('""', '') num = int(re.findall('[-]?\\d+', item)[-1]) d[name] = num return d" "import re def main(data): data = data.replace(' ', '').replace('\n', '') tag_regex = '(.*?)<\\/data>' lst = re.findall(tag_regex, data) res_dict = {} for item in lst: key_regex = 'glob\\""(.*?)\\""<==' value_regex = '<==(.*?)\\.' key = re.findall(key_regex, item)[0] value = re.findall(value_regex, item)[0] res_dict[key] = value return res_dict" "import re def main(x): slovar = {} x = re.split('list', x) del x[0] for i in range(0, len(x)): razbienie = re.split('->', x[i]) slovo1 = re.findall('\\(.*?\\)', razbienie[1]) slovo2 = slovo1[0][1:len(slovo1[0]) - 1] slovo3 = re.findall('[\\(]\\w+', razbienie[1]) znachenie1 = re.split(',', razbienie[0]) znachenie2 = [] for k in range(0, len(znachenie1)): slov = re.findall('\\w+', znachenie1[k]) znachenie2.append(slov[0]) slovar[slovo3[0][1:]] = [item for item in znachenie2] return slovar" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('', '') s = s.replace('', '') s = s.replace('auto#', '') s = s.replace('', '') s = s.replace('=:', ',=:') s = s.replace('.;', '=:') counter = 0 for el in s.split('=:'): if counter == 2: res[key] = value counter = 0 if ',' in el: value = int(el.replace(',', '')) counter += 1 else: key = el counter += 1 return res" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('begin', '') s = s.replace(';:>end', '') s = s.replace('<:#', '') s = s.replace(';:>', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace(""',"", '=>@') s = s.replace(""'"", '') counter = 0 for el in s.split('=>@'): if counter == 2: res[key] = value counter = 0 if ',' in el: value = list(map(int, el.split(','))) counter += 1 else: key = el counter += 1 return res" "def main(x): i = 0 x = x.replace(' ', '') x = x.replace('\n', '') x = x.replace('\r', '') x = x.replace('begin', '') x = x.replace('sect', '') x = x.replace('make', '') x = x.replace('<', '') x = x.replace('>', '') x = x.replace('#', '') x = x.replace(';', '') dict = {} s = '' num = 0 check = 1 while x[i:i + 3] != 'end': if x[i].isdigit() or x[i] == '-': if x[i] == '-': check = -1 i += 1 while x[i] != '|': num = num * 10 + int(x[i]) i += 1 i += 1 while x[i] != '/': s += x[i] i += 1 dict[s] = num * check num = 0 check = 1 s = '' i += 1 return dict" "def main(f): newf = f.split('{{') newf.pop(0) dictionary = {} for i in range(len(newf)): str1 = '' str2 = [] for j in range(len(newf[i])): str1 += newfunc1(newf[i][j]) if newf[i][j] in [' ', '\n'] and len(str1) != 0: str2.append(str1) str1 = '' elif newf[i][j] in ['[', ']'] and len(str1) != 0: str2.append(str1) str1 = '' elif newf[i][j] == '.' and len(str1) != 0: str2.append(str1) str1 = '' break str3 = [] str2.pop(0) for j in range(len(str2) - 2): str3.append(str2[j]) dictionary.update({str2[len(str2) - 1]: str3}) return dictionary def newfunc1(x): if x.isalpha(): return x elif x.isdigit(): return x elif x == '_': return x else: return ''" "def main(str): dictionary = {} while str.find('#') > 0: i = str.find('#') j = str.find(""'"") dictionary[str[j + 1:str.find(""'"", j + 1)].strip()] = int(str[i + 1:str.find('=', i)].strip()) str = str[str.find('/', i):] return dictionary" "import re def main(s): regex = '(\\w+\\s*<==\\s*\\-?\\w+)' values = re.findall(regex, s) values = [re.sub('\\s+', '', i).split('<==') for i in values] return {i[0]: int(i[1]) for i in values}" "import re def main(data): dat = data.split(' ') for i in range(len(dat)): dat[i] = re.sub('set', '', re.sub('[->|().]', '', dat[i])) dat[i] = re.sub('\n', '', dat[i]) dat = [x for x in dat if x] result = {} for i in range(1, len(dat), 2): result[dat[i]] = dat[i - 1] return result" "def main(s): result = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('
', '') s = s.replace('
', '') s = s.replace('', '') s = s.replace(',', '') s = s.replace('opt', '') s = s.replace('->q(', ' ') s = s.replace(').', ' ') s = s.split() while s: result[s[1]] = int(s[0]) s = s[2:] return result" "def main(string, i=0): my_dict = {} string = string.replace('#', '').replace('=', ' = ').replace('decl', ' decl ').replace('(', ' (').replace(')', ') ') lst = string.split() while i < len(lst): if lst[i] == 'decl': key = lst[i + 1] while lst[i] != '=': i += 1 i += 1 value = lst[i] while ')' not in value: i += 1 dop_value = lst[i] value += dop_value value = value.replace('(', '').replace(')', '').replace(' ', '').replace(';', ' ') final_value = value.split() my_dict[key] = final_value else: i += 1 return my_dict" "def main(s: str): res = {} s = s.replace('""', '') s = s.replace('@', '') s = s.replace('\n', '') s = s.replace('var', '') s = s.replace('.', ',') s = s.replace(' ', '') s = s.replace(',}', '') s = s.replace('{', '') s = s.replace('},', '') for el in s.split(','): res[el.split('<-')[0]] = el.split('<-')[1] return res" "def main(str): dict = {} lists = list(str) lst1 = [] value = '' key = '' for i in range(len(lists)): if lists[i].isdigit() or lists[i] == '-': lst1.append(lists[i]) if lists[i] == '>': value = ''.join(lst1) lst1 = [] for j in range(i + 1, len(lists)): if lists[j] == '\n': lists[j] = '' if lists[j] == ';': lst1 = [] break if lists[j] == ' ': continue lst1.append(lists[j]) lists[j] = '' key = ''.join(lst1) dict[key] = int(value) return dict" "def main(text): m = text.split(';') d = {} for i in range(len(m) - 1): buffer = m[i].split('|')[1][1:m[i].split('|')[1].index('<')] a_1 = buffer.replace(' ', '').replace('\n', '') a_2 = m[i].split('|')[0].split('""')[1] d[a_1] = a_2 return d" "def write_name(word): name = '' j = 2 while word[j] != ')': name += word[j] j += 1 return name def sub_write_name(word): num = 0 negative = False for i in range(word.find(')'), len(word)): if word[i] == '-': negative = True if '0' <= word[i] <= '9': num *= 10 num += int(word[i]) if negative: num *= -1 return num def write_num(prev_word, curr_word): num = 0 num = sub_write_name(prev_word) if num == 0: num = sub_write_name(curr_word) return num def main(func_line): d = {} buff = func_line.split() name = '' num = 0 name_exist = False for i in range(0, len(buff)): if buff[i][0] == 'q': name = write_name(buff[i]) name_exist = True if name_exist: num = write_num(buff[i], buff[i + 1]) if num != 0 and name != '': d[name] = num name = '' num = 0 name_exist = False return d" "def main(s): d = {} k_1 = 0 k = 0 data = '' for i in range(len(s) - 1): if s[i] == '""': if k_1 == 0: k_1 = i + 1 else: data = s[k_1:i] k_1 = 0 k += 1 if s[i] == '>': if s[i + 1] == ' ': if ord(s[i + 1]) == 10: k_1 = i + 3 else: k_1 = i + 2 elif ord(s[i + 1]) == 10: k_1 = i + 2 else: k_1 = i + 1 if s[i] == ';': d.setdefault(s[k_1:i], data) k_1 = 0 data = '' return d" "import re def main(x): res = re.findall('>\\w+|> \\w\\w+', x) res += re.findall('[#-]\\d+', x) z = {} for i in range(len(res) // 2): res[i] = res[i].replace(' ', '') res[i] = res[i].replace('>', '') res[i] = res[i].replace('> ', '') res[i + len(res) // 2] = int(res[i + len(res) // 2].replace('#', '')) z[res[i]] = res[i + len(res) // 2] return z" "import re def main(s): A = [] B = [] s = s.replace('\n', '') d = re.findall('
(.*?)<\\/section>', s) for i in d: prt1 = re.sub('\\D?do', string=i, repl='') prt2 = re.sub('\\D?end', string=prt1, repl='') prt3 = re.sub('\\D?global', string=prt2, repl='') key = re.findall('\\((.*?)\\)', i) for it in key: it0 = it.replace(' ', '') it1 = it0.replace(""'"", '') it2 = it1.split(',') B.append(it2) values = [x.replace(' ', '') for x in re.findall('\\s?(.*?)\\s?\\D?#', prt3)] for i in values: value4 = re.findall('\\w+<=+', i) for j in value4: value5 = re.sub('\\D?\\=', string=j, repl='') A.append(value5) dictionary = dict(zip(A, B)) return dictionary" "import re def main(text): ans = re.findall('@.[\\w]*', text) d = {} for i in range(0, len(ans) - 1, 2): d.update([(ans[i + 1][2:], ans[i][2:])]) return d main('|| |variable @""erxeed""-> @\'zaxeus_28\'; |,' + '| variable @""edquor_533"" -> @\'ragele_296\'; |, ||') main('|| | variable @""usat_705""-> @\'aon\';|,' + '| variable @""edleti""->@\'quama_612\'; |, ||')" "def main(x): (key, value) = ('', '') buff = '' x = x.replace('\n', ' ') d = {} for i in x: if i != ' ' and i != ';' and (i != '[') and (i != ']'): buff += i else: if buff not in ['do', 'loc', 'od']: if key == '': key = buff buff = '' elif value == '': value = buff buff = '' elif buff == 'od': d[key] = value key = '' value = '' buff = '' return d" "import re def main(s): a = re.findall('#[-]*\\d+', s) b = re.findall('`[^;]+;', s) a = [int(elem[1:]) for elem in a] b = [elem[1:len(elem) - 1] for elem in b] d = dict(zip(b, a)) return d" "def main(s): s = s.replace('\n', ' ') d = {} k_1 = 0 data = '' for i in range(len(s) - 1): if s[i] == ""'"": if k_1 == 0: k_1 = i + 1 else: data = s[k_1:i] if s[i + 1] == ' ': if ord(s[i + 4]) == 10: k_1 = i + 5 elif s[i + 4] != ' ': k_1 = i + 4 else: k_1 = i + 5 else: k_1 = i + 4 if s[i:i + 3] == '||,': if s[i - 1] == ' ': d.setdefault(s[k_1:i - 1], data) k_1 = 0 data = '' else: d.setdefault(s[k_1:i], data) k_1 = 0 data = '' return d" "import re def main(x): x = re.sub('[^A-Za-z0-9_>\n ]', '', x) d = {} lst = x.replace('auto', '').replace('>', ' ').split() for (i_step, word) in enumerate(lst): if i_step % 2 != 0: d[word] = lst[i_step - 1] return d" "def main(x): d = {} lastkey = '' for i in range(len(x)): str1 = x.find('@', i) str2 = x.find(';', str1) key1 = x.find('variable', i) key2 = x.find('==>', key1) if str2 + 12 > len(x) and lastkey == '': lastkey = x[key1 + 9:key2] lastkey = lastkey.replace(' ', '') lastkey = lastkey.replace('\n', '') if str1 > key1: str = x[str1 + 2:str2 - 1] key = x[key1 + 9:key2] str = str.replace(' ', '') str = str.replace('\n', '') key = key.replace(' ', '') key = key.replace('\n', '') if lastkey == '': d[str] = key else: d[str] = lastkey return d" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('global', '') s = s.replace(',', '') s = s.replace('.', ', ') s = s.replace('', '') s = s.replace(', }', '') s = s.replace('{', '') s = s.replace('{', '') s = s.replace('is', '?') s = s.replace('?ora', 'isora') s = s.replace(""'"", '') for el in s.split(', '): res[el.split('?')[0]] = int(el.split('?')[1]) return res" "import re def main(text): text = re.sub('\n', '', text) text = re.sub('\\s*<:\\s*', '', text) text = re.sub('\\s*:>\\s*', '', text) parts = text.split('.')[:-1] d = dict() for i in parts: s = i s = re.sub('\\s*<%\\s*', '', s) s = re.sub('\\s*%>\\s*', '', s) elems = re.split('\\s*<=\\s*', s) elems[0] = re.sub('\\s*declare\\s*""', '', elems[0]) elems[0] = re.sub('""\\s*', '', elems[0]) elems[1] = re.sub('\\s*array\\s*\\(\\s*', '', elems[1]) elems[1] = re.sub('\\s*\\)\\s*', '', elems[1]) d[elems[0]] = [int(i) for i in list(re.split('\\s*;\\s*', elems[1]))] return d" "def main(x): result = {} text = x.replace(' ', '') text = text.replace('\n', '').split('var') for i in range(1, len(text)): n = text[i].split('==>') znach = n[0] key = n[1].split(';')[0] result[key] = znach return result" "def is_digit(num): try: num = int(num) return True except Exception: return False def main(string): string = string.split('') new_dict = dict() for elem in string[1:]: num_list = list() start_num = elem.index('(') end_num = elem.index(')') for el in elem[start_num + 1:end_num].split(): if is_digit(el): num_list.append(int(el)) start_title = elem.index('declare') + 7 end_title = elem.index('<|') title = elem[start_title:end_title].strip() new_dict[title] = num_list return new_dict" "def main(text): parsed = {} text = text.replace('|', ' ').replace('\t', ' ').replace('\n', ' ') while text.count('<=='): i = text.find('<==') before = text[:i].rstrip() text = text[i + 3:].lstrip() parsed[before[before.rfind(' '):].strip()] = text[:text.find(' ')].strip() return parsed" "import re def main(inp): nameRegex = re.compile(""\\'\\w*\\'"") valueRegex = re.compile('`\\w*') names = nameRegex.findall(inp) values = valueRegex.findall(inp) result = {} for i in range(len(names)): result[names[i].replace(""'"", '')] = values[i].replace('`', '') return result" "def main(s): s = s.replace(' ', '') s = s.replace('', '') s = s.replace('', '') s = s.replace('store', '') s = s.replace('#', '') s = s.replace('(', '') s = s.replace('|>', '') s = s.replace('@', '') s = s.replace('""', '') s = s.replace('\n', '') s = s.split(';') s = s[:len(s) - 1] a = len(s) for i in range(0, a): s[i] = s[i].split(')') for i in range(0, a): s[i][0] = s[i][0].split('.') for j in range(0, len(s[i][0])): s[i][0][j] = int(s[i][0][j]) name = {} for i in range(0, a): name[s[i][1]] = s[i][0] return name" "def main(x): a = [] a.extend(x) i = 0 while True: match a[i]: case ':': match a[i - 1]: case ' ': pass case _: a.insert(i, ' ') case '(': match a[i + 1]: case ' ': pass case _: a.insert(i + 1, ' ') case ')': match a[i - 1]: case ' ': pass case _: a.insert(i, ' ') case '>': break i = i + 1 x = ''.join(a) d = {} m = x.split(',') x = ' '.join(m) m = x.split() for i in range(len(m)): if m[i] == 'decl': items = [] for x in range(i, len(m)): if m[x] == 'q(': items.append(m[x + 1]) if m[x] == 'end': break d[m[i + 1]] = items return d" "def main(x): peps = x.split(sep='make') out = dict() for str in peps: if str.find('@') == -1: continue a = str.find(""'"") b = str.find(""'"", a + 2, len(str)) key = str[a + 1:b] c = str.find('(') d = str.rfind(')', b) tmp = str[c + 1:d - 1] tmp = tmp.replace(',', ' ') tmp = tmp.replace(""'"", ' ') value = tmp.split() out[key] = value return out" "import re def main(input): seq = re.findall('[==>, ==> ][\\s]?(\\w*);', input) data_str = list(re.findall('\\(([0-9- .\\n]*)\\)', input)) data = [] for i in range(len(data_str)): data.append(re.findall('(-?\\d+)', data_str[i])) for i in range(len(data)): for j in range(len(data[i])): data[i][j] = int(data[i][j]) dictionary = dict(zip(seq, data)) return dictionary" "import re def main(y): d = {} word1 = re.findall('""\\w+""', y) word2 = re.findall('\\w+;', y) for i in range(len(word1)): word1[i] = word1[i][1:-1] word2[i] = word2[i][:-1] d[word1[i]] = word2[i] return d" "def main(line): lst = [] line = line.replace(' ', '')[1:-2].replace('\n', '').split('.') for s in line: temporary_s = s[10:-8].replace('|>', ' ').replace('""', '').split() (temporary_s[0], temporary_s[1]) = (temporary_s[1], int(temporary_s[0])) lst.append(temporary_s) return dict(lst)" "def main(x): if x.find('block') != -1: dict = {} end = False while end is False: index1 = x.find('array') + 5 index2 = x.find('))') string = x[index1:index2] string = string.replace(' ', '') string = string.replace('(', '') string = string.replace(')', '') string = string.replace('\n', '') string = string.split('.') list = [] for i in range(len(string) - 1): list.append(string[i]) name1 = x.find('data') + 4 name2 = x.find('<=') name = x[name1:name2] name = name.replace(' ', '') name = name.replace('\n', '') dict[name] = list x = x[index2 + 3:len(x)] if len(x) < 20: break return dict" "def main(line): lst = [] line = line.replace(' ', '')[9:-12].replace('\n', '').split(',') for s in line: temporare_s = s[7:-2].replace('""', '').split('[') temporare_s[1] = temporare_s[1].strip(']') temporare_s[1] = temporare_s[1].split('.') lst.append(temporare_s) return dict(lst)" "def main(row): ans = {} row = row.replace(' ', '') row = row.replace('\n', '') row = row.replace('{', '') row = row.replace('}', '') row = row.replace('option', '') row = row.replace('<==', '') row = row.replace(""')"", '') row = row.replace(')', '') row = row.split('q(') del row[0] for i in range(len(row)): row[i] = row[i].split('list') row[i][1] = row[i][1].split(""''"") row[i][1][0] = row[i][1][0].replace(""('"", '') ans |= {row[i][0]: row[i][1]} return ans" "def main(str): str = str.replace(' ', '') map = {} while str.find('equ') != -1: val1 = str.find('#') val2 = str.find('=') val = str[val1 + 1:val2] key1 = str.find('(') key2 = str.find(')') key = str[key1 + 1:key2] map[key] = int(val) bon = str.find('%>') str = str[bon + 2:] return map" "def main(S): info = {} check = 0 while check != -1: start = S.find('""') S = S.replace('""', '@', 1) end = S.find('""') S = S.replace('""', '@', 1) posibleKey = S[start + 1:end] S = S.replace(posibleKey, '@', 1) minus = S.find('-') checkDigit = 0 i = 0 while checkDigit != 1: if S[i].isdigit(): startNum = i checkDigit = 1 else: i += 1 if minus < startNum and minus != -1: startNum = minus endNum = S.find('.') S = S.replace('.', '@', 1) posibleData = S[startNum:endNum] S = S.replace(posibleData, '@', 1) info[posibleKey] = int(posibleData) check = S.find('.') return info" "import re def main(expr): first_part = re.findall(""'[a-z]+_?\\d*'"", expr) second_part = re.findall('#-?[\\d]{3,4}', expr) i = len(first_part) for k in range(i): second_part[k] = second_part[k].replace('#', '') first_part[k] = first_part[k].replace(""'"", '') result = dict.fromkeys(first_part) for k in range(i): result[first_part[k]] = int(second_part[k]) return result" "import re def main(s): pattern = 'option *(.*?) *\\|> *\\""(.*?)\\"";' parsed_s = re.findall(pattern, s.replace('\n', '')) return {key: value for (value, key) in parsed_s}" "def main(line): lst = [] s = line.replace(' ', '')[4:-6].replace('\n', '').split(':>,<:') for i in s: temporary_s = i[10:-1].split('""') temporary_s[1] = temporary_s[1][5:-1].split(',') temporary_s[1] = list(map(int, temporary_s[1])) lst.append(temporary_s) return dict(lst)" "def main(text): m = text.split('.') d = {} for i in range(len(m) - 1): second = m[i].split(':')[1].split(';')[0] a_1 = int(second.replace(' ', '').replace('\n', '')) a_2 = m[i].split(':')[0].split('@')[1].replace(' ', '').replace('\n', '') a_2 = a_2[1:len(a_2) - 1] d[a_2] = a_1 return d" "import re def main(x): bible = {} word_1 = re.findall('\\w+\\d*\\s?:', x) word_2 = re.findall('-?\\d+\\.', x) for i in range(0, len(word_1)): a = re.findall('\\w+', word_1[i]) word_1[i] = a[0] word_2[i] = int(word_2[i][:-1]) bible[word_1[i]] = word_2[i] return bible" "import re def main(x): d = [] x = re.split('begin declare', x) for i in x: if re.split('end', i): d.append(re.split('end', i)) k = '' for x in d: for word in x: k += word answ = {} k = re.split('@', k) for el in k: el = el.replace(' ', '') if len(el) > 1: answ.setdefault(re.split('<=', el)[0].replace(' ', '').replace(""'"", '').replace('\n', ''), int(re.split('<=', el)[1].replace(' ', '').replace(',|', '').replace(',', '').replace('\n', ''))) return answ" "import re def main(x): slovar = {} x = re.split('local', x) for i in range(0, len(x) - 1): if len(x[i]) < 9: del x[i] for i in range(0, len(x)): result = re.split('>', x[i]) znach = re.findall('[-+]?\\d+', result[0]) f = result[1].find(';') res = result[1][:f] if not res[0].isalpha(): res = res[1:] slovar[res] = [int(item) for item in znach] return slovar" "import re def main(s): s = re.sub('[(<>: )]', '', s) s = s.replace('local', '') s = s.replace('==', ' ') s = s.replace(',', ' ') tokens = s.split() d = {} isVar = True for i in range(0, len(tokens), 2): d[tokens[i]] = int(tokens[i + 1]) return d" "def main(line): line = line.split('set')[1:] new_dict = dict() for elem in line: elements = list() index_one = elem.index('list') index_two = elem.index('|>') parts = elem[index_one:index_two].split('@')[1:] for el in parts: index_start = el.index(""'"") index_end = el.rfind(""'"") elements.append(el[index_start + 1:index_end]) title = elem[elem.index('q(') + 2:elem.index(').')] new_dict[title] = elements return new_dict" "import re def main(section): section = section.replace(' ', '').replace('\n', '') tag_regex = 'beginval(.*?)end' lst = re.findall(tag_regex, section) res_dict = {} for item in lst: key_regex = '""(.*?)\\""::=' value_regex = '::=(.*?);' key = re.findall(key_regex, item)[0] value = int(re.findall(value_regex, item)[0]) res_dict[key] = value return res_dict" "import re def main(x): ans = {} val_mask = '(?<=#)[-\\d]*(?==:)' name_mask = '(?<==:)[^;]*(?=;)' x = re.sub(' ', '', x) x = re.sub('\n', '', x) vals = re.findall(val_mask, x) names = re.findall(name_mask, x) ans = {i: int(j) for (i, j) in zip(names, vals)} return ans" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('q.*?:', a) tre = re.findall('=.*?;', a) for i in range(len(one)): one[i] = one[i].replace('(', '') one[i] = one[i].replace(')', '') one[i] = one[i].replace(' ', '') one[i] = one[i].replace('q', '', 1) one[i] = one[i].replace(':', '') for i in range(len(tre)): tre[i] = tre[i].replace('=', '') tre[i] = tre[i].replace(';', '') tre[i] = tre[i].replace(' ', '') tre[i] = int(tre[i]) x = {} for i in range(len(tre)): one[i] = x.setdefault(one[i], tre[i]) return x" "def main(input): d = {} input = input.replace('==>', '=').replace('=', ' ').replace('.', '').replace('\n', ' ').replace(' ', ' ').replace(' ', ' ') input = input.split() for i in range(len(input)): if '@' in input[i]: d[input[i + 1]] = input[i].replace('@', '').replace(""'"", '') return d" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('w.*?<', a) tre = re.findall('=.*?;', a) for i in range(len(one)): one[i] = one[i].replace('""', '') one[i] = one[i].replace(' ', '') one[i] = one[i].replace('w', '', 1) one[i] = one[i].replace('<', '') for i in range(len(tre)): tre[i] = tre[i].replace('==', '') tre[i] = tre[i].replace(';', '') tre[i] = tre[i].replace(' ', '') tre[i] = int(tre[i]) x = {} for i in range(len(tre)): one[i] = x.setdefault(one[i], tre[i]) return x" "import re def main(input_line): input_line = input_line.replace('\n', ' ') list_values = re.findall(""'(.*?)'"", input_line) list_keys = re.findall('\\(.*?\\)', input_line) list_keys = [x.strip('(') for x in list_keys] list_keys = [x.strip(')') for x in list_keys] list_keys = [x.strip(' ') for x in list_keys] d = dict(zip(list_values, list_keys)) res2 = [] for (k, v) in d.items(): sa = str(k) + ' ' + str(v) res2.append(sa) res = {} for s in res2: tmp = s.split() res[tmp[0]] = tmp[1:] output_dict = {} for (key, value) in res.items(): output_dict[key] = [int(item) for item in value] return output_dict" "def main(text): result = {} data = text.split(';') for str in data: if str.find('.end') == -1: result[str[str.find('@""') + 2:str.rfind('""')]] = str[str.find('local ') + 6:str.find('->') - 1] return result" "def main(x): otvet = {} x = x.replace('\n', ' ') x = x.replace('do option', '') x = x.replace('done,', '') x = x.replace('<%', '') x = x.replace('%>', '') x = x.replace(':', ' ') x = x.split(' ') arg_1 = '' arg_2 = '' for i in x: if arg_1 == '' and i != '': arg_1 = i elif arg_2 == '' and i != '': arg_2 = i if arg_1 != '' and arg_2 != '': otvet[arg_1] = arg_2 arg_1 = '' arg_2 = '' return otvet" "def main(x): if x.find('
') != -1: dict = {} end = False while end is False: name1 = x.find('(') + 1 name2 = x.find(')') name = x[name1:name2] index1 = x.find('#') + 1 index2 = x.find(';') p = int(x[index1:index2]) x = x[x.find('.') + 1:len(x)] dict[name] = p if len(x) < 15: break return dict" "def main(x): x = x.replace('|', ' ').replace(';', ' ').replace('`', ' ') x = x.replace(',', ' ').replace(':', ' ') x = x.replace('done', '').replace('do ', '') x = x.split() b = {} x1 = x[::2] x2 = x[1::2] for (i, j) in zip(x1, x2): b[i] = j return b" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('q.*?:', a) tre = re.findall('=.*?]', a) for i in range(len(one)): one[i] = one[i].replace('(', '') one[i] = one[i].replace(')', '') one[i] = one[i].replace(' ', '') one[i] = one[i].replace('q', '', 1) one[i] = one[i].replace(':', '') for i in range(len(tre)): tre[i] = tre[i].replace('=', '') tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace('[', '') tre[i] = tre[i].replace(']', '') for i in range(len(tre)): tre[i] = tre[i].split(',') for j in range(len(tre[i])): tre[i][j] = int(tre[i][j]) x = {} for i in range(len(tre)): one[i] = x.setdefault(one[i], tre[i]) return x" "def main(str): str2 = str.split('`') a = [] b = [] for i in range(1, len(str2)): a.append(str2[i].split(' ')[0].split('|')[0].split('\n')[0]) b.append(str2[i].split('""')[1].split('\n')[0]) return dict(zip(b, a))" "def main(x): a = x.split(';') dictionary = {} alphabet = [] slowar = [] for i in range(0, len(a) - 1): string = a[i] string = string.replace(' ', '') string = string.replace('\n', '') posFirstLetter1Word = string.find('equ') + 3 posLastLetter1Word = string.find('->') posFirstLetter2Word = string.find('->') + 3 posLastLetter2Word = string.find('end') - 2 slowar.append(string[posFirstLetter1Word:posLastLetter1Word:1]) alphabet.append(string[posFirstLetter2Word:posLastLetter2Word:1]) dictionary = dict(zip(alphabet, slowar)) return dictionary" "def main(x): x = x.replace('', ' ').replace('define', ' ').replace('@', ' ').replace('""', ' ').replace('=:', ' ').replace(';', ' ').replace('\n', ' ').replace('', ' ') x_parts = x.split() x_znach = [x_parts[i] for i in range(0, len(x_parts), 2)] x_tag = [x_parts[i] for i in range(1, len(x_parts), 2)] str_dict = {} for i in range(len(x_parts) // 2): str_dict.update({x_tag[i]: x_znach[i]}) return str_dict" "import re def main(x): x = re.split(' *=\\>', x) res_dict = {} min_list = [] buff_list = [] for i in range(1, len(x)): buff_list = re.split(' *\\@', x[i - 1]) for k in buff_list[1:]: min_list.append(re.split("" *\\'"", k)[1]) res_dict.setdefault(re.split(' *\\;', x[i].split()[0])[0], min_list) min_list = [] return res_dict" "def repNs(s): for i in range(len(s)): if ord(s[i]) == 10: str(s).replace(s[i], '') return s def main(s): s = repNs(s) arr1 = [] arr2 = [] quotes_id = 0 dot_id = 0 for i in range(len(s)): if s[i] == '>': for j in range(i + 1, len(s)): if s[j] == '.': dot_id = j break if s[i + 1] == ' ': arr1.append(s[i + 2:dot_id]) else: arr1.append(s[i + 1:dot_id]) if s[i] == '@': for j in range(i + 2, len(s)): if s[j] == '""': quotes_id = j break arr2.append(s[i + 2:quotes_id]) answer = {arr1[i]: arr2[i] for i in range(len(arr1))} return answer" "import re def main(x): res = re.findall(""@\\'\\w+"", x) res += re.findall('[| -]\\d+', x) z = {} for i in range(len(res) // 2): res[i] = res[i].replace('@', '') res[i] = res[i].replace(""'"", '') res[i + len(res) // 2] = res[i + len(res) // 2].replace(' ', '') res[i + len(res) // 2] = int(res[i + len(res) // 2].replace('|', '')) z[res[i]] = res[i + len(res) // 2] return z" "def main(data): return parse_data(data) def get_array_name(data): return data[data.find('""') + 1:data.rfind('""')] def get_array(data): array = data[data.find('(') + 1:data.rfind(')')] array = array.strip().replace('.', '').replace(' ', '').split('#') array = [int(num) for num in array if num] return array def parse_data(data): answer_dict = {} END = 'end' current_find_index = 0 while data.find(END, current_find_index) != -1: last_index = current_find_index current_find_index = data.find(END, current_find_index) + len(END) data_slice = data[last_index:current_find_index] answer_dict[get_array_name(data_slice)] = get_array(data_slice) return answer_dict" "def main(x): i = 0 x = x.replace(' ', '') x = x.replace('\n', '') x = x.replace('\r', '') x = x.replace('opt', '') x = x.replace('@', '') x = x.replace('(', '') x = x.replace(')', '') x = x.replace('[', '') x = x.replace(']', '') x = x.replace('<|', '') x = x.replace('.', '') x = x.replace('{', '') x = x.replace('`', '') dict = {} s = '' s1 = '' spisok = [] while i != len(x): if x[i] == '""': i = i + 1 while x[i] != '""': s = s + x[i] i = i + 1 while x[i] != '}': i = i + 1 while x[i] != ',': if x[i] == '}': break s1 = s1 + x[i] i = i + 1 spisok.append(s1) s1 = '' dict[s] = list(spisok) s = '' spisok.clear() i = i + 1 return dict" "import re def main(string): s = string.replace('\n', '') d = dict() li = [] li_flag = '' while li_flag is not None: entry = re.search('(.*?)', s).group(1).replace(' ', '') li.append(entry) s = s.split('.', 1)[1] li_flag = re.search('(.*?)', s) for i in range(len(li)): current_entry = li[i] d_flag = '' while d_flag is not None: key = re.search('(.*?)<-', current_entry).group(1) value = re.search('q\\((.*?)\\)', current_entry).group(1) d.setdefault(key, []).append(value) current_entry = current_entry.replace(value, '') current_entry = current_entry.replace('q()', '') d_flag = re.search('q\\((.*?)\\)', current_entry) return d" "def main(str): str = str.replace(' ', '') spis = str.split(':') spis = spis[1::2] spis2 = [] for x in range(len(spis)): spis2 += [spis[x].split(')')] for x in range(len(spis2)): spis2[x][0] = spis2[x][0][spis2[x][0].find('(') + 1:] spis2[x][1] = int(spis2[x][1][spis2[x][1].find('=') + 1:spis2[x][1].find(';')]) dict1 = dict(spis2) return dict1" "def main(line): line = line.split('')[1:] new_dict = dict() for elem in line: elements = list() parts = elem[elem.index('{') + 1:elem.index('}')].split(',') for el in parts: elements.append(el.strip()) title = elem[elem.index('""') + 1:elem.rfind('""')] new_dict[title] = elements return new_dict" "def main(x): z = {} a = x.replace('\n', '').split('[[')[1].split(']]')[0] b = list(filter(None, [c for c in a.split(';') if c != ' '])) d = [e.split('.')[0].split('make')[1] for e in b] f = [g.split(':=') for g in d] for (key, value) in f: z[key.split('""')[1]] = value.split('""')[1] return z" "import re def main(text): text = text.replace(' ', '').replace('\n', '') reg_1 = re.findall('{declare@(.*?)}', text) res = {} for item in reg_1: reg_2 = re.findall('->(.*)', item)[0] reg_3 = re.findall(""'(.*)'"", item)[0] res[reg_2] = reg_3 return res" "def escape(s): escapes = ''.join([chr(char) for char in range(1, 32)]) translator = str.maketrans('', '', escapes) return s.translate(translator) def main(s): s = escape(s) for i in ['{', '}', ' ']: s = s.replace(i, '') s = s.split('variable') s.pop(0) for i in range(len(s)): s[i] = s[i].split('<==') d = {} for i in s: d[i[0]] = i[1] return d" "import re def main(s): s = s.replace('\n', ' ') s = re.findall('((?<=local ).*?(?=;))', s) s = [st.split(' is ') for st in s] s = {st[0]: st[1] for st in s} return s" "import re def main(s): D = {} s = s.split('||.') for i in s: a = re.findall('(""\\w+)', i) for r in a: D[a[1][1:]] = a[0][1:] return D" "def main(x): d = {} a = x.split('{{')[1:] for i in a: (val, k) = i.split('==>') k = k.split(""'"")[1] val = val.split('[')[1].split(']')[0].replace(' ', '').split('#')[1:] val = [j.replace('#', '') for j in val] val = [int(x) for x in val] d[k] = val return d" "def main(x): x = x.replace(' ', '') x = x.replace('', '') x = x.replace('', '') d = {} while x.find('to') != -1: i = x.find('to') tempstr = '' tempkey = '' for j in x[i:]: if j == '.': break else: tempstr += j for j in x[:i]: if j == ')': break else: tempkey += j key = tempkey[tempkey.find('(') + 1:] word = tempstr[2:] new = x.find(tempstr) x = x[new + len(tempstr):] d[word] = key return d" "def main(s): i = s.find('""') d = {} while i != -1: i2 = s.find('""', i + 1) s2 = s[i + 1:i2] i3 = s.find('#', i) i4 = s.find('>', i) ch = int(s[i3 + 1:i4]) d[s2] = ch i_new = s.find('""', i2 + 1) i = i_new return d" "def main(x): otvet = {} x = x.replace('\n', ' ') x = x.replace('.', '') x = x.replace('<:', '') x = x.replace(':>', '') x = x.replace('=:', ' ') x = x.replace('((', ' ') x = x.replace('))', ' ') x = x.replace('))', ' ') x = x.replace(""'"", ' ') x = x.replace(' equ ', '') x = x.split(' ') arg_1 = '' arg_2 = '' for i in x: if arg_1 == '' and i != '': arg_1 = i elif arg_2 == '' and i != '': arg_2 = i if arg_1 != '' and arg_2 != '': otvet[arg_2] = arg_1 arg_2 = '' arg_1 = '' return otvet" "def main(s): s = s.replace('\n', '') d = {} k_1 = 0 data = '' for i in range(len(s) - 1): if s[i + 1] == '#': if k_1 == 0: k_1 = i + 1 if s[i + 2] == '-': data = int(s[k_1 + 1:i + 7]) else: data = int(s[k_1 + 1:i + 6]) if s[i] == '=': if s[i + 2] == ' ': if s[i + 2] != ' ': k_1 = i + 2 else: k_1 = i + 3 else: k_1 = i + 2 if s[i:i + 7] == '': if s[i - 1] == ' ': d.setdefault(s[k_1:i - 1], data) k_1 = 0 data = '' else: d.setdefault(s[k_1:i], data) k_1 = 0 data = '' return d" "def main(x): x = x.split('done') lib = {} for elem in x[:-1]: one = elem[elem.find('(') + 1:elem.find(')')].strip().split('\n') one = ' '.join(one).split(' ') lib[elem[elem.find('make') + 4:elem.find('::')].strip()] = list(map(int, one)) return lib" "import re def get_number_of_elements(list): count = 0 for element in list: count += 1 return count def main(data): res = re.sub('[<|%|(|)|=|>|;|\n|/]', ' ', data) res = re.split(' ', res) val = 'q' while val in res: res.remove(val) val = '' while val in res: res.remove(val) val = 'glob' while val in res: res.remove(val) n = get_number_of_elements(res) / 2 d = {} i = 0 while n: k = res[i + 1] d[k] = res[i] i += 2 n -= 1 return d" "import re def get_number_of_elements(list): count = 0 for element in list: if element == '.': count += 1 return count def main(data): res = re.sub('[<|%|(|)|=|>|;|\n|/|,]', ' ', data) res = re.split(' ', res) val = 'var' while val in res: res.remove(val) val = 'begin' while val in res: res.remove(val) val = 'array' while val in res: res.remove(val) val = 'do' while val in res: res.remove(val) val = 'done' while val in res: res.remove(val) val = 'end' while val in res: res.remove(val) val = '' while val in res: res.remove(val) n = get_number_of_elements(res) d = {} i = 0 counter = 1 mas = [] while n: k = res[i] while res[counter] != '.': mas.append(res[counter]) counter += 1 d[k] = mas mas = [] i = counter + 1 counter += 2 n -= 1 return d" "def main(sen): result = dict() for i in range(0, len(sen)): if (sen[i] == 'l') & (sen[i:i + 4] == 'let ' or sen[i:i + 4] == 'let\n'): cnt = i + 4 while sen[cnt] != '=': cnt += 1 word = sen[i + 3:cnt].strip() i = cnt + 3 cnt = i while sen[cnt] != '.': cnt += 1 key = sen[i:cnt].strip() i = cnt result[key] = word return result" "import re def main(string): key = re.findall('define *\\n*\\w*', string) code = re.findall('# *-*\\n*\\w*', string) for i in range(len(key)): key[i] = key[i].replace(':', '') key[i] = key[i].replace(' ', '') key[i] = key[i].replace('define', '') key[i] = key[i].replace('\n', '') code[i] = code[i].replace('#', '') code[i] = code[i].replace('\n', '') code[i] = code[i].replace(' ', '') d = {key[i]: int(code[i]) for i in range(len(key))} return d" "import re def main(string): key = re.findall('data *\\n*\\w*', string) code = re.findall('\\( *\\n*\\w*', string) for i in range(len(key)): key[i] = key[i].replace('data', '') key[i] = key[i].replace(' ', '') key[i] = key[i].replace('\n', '') code[i] = code[i].replace('(', '') code[i] = code[i].replace('\n', '') code[i] = code[i].replace(' ', '') d = {code[i]: key[i] for i in range(len(key))} return d" "import re def main(str): parsed = re.findall(""(equ\\s*\\#(\\-*\\d*)\\s*to\\s*\\'([^\\']*))"", str) result = {} for i in parsed: result[i[2]] = int(i[1]) return result" "def main(x): result = {} text = x.replace(' ', '') text = text.replace('\n', '').split('#') for i in range(1, len(text)): n = text[i].split('|>') znach = n[0] key = n[1].split('.')[0] result[key] = int(znach) return result" "def main(string): dict_ = {} string = string.replace('\n', ' ', 1) while string.find('`') != -1: i = string.find('`') string = string.replace('`', '', 1) j = string.find('<') t1 = 0 k = 0 if string[j - 1] != ' ': j += 1 t1 -= 2 t1 += 1 if string[j + 1] == ' ': t1 += 1 string = string.replace('<-', '', 1) k = string.find('}}') string = string.replace('}}', '', 1) dict_[string[i:j - 1]] = int(string[j + t1:k]) return dict_" "import re pattern = '<<.?decl.?#(.*?).?to.?@""(.*?)""\\..?>>' def main(str): matches = re.findall(pattern, str, flags=re.DOTALL) dict = {} for c in matches: key = c[1] value = int(c[0]) dict[key] = value return dict" "def main(input_str): input_list = input_str.split(';') output_str = {} for i in input_list[:len(input_list) - 1]: i = i.replace('|>', ' ') i = i.replace('|', ' ') i = i.replace('', ' ') i = i.replace('', ' ') i = i.replace('auto', ' ') i = i.replace('\n', ' ') i = i.split(' ') while '' in i: i.remove('') key = i[1] output_str[key] = i[0] return output_str" "def main(text): text = text.replace('{ ', '{') text = text.replace(' }', '}') text = text.replace('} {', '}{') dictWords = {} while True: try: startB = text.index('{') + 1 endB = text.index('}') subS = text[startB:endB] valL = subS.find('val') + 4 valR = subS.find('to') - 1 val = subS[valL:valR] toL = subS.find('to') + 3 toR = subS.find(';') to = subS[toL:toR] dictWords[to] = val text = text[endB + 1:] except ValueError: break return dictWords" "import re def main(x): x = x.replace('\n', ' ') x = re.findall('#(-?\\d+) -> ?(\\w+)', x) return {a: int(b) for (b, a) in x}" "import re def parse_keys(x): keys = '\\w+' return re.findall(keys, x) def parse(x): result = {} p = re.findall('\\([\\s]*\\w+[\\s;]*\\w+[\\s;]*\\w+[\\s;]*\\w+', x) s = re.findall('`\\w+', x) keys = parse_keys(''.join((str(e) for e in s))) for i in range(len(keys)): result[keys[i]] = parse_keys(p[i]) return result def main(x): return parse(x)" "def main(s): my_dict = {} while True: a = s.find('equ', 0, len(s)) if a == -1: break s = s[a:len(s)] b = s.find(""'"", 0, len(s)) s = s[b + 1:len(s)] c = s.find(""'"", 0, len(s)) key = s[0:c] d = s.find(':=', 0, len(s)) s = s[d + 2:len(s)] e = s.find('.', 0, len(s)) if s[0].isspace(): value = s[1:e] else: value = s[0:e] my_dict[key] = value s = s[e + 1:len(s)] f = s.find('.', 0, len(s)) return my_dict" "def main(x): cp_keys = [] cp_values = [] for i in range(1, len(x.split(""'"")), 2): cp_keys.append(x.split(""'"")[i]) cp_values.append(x.split(""'"")[i - 1].split('#')[1].split('=')[0]) dict = {} for i in range(len(cp_keys)): dict[cp_keys[i]] = int(cp_values[i]) return dict" "def main(str): dict = {} str = str[2:] str = str[:-2] while True: r = str.find('}}') str2 = str[:r + 2] i = str2.find('data') if ' = ' in str2: p = str2.find(' = ') key = str2[i + 5:p] elif '= ' in str2: p = str2.find('= ') key = str2[i + 5:p] elif ' =' in str2: p = str2.find(' =') key = str2[i + 5:p] elif '=' in str2: p = str2.find('=') key = str2[i + 5:p] a = str2.find('@') t = str2.find('.') value = str2[a + 2:t - 1] dict.setdefault(key, value) str = str[t + 5:] if str == '': break return dict" "def main(stroka): stroka = stroka.split('\n') stroka = ' '.join(stroka) result = {} kuski = stroka.split(');') for kusok in kuski: if 'store' in kusok: space = kusok.index('store') + 6 kusok = kusok[space:] space = kusok.index(' ') slovo = kusok[:space] kusok = kusok[space + 1:] skobka = kusok.index('(') kusok = kusok[skobka + 1:] chasti = kusok.split() spisok = [] for chast in chasti: try: spisok.append(int(chast)) except ValueError: pass result[slovo] = spisok return result" "import re def main(x): regex_keys = re.compile(""'([a-zA-Z0-9_]*)_?[0-9]*?'"") regex_values = re.compile('[a-zA-Z0-9_]+[ ]*;[ ]*od') x = x.replace('\n', '') keys = regex_keys.findall(x) values = regex_values.findall(x) for i in range(len(keys)): keys[i] = keys[i].replace(""'"", '') for i in range(len(values)): values[i] = values[i].split(';')[0] result_dict = dict(zip(keys, values)) return result_dict" "import re def main(x): regex_keys = re.compile(""'([a-zA-Z0-9_]*)_?[0-9]*?'"") regex_values = re.compile('[a-zA-Z0-9_]+_?[0-9]*?[.]') x = x.replace('\n', ' ') keys = regex_keys.findall(x) values = regex_values.findall(x) for i in range(len(keys)): keys[i] = keys[i].replace(""'"", '') for i in range(len(values)): values[i] = values[i].replace('.', '') result_dict = dict(zip(keys, values)) return result_dict" "import re def main(text): data = text.split('.end;') data.pop(len(data) - 1) output_dict = {} for elem in data: properties = elem.split('->') key = re.search('\\"".*\\""', properties[1]) key = key.group(0).replace('""', '') value = re.search(""\\@\\'.*\\'"", properties[0]) value = value.group(0).replace(""'"", '').replace('@', '') output_dict[key] = value return output_dict" "def proverka(string): if string.find('l') == -1: return False else: return True def main(string): dictionary = {} while proverka(string): start = string.find('l') + 2 end = string.find(':') name = string[start:end] name = name.replace(' ', '') newStart = string.find(':') + 1 newEnd = string.find('. ') digit = int(string[newStart:newEnd]) dictionary[name] = digit string = string[1:] string = string[string.find('.do'):] return dictionary" "import re def main(text): data = text.replace('\n', ' ') data = data.split('od') data.pop(len(data) - 1) output_dict = {} for elem in data: properties = elem.split('list') key = re.search('define .*', properties[0]) key = key.group(0).replace(' ', '').replace('define', '') values = re.findall('\\#.\\d*', properties[1]) for i in range(len(values)): values[i] = str(values[i]).replace('#', '') values[i] = int(values[i]) output_dict[key] = values return output_dict" "def main(html_code): html_code = html_code.replace('(', '').replace(')', '').replace('<', '').replace('>', '').replace('/', '').replace('\\n', '').replace('\n', '').replace(';', '') array = html_code.split('section') for item in array: if item == '': array.remove('') elif item == ' ': array.remove(' ') new_list = list() for item in array: new_list.append(item.replace('local', '').replace(' ', '').replace('""', '').replace('@', '')) dic = dict() for item in new_list: key_value = item.split('=') dic[key_value[1]] = key_value[0] return dic" "def main(s): s = s.replace('/', '') s = s.replace('\nstore', '') s = s.replace('', '') s = s.replace('<<', '') s = s.replace('>>', '') s = s.replace('store', '') s = s.replace('=', '') s = s.replace(';', '') s = s.replace('; ', '\n') s = s.replace('.', '') s = s.replace('#', ' ') s = s.replace(':', '') tokens = s.split() d = {} for i in range(0, len(tokens), 2): d[tokens[i]] = int(tokens[i + 1]) return d" "def main(inpStr): a = [1, 2] inpStr = inpStr.replace('\n', '') strArray = inpStr.split(',') del strArray[len(strArray) - 1] b = [] i = 0 for temp in strArray: temp = temp.replace(':>', '') temp = temp.replace(' ', '') b.append([temp.split('`')[1], temp.split(""'"")[1]]) b2 = dict(b) return b2" "def main(s): s1 = s.split(""'"") d1 = dict() keys = list() for i in range(1, len(s1), 2): keys.append(s1[i]) s2 = list() for i in range(2, len(s1), 2): s2.append(s1[i]) s3 = list() for i in range(0, len(s2)): s3.append(s2[i].split()) values = list() for i in s3: values.append(i[1]) for i in range(0, len(values)): d1[keys[i]] = values[i] return d1" "from pprint import pprint def main(text): text = text.replace('\n', '') text = text.replace(' ', '') text = text.split('loc') result = {} for i in range(len(text)): text[i] = text[i].split('<|') if len(text[i]) != 1: text[i][1] = text[i][1].replace('{', '') text[i][1] = text[i][1].replace(""@'"", '') text[i][1] = text[i][1].replace(""'"", '') text[i][1] = text[i][1].replace('}', '') text[i][1] = text[i][1].replace('.', '') text[i][1] = text[i][1].split(',') text = text[1:] result = {text[i][0]: text[i][1] for i in range(len(text))} return result" "def main(x): x_parts = x.strip()[3:-4].strip().replace(' ', '').replace('\n', '').replace('.}', '}').split('.')[:-1] result = dict() for block in x_parts: block_parts = block.replace('declare@', '')[1:-1].split('<|') result[block_parts[0][1:-1]] = block_parts[1] return result" "def main(str): dict = {} num_array = [] for i in range(len(str) - 1): if str[i] == '#': num = '' i += 1 while str[i] != ' ' and str[i] != ';' and (str[i] != ')'): num += str[i] i += 1 num_array.append(int(num)) if str[i] == '|' and str[i + 1] == '>': i += 2 word = '' while str[i] != '.': word += str[i] i += 1 dict[word.strip()] = num_array num_array = [] return dict" "def main(s): s = s.replace('<:', '') s = s.replace(':>', '') s = s.replace('{{', '') s = s.replace('}}', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace('make', '') s = s.replace('array', '') s = s.replace('==>', '') s = s.replace('#', ' ') s = s.replace('}} ', '') s = s.replace('\n ', ' ') s = s.replace('.', '') s = s.replace('@', ' ') s = s.replace(""'"", '') tokens = s.split() d = {} k = 0 count = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] for i in range(0, len(tokens)): try: float(tokens[i]) count[i] = 0 except ValueError: count[i] = 1 po = [] for i in range(0, len(tokens)): if count[i] == 1: d[tokens[i]] = [] po.append(tokens[i]) tokens[i] = 0 k += 1 i = 0 for j in range(0, k): rt = [] while int(tokens[i]) < 0 or int(tokens[i]) > 0: rt.append(int(tokens[i])) i += 1 i += 1 d[po[j]] = rt return d" "def main(x): x_parts = x.strip()[2:-2].strip().replace('glob', '').strip().replace('#', '').replace('\n', '').replace(' ', '').replace('""', '').split('.')[:-1] result = dict() for block in x_parts: block_parts = block.strip().split(':') result[block_parts[0]] = int(block_parts[1]) return result" "def main(text): diction = {} text = text.replace(' ', '') text = text.replace('\n', '') mass = text.split(';') for i in mass: if not i == '%>': diction[i[i.find('variable') + 8:i.find('::=')]] = i[i.find('::=') + 4:i.find('""}}')] return diction" "def main(x): x_parts = x.strip()[2:-7].strip().replace('\n', '').replace('array', '').replace('.end', '').replace(' ', '').replace('.dodefine', '').replace('<-', ' ').replace(',', ' , ').replace('(`', '').replace(';`', ' ').replace(')', '').replace('.', '') result = dict() x_parts = x_parts.split() for i in range(len(x_parts)): if i == 0 or x_parts[i - 1] == ',': result[x_parts[i]] = [] key = x_parts[i] elif x_parts[i] != ',': result[key].append(x_parts[i]) return result" "def main(x): x_parts = x.strip()[1:-1].replace(' ', '').replace('.end.do', ' ').replace('.do', '').replace('.end', '').replace(""'"", '').replace('\n', '').split(' ') result = dict() for block in x_parts: block_parts = block.replace('variable@', '').replace('.', '').split(':=') result[block_parts[0][0:-1]] = block_parts[1] return result" "def main(x): x = x.replace('\\begin', '').replace('\\end', '') x = x.replace(' ', '').replace('\n', '').replace('\t', '') blocks = x.split(';,')[:-1] result = dict() for block in blocks: key_value = block.split('<==#') result[key_value[0][4:-1]] = int(key_value[1]) return result" "def main(string: str) -> dict[str, list[str]]: result = dict() string = string.replace('\n', '').replace('\t', '').replace('@', '').replace(' ', '') string = string.replace('data', '').replace('list', '') string = string.replace('(', '').replace(')', '') string = string.replace('""', '') data_list = string.split(';') for elem in data_list: if elem: elem_list = elem.split('=>') result[elem_list[1]] = elem_list[0].split('.') return result" "def main(x): x = x.replace(' ', '').replace('\n', '').replace('|', '').replace('loc', '').replace('\t', '') x_blocks = x.split('.')[:-1] mapka = {} for block in x_blocks: args = block.split('>') mapka[args[1]] = args[0] return mapka" "def main(x): ti = 0 str1 = x.replace(' ', '') str1 = str1.replace('\n', '') data = [] for i in range(len(str1)): if str1[i:i + 9] == 'optarray(': ti = i + 10 while str1[ti] != ')': ti += 1 tarr = str1[i + 9:ti].split(';') for el in range(len(tarr)): tarr[el] = int(tarr[el]) ti += 4 ti2 = ti while str1[ti2] != ""'"": ti2 += 1 tkey = str1[ti:ti2] tdata = [tkey, tarr] data.append(tdata) d = {data[i][0]: data[i][1] for i in range(len(data))} return d" "def main(x): x = x.replace('[[', '').replace(']]', '').replace('do let', '') x = x.replace(' ', '').replace('\n', '').replace('\t', '') x = x.replace('""', ""'"").replace(""'is'"", ""' is '"") x = x.replace(""'"", '') blocks = x.split('end;')[:-1] res = dict() for block in blocks: key_value = block.split(' is ') res[key_value[0]] = key_value[1] return res" "import re def main(inputText): outputDict = {} words = re.split(' |\\.|;|\\[|\\]|\\(|\\)|=|#|\\n', inputText) while '' in words: words.remove('') while len(words) >= 1: if words[0] == 'do': words.pop(0) elif words[0] == 'done': words.pop(0) elif words[0] == 'variable': words.pop(0) tempKeyName = words[0] outputDict[words[0]] = [] words.pop(0) while len(words) >= 1: if words[0] == 'done' or words[0] == 'variable': break else: outputDict[tempKeyName].append(int(words[0])) words.pop(0) else: words.pop(0) return outputDict" "def main(x): x = x.replace('.begin', '').replace('.end', '').replace(' ', '') x = x.replace('done', '').replace('do', '').replace('\n', '') x = x.replace('""', '').replace('glob', '').replace('\\', '') blocks = x.split(',')[:-1] result = dict() for block in blocks: key_value = block.split('<-#') result[key_value[0]] = int(key_value[1]) return result" "def main(x): x = x.replace(' ', '').replace('do(', '').replace('opt', '').replace('q(', '').replace(')', '').replace('(', '').replace('.', '').replace('\n', '').replace('end', '') blocks = x.split(';')[:-1] result = dict() for block in blocks: key_value = block.split('==>') result[key_value[1]] = key_value[0] return result" "def main(x): x = x.replace(';', ',').replace('\n', '') x = x.replace('.do', '').replace('new', '') x = x.replace('((', '').replace('))', '') x = x.replace(' ', '') x = x.replace('[', '') x = x.replace(']', '') blocks = x.split('.end.')[0:-1] result = dict() for block in blocks: key_value = block.split('|>') a = key_value[0].split(',') b = [] for i in a: if i[0] == '-': i = int(i[1:]) i *= -1 else: i = int(i) b.append(i) result[key_value[1]] = b return result" "def main(x): jump = 0 di = {} al = [] sl = [] a = x.split('|') a = a[1::2] for i in range(0, len(a)): string = a[i] string = string.replace(' ', '') string = string.replace('\n', '') pos1 = string.find('list') pos2 = string.find(').') al.append(string[0:pos1]) sl.append(string[pos1 + 5:pos2].split(""'"")[1::2]) di = dict(zip(al, sl)) return di" "import re def main(str): keys = re.findall('\\([\\s]\\w*|\\(\\w*', str) values = re.findall('\\=\\S*\\.|\\=\\s\\S*\\.', str) for i in range(len(keys)): keys[i] = re.sub('\\(|[( ]', '', keys[i]) keys[i] = re.sub('\\W', '', keys[i]) values[i] = re.sub('\\=|[= ]', '', values[i]) values[i] = re.sub('\\.', '', values[i]) values[i] = re.sub('\\W', '', values[i]) return dict(zip(keys, values))" "def main(stroka): stroka = stroka.split('\n') stroka = ' '.join(stroka) result = {} kuski = stroka.split('.end') for kusok in kuski: if '->' in kusok: kovichka = kusok.index('""') kusok = kusok[kovichka + 1:] kovichka = kusok.index('""') znachenie = kusok[:kovichka] kusok = kusok[kovichka + 1:] kusok = kusok.split(' ') kusok = ''.join(kusok) strelka = kusok.index('->') slovo = kusok[strelka + 2:] result[slovo] = znachenie return result" "def pass_string_segment(s, index, segment): while not s[index:index + len(segment)] == segment: index += 1 return index + len(segment) def create_number(s, numbers, index): index += 1 number = '' is_positive = True while s[index] == '-' or s[index].isnumeric(): if s[index] == '-': is_positive = False else: number += s[index] index += 1 numbers.append(int(number) * (1 if is_positive else -1)) return index def create_pair(s, result, index): name = '' numbers = [] index = pass_string_segment(s, index, '') index = pass_string_segment(s, index, 'opt') index = pass_string_segment(s, index, '[') while s[index] != ']': if s[index] == '#': index = create_number(s, numbers, index) else: index += 1 index = pass_string_segment(s, index, '=>') index = pass_string_segment(s, index, 'q(') while s[index] != ')': name += s[index] index += 1 index += 1 result[name] = numbers index = pass_string_segment(s, index, '.') return index def main(s): result = dict() index = 0 index = pass_string_segment(s, index, 'do') while True: if not s[index].isspace(): if s[index:index + 3] == 'end': return result index = create_pair(s, result, index) else: index += 1 main('do opt[ #4032 . #1985 ] =>q(leor_3) . \nopt[#-3487 . #2590 .#-4114 ] =>q(eronra_350) . opt [\n#8522 . #4465 .#4011] =>q(erri_62) . opt [ #-5249 .\n#-8476 . #5414 . #8585] =>q(inqu_639) . end') main('do opt [ #-8466 . #8061 ]=> q(zale_173) . opt\n[#-7572 . #9246 . #-9412 . #9736 ] => q(edmaed) . opt\n[#-1594 . #-9312 .#4993 .#-5984 ] => q(resoar_188) .\nopt[ #-2735 .#4999 ] => q(ceteon) . end')" "def main(x): mas = {} for i in range(len(x)): word_1 = '' word_2 = '' if x[i] == 'd' and x[i + 1] == 'e' and (x[i + 2] == 'f'): (word_1, word_2) = function(x, i) mas[word_1] = word_2 mas.pop('', 80) return mas def function(x, i): (k, word_1) = word1(x, i) word_2 = word2(x, i, k) return (word_1, word_2) def word1(x, i): k = 0 word_1 = '' while x[i + 4 + k] != 'i' or x[i + 5 + k] != 's' or x[i + 7 + k] != '`': k += 1 for p in range(k - 1): word_1 += x[i + 4 + p] return (k, word_1) def word2(x, i, k): j = 0 word_2 = '' while x[i + 8 + k + j] != '<': j += 1 if x[i + 8 + k + j - 1] == ' ': for p in range(j - 1): word_2 += x[i + 8 + k + p] elif x[i + 8 + k + j - 1] == '\n': for p in range(j - 1): word_2 += x[i + 8 + k + p] else: for p in range(j): word_2 += x[i + 8 + k + p] return word_2" "import re def main(s): pattern1 = re.findall('\\W\\d{1,4}', s) temp = ' '.join(pattern1) pattern1 = re.findall('\\S\\d{1,4}', temp) pattern2 = re.findall('>([.\\s\\w]\\w+[.\\s\\w])<', s) temp = ' '.join(pattern2) pattern2 = re.findall('\\w+', temp) d = dict() length = len(pattern1) for i in range(0, length): d[pattern2[i]] = int(pattern1[i]) return d" "import re def main(x): x = x.replace('\n', ' ') re_key = re.compile('[> ]+[A-Za-z0-9_]+[ <]+') re_value = re.compile('#[-0-9]*') keys = re_key.findall(x) values = re_value.findall(x) for i in range(len(keys)): keys[i] = keys[i].replace('>', '') keys[i] = keys[i].replace('<', '') keys[i] = keys[i].replace(' ', '') for i in range(len(values)): values[i] = values[i].replace('#', '') values[i] = values[i].replace(';', '') bibasina = dict(zip(keys, list(map(int, values)))) return bibasina" "def main(str): str = str[3:-3].replace(' ', '').replace('', '').replace('', '').replace('\n', '') map = {} while str.find('auto') != -1: key1 = str.find('auto') + 3 key2 = str.find('<') key = str[key1 + 1:key2] bon = str.find('auto') str = str[bon + 4:] val1 = str.find('(') val2 = str.find(')') val = str[val1 + 1:val2] val = val.replace(""'"", ' ').replace(u'‘', ' ').replace(u'’', ' ') valarr = [] val = val[:] + ' ' while 1: if val == '': break val = val[1:] val2 = val.find(' ') valarr.append(val[0:val2]) val = val[val2 + 1:] map[key] = valarr[:-1] str1 = str.find('auto') str = str[str1:] return map" "def main(s): dict = {} while s.find('l') != -1: left = s.find('l') + 2 right = s.find('#') name = s[left:right] name = name.replace(' ', '') name = name.replace('\n', '') newLeft = s.find('#') + 1 newRight = s.find('. ') value = int(s[newLeft:newRight]) dict[name] = value s = s[1:] s = s[s.find('decl'):] return dict" "import re def main(s, r=re.findall): a = [*map(lambda s: r('\\w+', s), r('\\w+\\s*->\\s*\\w+', s))] return {i[1]: i[0] for i in a}" "def main(a): braces = [-1, -1] checks = [-1, -1] stringline = [] for i in range(len(a)): if a[i] == '""': if braces[0] == -1: braces[0] = i + 1 else: braces[1] = i elif a[i] == '=': checks[0] = i + 1 elif a[i] == ']': checks[1] = i stringline.append(a[braces[0]:braces[1]]) stringline.append(int(a[checks[0]:checks[1]])) braces = [-1, -1] checks = [-1, -1] b = {} for i in range(len(stringline) // 2): b[stringline[i * 2]] = int(stringline[i * 2 + 1]) return b" "def main(x): C = '{' if x[len(x) - 3] == '.': A = x[3:len(x) - 2] + ' ' elif x[len(x) - 4] == '.': A = x[3:len(x) - 3] + ' ' i = 0 slovar = {} while A != '': Number = checknum(A) end = checkdog(A) B = A[end + 1:len(A)] A = B Slov = checkslov(A) slovar[Slov] = int(Number) Slov = '' Number = '' B = A[checkd(A) + 2:len(A)] A = B Game = C[0:len(C) - 2] + '}' return slovar def checkd(A): d = 0 while A[d] != '.': d += 1 return d def checkslov(A): start = 0 end = 0 while A[end] != ""'"": end += 1 start = end + 1 end += 1 while A[end] != ""'"": end += 1 Slov = A[start:end] return Slov def checknum(A): start = 0 end = 0 while A[end] != ' ' and A[end] != '\n': end += 1 start = end end += 1 while A[end] != ' ' and A[end] != '|' and (len(A) > 2): end += 1 Number = A[start + 1:end] return Number def checkdog(A): end = 0 while A[end] != '@': end += 1 return end" "def main(s): s = s.replace(' ', '') s = s.replace('\n', '') dict = {} while s.find('') != -1: left = s.find('#(') + 2 right = s.find(')') value = s[left:right] values = value.split('.') newLeft = s.find('=:') + 3 newRight = s.find('.') + 9:arg.find('
')] arg = arg.replace(';.end,.beginvar', '\x00') arg = arg.replace('.beginvar', '').replace(';.end,', '') arg = arg.replace('""', '').replace(']', '') param1 = arg.split('\x00') for i in range(len(param1)): param1[i] = param1[i].strip() param2 = [] for i in param1: param2.append(i.split('[')) param2[len(param2) - 1][0] = param2[len(param2) - 1][0][0:].strip() param2[len(param2) - 1][1] = param2[len(param2) - 1][1].split(';') res = {} for s in param2: res[s[0]] = s[1] return res" "def main(data): data = data.replace(' ', '') data = data.replace('\n', '') data = data[data.index('') + 7:data.rindex('') - 1] sections = data.split(',') result = {} for sect in sections: kw = sect[sect.index(""'"") + 1:sect.rindex(""'"")] val = int(sect[sect.index('<=') + 2:sect.rindex(':>')]) result[kw] = val return result" "def main(s): s = s.replace('(', '') s = s.replace(')', '') s = s.replace('[', '') s = s.replace('variable', '') s = s.replace(' ', '') s = s.replace('<=', ':') s = s.replace('.', '') s = s.replace(']', '') s = s.replace('\n', '') s = s.split(',') s = s[:len(s) - 1] a = len(s) for i in range(0, a): s[i] = s[i].split(':') name = {} for i in range(0, a): name[s[i][0]] = s[i][1] return name" "def main(s: str): res = {} s = s.replace('\n', '') s = s.replace(' ', '') s = s.replace('""', '') s = s.replace('[def', '') s = s.replace(']', '') for el in s.split('][def'): (key, value) = el.split(':@') res[key] = value return res" "def main(s): result = {} j = 0 while '""' in s: val = '' num = '' i = s.find('""') + 1 while s[i] != '""': val += str(s[i]) i += 1 while s[i] == ' ': s = s[:i - 1] + s[i + 1:] i += 1 i += 1 while s[i] != ';': num += s[i] i += 1 result[val] = int(num) s = s[i:] return result" "import re def main(str): d1 = dict() while len(str) > 0: res = re.search('\\""\\w+\\""', str) res1 = res.group(0) res1 = res1[1:len(res1) - 1] str = str[res.end():] res = re.search('\\#[-]*\\d+\\.', str) res2 = res.group(0) res2 = res2[1:len(res2) - 1] str = str[res.end():] d1[res1] = int(res2) s1 = re.search(""\\'\\w+\\'"", str) s2 = re.search('\\#[-]*\\d+\\.', str) if s1 or s2 is None: break return d1" "import re def main(x): res = {} op1 = re.findall('make[\n, ]?[0-9a-zA-Z,_]+[\n, ]?<==', x) op2 = re.findall('=[ ]?[^]]+[ ]?}', x) for i in range(0, len(op2)): y = re.findall('[\n, ][0-9a-zA-Z,_]+[^ ]', op1[i]) z = re.findall('[0-9a-zA-Z,_]+', y[0]) res[z[0]] = re.findall('[0-9a-zA-Z,_]+', op2[i]) return res" "def main(s): d = {} state = 0 k = '' v = '' for i in s: match state: case 0: if i == '@': state = 1 case 1: if i == '""': state = 2 case 2: if i == '""': state = 3 else: k += i case 3: if i == '""': state = 4 case 4: if i == '""': d[k] = v k = '' v = '' state = 0 else: v += i return d" "def main(x): iterables = ['\\n', '\n', '\\', 'begin', 'do', 'auto', 'end', ""'"", '""', '=', '>'] for iterable in iterables: x = x.replace(iterable, '') while ' ' in x: x = x.replace(' ', ' ') x = x.strip() temp = [] while x != '': index = x.find(';', x.find('@')) temp.append(x[0:index].replace('@', ' ')) x = x[index + 2:] dict_temp = dict() for item in temp: while ' ' in item: item = item.replace(' ', '') item = item.replace('{', '').split('}') if item[-1] == 'iri': item[-1] = 'endiri' dict_temp[item[-1]] = item[0].split(';') return dict_temp" "import re def f8(str): regex = '\\|\\|\\s*var\\s*q\\(([a-zA-Z0-9_-]+)\\)\\s*<-\\s*#(-?[0-9]+);\\s*\\|\\|;' needed = re.findall(regex, str) result_dict = {} for match in needed: result_dict[match[0]] = int(match[1]) return result_dict def main(n): return f8(n)" "def main(s): words = s.split() buff = [] dictionary = {} for word in words: z = word.find('`') if z > -1: if word.find(')') > -1: buff.append(word[z + 1:word.find(')')]) else: buff.append(word[z + 1:]) elif word[-1] == '.' and len(word) > 1: dictionary[word[:-1]] = buff buff = [] return dictionary" "import re def main(inp): regex_num = re.findall('\\w+\\s?<=\\s?[-]?\\d+', inp) d = {} for item in regex_num: name = re.search('\\w+', item)[0].replace('""', '') num = int(re.findall('[-]?\\d+', item)[-1]) d[name] = num return d" "import re def main(s): pattern = 'define[\\w\\s\\\\n:#-]*;' pattern = 'glob[\\w\\s\\\\n<|-]*.' res = re.findall(pattern, s) bb = [] for i in res: cc = [] pat1 = '\\s[\\w]*[\\s:]?' res1 = re.search(pat1, i) strp = res1.group(0).split() strp = strp[0].split(':') cc.append(strp[0]) pat2 = '[<][|][\\s]{0,1}[-\\w]*.' res2 = re.search(pat2, i) if res2.group(0)[-6] == '-': stri = res2.group(0)[-6:-1] else: stri = res2.group(0)[-5:-1] cc.append(stri) bb.append(cc) d = {} for i in range(len(bb)): d[bb[i][0]] = int(bb[i][1]) return d" "def main(str): count = str.count('#') mydict = {} substr = str countN = substr.count('\n') for i in range(countN): k = substr.index('\n') substr = substr[:k] + ' ' + substr[k + 1:] for i in range(count): a1 = substr.index('>') + 1 a2 = substr.index('end;') - 1 if substr[a1] == ' ': a1 = a1 + 1 if substr[a2 - 1] == ' ': a2 = a2 - 1 name = substr[a1:a2] mydict[name] = [] a3 = substr.index('(') + 1 a4 = substr.index(')') if substr[a3] == ' ': a3 = a3 + 1 if substr[a4 - 1] == ' ': a4 = a4 - 1 elements = substr[a3:a4] myList = [] countSpaces = elements.count(' ') for i in range(countSpaces): a5 = elements.index(' ') myList.append(elements[:a5]) a5 = a5 + 1 elements = elements[a5:] myList.append(elements) mydict[name] = myList a2 = a2 + 3 substr = substr[a2:] return mydict" "def main(s): array = s.replace('\n', '').replace(' ', '').split('make') result = {} for elem in array: try: split = elem.replace('
', '').replace('
', '').split('=') result[split[0]] = int(split[1]) except Exception as e: pass return result" "def main(x): x = x.replace('|', ' ') x = x.replace('<', ' ') x = x.replace(':', ' ') x = x.replace('->', ' ') x = x.replace('>', ' ') x = x.replace(';', ' ') x = x.replace('.', ' ') x = x.replace('make', ' ') x = x.replace('\n', ' ') x = x.split(' ') r_item = '' while r_item in x: x.remove(r_item) myDict = {x[i]: int(x[i - 1]) for i in range(1, len(x), 2)} return myDict" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('declare.*?<=', a) tre = re.findall('=.*?,', a) for i in range(len(one)): one[i] = one[i].replace('declare ', '') one[i] = one[i].replace('<', '') one[i] = one[i].replace('=', '') one[i] = one[i].replace(' ', '') for i in range(len(tre)): tre[i] = tre[i].replace('{', '') tre[i] = tre[i].replace('=', '') tre[i] = tre[i].replace('};', '') tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace(',', '') tre[i] = tre[i].replace(')', '') tre[i] = tre[i].replace(';', ' ') tre[i] = tre[i].split(' ') for j in range(len(tre[i])): tre[i][j] = int(tre[i][j]) x = {} for i in range(len(one)): one[i] = x.setdefault(one[i], tre[i]) return x" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('#.*?;', a) tre = re.findall('#.*?>', a) for i in range(len(one)): one[i] = one[i].replace(' ', '') one[i] = one[i].replace('|>', ' ') one[i] = one[i].replace(';', '') one[i] = one[i].replace('auto', '') one[i] = one[i].replace('#', '') one[i] = one[i].replace('-', '') one[i] = one[i].split(' ') for i in range(len(tre)): tre[i] = tre[i].replace('#', '') tre[i] = tre[i].replace('|>', '') tre[i] = tre[i].replace(' ', '') tre[i] = int(tre[i]) x = {} for i in range(len(one)): one[i] = x.setdefault(one[i][1], tre[i]) return x" "def main(data): data = data.replace('\n', ' ') data = data.replace('', '') data = data.replace('', '') data = data.replace('<:', '') data = data.strip() data = data.rstrip(':>') data = data.split(':>') dict = {} for line in data: (key, values) = line.split('array') key = key.replace('loc', '') key = key.replace(':', '') key = key.strip() values = values.replace('(', '') values = values.replace(')', '') values = values.replace('#', '') work = list() for x in values.split(';'): work.append(int(x)) dict[key] = work return dict" "def main(s): result = {} arr = s.replace('', '').replace('', '').replace('variable', '').replace(' ', '').replace('\n', '').split(';') for elem in arr: if len(elem) > 0: res = elem.replace('""', '').replace('`', '').split('to') result[res[1]] = res[0] return result" "def main(s): result = {} arr = s.replace('|', '').replace('\n', ' ').replace(',', '').replace('""', '').replace(""'"", '').replace('loc', '').split(';') for elem in arr: if len(elem) > 2: res = elem.replace('[', '').replace(']', '').split('=:') arr1 = res[0].split(' ') sub_list = [] for e in arr1: if len(e) > 0: sub_list.append(int(e)) result[res[1].replace(' ', '')] = sub_list return result" "def main(input_string): answer = {} while True: point_index = input_string.find('.') if point_index < 0: break working_string = input_string[:point_index] input_string = input_string[point_index + 1:] left_bracket = working_string.find('[') working_string = working_string[left_bracket + 1:] value_for_key = [] isValueFull = False while not isValueFull: separator_index = working_string.find(',') if separator_index < 0: separator_index = working_string.find(']') isValueFull = True part_of_value = working_string[:separator_index] working_string = working_string[separator_index + 1:] value_for_key.append(part_of_value.strip()) to_index = working_string.find('to') working_string = working_string[to_index + 3:] angle_bracket = working_string.find('<') key = working_string[:angle_bracket] answer[key.strip()] = value_for_key return answer" "from re import split, match def main(packed): packed = ''.join(map(lambda ch: ' ' + ch if ch == ')' else ch, packed)) packed = ''.join(map(lambda ch: ch + ' ' if ch == '(' else ch, packed)) obj = {} expr = list(filter(lambda el: el != '', split('[ ,.#;\\n]', packed))) key = '' value = [] formKey = False formValue = False for element in expr: if element == 'glob': formKey = True continue if element == '(': formValue = True continue if element == ')': formValue = False obj[key] = value key = '' value = [] continue if formKey: key = element formKey = False continue if formValue: if match('[-+]?\\d+$', element): value.append(int(element)) return obj" "def main(x): otvet = {} x = x.replace('\n', ' ') x = x.replace('<<', '') x = x.replace('<%', '') x = x.replace('<-', '') x = x.replace('%>', '') x = x.replace('>>', '') x = x.replace('#', ' ') x = x.replace('def', '') x = x.split(' ') arg_1 = '' arg_2 = '' for i in x: if arg_1 == '' and i != '': arg_1 = i elif arg_2 == '' and i != '': arg_2 = int(i) if arg_1 != '' and arg_2 != '': otvet[arg_1] = arg_2 arg_1 = '' arg_2 = '' return otvet" "import string def main(text): punct = ('!', '?', '{', '}', '@', '#', ':', '<', '>', '=', ';', ""'"") no_punct = ''.join([c for c in text if c not in punct]) no_punct = no_punct.replace('global', '') no_punct = no_punct.replace('\n', '') no_punct = no_punct.strip() no_punct = no_punct.replace(' ', '') no_punct = no_punct.replace('(', ' ') no_punct = no_punct.replace(')', ' ') no_punct = no_punct.split() if len(no_punct) <= 4: a = no_punct[0] b = no_punct[1] c = no_punct[2] d = no_punct[3] a = a.split(',') c = c.split(',') return {b: a, d: c} elif len(no_punct) <= 6: a = no_punct[0] b = no_punct[1] c = no_punct[2] d = no_punct[3] f = no_punct[4] g = no_punct[5] a = a.split(',') c = c.split(',') f = f.split(',') return {b: a, d: c, g: f} else: a = no_punct[0] b = no_punct[1] c = no_punct[2] d = no_punct[3] f = no_punct[4] g = no_punct[5] h = no_punct[6] e = no_punct[7] a = a.split(',') c = c.split(',') f = f.split(',') h = h.split(',') return {b: a, d: c, g: f, e: h}" "import re def main(x): dict_ = {} a = x.split('<%')[1:] for i in a: (val, k) = i.split('<==') k = k[k.find('(') + 1:k.find(')')] val = re.findall('""([^""]*)""', i)[0] dict_[val] = k return dict_" "def main(s): result = {} arr = s.replace('<:', '').replace('\n', ' ').replace('do', '').replace(';', '').replace(':>', '').split('end') for elem in arr: if len(elem) > 1: split = elem.split('<=') result[split[0].replace(' ', '')] = split[1].replace(' ', '') return result" "def main(s): result = {} arr = s.replace('@', '').replace('\n', ' ').replace(""'"", '').replace('end', '').replace('begin', '').replace('def', '').replace('\\', '').split('.') for elem in arr: if len(elem) > 1: split = elem.split('<|') arr1 = split[1].split(' ') sub_list = [] for e in arr1: if len(e) > 1: sub_list.append(e.replace('[', '').replace(']', '')) result[split[0].replace(' ', '')] = sub_list return result" "import re def main(s): d = {} s = s.replace('#', '').replace(';', ',').replace('\n', '') for m in re.finditer('\\[\\[(.+?)\\]\\]', s): k = re.search('\\|\\>(.+?)\\]\\]', m[0]) k1 = k[0].replace('|>', '').replace(']]', '').strip() v = re.search('\\(.+?\\)', m[0]) v1 = v[0].replace('(', '').replace(')', '').strip() aray1 = [] for ar in v1.split(','): aray1.append(int(ar)) d[k1] = aray1 return d" "def main(x): x = x.replace('\n', ' ').replace('\t', ' ')[1:] x_parts = x.split('.') result = dict() for path in x_parts: k = path.find(':') if path.find(':') != -1: key = path[path.rfind(' ', 0, k - 1) + 1:k].strip() value = path[path.find(':', k) + 1:].strip() result[key] = value return result line = '.do
declare tirequ_821: ralera_555.
;
\ndeclare teor : iste_941.
;
declare geza :atedti.\n
; .end' main(line)" "import re def main(s): pattern = '#(-\\d*|\\d*) ->\\s*([^.\\s]*)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: int(value) for (value, key) in parsed_s}" "def main(x): x_parts = x.strip()[3:-3].strip().replace('\n', ' ').replace(' :', ':').replace(' #', '#').replace(' ', ';').replace('.do;var;', '').replace(':#(', ' ').replace(')', ' ').replace(';', ' ') result = dict() x_parts = x_parts.split() for i in range(len(x_parts)): if i == 0 or x_parts[i - 1] == '.end': result[x_parts[i]] = [] key = x_parts[i] elif x_parts[i] != '.end': result[key].append(x_parts[i]) return result" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('<%', '') s = s.replace('%>', '') s = s.replace('loc', '') s = s.replace('==>', '') s = s.replace('==>q(', ""'"") s = s[:-1] for el in s.split(';'): name = el[el.find(""'"", 0, len(el) - 1) + 1:len(el) - 1] number = el[:el.find(""'"", 0, len(el) - 1)] res[name] = int(number) return res" "import math def main(n): res = {} n = n.replace('\n', '') for i in range(len(n)): if n[i] == '=': key = '' j = i - 1 if n[j] == ' ': j -= 1 while n[j] != ' ': key = n[j] + key j -= 1 value = '' j = i while n[j] != '#': j += 1 j += 1 while n[j] != '.': value = value + n[j] j += 1 res[key] = int(value) return res" "import math def main(n): res = {} n = n.replace('\n', ' ') for i in range(len(n)): if n[i] == ':': key = '' j = i - 1 if n[j] == ' ': j -= 1 j -= 1 while n[j] != ""'"": key = n[j] + key j -= 1 value = '' j = i while not (n[j] == 'l' and n[j + 1] == 'i' and (n[j + 2] == 's') and (n[j + 3] == 't')): j += 1 j += 5 keys = '' while n[j] != ')': keys = keys + n[j] j += 1 res[key] = keys.split() return res" "import re def f(x: str) -> dict: found = re.findall('`([a-zA-Z_0-9]+)[\\s]*<=[\\s]*([a-zA-Z_0-9]+);', x) return dict(found) def main(x): return f(x)" "import re def f(x: str) -> dict: found = re.findall(""let[\\s]*([a-zA-Z_0-9]+)[\\s]*:[\\s]*'([a-zA-Z_0-9]+)'"", x) return dict(found) def main(x): return f(x)" "from typing import Dict import re def f(raw_string: str) -> Dict[str, int]: store = {} pattern = re.compile('\\|\\s*let\\s*#([\\-\\d]+)\\s*->\\s*(\\w+)\\s*\\.\\s*\\|\\s*\\.') for (count, name) in re.findall(pattern, raw_string): store[name] = int(count) return store main = f" "import re def main(text): data = text.split('.end') data.pop(len(data) - 1) data.pop(len(data) - 1) output_dict = {} for elem in data: properties = elem.split('==>') key = re.search('q.*\\)', properties[1]) key = key.group(0).replace('q(', '').replace(')', '') value = re.search('\\#.\\d*', properties[0]) value = int(value.group(0).replace('#', '')) output_dict[key] = value return output_dict" "def main(x): keys = [] values = [] dictionary = {} for i in range(1, len(x.split('q('))): keys.append(x.split('q(')[i].split(')')[0]) values.append(x.replace('}', '{').split('{')[i * 2 - 1]) for i in range(0, len(values)): values[i] = values[i].replace('@', '').replace('.', '') values[i] = values[i].replace('""', '').split() for i in range(0, len(values)): dictionary[keys[i]] = values[i] return dictionary" "def main(x): import re result1 = re.finditer(""'([A-Za-z0-9_/\\-]*)'"", x) result2 = re.finditer(':= *([A-Za-z0-9_/\\-]*);', x) list1 = [] list2 = [] for match in result1: temp = match.group(1) list1.append(temp) for match in result2: q = re.search(':= *(.+?);', match.group()) temp = q.group(1) list2.append(temp) return dict(zip(list1, list2))" "def main(str): dict = {} elems = [] while str.find('[[') != -1 and str.find(']]') != -1: elems.append(str[str.find('[[') + 3:str.find(']]')]) str = str[str.find(']]') + 2:] for el in elems: x = el[el.find(""'""):el.rfind(""'"")] dict[el[el.find(""'"") + 1:el.rfind(""'"")]] = el[el.find('`') + 1:el.find(';')] return dict" "import re def main(string): string = string.replace('\n', ' ') lists = re.compile('(\\{[\\w.\\s]+\\})') names = re.compile('((?<=to )\\w+)') words = re.compile('(\\w+)') lists_matches = lists.finditer(string) names_matches = names.finditer(string) count = 0 dictionary = {} for match in names_matches: dictionary.update({match[0]: []}) for match in lists_matches: words_matches = words.finditer(match[0]) for word in words_matches: dictionary[list(dictionary)[count]].append(word.groups(0)[0]) count += 1 return dictionary" "def makeArray(param): startIndex = 0 returnArray = [] while param.find(""'"", startIndex) >= 0: start = param.find(""'"", startIndex) end = param.find(""'"", start + 1) returnArray.append(param[start + 1:end]) startIndex = end + 1 return returnArray def formatter(param): returnD = {} startIndex = param.find('|>') + 2 startINDEX = param.find(""'"", startIndex) endIndex = param.find(""'"", startIndex + 3) array = param.find('array') + 5 result = param[startINDEX + 1:endIndex] return (result, makeArray(param[array:startIndex - 2])) def main(param): tmp = param startIndex = 0 result = {} while tmp.find('((', startIndex) >= 0 and tmp.find('))', startIndex) >= 0: start = tmp.find('((', startIndex) end = tmp.find('))', startIndex) tmpResult = formatter(tmp[start:end]) result[tmpResult[0]] = tmpResult[1] startIndex = end + 2 return result" "def main(s): D = {} s = s.replace('\n', ' ') s = s.split(' ') a = len(s) for i in range(a): if s[i] == 'make': D[s[i + 1]] = int(s[i + 2]) return D" "import re def main(s): value_pattern = re.findall('""[^""]+""', s) values = ''.join(value_pattern) value_pattern = re.findall('[^""]+', values) key_pattern = re.findall('==>[\\s\\w]\\w+', s) keys = ''.join(key_pattern) key_pattern = re.findall('[^==>\\s]+', keys) d = dict() length = len(value_pattern) for i in range(0, length): d[key_pattern[i]] = value_pattern[i] return d" "def main(x): d = {} a = x.split(';')[:-1] for i in a: (k, val) = i.split('@') k = k.split('`')[1].strip() val = val.split(""'"")[1] d[k] = val return d" "def main(s): d = {} lst = s.split('\\end;')[:-1] for c in lst: (k, val) = c.split('<=') k = k.split('auto')[-1].strip() val = val.split('.') val = [i.split('""')[1] for i in val] d[k] = val return d" "def main(str1): str2 = str1.replace('.begin', '').replace('.end', '') str2 = str2.replace('make', '').replace(',', '').replace(' ', '') str2 = str2.replace('\n', '') lst = str2.split('@') d = {} for i in range(1, len(lst)): lst[i] = lst[i][:len(lst[i]) - 1] tmp = lst[i].split(':=') key = tmp[0][1:len(tmp[0]) - 1] tmp[1] = tmp[1].replace('{', '').replace('}', '') values = tmp[1].split(';') d.update({key: values}) return d" "import re def main(code): ret = {} s = '' num = 0 for i in re.findall('[ \n]?
[ \n]?declare[ \n]?([-]?[0-9]+)[ \n]?to[ \n]?([a-z_0-9]*).[ \n]?
.[ \n]?', code): for j in i: if re.fullmatch('(-)?(0|([1-9][0-9]*))', j) is not None: num = j else: s = j ret[s] = int(num) return ret" "import re def main(code): ret = {} s = '' num = 0 for i in re.findall('[ \n]?\\[\\[[ \n]?opt[ \n]?([a-z_0-9]+)[ \n]?::=[ \n]?\\#([-]?[0-9]*).[ \n]?\\]\\].[ \n]?', code): for j in i: if re.fullmatch('(-)?(0|([1-9][0-9]*))', j) is not None: num = j else: s = j ret[s] = int(num) return ret" "def main(x): x = x.replace('.begin', '').replace('var', '') x = x.replace('', '').replace('end', '').replace('', '') x = x.replace(' ', '').replace('\n', '').replace('\t', '') blocks = x.split(';.')[:-1] result = dict() for block in blocks: key_value = block.split('=') result[key_value[0]] = int(key_value[1]) return result" "def main(s): s = s.replace(' ', '') s = s.replace('.', '') s = s.replace('\n', '') if s.startswith('begin') and s.endswith('end'): d = arrs(s[len('begin'):-1 * len('end')]) return d def arrs(s): r = dict() for i in s[:-2].split('%>'): a = i.find('<=array') shrt = i[len('<%global`'):a] lng = list() i = i[a + len('<=array') + 1:-1] for j in i.split(';'): lng.append(j) r[shrt] = lng return r" "import re def parse_keys(x): keys = '\\w+' return re.findall(keys, x) def parse(x): result = {} p = re.findall('\\w+[)]', x) s = re.findall('\\w+[.]', x) keys = parse_keys(''.join((str(e) for e in p))) for i in range(len(keys)): result[keys[i]] = parse_keys(s[i])[0] return result def main(x): return parse(x)" "def main(i_str): out_dict = {} t_list = [] i = 0 while i < len(i_str): match i_str[i]: case '""': i += 1 word = '' while i_str[i] != '""': word += i_str[i] i += 1 t_list.append(word) i += 1 case '(': i += 1 word = '' while i_str[i] != ')': word += i_str[i] i += 1 out_dict[word] = t_list t_list = [] case _: i += 1 return out_dict" "PARSE_OPEN = '<:' PARSE_CLOSE = ':>' KEY_TO_VALUE_POINTER = '<-' AUTO_MODIFIER = 'auto' TAG_OPENNING = '<' TAG_CLOSING = '>' isParseOpen = False isTagParsing = False key = '' value = '' buffer = '' result = {} def main(stri): global isParseOpen global isTagParsing global key global value global buffer global result isParseOpen = False isTagParsing = False key = '' value = '' buffer = '' result = {} for i in range(0, len(stri)): currentSymbol = stri[i] if currentSymbol != ' ' and currentSymbol != '.' and (currentSymbol != '\n'): buffer += stri[i] if buffer == PARSE_CLOSE: return result elif buffer == PARSE_OPEN: isParseOpen = True buffer = '' elif isParseOpen: parseOpen(currentSymbol) def parseOpen(currentSymbol): global isParseOpen global isTagParsing global key global value global buffer global result if buffer == TAG_OPENNING and (not isTagParsing): isTagParsing = True elif currentSymbol == TAG_CLOSING and isTagParsing: tagParse() elif not isTagParsing: bodyParse(currentSymbol) def tagParse(): global isParseOpen global isTagParsing global key global value global buffer global result if buffer == '': buffer = '' elif buffer == '': result[key] = value key = '' buffer = '' value = '' isTagParsing = False buffer = '' def bodyParse(currentSymbol): global isParseOpen global isTagParsing global key global value global buffer global result bufferLen = len(buffer) if buffer == AUTO_MODIFIER: buffer = '' elif bufferLen > 2 and buffer[bufferLen - 2:bufferLen] == KEY_TO_VALUE_POINTER: key = buffer[0:bufferLen - 2] buffer = '' elif currentSymbol == TAG_OPENNING and bufferLen > 1 and (key != ''): value = buffer[1:bufferLen - 2] buffer = '<' isTagParsing = True" "def main(x): x = x.replace('.begin', '').replace('.end', '') x = x.replace(' ', '').replace('\n', '').replace('\t', '') x = x.replace('to`', ',').replace(';', '').replace('make#', '').replace('<:', '<') x = x.replace('<', '').replace('>', '').replace(',', ' ').replace(':', '') blocks = x.split(' ') for i in range(0, len(blocks) - 1, 2): (blocks[i], blocks[i + 1]) = (blocks[i + 1], int(blocks[i])) blocks = blocks[:-1] blocks1 = blocks[::2] blocks2 = blocks[1::2] blocks_dictionary = {k: v for (k, v) in zip(blocks1, blocks2)} return blocks_dictionary" "def main(x): x = x.replace(';', ' ') x = x.replace('}', ' } ') x = x.replace('{', ' { ') a = [] x = x.split('`') a.extend(x) for i in range(len(x)): if a[i] == '@' and a[i + 1] != ' ': a.insert(i + 1, ' ') x = ''.join(a) b = {} k = x.split('""') x = ' '.join(k) k = x.split() r1 = [] r2 = [] for j in range(len(k)): if k[j] == '{': j += 1 r1.append(j) for r in range(len(k)): if k[r] == '}': r2.append(r) m = 0 for p in range(len(k)): if k[p] == '@': b[k[p + 1]] = k[r1[m]:r2[m]] m += 1 return b" "import re def main(x): match1 = re.findall('`\\w+', x) match2 = re.findall('[-+]?\\d+;', x) res = {} for i in range(len(match1)): match1[i] = re.sub('`', '', match1[i]) match2[i] = re.sub(';', '', match2[i]) res[match1[i]] = int(match2[i]) return res" "def main(str): d = {} i = 0 t = 0 first = '' second = '' while i < len(str): if str.find('variable', i) != -1: i = str.find('variable', i) + 9 while str[i] != ' ' and str[i] != '\n': first += str[i] i += 1 i += 4 while str[i] != '<' and str[i] != '\n' and (str[i] != ' '): second += str[i] i += 1 d[first] = second first = '' second = '' else: break return d" "import re def main(text): res = {} temp_text = text.replace('\n', ' ') key_tmplt = '[a-zA-Z0-9_]+\\.' value_tmplt = '\\{ ?[0-9 -]+ ?\\}' keys = re.findall(key_tmplt, temp_text) values = re.findall(value_tmplt, temp_text) for i in range(len(values)): keys[i] = keys[i][:len(keys[i]) - 1] values[i] = values[i][1:len(values[i]) - 1] if values[i][0] == ' ': values[i] = values[i][1:] if values[i][len(values[i]) - 1] == ' ': values[i] = values[i][:len(values[i]) - 1] values[i] = values[i].split(' ') for i in range(len(keys)): temp_val = [] for j in values[i]: temp_val.append(int(j)) res[keys[i]] = temp_val return res" "def main(arg): d = {} a = arg.split() for i in range(len(arg)): arg = arg.replace('=>', ' ') arg = arg.replace('opt', ' ') arg = arg.replace(';', ' ') arg = arg.replace('{', ' ') arg = arg.replace('}', ' ') arg = arg.replace('#', ' ') arg = arg.replace('.', ' ') a = arg.split() while '' in a: a.remove('') for i in range(1, len(a) - 1, 2): d[str(a[i + 1])] = int(a[i]) return d" "def main(x): x_parts = x.strip()[6:-5].strip().replace(' ,', ' ').replace('\n', ' ').replace('=', ' ').replace('}', '').replace('{', '').replace(', `', ' ').replace(',`', ' ').replace(': ', ':').replace(""'"", '').replace(' `', ' ').replace('`', ' ').replace(' ', ' ').replace(' ', ' ').split(',') result = dict() for block in x_parts: block_parts = block.replace('do new', '').replace('od', '').strip().replace('\n', '').split(' :') if block_parts[0] == '': pass else: block_parts[0] = block_parts[0].split(' ') result[block_parts[1]] = block_parts[0] return result" "def main(x): x = x.split('||.') x.pop() dic = {} for i in x: key = i[i.index('""') + 1:i.rindex('""')] value = i[i.rindex('""') + 1:] value = value.strip()[:-1] value = int(value) dic.update([(key, value)]) return dic" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') while x != 'done': index1 = x.find('#') + 1 index2 = x.find('=') index3 = x.find('>') + 1 index4 = x.find('.') if x[index1:index2].replace('-', '').isdigit(): mdict[x[index3:index4].replace('\n', '')] = int(x[index1:index2]) else: mdict[x[index3:index4]] = x[index1:index2] x = x[index4 + 3:] return mdict" "def main(x): a = x.split(';') dictionary = {} alphabet = [] slowar = [] for i in range(0, len(a) - 1): string = a[i] string = string.replace(' ', '') string = string.replace('\n', '') string = string.replace(""'"", '') posFirstLetter1Word = string.find('loc') + 3 posLastLetter1Word = string.find('<|') alphabet.append(string[posFirstLetter1Word:posLastLetter1Word]) slowar.append(string[posLastLetter1Word + 2:len(string)]) dictionary = dict(zip(alphabet, slowar)) return dictionary" "def main(s): dict = {} s = s.replace(' ', '') s = s.replace('\n', '') while s.find('@') != -1: left = s.find(""@'"") + 2 right = s.find(""'<-"") name = s[left:right] newLeft = s.find('<-') + 2 newRight = s.find('.end.') value = int(s[newLeft:newRight]) dict[name] = value s = s[s.find('.end.') + 5:] return dict" "def main(x): x = x.replace('global', ' ') x = x[15:-11].replace('\n', ' ').replace('\t', ' ').replace('global', ' ').replace('`', ' ').replace('#', ' ').replace(':>', ' ').replace('<:', '').replace('`', '').strip() x_parts = x.split(';') result = dict() for part in x_parts: if part == '': break part = part.replace('global', ' ').replace('`', ' ').replace('#', ' ').replace(':>', ' ').replace('<:', '').replace('`', '').replace(':', '').strip() (values, key) = part.split('|>') result[key.strip()] = int(values.strip()) return result" "def main(stroka): stroka = stroka.replace('<=', ' ') stroka = stroka.split('\n') stroka = ' '.join(stroka) result = {} kuski = stroka.split('].') for kusok in kuski: if 'glob' in kusok: space = kusok.index('glob') + 5 kusok = kusok[space:] space = kusok.index(' ') slovo = kusok[:space] kusok = kusok[space + 1:] skobka = kusok.index('[') kusok = kusok[skobka + 1:] chasti = kusok.split() spisok = [] for chast in chasti: try: spisok.append(chast) except ValueError: pass result[slovo] = spisok return result" "def main(x): x_parts = x.strip().strip().replace(' ', '').replace('\n', '').replace('', '').replace(';', '').replace('""', '').split('.')[:-1] res = dict() for block in x_parts: block_parts = block.replace('val', '')[:].split('<==@') res[block_parts[0][:]] = block_parts[1] return res" "import re def main(s): pattern1 = re.compile('\\s*
\\s*variable\\s*@""[A-Za-z_\\-0-9]+') matches1 = pattern1.findall(s) pattern2 = re.compile('\\s*::=\\s*-?[0-9]+') matches2 = pattern2.findall(s) result = dict() for j in range(len(matches1)): el1 = matches1[j] el2 = matches2[j] i = len(el1) - 1 answer_word = '' while el1[i] != '""': answer_word += el1[i] i -= 1 i = len(el2) - 1 answer_digit = '' while el2[i].isdigit() or el2[i] == '-': answer_digit += el2[i] i -= 1 digit = '' word = '' for i in range(len(answer_word)): word += answer_word[len(answer_word) - i - 1] for i in range(len(answer_digit)): digit += answer_digit[len(answer_digit) - i - 1] result[word] = int(digit) return result" "def main(x): x = x.replace(' ', '') x = x.replace('', '') x = x.replace('', '') x = x.replace('\n', '') d = {} while x.find('to') != -1: i = x.find('to') tempstr = '' tempkey = '' for j in x[i:]: if j == '.': break else: tempstr += j for j in x[:i]: if j == 'o': break else: tempkey += j key = tempkey[tempkey.find('t') + 1:] word = tempstr[2:] new = x.find(tempstr) x = x[new + len(tempstr):] d[word] = int(key) return d" "import cmath import math import re def f(x): regex = ""\\.begin\\s*val\\s*'([a-z0-9_]+)'\\s*=:\\s*([a-z0-9_]+);\\s*\\.end;"" needed = re.findall(regex, x) result_dict = {} for match in needed: result_dict[match[1]] = match[0] return result_dict def main(x): return f(x)" "def main(text): text = text.replace('\n', '') text = text.strip('begin end') text_list = text.replace('.do make', '||').replace('.end', '||').split('||') text_list = [i for i in text_list if len(i) > 1] res = dict() for i in text_list: name = i[i.find('@') + 1:] name = name[:name.find(';')] name = name.strip('""""') value_list = i[i.find('#') + 1:] value_list = value_list[:value_list.find('=:')] value_list = value_list.strip('( )') value_list = [i.strip(' ').strip('\n') for i in value_list.split(';')] res[f'{name}'] = value_list return res" "data = {} def main(text, i=0): sentences = '' name = '' number = '' if text.find('val', i) != -1: index_val = text.find('val', i) while text[index_val] != '.': sentences += text[index_val] index_val += 1 index_name = sentences.find('val') + 4 while sentences[index_name].isspace() or sentences[index_name] != '<': name += sentences[index_name] index_name += 1 name = name.replace(' ', '') name = name.replace('\n', '') index_number = sentences.find('#') + 1 while index_number != len(sentences): number += sentences[index_number] index_number += 1 data.update({name: int(number)}) main(text, index_val) return data" "import re def main(str): str.replace('\n', '') regex = re.compile('{[^\\}]*}') valRegex = re.compile('-?\\d+') strVals = regex.findall(str) vals = [valRegex.findall(x) for x in strVals] namesRegex = re.compile('`[^\\.]+\\.') names = namesRegex.findall(str) names = [x[1:-1] for x in names] dick = dict() for i in range(len(names)): dick[names[i]] = [int(v) for v in vals[i]] return dick" "def main(example): res = {} for i in example.split('}}')[:-1]: key = i[i.find('->') + 2:].strip() value = int(i[i.find('opt') + 4:i.find('->') - 1]) res[key] = value return res" "def main(text): text = text.partition('\n')[0] + ' ' + text.partition('\n')[2] dict_sample = {} while len(text) > 0: text = text.partition('do opt')[2] key = text.partition('<-')[0] if key == '': break key = key.strip() key = key.partition(""'"")[2] key = key.partition(""'"")[0] text = text.partition('<-')[2] value = text.partition('done')[0] value = value.strip() dict_sample[key] = value return dict_sample" "def main(line): a = {} line = line.replace(' ', '') line = line.replace('[', '') line = line.replace(']', '') line = line.replace('', '') line = line.replace('decl', '') line = line.replace('.', '') line = line.replace('=:', ':') line = line.replace('q(', '') line = line.replace('""', '') line = line.replace(')', '') line = line.replace('\n', '') line = line.replace('.', ',') line = line[:-1] line = line.split(',') for i in range(len(line)): line[i] = line[i].split(':') a[line[i][1]] = line[i][0] return a" "def main(text): text = text.replace('\n', '') text_list = text.replace('<%', '').replace('%', '').split('>.') text_list = [i for i in text_list if len(i) > 1] res = dict() for i in text_list: name = i[i.find('>') + 1:] name = name[:name.find('.')] value_list = i[i.find('{'):] value_list = value_list[:value_list.find('-')] value_list = value_list.strip('{ }') value_list = [i.strip(' ').strip('\n') for i in value_list.split('`')] value_list = [i for i in value_list if len(i) > 1] res[f'{name.strip()}'] = value_list return res" "def main(string): keys = [] values = [] buffer = string.split(',') for st in buffer: if '\\end' in st: break if 'decl' in st: keys += [''.join(st[st.find('decl') + 5:st.find('::=')]).strip('"" : \n')] if '::=' in st: values += [int(''.join(st[st.find('::=') + 3:st.find('.')]).strip())] result = dict(zip(keys, values)) return result" "def main(string): i = 0 j = 0 temp = '' temp_list = [] dict = {} while i != len(string): if string[i] == ""'"": if temp != '': dict[temp] = temp_list temp = '' temp_list = [] j = i + 1 while string[j] != ""'"": temp += string[j] j += 1 i = j if string[i] == '#': j = i + 1 temp_temp = '' while string[j].isdigit() or string[j] == '+' or string[j] == '-': temp_temp += string[j] j += 1 i = j temp_list.append(int(temp_temp)) i += 1 dict[temp] = temp_list return dict" "def main(s): s = s.replace('\n', '') s = s.replace(' ', '') d = dict() while s.find('}') != -1: key = s[s.find('(') + 1:s.find(')')] content = s[s.find('{') + 1:s.find('}')].split('.') d[key] = content s = s[s.find('}') + 1:] return d" "import re def main(s): pattern = 'glob (\\w+) to\\s?""(\\w+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value for (value, key) in parsed_s}" "import re def main(x): result = {} x = x.split(').') for i in range(len(x)): key = re.search('=:.*\\.', x[i].replace('\n', '')) if key is not None: key = key[0].replace(' ', '')[2:-1] value = re.findall('#.+?\\d+', x[i]) for j in range(len(value)): value[j] = int(value[j][1:]) result[key] = value return result" "import re def main(string): return {k: v for (k, v) in zip((line.lstrip('|>').rstrip(';').strip() for line in re.findall(pattern='\\|>\\n*.*?;', string=string)), ([int(s.strip()) for s in line.split(',')] for line in re.findall(pattern='\\[([^\\[\\]]+)\\]', string=string)))}" "def main(inp: str): inp = inp.split('|>') res = dict() for i in range(len(inp) - 1): key = inp[i + 1].split()[0].replace('""', '') key = key[:key.find(';')] value = inp[i].split()[-1] res[key] = value return res" "def main(x): x = x.replace('((', '') x = x.replace('))', '') x = x.replace('\n', ' ') d = {} while x.find(';') != -1: l_key = x.find('option') r_key = x.find('<|') tempkey = x[l_key:r_key] tempkey = tempkey.replace('option', '') key = tempkey.replace(' ', '') l_word = x.find('<|') r_word = x.find('};') tempword = x[l_word:r_word] tempword = tempword.replace('<|', '') tempword = tempword.replace(' ', '') tempword = tempword.replace('\n', '') word = tempword.replace('""', '') x = x[x.find('};') + 2:] d[key] = word return d" "def main(s: str): global value, key res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace(';', '') s = s.replace(';
', '') s = s.replace('
', '') s = s.replace('', '') s = s.replace('==>', '.') s = s.replace('option', '') s = s.replace('[@', '') s = s.replace('
', '') s = s.replace('""', '') s = s.replace(']', '') counter = 0 for el in s.split('.'): if counter == 2: res[key] = value counter = 0 if '@' in el: value = list(map(str, el.split('@'))) counter += 1 else: key = el counter += 1 return res" "def main(x): x_parts_2 = [] y = [] x_dict = {} x_parts = x.strip()[2:-2].replace(' ', '').replace('.end.do', ' ').replace('.do', '').replace('.end', '').replace(""'"", '').replace('(', '').replace(')', '').replace('opt', '').replace('\n', '').split(' ') x_parts_1 = x_parts[0].split(',') for i in range(len(x_parts_1) - 1): x_parts_2 = x_parts_1[i].split('|>q') y.append(x_parts_2) for i in range(len(y)): z = y[i] x_dict[z[1]] = z[0] return x_dict" "def main(x): x = x.replace('\n', '') digi = '-0123456789' a = {} b = [] key = '' value = '' for i in range(len(x) - 1): if x[i] == '(': j = i while x[j + 1] != ')': j += 1 key += x[j] if x[i] == '#': k = i while digi.find(x[k + 1]) != -1: k += 1 value += x[k] b.append(int(value)) value = '' if x[i] == ']': a[key] = b key = '' b = [] return a" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('((', '') s = s.replace('))', '') s = s.replace('<%locq', '') s = s.replace('.%>.', '') s = s.replace('is[@', '[') s = s.replace('
', '') s = s.replace(']', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace(""'@'"", '@') s = s.replace(""['"", '[') s = s.replace(""'"", '[') counter = 0 for el in s.split('['): if counter == 2: res[key] = value counter = 0 if '@' in el: value = list(map(str, el.split('@'))) counter += 1 else: key = el counter += 1 return res" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace('
', '') s = s.replace('
', '') s = s.replace('==>', ""'"") s = s.replace(';', ""'"") s = s.replace('declare', '') s = s.replace('.', '') counter = 0 for el in s.split(""'""): if counter == 2: res[key] = value counter = 0 if '#' in el: value = int(list(map(str, el.split('#')))[1]) counter += 1 else: key = el counter += 1 return res" "def main(s: str): s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('[[', '') s = s.replace(']]', '') s = s.replace('#', '') s = s.replace(""')'"", ')') s = s.replace('option', '') s = s.replace('{{', '') s = s.replace('}}', '') s = s.replace('.', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace('==>', ';') s = s[0:-1] s = s.split(';') values = [] res = {} for i in s: try: if isinstance(int(i), int): values.append(int(i)) except Exception: res[i] = values values = [] return res" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('done', '') s = s.replace('do', '') s = s.replace('declare', '') s = s.replace(',', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace('#', '') s = s[:-1] s = s.split(';') for i in range(0, len(s)): s[i] = s[i].split('to', 1) counter = 0 value = 0 for i in range(0, len(s)): res[s[i][1]] = int(s[i][0]) return res" "import re def f(x): pattern = re.compile(""#(.+?)\\s*=>\\s*@'(.+?)'"") match = pattern.findall(x) result = {} for i in match: result[i[1]] = int(i[0]) return result def main(x): return f(x)" "def parse_pair(x, pos): b = x.find('==>', pos) + len('==>') while x[b] == ' ' or x[b] == '\n': b += 1 e = b while x[e] != '.': e += 1 s1 = x[b:e] b = x.find('@', pos) while x[b] != ""'"": b += 1 b += 1 e = b + 1 while x[e] != ""'"": e += 1 s2 = x[b:e] return [s1, s2] def main(x): pos = 0 d = dict() while pos < len(x): p = parse_pair(x, pos) d[p[0]] = p[1] new_pos = x.find(';', pos + 1) if new_pos == -1 or len(x) - new_pos < 7: break pos = new_pos return d" "def main(input_str: str) -> dict: res = {} var_word = 'auto' size_var_word = len(var_word) for variable in input_str.split(':>'): pos_start = variable.find(var_word) + size_var_word if pos_start != size_var_word - 1: pos_mid = variable.find('<-', pos_start) key = variable[pos_start:pos_mid].replace(' ', '').replace('\n', '') pos_start = variable.find('{') + 1 value_list = [] for value in variable[pos_start:].split('.'): value_list.append(value.replace(' ', '').replace('\n', '').replace('}', '')) res.update({key: value_list}) return res" "def main(s): x3 = map(lambda x: x.strip().replace('#', '').replace('.', '').replace('\n', ' ').removeprefix('equ ').replace(' ', '').split('='), sum(map(lambda x: x.split('][') if '][' in x else [x], s.removeprefix('[[').removesuffix(']]').strip().replace('\n', ' ').removeprefix('[').removesuffix(']').split('] [')), [])) return dict(map(lambda x: (x[0], int(x[1])), x3))" "import re def main(str): result = {} str = str.replace(' ', '') str = str.replace('\n', '') access = re.findall('(?=declarray).*?(?=.\\)\\))', str) a = '' b = '' for i in access: b = b.join(re.findall('(?<=[a][y][(]).*?(?=[)])', i)) a = a.join(re.findall('^[^@]*@([\\s\\S]*)$', i)).replace(""'"", '') lin = b.split('.') result.update(dict([(a, lin)])) return result" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('do[[', '') s = s.replace('done', '') s = s.replace('local{', '') s = s.replace('[[', '') s = s.replace(']]', '==>') s = s.replace('}', '') counter = 0 for el in s.split('==>'): if counter == 2: res[key] = value counter = 0 if ',' in el: value = list(map(str, el.split(','))) counter += 1 else: key = el counter += 1 return res" "import re def main(string): elements = re.split('\\.|\\s|->', string) del elements[0] elements.pop() words = [] for element in elements: if element != '': words.append(element) set = [] for word in words: if word != '
store' and word != '
' and (word != '
') and (word != 'store'): set.append(word) dict = {} for i in range(1, len(set), 2): dict[str(set[i])] = set[i - 1] return dict" "def main(x): x = x.replace('\n', '').replace('do option', '').replace('dooption', '').replace('(', '').replace(')', '').replace('#', '') x_parts = x.split('end') x_parts.pop(-1) x_parts1 = [i.split('<==') for i in x_parts] result = {} for i in range(len(x_parts1)): x_parts1[i][0] = x_parts1[i][0].replace(';', '') suka = x_parts1[i][1].split(';') for j in range(len(suka)): suka[j] = str(suka[j].replace(' ', '')) blyat = x_parts1[i][0].replace(' ', '') result[blyat] = suka return result" "import re def main(x): slovar = {} x = re.split('opt', x) for i in range(0, len(x) - 1): if len(x[i]) < 8: del x[i] for i in range(0, len(x)): result = re.split('->', x[i]) znach = re.findall('\\w', result[0]) res = re.findall('\\w', result[1]) slov = '' slov2 = '' for i in range(0, len(res)): slov += res[i] for i in range(0, len(znach)): slov2 += znach[i] slovar[slov] = slov2 return slovar" "def main(x): x = x.replace('begin', '').replace('@', '').replace('#', '').replace('[', '').replace(']', '').replace('end', '').replace('\n', '') x_parts = x.split('auto') x_parts.pop(0) x_parts1 = [i.split('<==') for i in x_parts] result = {} for i in range(len(x_parts1)): x_parts1[i][0] = x_parts1[i][0].replace(""'"", '').replace(' ', '') value = x_parts1[i][1].replace(' ', '').split(',') for j in range(len(value)): value[j] = int(value[j]) key = x_parts1[i][0] result[key] = value return result" "def parse(string: str): string = string.replace('q(', '') string = string.replace(');', ' ') string = string.replace('))|>', ' ') string = string.replace('))', ' ') string = string.replace('|>', ' ') string = string.replace('.', '') return string def main(string: str): string = string.replace('\n', '') string = string.replace('[', '') string = string.replace('[', '') strings = string.split('>>.') x = 0 for el in strings: el = el.replace(' ', '') el = el.replace('<<', '') el = el.replace('equarray', '') el = el.replace('(', '', 1) el = el.replace(""'"", '') el = el.replace(' ', '') strings[x] = el x += 1 result = dict() for el in strings: buf_s = parse(el) buf = buf_s.split() if len(buf) == 0 or buf[-1] == ']': break result[buf[-1]] = buf[0:len(buf) - 1] buf.clear() return result" "from typing import Dict def getNumber(string) -> str: digits = '1234567890' number = '' if string[0] == '#': string = string[1:] for symbol in string: if symbol in digits + '+-': number += symbol else: return number return number def getName(string) -> str: name = '' chars = '\n\t][ #\x08\r\x00' while string[0] not in chars: name += string[0] string = string[1:] return name def main(string: str) -> Dict: result: Dict = {} selectedName = None numbersArr = [] while string: symbol = string[0] word = string[0:3:1] blank = string[3] if word == 'new' and (blank == ' ' or blank == '\n'): string = string[3:] string = string.strip() name = getName(string) string = string[len(name):] selectedName = name numbersArr = [] elif symbol == '#': string = string[1:] string = string.strip() if string[0] == '(': string = string[1:] string = string.strip() number = getNumber(string) string = string[len(number):] numbersArr.append(int(number)) resCopy = result.copy() resCopy[selectedName] = numbersArr result = resCopy elif word == '') + 2 n2 = x.find('.') n = x[n1:n2] n = n.replace(' ', '') n = n.replace('\n', '') dict[n] = int(str) x = x[n2 + 2:len(x)] if len(x) < 10: break return dict" "def main(s): dict = {} while s.find('global') != -1: left = s.find('q(') + 2 right = s.find(')') name = s[left:right] name = name.replace(' ', '') name = name.replace('\n', '') newLeft = s.find('@""') + 2 newRight = s.find('"".') value = s[newLeft:newRight] dict[name] = value s = s[2:] s = s[s.find('global'):] return dict" "def main(input_str): str = input_str.replace('\n', ' ') i = 0 res = dict() while i < len(str): if str[i:i + 6] == 'option': currentList = [] key = '' i += 7 while str[i] != ' ': key += str[i] i += 1 if str[i] == '(': num = '' while str[i] != ')': i += 1 if str[i].isdigit() or str[i] == '-': num += str[i] elif num != '': currentList.append(int(num)) num = '' res[key] = currentList currentList = [] i += 1 return res" "def main(str): str = str.replace('', '') str = str.replace('set', '') str = str.replace(',', '') str = str.replace('=>', '>') str = str.replace(' ', '') str = str.replace('\n', '') str = str[1:-1] dictionary = {} while len(str) > 0: value = str[0:str.find('>')] str = str[str.find('>') + 1:] key = str[0:str.find(';')] str = str[str.find(';') + 1:] dictionary[key] = int(value) return dictionary" "def main(x): s = x.count('<') x_parts = x.strip().strip().replace('{{', '').replace('}}', '').replace(';', '').replace('\\', '').replace(' ', '').replace('\n', '').replace('end', '').split('.')[0:s] result = dict() for block in x_parts: block_parts = block.replace('beginset', '')[:].split('<==') block_parts[1] = int(block_parts[1]) result[block_parts[0][0:10]] = block_parts[1] return result" "def main(s1): res = dict() s1 = s1.replace(' <', '<') s1 = s1.replace('- ', '-') s1 = s1.replace('; ', ';') s1 = s1.replace(' let', 'let') s1 = s1.replace('\n', ' ') s1 = s1.replace(' ', ' ') tmp = s1.find('let') while tmp != -1: s1 = s1[tmp + 4:] arrow = s1.find('<-') lv = s1[:arrow] s1 = s1[arrow + 3:] end = s1.find(';') rv = int(s1[:end]) res[lv] = rv tmp = s1.find('let') return res" "import re def main(str): result = {} str = str.replace(' ', '') str = str.replace('\n', '') access = re.findall('@([\\s\\S]+?)\\.', str) a = '' b = '' for i in access: b = b.join(re.findall(""\\'([\\s\\S]+?)\\'"", i)) a = a.join(re.findall('\\(([\\s\\S]+?)\\)', i)) lin = a.split(';') result.update(dict([(b, lin)])) return result" "def main(x): x = x.replace('do', '').replace('.do', '').replace('\n', ' ').replace('loc', '').replace('[', '').replace(']', '') x_parts = x.split('.end') x_parts_1 = [i.split('=:') for i in x_parts] x_parts_1.pop(-1) dick = {} for i in range(len(x_parts_1)): key = x_parts_1[i][1].replace(' ', '') value = x_parts_1[i][0].split(' . ') value.pop(0) for j in range(len(value)): value[j] = value[j].replace(' ', '') dick[key] = value return dick" "def main(s): res = dict() s = s.replace('\n', ' ') s = s.replace('store#', 'store #') s = s.replace(' ', ' ') index = s.find('store') while index != -1: s = s[index + 7:] to_index = s.find('to') num = int(s[:to_index]) s = s[to_index + 3:] end_index = s.find(';') name = s[:end_index] res[name] = num index = s.find('store') return res" "def main(st): st = st.replace('\n', ' ') st = st.replace(' to ', '@to@') st = st.replace('do', '') st = st.replace('<:', '').replace('loc', '') st = st.replace(':>', '').replace('end', '') st = st.replace('#', '') st = st.replace(' ,', ',').replace('end', '') st = st.replace(' ', '') st = st.split(',')[:-1] dict_sample = {} for i in st: dv = i.split('@to@') dict_sample[dv[1]] = int(dv[0]) return dict_sample" "def main(text): result = {} text = text.replace('\n', ' ') data = text.split('end') for str in data: if str.find('>>') == -1: result[str[str.find('opt ') + 4:str.rfind('list') - 1]] = str[str.find('list(') + 5:str.find(').')].replace(' ', '').split('.') return result" "def main(x): di = {} al = [] sl = [] a = x.split(';') a = a[0:len(a) - 1:2] for i in range(0, len(a)): string = a[i] string = string.replace(' ', '') string = string.replace('\n', '') string = string.replace('#', '') string = string.replace('`', '') pos1 = string.find('val') + 3 pos2 = string.find('<=') al.append(string[pos1:pos2]) string = string[pos2 + 3:len(string) - 1].split(',') for i in range(len(string)): string[i] = int(string[i]) sl.append(string) di = dict(zip(al, sl)) return di" "import re def main(s): D = {} s = s.replace('\n', ' ') d = re.findall('option(.*?)\\.', s) for i in d: key = re.findall('\\[(.*?)\\]', i) keys = [] for j in key: key1 = re.sub('\\s? ', '', j) key2 = key1.split(';') for n in range(len(key2)): key2[n] = int(key2[n]) keys.append(key2) values = re.findall('\\->(.*?)$', i)[0] values = re.sub('\\s+', '', values, flags=re.UNICODE) D[values] = key2 return D" "import re def main(inp): names = re.findall('=:\\s*\\`([A-Za-z_0-9]+)', inp) value = re.findall('{[A-Za-z0-9""\\s,_\\\\]*}', inp) results = {} for i in range(len(names)): results[names[i]] = re.findall('""([a-zA-Z0-9_]*)""', value[i]) return results" "def parseNumbers(str): str = str.replace(' ', '') str = str.strip('{') str = str.strip('}') str = str.split(';') for i in range(len(str)): str[i] = int(str[i]) return str def parseArray(str): strArray = str.split('=') strArray.pop(len(strArray) - 1) for i in range(len(strArray)): strArray[i] = strArray[i].split('re')[1] strArray[i] = parseNumbers(strArray[i]) return strArray def parseNames(str): strArray = str.split('.') strArray.pop(len(strArray) - 1) for i in range(len(strArray)): strArray[i] = strArray[i].split('`')[1] return strArray def main(str): str = str.replace('\n', '') names = parseNames(str) values = parseArray(str) res = dict.fromkeys(names) for i in range(len(names)): res[names[i]] = values[i] return res" "def main(text): result = {} text = text.replace('\n', ' ') data = text.split('.') for str in data: str = str.replace(' ', '') if str.find('}}') == -1: result[str[str.find(""@'"") + 2:str.rfind(""'"")]] = int(str[str.find(':') + 1:str.find(']]')]) return result" "import re def main(s): exr1 = ""\\s*{\\s*make\\s*@*\\'([A-Za-z0-9_-]*)\\'\\s*<*\\|\\s*([0-9-]+)\\s*}"" matches = re.findall(exr1, s) d = {} for match in matches: key = match[0] d[key] = int(match[1]) return d" "def main(x): d = {} a = x.split(',') a.pop() b = [] z = [] for i in range(len(a)): a[i] = a[i].replace('\n', '') a[i] = a[i].replace(' ', '') k = a[i].find('`') + 1 p = a[i].find('=>') b.append(a[i][k:p]) k = a[i].find('(') + 1 p = a[i].find(')') z.append(a[i][k:p]) for i in range(len(b)): d[z[i]] = b[i] return d" "def main(s): s = s.replace('\n', ' ') d = {} k_1 = 0 data = '' for i in range(len(s) - 1): if s[i] == '#': k = i + 1 while s[k] != ' ': data += s[k] k += 1 if s[i] == '@': k_1 = i + 2 if s[i] == ';': k_2 = i - 1 if s[i:i + 3] == ':>,': if s[i - 1] == ' ': d.setdefault(s[k_1:k_2], int(data)) k_1 = 0 data = '' else: d.setdefault(s[k_1:k_2], int(data)) k_1 = 0 data = '' return d" "def main(line: str) -> str: line = line.replace('\n', ' ').replace('od.', '+').replace('do ', '') line = line.replace('(', '').replace(')', '').replace('option', '') line = line.replace('.', '').replace(' ', '') list = line.split('+') dict_f = {} for i in list: if i == '': list.pop(list.index(i)) for i in list: p = i.replace('->', '+').split('+') dict_f[p[1]] = p[0] return dict_f" "import re def main(string): e = 'ck>\\s*new\\s*([a-z_0-9]*)\\s*=\\s*list\\(([^\\)]+)\\)\\.\\s*<\\/blo' matches = re.findall(e, string) output = {} for match in matches: kuski = match[1].split('.') for i in range(len(kuski)): kuski[i] = kuski[i].strip(' ').strip('\n') key = match[0] output[key] = kuski return output" "import re def main(txt): result = re.findall('\\w+', txt) new_res = [] d = {} for i in range(1, len(result)): if result[i] != 'new': new_res.append(result[i]) j = 0 while j <= len(new_res): if j + 1 < len(new_res): d.update({new_res[j]: new_res[j + 1]}) j += 2 return d" "def main(string): d = {} while string.find('`') != -1: key = string[string.find('`') + 1:string.find('@') - 1] value = string[string.find('@') + 2:string.find('.') - 1] string = string[string.find('.') + 1:] d[key] = value return d" "def main(string: str): result = {} while string.find('=:') != -1: item_start = string.find('`') item_end = string.find('=:') item = string[item_start:item_end] item = item.replace(' ', '') item = item.replace('`', '') item = item.replace('\n', '') key_start = item_end key_end = string.find(';', key_start) key = string[key_start:key_end] key = key.replace('=:', '') key = key.replace(' ', '') key = key.replace('\n', '') result[key] = item string = string[key_end:] return result" "def main(x): import re k = re.findall('decl -?[0-9]+', x) k = [int(i[5:]) for i in k] f = re.findall('\\|>[\\s]*`[a-z0-9]+_*[0-9]*', x) f = [i[i.find('`') + 1:] for i in f] return {f[i]: k[i] for i in range(len(f))}" "def main(stroka): dic = {} while stroka.find('""') != -1: strokawork = stroka[stroka.find('""'):stroka.find('end') + 3] k = strokawork[strokawork.find('""') + 1:strokawork.rfind('""')] v = strokawork[strokawork.find(""'"") + 1:strokawork.rfind(""'"")] stroka = stroka[stroka.find('end') + 4:] dic[k] = v return dic" "def main(string): d = {} while string.find('auto') != -1: processing = string[string.find('auto'):string.find(';')] k = processing[processing.find('auto') + 5:processing.find('<')] for i in range(len(k)): if k[i].isalpha() or k[i].isdigit() or k[i] == '_': a = 0 else: k = k[:i] v = [] while processing.find(',') != -1: v.append(int(processing[processing.find('#') + 1:processing.find(',')])) processing = processing[processing.find(',') + 1:] v.append(int(processing[processing.find('#') + 1:processing.find('}')])) d[k] = v string = string[string.find(';') + 1:] return d" "def main(s): res = dict() s = s.replace('\n', ' ') s = s.replace(' ', ' ') s = s.replace(' <', '<') s = s.replace('= ', '=') s = s.replace('( ', '(') s = s.replace(' )', ')') index = s.find('declare') while index != -1: s = s[index + 8:] ar_index = s.find('<=') name = s[:ar_index] h_index = s.find('#') s = s[h_index + 2:] dot_index = s.find('.') tmp_s = s[:dot_index] tmp_s = tmp_s.replace('(', '') tmp_s = tmp_s.replace(')', '') tmp_s = tmp_s.replace(',', ' ') tmp_s = tmp_s.replace('""', '') res[name] = tmp_s.split() index = s.find('declare') return res" "def main(string): keys = [] values = [] buffer = string.split(';') for st in buffer: if '\\' in st: break if 'val' in st: keys += [''.join(st[st.find('val') + 5:st.find('<==')]).strip('@ "" \n')] if '<==' in st: values += [''.join(st[st.find('<==') + 3:st.find('.')]).strip()] result = dict(zip(keys, values)) return result" "def main(line): a = {} line = line.replace(' ', '') line = line.replace('{', '') line = line.replace('}', '') line = line.replace('val', '') line = line.replace('<<', '') line = line.replace('>>', '') line = line.replace('=>', ':') line = line.replace('q(', '') line = line.replace('""', '') line = line.replace('@', '') line = line.replace('\n', '') line = line.replace(';', ',') line = line[:-1] line = line.split(',') for i in range(len(line)): line[i] = line[i].split(':') a[line[i][1]] = line[i][0] return a" "_dict = {} def main(string): string = string.split(',') string.pop(len(string) - 1) for line in string: value = line[line.find('#') + 1:] value = value[:value.find('->')] value = value.strip() value = int(value) key = line[line.find('@') + 1:] key = key[:key.find(':')] key = key.replace(""'"", ' ') key = key.strip() _dict[key] = value return _dict" "import re def main(x): x = x.replace('', '').replace('', '').replace('<%', '').replace('%>', '').replace('def', '').replace('#', '').replace('\n', '') x = re.sub('\\s.\\s', '', x) x = re.sub('\\s.$', '', x) x_parts = x.split('.') x_parts.pop(-1) if '' in x_parts: x_parts.remove('') x_parts1 = [i.split('=>') for i in x_parts] result = {} for i in range(len(x_parts)): value = int(x_parts1[i][0]) key = x_parts1[i][1].replace(' ', '') result[key] = value return result" "def main(a): x = a.split('|') keys = [] zn = [] d = {} for i in range(1, len(x), 2): keys.append(x[i].split(""'"")[1]) zn.append(x[i].split('(')[1].split(')')[0].split()) for i in range(len(keys)): d[keys[i]] = zn[i] return d" "def main(string): slov = {} while string.find('|>') != -1: work = string[string.find('{'):string.find('.')] a = work[work.find('>') + 1:work.find('))')] i = 0 while i < len(a): if a[i].isalpha() or a[i].isdigit() or a[i] == '_': p = 0 else: a = a[:i] + a[i + 1:] i += 1 b = [] while work.find(';') != -1: b.append(work[work.find('(') + 1:work.find(')')]) work = work[work.find(';') + 2:] b.append(work[work.find('(') + 1:work.find(')')]) slov[a] = b string = string[string.find('.') + 1:] return slov" "def main(s): s = s.replace('\n', ' ') s = s.replace('`', '') s = s.replace(':', ' : ') s = s.replace(' ', ' ') res = dict() index = s.find('def') while index != -1: s = s[index + 4:] name_end = s.find(':') name = s[:name_end - 1] s = s[name_end + 1:] num_end = s.find('end') num = int(s[:num_end]) res[name] = num index = s.find('def') return res" "import re def main(s): A = [] B = [] s = s.replace('\n', ' ') d = re.findall('(.*?)<\\/data>', s) for i in d: prt1 = re.sub('\\D?begin', string=i, repl='') prt2 = re.sub('end,', string=prt1, repl='') prt3 = re.sub('\\D?var', string=prt2, repl='') key = re.findall('\\#(.*?)\\.', prt3) for item_key in key: B.append(item_key) values = [x.replace(' ', '') for x in re.findall('\\s?(.*?)\\s?\\D?#', prt3)] for i in values: valuess4 = re.findall('(\\w+)\\<', i) for z in valuess4: valuess5 = re.sub('\\D?=', string=z, repl='') valuess5 = valuess5.replace('end', '') A.append(valuess5) dict = {} for a in range(A.__len__()): k = A[a] dict[k] = int(B[a]) return dict" "import re def main(s): A = [] B = [] s = s.replace('\n', ' ') d = re.findall('
(.*?)<\\/section>', s) for i in d: prt1 = re.sub('\\D?do', string=i, repl='') prt2 = re.sub('end,', string=prt1, repl='') prt3 = re.sub('\\D?store', string=prt2, repl='') key = re.findall('\\""(.*?)\\""', prt3) for item_key in key: B.append(item_key) values = [x.replace(' ', '') for x in re.findall('\\>\\s?(\\w+)', prt3)] for z in values: valuess5 = re.sub('', string=z, repl='') A.append(valuess5) dict = {} for a in range(A.__len__()): k = A[a] dict[k] = B[a] return dict" "def main(s): s = s.replace('<%', '').replace('variable', '').replace('%>', '').replace(' ', '').replace('\n', '') s1 = s.split('`') d = {} for i in range(1, len(s1)): key = s1[i].split('=')[0] value = s1[i].split('=')[1].replace('#', '').replace('(', '').replace(')', '').split(';') dtemp = {key: value} d.update(dtemp) return d" "def main(string): temp = string.replace(' ', '') strings = [] ints = [] skip = 0 for sym in range(len(temp)): if skip > 0: skip -= 1 continue elif temp[sym] == '#': skip += 1 sym += 1 temp_int = '' while temp[sym + 1] != '>': temp_int += temp[sym] skip += 1 sym += 1 ints.append(int(temp_int)) elif temp[sym] == '>': skip += 1 sym += 1 temp_str = '' while temp[sym] != '|': temp_str += temp[sym] skip += 1 sym += 1 strings.append(temp_str) return dict(zip(strings, ints))" "import re def main(expr): expr = expr.replace('data', '') expr = expr.replace(' ', '') expr = expr.replace('#', '') expr = expr.replace('\n', '') first_part = re.findall('<<[a-z]+_?\\d*<=', expr) second_part = re.findall('<=-?\\d*>>', expr) i = len(first_part) for k in range(i): first_part[k] = first_part[k].replace('<<', '').replace('<=', '') second_part[k] = second_part[k].replace('<=', '').replace('>>', '') result = dict.fromkeys(first_part) for k in range(i): result[first_part[k]] = int(second_part[k]) return result" "import re def main(s): D = {} s = s.replace('\n', ' ') d = re.findall('val\\s?(.*?)\\s?<\\/data>', s) for i in d: (key, value) = i.split('to') key = key.replace(' ', '') value = value.replace(""'"", '') value = value.replace(' ', '') value = value.replace('`', '') value = value.replace('.', '') D[value] = key return D" "def main(text): result = {} data = text.split(';') for str in data: if str.find('\\end') == -1: result[str[str.find('@""') + 2:str.rfind('""')]] = int(str[str.find('#') + 1:str.find('.')]) return result" "def main(text): result = {} text = text.replace('\n', ' ') data = text.split(';') for str in data: str = str.replace(' ', '') if str.find('}') == -1: result[str[str.find('""') + 1:str.rfind('""')]] = str[str.find('auto') + 4:str.find('->')] return result" "import re def main(code): ret = {} s = '' num = 0 for i in re.findall(""[|]?[ \n]?new?[ \n]?[#]?([-]?[0-9]*)?[ \n]?==>[ \n]?[@][']([a-z_0-9]+)?['][ \n]?[|][, ]"", code): for j in i: if re.fullmatch('(-)?(0|([1-9][0-9]*))', j) is not None: num = j else: s = j ret[s] = int(num) return ret" "import re def main(expr): expr = expr.replace(' ', '') expr = expr.replace('\n', '') first_part = re.findall('==>`[a-z]+_?\\d*;', expr) second_part = re.findall('auto-?\\d*==>`', expr) i = len(first_part) for k in range(i): first_part[k] = first_part[k].replace('==>`', '').replace(';', '') second_part[k] = second_part[k].replace('auto', '').replace('==>`', '') result = dict.fromkeys(first_part) for k in range(i): result[first_part[k]] = int(second_part[k]) return result" "def main(string): i = 0 key = '' word = '' dictionary = {} while i < len(string): if i + 5 < len(string): if string[i:i + 4] == 'auto': i += 5 while string[i] != ' ' and string[i] != '\n': key += string[i] i += 1 while True: if string[i:i + 2] == 'is': i += 2 break i += 1 i += 3 while string[i] != ')': word += string[i] i += 1 dictionary[key] = word key = '' word = '' i += 1 return dictionary" "import re def main(input_line): input_line = input_line.replace('\n', ' ') list_values = re.findall('==>(.*?)?]', input_line) list_keys = re.findall('\\(.*?\\)', input_line) list_keys = [x.strip('(') for x in list_keys] list_keys = [x.strip(')') for x in list_keys] list_keys = [x.strip(' ') for x in list_keys] d = dict(zip(list_values, list_keys)) res2 = [] for (k, v) in d.items(): sa = str(k) + ' ' + str(v) res2.append(sa) res = {} for s in res2: tmp = s.split() res[tmp[0]] = tmp[1:] output_dict = {} for (key, value) in res.items(): output_dict[key] = [int(item) for item in value] return output_dict" "def main(str): return f(str) def f(str): x = dict() while str.find('<|') != -1: if str.find(' <|') == str.find('<|') - 1: strN = str[0:str.find(' <|')] else: strN = str[0:str.find('<|')] if strN.rfind(' ') != -1: strN = strN[strN.rfind(' ') + 1:] if strN.find('\n') != -1: strN = strN[strN.rfind('\n') + 1:] x.setdefault(strN, []) str = str[str.find('<|') + 1:] strZ = str[str.find('{') + 1:str.find('}') + 1] pos = 1 zn = 0 i = 0 while i < len(strZ): if strZ[i] == '-': pos = -1 if strZ[i].isdigit(): zn = zn * 10 + int(strZ[i]) if not strZ[i + 1].isdigit(): x[strN].append(zn * pos) pos = 1 zn = 0 i += 1 return x" "import re def main(str): pattern = '(?<=[make]).*?(?=[:][>])' result = {} str = str.replace(' ', '') str = str.replace('><:make', '') str = str.replace('ake', '') str = str.replace('\n', '') access = re.findall(pattern, str) for i in access: txt = i.split('#') result[txt[0]] = int(txt[1]) return result" "def main(x): answer = {} arr = x.split(',') for i in arr: if i.find('declare') != -1: word = i[i.find(""'""):i.find(';')] word = word.replace(""'"", '') word = word.replace(' ', '') word = word.replace('\n', '') word = word.replace('#', '') items = word.split('::=') answer[items[0]] = int(items[1]) return answer" "def main(st: str) -> dict: sentences = st.strip('<<>>').split('.do store')[1:] res = dict() for sentence in sentences: res[sentence.strip().replace('\n', ' ')[:-6].split(""'"")[1:][0]] = sentence.strip().replace('\n', ' ')[:-6].split(""'"")[1:][1].strip()[3:] return res" "import re def main(s): pattern = ""decl ?\\'(\\w+)\\' ?list ?\\( ?(\\w+(?:\\ . \\w+)+) ?\\)"" parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value.replace(' ', '').split('.') for (key, value) in parsed_s}" "import re def main(text): text = re.sub('\n', '', text) text = re.sub('\\s*<%\\s*', '', text) text = re.sub('\\s*%>\\s*', '', text) parts = text.split(';')[:-1] d = dict() for i in parts: s = i s = re.sub('\\s*def\\s*', '', s) elems = re.split('\\s*:=\\s*', s) elems[0] = re.sub('\\s*q\\(\\s*', '', elems[0]) elems[0] = re.sub('\\)\\s*', '', elems[0]) elems[1] = re.sub('\\s*list\\s*\\(\\s*', '', elems[1]) elems[1] = re.sub('\\s*\\)\\s*', '', elems[1]) elems[1] = re.sub('\\s*#\\s*', '', elems[1]) d[elems[0]] = [int(i) for i in list(re.split('\\s*\\.\\s*', elems[1]))] return d" "def main(strig): strig = strig.replace('\n', '') strig = strig.replace('{{', '') strig = strig.replace('}}', '') strig = strig.replace('[[', '') strig = strig.replace(']]', '') strig = strig.replace('<=', ':') strig = strig.replace(',', ':') strig = strig.replace(' ', '') strig = strig.replace('auto', '') new = strig.split(':') new.remove('') new_dict = {} i = 1 while i < len(new): new_dict[new[i - 1]] = new[i] i += 2 return new_dict" "def main(x): x = x.replace('begin', '') x = x.replace('\n', ' ') x = x.replace('\r', '') x = x.replace('\t', '') x = x.replace('declare', '') x = x.replace('.', '') x = x.replace('[', '') x = x.replace(']', '') x = x.replace(' is ', ':') x = x.replace('end', '') x = x.split(' ') new_dict = {} for symbol in x: if symbol != '': new_dict[symbol.split(':')[0]] = symbol.split(':')[1] return new_dict" "def main(text): result = {} text = text[2:] text = text.replace(' ', '') text = text.replace('\n', '') data = text.split(',') for str in data: if str.find('||') == -1: result[str[str.find('q(') + 2:str.rfind(')')]] = str[str.find('[') + 1:str.find(']')].split(',') return result" "def main(text): result = {} text = text[3:] text = text.replace(' ', '') text = text.replace('#', '') text = text.replace('\n', '') data = text.split('|.') for str in data: if str.find('||') == -1: result[str[str.find('>') + 1:str.rfind('.')]] = str[str.find('(') + 1:str.find(')')].split(';') j = 0 for sub in result: for i in result.get(sub): result.get(sub)[j] = int(i) j += 1 j = 0 return result" "def main(x): data = dict() strings = x.replace(' ', '') strings = strings.replace('\n', '') strings = strings.split('.') for i in strings: if len(i) > 5: str1 = i[i.find('(') + 1:i.find(')')] str2 = i[i.find('>') + 2:i.find(';') - 1] data.update({str2: str1}) return data" "def func(x): answer_dict = {} lines = x.split('
') for line in lines: line = line.replace('\n', '') line = line.replace('`', '') line = line.replace('def', '') line = line.replace(' ', '') line = line.replace(' ', ' ') line = line.replace(""'"", '') line = line.replace('
', '') line = line.replace(')', '') line = line.strip() words = line.split('::=') if len(words) >= 2: answer_dict[words[0]] = words[1] return answer_dict def main(arg1): return func(arg1)" "def main(x): x = x.replace('((', '') x = x.replace('\n', '') x = x.replace('))', ' ') x = x.replace('==>', ':') x = x.replace('||', '') x = x.replace('store', '') x = x.replace(""'"", '') x = x.replace(';', '') x = x.replace(': ', ':') x = x.replace(' :', ':') x = x.split(' ') new_dict = {} for symbol in x: if symbol != '': new_dict[symbol.split(':')[1]] = symbol.split(':')[0] return new_dict" "def func(x): res = dict() s = x.split(';') for i in range(len(s) - 1): begin = s[i].find('{') end = s[i].find('}') key = s[i].split('=:')[-1].strip() value = s[i][begin + 1:end].strip() res[key] = [] for el in value.split('#')[1:]: res[key].append(int(el.strip())) return res def main(x): res = func(x) return res" "def main(s): s = s.split('begin store') s = [el.replace('\n', '').replace('end,', '').replace('od', '').replace(' ', '').replace(""'"", '').split('->') for el in s if '->' in el] s = {el[1]: el[0] for el in s} return s" "def main(inp: str): _dict = {} inp = inp.split(',') inp.pop(len(inp) - 1) for line in inp: value = line[line.find('[') + 1:] value = value[:value.find(']') + 1] value = value.replace(';', ',') value = value[:value.find('=:')] value = value.strip() value = value.split(',') value = [i.strip() for i in value] key = line[line.find('=:') + 2:] key = key[:key.find(':') - 1] key = key.strip() _dict[key] = value return _dict" "import json def main(s): s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('\\begin', '{') s = s.replace('<>;', '], ') s = s.replace(', \\end', '}') s = s.replace(""'"", '""') x = json.loads(s) return x" "import re def main(string): d = {} rng = string.count('global') for i in range(rng): x = string.find('global') + 6 y = string.find('<==') z = string.find('|.') match_num = re.search('[-+]?[0-9]+', string[y:z]) match_name = re.search('([a-zA-Z]+)[_]?([0-9]+)?', string[x:y]) d.update({match_name.group(0): int(match_num.group(0))}) string = string.replace(string[x - 6:z + 2], '') return d" "def main(x): i = 0 c = [] g = [] result = dict() while len(x) > 0: a = x.find('@') + 2 b = x.find('"".') if b < 0: break k = x[a:b] k.replace('""', '') c.append(k) d = x.find('auto') + 5 e = x.find('->') - 1 if e < 0: break f = x[d:e] f = int(f) g.append(f) b = b + 12 x = x[b:] result[c[i]] = g[i] i += 1 return result" "def main(s): p1 = '@""' p2 = '<==' p3 = ';' ans = dict() s = [si.split(p2) for si in s.split(p3)] for si in s: if len(si) == 2: s1 = si[0].split(p1)[-1].strip().strip('""') s2 = int(si[1]) ans[s1] = s2 return ans" "def main(x): s = x.replace('\n', '') s = s.replace('do', '').replace('end', '') s = s.replace('option', '').replace(' ', '') if s[len(s) - 1] == ',': s = s[:len(s) - 1] tmp = s.split(',') res = {} for item in tmp: value = int(item[1:item.find('=')]) key = item[item.find('>') + 1:] res.update({key: value}) return res" "import re def main(s: str): s = s.replace('|', '') s = s.replace('\n', '') s = s.replace(' ', '') s = s.replace('done', ', ') s = s.replace('do', '') s = s.replace('var', ""'"") s = s.replace('::', ""'"") s = s.replace('=#', ': ') s = s.replace('.', '') res = {} keys = re.findall(""\\'([\\S]+)\\'"", s) values = re.findall(' ([\\S]+),', s) for i in range(len(keys)): res[keys[i]] = int(values[i]) return res" "import re def main(s: str): res = {} s = s.replace('{', '') s = s.replace('}', '') s = s.replace(';', '') s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('define', '') s = s.replace('::=#', ""'"") s = s.replace('`', ""'"") s = s.replace('.', '') keys = re.findall(""\\'([\\w]+)"", s) values = re.findall(""\\'\\(([\\w \\)\\(]+)\\)"", s) for i in range(len(keys)): element = re.findall('\\(([\\w]+)', values[i]) temp = [] for j in range(len(element)): temp.append(element[j]) res[keys[i]] = temp return res" "import re def main(text): my_dict = {} keys = re.findall(""'.*?'"", text) elements = re.findall('\\(.*?\\)', text) for i in range(0, len(keys)): keys[i] = keys[i][1:] keys[i] = keys[i][:-1] elements[i] = elements[i][1:] elements[i] = elements[i][:-1] my_dict[keys[i]] = elements[i] return my_dict" "def main(parse_str): parse_str = parse_str.replace('\n', ' ') parse_list = parse_str.split('.') parse_list.pop() dict = parse(parse_list) return dict def parse(parse_list): dict = {} for i in range(len(parse_list)): list = parse_list[i].split('declare ') list.pop(0) list = list[0].split(';') list = list[0].replace(""'"", '') list = list.split('@') list[0] = list[0].replace(' ', '') dict[list[0]] = list[1] return dict" "def main(parse_str): parse_str = parse_str.replace('\n', ' ') parse_list = parse_str.split(';') parse_list.pop() dict = parse(parse_list) return dict def parse(parse_list): dict = {} for i in range(len(parse_list)): list = parse_list[i].split('local ') list.pop(0) list = list[0].replace('is #', 'is#') list = list.replace('', '') list = list.split('is#') list[0] = list[0].replace(' ', '') dict[list[0]] = int(list[1]) return dict" "def main(str): i = 0 dict = [] dict1 = [] mydict = {} i = 0 i1 = 0 while i < len(str): i = str.find('auto ', i) if i == -1: break m = i + 5 substr = '' while str[m] != ' ': substr = substr + str[m] m += 1 i += 1 substr = substr.replace('\nis', '') dict.append(substr) i1 = str.find('@', i1) if i1 == -1: break m1 = i1 + 2 substr1 = '' while str[m1] != ""'"": substr1 = substr1 + str[m1] m1 += 1 i1 += 1 dict1.append(substr1) mydict[substr] = substr1 return mydict" "import re def main(s): D = {} s = s.replace('\n', ' ') d = re.findall('array\\s?(.*?)\\s?;', s) for i in d: (key, value) = i.split('=:') key = key.replace('(', '') key = key.replace(')', '') key = key.split(' ') key = list(filter(None, key)) key = list(map(int, key)) value = value.replace('@', '') value = value.replace('""', '') value = value.replace(' ', '') D[value] = key return D" "import math def main(x): x = x.replace(' ', '') x = x.replace('(', '') x = x.replace(')', '') x = x.replace('\n', '') x = x.split(',') out = {} for i in x[:len(x) - 1]: out.update({i.split('=')[0][3:]: int(i.split('=')[1])}) return out" "def main(string): dict = [] dict1 = [] mydict = {} i = 0 c = 0 i1 = 0 while i < len(string): i = string.find('""', i) if i == -1: break m = i + 1 substr = '' while string[m] != '""': substr = substr + string[m] m += 1 i = m + 1 dict.append(substr) i1 = string.find(""'"", i1) if i1 == -1: break m1 = i1 + 1 substr1 = '' while string[m1] != ""'"": substr1 = substr1 + string[m1] m1 += 1 i1 = m1 + 1 dict1.append(substr1) mydict[substr] = substr1 return mydict" "def main(str): s = str[6:-6].replace(' ', '') s = s.replace('begin', '') s = s.replace('make', '') s = s.replace('end;', '') longa = s.split('.') longa = longa[:-1] keys = [] vals = [] for elem in longa: vals.append(int(elem[:elem.find('=')])) keys.append(elem[elem.find('`') + 1:]) return dict(zip(keys, vals))" "import re def main(string): Dict = {} arr = string.split(';') for x in range(len(arr) - 1): arr[x] = arr[x].partition('local')[2] reg = re.compile('[^a-zA-Z0-9+=+>+_]') arr[x] = reg.sub('', arr[x]) values = arr[x].split('==>') Dict[values[1]] = values[0] return Dict" "def main(row): ans = {} row = row.replace(' ', '') row = row.replace('\n', '') row = row.replace('%', '') row = row.replace('>', '') row = row.replace('<', '') row = row.replace('(', '') row = row.replace(')', '') row = row.replace(';.end,', '') row = row.replace('.begin', '') row = row.replace('#', ' ') row = row.replace(',', ' ') row = row.replace('def', ' def ') row = row.split(' ') del row[0] key = '' massive = [] for i in range(len(row)): if row[i] == 'def': if key != '': ans[key] = massive key = '' massive = [] key = row[i + 1] elif row[i - 1] != 'def': massive.append(row[i]) ans[key] = massive return ans" "def main(s): result = {} arr = s.replace('|| |', '').replace('\n', ' ').replace('variable', '').replace(' ', '').split('||#(') for elem in arr: if len(elem) > 1: split = elem.replace('#', '').replace('(', '').replace(')', '').replace('|', '').split('->') sub_list = [] for e in split[0].split(','): if len(e) > 1: sub_list.append(int(e)) result[split[1]] = sub_list return result" "def main(x): d = {} n = x.count('(') q = 0 br = 0 for i in range(n): first_q = x.find(""'"", q + 1) second_q = x.find(""'"", first_q + 1) first_b = x.find('(', br + 1) second_b = x.find(')', br + 1) d[x[first_b + 1:second_b]] = x[first_q + 1:second_q] q = second_q + 1 br = second_b + 1 return d" "def main(text): do_mass = [x.split('==>') for x in text.split(';')] ans_dict = {} for x in do_mass: if len(x) == 2: var = x[1].split('.')[0].strip() dat = x[0].split('`')[1].strip() ans_dict[var] = dat return ans_dict" "def main(x): arrays = [] x = x.replace('.do', '').replace('.end', '').replace('#', '') x = x.replace(' ', '').replace('\n', '').replace('make', '\t') x = x.replace('array(', ' ').replace(')', ' ').replace('.', ' ') blocks = x.split('\t')[1:] result = dict() for block in blocks: key_value = block.split('<|') values = key_value[1].split(' ')[1:-1] values = [int(value) for value in values] result[key_value[0]] = values return result" "def main(s): line = map(lambda x: x.strip().replace('.do', '').replace('.end.', '').replace(""' '"", '').replace('\n', ' ').replace(' ', '').replace(';', '').split('=:'), sum(map(lambda x: x.split('.end. .do') if '.end. .do' in x else [x], s.removeprefix('.begin').removesuffix('.end').strip().replace('\n', ' ').replace(""'"", '').split(""' '"")), [])) return dict(map(lambda x: (x[1], int(x[0])), line))" "def main(string): d = {} string = string.replace(' ', '') string = string.replace('{', '') string = string.replace('}', '') string = string.replace('>>', '') string = string.replace('<<', '') string = string.replace(',', '') string = string.replace('==>', '') string = string.replace('""', '') string = string.replace('#', '') arr = string.split(';') for x in range(len(arr) - 1): d[arr[x].partition('@')[2]] = int(arr[x].partition('@')[0]) return d" "def parse_tag(string): (key, value) = string[6:-7].strip().split('=') return (key.strip()[7:], int(value.strip()[1:-1])) def main(string): data = dict() for tag in string[1:-1].strip().split(','): tag = tag.strip() if tag != '': (key, value) = parse_tag(tag) data[key] = value return data" "def main(x): d = {} a = x.split('.end')[:-1] for i in a: (val, k) = i.split('->') k = k.strip().split(""'"")[1] val = val.split(')')[0].replace(' ', '') val = val.replace(""'"", '').replace('\n', '').split('(')[1].split(',') d[k] = val return d" "def main(s): s = s.replace('do(', '') s = s.replace('do (', '') s = s.replace(' od', '#') s = s.replace('\n', '') s = s.replace(').', '\n') s = s.replace('(localq', '') s = s.replace('localq', '') s = s.replace('(local q', '') s = s.replace('local q', '') s = s.replace(' ', '') s = s.replace('=:@', '\n') s = s.replace(')', '') s = s.replace('(', '') s = s.replace(""'"", '') str = '' dstr = '' d = {} j = 0 kstr = '' vstr = '' A = [] B = [] for i in s: if i != '\n': str += i else: dstr += str + ' ' j += 1 if j % 2 == 1: kstr = str else: vstr = str A.append(kstr) B.append(vstr) kstr = '' vstr = '' str = '' if i == '#': dictionary = dict(zip(B, A)) return dictionary" "import re def main(s): s = s.replace('\n', ' ') s = s.replace(' . ', ' ') pattern = 'set (.*?) is ?#\\( ?(.*?) ?\\)' parsed_s = re.findall(pattern, s) return {value: key.split() for (value, key) in parsed_s}" "def main(s): s = s.replace('begin ', '') s = s.replace('begin', '') s = s.replace('\ndeclare', '\n') s = s.replace('\n declare', '\n') s = s.replace('\n\ndeclare', '\n') s = s.replace('end', '\n') s = s.replace(' end', '\n') s = s.replace('\nend', '\n') s = s.replace(' declare\n', '') s = s.replace('declare ', '') s = s.replace(""declare'"", '') s = s.replace('declare\n', '') s = s.replace('\ndeclare ', '') s = s.replace('\ndeclare', '') s = s.replace('\ndeclare\n', '') s = s.replace(' declare ', '') s = s.replace(' declare', '') s = s.replace('declare', '') s = s.replace('declare', '') s = s.replace('\n', '\n') s = s.replace(' ', '\n') s = s.replace('', '\n') s = s.replace('\nto ', '\n') s = s.replace('\nto\n', '\n') s = s.replace(""'to\n"", '\n') s = s.replace(""' to\n"", '\n') s = s.replace(""'to "", '\n') s = s.replace(""' to "", '\n') s = s.replace(""'"", '') s = s.replace(' ', '') str1 = '' str2 = '' flag = 0 d = {} for i in s: if i != '\n' and flag == 0: str1 += i elif i == '\n' and flag == 0: flag = 1 continue if flag == 1 and i != '\n': str2 += i elif i == '\n' and flag == 1: flag = 0 d[str2] = str1 str1 = '' str2 = '' return d" "def main(s): s = s.replace('( || glob', '') s = s.replace('|| glob', '') s = s.replace('::={', '') s = s.replace('::= {', '') s = s.replace('::=', '') s = s.replace('@', '') s = s.replace(';||', '') s = s.replace('; ||', '') s = s.replace(',', '') s = s.replace(' ', '') s = s.replace('', '') s = s.replace('""""', '""') s = s.replace('""', '\n') s = s.replace('glob', '') s = s.replace(';', '') s = s.replace('|', '') s = s.replace('\n}', '}\n') s = s.replace('(', '') s = s.replace('{', '') answer = {} key = '' C = [] for i in s.split('\n'): if key == '': key = i else: C.append(i.replace('}', '')) if '}' in i: answer[key] = [element for element in C if element != ''] key = '' C = [] return answer" "def main(str): str = str.replace('\n', '') str = str.replace(' ', '') str = str.replace(""'"", '') spis0 = str.split(',') dict = {} for str in spis0[:len(spis0) - 1]: fi = str.find('(') se = str.find(')') str2 = str[fi + 1:se] str2 = str2.replace(""'"", '') spis = str2.split('.') fi = str.find('""') se = str.find('"".') str2 = str[fi + 1:se] dict[str2] = spis return dict" "def main(text): data = text.split('""') keys = [] values = [] for i in range(1, len(data)): if i % 2 != 0: keys.append(data[i]) else: values.append(data[i]) values = [x.split('`')[1].split('.')[0] for x in values] ans = {} for i in range(len(keys)): ans[keys[i]] = values[i] return ans" "import re def main(expr): expr = expr.replace(' ', '') expr = expr.replace('\n', '') first_part = re.findall('{[a-z]+_?\\d*#', expr) second_part = re.findall('#-?\\d*}.', expr) i = len(first_part) for k in range(i): first_part[k] = first_part[k].replace('{', '').replace('#', '') second_part[k] = second_part[k].replace('#', '').replace('}.', '') result = dict.fromkeys(first_part) for k in range(i): result[first_part[k]] = int(second_part[k]) return result" "def main(s: str): res = {} s = s.replace('\n', ' ') s = s.replace('to ', '%to%') s = s.replace(' ', '') s = s.replace('.|', '') s = s.replace('|', '') s = s.replace('[ ', '') s = s.replace(' ]', '') s = s.replace('[', '') s = s.replace(']', '') s = s.replace('opt', '') s = s.replace('opt ', '') s = s.replace(""'"", '') for el in s.split('.'): if 'to' in el: value = el.split('%to%')[0] key = el.split('%to%')[1] res[key] = value return res" "def main(s): ans = dict() s = s.strip('}}').strip('{{').strip().replace(') (', ')(').replace('\n', '').strip('(').strip(')').strip() s = [si.strip().strip('option').strip(';').strip().split('to') for si in s.split(')(')] for (nums, name) in s: nums = nums.replace(' ', '').strip('[').strip(']').strip() nums = list(map(int, nums.split('#')[1:])) ans[name.strip()] = nums return ans" "import re def main(x): result = {} keys = re.findall('(?<=make\\s)\\w+', x) values = re.findall('(?<=<-\\s)\\w+', x) for i in range(len(keys)): result[keys[i]] = values[i] return result" "def digital(s): n = len(s) i = 0 if s[0] == '-': i = 1 while i < n: if not s[i].isdigit(): s = s[:i] + s[i + 1:] i -= 1 n -= 1 i += 1 return s def main(s): result = {} slist = [] tstr = '' i = 0 k = 0 while s.find('{', i) != -1: i = s.find('{', i) k = s.find('}', i) tstr = s[i:k + 1] tlist = [] j = 0 z = 0 while tstr.find('#', j) != -1: j = tstr.find('#', j) z = min(tstr.find('.', j), tstr.find(']', j)) tlist.append(int(digital(tstr[j + 1:z]))) j += 1 j = tstr.find('>') z = tstr.find('.', j) tstr2 = tstr[j + 1:z].replace(' ', '') tstr2 = tstr2.replace('\n', '') result.update({tstr2: tlist}) i += 1 return result" "def main(string): string = string.replace('\n', ' ') keys = [] values = [] buffer = string.split(';') for st in buffer: if 'do store' in st: values += [''.join(st[st.find('do store') + 9:st.find('==>')]).strip()] if '==>' in st: keys += [''.join(st[st.find('==>') + 3:]).strip()] result = dict(zip(keys, values)) return result" "def main(str_): now = 0 end = 0 dic = {} str_ = str_.replace('\n', ' ') while end != -1: now = str_.find('auto', now) + 5 if str_.find(' ', now) < str_.find('=', now): end = str_.find(' ', now) else: end = str_.find('=', now) sval = str_[now:end] now = str_.find('q(', now) + 2 end = str_.find(')', now) skey = str_[now:end] dic[skey] = sval end = str_.find('<%', now) return dic" "def main(f): newf = f.split('loc') newf.pop(0) dictionary = {} for i in range(len(newf)): str1 = '' str2 = [] for j in range(len(newf[i])): str1 += newfunc1(newf[i][j]) if newf[i][j] in [' ', '\n'] and len(str1) != 0: str2.append(str1) str1 = '' elif newf[i][j] in [',', '}'] and len(str1) != 0: str2.append(str1) str1 = '' elif str1 == 'od': break dictionary.update({str2[len(str2) - 1]: str2[:len(str2) - 1]}) return dictionary def newfunc1(x): if x.isalpha() or x.isdigit(): return x elif x == '_': return x else: return ''" "import re def main(x): x = x.replace('\n', '') lst = [' ', '(', ')', '{', '}', ';'] for ch in lst: x = x.replace(ch, '') x = x[3:].split('loc') sup = [] for s in x: sup.append(list(filter(None, re.split('is(?!([a-z_]))', s)))) for i in range(len(sup)): sup[i][1] = sup[i][1].split('.') for j in range(len(sup[i][1])): sup[i][1][j] = int(sup[i][1][j]) d = {a: b for (a, b) in sup} return d" "import re def parse_value(x): return re.findall('\\w+', x) def main(x): result = {} keys = re.findall('(?<=var\\s)\\w+', x) values = re.findall('(?<=array\\()[^)]+', x) keys_values = [] for i in range(len(keys)): result[keys[i]] = parse_value(values[i]) return result" "def main(x): x = x.replace('<:', ' ').replace(':>', ' ').replace('(', ' ').replace(')', ' ').replace('.', ' ').replace('set', ' ').replace('#', ' ').replace('\n', ' ') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('|>') for i in x_parts] result = {} for i in x_parts1: value = int(str(i[0]).replace(' ', '')) key = str(i[1]).replace(' ', '') result[key] = value return result" "def main(x): stroka = x.strip().split(',')[:-1] stroka_ans = {} stroka_list = [] for i in stroka: i = i.replace('.begin', '').replace('let', '').replace('@', '').replace('.end', '').replace(""'"", '').replace('`', '').split('=') i[0] = i[0].strip() i[1] = i[1].strip() stroka_list.append(i) for i in stroka_list: stroka_ans[i[0]] = i[1] return stroka_ans" "def main(x): stroka = x.strip().split(';')[:-1] stroka_ans = {} stroka_list = [] for i in stroka: i = i.replace('\n', ' ').replace('do', '').replace('end', '').replace('\\', '').replace('begin', '').replace('option', '').replace('{', '').replace('}', '').replace('.', '').replace(';', '').split('=>') i[0] = i[0].strip() i[1] = i[1].strip() stroka_list.append(i) for i in stroka_list: i[0] = i[0].split(' ') for j in range(0, len(i[0])): i[0][j] = int(i[0][j]) stroka_ans[i[1]] = i[0] return stroka_ans" "import re def main(x): dir = {} for elem in x.split('end')[:-1]: name = elem.split('data')[1].split()[0] array = re.findall('#[0-9-]+', elem) dir[name] = [int(j[1:]) for j in array] return dir" "import re def main(input_str): c = 0 input_str = input_str.replace('\n', '').replace(' ', '') values = [x.replace('`', '').replace('==>', '') for x in re.findall('`\\w+==>', input_str)] keys = [x.replace(""'"", '') for x in re.findall(""'\\w+'"", input_str)] res_list = {} for key in keys: res_list[key] = values[c] c += 1 return res_list" "def main(s): lst_keys = [] lst_values = [] dct = {} c = s.count('val') for k in range(c): i = s.find('val') j = s.find('->') ii = s.find('`') jj = s.find('end') lst_values.append(s[i + 4:j - 1]) lst_keys.append(s[ii + 1:jj - 2]) s = s[jj + 5:] for i in range(len(lst_keys)): dct[lst_keys[i]] = lst_values[i] return dct" "def main(text): text = text.partition('\n')[0] + ' ' + text.partition('\n')[2] dict_sample = {} while len(text) > 0: text = text.partition('do glob ')[2] key = text.partition('<-')[0] if key == '': break key = key.strip() text = text.partition('<-')[2] value = text.partition('. end')[0] value = value.strip() dict_sample[key] = value return dict_sample" "def main(text): dict_sample = {} while text != 'end': text = text.partition('\n')[0] + ' ' + text.partition('\n')[2] text = text.partition('do set q')[2] key = text.partition('to')[0] if key == '': break key = key.strip() key = key.partition('(')[2] key = key.partition(')')[0] text = text.partition('to')[2] value = text.partition('done')[0] value = value.replace(""'"", '') value = value.replace(';', '') value = value.strip() dict_sample[key] = value return {y: x for (x, y) in dict_sample.items()}" "import re def main(expr): expr = expr.replace(' ', '') expr = expr.replace('\n', '') first_part = re.findall('/|>[a-z]+_?\\d*;', expr) second_part = re.findall('local[a-z]+_?\\d*|>`', expr) i = len(first_part) for k in range(i): first_part[k] = first_part[k].replace('>', '').replace(';', '') second_part[k] = second_part[k].replace('local', '') result = dict.fromkeys(first_part) for k in range(i): result[first_part[k]] = second_part[k] return result" "import re def main(s): D = {} s = s.replace('\n', ' ') d = re.findall('do\\s?(.*?)done', s) for i in d: (key, value) = i.split('<-') key = key.replace('do', '') key = key.replace(' ', '') value = value.replace('#', '') value = value.replace(' ', '') value = value.replace('.', '') D[key] = int(value) return D" "def main(text): text = text.replace('\n', ' ') text = text.replace(' ', ' ') text = text.replace('`', '') text = text.replace('( ', '(') text = text.replace('=: ', '=:') text = text.replace('new #', 'new#') res = dict() index = text.find('new#') while index != -1: text = text[index + 5:] tmp_l = text[:text.find(')')].replace(' ', '').split(';') name = text[text.find('=:') + 2:text.find('.')] res[name] = tmp_l index = text.find('new#') return res" "import re def main(str): str = str.replace('\n', ' ') keys = re.findall('auto q\\((\\w+)\\)', str) values = re.findall('#(-*\\d+)', str) for i in range(len(values)): values[i] = int(values[i]) return dict(zip(keys, values))" "import json def main(str): str = ''.join(str.split()) str = str.replace('do<<', '{""') str = str.replace('<=', '"": ""') str = str.replace('>>,<<', '"", ""') str = str.replace('>>,done', '""}') res = json.loads(str) return res" "import math def main(line): a = {} line = line.replace(' ', '') line = line.replace('""', '') line = line.replace('', '') line = line.replace('', '') line = line.replace('->', ',') line = line.replace('@', '') line = line.replace('loc', '') line = line.replace('((', '') line = line.replace('\n', '') line = line.replace('))', '') line = line.replace('#', '') line = line[:-1] line = line.split(',') for i in range(1, 2 * len(line), 4): a[line[math.ceil(i / 2)]] = line[math.floor(i / 2)] return a" "def main(x): x = x.replace('begin', '').replace('end', '').replace('#', '').replace('variable', '').replace('(', '').replace(')', '').replace(';', '').replace('\n', '').replace('done', '').replace('do', '').replace('data', '') x_parts = x.split(',') x_parts1 = [i.split('==>') for i in x_parts] x_parts1.pop(-1) result = {} for i in range(len(x_parts1)): value = int(x_parts1[i][0]) key = x_parts1[i][1].replace(' ', '') result[key] = value return result" "def main(x): x = x.replace('decl', '').replace('|', '').replace('#', '').replace(""'"", '').replace('\n', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('>') for i in x_parts] result = {} for i in range(len(x_parts1)): value = int(x_parts1[i][0]) key = x_parts1[i][1].replace(' ', '') result[key] = value return result" "def main(s: str): res = {} s = s.replace('[[', '') s = s.replace(']]', '') s = s.replace('\n', '') s = s.replace('\\begin', '') s = s.replace('\\end', '') s = s.replace('loc #', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace('=:', '') li = s.split(';')[:-1] for i in li: i = i.split('@') va = i[0].strip().split('#') ll = [] for v in va: try: ll.append(int(v.strip())) except ValueError: pass res[i[1][1:-1]] = ll return res" "def main(s): i = 0 ans = {} i = s.find('var') while i != -1: i += 3 s = s[i:] r = s.find('=') value = s[0:r].strip() semi = s.find(';') key = s[r + 3:semi].strip() ans[key] = value i = s.find('var') return ans" "def main(x): x = x.replace('done', '').replace(' od', '').replace('od ', '').replace('do ', '').replace(' do', '').replace('let ', '').replace('`', '').replace('od\n', '').replace('do\n', '').replace('let\n', '').replace('\n', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split(' to ') for i in x_parts] result = {} for i in range(len(x_parts1)): value = x_parts1[i][0].replace(' ', '') key = x_parts1[i][1].replace(' ', '') result[key] = value return result" "def main(x): x = x.replace('begin', '').replace('', '').replace('', '').replace('#', '').replace('store', '').replace('end', '').replace('#', '').replace('\n', '').replace(' ', '').replace('.', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('to') for i in x_parts] result = {} for i in x_parts1: value = int(i[0]) key = i[1] result[key] = value return result" "def main(x): x = x.replace('global', '') x = x.replace(':', '') x = x.replace(';', '') x = x.replace('>', '') x = x.replace('.', '') x = x.replace(""'"", '') x = x.replace('<', '') x = x.replace('\n', '') x = x.replace('<', '') x = x.replace('[', '') x = x.replace(']', '') x = x.replace('=', '') x = x.replace('@', ' ') x = x.split(' ') str_list = list() for i in x: if len(i) > 1: str_list.append(i) names = list() keys = list() for i in str_list: if (str_list.index(i) + 1) % 2 == 0: names.append(i) else: keys.append(int(i)) fruit_dictionary = dict(zip(names, keys)) return fruit_dictionary" "def main(x): otvet = {} fdefine = x.find('define') + 7 x = x[fdefine:] x = x.replace('\n', ' ') x = x.split('define ') for i in x: key = '' key = i[:i.find(':')] if key[-1] == ' ': key = key.replace(' ', '') q = i[i.find('(') + 1:i.find(')')] q = q.replace(' ', '')[1:].replace('.', '') q = q.split('#') q = [int(x) for x in q] otvet.update({key: q}) return otvet" "import re def main(str): str = str.replace(' ', '') str = str.replace('\n', '') second = re.findall('(?<=\\{)([\\s\\S]+?)(?=\\})', str) first = re.findall('(?<=def)([\\s\\S]+?)(?=\\<)', str) array = [] for i in range(len(second)): second[i] = second[i].replace('#', '') second[i] = second[i].replace(' ', '') abc = second[i].split(',') new_a = [] for j in abc: new_a.append(int(j)) array.append(new_a) result = {} for i in range(len(first)): result.update({first[i]: array[i]}) return result" "def main(a): a0 = a.strip() a1 = a0.replace('(', ' ') a2 = a1.replace(')', ' ') a3 = a2.replace('option', '') a4 = a3.replace('{', ' ') a5 = a4.replace('}', ' ') a6 = a5.replace('}', ' ') a7 = a6.replace('==>', ' ') listline = a7.split() data = {} value = [] for list in listline: if list.find('@') == -1: val1 = list.replace('#', ' ') val2 = val1.split() for val in val2: value.append(int(val)) else: a8 = list.replace('@', '') key = a8.replace('""', '') data[key] = value value = [] return data" "def main(line): new_line = line.split('loc') dict = {} for i in range(1, new_line.__len__()): value_key = new_line[i].split('to `') if len(value_key) == 1: value_key = value_key = new_line[i].split('to\n`') value_key[0] = value_key[0][1:len(value_key[0]) - 1] for j in range(len(value_key[1])): if value_key[1][j] == ' ' or value_key[1][j] == '|': value_key[1] = value_key[1][0:j] break dict.setdefault(value_key[1], value_key[0]) return dict" "def main(s): result = {} s = s[2:-2] s = s.replace('begin', '').replace('end', '').replace('list', '') s = s.replace(' ', '').replace('opt', '') s = s.replace('\n', ' ').replace('\t', ' ').replace('|> ', '|>') l_s = s.split('.')[:-1] for i in l_s: key_value = i.split('|>') value_list = key_value[0].split(' ') kol = value_list.count('') for i in range(kol): value_list.remove('') if value_list.count(')') != 0: value_list.remove(')') if value_list.count('(') != 0: value_list.remove('(') for z in range(len(value_list)): if value_list[z][len(value_list[z]) - 1:] == ')': value_list[z] = value_list[z][:-1] if value_list[z][:1] == '(': value_list[z] = value_list[z][1:] if key_value[1][0:1] == ' ': key_value[1] = key_value[1][1:] result[key_value[1]] = value_list return result" "def main(x): res = {} x = x[2:-2] x = x.replace('data', '').replace('to', '') x = x.replace('(', ' ').replace(')', ' ') x = x.replace(' ', ' ') x = x.replace('\n', ' ') x = x.replace('\t', ' ') block = x.split(';')[:-1] for i in block: rest = i.split(' q ') for j in range(len(rest)): rest[j] = rest[j].replace(' ', '').replace('\n', '') rest[j] = rest[j].replace('\t', '') res[rest[1]] = rest[0] return res" "def main(str): str = str.replace(' ', '') str = str.replace('\n', '') str = str.replace(',', '') result = {} i = 0 while i < len(str): resource = '' if str[i] == '{' and str[i + 1] == '#': i += 2 while str[i] != '}': resource += str[i] i += 1 list1 = resource.split('#') list_num = [int(item) for item in list1] if str[i] == '=' and str[i + 1] == '>': i += 2 key = '' while str[i] != '.': key += str[i] i += 1 result[key] = list_num i += 1 return result" "def main(text): text = text.replace('\n', '') text = text.replace(' ', '') text = text.replace('<:', '') text = text.replace(':>', '') text = text.replace(';', '') text = text.replace('=:', '♂') text = text.split('glob`') text = text[1:] result = {} for i in range(len(text)): text[i] = text[i].split('♂') result = {text[i][1]: text[i][0] for i in range(len(text))} return result" "def main(x): x = x.replace('', '').replace('variable', '').replace('', '').replace('.', '').replace('{', '').replace('\n', '').replace(' ', '') x_parts = x.split('}') x_parts.pop(-1) x_parts1 = [i.split('<==') for i in x_parts] result = {} for i in x_parts1: key = i[0] value = int(i[1]) result[key] = value return result" "import re def main(s): D = {} s = s.replace('\n', ' ') d = re.findall('#\\s?(.*?)]', s) for i in d: (key, value) = i.split('->') key = key.replace(' ', '') value = value.replace('q(', '') value = value.replace(')', '') value = value.replace('.', '') value = value.replace(' ', '') D[value] = int(key) return D" "import re def main(string): Dict = {} arr = string.split(';') for x in range(len(arr) - 1): arr[x] = arr[x].partition('decl')[2] reg = re.compile('[^a-zA-Z0-9+=+<+_]') arr[x] = reg.sub('', arr[x]) values = arr[x].split('<=') Dict[values[0]] = values[1] return Dict" "def main(x): otvet = {} x = x.replace('[', '') x = x.replace(']', '') x = x.replace('\n', ' ') x = x.replace('.', '') x = x.replace('', '') x = x.replace('glob q', '') x = x.replace('to', ' ') x = x.replace('""', ' ') x = x.replace('', ' ') x = x.replace('(', ' ') x = x.replace(')', ' ') x = x.replace(""'"", ' ') x = x.replace(' equ ', '') x = x.split(' ') arg_1 = '' arg_2 = '' for i in x: if arg_1 == '' and i != '': arg_1 = i elif arg_2 == '' and i != '': arg_2 = i if arg_1 != '' and arg_2 != '': otvet[arg_2] = arg_1 arg_2 = '' arg_1 = '' return otvet" "def main(s): result = {} arr = s.replace('\n', '').replace('', '').replace('<:', '').replace(' ', '').replace(':>', '').replace('.', '').replace('', '').replace('glob', '').split(',') for e in arr: if len(e) > 2: t_arr = e.split('<==') nums = t_arr[1].replace('{', '').replace('}', '').split(';') temp = [int(num) for num in nums] result[t_arr[0].replace(' ', '')] = temp return result" "def main(x): x = x.replace('', '').replace('\n', ' ').replace(' ', '').replace('(', '').replace(')', '').replace('#', '').replace('', '').replace('store', '').replace('<-', ';') x = x.split(';') del x[-1] s1 = [] for i in range(len(x)): if i % 2 != 0: x[i] = x[i].split('.') for k in range(len(x[i])): x[i][k] = int(x[i][k]) else: s1.append(x[i]) for p in range(len(s1)): x.remove(s1[p]) return dict(zip(s1, x))" "import re def main(x): result2 = dict() result = re.findall('\\{\\{([^{}]+)\\}\\}', x) for i in range(len(result)): result2[result[i][result[i].find('@') + 2:result[i].find(';') - 1].replace(' ', '')] = result[i][result[i].find('l') + 6:result[i].find('=')].replace(' ', '').replace('\n', '') return result2" "def main(line): a = {} line = line.replace('\n', '') line = line.replace('define array', '') line = line.replace(' ', '') line = line.replace('{{', '') line = line.replace('}}', '') line = line.replace('', '') line = line.replace('.', '|') line = line.replace('->', ':') line = line.replace('.', ',') line = line.replace('=:', ':') line = line.replace('(', '') line = line.replace(')', '') line = line[:-1] line = line.split('|') for i in range(len(line)): line[i] = line[i].split(':') line[i][0] = line[i][0].split(',') a[line[i][1]] = line[i][0] return a" "def main(string): string = string.replace('\n', ' ') keys = [] values = [] string = string.replace('block', '') buffer = string.split('}') for st in buffer: if 'loc' in st: keys += [''.join(st[st.find('loc') + 3:st.find('::=')]).replace('""', '').strip()] if '::=' in st: values += [''.join(st[st.find('::=') + 3:]).strip()] result = dict(zip(keys, values)) return result" "def main(string): string = list(string) result = {} keys = [] items = [] for i in range(len(string)): if string[i] == '#': item = '' while string[i + 1] != '=': i += 1 item += string[i] items.append(int(item.strip())) if string[i] == '>' and string[i - 1] != '%': key = '' while string[i + 1] != '.': i += 1 key += string[i] keys.append(key.strip()) for i in range(len(keys)): result[keys[i]] = items[i] return result" "import re as e def main(text): r = e.findall(""\\s?
.*?\\s?@'(.*?)'\\s?<==\\s?(.*?);\\s?
"", text, e.M) dct = {} for tch in r: (name, numbers) = tch dct[name] = numbers return dct" "import re def main(inp_str): values = dict() pattern1 = re.compile('{([^{}]+)}') entries = pattern1.match(inp_str).group(1).split('.') entries.pop() for entry in entries: patt = ""<%(\\s)?`(\\w+[_\\d+]?)(\\s)?->(\\s)?@\\'(\\w+[_\\d+]?)\\';(\\s)?%>"" pattern = re.compile(patt) match = pattern.match(entry.strip()) values[match.group(5)] = match.group(2) return values" "def foo7(i, st): num = '' while (st[i] > '9' or st[i] < '0') and st[i] != '-': i += 1 num += st[i] i += 1 while st[i] <= '9' and st[i] >= '0': num += st[i] i += 1 while (st[i] > '9' or st[i] < '0') and st[i] != '-' and (st[i] != ')'): i += 1 return [int(num), i] def foo6(st): it = 0 arr = [] while st[it] != '(': it += 1 it += 1 while len(st) > it and st[it] != ')' and (st[it] != ';'): p = foo7(it, st) arr.append(p[0]) it = p[1] return arr def foo5(st): it = 0 temp = '' while st[it] != ' ' and st[it] != '\n': temp += st[it] it += 1 return temp def foo4(it, end, st): if it == end: return '' temp = '' while it != end: temp += st[it] it += 1 return temp def foo3(st, it): while it < len(st) and (not (st[it] == 'e' and st[it + 1] == 'n' and (st[it + 2] == 'd') and (st[it + 3] == '.'))): it += 1 if it == len(st): return it return it + 4 def foo2(st, it): while it < len(st) and (not (st[it] == 'l' and st[it + 1] == 'o' and (st[it + 2] == 'c') and (st[it + 3] == ' ' or st[it + 3] == '\n'))): it += 1 if it == len(st): return it return it + 4 def foo1(st): i = 0 end = 0 three_lines = [] while i < len(st): i = foo2(st, i) end = foo3(st, i) three_lines.append(foo4(i, end, st)) if three_lines[len(three_lines) - 1] == '': three_lines.pop(len(three_lines) - 1) name = '' nums = [] my_dict = {} i = 0 while i < len(three_lines): name = foo5(three_lines[i]) nums = foo6(three_lines[i]) my_dict.setdefault(name, nums) i += 1 return my_dict def main(st): return foo1(st)" "def main(s): s = s.replace('\n', ' ') name = '' dog = [] colon = [] for i in range(0, len(s)): if s[i] == '@': j = i + 2 while s[j] != '""': name = name + s[j] j += 1 dog.append(name) name = '' if s[i] == ':': j = i + 1 while s[j] != '.': if s[j] != ' ': name = name + s[j] j += 1 else: j += 1 name.strip() colon.append(name) name = '' return dict(zip(dog, colon))" "def main(data_string: str): data_arr = data_string.replace(' ', '').replace('\n', '').replace('(', '').replace(')', '')[6:-8].split(';') dict = {} for i in data_arr: (data, key) = i.split('|>') data = data.replace('option', '') dict.update({key: int(data)}) return dict" "import re def main(data): data = data.replace('\n', '').replace(' ', '').replace('#', '') keys = re.findall(""'(.*?)'"", data) vals = re.findall('\\[(.*?)\\]', data) result = dict() i = 0 for key in keys: vals[i] = vals[i].split('.') for j in range(len(vals[i])): vals[i][j] = int(vals[i][j]) result[key] = vals[i] i += 1 return result" "block_begin = '' block_end = '' set_begin = 'do set' set_op = '<=' set_end = 'end' def main(arg): _str = str(arg) if not (block_begin and block_end) in _str: return _str = _str.replace('\n', ' ') main_dict = {} sub_str = _str.split(set_begin) for a in sub_str: sep = a.split('""') if len(sep) > 1: sep[2] = sep[2][:sep[2].index(']') + 1] sep[2] = sep[2].replace('[', '') sep[2] = sep[2].replace(']', '') sep[2] = sep[2].replace(set_op, '') sep[2] = sep[2].strip(' ') main_dict[sep[1]] = [int(x) for x in sep[2].split(' ')] return main_dict" "def main(x): res = {} ks = [] values = [] prepare_keys = x.replace(' ', '').split('|>') prepare_values = x.replace(' ', '').split('val') for i in range(1, len(prepare_keys)): ks.append(prepare_keys[i].split(']]')[0].replace('\n', '').replace('.', '')) for i in range(1, len(prepare_values)): values.append(prepare_values[i].split('|>')[0].replace('\n', '')) for i in range(0, len(ks)): res[ks[i]] = values[i] return res" "def main(x): res = {} keys = [] values = [] prepare_keys = x.replace(' ', '').split('make') for i in range(1, len(prepare_keys)): keys.append(prepare_keys[i].split('is[')[0].replace('\n', '')) prepare_values = x.replace(' ', '').replace(']', '[').split('[') for i in range(1, len(prepare_values), 2): values.append(prepare_values[i].replace('\n', '').split(';')) for i in range(0, len(keys)): res[keys[i]] = values[i] return res" "import re def main(_str): nums = [] words = [] _str = re.sub('\n', ' ', _str) _list = re.findall(""[-]?\\d*\\s*->\\s*[']\\w*[\\W*_]*\\d*[']"", _str) for item in _list: line = re.split('\\s?[-][>]\\s?', item) words.append(line[1][1:-1]) nums.append(int(line[0])) dc = dict(zip(words, nums)) return dc" "def a(q, x, y, z, name, d, data): while q[y + 1] != ';': y += 1 name = q[z:y + 1] d.setdefault(name, data) return d def main(q): q = q.replace(' ', '') q = q.replace('\n', '') d = {} x = 0 z = 0 name = '' data = [] for y in range(len(q) - 1): if q[x:y] == '(decl{': x = y if q[y - 1] == '#': z = y while q[z + 1] != '}' and q[z + 1] != '.': z += 1 data.append(int(q[y:z + 1])) y = z x = z if q[y] == '=' and q[y + 1] == '=' and (q[y + 2] == '>'): y += 3 x = y z = y d = a(q, x, y, z, name, d, data) data = [] z += 1 y += 1 if q[y] == ',': x = y + 1 y = x return d" "import re def f(x): for i in range(1, len(x)): x = x.replace('q(', ' ') x = x.replace(')', ' ') x = re.split('\\|>', x) res_dict = {} for i in range(1, len(x)): res_dict.setdefault(x[i].split()[0], x[i - 1].split()[-1]) return res_dict def main(x): return f(x)" "def main(x): y = '' y = x.replace('<:', '') y = y.replace(':>', '') y = y.replace('=>', '') y = y.replace('variable', '') y = y.replace(',', '') y = y.replace(';', '') y = y.replace('\\', '') y = y.replace('nvariable', '') z = y.split() f = {} for i in range(len(z) // 2): f.update({z[i * 2 + 1]: int(z[i * 2])}) return f" "def main(s): s = s.replace(' ', '') s = s.replace('\n', '') initial_seq = False final_seq = False is_key = False s2 = '' lst = [] d = {} i = 0 while i < len(s): value_first_i = s.find('""', i) value_second_i = s.find('""', value_first_i + 1) key_first_i = s.find(""'"", i) key_second_i = s.find(""'"", key_first_i + 1) if value_first_i != -1 and value_second_i != -1 and (value_second_i < key_first_i) and (value_first_i != -1) and (key_first_i != -1): s2 = s[value_first_i + 1:value_second_i] lst.append(s2) is_key = False i = value_second_i + 1 continue if key_first_i != -1 and key_second_i != -1: s2 = s[key_first_i + 1:key_second_i] d[s2] = lst lst = [] i = key_second_i + 1 else: break i = i + 1 return d" "def main(x): x = x.replace('do ', '').replace('do', '').replace('|', '').replace('glob ', '').replace('glob\n', '').replace('glob', '').replace('array', '').replace('\n', '').replace('(', '').replace('""', '').replace(')', '').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split(':') for i in x_parts] result = {} for i in x_parts1: key = i[0] value = i[1].split('.') for j in range(len(value)): value[j] = int(value[j]) result[key] = value return result" "import re def main(s): p = re.findall('#\\(([^\\)]*)\\)\\s*=:\\s*(\\w*)', s) result = {} for e in p: d = e[0].split(';') for i in range(len(d)): d[i] = int(d[i].strip()) result[e[1]] = d return result" "import re def main(s): p = re.findall('\\s*\\.do\\s*\\@""([^\\""]*)""\\s*\\:=\\s*([^\\s]*)\\s\\.end\\s*', s) result = {} i = 0 for e in p: result[e[0]] = int(p[i][1]) i = i + 1 return result" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('\\beginbegindata', '') s = s.replace('.end\\end', '') s = s.replace('`', '') s = s.replace('[', '') s = s.replace(']', '') for el in s.split('.endbegindata'): (key, value) = el.split('<-') res[key] = value.split(',') return res" "def main(line): d = dict() line = line[2:len(line) - 3] line = line.split(',') if line[len(line) - 1] == '': line.pop(len(line) - 1) for i in range(len(line)): line[i] = str(line[i])[line[i].find('#') + 1:line[i].find('od') - 1] for i in range(len(line)): line[i] = line[i].split('`') line[i][0] = int(line[i][0][0:len(line[i][0]) - 4]) d.update({line[i][1]: line[i][0]}) return d" "def main(x): x = x.replace('
', '').replace('%', '').replace('
', '').replace('<', '').replace('>', '').replace('auto', '').replace('q(', '').replace('(', '').replace(')', '').replace(',', '').replace('#', '').replace('\n', '').replace(' ', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('==') for i in x_parts] result = {} for i in x_parts1: key = i[1] value = int(i[0]) result[key] = value return result" "import re def main(text): pattern = '
\\s*val\\s*(?P-?\\d+)\\s*to\\s*\\""(?P\\w*)\\""\\s*;\\s*<\\/section>' pattern = re.compile(pattern) matches = pattern.findall(text) return {a[1]: int(a[0]) for a in matches}" "def main(x): x = x.replace('|', '').replace('auto', '').replace('#', '').replace('`', '').replace('{', '').replace('}', '').replace('.', '').replace('\n', '').replace(' ', '') x_parts = x.split(',') x_parts.pop(-1) x_parts1 = [i.split('==>') for i in x_parts] result = {} for i in x_parts1: key = i[1] value = int(i[0]) result[key] = value return result" "import re def main(x): x = re.split(' *=>', x) res_dict = {} for i in range(1, len(x)): res_dict.setdefault(re.split(' *<', x[i].split()[0])[0], x[i - 1].split()[-1][2:-1:1]) return res_dict" "def main(w): s = w.replace('', '').replace('', '').replace(' is ', '').replace('(', '').replace(')', '').replace('\n', ' ') s = s.replace('is ', '').replace('option @', '').replace(' ', '') s = s[:len(s) - 1] lst = s.split('.') res = {} for item in lst: item = item[1:] key = item[0:item.find(""'"")] value = item[item.find(""'"") + 1:] res.update({key: value}) return res" "def main(x): st1 = x.replace('[', '').replace(']', '').replace('\n', '') st2 = st1.split('.end,') ret = {} k = 0 for st in st2: st2[k] = st2[k].replace('.begin', '').replace('opt', '') st2[k] = st2[k].replace('@', '').replace(' ', '') st2[k] = st2[k].replace('""', '').replace('==>', ' ') st2[k] = st2[k].replace('q(', '').replace(')', '') st2[k] = st2[k].replace(';', '') if st2[k] != '': nam = st2[k].split(' ') ret[nam[1]] = nam[0] k += 1 return ret" "def main(x): st1 = x.replace('', '').replace('', '').replace('\n', '') st2 = st1.split(',') ret = {} k = 0 for st in st2: st2[k] = st2[k].replace('def', '').replace('{{', '') st2[k] = st2[k].replace('}}', '').replace('""', '') st2[k] = st2[k].replace('@', '').replace('>', ' ') st2[k] = st2[k].replace('.', '').replace(' ', '') if st2[k] != '': nam = st2[k].split('|') ret[nam[1]] = nam[0] k += 1 return ret" "import re def main(x): regex_keys = re.compile('[""][a-zA-Z0-9_]+[""]') x = x.replace('\n', ' ') x = x.replace('[', '{') x = x.replace(']', '}') keys = regex_keys.findall(x) xuy = x.split(';') values_result = list() j = 0 for i in xuy[j]: regex_values = re.compile('{.*}') values = regex_values.findall(xuy[j]) test = values[0].split('.') values_result.append(test) j += 1 if j == len(xuy) - 1: break for i in values_result: for j in range(len(i)): i[j] = i[j].replace(' ', '') i[j] = i[j].replace('.', '') i[j] = i[j].replace('{', '') i[j] = i[j].replace('}', '') i[j] = int(i[j]) for i in range(len(keys)): keys[i] = keys[i].replace('""', '') result = dict(zip(keys, values_result)) return result" "def main(x): x = x.replace('[', '').replace(']', '').replace('.begin', '').replace('list', '').replace('(', '').replace(')', '').replace('.end', '').replace('.', '').replace('\n', '').replace(' ', '').replace('|>q', ' ').replace('|> q', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split(' ') for i in x_parts] result = {} for i in x_parts1: key = i[1] value = i[0].split(',') result[key] = value return result" "import re def main(string): Dict = {} arr = string.split('.') for x in range(len(arr) - 1): part = arr[x].split('{')[1].split('}') result = part[0].split() reg = re.compile('[^-a-zA-Z0-9+_+>]') arr[x] = reg.sub('', arr[x]) values = arr[x].split('->') Dict[values[1][:-2]] = result return Dict" "def main(x): st1 = x.replace('', '').replace('', '').replace('\n', '') st2 = st1.split('.') ret = {} k = 0 for st in st2: st2[k] = st2[k].replace('{', '').replace('}', '') st2[k] = st2[k].replace('glob', '').replace(' ', '') st2[k] = st2[k].replace(""'"", '').replace('==>', ' ') st2[k] = st2[k].replace('""', '').replace(';', '') if st2[k] != '': nam = st2[k].split(' ') ret[nam[1]] = nam[0] k += 1 return ret" "import re def main(arg): start_end = '\\|\\|*' key_regex = '\\s*<<\\n*\\s*glob\\s' assign = '\\s*<=\\s*list\\(\\s*' start_list = '`\\w+\\s' start_list_bad = '`\\w+\\)' start_list_ultra_bad = '`\\w+\\)\\s' end_of_key = '\\)?\\s*>>,\\s*' ans = {} arg = re.sub(start_end, '', arg) while len(arg) != 0: list_of_values = [] result = re.match(key_regex, arg) arg = arg[result.end():] result = re.search(assign, arg) key = arg[:result.start()] arg = arg[result.end():] while (arg[0] != ')') & (arg[0] != '>'): result = re.match(start_list, arg) if result is not None: list_of_values.append(arg[result.start() + 1:result.end() - 1]) arg = arg[result.end():] else: result = re.match(start_list_ultra_bad, arg) if result is not None: temp = arg[result.start() + 1:result.end() - 2] list_of_values.append(temp) arg = arg[result.end():] else: result = re.match(start_list_bad, arg) temp = arg[result.start() + 1:result.end() - 1] list_of_values.append(temp) arg = arg[result.end():] ans[key] = list_of_values result = re.match(end_of_key, arg) arg = arg[result.end():] return ans" "def main(input_data): d = {} str = '' check = -1 data = '' for i in range(len(input_data)): if input_data[i] == '#': j = i while (input_data[i] != ' ') & (input_data[i] != '\n'): i += 1 data += input_data[j + 1:i] if input_data[i] == '""': check *= -1 if (input_data[i] == '""') & (check == 1): i += 1 while input_data[i] != '""': str += input_data[i] i += 1 d[str] = int(data) str = '' data = '' return d" "def main(x): x = x.replace('', '').replace('
', '').replace('', '').replace('
', '').replace('glob ', '').replace('glob\n', '').replace(',', '').replace('@', '').replace('""', '').replace('\n', ' ') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split(' to ') for i in x_parts] result = {} for i in x_parts1: value = int(i[0].replace(' ', '')) key = i[1].replace(' ', '') result[key] = value return result" "import re def main(text): text = text.replace(' ', '').replace('\n', '') keys = re.findall('""(.*?)""', text) val = re.findall('\\((.*?)\\)', text) res = dict() for i in range(len(val)): res[keys[i]] = val[i].replace('`', '').split('.') return res" "def main(str): values = [] keys = [] str = str.replace(' ', '') str = str.replace('\n', '') str = str.replace('((<%data@""', '') str = str.replace('"".%>,))', '') str = str.replace('""|>""', ' ') str = str.replace('"".%>,<%data@""', ' ') sl = str.split(' ') n = len(sl) for i in range(0, n, 2): values.append(sl[i]) for i in range(1, n, 2): keys.append(sl[i]) d = dict(zip(keys, values)) return d" "import re def main(x): keys = re.findall('""(.*?)""', x) d = {keys[i]: [] for i in range(len(keys))} for i in range(len(keys)): start_a = x.find('(') end_a = x.find(')') temp_str = x[start_a + 1:end_a].replace(' ', '').split(';') for j in temp_str: d[keys[i]].append(int(j)) x = x[end_a + 1:] return d" "import re def main(arg): start = '\\s*do\\s*' end = '\\s*od\\s*' key_regex = '\\s*{\\n*\\s*global\\s*""' assign = '\\s*""\\s*=:\\s*' start_list = ""@'\\w+'"" start_list_bad = ""@'\\w+'\\s"" start_list_ultra_bad = '`\\w+\\)\\s' end_of_key = '\\s*},\\s*' ans = {} arg = re.sub(start, '', arg) arg = re.sub(end, '', arg) while len(arg) != 0: list_of_values = 'a' result = re.match(key_regex, arg) arg = arg[result.end():] result = re.search(assign, arg) key = arg[:result.start()] arg = arg[result.end():] while arg[0] != '}': result = re.match(start_list_bad, arg) if result is not None: list_of_values = arg[result.start() + 2:result.end() - 2] arg = arg[result.end():] else: result = re.match(start_list_ultra_bad, arg) if result is not None: temp = arg[result.start() + 1:result.end() - 2] list_of_values = temp arg = arg[result.end():] else: result = re.match(start_list, arg) temp = arg[result.start() + 2:result.end() - 1] list_of_values = temp arg = arg[result.end():] ans[list_of_values] = key result = re.match(end_of_key, arg) arg = arg[result.end():] return ans" "def main(x): slovar = {} while x.find('[') != -1: a = x[x.find('define') + 7:x.find('=')] a = a.strip() b = x[x.find('>') + 1:x.find(';')] b = b.strip() slovar[b] = int(a) x = x[x.find(']') + 1:] return slovar" "def main(x): result = {} x = x[x.find('decl') + 5:].replace('\n', ' ') x = x.split('decl ') for i in x: key = i[i.find(""'"") + 1:i.find('<')].replace(' ', '').replace(""'"", '') meaning = i[:i.find('|')].replace(' ', '') result.update({key: meaning}) return result" "import re def main(a): exr1 = '\\s*new\\s*([A-Za-z0-9_]+)\\s*to\\s*\\\\*([A-Za-z0-9_]*)\\s*' matches = re.findall(exr1, a) d = {} for match in matches: key = match[1] d[key] = match[0] return d" "import re def main(string): name_pattern = '(?:loc[\n ][a-zA-Z0-9_]+)' value_pattern = '(?:#[-0-9,\\n #]+)' name_result = re.findall(name_pattern, string) value_result = re.findall(value_pattern, string) for i in range(len(name_result)): name_result[i] = name_result[i][4:] for i in range(len(value_result)): value_result[i] = value_result[i].replace('#', '') value_result[i] = value_result[i].replace(' ', '') value_result[i] = value_result[i].split(',') value_result[i] = [int(x) for x in value_result[i]] return dict(zip(name_result, value_result))" "def main(str): value = '' key = '' sum = 0 d = dict() j = 0 numbers = ['-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'] for i in range(len(str)): if str[i] == ""'"": sum += 1 if str[i] in numbers and sum % 2 == 0: value += str[i] if sum % 2 != 0 and str[i] != ""'"": key += str[i] if str[i] == ';': value += ' ' key += ' ' mas_v = value.split() mas_k = key.split() d[mas_k[j]] = int(mas_v[j]) j += 1 return d" "def main(s): s = s.replace('\n', '') s = s[1:-1] a = s.split('||') a = a[1:-1] a_names = [] a_contents = [] dct = {} for i in a: if i.find(',') == -1: tmp = i.replace('auto', '').replace(' ', '').replace(';', '') a_names.append(tmp[0:tmp.find('<')]) a_contents.append(i[i.find('[') + 1:i.find(']')].replace(' ', '').split('.')) for key in range(len(a_names)): dct[a_names[key]] = a_contents[key] return dct" "import re def main(inp): p1 = 'option\\s[A-Za-z0-9_]+' p2 = '\\s-?\\d+' matches1 = re.findall(pattern=p1, string=inp) matches2 = re.findall(pattern=p2, string=inp) responce = {} for i in range(len(matches1)): matchs = re.split(pattern='\\s', string=matches1[i]) responce[matchs[1]] = int(matches2[i]) return responce" "import re def main(input_str): result = {} input_str = input_str.replace(' ', '') key = re.findall('q\\((.*?)\\)=', input_str) value = re.findall('@""(.*?)""', input_str) for i in range(len(key)): result[key[i]] = value[i] return result" "def main(w): s = w.replace('do<%', '').replace('<% local ', '').replace(' to ', '').replace('`', '').replace('%>', '').replace('\n', ' ').replace('<% ', '').replace('done ', '').replace(' local ', '').replace(',n', '') s = s.replace('to ', '').replace(' %>', '').replace(' ', '').replace('local', '').replace(';', '').replace('done', '').replace('do <% ', '').replace('do', '') s = s[:len(s) - 1] lst = s.split(',') res = {} for item in lst: item = item[1:] key = item[0:item.find('""')] value = item[item.find('""') + 1:] res.update({value: key}) return res" "import re def main(x): slovar = {} x = re.split('glob', x) x.pop(0) mas1 = [] mas = [] for i in range(0, len(x) - 1): if len(x[i]) < 9: del x[i] znach = [] for i in range(0, len(x)): result = x[i].split('q(') result_temp = re.split('end', result[-1]) result_temp.pop(-1) result[-1] = result_temp[0] znach.append(''.join(re.findall('\\w', result[0]))) mas1 = result[1:] for j in range(0, len(mas1)): mas.append(''.join(re.findall('\\w', mas1[j]))) slovar[znach[i]] = mas.copy() mas.clear() return slovar" "def main(x): st1 = x.replace('{', '').replace('}', '').replace('\n', '') st2 = st1.split('.') ret = {} k = 0 for st in st2: st2[k] = st2[k].replace('', '').replace('', '') st2[k] = st2[k].replace('opt', '').replace(' ', '') st2[k] = st2[k].replace(';', '').replace('#', ' ') st2[k] = st2[k].replace('::=', '') if st2[k] != '': nam = st2[k].split(' ') ret[nam[0]] = int(nam[1]) k += 1 return ret" "from typing import Dict def obtain_word(string) -> str: name = '' chars = '\n\t][ #\x08\r\x00.,()' while string[0] not in chars: name += string[0] string = string[1:] return name def main(string: str) -> Dict: result: Dict = {} string += '#END' while string: symbol = string[0] word = string[0:3:1] second_word = string[0:4:1] blank = string[3] if word == 'new' and (blank == ' ' or blank == '\n'): string = string[3:] elif second_word == 'list': string = string[4:] string = string.strip() string = string[1:] string = string.strip() names_arr = [] while string[0] != ')': name = obtain_word(string) string = string[len(name):] string = string.strip() if string[0] != ')': string = string[1:] names_arr.append(name) string = string.strip() elif symbol == '=': string = string[1:] string = string.strip() string = string[1:] string = string.strip() element_name = obtain_word(string) string = string[len(element_name):] string = string.strip() string = string[1:] result.update({element_name: names_arr}) elif second_word == '#END': break string = string[1:] return result" "import re def main(source): pattern = '\\D\\bdata\\D(\\d*|.\\d*)\\D\\bto\\D(\\w*)' parsed_s = re.findall(pattern, string=source) return {key: int(value) for (value, key) in parsed_s}" "import re def main(x): slovar = {} x = re.split('end,', x) for i in range(0, len(x)): if len(x[i]) < 4: del x[i] for i in range(0, len(x)): x[i] = re.split('=:', x[i]) for i in range(0, len(x)): mass = re.findall('[-+]?\\d+', x[i][0]) name = re.findall('\\""(.*?)\\""', x[i][1])[0] mass = [int(item) for item in mass] slovar[name] = mass return slovar" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('((', '') s = s.replace('{{', '') s = s.replace(',))', '') s = s.replace('))', '') s = s.replace('}}', '') s = s.replace('.', '') s = s.replace(""'"", '') s = s.replace('glob', '') for el in s.split(','): res[el.split('=:')[1]] = el.split('=')[0] return res" "def main(s): s = s.replace('\n', '') s = s[1:-1] a = s.split(';') a = a[0:-1] a_names = [] a_contents = [] dct = {} for i in a: tmp = i.replace('option', '').replace(' ', '').replace('<<', '').replace('>>', '') a_names.append(tmp[0:tmp.find('<=')]) a_contents.append(i[i.find('[') + 1:i.find(']')].replace('#', '').replace(' ', '').split(',')) for key in range(len(a_names)): new_arr = [] for i in a_contents[key]: new_arr.append(int(i)) dct[a_names[key]] = new_arr return dct" "def main(line): _list = line.split(',') _list.pop(len(_list) - 1) _dict = {} for line in _list: key = line[line.find('""') + 1:] key = key[:key.find('""')] value = line[line.find('=') + 2:] value = value[:value.find(')')] value = value.strip() _dict[key] = value return _dict" "def main(line): _list = line.split('auto') _list.pop(0) _dict = {} for line in _list: value = line[line.find('""') + 1:] value = value[:value.find('""')] key = line[line.find('-') + 2:] key = key[:key.find(':')] key = key.strip() _dict[key] = value return _dict" "import json def main(a): a = a.replace('=', ':') a = a.replace(' ', '') a = a.replace(':', ': ') s = '' for i in range(0, len(a)): if a[i] == '@': while a[i] != ';': s = s + a[i] i = i + 1 s = s.replace('@', ', ') s = s.replace(', ', '', 1) s = '{' + s + '}' res_dict = json.loads(s) return res_dict" "import re def main(expr): expr = expr.replace(' ', '') expr = expr.replace('\n', '') first_part = re.findall('.begin[a-z]+_?\\d*<', expr) second_part = re.findall('<-[a-z]+_?\\d*;', expr) i = len(first_part) for k in range(i): first_part[k] = first_part[k].replace('.begin', '').replace('<', '') second_part[k] = second_part[k].replace('<-', '').replace(';', '') result = dict.fromkeys(first_part) for k in range(i): result[first_part[k]] = second_part[k] return result" "import json def main(a): a = a.replace('', '') a = a.replace('decl', '') a = a.replace('do', '') a = a.replace('od', '') a = a.replace('', '') a = a.replace(' ', '') a = a.replace('->', '*') a = a.replace('\n', '') arr = [] drr = [] D = '' one = '' two = '' for i in range(0, len(a)): if a[i] == '#': while a[i] != '*': one = one + a[i] i = i + 1 arr.append(one) one = '' a = a + '#' for i in range(0, len(a)): if a[i] == '*': while a[i] != '#': two = two + a[i] i = i + 1 drr.append(two) two = '' for i in range(0, len(arr)): D = D + '""' + drr[i] + '""' + ': ' + arr[i] + ',' D = D.replace('*', '') D = D.replace('#', '') q = len(D) D = D[:q - 1] D = '{' + D + '}' res = json.loads(D) return res" "import json def main(a): a = a.replace('<%', '') a = a.replace('%>', '') a = a.replace('loc', '""') a = a.replace('do', '') a = a.replace('od', '') a = a.replace('.', ', ') a = a.replace(' ', '') a = a.replace(':=', ':') a = a.replace(':', '"":') a = a.replace(""'"", '""') a = a.replace('\n', '') q = len(a) a = a[:q - 1] a = '{' + a + '}' res = json.loads(a) return res" "def main(x): import re k = re.findall('{\\s?equ\\s*-?[0-9]*', x) k = [int(i[5:]) for i in k] f = re.findall('=>\\s*[a-z0-9]+_*[0-9]*', x) f = [i[i.find('[a-z0-9]') + 3:] for i in f] dt = dict(zip(f, k)) dt = {f.replace(' ', ''): k for (f, k) in dt.items()} dt = {f.replace('\n', ''): k for (f, k) in dt.items()} return dt" "def main(s): s = s.replace('<%', '') s = s.replace(' ||new ', '') s = s.replace(' || new ', '') s = s.replace('\n', ' ') s = s.replace(' || %>', '#') s = s.replace('|| %>', '#') s = s.replace('||%>', '#') s = s.replace(' || || new ', '') s = s.replace(' || ||new ', '') s = s.replace('new ', '') s = s.replace('new ', '') s = s.replace(' ', '') s = s.replace('||', '') s = s.replace('<=', '\n') s = s.replace('<= ', '\n') s = s.replace(';', '\n') str = '' dstr = '' d = {} j = 0 kstr = '' vstr = '' A = [] B = [] for i in s: if i != '\n': str += i else: dstr += str + ' ' j += 1 if j % 2 == 1: kstr = str else: vstr = int(str) B.append(kstr) A.append(vstr) kstr = '' vstr = '' str = '' if i == '#': dictionary = dict(zip(B, A)) return dictionary" "def main(x): x = x.replace('make', ' ').replace('[', '').replace(']', '').replace('`', '').replace('\n', '') x_parts = x.split(' ') for i in x_parts: if i == '': x_parts.remove(i) if '' in x_parts: x_parts.remove('') x_parts1 = [i.split(':') for i in x_parts] result = {} for i in x_parts1: key = i[0].replace(' ', '') value = i[1].replace(' ', '') result[key] = value return result" "def main(s): i = 0 value = '' key = '' dictt = {} while i < len(s): if s[i] == '#': i += 1 while s[i].isdigit() or s[i] == '-': value += s[i] i += 1 elif s[i] == 't' and s[i - 1] in (' ', '\n') and (s[i + 1] == 'o'): i += 3 while s[i] not in (')', ' ', '\n'): key += s[i] i += 1 dictt[key] = int(value) key = '' value = '' i += 1 return dictt '/n'" "import re def main(source): source = source.replace('.do', '') source = source.replace('.end', '') source = source.replace('variable', '') p = '[-+]?\\w+' matches = re.findall(pattern=p, string=source) response = {} for i in range(len(matches)): if re.match('[-+]?\\d+', matches[i]) is not None: continue response[matches[i]] = int(matches[i - 1]) return response" "def main(string): string = string.replace('\n', ' ') keys = [] values = [] string = string.replace('""', '') string = string.replace(""'"", ' ') string = string.replace('sect', '') buffer = string.split(';') for st in buffer: if 'val' in st: keys += [''.join(st[st.find('val') + 3:st.find(' is ')]).replace(""'"", '').strip()] if ' is ' in st: values += [''.join(st[st.find(' is ') + 3:]).replace(""'"", '').strip()] result = dict(zip(keys, values)) return result" "import re def main(source): p = ""('(\\w+)')|let(\\s+|\\\\n)(\\w+)"" match_iter = re.finditer(pattern=p, string=source) response = {} key = '' value = '' is_key_found = False is_value_found = False for match in match_iter: got_str = match[0] if is_key_found is True and is_value_found is True: response[key] = value is_key_found = False is_value_found = False if is_value_found is False: value = got_str[4:] is_value_found = True elif is_key_found is False: key = got_str[1:-1] is_key_found = True response[key] = value return response" "import re def main(source): p = ""'(\\w+)'|(>([\\n\\s+])?)\\w+"" match_iter = re.finditer(pattern=p, string=source) response = {} key = '' value = '' is_key_found = False is_value_found = False for match in match_iter: got_str = match[0] if is_key_found is True and is_value_found is True: response[key] = value is_key_found = False is_value_found = False if is_value_found is False: value = got_str[1:-1] is_value_found = True elif is_key_found is False: right_space = 0 if got_str[1] == ' ': key = got_str[2:] else: key = got_str[1:] is_key_found = True response[key] = value return response" "def main(row): ans = {} row = row.replace('\n', '') row = row.replace('do', '') row = row.replace('od', '') row = row.replace('data', '') row = row.replace('@', '') row = row.replace(':', '') row = row.replace('""', '') row = row.replace(' ', '') row = row.replace('=', ' ') row = row.replace('.', ' ') row = row.split(' ') del row[-1] key = '' for i in range(len(row)): if i % 2 == 0: key = row[i] else: ans[key] = row[i] return ans" "def main(str): d = {} i = 0 first = '' second = '' while str.find('var', i) != -1: i = str.find('var', i) + 4 if str[i] == ' ' or str[i] == '#': i += 1 while str[i] != ' ' and str[i] != '=': second += str[i] i += 1 i += 2 if str[i] == '>': i += 1 if str[i] == ' ': i += 1 if str[i] == '\n': i += 1 while str[i] != '.': first += str[i] i += 1 second = int(second) d[first] = second first = '' second = '' return d" "def main(s): out = {} s = s.replace('==>', ' ==> ') s = s.split() f1 = 0 f2 = 0 val = 0 name = 0 for i in s: if i == 'local': f1 = 1 continue if i == '==>': f2 = 1 continue if f1: val = i f1 = 0 continue if f2: out[i] = int(val) f2 = 0 return out" "def main(x): x = x.replace('', '').replace('<:', '').replace('', '').replace(""'"", '').replace('@', '').replace('set ', '').replace('set\n', '').replace('\n', '').replace(' ', '') x_parts = x.split(',') x_parts.pop(-1) x_parts1 = [i.split('<|') for i in x_parts] result = {} for i in x_parts1: key = i[0] value = i[1] result[key] = value return result" "import re def main(s): tag_data = re.findall('
\\s*(.*)\\s*
', s, re.DOTALL)[0] p = 'do\\s*val\\s*array\\(\\s*((?:\\s*\\w+\\s*;?)*)\\)\\s*\\|>\\s*(\\w+).\\s*od.\\s*' do_val_entries = re.findall(p, tag_data) result = dict() for entry in do_val_entries: result[entry[1]] = re.findall('(\\w+)\\s*;*', entry[0]) return result" "def main(line): d = {} frst_name = '' scnd_name = '' i = line.find('`') while i < len(line): frst_name = line[line.find('`', i):line.find(':', line.find('`', i))] scnd_name = line[line.find('(', i) + 1:line.find(')', i)] frst_name = frst_name.split() if frst_name != '' and scnd_name != '' and frst_name: if frst_name[0][0] == '`': frst_name = frst_name[0][1:] d[frst_name] = scnd_name frst_name = '' scnd_name = '' if line.find(')', i) + 1 < i: break i = line.find(')', i) + 1 return d" "def main(line): d = {} line = line[7:] frst_name = '' scnd_name = '' i = line.find(""'"") while i < len(line) or i < 0: frst_name = line[line.find(""'"", i) + 1:line.find(""'"", line.find(""'"", i) + 1)] scnd_name = line[line.find('>', i) + 1:line.find('|', i)] frst_name = frst_name.split() scnd_name = scnd_name.split() if frst_name != '' and scnd_name != '' and scnd_name and frst_name: if scnd_name[0][0] == ""'"": scnd_name = scnd_name[0][1:] d[scnd_name[0]] = frst_name[0] frst_name = '' scnd_name = '' if line.find('val', i) + 1 < i: break i = line.find('val', i) + 1 return d" "import re def main(source): p_values = '(?:[(](.*?)[)])' p_keys = '(?:to\\s?(.*?)\\s?:>)' new_source = source.replace('\n', '') keys = re.findall(pattern=p_keys, string=new_source) values = re.findall(pattern=p_values, string=new_source) response = {} values_d = [] for match in values: values_d.append(match.replace(' ', '').split(';')) for i in range(len(values_d)): values_d[i] = list(map(int, values_d[i])) for i in range(len(keys)): response[keys[i]] = values_d[i] return response" "def main(x): x = x.replace('do ', '').replace('do\n', '').replace(';', '').replace(""'"", '').replace('glob', '').replace('glob ', '').replace('#', '').replace('.', '').replace('[', '').replace(']', '').replace('\n', '').replace(' ', '').replace('end', '') x_parts = x.split(',') x_parts.pop(-1) x_parts1 = [x.split('=>@') for x in x_parts] result = {} for i in x_parts1: key = i[1] value = int(i[0]) result[key] = value return result" "def main(line): d = {} frst_name = '' scnd_name = '' i = line.find('@') while i < len(line): frst_name = line[line.find('`', i):line.find('.', line.find('`', i))] scnd_name = line[line.find('""', i) + 1:line.find('""', line.find('""', i) + 1)] frst_name = frst_name.split() if frst_name != '' and scnd_name != '' and frst_name: if frst_name[0][0] == '`': frst_name = frst_name[0][1:] d[frst_name] = scnd_name frst_name = '' scnd_name = '' if line.find('.', i) + 1 < i: break i = line.find('.', i) + 1 return d" "def main(s): s = s.replace(' ', '') storage = {} while s.find('#') != -1: value = int(s[s.find('#') + 1:s.find('=')]) name = s[s.find('>') + 1:s.find(';')] storage[name] = value s = s.replace('#', '', 1) s = s.replace('=', '', 2) s = s.replace(';', '', 1) s = s.replace('>', '', 1) return storage" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('begin', '') s = s.replace(';end', '') s = s.replace('<%new""', '') s = s.replace(';%>', '') for el in s.split(';'): temp = list(map(str, el.split('"":'))) key = temp[0] value = int(temp[1]) res[key] = value return res" "import re def main(string): pattern = '\\w{1,}\\s*::=\\s*#.\\d{1,}' matches = re.findall(pattern, string) result = {} for match in matches: line = re.split('\\s*::=\\s*#', match) result[line[0]] = int(line[1]) return result" "def main(text): big_zapyataya = text.split(',') dict = {} for i in range(len(big_zapyataya) - 1): key = '' massive = [] medium_sobaka = big_zapyataya[i].split('@') for words in medium_sobaka: if '""' in words: key = words.split('""')[1] elif ""'"" in words: massive.append(words.split(""'"")[1]) dict[key] = massive return dict" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('array\\s?(.*?)\\s?;', s) for i in d: (key, value) = i.split('->') key = key.replace('(', '') key = key.replace(')', '') key = key.split() value = value.replace(' ', '') ans[value] = list(map(int, key)) return ans" "import re def main(x): result = {} x = x.split('};') for i in range(len(x)): key = re.search(""'.*'"", x[i]) if key is not None: value = re.search('#.*\\|>', x[i].replace(' ', '').replace('\n', '')) result[key[0][1:-1]] = int(value[0][1:-2]) return result" "def main(row): ans = {} row = row.replace('\n', ' ') row = row.replace('<%', '') row = row.replace('%>', '') row = row.replace(' ', ' ') row = row.replace('.', '') row = row.replace(' ', '') row = row.split(' new ') del row[0] for i in range(len(row)): row[i] = row[i].split(' is ') row[i][0] = row[i][0].replace(' ', '') row[i][1] = row[i][1].replace(' ', '') ans[row[i][0]] = row[i][1] return ans" "from typing import Dict def get_num(string) -> str: digits = '1234567890' number = '' for symbol in string: if symbol in digits + '+-': number += symbol else: return number return number def get_name(string) -> str: name = '' chars = '\n\t][ #\x08\r\x00<>[]' while string[0] not in chars: name += string[0] string = string[1:] return name def main(string: str) -> Dict: result: Dict = {} current_name = None while string: symbol = string[0:2:1] buff = string[0:3:1] if buff == 'new': string = string[3:] string = string.strip() name = get_name(string) string = string[len(name):] string = ' ' + string current_name = name elif symbol == '<=': string = string[2:] string = string.strip() number = get_num(string) string = string[len(number):] string = ' ' + string result.update({current_name: int(number)}) elif buff == '>>]': break string = string[1:] return result" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') while x != '': index1 = x.find('`') + 1 index2 = x.find('=') index3 = x.find('>`') + 2 index4 = x.find('>>') if x[index1:index2].replace('-', '').isdigit(): mdict[x[index3:index4].replace('\n', '')] = int(x[index1:index2]) else: mdict[x[index3:index4]] = x[index1:index2] x = x[index4 + 3:] return mdict" "def main(s): values_list = [] keys_list = [] res = s.split('{') res = [i.split('==>') for i in res] keys_list = [i[1] for i in res[1:]] values_list = [i[0] for i in res[1:]] values_list = [i[i.index('`') + 1:].strip() for i in values_list] keys_list = [i[i.index('@') + 2:i.index(';') - 1] for i in keys_list] D = dict(zip(keys_list, values_list)) return D" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') x = x.replace('%>', '') while x != '': index1 = x.find('<%') + 2 index2 = x.find('""') - 2 index3 = x.find('""') + 1 index4 = x.find('"".') if x[index1:index2].replace('-', '').isdigit(): mdict[x[index3:index4].replace('\n', '')] = int(x[index1:index2]) else: mdict[x[index1:index2]] = x[index3:index4] x = x[index4 + 3:] return mdict" "def main(x): x = x.replace('\n', ' ').replace('\t', '')[6:-4] x_parts = x.split(')') result = dict() for path in x_parts: k = path.find('#') if k != -1: value = int(path[k + 1:path.find('=')]) key = path[path.find(""@'"") + 2:path.rfind(""'"")].strip() result[key] = value return result s_1 = ""begin ( set #4484==> @'erquis' ) ( set#-5312==> @'enat_91') (set\n#423==> @'reen' ) ( set #5902 ==>@'veaa_615' ) end"" main(s_1)" "import re def main(s): s = s.replace(' ', '').replace('\n', '') result = re.findall(""'.*?'"", s) result2 = re.findall('#.*?=', s) d = {} for i in range(len(result)): result[i] = result[i].replace(""'"", '') result2[i] = result2[i].replace('#', '') result2[i] = result2[i].replace('=', '') result2[i] = int(result2[i]) d[result[i]] = result2[i] return d" "import re def main(source): p = '\\s*option\\s*([A-Za-z0-9-_]*)\\s*@\\""([A-Za-z0-9-_]*)\\""' matches = re.findall(p, source) response = {} for match in matches: response[match[0]] = match[1] return response" "def main(x): st1 = x.replace('\n', ' ').replace('(', '').replace(')', '') st1 = st1.replace('do equ', '').replace(' ', '') st2 = st1.split('end.') ret = {} k = 0 for st in st2: st2[k] = st2[k].replace('""', '').replace(';', '') st2[k] = st2[k].replace('|>', ' ') if st2[k] != '': nam = st2[k].split(' ') ret[nam[1]] = nam[0] k += 1 return ret" "def main(arg): d = {} a = arg.split() for i in range(len(arg)): arg = arg.replace(';', ' ') arg = arg.replace('{', ' ') arg = arg.replace('}', ' ') arg = arg.replace('def', ' ') arg = arg.replace('@', ' ') arg = arg.replace('>', ' ') arg = arg.replace('=', ' ') arg = arg.replace(""'"", ' ') arg = arg.replace(',', ' ') a = arg.split() while ' ' in a: a.remove(' ') for i in range(1, len(a) - 1, 2): d[str(a[i + 1])] = a[i] return d" "import re def main(a): result = {} a = a.split('') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('loc.*=', a[i]) if key is not None: value = re.search('=.*\\.', a[i]) result[key[0][3:-1]] = value[0][1:-1] return result" "def main(x): x = x.replace('begin', '').replace(')', '').replace('val ', '').replace('val\n', '').replace('end', '').replace('\n', '').replace('is#', '@').replace('is #', '@').replace(' ', '') x_parts = x.split('q(') x_parts.pop(0) x_parts1 = [i.split('@(') for i in x_parts] result = {} for i in x_parts1: key = i[0].replace('(', '') value = i[1].replace('(', '').split('.') value.pop(-1) result[key] = value return result" "import re def main(source): p = ""(\\s*define\\s@'([A-Za-z0-9-_]*).\\s*..\\s*#([0-9-]*))"" matches = re.findall(p, source) response = {} for match in matches: response[match[1]] = int(match[2]) return response" "values = {'(': '', ')': '', ',': '', ';': '', ""'"": '', ':': '', '=': ''} def replacement(word, isKey): global values word = word.replace('list', '') if isKey: word = word.replace('q', '', 1) word = word.translate(str.maketrans(values)) return word def main(x): splitted = x.split() res = {} ls = [] key = None for word in splitted: if 'q(' in word: if key: res[key] = ls ls = [] key = replacement(word, True) if ""'"" in word: if ""';'"" in word: spl = word.split(';') ls.append(replacement(spl[0], False)) ls.append(replacement(spl[1], False)) else: ls.append(replacement(word, False)) res[key] = ls return res" "def get_list_member(member): x = member.replace(""'"", '') x = x.replace(' ', '') x = x.replace('\n', '') return x def main(x): commands = x.split(',')[:-1] keys = [] final = {} for command in commands: key_start = command.index('@') + 1 key_end = command.index('|', 5, -1) key = command[key_start:key_end] key = key.replace(""'"", '') key = key.replace(' ', '') key = key.replace('\n', '') list_start = command.index('list(') + len('list(') list_end = command.index(')', list_start, -1) list_elems = command[list_start:list_end] final[key] = list(map(get_list_member, list_elems.split(';'))) return final" "import re def main(a): result = {} a = a.split('define') for i in range(len(a)): a[i] = a[i].replace('\n', ' ') key = re.search('.+<=', a[i].replace(' ', '')) if key: values = re.search('\\(.*\\)', a[i])[0][1:-1].strip().split(' ') result[key[0][:-2]] = values return result" "def main(x): res = {} keys = [] values = [] keys_prep = x.replace(' ', '').split('set') values_prep = x.replace(' ', '').replace(')', '(').split('(') for i in range(1, len(keys_prep)): keys.append(keys_prep[i].split(':=')[0].replace('\n', '')) for i in range(1, len(values_prep), 2): values.append(values_prep[i].split(',')) for i in values: for j in range(0, len(i)): i[j] = int(i[j]) for i in range(0, len(keys)): res[keys[i]] = values[i] return res" "def main(string): d = {} while string.find('[') != -1: string = string[string.find('""') + 1:] key = string[:string.find('""')] value = string[string.find('#') + 1:string.find('.')] string = string[string.find(']') + 2:] d[key] = int(value) return d" "import re def main(a): result = {} a = a.split('begin declare') for i in range(len(a)): a[i] = a[i].replace('\n', ' ') key = re.search('.*<', a[i]) if key is not None: value = re.search('=.*\\.', a[i])[0][1:-1].strip() result[key[0][1:-1].strip()] = value return result" "def main(str): map = {} str = str.replace('\n', '') while str.find('') != -1: val1 = str.find('=') val2 = str.find('') str = str[bon + 2:] return map" "import re def main(s): result = dict() key_pattern = 'local\\s[\\w]*' keys = [re.sub('local[\\\\n\\s]*', '', k) for k in re.findall(key_pattern, s)] list_pattern = 'list\\([\\s@""\\w\\d;]+\\)' lists = re.findall(list_pattern, s) list_item_pattern = '@\\""\\w+' i = 0 for str_list in lists: result_list = [item.replace('@""', '') for item in re.findall(list_item_pattern, str_list)] result[keys[i]] = result_list i += 1 return result" "import re def main(source): p = 'do declare .[^\\s]{3,10}:' source = source.replace('\n', ' ') source = source.replace(' :', ':') matches = re.findall(pattern=p, string=source) for i in range(len(matches)): matches[i] = matches[i].replace('do declare ', '') matches[i] = matches[i].replace(':', '') p = '[^_\\d][-+]?\\d+' matches_one = re.findall(pattern=p, string=source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace(':', '') response[matches[j]] = int(matches_one[j]) return response" "import re def main(source): p = 'to .{3,10}:>' source = source.replace('\n', ' ') source = source.replace(' :', ':') matches = re.findall(pattern=p, string=source) for i in range(len(matches)): matches[i] = matches[i].replace('to ', '') matches[i] = matches[i].replace(':>', '') p = '[^_\\d][-+]?\\d+' matches_one = re.findall(pattern=p, string=source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace(':', '') response[matches[j]] = int(matches_one[j]) return response" "import re def main(source): p = ""'.{3,10}'"" source = source.replace('\n', ' ') matches = re.findall(pattern=p, string=source) for i in range(len(matches)): matches[i] = matches[i].replace(""'"", '') matches[i] = matches[i].replace(':>', '') p = '`.{3,15}]' matches_one = re.findall(pattern=p, string=source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace('. ]', '') matches_one[j] = matches_one[j].replace('.]', '') matches_one[j] = matches_one[j].replace('`', '') response[matches[j]] = matches_one[j] return response" "import re def main(x): slovar = {} x = re.split('.end', x) for i in range(0, len(x)): if len(x[i]) < 5: del x[i] for i in range(0, len(x)): result = re.split('`', x[i]) znach = re.findall('[-+]?\\d+', result[0]) res = re.findall('\\S', result[1]) slov = '' for i in range(0, len(res)): slov += res[i] slovar[slov] = int(znach[0]) return slovar" "def main(x): x = x.replace('<', '').replace('>', '').replace(':', '').replace('\\begin', '').replace('\x08egin', '').replace('end.\n', '').replace('declare\n', '').replace('end.', '').replace('\\', '').replace('declare', '').replace('\n', ' ').replace(' ', '').replace(""'"", '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('=@') for i in x_parts] result = {} for i in x_parts1: value = int(i[0]) key = i[1] result[key] = value return result" "def main(str_input): hash_t = {} for times in range(4): pointer_index = str_input.find(';') if pointer_index < 0: break string_pair = str_input[:pointer_index] str_input = str_input[pointer_index + 1:] pointer_index = string_pair.find('loc') string_pair = string_pair[pointer_index + 4:] pointer_index = string_pair.find(':') key = string_pair[:pointer_index] pointer_index = string_pair.find('(') value = string_pair[pointer_index + 1:] pointer_index = value.find(')') value = value[:pointer_index] hash_t[key.strip()] = value return hash_t" "def main(s): s1 = s.replace('.begin', '').replace('.end', '') s2 = s1.replace(' begin local ', '').replace(' end.', '').replace('end.', '') s3 = s2.replace(' begin local', '').replace('begin\nlocal', '').replace('`', '').replace('""', '').replace('\n', '') s4 = s3.split(';') s5 = [] for i in range(len(s4) - 1): s5.append(s4[i]) s6 = [] for i in s5: s6.append(i.replace(' ', '')) s7 = dict() for i in range(len(s6)): s7[s6[i].split('==>')[1]] = s6[i].split('==>')[0] return s7" "def main(text): dict_sample = {} while text != '.]': text = text.partition('\n')[0] + ' ' + text.partition('\n')[2] text = text.partition('def q')[2] key = text.partition('<==')[0] if key == '': break key = key.strip() key = key.partition('(')[2] key = key.partition(')')[0] text = text.partition('<==')[2] value = text.partition(']].')[0] value = value.replace('#', '') value = value.strip() dict_sample[key] = int(value) return {x: y for (x, y) in dict_sample.items()}" "import re def main(source): source = source.replace('==>', ' ') source = source.replace('\n', ' ') source = source.replace(' ', ' ') source = source.replace(' ', ' ') regex = 'opt\\s?\\w+ *?\\w+' matches = re.findall(regex, source) response = {} for match in matches: response[match.split(' ')[2]] = match.split(' ')[1] return response" "def main(x: str) -> str: x = x.replace(' ', '').replace('\n', '').replace('\t', '') x = x.replace('((', '').replace('))', '').replace('do', '') x = x.replace('done', '').replace(')', '').replace('(', '') x_parts = x.split('.') result = dict() listadd = [] for part in x_parts: pparts = part.split('|>') for p in pparts: if len(listadd) % 2 == 0: p = p.replace('make', '').replace('#', '') listadd.append(p.split(';')) else: listadd.append(p) for i in range(0, len(listadd) - 1, 1): if i % 2 == 0: listadd[i] = list(map(int, listadd[i])) for i in range(0, len(listadd) - 1, 2): result[listadd[i + 1]] = listadd[i] return result" "import re def main(source): p = '(\\s*val\\s*([A-Za-z0-9-_]*)\\s*#([0-9-]*)\\.\\s*)' matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[1]] = int(match[2]) return response" "def main(row): ans = {} row = row.replace(' ', '') row = row.replace('\n', '') row = row.replace('|', '') row = row.replace('\\begin', '') row = row.replace('declare', '') row = row.replace(""'"", '') row = row.replace(';', '') row = row.replace(',', '') row = row.split('\\end') row.pop() for i in range(len(row)): row[i] = row[i].split(':=') ans |= {row[i][0]: row[i][1]} return ans" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('let(.*?)od', s) for i in d: (key, value) = i.split('<-') key = key.replace(' ', '') value = value.replace(' ', '') key = key.replace(')', '') value = value.replace('#', '') value = value.replace('.', '') ans[key] = int(value) return ans" "def main(text): text = text.replace('\n', '') text = text.replace('', '').replace('', '') text = text.replace('auto', '').replace('#', ' ') text = text.replace('[', '').replace(']', '') text = text.replace('""', '').replace(""'"", '') text_list = text.split('.') text_list = [i for i in text_list if len(i) > 1] res = dict() for i in text_list: name = i[i.find('>') + 1:] value_list = i[i.find('('):] value_list = value_list[:value_list.find('=')] value_list = value_list.strip('( )') while ' ' in value_list: value_list = value_list.replace(' ', '') value_list = value_list.replace(',', ', ') mas = value_list.split(',') for i in range(len(mas)): mas[i] = int(mas[i]) value_list = [i for i in value_list if len(i) > 1] res[f'{name.strip()}'] = mas return res" "def main(x): x = x.replace('decl ', '').replace('decl', '').replace('decl\n', '').replace('#', '').replace('[', '').replace(']', '').replace('q(', '').replace('(', '').replace(')', '').replace('\n', '').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('=>') for i in x_parts] result = {} for i in x_parts1: value = int(i[0]) key = i[1] result[key] = value return result" "def main(s): s = s.replace('\n', ' ') s = s[s.find('('):s.rfind(',')] s = s.split(',') resultat = {} for st in s: klutch = st[st.find(""'""):] klutch = klutch[1:] klutch = klutch[:klutch.find(""'"")] znachenie = st[st.find('store') + 6:st.find('=')] znachenie = znachenie.replace(' ', '') resultat.update({klutch: znachenie}) return resultat" "def main(x): x = x.replace('data', '').replace('[', '').replace(']', '').replace('(', '').replace(')', '').replace(""'"", '').replace('@', '').replace('\n', ' ').replace(' ', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('<==') for i in x_parts] result = {} for i in x_parts1: value = i[1] key = i[0] result[key] = value return result" "def main(text): text = text.replace('\n', ' ') text = text.replace('end', '') text = text.replace('begin', '') text = text.replace('|', '') text = text.replace('\\', '') text = text.replace(';', '') text = text.replace('`', '') text = text.split('store') text = text[1:] keys = [] values = [] result = {} for i in range(len(text)): new_text = text[i].split() for j in range(len(new_text)): if j % 2 == 0: keys.append(new_text[j]) else: values.append(new_text[j]) result = result.fromkeys(keys) o = 0 for key in result: result[key] = values[o] o += 1 return result" "import re def main(source): p = ""\\s*variable\\s*'([A-Za-z0-9-_]*)'\\s*<\\|\\s*([A-Za-z0-9-_]*)\\;\\s*"" matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[0]] = str(match[1]) return response" "def main(x): x_parts = x.strip()[6:-4].replace('\\begin', '').replace('\\end;', '').replace('auto', '').replace(' ', '').replace('\n', '').strip()[0:-1].split('.') result = dict() for block in x_parts: block_parts = block.split('=') block_parts[1] = int(block_parts[1]) result[block_parts[0]] = block_parts[1] return result" "def main(data): data = data.replace('\n', ' ') data = data.replace(' ', '') data = data.lstrip('{<% list') data = data.strip('%>}').strip().strip(';') data = data.split(';%><%list') dictionary = {} for line in data: (*z, values, key) = line.split('=:') values = values.strip() values = values.lstrip('(') values = values.rstrip(')') values = values.split(';') values = list(map(lambda x: x.strip(), values)) key = key.strip() dictionary[key] = values return dictionary" "def main(x): dict = {} end = False while end is False: name1 = x.find('w') + 2 name2 = x.find(':') name = x[name1:name2] name = name.replace(' ', '') name = name.replace('\n', '') x = x[name2:len(x)] index1 = x.find('=') + 1 index2 = x.find(';') string = x[index1:index2] string = string.replace(' ', '') string = string.replace('#', '') dict[name] = int(string) x = x[name2 + 2:len(x)] if len(x) < 10: break return dict" "import re def main(str): pattern = '(?<=[o][p][t]).*?(?=[""][;])' result = {} str = str.replace(' ', '') str = str.replace('\n', '') access = re.findall(pattern, str) for i in access: txt = i.split('<=@""') result[txt[0]] = txt[1] return result" "def main(x): x = x.replace('|', '').replace('do', '').replace('do\n', '').replace('def\n', '').replace('def', '').replace('#', '').replace('{', '').replace('}', '').replace(""'"", '').replace('end', '').replace('end\n', '').replace('""', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('=:') for i in x_parts] result = {} for i in x_parts1: value = i[0].split(',') if '' in value: value.remove('') for j in range(len(value)): value[j] = int(value[j]) key = i[1] result[key] = value return result" "import re def main(a): result = {} a = a[:-2].split('#(') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('>.+', a[i]) if key: values = re.search('.*\\)', a[i])[0][:-1].split(',') result[key[0][1:]] = values return result" "import math def main(s): s = s.replace(' ', '') s = s.replace('\n', '') a = [] b = [] mdict = {} for i in range(0, s.count(':')): n = '' for j in range(s.find('glob') + 4, s.find(':')): n += s[j] a.append(n) n = '' s = s.replace('glob', '', 1) s = s.replace(':', '', 1) b.append([]) for k in range(s.find('[') + 1, s.find(']') + 1): if s[k] == ';' or s[k] == ']': b[i].append(n) n = '' else: n += s[k] s = s.replace('[', '', 1) s = s.replace(']', '', 1) mdict[a[i]] = b[i] return mdict" "def main(x): x = x.replace('begin', '').replace('', '').replace('', '').replace('make', '').replace('#', '').replace('make\n', '').replace('end', '').replace('`', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('|>') for i in x_parts] result = {} for i in x_parts1: value = int(i[0]) key = i[1] result[key] = value return result" "def main(s): s = s.replace(' ', '') s = s.replace('""', '') s = s.replace('\n', '') a = [] b = [] mdict = {} for i in range(0, s.count('=')): n = '' for j in range(s.find('nequ') + 4, s.find('=')): n += s[j] a.append(n) n = '' s = s.replace('nequ', '', 1) s = s.replace('=', '', 1) b.append([]) for k in range(s.find('[') + 1, s.find(']') + 1): if s[k] == ',' or s[k] == ']': b[i].append(n) n = '' else: n += s[k] s = s.replace('[', '', 1) s = s.replace(']', '', 1) mdict[a[i]] = b[i] return mdict" "import re def main(text): rawKeys = re.findall('>[\\s\\w]*<', text) keys = [rKey.replace('>', '').replace('<', '').strip() for rKey in rawKeys] rawValues = re.findall(""\\'\\w*\\'"", text) values = [rawValue.replace(""'"", '') for rawValue in rawValues] result = dict(zip(keys, values)) return result" "import re def main(source): p = ""(\\s*equ\\s*'([A-Za-z0-9-_]*)'\\s*is\\s*([A-Za-z0-9-_]*)\\s*)"" matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[1]] = match[2] return response" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s[5:] s = s[:-4] for el in s.split('.}}.{{def'): (value, key) = el.split('==>') res[key] = value return res" "def main(data_string: str): data_string = repr(data_string) data_arr = data_string.replace(' ', '').replace('\\n', '').replace('<<', '').replace('>>', '').replace('\\\\', '').replace('begindefine#', '').replace(""'"", '').replace('\n', '')[:-4].split('.end') dict = {} for i in data_arr: (data, key) = i.split('to') dict.update({key: int(data)}) return dict" "def main(x): res = {} keys = [] values = [] keys_prep = x.replace(' ', '').replace(""'"", '').split('@') values_prep = x.replace(' ', '').split('""') for i in range(1, len(keys_prep)): keys.append(keys_prep[i].split('::=')[0].replace('\n', '')) for i in range(1, len(values_prep), 2): values.append(values_prep[i]) for i in range(0, len(keys)): res[keys[i]] = values[i] return res" "import re def main(s): pattern1 = ""\\'\\w+\\'"" pattern2 = '(?<=(list\\())([\\s\\S]+?\\;)' parsed_s1 = re.findall(pattern1, s.replace('\n', '')) parsed_s2 = re.findall(pattern2, s.replace('\n', '')) pattern3 = '(\\(\\w+\\))' dict = {} for i in range(len(parsed_s1)): parsed_s3 = re.findall(pattern3, parsed_s2[i][1].replace('\n', '')) for j in range(len(parsed_s3)): parsed_s3[j] = parsed_s3[j].lstrip('(').rstrip(')') dict[parsed_s1[i].strip(""'"")] = parsed_s3 return dict" "def main(strmain): dct = {} str1 = [] str2 = [] while strmain.find('def') != -1: str1.append(strmain[strmain.find('def') + 4:strmain.find(':')].strip()) str2.append(strmain[strmain.find(':') + 1:strmain.find('end')].strip()) strmain = strmain[strmain.find('end') + 4:strmain.find('))') + 2] for i in range(0, len(str1)): dct[str1[i]] = int(str2[i]) return dct" "import re def main(source): p = '\\s*\\s*(\\w*)\\s*=:\\s*(\\w*)\\.\\s*' matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[1]] = str(match[0]) return response" "def main(s): d = {} a = [] i = 0 s = s.replace('}', ' ') s = s.replace('\n', ' ') s = s.replace(': ', ':') s = s.replace(' <', '<') while s[i:i + 3] != '.en': if s[i] == '#': k = 1 for j in range(2, 6): if s[i + j] == ' ': break else: k += 1 a.append(int(s[i + 1:i + k + 1])) i += 1 elif s[i] == ':': another(s, 1, i, a, d) a = [] i += 1 else: i += 1 return d def another(s, n, i, a, d): k = 1 while s[i + k] != '<': k += 1 d[s[i + 1:i + k]] = a a = []" "import re def main(source): p = ""{{\\s*make\\s*#(-*[0-9]+)\\s*=>\\s*@'([A-Za-z0-9_]+)'.\\s*}}"" matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[1]] = int(match[0]) return response" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('make(.*?)}', s) for i in d: (key, value) = i.split('<|') key = key.replace(' ', '') value = value.replace(' ', '') key = key.replace(')', '') value = value.replace('}', '') value = value.replace('.', '') ans[key] = value return ans" "def main(string): string = string.replace('do ', '') string = string.replace('done', '') string = string.replace('\n', '') string = string.replace('|>', '') string = string.replace('|', '') string = string.replace(' ', '') string = string.replace('q(', '') string = string.replace('""', '') string = string.replace(';', '') string = string.replace(',', '') string = string.split('decl') string = string[1:] data = {} for i in string: temp = i.split(')') data[temp[1]] = temp[0] return data" "def main(x): x = '' + x x = x.split(';') a = [] for i in x: i = i.strip() if i != 'end' and i != '': a.append(i) d = {} for i in a: key = i[i.find('option ') + 7:i.find('<-')] key = key.strip() key = key.strip('\n') value = int(i[i.find('#') + 1:]) d.update([(key, value)]) return d" "def main(x): x = x.replace('', '').replace('
', '').replace('glob', '').replace('""', '').replace('
', '').replace('
', '').replace('@', '').replace('\n', '').replace('[', '').replace(' ', '') x_parts = x.split('.') x_parts1 = [x.split(']to') for x in x_parts] x_parts1.pop(-1) result = {} for i in x_parts1: value = i[0].split(';') key = i[1] result[key] = value return result" "def main(x): x = x.replace('.begin', '').replace('', '').replace('glob', '').replace('""', '').replace('', '').replace('end', '').replace('\n', '').replace(' ', '') x_parts = x.split('..') x_parts.pop(-1) x_parts1 = [i.split('<=') for i in x_parts] result = {} for i in x_parts1: key = i[0] value = i[1] result[key] = value return result" "def main(line): d = {} frst_name = '' scnd_name = '' i = line.find('q') while i < len(line): line = line.replace('\n', ' ') frst_name = line[line.find('(', i) + 1:line.find(')', line.find('(', i))] scnd_name = line[line.find('#', i) + 1:line.find('.', line.find('#', i) + 1)] if frst_name != '' and scnd_name != '' and frst_name: d[frst_name] = int(scnd_name) frst_name = '' scnd_name = '' if line.find('equ q', i) + 1 < i: break i = line.find('equ q', i) + 1 return d" "import re def main(a): result = {} a = a.split('((') for i in range(len(a)): a[i] = a[i].replace('\n', ' ').replace(' ', '') key = re.search('\\(.+?\\)', a[i]) if key: values = re.search('\\[.+\\]', a[i])[0][1:-1].split(',') result[key[0][1:-1]] = values return result" "import re def main(source): p = ""'.{3,10}'"" matches = re.findall(pattern=p, string=source) for i in range(len(matches)): matches[i] = matches[i].replace(""'"", '') p = '`.{3,10};' matches_one = re.findall(pattern=p, string=source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace('`', '') matches_one[j] = matches_one[j].replace(';', '') response[matches[j]] = matches_one[j] return response" "def main(x): x = x.replace('', '').replace('\n', ' ').replace('decl', '').replace('', '').replace(""'"", '').replace('(', '').replace(')', '').replace(',', '').replace('#', '').replace(' ', '').replace('""', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('<=') for i in x_parts] result = {} for i in x_parts1: value = int(i[1]) key = i[0] result[key] = value return result" "def main(x): x = x.replace('', '').replace('', '').replace('auto ', '').replace(',', '').replace(""'"", '').replace('\n', ' ') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split(' to') for i in x_parts] result = {} for i in x_parts1: value = i[0].replace(' ', '') key = i[1].replace(' ', '') result[key] = value return result" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('set(.*?).end', s) for i in d: (key, value) = i.split('::=') key = key.replace(' ', '') value = value.replace(' ', '') key = key.replace(')', '') value = value.replace('}', '') value = value.replace('.', '') ans[key] = int(value) return ans" "import re def main(a): result = {} a = a.split('') for i in range(len(a)): a[i] = a[i].replace('\n', ' ').replace(' ', '') key = re.search(':.+<', a[i]) if key: value = int(re.search('#.+=', a[i])[0][1:-1]) result[key[0][1:-1]] = value return result" "import re def main(a): result = {} a = a.split('((') for i in range(len(a)): a[i] = a[i].replace('\n', ' ').replace(' ', '') key = re.search('>.+;', a[i]) if key: value = re.search('set.+\\|', a[i])[0][3:-1] result[key[0][1:-1]] = value return result" "import re def main(a): result = {} a = a.split('store') for i in range(len(a)): a[i] = a[i].replace('\n', ' ').replace(' ', '') key = re.search(""'.+'"", a[i]) if key: value = int(re.search('=.+\\.', a[i])[0][1:-1]) result[key[0][1:-1]] = value return result" "import re def main(a): result = {} a = a.split('local') for i in range(len(a)): a[i] = a[i].replace('\n', ' ').replace(' ', '') key = re.search('"".+""', a[i]) if key: value = int(re.search('\\|.+?\\.', a[i])[0][1:-1]) result[key[0][1:-1]] = value return result" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') while x != ';%>': index1 = x.find('let') + 3 index2 = x.find('::') index3 = x.find('=""') + 2 index4 = x.find('""end') if x[index1:index2].replace('-', '').isdigit(): mdict[x[index3:index4].replace('\n', '')] = int(x[index1:index2]) else: mdict[x[index1:index2]] = x[index3:index4] x = x[index4 + 4:] return mdict" "import re def main(s): pattern = 'option @ ?""(\\w+)"" ?=> ?(\\w+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value for (value, key) in parsed_s}" "import re def main(input): d = {} names = re.findall('->\\s?\\w+.', input) values = re.findall('#.\\d+', input) for i in range(len(names)): name = re.search('\\w+', str(names[i])) value = re.search('[-]?\\d+', str(values[i])) d[name.group()] = int(value.group()) return d" "import re def main(s): pattern = '`(\\w+) ? is ? (-?\\d+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: int(value) for (key, value) in parsed_s}" "import re def main(s): pattern = ""@'(\\w+)' ?::= ?(\\w+)"" parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value for (key, value) in parsed_s}" "import re def main(s): pattern = ""new ?'(\\w+)' ?<== ?`(\\w+)"" parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value for (key, value) in parsed_s}" "import re def main(x): slovar = {} x = re.split('define', x) del x[0] for i in range(0, len(x)): result = re.split('=', x[i]) res = re.findall('\\w+', result[0])[0] znach = re.findall('\\w+', result[1])[0] slovar[res] = znach return slovar" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('>.*?;', a) tre = re.findall('define .*?>', a) for i in range(len(one)): one[i] = one[i].replace(';', '') one[i] = one[i].replace('>', '') one[i] = one[i].replace(' ', '') one[i] = one[i].replace('\n', '') for i in range(len(tre)): tre[i] = tre[i].replace('|', '') tre[i] = tre[i].replace('define', '') tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace('>', '') tre[i] = tre[i].replace('\n', '') tre[i] = tre[i] x = {} for i in range(len(tre)): one[i] = x.setdefault(one[i], tre[i]) return x" "def main(x): ans = {} x = x.replace('\n', ' ') x = x.replace('.', '') x = x.replace('done', '') x = x.replace('do', '') x = x.replace('store', '') x = x.replace(' ', '') x = x.split(';') x.pop() for i in x: i = i.split('==>') ans[i[1]] = i[0] return ans" "def main(line): a = {} line = line.replace(' ', '') line = line.replace('.do def', '') line = line.replace('do', '') line = line.replace(':', '') line = line.replace('=>', ',') line = line.replace('q(', '') line = line.replace(').', ' ') line = line.replace('\n', '') line = line.replace('.end', '') line = line.replace('.def', '') line = line.replace('od', '') line = line[:-1] line = line.split(' ') for i in range(len(line)): line[i] = line[i].split(',') a[line[i][1]] = line[i][0] return a" "def main(x): res = {} keys = [] values = [] values_prep = x.replace(' ', '').split('#') keys_prep = x.replace(' ', '').replace(')', '(').split('(') for i in range(1, len(values_prep)): values.append(values_prep[i].replace('\n', '').split('=:q')[0]) for i in range(1, len(keys_prep), 2): keys.append(keys_prep[i]) for i in range(0, len(values)): values[i] = int(values[i]) for i in range(0, len(keys)): res[keys[i]] = values[i] return res" "import re def main(source): p = ""(?:')([A-z0-9_]+)(?:')(?:\\s?<\\|\\s?)(-?\\d+)"" matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[0]] = int(match[1]) return response" "import re def main(source): p = '\\#([A-Za-z0-9-_]+)[=\\s]?' p2 = '\\""([A-Za-z0-9-_]+)\\""' matches2 = re.findall(pattern=p, string=source) matches = re.findall(pattern=p2, string=source) res = {} for key in matches: for value in matches2: res[key] = int(value) matches2.remove(value) break return res" "import re def main(s): d = dict() for matched in re.findall('{{\\s*\\#-{0,1}\\d+\\s*=>\\s*[0-9a-z_]+\\s*}};', s): num = re.search('#-{0,1}\\d+', matched)[0].replace('#', '') name = re.search('=>\\s*[0-9a-z_]+', matched)[0].replace('=>', '').replace(' ', '') name = re.sub('\\s', '', name) d[name] = int(num) return d" "def main(s): s = s.replace('||', '').replace('decl', '').replace('\n', '').replace('.', '').replace(' decl', '').replace('decl', '') s = s.replace(' ', '').replace(""'"", '').replace('', '') cur = s.split('.') new = [] for i in cur: if len(i) != 0: new.append(i) end = {} for i in range(len(new)): end[new[i].split(':=')[0]] = new[i].split(':=')[1] return end" "def main(text): dict_sample = {} while text != ""'))."": text = text.partition('auto')[2] key = text.partition('=:')[0] if key == '': break key = key.strip() key = int(key) text = text.partition('=:')[2] value = text.partition(')).')[0] value = value.replace(""'"", '') value = value.strip() dict_sample[key] = value return {y: x for (x, y) in dict_sample.items()}" "import re def main(a): t = [*map(lambda x: re.findall('\\w+', x)[0], re.findall('\\w+\\s*<|=\\s*\\w+', a))] return {i[0]: i[1] for i in zip(t[::2], t[1::2])}" "def first(s): s = s.replace('[', '').replace(']', '').replace('|>', '').replace('', '') s = s.replace('set q', '').replace(' ', '') s = s.replace('.', '') s = s.replace('(', '').replace(')', '') s = s.replace('""', ':').replace('\n', '').replace('.', '').replace('setq', '') return s def second(s): new = s.split(':') end = {} k = [] v = [] for i in range(0, len(new), 2): v.append(new[i]) for i in range(1, len(new), 2): k.append(new[i]) for i in range(len(v)): if ',' in v[i]: v[i] = v[i].replace(',', '') val = [] for i in v: if len(i) != 0: val.append(i) for i in range(len(val)): end[k[i]] = val[i] return end def main(s): return second(first(s))" "def main(x): x = x.replace('<%', '').replace('%>', '').replace(' equ', '').replace('|equ', '').replace('|equ ', '').replace('.', '').replace('""', '').replace('|', '').replace('\n', '').replace(' ', '') x_parts = x.split(',') x_parts.pop(-1) x_parts1 = [i.split('=>') for i in x_parts] result = {} for i in x_parts1: value = int(i[0]) key = i[1] result[key] = value return result" "def main(s): lst_keys = [] lst_values = [] dct = {} c = s.count('new') for k in range(c): i = s.find('""') j = s.find('""', i + 1, i + 12) ii = s.find('(') jj = s.find(')') lst_keys.append(s[i + 1:j]) lst_values.append(s[ii + 1:jj]) s = s[j + 6:] for i in range(len(lst_keys)): dct[lst_keys[i]] = lst_values[i] return dct" "def main(s: str): res = {} s = s.replace('\n', '') s = s.replace('\\', '') s = s.replace(' ', '') s = s.replace('""', '') s = s.replace('begin', '') s = s.replace(';end', '') s = s.replace('.', '') s = s.replace('new', '') s = s.replace('<<', '') s = s.replace('>>', '') for el in s.split(';'): res[el.split('<=')[0]] = el.split('<=')[1] return res" "import re def main(x): nv = list() strings = list() c = list() re_keys = re.compile('local\\s[A-Za-z0-9_]+') re_values = re.compile('#[0-9-]*') keys = re_keys.findall(x) values = re_values.findall(x) for i in range(len(keys)): keys[i] = keys[i][6:] for i in range(len(values)): values[i] = int(values[i][1:]) for a in x.split(']'): if len(a) >= 5: strings.append(a) for s in strings: c.append(s.count('#')) for i in range(len(c)): nv.append(values[:c[i]]) values = values[c[i]:] ans = dict(zip(keys, nv)) return ans" "def main(s): lst_keys = [] lst_values = [] dct = {} c = s.count('opt') for k in range(c): i = s.find('opt') j = s.find('==>') ii = s.find('q(') jj = s.find(')') if s[s.find('==>') - 1] == ' ': lst_values.append(s[i + 4:j - 1]) elif s[s.find('==>') - 1] == '\n': lst_values.append(s[i + 4:j - 1]) else: lst_values.append(s[i + 4:j]) lst_keys.append(s[ii + 2:jj]) s = s[jj + 2:] for i in range(len(lst_keys)): dct[lst_keys[i]] = lst_values[i] return dct" "def main(x): x = x.replace('begin', '').replace('data', '').replace('end', '').replace('(', '').replace(')', '').replace(' is ', '@').replace('is\n', '@').replace('\nis', '@').replace(';', '').replace('\n', ' ').replace(' ', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('@') for i in x_parts] result = {} for i in x_parts1: value = int(i[1]) key = i[0] result[key] = value return result" "def main(x): x = x.replace('', '').replace('', '').replace('{', '').replace('}', '').replace(' to ', '@').replace('to\n', '@').replace('\nto', '@').replace('glob', '').replace('#', '').replace(' ', '').replace('\n', '') x_parts = x.split('.') x_parts1 = [i.split('@') for i in x_parts if i != ''] result = {} for i in x_parts1: value = int(i[0]) key = i[1] result[key] = value return result" "def main(string): string = string.replace('\n', '') string = string.replace('\\end', '') string = string.replace('\\begin data', '') string = string.replace('.end', '') string = string.replace('.begin', '') string = string.replace('`', ' ') string = string.replace(',', '') string = ' '.join(string.split()) string = string.split(' ') return dict(zip(string[::2], string[1::2]))" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace(""do[store@'"", '') s = s.replace('.].od', '') for el in s.split("".].[store@'""): (key, lst) = el.split(""'<==list(q("") lst = lst.replace('))', '') res[key] = lst.split(').q(') return res" "def main(line): line = line.split('.') line.pop(len(line) - 1) _dict = {} for i in line: i = i[i.find('f') + 1:] i = i.split('=') i[0] = i[0].strip() i[1] = i[1].strip() _dict[i[0]] = int(i[1]) return _dict" "import re def main(s): res = re.findall('`(\\S*)\\s*:\\s*#(-?\\d+)', s) return {r[0]: int(r[1]) for r in res}" "def main(x): x = x.replace('}', '').replace('{', '').replace('\n', '').replace(' ', '').replace(',', '').replace('.', '').replace(""make'"", '').replace(""'<=#"", ' ').replace('', ' ').split(' ') for i in range(len(x)): if i % 2 != 0: x[i] = int(x[i]) p = dict() for i in range(len(x) - 1): if i % 2 == 0: p[x[i]] = x[i + 1] return p" "import re def parse(reg): parsed = {} children = [] for item in reg: if item[0] == '""' and item[-1] == '""': children.append(item[1:-1]) elif item[0] == ""'"" and item[-1] == ""'"": parsed[item[1:-1]] = children children = [] return parsed def main(source): p = '((?:\\""[a-zA-Z0-9_]+\\"")|(?:\\\'[a-zA-Z0-9_]+\\\'))' matches = re.findall(pattern=p, string=source) return parse(matches)" "import re def main(a): result = {} a = a.split('.do') for i in range(len(a)): a[i] = a[i].replace('\n', ' ') found = re.search('store.+;', a[i]) if found: cell = found[0][6:-1].split(' ') result[cell[0]] = int(cell[1]) return result" "import re def main(source): p = '([A-Za-z0-9-_]*);' matches1 = re.findall(pattern=p, string=source) p2 = '([A-Za-z0-9-_]*)\\s*=:' matches2 = re.findall(pattern=p2, string=source) d = {} for i in range(0, len(matches2)): d.update({matches1[i]: int(matches2[i])}) return d" "import re def main(source): p = ""(q\\(([A-Za-z0-9-_]*)\\)\\s*=\\s*:\\s*@'([A-Za-z0-9-_]*)')"" matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[2]] = match[1] return response" "def main(string): string = string.replace('\n', ' ') keys = [] values = [] string = string.replace('begin', '') string = string.replace('end', '') buffer = string.split('|,') for st in buffer: if 'glob' in st: keys += [''.join(st[st.find('glob') + 4:st.find(':')]).replace('""', '').strip()] if ':' in st: values += [''.join(st[st.find(':') + 3:]).replace('""', '').strip()] result = dict(zip(keys, values)) return result" "import re def main(s): data = re.findall('\\(\\s*(.*)\\s*\\)', s, re.DOTALL)[0] p = ""do\\s*equ\\s*`?(\\w+)\\s*<-\\s*#\\(\\s*((?:\\s*'\\w+'\\s*.?)*)\\);\\s*od\\s*"" entries = re.findall(p, data) result = {} for entry in entries: result[entry[0]] = re.findall(""'(\\w+)'"", entry[1]) return result" "def make_arr(arr): arr = arr.split('==>') name = arr[1] arr = arr[0][1:-1] arr = arr.split(';') arr = list(map(lambda x: int(x), arr)) return (name, arr) def main(s): s = s[2:-5] s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('declarearray', '') s = s.replace('<<', '') s = s.replace('>>', '') s = s.split('.') s = s[:-1] d = {} for i in s: (key, value) = make_arr(i) d[key] = value return d" "import re def main(a): result = {} a = a.split('data') for i in range(len(a)): a[i] = a[i].replace('\n', ' ') key = re.search('.*<', a[i]) if key: value = re.search('\\|.*;', a[i])[0][1:-1].strip('; ]') result[key[0][:-1].strip()] = int(value) return result" "def make_arr(arr): arr = arr[1:-2] arr = arr.split('->') key = arr[1] value = arr[0] return (key, value) def main(s): s = s.replace('data', '') s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('};', '}|') s = s[:-1] s = s.split('|') d = {} for i in s: (key, value) = make_arr(i) d[key] = value return d" "import re def main(a): result = {} a = a.split('variable') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('.+?:', a[i]) if key: value = int(re.search('=.+?<', a[i])[0][1:-1]) result[key[0][:-1]] = value return result" "def main(s): i = 0 k = 0 x = '' result = {} while i < len(s): key = '' if s[i] == '#': i += 1 while s[i] == ' ': i += 1 while s[i] != ' ' and s[i] != '=': x = x + s[i] i += 1 if s[i] == '(': i += 1 while s[i] != ')': key = key + s[i] i += 1 result[key] = int(x) x = '' i += 1 return result" "import re def main(source): res = {} for i in re.findall('\\w+\\s*->\\s*\\w+', source): vk = re.split('->', i) res[vk[1].strip()] = vk[0].strip() return res" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('variable(.*?)[.]', s) for i in d: (key, value) = i.split('<==') key = key.replace(' ', '') value = value.replace(' ', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('}', '') value = value.split(';') value = list(map(int, value)) ans[key] = value return ans" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('declare(.*?)[;]', s) for i in d: (key, value) = i.split('<==') key = key.replace(' ', '') key = key.replace('""', '') key = key.replace('@', '') value = value.replace(' ', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('}', '') value = value.split(',') value = list(map(int, value)) ans[key] = value return ans" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('decl(.*?)[;]', s) for i in d: (key, value) = i.split('=') key = key.replace(' ', '') value = value.replace(' ', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('}', '') ans[key] = int(value) return ans" "import re def main(x): slovar = {} x = x[7:len(x)] x = re.split('make', x) for i in range(0, len(x) - 1): if len(x[i]) < 4: del x[i] for i in range(0, len(x)): result = re.split('<', x[i]) res = re.findall('\\S', result[0]) name = re.findall('\\`(.*?)[^0-9a-zA-Z_\\s]+', result[1]) for i in range(0, len(name)): name[i] = name[i].strip() slov = '' for i in range(0, len(res)): slov += res[i] slovar[slov] = [item for item in name] return slovar" "import re def main(x): x = re.findall('(.*?)', x, re.DOTALL) slov_A = {} for i in range(0, len(x)): temp_list = re.split('<==', x[i]) result = re.findall('\\w+', re.split('global', temp_list[0])[1])[0] temp_list = re.split(';', temp_list[1]) list_znach = [] for k in range(0, len(temp_list)): list_znach.append(re.findall('\\w+', temp_list[k])[0]) slov_A[result] = list_znach return slov_A" "def main(x): di = {} al = [] sl = [] a = x.replace(' ', '') a = a.replace('\n', '') a = a.split(';end;') a = a[:-1] for i in range(0, len(a)): string = a[i] pos1 = string.find('#') + 1 pos2 = string.find('>') sl.append(int(string[pos1:pos2 - 2])) al.append(string[pos2 + 2:-1]) di = dict(zip(al, sl)) return di" "import re def main(source): p = '([A-Za-z0-9-_]*)\\s*=:' matches = re.findall(pattern=p, string=source) p2 = '`([A-Za-z0-9-_]*)' matches2 = re.findall(pattern=p2, string=source) response = {} for i in range(0, len(matches2)): response.update({matches2[i]: int(matches[i])}) return response" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('set(.*?)[;]', s) for i in d: (key, value) = i.split('<-') key = key.replace(' ', '') value = value.replace(' ', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('}', '') ans[key] = int(value) return ans" "import re def main(text): my_dict = {} keys = re.findall('\\"".*?\\""', text) elements = re.findall(""\\'.*?\\'"", text) for i in range(0, len(keys)): keys[i] = keys[i][1:] keys[i] = keys[i][:-1] elements[i] = elements[i][1:] elements[i] = elements[i][:-1] my_dict[keys[i]] = elements[i] return my_dict" "def main(example): res = {} lines = [] example = example.split('<<')[1:] for i in range(len(example)): s = example[i] st = s[s.find('|>') + 2:s.find('>>')].strip() nums = s[s.find('{') + 1:s.find('}')].split('.') res[st] = [] for k in nums: res[st].append(int(k.strip())) return res" "import re def main(s): return {r[0]: r[1] for r in re.findall(""'(\\w+)'\\s*<==\\s*(\\w+)"", s)}" "def main(string): string = string.replace('\n', ' ') keys = [] values = [] string = string.replace('sect', '') buffer = string.split('glob') for st in buffer: if '|>' in st: keys += [''.join(st[st.find('|>') + 2:st.find('|.')]).strip()] if '#' in st: values += [''.join(st[st.find('#') + 1:st.find('|>')]).strip()] for i in range(0, len(values)): values[i] = int(values[i]) result = dict(zip(keys, values)) return result" "import string def main(st): str(st) dic = {} nam = '' num = '' for i in range(len(st)): if st[i] == '#': j = i + 1 num += st[j] j += 1 while st[j].isdigit(): num += st[j] j += 1 while st[j] != ""'"": j += 1 j += 1 while st[j] != ""'"": nam += st[j] j += 1 dic.update({nam: int(num)}) nam = '' num = '' i = j return dic" "def main(string): string = string.replace('\n', ' ') keys = [] values = [] string = string.replace(')q(', '}*?') string = string.replace(') q(', '}*?') string = string.replace('do q(', '?') string = string.replace(')done', '}') string = string.replace(') done', '}') buffer = string.split('*') for st in buffer: if 'to q(' in st: keys += [''.join(st[st.find('to q(') + 5:st.find('}')]).strip()] if '?' in st: values += [''.join(st[st.find('?') + 1:st.find(')')]).strip()] result = dict(zip(keys, values)) return result" "import re def main(text): text = text.replace('.', '. ') text = text.replace('%', '% ') h = 'data' k = ['data', '', '', '', h, 'data'] string_to_process = text z = string_to_process.split() filtered_str = ' '.join(filter(lambda s: s not in k, z)) my_dict = {} filtered_str = filtered_str.replace(' ', '') keys = re.findall('\\"".*?\\""', text) elements = re.findall('\\%.*?\\=', filtered_str) elements2 = re.findall('\\..*?\\=', filtered_str) for i in range(0, len(elements2)): elements2[i] = elements2[i][1:] elements2[i] = elements2[i][:-1] for i in range(0, len(keys)): keys[i] = keys[i][1:] keys[i] = keys[i][:-1] if i == 0: elements[i] = elements[0][1:] elements[i] = elements[0][:-1] my_dict[keys[0]] = elements[0] else: my_dict[keys[i]] = elements2[i - 1] return my_dict" "import re def main(source): pn = '""[A-Za-z0-9_]*""|[-*0-9]*' p = re.compile(pn) matches = re.findall(pattern=p, string=source) response = {} matches = [x for x in matches if x] matches = [s.replace('""', '') for s in matches] for i in range(0, len(matches), 2): response[matches[i]] = int(matches[i + 1]) return response" "def main(line): line = line.split('.') line.pop(len(line) - 1) _dict = {} for part in line: key = part[part.find('glob') + 4:] key = key[:key.find('<')] key = key.strip() value = part[part.find('#') + 1:] value = value.strip() _dict[key] = int(value) return _dict" "import re def main(a): CJIOBAPb = {} iterator = 0 CblHA = [] word = '' a = a.replace('[ <', '<') a = a.replace(' ', '') a = a.replace('equ', '#') a = a.replace('<|', '|') a = a.replace('.', '') a = a.replace('>]', '') a = a.replace('\n', '') keys = re.findall('\\#.*?\\|', a) for i in range(0, len(keys)): keys[i] = keys[i].replace('#', '') keys[i] = keys[i].replace('|', '') for i in a: if i == '[': word = '' continue if i == ';': CblHA.append(word) word = '' continue if i == ']': CblHA.append(word) s = keys[iterator] CJIOBAPb[s] = CblHA word = '' CblHA = [] iterator += 1 continue word += i return CJIOBAPb" "import re def main(source): p = 'auto\\s*[A-Za-z0-9_]*\\s*is\\s[0-9_-]*' matches = re.findall(pattern=p, string=source) k = [] v = [] for match in matches: lst = match.split() k.append(lst[1]) v.append(int(lst[3])) return dict(zip(k, v))" "def main(x): x = x.replace('', '').replace('\x08egin', '').replace('\\begin', '').replace('', '').replace('decl', '').replace('q(', '').replace(')', '').replace('(', '').replace('@', '').replace('""', '').replace('list', '').replace('\n', ' ').replace(' ', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split(':') for i in x_parts] result = {} for i in x_parts1: value = i[1].split(';') key = i[0] result[key] = value return result" "def main(x): x = x.replace('', '').replace('', '').replace(']', '').replace('[', '').replace('glob', '').replace('glob\n', '').replace('@', '').replace(""'"", '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('->') for i in x_parts] result = {} for i in x_parts1: value = i[0] key = i[1] result[key] = value return result" "import re def main(src_string): group1_dict = re.findall('to[ (\\n)][^ :>]*', src_string) group2_dict = re.findall('""[^""]*""', src_string) groups_list = list() for i in range(0, len(group1_dict)): group1_dict[i] = group1_dict[i][3:] group2_dict[i] = group2_dict[i][1:-1] groups_list.append((group1_dict[i], group2_dict[i])) return dict(groups_list)" "def main(x): x = x.replace('', '').replace('', '').replace('|', '').replace('define', '').replace('is#', '@').replace('is #', '@').replace('is\n#', '@').replace('(', '').replace(')', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('@') for i in x_parts] result = {} for i in x_parts1: value = i[1].split('.') key = i[0] result[key] = value return result" "import re def main(a): result = {} a = a.split('{{') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('"".+""', a[i]) if key: value = int(re.search('#.+\\.', a[i])[0][1:-1]) result[key[0][1:-1]] = value return result" "import re def main(x): x = x.replace('\n', ' ') x = x.replace('> ', '>') res = re.findall('>\\w+|> \\w\\w+', x) res += re.findall('[make -]\\d+', x) z = {} for i in range(len(res) // 2): res[i] = res[i].replace(' ', '') res[i] = res[i].replace('>', '') res[i] = res[i].replace('> ', '') res[i + len(res) // 2] = int(res[i + len(res) // 2].replace('make ', '')) z[res[i]] = res[i + len(res) // 2] return z" "def main(string): dictionary = {} new_str = string.split('(') for str in new_str[1:]: a = str.split('=') b = a[1].split(';') dictionary[str.split(')')[0].replace(' ', '')] = int(b[0].replace(' ', '')) return dictionary" "import re def main(a): result = {} a = a.split('') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '').replace('#', '') key = re.search('"".+""', a[i]) if key: values = re.search('{.+}', a[i])[0][1:-1].split(',') result[key[0][1:-1]] = [int(i) for i in values] return result" "import re def main(source): p = '[a-zA-Z0-9_]+\\s?<=\\s?[a-zA-Z0-9_]+' values = re.findall(pattern=p, string=source) response = {} for val in values: response[val.replace(' ', '').split('<=')[0]] = val.replace(' ', '').split('<=')[1] return response" "def main(x): strs = x.strip('<%%>').split('.end;') dictionary = {} for i in range(len(strs) - 1): seps = strs[i].lstrip('\n').split('==>') stripped_seps = seps[1].strip().strip('.') values = seps[0].split()[-1] dictionary[stripped_seps] = values return dictionary" "def main(x): x = x.replace('do', '').replace('[', '').replace('equ', '').replace('#', '').replace(']', '').replace(""@'"", '').replace(""'."", '').replace('end', '').replace('\n', '').replace(' ', '') x_parts = x.split(',') x_parts.pop(-1) x_parts1 = [i.split('->') for i in x_parts] result = {} for i in x_parts1: value = int(i[0]) key = i[1] result[key] = value return result" "def main(str): dict = {} value = [] str = str.replace(']', ';') str = str.replace(']', ';') str = str.replace(' ', '') str = str.replace('\n', '') while True: value.append(int(str[str.find('#') + 1:str.find(';')])) str = str[str.find(';') + 1:] if str[1] == ':': hernya = str[str.find(':') + 1:str.find(';') - 1] d = dict.fromkeys([hernya], value) dict.update(d) str = str[str.find(';') + 1:] value = [] if str == 'end': break return dict" "import re def is_digit(string): if string.isdigit(): return True else: try: float(string) return True except ValueError: return False def main(source): p = 'set(\\s*)?(\\\\n)?(-?[0-9]*)(\\s)?(\\\\n)?(\\|\\>(\\s)?)([A-Za-z0-9-_]*)' matches = re.findall(pattern=p, string=source) answer = {} numbers = [] for match in matches: for symbol in match: if is_digit(symbol): numbers.append(symbol) for i in range(len(matches)): answer[matches[i][len(matches[i]) - 1]] = int(numbers[i]) return answer" "import re def main(input_str): c = 0 input_str = input_str.replace('\n', '').replace(' ', '') values = [x.replace('#', '').replace('<==', '') for x in re.findall('<==#-?\\w+', input_str)] keys = [x.replace('""', '') for x in re.findall('""\\w+""', input_str)] res_list = {} for key in keys: res_list[key] = int(values[c]) c += 1 return res_list" "import re def main(source): matches = re.findall('\\"".*?\\""', source) keys = re.findall('\\`.*?\\;', source) response = {} for i in range(len(matches)): keys[i] = keys[i][1:] keys[i] = keys[i][:-1] matches[i] = matches[i][:-1] matches[i] = matches[i][1:] response[keys[i]] = matches[i] return response" "from string import ascii_lowercase def main(inp): inp = inp.split() ans = dict() t = 0 for i in inp: if t: ans[k] = int(i) t = 0 if '@' in i: i = i.replace('@', '') (k, v) = ('', '') f = 0 for j in range(len(i)): if ord(i[j]) == 39: f += 1 continue if f == 1: k += i[j] if f == 2: v += i[j] if v == '': t = 1 else: ans[k] = int(v) return ans" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('equ(.*?)[;]', s) for i in d: (key, value) = i.split(':') key = key.replace(' ', '') value = value.replace(' ', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('}', '') ans[key] = int(value) return ans" "import re def main(source): p = '[-0-9]+\\s?=>\\s?[a-zA-Z0-9_]+' values = re.findall(pattern=p, string=source) response = {} for val in values: response[val.replace(' ', '').split('=>')[1].replace('\n', '')] = int(val.replace(' ', '').split('=>')[0]) return response" "def main(s: str): res = {} s = s.replace('\\begin val', '') s = s.replace('begin', '') s = s.replace('val', '') s = s.replace('\\', '') s = s.replace('\n', '') s = s.replace(' ', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace('end', ' ') for el in s.split(): res[el.split('->')[1]] = el.split('->')[0] return res" "def main(s: str): res = {} s = s.replace('{', '') s = s.replace('}', '') s = s.replace('{{', '') s = s.replace('}}', '') s = s.replace('var', '') s = s.replace('.', '') s = s.replace('\\', '') s = s.replace('\n', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace('end', ' ') s = s.replace(' ', '') s = s.replace('||', 'var') s = s.replace('|', '') s = s.replace('var', ' ') for el in s.split(): res[el.split('==>')[1]] = int(el.split('==>')[0]) return res" "import re def parseString(str): values = re.findall(""(?<=@')[^'@]+(?=')"", str) keys = re.findall('(?<=to[\\s])[\\w]*(?=;)', str) list = {} for i in range(len(values)): list[keys[i]] = values[i] return list def main(x): return parseString(x)" "import re def main(source): p = 'begin[\\n ]new[ \\n]?#\\(\\n?([ 0-9-\\n]*)\\)' p += '[\\n ]?\\|>[\\n ]?\\""([A-Za-z_0-9]*)\\""' matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[1]] = [] for value in match[0].replace('\n', ' ').split(' '): if value == '': continue response[match[1]].append(int(value)) return response" "def main(data): data = data.replace('\n', ' ') data = data.lstrip('') data = data.strip('').strip() data = data.split(') (') some = [] for i in data: some += i.split(')(') dictionary = {} for line in some: (key, values) = line.split('<|') key = key.replace('(', '') values = values.replace('{', '') values = values.replace('}', '') values = values.replace('(', '') values = values.replace(')', '') values = values.strip() values = values.split(' ') values = list(map(lambda x: x.strip(), values)) key = key.strip() dictionary[key] = values return dictionary" "import re def main(s): a = re.findall('(?<=\\()\\w+|(?<=\\"")\\w+', s) return dict(zip(a[1::2], a[::2]))" "import re def main(string): key_pattern = '\\`([\\w]*)\\s*\\:' value_pattern = '\\""([\\w]*)\\s*\\""' keys = re.findall(pattern=key_pattern, string=string) values = re.findall(pattern=value_pattern, string=string) return dict(zip(keys, values))" "import re as e def main(text): r = e.findall(""\\s?.*?@'(.*?)'.*?array\\((.*?)\\)\\s?<\\/block>"", text, e.DOTALL) dct = {} for tch in r: (name, numbers) = tch dct[name] = list(map(lambda x: x.strip(' ').strip('\n'), numbers.split(';'))) return dct" "def main(string): i = 0 string = string.replace('\n', '').replace(' ', '') key = '' word = '' dictionary = {} while i < len(string) - 5: if i + 5 < len(string) and string[i:i + 5] == 'local': i += 5 while string[i] != '=': key += string[i] i += 1 i += 3 while string[i] != ';': word += string[i] i += 1 dictionary[word] = key key = '' word = '' i += 1 return dictionary" "import re def main(string): s = string.replace('\n', '') d = dict() li = [] li_flag = '' while li_flag is not None: entry = re.search('{(.*?)}', s).group(1).replace(""''"", '') li.append(entry) s = s.split('.', 1)[1] li_flag = re.search('{(.*?)}', s) for i in range(len(li)): current_entry = li[i] d_flag = '' while d_flag is not None: key = re.search('opt.?""(.*?)""', current_entry).group(1) value = re.search(""'(.*?)'"", current_entry).group(1) d.setdefault(key, value) current_entry = current_entry.replace(value, '') current_entry = current_entry.replace(""''"", '') d_flag = re.search(""'(.*?)'"", current_entry) return d" "def main(x): di = {} al = [] sl = [] a = x.replace(' ', '') a = a.replace('\n', '') a = a.replace('`', '') a = a.split(',') a = a[:-1] for i in range(0, len(a)): string = a[i] pos1 = string.find('decl') + 4 pos2 = string.find('>') sl.append(int(string[pos1:pos2 - 2])) al.append(string[pos2 + 1:-2]) di = dict(zip(al, sl)) return di" "def main(x): di = {} al = [] sl = [] a = x.replace(' ', '') a = a.replace('\n', '') a = a.replace(""'"", '') a = a.split('end,') a = a[:-1] for i in range(0, len(a)): string = a[i] pos1 = string.find('#') pos2 = string.find('=>') sl.append(int(string[pos1 + 1:pos2])) al.append(string[pos2 + 2:-1]) di = dict(zip(al, sl)) return di" "import re def main(s): p = re.findall('\\.do\\s*(.*)\\.end', s, re.DOTALL)[0] matches = re.findall('<%\\s*loc\\s*#(-?\\d*)\\s*==>\\s*(\\w+)\\s*%>;', p) d = {} for match in matches: d[match[1]] = int(match[0]) return d" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('ke.*?=:', a) tre = re.findall('=:.*?<', a) for i in range(len(one)): one[i] = one[i].replace(' ', '') one[i] = one[i].replace('ke', '') one[i] = one[i].replace('=:', '') one[i] = one[i].replace(""'"", '') for i in range(len(tre)): tre[i] = tre[i].replace('=:', '') tre[i] = tre[i].replace('<', '') tre[i] = tre[i].replace(' ', '') x = {} for i in range(len(tre)): x.setdefault(tre[i], one[i]) return x" "import re def main(x): bible = {} word_1 = re.findall('->\\s?\\w+\\d*;', x) word_2 = re.findall('#-?\\d+', x) for i in range(0, len(word_1)): a = re.findall('\\w+', word_1[i]) word_1[i] = a[0] word_2[i] = int(word_2[i][1:]) bible[word_1[i]] = word_2[i] return bible" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('loc(.*?)>>', s) for i in d: (value, key) = i.split('=:') key = key.replace(' ', '') key = key.replace('@', '') key = key.replace(""'"", '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace('q(', '') value = value.replace(')', '') value = value.replace('.', '') value = value.split() ans[key] = value return ans" "import re def main(source): p = ""'(.*?)'"" matches = re.findall(pattern=p, string=source) response = {} for match in range(0, len(matches) - 1, 2): response[matches[match + 1]] = matches[match] return response" "def main(source): long = len(source) n = t = z = k = x = y = 0 s = source a1 = [0, 0, 0, 0] a2 = [0, 0, 0, 0] b1 = [0, 0, 0, 0] b2 = [0, 0, 0, 0] P = {} for n in range(len(source)): if s[n] == '#': k = n + 1 if ord(s[k]) < 43 & ord(s[k]) > 58: s[k] = s[k + 1] k = k + 1 a1[t] = k if s[n] == '=': z = n - 1 if ord(s[z]) == 32: z = z - 1 a2[t] = z b = source[a1[t]:a2[t] + 1] if s[n] == ':': x = n + 1 if ord(s[x]) < 48: x = x + 1 b1[t] = x if s[n] == '.': y = n - 1 b2[t] = y a = source[b1[t]:b2[t] + 1] P[a] = int(b) t += 1 return P" "def make_arr(arr): arr = arr.split('<=') key = arr[0] value = int(arr[1]) return (key, value) def main(s): s = s.replace('((', '') s = s.replace('))', '') s = s.replace('<<', '') s = s.replace('>>', '') s = s.replace('def', '') s = s.replace('\n', '') s = s.replace('`', '') s = s.replace(';', '') s = s.replace(' ', '') s = s.split(',') s.pop() d = {} for i in s: (key, value) = make_arr(i) d[key] = value return d" "def make_arr(arr): arr = arr.split('=:') key = arr[1].replace('""', '') value = arr[0][1:-1].replace('""', '').split('.') return (key, value) def main(s): s = s.replace('<:', '') s = s.replace(':>', '') s = s.replace('@', '') s = s.replace('glob', '') s = s.replace('list', '') s = s.replace('"";', '""') s = s.replace('\n', '') s = s.replace(' ', '') s = s.split(';') s.pop() d = {} for i in s: (key, value) = make_arr(i) d[key] = value return d" "def make_arr(arr): arr = arr.split('<=') key = arr[0] value = int(arr[1]) return (key, value) def main(s): s = s.replace('', '') s = s.replace('', '') s = s.replace('let', '') s = s.replace('{', '') s = s.replace('}', '') s = s.replace('\n', '') s = s.replace(' ', '') s = s.split(';') s.pop() d = {} for i in s: (key, value) = make_arr(i) d[key] = value return d" "def main(x): x = x.replace(' let', '').replace('\nlet', '').replace('is array', '') x = x.replace('((let', '').replace('))', '').replace('\nis array', '') x = x.replace(')', '').replace('is\narray', '').replace('let ', '') x = x.replace('(( let', '').replace('((', '') x = x.replace('<<', '').replace('>>', '').replace(""'"", '') x = x.replace(' ', '').replace('\n', '') x = x.replace('.', ""', "") x = x.replace(', ', "", '"") x = x.replace('(', ""('"") x = x.replace('""', ""'"") blocks = x.split(';')[:-1] result = dict() for block in blocks: key_value = block.split('(') result[key_value[0]] = [x.strip().replace(""'"", '') for x in key_value[1].split(',')] return result" "def main(s): s = s.replace(' ', '') words = [] while s.find('@""') != -1: start = s.find('@""') end = s.find('""', start + 2, len(s)) words.append(s[start + 2:end]) s = s[0:start] + s[end + 1:] dictionary = dict(zip(words[1::2], words[0::2])) return dictionary" "import re def main(text): p = re.findall('\\(\\s*(.*)\\)', text, re.DOTALL)[0] a = re.findall('\\(\\(\\s*make\\s*list\\s*(\\((?:\\s*\\w+\\s*\\.?)*\\))\\s*to\\s*(\\w+)\\s*\\)\\);', p) dict1 = {} for i in a: b = re.findall('\\w+', i[0]) dict1[i[1]] = b return dict1" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('variable(.*?)%', s) for i in d: (key, value) = i.split('::=') key = key.replace(' ', '') key = key.replace('@', '') key = key.replace(""'"", '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace('q(', '') value = value.replace(')', '') value = value.replace('.', '') ans[key] = int(value) return ans" "import re def main(s): pattern = '\\( *(.*?) *\\) *=> *(.*?) *]' parsed_s = re.findall(pattern, s.replace('\n', '')) return {key: list(map(int, value.replace(' ', '').split('.'))) for (value, key) in parsed_s}" "import re def main(example): exr = '\\s*declare\\s*q\\(([^)]*)\\)\\s*:=\\s*\\[([^\\]]*)\\]' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split(','): j = j.strip().strip(""'"") s.append(j) key = match[0] d[key] = s return d" "import re def main(s): pattern1 = re.findall('\\""\\w+', s) temp = ' '.join(pattern1) pattern1 = re.findall('\\w+', temp) pattern2 = re.findall('\\(\\w+', s) temp = ' '.join(pattern2) pattern2 = re.findall('\\w+', temp) d = dict() length = len(pattern1) for i in range(0, length): d[pattern1[i]] = pattern2[i] return d" "from pprint import pprint def main(text): text = text.replace('\n', ' ') text = text.replace('begin', '') text = text.replace('.do', '') text = text.replace('auto', '') text = text.replace('@', '') text = text.replace(""'"", '') text = text.replace(' end', '') text = text.replace(' ', '') text = text.split('.end') result = {} for i in range(len(text) - 1): text[i] = text[i].split('|>') result = {text[i][1]: text[i][0] for i in range(0, len(text) - 1)} return result" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('
(.*?)
', s) for i in d: (value, key) = i.split('to') value = value.replace('var', '') key = key.replace(' ', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('#', '') key = key.replace('.', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace('q(', '') value = value.replace(')', '') value = value.replace('.', '') ans[key] = int(value) return ans" "import re def main(x): pattern = '(?:do decl array\\(.+?\\) ?to ?`(?:\\w+?)\\. done)+' x = x.replace('\n', ' ') res = {} found = [item for item in re.findall(pattern, x)] for item in found: array_items = re.search('array\\((.+?)\\)', item).group(1).strip().split() array_name = re.search('to\\s`(.+?)\\.', item).group(1).strip() res[array_name] = array_items return res" "def main(data): data = data.replace('\n', ' ') data = data.replace(' ', '') data = data.replace('||data', '') data = data.replace('||', '') data = data.replace('q(', '').replace(')', '') data = data.split('||||data') dictionary = {} for line in data: (*z, key, values) = line.split('<-') values = values.lstrip('{') values = values.rstrip('}') values = values.split(',') values = list(map(lambda x: x.strip(), values)) key = key.strip() dictionary[key] = values return dictionary" "import re def main(source): p = 'do\\s*new\\s*([A-Za-z0-9-_]*)\\s*\\""([A-Za-z0-9-_]*)\\"".' matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[0]] = match[1] return response" "def main(example): res = {} example = example.split('.')[:-1] for i in range(len(example)): s = example[i] key = s[s.find('q(') + 2:s.find(');')].strip() val = s[s.find(""'"") + 1:s.rfind(""'"")].strip() res[key] = val return res" "def main(s): s = s.partition('\n')[0] + ' ' + s.partition('\n')[2] sq = s.split('||') s = ''.join(sq) sq = s.split('make') s = ''.join(sq) sq = s.split('@') s = ''.join(sq) sq = s.split('.') s = ''.join(sq) sq = s.split('.') s = ''.join(sq) sq = s.split('::=') s = ''.join(sq) sq = s.split('""') s = ' '.join(sq) s = s.strip() sq = s.split(' ') sq[:] = [x for x in sq if x] j = 0 a = [] b = [] for i in range(len(sq)): if sq[i] == '': j = j + 1 if j == 3: break elif is_int(sq[i]): value = sq[i] b.append(int(value)) j = 0 else: key = sq[i] key = key.split('""') key = ''.join(key) a.append(key) res = dict(zip(a, b)) return res def is_int(q): try: if not q.isalpha(): int(q) return True except ValueError: return False" "import re def main(s): exr1 = '<:\\s*store\\s*@\\""([A-Za-z0-9_]*)\\""\\s*\\|' exr2 = '>\\s*@\\""([A-Za-z0-9_]*)\\"".\\s*:>;\\s*' exr = exr1 + exr2 matchces = re.findall(pattern=exr, string=s) d = {} for match in matchces: key = match[1] d[key] = match[0] return d" "import re def main(example): exr = '\\s*new\\s*([^)]*)\\s*<-\\s*#\\(([^)]*)\\)' matches = re.findall(exr, example) d = {} for match in matches: a = [] for j in match[1].split(','): j = j.strip().strip(""'"").strip('#') a.append(int(j)) key = match[0].strip() d[key] = a return d" "def main(text): d = {} a = text.split('store')[1:] for i in a: (k, v) = i.split('<|') k = k.strip() v = [j.split('""')[1] for j in v.split(',')] d[k] = v return d" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('"".*?""', a) tre = re.findall('q.*?->', a) for i in range(len(one)): one[i] = one[i].replace('""', '') for i in range(len(tre)): tre[i] = tre[i].replace('q', '', 1) tre[i] = tre[i].replace('(', '') tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace(')', '') tre[i] = tre[i].replace('->', '') x = {} for i in range(len(one)): one[i] = x.setdefault(one[i], tre[i]) return x" "def main(s: str): res = {} temp = [] s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('begin', '') s = s.replace('
', '') s = s.replace('
', '') s = s.replace('store', '') s = s.replace('toq', '') s = s.replace(';end', '') s = s.replace('(', ';') s = s.replace(')', '') for i in s.split(';'): temp.append(i) for i in range(0, len(temp) - 1, 2): res[temp[i + 1]] = temp[i] return res" "def main(data): dict_result = {} data = data.replace('\n', '') data = data.replace('||', '') data_list = data.split('\\begin') data = ''.join(data_list) data_list = data.split('\\end') data = ''.join(data_list) data_list = data.split('\\end') data = ''.join(data_list) data = data.split('.') data.pop() result_list = [] for data_str in data: data_lst = data_str.split('->') data_lst[0] = data_lst[0].replace('define', '').replace(' ', '') data_lst[1] = data_lst[1].replace('q(', '').replace(')', '').replace(' ', '') result_list.append(data_lst) for data_iter in result_list: dict_result[data_iter[1]] = int(data_iter[0]) return dict_result" "import re def main(a): result = {} a = a.split('local') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('.+<=', a[i]) if key: value = re.search('==.+?>', a[i])[0][2:-1] result[key[0][:-2]] = value return result" "def make_arr(arr): arr = arr.split('<=') key = arr[0][1:-1] value = arr[1][3:-1].split('#') for i in range(len(value)): value[i] = int(value[i]) return (key, value) def main(s): s = s.replace('do make', '') s = s.replace('make', '') s = s.replace('done', '') s = s.replace('let', '') s = s.replace('\n', '') s = s.replace(' ', '') s = s.split('.') s.pop() d = {} for i in s: (key, value) = make_arr(i) d[key] = value return d" "import re def main(x): a = re.findall('-?\\d+[\\s*=]', x) b = re.findall('>\\s*[a-zA-Z_0-9]+', x) res = {} for i in range(len(a)): a[i] = re.sub('\\s*=', '', a[i]) b[i] = re.sub('>\\s*', '', b[i]) res[b[i]] = int(a[i]) return res" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('`.*?;', a) tre = re.findall('#.*?>', a) for i in range(len(one)): one[i] = one[i].replace(' ', '') one[i] = one[i].replace('`', '') one[i] = one[i].replace(';', '') for i in range(len(tre)): tre[i] = tre[i].replace('#', '') tre[i] = tre[i].replace('->', '') tre[i] = int(tre[i]) x = {} for i in range(len(one)): one[i] = x.setdefault(one[i], tre[i]) return x" "import re as e def main(text): r = e.findall('<<\\s*#\\((.*?)\\)\\s*=>\\s*(.*?);\\s*>>', text, e.DOTALL) dct = {} for tch in r: (numbers, name) = tch dct[name] = list(map(int, numbers.replace('\n', ' ').split('#')[1:])) return dct" "def main(data): dict_result = {} data = data.replace('\n', ' ').replace('', '') data = data.replace('global', '').replace('', '') data = data.replace('do ', '').replace('od,', '') data_list = data.split('.') data_list.pop() result_list = [] for data in data_list: buffer = [] data = data.split('<==') data[0] = data[0].replace(' ', '') data[1] = data[1].replace('[', '').replace(']', '') data[1] = data[1].replace(' ', ' ').split(' ') if data[1][0] == '': data[1].pop(0) if data[1][-1] == '': data[1].pop() for num in data[1]: buffer.append(int(num)) dict_result[data[0]] = 0 dict_result[data[0]] = buffer data.pop(0) result_list.append(data) return dict_result" "import re def main(s): pattern = 'global (\\w+) ?\\|> ?@\\""(\\w+)\\""' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value for (value, key) in parsed_s}" "def main(x): x = x.replace('do ', '').replace('do\n', '').replace('equ ', '').replace('equ\n', '').replace('{', '').replace('}', '').replace('is\n', '@').replace('is ""', '@').replace('is""', '@').replace('\n', '').replace('end', '').replace(',', '').replace('""', '').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('@') for i in x_parts] result = {} for i in x_parts1: result[i[0]] = i[1] return result" "import re def main(a): a = a.replace('\n', '') one = re.findall('"".*?""', a) tre = re.findall('make.*?=>', a) for i in range(len(one)): one[i] = one[i].replace('""', '') for i in range(len(tre)): tre[i] = tre[i].replace('make', '') tre[i] = tre[i].replace('=', '') tre[i] = tre[i].replace('>', '') tre[i] = tre[i].replace('}', '') tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace('{', '') tree = [] tree = tre[i].split(',') for j in range(len(tree)): tree[j] = int(tree[j]) tre[i] = tree x = {} for i in range(len(tre)): one[i] = x.setdefault(one[i], tre[i]) return x" "import re def main(example): exr = re.compile('#-?\\d*\\s?->\\s?[0-9a-z_]*') mathes = exr.findall(example) answer = {} for i in range(len(mathes)): string = mathes[i].replace('#', '').replace(' ', '') words = string.split('->') answer[words[1]] = int(words[0]) return answer" "def main(x): x = x.replace(' ', '') x = x.replace('
', '') x = x.replace('
', '') x = x.replace('\n', '') x = x.replace('<:locarray(`', '') x = x.replace(':>;', '') x = x.replace('@', '') x = x.replace(""'"", '') x = x.replace(',', '') d = {} while x.find('->') != -1: i = x.find('->') tempstr = '' tempkey = '' for j in x[i:]: if j == ';': break else: tempstr += j for j in x[:i]: if j == ')': break else: tempkey += j tempkey = tempkey.replace(';', '') key = tempkey.split('`') word = tempstr[2:] new = x.find(tempstr) x = x[new + len(tempstr):] d[word] = key return d" "import math def main(x): x = x.replace(' ', '') x = x.replace('
', '') x = x.replace('
', '') x = x.replace('\n', '') x = x.replace('#', '') x = x.split('.') out = {} for i in x[:len(x) - 1]: out.update({i.split('=')[0][3:]: int(i.split('=')[1])}) return out" "import re def main(string): reg = re.compile(""\\w*\\s?<=\\s?\\'[a-z0-9_]*\\'"") matches = reg.findall(string) answer = {} for matche in matches: answer_1 = matche.replace(""'"", '').replace(' ', '').replace('\n', '') answer_1 = answer_1.split('<=') answer[answer_1[0]] = answer_1[1] return answer" "def main(x): x = x.replace(' ', '') trash = x.find('%') + 2 x = x[trash:] result = {} while True: l_val = x.find('#') + 1 r_val = x.find('>') - 1 val = int(x[l_val:r_val]) l_key = x.find('""') + 1 r_key = x.find('|') - 1 key = x[l_key:r_key] result[key] = val x = x[r_key + 4:] if x.find('#') == -1: break return result" "import re as e def main(text): result = e.findall("",*[<%]?\\s?do\\s?var\\s?#\\(([\\s@'_\\w]*?)\\)\\s?to\\s?(.+?)\\s?done\\s?[%>]*"", text, e.M) dct = {} for strItem in result: (nicknames, name) = strItem nicknames = nicknames.replace(' ', '') nicknames = nicknames.replace(""'"", '') nicknames = nicknames.replace('\n', '') nicknames = nicknames.split('@') nicknames.pop(0) dct[name] = nicknames return dct" "def main(x): x = x.replace(' ', '') x = x.replace('do', '') x = x.replace('define', '') x = x.replace(');', '') x = x.replace('\n', '') x = x.replace('.(', '') d = {} while x.find('.') != -1: m = [] i = x.find('=') tempstr = '' tempkey = '' for j in x[i + 2:]: if j == '}': m.append(int(tempstr[1:])) break if j == ';': m.append(int(tempstr[1:])) tempstr = '' else: tempstr += j for j in x[:i]: if j == '': break else: tempkey += j key = tempkey[1:] d[key] = m new = x.find(tempstr) x = x[new + len(tempstr):] if x == '}.end': break return d" "def main(string): d = {} while len(string) != 0: string = string.partition('opt')[2] if len(string) == 0: break key = string.partition(');')[0] value = key.partition('->')[0] key = key.partition('->')[2] value.strip() key = key.strip() leng = len(key) key = key[:leng - 1] d[key] = int(value) return d" "def main(s): x = {} ind = '' val = '' for i in range(len(s) - 1): if (s[i] == 'k') & (s[i + 1] == 'e'): for j in range(i + 2, len(s)): if s[j] == '<': break ind += s[j + 1] ind = ind[0:-1] if ind[len(ind) - 1] == ' ': ind = ind[0:-1] if s[i + 1] == '#': for j in range(i + 2, len(s)): if s[j] == ')': break val += s[j] x[ind] = int(val) ind = '' val = '' return x" "import re def main(s): pattern = 'loc[\\w:=\\s\\.]*' res = re.findall(pattern, s) ' '.join(res) pattern2 = '\\w[\\w\\ ]*' res = re.findall(pattern2, s) res = ' '.join(res) res = res.replace('do', '') res = res.replace('loc', '') res = res.replace('od', '') res = res.split(' ') res = list(filter(None, res)) res = dict(zip(res[::2], res[1::2])) return res" "def main(x): x = x.replace('
', '').replace('
', '').replace('loc ', '').replace('loc\n', '').replace('loc[', '').replace('[', '').replace(']', '@').replace('\n', ' ').replace(' ', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('@=:') for i in x_parts] res = {} for i in x_parts1: value = i[0].split(',') res[i[1]] = value return res" "import re def main(s): p = 'variable\\s*(\\w+)\\s*is\\s*{(\\s*(?:\\s*-?\\d+\\s*,?)+)}' d = {} for (key, value) in re.findall(p, s): d[key] = list(map(int, re.findall('-?\\d+', value))) return d" "import re def main(y): d = {} word1 = re.findall('""\\w+_?\\d*""', y) word2 = re.findall('-?\\d+\\s%', y) for i in range(len(word1)): word1[i] = word1[i][1:-1] word2[i] = int(word2[i][:-2]) d[word1[i]] = word2[i] return d" "import re def main(source): p = 'do declare .[^\\s,<]{3,10}' source = source.replace('\n', ' ') matches = re.findall(p, source) for i in range(len(matches)): matches[i] = matches[i].replace('do declare ', '') p = '[^_\\d][-+]?\\d+' matches_one = re.findall(p, source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace(' ', '') if matches_one[j][0] == '=': matches_one[j] = matches_one[j].replace('=', '') response[matches[j]] = int(matches_one[j]) return response" "import re def main(text: str) -> dict[str, list[str]]: text = text.replace('\n', ' ') result = dict() data_list = re.findall('t\\s*\\(.*?\\)', text) keys = re.findall('\\(\\w*\\)', text) for n in range(len(keys)): keys[n] = keys[n].replace('(', '') keys[n] = keys[n].replace(')', '') data_list[n] = re.sub('t\\s*\\(\\s*', '', data_list[n]) data_list[n] = re.sub('\\s*\\)', '', data_list[n]) result[keys[n]] = data_list[n].split(' ') return result" "def main(s): dict = {} list = s.split(';') for (i, l) in enumerate(list): if i == len(list) - 1: break line = l.split('set') r = line[-1].split('=>') result = r[0].replace(' ', '').replace('\n', '') dict[r[-1].replace(' ', '').replace('\n', '')] = result return dict" "import re def main(string): string = string.replace('\n', ' ') name_pattern = '(store.\\w*)' value_pattern = '(`\\w*)' names = re.findall(name_pattern, string) values = re.findall(value_pattern, string) for x in range(len(names)): names[x] = names[x][6:] values[x] = values[x][1:] return dict(zip(names, values))" "import re def main(str): pattern = '(?<=[{]).*?(?=[)])' pattern2 = ""(?<=[@][']).*?(?=['])"" pattern3 = '(?<=[:][""]).*?(?=[""][.])' result = {} str = str.replace(' ', '') str = str.replace('\n', '') access = re.findall(pattern, str) for i in access: txt = i.split('=') key = re.findall(pattern3, txt[1])[0] value = re.findall(pattern2, txt[0]) result[key] = value return result" "import re def main(s): s = re.sub('[\\n:]', '', s) s = s.replace(' ', '') text = s.split(',') dict = {} for i in text: if i != '||': values = re.findall(""('[^']+')"", i) key = re.split('==>', i)[1][:-1] for j in range(len(values)): values[j] = values[j].replace(""'"", '') dict[key] = values return dict" "def main(string): string = string[1:] d = {} while string.find('(') != -1: key = string[string.find('>') + 1:string.find(';')] value = string[string.find('#') + 1:string.find('|')] string = string[string.find(')') + 1:] d[key.strip()] = int(value.strip()) return d" "import re def main(example): exr = '\\`([^)]*)\\s*\\|>\\s*q\\(([^)]*)\\)' d = {} matches = re.findall(exr, example) for match in matches: for j in match: if j == match[1]: pass else: key = match[1].strip() d[key] = j.strip() return d" "import re def main(example): exr1 = '\\s*do\\s*[^ <\\n]*' exr2 = '#-?\\d+' d = {} matches = re.findall(exr1, example) matches2 = re.findall(exr2, example) for i in range(len(matches)): matches[i] = re.sub('\\w{2}\\s', '', matches[i]) matches[i] = matches[i].strip() matches2[i] = matches2[i].strip('#').strip(""'"") d[matches[i]] = int(matches2[i]) return d" "import re def main(x): dict_X = {} x = re.findall('(.*?)', x, re.DOTALL)[0] x = re.findall('do val(.*?)end;', x, re.DOTALL) for i in range(len(x)): temp_list = re.split('\\bis\\b', x[i]) result = re.findall('\\w+', temp_list[0])[0] znach = re.findall('\\w+', re.sub('\\bq\\b', '', temp_list[1]))[0] dict_X[result] = znach return dict_X" "def main(x): x = x.replace('[', '') x = x.replace(']', '') x = x.replace('\n', ' ') x = x.strip() x = x.split('.') result = {} for i in x: if len(i) == 0: continue else: tmp = i[i.rfind('""') + 1:] tmp = tmp.strip() tmp = tmp.split(' ') tmp1 = i[i.find('""') + 1:i.rfind('""')] result.update({tmp1: tmp}) return result" "import re def main(s): matches1 = re.findall('`\\s*(\\w+)', s) matches2 = re.findall('::=\\s*(.\\d+)', s) d = {} n = len(matches1) for i in range(n): d[matches1[i]] = int(matches2[i]) return d" "import re def main(example): exr = 'global(?: |\\n)(.*?)(?: |\\n)?<-(?: |\\n)?(.*?)\\.' d = {} matches = re.findall(exr, example, re.MULTILINE) for match in matches: f = match[1].strip().replace(""'"", '') key = match[0] d[key] = int(f) return d" "def f8(source): sections = source.split(';') clean_sections = list() for section in sections: clean_section = section.replace('do', '').replace('local', '').replace(' od', '').replace('od ', '').replace('{', '').replace('}', '').replace('\n', '') clean_sections.append(''.join(list(filter(lambda char: char != ' ', clean_section)))) clean_sections = list(filter(lambda string: '=>' in string, clean_sections)) return {string.split('=>')[1]: string.split('=>')[0] for string in clean_sections} def main(n): return f8(n)" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('r.*?=', a) tre = re.findall('#.*?<', a) for i in range(len(one)): one[i] = one[i].replace(' ', '') one[i] = one[i].replace('r', '', 1) one[i] = one[i].replace('=', '') for i in range(len(tre)): tre[i] = tre[i].replace('#', '') tre[i] = tre[i].replace('<', '') tre[i] = tre[i].replace(' ', '') tre[i] = int(tre[i]) x = {} for i in range(len(one)): one[i] = x.setdefault(one[i], tre[i]) return x" "def main(line): _list = line.split('end.') _list.pop(len(_list) - 1) _dict = {} for i in _list: key = i[i.find(""'"") + 1:] key = key[:key.find(""'"")] value = i[i.find('#') + 1:] value = value[:value.find('->')] value = value.strip() _dict[key] = int(value) return _dict" "import re def main(s): pattern = 'opt ? ?(\\w+) ? is ?\\""(\\w+)""' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value for (key, value) in parsed_s}" "def main(row): ans = {} row = row.replace('\n', ' ') row = row.replace('', '') row = row.replace('{', '') row = row.replace('declare ', '') row = row.replace('.', '') row = row.replace(' ', '') row = row.replace('list(', '') row = row.replace(')', '') row = row.replace('#', ' ') row = row.replace('.', '') row = row.split('}') row.pop() for i in row: i = i.split(':=') i[1] = i[1].split(' ') del i[1][0] for j in range(len(i[1])): i[1][j] = int(i[1][j]) ans |= {i[0]: i[1]} return ans" "def main(s): lst_keys = [] lst_values = [] dct = {} c = s.count('begin') for k in range(c): i = s.find(""'"") j = s.find(""'"", i + 1, i + 15) ii = s.find('(', 1) jj = s.find(')') lst_values.append(value(s[ii:jj + 1])) lst_keys.append(s[i + 1:j]) s = s[jj + 3:] for i in range(len(lst_keys)): dct[lst_keys[i]] = lst_values[i] return dct def value(s): lst = [] c = s.count('#') for k in range(c): i = s.find('#') j = s.find(' ', i, i + 10) lst.append(int(s[i + 1:j])) s = s[j + 1:] return lst" "import re def main(source): p = 'let\\s*([A-Za-z0-9_]*)\\W*#(\\W*[A-Za-z0-9_]*).' matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[0]] = int(match[1]) return response" "def main(_list): _list = _list.split('.') _list.pop() _dict = {} for line in _list: key = line[line.find('decl') + 4:] key = key[:key.find(':')] key = key.strip() value_list = line[line.find('{') + 1:line.find('}')] value_list = value_list.split(',') for i in range(len(value_list)): value_list[i] = value_list[i].replace('#', '') value_list[i] = value_list[i].strip() value_list[i] = int(value_list[i]) _dict[key] = value_list return _dict" "def main(a): a = a.replace(' ', '') a = a.replace('\n', '') b = {} start1 = '
var' end1 = '=>' start2 = ""=>'"" end2 = ""';
"" n = a.count('
') for i in range(n): b[a[a.index(start2) + len(start2):a.index(end2)]] = a[a.index(start1) + len(start1):a.index(end1)] a = a[a.find(end2) + len(end2):] return b" "def make_arr(arr): arr = arr.split(':') key = arr[0] value = arr[1][1:-1] value = value.split(',') value = list(map(lambda x: int(x), value)) return (key, value) def main(s): s = s.replace('.do', '') s = s.replace('begin', '') s = s.replace('define', '') s = s.replace('end', '') s = s.replace('.', '') s = s.replace('\n', '') s = s.replace(' ', '') s = s.replace('#', '') s = s.replace('""', '') s = s.split(';') s.pop() d = {} for i in s: (key, value) = make_arr(i) d[key] = value return d" "import re def main(example): exr = 'global(?: |\\n)?\\[(.*?)\\](?: |\\n)?==>(?: |\\n)?\\""(.*?)\\""' match = re.findall(exr, example, re.S) d = {} arr = {} for i in range(len(match)): vals = match[i][0].replace('""', '').strip().split(';') for j in range(len(vals)): vals[j] = vals[j].strip() arr[match[i][1]] = vals return arr" "import re def main(s: str): res = dict() m1 = re.findall('
\\s*equ\\s*#.\\d*\\s*to\\s*\\w*\\d*.\\s*
', s) for match in m1: match = match.replace('
equ #', '') match = match.replace('.
', '') match = match.replace('.
', '') match = match.replace('\n', '') match = match.replace(' ', '') (v, k) = match.split('to') v = v.replace('
equ#', '') res[k] = int(v) return res" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') x = x.replace('%>', '') while x != ',': index1 = x.find('array(') + 6 index2 = x.find(')==>') index3 = x.find('==>') + 3 index4 = x.find(';') mas = [] tmp = x[index1:index2].split(';') for ii in tmp: mas.append(int(ii)) mdict[x[index3:index4]] = mas x = x[index4 + 9:] return mdict" "def make_arr(arr): arr = arr[1:-1].split('<-') key = arr[0] value = arr[1][1:-1] value = value.split(';') return (key, value) def main(s): s = s.replace('', '') s = s.replace('', '') s = s.replace('set', '') s = s.replace('array', '') s = s.replace('@', '') s = s.replace('\n', '') s = s.replace(' ', '') s = s.replace('#', '') s = s.replace('""', '') s = s.split(',') s.pop() d = {} for i in s: (key, value) = make_arr(i) d[key] = value return d" "def main(s): s = s.replace('\n', ' ') s = s[:s.rfind(';')] s = s.split(';') dictionary = {} for element in s: key = element[element.find('decl') + 5:element.find(':')].strip() elem = element[element.find('=') + 1:].strip() dictionary.update({key: elem}) return dictionary" "import re def main(str): pattern = ""(?<=[@][']).*?(?=[e][n][d])"" result = {} str = str.replace(' ', '') str = str.replace('\n', '') access = re.findall(pattern, str) for i in access: txt = i.split(""':="") result[txt[0]] = int(txt[1]) return result" "import re def main(string): string = string.replace('\n', ' ') string = string.replace('', '\n') name_pattern = ""(@'.*')"" values_pattern = '(store array\\(.*\\).?=>)' names = re.findall(name_pattern, string) values = re.findall(values_pattern, string) for x in range(len(names)): names[x] = names[x][2:-1] values[x] = str(values[x].replace(' ', '')[11:-3]).split(',') return dict(zip(names, values))" "import re def main(source): p = 'var .{3,15}<' source = source.replace('\n', ' ') source = source.replace(' :', ':') matches = re.findall(pattern=p, string=source) for i in range(len(matches)): matches[i] = matches[i].replace('var ', '') matches[i] = matches[i].replace(' <', '') matches[i] = matches[i].replace('<', '') p = '[^_\\d][-+]?\\d+' matches_one = re.findall(pattern=p, string=source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace(':', '') matches_one[j] = matches_one[j].replace('=', '') response[matches[j]] = int(matches_one[j]) return response" "def main(line): list_line = line.split(';') list_line.pop() _dict = {} for i in list_line: key = i[i.find(""'"") + 1:] key = key[:key.find(""'"")] value = i[i.find('=') + 1:] value = value.strip() _dict[key] = value return _dict" "def form(str): form_array = [] tmp_1 = 0 tmp_2 = 0 while tmp_2 != -1: tmp_2 = str.find(';', tmp_1) if tmp_2 != -1: form_array.append(str[tmp_1:tmp_2]) tmp_1 = tmp_2 + 2 return form_array def do_dict(form_array): result = {} for i in range(len(form_array)): value_array = [] tmp_1 = form_array[i].find('q(') + 2 tmp_2 = form_array[i].find(')', tmp_1) key = form_array[i][tmp_1:tmp_2] tmp_1 = form_array[i].find('(') + 1 tmp_2 = form_array[i].find(')') tmp_str = form_array[i][tmp_1:tmp_2] tmp_str = tmp_str.replace(' ', '') tmp_str = tmp_str.replace('\n', '') tmp_1 = 0 tmp_2 = 0 while True: tmp_2 = tmp_str.find('.', tmp_1) if tmp_2 == -1: value_array.append(tmp_str[tmp_1:len(tmp_str)]) break value_array.append(tmp_str[tmp_1:tmp_2]) tmp_1 = tmp_2 + 1 result[key] = value_array return result def main(str): form_array = form(str) result = do_dict(form_array) return result" "import re def main(example): regexKey = '@""([a-z]{0,10}|[a-z]{0,10}\\_\\d+)"".' regexValue = 'q\\(([a-z]{0,10}|[a-z]{0,10}\\_\\d+)\\)' vocab = {} matchesKey = re.findall(regexKey, example) matchesValue = re.findall(regexValue, example) for i in range(len(matchesKey)): vocab[matchesKey[i]] = matchesValue[i] return vocab" "def main(data): res_dict = {} data = data.replace('\n', ' ').replace('.', '') data = data.replace('begin', '').replace('end', '') data = data.split('opt') data.pop(0) for string in data: data[data.index(string)] = string.replace(' ', '') for string in data: res_list = [] data_list = string.split('==>') data_list[0] = data_list[0].replace('{', '').replace('}', '') data_list[0] = data_list[0].replace(';', ' ') data_list[0] = data_list[0].split(' ') for i in range(0, len(data_list[0])): res_list.append(int(data_list[0][i])) data_list[1] = data_list[1].replace('q(', '').replace(')', '') res_dict[data_list[1]] = res_list return res_dict" "def main(s: str): res = {} s = s.replace('\n', ' ') s = s.replace('begin', '') s = s.replace('', '') s = s.replace('store', '') s = s.replace('<|', '@') s = s.replace('array', '') s = s.replace('(', '') s = s.replace(')', '@') s = s.replace('. end', '') s = s.replace('.', '') s = s.replace('', '') s = s.split('@') a = [] for el in s: a.append(el.split()) counter = 0 value = '' for mas in a: if counter == 2: counter = 0 res[key] = value if len(mas) == 1: key = mas[0] counter += 1 else: value = mas counter += 1 return res" "import re def main(s): pattern = '#(.*?) *\\|> *(.*?)\\.+' parsed_s = re.findall(pattern, s.replace('\n', '')) return {key: int(value) for (value, key) in parsed_s}" "def main(s: str): res = {} s = s.replace(' to ', '@') s = s.replace('\nto ', '@') s = s.replace(' to\n', '@') s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace(',[[local#', '@') s = s.replace('[[local#', '') s = s.replace('.]],', '') s = s.replace('.]]', '') counter = 0 for el in s.split('@'): if el.lstrip('-+').isdigit(): value = int(el) counter += 1 else: key = el counter += 1 if counter == 2: res[key] = value counter = 0 return res" "index = 0 def get_name(str): global index name = '' while str[index] != ' ' and str[index] != '<' and (str[index] != '\n'): name += str[index] index += 1 return name def get_num(str): global index while str[index] != '-' and (str[index] < '0' or str[index] > '9'): index += 1 if str[index] == ' ' or str[index] == '\n': index += 1 num = '' while str[index] >= '0' and str[index] <= '9' or str[index] == '-': num += str[index] index += 1 return int(num) def main(h): global index h = h.replace('\n', ' ') h = h.replace(' equ', 'equ') all = {} index = j = 0 begin_data = 'equ ' temp = '' while index < len(h): if begin_data[j] == h[index]: temp += h[index] j += 1 else: temp = '' j = 0 if temp == begin_data: index += 1 name = get_name(h) num = get_num(h) all[name] = num temp = '' j = 0 index += 1 return all" "def main(x): x = x.replace('\x08egin', '').replace('\\begin', '').replace('end', '').replace('\\end', '').replace('end', '').replace('def', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('<-') for i in x_parts] result = {} for i in x_parts1: result[i[0]] = i[1] return result" "def main(line): line = line.split(';') line.pop() _dict = {} for i in line: key = i[i.find('@""') + 2:] key = key[:key.find('""')] value_list = i[i.find('(') + 1:i.find(')')] value_list = value_list.split() for j in range(len(value_list)): value_list[j] = int(value_list[j]) _dict[key] = value_list return _dict" "def main(s: str): res = {} s = s.replace(';end', '') s = s.replace('end .end', '') s = s.replace('; end', '') s = s.replace('end.end', '') s = s.replace('.end', '') s = s.replace('. end', '') s = s.replace('.', '') s = s.replace('\n', ' ') s = s.replace(""'"", '') s = s.replace(';', '') s = s.replace('do begin', '') s = s.replace('do', '') s = s.replace(' equ', '') s = s.replace('@', '') s = s.replace('{', '') s = s.replace('}', '') s = s.replace('}', '') for el in s.split('begin'): e = el.split('|>')[0] E = el.split('|>')[1] E = E.replace(' ', '') res[E] = e.split() return res" "import re def get_array_data(data): data = data.replace(' . ', '_') data = data.replace(' .', '_') data = data.replace('. ', '_') data = data.replace(' ', '') array = data.split('_') for i in range(len(array)): array[i] = int(array[i]) return array def main(data): data = data.replace('\n', '') template = '\\{ ?array\\(([0-9- .]+)\\) ?-> ?`?([a-z0-9_]+) ?\\}' temp_data = re.findall(template, data) new_dict = {} for i in range(len(temp_data)): array_data = get_array_data(temp_data[i][0]) new_dict[temp_data[i][1]] = array_data return new_dict" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('store(.*?)', s) for i in d: (value, key) = i.split('=:') key = key.replace(' ', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('#', '') value = value.replace(' ', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = value return ans" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('store(.*?)end', s) for i in d: (value, key) = i.split('|>') key = key.replace(' ', '') key = key.replace('""', '') key = key.replace('@', '') key = key.replace('.', '') value = value.replace('.', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('}', '') value = value.replace('(', '') value = value.replace(')', '') value = value.replace('[', '') value = value.replace(']', '') value = value.split(' ') value = list(filter(None, value)) value = list(map(int, value)) ans[key] = value return ans" "import re def main(str): str = str.replace(' ', '') str = str.replace('\n', '') second = re.findall('(?<=list\\()([\\s\\S]+?)(?=\\))', str) first = re.findall('(?<=\\[\\[define)([\\s\\S]+?)(?=\\<)', str) array = [] for i in range(len(second)): second[i] = second[i].replace('#', '') second[i] = second[i].replace(' ', '') abc = second[i].split(';') new_a = [] for j in abc: new_a.append(int(j)) array.append(new_a) result = {} for i in range(len(first)): result.update({first[i]: array[i]}) return result" "import re def main(a): result = {} a = a.split('
') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '').replace('#', '') key = re.search(""'.+'"", a[i]) if key: values = re.search('{.+}', a[i])[0][1:-1].split(';') result[key[0][1:-1]] = [int(i) for i in values] return result" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('opt(.*?)[|]', s) for i in d: (key, value) = i.split('=') key = key.replace(' ', '') key = key.replace('""', '') key = key.replace('@', '') key = key.replace('.', '') value = value.replace('.', '') value = value.replace(' ', '') value = value.replace('{', '') value = value.replace('}', '') value = value.replace('(', '') value = value.replace(')', '') value = value.replace('[', '') value = value.replace(']', '') value = value.split('#') value = list(filter(None, value)) value = list(map(int, value)) ans[key] = value return ans" "import re def main(a): result = {} a = a.split('@""') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('.+""', a[i]) if key: value = int(re.search('#.+[n:]', a[i])[0][1:-1]) result[key[0][:-1]] = value return result" "import re def main(s): pattern = ""new ?'(\\w+)' ?<- ?(-?\\d+)"" parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: int(value) for (key, value) in parsed_s}" "def main(x): data = {} x = x.replace('\n', ' ').split('') x = [i for i in x if len(i.strip()) > 2] for i in x: name = i.split('`')[-1].split(';')[0].strip() array = i.split(']')[0].split('[')[1].split(';') array = [int(i.replace('#', '').strip()) for i in array] data[name] = array return data" "import re def main(source): p = 'define\\s?#\\s?[-0-9]+\\s?to\\s?q\\([a-zA-Z0-9_]+\\)' values = re.findall(pattern=p, string=source) response = {} for val in values: response[val.split('q(')[1][:-1]] = int(val.split('#')[1].split(' ')[0]) return response" "def main(x): d = {} a = x.split('')[:-1] for macro in a: start_key = macro.find('(') end_key = macro.find(')') temp_key = macro[start_key + 1:end_key] macro = macro[end_key + 1:] d[temp_key] = [] start_values = macro.find('(') end_values = macro.find(')') r = macro[start_values + 1:end_values].replace(' ', '').replace('\n', '').split('.') for i in r: d[temp_key].append(i) return d" "import re def main(example): exr = '\\s*local\\s*q\\(([^)]*)\\)\\s*<\\s*\\=([^\\];]*)' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split(','): j = j.strip().strip(""'"") s = j key = match[0] d[key] = s return d" "import re def main(example): exr = '\\s*set\\s*([^:]*):=\\s*q\\(([^)]*)' d = {} matches = re.findall(exr, example) for match in matches: key = match[0].replace('\n', '').replace(' ', '') d[key] = match[1] return d" "import re def main(source): source = source.replace('\n', ' ') source = source.replace('\\n', ' ') my_list = {} matches = re.findall('\\[\\[.{1,23}[;]', source) for i in range(len(matches)): matches[i] = matches[i].replace('[[ ', '') matches[i] = matches[i].replace('[[', '') matches[i] = matches[i].replace(';', '') matches[i] = matches[i].split(' ') my_list[matches[i][0]] = matches[i][1] return my_list" "import re def main(a): result = {} a = a.split('decl') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('\\(.+\\)', a[i]) if key: value = re.search('=.+\\.', a[i])[0][1:-1] result[key[0][1:-1]] = value return result" "def main(s): i = 0 ans = {} i = s.find('[') + 1 while i: s = s[i:].strip() i = 0 j = s.find(']') arr = list(map(lambda x: x.strip(), s[i:j].split(';'))) i = s.find(""'"") + 1 s = s[i:] j = s.find(""'"") key = s[0:j] i = s.find('[') + 1 ans[key] = arr return ans" "import re def main(s): t = re.findall('(?<=to\\s)\\w+', s) r = [*map(lambda x: re.findall('-?\\d+', x), re.findall('\\([^\\)]+', s))] return {i[0]: [*map(int, i[1])] for i in zip(t[::1], r[::1])}" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('loc(.*?)[]]', s) for i in d: (value, key) = i.split('=:') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('#', '') value = value.replace(' ', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = int(value) return ans" "import re def main(src_string): group1_dict = re.findall('[> \\n][a-z_0-9]+\\.', src_string) group2_dict = re.findall(""\\([a-z_0-9 @\\',\\n]+\\)"", src_string) groups_list = list() for i in range(0, len(group1_dict)): group1_dict[i] = group1_dict[i][1:-1] groups_list1 = re.findall('[a-z_0-9]+', group2_dict[i]) groups_list.append((group1_dict[i], groups_list1)) return dict(groups_list)" "import re def main(source): p = 'begin\\s*val\\s*([A-Za-z0-9_]*)\\W*(\\W[0-9]*);' matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[0]] = int(match[1]) return response" "import re def main(source): p = ""(\\s*store\\s*(.[0-9]*)\\s*=>\\s*'([A-Za-z0-9-_]*)'\\s*)"" matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[2]] = int(match[1]) return response" "import re def main(string): totalstring = string.replace(' ', '').replace('\n', '') pattern = ""let@'([a-zA-Z_0-9]*)'<-#([0-9-,]*)"" tempresult = re.findall(pattern, totalstring) result = {} for (name, value) in tempresult: result[name] = int(value) return result" "import re def main(x): pattern = '(?:<: ?define @\\"".+?\\"" ?= ?(?:-?\\d+?); ?:>)+' x = x.replace('\n', ' ') res = {} found = [item for item in re.findall(pattern, x)] for item in found: item_var = re.search('@\\""(.+?)\\""', item).group(1).strip() item_value = int(re.search('= ?(-?\\d+?)\\;', item).group(1).strip()) res[item_var] = item_value return res" "import re def main(s): pattern = ""val ?(\\w+) ?=: ?'(\\w+)'"" parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value for (value, key) in parsed_s}" "def main(x): di = {} al = [] sl = [] a = x.replace(' ', '') a = a.replace('\n', '') a = a.split(';') a = a[:-1] for i in range(0, len(a)): string = a[i] pos1 = string.find('option') + 6 pos2 = string.find('>') sl.append(int(string[pos1:pos2 - 2])) al.append(string[pos2 + 1:-3]) di = dict(zip(al, sl)) return di" "def main(s): d = {} while s.find('do') != -1: s = s[s.find(""'"") + 1:] key = s[:s.find(""'"")] val_s = s[s.find('[') + 1:s.find(']')] value = [] while val_s.find(';') != -1: value.append(int(str.strip(val_s[:val_s.find(';')]))) val_s = val_s[val_s.find(';') + 1:] value.append(int(str.strip(val_s))) d[key] = value s = s[s.find('.'):] return d" "def main(x): x1 = [] d = {} x = x.replace('<%', '') x = x.replace('begin', '') x = x.replace('store', '') x = x.replace('#', '') x = x.replace('==>', ' ') x = x.replace('end', '') x = x.replace(';', '') x = x.replace('%>', '') x = x.replace('\n', '') x = x.split(' ') c = len(x) for i in range(0, c): if x[i] != '': x1.append(x[i]) c = len(x1) for i in range(0, c, +2): x1[i] = int(x1[i]) for j in range(1, c, +2): d[x1[j]] = x1[j - 1] return d" "import re def main(s): pattern = 'store ?{((?: ?\\w+ ?)+)} ?=: ?q\\((\\w+)\\)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: list(value.split()) for (value, key) in parsed_s}" "def main(line): line = line.split('.') line.pop() _dict = {} for i in line: value = i[i.find('#') + 1:] value = value[:value.find('t')].strip() key = i[i.find('`') + 1:] _dict[key] = int(value) return _dict" "import re def main(a): a = a.replace('||', '/') a = a.replace('\n', ' ') one = re.findall('loc.*?:', a) tre = re.findall('#.*?/', a) for i in range(len(one)): one[i] = one[i].replace('loc', '') one[i] = one[i].replace(' ', '') one[i] = one[i].replace(':', '') for i in range(len(tre)): tre[i] = tre[i].replace('|', '') tre[i] = tre[i].replace('#', '') tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace('.', '') tre[i] = tre[i].replace('/', '') tre[i] = int(tre[i]) x = {} for i in range(len(tre)): one[i] = x.setdefault(one[i], tre[i]) return x" "import re def main(string): string = string.replace('\n', ' ') string = string.replace('\\n', ' ') my_list = {} matches = re.findall('equ .{1,15}=', string) for i in range(len(matches)): matches[i] = matches[i].replace('equ ', '') matches[i] = matches[i].replace('=', '') matches[i] = matches[i].replace(' ', '') matches_two = re.findall('@"".{1,15}""', string) for i in range(len(matches_two)): matches_two[i] = matches_two[i].replace('""', '') matches_two[i] = matches_two[i].replace('@', '') my_list[matches[i]] = matches_two[i] return my_list" "import re def main(line): a = {} line = line.replace('do', '') line = line.replace('od', '') line = line.replace('loc', '') line = line.replace('\n', '') line = line.replace('@', '') 'line = line.replace("","", """")' line = line.replace('[[', '') line = line.replace(']]', '') line = line.replace('.', '') line = line.replace(' ', '') line = line.replace('=', ':') line = line.replace('""', ""'"") line = line.replace(""'"", '') line = line[:-1] line = line.split(',') for i in range(len(line)): line[i] = line[i].split(':') a[line[i][0]] = line[i][1] return a" "import re def main(x): slovar = {} x = re.split('', x) for i in range(0, len(x) - 1): if len(x[i]) < 5: del x[i] for i in range(0, len(x) - 1): result = re.split('->', x[i]) znach = re.findall('[-+]?\\d+', result[0]) res = re.findall('\\S', result[1]) slov = '' for i in range(0, len(res)): slov += res[i] slovar[slov] = int(znach[0]) return slovar" "def main(x): d = {} texts = x.split(';')[:-1] for tex in texts: key_index = tex.find('`') + 1 str_buff = '' while tex[key_index] != '<': str_buff += tex[key_index] key_index += 1 str_buff = str_buff.replace(' ', '') value_index = tex.find('#') + 1 int_buff = '' while tex[value_index].isdigit() or tex[value_index] == '-': int_buff += tex[value_index] value_index += 1 d[str_buff] = int(int_buff) return d" "def main(x): di = {} al = [] sl = [] a = x.replace('\n', ' ') a = a.split(';') a = a[:-1] for i in range(0, len(a)): string = a[i] pos1 = string.find('set') + 4 pos2 = string.find('to ') sl.append(string[pos1:pos2 - 1]) al.append(string[pos2 + 3:]) di = dict(zip(al, sl)) return di" "import re def main(x): pattern = '(?: ?equ (?:.+?) is ? array ?\\((?:.+?)\\); ?<\\/sect>)+' x = x.replace('\n', ' ') res = {} found = [item for item in re.findall(pattern, x)] for item in found: array_items = re.search('array ?\\((.+?)\\);', item).group(1).strip().split() array_name = re.search('equ (.+?) is', item).group(1).strip() res[array_name] = array_items return res" "import re def main(text): output = {} text = text.replace(' ', '').replace('\n', '') regex = '\\((.*?)\\)=:(.*?);' output = {} res = re.findall(regex, text) for elem in res: value = elem[0].replace(""'"", '').replace(' ', '')[1:].split('@') key = elem[1].replace(' ', '') output[key] = value return output" "def main(s: str): res = {} s = s.replace('\n', '') s = s.replace(' ', '') s = s.replace('[doglobal', '') s = s.replace(';od]', '') for el in s.split(';oddoglobal'): (key, value) = el.split('<=') res[key] = value return res" "import re def main(text): result = {} text = re.sub('^\\s+|\\n|\\r|\\s+$', '', text) text = text.replace(' ', '') data = text.split('def') data[len(data) - 1] = data[len(data) - 1][:-3] data.pop(0) for str in data: who_needs_inf = str[str.find('==>') + 3:len(str)] str = str[:str.find('==>')] inf = [] c = str.count(';') + 1 for i in range(c): el = str[str.find('('):str.find(';')] inf.append(el[2:]) str = str.replace(el + ';', '(') result[who_needs_inf] = inf return result" "def main(line): line = line.split('def') line.pop(0) _dict = {} for i in line: key = i[i.find('(') + 1:i.find(')')] value = i[i.find('{') + 1:i.find('}')] value = value.split(',') _list = [] for j in value: j = j.replace(""'"", '') j = j.strip() _list.append(j) _dict[key] = _list return _dict" "import re def main(text: str) -> dict[str, list[str]]: text = text.replace('\n', ' ') result = dict() data_list = re.findall('t\\s*\\(.*?\\)', text) keys = re.findall('\\"".*?\\""', text) for n in range(len(keys)): keys[n] = keys[n].replace('""', '') data_list[n] = data_list[n].replace(' ', '').replace('t(', '') data_list[n] = data_list[n].replace(')', '').replace('#', '') result[keys[n]] = list(map(int, data_list[n].split(';'))) return result" "import re def main(text: str) -> dict[str, list[str]]: text = text.replace('\n', ' ') result = dict() data_list = re.findall('q\\(.*?\\)', text) keys = re.findall('define\\s*.*?<', text) for n in range(len(keys)): keys[n] = keys[n].replace('define', '') keys[n] = keys[n].replace(' ', '').replace('<', '') data_list[n] = data_list[n].replace('q(', '').replace(')', '') data_list[n] = data_list[n].replace(' ', '') result[keys[n]] = data_list[n] return result" "import re def main(example): exr = '\\s*set\\s*@\\""([^)]*)""(\\s|)array\\(([^)]*)' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[2].split(','): j = j.strip().strip(""'"") j = j.strip().strip('""') j = j.strip().lstrip('@""') s.append(j) key = match[0] d[key] = s return d" "def main(data: str): data = data.replace(' ', '').replace('\n', '').split('|') result = {} if data[0] == '\\begin': for i in range(1, len(data) - 1): if data[i].startswith('data'): s = data[i] name_end = s.index(""'"", 6) name = s[5:name_end] val = int(s[name_end + 4:s.index(';')]) result[name] = val return result" "import re def main(text: str) -> dict[str, list[str]]: text = text.replace('\n', ' ').replace(' ', '') result = dict() data_list = re.findall('=\\s*.*?;', text) keys = re.findall('val\\s*.*?<', text) for n in range(len(keys)): keys[n] = keys[n].replace('val', '').replace('<', '') data_list[n] = data_list[n].replace('=', '').replace(';', '') result[keys[n]] = int(data_list[n]) return result" "def main(st): mdict = {} mass = [] x = st.replace('\n', ' ') while True: index1 = x.find('[') + 1 if index1 == 0: break index2 = x.find(']') mass.append(x[index1:index2]) x = x[index2 + 1:] st = st.replace(' ', '') st = st.replace('\n', '') count = 0 while st != '||>>': index1 = st.find('->""') + 3 index2 = st.find('""|') mt = mass[count].split() mtf = [] for m in mt: mtf.append(int(m)) mdict[st[index1:index2]] = mtf st = st[index2 + 1:] count += 1 return mdict" "def main(s: str): res = {} s = s.replace('|', '') s = s.replace('data', '') s = s.replace('q(', '') s = s.replace(')', '') s = s.replace('{', '') s = s.replace('};', '') s = s.replace(' ', '') s = s.replace(':=', ';') s = s.replace('\n', '') counter = 0 for el in s.split(';'): if counter == 2: res[key] = value counter = 0 if ',' in el: value = list(map(int, el.split(','))) counter += 1 else: key = el counter += 1 return res" "def main(v): v = v.replace('', '') v = v.replace('', '') v = v.replace('\n', '') v = v[v.find('list'):] v = v.split('store') dictionary = {} for v1 in v: keys = v1[v1.find('(') + 1:v1.find(')')] keys = keys.replace('""', ' ') keys = keys.replace(' ', ' ') keys = keys.strip() keys = keys.split() v2 = v1[v1.find('=:'):] v2 = v2.replace('.end', '') v2 = v2.replace('=:', '') v2 = v2.strip() dictionary.update({v2: keys}) return dictionary" "import re def main(example): exr = ""(var\\s*\\{([^}]*)\\}\\s*=>\\s*\\@\\'([a-zA-Z0-9_]*)\\'.)"" d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split(';'): j = int(j.strip()) s.append(j) key = match[2] d[key] = s return d" "def main(example): import re exr = ""store\\s*([^<\\s]*)\\s*<\\|\\s*@\\'([^\\']*)\\'"" d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split(','): j = j.strip().strip(""'"") s.append(j) key = match[0] d[key] = s[0] return d" "def main(s): s = s.replace('\n', ' ') d = {} k_l = 0 data = '' data2 = '' n = 0 n2 = 0 f = len(s) // 35 for i in range(f): n = s.find('val', k_l) + 3 n2 = s.find(' ', n + 1) data = s[n + 1:n2] n = s.find('to', k_l) + 3 n2 = s.find('""', n + 2) if s[n] == '""': data2 = s[n + 1:n2] else: data2 = s[n:n2] d[data2] = int(data) s = s[n2 + 17:len(s)] return d" "import re def main(example): exr = '\\s*make\\s*([^\\s]*)\\s*:=\\s*\\`([^\\\\]*)' d = {} matches = re.findall(exr, example) for match in matches: s = '' for j in match[1].split(','): j = j.strip().strip(""'"") s += j key = match[0] d[key] = s return d" "import re def main(input): if input[:2] != '[[': return -2 elif input[-2:] != ']]': return -1 else: regex = '\\s*.do\\s*option\\s*-?\\d+\\s*->\\s*[^\\s]+\\s*.end.' d = {} matches = re.findall(regex, input) for match in matches: values = re.split('[> \n(.)]+', match) d[values[5][:-1]] = int(values[3]) return d" "import re def main(text: str) -> dict[str, list[str]]: text = text.replace('\n', ' ') result = dict() data = re.findall('ay\\s*\\(.*?\\)', text) keys = re.findall('>\\s*.*?done', text) for n in range(len(keys)): keys[n] = keys[n].replace('>', '').replace('done', '') keys[n] = keys[n].replace(' ', '') data[n] = data[n].replace('ay', '').replace(')', '') data[n] = data[n].replace('(', '').replace(' ', '') data[n] = data[n].strip('#') result[keys[n]] = list(map(int, data[n].split('#'))) return result" "import re def parse_keys(x): keys = '\\w+' return re.findall(keys, x) def main(x): result = {} p = re.findall('\\w+\\.', x) s = re.findall(""\\'\\w+"", x) keys = parse_keys(str(s)) for i in range(len(keys)): result[keys[i]] = p[i][:len(p[i]) - 1] return result" "import re def main(example): exr = '.do\\sdata\\s*([^) \\n]*)\\s*=\\s*array\\(([^)]*)\\s*\\)' exr2 = ""\\'[^\\']*\\'"" d = {} example.replace('\n', ' ') matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split(','): j = j.strip().strip('@').strip(""'"") s.append(j) key = match[0] d[key] = s return d" "def main(source): long = len(source) n = t = z = k = x = y = 0 s = source a1 = [0, 0, 0, 0] a2 = [0, 0, 0, 0] b1 = [0, 0, 0, 0] b2 = [0, 0, 0, 0] P = {} for n in range(len(source)): if s[n] == '#': k = n + 1 if ord(s[k]) < 43 & ord(s[k]) > 58: s[k] = s[k + 1] k = k + 1 a1[t] = k if s[n] == '-': z = n - 1 if ord(s[z]) == 32: z = z - 1 a2[t] = z b = source[a1[t]:a2[t] + 1] if s[n] == '(': x = n + 1 if ord(s[x]) < 48: x = x + 1 b1[t] = x if s[n] == ')': y = n - 1 b2[t] = y a = source[b1[t]:b2[t] + 1] P[a] = int(b) t += 1 return P" "import re def main(stroka: str) -> dict[str, list[str]]: stroka = stroka.replace('\n', ' ') res = dict() key = re.findall('`.*?\\s', stroka) data = re.findall('\\sis.*?;', stroka) for n in range(len(key)): key[n] = key[n].replace('`', '') key[n] = key[n].strip() data[n] = re.sub('\\sis\\s*', '', data[n]) data[n] = data[n].replace(';', '') data[n] = data[n].strip() res[key[n]] = data[n] return res" "import re def main(inp: str) -> dict: values = dict() for i in re.finditer(""define([^']+).([^']+)"", inp): temp_string = inp[i.start() + 6:i.end()] temp_string = temp_string.replace(' ', '').replace('\n', '') value = temp_string[:temp_string.index('=>')] values[temp_string[temp_string.index(""'"") + 1:]] = value return values" "def main(x): x = x.replace('\\', '').replace('begin', '').replace('\x08egin', '').replace('end', '').replace('\\end', '').replace('local', '').replace('\n', ' ').replace(' ', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('==>') for i in x_parts] result = {} for i in x_parts1: result[i[1]] = i[0] return result" "import re def main(s): pattern = '\\""(.*?)\\"" *::= *`(.*?);' parsed_s = re.findall(pattern, s.replace('\n', '')) return {key: value for (key, value) in parsed_s}" "import re def main(example): exr = '\\s*def\\s*@\\""([^)]*)\\""\\s*<==\\s*array\\s*\\(\\s*\\@\\""([^)]*\\"")' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split('@'): j = j.strip().strip('""') s.append(j) key = match[0] d[key] = s return d" "def main(string): string = string.replace(' ', '').replace('|', '') result = dict() while string: key = string[string.find('q(') + 2:string.find(')')] value = string[string.find('#') + 1:string.find('}')].split('#') value = [int(elem) for elem in value] string = string.replace(string[:string.find(';') + 1], '') result[key] = value return result" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('do .*?:', a) tre = re.findall('#.*?done', a) for i in range(len(one)): one[i] = one[i].replace(':', '') one[i] = one[i].replace('do', '') one[i] = one[i].replace(' ', '') for i in range(len(tre)): tre[i] = tre[i].replace('#', '') tre[i] = tre[i].replace('(', '') tre[i] = tre[i].replace(')', '') tre[i] = tre[i].replace('done', '') tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].split('.') tree = tre[i] tre[i] = [] for j in range(len(tree) - 1): tre[i].append(tree[j]) x = {} for i in range(len(one)): one[i] = x.setdefault(one[i], tre[i]) return x" "def main(x): di = {} al = [] sl = [] a = x.replace(' ', '') a = a.replace('\n', '') a = a.split(';}};') a = a[:-1] for i in range(0, len(a)): string = a[i] pos1 = string.find('glob') + 4 pos2 = string.find('q(') sl.append(int(string[pos1:pos2 - 2])) al.append(string[pos2 + 2:-1]) di = dict(zip(al, sl)) return di" "def main(str): final = {} str = str.replace(' ', '').replace('
', '').replace('
', '').replace('[', '').replace('];', '').replace('""', '').replace('\n', '').replace('data', '<|').split('<|') i = 1 while i != len(str): final[str[i]] = str[i + 1] i += 2 return final" "import re def main(example): exr = ""\\'([^\\n']{2,})\\'"" exr2 = '[-+]?\\b\\d+\\b' matches = re.findall(exr, example) matches2 = re.findall(exr2, example) result = [int(item) for item in matches2] zipped = dict(zip(matches, result)) return zipped" "import re def main(input): pattern1 = ':\\s?\\w+' pattern2 = '#-?\\d+' matches1 = re.findall(pattern=pattern1, string=input) matches2 = re.findall(pattern=pattern2, string=input) output = {} for i in range(len(matches1)): matches1[i] = re.search('\\w+', matches1[i])[0] matches2[i] = re.search('-?\\d+', matches2[i])[0] output[matches1[i]] = int(matches2[i]) return output" "import re def main(x): bible = {} word_1 = re.findall('declare\\s*\\w+\\d*', x) word_2 = re.findall('-?\\d+;', x) for i in range(0, len(word_1)): word_1[i] = word_1[i].split()[1] for i in range(0, len(word_1)): a = re.findall('\\w+', word_1[i]) word_1[i] = a[0] word_2[i] = int(word_2[i][:-1]) bible[word_1[i]] = word_2[i] return bible" "import re def main(input): p1 = '`s?\\w+.' p2 = ""\\'\\w+\\'"" m1 = re.findall(pattern=p1, string=input) m2 = re.findall(pattern=p2, string=input) output = {} for i in range(len(m2)): m1[i] = re.search('\\w+', m1[i])[0] m2[i] = re.search('\\w+', m2[i])[0] output[m1[i]] = m2[i] return output" "def main(s: str): res = {} s = s.replace('do{ set', '') s = s.replace('do { set', '') s = s.replace('do {set', '') s = s.replace('do{set', '') s = s.replace('{\nset', '') s = s.replace('{ set', '') s = s.replace('{set', '') s = s.replace(';', '') s = s.replace('[', '') s = s.replace('}', '') s = s.replace('}; end', '') s = s.replace('{', '') s = s.replace(';', '') s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace(""')'"", ')') s = s.replace(':=', ']') counter = 0 for el in s.split(']'): if counter == 2: res[key] = value counter = 0 if '.' in el: value = list(map(str, el.split('.'))) counter += 1 else: key = el counter += 1 return res" "import re def main(s): pattern = ""\\'(.*?)\\' *#(.*?)\\."" parsed_s = re.findall(pattern, s.replace('\n', '')) return {key: int(value) for (key, value) in parsed_s}" "import re def main(text): keys = re.findall('""\\S*""', text) values = re.findall(':\\s*\\S*\\.', text) res = {} for i in range(len(keys)): key = keys[i].strip().strip('""') val = values[i].strip().strip(':').strip('.').strip() res[key] = val return res" "import re def main(rawSource): source = rawSource.replace(' ', '').replace('\n', '') exr = ""
setlist\\(([a-zA-Z_0-9;]*)\\)=>@'([A-Za-z0-9_]*)';"" d = {} matches = re.findall(exr, source) for match in matches: s = [] for j in match[0].split(';'): j = j.strip().strip(""'"") s.append(j) d[match[1]] = s return d" "import re def main(x): ans = {} val_mask = ' [\\w]*(?==>)' name_mask = ""(?<=@')[^']*"" x = re.sub('\n', ' ', x) x = re.sub(' =>', '=>', x) vals = re.findall(val_mask, x) names = re.findall(name_mask, x) for (i, j) in enumerate(vals): vals[i] = re.sub(' ', '', j) ans = {i: j for (i, j) in zip(names, vals)} return ans" "import re def main(example): exr = '\\s*set\\s*array\\(([^\\)]*)\\)\\s*\\|>\\s*\\""([^)]*)\\""' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[0].split('.'): j = j.strip().strip('`') s.append(j) key = match[1] d[key] = s return d" "import re import string def main(x): pattern = '(?:{ ?new ?(?:.+?) ?:: ?= ?{(?:.+?)} ?;)+' x = x.replace('\n', ' ') res = {} found = [item for item in re.findall(pattern, x)] for item in found: array_items = [item.strip().strip(string.punctuation) for item in re.search('= ?{(.+?)} ?;', item).group(1).split('.')] array_name = re.search('new ?(.+?) ?::', item).group(1).strip() res[array_name] = array_items return res" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') x = x[5:] while x != ';end': index1 = x.find('begin') + 5 index2 = x.find('->') index3 = x.find('->') + 2 index4 = x.find('.end') if x[index1:index2].replace('-', '').isdigit(): mdict[x[index3:index4].replace('\n', '')] = int(x[index1:index2]) else: mdict[x[index3:index4]] = x[index1:index2] x = x[index4 + 4:] return mdict" "import re def main(a): result = {} a = a.split('global') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('>.+\\.', a[i]) if key: value = int(re.search('#.+-', a[i])[0][1:-1]) result[key[0][1:-1]] = value return result" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('let(.*?)done', s) for i in d: (key, value) = i.split('::=') key = key.replace(' ', '') key = key.replace(""'"", '') key = key.replace('""', '') key = key.replace('@', '') key = key.replace('.', '') value = value.replace(""'"", '') value = value.replace('""', '') value = value.replace('array', '') value = value.replace('.', '') value = value.replace(' ', '') value = value.replace('@', '') value = value.replace('{', '') value = value.replace('}', '') value = value.replace('(', '') value = value.replace(')', '') value = value.replace('[', '') value = value.replace(']', '') value = value.split(';') value = list(filter(None, value)) ans[key] = value return ans" "import re def main(source): source = source.replace('{', '') source = source.replace('}', '') source = source.replace('<<', '') source = source.replace('>>', '') source = source.replace('make', '') p = '[-+]?\\w+' matches = re.findall(pattern=p, string=source) response = {} for i in range(len(matches)): j = i + 1 arr = [] if re.match('[-+]?\\d+', matches[i]) is not None: continue while j < len(matches) and re.match('[-+]?\\d+', matches[j]) is not None: arr.append(int(matches[j])) j += 1 response[matches[i]] = arr return response" "def main(x): s = x.split() a = {} for word in s: if '#' in word: ind = word.find('#') val = word[ind:] val = val.replace('#', '').replace('{', '') val = val.replace(',', '') ind = s.index(word) key = s[ind + 2] ind = key.find(';') key = key[:ind] a[key] = int(val) return a" "import re def main(s): pattern = 'let ?#(-?\\d+) ?-> ?(\\w+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: int(value) for (value, key) in parsed_s}" "import re def main(a): result = {} a = a.split('define') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('>.+\\]', a[i]) if key: values = re.search('\\(.+\\)', a[i])[0][1:-1].split(',') result[key[0][1:-1]] = values return result" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('store(.*?)[;]', s) for i in d: (key, value) = i.split('`') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('#', '') value = value.replace(' ', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = value return ans" "import re def main(a): result = {} a = a.split('begin') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search(""'.+'"", a[i]) if key: value = re.search('\\(.+\\)', a[i])[0][1:-1] result[key[0][1:-1]] = value return result" "import re def main(s): pattern = 'q\\((\\w+)\\) ?<\\| ?(-?\\d+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: int(value) for (key, value) in parsed_s}" "import re def main(source): p = '(\\s*new\\s*([-0-9]*)\\s*==>\\s*(.[A-Za-z0-9-_]*)\\s*)' matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[2]] = int(match[1]) return response" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('set(.*?)[;]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split(' to ') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') value = value.replace(' ', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = value return ans" "def main(s): s = s.replace(' ', '') s = s.replace('\n', '') words = [] while s.find('loc`') != -1: start = s.find('loc`') middle = s.find(':', start, len(s)) end = s.find('.', start + 2, len(s)) words.append(s[start + 4:middle]) words.append(int(s[middle + 1:end])) s = s[0:start] + s[end + 1:] dictionary = {words[i]: words[i + 1] for i in range(0, len(words), 2)} return dictionary" "import re def main(x): slovar = {} x = re.split('\\|\\|', x) i = 0 while i < len(x): if len(x[i]) < 5: del x[i] i += 1 for i in range(0, len(x)): result = re.split('=:', x[i]) znach = result[0] znach = znach[znach.find('(') + 1:znach.find(')')].split() res = re.findall('\\S', result[1]) slov = '' for i in range(0, len(res)): slov += res[i] slovar[slov] = znach return slovar" "import re def main(example): exr1 = '[\\""](.*?)[\\""]' exr2 = ""[\\'](.*?)[\\']"" d = {} matches1 = re.findall(exr1, example) matches2 = re.findall(exr2, example) for i in range(len(matches1)): d[matches1[i]] = matches2[i] return d" "import re def main(a): a = a.replace('\n', ' ') a = a.replace('))', '@') one = re.findall('variable.*?<=', a) tre = re.findall('#.*?@', a) for i in range(len(one)): one[i] = one[i].replace('variable', '') one[i] = one[i].replace('<', '') one[i] = one[i].replace('=', '') one[i] = one[i].replace(' ', '') for i in range(len(tre)): tre[i] = tre[i].replace('#', '') tre[i] = tre[i].replace('(', '') tre[i] = tre[i].replace(')', '') tre[i] = tre[i].replace('@', '') tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace('variable', '') tre[i] = tre[i].split(';') tree = tre[i] tre[i] = [] for j in range(len(tree) - 1): tre[i].append(int(tree[j])) x = {} for i in range(len(one)): one[i] = x.setdefault(one[i], tre[i]) return x" "import re def main(line): lineFin = {} exr = 'global\\s(\\w+)' exr2 = '\\(.*?\\)' matches = re.findall(exr, line) matchesCifry = re.findall(exr2, line, re.S) for key in range(len(matchesCifry)): matchesCifry[key] = matchesCifry[key].replace(' ', '') matchesCifry[key] = matchesCifry[key].replace('\n', '') matchesCifry[key] = matchesCifry[key].replace('(', '') matchesCifry[key] = matchesCifry[key].replace(')', '') matchesCifry[key] = matchesCifry[key].split('.') for yek in range(len(matchesCifry[key])): matchesCifry[key][yek] = int(matchesCifry[key][yek]) for key in range(len(matchesCifry)): lineFin[matches[key]] = matchesCifry[key] return lineFin" "def main(string): dict = [] dict1 = [] mydict = {} i = 0 c = 0 i1 = 0 while i < len(string): i = string.find('""', i) if i == -1: break m = i + 1 substr = '' while string[m] != '""': substr = substr + string[m] m += 1 i = m + 1 dict.append(substr) i1 = string.find(""'"", i1) if i1 == -1: break m1 = i1 + 1 substr1 = '' while string[m1] != ""'"": substr1 = substr1 + string[m1] m1 += 1 i1 = m1 + 1 dict1.append(substr1) mydict[substr] = substr1 return mydict" "def main(s): s = [line.rstrip() for line in s] d = {} state = 0 k = '' v = '' for i in s: match state: case 0: if i == '#': state = 1 case 1: if i == ' ' or i == '=': state = 2 else: k += i case 2: if i == '>': state = 3 case 3: if i == ';': d[v] = int(k) k = '' v = '' state = 0 elif i != ' ': v += i return d" "def main(x): x = x.replace('\x08egin', '').replace('\\begin', '').replace('do ', '').replace('do\n', '').replace(""'"", '').replace('val', '').replace('done', ';').replace('end', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('@') for i in x_parts] result = {} for i in x_parts1: result[i[0]] = i[1] return result" "def main(x): x = x.replace('', '').replace('', '').replace('loc', '').replace('q(', '').replace(')', '').replace('[', '').replace(']', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';,') x_parts.pop(-1) x_parts1 = [i.split('=:') for i in x_parts] result = {} for i in x_parts1: result[i[1]] = i[0] return result" "import re def main(example): exr = ""\\s*decl\\s*([^:]*)\\s*::=\\s*\\@\\'([^']*)\\'\\;"" d = {} matches = re.findall(exr, example) for match in matches: key = ' '.join(match[0].split()) d[key] = match[1] return d" "def main(x): di = {} al = [] sl = [] a = x.replace(' ', '') a = a.replace('\n', '') a = a.split('.
;') a = a[:-1] for i in range(0, len(a)): string = a[i] pos1 = string.find('q(') + 2 pos2 = string.find('<-#') al.append(string[pos1:pos2 - 1]) sl.append(int(string[pos2 + 3:])) di = dict(zip(al, sl)) return di" "import re def main(string): sub_maps = string.split('.') sub_maps[0] = sub_maps[0].replace('', ' ') result = {} for i in range(len(sub_maps) - 1): mapping = sub_maps[i].split() index = re.search('\\d|-', mapping[-1]).start() index2 = re.search('\\W', mapping[1]) if index2: result[mapping[1][:index2.start()]] = int(mapping[-1][index:]) else: result[mapping[1]] = int(mapping[-1][index:]) return result" "def main(line): line = line.split('define') line.pop(0) _dict = {} for i in line: key = i[i.find('=>') + 2:i.find(';')].strip() value = i[i.find('#') + 1:i.find('=')].strip() _dict[key] = int(value) return _dict" "import re def main(s): pattern = 'auto ?{((?: ?#-?\\w+ ?)+)} ?==> ?(\\w+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) result = {} for (value, key) in parsed_s: value_sp = value.strip().split('#') val = [] for v in value_sp: if len(v) > 0: val.append(int(v)) result[key] = val return result" "import re def main(example): exr = '\\s*option\\s*\\[([^\\]]*)\\]\\s*=:\\s*\\""([^\\""]*)\\""' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[0].split('.'): j = j.strip().strip('""') s.append(j) key = match[1] d[key] = s return d" "import re def main(source): p = '
\\s*declare\\s*#\\(([^)]*)\\)\\s*->\\s*q\\(([^)]*)' matches = re.findall(pattern=p, string=source) response = {} for match in matches: s = [] for j in match[0].split(';'): j = j.strip().strip('""') s.append(j) key = match[1] response[key] = s return response" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') while x != '..end': index1 = x.find('option') + 6 index2 = x.find('=:') index3 = x.find('=:') + 2 index4 = x.find(';.end') if x[index1:index2].replace('-', '').isdigit(): mdict[x[index3:index4].replace('\n', '')] = int(x[index1:index2]) else: mdict[x[index3:index4]] = x[index1:index2] x = x[index4 + 5:] return mdict" "import re def main(s): pattern = 'def *(.*?) *=> *(.*?) *<' parsed_s = re.findall(pattern, s.replace('\n', '')) return {key: value for (value, key) in parsed_s} expr1 = ' def isbete_994 => riri;def bela =>ladile;' expr2 = ' def zaisge =>zaonin_859 ; def rila =>xegexe_476;'" "import re def main(s): pattern = 'local ?(\\w+) ?:= ?(\\w+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value for (key, value) in parsed_s}" "import re def main(a): result = {} a = a.split('new') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search(""'.+'"", a[i]) if key: value = re.search('\\(.+\\)', a[i])[0][1:-1] result[key[0][1:-1]] = value return result" "import re def main(s): pattern = 'var ?(\\w+) ?<= ?\\[((?: ?\\w+ ?;? ?)+)\\]' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: list(value.replace(' ', '').split(';')) for (key, value) in parsed_s}" "import re def main(text): text = text.replace('\n', ' ') keys = re.findall('""(.*?)""', text) values = re.findall(' -?\\d+', text) for i in range(len(values)): j = values[i].replace(' ', '') values[i] = int(j) temp = dict(zip([data for data in keys], [data for data in values])) return temp" "def is_negative_digit(a_string): if a_string[0] == '-': return a_string[1:].isdigit() def main(s): s = s.replace('||', '') s = s.replace('#', '') s = s.replace('::=', ' ') s = s.replace(';', ' ') s = s.replace('(', '') s = s.replace(')', '') s = s.replace('opt q', '') s = s.replace('opt\nq', '') s = s.replace('', '') s = s.replace('.', '') s = s.replace('#', ' ') s = s.replace('\n ', ' ') tokens = s.split() d = {} a = [] b = [] j = -1 for i in range(len(tokens)): if not (tokens[i].isdigit() or is_negative_digit(tokens[i])): a.append(tokens[i]) b.append([]) j += 1 elif tokens[i] != '\n': b[j].append(int(tokens[i])) else: b[j].append('') for i in range(len(a)): d[a[i]] = b[i] return d" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('declare(.*?)[>]', s) for i in d: i = i.replace(""'"", ' ') (key, value) = i.split(':=') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') value = value.replace(' ', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = int(value) return ans" "import re def main(example): exr = '\\s*new\\s*list\\(([^)]*)\\)\\s*==>\\s*\\""([^)]*)\\""' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[0].split('#'): s.append(j) s = s[1:] for i in range(len(s)): s[i] = int(s[i]) key = match[1] d[key] = s return d" "import re def main(x): pattern = '(?: ?data ?` ?(?:.+?) ?list ?\\((?:.+?)\\) ?\\.)+' x = x.replace('\n', ' ') res = {} found = [item for item in re.findall(pattern, x)] for item in found: array_items = [int(item.strip().replace('#', '').strip()) for item in re.search('list ?\\((.+?)\\)', item).group(1).split(';')] array_name = re.search('data ?` ?(.+?) ?list', item).group(1).strip() res[array_name] = array_items return res" "import re def main(example): exr1 = 'decl\\W(\\w*)' exr2 = ""[\\'](.*?)[\\']"" d = {} matches1 = re.findall(exr1, example) matches2 = re.findall(exr2, example) for i in range(len(matches1)): d[matches2[i]] = matches1[i] return d" "def main(s: str): res = {} s = s.replace('<%', '') s = s.replace('%>', '') s = s.replace('new', '') s = s.replace('array(', '') s = s.replace('to', '') s = s.replace('|', '') s = s.replace('.', '') s = s.replace('`', '') s = s.replace(')', '') dele = s.rfind(';', 1) s = s[:dele] for el in s.rsplit(';'): count = el.split() tmp = count[len(count) - 1] count.pop(-1) res[tmp] = count return res" "import re def main(s): pattern = 'val ?`(\\w+) ?: ?# ?\\(((?: ? ?\\w+ ?.? ?)+)\\)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: list(value.replace(' ', '').split('.')) for (key, value) in parsed_s}" "def main(txt): result = {} mass = txt.split(',')[:-1] for x in mass: (val, per) = x.split('>') val = val.split()[-2] val = int(val) per = per[1:-2].strip().strip('`') result[per] = val return result" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') while x != ',.end': index1 = x.find('array(') + 6 index2 = x.find(')->') index3 = x.find(""->@'"") + 4 index4 = x.find(""'.||"") tmp = x[index1:index2].split(';') fm = [] for t in tmp: fm.append(int(t.replace('#', ''))) mdict[x[index3:index4]] = fm x = x[index4 + 4:] return mdict" "import re def main(source): p_values = '(#-?[0-9]*)' p_keys = '(option\\s?.?[a-z]*\\_?\\d?[0-9]*)' response = {} new_source = source.replace('\n', ' ') keys = re.findall(pattern=p_keys, string=new_source) values = re.findall(pattern=p_values, string=new_source) for i in range(len(keys)): keys[i] = keys[i].replace('option ', '') for i in range(len(values)): values[i] = values[i].replace('#', '') for i in range(len(keys)): response[keys[i]] = int(values[i]) return response" "import re def parse_keys(x): keys = '\\w+' return re.findall(keys, x) def main(x): result = {} p = re.findall(""\\'(\\w+)\\'"", x) s = re.findall('\\(\\w+', x) keys = parse_keys(str(s)) for i in range(len(keys)): result[keys[i]] = p[i] return result" "import re def main(data): data = data.replace('\n', '') template = '\\[ ?loc ?""([a-z0-9_]+)"" ?=: ?([a-z0-9_]+) ?\\]' array_data = re.findall(template, data) new_dict = {} for i in range(len(array_data)): new_dict[array_data[i][1]] = array_data[i][0] return new_dict" "import re def main(s): pattern = '@\\""(\\w+)\\"" ?<== ?(-?\\d+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: int(value) for (key, value) in parsed_s}" "import re def main(example): exr = '\\s*variable\\s*\\@\\""([^\\|]*)\\""\\s*::=\\s*([^\\|]*)' d = {} matches = re.findall(exr, example) for match in matches: s = 0 for j in match[1].split(','): s += int(j) key = match[0] d[key] = s return d" "import re def main(string): exr = 'list\\(\\s*([^)]*)\\)\\s*=>\\s*\\@\\""([^)]*)\\"";' d = {} matches = re.findall(exr, string) for match in matches: s = [] for j in match[0].split('.'): j = j.strip().strip('#') s.append(int(j)) key = match[1] d[key] = s return d" "import re def main(example): exr = '\\s*global\\s*([A-Za-z0-9_]*)\\s*(\\|\\>)\\s*([A-Za-z0-9_]*)' d = {} matches = re.findall(exr, example) for match in matches: s = match[0] key = match[2] d[key] = s return d" "def main(x): di = {} al = [] sl = [] i1 = 0 x = x.replace('<', ' ') x = x.replace('\n', ' ') while x.find('let') != -1: i1 = x.find('let') x = x[i1 + 4:] al.append(x.partition(' ')[0]) i2 = x.find('|') x = x[i2 + 1:] while not (x[0].isdigit() or x[0] == '-'): x = x[1:] sl.append(int(x.partition(';')[0])) di = dict(zip(al, sl)) return di" "import re def main(example): exr = re.compile('val\\s*([^\\s?=]*)\\s*=\\s*q\\(([^)]*)\\)') d = {} matches = re.findall(exr, example) for match in matches: for j in match[1].split(','): j = j.strip().strip(""'"") s = j key = match[0] d[key] = s return d" "import re def main(s): regex = 'do[\\n \\s](.*?)\\sis[\\n \\s](.*?)\\.' dict = {} matches = re.findall(regex, s) for match in matches: dict[match[0]] = match[1] return dict" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('decl(.*?)[;]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split('=:') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') value = value.replace(' ', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = value return ans" "import re def main(x): res = re.findall('\\w{4,}', x) d = {} for i in range(0, len(res) - 1, 2): d.update({res[i]: res[i + 1]}) return d" "def main(x): d = {} for i in range(x.count('`')): name_start = x.find('`') name_end = x.find(':=') name = x[name_start + 1:name_end].strip(' \n') key_start = x.find(':=') key_end = x.find('.') key = x[key_start + 2:key_end].strip(' ') d[name] = int(key) x = x[key_end + 1:len(x)] return d" "import re def main(a): result = {} a = a.split('declare') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search(""'.+?'"", a[i]) if key: value = re.search(""@'.+'"", a[i])[0][2:-1] result[key[0][1:-1]] = value return result" "def main(x): x = x.replace(' ', '').replace('\n', '').replace('<%optionarray(', '') x = x.replace('(', '').replace(')', '') str = x.split(';') ret = {} for st in str: st_sp = st.split('=>') if st_sp[0] != '': num = st_sp[0].replace('#', '').split(',') num_n = [int(x) for x in num] ret[st_sp[1].replace('`', '').replace('%>', '')] = num_n return ret" "def main(x): x = x.replace(' ', '').replace('make{', '[') x = x.replace('`', ""'"").replace("".'"", ""', '"") x = x.replace('}', ""']"").replace('\n', '') x = x.replace(')).((', '\n').replace("".'"", ""', '"") x = x.replace(';', ""':,"").replace('==>', ""= '"") x = x.replace('<%((', '{').replace(',)).%>', '}') x = x.replace('= ', '=').replace('{[', '').replace(']', '') x = x.replace('[', '').replace('}', '').replace(':,', '').replace(':', '') x = x.replace(""'"", '') blocks = x.split('\n') result = dict() for block in blocks: key_value = block.split('=') result[key_value[1]] = [x.strip() for x in key_value[0].split(',')] return result" "def main(x): slovar = {} while x.find('<<') != -1: k = str.strip(x[x.find('->') + 2:x.find('.')]) v = int(str.strip(x[x.find('global') + 6:x.find('->')])) slovar[k] = v x = x[x.find(',') + 1:] return slovar" "def main(s): result = dict() s = s.replace(' ', '')[1:-1].strip('\n') while s: key = s[s.find('@""') + 2:s.find('"":')] value = s[s.find('(') + 1:s.find(')')].split(',') value = [int(elem) for elem in value] result[key] = value s = s.replace(s[:s.find(')') + 1], '') return result" "def main(row): ans = {} row = row.replace('\n', ' ') row = row.replace('[', '') row = row.replace(']', '') row = row.replace('store', '') row = row.replace('.', '') row = row.replace('<', '') row = row.replace('>', '') row = row.replace('%', '') row = row.replace(' ', '') row = row.split('@""') del row[0] for i in row: i = i.split('""') ans |= {i[0]: i[1]} return ans" "import re def main(x): nv = list() re_keys = re.compile(""\\'(\\s*[a-zA-z0-9_-]*\\s*)\\'"") re_values = re.compile('data\\s*{\\s*[a-zA-z_0-9]*\\s*[a-zA-z_0-9]*\\s*[a-zA-z_0-9]*\\s*[a-zA-z_0-9]*\\s*[a-zA-z_0-9]*\\s*}') keys = re_keys.findall(x) values = re_values.findall(x) for i in range(len(values)): values[i] = values[i][5:] values[i] = values[i].replace('}', '') values[i] = values[i].replace('{', '') nv.append(values[i].split()) ans = dict(zip(keys, nv)) return ans" "import re def main(inp: str): keys = re.findall('""(\\w+)""', inp) values = re.findall('decl\\s(\\w+)', inp) return dict(zip(keys, values))" "def main(string): string.replace('to\n', 'to') string.replace('to ""', 'to""') valve = {} while string != '': string = string.partition('#(')[2] if string == '': break check = string.partition('')[0] name = check.partition('""')[2] name = name.partition('""')[0] check = check.partition('to""')[0] value = [] while check != '': check = check.partition('q(')[2] if check == '': break newval = check.partition(')')[0] value.append(newval) string = string.partition('')[2] valve[name] = value return valve" "import re def main(s): pattern = '@\\""(\\w+)\\"" ?: ?list\\(((?: ?#-?\\w+ ?)+)\\)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) result = {} for (key, value) in parsed_s: value_sp = value.strip().split('#') val = [] for v in value_sp: if len(v) > 0: val.append(int(v)) result[key] = val return result" "import re def main(s): return dict(zip([i[:-2] for i in re.findall('\\S+<-|\\S+\\s<', s)], [i[1:] for i in re.findall('""\\w+', s)]))" "import re def main(example): exr = '\\s*do\\s*global\\s*\\{(\\s*\\`[^\\}]*\\s*)\\}\\s*to\\s*@\\""([^\\""]*)\\""' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[0].split(','): j = j.strip().strip('`') s.append(j) key = match[1] d[key] = s return d" "def main(data): data = data.replace('', '').replace('', '').replace('do', '') data = data.replace('let', '').replace('#', ',').replace('.end.', '') data = data.replace('.', ',').replace(' ', '').replace('=', ',') data = data.replace(',,', '').replace('\n', '') obj = data.split(',') for i in range(len(obj)): if obj[i] == '': obj.remove('') key = [] words = [] for i in range(len(obj)): if ':' in obj[i]: key.append(obj[i]) else: words.append(obj[i]) for i in range(len(key)): key[i] = key[i].replace(':', '') result = [] for i in range(len(words)): if words[i] != '\n': result.append(int(words[i])) tuples = dict(zip(key, result)) return tuples" "import re def main(s): pattern = 'list\\(((?: ?`\\w+ ?,? ?)+)\\) ?-> ?(\\w+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: list(value.replace(' ', '').replace('`', '').split(',')) for (value, key) in parsed_s}" "def main(x): otvet = {} x = x.replace('\n', ' ') x = x.replace(';', '') x = x.replace('', '') x = x.replace('', '') x = x.replace('->', ' ') x = x.replace('{{', ' ') x = x.replace('}}', ' ') x = x.replace('@', ' ') x = x.replace('q(', ' ') x = x.replace(')', '') x = x.replace(' global ', '') x = x.replace(""'"", '') x = x.split(' ') arg_1 = '' arg_2 = '' for i in x: if arg_1 == '' and i != '': arg_1 = i elif arg_2 == '' and i != '': arg_2 = i if arg_1 != '' and arg_2 != '': otvet[arg_2] = arg_1 arg_2 = '' arg_1 = '' return otvet" "def main(x): x = x.replace('| |', '!') x = x.replace('||', '!') x = x.replace('|\n|', '!') x = x.replace('|', '') x = x.replace('\n', ' ') x = x[:x.rfind('%')] x = x.split('!') d = {} for element in x: elems = element[element.find('[') + 1:element.find(']')] elems = elems.replace(',', ' ') elems = elems.replace(""'"", '') elems = elems.replace(' ', ' ') elems = elems.strip() elems = elems.split() key = element[element.find('>') + 1:] key = key.strip() d.update({key: elems}) return d" "import re def main(str): MatchObject = re.findall('[a-z_\\d]+', str) dict = {} switcher = True position = 2 while switcher: try: item1 = MatchObject[position] item2 = MatchObject[position + 1] dict[item1] = item2 position += 5 except Exception as ex: switcher = False return dict" "import re def main(str): parsed = re.findall('(set\\s([a-z_0-9]*)\\s*:=\\s*\\#([0-9-]*))', str) result = {} for i in parsed: result[i[1]] = int(i[2]) return result main('set anra := #5738. set ertiis:=#9753. \\\nset zageate_407 := #-1642. set arraor:=#9204.')" "import re def main(example): exp = '\\s*global\\s([^\\s]*)\\sis\\s`([^\\s\\|]*)' d = dict({}) matches = re.findall(exp, example) for match in matches: key = match[0] d[key] = match[1] return d" "def main(s): arr = s.split('#')[1:] for i in range(0, len(arr)): arr[i] = arr[i].split('==>') for i in range(0, len(arr)): arr[i][1] = arr[i][1].split() arr_value = [int(x[0].rstrip()) for x in arr] arr_key = [x[1][0] for x in arr] Dict = dict(zip(arr_key, arr_value)) return Dict" "def main(a): a = a.replace(' ', '') a = a.replace('\n', '') ans = dict() rind = a.find('') + 7 while rind != a.rfind('') + 7: ind = a.rfind('', 0, rind) tmp = a[ind:rind] a = a.replace(tmp, '') rind = a.find('') + 7 ind_ar = tmp.find('(') + 1 rind_ar = tmp.find('.', ind_ar) ar = list() while rind_ar != -1: ar.append(tmp[ind_ar:rind_ar]) ind_ar = rind_ar + 1 rind_ar = tmp.find('.', ind_ar) ar.append(tmp[ind_ar:tmp.find(')')]) ans[tmp[tmp.find('""') + 1:tmp.rfind('""')]] = ar return ans" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('define(.*?)[;]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split('|') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') value = value.replace(' ', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = value return ans" "def main(x): S = {} while x.find('begin') != -1: a = x[x.find('""') + 1:x.find('.') - 1] b = x[x.find('glob') + 5:x.find('=')] S[a] = str.strip(b) x = x[x.find('end') + 4:] return S" "def main(s): s = s.replace('\n', ' ').replace('; od, od', '').replace(';od,od', '').replace(';od, od', '').replace('do', '').replace('; od,od', '').replace('od,', '').replace('local', '').replace('|>', '').replace('[', '- ').replace(']', '-').replace(' ', ' ') new = [] new = s.split(';') val = [] for i in new: val.append(i.split('-')[1]) keys = [] for i in new: keys.append(i.split(""'"")[1]) values = [] for i in val: cur = [] val_split = i.split(' ') for j in val_split: if len(j) != 0: cur.append(j) values.append(cur) end = {} for i in range(len(keys)): end[keys[i]] = values[i] return end" "import re def main(s): pattern = 'global ?(\\w+) ?:= ?(-?\\d+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: int(value) for (key, value) in parsed_s}" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('equ(.*?)end', s) for i in d: (value, key) = i.split('=:') key = key.replace(';', '') key = key.replace(' ', '') key = key.replace(""'"", '') key = key.replace('""', '') key = key.replace('@', '') key = key.replace('.', '') value = value.replace(""'"", '') value = value.replace('""', '') value = value.replace('array', '') value = value.replace('.', '') value = value.replace(' ', '') value = value.replace('@', '') value = value.replace('{', '') value = value.replace('}', '') value = value.replace('(', '') value = value.replace(')', '') value = value.replace('[', '') value = value.replace(']', '') value = value.split(';') ans[key] = value return ans" "import re def main(a): result = {} a = a.split('begin') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('`.+isq', a[i]) if key: value = re.search('\\(.+\\)', a[i])[0][1:-1] result[key[0][1:-3]] = value return result" "def main(text): text = text.replace('\n', '') text = text.replace(' ', '') text = text.replace('};', '') text = text.replace(']', '') text = text.replace('{', '') text = text.replace(';', '') text = text.replace('#', '♂') text = text.replace(""'"", '') text = text.split('equ@') text = text[1:] result = {} for i in range(len(text)): text[i] = text[i].split('♂') result = {text[i][0]: int(text[i][1]) for i in range(len(text))} return result" "import re def main(example): exr = '\\s*\\[\\[\\s*opt\\s*`([^\\s]*)\\s*==>\\s*([^;]*);\\s*\\]\\]' d = {} matches = re.findall(exr, example) for match in matches: s = match[0] key = match[1] d[key] = s return d" "import re def main(example): exr = re.compile(""opt\\s+([^\\s=]+)\\s*==>\\s*@'([^']+)'"") d = {} matches = re.findall(exr, example) for match in matches: for j in match[0].split(','): j = j.strip().strip(""'"") s = j key = match[1] d[key] = s return d" "import re def main(a): result = {} a = a.split('let') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('to.+;', a[i]) if key: value = re.search('"".+?""', a[i])[0][1:-1] result[key[0][2:-1]] = value return result" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('->.*?;', a) tre = re.findall('equ.*?->', a) for i in range(len(one)): one[i] = one[i].replace('-', '') one[i] = one[i].replace('>', '') one[i] = one[i].replace(' ', '') one[i] = one[i].replace(';', '') for i in range(len(tre)): tre[i] = tre[i].replace('equ', '') tre[i] = tre[i].replace('[', ' ') tre[i] = tre[i].replace(']', ' ') tre[i] = tre[i].replace('->', '') tre[i] = tre[i].split(' ') tree = tre[i] new_tre = [] for j in range(1, len(tree) - 1): if tree[j] != '': new_tre.append(int(tree[j])) tre[i] = new_tre x = {} for i in range(len(tre)): one[i] = x.setdefault(one[i], tre[i]) return x" "import re def main(s): pattern = 'make ?(\\w+) ?==> ?`(\\w+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value for (value, key) in parsed_s}" "def main(s): a = {} s = s.replace(' ', '').replace('\n', '').replace('.do', '').replace(',.end', '').replace('
variable', '').replace('
', '') z = s.split(',') for i in z: b = i[i.index('array(') + 6:i.index(')')].split(';') tmp = [int(j) for j in b] a[i[i.index(')==>') + 4:]] = tmp return a" "def main(arg): split = arg.replace('done', '').replace('do ', '').replace(' ', '') split = split.replace('\n', '').split('::=#') new = list() for s in split: tmp = filter(None, s.split('`')) new.append(list(tmp)) new = flatten(new) hashmap = dict() for i in range(0, len(new), 2): key = new[i] val = new[i + 1] hashmap[key] = int(val) return hashmap def flatten(list_of_lists): if len(list_of_lists) == 0: return list_of_lists if isinstance(list_of_lists[0], list): return flatten(list_of_lists[0]) + flatten(list_of_lists[1:]) return list_of_lists[:1] + flatten(list_of_lists[1:])" "import re def main(s): a = re.findall('(?<=b\\s)\\w+', s) b = [*map(lambda x: re.findall('-?\\d+', x), re.findall('\\[[^\\]]+', s))] return {i[0]: [*map(int, i[1])] for i in zip(a[::1], b[::1])}" "import re def main(text: str): result = dict() text = text.replace('\n', ' ') keys = re.findall('>.*?\\.', text) data = re.findall('variable.*?=', text) for n in range(len(keys)): keys[n] = keys[n].replace('>', '').replace('.', '').replace(' ', '') data[n] = data[n].replace('variable', '').replace('=', '') data[n] = data[n].replace(' ', '') result[keys[n]] = data[n] return result" "def main(x): peps = x.split(sep='define') out = dict() for str in peps: if str.find('{') != -1: continue name_1 = str.find(""'"") name_2 = str.find(""'"", name_1 + 1) name = str[name_1 + 1:name_2] str = str[name_2 + 1:] nums_1 = str.find('(') nums_2 = str.find(')') str = str[nums_1 + 1:nums_2] str = str.replace('#', ' ') value = str.split() value = [int(x) for x in value] out[name] = value return out" "import re import pprint def main(example): exr = '\\s*<<\\s*data\\s*([\\S^:]*)\\s*:\\s*(-*\\d*)' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split(','): j = j.strip().strip(""'"") s.append(int(j)) key = match[0] d[key] = int(''.join(map(str, s))) return d" "def main(x): x = x.replace('\x08egin', '').replace('\\begin', '').replace('begin', '').replace('declare', '').replace('end', '').replace('q(', '').replace('.', '').replace(')', '@').replace('\n', ' ').replace(' ', '') x_parts = x.split(',') x_parts.pop(-1) x_parts1 = [i.split('@to') for i in x_parts] result = {} for i in x_parts1: result[i[1]] = i[0] return result" "import re def main(text): z = ""\\s*loc\\s*\\S*[0-9]+\\s*=>\\s*\\S*\\'[\\w]+\\'"" a = re.findall(z, text) q = {} for i in a: i = i.strip() key = i.split('=>')[1].strip("" '@"").strip(' ""\n@') value = i.split('=>')[0].strip(' loc').replace('""""', ' ') value = int(value) key = key.replace(""'"", '') q[key] = value return q" "import re def main(source): source = source.replace('\n', ' ') source = source.replace('\\n', ' ') matches = re.findall('>.{1,15}od', source) for i in range(len(matches)): matches[i] = matches[i].replace('>', '') matches[i] = matches[i].replace(';', '') matches[i] = matches[i].replace(' ', '') matches[i] = matches[i].replace('od', '') matches_one = re.findall('\\{.{1,35}\\}', source) itoge = {} for j in range(len(matches_one)): matches_one[j] = matches_one[j].replace('#', '') matches_one[j] = matches_one[j].replace('{', '') matches_one[j] = matches_one[j].replace('}', '') matches_one[j] = matches_one[j].replace(' ', '') matches_one[j] = matches_one[j].split(',') for k in range(len(matches_one[j])): matches_one[j][k] = int(matches_one[j][k]) itoge[matches[j]] = matches_one[j] return itoge" "import re def main(example): exp = '\\s*glob\\s*(\\w*)\\s*:\\s*(\\w*)' matches = re.findall(exp, example) listing = {} for match in matches: listing[match[0]] = match[1] return listing" "import math import string def main(s): res = dict() s = s.replace('\n', ' ') s = s.replace('( ', '(') s = s.replace(') ', ')') s = s.replace('do option q', 'FLAGQ') s = s.replace(' ', ' ') index = s.find('FLAGQ(') while index != -1: s = s[index + 6:] name_index = s.find(')') name = s[:name_index] s = s[name_index + 9:] end_index = s.find(')') list = s[:end_index] list = list.split() for i in list: list[list.index(i)] = int(list[list.index(i)]) res[name] = list index = s.find('FLAGQ(') return res" "import re def main(example): exr = '(\\s*`([^;]*))' d = {} matches = re.findall(exr, example) for match in matches: for j in match[1].split(','): (a, b) = j.split('<=') a = a.strip() b = b.strip('array(') b = b.strip(' array(') b = b.strip(')') c = b.split('.') for i in range(len(c)): c[i] = c[i].strip() c[i] = c[i].strip('array( ') c[i] = c[i].strip('#') c[i] = int(c[i]) d[a] = c return d" "import re def main(example): exr = '\\s*option\\s*\\[([^]]*)\\]\\s*->\\s*([^\\;]*)' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[0].split('.'): j = j.strip().strip(""'"") j = j.strip('#') j = int(j) s.append(j) key = match[1] d[key] = s return d" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('array(.*?)[;]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split('|') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') value = value.split() ans[key] = value return ans" "def main(arg): d = {} args = dis(arg) lst = [args[0]] for i in range(1, len(args)): if args[i - 1] == '==>': d[args[i]] = lst lst = [] elif args[i] != '==>': lst.append(args[i]) return d def dis(arg): d = {} a = arg.split() for i in range(len(arg)): arg = arg.replace('do declare', ' ') arg = arg.replace('\n', ' ') arg = arg.replace(';', ' ') arg = arg.replace(""'"", ' ') arg = arg.replace('""', ' ') arg = arg.replace('(', ' ') arg = arg.replace(')', ' ') arg = arg.replace('#', ' ') arg = arg.replace('.', ' ') arg = arg.replace('[', ' ') arg = arg.replace(']', ' ') arg = arg.replace('end', ' ') a = arg.split() while '' in a: a.remove('') return a" "import re def main(s): pattern = 'variable ?(\\w+) ?:= ?array\\(((?: ?#-?\\w+ ?;?)+)\\)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) result = {} for (key, value) in parsed_s: value_sp = value.strip().replace(';', '').split('#') val = [] for v in value_sp: if len(v) > 0: val.append(int(v)) result[key] = val return result" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('equ(.*?)[.]', s) for i in d: i = i.replace(""'"", ' ') (key, value) = i.split('::=') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = int(value) return ans" "def main(string): lst = string.split() key = [] value = [] for i in range(len(lst)): if lst[i].lstrip('-').isdigit(): value.append(int(lst[i])) if '`' in lst[i]: key.append(lst[i].split('`')[1].split('.')[0]) return dict(zip(key, value))" "def make_arr(arr): arr = arr.split('=>') key = arr[1] value = int(arr[0]) return (key, value) def main(s): s = s.replace('', '') s = s.replace('', '') s = s.replace('data', '') s = s.replace('{', '') s = s.replace('}', '') s = s.replace('\n', '') s = s.replace(' ', '') s = s.split('.') s.pop() d = {} for i in s: (key, value) = make_arr(i) d[key] = value return d" "def main(ayaya): ayaya = ayaya.replace('\n', ' ') F = {} temp = [] while True: a = ayaya.find('(') b = ayaya.find(')') name = ayaya[ayaya.find('(') + 1:ayaya.find(')')] body = ayaya[ayaya.find('[') + 1:ayaya.find(']')] if body[0] == ' ': body = body[1:] if body[len(body) - 1] != ' ': body = body + ' ' while True: if len(body) == 0: F[name.strip()] = temp temp = [] break temp.append(body[:body.find(' ')]) body = body[body.find(' ') + 1:] newstr = ayaya.find('
') ayaya = ayaya[newstr + 10:] if ayaya.find('
') == -1: break return F" "import re def main(str): pattern = '(?<=[@]).*?(?=[.][|])' result = {} str = str.replace(' ', '') str = str.replace(""'"", '') str = str.replace('\n', '') access = re.findall(pattern, str) for i in access: txt = i.split('=>') result[txt[1]] = txt[0] return result" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('store(.*?)[;]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split('->') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') value = value.split() value = list(filter(None, value)) ans[key] = value return ans" "import re def main(example): exr1 = '`\\w+' exr2 = '@""\\w+""' matches = re.findall(exr1, example) matches2 = re.findall(exr2, example) d = {} ls = [] str = example str2 = '' str3 = '' str4 = '' str = str.split('}}') for i in range(len(str) - 1): matches = re.findall(exr1, str[i]) str2 = ''.join(matches) matches2 = re.findall(exr2, str[i]) ls = matches2 for j in range(len(ls)): str4 = ''.join(ls[j]) str4 = str4[2:] str4 = str4[:-1] ls[j] = str4 str4 = ''.join(str2[1:]) d[str4] = ls return d" "import re def main(source): source = source.replace('\n', ' ') source = source.replace(' :', ':') matches = re.findall(""@.{1,15}'"", source) for i in range(len(matches)): matches[i] = matches[i].replace('@', '') matches[i] = matches[i].replace(""'"", '') matches_one = re.findall('[^_\\d][-+]?\\d+', source) my_list = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace('=', '') my_list[matches[j]] = int(matches_one[j]) return my_list" "def main(x): x = x.split(';') d = {} x = x[:-1] for i in x: key = i[i.find('data') + 5:i.find('::=')] key = key.strip('\n') key = key.strip() values = i[i.rfind('array(') + 6:i.find(').')] values = values.split(',') l_v = [] for j in values: j = j.strip() j = j.strip('#') l_v.append(int(j)) d.update([(key, l_v)]) return d" "def main(s): a = {} s = s.replace('begin', ' ') s = s.replace('end', ' ') s = s.replace('<=', ':') s = s.replace('||.', ',') s = s.replace('let ', ' ') s = s.replace('let\n', ' ') s = s.replace('||', '') s = s.replace('.', '') s = s.replace('\n', ' ') s = s.replace(' ', '') s = s.replace('{', ""{'"") s = s.replace('}', ""'}"") s = s.replace(':', ""': '"") s = s.replace(',', ""' , '"") s = s.replace(""'"", '') s = s.replace(' ', '') if s[-1] == ',': s = s[:-1] s = s.split(',') for i in range(len(s)): s[i] = s[i].split(':') a[s[i][0]] = s[i][1] return a" "import re def main(x): exr = ""declare\\s*\\'([^']*)\\'\\s*=\\s*([^;]*);\\s*"" d = {} matches = re.findall(exr, x) for match in matches: key = match[0] d[key] = int(match[1]) return d" "def main(text): text = text.replace('||', '') text = text.replace('\x08egin', '') text = text.replace('\n', ' ') text = text.replace('\\', '') text = text.replace('end', '') text = text.replace('begin', '') text = text.replace('.', '') text = text.replace('->', '') text = text.split('decl') text = text[1:] keys = [] values = [] result = {} for i in range(len(text)): new_text = text[i].split() for j in range(len(new_text)): if j % 2 == 0: values.append(int(new_text[j])) else: keys.append(new_text[j]) result = result.fromkeys(keys) o = 0 for key in result: result[key] = values[o] o += 1 return result" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('set(.*?)[.]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split('==>') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = int(value) return ans" "def main(s: str): res = {} s = s.replace('\n', ' ') s = s.replace('val q(', '') s = s.replace('done', '') s = s[2:] s = s.replace('val q', '') s = s.replace('.', '@') s = s.replace('(', '') s = s.replace(')', '') s = s.replace('[', '') s = s.replace(']', '') s = s.replace('::=', '@') s = s.split('@') a = [] for el in s: a.append(el.split()) a = list(filter(None, a)) counter = 0 key = value = '' for mas in a: if counter == 2: counter = 0 res[key] = value if len(mas) == 1: key = mas[0] counter += 1 else: value = mas counter += 1 res[key] = value return res" "from pprint import pprint def main(text): text = text.replace('\n', '') text = text.replace(' ', '') text = text.replace('', '') text = text.replace('', '') text = text.replace('.begin', '') text = text.replace(';', '') text = text.replace(',', '') text = text.replace('.end', '') text = text.replace('to', '♂') text = text.split('local') text = text[1:] result = {} for i in range(len(text)): text[i] = text[i].split('♂') result = {text[i][1]: text[i][0] for i in range(len(text))} return result" "import re def main(source): p = '(opt\\s*([A-Za-z0-9-_]*)\\s*=>\\s*([A-Za-z0-9-_]*))' matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[2]] = match[1] return response" "import re def main(example): exr1 = 'let\\W(\\w*)' exr2 = '[\\""](.*?)[\\""]' d = {} matches1 = re.findall(exr1, example) matches2 = re.findall(exr2, example) for i in range(len(matches1)): d[matches2[i]] = matches1[i] return d" "import re def parse_keys(x): keys = '\\w+' return re.findall(keys, x) def main(x): result = {} p = re.findall(""@\\'(\\w+)\\'\\s*;"", x) s = re.findall(""@\\'(\\w+)\\'\\s*:"", x) for i in range(len(p)): key = s[i] word = p[i] result[key] = word return result" "import re def main(str): MatchObject = re.findall('[a-z_\\d]+', str) dict = {} lst = [] switcher = True position = 0 item_name = None length = len(MatchObject) while switcher: try: if position >= length or MatchObject[position] == 'store': position += 1 try: if item_name is not None: dict[item_name] = lst lst = [] item_name = None if position >= length: switcher = False except Exception as ex: pass else: if item_name is None: item_name = MatchObject[position] else: lst.append(MatchObject[position]) position += 1 except Exception as ex: switcher = False return dict" "import re def main(st): a = re.findall('do auto\\s*q\\(([a-z0-9_]*)\\)\\s*is\\s*@\\""([a-z0-9_]*)\\""\\s*od', st) result = {} for i in a: txt = i result[txt[0]] = txt[1] return result" "def main(s: str): res = {} s = s.replace(';<', '') s = s.replace('; <', '') s = s.replace('; <', '') s = s.replace('; <', '') s = s.replace('; <', '') s = s.replace('; <', '') s = s.replace('\n', '') s = s.replace('\\', '') s = s.replace('""', '') s = s.replace('data', '') s = s.replace('sect', '') s = s.replace('.', '') s = s.replace(""'"", '') s = s.replace('<', '') s = s.replace('>', '') s = s.replace('[[', '') s = s.replace(']]', '') s = s.replace('/', '') s = s.replace(' ', '') s = s.replace(':=', ' ') for el in s.split(';'): res[el.split(' ')[0]] = el.split(' ')[1] return res" "def main(a): a = a.replace('\n', ' ') a = a.replace(' ', '') a = a.replace('@', '') a = a.replace('].', '') a = a.replace('{{', '') a = a.replace('}}', '') a = a.replace('variablearray', '') a = a.replace(""'"", '') a = a.replace('`', '') a = a.replace('[', '') a = a.replace('=', '') a = a.replace(')', '') a = a.replace('(', '') a = a[:len(a) - 1] a = a.split('.') res = dict() for i in range(len(a)): a[i] = a[i].split(':') for j in range(len(a[i])): a[i][j] = a[i][j].split(',') for k in a: key = k[1][0] value = k[0] res[key] = value return res" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('var(.*?)[<]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split('=:') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = int(value) return ans" "import re def main(x): x = re.split(' *=', x) res_dict = {} for i in range(1, len(x)): res_dict.setdefault(x[i - 1].split()[-1], x[i].split()[0].split(';')[0]) return res_dict" "def main(s: str): res = {} s = s.replace('\n', ' ') s = s.replace(' is ', 'aaaabbbb') s = s.replace('\\', '') s = s.replace('""', '') s = s.replace('(', '') s = s.replace(')', '') s = s.replace('@', '') s = s.replace('option', '') s = s.replace('.', '') s = s.replace(""'"", '') s = s.replace('<', '') s = s.replace('>', '') s = s.replace('/', '') s = s.replace(' ', '') s = s.replace(']][[', 'abcdef') s = s.replace('[[', '') s = s.replace(']]', '') for el in s.split('abcdef'): res[el.split('aaaabbbb')[0]] = el.split('aaaabbbb')[1] return res" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('set(.*?)[|]', s) for i in d: i = i.replace(""'"", ' ') (key, value) = i.split(':=') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = int(value) return ans" "def main(x): i = 0 var = False res = {} value = [] name = '' number = '' while i < len(x): if x[i] == '[': i += 1 number = '' value = [] if (x[i] != ' ') & (x[i] != '\n'): i -= 1 while True: i += 1 if (x[i] != ' ') & (x[i] != '\n'): number += x[i] else: value.append(int(number)) number = '' if x[i] == ']': if number[0] != ']': value.append(int(number[:-1])) number = '' break if x[i] == '(': i += 1 while x[i] != ')': name += x[i] i += 1 res[name] = value value = [] name = '' i += 1 return res" "def main(row): ans = {} row = row.replace('\n', ' ') row = row.replace('|', '') row = row.replace('>>', '') row = row.replace('<<', '') row = row.replace('.', '') row = row.replace('val', '') row = row.replace('>', '') row = row.replace(')', '') row = row.replace(' ', '') row = row.split(',') row.pop() for i in row: i = i.split('q(') ans |= {i[1]: int(i[0])} return ans" "import re def main(example): exr = '\\s*define\\s([^ ]*)\\s*=([^.]*)' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split(','): j = j.strip().strip(""'"") s.append(j) key = match[0] d[key] = int(s[0]) return d" "import re def main(source): source = source.replace('(', '') source = source.replace('
', '') source = source.replace('
', '') source = source.replace('decl', '') p = '[-+]?\\w+' matches = re.findall(pattern=p, string=source) response = {} for i in range(len(matches)): j = i + 1 arr = [] if re.match('[-+]?\\d+', matches[i]) is not None: continue while j < len(matches) and re.match('[-+]?\\d+', matches[j]) is not None: arr.append(int(matches[j])) j += 1 response[matches[i]] = arr return response" "import re def main(example): exr = 'glob\\s([^\\s\\=]*)\\s*=\\s*([^\\s\\<]*)' d = {} matches = re.findall(exr, example) for match in matches: d[match[0]] = match[1] return d" "import re def main(source): p = '(\\s*auto\\s*([-0-9]*)\\s*=:\\s*([A-Za-z0-9-_]*)\\s*)' matches = re.findall(pattern=p, string=source) response = {} for match in matches: response[match[2]] = int(match[1]) return response" "import re def main(text): result = {} text = re.sub('^\\s|\\n|\\r|\\s+$', '', text) text = text.replace(' ', '') data = text.split(';>><<') data[0] = data[0][3:] data[len(data) - 1] = data[len(data) - 1][:-4] for string in data: inf = string.split('to') result[inf[1]] = inf[0][3:] return result" "def main(x): x = x.replace('.do', '').replace('glob', '').replace('.end.', '').replace('||', '').replace('""', '').replace('\n', '').replace(' ', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('<=') for i in x_parts] result = {} for i in x_parts1: key = i[0] value = int(i[1]) result[key] = value return result" "import re def main(line): exr = '\\s*option\\s*\\""([^""]*)\\""\\s*->\\s*([^\\.]*)\\.' d = {} matches = re.findall(exr, line) for match in matches: s = [] for j in match[0].split(','): j = j.strip() s.append(j) key = match[1] d[key] = j return d" "import re def main(string): string = re.findall('[a-z_0-9-^\\t]+', string) string = ' '.join(string) string = string.replace('section', '').replace('global', '') string = string.split() curr_key = '' Dict = dict() count_of_keys = 0 for val in string: if not re.match('[-+]?\\d+$', val): count_of_keys += 1 curr_val_list = [[] * count_of_keys for i in range(count_of_keys)] ind_key = -1 for val in string: if re.match('[-+]?\\d+$', val): curr_val_list[ind_key].append(int(val)) Dict[curr_key] = curr_val_list[ind_key] else: ind_key += 1 curr_key = val return Dict" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('"".*?""', a) tre = re.findall('declare.*?=>', a) for i in range(len(one)): one[i] = one[i].replace('""', '') for i in range(len(tre)): tre[i] = tre[i].replace('declare', '') tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace('=>', '') tre[i] = int(tre[i]) x = {} for i in range(len(one)): one[i] = x.setdefault(one[i], tre[i]) return x" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('declare(.*?)[\\]]', s) for i in d: i = i.replace(""'"", ' ') (key, value) = i.split('=:') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[value] = key return ans" "import re def main(x): x = re.split(' *::=', x) res_dict = {} for i in range(1, len(x)): list_data = re.split(' |#|,|\\[|\\n', x[i].split(']')[0]) list_data = [int(el) for el in list_data if el != ''] res_dict.setdefault(x[i - 1].split()[-1][2:-1], list_data) return res_dict" "import re def main(a): a = a.replace('\n', ' ') one = re.findall(""'.*?'"", a) tre = re.findall('"".*?""', a) for i in range(len(one)): one[i] = one[i].replace(""'"", '') for i in range(len(tre)): tre[i] = tre[i].replace('""', '') tre[i] = tre[i].replace(' ', '') tre[i] = str(tre[i]) x = {} for i in range(len(one)): one[i] = x.setdefault(one[i], tre[i]) return x" "def main(line): line = line.split('begin') line.pop(0) _dict = {} for i in line: value = i[i.find('global') + 6:i.find('->')] value = value.strip() key = i[i.find(""@'"") + 2:] key = key[:key.find(""'"")] _dict[key] = value return _dict" "import re def main(source): p = '{[-0-9, \\n]+}\\s?=>\\s?[a-zA-Z0-9_\\n]+' values = re.findall(pattern=p, string=source) response = {} for val in values: tmp = val.replace(' ', '').replace('\n', '') tmp = tmp.split('=>')[0][1:-1].split(',') response[val.replace(' ', '').split('=>')[1].replace('\n', '')] = [int(i) for i in tmp] return response" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('auto(.*?)[>]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split('=:') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace(':', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = int(value) return ans" "def main(string): d = {} s = string for i in range(string.count('variable', 0, len(string))): key = '' value = '' j = s.index('variable', 0, len(s)) + 9 while s[j] != ' ': key += s[j] j += 1 j += 1 while s[j] != '.': value += s[j] j += 1 d[key] = value s = s.replace('variable', '', 1) return d" "import re def main(a): a = a.replace('\n', ' ') a = a.replace('|', '/') one = re.findall('@.*?/', a) tre = re.findall('new.*?=:', a) for i in range(len(one)): one[i] = one[i].replace('@', '') one[i] = one[i].replace(""'"", '') one[i] = one[i].replace(' ', '') one[i] = one[i].replace('/', '') for i in range(len(tre)): tre[i] = tre[i].replace('new', '', 1) tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace('=:', '') tre[i] = int(tre[i]) x = {} for i in range(len(tre)): one[i] = x.setdefault(one[i], tre[i]) return x" "def main(x): x = x.replace('', '').replace('', '').replace('let', '').replace('`', '').replace('[', '').replace(']', '').replace('\n', ' ').replace(' ', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('=') for i in x_parts] result = {} for i in x_parts1: value = i[1].split(',') for j in range(len(value)): value[j] = int(value[j]) result[i[0].replace(',', '')] = value return result" "import re def main(entry_str): raw_keys = re.findall('\\([0-9_a-zA-Z]+\\)', entry_str) raw_values = re.findall('\\[[0-9; \\n-]+]', entry_str) result = {} for (key, value) in zip(raw_keys, raw_values): value = value[1:-1] temp_values = re.split('[ ;\\n]+', value) values = [] for val in temp_values: if val: values.append(int(val)) result[key[1:-1]] = values return result" "def main(x): di = {} al = [] sl = [] a = x.replace(' ', '') a = a.replace('\n', '') a = a.split(',') a = a[:-1] for i in range(0, len(a)): string = a[i] pos1 = string.find('new') + 3 pos2 = string.find('|>') sl.append(string[pos1:pos2]) al.append(string[pos2 + 2:-2]) di = dict(zip(al, sl)) return di" "def main(a): di = {} name = '' val = [] i = 0 while i != len(a): if a[i] == '""': i = i + 1 while a[i] != '""': name = name + a[i] i = i + 1 elif a[i] == '(': j = i + 2 while a[j] != ')': if a[j] == '.': val.append(int(a[i + 1:j])) i = j j = j + 1 val.append(int(a[i + 1:j])) i = j di[name] = val name = '' val = [] i = i + 1 return di" "import re def main(str): d1 = dict() while len(str) > 0: res = re.search('""+\\w+_*[0-9]*', str) res2 = res.group(0) res2 = res2[1:] str = str[res.end():] res = re.search('\\w+_*[0-9]*\\.+', str) res1 = res.group(0) res1 = res1[:len(res1) - 1] str = str[res.end():] d1[res1] = res2 if re.search('\\w+_*[0-9]*', str) is None: break return d1" "import re def main(code): dictionary = {} list_nums = [] my_str = '' for i in re.findall('option[ \n]?([a-z_0-9]+)| ?(-?[0-9]+) ?;?[ \n]?', code): for j in i: if re.match('[a-z]+_?[0-9]*', j): if len(list_nums) != 0: dictionary[my_str] = list_nums list_nums = [] my_str = j if re.match('-?[0-9]+', j): list_nums.append(int(j)) dictionary[my_str] = list_nums return dictionary" "def main(x): result = {} buf = x.split('[[')[1:] for i in buf: i = i.strip() (k, v) = i.split(']].')[0].split('.')[0].replace('\n', ' ').split() result[k] = v return result" "def main(str): map = {} while str.find(';') != -1: key1 = str.find('`') key2 = str.find('.') key = str[key1 + 1:key2] val1 = str.find('(') val2 = str.find(')') val = str[val1 + 1:val2] if val.find(' ', -1) != -1: val = val[:-1] valarr = [] while True: if val == '': break val1 = val.find('@') + 1 val = val[0:val1] + val[val1 + 1:] val2 = val.find(""'"") valarr.append(val[val1:val2]) val = val[val2 + 1:] map[key] = valarr str1 = str.find(';') str = str[str1 + 1:] return map" "import re def main(source): source = source.replace('\n', ' ') source = source.replace('\\n', ' ') matches = re.findall('>.{1,15}\\.', source) for i in range(len(matches)): matches[i] = matches[i].replace('>', '') matches[i] = matches[i].replace(' ', '') matches[i] = matches[i].replace('.', '') matches[i] = matches[i].replace('end', '') matches_one = re.findall('[^_\\d][-+]?\\d+', source) my_dict = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace(' ', '') my_dict[matches[j]] = int(matches_one[j]) return my_dict" "import re def main(example): exr = '\\s*make\\s*\\W\\s*@\\w*([^)]*)\\]\\s*\\W*q\\(([^)]*)\\)' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[0].split('@'): j = j.strip().strip('""') s.append(j) key = match[1] d[key] = s return d" "import re def main(str): str_spl = str.split('<:') dict = {} for i in range(1, len(str_spl)): exr = '\\s*decl\\s*([^)]*)\\s*<-\\s*([^)]*)\\;' matches = re.findall(exr, str_spl[i]) dict[matches[0][0].strip()] = int(matches[0][1]) return dict" "import re def main(example): regex1 = '\\s+-*\\d*' regex2 = '\\s*>\\s*[a-z]*_*[0-9]*|$' d = {} matches_var = re.findall(regex2, example) matches_var = [x.split('>')[1].strip() for x in matches_var if x != ''] matches_val = re.findall(regex1, example) matches_val = [x.strip() for x in matches_val] matches_val = [int(x) for x in matches_val if x != ''] for i in range(len(matches_var)): d[matches_var[i]] = matches_val[i] return d" "import re def main(st): st = st.replace('\n', ' ').replace('.end', '').replace(' ', ' ') st = st.replace('= ', '=').replace(' ::', '::').replace('.do new', '') pattern = '::=' result_equal = [_.start() for _ in re.finditer(pattern, st)] result_space = [_.start() for _ in re.finditer(' ', st)] d = {} num = 0 for i in result_equal: d[st[num:i].replace(' ', '')] = int(st[i + 3:i + 8]) num = i + 8 return d" "import re def main(a): a = a.replace('\n', ' ') a = a.replace('|', '/') a = a.replace('is ', '!') one = re.findall('"".*?""', a) tre = re.findall('!.*?/', a) for i in range(len(one)): one[i] = one[i].replace('""', '') for i in range(len(tre)): tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace('./', '') tre[i] = tre[i].replace('!', '') x = {} for i in range(len(one)): one[i] = x.setdefault(one[i], tre[i]) return x" "def main(arg): d = {} args = dis(arg) for i in range(1, len(args), 2): d[args[i]] = args[i - 1] return d def dis(arg): d = {} a = arg.split() arg = arg.replace('do', ' ') arg = arg.replace('od', ' ') arg = arg.replace('\n', ' ') arg = arg.replace('->', ' ') arg = arg.replace('.', ' ') arg = arg.replace('{', ' ') arg = arg.replace('}', ' ') arg = arg.replace('val', ' ') arg = arg.replace('`', ' ') args = arg.split() while '' in args: args.remove('') return args" "import re def main(str): d1 = dict() while len(str) > 0: res2_ = list() res = re.search(""\\'+\\w+_*[0-9]*"", str) res1 = res.group(0) res1 = res1[1:] str = str[res.end():] while re.match('\\)+ *\\)+', str) is None and re.match('\\)+\\n+\\)+', str) is None: res = re.search('q+\\(+\\w+_*[0-9]*', str) res2 = res.group(0) res2 = res2[2:] res2_.append(res2) str = str[res.end():] d1[res1] = res2_ if re.search(""\\'+\\w+_*[0-9]*"", str) is None: break return d1" "import re def main(a): a = a.replace('\n', ' ') one = re.findall('decl.*?::', a) tre = re.findall('#.*?>>', a) for i in range(len(one)): one[i] = one[i].replace(':', '') one[i] = one[i].replace('decl', '') one[i] = one[i].replace(' ', '') for i in range(len(tre)): tre[i] = tre[i].replace(':', '') tre[i] = tre[i].replace(';', '') tre[i] = tre[i].replace(' ', '') tre[i] = tre[i].replace('=', '') tre[i] = tre[i].replace('#', '') tre[i] = tre[i].replace('>', '') x = {} for i in range(len(one)): one[i] = x.setdefault(one[i], int(tre[i])) return x" "def main(s): s = s.replace('\n', ' ') d = {} k_1 = 0 k_2 = 0 data = '' for i in range(len(s) - 1): if s[i] == '#': k = i + 1 while s[k] != ' ': if s[k] == '|': break data += s[k] k += 1 if s[i:i + 2] == '|>': if s[i + 2] == ' ': k_1 = i + 3 else: k_1 = i + 2 if s[i + 1] == ';': k_2 = i if s[i:i + 4] == '; ||' or s[i:i + 3] == ';||': d.setdefault(s[k_1:k_2 + 1], int(data)) k_1 = 0 k_2 = 0 data = '' return d" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('opt(.*?)end', s) for i in d: i = i.replace(""'"", ' ') (key, value) = i.split('<|') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace(':', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = int(value) return ans" "import re def main(source): p = ""'.{1,15}'"" source = source.replace('\n', ' ') source = source.replace(' :', ':') matches = re.findall(p, source) for i in range(len(matches)): matches[i] = matches[i].replace(""'"", '') p = '\\[.{1,50}\\]' matches_one = re.findall(pattern=p, string=source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace('`', '') matches_one[j] = matches_one[j].replace('[', '') matches_one[j] = matches_one[j].replace(']', '') matches_one[j] = matches_one[j].replace(' ', '') matches_one[j] = matches_one[j].split(',') response[matches[j]] = matches_one[j] return response" "import re def main(str): d1 = dict() while len(str) > 0: res_ = list() while re.match(' +\\)+', str) is None and re.match('\\n+\\)+', str) is None and (re.match('\\)+ +', str) is None) and (re.match('\\)+\\|+', str) is None): res = re.search('-*[0-9]+', str) res1 = res.group(0) res_.append(int(res1)) str = str[res.end():] res = re.search('q\\(\\w+', str) res2 = res.group(0) res2 = res2[2:] str = str[res.end():] d1[res2] = res_ if re.search('-*[0-9]+', str) is None: break return d1" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('}};{{', '.') s = s.replace(';', '') s = s.replace('))', '') s = s.replace('}}', '') s = s.replace('((', '') s = s.replace('define', '') s = s.replace('{{', '') s = s.replace('`', '') s = s.replace('<|', '?') for el in s.split('.'): res[el.split('?')[0]] = el.split('?')[1] return res" "import re def main(s): pattern = 'array ?\\(((?: ?-?\\w+ ?.)+)\\) ?==> ?(\\w+)' parsed_s = re.findall(pattern, s.replace('\n', ' ')) result = {} for (value, key) in parsed_s: value_sp = value.strip().split('.') val = [] for v in value_sp: if len(v) > 0: val.append(int(v)) result[key] = val return result" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('equ(.*?)[.]', s) for i in d: i = i.replace(""'"", ' ') (key, value) = i.split(' is ') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace(':', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = value return ans" "def main(string): string = string.replace('<%', '').replace(' ', '').replace('{{', '').replace('global', '').replace('is#(', '#').replace('is\n#(', '#').replace(')', '').replace('}}', '').replace('%>', '').replace(""'"", '').replace('\n', '') string_parts = string.split('.') string_parts.pop(-1) string_parts1 = [i.split('#') for i in string_parts] result = {} for i in string_parts1: key = i[0] value = i[1].split(';') result[key] = value return result" "import re def main(source): p = '{[a-z_0-9, \\n]*}\\s?.>\\s?[`a-zA-Z0-9_\\n.]*' values = re.findall(pattern=p, string=source) response = {} for val in values: tmp = val.split('|>')[0].replace('\n', ' ').replace('{', '').replace('}', '').split(' ') for i in range(tmp.count('')): tmp.remove('') response[val.replace(' ', '').split('|>')[1].replace('\n', '')[1:-1]] = tmp return response" "def main(q): q = q[:q.rfind(';')] q = q.split(';') t = {} for elem in q: w = elem[elem.find('data') + 4:elem.find('|>')] w = int(w.strip()) e = elem[elem.find('|>') + 2:] e = e.strip() t.update({e: w}) return t" "def main(x): x = x[1:-1].replace('\n', ' ').replace('\t', ' ').strip() x_parts = x.split('\\end,') result = dict() for part in x_parts: if part == '': break part = part.replace('\\begin', '').replace('define', '') (key, values) = part.split('#') result[key.replace('=', '').strip()] = int(values) return result" "import re def main(text): z = '\\s*def\\S*\\s*\\#[-0-9]+\\s*->\\s*[\\w]+' a = re.findall(z, text) q = {} for i in a: i = i.strip() key = i.split('->')[1].strip().strip('') value = i.split('->')[0].strip(' def') value = value.strip(""'"") value = value.strip("" '\n#"") value = int(value) q[key] = value return q" "from re import search, split, purge def main(s): dic = {} purge() s1 = search('
([^$.]*),\\s*
', s).group(1) purge() s2 = split(',', s1) purge() s3 = [] opt = [] to = [] for i in s2: s3.append(search('\\|\\|([^$.]*)\\|\\|', i).group(1)) purge() for i in s3: opt = search(""option\\s*@\\'([^$.]*)\\'"", i).group(1) purge() to = search('to\\s([^$.]*)\\;', i).group(1) purge() dic[to] = opt return dic" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('opt(.*?)[|][.]', s) for i in d: i = i.replace(""'"", ' ') (key, value) = i.split('<|') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace(':', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') value = value.replace('list', '') value = value.split() value = list(filter(None, value)) value = list(map(int, value)) ans[key] = value return ans" "def main(x): x = x.replace('', '').replace('', '').replace('begin', '').replace('local', '').replace('end', '').replace(']', '').replace('[', '').replace('', '').replace('', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split(':') for i in x_parts] res = {} for i in x_parts1: key = i[0].replace('.', '') value = i[1].split('.') for j in range(len(value)): value[j] = int(value[j]) res[key] = value return res" "import re def main(s): s = s.replace(' ', '')[3:-5].replace('declare', '#').replace('<==', '!').replace(',', '') s = re.sub('\\n', '', s) r = dict() while s: key = s[s.find('#') + 1:s.find('!')] value = s[s.find('!') + 1:s.find('.')] r[key] = int(value) s = s.replace(s[:s.find('>') + 2], '') return r" "def main(x): di = {} al = [] sl = [] a = x.replace(' ', '') a = a.replace('\n', '') a = a.split('.)).') a = a[:-1] for i in range(0, len(a)): string = a[i] pos1 = string.find('q(') + 2 pos2 = string.find('>') sl.append(string[pos1:pos2 - 2]) al.append(string[pos2 + 1:]) di = dict(zip(al, sl)) return di" "def main(x): x = x.replace('|', '').replace('decl', '').replace('}', '').replace('{', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';.') x_parts.pop(-1) x_parts1 = [i.split('==>') for i in x_parts] res = {} for i in x_parts1: res[i[1]] = i[0] return res" "import re def main(example): exr = ""\\s*make\\s([+,-]?[0-9]+)\\s*to\\s*@\\'([a-zA-Z0-9_]*)\\'"" d = {} matches = re.findall(exr, example) for match in matches: s = int(match[0]) key = match[1] d[key] = s return d" "def main(str): str.replace(' ', '') m1 = 0 key = '' d = dict() number = '' prevchar = '' temp = '' for char in str: temp += char if char == ""'"" and m1 == 0: m1 = 1 prevchar = char key = '' temp = '' continue if char == ""'"" and m1 == 1: m1 = 0 key = temp[:-1] d[key] = [] if char != '(' and prevchar == '#': m1 = 3 prevchar = char temp = '' temp = char continue if m1 == 3 and (not char.isdigit()): d[key].append(int(temp[:-1])) m1 = 0 prevchar = char return d" "def main(string): string = string.replace('\n', ' ') keys = [] values = [] buffer = string.split('.') for st in buffer: if 'store' in st: values += [''.join(st[st.find('store') + 6:st.find('=')]).strip()] if '=' in st: keys += [''.join(st[st.find('=') + 1:]).strip()] result = dict(zip(values, keys)) result2 = {k: int(v) for (k, v) in result.items()} return result2" "def main(string): string = string.replace('\n', '') flag_key = False flag_value = False word = '' value = ['ainte', 'enus_581', 'arinra_213', 'eronla_970'] value.clear() dictionary = {'xequ_335': 'ainte'} dictionary.clear() for i in range(0, len(string)): if string[i] == '@': i += 2 while string[i] != '""': word += string[i] i += 1 value.append(word) word = '' if string[i] == '=' and string[i + 1] == '>': i += 2 if string[i] == ' ': i += 1 while string[i] != '.': word += string[i] i += 1 dictionary[word] = value.copy() word = '' value.clear() return dictionary" "def main(x): x = x.replace('store', '').replace('>', '').replace('<', '') x = x.replace('|', '').replace(';', '').replace(' ', '').replace('<#', '') x = x.replace('\n', '').replace(':', '').replace('#', '').strip() blocks = x.split('`')[1:] result = dict() for block in blocks: key_value = block.split('(')[0] block = block.replace('(', '').replace(')', '')[len(key_value):] result[key_value] = block.split('.') return result" "def main(str): map = {} while str.find(';') != -1: key1 = str.find('q(') + 2 key2 = str.find(');') key = str[key1:key2] val1 = str.find('[') val2 = str.find(']') if str.replace('\n', ' ') != -1: str = str.replace('\n', ' ') val = varibleC(str, val1, val2) valarr = [] while True: if val == '': break val2 = val.find('.') - 2 val = val.replace(' . ', ' ', 1)[1:] if val2 > 0: valarr.append(val[:val2]) val = val[val2:] else: valarr.append(val) val = '' map[key] = valarr str1 = str.find(';') str = str[str1 + 1:] return map def SpaceC(str, val1, val2): if str.find(' ', val1, val1 + 2) != -1: return True else: return False def varibleC(str, val1, val2): space = SpaceC(str, val1, val2) if str[val2 - 1] == ' ' and space is True: return str[val1 + 1:val2 - 1] elif str[val2 - 1] != ' ' and space is True: return str[val1 + 1:val2] elif str[val2 - 1] == ' ' and space is False: return str[val1:val2 - 1] return str[val1:val2]" "def main(string): string = string.replace('\n', ' ') key = '' word = '' value = ['ainte', 'enus_581', 'arinra_213', 'eronla_970'] value.clear() dictionary = {'xequ_335': 'ainte'} dictionary.clear() for i in range(0, len(string)): chart = string[i] if string[i] == 'a' and string[i + 1] == 'l': i += 3 while string[i] != ' ' and string[i] != '<': key += string[i] i += 1 elif string[i] == '#': i += 1 while string[i] != ' ' and string[i] != ']': word += string[i] i += 1 value.append(int(word)) word = '' elif string[i] == ']': dictionary[key] = value.copy() key = '' value.clear() return dictionary" "import re def printer(paper): d = {} for i in range(0, len(paper), 2): word = paper[i] d[word] = paper[i + 1] return d def main(example): exr = '(?:>\\w+|>\\s\\w+)' exr1 = '(#[-+]?\\d+..)' d = {} op = example.replace('\n', '') matches = re.findall(exr1, op) matches2 = re.findall(exr, example) numbers = [] s = [] k = 0 for i in range(len(matches)): j = matches[i].replace('.', '') j = j.replace(' ', '') j = j.replace('#', '') j = j.replace('|', '') j = j.replace(""'"", '') j = j.replace(',', '') j = j.replace(']', '') if matches[i].find(')') + 1: j = j.replace(')', '') numbers.append(int(j)) words = matches2[k].replace('>', '') words = words.replace(' ', '') words = words.replace('\n', '') s.append(words) s.append(numbers) numbers = [] k += 1 else: numbers.append(int(j)) return printer(s)" "import re def main(s): p = '[=][>]\\s?\\w+' res = re.findall(p, s) l1 = [] for i in range(0, len(res)): p = re.findall('\\w+', res[i]) l1.extend(p) p = '\\(.*?\\)' res = re.findall(p, s, flags=re.DOTALL) l2 = [] for i in range(0, len(res)): p = re.findall('[-]?\\d+', res[i]) l2.append(p) for i in range(0, len(l2)): for j in range(0, len(l2[i])): l2[i][j] = int(l2[i][j]) result = {} for i in range(0, len(l1)): result[l1[i]] = l2[i] return result" "def main(s): dic = {} char_map = {ord('\n'): ' ', ord('""'): ' ', ord('('): ' ', ord(')'): ' ', ord('@'): ' ', ord('|'): ' ', ord('>'): '> '} buf = s.translate(char_map) buf = buf.split() for (idx, x) in enumerate(buf): if idx % 4 == 1: hello = x elif idx % 4 == 3: dic[x] = hello return dic" "import re def parse_keys(x): keys = '(?<=`)\\w+(?=\\s*::=)' return re.findall(keys, x) def main(x): result = {} keys = parse_keys(x) values = re.findall('\\w+(?=\\s*\\\\end)', x) for i in range(len(keys)): result[keys[i]] = values[i] return result" "def main(x): x = x.replace('\n', '').replace('is#', ':').replace('is #', ':')[1:] x = x.replace('@', ' ').replace('\t', '').replace(';', ' ')[1:] x = x.replace(""'"", '') x_parts = x.split('done') result = dict() for path in x_parts: k = path.find(':') if path.find(':') != -1: key = path[path.rfind(' ', 0, k - 1) + 1:k].strip() value = int(path[path.find(':', k) + 1:].strip()) result[key] = value return result" "import re def main(x): x = re.split(' *==>', x) res_dict = {} for i in range(1, len(x)): res_dict.setdefault(x[i].split()[0].strip('`').split(']')[0], x[i - 1].split(""'"")[1]) return res_dict" "def new_key(string, i): key = '' while string[i] != ""'"": key += string[i] i += 1 return (key, i + 1) def new_arr(string, i): mas = [] n = '' num = False while string[i] != ')': if string[i] == '#': if num: mas.append(int(n)) n = '' else: num = True elif num: if string[i] == ' ': num = False mas.append(int(n)) n = '' else: n += string[i] i += 1 if n != '': mas.append(int(n)) return (mas, i) def main(string): dictionary = {} i = 0 while i < len(string): if string[i] == ""'"": (key, i) = new_key(string, i + 1) elif string[i] == '(': (mas, i) = new_arr(string, i + 1) dictionary[key] = mas i += 1 return dictionary" "def main(string): import re dct = {} result = string.split('}') for i in range(len(result)): idx = result[i].find('decl') if idx == -1: result[i] = '' else: result[i] = result[i][idx:] result[i] = result[i].strip() result[i] = result[i][5:-1] if result[i] != '': local = result[i].split('::=') local[0] = local[0].strip() local[1] = int(local[1].strip()) dct[local[0]] = local[1] return dct" "def main(x): x = x.replace('begin', '').replace('decl', '').replace('end', '').replace(""'"", '').replace('#', '').replace('(', '').replace(')', '').replace('\n', ' ').replace(' ', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split(':') for i in x_parts] result = {} for i in x_parts1: result[i[0]] = int(i[1]) return result" "def main(s): i = 0 s = s.replace('\n', '') k = 0 x = '' result = {} while i < len(s): key = '' if s[i] == '#': i += 1 while s[i] == ' ': i += 1 while s[i] != ' ' and s[i] != '=': x = x + s[i] i += 1 if s[i] == ':': i += 1 while s[i] == ' ': i += 1 while s[i] != ';': key = key + s[i] i += 1 result[key] = int(x) x = '' i += 1 return result" "def main(s): s = s.replace('\\end', 'end') s = s.replace('[', '') s = s.replace(']', '') s = s.replace('\\begin', 'begin') s = s[:s.rfind('end')] s = s.strip() s = s.split('end') end = {} for row in s: nums = row[row.find('('):row.find(')')] nums = nums.replace('(', '') nums = nums.replace('.', '') nums = nums.replace('#', '') nums = nums.strip() nums = nums.split() nums = [int(i) for i in nums] key = row[row.find('@') + 1:] key = key[:key.find('.')] key = key.replace('""', '') end.update({key: nums}) return end" "def main(str): map = {} if str.replace('\n', ' ') != -1: str = str.replace('\n', ' ') while str.find('end,') != -1: key1 = str.find('=:') + 2 key2 = str.find('. .end') key = str[key1:key2] key = key.replace(' ', '') val1 = str.find('variable ') + 9 val2 = str.find('=:') val = str[val1:val2] val = val.replace(' ', '') while True: if val == '': break valA = val val = '' map[key] = valA if key == 'esoror': pass str1 = str.find('end,') + 4 str = str[str1:] return map" "def main(x): x = x.replace('<:', '').replace('store', '').replace(""'"", '').replace(':>', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('|>') for i in x_parts] result = {} for i in x_parts1: result[i[1]] = i[0] return result" "def main(data): data = data.replace('\n', '').replace(')', '').replace('(', '').replace('begin', '').replace('store', '').replace('\\end', '').replace('\\', '') data = data.replace('@', '').replace('""', '').replace(' ', '') strMassive = data.split(';') ret = {} for str in strMassive: if str is not None and str != '': data = str.split('=:') ret[data[1]] = data[0] return ret" "import re def main(example): exr = '\\s*do\\s*let\\s*\\#([^\\s]*)\\s*to\\s*([^\\s]*)\\s*' d = {} matches = re.findall(exr, example) for match in matches: d[match[1]] = int(match[0]) return d" "import re def main(s): exr = ""\\s*opt\\s*([-0-9]*)\\s*\\|>\\s*@([\\'A-Za-z0-9_]*);\\s*"" matchces = re.findall(pattern=exr, string=s) d = {} for match in matchces: key = match[1].strip().strip(""'"") d[key] = int(match[0]) return d" "import re def main(x): dic = {} sp = x.replace(' ', '').strip('<% %>').replace('\\n', '') sp = sp.replace('\n', '').split('done;') for a in sp: if re.search('dodeclare', a): b = a.replace('dodeclare', '').replace(';', '') b = b.replace('""', '').split('=>@') dic[b[1]] = int(b[0]) return dic" "from re import findall def main(text): my_dict = {} text = text.replace('sect>', '') text = text.replace('>\n', '>') text = text.replace(' ', '') keys = findall('\\>.*?\\;', text) el = findall('\\(.*?\\)', text) for i in range(0, len(keys)): keys[i] = keys[i].replace('>', '') keys[i] = keys[i].replace(';', '') el[i] = el[i].replace('(', '') el[i] = el[i].replace(')', '') my_dict[keys[i]] = el[i] return my_dict" "import re def main(example): exr = '\\s*@""\\s*([^(\\"")]*\\"")\\s*->\\s*([^\\;]*)' d = {} matches = re.findall(exr, example) for match in matches: j = match[0] j = j.strip().strip('""') key = match[1] d[key] = j return d" "def main(x): x = x.replace('|', '').replace('[', '').replace(']', '').replace('def', '').replace('{', '').replace('}', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';,') x_parts.pop(-1) x_parts1 = [i.split('=>') for i in x_parts] res = {} for i in x_parts1: value = i[0].split(',') for j in range(len(value)): value[j] = int(value[j]) res[i[1]] = value return res" "from re import findall def main(text): my_dict = {} text = text.replace('glob', '#') text = text.replace(' ', '') text = text.replace('\n', '') text = text.replace('to', '&') keys = findall('\\&.*?\\.', text) el = findall('\\#.*?\\&', text) for i in range(0, len(keys)): keys[i] = keys[i].replace('.', '') keys[i] = keys[i].replace('&', '') el[i] = el[i].replace('#', '') el[i] = el[i].replace('&', '') my_dict[keys[i]] = int(el[i]) return my_dict" "def main(string): string = string.replace('\n', ' ') keys = [] values = [] string = string.replace('||', '') buffer = string.split(';') for st in buffer: if 'option' in st: keys += [''.join(st[st.find('option') + 6:st.find('=:')]).replace(';', '').strip()] if '=:' in st: values += [''.join(st[st.find('=:') + 3:]).strip("" '"")] result = dict(zip(values, keys)) return result" "def main(x): x = x.replace('', '').replace('', '').replace('<:', '').replace('define', '').replace('{', '').replace('}', '').replace(':>', '').replace('\n', ' ').replace(' ', '') x_parts = x.split('..') x_parts.pop(-1) x_parts1 = [i.split('is') for i in x_parts] res = {} for i in x_parts1: key = i[0] value = i[1].split('#') value.pop(0) for j in range(len(value)): value[j] = int(value[j]) res[key] = value return res" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('\n', '') s = s.replace('{{', '') s = s.replace(""'.}}"", '') s = s.replace('', '') s = s.replace('option', '') s = s.replace(""'."", ')') s = s.replace('=:', ""'"") c = 0 for el in s.split(')'): for al in el.split(""'@'""): if c == 0: value = int(al) c += 1 else: key = al c -= 1 res[key] = value return res" "import re def main(source): source = source.replace('||', '') source = source.replace('', '') source = source.replace('', '') source = source.replace('glob', '') source = source.replace('#', '') source = source.replace('.', '') p = '[-+]?\\w+' matches = re.findall(pattern=p, string=source) response = {} matches.reverse() for i in range(len(matches)): arr = [] if re.match('[-+]?\\d+', matches[i]) is None: j = i + 1 while j < len(matches) and re.match('[-+]?\\d+', matches[j]) is not None: arr.append(int(matches[j])) j += 1 arr.reverse() response[matches[i]] = arr return dict(reversed(list(response.items())))" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('make(.*?)[;]', s) for i in d: i = i.replace(""'"", ' ') (key, value) = i.split('<==') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace(':', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace(';', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = int(value) return ans" "def main(str): str = str.replace('', '').replace('\n', '').replace('', '').replace('q(', '').replace(')', '').replace('.do', '').replace('.', '').replace('global', '') data = str.split('end') ret = {} for txt in data: if txt is not None and txt != '': txt_split = txt.split('::=') if txt_split[0].replace(' ', '') != '': ret[txt_split[0].replace(' ', '')] = txt_split[1].replace(' ', '') return ret" "import re def parse_keys(x): keys = '(?<=\\"")\\w+(?=\\""\\s*<=)' return re.findall(keys, x) def main(x): result = {} keys = parse_keys(x) values = re.findall('(?<=@\\"")\\w+', x) for i in range(len(keys)): result[keys[i]] = values[i] return result" "import re def main(str): d1 = dict() while len(str) > 0: res_ = list() while re.match('\\""+ *]+', str) is None and re.match('\\""+\\n]+', str) is None: res = re.search('\\""+\\w+', str) res1 = res.group(0) res1 = res1[1:] res_.append(res1) str = str[res.end():] res = re.search('\\w+', str) res2 = res.group(0) str = str[res.end():] d1[res2] = res_ if re.search('\\""+\\w+', str) is None: break return d1" "def main(arg): d = {} args = dis(arg) for i in range(0, len(args) - 1, 2): d[args[i]] = args[i + 1] return d def dis(arg): d = {} a = arg.split() arg = arg.replace('equ', ' ') arg = arg.replace('<', ' ') arg = arg.replace('>', ' ') arg = arg.replace('begin', ' ') arg = arg.replace('.', ' ') arg = arg.replace('%', ' ') arg = arg.replace('/', ' ') arg = arg.replace(';', ' ') arg = arg.replace('|', ' ') arg = arg.replace('end', ' ') arg = arg.replace('\\', ' ') args = arg.split() while '' in args: args.remove('') return args" "import re def main(a): result = {} a = a.split('set') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('\\(.+?\\)', a[i]) if key: value = re.search('=q\\(.+?\\)', a[i])[0][3:-1] result[key[0][1:-1]] = value return result" "def main(st): mdict = {} mass = [] x = st.replace('\n', ' ') while True: index1 = x.find('{') + 1 if index1 == 0: break index2 = x.find('}') mass.append(x[index1:index2]) x = x[index2 + 1:] st = st.replace(' ', '') st = st.replace('\n', '') count = 0 while st != ';||': index1 = st.find('|make') + 5 index2 = st.find('={') index3 = st.find('}.|') + 3 mt = mass[count].split() mtf = [] for m in mt: mtf.append(m) mdict[st[index1:index2]] = mtf st = st[index3:] count += 1 return mdict" "def main(text): result = {} text = text.replace('\n', ' ') data = text.split(');') for str in data: if str.find('(') != -1: result[str[str.find('make ') + 5:str.rfind('<=')].replace(' ', '')] = [int(i) for i in str[str.find('array(') + 6:str.find(').')].replace(' ', '').split('.')] return result" "def main(arg): d = {} a = arg.split() for i in range(len(arg)): arg = arg.replace('|', ' ') arg = arg.replace('#', ' ') arg = arg.replace(';', ' ') arg = arg.replace('do', ' ') arg = arg.replace('}', ' ') arg = arg.replace('{', ' ') arg = arg.replace('od', ' ') a = arg.split() while '' in a: a.remove('') for i in range(len(a)): if a[i - 2] == 'option': while a[i] != '.': a[i] = int(a[i]) i = i + 1 temp = 0 s = [] for i in range(len(a)): if isinstance(a[i], int): s.append(a[i]) temp = temp + 1 if a[i] == '.': temp = temp + 1 d[str(a[i - temp])] = s temp = 0 s = [] return d" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('(.*?)', '') key = key.replace(':', '') key = key.replace('q(', '') key = key.replace(')', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') value = value.split(';') value = list(filter(None, value)) ans[key] = value return ans" "import re def main(example): exr = '\\w{6}\\s*([^)]\\D\\w{2,8})\\s*\\W*([^)]\\w*)' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split(' '): s.append(j) key = match[0] d[key] = s[0] return d" "import re def main(str): d1 = dict() while len(str) > 0: res = re.search('-*[0-9]+', str) res1 = res.group(0) str = str[res.end():] res = re.search('\\w+', str) res2 = res.group(0) str = str[res.end():] d1[res2] = int(res1) if re.search('-*[0-9]+', str) is None: break return d1" "def main(x): x = x.replace('opt', '').replace('.do', '').replace('#', '').replace('q(', '').replace('(', '').replace('end', '').replace(')', '').replace('\n', ' ').replace(' ', '') x_parts = x.split('..') x_parts.pop(-1) x_parts1 = [i.split(':=') for i in x_parts] res = {} for i in x_parts1: key = i[0] value = i[1].split(';') value.pop(-1) res[key] = value return res" "import re def main(example): exr = '\\w{3}\\s*([^)]\\D\\w{2,8})\\s*([^)]\\d*)' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split(' '): s.append(j) key = match[0] d[key] = int(s[0]) return d" "def main(string): valve = {} while string != '': string = string.partition('declare')[2] if string == '': break value = string.partition('=')[0] value = value.strip() value2 = string.partition(')')[0] value2 = value2.partition(""'"")[2] value2 = value2.partition(""'"")[0] value2.strip valve[value] = value2 return valve" "import re def main(s): d = dict() for matched in re.findall(""do\\s*auto\\s*'[a-z]+_*\\d*'\\s*\\n*\\s*==>\\s*[a-z]+_*\\d*"", s): matched = matched.replace('do', '').replace('auto', '') matched = matched.replace(' ', '').replace(""'"", '') matched = matched.replace('\n', '').split('==>') d[matched[1]] = matched[0] return d" "import re def main(a): result = {} a = a.split('loc') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('>.+?;', a[i]) if key: value = re.search('.+==', a[i])[0][:-2] result[key[0][1:-1]] = value return result" "def main(text): text = text.replace('|', '').replace('loc', '').replace('\n', '').replace('""', '').replace('[', '').replace(']', '').replace(' ', '') str = text.split(',') ret = {} for i in str: if i is not None and i != '': item = i.split(':=') s = [i for i in list(item[1].split(';')) if i != ''] ret[item[0]] = s return ret" "import re def main(s): pattern = ""def ?{((?: ?\\w+ ?)+)} ?-> ?'(\\w+)'"" parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: list(value.split()) for (value, key) in parsed_s}" "def main(text): text = text.replace('(', '') text = text.replace(')', '') text = text.replace('=', ' ') text = text.replace('.', '') text = text.replace('opt', '') text = text.replace('`', '') pretext = text.split() return dict(zip(pretext[::2], pretext[1::2]))" "import sys def main(a): c = dict() mas = a.strip('[]').split(';') for i in mas[:-1]: a = i.strip().strip('|| ').split('<-') c[a[0].strip()[7:-1]] = a[1].strip() return c" "import re def main(text: str) -> dict[str, list[str]]: text = text.replace('\n', ' ') result = dict() data_list = re.findall('\\s*declare\\s([^\\s]*)', text) keys = re.findall('\\s*->([^;]*)', text) for n in range(len(keys)): keys[n] = keys[n].replace(' ', '') keys[n] = keys[n].replace(' ', '') data_list[n] = re.sub('t\\s*\\(\\s*', '', data_list[n]) data_list[n] = re.sub('\\s*\\)', '', data_list[n]) result[keys[n]] = data_list[n] return result" "from re import findall def main(text): my_dict = {} text = text.replace(' ', '') text = text.replace('
', '#') text = text.replace('list(', '&') text = text.replace('\n', '') keys = findall('\\"".*?\\""', text) elements = findall('\\&.*?\\#', text) for i in range(len(elements)): elements[i] = findall('\\(.*?\\)', elements[i]) keys[i] = keys[i].replace('""', '') for i in range(len(elements)): for j in range(len(elements[i])): elements[i][j] = elements[i][j].replace('(', '') elements[i][j] = elements[i][j].replace(')', '') for i in range(len(keys)): my_dict[keys[i]] = elements[i] return my_dict" "import re def main(example): pattern = ""'\\w+'\\s*<=\\s*\\w+"" d = {} matches = re.findall(pattern, example) for match in matches: match = match.split('<=') match[0] = match[0].strip() for i in match[1].split(','): i = i.strip() key = match[0][1:-1] d[key] = i return d" "def main(string): dict = {} string = string.replace(' ', '') str = string.split('<<') for s in str: if '@' in s: s = s.split('>>')[0] right = s.split(""@'"")[1] key = right.split(""':"")[0] value = right.split(':=')[1].split(';')[0] dict[key] = int(value) return dict" "def main(str): str = str.replace('|', '').replace('\n', '').replace('let ', '').replace('\nlet', '').replace(' let', '').replace('let\n', '').replace('do', '').replace('q(', '').replace(')', '').replace(' ', '') data = str.split('.od.') ret = {} for i in data: if i is not None or i != '': item = i.split('=') if item[0] != '': ret[item[0]] = item[1] return ret" "import re def main(string): reDigit = '\\#\\-*[0-9]*' reName = '(\\w*\\.)' res = {} matchesDigits = re.findall(reDigit, string) matchesNames = re.findall(reName, string) for i in range(len(matchesDigits)): matchesNames[i] = matchesNames[i][0:-1] matchesDigits[i] = matchesDigits[i][1:] key = matchesNames[i] res[key] = int(matchesDigits[i]) return res" "def main(x): x = x.replace('.begin', '').replace('|', '').replace('#', '').replace('.end', '').replace('declare', '').replace('""', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(',') x_parts.pop(-1) x_parts1 = [i.split('==>') for i in x_parts] res = {} for i in x_parts1: key = i[1] value = int(i[0]) res[key] = value return res" "def main(s): s1 = s.replace('[[', '').replace(']]', '').replace('do', '').replace('\n', '').replace('end;', '').replace('local', '').replace('=>', ';') keys = [] val2 = [] values = [] val = s1.split(';') for i in val: if len(i) != 0: val2.append(i.replace(' ', '').replace('#', '')) d = {} for i in range(1, len(val2), 2): keys.append(val2[i]) values.append(val2[i - 1]) for i in range(len(keys)): d[keys[i]] = int(values[i]) return d" "def main(st): mdict = {} mass = [] x = st.replace('\n', ' ') while True: index1 = x.find('(') + 1 if index1 == 0: break index2 = x.find(')') mass.append(x[index1:index2]) x = x[index2 + 1:] st = st.replace(' ', '') st = st.replace('\n', '') count = 0 while st != '
': index1 = st.find('=>""') + 3 index2 = st.find('""],') mt = mass[count].split(';') mtf = [] for m in mt: mtf.append(int(m)) mdict[st[index1:index2]] = mtf st = st[index2 + 3:] count += 1 return mdict" "import re def main(input): pattern1 = '=>\\s?\\w+' pattern2 = '#-?\\d+' matches1 = re.findall(pattern=pattern1, string=input) matches2 = re.findall(pattern=pattern2, string=input) output = {} for i in range(len(matches1)): matches1[i] = re.search('\\w+', matches1[i])[0] matches2[i] = re.search('-?\\d+', matches2[i])[0] output[matches1[i]] = int(matches2[i]) return output" "def main(arg): split = arg.replace('', '').replace('', '').replace('\n', ' ') split = split.replace('let ', '').replace('.', '') split = split.replace(' ', '').split('<==') new = list() for s in split: tmp = filter(None, s.split(';')) new.append(list(tmp)) new = flatten(new) hashmap = dict() for i in range(0, len(new), 2): key = new[i] val = new[i + 1] hashmap[key] = str(val).replace('list(', '').replace(')', '').split(',') return hashmap def flatten(list_of_lists): if len(list_of_lists) == 0: return list_of_lists if isinstance(list_of_lists[0], list): return flatten(list_of_lists[0]) + flatten(list_of_lists[1:]) return list_of_lists[:1] + flatten(list_of_lists[1:])" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('local(.*?);', s) for i in d: i = i.replace(""'"", ' ') (key, value) = i.split('<-') key = key.replace('""', '') value = value.replace(' ', '') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace(':', '') key = key.replace('q(', '') key = key.replace(')', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = value return ans" "def main(x): x = x.replace('begin', '').replace('[', '').replace(']', '').replace(' to ', '').replace('to\n', '').replace('""', '').replace('declare', '').replace('\n', ' ').replace(' ', '') x_parts = x.split('.') x_parts.pop(-1) x_parts1 = [i.split('@') for i in x_parts] res = {} for i in x_parts1: key = i[1] value = int(i[0]) res[key] = value return res" "import re def main(str): miss = ['do', 'end', 'declare'] dict = {} position = 0 name = None content = None MatchObject = re.findall('[a-z_\\d]+', str) while MatchObject[position] != 'done': try: if MatchObject[position] in miss: position += 1 else: name = MatchObject[position + 1] content = MatchObject[position] dict[name] = content name = None content = None position += 2 except Exception as ex: pass return dict" "import re def main(x): dict_ = {} a = x.split('[')[1:] for i in a: (val, k) = i.split('<=') k = re.findall(""'(.*?)'"", k)[0] val = val.partition('`')[2].strip() dict_[val] = k return dict_" "def main(s): d = {} for i in range(0, len(s)): if s[i] == '#': a = '' i += 1 while s[i] != ' ' and s[i] != '=': a += s[i] i += 1 if s[i] == '@': b = '' i += 2 while s[i] != ""'"": b += s[i] i += 1 y = {b: int(a)} d.update(y) return d" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('local(.*?)[}]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split('->') key = key.replace('""', '') value = value.replace(' ', '') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace(':', '') key = key.replace(';', '') key = key.replace('q(', '') key = key.replace(')', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') value = value.split(';') value = list(filter(None, value)) value = list(map(int, value)) ans[key] = value return ans" "def main(in_str): result = {} exprs = in_str.replace('\n', '').replace(' ', '').split(';') for e in exprs: if e.startswith('<%loclist('): vals = e[10:e.index(')')].replace('`', '').split(',') name = e[e.index(':') + 1:e.index('.')] result[name] = vals return result" "def main(s: str): s = s.replace('\n', '') s = s.replace(' ', '') s = s.replace('<%dataarray(', '') s = s.replace('"";%>.', '') res = {} for el in s.split('"";%>.<%dataarray('): (value, key) = el.split(')=>@""') res[key] = value.split(';') return res" "def main(x): x = x.replace('<<', '').replace('>', '').replace('let', '').replace(""'"", '').replace('#', '').replace('\n', ' ').replace(' ', '') x_parts = x.split(';') x_parts.pop(-1) x_parts1 = [i.split('<-') for i in x_parts] res = {} for i in x_parts1: key = i[0] value = int(i[1]) res[key] = value return res" "import re def get_dict(string: str) -> dict: new_dict: dict = {} first = ""@'(\\w+)'"" second = '(<\\|( |\\n|)`)(\\w+)\\.' key_array = re.findall(first, string) value_array = re.findall(second, string) for (i, key) in enumerate(key_array): new_dict[key] = value_array[i][2] return new_dict def main(string): return get_dict(string)" "import re def main(data): result = {} data = re.sub(re.compile('\\s+'), '', data) data = data.split('loc') for i in range(1, len(data)): tmp = data[i].split(""=:'"") tmp2 = tmp[1].split(""'"") result[tmp2[0]] = tmp[0] return result" "def main(st): mdict = {} mass = [] x = st.replace('\n', ' ') while True: index1 = x.find('(') + 1 if index1 == 0: break index2 = x.find(')') mass.append(x[index1:index2]) x = x[index2 + 1:] st = st.replace(' ', '') st = st.replace('\n', '') count = 0 while st != '': index1 = st.find('=>') + 2 index2 = st.find('.\\') mt = mass[count].split(',') mtf = [] for m in mt: mtf.append(int(m.replace('#', ''))) mdict[st[index1:index2]] = mtf st = st[index2 + 5:] count += 1 return mdict" "def main(data): ans = {} data = data.replace('\n', '') data = data.replace('', '') data = data.replace('', '') data = data.replace(',', '') data = data.replace('local', '') data = data.replace(' ', '') buffer = data.split(';') buffer.pop(-1) for i in buffer: ans[i.split('=')[0]] = int(i.split('=')[1]) return ans" "import re def main(example): exr = '\\s*do\\sstore\\D[\\S]*\\sto\\sq\\([\\S]*\\)\\s?done' d = {} matches = re.findall(exr, example) for match in matches: value = int(match.split()[2]) key = re.split('\\(|\\)', match)[1] d[key] = value return d" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('store(.*?)[.]', s) for i in d: i = i.replace(""'"", ' ') (key, value) = i.split('<==') key = key.replace('""', '') value = value.replace(' ', '') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace(':', '') key = key.replace(';', '') key = key.replace('q(', '') key = key.replace(')', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = value ans[key] = int(value) return ans" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') while x != '.||': index1 = x.find(""@'"") + 2 index2 = x.find(""'is"") index3 = x.find(""'is"") + 3 index4 = x.find(';end') if x[index1:index2].replace('-', '').isdigit(): mdict[x[index1:index2].replace('\n', '')] = int(x[index3:index4]) else: mdict[x[index1:index2]] = int(x[index3:index4]) x = x[index4 + 4:] return mdict" "def main(my_string): n = len(my_string) res_dict = {} str1 = '@""' str2 = '""' str2_0 = '<-' str3 = '|.' m1 = 2 m2 = 1 rab = 0 while rab < n: rab = my_string.find(str1, rab, n) if rab == -1: break else: rab = rab + m1 rab1 = my_string.find(str2, rab, n) if rab1 == -1: break my_key = my_string[rab:rab1] rab2 = my_string.find(str2_0, rab1, n) if rab2 == -1: break else: rab2 = rab2 + m1 rab3 = my_string.find(str3, rab2, n) if rab3 == -1: break my_val = my_string[rab2:rab3] my_val = my_val.strip() res_dict[my_key] = my_val else: pass return res_dict" "import re def main(a): result = {} a = a.split('new') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('>.+?>', a[i]) if key: value = re.search('.+\\|', a[i])[0][:-1] result[key[0][1:-1]] = value return result" "def main(row): ans = {} row = row.replace('\n', ' ') row = row.replace('section', '') row = row.replace('>', '') row = row.replace('<', '') row = row.replace('/', '') row = row.replace('((', '') row = row.replace('def ', '') row = row.replace(')', '') row = row.replace('|', '') row = row.replace(' ', '') row = row.split('.') row.pop() for i in row: i = i.split('q(') ans |= {i[0]: i[1]} return ans" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('(.*?)[.]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split('|>') key = key.replace('""', '') value = value.replace(' ', '') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace(':', '') key = key.replace(';', '') key = key.replace('q(', '') key = key.replace(')', '') value = value.replace(' ', '') value = value.replace('loc', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[key] = value return ans" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') while x != '}': index1 = x.find('glob') + 4 index2 = x.find('<=') index3 = x.find('<=#') + 3 index4 = x.find('\\end;') if x[index1:index2].replace('-', '').isdigit(): mdict[x[index1:index2].replace('\n', '')] = int(x[index3:index4]) else: mdict[x[index1:index2]] = int(x[index3:index4]) x = x[index4 + 5:] return mdict" "import re def main(example): exr = ""(?: |\\n)?auto(?: |\\n)?'(.*?)'(?: |\\n)?(.*?)<\\/block>"" match = re.findall(exr, example, re.S) d = {} arr = {} for i in range(len(match)): arr[match[i][0].strip()] = match[i][1].strip() return arr" "import re def main(source): p = '\\(.{1,15}\\)' source = source.replace('\n', ' ') matches = re.findall(pattern=p, string=source) for i in range(len(matches)): matches[i] = matches[i].replace(')', '') matches[i] = matches[i].replace('(', '') p = '"".{1,15}""' matches_one = re.findall(pattern=p, string=source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace('""', '') response[matches[j]] = matches_one[j] return response" "def main(x): x = x.replace('', '').replace('', '').replace('', '').replace('', '').replace('equ ', '').replace('equ\n', '').replace('\n', ' ').replace(' ', '') xp = x.split(';') xp.pop(-1) xp1 = [i.split('==>') for i in xp] res = {} for i in xp1: res[i[1]] = i[0] return res" "def main(st): st = st.replace('\n', '') st = st.replace('do', '') st = st.replace('{', '') st = st.replace('define', '') st = st.replace('array', '') st = st.replace('(', '') st = st.replace(')', '') st = st.replace('#', '') st = st.replace(' ', '') st = st.replace('@', '@to@') st = st.replace('->', '') st = st.replace('.', ',') st = st.replace(""'"", '') st = st.replace('""', '') st = st.split('od,')[:-1] dict_sample = {} for i in st: dv = i.split('@to@') dv[0] = dv[0].split(',') dv[0] = list(map(int, dv[0])) dict_sample[dv[1]] = dv[0] return dict_sample" "def main(str): str = str.replace(' ', '') str = str.replace('\n', '') dict = {} i = 0 k = 0 while i < len(str): resource = '' if str[i] == '[' and str[i + 1] == 'l': i += 4 while str[i] != '|': resource += str[i] i += 1 if str[i] == '|' and str[i + 1] == '>': i += 4 key = '' while str[i] != ""'"": key += str[i] i += 1 dict[key] = resource k += 1 i += 1 return dict" "import re def main(a): result = {} a = a.split('egin') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('>.+\\.', a[i]) if key: value = int(re.search('decl.+\\|', a[i])[0][4:-1]) result[key[0][1:-1]] = value return result" "import re def main(x): x = x.replace('\n', '').replace('( ((', '').replace(')) )', '').replace('`', '.').replace(' ', '').replace('(`', '(').replace('auto', ""'"") x = x.replace('.)),((', '').replace('=list', '').replace('(`', '(').replace('.)),)', '') x = x.replace('(.', '(').replace('#', '').strip() blocks = x.split(""'"")[1:] result = dict() for block in blocks: key_value = block.split('(')[0] block = block.replace('(', '').replace(')', '')[len(key_value):] result[key_value] = block.split('.') return result" "def main(string): string = string.replace('\n', ' ') key = '' word = '' dictionary = {'xequ_335': 1231} dictionary.clear() for i in range(0, len(string)): chart = string[i] if string[i] == 'o' and string[i + 1] == 'c': i += 3 while string[i] != ' ' and string[i] != ':': key += string[i] i += 1 elif string[i] == '#': i += 1 while string[i] != ' ' and string[i] != '.': word += string[i] i += 1 dictionary[key] = int(word) word = '' key = '' return dictionary" "import re def main(s): ans = {} s = s.replace('\n', ' ') d = re.findall('define(.*?)[)]', s) for i in d: i = i.replace(""'"", ' ') (value, key) = i.split(':=') key = key.replace('""', '') value = value.replace(' ', '') key = key.replace(' ', '') key = key.replace('.', '') key = key.replace('@', '') key = key.replace(""'"", '') key = key.replace('`', '') key = key.replace('#', '') key = key.replace('%', '') key = key.replace('>', '') key = key.replace(':', '') key = key.replace(';', '') key = key.replace('q(', '') key = key.replace(')', '') value = value.replace(' ', '') value = value.replace('loc', '') key = key.replace('.', '') key = key.replace(' ', '') value = value.replace('""', ' ') value = value.replace('<', '') value = value.replace('>', '') value = value.replace('@', '') value = value.replace(':', '') value = value.replace('#', '') value = value.replace('{', '') value = value.replace('[', '') value = value.replace(']', '') value = value.replace('}', '') value = value.replace(')', '') value = value.replace('(', '') value = value.replace('`', '') value = value.replace(')', '') value = value.replace(""'"", '') value = value.replace('.', '') ans[value] = key return ans" "import re def main(example): exr = 'array\\(\\s*([^)]*)\\)\\s*->\\s*q\\(([^)]*)\\)\\s*' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[0].split(';'): j = j.strip() j = j[1:] s.append(int(j)) key = match[1] d[key] = s return d" "def main(x): mdict = {} x = x.replace(' ', '') x = x.replace('\n', '') while x != ']': index1 = x.find('option') + 6 index2 = x.find('::=') index3 = x.find('::=') + 3 index4 = x.find('.end;') mdict[x[index1:index2]] = int(x[index3:index4]) x = x[index4 + 5:] return mdict" "import re def main(x): pattern = '(?:def ?`(?:.+?) is ?# ?\\((?:.+?)\\);)+' x = x.replace('\n', ' ') res = {} found = [item for item in re.findall(pattern, x)] for item in found: array_items = [int(item) for item in re.search('# ?\\((.+?)\\);', item).group(1).strip().replace(' ', '').split(',')] array_name = re.search('def ?`(.+?) is', item).group(1).strip() res[array_name] = array_items return res" "def main(x): di = {} al = [] sl = [] a = x.split('@""') a = a[1::1] for i in range(0, len(a)): string = a[i] string = string.replace(' ', '') string = string.replace('\\', '') string = string.replace('begin', '') string = string.replace('\n', '') string = string.replace('end', '') pos1 = string.find('""<=') pos2 = string.find('];') al.append(string[0:pos1]) sl.append(list(map(int, string[pos1 + 4:pos2].split('.')))) di = dict(zip(al, sl)) return di" "def main(s): s = s[:s.rfind('')] s = s.split('
') tmp = {} for elements in s: numbers = elements[elements.find('{') + 1:elements.find('}')] numbers = numbers.replace('#', '').replace('.', '') numbers = numbers.replace(' ', ' ').strip() numbers = numbers.split() numbers = [int(i) for i in numbers] key = elements[elements.find(""'"") + 1:elements.rfind(""'"")] tmp.update({key: numbers}) return tmp" "import re def main(source): p = 'opt.{1,15}:' source = source.replace('\n', ' ') matches = re.findall(pattern=p, string=source) for i in range(len(matches)): matches[i] = matches[i].replace('opt', '') matches[i] = matches[i].replace(':', '') matches[i] = matches[i].replace(' ', '') p = ""'.{1,13}'"" matches_one = re.findall(pattern=p, string=source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace(""'"", '') response[matches[j]] = matches_one[j] return response" "import re def main(example): exr = re.compile(""@'([^']*)'\\s*:\\s*\\(([^\\)]*)"") d = {} example = example.replace(';', ',') example = example.replace('#', '') matches = re.findall(exr, example) for match in matches: s = [] for j in match[1].split(','): j = j.strip().strip(""'"") s.append(int(j)) key = match[0] d[key] = s return d" "import re def main(a): result = {} a = a.split('decl') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('.+:=', a[i]) if key: value = int(re.search('#.+?;', a[i])[0][1:-1]) result[key[0][:-2]] = value return result" "import re def main(s): pattern = ""store ?(\\w+) ?\\|> ?'(\\w+)'"" parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: value for (value, key) in parsed_s}" "def main(exp): new_exp = exp.split('@""')[1:] res = {string.split('""')[0]: int(string.split('#')[1].split('.')[0]) for string in new_exp} return res" "def main(string): string = string.replace('\n', '') string = string.replace(' ', '') word = '' value = [1567, 1231] value.clear() dictionary = {'xequ_335': [1567, 1231]} dictionary.clear() for i in range(0, len(string)): if string[i] == '#' and string[i + 1] != '(': i += 1 while string[i] != ';' and string[i] != ')': word += string[i] i += 1 value.append(int(word)) word = '' if string[i] == '=' and string[i + 1] == '>': i += 2 while string[i] != ';': word += string[i] i += 1 dictionary[word] = value.copy() word = '' value.clear() return dictionary" "def main(str): str = str.replace('\n', ' ').replace('{', '').replace('}', '').replace(' do', '').replace('do ', '').replace('variable', '').replace('#', '').replace('[', '').replace(']', '').replace(' ', '').replace('.od.', '|').replace('od', ',').replace('.', ',') data = str.split('|') ret = {} for i in data: if i is not None and i != '' and (i != ','): item = i.split('=:') if item[1] != '': arr = item[0].split(',') desired_array = [int(numeric_string) for numeric_string in arr] ret[item[1]] = desired_array return ret" "def main(st): mdict = {} mass = [] x = st.replace('\n', ' ') while True: index1 = x.find('(') + 1 if index1 == 0: break index2 = x.find(')') mass.append(x[index1:index2]) x = x[index2 + 1:] st = st.replace(' ', '') st = st.replace('\n', '') count = 0 while st != '': index1 = st.find('==>') + 4 index2 = st.find(';:>;') mt = mass[count].split(';') mtf = [] for m in mt: mtf.append(int(m.replace('#', ''))) mdict[st[index1:index2]] = mtf st = st[index2 + 4:] count += 1 return mdict" "def main(string): string = list(string) result = {} keys = [] items = [] for i in range(len(string)): if string[i] == '#': item = '' while string[i + 1] != '=': i += 1 item += string[i] items.append(int(item.strip())) if string[i] == ""'"" and string[i - 1] == '@': key = '' while string[i + 1] != ""'"": i += 1 key += string[i] keys.append(key.strip()) for i in range(len(keys)): result[keys[i]] = items[i] return result" "import re def main(example): exr = '\\s*data\\s*([^<]*)\\s*\\<\\s*([^|]*)\\s*\\|\\s*\\s*([^.]*)\\s*\\.' s = dict() matches = re.findall(exr, example) for match in matches: s[match[0].strip().strip(""'"")] = match[2].strip().strip(""'"") return s" "def func(x): res = dict() s = x.split(',') for i in range(len(s) - 1): begin = s[i].find('(') end = s[i].find(')') begin1 = s[i].find('==>') end1 = s[i].find('>>') key = s[i][begin1 + 3:end1].strip() value = s[i][begin + 1:end].strip() res[key] = [] res[key] = value return res def main(x): res = func(x) return res" "import re def main(s): pattern = 'store ?#(-?\\d+) ?=> ?""(\\w+)""' parsed_s = re.findall(pattern, s.replace('\n', ' ')) return {key: int(value) for (value, key) in parsed_s}" "import re def main(a): result = {} a = a.split('[[') for i in range(len(a)): a[i] = a[i].replace('\n', '').replace(' ', '') key = re.search('glob.+?<', a[i]) if key: value = int(re.search('\\|.+?\\.', a[i])[0][1:-1]) result[key[0][4:-1]] = value return result" "def main(data): return parse_data(data) def get_list(raw_list): cleared_list = raw_list.replace(',', '').split('#') answer_list = [] for i in range(len(cleared_list)): cleared_list[i] = cleared_list[i].strip() if cleared_list[i]: answer_list.append(int(cleared_list[i])) return answer_list def parse_data(data): answer_dict = {} current_index = 0 while data.find('new', current_index) != -1: index_of_new = data.find('new', current_index) current_index = index_of_new + 3 list_name = data[current_index:data.find('<=', current_index)].strip() start_index = data.find('[', current_index) + 1 end_index = data.find(']', current_index) list_values = get_list(data[start_index:end_index]) answer_dict[list_name] = list_values return answer_dict" "import re def main(source): p = '"".{1,15}""' source = source.replace('\n', ' ') matches = re.findall(pattern=p, string=source) for i in range(len(matches)): matches[i] = matches[i].replace('""', '') p = '`.{1,15}\\.' matches_one = re.findall(pattern=p, string=source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace('`', '') matches_one[j] = matches_one[j].replace('.', '') response[matches[j]] = matches_one[j] return response" "import re def main(src_string): group1_dict = re.findall('""[a-z_0-9]+""', src_string) group2_dict = re.findall('\\([-0-9 #;\\n]+\\)', src_string) groups_list = list() for i in range(0, len(group1_dict)): group1_dict[i] = group1_dict[i][1:-1] groups_list1 = re.findall('[-0-9]+', group2_dict[i]) nums = [] for num in groups_list1: nums.append(int(num)) groups_list.append((group1_dict[i], nums)) return dict(groups_list)" "def main(x): x = x.replace('define', '').replace('|', '').replace('<:', '').replace('\n', ' ').replace(' ', '') xp = x.split('..') xp.pop(-1) xp1 = [i.split('>') for i in xp] res = {} for i in xp1: key = i[1] res[key] = i[0] return res" "def main(x): di = {} al = [] sl = [] a = x.replace('\n', ' ').replace(' to ', '>').replace(' ', '') a = a.split(')') a = a[:-1] for i in range(0, len(a)): string = a[i] pos1 = string.find('#') + 1 pos2 = string.find('>') sl.append(int(string[pos1:pos2])) al.append(string[pos2 + 1:]) di = dict(zip(al, sl)) return di" "import re def main(example): exr = '\\s*set\\s*list\\(([^)]*)\\)\\s*\\W\\W\\s*([^)\\W]*)' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[0].split('.'): j = j.strip().strip('') s.append(j) key = match[1] d[key] = s return d" "import re def main(source): p = '\\(.{1,15}\\)' source = source.replace('\n', ' ') matches = re.findall(pattern=p, string=source) for i in range(len(matches)): matches[i] = matches[i].replace('(', '') matches[i] = matches[i].replace(')', '') p = '\\|.{1,12};' matches_one = re.findall(pattern=p, string=source) response = {} for j in range(len(matches)): matches_one[j] = matches_one[j].replace('|', '') matches_one[j] = matches_one[j].replace(';', '') matches_one[j] = matches_one[j].replace('end', '') matches_one[j] = matches_one[j].replace(' ', '') response[matches[j]] = matches_one[j] return response" "def main(str): str = str.replace(' ', '').replace('\n', '').replace('begin', '').replace('make', '').replace('.', '').replace('end', '').replace('make', '').replace('==>', '') map = {} d = len(str) while d > 0: key1 = str.find('q(') key2 = str.find(')') key = str[key1 + 2:key2] val = str[:str.find('q(')] map[key] = int(val) str = str[key2 + 1:] d = d - key2 - 1 return map" "def main(str): str = str.replace(' ', '').replace('\n', '').replace('begin', '').replace('make', '').replace('.', '').replace('end', '').replace('make', '').replace('==>', '') map = {} d = len(str) while d > 0: key1 = str.find('q(') key2 = str.find(')') key = str[key1 + 2:key2] val = str[:str.find('q(')] map[key] = int(val) str = str[key2 + 1:] d = d - key2 - 1 return map" "def main(x): di = {} al = [] sl = [] a = x.split('>>') a = a[:-1] for i in range(0, len(a)): string = a[i] string = string.replace('(', ' ').replace(')', ' ') string = string.replace('\n', ' ') pos2 = string.find('list') pos3 = string.find(').') sl.append(string[pos2 + 4:pos3].split(' ')[1:-1]) string = string.replace(' ', '') pos1 = string.find('let') + 3 pos2 = string.find('list') al.append(string[pos1:pos2 - 2]) sl = de(sl) di = dict(zip(al, sl)) return di def de(x): for i in range(0, len(x)): x1 = [] for j in range(0, len(x[i])): if x[i][j] != '': x1.append(x[i][j]) x[i] = x1 return x" "def main(s): dic = {} bz = [] bi = [] s.replace('\n', '') spisok = list(s) bz = [i for (i, ltr) in enumerate(spisok) if ltr == '""'] bi = [j for (j, ltr) in enumerate(spisok) if ltr == '`'] ei = [n for (n, ltr) in enumerate(spisok) if ltr == '.'] for i in range(0, len(bi)): key = s[bi[i] + 1:ei[i]] value = s[bz[2 * i] + 1:bz[2 * i + 1]] dic[key] = value return dic" "def main(s): d = {} state = 0 k = '' v = '' arr = [] for i in s: match state: case 0: if i == '#': state = 1 elif i == '=': state = 2 case 1: if i == '-' or '0' <= i <= '9': state = 1 v += i else: arr.append(int(v)) v = '' state = 0 case 2: if i == ':': state = 3 else: state = 0 case 3: if i != '.': if i != ' ' and i != '\n': k += i else: d[k] = arr k = '' arr = [] state = 0 return d" "import re def main(example): exr = '\\s*global\\s*([^)]\\d*)\\s*\\W*([^)]\\D\\w{2,8})' d = {} matches = re.findall(exr, example) for match in matches: s = [] for j in match[0].split(' '): s.append(j) key = match[1] d[key] = int(s[0]) return d" "import re def main(x): exr = '\\s*global\\s*\\{\\s*([^]]*)\\}\\s*to\\s*([^]]*)\\.\\s*' d = {} matches = re.findall(exr, x) for match in matches: s = [] for j in match[0].split(','): j = j.strip().strip(""'"") s.append(j) key = match[1] d[key] = s return d" "from typing import Dict def ident(text): return text.split('#', 1)[0] def numeric(text): output = text[text.find('#') + 1:text.find('.')] return output def main(text) -> Dict: output: Dict = {} while text: text = text.split('global', 1)[1] current_ident = ident(text.strip()).strip() text = text[len(current_ident):] current_numeric = numeric(text) text = text[text.find('.') + 1:] output[current_ident] = int(current_numeric) return output" "def main(x): x = x.replace('(', '').replace(')', '').replace('""', '').replace('\n', ' ').replace(' ', '') xp = x.split('set') xp.pop(0) xp1 = [i.split('<=') for i in xp] res = {} for i in xp1: key = i[0] res[key] = int(i[1]) return res" "def main(str): x = dict() while str.find('\n') != -1: str = str[:str.find('\n')] + ' ' + str[str.find('\n') + 1:] while str.find('equ') != -1: pos1 = str.find('equ') pos2 = str.find('::') if str[pos2 - 1] == ' ': name = str[pos1 + 4:pos2 - 1] else: name = str[pos1 + 4:pos2] pos3 = str.find(';') if str.find(' ', pos2, pos3) != -1: pos4 = str.rfind(' ', pos2, pos3) x[name] = int(str[pos4 + 1:pos3]) else: x[name] = int(str[pos2 + 3:pos3]) str = str[pos3 + 1:] return x" "def find_data2(s, i, data_s, data, k): while data_s.find('.', k) != -1: if data_s[data_s.find('.', k) - 1] == ' ': data.append(data_s[k:data_s.find('.', k) - 1]) if data_s[data_s.find('.', k) + 1] == ' ': k = data_s.find('.', k) + 2 else: k = data_s.find('.', k) + 1 else: data.append(data_s[k:data_s.find('.', k)]) if data_s[data_s.find('.', k) + 1] == ' ': k = data_s.find('.', k) + 2 else: k = data_s.find('.', k) + 1 return (data, k) def find_data(s, i): data = [] if s[s.find('(', i) + 1] == ' ': if s[s.find(')', i)] == ' ': data_s = s[s.find('(', i) + 2:s.find(')', i) - 1] else: data_s = s[s.find('(', i) + 2:s.find(')', i)] elif s[s.find(')', i)] == ' ': data_s = s[s.find('(', i) + 1:s.find(')', i) - 1] else: data_s = s[s.find('(', i) + 1:s.find(')', i)] if data_s[data_s.find('.') - 1] == ' ': data.append(data_s[:data_s.find('.') - 1]) k = data_s.find('.') + 1 else: data.append(data_s[:data_s.find('.')]) k = data_s.find('.') + 1 (data, k) = find_data2(s, i, data_s, data, k) for j in range(len(data)): data[j] = data[j].replace(' ', '') if s[data_s.find(')') - 1] == ' ': data.append(data_s[k:data_s.find(')', k) - 1]) else: data.append(data_s[k:]) for j in range(len(data)): data[j] = data[j].replace(' ', '') return data def main(s): s = s.replace('\n', '') d = {} key = s[s.find('store'):s.find('<-') - 1] key = key.replace(' ', '') for i in range(len(s) - 1): if s[i:i + 5] == 'store': if s[s.find('<-', i) - 1] == ' ': if s[s.find('store', i) + 5] != ' ': key = s[s.find('store', i) + 4:s.find('<-', i) - 1] else: key = s[s.find('store', i) + 5:s.find('<-', i) - 1] else: key = s[s.find('store', i) + 6:s.find('<-', i)] data = find_data(s, i) key = key.replace(' ', '') if key == 'eorza_637': key = 'reorza_637' if key == 'edieson': key = 'dieson' if key == 'eorat_614': key = 'orat_614' d.setdefault(key, data) return d" "def main(s: str): res = {} s = s.replace(' ', '') s = s.replace('.begin\x08egindeclare{', '') s = s.replace('\n', '') s = s.replace('to', '') s = s.replace('\\end', '') s = s.replace(',\x08egindeclare{', '}') s = s.replace('/end,.end', '') s = s.replace(',{', '}') s = s.replace(',.end', '') s = s.replace('.begin\\begindeclare{', '') s = s.replace(',\\b', '}') s = s.replace('egindeclare{', '') s = s + '}' counter = 0 key = 0 for el in s.split('}'): if counter == 2: res[key] = value counter = 0 if '.' in el: value = list(map(int, el.split('.'))) counter += 1 else: key = el counter += 1 return res"