nthakur/cornstack-ruby-v1-tevatron-1M · Datasets at Fast360
{
// 获取包含Hugging Face文本的span元素
const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap');
spans.forEach(span => {
if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) {
span.textContent = 'AI快站';
}
});
});
// 替换logo图片的alt属性
document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => {
if (img.alt.match(/Hugging\s*Face/i)) {
img.alt = 'AI快站 logo';
}
});
}
// 替换导航栏中的链接
function replaceNavigationLinks() {
// 已替换标记,防止重复运行
if (window._navLinksReplaced) {
return;
}
// 已经替换过的链接集合,防止重复替换
const replacedLinks = new Set();
// 只在导航栏区域查找和替换链接
const headerArea = document.querySelector('header') || document.querySelector('nav');
if (!headerArea) {
return;
}
// 在导航区域内查找链接
const navLinks = headerArea.querySelectorAll('a');
navLinks.forEach(link => {
// 如果已经替换过,跳过
if (replacedLinks.has(link)) return;
const linkText = link.textContent.trim();
const linkHref = link.getAttribute('href') || '';
// 替换Spaces链接 - 仅替换一次
if (
(linkHref.includes('/spaces') || linkHref === '/spaces' ||
linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) &&
linkText !== 'OCR模型免费转Markdown' &&
linkText !== 'OCR模型免费转Markdown'
) {
link.textContent = 'OCR模型免费转Markdown';
link.href = 'https://fast360.xyz';
link.setAttribute('target', '_blank');
link.setAttribute('rel', 'noopener noreferrer');
replacedLinks.add(link);
}
// 删除Posts链接
else if (
(linkHref.includes('/posts') || linkHref === '/posts' ||
linkText === 'Posts' || linkText.match(/^s*Postss*$/i))
) {
if (link.parentNode) {
link.parentNode.removeChild(link);
}
replacedLinks.add(link);
}
// 替换Docs链接 - 仅替换一次
else if (
(linkHref.includes('/docs') || linkHref === '/docs' ||
linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) &&
linkText !== '模型下载攻略'
) {
link.textContent = '模型下载攻略';
link.href = '/';
replacedLinks.add(link);
}
// 删除Enterprise链接
else if (
(linkHref.includes('/enterprise') || linkHref === '/enterprise' ||
linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i))
) {
if (link.parentNode) {
link.parentNode.removeChild(link);
}
replacedLinks.add(link);
}
});
// 查找可能嵌套的Spaces和Posts文本
const textNodes = [];
function findTextNodes(element) {
if (element.nodeType === Node.TEXT_NODE) {
const text = element.textContent.trim();
if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') {
textNodes.push(element);
}
} else {
for (const child of element.childNodes) {
findTextNodes(child);
}
}
}
// 只在导航区域内查找文本节点
findTextNodes(headerArea);
// 替换找到的文本节点
textNodes.forEach(node => {
const text = node.textContent.trim();
if (text === 'Spaces') {
node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown');
} else if (text === 'Posts') {
// 删除Posts文本节点
if (node.parentNode) {
node.parentNode.removeChild(node);
}
} else if (text === 'Enterprise') {
// 删除Enterprise文本节点
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}
});
// 标记已替换完成
window._navLinksReplaced = true;
}
// 替换代码区域中的域名
function replaceCodeDomains() {
// 特别处理span.hljs-string和span.njs-string元素
document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => {
if (span.textContent && span.textContent.includes('huggingface.co')) {
span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com');
}
});
// 替换hljs-string类的span中的域名(移除多余的转义符号)
document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => {
if (span.textContent && span.textContent.includes('huggingface.co')) {
span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com');
}
});
// 替换pre和code标签中包含git clone命令的域名
document.querySelectorAll('pre, code').forEach(element => {
if (element.textContent && element.textContent.includes('git clone')) {
const text = element.innerHTML;
if (text.includes('huggingface.co')) {
element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com');
}
}
});
// 处理特定的命令行示例
document.querySelectorAll('pre, code').forEach(element => {
const text = element.innerHTML;
if (text.includes('huggingface.co')) {
// 针对git clone命令的专门处理
if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) {
element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com');
}
}
});
// 特别处理模型下载页面上的代码片段
document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => {
const content = container.innerHTML;
if (content && content.includes('huggingface.co')) {
container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com');
}
});
// 特别处理模型仓库克隆对话框中的代码片段
try {
// 查找包含"Clone this model repository"标题的对话框
const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]');
if (cloneDialog) {
// 查找对话框中所有的代码片段和命令示例
const codeElements = cloneDialog.querySelectorAll('pre, code, span');
codeElements.forEach(element => {
if (element.textContent && element.textContent.includes('huggingface.co')) {
if (element.innerHTML.includes('huggingface.co')) {
element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com');
} else {
element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com');
}
}
});
}
// 更精确地定位克隆命令中的域名
document.querySelectorAll('[data-target]').forEach(container => {
const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string');
codeBlocks.forEach(block => {
if (block.textContent && block.textContent.includes('huggingface.co')) {
if (block.innerHTML.includes('huggingface.co')) {
block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com');
} else {
block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com');
}
}
});
});
} catch (e) {
// 错误处理但不打印日志
}
}
// 当DOM加载完成后执行替换
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => {
replaceHeaderBranding();
replaceNavigationLinks();
replaceCodeDomains();
// 只在必要时执行替换 - 3秒后再次检查
setTimeout(() => {
if (!window._navLinksReplaced) {
console.log('[Client] 3秒后重新检查导航链接');
replaceNavigationLinks();
}
}, 3000);
});
} else {
replaceHeaderBranding();
replaceNavigationLinks();
replaceCodeDomains();
// 只在必要时执行替换 - 3秒后再次检查
setTimeout(() => {
if (!window._navLinksReplaced) {
console.log('[Client] 3秒后重新检查导航链接');
replaceNavigationLinks();
}
}, 3000);
}
// 增加一个MutationObserver来处理可能的动态元素加载
const observer = new MutationObserver(mutations => {
// 检查是否导航区域有变化
const hasNavChanges = mutations.some(mutation => {
// 检查是否存在header或nav元素变化
return Array.from(mutation.addedNodes).some(node => {
if (node.nodeType === Node.ELEMENT_NODE) {
// 检查是否是导航元素或其子元素
if (node.tagName === 'HEADER' || node.tagName === 'NAV' ||
node.querySelector('header, nav')) {
return true;
}
// 检查是否在导航元素内部
let parent = node.parentElement;
while (parent) {
if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') {
return true;
}
parent = parent.parentElement;
}
}
return false;
});
});
// 只在导航区域有变化时执行替换
if (hasNavChanges) {
// 重置替换状态,允许再次替换
window._navLinksReplaced = false;
replaceHeaderBranding();
replaceNavigationLinks();
}
});
// 开始观察document.body的变化,包括子节点
if (document.body) {
observer.observe(document.body, { childList: true, subtree: true });
} else {
document.addEventListener('DOMContentLoaded', () => {
observer.observe(document.body, { childList: true, subtree: true });
});
}
})();
\n\t#\t\n\t# \n\n \treturn ret_text\n end","title":""}],"string":"[\n {\n \"docid\": \"ea223be41c76a0f93f4fea06330e5348\",\n \"score\": \"0.0\",\n \"text\": \"def do_generic_text(work_id, expression_id, line, line_expression_order, line_page_order, line_designator, arr_flags)\\n\\tret_text = \\\"\\\"\\n\\t# \\n\\t# \\t\\n\\t#\\t\\n\\t# \\t\\n\\t#\\t\\n\\t# \\t\\t\\n\\t# \\t\\t\\n\\t# \\t\\t\\tline of text\\n\\t# \\t\\t
\\n\\t#\\t\\t\\n\\t# \\t\\n\\t#\\t\\n\\t# \\n\\n \\treturn ret_text\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"f5c2efb38808b8107fe7cbfb257e501d","score":"0.68141997","text":"def block_literal?; end","title":""},{"docid":"f5c2efb38808b8107fe7cbfb257e501d","score":"0.68141997","text":"def block_literal?; end","title":""},{"docid":"cd2b14095600593fbc1ccb218e134093","score":"0.6643096","text":"def make(let_expression); end","title":""},{"docid":"cd2b14095600593fbc1ccb218e134093","score":"0.6643096","text":"def make(let_expression); end","title":""},{"docid":"a4727132c96541e82c912b0ad68258a5","score":"0.6505693","text":"def BlockNode(opening, block_var, bodystmt); end","title":""},{"docid":"10c854f6525513974550266be55d2c50","score":"0.638336","text":"def _Block\n\n _save = self.pos\n begin # sequence\n while true # kleene\n _tmp = apply(:_BlankLine)\n break unless _tmp\n end\n _tmp = true # end kleene\n break unless _tmp\n\n begin # choice\n _tmp = apply(:_BlockQuote)\n break if _tmp\n _tmp = apply(:_Verbatim)\n break if _tmp\n _tmp = apply(:_HorizontalRule)\n break if _tmp\n _tmp = apply(:_Heading)\n break if _tmp\n _tmp = apply(:_BulletList)\n break if _tmp\n _tmp = apply(:_Para)\n break if _tmp\n _tmp = apply(:_Plain)\n end while false # end choice\n\n end while false\n unless _tmp\n self.pos = _save\n end # end sequence\n\n set_failed_rule :_Block unless _tmp\n return _tmp\n end","title":""},{"docid":"ee4f76b853611ddb3196b6191983a1de","score":"0.6372161","text":"def transforming_body_expr=(_); end","title":""},{"docid":"ee4f76b853611ddb3196b6191983a1de","score":"0.6372161","text":"def transforming_body_expr=(_); end","title":""},{"docid":"e47955358bc64af767046637b8dddf55","score":"0.63119316","text":"def parse_block_exps\n pos = position\n ws\n exps = E[pos]\n while ret = parse_defexp\n exps << ret\n end\n return exps\n end","title":""},{"docid":"2d44cc938eecdad2fd253d5a34c5f442","score":"0.63090473","text":"def transforming_body_expr; end","title":""},{"docid":"2d44cc938eecdad2fd253d5a34c5f442","score":"0.63090473","text":"def transforming_body_expr; end","title":""},{"docid":"c31f5b0b8044a1790933d408d879d8c9","score":"0.62725466","text":"def code_block(syntax, &plaintext)\n preserve { code(syntax.to_s, &plaintext) }\n end","title":""},{"docid":"9fb95b45f2495ab4fa6b26baf59f0cbe","score":"0.62457186","text":"def BEGINBlock(lbrace, statements); end","title":""},{"docid":"e54e7187b1fd0fdabbef80a5dfa57ad1","score":"0.62355804","text":"def visit_block(node); end","title":""},{"docid":"1836a347f3f3c745930e50117b39d4d6","score":"0.623343","text":"def block_code(code, language)\n \"```#{language}\\n#{code.strip}\\n```\" + NEW_BLOCK\n end","title":""},{"docid":"c1b419b550b9bb695ec901b56fc4fcf6","score":"0.6220687","text":"def ²; block_2ary end","title":""},{"docid":"edd4b105a06f76a72191872de9768a79","score":"0.6199745","text":"def build_basic_blocks; end","title":""},{"docid":"b684d98170f92145866dab0e9d732bf1","score":"0.6161734","text":"def transform_block(exp)\n if exp && exp[0] == :iter\n (exp.length-1).times do |i|\n expr = exp[i+1]\n #find the block\n if expr && expr.length && expr[0] == :block\n transform_ast exp if rewrite_bind? expr,expr[1]\n end\n end\n end\n end","title":""},{"docid":"f24f55baeaf2f64c086565d5cc4f22fe","score":"0.6158861","text":"def gen_block_p!(p)\n emit! \"#{p.type_node.p_type} \"\n end","title":""},{"docid":"bd13e40f04c11ad5d30d49f94568049d","score":"0.61234206","text":"def inner_expr\n signal('expr')\n # puts \"token: #{@token.value}\".yellow\n if @token.type == :begin_environment\n begin_token = @token.value\n end_token = begin_token.gsub('begin', 'end')\n environment(end_token)\n elsif @token.value =~ /\\\\[a-zA-Z].*/\n macro\n elsif @token.value[0] != '\\\\' and @token.value[0] != '\\\\['\n text_sequence\n else\n # do nothing\n end\n signal '-- exit expression'\n end","title":""},{"docid":"46ed489e5957a7d305b6a558e1d692e3","score":"0.611818","text":"def block_quote(quote)\n \"> \" + quote.strip.gsub(\"\\n\", \"\\n> \") + NEW_BLOCK\n end","title":""},{"docid":"30a21f2e8d3c892371ff20a2a2b4d2c6","score":"0.611395","text":"def Statements(body); end","title":""},{"docid":"5dd4261acf120f2f3c3664ef37f2ba8e","score":"0.61137724","text":"def block\n\t\tdeclaration_nodes = declarations\n\t\tcompound_statement_node = compound_statement\n\t\tBlock.new(declaration_nodes, compound_statement_node)\n\tend","title":""},{"docid":"45aedd9dc7f30ae8eb2beb551ed103d6","score":"0.6085719","text":"def blanky_code_block!(input)\n input.gsub!(REGEX_CODE_BLOCK) do\n data = $LAST_MATCH_INFO\n ticks = b(:ticks, data: data)\n lang = b(:lang, data: data)\n\n if strip_code_blocks?\n prettify? ? \"\" : ticks + lang + \"\\n\" + b(:code, data: data) + \"\\n\" + ticks\n else\n ticks + lang + \"\\n\" + m(:code, data: data) + \"\\n\" + ticks\n end\n end\n end","title":""},{"docid":"dc27ee5eae810a9c7ec980d80a2c5b75","score":"0.6073663","text":"def add_make_block(res,level)\n res << \" \" * level*3\n res << Low2C.make_name(self) << \"();\\n\"\n end","title":""},{"docid":"1ee2226743e1ca30e572cac2ab773d91","score":"0.6067644","text":"def block_node=(_); end","title":""},{"docid":"1ee2226743e1ca30e572cac2ab773d91","score":"0.6067644","text":"def block_node=(_); end","title":""},{"docid":"82f2af4c85921338aa9887dd12c5a882","score":"0.60587066","text":"def create_block_from_dup_alt(alt)\n nalt = GrammarAST.dup_tree_no_actions(alt, nil)\n blk = self.attr_ast_factory.make((ASTArray.new(3)).add(self.attr_ast_factory.create(BLOCK, \"BLOCK\")).add(nalt).add(self.attr_ast_factory.create(EOB, \"\")))\n return blk\n end","title":""},{"docid":"f0724c094e43ae15560f3d52210bed1c","score":"0.60562706","text":"def new_block name\n new_b = Block.new( name , @function , @next )\n @next = new_b\n return new_b\n end","title":""},{"docid":"f7d5cac6daf094d59c11a8e2cf901828","score":"0.6051015","text":"def process_block(exp)\n Block.new(*exp.map { |exp| process(exp) })\n end","title":""},{"docid":"1cce5315c8c1ae8806ab43f28473da3e","score":"0.6049487","text":"def translate_block(sexp)\n sexps = sexp.drop(1).map { |s| translate_generic_sexp s }\n filtered_stmts(*sexps).with_value_of sexps.last\n end","title":""},{"docid":"cd6f347c4bd64ff5e26c3598a7ba0504","score":"0.6049264","text":"def compile_interpolated_plain(node); end","title":""},{"docid":"cd6f347c4bd64ff5e26c3598a7ba0504","score":"0.6049264","text":"def compile_interpolated_plain(node); end","title":""},{"docid":"fc7c69e40a66ec8b135ee5c4f7f1ca7d","score":"0.6033279","text":"def block_node; end","title":""},{"docid":"fc7c69e40a66ec8b135ee5c4f7f1ca7d","score":"0.6033279","text":"def block_node; end","title":""},{"docid":"fc7c69e40a66ec8b135ee5c4f7f1ca7d","score":"0.6033279","text":"def block_node; end","title":""},{"docid":"fc7c69e40a66ec8b135ee5c4f7f1ca7d","score":"0.6033279","text":"def block_node; end","title":""},{"docid":"0993287632f69873b50917891718e738","score":"0.60238415","text":"def block_style_block(factory, cmd)\n factory.programbox() {\n text \"Running code from a block\"\n height 15\n width 30\n command {\n puts 'foo block'\n sleep 2\n puts 'bar block'\n sleep 2\n puts 'baz block'\n }\n }\nend","title":""},{"docid":"3a05df17a588208b3b5b6969a0d70d01","score":"0.6011341","text":"def code_block(input)\n \n input.gsub!(/^`{3} *([^\\n]+)?\\n(.+?)\\n`{3}/m) do\n caption = nil\n options = $1 || ''\n lang = nil\n str = $2\n \n if options =~ AllOptions\n lang = $1\n caption = \"#{$2}\\n#{$4 || 'link'}\"\n elsif options =~ LangCaption\n lang = $1\n caption = \"#{$2}\\n\"\n end\n \n if str.match(/\\A( {4}|\\t)/)\n str = str.gsub(/^( {4}|\\t)/, '')\n end\n \n render_octopress_like_code_block(lang, str, caption, options)\n end\n end","title":""},{"docid":"e997d167464be890f1d0945e288b7aa6","score":"0.6007835","text":"def block_node\n parent if block_literal?\n end","title":""},{"docid":"7f04905c21f90d601f0d9a07558cb95f","score":"0.59984887","text":"def create_block(line)\r\n # Gather variables\r\n elements = line.split('|')\r\n line_num = elements[0]\r\n last_hash = elements[1]\r\n transactors = elements[2]\r\n time_val = elements[3]\r\n end_hash = elements[4]\r\n # Return Block made with variables\r\n Block.new(line_num, last_hash, transactors, time_val, end_hash)\r\n end","title":""},{"docid":"4c840ab704667cbe42e1e15efd5579ef","score":"0.5970075","text":"def expression; end","title":""},{"docid":"4c840ab704667cbe42e1e15efd5579ef","score":"0.5970075","text":"def expression; end","title":""},{"docid":"4c840ab704667cbe42e1e15efd5579ef","score":"0.5970075","text":"def expression; end","title":""},{"docid":"4c840ab704667cbe42e1e15efd5579ef","score":"0.5970075","text":"def expression; end","title":""},{"docid":"4c840ab704667cbe42e1e15efd5579ef","score":"0.5970075","text":"def expression; end","title":""},{"docid":"4c840ab704667cbe42e1e15efd5579ef","score":"0.5970075","text":"def expression; end","title":""},{"docid":"f6ab1163f45dd463a552c9a41c365bcc","score":"0.5954181","text":"def process_block(exp)\n nodes = t(:block, CType.unknown)\n until exp.empty? do\n nodes << process(exp.shift)\n end\n nodes\n end","title":""},{"docid":"21c0d537b9de21be82c535475c112a83","score":"0.59349024","text":"def new_block(x, y, z, a, b)\n @chain.push(Block.new(x, y, z, a, b))\n end","title":""},{"docid":"98e7f4016c8e4a3e76b55e6794bac400","score":"0.59091336","text":"def process_block_token(tk); end","title":""},{"docid":"97856996239a133ce18a78e8ba569f5f","score":"0.58904326","text":"def new_block new_name\n new_b = Block.new( new_name , @blocks.first.method )\n index = @blocks.index( @current )\n @blocks.insert( index + 1 , new_b ) # + one because we want the ne after the insert_at\n return new_b\n end","title":""},{"docid":"1614d7445a0607df670819b1a640755e","score":"0.5884313","text":"def on_brace_block(block_var, statements); end","title":""},{"docid":"24501935a0e7d3d6708912690014e4ba","score":"0.58820814","text":"def negate_iife_block; end","title":""},{"docid":"1535c9ca7fbd4021ab9bf1f19afb7769","score":"0.58805084","text":"def add_expr_literal(src, code)\n src << '' << h(code) << ''\n src << '' if block_opener?(code)\n end","title":""},{"docid":"21740799cd962f60eb3dcbd6910427bc","score":"0.5865654","text":"def block_code(code, _language)\n \" #{code} \"\n end","title":""},{"docid":"5393a25622e9f18ff0e06445d1eb319b","score":"0.5863697","text":"def as_comment_body\n\t\tcomment = \"%s '%s': { \" % [ self.tagname, self.name ]\n\t\tif self.methodchain\n\t\t\tcomment << \"template.%s%s\" % [ self.identifiers.first, self.methodchain ]\n\t\telse\n\t\t\tcomment << self.literal\n\t\tend\n\t\tcomment << \" }\"\n\t\tcomment << \" with format: %p\" % [ self.format ] if self.format\n\n\t\treturn comment\n\tend","title":""},{"docid":"72bd181363a422c04deb556f56163c20","score":"0.5862568","text":"def create_block_temporary(args, body, callsite_block=nil)\n @temporary_counter += 1\n name = current_temporary('B-')\n if callsite_block\n new_proc = LaserProc.new(args, body, @graph, callsite_block)\n else\n new_proc = LaserProc.new(args, body)\n end\n binding = Bindings::BlockBinding.new(name, nil)\n add_instruction(:assign, binding, new_proc)\n [binding, new_proc]\n end","title":""},{"docid":"5aca6861230c5a2ecb708dfa0c8805a9","score":"0.5852094","text":"def expressions; end","title":""},{"docid":"5aca6861230c5a2ecb708dfa0c8805a9","score":"0.5852094","text":"def expressions; end","title":""},{"docid":"5aca6861230c5a2ecb708dfa0c8805a9","score":"0.5852094","text":"def expressions; end","title":""},{"docid":"5aca6861230c5a2ecb708dfa0c8805a9","score":"0.5852094","text":"def expressions; end","title":""},{"docid":"5aca6861230c5a2ecb708dfa0c8805a9","score":"0.5852094","text":"def expressions; end","title":""},{"docid":"5aca6861230c5a2ecb708dfa0c8805a9","score":"0.5852094","text":"def expressions; end","title":""},{"docid":"a04b0fdba4f231fb82dd9a197f5654da","score":"0.58501923","text":"def on_brace_block(params, body)\n return Token::BlockToken.new(\n :parameters => params,\n :value => body,\n :line => lineno,\n :column => column,\n :type => :block,\n :code => code(lineno)\n )\n end","title":""},{"docid":"2263e4c1c2a4cbc3c0cbffcb33264d89","score":"0.5847156","text":"def add_make_block(res,level)\n self.statement.add_make_block(res,level)\n end","title":""},{"docid":"a92cebb7da9d72f4fcf9ed7716d071fc","score":"0.5833989","text":"def visit_embexpr_beg(node); end","title":""},{"docid":"52deaf95579029396421b70c70d2b439","score":"0.5827229","text":"def rewrite_block(exp)\n # Take the leading atom (:block) of the s-expression, we'll put it back\n # on before returning. This way, the rotate independent code doesn't\n # have to worry about the leading atom for the original sexp.\n atom = exp.shift\n \n # Preserve the return statement – in ruby the last statement\n # is always the returned value. It cannot necessarily be\n # re-ordered.\n return_exp = exp.pop\n \n # Rotate the remaining statements and then replace the original\n # atom and return s-expressions.\n rotate_independent(exp).unshift(atom).push(return_exp)\n end","title":""},{"docid":"309f1729cee239f8a7d7423d7447a466","score":"0.5803093","text":"def block_contents(node, context); end","title":""},{"docid":"d2f1beca51661d0fd6732c0a5f85a4a3","score":"0.5801717","text":"def block_code\n \"```ruby\\n#{Lorem.sentence(word_count: 1)}\\n```\"\n end","title":""},{"docid":"9418dcf1f350cca7d524dc8c61743373","score":"0.5789063","text":"def block_in_template; \"<% \" + yield + \" %>\"; end","title":""},{"docid":"bd95d9d636d26e4d02f944296697e128","score":"0.57877195","text":"def visit_block_var(node); end","title":""},{"docid":"8e8f4a54504bab0d51be081144f34ae4","score":"0.5784012","text":"def inline_template_block(content)\n Proc.new{content}\n end","title":""},{"docid":"c2549a7c61777966686af332641b6e72","score":"0.57805204","text":"def test_text_block_using_variable\n @method.write_expression \"a = 5\", 5\n @method.write_expression \"b = 0\", 0\n @method.write_expression \"a.times do\\nb += a\\nend\", 5 #result is number of times \n @method.write_expression \"b\", 25\n expected = <<-EOF\n def test_1\n a = 5\n b = 0\n a.times do\n b += a\n end\n assert_equal(25, b)\n end\n\n EOF\n assert_equal expected, @method.text\n end","title":""},{"docid":"41ed4f375c62d023abd28eed49c954da","score":"0.5771002","text":"def syntaxer(&block)\n self.instance_eval(&block)\n end","title":""},{"docid":"90c62be12087cb83178d318a5d0480e5","score":"0.57658744","text":"def body()\n @@bodyExpression\n end","title":""},{"docid":"381a286b0ca46424966114d99c5fcabe","score":"0.57556766","text":"def visit_blockarg(node); end","title":""},{"docid":"97c2c86768f1d402797bdbc498f5413b","score":"0.5753781","text":"def block_runner_factory(expression)\n with_dsl(expression, &block)\n end","title":""},{"docid":"44b073cfc9821518c5390c14241272c0","score":"0.5749883","text":"def visit_Block(node)\n\t\tGLOBAL_SCOPE[node.name.value] = node.compoundStatement\n\t\tvisit(node.compoundStatement)\n\tend","title":""},{"docid":"0d17dc9e75512a96e450c18ae8e35a16","score":"0.5748533","text":"def plsql_block\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n return_value = PlsqlBlockReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n plsql_block_start_index = @input.index\n\n root_0 = nil\n __LLABEL104__ = nil\n __RLABEL106__ = nil\n string_literal107 = nil\n string_literal109 = nil\n string_literal111 = nil\n string_literal113 = nil\n label_name105 = nil\n declare_spec108 = nil\n seq_of_statements110 = nil\n exception_handler112 = nil\n label_name114 = nil\n\n tree_for_LLABEL104 = nil\n tree_for_RLABEL106 = nil\n tree_for_string_literal107 = nil\n tree_for_string_literal109 = nil\n tree_for_string_literal111 = nil\n tree_for_string_literal113 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 125:4: ( LLABEL label_name RLABEL )? ( ( 'DECLARE' )? ( declare_spec )+ )? ( 'BEGIN' ) seq_of_statements ( 'EXCEPTION' ( exception_handler )+ )? ( 'END' ( label_name )? )\n # at line 125:4: ( LLABEL label_name RLABEL )?\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0 == LLABEL )\n alt_22 = 1\n end\n case alt_22\n when 1\n # at line 125:6: LLABEL label_name RLABEL\n __LLABEL104__ = match( LLABEL, TOKENS_FOLLOWING_LLABEL_IN_plsql_block_661 )\n if @state.backtracking == 0\n\n tree_for_LLABEL104 = @adaptor.create_with_payload( __LLABEL104__ )\n @adaptor.add_child( root_0, tree_for_LLABEL104 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_label_name_IN_plsql_block_663 )\n label_name105 = label_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, label_name105.tree )\n end\n __RLABEL106__ = match( RLABEL, TOKENS_FOLLOWING_RLABEL_IN_plsql_block_665 )\n if @state.backtracking == 0\n\n tree_for_RLABEL106 = @adaptor.create_with_payload( __RLABEL106__ )\n @adaptor.add_child( root_0, tree_for_RLABEL106 )\n\n end\n\n end\n # at line 126:3: ( ( 'DECLARE' )? ( declare_spec )+ )?\n alt_25 = 2\n look_25_0 = @input.peek( 1 )\n\n if ( look_25_0.between?( ID, DOUBLEQUOTED_STRING ) || look_25_0 == T__50 || look_25_0 == T__60 || look_25_0.between?( T__103, T__104 ) || look_25_0 == T__161 )\n alt_25 = 1\n end\n case alt_25\n when 1\n # at line 126:5: ( 'DECLARE' )? ( declare_spec )+\n # at line 126:5: ( 'DECLARE' )?\n alt_23 = 2\n look_23_0 = @input.peek( 1 )\n\n if ( look_23_0 == T__60 )\n alt_23 = 1\n end\n case alt_23\n when 1\n # at line 126:7: 'DECLARE'\n string_literal107 = match( T__60, TOKENS_FOLLOWING_T__60_IN_plsql_block_676 )\n if @state.backtracking == 0\n\n tree_for_string_literal107 = @adaptor.create_with_payload( string_literal107 )\n @adaptor.add_child( root_0, tree_for_string_literal107 )\n\n end\n\n end\n # at file 126:20: ( declare_spec )+\n match_count_24 = 0\n while true\n alt_24 = 2\n look_24_0 = @input.peek( 1 )\n\n if ( look_24_0.between?( ID, DOUBLEQUOTED_STRING ) || look_24_0 == T__50 || look_24_0.between?( T__103, T__104 ) || look_24_0 == T__161 )\n alt_24 = 1\n\n end\n case alt_24\n when 1\n # at line 126:21: declare_spec\n @state.following.push( TOKENS_FOLLOWING_declare_spec_IN_plsql_block_682 )\n declare_spec108 = declare_spec\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, declare_spec108.tree )\n end\n\n else\n match_count_24 > 0 and break\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n eee = EarlyExit(24)\n\n\n raise eee\n end\n match_count_24 += 1\n end\n\n\n end\n # at line 127:3: ( 'BEGIN' )\n # at line 127:5: 'BEGIN'\n string_literal109 = match( T__55, TOKENS_FOLLOWING_T__55_IN_plsql_block_694 )\n if @state.backtracking == 0\n\n tree_for_string_literal109 = @adaptor.create_with_payload( string_literal109 )\n @adaptor.add_child( root_0, tree_for_string_literal109 )\n\n end\n\n @state.following.push( TOKENS_FOLLOWING_seq_of_statements_IN_plsql_block_700 )\n seq_of_statements110 = seq_of_statements\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, seq_of_statements110.tree )\n end\n # at line 129:3: ( 'EXCEPTION' ( exception_handler )+ )?\n alt_27 = 2\n look_27_0 = @input.peek( 1 )\n\n if ( look_27_0 == T__61 )\n alt_27 = 1\n end\n case alt_27\n when 1\n # at line 129:5: 'EXCEPTION' ( exception_handler )+\n string_literal111 = match( T__61, TOKENS_FOLLOWING_T__61_IN_plsql_block_706 )\n if @state.backtracking == 0\n\n tree_for_string_literal111 = @adaptor.create_with_payload( string_literal111 )\n @adaptor.add_child( root_0, tree_for_string_literal111 )\n\n end\n # at file 129:17: ( exception_handler )+\n match_count_26 = 0\n while true\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0 == T__63 )\n alt_26 = 1\n\n end\n case alt_26\n when 1\n # at line 129:19: exception_handler\n @state.following.push( TOKENS_FOLLOWING_exception_handler_IN_plsql_block_710 )\n exception_handler112 = exception_handler\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, exception_handler112.tree )\n end\n\n else\n match_count_26 > 0 and break\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n eee = EarlyExit(26)\n\n\n raise eee\n end\n match_count_26 += 1\n end\n\n\n end\n # at line 130:3: ( 'END' ( label_name )? )\n # at line 130:5: 'END' ( label_name )?\n string_literal113 = match( T__54, TOKENS_FOLLOWING_T__54_IN_plsql_block_723 )\n if @state.backtracking == 0\n\n tree_for_string_literal113 = @adaptor.create_with_payload( string_literal113 )\n @adaptor.add_child( root_0, tree_for_string_literal113 )\n\n end\n # at line 130:11: ( label_name )?\n alt_28 = 2\n look_28_0 = @input.peek( 1 )\n\n if ( look_28_0.between?( ID, DOUBLEQUOTED_STRING ) )\n alt_28 = 1\n end\n case alt_28\n when 1\n # at line 130:13: label_name\n @state.following.push( TOKENS_FOLLOWING_label_name_IN_plsql_block_727 )\n label_name114 = label_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, label_name114.tree )\n end\n\n end\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n memoize( __method__, plsql_block_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end","title":""},{"docid":"09596f8c43b986ba5dbcd7454a3ebd8b","score":"0.574535","text":"def block\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n return_value = BlockReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n paragraph47 = nil\n div48 = nil\n table49 = nil\n\n\n begin\n # at line 150:2: ( paragraph | div | table )\n alt_10 = 3\n look_10_0 = @input.peek( 1 )\n\n if ( look_10_0 == OPENING_TAG )\n case look_10 = @input.peek( 2 )\n when P then alt_10 = 1\n when DIV then alt_10 = 2\n when TABLE then alt_10 = 3\n else\n raise NoViableAlternative( \"\", 10, 1 )\n end\n else\n raise NoViableAlternative( \"\", 10, 0 )\n end\n case alt_10\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 150:4: paragraph\n @state.following.push( TOKENS_FOLLOWING_paragraph_IN_block_351 )\n paragraph47 = paragraph\n @state.following.pop\n @adaptor.add_child( root_0, paragraph47.tree )\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 151:4: div\n @state.following.push( TOKENS_FOLLOWING_div_IN_block_356 )\n div48 = div\n @state.following.pop\n @adaptor.add_child( root_0, div48.tree )\n\n when 3\n root_0 = @adaptor.create_flat_list\n\n\n # at line 152:4: table\n @state.following.push( TOKENS_FOLLOWING_table_IN_block_361 )\n table49 = table\n @state.following.pop\n @adaptor.add_child( root_0, table49.tree )\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 10 )\n\n end\n \n return return_value\n end","title":""},{"docid":"a347cc68889c6fc304e79d496f5181ce","score":"0.57394993","text":"def filtered_block(*args)\n #s(:block, *expand_stmts(args))\n s(:block, *args)\n end","title":""},{"docid":"53a17f3544b3747a07bb1f9de5094a80","score":"0.57327515","text":"def add_content(parent, expression, &block)\n if block_given? && expression.is_a?(ParentExpression)\n dsl_stack.push(expression.class.dsl)\n parent_stack.push(parent) \n expression.add_content(parent, &block)\n parent_stack.pop\n dsl_stack.pop\n end\n end","title":""},{"docid":"f85ec52e5d7c7b0c9e9ea6459cd65625","score":"0.5723403","text":"def begin_block\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 52 )\n return_value = BeginBlockReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n begin_block_start_index = @input.index\n\n root_0 = nil\n string_literal456 = nil\n string_literal458 = nil\n string_literal460 = nil\n seq_of_statements457 = nil\n exception_handler459 = nil\n\n tree_for_string_literal456 = nil\n tree_for_string_literal458 = nil\n tree_for_string_literal460 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 386:4: 'BEGIN' ( seq_of_statements ) ( 'EXCEPTION' ( exception_handler )+ )? 'END'\n string_literal456 = match( T__55, TOKENS_FOLLOWING_T__55_IN_begin_block_2551 )\n if @state.backtracking == 0\n\n tree_for_string_literal456 = @adaptor.create_with_payload( string_literal456 )\n @adaptor.add_child( root_0, tree_for_string_literal456 )\n\n end\n # at line 387:3: ( seq_of_statements )\n # at line 387:5: seq_of_statements\n @state.following.push( TOKENS_FOLLOWING_seq_of_statements_IN_begin_block_2557 )\n seq_of_statements457 = seq_of_statements\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, seq_of_statements457.tree )\n end\n\n # at line 388:3: ( 'EXCEPTION' ( exception_handler )+ )?\n alt_108 = 2\n look_108_0 = @input.peek( 1 )\n\n if ( look_108_0 == T__61 )\n alt_108 = 1\n end\n case alt_108\n when 1\n # at line 388:5: 'EXCEPTION' ( exception_handler )+\n string_literal458 = match( T__61, TOKENS_FOLLOWING_T__61_IN_begin_block_2565 )\n if @state.backtracking == 0\n\n tree_for_string_literal458 = @adaptor.create_with_payload( string_literal458 )\n @adaptor.add_child( root_0, tree_for_string_literal458 )\n\n end\n # at file 388:17: ( exception_handler )+\n match_count_107 = 0\n while true\n alt_107 = 2\n look_107_0 = @input.peek( 1 )\n\n if ( look_107_0 == T__63 )\n alt_107 = 1\n\n end\n case alt_107\n when 1\n # at line 388:19: exception_handler\n @state.following.push( TOKENS_FOLLOWING_exception_handler_IN_begin_block_2569 )\n exception_handler459 = exception_handler\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, exception_handler459.tree )\n end\n\n else\n match_count_107 > 0 and break\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n eee = EarlyExit(107)\n\n\n raise eee\n end\n match_count_107 += 1\n end\n\n\n end\n string_literal460 = match( T__54, TOKENS_FOLLOWING_T__54_IN_begin_block_2579 )\n if @state.backtracking == 0\n\n tree_for_string_literal460 = @adaptor.create_with_payload( string_literal460 )\n @adaptor.add_child( root_0, tree_for_string_literal460 )\n\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 52 )\n memoize( __method__, begin_block_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end","title":""},{"docid":"db4f59696e2c061c8c496b4e25a60f04","score":"0.57210976","text":"def compound_statement\n eat :begin\n nodes = statement_list\n eat :end\n root = Compound.new\n root.children = nodes\n root\n end","title":""},{"docid":"8830f8724623f4951dc43ecb4fc5fd89","score":"0.57187283","text":"def reduce_begin_expression(_production, _range, _tokens, theChildren)\n SkmSequencingBlock.new(theChildren[2])\n end","title":""},{"docid":"e901a61dc8f9a681ddb972ade147f6de","score":"0.5717369","text":"def compile_block(scope, *exp)\n compile_do(scope, *exp[1])\n end","title":""},{"docid":"a7a62b3fcea4ff2985e2a26e93f6a4d0","score":"0.57171893","text":"def create_first_block\n\ti = 0\n\tinstance_variable_set(\"@b#{i}\", Block.first(\"Genesis\")) #Méta programmation\n\tLEDGER << @b0\n\tpp @b0\n\tadd_block\nend","title":""},{"docid":"712a25c3630be5f344b895a8cce4868b","score":"0.57171315","text":"def expr; end","title":""},{"docid":"712a25c3630be5f344b895a8cce4868b","score":"0.57171315","text":"def expr; end","title":""},{"docid":"712a25c3630be5f344b895a8cce4868b","score":"0.57171315","text":"def expr; end","title":""},{"docid":"712a25c3630be5f344b895a8cce4868b","score":"0.57171315","text":"def expr; end","title":""},{"docid":"712a25c3630be5f344b895a8cce4868b","score":"0.57171315","text":"def expr; end","title":""},{"docid":"712a25c3630be5f344b895a8cce4868b","score":"0.57171315","text":"def expr; end","title":""},{"docid":"712a25c3630be5f344b895a8cce4868b","score":"0.57171315","text":"def expr; end","title":""},{"docid":"ab38ee13c5bed2a3242b66c6c7382e8c","score":"0.5709922","text":"def render_block(markdown)\n rootNode = parser.parse(markdown)\n if rootNode\n return rootNode.render\n else\n error_line = markdown.split(\"\\n\")[parser.failure_line-1]\n raise SyntaxError.new \"Alongslide syntax error around: \\\"#{error_line}\\\"\"\n end\n rescue\n raise SyntaxError.new \"Unknown Alongslide syntax error\"\n end","title":""},{"docid":"6b564ed5506998f1685292d45c20fb1e","score":"0.5708929","text":"def rule10(block)\r\n\treturn\r\n end","title":""},{"docid":"f9d135ba8f66ad1f2387bbe414adf068","score":"0.57057446","text":"def to_vool\n block_name = \"implicit_block_#{object_id}\".to_sym\n block = Vool::BlockStatement.new( @args.dup , @body.to_vool)\n assign = Vool::LocalAssignment.new( block_name , block)\n sendd = @send.to_vool\n if(sendd.is_a?(Vool::Statements))\n ret = sendd\n sendd = sendd.last\n else\n ret = Vool::Statements.new([sendd])\n end\n sendd.arguments << LocalVariable.new(block_name).to_vool\n ret.prepend(assign)\n ret\n end","title":""},{"docid":"eb4698bf22ad5c5e1bc0780fc0e805f7","score":"0.5705531","text":"def add_block(mode = nil, name = :\"\", &ruby_block)\n # Creates the block.\n block = High.make_block(mode,name,&ruby_block)\n # Adds it as a statement.\n self.add_statement(block)\n # Use its return value.\n return block.return_value\n end","title":""},{"docid":"3c7523ff01bc666bfc03f7882ad84086","score":"0.5694298","text":"def blk( text, deep_code = false )\n return text if text =~ /<[0-9]+>/\n \n plain = text !~ /\\A[#*> ]/\n\n # skip blocks that are complex HTML\n if text =~ /^<\\/?(\\w+).*>/ and not SIMPLE_HTML_TAGS.include? $1\n text\n else\n # search for indentation levels\n text.strip!\n if text.empty?\n text\n else\n code_blk = nil\n text.gsub!( /((?:\\n(?:\\n^ +[^\\n]*)+)+)/m ) do |iblk|\n flush_left iblk\n blocks iblk, plain\n iblk.gsub( /^(\\S)/, \"\\\\1\" )\n if plain\n code_blk = iblk; \"\"\n else\n iblk\n end\n end\n block_applied = 0 \n @rules.each do |rule_name|\n block_applied += 1 if ( rule_name.to_s.match /^block_/ and method( rule_name ).call( text ) )\n end\n if block_applied.zero?\n if deep_code\n text = \"\\t#{ text }
\\n\"\n else\n text = \"\\t#{ text }
\\n\"\n end\n end\n # hard_break text\n text << \"\\n#{ code_blk }\"\n end\n return text\n end\n \n end","title":""},{"docid":"9102fa935c7ce0e04861a363f1fd9b89","score":"0.56903607","text":"def block\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n\n begin\n # at line 100:8: ( paragraph | div | table )\n alt_17 = 3\n look_17_0 = @input.peek( 1 )\n\n if ( look_17_0 == TAG )\n look_17_1 = @input.peek( 2 )\n\n if ( look_17_1 == DOWN )\n case look_17 = @input.peek( 3 )\n when P then alt_17 = 1\n when DIV then alt_17 = 2\n when TABLE then alt_17 = 3\n else\n raise NoViableAlternative( \"\", 17, 2 )\n end\n else\n raise NoViableAlternative( \"\", 17, 1 )\n end\n else\n raise NoViableAlternative( \"\", 17, 0 )\n end\n case alt_17\n when 1\n # at line 100:10: paragraph\n @state.following.push( TOKENS_FOLLOWING_paragraph_IN_block_596 )\n paragraph\n @state.following.pop\n\n when 2\n # at line 101:10: div\n @state.following.push( TOKENS_FOLLOWING_div_IN_block_607 )\n div\n @state.following.pop\n\n when 3\n # at line 102:10: table\n @state.following.push( TOKENS_FOLLOWING_table_IN_block_618 )\n table\n @state.following.pop\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n end\n \n return \n end","title":""},{"docid":"a973b709cc0d84320fbab5cfd9e19a24","score":"0.56894106","text":"def block_node\n case sexp_type\n when :method_add_block\n self[2]\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"f5c2efb38808b8107fe7cbfb257e501d\",\n \"score\": \"0.68141997\",\n \"text\": \"def block_literal?; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f5c2efb38808b8107fe7cbfb257e501d\",\n \"score\": \"0.68141997\",\n \"text\": \"def block_literal?; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cd2b14095600593fbc1ccb218e134093\",\n \"score\": \"0.6643096\",\n \"text\": \"def make(let_expression); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cd2b14095600593fbc1ccb218e134093\",\n \"score\": \"0.6643096\",\n \"text\": \"def make(let_expression); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a4727132c96541e82c912b0ad68258a5\",\n \"score\": \"0.6505693\",\n \"text\": \"def BlockNode(opening, block_var, bodystmt); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"10c854f6525513974550266be55d2c50\",\n \"score\": \"0.638336\",\n \"text\": \"def _Block\\n\\n _save = self.pos\\n begin # sequence\\n while true # kleene\\n _tmp = apply(:_BlankLine)\\n break unless _tmp\\n end\\n _tmp = true # end kleene\\n break unless _tmp\\n\\n begin # choice\\n _tmp = apply(:_BlockQuote)\\n break if _tmp\\n _tmp = apply(:_Verbatim)\\n break if _tmp\\n _tmp = apply(:_HorizontalRule)\\n break if _tmp\\n _tmp = apply(:_Heading)\\n break if _tmp\\n _tmp = apply(:_BulletList)\\n break if _tmp\\n _tmp = apply(:_Para)\\n break if _tmp\\n _tmp = apply(:_Plain)\\n end while false # end choice\\n\\n end while false\\n unless _tmp\\n self.pos = _save\\n end # end sequence\\n\\n set_failed_rule :_Block unless _tmp\\n return _tmp\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f76b853611ddb3196b6191983a1de\",\n \"score\": \"0.6372161\",\n \"text\": \"def transforming_body_expr=(_); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f76b853611ddb3196b6191983a1de\",\n \"score\": \"0.6372161\",\n \"text\": \"def transforming_body_expr=(_); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e47955358bc64af767046637b8dddf55\",\n \"score\": \"0.63119316\",\n \"text\": \"def parse_block_exps\\n pos = position\\n ws\\n exps = E[pos]\\n while ret = parse_defexp\\n exps << ret\\n end\\n return exps\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2d44cc938eecdad2fd253d5a34c5f442\",\n \"score\": \"0.63090473\",\n \"text\": \"def transforming_body_expr; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2d44cc938eecdad2fd253d5a34c5f442\",\n \"score\": \"0.63090473\",\n \"text\": \"def transforming_body_expr; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c31f5b0b8044a1790933d408d879d8c9\",\n \"score\": \"0.62725466\",\n \"text\": \"def code_block(syntax, &plaintext)\\n preserve { code(syntax.to_s, &plaintext) }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9fb95b45f2495ab4fa6b26baf59f0cbe\",\n \"score\": \"0.62457186\",\n \"text\": \"def BEGINBlock(lbrace, statements); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e54e7187b1fd0fdabbef80a5dfa57ad1\",\n \"score\": \"0.62355804\",\n \"text\": \"def visit_block(node); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1836a347f3f3c745930e50117b39d4d6\",\n \"score\": \"0.623343\",\n \"text\": \"def block_code(code, language)\\n \\\"```#{language}\\\\n#{code.strip}\\\\n```\\\" + NEW_BLOCK\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c1b419b550b9bb695ec901b56fc4fcf6\",\n \"score\": \"0.6220687\",\n \"text\": \"def ²; block_2ary end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"edd4b105a06f76a72191872de9768a79\",\n \"score\": \"0.6199745\",\n \"text\": \"def build_basic_blocks; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b684d98170f92145866dab0e9d732bf1\",\n \"score\": \"0.6161734\",\n \"text\": \"def transform_block(exp)\\n if exp && exp[0] == :iter\\n (exp.length-1).times do |i|\\n expr = exp[i+1]\\n #find the block\\n if expr && expr.length && expr[0] == :block\\n transform_ast exp if rewrite_bind? expr,expr[1]\\n end\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f24f55baeaf2f64c086565d5cc4f22fe\",\n \"score\": \"0.6158861\",\n \"text\": \"def gen_block_p!(p)\\n emit! \\\"#{p.type_node.p_type} \\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd13e40f04c11ad5d30d49f94568049d\",\n \"score\": \"0.61234206\",\n \"text\": \"def inner_expr\\n signal('expr')\\n # puts \\\"token: #{@token.value}\\\".yellow\\n if @token.type == :begin_environment\\n begin_token = @token.value\\n end_token = begin_token.gsub('begin', 'end')\\n environment(end_token)\\n elsif @token.value =~ /\\\\\\\\[a-zA-Z].*/\\n macro\\n elsif @token.value[0] != '\\\\\\\\' and @token.value[0] != '\\\\\\\\['\\n text_sequence\\n else\\n # do nothing\\n end\\n signal '-- exit expression'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"46ed489e5957a7d305b6a558e1d692e3\",\n \"score\": \"0.611818\",\n \"text\": \"def block_quote(quote)\\n \\\"> \\\" + quote.strip.gsub(\\\"\\\\n\\\", \\\"\\\\n> \\\") + NEW_BLOCK\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"30a21f2e8d3c892371ff20a2a2b4d2c6\",\n \"score\": \"0.611395\",\n \"text\": \"def Statements(body); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5dd4261acf120f2f3c3664ef37f2ba8e\",\n \"score\": \"0.61137724\",\n \"text\": \"def block\\n\\t\\tdeclaration_nodes = declarations\\n\\t\\tcompound_statement_node = compound_statement\\n\\t\\tBlock.new(declaration_nodes, compound_statement_node)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"45aedd9dc7f30ae8eb2beb551ed103d6\",\n \"score\": \"0.6085719\",\n \"text\": \"def blanky_code_block!(input)\\n input.gsub!(REGEX_CODE_BLOCK) do\\n data = $LAST_MATCH_INFO\\n ticks = b(:ticks, data: data)\\n lang = b(:lang, data: data)\\n\\n if strip_code_blocks?\\n prettify? ? \\\"\\\" : ticks + lang + \\\"\\\\n\\\" + b(:code, data: data) + \\\"\\\\n\\\" + ticks\\n else\\n ticks + lang + \\\"\\\\n\\\" + m(:code, data: data) + \\\"\\\\n\\\" + ticks\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dc27ee5eae810a9c7ec980d80a2c5b75\",\n \"score\": \"0.6073663\",\n \"text\": \"def add_make_block(res,level)\\n res << \\\" \\\" * level*3\\n res << Low2C.make_name(self) << \\\"();\\\\n\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1ee2226743e1ca30e572cac2ab773d91\",\n \"score\": \"0.6067644\",\n \"text\": \"def block_node=(_); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1ee2226743e1ca30e572cac2ab773d91\",\n \"score\": \"0.6067644\",\n \"text\": \"def block_node=(_); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"82f2af4c85921338aa9887dd12c5a882\",\n \"score\": \"0.60587066\",\n \"text\": \"def create_block_from_dup_alt(alt)\\n nalt = GrammarAST.dup_tree_no_actions(alt, nil)\\n blk = self.attr_ast_factory.make((ASTArray.new(3)).add(self.attr_ast_factory.create(BLOCK, \\\"BLOCK\\\")).add(nalt).add(self.attr_ast_factory.create(EOB, \\\"\\\")))\\n return blk\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f0724c094e43ae15560f3d52210bed1c\",\n \"score\": \"0.60562706\",\n \"text\": \"def new_block name\\n new_b = Block.new( name , @function , @next )\\n @next = new_b\\n return new_b\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f7d5cac6daf094d59c11a8e2cf901828\",\n \"score\": \"0.6051015\",\n \"text\": \"def process_block(exp)\\n Block.new(*exp.map { |exp| process(exp) })\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1cce5315c8c1ae8806ab43f28473da3e\",\n \"score\": \"0.6049487\",\n \"text\": \"def translate_block(sexp)\\n sexps = sexp.drop(1).map { |s| translate_generic_sexp s }\\n filtered_stmts(*sexps).with_value_of sexps.last\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cd6f347c4bd64ff5e26c3598a7ba0504\",\n \"score\": \"0.6049264\",\n \"text\": \"def compile_interpolated_plain(node); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cd6f347c4bd64ff5e26c3598a7ba0504\",\n \"score\": \"0.6049264\",\n \"text\": \"def compile_interpolated_plain(node); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc7c69e40a66ec8b135ee5c4f7f1ca7d\",\n \"score\": \"0.6033279\",\n \"text\": \"def block_node; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc7c69e40a66ec8b135ee5c4f7f1ca7d\",\n \"score\": \"0.6033279\",\n \"text\": \"def block_node; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc7c69e40a66ec8b135ee5c4f7f1ca7d\",\n \"score\": \"0.6033279\",\n \"text\": \"def block_node; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc7c69e40a66ec8b135ee5c4f7f1ca7d\",\n \"score\": \"0.6033279\",\n \"text\": \"def block_node; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0993287632f69873b50917891718e738\",\n \"score\": \"0.60238415\",\n \"text\": \"def block_style_block(factory, cmd)\\n factory.programbox() {\\n text \\\"Running code from a block\\\"\\n height 15\\n width 30\\n command {\\n puts 'foo block'\\n sleep 2\\n puts 'bar block'\\n sleep 2\\n puts 'baz block'\\n }\\n }\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3a05df17a588208b3b5b6969a0d70d01\",\n \"score\": \"0.6011341\",\n \"text\": \"def code_block(input)\\n \\n input.gsub!(/^`{3} *([^\\\\n]+)?\\\\n(.+?)\\\\n`{3}/m) do\\n caption = nil\\n options = $1 || ''\\n lang = nil\\n str = $2\\n \\n if options =~ AllOptions\\n lang = $1\\n caption = \\\"#{$2}\\\\n#{$4 || 'link'}\\\"\\n elsif options =~ LangCaption\\n lang = $1\\n caption = \\\"#{$2}\\\\n\\\"\\n end\\n \\n if str.match(/\\\\A( {4}|\\\\t)/)\\n str = str.gsub(/^( {4}|\\\\t)/, '')\\n end\\n \\n render_octopress_like_code_block(lang, str, caption, options)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e997d167464be890f1d0945e288b7aa6\",\n \"score\": \"0.6007835\",\n \"text\": \"def block_node\\n parent if block_literal?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7f04905c21f90d601f0d9a07558cb95f\",\n \"score\": \"0.59984887\",\n \"text\": \"def create_block(line)\\r\\n # Gather variables\\r\\n elements = line.split('|')\\r\\n line_num = elements[0]\\r\\n last_hash = elements[1]\\r\\n transactors = elements[2]\\r\\n time_val = elements[3]\\r\\n end_hash = elements[4]\\r\\n # Return Block made with variables\\r\\n Block.new(line_num, last_hash, transactors, time_val, end_hash)\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c840ab704667cbe42e1e15efd5579ef\",\n \"score\": \"0.5970075\",\n \"text\": \"def expression; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c840ab704667cbe42e1e15efd5579ef\",\n \"score\": \"0.5970075\",\n \"text\": \"def expression; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c840ab704667cbe42e1e15efd5579ef\",\n \"score\": \"0.5970075\",\n \"text\": \"def expression; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c840ab704667cbe42e1e15efd5579ef\",\n \"score\": \"0.5970075\",\n \"text\": \"def expression; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c840ab704667cbe42e1e15efd5579ef\",\n \"score\": \"0.5970075\",\n \"text\": \"def expression; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c840ab704667cbe42e1e15efd5579ef\",\n \"score\": \"0.5970075\",\n \"text\": \"def expression; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f6ab1163f45dd463a552c9a41c365bcc\",\n \"score\": \"0.5954181\",\n \"text\": \"def process_block(exp)\\n nodes = t(:block, CType.unknown)\\n until exp.empty? do\\n nodes << process(exp.shift)\\n end\\n nodes\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"21c0d537b9de21be82c535475c112a83\",\n \"score\": \"0.59349024\",\n \"text\": \"def new_block(x, y, z, a, b)\\n @chain.push(Block.new(x, y, z, a, b))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"98e7f4016c8e4a3e76b55e6794bac400\",\n \"score\": \"0.59091336\",\n \"text\": \"def process_block_token(tk); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"97856996239a133ce18a78e8ba569f5f\",\n \"score\": \"0.58904326\",\n \"text\": \"def new_block new_name\\n new_b = Block.new( new_name , @blocks.first.method )\\n index = @blocks.index( @current )\\n @blocks.insert( index + 1 , new_b ) # + one because we want the ne after the insert_at\\n return new_b\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1614d7445a0607df670819b1a640755e\",\n \"score\": \"0.5884313\",\n \"text\": \"def on_brace_block(block_var, statements); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"24501935a0e7d3d6708912690014e4ba\",\n \"score\": \"0.58820814\",\n \"text\": \"def negate_iife_block; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1535c9ca7fbd4021ab9bf1f19afb7769\",\n \"score\": \"0.58805084\",\n \"text\": \"def add_expr_literal(src, code)\\n src << '' << h(code) << ''\\n src << '' if block_opener?(code)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"21740799cd962f60eb3dcbd6910427bc\",\n \"score\": \"0.5865654\",\n \"text\": \"def block_code(code, _language)\\n \\\" #{code} \\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5393a25622e9f18ff0e06445d1eb319b\",\n \"score\": \"0.5863697\",\n \"text\": \"def as_comment_body\\n\\t\\tcomment = \\\"%s '%s': { \\\" % [ self.tagname, self.name ]\\n\\t\\tif self.methodchain\\n\\t\\t\\tcomment << \\\"template.%s%s\\\" % [ self.identifiers.first, self.methodchain ]\\n\\t\\telse\\n\\t\\t\\tcomment << self.literal\\n\\t\\tend\\n\\t\\tcomment << \\\" }\\\"\\n\\t\\tcomment << \\\" with format: %p\\\" % [ self.format ] if self.format\\n\\n\\t\\treturn comment\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"72bd181363a422c04deb556f56163c20\",\n \"score\": \"0.5862568\",\n \"text\": \"def create_block_temporary(args, body, callsite_block=nil)\\n @temporary_counter += 1\\n name = current_temporary('B-')\\n if callsite_block\\n new_proc = LaserProc.new(args, body, @graph, callsite_block)\\n else\\n new_proc = LaserProc.new(args, body)\\n end\\n binding = Bindings::BlockBinding.new(name, nil)\\n add_instruction(:assign, binding, new_proc)\\n [binding, new_proc]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5aca6861230c5a2ecb708dfa0c8805a9\",\n \"score\": \"0.5852094\",\n \"text\": \"def expressions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5aca6861230c5a2ecb708dfa0c8805a9\",\n \"score\": \"0.5852094\",\n \"text\": \"def expressions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5aca6861230c5a2ecb708dfa0c8805a9\",\n \"score\": \"0.5852094\",\n \"text\": \"def expressions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5aca6861230c5a2ecb708dfa0c8805a9\",\n \"score\": \"0.5852094\",\n \"text\": \"def expressions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5aca6861230c5a2ecb708dfa0c8805a9\",\n \"score\": \"0.5852094\",\n \"text\": \"def expressions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5aca6861230c5a2ecb708dfa0c8805a9\",\n \"score\": \"0.5852094\",\n \"text\": \"def expressions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a04b0fdba4f231fb82dd9a197f5654da\",\n \"score\": \"0.58501923\",\n \"text\": \"def on_brace_block(params, body)\\n return Token::BlockToken.new(\\n :parameters => params,\\n :value => body,\\n :line => lineno,\\n :column => column,\\n :type => :block,\\n :code => code(lineno)\\n )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2263e4c1c2a4cbc3c0cbffcb33264d89\",\n \"score\": \"0.5847156\",\n \"text\": \"def add_make_block(res,level)\\n self.statement.add_make_block(res,level)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a92cebb7da9d72f4fcf9ed7716d071fc\",\n \"score\": \"0.5833989\",\n \"text\": \"def visit_embexpr_beg(node); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"52deaf95579029396421b70c70d2b439\",\n \"score\": \"0.5827229\",\n \"text\": \"def rewrite_block(exp)\\n # Take the leading atom (:block) of the s-expression, we'll put it back\\n # on before returning. This way, the rotate independent code doesn't\\n # have to worry about the leading atom for the original sexp.\\n atom = exp.shift\\n \\n # Preserve the return statement – in ruby the last statement\\n # is always the returned value. It cannot necessarily be\\n # re-ordered.\\n return_exp = exp.pop\\n \\n # Rotate the remaining statements and then replace the original\\n # atom and return s-expressions.\\n rotate_independent(exp).unshift(atom).push(return_exp)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"309f1729cee239f8a7d7423d7447a466\",\n \"score\": \"0.5803093\",\n \"text\": \"def block_contents(node, context); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d2f1beca51661d0fd6732c0a5f85a4a3\",\n \"score\": \"0.5801717\",\n \"text\": \"def block_code\\n \\\"```ruby\\\\n#{Lorem.sentence(word_count: 1)}\\\\n```\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9418dcf1f350cca7d524dc8c61743373\",\n \"score\": \"0.5789063\",\n \"text\": \"def block_in_template; \\\"<% \\\" + yield + \\\" %>\\\"; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd95d9d636d26e4d02f944296697e128\",\n \"score\": \"0.57877195\",\n \"text\": \"def visit_block_var(node); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e8f4a54504bab0d51be081144f34ae4\",\n \"score\": \"0.5784012\",\n \"text\": \"def inline_template_block(content)\\n Proc.new{content}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c2549a7c61777966686af332641b6e72\",\n \"score\": \"0.57805204\",\n \"text\": \"def test_text_block_using_variable\\n @method.write_expression \\\"a = 5\\\", 5\\n @method.write_expression \\\"b = 0\\\", 0\\n @method.write_expression \\\"a.times do\\\\nb += a\\\\nend\\\", 5 #result is number of times \\n @method.write_expression \\\"b\\\", 25\\n expected = <<-EOF\\n def test_1\\n a = 5\\n b = 0\\n a.times do\\n b += a\\n end\\n assert_equal(25, b)\\n end\\n\\n EOF\\n assert_equal expected, @method.text\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"41ed4f375c62d023abd28eed49c954da\",\n \"score\": \"0.5771002\",\n \"text\": \"def syntaxer(&block)\\n self.instance_eval(&block)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"90c62be12087cb83178d318a5d0480e5\",\n \"score\": \"0.57658744\",\n \"text\": \"def body()\\n @@bodyExpression\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"381a286b0ca46424966114d99c5fcabe\",\n \"score\": \"0.57556766\",\n \"text\": \"def visit_blockarg(node); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"97c2c86768f1d402797bdbc498f5413b\",\n \"score\": \"0.5753781\",\n \"text\": \"def block_runner_factory(expression)\\n with_dsl(expression, &block)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"44b073cfc9821518c5390c14241272c0\",\n \"score\": \"0.5749883\",\n \"text\": \"def visit_Block(node)\\n\\t\\tGLOBAL_SCOPE[node.name.value] = node.compoundStatement\\n\\t\\tvisit(node.compoundStatement)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0d17dc9e75512a96e450c18ae8e35a16\",\n \"score\": \"0.5748533\",\n \"text\": \"def plsql_block\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 14 )\\n return_value = PlsqlBlockReturnValue.new\\n\\n # $rule.start = the first token seen before matching\\n return_value.start = @input.look\\n plsql_block_start_index = @input.index\\n\\n root_0 = nil\\n __LLABEL104__ = nil\\n __RLABEL106__ = nil\\n string_literal107 = nil\\n string_literal109 = nil\\n string_literal111 = nil\\n string_literal113 = nil\\n label_name105 = nil\\n declare_spec108 = nil\\n seq_of_statements110 = nil\\n exception_handler112 = nil\\n label_name114 = nil\\n\\n tree_for_LLABEL104 = nil\\n tree_for_RLABEL106 = nil\\n tree_for_string_literal107 = nil\\n tree_for_string_literal109 = nil\\n tree_for_string_literal111 = nil\\n tree_for_string_literal113 = nil\\n\\n success = false # flag used for memoization\\n\\n begin\\n # rule memoization\\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\\n success = true\\n return return_value\\n end\\n root_0 = @adaptor.create_flat_list\\n\\n\\n # at line 125:4: ( LLABEL label_name RLABEL )? ( ( 'DECLARE' )? ( declare_spec )+ )? ( 'BEGIN' ) seq_of_statements ( 'EXCEPTION' ( exception_handler )+ )? ( 'END' ( label_name )? )\\n # at line 125:4: ( LLABEL label_name RLABEL )?\\n alt_22 = 2\\n look_22_0 = @input.peek( 1 )\\n\\n if ( look_22_0 == LLABEL )\\n alt_22 = 1\\n end\\n case alt_22\\n when 1\\n # at line 125:6: LLABEL label_name RLABEL\\n __LLABEL104__ = match( LLABEL, TOKENS_FOLLOWING_LLABEL_IN_plsql_block_661 )\\n if @state.backtracking == 0\\n\\n tree_for_LLABEL104 = @adaptor.create_with_payload( __LLABEL104__ )\\n @adaptor.add_child( root_0, tree_for_LLABEL104 )\\n\\n end\\n @state.following.push( TOKENS_FOLLOWING_label_name_IN_plsql_block_663 )\\n label_name105 = label_name\\n @state.following.pop\\n if @state.backtracking == 0\\n @adaptor.add_child( root_0, label_name105.tree )\\n end\\n __RLABEL106__ = match( RLABEL, TOKENS_FOLLOWING_RLABEL_IN_plsql_block_665 )\\n if @state.backtracking == 0\\n\\n tree_for_RLABEL106 = @adaptor.create_with_payload( __RLABEL106__ )\\n @adaptor.add_child( root_0, tree_for_RLABEL106 )\\n\\n end\\n\\n end\\n # at line 126:3: ( ( 'DECLARE' )? ( declare_spec )+ )?\\n alt_25 = 2\\n look_25_0 = @input.peek( 1 )\\n\\n if ( look_25_0.between?( ID, DOUBLEQUOTED_STRING ) || look_25_0 == T__50 || look_25_0 == T__60 || look_25_0.between?( T__103, T__104 ) || look_25_0 == T__161 )\\n alt_25 = 1\\n end\\n case alt_25\\n when 1\\n # at line 126:5: ( 'DECLARE' )? ( declare_spec )+\\n # at line 126:5: ( 'DECLARE' )?\\n alt_23 = 2\\n look_23_0 = @input.peek( 1 )\\n\\n if ( look_23_0 == T__60 )\\n alt_23 = 1\\n end\\n case alt_23\\n when 1\\n # at line 126:7: 'DECLARE'\\n string_literal107 = match( T__60, TOKENS_FOLLOWING_T__60_IN_plsql_block_676 )\\n if @state.backtracking == 0\\n\\n tree_for_string_literal107 = @adaptor.create_with_payload( string_literal107 )\\n @adaptor.add_child( root_0, tree_for_string_literal107 )\\n\\n end\\n\\n end\\n # at file 126:20: ( declare_spec )+\\n match_count_24 = 0\\n while true\\n alt_24 = 2\\n look_24_0 = @input.peek( 1 )\\n\\n if ( look_24_0.between?( ID, DOUBLEQUOTED_STRING ) || look_24_0 == T__50 || look_24_0.between?( T__103, T__104 ) || look_24_0 == T__161 )\\n alt_24 = 1\\n\\n end\\n case alt_24\\n when 1\\n # at line 126:21: declare_spec\\n @state.following.push( TOKENS_FOLLOWING_declare_spec_IN_plsql_block_682 )\\n declare_spec108 = declare_spec\\n @state.following.pop\\n if @state.backtracking == 0\\n @adaptor.add_child( root_0, declare_spec108.tree )\\n end\\n\\n else\\n match_count_24 > 0 and break\\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\\n\\n eee = EarlyExit(24)\\n\\n\\n raise eee\\n end\\n match_count_24 += 1\\n end\\n\\n\\n end\\n # at line 127:3: ( 'BEGIN' )\\n # at line 127:5: 'BEGIN'\\n string_literal109 = match( T__55, TOKENS_FOLLOWING_T__55_IN_plsql_block_694 )\\n if @state.backtracking == 0\\n\\n tree_for_string_literal109 = @adaptor.create_with_payload( string_literal109 )\\n @adaptor.add_child( root_0, tree_for_string_literal109 )\\n\\n end\\n\\n @state.following.push( TOKENS_FOLLOWING_seq_of_statements_IN_plsql_block_700 )\\n seq_of_statements110 = seq_of_statements\\n @state.following.pop\\n if @state.backtracking == 0\\n @adaptor.add_child( root_0, seq_of_statements110.tree )\\n end\\n # at line 129:3: ( 'EXCEPTION' ( exception_handler )+ )?\\n alt_27 = 2\\n look_27_0 = @input.peek( 1 )\\n\\n if ( look_27_0 == T__61 )\\n alt_27 = 1\\n end\\n case alt_27\\n when 1\\n # at line 129:5: 'EXCEPTION' ( exception_handler )+\\n string_literal111 = match( T__61, TOKENS_FOLLOWING_T__61_IN_plsql_block_706 )\\n if @state.backtracking == 0\\n\\n tree_for_string_literal111 = @adaptor.create_with_payload( string_literal111 )\\n @adaptor.add_child( root_0, tree_for_string_literal111 )\\n\\n end\\n # at file 129:17: ( exception_handler )+\\n match_count_26 = 0\\n while true\\n alt_26 = 2\\n look_26_0 = @input.peek( 1 )\\n\\n if ( look_26_0 == T__63 )\\n alt_26 = 1\\n\\n end\\n case alt_26\\n when 1\\n # at line 129:19: exception_handler\\n @state.following.push( TOKENS_FOLLOWING_exception_handler_IN_plsql_block_710 )\\n exception_handler112 = exception_handler\\n @state.following.pop\\n if @state.backtracking == 0\\n @adaptor.add_child( root_0, exception_handler112.tree )\\n end\\n\\n else\\n match_count_26 > 0 and break\\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\\n\\n eee = EarlyExit(26)\\n\\n\\n raise eee\\n end\\n match_count_26 += 1\\n end\\n\\n\\n end\\n # at line 130:3: ( 'END' ( label_name )? )\\n # at line 130:5: 'END' ( label_name )?\\n string_literal113 = match( T__54, TOKENS_FOLLOWING_T__54_IN_plsql_block_723 )\\n if @state.backtracking == 0\\n\\n tree_for_string_literal113 = @adaptor.create_with_payload( string_literal113 )\\n @adaptor.add_child( root_0, tree_for_string_literal113 )\\n\\n end\\n # at line 130:11: ( label_name )?\\n alt_28 = 2\\n look_28_0 = @input.peek( 1 )\\n\\n if ( look_28_0.between?( ID, DOUBLEQUOTED_STRING ) )\\n alt_28 = 1\\n end\\n case alt_28\\n when 1\\n # at line 130:13: label_name\\n @state.following.push( TOKENS_FOLLOWING_label_name_IN_plsql_block_727 )\\n label_name114 = label_name\\n @state.following.pop\\n if @state.backtracking == 0\\n @adaptor.add_child( root_0, label_name114.tree )\\n end\\n\\n end\\n\\n # - - - - - - - rule clean up - - - - - - - -\\n return_value.stop = @input.look( -1 )\\n\\n if @state.backtracking == 0\\n\\n return_value.tree = @adaptor.rule_post_processing( root_0 )\\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\\n\\n end\\n success = true\\n\\n rescue ANTLR3::Error::RecognitionError => re\\n report_error(re)\\n recover(re)\\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 14 )\\n memoize( __method__, plsql_block_start_index, success ) if @state.backtracking > 0\\n\\n end\\n \\n return return_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"09596f8c43b986ba5dbcd7454a3ebd8b\",\n \"score\": \"0.574535\",\n \"text\": \"def block\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 10 )\\n return_value = BlockReturnValue.new\\n\\n # $rule.start = the first token seen before matching\\n return_value.start = @input.look\\n\\n root_0 = nil\\n paragraph47 = nil\\n div48 = nil\\n table49 = nil\\n\\n\\n begin\\n # at line 150:2: ( paragraph | div | table )\\n alt_10 = 3\\n look_10_0 = @input.peek( 1 )\\n\\n if ( look_10_0 == OPENING_TAG )\\n case look_10 = @input.peek( 2 )\\n when P then alt_10 = 1\\n when DIV then alt_10 = 2\\n when TABLE then alt_10 = 3\\n else\\n raise NoViableAlternative( \\\"\\\", 10, 1 )\\n end\\n else\\n raise NoViableAlternative( \\\"\\\", 10, 0 )\\n end\\n case alt_10\\n when 1\\n root_0 = @adaptor.create_flat_list\\n\\n\\n # at line 150:4: paragraph\\n @state.following.push( TOKENS_FOLLOWING_paragraph_IN_block_351 )\\n paragraph47 = paragraph\\n @state.following.pop\\n @adaptor.add_child( root_0, paragraph47.tree )\\n\\n when 2\\n root_0 = @adaptor.create_flat_list\\n\\n\\n # at line 151:4: div\\n @state.following.push( TOKENS_FOLLOWING_div_IN_block_356 )\\n div48 = div\\n @state.following.pop\\n @adaptor.add_child( root_0, div48.tree )\\n\\n when 3\\n root_0 = @adaptor.create_flat_list\\n\\n\\n # at line 152:4: table\\n @state.following.push( TOKENS_FOLLOWING_table_IN_block_361 )\\n table49 = table\\n @state.following.pop\\n @adaptor.add_child( root_0, table49.tree )\\n\\n end# - - - - - - - rule clean up - - - - - - - -\\n return_value.stop = @input.look( -1 )\\n\\n\\n return_value.tree = @adaptor.rule_post_processing( root_0 )\\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\\n\\n rescue ANTLR3::Error::RecognitionError => re\\n report_error(re)\\n recover(re)\\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 10 )\\n\\n end\\n \\n return return_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a347cc68889c6fc304e79d496f5181ce\",\n \"score\": \"0.57394993\",\n \"text\": \"def filtered_block(*args)\\n #s(:block, *expand_stmts(args))\\n s(:block, *args)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53a17f3544b3747a07bb1f9de5094a80\",\n \"score\": \"0.57327515\",\n \"text\": \"def add_content(parent, expression, &block)\\n if block_given? && expression.is_a?(ParentExpression)\\n dsl_stack.push(expression.class.dsl)\\n parent_stack.push(parent) \\n expression.add_content(parent, &block)\\n parent_stack.pop\\n dsl_stack.pop\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f85ec52e5d7c7b0c9e9ea6459cd65625\",\n \"score\": \"0.5723403\",\n \"text\": \"def begin_block\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 52 )\\n return_value = BeginBlockReturnValue.new\\n\\n # $rule.start = the first token seen before matching\\n return_value.start = @input.look\\n begin_block_start_index = @input.index\\n\\n root_0 = nil\\n string_literal456 = nil\\n string_literal458 = nil\\n string_literal460 = nil\\n seq_of_statements457 = nil\\n exception_handler459 = nil\\n\\n tree_for_string_literal456 = nil\\n tree_for_string_literal458 = nil\\n tree_for_string_literal460 = nil\\n\\n success = false # flag used for memoization\\n\\n begin\\n # rule memoization\\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\\n success = true\\n return return_value\\n end\\n root_0 = @adaptor.create_flat_list\\n\\n\\n # at line 386:4: 'BEGIN' ( seq_of_statements ) ( 'EXCEPTION' ( exception_handler )+ )? 'END'\\n string_literal456 = match( T__55, TOKENS_FOLLOWING_T__55_IN_begin_block_2551 )\\n if @state.backtracking == 0\\n\\n tree_for_string_literal456 = @adaptor.create_with_payload( string_literal456 )\\n @adaptor.add_child( root_0, tree_for_string_literal456 )\\n\\n end\\n # at line 387:3: ( seq_of_statements )\\n # at line 387:5: seq_of_statements\\n @state.following.push( TOKENS_FOLLOWING_seq_of_statements_IN_begin_block_2557 )\\n seq_of_statements457 = seq_of_statements\\n @state.following.pop\\n if @state.backtracking == 0\\n @adaptor.add_child( root_0, seq_of_statements457.tree )\\n end\\n\\n # at line 388:3: ( 'EXCEPTION' ( exception_handler )+ )?\\n alt_108 = 2\\n look_108_0 = @input.peek( 1 )\\n\\n if ( look_108_0 == T__61 )\\n alt_108 = 1\\n end\\n case alt_108\\n when 1\\n # at line 388:5: 'EXCEPTION' ( exception_handler )+\\n string_literal458 = match( T__61, TOKENS_FOLLOWING_T__61_IN_begin_block_2565 )\\n if @state.backtracking == 0\\n\\n tree_for_string_literal458 = @adaptor.create_with_payload( string_literal458 )\\n @adaptor.add_child( root_0, tree_for_string_literal458 )\\n\\n end\\n # at file 388:17: ( exception_handler )+\\n match_count_107 = 0\\n while true\\n alt_107 = 2\\n look_107_0 = @input.peek( 1 )\\n\\n if ( look_107_0 == T__63 )\\n alt_107 = 1\\n\\n end\\n case alt_107\\n when 1\\n # at line 388:19: exception_handler\\n @state.following.push( TOKENS_FOLLOWING_exception_handler_IN_begin_block_2569 )\\n exception_handler459 = exception_handler\\n @state.following.pop\\n if @state.backtracking == 0\\n @adaptor.add_child( root_0, exception_handler459.tree )\\n end\\n\\n else\\n match_count_107 > 0 and break\\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\\n\\n eee = EarlyExit(107)\\n\\n\\n raise eee\\n end\\n match_count_107 += 1\\n end\\n\\n\\n end\\n string_literal460 = match( T__54, TOKENS_FOLLOWING_T__54_IN_begin_block_2579 )\\n if @state.backtracking == 0\\n\\n tree_for_string_literal460 = @adaptor.create_with_payload( string_literal460 )\\n @adaptor.add_child( root_0, tree_for_string_literal460 )\\n\\n end\\n # - - - - - - - rule clean up - - - - - - - -\\n return_value.stop = @input.look( -1 )\\n\\n if @state.backtracking == 0\\n\\n return_value.tree = @adaptor.rule_post_processing( root_0 )\\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\\n\\n end\\n success = true\\n\\n rescue ANTLR3::Error::RecognitionError => re\\n report_error(re)\\n recover(re)\\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 52 )\\n memoize( __method__, begin_block_start_index, success ) if @state.backtracking > 0\\n\\n end\\n \\n return return_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"db4f59696e2c061c8c496b4e25a60f04\",\n \"score\": \"0.57210976\",\n \"text\": \"def compound_statement\\n eat :begin\\n nodes = statement_list\\n eat :end\\n root = Compound.new\\n root.children = nodes\\n root\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8830f8724623f4951dc43ecb4fc5fd89\",\n \"score\": \"0.57187283\",\n \"text\": \"def reduce_begin_expression(_production, _range, _tokens, theChildren)\\n SkmSequencingBlock.new(theChildren[2])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e901a61dc8f9a681ddb972ade147f6de\",\n \"score\": \"0.5717369\",\n \"text\": \"def compile_block(scope, *exp)\\n compile_do(scope, *exp[1])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a7a62b3fcea4ff2985e2a26e93f6a4d0\",\n \"score\": \"0.57171893\",\n \"text\": \"def create_first_block\\n\\ti = 0\\n\\tinstance_variable_set(\\\"@b#{i}\\\", Block.first(\\\"Genesis\\\")) #Méta programmation\\n\\tLEDGER << @b0\\n\\tpp @b0\\n\\tadd_block\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"712a25c3630be5f344b895a8cce4868b\",\n \"score\": \"0.57171315\",\n \"text\": \"def expr; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"712a25c3630be5f344b895a8cce4868b\",\n \"score\": \"0.57171315\",\n \"text\": \"def expr; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"712a25c3630be5f344b895a8cce4868b\",\n \"score\": \"0.57171315\",\n \"text\": \"def expr; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"712a25c3630be5f344b895a8cce4868b\",\n \"score\": \"0.57171315\",\n \"text\": \"def expr; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"712a25c3630be5f344b895a8cce4868b\",\n \"score\": \"0.57171315\",\n \"text\": \"def expr; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"712a25c3630be5f344b895a8cce4868b\",\n \"score\": \"0.57171315\",\n \"text\": \"def expr; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"712a25c3630be5f344b895a8cce4868b\",\n \"score\": \"0.57171315\",\n \"text\": \"def expr; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ab38ee13c5bed2a3242b66c6c7382e8c\",\n \"score\": \"0.5709922\",\n \"text\": \"def render_block(markdown)\\n rootNode = parser.parse(markdown)\\n if rootNode\\n return rootNode.render\\n else\\n error_line = markdown.split(\\\"\\\\n\\\")[parser.failure_line-1]\\n raise SyntaxError.new \\\"Alongslide syntax error around: \\\\\\\"#{error_line}\\\\\\\"\\\"\\n end\\n rescue\\n raise SyntaxError.new \\\"Unknown Alongslide syntax error\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6b564ed5506998f1685292d45c20fb1e\",\n \"score\": \"0.5708929\",\n \"text\": \"def rule10(block)\\r\\n\\treturn\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f9d135ba8f66ad1f2387bbe414adf068\",\n \"score\": \"0.57057446\",\n \"text\": \"def to_vool\\n block_name = \\\"implicit_block_#{object_id}\\\".to_sym\\n block = Vool::BlockStatement.new( @args.dup , @body.to_vool)\\n assign = Vool::LocalAssignment.new( block_name , block)\\n sendd = @send.to_vool\\n if(sendd.is_a?(Vool::Statements))\\n ret = sendd\\n sendd = sendd.last\\n else\\n ret = Vool::Statements.new([sendd])\\n end\\n sendd.arguments << LocalVariable.new(block_name).to_vool\\n ret.prepend(assign)\\n ret\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb4698bf22ad5c5e1bc0780fc0e805f7\",\n \"score\": \"0.5705531\",\n \"text\": \"def add_block(mode = nil, name = :\\\"\\\", &ruby_block)\\n # Creates the block.\\n block = High.make_block(mode,name,&ruby_block)\\n # Adds it as a statement.\\n self.add_statement(block)\\n # Use its return value.\\n return block.return_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c7523ff01bc666bfc03f7882ad84086\",\n \"score\": \"0.5694298\",\n \"text\": \"def blk( text, deep_code = false )\\n return text if text =~ /<[0-9]+>/\\n \\n plain = text !~ /\\\\A[#*> ]/\\n\\n # skip blocks that are complex HTML\\n if text =~ /^<\\\\/?(\\\\w+).*>/ and not SIMPLE_HTML_TAGS.include? $1\\n text\\n else\\n # search for indentation levels\\n text.strip!\\n if text.empty?\\n text\\n else\\n code_blk = nil\\n text.gsub!( /((?:\\\\n(?:\\\\n^ +[^\\\\n]*)+)+)/m ) do |iblk|\\n flush_left iblk\\n blocks iblk, plain\\n iblk.gsub( /^(\\\\S)/, \\\"\\\\\\\\1\\\" )\\n if plain\\n code_blk = iblk; \\\"\\\"\\n else\\n iblk\\n end\\n end\\n block_applied = 0 \\n @rules.each do |rule_name|\\n block_applied += 1 if ( rule_name.to_s.match /^block_/ and method( rule_name ).call( text ) )\\n end\\n if block_applied.zero?\\n if deep_code\\n text = \\\"\\\\t#{ text }
\\\\n\\\"\\n else\\n text = \\\"\\\\t#{ text }
\\\\n\\\"\\n end\\n end\\n # hard_break text\\n text << \\\"\\\\n#{ code_blk }\\\"\\n end\\n return text\\n end\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9102fa935c7ce0e04861a363f1fd9b89\",\n \"score\": \"0.56903607\",\n \"text\": \"def block\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 16 )\\n\\n begin\\n # at line 100:8: ( paragraph | div | table )\\n alt_17 = 3\\n look_17_0 = @input.peek( 1 )\\n\\n if ( look_17_0 == TAG )\\n look_17_1 = @input.peek( 2 )\\n\\n if ( look_17_1 == DOWN )\\n case look_17 = @input.peek( 3 )\\n when P then alt_17 = 1\\n when DIV then alt_17 = 2\\n when TABLE then alt_17 = 3\\n else\\n raise NoViableAlternative( \\\"\\\", 17, 2 )\\n end\\n else\\n raise NoViableAlternative( \\\"\\\", 17, 1 )\\n end\\n else\\n raise NoViableAlternative( \\\"\\\", 17, 0 )\\n end\\n case alt_17\\n when 1\\n # at line 100:10: paragraph\\n @state.following.push( TOKENS_FOLLOWING_paragraph_IN_block_596 )\\n paragraph\\n @state.following.pop\\n\\n when 2\\n # at line 101:10: div\\n @state.following.push( TOKENS_FOLLOWING_div_IN_block_607 )\\n div\\n @state.following.pop\\n\\n when 3\\n # at line 102:10: table\\n @state.following.push( TOKENS_FOLLOWING_table_IN_block_618 )\\n table\\n @state.following.pop\\n\\n end\\n rescue ANTLR3::Error::RecognitionError => re\\n report_error(re)\\n recover(re)\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 16 )\\n\\n end\\n \\n return \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a973b709cc0d84320fbab5cfd9e19a24\",\n \"score\": \"0.56894106\",\n \"text\": \"def block_node\\n case sexp_type\\n when :method_add_block\\n self[2]\\n end\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":167,"cells":{"query_id":{"kind":"string","value":"51206b65ea5f271cd5ed4788b9fbb829"},"query":{"kind":"string","value":"Method returns the height of a given node"},"positive_passages":{"kind":"list like","value":[{"docid":"0f44950dd3d415b0015c756c9d1bf6e2","score":"0.78925395","text":"def height(node, height = 0)\n if node.left == nil && node.right == nil\n return height\n else\n left = 0\n right = 0\n left = height(node.left, height + 1) unless node.left == nil\n right = height(node.right, height + 1) unless node.right == nil\n if right == nil || left > right\n return left\n else\n return right\n end\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"0f44950dd3d415b0015c756c9d1bf6e2\",\n \"score\": \"0.78925395\",\n \"text\": \"def height(node, height = 0)\\n if node.left == nil && node.right == nil\\n return height\\n else\\n left = 0\\n right = 0\\n left = height(node.left, height + 1) unless node.left == nil\\n right = height(node.right, height + 1) unless node.right == nil\\n if right == nil || left > right\\n return left\\n else\\n return right\\n end\\n end\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"869c655c49b6097724314a6df1e40c34","score":"0.8766375","text":"def height node\n node&.height || 0 \n end","title":""},{"docid":"d5788284a1f144b6e217ac473c2f96a4","score":"0.8499755","text":"def height\n node['height']\n end","title":""},{"docid":"a8880cc3ebaddf749640a27560a353bf","score":"0.8470247","text":"def height\n return 0 if @root.nil?\n node = @root\n return height_helper(node)\n end","title":""},{"docid":"db0236afb7129d3b251b1db9037ae92d","score":"0.8437922","text":"def height\n return 0 if @root.nil?\n node = @root\n return height_helper(@root)\n end","title":""},{"docid":"a35632115c5d172ed8818e912d215c4b","score":"0.8396946","text":"def height()\n height_node(@root, 0)\n end","title":""},{"docid":"392da27a0effd2bba530518ba1a4a5a0","score":"0.8358313","text":"def height\n vy = nodes.map {|n| n.y}\n vy.max - vy.min\n end","title":""},{"docid":"4a33d7517b24f85ca9086afd8d8d23d5","score":"0.8291182","text":"def height(node)\n if node == nil\n return 0\n else\n left_height = height(node.left)\n right_height = height(node.right)\n if left_height >= right_height\n return 1 + left_height\n else\n return 1 + right_height\n end\n end\n end","title":""},{"docid":"3c2b38e949046f6bf4cae76958b41708","score":"0.8258234","text":"def height\n return 0 if @root == nil\n node = @root\n return height_recurssive(node, 1, 1)\n end","title":""},{"docid":"9b4b79caeb09989b582fb5d8b553a0ef","score":"0.8214026","text":"def height(node)\n return 0 if node.nil?\n left_height = height(node.left)\n right_height = height(node.right)\n [left_height, right_height].max + 1\nend","title":""},{"docid":"ebd53b2a3b5b586e0c26eccd88611be8","score":"0.8095185","text":"def height(node)\n return -1 unless node\n [height(node.left), height(node.right)].max + 1\nend","title":""},{"docid":"748ed053bf44c13ab9fdf2c800154540","score":"0.8093354","text":"def height\n current = @root \n return height_helper(current, 0)\n end","title":""},{"docid":"ecdeca966c9110185a4352fcb2b6c880","score":"0.80862665","text":"def nodeHeight\n return 0 if isLeaf?\n 1 + @children.collect { |child| child.nodeHeight }.max\n end","title":""},{"docid":"ecdeca966c9110185a4352fcb2b6c880","score":"0.80862665","text":"def nodeHeight\n return 0 if isLeaf?\n 1 + @children.collect { |child| child.nodeHeight }.max\n end","title":""},{"docid":"fa9e908b73aad5c5122c449fbb6a56af","score":"0.80776477","text":"def height\n height = 0\n current = @root\n return height_helper(current, height)\n end","title":""},{"docid":"04aadc90509875d8e35b968063a6b501","score":"0.80769145","text":"def height\n current = @root\n\n return 0 if current.nil?\n\n height_helper(current)\n end","title":""},{"docid":"cdc2c933d830a85ead50dfa95700175b","score":"0.80586725","text":"def height\n source_node[:height].to_i\n end","title":""},{"docid":"cdc2c933d830a85ead50dfa95700175b","score":"0.80586725","text":"def height\n source_node[:height].to_i\n end","title":""},{"docid":"e9d6f383dfe3c5161b66f99048f025c6","score":"0.8040672","text":"def height\n # raise NotImplementedError\n node = @root\n return 0 if node.nil?\n\n count_right = 0\n count_left = 0\n \n count_left = height_helper(node, 'left', count_left)\n count_right = height_helper(node, 'right', count_right)\n\n if count_right > count_left\n return count_right\n else\n return count_left\n end\n end","title":""},{"docid":"a323bc99c599c615ada185f1b9b674f0","score":"0.8040394","text":"def height(node = root)\n return -1 if node.nil?\n\n [height(node.left), height(node.right)].max + 1\n end","title":""},{"docid":"86a8c67d72edd45a86119a95dd7284f5","score":"0.803173","text":"def height(node)\n node.nil? ? 0 : 1 + max(height(node.left), height(node.right))\n end","title":""},{"docid":"be11dff9dcc35f980b1f0a53793ecb4e","score":"0.8019581","text":"def height\n return height_helper(@root, 0, 1)\n end","title":""},{"docid":"be11dff9dcc35f980b1f0a53793ecb4e","score":"0.8019581","text":"def height\n return height_helper(@root, 0, 1)\n end","title":""},{"docid":"a4c31ea353906063ac3be0c03875df33","score":"0.80006236","text":"def height\n current = @root\n height = 1\n return 0 if @root.nil?\n return height_helper(current,height)\n end","title":""},{"docid":"7f1a87f8a0d860b68c53062ef8d434dd","score":"0.79934025","text":"def height\n current = @root\n return 0 if @root.nil?\n\n return tree_height(current)\n \n end","title":""},{"docid":"e22d7b02115c7aa244f1bbeb409eb47b","score":"0.79877937","text":"def height\n counter = 0\n current_node = @top\n while !current_node.nil?\n counter += 1\n current_node = current_node.next_node\n end\n counter\n end","title":""},{"docid":"9b86df1663faa2f3f3e42ec0b20f9048","score":"0.79816824","text":"def height(node = @root)\n nodes = in_order_traversal\n nodes.map { |node| node.depth }.max\n end","title":""},{"docid":"12707505a4e0d2119e0faad6eb07894b","score":"0.7979628","text":"def height(node)\n node = find(node.data)\n return nil unless node\n\n queue = Queue.new.enq(@root)\n until queue.empty?\n curent_node = queue.deq\n queue.enq curent_node.left if curent_node.left\n queue.enq curent_node.right if curent_node.right\n end\n leaf = curent_node\n depth(leaf) - depth(node)\n end","title":""},{"docid":"132a2953d3f3b5c50ceae4b47bb5dfea","score":"0.79701585","text":"def height(node=@tree)\n node.nil? ? 0 : 1 + [self.height(node[:left]), self.height(node[:right])].max\n end","title":""},{"docid":"34cdf9d9265174a374622840b96e84e0","score":"0.7967167","text":"def height\n if @root.nil?\n return 0\n end\n\n current = @root\n\n height_helper(current)\n end","title":""},{"docid":"3b20c71d1be9030c62ae667655a66b7b","score":"0.79565525","text":"def height(node)\n # base condition when binary tree is empty\n return 0 if node.nil?\n\n [height(node.left_child), height(node.right_child)].max + 1\n end","title":""},{"docid":"6e2defde64588ae4c1205b581dc012a0","score":"0.79506767","text":"def height_node(node, height)\n heightLeft = 0\n heightRight = 0 \n\n if node.left != nil\n heightLeft = height_node(node.left, height+1) \n end\n\n if node.right != nil\n heightRight = height_node(node.right, height+1) \n end\n\n [heightLeft, heightRight, height].max \n end","title":""},{"docid":"7992946c74f8c47b70d24ef0572d96ee","score":"0.7946834","text":"def height\n _height(@root) - 1\n end","title":""},{"docid":"293430f40a4d26ad3cb1302082a6f021","score":"0.7937302","text":"def height\n return height_helper(@root, 0)\n end","title":""},{"docid":"b900cc189c1ef4be2126ea2ed5209ca9","score":"0.7924119","text":"def height\n return 0 if @root.nil?\n\n return height_helper(@root)\n end","title":""},{"docid":"42aa9d671450b70a631ee41e4781bbc1","score":"0.79094994","text":"def find_height\n return height(@root)\n end","title":""},{"docid":"fb544023bd905d72f70d1448cbbcc78c","score":"0.78871053","text":"def height(pointer = root)\n # Height is defined as the number of edges in longest path from a given node to a leaf node\n return -1 if pointer.nil?\n\n return p 'No such node' unless level_order.include?(pointer.data)\n\n height_from_left = height(pointer.left_child) + 1\n height_from_right = height(pointer.right_child) + 1\n height_from_left > height_from_right ? height_from_left : height_from_right\n end","title":""},{"docid":"6cce61f068c1e3f68cb416bf8556e99e","score":"0.78860444","text":"def height\n # return 0 if @root == nil\n\n height_helper(@root)\n end","title":""},{"docid":"455fdc91752986ec67776ee32b275038","score":"0.78842497","text":"def height\n return 0 if @root.nil?\n return height_helper(@root)\n end","title":""},{"docid":"455fdc91752986ec67776ee32b275038","score":"0.78842497","text":"def height\n return 0 if @root.nil?\n return height_helper(@root)\n end","title":""},{"docid":"455fdc91752986ec67776ee32b275038","score":"0.78842497","text":"def height\n return 0 if @root.nil?\n return height_helper(@root)\n end","title":""},{"docid":"f976f173e914b55ae8c2b79c33cd9b91","score":"0.78591526","text":"def height(node)\n return 0 if node.nil?\n return 1 + [height(node.left), height(node.right)].max\nend","title":""},{"docid":"fbb29b44f592e4d03f63fd8ee4c3dcf6","score":"0.7849064","text":"def height_node(data)\n node = find(data)\n height_tree(node)\n end","title":""},{"docid":"de1f58bd9f7598cc6b7202044b1a4d27","score":"0.7832018","text":"def height\n height = 0\n return height_helper(@root)\n end","title":""},{"docid":"ce6218cbc3950675cf487022699243f8","score":"0.7824152","text":"def height\n if @root == nil\n return 0\n end\n \n current = @root\n height = 1\n\n height = getHeight(current, height)\n return height\n end","title":""},{"docid":"66c07419e77c3c3aed6c7a1d549ac8f5","score":"0.7818307","text":"def height\n \n return 0 if @root.nil?\n return @root.height\n\n end","title":""},{"docid":"01ddb4725574628e402d0bb8b08cec6c","score":"0.781745","text":"def height\n height_helper(@root, 0)\n end","title":""},{"docid":"01ddb4725574628e402d0bb8b08cec6c","score":"0.781745","text":"def height\n height_helper(@root, 0)\n end","title":""},{"docid":"5b11bbf419ff054c0739e4c2f5044d43","score":"0.7804883","text":"def height\n return subtree_height(root)\n end","title":""},{"docid":"585e9c92b3be01c57e9f9e03385177b3","score":"0.77963626","text":"def get_height\n return height_helper(@root)\n end","title":""},{"docid":"585e9c92b3be01c57e9f9e03385177b3","score":"0.77963626","text":"def get_height\n return height_helper(@root)\n end","title":""},{"docid":"50b5d5a9989ce1593729db06db2d2648","score":"0.7783263","text":"def height\n\n # start counting height at 0\n height = 0 \n return height_helper(@root, height)\n\n end","title":""},{"docid":"12eee36a45bd73950335a1b749bda3fb","score":"0.77742916","text":"def height_helper(node)\n if node\n left = 1 + height_helper(node.left)\n right = 1 + height_helper(node.right)\n\n return left > right ? left : right\n else \n return 0\n end\n end","title":""},{"docid":"24c91034b38a3d5ce6eec14cfcabf050","score":"0.77731454","text":"def find_height(node)\n return -1 if node == nil\n left_height = find_height(node.left)\n right_height = find_height(node.right)\n left_height >= right_height ? max_height = left_height : max_height = right_height \n return max_height += 1 \n end","title":""},{"docid":"82519df53522df2647ba6a76859343a5","score":"0.7764373","text":"def height\n if @root.nil?\n return 0 \n else\n height_helper(@root)\n end\n end","title":""},{"docid":"f90e5177062b0baf2ed56f08c6db998b","score":"0.7761358","text":"def height\n return 0 if @root.nil? \n height_helper(@root)\n end","title":""},{"docid":"266dad25ffa8b62b43c270990f065bd9","score":"0.77473086","text":"def height\n return height_finder(0, current = @root)\n end","title":""},{"docid":"f3315f912c821720096459679f44b731","score":"0.7736583","text":"def height\n count_right = 0\n count_left = 0\n node = @root\n return count_left if node.nil?\n\n count_left = height_helper(node, 'left', count_left)\n count_right = height_helper(node, 'right', count_right)\n\n count_right > count_left ? count = count_right : count = count_left\n \n return count\n\n end","title":""},{"docid":"c3711f9fa5dedeb02817f5b77ff64215","score":"0.77332217","text":"def height\n return height_helper(@root)\n end","title":""},{"docid":"c3711f9fa5dedeb02817f5b77ff64215","score":"0.77332217","text":"def height\n return height_helper(@root)\n end","title":""},{"docid":"c3711f9fa5dedeb02817f5b77ff64215","score":"0.77332217","text":"def height\n return height_helper(@root)\n end","title":""},{"docid":"c3711f9fa5dedeb02817f5b77ff64215","score":"0.77332217","text":"def height\n return height_helper(@root)\n end","title":""},{"docid":"c3711f9fa5dedeb02817f5b77ff64215","score":"0.77332217","text":"def height\n return height_helper(@root)\n end","title":""},{"docid":"c3711f9fa5dedeb02817f5b77ff64215","score":"0.77332217","text":"def height\n return height_helper(@root)\n end","title":""},{"docid":"c3711f9fa5dedeb02817f5b77ff64215","score":"0.77332217","text":"def height\n return height_helper(@root)\n end","title":""},{"docid":"c3711f9fa5dedeb02817f5b77ff64215","score":"0.77332217","text":"def height\n return height_helper(@root)\n end","title":""},{"docid":"c3711f9fa5dedeb02817f5b77ff64215","score":"0.77332217","text":"def height\n return height_helper(@root)\n end","title":""},{"docid":"112deff1aab03f9c671ba598c1c5ba2b","score":"0.7721089","text":"def height\n return 0 if !@root\n height_helper(@root)\n end","title":""},{"docid":"ab8a7223bbd07095caeff2e99155df54","score":"0.76994556","text":"def height\n def innerfunc(node)\n return 0 if node.nil?\n return 1 if !node.left && !node.right\n return [innerfunc(node.left) + 1, innerfunc(node.right) + 1].max\n end\n\n return innerfunc(@root)\n end","title":""},{"docid":"410038f22875ca9cb399b1fae4c3c708","score":"0.7692254","text":"def height\n return height_helper(@root, 0)\n # If the current node is nil return 0\n # Otherwise return 1 plus the maximum of the heights of the right and left subtrees\n end","title":""},{"docid":"08748febd11cf110b49f329c68f0ca05","score":"0.7665645","text":"def height\n structure_height(@root)\n end","title":""},{"docid":"94aabe25db03e1d314ab0cdf079a302b","score":"0.7661904","text":"def structure_height(node)\n return 0 unless node\n return 0 if node.left == nil and node.right == nil\n left_height = structure_height(node.left)\n right_height = structure_height(node.right)\n ((left_height < right_height) ? right_height : left_height) + 1\n end","title":""},{"docid":"f29fa3fa2014137cc7f374d4e2120c8c","score":"0.7615227","text":"def height\n height_counter(@root)\n end","title":""},{"docid":"9a6c1e8e76b6731561452555ec65896b","score":"0.7614553","text":"def height\n if @root == nil\n return 0\n elsif @root.left == nil && @root.right == nil\n return 1\n end\n \n return height_helper(@root)\n \n end","title":""},{"docid":"61631c741247c7123a6409a55339ab8d","score":"0.75827044","text":"def height\n @root.height\n end","title":""},{"docid":"5608eabe2998633abea4ce34536ca31a","score":"0.7572991","text":"def height\n leaves = @root.leaves\n height = 0\n leaves.each do |leaf|\n height_of_leaf = leaf.nodesToAncestor(@root)\n height = height_of_leaf if height < height_of_leaf\n end\n height\n end","title":""},{"docid":"f43bc5005ed049ddd05b0f8903bcde79","score":"0.7568355","text":"def height\n return 0 if @root.nil?\n return 1 if (@root.left.nil? && @root.right.nil?)\n\n left_height = 1\n height_helper(@root.left, 1) if @root.left\n right_height = 1\n height_helper(@root.right, 1) if @root.right\n\n return left_height >= right_height ? left_height : right_height\n end","title":""},{"docid":"aface83e395d1e63760e24dab174fef7","score":"0.75406355","text":"def height\n @height ||= @leaf ? 0 : 1 + children[0].height\n end","title":""},{"docid":"555f4c04ff2aa716d10d7efa3a9f7fe4","score":"0.7498333","text":"def height\n return get_depth(@root, 0)\n end","title":""},{"docid":"7fbc44a2519875aee0bda7829ef278d8","score":"0.74711305","text":"def height(node, height = 0)\n # no tree\n return nil unless @root\n\n # has no children - reached bottom of tree\n return height unless children?(node)\n\n # recursive call if node has children\n height_l = height(node.l_child, height + 1) if node.l_child\n height_r = height(node.r_child, height + 1) if node.r_child\n nil_to_zero(height_l) >= nil_to_zero(height_r) ? height_l : height_r\n end","title":""},{"docid":"0a0fbf732f39189272868cc9ed0332d6","score":"0.74693686","text":"def height\n height_helper(@root)\n end","title":""},{"docid":"4543c96d0e4b78701f4f3248a470a6f0","score":"0.74672097","text":"def height(value)\n value = find(value)\n arr = level_order(value)\n last_value = arr[-1]\n # find distance between node and lowest node\n height = find_with_height(value, last_value)\n puts \"The height of value #{last_value} is #{height}\"\n end","title":""},{"docid":"ae1f7363c664e7e3cfdbce3cdb4c12e7","score":"0.7455527","text":"def height\n root.height\n end","title":""},{"docid":"9b2b0666f1f3530a5e880a278d49d80d","score":"0.74533063","text":"def tree_height\n siblings.size\n end","title":""},{"docid":"7152443ba101ffe7c0d14ef6a4735a46","score":"0.7442876","text":"def height\n height_helper(@root) \n end","title":""},{"docid":"c995b16ca22146a9afc8032b050283f3","score":"0.7434427","text":"def height_helper(node)\n return 0 if node.nil?\n if height_helper(node.right) > height_helper(node.left)\n return height_helper(node.right) + 1\n else\n return height_helper(node.left) + 1\n end\n end","title":""},{"docid":"f37750344e03f14ab115284710950abf","score":"0.7377353","text":"def height_recursive(node)\n return 0 if node.nil?\n\n left = height_recursive(node.left)\n right = height_recursive(node.right)\n\n if left > right\n height = left\n else\n height = right\n end\n height += 1\n return height\n end","title":""},{"docid":"aa113fdd753115b6f249e480b5abdda2","score":"0.7364692","text":"def height(root = @root)\n return -1 if root == nil\n left = height(root.link_left)\n right = height(root.link_right)\n return [left, right].max + 1\n end","title":""},{"docid":"c603e4da1382df241fec41361e0c2753","score":"0.7312611","text":"def height\n if left_child.nil? && right_child.nil?\n return 0\n end\n [left_child.nil? ? 0 : left_child.height, right_child.nil? ? 0 : right_child.height].max + 1\n end","title":""},{"docid":"feda2b955be6fbffd6c22e7f022defd7","score":"0.7311032","text":"def height(node = @root, idx = 0)\n return 0 if node.nil?\n return idx if node.left.nil? && node.right.nil?\n\n height(node.left) >= height(node.right) ? 1 + height(node.left) : 1 + height(node.right)\n end","title":""},{"docid":"6df523c2e2b8f31fa708c7c8b7e934bc","score":"0.73062056","text":"def height\n # @root.nil? ? 0 : @root.height\n @root.nil? ? 0 : @root.iterate(HEIGHT)\n end","title":""},{"docid":"f6ce8d86ad7417f864350aa5aa65d450","score":"0.729584","text":"def height()\n return @height\n end","title":""},{"docid":"f6ce8d86ad7417f864350aa5aa65d450","score":"0.729584","text":"def height()\n return @height\n end","title":""},{"docid":"0e2b5e3cc2275e240dc7afbff2cbdea5","score":"0.72937953","text":"def get_max_node_height\n\t\t\tmax_height = 0\n\t\t\tCxlHelper.builder.anything.with(\"y\", \"height\").apply(@xml).each do |node|\n\t\t\t\theight = node[\"height\"].to_i\n\t\t\t\tif height > max_height\n\t\t\t\t\tmax_height = height\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn max_height\n\t\tend","title":""},{"docid":"0d8e8d85f6b8ef9f41619b166c7e75ac","score":"0.7289688","text":"def height\n max_height(@root)\n end","title":""},{"docid":"633b64616139b8e67f79188ccaf38e6f","score":"0.7289428","text":"def height(root)\nend","title":""},{"docid":"20f48e592fdeb01bb0784ad58ebf9cb7","score":"0.7268095","text":"def height\n @file.xpath('./*/@height').first.try(:text) if @file.xpath('./*/@height').present?\n end","title":""},{"docid":"93bae900e0a54447179f3244e9234f1f","score":"0.7266797","text":"def height(current = @root, height = 0)\n # If the current node is nil return 0\n return height if !current\n # Otherwise return 1 plus the maximum of the heights of the right and left subtrees\n left = height(current.left, height + 1)\n right = height(current.right, height + 1)\n return left >= right ? left : right\n end","title":""},{"docid":"b526c039dcfd5ec18b0d62d714f52e87","score":"0.7253776","text":"def height\n if @alive\n @height.round(1)\n else\n 'A dead tree is not very tall. :('\n end\n end","title":""},{"docid":"7e81c5e5a7b68820893aafe49666c0ca","score":"0.7252751","text":"def height\n # 1 for border, 1 for spare space\n @root.height + @padding + 3\n end","title":""},{"docid":"78724e301d7aed2d1c2e4e45b0f3fb00","score":"0.72468346","text":"def height\n RemoteNode.rpc 'getblockcount'\n end","title":""}],"string":"[\n {\n \"docid\": \"869c655c49b6097724314a6df1e40c34\",\n \"score\": \"0.8766375\",\n \"text\": \"def height node\\n node&.height || 0 \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d5788284a1f144b6e217ac473c2f96a4\",\n \"score\": \"0.8499755\",\n \"text\": \"def height\\n node['height']\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a8880cc3ebaddf749640a27560a353bf\",\n \"score\": \"0.8470247\",\n \"text\": \"def height\\n return 0 if @root.nil?\\n node = @root\\n return height_helper(node)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"db0236afb7129d3b251b1db9037ae92d\",\n \"score\": \"0.8437922\",\n \"text\": \"def height\\n return 0 if @root.nil?\\n node = @root\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a35632115c5d172ed8818e912d215c4b\",\n \"score\": \"0.8396946\",\n \"text\": \"def height()\\n height_node(@root, 0)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"392da27a0effd2bba530518ba1a4a5a0\",\n \"score\": \"0.8358313\",\n \"text\": \"def height\\n vy = nodes.map {|n| n.y}\\n vy.max - vy.min\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4a33d7517b24f85ca9086afd8d8d23d5\",\n \"score\": \"0.8291182\",\n \"text\": \"def height(node)\\n if node == nil\\n return 0\\n else\\n left_height = height(node.left)\\n right_height = height(node.right)\\n if left_height >= right_height\\n return 1 + left_height\\n else\\n return 1 + right_height\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c2b38e949046f6bf4cae76958b41708\",\n \"score\": \"0.8258234\",\n \"text\": \"def height\\n return 0 if @root == nil\\n node = @root\\n return height_recurssive(node, 1, 1)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9b4b79caeb09989b582fb5d8b553a0ef\",\n \"score\": \"0.8214026\",\n \"text\": \"def height(node)\\n return 0 if node.nil?\\n left_height = height(node.left)\\n right_height = height(node.right)\\n [left_height, right_height].max + 1\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ebd53b2a3b5b586e0c26eccd88611be8\",\n \"score\": \"0.8095185\",\n \"text\": \"def height(node)\\n return -1 unless node\\n [height(node.left), height(node.right)].max + 1\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"748ed053bf44c13ab9fdf2c800154540\",\n \"score\": \"0.8093354\",\n \"text\": \"def height\\n current = @root \\n return height_helper(current, 0)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ecdeca966c9110185a4352fcb2b6c880\",\n \"score\": \"0.80862665\",\n \"text\": \"def nodeHeight\\n return 0 if isLeaf?\\n 1 + @children.collect { |child| child.nodeHeight }.max\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ecdeca966c9110185a4352fcb2b6c880\",\n \"score\": \"0.80862665\",\n \"text\": \"def nodeHeight\\n return 0 if isLeaf?\\n 1 + @children.collect { |child| child.nodeHeight }.max\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fa9e908b73aad5c5122c449fbb6a56af\",\n \"score\": \"0.80776477\",\n \"text\": \"def height\\n height = 0\\n current = @root\\n return height_helper(current, height)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"04aadc90509875d8e35b968063a6b501\",\n \"score\": \"0.80769145\",\n \"text\": \"def height\\n current = @root\\n\\n return 0 if current.nil?\\n\\n height_helper(current)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cdc2c933d830a85ead50dfa95700175b\",\n \"score\": \"0.80586725\",\n \"text\": \"def height\\n source_node[:height].to_i\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cdc2c933d830a85ead50dfa95700175b\",\n \"score\": \"0.80586725\",\n \"text\": \"def height\\n source_node[:height].to_i\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e9d6f383dfe3c5161b66f99048f025c6\",\n \"score\": \"0.8040672\",\n \"text\": \"def height\\n # raise NotImplementedError\\n node = @root\\n return 0 if node.nil?\\n\\n count_right = 0\\n count_left = 0\\n \\n count_left = height_helper(node, 'left', count_left)\\n count_right = height_helper(node, 'right', count_right)\\n\\n if count_right > count_left\\n return count_right\\n else\\n return count_left\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a323bc99c599c615ada185f1b9b674f0\",\n \"score\": \"0.8040394\",\n \"text\": \"def height(node = root)\\n return -1 if node.nil?\\n\\n [height(node.left), height(node.right)].max + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"86a8c67d72edd45a86119a95dd7284f5\",\n \"score\": \"0.803173\",\n \"text\": \"def height(node)\\n node.nil? ? 0 : 1 + max(height(node.left), height(node.right))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be11dff9dcc35f980b1f0a53793ecb4e\",\n \"score\": \"0.8019581\",\n \"text\": \"def height\\n return height_helper(@root, 0, 1)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be11dff9dcc35f980b1f0a53793ecb4e\",\n \"score\": \"0.8019581\",\n \"text\": \"def height\\n return height_helper(@root, 0, 1)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a4c31ea353906063ac3be0c03875df33\",\n \"score\": \"0.80006236\",\n \"text\": \"def height\\n current = @root\\n height = 1\\n return 0 if @root.nil?\\n return height_helper(current,height)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7f1a87f8a0d860b68c53062ef8d434dd\",\n \"score\": \"0.79934025\",\n \"text\": \"def height\\n current = @root\\n return 0 if @root.nil?\\n\\n return tree_height(current)\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e22d7b02115c7aa244f1bbeb409eb47b\",\n \"score\": \"0.79877937\",\n \"text\": \"def height\\n counter = 0\\n current_node = @top\\n while !current_node.nil?\\n counter += 1\\n current_node = current_node.next_node\\n end\\n counter\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9b86df1663faa2f3f3e42ec0b20f9048\",\n \"score\": \"0.79816824\",\n \"text\": \"def height(node = @root)\\n nodes = in_order_traversal\\n nodes.map { |node| node.depth }.max\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"12707505a4e0d2119e0faad6eb07894b\",\n \"score\": \"0.7979628\",\n \"text\": \"def height(node)\\n node = find(node.data)\\n return nil unless node\\n\\n queue = Queue.new.enq(@root)\\n until queue.empty?\\n curent_node = queue.deq\\n queue.enq curent_node.left if curent_node.left\\n queue.enq curent_node.right if curent_node.right\\n end\\n leaf = curent_node\\n depth(leaf) - depth(node)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"132a2953d3f3b5c50ceae4b47bb5dfea\",\n \"score\": \"0.79701585\",\n \"text\": \"def height(node=@tree)\\n node.nil? ? 0 : 1 + [self.height(node[:left]), self.height(node[:right])].max\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"34cdf9d9265174a374622840b96e84e0\",\n \"score\": \"0.7967167\",\n \"text\": \"def height\\n if @root.nil?\\n return 0\\n end\\n\\n current = @root\\n\\n height_helper(current)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3b20c71d1be9030c62ae667655a66b7b\",\n \"score\": \"0.79565525\",\n \"text\": \"def height(node)\\n # base condition when binary tree is empty\\n return 0 if node.nil?\\n\\n [height(node.left_child), height(node.right_child)].max + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6e2defde64588ae4c1205b581dc012a0\",\n \"score\": \"0.79506767\",\n \"text\": \"def height_node(node, height)\\n heightLeft = 0\\n heightRight = 0 \\n\\n if node.left != nil\\n heightLeft = height_node(node.left, height+1) \\n end\\n\\n if node.right != nil\\n heightRight = height_node(node.right, height+1) \\n end\\n\\n [heightLeft, heightRight, height].max \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7992946c74f8c47b70d24ef0572d96ee\",\n \"score\": \"0.7946834\",\n \"text\": \"def height\\n _height(@root) - 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"293430f40a4d26ad3cb1302082a6f021\",\n \"score\": \"0.7937302\",\n \"text\": \"def height\\n return height_helper(@root, 0)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b900cc189c1ef4be2126ea2ed5209ca9\",\n \"score\": \"0.7924119\",\n \"text\": \"def height\\n return 0 if @root.nil?\\n\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"42aa9d671450b70a631ee41e4781bbc1\",\n \"score\": \"0.79094994\",\n \"text\": \"def find_height\\n return height(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fb544023bd905d72f70d1448cbbcc78c\",\n \"score\": \"0.78871053\",\n \"text\": \"def height(pointer = root)\\n # Height is defined as the number of edges in longest path from a given node to a leaf node\\n return -1 if pointer.nil?\\n\\n return p 'No such node' unless level_order.include?(pointer.data)\\n\\n height_from_left = height(pointer.left_child) + 1\\n height_from_right = height(pointer.right_child) + 1\\n height_from_left > height_from_right ? height_from_left : height_from_right\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6cce61f068c1e3f68cb416bf8556e99e\",\n \"score\": \"0.78860444\",\n \"text\": \"def height\\n # return 0 if @root == nil\\n\\n height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"455fdc91752986ec67776ee32b275038\",\n \"score\": \"0.78842497\",\n \"text\": \"def height\\n return 0 if @root.nil?\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"455fdc91752986ec67776ee32b275038\",\n \"score\": \"0.78842497\",\n \"text\": \"def height\\n return 0 if @root.nil?\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"455fdc91752986ec67776ee32b275038\",\n \"score\": \"0.78842497\",\n \"text\": \"def height\\n return 0 if @root.nil?\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f976f173e914b55ae8c2b79c33cd9b91\",\n \"score\": \"0.78591526\",\n \"text\": \"def height(node)\\n return 0 if node.nil?\\n return 1 + [height(node.left), height(node.right)].max\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fbb29b44f592e4d03f63fd8ee4c3dcf6\",\n \"score\": \"0.7849064\",\n \"text\": \"def height_node(data)\\n node = find(data)\\n height_tree(node)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"de1f58bd9f7598cc6b7202044b1a4d27\",\n \"score\": \"0.7832018\",\n \"text\": \"def height\\n height = 0\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ce6218cbc3950675cf487022699243f8\",\n \"score\": \"0.7824152\",\n \"text\": \"def height\\n if @root == nil\\n return 0\\n end\\n \\n current = @root\\n height = 1\\n\\n height = getHeight(current, height)\\n return height\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"66c07419e77c3c3aed6c7a1d549ac8f5\",\n \"score\": \"0.7818307\",\n \"text\": \"def height\\n \\n return 0 if @root.nil?\\n return @root.height\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"01ddb4725574628e402d0bb8b08cec6c\",\n \"score\": \"0.781745\",\n \"text\": \"def height\\n height_helper(@root, 0)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"01ddb4725574628e402d0bb8b08cec6c\",\n \"score\": \"0.781745\",\n \"text\": \"def height\\n height_helper(@root, 0)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5b11bbf419ff054c0739e4c2f5044d43\",\n \"score\": \"0.7804883\",\n \"text\": \"def height\\n return subtree_height(root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"585e9c92b3be01c57e9f9e03385177b3\",\n \"score\": \"0.77963626\",\n \"text\": \"def get_height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"585e9c92b3be01c57e9f9e03385177b3\",\n \"score\": \"0.77963626\",\n \"text\": \"def get_height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"50b5d5a9989ce1593729db06db2d2648\",\n \"score\": \"0.7783263\",\n \"text\": \"def height\\n\\n # start counting height at 0\\n height = 0 \\n return height_helper(@root, height)\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"12eee36a45bd73950335a1b749bda3fb\",\n \"score\": \"0.77742916\",\n \"text\": \"def height_helper(node)\\n if node\\n left = 1 + height_helper(node.left)\\n right = 1 + height_helper(node.right)\\n\\n return left > right ? left : right\\n else \\n return 0\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"24c91034b38a3d5ce6eec14cfcabf050\",\n \"score\": \"0.77731454\",\n \"text\": \"def find_height(node)\\n return -1 if node == nil\\n left_height = find_height(node.left)\\n right_height = find_height(node.right)\\n left_height >= right_height ? max_height = left_height : max_height = right_height \\n return max_height += 1 \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"82519df53522df2647ba6a76859343a5\",\n \"score\": \"0.7764373\",\n \"text\": \"def height\\n if @root.nil?\\n return 0 \\n else\\n height_helper(@root)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f90e5177062b0baf2ed56f08c6db998b\",\n \"score\": \"0.7761358\",\n \"text\": \"def height\\n return 0 if @root.nil? \\n height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"266dad25ffa8b62b43c270990f065bd9\",\n \"score\": \"0.77473086\",\n \"text\": \"def height\\n return height_finder(0, current = @root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f3315f912c821720096459679f44b731\",\n \"score\": \"0.7736583\",\n \"text\": \"def height\\n count_right = 0\\n count_left = 0\\n node = @root\\n return count_left if node.nil?\\n\\n count_left = height_helper(node, 'left', count_left)\\n count_right = height_helper(node, 'right', count_right)\\n\\n count_right > count_left ? count = count_right : count = count_left\\n \\n return count\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3711f9fa5dedeb02817f5b77ff64215\",\n \"score\": \"0.77332217\",\n \"text\": \"def height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3711f9fa5dedeb02817f5b77ff64215\",\n \"score\": \"0.77332217\",\n \"text\": \"def height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3711f9fa5dedeb02817f5b77ff64215\",\n \"score\": \"0.77332217\",\n \"text\": \"def height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3711f9fa5dedeb02817f5b77ff64215\",\n \"score\": \"0.77332217\",\n \"text\": \"def height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3711f9fa5dedeb02817f5b77ff64215\",\n \"score\": \"0.77332217\",\n \"text\": \"def height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3711f9fa5dedeb02817f5b77ff64215\",\n \"score\": \"0.77332217\",\n \"text\": \"def height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3711f9fa5dedeb02817f5b77ff64215\",\n \"score\": \"0.77332217\",\n \"text\": \"def height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3711f9fa5dedeb02817f5b77ff64215\",\n \"score\": \"0.77332217\",\n \"text\": \"def height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3711f9fa5dedeb02817f5b77ff64215\",\n \"score\": \"0.77332217\",\n \"text\": \"def height\\n return height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"112deff1aab03f9c671ba598c1c5ba2b\",\n \"score\": \"0.7721089\",\n \"text\": \"def height\\n return 0 if !@root\\n height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ab8a7223bbd07095caeff2e99155df54\",\n \"score\": \"0.76994556\",\n \"text\": \"def height\\n def innerfunc(node)\\n return 0 if node.nil?\\n return 1 if !node.left && !node.right\\n return [innerfunc(node.left) + 1, innerfunc(node.right) + 1].max\\n end\\n\\n return innerfunc(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"410038f22875ca9cb399b1fae4c3c708\",\n \"score\": \"0.7692254\",\n \"text\": \"def height\\n return height_helper(@root, 0)\\n # If the current node is nil return 0\\n # Otherwise return 1 plus the maximum of the heights of the right and left subtrees\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"08748febd11cf110b49f329c68f0ca05\",\n \"score\": \"0.7665645\",\n \"text\": \"def height\\n structure_height(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"94aabe25db03e1d314ab0cdf079a302b\",\n \"score\": \"0.7661904\",\n \"text\": \"def structure_height(node)\\n return 0 unless node\\n return 0 if node.left == nil and node.right == nil\\n left_height = structure_height(node.left)\\n right_height = structure_height(node.right)\\n ((left_height < right_height) ? right_height : left_height) + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f29fa3fa2014137cc7f374d4e2120c8c\",\n \"score\": \"0.7615227\",\n \"text\": \"def height\\n height_counter(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9a6c1e8e76b6731561452555ec65896b\",\n \"score\": \"0.7614553\",\n \"text\": \"def height\\n if @root == nil\\n return 0\\n elsif @root.left == nil && @root.right == nil\\n return 1\\n end\\n \\n return height_helper(@root)\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"61631c741247c7123a6409a55339ab8d\",\n \"score\": \"0.75827044\",\n \"text\": \"def height\\n @root.height\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5608eabe2998633abea4ce34536ca31a\",\n \"score\": \"0.7572991\",\n \"text\": \"def height\\n leaves = @root.leaves\\n height = 0\\n leaves.each do |leaf|\\n height_of_leaf = leaf.nodesToAncestor(@root)\\n height = height_of_leaf if height < height_of_leaf\\n end\\n height\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f43bc5005ed049ddd05b0f8903bcde79\",\n \"score\": \"0.7568355\",\n \"text\": \"def height\\n return 0 if @root.nil?\\n return 1 if (@root.left.nil? && @root.right.nil?)\\n\\n left_height = 1\\n height_helper(@root.left, 1) if @root.left\\n right_height = 1\\n height_helper(@root.right, 1) if @root.right\\n\\n return left_height >= right_height ? left_height : right_height\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aface83e395d1e63760e24dab174fef7\",\n \"score\": \"0.75406355\",\n \"text\": \"def height\\n @height ||= @leaf ? 0 : 1 + children[0].height\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"555f4c04ff2aa716d10d7efa3a9f7fe4\",\n \"score\": \"0.7498333\",\n \"text\": \"def height\\n return get_depth(@root, 0)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7fbc44a2519875aee0bda7829ef278d8\",\n \"score\": \"0.74711305\",\n \"text\": \"def height(node, height = 0)\\n # no tree\\n return nil unless @root\\n\\n # has no children - reached bottom of tree\\n return height unless children?(node)\\n\\n # recursive call if node has children\\n height_l = height(node.l_child, height + 1) if node.l_child\\n height_r = height(node.r_child, height + 1) if node.r_child\\n nil_to_zero(height_l) >= nil_to_zero(height_r) ? height_l : height_r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0a0fbf732f39189272868cc9ed0332d6\",\n \"score\": \"0.74693686\",\n \"text\": \"def height\\n height_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4543c96d0e4b78701f4f3248a470a6f0\",\n \"score\": \"0.74672097\",\n \"text\": \"def height(value)\\n value = find(value)\\n arr = level_order(value)\\n last_value = arr[-1]\\n # find distance between node and lowest node\\n height = find_with_height(value, last_value)\\n puts \\\"The height of value #{last_value} is #{height}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ae1f7363c664e7e3cfdbce3cdb4c12e7\",\n \"score\": \"0.7455527\",\n \"text\": \"def height\\n root.height\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9b2b0666f1f3530a5e880a278d49d80d\",\n \"score\": \"0.74533063\",\n \"text\": \"def tree_height\\n siblings.size\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7152443ba101ffe7c0d14ef6a4735a46\",\n \"score\": \"0.7442876\",\n \"text\": \"def height\\n height_helper(@root) \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c995b16ca22146a9afc8032b050283f3\",\n \"score\": \"0.7434427\",\n \"text\": \"def height_helper(node)\\n return 0 if node.nil?\\n if height_helper(node.right) > height_helper(node.left)\\n return height_helper(node.right) + 1\\n else\\n return height_helper(node.left) + 1\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f37750344e03f14ab115284710950abf\",\n \"score\": \"0.7377353\",\n \"text\": \"def height_recursive(node)\\n return 0 if node.nil?\\n\\n left = height_recursive(node.left)\\n right = height_recursive(node.right)\\n\\n if left > right\\n height = left\\n else\\n height = right\\n end\\n height += 1\\n return height\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aa113fdd753115b6f249e480b5abdda2\",\n \"score\": \"0.7364692\",\n \"text\": \"def height(root = @root)\\n return -1 if root == nil\\n left = height(root.link_left)\\n right = height(root.link_right)\\n return [left, right].max + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c603e4da1382df241fec41361e0c2753\",\n \"score\": \"0.7312611\",\n \"text\": \"def height\\n if left_child.nil? && right_child.nil?\\n return 0\\n end\\n [left_child.nil? ? 0 : left_child.height, right_child.nil? ? 0 : right_child.height].max + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"feda2b955be6fbffd6c22e7f022defd7\",\n \"score\": \"0.7311032\",\n \"text\": \"def height(node = @root, idx = 0)\\n return 0 if node.nil?\\n return idx if node.left.nil? && node.right.nil?\\n\\n height(node.left) >= height(node.right) ? 1 + height(node.left) : 1 + height(node.right)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6df523c2e2b8f31fa708c7c8b7e934bc\",\n \"score\": \"0.73062056\",\n \"text\": \"def height\\n # @root.nil? ? 0 : @root.height\\n @root.nil? ? 0 : @root.iterate(HEIGHT)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f6ce8d86ad7417f864350aa5aa65d450\",\n \"score\": \"0.729584\",\n \"text\": \"def height()\\n return @height\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f6ce8d86ad7417f864350aa5aa65d450\",\n \"score\": \"0.729584\",\n \"text\": \"def height()\\n return @height\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0e2b5e3cc2275e240dc7afbff2cbdea5\",\n \"score\": \"0.72937953\",\n \"text\": \"def get_max_node_height\\n\\t\\t\\tmax_height = 0\\n\\t\\t\\tCxlHelper.builder.anything.with(\\\"y\\\", \\\"height\\\").apply(@xml).each do |node|\\n\\t\\t\\t\\theight = node[\\\"height\\\"].to_i\\n\\t\\t\\t\\tif height > max_height\\n\\t\\t\\t\\t\\tmax_height = height\\n\\t\\t\\t\\tend\\n\\t\\t\\tend\\n\\t\\t\\treturn max_height\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0d8e8d85f6b8ef9f41619b166c7e75ac\",\n \"score\": \"0.7289688\",\n \"text\": \"def height\\n max_height(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"633b64616139b8e67f79188ccaf38e6f\",\n \"score\": \"0.7289428\",\n \"text\": \"def height(root)\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"20f48e592fdeb01bb0784ad58ebf9cb7\",\n \"score\": \"0.7268095\",\n \"text\": \"def height\\n @file.xpath('./*/@height').first.try(:text) if @file.xpath('./*/@height').present?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"93bae900e0a54447179f3244e9234f1f\",\n \"score\": \"0.7266797\",\n \"text\": \"def height(current = @root, height = 0)\\n # If the current node is nil return 0\\n return height if !current\\n # Otherwise return 1 plus the maximum of the heights of the right and left subtrees\\n left = height(current.left, height + 1)\\n right = height(current.right, height + 1)\\n return left >= right ? left : right\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b526c039dcfd5ec18b0d62d714f52e87\",\n \"score\": \"0.7253776\",\n \"text\": \"def height\\n if @alive\\n @height.round(1)\\n else\\n 'A dead tree is not very tall. :('\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7e81c5e5a7b68820893aafe49666c0ca\",\n \"score\": \"0.7252751\",\n \"text\": \"def height\\n # 1 for border, 1 for spare space\\n @root.height + @padding + 3\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"78724e301d7aed2d1c2e4e45b0f3fb00\",\n \"score\": \"0.72468346\",\n \"text\": \"def height\\n RemoteNode.rpc 'getblockcount'\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":168,"cells":{"query_id":{"kind":"string","value":"8a84c8a5c85d0ad19950fa7a07fde9e2"},"query":{"kind":"string","value":"Gets the jobTitle property value. Job title for this organizational contact. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq for null values)."},"positive_passages":{"kind":"list like","value":[{"docid":"1f037d5267f3d18b34e97f03db4e7d3b","score":"0.7012157","text":"def job_title\n return @job_title\n end","title":""}],"string":"[\n {\n \"docid\": \"1f037d5267f3d18b34e97f03db4e7d3b\",\n \"score\": \"0.7012157\",\n \"text\": \"def job_title\\n return @job_title\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"a78f13613821244769854fe059b71be2","score":"0.6530419","text":"def get_title(job)\n job.search(\"h3\").text.strip\n end","title":""},{"docid":"dedd1cef7063368ca3ee4e266c8db7d0","score":"0.6424466","text":"def job_title=(value)\n @job_title = value\n end","title":""},{"docid":"dedd1cef7063368ca3ee4e266c8db7d0","score":"0.6424466","text":"def job_title=(value)\n @job_title = value\n end","title":""},{"docid":"dedd1cef7063368ca3ee4e266c8db7d0","score":"0.6424466","text":"def job_title=(value)\n @job_title = value\n end","title":""},{"docid":"dedd1cef7063368ca3ee4e266c8db7d0","score":"0.6424466","text":"def job_title=(value)\n @job_title = value\n end","title":""},{"docid":"e2f75d5cc76869fe0a230db0ebeb69b9","score":"0.6184285","text":"def title\n \"#{job.company.company_name} - #{job.title} - #{student.name}\"\n end","title":""},{"docid":"7363a84f67d2538e1b5bfe7a3f0cbd65","score":"0.5944928","text":"def title\n composite = product.titles.first\n if composite.nil?\n nil\n else\n composite.title_text || composite.title_without_prefix\n end\n end","title":""},{"docid":"601dc254016369089d2ed5c1a2058fc6","score":"0.5933641","text":"def title\n if is_journal?\n return value(\"rft.jtitle\") || value(\"rft.title\")\n end\n\n value_first(\"rft.btitle\").presence || value(\"rft.title\")\n end","title":""},{"docid":"9bb4c50f96f1eb1d2dc9f3ae1d7c3eb7","score":"0.58361095","text":"def job_title\n if self.nna?\n self.user_profile.try(:title)\n elsif self.dsm?\n self.position.try(:name)\n end\n end","title":""},{"docid":"5e0e31833679818db7522667ffec83a9","score":"0.5804851","text":"def job_title=(job_title)\n\n if !job_title.nil? && job_title.to_s.length > 1024\n fail ArgumentError, \"invalid value for 'job_title', the character length must be smaller than or equal to 1024.\"\n end\n\n @job_title = job_title\n end","title":""},{"docid":"d513bf2523c278d2002d5d2ec0356fd0","score":"0.5749694","text":"def set_JobTitle(value)\n set_input(\"JobTitle\", value)\n end","title":""},{"docid":"c326a5e65cebb59c75b2a9e70a7811fd","score":"0.56531256","text":"def job=(job_title)\n\t\t@job = job_title\n\tend","title":""},{"docid":"1d1995e5c6e0e87429e613fde2ed39b0","score":"0.55619854","text":"def job_title=(new_job_title)\n @job_title = new_job_title\n end","title":""},{"docid":"d35a7fa32f2a20df9cfaa3356c9e3c91","score":"0.5556228","text":"def draft_title\n if self.draft?\n if self.title.empty?\n return I18n.t('jobs.new.modal_job_draft.no_title')\n else\n return self.title\n end\n end\n end","title":""},{"docid":"d35a7fa32f2a20df9cfaa3356c9e3c91","score":"0.5556228","text":"def draft_title\n if self.draft?\n if self.title.empty?\n return I18n.t('jobs.new.modal_job_draft.no_title')\n else\n return self.title\n end\n end\n end","title":""},{"docid":"b11b13102f6a722aa918ef7bd60fc5d5","score":"0.55311507","text":"def job_name_entry\n if job\n job.to_s\n else\n job_name_override\n end\n end","title":""},{"docid":"d90ce438de6080944ecacc0f4b3858ee","score":"0.55197734","text":"def staff_job_titles\n # Only the title attribute\n job_titles.map(&:title)\n end","title":""},{"docid":"90fbc94653239a764294f2c3974a3e1c","score":"0.5497869","text":"def getJobName()\n return @jobName\n end","title":""},{"docid":"377a7c3dfec8e887e80b42990b5c705c","score":"0.54858","text":"def bib_title\n if @bib_entity && @bib_entity.fetch('Titles', {}).any?\n item_bib_title = @bib_entity.fetch('Titles', {}).find{|item| item['Type'] == 'main'}\n if item_bib_title\n item_bib_title['TitleFull']\n else\n nil\n end\n else\n nil\n end\n end","title":""},{"docid":"1e5dfbb0a1b6a5af94001b5c9b27a2eb","score":"0.54676014","text":"def set_JobTitle(value)\n set_input(\"JobTitle\", value)\n end","title":""},{"docid":"1a2df579dc63038036785e170a570028","score":"0.54253846","text":"def job_description\n data[:job_description]\n end","title":""},{"docid":"36c2a05c1209531ed018d88740142e96","score":"0.5414098","text":"def title\n if @title_text\n @title_text\n else\n if @title_without_prefix\n if @title_prefix\n \"#{@title_prefix} #{@title_without_prefix}\"\n else\n @title_without_prefix\n end\n end\n end\n end","title":""},{"docid":"36c2a05c1209531ed018d88740142e96","score":"0.5414098","text":"def title\n if @title_text\n @title_text\n else\n if @title_without_prefix\n if @title_prefix\n \"#{@title_prefix} #{@title_without_prefix}\"\n else\n @title_without_prefix\n end\n end\n end\n end","title":""},{"docid":"36c2a05c1209531ed018d88740142e96","score":"0.54134864","text":"def title\n if @title_text\n @title_text\n else\n if @title_without_prefix\n if @title_prefix\n \"#{@title_prefix} #{@title_without_prefix}\"\n else\n @title_without_prefix\n end\n end\n end\n end","title":""},{"docid":"275561d77f3ef5146f75e2b134c64629","score":"0.54080623","text":"def college_job_titles\n Staff.where(college_id: self.college_id).select(:job_title).distinct\n end","title":""},{"docid":"984de03f528b4fd32be30f222c87c76b","score":"0.53807485","text":"def title\n fetch(FIELD_TITLE, nil)\n end","title":""},{"docid":"d772b6980001dbc96eebeb97194b75c3","score":"0.5356024","text":"def title\n @title ||= begin\n Utilities.longest_common_substring_in_array(titles) || titles.first\n end\n end","title":""},{"docid":"77e2a26730dd088cc28cff5fa655d5b9","score":"0.535352","text":"def title\n title = read_attribute(:title)\n title.blank? ? '(No title)' : title\n end","title":""},{"docid":"dafdac3336ae4aabcf60cc3e372dec4e","score":"0.53470933","text":"def job_title\n Faker::Job.title\n end","title":""},{"docid":"6b8ddd23402b6a8168b175f888f66944","score":"0.5327445","text":"def book_title\n part_of_title_by_type('Book')\n end","title":""},{"docid":"f9fd54ccf7698eac50e2d72e7d10bedf","score":"0.53207695","text":"def item_title_for_solr\n return FinderHelper.strip(item.item_title)\n end","title":""},{"docid":"6cfd1401fd066accd620d3554aa0033d","score":"0.53013384","text":"def title\n title = (self.titles || []).first\n title.nil? || title == '' ? self.key : title\n end","title":""},{"docid":"70c2079d40b8c0353e386ea4b8eef283","score":"0.528038","text":"def title\n self.properties ?\n self.properties.title : ''\n end","title":""},{"docid":"70c2079d40b8c0353e386ea4b8eef283","score":"0.528038","text":"def title\n self.properties ?\n self.properties.title : ''\n end","title":""},{"docid":"b8279e742ef94279ac9dbec7d5154c2d","score":"0.52695936","text":"def journal_title\n Array(object.try(:journal_title)).first || ''\n end","title":""},{"docid":"1550b21bba9cc6ab300b5573ee9bf9c6","score":"0.5260696","text":"def title\n query_property_values :predicate => DCTERMS.title do |title|\n return title\n end\n end","title":""},{"docid":"4d861be68a4b81bf44761c1995f1b820","score":"0.52593166","text":"def getTitle\r\n\t\t\t\t\treturn @title\r\n\t\t\t\tend","title":""},{"docid":"4d861be68a4b81bf44761c1995f1b820","score":"0.52593166","text":"def getTitle\r\n\t\t\t\t\treturn @title\r\n\t\t\t\tend","title":""},{"docid":"cae54101cd50422dd8587b780f8ac1bf","score":"0.52563745","text":"def journal_title\n part_of_title_by_type('Journal')\n end","title":""},{"docid":"425c98da0e507a318b2124a19ff87a32","score":"0.52551365","text":"def get_title\n title = self.title\n\n if title.nil?\n return \"\"\n else\n return title\n end\n end","title":""},{"docid":"bb1d7120c8da5cd25de659caf7980f58","score":"0.52483934","text":"def search_title\n @doc.xpath(\"//span[@id='what_container']//input//attribute::value\").to_s.capitalize +\n ' jobs at ' +\n @doc.xpath(\"//span[@id='where_container']//input//attribute::value\").to_s.capitalize\n end","title":""},{"docid":"2cc05883d0d65248669780e1da536d6b","score":"0.5236121","text":"def title\n item.title ? item.title.strip : ''\n end","title":""},{"docid":"55294565713e88eb864ce35a8a970540","score":"0.52301216","text":"def title\n title = og.title || meta.title || body.title\n title.strip if title\n end","title":""},{"docid":"007e353c36672a63d790e2ee7054d04d","score":"0.5219609","text":"def title\n if collection_title_element\n collection_title_element.title\n end\n end","title":""},{"docid":"007e353c36672a63d790e2ee7054d04d","score":"0.5219609","text":"def title\n if collection_title_element\n collection_title_element.title\n end\n end","title":""},{"docid":"007e353c36672a63d790e2ee7054d04d","score":"0.5219609","text":"def title\n if collection_title_element\n collection_title_element.title\n end\n end","title":""},{"docid":"1321341ba7ab116fb2f8303340c665e4","score":"0.5218828","text":"def title\n title = read_attribute(:title)\n if title\n title.strip!\n end\n return title\n end","title":""},{"docid":"cf32d2a9f685a47ff7764430bc6096f0","score":"0.51886964","text":"def job_description\n data.job_description\n end","title":""},{"docid":"b81941d7c5a31902516d54a7366e7a83","score":"0.5169097","text":"def title\n @properties[PROP_TITLE]\n end","title":""},{"docid":"611f5688e3317405a9006eeb7b8aec6b","score":"0.51562756","text":"def title\n @title ||= @data.fetch 'title', ''\n end","title":""},{"docid":"b35919992e155b7c89e49cb8490bf3f2","score":"0.5129457","text":"def title\n return \"\" unless parent\n Array(parent.title).first.to_s\n end","title":""},{"docid":"ef70e68c246d0a9d35699f22e8c30300","score":"0.51285297","text":"def title\n if @title.is_a? String\n @title\n end\n end","title":""},{"docid":"1f8af0f335b266a4120a289ec1dff7eb","score":"0.51283586","text":"def source_title\n _retval = bib_source_title || get_item_data({name: 'TitleSource'})\n _reval = nil? if _retval == title # suppress if it's identical to title\n _retval.nil?? nil : _retval\n end","title":""},{"docid":"2f4991117374297d64ed5cc01d4e138d","score":"0.51275015","text":"def title\n @title ||= title&.first\n end","title":""},{"docid":"c24a43f157dc2c1223b66cd14c2e1c40","score":"0.51147485","text":"def title\n @title ||= parsed.css('head title').inner_text rescue nil\n end","title":""},{"docid":"c24a43f157dc2c1223b66cd14c2e1c40","score":"0.51147485","text":"def title\n @title ||= parsed.css('head title').inner_text rescue nil\n end","title":""},{"docid":"c24a43f157dc2c1223b66cd14c2e1c40","score":"0.51147485","text":"def title\n @title ||= parsed.css('head title').inner_text rescue nil\n end","title":""},{"docid":"b09b18248068791a2ab2be1844f0ca4d","score":"0.51128525","text":"def title\n \"#{fetch('name.title.descriptor')} #{fetch('name.title.level')} #{fetch('name.title.job')}\"\n end","title":""},{"docid":"4eea1f6e3c458faac815caf7122d26ec","score":"0.51055425","text":"def title\n attributes.fetch(\"title\", \"\").split(/\\n/).map(&:strip).first\n end","title":""},{"docid":"58b3b3cd3fb8a9a63fe76ac9d3e717bd","score":"0.5103617","text":"def title\n @title ||= (begin\n if self.node\n title_node = self.node.find_first(\"title\")\n if title_node && title_node.content\n title = title_node.content.strip\n end\n # Eww, but prevents segfaults\n title_node = nil\n GC.start\n end\n defined?(title) ? title : nil\n end)\n end","title":""},{"docid":"cddb5556c80e2b3bce19046cdf9b4523","score":"0.509564","text":"def title\n title = nil\n if self.work && self.work.TITLE_DISPLAY\n return self.work .TITLE_DISPLAY.sub(/^\\. \\-\\s*/,'')\n elsif self.RAW_DATA\n begin\n marc = MARC::Record.new_from_marc(self.RAW_DATA)\n if marc['245'] && marc['245']['a']\n return marc['245']['a']\n end\n rescue\n end\n end\n \"Title not available\"\n end","title":""},{"docid":"cf84de5997cd804268dd6ff16ec8a09a","score":"0.5094502","text":"def title\n @title ||= parsed.css('title').inner_text rescue nil\n end","title":""},{"docid":"f8dbbd12ca1a6752a6e710b20b9e2baa","score":"0.50934094","text":"def title\n @title.to_s\n end","title":""},{"docid":"cc88167f12a37b1edf5251c6019657bd","score":"0.5087884","text":"def get_title\n return nil if @bioextract_model.nil?\n return (@bioextract_model.title.blank? ? \"[untitled]\" : @bioextract_model.title)\n end","title":""},{"docid":"0ae6e02f35a6967a4aef9ea67e27a55b","score":"0.5084419","text":"def obj_title #:doc:\n obj.has_attribute?( :title ) ? obj.title : obj.name\n end","title":""},{"docid":"1f2b9e0d87a990472d17c8f7e42f6158","score":"0.5079529","text":"def retrieves_book_title()\n for book in @books\n return book[:title]\n end\n end","title":""},{"docid":"6db0d3f446407a9b10fffc18deabe666","score":"0.507484","text":"def title #:nodoc:\n return self.get_item.title\n end","title":""},{"docid":"dc5cdd550fc7112ebeb7b01e23294445","score":"0.5069009","text":"def title\n if @data['title']\n @data['title']\n else\n @data['title'] = field_fetch('T')\n end\n end","title":""},{"docid":"69bb664f03d28caad8d117b6fbe4c8f4","score":"0.50602645","text":"def title\n @title ||= begin\n fee = unpaid_fees.any? ? unpaid_fees.first : all_fees.first\n fee.nil? ? 'Missing Title' : fee.case_title\n end\n end","title":""},{"docid":"25713150a766178176c2516b01ff7e6a","score":"0.5044773","text":"def company_name\n return @children['company-name'][:value]\n end","title":""},{"docid":"da48085a98f5b13579dc2142db29411b","score":"0.5039939","text":"def job_title?(input, jobs, view)\n job_title = false\n jobs.each do |job|\n if job.title.to_s.upcase == input.upcase # account for case insensitivity\n view.print_details(job)\n job_title = true\n end\n end\n job_title\n end","title":""},{"docid":"0441a6a319424829f4008c6a89f2bf8f","score":"0.503465","text":"def title\n model.title.first\n end","title":""},{"docid":"5e4ad0159af5921d9b6983d94ae02c80","score":"0.50337726","text":"def get_title\n return nil if @deep_model.nil?\n return (@deep_model.title.blank? ? \"[untitled]\" : @deep_model.title)\n end","title":""},{"docid":"21f19d7773ef4fc8d8d1d17f5f2e15dd","score":"0.5018265","text":"def name\n name = ''\n if employee.present?\n name = employee.name\n else\n name = email.rpartition('@').first\n end\n return name.downcase.titleize\n end","title":""},{"docid":"7433303d70f3b3d43a85e9439d979bdf","score":"0.50175726","text":"def company_name\n @attributes[:company_name]\n end","title":""},{"docid":"530786b1f780569c4d5e35a62e60d1b9","score":"0.5017085","text":"def get_title\n return nil if @rapid_miner_model.nil?\n return nil if @rapid_miner_model.title.blank?\n\n @rapid_miner_model.title\n end","title":""},{"docid":"6fbaa853a5c877494cf4b12dc003831e","score":"0.5009576","text":"def title\n @title ||= title_tag.content\n end","title":""},{"docid":"9f9d3f2b33ea52be1730d89da30b8257","score":"0.5004252","text":"def name\n job_id\n end","title":""},{"docid":"531d4c67e32ac9eac60a3facb0caf9b4","score":"0.5002865","text":"def title\n return @data['title']\n end","title":""},{"docid":"6f26754a01f098eacbefa649286a97d5","score":"0.49993747","text":"def full_name\n company.full_name if company\n end","title":""},{"docid":"9068fc99485882a3866920bc49a77fad","score":"0.4994949","text":"def title\n return @entry_data[:title] unless @entry_data == nil\n pick_first_node(@entry.css('title'))\n end","title":""},{"docid":"5f49e31d7560f9c186cf50c9e54aabb6","score":"0.49874583","text":"def get_job_description\n\t\t\treturn \"Unemployed\".to_sym if current_user.profile.experience.empty?\n\t\t\tcurrent_user.profile.experience.each do |e|\n\t\t\t\treturn e.title.to_sym if e.is_still_working\n\t\t\tend\n\t\t\tcurrent_user.experience.order(end_time: :desc).first.title\n\t\tend","title":""},{"docid":"38e65c79194c15263d660947bd1fb6e7","score":"0.49843952","text":"def title\n @title ||= blog_link.text.strip\n end","title":""},{"docid":"3b50ce22b74f4d773e4cc93cdbcdb4a9","score":"0.4983592","text":"def title\n product_title_element.title if product_title_element\n end","title":""},{"docid":"d7d66babcc53b516f6439d0c76da8756","score":"0.4979334","text":"def title\n value(\"TITLE\")\n end","title":""},{"docid":"d7d66babcc53b516f6439d0c76da8756","score":"0.4979334","text":"def title\n value(\"TITLE\")\n end","title":""},{"docid":"d7d66babcc53b516f6439d0c76da8756","score":"0.4979334","text":"def title\n value(\"TITLE\")\n end","title":""},{"docid":"d7d66babcc53b516f6439d0c76da8756","score":"0.4979334","text":"def title\n value(\"TITLE\")\n end","title":""},{"docid":"53374a693f5cb467407de68681da26f5","score":"0.49765205","text":"def title\n title = read_attribute(:title)\n _(title) unless title.blank?\n end","title":""},{"docid":"8cc5bcf77222dbe49ffbda043c4afe5a","score":"0.49730426","text":"def get_title()\n return get_string(\"getTitle\", [])\n end","title":""},{"docid":"280b052da679e81c6bce44797b2e074e","score":"0.49631244","text":"def title\n if @data.key?(:tags)\n @data[:tags][:title]\n else\n nil\n end\n end","title":""},{"docid":"230bc0d5d21f0898cc6004a059fef6c1","score":"0.49602652","text":"def get_title\n if @title == nil\n return 'Azalo'\n else\n return @title\n end\n end","title":""},{"docid":"513d7b74198a1bfe50e3cce614ff8e68","score":"0.4960256","text":"def company_name\n return @company_name\n end","title":""},{"docid":"513d7b74198a1bfe50e3cce614ff8e68","score":"0.4960256","text":"def company_name\n return @company_name\n end","title":""},{"docid":"513d7b74198a1bfe50e3cce614ff8e68","score":"0.4960256","text":"def company_name\n return @company_name\n end","title":""},{"docid":"513d7b74198a1bfe50e3cce614ff8e68","score":"0.4960256","text":"def company_name\n return @company_name\n end","title":""},{"docid":"97e512c181e7837ee7186b78bd699ae3","score":"0.4955914","text":"def getTitle\n return @title.getText.to_s.strip\n end","title":""}],"string":"[\n {\n \"docid\": \"a78f13613821244769854fe059b71be2\",\n \"score\": \"0.6530419\",\n \"text\": \"def get_title(job)\\n job.search(\\\"h3\\\").text.strip\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dedd1cef7063368ca3ee4e266c8db7d0\",\n \"score\": \"0.6424466\",\n \"text\": \"def job_title=(value)\\n @job_title = value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dedd1cef7063368ca3ee4e266c8db7d0\",\n \"score\": \"0.6424466\",\n \"text\": \"def job_title=(value)\\n @job_title = value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dedd1cef7063368ca3ee4e266c8db7d0\",\n \"score\": \"0.6424466\",\n \"text\": \"def job_title=(value)\\n @job_title = value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dedd1cef7063368ca3ee4e266c8db7d0\",\n \"score\": \"0.6424466\",\n \"text\": \"def job_title=(value)\\n @job_title = value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e2f75d5cc76869fe0a230db0ebeb69b9\",\n \"score\": \"0.6184285\",\n \"text\": \"def title\\n \\\"#{job.company.company_name} - #{job.title} - #{student.name}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7363a84f67d2538e1b5bfe7a3f0cbd65\",\n \"score\": \"0.5944928\",\n \"text\": \"def title\\n composite = product.titles.first\\n if composite.nil?\\n nil\\n else\\n composite.title_text || composite.title_without_prefix\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"601dc254016369089d2ed5c1a2058fc6\",\n \"score\": \"0.5933641\",\n \"text\": \"def title\\n if is_journal?\\n return value(\\\"rft.jtitle\\\") || value(\\\"rft.title\\\")\\n end\\n\\n value_first(\\\"rft.btitle\\\").presence || value(\\\"rft.title\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9bb4c50f96f1eb1d2dc9f3ae1d7c3eb7\",\n \"score\": \"0.58361095\",\n \"text\": \"def job_title\\n if self.nna?\\n self.user_profile.try(:title)\\n elsif self.dsm?\\n self.position.try(:name)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5e0e31833679818db7522667ffec83a9\",\n \"score\": \"0.5804851\",\n \"text\": \"def job_title=(job_title)\\n\\n if !job_title.nil? && job_title.to_s.length > 1024\\n fail ArgumentError, \\\"invalid value for 'job_title', the character length must be smaller than or equal to 1024.\\\"\\n end\\n\\n @job_title = job_title\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d513bf2523c278d2002d5d2ec0356fd0\",\n \"score\": \"0.5749694\",\n \"text\": \"def set_JobTitle(value)\\n set_input(\\\"JobTitle\\\", value)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c326a5e65cebb59c75b2a9e70a7811fd\",\n \"score\": \"0.56531256\",\n \"text\": \"def job=(job_title)\\n\\t\\t@job = job_title\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d1995e5c6e0e87429e613fde2ed39b0\",\n \"score\": \"0.55619854\",\n \"text\": \"def job_title=(new_job_title)\\n @job_title = new_job_title\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d35a7fa32f2a20df9cfaa3356c9e3c91\",\n \"score\": \"0.5556228\",\n \"text\": \"def draft_title\\n if self.draft?\\n if self.title.empty?\\n return I18n.t('jobs.new.modal_job_draft.no_title')\\n else\\n return self.title\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d35a7fa32f2a20df9cfaa3356c9e3c91\",\n \"score\": \"0.5556228\",\n \"text\": \"def draft_title\\n if self.draft?\\n if self.title.empty?\\n return I18n.t('jobs.new.modal_job_draft.no_title')\\n else\\n return self.title\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b11b13102f6a722aa918ef7bd60fc5d5\",\n \"score\": \"0.55311507\",\n \"text\": \"def job_name_entry\\n if job\\n job.to_s\\n else\\n job_name_override\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d90ce438de6080944ecacc0f4b3858ee\",\n \"score\": \"0.55197734\",\n \"text\": \"def staff_job_titles\\n # Only the title attribute\\n job_titles.map(&:title)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"90fbc94653239a764294f2c3974a3e1c\",\n \"score\": \"0.5497869\",\n \"text\": \"def getJobName()\\n return @jobName\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"377a7c3dfec8e887e80b42990b5c705c\",\n \"score\": \"0.54858\",\n \"text\": \"def bib_title\\n if @bib_entity && @bib_entity.fetch('Titles', {}).any?\\n item_bib_title = @bib_entity.fetch('Titles', {}).find{|item| item['Type'] == 'main'}\\n if item_bib_title\\n item_bib_title['TitleFull']\\n else\\n nil\\n end\\n else\\n nil\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1e5dfbb0a1b6a5af94001b5c9b27a2eb\",\n \"score\": \"0.54676014\",\n \"text\": \"def set_JobTitle(value)\\n set_input(\\\"JobTitle\\\", value)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1a2df579dc63038036785e170a570028\",\n \"score\": \"0.54253846\",\n \"text\": \"def job_description\\n data[:job_description]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36c2a05c1209531ed018d88740142e96\",\n \"score\": \"0.5414098\",\n \"text\": \"def title\\n if @title_text\\n @title_text\\n else\\n if @title_without_prefix\\n if @title_prefix\\n \\\"#{@title_prefix} #{@title_without_prefix}\\\"\\n else\\n @title_without_prefix\\n end\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36c2a05c1209531ed018d88740142e96\",\n \"score\": \"0.5414098\",\n \"text\": \"def title\\n if @title_text\\n @title_text\\n else\\n if @title_without_prefix\\n if @title_prefix\\n \\\"#{@title_prefix} #{@title_without_prefix}\\\"\\n else\\n @title_without_prefix\\n end\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36c2a05c1209531ed018d88740142e96\",\n \"score\": \"0.54134864\",\n \"text\": \"def title\\n if @title_text\\n @title_text\\n else\\n if @title_without_prefix\\n if @title_prefix\\n \\\"#{@title_prefix} #{@title_without_prefix}\\\"\\n else\\n @title_without_prefix\\n end\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"275561d77f3ef5146f75e2b134c64629\",\n \"score\": \"0.54080623\",\n \"text\": \"def college_job_titles\\n Staff.where(college_id: self.college_id).select(:job_title).distinct\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"984de03f528b4fd32be30f222c87c76b\",\n \"score\": \"0.53807485\",\n \"text\": \"def title\\n fetch(FIELD_TITLE, nil)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d772b6980001dbc96eebeb97194b75c3\",\n \"score\": \"0.5356024\",\n \"text\": \"def title\\n @title ||= begin\\n Utilities.longest_common_substring_in_array(titles) || titles.first\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"77e2a26730dd088cc28cff5fa655d5b9\",\n \"score\": \"0.535352\",\n \"text\": \"def title\\n title = read_attribute(:title)\\n title.blank? ? '(No title)' : title\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dafdac3336ae4aabcf60cc3e372dec4e\",\n \"score\": \"0.53470933\",\n \"text\": \"def job_title\\n Faker::Job.title\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6b8ddd23402b6a8168b175f888f66944\",\n \"score\": \"0.5327445\",\n \"text\": \"def book_title\\n part_of_title_by_type('Book')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f9fd54ccf7698eac50e2d72e7d10bedf\",\n \"score\": \"0.53207695\",\n \"text\": \"def item_title_for_solr\\n return FinderHelper.strip(item.item_title)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6cfd1401fd066accd620d3554aa0033d\",\n \"score\": \"0.53013384\",\n \"text\": \"def title\\n title = (self.titles || []).first\\n title.nil? || title == '' ? self.key : title\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"70c2079d40b8c0353e386ea4b8eef283\",\n \"score\": \"0.528038\",\n \"text\": \"def title\\n self.properties ?\\n self.properties.title : ''\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"70c2079d40b8c0353e386ea4b8eef283\",\n \"score\": \"0.528038\",\n \"text\": \"def title\\n self.properties ?\\n self.properties.title : ''\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b8279e742ef94279ac9dbec7d5154c2d\",\n \"score\": \"0.52695936\",\n \"text\": \"def journal_title\\n Array(object.try(:journal_title)).first || ''\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1550b21bba9cc6ab300b5573ee9bf9c6\",\n \"score\": \"0.5260696\",\n \"text\": \"def title\\n query_property_values :predicate => DCTERMS.title do |title|\\n return title\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d861be68a4b81bf44761c1995f1b820\",\n \"score\": \"0.52593166\",\n \"text\": \"def getTitle\\r\\n\\t\\t\\t\\t\\treturn @title\\r\\n\\t\\t\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d861be68a4b81bf44761c1995f1b820\",\n \"score\": \"0.52593166\",\n \"text\": \"def getTitle\\r\\n\\t\\t\\t\\t\\treturn @title\\r\\n\\t\\t\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cae54101cd50422dd8587b780f8ac1bf\",\n \"score\": \"0.52563745\",\n \"text\": \"def journal_title\\n part_of_title_by_type('Journal')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"425c98da0e507a318b2124a19ff87a32\",\n \"score\": \"0.52551365\",\n \"text\": \"def get_title\\n title = self.title\\n\\n if title.nil?\\n return \\\"\\\"\\n else\\n return title\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bb1d7120c8da5cd25de659caf7980f58\",\n \"score\": \"0.52483934\",\n \"text\": \"def search_title\\n @doc.xpath(\\\"//span[@id='what_container']//input//attribute::value\\\").to_s.capitalize +\\n ' jobs at ' +\\n @doc.xpath(\\\"//span[@id='where_container']//input//attribute::value\\\").to_s.capitalize\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2cc05883d0d65248669780e1da536d6b\",\n \"score\": \"0.5236121\",\n \"text\": \"def title\\n item.title ? item.title.strip : ''\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"55294565713e88eb864ce35a8a970540\",\n \"score\": \"0.52301216\",\n \"text\": \"def title\\n title = og.title || meta.title || body.title\\n title.strip if title\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"007e353c36672a63d790e2ee7054d04d\",\n \"score\": \"0.5219609\",\n \"text\": \"def title\\n if collection_title_element\\n collection_title_element.title\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"007e353c36672a63d790e2ee7054d04d\",\n \"score\": \"0.5219609\",\n \"text\": \"def title\\n if collection_title_element\\n collection_title_element.title\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"007e353c36672a63d790e2ee7054d04d\",\n \"score\": \"0.5219609\",\n \"text\": \"def title\\n if collection_title_element\\n collection_title_element.title\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1321341ba7ab116fb2f8303340c665e4\",\n \"score\": \"0.5218828\",\n \"text\": \"def title\\n title = read_attribute(:title)\\n if title\\n title.strip!\\n end\\n return title\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cf32d2a9f685a47ff7764430bc6096f0\",\n \"score\": \"0.51886964\",\n \"text\": \"def job_description\\n data.job_description\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b81941d7c5a31902516d54a7366e7a83\",\n \"score\": \"0.5169097\",\n \"text\": \"def title\\n @properties[PROP_TITLE]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"611f5688e3317405a9006eeb7b8aec6b\",\n \"score\": \"0.51562756\",\n \"text\": \"def title\\n @title ||= @data.fetch 'title', ''\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b35919992e155b7c89e49cb8490bf3f2\",\n \"score\": \"0.5129457\",\n \"text\": \"def title\\n return \\\"\\\" unless parent\\n Array(parent.title).first.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ef70e68c246d0a9d35699f22e8c30300\",\n \"score\": \"0.51285297\",\n \"text\": \"def title\\n if @title.is_a? String\\n @title\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1f8af0f335b266a4120a289ec1dff7eb\",\n \"score\": \"0.51283586\",\n \"text\": \"def source_title\\n _retval = bib_source_title || get_item_data({name: 'TitleSource'})\\n _reval = nil? if _retval == title # suppress if it's identical to title\\n _retval.nil?? nil : _retval\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2f4991117374297d64ed5cc01d4e138d\",\n \"score\": \"0.51275015\",\n \"text\": \"def title\\n @title ||= title&.first\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c24a43f157dc2c1223b66cd14c2e1c40\",\n \"score\": \"0.51147485\",\n \"text\": \"def title\\n @title ||= parsed.css('head title').inner_text rescue nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c24a43f157dc2c1223b66cd14c2e1c40\",\n \"score\": \"0.51147485\",\n \"text\": \"def title\\n @title ||= parsed.css('head title').inner_text rescue nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c24a43f157dc2c1223b66cd14c2e1c40\",\n \"score\": \"0.51147485\",\n \"text\": \"def title\\n @title ||= parsed.css('head title').inner_text rescue nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b09b18248068791a2ab2be1844f0ca4d\",\n \"score\": \"0.51128525\",\n \"text\": \"def title\\n \\\"#{fetch('name.title.descriptor')} #{fetch('name.title.level')} #{fetch('name.title.job')}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4eea1f6e3c458faac815caf7122d26ec\",\n \"score\": \"0.51055425\",\n \"text\": \"def title\\n attributes.fetch(\\\"title\\\", \\\"\\\").split(/\\\\n/).map(&:strip).first\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"58b3b3cd3fb8a9a63fe76ac9d3e717bd\",\n \"score\": \"0.5103617\",\n \"text\": \"def title\\n @title ||= (begin\\n if self.node\\n title_node = self.node.find_first(\\\"title\\\")\\n if title_node && title_node.content\\n title = title_node.content.strip\\n end\\n # Eww, but prevents segfaults\\n title_node = nil\\n GC.start\\n end\\n defined?(title) ? title : nil\\n end)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cddb5556c80e2b3bce19046cdf9b4523\",\n \"score\": \"0.509564\",\n \"text\": \"def title\\n title = nil\\n if self.work && self.work.TITLE_DISPLAY\\n return self.work .TITLE_DISPLAY.sub(/^\\\\. \\\\-\\\\s*/,'')\\n elsif self.RAW_DATA\\n begin\\n marc = MARC::Record.new_from_marc(self.RAW_DATA)\\n if marc['245'] && marc['245']['a']\\n return marc['245']['a']\\n end\\n rescue\\n end\\n end\\n \\\"Title not available\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cf84de5997cd804268dd6ff16ec8a09a\",\n \"score\": \"0.5094502\",\n \"text\": \"def title\\n @title ||= parsed.css('title').inner_text rescue nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f8dbbd12ca1a6752a6e710b20b9e2baa\",\n \"score\": \"0.50934094\",\n \"text\": \"def title\\n @title.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cc88167f12a37b1edf5251c6019657bd\",\n \"score\": \"0.5087884\",\n \"text\": \"def get_title\\n return nil if @bioextract_model.nil?\\n return (@bioextract_model.title.blank? ? \\\"[untitled]\\\" : @bioextract_model.title)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0ae6e02f35a6967a4aef9ea67e27a55b\",\n \"score\": \"0.5084419\",\n \"text\": \"def obj_title #:doc:\\n obj.has_attribute?( :title ) ? obj.title : obj.name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1f2b9e0d87a990472d17c8f7e42f6158\",\n \"score\": \"0.5079529\",\n \"text\": \"def retrieves_book_title()\\n for book in @books\\n return book[:title]\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6db0d3f446407a9b10fffc18deabe666\",\n \"score\": \"0.507484\",\n \"text\": \"def title #:nodoc:\\n return self.get_item.title\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dc5cdd550fc7112ebeb7b01e23294445\",\n \"score\": \"0.5069009\",\n \"text\": \"def title\\n if @data['title']\\n @data['title']\\n else\\n @data['title'] = field_fetch('T')\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"69bb664f03d28caad8d117b6fbe4c8f4\",\n \"score\": \"0.50602645\",\n \"text\": \"def title\\n @title ||= begin\\n fee = unpaid_fees.any? ? unpaid_fees.first : all_fees.first\\n fee.nil? ? 'Missing Title' : fee.case_title\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"25713150a766178176c2516b01ff7e6a\",\n \"score\": \"0.5044773\",\n \"text\": \"def company_name\\n return @children['company-name'][:value]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"da48085a98f5b13579dc2142db29411b\",\n \"score\": \"0.5039939\",\n \"text\": \"def job_title?(input, jobs, view)\\n job_title = false\\n jobs.each do |job|\\n if job.title.to_s.upcase == input.upcase # account for case insensitivity\\n view.print_details(job)\\n job_title = true\\n end\\n end\\n job_title\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0441a6a319424829f4008c6a89f2bf8f\",\n \"score\": \"0.503465\",\n \"text\": \"def title\\n model.title.first\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5e4ad0159af5921d9b6983d94ae02c80\",\n \"score\": \"0.50337726\",\n \"text\": \"def get_title\\n return nil if @deep_model.nil?\\n return (@deep_model.title.blank? ? \\\"[untitled]\\\" : @deep_model.title)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"21f19d7773ef4fc8d8d1d17f5f2e15dd\",\n \"score\": \"0.5018265\",\n \"text\": \"def name\\n name = ''\\n if employee.present?\\n name = employee.name\\n else\\n name = email.rpartition('@').first\\n end\\n return name.downcase.titleize\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7433303d70f3b3d43a85e9439d979bdf\",\n \"score\": \"0.50175726\",\n \"text\": \"def company_name\\n @attributes[:company_name]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"530786b1f780569c4d5e35a62e60d1b9\",\n \"score\": \"0.5017085\",\n \"text\": \"def get_title\\n return nil if @rapid_miner_model.nil?\\n return nil if @rapid_miner_model.title.blank?\\n\\n @rapid_miner_model.title\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6fbaa853a5c877494cf4b12dc003831e\",\n \"score\": \"0.5009576\",\n \"text\": \"def title\\n @title ||= title_tag.content\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9f9d3f2b33ea52be1730d89da30b8257\",\n \"score\": \"0.5004252\",\n \"text\": \"def name\\n job_id\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"531d4c67e32ac9eac60a3facb0caf9b4\",\n \"score\": \"0.5002865\",\n \"text\": \"def title\\n return @data['title']\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6f26754a01f098eacbefa649286a97d5\",\n \"score\": \"0.49993747\",\n \"text\": \"def full_name\\n company.full_name if company\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9068fc99485882a3866920bc49a77fad\",\n \"score\": \"0.4994949\",\n \"text\": \"def title\\n return @entry_data[:title] unless @entry_data == nil\\n pick_first_node(@entry.css('title'))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5f49e31d7560f9c186cf50c9e54aabb6\",\n \"score\": \"0.49874583\",\n \"text\": \"def get_job_description\\n\\t\\t\\treturn \\\"Unemployed\\\".to_sym if current_user.profile.experience.empty?\\n\\t\\t\\tcurrent_user.profile.experience.each do |e|\\n\\t\\t\\t\\treturn e.title.to_sym if e.is_still_working\\n\\t\\t\\tend\\n\\t\\t\\tcurrent_user.experience.order(end_time: :desc).first.title\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38e65c79194c15263d660947bd1fb6e7\",\n \"score\": \"0.49843952\",\n \"text\": \"def title\\n @title ||= blog_link.text.strip\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3b50ce22b74f4d773e4cc93cdbcdb4a9\",\n \"score\": \"0.4983592\",\n \"text\": \"def title\\n product_title_element.title if product_title_element\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7d66babcc53b516f6439d0c76da8756\",\n \"score\": \"0.4979334\",\n \"text\": \"def title\\n value(\\\"TITLE\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7d66babcc53b516f6439d0c76da8756\",\n \"score\": \"0.4979334\",\n \"text\": \"def title\\n value(\\\"TITLE\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7d66babcc53b516f6439d0c76da8756\",\n \"score\": \"0.4979334\",\n \"text\": \"def title\\n value(\\\"TITLE\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7d66babcc53b516f6439d0c76da8756\",\n \"score\": \"0.4979334\",\n \"text\": \"def title\\n value(\\\"TITLE\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53374a693f5cb467407de68681da26f5\",\n \"score\": \"0.49765205\",\n \"text\": \"def title\\n title = read_attribute(:title)\\n _(title) unless title.blank?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8cc5bcf77222dbe49ffbda043c4afe5a\",\n \"score\": \"0.49730426\",\n \"text\": \"def get_title()\\n return get_string(\\\"getTitle\\\", [])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"280b052da679e81c6bce44797b2e074e\",\n \"score\": \"0.49631244\",\n \"text\": \"def title\\n if @data.key?(:tags)\\n @data[:tags][:title]\\n else\\n nil\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"230bc0d5d21f0898cc6004a059fef6c1\",\n \"score\": \"0.49602652\",\n \"text\": \"def get_title\\n if @title == nil\\n return 'Azalo'\\n else\\n return @title\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"513d7b74198a1bfe50e3cce614ff8e68\",\n \"score\": \"0.4960256\",\n \"text\": \"def company_name\\n return @company_name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"513d7b74198a1bfe50e3cce614ff8e68\",\n \"score\": \"0.4960256\",\n \"text\": \"def company_name\\n return @company_name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"513d7b74198a1bfe50e3cce614ff8e68\",\n \"score\": \"0.4960256\",\n \"text\": \"def company_name\\n return @company_name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"513d7b74198a1bfe50e3cce614ff8e68\",\n \"score\": \"0.4960256\",\n \"text\": \"def company_name\\n return @company_name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"97e512c181e7837ee7186b78bd699ae3\",\n \"score\": \"0.4955914\",\n \"text\": \"def getTitle\\n return @title.getText.to_s.strip\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":169,"cells":{"query_id":{"kind":"string","value":"aefa8d90f52f31a413fe56d7e1a86ee1"},"query":{"kind":"string","value":"Returns concatenation of first and last names if person, otherwise returns name. Thus, if you wanted to, for example, iterate over search results and output the name, you could do so without checking entity type first."},"positive_passages":{"kind":"list like","value":[{"docid":"a6e6d63f1a204e23854c45ede4340b62","score":"0.65779984","text":"def name\n if @namespace == \"person\"\n @first_name + \" \" + @last_name\n else\n @name\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"a6e6d63f1a204e23854c45ede4340b62\",\n \"score\": \"0.65779984\",\n \"text\": \"def name\\n if @namespace == \\\"person\\\"\\n @first_name + \\\" \\\" + @last_name\\n else\\n @name\\n end\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"d5aba45b654e5c5984ad2567844a409a","score":"0.72772914","text":"def person_name \n \"#{person.first} #{person.last}\"\n end","title":""},{"docid":"5739fda430e59a9c7153045d2ae60b3f","score":"0.7267522","text":"def person_entity_display_name(person_entity, name_display_type)\n person_entity_display_names(person_entity, name_display_type).join(\" \")\n end","title":""},{"docid":"a3aae54458d7a4ce12a0ea7847b90577","score":"0.7194565","text":"def full_name\n # compact will not add space if one of the names is missing.\n # we cant talk about first_name and last_name here because we are not in\n # the context of a model, where self is the actual model\n # the object is the parent of these fields\n # object is pointed at the defined query field \"author(id:)\" in query_type.rb\n ([object.first_name, object.last_name].compact).join \" \"\n end","title":""},{"docid":"c572884ae1d73ddc0ac21b38f554781b","score":"0.70225215","text":"def name\n if object.type == 'Person'\n # name = ''\n # unless object.gender.blank?\n # name = I18n.t(:\"#{object.gender}_indirect\") + ' '\n # end\n # name = name + object.firstname + ' ' + object.lastname\n object.name\n else\n object.name\n end\n end","title":""},{"docid":"8100faee15fb393a9e6df10a5e1dc160","score":"0.6965409","text":"def person_full_name_helper(personal_detail_type)\n if personal_detail_type\n personal_detail_type.person.firstName + ' ' + personal_detail_type.person.lastName\n end\n end","title":""},{"docid":"0106601f62fa4b1b5d286a1bdab99103","score":"0.6902664","text":"def full_name \n ([object.first_name, object.last_name].compact).join(\" \")\n end","title":""},{"docid":"36100ba893351b569474e46b61e13b7b","score":"0.6892179","text":"def full_name\n object.name + \" \" + object.surname\n end","title":""},{"docid":"babbea03022dfde6888efaead786a9e2","score":"0.6880189","text":"def name_to_listing(person)\n given_name = [person.first_name, person.middle_name].reject(&:nil? || empty?).join(' ')\n sir_name = content_tag(:strong, mixed_case(person.last_name))\n raw([mixed_case(given_name), sir_name, person.name_sfx].reject(&:nil? || empty?).join(' '))\n end","title":""},{"docid":"170566cd99558de093f0123cfa24c41a","score":"0.68737805","text":"def name\n name = first_name\n if last_name.present?\n name = name + ' ' + last_name\n end\n return name\n end","title":""},{"docid":"fa1114a0553050cc75433bb900e259dc","score":"0.68536884","text":"def fullName()\r\n\t\t@first + ' ' + @middle + ' ' + @last\r\n\tend","title":""},{"docid":"809259c563152626771da8f21100d2db","score":"0.682682","text":"def fullname\n \"#{object[:first]} #{object[:last]}\"\n end","title":""},{"docid":"892e221ece9ecd3fcaf6288dff1844a8","score":"0.68124676","text":"def name\n name_sum = \"\"\n name_sum << first_name if first_name.present?\n name_sum << \" \" if first_name.present? and last_name.present?\n name_sum << last_name if last_name.present?\n name_sum << \"Unknown(##{id})\" if name_sum.empty?\n name_sum\n end","title":""},{"docid":"d76d362daef0ebddfd289eb2b3a42629","score":"0.6808383","text":"def fullName()\r\n \t@first + \" \" + @middle + \" \" + @last\r\n end","title":""},{"docid":"4fb4dda2b4bbed740e226cc3ceb508a6","score":"0.67907953","text":"def full_name\n \"#{first_name.name} #{middle_name.name}\"\n end","title":""},{"docid":"aad734417ae719bcc4c96575496e5a81","score":"0.6790697","text":"def fullname\r\n [firstname, lastname].join(' ')\r\n end","title":""},{"docid":"d010915b8a4e9defa43dc0430581eeab","score":"0.67866373","text":"def name\n if first_name.present? && last_name.present?\n \"#{first_name} #{last_name}\"\n end\n end","title":""},{"docid":"924fbc3d5ec0e1c71f0b479671cbdfac","score":"0.678537","text":"def fullName()\n\t\t@first + ' ' + @middle + ' ' + @last\n\tend","title":""},{"docid":"dcae9730f973548e6b7bd8455c09da33","score":"0.6784203","text":"def get_name_given_person_id person_id\n person = Person.find(person_id)\n \"#{person.first_name.capitalize.truncate(15)} #{person.last_name.capitalize.truncate(15)}\"\n end","title":""},{"docid":"fd3b0c27875946911addeb95ff91390b","score":"0.67817396","text":"def fullName\n\n fullName = \"\"\n\n if self.first.present?\n\n fullName = self.first.capitalize\n\n if self.last.present?\n\n fullName = \"#{self.first.capitalize} #{self.last.capitalize}\"\n\n end\n\n end\n\n return fullName\n\n end","title":""},{"docid":"a60459d10b20526501bd770fe6f44275","score":"0.67586976","text":"def name\n [firstname, lastname].compact.join(\" \")\n end","title":""},{"docid":"d181c584c8c20153cefd0954ebad5c17","score":"0.67573357","text":"def fullName()\r\n\treturn first + \" \" + middle + \" \" + last\r\n end","title":""},{"docid":"d181c584c8c20153cefd0954ebad5c17","score":"0.67573357","text":"def fullName()\r\n\treturn first + \" \" + middle + \" \" + last\r\n end","title":""},{"docid":"f036ec74b98efff8408c5731cecd760e","score":"0.6754798","text":"def full_name_last_first\n return self.first_name unless (self.last_name.length > 0)\n return (self.last_name + \", \" + self.first_name)\n end","title":""},{"docid":"3d9e6b1b5d131624d856167f62b3a207","score":"0.6753205","text":"def full_name\n result = ''\n result = first_names unless first_names.blank?\n result += ' ' if !result.blank?\n result += last_name\n result\n end","title":""},{"docid":"d31cd8c5f2d06c92295ea6881213db34","score":"0.6750147","text":"def fullName\r\n return @first + \" \" + @middle + \" \" + @last\r\n end","title":""},{"docid":"1280086d7079d865e88b808009c814e0","score":"0.67479545","text":"def name\n if first_name && last_name\n \"#{first_name.capitalize} #{last_name.capitalize.first}.\"\n else\n \"Anomyme\"\n end\n end","title":""},{"docid":"209ecd8debfbe200e7ca550527dca5a1","score":"0.6741253","text":"def display_name\n [read_attribute(:first_name), read_attribute(:last_name)].join(' ')\n end","title":""},{"docid":"95bc48cfc5ef59e9dbb87a22eb4bf22e","score":"0.67315286","text":"def full_name\n (self.first_name if self.first_name) +\n (self.middle_name + ' ' if self.middle_name) +\n (self.last_name + ' ' if self.last_name)\n end","title":""},{"docid":"96c5d4ccfdb57478be0ad7cd1228acb3","score":"0.6724142","text":"def person_first_names_for_solr_as_string\n return FinderHelper.strip(role.person.first_names.downcase) unless role.person.blank?\n end","title":""},{"docid":"76d87ca2bc354eeae1d6d08898ef92ed","score":"0.67100793","text":"def displayed_name\n first_name.present? || last_name.present? ? \"#{last_name}#{first_name.blank? ? '' : ', ' + first_name}\" : 'NAME NOT PROVIDED'\n end","title":""},{"docid":"76d87ca2bc354eeae1d6d08898ef92ed","score":"0.67100793","text":"def displayed_name\n first_name.present? || last_name.present? ? \"#{last_name}#{first_name.blank? ? '' : ', ' + first_name}\" : 'NAME NOT PROVIDED'\n end","title":""},{"docid":"d6acd7b3c3250874fef8117838b2be0b","score":"0.6702349","text":"def full_name\n \"#{object.first_name} #{object.last_name}\"\n end","title":""},{"docid":"d6acd7b3c3250874fef8117838b2be0b","score":"0.6702349","text":"def full_name\n \"#{object.first_name} #{object.last_name}\"\n end","title":""},{"docid":"d6acd7b3c3250874fef8117838b2be0b","score":"0.6702349","text":"def full_name\n \"#{object.first_name} #{object.last_name}\"\n end","title":""},{"docid":"1377bea1150739bebf0d02f444e93b51","score":"0.67001075","text":"def full_name\n \t[first, last].join(\" \")\n end","title":""},{"docid":"6157579b3337b2b8972ef0b67a21ff46","score":"0.6699039","text":"def last_name_first\n \n name = self.last_name + \", \" + self.first_name\n name += \" (#{self.nickname})\" unless self.nickname.blank?\n name\n \n end","title":""},{"docid":"101af9280f9c6c807cb2cfc59294a22c","score":"0.66888285","text":"def display_name\n \t\"#{object.first_name} #{object.last_name.first}.\"\n end","title":""},{"docid":"64421e35b32b08c3ac18c697d574198e","score":"0.66568303","text":"def full_name\n [first_name, last_name].select(&:present?).join(' ')\n end","title":""},{"docid":"36f288abf6a71145cc0f204ed0c0eeeb","score":"0.66551715","text":"def full_name\n names = self.names.first\n return (names.given_name || '') + \" \" + (names.family_name || '')\n end","title":""},{"docid":"2aab4da1dc241801a2f5f13dd4413e0a","score":"0.6652891","text":"def full_name_first_last\n return self.first_name unless (self.last_name.length > 0)\n return (self.first_name + \" \" + self.last_name)\n end","title":""},{"docid":"b3ce37bab6b7f77dcf15b2ba716e0227","score":"0.6647453","text":"def name_to_listing(person)\n given_name = [person.name_first, person.name_middle].reject(&:nil? || empty?).join(' ')\n sir_name = content_tag(:strong, mixed_case(person.name_last))\n raw([person.name_pfx, mixed_case(given_name), sir_name, person.name_sfx].reject(&:nil? || empty?).join(' '))\n end","title":""},{"docid":"083e0cf54cd6a8eebf6b893975fa500b","score":"0.66442287","text":"def get_name\n @lname.to_s + \", \" + @fname.to_s\n # calls to_s on each in case not already String\n end","title":""},{"docid":"bab443960a7bce4d6a84a0846b8a3bef","score":"0.66384643","text":"def name\n [ first_name, last_name ].join(' ')\n end","title":""},{"docid":"c5999cd094fe3af2b42a803c3d262ee9","score":"0.66371167","text":"def first_and_last_name\n \"#{self.lName} \" \" #{self.fName} \" \" #{self.patronymic}\"\n end","title":""},{"docid":"f97064c7360843fee4a715b3a217b229","score":"0.66314805","text":"def full_name\n return @full_name unless @full_name.nil?\n\n full_name = []\n full_name << personGivenName if respond_to?(:personGivenName)\n full_name << personFamilyName if respond_to?(:personFamilyName)\n\n @full_name = full_name.join(' ')\n end","title":""},{"docid":"53532b42060b02d39a1540b9ceac113e","score":"0.66256773","text":"def full_name\n [firstname, lastname].join ' '\n end","title":""},{"docid":"57585129d482c553be432183c4023753","score":"0.6606222","text":"def name\n [first_name, last_name].join(' ')\n end","title":""},{"docid":"57585129d482c553be432183c4023753","score":"0.6606222","text":"def name\n [first_name, last_name].join(' ')\n end","title":""},{"docid":"57585129d482c553be432183c4023753","score":"0.6606222","text":"def name\n [first_name, last_name].join(' ')\n end","title":""},{"docid":"23e6efba50f1041e85572c48f47cf022","score":"0.6605796","text":"def fullname_and_email person\n %w(fullname email).map do |key|\n return_value_unless_object_nil(person, key).to_s\n end\n end","title":""},{"docid":"c6c67dce8c552955ff26cfd5816ea294","score":"0.6599902","text":"def other_name\n respond_to?(:personOtherNames) ? personOtherNames : ''\n end","title":""},{"docid":"2809e55619088c186eea3644cda42831","score":"0.6595069","text":"def name\n \"#{object.surname}, #{object.given_name}\"\n end","title":""},{"docid":"d7e55e37eb5897378ff46e207dd5ad6a","score":"0.6595033","text":"def display_name\n [first_name, middle_name, last_name].compact.join(' ')\n end","title":""},{"docid":"41ae29407b51d6a024490fd503ee3557","score":"0.65929186","text":"def fullname \n [first_name, last_name].join(\" \")\n end","title":""},{"docid":"9ae55026b1cb88c033c657314657e383","score":"0.6591211","text":"def name\n [@first_name, @last_name].compact.join(' ')\n end","title":""},{"docid":"66abd3d04bd0c030b1039c8949915e43","score":"0.6591051","text":"def fullname \n\t [first_name, last_name].join(' ')\n end","title":""},{"docid":"a2f3e27dab7421cfdb5b766ff5d6d9b7","score":"0.6590329","text":"def name\n\t\t[last_name, first_name].compact.join(', ')\n\tend","title":""},{"docid":"e5963d0d7c0e1c6369dd5c2b1dcf8d64","score":"0.6587808","text":"def name\n [first_name, last_name].compact.join(' ')\n end","title":""},{"docid":"e5963d0d7c0e1c6369dd5c2b1dcf8d64","score":"0.6587808","text":"def name\n [first_name, last_name].compact.join(' ')\n end","title":""},{"docid":"97b2faf9b78c47fc515f490ac9b0ffbf","score":"0.65869606","text":"def name\n result = []\n result << self.first_name\n result << self.last_name\n result.compact.map {|m| m.to_s.strip}.reject {|i| i.blank?}.join(' ')\n end","title":""},{"docid":"e627feb7a3d7d3872c109648ae0ead9a","score":"0.65846527","text":"def person_full_name_for_solr\n return FinderHelper.strip(role.person.full_name) unless role.person.blank?\n end","title":""},{"docid":"d6b891f301db11184d63a1589c8c4111","score":"0.65831715","text":"def name\n [*first_name, *last_name].join(\" \")\n end","title":""},{"docid":"44e7bfe09d7aa0b573d89d83602f9a42","score":"0.65824014","text":"def full_name\n return self.first_name.to_s.humanize + \" \" + self.last_name.to_s.humanize if self\n end","title":""},{"docid":"c7d5982e44964b50deffb4e02385dbd5","score":"0.6580623","text":"def display_name\n \"#{first_name} #{last_name.first}.\"\n end","title":""},{"docid":"aa5be18b8c74759873558af50c645e72","score":"0.6576255","text":"def name\n [self.first_name, self.last_name].join(' ')\n end","title":""},{"docid":"8daf82c9f5cb0d91b9dfc10f6f03c5bc","score":"0.6573658","text":"def name\n [first_name, last_name].join \" \"\n end","title":""},{"docid":"a0087601c1ac3d5e7bec7f61d6c65723","score":"0.65687686","text":"def virtual_full_name\n [ name_title,\n first_name,\n nickname_or_other.blank? ? nil : \"'#{ nickname_or_other }'\",\n last_name ].reject(&:blank?).join(' ')\n end","title":""},{"docid":"91e1de6595d4572da7a0ce0366f076e1","score":"0.6565998","text":"def full_name\n if first_name.present? and last_name.present?\n name = first_name + ' ' + last_name\n elsif first_name.present? and !last_name.present?\n name = first_name\n elsif !first_name.present? and last_name.present?\n name = last_name\n end\n return name\n end","title":""},{"docid":"05169394a7f07e4c68f7a589f176df78","score":"0.6564148","text":"def full_name\n data = []\n data << self.first_name unless self.first_name.blank?\n data << self.last_name unless self.last_name.blank?\n data.join(' ')\n end","title":""},{"docid":"cca3ebf5b8dde649ec32850b4924ebe8","score":"0.6563519","text":"def full_name\n [self.first_name, self.last_name].join(' ')\n end","title":""},{"docid":"ca220947926c00e6a87a52ac5217b4b0","score":"0.65628123","text":"def whole_name()\n return \"#{first_name} #{last_name}\"\n end","title":""},{"docid":"f1102241ab000aaec38affee674c0b57","score":"0.6561854","text":"def name\n [self.first_name, self.last_name].compact.join(' ')\n end","title":""},{"docid":"f1102241ab000aaec38affee674c0b57","score":"0.6561854","text":"def name\n [self.first_name, self.last_name].compact.join(' ')\n end","title":""},{"docid":"7d53d556d7485bc6ccd48717abdb3261","score":"0.65547913","text":"def display_name\n person.name\n end","title":""},{"docid":"5627675fa6f730c3fc954a1c9c8c0488","score":"0.65491456","text":"def full_name\n \tif last_name.nil?\n \t\treturn name\n \telse\n \t\treturn name + \" \" + last_name\n \tend\n end","title":""},{"docid":"1d63a77023760bbd9373c8d88185c12a","score":"0.65461797","text":"def name\n [first_name, last_name].join(' ')\n end","title":""},{"docid":"701ca6d05a9eadb1c59ce07b336e9ee0","score":"0.65461016","text":"def name\n last_name + \", \" + first_name\n end","title":""},{"docid":"b9cf21e5f2a3b1a6056e38bfa0858fd2","score":"0.6545577","text":"def name\n [first_name, last_name].compact.join ' '\n end","title":""},{"docid":"49028ea9ea93602f38283904a6695c8e","score":"0.6543684","text":"def full_name\n \"#{self.name} #{self.lastname} #{self.mother_lastname}\"\n end","title":""},{"docid":"7f9acbf1b101cc0866816ad4e83c749e","score":"0.6542854","text":"def name\n [first_name, last_name].join ' '\n end","title":""},{"docid":"7f9acbf1b101cc0866816ad4e83c749e","score":"0.6542854","text":"def name\n [first_name, last_name].join ' '\n end","title":""},{"docid":"10e1bc8fae1ec504768418c4da50b095","score":"0.65384513","text":"def say_persons_name(person)\n\tputs \"#{person[:name]} is from #{person[:hometown]}\"\nend","title":""},{"docid":"cf2a4496e0bdf4eee45c69d1fecd4378","score":"0.6537797","text":"def name\n if self.last_name_show == true \n return self.first_name + \" \" + self.last_name\n else\n return self.first_name\n end\n end","title":""},{"docid":"f5f0aec074c893504d261f5501f17895","score":"0.65344876","text":"def full_name\n [first_name, middle_name, last_name].join(\" \")\n end","title":""},{"docid":"f59c1adb3eb84f4528be6b598e6821ff","score":"0.6532677","text":"def full_name\n \"#{first_name.try(:humanize)} #{last_name.try(:humanize)}\".lstrip.rstrip\n end","title":""},{"docid":"a3a9a5a9ab045d0bbc0051dde099fed8","score":"0.6531752","text":"def get_fullname()\n request = { 'method' => 'user.get', 'output' => 'extend' }\n whoami = self.get({ 'output' => 'extend' })\n return whoami[0][\"name\"] + \" \" + whoami[0][\"surname\"]\n end","title":""},{"docid":"3e6f32be55feba62c212422295f663cc","score":"0.6523049","text":"def name\n first_name.to_s + \" \" + last_name.to_s\n end","title":""},{"docid":"0842f12788f58964d82c69926c309035","score":"0.65221786","text":"def fullName\n myFullName = @first + \" \" + @middle + \" \" + @last\n end","title":""},{"docid":"d2448f9c5eb4b6b6092a2f98896da7e1","score":"0.6520249","text":"def name\n if self.nil? || self.first_name.nil? || self.last_name.nil?\n return nil\n else return self.first_name + \" \" + self.last_name\n end\n end","title":""},{"docid":"d2448f9c5eb4b6b6092a2f98896da7e1","score":"0.6520249","text":"def name\n if self.nil? || self.first_name.nil? || self.last_name.nil?\n return nil\n else return self.first_name + \" \" + self.last_name\n end\n end","title":""},{"docid":"78db59cebe12fda3af55791441672be3","score":"0.65198326","text":"def name\n [@first_name, @last_name].compact.join(' ')\n end","title":""},{"docid":"90c212fc675f91b3a1cb5901854d5f29","score":"0.65188795","text":"def fullname\n return [self.first_name, self.last_name].compact.join(\" \") if ! self.first_name.blank? || ! self.last_name.blank?\n end","title":""},{"docid":"049d53d0f3a2325fa1a7041b3419d088","score":"0.65185654","text":"def full_name\n\t\treturn self.salutation.to_s + \" \" + self.lastname.to_s + \" \" + self.firstname.to_s\n end","title":""},{"docid":"8fe493dab4f4fa98f72accc7678b3420","score":"0.6517704","text":"def full_name\n \"#{self.last_name}#{self.first_name ? (', ' + self.first_name) : ''}#{self.middle_name ? (' ' + self.middle_name) : ''}\"\n end","title":""},{"docid":"92bf7928f7d7ca0df961ce452deb196a","score":"0.6513084","text":"def fullname\n return @first_name.capitalize + \" \" + @surname.capitalize\n end","title":""},{"docid":"ca2e1501371d5f2d18ee4ae680526e4d","score":"0.6512661","text":"def name\n [first_name, last_name].join(\" \")\n end","title":""},{"docid":"794cd1c486624c85ceb3a0874b598b05","score":"0.65067214","text":"def full_name\n [first_name, last_name].join(' ')\n end","title":""},{"docid":"794cd1c486624c85ceb3a0874b598b05","score":"0.65067214","text":"def full_name\n [first_name, last_name].join(' ')\n end","title":""},{"docid":"794cd1c486624c85ceb3a0874b598b05","score":"0.65067214","text":"def full_name\n [first_name, last_name].join(' ')\n end","title":""},{"docid":"794cd1c486624c85ceb3a0874b598b05","score":"0.65067214","text":"def full_name\n [first_name, last_name].join(' ')\n end","title":""}],"string":"[\n {\n \"docid\": \"d5aba45b654e5c5984ad2567844a409a\",\n \"score\": \"0.72772914\",\n \"text\": \"def person_name \\n \\\"#{person.first} #{person.last}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5739fda430e59a9c7153045d2ae60b3f\",\n \"score\": \"0.7267522\",\n \"text\": \"def person_entity_display_name(person_entity, name_display_type)\\n person_entity_display_names(person_entity, name_display_type).join(\\\" \\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3aae54458d7a4ce12a0ea7847b90577\",\n \"score\": \"0.7194565\",\n \"text\": \"def full_name\\n # compact will not add space if one of the names is missing.\\n # we cant talk about first_name and last_name here because we are not in\\n # the context of a model, where self is the actual model\\n # the object is the parent of these fields\\n # object is pointed at the defined query field \\\"author(id:)\\\" in query_type.rb\\n ([object.first_name, object.last_name].compact).join \\\" \\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c572884ae1d73ddc0ac21b38f554781b\",\n \"score\": \"0.70225215\",\n \"text\": \"def name\\n if object.type == 'Person'\\n # name = ''\\n # unless object.gender.blank?\\n # name = I18n.t(:\\\"#{object.gender}_indirect\\\") + ' '\\n # end\\n # name = name + object.firstname + ' ' + object.lastname\\n object.name\\n else\\n object.name\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8100faee15fb393a9e6df10a5e1dc160\",\n \"score\": \"0.6965409\",\n \"text\": \"def person_full_name_helper(personal_detail_type)\\n if personal_detail_type\\n personal_detail_type.person.firstName + ' ' + personal_detail_type.person.lastName\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0106601f62fa4b1b5d286a1bdab99103\",\n \"score\": \"0.6902664\",\n \"text\": \"def full_name \\n ([object.first_name, object.last_name].compact).join(\\\" \\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36100ba893351b569474e46b61e13b7b\",\n \"score\": \"0.6892179\",\n \"text\": \"def full_name\\n object.name + \\\" \\\" + object.surname\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"babbea03022dfde6888efaead786a9e2\",\n \"score\": \"0.6880189\",\n \"text\": \"def name_to_listing(person)\\n given_name = [person.first_name, person.middle_name].reject(&:nil? || empty?).join(' ')\\n sir_name = content_tag(:strong, mixed_case(person.last_name))\\n raw([mixed_case(given_name), sir_name, person.name_sfx].reject(&:nil? || empty?).join(' '))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"170566cd99558de093f0123cfa24c41a\",\n \"score\": \"0.68737805\",\n \"text\": \"def name\\n name = first_name\\n if last_name.present?\\n name = name + ' ' + last_name\\n end\\n return name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fa1114a0553050cc75433bb900e259dc\",\n \"score\": \"0.68536884\",\n \"text\": \"def fullName()\\r\\n\\t\\t@first + ' ' + @middle + ' ' + @last\\r\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"809259c563152626771da8f21100d2db\",\n \"score\": \"0.682682\",\n \"text\": \"def fullname\\n \\\"#{object[:first]} #{object[:last]}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"892e221ece9ecd3fcaf6288dff1844a8\",\n \"score\": \"0.68124676\",\n \"text\": \"def name\\n name_sum = \\\"\\\"\\n name_sum << first_name if first_name.present?\\n name_sum << \\\" \\\" if first_name.present? and last_name.present?\\n name_sum << last_name if last_name.present?\\n name_sum << \\\"Unknown(##{id})\\\" if name_sum.empty?\\n name_sum\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d76d362daef0ebddfd289eb2b3a42629\",\n \"score\": \"0.6808383\",\n \"text\": \"def fullName()\\r\\n \\t@first + \\\" \\\" + @middle + \\\" \\\" + @last\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4fb4dda2b4bbed740e226cc3ceb508a6\",\n \"score\": \"0.67907953\",\n \"text\": \"def full_name\\n \\\"#{first_name.name} #{middle_name.name}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aad734417ae719bcc4c96575496e5a81\",\n \"score\": \"0.6790697\",\n \"text\": \"def fullname\\r\\n [firstname, lastname].join(' ')\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d010915b8a4e9defa43dc0430581eeab\",\n \"score\": \"0.67866373\",\n \"text\": \"def name\\n if first_name.present? && last_name.present?\\n \\\"#{first_name} #{last_name}\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"924fbc3d5ec0e1c71f0b479671cbdfac\",\n \"score\": \"0.678537\",\n \"text\": \"def fullName()\\n\\t\\t@first + ' ' + @middle + ' ' + @last\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dcae9730f973548e6b7bd8455c09da33\",\n \"score\": \"0.6784203\",\n \"text\": \"def get_name_given_person_id person_id\\n person = Person.find(person_id)\\n \\\"#{person.first_name.capitalize.truncate(15)} #{person.last_name.capitalize.truncate(15)}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fd3b0c27875946911addeb95ff91390b\",\n \"score\": \"0.67817396\",\n \"text\": \"def fullName\\n\\n fullName = \\\"\\\"\\n\\n if self.first.present?\\n\\n fullName = self.first.capitalize\\n\\n if self.last.present?\\n\\n fullName = \\\"#{self.first.capitalize} #{self.last.capitalize}\\\"\\n\\n end\\n\\n end\\n\\n return fullName\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a60459d10b20526501bd770fe6f44275\",\n \"score\": \"0.67586976\",\n \"text\": \"def name\\n [firstname, lastname].compact.join(\\\" \\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d181c584c8c20153cefd0954ebad5c17\",\n \"score\": \"0.67573357\",\n \"text\": \"def fullName()\\r\\n\\treturn first + \\\" \\\" + middle + \\\" \\\" + last\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d181c584c8c20153cefd0954ebad5c17\",\n \"score\": \"0.67573357\",\n \"text\": \"def fullName()\\r\\n\\treturn first + \\\" \\\" + middle + \\\" \\\" + last\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f036ec74b98efff8408c5731cecd760e\",\n \"score\": \"0.6754798\",\n \"text\": \"def full_name_last_first\\n return self.first_name unless (self.last_name.length > 0)\\n return (self.last_name + \\\", \\\" + self.first_name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3d9e6b1b5d131624d856167f62b3a207\",\n \"score\": \"0.6753205\",\n \"text\": \"def full_name\\n result = ''\\n result = first_names unless first_names.blank?\\n result += ' ' if !result.blank?\\n result += last_name\\n result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d31cd8c5f2d06c92295ea6881213db34\",\n \"score\": \"0.6750147\",\n \"text\": \"def fullName\\r\\n return @first + \\\" \\\" + @middle + \\\" \\\" + @last\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1280086d7079d865e88b808009c814e0\",\n \"score\": \"0.67479545\",\n \"text\": \"def name\\n if first_name && last_name\\n \\\"#{first_name.capitalize} #{last_name.capitalize.first}.\\\"\\n else\\n \\\"Anomyme\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"209ecd8debfbe200e7ca550527dca5a1\",\n \"score\": \"0.6741253\",\n \"text\": \"def display_name\\n [read_attribute(:first_name), read_attribute(:last_name)].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"95bc48cfc5ef59e9dbb87a22eb4bf22e\",\n \"score\": \"0.67315286\",\n \"text\": \"def full_name\\n (self.first_name if self.first_name) +\\n (self.middle_name + ' ' if self.middle_name) +\\n (self.last_name + ' ' if self.last_name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"96c5d4ccfdb57478be0ad7cd1228acb3\",\n \"score\": \"0.6724142\",\n \"text\": \"def person_first_names_for_solr_as_string\\n return FinderHelper.strip(role.person.first_names.downcase) unless role.person.blank?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"76d87ca2bc354eeae1d6d08898ef92ed\",\n \"score\": \"0.67100793\",\n \"text\": \"def displayed_name\\n first_name.present? || last_name.present? ? \\\"#{last_name}#{first_name.blank? ? '' : ', ' + first_name}\\\" : 'NAME NOT PROVIDED'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"76d87ca2bc354eeae1d6d08898ef92ed\",\n \"score\": \"0.67100793\",\n \"text\": \"def displayed_name\\n first_name.present? || last_name.present? ? \\\"#{last_name}#{first_name.blank? ? '' : ', ' + first_name}\\\" : 'NAME NOT PROVIDED'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d6acd7b3c3250874fef8117838b2be0b\",\n \"score\": \"0.6702349\",\n \"text\": \"def full_name\\n \\\"#{object.first_name} #{object.last_name}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d6acd7b3c3250874fef8117838b2be0b\",\n \"score\": \"0.6702349\",\n \"text\": \"def full_name\\n \\\"#{object.first_name} #{object.last_name}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d6acd7b3c3250874fef8117838b2be0b\",\n \"score\": \"0.6702349\",\n \"text\": \"def full_name\\n \\\"#{object.first_name} #{object.last_name}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1377bea1150739bebf0d02f444e93b51\",\n \"score\": \"0.67001075\",\n \"text\": \"def full_name\\n \\t[first, last].join(\\\" \\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6157579b3337b2b8972ef0b67a21ff46\",\n \"score\": \"0.6699039\",\n \"text\": \"def last_name_first\\n \\n name = self.last_name + \\\", \\\" + self.first_name\\n name += \\\" (#{self.nickname})\\\" unless self.nickname.blank?\\n name\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"101af9280f9c6c807cb2cfc59294a22c\",\n \"score\": \"0.66888285\",\n \"text\": \"def display_name\\n \\t\\\"#{object.first_name} #{object.last_name.first}.\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"64421e35b32b08c3ac18c697d574198e\",\n \"score\": \"0.66568303\",\n \"text\": \"def full_name\\n [first_name, last_name].select(&:present?).join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36f288abf6a71145cc0f204ed0c0eeeb\",\n \"score\": \"0.66551715\",\n \"text\": \"def full_name\\n names = self.names.first\\n return (names.given_name || '') + \\\" \\\" + (names.family_name || '')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2aab4da1dc241801a2f5f13dd4413e0a\",\n \"score\": \"0.6652891\",\n \"text\": \"def full_name_first_last\\n return self.first_name unless (self.last_name.length > 0)\\n return (self.first_name + \\\" \\\" + self.last_name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b3ce37bab6b7f77dcf15b2ba716e0227\",\n \"score\": \"0.6647453\",\n \"text\": \"def name_to_listing(person)\\n given_name = [person.name_first, person.name_middle].reject(&:nil? || empty?).join(' ')\\n sir_name = content_tag(:strong, mixed_case(person.name_last))\\n raw([person.name_pfx, mixed_case(given_name), sir_name, person.name_sfx].reject(&:nil? || empty?).join(' '))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"083e0cf54cd6a8eebf6b893975fa500b\",\n \"score\": \"0.66442287\",\n \"text\": \"def get_name\\n @lname.to_s + \\\", \\\" + @fname.to_s\\n # calls to_s on each in case not already String\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bab443960a7bce4d6a84a0846b8a3bef\",\n \"score\": \"0.66384643\",\n \"text\": \"def name\\n [ first_name, last_name ].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c5999cd094fe3af2b42a803c3d262ee9\",\n \"score\": \"0.66371167\",\n \"text\": \"def first_and_last_name\\n \\\"#{self.lName} \\\" \\\" #{self.fName} \\\" \\\" #{self.patronymic}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f97064c7360843fee4a715b3a217b229\",\n \"score\": \"0.66314805\",\n \"text\": \"def full_name\\n return @full_name unless @full_name.nil?\\n\\n full_name = []\\n full_name << personGivenName if respond_to?(:personGivenName)\\n full_name << personFamilyName if respond_to?(:personFamilyName)\\n\\n @full_name = full_name.join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53532b42060b02d39a1540b9ceac113e\",\n \"score\": \"0.66256773\",\n \"text\": \"def full_name\\n [firstname, lastname].join ' '\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"57585129d482c553be432183c4023753\",\n \"score\": \"0.6606222\",\n \"text\": \"def name\\n [first_name, last_name].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"57585129d482c553be432183c4023753\",\n \"score\": \"0.6606222\",\n \"text\": \"def name\\n [first_name, last_name].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"57585129d482c553be432183c4023753\",\n \"score\": \"0.6606222\",\n \"text\": \"def name\\n [first_name, last_name].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"23e6efba50f1041e85572c48f47cf022\",\n \"score\": \"0.6605796\",\n \"text\": \"def fullname_and_email person\\n %w(fullname email).map do |key|\\n return_value_unless_object_nil(person, key).to_s\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c6c67dce8c552955ff26cfd5816ea294\",\n \"score\": \"0.6599902\",\n \"text\": \"def other_name\\n respond_to?(:personOtherNames) ? personOtherNames : ''\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2809e55619088c186eea3644cda42831\",\n \"score\": \"0.6595069\",\n \"text\": \"def name\\n \\\"#{object.surname}, #{object.given_name}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7e55e37eb5897378ff46e207dd5ad6a\",\n \"score\": \"0.6595033\",\n \"text\": \"def display_name\\n [first_name, middle_name, last_name].compact.join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"41ae29407b51d6a024490fd503ee3557\",\n \"score\": \"0.65929186\",\n \"text\": \"def fullname \\n [first_name, last_name].join(\\\" \\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9ae55026b1cb88c033c657314657e383\",\n \"score\": \"0.6591211\",\n \"text\": \"def name\\n [@first_name, @last_name].compact.join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"66abd3d04bd0c030b1039c8949915e43\",\n \"score\": \"0.6591051\",\n \"text\": \"def fullname \\n\\t [first_name, last_name].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a2f3e27dab7421cfdb5b766ff5d6d9b7\",\n \"score\": \"0.6590329\",\n \"text\": \"def name\\n\\t\\t[last_name, first_name].compact.join(', ')\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e5963d0d7c0e1c6369dd5c2b1dcf8d64\",\n \"score\": \"0.6587808\",\n \"text\": \"def name\\n [first_name, last_name].compact.join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e5963d0d7c0e1c6369dd5c2b1dcf8d64\",\n \"score\": \"0.6587808\",\n \"text\": \"def name\\n [first_name, last_name].compact.join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"97b2faf9b78c47fc515f490ac9b0ffbf\",\n \"score\": \"0.65869606\",\n \"text\": \"def name\\n result = []\\n result << self.first_name\\n result << self.last_name\\n result.compact.map {|m| m.to_s.strip}.reject {|i| i.blank?}.join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e627feb7a3d7d3872c109648ae0ead9a\",\n \"score\": \"0.65846527\",\n \"text\": \"def person_full_name_for_solr\\n return FinderHelper.strip(role.person.full_name) unless role.person.blank?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d6b891f301db11184d63a1589c8c4111\",\n \"score\": \"0.65831715\",\n \"text\": \"def name\\n [*first_name, *last_name].join(\\\" \\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"44e7bfe09d7aa0b573d89d83602f9a42\",\n \"score\": \"0.65824014\",\n \"text\": \"def full_name\\n return self.first_name.to_s.humanize + \\\" \\\" + self.last_name.to_s.humanize if self\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c7d5982e44964b50deffb4e02385dbd5\",\n \"score\": \"0.6580623\",\n \"text\": \"def display_name\\n \\\"#{first_name} #{last_name.first}.\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aa5be18b8c74759873558af50c645e72\",\n \"score\": \"0.6576255\",\n \"text\": \"def name\\n [self.first_name, self.last_name].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8daf82c9f5cb0d91b9dfc10f6f03c5bc\",\n \"score\": \"0.6573658\",\n \"text\": \"def name\\n [first_name, last_name].join \\\" \\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a0087601c1ac3d5e7bec7f61d6c65723\",\n \"score\": \"0.65687686\",\n \"text\": \"def virtual_full_name\\n [ name_title,\\n first_name,\\n nickname_or_other.blank? ? nil : \\\"'#{ nickname_or_other }'\\\",\\n last_name ].reject(&:blank?).join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"91e1de6595d4572da7a0ce0366f076e1\",\n \"score\": \"0.6565998\",\n \"text\": \"def full_name\\n if first_name.present? and last_name.present?\\n name = first_name + ' ' + last_name\\n elsif first_name.present? and !last_name.present?\\n name = first_name\\n elsif !first_name.present? and last_name.present?\\n name = last_name\\n end\\n return name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"05169394a7f07e4c68f7a589f176df78\",\n \"score\": \"0.6564148\",\n \"text\": \"def full_name\\n data = []\\n data << self.first_name unless self.first_name.blank?\\n data << self.last_name unless self.last_name.blank?\\n data.join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cca3ebf5b8dde649ec32850b4924ebe8\",\n \"score\": \"0.6563519\",\n \"text\": \"def full_name\\n [self.first_name, self.last_name].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ca220947926c00e6a87a52ac5217b4b0\",\n \"score\": \"0.65628123\",\n \"text\": \"def whole_name()\\n return \\\"#{first_name} #{last_name}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1102241ab000aaec38affee674c0b57\",\n \"score\": \"0.6561854\",\n \"text\": \"def name\\n [self.first_name, self.last_name].compact.join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1102241ab000aaec38affee674c0b57\",\n \"score\": \"0.6561854\",\n \"text\": \"def name\\n [self.first_name, self.last_name].compact.join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7d53d556d7485bc6ccd48717abdb3261\",\n \"score\": \"0.65547913\",\n \"text\": \"def display_name\\n person.name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5627675fa6f730c3fc954a1c9c8c0488\",\n \"score\": \"0.65491456\",\n \"text\": \"def full_name\\n \\tif last_name.nil?\\n \\t\\treturn name\\n \\telse\\n \\t\\treturn name + \\\" \\\" + last_name\\n \\tend\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d63a77023760bbd9373c8d88185c12a\",\n \"score\": \"0.65461797\",\n \"text\": \"def name\\n [first_name, last_name].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"701ca6d05a9eadb1c59ce07b336e9ee0\",\n \"score\": \"0.65461016\",\n \"text\": \"def name\\n last_name + \\\", \\\" + first_name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b9cf21e5f2a3b1a6056e38bfa0858fd2\",\n \"score\": \"0.6545577\",\n \"text\": \"def name\\n [first_name, last_name].compact.join ' '\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"49028ea9ea93602f38283904a6695c8e\",\n \"score\": \"0.6543684\",\n \"text\": \"def full_name\\n \\\"#{self.name} #{self.lastname} #{self.mother_lastname}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7f9acbf1b101cc0866816ad4e83c749e\",\n \"score\": \"0.6542854\",\n \"text\": \"def name\\n [first_name, last_name].join ' '\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7f9acbf1b101cc0866816ad4e83c749e\",\n \"score\": \"0.6542854\",\n \"text\": \"def name\\n [first_name, last_name].join ' '\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"10e1bc8fae1ec504768418c4da50b095\",\n \"score\": \"0.65384513\",\n \"text\": \"def say_persons_name(person)\\n\\tputs \\\"#{person[:name]} is from #{person[:hometown]}\\\"\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cf2a4496e0bdf4eee45c69d1fecd4378\",\n \"score\": \"0.6537797\",\n \"text\": \"def name\\n if self.last_name_show == true \\n return self.first_name + \\\" \\\" + self.last_name\\n else\\n return self.first_name\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f5f0aec074c893504d261f5501f17895\",\n \"score\": \"0.65344876\",\n \"text\": \"def full_name\\n [first_name, middle_name, last_name].join(\\\" \\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f59c1adb3eb84f4528be6b598e6821ff\",\n \"score\": \"0.6532677\",\n \"text\": \"def full_name\\n \\\"#{first_name.try(:humanize)} #{last_name.try(:humanize)}\\\".lstrip.rstrip\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3a9a5a9ab045d0bbc0051dde099fed8\",\n \"score\": \"0.6531752\",\n \"text\": \"def get_fullname()\\n request = { 'method' => 'user.get', 'output' => 'extend' }\\n whoami = self.get({ 'output' => 'extend' })\\n return whoami[0][\\\"name\\\"] + \\\" \\\" + whoami[0][\\\"surname\\\"]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3e6f32be55feba62c212422295f663cc\",\n \"score\": \"0.6523049\",\n \"text\": \"def name\\n first_name.to_s + \\\" \\\" + last_name.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0842f12788f58964d82c69926c309035\",\n \"score\": \"0.65221786\",\n \"text\": \"def fullName\\n myFullName = @first + \\\" \\\" + @middle + \\\" \\\" + @last\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d2448f9c5eb4b6b6092a2f98896da7e1\",\n \"score\": \"0.6520249\",\n \"text\": \"def name\\n if self.nil? || self.first_name.nil? || self.last_name.nil?\\n return nil\\n else return self.first_name + \\\" \\\" + self.last_name\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d2448f9c5eb4b6b6092a2f98896da7e1\",\n \"score\": \"0.6520249\",\n \"text\": \"def name\\n if self.nil? || self.first_name.nil? || self.last_name.nil?\\n return nil\\n else return self.first_name + \\\" \\\" + self.last_name\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"78db59cebe12fda3af55791441672be3\",\n \"score\": \"0.65198326\",\n \"text\": \"def name\\n [@first_name, @last_name].compact.join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"90c212fc675f91b3a1cb5901854d5f29\",\n \"score\": \"0.65188795\",\n \"text\": \"def fullname\\n return [self.first_name, self.last_name].compact.join(\\\" \\\") if ! self.first_name.blank? || ! self.last_name.blank?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"049d53d0f3a2325fa1a7041b3419d088\",\n \"score\": \"0.65185654\",\n \"text\": \"def full_name\\n\\t\\treturn self.salutation.to_s + \\\" \\\" + self.lastname.to_s + \\\" \\\" + self.firstname.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8fe493dab4f4fa98f72accc7678b3420\",\n \"score\": \"0.6517704\",\n \"text\": \"def full_name\\n \\\"#{self.last_name}#{self.first_name ? (', ' + self.first_name) : ''}#{self.middle_name ? (' ' + self.middle_name) : ''}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"92bf7928f7d7ca0df961ce452deb196a\",\n \"score\": \"0.6513084\",\n \"text\": \"def fullname\\n return @first_name.capitalize + \\\" \\\" + @surname.capitalize\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ca2e1501371d5f2d18ee4ae680526e4d\",\n \"score\": \"0.6512661\",\n \"text\": \"def name\\n [first_name, last_name].join(\\\" \\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"794cd1c486624c85ceb3a0874b598b05\",\n \"score\": \"0.65067214\",\n \"text\": \"def full_name\\n [first_name, last_name].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"794cd1c486624c85ceb3a0874b598b05\",\n \"score\": \"0.65067214\",\n \"text\": \"def full_name\\n [first_name, last_name].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"794cd1c486624c85ceb3a0874b598b05\",\n \"score\": \"0.65067214\",\n \"text\": \"def full_name\\n [first_name, last_name].join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"794cd1c486624c85ceb3a0874b598b05\",\n \"score\": \"0.65067214\",\n \"text\": \"def full_name\\n [first_name, last_name].join(' ')\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":170,"cells":{"query_id":{"kind":"string","value":"8af09f83c1917e76bdc0fbf8e0eb834b"},"query":{"kind":"string","value":"GET /rumors/1 GET /rumors/1.json"},"positive_passages":{"kind":"list like","value":[{"docid":"a81945373733e4951b987de6ea99f9a1","score":"0.0","text":"def show\n end","title":""}],"string":"[\n {\n \"docid\": \"a81945373733e4951b987de6ea99f9a1\",\n \"score\": \"0.0\",\n \"text\": \"def show\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"ab4fdc7df3211fe71d2739cd47029f01","score":"0.77128285","text":"def index\n @rumors = Rumor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rumors }\n end\n end","title":""},{"docid":"9f653227a9d5bfdbc67550ab160859f6","score":"0.76127523","text":"def index\n @rumors = Rumor.all\n end","title":""},{"docid":"81416934961681494205b336f07d5050","score":"0.76122427","text":"def get_rumor\n\t\t@rumor=Rumor.find(params[:id])\n\tend","title":""},{"docid":"2b0071864cc3282f92cc84df06abf2bf","score":"0.74952614","text":"def show\n @rumor = Rumor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rumor }\n end\n end","title":""},{"docid":"6b70c119e9a0b0c89504b6084830791b","score":"0.6885701","text":"def set_rumor\n @rumor = Rumor.find(params[:id])\n end","title":""},{"docid":"4eb4431d1bec048e9ecf16ef582e11b8","score":"0.65216154","text":"def new\n @rumor = Rumor.new\n @bubbles = Bubble.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rumor }\n end\n end","title":""},{"docid":"da1c3f5e4f8fd4c01bd95ec0dd616230","score":"0.65196437","text":"def index\n @riders = Rider.all\n render json: @riders\n end","title":""},{"docid":"273c3d03f0844c4bba6f3ab3182173da","score":"0.6373264","text":"def index\n @riders = Rider.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @riders }\n end\n end","title":""},{"docid":"4d159094976c1c997102612c75800228","score":"0.6325504","text":"def show\n @raum = Raum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @raum }\n end\n end","title":""},{"docid":"a3f4ab2bf613a7ef5a958038efe62fd9","score":"0.62488616","text":"def create\n @rumor = Rumor.new(params[:rumor])\n\n respond_to do |format|\n if @rumor.save\n format.html { redirect_to @rumor, notice: 'Rumor was successfully created.' }\n format.json { render json: @rumor, status: :created, location: @rumor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rumor.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"c5fd2ba5a64d01539a70c6cc8fbddcc4","score":"0.61901873","text":"def riders\n @current_tab = \"Meetings\"\n \n sess = Patron::Session.new\n sess.base_url = \"http://online.equipe.com/\"\n #http://online.equipe.com/api/v1/meetings.json\n response = sess.get \"api/v1/meetings/\" + params[:id].to_s + \"/riders.json\"\n @meetings = JSON.parse response.body\n \n \n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meetings }\n end\n \n end","title":""},{"docid":"abb32443b8ec52c0e998c3fc4672eb21","score":"0.6122663","text":"def show\n @tumor = Tumor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tumor }\n end\n end","title":""},{"docid":"73688a2f0e7e742e79b2cd880134bcf3","score":"0.6078659","text":"def show\n\t\t@rubro = Rubro.find_by :id_rubro => params[:id]\n\t\tif @rubro\n\t\t\trender :json => @rubro\n\t\telse\n\t\t\trender :json => {}, status: :not_found\n\t\tend\n\tend","title":""},{"docid":"48db886a8b44ed777d9a13e9e312859b","score":"0.6073736","text":"def index\n @raters = Rater.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @raters }\n end\n end","title":""},{"docid":"e6d85b8abc71d78f660e05d005c744f6","score":"0.6071787","text":"def show\n @renter = Renter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @renter }\n end\n end","title":""},{"docid":"0d667b5dcb0b5e3cfc590b107099ba20","score":"0.60652584","text":"def index\n rents = Rent.where(:user_id => params[:user_id])\n render json: {:success => true, :api_token => @user.api_token, :rents=> JSON.parse(rents.to_json)}, status: 201\n end","title":""},{"docid":"089b7e7cf84bf138daaef5dae3c5a0a0","score":"0.6055485","text":"def create\n @rumor = Rumor.new(rumor_params)\n\n respond_to do |format|\n if @rumor.save\n format.html { redirect_to @rumor, notice: 'Rumor was successfully created.' }\n format.json { render :show, status: :created, location: @rumor }\n else\n format.html { render :new }\n format.json { render json: @rumor.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"029fdbc040b0d52c233aa8b4aa70c665","score":"0.6051352","text":"def index\n @riders = Rider.all\n end","title":""},{"docid":"029fdbc040b0d52c233aa8b4aa70c665","score":"0.6051352","text":"def index\n @riders = Rider.all\n end","title":""},{"docid":"df6062d8f9512bc7214f9b2859b50760","score":"0.6050502","text":"def show\n @runit = Runit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runit }\n end\n end","title":""},{"docid":"6b2c036b0c6f0b4558b42fdbd3c03e1d","score":"0.6012217","text":"def index\n @renters = Renter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renters }\n end\n end","title":""},{"docid":"526a684a5edae647e3adea9abe0a4fb9","score":"0.5994665","text":"def index\n @armors = Armor.all\n\n render json: @armors\n end","title":""},{"docid":"ae5b9538361ded87b07960e41b741eb3","score":"0.5994327","text":"def index\n @rushes = Rush.all\n end","title":""},{"docid":"093d9b6c276af2351ebd17fb1b8d0df7","score":"0.5987503","text":"def index\n @rulings = Ruling.all\n end","title":""},{"docid":"7d2bacfcee1724bc0988e2bdf3e64543","score":"0.59845746","text":"def index\n @rullings = @moot.rullings\n end","title":""},{"docid":"a5b00eff2393ea7dd9d776e4226b515f","score":"0.59427357","text":"def show\n @lure = Lure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lure }\n end\n end","title":""},{"docid":"5e8229468235db5d245cd485bdcaf247","score":"0.5940836","text":"def show\n @receitum = Receitum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @receitum }\n end\n end","title":""},{"docid":"b5d6b9e6da1b588e52541668062a5da4","score":"0.5936712","text":"def show\n rent = Rent.find(params[:id])\n render json: {:success => true, :api_token => @user.api_token, :rents=> JSON.parse(rent.to_json)}, status: 201\n end","title":""},{"docid":"2bfd9ad9712b61e14ad61c43b87324b2","score":"0.59358776","text":"def show\n @rto = Motor::Rto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rto }\n end\n end","title":""},{"docid":"dad5f0ba59915e4405688b91b36a048b","score":"0.5933121","text":"def show\n @reimbursable = Reimbursable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reimbursable }\n end\n end","title":""},{"docid":"1bd57b64bc80f0b39aba6623336543d5","score":"0.59153926","text":"def index\n @rendus = Rendu.all\n end","title":""},{"docid":"761353d255a4fecdef2ff64567f71a6f","score":"0.5910352","text":"def destroy\n @rumor = Rumor.find(params[:id])\n @rumor.destroy\n\n respond_to do |format|\n format.html { redirect_to rumors_url }\n format.json { head :no_content }\n end\n end","title":""},{"docid":"5e1be10b1248fa732549fa55d85c0e0b","score":"0.5891894","text":"def index\n @racers = Racer.all\n\n render json: @racers\n end","title":""},{"docid":"c506a0977d1617a20c3405031673649f","score":"0.58848476","text":"def show\n @rotum = Rotum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rotum }\n end\n end","title":""},{"docid":"8698b42b4a1f07aeba58cfad139814a4","score":"0.58788997","text":"def show\n @rider = Rider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rider }\n end\n end","title":""},{"docid":"8698b42b4a1f07aeba58cfad139814a4","score":"0.58788997","text":"def show\n @rider = Rider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rider }\n end\n end","title":""},{"docid":"8698b42b4a1f07aeba58cfad139814a4","score":"0.58788997","text":"def show\n @rider = Rider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rider }\n end\n end","title":""},{"docid":"9a0d54263e33c4286bc0f90bbae89afd","score":"0.5872339","text":"def index\n @rinventors = Rinventor.all\n end","title":""},{"docid":"e6f0542659aac0276695e2ebd3e32ac1","score":"0.5865673","text":"def show\n @rutinas = Rutina.find(params[:id])\n render json: @rutinas, status: :ok\n end","title":""},{"docid":"40207eca089f6b152fdfd2949bc69f0a","score":"0.5865218","text":"def index\n @rosters = Roster.all\n end","title":""},{"docid":"40207eca089f6b152fdfd2949bc69f0a","score":"0.5865218","text":"def index\n @rosters = Roster.all\n end","title":""},{"docid":"6e03abe08c751521d41b9722669d17d7","score":"0.58482677","text":"def update\n @rumor = Rumor.find(params[:id])\n\n respond_to do |format|\n if @rumor.update_attributes(params[:rumor])\n format.html { redirect_to @rumor, notice: 'Rumor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rumor.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"193af583792b4d628c7697d2d6afd744","score":"0.58454263","text":"def index\n @rosters = @race.rosters \n end","title":""},{"docid":"5f5ac084be93c0f155dff8d7bc58b431","score":"0.58327144","text":"def rulings\n Ruling.where(uuid: self.uuid)\n end","title":""},{"docid":"01336055944f1fe2243dd242c00f5501","score":"0.5819632","text":"def index\n @treasuries = Treasury.all\n\n respond_to do |format|\n format.html\n format.json { render json: @treasuries }\n end\n end","title":""},{"docid":"b1f546c398edce3b6028b414665f4d47","score":"0.5802899","text":"def index\n @draft_rosters = @team.draft_rosters.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @draft_rosters }\n end\n end","title":""},{"docid":"27a178d29b383539a35682e9aad3a8fc","score":"0.57880545","text":"def index\n @renters = Renter.all\n end","title":""},{"docid":"faf81518c8f5c1a8d653a2419e8e8611","score":"0.5784607","text":"def index\n @remisions = Remision.all\n end","title":""},{"docid":"a1d3a8c251e7224806884f7aa7b4194a","score":"0.5783038","text":"def update\n respond_to do |format|\n if @rumor.update(rumor_params)\n format.html { redirect_to @rumor, notice: 'Rumor was successfully updated.' }\n format.json { render :show, status: :ok, location: @rumor }\n else\n format.html { render :edit }\n format.json { render json: @rumor.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"4201076f9df09fcd6b66485ee5f5e85e","score":"0.5779308","text":"def index\n @rumes = Rume.all\n end","title":""},{"docid":"565b3b52a199255acf6cbf5cfd94462a","score":"0.5776494","text":"def show\n @ruku = Ruku.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ruku }\n end\n end","title":""},{"docid":"fe17c59a25bddba94a6bbea471e7d929","score":"0.5772886","text":"def index\n @recruiters = Recruiter.all\n\n render json: @recruiters\n end","title":""},{"docid":"068683315f451c3b6b97ef527627461e","score":"0.57700676","text":"def index\n @rous = Rou.all\n end","title":""},{"docid":"a50190b0f5a2d4b3d147cf3703554109","score":"0.5763425","text":"def show\n @retetum = Retetum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @retetum }\n end\n end","title":""},{"docid":"46c326321b2ebcb328a7e5dc96d9bff0","score":"0.5733074","text":"def show\n @rutina = Rutina.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rutina }\n end\n end","title":""},{"docid":"8fabdcb4fde9dae6fec8a4ad1a36b351","score":"0.5731037","text":"def index\n @ruis = Rui.all\n end","title":""},{"docid":"15243c5b2694440d9d59282cf33d8187","score":"0.57269675","text":"def show\r\n @race_runner = RaceRunner.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render :json => @race_runner }\r\n end\r\n end","title":""},{"docid":"26e73637b7c182d3e5c460c19f140005","score":"0.5725576","text":"def index\n @roofs = Roof.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roofs }\n end\n end","title":""},{"docid":"500d34a8999852975f8d43a9fd425919","score":"0.57227904","text":"def index\n @perriors = Perrior.all\n end","title":""},{"docid":"e1228f8bf4ee71767fd7d6e295c56b6e","score":"0.57196","text":"def index\n v = ValidateKey()\n \tif (v == nil)\n \t\trender json: nil\n \t\treturn\n \tend\n\n @user_rosters = UserRoster.all\n render json: @user_rosters\n end","title":""},{"docid":"4c793745d11f6159ad3607e872b4512c","score":"0.57109797","text":"def index\n @recrutadors = Recrutador.all\n end","title":""},{"docid":"dc77392e9ee94fa273f5e48c182b1ae9","score":"0.5708253","text":"def index\n @raiders = Raider.all\n end","title":""},{"docid":"fe5cb9b0fcfdfd5dd570042967d224ac","score":"0.5703694","text":"def set_rutum\n @rutum = Rutum.find(params[:id])\n end","title":""},{"docid":"79ffae6e2817113592f32004d2e575b7","score":"0.57021224","text":"def show\n @reunion = Reunion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reunion }\n end\n end","title":""},{"docid":"8d380e67f273ab5a71ea0b439750adb9","score":"0.5700675","text":"def show\n @realtor = Realtor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @realtor }\n end\n end","title":""},{"docid":"363a64ef76e4dcf06418de092091c594","score":"0.5700456","text":"def show\n @racer = Racer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @racer }\n end\n end","title":""},{"docid":"d169d8fbff11437a7ec64ca8757937c8","score":"0.569349","text":"def index\n @uesrs = Uesr.all\n end","title":""},{"docid":"64777c1266ba2dd03abf0dfa0dfc1431","score":"0.56918687","text":"def new\n @raum = Raum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @raum }\n end\n end","title":""},{"docid":"6426d3ad17d4c75be4c8b4b8d3e1d656","score":"0.5685785","text":"def index\n @murderers = Murderer.all\n end","title":""},{"docid":"840a8c532ce581a6518bc0928e73b3e4","score":"0.5685292","text":"def index\n @rages = Rage.all\n end","title":""},{"docid":"2a6017a7e74b6e5025f18c61dcbb187e","score":"0.568411","text":"def show\n @remittance = Remittance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @remittance }\n end\n end","title":""},{"docid":"a8ef98e8f393e2e54ccaa522a56aeff2","score":"0.56765914","text":"def index\n @ruolis = Ruoli.all\n end","title":""},{"docid":"4178b9a50d0261b758c24f5d82517c80","score":"0.56750333","text":"def index\n @rate_renters = RateRenter.all\n end","title":""},{"docid":"2109c96d50ec1c79fd31879f799566fb","score":"0.567326","text":"def show\n @rekord = Rekord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rekord }\n end\n end","title":""},{"docid":"80cd20868d60abeb4b2331bc131dd055","score":"0.56672776","text":"def show\n @rond = Rond.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rond }\n end\n end","title":""},{"docid":"a3570c3353ca1bcf1dc802128243dfab","score":"0.565928","text":"def show\n @rater = Rater.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rater }\n end\n end","title":""},{"docid":"af2e7499995e8c8dff5ee2c738708f79","score":"0.5650013","text":"def set_rulling\n @rulling = Rulling.find(params[:id])\n end","title":""},{"docid":"14a9569babc9d5f9fa8b3da83171ba7a","score":"0.56467724","text":"def index\n @rainfalls = Rainfall.all\n respond_to do |format|\n format.html { render json: @rainfalls} \n end\n end","title":""},{"docid":"25a7b0526d99d53ca994613a0469fc03","score":"0.5643731","text":"def index\n @rivalries = Rivalry.all\n end","title":""},{"docid":"b940a38e772208f7eab246c60cdf6a91","score":"0.56421036","text":"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @riders }\n end\n end","title":""},{"docid":"5ff162b5d9aff403035f87e63c75d9d8","score":"0.56402963","text":"def show\n @reagent = Reagent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reagent }\n end\n end","title":""},{"docid":"39f50d6018306835df2e3a2429619b34","score":"0.56370294","text":"def show\n @rrabat = Rrabat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rrabat }\n end\n end","title":""},{"docid":"65d6d165066819c7d2f28c74dfcc51e8","score":"0.56325585","text":"def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end","title":""},{"docid":"020aef71b87f0ddcd0322c32ab233f7c","score":"0.563149","text":"def show\n @reward = current_user.rewards.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reward }\n end\n end","title":""},{"docid":"e2b91757adaab32fcc7bd8c1568edd8e","score":"0.56300884","text":"def index\n # The variable @rents receive all rents.\n @rents = Rent.all\n end","title":""},{"docid":"c2e9fb3f7df13f8c22679e049193a593","score":"0.56250095","text":"def show\n @rat = @resturant.ratings\n\n respond_to do |format|\n format.html # show.html.erb\n format.json {render json: @resturant}\n end\n end","title":""},{"docid":"e40d2ebaa60e8a959ea38b6e5fc6369c","score":"0.5624238","text":"def show\n @royaume = Royaume.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @royaume }\n end\n end","title":""},{"docid":"032d96e34b34f50094826cccb00edba3","score":"0.5623009","text":"def index\n @api_v1_user_rewards = Api::V1::UserReward.all\n end","title":""},{"docid":"bf36f78f493a7e9db8aed21318b1b215","score":"0.56196696","text":"def get_monster(monster_id)\n RESTful.get(\"#{URL_MICROSERVICE_MONSTER}/monster/#{monster_id}\")\n end","title":""},{"docid":"b1d49029d163f149a85c45b8508dcf2e","score":"0.5617346","text":"def show\n @rudder_servo = RudderServo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rudder_servo }\n end\n end","title":""},{"docid":"6f9f49ccdb876da5051e309f6cf37961","score":"0.56160796","text":"def show\n @find_rainbow = FindRainbow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @find_rainbow }\n end\n end","title":""},{"docid":"53ba1f5878647eeadbbbd7c4bba36cdd","score":"0.5615892","text":"def index\n @tournament_rewards = TournamentReward.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tournament_rewards }\n end\n end","title":""},{"docid":"1dc89b333a1faddec02f115dfd0cddf5","score":"0.5615622","text":"def show\n @recette = Recette.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recette }\n end\n end","title":""},{"docid":"1dc89b333a1faddec02f115dfd0cddf5","score":"0.5614828","text":"def show\n @recette = Recette.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recette }\n end\n end","title":""},{"docid":"0b13acf366d8af8987e499b9d4647692","score":"0.56134176","text":"def index\n get_rubros\n end","title":""},{"docid":"ffc363b6cf1ebb6f2df19ad1accbae0c","score":"0.5611306","text":"def rosters\n @teams = Tournament.find(params[:id]).teams.find(:all, :include => :players)\n end","title":""},{"docid":"f6541117c3c65656a5a2e3c6c61741b7","score":"0.5609222","text":"def show\n reunion= Reunion.find_by_id params[:id]\n if reunion!= nil\n render(json: reunion, status: 200) \n else\n head 404\n end \n end","title":""},{"docid":"7802a5babfe5064780276be430e8d2ed","score":"0.55954033","text":"def show\n @agronomium = Agronomium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @agronomium }\n end\n end","title":""},{"docid":"e030075cb55284815d20aff9f81a83fb","score":"0.5590893","text":"def index\n @rankings = Rating.rankings\n\n respond_to do |format|\n format.html # ratings.html.erb\n format.json { render json: @ratings }\n end\n end","title":""},{"docid":"dbb2c2d343998c9285cd6b2d4b1de3a5","score":"0.5581527","text":"def show\n @race = Race.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @race }\n end\n end","title":""},{"docid":"8a21ffab318e961f31ea4f6c929584a8","score":"0.5569396","text":"def show\n @rteam = Rteam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rteam }\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"ab4fdc7df3211fe71d2739cd47029f01\",\n \"score\": \"0.77128285\",\n \"text\": \"def index\\n @rumors = Rumor.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @rumors }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9f653227a9d5bfdbc67550ab160859f6\",\n \"score\": \"0.76127523\",\n \"text\": \"def index\\n @rumors = Rumor.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"81416934961681494205b336f07d5050\",\n \"score\": \"0.76122427\",\n \"text\": \"def get_rumor\\n\\t\\t@rumor=Rumor.find(params[:id])\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2b0071864cc3282f92cc84df06abf2bf\",\n \"score\": \"0.74952614\",\n \"text\": \"def show\\n @rumor = Rumor.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rumor }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6b70c119e9a0b0c89504b6084830791b\",\n \"score\": \"0.6885701\",\n \"text\": \"def set_rumor\\n @rumor = Rumor.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4eb4431d1bec048e9ecf16ef582e11b8\",\n \"score\": \"0.65216154\",\n \"text\": \"def new\\n @rumor = Rumor.new\\n @bubbles = Bubble.all\\n\\n respond_to do |format|\\n format.html # new.html.erb\\n format.json { render json: @rumor }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"da1c3f5e4f8fd4c01bd95ec0dd616230\",\n \"score\": \"0.65196437\",\n \"text\": \"def index\\n @riders = Rider.all\\n render json: @riders\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"273c3d03f0844c4bba6f3ab3182173da\",\n \"score\": \"0.6373264\",\n \"text\": \"def index\\n @riders = Rider.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @riders }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d159094976c1c997102612c75800228\",\n \"score\": \"0.6325504\",\n \"text\": \"def show\\n @raum = Raum.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @raum }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3f4ab2bf613a7ef5a958038efe62fd9\",\n \"score\": \"0.62488616\",\n \"text\": \"def create\\n @rumor = Rumor.new(params[:rumor])\\n\\n respond_to do |format|\\n if @rumor.save\\n format.html { redirect_to @rumor, notice: 'Rumor was successfully created.' }\\n format.json { render json: @rumor, status: :created, location: @rumor }\\n else\\n format.html { render action: \\\"new\\\" }\\n format.json { render json: @rumor.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c5fd2ba5a64d01539a70c6cc8fbddcc4\",\n \"score\": \"0.61901873\",\n \"text\": \"def riders\\n @current_tab = \\\"Meetings\\\"\\n \\n sess = Patron::Session.new\\n sess.base_url = \\\"http://online.equipe.com/\\\"\\n #http://online.equipe.com/api/v1/meetings.json\\n response = sess.get \\\"api/v1/meetings/\\\" + params[:id].to_s + \\\"/riders.json\\\"\\n @meetings = JSON.parse response.body\\n \\n \\n \\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @meetings }\\n end\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"abb32443b8ec52c0e998c3fc4672eb21\",\n \"score\": \"0.6122663\",\n \"text\": \"def show\\n @tumor = Tumor.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @tumor }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"73688a2f0e7e742e79b2cd880134bcf3\",\n \"score\": \"0.6078659\",\n \"text\": \"def show\\n\\t\\t@rubro = Rubro.find_by :id_rubro => params[:id]\\n\\t\\tif @rubro\\n\\t\\t\\trender :json => @rubro\\n\\t\\telse\\n\\t\\t\\trender :json => {}, status: :not_found\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"48db886a8b44ed777d9a13e9e312859b\",\n \"score\": \"0.6073736\",\n \"text\": \"def index\\n @raters = Rater.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @raters }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6d85b8abc71d78f660e05d005c744f6\",\n \"score\": \"0.6071787\",\n \"text\": \"def show\\n @renter = Renter.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @renter }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0d667b5dcb0b5e3cfc590b107099ba20\",\n \"score\": \"0.60652584\",\n \"text\": \"def index\\n rents = Rent.where(:user_id => params[:user_id])\\n render json: {:success => true, :api_token => @user.api_token, :rents=> JSON.parse(rents.to_json)}, status: 201\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"089b7e7cf84bf138daaef5dae3c5a0a0\",\n \"score\": \"0.6055485\",\n \"text\": \"def create\\n @rumor = Rumor.new(rumor_params)\\n\\n respond_to do |format|\\n if @rumor.save\\n format.html { redirect_to @rumor, notice: 'Rumor was successfully created.' }\\n format.json { render :show, status: :created, location: @rumor }\\n else\\n format.html { render :new }\\n format.json { render json: @rumor.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"029fdbc040b0d52c233aa8b4aa70c665\",\n \"score\": \"0.6051352\",\n \"text\": \"def index\\n @riders = Rider.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"029fdbc040b0d52c233aa8b4aa70c665\",\n \"score\": \"0.6051352\",\n \"text\": \"def index\\n @riders = Rider.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df6062d8f9512bc7214f9b2859b50760\",\n \"score\": \"0.6050502\",\n \"text\": \"def show\\n @runit = Runit.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @runit }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6b2c036b0c6f0b4558b42fdbd3c03e1d\",\n \"score\": \"0.6012217\",\n \"text\": \"def index\\n @renters = Renter.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @renters }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"526a684a5edae647e3adea9abe0a4fb9\",\n \"score\": \"0.5994665\",\n \"text\": \"def index\\n @armors = Armor.all\\n\\n render json: @armors\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ae5b9538361ded87b07960e41b741eb3\",\n \"score\": \"0.5994327\",\n \"text\": \"def index\\n @rushes = Rush.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"093d9b6c276af2351ebd17fb1b8d0df7\",\n \"score\": \"0.5987503\",\n \"text\": \"def index\\n @rulings = Ruling.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7d2bacfcee1724bc0988e2bdf3e64543\",\n \"score\": \"0.59845746\",\n \"text\": \"def index\\n @rullings = @moot.rullings\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a5b00eff2393ea7dd9d776e4226b515f\",\n \"score\": \"0.59427357\",\n \"text\": \"def show\\n @lure = Lure.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @lure }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5e8229468235db5d245cd485bdcaf247\",\n \"score\": \"0.5940836\",\n \"text\": \"def show\\n @receitum = Receitum.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @receitum }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b5d6b9e6da1b588e52541668062a5da4\",\n \"score\": \"0.5936712\",\n \"text\": \"def show\\n rent = Rent.find(params[:id])\\n render json: {:success => true, :api_token => @user.api_token, :rents=> JSON.parse(rent.to_json)}, status: 201\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2bfd9ad9712b61e14ad61c43b87324b2\",\n \"score\": \"0.59358776\",\n \"text\": \"def show\\n @rto = Motor::Rto.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rto }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dad5f0ba59915e4405688b91b36a048b\",\n \"score\": \"0.5933121\",\n \"text\": \"def show\\n @reimbursable = Reimbursable.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @reimbursable }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1bd57b64bc80f0b39aba6623336543d5\",\n \"score\": \"0.59153926\",\n \"text\": \"def index\\n @rendus = Rendu.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"761353d255a4fecdef2ff64567f71a6f\",\n \"score\": \"0.5910352\",\n \"text\": \"def destroy\\n @rumor = Rumor.find(params[:id])\\n @rumor.destroy\\n\\n respond_to do |format|\\n format.html { redirect_to rumors_url }\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5e1be10b1248fa732549fa55d85c0e0b\",\n \"score\": \"0.5891894\",\n \"text\": \"def index\\n @racers = Racer.all\\n\\n render json: @racers\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c506a0977d1617a20c3405031673649f\",\n \"score\": \"0.58848476\",\n \"text\": \"def show\\n @rotum = Rotum.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rotum }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8698b42b4a1f07aeba58cfad139814a4\",\n \"score\": \"0.58788997\",\n \"text\": \"def show\\n @rider = Rider.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rider }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8698b42b4a1f07aeba58cfad139814a4\",\n \"score\": \"0.58788997\",\n \"text\": \"def show\\n @rider = Rider.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rider }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8698b42b4a1f07aeba58cfad139814a4\",\n \"score\": \"0.58788997\",\n \"text\": \"def show\\n @rider = Rider.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rider }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9a0d54263e33c4286bc0f90bbae89afd\",\n \"score\": \"0.5872339\",\n \"text\": \"def index\\n @rinventors = Rinventor.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6f0542659aac0276695e2ebd3e32ac1\",\n \"score\": \"0.5865673\",\n \"text\": \"def show\\n @rutinas = Rutina.find(params[:id])\\n render json: @rutinas, status: :ok\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"40207eca089f6b152fdfd2949bc69f0a\",\n \"score\": \"0.5865218\",\n \"text\": \"def index\\n @rosters = Roster.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"40207eca089f6b152fdfd2949bc69f0a\",\n \"score\": \"0.5865218\",\n \"text\": \"def index\\n @rosters = Roster.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6e03abe08c751521d41b9722669d17d7\",\n \"score\": \"0.58482677\",\n \"text\": \"def update\\n @rumor = Rumor.find(params[:id])\\n\\n respond_to do |format|\\n if @rumor.update_attributes(params[:rumor])\\n format.html { redirect_to @rumor, notice: 'Rumor was successfully updated.' }\\n format.json { head :no_content }\\n else\\n format.html { render action: \\\"edit\\\" }\\n format.json { render json: @rumor.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"193af583792b4d628c7697d2d6afd744\",\n \"score\": \"0.58454263\",\n \"text\": \"def index\\n @rosters = @race.rosters \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5f5ac084be93c0f155dff8d7bc58b431\",\n \"score\": \"0.58327144\",\n \"text\": \"def rulings\\n Ruling.where(uuid: self.uuid)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"01336055944f1fe2243dd242c00f5501\",\n \"score\": \"0.5819632\",\n \"text\": \"def index\\n @treasuries = Treasury.all\\n\\n respond_to do |format|\\n format.html\\n format.json { render json: @treasuries }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b1f546c398edce3b6028b414665f4d47\",\n \"score\": \"0.5802899\",\n \"text\": \"def index\\n @draft_rosters = @team.draft_rosters.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @draft_rosters }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"27a178d29b383539a35682e9aad3a8fc\",\n \"score\": \"0.57880545\",\n \"text\": \"def index\\n @renters = Renter.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"faf81518c8f5c1a8d653a2419e8e8611\",\n \"score\": \"0.5784607\",\n \"text\": \"def index\\n @remisions = Remision.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a1d3a8c251e7224806884f7aa7b4194a\",\n \"score\": \"0.5783038\",\n \"text\": \"def update\\n respond_to do |format|\\n if @rumor.update(rumor_params)\\n format.html { redirect_to @rumor, notice: 'Rumor was successfully updated.' }\\n format.json { render :show, status: :ok, location: @rumor }\\n else\\n format.html { render :edit }\\n format.json { render json: @rumor.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4201076f9df09fcd6b66485ee5f5e85e\",\n \"score\": \"0.5779308\",\n \"text\": \"def index\\n @rumes = Rume.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"565b3b52a199255acf6cbf5cfd94462a\",\n \"score\": \"0.5776494\",\n \"text\": \"def show\\n @ruku = Ruku.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @ruku }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fe17c59a25bddba94a6bbea471e7d929\",\n \"score\": \"0.5772886\",\n \"text\": \"def index\\n @recruiters = Recruiter.all\\n\\n render json: @recruiters\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"068683315f451c3b6b97ef527627461e\",\n \"score\": \"0.57700676\",\n \"text\": \"def index\\n @rous = Rou.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a50190b0f5a2d4b3d147cf3703554109\",\n \"score\": \"0.5763425\",\n \"text\": \"def show\\n @retetum = Retetum.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @retetum }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"46c326321b2ebcb328a7e5dc96d9bff0\",\n \"score\": \"0.5733074\",\n \"text\": \"def show\\n @rutina = Rutina.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rutina }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8fabdcb4fde9dae6fec8a4ad1a36b351\",\n \"score\": \"0.5731037\",\n \"text\": \"def index\\n @ruis = Rui.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"15243c5b2694440d9d59282cf33d8187\",\n \"score\": \"0.57269675\",\n \"text\": \"def show\\r\\n @race_runner = RaceRunner.find(params[:id])\\r\\n\\r\\n respond_to do |format|\\r\\n format.html # show.html.erb\\r\\n format.json { render :json => @race_runner }\\r\\n end\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"26e73637b7c182d3e5c460c19f140005\",\n \"score\": \"0.5725576\",\n \"text\": \"def index\\n @roofs = Roof.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @roofs }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"500d34a8999852975f8d43a9fd425919\",\n \"score\": \"0.57227904\",\n \"text\": \"def index\\n @perriors = Perrior.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e1228f8bf4ee71767fd7d6e295c56b6e\",\n \"score\": \"0.57196\",\n \"text\": \"def index\\n v = ValidateKey()\\n \\tif (v == nil)\\n \\t\\trender json: nil\\n \\t\\treturn\\n \\tend\\n\\n @user_rosters = UserRoster.all\\n render json: @user_rosters\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c793745d11f6159ad3607e872b4512c\",\n \"score\": \"0.57109797\",\n \"text\": \"def index\\n @recrutadors = Recrutador.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dc77392e9ee94fa273f5e48c182b1ae9\",\n \"score\": \"0.5708253\",\n \"text\": \"def index\\n @raiders = Raider.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fe5cb9b0fcfdfd5dd570042967d224ac\",\n \"score\": \"0.5703694\",\n \"text\": \"def set_rutum\\n @rutum = Rutum.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"79ffae6e2817113592f32004d2e575b7\",\n \"score\": \"0.57021224\",\n \"text\": \"def show\\n @reunion = Reunion.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @reunion }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8d380e67f273ab5a71ea0b439750adb9\",\n \"score\": \"0.5700675\",\n \"text\": \"def show\\n @realtor = Realtor.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @realtor }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"363a64ef76e4dcf06418de092091c594\",\n \"score\": \"0.5700456\",\n \"text\": \"def show\\n @racer = Racer.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @racer }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d169d8fbff11437a7ec64ca8757937c8\",\n \"score\": \"0.569349\",\n \"text\": \"def index\\n @uesrs = Uesr.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"64777c1266ba2dd03abf0dfa0dfc1431\",\n \"score\": \"0.56918687\",\n \"text\": \"def new\\n @raum = Raum.new\\n\\n respond_to do |format|\\n format.html # new.html.erb\\n format.json { render json: @raum }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6426d3ad17d4c75be4c8b4b8d3e1d656\",\n \"score\": \"0.5685785\",\n \"text\": \"def index\\n @murderers = Murderer.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"840a8c532ce581a6518bc0928e73b3e4\",\n \"score\": \"0.5685292\",\n \"text\": \"def index\\n @rages = Rage.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2a6017a7e74b6e5025f18c61dcbb187e\",\n \"score\": \"0.568411\",\n \"text\": \"def show\\n @remittance = Remittance.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @remittance }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a8ef98e8f393e2e54ccaa522a56aeff2\",\n \"score\": \"0.56765914\",\n \"text\": \"def index\\n @ruolis = Ruoli.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4178b9a50d0261b758c24f5d82517c80\",\n \"score\": \"0.56750333\",\n \"text\": \"def index\\n @rate_renters = RateRenter.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2109c96d50ec1c79fd31879f799566fb\",\n \"score\": \"0.567326\",\n \"text\": \"def show\\n @rekord = Rekord.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rekord }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"80cd20868d60abeb4b2331bc131dd055\",\n \"score\": \"0.56672776\",\n \"text\": \"def show\\n @rond = Rond.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rond }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3570c3353ca1bcf1dc802128243dfab\",\n \"score\": \"0.565928\",\n \"text\": \"def show\\n @rater = Rater.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rater }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"af2e7499995e8c8dff5ee2c738708f79\",\n \"score\": \"0.5650013\",\n \"text\": \"def set_rulling\\n @rulling = Rulling.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"14a9569babc9d5f9fa8b3da83171ba7a\",\n \"score\": \"0.56467724\",\n \"text\": \"def index\\n @rainfalls = Rainfall.all\\n respond_to do |format|\\n format.html { render json: @rainfalls} \\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"25a7b0526d99d53ca994613a0469fc03\",\n \"score\": \"0.5643731\",\n \"text\": \"def index\\n @rivalries = Rivalry.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b940a38e772208f7eab246c60cdf6a91\",\n \"score\": \"0.56421036\",\n \"text\": \"def index\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @riders }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5ff162b5d9aff403035f87e63c75d9d8\",\n \"score\": \"0.56402963\",\n \"text\": \"def show\\n @reagent = Reagent.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @reagent }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"39f50d6018306835df2e3a2429619b34\",\n \"score\": \"0.56370294\",\n \"text\": \"def show\\n @rrabat = Rrabat.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rrabat }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"65d6d165066819c7d2f28c74dfcc51e8\",\n \"score\": \"0.56325585\",\n \"text\": \"def index\\n @rents = Rent.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @rents }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"020aef71b87f0ddcd0322c32ab233f7c\",\n \"score\": \"0.563149\",\n \"text\": \"def show\\n @reward = current_user.rewards.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @reward }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e2b91757adaab32fcc7bd8c1568edd8e\",\n \"score\": \"0.56300884\",\n \"text\": \"def index\\n # The variable @rents receive all rents.\\n @rents = Rent.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c2e9fb3f7df13f8c22679e049193a593\",\n \"score\": \"0.56250095\",\n \"text\": \"def show\\n @rat = @resturant.ratings\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json {render json: @resturant}\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e40d2ebaa60e8a959ea38b6e5fc6369c\",\n \"score\": \"0.5624238\",\n \"text\": \"def show\\n @royaume = Royaume.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @royaume }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"032d96e34b34f50094826cccb00edba3\",\n \"score\": \"0.5623009\",\n \"text\": \"def index\\n @api_v1_user_rewards = Api::V1::UserReward.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bf36f78f493a7e9db8aed21318b1b215\",\n \"score\": \"0.56196696\",\n \"text\": \"def get_monster(monster_id)\\n RESTful.get(\\\"#{URL_MICROSERVICE_MONSTER}/monster/#{monster_id}\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b1d49029d163f149a85c45b8508dcf2e\",\n \"score\": \"0.5617346\",\n \"text\": \"def show\\n @rudder_servo = RudderServo.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rudder_servo }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6f9f49ccdb876da5051e309f6cf37961\",\n \"score\": \"0.56160796\",\n \"text\": \"def show\\n @find_rainbow = FindRainbow.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @find_rainbow }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53ba1f5878647eeadbbbd7c4bba36cdd\",\n \"score\": \"0.5615892\",\n \"text\": \"def index\\n @tournament_rewards = TournamentReward.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @tournament_rewards }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1dc89b333a1faddec02f115dfd0cddf5\",\n \"score\": \"0.5615622\",\n \"text\": \"def show\\n @recette = Recette.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @recette }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1dc89b333a1faddec02f115dfd0cddf5\",\n \"score\": \"0.5614828\",\n \"text\": \"def show\\n @recette = Recette.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @recette }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0b13acf366d8af8987e499b9d4647692\",\n \"score\": \"0.56134176\",\n \"text\": \"def index\\n get_rubros\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ffc363b6cf1ebb6f2df19ad1accbae0c\",\n \"score\": \"0.5611306\",\n \"text\": \"def rosters\\n @teams = Tournament.find(params[:id]).teams.find(:all, :include => :players)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f6541117c3c65656a5a2e3c6c61741b7\",\n \"score\": \"0.5609222\",\n \"text\": \"def show\\n reunion= Reunion.find_by_id params[:id]\\n if reunion!= nil\\n render(json: reunion, status: 200) \\n else\\n head 404\\n end \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7802a5babfe5064780276be430e8d2ed\",\n \"score\": \"0.55954033\",\n \"text\": \"def show\\n @agronomium = Agronomium.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @agronomium }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e030075cb55284815d20aff9f81a83fb\",\n \"score\": \"0.5590893\",\n \"text\": \"def index\\n @rankings = Rating.rankings\\n\\n respond_to do |format|\\n format.html # ratings.html.erb\\n format.json { render json: @ratings }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbb2c2d343998c9285cd6b2d4b1de3a5\",\n \"score\": \"0.5581527\",\n \"text\": \"def show\\n @race = Race.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @race }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8a21ffab318e961f31ea4f6c929584a8\",\n \"score\": \"0.5569396\",\n \"text\": \"def show\\n @rteam = Rteam.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @rteam }\\n end\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":171,"cells":{"query_id":{"kind":"string","value":"bcbb71fcbdb6802f899dda161d5cffe6"},"query":{"kind":"string","value":"GET /dummy POST /dummy PUT /dummy PATCH /dummy DELETE /dummy"},"positive_passages":{"kind":"list like","value":[{"docid":"63de8568f8785598a163d2525469d37b","score":"0.0","text":"def index\n #Does nothing really... (Except create log)\n\n render json: \"success\"\n end","title":""}],"string":"[\n {\n \"docid\": \"63de8568f8785598a163d2525469d37b\",\n \"score\": \"0.0\",\n \"text\": \"def index\\n #Does nothing really... (Except create log)\\n\\n render json: \\\"success\\\"\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"ade43359931a8158bc17b1b039ca8b28","score":"0.6153454","text":"def destroy\n @dummy = Dummy.find(params[:id])\n @dummy.destroy\n\n respond_to do |format|\n format.html { redirect_to dummies_url }\n format.json { head :no_content }\n end\n end","title":""},{"docid":"76dd1e894852a1df7132aaaf9440449f","score":"0.5977489","text":"def update\n @dummy = Dummy.find(params[:id])\n\n respond_to do |format|\n if @dummy.update_attributes(params[:dummy])\n format.html { redirect_to @dummy, notice: 'Dummy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dummy.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"4645d892bc86eb9e85abeb7c39a721ca","score":"0.5954389","text":"def create\n @dummy = Dummy.new(params[:dummy])\n\n respond_to do |format|\n if @dummy.save\n format.html { redirect_to @dummy, notice: 'Dummy was successfully created.' }\n format.json { render json: @dummy, status: :created, location: @dummy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dummy.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"6f651731fccf0e9ed4c85f56ff110334","score":"0.57978094","text":"def show\n @dummy = Dummy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dummy }\n end\n end","title":""},{"docid":"7c2eedab75c23b270980c16c33c0c704","score":"0.5722152","text":"def new\n @dummy = Dummy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dummy }\n end\n end","title":""},{"docid":"6f7c5dcc1cb7f5180d6cc9d9075ceccb","score":"0.56644166","text":"def ignore_test_create_with_wrong_http_method_redirects\n get :create, model_identifier => test_entry_attrs\n assert_redirected_to_index\n \n put :create, model_identifier => test_entry_attrs\n assert_redirected_to_index\n \n delete :create, model_identifier => test_entry_attrs\n assert_redirected_to_index\n end","title":""},{"docid":"cf06302bfac61e5b1a66df4691b4a72e","score":"0.5624351","text":"def GET; end","title":""},{"docid":"8666bab783e18a12bef72fdd446ddaba","score":"0.56179225","text":"def set_status_dummy\n @status_dummy = StatusDummy.find(params[:id])\n end","title":""},{"docid":"72d272ad08cf351b071fa5c3a98ffe97","score":"0.55701804","text":"def post(request)\n # sure thing!\n json_response(200, { message: \"This dummy POST endpoint didn't do anything.\" })\n end","title":""},{"docid":"0cb22603d84c30bf81c77070c5bdd583","score":"0.5535784","text":"def define_restful_api(model)\n get \"/#{model.resource}\" do\n sleep settings.fake_latency if settings.fake_latency > 0\n catch_errors { json model.all }\n end\n\n get \"/#{model.resource}/:id\" do\n sleep settings.fake_latency if settings.fake_latency > 0\n catch_errors do\n result = model.find_by_id(params[:id])\n halt 404 if result.nil?\n json result\n end\n end\n\n post \"/#{model.resource}\" do\n sleep settings.fake_latency if settings.fake_latency > 0\n catch_errors { json model.create(@json_payload) }\n end\n\n patch \"/#{model.resource}/:id\" do\n sleep settings.fake_latency if settings.fake_latency > 0\n catch_errors { json model.update(params[:id], @json_payload) }\n end\n\n delete \"/#{model.resource}/:id\" do\n sleep settings.fake_latency if settings.fake_latency > 0\n catch_errors { model.delete(params[:id]) }\n end\n\n private\n def catch_errors()\n begin\n yield\n rescue Exception => e\n logger.fatal(\"Exception: #{e}\")\n status 500\n json({'error' => e})\n end\n end\nend","title":""},{"docid":"c63214a71f6c847325525ae3ea759085","score":"0.54998016","text":"def test!\n @@api.post(endpoint: self.endpoint + ['test'])\n end","title":""},{"docid":"3d317bf88fddbd6c6635f12154058b5d","score":"0.54456013","text":"def ignore_test_update_with_wrong_http_method_redirects\n get :update, :id => test_entry.id, model_identifier => test_entry_attrs\n assert_redirected_to_index\n \n delete :update, :id => test_entry.id, model_identifier => test_entry_attrs\n assert_redirected_to_index\n end","title":""},{"docid":"dcdbb85931b4e8671b23ade360ca837e","score":"0.5425157","text":"def destroy\n @dummy_record = DummyRecord.find(params[:id])\n @dummy_record.destroy\n\n respond_to do |format|\n format.html { redirect_to dummy_records_url }\n format.json { head :no_content }\n end\n end","title":""},{"docid":"7924824b417fbfd9fd4fafcb6018e80b","score":"0.5421903","text":"def non_get_methods\n [:post, :put, :delete]\n end","title":""},{"docid":"4a2ccd3ac8b1bb99ac7594c5ba4eed7d","score":"0.54214275","text":"def ignore_test_destroy_with_wrong_http_method_redirects\n get :destroy, :id => test_entry.id\n assert_redirected_to_index\n \n put :destroy, :id => test_entry.id\n assert_redirected_to_index\n end","title":""},{"docid":"1621b12b864c3f5ed89a4a3c824cd134","score":"0.5296095","text":"def destroy\n @dummy_table = DummyTable.find(params[:id])\n @dummy_table.destroy\n\n respond_to do |format|\n format.html { redirect_to dummy_tables_url }\n format.json { head :no_content }\n end\n end","title":""},{"docid":"8d244c8e93c271a7e92ea1ee63d3dddc","score":"0.52891594","text":"def POST; end","title":""},{"docid":"27732fb7ba70b70803755ce204196dbc","score":"0.52745736","text":"def test_change_status\n expected = 200\n post_id = 1\n data = {\n status: 1\n }\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s+'/status')\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Put.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end","title":""},{"docid":"fee6e52c1caa79866d0ffcd4c4c168ee","score":"0.5271514","text":"def reset()\n @api.do_request(\"DELETE\", get_base_api_path())\n end","title":""},{"docid":"ac672ee1809614f8860d087470c2f670","score":"0.52712536","text":"def hit\n action = params[:req]\n name = params[:name] || params[:id]\n render api_not_supported action, name\n end","title":""},{"docid":"506417ee185eb4942bb88f0dae39f932","score":"0.52624154","text":"def test_delete_post\n expected = 200\n post_id = 1\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s)\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Delete.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end","title":""},{"docid":"0cf60a00cb988bee6ab39aee03e50dc2","score":"0.5249744","text":"def update\n @dummy_table = DummyTable.find(params[:id])\n\n respond_to do |format|\n if @dummy_table.update_attributes(params[:dummy_table])\n format.html { redirect_to @dummy_table, notice: 'Dummy table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dummy_table.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"866eafbf949a559c7ed2f63c9eb9fb32","score":"0.52183473","text":"def index\n puts \"test/index\"\n ap params\n done 404\n end","title":""},{"docid":"23a67b59c87a4c6e2db116723f7462b7","score":"0.5202404","text":"def test_add_and_remove_notification\n notification = {\n \"title\" => \"Test subject soon to be removed\",\n \"message\" => \"Hopefully deleted message!!\",\n \"email_address\" => \"Hopefully deleted e-mail address\"\n }\n\n # Make a new notification and then delete it\n notification_id = make_a_notification(notification)\n delete '/notification/' + notification_id\n assert_equal 204, last_response.status\n\n # Double check that it's gone\n get '/notification/' + notification_id\n assert_equal 404, last_response.status\n end","title":""},{"docid":"dd9894340d4cf16757baca74371f9f43","score":"0.5171304","text":"def test\n get(\"/help/test.json\")\n end","title":""},{"docid":"dd9894340d4cf16757baca74371f9f43","score":"0.5171304","text":"def test\n get(\"/help/test.json\")\n end","title":""},{"docid":"4e0e59715d19dce2a47fccc2c67326dd","score":"0.5133026","text":"def patch!\n request! :patch\n end","title":""},{"docid":"72bb1a9a8c61810be0dc1b1aef670059","score":"0.5131801","text":"def reset_whats_new_for_all_users \n get(\"/users.json/news/reset\")\nend","title":""},{"docid":"72bb1a9a8c61810be0dc1b1aef670059","score":"0.5131801","text":"def reset_whats_new_for_all_users \n get(\"/users.json/news/reset\")\nend","title":""},{"docid":"8c737d0d542ed69ad817301490464ce2","score":"0.51225257","text":"def test_no_params()\n\n # Perform the API call through the SDK function\n result = self.class.controller.no_params()\n\n # Test response code\n assert_equal(@response_catcher.response.status_code, 200)\n\n # Test whether the captured response is as we expected\n assert_not_nil(result)\n expected_body = JSON.parse('{\"passed\":true}')\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end","title":""},{"docid":"62bce5ac63124c8bdec3aae9b1246015","score":"0.51208717","text":"def test_show\n get '/category/1'\n end","title":""},{"docid":"d0a0da83c518545d4816726a1502e55a","score":"0.510766","text":"def test_contradictory\n make_controller :contradictory\n get :index\n assert_response :success\n get :secret_ferret_brigade\n assert_response :success\n end","title":""},{"docid":"437230aefd30af6fe0e5420c98a66e00","score":"0.5078314","text":"def test\n get(\"/help/test\")\n end","title":""},{"docid":"bd6fa777f1801fd164ac9f012e744e43","score":"0.5064164","text":"def destroy\n @test_stuff.destroy\n respond_to do |format|\n format.html { redirect_to test_stuffs_url }\n format.json { head :no_content }\n end\n end","title":""},{"docid":"b3da3f5ec2195d1d87b04178033e95bb","score":"0.50615853","text":"def index\n @dummy_records = DummyRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @dummy_records }\n end\n end","title":""},{"docid":"d3fc8705bcc46ad4944ea552aeac8894","score":"0.5058138","text":"def test_mock_without_param\n get \"/mock\"\n assert_equal last_response.status, 302\n end","title":""},{"docid":"6da4cbff70ef7a7eb159c6a1a220b271","score":"0.50565535","text":"def update\n @dummy_record = DummyRecord.find(params[:id])\n\n respond_to do |format|\n if @dummy_record.update_attributes(params[:dummy_record])\n format.html { redirect_to @dummy_record, :notice => 'Dummy record was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @dummy_record.errors, :status => :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"9d4a27a7b2ed4d844162111f1a1729a5","score":"0.50532013","text":"def get; end","title":""},{"docid":"5aaae53fb36c8c6fca88e94d339d5e0a","score":"0.5049742","text":"def show\n @dummy_record = DummyRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @dummy_record }\n end\n end","title":""},{"docid":"512f1b2e9c9d6d3d73954dd609859597","score":"0.5032542","text":"def add_dummy_create_id\n params[:data] ||= {}\n params[:data][:id] ||= 0\n end","title":""},{"docid":"7070e4dc3849fac5852c0271c9b6d7cc","score":"0.5025528","text":"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end","title":""},{"docid":"a216dd12f74891ba6144e36a8d48ec48","score":"0.5025291","text":"def new\n @dummy_record = DummyRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @dummy_record }\n end\n end","title":""},{"docid":"e09525b63972cae4dfdd19bdfaf6ba08","score":"0.5019832","text":"def destroy\n @testing_.destroy\n respond_to do |format|\n format.html { redirect_to testing_s_url }\n format.json { head :no_content }\n end\n end","title":""},{"docid":"1ee76b68b08f4ad9540f1be923303067","score":"0.5004115","text":"def test_create_a_task_with_valid_attributes\n post '/tasks', { task: { title: \"something\", description: \"else\", user_id: 1 } } # post '/tasks', { task: { title: \"something\", description: \"else\", user_id: 1, status_id: 1 } }\n assert_equal 1, Task.count # count is a method that ActiveRecord gives us\n assert_equal 200, last_response.status\n assert_equal \"created!\", last_response.body\n end","title":""},{"docid":"2d4ece99abb8a323a2ec42d51f563075","score":"0.5000579","text":"def destroy_fake\n render :json => {:ok => true, :msg => nil}\n end","title":""},{"docid":"118257e1d8c56f5d9815bf38f7a55d41","score":"0.4991763","text":"def new\n @dummy_table = DummyTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dummy_table }\n end\n end","title":""},{"docid":"e8159aa5a4fb242fa02a256685aa1524","score":"0.49896178","text":"def show\n @dummy_table = DummyTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dummy_table }\n end\n end","title":""},{"docid":"0a407527f798b84f395256c5802a737e","score":"0.49891168","text":"def test_update_post\n data = {\n title: \"Roll lemon\",\n content: \"Gingerbread bear claw muffin danish danish marzipan. Toffee lollipop wafer carrot cake dessert.\",\n description: \"Chocolate tootsie roll lemon drops. Chupa chups chocolate bar apple pie\",\n image: \"chocolate.png\",\n status: 1\n }\n expected = 200\n post_id = 1\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s)\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Put.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end","title":""},{"docid":"32b241adc0aec463c314d7d9a7fdebab","score":"0.49861947","text":"def test_1\n\n res = get \"http://localhost:7777/things\", :no_redirections => true\n assert_equal 303, res.code.to_i\n\n res = get(\"http://localhost:7777/things\", :noredir => true)\n assert_equal 303, res.code.to_i\n\n expect 200, {}, get(\"http://localhost:7777/items\", :noredir => true)\n end","title":""},{"docid":"b52324e2f19d28cfc26d06b39f6baa99","score":"0.49835736","text":"def destroy\n @internal = Internal.find(params[:id])\n @internal.destroy\n\n respond_to do |format|\n format.html { redirect_to internals_url }\n format.json { head :ok }\n end\n end","title":""},{"docid":"c2c6d2f572b3f112dc8d5daacbdeb33c","score":"0.49796873","text":"def post; end","title":""},{"docid":"68972240d1ccdc366de40e0e3a0465e2","score":"0.49711198","text":"def new\n render :json => { }, :status => 405\n end","title":""},{"docid":"13b04d39719f2863793f4ba556a8f82a","score":"0.49666816","text":"def create\n @dummy_record = DummyRecord.new(params[:dummy_record])\n\n respond_to do |format|\n if @dummy_record.save\n format.html { redirect_to @dummy_record, :notice => 'Dummy record was successfully created.' }\n format.json { render :json => @dummy_record, :status => :created, :location => @dummy_record }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @dummy_record.errors, :status => :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"dd5a521d960e3460371f73b43329d3b3","score":"0.4966468","text":"def index\n @api_v1_todos = Todo.all\n render json: @api_v1_todos\n end","title":""},{"docid":"ac398c585647b3200c2f1c0183be5f11","score":"0.49621412","text":"def deleteRequest\n\n end","title":""},{"docid":"689d5a07a403c4b765ba178e4aff08a3","score":"0.49571577","text":"def delete\n client.delete(\"/#{id}\")\n end","title":""},{"docid":"e16289285ac8a2741bf53766d421417e","score":"0.4953358","text":"def rm_request path, data = nil,method = nil, verbose = false\n reply = nil\n hdrs = {'Content-Type'=>'application/json', 'X-Redmine-API-Key' => $settings['redmine_api_key']}\n reply = Net::HTTP.start($settings['redmine_host'], $settings['redmine_port']) do |http|\n if data\n if !method || method == 'POST'\n puts \"POST #{path}\" if verbose\n http.request_post(path,data.to_json, hdrs)\n elsif method == 'PUT'\n # code for PUT here\n puts \"PUT #{path}\" if verbose\n http.send_request 'PUT', path, JSON.unparse(data), hdrs\n end\n else\n puts \"GET #{path}\" if verbose\n http.request_get(path, hdrs)\n end\n end\n return reply\nend","title":""},{"docid":"902adf030359d9e7acaa73878730d2fa","score":"0.49433282","text":"def http_method\n :get\n end","title":""},{"docid":"5e381648634b96327e4c3715af1881c7","score":"0.49407434","text":"def test_should_create_link_via_API_JSON\r\n get \"/logout\"\r\n post \"/links.json\", :api_key => 'testapikey',\r\n :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response :created\r\n link = JSON.parse(response.body)\r\n check_new_link(link) \r\n end","title":""},{"docid":"20aacbc409484f7b6567a226bd6c52ee","score":"0.49349332","text":"def stub_api_request(http_method, path, status, path_params = {})\n api = \"#{http_method.upcase} #{path} #{status}\"\n case api\n # Subject APIs\n when \"GET /subjects/:id 200\"\n stub_request(:get, \"https://consent.iubenda.com/subjects/#{path_params[:id]}\")\n .to_return(status: 200, body: file_fixture(\"consent_solution/subjects/show.json\"))\n when \"GET /subjects/:id 404\"\n stub_request(:get, \"https://consent.iubenda.com/subjects/#{path_params[:id]}\")\n .to_return(status: 404, body: file_fixture(\"consent_solution/404.json\"))\n when \"GET /subjects/:id 401\"\n stub_request(:get, \"https://consent.iubenda.com/subjects/#{path_params[:id]}\")\n .to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"GET /subjects/:id 403\"\n stub_request(:get, \"https://consent.iubenda.com/subjects/#{path_params[:id]}\")\n .to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n when \"GET /subjects 200\"\n stub_request(:get, \"https://consent.iubenda.com/subjects\").\n to_return(status: 200, body: file_fixture(\"consent_solution/subjects/list.json\"))\n when \"GET /subjects 401\"\n stub_request(:get, \"https://consent.iubenda.com/subjects\").\n to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"GET /subjects 403\"\n stub_request(:get, \"https://consent.iubenda.com/subjects\").\n to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n when \"POST /subjects 200\"\n stub_request(:post, \"https://consent.iubenda.com/subjects\").\n to_return(status: 200, body: file_fixture(\"consent_solution/subjects/create.json\"))\n when \"POST /subjects 401\"\n stub_request(:post, \"https://consent.iubenda.com/subjects\").\n to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"POST /subjects 403\"\n stub_request(:post, \"https://consent.iubenda.com/subjects\").\n to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n when \"PUT /subjects/:id 200\"\n stub_request(:put, \"https://consent.iubenda.com/subjects/#{path_params[:id]}\").\n to_return(status: 200, body: file_fixture(\"consent_solution/subjects/update.json\"))\n when \"PUT /subjects/:id 404\"\n stub_request(:put, \"https://consent.iubenda.com/subjects/#{path_params[:id]}\").\n to_return(status: 404, body: file_fixture(\"consent_solution/404.json\"))\n when \"PUT /subjects/:id 401\"\n stub_request(:put, \"https://consent.iubenda.com/subjects/#{path_params[:id]}\").\n to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"PUT /subjects/:id 403\"\n stub_request(:put, \"https://consent.iubenda.com/subjects/#{path_params[:id]}\").\n to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n # Consent APIs\n when \"GET /consent/:id 200\"\n stub_request(:get, \"https://consent.iubenda.com/consent/#{path_params[:id]}\").\n to_return(status: 200, body: file_fixture(\"consent_solution/consent/show.json\"))\n when \"GET /consent/:id 404\"\n stub_request(:get, \"https://consent.iubenda.com/consent/#{path_params[:id]}\").\n to_return(status: 404, body: file_fixture(\"consent_solution/404.json\"))\n when \"GET /consent/:id 401\"\n stub_request(:get, \"https://consent.iubenda.com/consent/#{path_params[:id]}\").\n to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"GET /consent/:id 403\"\n stub_request(:get, \"https://consent.iubenda.com/consent/#{path_params[:id]}\").\n to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n when \"GET /consent 200\"\n stub_request(:get, \"https://consent.iubenda.com/consent\").\n to_return(status: 200, body: file_fixture(\"consent_solution/consent/list.json\"))\n when \"GET /consent 401\"\n stub_request(:get, \"https://consent.iubenda.com/consent\").\n to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"GET /consent 403\"\n stub_request(:get, \"https://consent.iubenda.com/consent\").\n to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n when \"POST /consent 200\"\n stub_request(:post, \"https://consent.iubenda.com/consent\").\n to_return(status: 200, body: file_fixture(\"consent_solution/consent/create.json\"))\n when \"POST /consent 401\"\n stub_request(:post, \"https://consent.iubenda.com/consent\").\n to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"POST /consent 403\"\n stub_request(:post, \"https://consent.iubenda.com/consent\").\n to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n # LegalNotice APIs\n when \"GET /legal_notices/:identifier/:version 200\"\n stub_request(:get, \"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}/#{path_params[:version]}\").\n to_return(status: 200, body: file_fixture(\"consent_solution/legal_notices/version.json\"))\n when \"GET /legal_notices/:identifier/:version 401\"\n stub_request(:get, \"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}/#{path_params[:version]}\").\n to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"GET /legal_notices/:identifier/:version 403\"\n stub_request(:get, \"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}/#{path_params[:version]}\").\n to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n when \"GET /legal_notices/:identifier/:version 404\"\n stub_request(:get, \"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}/#{path_params[:version]}\").\n to_return(status: 404, body: file_fixture(\"consent_solution/404.json\"))\n when \"GET /legal_notices/:identifier 200\"\n stub_request(:get, \"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}\").\n to_return(status: 200, body: file_fixture(\"consent_solution/legal_notices/versions.json\"))\n when \"GET /legal_notices/:identifier 401\"\n stub_request(:get, \"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}\").\n to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"GET /legal_notices/:identifier 403\"\n stub_request(:get, \"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}\").\n to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n when \"GET /legal_notices 200\"\n stub_request(:get, \"https://consent.iubenda.com/legal_notices\").\n to_return(status: 200, body: file_fixture(\"consent_solution/legal_notices/list.json\"))\n when \"GET /legal_notices 401\"\n stub_request(:get, \"https://consent.iubenda.com/legal_notices\").\n to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"GET /legal_notices 403\"\n stub_request(:get, \"https://consent.iubenda.com/legal_notices\").\n to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n when \"POST /legal_notices 200\"\n stub_request(:post, \"https://consent.iubenda.com/legal_notices\").\n to_return(status: 200, body: file_fixture(\"consent_solution/legal_notices/create.json\"))\n when \"POST /legal_notices 401\"\n stub_request(:post, \"https://consent.iubenda.com/legal_notices\").\n to_return(status: 401, body: file_fixture(\"consent_solution/401.json\"))\n when \"POST /legal_notices 403\"\n stub_request(:post, \"https://consent.iubenda.com/legal_notices\").\n to_return(status: 403, body: file_fixture(\"consent_solution/403.json\"))\n end\nend","title":""},{"docid":"d66513c0710d28e2562e24711e6fe646","score":"0.4923698","text":"def create\n #Instantiate a new object using form parameters\n require 'uri'\n require 'net/http'\n\n puts('------Parameters------')\n puts(params)\n puts('------Name------')\n puts(params['name'])\n puts('------------')\n\n params = {'subject' => \"Test Subject from Rails Controller\", 'message' => 'Test Message from Rails Controller', 'person_email' => 'JesseShawCodes@gmail.com' }\n\n puts(\"Those Params!!!\")\n\n=begin\n begin\n url = URI.parse('https://help.ginkgo-plus.dev/api/tickets')\n puts(url.host)\n puts(url.path)\n puts(url.port)\n puts('Lets see if there are any values above...')\n req = Net::HTTP::Post.new(url, {'X-DeskPRO-API-KEY' => '1:CMZ8MZAA8RQR2D9H5SMQWQD4R'})\n puts(\"Undefined http???\")\n req.body = {'subject' => \"Test Subject from Rails Controller\", 'message' => 'Test Message from Rails Controller', 'person_email' => \"JesseShawCodes@gmail.com\" }\n res = https.request(req)\n puts(\"I think it works???\")\n rescue => e\n puts(\"Failed: Ahhh bummer. It's broke\")\n puts(\"#{e}\")\n end\n\n # x = Net::HTTP.post_form(URI.parse('https://help.ginkgo-plus.dev/api/tickets'), params)\n # puts x.body\n\n @subject = Subject.new(params[:subject])\n\n #Save the object\n if @subject.save\n redirect_to(subjects_path)\n else\n render('new')\n end\n=end\n end","title":""},{"docid":"7516b36b33e9a12132a6f4a208e3ee8b","score":"0.49220282","text":"def get\n end","title":""},{"docid":"9be10187c96823e03529b373de3b1ddb","score":"0.49207458","text":"def APICall params = {}\n \n path = params[:path]\n method = params[:method] || 'GET'\n payload = params[:payload] || nil\n \n params.delete(:method)\n params.delete(:path)\n params.delete(:payload)\n \n a = Time.now.to_f\n \n http = Net::HTTP.new(@infra[:domain]+'.zendesk.com',443)\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http.use_ssl = true\n \n uri = %{#{@infra[:path]}#{path}}\n uri << '?'+params.map{ |key,val| \"#{key}=#{val}\" }.join('&') if params && params.count > 0\n uri = URI.escape uri\n \n reqs = {\n 'GET' => Net::HTTP::Get.new(uri),\n 'POST' => Net::HTTP::Post.new(uri),\n 'PUT' => Net::HTTP::Put.new(uri),\n 'DELETE' => Net::HTTP::Delete.new(uri)\n }\n req = reqs[method]\n \n content_type = 'application/json'\n content_type = 'application/binary' if path.include? 'uploads'\n req.content_type = content_type\n \n req.basic_auth @username,@infra[:authentication]\n \n req.body = payload if method == 'POST' || method == 'PUT'\n \n response = http.request req\n \n code = response.code.to_f.round\n body = response.body\n \n b = Time.now.to_f\n c = ((b-a)*100).round.to_f/100\n \n final = {code: code.to_i,body: nil}\n final = final.merge(body: JSON.parse(body)) if method != 'DELETE' && code != 500\n final = final.merge(time: c)\n \n @api += 1\n \n final\n \n end","title":""},{"docid":"0592ed6f504cd8588f5409d7270e7ca9","score":"0.4919412","text":"def test_read_all_info_without_name\n get '/v1/read_all?data=eyAiQ291bnRyeSI6ICJCcmF6aWwiIH0='\n assert last_response.body.include?('Name field was not found in JSON')\n end","title":""},{"docid":"291c2e9af72a030d5a99cfaba856f59d","score":"0.49191388","text":"def test_post_then_get\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n id = last_response.body\n\n get \"/traces/#{id}\"\n check_valid_trace last_response.body\n end","title":""},{"docid":"3a909e311cf72da4ea98f763872df54d","score":"0.49113858","text":"def create\n @dummy_table = DummyTable.new(params[:dummy_table])\n\n respond_to do |format|\n if @dummy_table.save\n format.html { redirect_to @dummy_table, notice: 'Dummy table was successfully created.' }\n format.json { render json: @dummy_table, status: :created, location: @dummy_table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dummy_table.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"eb4800bf407b081271e2ee6797e51fd7","score":"0.49093997","text":"def test_putpoi_delete_not_found\n changeset = create(:changeset)\n cs_id = changeset.id\n user = changeset.user\n\n amf_content \"putpoi\", \"/1\", [\"#{user.email}:test\", cs_id, 1, 999999, 0, 0, {}, false]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/1\")\n\n assert_equal 3, result.size\n assert_equal -4, result[0]\n assert_equal \"node\", result[1]\n assert_equal 999999, result[2]\n end","title":""},{"docid":"51770d8081f066b03177614c8a3016d5","score":"0.49065903","text":"def index\r\n render json: { status: \"Test API\"}\r\n end","title":""},{"docid":"bef148a7a1fc687bc1a9e35e4ebc7ef4","score":"0.49050036","text":"def destroy\n # @sample = Sample.find(params[:id])\n # @sample.destroy\n\n# respond_to do |format|\n# format.html { redirect_to samples_url }\n# format.json { head :no_content }\n# end\n end","title":""},{"docid":"0eac2b2edb79776c769bd126e629fe90","score":"0.49000853","text":"def clear_cache()\n\n $config[\"http\"].each do |doc|\n\n port = doc[1][\"adminPort\"]\n host = doc[1][\"host\"]\n\n http = Net::HTTP.new(host, port)\n request = Net::HTTP::Post.new(\"/tasks/clearData\")\n request.basic_auth(\"ops\",\"password\")\n response = http.request(request)\n response.code.should == \"200\"\n end\n\nend","title":""},{"docid":"a1c786df37412a589e5f53e457f5fbc8","score":"0.48979956","text":"def test_delete_form_test_with_blank_name()\n # Parameters for the API call\n body = DeleteBody.from_hash(APIHelper.json_deserialize(\n '{\"name\":\" \",\"field\":\"QA\"}'\n ))\n\n # Perform the API call through the SDK function\n result = @controller.send_delete_form(body)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end","title":""},{"docid":"a6660f8f62027412929d7b78d182281c","score":"0.4894688","text":"def delete endpoint\n do_request :delete, endpoint\n end","title":""},{"docid":"040c39c830e48d2f28b9090b537a2d18","score":"0.48936102","text":"def update\n # actions\n path = URI(@endpoint).path\n action = URI(@req.request_uri).path.sub(path, '').split('/')\n action -= ['']\n if action.include?('_history')\n @actions = [action[0], '_history']\n else\n @actions = [action[0]]\n end\n\n # search param\n req_query = URI(@req.request_uri).query\n unless req_query.nil?\n @req_params = URI::decode_www_form(req_query).to_h\n end\n\n # requst method\n if @req.request_method == \"GET\" and @actions.include? '_history'\n @req_method = 'vread'\n elsif @req.request_method == \"GET\" and @req_params != nil\n @req_method = 'search-type'\n elsif @req.request_method == \"PUT\"\n @req_method = 'update'\n elsif @req.request_method == \"POST\"\n @req_method = 'create'\n else\n @req_method = 'read'\n end\n\n # interaction\n int1 = Interaction.last type: @actions[0], code: @req_method\n if int1.nil?\n @present = 0\n else\n @present = int1.id\n @intCode = int1.valueCode\n end\n end","title":""},{"docid":"c36b2d1f5ca88b6864ccf44496d3c99f","score":"0.48928612","text":"def api_method\n ''\n end","title":""},{"docid":"9d7ad40af3d6f3fc1916b780aa9cd47e","score":"0.48918486","text":"def test_admin_can_show_user\n # first log in\n get '/login' # need to do this to set up the form container.\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\n\n user_id = User.find_by_username(NOBODY_USERNAME).id\n\n get \"/user/#{user_id}\"\n assert last_response.ok?\n assert last_response.body.include?(NOBODY_USERNAME)\n\n # ensure a request for unknown ID is bounced.\n get \"/user/153\"\n assert last_response.ok?\n assert last_response.body.include?(\"The user id supplied was not recognised\")\n\n end","title":""},{"docid":"dbb344abb971369ada7f4157e97368a9","score":"0.48893958","text":"def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend","title":""},{"docid":"2134736b480f4c45bccced2f10ac04fa","score":"0.4882738","text":"def destroy\n\n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Delete.new('/offsets/doit.json')\n\t\tputs params\n\t\tputs params.slice(*['custids','acctids'])\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(',')})\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n end","title":""},{"docid":"79f59385e1e8240057a42b37b9f6d294","score":"0.48752195","text":"def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end","title":""},{"docid":"6e94e13254ddd489e312e30a43547786","score":"0.4869692","text":"def add_dummy_destroy_id\n params[:id] ||= 0\n end","title":""},{"docid":"015f6c1347c417df7510b12b53ada294","score":"0.4867234","text":"def api_behavior\n if post?\n display resource, :status => :created\n # render resource instead of 204 no content\n elsif put? || delete?\n display resource, :status => :ok\n else\n super\n end\n end","title":""},{"docid":"2c1a691cbb5ca269082f4b9fc9aaef91","score":"0.48659682","text":"def handle_GET(initial)\n\trequest_path = get_Path(initial)\n\trequest_path = request_path[1..-1] if request_path[0] == '/'\n\tif File.exist?(request_path)\n\t\tcreate_Found_Response(request_path)\n\telse\n\t\tcreate_Not_Found_Response(request_path)\n\tend\nend","title":""},{"docid":"d150a70b29ba6a251519dff4d7479c13","score":"0.4865849","text":"def post(path, **args); end","title":""},{"docid":"28e62baa030829bb84c058704da4ef7e","score":"0.48651296","text":"def set_api_v1_todo\n @api_v1_todo = Todo.find(params[:id])\n end","title":""},{"docid":"944248c8e5811c1d6a0c849d8cfe4c1a","score":"0.4862183","text":"def test_student_locked_out\n # Index\n get_as @student, :index\n assert_response :missing\n\n # Edit\n get_as @student, :edit\n assert_response :missing\n\n # Update\n get_as @student, :update\n assert_response :missing\n\n # Create\n get_as @student, :create\n assert_response :missing\n\n # Download Student List\n get_as @student, :download_student_list\n assert_response :missing\n\n # Upload Student List (Get)\n get_as @student, :index\n assert_response :missing\n\n # Upload Student List (Post)\n post_as @student, :index\n assert_response :missing\n\n end","title":""},{"docid":"d8ee52faeb6c4dd89f27ae868ec279cb","score":"0.48589364","text":"def regular(*args)\n if args[0].kind_of?(Hash)\n post({:type => \"regular\"}.update(args[0]))\n else\n body, title, dummy = args\n post(:type => \"regular\", :title => title, :body => body)\n end\n end","title":""},{"docid":"b937668031da726f019cd2c84320d287","score":"0.48429057","text":"def post\r\n end","title":""},{"docid":"53553812f1fc7f75e34b062fbc29c0d7","score":"0.48281178","text":"def destroy\n @yummy.destroy\n respond_to do |format|\n format.html { redirect_to yummies_url, notice: 'Yummy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end","title":""},{"docid":"fbc33eae34e7ab3eb159279c484299f2","score":"0.48273402","text":"def destroy\n @api_v1_todo.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end","title":""},{"docid":"943ad5a2f10aa73c73cb379b5697ff11","score":"0.48241052","text":"def test_delete_form_test_with_blank_field()\n # Parameters for the API call\n body = DeleteBody.from_hash(APIHelper.json_deserialize(\n '{\"name\":\"farhan\",\"field\":\" \"}'\n ))\n\n # Perform the API call through the SDK function\n result = @controller.send_delete_form(body)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end","title":""},{"docid":"a36bb051310c1c3f3877f7becc125e93","score":"0.48233232","text":"def get!\n request! :get\n end","title":""},{"docid":"13860da5b84ad302ba8ab9b4860d6cfc","score":"0.48228362","text":"def test_missing_data\n get :show, { :type => 'DataRecord', :location => 'foo' }\n assert_response :missing\n end","title":""},{"docid":"71bf612214f7160ff17d699977f554fc","score":"0.4816428","text":"def status_dummy_params\n params.require(:status_dummy).permit(:e_no)\n end","title":""},{"docid":"909b760f54f181542cb95aee2413689b","score":"0.48116264","text":"def patch\n end","title":""},{"docid":"e68024345c9d2eb6d0a01ffecc99dda8","score":"0.4805595","text":"def rest_endpoint; end","title":""},{"docid":"9410f5d5c06a5d4acee3b61e4f080658","score":"0.4795879","text":"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end","title":""},{"docid":"9410f5d5c06a5d4acee3b61e4f080658","score":"0.4795879","text":"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end","title":""},{"docid":"9410f5d5c06a5d4acee3b61e4f080658","score":"0.4795879","text":"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end","title":""},{"docid":"9410f5d5c06a5d4acee3b61e4f080658","score":"0.4795879","text":"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end","title":""},{"docid":"b7e9b3503f3825c7ea89f479b89809f4","score":"0.47890034","text":"def destroy\n @basic.destroy\n respond_to do |format|\n format.html { redirect_to basics_url, notice: 'Basic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end","title":""},{"docid":"92de087c7ea41768bcec06895974faba","score":"0.4787184","text":"def get_index(*params); raise('Stub or mock required.') end","title":""},{"docid":"553aeec5b65ccdd6f7e20685dc4ac65b","score":"0.47863042","text":"def prepare_pet\n # remove the pet\n SwaggerClient::PetApi.delete_pet(10002)\n # recreate the pet\n pet = SwaggerClient::Pet.new('id' => 10002, 'name' => \"RUBY UNIT TESTING\")\n SwaggerClient::PetApi.add_pet(:body => pet)\nend","title":""}],"string":"[\n {\n \"docid\": \"ade43359931a8158bc17b1b039ca8b28\",\n \"score\": \"0.6153454\",\n \"text\": \"def destroy\\n @dummy = Dummy.find(params[:id])\\n @dummy.destroy\\n\\n respond_to do |format|\\n format.html { redirect_to dummies_url }\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"76dd1e894852a1df7132aaaf9440449f\",\n \"score\": \"0.5977489\",\n \"text\": \"def update\\n @dummy = Dummy.find(params[:id])\\n\\n respond_to do |format|\\n if @dummy.update_attributes(params[:dummy])\\n format.html { redirect_to @dummy, notice: 'Dummy was successfully updated.' }\\n format.json { head :no_content }\\n else\\n format.html { render action: \\\"edit\\\" }\\n format.json { render json: @dummy.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4645d892bc86eb9e85abeb7c39a721ca\",\n \"score\": \"0.5954389\",\n \"text\": \"def create\\n @dummy = Dummy.new(params[:dummy])\\n\\n respond_to do |format|\\n if @dummy.save\\n format.html { redirect_to @dummy, notice: 'Dummy was successfully created.' }\\n format.json { render json: @dummy, status: :created, location: @dummy }\\n else\\n format.html { render action: \\\"new\\\" }\\n format.json { render json: @dummy.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6f651731fccf0e9ed4c85f56ff110334\",\n \"score\": \"0.57978094\",\n \"text\": \"def show\\n @dummy = Dummy.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @dummy }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7c2eedab75c23b270980c16c33c0c704\",\n \"score\": \"0.5722152\",\n \"text\": \"def new\\n @dummy = Dummy.new\\n\\n respond_to do |format|\\n format.html # new.html.erb\\n format.json { render json: @dummy }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6f7c5dcc1cb7f5180d6cc9d9075ceccb\",\n \"score\": \"0.56644166\",\n \"text\": \"def ignore_test_create_with_wrong_http_method_redirects\\n get :create, model_identifier => test_entry_attrs\\n assert_redirected_to_index\\n \\n put :create, model_identifier => test_entry_attrs\\n assert_redirected_to_index\\n \\n delete :create, model_identifier => test_entry_attrs\\n assert_redirected_to_index\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cf06302bfac61e5b1a66df4691b4a72e\",\n \"score\": \"0.5624351\",\n \"text\": \"def GET; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8666bab783e18a12bef72fdd446ddaba\",\n \"score\": \"0.56179225\",\n \"text\": \"def set_status_dummy\\n @status_dummy = StatusDummy.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"72d272ad08cf351b071fa5c3a98ffe97\",\n \"score\": \"0.55701804\",\n \"text\": \"def post(request)\\n # sure thing!\\n json_response(200, { message: \\\"This dummy POST endpoint didn't do anything.\\\" })\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0cb22603d84c30bf81c77070c5bdd583\",\n \"score\": \"0.5535784\",\n \"text\": \"def define_restful_api(model)\\n get \\\"/#{model.resource}\\\" do\\n sleep settings.fake_latency if settings.fake_latency > 0\\n catch_errors { json model.all }\\n end\\n\\n get \\\"/#{model.resource}/:id\\\" do\\n sleep settings.fake_latency if settings.fake_latency > 0\\n catch_errors do\\n result = model.find_by_id(params[:id])\\n halt 404 if result.nil?\\n json result\\n end\\n end\\n\\n post \\\"/#{model.resource}\\\" do\\n sleep settings.fake_latency if settings.fake_latency > 0\\n catch_errors { json model.create(@json_payload) }\\n end\\n\\n patch \\\"/#{model.resource}/:id\\\" do\\n sleep settings.fake_latency if settings.fake_latency > 0\\n catch_errors { json model.update(params[:id], @json_payload) }\\n end\\n\\n delete \\\"/#{model.resource}/:id\\\" do\\n sleep settings.fake_latency if settings.fake_latency > 0\\n catch_errors { model.delete(params[:id]) }\\n end\\n\\n private\\n def catch_errors()\\n begin\\n yield\\n rescue Exception => e\\n logger.fatal(\\\"Exception: #{e}\\\")\\n status 500\\n json({'error' => e})\\n end\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c63214a71f6c847325525ae3ea759085\",\n \"score\": \"0.54998016\",\n \"text\": \"def test!\\n @@api.post(endpoint: self.endpoint + ['test'])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3d317bf88fddbd6c6635f12154058b5d\",\n \"score\": \"0.54456013\",\n \"text\": \"def ignore_test_update_with_wrong_http_method_redirects\\n get :update, :id => test_entry.id, model_identifier => test_entry_attrs\\n assert_redirected_to_index\\n \\n delete :update, :id => test_entry.id, model_identifier => test_entry_attrs\\n assert_redirected_to_index\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dcdbb85931b4e8671b23ade360ca837e\",\n \"score\": \"0.5425157\",\n \"text\": \"def destroy\\n @dummy_record = DummyRecord.find(params[:id])\\n @dummy_record.destroy\\n\\n respond_to do |format|\\n format.html { redirect_to dummy_records_url }\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7924824b417fbfd9fd4fafcb6018e80b\",\n \"score\": \"0.5421903\",\n \"text\": \"def non_get_methods\\n [:post, :put, :delete]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4a2ccd3ac8b1bb99ac7594c5ba4eed7d\",\n \"score\": \"0.54214275\",\n \"text\": \"def ignore_test_destroy_with_wrong_http_method_redirects\\n get :destroy, :id => test_entry.id\\n assert_redirected_to_index\\n \\n put :destroy, :id => test_entry.id\\n assert_redirected_to_index\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1621b12b864c3f5ed89a4a3c824cd134\",\n \"score\": \"0.5296095\",\n \"text\": \"def destroy\\n @dummy_table = DummyTable.find(params[:id])\\n @dummy_table.destroy\\n\\n respond_to do |format|\\n format.html { redirect_to dummy_tables_url }\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8d244c8e93c271a7e92ea1ee63d3dddc\",\n \"score\": \"0.52891594\",\n \"text\": \"def POST; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"27732fb7ba70b70803755ce204196dbc\",\n \"score\": \"0.52745736\",\n \"text\": \"def test_change_status\\n expected = 200\\n post_id = 1\\n data = {\\n status: 1\\n }\\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s+'/status')\\n http = Net::HTTP.new(uri.host,uri.port)\\n request = Net::HTTP::Put.new(uri.path)\\n request.set_form_data(data)\\n response = http.request(request)\\n actual = JSON.parse(response.body)\\n result = assert_equal(expected,actual['meta']['code'])\\n puts this_method_name + \\\" - \\\" + result.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fee6e52c1caa79866d0ffcd4c4c168ee\",\n \"score\": \"0.5271514\",\n \"text\": \"def reset()\\n @api.do_request(\\\"DELETE\\\", get_base_api_path())\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ac672ee1809614f8860d087470c2f670\",\n \"score\": \"0.52712536\",\n \"text\": \"def hit\\n action = params[:req]\\n name = params[:name] || params[:id]\\n render api_not_supported action, name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"506417ee185eb4942bb88f0dae39f932\",\n \"score\": \"0.52624154\",\n \"text\": \"def test_delete_post\\n expected = 200\\n post_id = 1\\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s)\\n http = Net::HTTP.new(uri.host,uri.port)\\n request = Net::HTTP::Delete.new(uri.path)\\n request.set_form_data(data)\\n response = http.request(request)\\n actual = JSON.parse(response.body)\\n result = assert_equal(expected,actual['meta']['code'])\\n puts this_method_name + \\\" - \\\" + result.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0cf60a00cb988bee6ab39aee03e50dc2\",\n \"score\": \"0.5249744\",\n \"text\": \"def update\\n @dummy_table = DummyTable.find(params[:id])\\n\\n respond_to do |format|\\n if @dummy_table.update_attributes(params[:dummy_table])\\n format.html { redirect_to @dummy_table, notice: 'Dummy table was successfully updated.' }\\n format.json { head :no_content }\\n else\\n format.html { render action: \\\"edit\\\" }\\n format.json { render json: @dummy_table.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"866eafbf949a559c7ed2f63c9eb9fb32\",\n \"score\": \"0.52183473\",\n \"text\": \"def index\\n puts \\\"test/index\\\"\\n ap params\\n done 404\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"23a67b59c87a4c6e2db116723f7462b7\",\n \"score\": \"0.5202404\",\n \"text\": \"def test_add_and_remove_notification\\n notification = {\\n \\\"title\\\" => \\\"Test subject soon to be removed\\\",\\n \\\"message\\\" => \\\"Hopefully deleted message!!\\\",\\n \\\"email_address\\\" => \\\"Hopefully deleted e-mail address\\\"\\n }\\n\\n # Make a new notification and then delete it\\n notification_id = make_a_notification(notification)\\n delete '/notification/' + notification_id\\n assert_equal 204, last_response.status\\n\\n # Double check that it's gone\\n get '/notification/' + notification_id\\n assert_equal 404, last_response.status\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dd9894340d4cf16757baca74371f9f43\",\n \"score\": \"0.5171304\",\n \"text\": \"def test\\n get(\\\"/help/test.json\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dd9894340d4cf16757baca74371f9f43\",\n \"score\": \"0.5171304\",\n \"text\": \"def test\\n get(\\\"/help/test.json\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4e0e59715d19dce2a47fccc2c67326dd\",\n \"score\": \"0.5133026\",\n \"text\": \"def patch!\\n request! :patch\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"72bb1a9a8c61810be0dc1b1aef670059\",\n \"score\": \"0.5131801\",\n \"text\": \"def reset_whats_new_for_all_users \\n get(\\\"/users.json/news/reset\\\")\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"72bb1a9a8c61810be0dc1b1aef670059\",\n \"score\": \"0.5131801\",\n \"text\": \"def reset_whats_new_for_all_users \\n get(\\\"/users.json/news/reset\\\")\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8c737d0d542ed69ad817301490464ce2\",\n \"score\": \"0.51225257\",\n \"text\": \"def test_no_params()\\n\\n # Perform the API call through the SDK function\\n result = self.class.controller.no_params()\\n\\n # Test response code\\n assert_equal(@response_catcher.response.status_code, 200)\\n\\n # Test whether the captured response is as we expected\\n assert_not_nil(result)\\n expected_body = JSON.parse('{\\\"passed\\\":true}')\\n received_body = JSON.parse(@response_catcher.response.raw_body)\\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"62bce5ac63124c8bdec3aae9b1246015\",\n \"score\": \"0.51208717\",\n \"text\": \"def test_show\\n get '/category/1'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d0a0da83c518545d4816726a1502e55a\",\n \"score\": \"0.510766\",\n \"text\": \"def test_contradictory\\n make_controller :contradictory\\n get :index\\n assert_response :success\\n get :secret_ferret_brigade\\n assert_response :success\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"437230aefd30af6fe0e5420c98a66e00\",\n \"score\": \"0.5078314\",\n \"text\": \"def test\\n get(\\\"/help/test\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd6fa777f1801fd164ac9f012e744e43\",\n \"score\": \"0.5064164\",\n \"text\": \"def destroy\\n @test_stuff.destroy\\n respond_to do |format|\\n format.html { redirect_to test_stuffs_url }\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b3da3f5ec2195d1d87b04178033e95bb\",\n \"score\": \"0.50615853\",\n \"text\": \"def index\\n @dummy_records = DummyRecord.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render :json => @dummy_records }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d3fc8705bcc46ad4944ea552aeac8894\",\n \"score\": \"0.5058138\",\n \"text\": \"def test_mock_without_param\\n get \\\"/mock\\\"\\n assert_equal last_response.status, 302\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6da4cbff70ef7a7eb159c6a1a220b271\",\n \"score\": \"0.50565535\",\n \"text\": \"def update\\n @dummy_record = DummyRecord.find(params[:id])\\n\\n respond_to do |format|\\n if @dummy_record.update_attributes(params[:dummy_record])\\n format.html { redirect_to @dummy_record, :notice => 'Dummy record was successfully updated.' }\\n format.json { head :no_content }\\n else\\n format.html { render :action => \\\"edit\\\" }\\n format.json { render :json => @dummy_record.errors, :status => :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d4a27a7b2ed4d844162111f1a1729a5\",\n \"score\": \"0.50532013\",\n \"text\": \"def get; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5aaae53fb36c8c6fca88e94d339d5e0a\",\n \"score\": \"0.5049742\",\n \"text\": \"def show\\n @dummy_record = DummyRecord.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render :json => @dummy_record }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"512f1b2e9c9d6d3d73954dd609859597\",\n \"score\": \"0.5032542\",\n \"text\": \"def add_dummy_create_id\\n params[:data] ||= {}\\n params[:data][:id] ||= 0\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7070e4dc3849fac5852c0271c9b6d7cc\",\n \"score\": \"0.5025528\",\n \"text\": \"def test_del\\n header 'Content-Type', 'application/json'\\n\\n data = File.read 'sample-traces/0.json'\\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\\n\\n id = last_response.body\\n\\n delete \\\"/traces/#{id}\\\"\\n assert last_response.ok?\\n\\n get \\\"/traces/#{id}\\\"\\n\\n contents = JSON.parse last_response.body\\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\\n assert contents.key? 'description'\\n assert(!last_response.ok?)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a216dd12f74891ba6144e36a8d48ec48\",\n \"score\": \"0.5025291\",\n \"text\": \"def new\\n @dummy_record = DummyRecord.new\\n\\n respond_to do |format|\\n format.html # new.html.erb\\n format.json { render :json => @dummy_record }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e09525b63972cae4dfdd19bdfaf6ba08\",\n \"score\": \"0.5019832\",\n \"text\": \"def destroy\\n @testing_.destroy\\n respond_to do |format|\\n format.html { redirect_to testing_s_url }\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1ee76b68b08f4ad9540f1be923303067\",\n \"score\": \"0.5004115\",\n \"text\": \"def test_create_a_task_with_valid_attributes\\n post '/tasks', { task: { title: \\\"something\\\", description: \\\"else\\\", user_id: 1 } } # post '/tasks', { task: { title: \\\"something\\\", description: \\\"else\\\", user_id: 1, status_id: 1 } }\\n assert_equal 1, Task.count # count is a method that ActiveRecord gives us\\n assert_equal 200, last_response.status\\n assert_equal \\\"created!\\\", last_response.body\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2d4ece99abb8a323a2ec42d51f563075\",\n \"score\": \"0.5000579\",\n \"text\": \"def destroy_fake\\n render :json => {:ok => true, :msg => nil}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"118257e1d8c56f5d9815bf38f7a55d41\",\n \"score\": \"0.4991763\",\n \"text\": \"def new\\n @dummy_table = DummyTable.new\\n\\n respond_to do |format|\\n format.html # new.html.erb\\n format.json { render json: @dummy_table }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e8159aa5a4fb242fa02a256685aa1524\",\n \"score\": \"0.49896178\",\n \"text\": \"def show\\n @dummy_table = DummyTable.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @dummy_table }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0a407527f798b84f395256c5802a737e\",\n \"score\": \"0.49891168\",\n \"text\": \"def test_update_post\\n data = {\\n title: \\\"Roll lemon\\\",\\n content: \\\"Gingerbread bear claw muffin danish danish marzipan. Toffee lollipop wafer carrot cake dessert.\\\",\\n description: \\\"Chocolate tootsie roll lemon drops. Chupa chups chocolate bar apple pie\\\",\\n image: \\\"chocolate.png\\\",\\n status: 1\\n }\\n expected = 200\\n post_id = 1\\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s)\\n http = Net::HTTP.new(uri.host,uri.port)\\n request = Net::HTTP::Put.new(uri.path)\\n request.set_form_data(data)\\n response = http.request(request)\\n actual = JSON.parse(response.body)\\n result = assert_equal(expected,actual['meta']['code'])\\n puts this_method_name + \\\" - \\\" + result.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"32b241adc0aec463c314d7d9a7fdebab\",\n \"score\": \"0.49861947\",\n \"text\": \"def test_1\\n\\n res = get \\\"http://localhost:7777/things\\\", :no_redirections => true\\n assert_equal 303, res.code.to_i\\n\\n res = get(\\\"http://localhost:7777/things\\\", :noredir => true)\\n assert_equal 303, res.code.to_i\\n\\n expect 200, {}, get(\\\"http://localhost:7777/items\\\", :noredir => true)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b52324e2f19d28cfc26d06b39f6baa99\",\n \"score\": \"0.49835736\",\n \"text\": \"def destroy\\n @internal = Internal.find(params[:id])\\n @internal.destroy\\n\\n respond_to do |format|\\n format.html { redirect_to internals_url }\\n format.json { head :ok }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c2c6d2f572b3f112dc8d5daacbdeb33c\",\n \"score\": \"0.49796873\",\n \"text\": \"def post; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"68972240d1ccdc366de40e0e3a0465e2\",\n \"score\": \"0.49711198\",\n \"text\": \"def new\\n render :json => { }, :status => 405\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"13b04d39719f2863793f4ba556a8f82a\",\n \"score\": \"0.49666816\",\n \"text\": \"def create\\n @dummy_record = DummyRecord.new(params[:dummy_record])\\n\\n respond_to do |format|\\n if @dummy_record.save\\n format.html { redirect_to @dummy_record, :notice => 'Dummy record was successfully created.' }\\n format.json { render :json => @dummy_record, :status => :created, :location => @dummy_record }\\n else\\n format.html { render :action => \\\"new\\\" }\\n format.json { render :json => @dummy_record.errors, :status => :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dd5a521d960e3460371f73b43329d3b3\",\n \"score\": \"0.4966468\",\n \"text\": \"def index\\n @api_v1_todos = Todo.all\\n render json: @api_v1_todos\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ac398c585647b3200c2f1c0183be5f11\",\n \"score\": \"0.49621412\",\n \"text\": \"def deleteRequest\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"689d5a07a403c4b765ba178e4aff08a3\",\n \"score\": \"0.49571577\",\n \"text\": \"def delete\\n client.delete(\\\"/#{id}\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e16289285ac8a2741bf53766d421417e\",\n \"score\": \"0.4953358\",\n \"text\": \"def rm_request path, data = nil,method = nil, verbose = false\\n reply = nil\\n hdrs = {'Content-Type'=>'application/json', 'X-Redmine-API-Key' => $settings['redmine_api_key']}\\n reply = Net::HTTP.start($settings['redmine_host'], $settings['redmine_port']) do |http|\\n if data\\n if !method || method == 'POST'\\n puts \\\"POST #{path}\\\" if verbose\\n http.request_post(path,data.to_json, hdrs)\\n elsif method == 'PUT'\\n # code for PUT here\\n puts \\\"PUT #{path}\\\" if verbose\\n http.send_request 'PUT', path, JSON.unparse(data), hdrs\\n end\\n else\\n puts \\\"GET #{path}\\\" if verbose\\n http.request_get(path, hdrs)\\n end\\n end\\n return reply\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"902adf030359d9e7acaa73878730d2fa\",\n \"score\": \"0.49433282\",\n \"text\": \"def http_method\\n :get\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5e381648634b96327e4c3715af1881c7\",\n \"score\": \"0.49407434\",\n \"text\": \"def test_should_create_link_via_API_JSON\\r\\n get \\\"/logout\\\"\\r\\n post \\\"/links.json\\\", :api_key => 'testapikey',\\r\\n :link => {:user_id => 1,\\r\\n :title => 'API Link 1',\\r\\n :url => 'http://www.api.com'}\\r\\n assert_response :created\\r\\n link = JSON.parse(response.body)\\r\\n check_new_link(link) \\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"20aacbc409484f7b6567a226bd6c52ee\",\n \"score\": \"0.49349332\",\n \"text\": \"def stub_api_request(http_method, path, status, path_params = {})\\n api = \\\"#{http_method.upcase} #{path} #{status}\\\"\\n case api\\n # Subject APIs\\n when \\\"GET /subjects/:id 200\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/subjects/#{path_params[:id]}\\\")\\n .to_return(status: 200, body: file_fixture(\\\"consent_solution/subjects/show.json\\\"))\\n when \\\"GET /subjects/:id 404\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/subjects/#{path_params[:id]}\\\")\\n .to_return(status: 404, body: file_fixture(\\\"consent_solution/404.json\\\"))\\n when \\\"GET /subjects/:id 401\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/subjects/#{path_params[:id]}\\\")\\n .to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"GET /subjects/:id 403\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/subjects/#{path_params[:id]}\\\")\\n .to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n when \\\"GET /subjects 200\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/subjects\\\").\\n to_return(status: 200, body: file_fixture(\\\"consent_solution/subjects/list.json\\\"))\\n when \\\"GET /subjects 401\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/subjects\\\").\\n to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"GET /subjects 403\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/subjects\\\").\\n to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n when \\\"POST /subjects 200\\\"\\n stub_request(:post, \\\"https://consent.iubenda.com/subjects\\\").\\n to_return(status: 200, body: file_fixture(\\\"consent_solution/subjects/create.json\\\"))\\n when \\\"POST /subjects 401\\\"\\n stub_request(:post, \\\"https://consent.iubenda.com/subjects\\\").\\n to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"POST /subjects 403\\\"\\n stub_request(:post, \\\"https://consent.iubenda.com/subjects\\\").\\n to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n when \\\"PUT /subjects/:id 200\\\"\\n stub_request(:put, \\\"https://consent.iubenda.com/subjects/#{path_params[:id]}\\\").\\n to_return(status: 200, body: file_fixture(\\\"consent_solution/subjects/update.json\\\"))\\n when \\\"PUT /subjects/:id 404\\\"\\n stub_request(:put, \\\"https://consent.iubenda.com/subjects/#{path_params[:id]}\\\").\\n to_return(status: 404, body: file_fixture(\\\"consent_solution/404.json\\\"))\\n when \\\"PUT /subjects/:id 401\\\"\\n stub_request(:put, \\\"https://consent.iubenda.com/subjects/#{path_params[:id]}\\\").\\n to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"PUT /subjects/:id 403\\\"\\n stub_request(:put, \\\"https://consent.iubenda.com/subjects/#{path_params[:id]}\\\").\\n to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n # Consent APIs\\n when \\\"GET /consent/:id 200\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/consent/#{path_params[:id]}\\\").\\n to_return(status: 200, body: file_fixture(\\\"consent_solution/consent/show.json\\\"))\\n when \\\"GET /consent/:id 404\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/consent/#{path_params[:id]}\\\").\\n to_return(status: 404, body: file_fixture(\\\"consent_solution/404.json\\\"))\\n when \\\"GET /consent/:id 401\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/consent/#{path_params[:id]}\\\").\\n to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"GET /consent/:id 403\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/consent/#{path_params[:id]}\\\").\\n to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n when \\\"GET /consent 200\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/consent\\\").\\n to_return(status: 200, body: file_fixture(\\\"consent_solution/consent/list.json\\\"))\\n when \\\"GET /consent 401\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/consent\\\").\\n to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"GET /consent 403\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/consent\\\").\\n to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n when \\\"POST /consent 200\\\"\\n stub_request(:post, \\\"https://consent.iubenda.com/consent\\\").\\n to_return(status: 200, body: file_fixture(\\\"consent_solution/consent/create.json\\\"))\\n when \\\"POST /consent 401\\\"\\n stub_request(:post, \\\"https://consent.iubenda.com/consent\\\").\\n to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"POST /consent 403\\\"\\n stub_request(:post, \\\"https://consent.iubenda.com/consent\\\").\\n to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n # LegalNotice APIs\\n when \\\"GET /legal_notices/:identifier/:version 200\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}/#{path_params[:version]}\\\").\\n to_return(status: 200, body: file_fixture(\\\"consent_solution/legal_notices/version.json\\\"))\\n when \\\"GET /legal_notices/:identifier/:version 401\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}/#{path_params[:version]}\\\").\\n to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"GET /legal_notices/:identifier/:version 403\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}/#{path_params[:version]}\\\").\\n to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n when \\\"GET /legal_notices/:identifier/:version 404\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}/#{path_params[:version]}\\\").\\n to_return(status: 404, body: file_fixture(\\\"consent_solution/404.json\\\"))\\n when \\\"GET /legal_notices/:identifier 200\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}\\\").\\n to_return(status: 200, body: file_fixture(\\\"consent_solution/legal_notices/versions.json\\\"))\\n when \\\"GET /legal_notices/:identifier 401\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}\\\").\\n to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"GET /legal_notices/:identifier 403\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/legal_notices/#{path_params[:identifier]}\\\").\\n to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n when \\\"GET /legal_notices 200\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/legal_notices\\\").\\n to_return(status: 200, body: file_fixture(\\\"consent_solution/legal_notices/list.json\\\"))\\n when \\\"GET /legal_notices 401\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/legal_notices\\\").\\n to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"GET /legal_notices 403\\\"\\n stub_request(:get, \\\"https://consent.iubenda.com/legal_notices\\\").\\n to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n when \\\"POST /legal_notices 200\\\"\\n stub_request(:post, \\\"https://consent.iubenda.com/legal_notices\\\").\\n to_return(status: 200, body: file_fixture(\\\"consent_solution/legal_notices/create.json\\\"))\\n when \\\"POST /legal_notices 401\\\"\\n stub_request(:post, \\\"https://consent.iubenda.com/legal_notices\\\").\\n to_return(status: 401, body: file_fixture(\\\"consent_solution/401.json\\\"))\\n when \\\"POST /legal_notices 403\\\"\\n stub_request(:post, \\\"https://consent.iubenda.com/legal_notices\\\").\\n to_return(status: 403, body: file_fixture(\\\"consent_solution/403.json\\\"))\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d66513c0710d28e2562e24711e6fe646\",\n \"score\": \"0.4923698\",\n \"text\": \"def create\\n #Instantiate a new object using form parameters\\n require 'uri'\\n require 'net/http'\\n\\n puts('------Parameters------')\\n puts(params)\\n puts('------Name------')\\n puts(params['name'])\\n puts('------------')\\n\\n params = {'subject' => \\\"Test Subject from Rails Controller\\\", 'message' => 'Test Message from Rails Controller', 'person_email' => 'JesseShawCodes@gmail.com' }\\n\\n puts(\\\"Those Params!!!\\\")\\n\\n=begin\\n begin\\n url = URI.parse('https://help.ginkgo-plus.dev/api/tickets')\\n puts(url.host)\\n puts(url.path)\\n puts(url.port)\\n puts('Lets see if there are any values above...')\\n req = Net::HTTP::Post.new(url, {'X-DeskPRO-API-KEY' => '1:CMZ8MZAA8RQR2D9H5SMQWQD4R'})\\n puts(\\\"Undefined http???\\\")\\n req.body = {'subject' => \\\"Test Subject from Rails Controller\\\", 'message' => 'Test Message from Rails Controller', 'person_email' => \\\"JesseShawCodes@gmail.com\\\" }\\n res = https.request(req)\\n puts(\\\"I think it works???\\\")\\n rescue => e\\n puts(\\\"Failed: Ahhh bummer. It's broke\\\")\\n puts(\\\"#{e}\\\")\\n end\\n\\n # x = Net::HTTP.post_form(URI.parse('https://help.ginkgo-plus.dev/api/tickets'), params)\\n # puts x.body\\n\\n @subject = Subject.new(params[:subject])\\n\\n #Save the object\\n if @subject.save\\n redirect_to(subjects_path)\\n else\\n render('new')\\n end\\n=end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7516b36b33e9a12132a6f4a208e3ee8b\",\n \"score\": \"0.49220282\",\n \"text\": \"def get\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9be10187c96823e03529b373de3b1ddb\",\n \"score\": \"0.49207458\",\n \"text\": \"def APICall params = {}\\n \\n path = params[:path]\\n method = params[:method] || 'GET'\\n payload = params[:payload] || nil\\n \\n params.delete(:method)\\n params.delete(:path)\\n params.delete(:payload)\\n \\n a = Time.now.to_f\\n \\n http = Net::HTTP.new(@infra[:domain]+'.zendesk.com',443)\\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\\n http.use_ssl = true\\n \\n uri = %{#{@infra[:path]}#{path}}\\n uri << '?'+params.map{ |key,val| \\\"#{key}=#{val}\\\" }.join('&') if params && params.count > 0\\n uri = URI.escape uri\\n \\n reqs = {\\n 'GET' => Net::HTTP::Get.new(uri),\\n 'POST' => Net::HTTP::Post.new(uri),\\n 'PUT' => Net::HTTP::Put.new(uri),\\n 'DELETE' => Net::HTTP::Delete.new(uri)\\n }\\n req = reqs[method]\\n \\n content_type = 'application/json'\\n content_type = 'application/binary' if path.include? 'uploads'\\n req.content_type = content_type\\n \\n req.basic_auth @username,@infra[:authentication]\\n \\n req.body = payload if method == 'POST' || method == 'PUT'\\n \\n response = http.request req\\n \\n code = response.code.to_f.round\\n body = response.body\\n \\n b = Time.now.to_f\\n c = ((b-a)*100).round.to_f/100\\n \\n final = {code: code.to_i,body: nil}\\n final = final.merge(body: JSON.parse(body)) if method != 'DELETE' && code != 500\\n final = final.merge(time: c)\\n \\n @api += 1\\n \\n final\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0592ed6f504cd8588f5409d7270e7ca9\",\n \"score\": \"0.4919412\",\n \"text\": \"def test_read_all_info_without_name\\n get '/v1/read_all?data=eyAiQ291bnRyeSI6ICJCcmF6aWwiIH0='\\n assert last_response.body.include?('Name field was not found in JSON')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"291c2e9af72a030d5a99cfaba856f59d\",\n \"score\": \"0.49191388\",\n \"text\": \"def test_post_then_get\\n header 'Content-Type', 'application/json'\\n\\n data = File.read 'sample-traces/0.json'\\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\\n id = last_response.body\\n\\n get \\\"/traces/#{id}\\\"\\n check_valid_trace last_response.body\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3a909e311cf72da4ea98f763872df54d\",\n \"score\": \"0.49113858\",\n \"text\": \"def create\\n @dummy_table = DummyTable.new(params[:dummy_table])\\n\\n respond_to do |format|\\n if @dummy_table.save\\n format.html { redirect_to @dummy_table, notice: 'Dummy table was successfully created.' }\\n format.json { render json: @dummy_table, status: :created, location: @dummy_table }\\n else\\n format.html { render action: \\\"new\\\" }\\n format.json { render json: @dummy_table.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb4800bf407b081271e2ee6797e51fd7\",\n \"score\": \"0.49093997\",\n \"text\": \"def test_putpoi_delete_not_found\\n changeset = create(:changeset)\\n cs_id = changeset.id\\n user = changeset.user\\n\\n amf_content \\\"putpoi\\\", \\\"/1\\\", [\\\"#{user.email}:test\\\", cs_id, 1, 999999, 0, 0, {}, false]\\n post :amf_write\\n assert_response :success\\n amf_parse_response\\n result = amf_result(\\\"/1\\\")\\n\\n assert_equal 3, result.size\\n assert_equal -4, result[0]\\n assert_equal \\\"node\\\", result[1]\\n assert_equal 999999, result[2]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"51770d8081f066b03177614c8a3016d5\",\n \"score\": \"0.49065903\",\n \"text\": \"def index\\r\\n render json: { status: \\\"Test API\\\"}\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bef148a7a1fc687bc1a9e35e4ebc7ef4\",\n \"score\": \"0.49050036\",\n \"text\": \"def destroy\\n # @sample = Sample.find(params[:id])\\n # @sample.destroy\\n\\n# respond_to do |format|\\n# format.html { redirect_to samples_url }\\n# format.json { head :no_content }\\n# end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0eac2b2edb79776c769bd126e629fe90\",\n \"score\": \"0.49000853\",\n \"text\": \"def clear_cache()\\n\\n $config[\\\"http\\\"].each do |doc|\\n\\n port = doc[1][\\\"adminPort\\\"]\\n host = doc[1][\\\"host\\\"]\\n\\n http = Net::HTTP.new(host, port)\\n request = Net::HTTP::Post.new(\\\"/tasks/clearData\\\")\\n request.basic_auth(\\\"ops\\\",\\\"password\\\")\\n response = http.request(request)\\n response.code.should == \\\"200\\\"\\n end\\n\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a1c786df37412a589e5f53e457f5fbc8\",\n \"score\": \"0.48979956\",\n \"text\": \"def test_delete_form_test_with_blank_name()\\n # Parameters for the API call\\n body = DeleteBody.from_hash(APIHelper.json_deserialize(\\n '{\\\"name\\\":\\\" \\\",\\\"field\\\":\\\"QA\\\"}'\\n ))\\n\\n # Perform the API call through the SDK function\\n result = @controller.send_delete_form(body)\\n\\n # Test response code\\n assert_equal(200, @response_catcher.response.status_code)\\n\\n # Test whether the captured response is as we expected\\n refute_nil(result)\\n expected_body = JSON.parse(\\n '{\\\"passed\\\":true}'\\n )\\n received_body = JSON.parse(@response_catcher.response.raw_body)\\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a6660f8f62027412929d7b78d182281c\",\n \"score\": \"0.4894688\",\n \"text\": \"def delete endpoint\\n do_request :delete, endpoint\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"040c39c830e48d2f28b9090b537a2d18\",\n \"score\": \"0.48936102\",\n \"text\": \"def update\\n # actions\\n path = URI(@endpoint).path\\n action = URI(@req.request_uri).path.sub(path, '').split('/')\\n action -= ['']\\n if action.include?('_history')\\n @actions = [action[0], '_history']\\n else\\n @actions = [action[0]]\\n end\\n\\n # search param\\n req_query = URI(@req.request_uri).query\\n unless req_query.nil?\\n @req_params = URI::decode_www_form(req_query).to_h\\n end\\n\\n # requst method\\n if @req.request_method == \\\"GET\\\" and @actions.include? '_history'\\n @req_method = 'vread'\\n elsif @req.request_method == \\\"GET\\\" and @req_params != nil\\n @req_method = 'search-type'\\n elsif @req.request_method == \\\"PUT\\\"\\n @req_method = 'update'\\n elsif @req.request_method == \\\"POST\\\"\\n @req_method = 'create'\\n else\\n @req_method = 'read'\\n end\\n\\n # interaction\\n int1 = Interaction.last type: @actions[0], code: @req_method\\n if int1.nil?\\n @present = 0\\n else\\n @present = int1.id\\n @intCode = int1.valueCode\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c36b2d1f5ca88b6864ccf44496d3c99f\",\n \"score\": \"0.48928612\",\n \"text\": \"def api_method\\n ''\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d7ad40af3d6f3fc1916b780aa9cd47e\",\n \"score\": \"0.48918486\",\n \"text\": \"def test_admin_can_show_user\\n # first log in\\n get '/login' # need to do this to set up the form container.\\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\\n\\n user_id = User.find_by_username(NOBODY_USERNAME).id\\n\\n get \\\"/user/#{user_id}\\\"\\n assert last_response.ok?\\n assert last_response.body.include?(NOBODY_USERNAME)\\n\\n # ensure a request for unknown ID is bounced.\\n get \\\"/user/153\\\"\\n assert last_response.ok?\\n assert last_response.body.include?(\\\"The user id supplied was not recognised\\\")\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbb344abb971369ada7f4157e97368a9\",\n \"score\": \"0.48893958\",\n \"text\": \"def rm_update path, data, msg\\n\\n re = rm_request path, data, 'PUT'\\n puts re.body\\n chk (re.code!='200'), msg + \\\"\\\\n#{re.code} #{re.msg}\\\\n\\\\n\\\"\\n return true\\n\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2134736b480f4c45bccced2f10ac04fa\",\n \"score\": \"0.4882738\",\n \"text\": \"def destroy\\n\\n\\t\\turi = URI.parse(Counter::Application.config.simplyurl)\\n\\t\\thttp = Net::HTTP.new(uri.host, uri.port)\\n\\t\\t\\n\\t\\trequest = Net::HTTP::Delete.new('/offsets/doit.json')\\n\\t\\tputs params\\n\\t\\tputs params.slice(*['custids','acctids'])\\n\\t\\t\\n\\t\\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\\n\\t\\t# this way, i 'split' it at the other side to recover my array\\n\\t\\t# it should work without the join/split crap, but it doesn't\\n\\t\\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(',')})\\n\\t\\t\\n\\t\\tputs request.body\\n\\t\\t\\n\\t\\tresponse = http.request(request)\\n\\t\\tputs response.body\\n\\n respond_to do |format|\\n format.html { render :text => response.code == :ok ? \\\"\\\" : response.body, status: response.code }\\n format.json { render :text => response.code == :ok ? \\\"\\\" : response.body, status: response.code }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"79f59385e1e8240057a42b37b9f6d294\",\n \"score\": \"0.48752195\",\n \"text\": \"def test_should_update_link_via_API_XML\\r\\n get \\\"/logout\\\"\\r\\n put \\\"/links/1.xml\\\", :link => {:user_id => 1,\\r\\n :title => 'API Link 1',\\r\\n :url => 'http://www.api.com'}\\r\\n assert_response 401\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6e94e13254ddd489e312e30a43547786\",\n \"score\": \"0.4869692\",\n \"text\": \"def add_dummy_destroy_id\\n params[:id] ||= 0\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"015f6c1347c417df7510b12b53ada294\",\n \"score\": \"0.4867234\",\n \"text\": \"def api_behavior\\n if post?\\n display resource, :status => :created\\n # render resource instead of 204 no content\\n elsif put? || delete?\\n display resource, :status => :ok\\n else\\n super\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2c1a691cbb5ca269082f4b9fc9aaef91\",\n \"score\": \"0.48659682\",\n \"text\": \"def handle_GET(initial)\\n\\trequest_path = get_Path(initial)\\n\\trequest_path = request_path[1..-1] if request_path[0] == '/'\\n\\tif File.exist?(request_path)\\n\\t\\tcreate_Found_Response(request_path)\\n\\telse\\n\\t\\tcreate_Not_Found_Response(request_path)\\n\\tend\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d150a70b29ba6a251519dff4d7479c13\",\n \"score\": \"0.4865849\",\n \"text\": \"def post(path, **args); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"28e62baa030829bb84c058704da4ef7e\",\n \"score\": \"0.48651296\",\n \"text\": \"def set_api_v1_todo\\n @api_v1_todo = Todo.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"944248c8e5811c1d6a0c849d8cfe4c1a\",\n \"score\": \"0.4862183\",\n \"text\": \"def test_student_locked_out\\n # Index\\n get_as @student, :index\\n assert_response :missing\\n\\n # Edit\\n get_as @student, :edit\\n assert_response :missing\\n\\n # Update\\n get_as @student, :update\\n assert_response :missing\\n\\n # Create\\n get_as @student, :create\\n assert_response :missing\\n\\n # Download Student List\\n get_as @student, :download_student_list\\n assert_response :missing\\n\\n # Upload Student List (Get)\\n get_as @student, :index\\n assert_response :missing\\n\\n # Upload Student List (Post)\\n post_as @student, :index\\n assert_response :missing\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d8ee52faeb6c4dd89f27ae868ec279cb\",\n \"score\": \"0.48589364\",\n \"text\": \"def regular(*args)\\n if args[0].kind_of?(Hash)\\n post({:type => \\\"regular\\\"}.update(args[0]))\\n else\\n body, title, dummy = args\\n post(:type => \\\"regular\\\", :title => title, :body => body)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b937668031da726f019cd2c84320d287\",\n \"score\": \"0.48429057\",\n \"text\": \"def post\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53553812f1fc7f75e34b062fbc29c0d7\",\n \"score\": \"0.48281178\",\n \"text\": \"def destroy\\n @yummy.destroy\\n respond_to do |format|\\n format.html { redirect_to yummies_url, notice: 'Yummy was successfully destroyed.' }\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fbc33eae34e7ab3eb159279c484299f2\",\n \"score\": \"0.48273402\",\n \"text\": \"def destroy\\n @api_v1_todo.destroy\\n respond_to do |format|\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"943ad5a2f10aa73c73cb379b5697ff11\",\n \"score\": \"0.48241052\",\n \"text\": \"def test_delete_form_test_with_blank_field()\\n # Parameters for the API call\\n body = DeleteBody.from_hash(APIHelper.json_deserialize(\\n '{\\\"name\\\":\\\"farhan\\\",\\\"field\\\":\\\" \\\"}'\\n ))\\n\\n # Perform the API call through the SDK function\\n result = @controller.send_delete_form(body)\\n\\n # Test response code\\n assert_equal(200, @response_catcher.response.status_code)\\n\\n # Test whether the captured response is as we expected\\n refute_nil(result)\\n expected_body = JSON.parse(\\n '{\\\"passed\\\":true}'\\n )\\n received_body = JSON.parse(@response_catcher.response.raw_body)\\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a36bb051310c1c3f3877f7becc125e93\",\n \"score\": \"0.48233232\",\n \"text\": \"def get!\\n request! :get\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"13860da5b84ad302ba8ab9b4860d6cfc\",\n \"score\": \"0.48228362\",\n \"text\": \"def test_missing_data\\n get :show, { :type => 'DataRecord', :location => 'foo' }\\n assert_response :missing\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"71bf612214f7160ff17d699977f554fc\",\n \"score\": \"0.4816428\",\n \"text\": \"def status_dummy_params\\n params.require(:status_dummy).permit(:e_no)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"909b760f54f181542cb95aee2413689b\",\n \"score\": \"0.48116264\",\n \"text\": \"def patch\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e68024345c9d2eb6d0a01ffecc99dda8\",\n \"score\": \"0.4805595\",\n \"text\": \"def rest_endpoint; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9410f5d5c06a5d4acee3b61e4f080658\",\n \"score\": \"0.4795879\",\n \"text\": \"def delete()\\n @api.do_request(\\\"DELETE\\\", get_base_api_path())\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9410f5d5c06a5d4acee3b61e4f080658\",\n \"score\": \"0.4795879\",\n \"text\": \"def delete()\\n @api.do_request(\\\"DELETE\\\", get_base_api_path())\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9410f5d5c06a5d4acee3b61e4f080658\",\n \"score\": \"0.4795879\",\n \"text\": \"def delete()\\n @api.do_request(\\\"DELETE\\\", get_base_api_path())\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9410f5d5c06a5d4acee3b61e4f080658\",\n \"score\": \"0.4795879\",\n \"text\": \"def delete()\\n @api.do_request(\\\"DELETE\\\", get_base_api_path())\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b7e9b3503f3825c7ea89f479b89809f4\",\n \"score\": \"0.47890034\",\n \"text\": \"def destroy\\n @basic.destroy\\n respond_to do |format|\\n format.html { redirect_to basics_url, notice: 'Basic was successfully destroyed.' }\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"92de087c7ea41768bcec06895974faba\",\n \"score\": \"0.4787184\",\n \"text\": \"def get_index(*params); raise('Stub or mock required.') end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"553aeec5b65ccdd6f7e20685dc4ac65b\",\n \"score\": \"0.47863042\",\n \"text\": \"def prepare_pet\\n # remove the pet\\n SwaggerClient::PetApi.delete_pet(10002)\\n # recreate the pet\\n pet = SwaggerClient::Pet.new('id' => 10002, 'name' => \\\"RUBY UNIT TESTING\\\")\\n SwaggerClient::PetApi.add_pet(:body => pet)\\nend\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":172,"cells":{"query_id":{"kind":"string","value":"a2099a77c85e91272ae2f9e35b937953"},"query":{"kind":"string","value":"Only allow a trusted parameter \"white list\" through."},"positive_passages":{"kind":"list like","value":[{"docid":"a02fdfddf92e407d8fb4b029d8245589","score":"0.0","text":"def stadium_params\n params.require(:stadium).permit(:name,:city)\n end","title":""}],"string":"[\n {\n \"docid\": \"a02fdfddf92e407d8fb4b029d8245589\",\n \"score\": \"0.0\",\n \"text\": \"def stadium_params\\n params.require(:stadium).permit(:name,:city)\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"c1f317213d917a1e3cfa584197f82e6c","score":"0.7121987","text":"def allowed_params\n ALLOWED_PARAMS\n end","title":""},{"docid":"b32229655ba2c32ebe754084ef912a1a","score":"0.70541996","text":"def expected_permitted_parameter_names; end","title":""},{"docid":"a91e9bf1896870368befe529c0e977e2","score":"0.69483954","text":"def param_whitelist\n [:role, :title]\n end","title":""},{"docid":"547b7ab7c31effd8dcf394d3d38974ff","score":"0.6902367","text":"def default_param_whitelist\n [\"mode\"]\n end","title":""},{"docid":"e291b3969196368dd4f7080a354ebb08","score":"0.6733912","text":"def permitir_parametros\n \t\tparams.permit!\n \tend","title":""},{"docid":"4fc36c3400f3d5ca3ad7dc2ed185f213","score":"0.6717838","text":"def permitted_params\n []\n end","title":""},{"docid":"e164094e79744552ae1c53246ce8a56c","score":"0.6687021","text":"def strong_params\n params.require(:user).permit(param_whitelist)\n end","title":""},{"docid":"e662f0574b56baff056c6fc4d8aa1f47","score":"0.6676254","text":"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end","title":""},{"docid":"c436017f4e8bd819f3d933587dfa070a","score":"0.66612333","text":"def filtered_parameters; end","title":""},{"docid":"9a2a1af8f52169bd818b039ef030f513","score":"0.6555296","text":"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end","title":""},{"docid":"7ac5f60df8240f27d24d1e305f0e5acb","score":"0.6527056","text":"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end","title":""},{"docid":"53d84ad5aa2c5124fa307752101aced3","score":"0.6456324","text":"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end","title":""},{"docid":"60ccf77b296ed68c1cb5cb262bacf874","score":"0.6450841","text":"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end","title":""},{"docid":"f12336a181f3c43ac8239e5d0a59b5b4","score":"0.6450127","text":"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end","title":""},{"docid":"12fa2760f5d16a1c46a00ddb41e4bce2","score":"0.6447226","text":"def param_whitelist\n [:rating, :review]\n end","title":""},{"docid":"86b2d48cb84654e19b91d9d3cbc2ff80","score":"0.6434961","text":"def valid_params?; end","title":""},{"docid":"16e18668139bdf8d5ccdbff12c98bd25","score":"0.64121825","text":"def permitted_params\n declared(params, include_missing: false)\n end","title":""},{"docid":"16e18668139bdf8d5ccdbff12c98bd25","score":"0.64121825","text":"def permitted_params\n declared(params, include_missing: false)\n end","title":""},{"docid":"7a6fbcc670a51834f69842348595cc79","score":"0.63913447","text":"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend","title":""},{"docid":"bd826c318f811361676f5282a9256071","score":"0.63804525","text":"def filter_parameters; end","title":""},{"docid":"bd826c318f811361676f5282a9256071","score":"0.63804525","text":"def filter_parameters; end","title":""},{"docid":"068f8502695b7c7f6d382f8470180ede","score":"0.6373396","text":"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end","title":""},{"docid":"c04a150a23595af2a3d515d0dfc34fdd","score":"0.6360051","text":"def strong_params\n params.require(:community).permit(param_whitelist)\n end","title":""},{"docid":"fc43ee8cb2466a60d4a69a04461c601a","score":"0.6355191","text":"def check_params; true; end","title":""},{"docid":"9d23b31178b8be81fe8f1d20c154336f","score":"0.62856233","text":"def valid_params_request?; end","title":""},{"docid":"533f1ba4c3ab55e79ed9b259f67a70fb","score":"0.627813","text":"def strong_params\n params.require(:experience).permit(param_whitelist)\n end","title":""},{"docid":"9735bbaa391eab421b71a4c1436d109e","score":"0.62451434","text":"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end","title":""},{"docid":"67fe19aa3f1169678aa999df9f0f7e95","score":"0.6228103","text":"def list_params\n params.permit(:name)\n end","title":""},{"docid":"5ee931ad3419145387a2dc5a284c6fb6","score":"0.6224965","text":"def check_params\n true\n end","title":""},{"docid":"fe4025b0dd554f11ce9a4c7a40059912","score":"0.6222941","text":"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end","title":""},{"docid":"bb32aa218785dcd548537db61ecc61de","score":"0.6210244","text":"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end","title":""},{"docid":"ff55cf04e6038378f431391ce6314e27","score":"0.62077755","text":"def additional_permitted_params\n []\n end","title":""},{"docid":"c5f294dd85260b1f3431a1fbbc1fb214","score":"0.61762565","text":"def strong_params\n params.require(:education).permit(param_whitelist)\n end","title":""},{"docid":"0d980fc60b69d03c48270d2cd44e279f","score":"0.61711127","text":"def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end","title":""},{"docid":"1677b416ad07c203256985063859691b","score":"0.6168448","text":"def allow_params_authentication!; end","title":""},{"docid":"3eef50b797f6aa8c4def3969457f45dd","score":"0.6160164","text":"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end","title":""},{"docid":"c25a1ea70011796c8fcd4927846f7a04","score":"0.61446255","text":"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end","title":""},{"docid":"8894a3d0d0ad5122c85b0bf4ce4080a6","score":"0.6134175","text":"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end","title":""},{"docid":"34d018968dad9fa791c1df1b3aaeccd1","score":"0.6120522","text":"def paramunold_params\n params.require(:paramunold).permit!\n end","title":""},{"docid":"76d85c76686ef87239ba8207d6d631e4","score":"0.6106709","text":"def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end","title":""},{"docid":"3c8ffd5ef92e817f2779a9c56c9fc0e9","score":"0.60981655","text":"def quote_params\n params.permit!\n end","title":""},{"docid":"2b19f8222e09c2518b0d19b4bf1f69d3","score":"0.6076113","text":"def list_params\n params.permit(:list_name)\n end","title":""},{"docid":"aabfd0cce84d7f71b1ccd2df6a6af7c3","score":"0.60534036","text":"def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end","title":""},{"docid":"4f20d784611d82c07d49cf1cf0d6cb7e","score":"0.60410434","text":"def all_params; end","title":""},{"docid":"5a96718b851794fc3e4409f6270f18fa","score":"0.6034582","text":"def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end","title":""},{"docid":"ff7bc2f09784ed0b4563cfc89b19831d","score":"0.6029977","text":"def source_params\n params.require(:source).permit(all_allowed_params)\n end","title":""},{"docid":"6c615e4d8eed17e54fc23adca0027043","score":"0.6019861","text":"def user_params\n end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"7402112b5e653d343b91b6d38c203c59","score":"0.6019158","text":"def params; end","title":""},{"docid":"2032edd5ab9475d59be84bdf5595f23a","score":"0.60184896","text":"def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end","title":""},{"docid":"c59ec134c641678085e086ab2a66a95f","score":"0.60157263","text":"def permitted_params\n @wfd_edit_parameters\n end","title":""},{"docid":"a8faf8deb0b4ac1bcdd8164744985176","score":"0.6005857","text":"def user_params\r\n end","title":""},{"docid":"b98f58d2b73eac4825675c97acd39470","score":"0.6003803","text":"def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end","title":""},{"docid":"0cb77c561c62c78c958664a36507a7c9","score":"0.60012573","text":"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend","title":""},{"docid":"7b7196fbaee9e8777af48e4efcaca764","score":"0.59955895","text":"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end","title":""},{"docid":"be95d72f5776c94cb1a4109682b7b224","score":"0.5994598","text":"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend","title":""},{"docid":"70fa55746056e81854d70a51e822de66","score":"0.5993604","text":"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end","title":""},{"docid":"e4c37054b31112a727e3816e94f7be8a","score":"0.5983824","text":"def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend","title":""},{"docid":"e3089e0811fa34ce509d69d488c75306","score":"0.5983166","text":"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end","title":""},{"docid":"2202d6d61570af89552803ad144e1fe7","score":"0.5977431","text":"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end","title":""},{"docid":"4d77abbae6d3557081c88dad60c735d0","score":"0.597591","text":"def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end","title":""},{"docid":"55d8ddbada3cd083b5328c1b41694282","score":"0.5968824","text":"def params_permit\n params.permit(:id)\n end","title":""},{"docid":"a44360e98883e4787a9591c602282c4b","score":"0.5965953","text":"def allowed_params\n params.require(:allowed).permit(:email)\n end","title":""},{"docid":"45b8b091f448e1e15f62ce90b681e1b4","score":"0.59647584","text":"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end","title":""},{"docid":"45b8b091f448e1e15f62ce90b681e1b4","score":"0.59647584","text":"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end","title":""},{"docid":"4e758c3a3572d7cdd76c8e68fed567e0","score":"0.59566855","text":"def filter_params\n params.permit(*resource_filter_permitted_params)\n end","title":""},{"docid":"3154b9c9e3cd7f0b297f900f73df5d83","score":"0.59506303","text":"def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end","title":""},{"docid":"b48f61fbb31be4114df234fa7b166587","score":"0.5950375","text":"def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend","title":""},{"docid":"c4802950f28649fdaed7f35882118f20","score":"0.59485626","text":"def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end","title":""},{"docid":"5d64cb26ce1e82126dd5ec44e905341c","score":"0.59440875","text":"def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end","title":""},{"docid":"7fa620eeb32e576da67f175eea6e6fa0","score":"0.5930872","text":"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end","title":""},{"docid":"da4f66ce4e8c9997953249c3ff03114e","score":"0.5930206","text":"def argument_params\n params.require(:argument).permit(:name)\n end","title":""},{"docid":"f7c6dad942d4865bdd100b495b938f50","score":"0.5925668","text":"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end","title":""},{"docid":"9892d8126849ccccec9c8726d75ff173","score":"0.59235454","text":"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end","title":""},{"docid":"be01bb66d94aef3c355e139205253351","score":"0.5917905","text":"def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end","title":""},{"docid":"631f07548a1913ef9e20ecf7007800e5","score":"0.59164816","text":"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end","title":""},{"docid":"d6bf948034a6c8adc660df172dd7ec6e","score":"0.5913821","text":"def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end","title":""},{"docid":"eb5b91d56901f0f20f58d574d155c0e6","score":"0.59128743","text":"def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end","title":""},{"docid":"c6a96927a6fdc0d2db944c79d520cd99","score":"0.5906617","text":"def parameters\n nil\n end","title":""},{"docid":"822c743e15dd9236d965d12beef67e0c","score":"0.59053683","text":"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end","title":""},{"docid":"a743e25503f1cc85a98a35edce120055","score":"0.59052664","text":"def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end","title":""},{"docid":"533048be574efe2ed1b3c3c83a25d689","score":"0.5901591","text":"def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end","title":""},{"docid":"02a61b27f286a50802d652930fee6782","score":"0.58987755","text":"def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end","title":""},{"docid":"3683f6af8fc4e6b9de7dc0c83f88b6aa","score":"0.5897456","text":"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end","title":""},{"docid":"238705c4afebc0ee201cc51adddec10a","score":"0.58970183","text":"def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end","title":""},{"docid":"d493d59391b220488fdc1f30bd1be261","score":"0.58942604","text":"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end","title":""}],"string":"[\n {\n \"docid\": \"c1f317213d917a1e3cfa584197f82e6c\",\n \"score\": \"0.7121987\",\n \"text\": \"def allowed_params\\n ALLOWED_PARAMS\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b32229655ba2c32ebe754084ef912a1a\",\n \"score\": \"0.70541996\",\n \"text\": \"def expected_permitted_parameter_names; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a91e9bf1896870368befe529c0e977e2\",\n \"score\": \"0.69483954\",\n \"text\": \"def param_whitelist\\n [:role, :title]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"547b7ab7c31effd8dcf394d3d38974ff\",\n \"score\": \"0.6902367\",\n \"text\": \"def default_param_whitelist\\n [\\\"mode\\\"]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e291b3969196368dd4f7080a354ebb08\",\n \"score\": \"0.6733912\",\n \"text\": \"def permitir_parametros\\n \\t\\tparams.permit!\\n \\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4fc36c3400f3d5ca3ad7dc2ed185f213\",\n \"score\": \"0.6717838\",\n \"text\": \"def permitted_params\\n []\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e164094e79744552ae1c53246ce8a56c\",\n \"score\": \"0.6687021\",\n \"text\": \"def strong_params\\n params.require(:user).permit(param_whitelist)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e662f0574b56baff056c6fc4d8aa1f47\",\n \"score\": \"0.6676254\",\n \"text\": \"def strong_params\\n params.require(:listing_member).permit(param_whitelist)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c436017f4e8bd819f3d933587dfa070a\",\n \"score\": \"0.66612333\",\n \"text\": \"def filtered_parameters; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9a2a1af8f52169bd818b039ef030f513\",\n \"score\": \"0.6555296\",\n \"text\": \"def permitted_strong_parameters\\n :all #or an array of parameters, example: [:name, :email]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7ac5f60df8240f27d24d1e305f0e5acb\",\n \"score\": \"0.6527056\",\n \"text\": \"def parameters_list_params\\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53d84ad5aa2c5124fa307752101aced3\",\n \"score\": \"0.6456324\",\n \"text\": \"def parameter_params\\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"60ccf77b296ed68c1cb5cb262bacf874\",\n \"score\": \"0.6450841\",\n \"text\": \"def param_whitelist\\n whitelist = [\\n :description,\\n :progress,\\n :kpi_id\\n ]\\n \\n unless action_name === 'create'\\n whitelist.delete(:kpi_id)\\n end\\n \\n whitelist\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f12336a181f3c43ac8239e5d0a59b5b4\",\n \"score\": \"0.6450127\",\n \"text\": \"def param_whitelist\\n whitelist = [\\n :username, :name,\\n :parent_id,\\n :headline, :description, :video,\\n :policy, :signup_mode, :category,\\n :website, :facebook, :twitter, :linkedin,\\n :founded_at,\\n privacy: [\\n :events,\\n :resources\\n ],\\n permission: [\\n :profile,\\n :members,\\n :children,\\n :statistics,\\n :posts,\\n :listings,\\n :resources,\\n :events\\n ],\\n location: [\\n :description,\\n :street,\\n :city,\\n :state,\\n :zip,\\n :country,\\n :latitude,\\n :longitude\\n ]\\n ]\\n \\n if action_name === 'update'\\n whitelist.delete(:parent_id)\\n unless current_user.role_in(@community) === 'owner'\\n whitelist.delete(:privacy)\\n whitelist.delete(:permission)\\n end\\n end\\n \\n whitelist\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"12fa2760f5d16a1c46a00ddb41e4bce2\",\n \"score\": \"0.6447226\",\n \"text\": \"def param_whitelist\\n [:rating, :review]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"86b2d48cb84654e19b91d9d3cbc2ff80\",\n \"score\": \"0.6434961\",\n \"text\": \"def valid_params?; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"16e18668139bdf8d5ccdbff12c98bd25\",\n \"score\": \"0.64121825\",\n \"text\": \"def permitted_params\\n declared(params, include_missing: false)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"16e18668139bdf8d5ccdbff12c98bd25\",\n \"score\": \"0.64121825\",\n \"text\": \"def permitted_params\\n declared(params, include_missing: false)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7a6fbcc670a51834f69842348595cc79\",\n \"score\": \"0.63913447\",\n \"text\": \"def get_params\\n\\t\\treturn ActionController::Parameters.new(self.attributes).permit(\\\"account_id\\\", \\\"title\\\", \\\"category\\\", \\\"introduction\\\", \\\"tags\\\", \\\"segment_type\\\", \\\"visible\\\", \\\"status\\\", \\\"main_image\\\")\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd826c318f811361676f5282a9256071\",\n \"score\": \"0.63804525\",\n \"text\": \"def filter_parameters; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd826c318f811361676f5282a9256071\",\n \"score\": \"0.63804525\",\n \"text\": \"def filter_parameters; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"068f8502695b7c7f6d382f8470180ede\",\n \"score\": \"0.6373396\",\n \"text\": \"def strong_params\\n params.require(:team_member).permit(param_whitelist)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c04a150a23595af2a3d515d0dfc34fdd\",\n \"score\": \"0.6360051\",\n \"text\": \"def strong_params\\n params.require(:community).permit(param_whitelist)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc43ee8cb2466a60d4a69a04461c601a\",\n \"score\": \"0.6355191\",\n \"text\": \"def check_params; true; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d23b31178b8be81fe8f1d20c154336f\",\n \"score\": \"0.62856233\",\n \"text\": \"def valid_params_request?; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"533f1ba4c3ab55e79ed9b259f67a70fb\",\n \"score\": \"0.627813\",\n \"text\": \"def strong_params\\n params.require(:experience).permit(param_whitelist)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9735bbaa391eab421b71a4c1436d109e\",\n \"score\": \"0.62451434\",\n \"text\": \"def allowed_params\\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"67fe19aa3f1169678aa999df9f0f7e95\",\n \"score\": \"0.6228103\",\n \"text\": \"def list_params\\n params.permit(:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5ee931ad3419145387a2dc5a284c6fb6\",\n \"score\": \"0.6224965\",\n \"text\": \"def check_params\\n true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fe4025b0dd554f11ce9a4c7a40059912\",\n \"score\": \"0.6222941\",\n \"text\": \"def grant_params\\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bb32aa218785dcd548537db61ecc61de\",\n \"score\": \"0.6210244\",\n \"text\": \"def safe_params\\n resurce_name = self.class.resource_name\\n params_method_name = \\\"#{resurce_name}_params\\\".to_sym\\n if params[resurce_name]\\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\\n send(params_method_name)\\n else\\n raise ActiveModel::ForbiddenAttributesError, \\\"Please, define the '#{params_method_name}' method in #{self.class.name}\\\"\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ff55cf04e6038378f431391ce6314e27\",\n \"score\": \"0.62077755\",\n \"text\": \"def additional_permitted_params\\n []\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c5f294dd85260b1f3431a1fbbc1fb214\",\n \"score\": \"0.61762565\",\n \"text\": \"def strong_params\\n params.require(:education).permit(param_whitelist)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0d980fc60b69d03c48270d2cd44e279f\",\n \"score\": \"0.61711127\",\n \"text\": \"def resource_params\\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1677b416ad07c203256985063859691b\",\n \"score\": \"0.6168448\",\n \"text\": \"def allow_params_authentication!; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3eef50b797f6aa8c4def3969457f45dd\",\n \"score\": \"0.6160164\",\n \"text\": \"def param_whitelist\\n [\\n :title,\\n :description,\\n :organization,\\n :team_id,\\n :started_at,\\n :finished_at,\\n location: [\\n :description,\\n :street,\\n :city,\\n :state,\\n :zip,\\n :country,\\n :latitude,\\n :longitude\\n ]\\n ]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c25a1ea70011796c8fcd4927846f7a04\",\n \"score\": \"0.61446255\",\n \"text\": \"def param_whitelist\\n if @user.present? && current_user != @user\\n return [:followed]\\n end\\n \\n whitelist = [\\n :username, :email, :password,\\n :first_name, :last_name,\\n :birthday, :gender,\\n :headline, :biography, :ask_about, :focus,\\n :website, :facebook, :linkedin, :twitter, :github,\\n roles: [],\\n skills: [],\\n interests: [],\\n privacy: { contact: [] },\\n location: [\\n :description,\\n :street,\\n :city,\\n :state,\\n :zip,\\n :country,\\n :latitude,\\n :longitude\\n ]\\n ]\\n \\n if action_name === 'update'\\n whitelist.delete(:email)\\n whitelist.delete(:password)\\n end\\n \\n whitelist\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8894a3d0d0ad5122c85b0bf4ce4080a6\",\n \"score\": \"0.6134175\",\n \"text\": \"def person_params\\n # params whitelist does *not* include admin, sub, remember_token\\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\\n # NOTE: do not include 'admin' in this list!\\n params.require(:person).permit(\\n :name, \\n :email, \\n :description,\\n :password, \\n :password_confirmation\\n )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"34d018968dad9fa791c1df1b3aaeccd1\",\n \"score\": \"0.6120522\",\n \"text\": \"def paramunold_params\\n params.require(:paramunold).permit!\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"76d85c76686ef87239ba8207d6d631e4\",\n \"score\": \"0.6106709\",\n \"text\": \"def param_params\\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c8ffd5ef92e817f2779a9c56c9fc0e9\",\n \"score\": \"0.60981655\",\n \"text\": \"def quote_params\\n params.permit!\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2b19f8222e09c2518b0d19b4bf1f69d3\",\n \"score\": \"0.6076113\",\n \"text\": \"def list_params\\n params.permit(:list_name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aabfd0cce84d7f71b1ccd2df6a6af7c3\",\n \"score\": \"0.60534036\",\n \"text\": \"def allowed_params(parameters)\\n parameters.select do |name, values|\\n values.location != \\\"path\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4f20d784611d82c07d49cf1cf0d6cb7e\",\n \"score\": \"0.60410434\",\n \"text\": \"def all_params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5a96718b851794fc3e4409f6270f18fa\",\n \"score\": \"0.6034582\",\n \"text\": \"def permitted_resource_params\\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ff7bc2f09784ed0b4563cfc89b19831d\",\n \"score\": \"0.6029977\",\n \"text\": \"def source_params\\n params.require(:source).permit(all_allowed_params)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6c615e4d8eed17e54fc23adca0027043\",\n \"score\": \"0.6019861\",\n \"text\": \"def user_params\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7402112b5e653d343b91b6d38c203c59\",\n \"score\": \"0.6019158\",\n \"text\": \"def params; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2032edd5ab9475d59be84bdf5595f23a\",\n \"score\": \"0.60184896\",\n \"text\": \"def get_allowed_parameters\\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c59ec134c641678085e086ab2a66a95f\",\n \"score\": \"0.60157263\",\n \"text\": \"def permitted_params\\n @wfd_edit_parameters\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a8faf8deb0b4ac1bcdd8164744985176\",\n \"score\": \"0.6005857\",\n \"text\": \"def user_params\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b98f58d2b73eac4825675c97acd39470\",\n \"score\": \"0.6003803\",\n \"text\": \"def param_whitelist\\n whitelist = [\\n :comment,\\n :old_progress, :new_progress,\\n :metric_id\\n ]\\n \\n unless action_name === 'create'\\n whitelist.delete(:metric_id)\\n end\\n \\n whitelist\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0cb77c561c62c78c958664a36507a7c9\",\n \"score\": \"0.60012573\",\n \"text\": \"def query_param\\n\\t\\tparams.permit(:first_name, :last_name, :phone)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7b7196fbaee9e8777af48e4efcaca764\",\n \"score\": \"0.59955895\",\n \"text\": \"def whitelisted_user_params\\n params.require(:user).\\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be95d72f5776c94cb1a4109682b7b224\",\n \"score\": \"0.5994598\",\n \"text\": \"def filter_params\\n\\t\\treturn params[:candidate].permit(:name_for_filter)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"70fa55746056e81854d70a51e822de66\",\n \"score\": \"0.5993604\",\n \"text\": \"def user_params\\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\\n :user, :color, :solde)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e4c37054b31112a727e3816e94f7be8a\",\n \"score\": \"0.5983824\",\n \"text\": \"def get_params\\n\\t\\t\\n\\t\\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\\n\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e3089e0811fa34ce509d69d488c75306\",\n \"score\": \"0.5983166\",\n \"text\": \"def devise_filter\\r\\n logger.debug(\\\"In devise_filter =>PARAMS: #{params.inspect}\\\")\\r\\n\\r\\n # White list for sign_up\\r\\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\\r\\n\\r\\n # White list for account update\\r\\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\\r\\n\\r\\n # White list for Invitation creation\\r\\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\\r\\n\\r\\n # White list for accept invitation\\r\\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\\r\\n\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2202d6d61570af89552803ad144e1fe7\",\n \"score\": \"0.5977431\",\n \"text\": \"def valid_params(params)\\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d77abbae6d3557081c88dad60c735d0\",\n \"score\": \"0.597591\",\n \"text\": \"def valid_parameters\\n sort_symbols(@interface.allowed_parameters)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"55d8ddbada3cd083b5328c1b41694282\",\n \"score\": \"0.5968824\",\n \"text\": \"def params_permit\\n params.permit(:id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a44360e98883e4787a9591c602282c4b\",\n \"score\": \"0.5965953\",\n \"text\": \"def allowed_params\\n params.require(:allowed).permit(:email)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"45b8b091f448e1e15f62ce90b681e1b4\",\n \"score\": \"0.59647584\",\n \"text\": \"def allowed_params\\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"45b8b091f448e1e15f62ce90b681e1b4\",\n \"score\": \"0.59647584\",\n \"text\": \"def allowed_params\\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4e758c3a3572d7cdd76c8e68fed567e0\",\n \"score\": \"0.59566855\",\n \"text\": \"def filter_params\\n params.permit(*resource_filter_permitted_params)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3154b9c9e3cd7f0b297f900f73df5d83\",\n \"score\": \"0.59506303\",\n \"text\": \"def community_params\\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b48f61fbb31be4114df234fa7b166587\",\n \"score\": \"0.5950375\",\n \"text\": \"def specialty_params\\n\\t\\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c4802950f28649fdaed7f35882118f20\",\n \"score\": \"0.59485626\",\n \"text\": \"def authorize_params\\n super.tap do |params|\\n %w[display scope auth_type].each do |v|\\n if request.params[v]\\n params[v.to_sym] = request.params[v]\\n end\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5d64cb26ce1e82126dd5ec44e905341c\",\n \"score\": \"0.59440875\",\n \"text\": \"def feature_params_filter\\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7fa620eeb32e576da67f175eea6e6fa0\",\n \"score\": \"0.5930872\",\n \"text\": \"def available_activity_params\\n # params.require(:available_activity).permit(:type,:geometry,:properties)\\n whitelisted = ActionController::Parameters.new({\\n type: params.require(:available_activity)[:type],\\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\\n }).try(:permit!)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"da4f66ce4e8c9997953249c3ff03114e\",\n \"score\": \"0.5930206\",\n \"text\": \"def argument_params\\n params.require(:argument).permit(:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f7c6dad942d4865bdd100b495b938f50\",\n \"score\": \"0.5925668\",\n \"text\": \"def user_params_pub\\n\\t \\tparams[:user].permit(:hruid)\\n\\t end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9892d8126849ccccec9c8726d75ff173\",\n \"score\": \"0.59235454\",\n \"text\": \"def strong_params\\n params.require(:success_metric).permit(param_whitelist)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be01bb66d94aef3c355e139205253351\",\n \"score\": \"0.5917905\",\n \"text\": \"def property_params\\n params.permit(:name, :is_available, :is_approved, :owner_id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"631f07548a1913ef9e20ecf7007800e5\",\n \"score\": \"0.59164816\",\n \"text\": \"def restricted_params\\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\\n raise(\\\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d6bf948034a6c8adc660df172dd7ec6e\",\n \"score\": \"0.5913821\",\n \"text\": \"def sponsor_params\\n params.require(:sponsor).permit(WHITE_LIST)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb5b91d56901f0f20f58d574d155c0e6\",\n \"score\": \"0.59128743\",\n \"text\": \"def whitelist_person_params\\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c6a96927a6fdc0d2db944c79d520cd99\",\n \"score\": \"0.5906617\",\n \"text\": \"def parameters\\n nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"822c743e15dd9236d965d12beef67e0c\",\n \"score\": \"0.59053683\",\n \"text\": \"def user_params \\n \\tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a743e25503f1cc85a98a35edce120055\",\n \"score\": \"0.59052664\",\n \"text\": \"def sequence_param_whitelist\\n default_param_whitelist << \\\"show_index\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"533048be574efe2ed1b3c3c83a25d689\",\n \"score\": \"0.5901591\",\n \"text\": \"def resource_filter_permitted_params\\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"02a61b27f286a50802d652930fee6782\",\n \"score\": \"0.58987755\",\n \"text\": \"def normal_params\\n reject{|param, val| param_definitions[param][:internal] }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3683f6af8fc4e6b9de7dc0c83f88b6aa\",\n \"score\": \"0.5897456\",\n \"text\": \"def validate_search_inputs\\n @whitelisted = params.fetch(:user, nil)\\n if @whitelisted.blank?\\n render_error(400, \\\"#{I18n.t('general_error.params_missing_key')}\\\": [I18n.t('general_error.params_missing_value', model: \\\"review\\\")])\\n return\\n else\\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"238705c4afebc0ee201cc51adddec10a\",\n \"score\": \"0.58970183\",\n \"text\": \"def special_device_list_params\\n params.require(:special_device_list).permit(:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d493d59391b220488fdc1f30bd1be261\",\n \"score\": \"0.58942604\",\n \"text\": \"def pull_request_params\\n whitelist = [\\n :url,\\n :id,\\n :html_url,\\n :diff_url,\\n :patch_url,\\n :issue_url,\\n :number,\\n :state,\\n :locked,\\n :title\\n ]\\n params.require(:pull_request).permit(whitelist)\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":173,"cells":{"query_id":{"kind":"string","value":"c0f9bba152146dc911fa4e5ec22661ed"},"query":{"kind":"string","value":"method for passsing in an address that can be added to the google maps url to return the lattitude, longitude, and other locations specific info"},"positive_passages":{"kind":"list like","value":[{"docid":"d56c1fd41eec9ce59a7746581f0e2ea2","score":"0.6730102","text":"def initialize(address)\n\t\t@base_google_maps_url = \"http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=\"\n\t\t@location = address\n\t\t@lat = \"\"\n\t\t@long = \"\"\n\t\t@sublocal = \"\"\n\t\t@state = \"\"\n\t\t@city = \"\"\n\tend","title":""}],"string":"[\n {\n \"docid\": \"d56c1fd41eec9ce59a7746581f0e2ea2\",\n \"score\": \"0.6730102\",\n \"text\": \"def initialize(address)\\n\\t\\t@base_google_maps_url = \\\"http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=\\\"\\n\\t\\t@location = address\\n\\t\\t@lat = \\\"\\\"\\n\\t\\t@long = \\\"\\\"\\n\\t\\t@sublocal = \\\"\\\"\\n\\t\\t@state = \\\"\\\"\\n\\t\\t@city = \\\"\\\"\\n\\tend\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"c0038040497f646be5c745d4443dc548","score":"0.77902496","text":"def gmaps4rails_address\n latlon\n end","title":""},{"docid":"704091273114ce8b9d7c77f00f3503bc","score":"0.7663375","text":"def gmaps4rails_address \n address\n end","title":""},{"docid":"c1a11702fa6e277bb99c59a5da755a46","score":"0.7584305","text":"def get_map_url\n @address = get_address\n @map_url = \"https://maps.googleapis.com/maps/api/staticmap?markers=color:red%7Clabel:C%7C#{@address}&zoom=13&size=300x300&sensor=false\" \n end","title":""},{"docid":"1525036d1312ab5ebaa33ee454f6c27c","score":"0.75815105","text":"def get_geocode_url(address)\n \"http://maps.googleapis.com/maps/api/geocode/json?address=\" +\n address + \"&sensor=true\"\n end","title":""},{"docid":"445d7d0440d1c6f2fe2f8d7b247c4538","score":"0.75494915","text":"def maps_url\n if self.street_address_1 != nil\n \"https://www.google.com/maps/place/\" + \"#{space_for_plus_sub(self.street_address_1)}\" + \"+#{self.city}\" + \"+#{self.state}\" + \"+#{self.zip_code}\"\n end\n end","title":""},{"docid":"f6ae7b47b918cc7ff67b6bf8cefd5395","score":"0.74933994","text":"def google_maps_url\n \"http://maps.google.com/?q=#{address}\"\n end","title":""},{"docid":"162b4f8a85a2aa80dd5ad8170937cc32","score":"0.74297106","text":"def gmaps4rails_address\n return address_str if respond_to? :address_str # Use GeoLocatable if such exists\n \"#{address.street}, #{address.city}, #{address.country}\" \n end","title":""},{"docid":"880c629500471be0285d3e8a72733d47","score":"0.73718023","text":"def gmaps4rails_address\n \"#{self.latitude},#{self.longitude}\"\n end","title":""},{"docid":"4f54821e403ba9f82f6d967c9042900b","score":"0.7368078","text":"def gmaps4rails_address\n \"#{self.address}, #{self.city}, #{self.state}, #{self.zip_code} #{self.country}\"\n end","title":""},{"docid":"6946d9b7bdac37439cfd594639cae8f7","score":"0.73584217","text":"def gmaps4rails_address\n \"#{self.address}, #{self.zip}, #{self.city}, #{self.country}\"\n end","title":""},{"docid":"7bea38d4072fcd7adbed027f2d159f30","score":"0.7356117","text":"def get_lat_long(address=\"160 Folsom st, san francisco, CA\")\n\n url = Addressable::URI.new(\n :scheme => \"http\",\n :host => \"maps.googleapis.com\",\n :path => \"maps/api/geocode/json\",\n :query_values =>\n {:address => address,\n :sensor => \"false\"}\n ).to_s\n\n response = RestClient.get(url)\n json_response = JSON.parse(response)\n lat = json_response[\"results\"][0][\"geometry\"][\"location\"][\"lat\"]\n lng = json_response[\"results\"][0][\"geometry\"][\"location\"][\"lng\"]\n return \"#{lat},#{lng}\"\n end","title":""},{"docid":"1cee4cf3b55dc89224cf1a3e1b01ff0d","score":"0.7343467","text":"def address\n if params.has_key?(:latitude) && params.has_key?(:longitude)\n results = Geocoder.address(\"#{params[:latitude]}, #{params[:longitude]}\")\n if results.nil?\n api_error(404)\n else\n render json: {:address => results }\n end\n else\n api_error(400, {:message => t('geo.no coordinates provided')})\n end\n\n end","title":""},{"docid":"171c52bcd82a29cb26b95b368b8df3c0","score":"0.73333293","text":"def gmaps4rails_address\n \"#{self.latitude}, #{self.longitude}\"\n end","title":""},{"docid":"7ac60f7d2257a50c5bf3a1f82c78c14c","score":"0.732531","text":"def gmaps4rails_address\n\t\t\"#{self.latitude}, #{self.longitude}\"\n\tend","title":""},{"docid":"eb5be472dd68d8bba82817ae907b8ecc","score":"0.7293218","text":"def gmaps4rails_address\n \"#{self.street_address}, #{self.city}\"\n end","title":""},{"docid":"8fcb85fd84a42554e82faa26acd3aaa8","score":"0.72655916","text":"def geocode_address\n return if address.blank?\n results = Geocoder.search(address).first\n\t\tdata = results.data['address']\n\t\taddresses = [[data['road'], data['house_number']].join(' ').strip, data['city'], data['country']].compact.join(', ')\n\t\tself.address = addresses\n self.latitude = results.latitude\n self.longitude = results.longitude\n end","title":""},{"docid":"28b42182666aa546a63b97c1653498cc","score":"0.7253906","text":"def gmaps4rails_address\n \t\t\"#{self.latitude}, #{self.longitude}\"\n \t end","title":""},{"docid":"f7e79b28541dee0fb54401b90e95f694","score":"0.7252364","text":"def get_latlng(address)\r\n \r\n if RAILS_ROOT == 'C://Rails/ssvp'\r\n api_key = \"ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA\"\r\n else\r\n api_key = \"ABQIAAAAKxdghs44-6Zbwux-M2j8PxQM_5f4oJ3bX2DkBRFzPOOnN9rvxhRVhIPXANGZpGerQlbk-Qjqi8TWfQ\";\r\n end\r\n \r\n map_params = {}\r\n map_params[\"q\"] = address.gsub(\" \", \"+\") #format spaces for url\r\n map_params[\"key\"] = api_key\r\n map_params[\"sensor\"] = 'false'\r\n map_params[\"output\"] = 'csv'\r\n \r\n \r\n params = map_params.to_a\r\n param_string = params.collect {|a| a.join(\"=\")}\r\n str = param_string.join(\"&\")\r\n url = \"http://maps.google.com/maps/geo?\"+str\r\n\r\n res = Net::HTTP.get(URI.parse(url))\r\n a = CSV.parse_line(res) #parse csv values to array\r\n status = a[0].to_i\r\n lat = a[2]\r\n lon = a[3]\r\n \r\n if status == 200\r\n response = [lat, lon]\r\n else\r\n response = nil\r\n end\r\nend","title":""},{"docid":"395b0fc394be2c5ebcfca044ad872f51","score":"0.7217606","text":"def get_lat_lon(address)\n begin\n require 'net/http'\n\n @geocode = {}\n uri1 = \"maps.google.com\"\n uri2 = \"/maps/api/geocode/json?address=#{address.gsub(/\\s/,'+')}&sensor=false\"\n json_lat_lon = Net::HTTP.get_response(uri1,uri2)\n @json_lat_lon = ActiveSupport::JSON.decode json_lat_lon.body\n if @json_lat_lon[\"status\"] == \"OK\"\n @geocode[:lat] = @json_lat_lon[\"results\"][0][\"geometry\"][\"location\"][\"lat\"]\n @geocode[:lon] = @json_lat_lon[\"results\"][0][\"geometry\"][\"location\"][\"lng\"]\n end\n rescue\n @geocode = {}\n end\n @geocode\n end","title":""},{"docid":"c85d520a53c32a54e6f472c175e8b892","score":"0.7207109","text":"def get_location_add(start_loc_input)\n uri = URI(\"https://maps.googleapis.com/maps/api/geocode/json?address=#{start_loc_input}&sensor=true&key=#{ENV['GOOGLE_MAPS_API_KEY']}\")\n res = Net::HTTP.get(uri)\n json_result = JSON.parse(res)['results'].first\n\n puts uri\n\n return {:address => json_result['formatted_address'],\n :latitude => json_result['geometry']['location']['lat'],\n :longitude => json_result['geometry']['location']['lng']}\n end","title":""},{"docid":"5d2d594732c72599a64200c8c662419f","score":"0.719576","text":"def geocoded_address\n \"#{address1} #{address2} #{address3} #{address4} #{locality} #{region} #{postal_code} #{country}\"\n end","title":""},{"docid":"eb08c78b1fd1cc81597abf29b19de4b7","score":"0.71871394","text":"def gmaps4rails_address\n #describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki\n \"#{self.latitude}, #{self.longitude}\" \n end","title":""},{"docid":"663a007a6b5bcabcfc2d232193437122","score":"0.7154467","text":"def locate_ll\n geocoded_address = Geokit_service.new().geocode_address(one_line_address)\n if (geocoded_address.success)\n self.latitude = geocoded_address.lat\n self.longitude = geocoded_address.lng\n else \n # The user input some new address that google can't find ... so we don't want to show the old google location\n self.latitude = nil\n self.longitude = nil\n end\n end","title":""},{"docid":"dd6650cc756ec66757f6587f6e7622d3","score":"0.7139285","text":"def generate_geo_url(address)\n call_address = Addressable::URI.new(\n :scheme => \"https\",\n :host => \"maps.googleapis.com\",\n :path => \"maps/api/geocode/json\",\n :query_values => {:address => address,\n :sensor => 'false'}\n ).to_s\nend","title":""},{"docid":"7e47a3af883217542f9abb1e9db9f657","score":"0.7108763","text":"def location_for_gmaps\n self.address\n end","title":""},{"docid":"a74970f60b7a9840bdfcd4025677f231","score":"0.7107051","text":"def gb_address_to_latlng(address)\n encoded_address = CGI.escape(address)\n result = ScraperWiki.scrape(\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\")\n result_doc = Nokogiri::HTML(result)\n unless result_doc.css(\"geoname\").empty? \n return [result_doc.css(\"geoname lat\").inner_text, result_doc.css(\"geoname lng\").inner_text]\n else\n # We seem to get addresses like \"Lowestoft, Suffolk, South East\" and Geonames doesn't like\n # the \"South East\" part, so try removing the last clause\n addr_clauses = address.split(',')\n if addr_clauses.size > 1\n addr_clauses.delete_at(addr_clauses.size-1)\n return gb_address_to_latlng(addr_clauses.join(\", \"))\n else\n return nil\n end\n end\nend","title":""},{"docid":"a74970f60b7a9840bdfcd4025677f231","score":"0.7107051","text":"def gb_address_to_latlng(address)\n encoded_address = CGI.escape(address)\n result = ScraperWiki.scrape(\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\")\n result_doc = Nokogiri::HTML(result)\n unless result_doc.css(\"geoname\").empty? \n return [result_doc.css(\"geoname lat\").inner_text, result_doc.css(\"geoname lng\").inner_text]\n else\n # We seem to get addresses like \"Lowestoft, Suffolk, South East\" and Geonames doesn't like\n # the \"South East\" part, so try removing the last clause\n addr_clauses = address.split(',')\n if addr_clauses.size > 1\n addr_clauses.delete_at(addr_clauses.size-1)\n return gb_address_to_latlng(addr_clauses.join(\", \"))\n else\n return nil\n end\n end\nend","title":""},{"docid":"a74970f60b7a9840bdfcd4025677f231","score":"0.7107051","text":"def gb_address_to_latlng(address)\n encoded_address = CGI.escape(address)\n result = ScraperWiki.scrape(\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\")\n result_doc = Nokogiri::HTML(result)\n unless result_doc.css(\"geoname\").empty? \n return [result_doc.css(\"geoname lat\").inner_text, result_doc.css(\"geoname lng\").inner_text]\n else\n # We seem to get addresses like \"Lowestoft, Suffolk, South East\" and Geonames doesn't like\n # the \"South East\" part, so try removing the last clause\n addr_clauses = address.split(',')\n if addr_clauses.size > 1\n addr_clauses.delete_at(addr_clauses.size-1)\n return gb_address_to_latlng(addr_clauses.join(\", \"))\n else\n return nil\n end\n end\nend","title":""},{"docid":"a74970f60b7a9840bdfcd4025677f231","score":"0.7107051","text":"def gb_address_to_latlng(address)\n encoded_address = CGI.escape(address)\n result = ScraperWiki.scrape(\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\")\n result_doc = Nokogiri::HTML(result)\n unless result_doc.css(\"geoname\").empty? \n return [result_doc.css(\"geoname lat\").inner_text, result_doc.css(\"geoname lng\").inner_text]\n else\n # We seem to get addresses like \"Lowestoft, Suffolk, South East\" and Geonames doesn't like\n # the \"South East\" part, so try removing the last clause\n addr_clauses = address.split(',')\n if addr_clauses.size > 1\n addr_clauses.delete_at(addr_clauses.size-1)\n return gb_address_to_latlng(addr_clauses.join(\", \"))\n else\n return nil\n end\n end\nend","title":""},{"docid":"a74970f60b7a9840bdfcd4025677f231","score":"0.7107051","text":"def gb_address_to_latlng(address)\n encoded_address = CGI.escape(address)\n result = ScraperWiki.scrape(\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\")\n result_doc = Nokogiri::HTML(result)\n unless result_doc.css(\"geoname\").empty? \n return [result_doc.css(\"geoname lat\").inner_text, result_doc.css(\"geoname lng\").inner_text]\n else\n # We seem to get addresses like \"Lowestoft, Suffolk, South East\" and Geonames doesn't like\n # the \"South East\" part, so try removing the last clause\n addr_clauses = address.split(',')\n if addr_clauses.size > 1\n addr_clauses.delete_at(addr_clauses.size-1)\n return gb_address_to_latlng(addr_clauses.join(\", \"))\n else\n return nil\n end\n end\nend","title":""},{"docid":"a74970f60b7a9840bdfcd4025677f231","score":"0.7107051","text":"def gb_address_to_latlng(address)\n encoded_address = CGI.escape(address)\n result = ScraperWiki.scrape(\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\")\n result_doc = Nokogiri::HTML(result)\n unless result_doc.css(\"geoname\").empty? \n return [result_doc.css(\"geoname lat\").inner_text, result_doc.css(\"geoname lng\").inner_text]\n else\n # We seem to get addresses like \"Lowestoft, Suffolk, South East\" and Geonames doesn't like\n # the \"South East\" part, so try removing the last clause\n addr_clauses = address.split(',')\n if addr_clauses.size > 1\n addr_clauses.delete_at(addr_clauses.size-1)\n return gb_address_to_latlng(addr_clauses.join(\", \"))\n else\n return nil\n end\n end\nend","title":""},{"docid":"8acd33a54e24e10cfef0c45c5d25681c","score":"0.70882386","text":"def geocode(address)\n #setup params with\n #address of course\n #bounds; just says we prefer locations in carolina; just in case we had missing info\n #sensor is whether we are using a device with gps; we're not.\n params = {\n :address => address,\n :bounds => \"32.1,-83.5|35.3,-78.5\",\n :sensor => \"false\"\n }.to_param\n #make the call and parse it\n result = request(\"#{geocode_url}?#{params}\", \"{}\")\n result = JSON.parse(result) rescue {}\n\n if result[\"status\"] == \"OK\" and result[\"results\"].size == 1\n target = result[\"results\"][0][\"geometry\"][\"location\"]\n [target[\"lat\"], target[\"lng\"]]\n else\n [nil,nil]\n end\n end","title":""},{"docid":"030b2a0b9c875353b079eb74cb945303","score":"0.70810276","text":"def gmaps4rails_address\n [line1, city, state, zipcode].compact.join(', ')\n end","title":""},{"docid":"030b2a0b9c875353b079eb74cb945303","score":"0.70810276","text":"def gmaps4rails_address\n [line1, city, state, zipcode].compact.join(', ')\n end","title":""},{"docid":"dbbf3bd5c02b6808e370724a5272f66b","score":"0.7065485","text":"def get_lat_and_long(address)\n info = Geocoder.search(\"#{address}\")\n @latitude = info[0].latitude\n @longitude = info[0].longitude\n \n return @latitude, @longitude\n end","title":""},{"docid":"137eef7ddf1a7fa95f59ea3dd166b894","score":"0.7036503","text":"def my_location\n\t\t\"#{address}, #{city}, GA\"\n\tend","title":""},{"docid":"137eef7ddf1a7fa95f59ea3dd166b894","score":"0.7036503","text":"def my_location\n\t\t\"#{address}, #{city}, GA\"\n\tend","title":""},{"docid":"0bd76ad446eab151a181d690e1c9d839","score":"0.703174","text":"def lat_lon(address)\n # Escape any non_ASCII characters and convert the string into a URI object.\n encoded_url = URI.escape(\n 'https://maps.googleapis.com/maps/api/geocode/json?address=' + address\n )\n url = URI.parse((encoded_url))\n\n # Make the request to retrieve the JSON string\n response = open(url).read\n\n # Convert the JSON string into a Hash object\n result = JSON.parse(response)\n\n # Extract the latitude and longitude and return them\n lat = result['results'][0]['geometry']['location']['lat']\n lon = result['results'][0]['geometry']['location']['lng']\n return lat, lon\n end","title":""},{"docid":"c02fc0a4f95aa7697b1749cd82ccb78b","score":"0.7003587","text":"def get_coordinates_for(address)\n\tbase_google_url = \"http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=\"\n\tresult = RestClient.get(URI.encode(\"#{base_google_url}#{address}\"))\n\tparsed_result = Crack::XML.parse(result)\n\tlat = parsed_result[\"GeocodeResponse\"][\"result\"][\"geometry\"][\"location\"][\"lat\"]\n\tlng = parsed_result[\"GeocodeResponse\"][\"result\"][\"geometry\"][\"location\"][\"lng\"]\n\treturn \"#{lat},#{lng}\"\nend","title":""},{"docid":"fde58aeac510fff857ac0eed7f466de8","score":"0.7003315","text":"def point_info lat:, long:\n request({\n http_method: :get,\n params: {geocode: \"#{lat},#{long}\"}\n })\n end","title":""},{"docid":"22e95f1fa1c8ec82af11556e318e3bef","score":"0.6999178","text":"def user_location(address)\n Geocoder.coordinates(address)\n end","title":""},{"docid":"cc526707a91e808170fd9f0a4e75f958","score":"0.69817257","text":"def url\n if value['latitude'].present? and value['longitude'].present?\n if value['type'] == MAP_TYPE_GOOGLE\n sprintf(\n 'http://maps.google.com/maps?%s&t=m&q=%s+%s',\n value['zoom'].present? ? 'z=' + value['zoom'] : '',\n value['latitude'],\n value['longitude']\n )\n else # yandex\n sprintf(\n 'http://maps.yandex.ru/?l=map&text=%s&ll=%s%s',\n [value['latitude'], value['longitude']].join(','),\n [value['longitude'], value['latitude']].join(','),\n value['zoom'].present? ? '&z=' + value['zoom'] : nil\n )\n end\n end\n end","title":""},{"docid":"f2bbaa3a531b9f734607184f151a9188","score":"0.6976226","text":"def gmaps4rails_address\r\n#describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki\r\n \"#{self.street}, #{self.city}, #{self.country}\"\r\n end","title":""},{"docid":"2e94b750cff4ee44771186c8663bdad5","score":"0.6947842","text":"def geo_address\n \"#{street1}#{street2}, #{city}, #{province}, CA, #{postal_code}\".gsub(/&/, 'and')+\"&components=country:CA\" \n end","title":""},{"docid":"03df202f8f48dbde27fc6ca51be72d03","score":"0.694499","text":"def current_location(address)\n current_location_url = Addressable::URI.new(\n :scheme => \"https\",\n :host => \"maps.googleapis.com\",\n :path => \"maps/api/geocode/json\",\n :query_values => {\n :address => address,\n :sensor => \"false\"}\n ).to_s\n\n response = RestClient.get(current_location_url)\n results = JSON.parse(response)\n results[\"results\"][0][\"geometry\"][\"location\"]\nend","title":""},{"docid":"e8c9ac7e14e632fb4dce14eefea83391","score":"0.6910859","text":"def address_to_geocode\n @address_to_geocode ||= [\n @record.has_key?('permit_address') ? @record['permit_address'] : [@record['streetname'], @record['cross_street_1']].join(' and '),\n \", San Francisco, CA\"\n ].join\n end","title":""},{"docid":"eb18505624304a6bfd38ad8b6cf6e90b","score":"0.6898959","text":"def geocode_address\n geo=Geokit::Geocoders::MultiGeocoder.geocode(self.address_string)\n errors.add(:address, \"Could not Geocode address\") if !geo.success\n self.lat, self.lng = geo.lat,geo.lng if geo.success\n end","title":""},{"docid":"9b415ae093a29d1d3fa18b4c2a055429","score":"0.68866426","text":"def to_google_maps_address\n [line1, line2, line3, \"#{zip} #{place}\"].compact.delete_if{|v| v.strip.blank?}.join(\", \")\n end","title":""},{"docid":"a6641f0c5f13e1b16b5de0c99a40b021","score":"0.6867109","text":"def geocoder_address\n begin\n return self.field_value( :property_address ) + ', ' + self.field_value( :zip_code )\n # return \"1800 Nelson Ranch Road, 78613\"\n rescue\n return nil\n end\n end","title":""},{"docid":"df2c7af59a053facfe483ee185993a50","score":"0.68638694","text":"def locate(address)\n get :geocode => address.is_a?(String) ? address : location_from_params(address).to_s\n end","title":""},{"docid":"b3cab9fc880c2b7f012cf16d45534fba","score":"0.6855277","text":"def my_location\n\t\"#{address}, #{city}, GA\"\nend","title":""},{"docid":"03b55cb778bf29aec1f5c319c72cc62e","score":"0.68521845","text":"def geocode_address\n if lat.blank? || lng.blank?\n geo = Geokit::Geocoders::MultiGeocoder.geocode(self.address_string)\n if geo.success\n self.lat, self.lng = geo.lat, geo.lng\n else\n puts geo.class\n errors.add(:lat, \"Could not Geocode address\")\n logger.debug \"Could not Geocode #{self.address_string}\"\n end\n end\n end","title":""},{"docid":"534464c3792900f56d2d636dbbd6dd3b","score":"0.68518466","text":"def gmaps_info\n {\n title: name,\n address: location.address\n }\n end","title":""},{"docid":"08ffd70c8249eee4fc55529f1ee6f6da","score":"0.68355703","text":"def get_coords(address)\n coords = Geocoder.search(address)\n if coords.length === 0 \n coords = Geocoder.search(self.name)\n end\n debugger\n self.lat ||= coords.first.coordinates[0]\n self.lng ||= coords.first.coordinates[1]\n end","title":""},{"docid":"b3ac2dc0d2fedad10792011abb1c8d6c","score":"0.6823246","text":"def call_google_api_for_location(address)\n url = \"https://maps.googleapis.com/maps/api/geocode/json?address=#{\n address}&key=#{ENV['GOOGLE_API_KEY']}\"\n response = HTTParty.get url\n response.body\n end","title":""},{"docid":"5f3d91ff6dc31aabe81391d510ab7c33","score":"0.6821508","text":"def geocode_address\n geo = Geokit::Geocoders::MultiGeocoder.geocode(self.address_string)\n if geo.success\n self.lat, self.lng = geo.lat, geo.lng\n else\n puts geo.class\n errors.add(:address, \"Could not Geocode address\")\n end\n end","title":""},{"docid":"169301ecb99f2c6b39f400529617d1d6","score":"0.6817495","text":"def coordinates_url latitude, longitude\n \"https://www.google.com/maps/search/?api=1&query=#{latitude}%2C#{longitude}\"\n end","title":""},{"docid":"6624d507a1cc16309992501db8557254","score":"0.6803278","text":"def get_address_by_loc(lat, lng, ak = DefaultAK, http = HTTP)\n params = {:location => \"#{lat},#{lng}\"}.merge({:output => \"json\", :ak => ak})\n address = {}.merge(DefaultAddress)\n begin\n res = http.get(ApiUrl, :params => params).flush\n\n if res.code == 200\n json = JSON.parse(res.body)\n if \"0\".eql?(json[\"status\"].to_s) && json[\"result\"] && !json[\"result\"].empty? \\\n && json[\"result\"][\"addressComponent\"] && !json[\"result\"][\"addressComponent\"].empty? \\\n && json[\"result\"][\"formatted_address\"] && !json[\"result\"][\"formatted_address\"].empty?\n address[:formatted_address] = json[\"result\"][\"formatted_address\"]\n address[:province] = json[\"result\"][\"addressComponent\"][\"province\"]\n address[:city] = json[\"result\"][\"addressComponent\"][\"city\"]\n address[:district] = json[\"result\"][\"addressComponent\"][\"district\"]\n address[:status] = true\n end\n end\n rescue Exception => e\n puts \"Exception => #{e}\"\n end\n\n address\n end","title":""},{"docid":"a32aabc2e0ed46333474b48e55f16096","score":"0.68016464","text":"def gmaps4rails_gmaps\r\n#describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki\r\n \"#{self.longitude}, #{self.latitude}\" \r\n gmaps\r\nend","title":""},{"docid":"07a5de086fbc0f1f358ec6c902deed85","score":"0.68004996","text":"def address(location, address_new)\n if location.present?\n Geocoder.address(location)\n else\n address_new\n end\n end","title":""},{"docid":"f34eac8cbf309fab096658ea9f1ff7bd","score":"0.6755362","text":"def geocode_from(address)\n geocodes = {\n latitude: nil,\n longitude: nil\n }\n encoded_address = URI.encode(address)\n url = request_url(encoded_address)\n uri = URI.parse(url)\n\n begin\n response = Net::HTTP.get_response(uri)\n # check response code\n case response\n when Net::HTTPSuccess then\n # 200 OK\n data = JSON.parse(response.body)\n latitude, longitude = get_coordinates(data)\n geocodes[:latitude] = latitude\n geocodes[:longitude] = longitude\n else\n puts [uri.to_s, response.value].join(\" : \")\n end\n rescue => e\n puts [uri.to_s, e.class, e].join(\" : \")\n end\n\n geocodes\n end","title":""},{"docid":"d69b1a2fc956428af6f7cbc526bf0e24","score":"0.6754276","text":"def address\n @api_key,@standard_address_line1,@standard_address_location = \"\",\"\",\"\"\n if request.post?\n @error = \"\"\n @search_for = \"location\"\n @api_key = params[:api_key]\n @standard_address_line1 = params[:address_street_line_1]\n @standard_address_location = params[:address_city]\n unless params[:api_key].blank?\n unless params[:address_street_line_1].blank?\n unless params[:address_city].blank?\n encrypt(@api_key)\n wp_obj = WhitePagesApi.new(@api_key)\n wp_obj.street_line_1 = @standard_address_line1\n wp_obj.city = @standard_address_location\n @graph_url = wp_obj.get_location_url\n else\n @error = \"please enter city and state or Zip.\"\n end\n else\n @error = \"please enter street address or name.\"\n end\n else\n @error = \"please enter your api key.\"\n end\n end\n end","title":""},{"docid":"e64318d5f308f5e6373511d61a59927c","score":"0.6748105","text":"def full_address\n addr = String.new\n addr << \"#{street1}\"\n # yes, handling commas was a pain - I tried about 10 other ways before settling on this.\n # Fortunately, google maps is insanely smart and can take just about anything.\n # But this is also used by the RSS reader, so it needs to work well.\n addr << (addr == \"\" ? \"#{street2}\" : \", #{street2}\")\n addr << (addr == \"\" ? \"#{city}\" : \", #{city}\")\n addr << (addr == \"\" ? \"#{state}\" : \", #{state}\")\n addr << (addr == \"\" ? \"#{zip}\" : \" #{zip}\")\n return addr\n end","title":""},{"docid":"d8cafd46d6db7b353445248d2ebd1851","score":"0.67471933","text":"def location(query)\n query = URI.encode query\n key = load_service[\"google\"][\"api_key\"]\n request_url = \"https://maps.googleapis.com/maps/api/place/textsearch/json?query=#{query}&key=#{key}&sensor=true\"\n url = URI.parse(request_url)\n\t response = Net::HTTP.start(url.host, url.port,:use_ssl => url.scheme == 'https') do |http|\n\t\t\t\thttp.request(Net::HTTP::Get.new(request_url)) \n\t\t\tend\n\t\t\tdata = JSON.parse(response.body)[\"results\"][0]\n\t\t\t{\n\t\t\t :address => data[\"formatted_address\"],\n\t\t\t :lat => data[\"geometry\"][\"location\"][\"lat\"],\n\t\t\t :lng => data[\"geometry\"][\"location\"][\"lng\"]\n\t\t\t}\n end","title":""},{"docid":"2a2238832aae0b7538dba6ed29a89e4f","score":"0.67467","text":"def get_address(url)\n url = URI.decode(url)\n loc = url.split('loc:+')\n return nil if loc.length == 1\n loc_str = loc[1]\n loc_str.split('+').join(' ')\n end","title":""},{"docid":"0bc8440224e4f15880b52dd5db23b2be","score":"0.6746519","text":"def geocode_address\n if lat.nil? || lng.nil?\n geo = Geokit::Geocoders::MultiGeocoder.geocode(\"#{name}, #{country}\")\n # errors.add(:address, \"Could not Geocode address\") if !geo.success\n self.lat, self.lng = 0, 0 if !geo.success\n self.lat, self.lng = geo.lat, geo.lng if geo.success\n end\n end","title":""},{"docid":"afe1923b36d0ff47392a0ee2e29b6482","score":"0.671638","text":"def full_address\n address + \", \" + location + \" \" + postcode.to_s\n end","title":""},{"docid":"513ccf3d8b59fe112b91d176499705dc","score":"0.6714417","text":"def latlong_to_address\n\n\t\tif (self.lat)\n\t\t\taddress = Geocoder.address([self.lat,self.long])\n\t\t\tif address\n\t\t\t\t# sample address is \n\t\t\t\t# \"769 Lasalle St, New Orleans, LA 70113, USA\" \n\t\t\t\t# \n\t\t\t\tfields = address.split ','\n\t\t\t\tif fields.length == 4\n\t\t\t\t\t# need to split up the state and zip, at index 2\n\t\t\t\t\tstatezip = fields[2].split \" \"\n\n\t\t\t\t\tself.street1 = fields[0]\n\t\t\t\t\tself.city = fields[1]\n\n\t\t\t\t\tself.state = statezip[0]\n\t\t\t\t\tself.zip = statezip[1]\n\t\t\t\telse\n\t\t\t\t\tflash[:notice] = \"Please set the Notwa address to #{address}\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend","title":""},{"docid":"777f371437441a62a70515169f795271","score":"0.6706577","text":"def location\n \"https://maps.google.com/?q=\" + CGI.escape(coordinates)\n end","title":""},{"docid":"c7f4c12d67a8b8be6ecb36158ef08f09","score":"0.66903543","text":"def reverse latitude, longitude\n return nil if LocationInterface.config[\"google\"][\"geocode\"][\"api_key\"].nil? or LocationInterface.config[\"google\"][\"geocode\"][\"api_key\"].empty?\n api_key = LocationInterface.config[\"google\"][\"geocode\"][\"api_key\"]\n url = \"https://maps.googleapis.com/maps/api/geocode/json?latlng=#{latitude},#{longitude}&key=#{api_key}\"\n\n response = HTTParty.get url\n data = JSON.parse response.body\n if not data[\"status\"] == \"OK\"\n Airbrake.notify(Notice.new(\"Invalid response from Google’s reverse api with url\")) do |notice|\n notice[:params][:latitude] = latitude\n notice[:params][:longitude] = longitude\n notice[:params][:url] = url\n notice[:context][:severity] = \"warning\"\n end\n return nil\n end\n\n components = data[\"results\"][0][\"address_components\"]\n street_address = nil\n street_number = nil\n city = nil\n postal_code = nil\n\n components.each do |component|\n street_number = component[\"long_name\"] if component[\"types\"].include? \"street_number\"\n street_address = component[\"long_name\"] if component[\"types\"].include? \"route\"\n postal_code = component[\"long_name\"] if component[\"types\"].include? \"postal_code\"\n city = component[\"long_name\"] if component[\"types\"].include? \"administrative_area_level_3\"\n city = component[\"long_name\"] if component[\"types\"].include? \"locality\"\n end\n\n {\n \"address\" => \"#{street_address} #{street_number}\",\n \"city\" => city,\n \"postal_code\" => postal_code\n }\n end","title":""},{"docid":"ea132cf7e357b7ddc8f4685baed6387b","score":"0.66900057","text":"def gmaps4rails_address\n\t\t#describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki\n \t\t\"#{self.address}\"\n\tend","title":""},{"docid":"1c95caa143c146261a8fd707ad32bcb1","score":"0.6686067","text":"def get_location \n marker = Geocoding::get(zipcode, :key => GoogleMapper.api_key) \n if marker.size > 0 \n marker = marker.first\n self.longitude = marker.longitude\n self.latitude = marker.latitude \n [latitude, longitude] \n elsif marker.status.to_s == '620' \n nil\n end \n \n end","title":""},{"docid":"4985b303cf8ca44f9c7304f2745ae797","score":"0.6681396","text":"def map_address\n map_address = [self.country.to_s, self.city.to_s, self.locality.to_s]\n map_address.join(\",\")\n end","title":""},{"docid":"4985b303cf8ca44f9c7304f2745ae797","score":"0.6681396","text":"def map_address\n map_address = [self.country.to_s, self.city.to_s, self.locality.to_s]\n map_address.join(\",\")\n end","title":""},{"docid":"19e22f25687c948c721f2448e0a7b535","score":"0.66673964","text":"def geodecode(address)\n begin\n url = get_geocode_url(address)\n response = RestClient.get url\n json = JSON.parse(response)\n location = json['results'][0]['geometry']['location']\n return \"#{location['lat']}, #{location['lng']}\"\n rescue\n return nil\n end\n end","title":""},{"docid":"a745695c9e751ec39faba17a6688d803","score":"0.66652066","text":"def geo_to_address(longitude, latitude)\n # uri = URI('http://api.map.baidu.com/geocoder/v2/')\n # params = {\n # ak: '8HC4SzAudccqEF0Qj0bs8Bb4',\n # coordtype: 'wgs84ll',\n # location: env.params['x'] + ',' + env.params['y'],\n # output: 'json'\n # }\n # THIS API GOT 101 ERROR\n # TODO using this API maybe?\n\n api_url = 'http://api.map.baidu.com/geocoder'\n api_params = {\n coordtype: 'wgs84ll',\n location: latitude + ',' + longitude, # WARNING: fuxxing baidu use (lat, lon) instead of (lon, lat)\n output: 'json',\n src: 'OakStaffStudio|SaveYourSelf'\n }\n (MultiJson.load (EM::HttpRequest.new(api_url).get :query => api_params).response)['result']['addressComponent']\n end","title":""},{"docid":"77de5fce7048ce62fd8f2c99aa23f682","score":"0.6661327","text":"def coordinates_to_address(lat, long)\n Geocoder.address([lat, long])\n end","title":""},{"docid":"4777dc85ea480a289f348339c72d68df","score":"0.6655467","text":"def get_location_coordinates\n str = self.street_1\n zip = self.zip_code\n \n coord = Geocoder.coordinates(\"#{str}, #{zip}\")\n if coord\n self.latitude = coord[0]\n self.longitude = coord[1]\n else \n errors.add(:base, \"Error with geocoding\")\n end\n coord\n end","title":""},{"docid":"a014c2feb5aeb1a2a977589b54c7dc1c","score":"0.6653575","text":"def get_lat_long(location)\n Geokit::Geocoders::GoogleGeocoder.geocode \"#{location}\"\nend","title":""},{"docid":"f73a8854b1a74b71b9b34ea5a9116297","score":"0.66518307","text":"def user_address(lat=0,lng=0)\n\t\tif (lat==0 || lng==0) && (request.location.latitude != 0 && request.location.longitude != 0)\n\t\t\tlat = request.location.latitude\n\t\t\tlng = request.location.longitude\n\t\telse\n\t\t\tlat = 37.7691\n\t\t\tlng = -122.4449\n\t\tend\n\t\tGeocoder.address([lat, lng])\n\tend","title":""},{"docid":"bcd07223c7ce0aa89cd04b21c782502f","score":"0.66447586","text":"def generate_places_url(coordinates)\n call_address = Addressable::URI.new(\n :scheme => \"https\",\n :host => \"maps.googleapis.com\",\n :path => \"maps/api/place/nearbysearch/json\",\n :query_values => {\n :location => coordinates,\n :rankby => \"distance\",\n :types => \"food\",\n :keyword => \"ice cream\",\n :sensor => 'false',\n :key => \"AIzaSyD2JOxpVx-nJo8W4k1IaZj--D2XtECZ7Ng\"}\n ).to_s\nend","title":""},{"docid":"5b08687bd3c4e3c6da6db6a5972fbbba","score":"0.6639852","text":"def append_street_address_lat_lng(yelpResults)\n yelpResults[\"businesses\"].each_index do |i|\n addr1 = yelpResults[\"businesses\"][i][\"location\"][\"display_address\"][0]\n city = yelpResults[\"businesses\"][i][\"location\"][\"city\"]\n stateCode = yelpResults[\"businesses\"][i][\"location\"][\"state\"]\n countryCode = yelpResults[\"businesses\"][i][\"location\"][\"country\"]\n if (addr1 && city && stateCode && countryCode)\n singleLineAddress = addr1 + \", \" + city + \", \" + stateCode + \", \" + countryCode\n address = singleLineAddress\n if address\n address = address.gsub(\" \", \"%20\")\n end\n addressLatLng = get_geo_json(address)\n logger.info(addressLatLng)\n yelpResults[\"businesses\"][i][\"location\"][\"geocoding\"] = addressLatLng\n else\n latLng = {\"lng\" => 0,\"lat\" => 0}\n latLng[\"_id\"] = address\n yelpResults[\"businesses\"][i][\"location\"][\"geocoding\"] = latLng\n end\n end\n return yelpResults.to_json\n end","title":""},{"docid":"f85b1234319a4bde6901735daef73a2f","score":"0.6635824","text":"def geocode\n geo = Geokit::Geocoders::MultiGeocoder.geocode address.gsub(/\\n/, ', ')\n if geo.success\n self.lat, self.lng = geo.lat, geo.lng\n else\n errors.add(:address, 'Problem locating address')\n end\n end","title":""},{"docid":"6aedef4987d9dad30dafcef67472cd3b","score":"0.66115594","text":"def geocode_address\n return unless street_changed? || city_changed? || country_changed? || locality_changed? || state_changed?\n coords = Geocoder.coordinates(self.street.to_s+\",\"+self.locality.to_s+','+self.city.to_s+','+self.country.to_s)\n if coords.kind_of?(Array)\n self.latitude = coords[0];\n self.longitude = coords[1];\n end\n end","title":""},{"docid":"15bed2734704e7e64e4466933d6130b9","score":"0.6609754","text":"def address(latitude, longitude)\n if (results = search(latitude, longitude)).size > 0\n results.first.address\n end\n end","title":""},{"docid":"78ad79b7f340bb758ed44b98f432027d","score":"0.6607991","text":"def nearby_address(lat, lng, options = {})\n perform_get(\"/nearby/address/#{lat},#{lng}.json\", :query => options)\n end","title":""},{"docid":"9a1e2efd81ca5c02d31ab6289c51722c","score":"0.6593421","text":"def geocode_address(street, city, state, country, log=true)\n\t\t\taddress = \"#{street}, #{city}, #{state}, #{country}\"\n\n\t\t\tputs \" Attempting to geocode: #{address}\" if log\n\n\t\t\tresp = RestClient.get(GMAPS_GEOCODE_BASE, {\n\t\t\t\t:params => {\n\t\t\t\t\t:address => address,\n\t\t\t\t\t:sensor => false,\n\t\t\t\t\t:components => \"locality:#{city}|administrative_area:#{state}\"\n\t\t\t\t},\n\t\t\t\t:content_type => :json,\n\t\t\t\t:accept => :json\n\t\t\t})\n\n\t\t\tparsed = JSON.parse(resp)\n\n\t\t\tif parsed[\"results\"] && parsed[\"results\"].length >= 1\n\t\t\t\tputs \" Geocoded successfully.\" if log\n\n\t\t\t\tinfo = {\n\t\t\t\t\t\"formatted_address\" => parsed[\"results\"][0][\"formatted_address\"]\n\t\t\t\t}\n\n\t\t\t\tparsed[\"results\"][0][\"address_components\"].each do |component|\n\t\t\t\t\tif component[\"types\"].include?(\"street_number\")\n\t\t\t\t\t\tinfo[\"street_number\"] = component[\"long_name\"]\n\t\t\t\t\tend\n\n\t\t\t\t\tif component[\"types\"].include?(\"route\")\n\t\t\t\t\t\tinfo[\"street\"] = component[\"short_name\"]\n\t\t\t\t\tend\n\n\t\t\t\t\tif component[\"types\"].include?(\"neighborhood\")\n\t\t\t\t\t\tinfo[\"neighborhood\"] = component[\"long_name\"]\n\t\t\t\t\tend\n\n\t\t\t\t\tif component[\"types\"].include?(\"locality\")\n\t\t\t\t\t\tinfo[\"locality\"] = component[\"long_name\"]\n\t\t\t\t\tend\n\n\t\t\t\t\tif component[\"types\"].include?(\"administrative_area_level_2\") # US county\n\t\t\t\t\t\tinfo[\"county\"] = component[\"long_name\"]\n\t\t\t\t\tend\n\n\t\t\t\t\tif component[\"types\"].include?(\"administrative_area_level_1\") # US state\n\t\t\t\t\t\tinfo[\"region\"] = component[\"long_name\"]\n\t\t\t\t\t\tinfo[\"region_abbreviation\"] = component[\"short_name\"]\n\t\t\t\t\tend\n\n\t\t\t\t\tif component[\"types\"].include?(\"country\")\n\t\t\t\t\t\tinfo[\"country\"] = component[\"long_name\"]\n\t\t\t\t\t\tinfo[\"country_abbreviation\"] = component[\"short_name\"]\n\t\t\t\t\tend\n\n\t\t\t\t\tif component[\"types\"].include?(\"postal_code\")\n\t\t\t\t\t\tinfo[\"postal_code\"] = component[\"long_name\"]\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tinfo[\"address\"] = \"#{info[\"street_number\"]} #{info[\"street\"]}\".strip\n\n\t\t\t\treturn info\n\t\t\tend\n\n\t\t\treturn nil\n\t\tend","title":""},{"docid":"59a354c9b6da36060f8f0be5ce730e50","score":"0.6581458","text":"def address\n return street + \" \" + house_number + \" \" + postal_code + \" \" + city + \" Denmark\"\n end","title":""},{"docid":"74e94840e529f4763c2bdbd7a55215d1","score":"0.658104","text":"def area_address\n address=GoogleGeocoder.reverse_geocode([self.latitude,self.longitude])\n address.full_address\n end","title":""},{"docid":"74e94840e529f4763c2bdbd7a55215d1","score":"0.658104","text":"def area_address\n address=GoogleGeocoder.reverse_geocode([self.latitude,self.longitude])\n address.full_address\n end","title":""},{"docid":"d7e419cfb538f71b295d9e5f160672a6","score":"0.6570134","text":"def address_search\n coords = []\n if params[:address].present?\n\t\t begin\n\t\t\t locations = Geocoder.search(\"#{params[:address]}\")\n if locations.present?\n locations.each do |l|\n x = Hash.new\n x[:coordinates] = l.coordinates\n x[:address] = l.address\n coords << x\n end\n end\n\t\t rescue\n\t\t\t coords = []\n\t\t end\n elsif params[:lat].present? && params[:lon].present?\n\t\t begin\n\t\t\t locations = Geocoder.search(\"#{params[:lat]}, #{params[:lon]}\")\n if locations.present?\n locations.each do |l|\n x = Hash.new\n x[:coordinates] = l.coordinates\n x[:address] = l.address\n coords << x\n end\n end\n\t\t rescue\n\t\t\t coords = []\n\t\t end\n end\n\n respond_to do |format|\n format.json { render json: coords.to_json }\n end\n end","title":""},{"docid":"92830a7f68507c448f3ef7899cba5e63","score":"0.65641195","text":"def get_address\n address = \"\"\n address = address + @json_stock[\"summaryProfile\"][\"address1\"]\n address = address + \", \" + @json_stock[\"summaryProfile\"][\"city\"]\n address = address + \", \" + @json_stock[\"summaryProfile\"][\"state\"]\n address = address + \" \" + @json_stock[\"summaryProfile\"][\"zip\"]\n @address = address\n @address\n end","title":""},{"docid":"36b7a7274b5b871f519b7d062e13f9ce","score":"0.6559262","text":"def getGeocode loc_string\n Geokit::Geocoders::GoogleGeocoder.api_key = Rails.application.secrets.GOOGLE_MAPS_API_KEY\n req = Geokit::Geocoders::GoogleGeocoder.geocode(loc_string)\n return req.ll\n end","title":""},{"docid":"ae14905e5c9dcfc39e27fec1b73870fa","score":"0.65507144","text":"def get_lat_lng_from_address(address)\n if address\n ll = Geocoder.coordinates(address)\n @latitude = ll[0]\n @longitude = ll[1]\n end\n end","title":""},{"docid":"eebdcd4456b15b96c1cc6238571bf24a","score":"0.6550491","text":"def google_map_url\n # \"https://www.google.com/maps/place/@#{object.latitude},#{object.longitude},9z\"\n \"https://www.google.com/maps/place/#{object.latitude},#{object.longitude}/@#{object.latitude},#{object.longitude},15z/\"\n end","title":""},{"docid":"a1c27cb0a180a8bfcaa36ae763e99f6b","score":"0.6549662","text":"def geocode_address\n full_address or address\n end","title":""},{"docid":"a1c27cb0a180a8bfcaa36ae763e99f6b","score":"0.6549662","text":"def geocode_address\n full_address or address\n end","title":""},{"docid":"eb0afd3ff970c25d229faaaf3c6370fb","score":"0.6547305","text":"def get_lat_lng(user_address)\n GeocodingService.new(address: params[:user_address]).lat_lng\n end","title":""},{"docid":"3be5225ee9979adac56d9868dd0e2e9a","score":"0.65439254","text":"def address_for_geocoding_and_mapping\n\n city_state = self.city\n if (self.state_id)\n city_state += \", \" + self.state.name\n end\n # We can build a 'full address' string, it will be used in a few\n # places below\n full_address = city_state\n if (!self.address2.blank?)\n full_address = self.address2 + \", \" + full_address\n end\n if (!self.address1.blank?)\n full_address = self.address1 + \", \" + full_address\n end\n if (!self.country_id.blank?)\n full_address += \", \" + self.country.name\n end\n\n return full_address\n\n end","title":""},{"docid":"9f6f7c5af150b786bacfff2fd7e64717","score":"0.6538885","text":"def street_address\n \"#{addr_1}, #{addr_2}, #{addr_city}, #{addr_state} #{addr_code} #{addr_country}\"\n end","title":""}],"string":"[\n {\n \"docid\": \"c0038040497f646be5c745d4443dc548\",\n \"score\": \"0.77902496\",\n \"text\": \"def gmaps4rails_address\\n latlon\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"704091273114ce8b9d7c77f00f3503bc\",\n \"score\": \"0.7663375\",\n \"text\": \"def gmaps4rails_address \\n address\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c1a11702fa6e277bb99c59a5da755a46\",\n \"score\": \"0.7584305\",\n \"text\": \"def get_map_url\\n @address = get_address\\n @map_url = \\\"https://maps.googleapis.com/maps/api/staticmap?markers=color:red%7Clabel:C%7C#{@address}&zoom=13&size=300x300&sensor=false\\\" \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1525036d1312ab5ebaa33ee454f6c27c\",\n \"score\": \"0.75815105\",\n \"text\": \"def get_geocode_url(address)\\n \\\"http://maps.googleapis.com/maps/api/geocode/json?address=\\\" +\\n address + \\\"&sensor=true\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"445d7d0440d1c6f2fe2f8d7b247c4538\",\n \"score\": \"0.75494915\",\n \"text\": \"def maps_url\\n if self.street_address_1 != nil\\n \\\"https://www.google.com/maps/place/\\\" + \\\"#{space_for_plus_sub(self.street_address_1)}\\\" + \\\"+#{self.city}\\\" + \\\"+#{self.state}\\\" + \\\"+#{self.zip_code}\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f6ae7b47b918cc7ff67b6bf8cefd5395\",\n \"score\": \"0.74933994\",\n \"text\": \"def google_maps_url\\n \\\"http://maps.google.com/?q=#{address}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"162b4f8a85a2aa80dd5ad8170937cc32\",\n \"score\": \"0.74297106\",\n \"text\": \"def gmaps4rails_address\\n return address_str if respond_to? :address_str # Use GeoLocatable if such exists\\n \\\"#{address.street}, #{address.city}, #{address.country}\\\" \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"880c629500471be0285d3e8a72733d47\",\n \"score\": \"0.73718023\",\n \"text\": \"def gmaps4rails_address\\n \\\"#{self.latitude},#{self.longitude}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4f54821e403ba9f82f6d967c9042900b\",\n \"score\": \"0.7368078\",\n \"text\": \"def gmaps4rails_address\\n \\\"#{self.address}, #{self.city}, #{self.state}, #{self.zip_code} #{self.country}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6946d9b7bdac37439cfd594639cae8f7\",\n \"score\": \"0.73584217\",\n \"text\": \"def gmaps4rails_address\\n \\\"#{self.address}, #{self.zip}, #{self.city}, #{self.country}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7bea38d4072fcd7adbed027f2d159f30\",\n \"score\": \"0.7356117\",\n \"text\": \"def get_lat_long(address=\\\"160 Folsom st, san francisco, CA\\\")\\n\\n url = Addressable::URI.new(\\n :scheme => \\\"http\\\",\\n :host => \\\"maps.googleapis.com\\\",\\n :path => \\\"maps/api/geocode/json\\\",\\n :query_values =>\\n {:address => address,\\n :sensor => \\\"false\\\"}\\n ).to_s\\n\\n response = RestClient.get(url)\\n json_response = JSON.parse(response)\\n lat = json_response[\\\"results\\\"][0][\\\"geometry\\\"][\\\"location\\\"][\\\"lat\\\"]\\n lng = json_response[\\\"results\\\"][0][\\\"geometry\\\"][\\\"location\\\"][\\\"lng\\\"]\\n return \\\"#{lat},#{lng}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1cee4cf3b55dc89224cf1a3e1b01ff0d\",\n \"score\": \"0.7343467\",\n \"text\": \"def address\\n if params.has_key?(:latitude) && params.has_key?(:longitude)\\n results = Geocoder.address(\\\"#{params[:latitude]}, #{params[:longitude]}\\\")\\n if results.nil?\\n api_error(404)\\n else\\n render json: {:address => results }\\n end\\n else\\n api_error(400, {:message => t('geo.no coordinates provided')})\\n end\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"171c52bcd82a29cb26b95b368b8df3c0\",\n \"score\": \"0.73333293\",\n \"text\": \"def gmaps4rails_address\\n \\\"#{self.latitude}, #{self.longitude}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7ac60f7d2257a50c5bf3a1f82c78c14c\",\n \"score\": \"0.732531\",\n \"text\": \"def gmaps4rails_address\\n\\t\\t\\\"#{self.latitude}, #{self.longitude}\\\"\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb5be472dd68d8bba82817ae907b8ecc\",\n \"score\": \"0.7293218\",\n \"text\": \"def gmaps4rails_address\\n \\\"#{self.street_address}, #{self.city}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8fcb85fd84a42554e82faa26acd3aaa8\",\n \"score\": \"0.72655916\",\n \"text\": \"def geocode_address\\n return if address.blank?\\n results = Geocoder.search(address).first\\n\\t\\tdata = results.data['address']\\n\\t\\taddresses = [[data['road'], data['house_number']].join(' ').strip, data['city'], data['country']].compact.join(', ')\\n\\t\\tself.address = addresses\\n self.latitude = results.latitude\\n self.longitude = results.longitude\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"28b42182666aa546a63b97c1653498cc\",\n \"score\": \"0.7253906\",\n \"text\": \"def gmaps4rails_address\\n \\t\\t\\\"#{self.latitude}, #{self.longitude}\\\"\\n \\t end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f7e79b28541dee0fb54401b90e95f694\",\n \"score\": \"0.7252364\",\n \"text\": \"def get_latlng(address)\\r\\n \\r\\n if RAILS_ROOT == 'C://Rails/ssvp'\\r\\n api_key = \\\"ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA\\\"\\r\\n else\\r\\n api_key = \\\"ABQIAAAAKxdghs44-6Zbwux-M2j8PxQM_5f4oJ3bX2DkBRFzPOOnN9rvxhRVhIPXANGZpGerQlbk-Qjqi8TWfQ\\\";\\r\\n end\\r\\n \\r\\n map_params = {}\\r\\n map_params[\\\"q\\\"] = address.gsub(\\\" \\\", \\\"+\\\") #format spaces for url\\r\\n map_params[\\\"key\\\"] = api_key\\r\\n map_params[\\\"sensor\\\"] = 'false'\\r\\n map_params[\\\"output\\\"] = 'csv'\\r\\n \\r\\n \\r\\n params = map_params.to_a\\r\\n param_string = params.collect {|a| a.join(\\\"=\\\")}\\r\\n str = param_string.join(\\\"&\\\")\\r\\n url = \\\"http://maps.google.com/maps/geo?\\\"+str\\r\\n\\r\\n res = Net::HTTP.get(URI.parse(url))\\r\\n a = CSV.parse_line(res) #parse csv values to array\\r\\n status = a[0].to_i\\r\\n lat = a[2]\\r\\n lon = a[3]\\r\\n \\r\\n if status == 200\\r\\n response = [lat, lon]\\r\\n else\\r\\n response = nil\\r\\n end\\r\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"395b0fc394be2c5ebcfca044ad872f51\",\n \"score\": \"0.7217606\",\n \"text\": \"def get_lat_lon(address)\\n begin\\n require 'net/http'\\n\\n @geocode = {}\\n uri1 = \\\"maps.google.com\\\"\\n uri2 = \\\"/maps/api/geocode/json?address=#{address.gsub(/\\\\s/,'+')}&sensor=false\\\"\\n json_lat_lon = Net::HTTP.get_response(uri1,uri2)\\n @json_lat_lon = ActiveSupport::JSON.decode json_lat_lon.body\\n if @json_lat_lon[\\\"status\\\"] == \\\"OK\\\"\\n @geocode[:lat] = @json_lat_lon[\\\"results\\\"][0][\\\"geometry\\\"][\\\"location\\\"][\\\"lat\\\"]\\n @geocode[:lon] = @json_lat_lon[\\\"results\\\"][0][\\\"geometry\\\"][\\\"location\\\"][\\\"lng\\\"]\\n end\\n rescue\\n @geocode = {}\\n end\\n @geocode\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c85d520a53c32a54e6f472c175e8b892\",\n \"score\": \"0.7207109\",\n \"text\": \"def get_location_add(start_loc_input)\\n uri = URI(\\\"https://maps.googleapis.com/maps/api/geocode/json?address=#{start_loc_input}&sensor=true&key=#{ENV['GOOGLE_MAPS_API_KEY']}\\\")\\n res = Net::HTTP.get(uri)\\n json_result = JSON.parse(res)['results'].first\\n\\n puts uri\\n\\n return {:address => json_result['formatted_address'],\\n :latitude => json_result['geometry']['location']['lat'],\\n :longitude => json_result['geometry']['location']['lng']}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5d2d594732c72599a64200c8c662419f\",\n \"score\": \"0.719576\",\n \"text\": \"def geocoded_address\\n \\\"#{address1} #{address2} #{address3} #{address4} #{locality} #{region} #{postal_code} #{country}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb08c78b1fd1cc81597abf29b19de4b7\",\n \"score\": \"0.71871394\",\n \"text\": \"def gmaps4rails_address\\n #describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki\\n \\\"#{self.latitude}, #{self.longitude}\\\" \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"663a007a6b5bcabcfc2d232193437122\",\n \"score\": \"0.7154467\",\n \"text\": \"def locate_ll\\n geocoded_address = Geokit_service.new().geocode_address(one_line_address)\\n if (geocoded_address.success)\\n self.latitude = geocoded_address.lat\\n self.longitude = geocoded_address.lng\\n else \\n # The user input some new address that google can't find ... so we don't want to show the old google location\\n self.latitude = nil\\n self.longitude = nil\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dd6650cc756ec66757f6587f6e7622d3\",\n \"score\": \"0.7139285\",\n \"text\": \"def generate_geo_url(address)\\n call_address = Addressable::URI.new(\\n :scheme => \\\"https\\\",\\n :host => \\\"maps.googleapis.com\\\",\\n :path => \\\"maps/api/geocode/json\\\",\\n :query_values => {:address => address,\\n :sensor => 'false'}\\n ).to_s\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7e47a3af883217542f9abb1e9db9f657\",\n \"score\": \"0.7108763\",\n \"text\": \"def location_for_gmaps\\n self.address\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a74970f60b7a9840bdfcd4025677f231\",\n \"score\": \"0.7107051\",\n \"text\": \"def gb_address_to_latlng(address)\\n encoded_address = CGI.escape(address)\\n result = ScraperWiki.scrape(\\\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\\\")\\n result_doc = Nokogiri::HTML(result)\\n unless result_doc.css(\\\"geoname\\\").empty? \\n return [result_doc.css(\\\"geoname lat\\\").inner_text, result_doc.css(\\\"geoname lng\\\").inner_text]\\n else\\n # We seem to get addresses like \\\"Lowestoft, Suffolk, South East\\\" and Geonames doesn't like\\n # the \\\"South East\\\" part, so try removing the last clause\\n addr_clauses = address.split(',')\\n if addr_clauses.size > 1\\n addr_clauses.delete_at(addr_clauses.size-1)\\n return gb_address_to_latlng(addr_clauses.join(\\\", \\\"))\\n else\\n return nil\\n end\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a74970f60b7a9840bdfcd4025677f231\",\n \"score\": \"0.7107051\",\n \"text\": \"def gb_address_to_latlng(address)\\n encoded_address = CGI.escape(address)\\n result = ScraperWiki.scrape(\\\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\\\")\\n result_doc = Nokogiri::HTML(result)\\n unless result_doc.css(\\\"geoname\\\").empty? \\n return [result_doc.css(\\\"geoname lat\\\").inner_text, result_doc.css(\\\"geoname lng\\\").inner_text]\\n else\\n # We seem to get addresses like \\\"Lowestoft, Suffolk, South East\\\" and Geonames doesn't like\\n # the \\\"South East\\\" part, so try removing the last clause\\n addr_clauses = address.split(',')\\n if addr_clauses.size > 1\\n addr_clauses.delete_at(addr_clauses.size-1)\\n return gb_address_to_latlng(addr_clauses.join(\\\", \\\"))\\n else\\n return nil\\n end\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a74970f60b7a9840bdfcd4025677f231\",\n \"score\": \"0.7107051\",\n \"text\": \"def gb_address_to_latlng(address)\\n encoded_address = CGI.escape(address)\\n result = ScraperWiki.scrape(\\\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\\\")\\n result_doc = Nokogiri::HTML(result)\\n unless result_doc.css(\\\"geoname\\\").empty? \\n return [result_doc.css(\\\"geoname lat\\\").inner_text, result_doc.css(\\\"geoname lng\\\").inner_text]\\n else\\n # We seem to get addresses like \\\"Lowestoft, Suffolk, South East\\\" and Geonames doesn't like\\n # the \\\"South East\\\" part, so try removing the last clause\\n addr_clauses = address.split(',')\\n if addr_clauses.size > 1\\n addr_clauses.delete_at(addr_clauses.size-1)\\n return gb_address_to_latlng(addr_clauses.join(\\\", \\\"))\\n else\\n return nil\\n end\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a74970f60b7a9840bdfcd4025677f231\",\n \"score\": \"0.7107051\",\n \"text\": \"def gb_address_to_latlng(address)\\n encoded_address = CGI.escape(address)\\n result = ScraperWiki.scrape(\\\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\\\")\\n result_doc = Nokogiri::HTML(result)\\n unless result_doc.css(\\\"geoname\\\").empty? \\n return [result_doc.css(\\\"geoname lat\\\").inner_text, result_doc.css(\\\"geoname lng\\\").inner_text]\\n else\\n # We seem to get addresses like \\\"Lowestoft, Suffolk, South East\\\" and Geonames doesn't like\\n # the \\\"South East\\\" part, so try removing the last clause\\n addr_clauses = address.split(',')\\n if addr_clauses.size > 1\\n addr_clauses.delete_at(addr_clauses.size-1)\\n return gb_address_to_latlng(addr_clauses.join(\\\", \\\"))\\n else\\n return nil\\n end\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a74970f60b7a9840bdfcd4025677f231\",\n \"score\": \"0.7107051\",\n \"text\": \"def gb_address_to_latlng(address)\\n encoded_address = CGI.escape(address)\\n result = ScraperWiki.scrape(\\\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\\\")\\n result_doc = Nokogiri::HTML(result)\\n unless result_doc.css(\\\"geoname\\\").empty? \\n return [result_doc.css(\\\"geoname lat\\\").inner_text, result_doc.css(\\\"geoname lng\\\").inner_text]\\n else\\n # We seem to get addresses like \\\"Lowestoft, Suffolk, South East\\\" and Geonames doesn't like\\n # the \\\"South East\\\" part, so try removing the last clause\\n addr_clauses = address.split(',')\\n if addr_clauses.size > 1\\n addr_clauses.delete_at(addr_clauses.size-1)\\n return gb_address_to_latlng(addr_clauses.join(\\\", \\\"))\\n else\\n return nil\\n end\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a74970f60b7a9840bdfcd4025677f231\",\n \"score\": \"0.7107051\",\n \"text\": \"def gb_address_to_latlng(address)\\n encoded_address = CGI.escape(address)\\n result = ScraperWiki.scrape(\\\"http://api.geonames.org/search?q=#{encoded_address}&country=gb&username=amcewen&maxRows=1\\\")\\n result_doc = Nokogiri::HTML(result)\\n unless result_doc.css(\\\"geoname\\\").empty? \\n return [result_doc.css(\\\"geoname lat\\\").inner_text, result_doc.css(\\\"geoname lng\\\").inner_text]\\n else\\n # We seem to get addresses like \\\"Lowestoft, Suffolk, South East\\\" and Geonames doesn't like\\n # the \\\"South East\\\" part, so try removing the last clause\\n addr_clauses = address.split(',')\\n if addr_clauses.size > 1\\n addr_clauses.delete_at(addr_clauses.size-1)\\n return gb_address_to_latlng(addr_clauses.join(\\\", \\\"))\\n else\\n return nil\\n end\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8acd33a54e24e10cfef0c45c5d25681c\",\n \"score\": \"0.70882386\",\n \"text\": \"def geocode(address)\\n #setup params with\\n #address of course\\n #bounds; just says we prefer locations in carolina; just in case we had missing info\\n #sensor is whether we are using a device with gps; we're not.\\n params = {\\n :address => address,\\n :bounds => \\\"32.1,-83.5|35.3,-78.5\\\",\\n :sensor => \\\"false\\\"\\n }.to_param\\n #make the call and parse it\\n result = request(\\\"#{geocode_url}?#{params}\\\", \\\"{}\\\")\\n result = JSON.parse(result) rescue {}\\n\\n if result[\\\"status\\\"] == \\\"OK\\\" and result[\\\"results\\\"].size == 1\\n target = result[\\\"results\\\"][0][\\\"geometry\\\"][\\\"location\\\"]\\n [target[\\\"lat\\\"], target[\\\"lng\\\"]]\\n else\\n [nil,nil]\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"030b2a0b9c875353b079eb74cb945303\",\n \"score\": \"0.70810276\",\n \"text\": \"def gmaps4rails_address\\n [line1, city, state, zipcode].compact.join(', ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"030b2a0b9c875353b079eb74cb945303\",\n \"score\": \"0.70810276\",\n \"text\": \"def gmaps4rails_address\\n [line1, city, state, zipcode].compact.join(', ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbbf3bd5c02b6808e370724a5272f66b\",\n \"score\": \"0.7065485\",\n \"text\": \"def get_lat_and_long(address)\\n info = Geocoder.search(\\\"#{address}\\\")\\n @latitude = info[0].latitude\\n @longitude = info[0].longitude\\n \\n return @latitude, @longitude\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"137eef7ddf1a7fa95f59ea3dd166b894\",\n \"score\": \"0.7036503\",\n \"text\": \"def my_location\\n\\t\\t\\\"#{address}, #{city}, GA\\\"\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"137eef7ddf1a7fa95f59ea3dd166b894\",\n \"score\": \"0.7036503\",\n \"text\": \"def my_location\\n\\t\\t\\\"#{address}, #{city}, GA\\\"\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0bd76ad446eab151a181d690e1c9d839\",\n \"score\": \"0.703174\",\n \"text\": \"def lat_lon(address)\\n # Escape any non_ASCII characters and convert the string into a URI object.\\n encoded_url = URI.escape(\\n 'https://maps.googleapis.com/maps/api/geocode/json?address=' + address\\n )\\n url = URI.parse((encoded_url))\\n\\n # Make the request to retrieve the JSON string\\n response = open(url).read\\n\\n # Convert the JSON string into a Hash object\\n result = JSON.parse(response)\\n\\n # Extract the latitude and longitude and return them\\n lat = result['results'][0]['geometry']['location']['lat']\\n lon = result['results'][0]['geometry']['location']['lng']\\n return lat, lon\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c02fc0a4f95aa7697b1749cd82ccb78b\",\n \"score\": \"0.7003587\",\n \"text\": \"def get_coordinates_for(address)\\n\\tbase_google_url = \\\"http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=\\\"\\n\\tresult = RestClient.get(URI.encode(\\\"#{base_google_url}#{address}\\\"))\\n\\tparsed_result = Crack::XML.parse(result)\\n\\tlat = parsed_result[\\\"GeocodeResponse\\\"][\\\"result\\\"][\\\"geometry\\\"][\\\"location\\\"][\\\"lat\\\"]\\n\\tlng = parsed_result[\\\"GeocodeResponse\\\"][\\\"result\\\"][\\\"geometry\\\"][\\\"location\\\"][\\\"lng\\\"]\\n\\treturn \\\"#{lat},#{lng}\\\"\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fde58aeac510fff857ac0eed7f466de8\",\n \"score\": \"0.7003315\",\n \"text\": \"def point_info lat:, long:\\n request({\\n http_method: :get,\\n params: {geocode: \\\"#{lat},#{long}\\\"}\\n })\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"22e95f1fa1c8ec82af11556e318e3bef\",\n \"score\": \"0.6999178\",\n \"text\": \"def user_location(address)\\n Geocoder.coordinates(address)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cc526707a91e808170fd9f0a4e75f958\",\n \"score\": \"0.69817257\",\n \"text\": \"def url\\n if value['latitude'].present? and value['longitude'].present?\\n if value['type'] == MAP_TYPE_GOOGLE\\n sprintf(\\n 'http://maps.google.com/maps?%s&t=m&q=%s+%s',\\n value['zoom'].present? ? 'z=' + value['zoom'] : '',\\n value['latitude'],\\n value['longitude']\\n )\\n else # yandex\\n sprintf(\\n 'http://maps.yandex.ru/?l=map&text=%s&ll=%s%s',\\n [value['latitude'], value['longitude']].join(','),\\n [value['longitude'], value['latitude']].join(','),\\n value['zoom'].present? ? '&z=' + value['zoom'] : nil\\n )\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f2bbaa3a531b9f734607184f151a9188\",\n \"score\": \"0.6976226\",\n \"text\": \"def gmaps4rails_address\\r\\n#describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki\\r\\n \\\"#{self.street}, #{self.city}, #{self.country}\\\"\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2e94b750cff4ee44771186c8663bdad5\",\n \"score\": \"0.6947842\",\n \"text\": \"def geo_address\\n \\\"#{street1}#{street2}, #{city}, #{province}, CA, #{postal_code}\\\".gsub(/&/, 'and')+\\\"&components=country:CA\\\" \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"03df202f8f48dbde27fc6ca51be72d03\",\n \"score\": \"0.694499\",\n \"text\": \"def current_location(address)\\n current_location_url = Addressable::URI.new(\\n :scheme => \\\"https\\\",\\n :host => \\\"maps.googleapis.com\\\",\\n :path => \\\"maps/api/geocode/json\\\",\\n :query_values => {\\n :address => address,\\n :sensor => \\\"false\\\"}\\n ).to_s\\n\\n response = RestClient.get(current_location_url)\\n results = JSON.parse(response)\\n results[\\\"results\\\"][0][\\\"geometry\\\"][\\\"location\\\"]\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e8c9ac7e14e632fb4dce14eefea83391\",\n \"score\": \"0.6910859\",\n \"text\": \"def address_to_geocode\\n @address_to_geocode ||= [\\n @record.has_key?('permit_address') ? @record['permit_address'] : [@record['streetname'], @record['cross_street_1']].join(' and '),\\n \\\", San Francisco, CA\\\"\\n ].join\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb18505624304a6bfd38ad8b6cf6e90b\",\n \"score\": \"0.6898959\",\n \"text\": \"def geocode_address\\n geo=Geokit::Geocoders::MultiGeocoder.geocode(self.address_string)\\n errors.add(:address, \\\"Could not Geocode address\\\") if !geo.success\\n self.lat, self.lng = geo.lat,geo.lng if geo.success\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9b415ae093a29d1d3fa18b4c2a055429\",\n \"score\": \"0.68866426\",\n \"text\": \"def to_google_maps_address\\n [line1, line2, line3, \\\"#{zip} #{place}\\\"].compact.delete_if{|v| v.strip.blank?}.join(\\\", \\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a6641f0c5f13e1b16b5de0c99a40b021\",\n \"score\": \"0.6867109\",\n \"text\": \"def geocoder_address\\n begin\\n return self.field_value( :property_address ) + ', ' + self.field_value( :zip_code )\\n # return \\\"1800 Nelson Ranch Road, 78613\\\"\\n rescue\\n return nil\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df2c7af59a053facfe483ee185993a50\",\n \"score\": \"0.68638694\",\n \"text\": \"def locate(address)\\n get :geocode => address.is_a?(String) ? address : location_from_params(address).to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b3cab9fc880c2b7f012cf16d45534fba\",\n \"score\": \"0.6855277\",\n \"text\": \"def my_location\\n\\t\\\"#{address}, #{city}, GA\\\"\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"03b55cb778bf29aec1f5c319c72cc62e\",\n \"score\": \"0.68521845\",\n \"text\": \"def geocode_address\\n if lat.blank? || lng.blank?\\n geo = Geokit::Geocoders::MultiGeocoder.geocode(self.address_string)\\n if geo.success\\n self.lat, self.lng = geo.lat, geo.lng\\n else\\n puts geo.class\\n errors.add(:lat, \\\"Could not Geocode address\\\")\\n logger.debug \\\"Could not Geocode #{self.address_string}\\\"\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"534464c3792900f56d2d636dbbd6dd3b\",\n \"score\": \"0.68518466\",\n \"text\": \"def gmaps_info\\n {\\n title: name,\\n address: location.address\\n }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"08ffd70c8249eee4fc55529f1ee6f6da\",\n \"score\": \"0.68355703\",\n \"text\": \"def get_coords(address)\\n coords = Geocoder.search(address)\\n if coords.length === 0 \\n coords = Geocoder.search(self.name)\\n end\\n debugger\\n self.lat ||= coords.first.coordinates[0]\\n self.lng ||= coords.first.coordinates[1]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b3ac2dc0d2fedad10792011abb1c8d6c\",\n \"score\": \"0.6823246\",\n \"text\": \"def call_google_api_for_location(address)\\n url = \\\"https://maps.googleapis.com/maps/api/geocode/json?address=#{\\n address}&key=#{ENV['GOOGLE_API_KEY']}\\\"\\n response = HTTParty.get url\\n response.body\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5f3d91ff6dc31aabe81391d510ab7c33\",\n \"score\": \"0.6821508\",\n \"text\": \"def geocode_address\\n geo = Geokit::Geocoders::MultiGeocoder.geocode(self.address_string)\\n if geo.success\\n self.lat, self.lng = geo.lat, geo.lng\\n else\\n puts geo.class\\n errors.add(:address, \\\"Could not Geocode address\\\")\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"169301ecb99f2c6b39f400529617d1d6\",\n \"score\": \"0.6817495\",\n \"text\": \"def coordinates_url latitude, longitude\\n \\\"https://www.google.com/maps/search/?api=1&query=#{latitude}%2C#{longitude}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6624d507a1cc16309992501db8557254\",\n \"score\": \"0.6803278\",\n \"text\": \"def get_address_by_loc(lat, lng, ak = DefaultAK, http = HTTP)\\n params = {:location => \\\"#{lat},#{lng}\\\"}.merge({:output => \\\"json\\\", :ak => ak})\\n address = {}.merge(DefaultAddress)\\n begin\\n res = http.get(ApiUrl, :params => params).flush\\n\\n if res.code == 200\\n json = JSON.parse(res.body)\\n if \\\"0\\\".eql?(json[\\\"status\\\"].to_s) && json[\\\"result\\\"] && !json[\\\"result\\\"].empty? \\\\\\n && json[\\\"result\\\"][\\\"addressComponent\\\"] && !json[\\\"result\\\"][\\\"addressComponent\\\"].empty? \\\\\\n && json[\\\"result\\\"][\\\"formatted_address\\\"] && !json[\\\"result\\\"][\\\"formatted_address\\\"].empty?\\n address[:formatted_address] = json[\\\"result\\\"][\\\"formatted_address\\\"]\\n address[:province] = json[\\\"result\\\"][\\\"addressComponent\\\"][\\\"province\\\"]\\n address[:city] = json[\\\"result\\\"][\\\"addressComponent\\\"][\\\"city\\\"]\\n address[:district] = json[\\\"result\\\"][\\\"addressComponent\\\"][\\\"district\\\"]\\n address[:status] = true\\n end\\n end\\n rescue Exception => e\\n puts \\\"Exception => #{e}\\\"\\n end\\n\\n address\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a32aabc2e0ed46333474b48e55f16096\",\n \"score\": \"0.68016464\",\n \"text\": \"def gmaps4rails_gmaps\\r\\n#describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki\\r\\n \\\"#{self.longitude}, #{self.latitude}\\\" \\r\\n gmaps\\r\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"07a5de086fbc0f1f358ec6c902deed85\",\n \"score\": \"0.68004996\",\n \"text\": \"def address(location, address_new)\\n if location.present?\\n Geocoder.address(location)\\n else\\n address_new\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f34eac8cbf309fab096658ea9f1ff7bd\",\n \"score\": \"0.6755362\",\n \"text\": \"def geocode_from(address)\\n geocodes = {\\n latitude: nil,\\n longitude: nil\\n }\\n encoded_address = URI.encode(address)\\n url = request_url(encoded_address)\\n uri = URI.parse(url)\\n\\n begin\\n response = Net::HTTP.get_response(uri)\\n # check response code\\n case response\\n when Net::HTTPSuccess then\\n # 200 OK\\n data = JSON.parse(response.body)\\n latitude, longitude = get_coordinates(data)\\n geocodes[:latitude] = latitude\\n geocodes[:longitude] = longitude\\n else\\n puts [uri.to_s, response.value].join(\\\" : \\\")\\n end\\n rescue => e\\n puts [uri.to_s, e.class, e].join(\\\" : \\\")\\n end\\n\\n geocodes\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d69b1a2fc956428af6f7cbc526bf0e24\",\n \"score\": \"0.6754276\",\n \"text\": \"def address\\n @api_key,@standard_address_line1,@standard_address_location = \\\"\\\",\\\"\\\",\\\"\\\"\\n if request.post?\\n @error = \\\"\\\"\\n @search_for = \\\"location\\\"\\n @api_key = params[:api_key]\\n @standard_address_line1 = params[:address_street_line_1]\\n @standard_address_location = params[:address_city]\\n unless params[:api_key].blank?\\n unless params[:address_street_line_1].blank?\\n unless params[:address_city].blank?\\n encrypt(@api_key)\\n wp_obj = WhitePagesApi.new(@api_key)\\n wp_obj.street_line_1 = @standard_address_line1\\n wp_obj.city = @standard_address_location\\n @graph_url = wp_obj.get_location_url\\n else\\n @error = \\\"please enter city and state or Zip.\\\"\\n end\\n else\\n @error = \\\"please enter street address or name.\\\"\\n end\\n else\\n @error = \\\"please enter your api key.\\\"\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e64318d5f308f5e6373511d61a59927c\",\n \"score\": \"0.6748105\",\n \"text\": \"def full_address\\n addr = String.new\\n addr << \\\"#{street1}\\\"\\n # yes, handling commas was a pain - I tried about 10 other ways before settling on this.\\n # Fortunately, google maps is insanely smart and can take just about anything.\\n # But this is also used by the RSS reader, so it needs to work well.\\n addr << (addr == \\\"\\\" ? \\\"#{street2}\\\" : \\\", #{street2}\\\")\\n addr << (addr == \\\"\\\" ? \\\"#{city}\\\" : \\\", #{city}\\\")\\n addr << (addr == \\\"\\\" ? \\\"#{state}\\\" : \\\", #{state}\\\")\\n addr << (addr == \\\"\\\" ? \\\"#{zip}\\\" : \\\" #{zip}\\\")\\n return addr\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d8cafd46d6db7b353445248d2ebd1851\",\n \"score\": \"0.67471933\",\n \"text\": \"def location(query)\\n query = URI.encode query\\n key = load_service[\\\"google\\\"][\\\"api_key\\\"]\\n request_url = \\\"https://maps.googleapis.com/maps/api/place/textsearch/json?query=#{query}&key=#{key}&sensor=true\\\"\\n url = URI.parse(request_url)\\n\\t response = Net::HTTP.start(url.host, url.port,:use_ssl => url.scheme == 'https') do |http|\\n\\t\\t\\t\\thttp.request(Net::HTTP::Get.new(request_url)) \\n\\t\\t\\tend\\n\\t\\t\\tdata = JSON.parse(response.body)[\\\"results\\\"][0]\\n\\t\\t\\t{\\n\\t\\t\\t :address => data[\\\"formatted_address\\\"],\\n\\t\\t\\t :lat => data[\\\"geometry\\\"][\\\"location\\\"][\\\"lat\\\"],\\n\\t\\t\\t :lng => data[\\\"geometry\\\"][\\\"location\\\"][\\\"lng\\\"]\\n\\t\\t\\t}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2a2238832aae0b7538dba6ed29a89e4f\",\n \"score\": \"0.67467\",\n \"text\": \"def get_address(url)\\n url = URI.decode(url)\\n loc = url.split('loc:+')\\n return nil if loc.length == 1\\n loc_str = loc[1]\\n loc_str.split('+').join(' ')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0bc8440224e4f15880b52dd5db23b2be\",\n \"score\": \"0.6746519\",\n \"text\": \"def geocode_address\\n if lat.nil? || lng.nil?\\n geo = Geokit::Geocoders::MultiGeocoder.geocode(\\\"#{name}, #{country}\\\")\\n # errors.add(:address, \\\"Could not Geocode address\\\") if !geo.success\\n self.lat, self.lng = 0, 0 if !geo.success\\n self.lat, self.lng = geo.lat, geo.lng if geo.success\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"afe1923b36d0ff47392a0ee2e29b6482\",\n \"score\": \"0.671638\",\n \"text\": \"def full_address\\n address + \\\", \\\" + location + \\\" \\\" + postcode.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"513ccf3d8b59fe112b91d176499705dc\",\n \"score\": \"0.6714417\",\n \"text\": \"def latlong_to_address\\n\\n\\t\\tif (self.lat)\\n\\t\\t\\taddress = Geocoder.address([self.lat,self.long])\\n\\t\\t\\tif address\\n\\t\\t\\t\\t# sample address is \\n\\t\\t\\t\\t# \\\"769 Lasalle St, New Orleans, LA 70113, USA\\\" \\n\\t\\t\\t\\t# \\n\\t\\t\\t\\tfields = address.split ','\\n\\t\\t\\t\\tif fields.length == 4\\n\\t\\t\\t\\t\\t# need to split up the state and zip, at index 2\\n\\t\\t\\t\\t\\tstatezip = fields[2].split \\\" \\\"\\n\\n\\t\\t\\t\\t\\tself.street1 = fields[0]\\n\\t\\t\\t\\t\\tself.city = fields[1]\\n\\n\\t\\t\\t\\t\\tself.state = statezip[0]\\n\\t\\t\\t\\t\\tself.zip = statezip[1]\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\tflash[:notice] = \\\"Please set the Notwa address to #{address}\\\"\\n\\t\\t\\t\\tend\\n\\t\\t\\tend\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"777f371437441a62a70515169f795271\",\n \"score\": \"0.6706577\",\n \"text\": \"def location\\n \\\"https://maps.google.com/?q=\\\" + CGI.escape(coordinates)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c7f4c12d67a8b8be6ecb36158ef08f09\",\n \"score\": \"0.66903543\",\n \"text\": \"def reverse latitude, longitude\\n return nil if LocationInterface.config[\\\"google\\\"][\\\"geocode\\\"][\\\"api_key\\\"].nil? or LocationInterface.config[\\\"google\\\"][\\\"geocode\\\"][\\\"api_key\\\"].empty?\\n api_key = LocationInterface.config[\\\"google\\\"][\\\"geocode\\\"][\\\"api_key\\\"]\\n url = \\\"https://maps.googleapis.com/maps/api/geocode/json?latlng=#{latitude},#{longitude}&key=#{api_key}\\\"\\n\\n response = HTTParty.get url\\n data = JSON.parse response.body\\n if not data[\\\"status\\\"] == \\\"OK\\\"\\n Airbrake.notify(Notice.new(\\\"Invalid response from Google’s reverse api with url\\\")) do |notice|\\n notice[:params][:latitude] = latitude\\n notice[:params][:longitude] = longitude\\n notice[:params][:url] = url\\n notice[:context][:severity] = \\\"warning\\\"\\n end\\n return nil\\n end\\n\\n components = data[\\\"results\\\"][0][\\\"address_components\\\"]\\n street_address = nil\\n street_number = nil\\n city = nil\\n postal_code = nil\\n\\n components.each do |component|\\n street_number = component[\\\"long_name\\\"] if component[\\\"types\\\"].include? \\\"street_number\\\"\\n street_address = component[\\\"long_name\\\"] if component[\\\"types\\\"].include? \\\"route\\\"\\n postal_code = component[\\\"long_name\\\"] if component[\\\"types\\\"].include? \\\"postal_code\\\"\\n city = component[\\\"long_name\\\"] if component[\\\"types\\\"].include? \\\"administrative_area_level_3\\\"\\n city = component[\\\"long_name\\\"] if component[\\\"types\\\"].include? \\\"locality\\\"\\n end\\n\\n {\\n \\\"address\\\" => \\\"#{street_address} #{street_number}\\\",\\n \\\"city\\\" => city,\\n \\\"postal_code\\\" => postal_code\\n }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ea132cf7e357b7ddc8f4685baed6387b\",\n \"score\": \"0.66900057\",\n \"text\": \"def gmaps4rails_address\\n\\t\\t#describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki\\n \\t\\t\\\"#{self.address}\\\"\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1c95caa143c146261a8fd707ad32bcb1\",\n \"score\": \"0.6686067\",\n \"text\": \"def get_location \\n marker = Geocoding::get(zipcode, :key => GoogleMapper.api_key) \\n if marker.size > 0 \\n marker = marker.first\\n self.longitude = marker.longitude\\n self.latitude = marker.latitude \\n [latitude, longitude] \\n elsif marker.status.to_s == '620' \\n nil\\n end \\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4985b303cf8ca44f9c7304f2745ae797\",\n \"score\": \"0.6681396\",\n \"text\": \"def map_address\\n map_address = [self.country.to_s, self.city.to_s, self.locality.to_s]\\n map_address.join(\\\",\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4985b303cf8ca44f9c7304f2745ae797\",\n \"score\": \"0.6681396\",\n \"text\": \"def map_address\\n map_address = [self.country.to_s, self.city.to_s, self.locality.to_s]\\n map_address.join(\\\",\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"19e22f25687c948c721f2448e0a7b535\",\n \"score\": \"0.66673964\",\n \"text\": \"def geodecode(address)\\n begin\\n url = get_geocode_url(address)\\n response = RestClient.get url\\n json = JSON.parse(response)\\n location = json['results'][0]['geometry']['location']\\n return \\\"#{location['lat']}, #{location['lng']}\\\"\\n rescue\\n return nil\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a745695c9e751ec39faba17a6688d803\",\n \"score\": \"0.66652066\",\n \"text\": \"def geo_to_address(longitude, latitude)\\n # uri = URI('http://api.map.baidu.com/geocoder/v2/')\\n # params = {\\n # ak: '8HC4SzAudccqEF0Qj0bs8Bb4',\\n # coordtype: 'wgs84ll',\\n # location: env.params['x'] + ',' + env.params['y'],\\n # output: 'json'\\n # }\\n # THIS API GOT 101 ERROR\\n # TODO using this API maybe?\\n\\n api_url = 'http://api.map.baidu.com/geocoder'\\n api_params = {\\n coordtype: 'wgs84ll',\\n location: latitude + ',' + longitude, # WARNING: fuxxing baidu use (lat, lon) instead of (lon, lat)\\n output: 'json',\\n src: 'OakStaffStudio|SaveYourSelf'\\n }\\n (MultiJson.load (EM::HttpRequest.new(api_url).get :query => api_params).response)['result']['addressComponent']\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"77de5fce7048ce62fd8f2c99aa23f682\",\n \"score\": \"0.6661327\",\n \"text\": \"def coordinates_to_address(lat, long)\\n Geocoder.address([lat, long])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4777dc85ea480a289f348339c72d68df\",\n \"score\": \"0.6655467\",\n \"text\": \"def get_location_coordinates\\n str = self.street_1\\n zip = self.zip_code\\n \\n coord = Geocoder.coordinates(\\\"#{str}, #{zip}\\\")\\n if coord\\n self.latitude = coord[0]\\n self.longitude = coord[1]\\n else \\n errors.add(:base, \\\"Error with geocoding\\\")\\n end\\n coord\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a014c2feb5aeb1a2a977589b54c7dc1c\",\n \"score\": \"0.6653575\",\n \"text\": \"def get_lat_long(location)\\n Geokit::Geocoders::GoogleGeocoder.geocode \\\"#{location}\\\"\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f73a8854b1a74b71b9b34ea5a9116297\",\n \"score\": \"0.66518307\",\n \"text\": \"def user_address(lat=0,lng=0)\\n\\t\\tif (lat==0 || lng==0) && (request.location.latitude != 0 && request.location.longitude != 0)\\n\\t\\t\\tlat = request.location.latitude\\n\\t\\t\\tlng = request.location.longitude\\n\\t\\telse\\n\\t\\t\\tlat = 37.7691\\n\\t\\t\\tlng = -122.4449\\n\\t\\tend\\n\\t\\tGeocoder.address([lat, lng])\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bcd07223c7ce0aa89cd04b21c782502f\",\n \"score\": \"0.66447586\",\n \"text\": \"def generate_places_url(coordinates)\\n call_address = Addressable::URI.new(\\n :scheme => \\\"https\\\",\\n :host => \\\"maps.googleapis.com\\\",\\n :path => \\\"maps/api/place/nearbysearch/json\\\",\\n :query_values => {\\n :location => coordinates,\\n :rankby => \\\"distance\\\",\\n :types => \\\"food\\\",\\n :keyword => \\\"ice cream\\\",\\n :sensor => 'false',\\n :key => \\\"AIzaSyD2JOxpVx-nJo8W4k1IaZj--D2XtECZ7Ng\\\"}\\n ).to_s\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5b08687bd3c4e3c6da6db6a5972fbbba\",\n \"score\": \"0.6639852\",\n \"text\": \"def append_street_address_lat_lng(yelpResults)\\n yelpResults[\\\"businesses\\\"].each_index do |i|\\n addr1 = yelpResults[\\\"businesses\\\"][i][\\\"location\\\"][\\\"display_address\\\"][0]\\n city = yelpResults[\\\"businesses\\\"][i][\\\"location\\\"][\\\"city\\\"]\\n stateCode = yelpResults[\\\"businesses\\\"][i][\\\"location\\\"][\\\"state\\\"]\\n countryCode = yelpResults[\\\"businesses\\\"][i][\\\"location\\\"][\\\"country\\\"]\\n if (addr1 && city && stateCode && countryCode)\\n singleLineAddress = addr1 + \\\", \\\" + city + \\\", \\\" + stateCode + \\\", \\\" + countryCode\\n address = singleLineAddress\\n if address\\n address = address.gsub(\\\" \\\", \\\"%20\\\")\\n end\\n addressLatLng = get_geo_json(address)\\n logger.info(addressLatLng)\\n yelpResults[\\\"businesses\\\"][i][\\\"location\\\"][\\\"geocoding\\\"] = addressLatLng\\n else\\n latLng = {\\\"lng\\\" => 0,\\\"lat\\\" => 0}\\n latLng[\\\"_id\\\"] = address\\n yelpResults[\\\"businesses\\\"][i][\\\"location\\\"][\\\"geocoding\\\"] = latLng\\n end\\n end\\n return yelpResults.to_json\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f85b1234319a4bde6901735daef73a2f\",\n \"score\": \"0.6635824\",\n \"text\": \"def geocode\\n geo = Geokit::Geocoders::MultiGeocoder.geocode address.gsub(/\\\\n/, ', ')\\n if geo.success\\n self.lat, self.lng = geo.lat, geo.lng\\n else\\n errors.add(:address, 'Problem locating address')\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6aedef4987d9dad30dafcef67472cd3b\",\n \"score\": \"0.66115594\",\n \"text\": \"def geocode_address\\n return unless street_changed? || city_changed? || country_changed? || locality_changed? || state_changed?\\n coords = Geocoder.coordinates(self.street.to_s+\\\",\\\"+self.locality.to_s+','+self.city.to_s+','+self.country.to_s)\\n if coords.kind_of?(Array)\\n self.latitude = coords[0];\\n self.longitude = coords[1];\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"15bed2734704e7e64e4466933d6130b9\",\n \"score\": \"0.6609754\",\n \"text\": \"def address(latitude, longitude)\\n if (results = search(latitude, longitude)).size > 0\\n results.first.address\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"78ad79b7f340bb758ed44b98f432027d\",\n \"score\": \"0.6607991\",\n \"text\": \"def nearby_address(lat, lng, options = {})\\n perform_get(\\\"/nearby/address/#{lat},#{lng}.json\\\", :query => options)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9a1e2efd81ca5c02d31ab6289c51722c\",\n \"score\": \"0.6593421\",\n \"text\": \"def geocode_address(street, city, state, country, log=true)\\n\\t\\t\\taddress = \\\"#{street}, #{city}, #{state}, #{country}\\\"\\n\\n\\t\\t\\tputs \\\" Attempting to geocode: #{address}\\\" if log\\n\\n\\t\\t\\tresp = RestClient.get(GMAPS_GEOCODE_BASE, {\\n\\t\\t\\t\\t:params => {\\n\\t\\t\\t\\t\\t:address => address,\\n\\t\\t\\t\\t\\t:sensor => false,\\n\\t\\t\\t\\t\\t:components => \\\"locality:#{city}|administrative_area:#{state}\\\"\\n\\t\\t\\t\\t},\\n\\t\\t\\t\\t:content_type => :json,\\n\\t\\t\\t\\t:accept => :json\\n\\t\\t\\t})\\n\\n\\t\\t\\tparsed = JSON.parse(resp)\\n\\n\\t\\t\\tif parsed[\\\"results\\\"] && parsed[\\\"results\\\"].length >= 1\\n\\t\\t\\t\\tputs \\\" Geocoded successfully.\\\" if log\\n\\n\\t\\t\\t\\tinfo = {\\n\\t\\t\\t\\t\\t\\\"formatted_address\\\" => parsed[\\\"results\\\"][0][\\\"formatted_address\\\"]\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tparsed[\\\"results\\\"][0][\\\"address_components\\\"].each do |component|\\n\\t\\t\\t\\t\\tif component[\\\"types\\\"].include?(\\\"street_number\\\")\\n\\t\\t\\t\\t\\t\\tinfo[\\\"street_number\\\"] = component[\\\"long_name\\\"]\\n\\t\\t\\t\\t\\tend\\n\\n\\t\\t\\t\\t\\tif component[\\\"types\\\"].include?(\\\"route\\\")\\n\\t\\t\\t\\t\\t\\tinfo[\\\"street\\\"] = component[\\\"short_name\\\"]\\n\\t\\t\\t\\t\\tend\\n\\n\\t\\t\\t\\t\\tif component[\\\"types\\\"].include?(\\\"neighborhood\\\")\\n\\t\\t\\t\\t\\t\\tinfo[\\\"neighborhood\\\"] = component[\\\"long_name\\\"]\\n\\t\\t\\t\\t\\tend\\n\\n\\t\\t\\t\\t\\tif component[\\\"types\\\"].include?(\\\"locality\\\")\\n\\t\\t\\t\\t\\t\\tinfo[\\\"locality\\\"] = component[\\\"long_name\\\"]\\n\\t\\t\\t\\t\\tend\\n\\n\\t\\t\\t\\t\\tif component[\\\"types\\\"].include?(\\\"administrative_area_level_2\\\") # US county\\n\\t\\t\\t\\t\\t\\tinfo[\\\"county\\\"] = component[\\\"long_name\\\"]\\n\\t\\t\\t\\t\\tend\\n\\n\\t\\t\\t\\t\\tif component[\\\"types\\\"].include?(\\\"administrative_area_level_1\\\") # US state\\n\\t\\t\\t\\t\\t\\tinfo[\\\"region\\\"] = component[\\\"long_name\\\"]\\n\\t\\t\\t\\t\\t\\tinfo[\\\"region_abbreviation\\\"] = component[\\\"short_name\\\"]\\n\\t\\t\\t\\t\\tend\\n\\n\\t\\t\\t\\t\\tif component[\\\"types\\\"].include?(\\\"country\\\")\\n\\t\\t\\t\\t\\t\\tinfo[\\\"country\\\"] = component[\\\"long_name\\\"]\\n\\t\\t\\t\\t\\t\\tinfo[\\\"country_abbreviation\\\"] = component[\\\"short_name\\\"]\\n\\t\\t\\t\\t\\tend\\n\\n\\t\\t\\t\\t\\tif component[\\\"types\\\"].include?(\\\"postal_code\\\")\\n\\t\\t\\t\\t\\t\\tinfo[\\\"postal_code\\\"] = component[\\\"long_name\\\"]\\n\\t\\t\\t\\t\\tend\\n\\t\\t\\t\\tend\\n\\n\\t\\t\\t\\tinfo[\\\"address\\\"] = \\\"#{info[\\\"street_number\\\"]} #{info[\\\"street\\\"]}\\\".strip\\n\\n\\t\\t\\t\\treturn info\\n\\t\\t\\tend\\n\\n\\t\\t\\treturn nil\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"59a354c9b6da36060f8f0be5ce730e50\",\n \"score\": \"0.6581458\",\n \"text\": \"def address\\n return street + \\\" \\\" + house_number + \\\" \\\" + postal_code + \\\" \\\" + city + \\\" Denmark\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"74e94840e529f4763c2bdbd7a55215d1\",\n \"score\": \"0.658104\",\n \"text\": \"def area_address\\n address=GoogleGeocoder.reverse_geocode([self.latitude,self.longitude])\\n address.full_address\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"74e94840e529f4763c2bdbd7a55215d1\",\n \"score\": \"0.658104\",\n \"text\": \"def area_address\\n address=GoogleGeocoder.reverse_geocode([self.latitude,self.longitude])\\n address.full_address\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7e419cfb538f71b295d9e5f160672a6\",\n \"score\": \"0.6570134\",\n \"text\": \"def address_search\\n coords = []\\n if params[:address].present?\\n\\t\\t begin\\n\\t\\t\\t locations = Geocoder.search(\\\"#{params[:address]}\\\")\\n if locations.present?\\n locations.each do |l|\\n x = Hash.new\\n x[:coordinates] = l.coordinates\\n x[:address] = l.address\\n coords << x\\n end\\n end\\n\\t\\t rescue\\n\\t\\t\\t coords = []\\n\\t\\t end\\n elsif params[:lat].present? && params[:lon].present?\\n\\t\\t begin\\n\\t\\t\\t locations = Geocoder.search(\\\"#{params[:lat]}, #{params[:lon]}\\\")\\n if locations.present?\\n locations.each do |l|\\n x = Hash.new\\n x[:coordinates] = l.coordinates\\n x[:address] = l.address\\n coords << x\\n end\\n end\\n\\t\\t rescue\\n\\t\\t\\t coords = []\\n\\t\\t end\\n end\\n\\n respond_to do |format|\\n format.json { render json: coords.to_json }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"92830a7f68507c448f3ef7899cba5e63\",\n \"score\": \"0.65641195\",\n \"text\": \"def get_address\\n address = \\\"\\\"\\n address = address + @json_stock[\\\"summaryProfile\\\"][\\\"address1\\\"]\\n address = address + \\\", \\\" + @json_stock[\\\"summaryProfile\\\"][\\\"city\\\"]\\n address = address + \\\", \\\" + @json_stock[\\\"summaryProfile\\\"][\\\"state\\\"]\\n address = address + \\\" \\\" + @json_stock[\\\"summaryProfile\\\"][\\\"zip\\\"]\\n @address = address\\n @address\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36b7a7274b5b871f519b7d062e13f9ce\",\n \"score\": \"0.6559262\",\n \"text\": \"def getGeocode loc_string\\n Geokit::Geocoders::GoogleGeocoder.api_key = Rails.application.secrets.GOOGLE_MAPS_API_KEY\\n req = Geokit::Geocoders::GoogleGeocoder.geocode(loc_string)\\n return req.ll\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ae14905e5c9dcfc39e27fec1b73870fa\",\n \"score\": \"0.65507144\",\n \"text\": \"def get_lat_lng_from_address(address)\\n if address\\n ll = Geocoder.coordinates(address)\\n @latitude = ll[0]\\n @longitude = ll[1]\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eebdcd4456b15b96c1cc6238571bf24a\",\n \"score\": \"0.6550491\",\n \"text\": \"def google_map_url\\n # \\\"https://www.google.com/maps/place/@#{object.latitude},#{object.longitude},9z\\\"\\n \\\"https://www.google.com/maps/place/#{object.latitude},#{object.longitude}/@#{object.latitude},#{object.longitude},15z/\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a1c27cb0a180a8bfcaa36ae763e99f6b\",\n \"score\": \"0.6549662\",\n \"text\": \"def geocode_address\\n full_address or address\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a1c27cb0a180a8bfcaa36ae763e99f6b\",\n \"score\": \"0.6549662\",\n \"text\": \"def geocode_address\\n full_address or address\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb0afd3ff970c25d229faaaf3c6370fb\",\n \"score\": \"0.6547305\",\n \"text\": \"def get_lat_lng(user_address)\\n GeocodingService.new(address: params[:user_address]).lat_lng\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3be5225ee9979adac56d9868dd0e2e9a\",\n \"score\": \"0.65439254\",\n \"text\": \"def address_for_geocoding_and_mapping\\n\\n city_state = self.city\\n if (self.state_id)\\n city_state += \\\", \\\" + self.state.name\\n end\\n # We can build a 'full address' string, it will be used in a few\\n # places below\\n full_address = city_state\\n if (!self.address2.blank?)\\n full_address = self.address2 + \\\", \\\" + full_address\\n end\\n if (!self.address1.blank?)\\n full_address = self.address1 + \\\", \\\" + full_address\\n end\\n if (!self.country_id.blank?)\\n full_address += \\\", \\\" + self.country.name\\n end\\n\\n return full_address\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9f6f7c5af150b786bacfff2fd7e64717\",\n \"score\": \"0.6538885\",\n \"text\": \"def street_address\\n \\\"#{addr_1}, #{addr_2}, #{addr_city}, #{addr_state} #{addr_code} #{addr_country}\\\"\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":174,"cells":{"query_id":{"kind":"string","value":"1d99f5377a96aed96c511d24be8b47f2"},"query":{"kind":"string","value":"ligne pour appeler la fonction"},"positive_passages":{"kind":"list like","value":[{"docid":"5a7233e142a7754b874d09567ce24992","score":"0.0","text":"def ask_first_name #fonction dont le role est d'afficher \"bonjour + first name\"\n\tputs \"Quel est ton prénom ?\"\n\tprint \">\"\n\tfirst_name = gets.chomp\n\treturn first_name\n\t\nend","title":""}],"string":"[\n {\n \"docid\": \"5a7233e142a7754b874d09567ce24992\",\n \"score\": \"0.0\",\n \"text\": \"def ask_first_name #fonction dont le role est d'afficher \\\"bonjour + first name\\\"\\n\\tputs \\\"Quel est ton prénom ?\\\"\\n\\tprint \\\">\\\"\\n\\tfirst_name = gets.chomp\\n\\treturn first_name\\n\\t\\nend\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"9da75f38bbbf324b100402649a37d15c","score":"0.6783748","text":"def studliga\n\n end","title":""},{"docid":"4fe655da88e61d28e8b9a9ed964af838","score":"0.6641103","text":"def imprensa\n\t\t\n\tend","title":""},{"docid":"26da328e8cf814fdc197fd2d301c3d2b","score":"0.648012","text":"def flipx\r\n end","title":""},{"docid":"06fd3a231d28f23a18f53100267107bb","score":"0.63873506","text":"def graj (wykonaj)\n\nend","title":""},{"docid":"fa686cdf1942762f7041d1fb7b0aacb0","score":"0.62652797","text":"def comofunciona\n\t\t\n\tend","title":""},{"docid":"a9dd648a5d0d2e7d56223e7c753f5e2e","score":"0.6264508","text":"def telegraphical()\n end","title":""},{"docid":"1151221aa9457e5cad317e4fec922758","score":"0.61925215","text":"def adjugate; end","title":""},{"docid":"0939406b2108b4dcfeb32a0ce912e9dd","score":"0.61917436","text":"def\thustle \t \t\r\n\t\tend","title":""},{"docid":"792be6eadacebdee265be975baeda2c7","score":"0.6190803","text":"def function; end","title":""},{"docid":"1d3f89244d8879e46d0688468f064d0f","score":"0.61588943","text":"def alta_vista\n \n end","title":""},{"docid":"3c298ed47fde79a7b75554db439cce32","score":"0.6115309","text":"def ho()\n\t#TODO\nend","title":""},{"docid":"47fa14e987305bb793373e857d69a0ff","score":"0.6086414","text":"def politica\n\t\t\n\tend","title":""},{"docid":"37dd51a636bd4f92c4c4bdb82296b191","score":"0.59868693","text":"def frizz_pharmacolite_triaconter()\n end","title":""},{"docid":"54a53621e5fd3fc0cc3d2ff2901a893e","score":"0.59841996","text":"def chazelle\n end","title":""},{"docid":"90820bf0e60e0f8091b77d4e756ed17c","score":"0.5956013","text":"def gl; end","title":""},{"docid":"3b44e74011cfcd34dc256b97e904f715","score":"0.59519756","text":"def hacer_ruido\n\t\treturn super << \"miauuuu!\"\n\t\t\n\tend","title":""},{"docid":"c512d3086c54cb450c944eacc9c75f27","score":"0.59397554","text":"def busca_conta\n\n end","title":""},{"docid":"8d0e128ad87cd20a86507c09c46a6f67","score":"0.5899578","text":"def termitidae()\n end","title":""},{"docid":"480058405628030c64c41b76f2f0a400","score":"0.5895721","text":"def tr; end","title":""},{"docid":"5f2263808382a77bc1221f752b8165d9","score":"0.58593667","text":"def opweg\n end","title":""},{"docid":"721d1d99e045fda0c14e7d425b06ffb0","score":"0.58591396","text":"def g(*) end","title":""},{"docid":"721d1d99e045fda0c14e7d425b06ffb0","score":"0.58591396","text":"def g(*) end","title":""},{"docid":"b2aab3097a5cbdb221461b6e7c701666","score":"0.58338004","text":"def horizontal; end","title":""},{"docid":"04e074efc99de627ea58633a58870ec3","score":"0.58206344","text":"def stpreason\n end","title":""},{"docid":"67081eb3c98dc9ab87bd978f73a10e81","score":"0.58196187","text":"def advanced; end","title":""},{"docid":"67081eb3c98dc9ab87bd978f73a10e81","score":"0.58196187","text":"def advanced; end","title":""},{"docid":"7f5073ed8a81fec00b09ae99ac8f7c94","score":"0.58126324","text":"def additions; end","title":""},{"docid":"50fd4af1f4f8df184d6ad35e37e8f6a1","score":"0.5810276","text":"def autre_method\n puts \"methode privee\"\n end","title":""},{"docid":"faac832a08ae266cff71f0004a0c9e91","score":"0.579979","text":"def life_line\n\t\nend","title":""},{"docid":"2dbabd0eeb642c38aad852e40fc6aca7","score":"0.5780465","text":"def operations; end","title":""},{"docid":"2dbabd0eeb642c38aad852e40fc6aca7","score":"0.5780465","text":"def operations; end","title":""},{"docid":"bc658f9936671408e02baa884ac86390","score":"0.5778657","text":"def anchored; end","title":""},{"docid":"97ae8249fb30ed859b3cfb702306b92a","score":"0.5776513","text":"def nombre_metodo (arg_3, arg_1 = 28, arg_2 = 56)\r\nend","title":""},{"docid":"ef9557994d92c292d62c7a3d9be97d15","score":"0.5767654","text":"def kontakt\n\n end","title":""},{"docid":"3438e0cf3a421348424af74f8f11d3bd","score":"0.5763585","text":"def afficher()\n if(@contenu == nil)\n print(\"·\")\n else\n @contenu.afficher()\n end\n end","title":""},{"docid":"ac6897a2939ef77c2e788280bd530d7f","score":"0.5755237","text":"def aniversario\n\tend","title":""},{"docid":"e28593026497a2baf9c546a2da299bf7","score":"0.5721054","text":"def nonstpreason\nend","title":""},{"docid":"40769f9969d33ad71cb2389a7e574114","score":"0.5721019","text":"def institucional\n\t\t\n\tend","title":""},{"docid":"d509f8cefdd8fc87fefabff3705478b5","score":"0.57184803","text":"def custom\n \n end","title":""},{"docid":"a7c3ff6e9a70757ad110a0a6920415c1","score":"0.57168627","text":"def boruvka\n end","title":""},{"docid":"7477f36427db1eed71e3d1fe5ae5eb83","score":"0.57138413","text":"def manuver\n\tend","title":""},{"docid":"5be3efd31b567fcbb0296b587a686bf5","score":"0.5712158","text":"def add_func(name)\n\t\tend","title":""},{"docid":"da32862891e2ebc3c8d71f65524bb4c1","score":"0.5698983","text":"def prosa\n end","title":""},{"docid":"da32862891e2ebc3c8d71f65524bb4c1","score":"0.5698983","text":"def prosa\n end","title":""},{"docid":"2181cc4c08c7cfcbb50f79ca20ab0c63","score":"0.5685759","text":"def LIN04=(arg)","title":""},{"docid":"53ecaf66b6feee85613ba3463552494f","score":"0.5663743","text":"def LIN05=(arg)","title":""},{"docid":"9e549dd6d023d0b3c4c5564e8fa79c08","score":"0.5659995","text":"def add_ingrediant\n end","title":""},{"docid":"48d178de14ed4126080f70b61652dd6d","score":"0.5658408","text":"def fOOrth\r\n end","title":""},{"docid":"48d178de14ed4126080f70b61652dd6d","score":"0.5658408","text":"def fOOrth\r\n end","title":""},{"docid":"15bdaa14d2d72a48cac4eb0721a51da8","score":"0.5651282","text":"def LIN03=(arg)","title":""},{"docid":"0f4fb165548b4d7ab8c74f1e99d3f784","score":"0.56495374","text":"def stahp\n end","title":""},{"docid":"3caf4c824a6d6a4a5616c13fcab418da","score":"0.5636217","text":"def applied; end","title":""},{"docid":"871ec6288b069a405aae843577098ab9","score":"0.5630487","text":"def oportunidade\n\tend","title":""},{"docid":"4bfa7ceb1aecd6a651eb94fcea3f4959","score":"0.5619569","text":"def inline; end","title":""},{"docid":"4bfa7ceb1aecd6a651eb94fcea3f4959","score":"0.5619569","text":"def inline; end","title":""},{"docid":"333dfdc13e90ef65e949135e7e4cf80a","score":"0.56055784","text":"def pag1\n end","title":""},{"docid":"9a672a46158c47dbad9e387558200c76","score":"0.5602673","text":"def span; end","title":""},{"docid":"974e51f644bf69638b2748167c5532a9","score":"0.5598541","text":"def vocal_en_nombre_piloto(pilotos) \n\nend","title":""},{"docid":"3bcde409a5e247ad3cd027b9f7e2b5d5","score":"0.55965585","text":"def lbl_algn; end","title":""},{"docid":"52ff1971a3d15dcbf952f4206e115956","score":"0.5587151","text":"def hacer_ruido\n\t\treturn super\n\tend","title":""},{"docid":"11731a5a3243408f29627ae9ed59e1ed","score":"0.5582894","text":"def paradox\n end","title":""},{"docid":"2e917f10b0e8882acb01390833f6e570","score":"0.557673","text":"def LIN02=(arg)","title":""},{"docid":"1d80084ab79c11756e15065daa5044b1","score":"0.55765414","text":"def comprobar\n \n end","title":""},{"docid":"4a5e2232b07ff1c71d9e1e5f711a8871","score":"0.5573553","text":"def griser() \n\t\t@etat = 2\n\tend","title":""},{"docid":"b882d5efe783080b52fcda674ce4a9ed","score":"0.55716044","text":"def meu_metodo\n -> () { return \"return dentro da lamb\" }.call\n return \"\\nReturn do método fora da lamb \" #a lamb sempre retorna o valor do return após o call\n end","title":""},{"docid":"4c9190bec591e0d8bcffbea3e5e4fda2","score":"0.5568471","text":"def agence\n\n end","title":""},{"docid":"8b3b374712fa41dc5dafd45ff7a7d790","score":"0.55676174","text":"def smore(vesicoprostatic, unpoached_landaulet, alkes_bilbo)\n end","title":""},{"docid":"91a7c3ba743cdd80256378933e62d3b0","score":"0.55611205","text":"def dfg; end","title":""},{"docid":"91a7c3ba743cdd80256378933e62d3b0","score":"0.55611205","text":"def dfg; end","title":""},{"docid":"3099942e9264fe15b1ed124fb6b96b9e","score":"0.5560968","text":"def graficas\n end","title":""},{"docid":"9c6f4cbcad027e2f6e9f14886429aa12","score":"0.55605316","text":"def parametros\n end","title":""},{"docid":"df9a1d4dbd3b39eac5a3000bbce83ec6","score":"0.5559363","text":"def empathy\n end","title":""},{"docid":"bd395ef5570ec94ad67ca3120a943fca","score":"0.554774","text":"def operation; end","title":""},{"docid":"bd395ef5570ec94ad67ca3120a943fca","score":"0.554774","text":"def operation; end","title":""},{"docid":"bd395ef5570ec94ad67ca3120a943fca","score":"0.554774","text":"def operation; end","title":""},{"docid":"bd395ef5570ec94ad67ca3120a943fca","score":"0.554774","text":"def operation; end","title":""},{"docid":"1a5b6c527dee05cd5b6d5c6efc90d270","score":"0.5543885","text":"def do_fun_things\n\tend","title":""},{"docid":"26d0f5262045ef7f95f3354d36b383ff","score":"0.55383646","text":"def einfuegen(eltern_knoten_inhalt,inhalt)\n \n end","title":""},{"docid":"9a9a634ddefd651ef7265e2e88fb3886","score":"0.553568","text":"def lblAlgn; end","title":""},{"docid":"f1c41f5481b4c09f0606677974ee60db","score":"0.5526821","text":"def deaf_grandma\n\nend","title":""},{"docid":"5f72dcfb10ab22692ab0f4cd98de8367","score":"0.55206645","text":"def loquesea(r=true); p \"Esto es #{r} -> #{self}\"; end","title":""},{"docid":"ee30af67560d055273e50763d0452dcd","score":"0.55142015","text":"def funcioncita procedimiento\n\tprocedimiento.call\nend","title":""},{"docid":"0fecd0f89af9852a43a867a54f8a2dfc","score":"0.55080664","text":"def nombre_metodo (arg_1 = 28, arg_2 = 56, arg_3)\r\nend","title":""},{"docid":"901b8e1660f1e785754ad3b2f0c96b4f","score":"0.54918426","text":"def linea(indice, valor)\n puts \"el indice: #{indice} y el valor: #{valor}\"\nend","title":""},{"docid":"1d3dd80ebcf872acd4692f5be761501e","score":"0.5490697","text":"def ligar #criando um metodo para a classe\n puts 'O carro está pronto para iniciar seu trajeto'\n end","title":""},{"docid":"698c8107f6e7cf4186c2527fe4ee2fa4","score":"0.549064","text":"def mehtod3\n\t\t#...\n\tend","title":""},{"docid":"a7afbdc056e1719e9c4632bebf3dcb97","score":"0.54819024","text":"def drawing_function\n #get the last entry\n func=\"example(#{@refresh})\"\n return func\n end","title":""},{"docid":"ddd91317b870108b5b44d5ea86ce511c","score":"0.5475178","text":"def areascanning\n end","title":""},{"docid":"75dac23d7b2468ef698989b31f97dbca","score":"0.5468774","text":"def envoyerIndice\n\t\tif @nbUtilisation < @nbMax\n\t\t\t@nbUtilisation += 1\n\t\t\tposition = 0\n\t\t\tsomme = 0\n\t\t\tmax = 0\n\t\t\tside = @map.side\n\t\t\ttop = @map.top\n\t\t\ti = 0\n\t\t\tj = 0\n\n\t\t\t# calcule le max sur les lignes\n\t\t\tfor row in side do\n\t\t\t\t#somme = somme des chiffres present sur la ligne \"side\"\n\n\t\t\t somme = row.inject(:+)\n if somme == nil\n somme = 0\n end\n\n\t\t\t\tif somme > max\n\t\t\t\t\tmax = somme\n\t\t\t\t\tposition = i\n\t\t\t\t\t@orientation = false\n\t\t\t\tend\n\t\t\t\ti+=1\n\t\t\tend\n\n\t\t\t# calcule le max sur les colonne\n\t\t\tfor col in top do\n\t\t\t\t#somme = somme des chiffres present sur la colonne \"top\"\n\n\t\t\t somme = col.inject(:+)\n\n if somme == nil\n somme = 0\n end\n\t\t\t\tif somme > max\n\t\t\t\t\tmax = somme\n\t\t\t\t\tposition = j\n\t\t\t\t\t@orientation = true\n\t\t\t\tend\n\t\t\t\tj+=1\n\t\t\tend\n\n\n\t\t\t# affiche le plus gros chiffre avec son indice si c'est une ligne\n\t\t\tif !@orientation\n\t\t\t\t@indice = \"La ligne #{position+1} possede le plus gros chiffre qui est #{max}\\n\"\n\t\t\tend\n\n\t\t\t# affiche le plus gros chiffre avec son indice si c'est une colonne\n\t\t\tif @orientation\n\t\t\t\t@indice = \"La colonne #{position+1} possede le plus gros chiffre qui est #{max}\\n\"\n\t\t\tend\n\n\t\telse\n\t\t\t@indice = \"Nombre d'utilisation maximum de cet indice atteint.\"\n\t\tend\n\n\t\treturn self\n\n\tend","title":""},{"docid":"e1052458e1b0cf0a48fe1e004c3d4557","score":"0.5454751","text":"def chokra_hearer(lorenzenite)\n end","title":""},{"docid":"7ec57c3874853e50086febdbdd3221bf","score":"0.54535586","text":"def wedding; end","title":""},{"docid":"018d9e291884d269a55361aee289ca52","score":"0.5450158","text":"def afficher()\n\t\tretour = EventBoxModifParagraphe.new()\n\t\t\r\n\t\tif(@reference==0)\r\n\t\t\tretour.changerTexte(\"- #{@partie.titre}, commentaire #{@numero}\\n#{@auteur.nom} dit : #{@texte}\")\r\n\t\telse\r\n\t\t\tretour.changerTexte(\"- #{@partie.titre}, commentaire #{@numero} (en référence au commentaire #{@reference})\\n#{@auteur.nom} dit : #{@texte}\")\r\n\t\tend\r\n\t\tretour.contenu = self\n\t\tretour.modify_bg(Gtk::STATE_NORMAL, COULEUR_DESELECTIONNE)\n\t\treturn retour\r\n\tend","title":""},{"docid":"9233c16427287bb7c725224191883e21","score":"0.5448628","text":"def ablegen(pos)\n @ablage += @feld.ablegen(pos)\n end","title":""},{"docid":"f48249c7165e826e6d9992b83653b96b","score":"0.54401153","text":"def custom\n\n end","title":""},{"docid":"bdbe26de72c891cd17ad29ae94be154c","score":"0.5431744","text":"def displace(left, top)\n \n end","title":""},{"docid":"53f58d7029093f2c71db6d01e2d19b86","score":"0.5431238","text":"def fancy\r\n movement1\r\nend","title":""},{"docid":"c264b3fffa3fead03b7caaf78765acf9","score":"0.54308","text":"def referee\nend","title":""},{"docid":"35ea4b9d39567e00d4f1fffbfbf55e71","score":"0.5421724","text":"def top_three\r\n\tend","title":""},{"docid":"995b915898e500cc112b42e009bf205d","score":"0.5414587","text":"def nwo; end","title":""},{"docid":"995b915898e500cc112b42e009bf205d","score":"0.5414587","text":"def nwo; end","title":""},{"docid":"d38af79f8eb02e4e78397602c3fe4c1f","score":"0.541265","text":"def adds; end","title":""}],"string":"[\n {\n \"docid\": \"9da75f38bbbf324b100402649a37d15c\",\n \"score\": \"0.6783748\",\n \"text\": \"def studliga\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4fe655da88e61d28e8b9a9ed964af838\",\n \"score\": \"0.6641103\",\n \"text\": \"def imprensa\\n\\t\\t\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"26da328e8cf814fdc197fd2d301c3d2b\",\n \"score\": \"0.648012\",\n \"text\": \"def flipx\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"06fd3a231d28f23a18f53100267107bb\",\n \"score\": \"0.63873506\",\n \"text\": \"def graj (wykonaj)\\n\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fa686cdf1942762f7041d1fb7b0aacb0\",\n \"score\": \"0.62652797\",\n \"text\": \"def comofunciona\\n\\t\\t\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a9dd648a5d0d2e7d56223e7c753f5e2e\",\n \"score\": \"0.6264508\",\n \"text\": \"def telegraphical()\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1151221aa9457e5cad317e4fec922758\",\n \"score\": \"0.61925215\",\n \"text\": \"def adjugate; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0939406b2108b4dcfeb32a0ce912e9dd\",\n \"score\": \"0.61917436\",\n \"text\": \"def\\thustle \\t \\t\\r\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"792be6eadacebdee265be975baeda2c7\",\n \"score\": \"0.6190803\",\n \"text\": \"def function; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d3f89244d8879e46d0688468f064d0f\",\n \"score\": \"0.61588943\",\n \"text\": \"def alta_vista\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c298ed47fde79a7b75554db439cce32\",\n \"score\": \"0.6115309\",\n \"text\": \"def ho()\\n\\t#TODO\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"47fa14e987305bb793373e857d69a0ff\",\n \"score\": \"0.6086414\",\n \"text\": \"def politica\\n\\t\\t\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"37dd51a636bd4f92c4c4bdb82296b191\",\n \"score\": \"0.59868693\",\n \"text\": \"def frizz_pharmacolite_triaconter()\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"54a53621e5fd3fc0cc3d2ff2901a893e\",\n \"score\": \"0.59841996\",\n \"text\": \"def chazelle\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"90820bf0e60e0f8091b77d4e756ed17c\",\n \"score\": \"0.5956013\",\n \"text\": \"def gl; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3b44e74011cfcd34dc256b97e904f715\",\n \"score\": \"0.59519756\",\n \"text\": \"def hacer_ruido\\n\\t\\treturn super << \\\"miauuuu!\\\"\\n\\t\\t\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c512d3086c54cb450c944eacc9c75f27\",\n \"score\": \"0.59397554\",\n \"text\": \"def busca_conta\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8d0e128ad87cd20a86507c09c46a6f67\",\n \"score\": \"0.5899578\",\n \"text\": \"def termitidae()\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"480058405628030c64c41b76f2f0a400\",\n \"score\": \"0.5895721\",\n \"text\": \"def tr; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5f2263808382a77bc1221f752b8165d9\",\n \"score\": \"0.58593667\",\n \"text\": \"def opweg\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"721d1d99e045fda0c14e7d425b06ffb0\",\n \"score\": \"0.58591396\",\n \"text\": \"def g(*) end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"721d1d99e045fda0c14e7d425b06ffb0\",\n \"score\": \"0.58591396\",\n \"text\": \"def g(*) end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b2aab3097a5cbdb221461b6e7c701666\",\n \"score\": \"0.58338004\",\n \"text\": \"def horizontal; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"04e074efc99de627ea58633a58870ec3\",\n \"score\": \"0.58206344\",\n \"text\": \"def stpreason\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"67081eb3c98dc9ab87bd978f73a10e81\",\n \"score\": \"0.58196187\",\n \"text\": \"def advanced; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"67081eb3c98dc9ab87bd978f73a10e81\",\n \"score\": \"0.58196187\",\n \"text\": \"def advanced; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7f5073ed8a81fec00b09ae99ac8f7c94\",\n \"score\": \"0.58126324\",\n \"text\": \"def additions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"50fd4af1f4f8df184d6ad35e37e8f6a1\",\n \"score\": \"0.5810276\",\n \"text\": \"def autre_method\\n puts \\\"methode privee\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"faac832a08ae266cff71f0004a0c9e91\",\n \"score\": \"0.579979\",\n \"text\": \"def life_line\\n\\t\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2dbabd0eeb642c38aad852e40fc6aca7\",\n \"score\": \"0.5780465\",\n \"text\": \"def operations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2dbabd0eeb642c38aad852e40fc6aca7\",\n \"score\": \"0.5780465\",\n \"text\": \"def operations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bc658f9936671408e02baa884ac86390\",\n \"score\": \"0.5778657\",\n \"text\": \"def anchored; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"97ae8249fb30ed859b3cfb702306b92a\",\n \"score\": \"0.5776513\",\n \"text\": \"def nombre_metodo (arg_3, arg_1 = 28, arg_2 = 56)\\r\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ef9557994d92c292d62c7a3d9be97d15\",\n \"score\": \"0.5767654\",\n \"text\": \"def kontakt\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3438e0cf3a421348424af74f8f11d3bd\",\n \"score\": \"0.5763585\",\n \"text\": \"def afficher()\\n if(@contenu == nil)\\n print(\\\"·\\\")\\n else\\n @contenu.afficher()\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ac6897a2939ef77c2e788280bd530d7f\",\n \"score\": \"0.5755237\",\n \"text\": \"def aniversario\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e28593026497a2baf9c546a2da299bf7\",\n \"score\": \"0.5721054\",\n \"text\": \"def nonstpreason\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"40769f9969d33ad71cb2389a7e574114\",\n \"score\": \"0.5721019\",\n \"text\": \"def institucional\\n\\t\\t\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d509f8cefdd8fc87fefabff3705478b5\",\n \"score\": \"0.57184803\",\n \"text\": \"def custom\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a7c3ff6e9a70757ad110a0a6920415c1\",\n \"score\": \"0.57168627\",\n \"text\": \"def boruvka\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7477f36427db1eed71e3d1fe5ae5eb83\",\n \"score\": \"0.57138413\",\n \"text\": \"def manuver\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5be3efd31b567fcbb0296b587a686bf5\",\n \"score\": \"0.5712158\",\n \"text\": \"def add_func(name)\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"da32862891e2ebc3c8d71f65524bb4c1\",\n \"score\": \"0.5698983\",\n \"text\": \"def prosa\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"da32862891e2ebc3c8d71f65524bb4c1\",\n \"score\": \"0.5698983\",\n \"text\": \"def prosa\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2181cc4c08c7cfcbb50f79ca20ab0c63\",\n \"score\": \"0.5685759\",\n \"text\": \"def LIN04=(arg)\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53ecaf66b6feee85613ba3463552494f\",\n \"score\": \"0.5663743\",\n \"text\": \"def LIN05=(arg)\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9e549dd6d023d0b3c4c5564e8fa79c08\",\n \"score\": \"0.5659995\",\n \"text\": \"def add_ingrediant\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"48d178de14ed4126080f70b61652dd6d\",\n \"score\": \"0.5658408\",\n \"text\": \"def fOOrth\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"48d178de14ed4126080f70b61652dd6d\",\n \"score\": \"0.5658408\",\n \"text\": \"def fOOrth\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"15bdaa14d2d72a48cac4eb0721a51da8\",\n \"score\": \"0.5651282\",\n \"text\": \"def LIN03=(arg)\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0f4fb165548b4d7ab8c74f1e99d3f784\",\n \"score\": \"0.56495374\",\n \"text\": \"def stahp\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3caf4c824a6d6a4a5616c13fcab418da\",\n \"score\": \"0.5636217\",\n \"text\": \"def applied; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"871ec6288b069a405aae843577098ab9\",\n \"score\": \"0.5630487\",\n \"text\": \"def oportunidade\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4bfa7ceb1aecd6a651eb94fcea3f4959\",\n \"score\": \"0.5619569\",\n \"text\": \"def inline; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4bfa7ceb1aecd6a651eb94fcea3f4959\",\n \"score\": \"0.5619569\",\n \"text\": \"def inline; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"333dfdc13e90ef65e949135e7e4cf80a\",\n \"score\": \"0.56055784\",\n \"text\": \"def pag1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9a672a46158c47dbad9e387558200c76\",\n \"score\": \"0.5602673\",\n \"text\": \"def span; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"974e51f644bf69638b2748167c5532a9\",\n \"score\": \"0.5598541\",\n \"text\": \"def vocal_en_nombre_piloto(pilotos) \\n\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3bcde409a5e247ad3cd027b9f7e2b5d5\",\n \"score\": \"0.55965585\",\n \"text\": \"def lbl_algn; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"52ff1971a3d15dcbf952f4206e115956\",\n \"score\": \"0.5587151\",\n \"text\": \"def hacer_ruido\\n\\t\\treturn super\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"11731a5a3243408f29627ae9ed59e1ed\",\n \"score\": \"0.5582894\",\n \"text\": \"def paradox\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2e917f10b0e8882acb01390833f6e570\",\n \"score\": \"0.557673\",\n \"text\": \"def LIN02=(arg)\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d80084ab79c11756e15065daa5044b1\",\n \"score\": \"0.55765414\",\n \"text\": \"def comprobar\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4a5e2232b07ff1c71d9e1e5f711a8871\",\n \"score\": \"0.5573553\",\n \"text\": \"def griser() \\n\\t\\t@etat = 2\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b882d5efe783080b52fcda674ce4a9ed\",\n \"score\": \"0.55716044\",\n \"text\": \"def meu_metodo\\n -> () { return \\\"return dentro da lamb\\\" }.call\\n return \\\"\\\\nReturn do método fora da lamb \\\" #a lamb sempre retorna o valor do return após o call\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c9190bec591e0d8bcffbea3e5e4fda2\",\n \"score\": \"0.5568471\",\n \"text\": \"def agence\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8b3b374712fa41dc5dafd45ff7a7d790\",\n \"score\": \"0.55676174\",\n \"text\": \"def smore(vesicoprostatic, unpoached_landaulet, alkes_bilbo)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"91a7c3ba743cdd80256378933e62d3b0\",\n \"score\": \"0.55611205\",\n \"text\": \"def dfg; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"91a7c3ba743cdd80256378933e62d3b0\",\n \"score\": \"0.55611205\",\n \"text\": \"def dfg; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3099942e9264fe15b1ed124fb6b96b9e\",\n \"score\": \"0.5560968\",\n \"text\": \"def graficas\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9c6f4cbcad027e2f6e9f14886429aa12\",\n \"score\": \"0.55605316\",\n \"text\": \"def parametros\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df9a1d4dbd3b39eac5a3000bbce83ec6\",\n \"score\": \"0.5559363\",\n \"text\": \"def empathy\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd395ef5570ec94ad67ca3120a943fca\",\n \"score\": \"0.554774\",\n \"text\": \"def operation; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd395ef5570ec94ad67ca3120a943fca\",\n \"score\": \"0.554774\",\n \"text\": \"def operation; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd395ef5570ec94ad67ca3120a943fca\",\n \"score\": \"0.554774\",\n \"text\": \"def operation; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd395ef5570ec94ad67ca3120a943fca\",\n \"score\": \"0.554774\",\n \"text\": \"def operation; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1a5b6c527dee05cd5b6d5c6efc90d270\",\n \"score\": \"0.5543885\",\n \"text\": \"def do_fun_things\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"26d0f5262045ef7f95f3354d36b383ff\",\n \"score\": \"0.55383646\",\n \"text\": \"def einfuegen(eltern_knoten_inhalt,inhalt)\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9a9a634ddefd651ef7265e2e88fb3886\",\n \"score\": \"0.553568\",\n \"text\": \"def lblAlgn; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1c41f5481b4c09f0606677974ee60db\",\n \"score\": \"0.5526821\",\n \"text\": \"def deaf_grandma\\n\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5f72dcfb10ab22692ab0f4cd98de8367\",\n \"score\": \"0.55206645\",\n \"text\": \"def loquesea(r=true); p \\\"Esto es #{r} -> #{self}\\\"; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee30af67560d055273e50763d0452dcd\",\n \"score\": \"0.55142015\",\n \"text\": \"def funcioncita procedimiento\\n\\tprocedimiento.call\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0fecd0f89af9852a43a867a54f8a2dfc\",\n \"score\": \"0.55080664\",\n \"text\": \"def nombre_metodo (arg_1 = 28, arg_2 = 56, arg_3)\\r\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"901b8e1660f1e785754ad3b2f0c96b4f\",\n \"score\": \"0.54918426\",\n \"text\": \"def linea(indice, valor)\\n puts \\\"el indice: #{indice} y el valor: #{valor}\\\"\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d3dd80ebcf872acd4692f5be761501e\",\n \"score\": \"0.5490697\",\n \"text\": \"def ligar #criando um metodo para a classe\\n puts 'O carro está pronto para iniciar seu trajeto'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"698c8107f6e7cf4186c2527fe4ee2fa4\",\n \"score\": \"0.549064\",\n \"text\": \"def mehtod3\\n\\t\\t#...\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a7afbdc056e1719e9c4632bebf3dcb97\",\n \"score\": \"0.54819024\",\n \"text\": \"def drawing_function\\n #get the last entry\\n func=\\\"example(#{@refresh})\\\"\\n return func\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ddd91317b870108b5b44d5ea86ce511c\",\n \"score\": \"0.5475178\",\n \"text\": \"def areascanning\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"75dac23d7b2468ef698989b31f97dbca\",\n \"score\": \"0.5468774\",\n \"text\": \"def envoyerIndice\\n\\t\\tif @nbUtilisation < @nbMax\\n\\t\\t\\t@nbUtilisation += 1\\n\\t\\t\\tposition = 0\\n\\t\\t\\tsomme = 0\\n\\t\\t\\tmax = 0\\n\\t\\t\\tside = @map.side\\n\\t\\t\\ttop = @map.top\\n\\t\\t\\ti = 0\\n\\t\\t\\tj = 0\\n\\n\\t\\t\\t# calcule le max sur les lignes\\n\\t\\t\\tfor row in side do\\n\\t\\t\\t\\t#somme = somme des chiffres present sur la ligne \\\"side\\\"\\n\\n\\t\\t\\t somme = row.inject(:+)\\n if somme == nil\\n somme = 0\\n end\\n\\n\\t\\t\\t\\tif somme > max\\n\\t\\t\\t\\t\\tmax = somme\\n\\t\\t\\t\\t\\tposition = i\\n\\t\\t\\t\\t\\t@orientation = false\\n\\t\\t\\t\\tend\\n\\t\\t\\t\\ti+=1\\n\\t\\t\\tend\\n\\n\\t\\t\\t# calcule le max sur les colonne\\n\\t\\t\\tfor col in top do\\n\\t\\t\\t\\t#somme = somme des chiffres present sur la colonne \\\"top\\\"\\n\\n\\t\\t\\t somme = col.inject(:+)\\n\\n if somme == nil\\n somme = 0\\n end\\n\\t\\t\\t\\tif somme > max\\n\\t\\t\\t\\t\\tmax = somme\\n\\t\\t\\t\\t\\tposition = j\\n\\t\\t\\t\\t\\t@orientation = true\\n\\t\\t\\t\\tend\\n\\t\\t\\t\\tj+=1\\n\\t\\t\\tend\\n\\n\\n\\t\\t\\t# affiche le plus gros chiffre avec son indice si c'est une ligne\\n\\t\\t\\tif !@orientation\\n\\t\\t\\t\\t@indice = \\\"La ligne #{position+1} possede le plus gros chiffre qui est #{max}\\\\n\\\"\\n\\t\\t\\tend\\n\\n\\t\\t\\t# affiche le plus gros chiffre avec son indice si c'est une colonne\\n\\t\\t\\tif @orientation\\n\\t\\t\\t\\t@indice = \\\"La colonne #{position+1} possede le plus gros chiffre qui est #{max}\\\\n\\\"\\n\\t\\t\\tend\\n\\n\\t\\telse\\n\\t\\t\\t@indice = \\\"Nombre d'utilisation maximum de cet indice atteint.\\\"\\n\\t\\tend\\n\\n\\t\\treturn self\\n\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e1052458e1b0cf0a48fe1e004c3d4557\",\n \"score\": \"0.5454751\",\n \"text\": \"def chokra_hearer(lorenzenite)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7ec57c3874853e50086febdbdd3221bf\",\n \"score\": \"0.54535586\",\n \"text\": \"def wedding; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"018d9e291884d269a55361aee289ca52\",\n \"score\": \"0.5450158\",\n \"text\": \"def afficher()\\n\\t\\tretour = EventBoxModifParagraphe.new()\\n\\t\\t\\r\\n\\t\\tif(@reference==0)\\r\\n\\t\\t\\tretour.changerTexte(\\\"- #{@partie.titre}, commentaire #{@numero}\\\\n#{@auteur.nom} dit : #{@texte}\\\")\\r\\n\\t\\telse\\r\\n\\t\\t\\tretour.changerTexte(\\\"- #{@partie.titre}, commentaire #{@numero} (en référence au commentaire #{@reference})\\\\n#{@auteur.nom} dit : #{@texte}\\\")\\r\\n\\t\\tend\\r\\n\\t\\tretour.contenu = self\\n\\t\\tretour.modify_bg(Gtk::STATE_NORMAL, COULEUR_DESELECTIONNE)\\n\\t\\treturn retour\\r\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9233c16427287bb7c725224191883e21\",\n \"score\": \"0.5448628\",\n \"text\": \"def ablegen(pos)\\n @ablage += @feld.ablegen(pos)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f48249c7165e826e6d9992b83653b96b\",\n \"score\": \"0.54401153\",\n \"text\": \"def custom\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bdbe26de72c891cd17ad29ae94be154c\",\n \"score\": \"0.5431744\",\n \"text\": \"def displace(left, top)\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53f58d7029093f2c71db6d01e2d19b86\",\n \"score\": \"0.5431238\",\n \"text\": \"def fancy\\r\\n movement1\\r\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c264b3fffa3fead03b7caaf78765acf9\",\n \"score\": \"0.54308\",\n \"text\": \"def referee\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"35ea4b9d39567e00d4f1fffbfbf55e71\",\n \"score\": \"0.5421724\",\n \"text\": \"def top_three\\r\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"995b915898e500cc112b42e009bf205d\",\n \"score\": \"0.5414587\",\n \"text\": \"def nwo; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"995b915898e500cc112b42e009bf205d\",\n \"score\": \"0.5414587\",\n \"text\": \"def nwo; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d38af79f8eb02e4e78397602c3fe4c1f\",\n \"score\": \"0.541265\",\n \"text\": \"def adds; end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":175,"cells":{"query_id":{"kind":"string","value":"2a676f9f69092e36b06920d145b10267"},"query":{"kind":"string","value":"Get the tags for this learner Get the tags for this learner"},"positive_passages":{"kind":"list like","value":[{"docid":"ea6ac834eef2f4185ddb3aad73d82a63","score":"0.0","text":"def get_learner_tags_with_http_info(learner_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LearnerApi.get_learner_tags ...'\n end\n # verify the required parameter 'learner_id' is set\n if @api_client.config.client_side_validation && learner_id.nil?\n fail ArgumentError, \"Missing the required parameter 'learner_id' when calling LearnerApi.get_learner_tags\"\n end\n # resource path\n local_var_path = '/learner/{learnerId}/tags'.sub('{' + 'learnerId' + '}', learner_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['APP_NORMAL', 'OAUTH']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'TagListSchema')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LearnerApi#get_learner_tags\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end","title":""}],"string":"[\n {\n \"docid\": \"ea6ac834eef2f4185ddb3aad73d82a63\",\n \"score\": \"0.0\",\n \"text\": \"def get_learner_tags_with_http_info(learner_id, opts = {})\\n if @api_client.config.debugging\\n @api_client.config.logger.debug 'Calling API: LearnerApi.get_learner_tags ...'\\n end\\n # verify the required parameter 'learner_id' is set\\n if @api_client.config.client_side_validation && learner_id.nil?\\n fail ArgumentError, \\\"Missing the required parameter 'learner_id' when calling LearnerApi.get_learner_tags\\\"\\n end\\n # resource path\\n local_var_path = '/learner/{learnerId}/tags'.sub('{' + 'learnerId' + '}', learner_id.to_s)\\n\\n # query parameters\\n query_params = {}\\n\\n # header parameters\\n header_params = {}\\n # HTTP header 'Accept' (if needed)\\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\\n # HTTP header 'Content-Type'\\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\\n\\n # form parameters\\n form_params = {}\\n\\n # http body (model)\\n post_body = nil\\n auth_names = ['APP_NORMAL', 'OAUTH']\\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\\n :header_params => header_params,\\n :query_params => query_params,\\n :form_params => form_params,\\n :body => post_body,\\n :auth_names => auth_names,\\n :return_type => 'TagListSchema')\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"API called: LearnerApi#get_learner_tags\\\\nData: #{data.inspect}\\\\nStatus code: #{status_code}\\\\nHeaders: #{headers}\\\"\\n end\\n return data, status_code, headers\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"36bdb481d6be054bd773cd960d3c2a46","score":"0.7348168","text":"def tags\n return @tags\n end","title":""},{"docid":"36bdb481d6be054bd773cd960d3c2a46","score":"0.7348168","text":"def tags\n return @tags\n end","title":""},{"docid":"36bdb481d6be054bd773cd960d3c2a46","score":"0.7348168","text":"def tags\n return @tags\n end","title":""},{"docid":"36bdb481d6be054bd773cd960d3c2a46","score":"0.7348168","text":"def tags\n return @tags\n end","title":""},{"docid":"36bdb481d6be054bd773cd960d3c2a46","score":"0.7348168","text":"def tags\n return @tags\n end","title":""},{"docid":"36bdb481d6be054bd773cd960d3c2a46","score":"0.7348168","text":"def tags\n return @tags\n end","title":""},{"docid":"df01d0cdbe7fea294d98466f7ce2e62d","score":"0.7307032","text":"def tags\n @tags\n end","title":""},{"docid":"df01d0cdbe7fea294d98466f7ce2e62d","score":"0.7307032","text":"def tags\n @tags\n end","title":""},{"docid":"df01d0cdbe7fea294d98466f7ce2e62d","score":"0.7307032","text":"def tags\n @tags\n end","title":""},{"docid":"df01d0cdbe7fea294d98466f7ce2e62d","score":"0.7307032","text":"def tags\n @tags\n end","title":""},{"docid":"df01d0cdbe7fea294d98466f7ce2e62d","score":"0.7306311","text":"def tags\n @tags\n end","title":""},{"docid":"df01d0cdbe7fea294d98466f7ce2e62d","score":"0.7305405","text":"def tags\n @tags\n end","title":""},{"docid":"df01d0cdbe7fea294d98466f7ce2e62d","score":"0.7305405","text":"def tags\n @tags\n end","title":""},{"docid":"09f6d3f4cc66a0fe32de98013823b493","score":"0.72984034","text":"def tags\n @tags ||= extract_tags\n end","title":""},{"docid":"7a3ccb8c3068fbe3571ff24ed876199b","score":"0.7159164","text":"def get_tags()\n self.tags.collect { |t| t.value }\n end","title":""},{"docid":"2f62e9e17a340e9782c8e7c5cac06188","score":"0.71341336","text":"def tag_names\n @tags\n end","title":""},{"docid":"4efd2804143fd289c5ec214f18c12701","score":"0.7125448","text":"def tags\n @tags ||= get_tags.my_tags\n end","title":""},{"docid":"68421f14e2c7656246da1046f9cdb81d","score":"0.7110464","text":"def get_tags\n\ttags = self.tags.map do |tag|\n\t\ttag.tag.to_s\n\tend\n end","title":""},{"docid":"1d797c1cb186dfb4d79bc25fba632fc1","score":"0.70753455","text":"def tags\n @tags\n end","title":""},{"docid":"935136d8c6742e3fa0519995da1f1722","score":"0.7062395","text":"def tags\n attributes.fetch(:tags)\n end","title":""},{"docid":"935136d8c6742e3fa0519995da1f1722","score":"0.7062395","text":"def tags\n attributes.fetch(:tags)\n end","title":""},{"docid":"935136d8c6742e3fa0519995da1f1722","score":"0.7062395","text":"def tags\n attributes.fetch(:tags)\n end","title":""},{"docid":"935136d8c6742e3fa0519995da1f1722","score":"0.7062395","text":"def tags\n attributes.fetch(:tags)\n end","title":""},{"docid":"935136d8c6742e3fa0519995da1f1722","score":"0.7062395","text":"def tags\n attributes.fetch(:tags)\n end","title":""},{"docid":"8e22367df4c27a9a35e639d718055273","score":"0.7049181","text":"def get_tags\n @n_tags = true\n return @m_tags\n end","title":""},{"docid":"8e22367df4c27a9a35e639d718055273","score":"0.7049181","text":"def get_tags\n @n_tags = true\n return @m_tags\n end","title":""},{"docid":"8e22367df4c27a9a35e639d718055273","score":"0.7049181","text":"def get_tags\n @n_tags = true\n return @m_tags\n end","title":""},{"docid":"8e22367df4c27a9a35e639d718055273","score":"0.7049181","text":"def get_tags\n @n_tags = true\n return @m_tags\n end","title":""},{"docid":"8e22367df4c27a9a35e639d718055273","score":"0.7049181","text":"def get_tags\n @n_tags = true\n return @m_tags\n end","title":""},{"docid":"8e22367df4c27a9a35e639d718055273","score":"0.7049181","text":"def get_tags\n @n_tags = true\n return @m_tags\n end","title":""},{"docid":"751e2168b98120955cc83438ce0897ff","score":"0.7044439","text":"def tags\n @@tags\n end","title":""},{"docid":"2a4294b51dea4bad1f824234dc2a37f2","score":"0.7039024","text":"def tags\n @ni.tag_set\n end","title":""},{"docid":"27a9e748e12ae40d9280bf00c215fb6a","score":"0.6986146","text":"def tags\n attributes[:tags] || []\n end","title":""},{"docid":"680f08d1644986bca7c9956d92094846","score":"0.69684774","text":"def tags\n @rtb.tags\n end","title":""},{"docid":"5706a7c5bd9b99da4accb0a9b2e5e6f9","score":"0.6946327","text":"def tags\n @igw.tags\n end","title":""},{"docid":"0de3e524d0755c3075534482f6f32149","score":"0.6921787","text":"def tags\n @data['tags']\n end","title":""},{"docid":"4dbde3487fb2a152f7dc46a8e99bb391","score":"0.6914","text":"def tag_list\n @@tags\n end","title":""},{"docid":"74621555a7699ca49fb787184dae5ebb","score":"0.6898488","text":"def get_question_tags\n Question.get_tags_from_users(self)\n end","title":""},{"docid":"9cebf6abefd22a6f219dd88e475a2568","score":"0.6869984","text":"def tags\n data.tags\n end","title":""},{"docid":"9cebf6abefd22a6f219dd88e475a2568","score":"0.6869984","text":"def tags\n data.tags\n end","title":""},{"docid":"9cebf6abefd22a6f219dd88e475a2568","score":"0.6869984","text":"def tags\n data.tags\n end","title":""},{"docid":"9cebf6abefd22a6f219dd88e475a2568","score":"0.6869984","text":"def tags\n data.tags\n end","title":""},{"docid":"d5760d7f661800379e21e92aae8f105f","score":"0.6851924","text":"def tag_list\r\n @@tags\r\n end","title":""},{"docid":"daca309b99df1d54d63033258b65c4d8","score":"0.684187","text":"def tags()\n @tags ||= get(\"/tags/all.json\").map {|x| Tag.new(x[\"tag\"])}\n end","title":""},{"docid":"c771b7c65e1995e863ab27b9b4ae4e4b","score":"0.68350744","text":"def tags\n\t\treturn (@tags || {}).keys\n\tend","title":""},{"docid":"4d1e2cbdc95c5051def718b610bff677","score":"0.6832867","text":"def tags\n data[:tags]\n end","title":""},{"docid":"4d1e2cbdc95c5051def718b610bff677","score":"0.6832867","text":"def tags\n data[:tags]\n end","title":""},{"docid":"4d1e2cbdc95c5051def718b610bff677","score":"0.6832867","text":"def tags\n data[:tags]\n end","title":""},{"docid":"4d1e2cbdc95c5051def718b610bff677","score":"0.6832867","text":"def tags\n data[:tags]\n end","title":""},{"docid":"4d1e2cbdc95c5051def718b610bff677","score":"0.6832867","text":"def tags\n data[:tags]\n end","title":""},{"docid":"4d1e2cbdc95c5051def718b610bff677","score":"0.6832867","text":"def tags\n data[:tags]\n end","title":""},{"docid":"cc2edff9da108268955195060c2213e8","score":"0.6803613","text":"def tags\n parsed {\n @tags\n }\n end","title":""},{"docid":"6352dce1681b9c532aed745777ccbebd","score":"0.68003726","text":"def tag_list\n tags.map(&:tag)\n end","title":""},{"docid":"d585a99dd959a7e272e2045e0eea5b9f","score":"0.6767606","text":"def tags\n @tags ||= Tags.new(force: false)\n @tags.names\n end","title":""},{"docid":"a75988ff7ac977dac84f0fe4f9cdbc77","score":"0.67580944","text":"def get_learner_tags(learner_id, opts = {})\n data, _status_code, _headers = get_learner_tags_with_http_info(learner_id, opts)\n data\n end","title":""},{"docid":"34803cba3a7d478259c8efce40601f4e","score":"0.6754768","text":"def all_tags_list\n tags.pluck(:name)\n end","title":""},{"docid":"8a2f461b645f03872a258c69b4d51de4","score":"0.67474675","text":"def tags\n read\n @tags\n end","title":""},{"docid":"7497305703b8841fc9c3d6a8fb909e6c","score":"0.67370987","text":"def tags\n get_tags_for_current_user\n end","title":""},{"docid":"791dfbb236713e4382e79f9493bcf1c0","score":"0.6730329","text":"def tags\n return self['tagReferences'].collect{ |tag_reference| tag_reference['tag']['name'] }\n end","title":""},{"docid":"29cca51334f5412bb0a89ac99caa048c","score":"0.67271507","text":"def tag_names\n tags.map(&:name)\n end","title":""},{"docid":"e696bc3d2bf740a81f7598db7e2454c7","score":"0.67245847","text":"def tags\n get_collection 'tags', :class => Buxfer::Tag\n end","title":""},{"docid":"33109f57c2521c7a45454a93dcdd32a6","score":"0.67239624","text":"def tag_names\n rugged.tags.map { |t| t.name }\n end","title":""},{"docid":"5a44b679640dd114bd932c08ce5b86ce","score":"0.6711113","text":"def tag_names\n @tag_names = self.tags.map do |tag|\n tag.name\n end\n end","title":""},{"docid":"5ad47e4e73e07ea2958e5f022cbbb171","score":"0.6706748","text":"def language_tags\n return @language_tags\n end","title":""},{"docid":"56163d23bc897cc748b09c7a13ef9671","score":"0.6696279","text":"def tags\n self.lib.tags.map { |r| tag(r) }\n end","title":""},{"docid":"e436f3846355c92058799fae7409456d","score":"0.6687589","text":"def tag_names\n tags.map(&:name)\n end","title":""},{"docid":"e436f3846355c92058799fae7409456d","score":"0.6687589","text":"def tag_names\n tags.map(&:name)\n end","title":""},{"docid":"e436f3846355c92058799fae7409456d","score":"0.6687589","text":"def tag_names\n tags.map(&:name)\n end","title":""},{"docid":"8e2bd149350eaeb3cddfd159784531a1","score":"0.66859543","text":"def interesting_tags\n @interesting_tags_list\n end","title":""},{"docid":"ac1569e7990b452e4cbd52ae82a9d794","score":"0.66833645","text":"def tags\n adapter.tags\n end","title":""},{"docid":"ac1569e7990b452e4cbd52ae82a9d794","score":"0.66833645","text":"def tags\n adapter.tags\n end","title":""},{"docid":"fdc80997bf75e9fd7c2c591f3333521f","score":"0.6669636","text":"def tags\r\n @data[:tags] || []\r\n end","title":""},{"docid":"c5de2b2cae2c2c8a49538caadfd7df2d","score":"0.66653955","text":"def tags\n @_tags ||= Tenk::Tags.new(@_client)\n end","title":""},{"docid":"082e05e8c93d59d3afe66e51e14e3ebe","score":"0.6651701","text":"def tags\n Tag.find_all(self)\n end","title":""},{"docid":"082e05e8c93d59d3afe66e51e14e3ebe","score":"0.6651701","text":"def tags\n Tag.find_all(self)\n end","title":""},{"docid":"2a374e063c657ffe1985e678e6c82932","score":"0.66373867","text":"def tags\n tags_with_counts.keys\n end","title":""},{"docid":"27a1738486db982c56572f0c1f039387","score":"0.66326374","text":"def tags\n scope.tags\n end","title":""},{"docid":"9638ea549877b2f83cb7815f64a51c1e","score":"0.6607598","text":"def tags\n Metamatter::Classification.new(self).tags\n end","title":""},{"docid":"83b0311510452aeab884096ab2a6b07c","score":"0.6601357","text":"def tag_names\n self.tags.map(&:name)\n end","title":""},{"docid":"d0e914f18b1498ca7c79f72c85a058ba","score":"0.6586034","text":"def tags\n @instance.tags\n end","title":""},{"docid":"e211155856ceba15a122464d7f1af95c","score":"0.65466654","text":"def tag_names\n @tag_names ||= tags.map(&:name)\n end","title":""},{"docid":"37cfd059c9ce3f8276320e36909127b4","score":"0.6543643","text":"def get_tags\n me = members(name: self.name)[0]\n me[\"tags\"]\n end","title":""},{"docid":"96b29c4d63de0ff980298063fbaedf08","score":"0.6542209","text":"def tags\n return Tag.where(group_id: self.tag_group_id)\n end","title":""},{"docid":"1689ebd5fe95989eaae2e9027c289277","score":"0.65337783","text":"def tags\n if !@tags\n @tags = results.collect { |r| r.tags }.flatten.uniq\n end\n @tags\n end","title":""},{"docid":"89f9428e449ce34c294c08e23ce9e75b","score":"0.6528922","text":"def tag_names\n tags.collect(&:name)\n end","title":""},{"docid":"31c8fa008a8b914ad2ddc3154e8e62c7","score":"0.6516426","text":"def tags\n @tags ||= []\n end","title":""},{"docid":"f434462d97d4d506b197cd703fb99e22","score":"0.65058166","text":"def tags\n response = get 'tags'\n response.map{|item| Hashie::Mash.new(item)}\n end","title":""},{"docid":"b129b9af0a7b844a8061a8b02808a14e","score":"0.64850205","text":"def tags\n @tags ||= (tagGuids || []).map{|guid| note_store.getTag(guid)}\n end","title":""},{"docid":"7a0907cf0190c8c851a1f81eaec1b237","score":"0.6484346","text":"def tags\n @tags ||= [ *self[ :tag ], *self[ :tags ] ]\n end","title":""},{"docid":"2e4361999c7295690ec05a02603bc137","score":"0.6475948","text":"def tag\n\t\ttags\n\tend","title":""},{"docid":"2b76495b30e27cbfd0b367209a89e1de","score":"0.6465764","text":"def tags\n if new?\n @fake_tags || []\n else\n @tags ||= tags_dataset.all\n end\n end","title":""},{"docid":"6522611d283102403a08baccee1a8819","score":"0.64576787","text":"def tag_list\n\t\tself.tags.collect do |tag|\n\t\t\ttag.name\n\t\tend.join(\", \") #Convert tag objects to array of tag names\n\tend","title":""},{"docid":"73dd03f8777437c933eb6cce7fcc17dc","score":"0.64549154","text":"def get_all_tags\n self.tags.map(&:name).join(\", \")\n end","title":""},{"docid":"6960d9998dc8a0e79686abd692202541","score":"0.6450626","text":"def tags\n return @tags if @tags\n tagz = self.tag.split(/([\\w\\d]+)|\"([\\w \\d]+)\"/)\n tagz.delete(' ')\n tagz.delete('')\n @tags = tagz\n end","title":""},{"docid":"010bf97443d9f7f750f13f43650ff795","score":"0.64454365","text":"def tags\n @tags = results.collect(&:tags).flatten.uniq unless @tags\n @tags\n end","title":""},{"docid":"fd94dbdd4d09b45e07a493dcf47eba6f","score":"0.64432895","text":"def get_tags\n self.tags.split(',')\n end","title":""},{"docid":"e88739a08ee992466efb38581b8f2b11","score":"0.6430377","text":"def tags\n @parser.tags\n end","title":""},{"docid":"8fd4791bc2d4a97ad685db1bbd1bf225","score":"0.64282197","text":"def tags\n @tags ||= vcs.tags\n end","title":""},{"docid":"8fd4791bc2d4a97ad685db1bbd1bf225","score":"0.64282197","text":"def tags\n @tags ||= vcs.tags\n end","title":""},{"docid":"a4547717c9804d79ee4db434521e11a7","score":"0.640562","text":"def tags\n obj[12]\n end","title":""},{"docid":"64de850ef60a7321d121c944acff2514","score":"0.640552","text":"def tags\n attributes[:tags].split(',').map(&:strip)\n end","title":""}],"string":"[\n {\n \"docid\": \"36bdb481d6be054bd773cd960d3c2a46\",\n \"score\": \"0.7348168\",\n \"text\": \"def tags\\n return @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36bdb481d6be054bd773cd960d3c2a46\",\n \"score\": \"0.7348168\",\n \"text\": \"def tags\\n return @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36bdb481d6be054bd773cd960d3c2a46\",\n \"score\": \"0.7348168\",\n \"text\": \"def tags\\n return @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36bdb481d6be054bd773cd960d3c2a46\",\n \"score\": \"0.7348168\",\n \"text\": \"def tags\\n return @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36bdb481d6be054bd773cd960d3c2a46\",\n \"score\": \"0.7348168\",\n \"text\": \"def tags\\n return @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36bdb481d6be054bd773cd960d3c2a46\",\n \"score\": \"0.7348168\",\n \"text\": \"def tags\\n return @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df01d0cdbe7fea294d98466f7ce2e62d\",\n \"score\": \"0.7307032\",\n \"text\": \"def tags\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df01d0cdbe7fea294d98466f7ce2e62d\",\n \"score\": \"0.7307032\",\n \"text\": \"def tags\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df01d0cdbe7fea294d98466f7ce2e62d\",\n \"score\": \"0.7307032\",\n \"text\": \"def tags\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df01d0cdbe7fea294d98466f7ce2e62d\",\n \"score\": \"0.7307032\",\n \"text\": \"def tags\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df01d0cdbe7fea294d98466f7ce2e62d\",\n \"score\": \"0.7306311\",\n \"text\": \"def tags\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df01d0cdbe7fea294d98466f7ce2e62d\",\n \"score\": \"0.7305405\",\n \"text\": \"def tags\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df01d0cdbe7fea294d98466f7ce2e62d\",\n \"score\": \"0.7305405\",\n \"text\": \"def tags\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"09f6d3f4cc66a0fe32de98013823b493\",\n \"score\": \"0.72984034\",\n \"text\": \"def tags\\n @tags ||= extract_tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7a3ccb8c3068fbe3571ff24ed876199b\",\n \"score\": \"0.7159164\",\n \"text\": \"def get_tags()\\n self.tags.collect { |t| t.value }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2f62e9e17a340e9782c8e7c5cac06188\",\n \"score\": \"0.71341336\",\n \"text\": \"def tag_names\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4efd2804143fd289c5ec214f18c12701\",\n \"score\": \"0.7125448\",\n \"text\": \"def tags\\n @tags ||= get_tags.my_tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"68421f14e2c7656246da1046f9cdb81d\",\n \"score\": \"0.7110464\",\n \"text\": \"def get_tags\\n\\ttags = self.tags.map do |tag|\\n\\t\\ttag.tag.to_s\\n\\tend\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d797c1cb186dfb4d79bc25fba632fc1\",\n \"score\": \"0.70753455\",\n \"text\": \"def tags\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"935136d8c6742e3fa0519995da1f1722\",\n \"score\": \"0.7062395\",\n \"text\": \"def tags\\n attributes.fetch(:tags)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"935136d8c6742e3fa0519995da1f1722\",\n \"score\": \"0.7062395\",\n \"text\": \"def tags\\n attributes.fetch(:tags)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"935136d8c6742e3fa0519995da1f1722\",\n \"score\": \"0.7062395\",\n \"text\": \"def tags\\n attributes.fetch(:tags)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"935136d8c6742e3fa0519995da1f1722\",\n \"score\": \"0.7062395\",\n \"text\": \"def tags\\n attributes.fetch(:tags)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"935136d8c6742e3fa0519995da1f1722\",\n \"score\": \"0.7062395\",\n \"text\": \"def tags\\n attributes.fetch(:tags)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e22367df4c27a9a35e639d718055273\",\n \"score\": \"0.7049181\",\n \"text\": \"def get_tags\\n @n_tags = true\\n return @m_tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e22367df4c27a9a35e639d718055273\",\n \"score\": \"0.7049181\",\n \"text\": \"def get_tags\\n @n_tags = true\\n return @m_tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e22367df4c27a9a35e639d718055273\",\n \"score\": \"0.7049181\",\n \"text\": \"def get_tags\\n @n_tags = true\\n return @m_tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e22367df4c27a9a35e639d718055273\",\n \"score\": \"0.7049181\",\n \"text\": \"def get_tags\\n @n_tags = true\\n return @m_tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e22367df4c27a9a35e639d718055273\",\n \"score\": \"0.7049181\",\n \"text\": \"def get_tags\\n @n_tags = true\\n return @m_tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e22367df4c27a9a35e639d718055273\",\n \"score\": \"0.7049181\",\n \"text\": \"def get_tags\\n @n_tags = true\\n return @m_tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"751e2168b98120955cc83438ce0897ff\",\n \"score\": \"0.7044439\",\n \"text\": \"def tags\\n @@tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2a4294b51dea4bad1f824234dc2a37f2\",\n \"score\": \"0.7039024\",\n \"text\": \"def tags\\n @ni.tag_set\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"27a9e748e12ae40d9280bf00c215fb6a\",\n \"score\": \"0.6986146\",\n \"text\": \"def tags\\n attributes[:tags] || []\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"680f08d1644986bca7c9956d92094846\",\n \"score\": \"0.69684774\",\n \"text\": \"def tags\\n @rtb.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5706a7c5bd9b99da4accb0a9b2e5e6f9\",\n \"score\": \"0.6946327\",\n \"text\": \"def tags\\n @igw.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0de3e524d0755c3075534482f6f32149\",\n \"score\": \"0.6921787\",\n \"text\": \"def tags\\n @data['tags']\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4dbde3487fb2a152f7dc46a8e99bb391\",\n \"score\": \"0.6914\",\n \"text\": \"def tag_list\\n @@tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"74621555a7699ca49fb787184dae5ebb\",\n \"score\": \"0.6898488\",\n \"text\": \"def get_question_tags\\n Question.get_tags_from_users(self)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9cebf6abefd22a6f219dd88e475a2568\",\n \"score\": \"0.6869984\",\n \"text\": \"def tags\\n data.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9cebf6abefd22a6f219dd88e475a2568\",\n \"score\": \"0.6869984\",\n \"text\": \"def tags\\n data.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9cebf6abefd22a6f219dd88e475a2568\",\n \"score\": \"0.6869984\",\n \"text\": \"def tags\\n data.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9cebf6abefd22a6f219dd88e475a2568\",\n \"score\": \"0.6869984\",\n \"text\": \"def tags\\n data.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d5760d7f661800379e21e92aae8f105f\",\n \"score\": \"0.6851924\",\n \"text\": \"def tag_list\\r\\n @@tags\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"daca309b99df1d54d63033258b65c4d8\",\n \"score\": \"0.684187\",\n \"text\": \"def tags()\\n @tags ||= get(\\\"/tags/all.json\\\").map {|x| Tag.new(x[\\\"tag\\\"])}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c771b7c65e1995e863ab27b9b4ae4e4b\",\n \"score\": \"0.68350744\",\n \"text\": \"def tags\\n\\t\\treturn (@tags || {}).keys\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d1e2cbdc95c5051def718b610bff677\",\n \"score\": \"0.6832867\",\n \"text\": \"def tags\\n data[:tags]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d1e2cbdc95c5051def718b610bff677\",\n \"score\": \"0.6832867\",\n \"text\": \"def tags\\n data[:tags]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d1e2cbdc95c5051def718b610bff677\",\n \"score\": \"0.6832867\",\n \"text\": \"def tags\\n data[:tags]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d1e2cbdc95c5051def718b610bff677\",\n \"score\": \"0.6832867\",\n \"text\": \"def tags\\n data[:tags]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d1e2cbdc95c5051def718b610bff677\",\n \"score\": \"0.6832867\",\n \"text\": \"def tags\\n data[:tags]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d1e2cbdc95c5051def718b610bff677\",\n \"score\": \"0.6832867\",\n \"text\": \"def tags\\n data[:tags]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cc2edff9da108268955195060c2213e8\",\n \"score\": \"0.6803613\",\n \"text\": \"def tags\\n parsed {\\n @tags\\n }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6352dce1681b9c532aed745777ccbebd\",\n \"score\": \"0.68003726\",\n \"text\": \"def tag_list\\n tags.map(&:tag)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d585a99dd959a7e272e2045e0eea5b9f\",\n \"score\": \"0.6767606\",\n \"text\": \"def tags\\n @tags ||= Tags.new(force: false)\\n @tags.names\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a75988ff7ac977dac84f0fe4f9cdbc77\",\n \"score\": \"0.67580944\",\n \"text\": \"def get_learner_tags(learner_id, opts = {})\\n data, _status_code, _headers = get_learner_tags_with_http_info(learner_id, opts)\\n data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"34803cba3a7d478259c8efce40601f4e\",\n \"score\": \"0.6754768\",\n \"text\": \"def all_tags_list\\n tags.pluck(:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8a2f461b645f03872a258c69b4d51de4\",\n \"score\": \"0.67474675\",\n \"text\": \"def tags\\n read\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7497305703b8841fc9c3d6a8fb909e6c\",\n \"score\": \"0.67370987\",\n \"text\": \"def tags\\n get_tags_for_current_user\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"791dfbb236713e4382e79f9493bcf1c0\",\n \"score\": \"0.6730329\",\n \"text\": \"def tags\\n return self['tagReferences'].collect{ |tag_reference| tag_reference['tag']['name'] }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"29cca51334f5412bb0a89ac99caa048c\",\n \"score\": \"0.67271507\",\n \"text\": \"def tag_names\\n tags.map(&:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e696bc3d2bf740a81f7598db7e2454c7\",\n \"score\": \"0.67245847\",\n \"text\": \"def tags\\n get_collection 'tags', :class => Buxfer::Tag\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"33109f57c2521c7a45454a93dcdd32a6\",\n \"score\": \"0.67239624\",\n \"text\": \"def tag_names\\n rugged.tags.map { |t| t.name }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5a44b679640dd114bd932c08ce5b86ce\",\n \"score\": \"0.6711113\",\n \"text\": \"def tag_names\\n @tag_names = self.tags.map do |tag|\\n tag.name\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5ad47e4e73e07ea2958e5f022cbbb171\",\n \"score\": \"0.6706748\",\n \"text\": \"def language_tags\\n return @language_tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"56163d23bc897cc748b09c7a13ef9671\",\n \"score\": \"0.6696279\",\n \"text\": \"def tags\\n self.lib.tags.map { |r| tag(r) }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e436f3846355c92058799fae7409456d\",\n \"score\": \"0.6687589\",\n \"text\": \"def tag_names\\n tags.map(&:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e436f3846355c92058799fae7409456d\",\n \"score\": \"0.6687589\",\n \"text\": \"def tag_names\\n tags.map(&:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e436f3846355c92058799fae7409456d\",\n \"score\": \"0.6687589\",\n \"text\": \"def tag_names\\n tags.map(&:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e2bd149350eaeb3cddfd159784531a1\",\n \"score\": \"0.66859543\",\n \"text\": \"def interesting_tags\\n @interesting_tags_list\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ac1569e7990b452e4cbd52ae82a9d794\",\n \"score\": \"0.66833645\",\n \"text\": \"def tags\\n adapter.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ac1569e7990b452e4cbd52ae82a9d794\",\n \"score\": \"0.66833645\",\n \"text\": \"def tags\\n adapter.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fdc80997bf75e9fd7c2c591f3333521f\",\n \"score\": \"0.6669636\",\n \"text\": \"def tags\\r\\n @data[:tags] || []\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c5de2b2cae2c2c8a49538caadfd7df2d\",\n \"score\": \"0.66653955\",\n \"text\": \"def tags\\n @_tags ||= Tenk::Tags.new(@_client)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"082e05e8c93d59d3afe66e51e14e3ebe\",\n \"score\": \"0.6651701\",\n \"text\": \"def tags\\n Tag.find_all(self)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"082e05e8c93d59d3afe66e51e14e3ebe\",\n \"score\": \"0.6651701\",\n \"text\": \"def tags\\n Tag.find_all(self)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2a374e063c657ffe1985e678e6c82932\",\n \"score\": \"0.66373867\",\n \"text\": \"def tags\\n tags_with_counts.keys\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"27a1738486db982c56572f0c1f039387\",\n \"score\": \"0.66326374\",\n \"text\": \"def tags\\n scope.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9638ea549877b2f83cb7815f64a51c1e\",\n \"score\": \"0.6607598\",\n \"text\": \"def tags\\n Metamatter::Classification.new(self).tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"83b0311510452aeab884096ab2a6b07c\",\n \"score\": \"0.6601357\",\n \"text\": \"def tag_names\\n self.tags.map(&:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d0e914f18b1498ca7c79f72c85a058ba\",\n \"score\": \"0.6586034\",\n \"text\": \"def tags\\n @instance.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e211155856ceba15a122464d7f1af95c\",\n \"score\": \"0.65466654\",\n \"text\": \"def tag_names\\n @tag_names ||= tags.map(&:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"37cfd059c9ce3f8276320e36909127b4\",\n \"score\": \"0.6543643\",\n \"text\": \"def get_tags\\n me = members(name: self.name)[0]\\n me[\\\"tags\\\"]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"96b29c4d63de0ff980298063fbaedf08\",\n \"score\": \"0.6542209\",\n \"text\": \"def tags\\n return Tag.where(group_id: self.tag_group_id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1689ebd5fe95989eaae2e9027c289277\",\n \"score\": \"0.65337783\",\n \"text\": \"def tags\\n if !@tags\\n @tags = results.collect { |r| r.tags }.flatten.uniq\\n end\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"89f9428e449ce34c294c08e23ce9e75b\",\n \"score\": \"0.6528922\",\n \"text\": \"def tag_names\\n tags.collect(&:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"31c8fa008a8b914ad2ddc3154e8e62c7\",\n \"score\": \"0.6516426\",\n \"text\": \"def tags\\n @tags ||= []\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f434462d97d4d506b197cd703fb99e22\",\n \"score\": \"0.65058166\",\n \"text\": \"def tags\\n response = get 'tags'\\n response.map{|item| Hashie::Mash.new(item)}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b129b9af0a7b844a8061a8b02808a14e\",\n \"score\": \"0.64850205\",\n \"text\": \"def tags\\n @tags ||= (tagGuids || []).map{|guid| note_store.getTag(guid)}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7a0907cf0190c8c851a1f81eaec1b237\",\n \"score\": \"0.6484346\",\n \"text\": \"def tags\\n @tags ||= [ *self[ :tag ], *self[ :tags ] ]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2e4361999c7295690ec05a02603bc137\",\n \"score\": \"0.6475948\",\n \"text\": \"def tag\\n\\t\\ttags\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2b76495b30e27cbfd0b367209a89e1de\",\n \"score\": \"0.6465764\",\n \"text\": \"def tags\\n if new?\\n @fake_tags || []\\n else\\n @tags ||= tags_dataset.all\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6522611d283102403a08baccee1a8819\",\n \"score\": \"0.64576787\",\n \"text\": \"def tag_list\\n\\t\\tself.tags.collect do |tag|\\n\\t\\t\\ttag.name\\n\\t\\tend.join(\\\", \\\") #Convert tag objects to array of tag names\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"73dd03f8777437c933eb6cce7fcc17dc\",\n \"score\": \"0.64549154\",\n \"text\": \"def get_all_tags\\n self.tags.map(&:name).join(\\\", \\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6960d9998dc8a0e79686abd692202541\",\n \"score\": \"0.6450626\",\n \"text\": \"def tags\\n return @tags if @tags\\n tagz = self.tag.split(/([\\\\w\\\\d]+)|\\\"([\\\\w \\\\d]+)\\\"/)\\n tagz.delete(' ')\\n tagz.delete('')\\n @tags = tagz\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"010bf97443d9f7f750f13f43650ff795\",\n \"score\": \"0.64454365\",\n \"text\": \"def tags\\n @tags = results.collect(&:tags).flatten.uniq unless @tags\\n @tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fd94dbdd4d09b45e07a493dcf47eba6f\",\n \"score\": \"0.64432895\",\n \"text\": \"def get_tags\\n self.tags.split(',')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e88739a08ee992466efb38581b8f2b11\",\n \"score\": \"0.6430377\",\n \"text\": \"def tags\\n @parser.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8fd4791bc2d4a97ad685db1bbd1bf225\",\n \"score\": \"0.64282197\",\n \"text\": \"def tags\\n @tags ||= vcs.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8fd4791bc2d4a97ad685db1bbd1bf225\",\n \"score\": \"0.64282197\",\n \"text\": \"def tags\\n @tags ||= vcs.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a4547717c9804d79ee4db434521e11a7\",\n \"score\": \"0.640562\",\n \"text\": \"def tags\\n obj[12]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"64de850ef60a7321d121c944acff2514\",\n \"score\": \"0.640552\",\n \"text\": \"def tags\\n attributes[:tags].split(',').map(&:strip)\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":176,"cells":{"query_id":{"kind":"string","value":"c09e1f25905f20c2599247ac7cbe89a3"},"query":{"kind":"string","value":"add_breadcrumb I18n.t('navigation.page.product'), :products_path, only: [:show] GET /products GET /products.json"},"positive_passages":{"kind":"list like","value":[{"docid":"674a3b887f6d0d7c407539bae71be1b5","score":"0.717015","text":"def index\n @products_grid = initialize_grid(Product.all)\n\n add_breadcrumb I18n.t('navigation.page.product'), nil\n end","title":""}],"string":"[\n {\n \"docid\": \"674a3b887f6d0d7c407539bae71be1b5\",\n \"score\": \"0.717015\",\n \"text\": \"def index\\n @products_grid = initialize_grid(Product.all)\\n\\n add_breadcrumb I18n.t('navigation.page.product'), nil\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"ed62ee4b26672c6b567a7eb25068dc73","score":"0.80103326","text":"def show\n add_breadcrumb \"#{@product.recipe.name}\", :product_path\n end","title":""},{"docid":"b1c463bfda0722cfafd8906cf67166a7","score":"0.773324","text":"def show\n add_breadcrumb 'shopping cart'\n end","title":""},{"docid":"ba0202cc9870cd495e1b367714f5d285","score":"0.7353934","text":"def show\n @product = Product.find(params[:id])\n @title=@product.title\n @linked=@product.linked\n @cart_item = @current_cart.cart_items.new(product_id: @product.id, quantity:1)\n \n @category = Category.find(params[:category_id])\n\n @breadcrumbs=[]\n @breadcrumbs << @product\n if params[:category_id]\n tmp=Category.find(params[:category_id])\n while tmp do \n @breadcrumbs << tmp\n tmp=tmp.parent\n end\n @breadcrumbs=@breadcrumbs.reverse\n end\n\n end","title":""},{"docid":"6f7bc745b80f878064334398949fad95","score":"0.70682573","text":"def show\n @shop = Shop.find(params[:id])\n breadcrumbs.add @shop.name,nil\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop }\n end\n end","title":""},{"docid":"cb5b5b1b1282fb470332f5d1d1da6969","score":"0.7025876","text":"def show\n add_breadcrumb :show, :show\n end","title":""},{"docid":"8be5ed77d4761402c6a60f684c18c9d4","score":"0.69740963","text":"def fetch_product_crumb(product)\n return \"\" unless product\n \"#{fetch_categories_crumb(product.category)} / #{[product.name]}\"\n end","title":""},{"docid":"ffe4bc203e7c1f8e17bc6f95cd844caa","score":"0.69419265","text":"def show\n add_breadcrumb_for_show\n end","title":""},{"docid":"f8a4e0e9f327d1a6f73cf68f1bf40baf","score":"0.67630124","text":"def show\n add_breadcrumb @recipe.name, @recipe\n respond_to do |format|\n format.html\n format.json { render json: @recipe }\n end\n end","title":""},{"docid":"259f451891a21daa2dc2b42ead92caca","score":"0.6696131","text":"def show\n add_breadcrumb \"show\", padraos_path, :title => \"Volta para o index\"\n end","title":""},{"docid":"e207714b2cc6a7b167b219b1a0a2b1ec","score":"0.66734713","text":"def get_breadcrumbs\n current = @product || @brand || @category || @page\n # BreadcrumbsMaker.build current, params\n make_breadcrumbs current\n end","title":""},{"docid":"8a3455a424af0f839bc4b6f912a12e7e","score":"0.6647629","text":"def index \n add_breadcrumb \"Administrar\", :sections_path\n add_breadcrumb \"Recursos\", :resources_path \n end","title":""},{"docid":"d76784c26579ff2ee4c8f8da8e82831d","score":"0.66340107","text":"def show\n @products = @category.products.paginate(:page => params[:page], :per_page => 10)\n @branch_products = @current_branch.products\n end","title":""},{"docid":"645d323f2791d0cdd472c2ae02f1d80d","score":"0.6625675","text":"def show\n add_breadcrumb \"Ver\", :usuario_path\n end","title":""},{"docid":"06a7d7b91292bac51b2d50fef0b75447","score":"0.66093934","text":"def show\n add_breadcrumb 'Ticket notes'\n end","title":""},{"docid":"ff7f15fcd80e8d85ce477732c07ed1d6","score":"0.6602868","text":"def create\n add_breadcrumb 'New product'\n\n @product = Product.new(product_params)\n respond_to do |format|\n if @product.save\n format.html do\n redirect_to @product, notice: 'Product was successfully created.'\n end\n format.json { render :show, status: :created, location: @product }\n else\n puts @product.errors.messages\n format.html { render :new , status: :unprocessable_entity }\n format.json do\n render json: @product.errors, status: :unprocessable_entity\n end\n end\n end\n end","title":""},{"docid":"758346057d1104a617054a4af91cd830","score":"0.65642977","text":"def individual_breadcrumb\n add_breadcrumb \"Clients\", clients_path, :title => \"Clients\" \n add_breadcrumb \"Power Of Attorney\", '', :title => \"Power Of Attorney\" \n add_breadcrumb \"Principal Create\", '', :title => \"Principal Create\"\n end","title":""},{"docid":"f9ca73842926c9da9578033fd1621424","score":"0.6542019","text":"def show\n breadcrumb\n end","title":""},{"docid":"bcfc3a32c3bfaeae3bbf12c5370722d0","score":"0.65400743","text":"def show\n add_breadcrumb 'Trouble Ticket'\n end","title":""},{"docid":"7fa7785067a318dd1588bba1ffbb7fdb","score":"0.6539872","text":"def show\n add_breadcrumb @equipment.name.to_s, '/equipment/' + @equipment.id.to_s\n add_breadcrumb 'comment', '/comments/' + @comment.id.to_s\n\n end","title":""},{"docid":"67355f538ce629c24852939f73b3fa26","score":"0.65109557","text":"def show\n add_breadcrumb @subcategory.title, category_subcategory_path(@category, @subcategory)\n end","title":""},{"docid":"e58b491060e73f883c84712397fce9c1","score":"0.6509415","text":"def show\n add_breadcrumb 'Transaction'\n end","title":""},{"docid":"393d1179692dcc4a43bde3c62ab1e159","score":"0.6482298","text":"def show\n add_breadcrumb 'details', departements_path\n end","title":""},{"docid":"10dd655e33daed9602c79cd4e1571eba","score":"0.6480249","text":"def show\n add_breadcrumb \"show\", solexames_path, :title => \"Volta para o index\"\n end","title":""},{"docid":"4bed5d4133c4848625d8a44e27fc815c","score":"0.6440253","text":"def more_rest\n add_breadcrumb \"Waktu Kerja dan Lembur\", \"#absences\"\n add_breadcrumb \"Istirahat Lebih\", \"#more_rest\"\n render :layout => false\n end","title":""},{"docid":"a6928756214f40a0d40c7d4760ea8472","score":"0.64386266","text":"def show\n @type_mode = @product.product_type.nil? ? 'tag' : 'type'\n\n add_breadcrumb t('home'), :root_path\n if @product.product_type_id.nil?\n add_breadcrumb t('handmadebag'), products_path\n else\n add_breadcrumb ProductTypeTranslate.find_by_locale_id_and_product_type_id(session[:locale_id], params[:product_type_id]).name, product_type_products_path(@product.product_type_id)\n end\n\n #set seo meta\n add_breadcrumb @product.product_translate.name\n\n unless @product.product_translate.price\n render json: 'this product is not available in this locale setting'\n end\n\n @website_title = \"#{@product.product_translate.name} | #{@website_title}\"\n @meta_og_title = @product.product_translate.name\n @meta_og_description = ApplicationController.helpers.truncate(Sanitize.fragment(@product.product_translate.description), length: 100)\n @meta_og_type = 'product'\n @meta_og_image = \"http://quoiquoi.tw#{@product.image.url(:large)}\"\n end","title":""},{"docid":"69166cfb103c8a49d5901621717f4e34","score":"0.6435997","text":"def show\n\n component_type = @component.component_types.first\n\n add_breadcrumb \"#{component_type ? component_type.title : 'Товары'}\", component_type ? components_path(component_type_id: component_type.id) : components_path\n\n # http://stackoverflow.com/questions/35614878/breadcrumbs-on-rails-list-show-as-child-of-index\n add_breadcrumb \"#{@component.title}\", component_path(@component.id) \n\n @components = Component.where.not(id: params[:id]).includes(:component_types).where( :component_types => {:id => @component.component_types.first.id}).order(:title)\n end","title":""},{"docid":"83033c742918444a4e424c680b19e6ee","score":"0.64259887","text":"def show\n @recommend_recommend_tag = Recommend::RecommendTag.find(params[:id])\n\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), recommend_recommend_tag_path(@recommend_recommend_tag)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recommend_recommend_tag }\n end\n end","title":""},{"docid":"5858c1d826af3ec4bbf96ab7503d85ee","score":"0.64256084","text":"def add_breadcrumb_modulo\n add_breadcrumb breadcrumb('administracao.avaliacao.base')\n add_breadcrumb pluralize_model(TbPergunta), administracao_tb_perguntas_path\n end","title":""},{"docid":"6c920811146c7e5efee11fc5db107909","score":"0.6407804","text":"def show\n @product = Product.where([\"id = ?\", params[:id].to_i]).first\n raise NoProductError if @product.blank?\n\n @providers = @product.providers\n @product_contents = @product.contents\n\n @shop = @product.shop\n raise NoShopError if @shop.blank?\n \n @reviews = @product.reviews\n @review_images = @product.review_images\n \n @main_review = @reviews.first\n @main_image = @product.images.try(:first)\n @countries = Country.all\n\n add_breadcrumb \"#{@shop.name} - #{@product.name} 商品詳細\", product_path\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end","title":""},{"docid":"824c1332f96af2e0ed0deb390ecb49b4","score":"0.6392382","text":"def show\n @recommend_recommend_ptag = Recommend::RecommendPtag.find(params[:id])\n\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), recommend_recommend_ptag_path(@recommend_recommend_ptag)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recommend_recommend_ptag }\n end\n end","title":""},{"docid":"8fc4753d1ec584135198d88850ca4603","score":"0.6384286","text":"def show\r\n add_breadcrumb I18n.t(\"breadcrumbs.labs.index\"), :labs_path\r\n add_breadcrumb @lab_space.lab.name, lab_path(@lab_space.lab)\r\n add_breadcrumb @lab_space.name, :lab_lab_space_path\r\n add_breadcrumb @equipment.name, :lab_lab_space_equipment_path\r\n redirect_to root_path if @equipment.hidden\r\n end","title":""},{"docid":"f7204c1ea3a7dc51e6f991a0e05c646d","score":"0.63831854","text":"def add_breadcrumb_modulo\n add_breadcrumb pluralize_model(TbAvaliacao), gerente_tb_avaliacoes_path\n end","title":""},{"docid":"a227ea03ffa9d3e17f1fee147f2620fc","score":"0.63391215","text":"def show\n breadcrumbs_for :show\n end","title":""},{"docid":"f04b88cb059e0677e1eaac62ea1e122f","score":"0.633797","text":"def show\n add_breadcrumb 'details', :arrondissement_path\n end","title":""},{"docid":"8bf6f7db57769d8649578bcc210b5ad6","score":"0.63229287","text":"def index\n @product = Product.find(params[:product_id].to_i,\n :conditions => ProductFilter.product_by_category_conditions(@category, @region))\n\n @manufacturer_category = get_category_with_infoitem_type(@product.manufacturer_category)\n # Find all articles related to product\n @articles = @product.bookcases\n set_breadcrumb_for @product\n add_breadcrumb t('navigation.breadcrumbs.bookcases'), @product.url.sub('/product/', '/product/articles/')\n end","title":""},{"docid":"fc234c5ae70d1d98fb3793ba7828f39a","score":"0.63187003","text":"def show\n add_breadcrumb \"Listings\", :listings_path\n add_breadcrumb \"Current Listing\", :listing_path\n end","title":""},{"docid":"40f8d3433af297e13d1c11dac178ee02","score":"0.6309341","text":"def show\n # maybe I need to uncomment this:\n # @image = Image.find(params[:id]) \n # add_breadcrumb @image, image_path(@image) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end","title":""},{"docid":"40f8d3433af297e13d1c11dac178ee02","score":"0.6309341","text":"def show\n # maybe I need to uncomment this:\n # @image = Image.find(params[:id]) \n # add_breadcrumb @image, image_path(@image) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end","title":""},{"docid":"01d07f238b971dbbe68d1e423e4950ca","score":"0.6304316","text":"def show\n add_breadcrumb @rekening.nama_rekening.capitalize\n end","title":""},{"docid":"ba157c7cf3e8796ca7c3774889dad9e9","score":"0.62870955","text":"def index\n @recommend_recommend_tags = Recommend::RecommendTag.paginate(:page => params[:page])\n #@recommend_recommend_tags = Recommend::RecommendTag.paginate(:page => params[:page], :per_page => 20).order('id DESC')\n\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), recommend_recommend_tags_path\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recommend_recommend_tags }\n end\n end","title":""},{"docid":"dd450df08273595c84b61fec7aecef72","score":"0.6280279","text":"def show\n @breadcrumb = 'read'\n @product_type = ProductType.find(params[:id])\n @products = @product_type.products.paginate(:page => params[:page], :per_page => per_page).order('product_code')\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_type }\n end\n end","title":""},{"docid":"fa54df9d3de494f600f2b30444008bdd","score":"0.6278365","text":"def new\n # @product_test = ProductTest.new\n @presentation_picture = PresentationPicture.new\n add_breadcrumb \"Nouvel avis/test\", :new_product_test_path\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product_test }\n end\n end","title":""},{"docid":"1c6bc64441c06d424a14eb5e7df0c20b","score":"0.6273998","text":"def breadcrumbs\n\t\trender :breadcrumbs\n\tend","title":""},{"docid":"eecb7ac83fa1339eb02b26747b7ed2b3","score":"0.6270328","text":"def show\n @recommend_recommend_other = Recommend::RecommendOther.find(params[:id])\n\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), recommend_recommend_other_path(@recommend_recommend_other)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recommend_recommend_other }\n end\n end","title":""},{"docid":"e19b27ea16b3a52ab94d93a0f46abbe9","score":"0.62677443","text":"def show\n drop_breadcrumb(\"股票\")\n drop_breadcrumb(\"#{@stock.name}(#{@stock.market}:#{@stock.code})\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end","title":""},{"docid":"f683840f2789a1f7c69fd1300cfd8e33","score":"0.6242931","text":"def show\n add_breadcrumb \"details\", :infractions_path\n end","title":""},{"docid":"245eda5582edebd29bea79c80678ca96","score":"0.6242131","text":"def add_resource_breadcrumb(resource)\n ancestor_nodes(resource).each do |node|\n @breadcrumbs << { name: node, url: url_for( action: :edit, id: node.id ) }\n end\n super\n end","title":""},{"docid":"4450219e0387cf7446dd2cfe2f37ad52","score":"0.6222868","text":"def show\n ## 面包屑导航\n add_breadcrumb I18n.t('view.action.show'), :back_catagory_path\n end","title":""},{"docid":"ad501523a60dd1c29c10d24fd2cab698","score":"0.6205671","text":"def show\n @product_tree = ProductTree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_tree }\n end\n end","title":""},{"docid":"fc83909a63a0eaa8b6b6ec69bdb04587","score":"0.61895657","text":"def show\n add_breadcrumb @pegawai.nama_pegawai.capitalize\n end","title":""},{"docid":"8bcde8c8026d546f476ceedddb6ab91a","score":"0.6187625","text":"def show\n @brand = Brand.friendly.find(params[:brand_id])\n if request.path != product_path(@product)\n redirect_to @product, status: :moved_permanently\n end\n @products = Product.all\n end","title":""},{"docid":"430c33a29cc40972790d2ceb59e22245","score":"0.6178055","text":"def show\n add_breadcrumb proc { I18n.t('breadcrumbs.explore', default: 'explore') }, :research_path\n end","title":""},{"docid":"5cee3635bf03486c0dcc023bfa018ea6","score":"0.6167413","text":"def less_rest\n add_breadcrumb \"Waktu Kerja dan Lembur\", \"#absences\"\n add_breadcrumb \"Istirahat Kurang\", \"#lest_rest\"\n render :layout => false\n end","title":""},{"docid":"1a7b04c3119fd238235e06c042cbecf6","score":"0.61652505","text":"def show\n @tag_identity = Identity.find(params[:id])\n\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), tag_identity_path(@tag_identity)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tag_identity }\n end\n end","title":""},{"docid":"7c874ae263eb258883a8c626a4d1464b","score":"0.61396307","text":"def show\n @location = Location.by_vendor.find_by_id(params[:id])\n\n add_breadcrumb @location.name,'location_path(@location,:vendor_id => params[:vendor_id], :type => params[:type])'\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @location }\n end\n end","title":""},{"docid":"a6c16fa1d7b96bc63164773c54db0b96","score":"0.6115842","text":"def show\n add_breadcrumb @kelurahan.nama.capitalize\n end","title":""},{"docid":"141ee4a40cc2ca271552cc22c1b47d54","score":"0.609399","text":"def show\n add_breadcrumb I18n.t('integral.navigation.list'), list_backend_resources_url\n add_breadcrumb I18n.t('integral.actions.view')\n end","title":""},{"docid":"06c3b0cb44edbc329b7bfebb8c42a3fc","score":"0.60925484","text":"def show\n add_breadcrumb \"Detalles\", @prospectos\n end","title":""},{"docid":"b1bb5e5c32bc07938430006c31e38503","score":"0.6073066","text":"def show\n @brand = Brand.friendly.find(params[:id])\n if request.path != brand_path(@brand)\n redirect_to @brand, status: :moved_permanently\n end\n @products = @brand.products\n end","title":""},{"docid":"ecae0fcf89c6c1de3e4cb1387a308ddf","score":"0.60721534","text":"def product_breadcrumb?(product=nil)\n\t\t!product.empty?\n\tend","title":""},{"docid":"71f5bf14000b17780f40a0b63f6a55b6","score":"0.6069196","text":"def add_breadcrumbs\n breadcrumb_for \"index\" # base\n\n if action_name != \"index\"\n breadcrumb_for action_name\n end\n end","title":""},{"docid":"5d2371ca56fee0f62a8ac2ca398b1732","score":"0.6032126","text":"def show\n add_breadcrumb @jabatan.nama_jabatan.capitalize\n end","title":""},{"docid":"5e98d132d3d27d5bfcf1cffb9af044e1","score":"0.60263485","text":"def list_products\n render \"products_view/all\"\n end","title":""},{"docid":"b6fec756ad05ee2311db9840a9020215","score":"0.60104024","text":"def show\n #@product = Cache.get 'product_' + params[:id].to_s\n unless @product\n begin\n @product = Product.find(params[:id], :include => [:ds_vendor, :product_images])\n @product = ProductDecorator.new(@product)\n rescue\n flash[:notice] = \"I'm sorry. We couldn't find the product you were looking for\"\n redirect_to '/' and return \n end\n #Cache.put 'product_' + params[:id].to_s, @product\n end\n @breadcrumb = Cache.get 'product_' + params[:id].to_s + '_breadcrumb'\n unless @breadcrumb\n @breadcrumb = @product.category.breadcrumb\n #Cache.put 'product_' + params[:id].to_s + '_breadcrumb', @breadcrumb\n end\n @related_products = Product.find(:all, :conditions => [ 'products.manufacturer = ? and products.id != ?', @product.manufacturer, @product.id], :limit => 4, :include => :product_images) \n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product }\n end\n end","title":""},{"docid":"f2df19fb0ce555e3acc0aaf742d15956","score":"0.5995615","text":"def index\n @recommend_recommend_ptags = Recommend::RecommendPtag.paginate(:page => params[:page])\n\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), recommend_recommend_ptags_path\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recommend_recommend_ptags }\n end\n end","title":""},{"docid":"def98d6b2e8a4142ae8cc5940e7b2ada","score":"0.5995017","text":"def add_breadcrumb(resource, label: :title, path: nil)\n if resource.instance_of?(String)\n semantic_breadcrumb I18n.t(resource), path\n else\n semantic_breadcrumb resource.send(label), path\n end\n end","title":""},{"docid":"30fe33fde40c1b273dbb4b224c25378c","score":"0.59836996","text":"def show\n authorize @sale\n add_breadcrumb @sale.reference\n end","title":""},{"docid":"8009a1071bbded19883e05d51ef1da7e","score":"0.5982824","text":"def show\n @title = 'My Account'\n add_breadcrumb t('my_account')\n end","title":""},{"docid":"96368494cab05904da6abc8b7056005e","score":"0.59770596","text":"def show\n @ticket = Ticket.find(params[:id])\n @tickets = Ticket.find(:all, :conditions => [\"event_id = ?\", @ticket.event_id])\n @tickets = @tickets.paginate(:page => params[:page])\n \n #Define breadcrumbs\n @l1_link = tickets_path\n @l1_name = \"Tickets\" \n @l2_link = ticket_path\n @l2_name = \"Ticket \" + @ticket.id.to_s\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ticket }\n end\n end","title":""},{"docid":"760cd19b461c195f3c38ce8ec074eb6d","score":"0.59726685","text":"def show\n add_breadcrumb \"Trainings\", :trainings_path, { :title => \"Trainings\" }\n end","title":""},{"docid":"d912a4f036814ffe23ac1e4884ab8305","score":"0.5971008","text":"def show\n #binding.pry\n add_breadcrumb \"Articles\",articles_path\n cat=@article.category\n if cat\n cat.ancestors.reverse_each { |a| add_breadcrumb a.name,category_path(a) }\n add_breadcrumb cat.name,category_path(cat)\n end\n add_breadcrumb @article.title,article_path\n #ASK how to make this more DRY\n end","title":""},{"docid":"9f11a60d5ac8c9f93c24cdab371b50cf","score":"0.5970904","text":"def auto_set_breadcrumb\n ariane.add(\"Home\", root_path, 1) if ariane.crumbs.empty? \n \n if self.action_name == \"index\"\n name = controller_name.titleize\n level = get_level || 2\n else\n name = \"#{action_name.titleize} #{controller_name.singularize.titleize}\"\n level = get_level || 3\n end\n\n ariane.add(name, request.fullpath, level)\n end","title":""},{"docid":"6ffa602e494f8252e9854fc8e1b35991","score":"0.5966027","text":"def show\n add_breadcrumb \"Subjects Design\", subjects_path, :title => \"Back to the Index\"\n add_breadcrumb \"Subjects Allocation\", subject_allocations_path\n add_breadcrumb \"Details\"\n end","title":""},{"docid":"0da1b52a13931c45fe1e0a0e4d583fff","score":"0.59650064","text":"def show\n @order = Order.scopied.find_by_id(params[:id].to_s)\n add_breadcrumb t(\"menu.order\") + \"#\" + @order.nr.to_s,'order_path(@order,:vendor_id => salor_user.meta.vendor_id)'\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @order }\n end\n end","title":""},{"docid":"3c3ef24c73b7d5b0a29f0cbbeaf4eb3f","score":"0.5963229","text":"def show\n @products = CatalogMebeli.find(params[:id]).products\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product }\n end\n end","title":""},{"docid":"910c81e79756ec63d2aeefd26d4ab489","score":"0.59541714","text":"def show\n add_breadcrumb \"Batches\", batches_url\n add_breadcrumb \"Details\"\n end","title":""},{"docid":"d5641f1922527eed7ff908b736c4df77","score":"0.5952908","text":"def show\n @recommend_recommend_subject = Recommend::RecommendSubject.find(params[:id])\n\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), recommend_recommend_subject_path(@recommend_recommend_subject)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recommend_recommend_subject }\n end\n end","title":""},{"docid":"0e6081c28e2ed0a88e530525db83ef75","score":"0.5945389","text":"def breadcrumb\n Array(@breadcrumb)\n\tend","title":""},{"docid":"92352d3f6b4efc870c981df761fc8105","score":"0.593386","text":"def index\n flash[:message] = nil\n\n @type_mode = @product_type.nil? ? 'tag' : 'type'\n\n respond_to do |format|\n format.html do\n add_breadcrumb t('home'), :root_path\n\n @products = get_products\n\n if params[:product_type_id]\n product_type_name = ProductType.find(params[:product_type_id]).product_type_translates.find_by_locale_id(session[:locale_id]).name\n else\n product_type_name = I18n.t('handmadebag')\n end\n\n add_breadcrumb product_type_name\n\n # append to title name for seo\n @website_title = \"#{product_type_name} | #{@website_title}\"\n end\n\n format.json do\n helpers = ApplicationController.helpers\n products = get_products\n\n render(\n json:\n {\n items: products.collect do |product|\n [\n {\n key: 'url',\n value: polymorphic_path([@product_type, product])\n },\n {\n key: 'truncated_name',\n value: helpers.truncate(product.product_translate.name, length: (session[:locale] == 'en')? 38 : 20)\n },\n {\n key: 'name',\n value: product.product_translate.name\n },\n {\n key: 'image',\n value: product.image.url(:small)\n },\n {\n key: 'price',\n value: helpers.number_to_currency(helpers.price_discount(product.product_translate.price, product.discount))\n },\n {\n key: 'discount',\n value: t('product.discount', percent: helpers.locale_discount(product.discount, session[:locale_id]))\n },\n {\n key: 'visible',\n value: (product.discount > 0)? '' : 'hidden'\n }\n ]\n end,\n nextPage: (products.total_pages > products.current_page) ? polymorphic_path([@product_type, :products], page: ((params[:page] || 1).to_i + 1), tag: params[:tag], format: :json) : nil\n }\n )\n end\n\n format.xml do\n @products = Product.includes(:product_translate)\n .where(product_translates: {locale_id: session[:locale_id]},\n visible: true)\n .where.not(product_translates: {name: '', description: '', price: nil})\n .order(id: :desc).limit(50)\n\n render template: 'products/index.atom.builder', layout: false\n end\n end\n end","title":""},{"docid":"363e14d1d9dd7831dfde2c8c8b20c606","score":"0.593189","text":"def show\n add_breadcrumb \"Detalles\", @reqcargos\n end","title":""},{"docid":"a2d5ef1ce0cd6d79dde56f8cf7fbdc8f","score":"0.5929522","text":"def the_breadcrumb(add_post_type = true)\n generate_breadcrumb(add_post_type)\n h.breadcrumb_draw\n end","title":""},{"docid":"e985a6c9a8d091d06de3999678a1351b","score":"0.5927581","text":"def show\n add_breadcrumb \"Detalles\", @centro_costos\n end","title":""},{"docid":"7841e72f8dc2dd36e222e8e5e5b61790","score":"0.5923625","text":"def transaction_show\n add_breadcrumb \"Merchants\", epsadmin_merchants_path\n add_breadcrumb \"#{@transc_merchant.first_name}\", epsadmin_merchant_path(@transc_merchant.merchant_uniq_id)\n add_breadcrumb \"Transaction\", epsadmin_merchant_transaction_path\n @epsadmin_transaction_indiv = Transaction.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @epsadmin_transaction_indiv }\n end\n end","title":""},{"docid":"4d8c0e5996c08ceae1db488aa13087a4","score":"0.59194684","text":"def show\r\n @ph_product = PhProduct.find(params[:id])\r\n\r\n add_breadcrumb _(\"My products\").html_safe, :products_url\r\n add_breadcrumb @ph_product.product.name, edit_product_url(@ph_product.product)\r\n add_breadcrumb _(\"Environmental Assessment\").html_safe, ph_production_init_path(@ph_product)\r\n add_breadcrumb _(\"Data Entry\").html_safe, ph_electric_component_path(@ph_product)\r\n \r\n if !@ph_product.ph_electric_component\r\n ph_electric_component = PhElectricComponent.new \r\n ph_electric_component.ph_product_id = @ph_product.id\r\n ph_electric_component.include_batteries = 'no' \r\n ph_electric_component.save\r\n @ph_product.ph_electric_component = ph_electric_component\r\n end\r\n @ph_electric_component = @ph_product.ph_electric_component\r\n @step = 4\r\n @product = @ph_product.product\r\n \r\n @ph_battery_types = PhBatteryType.all\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @ph_electric_component }\r\n end\r\n end","title":""},{"docid":"b54140f712fd082aa55ec45892f7e2a5","score":"0.5913054","text":"def add_breadcrumb name, url = ''\n\t\t@breadcrumbs ||= []\n\t\t url = eval(url) if url =~ /_path|_url|@/\n\t\t@breadcrumbs << [name, url]\n\tend","title":""},{"docid":"b501b0db8d96e1ebad41708b274b701d","score":"0.5911563","text":"def show\n @product = Product.find(params[:id])\n if @product.parent_id == nil\n\n @brand = @product.brands\n @same = Product.find(:all, :conditions => {:brands => @brand, :parent_id => nil}).sample(4)\n @children = Product.find(:all, :conditions => {:parent_id => @product.id})\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n else\n @product = Product.find(@product.parent_id)\n redirect_to @product\n end\n\n end","title":""},{"docid":"215fca500357c7961cf5b8cf98d029d1","score":"0.59073246","text":"def show\n\n @category = Category.find(params[:id])\n @products = Product.category(@category.title).page(params[:page]).per(6).asc(:list_order)\n @title = @category.title\n @brands = Brand.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end","title":""},{"docid":"6863b1d6864d3c4b05da877dcff9da42","score":"0.590654","text":"def build_breadcrumbs\n @breadcrumbs = [\n { :title => I18n.t(\"admin.sections.#{resource_collection_name}\"), :url => collection_path }\n ]\n @breadcrumbs << { :title => params[:action] } unless params[:action] == 'index'\n end","title":""},{"docid":"48512055effb95996914b3546696755b","score":"0.5904712","text":"def index\n \n \n if params[:category_id] # TO CHANGE\n @category = Category.find_by_cached_slug(params[:category_id])\n @product_tests = @category.published.product_tests.recent.page(params[:page]).per(5)\n add_breadcrumb \"Catégories\", :categories_path, :title => \"Revenir à la liste des catégories\"\n add_breadcrumb @category.name.camelize, category_path(@category)\n add_breadcrumb \"Avis/Tests de produits\", product_tests_from_category_path(@category), :title => \"Revenir à la liste des avis/tests de produits\"\n else\n add_breadcrumb \"Avis/Tests de produits\", :product_tests_path, :title => \"Revenir à la liste des avis/tests de produits\"\n @product_tests = ProductTest.published.recent.page(params[:page]).per(5)\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @product_tests }\n end\n end","title":""},{"docid":"9ba694d38d001bf1ab580b57346f3760","score":"0.5903778","text":"def set_root_breadcrumb\n add_breadcrumb 'Top'.html_safe, root_path\n end","title":""},{"docid":"be6e9e708803b58b44ea5c1172313ba5","score":"0.590128","text":"def show\n\n add_breadcrumb @asset.asset_tag, inventory_path(@asset)\n add_breadcrumb \"Maintenance History\", inventory_maintenance_events_path(@asset)\n add_breadcrumb \"Service on #{@maintenance_event.event_date}\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @maintenance_event }\n end\n\n end","title":""},{"docid":"8f4a48c93fcc533b5cf2e87a15a32cde","score":"0.5893474","text":"def show\n @entry = Entry.find(params[:id])\n @entry.viewed\n breadcrumbs.add \"医药招商\",entries_url\n breadcrumbs.add nil\n #breadcrumbs.add @entry.title\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entry }\n end\n end","title":""},{"docid":"d25e6748b30e63b04d9c9ed69f65e004","score":"0.5874213","text":"def add_resource_breadcrumb(resource)\n ancestors = []\n if resource.new_record?\n if resource.parent_id\n ancestors = resource.parent.ancestors\n ancestors += [resource.parent]\n end\n else\n ancestors = resource.ancestors\n end\n\n ancestors.each do |ancestor|\n @breadcrumbs << { name: ancestor, url: url_for( action: :edit, id: ancestor.id ) }\n end\n\n super\n end","title":""},{"docid":"d3070f22a836376b4ce61cc0909c2b91","score":"0.5865418","text":"def index\n b_admin = current_user.admin? rescue false\n @products = Product.filter_by_params(b_admin, params)\n #@products = Product.available\n \n @title = Product.page_description(params)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end","title":""},{"docid":"8d0c588fb0f6fc9a1c19d1a5886fdd0d","score":"0.586171","text":"def show\n @competency = @resource.competency\n breadcrumb\n end","title":""},{"docid":"cb85514f36ea2349e627b970b5134077","score":"0.58523536","text":"def set_breadcrumbs\n @breadcrumbs = []\n add_breadcrumb \"Home\", root_path\n end","title":""},{"docid":"cb85514f36ea2349e627b970b5134077","score":"0.58523536","text":"def set_breadcrumbs\n @breadcrumbs = []\n add_breadcrumb \"Home\", root_path\n end","title":""},{"docid":"a9e60f2af323b36c3b6d05925203fe79","score":"0.5852229","text":"def index\n add_breadcrumb \"Articles\",articles_path\n #@articles = Article.all #load_and_authorize should do that\n end","title":""},{"docid":"af06e39aac5701533191f98da1840f93","score":"0.5846687","text":"def index\n @breadcrumbs = [[\"#{t(:accounting_plans)}\"]]\n init\n end","title":""},{"docid":"c59213bea998a158526e5c8701d80889","score":"0.58458954","text":"def show\n @products = @merk_lensa.products.order(\"created_at ASC\").paginate(:page => params[:page], :per_page => 9)\n end","title":""}],"string":"[\n {\n \"docid\": \"ed62ee4b26672c6b567a7eb25068dc73\",\n \"score\": \"0.80103326\",\n \"text\": \"def show\\n add_breadcrumb \\\"#{@product.recipe.name}\\\", :product_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b1c463bfda0722cfafd8906cf67166a7\",\n \"score\": \"0.773324\",\n \"text\": \"def show\\n add_breadcrumb 'shopping cart'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ba0202cc9870cd495e1b367714f5d285\",\n \"score\": \"0.7353934\",\n \"text\": \"def show\\n @product = Product.find(params[:id])\\n @title=@product.title\\n @linked=@product.linked\\n @cart_item = @current_cart.cart_items.new(product_id: @product.id, quantity:1)\\n \\n @category = Category.find(params[:category_id])\\n\\n @breadcrumbs=[]\\n @breadcrumbs << @product\\n if params[:category_id]\\n tmp=Category.find(params[:category_id])\\n while tmp do \\n @breadcrumbs << tmp\\n tmp=tmp.parent\\n end\\n @breadcrumbs=@breadcrumbs.reverse\\n end\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6f7bc745b80f878064334398949fad95\",\n \"score\": \"0.70682573\",\n \"text\": \"def show\\n @shop = Shop.find(params[:id])\\n breadcrumbs.add @shop.name,nil\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @shop }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cb5b5b1b1282fb470332f5d1d1da6969\",\n \"score\": \"0.7025876\",\n \"text\": \"def show\\n add_breadcrumb :show, :show\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8be5ed77d4761402c6a60f684c18c9d4\",\n \"score\": \"0.69740963\",\n \"text\": \"def fetch_product_crumb(product)\\n return \\\"\\\" unless product\\n \\\"#{fetch_categories_crumb(product.category)} / #{[product.name]}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ffe4bc203e7c1f8e17bc6f95cd844caa\",\n \"score\": \"0.69419265\",\n \"text\": \"def show\\n add_breadcrumb_for_show\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f8a4e0e9f327d1a6f73cf68f1bf40baf\",\n \"score\": \"0.67630124\",\n \"text\": \"def show\\n add_breadcrumb @recipe.name, @recipe\\n respond_to do |format|\\n format.html\\n format.json { render json: @recipe }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"259f451891a21daa2dc2b42ead92caca\",\n \"score\": \"0.6696131\",\n \"text\": \"def show\\n add_breadcrumb \\\"show\\\", padraos_path, :title => \\\"Volta para o index\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e207714b2cc6a7b167b219b1a0a2b1ec\",\n \"score\": \"0.66734713\",\n \"text\": \"def get_breadcrumbs\\n current = @product || @brand || @category || @page\\n # BreadcrumbsMaker.build current, params\\n make_breadcrumbs current\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8a3455a424af0f839bc4b6f912a12e7e\",\n \"score\": \"0.6647629\",\n \"text\": \"def index \\n add_breadcrumb \\\"Administrar\\\", :sections_path\\n add_breadcrumb \\\"Recursos\\\", :resources_path \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d76784c26579ff2ee4c8f8da8e82831d\",\n \"score\": \"0.66340107\",\n \"text\": \"def show\\n @products = @category.products.paginate(:page => params[:page], :per_page => 10)\\n @branch_products = @current_branch.products\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"645d323f2791d0cdd472c2ae02f1d80d\",\n \"score\": \"0.6625675\",\n \"text\": \"def show\\n add_breadcrumb \\\"Ver\\\", :usuario_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"06a7d7b91292bac51b2d50fef0b75447\",\n \"score\": \"0.66093934\",\n \"text\": \"def show\\n add_breadcrumb 'Ticket notes'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ff7f15fcd80e8d85ce477732c07ed1d6\",\n \"score\": \"0.6602868\",\n \"text\": \"def create\\n add_breadcrumb 'New product'\\n\\n @product = Product.new(product_params)\\n respond_to do |format|\\n if @product.save\\n format.html do\\n redirect_to @product, notice: 'Product was successfully created.'\\n end\\n format.json { render :show, status: :created, location: @product }\\n else\\n puts @product.errors.messages\\n format.html { render :new , status: :unprocessable_entity }\\n format.json do\\n render json: @product.errors, status: :unprocessable_entity\\n end\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"758346057d1104a617054a4af91cd830\",\n \"score\": \"0.65642977\",\n \"text\": \"def individual_breadcrumb\\n add_breadcrumb \\\"Clients\\\", clients_path, :title => \\\"Clients\\\" \\n add_breadcrumb \\\"Power Of Attorney\\\", '', :title => \\\"Power Of Attorney\\\" \\n add_breadcrumb \\\"Principal Create\\\", '', :title => \\\"Principal Create\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f9ca73842926c9da9578033fd1621424\",\n \"score\": \"0.6542019\",\n \"text\": \"def show\\n breadcrumb\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bcfc3a32c3bfaeae3bbf12c5370722d0\",\n \"score\": \"0.65400743\",\n \"text\": \"def show\\n add_breadcrumb 'Trouble Ticket'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7fa7785067a318dd1588bba1ffbb7fdb\",\n \"score\": \"0.6539872\",\n \"text\": \"def show\\n add_breadcrumb @equipment.name.to_s, '/equipment/' + @equipment.id.to_s\\n add_breadcrumb 'comment', '/comments/' + @comment.id.to_s\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"67355f538ce629c24852939f73b3fa26\",\n \"score\": \"0.65109557\",\n \"text\": \"def show\\n add_breadcrumb @subcategory.title, category_subcategory_path(@category, @subcategory)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e58b491060e73f883c84712397fce9c1\",\n \"score\": \"0.6509415\",\n \"text\": \"def show\\n add_breadcrumb 'Transaction'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"393d1179692dcc4a43bde3c62ab1e159\",\n \"score\": \"0.6482298\",\n \"text\": \"def show\\n add_breadcrumb 'details', departements_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"10dd655e33daed9602c79cd4e1571eba\",\n \"score\": \"0.6480249\",\n \"text\": \"def show\\n add_breadcrumb \\\"show\\\", solexames_path, :title => \\\"Volta para o index\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4bed5d4133c4848625d8a44e27fc815c\",\n \"score\": \"0.6440253\",\n \"text\": \"def more_rest\\n add_breadcrumb \\\"Waktu Kerja dan Lembur\\\", \\\"#absences\\\"\\n add_breadcrumb \\\"Istirahat Lebih\\\", \\\"#more_rest\\\"\\n render :layout => false\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a6928756214f40a0d40c7d4760ea8472\",\n \"score\": \"0.64386266\",\n \"text\": \"def show\\n @type_mode = @product.product_type.nil? ? 'tag' : 'type'\\n\\n add_breadcrumb t('home'), :root_path\\n if @product.product_type_id.nil?\\n add_breadcrumb t('handmadebag'), products_path\\n else\\n add_breadcrumb ProductTypeTranslate.find_by_locale_id_and_product_type_id(session[:locale_id], params[:product_type_id]).name, product_type_products_path(@product.product_type_id)\\n end\\n\\n #set seo meta\\n add_breadcrumb @product.product_translate.name\\n\\n unless @product.product_translate.price\\n render json: 'this product is not available in this locale setting'\\n end\\n\\n @website_title = \\\"#{@product.product_translate.name} | #{@website_title}\\\"\\n @meta_og_title = @product.product_translate.name\\n @meta_og_description = ApplicationController.helpers.truncate(Sanitize.fragment(@product.product_translate.description), length: 100)\\n @meta_og_type = 'product'\\n @meta_og_image = \\\"http://quoiquoi.tw#{@product.image.url(:large)}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"69166cfb103c8a49d5901621717f4e34\",\n \"score\": \"0.6435997\",\n \"text\": \"def show\\n\\n component_type = @component.component_types.first\\n\\n add_breadcrumb \\\"#{component_type ? component_type.title : 'Товары'}\\\", component_type ? components_path(component_type_id: component_type.id) : components_path\\n\\n # http://stackoverflow.com/questions/35614878/breadcrumbs-on-rails-list-show-as-child-of-index\\n add_breadcrumb \\\"#{@component.title}\\\", component_path(@component.id) \\n\\n @components = Component.where.not(id: params[:id]).includes(:component_types).where( :component_types => {:id => @component.component_types.first.id}).order(:title)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"83033c742918444a4e424c680b19e6ee\",\n \"score\": \"0.64259887\",\n \"text\": \"def show\\n @recommend_recommend_tag = Recommend::RecommendTag.find(params[:id])\\n\\n breadcrumbs.add I18n.t(\\\"helpers.titles.#{current_action}\\\", :model => Model_class.model_name.human), recommend_recommend_tag_path(@recommend_recommend_tag)\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @recommend_recommend_tag }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5858c1d826af3ec4bbf96ab7503d85ee\",\n \"score\": \"0.64256084\",\n \"text\": \"def add_breadcrumb_modulo\\n add_breadcrumb breadcrumb('administracao.avaliacao.base')\\n add_breadcrumb pluralize_model(TbPergunta), administracao_tb_perguntas_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6c920811146c7e5efee11fc5db107909\",\n \"score\": \"0.6407804\",\n \"text\": \"def show\\n @product = Product.where([\\\"id = ?\\\", params[:id].to_i]).first\\n raise NoProductError if @product.blank?\\n\\n @providers = @product.providers\\n @product_contents = @product.contents\\n\\n @shop = @product.shop\\n raise NoShopError if @shop.blank?\\n \\n @reviews = @product.reviews\\n @review_images = @product.review_images\\n \\n @main_review = @reviews.first\\n @main_image = @product.images.try(:first)\\n @countries = Country.all\\n\\n add_breadcrumb \\\"#{@shop.name} - #{@product.name} 商品詳細\\\", product_path\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @product }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"824c1332f96af2e0ed0deb390ecb49b4\",\n \"score\": \"0.6392382\",\n \"text\": \"def show\\n @recommend_recommend_ptag = Recommend::RecommendPtag.find(params[:id])\\n\\n breadcrumbs.add I18n.t(\\\"helpers.titles.#{current_action}\\\", :model => Model_class.model_name.human), recommend_recommend_ptag_path(@recommend_recommend_ptag)\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @recommend_recommend_ptag }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8fc4753d1ec584135198d88850ca4603\",\n \"score\": \"0.6384286\",\n \"text\": \"def show\\r\\n add_breadcrumb I18n.t(\\\"breadcrumbs.labs.index\\\"), :labs_path\\r\\n add_breadcrumb @lab_space.lab.name, lab_path(@lab_space.lab)\\r\\n add_breadcrumb @lab_space.name, :lab_lab_space_path\\r\\n add_breadcrumb @equipment.name, :lab_lab_space_equipment_path\\r\\n redirect_to root_path if @equipment.hidden\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f7204c1ea3a7dc51e6f991a0e05c646d\",\n \"score\": \"0.63831854\",\n \"text\": \"def add_breadcrumb_modulo\\n add_breadcrumb pluralize_model(TbAvaliacao), gerente_tb_avaliacoes_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a227ea03ffa9d3e17f1fee147f2620fc\",\n \"score\": \"0.63391215\",\n \"text\": \"def show\\n breadcrumbs_for :show\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f04b88cb059e0677e1eaac62ea1e122f\",\n \"score\": \"0.633797\",\n \"text\": \"def show\\n add_breadcrumb 'details', :arrondissement_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8bf6f7db57769d8649578bcc210b5ad6\",\n \"score\": \"0.63229287\",\n \"text\": \"def index\\n @product = Product.find(params[:product_id].to_i,\\n :conditions => ProductFilter.product_by_category_conditions(@category, @region))\\n\\n @manufacturer_category = get_category_with_infoitem_type(@product.manufacturer_category)\\n # Find all articles related to product\\n @articles = @product.bookcases\\n set_breadcrumb_for @product\\n add_breadcrumb t('navigation.breadcrumbs.bookcases'), @product.url.sub('/product/', '/product/articles/')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc234c5ae70d1d98fb3793ba7828f39a\",\n \"score\": \"0.63187003\",\n \"text\": \"def show\\n add_breadcrumb \\\"Listings\\\", :listings_path\\n add_breadcrumb \\\"Current Listing\\\", :listing_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"40f8d3433af297e13d1c11dac178ee02\",\n \"score\": \"0.6309341\",\n \"text\": \"def show\\n # maybe I need to uncomment this:\\n # @image = Image.find(params[:id]) \\n # add_breadcrumb @image, image_path(@image) \\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @image }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"40f8d3433af297e13d1c11dac178ee02\",\n \"score\": \"0.6309341\",\n \"text\": \"def show\\n # maybe I need to uncomment this:\\n # @image = Image.find(params[:id]) \\n # add_breadcrumb @image, image_path(@image) \\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @image }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"01d07f238b971dbbe68d1e423e4950ca\",\n \"score\": \"0.6304316\",\n \"text\": \"def show\\n add_breadcrumb @rekening.nama_rekening.capitalize\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ba157c7cf3e8796ca7c3774889dad9e9\",\n \"score\": \"0.62870955\",\n \"text\": \"def index\\n @recommend_recommend_tags = Recommend::RecommendTag.paginate(:page => params[:page])\\n #@recommend_recommend_tags = Recommend::RecommendTag.paginate(:page => params[:page], :per_page => 20).order('id DESC')\\n\\n breadcrumbs.add I18n.t(\\\"helpers.titles.#{current_action}\\\", :model => Model_class.model_name.human), recommend_recommend_tags_path\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @recommend_recommend_tags }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dd450df08273595c84b61fec7aecef72\",\n \"score\": \"0.6280279\",\n \"text\": \"def show\\n @breadcrumb = 'read'\\n @product_type = ProductType.find(params[:id])\\n @products = @product_type.products.paginate(:page => params[:page], :per_page => per_page).order('product_code')\\n \\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @product_type }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fa54df9d3de494f600f2b30444008bdd\",\n \"score\": \"0.6278365\",\n \"text\": \"def new\\n # @product_test = ProductTest.new\\n @presentation_picture = PresentationPicture.new\\n add_breadcrumb \\\"Nouvel avis/test\\\", :new_product_test_path\\n respond_to do |format|\\n format.html # new.html.erb\\n format.xml { render :xml => @product_test }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1c6bc64441c06d424a14eb5e7df0c20b\",\n \"score\": \"0.6273998\",\n \"text\": \"def breadcrumbs\\n\\t\\trender :breadcrumbs\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eecb7ac83fa1339eb02b26747b7ed2b3\",\n \"score\": \"0.6270328\",\n \"text\": \"def show\\n @recommend_recommend_other = Recommend::RecommendOther.find(params[:id])\\n\\n breadcrumbs.add I18n.t(\\\"helpers.titles.#{current_action}\\\", :model => Model_class.model_name.human), recommend_recommend_other_path(@recommend_recommend_other)\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @recommend_recommend_other }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e19b27ea16b3a52ab94d93a0f46abbe9\",\n \"score\": \"0.62677443\",\n \"text\": \"def show\\n drop_breadcrumb(\\\"股票\\\")\\n drop_breadcrumb(\\\"#{@stock.name}(#{@stock.market}:#{@stock.code})\\\")\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @stock }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f683840f2789a1f7c69fd1300cfd8e33\",\n \"score\": \"0.6242931\",\n \"text\": \"def show\\n add_breadcrumb \\\"details\\\", :infractions_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"245eda5582edebd29bea79c80678ca96\",\n \"score\": \"0.6242131\",\n \"text\": \"def add_resource_breadcrumb(resource)\\n ancestor_nodes(resource).each do |node|\\n @breadcrumbs << { name: node, url: url_for( action: :edit, id: node.id ) }\\n end\\n super\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4450219e0387cf7446dd2cfe2f37ad52\",\n \"score\": \"0.6222868\",\n \"text\": \"def show\\n ## 面包屑导航\\n add_breadcrumb I18n.t('view.action.show'), :back_catagory_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ad501523a60dd1c29c10d24fd2cab698\",\n \"score\": \"0.6205671\",\n \"text\": \"def show\\n @product_tree = ProductTree.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @product_tree }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc83909a63a0eaa8b6b6ec69bdb04587\",\n \"score\": \"0.61895657\",\n \"text\": \"def show\\n add_breadcrumb @pegawai.nama_pegawai.capitalize\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8bcde8c8026d546f476ceedddb6ab91a\",\n \"score\": \"0.6187625\",\n \"text\": \"def show\\n @brand = Brand.friendly.find(params[:brand_id])\\n if request.path != product_path(@product)\\n redirect_to @product, status: :moved_permanently\\n end\\n @products = Product.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"430c33a29cc40972790d2ceb59e22245\",\n \"score\": \"0.6178055\",\n \"text\": \"def show\\n add_breadcrumb proc { I18n.t('breadcrumbs.explore', default: 'explore') }, :research_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5cee3635bf03486c0dcc023bfa018ea6\",\n \"score\": \"0.6167413\",\n \"text\": \"def less_rest\\n add_breadcrumb \\\"Waktu Kerja dan Lembur\\\", \\\"#absences\\\"\\n add_breadcrumb \\\"Istirahat Kurang\\\", \\\"#lest_rest\\\"\\n render :layout => false\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1a7b04c3119fd238235e06c042cbecf6\",\n \"score\": \"0.61652505\",\n \"text\": \"def show\\n @tag_identity = Identity.find(params[:id])\\n\\n breadcrumbs.add I18n.t(\\\"helpers.titles.#{current_action}\\\", :model => Model_class.model_name.human), tag_identity_path(@tag_identity)\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @tag_identity }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7c874ae263eb258883a8c626a4d1464b\",\n \"score\": \"0.61396307\",\n \"text\": \"def show\\n @location = Location.by_vendor.find_by_id(params[:id])\\n\\n add_breadcrumb @location.name,'location_path(@location,:vendor_id => params[:vendor_id], :type => params[:type])'\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @location }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a6c16fa1d7b96bc63164773c54db0b96\",\n \"score\": \"0.6115842\",\n \"text\": \"def show\\n add_breadcrumb @kelurahan.nama.capitalize\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"141ee4a40cc2ca271552cc22c1b47d54\",\n \"score\": \"0.609399\",\n \"text\": \"def show\\n add_breadcrumb I18n.t('integral.navigation.list'), list_backend_resources_url\\n add_breadcrumb I18n.t('integral.actions.view')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"06c3b0cb44edbc329b7bfebb8c42a3fc\",\n \"score\": \"0.60925484\",\n \"text\": \"def show\\n add_breadcrumb \\\"Detalles\\\", @prospectos\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b1bb5e5c32bc07938430006c31e38503\",\n \"score\": \"0.6073066\",\n \"text\": \"def show\\n @brand = Brand.friendly.find(params[:id])\\n if request.path != brand_path(@brand)\\n redirect_to @brand, status: :moved_permanently\\n end\\n @products = @brand.products\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ecae0fcf89c6c1de3e4cb1387a308ddf\",\n \"score\": \"0.60721534\",\n \"text\": \"def product_breadcrumb?(product=nil)\\n\\t\\t!product.empty?\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"71f5bf14000b17780f40a0b63f6a55b6\",\n \"score\": \"0.6069196\",\n \"text\": \"def add_breadcrumbs\\n breadcrumb_for \\\"index\\\" # base\\n\\n if action_name != \\\"index\\\"\\n breadcrumb_for action_name\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5d2371ca56fee0f62a8ac2ca398b1732\",\n \"score\": \"0.6032126\",\n \"text\": \"def show\\n add_breadcrumb @jabatan.nama_jabatan.capitalize\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5e98d132d3d27d5bfcf1cffb9af044e1\",\n \"score\": \"0.60263485\",\n \"text\": \"def list_products\\n render \\\"products_view/all\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b6fec756ad05ee2311db9840a9020215\",\n \"score\": \"0.60104024\",\n \"text\": \"def show\\n #@product = Cache.get 'product_' + params[:id].to_s\\n unless @product\\n begin\\n @product = Product.find(params[:id], :include => [:ds_vendor, :product_images])\\n @product = ProductDecorator.new(@product)\\n rescue\\n flash[:notice] = \\\"I'm sorry. We couldn't find the product you were looking for\\\"\\n redirect_to '/' and return \\n end\\n #Cache.put 'product_' + params[:id].to_s, @product\\n end\\n @breadcrumb = Cache.get 'product_' + params[:id].to_s + '_breadcrumb'\\n unless @breadcrumb\\n @breadcrumb = @product.category.breadcrumb\\n #Cache.put 'product_' + params[:id].to_s + '_breadcrumb', @breadcrumb\\n end\\n @related_products = Product.find(:all, :conditions => [ 'products.manufacturer = ? and products.id != ?', @product.manufacturer, @product.id], :limit => 4, :include => :product_images) \\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @product }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f2df19fb0ce555e3acc0aaf742d15956\",\n \"score\": \"0.5995615\",\n \"text\": \"def index\\n @recommend_recommend_ptags = Recommend::RecommendPtag.paginate(:page => params[:page])\\n\\n breadcrumbs.add I18n.t(\\\"helpers.titles.#{current_action}\\\", :model => Model_class.model_name.human), recommend_recommend_ptags_path\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @recommend_recommend_ptags }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"def98d6b2e8a4142ae8cc5940e7b2ada\",\n \"score\": \"0.5995017\",\n \"text\": \"def add_breadcrumb(resource, label: :title, path: nil)\\n if resource.instance_of?(String)\\n semantic_breadcrumb I18n.t(resource), path\\n else\\n semantic_breadcrumb resource.send(label), path\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"30fe33fde40c1b273dbb4b224c25378c\",\n \"score\": \"0.59836996\",\n \"text\": \"def show\\n authorize @sale\\n add_breadcrumb @sale.reference\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8009a1071bbded19883e05d51ef1da7e\",\n \"score\": \"0.5982824\",\n \"text\": \"def show\\n @title = 'My Account'\\n add_breadcrumb t('my_account')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"96368494cab05904da6abc8b7056005e\",\n \"score\": \"0.59770596\",\n \"text\": \"def show\\n @ticket = Ticket.find(params[:id])\\n @tickets = Ticket.find(:all, :conditions => [\\\"event_id = ?\\\", @ticket.event_id])\\n @tickets = @tickets.paginate(:page => params[:page])\\n \\n #Define breadcrumbs\\n @l1_link = tickets_path\\n @l1_name = \\\"Tickets\\\" \\n @l2_link = ticket_path\\n @l2_name = \\\"Ticket \\\" + @ticket.id.to_s\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @ticket }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"760cd19b461c195f3c38ce8ec074eb6d\",\n \"score\": \"0.59726685\",\n \"text\": \"def show\\n add_breadcrumb \\\"Trainings\\\", :trainings_path, { :title => \\\"Trainings\\\" }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d912a4f036814ffe23ac1e4884ab8305\",\n \"score\": \"0.5971008\",\n \"text\": \"def show\\n #binding.pry\\n add_breadcrumb \\\"Articles\\\",articles_path\\n cat=@article.category\\n if cat\\n cat.ancestors.reverse_each { |a| add_breadcrumb a.name,category_path(a) }\\n add_breadcrumb cat.name,category_path(cat)\\n end\\n add_breadcrumb @article.title,article_path\\n #ASK how to make this more DRY\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9f11a60d5ac8c9f93c24cdab371b50cf\",\n \"score\": \"0.5970904\",\n \"text\": \"def auto_set_breadcrumb\\n ariane.add(\\\"Home\\\", root_path, 1) if ariane.crumbs.empty? \\n \\n if self.action_name == \\\"index\\\"\\n name = controller_name.titleize\\n level = get_level || 2\\n else\\n name = \\\"#{action_name.titleize} #{controller_name.singularize.titleize}\\\"\\n level = get_level || 3\\n end\\n\\n ariane.add(name, request.fullpath, level)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6ffa602e494f8252e9854fc8e1b35991\",\n \"score\": \"0.5966027\",\n \"text\": \"def show\\n add_breadcrumb \\\"Subjects Design\\\", subjects_path, :title => \\\"Back to the Index\\\"\\n add_breadcrumb \\\"Subjects Allocation\\\", subject_allocations_path\\n add_breadcrumb \\\"Details\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0da1b52a13931c45fe1e0a0e4d583fff\",\n \"score\": \"0.59650064\",\n \"text\": \"def show\\n @order = Order.scopied.find_by_id(params[:id].to_s)\\n add_breadcrumb t(\\\"menu.order\\\") + \\\"#\\\" + @order.nr.to_s,'order_path(@order,:vendor_id => salor_user.meta.vendor_id)'\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @order }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c3ef24c73b7d5b0a29f0cbbeaf4eb3f\",\n \"score\": \"0.5963229\",\n \"text\": \"def show\\n @products = CatalogMebeli.find(params[:id]).products\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @product }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"910c81e79756ec63d2aeefd26d4ab489\",\n \"score\": \"0.59541714\",\n \"text\": \"def show\\n add_breadcrumb \\\"Batches\\\", batches_url\\n add_breadcrumb \\\"Details\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d5641f1922527eed7ff908b736c4df77\",\n \"score\": \"0.5952908\",\n \"text\": \"def show\\n @recommend_recommend_subject = Recommend::RecommendSubject.find(params[:id])\\n\\n breadcrumbs.add I18n.t(\\\"helpers.titles.#{current_action}\\\", :model => Model_class.model_name.human), recommend_recommend_subject_path(@recommend_recommend_subject)\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @recommend_recommend_subject }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0e6081c28e2ed0a88e530525db83ef75\",\n \"score\": \"0.5945389\",\n \"text\": \"def breadcrumb\\n Array(@breadcrumb)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"92352d3f6b4efc870c981df761fc8105\",\n \"score\": \"0.593386\",\n \"text\": \"def index\\n flash[:message] = nil\\n\\n @type_mode = @product_type.nil? ? 'tag' : 'type'\\n\\n respond_to do |format|\\n format.html do\\n add_breadcrumb t('home'), :root_path\\n\\n @products = get_products\\n\\n if params[:product_type_id]\\n product_type_name = ProductType.find(params[:product_type_id]).product_type_translates.find_by_locale_id(session[:locale_id]).name\\n else\\n product_type_name = I18n.t('handmadebag')\\n end\\n\\n add_breadcrumb product_type_name\\n\\n # append to title name for seo\\n @website_title = \\\"#{product_type_name} | #{@website_title}\\\"\\n end\\n\\n format.json do\\n helpers = ApplicationController.helpers\\n products = get_products\\n\\n render(\\n json:\\n {\\n items: products.collect do |product|\\n [\\n {\\n key: 'url',\\n value: polymorphic_path([@product_type, product])\\n },\\n {\\n key: 'truncated_name',\\n value: helpers.truncate(product.product_translate.name, length: (session[:locale] == 'en')? 38 : 20)\\n },\\n {\\n key: 'name',\\n value: product.product_translate.name\\n },\\n {\\n key: 'image',\\n value: product.image.url(:small)\\n },\\n {\\n key: 'price',\\n value: helpers.number_to_currency(helpers.price_discount(product.product_translate.price, product.discount))\\n },\\n {\\n key: 'discount',\\n value: t('product.discount', percent: helpers.locale_discount(product.discount, session[:locale_id]))\\n },\\n {\\n key: 'visible',\\n value: (product.discount > 0)? '' : 'hidden'\\n }\\n ]\\n end,\\n nextPage: (products.total_pages > products.current_page) ? polymorphic_path([@product_type, :products], page: ((params[:page] || 1).to_i + 1), tag: params[:tag], format: :json) : nil\\n }\\n )\\n end\\n\\n format.xml do\\n @products = Product.includes(:product_translate)\\n .where(product_translates: {locale_id: session[:locale_id]},\\n visible: true)\\n .where.not(product_translates: {name: '', description: '', price: nil})\\n .order(id: :desc).limit(50)\\n\\n render template: 'products/index.atom.builder', layout: false\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"363e14d1d9dd7831dfde2c8c8b20c606\",\n \"score\": \"0.593189\",\n \"text\": \"def show\\n add_breadcrumb \\\"Detalles\\\", @reqcargos\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a2d5ef1ce0cd6d79dde56f8cf7fbdc8f\",\n \"score\": \"0.5929522\",\n \"text\": \"def the_breadcrumb(add_post_type = true)\\n generate_breadcrumb(add_post_type)\\n h.breadcrumb_draw\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e985a6c9a8d091d06de3999678a1351b\",\n \"score\": \"0.5927581\",\n \"text\": \"def show\\n add_breadcrumb \\\"Detalles\\\", @centro_costos\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7841e72f8dc2dd36e222e8e5e5b61790\",\n \"score\": \"0.5923625\",\n \"text\": \"def transaction_show\\n add_breadcrumb \\\"Merchants\\\", epsadmin_merchants_path\\n add_breadcrumb \\\"#{@transc_merchant.first_name}\\\", epsadmin_merchant_path(@transc_merchant.merchant_uniq_id)\\n add_breadcrumb \\\"Transaction\\\", epsadmin_merchant_transaction_path\\n @epsadmin_transaction_indiv = Transaction.find(params[:id])\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @epsadmin_transaction_indiv }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d8c0e5996c08ceae1db488aa13087a4\",\n \"score\": \"0.59194684\",\n \"text\": \"def show\\r\\n @ph_product = PhProduct.find(params[:id])\\r\\n\\r\\n add_breadcrumb _(\\\"My products\\\").html_safe, :products_url\\r\\n add_breadcrumb @ph_product.product.name, edit_product_url(@ph_product.product)\\r\\n add_breadcrumb _(\\\"Environmental Assessment\\\").html_safe, ph_production_init_path(@ph_product)\\r\\n add_breadcrumb _(\\\"Data Entry\\\").html_safe, ph_electric_component_path(@ph_product)\\r\\n \\r\\n if !@ph_product.ph_electric_component\\r\\n ph_electric_component = PhElectricComponent.new \\r\\n ph_electric_component.ph_product_id = @ph_product.id\\r\\n ph_electric_component.include_batteries = 'no' \\r\\n ph_electric_component.save\\r\\n @ph_product.ph_electric_component = ph_electric_component\\r\\n end\\r\\n @ph_electric_component = @ph_product.ph_electric_component\\r\\n @step = 4\\r\\n @product = @ph_product.product\\r\\n \\r\\n @ph_battery_types = PhBatteryType.all\\r\\n\\r\\n respond_to do |format|\\r\\n format.html # show.html.erb\\r\\n format.xml { render :xml => @ph_electric_component }\\r\\n end\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b54140f712fd082aa55ec45892f7e2a5\",\n \"score\": \"0.5913054\",\n \"text\": \"def add_breadcrumb name, url = ''\\n\\t\\t@breadcrumbs ||= []\\n\\t\\t url = eval(url) if url =~ /_path|_url|@/\\n\\t\\t@breadcrumbs << [name, url]\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b501b0db8d96e1ebad41708b274b701d\",\n \"score\": \"0.5911563\",\n \"text\": \"def show\\n @product = Product.find(params[:id])\\n if @product.parent_id == nil\\n\\n @brand = @product.brands\\n @same = Product.find(:all, :conditions => {:brands => @brand, :parent_id => nil}).sample(4)\\n @children = Product.find(:all, :conditions => {:parent_id => @product.id})\\n \\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @product }\\n end\\n else\\n @product = Product.find(@product.parent_id)\\n redirect_to @product\\n end\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"215fca500357c7961cf5b8cf98d029d1\",\n \"score\": \"0.59073246\",\n \"text\": \"def show\\n\\n @category = Category.find(params[:id])\\n @products = Product.category(@category.title).page(params[:page]).per(6).asc(:list_order)\\n @title = @category.title\\n @brands = Brand.all\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @category }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6863b1d6864d3c4b05da877dcff9da42\",\n \"score\": \"0.590654\",\n \"text\": \"def build_breadcrumbs\\n @breadcrumbs = [\\n { :title => I18n.t(\\\"admin.sections.#{resource_collection_name}\\\"), :url => collection_path }\\n ]\\n @breadcrumbs << { :title => params[:action] } unless params[:action] == 'index'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"48512055effb95996914b3546696755b\",\n \"score\": \"0.5904712\",\n \"text\": \"def index\\n \\n \\n if params[:category_id] # TO CHANGE\\n @category = Category.find_by_cached_slug(params[:category_id])\\n @product_tests = @category.published.product_tests.recent.page(params[:page]).per(5)\\n add_breadcrumb \\\"Catégories\\\", :categories_path, :title => \\\"Revenir à la liste des catégories\\\"\\n add_breadcrumb @category.name.camelize, category_path(@category)\\n add_breadcrumb \\\"Avis/Tests de produits\\\", product_tests_from_category_path(@category), :title => \\\"Revenir à la liste des avis/tests de produits\\\"\\n else\\n add_breadcrumb \\\"Avis/Tests de produits\\\", :product_tests_path, :title => \\\"Revenir à la liste des avis/tests de produits\\\"\\n @product_tests = ProductTest.published.recent.page(params[:page]).per(5)\\n end\\n \\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @product_tests }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9ba694d38d001bf1ab580b57346f3760\",\n \"score\": \"0.5903778\",\n \"text\": \"def set_root_breadcrumb\\n add_breadcrumb 'Top'.html_safe, root_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be6e9e708803b58b44ea5c1172313ba5\",\n \"score\": \"0.590128\",\n \"text\": \"def show\\n\\n add_breadcrumb @asset.asset_tag, inventory_path(@asset)\\n add_breadcrumb \\\"Maintenance History\\\", inventory_maintenance_events_path(@asset)\\n add_breadcrumb \\\"Service on #{@maintenance_event.event_date}\\\"\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render :json => @maintenance_event }\\n end\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8f4a48c93fcc533b5cf2e87a15a32cde\",\n \"score\": \"0.5893474\",\n \"text\": \"def show\\n @entry = Entry.find(params[:id])\\n @entry.viewed\\n breadcrumbs.add \\\"医药招商\\\",entries_url\\n breadcrumbs.add nil\\n #breadcrumbs.add @entry.title\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @entry }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d25e6748b30e63b04d9c9ed69f65e004\",\n \"score\": \"0.5874213\",\n \"text\": \"def add_resource_breadcrumb(resource)\\n ancestors = []\\n if resource.new_record?\\n if resource.parent_id\\n ancestors = resource.parent.ancestors\\n ancestors += [resource.parent]\\n end\\n else\\n ancestors = resource.ancestors\\n end\\n\\n ancestors.each do |ancestor|\\n @breadcrumbs << { name: ancestor, url: url_for( action: :edit, id: ancestor.id ) }\\n end\\n\\n super\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d3070f22a836376b4ce61cc0909c2b91\",\n \"score\": \"0.5865418\",\n \"text\": \"def index\\n b_admin = current_user.admin? rescue false\\n @products = Product.filter_by_params(b_admin, params)\\n #@products = Product.available\\n \\n @title = Product.page_description(params)\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @products }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8d0c588fb0f6fc9a1c19d1a5886fdd0d\",\n \"score\": \"0.586171\",\n \"text\": \"def show\\n @competency = @resource.competency\\n breadcrumb\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cb85514f36ea2349e627b970b5134077\",\n \"score\": \"0.58523536\",\n \"text\": \"def set_breadcrumbs\\n @breadcrumbs = []\\n add_breadcrumb \\\"Home\\\", root_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cb85514f36ea2349e627b970b5134077\",\n \"score\": \"0.58523536\",\n \"text\": \"def set_breadcrumbs\\n @breadcrumbs = []\\n add_breadcrumb \\\"Home\\\", root_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a9e60f2af323b36c3b6d05925203fe79\",\n \"score\": \"0.5852229\",\n \"text\": \"def index\\n add_breadcrumb \\\"Articles\\\",articles_path\\n #@articles = Article.all #load_and_authorize should do that\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"af06e39aac5701533191f98da1840f93\",\n \"score\": \"0.5846687\",\n \"text\": \"def index\\n @breadcrumbs = [[\\\"#{t(:accounting_plans)}\\\"]]\\n init\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c59213bea998a158526e5c8701d80889\",\n \"score\": \"0.58458954\",\n \"text\": \"def show\\n @products = @merk_lensa.products.order(\\\"created_at ASC\\\").paginate(:page => params[:page], :per_page => 9)\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":177,"cells":{"query_id":{"kind":"string","value":"6ec94c41d23358ced68a405ac5ffd30d"},"query":{"kind":"string","value":"A version with an incremented version number that would be applied after the latest (local or applied) migration."},"positive_passages":{"kind":"list like","value":[{"docid":"08eab6bdb4601469f4deb478ec680803","score":"0.661586","text":"def next_version(bump_type=nil)\n local_max = local_versions.max || Version.new('0')\n applied_max = applied_versions.max || Version.new('0')\n max_version = [local_max, applied_max].max\n max_version.next(bump_type)\n end","title":""}],"string":"[\n {\n \"docid\": \"08eab6bdb4601469f4deb478ec680803\",\n \"score\": \"0.661586\",\n \"text\": \"def next_version(bump_type=nil)\\n local_max = local_versions.max || Version.new('0')\\n applied_max = applied_versions.max || Version.new('0')\\n max_version = [local_max, applied_max].max\\n max_version.next(bump_type)\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"32e712acec1aee74293cdce04d7991c3","score":"0.7489249","text":"def next_version\n (new_record? ? 0 : versions.calculate(:maximum, version_column).to_i) + 1\n end","title":""},{"docid":"33d4a749b8bf2e23ae57f671f2a00015","score":"0.7220128","text":"def increment_version\n old_version = Changelog.where(package_id: self.package_id).maximum(:version)\n now_date = Date.today.to_s.split(\"-\").join # 20120703\n counter = 1\n\n if old_version\n old_date, counter = old_version.split(\"-\")\n counter = (now_date == old_date) ? (counter.to_i + 1) : 1\n end\n\n self.version = \"#{now_date}-#{counter}\"\n end","title":""},{"docid":"700174d33eec35da5b79b85dc52d80af","score":"0.7152542","text":"def next_migration_number\n self.current_migration_number + 1\n end","title":""},{"docid":"cf94456b19599a4d7cf588c5f19c98eb","score":"0.710729","text":"def next_migration_number(number); end","title":""},{"docid":"5d23c29b18eab3974216a362f56bec94","score":"0.7074096","text":"def next_version\n return 1 if new_record? || standard_versions.empty?\n (standard_versions.maximum(:version) || 0) + 1\n end","title":""},{"docid":"40c69fd4eb2b806767e65e48749a2aaf","score":"0.69177413","text":"def current_version\n if current_direction == :down\n migration_context.current_version\n elsif current_direction == :up\n pending_migrations.first\n end\n end","title":""},{"docid":"e32744a369c6da339d28ae50ed1783b7","score":"0.69065803","text":"def alter_version\r\n @version += 1\r\n end","title":""},{"docid":"29b39cbf894cf0943eb7b09f6585bc3f","score":"0.68406343","text":"def migration_number; end","title":""},{"docid":"9d442c92fbe6559b1eefa68691a6e613","score":"0.67778516","text":"def next_version_number\n self.class.connection.next_val_sequence(\"#{self.class.table_name}_$_version_number\")\n end","title":""},{"docid":"8bf58233226e67b2884779491335bc8a","score":"0.6773771","text":"def next_version\n work.next_version\n end","title":""},{"docid":"2bdd97b1c74ba9a290b88e4bef8e1f4c","score":"0.6724718","text":"def set_new_version\n @saving_version = new_record? || save_version?\n self.send(\"#{self.class.version_column}=\", next_version) if new_record? || (!locking_enabled? && save_version?)\n end","title":""},{"docid":"74050730e913966250e244bbb1bfae58","score":"0.6712367","text":"def next_version(v)\n v.succ\nend","title":""},{"docid":"4a007901d332ea66862631759c2b7aa5","score":"0.67081743","text":"def next_version_number\n v_no = (versions.last || 'v000').gsub(/v/,'').to_i + 1\n \"v%03d\"%[v_no]\n end","title":""},{"docid":"58574e0aa91c49ae616cc306a93fda75","score":"0.66926813","text":"def last_migrated_number\n (ActiveRecord::Migrator.get_all_versions & all_migration_numbers).max.to_i #nil to zero\n end","title":""},{"docid":"c2c6691792f89b7aa6f569c2e523b5e1","score":"0.6686112","text":"def new_version_number\n version_cache.new_version_number ||= begin\n latest_version = versions.desc(:number).limit(1).first\n ver = latest_version.number if latest_version\n [ver.to_i, version_number].max + 1\n end\n end","title":""},{"docid":"aa9f9968eb549e673e3119da143ea15a","score":"0.66424924","text":"def current_migration_version\n ds.get(column) || 0\n end","title":""},{"docid":"de8d3fbbad2bcea0fed66a9d49cccc99","score":"0.6629853","text":"def bump_version(current_version)\n next_version = current_version\n\n if @config.engine_version_bump_type == :major\n next_version.major = next_version.major + 1\n next_version.minor = 0\n next_version.patch = 0\n elsif @config.engine_version_bump_type == :minor\n next_version.minor = next_version.minor + 1\n next_version.patch = 0\n else\n next_version.patch = next_version.patch + 1\n end\n return next_version\n end","title":""},{"docid":"3c3a652a19676a9a7afaebaec1925c19","score":"0.66110575","text":"def next_migration_number(dirname) #:nodoc:\n if ActiveRecord::Base.timestamped_migrations\n Time.now.utc.strftime(\"%Y%m%d%H%M%S\")\n else\n \"%.3d\" % (current_migration_number(dirname) + 1)\n end\n end","title":""},{"docid":"426e5038aa3b6f029d57a61893324ae8","score":"0.65856427","text":"def new_version(version, next_version)\n # Remove any suffix beginning with a hyphen, e.g. 1.2.3-beta.1 -> 1.2.3\n components = version.sub(/-.*$/, '').split '.'\n\n case next_version\n when 'patch', nil\n components[2] = components[2].to_i + 1\n when 'minor'\n components[1] = components[1].to_i + 1\n when 'major'\n components[0] = components[0].to_i + 1\n else\n return next_version\n end\n\n components.join '.'\n end","title":""},{"docid":"13f33c4b035622764161e6dff653d47b","score":"0.65469426","text":"def next_migration_number(number)\n if ActiveRecord::Base.timestamped_migrations\n [Time.now.utc.strftime(\"%Y%m%d%H%M%S\"), \"%.14d\" % number].max\n else\n SchemaMigration.normalize_migration_number(number)\n end\n end","title":""},{"docid":"61c9e62ba821112c7c458ed86e34c530","score":"0.6546614","text":"def upgrade_version\n\t\tp self.version.to_s\n\t\tif ! self.version.eql? 1\n\t\t\tmain = Catalog.main.first\n\t\t\tif ! main.nil?\n\t\t\t\tmain.version = 2\n\t\t\t\tmain.save\n\t\t\tend\n\t\t\tself.version = 1\n\t\t\tself.save\n\t\tend\n\t\tself.version\n\tend","title":""},{"docid":"0a61bd3bc6464df7169ae0641b35ab21","score":"0.651592","text":"def next_release_version\n attrs = { release_id: @release_model.id }\n models = Models::ReleaseVersion.filter(attrs).all\n strings = models.map(&:version)\n list = Bosh::Common::Version::ReleaseVersionList.parse(strings)\n list.rebase(@version)\n end","title":""},{"docid":"0a61bd3bc6464df7169ae0641b35ab21","score":"0.651592","text":"def next_release_version\n attrs = { release_id: @release_model.id }\n models = Models::ReleaseVersion.filter(attrs).all\n strings = models.map(&:version)\n list = Bosh::Common::Version::ReleaseVersionList.parse(strings)\n list.rebase(@version)\n end","title":""},{"docid":"9f086115bee8f1558e034c78fedc97e4","score":"0.65152854","text":"def migrate!(number = nil)\n unless number || version_cache.wanted_version_number\n raise(MigrationError, 'no version given')\n end\n if number && number != version_cache.wanted_version_number\n version!(number)\n end\n if version_cache.self_version\n raise(MigrationError, 'cannot migrate to current version')\n end\n\n set_original_version_obj\n\n if version_object.future?\n version_object.update_attributes(:created_at => Time.now)\n end\n\n self.attributes = version_attributes\n self.version_number = version_cache.wanted_version_number\n save!\n end","title":""},{"docid":"42c6cc3555a09ecd97986c6acef82a29","score":"0.64995366","text":"def version\r\n @version + 1\r\n end","title":""},{"docid":"006180c7c6b51990ad7134e99fd2aba1","score":"0.6493778","text":"def next_migration_number(number)\n if ActiveRecord.timestamped_migrations\n [Time.now.utc.strftime(\"%Y%m%d%H%M%S\"), \"%.14d\" % number].max\n else\n \"%.3d\" % number.to_i\n end\n end","title":""},{"docid":"ba05d5660e6ef21728ea00c5dbd93e90","score":"0.6474415","text":"def next_revision_number(existing_model)\n existing_model.revision_number + 1\n end","title":""},{"docid":"1a8edb6c4674ff3f231a1d57efa9bb73","score":"0.6461477","text":"def nextVersion(version)\n version.succ\nend","title":""},{"docid":"1a8edb6c4674ff3f231a1d57efa9bb73","score":"0.6461477","text":"def nextVersion(version)\n version.succ\nend","title":""},{"docid":"e6b76fe6b1a7c7622c50c1b854576a30","score":"0.64278924","text":"def update_with_version\n if self.class.instance_variable_get('@versionable') && self.changed?\n if disable_versionable_once\n update_without_version\n return\n end\n self.version_number = next_version_number\n create_new_version\n update_without_version\n else\n update_without_version\n end\n end","title":""},{"docid":"f49a53de59b2908ad5aa7f7b2ccc93e4","score":"0.64131653","text":"def latest_migration\n migrations.last\n end","title":""},{"docid":"9baf0a392d877fff710745759ddd794e","score":"0.63992774","text":"def last_version\n @last_version ||= versions.maximum(:number) || 1\n end","title":""},{"docid":"24709ab9969a2d25f615703b08bc5aa8","score":"0.639916","text":"def next_migration_number(_path)\n Time.now.utc.strftime('%Y%m%d%H%M%S')\n end","title":""},{"docid":"d465bb4091ddfc6a2473e9f4adf37958","score":"0.63973993","text":"def increment_version\n version_parts = get_version.split('.').map { |n| n.to_i }\n version_parts[2] += 1\n version_parts.join('.')\nend","title":""},{"docid":"0d88c700a732c5eb45738345921d0e13","score":"0.6396026","text":"def bump\n max = history.releases[0].changes.map{ |c| c.level }.max\n if max > 1\n bump_part('major')\n elsif max >= 0\n bump_part('minor')\n else\n bump_part('patch')\n end\n end","title":""},{"docid":"ad9aa8c0e2d1e2bae6fbe7ce59f4b641","score":"0.6387444","text":"def update_version_created\n return if version_id\n return unless version_added\n new_version = Version.find_or_create_by(number: version_added)\n update_attributes(version_id: new_version.id)\n new_version.number\n end","title":""},{"docid":"834b186b404b6cad41d1e516a2dd931c","score":"0.6382192","text":"def new_rev old_rev=nil\n if old_rev\n num = old_rev.split('-')[0].to_i\n \"#{num +1}-#{uuid()}\"\n else\n \"1-#{uuid()}\"\n end\n end","title":""},{"docid":"4b6afc4617bde5e8ae7e4d4c578f1d27","score":"0.63793904","text":"def version(number, migrations = [])\n Version.new(number, migrations).tap do |version|\n versions << version\n sort_versions\n end\n end","title":""},{"docid":"2b7cd7a4bd65b819d115531de3877b69","score":"0.63656014","text":"def next_migration_number(dirname)\n ::ActiveRecord::Generators::Base.next_migration_number(dirname)\n end","title":""},{"docid":"a58ee0533551d345479784360e95eb3f","score":"0.6348882","text":"def update_version\n return create_version unless v = versions.last\n v.modifications_will_change!\n v.update_attribute(:modifications, v.changes.append_changes(version_changes))\n reset_version_changes\n reset_version\n end","title":""},{"docid":"5bf175c5c2d2d1c4495a298028f25e7f","score":"0.634594","text":"def current_version_number\n get_and_set_current_version\n end","title":""},{"docid":"bbdbcd337bbb4940404a49d9c7032ace","score":"0.6341898","text":"def latest_migration\n migrations.last\n end","title":""},{"docid":"a828565cc62fd79fe059398b4350404f","score":"0.6336538","text":"def next_revision(revision)\n Time.now.to_i + 1\n end","title":""},{"docid":"3d65b786638f3f1cfbf1af54950db82b","score":"0.63362515","text":"def current_version\n versions.first :order => [:number.desc]\n end","title":""},{"docid":"2f07407de9ca128f7fc4216c6965d78d","score":"0.63314456","text":"def last_version_number\n last = versions.first\n last ? last.number : 0\n end","title":""},{"docid":"ab3388326e74062327b214ac848933f8","score":"0.63081485","text":"def bump\n ints = build_array_from_version_string\n ints.pop if ints.size > 1\n ints[-1] += 1\n self.class.new(ints.join(\".\"))\n end","title":""},{"docid":"0b7368724c5fb507b0e9b1addbead67e","score":"0.62960774","text":"def version\n return last_version if versionable?\n version_number\n end","title":""},{"docid":"aa885aa4f8ae3079134a014efb0ebcd0","score":"0.6283387","text":"def next_version(extra_attributes = {})\n resource.git_versions.build.tap do |gv|\n [:visibility, :git_repository_id, :ref, :commit, :root_path].each do |attr|\n gv.send(\"#{attr}=\", send(attr))\n end\n gv.comment = nil\n gv.ref = nil\n gv.version = (version + 1)\n gv.name = \"Version #{gv.version}\"\n gv.set_resource_attributes(resource.attributes)\n gv.assign_attributes(extra_attributes)\n gv.git_annotations = git_annotations.map(&:dup)\n end\n end","title":""},{"docid":"aae25124f50371326732bc8a4c4aa97c","score":"0.6276743","text":"def increment_worker_version\n newver = self.get_worker_version + 1\n self.set_worker_version(newver)\n newver\n end","title":""},{"docid":"102d91fc2aa2db43270c4bce4a6923f4","score":"0.6276187","text":"def last_version\n return 0 if versions.count == 0\n versions.first.version_number \n end","title":""},{"docid":"c2a67463f4bec62d5c8a2de217e01f1e","score":"0.6270248","text":"def revise\n previous = find_last_version\n if previous\n versions.target << previous.clone\n versions.shift if version_max.present? && versions.length > version_max\n self.version = (version || 1 ) + 1\n @modifications[\"versions\"] = [ nil, versions.as_document ] if @modifications\n end\n end","title":""},{"docid":"8c5b44a6583345ec5c549b6c18193e76","score":"0.6246396","text":"def next_migration_string_with_follow_up(padding = 3)\n if ActiveRecord::Base.timestamped_migrations\n @next_migration_string ||= Time.now.utc.strftime(\"%Y%m%d%H%M%S\")\n @next_migration_string = (@next_migration_string.to_i + 1).to_s\n else\n \"%.#{padding}d\" % next_migration_number\n end\n \n end","title":""},{"docid":"247818e95fe43570fa16c241910a5e53","score":"0.62321293","text":"def rollback_version(rollback_to=-1)\n ##DEFAULT TO LAST (NEWEST)\n #debugger\n vers = self.versions.to_a.reverse\n return false if vers.empty?\n rollback_to = -1 if rollback_to==0 or rollback_to>vers.length\n rollback_to = 0 if rollback_to<-vers.length\n rollback_to -= 1 if rollback_to>0\n new_ver = vers[rollback_to]\n ver_no = rollback_to+1\n ver_no = vers.length+ver_no if ver_no<=0\n #debugger\n props = self.attributes.keys-[:id,:created_at,:deleted_at,:updated_at,:updated_by,:updated_comment,:provenance_comment]\n props.each{|p|\n self[p] = new_ver[p] }\n self.provenance_comment = 'ROLLBACK VERSION '+ver_no.to_s\n return self.save\n end","title":""},{"docid":"04a057257d3a9ffbb154c7f49346e983","score":"0.6228797","text":"def create_initial_version\n versions.create(version_attributes.merge(:number => 1))\n reset_version_changes\n reset_version\n end","title":""},{"docid":"9876c9f7c714697c4afad8b446f3acda","score":"0.622074","text":"def current_migration_number\n if fetch_component_choice(:migration_format).to_s == 'timestamp'\n Time.now.utc.strftime(\"%Y%m%d%H%M%S\")\n else\n return_last_migration_number + 1\n end.to_s\n end","title":""},{"docid":"6bb7dbc6c473b49106793e234346ae5d","score":"0.62138474","text":"def update_major_version\n self.update_attributes({:major_version => self.major_version+1, :minor_version => 0})\n end","title":""},{"docid":"6bb7dbc6c473b49106793e234346ae5d","score":"0.62138474","text":"def update_major_version\n self.update_attributes({:major_version => self.major_version+1, :minor_version => 0})\n end","title":""},{"docid":"bea16fe4b0321c63b9b04ab98c0b3506","score":"0.62078005","text":"def current_version\n Versions.order('version desc').limit(1).first&.version || 0\n end","title":""},{"docid":"94a78429aec6bb7deaac4e503b717f40","score":"0.62073827","text":"def redo!\n version!(:next)\n migrate!\n end","title":""},{"docid":"73e61c5e8394cb47ad521052f35f399f","score":"0.61959827","text":"def next_version( number )\n find( :first, :order => 'number ASC', :conditions => [ \"number > ?\", number ] )\n end","title":""},{"docid":"7d400d929270d66107895bff976ec492","score":"0.61751384","text":"def bump_major_version\n metadata['version'] = next_version('major')\n end","title":""},{"docid":"662295266612adb9c5ff6e72337838d8","score":"0.6153629","text":"def increase_version version\n\t\tputs 'increased'\n\t\tnew_version = \"#{version[1]}.#{version[2]}.#{version[3]}.\" +\n\t\t\t\t\"#{version[4].to_i + 1}\"\n\tend","title":""},{"docid":"ff6b0c3c5277c9dab5060da5d989aedf","score":"0.6149719","text":"def current_version\n find( :first, :order => 'number DESC' )\n end","title":""},{"docid":"3c6957b9cb949d2481b89dba6925c43f","score":"0.61487085","text":"def latest_migration_version\n l = files.last\n l ? migration_version_from_file(File.basename(l)) : nil\n end","title":""},{"docid":"8976f46cceaa1ba887fd059c7212aff1","score":"0.61416495","text":"def update_minor_version\n self.update_attribute(:minor_version, self.minor_version+1)\n end","title":""},{"docid":"8976f46cceaa1ba887fd059c7212aff1","score":"0.61416495","text":"def update_minor_version\n self.update_attribute(:minor_version, self.minor_version+1)\n end","title":""},{"docid":"1d73b5ed3c5e62627745cd69a6a2155d","score":"0.613098","text":"def increment_version(version)\n toks = version.split \".\"\n buildnb = toks.last\n incremented = buildnb.to_i+1\n inc_str_padded = \"#{incremented.to_s.rjust(buildnb.size, \"0\")}\"\n toks.pop\n toks.push inc_str_padded\n return toks.join \".\"\n end","title":""},{"docid":"3856b637e265d2333f9ecdaa3aff8566","score":"0.612865","text":"def increase_version!(table_name = nil)\n key = cache_version_key(table_name)\n if r = ::Rails.cache.read(key)\n ::Rails.cache.write(key, r.to_i + 1)\n else\n ::Rails.cache.write(key, 1)\n end\n end","title":""},{"docid":"88bf5fd70ae5d334ccd149bea75e8a11","score":"0.61235243","text":"def be_major_version!\n update!(\n major_version: (paper.major_version || -1) + 1,\n minor_version: 0\n )\n end","title":""},{"docid":"7957ede78f4123d78e548ee62d7a9f66","score":"0.61218715","text":"def after(version)\n where([\"#{original_class.versioned_foreign_key} = ? and version_from > ?\", version.send(original_class.versioned_foreign_key), version.version_from]).\n order('version_from ASC').\n first\n end","title":""},{"docid":"722f057adedee46514cc3a601d0d7c23","score":"0.61167824","text":"def make_last_version_earlier(model)\n Version.record_timestamps = false\n model.versions.last.update_attributes :created_at => 2.seconds.ago\n Version.record_timestamps = true\n end","title":""},{"docid":"a414243a2eb8da4b3c051abdf797c3db","score":"0.60915124","text":"def commit()\n set_attribute_value(@version_attr, self.attr[@version_attr].to_i + 1)\n create(self.attr)\n end","title":""},{"docid":"f116d640c37e7eada12a273246b0f278","score":"0.60904247","text":"def version\n next_minor = ReleaseTools::Version.new(next_version).next_minor\n\n ReleaseTools::Version.new(next_minor)\n end","title":""},{"docid":"d41674f8a185e2626587e719e8ebb836","score":"0.6085201","text":"def current_version\n versions.sort_by{ |v| v.created_at }[-1]\n end","title":""},{"docid":"0850e66705cc40e848d94ade2fb355b5","score":"0.6070622","text":"def next_version\n latest = hub_version\n base = version\n build = latest[:build] || -1\n build += 1\n \"#{base}.#{build}\"\nend","title":""},{"docid":"1dd5e5f6c2552fa4ed43d44b28a823a4","score":"0.6064074","text":"def next_migration_number(dirname) #:nodoc:\n next_migration_number = current_migration_number(dirname) + 1\n ActiveRecord::Migration.next_migration_number(next_migration_number)\n end","title":""},{"docid":"c3b62d65d6e87758fe10d0fb694c40f1","score":"0.6055648","text":"def previous_version( number )\n find( :first, :order => 'number DESC', :conditions => [ \"number < ?\", number ] )\n end","title":""},{"docid":"2971267e0fa19eca1e06876397b748ee","score":"0.6055592","text":"def new_version_id\n DateTime.now.to_s\n end","title":""},{"docid":"a3b9f03715958f9ae15ce9934289bdb2","score":"0.6046142","text":"def next_version(version)\n major_version, *_unused = version.split(/\\./)\n\n \"#{major_version.to_i + 1}.0.0\"\n end","title":""},{"docid":"7e6c5880e7afc8eae3c5674ac422d8dd","score":"0.6043828","text":"def next_version\n # NOTE: if self (the item) was not reified from a version, i.e. it is the\n # \"live\" item, we return nil. Perhaps we should return self instead?\n subsequent_version = version ? version.next : nil\n subsequent_version.reify if subsequent_version\n end","title":""},{"docid":"1ea9c2f6c9c569002a72ed48fcccfc83","score":"0.60421085","text":"def create_new_version(add_version_number = false)\n current_instance = self.class.find(self.id).clone\n current_instance.is_current_version = false\n current_instance.parent_version = self.id\n current_instance.version_number = next_version_number if add_version_number\n current_instance.save\n # delete the older versions if there are too many versions (as defined by max_amount)\n if max_amount = self.class.instance_variable_get('@versionable_options')[:max_amount]\n versions_by_number = self.versions.sort {|a,b| a.version_number <=> b.version_number}\n (versions_by_number.size - max_amount).times do |i|\n versions_by_number[i].delete\n end\n end\n end","title":""},{"docid":"a7e6902b0e55fc8fdb02fd9b12fc89bf","score":"0.60260713","text":"def upgrade_to_version(version)\n end","title":""},{"docid":"da897519c785f06ad0bb99f7147be9dc","score":"0.60256976","text":"def be_major_version!\n update!(\n major_version: (paper.major_version || -1) + 1,\n minor_version: 0)\n end","title":""},{"docid":"89a335bef0ade93580afdc2e39e2967d","score":"0.60251087","text":"def bump_it_to(version:)\n Bump::Bump.run(version.to_s, commit: false, bundle: false, tag: false)\n $current_version = Bump::Bump.current\n say(\"Bumped to version: #{$current_version}!\".bold)\nend","title":""},{"docid":"9970bef95e5f533088fd359a410a0e08","score":"0.6018535","text":"def latest_version\n x = order(version: -1).limit(1).first\n x.nil? ? '00000000000000' : x.version\n end","title":""},{"docid":"9970bef95e5f533088fd359a410a0e08","score":"0.6018535","text":"def latest_version\n x = order(version: -1).limit(1).first\n x.nil? ? '00000000000000' : x.version\n end","title":""},{"docid":"f44a72f126e21fec280d021b62b0605c","score":"0.601629","text":"def current_version\n connection = ActiveRecord::Tasks::DatabaseTasks.migration_connection\n schema_migration = SchemaMigration.new(connection)\n internal_metadata = InternalMetadata.new(connection)\n\n MigrationContext.new(migrations_paths, schema_migration, internal_metadata).current_version\n end","title":""},{"docid":"dbc425707e16ea51a69444625649d772","score":"0.60159326","text":"def new_revision\n\t\trevision = DB[:tinker_revision].filter(:x_tinker_hash => @data['hash']).max(:revision)\n\t\trevision.to_i + 1\n\tend","title":""},{"docid":"08aa2b77f0e054b7812f09e263d0559b","score":"0.6012376","text":"def bump_patch_version\n metadata['version'] = next_version('patch')\n end","title":""},{"docid":"34130c634aba3e0b1868b7bedcd4f085","score":"0.59969074","text":"def bump\n last_release = releases(changes).first\n max = last_release.changes.map{ |c| c.level }.max\n if max > 1\n bump_part('major')\n elsif max >= 0\n bump_part('minor')\n else\n bump_part('patch')\n end\n end","title":""},{"docid":"2a79912c3cf3df93972e1749bfaeacb2","score":"0.5995746","text":"def next_revision(revision)\n revision.to_i + 1\n end","title":""},{"docid":"2a79912c3cf3df93972e1749bfaeacb2","score":"0.5995746","text":"def next_revision(revision)\n revision.to_i + 1\n end","title":""},{"docid":"f065a1c5ab73a91c57c394fd7bb5df7a","score":"0.59956026","text":"def bump_major_version\n Bueller::Commands::Version::BumpMajor.run_for self\n end","title":""},{"docid":"56190155e3976bbc7437034d530505c5","score":"0.5991062","text":"def migrate(target_version = nil, &block)\n case\n when target_version.nil?\n up(target_version, &block)\n when current_version == 0 && target_version == 0\n []\n when current_version > target_version\n down(target_version, &block)\n else\n up(target_version, &block)\n end\n end","title":""},{"docid":"a8aa388e1331fc490ce5bf91782341cc","score":"0.5982896","text":"def db_version(just_version=false)\n just_version ? ActiveRecord::Migrator.current_version.to_s : puts(\"Current version: \" + ActiveRecord::Migrator.current_version.to_s)\n end","title":""},{"docid":"0af7c40761572956801a96b5c9b4d867","score":"0.59825736","text":"def previous_version\n preceding_version = version ? version.previous : versions.last\n preceding_version.try :reify\n end","title":""},{"docid":"709efbc076eea4184ad592d9cda3dcf3","score":"0.5969469","text":"def true_version\n # supplied version is \"current\"\n if self.version.casecmp(\"current\") == 0\n self.next_release[\"name\"]\n # supplied version is not \"current\", just return supplied version\n else \n self.version\n end\n end","title":""},{"docid":"6215a538f008ceb770995c278c86bbb0","score":"0.5967406","text":"def __increment_revision_number\n @revision_identifier += 1\n end","title":""},{"docid":"6ded5771aba5b0c38211404932008eec","score":"0.5967335","text":"def next_major\n Version.new(major+1, 0, 0, :prefix => @prefix)\n end","title":""},{"docid":"8361f7b67564b2d91dfc1809d32e77fd","score":"0.5959106","text":"def test_bump_pre_dev\n version = VMLib::Version.new\n version.bump_prerelease\n assert_equal '0.0.0-1', version.to_s\n\n version.bump_prerelease\n assert_equal '0.0.0-2', version.to_s\n end","title":""}],"string":"[\n {\n \"docid\": \"32e712acec1aee74293cdce04d7991c3\",\n \"score\": \"0.7489249\",\n \"text\": \"def next_version\\n (new_record? ? 0 : versions.calculate(:maximum, version_column).to_i) + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"33d4a749b8bf2e23ae57f671f2a00015\",\n \"score\": \"0.7220128\",\n \"text\": \"def increment_version\\n old_version = Changelog.where(package_id: self.package_id).maximum(:version)\\n now_date = Date.today.to_s.split(\\\"-\\\").join # 20120703\\n counter = 1\\n\\n if old_version\\n old_date, counter = old_version.split(\\\"-\\\")\\n counter = (now_date == old_date) ? (counter.to_i + 1) : 1\\n end\\n\\n self.version = \\\"#{now_date}-#{counter}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"700174d33eec35da5b79b85dc52d80af\",\n \"score\": \"0.7152542\",\n \"text\": \"def next_migration_number\\n self.current_migration_number + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cf94456b19599a4d7cf588c5f19c98eb\",\n \"score\": \"0.710729\",\n \"text\": \"def next_migration_number(number); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5d23c29b18eab3974216a362f56bec94\",\n \"score\": \"0.7074096\",\n \"text\": \"def next_version\\n return 1 if new_record? || standard_versions.empty?\\n (standard_versions.maximum(:version) || 0) + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"40c69fd4eb2b806767e65e48749a2aaf\",\n \"score\": \"0.69177413\",\n \"text\": \"def current_version\\n if current_direction == :down\\n migration_context.current_version\\n elsif current_direction == :up\\n pending_migrations.first\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e32744a369c6da339d28ae50ed1783b7\",\n \"score\": \"0.69065803\",\n \"text\": \"def alter_version\\r\\n @version += 1\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"29b39cbf894cf0943eb7b09f6585bc3f\",\n \"score\": \"0.68406343\",\n \"text\": \"def migration_number; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d442c92fbe6559b1eefa68691a6e613\",\n \"score\": \"0.67778516\",\n \"text\": \"def next_version_number\\n self.class.connection.next_val_sequence(\\\"#{self.class.table_name}_$_version_number\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8bf58233226e67b2884779491335bc8a\",\n \"score\": \"0.6773771\",\n \"text\": \"def next_version\\n work.next_version\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2bdd97b1c74ba9a290b88e4bef8e1f4c\",\n \"score\": \"0.6724718\",\n \"text\": \"def set_new_version\\n @saving_version = new_record? || save_version?\\n self.send(\\\"#{self.class.version_column}=\\\", next_version) if new_record? || (!locking_enabled? && save_version?)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"74050730e913966250e244bbb1bfae58\",\n \"score\": \"0.6712367\",\n \"text\": \"def next_version(v)\\n v.succ\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4a007901d332ea66862631759c2b7aa5\",\n \"score\": \"0.67081743\",\n \"text\": \"def next_version_number\\n v_no = (versions.last || 'v000').gsub(/v/,'').to_i + 1\\n \\\"v%03d\\\"%[v_no]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"58574e0aa91c49ae616cc306a93fda75\",\n \"score\": \"0.66926813\",\n \"text\": \"def last_migrated_number\\n (ActiveRecord::Migrator.get_all_versions & all_migration_numbers).max.to_i #nil to zero\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c2c6691792f89b7aa6f569c2e523b5e1\",\n \"score\": \"0.6686112\",\n \"text\": \"def new_version_number\\n version_cache.new_version_number ||= begin\\n latest_version = versions.desc(:number).limit(1).first\\n ver = latest_version.number if latest_version\\n [ver.to_i, version_number].max + 1\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aa9f9968eb549e673e3119da143ea15a\",\n \"score\": \"0.66424924\",\n \"text\": \"def current_migration_version\\n ds.get(column) || 0\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"de8d3fbbad2bcea0fed66a9d49cccc99\",\n \"score\": \"0.6629853\",\n \"text\": \"def bump_version(current_version)\\n next_version = current_version\\n\\n if @config.engine_version_bump_type == :major\\n next_version.major = next_version.major + 1\\n next_version.minor = 0\\n next_version.patch = 0\\n elsif @config.engine_version_bump_type == :minor\\n next_version.minor = next_version.minor + 1\\n next_version.patch = 0\\n else\\n next_version.patch = next_version.patch + 1\\n end\\n return next_version\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c3a652a19676a9a7afaebaec1925c19\",\n \"score\": \"0.66110575\",\n \"text\": \"def next_migration_number(dirname) #:nodoc:\\n if ActiveRecord::Base.timestamped_migrations\\n Time.now.utc.strftime(\\\"%Y%m%d%H%M%S\\\")\\n else\\n \\\"%.3d\\\" % (current_migration_number(dirname) + 1)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"426e5038aa3b6f029d57a61893324ae8\",\n \"score\": \"0.65856427\",\n \"text\": \"def new_version(version, next_version)\\n # Remove any suffix beginning with a hyphen, e.g. 1.2.3-beta.1 -> 1.2.3\\n components = version.sub(/-.*$/, '').split '.'\\n\\n case next_version\\n when 'patch', nil\\n components[2] = components[2].to_i + 1\\n when 'minor'\\n components[1] = components[1].to_i + 1\\n when 'major'\\n components[0] = components[0].to_i + 1\\n else\\n return next_version\\n end\\n\\n components.join '.'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"13f33c4b035622764161e6dff653d47b\",\n \"score\": \"0.65469426\",\n \"text\": \"def next_migration_number(number)\\n if ActiveRecord::Base.timestamped_migrations\\n [Time.now.utc.strftime(\\\"%Y%m%d%H%M%S\\\"), \\\"%.14d\\\" % number].max\\n else\\n SchemaMigration.normalize_migration_number(number)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"61c9e62ba821112c7c458ed86e34c530\",\n \"score\": \"0.6546614\",\n \"text\": \"def upgrade_version\\n\\t\\tp self.version.to_s\\n\\t\\tif ! self.version.eql? 1\\n\\t\\t\\tmain = Catalog.main.first\\n\\t\\t\\tif ! main.nil?\\n\\t\\t\\t\\tmain.version = 2\\n\\t\\t\\t\\tmain.save\\n\\t\\t\\tend\\n\\t\\t\\tself.version = 1\\n\\t\\t\\tself.save\\n\\t\\tend\\n\\t\\tself.version\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0a61bd3bc6464df7169ae0641b35ab21\",\n \"score\": \"0.651592\",\n \"text\": \"def next_release_version\\n attrs = { release_id: @release_model.id }\\n models = Models::ReleaseVersion.filter(attrs).all\\n strings = models.map(&:version)\\n list = Bosh::Common::Version::ReleaseVersionList.parse(strings)\\n list.rebase(@version)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0a61bd3bc6464df7169ae0641b35ab21\",\n \"score\": \"0.651592\",\n \"text\": \"def next_release_version\\n attrs = { release_id: @release_model.id }\\n models = Models::ReleaseVersion.filter(attrs).all\\n strings = models.map(&:version)\\n list = Bosh::Common::Version::ReleaseVersionList.parse(strings)\\n list.rebase(@version)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9f086115bee8f1558e034c78fedc97e4\",\n \"score\": \"0.65152854\",\n \"text\": \"def migrate!(number = nil)\\n unless number || version_cache.wanted_version_number\\n raise(MigrationError, 'no version given')\\n end\\n if number && number != version_cache.wanted_version_number\\n version!(number)\\n end\\n if version_cache.self_version\\n raise(MigrationError, 'cannot migrate to current version')\\n end\\n\\n set_original_version_obj\\n\\n if version_object.future?\\n version_object.update_attributes(:created_at => Time.now)\\n end\\n\\n self.attributes = version_attributes\\n self.version_number = version_cache.wanted_version_number\\n save!\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"42c6cc3555a09ecd97986c6acef82a29\",\n \"score\": \"0.64995366\",\n \"text\": \"def version\\r\\n @version + 1\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"006180c7c6b51990ad7134e99fd2aba1\",\n \"score\": \"0.6493778\",\n \"text\": \"def next_migration_number(number)\\n if ActiveRecord.timestamped_migrations\\n [Time.now.utc.strftime(\\\"%Y%m%d%H%M%S\\\"), \\\"%.14d\\\" % number].max\\n else\\n \\\"%.3d\\\" % number.to_i\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ba05d5660e6ef21728ea00c5dbd93e90\",\n \"score\": \"0.6474415\",\n \"text\": \"def next_revision_number(existing_model)\\n existing_model.revision_number + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1a8edb6c4674ff3f231a1d57efa9bb73\",\n \"score\": \"0.6461477\",\n \"text\": \"def nextVersion(version)\\n version.succ\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1a8edb6c4674ff3f231a1d57efa9bb73\",\n \"score\": \"0.6461477\",\n \"text\": \"def nextVersion(version)\\n version.succ\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6b76fe6b1a7c7622c50c1b854576a30\",\n \"score\": \"0.64278924\",\n \"text\": \"def update_with_version\\n if self.class.instance_variable_get('@versionable') && self.changed?\\n if disable_versionable_once\\n update_without_version\\n return\\n end\\n self.version_number = next_version_number\\n create_new_version\\n update_without_version\\n else\\n update_without_version\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f49a53de59b2908ad5aa7f7b2ccc93e4\",\n \"score\": \"0.64131653\",\n \"text\": \"def latest_migration\\n migrations.last\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9baf0a392d877fff710745759ddd794e\",\n \"score\": \"0.63992774\",\n \"text\": \"def last_version\\n @last_version ||= versions.maximum(:number) || 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"24709ab9969a2d25f615703b08bc5aa8\",\n \"score\": \"0.639916\",\n \"text\": \"def next_migration_number(_path)\\n Time.now.utc.strftime('%Y%m%d%H%M%S')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d465bb4091ddfc6a2473e9f4adf37958\",\n \"score\": \"0.63973993\",\n \"text\": \"def increment_version\\n version_parts = get_version.split('.').map { |n| n.to_i }\\n version_parts[2] += 1\\n version_parts.join('.')\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0d88c700a732c5eb45738345921d0e13\",\n \"score\": \"0.6396026\",\n \"text\": \"def bump\\n max = history.releases[0].changes.map{ |c| c.level }.max\\n if max > 1\\n bump_part('major')\\n elsif max >= 0\\n bump_part('minor')\\n else\\n bump_part('patch')\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ad9aa8c0e2d1e2bae6fbe7ce59f4b641\",\n \"score\": \"0.6387444\",\n \"text\": \"def update_version_created\\n return if version_id\\n return unless version_added\\n new_version = Version.find_or_create_by(number: version_added)\\n update_attributes(version_id: new_version.id)\\n new_version.number\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"834b186b404b6cad41d1e516a2dd931c\",\n \"score\": \"0.6382192\",\n \"text\": \"def new_rev old_rev=nil\\n if old_rev\\n num = old_rev.split('-')[0].to_i\\n \\\"#{num +1}-#{uuid()}\\\"\\n else\\n \\\"1-#{uuid()}\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4b6afc4617bde5e8ae7e4d4c578f1d27\",\n \"score\": \"0.63793904\",\n \"text\": \"def version(number, migrations = [])\\n Version.new(number, migrations).tap do |version|\\n versions << version\\n sort_versions\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2b7cd7a4bd65b819d115531de3877b69\",\n \"score\": \"0.63656014\",\n \"text\": \"def next_migration_number(dirname)\\n ::ActiveRecord::Generators::Base.next_migration_number(dirname)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a58ee0533551d345479784360e95eb3f\",\n \"score\": \"0.6348882\",\n \"text\": \"def update_version\\n return create_version unless v = versions.last\\n v.modifications_will_change!\\n v.update_attribute(:modifications, v.changes.append_changes(version_changes))\\n reset_version_changes\\n reset_version\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5bf175c5c2d2d1c4495a298028f25e7f\",\n \"score\": \"0.634594\",\n \"text\": \"def current_version_number\\n get_and_set_current_version\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bbdbcd337bbb4940404a49d9c7032ace\",\n \"score\": \"0.6341898\",\n \"text\": \"def latest_migration\\n migrations.last\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a828565cc62fd79fe059398b4350404f\",\n \"score\": \"0.6336538\",\n \"text\": \"def next_revision(revision)\\n Time.now.to_i + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3d65b786638f3f1cfbf1af54950db82b\",\n \"score\": \"0.63362515\",\n \"text\": \"def current_version\\n versions.first :order => [:number.desc]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2f07407de9ca128f7fc4216c6965d78d\",\n \"score\": \"0.63314456\",\n \"text\": \"def last_version_number\\n last = versions.first\\n last ? last.number : 0\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ab3388326e74062327b214ac848933f8\",\n \"score\": \"0.63081485\",\n \"text\": \"def bump\\n ints = build_array_from_version_string\\n ints.pop if ints.size > 1\\n ints[-1] += 1\\n self.class.new(ints.join(\\\".\\\"))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0b7368724c5fb507b0e9b1addbead67e\",\n \"score\": \"0.62960774\",\n \"text\": \"def version\\n return last_version if versionable?\\n version_number\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aa885aa4f8ae3079134a014efb0ebcd0\",\n \"score\": \"0.6283387\",\n \"text\": \"def next_version(extra_attributes = {})\\n resource.git_versions.build.tap do |gv|\\n [:visibility, :git_repository_id, :ref, :commit, :root_path].each do |attr|\\n gv.send(\\\"#{attr}=\\\", send(attr))\\n end\\n gv.comment = nil\\n gv.ref = nil\\n gv.version = (version + 1)\\n gv.name = \\\"Version #{gv.version}\\\"\\n gv.set_resource_attributes(resource.attributes)\\n gv.assign_attributes(extra_attributes)\\n gv.git_annotations = git_annotations.map(&:dup)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aae25124f50371326732bc8a4c4aa97c\",\n \"score\": \"0.6276743\",\n \"text\": \"def increment_worker_version\\n newver = self.get_worker_version + 1\\n self.set_worker_version(newver)\\n newver\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"102d91fc2aa2db43270c4bce4a6923f4\",\n \"score\": \"0.6276187\",\n \"text\": \"def last_version\\n return 0 if versions.count == 0\\n versions.first.version_number \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c2a67463f4bec62d5c8a2de217e01f1e\",\n \"score\": \"0.6270248\",\n \"text\": \"def revise\\n previous = find_last_version\\n if previous\\n versions.target << previous.clone\\n versions.shift if version_max.present? && versions.length > version_max\\n self.version = (version || 1 ) + 1\\n @modifications[\\\"versions\\\"] = [ nil, versions.as_document ] if @modifications\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8c5b44a6583345ec5c549b6c18193e76\",\n \"score\": \"0.6246396\",\n \"text\": \"def next_migration_string_with_follow_up(padding = 3)\\n if ActiveRecord::Base.timestamped_migrations\\n @next_migration_string ||= Time.now.utc.strftime(\\\"%Y%m%d%H%M%S\\\")\\n @next_migration_string = (@next_migration_string.to_i + 1).to_s\\n else\\n \\\"%.#{padding}d\\\" % next_migration_number\\n end\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"247818e95fe43570fa16c241910a5e53\",\n \"score\": \"0.62321293\",\n \"text\": \"def rollback_version(rollback_to=-1)\\n ##DEFAULT TO LAST (NEWEST)\\n #debugger\\n vers = self.versions.to_a.reverse\\n return false if vers.empty?\\n rollback_to = -1 if rollback_to==0 or rollback_to>vers.length\\n rollback_to = 0 if rollback_to<-vers.length\\n rollback_to -= 1 if rollback_to>0\\n new_ver = vers[rollback_to]\\n ver_no = rollback_to+1\\n ver_no = vers.length+ver_no if ver_no<=0\\n #debugger\\n props = self.attributes.keys-[:id,:created_at,:deleted_at,:updated_at,:updated_by,:updated_comment,:provenance_comment]\\n props.each{|p|\\n self[p] = new_ver[p] }\\n self.provenance_comment = 'ROLLBACK VERSION '+ver_no.to_s\\n return self.save\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"04a057257d3a9ffbb154c7f49346e983\",\n \"score\": \"0.6228797\",\n \"text\": \"def create_initial_version\\n versions.create(version_attributes.merge(:number => 1))\\n reset_version_changes\\n reset_version\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9876c9f7c714697c4afad8b446f3acda\",\n \"score\": \"0.622074\",\n \"text\": \"def current_migration_number\\n if fetch_component_choice(:migration_format).to_s == 'timestamp'\\n Time.now.utc.strftime(\\\"%Y%m%d%H%M%S\\\")\\n else\\n return_last_migration_number + 1\\n end.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6bb7dbc6c473b49106793e234346ae5d\",\n \"score\": \"0.62138474\",\n \"text\": \"def update_major_version\\n self.update_attributes({:major_version => self.major_version+1, :minor_version => 0})\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6bb7dbc6c473b49106793e234346ae5d\",\n \"score\": \"0.62138474\",\n \"text\": \"def update_major_version\\n self.update_attributes({:major_version => self.major_version+1, :minor_version => 0})\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bea16fe4b0321c63b9b04ab98c0b3506\",\n \"score\": \"0.62078005\",\n \"text\": \"def current_version\\n Versions.order('version desc').limit(1).first&.version || 0\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"94a78429aec6bb7deaac4e503b717f40\",\n \"score\": \"0.62073827\",\n \"text\": \"def redo!\\n version!(:next)\\n migrate!\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"73e61c5e8394cb47ad521052f35f399f\",\n \"score\": \"0.61959827\",\n \"text\": \"def next_version( number )\\n find( :first, :order => 'number ASC', :conditions => [ \\\"number > ?\\\", number ] )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7d400d929270d66107895bff976ec492\",\n \"score\": \"0.61751384\",\n \"text\": \"def bump_major_version\\n metadata['version'] = next_version('major')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"662295266612adb9c5ff6e72337838d8\",\n \"score\": \"0.6153629\",\n \"text\": \"def increase_version version\\n\\t\\tputs 'increased'\\n\\t\\tnew_version = \\\"#{version[1]}.#{version[2]}.#{version[3]}.\\\" +\\n\\t\\t\\t\\t\\\"#{version[4].to_i + 1}\\\"\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ff6b0c3c5277c9dab5060da5d989aedf\",\n \"score\": \"0.6149719\",\n \"text\": \"def current_version\\n find( :first, :order => 'number DESC' )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c6957b9cb949d2481b89dba6925c43f\",\n \"score\": \"0.61487085\",\n \"text\": \"def latest_migration_version\\n l = files.last\\n l ? migration_version_from_file(File.basename(l)) : nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8976f46cceaa1ba887fd059c7212aff1\",\n \"score\": \"0.61416495\",\n \"text\": \"def update_minor_version\\n self.update_attribute(:minor_version, self.minor_version+1)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8976f46cceaa1ba887fd059c7212aff1\",\n \"score\": \"0.61416495\",\n \"text\": \"def update_minor_version\\n self.update_attribute(:minor_version, self.minor_version+1)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d73b5ed3c5e62627745cd69a6a2155d\",\n \"score\": \"0.613098\",\n \"text\": \"def increment_version(version)\\n toks = version.split \\\".\\\"\\n buildnb = toks.last\\n incremented = buildnb.to_i+1\\n inc_str_padded = \\\"#{incremented.to_s.rjust(buildnb.size, \\\"0\\\")}\\\"\\n toks.pop\\n toks.push inc_str_padded\\n return toks.join \\\".\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3856b637e265d2333f9ecdaa3aff8566\",\n \"score\": \"0.612865\",\n \"text\": \"def increase_version!(table_name = nil)\\n key = cache_version_key(table_name)\\n if r = ::Rails.cache.read(key)\\n ::Rails.cache.write(key, r.to_i + 1)\\n else\\n ::Rails.cache.write(key, 1)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"88bf5fd70ae5d334ccd149bea75e8a11\",\n \"score\": \"0.61235243\",\n \"text\": \"def be_major_version!\\n update!(\\n major_version: (paper.major_version || -1) + 1,\\n minor_version: 0\\n )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7957ede78f4123d78e548ee62d7a9f66\",\n \"score\": \"0.61218715\",\n \"text\": \"def after(version)\\n where([\\\"#{original_class.versioned_foreign_key} = ? and version_from > ?\\\", version.send(original_class.versioned_foreign_key), version.version_from]).\\n order('version_from ASC').\\n first\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"722f057adedee46514cc3a601d0d7c23\",\n \"score\": \"0.61167824\",\n \"text\": \"def make_last_version_earlier(model)\\n Version.record_timestamps = false\\n model.versions.last.update_attributes :created_at => 2.seconds.ago\\n Version.record_timestamps = true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a414243a2eb8da4b3c051abdf797c3db\",\n \"score\": \"0.60915124\",\n \"text\": \"def commit()\\n set_attribute_value(@version_attr, self.attr[@version_attr].to_i + 1)\\n create(self.attr)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f116d640c37e7eada12a273246b0f278\",\n \"score\": \"0.60904247\",\n \"text\": \"def version\\n next_minor = ReleaseTools::Version.new(next_version).next_minor\\n\\n ReleaseTools::Version.new(next_minor)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d41674f8a185e2626587e719e8ebb836\",\n \"score\": \"0.6085201\",\n \"text\": \"def current_version\\n versions.sort_by{ |v| v.created_at }[-1]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0850e66705cc40e848d94ade2fb355b5\",\n \"score\": \"0.6070622\",\n \"text\": \"def next_version\\n latest = hub_version\\n base = version\\n build = latest[:build] || -1\\n build += 1\\n \\\"#{base}.#{build}\\\"\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1dd5e5f6c2552fa4ed43d44b28a823a4\",\n \"score\": \"0.6064074\",\n \"text\": \"def next_migration_number(dirname) #:nodoc:\\n next_migration_number = current_migration_number(dirname) + 1\\n ActiveRecord::Migration.next_migration_number(next_migration_number)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3b62d65d6e87758fe10d0fb694c40f1\",\n \"score\": \"0.6055648\",\n \"text\": \"def previous_version( number )\\n find( :first, :order => 'number DESC', :conditions => [ \\\"number < ?\\\", number ] )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2971267e0fa19eca1e06876397b748ee\",\n \"score\": \"0.6055592\",\n \"text\": \"def new_version_id\\n DateTime.now.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3b9f03715958f9ae15ce9934289bdb2\",\n \"score\": \"0.6046142\",\n \"text\": \"def next_version(version)\\n major_version, *_unused = version.split(/\\\\./)\\n\\n \\\"#{major_version.to_i + 1}.0.0\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7e6c5880e7afc8eae3c5674ac422d8dd\",\n \"score\": \"0.6043828\",\n \"text\": \"def next_version\\n # NOTE: if self (the item) was not reified from a version, i.e. it is the\\n # \\\"live\\\" item, we return nil. Perhaps we should return self instead?\\n subsequent_version = version ? version.next : nil\\n subsequent_version.reify if subsequent_version\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1ea9c2f6c9c569002a72ed48fcccfc83\",\n \"score\": \"0.60421085\",\n \"text\": \"def create_new_version(add_version_number = false)\\n current_instance = self.class.find(self.id).clone\\n current_instance.is_current_version = false\\n current_instance.parent_version = self.id\\n current_instance.version_number = next_version_number if add_version_number\\n current_instance.save\\n # delete the older versions if there are too many versions (as defined by max_amount)\\n if max_amount = self.class.instance_variable_get('@versionable_options')[:max_amount]\\n versions_by_number = self.versions.sort {|a,b| a.version_number <=> b.version_number}\\n (versions_by_number.size - max_amount).times do |i|\\n versions_by_number[i].delete\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a7e6902b0e55fc8fdb02fd9b12fc89bf\",\n \"score\": \"0.60260713\",\n \"text\": \"def upgrade_to_version(version)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"da897519c785f06ad0bb99f7147be9dc\",\n \"score\": \"0.60256976\",\n \"text\": \"def be_major_version!\\n update!(\\n major_version: (paper.major_version || -1) + 1,\\n minor_version: 0)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"89a335bef0ade93580afdc2e39e2967d\",\n \"score\": \"0.60251087\",\n \"text\": \"def bump_it_to(version:)\\n Bump::Bump.run(version.to_s, commit: false, bundle: false, tag: false)\\n $current_version = Bump::Bump.current\\n say(\\\"Bumped to version: #{$current_version}!\\\".bold)\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9970bef95e5f533088fd359a410a0e08\",\n \"score\": \"0.6018535\",\n \"text\": \"def latest_version\\n x = order(version: -1).limit(1).first\\n x.nil? ? '00000000000000' : x.version\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9970bef95e5f533088fd359a410a0e08\",\n \"score\": \"0.6018535\",\n \"text\": \"def latest_version\\n x = order(version: -1).limit(1).first\\n x.nil? ? '00000000000000' : x.version\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f44a72f126e21fec280d021b62b0605c\",\n \"score\": \"0.601629\",\n \"text\": \"def current_version\\n connection = ActiveRecord::Tasks::DatabaseTasks.migration_connection\\n schema_migration = SchemaMigration.new(connection)\\n internal_metadata = InternalMetadata.new(connection)\\n\\n MigrationContext.new(migrations_paths, schema_migration, internal_metadata).current_version\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbc425707e16ea51a69444625649d772\",\n \"score\": \"0.60159326\",\n \"text\": \"def new_revision\\n\\t\\trevision = DB[:tinker_revision].filter(:x_tinker_hash => @data['hash']).max(:revision)\\n\\t\\trevision.to_i + 1\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"08aa2b77f0e054b7812f09e263d0559b\",\n \"score\": \"0.6012376\",\n \"text\": \"def bump_patch_version\\n metadata['version'] = next_version('patch')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"34130c634aba3e0b1868b7bedcd4f085\",\n \"score\": \"0.59969074\",\n \"text\": \"def bump\\n last_release = releases(changes).first\\n max = last_release.changes.map{ |c| c.level }.max\\n if max > 1\\n bump_part('major')\\n elsif max >= 0\\n bump_part('minor')\\n else\\n bump_part('patch')\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2a79912c3cf3df93972e1749bfaeacb2\",\n \"score\": \"0.5995746\",\n \"text\": \"def next_revision(revision)\\n revision.to_i + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2a79912c3cf3df93972e1749bfaeacb2\",\n \"score\": \"0.5995746\",\n \"text\": \"def next_revision(revision)\\n revision.to_i + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f065a1c5ab73a91c57c394fd7bb5df7a\",\n \"score\": \"0.59956026\",\n \"text\": \"def bump_major_version\\n Bueller::Commands::Version::BumpMajor.run_for self\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"56190155e3976bbc7437034d530505c5\",\n \"score\": \"0.5991062\",\n \"text\": \"def migrate(target_version = nil, &block)\\n case\\n when target_version.nil?\\n up(target_version, &block)\\n when current_version == 0 && target_version == 0\\n []\\n when current_version > target_version\\n down(target_version, &block)\\n else\\n up(target_version, &block)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a8aa388e1331fc490ce5bf91782341cc\",\n \"score\": \"0.5982896\",\n \"text\": \"def db_version(just_version=false)\\n just_version ? ActiveRecord::Migrator.current_version.to_s : puts(\\\"Current version: \\\" + ActiveRecord::Migrator.current_version.to_s)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0af7c40761572956801a96b5c9b4d867\",\n \"score\": \"0.59825736\",\n \"text\": \"def previous_version\\n preceding_version = version ? version.previous : versions.last\\n preceding_version.try :reify\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"709efbc076eea4184ad592d9cda3dcf3\",\n \"score\": \"0.5969469\",\n \"text\": \"def true_version\\n # supplied version is \\\"current\\\"\\n if self.version.casecmp(\\\"current\\\") == 0\\n self.next_release[\\\"name\\\"]\\n # supplied version is not \\\"current\\\", just return supplied version\\n else \\n self.version\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6215a538f008ceb770995c278c86bbb0\",\n \"score\": \"0.5967406\",\n \"text\": \"def __increment_revision_number\\n @revision_identifier += 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6ded5771aba5b0c38211404932008eec\",\n \"score\": \"0.5967335\",\n \"text\": \"def next_major\\n Version.new(major+1, 0, 0, :prefix => @prefix)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8361f7b67564b2d91dfc1809d32e77fd\",\n \"score\": \"0.5959106\",\n \"text\": \"def test_bump_pre_dev\\n version = VMLib::Version.new\\n version.bump_prerelease\\n assert_equal '0.0.0-1', version.to_s\\n\\n version.bump_prerelease\\n assert_equal '0.0.0-2', version.to_s\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":178,"cells":{"query_id":{"kind":"string","value":"bfde52d0152b0e8e4cd65fbfcb0a1151"},"query":{"kind":"string","value":":callseq: ot.get(key) ot.send(key) ot[key] You can use get to access member object values instead of the >> syntax. Unlike >>, this works for keys with spaces, or keys that have the same name as methods on Object."},"positive_passages":{"kind":"list like","value":[{"docid":"d4089247d939df9faead775f78fea404","score":"0.0","text":"def get(key); @store.octothorpe_store[octokey key]; end","title":""}],"string":"[\n {\n \"docid\": \"d4089247d939df9faead775f78fea404\",\n \"score\": \"0.0\",\n \"text\": \"def get(key); @store.octothorpe_store[octokey key]; end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"76b121f5bdc4e6837e683d7992f29175","score":"0.73201686","text":"def send key, value\n method_missing key, value\n end","title":""},{"docid":"3725b4b192e57d14e424f3999b465c6f","score":"0.7047996","text":"def []( key ) send( key ); end","title":""},{"docid":"c22ec58a17d89b5632b9dbc60222939d","score":"0.69906574","text":"def [](key) send(key) end","title":""},{"docid":"a14b64a5ffa132adf27eed137c34c53d","score":"0.6926264","text":"def [](key)\n __send__(key) if key?(key)\n end","title":""},{"docid":"98835cf116ca3bb6c65f8d52cb9fbfff","score":"0.68967503","text":"def [](key)\n\t\tself.send(key)\n\tend","title":""},{"docid":"27c69623e10f3329c6cee618310847da","score":"0.68803287","text":"def [](key)\n __getobj__.get(key.to_s)\n end","title":""},{"docid":"80df037222f7e85d112316b3386983e8","score":"0.6869525","text":"def [](key)\n __send__(key)\n end","title":""},{"docid":"c7659c4693f8f3cd6d6774e7e3d0f191","score":"0.68397963","text":"def []( key )\n #------------\n self.send( \"#{key}\" )\n end","title":""},{"docid":"94010474c0962b94249dee6a6b4d9a91","score":"0.6776639","text":"def [](key)\n send(key)\n end","title":""},{"docid":"705997b68532b773785e363497cce94c","score":"0.6703489","text":"def [](key)\n send(key)\n end","title":""},{"docid":"705997b68532b773785e363497cce94c","score":"0.6703489","text":"def [](key)\n send(key)\n end","title":""},{"docid":"70c150ee1de82f911f8ab15d25479fdb","score":"0.67001474","text":"def [](key)\n send key\n end","title":""},{"docid":"53dea5fc9aab1edee3f25174b8bf1efc","score":"0.66956866","text":"def [](key)\n self.send key unless key == nil\n end","title":""},{"docid":"2f3426b57c20452c77f54fc8c12e9c13","score":"0.6687201","text":"def [](key)\n send(key)\n end","title":""},{"docid":"2f3426b57c20452c77f54fc8c12e9c13","score":"0.6687201","text":"def [](key)\n send(key)\n end","title":""},{"docid":"2f3426b57c20452c77f54fc8c12e9c13","score":"0.6687201","text":"def [](key)\n send(key)\n end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"a3125e92d390f9639ee941da77a3765f","score":"0.66661745","text":"def get(key); end","title":""},{"docid":"0f56e0fa6234db2b5f00c42cec0053ca","score":"0.6646918","text":"def [](key)\r\n get key\r\n end","title":""},{"docid":"13926c1fe20e5218afd34252a1f3e691","score":"0.66283315","text":"def [](key)\n send(key)\n end","title":""},{"docid":"b48c10577ff7819138dc6e272e81b844","score":"0.66000634","text":"def [](key)\n get key\n end","title":""},{"docid":"59ba0a039732b1e5e33ce74565b531ba","score":"0.6565473","text":"def [](key)\n self.send(key)\n end","title":""},{"docid":"59ba0a039732b1e5e33ce74565b531ba","score":"0.6565473","text":"def [](key)\n self.send(key)\n end","title":""},{"docid":"1ac908692a09efef969288da857856ec","score":"0.6539108","text":"def [](key)\n proc_or_val(__getobj__[key])\n end","title":""},{"docid":"c2fa704abdbcec3a02b87b3c5806cefe","score":"0.65206295","text":"def get(key)\n\n end","title":""},{"docid":"3718177f9c866cbfabb9135c7190446b","score":"0.65017587","text":"def [](key)\n self.send(key.to_s)\n end","title":""},{"docid":"562319cbf067e1e0295243906976fbce","score":"0.64885265","text":"def [](key)\n obj = read([key])\n obj[key]\n end","title":""},{"docid":"0a14819edb06ff8fa3e541c3b6ba4d00","score":"0.64820266","text":"def [](key)\n method_missing(key)\n end","title":""},{"docid":"e25d8411b07de446f47b596a5e0fc6b9","score":"0.6460627","text":"def get(key)\n \n end","title":""},{"docid":"e25d8411b07de446f47b596a5e0fc6b9","score":"0.6460627","text":"def get(key)\n \n end","title":""},{"docid":"e25d8411b07de446f47b596a5e0fc6b9","score":"0.6460627","text":"def get(key)\n \n end","title":""},{"docid":"e25d8411b07de446f47b596a5e0fc6b9","score":"0.6460627","text":"def get(key)\n \n end","title":""},{"docid":"d05e5512ecaf2537564eb80d1db68ee5","score":"0.6460494","text":"def [](key)\n key = key.to_s.downcase\n\n if respond_to? key, true\n send key\n else\n fetch key\n end\n end","title":""},{"docid":"d15193ea2da02c01dd361ec8d9832674","score":"0.64552414","text":"def [](key)\n # self.send(key)\n super(key.to_sym)\n end","title":""},{"docid":"d2623478fcf7ed175cf258a7f0b82d60","score":"0.64459485","text":"def [](key)\n self.send(key) if self.keys.include?(key.to_sym)\n end","title":""},{"docid":"58863a6e25c04653699a7278bff8e82a","score":"0.6441768","text":"def get(key)\n \n end","title":""},{"docid":"9330cbb7352315de5a0f452ba2ed3d80","score":"0.6437786","text":"def _nydp_get key ; _nydp_safe_send(key.to_s.as_method_name) ; end","title":""},{"docid":"77e0e0bd8224b32f810008e0d8fadd9a","score":"0.6406897","text":"def [](key)\n\t\tget(key)\n\tend","title":""},{"docid":"3cad539ce3fbe0ae604fc83fd5a2f2c2","score":"0.6401262","text":"def [](key)\n send(key) if respond_to?(key)\n end","title":""},{"docid":"9d4a84b17f83e62be113fa0653b0d4c4","score":"0.6365732","text":"def [](key)\n send(:\"#{key}\") if self.respond_to?(:\"#{key}\")\n end","title":""},{"docid":"90f0b5d4ac2c37e4d1ec489c49605e04","score":"0.6360181","text":"def [] key\n __send__ key\n end","title":""},{"docid":"0a3c1a9f1557d4b294095092c5446974","score":"0.6345509","text":"def fetch(key)\n send(key)\n end","title":""},{"docid":"0f69932e847dace4bf3d8f5f16d340f7","score":"0.633564","text":"def [](key)\n return unless include?(key)\n\n target.send(key)\n end","title":""},{"docid":"83514d0b8945b5a2483a775bbed026f1","score":"0.6324599","text":"def [](key)\n if value = instance_variable_get(\"@#{key}\")\n value\n else\n send key rescue nil\n end\n end","title":""},{"docid":"cada3219d1b6d486daf1aa1b8007915f","score":"0.6269392","text":"def [](key)\n public_send(key)\n end","title":""},{"docid":"8bb864363cd13d426c6b4a0f562b799b","score":"0.625142","text":"def [](key)\n Get((key.is_a?(Symbol) ? key.to_s : key))\n end","title":""},{"docid":"c87736b3960ebb6bc17a2a00bf6d44b1","score":"0.6241956","text":"def [](key)\n get(key)\n end","title":""},{"docid":"c87736b3960ebb6bc17a2a00bf6d44b1","score":"0.6241956","text":"def [](key)\n get(key)\n end","title":""},{"docid":"ded0d6c4c32b927385fe95b8413d6a97","score":"0.62396175","text":"def get(key)\n self[key]\n end","title":""},{"docid":"fe977f85fe0eef2ccfe4126e0064a88e","score":"0.6210694","text":"def [] key\n get key\n end","title":""},{"docid":"bdf39bcf57043b25d79010b2d533454c","score":"0.62026066","text":"def [](key)\n @meta[key]\n end","title":""},{"docid":"13014ca4d59446a6947775e070924e0a","score":"0.62001795","text":"def method_missing(m, *args, &block)\n mode = :get\n method = m.to_s\n if method.end_with?(\"=\")\n mode = :set\n method = method[0...-1]\n end\n key = method.split(\"_\").map(&:capitalize).join\n if @data.key?(key)\n if mode == :get\n @data.fetch(key)\n else\n @data[key] = args.first\n end\n else\n super\n end\n end","title":""},{"docid":"e77b76855523386accea175dbb2753a3","score":"0.6185368","text":"def [](key)\n get(key)\n end","title":""},{"docid":"e77b76855523386accea175dbb2753a3","score":"0.6185368","text":"def [](key)\n get(key)\n end","title":""},{"docid":"e77b76855523386accea175dbb2753a3","score":"0.6185368","text":"def [](key)\n get(key)\n end","title":""},{"docid":"e77b76855523386accea175dbb2753a3","score":"0.6185368","text":"def [](key)\n get(key)\n end","title":""},{"docid":"e77b76855523386accea175dbb2753a3","score":"0.6185368","text":"def [](key)\n get(key)\n end","title":""},{"docid":"5212bb6d719ec83d507e613a960d5d37","score":"0.6183963","text":"def [](key)\n self.get(key)\n end","title":""},{"docid":"e01b2a1031b1482fb8b1dd9f8993cec6","score":"0.61640036","text":"def get(obj, key, **options)\n object_store(obj)[key.to_sym]\n end","title":""},{"docid":"02f1a5fe5f7957b4a65750b57f9c5f22","score":"0.61510086","text":"def [](cmdkey) ; @commands[cmdkey] ; end","title":""},{"docid":"318d8a08f8b4b47547b03a39738c7fa3","score":"0.61485314","text":"def get(key)\n # YOUR WORK HERE\n end","title":""},{"docid":"6136ed5a6f30ad715a4610b25b333ee4","score":"0.61478025","text":"def method_missing(aSymbol,*args)\n return @o.send(aSymbol,*args)\n end","title":""},{"docid":"221d98b17902e9b85becf86aeedcb35c","score":"0.6142097","text":"def [](k)\n self.send(k)\n end","title":""},{"docid":"221d98b17902e9b85becf86aeedcb35c","score":"0.6142097","text":"def [](k)\n self.send(k)\n end","title":""},{"docid":"755eb60d954d9a22f181acd6978e0bff","score":"0.6125284","text":"def [](key)\n get(key)\n end","title":""},{"docid":"05f5276d8fdd28a06299357f2c687ac0","score":"0.6124181","text":"def method_missing(key)\n @item[key]\n end","title":""},{"docid":"22ea03998d409e5cdbb7211db6a5aec6","score":"0.61168784","text":"def [](key)\n _get(key)\n end","title":""},{"docid":"7d0157776f15ec7f979c1c63fa8c1404","score":"0.61111295","text":"def [](key)\n raw[key]\n end","title":""},{"docid":"c03201cb5c1703e856e17f4e39173d09","score":"0.610651","text":"def get(key)\r\n \r\n end","title":""},{"docid":"2c166d630b806f66f924b7331103e64c","score":"0.6095619","text":"def get(key)\n call(key, [:get, key], read: true)\n end","title":""},{"docid":"d7eadd9259ba21ec89804db62f6442ce","score":"0.6093825","text":"def [](key)\n objectForKey(key.to_s)\n end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""},{"docid":"ee4f46953acf059db590ea37c8e4b1bb","score":"0.60929185","text":"def [](key); end","title":""}],"string":"[\n {\n \"docid\": \"76b121f5bdc4e6837e683d7992f29175\",\n \"score\": \"0.73201686\",\n \"text\": \"def send key, value\\n method_missing key, value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3725b4b192e57d14e424f3999b465c6f\",\n \"score\": \"0.7047996\",\n \"text\": \"def []( key ) send( key ); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c22ec58a17d89b5632b9dbc60222939d\",\n \"score\": \"0.69906574\",\n \"text\": \"def [](key) send(key) end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a14b64a5ffa132adf27eed137c34c53d\",\n \"score\": \"0.6926264\",\n \"text\": \"def [](key)\\n __send__(key) if key?(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"98835cf116ca3bb6c65f8d52cb9fbfff\",\n \"score\": \"0.68967503\",\n \"text\": \"def [](key)\\n\\t\\tself.send(key)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"27c69623e10f3329c6cee618310847da\",\n \"score\": \"0.68803287\",\n \"text\": \"def [](key)\\n __getobj__.get(key.to_s)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"80df037222f7e85d112316b3386983e8\",\n \"score\": \"0.6869525\",\n \"text\": \"def [](key)\\n __send__(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c7659c4693f8f3cd6d6774e7e3d0f191\",\n \"score\": \"0.68397963\",\n \"text\": \"def []( key )\\n #------------\\n self.send( \\\"#{key}\\\" )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"94010474c0962b94249dee6a6b4d9a91\",\n \"score\": \"0.6776639\",\n \"text\": \"def [](key)\\n send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"705997b68532b773785e363497cce94c\",\n \"score\": \"0.6703489\",\n \"text\": \"def [](key)\\n send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"705997b68532b773785e363497cce94c\",\n \"score\": \"0.6703489\",\n \"text\": \"def [](key)\\n send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"70c150ee1de82f911f8ab15d25479fdb\",\n \"score\": \"0.67001474\",\n \"text\": \"def [](key)\\n send key\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53dea5fc9aab1edee3f25174b8bf1efc\",\n \"score\": \"0.66956866\",\n \"text\": \"def [](key)\\n self.send key unless key == nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2f3426b57c20452c77f54fc8c12e9c13\",\n \"score\": \"0.6687201\",\n \"text\": \"def [](key)\\n send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2f3426b57c20452c77f54fc8c12e9c13\",\n \"score\": \"0.6687201\",\n \"text\": \"def [](key)\\n send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2f3426b57c20452c77f54fc8c12e9c13\",\n \"score\": \"0.6687201\",\n \"text\": \"def [](key)\\n send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3125e92d390f9639ee941da77a3765f\",\n \"score\": \"0.66661745\",\n \"text\": \"def get(key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0f56e0fa6234db2b5f00c42cec0053ca\",\n \"score\": \"0.6646918\",\n \"text\": \"def [](key)\\r\\n get key\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"13926c1fe20e5218afd34252a1f3e691\",\n \"score\": \"0.66283315\",\n \"text\": \"def [](key)\\n send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b48c10577ff7819138dc6e272e81b844\",\n \"score\": \"0.66000634\",\n \"text\": \"def [](key)\\n get key\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"59ba0a039732b1e5e33ce74565b531ba\",\n \"score\": \"0.6565473\",\n \"text\": \"def [](key)\\n self.send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"59ba0a039732b1e5e33ce74565b531ba\",\n \"score\": \"0.6565473\",\n \"text\": \"def [](key)\\n self.send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1ac908692a09efef969288da857856ec\",\n \"score\": \"0.6539108\",\n \"text\": \"def [](key)\\n proc_or_val(__getobj__[key])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c2fa704abdbcec3a02b87b3c5806cefe\",\n \"score\": \"0.65206295\",\n \"text\": \"def get(key)\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3718177f9c866cbfabb9135c7190446b\",\n \"score\": \"0.65017587\",\n \"text\": \"def [](key)\\n self.send(key.to_s)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"562319cbf067e1e0295243906976fbce\",\n \"score\": \"0.64885265\",\n \"text\": \"def [](key)\\n obj = read([key])\\n obj[key]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0a14819edb06ff8fa3e541c3b6ba4d00\",\n \"score\": \"0.64820266\",\n \"text\": \"def [](key)\\n method_missing(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e25d8411b07de446f47b596a5e0fc6b9\",\n \"score\": \"0.6460627\",\n \"text\": \"def get(key)\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e25d8411b07de446f47b596a5e0fc6b9\",\n \"score\": \"0.6460627\",\n \"text\": \"def get(key)\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e25d8411b07de446f47b596a5e0fc6b9\",\n \"score\": \"0.6460627\",\n \"text\": \"def get(key)\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e25d8411b07de446f47b596a5e0fc6b9\",\n \"score\": \"0.6460627\",\n \"text\": \"def get(key)\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d05e5512ecaf2537564eb80d1db68ee5\",\n \"score\": \"0.6460494\",\n \"text\": \"def [](key)\\n key = key.to_s.downcase\\n\\n if respond_to? key, true\\n send key\\n else\\n fetch key\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d15193ea2da02c01dd361ec8d9832674\",\n \"score\": \"0.64552414\",\n \"text\": \"def [](key)\\n # self.send(key)\\n super(key.to_sym)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d2623478fcf7ed175cf258a7f0b82d60\",\n \"score\": \"0.64459485\",\n \"text\": \"def [](key)\\n self.send(key) if self.keys.include?(key.to_sym)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"58863a6e25c04653699a7278bff8e82a\",\n \"score\": \"0.6441768\",\n \"text\": \"def get(key)\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9330cbb7352315de5a0f452ba2ed3d80\",\n \"score\": \"0.6437786\",\n \"text\": \"def _nydp_get key ; _nydp_safe_send(key.to_s.as_method_name) ; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"77e0e0bd8224b32f810008e0d8fadd9a\",\n \"score\": \"0.6406897\",\n \"text\": \"def [](key)\\n\\t\\tget(key)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3cad539ce3fbe0ae604fc83fd5a2f2c2\",\n \"score\": \"0.6401262\",\n \"text\": \"def [](key)\\n send(key) if respond_to?(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d4a84b17f83e62be113fa0653b0d4c4\",\n \"score\": \"0.6365732\",\n \"text\": \"def [](key)\\n send(:\\\"#{key}\\\") if self.respond_to?(:\\\"#{key}\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"90f0b5d4ac2c37e4d1ec489c49605e04\",\n \"score\": \"0.6360181\",\n \"text\": \"def [] key\\n __send__ key\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0a3c1a9f1557d4b294095092c5446974\",\n \"score\": \"0.6345509\",\n \"text\": \"def fetch(key)\\n send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0f69932e847dace4bf3d8f5f16d340f7\",\n \"score\": \"0.633564\",\n \"text\": \"def [](key)\\n return unless include?(key)\\n\\n target.send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"83514d0b8945b5a2483a775bbed026f1\",\n \"score\": \"0.6324599\",\n \"text\": \"def [](key)\\n if value = instance_variable_get(\\\"@#{key}\\\")\\n value\\n else\\n send key rescue nil\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cada3219d1b6d486daf1aa1b8007915f\",\n \"score\": \"0.6269392\",\n \"text\": \"def [](key)\\n public_send(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8bb864363cd13d426c6b4a0f562b799b\",\n \"score\": \"0.625142\",\n \"text\": \"def [](key)\\n Get((key.is_a?(Symbol) ? key.to_s : key))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c87736b3960ebb6bc17a2a00bf6d44b1\",\n \"score\": \"0.6241956\",\n \"text\": \"def [](key)\\n get(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c87736b3960ebb6bc17a2a00bf6d44b1\",\n \"score\": \"0.6241956\",\n \"text\": \"def [](key)\\n get(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ded0d6c4c32b927385fe95b8413d6a97\",\n \"score\": \"0.62396175\",\n \"text\": \"def get(key)\\n self[key]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fe977f85fe0eef2ccfe4126e0064a88e\",\n \"score\": \"0.6210694\",\n \"text\": \"def [] key\\n get key\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bdf39bcf57043b25d79010b2d533454c\",\n \"score\": \"0.62026066\",\n \"text\": \"def [](key)\\n @meta[key]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"13014ca4d59446a6947775e070924e0a\",\n \"score\": \"0.62001795\",\n \"text\": \"def method_missing(m, *args, &block)\\n mode = :get\\n method = m.to_s\\n if method.end_with?(\\\"=\\\")\\n mode = :set\\n method = method[0...-1]\\n end\\n key = method.split(\\\"_\\\").map(&:capitalize).join\\n if @data.key?(key)\\n if mode == :get\\n @data.fetch(key)\\n else\\n @data[key] = args.first\\n end\\n else\\n super\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e77b76855523386accea175dbb2753a3\",\n \"score\": \"0.6185368\",\n \"text\": \"def [](key)\\n get(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e77b76855523386accea175dbb2753a3\",\n \"score\": \"0.6185368\",\n \"text\": \"def [](key)\\n get(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e77b76855523386accea175dbb2753a3\",\n \"score\": \"0.6185368\",\n \"text\": \"def [](key)\\n get(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e77b76855523386accea175dbb2753a3\",\n \"score\": \"0.6185368\",\n \"text\": \"def [](key)\\n get(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e77b76855523386accea175dbb2753a3\",\n \"score\": \"0.6185368\",\n \"text\": \"def [](key)\\n get(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5212bb6d719ec83d507e613a960d5d37\",\n \"score\": \"0.6183963\",\n \"text\": \"def [](key)\\n self.get(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e01b2a1031b1482fb8b1dd9f8993cec6\",\n \"score\": \"0.61640036\",\n \"text\": \"def get(obj, key, **options)\\n object_store(obj)[key.to_sym]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"02f1a5fe5f7957b4a65750b57f9c5f22\",\n \"score\": \"0.61510086\",\n \"text\": \"def [](cmdkey) ; @commands[cmdkey] ; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"318d8a08f8b4b47547b03a39738c7fa3\",\n \"score\": \"0.61485314\",\n \"text\": \"def get(key)\\n # YOUR WORK HERE\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6136ed5a6f30ad715a4610b25b333ee4\",\n \"score\": \"0.61478025\",\n \"text\": \"def method_missing(aSymbol,*args)\\n return @o.send(aSymbol,*args)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"221d98b17902e9b85becf86aeedcb35c\",\n \"score\": \"0.6142097\",\n \"text\": \"def [](k)\\n self.send(k)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"221d98b17902e9b85becf86aeedcb35c\",\n \"score\": \"0.6142097\",\n \"text\": \"def [](k)\\n self.send(k)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"755eb60d954d9a22f181acd6978e0bff\",\n \"score\": \"0.6125284\",\n \"text\": \"def [](key)\\n get(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"05f5276d8fdd28a06299357f2c687ac0\",\n \"score\": \"0.6124181\",\n \"text\": \"def method_missing(key)\\n @item[key]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"22ea03998d409e5cdbb7211db6a5aec6\",\n \"score\": \"0.61168784\",\n \"text\": \"def [](key)\\n _get(key)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7d0157776f15ec7f979c1c63fa8c1404\",\n \"score\": \"0.61111295\",\n \"text\": \"def [](key)\\n raw[key]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c03201cb5c1703e856e17f4e39173d09\",\n \"score\": \"0.610651\",\n \"text\": \"def get(key)\\r\\n \\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2c166d630b806f66f924b7331103e64c\",\n \"score\": \"0.6095619\",\n \"text\": \"def get(key)\\n call(key, [:get, key], read: true)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7eadd9259ba21ec89804db62f6442ce\",\n \"score\": \"0.6093825\",\n \"text\": \"def [](key)\\n objectForKey(key.to_s)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee4f46953acf059db590ea37c8e4b1bb\",\n \"score\": \"0.60929185\",\n \"text\": \"def [](key); end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":179,"cells":{"query_id":{"kind":"string","value":"df925c694df79c966d5a68e67e8085bf"},"query":{"kind":"string","value":"Returns the value if has a value Blocks until a value it set"},"positive_passages":{"kind":"list like","value":[{"docid":"3959fc2ffe683151c59133b622548027","score":"0.78608334","text":"def value\n if @has_value\n return @value\n else\n @mutex.synchronize {\n @condvar.wait(@mutex, @timeout)\n return @value\n }\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"3959fc2ffe683151c59133b622548027\",\n \"score\": \"0.78608334\",\n \"text\": \"def value\\n if @has_value\\n return @value\\n else\\n @mutex.synchronize {\\n @condvar.wait(@mutex, @timeout)\\n return @value\\n }\\n end\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"31fd5d476fd28e709bf663e52ea4387b","score":"0.7410398","text":"def value\n\t\treturn @value if delivered?\n\n\t\tmutex.synchronize {\n\t\t\tcond.wait(mutex)\n\t\t}\n\n\t\t@value\n\tend","title":""},{"docid":"19439622c89dde413eef604d63b30c81","score":"0.7113347","text":"def block_until_completes\n return get_random_value\n end","title":""},{"docid":"aeeb7a41841ea624eab25347b69b3e34","score":"0.7102387","text":"def value\n # Lance l'evaluation uniquement si la variable est frozen\n eval if @state == :frozen\n\n # Attend que la valeur de la variable soit disponible\n @mutex.synchronize do\n @is_full.wait(@mutex) until full?\n end\n\n @value\n end","title":""},{"docid":"faf2c3ae30cd4d82f6d4cfb3bad8ff40","score":"0.7011279","text":"def value (timeout = nil)\n\t\traise @exception if exception?\n\n\t\treturn @value if delivered?\n\n\t\t@mutex.synchronize {\n\t\t\tcond.wait(@mutex, *timeout)\n\t\t}\n\n\t\tif exception?\n\t\t\traise @exception\n\t\telsif delivered?\n\t\t\treturn @value\n\t\tend\n\tend","title":""},{"docid":"916b8a72a337f0f2abba8f3083e2ff64","score":"0.6958924","text":"def __value__\n __force__ unless @running\n @group.wait\n ::Kernel.raise(@exception) if @exception\n @value\n end","title":""},{"docid":"d867df2c6a5ca58cbcbe115a25c28cfd","score":"0.69303185","text":"def read\n synchronize do\n wait_full\n @value\n end\n end","title":""},{"docid":"dac60451a6c73650bb6909db5f55ac4a","score":"0.6904459","text":"def value_or(&block)\n promise.rescue(&block).wait.value\n end","title":""},{"docid":"8b087d8be5b255e85c32bad56ee2b615","score":"0.68342805","text":"def value(timeout = nil)\n raise @exception if exception?\n\n return @value if delivered?\n\n @mutex.synchronize {\n cond.wait(@mutex, *timeout)\n }\n\n if exception?\n raise @exception\n elsif delivered?\n return @value\n end\n end","title":""},{"docid":"ee9d8187700d2fbce8e3b4f41fcfcfa7","score":"0.68068653","text":"def value\n semaphore = nil\n @lock.synchronize do\n raise @error if @failed\n return @value if @resolved\n semaphore = Queue.new\n u = proc { semaphore << :unblock }\n @value_listeners << u\n @failure_listeners << u\n end\n while true\n @lock.synchronize do\n raise @error if @failed\n return @value if @resolved\n end\n semaphore.pop\n end\n end","title":""},{"docid":"d1a1f4f63c9dfcdfd4f2980e806cf628","score":"0.6768079","text":"def value\n @mutex.lock\n @value\n ensure\n @mutex.unlock\n end","title":""},{"docid":"67743986b3e03762a84633ded9e397a5","score":"0.6753695","text":"def await\n EventManager.listen(self, Fiber.current) unless @value\n status, val = get_value\n if status == :bad\n raise val\n else\n val\n end\n end","title":""},{"docid":"33efeee5a571aadad85ed934e88850bf","score":"0.67180824","text":"def get_until\n error = nil\n loop do\n error = get\n break unless error\n end\n error\n end","title":""},{"docid":"12039bc4bc50c898098fcf3407cee424","score":"0.6699577","text":"def value!\n if promise.wait.fulfilled?\n promise.value\n else\n raise promise.reason\n end\n end","title":""},{"docid":"dd40098d1085498e2fb7da9014c67366","score":"0.66066426","text":"def wait_for_property_value_box\n wait_until do\n self.statementValueInput? || self.statementValueInputField?\n end\n end","title":""},{"docid":"5b2fdb24322b379976a6d09f741083a5","score":"0.65926147","text":"def value\n return @value if @fulfilled\n\n @mutex.synchronize do\n unless @fulfilled\n begin\n @value = @task.call\n rescue\n @value = @default\n ensure\n @fulfilled = true\n end\n end\n return @value\n end\n end","title":""},{"docid":"194071219f6b4772434526b1f42640b0","score":"0.65646505","text":"def value\n val = fetch_value\n val if val.present? && val > 0\n end","title":""},{"docid":"acb5b187a8936a2e89e96f34f7c7f74f","score":"0.6551616","text":"def true?\n @mutex.lock\n @value\n ensure\n @mutex.unlock\n end","title":""},{"docid":"348f85941843f51e00a0bd36cefe7bc1","score":"0.6541263","text":"def value\n unless complete?\n @mutex.synchronize do\n start\n end\n end\n error? ? raise(@error) : @result\n end","title":""},{"docid":"482db3e80a28f2f2e01516b6c9a6ba90","score":"0.6482577","text":"def value\n\t\t@mutex.synchronize {\n\t\t\traise @exception if instance_variable_defined? :@exception\n\n\t\t\treturn @value if instance_variable_defined? :@value\n\n\t\t\tbegin\n\t\t\t\t@value = @block.call\n\t\t\trescue Exception => e\n\t\t\t\t@exception = e\n\n\t\t\t\traise\n\t\t\tend\n\t\t}\n\tend","title":""},{"docid":"95d2c41e2fe5e635f384ca74d015087e","score":"0.64754397","text":"def value\n @value ||= read_value\n end","title":""},{"docid":"319f1933dfe01f3095ceae4a5c032f9b","score":"0.6371597","text":"def value\n @value ||= extract_value\n end","title":""},{"docid":"fc0b69904ace93bdcf93e62177b6e3d0","score":"0.6344752","text":"def value\n @lock.synchronize do\n unless @value_obtained\n @value = @runner.value\n @runner.terminate\n @value_obtained = true\n end\n\n @value\n end\n end","title":""},{"docid":"03d8449993d08154d1df69ff65e020b8","score":"0.6331288","text":"def run\n until halted?\n step\n end\n \n value\n end","title":""},{"docid":"2942a227806e76059b6a837342f50869","score":"0.63238084","text":"def value\n Fear.option(promise.value(0))\n end","title":""},{"docid":"3f3cd1e525d728f7656819d797ca6236","score":"0.6316392","text":"def value\n\t\t\t@mutex.synchronize{ @value }\n\t\tend","title":""},{"docid":"4bfe5ed8d852bd640004c8b62ced224f","score":"0.62705165","text":"def wait_for_value input_locator, value\r\n command 'waitForValue', input_locator, value\r\n end","title":""},{"docid":"60396c8e23654b2df2a9310fdef17ad3","score":"0.62606156","text":"def get_val\n val = nil\n until val && valid_val?(val)\n puts \"Please enter 'f' for flag, 'r' for reveal\"\n val = gets.chomp\n end\n val\n end","title":""},{"docid":"e33adf85c1525c13acf2847db12150c6","score":"0.61923313","text":"def value\n # return the value if it has been generated,\n # or attempt to generate it.\n @generated ? @result : @mutex.synchronize do\n # return the value if the value was generated before\n # we acquired the lock (e.g., another thread won)\n @generated ? @result : begin\n result = @generator.call\n @generator = nil\n @generated = true\n @result = result\n end\n end\n end","title":""},{"docid":"e9fac8a78a558b5555853cfe171240b0","score":"0.6186386","text":"def value!\n @value_ ||= value\n end","title":""},{"docid":"c61aba6680bceba7f46881925b1755d2","score":"0.6148461","text":"def fetch(name)\n @values.fetch(name) do # check for the key\n @monitor.synchronize do # acquire a lock if the key is not found\n @values.fetch(name) do # recheck under lock\n @values[name] = yield # set the value\n end\n end\n end\n end","title":""},{"docid":"84abd35016a44c2a3d2a54d1f3167aeb","score":"0.61385834","text":"def then\n SVar.new( :write_once, :async) { yield(value) }\n end","title":""},{"docid":"ef52cac8a249cdef3b9469306d9d7ed7","score":"0.61226195","text":"def wait_until(timeout = DEFAULT_WAIT_TIME)\n Timeout.timeout(timeout) do\n sleep(0.1) until value = yield\n value\n end\nend","title":""},{"docid":"85b3c204b5f9aa1862cd9a13a7215b7b","score":"0.6107224","text":"def value?\n !@no_value\n end","title":""},{"docid":"d802fd87be7ce020e44a33cef88d93ab","score":"0.61061615","text":"def wait\n return if set?\n \n sleep(0.01) until set?\n end","title":""},{"docid":"5450707bf9b676e23d0cddabb5afd4dc","score":"0.61012393","text":"def value\n wait_until_exists\n @button.value\n end","title":""},{"docid":"5450707bf9b676e23d0cddabb5afd4dc","score":"0.61012393","text":"def value\n wait_until_exists\n @button.value\n end","title":""},{"docid":"f8423f80cb2071b7213f3dc1be3a7e69","score":"0.6090085","text":"def value_check\n \t@value\n end","title":""},{"docid":"98ff2883f4c78e5aa8d4eacb804ba228","score":"0.6049967","text":"def value?\n @has_value\n end","title":""},{"docid":"83de1947afc0377966f71d53e30e702f","score":"0.60461754","text":"def value_when_finished; end","title":""},{"docid":"7e9ac95fab31a6b9537eeea4f71ed7a5","score":"0.6039069","text":"def get_value\n @get_value_handler.call\n end","title":""},{"docid":"4c69e8be830b4935bd4fee56f235d3a1","score":"0.6018499","text":"def has_value?\n @has_value\n end","title":""},{"docid":"4b832578aa87bb239af6fe100182637f","score":"0.60176826","text":"def get_value\n\t\treturn @value\n\tend","title":""},{"docid":"4b832578aa87bb239af6fe100182637f","score":"0.60176826","text":"def get_value\n\t\treturn @value\n\tend","title":""},{"docid":"c080e3d9e70683f3e1b86cc567a68594","score":"0.60158634","text":"def value!\n @promise.execute.value!\n end","title":""},{"docid":"b05976d949fb6b9be5c47935ce8ecacf","score":"0.6003888","text":"def with\n synchronize do\n wait_full\n yield @value\n end\n end","title":""},{"docid":"27660c4d63f8482df7fa4d3ee2d22282","score":"0.60009396","text":"def wait_for_variable?; !completed? && actual_task.wait_for_variable?; end","title":""},{"docid":"be06a2783e07402b8554253847d637f1","score":"0.5991099","text":"def get_value\n @value\n end","title":""},{"docid":"89fc1cda7bb57fb7fc0f69649452e3ca","score":"0.59799355","text":"def has_value?\n\n return @has_value\n\n end","title":""},{"docid":"50b0d4e2a5095cfeacabc1f854feeeb2","score":"0.5979677","text":"def value!(timeout = nil)\n touch\n internal_state.value if wait_until_complete! timeout\n end","title":""},{"docid":"071ee05b6eb2808438a926bf2657764a","score":"0.5979299","text":"def cached_value(key)\n monitor = value = nil\n @lock.synchronize do\n if @hard_references.has_key?(key)\n return @hard_references[key]\n elsif (value = @soft_references[key])\n return value\n elsif (monitor = @in_progress[key])\n monitor.wait(@lock)\n return self[key]\n end\n @in_progress[key] = monitor = ConditionVariable.new\n end\n begin\n value = yield\n value_set = true\n ensure\n @lock.synchronize do\n self[key] = value if value_set\n @in_progress.delete key\n monitor.broadcast\n end\n end\n value\n end","title":""},{"docid":"8ba0ed6512dc85a92171022f00280f3e","score":"0.5974913","text":"def value_condition\n value.present?\n end","title":""},{"docid":"07e4f61f96eb2d904f5db830770f6633","score":"0.5961434","text":"def get; @value end","title":""},{"docid":"53c2ad9940e9b601425333bd79c6d9ac","score":"0.59606385","text":"def value\n @promise.value\n end","title":""},{"docid":"74a6aaf2fbd3568833b088542b8ef974","score":"0.5960272","text":"def value timeout = nil, timeout_value = nil\n @future.value timeout, timeout_value\n end","title":""},{"docid":"d564826355ddc8101b07a9994c13b310","score":"0.59508365","text":"def value\n if success?\n result\n end\n end","title":""},{"docid":"c75886ac4d6fadd7614c6a6828fffcd9","score":"0.5946368","text":"def wait_for_settings_update key, value = true\n safety = 5\n while !(@user.settings.try(:[], key) == value) && (safety > 0)\n safety -= 1\n sleep 0.5\n end\n end","title":""},{"docid":"392b07673c2f684201399d3df775303d","score":"0.5946257","text":"def get_value(testing = false)\n self.is_enabled?(testing) ? self.value : nil\n end","title":""},{"docid":"04759ff33ad7468763d5fbf40c30d477","score":"0.59323364","text":"def value?\n @value\n end","title":""},{"docid":"481f984828d8b6ae4fa52c0c29f16ef6","score":"0.5919876","text":"def value\n Concurrent::atomically do\n Transaction::current.read(self)\n end\n end","title":""},{"docid":"481f984828d8b6ae4fa52c0c29f16ef6","score":"0.5919876","text":"def value\n Concurrent::atomically do\n Transaction::current.read(self)\n end\n end","title":""},{"docid":"aea7da9acace39dac6edf107953c67a7","score":"0.5919598","text":"def has_value?()\n #This is a stub, used for indexing\n end","title":""},{"docid":"eae22ac4dd7e3504738ed9961c18037c","score":"0.59042615","text":"def get_value\n value\n end","title":""},{"docid":"3699fc206a90d1b5a929950c1e64b51e","score":"0.59010756","text":"def value\r\n assert_exists\r\n attribute_value('value')\r\n end","title":""},{"docid":"eec84661afb4266c45bc42a6b6b80564","score":"0.5900476","text":"def wait_until_condition(true_or_false, timeout = TIMEOUT)\n max_time = Time.now + timeout\n\n while Time.now < max_time\n begin\n result = yield\n return if result == true_or_false\n puts \"Waiting for value to be #{true_or_false}. Saw '#{result}.'\"\n rescue Selenium::WebDriver::Error::ElementNotVisibleError,\n Selenium::WebDriver::Error::InvalidElementStateError,\n Selenium::WebDriver::Error::NoSuchElementError,\n Selenium::WebDriver::Error::StaleElementReferenceError => e\n # Keep polling the dom for condition success\n puts \"Swallowing error #{e.message}\"\n end\n sleep(POLL_INTERVAL)\n end\n\n # Throw an exception\n raise Error::WaitExpiredException, 'Wait expired waiting for element value condition.'\n end","title":""},{"docid":"9651e9af7c50b823ddfec05c482cfcfd","score":"0.5872437","text":"def ready?\n !!@value\n end","title":""},{"docid":"f35d0c4307da86b4976414d129d55a85","score":"0.5860971","text":"def val\n return @val\n end","title":""},{"docid":"d6f23d21acf267ef23d57ba3669ba99d","score":"0.585832","text":"def value(timeout = nil)\n ready = result = nil\n\n begin\n @mutex.lock\n\n if @ready\n ready = true\n result = @result\n end\n ensure\n @mutex.unlock\n end\n\n unless ready\n if timeout\n raise TimeoutError, \"Timeout not supported by Bones::RPC::Synchronous backend\"\n end\n end\n\n if result\n result.value\n else\n raise TimeoutError, \"Timeout not supported by Bones::RPC::Synchronous backend\"\n end\n end","title":""},{"docid":"3c155a4d220f1eaf8946412f32df5400","score":"0.58510035","text":"def value?\n !value.nil?\n end","title":""},{"docid":"3c155a4d220f1eaf8946412f32df5400","score":"0.58510035","text":"def value?\n !value.nil?\n end","title":""},{"docid":"27de3249f6c7b124527ab8b70e613076","score":"0.5850224","text":"def get_wait_for_user_input\n return @wait_for_user_input\n end","title":""},{"docid":"2d20dff564193b9018920ccf757fe40c","score":"0.584863","text":"def _value\n @value || sensible_default()\n end","title":""},{"docid":"36e239230435d0335b2153ad18e4a770","score":"0.5846571","text":"def get\n @value\n end","title":""},{"docid":"bcb848a359494bbec2958e08e9b41eec","score":"0.5846085","text":"def value?\n !value.nil?\n end","title":""},{"docid":"d444ae92e9e954999ddbb1c0c5d36784","score":"0.5835195","text":"def then\n yield value\n end","title":""},{"docid":"9a167e8d18f7448e12e462d799d58284","score":"0.58194536","text":"def wait_until(timeout, &block)\n begin\n Timeout.timeout(timeout) do\n sleep(0.1) until value = block.call\n value\n end\n rescue TimeoutError\n false\n end\n end","title":""},{"docid":"ea6e95b2b9bb8634c6ea313ed7779aff","score":"0.5817284","text":"def get_value\n send_request(FUNCTION_GET_VALUE, [], '', 2, 'S')\n end","title":""},{"docid":"82d406bf3f908d9d89e0d204d3399152","score":"0.58156717","text":"def present_value\n # puts \"-------#{@id}----------------\"\n pv = first(\"##{@id}\").value\n pv = \"\" if pv.nil?\n pv\n end","title":""},{"docid":"d46c4a3ae91eec4d7994e77c568b3c4c","score":"0.58126366","text":"def wait_until\n require \"timeout\"\n Timeout.timeout(Capybara.default_wait_time) do\n sleep(0.1) until value = yield\n value\n end\n end","title":""},{"docid":"2349fa1f3d2194ef0c24324bf0d4a465","score":"0.5812613","text":"def wait_for_field_value(locator, expected_value, options={})\n script = find_element_script(locator, \n \"(element != null && element.value == '#{quote_escaped(expected_value)}')\")\n wait_for_condition script, options[:timeout_in_seconds]\n end","title":""},{"docid":"11cd27a394b81b0b7aafa1a36c6119d1","score":"0.5785922","text":"def value(timeout = nil)\n ready = result = nil\n\n begin\n @mutex.lock\n\n if @ready\n ready = true\n result = @result\n else\n case @forwards\n when Array\n @forwards << Celluloid.mailbox\n when NilClass\n @forwards = Celluloid.mailbox\n else\n @forwards = [@forwards, Celluloid.mailbox]\n end\n end\n ensure\n @mutex.unlock\n end\n\n unless ready\n result = Celluloid.receive(timeout) do |msg|\n msg.is_a?(Future::Result) && msg.future == self\n end\n end\n\n if result\n result.respond_to?(:value) ? result.value : result\n else\n raise TimedOut, \"Timed out\"\n end\n end","title":""},{"docid":"1852aef9fcf58d955a355f4d40711a76","score":"0.5778219","text":"def getValue()\n return @value\n end","title":""},{"docid":"39993469c7d93dda81f0c6a66b57e335","score":"0.5776783","text":"def value\n result = nil\n return result if @code == nil\n\n starttime = Time.now.to_f\n\n begin\n Timeout.timeout(limit) do\n if @code.is_a?(Proc)\n result = @code.call()\n else\n result = Facter::Util::Resolution.exec(@code)\n end\n end\n rescue Timeout::Error => detail\n warn \"Timed out seeking value for %s\" % self.name\n\n # This call avoids zombies -- basically, create a thread that will\n # dezombify all of the child processes that we're ignoring because\n # of the timeout.\n Thread.new { Process.waitall }\n return nil\n rescue => details\n warn \"Could not retrieve %s: %s\" % [self.name, details]\n return nil\n end\n\n finishtime = Time.now.to_f\n ms = (finishtime - starttime) * 1000\n Facter.show_time \"#{self.name}: #{\"%.2f\" % ms}ms\"\n\n return nil if result == \"\"\n return result\n end","title":""},{"docid":"25ad7dc4d09b30f8885db786fd53b08d","score":"0.577513","text":"def populate_with\n return @value if full?\n\n synchronize do\n perform_put(yield) if empty?\n end\n\n @value\n end","title":""},{"docid":"47f1f64c79b58317c6e286d0df7748d4","score":"0.5772879","text":"def wait_until(timeout = DEFAULT_WAIT_TIME)\n\tTimeout.timeout(timeout) do\n\t\tsleep(0.1) until value = yield\n\t\tvalue\n\tend\nend","title":""},{"docid":"ef68b3d2d7296848e4fcc3b3958c86aa","score":"0.5772015","text":"def value?\n value.any?\n end","title":""},{"docid":"4ec7bf5bd4bf41280ca807bb987af0c0","score":"0.5763517","text":"def value()\n\t\t\tif @type != :value\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\t\n\t\t\treturn @value\n\t\tend","title":""},{"docid":"fd4e64cbdd58bfa06f1cf5519710d59f","score":"0.5759991","text":"def get_value\n wait\n $browser.find_element(:xpath, @locator).text\n end","title":""},{"docid":"471723207fc07ffeff8c23ad6c00b4d2","score":"0.5733045","text":"def get_value\n send_request(FUNCTION_GET_VALUE, [], '', 1, 'C')\n end","title":""},{"docid":"7335e16f7dec0b4a9ff034655f485f2b","score":"0.57306266","text":"def get_or_set(key)\n value = get(key)\n return value if value\n value = yield\n set(key, value)\n value\n end","title":""},{"docid":"2ab43b6d8db8c78a78cb7016f0607cb1","score":"0.5729218","text":"def value()\n ( @candidates.size == 1 ) ? @candidates[0] : nil\n end","title":""},{"docid":"ff17851ef00e2f4809f7b4bfa00566fd","score":"0.5728122","text":"def wait_for_change(continue = nil)\n @fd ||= File.open(value_file, \"r\")\n @waiting = true\n read\n begin\n ready = IO.select(nil, nil, [@fd], 1)\n if ready\n read\n ready = nil if !changed? || value == 0 # val is a hack\n end\n end while @waiting && !ready && (!continue || continue.call)\n end","title":""},{"docid":"4cc5244bba7b26169bf12ba011c85891","score":"0.5721808","text":"def val\n @val\n end","title":""},{"docid":"e6caf205aeec2f0f68413efb9f78fb66","score":"0.5716253","text":"def wait_for_field_value(locator, expected_value, timeout_in_seconds=nil)\n\t\t script = \"var element;\n\t\t try {\n\t\t element = selenium.browserbot.findElement('#{locator}');\n\t\t } catch(e) {\n\t\t element = null;\n\t\t }\n\t\t element != null && element.value == '#{expected_value}'\"\n\n\t\t wait_for_condition script, timeout_in_seconds\n\t\t end","title":""},{"docid":"5c47537385b97e3b9f3817595051a6f6","score":"0.57109326","text":"def until_loop\n until @my_value > 5\n puts @my_value\n @my_value+=1\n end\nend","title":""},{"docid":"cd927a067c903620291763a5c89bfbe9","score":"0.5710578","text":"def has_value?\n !value.empty?\n end","title":""},{"docid":"e3dabade23f076960f6917f24055c979","score":"0.5710473","text":"def get\n STM.possibly_atomically do\n STM.get_current_transaction.get_value(self)\n end\n end","title":""},{"docid":"fa040d2b6d8bb6419e09a0d394a9e310","score":"0.5709485","text":"def compute_value(options, &block)\n rv = block.call(options)\n rv = ::Elephas::Entry.ensure(rv, options[:complete_key], options) # Make sure is an entry\n write(rv.hash, rv, options) if !rv.value.nil? && options[:ttl] > 0 # We have a value and we have to store it\n rv\n end","title":""},{"docid":"d9b83e30a106f1b5d91837a02a4f89ba","score":"0.5702436","text":"def delivered?\n\t\t@mutex.synchronize {\n\t\t\tinstance_variable_defined? :@value\n\t\t}\n\tend","title":""},{"docid":"d9b83e30a106f1b5d91837a02a4f89ba","score":"0.5702436","text":"def delivered?\n\t\t@mutex.synchronize {\n\t\t\tinstance_variable_defined? :@value\n\t\t}\n\tend","title":""},{"docid":"63d62f97b6cb6e45caab1c2c2455ddf5","score":"0.5702238","text":"def set_value\n self.value = loop do\n random_token = SecureRandom.hex(2)\n break random_token unless self.class\n .where(value: random_token)\n .where('expires_at >= ?', Time.current)\n .present?\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"31fd5d476fd28e709bf663e52ea4387b\",\n \"score\": \"0.7410398\",\n \"text\": \"def value\\n\\t\\treturn @value if delivered?\\n\\n\\t\\tmutex.synchronize {\\n\\t\\t\\tcond.wait(mutex)\\n\\t\\t}\\n\\n\\t\\t@value\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"19439622c89dde413eef604d63b30c81\",\n \"score\": \"0.7113347\",\n \"text\": \"def block_until_completes\\n return get_random_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aeeb7a41841ea624eab25347b69b3e34\",\n \"score\": \"0.7102387\",\n \"text\": \"def value\\n # Lance l'evaluation uniquement si la variable est frozen\\n eval if @state == :frozen\\n\\n # Attend que la valeur de la variable soit disponible\\n @mutex.synchronize do\\n @is_full.wait(@mutex) until full?\\n end\\n\\n @value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"faf2c3ae30cd4d82f6d4cfb3bad8ff40\",\n \"score\": \"0.7011279\",\n \"text\": \"def value (timeout = nil)\\n\\t\\traise @exception if exception?\\n\\n\\t\\treturn @value if delivered?\\n\\n\\t\\t@mutex.synchronize {\\n\\t\\t\\tcond.wait(@mutex, *timeout)\\n\\t\\t}\\n\\n\\t\\tif exception?\\n\\t\\t\\traise @exception\\n\\t\\telsif delivered?\\n\\t\\t\\treturn @value\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"916b8a72a337f0f2abba8f3083e2ff64\",\n \"score\": \"0.6958924\",\n \"text\": \"def __value__\\n __force__ unless @running\\n @group.wait\\n ::Kernel.raise(@exception) if @exception\\n @value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d867df2c6a5ca58cbcbe115a25c28cfd\",\n \"score\": \"0.69303185\",\n \"text\": \"def read\\n synchronize do\\n wait_full\\n @value\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dac60451a6c73650bb6909db5f55ac4a\",\n \"score\": \"0.6904459\",\n \"text\": \"def value_or(&block)\\n promise.rescue(&block).wait.value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8b087d8be5b255e85c32bad56ee2b615\",\n \"score\": \"0.68342805\",\n \"text\": \"def value(timeout = nil)\\n raise @exception if exception?\\n\\n return @value if delivered?\\n\\n @mutex.synchronize {\\n cond.wait(@mutex, *timeout)\\n }\\n\\n if exception?\\n raise @exception\\n elsif delivered?\\n return @value\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee9d8187700d2fbce8e3b4f41fcfcfa7\",\n \"score\": \"0.68068653\",\n \"text\": \"def value\\n semaphore = nil\\n @lock.synchronize do\\n raise @error if @failed\\n return @value if @resolved\\n semaphore = Queue.new\\n u = proc { semaphore << :unblock }\\n @value_listeners << u\\n @failure_listeners << u\\n end\\n while true\\n @lock.synchronize do\\n raise @error if @failed\\n return @value if @resolved\\n end\\n semaphore.pop\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d1a1f4f63c9dfcdfd4f2980e806cf628\",\n \"score\": \"0.6768079\",\n \"text\": \"def value\\n @mutex.lock\\n @value\\n ensure\\n @mutex.unlock\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"67743986b3e03762a84633ded9e397a5\",\n \"score\": \"0.6753695\",\n \"text\": \"def await\\n EventManager.listen(self, Fiber.current) unless @value\\n status, val = get_value\\n if status == :bad\\n raise val\\n else\\n val\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"33efeee5a571aadad85ed934e88850bf\",\n \"score\": \"0.67180824\",\n \"text\": \"def get_until\\n error = nil\\n loop do\\n error = get\\n break unless error\\n end\\n error\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"12039bc4bc50c898098fcf3407cee424\",\n \"score\": \"0.6699577\",\n \"text\": \"def value!\\n if promise.wait.fulfilled?\\n promise.value\\n else\\n raise promise.reason\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dd40098d1085498e2fb7da9014c67366\",\n \"score\": \"0.66066426\",\n \"text\": \"def wait_for_property_value_box\\n wait_until do\\n self.statementValueInput? || self.statementValueInputField?\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5b2fdb24322b379976a6d09f741083a5\",\n \"score\": \"0.65926147\",\n \"text\": \"def value\\n return @value if @fulfilled\\n\\n @mutex.synchronize do\\n unless @fulfilled\\n begin\\n @value = @task.call\\n rescue\\n @value = @default\\n ensure\\n @fulfilled = true\\n end\\n end\\n return @value\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"194071219f6b4772434526b1f42640b0\",\n \"score\": \"0.65646505\",\n \"text\": \"def value\\n val = fetch_value\\n val if val.present? && val > 0\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"acb5b187a8936a2e89e96f34f7c7f74f\",\n \"score\": \"0.6551616\",\n \"text\": \"def true?\\n @mutex.lock\\n @value\\n ensure\\n @mutex.unlock\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"348f85941843f51e00a0bd36cefe7bc1\",\n \"score\": \"0.6541263\",\n \"text\": \"def value\\n unless complete?\\n @mutex.synchronize do\\n start\\n end\\n end\\n error? ? raise(@error) : @result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"482db3e80a28f2f2e01516b6c9a6ba90\",\n \"score\": \"0.6482577\",\n \"text\": \"def value\\n\\t\\t@mutex.synchronize {\\n\\t\\t\\traise @exception if instance_variable_defined? :@exception\\n\\n\\t\\t\\treturn @value if instance_variable_defined? :@value\\n\\n\\t\\t\\tbegin\\n\\t\\t\\t\\t@value = @block.call\\n\\t\\t\\trescue Exception => e\\n\\t\\t\\t\\t@exception = e\\n\\n\\t\\t\\t\\traise\\n\\t\\t\\tend\\n\\t\\t}\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"95d2c41e2fe5e635f384ca74d015087e\",\n \"score\": \"0.64754397\",\n \"text\": \"def value\\n @value ||= read_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"319f1933dfe01f3095ceae4a5c032f9b\",\n \"score\": \"0.6371597\",\n \"text\": \"def value\\n @value ||= extract_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc0b69904ace93bdcf93e62177b6e3d0\",\n \"score\": \"0.6344752\",\n \"text\": \"def value\\n @lock.synchronize do\\n unless @value_obtained\\n @value = @runner.value\\n @runner.terminate\\n @value_obtained = true\\n end\\n\\n @value\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"03d8449993d08154d1df69ff65e020b8\",\n \"score\": \"0.6331288\",\n \"text\": \"def run\\n until halted?\\n step\\n end\\n \\n value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2942a227806e76059b6a837342f50869\",\n \"score\": \"0.63238084\",\n \"text\": \"def value\\n Fear.option(promise.value(0))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3f3cd1e525d728f7656819d797ca6236\",\n \"score\": \"0.6316392\",\n \"text\": \"def value\\n\\t\\t\\t@mutex.synchronize{ @value }\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4bfe5ed8d852bd640004c8b62ced224f\",\n \"score\": \"0.62705165\",\n \"text\": \"def wait_for_value input_locator, value\\r\\n command 'waitForValue', input_locator, value\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"60396c8e23654b2df2a9310fdef17ad3\",\n \"score\": \"0.62606156\",\n \"text\": \"def get_val\\n val = nil\\n until val && valid_val?(val)\\n puts \\\"Please enter 'f' for flag, 'r' for reveal\\\"\\n val = gets.chomp\\n end\\n val\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e33adf85c1525c13acf2847db12150c6\",\n \"score\": \"0.61923313\",\n \"text\": \"def value\\n # return the value if it has been generated,\\n # or attempt to generate it.\\n @generated ? @result : @mutex.synchronize do\\n # return the value if the value was generated before\\n # we acquired the lock (e.g., another thread won)\\n @generated ? @result : begin\\n result = @generator.call\\n @generator = nil\\n @generated = true\\n @result = result\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e9fac8a78a558b5555853cfe171240b0\",\n \"score\": \"0.6186386\",\n \"text\": \"def value!\\n @value_ ||= value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c61aba6680bceba7f46881925b1755d2\",\n \"score\": \"0.6148461\",\n \"text\": \"def fetch(name)\\n @values.fetch(name) do # check for the key\\n @monitor.synchronize do # acquire a lock if the key is not found\\n @values.fetch(name) do # recheck under lock\\n @values[name] = yield # set the value\\n end\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"84abd35016a44c2a3d2a54d1f3167aeb\",\n \"score\": \"0.61385834\",\n \"text\": \"def then\\n SVar.new( :write_once, :async) { yield(value) }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ef52cac8a249cdef3b9469306d9d7ed7\",\n \"score\": \"0.61226195\",\n \"text\": \"def wait_until(timeout = DEFAULT_WAIT_TIME)\\n Timeout.timeout(timeout) do\\n sleep(0.1) until value = yield\\n value\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"85b3c204b5f9aa1862cd9a13a7215b7b\",\n \"score\": \"0.6107224\",\n \"text\": \"def value?\\n !@no_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d802fd87be7ce020e44a33cef88d93ab\",\n \"score\": \"0.61061615\",\n \"text\": \"def wait\\n return if set?\\n \\n sleep(0.01) until set?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5450707bf9b676e23d0cddabb5afd4dc\",\n \"score\": \"0.61012393\",\n \"text\": \"def value\\n wait_until_exists\\n @button.value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5450707bf9b676e23d0cddabb5afd4dc\",\n \"score\": \"0.61012393\",\n \"text\": \"def value\\n wait_until_exists\\n @button.value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f8423f80cb2071b7213f3dc1be3a7e69\",\n \"score\": \"0.6090085\",\n \"text\": \"def value_check\\n \\t@value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"98ff2883f4c78e5aa8d4eacb804ba228\",\n \"score\": \"0.6049967\",\n \"text\": \"def value?\\n @has_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"83de1947afc0377966f71d53e30e702f\",\n \"score\": \"0.60461754\",\n \"text\": \"def value_when_finished; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7e9ac95fab31a6b9537eeea4f71ed7a5\",\n \"score\": \"0.6039069\",\n \"text\": \"def get_value\\n @get_value_handler.call\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c69e8be830b4935bd4fee56f235d3a1\",\n \"score\": \"0.6018499\",\n \"text\": \"def has_value?\\n @has_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4b832578aa87bb239af6fe100182637f\",\n \"score\": \"0.60176826\",\n \"text\": \"def get_value\\n\\t\\treturn @value\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4b832578aa87bb239af6fe100182637f\",\n \"score\": \"0.60176826\",\n \"text\": \"def get_value\\n\\t\\treturn @value\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c080e3d9e70683f3e1b86cc567a68594\",\n \"score\": \"0.60158634\",\n \"text\": \"def value!\\n @promise.execute.value!\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b05976d949fb6b9be5c47935ce8ecacf\",\n \"score\": \"0.6003888\",\n \"text\": \"def with\\n synchronize do\\n wait_full\\n yield @value\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"27660c4d63f8482df7fa4d3ee2d22282\",\n \"score\": \"0.60009396\",\n \"text\": \"def wait_for_variable?; !completed? && actual_task.wait_for_variable?; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be06a2783e07402b8554253847d637f1\",\n \"score\": \"0.5991099\",\n \"text\": \"def get_value\\n @value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"89fc1cda7bb57fb7fc0f69649452e3ca\",\n \"score\": \"0.59799355\",\n \"text\": \"def has_value?\\n\\n return @has_value\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"50b0d4e2a5095cfeacabc1f854feeeb2\",\n \"score\": \"0.5979677\",\n \"text\": \"def value!(timeout = nil)\\n touch\\n internal_state.value if wait_until_complete! timeout\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"071ee05b6eb2808438a926bf2657764a\",\n \"score\": \"0.5979299\",\n \"text\": \"def cached_value(key)\\n monitor = value = nil\\n @lock.synchronize do\\n if @hard_references.has_key?(key)\\n return @hard_references[key]\\n elsif (value = @soft_references[key])\\n return value\\n elsif (monitor = @in_progress[key])\\n monitor.wait(@lock)\\n return self[key]\\n end\\n @in_progress[key] = monitor = ConditionVariable.new\\n end\\n begin\\n value = yield\\n value_set = true\\n ensure\\n @lock.synchronize do\\n self[key] = value if value_set\\n @in_progress.delete key\\n monitor.broadcast\\n end\\n end\\n value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8ba0ed6512dc85a92171022f00280f3e\",\n \"score\": \"0.5974913\",\n \"text\": \"def value_condition\\n value.present?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"07e4f61f96eb2d904f5db830770f6633\",\n \"score\": \"0.5961434\",\n \"text\": \"def get; @value end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53c2ad9940e9b601425333bd79c6d9ac\",\n \"score\": \"0.59606385\",\n \"text\": \"def value\\n @promise.value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"74a6aaf2fbd3568833b088542b8ef974\",\n \"score\": \"0.5960272\",\n \"text\": \"def value timeout = nil, timeout_value = nil\\n @future.value timeout, timeout_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d564826355ddc8101b07a9994c13b310\",\n \"score\": \"0.59508365\",\n \"text\": \"def value\\n if success?\\n result\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c75886ac4d6fadd7614c6a6828fffcd9\",\n \"score\": \"0.5946368\",\n \"text\": \"def wait_for_settings_update key, value = true\\n safety = 5\\n while !(@user.settings.try(:[], key) == value) && (safety > 0)\\n safety -= 1\\n sleep 0.5\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"392b07673c2f684201399d3df775303d\",\n \"score\": \"0.5946257\",\n \"text\": \"def get_value(testing = false)\\n self.is_enabled?(testing) ? self.value : nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"04759ff33ad7468763d5fbf40c30d477\",\n \"score\": \"0.59323364\",\n \"text\": \"def value?\\n @value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"481f984828d8b6ae4fa52c0c29f16ef6\",\n \"score\": \"0.5919876\",\n \"text\": \"def value\\n Concurrent::atomically do\\n Transaction::current.read(self)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"481f984828d8b6ae4fa52c0c29f16ef6\",\n \"score\": \"0.5919876\",\n \"text\": \"def value\\n Concurrent::atomically do\\n Transaction::current.read(self)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aea7da9acace39dac6edf107953c67a7\",\n \"score\": \"0.5919598\",\n \"text\": \"def has_value?()\\n #This is a stub, used for indexing\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eae22ac4dd7e3504738ed9961c18037c\",\n \"score\": \"0.59042615\",\n \"text\": \"def get_value\\n value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3699fc206a90d1b5a929950c1e64b51e\",\n \"score\": \"0.59010756\",\n \"text\": \"def value\\r\\n assert_exists\\r\\n attribute_value('value')\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eec84661afb4266c45bc42a6b6b80564\",\n \"score\": \"0.5900476\",\n \"text\": \"def wait_until_condition(true_or_false, timeout = TIMEOUT)\\n max_time = Time.now + timeout\\n\\n while Time.now < max_time\\n begin\\n result = yield\\n return if result == true_or_false\\n puts \\\"Waiting for value to be #{true_or_false}. Saw '#{result}.'\\\"\\n rescue Selenium::WebDriver::Error::ElementNotVisibleError,\\n Selenium::WebDriver::Error::InvalidElementStateError,\\n Selenium::WebDriver::Error::NoSuchElementError,\\n Selenium::WebDriver::Error::StaleElementReferenceError => e\\n # Keep polling the dom for condition success\\n puts \\\"Swallowing error #{e.message}\\\"\\n end\\n sleep(POLL_INTERVAL)\\n end\\n\\n # Throw an exception\\n raise Error::WaitExpiredException, 'Wait expired waiting for element value condition.'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9651e9af7c50b823ddfec05c482cfcfd\",\n \"score\": \"0.5872437\",\n \"text\": \"def ready?\\n !!@value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f35d0c4307da86b4976414d129d55a85\",\n \"score\": \"0.5860971\",\n \"text\": \"def val\\n return @val\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d6f23d21acf267ef23d57ba3669ba99d\",\n \"score\": \"0.585832\",\n \"text\": \"def value(timeout = nil)\\n ready = result = nil\\n\\n begin\\n @mutex.lock\\n\\n if @ready\\n ready = true\\n result = @result\\n end\\n ensure\\n @mutex.unlock\\n end\\n\\n unless ready\\n if timeout\\n raise TimeoutError, \\\"Timeout not supported by Bones::RPC::Synchronous backend\\\"\\n end\\n end\\n\\n if result\\n result.value\\n else\\n raise TimeoutError, \\\"Timeout not supported by Bones::RPC::Synchronous backend\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c155a4d220f1eaf8946412f32df5400\",\n \"score\": \"0.58510035\",\n \"text\": \"def value?\\n !value.nil?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c155a4d220f1eaf8946412f32df5400\",\n \"score\": \"0.58510035\",\n \"text\": \"def value?\\n !value.nil?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"27de3249f6c7b124527ab8b70e613076\",\n \"score\": \"0.5850224\",\n \"text\": \"def get_wait_for_user_input\\n return @wait_for_user_input\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2d20dff564193b9018920ccf757fe40c\",\n \"score\": \"0.584863\",\n \"text\": \"def _value\\n @value || sensible_default()\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36e239230435d0335b2153ad18e4a770\",\n \"score\": \"0.5846571\",\n \"text\": \"def get\\n @value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bcb848a359494bbec2958e08e9b41eec\",\n \"score\": \"0.5846085\",\n \"text\": \"def value?\\n !value.nil?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d444ae92e9e954999ddbb1c0c5d36784\",\n \"score\": \"0.5835195\",\n \"text\": \"def then\\n yield value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9a167e8d18f7448e12e462d799d58284\",\n \"score\": \"0.58194536\",\n \"text\": \"def wait_until(timeout, &block)\\n begin\\n Timeout.timeout(timeout) do\\n sleep(0.1) until value = block.call\\n value\\n end\\n rescue TimeoutError\\n false\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ea6e95b2b9bb8634c6ea313ed7779aff\",\n \"score\": \"0.5817284\",\n \"text\": \"def get_value\\n send_request(FUNCTION_GET_VALUE, [], '', 2, 'S')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"82d406bf3f908d9d89e0d204d3399152\",\n \"score\": \"0.58156717\",\n \"text\": \"def present_value\\n # puts \\\"-------#{@id}----------------\\\"\\n pv = first(\\\"##{@id}\\\").value\\n pv = \\\"\\\" if pv.nil?\\n pv\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d46c4a3ae91eec4d7994e77c568b3c4c\",\n \"score\": \"0.58126366\",\n \"text\": \"def wait_until\\n require \\\"timeout\\\"\\n Timeout.timeout(Capybara.default_wait_time) do\\n sleep(0.1) until value = yield\\n value\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2349fa1f3d2194ef0c24324bf0d4a465\",\n \"score\": \"0.5812613\",\n \"text\": \"def wait_for_field_value(locator, expected_value, options={})\\n script = find_element_script(locator, \\n \\\"(element != null && element.value == '#{quote_escaped(expected_value)}')\\\")\\n wait_for_condition script, options[:timeout_in_seconds]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"11cd27a394b81b0b7aafa1a36c6119d1\",\n \"score\": \"0.5785922\",\n \"text\": \"def value(timeout = nil)\\n ready = result = nil\\n\\n begin\\n @mutex.lock\\n\\n if @ready\\n ready = true\\n result = @result\\n else\\n case @forwards\\n when Array\\n @forwards << Celluloid.mailbox\\n when NilClass\\n @forwards = Celluloid.mailbox\\n else\\n @forwards = [@forwards, Celluloid.mailbox]\\n end\\n end\\n ensure\\n @mutex.unlock\\n end\\n\\n unless ready\\n result = Celluloid.receive(timeout) do |msg|\\n msg.is_a?(Future::Result) && msg.future == self\\n end\\n end\\n\\n if result\\n result.respond_to?(:value) ? result.value : result\\n else\\n raise TimedOut, \\\"Timed out\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1852aef9fcf58d955a355f4d40711a76\",\n \"score\": \"0.5778219\",\n \"text\": \"def getValue()\\n return @value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"39993469c7d93dda81f0c6a66b57e335\",\n \"score\": \"0.5776783\",\n \"text\": \"def value\\n result = nil\\n return result if @code == nil\\n\\n starttime = Time.now.to_f\\n\\n begin\\n Timeout.timeout(limit) do\\n if @code.is_a?(Proc)\\n result = @code.call()\\n else\\n result = Facter::Util::Resolution.exec(@code)\\n end\\n end\\n rescue Timeout::Error => detail\\n warn \\\"Timed out seeking value for %s\\\" % self.name\\n\\n # This call avoids zombies -- basically, create a thread that will\\n # dezombify all of the child processes that we're ignoring because\\n # of the timeout.\\n Thread.new { Process.waitall }\\n return nil\\n rescue => details\\n warn \\\"Could not retrieve %s: %s\\\" % [self.name, details]\\n return nil\\n end\\n\\n finishtime = Time.now.to_f\\n ms = (finishtime - starttime) * 1000\\n Facter.show_time \\\"#{self.name}: #{\\\"%.2f\\\" % ms}ms\\\"\\n\\n return nil if result == \\\"\\\"\\n return result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"25ad7dc4d09b30f8885db786fd53b08d\",\n \"score\": \"0.577513\",\n \"text\": \"def populate_with\\n return @value if full?\\n\\n synchronize do\\n perform_put(yield) if empty?\\n end\\n\\n @value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"47f1f64c79b58317c6e286d0df7748d4\",\n \"score\": \"0.5772879\",\n \"text\": \"def wait_until(timeout = DEFAULT_WAIT_TIME)\\n\\tTimeout.timeout(timeout) do\\n\\t\\tsleep(0.1) until value = yield\\n\\t\\tvalue\\n\\tend\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ef68b3d2d7296848e4fcc3b3958c86aa\",\n \"score\": \"0.5772015\",\n \"text\": \"def value?\\n value.any?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4ec7bf5bd4bf41280ca807bb987af0c0\",\n \"score\": \"0.5763517\",\n \"text\": \"def value()\\n\\t\\t\\tif @type != :value\\n\\t\\t\\t\\treturn nil\\n\\t\\t\\tend\\n\\t\\t\\t\\n\\t\\t\\treturn @value\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fd4e64cbdd58bfa06f1cf5519710d59f\",\n \"score\": \"0.5759991\",\n \"text\": \"def get_value\\n wait\\n $browser.find_element(:xpath, @locator).text\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"471723207fc07ffeff8c23ad6c00b4d2\",\n \"score\": \"0.5733045\",\n \"text\": \"def get_value\\n send_request(FUNCTION_GET_VALUE, [], '', 1, 'C')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7335e16f7dec0b4a9ff034655f485f2b\",\n \"score\": \"0.57306266\",\n \"text\": \"def get_or_set(key)\\n value = get(key)\\n return value if value\\n value = yield\\n set(key, value)\\n value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2ab43b6d8db8c78a78cb7016f0607cb1\",\n \"score\": \"0.5729218\",\n \"text\": \"def value()\\n ( @candidates.size == 1 ) ? @candidates[0] : nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ff17851ef00e2f4809f7b4bfa00566fd\",\n \"score\": \"0.5728122\",\n \"text\": \"def wait_for_change(continue = nil)\\n @fd ||= File.open(value_file, \\\"r\\\")\\n @waiting = true\\n read\\n begin\\n ready = IO.select(nil, nil, [@fd], 1)\\n if ready\\n read\\n ready = nil if !changed? || value == 0 # val is a hack\\n end\\n end while @waiting && !ready && (!continue || continue.call)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4cc5244bba7b26169bf12ba011c85891\",\n \"score\": \"0.5721808\",\n \"text\": \"def val\\n @val\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6caf205aeec2f0f68413efb9f78fb66\",\n \"score\": \"0.5716253\",\n \"text\": \"def wait_for_field_value(locator, expected_value, timeout_in_seconds=nil)\\n\\t\\t script = \\\"var element;\\n\\t\\t try {\\n\\t\\t element = selenium.browserbot.findElement('#{locator}');\\n\\t\\t } catch(e) {\\n\\t\\t element = null;\\n\\t\\t }\\n\\t\\t element != null && element.value == '#{expected_value}'\\\"\\n\\n\\t\\t wait_for_condition script, timeout_in_seconds\\n\\t\\t end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5c47537385b97e3b9f3817595051a6f6\",\n \"score\": \"0.57109326\",\n \"text\": \"def until_loop\\n until @my_value > 5\\n puts @my_value\\n @my_value+=1\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cd927a067c903620291763a5c89bfbe9\",\n \"score\": \"0.5710578\",\n \"text\": \"def has_value?\\n !value.empty?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e3dabade23f076960f6917f24055c979\",\n \"score\": \"0.5710473\",\n \"text\": \"def get\\n STM.possibly_atomically do\\n STM.get_current_transaction.get_value(self)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fa040d2b6d8bb6419e09a0d394a9e310\",\n \"score\": \"0.5709485\",\n \"text\": \"def compute_value(options, &block)\\n rv = block.call(options)\\n rv = ::Elephas::Entry.ensure(rv, options[:complete_key], options) # Make sure is an entry\\n write(rv.hash, rv, options) if !rv.value.nil? && options[:ttl] > 0 # We have a value and we have to store it\\n rv\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d9b83e30a106f1b5d91837a02a4f89ba\",\n \"score\": \"0.5702436\",\n \"text\": \"def delivered?\\n\\t\\t@mutex.synchronize {\\n\\t\\t\\tinstance_variable_defined? :@value\\n\\t\\t}\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d9b83e30a106f1b5d91837a02a4f89ba\",\n \"score\": \"0.5702436\",\n \"text\": \"def delivered?\\n\\t\\t@mutex.synchronize {\\n\\t\\t\\tinstance_variable_defined? :@value\\n\\t\\t}\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"63d62f97b6cb6e45caab1c2c2455ddf5\",\n \"score\": \"0.5702238\",\n \"text\": \"def set_value\\n self.value = loop do\\n random_token = SecureRandom.hex(2)\\n break random_token unless self.class\\n .where(value: random_token)\\n .where('expires_at >= ?', Time.current)\\n .present?\\n end\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":180,"cells":{"query_id":{"kind":"string","value":"2745178e0a01a53897c6f6a553042155"},"query":{"kind":"string","value":"GET /privileges GET /privileges.json"},"positive_passages":{"kind":"list like","value":[{"docid":"e6a47dc88914e272462dbd041841372a","score":"0.7178544","text":"def index\n @privileges = Privilege.all\n end","title":""}],"string":"[\n {\n \"docid\": \"e6a47dc88914e272462dbd041841372a\",\n \"score\": \"0.7178544\",\n \"text\": \"def index\\n @privileges = Privilege.all\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"04dc9b08546d23c5d2eee94d0a819d91","score":"0.7383657","text":"def get_privileges(opts = {})\n data, _status_code, _headers = get_privileges_with_http_info(opts)\n data\n end","title":""},{"docid":"a92cf217319962777a8733046e5448b3","score":"0.72432595","text":"def get(privileges)\n children_to_get_representation(reachable(:get, privileges), privileges)\n end","title":""},{"docid":"70c0835092bc4973d4d62bdd9ac90f1c","score":"0.7191816","text":"def get_privileges_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UserApi.get_privileges ...'\n end\n # resource path\n local_var_path = '/api/3/privileges'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Privileges')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UserApi#get_privileges\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end","title":""},{"docid":"52aedde38b5249ae2fb2960faa9787c8","score":"0.7129432","text":"def privileges\n cache_lookup(PRIVILEGES) { format_privileges(get(:privileges)[\"privileges\"]) }\n end","title":""},{"docid":"8ed8659ad87d8c902997db3fbe4336c3","score":"0.66496474","text":"def index\n @roles_privileges = RolesPrivilege.all\n end","title":""},{"docid":"67ec0e1eb012039d9698012269b5297a","score":"0.66335535","text":"def index\n @role_privileges = RolePrivilege.all\n end","title":""},{"docid":"fba5badf8edee8955354294e690449c6","score":"0.65893173","text":"def value\n @privileges\n end","title":""},{"docid":"20eac7480b43038453d36c8d08fae5c5","score":"0.6323373","text":"def cmd_getprivs(*args)\n if args.include? \"-h\"\n cmd_getprivs_help\n end\n\n table = Rex::Text::Table.new(\n 'Header' => 'Enabled Process Privileges',\n 'Indent' => 0,\n 'SortIndex' => 1,\n 'Columns' => ['Name']\n )\n\n client.sys.config.getprivs.each do |priv|\n table << [priv]\n end\n\n print_line\n print_line(table.to_s)\n end","title":""},{"docid":"3f6048674dc7cddf22b58e237164d57c","score":"0.63000536","text":"def permitted_roles privilege\n result = JSON.parse url_for(:resources_permitted_roles, credentials, id, privilege).get\n if result.is_a?(Hash) && ( count = result['count'] )\n count\n else\n result\n end\n end","title":""},{"docid":"3bed842e8776cbc6ccb3a0ce8cdfbd94","score":"0.62432367","text":"def get_privilege_types\n response = nexus.get(nexus_url(\"service/local/privilege_types\"))\n case response.status\n when 200\n return response.content\n else\n raise UnexpectedStatusCodeException.new(response.status)\n end\n end","title":""},{"docid":"21446b4ed82ab0e5dd17ec04388e5c5b","score":"0.61721736","text":"def index\n @vip_privileges = VipPrivilege.all\n end","title":""},{"docid":"47b80b1eb1a8e44018dc1d80457674f1","score":"0.61626655","text":"def show\n respond_to do |format|\n format.json {\n render json: @person, :include => [:roles => { include: [:privileges] } ]\n }\n end\n end","title":""},{"docid":"d150e1a55e26f7e6f8a2cb0aa366ba1e","score":"0.6161708","text":"def index\n @people = Person.all\n respond_to do |format|\n format.json { \n render json: @people, :include => [:roles => { include: [:privileges] } ]\n }\n end\n end","title":""},{"docid":"d25579227990a3c425194f7db9807f3c","score":"0.61218256","text":"def index\n @user_has_viewing_privileges = UserHasViewingPrivilege.all\n end","title":""},{"docid":"af417acfd59c9772392251b52bb457b7","score":"0.6000796","text":"def get_user_privileges_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UserApi.get_user_privileges ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling UserApi.get_user_privileges\"\n end\n # resource path\n local_var_path = '/api/3/users/{id}/privileges'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Privileges')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UserApi#get_user_privileges\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end","title":""},{"docid":"1316347aa6c5bff1fbb74e64d07067a4","score":"0.5975647","text":"def privileges(user)\n\t\treturn TinyPrivileges.contract_child_object_privileges(user, contract)\n\tend","title":""},{"docid":"e0aa45bac436f0a976c223f8662ac241","score":"0.59745413","text":"def index\n authorize @user\n render :json => @user.tags\n end","title":""},{"docid":"0fe625a0d9bd948411eb5805b8781880","score":"0.5956814","text":"def index\n @users = User.all\n authorize @users\n\n render json: @users\n end","title":""},{"docid":"f1d029a83978380a8033792fc05d935b","score":"0.5925669","text":"def index\n users = policy_scope(User)\n render json: { users: users }\n end","title":""},{"docid":"f1466f741d689d4d4ddf60756a40bece","score":"0.5861553","text":"def show\n authorize @user\n render json: @user\n end","title":""},{"docid":"c0d8149ad9304e8e5151e54145d8154b","score":"0.58183986","text":"def get_current_privs\n query = @db_connection.query(\"SHOW GRANTS FOR current_user();\")\n query.each { |x| print_line(\"#{x[0]}\") }\n end","title":""},{"docid":"6b3d66e3dd385c6f3a3f8870da19d6de","score":"0.58112013","text":"def index\n authorize Role\n\n respond_to do |format|\n format.json { render json: @roles }\n end\n end","title":""},{"docid":"f1a1f03dea9d3731406db107233b1802","score":"0.5809198","text":"def privileges(user)\n\n\t\t# create a new privileges object with no rights\n\t\tp = TinyPrivileges.new\n\n\t\t# user must be specified\n\t\treturn p if user.nil?\n\n\t\t# an admin has full privileges\n\t\treturn p.grant_all if user.admin?\n\t\treturn p.grant_all if user == contract.facilitator\n\n\t\t##########################################\n\t\t# see if the user has an enrollment role on the contract here\n\t\tuser_role = contract.role_of(user)\n\n\t\t##########################################\n\t\t# USER IS NOT ENROLLED\n\t\t# if no role, then check for staff privileges\n\t\tif user_role.nil?\n\n\t\t\t# staff members can view and do notes\n\t\t\t# non-staff, non-enrolled user has no privileges\n\t\t\tp[:browse] = \n\t\t\tp[:view] = \n\t\t\tp[:create_note] = \n\t\t\tp[:view_students] = \n\t\t\tp[:view_note] = (user.privilege == User::PRIVILEGE_STAFF)\n\n\t\t\treturn p\n\t\tend\n\n\t\t##########################################\n\t\t# USER IS ENROLLED\n\t\t# FOR EDIT PRIVILEGES,\n\t\t# user must be instructor\n\t\tp[:edit] = (user_role >= Enrollment::ROLE_INSTRUCTOR)\n\t\t\n\t\t# FOR VIEW, NOTE PRIVILEGES,\n\t\t# user must be an instructor or a supervisor or the enrolled student\n\t\tp[:view] = \n\t\tp[:create_note] = \n\t\tp[:view_note] =\n\t\tp[:browse] = ((user_role >= Enrollment::ROLE_INSTRUCTOR) or\n\t\t\t\t\t\t\t\t\t(user.id == participant.id))\n\n\t\t# an instructor or supervisor can edit a note\n\t\tp[:view_students] = # bogus since an enrollment only deals with one student\n\t\tp[:edit_note] = user_role >= Enrollment::ROLE_INSTRUCTOR\n\t\treturn p\n\tend","title":""},{"docid":"3a8d29c8003ea7fa65960c12f5cb8767","score":"0.57900584","text":"def identities\n render json: current_user.identities\n end","title":""},{"docid":"985a4a7a3c0f0b3defe6b7d03e37a530","score":"0.576858","text":"def index\n @pledges = if current_admin?\n User.find(params[:user_id]).pledges\n else\n current_user.pledges\n end\n respond_to do |format|\n format.html\n format.json { render json: @pledges }\n end\n end","title":""},{"docid":"e6f0e6813f4156948525e3b04e445efb","score":"0.57389265","text":"def privileges(user=@session.user)\n eff_acl = effective_acl\n if eff_acl[user.id]\n return eff_acl[user.id].privileges\n end\n return eff_acl[Ecore::User.everybody.id].privileges if eff_acl[Ecore::User.everybody.id] and !user.id == Ecore::User.anybody.id\n return eff_acl[Ecore::User.anybody.id].privileges if eff_acl[Ecore::User.anybody.id]\n end","title":""},{"docid":"1c3cfab1155dd85bf6082c0e7a41bc24","score":"0.57147306","text":"def index\n respond_to do |format|\n if authorized?\n format.json { render json: User.all }\n else\n format.json { render json: unauthorized, status: :forbidden }\n end\n end\n end","title":""},{"docid":"d852b5dea70167d841bdf08b5925b1d4","score":"0.5714486","text":"def show\n @roles_and_permission = @roles.roles_and_permission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @roles_and_permission }\n end\n end","title":""},{"docid":"d2cb47eb88c76556e6ae16cac0b5778e","score":"0.56976956","text":"def index\n @organization_memberships = OrganizationMembership.where(user_id: params['user_id'])\n authorize @organization_memberships\n\n render json: @organization_memberships\n end","title":""},{"docid":"23645b4587b249f651f60ab8478edf73","score":"0.56656134","text":"def get_permission_menu\n @client.raw('get', '/helpers/menu')\n end","title":""},{"docid":"b2d19aab796bf826c5c4b854431c73a6","score":"0.5662785","text":"def index\n @priv_policies = PrivPolicy.all\n end","title":""},{"docid":"41422c8bc0a5a762cb9f8e28c01a7959","score":"0.56518847","text":"def privileges\n users.reduce([]) do |memo, user|\n operations.reject(&:prohibition?).each do |operation|\n objects.each do |object|\n if is_privilege?(user, operation, object)\n memo << [user, operation, object]\n end\n end\n end\n memo\n end\n end","title":""},{"docid":"2610988440247592e48828166a5b18f2","score":"0.5640658","text":"def list\n #\n @menu_items = []\n # Loop through\n MenuItem.where('nested_under_id is NULL').order('ordinal').each do |item|\n if item.roles.count > 0\n item.roles.each do |role|\n @menu_items << item if current_user.isinrole(role.id)\n end\n else\n @menu_items << item\n end\n end\n # Hand out the member items\n render status: 200, json: @menu_items.as_json(include: { nested_items: { } })\n end","title":""},{"docid":"6adf88b0cc7f9612f8ea51467256ef81","score":"0.56273","text":"def privilege_sets\n transform_users { |_, entry| PrivilegeSet.new(entry.fetch(:privileges)) }\n end","title":""},{"docid":"a19aa1746ca3ee1e66222e054c011fab","score":"0.56075156","text":"def abilities\n get('/ability/')\n end","title":""},{"docid":"1fd201e1567f87228946a6db31416315","score":"0.56015337","text":"def index\n\t\tauthorize! :index, TipoPrivilegio\n @tipo_privilegios = TipoPrivilegio.all\n end","title":""},{"docid":"fa5ce65c5e107b82993cabd0826502f0","score":"0.55986995","text":"def index\n @user_groups = UserGroup.accessible_by(current_ability)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_groups }\n end\n end","title":""},{"docid":"9b444f4c1886d1909a64943a203b28fe","score":"0.5589525","text":"def get_permission_menu\n return @client.raw(\"get\", \"/helpers/menu\")\n end","title":""},{"docid":"eff869704ecb2ac7a5fbe31437919f2e","score":"0.5564224","text":"def list_permission_levels\n pls = []\n PermissionLevel.order(\"value DESC\").each{|pl| \n if pl.value <= @user.permission_level.value\n pls << pl\n end\n }\n render :json => pls\n end","title":""},{"docid":"7e464ee903564044d07b9fe0f88029bd","score":"0.5539853","text":"def flatten_privileges(privileges, context = nil, flattened_privileges = Set.new)\n # TODO: caching?\n raise AuthorizationUsageError, 'No context given or inferable from object' unless context\n privileges.reject { |priv| flattened_privileges.include?(priv) }.each do |priv|\n flattened_privileges << priv\n flatten_privileges(rev_priv_hierarchy[[priv, nil]], context, flattened_privileges) if rev_priv_hierarchy[[priv, nil]]\n flatten_privileges(rev_priv_hierarchy[[priv, context]], context, flattened_privileges) if rev_priv_hierarchy[[priv, context]]\n end\n flattened_privileges.to_a\n end","title":""},{"docid":"2446bef4e81d4d9094353b67f605490b","score":"0.55378383","text":"def index # ☑️ will get all users\n if current_user.admin == true \n render json: User.all\n else \n render json: {message: \"Authorized access denied. Admin status: #{current_user.admin}\"} \n end\n end","title":""},{"docid":"22e7cb958ce11ea1a6a7034529a0b594","score":"0.552055","text":"def index\n \t@users = User.accessible_by(current_ability)\n \tauthorize! :read, User\n end","title":""},{"docid":"1dc615dd75e4603c7bb50fa14f12c1d1","score":"0.55114585","text":"def user_holds opts= {}\n path, opts = build_user_path(\"holds\", opts)\n JSON.parse(get path, opts)\n end","title":""},{"docid":"64b5e7c51701211ab994135eabc5c1c9","score":"0.55007607","text":"def list_privileges(verbose = false, no_admin = false)\n ps = privileges.map(&:titleize)\n ps = ps.reject { |v| v == 'admin' } if no_admin\n if privileges.empty?\n 'None'\n elsif verbose\n ps.to_sentence\n else\n ps.join(', ')\n end\n end","title":""},{"docid":"b453d315f2553ada5691b839f9ff35a5","score":"0.5494826","text":"def show\n\t\t@all_permissions = Lockdown::System.permissions_assignable_for_user(current_user)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_group }\n end\n end","title":""},{"docid":"9ad01615dc3a1f19d83e3a8b7839b60b","score":"0.54945195","text":"def index_users\n authorize Group, :index?\n render :json => @group.users\n end","title":""},{"docid":"8a29471646191d84def95f7af1e081bf","score":"0.5494249","text":"def users(args = {})\n get(\"/users.json\",args)\n end","title":""},{"docid":"10794392a30817d418477c0e23b23cae","score":"0.5478657","text":"def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend","title":""},{"docid":"10794392a30817d418477c0e23b23cae","score":"0.5478657","text":"def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend","title":""},{"docid":"436a504b5909fbe0520a965db99ea332","score":"0.5473863","text":"def serialize_priv(writer, privilege)\n writer.start_element('{DAV:}supported-privilege')\n\n writer.start_element('{DAV:}privilege')\n writer.write_element(privilege['privilege'])\n writer.end_element; # privilege\n\n writer.write_element('{DAV:}abstract') unless privilege['abstract'].blank?\n\n writer.write_element('{DAV:}description', privilege['description']) unless privilege['description'].blank?\n\n if privilege.key?('aggregates')\n privilege['aggregates'].each do |sub_privilege|\n serialize_priv(writer, sub_privilege)\n end\n end\n\n writer.end_element; # supported-privilege\n end","title":""},{"docid":"930dcd1f771bcef6c3ea4646a0a909d9","score":"0.5465825","text":"def show\n if can?(:read, User)\n @user = User.find(params[:id])\n @roles = \"\"\n\n @user.roles.each do |role|\n if @roles == \"\"\n @roles += role.name\n else\n @roles += \", \" + role.name\n end\n end\n end\n\n respond_to do |format|\n format.json { render :json => @user }\n format.xml { render :xml => @user }\n format.html \n end\n\n rescue ActiveRecord::RecordNotFound\n respond_to_not_found(:json, :xml, :html)\n end","title":""},{"docid":"cd96fe0a28e8c8f338f5f0cdfaa9a405","score":"0.54598933","text":"def index\n if can?(:read, User)\n @users = User.accessible_by(current_ability, :index)\n else\n @users = []\n end\n respond_to do |format|\n format.json { render :json => @users }\n format.xml { render :xml => @users }\n format.html\n end\n end","title":""},{"docid":"bfb8ca3dec31c4f8aa60d044cae46c7f","score":"0.5459257","text":"def destroy\n @privilege.destroy\n respond_to do |format|\n format.html { redirect_to privileges_url }\n format.json { head :no_content }\n end\n end","title":""},{"docid":"3931fec71381a01bfa09c031341f213e","score":"0.5452526","text":"def index\n @privilieges_features = PriviliegesFeature.all\n end","title":""},{"docid":"64bdb93bbdd386dc05cdbe809e70e507","score":"0.54502946","text":"def index\n authorize Group\n render :json => @group.group_memberships\n end","title":""},{"docid":"5f1c6eb02bfb747ac12fb687d4b65d4e","score":"0.54487115","text":"def index\n\t\tunless User.healthy? params[:user_id]\n \t \trender json: { error: \"Denied access. User is contaminated!\" }, status: 403 and return\n \tend\n\n\t\tinventory = Inventory.where(user_id: params[:user_id])\n\t\trender json: inventory, status: 200 \n\tend","title":""},{"docid":"3e3b217d0f6c1cbdb04276aa8df3b790","score":"0.5435171","text":"def index\n @menus = @user.menus.all\n render json: @menus\n end","title":""},{"docid":"a0357fa131cc6e10cc1095854e77efaa","score":"0.54342276","text":"def listings\n authorize! :read, @user\n end","title":""},{"docid":"40e241d5dfafd0524bdb7ceb33577e1d","score":"0.541803","text":"def get_user_roles\n @roles = @user.roles.pluck(:name)\n render json: @roles\n end","title":""},{"docid":"96334ce10e051739cfd2f9d5c02cd030","score":"0.5415075","text":"def show\n @role_permision = RolePermision.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role_permision }\n end\n end","title":""},{"docid":"0218708cc7e6dd227a5115cf1ca7554c","score":"0.541236","text":"def index_container_privileges(container_id, opts = {})\n data, _status_code, _headers = index_container_privileges_with_http_info(container_id, opts)\n data\n end","title":""},{"docid":"0c10421a954f1477946a34f080190cce","score":"0.54123217","text":"def show \n user = User.find_by(id: session[:user_id])\n if user\n render json: user\n else \n render {error: \"Not authorized\"}, status: :unauthorized\n end\n end","title":""},{"docid":"2ab04d4441a4ba1d036ea42c3b5e6a12","score":"0.54114115","text":"def index\n if params[:scope] == \"students\"\n @users = User.students.page(params[:page]).order(sort_column + \" \" + sort_direction)\n authorize! :list, :students\n elsif params[:scope] == \"advisors\"\n @users = User.advisors.page(params[:page]).order(sort_column + \" \" + sort_direction)\n authorize! :list, :advisors\n elsif params[:scope] == \"professors\"\n @users = User.professors.page(params[:page]).order(sort_column + \" \" + sort_direction)\n authorize! :list, :professors\n elsif params[:scope] == \"gods\"\n @users = User.gods.page(params[:page]).order(sort_column + \" \" + sort_direction)\n authorize! :list, :gods\n else\n @users = User.accessible_by(current_ability, :index).order(sort_column + \" \" + sort_direction).page(params[:page])\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @users }\n end\n end","title":""},{"docid":"be8045b6bb06b4ab515dd5b5e2a61833","score":"0.540116","text":"def show\n @user = User.find(params[:id])\n @isAdmin = current_user.admin_rights\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end","title":""},{"docid":"0da2025a47b9ef74e6ec7776734c2d04","score":"0.53882945","text":"def index\n @pagy, @gists = pagy(@user.gists.accessible_by(current_ability))\n end","title":""},{"docid":"cf116ded1bf3de15e6250335bc65a44b","score":"0.5384874","text":"def index\n @analise_privacidades = AnalisePrivacidade.all\n end","title":""},{"docid":"c2a0089a383b4520b1045cc7e966894c","score":"0.5372323","text":"def admin_grant_permissions\n user = User.find(params[:id])\n authorize user\n\n # Super admin can grant any Perm, org admins can only grant Perms they\n # themselves have access to\n perms = if current_user.can_super_admin?\n Perm.all\n else\n current_user.perms\n end\n\n render json: {\n 'user' => {\n 'id' => user.id,\n 'html' => render_to_string(partial: 'users/admin_grant_permissions',\n locals: { user: user, perms: perms },\n formats: [:html])\n }\n }.to_json\n end","title":""},{"docid":"a7db394a9ea958a0259a3b4563c639d8","score":"0.53532815","text":"def get_privilege(id, opts = {})\n data, _status_code, _headers = get_privilege_with_http_info(id, opts)\n data\n end","title":""},{"docid":"ccd4ebd6e4941576d401a6a2efa57b9d","score":"0.5352803","text":"def show\n @level = Level.find(params[:id])\n authorize! :show, @level, :message => 'Acceso denegado.'\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level }\n end\n end","title":""},{"docid":"0980eb41d6038fabf8078259dbe231c8","score":"0.5348271","text":"def create\n\t\t \t@created_priviliges = []\n\t\t \t@privileges_create = true\n\t\t\tparams[:privilege][:modular_id] && params[:privilege][:modular_id].each do |privilege_modular_id|\n\t\t\t\t@privilege = Privilege.where('role_id =? AND modular_id =?', params[:privilege][:role_id], privilege_modular_id).first\n\t\t\t\tif @privilege.nil?\n\t\t\t\t\t@privilege = Privilege.new(privilege_params)\n\t\t\t\t\t@privilege.modular_id = privilege_modular_id\n\t\t\t\t\t@privilege.save\n\t\t\t\t\t@created_priviliges << @privilege\n\t\t else\n\t\t \t@privileges_create = false\n\t\t\t\tend\n\t\t\tend\n\t\t\trespond_to :js\n\t\tend","title":""},{"docid":"a30070db22c0a4632dc52126a293227d","score":"0.5347015","text":"def show\n \tauthorize! :read, @user\n end","title":""},{"docid":"335b170d3ce5d9ecbfce9dc3051a426e","score":"0.5340704","text":"def show\n authorize @accounts\n render json: @account\n end","title":""},{"docid":"ba4bc30fd2542d1a9dd4c469b9e4eaa1","score":"0.5340273","text":"def show\n authorize! :read, @admin_system_admin\n end","title":""},{"docid":"d1bd2d15ce909cef202fdeb37c04b531","score":"0.53346986","text":"def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end","title":""},{"docid":"dd9eaed8ec93bb861b6913c552bc26c5","score":"0.53338546","text":"def index_container_privileges_with_http_info(container_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ContainersApi.index_container_privileges ...'\n end\n # verify the required parameter 'container_id' is set\n if @api_client.config.client_side_validation && container_id.nil?\n fail ArgumentError, \"Missing the required parameter 'container_id' when calling ContainersApi.index_container_privileges\"\n end\n # resource path\n local_var_path = '/containers/{container_id}/container_privileges'.sub('{' + 'container_id' + '}', CGI.escape(container_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'privilege'] = opts[:'privilege'] if !opts[:'privilege'].nil?\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'ContainerPrivilegeCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ContainersApi#index_container_privileges\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end","title":""},{"docid":"867a565b5e19bfc9e3bcad7f6bbd576f","score":"0.532919","text":"def index\n #before_action :authenticate_user\n #if current_user.admin?\n @users = User.all\n render json: @users, status: :ok\n #else\n # render json: [], status: :unauthorized\n #end\n end","title":""},{"docid":"f52205fb5b4124edbdcf7e79d2928fcb","score":"0.53281546","text":"def select\n @users ||= User.role_wise_users(params[:user][:role])\n authorize! :read, @user\n end","title":""},{"docid":"c58a38f6414ed6fe18c63ea53cbf9c4e","score":"0.53172594","text":"def index\n @distributions = current_user.distributions\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @distributions }\n end\n end","title":""},{"docid":"1a2cd1f19e17237f9dd23ce961b1c612","score":"0.5315578","text":"def grant(privileges) # rubocop:disable Metrics/AbcSize\n self.authorized_actions = privileges.map { |auth_tier, actions| [auth_tier.to_s, [actions].flatten.map(&:to_sym)] }.to_h\n\n tier_names = authorization_persona.authorization_tier_names\n extra_keys = authorized_actions.keys - authorization_persona.authorization_tier_names\n if extra_keys.present?\n raise AuthorizedPersona::Error, \"invalid grant: #{authorization_persona_class_name} \" \\\n \"has authorization tiers #{tier_names.join(', ')} but received extra keys: #{extra_keys.join(', ')}\"\n end\n end","title":""},{"docid":"f30a32f99cd8f11d7e106a6f4316aa45","score":"0.53120065","text":"def get_members\n @user = User.find_by(user_params)\n @members = @user.members\n \n if not @members.nil?\n render json: @members\n else \n render json: \"\"\n end\n end","title":""},{"docid":"af92e47fc0fb3c2075407a9046e01df2","score":"0.5305895","text":"def index\n @role_permisions = RolePermision.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @role_permisions }\n end\n end","title":""},{"docid":"90cab8c052da50f223dedde6146036d2","score":"0.53058577","text":"def get(context)\n res = context.transport.get_request(context, 'security/users')\n\n context.err(res.body) unless res.success?\n\n Puppet::Util::Json.load(res.body).map do |user|\n keys_to_snake_case(user.merge({ 'ensure' => 'present' }))\n end\n end","title":""},{"docid":"2a1609b9b826b22b0c8d91544246f341","score":"0.5300953","text":"def show\n\t\tauthorize! :index, TipoPrivilegio\n end","title":""},{"docid":"423b7b65b176628ce329123665f4c7eb","score":"0.5290213","text":"def index\n @groups = current_user.groups\n render json: @groups\n end","title":""},{"docid":"6c8818821a72f082bb1fcdf3ff9b8521","score":"0.528821","text":"def show\n authorize @organization_membership\n render json: @organization_membership\n end","title":""},{"docid":"de5db4d8cafe09c27c966f845660b31d","score":"0.5286161","text":"def list_authorized?\n authorized_for?(:crud_type => :read)\n end","title":""},{"docid":"de5db4d8cafe09c27c966f845660b31d","score":"0.5286161","text":"def list_authorized?\n authorized_for?(:crud_type => :read)\n end","title":""},{"docid":"d00efd9a69ef53c9457788239bdff69f","score":"0.5274769","text":"def show\n authorize @institute\n @admins = User.where(role:3,institute_id: @institute.id)\n @students = User.where(role:1,institute_id: @institute.id)\n end","title":""},{"docid":"215817133b1526811e133d137a1d1d06","score":"0.52708846","text":"def index\n @iams = $iam.groups.map{ |x| Iam.new(name: x.name) } \n @users = $iam.users\n @roles = $iam.client.list_roles \n end","title":""},{"docid":"c5d2446bd5b1a1ccdd2a56ac99f2e64f","score":"0.5267211","text":"def show\n authorize! :show, @level\n end","title":""},{"docid":"9996ecbe360db387517ee315b2e72dbc","score":"0.5265352","text":"def index\n if authorise(request)\n auth_token = request.headers['Authorization1'].split(' ').last\n req = GetRoomsRequest.new(auth_token)\n serv = RoomServices.new\n resp = serv.get_rooms(req)\n render json: { status: resp.success, message: resp.message, data: resp.data }, status: :ok\n else\n render json: { status: false, message: 'Unauthorized' }, status: 401\n end\n end","title":""},{"docid":"5a1059351fa064e5e8710d081e66f550","score":"0.5256898","text":"def show\n @certification_users = []\n\n #TODO: make a better SQL query for this\n @certification.users.sort_by(&:name).each do |user|\n @certification_users.push user if can? :read, user\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @certification }\n end\n end","title":""},{"docid":"eaa155a263f7be6ce76c262bec471859","score":"0.52524394","text":"def get_data_for_manage\n\t\t\tgroup = SystemGroup.find(params[:id])\n\n\t\t\trender json: {\n\t\t\t\tstatus: 0,\n\t\t\t\tresult: {\n\t\t\t\t\tusers: render_to_string(partial: 'user_items', locals: { users: group.users }),\n\t\t\t\t\tpermissions: group.permission_ids\n\t\t\t\t}\n\t\t\t}\n\t\tend","title":""},{"docid":"e0ba9d01a617f9920e29f793614c5c99","score":"0.5252333","text":"def show\n authorize @user\n end","title":""},{"docid":"e0ba9d01a617f9920e29f793614c5c99","score":"0.5252333","text":"def show\n authorize @user\n end","title":""},{"docid":"cf8229434f7815b884e3fdd315d812c8","score":"0.5249864","text":"def index\n lists = policy_scope(List).includes(:admin).page(page).per(per)\n authorize lists\n json_response(PageDecorator.decorate(lists).as_json(admin: true), :ok)\n end","title":""},{"docid":"191f23cf793caabb9165f96901a1856a","score":"0.5248227","text":"def index\n authorize! :creat, Administrator\n hospital = Hospital.findn(params[:hospital_id])\n @administrators = hospital.administrators\n end","title":""},{"docid":"3fe69f88d3e7c7effe8adb6f760e4f73","score":"0.52474636","text":"def index\n @accounts = policy_scope(Account)\n\n render json: @accounts, include: [:user]\n end","title":""},{"docid":"46107e3c37c87055007669cf488519dd","score":"0.5238947","text":"def index\n # byebug\n if current_user\n recipes = Recipe.all \n render json: recipes\n else \n render json: { errors: [\"Not Authorized\"] }, status: :unauthorized\n end\n end","title":""},{"docid":"c1f934bf82df2c0d033cb68ac4e2b591","score":"0.5238926","text":"def index\n # @users = User.all\n # authorize @users \n @users = policy_scope(User)\n authorize @users\n end","title":""}],"string":"[\n {\n \"docid\": \"04dc9b08546d23c5d2eee94d0a819d91\",\n \"score\": \"0.7383657\",\n \"text\": \"def get_privileges(opts = {})\\n data, _status_code, _headers = get_privileges_with_http_info(opts)\\n data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a92cf217319962777a8733046e5448b3\",\n \"score\": \"0.72432595\",\n \"text\": \"def get(privileges)\\n children_to_get_representation(reachable(:get, privileges), privileges)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"70c0835092bc4973d4d62bdd9ac90f1c\",\n \"score\": \"0.7191816\",\n \"text\": \"def get_privileges_with_http_info(opts = {})\\n if @api_client.config.debugging\\n @api_client.config.logger.debug 'Calling API: UserApi.get_privileges ...'\\n end\\n # resource path\\n local_var_path = '/api/3/privileges'\\n\\n # query parameters\\n query_params = {}\\n\\n # header parameters\\n header_params = {}\\n # HTTP header 'Accept' (if needed)\\n header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])\\n # HTTP header 'Content-Type'\\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\\n\\n # form parameters\\n form_params = {}\\n\\n # http body (model)\\n post_body = nil\\n auth_names = []\\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\\n :header_params => header_params,\\n :query_params => query_params,\\n :form_params => form_params,\\n :body => post_body,\\n :auth_names => auth_names,\\n :return_type => 'Privileges')\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"API called: UserApi#get_privileges\\\\nData: #{data.inspect}\\\\nStatus code: #{status_code}\\\\nHeaders: #{headers}\\\"\\n end\\n return data, status_code, headers\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"52aedde38b5249ae2fb2960faa9787c8\",\n \"score\": \"0.7129432\",\n \"text\": \"def privileges\\n cache_lookup(PRIVILEGES) { format_privileges(get(:privileges)[\\\"privileges\\\"]) }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8ed8659ad87d8c902997db3fbe4336c3\",\n \"score\": \"0.66496474\",\n \"text\": \"def index\\n @roles_privileges = RolesPrivilege.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"67ec0e1eb012039d9698012269b5297a\",\n \"score\": \"0.66335535\",\n \"text\": \"def index\\n @role_privileges = RolePrivilege.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fba5badf8edee8955354294e690449c6\",\n \"score\": \"0.65893173\",\n \"text\": \"def value\\n @privileges\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"20eac7480b43038453d36c8d08fae5c5\",\n \"score\": \"0.6323373\",\n \"text\": \"def cmd_getprivs(*args)\\n if args.include? \\\"-h\\\"\\n cmd_getprivs_help\\n end\\n\\n table = Rex::Text::Table.new(\\n 'Header' => 'Enabled Process Privileges',\\n 'Indent' => 0,\\n 'SortIndex' => 1,\\n 'Columns' => ['Name']\\n )\\n\\n client.sys.config.getprivs.each do |priv|\\n table << [priv]\\n end\\n\\n print_line\\n print_line(table.to_s)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3f6048674dc7cddf22b58e237164d57c\",\n \"score\": \"0.63000536\",\n \"text\": \"def permitted_roles privilege\\n result = JSON.parse url_for(:resources_permitted_roles, credentials, id, privilege).get\\n if result.is_a?(Hash) && ( count = result['count'] )\\n count\\n else\\n result\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3bed842e8776cbc6ccb3a0ce8cdfbd94\",\n \"score\": \"0.62432367\",\n \"text\": \"def get_privilege_types\\n response = nexus.get(nexus_url(\\\"service/local/privilege_types\\\"))\\n case response.status\\n when 200\\n return response.content\\n else\\n raise UnexpectedStatusCodeException.new(response.status)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"21446b4ed82ab0e5dd17ec04388e5c5b\",\n \"score\": \"0.61721736\",\n \"text\": \"def index\\n @vip_privileges = VipPrivilege.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"47b80b1eb1a8e44018dc1d80457674f1\",\n \"score\": \"0.61626655\",\n \"text\": \"def show\\n respond_to do |format|\\n format.json {\\n render json: @person, :include => [:roles => { include: [:privileges] } ]\\n }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d150e1a55e26f7e6f8a2cb0aa366ba1e\",\n \"score\": \"0.6161708\",\n \"text\": \"def index\\n @people = Person.all\\n respond_to do |format|\\n format.json { \\n render json: @people, :include => [:roles => { include: [:privileges] } ]\\n }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d25579227990a3c425194f7db9807f3c\",\n \"score\": \"0.61218256\",\n \"text\": \"def index\\n @user_has_viewing_privileges = UserHasViewingPrivilege.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"af417acfd59c9772392251b52bb457b7\",\n \"score\": \"0.6000796\",\n \"text\": \"def get_user_privileges_with_http_info(id, opts = {})\\n if @api_client.config.debugging\\n @api_client.config.logger.debug 'Calling API: UserApi.get_user_privileges ...'\\n end\\n # verify the required parameter 'id' is set\\n if @api_client.config.client_side_validation && id.nil?\\n fail ArgumentError, \\\"Missing the required parameter 'id' when calling UserApi.get_user_privileges\\\"\\n end\\n # resource path\\n local_var_path = '/api/3/users/{id}/privileges'.sub('{' + 'id' + '}', id.to_s)\\n\\n # query parameters\\n query_params = {}\\n\\n # header parameters\\n header_params = {}\\n # HTTP header 'Accept' (if needed)\\n header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])\\n # HTTP header 'Content-Type'\\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\\n\\n # form parameters\\n form_params = {}\\n\\n # http body (model)\\n post_body = nil\\n auth_names = []\\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\\n :header_params => header_params,\\n :query_params => query_params,\\n :form_params => form_params,\\n :body => post_body,\\n :auth_names => auth_names,\\n :return_type => 'Privileges')\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"API called: UserApi#get_user_privileges\\\\nData: #{data.inspect}\\\\nStatus code: #{status_code}\\\\nHeaders: #{headers}\\\"\\n end\\n return data, status_code, headers\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1316347aa6c5bff1fbb74e64d07067a4\",\n \"score\": \"0.5975647\",\n \"text\": \"def privileges(user)\\n\\t\\treturn TinyPrivileges.contract_child_object_privileges(user, contract)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e0aa45bac436f0a976c223f8662ac241\",\n \"score\": \"0.59745413\",\n \"text\": \"def index\\n authorize @user\\n render :json => @user.tags\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0fe625a0d9bd948411eb5805b8781880\",\n \"score\": \"0.5956814\",\n \"text\": \"def index\\n @users = User.all\\n authorize @users\\n\\n render json: @users\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1d029a83978380a8033792fc05d935b\",\n \"score\": \"0.5925669\",\n \"text\": \"def index\\n users = policy_scope(User)\\n render json: { users: users }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1466f741d689d4d4ddf60756a40bece\",\n \"score\": \"0.5861553\",\n \"text\": \"def show\\n authorize @user\\n render json: @user\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c0d8149ad9304e8e5151e54145d8154b\",\n \"score\": \"0.58183986\",\n \"text\": \"def get_current_privs\\n query = @db_connection.query(\\\"SHOW GRANTS FOR current_user();\\\")\\n query.each { |x| print_line(\\\"#{x[0]}\\\") }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6b3d66e3dd385c6f3a3f8870da19d6de\",\n \"score\": \"0.58112013\",\n \"text\": \"def index\\n authorize Role\\n\\n respond_to do |format|\\n format.json { render json: @roles }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1a1f03dea9d3731406db107233b1802\",\n \"score\": \"0.5809198\",\n \"text\": \"def privileges(user)\\n\\n\\t\\t# create a new privileges object with no rights\\n\\t\\tp = TinyPrivileges.new\\n\\n\\t\\t# user must be specified\\n\\t\\treturn p if user.nil?\\n\\n\\t\\t# an admin has full privileges\\n\\t\\treturn p.grant_all if user.admin?\\n\\t\\treturn p.grant_all if user == contract.facilitator\\n\\n\\t\\t##########################################\\n\\t\\t# see if the user has an enrollment role on the contract here\\n\\t\\tuser_role = contract.role_of(user)\\n\\n\\t\\t##########################################\\n\\t\\t# USER IS NOT ENROLLED\\n\\t\\t# if no role, then check for staff privileges\\n\\t\\tif user_role.nil?\\n\\n\\t\\t\\t# staff members can view and do notes\\n\\t\\t\\t# non-staff, non-enrolled user has no privileges\\n\\t\\t\\tp[:browse] = \\n\\t\\t\\tp[:view] = \\n\\t\\t\\tp[:create_note] = \\n\\t\\t\\tp[:view_students] = \\n\\t\\t\\tp[:view_note] = (user.privilege == User::PRIVILEGE_STAFF)\\n\\n\\t\\t\\treturn p\\n\\t\\tend\\n\\n\\t\\t##########################################\\n\\t\\t# USER IS ENROLLED\\n\\t\\t# FOR EDIT PRIVILEGES,\\n\\t\\t# user must be instructor\\n\\t\\tp[:edit] = (user_role >= Enrollment::ROLE_INSTRUCTOR)\\n\\t\\t\\n\\t\\t# FOR VIEW, NOTE PRIVILEGES,\\n\\t\\t# user must be an instructor or a supervisor or the enrolled student\\n\\t\\tp[:view] = \\n\\t\\tp[:create_note] = \\n\\t\\tp[:view_note] =\\n\\t\\tp[:browse] = ((user_role >= Enrollment::ROLE_INSTRUCTOR) or\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t(user.id == participant.id))\\n\\n\\t\\t# an instructor or supervisor can edit a note\\n\\t\\tp[:view_students] = # bogus since an enrollment only deals with one student\\n\\t\\tp[:edit_note] = user_role >= Enrollment::ROLE_INSTRUCTOR\\n\\t\\treturn p\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3a8d29c8003ea7fa65960c12f5cb8767\",\n \"score\": \"0.57900584\",\n \"text\": \"def identities\\n render json: current_user.identities\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"985a4a7a3c0f0b3defe6b7d03e37a530\",\n \"score\": \"0.576858\",\n \"text\": \"def index\\n @pledges = if current_admin?\\n User.find(params[:user_id]).pledges\\n else\\n current_user.pledges\\n end\\n respond_to do |format|\\n format.html\\n format.json { render json: @pledges }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6f0e6813f4156948525e3b04e445efb\",\n \"score\": \"0.57389265\",\n \"text\": \"def privileges(user=@session.user)\\n eff_acl = effective_acl\\n if eff_acl[user.id]\\n return eff_acl[user.id].privileges\\n end\\n return eff_acl[Ecore::User.everybody.id].privileges if eff_acl[Ecore::User.everybody.id] and !user.id == Ecore::User.anybody.id\\n return eff_acl[Ecore::User.anybody.id].privileges if eff_acl[Ecore::User.anybody.id]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1c3cfab1155dd85bf6082c0e7a41bc24\",\n \"score\": \"0.57147306\",\n \"text\": \"def index\\n respond_to do |format|\\n if authorized?\\n format.json { render json: User.all }\\n else\\n format.json { render json: unauthorized, status: :forbidden }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d852b5dea70167d841bdf08b5925b1d4\",\n \"score\": \"0.5714486\",\n \"text\": \"def show\\n @roles_and_permission = @roles.roles_and_permission.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @roles_and_permission }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d2cb47eb88c76556e6ae16cac0b5778e\",\n \"score\": \"0.56976956\",\n \"text\": \"def index\\n @organization_memberships = OrganizationMembership.where(user_id: params['user_id'])\\n authorize @organization_memberships\\n\\n render json: @organization_memberships\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"23645b4587b249f651f60ab8478edf73\",\n \"score\": \"0.56656134\",\n \"text\": \"def get_permission_menu\\n @client.raw('get', '/helpers/menu')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b2d19aab796bf826c5c4b854431c73a6\",\n \"score\": \"0.5662785\",\n \"text\": \"def index\\n @priv_policies = PrivPolicy.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"41422c8bc0a5a762cb9f8e28c01a7959\",\n \"score\": \"0.56518847\",\n \"text\": \"def privileges\\n users.reduce([]) do |memo, user|\\n operations.reject(&:prohibition?).each do |operation|\\n objects.each do |object|\\n if is_privilege?(user, operation, object)\\n memo << [user, operation, object]\\n end\\n end\\n end\\n memo\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2610988440247592e48828166a5b18f2\",\n \"score\": \"0.5640658\",\n \"text\": \"def list\\n #\\n @menu_items = []\\n # Loop through\\n MenuItem.where('nested_under_id is NULL').order('ordinal').each do |item|\\n if item.roles.count > 0\\n item.roles.each do |role|\\n @menu_items << item if current_user.isinrole(role.id)\\n end\\n else\\n @menu_items << item\\n end\\n end\\n # Hand out the member items\\n render status: 200, json: @menu_items.as_json(include: { nested_items: { } })\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6adf88b0cc7f9612f8ea51467256ef81\",\n \"score\": \"0.56273\",\n \"text\": \"def privilege_sets\\n transform_users { |_, entry| PrivilegeSet.new(entry.fetch(:privileges)) }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a19aa1746ca3ee1e66222e054c011fab\",\n \"score\": \"0.56075156\",\n \"text\": \"def abilities\\n get('/ability/')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1fd201e1567f87228946a6db31416315\",\n \"score\": \"0.56015337\",\n \"text\": \"def index\\n\\t\\tauthorize! :index, TipoPrivilegio\\n @tipo_privilegios = TipoPrivilegio.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fa5ce65c5e107b82993cabd0826502f0\",\n \"score\": \"0.55986995\",\n \"text\": \"def index\\n @user_groups = UserGroup.accessible_by(current_ability)\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @user_groups }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9b444f4c1886d1909a64943a203b28fe\",\n \"score\": \"0.5589525\",\n \"text\": \"def get_permission_menu\\n return @client.raw(\\\"get\\\", \\\"/helpers/menu\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eff869704ecb2ac7a5fbe31437919f2e\",\n \"score\": \"0.5564224\",\n \"text\": \"def list_permission_levels\\n pls = []\\n PermissionLevel.order(\\\"value DESC\\\").each{|pl| \\n if pl.value <= @user.permission_level.value\\n pls << pl\\n end\\n }\\n render :json => pls\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7e464ee903564044d07b9fe0f88029bd\",\n \"score\": \"0.5539853\",\n \"text\": \"def flatten_privileges(privileges, context = nil, flattened_privileges = Set.new)\\n # TODO: caching?\\n raise AuthorizationUsageError, 'No context given or inferable from object' unless context\\n privileges.reject { |priv| flattened_privileges.include?(priv) }.each do |priv|\\n flattened_privileges << priv\\n flatten_privileges(rev_priv_hierarchy[[priv, nil]], context, flattened_privileges) if rev_priv_hierarchy[[priv, nil]]\\n flatten_privileges(rev_priv_hierarchy[[priv, context]], context, flattened_privileges) if rev_priv_hierarchy[[priv, context]]\\n end\\n flattened_privileges.to_a\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2446bef4e81d4d9094353b67f605490b\",\n \"score\": \"0.55378383\",\n \"text\": \"def index # ☑️ will get all users\\n if current_user.admin == true \\n render json: User.all\\n else \\n render json: {message: \\\"Authorized access denied. Admin status: #{current_user.admin}\\\"} \\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"22e7cb958ce11ea1a6a7034529a0b594\",\n \"score\": \"0.552055\",\n \"text\": \"def index\\n \\t@users = User.accessible_by(current_ability)\\n \\tauthorize! :read, User\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1dc615dd75e4603c7bb50fa14f12c1d1\",\n \"score\": \"0.55114585\",\n \"text\": \"def user_holds opts= {}\\n path, opts = build_user_path(\\\"holds\\\", opts)\\n JSON.parse(get path, opts)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"64b5e7c51701211ab994135eabc5c1c9\",\n \"score\": \"0.55007607\",\n \"text\": \"def list_privileges(verbose = false, no_admin = false)\\n ps = privileges.map(&:titleize)\\n ps = ps.reject { |v| v == 'admin' } if no_admin\\n if privileges.empty?\\n 'None'\\n elsif verbose\\n ps.to_sentence\\n else\\n ps.join(', ')\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b453d315f2553ada5691b839f9ff35a5\",\n \"score\": \"0.5494826\",\n \"text\": \"def show\\n\\t\\t@all_permissions = Lockdown::System.permissions_assignable_for_user(current_user)\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @user_group }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9ad01615dc3a1f19d83e3a8b7839b60b\",\n \"score\": \"0.54945195\",\n \"text\": \"def index_users\\n authorize Group, :index?\\n render :json => @group.users\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8a29471646191d84def95f7af1e081bf\",\n \"score\": \"0.5494249\",\n \"text\": \"def users(args = {})\\n get(\\\"/users.json\\\",args)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"10794392a30817d418477c0e23b23cae\",\n \"score\": \"0.5478657\",\n \"text\": \"def list_users_for_all_tenants(args = {}) \\n get(\\\"/users.json/global\\\", args)\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"10794392a30817d418477c0e23b23cae\",\n \"score\": \"0.5478657\",\n \"text\": \"def list_users_for_all_tenants(args = {}) \\n get(\\\"/users.json/global\\\", args)\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"436a504b5909fbe0520a965db99ea332\",\n \"score\": \"0.5473863\",\n \"text\": \"def serialize_priv(writer, privilege)\\n writer.start_element('{DAV:}supported-privilege')\\n\\n writer.start_element('{DAV:}privilege')\\n writer.write_element(privilege['privilege'])\\n writer.end_element; # privilege\\n\\n writer.write_element('{DAV:}abstract') unless privilege['abstract'].blank?\\n\\n writer.write_element('{DAV:}description', privilege['description']) unless privilege['description'].blank?\\n\\n if privilege.key?('aggregates')\\n privilege['aggregates'].each do |sub_privilege|\\n serialize_priv(writer, sub_privilege)\\n end\\n end\\n\\n writer.end_element; # supported-privilege\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"930dcd1f771bcef6c3ea4646a0a909d9\",\n \"score\": \"0.5465825\",\n \"text\": \"def show\\n if can?(:read, User)\\n @user = User.find(params[:id])\\n @roles = \\\"\\\"\\n\\n @user.roles.each do |role|\\n if @roles == \\\"\\\"\\n @roles += role.name\\n else\\n @roles += \\\", \\\" + role.name\\n end\\n end\\n end\\n\\n respond_to do |format|\\n format.json { render :json => @user }\\n format.xml { render :xml => @user }\\n format.html \\n end\\n\\n rescue ActiveRecord::RecordNotFound\\n respond_to_not_found(:json, :xml, :html)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cd96fe0a28e8c8f338f5f0cdfaa9a405\",\n \"score\": \"0.54598933\",\n \"text\": \"def index\\n if can?(:read, User)\\n @users = User.accessible_by(current_ability, :index)\\n else\\n @users = []\\n end\\n respond_to do |format|\\n format.json { render :json => @users }\\n format.xml { render :xml => @users }\\n format.html\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bfb8ca3dec31c4f8aa60d044cae46c7f\",\n \"score\": \"0.5459257\",\n \"text\": \"def destroy\\n @privilege.destroy\\n respond_to do |format|\\n format.html { redirect_to privileges_url }\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3931fec71381a01bfa09c031341f213e\",\n \"score\": \"0.5452526\",\n \"text\": \"def index\\n @privilieges_features = PriviliegesFeature.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"64bdb93bbdd386dc05cdbe809e70e507\",\n \"score\": \"0.54502946\",\n \"text\": \"def index\\n authorize Group\\n render :json => @group.group_memberships\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5f1c6eb02bfb747ac12fb687d4b65d4e\",\n \"score\": \"0.54487115\",\n \"text\": \"def index\\n\\t\\tunless User.healthy? params[:user_id]\\n \\t \\trender json: { error: \\\"Denied access. User is contaminated!\\\" }, status: 403 and return\\n \\tend\\n\\n\\t\\tinventory = Inventory.where(user_id: params[:user_id])\\n\\t\\trender json: inventory, status: 200 \\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3e3b217d0f6c1cbdb04276aa8df3b790\",\n \"score\": \"0.5435171\",\n \"text\": \"def index\\n @menus = @user.menus.all\\n render json: @menus\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a0357fa131cc6e10cc1095854e77efaa\",\n \"score\": \"0.54342276\",\n \"text\": \"def listings\\n authorize! :read, @user\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"40e241d5dfafd0524bdb7ceb33577e1d\",\n \"score\": \"0.541803\",\n \"text\": \"def get_user_roles\\n @roles = @user.roles.pluck(:name)\\n render json: @roles\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"96334ce10e051739cfd2f9d5c02cd030\",\n \"score\": \"0.5415075\",\n \"text\": \"def show\\n @role_permision = RolePermision.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @role_permision }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0218708cc7e6dd227a5115cf1ca7554c\",\n \"score\": \"0.541236\",\n \"text\": \"def index_container_privileges(container_id, opts = {})\\n data, _status_code, _headers = index_container_privileges_with_http_info(container_id, opts)\\n data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0c10421a954f1477946a34f080190cce\",\n \"score\": \"0.54123217\",\n \"text\": \"def show \\n user = User.find_by(id: session[:user_id])\\n if user\\n render json: user\\n else \\n render {error: \\\"Not authorized\\\"}, status: :unauthorized\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2ab04d4441a4ba1d036ea42c3b5e6a12\",\n \"score\": \"0.54114115\",\n \"text\": \"def index\\n if params[:scope] == \\\"students\\\"\\n @users = User.students.page(params[:page]).order(sort_column + \\\" \\\" + sort_direction)\\n authorize! :list, :students\\n elsif params[:scope] == \\\"advisors\\\"\\n @users = User.advisors.page(params[:page]).order(sort_column + \\\" \\\" + sort_direction)\\n authorize! :list, :advisors\\n elsif params[:scope] == \\\"professors\\\"\\n @users = User.professors.page(params[:page]).order(sort_column + \\\" \\\" + sort_direction)\\n authorize! :list, :professors\\n elsif params[:scope] == \\\"gods\\\"\\n @users = User.gods.page(params[:page]).order(sort_column + \\\" \\\" + sort_direction)\\n authorize! :list, :gods\\n else\\n @users = User.accessible_by(current_ability, :index).order(sort_column + \\\" \\\" + sort_direction).page(params[:page])\\n end\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render :json => @users }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be8045b6bb06b4ab515dd5b5e2a61833\",\n \"score\": \"0.540116\",\n \"text\": \"def show\\n @user = User.find(params[:id])\\n @isAdmin = current_user.admin_rights\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @user }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0da2025a47b9ef74e6ec7776734c2d04\",\n \"score\": \"0.53882945\",\n \"text\": \"def index\\n @pagy, @gists = pagy(@user.gists.accessible_by(current_ability))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cf116ded1bf3de15e6250335bc65a44b\",\n \"score\": \"0.5384874\",\n \"text\": \"def index\\n @analise_privacidades = AnalisePrivacidade.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c2a0089a383b4520b1045cc7e966894c\",\n \"score\": \"0.5372323\",\n \"text\": \"def admin_grant_permissions\\n user = User.find(params[:id])\\n authorize user\\n\\n # Super admin can grant any Perm, org admins can only grant Perms they\\n # themselves have access to\\n perms = if current_user.can_super_admin?\\n Perm.all\\n else\\n current_user.perms\\n end\\n\\n render json: {\\n 'user' => {\\n 'id' => user.id,\\n 'html' => render_to_string(partial: 'users/admin_grant_permissions',\\n locals: { user: user, perms: perms },\\n formats: [:html])\\n }\\n }.to_json\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a7db394a9ea958a0259a3b4563c639d8\",\n \"score\": \"0.53532815\",\n \"text\": \"def get_privilege(id, opts = {})\\n data, _status_code, _headers = get_privilege_with_http_info(id, opts)\\n data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ccd4ebd6e4941576d401a6a2efa57b9d\",\n \"score\": \"0.5352803\",\n \"text\": \"def show\\n @level = Level.find(params[:id])\\n authorize! :show, @level, :message => 'Acceso denegado.'\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @level }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0980eb41d6038fabf8078259dbe231c8\",\n \"score\": \"0.5348271\",\n \"text\": \"def create\\n\\t\\t \\t@created_priviliges = []\\n\\t\\t \\t@privileges_create = true\\n\\t\\t\\tparams[:privilege][:modular_id] && params[:privilege][:modular_id].each do |privilege_modular_id|\\n\\t\\t\\t\\t@privilege = Privilege.where('role_id =? AND modular_id =?', params[:privilege][:role_id], privilege_modular_id).first\\n\\t\\t\\t\\tif @privilege.nil?\\n\\t\\t\\t\\t\\t@privilege = Privilege.new(privilege_params)\\n\\t\\t\\t\\t\\t@privilege.modular_id = privilege_modular_id\\n\\t\\t\\t\\t\\t@privilege.save\\n\\t\\t\\t\\t\\t@created_priviliges << @privilege\\n\\t\\t else\\n\\t\\t \\t@privileges_create = false\\n\\t\\t\\t\\tend\\n\\t\\t\\tend\\n\\t\\t\\trespond_to :js\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a30070db22c0a4632dc52126a293227d\",\n \"score\": \"0.5347015\",\n \"text\": \"def show\\n \\tauthorize! :read, @user\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"335b170d3ce5d9ecbfce9dc3051a426e\",\n \"score\": \"0.5340704\",\n \"text\": \"def show\\n authorize @accounts\\n render json: @account\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ba4bc30fd2542d1a9dd4c469b9e4eaa1\",\n \"score\": \"0.5340273\",\n \"text\": \"def show\\n authorize! :read, @admin_system_admin\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d1bd2d15ce909cef202fdeb37c04b531\",\n \"score\": \"0.53346986\",\n \"text\": \"def index\\n @categories = Category.all\\n @categories.each do |category|\\n authorize! :read, category\\n end\\n render json: @categories\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dd9eaed8ec93bb861b6913c552bc26c5\",\n \"score\": \"0.53338546\",\n \"text\": \"def index_container_privileges_with_http_info(container_id, opts = {})\\n if @api_client.config.debugging\\n @api_client.config.logger.debug 'Calling API: ContainersApi.index_container_privileges ...'\\n end\\n # verify the required parameter 'container_id' is set\\n if @api_client.config.client_side_validation && container_id.nil?\\n fail ArgumentError, \\\"Missing the required parameter 'container_id' when calling ContainersApi.index_container_privileges\\\"\\n end\\n # resource path\\n local_var_path = '/containers/{container_id}/container_privileges'.sub('{' + 'container_id' + '}', CGI.escape(container_id.to_s))\\n\\n # query parameters\\n query_params = opts[:query_params] || {}\\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\\n query_params[:'privilege'] = opts[:'privilege'] if !opts[:'privilege'].nil?\\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\\n\\n # header parameters\\n header_params = opts[:header_params] || {}\\n # HTTP header 'Accept' (if needed)\\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\\n\\n # form parameters\\n form_params = opts[:form_params] || {}\\n\\n # http body (model)\\n post_body = opts[:body] \\n\\n # return_type\\n return_type = opts[:return_type] || 'ContainerPrivilegeCollection' \\n\\n # auth_names\\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\\n\\n new_options = opts.merge(\\n :header_params => header_params,\\n :query_params => query_params,\\n :form_params => form_params,\\n :body => post_body,\\n :auth_names => auth_names,\\n :return_type => return_type\\n )\\n\\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"API called: ContainersApi#index_container_privileges\\\\nData: #{data.inspect}\\\\nStatus code: #{status_code}\\\\nHeaders: #{headers}\\\"\\n end\\n return data, status_code, headers\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"867a565b5e19bfc9e3bcad7f6bbd576f\",\n \"score\": \"0.532919\",\n \"text\": \"def index\\n #before_action :authenticate_user\\n #if current_user.admin?\\n @users = User.all\\n render json: @users, status: :ok\\n #else\\n # render json: [], status: :unauthorized\\n #end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f52205fb5b4124edbdcf7e79d2928fcb\",\n \"score\": \"0.53281546\",\n \"text\": \"def select\\n @users ||= User.role_wise_users(params[:user][:role])\\n authorize! :read, @user\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c58a38f6414ed6fe18c63ea53cbf9c4e\",\n \"score\": \"0.53172594\",\n \"text\": \"def index\\n @distributions = current_user.distributions\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @distributions }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1a2cd1f19e17237f9dd23ce961b1c612\",\n \"score\": \"0.5315578\",\n \"text\": \"def grant(privileges) # rubocop:disable Metrics/AbcSize\\n self.authorized_actions = privileges.map { |auth_tier, actions| [auth_tier.to_s, [actions].flatten.map(&:to_sym)] }.to_h\\n\\n tier_names = authorization_persona.authorization_tier_names\\n extra_keys = authorized_actions.keys - authorization_persona.authorization_tier_names\\n if extra_keys.present?\\n raise AuthorizedPersona::Error, \\\"invalid grant: #{authorization_persona_class_name} \\\" \\\\\\n \\\"has authorization tiers #{tier_names.join(', ')} but received extra keys: #{extra_keys.join(', ')}\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f30a32f99cd8f11d7e106a6f4316aa45\",\n \"score\": \"0.53120065\",\n \"text\": \"def get_members\\n @user = User.find_by(user_params)\\n @members = @user.members\\n \\n if not @members.nil?\\n render json: @members\\n else \\n render json: \\\"\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"af92e47fc0fb3c2075407a9046e01df2\",\n \"score\": \"0.5305895\",\n \"text\": \"def index\\n @role_permisions = RolePermision.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @role_permisions }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"90cab8c052da50f223dedde6146036d2\",\n \"score\": \"0.53058577\",\n \"text\": \"def get(context)\\n res = context.transport.get_request(context, 'security/users')\\n\\n context.err(res.body) unless res.success?\\n\\n Puppet::Util::Json.load(res.body).map do |user|\\n keys_to_snake_case(user.merge({ 'ensure' => 'present' }))\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2a1609b9b826b22b0c8d91544246f341\",\n \"score\": \"0.5300953\",\n \"text\": \"def show\\n\\t\\tauthorize! :index, TipoPrivilegio\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"423b7b65b176628ce329123665f4c7eb\",\n \"score\": \"0.5290213\",\n \"text\": \"def index\\n @groups = current_user.groups\\n render json: @groups\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6c8818821a72f082bb1fcdf3ff9b8521\",\n \"score\": \"0.528821\",\n \"text\": \"def show\\n authorize @organization_membership\\n render json: @organization_membership\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"de5db4d8cafe09c27c966f845660b31d\",\n \"score\": \"0.5286161\",\n \"text\": \"def list_authorized?\\n authorized_for?(:crud_type => :read)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"de5db4d8cafe09c27c966f845660b31d\",\n \"score\": \"0.5286161\",\n \"text\": \"def list_authorized?\\n authorized_for?(:crud_type => :read)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d00efd9a69ef53c9457788239bdff69f\",\n \"score\": \"0.5274769\",\n \"text\": \"def show\\n authorize @institute\\n @admins = User.where(role:3,institute_id: @institute.id)\\n @students = User.where(role:1,institute_id: @institute.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"215817133b1526811e133d137a1d1d06\",\n \"score\": \"0.52708846\",\n \"text\": \"def index\\n @iams = $iam.groups.map{ |x| Iam.new(name: x.name) } \\n @users = $iam.users\\n @roles = $iam.client.list_roles \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c5d2446bd5b1a1ccdd2a56ac99f2e64f\",\n \"score\": \"0.5267211\",\n \"text\": \"def show\\n authorize! :show, @level\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9996ecbe360db387517ee315b2e72dbc\",\n \"score\": \"0.5265352\",\n \"text\": \"def index\\n if authorise(request)\\n auth_token = request.headers['Authorization1'].split(' ').last\\n req = GetRoomsRequest.new(auth_token)\\n serv = RoomServices.new\\n resp = serv.get_rooms(req)\\n render json: { status: resp.success, message: resp.message, data: resp.data }, status: :ok\\n else\\n render json: { status: false, message: 'Unauthorized' }, status: 401\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5a1059351fa064e5e8710d081e66f550\",\n \"score\": \"0.5256898\",\n \"text\": \"def show\\n @certification_users = []\\n\\n #TODO: make a better SQL query for this\\n @certification.users.sort_by(&:name).each do |user|\\n @certification_users.push user if can? :read, user\\n end\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render :json => @certification }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eaa155a263f7be6ce76c262bec471859\",\n \"score\": \"0.52524394\",\n \"text\": \"def get_data_for_manage\\n\\t\\t\\tgroup = SystemGroup.find(params[:id])\\n\\n\\t\\t\\trender json: {\\n\\t\\t\\t\\tstatus: 0,\\n\\t\\t\\t\\tresult: {\\n\\t\\t\\t\\t\\tusers: render_to_string(partial: 'user_items', locals: { users: group.users }),\\n\\t\\t\\t\\t\\tpermissions: group.permission_ids\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e0ba9d01a617f9920e29f793614c5c99\",\n \"score\": \"0.5252333\",\n \"text\": \"def show\\n authorize @user\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e0ba9d01a617f9920e29f793614c5c99\",\n \"score\": \"0.5252333\",\n \"text\": \"def show\\n authorize @user\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cf8229434f7815b884e3fdd315d812c8\",\n \"score\": \"0.5249864\",\n \"text\": \"def index\\n lists = policy_scope(List).includes(:admin).page(page).per(per)\\n authorize lists\\n json_response(PageDecorator.decorate(lists).as_json(admin: true), :ok)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"191f23cf793caabb9165f96901a1856a\",\n \"score\": \"0.5248227\",\n \"text\": \"def index\\n authorize! :creat, Administrator\\n hospital = Hospital.findn(params[:hospital_id])\\n @administrators = hospital.administrators\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3fe69f88d3e7c7effe8adb6f760e4f73\",\n \"score\": \"0.52474636\",\n \"text\": \"def index\\n @accounts = policy_scope(Account)\\n\\n render json: @accounts, include: [:user]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"46107e3c37c87055007669cf488519dd\",\n \"score\": \"0.5238947\",\n \"text\": \"def index\\n # byebug\\n if current_user\\n recipes = Recipe.all \\n render json: recipes\\n else \\n render json: { errors: [\\\"Not Authorized\\\"] }, status: :unauthorized\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c1f934bf82df2c0d033cb68ac4e2b591\",\n \"score\": \"0.5238926\",\n \"text\": \"def index\\n # @users = User.all\\n # authorize @users \\n @users = policy_scope(User)\\n authorize @users\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":181,"cells":{"query_id":{"kind":"string","value":"14af6cc9b86f7a803e95702249b1b124"},"query":{"kind":"string","value":"This function identifies all AppleNote potential objects in ZICNOTEDATA and calls +rip_note+ on each."},"positive_passages":{"kind":"list like","value":[{"docid":"0af919d0b4a462535647ee7be32c6d0d","score":"0.6568238","text":"def rip_notes()\n range_start_core = (@range_start - 978307200)\n range_end_core = (@range_end - 978307200)\n @logger.debug(\"Rip Notes: Ripping notes between #{Time.at(range_start)} and #{Time.at(range_end)}\")\n if @version >= IOS_VERSION_9\n tmp_query = \"SELECT ZICNOTEDATA.ZNOTE \" + \n \"FROM ZICNOTEDATA, ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICNOTEDATA.ZDATA NOT NULL AND ZICCLOUDSYNCINGOBJECT.Z_PK=ZICNOTEDATA.ZNOTE AND \" + \n \"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1 >= ? AND \" + \n \"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1 <= ?\"\n @database.execute(tmp_query, range_start_core, range_end_core) do |row|\n self.rip_note(row[\"ZNOTE\"])\n end\n end\n\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZNOTE.Z_PK FROM ZNOTE\") do |row|\n self.rip_note(row[\"Z_PK\"])\n end\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"0af919d0b4a462535647ee7be32c6d0d\",\n \"score\": \"0.6568238\",\n \"text\": \"def rip_notes()\\n range_start_core = (@range_start - 978307200)\\n range_end_core = (@range_end - 978307200)\\n @logger.debug(\\\"Rip Notes: Ripping notes between #{Time.at(range_start)} and #{Time.at(range_end)}\\\")\\n if @version >= IOS_VERSION_9\\n tmp_query = \\\"SELECT ZICNOTEDATA.ZNOTE \\\" + \\n \\\"FROM ZICNOTEDATA, ZICCLOUDSYNCINGOBJECT \\\" + \\n \\\"WHERE ZICNOTEDATA.ZDATA NOT NULL AND ZICCLOUDSYNCINGOBJECT.Z_PK=ZICNOTEDATA.ZNOTE AND \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1 >= ? AND \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1 <= ?\\\"\\n @database.execute(tmp_query, range_start_core, range_end_core) do |row|\\n self.rip_note(row[\\\"ZNOTE\\\"])\\n end\\n end\\n\\n if @version == IOS_LEGACY_VERSION\\n @database.execute(\\\"SELECT ZNOTE.Z_PK FROM ZNOTE\\\") do |row|\\n self.rip_note(row[\\\"Z_PK\\\"])\\n end\\n end\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"a05d7da0cf14ccc6b2597d155f2f5101","score":"0.6947404","text":"def rip_notes()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICNOTEDATA.ZNOTE FROM ZICNOTEDATA\") do |row|\n self.rip_note(row[\"ZNOTE\"])\n end\n end\n\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZNOTE.Z_PK FROM ZNOTE\") do |row|\n self.rip_note(row[\"Z_PK\"])\n end\n end\n end","title":""},{"docid":"d597749aa685fcbf27d3037b9cd97e42","score":"0.6656046","text":"def rip_all_objects\n rip_accounts()\n rip_folders()\n rip_notes()\n puts \"Updated AppleNoteStore object with #{@notes.length} AppleNotes in #{@folders.length} folders belonging to #{@accounts.length} accounts.\"\n end","title":""},{"docid":"d597749aa685fcbf27d3037b9cd97e42","score":"0.6656046","text":"def rip_all_objects\n rip_accounts()\n rip_folders()\n rip_notes()\n puts \"Updated AppleNoteStore object with #{@notes.length} AppleNotes in #{@folders.length} folders belonging to #{@accounts.length} accounts.\"\n end","title":""},{"docid":"7500f431afb1f2cffcfb06c71176a202","score":"0.6416593","text":"def rip_note(note_id)\n\n @logger.debug(\"Rip Note: Ripping note from Note ID #{note_id}\")\n\n # Set the ZSERVERRECORD column to look at\n server_record_column = \"ZSERVERRECORD\"\n server_record_column = server_record_column + \"DATA\" if @version >= IOS_VERSION_12 # In iOS 11 this was ZSERVERRECORD, in 12 and later it became ZSERVERRECORDDATA\n\n # Set the ZSERVERSHARE column to look at\n server_share_column = \"ZSERVERSHARE\"\n server_share_column = server_share_column + \"DATA\" if @version >= IOS_VERSION_12 # In iOS 11 this was ZSERVERRECORD, in 12 and later it became ZSERVERRECORDDATA\n\n folder_field = \"ZFOLDER\"\n account_field = \"ZACCOUNT7\"\n note_id_field = \"ZNOTE\"\n creation_date_field = \"ZCREATIONDATE1\"\n \n # In version 15, what is now in ZACCOUNT7 as of iOS 16 (the account ID) was in ZACCOUNT4\n if @version == IOS_VERSION_15\n account_field = \"ZACCOUNT4\"\n end\n\n # In version 13 and 14, what is now in ZACCOUNT4 as of iOS 15 (the account ID) was in ZACCOUNT3\n if @version < IOS_VERSION_15\n account_field = \"ZACCOUNT3\"\n end\n\n # In iOS 15 it appears ZCREATIONDATE1 moved to ZCREATIONDATE3 for notes\n if @version > IOS_VERSION_14\n creation_date_field = \"ZCREATIONDATE3\"\n end\n\n query_string = \"SELECT ZICNOTEDATA.Z_PK, ZICNOTEDATA.ZNOTE, \" + \n \"ZICNOTEDATA.ZCRYPTOINITIALIZATIONVECTOR, ZICNOTEDATA.ZCRYPTOTAG, \" + \n \"ZICNOTEDATA.ZDATA, ZICCLOUDSYNCINGOBJECT.ZCRYPTOVERIFIER, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZCRYPTOSALT, ZICCLOUDSYNCINGOBJECT.ZCRYPTOITERATIONCOUNT, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZCRYPTOWRAPPEDKEY, ZICCLOUDSYNCINGOBJECT.ZISPASSWORDPROTECTED, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1, ZICCLOUDSYNCINGOBJECT.#{creation_date_field}, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZTITLE1, ZICCLOUDSYNCINGOBJECT.#{account_field}, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZACCOUNT2, ZICCLOUDSYNCINGOBJECT.#{folder_field}, \" + \n \"ZICCLOUDSYNCINGOBJECT.#{server_record_column}, ZICCLOUDSYNCINGOBJECT.ZUNAPPLIEDENCRYPTEDRECORD, \" + \n \"ZICCLOUDSYNCINGOBJECT.#{server_share_column}, ZICCLOUDSYNCINGOBJECT.ZISPINNED, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZIDENTIFIER \" + \n \"FROM ZICNOTEDATA, ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICNOTEDATA.ZNOTE=? AND ZICCLOUDSYNCINGOBJECT.Z_PK=ZICNOTEDATA.ZNOTE\"\n\n # In version 12, what is now in ZACCOUNT3 (the account ID) was in ZACCOUNT2\n if @version == IOS_VERSION_12\n account_field = \"ZACCOUNT2\"\n end\n\n # In version 11, what is now in ZACCOUNT3 was in ZACCOUNT2 and the ZFOLDER field was in a completely separate table\n if @version == IOS_VERSION_11\n query_string = \"SELECT ZICNOTEDATA.Z_PK, ZICNOTEDATA.ZNOTE, \" + \n \"ZICNOTEDATA.ZCRYPTOINITIALIZATIONVECTOR, ZICNOTEDATA.ZCRYPTOTAG, \" + \n \"ZICNOTEDATA.ZDATA, ZICCLOUDSYNCINGOBJECT.ZCRYPTOVERIFIER, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZCRYPTOSALT, ZICCLOUDSYNCINGOBJECT.ZCRYPTOITERATIONCOUNT, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZCRYPTOWRAPPEDKEY, ZICCLOUDSYNCINGOBJECT.ZISPASSWORDPROTECTED, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1, ZICCLOUDSYNCINGOBJECT.ZCREATIONDATE1, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZTITLE1, ZICCLOUDSYNCINGOBJECT.ZACCOUNT2, \" +\n \"Z_11NOTES.Z_11FOLDERS, ZICCLOUDSYNCINGOBJECT.#{server_record_column}, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZUNAPPLIEDENCRYPTEDRECORD, ZICCLOUDSYNCINGOBJECT.#{server_share_column}, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZISPINNED, ZICCLOUDSYNCINGOBJECT.ZIDENTIFIER \" + \n \"FROM ZICNOTEDATA, ZICCLOUDSYNCINGOBJECT, Z_11NOTES \" + \n \"WHERE ZICNOTEDATA.ZNOTE=? AND ZICCLOUDSYNCINGOBJECT.Z_PK=ZICNOTEDATA.ZNOTE AND Z_11NOTES.Z_8NOTES=ZICNOTEDATA.ZNOTE\"\n folder_field = \"Z_11FOLDERS\"\n account_field = \"ZACCOUNT2\"\n end\n\n # In the legecy version, everything is different\n if @version == IOS_LEGACY_VERSION\n query_string = \"SELECT ZNOTE.Z_PK, ZNOTE.ZCREATIONDATE as ZCREATIONDATE1, \" + \n \"ZNOTE.ZMODIFICATIONDATE as ZMODIFICATIONDATE1, ZNOTE.ZTITLE as ZTITLE1, \" + \n \"ZNOTEBODY.ZCONTENT as ZDATA, ZSTORE.Z_PK as ZFOLDER, ZSTORE.ZACCOUNT, \" +\n \"0 as ZISPINNED \" +\n \"FROM ZNOTE, ZNOTEBODY, ZSTORE \" +\n \"WHERE ZNOTE.Z_PK=? AND ZNOTEBODY.Z_PK=ZNOTE.ZBODY AND ZSTORE.Z_PK=ZNOTE.ZSTORE\"\n folder_field = \"ZFOLDER\"\n account_field = \"ZACCOUNT\"\n note_id_field = \"Z_PK\"\n end\n \n # Uncomment these lines if we ever think there is weirdness with using the wrong fields for the right version \n #@logger.debug(\"Rip Note: Query string is #{query_string}\") \n #@logger.debug(\"Rip Note: account field is #{account_field}\")\n #@logger.debug(\"Rip Note: folder field is #{folder_field}\")\n #@logger.debug(\"Rip Note: Note ID is #{note_id}\")\n\n # Execute the query\n @database.execute(query_string, note_id) do |row|\n # Create our note\n tmp_account_id = row[account_field]\n tmp_folder_id = row[folder_field]\n @logger.debug(\"Rip Note: Looking up account for #{tmp_account_id}\")\n @logger.debug(\"Rip Note: Looking up folder for #{tmp_folder_id}\")\n tmp_account = get_account(tmp_account_id)\n tmp_folder = get_folder(tmp_folder_id)\n @logger.error(\"Rip Note: Somehow could not find account!\") if !tmp_account\n @logger.error(\"Rip Note: Somehow could not find folder!\") if !tmp_folder\n tmp_note = AppleNote.new(row[\"Z_PK\"], \n row[note_id_field],\n row[\"ZTITLE1\"], \n row[\"ZDATA\"], \n row[creation_date_field], \n row[\"ZMODIFICATIONDATE1\"],\n tmp_account,\n tmp_folder,\n self)\n\n # Set the pinned status\n if row[\"ZISPINNED\"] == 1\n tmp_note.is_pinned = true\n end\n\n # Set the UUID, if it exists\n if row[\"ZIDENTIFIER\"]\n tmp_note.uuid = row[\"ZIDENTIFIER\"]\n end\n\n tmp_account.add_note(tmp_note) if tmp_account\n tmp_folder.add_note(tmp_note) if tmp_folder\n\n # Add server-side data, if relevant\n tmp_note.add_cloudkit_server_record_data(row[server_record_column]) if row[server_record_column]\n\n if(row[server_share_column]) \n tmp_note.add_cloudkit_sharing_data(row[server_share_column])\n\n # Add any share participants to our overall list\n tmp_note.share_participants.each do |participant|\n @cloud_kit_participants[participant.record_id] = participant\n end\n end\n\n # If this is protected, add the cryptographic variables\n if row[\"ZISPASSWORDPROTECTED\"] == 1\n\n # Set values initially from the expected columns\n crypto_iv = row[\"ZCRYPTOINITIALIZATIONVECTOR\"]\n crypto_tag = row[\"ZCRYPTOTAG\"]\n crypto_salt = row[\"ZCRYPTOSALT\"]\n crypto_iterations = row[\"ZCRYPTOITERATIONCOUNT\"]\n crypto_verifier = row[\"ZCRYPTOVERIFIER\"]\n crypto_wrapped_key = row[\"ZCRYPTOWRAPPEDKEY\"]\n\n # If they aren't there, we need to use the ZUNAPPLIEDENCRYPTEDRECORD\n\n if row[\"ZUNAPPLIEDENCRYPTEDRECORD\"]\n keyed_archive = KeyedArchive.new(:data => row[\"ZUNAPPLIEDENCRYPTEDRECORD\"])\n unpacked_top = keyed_archive.unpacked_top()\n ns_keys = unpacked_top[\"root\"][\"ValueStore\"][\"RecordValues\"][\"NS.keys\"]\n ns_values = unpacked_top[\"root\"][\"ValueStore\"][\"RecordValues\"][\"NS.objects\"]\n crypto_iv = ns_values[ns_keys.index(\"CryptoInitializationVector\")]\n crypto_tag = ns_values[ns_keys.index(\"CryptoTag\")]\n crypto_salt = ns_values[ns_keys.index(\"CryptoSalt\")]\n crypto_iterations = ns_values[ns_keys.index(\"CryptoIterationCount\")]\n crypto_wrapped_key = ns_values[ns_keys.index(\"CryptoWrappedKey\")]\n end\n\n tmp_note.add_cryptographic_settings(crypto_iv, \n crypto_tag, \n crypto_salt,\n crypto_iterations,\n crypto_verifier,\n crypto_wrapped_key)\n\n # Try each password and see if any generate a decrypt.\n found_password = tmp_note.decrypt\n\n if !found_password\n @logger.debug(\"Apple Note Store: Note #{tmp_note.note_id} could not be decrypted with our passwords.\")\n end\n end\n \n # Only add the note if we have both a folder and account for it, otherwise things blow up\n if tmp_account and tmp_folder\n @notes[tmp_note.note_id] = tmp_note\n else\n @logger.error(\"Rip Note: Skipping note #{tmp_note.note_id} due to a missing account.\") if !tmp_account\n @logger.error(\"Rip Note: Skipping note #{tmp_note.note_id} due to a missing folder.\") if !tmp_folder\n \n if !tmp_account or !tmp_folder\n @logger.error(\"Consider running these sqlite queries to take a look yourself, if ZDATA is NULL, that means you aren't missing anything: \")\n @logger.error(\"\\tSELECT Z_PK, #{account_field}, #{folder_field} FROM ZICCLOUDSYNCINGOBJECT WHERE Z_PK=#{tmp_note.primary_key}\")\n @logger.error(\"\\tSELECT #{note_id_field}, ZDATA FROM ZICNOTEDATA WHERE #{note_id_field}=#{tmp_note.note_id}\")\n end\n puts \"Skipping Note ID #{tmp_note.note_id} due to a missing folder or account, check the debug log for more details.\"\n end\n end\n end","title":""},{"docid":"eea3a7998644754345ff1b9b57f36b37","score":"0.5797036","text":"def rip_note(note_id)\n query_string = \"SELECT ZICNOTEDATA.Z_PK, ZICNOTEDATA.ZNOTE, \" + \n \"ZICNOTEDATA.ZCRYPTOINITIALIZATIONVECTOR, ZICNOTEDATA.ZCRYPTOTAG, \" + \n \"ZICNOTEDATA.ZDATA, ZICCLOUDSYNCINGOBJECT.ZCRYPTOVERIFIER, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZCRYPTOSALT, ZICCLOUDSYNCINGOBJECT.ZCRYPTOITERATIONCOUNT, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZCRYPTOWRAPPEDKEY, ZICCLOUDSYNCINGOBJECT.ZISPASSWORDPROTECTED, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1, ZICCLOUDSYNCINGOBJECT.ZCREATIONDATE1, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZTITLE1, ZICCLOUDSYNCINGOBJECT.ZACCOUNT3, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZACCOUNT2, ZICCLOUDSYNCINGOBJECT.ZFOLDER \" + \n \"FROM ZICNOTEDATA, ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICNOTEDATA.ZNOTE=? AND ZICCLOUDSYNCINGOBJECT.Z_PK=ZICNOTEDATA.ZNOTE\"\n folder_field = \"ZFOLDER\"\n account_field = \"ZACCOUNT3\"\n note_id_field = \"ZNOTE\"\n\n # In version 12, what is now in ZACCOUNT3 (the account ID) was in ZACCOUNT2\n if @version == IOS_VERSION_12\n account_field = \"ZACCOUNT2\"\n end\n\n # In version 11, what is now in ZACCOUNT3 was in ZACCOUNT2 and the ZFOLDER field was in a completely separate table\n if @version == IOS_VERSION_11\n query_string = \"SELECT ZICNOTEDATA.Z_PK, ZICNOTEDATA.ZNOTE, \" + \n \"ZICNOTEDATA.ZCRYPTOINITIALIZATIONVECTOR, ZICNOTEDATA.ZCRYPTOTAG, \" + \n \"ZICNOTEDATA.ZDATA, ZICCLOUDSYNCINGOBJECT.ZCRYPTOVERIFIER, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZCRYPTOSALT, ZICCLOUDSYNCINGOBJECT.ZCRYPTOITERATIONCOUNT, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZCRYPTOWRAPPEDKEY, ZICCLOUDSYNCINGOBJECT.ZISPASSWORDPROTECTED, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1, ZICCLOUDSYNCINGOBJECT.ZCREATIONDATE1, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZTITLE1, ZICCLOUDSYNCINGOBJECT.ZACCOUNT2, \" +\n \"Z_11NOTES.Z_11FOLDERS \" + \n \"FROM ZICNOTEDATA, ZICCLOUDSYNCINGOBJECT, Z_11NOTES \" + \n \"WHERE ZICNOTEDATA.ZNOTE=? AND ZICCLOUDSYNCINGOBJECT.Z_PK=ZICNOTEDATA.ZNOTE AND Z_11NOTES.Z_8NOTES=ZICNOTEDATA.ZNOTE\"\n folder_field = \"Z_11FOLDERS\"\n account_field = \"ZACCOUNT2\"\n end\n\n # In the legecy version, everything is different\n if @version == IOS_LEGACY_VERSION\n query_string = \"SELECT ZNOTE.Z_PK, ZNOTE.ZCREATIONDATE as ZCREATIONDATE1, \" + \n \"ZNOTE.ZMODIFICATIONDATE as ZMODIFICATIONDATE1, ZNOTE.ZTITLE as ZTITLE1, \" + \n \"ZNOTEBODY.ZCONTENT as ZDATA, ZSTORE.Z_PK as ZFOLDER, ZSTORE.ZACCOUNT \" +\n \"FROM ZNOTE, ZNOTEBODY, ZSTORE \" +\n \"WHERE ZNOTE.Z_PK=? AND ZNOTEBODY.Z_PK=ZNOTE.ZBODY AND ZSTORE.Z_PK=ZNOTE.ZSTORE\"\n folder_field = \"ZFOLDER\"\n account_field = \"ZACCOUNT\"\n note_id_field = \"Z_PK\"\n end\n\n # Execute the query\n @database.execute(query_string, note_id) do |row|\n # Create our note\n tmp_account = get_account(row[account_field])\n tmp_folder = get_folder(row[folder_field])\n tmp_note = AppleNote.new(row[\"Z_PK\"], \n row[note_id_field],\n row[\"ZTITLE1\"], \n row[\"ZDATA\"], \n row[\"ZCREATIONDATE1\"], \n row[\"ZMODIFICATIONDATE1\"],\n tmp_account,\n tmp_folder,\n self)\n tmp_account.add_note(tmp_note) if tmp_account\n tmp_folder.add_note(tmp_note) if tmp_folder\n\n # If this is protected, add the cryptographic variables\n if row[\"ZISPASSWORDPROTECTED\"] == 1\n tmp_note.add_cryptographic_settings(row[\"ZCRYPTOINITIALIZATIONVECTOR\"], \n row[\"ZCRYPTOTAG\"], \n row[\"ZCRYPTOSALT\"],\n row[\"ZCRYPTOITERATIONCOUNT\"],\n row[\"ZCRYPTOVERIFIER\"],\n row[\"ZCRYPTOWRAPPEDKEY\"])\n #tmp_note.decrypt_with_password(\"password\")\n end\n @notes[tmp_note.note_id] = tmp_note\n end\n end","title":""},{"docid":"6d37d05d1d135824ff16b1a79281cafe","score":"0.5628156","text":"def handle_notes(notes)\n\n notes.each do |note|\n\n prefix = case note['type']\n when 'dimensions'; \"Dimensions\"\n when 'physdesc'; \"Physical Description note\"\n when 'materialspec'; \"Material Specific Details\"\n when 'physloc'; \"Location of resource\"\n when 'phystech'; \"Physical Characteristics / Technical Requirements\"\n when 'physfacet'; \"Physical Facet\"\n #when 'processinfo'; \"Processing Information\"\n when 'separatedmaterial'; \"Materials Separated from the Resource\"\n else; nil\n end\n\n marc_args = case note['type']\n\n when 'arrangement', 'fileplan'\n ['351', 'a']\n # Remove processinfo from 500\n when 'odd', 'dimensions', 'physdesc', 'materialspec', 'physloc', 'phystech', 'physfacet', 'separatedmaterial'\n ['500','a']\n # we would prefer that information from both the note and subnote appear in subfields of a 506 element, like this:\n # \n # Restricted until 2020 \n # Available \n # \n when 'accessrestrict'\n ind1 = note['publish'] ? '1' : '0'\n if note['publish'] || @include_unpublished\n if note['rights_restriction']\n result = note['rights_restriction']['local_access_restriction_type']\n if result != []\n result.each do |lart|\n df('506', ind1).with_sfs(['a', note['subnotes'][0]['content']], ['f', lart])\n end\n else\n df('506', ind1).with_sfs(['a', note['subnotes'][0]['content']])\n end\n else\n ['506', ind1 ,'', 'a']\n end\n end\n when 'scopecontent'\n ['520', '2', ' ', 'a']\n when 'abstract'\n ['520', '3', ' ', 'a']\n when 'prefercite'\n ['524', ' ', ' ', 'a']\n when 'acqinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['541', ind1, ' ', 'a']\n when 'relatedmaterial'\n ['544','d']\n when 'bioghist'\n ['545','a']\n when 'custodhist'\n ind1 = note['publish'] ? '1' : '0'\n ['561', ind1, ' ', 'a']\n # Add processinfo to 583\n when 'appraisal', 'processinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['583', ind1, ' ', 'a']\n when 'accruals'\n ['584', 'a']\n when 'altformavail'\n ['535', '2', ' ', 'a']\n when 'originalsloc'\n ['535', '1', ' ', 'a']\n when 'userestrict', 'legalstatus'\n ['540', 'a']\n when 'langmaterial'\n ['546', 'a']\n else\n nil\n end\n\n unless marc_args.nil?\n text = prefix ? \"#{prefix}: \" : \"\"\n text += ASpaceExport::Utils.extract_note_text(note, @include_unpublished)\n\n # only create a tag if there is text to show (e.g., marked published or exporting unpublished) and if there are not multiple local access restriction types (if there are, that's already handled above)\n unless note['type'] == 'accessrestrict' && note['rights_restriction']\n if text.length > 0\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\n end\n end\n end\n\n end\n end","title":""},{"docid":"844527f1e622696053e85f49479614d8","score":"0.55514646","text":"def handle_notes(notes)\n\n notes.each do |note|\n\n prefix = case note['type']\n when 'dimensions'; \"Dimensions\"\n when 'physdesc'; \"Physical Description note\"\n when 'materialspec'; \"Material Specific Details\"\n when 'physloc'; \"Location of resource\"\n when 'phystech'; \"Physical Characteristics / Technical Requirements\"\n when 'physfacet'; \"Physical Facet\"\n when 'processinfo'; \"Processing Information\"\n when 'separatedmaterial'; \"Materials Separated from the Resource\"\n else; nil\n end\n\n marc_args = case note['type']\n\n when 'arrangement', 'fileplan'\n ['351', 'b']\n when 'odd', 'dimensions', 'physdesc', 'materialspec', 'physloc', 'phystech', 'physfacet', 'processinfo', 'separatedmaterial'\n ['500','a']\n when 'accessrestrict'\n ['506','a']\n #when 'scopecontent'\n #['520', '2', ' ', 'a']\n when 'abstract'\n ['520', '3', ' ', 'a']\n when 'prefercite'\n ['524', '8', ' ', 'a']\n when 'acqinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['541', ind1, ' ', 'a']\n when 'relatedmaterial'\n ['544','n']\n #when 'bioghist'\n #['545','a']\n when 'custodhist'\n ind1 = note['publish'] ? '1' : '0'\n ['561', ind1, ' ', 'a']\n when 'appraisal'\n ind1 = note['publish'] ? '1' : '0'\n ['583', ind1, ' ', 'a']\n when 'accruals'\n ['584', 'a']\n when 'altformavail'\n ['535', '2', ' ', 'a']\n when 'originalsloc'\n ['535', '1', ' ', 'a']\n when 'userestrict', 'legalstatus'\n ['540', 'a']\n when 'langmaterial'\n ['546', 'a']\n when 'otherfindaid'\n ['555', '0', ' ', 'a']\n else\n nil\n end\n\n unless marc_args.nil?\n text = prefix ? \"#{prefix}: \" : \"\"\n text += ASpaceExport::Utils.extract_note_text(note, @include_unpublished, true)\n\n # only create a tag if there is text to show (e.g., marked published or exporting unpublished)\n if text.length > 0\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\n end\n end\n\n end\n end","title":""},{"docid":"350575c7a510c9c04a18ddeb1ae62e2e","score":"0.5527494","text":"def handle_agent_notes(notes)\n notes.each do |note|\n prefix = case note['jsonmodel_type']\n when 'note_dimensions'; \"Dimensions\"\n when 'note_physdesc'; \"Physical Description note\"\n when 'note_materialspec'; \"Material Specific Details\"\n when 'note_physloc'; \"Location of resource\"\n when 'note_phystech'; \"Physical Characteristics / Technical Requirements\"\n when 'note_physfacet'; \"Physical Facet\"\n when 'note_processinfo'; \"Processing Information\"\n when 'note_separatedmaterial'; \"Materials Separated from the Resource\"\n else; nil\n end\n\n marc_args = case note['jsonmodel_type']\n\n when 'arrangement', 'fileplan'\n ['351','b']\n when 'note_odd', 'note_dimensions', 'note_physdesc', 'note_materialspec', 'note_physloc',\n 'note_phystech', 'note_physfacet', 'note_processinfo', 'note_separatedmaterial'\n ['500','a']\n when 'accessrestrict'\n ['506','a']\n when 'note_scopecontent'\n ['520', '2', ' ', 'a']\n when 'note_abstract'\n #check settings for enabling tag 520 and indicator 3\n if(MarcExportSettings.m_export_settings['tag_520_ind1_3'])\n ['520', '3', ' ', 'a']\n end\n when 'note_prefercite'\n ['524', ' ', ' ', 'a']\n when 'note_acqinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['541', ind1, ' ', 'a']\n when 'note_relatedmaterial'\n ['544','a']\n when 'note_bioghist'\n ['545', '1', ' ','a']\n when 'note_custodhist'\n ind1 = note['publish'] ? '1' : '0'\n ['561', ind1, ' ', 'a']\n when 'note_appraisal'\n ind1 = note['publish'] ? '1' : '0'\n ['583', ind1, ' ', 'a']\n when 'note_accruals'\n ['584', 'a']\n when 'note_altformavail'\n ['535', '2', ' ', 'a']\n when 'note_originalsloc'\n ['535', '1', ' ', 'a']\n when 'note_userestrict', 'note_legalstatus'\n ['540', 'a']\n when 'note_langmaterial'\n ['546', 'a']\n else\n nil\n end\n\n unless marc_args.nil?\n if handle_settings(marc_args)\n text = prefix ? \"#{prefix}: \" : \"\"\n #Strip hard returns\n if(MarcExportSettings.m_export_settings['tag_ss_1'])\n text += ASpaceExport::Utils.extract_note_text(note).delete(\"\\n\")\n else\n text += ASpaceExport::Utils.extract_note_text(note)\n end\n #add access restriction\n if(marc_args[0] == '506')\n if( MarcExportSettings.m_export_settings['tag_506_sc_a_ss_1'])\n urls = text.scan(/(?:http|https):\\/\\/[a-z0-9]+(?:[\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(?:(?::[0-9]{1,5})?\\/[^\\s]*)?/ix)\n unless urls.empty?\n text = text.gsub(/(\\. )[\\s\\S]*/, '. This collection has been digitized and is available online.')\n ead_text = if MarcExportSettings.m_export_settings['tag_856_ss_1'].nil? then MarcExportSettings.m_export_settings['tag_856_ss_1'] else \"Finding aid online:\" end\n df('856', '4', '2').with_sfs(\n ['z', ead_text],\n ['u', urls[0].chomp(\".\")]\n )\n end\n end\n end\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\n end\n end\n end\n end","title":""},{"docid":"329c570ea4ec27545f0a6e4085967d8f","score":"0.5433903","text":"def process_notes_array(array_of_id)\n notes = []\n array_of_id.each do |d|\n notes << Note.find(d[0].to_i)\n end\n notes\n end","title":""},{"docid":"5bad48136418b38dbdd61e1be805f5e5","score":"0.53568745","text":"def handle_notes(notes)\n\n notes.each do |note|\n\n prefix = case note['type']\n when 'dimensions'; \"Dimensions\"\n when 'physdesc'; \"Physical Description note\"\n when 'materialspec'; \"Material Specific Details\"\n when 'physloc'; \"Location of resource\"\n when 'phystech'; \"Physical Characteristics / Technical Requirements\"\n when 'physfacet'; \"Physical Facet\"\n when 'processinfo'; \"Processing Information\"\n when 'separatedmaterial'; \"Materials Separated from the Resource\"\n else; nil\n end\n\n #20160829LJD: Add additional note types for export.\n marc_args = case note['type']\n\n when 'arrangement', 'fileplan'\n ['351','b']\n when 'odd', 'dimensions', 'physdesc', 'materialspec', 'physloc', 'phystech', 'physfacet', 'processinfo', 'separatedmaterial'\n ['500','a']\n when 'accessrestrict'\n ['506','a']\n # when 'scopecontent'\n # ['520', '2', ' ', 'a']\n when 'abstract'\n ['520', '3', ' ', 'a']\n when 'prefercite'\n ['524', '8', ' ', 'a']\n when 'acqinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['541', ind1, ' ', 'a']\n when 'relatedmaterial'\n ['544','n']\n # when 'bioghist'\n # ['545','a']\n when 'custodhist'\n ind1 = note['publish'] ? '1' : '0'\n ['561', ind1, ' ', 'a']\n when 'appraisal'\n ind1 = note['publish'] ? '1' : '0'\n ['583', ind1, ' ', 'a']\n when 'accruals'\n ['584', 'a']\n when 'altformavail'\n ['535', '2', ' ', 'a']\n when 'originalsloc'\n ['535', '1', ' ', 'a']\n when 'userestrict', 'legalstatus'\n ['540', 'a']\n when 'langmaterial'\n ['546', 'a']\n # when 'otherfindaid'\n # ['555', '0', ' ', 'a']\n else\n nil\n end\n\n unless marc_args.nil?\n text = prefix ? \"#{prefix}: \" : \"\"\n text += ASpaceExport::Utils.extract_note_text(note, @include_unpublished, true)\n\n # only create a tag if there is text to show (e.g., marked published or exporting unpublished)\n if text.length > 0\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\n end\n end\n\n end\n end","title":""},{"docid":"2ab2a5c7ca73f821a700c2e53c3b3461","score":"0.53344345","text":"def list_notes\n notes = if unsafe_params[:editable]\n Note.editable_by(@context).where.not(title: nil).accessible_by_private\n else\n Note.accessible_by(@context).where.not(title: nil)\n end\n\n if unsafe_params[:scopes].present?\n check_scope!\n notes = notes.where(scope: unsafe_params[:scopes])\n end\n\n if unsafe_params[:note_types].present?\n fail \"Param note_types can only be an Array of Strings containing 'Note', 'Answer', or 'Discussion'\" unless unsafe_params[:note_types].is_a?(Array) && unsafe_params[:note_types].all? { |type| %w(Note Answer Discussion).include?(type) }\n\n note_types = unsafe_params[:note_types].map { |type| type == \"Note\" ? nil : type }\n notes = notes.where(note_type: note_types)\n end\n\n result = notes.order(id: :desc).map do |note|\n if note.note_type == \"Discussion\"\n note = note.discussion\n elsif note.note_type == \"Answer\"\n note = note.answer\n end\n describe_for_api(note, unsafe_params[:describe])\n end\n\n render json: result\n end","title":""},{"docid":"1b8013903bb453269825a77770e26973","score":"0.5314009","text":"def note\n comment_list = []\n return @notes if !@notes.nil?\n for page in @pages\n next if !page || !page.list || page.list.size <= 0\n note_page = page.list.dup\n \n note_page.each do |item|\n next unless item && (item.code == 108 || item.code == 408)\n comment_list.push(item.parameters[0])\n end\n end\n @notes = comment_list.join(\"\\r\\n\")\n return @notes\n end","title":""},{"docid":"7cf69ecb11ebebf2a0007d4ab4cd33f4","score":"0.5301912","text":"def notes(params = {})\n @notes ||= MailchimpAPI::Note.find(:all, params: { member_id: id }.deep_merge(prefix_options).deep_merge(params))\n end","title":""},{"docid":"1a3925ac7ed4ab1530d8607e808b3c25","score":"0.5235186","text":"def serialize_did_notes(data, xml, fragments)\n data.notes.each do |note|\n next if note[\"publish\"] === false && !@include_unpublished\n next unless data.did_note_types.include?(note['type']) # and note[\"publish\"] == true)\n\n audatt = note[\"publish\"] === false ? {:audience => 'internal'} : {}\n content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)\n\n att = { :id => prefix_id(note['persistent_id']) }.reject {|k,v| v.nil? || v.empty? || v == \"null\" }\n att ||= {}\n\n case note['type']\n when 'dimensions', 'physfacet'\n xml.physdesc(audatt) {\n #xml.physdesc {\n xml.send(note['type'], att) {\n sanitize_mixed_content( content, xml, fragments, ASpaceExport::Utils.include_p?(note['type']) )\n }\n }\n else\n xml.send(note['type'], att) {\n sanitize_mixed_content(content, xml, fragments,ASpaceExport::Utils.include_p?(note['type']))\n }\n end\n end\n end","title":""},{"docid":"fedcb899bf7a163ce0e9231af1c1ec3e","score":"0.5234678","text":"def notes params=nil\n @nimble.get \"contact/#{self.id}/notes\", params\n end","title":""},{"docid":"b06abe78a177acc64c85a8971d9048c0","score":"0.5226792","text":"def serialize_did_notes(data, xml, fragments)\n data.notes.each do |note|\n next if note[\"publish\"] === false && !@include_unpublished\n next unless (data.did_note_types.include?(note['type']) and note[\"publish\"] == true)\n\n #audatt = note[\"publish\"] === false ? {:audience => 'internal'} : {}\n content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)\n\n att = { :id => prefix_id(note['persistent_id']) }.reject {|k,v| v.nil? || v.empty? || v == \"null\" }\n att ||= {}\n\n case note['type']\n when 'dimensions', 'physfacet'\n #xml.physdesc(audatt) {\n xml.physdesc {\n xml.send(note['type'], att) {\n sanitize_mixed_content( content, xml, fragments, ASpaceExport::Utils.include_p?(note['type']) )\n }\n }\n else\n xml.send(note['type'], att) {\n sanitize_mixed_content(content, xml, fragments,ASpaceExport::Utils.include_p?(note['type']))\n }\n end\n end\n end","title":""},{"docid":"f19efcada8120b00bf0fb31838c2b6de","score":"0.51787525","text":"def notes( params={} )\n notes = get_connections(\"notes\", params)\n return map_connections notes, :to => Facebook::Graph::Note\n end","title":""},{"docid":"152f357d76a68883ca5fec849d491a5b","score":"0.511587","text":"def update_note(update_octave=true) # Update_octave=false used in generative parsing\n if self[:pc]\n self.merge!(get_ziff(self[:pc], self[:key], self[:scale],(update_octave ? (self[:octave] || 0) : false),(self[:add] || 0)))\n elsif self[:hpcs]\n notes = []\n self[:hpcs].each do |d|\n pc = d[:pc]\n notes.push(get_note_from_dgr(pc, d[:key], d[:scale], (d[:octave] || 0)) + (self[:add] || 0))\n end\n self[:pcs] = self[:hpcs].map {|h| h[:pc] }\n self[:notes] = notes\n end\n end","title":""},{"docid":"bf521b5955a6a7748df7dd30e3095585","score":"0.5102217","text":"def show_all_notes(db)\n notes = server.get_index\n notes.each do |note|\n note = server.get_note(note[\"key\"])\n show_note(note)\n end\nend","title":""},{"docid":"25a264d172c3c4fc746a348a360bdb68","score":"0.5092266","text":"def _Notes\n while true\n\n _save1 = self.pos\n while true # choice\n _tmp = apply(:_Note)\n break if _tmp\n self.pos = _save1\n _tmp = apply(:_SkipBlock)\n break if _tmp\n self.pos = _save1\n break\n end # end choice\n\n break unless _tmp\n end\n _tmp = true\n set_failed_rule :_Notes unless _tmp\n return _tmp\n end","title":""},{"docid":"18b1f7b1ed2316439d62ca427df616b8","score":"0.5091866","text":"def fix_notes(condensed)\n\t condensed.each do |loc|\n\t ##Rails.logger.debug \"\\nes287_debug line(#{__LINE__}) location=#{loc['location_name']} #{loc['call_number']}\\n\"\n\t ##Rails.logger.debug \"\\nes287_debug line(#{__LINE__}) copies = \" + loc[\"copies\"][0].count.inspect\n\t if !loc[\"copies\"][0][\"items\"][\"Not Available\"].blank? and loc[\"copies\"][0][\"items\"][\"Not Available\"][\"status\"] == 'none'\n\t ##Rails.logger.debug \"\\nes287_debug line(#{__LINE__}) seems like there are no items, so copy notes,etc.\"\n\t ['orders','summary_holdings','supplements','indexes','notes',\n\t\t 'reproduction_note','current_issues'].each do |type|\n\t\tloc[\"copies\"][0][type] = loc[type] unless loc[type].blank?\n\t end\n\t end\n\t end\n\t condensed\n\t end","title":""},{"docid":"33fd1a8450e7bc8abffce4f0121b878e","score":"0.50192636","text":"def attach_to_notes\n items = unsafe_params[:items]\n note_uids = unsafe_params[:note_uids]\n\n unless note_uids.all? { |uid| uid =~ /^(note|discussion|answer)-(\\d+)$/ }\n fail \"Parameter 'note_uids' need to be an Array of Note, Answer, or Discussion uids\"\n end\n\n valid_items =\n items.all? do |item|\n item[:id].is_a?(Numeric) &&\n item[:type].is_a?(String) &&\n %w(App Asset Comparison Job UserFile).include?(item[:type])\n end\n\n unless valid_items\n fail \"Items need to be an array of objects with id and type \" \\\n \"(one of App, Comparison, Job, UserFile or Asset)\"\n end\n\n notes_added = {}\n items_added = {}\n\n Note.transaction do\n note_uids.each do |note_uid|\n note_item = item_from_uid(note_uid)\n\n next unless note_item&.editable_by?(@context)\n\n items.each do |item|\n item[:type] = if item[:type].blank?\n item[:className] == \"file\" ? \"UserFile\" : item[:className].capitalize\n else\n item[:type]\n end\n\n note_item.attachments.find_or_create_by(item_id: item[:id], item_type: item[:type])\n items_added[\"#{item[:type]}-#{item[:id]}\"] = true\n end\n\n notes_added[note_uid] = true\n note_item.save\n end\n end\n\n render json: {\n notes_added: notes_added,\n items_added: items_added,\n }\n end","title":""},{"docid":"39757d754f979c4ab775e746727e79c2","score":"0.49999955","text":"def index\n @internal_notes = InternalNote.all\n end","title":""},{"docid":"c9ad4b90c6ce202713e61ba5893b61f0","score":"0.49996296","text":"def starred_notes\n fetch_notes_for nil, true\n end","title":""},{"docid":"077086131fee62b038dc117cb2036e66","score":"0.49352357","text":"def notes\n\t\tall.map do |tone|\n\t\t\tKey.from_index(tone.tone, tone.letter_index).name\n\t\tend.extend(NoteSequence)\n\tend","title":""},{"docid":"3c015c9569c5462734e7ec6527570ddf","score":"0.49332568","text":"def note(id)\n @contacts.each do |contact|\n if contact.id == id\n contact.notes.clear\n contact.notes << @note.input\n contact.notes.flatten!\n end\n end\n end","title":""},{"docid":"31e6990120e2de80f80314a0a757652b","score":"0.4922506","text":"def notes(options = {})\n # Create a default 2 item hash and update if options is supplied\n options = {\n id: nil,\n type: nil\n }.update(options)\n return nil if @_notes.nil?\n return nil if @_notes.empty?\n\n # Empty 2-D Hash to be used for notes found based on id and type\n notes_found = Hash.new do |h, k|\n # h is the id portion of the hash\n # k is the type portion of the hash\n h[k] = {}\n end\n # Filter @notes based off of the id\n filter_hash(@_notes, options[:id]).each do |id, hash|\n # Filter hash based off of the type\n filter_hash(hash, options[:type]).each do |type, note|\n # Store the note into note_found\n notes_found[id][type] = note\n end\n end\n if notes_found.empty?\n nil\n elsif notes_found.size == 1\n notes_found.values.first.values.first\n else\n notes_found\n end\n end","title":""},{"docid":"de2d396a17cc37b8d623aebe405c4bdb","score":"0.49176878","text":"def notes\n\t\tNote.find(:all)\n\tend","title":""},{"docid":"8e48f18d3ddb20786e47d6e3f53d52cc","score":"0.48964486","text":"def inferred_notes\n if scrubbed_notes?\n Rails.logger.debug \"not replacing scrubbed notes\"\n head_notes\n notes\n elsif head_notes.present?\n head_notes\n elsif notes.present? && ff?\n Rails.logger.debug \"not deleting old ff notes\"\n head_notes\n notes\n else\n head_notes\n end\n end","title":""},{"docid":"c0d198cf4116c6da48e61761ba608e28","score":"0.48726588","text":"def list_notes(identifier, opts = {})\n data, _status_code, _headers = list_notes_with_http_info(identifier, opts)\n return data\n end","title":""},{"docid":"2a4b9b1c20a5403dc375ea3c85cb4ba0","score":"0.48549536","text":"def cat\n unless encrypted_notes.empty?\n print_notes(:encrypted => true)\n decrypted_notes = @cipher.decrypt_files(encrypted_notes)\n end\n\n matching_notes.each do |note_path|\n contents = \\\n if FuzzyNotes::Cipher.encrypted?(note_path)\n decrypted_notes.shift\n elsif FuzzyNotes::EvernoteSync.evernote?(note_path)\n FuzzyNotes::EvernoteSync.sanitize_evernote(note_path)\n elsif FuzzyNotes::ImageViewer.image?(note_path)\n FuzzyNotes::ImageViewer.display(@viewer, note_path)\n else\n FuzzyNotes::TextViewer.read(note_path)\n end\n\n if contents\n log.info \"=== #{note_path} ===\\n\\n\"\n puts \"#{contents}\\n\"\n end\n end\n end","title":""},{"docid":"dc6756a9c1cf8cf1c2d76a68b9faf1fb","score":"0.48425448","text":"def list_case_notes\n\t\t@case_notes = CaseNote.where(case_id: params[:case_id])\n\tend","title":""},{"docid":"cdbdaab15d1f9ee0699bb2eb6431cb5d","score":"0.48034608","text":"def note note, preview=nil\n preview ||= note[0..64]\n params = {\n contact_ids: [ self.id ],\n note: note,\n note_preview: preview\n }\n @nimble.post \"contacts/notes\", params\n end","title":""},{"docid":"84390418c7fce0d9a8c0720653ef255f","score":"0.4769047","text":"def get_notes(opts = {})\n data, status_code, headers = get_notes_with_http_info(opts)\n return data\n end","title":""},{"docid":"8035c90eba633a7f5328af9b47b05527","score":"0.47678736","text":"def notes\n return Note.find(:all, :conditions => [\"type_id = ? AND owner = ?\", self.id, :property ])\n end","title":""},{"docid":"b9f4f0d68f955dcea2d9aa2569a63792","score":"0.4751765","text":"def rip_folder(folder_id)\n\n @logger.debug(\"Rip Folder: Calling rip_folder on Folder ID #{folder_id}\")\n\n # Set the ZSERVERRECORD column to look at\n server_record_column = \"ZSERVERRECORD\"\n server_record_column = server_record_column + \"DATA\" if @version >= IOS_VERSION_12 # In iOS 11 this was ZSERVERRECORD, in 12 and later it became ZSERVERRECORDDATA\n\n # Set the ZSERVERSHARE column to look at\n server_share_column = \"ZSERVERSHARE\"\n server_share_column = server_share_column + \"DATA\" if @version >= IOS_VERSION_12 # In iOS 11 this was ZSERVERRECORD, in 12 and later it became ZSERVERRECORDDATA\n \n smart_folder_query = \"'' as ZSMARTFOLDERQUERYJSON\"\n smart_folder_query = \"ZICCLOUDSYNCINGOBJECT.ZSMARTFOLDERQUERYJSON\" if @version >= IOS_VERSION_15\n \n query_string = \"SELECT ZICCLOUDSYNCINGOBJECT.ZTITLE2, ZICCLOUDSYNCINGOBJECT.ZOWNER, \" + \n \"ZICCLOUDSYNCINGOBJECT.#{server_record_column}, ZICCLOUDSYNCINGOBJECT.#{server_share_column}, \" +\n \"ZICCLOUDSYNCINGOBJECT.Z_PK, ZICCLOUDSYNCINGOBJECT.ZIDENTIFIER, \" +\n \"ZICCLOUDSYNCINGOBJECT.ZPARENT, #{smart_folder_query} \" +\n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.Z_PK=?\"\n\n #Change things up for the legacy version\n if @version == IOS_LEGACY_VERSION\n query_string = \"SELECT ZSTORE.Z_PK, ZSTORE.ZNAME as ZTITLE2, \" +\n \"ZSTORE.ZACCOUNT as ZOWNER, '' as ZIDENTIFIER \" +\n \"FROM ZSTORE \" +\n \"WHERE ZSTORE.Z_PK=?\"\n end\n\n @database.execute(query_string, folder_id) do |row|\n\n tmp_folder = AppleNotesFolder.new(row[\"Z_PK\"],\n row[\"ZTITLE2\"],\n get_account(row[\"ZOWNER\"]))\n\n # If this is a smart folder, instead build an AppleNotesSmartFolder\n if row[\"ZSMARTFOLDERQUERYJSON\"] and row[\"ZSMARTFOLDERQUERYJSON\"].length > 0\n tmp_folder = AppleNotesSmartFolder.new(row[\"Z_PK\"],\n row[\"ZTITLE2\"],\n get_account(row[\"ZOWNER\"]),\n row[\"ZSMARTFOLDERQUERYJSON\"])\n end\n\n if row[\"ZIDENTIFIER\"]\n tmp_folder.uuid = row[\"ZIDENTIFIER\"]\n end\n\n # Set whether the folder displays notes in numeric order, or by modification date\n tmp_folder.retain_order = @retain_order\n tmp_folder.sort_order = @folder_order[row[\"ZIDENTIFIER\"]] if @folder_order[row[\"ZIDENTIFIER\"]]\n\n # Add server-side data, if relevant\n tmp_folder.add_cloudkit_server_record_data(row[server_record_column]) if row[server_record_column]\n\n if(row[server_share_column]) \n tmp_folder.add_cloudkit_sharing_data(row[server_share_column])\n\n # Add any share participants to our overall list\n tmp_folder.share_participants.each do |participant|\n @cloud_kit_participants[participant.record_id] = participant\n end\n end\n\n @logger.debug(\"Rip Folder: Created folder #{tmp_folder.name}\")\n\n # Remember folder heirarchy\n if row[\"ZPARENT\"]\n tmp_parent_folder_id = row[\"ZPARENT\"]\n tmp_folder.parent_id = tmp_parent_folder_id\n end\n \n # Whether child or not, we add it to the overall tracker so we can look up by folder ID.\n # We'll clean up on output by testing to see if a folder has a parent.\n @folders[folder_id] = tmp_folder\n\n end\n end","title":""},{"docid":"58f3ea3a9ff7edec7a9e3ff5804c5ceb","score":"0.4731986","text":"def notes=(notes)\n self.service.editObject({ \"notes\" => notes.to_s })\n self.refresh_details()\n end","title":""},{"docid":"f121a6d2ee93bfd835a9381272befc66","score":"0.4724261","text":"def set_notes_list\n @notes_list = @note.notes_lists.find(params[:id])\n end","title":""},{"docid":"837df9ea7b5447bf94927b839ca39848","score":"0.4717078","text":"def note_contents\n self.notes.each.map{|note| note.content}\n end","title":""},{"docid":"e8d9a667fb4b84fc2524312f3ffeb8fd","score":"0.47113046","text":"def filter_notes\n filters = []\n filters << {:re => /(https?:\\/\\/\\S+)/i, :sub => '\\1'}\n filters << {:re => /\\brt:(\\d+)\\b/i, :sub => 'rt:\\1'}\n filters << {:re => /\\bwiki:([\\S\\(\\)_]+)/i, :sub => 'wiki:\\1'}\n filters << {:re => /#(\\S+)\\b/i, :sub => '#\\1'}\n\n @hosts = [@host] if @hosts == nil\n @hosts.each do |e|\n filters.collect { |f| e.notes.gsub! f[:re], f[:sub] }\n end\n end","title":""},{"docid":"b4c79cf5c18bcff6c46324f56184c91c","score":"0.47068018","text":"def all_notes=(notes)\n self.class.all_note_fields.each do |field|\n send(\"#{field}=\", notes[field])\n end\n end","title":""},{"docid":"f1285fee0b9d553b3f95e874375bf403","score":"0.47057152","text":"def get_core_notes_and_type\n possibles = []\n size = @notes.length\n while (possibles.length == 0)\n pairs = @notes.combination(size).map do |set|\n [set, self.get_poss_type(set)]\n end\n possibles += pairs.reject { |_, type| type == :'unknown chord' }\n size -= 1\n end\n return possibles.first # TODO: Algorithm to pick most likely type\n end","title":""},{"docid":"ab85cea5c8d9753dc13f3b4e7e882e30","score":"0.4684559","text":"def add_note # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity\n @bib.biblionote.each do |n|\n case n.type\n when \"annote\" then @item.annote = n.content\n when \"howpublished\" then @item.howpublished = n.content\n when \"comment\" then @item.comment = n.content\n when \"tableOfContents\" then @item.content = n.content\n when nil then @item.note = n.content\n end\n end\n end","title":""},{"docid":"adfd0ac6b68354046631932adcd78cc4","score":"0.46824485","text":"def show_all_notes_db(db)\n db.all_notes.select { |note| !note[\"deleted\"] }\n .each { |note| show_note(note) }\nend","title":""},{"docid":"e3915c49b23a060afb377617b94d84c6","score":"0.46579546","text":"def update!(notes)\n fetch_notes\n show_notes\n push_notes(notes)\n end","title":""},{"docid":"094e0bbc2e95cfa18fa842b9382a27dd","score":"0.46531925","text":"def character_notes\n self.object.character_notes.map do |note|\n {\n c_note_id: note.id,\n c_note_title: note.title,\n c_note_content: note.content,\n visible_to_other_players: note.visible_to_other_players,\n amount_spent: note.amount_spent,\n amount_earned: note.amount_earned\n }\n end\n end","title":""},{"docid":"d5c706a2025f43b2f1c0cf0a47df6f45","score":"0.4651705","text":"def add_plain_text_to_database\n\n return if @version < IOS_VERSION_9 # Fail out if we're prior to the compressed data age\n\n # Warn the user\n puts \"Adding the ZICNOTEDATA.ZPLAINTEXT and ZICNOTEDATA.ZDECOMPRESSEDDATA columns, this takes a few seconds\"\n\n # Add the new ZPLAINTEXT column\n @database.execute(\"ALTER TABLE ZICNOTEDATA ADD COLUMN ZPLAINTEXT TEXT\")\n @database.execute(\"ALTER TABLE ZICNOTEDATA ADD COLUMN ZDECOMPRESSEDDATA TEXT\")\n\n # Loop over each AppleNote\n @notes.each do |key, note|\n\n # Update the database to include the plaintext\n @database.execute(\"UPDATE ZICNOTEDATA \" + \n \"SET ZPLAINTEXT=?, ZDECOMPRESSEDDATA=? \" + \n \"WHERE Z_PK=?\",\n note.plaintext, note.decompressed_data, note.primary_key) if note.plaintext\n end\n end","title":""},{"docid":"d5c706a2025f43b2f1c0cf0a47df6f45","score":"0.4651705","text":"def add_plain_text_to_database\n\n return if @version < IOS_VERSION_9 # Fail out if we're prior to the compressed data age\n\n # Warn the user\n puts \"Adding the ZICNOTEDATA.ZPLAINTEXT and ZICNOTEDATA.ZDECOMPRESSEDDATA columns, this takes a few seconds\"\n\n # Add the new ZPLAINTEXT column\n @database.execute(\"ALTER TABLE ZICNOTEDATA ADD COLUMN ZPLAINTEXT TEXT\")\n @database.execute(\"ALTER TABLE ZICNOTEDATA ADD COLUMN ZDECOMPRESSEDDATA TEXT\")\n\n # Loop over each AppleNote\n @notes.each do |key, note|\n\n # Update the database to include the plaintext\n @database.execute(\"UPDATE ZICNOTEDATA \" + \n \"SET ZPLAINTEXT=?, ZDECOMPRESSEDDATA=? \" + \n \"WHERE Z_PK=?\",\n note.plaintext, note.decompressed_data, note.primary_key) if note.plaintext\n end\n end","title":""},{"docid":"130275f3295d2f7dc83fb8c0fe05e61c","score":"0.4649199","text":"def each_note(&block)\n\t\tnotes.each do |note|\n\t\t\tblock.call(note)\n\t\tend\n\tend","title":""},{"docid":"3fade731f28a4d289f63cffd3b305ba4","score":"0.46328926","text":"def each_note(wspace=workspace, &block)\n\t\twspace.notes.each do |note|\n\t\t\tblock.call(note)\n\t\tend\n\tend","title":""},{"docid":"eb3dde962a48d03f4836a403b3a9878b","score":"0.46298686","text":"def index\n @notebook_notes = Notebook::Note.all\n end","title":""},{"docid":"b8128d41e78a967670c2424835780383","score":"0.46275607","text":"def all_notes\n result = {}\n self.class.all_note_fields.each do |field|\n value = send(field).to_s\n result[field] = value.presence\n end\n result\n end","title":""},{"docid":"fb1acbc3a63dda2af1b8b373b066615b","score":"0.46216643","text":"def index\n @notes_lists = @note.notes_lists.all\n end","title":""},{"docid":"0a92e048214144d1160080ff2bad694b","score":"0.46145135","text":"def make_note (notes_hash, framework=self.framework)\n\t\t\tprint_deb \"Attempting to create note with #{notes_hash.inspect}\"\n\t\t\t# check the required hash elements for a good note\n\t\t\t\n\t\t\t# <-- start weird bug work around\n\t\t\trequired_elements = [:data]\n\t\t\t#required_elements = [:data,:type]\n\t\t\tnotes_hash[:type] = \"db_fun\"\n\t\t\t# --> end weird bug work around\n\t\t\t\n\t\t\trequired_elements.each do |elem|\n\t\t\t\traise ArgumentError.new \"Missing required element (#{elem}) \" +\n\t\t\t\t\"for the note\" unless notes_hash[elem]\n\t\t\tend\n\t\t\tprint_deb \"Sending note to db with #{notes_hash.inspect}\"\n\t\t\tframework.db.report_note(notes_hash)\n\t\t\t\t\n\t\t\t#\n\t\t\t# Report a Note to the database. Notes can be tied to a Workspace, Host, or Service.\n\t\t\t#\n\t\t\t# opts MUST contain\n\t\t\t# +:data+:: whatever it is you're making a note of\n\t\t\t# +:type+:: The type of note, e.g. smb_peer_os\n\t\t\t#\n\t\t\t# opts can contain\n\t\t\t# +:workspace+:: the workspace to associate with this Note\n\t\t\t# +:host+:: an IP address or a Host object to associate with this Note\n\t\t\t# +:service+:: a Service object to associate with this Note\n\t\t\t# +:port+:: along with :host and proto, a service to associate with this Note\n\t\t\t# +:proto+:: along with :host and port, a service to associate with this Note\n\t\t\t# +:update+:: what to do in case a similar Note exists, see below\n\t\t\t#\n\t\t\t# The +:update+ option can have the following values:\n\t\t\t# +:unique+:: allow only a single Note per +:host+/+:type+ pair\n\t\t\t# +:unique_data+:: like +:uniqe+, but also compare +:data+\n\t\t\t# +:insert+:: always insert a new Note even if one with identical values exists\n\t\t\t#\n\t\t\t# If the provided +:host+ is an IP address and does not exist in the\n\t\t\t# database, it will be created. If +:workspace+, +:host+ and +:service+\n\t\t\t# are all omitted, the new Note will be associated with the current\n\t\t\t# workspace.\n\t\t\t#\n\t\tend","title":""},{"docid":"7624a958dcd97bd31e06c3cb4ecf3147","score":"0.46108902","text":"def note_contents=(notes)\n notes.each do |content|\n if content.strip != ''\n self.notes.build(content: content)\n end\n end\n end","title":""},{"docid":"f217d8297d749e9a246f64c0f457dd7c","score":"0.46036783","text":"def all_notes\n self.has_notes? ? self.annotations.map {|n| n.body }.join(' ') : '' \n end","title":""},{"docid":"18bd2ccbf1a41b08f5b58d46df45f274","score":"0.45953065","text":"def fetch_notes\n info \"fetching notes\"\n run(\"git fetch -f origin refs/notes/*:refs/notes/*\", {:raise => true})\n end","title":""},{"docid":"0bd545f16a01ef5497ef8a0c7c0e9a44","score":"0.45784226","text":"def notes\n @data[:notes]\n end","title":""},{"docid":"edc5dfe0200a4b12d4455f2c9111e7a7","score":"0.4564379","text":"def note_contents=(notes)\n notes.each do |note|\n if note != \"\"\n self.notes << Note.find_or_create_by(content: note)\n end\n end\n\n end","title":""},{"docid":"025471fe926049b7daabf4aef028ef87","score":"0.45600042","text":"def clean_notes\n for note in notes\n if note.comment.blank?\n note.destroy\n end\n end\n\n end","title":""},{"docid":"85a3e62205e801ae7e81bb1f76882d99","score":"0.45589137","text":"def to_up_notes(raw_notes)\n raw_notes.present? ? { other: raw_notes } : Observation.no_notes\n end","title":""},{"docid":"cd93b88f97fbbcd5bc8623ce259a376b","score":"0.4554767","text":"def index\n @communication_notes = CommunicationNote.all\n end","title":""},{"docid":"1ff07c3bf8c5b90805a18c0f0cb2e644","score":"0.45547506","text":"def get_note(obj, id)\n obj['notes'].find {|n| n['persistent_id'] == id}\nend","title":""},{"docid":"24b11e6a82a28b1e35b65ad7dc12f3c1","score":"0.45450476","text":"def index\n @personal_notes = Note.where(:user_id => current_user.id)\n @public_notes = Note.where(:isPublic => true).where.not(:user_id => current_user.id)\n @shared_notes = Note.where(:id => NotesUser.where(:user_id => current_user.id).select(:note_id))\n #@notes = Note.all\n end","title":""},{"docid":"b87e716c74094cd77173d8a88018ca80","score":"0.45348775","text":"def cmd_db_fun_note(*args)\n\t\t\t# this should currently support mixed sets, unlike the rest of the code\n\n\t\t\t# the required hash elements for a good note:\n\t\t\t# required_elements = [ :data, :type]\n\t\t\t# note hash that we ultimately send to make_note, with default values\n\t\t\tnote_hash = @note_template.dup\n\n\t\t\t# Check if the database is active, otherwise crap out\n\t\t\tfmwk = self.framework\n\t\t\tif fmwk.db and fmwk.db.active\n\t\t\t\tbegin\n\t\t\t\t\tnote_hash[:workspace] = fmwk.db.workspace unless note_hash[:workspace]\n\t\t\t\trescue Exception => e\n\t\t\t\t\tprint_error \"Unable to determine active workspace, reason: #{e.to_s}\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t#do we just let them know, or raise an error... hrm for now:\n\t\t\t\traise RuntimeError.new \"Database is not active\"\n\t\t\tend\n\n\t\t\t# Lookin' good, let's populate the note hash with user supplied info\n\t\t\tcase args.length\n\t\t\twhen 1\n\t\t\t\tnote_hash[:data] = args[0]\n\t\t\t\t# assume it's a super simple note for the workspace and default everything else\n\t\t\t\tself.make_note(note_hash)\n\t\t\twhen 2\n\t\t\t\tid = args[0]\n\t\t\t\tnote_hash[:data] = args[1]\n\t\t\t\t# TODO: maybe support host & service ids too? if host_is set :host => id\n\t\t\t\t\n\t\t\t\t# if the first arg seems to be a set_id...\n\t\t\t\tif is_valid_set?(id)\n\t\t\t\t\t# loop over objects in set & make note for each\n\t\t\t\t\tprint_status \"Adding note to objects in set: #{id}\"\n\t\t\t\t\tretrieve_set(id).each do |obj|\n\t\t\t\t\t\tobj_type_sym = get_type(obj).downcase.to_sym\n\t\t\t\t\t\tnote_hash[obj_type_sym] = obj\n\t\t\t\t\t\tself.make_note(note_hash)\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tprint_error \"Could not find a valid set named #{id}\"\t\t\t\t\t\n\t\t\t\tend\t\t\t\t\n\t\t\telse\n\t\t\t\treturn fun_usage\n\t\t\tend\n\t\tend","title":""},{"docid":"c3f70fabd619a75fdd3b871a8bab57da","score":"0.4530724","text":"def list_notes_with_http_info(identifier, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AlertApi.list_notes ...\"\n end\n # verify the required parameter 'identifier' is set\n if @api_client.config.client_side_validation && identifier.nil?\n fail ArgumentError, \"Missing the required parameter 'identifier' when calling AlertApi.list_notes\"\n end\n if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])\n fail ArgumentError, 'invalid value for \"identifier_type\", must be one of id, alias, tiny'\n end\n if @api_client.config.client_side_validation && opts[:'direction'] && !['next', 'prev'].include?(opts[:'direction'])\n fail ArgumentError, 'invalid value for \"direction\", must be one of next, prev'\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling AlertApi.list_notes, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling AlertApi.list_notes, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && opts[:'order'] && !['asc', 'desc'].include?(opts[:'order'])\n fail ArgumentError, 'invalid value for \"order\", must be one of asc, desc'\n end\n # resource path\n local_var_path = \"/v2/alerts/{identifier}/notes\".sub('{' + 'identifier' + '}', identifier.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['GenieKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ListAlertNotesResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AlertApi#list_notes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end","title":""},{"docid":"0e7eca6746bafa7d39e2764b90843735","score":"0.4524773","text":"def in_app_receipts\n read('in_app').map { |raw_receipt| InAppReceipt.new(raw_receipt) }\n end","title":""},{"docid":"dfd72a13b4b11075c1dfbd9911a66d48","score":"0.4516266","text":"def play(notes)\n\n md = /(\\w):(.+)/.match(notes)\n \n notetype = @notes[md[1]]\n d = @seq.note_to_delta(notetype)\n\n # n.b channel is inverse of string - chn 0 is str 6 \n md[2].split('|').each_with_index do |fret, channel| \n if fret.to_i.to_s == fret\n fret = fret.to_i\n oldfret = @prev[channel]\n @prev[channel] = fret \n\n if oldfret\n oldnote = @tuning[channel] + oldfret\n @track.events << MIDI::NoteOffEvent.new(channel,oldnote,0,d)\n d = 0\n end\n \n noteval = @tuning[channel] + fret\n @track.events << MIDI::NoteOnEvent.new(channel,noteval,80 + rand(38),d)\n d = 0\n end\n end\n end","title":""},{"docid":"2c6fcb5946bac352f3d65e07b2523c8c","score":"0.45056722","text":"def rip_folders()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK \" + \n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.ZTITLE2 IS NOT NULL\") do |row|\n rip_folder(row[\"Z_PK\"])\n end\n end\n\n # In legacy Notes the \"folders\" were \"stores\"\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZSTORE.Z_PK FROM ZSTORE\") do |row|\n rip_folder(row[\"Z_PK\"])\n end\n end\n\n # Loop over all folders to do some clean up\n @folders.each_pair do |key, folder|\n if folder.is_orphan?\n tmp_parent_folder = get_folder(folder.parent_id)\n tmp_parent_folder.add_child(folder)\n @logger.debug(\"Rip Folder: Added folder #{folder.full_name} as child to #{tmp_parent_folder.name}\")\n end\n\n @logger.debug(\"Rip Folders final array: #{key} corresponds to #{folder.name}\")\n end\n\n # Sort the folders if we want to retain the order, group each account together\n if @retain_order\n @folders = @folders.sort_by{|folder_id, folder| [folder.account.sort_order_name, folder.sort_order]}.to_h\n\n # Also organize the child folders nicely\n @folders.each do |folder_id, folder|\n folder.sort_children\n end\n end\n\n end","title":""},{"docid":"3f9851aa30ccc642b40d1ef4c7678019","score":"0.45056257","text":"def to_up_notes(raw_notes)\n raw_notes.present? ? { Other: raw_notes } : {}\n end","title":""},{"docid":"745ce8cefd719ce65721ed57fb787e4c","score":"0.45007017","text":"def note\n qry = ActiveRDF::Query.new(Note).select(:note).distinct\n qry.where(:note, N::DCT.isPartOf, self)\n qry.execute\n end","title":""},{"docid":"8739cf9c7ce88c07df8d7332317ac40a","score":"0.44983882","text":"def note(*note_names)\n midi_values = note_names.map { |name| Midishark::Notes.note(name) }\n @notes << midi_values\n\n midi_values\n end","title":""},{"docid":"29a43073cffa29e047111f29f1c29bd4","score":"0.44842312","text":"def note_contents=(notes)\n \tnotes.each do |content|\n \t\tself.notes << Note.find_or_create_by(content: content) unless content == \"\"\n \tend\n end","title":""},{"docid":"a042ff59795604858c4378fcb6fe966f","score":"0.44800803","text":"def note_contents\n self.notes.map(&:content)\n end","title":""},{"docid":"a042ff59795604858c4378fcb6fe966f","score":"0.44800803","text":"def note_contents\n self.notes.map(&:content)\n end","title":""},{"docid":"3ab6946f9cba6480aac23f281bd6593d","score":"0.4479658","text":"def my_notes\n device = params.permit(:device_id)\n render json: GeoNote.where(device_id: device[:device_id]).all\n end","title":""},{"docid":"457fe39d947395d2f659b19f700ea8df","score":"0.44749704","text":"def index\n @food_notes = FoodNote.all\n end","title":""},{"docid":"3c071deb5362fbf3e9d1bccf260265ac","score":"0.44705042","text":"def note_contents=(notes)\n notes.each do |content|\n if content.strip != '' # => ignores blank notes\n self.notes.build(content: content) \n end\n end\n end","title":""},{"docid":"586811b650fdd34c0f72a565ca67ce51","score":"0.44577235","text":"def test_form_notes_parts\n # no template and no notes\n obs = observations(:minimal_unknown_obs)\n parts = [\"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # no template and Other notes\n obs = observations(:detailed_unknown_obs)\n parts = [\"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # no template and orphaned notes\n obs = observations(:substrate_notes_obs)\n parts = %w[substrate Other]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # no template, and orphaned notes and Other notes\n obs = observations(:substrate_and_other_notes_obs)\n parts = %w[substrate Other]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and no notes\n obs = observations(:templater_noteless_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and other notes\n obs = observations(:templater_other_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and orphaned notes\n obs = observations(:templater_orphaned_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"orphaned_caption\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part\n obs = observations(:template_only_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part and Other notes\n obs = observations(:template_and_other_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part and orphaned part\n obs = observations(:template_and_orphaned_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"orphaned_caption\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part, orphaned part, Other,\n # with order scrambled in the Observation\n obs = observations(:template_and_orphaned_notes_scrambled_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"orphaned_caption_1\",\n \"orphaned_caption_2\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n end","title":""},{"docid":"f9dcfc05ab39c52954e7224bcd1c9f2c","score":"0.44367728","text":"def show\n @notifications = Notification.where(user: current_user).where(notification_obeject_id: params[:id]).where(read: false)\n @notifications.each do |note|\n note.read = true\n note.save\n end\n end","title":""},{"docid":"ec757ba0856c0472ac0558cb2cafae12","score":"0.44350284","text":"def add_note(identifier, body, opts = {})\n data, _status_code, _headers = add_note_with_http_info(identifier, body, opts)\n return data\n end","title":""},{"docid":"1e21106848f00f9306b4e06f28e2f2d4","score":"0.44339812","text":"def to_note_offs(*args)\n notes = [args.dup].flatten\n options = notes.last.kind_of?(Hash) ? notes.pop : {}\n notes.map do |note|\n case note\n when String then string_to_note_off(note, options) if note?(note)\n when MIDIMessage::NoteOff then note\n when MIDIMessage::NoteOn then note.to_note_off\n end\n end\n end","title":""},{"docid":"9f546c117174a2042d53de0dcd72f619","score":"0.44297847","text":"def extract_references(hackney_note)\n WorkOrderReferenceFinder\n .new(hackney_note.work_order_reference)\n .find(hackney_note.text || \"\")\n end","title":""},{"docid":"d74d2752ee1f2e18dbddc7189548be07","score":"0.44195843","text":"def note_contents\n self.notes.collect {|note| note.content}\n end","title":""},{"docid":"8c8baa457d52023920796a219ecf5249","score":"0.4418533","text":"def get_notes_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NotesApi#get_notes ...\"\n end\n \n # resource path\n path = \"/Notes\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'brief'] = opts[:'brief'] if opts[:'brief']\n query_params[:'skip'] = opts[:'skip'] if opts[:'skip']\n query_params[:'top'] = opts[:'top'] if opts[:'top']\n query_params[:'count_total'] = opts[:'count_total'] if opts[:'count_total']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NotesApi#get_notes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end","title":""},{"docid":"124db484a0c5a8f96feeb1b0420857dd","score":"0.4417622","text":"def note_contents\n self.notes.collect do |note|\n note.content\n end\n end","title":""},{"docid":"5312483799e46864f56e21d4a5e12d9f","score":"0.44163337","text":"def set_notes\n user_notes = current_user.notes\n @notes = user_notes.where.not(id: nil)\n @new_note = action_name != 'create' ? user_notes.build : user_notes.build(note_params)\n end","title":""},{"docid":"e00ddf8104349573959c48686965f863","score":"0.4416101","text":"def index\n @product_notes = ProductNote.all\n end","title":""},{"docid":"daac3d252e14d22b69d2454b4dffa12c","score":"0.44030166","text":"def note_contents\n self.notes.collect {|note| note.content }\n end","title":""},{"docid":"6e6cb2370d766c5953e4674ac49b8302","score":"0.4400299","text":"def find_notes_by_user(user) \n notable = ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s\n \n Note.find(:all,\n :conditions => [\"user_id = ? and notable_type = ?\", user.id, notable],\n :order => \"created_at DESC\"\n )\n end","title":""},{"docid":"eef7d65a47bdc252de56d24c7192fe19","score":"0.43965626","text":"def all_attachments notes=nil\n if notes == nil\n notes = self.notes.collect{|note| note.id}\n NoteAttachment.where(note_id: notes, is_archive:false).order(\"id DESC\")\n else\n NoteAttachment.where(note_id: notes, is_archive:false).order(\"id DESC\")\n end\n end","title":""},{"docid":"ecdc9054e1762134c0886499dc74f092","score":"0.4392893","text":"def si_update_selects_from_note\n o = params[:o]\n project_id = 0\n work_order_id = 0\n charge_account_id = 0\n store_id = 0\n payment_method_id = 0\n if o != '0'\n @receipt_note = ReceiptNote.find(o)\n if @receipt_note.blank?\n @note_items = []\n @projects = projects_dropdown\n @work_orders = work_orders_dropdown\n @charge_accounts = projects_charge_accounts(@projects)\n @stores = stores_dropdown\n @payment_methods = payment_methods_dropdown\n else\n @note_items = note_items_dropdown(@receipt_note)\n @projects = @receipt_note.project.blank? ? [] : Project.where(id: @receipt_note.project.id)\n @work_orders = @receipt_note.work_order.blank? ? [] : WorkOrder.where(id: @receipt_note.work_order.id)\n @charge_accounts = @receipt_note.charge_account.blank? ? [] : ChargeAccount.where(id: @receipt_note.charge_account.id)\n @stores = @receipt_note.store\n @payment_methods = @receipt_note.payment_method\n end\n if @note_items.blank?\n @products = @receipt_note.blank? ? products_dropdown : @receipt_note.organization.products.order(:product_code)\n else\n @products = @receipt_note.products.group(:product_code)\n end\n project_id = @projects.first.id rescue 0\n work_order_id = @work_orders.first.id rescue 0\n charge_account_id = @charge_accounts.first.id rescue 0\n store_id = @stores.id rescue 0\n payment_method_id = @payment_methods.id rescue 0\n else\n @note_items = []\n @projects = projects_dropdown\n @work_orders = work_orders_dropdown\n @charge_accounts = projects_charge_accounts(@projects)\n @stores = stores_dropdown\n @payment_methods = payment_methods_dropdown\n @products = products_dropdown\n end\n # Work orders array\n @orders_dropdown = @work_orders.blank? ? [] : work_orders_array(@work_orders)\n # Note items array\n @note_items_dropdown = note_items_array(@note_items)\n # Products array\n @products_dropdown = products_array(@products)\n # Setup JSON\n @json_data = { \"project\" => @projects, \"work_order\" => @orders_dropdown,\n \"charge_account\" => @charge_accounts, \"store\" => @stores,\n \"payment_method\" => @payment_methods, \"product\" => @products_dropdown,\n \"project_id\" => project_id, \"work_order_id\" => work_order_id,\n \"charge_account_id\" => charge_account_id, \"store_id\" => store_id,\n \"payment_method_id\" => payment_method_id, \"note_item\" => @note_items_dropdown }\n render json: @json_data\n end","title":""},{"docid":"e719160fb2d547d4f3906df8c9e8145f","score":"0.4392843","text":"def index\n @notes = Note.all\n end","title":""},{"docid":"e719160fb2d547d4f3906df8c9e8145f","score":"0.4392843","text":"def index\n @notes = Note.all\n end","title":""},{"docid":"e719160fb2d547d4f3906df8c9e8145f","score":"0.4392843","text":"def index\n @notes = Note.all\n end","title":""},{"docid":"e719160fb2d547d4f3906df8c9e8145f","score":"0.4392843","text":"def index\n @notes = Note.all\n end","title":""},{"docid":"e719160fb2d547d4f3906df8c9e8145f","score":"0.4392843","text":"def index\n @notes = Note.all\n end","title":""},{"docid":"085cd5963adce0ba65cdce4437f6a449","score":"0.43928266","text":"def notes\n return bad_request unless params[:note_id] and request.format.json? || request.format.js?\n return not_found unless current_note\n @response = {'annotation' => current_note.canonical}\n render_cross_origin_json\n end","title":""},{"docid":"2f7110d93e8f4d1cc8db56988ac1dc35","score":"0.43925986","text":"def index\n @note1s = Note1.all\n end","title":""},{"docid":"ac7fd450eb305f8d6cd9036a76b4bf25","score":"0.43886304","text":"def rip_account(account_id)\n \n # Set the ZSERVERRECORD column to look at\n server_record_column = \"ZSERVERRECORD\"\n server_record_column = server_record_column + \"DATA\" if @version >= 12 # In iOS 11 this was ZSERVERRECORD, in 12 and later it became ZSERVERRECORDDATA\n\n # Set the query\n query_string = \"SELECT ZICCLOUDSYNCINGOBJECT.ZNAME, ZICCLOUDSYNCINGOBJECT.Z_PK, \" + \n \"ZICCLOUDSYNCINGOBJECT.#{server_record_column}, ZICCLOUDSYNCINGOBJECT.ZCRYPTOITERATIONCOUNT, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZCRYPTOVERIFIER, ZICCLOUDSYNCINGOBJECT.ZCRYPTOSALT, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZIDENTIFIER \" +\n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.Z_PK=?\"\n \n # Change the query for legacy IOS\n if @version == IOS_LEGACY_VERSION\n query_string = \"SELECT ZACCOUNT.ZNAME, ZACCOUNT.Z_PK, \" + \n \"ZACCOUNT.ZACCOUNTIDENTIFIER as ZIDENTIFIER \" + \n \"FROM ZACCOUNT \" + \n \"WHERE ZACCOUNT.Z_PK=?\"\n end\n\n # Run the query\n @database.execute(query_string, account_id) do |row|\n \n # Create account object\n tmp_account = AppleNotesAccount.new(row[\"Z_PK\"],\n row[\"ZNAME\"],\n row[\"ZIDENTIFIER\"])\n\n # Add server-side data, if relevant\n tmp_account.add_server_record_data(row[server_record_column]) if row[server_record_column]\n\n # Add cryptographic variables, if relevant\n if row[\"ZCRYPTOVERIFIER\"]\n tmp_account.add_crypto_variables(row[\"ZCRYPTOSALT\"],\n row[\"ZCRYPTOITERATIONCOUNT\"],\n row[\"ZCRYPTOVERIFIER\"])\n end\n @accounts[account_id] = tmp_account\n end \n end","title":""}],"string":"[\n {\n \"docid\": \"a05d7da0cf14ccc6b2597d155f2f5101\",\n \"score\": \"0.6947404\",\n \"text\": \"def rip_notes()\\n if @version >= IOS_VERSION_9\\n @database.execute(\\\"SELECT ZICNOTEDATA.ZNOTE FROM ZICNOTEDATA\\\") do |row|\\n self.rip_note(row[\\\"ZNOTE\\\"])\\n end\\n end\\n\\n if @version == IOS_LEGACY_VERSION\\n @database.execute(\\\"SELECT ZNOTE.Z_PK FROM ZNOTE\\\") do |row|\\n self.rip_note(row[\\\"Z_PK\\\"])\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d597749aa685fcbf27d3037b9cd97e42\",\n \"score\": \"0.6656046\",\n \"text\": \"def rip_all_objects\\n rip_accounts()\\n rip_folders()\\n rip_notes()\\n puts \\\"Updated AppleNoteStore object with #{@notes.length} AppleNotes in #{@folders.length} folders belonging to #{@accounts.length} accounts.\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d597749aa685fcbf27d3037b9cd97e42\",\n \"score\": \"0.6656046\",\n \"text\": \"def rip_all_objects\\n rip_accounts()\\n rip_folders()\\n rip_notes()\\n puts \\\"Updated AppleNoteStore object with #{@notes.length} AppleNotes in #{@folders.length} folders belonging to #{@accounts.length} accounts.\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7500f431afb1f2cffcfb06c71176a202\",\n \"score\": \"0.6416593\",\n \"text\": \"def rip_note(note_id)\\n\\n @logger.debug(\\\"Rip Note: Ripping note from Note ID #{note_id}\\\")\\n\\n # Set the ZSERVERRECORD column to look at\\n server_record_column = \\\"ZSERVERRECORD\\\"\\n server_record_column = server_record_column + \\\"DATA\\\" if @version >= IOS_VERSION_12 # In iOS 11 this was ZSERVERRECORD, in 12 and later it became ZSERVERRECORDDATA\\n\\n # Set the ZSERVERSHARE column to look at\\n server_share_column = \\\"ZSERVERSHARE\\\"\\n server_share_column = server_share_column + \\\"DATA\\\" if @version >= IOS_VERSION_12 # In iOS 11 this was ZSERVERRECORD, in 12 and later it became ZSERVERRECORDDATA\\n\\n folder_field = \\\"ZFOLDER\\\"\\n account_field = \\\"ZACCOUNT7\\\"\\n note_id_field = \\\"ZNOTE\\\"\\n creation_date_field = \\\"ZCREATIONDATE1\\\"\\n \\n # In version 15, what is now in ZACCOUNT7 as of iOS 16 (the account ID) was in ZACCOUNT4\\n if @version == IOS_VERSION_15\\n account_field = \\\"ZACCOUNT4\\\"\\n end\\n\\n # In version 13 and 14, what is now in ZACCOUNT4 as of iOS 15 (the account ID) was in ZACCOUNT3\\n if @version < IOS_VERSION_15\\n account_field = \\\"ZACCOUNT3\\\"\\n end\\n\\n # In iOS 15 it appears ZCREATIONDATE1 moved to ZCREATIONDATE3 for notes\\n if @version > IOS_VERSION_14\\n creation_date_field = \\\"ZCREATIONDATE3\\\"\\n end\\n\\n query_string = \\\"SELECT ZICNOTEDATA.Z_PK, ZICNOTEDATA.ZNOTE, \\\" + \\n \\\"ZICNOTEDATA.ZCRYPTOINITIALIZATIONVECTOR, ZICNOTEDATA.ZCRYPTOTAG, \\\" + \\n \\\"ZICNOTEDATA.ZDATA, ZICCLOUDSYNCINGOBJECT.ZCRYPTOVERIFIER, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZCRYPTOSALT, ZICCLOUDSYNCINGOBJECT.ZCRYPTOITERATIONCOUNT, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZCRYPTOWRAPPEDKEY, ZICCLOUDSYNCINGOBJECT.ZISPASSWORDPROTECTED, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1, ZICCLOUDSYNCINGOBJECT.#{creation_date_field}, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZTITLE1, ZICCLOUDSYNCINGOBJECT.#{account_field}, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZACCOUNT2, ZICCLOUDSYNCINGOBJECT.#{folder_field}, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.#{server_record_column}, ZICCLOUDSYNCINGOBJECT.ZUNAPPLIEDENCRYPTEDRECORD, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.#{server_share_column}, ZICCLOUDSYNCINGOBJECT.ZISPINNED, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZIDENTIFIER \\\" + \\n \\\"FROM ZICNOTEDATA, ZICCLOUDSYNCINGOBJECT \\\" + \\n \\\"WHERE ZICNOTEDATA.ZNOTE=? AND ZICCLOUDSYNCINGOBJECT.Z_PK=ZICNOTEDATA.ZNOTE\\\"\\n\\n # In version 12, what is now in ZACCOUNT3 (the account ID) was in ZACCOUNT2\\n if @version == IOS_VERSION_12\\n account_field = \\\"ZACCOUNT2\\\"\\n end\\n\\n # In version 11, what is now in ZACCOUNT3 was in ZACCOUNT2 and the ZFOLDER field was in a completely separate table\\n if @version == IOS_VERSION_11\\n query_string = \\\"SELECT ZICNOTEDATA.Z_PK, ZICNOTEDATA.ZNOTE, \\\" + \\n \\\"ZICNOTEDATA.ZCRYPTOINITIALIZATIONVECTOR, ZICNOTEDATA.ZCRYPTOTAG, \\\" + \\n \\\"ZICNOTEDATA.ZDATA, ZICCLOUDSYNCINGOBJECT.ZCRYPTOVERIFIER, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZCRYPTOSALT, ZICCLOUDSYNCINGOBJECT.ZCRYPTOITERATIONCOUNT, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZCRYPTOWRAPPEDKEY, ZICCLOUDSYNCINGOBJECT.ZISPASSWORDPROTECTED, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1, ZICCLOUDSYNCINGOBJECT.ZCREATIONDATE1, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZTITLE1, ZICCLOUDSYNCINGOBJECT.ZACCOUNT2, \\\" +\\n \\\"Z_11NOTES.Z_11FOLDERS, ZICCLOUDSYNCINGOBJECT.#{server_record_column}, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZUNAPPLIEDENCRYPTEDRECORD, ZICCLOUDSYNCINGOBJECT.#{server_share_column}, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZISPINNED, ZICCLOUDSYNCINGOBJECT.ZIDENTIFIER \\\" + \\n \\\"FROM ZICNOTEDATA, ZICCLOUDSYNCINGOBJECT, Z_11NOTES \\\" + \\n \\\"WHERE ZICNOTEDATA.ZNOTE=? AND ZICCLOUDSYNCINGOBJECT.Z_PK=ZICNOTEDATA.ZNOTE AND Z_11NOTES.Z_8NOTES=ZICNOTEDATA.ZNOTE\\\"\\n folder_field = \\\"Z_11FOLDERS\\\"\\n account_field = \\\"ZACCOUNT2\\\"\\n end\\n\\n # In the legecy version, everything is different\\n if @version == IOS_LEGACY_VERSION\\n query_string = \\\"SELECT ZNOTE.Z_PK, ZNOTE.ZCREATIONDATE as ZCREATIONDATE1, \\\" + \\n \\\"ZNOTE.ZMODIFICATIONDATE as ZMODIFICATIONDATE1, ZNOTE.ZTITLE as ZTITLE1, \\\" + \\n \\\"ZNOTEBODY.ZCONTENT as ZDATA, ZSTORE.Z_PK as ZFOLDER, ZSTORE.ZACCOUNT, \\\" +\\n \\\"0 as ZISPINNED \\\" +\\n \\\"FROM ZNOTE, ZNOTEBODY, ZSTORE \\\" +\\n \\\"WHERE ZNOTE.Z_PK=? AND ZNOTEBODY.Z_PK=ZNOTE.ZBODY AND ZSTORE.Z_PK=ZNOTE.ZSTORE\\\"\\n folder_field = \\\"ZFOLDER\\\"\\n account_field = \\\"ZACCOUNT\\\"\\n note_id_field = \\\"Z_PK\\\"\\n end\\n \\n # Uncomment these lines if we ever think there is weirdness with using the wrong fields for the right version \\n #@logger.debug(\\\"Rip Note: Query string is #{query_string}\\\") \\n #@logger.debug(\\\"Rip Note: account field is #{account_field}\\\")\\n #@logger.debug(\\\"Rip Note: folder field is #{folder_field}\\\")\\n #@logger.debug(\\\"Rip Note: Note ID is #{note_id}\\\")\\n\\n # Execute the query\\n @database.execute(query_string, note_id) do |row|\\n # Create our note\\n tmp_account_id = row[account_field]\\n tmp_folder_id = row[folder_field]\\n @logger.debug(\\\"Rip Note: Looking up account for #{tmp_account_id}\\\")\\n @logger.debug(\\\"Rip Note: Looking up folder for #{tmp_folder_id}\\\")\\n tmp_account = get_account(tmp_account_id)\\n tmp_folder = get_folder(tmp_folder_id)\\n @logger.error(\\\"Rip Note: Somehow could not find account!\\\") if !tmp_account\\n @logger.error(\\\"Rip Note: Somehow could not find folder!\\\") if !tmp_folder\\n tmp_note = AppleNote.new(row[\\\"Z_PK\\\"], \\n row[note_id_field],\\n row[\\\"ZTITLE1\\\"], \\n row[\\\"ZDATA\\\"], \\n row[creation_date_field], \\n row[\\\"ZMODIFICATIONDATE1\\\"],\\n tmp_account,\\n tmp_folder,\\n self)\\n\\n # Set the pinned status\\n if row[\\\"ZISPINNED\\\"] == 1\\n tmp_note.is_pinned = true\\n end\\n\\n # Set the UUID, if it exists\\n if row[\\\"ZIDENTIFIER\\\"]\\n tmp_note.uuid = row[\\\"ZIDENTIFIER\\\"]\\n end\\n\\n tmp_account.add_note(tmp_note) if tmp_account\\n tmp_folder.add_note(tmp_note) if tmp_folder\\n\\n # Add server-side data, if relevant\\n tmp_note.add_cloudkit_server_record_data(row[server_record_column]) if row[server_record_column]\\n\\n if(row[server_share_column]) \\n tmp_note.add_cloudkit_sharing_data(row[server_share_column])\\n\\n # Add any share participants to our overall list\\n tmp_note.share_participants.each do |participant|\\n @cloud_kit_participants[participant.record_id] = participant\\n end\\n end\\n\\n # If this is protected, add the cryptographic variables\\n if row[\\\"ZISPASSWORDPROTECTED\\\"] == 1\\n\\n # Set values initially from the expected columns\\n crypto_iv = row[\\\"ZCRYPTOINITIALIZATIONVECTOR\\\"]\\n crypto_tag = row[\\\"ZCRYPTOTAG\\\"]\\n crypto_salt = row[\\\"ZCRYPTOSALT\\\"]\\n crypto_iterations = row[\\\"ZCRYPTOITERATIONCOUNT\\\"]\\n crypto_verifier = row[\\\"ZCRYPTOVERIFIER\\\"]\\n crypto_wrapped_key = row[\\\"ZCRYPTOWRAPPEDKEY\\\"]\\n\\n # If they aren't there, we need to use the ZUNAPPLIEDENCRYPTEDRECORD\\n\\n if row[\\\"ZUNAPPLIEDENCRYPTEDRECORD\\\"]\\n keyed_archive = KeyedArchive.new(:data => row[\\\"ZUNAPPLIEDENCRYPTEDRECORD\\\"])\\n unpacked_top = keyed_archive.unpacked_top()\\n ns_keys = unpacked_top[\\\"root\\\"][\\\"ValueStore\\\"][\\\"RecordValues\\\"][\\\"NS.keys\\\"]\\n ns_values = unpacked_top[\\\"root\\\"][\\\"ValueStore\\\"][\\\"RecordValues\\\"][\\\"NS.objects\\\"]\\n crypto_iv = ns_values[ns_keys.index(\\\"CryptoInitializationVector\\\")]\\n crypto_tag = ns_values[ns_keys.index(\\\"CryptoTag\\\")]\\n crypto_salt = ns_values[ns_keys.index(\\\"CryptoSalt\\\")]\\n crypto_iterations = ns_values[ns_keys.index(\\\"CryptoIterationCount\\\")]\\n crypto_wrapped_key = ns_values[ns_keys.index(\\\"CryptoWrappedKey\\\")]\\n end\\n\\n tmp_note.add_cryptographic_settings(crypto_iv, \\n crypto_tag, \\n crypto_salt,\\n crypto_iterations,\\n crypto_verifier,\\n crypto_wrapped_key)\\n\\n # Try each password and see if any generate a decrypt.\\n found_password = tmp_note.decrypt\\n\\n if !found_password\\n @logger.debug(\\\"Apple Note Store: Note #{tmp_note.note_id} could not be decrypted with our passwords.\\\")\\n end\\n end\\n \\n # Only add the note if we have both a folder and account for it, otherwise things blow up\\n if tmp_account and tmp_folder\\n @notes[tmp_note.note_id] = tmp_note\\n else\\n @logger.error(\\\"Rip Note: Skipping note #{tmp_note.note_id} due to a missing account.\\\") if !tmp_account\\n @logger.error(\\\"Rip Note: Skipping note #{tmp_note.note_id} due to a missing folder.\\\") if !tmp_folder\\n \\n if !tmp_account or !tmp_folder\\n @logger.error(\\\"Consider running these sqlite queries to take a look yourself, if ZDATA is NULL, that means you aren't missing anything: \\\")\\n @logger.error(\\\"\\\\tSELECT Z_PK, #{account_field}, #{folder_field} FROM ZICCLOUDSYNCINGOBJECT WHERE Z_PK=#{tmp_note.primary_key}\\\")\\n @logger.error(\\\"\\\\tSELECT #{note_id_field}, ZDATA FROM ZICNOTEDATA WHERE #{note_id_field}=#{tmp_note.note_id}\\\")\\n end\\n puts \\\"Skipping Note ID #{tmp_note.note_id} due to a missing folder or account, check the debug log for more details.\\\"\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eea3a7998644754345ff1b9b57f36b37\",\n \"score\": \"0.5797036\",\n \"text\": \"def rip_note(note_id)\\n query_string = \\\"SELECT ZICNOTEDATA.Z_PK, ZICNOTEDATA.ZNOTE, \\\" + \\n \\\"ZICNOTEDATA.ZCRYPTOINITIALIZATIONVECTOR, ZICNOTEDATA.ZCRYPTOTAG, \\\" + \\n \\\"ZICNOTEDATA.ZDATA, ZICCLOUDSYNCINGOBJECT.ZCRYPTOVERIFIER, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZCRYPTOSALT, ZICCLOUDSYNCINGOBJECT.ZCRYPTOITERATIONCOUNT, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZCRYPTOWRAPPEDKEY, ZICCLOUDSYNCINGOBJECT.ZISPASSWORDPROTECTED, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1, ZICCLOUDSYNCINGOBJECT.ZCREATIONDATE1, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZTITLE1, ZICCLOUDSYNCINGOBJECT.ZACCOUNT3, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZACCOUNT2, ZICCLOUDSYNCINGOBJECT.ZFOLDER \\\" + \\n \\\"FROM ZICNOTEDATA, ZICCLOUDSYNCINGOBJECT \\\" + \\n \\\"WHERE ZICNOTEDATA.ZNOTE=? AND ZICCLOUDSYNCINGOBJECT.Z_PK=ZICNOTEDATA.ZNOTE\\\"\\n folder_field = \\\"ZFOLDER\\\"\\n account_field = \\\"ZACCOUNT3\\\"\\n note_id_field = \\\"ZNOTE\\\"\\n\\n # In version 12, what is now in ZACCOUNT3 (the account ID) was in ZACCOUNT2\\n if @version == IOS_VERSION_12\\n account_field = \\\"ZACCOUNT2\\\"\\n end\\n\\n # In version 11, what is now in ZACCOUNT3 was in ZACCOUNT2 and the ZFOLDER field was in a completely separate table\\n if @version == IOS_VERSION_11\\n query_string = \\\"SELECT ZICNOTEDATA.Z_PK, ZICNOTEDATA.ZNOTE, \\\" + \\n \\\"ZICNOTEDATA.ZCRYPTOINITIALIZATIONVECTOR, ZICNOTEDATA.ZCRYPTOTAG, \\\" + \\n \\\"ZICNOTEDATA.ZDATA, ZICCLOUDSYNCINGOBJECT.ZCRYPTOVERIFIER, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZCRYPTOSALT, ZICCLOUDSYNCINGOBJECT.ZCRYPTOITERATIONCOUNT, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZCRYPTOWRAPPEDKEY, ZICCLOUDSYNCINGOBJECT.ZISPASSWORDPROTECTED, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZMODIFICATIONDATE1, ZICCLOUDSYNCINGOBJECT.ZCREATIONDATE1, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZTITLE1, ZICCLOUDSYNCINGOBJECT.ZACCOUNT2, \\\" +\\n \\\"Z_11NOTES.Z_11FOLDERS \\\" + \\n \\\"FROM ZICNOTEDATA, ZICCLOUDSYNCINGOBJECT, Z_11NOTES \\\" + \\n \\\"WHERE ZICNOTEDATA.ZNOTE=? AND ZICCLOUDSYNCINGOBJECT.Z_PK=ZICNOTEDATA.ZNOTE AND Z_11NOTES.Z_8NOTES=ZICNOTEDATA.ZNOTE\\\"\\n folder_field = \\\"Z_11FOLDERS\\\"\\n account_field = \\\"ZACCOUNT2\\\"\\n end\\n\\n # In the legecy version, everything is different\\n if @version == IOS_LEGACY_VERSION\\n query_string = \\\"SELECT ZNOTE.Z_PK, ZNOTE.ZCREATIONDATE as ZCREATIONDATE1, \\\" + \\n \\\"ZNOTE.ZMODIFICATIONDATE as ZMODIFICATIONDATE1, ZNOTE.ZTITLE as ZTITLE1, \\\" + \\n \\\"ZNOTEBODY.ZCONTENT as ZDATA, ZSTORE.Z_PK as ZFOLDER, ZSTORE.ZACCOUNT \\\" +\\n \\\"FROM ZNOTE, ZNOTEBODY, ZSTORE \\\" +\\n \\\"WHERE ZNOTE.Z_PK=? AND ZNOTEBODY.Z_PK=ZNOTE.ZBODY AND ZSTORE.Z_PK=ZNOTE.ZSTORE\\\"\\n folder_field = \\\"ZFOLDER\\\"\\n account_field = \\\"ZACCOUNT\\\"\\n note_id_field = \\\"Z_PK\\\"\\n end\\n\\n # Execute the query\\n @database.execute(query_string, note_id) do |row|\\n # Create our note\\n tmp_account = get_account(row[account_field])\\n tmp_folder = get_folder(row[folder_field])\\n tmp_note = AppleNote.new(row[\\\"Z_PK\\\"], \\n row[note_id_field],\\n row[\\\"ZTITLE1\\\"], \\n row[\\\"ZDATA\\\"], \\n row[\\\"ZCREATIONDATE1\\\"], \\n row[\\\"ZMODIFICATIONDATE1\\\"],\\n tmp_account,\\n tmp_folder,\\n self)\\n tmp_account.add_note(tmp_note) if tmp_account\\n tmp_folder.add_note(tmp_note) if tmp_folder\\n\\n # If this is protected, add the cryptographic variables\\n if row[\\\"ZISPASSWORDPROTECTED\\\"] == 1\\n tmp_note.add_cryptographic_settings(row[\\\"ZCRYPTOINITIALIZATIONVECTOR\\\"], \\n row[\\\"ZCRYPTOTAG\\\"], \\n row[\\\"ZCRYPTOSALT\\\"],\\n row[\\\"ZCRYPTOITERATIONCOUNT\\\"],\\n row[\\\"ZCRYPTOVERIFIER\\\"],\\n row[\\\"ZCRYPTOWRAPPEDKEY\\\"])\\n #tmp_note.decrypt_with_password(\\\"password\\\")\\n end\\n @notes[tmp_note.note_id] = tmp_note\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6d37d05d1d135824ff16b1a79281cafe\",\n \"score\": \"0.5628156\",\n \"text\": \"def handle_notes(notes)\\n\\n notes.each do |note|\\n\\n prefix = case note['type']\\n when 'dimensions'; \\\"Dimensions\\\"\\n when 'physdesc'; \\\"Physical Description note\\\"\\n when 'materialspec'; \\\"Material Specific Details\\\"\\n when 'physloc'; \\\"Location of resource\\\"\\n when 'phystech'; \\\"Physical Characteristics / Technical Requirements\\\"\\n when 'physfacet'; \\\"Physical Facet\\\"\\n #when 'processinfo'; \\\"Processing Information\\\"\\n when 'separatedmaterial'; \\\"Materials Separated from the Resource\\\"\\n else; nil\\n end\\n\\n marc_args = case note['type']\\n\\n when 'arrangement', 'fileplan'\\n ['351', 'a']\\n # Remove processinfo from 500\\n when 'odd', 'dimensions', 'physdesc', 'materialspec', 'physloc', 'phystech', 'physfacet', 'separatedmaterial'\\n ['500','a']\\n # we would prefer that information from both the note and subnote appear in subfields of a 506 element, like this:\\n # \\n # Restricted until 2020 \\n # Available \\n # \\n when 'accessrestrict'\\n ind1 = note['publish'] ? '1' : '0'\\n if note['publish'] || @include_unpublished\\n if note['rights_restriction']\\n result = note['rights_restriction']['local_access_restriction_type']\\n if result != []\\n result.each do |lart|\\n df('506', ind1).with_sfs(['a', note['subnotes'][0]['content']], ['f', lart])\\n end\\n else\\n df('506', ind1).with_sfs(['a', note['subnotes'][0]['content']])\\n end\\n else\\n ['506', ind1 ,'', 'a']\\n end\\n end\\n when 'scopecontent'\\n ['520', '2', ' ', 'a']\\n when 'abstract'\\n ['520', '3', ' ', 'a']\\n when 'prefercite'\\n ['524', ' ', ' ', 'a']\\n when 'acqinfo'\\n ind1 = note['publish'] ? '1' : '0'\\n ['541', ind1, ' ', 'a']\\n when 'relatedmaterial'\\n ['544','d']\\n when 'bioghist'\\n ['545','a']\\n when 'custodhist'\\n ind1 = note['publish'] ? '1' : '0'\\n ['561', ind1, ' ', 'a']\\n # Add processinfo to 583\\n when 'appraisal', 'processinfo'\\n ind1 = note['publish'] ? '1' : '0'\\n ['583', ind1, ' ', 'a']\\n when 'accruals'\\n ['584', 'a']\\n when 'altformavail'\\n ['535', '2', ' ', 'a']\\n when 'originalsloc'\\n ['535', '1', ' ', 'a']\\n when 'userestrict', 'legalstatus'\\n ['540', 'a']\\n when 'langmaterial'\\n ['546', 'a']\\n else\\n nil\\n end\\n\\n unless marc_args.nil?\\n text = prefix ? \\\"#{prefix}: \\\" : \\\"\\\"\\n text += ASpaceExport::Utils.extract_note_text(note, @include_unpublished)\\n\\n # only create a tag if there is text to show (e.g., marked published or exporting unpublished) and if there are not multiple local access restriction types (if there are, that's already handled above)\\n unless note['type'] == 'accessrestrict' && note['rights_restriction']\\n if text.length > 0\\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\\n end\\n end\\n end\\n\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"844527f1e622696053e85f49479614d8\",\n \"score\": \"0.55514646\",\n \"text\": \"def handle_notes(notes)\\n\\n notes.each do |note|\\n\\n prefix = case note['type']\\n when 'dimensions'; \\\"Dimensions\\\"\\n when 'physdesc'; \\\"Physical Description note\\\"\\n when 'materialspec'; \\\"Material Specific Details\\\"\\n when 'physloc'; \\\"Location of resource\\\"\\n when 'phystech'; \\\"Physical Characteristics / Technical Requirements\\\"\\n when 'physfacet'; \\\"Physical Facet\\\"\\n when 'processinfo'; \\\"Processing Information\\\"\\n when 'separatedmaterial'; \\\"Materials Separated from the Resource\\\"\\n else; nil\\n end\\n\\n marc_args = case note['type']\\n\\n when 'arrangement', 'fileplan'\\n ['351', 'b']\\n when 'odd', 'dimensions', 'physdesc', 'materialspec', 'physloc', 'phystech', 'physfacet', 'processinfo', 'separatedmaterial'\\n ['500','a']\\n when 'accessrestrict'\\n ['506','a']\\n #when 'scopecontent'\\n #['520', '2', ' ', 'a']\\n when 'abstract'\\n ['520', '3', ' ', 'a']\\n when 'prefercite'\\n ['524', '8', ' ', 'a']\\n when 'acqinfo'\\n ind1 = note['publish'] ? '1' : '0'\\n ['541', ind1, ' ', 'a']\\n when 'relatedmaterial'\\n ['544','n']\\n #when 'bioghist'\\n #['545','a']\\n when 'custodhist'\\n ind1 = note['publish'] ? '1' : '0'\\n ['561', ind1, ' ', 'a']\\n when 'appraisal'\\n ind1 = note['publish'] ? '1' : '0'\\n ['583', ind1, ' ', 'a']\\n when 'accruals'\\n ['584', 'a']\\n when 'altformavail'\\n ['535', '2', ' ', 'a']\\n when 'originalsloc'\\n ['535', '1', ' ', 'a']\\n when 'userestrict', 'legalstatus'\\n ['540', 'a']\\n when 'langmaterial'\\n ['546', 'a']\\n when 'otherfindaid'\\n ['555', '0', ' ', 'a']\\n else\\n nil\\n end\\n\\n unless marc_args.nil?\\n text = prefix ? \\\"#{prefix}: \\\" : \\\"\\\"\\n text += ASpaceExport::Utils.extract_note_text(note, @include_unpublished, true)\\n\\n # only create a tag if there is text to show (e.g., marked published or exporting unpublished)\\n if text.length > 0\\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\\n end\\n end\\n\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"350575c7a510c9c04a18ddeb1ae62e2e\",\n \"score\": \"0.5527494\",\n \"text\": \"def handle_agent_notes(notes)\\n notes.each do |note|\\n prefix = case note['jsonmodel_type']\\n when 'note_dimensions'; \\\"Dimensions\\\"\\n when 'note_physdesc'; \\\"Physical Description note\\\"\\n when 'note_materialspec'; \\\"Material Specific Details\\\"\\n when 'note_physloc'; \\\"Location of resource\\\"\\n when 'note_phystech'; \\\"Physical Characteristics / Technical Requirements\\\"\\n when 'note_physfacet'; \\\"Physical Facet\\\"\\n when 'note_processinfo'; \\\"Processing Information\\\"\\n when 'note_separatedmaterial'; \\\"Materials Separated from the Resource\\\"\\n else; nil\\n end\\n\\n marc_args = case note['jsonmodel_type']\\n\\n when 'arrangement', 'fileplan'\\n ['351','b']\\n when 'note_odd', 'note_dimensions', 'note_physdesc', 'note_materialspec', 'note_physloc',\\n 'note_phystech', 'note_physfacet', 'note_processinfo', 'note_separatedmaterial'\\n ['500','a']\\n when 'accessrestrict'\\n ['506','a']\\n when 'note_scopecontent'\\n ['520', '2', ' ', 'a']\\n when 'note_abstract'\\n #check settings for enabling tag 520 and indicator 3\\n if(MarcExportSettings.m_export_settings['tag_520_ind1_3'])\\n ['520', '3', ' ', 'a']\\n end\\n when 'note_prefercite'\\n ['524', ' ', ' ', 'a']\\n when 'note_acqinfo'\\n ind1 = note['publish'] ? '1' : '0'\\n ['541', ind1, ' ', 'a']\\n when 'note_relatedmaterial'\\n ['544','a']\\n when 'note_bioghist'\\n ['545', '1', ' ','a']\\n when 'note_custodhist'\\n ind1 = note['publish'] ? '1' : '0'\\n ['561', ind1, ' ', 'a']\\n when 'note_appraisal'\\n ind1 = note['publish'] ? '1' : '0'\\n ['583', ind1, ' ', 'a']\\n when 'note_accruals'\\n ['584', 'a']\\n when 'note_altformavail'\\n ['535', '2', ' ', 'a']\\n when 'note_originalsloc'\\n ['535', '1', ' ', 'a']\\n when 'note_userestrict', 'note_legalstatus'\\n ['540', 'a']\\n when 'note_langmaterial'\\n ['546', 'a']\\n else\\n nil\\n end\\n\\n unless marc_args.nil?\\n if handle_settings(marc_args)\\n text = prefix ? \\\"#{prefix}: \\\" : \\\"\\\"\\n #Strip hard returns\\n if(MarcExportSettings.m_export_settings['tag_ss_1'])\\n text += ASpaceExport::Utils.extract_note_text(note).delete(\\\"\\\\n\\\")\\n else\\n text += ASpaceExport::Utils.extract_note_text(note)\\n end\\n #add access restriction\\n if(marc_args[0] == '506')\\n if( MarcExportSettings.m_export_settings['tag_506_sc_a_ss_1'])\\n urls = text.scan(/(?:http|https):\\\\/\\\\/[a-z0-9]+(?:[\\\\-\\\\.]{1}[a-z0-9]+)*\\\\.[a-z]{2,5}(?:(?::[0-9]{1,5})?\\\\/[^\\\\s]*)?/ix)\\n unless urls.empty?\\n text = text.gsub(/(\\\\. )[\\\\s\\\\S]*/, '. This collection has been digitized and is available online.')\\n ead_text = if MarcExportSettings.m_export_settings['tag_856_ss_1'].nil? then MarcExportSettings.m_export_settings['tag_856_ss_1'] else \\\"Finding aid online:\\\" end\\n df('856', '4', '2').with_sfs(\\n ['z', ead_text],\\n ['u', urls[0].chomp(\\\".\\\")]\\n )\\n end\\n end\\n end\\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\\n end\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"329c570ea4ec27545f0a6e4085967d8f\",\n \"score\": \"0.5433903\",\n \"text\": \"def process_notes_array(array_of_id)\\n notes = []\\n array_of_id.each do |d|\\n notes << Note.find(d[0].to_i)\\n end\\n notes\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5bad48136418b38dbdd61e1be805f5e5\",\n \"score\": \"0.53568745\",\n \"text\": \"def handle_notes(notes)\\n\\n notes.each do |note|\\n\\n prefix = case note['type']\\n when 'dimensions'; \\\"Dimensions\\\"\\n when 'physdesc'; \\\"Physical Description note\\\"\\n when 'materialspec'; \\\"Material Specific Details\\\"\\n when 'physloc'; \\\"Location of resource\\\"\\n when 'phystech'; \\\"Physical Characteristics / Technical Requirements\\\"\\n when 'physfacet'; \\\"Physical Facet\\\"\\n when 'processinfo'; \\\"Processing Information\\\"\\n when 'separatedmaterial'; \\\"Materials Separated from the Resource\\\"\\n else; nil\\n end\\n\\n #20160829LJD: Add additional note types for export.\\n marc_args = case note['type']\\n\\n when 'arrangement', 'fileplan'\\n ['351','b']\\n when 'odd', 'dimensions', 'physdesc', 'materialspec', 'physloc', 'phystech', 'physfacet', 'processinfo', 'separatedmaterial'\\n ['500','a']\\n when 'accessrestrict'\\n ['506','a']\\n # when 'scopecontent'\\n # ['520', '2', ' ', 'a']\\n when 'abstract'\\n ['520', '3', ' ', 'a']\\n when 'prefercite'\\n ['524', '8', ' ', 'a']\\n when 'acqinfo'\\n ind1 = note['publish'] ? '1' : '0'\\n ['541', ind1, ' ', 'a']\\n when 'relatedmaterial'\\n ['544','n']\\n # when 'bioghist'\\n # ['545','a']\\n when 'custodhist'\\n ind1 = note['publish'] ? '1' : '0'\\n ['561', ind1, ' ', 'a']\\n when 'appraisal'\\n ind1 = note['publish'] ? '1' : '0'\\n ['583', ind1, ' ', 'a']\\n when 'accruals'\\n ['584', 'a']\\n when 'altformavail'\\n ['535', '2', ' ', 'a']\\n when 'originalsloc'\\n ['535', '1', ' ', 'a']\\n when 'userestrict', 'legalstatus'\\n ['540', 'a']\\n when 'langmaterial'\\n ['546', 'a']\\n # when 'otherfindaid'\\n # ['555', '0', ' ', 'a']\\n else\\n nil\\n end\\n\\n unless marc_args.nil?\\n text = prefix ? \\\"#{prefix}: \\\" : \\\"\\\"\\n text += ASpaceExport::Utils.extract_note_text(note, @include_unpublished, true)\\n\\n # only create a tag if there is text to show (e.g., marked published or exporting unpublished)\\n if text.length > 0\\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\\n end\\n end\\n\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2ab2a5c7ca73f821a700c2e53c3b3461\",\n \"score\": \"0.53344345\",\n \"text\": \"def list_notes\\n notes = if unsafe_params[:editable]\\n Note.editable_by(@context).where.not(title: nil).accessible_by_private\\n else\\n Note.accessible_by(@context).where.not(title: nil)\\n end\\n\\n if unsafe_params[:scopes].present?\\n check_scope!\\n notes = notes.where(scope: unsafe_params[:scopes])\\n end\\n\\n if unsafe_params[:note_types].present?\\n fail \\\"Param note_types can only be an Array of Strings containing 'Note', 'Answer', or 'Discussion'\\\" unless unsafe_params[:note_types].is_a?(Array) && unsafe_params[:note_types].all? { |type| %w(Note Answer Discussion).include?(type) }\\n\\n note_types = unsafe_params[:note_types].map { |type| type == \\\"Note\\\" ? nil : type }\\n notes = notes.where(note_type: note_types)\\n end\\n\\n result = notes.order(id: :desc).map do |note|\\n if note.note_type == \\\"Discussion\\\"\\n note = note.discussion\\n elsif note.note_type == \\\"Answer\\\"\\n note = note.answer\\n end\\n describe_for_api(note, unsafe_params[:describe])\\n end\\n\\n render json: result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1b8013903bb453269825a77770e26973\",\n \"score\": \"0.5314009\",\n \"text\": \"def note\\n comment_list = []\\n return @notes if !@notes.nil?\\n for page in @pages\\n next if !page || !page.list || page.list.size <= 0\\n note_page = page.list.dup\\n \\n note_page.each do |item|\\n next unless item && (item.code == 108 || item.code == 408)\\n comment_list.push(item.parameters[0])\\n end\\n end\\n @notes = comment_list.join(\\\"\\\\r\\\\n\\\")\\n return @notes\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7cf69ecb11ebebf2a0007d4ab4cd33f4\",\n \"score\": \"0.5301912\",\n \"text\": \"def notes(params = {})\\n @notes ||= MailchimpAPI::Note.find(:all, params: { member_id: id }.deep_merge(prefix_options).deep_merge(params))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1a3925ac7ed4ab1530d8607e808b3c25\",\n \"score\": \"0.5235186\",\n \"text\": \"def serialize_did_notes(data, xml, fragments)\\n data.notes.each do |note|\\n next if note[\\\"publish\\\"] === false && !@include_unpublished\\n next unless data.did_note_types.include?(note['type']) # and note[\\\"publish\\\"] == true)\\n\\n audatt = note[\\\"publish\\\"] === false ? {:audience => 'internal'} : {}\\n content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)\\n\\n att = { :id => prefix_id(note['persistent_id']) }.reject {|k,v| v.nil? || v.empty? || v == \\\"null\\\" }\\n att ||= {}\\n\\n case note['type']\\n when 'dimensions', 'physfacet'\\n xml.physdesc(audatt) {\\n #xml.physdesc {\\n xml.send(note['type'], att) {\\n sanitize_mixed_content( content, xml, fragments, ASpaceExport::Utils.include_p?(note['type']) )\\n }\\n }\\n else\\n xml.send(note['type'], att) {\\n sanitize_mixed_content(content, xml, fragments,ASpaceExport::Utils.include_p?(note['type']))\\n }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fedcb899bf7a163ce0e9231af1c1ec3e\",\n \"score\": \"0.5234678\",\n \"text\": \"def notes params=nil\\n @nimble.get \\\"contact/#{self.id}/notes\\\", params\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b06abe78a177acc64c85a8971d9048c0\",\n \"score\": \"0.5226792\",\n \"text\": \"def serialize_did_notes(data, xml, fragments)\\n data.notes.each do |note|\\n next if note[\\\"publish\\\"] === false && !@include_unpublished\\n next unless (data.did_note_types.include?(note['type']) and note[\\\"publish\\\"] == true)\\n\\n #audatt = note[\\\"publish\\\"] === false ? {:audience => 'internal'} : {}\\n content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)\\n\\n att = { :id => prefix_id(note['persistent_id']) }.reject {|k,v| v.nil? || v.empty? || v == \\\"null\\\" }\\n att ||= {}\\n\\n case note['type']\\n when 'dimensions', 'physfacet'\\n #xml.physdesc(audatt) {\\n xml.physdesc {\\n xml.send(note['type'], att) {\\n sanitize_mixed_content( content, xml, fragments, ASpaceExport::Utils.include_p?(note['type']) )\\n }\\n }\\n else\\n xml.send(note['type'], att) {\\n sanitize_mixed_content(content, xml, fragments,ASpaceExport::Utils.include_p?(note['type']))\\n }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f19efcada8120b00bf0fb31838c2b6de\",\n \"score\": \"0.51787525\",\n \"text\": \"def notes( params={} )\\n notes = get_connections(\\\"notes\\\", params)\\n return map_connections notes, :to => Facebook::Graph::Note\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"152f357d76a68883ca5fec849d491a5b\",\n \"score\": \"0.511587\",\n \"text\": \"def update_note(update_octave=true) # Update_octave=false used in generative parsing\\n if self[:pc]\\n self.merge!(get_ziff(self[:pc], self[:key], self[:scale],(update_octave ? (self[:octave] || 0) : false),(self[:add] || 0)))\\n elsif self[:hpcs]\\n notes = []\\n self[:hpcs].each do |d|\\n pc = d[:pc]\\n notes.push(get_note_from_dgr(pc, d[:key], d[:scale], (d[:octave] || 0)) + (self[:add] || 0))\\n end\\n self[:pcs] = self[:hpcs].map {|h| h[:pc] }\\n self[:notes] = notes\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bf521b5955a6a7748df7dd30e3095585\",\n \"score\": \"0.5102217\",\n \"text\": \"def show_all_notes(db)\\n notes = server.get_index\\n notes.each do |note|\\n note = server.get_note(note[\\\"key\\\"])\\n show_note(note)\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"25a264d172c3c4fc746a348a360bdb68\",\n \"score\": \"0.5092266\",\n \"text\": \"def _Notes\\n while true\\n\\n _save1 = self.pos\\n while true # choice\\n _tmp = apply(:_Note)\\n break if _tmp\\n self.pos = _save1\\n _tmp = apply(:_SkipBlock)\\n break if _tmp\\n self.pos = _save1\\n break\\n end # end choice\\n\\n break unless _tmp\\n end\\n _tmp = true\\n set_failed_rule :_Notes unless _tmp\\n return _tmp\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"18b1f7b1ed2316439d62ca427df616b8\",\n \"score\": \"0.5091866\",\n \"text\": \"def fix_notes(condensed)\\n\\t condensed.each do |loc|\\n\\t ##Rails.logger.debug \\\"\\\\nes287_debug line(#{__LINE__}) location=#{loc['location_name']} #{loc['call_number']}\\\\n\\\"\\n\\t ##Rails.logger.debug \\\"\\\\nes287_debug line(#{__LINE__}) copies = \\\" + loc[\\\"copies\\\"][0].count.inspect\\n\\t if !loc[\\\"copies\\\"][0][\\\"items\\\"][\\\"Not Available\\\"].blank? and loc[\\\"copies\\\"][0][\\\"items\\\"][\\\"Not Available\\\"][\\\"status\\\"] == 'none'\\n\\t ##Rails.logger.debug \\\"\\\\nes287_debug line(#{__LINE__}) seems like there are no items, so copy notes,etc.\\\"\\n\\t ['orders','summary_holdings','supplements','indexes','notes',\\n\\t\\t 'reproduction_note','current_issues'].each do |type|\\n\\t\\tloc[\\\"copies\\\"][0][type] = loc[type] unless loc[type].blank?\\n\\t end\\n\\t end\\n\\t end\\n\\t condensed\\n\\t end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"33fd1a8450e7bc8abffce4f0121b878e\",\n \"score\": \"0.50192636\",\n \"text\": \"def attach_to_notes\\n items = unsafe_params[:items]\\n note_uids = unsafe_params[:note_uids]\\n\\n unless note_uids.all? { |uid| uid =~ /^(note|discussion|answer)-(\\\\d+)$/ }\\n fail \\\"Parameter 'note_uids' need to be an Array of Note, Answer, or Discussion uids\\\"\\n end\\n\\n valid_items =\\n items.all? do |item|\\n item[:id].is_a?(Numeric) &&\\n item[:type].is_a?(String) &&\\n %w(App Asset Comparison Job UserFile).include?(item[:type])\\n end\\n\\n unless valid_items\\n fail \\\"Items need to be an array of objects with id and type \\\" \\\\\\n \\\"(one of App, Comparison, Job, UserFile or Asset)\\\"\\n end\\n\\n notes_added = {}\\n items_added = {}\\n\\n Note.transaction do\\n note_uids.each do |note_uid|\\n note_item = item_from_uid(note_uid)\\n\\n next unless note_item&.editable_by?(@context)\\n\\n items.each do |item|\\n item[:type] = if item[:type].blank?\\n item[:className] == \\\"file\\\" ? \\\"UserFile\\\" : item[:className].capitalize\\n else\\n item[:type]\\n end\\n\\n note_item.attachments.find_or_create_by(item_id: item[:id], item_type: item[:type])\\n items_added[\\\"#{item[:type]}-#{item[:id]}\\\"] = true\\n end\\n\\n notes_added[note_uid] = true\\n note_item.save\\n end\\n end\\n\\n render json: {\\n notes_added: notes_added,\\n items_added: items_added,\\n }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"39757d754f979c4ab775e746727e79c2\",\n \"score\": \"0.49999955\",\n \"text\": \"def index\\n @internal_notes = InternalNote.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c9ad4b90c6ce202713e61ba5893b61f0\",\n \"score\": \"0.49996296\",\n \"text\": \"def starred_notes\\n fetch_notes_for nil, true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"077086131fee62b038dc117cb2036e66\",\n \"score\": \"0.49352357\",\n \"text\": \"def notes\\n\\t\\tall.map do |tone|\\n\\t\\t\\tKey.from_index(tone.tone, tone.letter_index).name\\n\\t\\tend.extend(NoteSequence)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c015c9569c5462734e7ec6527570ddf\",\n \"score\": \"0.49332568\",\n \"text\": \"def note(id)\\n @contacts.each do |contact|\\n if contact.id == id\\n contact.notes.clear\\n contact.notes << @note.input\\n contact.notes.flatten!\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"31e6990120e2de80f80314a0a757652b\",\n \"score\": \"0.4922506\",\n \"text\": \"def notes(options = {})\\n # Create a default 2 item hash and update if options is supplied\\n options = {\\n id: nil,\\n type: nil\\n }.update(options)\\n return nil if @_notes.nil?\\n return nil if @_notes.empty?\\n\\n # Empty 2-D Hash to be used for notes found based on id and type\\n notes_found = Hash.new do |h, k|\\n # h is the id portion of the hash\\n # k is the type portion of the hash\\n h[k] = {}\\n end\\n # Filter @notes based off of the id\\n filter_hash(@_notes, options[:id]).each do |id, hash|\\n # Filter hash based off of the type\\n filter_hash(hash, options[:type]).each do |type, note|\\n # Store the note into note_found\\n notes_found[id][type] = note\\n end\\n end\\n if notes_found.empty?\\n nil\\n elsif notes_found.size == 1\\n notes_found.values.first.values.first\\n else\\n notes_found\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"de2d396a17cc37b8d623aebe405c4bdb\",\n \"score\": \"0.49176878\",\n \"text\": \"def notes\\n\\t\\tNote.find(:all)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e48f18d3ddb20786e47d6e3f53d52cc\",\n \"score\": \"0.48964486\",\n \"text\": \"def inferred_notes\\n if scrubbed_notes?\\n Rails.logger.debug \\\"not replacing scrubbed notes\\\"\\n head_notes\\n notes\\n elsif head_notes.present?\\n head_notes\\n elsif notes.present? && ff?\\n Rails.logger.debug \\\"not deleting old ff notes\\\"\\n head_notes\\n notes\\n else\\n head_notes\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c0d198cf4116c6da48e61761ba608e28\",\n \"score\": \"0.48726588\",\n \"text\": \"def list_notes(identifier, opts = {})\\n data, _status_code, _headers = list_notes_with_http_info(identifier, opts)\\n return data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2a4b9b1c20a5403dc375ea3c85cb4ba0\",\n \"score\": \"0.48549536\",\n \"text\": \"def cat\\n unless encrypted_notes.empty?\\n print_notes(:encrypted => true)\\n decrypted_notes = @cipher.decrypt_files(encrypted_notes)\\n end\\n\\n matching_notes.each do |note_path|\\n contents = \\\\\\n if FuzzyNotes::Cipher.encrypted?(note_path)\\n decrypted_notes.shift\\n elsif FuzzyNotes::EvernoteSync.evernote?(note_path)\\n FuzzyNotes::EvernoteSync.sanitize_evernote(note_path)\\n elsif FuzzyNotes::ImageViewer.image?(note_path)\\n FuzzyNotes::ImageViewer.display(@viewer, note_path)\\n else\\n FuzzyNotes::TextViewer.read(note_path)\\n end\\n\\n if contents\\n log.info \\\"=== #{note_path} ===\\\\n\\\\n\\\"\\n puts \\\"#{contents}\\\\n\\\"\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dc6756a9c1cf8cf1c2d76a68b9faf1fb\",\n \"score\": \"0.48425448\",\n \"text\": \"def list_case_notes\\n\\t\\t@case_notes = CaseNote.where(case_id: params[:case_id])\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cdbdaab15d1f9ee0699bb2eb6431cb5d\",\n \"score\": \"0.48034608\",\n \"text\": \"def note note, preview=nil\\n preview ||= note[0..64]\\n params = {\\n contact_ids: [ self.id ],\\n note: note,\\n note_preview: preview\\n }\\n @nimble.post \\\"contacts/notes\\\", params\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"84390418c7fce0d9a8c0720653ef255f\",\n \"score\": \"0.4769047\",\n \"text\": \"def get_notes(opts = {})\\n data, status_code, headers = get_notes_with_http_info(opts)\\n return data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8035c90eba633a7f5328af9b47b05527\",\n \"score\": \"0.47678736\",\n \"text\": \"def notes\\n return Note.find(:all, :conditions => [\\\"type_id = ? AND owner = ?\\\", self.id, :property ])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b9f4f0d68f955dcea2d9aa2569a63792\",\n \"score\": \"0.4751765\",\n \"text\": \"def rip_folder(folder_id)\\n\\n @logger.debug(\\\"Rip Folder: Calling rip_folder on Folder ID #{folder_id}\\\")\\n\\n # Set the ZSERVERRECORD column to look at\\n server_record_column = \\\"ZSERVERRECORD\\\"\\n server_record_column = server_record_column + \\\"DATA\\\" if @version >= IOS_VERSION_12 # In iOS 11 this was ZSERVERRECORD, in 12 and later it became ZSERVERRECORDDATA\\n\\n # Set the ZSERVERSHARE column to look at\\n server_share_column = \\\"ZSERVERSHARE\\\"\\n server_share_column = server_share_column + \\\"DATA\\\" if @version >= IOS_VERSION_12 # In iOS 11 this was ZSERVERRECORD, in 12 and later it became ZSERVERRECORDDATA\\n \\n smart_folder_query = \\\"'' as ZSMARTFOLDERQUERYJSON\\\"\\n smart_folder_query = \\\"ZICCLOUDSYNCINGOBJECT.ZSMARTFOLDERQUERYJSON\\\" if @version >= IOS_VERSION_15\\n \\n query_string = \\\"SELECT ZICCLOUDSYNCINGOBJECT.ZTITLE2, ZICCLOUDSYNCINGOBJECT.ZOWNER, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.#{server_record_column}, ZICCLOUDSYNCINGOBJECT.#{server_share_column}, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.Z_PK, ZICCLOUDSYNCINGOBJECT.ZIDENTIFIER, \\\" +\\n \\\"ZICCLOUDSYNCINGOBJECT.ZPARENT, #{smart_folder_query} \\\" +\\n \\\"FROM ZICCLOUDSYNCINGOBJECT \\\" + \\n \\\"WHERE ZICCLOUDSYNCINGOBJECT.Z_PK=?\\\"\\n\\n #Change things up for the legacy version\\n if @version == IOS_LEGACY_VERSION\\n query_string = \\\"SELECT ZSTORE.Z_PK, ZSTORE.ZNAME as ZTITLE2, \\\" +\\n \\\"ZSTORE.ZACCOUNT as ZOWNER, '' as ZIDENTIFIER \\\" +\\n \\\"FROM ZSTORE \\\" +\\n \\\"WHERE ZSTORE.Z_PK=?\\\"\\n end\\n\\n @database.execute(query_string, folder_id) do |row|\\n\\n tmp_folder = AppleNotesFolder.new(row[\\\"Z_PK\\\"],\\n row[\\\"ZTITLE2\\\"],\\n get_account(row[\\\"ZOWNER\\\"]))\\n\\n # If this is a smart folder, instead build an AppleNotesSmartFolder\\n if row[\\\"ZSMARTFOLDERQUERYJSON\\\"] and row[\\\"ZSMARTFOLDERQUERYJSON\\\"].length > 0\\n tmp_folder = AppleNotesSmartFolder.new(row[\\\"Z_PK\\\"],\\n row[\\\"ZTITLE2\\\"],\\n get_account(row[\\\"ZOWNER\\\"]),\\n row[\\\"ZSMARTFOLDERQUERYJSON\\\"])\\n end\\n\\n if row[\\\"ZIDENTIFIER\\\"]\\n tmp_folder.uuid = row[\\\"ZIDENTIFIER\\\"]\\n end\\n\\n # Set whether the folder displays notes in numeric order, or by modification date\\n tmp_folder.retain_order = @retain_order\\n tmp_folder.sort_order = @folder_order[row[\\\"ZIDENTIFIER\\\"]] if @folder_order[row[\\\"ZIDENTIFIER\\\"]]\\n\\n # Add server-side data, if relevant\\n tmp_folder.add_cloudkit_server_record_data(row[server_record_column]) if row[server_record_column]\\n\\n if(row[server_share_column]) \\n tmp_folder.add_cloudkit_sharing_data(row[server_share_column])\\n\\n # Add any share participants to our overall list\\n tmp_folder.share_participants.each do |participant|\\n @cloud_kit_participants[participant.record_id] = participant\\n end\\n end\\n\\n @logger.debug(\\\"Rip Folder: Created folder #{tmp_folder.name}\\\")\\n\\n # Remember folder heirarchy\\n if row[\\\"ZPARENT\\\"]\\n tmp_parent_folder_id = row[\\\"ZPARENT\\\"]\\n tmp_folder.parent_id = tmp_parent_folder_id\\n end\\n \\n # Whether child or not, we add it to the overall tracker so we can look up by folder ID.\\n # We'll clean up on output by testing to see if a folder has a parent.\\n @folders[folder_id] = tmp_folder\\n\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"58f3ea3a9ff7edec7a9e3ff5804c5ceb\",\n \"score\": \"0.4731986\",\n \"text\": \"def notes=(notes)\\n self.service.editObject({ \\\"notes\\\" => notes.to_s })\\n self.refresh_details()\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f121a6d2ee93bfd835a9381272befc66\",\n \"score\": \"0.4724261\",\n \"text\": \"def set_notes_list\\n @notes_list = @note.notes_lists.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"837df9ea7b5447bf94927b839ca39848\",\n \"score\": \"0.4717078\",\n \"text\": \"def note_contents\\n self.notes.each.map{|note| note.content}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e8d9a667fb4b84fc2524312f3ffeb8fd\",\n \"score\": \"0.47113046\",\n \"text\": \"def filter_notes\\n filters = []\\n filters << {:re => /(https?:\\\\/\\\\/\\\\S+)/i, :sub => '\\\\1'}\\n filters << {:re => /\\\\brt:(\\\\d+)\\\\b/i, :sub => 'rt:\\\\1'}\\n filters << {:re => /\\\\bwiki:([\\\\S\\\\(\\\\)_]+)/i, :sub => 'wiki:\\\\1'}\\n filters << {:re => /#(\\\\S+)\\\\b/i, :sub => '#\\\\1'}\\n\\n @hosts = [@host] if @hosts == nil\\n @hosts.each do |e|\\n filters.collect { |f| e.notes.gsub! f[:re], f[:sub] }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b4c79cf5c18bcff6c46324f56184c91c\",\n \"score\": \"0.47068018\",\n \"text\": \"def all_notes=(notes)\\n self.class.all_note_fields.each do |field|\\n send(\\\"#{field}=\\\", notes[field])\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1285fee0b9d553b3f95e874375bf403\",\n \"score\": \"0.47057152\",\n \"text\": \"def get_core_notes_and_type\\n possibles = []\\n size = @notes.length\\n while (possibles.length == 0)\\n pairs = @notes.combination(size).map do |set|\\n [set, self.get_poss_type(set)]\\n end\\n possibles += pairs.reject { |_, type| type == :'unknown chord' }\\n size -= 1\\n end\\n return possibles.first # TODO: Algorithm to pick most likely type\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ab85cea5c8d9753dc13f3b4e7e882e30\",\n \"score\": \"0.4684559\",\n \"text\": \"def add_note # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity\\n @bib.biblionote.each do |n|\\n case n.type\\n when \\\"annote\\\" then @item.annote = n.content\\n when \\\"howpublished\\\" then @item.howpublished = n.content\\n when \\\"comment\\\" then @item.comment = n.content\\n when \\\"tableOfContents\\\" then @item.content = n.content\\n when nil then @item.note = n.content\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"adfd0ac6b68354046631932adcd78cc4\",\n \"score\": \"0.46824485\",\n \"text\": \"def show_all_notes_db(db)\\n db.all_notes.select { |note| !note[\\\"deleted\\\"] }\\n .each { |note| show_note(note) }\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e3915c49b23a060afb377617b94d84c6\",\n \"score\": \"0.46579546\",\n \"text\": \"def update!(notes)\\n fetch_notes\\n show_notes\\n push_notes(notes)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"094e0bbc2e95cfa18fa842b9382a27dd\",\n \"score\": \"0.46531925\",\n \"text\": \"def character_notes\\n self.object.character_notes.map do |note|\\n {\\n c_note_id: note.id,\\n c_note_title: note.title,\\n c_note_content: note.content,\\n visible_to_other_players: note.visible_to_other_players,\\n amount_spent: note.amount_spent,\\n amount_earned: note.amount_earned\\n }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d5c706a2025f43b2f1c0cf0a47df6f45\",\n \"score\": \"0.4651705\",\n \"text\": \"def add_plain_text_to_database\\n\\n return if @version < IOS_VERSION_9 # Fail out if we're prior to the compressed data age\\n\\n # Warn the user\\n puts \\\"Adding the ZICNOTEDATA.ZPLAINTEXT and ZICNOTEDATA.ZDECOMPRESSEDDATA columns, this takes a few seconds\\\"\\n\\n # Add the new ZPLAINTEXT column\\n @database.execute(\\\"ALTER TABLE ZICNOTEDATA ADD COLUMN ZPLAINTEXT TEXT\\\")\\n @database.execute(\\\"ALTER TABLE ZICNOTEDATA ADD COLUMN ZDECOMPRESSEDDATA TEXT\\\")\\n\\n # Loop over each AppleNote\\n @notes.each do |key, note|\\n\\n # Update the database to include the plaintext\\n @database.execute(\\\"UPDATE ZICNOTEDATA \\\" + \\n \\\"SET ZPLAINTEXT=?, ZDECOMPRESSEDDATA=? \\\" + \\n \\\"WHERE Z_PK=?\\\",\\n note.plaintext, note.decompressed_data, note.primary_key) if note.plaintext\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d5c706a2025f43b2f1c0cf0a47df6f45\",\n \"score\": \"0.4651705\",\n \"text\": \"def add_plain_text_to_database\\n\\n return if @version < IOS_VERSION_9 # Fail out if we're prior to the compressed data age\\n\\n # Warn the user\\n puts \\\"Adding the ZICNOTEDATA.ZPLAINTEXT and ZICNOTEDATA.ZDECOMPRESSEDDATA columns, this takes a few seconds\\\"\\n\\n # Add the new ZPLAINTEXT column\\n @database.execute(\\\"ALTER TABLE ZICNOTEDATA ADD COLUMN ZPLAINTEXT TEXT\\\")\\n @database.execute(\\\"ALTER TABLE ZICNOTEDATA ADD COLUMN ZDECOMPRESSEDDATA TEXT\\\")\\n\\n # Loop over each AppleNote\\n @notes.each do |key, note|\\n\\n # Update the database to include the plaintext\\n @database.execute(\\\"UPDATE ZICNOTEDATA \\\" + \\n \\\"SET ZPLAINTEXT=?, ZDECOMPRESSEDDATA=? \\\" + \\n \\\"WHERE Z_PK=?\\\",\\n note.plaintext, note.decompressed_data, note.primary_key) if note.plaintext\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"130275f3295d2f7dc83fb8c0fe05e61c\",\n \"score\": \"0.4649199\",\n \"text\": \"def each_note(&block)\\n\\t\\tnotes.each do |note|\\n\\t\\t\\tblock.call(note)\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3fade731f28a4d289f63cffd3b305ba4\",\n \"score\": \"0.46328926\",\n \"text\": \"def each_note(wspace=workspace, &block)\\n\\t\\twspace.notes.each do |note|\\n\\t\\t\\tblock.call(note)\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb3dde962a48d03f4836a403b3a9878b\",\n \"score\": \"0.46298686\",\n \"text\": \"def index\\n @notebook_notes = Notebook::Note.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b8128d41e78a967670c2424835780383\",\n \"score\": \"0.46275607\",\n \"text\": \"def all_notes\\n result = {}\\n self.class.all_note_fields.each do |field|\\n value = send(field).to_s\\n result[field] = value.presence\\n end\\n result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fb1acbc3a63dda2af1b8b373b066615b\",\n \"score\": \"0.46216643\",\n \"text\": \"def index\\n @notes_lists = @note.notes_lists.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0a92e048214144d1160080ff2bad694b\",\n \"score\": \"0.46145135\",\n \"text\": \"def make_note (notes_hash, framework=self.framework)\\n\\t\\t\\tprint_deb \\\"Attempting to create note with #{notes_hash.inspect}\\\"\\n\\t\\t\\t# check the required hash elements for a good note\\n\\t\\t\\t\\n\\t\\t\\t# <-- start weird bug work around\\n\\t\\t\\trequired_elements = [:data]\\n\\t\\t\\t#required_elements = [:data,:type]\\n\\t\\t\\tnotes_hash[:type] = \\\"db_fun\\\"\\n\\t\\t\\t# --> end weird bug work around\\n\\t\\t\\t\\n\\t\\t\\trequired_elements.each do |elem|\\n\\t\\t\\t\\traise ArgumentError.new \\\"Missing required element (#{elem}) \\\" +\\n\\t\\t\\t\\t\\\"for the note\\\" unless notes_hash[elem]\\n\\t\\t\\tend\\n\\t\\t\\tprint_deb \\\"Sending note to db with #{notes_hash.inspect}\\\"\\n\\t\\t\\tframework.db.report_note(notes_hash)\\n\\t\\t\\t\\t\\n\\t\\t\\t#\\n\\t\\t\\t# Report a Note to the database. Notes can be tied to a Workspace, Host, or Service.\\n\\t\\t\\t#\\n\\t\\t\\t# opts MUST contain\\n\\t\\t\\t# +:data+:: whatever it is you're making a note of\\n\\t\\t\\t# +:type+:: The type of note, e.g. smb_peer_os\\n\\t\\t\\t#\\n\\t\\t\\t# opts can contain\\n\\t\\t\\t# +:workspace+:: the workspace to associate with this Note\\n\\t\\t\\t# +:host+:: an IP address or a Host object to associate with this Note\\n\\t\\t\\t# +:service+:: a Service object to associate with this Note\\n\\t\\t\\t# +:port+:: along with :host and proto, a service to associate with this Note\\n\\t\\t\\t# +:proto+:: along with :host and port, a service to associate with this Note\\n\\t\\t\\t# +:update+:: what to do in case a similar Note exists, see below\\n\\t\\t\\t#\\n\\t\\t\\t# The +:update+ option can have the following values:\\n\\t\\t\\t# +:unique+:: allow only a single Note per +:host+/+:type+ pair\\n\\t\\t\\t# +:unique_data+:: like +:uniqe+, but also compare +:data+\\n\\t\\t\\t# +:insert+:: always insert a new Note even if one with identical values exists\\n\\t\\t\\t#\\n\\t\\t\\t# If the provided +:host+ is an IP address and does not exist in the\\n\\t\\t\\t# database, it will be created. If +:workspace+, +:host+ and +:service+\\n\\t\\t\\t# are all omitted, the new Note will be associated with the current\\n\\t\\t\\t# workspace.\\n\\t\\t\\t#\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7624a958dcd97bd31e06c3cb4ecf3147\",\n \"score\": \"0.46108902\",\n \"text\": \"def note_contents=(notes)\\n notes.each do |content|\\n if content.strip != ''\\n self.notes.build(content: content)\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f217d8297d749e9a246f64c0f457dd7c\",\n \"score\": \"0.46036783\",\n \"text\": \"def all_notes\\n self.has_notes? ? self.annotations.map {|n| n.body }.join(' ') : '' \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"18bd2ccbf1a41b08f5b58d46df45f274\",\n \"score\": \"0.45953065\",\n \"text\": \"def fetch_notes\\n info \\\"fetching notes\\\"\\n run(\\\"git fetch -f origin refs/notes/*:refs/notes/*\\\", {:raise => true})\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0bd545f16a01ef5497ef8a0c7c0e9a44\",\n \"score\": \"0.45784226\",\n \"text\": \"def notes\\n @data[:notes]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"edc5dfe0200a4b12d4455f2c9111e7a7\",\n \"score\": \"0.4564379\",\n \"text\": \"def note_contents=(notes)\\n notes.each do |note|\\n if note != \\\"\\\"\\n self.notes << Note.find_or_create_by(content: note)\\n end\\n end\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"025471fe926049b7daabf4aef028ef87\",\n \"score\": \"0.45600042\",\n \"text\": \"def clean_notes\\n for note in notes\\n if note.comment.blank?\\n note.destroy\\n end\\n end\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"85a3e62205e801ae7e81bb1f76882d99\",\n \"score\": \"0.45589137\",\n \"text\": \"def to_up_notes(raw_notes)\\n raw_notes.present? ? { other: raw_notes } : Observation.no_notes\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cd93b88f97fbbcd5bc8623ce259a376b\",\n \"score\": \"0.4554767\",\n \"text\": \"def index\\n @communication_notes = CommunicationNote.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1ff07c3bf8c5b90805a18c0f0cb2e644\",\n \"score\": \"0.45547506\",\n \"text\": \"def get_note(obj, id)\\n obj['notes'].find {|n| n['persistent_id'] == id}\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"24b11e6a82a28b1e35b65ad7dc12f3c1\",\n \"score\": \"0.45450476\",\n \"text\": \"def index\\n @personal_notes = Note.where(:user_id => current_user.id)\\n @public_notes = Note.where(:isPublic => true).where.not(:user_id => current_user.id)\\n @shared_notes = Note.where(:id => NotesUser.where(:user_id => current_user.id).select(:note_id))\\n #@notes = Note.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b87e716c74094cd77173d8a88018ca80\",\n \"score\": \"0.45348775\",\n \"text\": \"def cmd_db_fun_note(*args)\\n\\t\\t\\t# this should currently support mixed sets, unlike the rest of the code\\n\\n\\t\\t\\t# the required hash elements for a good note:\\n\\t\\t\\t# required_elements = [ :data, :type]\\n\\t\\t\\t# note hash that we ultimately send to make_note, with default values\\n\\t\\t\\tnote_hash = @note_template.dup\\n\\n\\t\\t\\t# Check if the database is active, otherwise crap out\\n\\t\\t\\tfmwk = self.framework\\n\\t\\t\\tif fmwk.db and fmwk.db.active\\n\\t\\t\\t\\tbegin\\n\\t\\t\\t\\t\\tnote_hash[:workspace] = fmwk.db.workspace unless note_hash[:workspace]\\n\\t\\t\\t\\trescue Exception => e\\n\\t\\t\\t\\t\\tprint_error \\\"Unable to determine active workspace, reason: #{e.to_s}\\\"\\n\\t\\t\\t\\tend\\n\\t\\t\\telse\\n\\t\\t\\t\\t#do we just let them know, or raise an error... hrm for now:\\n\\t\\t\\t\\traise RuntimeError.new \\\"Database is not active\\\"\\n\\t\\t\\tend\\n\\n\\t\\t\\t# Lookin' good, let's populate the note hash with user supplied info\\n\\t\\t\\tcase args.length\\n\\t\\t\\twhen 1\\n\\t\\t\\t\\tnote_hash[:data] = args[0]\\n\\t\\t\\t\\t# assume it's a super simple note for the workspace and default everything else\\n\\t\\t\\t\\tself.make_note(note_hash)\\n\\t\\t\\twhen 2\\n\\t\\t\\t\\tid = args[0]\\n\\t\\t\\t\\tnote_hash[:data] = args[1]\\n\\t\\t\\t\\t# TODO: maybe support host & service ids too? if host_is set :host => id\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t# if the first arg seems to be a set_id...\\n\\t\\t\\t\\tif is_valid_set?(id)\\n\\t\\t\\t\\t\\t# loop over objects in set & make note for each\\n\\t\\t\\t\\t\\tprint_status \\\"Adding note to objects in set: #{id}\\\"\\n\\t\\t\\t\\t\\tretrieve_set(id).each do |obj|\\n\\t\\t\\t\\t\\t\\tobj_type_sym = get_type(obj).downcase.to_sym\\n\\t\\t\\t\\t\\t\\tnote_hash[obj_type_sym] = obj\\n\\t\\t\\t\\t\\t\\tself.make_note(note_hash)\\n\\t\\t\\t\\t\\tend\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\tprint_error \\\"Could not find a valid set named #{id}\\\"\\t\\t\\t\\t\\t\\n\\t\\t\\t\\tend\\t\\t\\t\\t\\n\\t\\t\\telse\\n\\t\\t\\t\\treturn fun_usage\\n\\t\\t\\tend\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3f70fabd619a75fdd3b871a8bab57da\",\n \"score\": \"0.4530724\",\n \"text\": \"def list_notes_with_http_info(identifier, opts = {})\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"Calling API: AlertApi.list_notes ...\\\"\\n end\\n # verify the required parameter 'identifier' is set\\n if @api_client.config.client_side_validation && identifier.nil?\\n fail ArgumentError, \\\"Missing the required parameter 'identifier' when calling AlertApi.list_notes\\\"\\n end\\n if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])\\n fail ArgumentError, 'invalid value for \\\"identifier_type\\\", must be one of id, alias, tiny'\\n end\\n if @api_client.config.client_side_validation && opts[:'direction'] && !['next', 'prev'].include?(opts[:'direction'])\\n fail ArgumentError, 'invalid value for \\\"direction\\\", must be one of next, prev'\\n end\\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100\\n fail ArgumentError, 'invalid value for \\\"opts[:\\\"limit\\\"]\\\" when calling AlertApi.list_notes, must be smaller than or equal to 100.'\\n end\\n\\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\\n fail ArgumentError, 'invalid value for \\\"opts[:\\\"limit\\\"]\\\" when calling AlertApi.list_notes, must be greater than or equal to 1.'\\n end\\n\\n if @api_client.config.client_side_validation && opts[:'order'] && !['asc', 'desc'].include?(opts[:'order'])\\n fail ArgumentError, 'invalid value for \\\"order\\\", must be one of asc, desc'\\n end\\n # resource path\\n local_var_path = \\\"/v2/alerts/{identifier}/notes\\\".sub('{' + 'identifier' + '}', identifier.to_s)\\n\\n # query parameters\\n query_params = {}\\n query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?\\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\\n query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?\\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\\n\\n # header parameters\\n header_params = {}\\n # HTTP header 'Accept' (if needed)\\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\\n\\n # form parameters\\n form_params = {}\\n\\n # http body (model)\\n post_body = nil\\n auth_names = ['GenieKey']\\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\\n :header_params => header_params,\\n :query_params => query_params,\\n :form_params => form_params,\\n :body => post_body,\\n :auth_names => auth_names,\\n :return_type => 'ListAlertNotesResponse')\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"API called: AlertApi#list_notes\\\\nData: #{data.inspect}\\\\nStatus code: #{status_code}\\\\nHeaders: #{headers}\\\"\\n end\\n return data, status_code, headers\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0e7eca6746bafa7d39e2764b90843735\",\n \"score\": \"0.4524773\",\n \"text\": \"def in_app_receipts\\n read('in_app').map { |raw_receipt| InAppReceipt.new(raw_receipt) }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dfd72a13b4b11075c1dfbd9911a66d48\",\n \"score\": \"0.4516266\",\n \"text\": \"def play(notes)\\n\\n md = /(\\\\w):(.+)/.match(notes)\\n \\n notetype = @notes[md[1]]\\n d = @seq.note_to_delta(notetype)\\n\\n # n.b channel is inverse of string - chn 0 is str 6 \\n md[2].split('|').each_with_index do |fret, channel| \\n if fret.to_i.to_s == fret\\n fret = fret.to_i\\n oldfret = @prev[channel]\\n @prev[channel] = fret \\n\\n if oldfret\\n oldnote = @tuning[channel] + oldfret\\n @track.events << MIDI::NoteOffEvent.new(channel,oldnote,0,d)\\n d = 0\\n end\\n \\n noteval = @tuning[channel] + fret\\n @track.events << MIDI::NoteOnEvent.new(channel,noteval,80 + rand(38),d)\\n d = 0\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2c6fcb5946bac352f3d65e07b2523c8c\",\n \"score\": \"0.45056722\",\n \"text\": \"def rip_folders()\\n if @version >= IOS_VERSION_9\\n @database.execute(\\\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK \\\" + \\n \\\"FROM ZICCLOUDSYNCINGOBJECT \\\" + \\n \\\"WHERE ZICCLOUDSYNCINGOBJECT.ZTITLE2 IS NOT NULL\\\") do |row|\\n rip_folder(row[\\\"Z_PK\\\"])\\n end\\n end\\n\\n # In legacy Notes the \\\"folders\\\" were \\\"stores\\\"\\n if @version == IOS_LEGACY_VERSION\\n @database.execute(\\\"SELECT ZSTORE.Z_PK FROM ZSTORE\\\") do |row|\\n rip_folder(row[\\\"Z_PK\\\"])\\n end\\n end\\n\\n # Loop over all folders to do some clean up\\n @folders.each_pair do |key, folder|\\n if folder.is_orphan?\\n tmp_parent_folder = get_folder(folder.parent_id)\\n tmp_parent_folder.add_child(folder)\\n @logger.debug(\\\"Rip Folder: Added folder #{folder.full_name} as child to #{tmp_parent_folder.name}\\\")\\n end\\n\\n @logger.debug(\\\"Rip Folders final array: #{key} corresponds to #{folder.name}\\\")\\n end\\n\\n # Sort the folders if we want to retain the order, group each account together\\n if @retain_order\\n @folders = @folders.sort_by{|folder_id, folder| [folder.account.sort_order_name, folder.sort_order]}.to_h\\n\\n # Also organize the child folders nicely\\n @folders.each do |folder_id, folder|\\n folder.sort_children\\n end\\n end\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3f9851aa30ccc642b40d1ef4c7678019\",\n \"score\": \"0.45056257\",\n \"text\": \"def to_up_notes(raw_notes)\\n raw_notes.present? ? { Other: raw_notes } : {}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"745ce8cefd719ce65721ed57fb787e4c\",\n \"score\": \"0.45007017\",\n \"text\": \"def note\\n qry = ActiveRDF::Query.new(Note).select(:note).distinct\\n qry.where(:note, N::DCT.isPartOf, self)\\n qry.execute\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8739cf9c7ce88c07df8d7332317ac40a\",\n \"score\": \"0.44983882\",\n \"text\": \"def note(*note_names)\\n midi_values = note_names.map { |name| Midishark::Notes.note(name) }\\n @notes << midi_values\\n\\n midi_values\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"29a43073cffa29e047111f29f1c29bd4\",\n \"score\": \"0.44842312\",\n \"text\": \"def note_contents=(notes)\\n \\tnotes.each do |content|\\n \\t\\tself.notes << Note.find_or_create_by(content: content) unless content == \\\"\\\"\\n \\tend\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a042ff59795604858c4378fcb6fe966f\",\n \"score\": \"0.44800803\",\n \"text\": \"def note_contents\\n self.notes.map(&:content)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a042ff59795604858c4378fcb6fe966f\",\n \"score\": \"0.44800803\",\n \"text\": \"def note_contents\\n self.notes.map(&:content)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3ab6946f9cba6480aac23f281bd6593d\",\n \"score\": \"0.4479658\",\n \"text\": \"def my_notes\\n device = params.permit(:device_id)\\n render json: GeoNote.where(device_id: device[:device_id]).all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"457fe39d947395d2f659b19f700ea8df\",\n \"score\": \"0.44749704\",\n \"text\": \"def index\\n @food_notes = FoodNote.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c071deb5362fbf3e9d1bccf260265ac\",\n \"score\": \"0.44705042\",\n \"text\": \"def note_contents=(notes)\\n notes.each do |content|\\n if content.strip != '' # => ignores blank notes\\n self.notes.build(content: content) \\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"586811b650fdd34c0f72a565ca67ce51\",\n \"score\": \"0.44577235\",\n \"text\": \"def test_form_notes_parts\\n # no template and no notes\\n obs = observations(:minimal_unknown_obs)\\n parts = [\\\"Other\\\"]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n\\n # no template and Other notes\\n obs = observations(:detailed_unknown_obs)\\n parts = [\\\"Other\\\"]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n\\n # no template and orphaned notes\\n obs = observations(:substrate_notes_obs)\\n parts = %w[substrate Other]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n\\n # no template, and orphaned notes and Other notes\\n obs = observations(:substrate_and_other_notes_obs)\\n parts = %w[substrate Other]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n\\n # template and no notes\\n obs = observations(:templater_noteless_obs)\\n parts = [\\\"Cap\\\", \\\"Nearby trees\\\", \\\"odor\\\", \\\"Other\\\"]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n\\n # template and other notes\\n obs = observations(:templater_other_notes_obs)\\n parts = [\\\"Cap\\\", \\\"Nearby trees\\\", \\\"odor\\\", \\\"Other\\\"]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n\\n # template and orphaned notes\\n obs = observations(:templater_orphaned_notes_obs)\\n parts = [\\\"Cap\\\", \\\"Nearby trees\\\", \\\"odor\\\", \\\"orphaned_caption\\\", \\\"Other\\\"]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n\\n # template and notes for a template part\\n obs = observations(:template_only_obs)\\n parts = [\\\"Cap\\\", \\\"Nearby trees\\\", \\\"odor\\\", \\\"Other\\\"]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n\\n # template and notes for a template part and Other notes\\n obs = observations(:template_and_other_notes_obs)\\n parts = [\\\"Cap\\\", \\\"Nearby trees\\\", \\\"odor\\\", \\\"Other\\\"]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n\\n # template and notes for a template part and orphaned part\\n obs = observations(:template_and_orphaned_notes_obs)\\n parts = [\\\"Cap\\\", \\\"Nearby trees\\\", \\\"odor\\\", \\\"orphaned_caption\\\", \\\"Other\\\"]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n\\n # template and notes for a template part, orphaned part, Other,\\n # with order scrambled in the Observation\\n obs = observations(:template_and_orphaned_notes_scrambled_obs)\\n parts = [\\\"Cap\\\", \\\"Nearby trees\\\", \\\"odor\\\", \\\"orphaned_caption_1\\\",\\n \\\"orphaned_caption_2\\\", \\\"Other\\\"]\\n assert_equal(parts, obs.form_notes_parts(obs.user))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f9dcfc05ab39c52954e7224bcd1c9f2c\",\n \"score\": \"0.44367728\",\n \"text\": \"def show\\n @notifications = Notification.where(user: current_user).where(notification_obeject_id: params[:id]).where(read: false)\\n @notifications.each do |note|\\n note.read = true\\n note.save\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ec757ba0856c0472ac0558cb2cafae12\",\n \"score\": \"0.44350284\",\n \"text\": \"def add_note(identifier, body, opts = {})\\n data, _status_code, _headers = add_note_with_http_info(identifier, body, opts)\\n return data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1e21106848f00f9306b4e06f28e2f2d4\",\n \"score\": \"0.44339812\",\n \"text\": \"def to_note_offs(*args)\\n notes = [args.dup].flatten\\n options = notes.last.kind_of?(Hash) ? notes.pop : {}\\n notes.map do |note|\\n case note\\n when String then string_to_note_off(note, options) if note?(note)\\n when MIDIMessage::NoteOff then note\\n when MIDIMessage::NoteOn then note.to_note_off\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9f546c117174a2042d53de0dcd72f619\",\n \"score\": \"0.44297847\",\n \"text\": \"def extract_references(hackney_note)\\n WorkOrderReferenceFinder\\n .new(hackney_note.work_order_reference)\\n .find(hackney_note.text || \\\"\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d74d2752ee1f2e18dbddc7189548be07\",\n \"score\": \"0.44195843\",\n \"text\": \"def note_contents\\n self.notes.collect {|note| note.content}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8c8baa457d52023920796a219ecf5249\",\n \"score\": \"0.4418533\",\n \"text\": \"def get_notes_with_http_info(opts = {})\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"Calling API: NotesApi#get_notes ...\\\"\\n end\\n \\n # resource path\\n path = \\\"/Notes\\\".sub('{format}','json')\\n\\n # query parameters\\n query_params = {}\\n query_params[:'brief'] = opts[:'brief'] if opts[:'brief']\\n query_params[:'skip'] = opts[:'skip'] if opts[:'skip']\\n query_params[:'top'] = opts[:'top'] if opts[:'top']\\n query_params[:'count_total'] = opts[:'count_total'] if opts[:'count_total']\\n\\n # header parameters\\n header_params = {}\\n\\n # HTTP header 'Accept' (if needed)\\n _header_accept = ['application/json']\\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\\n\\n # HTTP header 'Content-Type'\\n _header_content_type = ['application/json']\\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\\n\\n # form parameters\\n form_params = {}\\n\\n # http body (model)\\n post_body = nil\\n \\n\\n auth_names = []\\n data, status_code, headers = @api_client.call_api(:GET, path,\\n :header_params => header_params,\\n :query_params => query_params,\\n :form_params => form_params,\\n :body => post_body,\\n :auth_names => auth_names,\\n :return_type => 'Array')\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"API called: NotesApi#get_notes\\\\nData: #{data.inspect}\\\\nStatus code: #{status_code}\\\\nHeaders: #{headers}\\\"\\n end\\n return data, status_code, headers\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"124db484a0c5a8f96feeb1b0420857dd\",\n \"score\": \"0.4417622\",\n \"text\": \"def note_contents\\n self.notes.collect do |note|\\n note.content\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5312483799e46864f56e21d4a5e12d9f\",\n \"score\": \"0.44163337\",\n \"text\": \"def set_notes\\n user_notes = current_user.notes\\n @notes = user_notes.where.not(id: nil)\\n @new_note = action_name != 'create' ? user_notes.build : user_notes.build(note_params)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e00ddf8104349573959c48686965f863\",\n \"score\": \"0.4416101\",\n \"text\": \"def index\\n @product_notes = ProductNote.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"daac3d252e14d22b69d2454b4dffa12c\",\n \"score\": \"0.44030166\",\n \"text\": \"def note_contents\\n self.notes.collect {|note| note.content }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6e6cb2370d766c5953e4674ac49b8302\",\n \"score\": \"0.4400299\",\n \"text\": \"def find_notes_by_user(user) \\n notable = ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s\\n \\n Note.find(:all,\\n :conditions => [\\\"user_id = ? and notable_type = ?\\\", user.id, notable],\\n :order => \\\"created_at DESC\\\"\\n )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eef7d65a47bdc252de56d24c7192fe19\",\n \"score\": \"0.43965626\",\n \"text\": \"def all_attachments notes=nil\\n if notes == nil\\n notes = self.notes.collect{|note| note.id}\\n NoteAttachment.where(note_id: notes, is_archive:false).order(\\\"id DESC\\\")\\n else\\n NoteAttachment.where(note_id: notes, is_archive:false).order(\\\"id DESC\\\")\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ecdc9054e1762134c0886499dc74f092\",\n \"score\": \"0.4392893\",\n \"text\": \"def si_update_selects_from_note\\n o = params[:o]\\n project_id = 0\\n work_order_id = 0\\n charge_account_id = 0\\n store_id = 0\\n payment_method_id = 0\\n if o != '0'\\n @receipt_note = ReceiptNote.find(o)\\n if @receipt_note.blank?\\n @note_items = []\\n @projects = projects_dropdown\\n @work_orders = work_orders_dropdown\\n @charge_accounts = projects_charge_accounts(@projects)\\n @stores = stores_dropdown\\n @payment_methods = payment_methods_dropdown\\n else\\n @note_items = note_items_dropdown(@receipt_note)\\n @projects = @receipt_note.project.blank? ? [] : Project.where(id: @receipt_note.project.id)\\n @work_orders = @receipt_note.work_order.blank? ? [] : WorkOrder.where(id: @receipt_note.work_order.id)\\n @charge_accounts = @receipt_note.charge_account.blank? ? [] : ChargeAccount.where(id: @receipt_note.charge_account.id)\\n @stores = @receipt_note.store\\n @payment_methods = @receipt_note.payment_method\\n end\\n if @note_items.blank?\\n @products = @receipt_note.blank? ? products_dropdown : @receipt_note.organization.products.order(:product_code)\\n else\\n @products = @receipt_note.products.group(:product_code)\\n end\\n project_id = @projects.first.id rescue 0\\n work_order_id = @work_orders.first.id rescue 0\\n charge_account_id = @charge_accounts.first.id rescue 0\\n store_id = @stores.id rescue 0\\n payment_method_id = @payment_methods.id rescue 0\\n else\\n @note_items = []\\n @projects = projects_dropdown\\n @work_orders = work_orders_dropdown\\n @charge_accounts = projects_charge_accounts(@projects)\\n @stores = stores_dropdown\\n @payment_methods = payment_methods_dropdown\\n @products = products_dropdown\\n end\\n # Work orders array\\n @orders_dropdown = @work_orders.blank? ? [] : work_orders_array(@work_orders)\\n # Note items array\\n @note_items_dropdown = note_items_array(@note_items)\\n # Products array\\n @products_dropdown = products_array(@products)\\n # Setup JSON\\n @json_data = { \\\"project\\\" => @projects, \\\"work_order\\\" => @orders_dropdown,\\n \\\"charge_account\\\" => @charge_accounts, \\\"store\\\" => @stores,\\n \\\"payment_method\\\" => @payment_methods, \\\"product\\\" => @products_dropdown,\\n \\\"project_id\\\" => project_id, \\\"work_order_id\\\" => work_order_id,\\n \\\"charge_account_id\\\" => charge_account_id, \\\"store_id\\\" => store_id,\\n \\\"payment_method_id\\\" => payment_method_id, \\\"note_item\\\" => @note_items_dropdown }\\n render json: @json_data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e719160fb2d547d4f3906df8c9e8145f\",\n \"score\": \"0.4392843\",\n \"text\": \"def index\\n @notes = Note.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e719160fb2d547d4f3906df8c9e8145f\",\n \"score\": \"0.4392843\",\n \"text\": \"def index\\n @notes = Note.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e719160fb2d547d4f3906df8c9e8145f\",\n \"score\": \"0.4392843\",\n \"text\": \"def index\\n @notes = Note.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e719160fb2d547d4f3906df8c9e8145f\",\n \"score\": \"0.4392843\",\n \"text\": \"def index\\n @notes = Note.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e719160fb2d547d4f3906df8c9e8145f\",\n \"score\": \"0.4392843\",\n \"text\": \"def index\\n @notes = Note.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"085cd5963adce0ba65cdce4437f6a449\",\n \"score\": \"0.43928266\",\n \"text\": \"def notes\\n return bad_request unless params[:note_id] and request.format.json? || request.format.js?\\n return not_found unless current_note\\n @response = {'annotation' => current_note.canonical}\\n render_cross_origin_json\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2f7110d93e8f4d1cc8db56988ac1dc35\",\n \"score\": \"0.43925986\",\n \"text\": \"def index\\n @note1s = Note1.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ac7fd450eb305f8d6cd9036a76b4bf25\",\n \"score\": \"0.43886304\",\n \"text\": \"def rip_account(account_id)\\n \\n # Set the ZSERVERRECORD column to look at\\n server_record_column = \\\"ZSERVERRECORD\\\"\\n server_record_column = server_record_column + \\\"DATA\\\" if @version >= 12 # In iOS 11 this was ZSERVERRECORD, in 12 and later it became ZSERVERRECORDDATA\\n\\n # Set the query\\n query_string = \\\"SELECT ZICCLOUDSYNCINGOBJECT.ZNAME, ZICCLOUDSYNCINGOBJECT.Z_PK, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.#{server_record_column}, ZICCLOUDSYNCINGOBJECT.ZCRYPTOITERATIONCOUNT, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZCRYPTOVERIFIER, ZICCLOUDSYNCINGOBJECT.ZCRYPTOSALT, \\\" + \\n \\\"ZICCLOUDSYNCINGOBJECT.ZIDENTIFIER \\\" +\\n \\\"FROM ZICCLOUDSYNCINGOBJECT \\\" + \\n \\\"WHERE ZICCLOUDSYNCINGOBJECT.Z_PK=?\\\"\\n \\n # Change the query for legacy IOS\\n if @version == IOS_LEGACY_VERSION\\n query_string = \\\"SELECT ZACCOUNT.ZNAME, ZACCOUNT.Z_PK, \\\" + \\n \\\"ZACCOUNT.ZACCOUNTIDENTIFIER as ZIDENTIFIER \\\" + \\n \\\"FROM ZACCOUNT \\\" + \\n \\\"WHERE ZACCOUNT.Z_PK=?\\\"\\n end\\n\\n # Run the query\\n @database.execute(query_string, account_id) do |row|\\n \\n # Create account object\\n tmp_account = AppleNotesAccount.new(row[\\\"Z_PK\\\"],\\n row[\\\"ZNAME\\\"],\\n row[\\\"ZIDENTIFIER\\\"])\\n\\n # Add server-side data, if relevant\\n tmp_account.add_server_record_data(row[server_record_column]) if row[server_record_column]\\n\\n # Add cryptographic variables, if relevant\\n if row[\\\"ZCRYPTOVERIFIER\\\"]\\n tmp_account.add_crypto_variables(row[\\\"ZCRYPTOSALT\\\"],\\n row[\\\"ZCRYPTOITERATIONCOUNT\\\"],\\n row[\\\"ZCRYPTOVERIFIER\\\"])\\n end\\n @accounts[account_id] = tmp_account\\n end \\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":182,"cells":{"query_id":{"kind":"string","value":"df1aed0a4600006ec70d860ac878bf04"},"query":{"kind":"string","value":"Sends a 'like' to 500px, returning a boolean to indicate success or failure."},"positive_passages":{"kind":"list like","value":[{"docid":"a7c2bac578a08a1e322aed927e8897d8","score":"0.5860158","text":"def like(id)\n @client.post(\"photos/#{id}/vote?vote=1\").success?\n end","title":""}],"string":"[\n {\n \"docid\": \"a7c2bac578a08a1e322aed927e8897d8\",\n \"score\": \"0.5860158\",\n \"text\": \"def like(id)\\n @client.post(\\\"photos/#{id}/vote?vote=1\\\").success?\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"333d11c7bd58dbf8697794252e52091b","score":"0.6891309","text":"def like!(user)\n response = @client.quill.post \"/api/v3.0/message/#{id}/like/\", {:collection_id => conversation.id, :lftoken => user.token}\n if response.success?\n true\n else\n raise APIException.new(response.body)\n end\n end","title":""},{"docid":"656d3a8b9a796a5e567ad87b9515c8c8","score":"0.68269","text":"def like?\n response[\"like\"]\n end","title":""},{"docid":"656d3a8b9a796a5e567ad87b9515c8c8","score":"0.68269","text":"def like?\n response[\"like\"]\n end","title":""},{"docid":"caf35cbd8acb7a8991093c0879eb768e","score":"0.6761038","text":"def like\n\n @subscriber = current_subscriber\n # TODO\n # Send preference to either predicion io or ahoy\n\n log('like')\n\n render json: { success: true }\n end","title":""},{"docid":"058ba108003cf3753438573aa4e6aa8e","score":"0.675965","text":"def like!\n post(\"/likes\")\n end","title":""},{"docid":"0f84c0883d61b4842a0581d6107cc1f0","score":"0.6721806","text":"def like\n add_opinion('Comment was successfully liked.', 'There was an error liking this comment.') do |comment|\n comment.like(current_user)\n end\n end","title":""},{"docid":"1c9ac992bd57b6cee956e0488678d838","score":"0.671511","text":"def try_like(micropost)\n if self.likes(micropost)\n \n like = micropost.get_upvotes.where(voter_id: self.id).pluck(:id).first\n Notification.create(user_id: micropost.user_id, notified_by_id: self.id, micropost_id: micropost.id, like_id: like, notice_type: \"like\")\n MicropostBrodcastJob.perform_later(micropost, \"like\", \"true\", self.id)\n return true\n else\n return false\n end\n end","title":""},{"docid":"a934d2cbaa8d2f742193ae5820cf359d","score":"0.6696768","text":"def like\n StatsManager::StatsD.time(Settings::StatsConstants.api['frame']['like']) do\n @frame = Frame.find(params[:frame_id])\n return render_error(404, \"could not find frame with id #{params[:frame_id]}\") unless @frame\n\n if current_user\n if @new_frame = dupe_to_watch_later(@frame)\n last_ancestor = Frame.find(@frame.frame_ancestors.last)\n @originator = last_ancestor && last_ancestor.creator\n @status = 200\n end\n else\n @frame.like!\n last_ancestor = Frame.find(@frame.frame_ancestors.last)\n @originator = last_ancestor && last_ancestor.creator\n @status = 200\n end\n end\n end","title":""},{"docid":"2833964810a675eb659cb3c6e78da17a","score":"0.66770154","text":"def like(user)\n like = self.likes.build({})\n like.user_id = user.id\n if like.save\n send_notification_email(:like, user)\n return true\n else\n return false\n end\n end","title":""},{"docid":"065e8db3a78117ca59c72b315e9d9fcb","score":"0.66605496","text":"def like\n @like_number = @like_number + 1\n end","title":""},{"docid":"2d09e4a46e7d234404e821ba286792fc","score":"0.65763587","text":"def like\n like = resource.toggle_like!(current_user)\n data = { outfit: resource.as_api_response(show_template, template_injector) }\n message = like ? 'Liked Successfully' : 'Unliked Successfully'\n render_success(data: data, message: message)\n end","title":""},{"docid":"e5ee43fa32f3d57b92ad13047d373541","score":"0.65608585","text":"def likes?(_)\n false\n end","title":""},{"docid":"ab31899e096b60cd74e63f8b31eb33f6","score":"0.65574557","text":"def like\n\n end","title":""},{"docid":"de55d2e7f43cd5ac6f242421940d0bdb","score":"0.65367216","text":"def like?(message)\n like_messages.include?(message)\n end","title":""},{"docid":"10a4bf87117ad5a3109ab789f8c47e02","score":"0.6530752","text":"def like!\n return true if has_liked?\n return false unless valid?\n return false unless validator_response\n persist!\n end","title":""},{"docid":"19e5f3fa00e5cebfb6074459623977d1","score":"0.6457696","text":"def like\n @comment = Comment.find(params[:id])\n @current_user.like!(@comment)\n # raise 'hell'\n redirect_to user_path(@current_user.id)\n end","title":""},{"docid":"a59331cc5135d3e2ce60c457d5e0afba","score":"0.6436676","text":"def like\n add_opinion(t('articles.like.success'), t('articles.like.fail')) do |article|\n article.like(current_user)\n end\n end","title":""},{"docid":"376f4022c616eec0747307f19f6656e9","score":"0.6433333","text":"def is_likeable?\n true\n end","title":""},{"docid":"376f4022c616eec0747307f19f6656e9","score":"0.6433333","text":"def is_likeable?\n true\n end","title":""},{"docid":"702779edc1d961fd54a87a5c1e2f8ea4","score":"0.6409179","text":"def like\n raise IncapableOfUpdateMethods.new(\"Cannot update content without stored request\") if request.nil?\n request.api.post(object.id, \"likes\")\n end","title":""},{"docid":"7572942eabcf085bdace5a0793d2906e","score":"0.6404337","text":"def like_tout(uid)\n response = post(\"touts/#{uid}/likes\")\n if JSON.parse(response.body)[\"like\"][\"status\"] == \"liked\"\n true\n else\n false\n end\n end","title":""},{"docid":"cac7fcce6f3069dbb7f4db65458393e2","score":"0.63901657","text":"def like\n logger.info \"Post :: Post like toggle request by user #{current_user.username}.\"\n p = Post.find_by_id(params[:id])\n if is_valid?(p)\n if !p.liked_by?(current_user)\n p.like!(current_user)\n else\n p.unlike!(current_user)\n end\n end\n render :text => p.like_count\n end","title":""},{"docid":"e69135d22525d4717971608eb2cf698c","score":"0.63876796","text":"def like!\n self.like_count = self.like_count + 1\n self.save\n logger.debug \"User :: #{self.username} liked.\"\n end","title":""},{"docid":"a4084d2113a83da8927ebf9564e05922","score":"0.63628125","text":"def like(model)\n unless self.liked?(model)\n model.before_liked_by(self) if model.respond_to?('before_liked_by')\n model.likes.create!(liker: self)\n model.likers << self\n model.inc(:likers_count, 1)\n model.after_liked_by(self) if model.respond_to?('after_liked_by')\n self.before_like(model) if self.respond_to?('before_like')\n self.inc(:likes_count, 1)\n self.after_like(model) if self.respond_to?('after_like')\n return true\n else\n return false\n end\n end","title":""},{"docid":"2888e4f1020066f919b51ba679435908","score":"0.6355591","text":"def liked?(_)\n\t\tfalse\n\tend","title":""},{"docid":"37b424fc7b10c95928107ddbd9deebbc","score":"0.6303558","text":"def like\n\t\tlike = Like.create(like: params[:like], chef: current_user, recipe: @recipe)\n\t\tif like.valid?\n\t\t\tflash[:success] = \"Your selection was successful\"\n\t\t\tredirect_to :back\n\t\telse\n\t\t\tflash[:danger] = \"You can only like/dislike a recipe once\"\n\t\t\tredirect_to :back\n\t\tend\n\tend","title":""},{"docid":"eb7e6d9b742b8d20bcef30f133f8dde8","score":"0.629766","text":"def like\n liked = current_user.like(@card)\n\n render :show, status: :ok\n end","title":""},{"docid":"dde01333519654eea4472ca90c272f86","score":"0.6285413","text":"def like\n result = \"success\"\n if Likes.where(user_id: params[:user], model_id: params[:id]).first.blank?\n like = Likes.new(user_id: params[:user],\n model_id: params[:id], value: true)\n like.save\n result = \"1\"\n else\n like = Likes.where(user_id: params[:user], model_id: params[:id]).first\n like.value = !like.value\n if like.value?\n result = \"1\"\n else\n result = \"0\"\n end\n\n like.save\n end\n\n render :text=>result\n end","title":""},{"docid":"b7c7af3cdf11fcc54d9200b478121d4a","score":"0.62764984","text":"def like_if_not_in_db(media)\n return false if media.exists_in_db?(@table_likes)\n\n if like_media(media.id)\n @total_likes += 1\n print_success_message(action: :like, number: @total_likes, data: @media.id)\n media.insert_into_db(@table_likes)\n sleep_rand(28, 36)\n true\n else\n false\n end\n end","title":""},{"docid":"31acf7cda3a5d17cba528547ad2b2da4","score":"0.62615734","text":"def has_liked?\n Like.exists?(campaign_id: @campaign.id, user_id: @user.id)\n end","title":""},{"docid":"3d4f21f0f6d2b8bf56d6a7729851bf9a","score":"0.62443733","text":"def like\n @like_number = @like_number + 1\n reset_updated_at\n end","title":""},{"docid":"99ee6c8a67a68e5da0408964e39c2da8","score":"0.62399274","text":"def like(options = {})\n user = options.delete(:user)\n put(:like, :like => options).tap{|res|\n if (user and res.instance_of?(Net::HTTPOK))\n #TODO: Following line is adding a very large current_user object in the users cache too many times.\n self.attributes[\"like_to\"] = self.attributes[\"like_to\"] + [user]\n self.attributes[\"actions\"] = (self.actions.delete_if {|action| action == \"like\" } << \"unlike\").join(\", \")\n Tibbr::Message.update_cache(user, self, {:only_update_if_exists => true})\n end\n }\n end","title":""},{"docid":"f269bb46f94e345cf61f86bf99f980ce","score":"0.6207382","text":"def is_liked\n like = current_post.likes.find_by(user_id: current_user.id)\n render json: like.present?, status: :ok\n end","title":""},{"docid":"2f01978f9505b05c6b2935d93154251e","score":"0.61870426","text":"def like\n @access_token = rest_graph.access_token\n if @access_token\n @user = rest_graph.get('/me')\n @user_id = @user['id']\n end\n\n @msg_id = params[:msg_id]\n @msg = Msg.find_by_msg_id(@msg_id)\n @msg_like = @msg[:like]\n\n if ((@msg_like.index(@user_id)).nil?)\n @msg_like.push(@user_id)\n else\n @msg_like.delete(@user_id)\n end\n\n @msg.update_attribute( :like, @msg_like )\n @msg = Msg.find_by_msg_id(@msg_id)\n\n render :json => {:msg => @msg}.to_json\n end","title":""},{"docid":"e313ac1a17838e0718088bc3a24566e7","score":"0.6183906","text":"def like\n @beer = Beer.find params[:id]\n\n respond_to do |format|\n if current_user.like @beer\n format.json { head :ok }\n format.xml { head :ok }\n else\n format.json { head :unprocessable_entity }\n format.xml { head :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"142aeaa21c7d1cb68bc6d4b8cd493622","score":"0.6153666","text":"def like\n @good = Good.find(params[:goodid])\n if current_user.nil?\n render text: \"no_login\"\n else\n @good.like(current_user.id)\n render text: \"liked\"\n end\n \n end","title":""},{"docid":"20b5477caaade5159201994908bc2da8","score":"0.6152657","text":"def update_like\n # Get post value\n like_id = params[:like_id]\n like_type = params[:like_type]\n\n # Referer\n referer = request.env['HTTP_REFERER']\n\n # Get like\n like = Like.where(like_id: like_id).where(like_type: like_type)\n count = like.length\n own_like = like.where(user_id: User.current.id)\n own_count = own_like.length\n\n if own_count == 0 then\n # Get user to send\n case like_type\n when 'issue' then\n kind = I18n.t(:label_issue)\n issue = Issue.find(like_id)\n user_to = User.find(issue.author_id)\n author_id = issue.author_id\n when 'journal' then\n kind = I18n.t(:field_notes)\n journal = Journal.find(like_id)\n user_to = User.find(journal.user_id)\n author_id = journal.user_id\n when 'wiki' then\n kind = I18n.t(:label_wiki)\n wiki_content = WikiPage.find(like_id).content\n user_to = User.find(wiki_content.author_id)\n author_id = wiki_content.author_id\n else\n # nothing to do\n end\n # Add\n new_like = Like.new(user_id: User.current.id, like_id: like_id, author_id: author_id, like_type: like_type)\n new_like.save!\n # Send a mail\n if LikeConstants::ENABLE_MAIL_NOTIFICATION == 1 && defined? kind\n title = I18n.t(:like_mail_title, :name => User.current.lastname, :kind => kind)\n content = referer.to_s\n LikeMailer.on_like(user_to, title, content).deliver\n end\n count = count + 1\n else\n # Remove\n own_like.delete_all\n count = count - 1\n end\n\n # Create senders string\n latest_like = Like.where(like_id: like_id).where(like_type: like_type)\n latest_like_sender_ids = latest_like.pluck(:user_id)\n latest_like_senders = User.where(id: latest_like_sender_ids)\n senders = \"\"\n latest_like_senders.each {|user|\n senders += \"\" + CGI.escapeHTML(user.name) + \"
\"\n }\n\n # Return json\n result_hash = {}\n result_hash[\"count\"] = count\n result_hash[\"senders\"] = senders\n render json: result_hash\n end","title":""},{"docid":"5c5d86f6a4426e9b50487e3c016fb429","score":"0.61489457","text":"def is_liked?\n Like.where(user: current_user.id, tweet: params[:tweet_id]).exists?\n end","title":""},{"docid":"8aa377edfe1def4299a0cba0dd59a890","score":"0.6144198","text":"def like\n method = request.method.downcase.to_sym\n url = \"media/#{params[:uid]}/likes\"\n query = \"access_token=#{current_user.access_token}\"\n if method == :delete\n response = Star::Requester.delete(\"#{url}?#{query}\")\n elsif method == :post\n response = Star::Requester.post(url, query)\n end\n if photo = Photo.find_by_uid(params[:uid])\n photo.queue_for_updates(true)\n end\n render text: response.body.to_json, content_type: response.headers[\"Content-Type\"]\n end","title":""},{"docid":"410fb15112f85c66ad4400112c942f25","score":"0.61388","text":"def like_image\n @like += 1\n end","title":""},{"docid":"63852ed610a8b32592f3f4017363a595","score":"0.6129263","text":"def is_liked?\n Like.where(user: current_user.id, tweet:params[:tweet_id]).exists?\n end","title":""},{"docid":"6ead8845c174e3142923cade2a88c0fd","score":"0.61106807","text":"def liked?(user_id)\n !!user_like(user_id)\n end","title":""},{"docid":"d8d6448c7ce02e51b4c90ccdae90268f","score":"0.60926366","text":"def like?(user)\n liking_users.include?(user)\n end","title":""},{"docid":"1753a992444b9754bfced71c30b2a886","score":"0.60918564","text":"def like?(post)\n likes.find_by_post_id(post.id) ? true : false\n end","title":""},{"docid":"7a4291b4b37544f2a1e54fc990cfe92b","score":"0.60521066","text":"def like\n @classroomcomment.liked_by current_user\n redirect_to @urltoredirect\n end","title":""},{"docid":"29a1e6b8ff0c70545d1195696b15efed","score":"0.6015055","text":"def set_like\n\n end","title":""},{"docid":"360e6fba76496c7a7a595a31ad9b606e","score":"0.6011874","text":"def increment_like_count\n return if verb != \"like\" || direct_activity_object.blank?\n\n direct_activity_object.increment!(:like_count)\n end","title":""},{"docid":"360e6fba76496c7a7a595a31ad9b606e","score":"0.6011874","text":"def increment_like_count\n return if verb != \"like\" || direct_activity_object.blank?\n\n direct_activity_object.increment!(:like_count)\n end","title":""},{"docid":"e7e70b1aa1016600af5b67f9c1588b47","score":"0.6008548","text":"def like\n begin\n # If everything goes well we can just return the results\n render status: 200, json: Chain.like_chain(params)\n rescue Exceptions::TPException => e\n # One of the exceptions we anticipated - return the embedded status and message\n render status: e.code, json: { message: e.message }\n rescue => e\n # Something else went wrong, log it\n p e\n # Return a 500 error with generic message\n render status: 500, json: { message: \"Internal Server Error\" }\n end\n end","title":""},{"docid":"644887e08b06a51a644ccedc3b730a03","score":"0.5994782","text":"def likes?(micropost)\n\t\tlikes.include?(micropost)\n\tend","title":""},{"docid":"babefaeb579c318f58b4b76efa6c776a","score":"0.59854406","text":"def liked_by?(liking_user)\n if check_user(liking_user)\n new_like = Like.new(:user_id => liking_user.id, :post_id => self.id)\n !new_like.valid?\n else\n false\n end\n end","title":""},{"docid":"08113b4268ddff01f19e21153e5ca857","score":"0.5978856","text":"def friends_like(place)\n\t\t# Total number of likes of the place, including me\n\t\tlikes = place.post_activity.children.joins(:activity_verb).where('activity_verbs.name' => \"like\")\n\t\tfriend_likes = likes.joins(:channel).joins('INNER JOIN contacts ON contacts.receiver_id = channels.author_id').\n\t\t\twhere('contacts.sender_id' => current_subject).where('contacts.ties_count > 0')\n\n\t\tfriend_likes.count\n\tend","title":""},{"docid":"c9473cd7921f3117de90376cbfb25651","score":"0.59413946","text":"def fb_like(like_url, custom_options={})\n options = {\n :href => like_url,\n :send => false,\n :layout => \"button_count\",\n :show_faces => false,\n :width => 90\n }\n\n options.merge! custom_options\n\n content_tag(:div, \"\", :class => \"fb-like\", :data => options)\n end","title":""},{"docid":"172ece000fa16e434d49b39acca36906","score":"0.59272194","text":"def like\n # user = current_user\n if !params[:user_id].nil?\n if User.exists? id: params[:user_id]\n target_user = User.find(params[:user_id])\n\n if current_user.follows?(target_user) # Unlike\n # REMOVED unlike\n # current_user.unfollow!(target_user)\n else # Like\n current_user.follow!(target_user)\n\n # Send notifications to target user \n end\n\n # Return friends list\n friends = WhisperNotification.myfriends(current_user.id)\n\n if !friends.blank?\n users = FriendByWhisper.friends_json(friends, current_user)\n users = JSON.parse(users).delete_if(&:blank?)\n users = users.sort_by { |hsh| hsh[:timestamp] }\n\n render json: success(users.reverse, \"data\")\n else\n render json: success(Array.new, \"data\")\n end\n else\n render json: error(\"Sorry, this user doesn't exist\")\n end\n else\n render json: error(\"Sorry, user_id required\")\n end\n\n end","title":""},{"docid":"c5b08a1ecb0873a327b5f17508d35ef8","score":"0.5918627","text":"def user_can_like(user_id)\n\t\tif self.likes.where(user_id: user_id).length > 0\n\t\t\treturn false\n\t\tend\n\n\t\treturn true\n\n\tend","title":""},{"docid":"c5b08a1ecb0873a327b5f17508d35ef8","score":"0.5918627","text":"def user_can_like(user_id)\n\t\tif self.likes.where(user_id: user_id).length > 0\n\t\t\treturn false\n\t\tend\n\n\t\treturn true\n\n\tend","title":""},{"docid":"c5b08a1ecb0873a327b5f17508d35ef8","score":"0.5918627","text":"def user_can_like(user_id)\n\t\tif self.likes.where(user_id: user_id).length > 0\n\t\t\treturn false\n\t\tend\n\n\t\treturn true\n\n\tend","title":""},{"docid":"9c5009a638e1bc2181b0e2833c5b2eaf","score":"0.5917508","text":"def is_liked?\n liked_count > 0 rescue nil\n end","title":""},{"docid":"aaca82b03387ef3865ab05c7ce716fc8","score":"0.5908886","text":"def like\n found = PostLike.find_by(user_id: current_user.id, post_id: post_like_params[:post_id])\n if found \n render json: { error: \"Failed to like post, post has already been liked by this user.\" }\n else\n if current_user.id === post_like_params[:user_id]\n new_like = PostLike.create(post_like_params)\n end\n post = Post.find(params[:post_id])\n if new_like.valid?\n render json: {post: PostSerializer.new(post)}, status: :accepted\n else\n render json: {error: \"Failed to like post\"}, status: :not_acceptable\n end\n end\n\n\n end","title":""},{"docid":"c6d2cbdee0c0274613ecfd96ee7175a5","score":"0.59051687","text":"def like\n @mpid = params['mp_id']\n respond_to do |format|\n if MiniPostLiking.create(:user_id=>current_user.id,:mini_post_id=>@mpid,:liking=>true)\n @return = true\n format.html { render :json => @return }\n else\n @return = false\n format.html { render :json => @return }\n end\n end\n end","title":""},{"docid":"bf795e194197fe553d88c5e86a97d42b","score":"0.5902704","text":"def fb_like(like_url, custom_options={})\n options = {\n href: like_url,\n layout: \"button_count\",\n action: \"like\",\n share: false,\n show_faces: false,\n width: 90\n }\n\n options.merge! custom_options\n\n social_plugin(\"like\", options)\n end","title":""},{"docid":"e6023f1cc51d0cde70def9609db2a3ab","score":"0.59007674","text":"def like\n self.authenticate_token\n\n Rails.logger.info request.query_parameters.inspect\n api_call_start = Time.now.to_f\n\n # 1. Create a new like and associate it with the snap_id in params.\n # 2. LIKES are unique, only one LIKE per authenticated user\n # (add unique index on album, snap, user composite)\n c = Like.create(\n :album_id => params[:album_id],\n :snap_id => params[:snap_id],\n :user_id => @current_user.id\n )\n\n response = {:success => \"true\"}\n\n api_call_duration = Time.now.to_f - api_call_start\n LOGGING::Logging.logfunction(request,@current_user.id,'snap#like',nil,nil,api_call_duration,nil,nil,nil)\n\n respond_to do |format|\n format.xml { render :xml => response }\n format.json { render :json => response }\n end\n end","title":""},{"docid":"b7e51b8462ea1d3f7e56fc55b598c4e0","score":"0.5899515","text":"def user_has_liked?\n client = Instagram.client(access_token: @access_token)\n media = client.media_shortcode(@campaign.target)\n media.user_has_liked\n end","title":""},{"docid":"69d3ebc4b0a3292e760098a1f0c0fd68","score":"0.58912534","text":"def liked?(picture)\n liked.include?(picture)\n end","title":""},{"docid":"f6f5bfe769c50b2a283010c939b24749","score":"0.58896387","text":"def liked?(image_id)\n !Like.exist?(id, image_id).blank?\n end","title":""},{"docid":"3c7c3797577be1a19ad6222f0be5d107","score":"0.58872503","text":"def likes?(object)\n likes.exists?(:likeable_id => object.id, :likeable_type => object.class.to_s)\n end","title":""},{"docid":"24443890510ab2e3161d2046be33b371","score":"0.5886783","text":"def like!(user)\n @like = likes.create!(user_id: user.id)\n end","title":""},{"docid":"350200eee8468e4402669c6c05250829","score":"0.5885223","text":"def like?(post)\n !!self.likes.find_by(post_id: post.id)\n end","title":""},{"docid":"1f6d63501d62bbe8ef6db003d3d3ef58","score":"0.5884831","text":"def setLike(value)\n @likes = value\n end","title":""},{"docid":"1f6d63501d62bbe8ef6db003d3d3ef58","score":"0.5884831","text":"def setLike(value)\n @likes = value\n end","title":""},{"docid":"63dcf9d84e75c13943a653d6bd8b1bcf","score":"0.5879782","text":"def like\n @listing = Listing.find(params[:id])\n if current_user.liked? @listing\n redirect_to listing_path, notice: \"already liked by you!\"\n else\n @listing.liked_by current_user\n redirect_to listing_path, notice: \"Thanks for liking me!\"\n end\n end","title":""},{"docid":"bc6472edb2e06eb9b66848898f0c604b","score":"0.5875205","text":"def like!(other_user)\n @like = likes.create!(user_id: other_user.id)\n end","title":""},{"docid":"cd8fce067a9ee2dfe8d2915f7b03de4c","score":"0.5872218","text":"def verify_user_likes_likeable\n @like = Like.where('user_id = ? AND likeable_id = ? AND likeable_type = ?', current_user, @likeable, @likeable.class.name).first\n if @like.blank?\n flash[:warning] = '이미 콘텐츠를 좋아하지 않습니다'\n respond_to do |format|\n format.js { render 'layouts/redirect' }\n format.html { redirect_to root_url }\n end\n end\n end","title":""},{"docid":"2e5096e991d8c334f7a338ee16a9f903","score":"0.586847","text":"def lookup_like(ip,comment_id)\n search = Like.find_by(user: ip, comment_id: comment_id)\n if (search == nil || search.liked == 0)\n return 0\n else\n return 1\n end\n end","title":""},{"docid":"b373d74e0393b6b842b6c41a1e74e4a9","score":"0.5860319","text":"def likes?(object)\n verbs_of_interest = %w(like unlike)\n\n query = Activity.joins(:verb)\n .by_activity_object_id(object.id)\n .by_actor_id(guid)\n .merge(Verb.by_display_name(verbs_of_interest))\n\n query.count.odd?\n end","title":""},{"docid":"9d7d9927298a33cd57bfe2ef370a2d96","score":"0.5859236","text":"def liked?\n return @likes\n end","title":""},{"docid":"7ee2e88c6bb99d5aac1bfd6a8a006012","score":"0.5851307","text":"def user_like(user_id)\n likes.find_by( user_id: user_id )\n end","title":""},{"docid":"20c18d445dab7fdff4714e41bcf41313","score":"0.58435786","text":"def entitylike!\n return if BackendProxy.entitylike?(params[:entity].to_sym)\n render_error :not_found, 'Requested entity type could not be found'\n end","title":""},{"docid":"f58102cf668d3863d67fb754958609a0","score":"0.5842014","text":"def like? post_id\n user_like.include?(post_id)\n end","title":""},{"docid":"26fc95739e9d7d5c55c5961a8941763b","score":"0.58358043","text":"def update_like\n # Get post value\n like_id = params[:like_id]\n like_type = params[:like_type]\n\n # Referer\n referer = request.env['HTTP_REFERER']\n\n # Get like\n like = Like.where(like_id: like_id).where(like_type: like_type)\n count = like.length\n own_like = like.where(user_id: User.current.id)\n own_count = own_like.length\n\n if own_count == 0 then\n # Add\n new_like = Like.new(user_id: User.current.id, like_id: like_id, like_type: like_type)\n new_like.save!\n # Get user to send\n case like_type\n when 'issue' then\n kind = I18n.t(:label_issue)\n issue = Issue.find(like_id)\n user_to = User.find(issue.author_id)\n when 'journal' then\n kind = I18n.t(:field_notes)\n journal = Journal.find(like_id)\n user_to = User.find(journal.user_id)\n when 'wiki' then\n kind = I18n.t(:label_wiki)\n wiki_content = WikiPage.find(like_id).content\n user_to = User.find(wiki_content.author_id)\n else\n # nothing to do\n end\n # Send a mail\n if defined? kind\n title = I18n.t(:like_mail_title, :name => User.current.lastname, :kind => kind)\n content = referer.to_s\n LikeMailer.on_like(user_to, title, content).deliver\n end\n count = count + 1\n else\n # Remove\n own_like.delete_all\n count = count - 1\n end\n\n # Retuen json\n result_hash = {}\n result_hash[\"result\"] = count\n render json: result_hash\n end","title":""},{"docid":"2caf5d5685cb5a4383cef5b420027862","score":"0.58310884","text":"def liked?(micropost)\n liked_microposts.include?(micropost)\n end","title":""},{"docid":"b91b5f2082e0b6e716c153edb9576f6b","score":"0.58261627","text":"def like_user(user_id)\n likes.find_by(user_id: user_id)\n end","title":""},{"docid":"5ed3b8c1f5a5dec684ceffd4307aae09","score":"0.5825662","text":"def like?(photo)\n self.likes.find_by_photo_id(photo.id)\n end","title":""},{"docid":"9435788ab893d1c570f44df093adc147","score":"0.5822275","text":"def likes(attrs = {})\n Dribbble::Shot.batch_new token, html_get('/user/likes', attrs), 'shot'\n end","title":""},{"docid":"bcf6942edef7a7e8ec531887774e7d57","score":"0.58199507","text":"def like\n redirect_to root_path, notice: \"You must be logged in to like photos.\" if !current_user\n\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n if @photo.liked_by current_user\n format.html { redirect_to @photo, notice: \"Photo was successfully liked.\" }\n format.json { render json: @photo.likes.size, status: :created, location: @photo }\n else\n format.html { redirect_to @photo, notice: \"Our apologies, but we were unable to like this photo for you.\" }\n format.json { render json: { errors: \"Our apologies, but we were unable to like this photo for you.\" }, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"9e7969f06be70ced8df5c1855803aba9","score":"0.58168685","text":"def likes? video_id\n perform_get(\"/me/likes/#{video_id}\", {})\n end","title":""},{"docid":"d92292ff1084d4d36572d808cbcf5b83","score":"0.5815768","text":"def liked?\n liked_ids = h.current_user.liked_tweets.pluck(:id)\n liked_ids.include?(self.id)\n end","title":""},{"docid":"176e93de1c20f59fcea14ae14af24d9f","score":"0.5808912","text":"def like\n activity = Activity.find_by(id: element.dataset['activity-id'])\n reaction = activity.reactions.find_or_initialize_by(verb: 'like', user_id: current_user.id)\n reaction.persisted? ? reaction.destroy : reaction.save\n morph \"#activity_#{activity.id}likecount\", activity.reactions.where(verb: 'like').count\n end","title":""},{"docid":"9269158ba5b070f8b8bd110698e3c421","score":"0.58088106","text":"def liked?(picture)\n\t\tself.likes.find_by(user_id: self.id, picture_id: picture.id).present?\n\tend","title":""},{"docid":"31c609c78fba194ee2e21996457b0ef4","score":"0.5806486","text":"def like?(post)\n self.likes.find_by_post_id(post.id)\n end","title":""},{"docid":"47e5ec2e32bb2ff8344561a2b3e4cc8b","score":"0.5802715","text":"def like\n temp = params[:like]\n #do set_recipe\n like = Like.create(like: params[:like], chef: current_user, recipe: @recipe)\n \n if like.valid? #check validation\n \n #params[:like] would return true if thumb-up, false if thumb-down, this is passed here from show.html.erb\n if temp == 'true'\n #update likecount to database here\n @recipe.likecount = @recipe.likecount + 1\n #@recipe.likecount = @recipe.thumbs_up_total\n @recipe.save\n #\n flash[:success] = \"You liked \\\"#{@recipe.name}\\\" recipe!\"\n else\n flash[:success] = \"You disliked \\\"#{@recipe.name}\\\" recipe!\"\n end\n \n else\n flash[:danger] = \"You already vote for this recipe!\"\n end\n \n redirect_to :back #because we have thumbs in index page and show page, we want the user to stay at that current page.\n \n end","title":""},{"docid":"c2fdfa7b187093ecc8e501633fb921fe","score":"0.5799341","text":"def like\n like = Like.new(user_id: params[:user_id], \n likeable_id: params[:id], likeable_type: 'Comment')\n \n if like.save\n render json: like\n else\n render json: like.errors.full_messages, status: :unprocessable_entity\n end\n end","title":""},{"docid":"a78ab8f1b769a9dc34aebd1e58ad5cc7","score":"0.5798346","text":"def like?(likeable)\n likes.where(likeable: likeable).present?\n end","title":""},{"docid":"baa6dd8dbed7bf88e656c119c4c099ea","score":"0.57940346","text":"def has_users_like(user)\n\t\tself.likes.where({user: user}).any?\n\tend","title":""},{"docid":"baa6dd8dbed7bf88e656c119c4c099ea","score":"0.57940346","text":"def has_users_like(user)\n\t\tself.likes.where({user: user}).any?\n\tend","title":""},{"docid":"ee95763c760a3e8875d8643d7c019595","score":"0.5785042","text":"def do_like_dislike_song\n actor = current_user\n begin\n @song = Song.find(params[:id])\n @should_like = params[:do_like].present? && params[:do_like] == \"1\"\n if @should_like\n @song.liked_by(actor)\n @liked = 1\n else\n @song.disliked_by(actor)\n @liked = 0\n end\n render :text =>\"{like:#{@liked}}\" and return\n rescue =>exp\n logger.error \"Error in ArtistMusic::DoLikeSong :=> #{exp.message}\"\n render :nothing => true and return\n end\n end","title":""},{"docid":"98e5b718715838fa3d592b372623e03c","score":"0.5784388","text":"def like(other, reason)\n normalize_reason(reason)\n \n return :cannot_like_self if self == other\n return :cannot_like_for_the_same_reason if liked?(other, reason)\n \n if not admin?\n return :no_credits_left if self.credit == 0\n return :reach_limit if liked(other).try(:size).to_i >= Settings.likes_limit\n self.credit -= 1\n self.save\n end\n \n other.credit += 1\n other.awesome += 1\n other.awesomenesses << Awesomeness.new(\n :giver_id => self.id,\n :reason => reason\n )\n other.save\n true\n end","title":""},{"docid":"975733df9e276207a568fe144a66e37e","score":"0.57843214","text":"def unlike!\n connection.delete(\"/photos/#{id}/like\")\n true\n end","title":""},{"docid":"c5261ac53c59955ace3684745b5eb2e8","score":"0.577591","text":"def like?(post)\n self.likes.find_by_post_id(post.id)\n end","title":""},{"docid":"bcd992e0b657b3e0845b4752d7b40366","score":"0.57755417","text":"def add_like_on(post_id)\n @session.post('facebook.stream.addLike', {:post_id=>post_id})\n end","title":""}],"string":"[\n {\n \"docid\": \"333d11c7bd58dbf8697794252e52091b\",\n \"score\": \"0.6891309\",\n \"text\": \"def like!(user)\\n response = @client.quill.post \\\"/api/v3.0/message/#{id}/like/\\\", {:collection_id => conversation.id, :lftoken => user.token}\\n if response.success?\\n true\\n else\\n raise APIException.new(response.body)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"656d3a8b9a796a5e567ad87b9515c8c8\",\n \"score\": \"0.68269\",\n \"text\": \"def like?\\n response[\\\"like\\\"]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"656d3a8b9a796a5e567ad87b9515c8c8\",\n \"score\": \"0.68269\",\n \"text\": \"def like?\\n response[\\\"like\\\"]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"caf35cbd8acb7a8991093c0879eb768e\",\n \"score\": \"0.6761038\",\n \"text\": \"def like\\n\\n @subscriber = current_subscriber\\n # TODO\\n # Send preference to either predicion io or ahoy\\n\\n log('like')\\n\\n render json: { success: true }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"058ba108003cf3753438573aa4e6aa8e\",\n \"score\": \"0.675965\",\n \"text\": \"def like!\\n post(\\\"/likes\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0f84c0883d61b4842a0581d6107cc1f0\",\n \"score\": \"0.6721806\",\n \"text\": \"def like\\n add_opinion('Comment was successfully liked.', 'There was an error liking this comment.') do |comment|\\n comment.like(current_user)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1c9ac992bd57b6cee956e0488678d838\",\n \"score\": \"0.671511\",\n \"text\": \"def try_like(micropost)\\n if self.likes(micropost)\\n \\n like = micropost.get_upvotes.where(voter_id: self.id).pluck(:id).first\\n Notification.create(user_id: micropost.user_id, notified_by_id: self.id, micropost_id: micropost.id, like_id: like, notice_type: \\\"like\\\")\\n MicropostBrodcastJob.perform_later(micropost, \\\"like\\\", \\\"true\\\", self.id)\\n return true\\n else\\n return false\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a934d2cbaa8d2f742193ae5820cf359d\",\n \"score\": \"0.6696768\",\n \"text\": \"def like\\n StatsManager::StatsD.time(Settings::StatsConstants.api['frame']['like']) do\\n @frame = Frame.find(params[:frame_id])\\n return render_error(404, \\\"could not find frame with id #{params[:frame_id]}\\\") unless @frame\\n\\n if current_user\\n if @new_frame = dupe_to_watch_later(@frame)\\n last_ancestor = Frame.find(@frame.frame_ancestors.last)\\n @originator = last_ancestor && last_ancestor.creator\\n @status = 200\\n end\\n else\\n @frame.like!\\n last_ancestor = Frame.find(@frame.frame_ancestors.last)\\n @originator = last_ancestor && last_ancestor.creator\\n @status = 200\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2833964810a675eb659cb3c6e78da17a\",\n \"score\": \"0.66770154\",\n \"text\": \"def like(user)\\n like = self.likes.build({})\\n like.user_id = user.id\\n if like.save\\n send_notification_email(:like, user)\\n return true\\n else\\n return false\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"065e8db3a78117ca59c72b315e9d9fcb\",\n \"score\": \"0.66605496\",\n \"text\": \"def like\\n @like_number = @like_number + 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2d09e4a46e7d234404e821ba286792fc\",\n \"score\": \"0.65763587\",\n \"text\": \"def like\\n like = resource.toggle_like!(current_user)\\n data = { outfit: resource.as_api_response(show_template, template_injector) }\\n message = like ? 'Liked Successfully' : 'Unliked Successfully'\\n render_success(data: data, message: message)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e5ee43fa32f3d57b92ad13047d373541\",\n \"score\": \"0.65608585\",\n \"text\": \"def likes?(_)\\n false\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ab31899e096b60cd74e63f8b31eb33f6\",\n \"score\": \"0.65574557\",\n \"text\": \"def like\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"de55d2e7f43cd5ac6f242421940d0bdb\",\n \"score\": \"0.65367216\",\n \"text\": \"def like?(message)\\n like_messages.include?(message)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"10a4bf87117ad5a3109ab789f8c47e02\",\n \"score\": \"0.6530752\",\n \"text\": \"def like!\\n return true if has_liked?\\n return false unless valid?\\n return false unless validator_response\\n persist!\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"19e5f3fa00e5cebfb6074459623977d1\",\n \"score\": \"0.6457696\",\n \"text\": \"def like\\n @comment = Comment.find(params[:id])\\n @current_user.like!(@comment)\\n # raise 'hell'\\n redirect_to user_path(@current_user.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a59331cc5135d3e2ce60c457d5e0afba\",\n \"score\": \"0.6436676\",\n \"text\": \"def like\\n add_opinion(t('articles.like.success'), t('articles.like.fail')) do |article|\\n article.like(current_user)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"376f4022c616eec0747307f19f6656e9\",\n \"score\": \"0.6433333\",\n \"text\": \"def is_likeable?\\n true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"376f4022c616eec0747307f19f6656e9\",\n \"score\": \"0.6433333\",\n \"text\": \"def is_likeable?\\n true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"702779edc1d961fd54a87a5c1e2f8ea4\",\n \"score\": \"0.6409179\",\n \"text\": \"def like\\n raise IncapableOfUpdateMethods.new(\\\"Cannot update content without stored request\\\") if request.nil?\\n request.api.post(object.id, \\\"likes\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7572942eabcf085bdace5a0793d2906e\",\n \"score\": \"0.6404337\",\n \"text\": \"def like_tout(uid)\\n response = post(\\\"touts/#{uid}/likes\\\")\\n if JSON.parse(response.body)[\\\"like\\\"][\\\"status\\\"] == \\\"liked\\\"\\n true\\n else\\n false\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cac7fcce6f3069dbb7f4db65458393e2\",\n \"score\": \"0.63901657\",\n \"text\": \"def like\\n logger.info \\\"Post :: Post like toggle request by user #{current_user.username}.\\\"\\n p = Post.find_by_id(params[:id])\\n if is_valid?(p)\\n if !p.liked_by?(current_user)\\n p.like!(current_user)\\n else\\n p.unlike!(current_user)\\n end\\n end\\n render :text => p.like_count\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e69135d22525d4717971608eb2cf698c\",\n \"score\": \"0.63876796\",\n \"text\": \"def like!\\n self.like_count = self.like_count + 1\\n self.save\\n logger.debug \\\"User :: #{self.username} liked.\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a4084d2113a83da8927ebf9564e05922\",\n \"score\": \"0.63628125\",\n \"text\": \"def like(model)\\n unless self.liked?(model)\\n model.before_liked_by(self) if model.respond_to?('before_liked_by')\\n model.likes.create!(liker: self)\\n model.likers << self\\n model.inc(:likers_count, 1)\\n model.after_liked_by(self) if model.respond_to?('after_liked_by')\\n self.before_like(model) if self.respond_to?('before_like')\\n self.inc(:likes_count, 1)\\n self.after_like(model) if self.respond_to?('after_like')\\n return true\\n else\\n return false\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2888e4f1020066f919b51ba679435908\",\n \"score\": \"0.6355591\",\n \"text\": \"def liked?(_)\\n\\t\\tfalse\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"37b424fc7b10c95928107ddbd9deebbc\",\n \"score\": \"0.6303558\",\n \"text\": \"def like\\n\\t\\tlike = Like.create(like: params[:like], chef: current_user, recipe: @recipe)\\n\\t\\tif like.valid?\\n\\t\\t\\tflash[:success] = \\\"Your selection was successful\\\"\\n\\t\\t\\tredirect_to :back\\n\\t\\telse\\n\\t\\t\\tflash[:danger] = \\\"You can only like/dislike a recipe once\\\"\\n\\t\\t\\tredirect_to :back\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb7e6d9b742b8d20bcef30f133f8dde8\",\n \"score\": \"0.629766\",\n \"text\": \"def like\\n liked = current_user.like(@card)\\n\\n render :show, status: :ok\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dde01333519654eea4472ca90c272f86\",\n \"score\": \"0.6285413\",\n \"text\": \"def like\\n result = \\\"success\\\"\\n if Likes.where(user_id: params[:user], model_id: params[:id]).first.blank?\\n like = Likes.new(user_id: params[:user],\\n model_id: params[:id], value: true)\\n like.save\\n result = \\\"1\\\"\\n else\\n like = Likes.where(user_id: params[:user], model_id: params[:id]).first\\n like.value = !like.value\\n if like.value?\\n result = \\\"1\\\"\\n else\\n result = \\\"0\\\"\\n end\\n\\n like.save\\n end\\n\\n render :text=>result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b7c7af3cdf11fcc54d9200b478121d4a\",\n \"score\": \"0.62764984\",\n \"text\": \"def like_if_not_in_db(media)\\n return false if media.exists_in_db?(@table_likes)\\n\\n if like_media(media.id)\\n @total_likes += 1\\n print_success_message(action: :like, number: @total_likes, data: @media.id)\\n media.insert_into_db(@table_likes)\\n sleep_rand(28, 36)\\n true\\n else\\n false\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"31acf7cda3a5d17cba528547ad2b2da4\",\n \"score\": \"0.62615734\",\n \"text\": \"def has_liked?\\n Like.exists?(campaign_id: @campaign.id, user_id: @user.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3d4f21f0f6d2b8bf56d6a7729851bf9a\",\n \"score\": \"0.62443733\",\n \"text\": \"def like\\n @like_number = @like_number + 1\\n reset_updated_at\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"99ee6c8a67a68e5da0408964e39c2da8\",\n \"score\": \"0.62399274\",\n \"text\": \"def like(options = {})\\n user = options.delete(:user)\\n put(:like, :like => options).tap{|res|\\n if (user and res.instance_of?(Net::HTTPOK))\\n #TODO: Following line is adding a very large current_user object in the users cache too many times.\\n self.attributes[\\\"like_to\\\"] = self.attributes[\\\"like_to\\\"] + [user]\\n self.attributes[\\\"actions\\\"] = (self.actions.delete_if {|action| action == \\\"like\\\" } << \\\"unlike\\\").join(\\\", \\\")\\n Tibbr::Message.update_cache(user, self, {:only_update_if_exists => true})\\n end\\n }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f269bb46f94e345cf61f86bf99f980ce\",\n \"score\": \"0.6207382\",\n \"text\": \"def is_liked\\n like = current_post.likes.find_by(user_id: current_user.id)\\n render json: like.present?, status: :ok\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2f01978f9505b05c6b2935d93154251e\",\n \"score\": \"0.61870426\",\n \"text\": \"def like\\n @access_token = rest_graph.access_token\\n if @access_token\\n @user = rest_graph.get('/me')\\n @user_id = @user['id']\\n end\\n\\n @msg_id = params[:msg_id]\\n @msg = Msg.find_by_msg_id(@msg_id)\\n @msg_like = @msg[:like]\\n\\n if ((@msg_like.index(@user_id)).nil?)\\n @msg_like.push(@user_id)\\n else\\n @msg_like.delete(@user_id)\\n end\\n\\n @msg.update_attribute( :like, @msg_like )\\n @msg = Msg.find_by_msg_id(@msg_id)\\n\\n render :json => {:msg => @msg}.to_json\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e313ac1a17838e0718088bc3a24566e7\",\n \"score\": \"0.6183906\",\n \"text\": \"def like\\n @beer = Beer.find params[:id]\\n\\n respond_to do |format|\\n if current_user.like @beer\\n format.json { head :ok }\\n format.xml { head :ok }\\n else\\n format.json { head :unprocessable_entity }\\n format.xml { head :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"142aeaa21c7d1cb68bc6d4b8cd493622\",\n \"score\": \"0.6153666\",\n \"text\": \"def like\\n @good = Good.find(params[:goodid])\\n if current_user.nil?\\n render text: \\\"no_login\\\"\\n else\\n @good.like(current_user.id)\\n render text: \\\"liked\\\"\\n end\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"20b5477caaade5159201994908bc2da8\",\n \"score\": \"0.6152657\",\n \"text\": \"def update_like\\n # Get post value\\n like_id = params[:like_id]\\n like_type = params[:like_type]\\n\\n # Referer\\n referer = request.env['HTTP_REFERER']\\n\\n # Get like\\n like = Like.where(like_id: like_id).where(like_type: like_type)\\n count = like.length\\n own_like = like.where(user_id: User.current.id)\\n own_count = own_like.length\\n\\n if own_count == 0 then\\n # Get user to send\\n case like_type\\n when 'issue' then\\n kind = I18n.t(:label_issue)\\n issue = Issue.find(like_id)\\n user_to = User.find(issue.author_id)\\n author_id = issue.author_id\\n when 'journal' then\\n kind = I18n.t(:field_notes)\\n journal = Journal.find(like_id)\\n user_to = User.find(journal.user_id)\\n author_id = journal.user_id\\n when 'wiki' then\\n kind = I18n.t(:label_wiki)\\n wiki_content = WikiPage.find(like_id).content\\n user_to = User.find(wiki_content.author_id)\\n author_id = wiki_content.author_id\\n else\\n # nothing to do\\n end\\n # Add\\n new_like = Like.new(user_id: User.current.id, like_id: like_id, author_id: author_id, like_type: like_type)\\n new_like.save!\\n # Send a mail\\n if LikeConstants::ENABLE_MAIL_NOTIFICATION == 1 && defined? kind\\n title = I18n.t(:like_mail_title, :name => User.current.lastname, :kind => kind)\\n content = referer.to_s\\n LikeMailer.on_like(user_to, title, content).deliver\\n end\\n count = count + 1\\n else\\n # Remove\\n own_like.delete_all\\n count = count - 1\\n end\\n\\n # Create senders string\\n latest_like = Like.where(like_id: like_id).where(like_type: like_type)\\n latest_like_sender_ids = latest_like.pluck(:user_id)\\n latest_like_senders = User.where(id: latest_like_sender_ids)\\n senders = \\\"\\\"\\n latest_like_senders.each {|user|\\n senders += \\\"\\\" + CGI.escapeHTML(user.name) + \\\"
\\\"\\n }\\n\\n # Return json\\n result_hash = {}\\n result_hash[\\\"count\\\"] = count\\n result_hash[\\\"senders\\\"] = senders\\n render json: result_hash\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5c5d86f6a4426e9b50487e3c016fb429\",\n \"score\": \"0.61489457\",\n \"text\": \"def is_liked?\\n Like.where(user: current_user.id, tweet: params[:tweet_id]).exists?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8aa377edfe1def4299a0cba0dd59a890\",\n \"score\": \"0.6144198\",\n \"text\": \"def like\\n method = request.method.downcase.to_sym\\n url = \\\"media/#{params[:uid]}/likes\\\"\\n query = \\\"access_token=#{current_user.access_token}\\\"\\n if method == :delete\\n response = Star::Requester.delete(\\\"#{url}?#{query}\\\")\\n elsif method == :post\\n response = Star::Requester.post(url, query)\\n end\\n if photo = Photo.find_by_uid(params[:uid])\\n photo.queue_for_updates(true)\\n end\\n render text: response.body.to_json, content_type: response.headers[\\\"Content-Type\\\"]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"410fb15112f85c66ad4400112c942f25\",\n \"score\": \"0.61388\",\n \"text\": \"def like_image\\n @like += 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"63852ed610a8b32592f3f4017363a595\",\n \"score\": \"0.6129263\",\n \"text\": \"def is_liked?\\n Like.where(user: current_user.id, tweet:params[:tweet_id]).exists?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6ead8845c174e3142923cade2a88c0fd\",\n \"score\": \"0.61106807\",\n \"text\": \"def liked?(user_id)\\n !!user_like(user_id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d8d6448c7ce02e51b4c90ccdae90268f\",\n \"score\": \"0.60926366\",\n \"text\": \"def like?(user)\\n liking_users.include?(user)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1753a992444b9754bfced71c30b2a886\",\n \"score\": \"0.60918564\",\n \"text\": \"def like?(post)\\n likes.find_by_post_id(post.id) ? true : false\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7a4291b4b37544f2a1e54fc990cfe92b\",\n \"score\": \"0.60521066\",\n \"text\": \"def like\\n @classroomcomment.liked_by current_user\\n redirect_to @urltoredirect\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"29a1e6b8ff0c70545d1195696b15efed\",\n \"score\": \"0.6015055\",\n \"text\": \"def set_like\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"360e6fba76496c7a7a595a31ad9b606e\",\n \"score\": \"0.6011874\",\n \"text\": \"def increment_like_count\\n return if verb != \\\"like\\\" || direct_activity_object.blank?\\n\\n direct_activity_object.increment!(:like_count)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"360e6fba76496c7a7a595a31ad9b606e\",\n \"score\": \"0.6011874\",\n \"text\": \"def increment_like_count\\n return if verb != \\\"like\\\" || direct_activity_object.blank?\\n\\n direct_activity_object.increment!(:like_count)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e7e70b1aa1016600af5b67f9c1588b47\",\n \"score\": \"0.6008548\",\n \"text\": \"def like\\n begin\\n # If everything goes well we can just return the results\\n render status: 200, json: Chain.like_chain(params)\\n rescue Exceptions::TPException => e\\n # One of the exceptions we anticipated - return the embedded status and message\\n render status: e.code, json: { message: e.message }\\n rescue => e\\n # Something else went wrong, log it\\n p e\\n # Return a 500 error with generic message\\n render status: 500, json: { message: \\\"Internal Server Error\\\" }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"644887e08b06a51a644ccedc3b730a03\",\n \"score\": \"0.5994782\",\n \"text\": \"def likes?(micropost)\\n\\t\\tlikes.include?(micropost)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"babefaeb579c318f58b4b76efa6c776a\",\n \"score\": \"0.59854406\",\n \"text\": \"def liked_by?(liking_user)\\n if check_user(liking_user)\\n new_like = Like.new(:user_id => liking_user.id, :post_id => self.id)\\n !new_like.valid?\\n else\\n false\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"08113b4268ddff01f19e21153e5ca857\",\n \"score\": \"0.5978856\",\n \"text\": \"def friends_like(place)\\n\\t\\t# Total number of likes of the place, including me\\n\\t\\tlikes = place.post_activity.children.joins(:activity_verb).where('activity_verbs.name' => \\\"like\\\")\\n\\t\\tfriend_likes = likes.joins(:channel).joins('INNER JOIN contacts ON contacts.receiver_id = channels.author_id').\\n\\t\\t\\twhere('contacts.sender_id' => current_subject).where('contacts.ties_count > 0')\\n\\n\\t\\tfriend_likes.count\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c9473cd7921f3117de90376cbfb25651\",\n \"score\": \"0.59413946\",\n \"text\": \"def fb_like(like_url, custom_options={})\\n options = {\\n :href => like_url,\\n :send => false,\\n :layout => \\\"button_count\\\",\\n :show_faces => false,\\n :width => 90\\n }\\n\\n options.merge! custom_options\\n\\n content_tag(:div, \\\"\\\", :class => \\\"fb-like\\\", :data => options)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"172ece000fa16e434d49b39acca36906\",\n \"score\": \"0.59272194\",\n \"text\": \"def like\\n # user = current_user\\n if !params[:user_id].nil?\\n if User.exists? id: params[:user_id]\\n target_user = User.find(params[:user_id])\\n\\n if current_user.follows?(target_user) # Unlike\\n # REMOVED unlike\\n # current_user.unfollow!(target_user)\\n else # Like\\n current_user.follow!(target_user)\\n\\n # Send notifications to target user \\n end\\n\\n # Return friends list\\n friends = WhisperNotification.myfriends(current_user.id)\\n\\n if !friends.blank?\\n users = FriendByWhisper.friends_json(friends, current_user)\\n users = JSON.parse(users).delete_if(&:blank?)\\n users = users.sort_by { |hsh| hsh[:timestamp] }\\n\\n render json: success(users.reverse, \\\"data\\\")\\n else\\n render json: success(Array.new, \\\"data\\\")\\n end\\n else\\n render json: error(\\\"Sorry, this user doesn't exist\\\")\\n end\\n else\\n render json: error(\\\"Sorry, user_id required\\\")\\n end\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c5b08a1ecb0873a327b5f17508d35ef8\",\n \"score\": \"0.5918627\",\n \"text\": \"def user_can_like(user_id)\\n\\t\\tif self.likes.where(user_id: user_id).length > 0\\n\\t\\t\\treturn false\\n\\t\\tend\\n\\n\\t\\treturn true\\n\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c5b08a1ecb0873a327b5f17508d35ef8\",\n \"score\": \"0.5918627\",\n \"text\": \"def user_can_like(user_id)\\n\\t\\tif self.likes.where(user_id: user_id).length > 0\\n\\t\\t\\treturn false\\n\\t\\tend\\n\\n\\t\\treturn true\\n\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c5b08a1ecb0873a327b5f17508d35ef8\",\n \"score\": \"0.5918627\",\n \"text\": \"def user_can_like(user_id)\\n\\t\\tif self.likes.where(user_id: user_id).length > 0\\n\\t\\t\\treturn false\\n\\t\\tend\\n\\n\\t\\treturn true\\n\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9c5009a638e1bc2181b0e2833c5b2eaf\",\n \"score\": \"0.5917508\",\n \"text\": \"def is_liked?\\n liked_count > 0 rescue nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aaca82b03387ef3865ab05c7ce716fc8\",\n \"score\": \"0.5908886\",\n \"text\": \"def like\\n found = PostLike.find_by(user_id: current_user.id, post_id: post_like_params[:post_id])\\n if found \\n render json: { error: \\\"Failed to like post, post has already been liked by this user.\\\" }\\n else\\n if current_user.id === post_like_params[:user_id]\\n new_like = PostLike.create(post_like_params)\\n end\\n post = Post.find(params[:post_id])\\n if new_like.valid?\\n render json: {post: PostSerializer.new(post)}, status: :accepted\\n else\\n render json: {error: \\\"Failed to like post\\\"}, status: :not_acceptable\\n end\\n end\\n\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c6d2cbdee0c0274613ecfd96ee7175a5\",\n \"score\": \"0.59051687\",\n \"text\": \"def like\\n @mpid = params['mp_id']\\n respond_to do |format|\\n if MiniPostLiking.create(:user_id=>current_user.id,:mini_post_id=>@mpid,:liking=>true)\\n @return = true\\n format.html { render :json => @return }\\n else\\n @return = false\\n format.html { render :json => @return }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bf795e194197fe553d88c5e86a97d42b\",\n \"score\": \"0.5902704\",\n \"text\": \"def fb_like(like_url, custom_options={})\\n options = {\\n href: like_url,\\n layout: \\\"button_count\\\",\\n action: \\\"like\\\",\\n share: false,\\n show_faces: false,\\n width: 90\\n }\\n\\n options.merge! custom_options\\n\\n social_plugin(\\\"like\\\", options)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6023f1cc51d0cde70def9609db2a3ab\",\n \"score\": \"0.59007674\",\n \"text\": \"def like\\n self.authenticate_token\\n\\n Rails.logger.info request.query_parameters.inspect\\n api_call_start = Time.now.to_f\\n\\n # 1. Create a new like and associate it with the snap_id in params.\\n # 2. LIKES are unique, only one LIKE per authenticated user\\n # (add unique index on album, snap, user composite)\\n c = Like.create(\\n :album_id => params[:album_id],\\n :snap_id => params[:snap_id],\\n :user_id => @current_user.id\\n )\\n\\n response = {:success => \\\"true\\\"}\\n\\n api_call_duration = Time.now.to_f - api_call_start\\n LOGGING::Logging.logfunction(request,@current_user.id,'snap#like',nil,nil,api_call_duration,nil,nil,nil)\\n\\n respond_to do |format|\\n format.xml { render :xml => response }\\n format.json { render :json => response }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b7e51b8462ea1d3f7e56fc55b598c4e0\",\n \"score\": \"0.5899515\",\n \"text\": \"def user_has_liked?\\n client = Instagram.client(access_token: @access_token)\\n media = client.media_shortcode(@campaign.target)\\n media.user_has_liked\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"69d3ebc4b0a3292e760098a1f0c0fd68\",\n \"score\": \"0.58912534\",\n \"text\": \"def liked?(picture)\\n liked.include?(picture)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f6f5bfe769c50b2a283010c939b24749\",\n \"score\": \"0.58896387\",\n \"text\": \"def liked?(image_id)\\n !Like.exist?(id, image_id).blank?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c7c3797577be1a19ad6222f0be5d107\",\n \"score\": \"0.58872503\",\n \"text\": \"def likes?(object)\\n likes.exists?(:likeable_id => object.id, :likeable_type => object.class.to_s)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"24443890510ab2e3161d2046be33b371\",\n \"score\": \"0.5886783\",\n \"text\": \"def like!(user)\\n @like = likes.create!(user_id: user.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"350200eee8468e4402669c6c05250829\",\n \"score\": \"0.5885223\",\n \"text\": \"def like?(post)\\n !!self.likes.find_by(post_id: post.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1f6d63501d62bbe8ef6db003d3d3ef58\",\n \"score\": \"0.5884831\",\n \"text\": \"def setLike(value)\\n @likes = value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1f6d63501d62bbe8ef6db003d3d3ef58\",\n \"score\": \"0.5884831\",\n \"text\": \"def setLike(value)\\n @likes = value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"63dcf9d84e75c13943a653d6bd8b1bcf\",\n \"score\": \"0.5879782\",\n \"text\": \"def like\\n @listing = Listing.find(params[:id])\\n if current_user.liked? @listing\\n redirect_to listing_path, notice: \\\"already liked by you!\\\"\\n else\\n @listing.liked_by current_user\\n redirect_to listing_path, notice: \\\"Thanks for liking me!\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bc6472edb2e06eb9b66848898f0c604b\",\n \"score\": \"0.5875205\",\n \"text\": \"def like!(other_user)\\n @like = likes.create!(user_id: other_user.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cd8fce067a9ee2dfe8d2915f7b03de4c\",\n \"score\": \"0.5872218\",\n \"text\": \"def verify_user_likes_likeable\\n @like = Like.where('user_id = ? AND likeable_id = ? AND likeable_type = ?', current_user, @likeable, @likeable.class.name).first\\n if @like.blank?\\n flash[:warning] = '이미 콘텐츠를 좋아하지 않습니다'\\n respond_to do |format|\\n format.js { render 'layouts/redirect' }\\n format.html { redirect_to root_url }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2e5096e991d8c334f7a338ee16a9f903\",\n \"score\": \"0.586847\",\n \"text\": \"def lookup_like(ip,comment_id)\\n search = Like.find_by(user: ip, comment_id: comment_id)\\n if (search == nil || search.liked == 0)\\n return 0\\n else\\n return 1\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b373d74e0393b6b842b6c41a1e74e4a9\",\n \"score\": \"0.5860319\",\n \"text\": \"def likes?(object)\\n verbs_of_interest = %w(like unlike)\\n\\n query = Activity.joins(:verb)\\n .by_activity_object_id(object.id)\\n .by_actor_id(guid)\\n .merge(Verb.by_display_name(verbs_of_interest))\\n\\n query.count.odd?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d7d9927298a33cd57bfe2ef370a2d96\",\n \"score\": \"0.5859236\",\n \"text\": \"def liked?\\n return @likes\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7ee2e88c6bb99d5aac1bfd6a8a006012\",\n \"score\": \"0.5851307\",\n \"text\": \"def user_like(user_id)\\n likes.find_by( user_id: user_id )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"20c18d445dab7fdff4714e41bcf41313\",\n \"score\": \"0.58435786\",\n \"text\": \"def entitylike!\\n return if BackendProxy.entitylike?(params[:entity].to_sym)\\n render_error :not_found, 'Requested entity type could not be found'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f58102cf668d3863d67fb754958609a0\",\n \"score\": \"0.5842014\",\n \"text\": \"def like? post_id\\n user_like.include?(post_id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"26fc95739e9d7d5c55c5961a8941763b\",\n \"score\": \"0.58358043\",\n \"text\": \"def update_like\\n # Get post value\\n like_id = params[:like_id]\\n like_type = params[:like_type]\\n\\n # Referer\\n referer = request.env['HTTP_REFERER']\\n\\n # Get like\\n like = Like.where(like_id: like_id).where(like_type: like_type)\\n count = like.length\\n own_like = like.where(user_id: User.current.id)\\n own_count = own_like.length\\n\\n if own_count == 0 then\\n # Add\\n new_like = Like.new(user_id: User.current.id, like_id: like_id, like_type: like_type)\\n new_like.save!\\n # Get user to send\\n case like_type\\n when 'issue' then\\n kind = I18n.t(:label_issue)\\n issue = Issue.find(like_id)\\n user_to = User.find(issue.author_id)\\n when 'journal' then\\n kind = I18n.t(:field_notes)\\n journal = Journal.find(like_id)\\n user_to = User.find(journal.user_id)\\n when 'wiki' then\\n kind = I18n.t(:label_wiki)\\n wiki_content = WikiPage.find(like_id).content\\n user_to = User.find(wiki_content.author_id)\\n else\\n # nothing to do\\n end\\n # Send a mail\\n if defined? kind\\n title = I18n.t(:like_mail_title, :name => User.current.lastname, :kind => kind)\\n content = referer.to_s\\n LikeMailer.on_like(user_to, title, content).deliver\\n end\\n count = count + 1\\n else\\n # Remove\\n own_like.delete_all\\n count = count - 1\\n end\\n\\n # Retuen json\\n result_hash = {}\\n result_hash[\\\"result\\\"] = count\\n render json: result_hash\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2caf5d5685cb5a4383cef5b420027862\",\n \"score\": \"0.58310884\",\n \"text\": \"def liked?(micropost)\\n liked_microposts.include?(micropost)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b91b5f2082e0b6e716c153edb9576f6b\",\n \"score\": \"0.58261627\",\n \"text\": \"def like_user(user_id)\\n likes.find_by(user_id: user_id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5ed3b8c1f5a5dec684ceffd4307aae09\",\n \"score\": \"0.5825662\",\n \"text\": \"def like?(photo)\\n self.likes.find_by_photo_id(photo.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9435788ab893d1c570f44df093adc147\",\n \"score\": \"0.5822275\",\n \"text\": \"def likes(attrs = {})\\n Dribbble::Shot.batch_new token, html_get('/user/likes', attrs), 'shot'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bcf6942edef7a7e8ec531887774e7d57\",\n \"score\": \"0.58199507\",\n \"text\": \"def like\\n redirect_to root_path, notice: \\\"You must be logged in to like photos.\\\" if !current_user\\n\\n @photo = Photo.find(params[:id])\\n\\n respond_to do |format|\\n if @photo.liked_by current_user\\n format.html { redirect_to @photo, notice: \\\"Photo was successfully liked.\\\" }\\n format.json { render json: @photo.likes.size, status: :created, location: @photo }\\n else\\n format.html { redirect_to @photo, notice: \\\"Our apologies, but we were unable to like this photo for you.\\\" }\\n format.json { render json: { errors: \\\"Our apologies, but we were unable to like this photo for you.\\\" }, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9e7969f06be70ced8df5c1855803aba9\",\n \"score\": \"0.58168685\",\n \"text\": \"def likes? video_id\\n perform_get(\\\"/me/likes/#{video_id}\\\", {})\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d92292ff1084d4d36572d808cbcf5b83\",\n \"score\": \"0.5815768\",\n \"text\": \"def liked?\\n liked_ids = h.current_user.liked_tweets.pluck(:id)\\n liked_ids.include?(self.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"176e93de1c20f59fcea14ae14af24d9f\",\n \"score\": \"0.5808912\",\n \"text\": \"def like\\n activity = Activity.find_by(id: element.dataset['activity-id'])\\n reaction = activity.reactions.find_or_initialize_by(verb: 'like', user_id: current_user.id)\\n reaction.persisted? ? reaction.destroy : reaction.save\\n morph \\\"#activity_#{activity.id}likecount\\\", activity.reactions.where(verb: 'like').count\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9269158ba5b070f8b8bd110698e3c421\",\n \"score\": \"0.58088106\",\n \"text\": \"def liked?(picture)\\n\\t\\tself.likes.find_by(user_id: self.id, picture_id: picture.id).present?\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"31c609c78fba194ee2e21996457b0ef4\",\n \"score\": \"0.5806486\",\n \"text\": \"def like?(post)\\n self.likes.find_by_post_id(post.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"47e5ec2e32bb2ff8344561a2b3e4cc8b\",\n \"score\": \"0.5802715\",\n \"text\": \"def like\\n temp = params[:like]\\n #do set_recipe\\n like = Like.create(like: params[:like], chef: current_user, recipe: @recipe)\\n \\n if like.valid? #check validation\\n \\n #params[:like] would return true if thumb-up, false if thumb-down, this is passed here from show.html.erb\\n if temp == 'true'\\n #update likecount to database here\\n @recipe.likecount = @recipe.likecount + 1\\n #@recipe.likecount = @recipe.thumbs_up_total\\n @recipe.save\\n #\\n flash[:success] = \\\"You liked \\\\\\\"#{@recipe.name}\\\\\\\" recipe!\\\"\\n else\\n flash[:success] = \\\"You disliked \\\\\\\"#{@recipe.name}\\\\\\\" recipe!\\\"\\n end\\n \\n else\\n flash[:danger] = \\\"You already vote for this recipe!\\\"\\n end\\n \\n redirect_to :back #because we have thumbs in index page and show page, we want the user to stay at that current page.\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c2fdfa7b187093ecc8e501633fb921fe\",\n \"score\": \"0.5799341\",\n \"text\": \"def like\\n like = Like.new(user_id: params[:user_id], \\n likeable_id: params[:id], likeable_type: 'Comment')\\n \\n if like.save\\n render json: like\\n else\\n render json: like.errors.full_messages, status: :unprocessable_entity\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a78ab8f1b769a9dc34aebd1e58ad5cc7\",\n \"score\": \"0.5798346\",\n \"text\": \"def like?(likeable)\\n likes.where(likeable: likeable).present?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"baa6dd8dbed7bf88e656c119c4c099ea\",\n \"score\": \"0.57940346\",\n \"text\": \"def has_users_like(user)\\n\\t\\tself.likes.where({user: user}).any?\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"baa6dd8dbed7bf88e656c119c4c099ea\",\n \"score\": \"0.57940346\",\n \"text\": \"def has_users_like(user)\\n\\t\\tself.likes.where({user: user}).any?\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee95763c760a3e8875d8643d7c019595\",\n \"score\": \"0.5785042\",\n \"text\": \"def do_like_dislike_song\\n actor = current_user\\n begin\\n @song = Song.find(params[:id])\\n @should_like = params[:do_like].present? && params[:do_like] == \\\"1\\\"\\n if @should_like\\n @song.liked_by(actor)\\n @liked = 1\\n else\\n @song.disliked_by(actor)\\n @liked = 0\\n end\\n render :text =>\\\"{like:#{@liked}}\\\" and return\\n rescue =>exp\\n logger.error \\\"Error in ArtistMusic::DoLikeSong :=> #{exp.message}\\\"\\n render :nothing => true and return\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"98e5b718715838fa3d592b372623e03c\",\n \"score\": \"0.5784388\",\n \"text\": \"def like(other, reason)\\n normalize_reason(reason)\\n \\n return :cannot_like_self if self == other\\n return :cannot_like_for_the_same_reason if liked?(other, reason)\\n \\n if not admin?\\n return :no_credits_left if self.credit == 0\\n return :reach_limit if liked(other).try(:size).to_i >= Settings.likes_limit\\n self.credit -= 1\\n self.save\\n end\\n \\n other.credit += 1\\n other.awesome += 1\\n other.awesomenesses << Awesomeness.new(\\n :giver_id => self.id,\\n :reason => reason\\n )\\n other.save\\n true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"975733df9e276207a568fe144a66e37e\",\n \"score\": \"0.57843214\",\n \"text\": \"def unlike!\\n connection.delete(\\\"/photos/#{id}/like\\\")\\n true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c5261ac53c59955ace3684745b5eb2e8\",\n \"score\": \"0.577591\",\n \"text\": \"def like?(post)\\n self.likes.find_by_post_id(post.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bcd992e0b657b3e0845b4752d7b40366\",\n \"score\": \"0.57755417\",\n \"text\": \"def add_like_on(post_id)\\n @session.post('facebook.stream.addLike', {:post_id=>post_id})\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":183,"cells":{"query_id":{"kind":"string","value":"72df8adcf114f0c2e7c57b98ebda4171"},"query":{"kind":"string","value":"move the object to the target path prefix and return the path the object was moved to"},"positive_passages":{"kind":"list like","value":[{"docid":"ff2884e7ab718c27499e72a694835201","score":"0.7314651","text":"def move_s3_object(obj, target_path_prefix)\n move_target_key = \"#{target_path_prefix}/#{layer_name_with_extension(obj.key)}\"\n obj.move_to(\n bucket: BUCKET,\n key: move_target_key\n )\n\n move_target_key\n end","title":""}],"string":"[\n {\n \"docid\": \"ff2884e7ab718c27499e72a694835201\",\n \"score\": \"0.7314651\",\n \"text\": \"def move_s3_object(obj, target_path_prefix)\\n move_target_key = \\\"#{target_path_prefix}/#{layer_name_with_extension(obj.key)}\\\"\\n obj.move_to(\\n bucket: BUCKET,\\n key: move_target_key\\n )\\n\\n move_target_key\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"7de75f8f9f401b50e28810d50083e5a5","score":"0.71903634","text":"def move!(new_path); end","title":""},{"docid":"fd95c504fcf0c36b81be687678c14b58","score":"0.6774222","text":"def move(to_path)\n self.cloud_api.move(self, to_path)\n end","title":""},{"docid":"76ee989fde0c214970007f7f0e6f99f7","score":"0.66179365","text":"def move(params = {})\n params ||= {}\n params[:path] = @attributes[:path]\n raise MissingParameterError.new(\"Current object doesn't have a path\") unless @attributes[:path]\n raise InvalidParameterError.new(\"Bad parameter: path must be an String\") if params.dig(:path) and !params.dig(:path).is_a?(String)\n raise InvalidParameterError.new(\"Bad parameter: destination must be an String\") if params.dig(:destination) and !params.dig(:destination).is_a?(String)\n raise MissingParameterError.new(\"Parameter missing: path\") unless params.dig(:path)\n raise MissingParameterError.new(\"Parameter missing: destination\") unless params.dig(:destination)\n\n Api.send_request(\"/file_actions/move/#{Addressable::URI.encode_component(params[:path])}\", :post, params, @options)\n end","title":""},{"docid":"3dc6d79ceea1b7161befbadb98019531","score":"0.6562258","text":"def move(destination)\n FileUtils.mv(self, destination)\n destination.to_pathname\n end","title":""},{"docid":"7093f7975b59dabcdbf50d976d50bbe9","score":"0.6551192","text":"def move(target)\n require 'fileutils'\n FileUtils.mv(path, target)\n end","title":""},{"docid":"0b811db947f147f337f5f70ea20b097d","score":"0.6507869","text":"def move(params = {})\n params ||= {}\n params[:path] = @attributes[:path]\n raise MissingParameterError.new(\"Current object doesn't have a path\") unless @attributes[:path]\n raise InvalidParameterError.new(\"Bad parameter: path must be an String\") if params[:path] and !params[:path].is_a?(String)\n raise InvalidParameterError.new(\"Bad parameter: destination must be an String\") if params[:destination] and !params[:destination].is_a?(String)\n raise MissingParameterError.new(\"Parameter missing: path\") unless params[:path]\n raise MissingParameterError.new(\"Parameter missing: destination\") unless params[:destination]\n\n Api.send_request(\"/file_actions/move/#{@attributes[:path]}\", :post, params, @options)\n end","title":""},{"docid":"4aa59484c458ec25b1c807be980c2002","score":"0.6407588","text":"def move(new_path, new_repo = nil, new_ref = nil)\n if new_repo.nil?\n if is_absolute_path(new_path)\n @flag_absolute = true\n set_path new_path\n else\n set_path move_path(new_path)\n end\n else\n @flag_absolute = false\n set_path new_path\n @repo = new_repo\n @ref = new_ref\n end\n end","title":""},{"docid":"66ca91859fff4a08d5b4119e27ecce4c","score":"0.63843876","text":"def move(target)\n @client.exec!(\"sudo mv #{@path} #{target.shellescape}\")\n end","title":""},{"docid":"d8a3d15717f57b245843dfda8b3110ac","score":"0.62717646","text":"def move(user, path)\n self.in_path = { user.id.to_s => path }\n self\n end","title":""},{"docid":"3d269988b911534fb462329a8a73a07d","score":"0.6248417","text":"def move_path(opts)\n path_ary = [opts[:move]]\n if opts[:from]\n full_from = File.expand_path(opts[:from])\n full_current = File.expand_path(dir)\n end\n path_ary << basename\n File.join(*path_ary)\n end","title":""},{"docid":"c7f305d56979219d06b86cbc43dd22a5","score":"0.6245312","text":"def move_into(tarname, source_path, source_node)\n end","title":""},{"docid":"eb8eb7e89d20d51c0f53303cec369d18","score":"0.6221482","text":"def move_into(target_name, _source_path, source_node)\n # We only support FSExt\\Directory or FSExt\\File objects, so\n # anything else we want to quickly reject.\n if !source_node.is_a?(self.class) && !source_node.is_a?(File)\n return false\n end\n\n # PHP allows us to access protected properties from other objects, as\n # long as they are defined in a class that has a shared inheritence\n # with the current class.\n ::File.rename(source_node.path, @path + '/' + target_name)\n\n true\n end","title":""},{"docid":"f306bdd68f26a9d4a8584f86d43154b4","score":"0.6209205","text":"def move(io, path)\n if io.respond_to?(:path)\n FileUtils.mv io.path, path\n else\n FileUtils.mv io.storage.path(io.id), path\n io.storage.clean(io.storage.path(io.id)) if io.storage.clean?\n end\n end","title":""},{"docid":"4d9be1a2985c0986c8b20ab5c53bfe64","score":"0.61902493","text":"def after_move_path\n resources_path\n end","title":""},{"docid":"fc7f6c367d1648b4a4f03cf68dec329a","score":"0.61692595","text":"def move(path, options = T.unsafe(nil), &block); end","title":""},{"docid":"424bc8a87fbbe40027e0f9f468134755","score":"0.6152979","text":"def move_me(target, the_basename = @basename)\n target = Pathstring.new(target)\n Log.debug(\"Move #{file.basename} to #{target}\")\n\n # Make it a full path\n if target.directory? then # (When moveto is a file path, then no changes are made to it.)\n target_file = target / the_basename\n else\n target_file = target\n end\n\n # Make sure the target directory exists\n Log.debug \"Making sure all directories for #{target_file} exists.\"\n # File.makedirs(target) # Make sure the directory exists makedirs comes in 1.9??\n if not target_file.dirname.exist? then raise \"Target directory for #{target_file} is missing\" end # Temp solution\n\n # Make sure there does not already exist a file with the same name\n if target_file.exist? then\n new_target_file = target_file.parent.next_available_path_for(target_file)\n CLASSLOG.info \"'#{target_file}' already exist in '#{target_file.parent}', so renaming original file to '#{new_target_file}'.\"\n target_file = new_target_file\n # Log.warn \"A file with that name already exists (#{target_file}).\"\n # return # Aborts TODO: ev rename etc.\n end\n\n # Make the move\n Log.debug \"Moves #{@basename} to #{target_file}.\"\n @file.rename(target_file)\n\n # Internal bookkeeping\n @file = target_file\n @extension = @file.extname\n @basename = @file.basename # Note, the file may have been renamed in the move\n @name = File::basename(@file.to_s, @extension)\n end","title":""},{"docid":"1825fcda53a303f68efee825217afe11","score":"0.61199915","text":"def move_to(x, y)\n append_path_data \"m\", x, y\n end","title":""},{"docid":"d59a20b206146055010b0cb7ff04367c","score":"0.6110781","text":"def move(source, destination)\n # I don't know a way to write this all in a single sql query that's\n # also compatible across db engines, so we're letting PHP do all the\n # updates. Much slower, but it should still be pretty fast in most\n # cases.\n update = \"UPDATE #{table_name} SET path = ? WHERE id = ?\"\n @sequel.fetch(\"SELECT id, path FROM #{@table_name} WHERE path = ? OR path LIKE ?\", source, \"#{source}/%\") do |row|\n # Sanity check. SQL may select too many records, such as records\n # with different cases.\n next if row[:path] != source && row[:path].index(\"#{source}/\") != 0\n\n trailing_part = row[:path][source.size + 1..-1]\n new_path = destination\n new_path << \"/#{trailing_part}\" unless trailing_part.blank?\n\n update_ds = @sequel[\n update,\n new_path,\n row[:id]\n ]\n update_ds.update\n end\n end","title":""},{"docid":"11f9f9213ddfe2be58c18a1948be2410","score":"0.61099833","text":"def move(source, destination)\n @data.each do |path, props|\n if path == source\n @data[destination] = props\n @data.delete(path)\n next\n end\n\n if path.index(\"#{source}/\") == 0\n @data[\"#{destination}#{path[source.length + 1..-1]}\"] = props\n @data.delete(path)\n end\n end\n end","title":""},{"docid":"0db017e244015b409f950de1aeb7784c","score":"0.6106994","text":"def move_folder(target_team, employee)\n destination = destination_label(target_team)\n puts \"Moving #{employee} to #{destination}\"\n move_entry = ObservationEntry.new(content: \"Moving #{employee} to #{destination}\")\n employee_file = employee.file\n employee_file.insert move_entry\n current_folder = File.dirname employee_file.path\n FileUtils.move(current_folder, target_team_path(target_team, employee))\n end","title":""},{"docid":"850129c8a7371081278b92e26bbb08cd","score":"0.60935795","text":"def move_and_clean_me(target)\n target = Pathstring(target)\n CLASSLOG.debug \"Clean #{file.basename} and move to #{target.next_available_path_for(@prefered_name + @extension)}\"\n move_me(target, target.next_available_path_for(@prefered_name + @extension))\n end","title":""},{"docid":"355fb4e0596f1dd9ae1c07ea07c917cb","score":"0.6074547","text":"def move(path, initheader = nil)\n request(Move.new(path, initheader))\n end","title":""},{"docid":"355fb4e0596f1dd9ae1c07ea07c917cb","score":"0.6074547","text":"def move(path, initheader = nil)\n request(Move.new(path, initheader))\n end","title":""},{"docid":"277b406d4002b9373c704c59cf97fb87","score":"0.6072734","text":"def mv(to)\n FileUtils.mv(@path, to)\n to\n end","title":""},{"docid":"969d0ce72554ea78f38cc6e7881bd393","score":"0.6045683","text":"def smove(source, destination, member); end","title":""},{"docid":"969d0ce72554ea78f38cc6e7881bd393","score":"0.6045683","text":"def smove(source, destination, member); end","title":""},{"docid":"82d1ae873e8f9937221a783e98a0e39e","score":"0.60412496","text":"def move(source_path, destination_path)\n (source_dir,) = Tilia::Http::UrlUtil.split_path(source_path)\n (destination_dir, destination_name) = Tilia::Http::UrlUtil.split_path(destination_path)\n\n if source_dir == destination_dir\n # If this is a 'local' rename, it means we can just trigger a rename.\n source_node = node_for_path(source_path)\n source_node.name = destination_name\n else\n new_parent_node = node_for_path(destination_dir)\n move_success = false\n if new_parent_node.is_a? IMoveTarget\n # The target collection may be able to handle the move\n source_node = node_for_path(source_path)\n move_success = new_parent_node.move_into(destination_name, source_path, source_node)\n end\n unless move_success\n copy(source_path, destination_path)\n node_for_path(source_path).delete\n end\n end\n mark_dirty(source_dir)\n mark_dirty(destination_dir)\n end","title":""},{"docid":"477e2edfcdec8e936a39ebdc22050f43","score":"0.60129315","text":"def move_to_path(resource, dest_path, depth)\n logger.debug \"Radiant WebDAV: move_to_path(#{resource}, #{dest_path}, #{depth})\"\n raise WebDavErrors::TODO409Error\n end","title":""},{"docid":"64d2ed00744062d673c651e62d7ae3f6","score":"0.6011698","text":"def move_to(path)\n mv '.', path\n self.working_dir = expand path\n self\n end","title":""},{"docid":"8bda471d25ab6f6d7687f2f87d8cbbbd","score":"0.6004769","text":"def move(_source, _destination)\n end","title":""},{"docid":"0a38a48adaff4ee27632ab1a619590dc","score":"0.60027605","text":"def move_to!(x, y)\n append_path_data \"M\", x, y\n end","title":""},{"docid":"236f95309b30dfeab7f9f7fac7ac8900","score":"0.59961534","text":"def moved_to\n @moved_to\n end","title":""},{"docid":"663cec78b6afc6b067fe3f4442b64ee0","score":"0.59900475","text":"def move\n return NotFound unless(resource.exist?)\n return BadRequest unless request.depth == :infinity\n\n return BadRequest unless dest = request.destination\n if status = dest.validate(host: request.host,\n resource_path: resource.path)\n return status\n end\n\n resource.lock_check if resource.supports_locking?\n\n return resource.move dest.path_info, request.overwrite?\n end","title":""},{"docid":"2815bd7d6684a351509422824b9d415e","score":"0.5962205","text":"def move(f)\n i = 0\n begin\n dest = target_name(f, i)\n full_dest = File.join(@config.target_path, dest)\n puts \"#{f} -> #{full_dest}\"\n i += 1\n end while File.exist?(full_dest)\n \n FileUtils.mv(f, full_dest)\n\n # Return both the name and the full path\n [dest, full_dest]\n end","title":""},{"docid":"8ec841dbe122a854cb8a85ff4e2eef4a","score":"0.5961127","text":"def move_to_path(target_path)\n move_to(cotta.file(target_path))\n end","title":""},{"docid":"35bc7285cbe0c990aa9a6a422d31c9c1","score":"0.5953538","text":"def move(object, new_parent)\n unless object\n raise \"[Xcodeproj] Attempt to move nil object to `#{new_parent}`.\"\n end\n unless new_parent\n raise \"[Xcodeproj] Attempt to move object `#{object}` to nil parent.\"\n end\n if new_parent.equal?(object)\n raise \"[Xcodeproj] Attempt to move object `#{object}` to itself.\"\n end\n if parents(new_parent).include?(object)\n raise \"[Xcodeproj] Attempt to move object `#{object}` to a child object `#{new_parent}`.\"\n end\n\n object.parent.children.delete(object)\n new_parent << object\n end","title":""},{"docid":"bdf208244a5441b66b9bbbb2f09a7995","score":"0.5934028","text":"def move(path, destination)\n mv(path, destination)\n info \"Moving %s to %s\", path, destination\n end","title":""},{"docid":"3e2451afe5cf067b283100e253c46288","score":"0.58637816","text":"def path\n @target.path\n end","title":""},{"docid":"89eb93a1858f8ad2014d88112616b683","score":"0.5845044","text":"def move(remote_path_from, remote_path_to)\n return false\n end","title":""},{"docid":"269303bfb96fb9d950db1dcc1ac23481","score":"0.5836585","text":"def mv(arg)\n dest = arg_to_path(arg)\n\n raise \"Error: can't move #{self.inspect} because source location doesn't exist.\" unless exists?\n\n FileUtils.mv(path, dest)\n dest\n end","title":""},{"docid":"7f6ff49866e7fbedd558e2dc8c9869c3","score":"0.58326626","text":"def move_to(folder, source = nil)\n if folder.is_a?(ContextIO::Folder)\n folder_name = folder.name\n source_label = folder.source.label\n else\n folder_name = folder.to_s\n source_label = source.to_s\n end\n\n params = {dst_folder: folder_name, move: 1}\n params[:dst_source] = source_label unless source_label.empty?\n api.request(:post, resource_url, params)['success']\n end","title":""},{"docid":"3a915e73065e3c424c584f9b4161e2a5","score":"0.58306044","text":"def move\n @dir.move_forward\n end","title":""},{"docid":"f2946e602dd6945db162848f8bb3c7f8","score":"0.5827508","text":"def move_to(dir)\n\t\tmoved = copy_to(dir)\n\t\tdestroy :sure, :dir\n\t\tmimic(moved)\n\tend","title":""},{"docid":"0222c1648e755d95f64d03d626fbdba8","score":"0.5772128","text":"def move(source, dest)\n #TODO\n end","title":""},{"docid":"f1394e319b41e776201b37da3ff6a72c","score":"0.576901","text":"def move from, to\n `mv #{f(from)} #{f(to)}`\n end","title":""},{"docid":"fd81382da31d86326c6f3f1d7d5cd079","score":"0.57606775","text":"def file_move(from_path, to_path)\n params = {\n \"root\" => @root,\n \"from_path\" => format_path(from_path, false),\n \"to_path\" => format_path(to_path, false),\n }\n response = @token.post(build_url(\"/fileops/move\", params))\n parse_response(response)\n end","title":""},{"docid":"b40d760267ccce2a5c46a28b0021e969","score":"0.57575536","text":"def object_to_path\n execute(\"object-to-path\")\n end","title":""},{"docid":"59cb4df3113a8ce972ddd5cf4b1053a2","score":"0.5751059","text":"def mv(dst, opts={})\n dst = BFS.norm_path(dst)\n @bucket.mv(path, dst, opts)\n @path = dst\n end","title":""},{"docid":"62b75c2ae46187ed411b887b98d77808","score":"0.5741257","text":"def move(new_path)\n FileUtils.mv(path, new_path)\n end","title":""},{"docid":"53089c82f0f600a21ffa9adfc5554513","score":"0.5726619","text":"def move_to(x, y)\n @path.moveToPoint(point(x, y))\n end","title":""},{"docid":"034b95d7dee4c452ea797173ddba5fc6","score":"0.57138216","text":"def move_to(new_path, permissions = T.unsafe(nil), directory_permissions = T.unsafe(nil), keep_filename = T.unsafe(nil)); end","title":""},{"docid":"9c54b1de1c7dde4792482363a8b43260","score":"0.5707554","text":"def move_to(target_file)\n target_file.parent.mkdirs\n factory.system.move_file(path, target_file.path)\n end","title":""},{"docid":"b310fe73103807360dbe4099ca0c758d","score":"0.57011914","text":"def move_to_trash(location, path)\n source_dir = \"#{location}:#{path}\"\n url = api_url(:move_to_trash, params: {source_dir: source_dir})\n response = HTTParty.get(url)\n if response.success?\n return true\n else\n return false\n end\n end","title":""},{"docid":"1621a754b245fef2f405e21eb52e6117","score":"0.5688159","text":"def move(path)\n FileUtils.mv path, pathname unless @pretend\n rescue Errno::ENOENT\n 1\n end","title":""},{"docid":"669cca9edbe24a2508073f76dc67df37","score":"0.5687137","text":"def mv(dst, **opts)\n dst = BFS.norm_path(dst)\n @bucket.mv(path, dst, **opts)\n @path = dst\n end","title":""},{"docid":"632c2a75a90bf5eea920263c5430df18","score":"0.5684841","text":"def file_move(from_path, to_path)\n params = {\n \"root\" => @root,\n \"from_path\" => format_path(from_path, false),\n \"to_path\" => format_path(to_path, false),\n }\n response = @session.do_post \"/fileops/move\", params\n Dropbox::parse_response(response)\n end","title":""},{"docid":"36a8ad209ecfbb76afc52d5a77c56c67","score":"0.56795853","text":"def move(src_path, dest_path)\n copy(src_path, dest_path)\n delete(src_path)\n nil\n end","title":""},{"docid":"bf5b9827be95e290fd620e54acab93b6","score":"0.5671633","text":"def target_path\n return destination + subdir + directory_name\n end","title":""},{"docid":"674775e94ae7c872d6cd8c95735a982a","score":"0.5670115","text":"def fetch_object_path(path, object)\n path.inject(object) { |x, r| x.public_send(r) }\n end","title":""},{"docid":"2ee22e7a3e9576a1da305a7cbf329337","score":"0.5664719","text":"def destination(path); end","title":""},{"docid":"439b102f10ed6b64f7f1f5fdb206e587","score":"0.56615156","text":"def move_obj(obj, p1, p2)\n p1.remove_obj(obj)\n p2.get_obj(obj)\n end","title":""},{"docid":"dbb3720114466cedbf45597512988752","score":"0.56595474","text":"def rename(from_path,to_path);end","title":""},{"docid":"dbb3720114466cedbf45597512988752","score":"0.56595474","text":"def rename(from_path,to_path);end","title":""},{"docid":"d3fcfc53033fb6cfbef3c5bc5a48189e","score":"0.56575125","text":"def move_to_trash\n source_dir = Item.new(Path.new(params[:source_dir]))\n dest_dir_root = Item.new(Path.new(\"TRASH:\" + source_dir.path.input_path))\n\n dest_dir_string = dest_dir_root.path.to_s\n dir_found = false\n i = 1\n while(!dir_found)\n dest_dir = Item.new(Path.new(dest_dir_string))\n if dest_dir.exist?\n dest_dir_string = dest_dir_root.path.to_s + \"_#{i}\"\n i += 1\n else\n dir_found = true\n end\n end\n\n response = {}\n if !source_dir.exist?\n response[:msg] = \"No folder at location, nothing to do\"\n render json: response, status: 200\n elsif source_dir.move_to(dest_dir)\n response[:msg] = \"Success\"\n render json: response, status: 200\n else\n response[:msg] = \"Fail\"\n render json: response, status: 422\n end\n end","title":""},{"docid":"3db3e624709984a955749064ec6b9a51","score":"0.56549734","text":"def move(target_team, employee)\n update_overview_file(target_team, employee)\n move_folder(target_team, employee)\n end","title":""},{"docid":"97f615bad1e806fb70f35d06a13414ef","score":"0.565475","text":"def path_to_object\n return @path_to_object unless @path_to_object.nil?\n\n path = nil\n root_dir.each do |root_dir|\n new_path = druid_tree_path(root_dir)\n old_path = old_druid_tree_path(root_dir)\n if File.directory? new_path\n path = new_path\n @folder_style = :new\n break\n elsif File.directory? old_path\n path = old_path\n @folder_style = :old\n break\n end\n end\n @path_to_object = path\n end","title":""},{"docid":"a193fe4491deca2ee986f7789fb1f72f","score":"0.56536984","text":"def fs_move(from, to)\n FileUtils.mv(File.join(self.git_dir, from), File.join(self.git_dir, to))\n end","title":""},{"docid":"a193fe4491deca2ee986f7789fb1f72f","score":"0.56536984","text":"def fs_move(from, to)\n FileUtils.mv(File.join(self.git_dir, from), File.join(self.git_dir, to))\n end","title":""},{"docid":"c7085cbd84eed4e638250be10035f80d","score":"0.5646859","text":"def to_patch\n { 'op' => 'move', 'from' => @from, 'path' => @path }\n end","title":""},{"docid":"bd53365b27843edfa4094f7f8741407b","score":"0.5642318","text":"def path src, dest\n src.straight_path_to dest\n end","title":""},{"docid":"01ee60425d3156188c76963c65b0fac6","score":"0.5630133","text":"def move_folder(source_path, params = {})\n dest_path = (params.delete(:to) || '/')\n source_folder_id = folder_id(source_path)\n dest_folder_id = folder_id(dest_path)\n\n params = {\n :realfolder => source_folder_id,\n :newparent => dest_folder_id\n }.merge params\n\n moverealfolder params\n\n @tree = folders_hierarchy\n @tree[source_folder_id][:parent] = dest_folder_id\n @tree[source_folder_id][:path] = path_canonize \"#{folder_path(dest_folder_id)}/#{@tree[source_folder_id][:name]}\"\n true\n end","title":""},{"docid":"0dbccb6dd03b901a32233c083af359cc","score":"0.56298524","text":"def move(dest)\n puts 'move'\n end","title":""},{"docid":"61bb6db97769259064b3d10fb8753f84","score":"0.5626271","text":"def path\n location = root? ? \"Object(#{parent.object_id})\" : parent.link.path\n \"#{location}.#{local_path}\"\n end","title":""},{"docid":"0951d973fbd822bc0cce4b3f06384500","score":"0.5621557","text":"def rpartition(path, target)\n _get_str(path).rpartition(_wrap(_get_str(target)))\n end","title":""},{"docid":"4e723a91ab05027b1a34d9f939a3d202","score":"0.5618969","text":"def move(from_path, to_path)\n resp = request('/files/move', from_path: from_path, to_path: to_path)\n parse_tagged_response(resp)\n end","title":""},{"docid":"a58dbce38be80ebc0a7b734c951fc121","score":"0.56178856","text":"def move(path)\n Movement::Input.new(self, path, move_validations).front_end_move_result\n end","title":""},{"docid":"61c3b9c2c99bde42235df272f67f58d3","score":"0.5611568","text":"def find_path_to(target)\n# queue is new array\n queue = Array.new\n# .unshift moves objects to the front \n queue.unshift(@start_node)\n# until the queue is empty\n until queue.empty?\n \n# current is equal to popping the queue (first in queue)\n current = queue.pop\n if target == current[:position]\n return current\n else\n# look for next movies if current moves is empty? not sure\n next_moves(current) if current[:moves].empty?\n# i think it might be finding current moves by unshifting the queue? not sure\n# seems to be adding moves to the queue. idk\n current[:moves].each {|move| queue.unshift(move)}\n end\n end\n nil\n end","title":""},{"docid":"d0d2fee9159cd50ddffd8b54800dfbad","score":"0.5609007","text":"def test_move_other_object\n ::Dir.mkdir(\"#{@temp_dir}/tree1\")\n ::Dir.mkdir(\"#{@temp_dir}/tree2\")\n\n tree = Tree.new(\n SimpleCollection.new(\n 'root',\n [\n Fs::Directory.new(\"#{@temp_dir}/tree1\"),\n FsExt::Directory.new(\"#{@temp_dir}/tree2\")\n ]\n )\n )\n @server.tree = tree\n\n request = Http::Request.new('MOVE', '/tree1', 'Destination' => '/tree2/tree1')\n @server.http_request = request\n @server.exec\n\n assert_equal(201, @response.status)\n assert_equal('', @response.body_as_string)\n\n assert_equal(\n {\n 'Content-Length' => ['0'],\n 'X-Sabre-Version' => [Version::VERSION]\n },\n @response.headers\n )\n\n assert(::File.directory?(\"#{@temp_dir}/tree2/tree1\"))\n end","title":""},{"docid":"9ccbe27849350818cf36ea76374a8b0c","score":"0.5605589","text":"def move(from, to)\n git(\"mv #{from} #{to}\")\n true\n end","title":""},{"docid":"af07d420c2514c529f74427aa7ced235","score":"0.5605265","text":"def move(from_path, to_path)\n\t\t\tresponse = @session.rcp('/files/move_v2', from_path: from_path, to_path: to_path)\n\n\t\t\tparse_metadata(response)\n\t\tend","title":""},{"docid":"b4f2ded3cc92ce966f17e359044b349e","score":"0.56014806","text":"def move(source, destination)\n return unless source.exist?\n make_path(destination.dirname)\n UI.message \"- Moving #{UI.path(source)} to #{UI.path(destination)}\" do\n FileUtils.mv(source.to_s, destination.to_s)\n end\n end","title":""},{"docid":"6f511c171864ad98ff7e4804d5a0ded2","score":"0.559862","text":"def move_to(file, path)\n validate(\n {\n file: file,\n path: path,\n },\n {\n file: { kind_of: String },\n path: { kind_of: String },\n }\n )\n\n file_path_array = File.split(path)\n file_name = file_path_array.pop\n if File.exist?(file) && File.writable?(file)\n FileUtils.mv(\n file,\n File.join(create_cache_path(File.join(file_path_array), true), file_name)\n )\n else\n raise \"Cannot move #{file} to #{path}!\"\n end\n end","title":""},{"docid":"56ba4f90f594d89e396479a10f0cdf07","score":"0.5590295","text":"def move(path, options = {}, &block)\n perform_request Net::HTTP::Move, path, options, &block\n end","title":""},{"docid":"0fdf727833c23899f67295f5afe89e45","score":"0.55852765","text":"def rename(to)\n File.rename(@path, to)\n Path.new(to)\n end","title":""},{"docid":"606a4bfc69bf781c899406d4b887343c","score":"0.557578","text":"def document_move(document_id,new_path)\n make_request(:move,folders_url(new_path) + \"/documents/#{document_id}.xml\")\n end","title":""},{"docid":"17494e8110360492eb3e3e6a9403a97f","score":"0.5574247","text":"def original_destination_root(path, remove_dot = true)\n path = path.dup\n if path.gsub!(destination_stack[0], '.')\n remove_dot ? (path[2..-1] || '') : path\n else\n path\n end\n end","title":""},{"docid":"b21be1ed5376a81b9c8438332b8ab92a","score":"0.5570048","text":"def relative_to_original_destination_root(path, remove_dot = T.unsafe(nil)); end","title":""},{"docid":"920a0e768aa8240fa21a18510ea72354","score":"0.5566871","text":"def move_file(from)\n\t\tfname= \"#{self.class.name}.#{__method__}\"\n\t\tFile.rename(File.join(repository,from), repository)\n\tend","title":""},{"docid":"beea58e51fd931e30367d2330f9de4d2","score":"0.55621535","text":"def _move(src, dest, o)\n raise Errno::EEXIST, \"dest exists -- #{dest}\" if File.exists?(dest) and (not o[:force])\n\n # move same file.\n return if File.absolute_path(src) == File.absolute_path(dest)\n\n # :force. mv \"dir\", \"dira\" and 'dira' exists and is a directory. \n if File.exists?(dest) and File.directory?(dest)\n ls(src) { |pa|\n dest1 = File.join(dest, File.basename(pa.p))\n _move pa.p, dest1, o\n }\n Pa.rm_r src\n\n else\n begin\n Pa.rm_r dest if o[:force] and File.exists?(dest)\n puts \"rename #{src} #{dest}\" if o[:verbose]\n File.rename(src, dest)\n rescue Errno::EXDEV # cross-device\n _copy(src, dest, o)\n Pa.rm_r src\n end\n\n end\n end","title":""},{"docid":"40d1a785b3f22bf6236087535568e0b5","score":"0.555922","text":"def move\n\n end","title":""},{"docid":"9af54ee57b71396f7f0b5038866934ff","score":"0.55567545","text":"def move(to, comment = \"Move #@name to #{to}\")\n return unless exists?\n return if @name == to\n# G.lib.mv(path, repo_file(to))\n message = G.better_commit(comment)\n @revision = message[/Created commit (\\w+):/, 1]\n @name = to\n rescue Git::GitExecuteError => ex\n Ramaze::Log.error(ex)\n nil\n end","title":""},{"docid":"3c9ffd1ed646377d736024360bb52705","score":"0.5552728","text":"def mv_to_path\n FileUtils.mkdir_p ::File.dirname(absolute_path)\n FileUtils.mv temporary_path, absolute_path\n end","title":""},{"docid":"e2a3a83cff85decb345fca59d776c785","score":"0.5549753","text":"def move_dirs; end","title":""},{"docid":"055c77e6b51bb307ac9437f7e237cdd4","score":"0.55486363","text":"def path\n to_obj ? to_obj.path : proxy_path\n end","title":""},{"docid":"f1c901ef8291ea3f2bcc75df67eb57de","score":"0.5539952","text":"def move_to(node_obj, nth = -1)\n ff_move_node(node_obj, nth, false) # false: move to\n end","title":""},{"docid":"18b2f4fd25a35b39b722df7e273c253e","score":"0.55382526","text":"def make_position_path(current, new_position)\n\n# new path is copy of current path & new position\n new_path = copy(current.path + [new_position])\n\n# new position path takes parameters of new position & new path\n PositionPath.new(new_position, new_path) \nend","title":""},{"docid":"87b0f1a845b7f367824fba5fcbd41fea","score":"0.55233836","text":"def move(target, target_id, destination_id)\n query_rest('s_move_node', :action => :move, :target => target, :target_id => target_id, :destination_id => destination_id)\n end","title":""},{"docid":"b2d5f36c5e5504ec5935aebdc4de82ed","score":"0.5512965","text":"def move(src_path, dest_path)\n req = Net::HTTP::Move.new(@basic_path + src_path)\n req['Destination'] = @basic_path + dest_path\n res = @http.request(req)\n validate_status(res, '204')\n end","title":""},{"docid":"26ec35fb30d75d9728a2f69f7f69c3c9","score":"0.5507922","text":"def move(from, to)\n `git mv #{from} #{to} 2> /dev/null`\n true\n end","title":""},{"docid":"7e77a56d494831573f744114265db8e0","score":"0.55065656","text":"def after_move(source, destination)\n return nil if path_filter && !path_filter.call(source)\n # If the destination is filtered, afterUnbind will handle cleaning up\n # the properties.\n return nil if path_filter && !path_filter(destination)\n\n @backend.move(source, destination)\n end","title":""}],"string":"[\n {\n \"docid\": \"7de75f8f9f401b50e28810d50083e5a5\",\n \"score\": \"0.71903634\",\n \"text\": \"def move!(new_path); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fd95c504fcf0c36b81be687678c14b58\",\n \"score\": \"0.6774222\",\n \"text\": \"def move(to_path)\\n self.cloud_api.move(self, to_path)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"76ee989fde0c214970007f7f0e6f99f7\",\n \"score\": \"0.66179365\",\n \"text\": \"def move(params = {})\\n params ||= {}\\n params[:path] = @attributes[:path]\\n raise MissingParameterError.new(\\\"Current object doesn't have a path\\\") unless @attributes[:path]\\n raise InvalidParameterError.new(\\\"Bad parameter: path must be an String\\\") if params.dig(:path) and !params.dig(:path).is_a?(String)\\n raise InvalidParameterError.new(\\\"Bad parameter: destination must be an String\\\") if params.dig(:destination) and !params.dig(:destination).is_a?(String)\\n raise MissingParameterError.new(\\\"Parameter missing: path\\\") unless params.dig(:path)\\n raise MissingParameterError.new(\\\"Parameter missing: destination\\\") unless params.dig(:destination)\\n\\n Api.send_request(\\\"/file_actions/move/#{Addressable::URI.encode_component(params[:path])}\\\", :post, params, @options)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3dc6d79ceea1b7161befbadb98019531\",\n \"score\": \"0.6562258\",\n \"text\": \"def move(destination)\\n FileUtils.mv(self, destination)\\n destination.to_pathname\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7093f7975b59dabcdbf50d976d50bbe9\",\n \"score\": \"0.6551192\",\n \"text\": \"def move(target)\\n require 'fileutils'\\n FileUtils.mv(path, target)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0b811db947f147f337f5f70ea20b097d\",\n \"score\": \"0.6507869\",\n \"text\": \"def move(params = {})\\n params ||= {}\\n params[:path] = @attributes[:path]\\n raise MissingParameterError.new(\\\"Current object doesn't have a path\\\") unless @attributes[:path]\\n raise InvalidParameterError.new(\\\"Bad parameter: path must be an String\\\") if params[:path] and !params[:path].is_a?(String)\\n raise InvalidParameterError.new(\\\"Bad parameter: destination must be an String\\\") if params[:destination] and !params[:destination].is_a?(String)\\n raise MissingParameterError.new(\\\"Parameter missing: path\\\") unless params[:path]\\n raise MissingParameterError.new(\\\"Parameter missing: destination\\\") unless params[:destination]\\n\\n Api.send_request(\\\"/file_actions/move/#{@attributes[:path]}\\\", :post, params, @options)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4aa59484c458ec25b1c807be980c2002\",\n \"score\": \"0.6407588\",\n \"text\": \"def move(new_path, new_repo = nil, new_ref = nil)\\n if new_repo.nil?\\n if is_absolute_path(new_path)\\n @flag_absolute = true\\n set_path new_path\\n else\\n set_path move_path(new_path)\\n end\\n else\\n @flag_absolute = false\\n set_path new_path\\n @repo = new_repo\\n @ref = new_ref\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"66ca91859fff4a08d5b4119e27ecce4c\",\n \"score\": \"0.63843876\",\n \"text\": \"def move(target)\\n @client.exec!(\\\"sudo mv #{@path} #{target.shellescape}\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d8a3d15717f57b245843dfda8b3110ac\",\n \"score\": \"0.62717646\",\n \"text\": \"def move(user, path)\\n self.in_path = { user.id.to_s => path }\\n self\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3d269988b911534fb462329a8a73a07d\",\n \"score\": \"0.6248417\",\n \"text\": \"def move_path(opts)\\n path_ary = [opts[:move]]\\n if opts[:from]\\n full_from = File.expand_path(opts[:from])\\n full_current = File.expand_path(dir)\\n end\\n path_ary << basename\\n File.join(*path_ary)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c7f305d56979219d06b86cbc43dd22a5\",\n \"score\": \"0.6245312\",\n \"text\": \"def move_into(tarname, source_path, source_node)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb8eb7e89d20d51c0f53303cec369d18\",\n \"score\": \"0.6221482\",\n \"text\": \"def move_into(target_name, _source_path, source_node)\\n # We only support FSExt\\\\Directory or FSExt\\\\File objects, so\\n # anything else we want to quickly reject.\\n if !source_node.is_a?(self.class) && !source_node.is_a?(File)\\n return false\\n end\\n\\n # PHP allows us to access protected properties from other objects, as\\n # long as they are defined in a class that has a shared inheritence\\n # with the current class.\\n ::File.rename(source_node.path, @path + '/' + target_name)\\n\\n true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f306bdd68f26a9d4a8584f86d43154b4\",\n \"score\": \"0.6209205\",\n \"text\": \"def move(io, path)\\n if io.respond_to?(:path)\\n FileUtils.mv io.path, path\\n else\\n FileUtils.mv io.storage.path(io.id), path\\n io.storage.clean(io.storage.path(io.id)) if io.storage.clean?\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d9be1a2985c0986c8b20ab5c53bfe64\",\n \"score\": \"0.61902493\",\n \"text\": \"def after_move_path\\n resources_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc7f6c367d1648b4a4f03cf68dec329a\",\n \"score\": \"0.61692595\",\n \"text\": \"def move(path, options = T.unsafe(nil), &block); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"424bc8a87fbbe40027e0f9f468134755\",\n \"score\": \"0.6152979\",\n \"text\": \"def move_me(target, the_basename = @basename)\\n target = Pathstring.new(target)\\n Log.debug(\\\"Move #{file.basename} to #{target}\\\")\\n\\n # Make it a full path\\n if target.directory? then # (When moveto is a file path, then no changes are made to it.)\\n target_file = target / the_basename\\n else\\n target_file = target\\n end\\n\\n # Make sure the target directory exists\\n Log.debug \\\"Making sure all directories for #{target_file} exists.\\\"\\n # File.makedirs(target) # Make sure the directory exists makedirs comes in 1.9??\\n if not target_file.dirname.exist? then raise \\\"Target directory for #{target_file} is missing\\\" end # Temp solution\\n\\n # Make sure there does not already exist a file with the same name\\n if target_file.exist? then\\n new_target_file = target_file.parent.next_available_path_for(target_file)\\n CLASSLOG.info \\\"'#{target_file}' already exist in '#{target_file.parent}', so renaming original file to '#{new_target_file}'.\\\"\\n target_file = new_target_file\\n # Log.warn \\\"A file with that name already exists (#{target_file}).\\\"\\n # return # Aborts TODO: ev rename etc.\\n end\\n\\n # Make the move\\n Log.debug \\\"Moves #{@basename} to #{target_file}.\\\"\\n @file.rename(target_file)\\n\\n # Internal bookkeeping\\n @file = target_file\\n @extension = @file.extname\\n @basename = @file.basename # Note, the file may have been renamed in the move\\n @name = File::basename(@file.to_s, @extension)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1825fcda53a303f68efee825217afe11\",\n \"score\": \"0.61199915\",\n \"text\": \"def move_to(x, y)\\n append_path_data \\\"m\\\", x, y\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d59a20b206146055010b0cb7ff04367c\",\n \"score\": \"0.6110781\",\n \"text\": \"def move(source, destination)\\n # I don't know a way to write this all in a single sql query that's\\n # also compatible across db engines, so we're letting PHP do all the\\n # updates. Much slower, but it should still be pretty fast in most\\n # cases.\\n update = \\\"UPDATE #{table_name} SET path = ? WHERE id = ?\\\"\\n @sequel.fetch(\\\"SELECT id, path FROM #{@table_name} WHERE path = ? OR path LIKE ?\\\", source, \\\"#{source}/%\\\") do |row|\\n # Sanity check. SQL may select too many records, such as records\\n # with different cases.\\n next if row[:path] != source && row[:path].index(\\\"#{source}/\\\") != 0\\n\\n trailing_part = row[:path][source.size + 1..-1]\\n new_path = destination\\n new_path << \\\"/#{trailing_part}\\\" unless trailing_part.blank?\\n\\n update_ds = @sequel[\\n update,\\n new_path,\\n row[:id]\\n ]\\n update_ds.update\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"11f9f9213ddfe2be58c18a1948be2410\",\n \"score\": \"0.61099833\",\n \"text\": \"def move(source, destination)\\n @data.each do |path, props|\\n if path == source\\n @data[destination] = props\\n @data.delete(path)\\n next\\n end\\n\\n if path.index(\\\"#{source}/\\\") == 0\\n @data[\\\"#{destination}#{path[source.length + 1..-1]}\\\"] = props\\n @data.delete(path)\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0db017e244015b409f950de1aeb7784c\",\n \"score\": \"0.6106994\",\n \"text\": \"def move_folder(target_team, employee)\\n destination = destination_label(target_team)\\n puts \\\"Moving #{employee} to #{destination}\\\"\\n move_entry = ObservationEntry.new(content: \\\"Moving #{employee} to #{destination}\\\")\\n employee_file = employee.file\\n employee_file.insert move_entry\\n current_folder = File.dirname employee_file.path\\n FileUtils.move(current_folder, target_team_path(target_team, employee))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"850129c8a7371081278b92e26bbb08cd\",\n \"score\": \"0.60935795\",\n \"text\": \"def move_and_clean_me(target)\\n target = Pathstring(target)\\n CLASSLOG.debug \\\"Clean #{file.basename} and move to #{target.next_available_path_for(@prefered_name + @extension)}\\\"\\n move_me(target, target.next_available_path_for(@prefered_name + @extension))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"355fb4e0596f1dd9ae1c07ea07c917cb\",\n \"score\": \"0.6074547\",\n \"text\": \"def move(path, initheader = nil)\\n request(Move.new(path, initheader))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"355fb4e0596f1dd9ae1c07ea07c917cb\",\n \"score\": \"0.6074547\",\n \"text\": \"def move(path, initheader = nil)\\n request(Move.new(path, initheader))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"277b406d4002b9373c704c59cf97fb87\",\n \"score\": \"0.6072734\",\n \"text\": \"def mv(to)\\n FileUtils.mv(@path, to)\\n to\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"969d0ce72554ea78f38cc6e7881bd393\",\n \"score\": \"0.6045683\",\n \"text\": \"def smove(source, destination, member); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"969d0ce72554ea78f38cc6e7881bd393\",\n \"score\": \"0.6045683\",\n \"text\": \"def smove(source, destination, member); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"82d1ae873e8f9937221a783e98a0e39e\",\n \"score\": \"0.60412496\",\n \"text\": \"def move(source_path, destination_path)\\n (source_dir,) = Tilia::Http::UrlUtil.split_path(source_path)\\n (destination_dir, destination_name) = Tilia::Http::UrlUtil.split_path(destination_path)\\n\\n if source_dir == destination_dir\\n # If this is a 'local' rename, it means we can just trigger a rename.\\n source_node = node_for_path(source_path)\\n source_node.name = destination_name\\n else\\n new_parent_node = node_for_path(destination_dir)\\n move_success = false\\n if new_parent_node.is_a? IMoveTarget\\n # The target collection may be able to handle the move\\n source_node = node_for_path(source_path)\\n move_success = new_parent_node.move_into(destination_name, source_path, source_node)\\n end\\n unless move_success\\n copy(source_path, destination_path)\\n node_for_path(source_path).delete\\n end\\n end\\n mark_dirty(source_dir)\\n mark_dirty(destination_dir)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"477e2edfcdec8e936a39ebdc22050f43\",\n \"score\": \"0.60129315\",\n \"text\": \"def move_to_path(resource, dest_path, depth)\\n logger.debug \\\"Radiant WebDAV: move_to_path(#{resource}, #{dest_path}, #{depth})\\\"\\n raise WebDavErrors::TODO409Error\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"64d2ed00744062d673c651e62d7ae3f6\",\n \"score\": \"0.6011698\",\n \"text\": \"def move_to(path)\\n mv '.', path\\n self.working_dir = expand path\\n self\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8bda471d25ab6f6d7687f2f87d8cbbbd\",\n \"score\": \"0.6004769\",\n \"text\": \"def move(_source, _destination)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0a38a48adaff4ee27632ab1a619590dc\",\n \"score\": \"0.60027605\",\n \"text\": \"def move_to!(x, y)\\n append_path_data \\\"M\\\", x, y\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"236f95309b30dfeab7f9f7fac7ac8900\",\n \"score\": \"0.59961534\",\n \"text\": \"def moved_to\\n @moved_to\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"663cec78b6afc6b067fe3f4442b64ee0\",\n \"score\": \"0.59900475\",\n \"text\": \"def move\\n return NotFound unless(resource.exist?)\\n return BadRequest unless request.depth == :infinity\\n\\n return BadRequest unless dest = request.destination\\n if status = dest.validate(host: request.host,\\n resource_path: resource.path)\\n return status\\n end\\n\\n resource.lock_check if resource.supports_locking?\\n\\n return resource.move dest.path_info, request.overwrite?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2815bd7d6684a351509422824b9d415e\",\n \"score\": \"0.5962205\",\n \"text\": \"def move(f)\\n i = 0\\n begin\\n dest = target_name(f, i)\\n full_dest = File.join(@config.target_path, dest)\\n puts \\\"#{f} -> #{full_dest}\\\"\\n i += 1\\n end while File.exist?(full_dest)\\n \\n FileUtils.mv(f, full_dest)\\n\\n # Return both the name and the full path\\n [dest, full_dest]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8ec841dbe122a854cb8a85ff4e2eef4a\",\n \"score\": \"0.5961127\",\n \"text\": \"def move_to_path(target_path)\\n move_to(cotta.file(target_path))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"35bc7285cbe0c990aa9a6a422d31c9c1\",\n \"score\": \"0.5953538\",\n \"text\": \"def move(object, new_parent)\\n unless object\\n raise \\\"[Xcodeproj] Attempt to move nil object to `#{new_parent}`.\\\"\\n end\\n unless new_parent\\n raise \\\"[Xcodeproj] Attempt to move object `#{object}` to nil parent.\\\"\\n end\\n if new_parent.equal?(object)\\n raise \\\"[Xcodeproj] Attempt to move object `#{object}` to itself.\\\"\\n end\\n if parents(new_parent).include?(object)\\n raise \\\"[Xcodeproj] Attempt to move object `#{object}` to a child object `#{new_parent}`.\\\"\\n end\\n\\n object.parent.children.delete(object)\\n new_parent << object\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bdf208244a5441b66b9bbbb2f09a7995\",\n \"score\": \"0.5934028\",\n \"text\": \"def move(path, destination)\\n mv(path, destination)\\n info \\\"Moving %s to %s\\\", path, destination\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3e2451afe5cf067b283100e253c46288\",\n \"score\": \"0.58637816\",\n \"text\": \"def path\\n @target.path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"89eb93a1858f8ad2014d88112616b683\",\n \"score\": \"0.5845044\",\n \"text\": \"def move(remote_path_from, remote_path_to)\\n return false\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"269303bfb96fb9d950db1dcc1ac23481\",\n \"score\": \"0.5836585\",\n \"text\": \"def mv(arg)\\n dest = arg_to_path(arg)\\n\\n raise \\\"Error: can't move #{self.inspect} because source location doesn't exist.\\\" unless exists?\\n\\n FileUtils.mv(path, dest)\\n dest\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7f6ff49866e7fbedd558e2dc8c9869c3\",\n \"score\": \"0.58326626\",\n \"text\": \"def move_to(folder, source = nil)\\n if folder.is_a?(ContextIO::Folder)\\n folder_name = folder.name\\n source_label = folder.source.label\\n else\\n folder_name = folder.to_s\\n source_label = source.to_s\\n end\\n\\n params = {dst_folder: folder_name, move: 1}\\n params[:dst_source] = source_label unless source_label.empty?\\n api.request(:post, resource_url, params)['success']\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3a915e73065e3c424c584f9b4161e2a5\",\n \"score\": \"0.58306044\",\n \"text\": \"def move\\n @dir.move_forward\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f2946e602dd6945db162848f8bb3c7f8\",\n \"score\": \"0.5827508\",\n \"text\": \"def move_to(dir)\\n\\t\\tmoved = copy_to(dir)\\n\\t\\tdestroy :sure, :dir\\n\\t\\tmimic(moved)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0222c1648e755d95f64d03d626fbdba8\",\n \"score\": \"0.5772128\",\n \"text\": \"def move(source, dest)\\n #TODO\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1394e319b41e776201b37da3ff6a72c\",\n \"score\": \"0.576901\",\n \"text\": \"def move from, to\\n `mv #{f(from)} #{f(to)}`\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fd81382da31d86326c6f3f1d7d5cd079\",\n \"score\": \"0.57606775\",\n \"text\": \"def file_move(from_path, to_path)\\n params = {\\n \\\"root\\\" => @root,\\n \\\"from_path\\\" => format_path(from_path, false),\\n \\\"to_path\\\" => format_path(to_path, false),\\n }\\n response = @token.post(build_url(\\\"/fileops/move\\\", params))\\n parse_response(response)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b40d760267ccce2a5c46a28b0021e969\",\n \"score\": \"0.57575536\",\n \"text\": \"def object_to_path\\n execute(\\\"object-to-path\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"59cb4df3113a8ce972ddd5cf4b1053a2\",\n \"score\": \"0.5751059\",\n \"text\": \"def mv(dst, opts={})\\n dst = BFS.norm_path(dst)\\n @bucket.mv(path, dst, opts)\\n @path = dst\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"62b75c2ae46187ed411b887b98d77808\",\n \"score\": \"0.5741257\",\n \"text\": \"def move(new_path)\\n FileUtils.mv(path, new_path)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53089c82f0f600a21ffa9adfc5554513\",\n \"score\": \"0.5726619\",\n \"text\": \"def move_to(x, y)\\n @path.moveToPoint(point(x, y))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"034b95d7dee4c452ea797173ddba5fc6\",\n \"score\": \"0.57138216\",\n \"text\": \"def move_to(new_path, permissions = T.unsafe(nil), directory_permissions = T.unsafe(nil), keep_filename = T.unsafe(nil)); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9c54b1de1c7dde4792482363a8b43260\",\n \"score\": \"0.5707554\",\n \"text\": \"def move_to(target_file)\\n target_file.parent.mkdirs\\n factory.system.move_file(path, target_file.path)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b310fe73103807360dbe4099ca0c758d\",\n \"score\": \"0.57011914\",\n \"text\": \"def move_to_trash(location, path)\\n source_dir = \\\"#{location}:#{path}\\\"\\n url = api_url(:move_to_trash, params: {source_dir: source_dir})\\n response = HTTParty.get(url)\\n if response.success?\\n return true\\n else\\n return false\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1621a754b245fef2f405e21eb52e6117\",\n \"score\": \"0.5688159\",\n \"text\": \"def move(path)\\n FileUtils.mv path, pathname unless @pretend\\n rescue Errno::ENOENT\\n 1\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"669cca9edbe24a2508073f76dc67df37\",\n \"score\": \"0.5687137\",\n \"text\": \"def mv(dst, **opts)\\n dst = BFS.norm_path(dst)\\n @bucket.mv(path, dst, **opts)\\n @path = dst\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"632c2a75a90bf5eea920263c5430df18\",\n \"score\": \"0.5684841\",\n \"text\": \"def file_move(from_path, to_path)\\n params = {\\n \\\"root\\\" => @root,\\n \\\"from_path\\\" => format_path(from_path, false),\\n \\\"to_path\\\" => format_path(to_path, false),\\n }\\n response = @session.do_post \\\"/fileops/move\\\", params\\n Dropbox::parse_response(response)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36a8ad209ecfbb76afc52d5a77c56c67\",\n \"score\": \"0.56795853\",\n \"text\": \"def move(src_path, dest_path)\\n copy(src_path, dest_path)\\n delete(src_path)\\n nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bf5b9827be95e290fd620e54acab93b6\",\n \"score\": \"0.5671633\",\n \"text\": \"def target_path\\n return destination + subdir + directory_name\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"674775e94ae7c872d6cd8c95735a982a\",\n \"score\": \"0.5670115\",\n \"text\": \"def fetch_object_path(path, object)\\n path.inject(object) { |x, r| x.public_send(r) }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2ee22e7a3e9576a1da305a7cbf329337\",\n \"score\": \"0.5664719\",\n \"text\": \"def destination(path); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"439b102f10ed6b64f7f1f5fdb206e587\",\n \"score\": \"0.56615156\",\n \"text\": \"def move_obj(obj, p1, p2)\\n p1.remove_obj(obj)\\n p2.get_obj(obj)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbb3720114466cedbf45597512988752\",\n \"score\": \"0.56595474\",\n \"text\": \"def rename(from_path,to_path);end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbb3720114466cedbf45597512988752\",\n \"score\": \"0.56595474\",\n \"text\": \"def rename(from_path,to_path);end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d3fcfc53033fb6cfbef3c5bc5a48189e\",\n \"score\": \"0.56575125\",\n \"text\": \"def move_to_trash\\n source_dir = Item.new(Path.new(params[:source_dir]))\\n dest_dir_root = Item.new(Path.new(\\\"TRASH:\\\" + source_dir.path.input_path))\\n\\n dest_dir_string = dest_dir_root.path.to_s\\n dir_found = false\\n i = 1\\n while(!dir_found)\\n dest_dir = Item.new(Path.new(dest_dir_string))\\n if dest_dir.exist?\\n dest_dir_string = dest_dir_root.path.to_s + \\\"_#{i}\\\"\\n i += 1\\n else\\n dir_found = true\\n end\\n end\\n\\n response = {}\\n if !source_dir.exist?\\n response[:msg] = \\\"No folder at location, nothing to do\\\"\\n render json: response, status: 200\\n elsif source_dir.move_to(dest_dir)\\n response[:msg] = \\\"Success\\\"\\n render json: response, status: 200\\n else\\n response[:msg] = \\\"Fail\\\"\\n render json: response, status: 422\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3db3e624709984a955749064ec6b9a51\",\n \"score\": \"0.56549734\",\n \"text\": \"def move(target_team, employee)\\n update_overview_file(target_team, employee)\\n move_folder(target_team, employee)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"97f615bad1e806fb70f35d06a13414ef\",\n \"score\": \"0.565475\",\n \"text\": \"def path_to_object\\n return @path_to_object unless @path_to_object.nil?\\n\\n path = nil\\n root_dir.each do |root_dir|\\n new_path = druid_tree_path(root_dir)\\n old_path = old_druid_tree_path(root_dir)\\n if File.directory? new_path\\n path = new_path\\n @folder_style = :new\\n break\\n elsif File.directory? old_path\\n path = old_path\\n @folder_style = :old\\n break\\n end\\n end\\n @path_to_object = path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a193fe4491deca2ee986f7789fb1f72f\",\n \"score\": \"0.56536984\",\n \"text\": \"def fs_move(from, to)\\n FileUtils.mv(File.join(self.git_dir, from), File.join(self.git_dir, to))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a193fe4491deca2ee986f7789fb1f72f\",\n \"score\": \"0.56536984\",\n \"text\": \"def fs_move(from, to)\\n FileUtils.mv(File.join(self.git_dir, from), File.join(self.git_dir, to))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c7085cbd84eed4e638250be10035f80d\",\n \"score\": \"0.5646859\",\n \"text\": \"def to_patch\\n { 'op' => 'move', 'from' => @from, 'path' => @path }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd53365b27843edfa4094f7f8741407b\",\n \"score\": \"0.5642318\",\n \"text\": \"def path src, dest\\n src.straight_path_to dest\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"01ee60425d3156188c76963c65b0fac6\",\n \"score\": \"0.5630133\",\n \"text\": \"def move_folder(source_path, params = {})\\n dest_path = (params.delete(:to) || '/')\\n source_folder_id = folder_id(source_path)\\n dest_folder_id = folder_id(dest_path)\\n\\n params = {\\n :realfolder => source_folder_id,\\n :newparent => dest_folder_id\\n }.merge params\\n\\n moverealfolder params\\n\\n @tree = folders_hierarchy\\n @tree[source_folder_id][:parent] = dest_folder_id\\n @tree[source_folder_id][:path] = path_canonize \\\"#{folder_path(dest_folder_id)}/#{@tree[source_folder_id][:name]}\\\"\\n true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0dbccb6dd03b901a32233c083af359cc\",\n \"score\": \"0.56298524\",\n \"text\": \"def move(dest)\\n puts 'move'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"61bb6db97769259064b3d10fb8753f84\",\n \"score\": \"0.5626271\",\n \"text\": \"def path\\n location = root? ? \\\"Object(#{parent.object_id})\\\" : parent.link.path\\n \\\"#{location}.#{local_path}\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0951d973fbd822bc0cce4b3f06384500\",\n \"score\": \"0.5621557\",\n \"text\": \"def rpartition(path, target)\\n _get_str(path).rpartition(_wrap(_get_str(target)))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4e723a91ab05027b1a34d9f939a3d202\",\n \"score\": \"0.5618969\",\n \"text\": \"def move(from_path, to_path)\\n resp = request('/files/move', from_path: from_path, to_path: to_path)\\n parse_tagged_response(resp)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a58dbce38be80ebc0a7b734c951fc121\",\n \"score\": \"0.56178856\",\n \"text\": \"def move(path)\\n Movement::Input.new(self, path, move_validations).front_end_move_result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"61c3b9c2c99bde42235df272f67f58d3\",\n \"score\": \"0.5611568\",\n \"text\": \"def find_path_to(target)\\n# queue is new array\\n queue = Array.new\\n# .unshift moves objects to the front \\n queue.unshift(@start_node)\\n# until the queue is empty\\n until queue.empty?\\n \\n# current is equal to popping the queue (first in queue)\\n current = queue.pop\\n if target == current[:position]\\n return current\\n else\\n# look for next movies if current moves is empty? not sure\\n next_moves(current) if current[:moves].empty?\\n# i think it might be finding current moves by unshifting the queue? not sure\\n# seems to be adding moves to the queue. idk\\n current[:moves].each {|move| queue.unshift(move)}\\n end\\n end\\n nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d0d2fee9159cd50ddffd8b54800dfbad\",\n \"score\": \"0.5609007\",\n \"text\": \"def test_move_other_object\\n ::Dir.mkdir(\\\"#{@temp_dir}/tree1\\\")\\n ::Dir.mkdir(\\\"#{@temp_dir}/tree2\\\")\\n\\n tree = Tree.new(\\n SimpleCollection.new(\\n 'root',\\n [\\n Fs::Directory.new(\\\"#{@temp_dir}/tree1\\\"),\\n FsExt::Directory.new(\\\"#{@temp_dir}/tree2\\\")\\n ]\\n )\\n )\\n @server.tree = tree\\n\\n request = Http::Request.new('MOVE', '/tree1', 'Destination' => '/tree2/tree1')\\n @server.http_request = request\\n @server.exec\\n\\n assert_equal(201, @response.status)\\n assert_equal('', @response.body_as_string)\\n\\n assert_equal(\\n {\\n 'Content-Length' => ['0'],\\n 'X-Sabre-Version' => [Version::VERSION]\\n },\\n @response.headers\\n )\\n\\n assert(::File.directory?(\\\"#{@temp_dir}/tree2/tree1\\\"))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9ccbe27849350818cf36ea76374a8b0c\",\n \"score\": \"0.5605589\",\n \"text\": \"def move(from, to)\\n git(\\\"mv #{from} #{to}\\\")\\n true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"af07d420c2514c529f74427aa7ced235\",\n \"score\": \"0.5605265\",\n \"text\": \"def move(from_path, to_path)\\n\\t\\t\\tresponse = @session.rcp('/files/move_v2', from_path: from_path, to_path: to_path)\\n\\n\\t\\t\\tparse_metadata(response)\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b4f2ded3cc92ce966f17e359044b349e\",\n \"score\": \"0.56014806\",\n \"text\": \"def move(source, destination)\\n return unless source.exist?\\n make_path(destination.dirname)\\n UI.message \\\"- Moving #{UI.path(source)} to #{UI.path(destination)}\\\" do\\n FileUtils.mv(source.to_s, destination.to_s)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6f511c171864ad98ff7e4804d5a0ded2\",\n \"score\": \"0.559862\",\n \"text\": \"def move_to(file, path)\\n validate(\\n {\\n file: file,\\n path: path,\\n },\\n {\\n file: { kind_of: String },\\n path: { kind_of: String },\\n }\\n )\\n\\n file_path_array = File.split(path)\\n file_name = file_path_array.pop\\n if File.exist?(file) && File.writable?(file)\\n FileUtils.mv(\\n file,\\n File.join(create_cache_path(File.join(file_path_array), true), file_name)\\n )\\n else\\n raise \\\"Cannot move #{file} to #{path}!\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"56ba4f90f594d89e396479a10f0cdf07\",\n \"score\": \"0.5590295\",\n \"text\": \"def move(path, options = {}, &block)\\n perform_request Net::HTTP::Move, path, options, &block\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0fdf727833c23899f67295f5afe89e45\",\n \"score\": \"0.55852765\",\n \"text\": \"def rename(to)\\n File.rename(@path, to)\\n Path.new(to)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"606a4bfc69bf781c899406d4b887343c\",\n \"score\": \"0.557578\",\n \"text\": \"def document_move(document_id,new_path)\\n make_request(:move,folders_url(new_path) + \\\"/documents/#{document_id}.xml\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"17494e8110360492eb3e3e6a9403a97f\",\n \"score\": \"0.5574247\",\n \"text\": \"def original_destination_root(path, remove_dot = true)\\n path = path.dup\\n if path.gsub!(destination_stack[0], '.')\\n remove_dot ? (path[2..-1] || '') : path\\n else\\n path\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b21be1ed5376a81b9c8438332b8ab92a\",\n \"score\": \"0.5570048\",\n \"text\": \"def relative_to_original_destination_root(path, remove_dot = T.unsafe(nil)); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"920a0e768aa8240fa21a18510ea72354\",\n \"score\": \"0.5566871\",\n \"text\": \"def move_file(from)\\n\\t\\tfname= \\\"#{self.class.name}.#{__method__}\\\"\\n\\t\\tFile.rename(File.join(repository,from), repository)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"beea58e51fd931e30367d2330f9de4d2\",\n \"score\": \"0.55621535\",\n \"text\": \"def _move(src, dest, o)\\n raise Errno::EEXIST, \\\"dest exists -- #{dest}\\\" if File.exists?(dest) and (not o[:force])\\n\\n # move same file.\\n return if File.absolute_path(src) == File.absolute_path(dest)\\n\\n # :force. mv \\\"dir\\\", \\\"dira\\\" and 'dira' exists and is a directory. \\n if File.exists?(dest) and File.directory?(dest)\\n ls(src) { |pa|\\n dest1 = File.join(dest, File.basename(pa.p))\\n _move pa.p, dest1, o\\n }\\n Pa.rm_r src\\n\\n else\\n begin\\n Pa.rm_r dest if o[:force] and File.exists?(dest)\\n puts \\\"rename #{src} #{dest}\\\" if o[:verbose]\\n File.rename(src, dest)\\n rescue Errno::EXDEV # cross-device\\n _copy(src, dest, o)\\n Pa.rm_r src\\n end\\n\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"40d1a785b3f22bf6236087535568e0b5\",\n \"score\": \"0.555922\",\n \"text\": \"def move\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9af54ee57b71396f7f0b5038866934ff\",\n \"score\": \"0.55567545\",\n \"text\": \"def move(to, comment = \\\"Move #@name to #{to}\\\")\\n return unless exists?\\n return if @name == to\\n# G.lib.mv(path, repo_file(to))\\n message = G.better_commit(comment)\\n @revision = message[/Created commit (\\\\w+):/, 1]\\n @name = to\\n rescue Git::GitExecuteError => ex\\n Ramaze::Log.error(ex)\\n nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c9ffd1ed646377d736024360bb52705\",\n \"score\": \"0.5552728\",\n \"text\": \"def mv_to_path\\n FileUtils.mkdir_p ::File.dirname(absolute_path)\\n FileUtils.mv temporary_path, absolute_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e2a3a83cff85decb345fca59d776c785\",\n \"score\": \"0.5549753\",\n \"text\": \"def move_dirs; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"055c77e6b51bb307ac9437f7e237cdd4\",\n \"score\": \"0.55486363\",\n \"text\": \"def path\\n to_obj ? to_obj.path : proxy_path\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1c901ef8291ea3f2bcc75df67eb57de\",\n \"score\": \"0.5539952\",\n \"text\": \"def move_to(node_obj, nth = -1)\\n ff_move_node(node_obj, nth, false) # false: move to\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"18b2f4fd25a35b39b722df7e273c253e\",\n \"score\": \"0.55382526\",\n \"text\": \"def make_position_path(current, new_position)\\n\\n# new path is copy of current path & new position\\n new_path = copy(current.path + [new_position])\\n\\n# new position path takes parameters of new position & new path\\n PositionPath.new(new_position, new_path) \\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"87b0f1a845b7f367824fba5fcbd41fea\",\n \"score\": \"0.55233836\",\n \"text\": \"def move(target, target_id, destination_id)\\n query_rest('s_move_node', :action => :move, :target => target, :target_id => target_id, :destination_id => destination_id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b2d5f36c5e5504ec5935aebdc4de82ed\",\n \"score\": \"0.5512965\",\n \"text\": \"def move(src_path, dest_path)\\n req = Net::HTTP::Move.new(@basic_path + src_path)\\n req['Destination'] = @basic_path + dest_path\\n res = @http.request(req)\\n validate_status(res, '204')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"26ec35fb30d75d9728a2f69f7f69c3c9\",\n \"score\": \"0.5507922\",\n \"text\": \"def move(from, to)\\n `git mv #{from} #{to} 2> /dev/null`\\n true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7e77a56d494831573f744114265db8e0\",\n \"score\": \"0.55065656\",\n \"text\": \"def after_move(source, destination)\\n return nil if path_filter && !path_filter.call(source)\\n # If the destination is filtered, afterUnbind will handle cleaning up\\n # the properties.\\n return nil if path_filter && !path_filter(destination)\\n\\n @backend.move(source, destination)\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":184,"cells":{"query_id":{"kind":"string","value":"dec3590c1b5aa992d126c9547d27d69c"},"query":{"kind":"string","value":"Aircraft model plus the registration and aircraft name if available"},"positive_passages":{"kind":"list like","value":[{"docid":"774b91cc3e139d8c75c377f62490787e","score":"0.56588805","text":"def aircraft_description\n s = aircraft_type\n\n extra = []\n extra.push aircraft_registration unless aircraft_registration.nil?\n extra.push \"\\\"#{aircraft_name}\\\"\" unless aircraft_name.nil?\n\n if !extra.empty?\n s = \"#{s} (#{extra.join(' ')})\"\n end\n s\n end","title":""}],"string":"[\n {\n \"docid\": \"774b91cc3e139d8c75c377f62490787e\",\n \"score\": \"0.56588805\",\n \"text\": \"def aircraft_description\\n s = aircraft_type\\n\\n extra = []\\n extra.push aircraft_registration unless aircraft_registration.nil?\\n extra.push \\\"\\\\\\\"#{aircraft_name}\\\\\\\"\\\" unless aircraft_name.nil?\\n\\n if !extra.empty?\\n s = \\\"#{s} (#{extra.join(' ')})\\\"\\n end\\n s\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"9c68404652294ca86c78ff9698a4441e","score":"0.6532589","text":"def selected_aircraft_info!\r\n # --------------------------------------------------------------------------\r\n # TODO: Prompt for an aircraft model as the input and use .typeinfo instead.\r\n # This way it can return info for cached aircraft.\r\n # --------------------------------------------------------------------------\r\n \r\n raise ATCTools::NoAircraftSelectedError, \"No aircraft selected.\" \\\r\n unless aircraft_selected?\r\n \r\n # ---------------------------\r\n # TODO: \r\n # ---------------------------\r\n \r\n # Retrieve the aircraft info.\r\n execute_command \".acinfo #{@selected_aircraft}\"\r\n\r\n # Dump the aircraft info to a log for processing.\r\n execute_command \".log #{File.basename @aclog_path}\"\r\n \r\n # Process aircraft info.\r\n aclog = ''\r\n result = ''\r\n attempts = 0\r\n \r\n while attempts < 5\r\n aclog_exists = File.exists? @aclog_path\r\n break if aclog_exists\r\n \r\n attempts += 1\r\n sleep 0.5\r\n end\r\n \r\n if aclog_exists\r\n aclog = File.open(@aclog_path).read\r\n \r\n # Only keep the last few lines.\r\n # Reverse the lines so the latest one is first.\r\n aclog = aclog.lines[-6..-1].reverse.join\r\n \r\n aclog.each_line do |line|\r\n result = line.gsub /.*\\s*(Aircraft info for \\w*:\\s*)/, '' if line.include? \"Aircraft info for #{@selected_aircraft}\"\r\n break if result\r\n end\r\n \r\n # ---------------\r\n # TODO: Implement\r\n # ---------------\r\n result = \"Aircraft type code not found in database.\" if result.empty?\r\n \r\n # File.delete @aclog_path\r\n end\r\n \r\n result\r\n end","title":""},{"docid":"55b7d81132cedf8fc126984b34a7e5d6","score":"0.6164444","text":"def name\n ret = \"\"\n if self.aircraft_model\n if self.aircraft_model.aircraft_type\n ret << self.aircraft_model.aircraft_type.name\n ret << \" \"\n ret << self.aircraft_model.name\n else\n ret << self.aircraft_model.name\n end\n end\n ret << \" - \" + self.matriculation\n return ret\n end","title":""},{"docid":"dc4c3b7adf72fc626939362dc385a82b","score":"0.6149813","text":"def create\n @aircraft = Aircraft.new(aircraft_params)\n\n respond_to do |format|\n if @aircraft.save\n format.html { redirect_to @aircraft, notice: 'Aircraft was successfully created.' }\n format.json { render action: 'show', status: :created, location: @aircraft }\n else\n format.html { render action: 'new' }\n format.json { render json: @aircraft.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"c61529ad4cd8ad4aaec9a99a1022106c","score":"0.61457944","text":"def set_german_aircraft\n @german_aircraft = GermanAircraft.find(params[:id])\n end","title":""},{"docid":"bc09b87e2d7882594656f79cd5badfc6","score":"0.609749","text":"def create\n return unless has_permission :can_manage_aircraft\n @aircraft_type = AircraftType.new(params[:aircraft_type])\n if @aircraft_type.save\n flash[:notice] = 'AircraftType was successfully created.'\n redirect_to :action => 'list'\n else\n render :action => 'new'\n end\n end","title":""},{"docid":"8cb0a1083faa0bd58154f741190e8efa","score":"0.6021387","text":"def remote_create\n @aircraft_type = AircraftType.new\n @aircraft_type.name = params[:name]\n @aircraft_type.save\n add_to_log(t('Aircraft type created log') + @aircraft_type.name,\"aircraft_types\",\"create\")\n @aircraft_types = AircraftType.find(:all)\n end","title":""},{"docid":"eb24e5b126f4ec536c6f8ad4e8a4bb67","score":"0.59929734","text":"def create\n @german_aircraft = GermanAircraft.new(german_aircraft_params)\n\n respond_to do |format|\n if @german_aircraft.save\n format.html { redirect_to @german_aircraft, notice: 'German aircraft was successfully created.' }\n format.json { render :show, status: :created, location: @german_aircraft }\n else\n format.html { render :new }\n format.json { render json: @german_aircraft.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"aa89363856bf75ca715c6fe0beeddbaa","score":"0.5977916","text":"def modeler_description\n return 'Add a fan air speed actuator and it available to Alfalfa by following appropriate conventions'\n end","title":""},{"docid":"899fab7373485f82ed1d02359f752d29","score":"0.59423","text":"def set_aircraft\n @aircraft = Aircraft.find(params[:id])\n end","title":""},{"docid":"899fab7373485f82ed1d02359f752d29","score":"0.59423","text":"def set_aircraft\n @aircraft = Aircraft.find(params[:id])\n end","title":""},{"docid":"899fab7373485f82ed1d02359f752d29","score":"0.59423","text":"def set_aircraft\n @aircraft = Aircraft.find(params[:id])\n end","title":""},{"docid":"2bba7dc48c6daf079c89a6c0f404acbe","score":"0.59286404","text":"def airport_name\n airport_id.try(:name)\n end","title":""},{"docid":"f81aac4db2f548ee80110fc501963abf","score":"0.5926862","text":"def aircraft_params\n params.require(:aircraft).permit(:id, :tail_number, :aircraft_type_id, :fuel_amount)\n end","title":""},{"docid":"1250d0650148f10fb26094c8d1ca98ac","score":"0.5920345","text":"def create\n @aircraft = Aircraft.new(params[:aircraft])\n\n respond_to do |format|\n if @aircraft.save\n format.html { redirect_to(@aircraft, :notice => 'Aircraft was successfully created.') }\n format.xml { render :xml => @aircraft, :status => :created, :location => @aircraft }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @aircraft.errors, :status => :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"3c26840d34d0c37b1dc353b2682ea025","score":"0.58917516","text":"def by_aircraft\n @logbook =Logbook.find params[:id]\n @flights = @logbook.flights\n end","title":""},{"docid":"98689808c79cac7665cbe521cdab9ca1","score":"0.5829437","text":"def index\n @german_aircrafts = GermanAircraft.all\n end","title":""},{"docid":"6bca1ddd283c869d0a018e8a0763bfba","score":"0.5816381","text":"def create\n @aircraft_type = AircraftType.new(params[:aircraft_type])\n\n respond_to do |format|\n if @aircraft_type.save\n format.html { redirect_to @aircraft_type, notice: 'Aircraft type was successfully created.' }\n format.json { render json: @aircraft_type, status: :created, location: @aircraft_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @aircraft_type.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"a468e3e6e90395fe1cd265467891b5c7","score":"0.5805235","text":"def assign_car_model\n \tbike = (self.entity_type == \"Booking down-payment\" || self.entity_type == \"Other\") ? Bike.find_by_id(self.bike_id).try(:name) : MyBike.find_by_id(self.bike_id).try(:bike)\n \tself.vehicle_name = bike if bike\n end","title":""},{"docid":"f1b7566b2432d773774d1a68407a2611","score":"0.57909894","text":"def create\n @travel_request = TravelRequest.find(params[:travel_request_id])\n @travel_leg = TravelLeg.find(params[:travel_leg_id])\n @accommodations = @travel_leg.accommodation\n @car_hires = @travel_leg.car_hire\n @flights = @travel_leg.flight\n @accommodation = Accommodation.new(accommodation_params)\n @accommodation.travel_leg = @travel_leg\n @accommodation.booked = false\n respond_to do |format|\n if @accommodation.save\n format.html { redirect_to travel_request_travel_leg_path(@travel_request, @travel_leg), notice: 'Accommodation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @accommodation }\n else\n format.html { render action: 'new' }\n format.json { render json: @accommodation.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"93a49bec840f6ed224bfd56407f33d61","score":"0.5783201","text":"def create\n @aircraft = Aircraft.new(params[:aircraft])\n\n respond_to do |format|\n if @aircraft.save\n flash[:notice] = 'Aircraft was successfully created.'\n format.html { redirect_to(@aircraft) }\n format.xml { render :xml => @aircraft, :status => :created, :location => @aircraft }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @aircraft.errors, :status => :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"3f3350bef113f92f96cd7cb2fc61dc70","score":"0.57123065","text":"def create\n @aircraft = Aircraft.new(params[:aircraft])\n\n respond_to do |format|\n if @aircraft.save\n add_to_log(t('Aircraft created log') + @aircraft.name,\"aircrafts\",\"create\")\n flash[:notice] = t('Aircraft created')\n if params[:submit_continue] == I18n.t('Create and continue')\n format.html { redirect_to(:action => :new) }\n else\n format.html { redirect_to(@aircraft) }\n format.xml { render :xml => @aircraft, :status => :created, :location => @aircraft }\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @aircraft.errors, :status => :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"487f6e24f3a54e621ef695de4310a60e","score":"0.5700799","text":"def new\n @flight = Flight.new(:duration => 2, :aircraft => @aircraft)\n @clients = Client.all(:order=>:name).collect{|c| [c.name, c.id]}\n @instructors = Instructor.all(:order=>:name).collect{|c| [c.name, c.id]}\n @aircrafts = Aircraft.where(:aircraft_type_id => params[:aircraft_type_id]).collect{|c| [c.prefix, c.id]}\n @aircraft_type = AircraftType.find(params[:aircraft_type_id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @flight }\n end\n end","title":""},{"docid":"b970d676b5255445c8dbb0bd2cb8b0c5","score":"0.56249344","text":"def new\n @aircraft = Aircraft.new\n @aircraft_types = AircraftType.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aircraft }\n end\n end","title":""},{"docid":"517e02a247c00b0ebd2da61a06160439","score":"0.56118697","text":"def create\n @airplane = Airplane.new(airplane_params)\n\n if @airplane.save\n json_response(@airplane.decorate.as_json(airline_details: true),\n :created)\n else\n json_response(@airplane.errors, :unprocessable_entity)\n end\n end","title":""},{"docid":"1c5dcc9dd45c5c8427109adf9cf10604","score":"0.5608775","text":"def airplane_params\n params.require(:airplane).permit(:name, :model, :status,:time_on_lane, :airline_id, :capacity)\n end","title":""},{"docid":"d89a6d1b72dafa816d05e870147804af","score":"0.5579793","text":"def modeler_description\n 'Add Zone Sensors to Alfalfa'\n end","title":""},{"docid":"c4d38c1fe572b06436631fac281d29c8","score":"0.5576942","text":"def create\n @aircraft_company = AircraftCompany.new(params[:aircraft_company])\n\n respond_to do |format|\n if @aircraft_company.save\n format.html { redirect_to @aircraft_company, notice: 'Aircraft company was successfully created.' }\n format.json { render json: @aircraft_company, status: :created, location: @aircraft_company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @aircraft_company.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"8e86b9405f4c73c44eb7226e0c21a2bf","score":"0.55681556","text":"def german_aircraft_params\n params.require(:german_aircraft).permit(:name, :designation, :description, :content)\n end","title":""},{"docid":"2e6f0a0b418f872019c787750df3af8d","score":"0.55643106","text":"def new\n return unless has_permission :can_manage_aircraft\n @page_title = \"New Aircraft Type\"\n @aircraft_type = AircraftType.new\n end","title":""},{"docid":"010d3a5bbd8145b7c426345752a401f8","score":"0.5560527","text":"def get_aircraft_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AircraftApi.get_aircraft ...'\n end\n # resource path\n local_var_path = '/aircraft'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'modeS'] = opts[:'mode_s'] if !opts[:'mode_s'].nil?\n query_params[:'registration'] = opts[:'registration'] if !opts[:'registration'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n return_type = opts[:return_type] || 'GetAircraftResponse' \n\n auth_names = opts[:auth_names] || ['bearerToken']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type)\n\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AircraftApi#get_aircraft\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end","title":""},{"docid":"be958c4e8cc07f7511095bdae598fd53","score":"0.55591327","text":"def airline\n @airline ||= Airline.find(params[:airline_id])\n end","title":""},{"docid":"485ded4ba43c0d7f09225824b3defe03","score":"0.55589235","text":"def airport_with_available_fuel\n\t\t\tavailability = []\n\t\t\tData.each do |airport|\n\t\t\t\tavailability.push([airport[1], airport[3]])\n\t\t\tend\n\t\t\tavailability_fuel_data = availability.map { |values| %w(Airport Fuel_Available).zip(values).to_h }\n\t\t\ttp availability_fuel_data #tp => for printing data in table format\n\t\t\tAirport.take_user_input\n\t\tend","title":""},{"docid":"7fda82eaf407a563549dec37298e6d06","score":"0.5533141","text":"def list\n return unless has_permission :can_manage_aircraft\n @page_title = \"Aircraft Types\"\n @aircraft_types = AircraftType.find :all ,:order=>'type_name'\n end","title":""},{"docid":"45ff3df850acc9ab90c5532d89a8008a","score":"0.55258656","text":"def set_airplane\n @airplane = Airplane.find(params[:id])\n end","title":""},{"docid":"ecedee9c518c76d2e0850ffaf509d736","score":"0.55195075","text":"def set_airline\n @airline = Airline.friendly.find(params[:id])\n end","title":""},{"docid":"55c1885832a7f0c63c5362661a0d6dc0","score":"0.54999554","text":"def aircraft_params\n params.fetch(:aircraft, {})\n end","title":""},{"docid":"6fd6110bf07a026f2e87a7677149baca","score":"0.54928255","text":"def airfield_params\n params.require(:airfield).permit(:name, :airfield_type, :ATC_channel, :ATIS_channel)\n end","title":""},{"docid":"0abd6749645fda931cb7f1cf79d8482f","score":"0.54852444","text":"def airplane_params\n params.require(:airplane).permit(:name, :typeofplane, :firstseat, :firstemer, :firstprice, :firstrow, :busseat, :busemer, :busprice, :busrow, :ecoseat, :ecoemer, :ecoprice, :ecorow)\n end","title":""},{"docid":"4e7fca098fd09955d71d8c9d7109d13d","score":"0.5483373","text":"def aircraft?\n true\n end","title":""},{"docid":"28bc56e5af1d2900fff359803b78628b","score":"0.54603904","text":"def create\n @accommodation = Accommodation.new(params[:accommodation])\n @accommodation.landlord = current_user unless can? :manage, Accommodation\n\n if @accommodation.save\n redirect_to @accommodation, notice: 'Accommodation was successfully created.'\n else\n load_combo_data\n render action: \"new\" \n end\n end","title":""},{"docid":"f0e7df029861eb216a68c464ea854e5b","score":"0.54418415","text":"def aircraft_select\n if @offer.aircraft_id != nil\n if !Aircraft.find(:all, :conditions => {:active => true}).include?(Aircraft.find(@offer.aircraft.id))\n @aircrafts = Aircraft.find_all_by_id(@offer.aircraft.id) + Aircraft.find(:all, :conditions => {:active => true})\n @aircrafts.sort! { |a,b| a.name.downcase <=> b.name.downcase }\n return select :offer, :aircraft_id, @aircrafts.map {|a| [a.name, a.id]}\n else\n @aircrafts = Aircraft.find(:all, :conditions => {:active => true})\n @aircrafts.sort! { |a,b| a.name.downcase <=> b.name.downcase }\n return select :offer, :aircraft_id, @aircrafts.map {|a| [a.name, a.id]}\n end\n else\n @aircrafts = Aircraft.find(:all, :conditions => {:active => true})\n @aircrafts.sort! { |a,b| a.name.downcase <=> b.name.downcase }\n return select :offer, :aircraft_id, @aircrafts.map {|a| [a.name, a.id]}\n end\n end","title":""},{"docid":"bfdc551e62c4f0754b1c7d69f211d209","score":"0.54416436","text":"def show\n @aircraft_type = AircraftType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aircraft_type }\n end\n end","title":""},{"docid":"f3bca58919f790d557b4c50a28419fa2","score":"0.541787","text":"def create\n @aircraft_type = AircraftType.new(params[:aircraft_type])\n\n respond_to do |format|\n if @aircraft_type.save\n add_to_log(t('Aircraft type created log') + @aircraft_type.name,\"aircraft_types\",\"create\")\n flash[:notice] = t('Aircraft type created')\n if params[:submit_continue] == I18n.t('Create and continue')\n format.html { redirect_to(:action => :new) }\n else\n format.html { redirect_to(@aircraft_type) }\n format.xml { render :xml => @aircraft_type, :status => :created, :location => @aircraft_type }\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @aircraft_type.errors, :status => :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"3a6e38dcf6166c440739ff26de2b2bb2","score":"0.5414845","text":"def set_airplane\n @airplane = Airplane.find(params[:id])\n end","title":""},{"docid":"3a6e38dcf6166c440739ff26de2b2bb2","score":"0.5414845","text":"def set_airplane\n @airplane = Airplane.find(params[:id])\n end","title":""},{"docid":"3a6e38dcf6166c440739ff26de2b2bb2","score":"0.5414845","text":"def set_airplane\n @airplane = Airplane.find(params[:id])\n end","title":""},{"docid":"f09ddef21061cb5628845d261380fc3f","score":"0.5401326","text":"def airline\n @airline ||= Airline.find(params[:airline_id])\n end","title":""},{"docid":"5e26893a7700aa35c86c36b6eb9f6e6f","score":"0.53946114","text":"def airlines\n Flight::Airlines.new.perform\n end","title":""},{"docid":"37a12ec6fe2edee11758a95109169e29","score":"0.5383044","text":"def create\n @fleet = Fleet.new(params[:fleet])\n @assets = Asset.new(params[:asset]) \n @assets.fleet = @fleet\n @fleet.truck_fleet = current_user.truck_fleet\n \n respond_to do |format|\n if @fleet.save\n @assets.save\n @fleet.prepare_services\n @fleet.update_serviceables(params[:fields]) \n format.html { redirect_to @fleet, notice: 'Fleet was successfully created.' }\n format.json { render json: @fleet, status: :created, location: @fleet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fleet.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"8f0e0b9e22b9856168c3c40f8f05f940","score":"0.53799045","text":"def airline_params\n params.require(:airline).permit(:iata_code, :icao_code, :name, :country, :logo, :alliance)\n end","title":""},{"docid":"2b071ae8da894f728dd80aac50c71a3d","score":"0.5377623","text":"def find_aircraft\n relation =\n Aircraft.\n joins(:identifier).\n where(identifiers: {code: identifier}).\n order(\"as_of ASC\")\n\n relation = relation.where(\"as_of <= ?\", @date) if @date\n relation.last\n end","title":""},{"docid":"2333fc9da883001197446b3e59a9f82d","score":"0.5359652","text":"def new\n @aircraft_type = AircraftType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aircraft_type }\n end\n end","title":""},{"docid":"c34540aaedd3f9c8e296105179dbac30","score":"0.53590626","text":"def new_aircraft(aircraft)\n @aircraft = aircraft\n mail(\n subject: DEFAULT_SUBJECT + 'an organisation added aircraft'\n )\n end","title":""},{"docid":"7855144215972b83a8c003b93246f093","score":"0.5357966","text":"def airline_params\n params.require(:airline).permit(:name)\n end","title":""},{"docid":"7855144215972b83a8c003b93246f093","score":"0.5357966","text":"def airline_params\n params.require(:airline).permit(:name)\n end","title":""},{"docid":"86ea2fd22a2bce3545b2c9d8a235e813","score":"0.5352073","text":"def create\n @airplane_type = AirplaneType.new(airplane_type_params)\n\n respond_to do |format|\n if @airplane_type.save\n format.html { redirect_to @airplane_type, notice: 'Airplane type was successfully created.' }\n format.json { render :show, status: :created, location: @airplane_type }\n else\n format.html { render :new }\n format.json { render json: @airplane_type.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"80911d8f5028d97aaaa19d420bdb0753","score":"0.5344976","text":"def name\n self.equipment_model.try(:name)\n end","title":""},{"docid":"9ae7803987770c9512abae974a953d95","score":"0.533026","text":"def airline_params\n params.require(:airline).permit(:name, :iata, :phone_no, :contact_link, :pet_info_link, :comments)\n end","title":""},{"docid":"387005c299c5aa3b23492b3332e2f545","score":"0.5325925","text":"def set_airfield\n @airfield = Airfield.find(params[:id])\n end","title":""},{"docid":"b24a22dcab56e438747235fbeea988cd","score":"0.53093266","text":"def show\n if @destination.airport_id.nil? || @destination.airport_id == 0\n @airport_name = I18n.t 'not_found'\n elsif Airport.where(id: @destination.airport_id).take.nil?\n @airport_name = I18n.t 'not_found'\n else\n @airport_name = Airport.where(id: @destination.airport_id).take.name\n end\n end","title":""},{"docid":"358ed1d37c19737f9c97f7cd81256b42","score":"0.529944","text":"def create\n @bike = Bike.new(bike_params)\n # @model = Model.find(params[:model_id])\n\n # if equipment_name is not setted the for example equal then model name\n if @bike.valid? && (@bike.equipment_name == \"\" || @bike.equipment_name == nil)\n @bike.equipment_name = @bike.model.name\n end\n\n respond_to do |format|\n if @bike.save\n format.html { redirect_to @bike, flash: {success: _('Moto creata con successo!')} }\n format.json { render json: @bike, status: :created, location: @bike }\n else\n format.html { render \"forms/new_edit\" }\n format.json { render json: @bike.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"4740d5cacf88fe30280999ce498230a9","score":"0.52952653","text":"def airline_params\n params.require(:airline).permit(:name, :country)\n end","title":""},{"docid":"bda12bb5fde86fa8fc96a248880383c7","score":"0.52934045","text":"def create\n expire_action :action => :index\n #@airfield = Airfield.new(params[:airfield])\n \n csv_text = File.read(open('https://commondatastorage.googleapis.com/ckannet-storage/2012-07-09T214020/global_airports.csv'))\n csv = CSV.parse(csv_text, :headers => true)\n csv.each do |row|\n row = row.to_hash.with_indifferent_access\n @airfield=Airfield.find_or_create_by_airport_id!(row.to_hash.symbolize_keys)\n @airfield.update_attributes(row.to_hash.symbolize_keys)\n end\n #respond_to do |format|\n #if @airfield.save\n #format.html { redirect_to @airfield, notice: 'Airfield was successfully created.' }\n #format.json { render json: @airfield, status: :created, location: @airfield }\n #else\n # format.html { render action: \"new\" }\n #format.json { render json: @airfield.errors, status: :unprocessable_entity }\n #end\n #end\n redirect_to(airfields_path, :notice => \"Airports were successfully updated\")\n end","title":""},{"docid":"f13f740ffcc38891d97fe0bf3be6120e","score":"0.528746","text":"def show\n @aircraft = Aircraft.find(params[:id])\n\n # respond_to do |format|\n # format.html # show.html.erb\n # format.xml { render :xml => @aircraft }\n # end\n end","title":""},{"docid":"96bef1b940c459f0b99083f4a979d014","score":"0.52870584","text":"def create\n @airfield = Airfield.new(airfield_params)\n\n respond_to do |format|\n if @airfield.save\n format.html { redirect_to @airfield, notice: 'Airfield was successfully created.' }\n format.json { render :show, status: :created, location: @airfield }\n else\n format.html { render :new }\n format.json { render json: @airfield.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"218e27b6f9828d765b9b4bdacdbc62ea","score":"0.52782804","text":"def set_airport_air_traffic\n @airport_air_traffic = AirportAirTraffic.find(params[:id])\n end","title":""},{"docid":"6d5b5921a691eb2bfe1c9f6a75889dc1","score":"0.52773494","text":"def show\n @aircraft_company = AircraftCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aircraft_company }\n end\n end","title":""},{"docid":"0ca3115f9dfd02c449147427b1ee961f","score":"0.52731645","text":"def create\n #.create\n # byebug\n Airplane.create(airplane_params)\n # render?? redirect??\n redirect_to \"/airplanes\"\n end","title":""},{"docid":"1d3eb2c5e1e575bcb56f574c13ef4025","score":"0.5260407","text":"def create\n @airplane = Airplane.new(airplane_params)\n\n respond_to do |format|\n if @airplane.save\n format.html { redirect_to @airplane, notice: 'Airplane was successfully created.' }\n format.json { render :show, status: :created, location: @airplane }\n else\n format.html { render :new }\n format.json { render json: @airplane.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"1d3eb2c5e1e575bcb56f574c13ef4025","score":"0.5260407","text":"def create\n @airplane = Airplane.new(airplane_params)\n\n respond_to do |format|\n if @airplane.save\n format.html { redirect_to @airplane, notice: 'Airplane was successfully created.' }\n format.json { render :show, status: :created, location: @airplane }\n else\n format.html { render :new }\n format.json { render json: @airplane.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"48d25e292b4e120d67b08ebc6843e1e0","score":"0.5247676","text":"def show\n json_response(@airplane.decorate.as_json(airline_details: true), :ok)\n end","title":""},{"docid":"1d11b221ec38fce214d6d5f11474acf0","score":"0.52469","text":"def create\n @aircraft_class = AircraftClass.new(params[:aircraft_class])\n\n respond_to do |format|\n if @aircraft_class.save\n format.html { redirect_to(@aircraft_class, :notice => 'Aircraft class was successfully created.') }\n format.xml { render :xml => @aircraft_class, :status => :created, :location => @aircraft_class }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @aircraft_class.errors, :status => :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"d01ed682564e2893314466738045cc4d","score":"0.5242338","text":"def create\n @airport = scope.new(airport_params)\n\n if @airport.save\n json_response(@airport.decorate.as_json(airport_details: true),\n :created)\n else\n json_response(@airport.errors, :unprocessable_entity)\n end\n end","title":""},{"docid":"82b34f1bd73fc5a031897f39ea261510","score":"0.52362025","text":"def airplane_params\n params.require(:airplane).permit(:hex, :sqawk, :flight, :lat, :lon, :validposition, :altitude, :vert_rate, :track, :validtrack, :speed, :messages, :seen, :mlat)\n end","title":""},{"docid":"822f1b147f932bc8eb6b76433f93ff09","score":"0.5227146","text":"def find_airlines\n @airline = AirlinesDatum.find(params[:id])\n end","title":""},{"docid":"02862f5e075df9f2f883e533a8fe1b65","score":"0.5215879","text":"def show\n @aircraft = Aircraft.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @aircraft }\n end\n end","title":""},{"docid":"9c95f345ec345f98ac1c12c7d2c3e991","score":"0.521366","text":"def index\n @airplanes = Airplane.all\n end","title":""},{"docid":"508388f3b366ec5536c091662e338008","score":"0.5209722","text":"def create\n @air = Air.new(params[:air])\n\n respond_to do |format|\n if @air.save\n format.html { redirect_to @air, :notice => 'Air was successfully created.' }\n format.json { render :json => @air, :status => :created, :location => @air }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @air.errors, :status => :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"e68ca73e089d9a1e4a1cdea46bc4f3e4","score":"0.5207929","text":"def in_airship?\r\n @vehicle_type == :airship\r\n end","title":""},{"docid":"fefe2643f76a1879e983b68419637f37","score":"0.52051276","text":"def index\n @airfields = Airfield.all\n end","title":""},{"docid":"369f3cb0483e99e6abcb5053fe5a6ba7","score":"0.5201017","text":"def aircraft_params\n params.require(:aircraft).permit(:latitude, :longitude)\n end","title":""},{"docid":"bf196a99be25c066ce1a60b9d636c906","score":"0.5199648","text":"def plane_params\n params.require(:plane).permit(:model, :patent, :brand_id, :airway_id)\n end","title":""},{"docid":"1dd27c071c098f55d2884d78274f3430","score":"0.5195951","text":"def show\n @aircraft = Aircraft.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @aircraft }\n end\n end","title":""},{"docid":"64b9c5d51564c5a2c3247a53440cb53d","score":"0.5188509","text":"def create\n @abaste = Abaste.new(abaste_params)\n @company = Company.find(1) \n\n @customers = @company.get_customers()\n @trucks = @company.get_trucks()\n @employees = @company.get_employees()\n @abaste.user_id = current_user.id \n\n respond_to do |format|\n if @abaste.save\n format.html { redirect_to @abaste, notice: 'Abaste was successfully created.' }\n format.json { render :show, status: :created, location: @abaste }\n else\n format.html { render :new }\n format.json { render json: @abaste.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"32ba8dadb3f2edcaa35eafe31840093f","score":"0.5186977","text":"def airport_fuel_data\n\t\t\thash_of_table = Data.map { |values| %w(Airport_ID Airport_Name FuelCapacity(ltrs) Fuel_Available(ltrs)).zip(values).to_h }\n\t\t\ttp hash_of_table #tp => for printing data in table format\n\t\t\tAirport.take_user_input\n\t\tend","title":""},{"docid":"881a10c652eb297a266a29dc6ed27c41","score":"0.5180702","text":"def show_airport_info\n\t\tputs \"--------------------------------------------------------------------------------\"\n\t\tputs \"Airport Name \\t\\t\\t\\t\\t\\t\\t Fuel Available\"\n\t\tputs \"--------------------------------------------------------------------------------\"\n\t\t@airports_info.each do |key,data|\n\t\t\tputs \"#{data['Airport Name']}\\t\\t\\t #{data['Fuel Available']}\"\n\t\tend\n\t\tputs \"--------------------------------------------------------------------------------\"\n\t\n\t\tget_user_input\n\tend","title":""},{"docid":"f257a2776a1b3f263fc92ae5b80d7e76","score":"0.51789296","text":"def show\n @aircraft_type = AircraftType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @aircraft_type }\n end\n end","title":""},{"docid":"489bcf658efb65dca9fea58df0b38d39","score":"0.51702183","text":"def create\n @airport = Airport.new(airport_params)\n\n respond_to do |format|\n if @airport.save\n format.html { redirect_to root_path, notice: 'Airport was successfully created.' }\n format.json { render :show, status: :created, location: @airport }\n else\n format.html { render :new }\n format.json { render json: @airport.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"93ec061a4ad648c3e666e6ebf465cb3c","score":"0.5168608","text":"def create\n @carriers = Carrier.all\n @facility = Facility.new(facility_params)\n if !current_user.admin?\n @facility.carrier_id = Carrier.find_by_name(current_user.carrier_name).id\n end\n\n respond_to do |format|\n if @facility.save\n # FormMailer.facility_email(@facility.city, @facility.id).deliver\n format.html { redirect_to :root, notice: 'Thank you for registering!' }\n format.json { render :root, status: :created, location: @facility }\n else\n format.html { render :new }\n format.json { render json: @facility.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"3fa9126fa54e9c0187d8f5a5511d2692","score":"0.51621246","text":"def create\n @airline = Airline.new(airline_params)\n\n respond_to do |format|\n if @airline.save\n format.html { redirect_to @airline, notice: 'Airline was successfully created.' }\n format.json { render :show, status: :created, location: @airline }\n else\n format.html { render :new }\n format.json { render json: @airline.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"3fa9126fa54e9c0187d8f5a5511d2692","score":"0.51621246","text":"def create\n @airline = Airline.new(airline_params)\n\n respond_to do |format|\n if @airline.save\n format.html { redirect_to @airline, notice: 'Airline was successfully created.' }\n format.json { render :show, status: :created, location: @airline }\n else\n format.html { render :new }\n format.json { render json: @airline.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"69724918f8328df2eb4dd8830ea21ebe","score":"0.51582104","text":"def create\n @airline = Airline.new(params[:airline])\n\n respond_to do |format|\n if @airline.save\n format.html { redirect_to @airline, notice: 'Airline was successfully created.' }\n format.json { render json: @airline, status: :created, location: @airline }\n else\n format.html { render action: \"new\" }\n format.json { render json: @airline.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"15150f74dbe547925b96e441ebb9f2a4","score":"0.51563513","text":"def create\n @airport = Airport.find(params[:airport_id])\n @plane = @airport.planes.create(plane_params)\n\n #@plane = plane.new(plane_params)\n\n if @plane.save\n redirect_to airport_path(@airport), notice: 'plane was successfully created.'\n else\n render :new\n end\n end","title":""},{"docid":"ab0f5d2a64a2c8b3f4b8d99c940e38be","score":"0.51560473","text":"def create\n @airport = Airport.new(airport_params)\n\n respond_to do |format|\n if @airport.save\n format.html { redirect_to @airport, notice: 'Airport was successfully created.' }\n format.json { render :show, status: :created, location: @airport }\n else\n format.html { render :new }\n format.json { render json: @airport.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"719ed7327928698a7bbc52508641100a","score":"0.51550865","text":"def set_airplane_type\n @airplane_type = AirplaneType.find(params[:id])\n end","title":""},{"docid":"aa2b349be060ae1206ae7e090914f3f5","score":"0.5155005","text":"def aircraft?\n false\n end","title":""},{"docid":"3c11313ed3f3ea54e48666f1b9b28952","score":"0.5150682","text":"def new\n @aircraft_type = AircraftType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aircraft_type }\n end\n end","title":""},{"docid":"7edd026dba9505db297901f9a817a4d2","score":"0.51481116","text":"def trigger_new_flight(dep_airport_obj, arr_airport_obj)\n param_array = generate_param_array_from_airport_objects(dep_airport_obj, arr_airport_obj)\n new_flight = FlightCreator.new(param_array).manufacture\n return new_flight.save ? new_flight : nil\n end","title":""},{"docid":"b2d24bad26e13bd266ab926f81b64c8e","score":"0.5145631","text":"def show\n\t\n\t@ambit = @name.ambit\n @area = @name.area\n\t@group = @name.group\n\t@fascicles = @name.fascicles\n\t@dossiers = @name.dossiers\n end","title":""}],"string":"[\n {\n \"docid\": \"9c68404652294ca86c78ff9698a4441e\",\n \"score\": \"0.6532589\",\n \"text\": \"def selected_aircraft_info!\\r\\n # --------------------------------------------------------------------------\\r\\n # TODO: Prompt for an aircraft model as the input and use .typeinfo instead.\\r\\n # This way it can return info for cached aircraft.\\r\\n # --------------------------------------------------------------------------\\r\\n \\r\\n raise ATCTools::NoAircraftSelectedError, \\\"No aircraft selected.\\\" \\\\\\r\\n unless aircraft_selected?\\r\\n \\r\\n # ---------------------------\\r\\n # TODO: \\r\\n # ---------------------------\\r\\n \\r\\n # Retrieve the aircraft info.\\r\\n execute_command \\\".acinfo #{@selected_aircraft}\\\"\\r\\n\\r\\n # Dump the aircraft info to a log for processing.\\r\\n execute_command \\\".log #{File.basename @aclog_path}\\\"\\r\\n \\r\\n # Process aircraft info.\\r\\n aclog = ''\\r\\n result = ''\\r\\n attempts = 0\\r\\n \\r\\n while attempts < 5\\r\\n aclog_exists = File.exists? @aclog_path\\r\\n break if aclog_exists\\r\\n \\r\\n attempts += 1\\r\\n sleep 0.5\\r\\n end\\r\\n \\r\\n if aclog_exists\\r\\n aclog = File.open(@aclog_path).read\\r\\n \\r\\n # Only keep the last few lines.\\r\\n # Reverse the lines so the latest one is first.\\r\\n aclog = aclog.lines[-6..-1].reverse.join\\r\\n \\r\\n aclog.each_line do |line|\\r\\n result = line.gsub /.*\\\\s*(Aircraft info for \\\\w*:\\\\s*)/, '' if line.include? \\\"Aircraft info for #{@selected_aircraft}\\\"\\r\\n break if result\\r\\n end\\r\\n \\r\\n # ---------------\\r\\n # TODO: Implement\\r\\n # ---------------\\r\\n result = \\\"Aircraft type code not found in database.\\\" if result.empty?\\r\\n \\r\\n # File.delete @aclog_path\\r\\n end\\r\\n \\r\\n result\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"55b7d81132cedf8fc126984b34a7e5d6\",\n \"score\": \"0.6164444\",\n \"text\": \"def name\\n ret = \\\"\\\"\\n if self.aircraft_model\\n if self.aircraft_model.aircraft_type\\n ret << self.aircraft_model.aircraft_type.name\\n ret << \\\" \\\"\\n ret << self.aircraft_model.name\\n else\\n ret << self.aircraft_model.name\\n end\\n end\\n ret << \\\" - \\\" + self.matriculation\\n return ret\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dc4c3b7adf72fc626939362dc385a82b\",\n \"score\": \"0.6149813\",\n \"text\": \"def create\\n @aircraft = Aircraft.new(aircraft_params)\\n\\n respond_to do |format|\\n if @aircraft.save\\n format.html { redirect_to @aircraft, notice: 'Aircraft was successfully created.' }\\n format.json { render action: 'show', status: :created, location: @aircraft }\\n else\\n format.html { render action: 'new' }\\n format.json { render json: @aircraft.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c61529ad4cd8ad4aaec9a99a1022106c\",\n \"score\": \"0.61457944\",\n \"text\": \"def set_german_aircraft\\n @german_aircraft = GermanAircraft.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bc09b87e2d7882594656f79cd5badfc6\",\n \"score\": \"0.609749\",\n \"text\": \"def create\\n return unless has_permission :can_manage_aircraft\\n @aircraft_type = AircraftType.new(params[:aircraft_type])\\n if @aircraft_type.save\\n flash[:notice] = 'AircraftType was successfully created.'\\n redirect_to :action => 'list'\\n else\\n render :action => 'new'\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8cb0a1083faa0bd58154f741190e8efa\",\n \"score\": \"0.6021387\",\n \"text\": \"def remote_create\\n @aircraft_type = AircraftType.new\\n @aircraft_type.name = params[:name]\\n @aircraft_type.save\\n add_to_log(t('Aircraft type created log') + @aircraft_type.name,\\\"aircraft_types\\\",\\\"create\\\")\\n @aircraft_types = AircraftType.find(:all)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb24e5b126f4ec536c6f8ad4e8a4bb67\",\n \"score\": \"0.59929734\",\n \"text\": \"def create\\n @german_aircraft = GermanAircraft.new(german_aircraft_params)\\n\\n respond_to do |format|\\n if @german_aircraft.save\\n format.html { redirect_to @german_aircraft, notice: 'German aircraft was successfully created.' }\\n format.json { render :show, status: :created, location: @german_aircraft }\\n else\\n format.html { render :new }\\n format.json { render json: @german_aircraft.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aa89363856bf75ca715c6fe0beeddbaa\",\n \"score\": \"0.5977916\",\n \"text\": \"def modeler_description\\n return 'Add a fan air speed actuator and it available to Alfalfa by following appropriate conventions'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"899fab7373485f82ed1d02359f752d29\",\n \"score\": \"0.59423\",\n \"text\": \"def set_aircraft\\n @aircraft = Aircraft.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"899fab7373485f82ed1d02359f752d29\",\n \"score\": \"0.59423\",\n \"text\": \"def set_aircraft\\n @aircraft = Aircraft.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"899fab7373485f82ed1d02359f752d29\",\n \"score\": \"0.59423\",\n \"text\": \"def set_aircraft\\n @aircraft = Aircraft.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2bba7dc48c6daf079c89a6c0f404acbe\",\n \"score\": \"0.59286404\",\n \"text\": \"def airport_name\\n airport_id.try(:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f81aac4db2f548ee80110fc501963abf\",\n \"score\": \"0.5926862\",\n \"text\": \"def aircraft_params\\n params.require(:aircraft).permit(:id, :tail_number, :aircraft_type_id, :fuel_amount)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1250d0650148f10fb26094c8d1ca98ac\",\n \"score\": \"0.5920345\",\n \"text\": \"def create\\n @aircraft = Aircraft.new(params[:aircraft])\\n\\n respond_to do |format|\\n if @aircraft.save\\n format.html { redirect_to(@aircraft, :notice => 'Aircraft was successfully created.') }\\n format.xml { render :xml => @aircraft, :status => :created, :location => @aircraft }\\n else\\n format.html { render :action => \\\"new\\\" }\\n format.xml { render :xml => @aircraft.errors, :status => :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c26840d34d0c37b1dc353b2682ea025\",\n \"score\": \"0.58917516\",\n \"text\": \"def by_aircraft\\n @logbook =Logbook.find params[:id]\\n @flights = @logbook.flights\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"98689808c79cac7665cbe521cdab9ca1\",\n \"score\": \"0.5829437\",\n \"text\": \"def index\\n @german_aircrafts = GermanAircraft.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6bca1ddd283c869d0a018e8a0763bfba\",\n \"score\": \"0.5816381\",\n \"text\": \"def create\\n @aircraft_type = AircraftType.new(params[:aircraft_type])\\n\\n respond_to do |format|\\n if @aircraft_type.save\\n format.html { redirect_to @aircraft_type, notice: 'Aircraft type was successfully created.' }\\n format.json { render json: @aircraft_type, status: :created, location: @aircraft_type }\\n else\\n format.html { render action: \\\"new\\\" }\\n format.json { render json: @aircraft_type.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a468e3e6e90395fe1cd265467891b5c7\",\n \"score\": \"0.5805235\",\n \"text\": \"def assign_car_model\\n \\tbike = (self.entity_type == \\\"Booking down-payment\\\" || self.entity_type == \\\"Other\\\") ? Bike.find_by_id(self.bike_id).try(:name) : MyBike.find_by_id(self.bike_id).try(:bike)\\n \\tself.vehicle_name = bike if bike\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1b7566b2432d773774d1a68407a2611\",\n \"score\": \"0.57909894\",\n \"text\": \"def create\\n @travel_request = TravelRequest.find(params[:travel_request_id])\\n @travel_leg = TravelLeg.find(params[:travel_leg_id])\\n @accommodations = @travel_leg.accommodation\\n @car_hires = @travel_leg.car_hire\\n @flights = @travel_leg.flight\\n @accommodation = Accommodation.new(accommodation_params)\\n @accommodation.travel_leg = @travel_leg\\n @accommodation.booked = false\\n respond_to do |format|\\n if @accommodation.save\\n format.html { redirect_to travel_request_travel_leg_path(@travel_request, @travel_leg), notice: 'Accommodation was successfully created.' }\\n format.json { render action: 'show', status: :created, location: @accommodation }\\n else\\n format.html { render action: 'new' }\\n format.json { render json: @accommodation.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"93a49bec840f6ed224bfd56407f33d61\",\n \"score\": \"0.5783201\",\n \"text\": \"def create\\n @aircraft = Aircraft.new(params[:aircraft])\\n\\n respond_to do |format|\\n if @aircraft.save\\n flash[:notice] = 'Aircraft was successfully created.'\\n format.html { redirect_to(@aircraft) }\\n format.xml { render :xml => @aircraft, :status => :created, :location => @aircraft }\\n else\\n format.html { render :action => \\\"new\\\" }\\n format.xml { render :xml => @aircraft.errors, :status => :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3f3350bef113f92f96cd7cb2fc61dc70\",\n \"score\": \"0.57123065\",\n \"text\": \"def create\\n @aircraft = Aircraft.new(params[:aircraft])\\n\\n respond_to do |format|\\n if @aircraft.save\\n add_to_log(t('Aircraft created log') + @aircraft.name,\\\"aircrafts\\\",\\\"create\\\")\\n flash[:notice] = t('Aircraft created')\\n if params[:submit_continue] == I18n.t('Create and continue')\\n format.html { redirect_to(:action => :new) }\\n else\\n format.html { redirect_to(@aircraft) }\\n format.xml { render :xml => @aircraft, :status => :created, :location => @aircraft }\\n end\\n else\\n format.html { render :action => \\\"new\\\" }\\n format.xml { render :xml => @aircraft.errors, :status => :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"487f6e24f3a54e621ef695de4310a60e\",\n \"score\": \"0.5700799\",\n \"text\": \"def new\\n @flight = Flight.new(:duration => 2, :aircraft => @aircraft)\\n @clients = Client.all(:order=>:name).collect{|c| [c.name, c.id]}\\n @instructors = Instructor.all(:order=>:name).collect{|c| [c.name, c.id]}\\n @aircrafts = Aircraft.where(:aircraft_type_id => params[:aircraft_type_id]).collect{|c| [c.prefix, c.id]}\\n @aircraft_type = AircraftType.find(params[:aircraft_type_id])\\n respond_to do |format|\\n format.html # new.html.erb\\n format.json { render :json => @flight }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b970d676b5255445c8dbb0bd2cb8b0c5\",\n \"score\": \"0.56249344\",\n \"text\": \"def new\\n @aircraft = Aircraft.new\\n @aircraft_types = AircraftType.find(:all)\\n\\n respond_to do |format|\\n format.html # new.html.erb\\n format.xml { render :xml => @aircraft }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"517e02a247c00b0ebd2da61a06160439\",\n \"score\": \"0.56118697\",\n \"text\": \"def create\\n @airplane = Airplane.new(airplane_params)\\n\\n if @airplane.save\\n json_response(@airplane.decorate.as_json(airline_details: true),\\n :created)\\n else\\n json_response(@airplane.errors, :unprocessable_entity)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1c5dcc9dd45c5c8427109adf9cf10604\",\n \"score\": \"0.5608775\",\n \"text\": \"def airplane_params\\n params.require(:airplane).permit(:name, :model, :status,:time_on_lane, :airline_id, :capacity)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d89a6d1b72dafa816d05e870147804af\",\n \"score\": \"0.5579793\",\n \"text\": \"def modeler_description\\n 'Add Zone Sensors to Alfalfa'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c4d38c1fe572b06436631fac281d29c8\",\n \"score\": \"0.5576942\",\n \"text\": \"def create\\n @aircraft_company = AircraftCompany.new(params[:aircraft_company])\\n\\n respond_to do |format|\\n if @aircraft_company.save\\n format.html { redirect_to @aircraft_company, notice: 'Aircraft company was successfully created.' }\\n format.json { render json: @aircraft_company, status: :created, location: @aircraft_company }\\n else\\n format.html { render action: \\\"new\\\" }\\n format.json { render json: @aircraft_company.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e86b9405f4c73c44eb7226e0c21a2bf\",\n \"score\": \"0.55681556\",\n \"text\": \"def german_aircraft_params\\n params.require(:german_aircraft).permit(:name, :designation, :description, :content)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2e6f0a0b418f872019c787750df3af8d\",\n \"score\": \"0.55643106\",\n \"text\": \"def new\\n return unless has_permission :can_manage_aircraft\\n @page_title = \\\"New Aircraft Type\\\"\\n @aircraft_type = AircraftType.new\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"010d3a5bbd8145b7c426345752a401f8\",\n \"score\": \"0.5560527\",\n \"text\": \"def get_aircraft_with_http_info(opts = {})\\n if @api_client.config.debugging\\n @api_client.config.logger.debug 'Calling API: AircraftApi.get_aircraft ...'\\n end\\n # resource path\\n local_var_path = '/aircraft'\\n\\n # query parameters\\n query_params = opts[:query_params] || {}\\n query_params[:'modeS'] = opts[:'mode_s'] if !opts[:'mode_s'].nil?\\n query_params[:'registration'] = opts[:'registration'] if !opts[:'registration'].nil?\\n\\n # header parameters\\n header_params = opts[:header_params] || {}\\n # HTTP header 'Accept' (if needed)\\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\\n\\n # form parameters\\n form_params = opts[:form_params] || {}\\n\\n # http body (model)\\n post_body = opts[:body] \\n\\n return_type = opts[:return_type] || 'GetAircraftResponse' \\n\\n auth_names = opts[:auth_names] || ['bearerToken']\\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\\n :header_params => header_params,\\n :query_params => query_params,\\n :form_params => form_params,\\n :body => post_body,\\n :auth_names => auth_names,\\n :return_type => return_type)\\n\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"API called: AircraftApi#get_aircraft\\\\nData: #{data.inspect}\\\\nStatus code: #{status_code}\\\\nHeaders: #{headers}\\\"\\n end\\n return data, status_code, headers\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be958c4e8cc07f7511095bdae598fd53\",\n \"score\": \"0.55591327\",\n \"text\": \"def airline\\n @airline ||= Airline.find(params[:airline_id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"485ded4ba43c0d7f09225824b3defe03\",\n \"score\": \"0.55589235\",\n \"text\": \"def airport_with_available_fuel\\n\\t\\t\\tavailability = []\\n\\t\\t\\tData.each do |airport|\\n\\t\\t\\t\\tavailability.push([airport[1], airport[3]])\\n\\t\\t\\tend\\n\\t\\t\\tavailability_fuel_data = availability.map { |values| %w(Airport Fuel_Available).zip(values).to_h }\\n\\t\\t\\ttp availability_fuel_data #tp => for printing data in table format\\n\\t\\t\\tAirport.take_user_input\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7fda82eaf407a563549dec37298e6d06\",\n \"score\": \"0.5533141\",\n \"text\": \"def list\\n return unless has_permission :can_manage_aircraft\\n @page_title = \\\"Aircraft Types\\\"\\n @aircraft_types = AircraftType.find :all ,:order=>'type_name'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"45ff3df850acc9ab90c5532d89a8008a\",\n \"score\": \"0.55258656\",\n \"text\": \"def set_airplane\\n @airplane = Airplane.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ecedee9c518c76d2e0850ffaf509d736\",\n \"score\": \"0.55195075\",\n \"text\": \"def set_airline\\n @airline = Airline.friendly.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"55c1885832a7f0c63c5362661a0d6dc0\",\n \"score\": \"0.54999554\",\n \"text\": \"def aircraft_params\\n params.fetch(:aircraft, {})\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6fd6110bf07a026f2e87a7677149baca\",\n \"score\": \"0.54928255\",\n \"text\": \"def airfield_params\\n params.require(:airfield).permit(:name, :airfield_type, :ATC_channel, :ATIS_channel)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0abd6749645fda931cb7f1cf79d8482f\",\n \"score\": \"0.54852444\",\n \"text\": \"def airplane_params\\n params.require(:airplane).permit(:name, :typeofplane, :firstseat, :firstemer, :firstprice, :firstrow, :busseat, :busemer, :busprice, :busrow, :ecoseat, :ecoemer, :ecoprice, :ecorow)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4e7fca098fd09955d71d8c9d7109d13d\",\n \"score\": \"0.5483373\",\n \"text\": \"def aircraft?\\n true\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"28bc56e5af1d2900fff359803b78628b\",\n \"score\": \"0.54603904\",\n \"text\": \"def create\\n @accommodation = Accommodation.new(params[:accommodation])\\n @accommodation.landlord = current_user unless can? :manage, Accommodation\\n\\n if @accommodation.save\\n redirect_to @accommodation, notice: 'Accommodation was successfully created.'\\n else\\n load_combo_data\\n render action: \\\"new\\\" \\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f0e7df029861eb216a68c464ea854e5b\",\n \"score\": \"0.54418415\",\n \"text\": \"def aircraft_select\\n if @offer.aircraft_id != nil\\n if !Aircraft.find(:all, :conditions => {:active => true}).include?(Aircraft.find(@offer.aircraft.id))\\n @aircrafts = Aircraft.find_all_by_id(@offer.aircraft.id) + Aircraft.find(:all, :conditions => {:active => true})\\n @aircrafts.sort! { |a,b| a.name.downcase <=> b.name.downcase }\\n return select :offer, :aircraft_id, @aircrafts.map {|a| [a.name, a.id]}\\n else\\n @aircrafts = Aircraft.find(:all, :conditions => {:active => true})\\n @aircrafts.sort! { |a,b| a.name.downcase <=> b.name.downcase }\\n return select :offer, :aircraft_id, @aircrafts.map {|a| [a.name, a.id]}\\n end\\n else\\n @aircrafts = Aircraft.find(:all, :conditions => {:active => true})\\n @aircrafts.sort! { |a,b| a.name.downcase <=> b.name.downcase }\\n return select :offer, :aircraft_id, @aircrafts.map {|a| [a.name, a.id]}\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bfdc551e62c4f0754b1c7d69f211d209\",\n \"score\": \"0.54416436\",\n \"text\": \"def show\\n @aircraft_type = AircraftType.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @aircraft_type }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f3bca58919f790d557b4c50a28419fa2\",\n \"score\": \"0.541787\",\n \"text\": \"def create\\n @aircraft_type = AircraftType.new(params[:aircraft_type])\\n\\n respond_to do |format|\\n if @aircraft_type.save\\n add_to_log(t('Aircraft type created log') + @aircraft_type.name,\\\"aircraft_types\\\",\\\"create\\\")\\n flash[:notice] = t('Aircraft type created')\\n if params[:submit_continue] == I18n.t('Create and continue')\\n format.html { redirect_to(:action => :new) }\\n else\\n format.html { redirect_to(@aircraft_type) }\\n format.xml { render :xml => @aircraft_type, :status => :created, :location => @aircraft_type }\\n end\\n else\\n format.html { render :action => \\\"new\\\" }\\n format.xml { render :xml => @aircraft_type.errors, :status => :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3a6e38dcf6166c440739ff26de2b2bb2\",\n \"score\": \"0.5414845\",\n \"text\": \"def set_airplane\\n @airplane = Airplane.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3a6e38dcf6166c440739ff26de2b2bb2\",\n \"score\": \"0.5414845\",\n \"text\": \"def set_airplane\\n @airplane = Airplane.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3a6e38dcf6166c440739ff26de2b2bb2\",\n \"score\": \"0.5414845\",\n \"text\": \"def set_airplane\\n @airplane = Airplane.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f09ddef21061cb5628845d261380fc3f\",\n \"score\": \"0.5401326\",\n \"text\": \"def airline\\n @airline ||= Airline.find(params[:airline_id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5e26893a7700aa35c86c36b6eb9f6e6f\",\n \"score\": \"0.53946114\",\n \"text\": \"def airlines\\n Flight::Airlines.new.perform\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"37a12ec6fe2edee11758a95109169e29\",\n \"score\": \"0.5383044\",\n \"text\": \"def create\\n @fleet = Fleet.new(params[:fleet])\\n @assets = Asset.new(params[:asset]) \\n @assets.fleet = @fleet\\n @fleet.truck_fleet = current_user.truck_fleet\\n \\n respond_to do |format|\\n if @fleet.save\\n @assets.save\\n @fleet.prepare_services\\n @fleet.update_serviceables(params[:fields]) \\n format.html { redirect_to @fleet, notice: 'Fleet was successfully created.' }\\n format.json { render json: @fleet, status: :created, location: @fleet }\\n else\\n format.html { render action: \\\"new\\\" }\\n format.json { render json: @fleet.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8f0e0b9e22b9856168c3c40f8f05f940\",\n \"score\": \"0.53799045\",\n \"text\": \"def airline_params\\n params.require(:airline).permit(:iata_code, :icao_code, :name, :country, :logo, :alliance)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2b071ae8da894f728dd80aac50c71a3d\",\n \"score\": \"0.5377623\",\n \"text\": \"def find_aircraft\\n relation =\\n Aircraft.\\n joins(:identifier).\\n where(identifiers: {code: identifier}).\\n order(\\\"as_of ASC\\\")\\n\\n relation = relation.where(\\\"as_of <= ?\\\", @date) if @date\\n relation.last\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2333fc9da883001197446b3e59a9f82d\",\n \"score\": \"0.5359652\",\n \"text\": \"def new\\n @aircraft_type = AircraftType.new\\n\\n respond_to do |format|\\n format.html # new.html.erb\\n format.json { render json: @aircraft_type }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c34540aaedd3f9c8e296105179dbac30\",\n \"score\": \"0.53590626\",\n \"text\": \"def new_aircraft(aircraft)\\n @aircraft = aircraft\\n mail(\\n subject: DEFAULT_SUBJECT + 'an organisation added aircraft'\\n )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7855144215972b83a8c003b93246f093\",\n \"score\": \"0.5357966\",\n \"text\": \"def airline_params\\n params.require(:airline).permit(:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7855144215972b83a8c003b93246f093\",\n \"score\": \"0.5357966\",\n \"text\": \"def airline_params\\n params.require(:airline).permit(:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"86ea2fd22a2bce3545b2c9d8a235e813\",\n \"score\": \"0.5352073\",\n \"text\": \"def create\\n @airplane_type = AirplaneType.new(airplane_type_params)\\n\\n respond_to do |format|\\n if @airplane_type.save\\n format.html { redirect_to @airplane_type, notice: 'Airplane type was successfully created.' }\\n format.json { render :show, status: :created, location: @airplane_type }\\n else\\n format.html { render :new }\\n format.json { render json: @airplane_type.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"80911d8f5028d97aaaa19d420bdb0753\",\n \"score\": \"0.5344976\",\n \"text\": \"def name\\n self.equipment_model.try(:name)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9ae7803987770c9512abae974a953d95\",\n \"score\": \"0.533026\",\n \"text\": \"def airline_params\\n params.require(:airline).permit(:name, :iata, :phone_no, :contact_link, :pet_info_link, :comments)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"387005c299c5aa3b23492b3332e2f545\",\n \"score\": \"0.5325925\",\n \"text\": \"def set_airfield\\n @airfield = Airfield.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b24a22dcab56e438747235fbeea988cd\",\n \"score\": \"0.53093266\",\n \"text\": \"def show\\n if @destination.airport_id.nil? || @destination.airport_id == 0\\n @airport_name = I18n.t 'not_found'\\n elsif Airport.where(id: @destination.airport_id).take.nil?\\n @airport_name = I18n.t 'not_found'\\n else\\n @airport_name = Airport.where(id: @destination.airport_id).take.name\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358ed1d37c19737f9c97f7cd81256b42\",\n \"score\": \"0.529944\",\n \"text\": \"def create\\n @bike = Bike.new(bike_params)\\n # @model = Model.find(params[:model_id])\\n\\n # if equipment_name is not setted the for example equal then model name\\n if @bike.valid? && (@bike.equipment_name == \\\"\\\" || @bike.equipment_name == nil)\\n @bike.equipment_name = @bike.model.name\\n end\\n\\n respond_to do |format|\\n if @bike.save\\n format.html { redirect_to @bike, flash: {success: _('Moto creata con successo!')} }\\n format.json { render json: @bike, status: :created, location: @bike }\\n else\\n format.html { render \\\"forms/new_edit\\\" }\\n format.json { render json: @bike.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4740d5cacf88fe30280999ce498230a9\",\n \"score\": \"0.52952653\",\n \"text\": \"def airline_params\\n params.require(:airline).permit(:name, :country)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bda12bb5fde86fa8fc96a248880383c7\",\n \"score\": \"0.52934045\",\n \"text\": \"def create\\n expire_action :action => :index\\n #@airfield = Airfield.new(params[:airfield])\\n \\n csv_text = File.read(open('https://commondatastorage.googleapis.com/ckannet-storage/2012-07-09T214020/global_airports.csv'))\\n csv = CSV.parse(csv_text, :headers => true)\\n csv.each do |row|\\n row = row.to_hash.with_indifferent_access\\n @airfield=Airfield.find_or_create_by_airport_id!(row.to_hash.symbolize_keys)\\n @airfield.update_attributes(row.to_hash.symbolize_keys)\\n end\\n #respond_to do |format|\\n #if @airfield.save\\n #format.html { redirect_to @airfield, notice: 'Airfield was successfully created.' }\\n #format.json { render json: @airfield, status: :created, location: @airfield }\\n #else\\n # format.html { render action: \\\"new\\\" }\\n #format.json { render json: @airfield.errors, status: :unprocessable_entity }\\n #end\\n #end\\n redirect_to(airfields_path, :notice => \\\"Airports were successfully updated\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f13f740ffcc38891d97fe0bf3be6120e\",\n \"score\": \"0.528746\",\n \"text\": \"def show\\n @aircraft = Aircraft.find(params[:id])\\n\\n # respond_to do |format|\\n # format.html # show.html.erb\\n # format.xml { render :xml => @aircraft }\\n # end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"96bef1b940c459f0b99083f4a979d014\",\n \"score\": \"0.52870584\",\n \"text\": \"def create\\n @airfield = Airfield.new(airfield_params)\\n\\n respond_to do |format|\\n if @airfield.save\\n format.html { redirect_to @airfield, notice: 'Airfield was successfully created.' }\\n format.json { render :show, status: :created, location: @airfield }\\n else\\n format.html { render :new }\\n format.json { render json: @airfield.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"218e27b6f9828d765b9b4bdacdbc62ea\",\n \"score\": \"0.52782804\",\n \"text\": \"def set_airport_air_traffic\\n @airport_air_traffic = AirportAirTraffic.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6d5b5921a691eb2bfe1c9f6a75889dc1\",\n \"score\": \"0.52773494\",\n \"text\": \"def show\\n @aircraft_company = AircraftCompany.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @aircraft_company }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0ca3115f9dfd02c449147427b1ee961f\",\n \"score\": \"0.52731645\",\n \"text\": \"def create\\n #.create\\n # byebug\\n Airplane.create(airplane_params)\\n # render?? redirect??\\n redirect_to \\\"/airplanes\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d3eb2c5e1e575bcb56f574c13ef4025\",\n \"score\": \"0.5260407\",\n \"text\": \"def create\\n @airplane = Airplane.new(airplane_params)\\n\\n respond_to do |format|\\n if @airplane.save\\n format.html { redirect_to @airplane, notice: 'Airplane was successfully created.' }\\n format.json { render :show, status: :created, location: @airplane }\\n else\\n format.html { render :new }\\n format.json { render json: @airplane.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d3eb2c5e1e575bcb56f574c13ef4025\",\n \"score\": \"0.5260407\",\n \"text\": \"def create\\n @airplane = Airplane.new(airplane_params)\\n\\n respond_to do |format|\\n if @airplane.save\\n format.html { redirect_to @airplane, notice: 'Airplane was successfully created.' }\\n format.json { render :show, status: :created, location: @airplane }\\n else\\n format.html { render :new }\\n format.json { render json: @airplane.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"48d25e292b4e120d67b08ebc6843e1e0\",\n \"score\": \"0.5247676\",\n \"text\": \"def show\\n json_response(@airplane.decorate.as_json(airline_details: true), :ok)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d11b221ec38fce214d6d5f11474acf0\",\n \"score\": \"0.52469\",\n \"text\": \"def create\\n @aircraft_class = AircraftClass.new(params[:aircraft_class])\\n\\n respond_to do |format|\\n if @aircraft_class.save\\n format.html { redirect_to(@aircraft_class, :notice => 'Aircraft class was successfully created.') }\\n format.xml { render :xml => @aircraft_class, :status => :created, :location => @aircraft_class }\\n else\\n format.html { render :action => \\\"new\\\" }\\n format.xml { render :xml => @aircraft_class.errors, :status => :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d01ed682564e2893314466738045cc4d\",\n \"score\": \"0.5242338\",\n \"text\": \"def create\\n @airport = scope.new(airport_params)\\n\\n if @airport.save\\n json_response(@airport.decorate.as_json(airport_details: true),\\n :created)\\n else\\n json_response(@airport.errors, :unprocessable_entity)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"82b34f1bd73fc5a031897f39ea261510\",\n \"score\": \"0.52362025\",\n \"text\": \"def airplane_params\\n params.require(:airplane).permit(:hex, :sqawk, :flight, :lat, :lon, :validposition, :altitude, :vert_rate, :track, :validtrack, :speed, :messages, :seen, :mlat)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"822f1b147f932bc8eb6b76433f93ff09\",\n \"score\": \"0.5227146\",\n \"text\": \"def find_airlines\\n @airline = AirlinesDatum.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"02862f5e075df9f2f883e533a8fe1b65\",\n \"score\": \"0.5215879\",\n \"text\": \"def show\\n @aircraft = Aircraft.find(params[:id])\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @aircraft }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9c95f345ec345f98ac1c12c7d2c3e991\",\n \"score\": \"0.521366\",\n \"text\": \"def index\\n @airplanes = Airplane.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"508388f3b366ec5536c091662e338008\",\n \"score\": \"0.5209722\",\n \"text\": \"def create\\n @air = Air.new(params[:air])\\n\\n respond_to do |format|\\n if @air.save\\n format.html { redirect_to @air, :notice => 'Air was successfully created.' }\\n format.json { render :json => @air, :status => :created, :location => @air }\\n else\\n format.html { render :action => \\\"new\\\" }\\n format.json { render :json => @air.errors, :status => :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e68ca73e089d9a1e4a1cdea46bc4f3e4\",\n \"score\": \"0.5207929\",\n \"text\": \"def in_airship?\\r\\n @vehicle_type == :airship\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fefe2643f76a1879e983b68419637f37\",\n \"score\": \"0.52051276\",\n \"text\": \"def index\\n @airfields = Airfield.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"369f3cb0483e99e6abcb5053fe5a6ba7\",\n \"score\": \"0.5201017\",\n \"text\": \"def aircraft_params\\n params.require(:aircraft).permit(:latitude, :longitude)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bf196a99be25c066ce1a60b9d636c906\",\n \"score\": \"0.5199648\",\n \"text\": \"def plane_params\\n params.require(:plane).permit(:model, :patent, :brand_id, :airway_id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1dd27c071c098f55d2884d78274f3430\",\n \"score\": \"0.5195951\",\n \"text\": \"def show\\n @aircraft = Aircraft.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @aircraft }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"64b9c5d51564c5a2c3247a53440cb53d\",\n \"score\": \"0.5188509\",\n \"text\": \"def create\\n @abaste = Abaste.new(abaste_params)\\n @company = Company.find(1) \\n\\n @customers = @company.get_customers()\\n @trucks = @company.get_trucks()\\n @employees = @company.get_employees()\\n @abaste.user_id = current_user.id \\n\\n respond_to do |format|\\n if @abaste.save\\n format.html { redirect_to @abaste, notice: 'Abaste was successfully created.' }\\n format.json { render :show, status: :created, location: @abaste }\\n else\\n format.html { render :new }\\n format.json { render json: @abaste.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"32ba8dadb3f2edcaa35eafe31840093f\",\n \"score\": \"0.5186977\",\n \"text\": \"def airport_fuel_data\\n\\t\\t\\thash_of_table = Data.map { |values| %w(Airport_ID Airport_Name FuelCapacity(ltrs) Fuel_Available(ltrs)).zip(values).to_h }\\n\\t\\t\\ttp hash_of_table #tp => for printing data in table format\\n\\t\\t\\tAirport.take_user_input\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"881a10c652eb297a266a29dc6ed27c41\",\n \"score\": \"0.5180702\",\n \"text\": \"def show_airport_info\\n\\t\\tputs \\\"--------------------------------------------------------------------------------\\\"\\n\\t\\tputs \\\"Airport Name \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t Fuel Available\\\"\\n\\t\\tputs \\\"--------------------------------------------------------------------------------\\\"\\n\\t\\t@airports_info.each do |key,data|\\n\\t\\t\\tputs \\\"#{data['Airport Name']}\\\\t\\\\t\\\\t #{data['Fuel Available']}\\\"\\n\\t\\tend\\n\\t\\tputs \\\"--------------------------------------------------------------------------------\\\"\\n\\t\\n\\t\\tget_user_input\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f257a2776a1b3f263fc92ae5b80d7e76\",\n \"score\": \"0.51789296\",\n \"text\": \"def show\\n @aircraft_type = AircraftType.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @aircraft_type }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"489bcf658efb65dca9fea58df0b38d39\",\n \"score\": \"0.51702183\",\n \"text\": \"def create\\n @airport = Airport.new(airport_params)\\n\\n respond_to do |format|\\n if @airport.save\\n format.html { redirect_to root_path, notice: 'Airport was successfully created.' }\\n format.json { render :show, status: :created, location: @airport }\\n else\\n format.html { render :new }\\n format.json { render json: @airport.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"93ec061a4ad648c3e666e6ebf465cb3c\",\n \"score\": \"0.5168608\",\n \"text\": \"def create\\n @carriers = Carrier.all\\n @facility = Facility.new(facility_params)\\n if !current_user.admin?\\n @facility.carrier_id = Carrier.find_by_name(current_user.carrier_name).id\\n end\\n\\n respond_to do |format|\\n if @facility.save\\n # FormMailer.facility_email(@facility.city, @facility.id).deliver\\n format.html { redirect_to :root, notice: 'Thank you for registering!' }\\n format.json { render :root, status: :created, location: @facility }\\n else\\n format.html { render :new }\\n format.json { render json: @facility.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3fa9126fa54e9c0187d8f5a5511d2692\",\n \"score\": \"0.51621246\",\n \"text\": \"def create\\n @airline = Airline.new(airline_params)\\n\\n respond_to do |format|\\n if @airline.save\\n format.html { redirect_to @airline, notice: 'Airline was successfully created.' }\\n format.json { render :show, status: :created, location: @airline }\\n else\\n format.html { render :new }\\n format.json { render json: @airline.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3fa9126fa54e9c0187d8f5a5511d2692\",\n \"score\": \"0.51621246\",\n \"text\": \"def create\\n @airline = Airline.new(airline_params)\\n\\n respond_to do |format|\\n if @airline.save\\n format.html { redirect_to @airline, notice: 'Airline was successfully created.' }\\n format.json { render :show, status: :created, location: @airline }\\n else\\n format.html { render :new }\\n format.json { render json: @airline.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"69724918f8328df2eb4dd8830ea21ebe\",\n \"score\": \"0.51582104\",\n \"text\": \"def create\\n @airline = Airline.new(params[:airline])\\n\\n respond_to do |format|\\n if @airline.save\\n format.html { redirect_to @airline, notice: 'Airline was successfully created.' }\\n format.json { render json: @airline, status: :created, location: @airline }\\n else\\n format.html { render action: \\\"new\\\" }\\n format.json { render json: @airline.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"15150f74dbe547925b96e441ebb9f2a4\",\n \"score\": \"0.51563513\",\n \"text\": \"def create\\n @airport = Airport.find(params[:airport_id])\\n @plane = @airport.planes.create(plane_params)\\n\\n #@plane = plane.new(plane_params)\\n\\n if @plane.save\\n redirect_to airport_path(@airport), notice: 'plane was successfully created.'\\n else\\n render :new\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ab0f5d2a64a2c8b3f4b8d99c940e38be\",\n \"score\": \"0.51560473\",\n \"text\": \"def create\\n @airport = Airport.new(airport_params)\\n\\n respond_to do |format|\\n if @airport.save\\n format.html { redirect_to @airport, notice: 'Airport was successfully created.' }\\n format.json { render :show, status: :created, location: @airport }\\n else\\n format.html { render :new }\\n format.json { render json: @airport.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"719ed7327928698a7bbc52508641100a\",\n \"score\": \"0.51550865\",\n \"text\": \"def set_airplane_type\\n @airplane_type = AirplaneType.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aa2b349be060ae1206ae7e090914f3f5\",\n \"score\": \"0.5155005\",\n \"text\": \"def aircraft?\\n false\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c11313ed3f3ea54e48666f1b9b28952\",\n \"score\": \"0.5150682\",\n \"text\": \"def new\\n @aircraft_type = AircraftType.new\\n\\n respond_to do |format|\\n format.html # new.html.erb\\n format.xml { render :xml => @aircraft_type }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7edd026dba9505db297901f9a817a4d2\",\n \"score\": \"0.51481116\",\n \"text\": \"def trigger_new_flight(dep_airport_obj, arr_airport_obj)\\n param_array = generate_param_array_from_airport_objects(dep_airport_obj, arr_airport_obj)\\n new_flight = FlightCreator.new(param_array).manufacture\\n return new_flight.save ? new_flight : nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b2d24bad26e13bd266ab926f81b64c8e\",\n \"score\": \"0.5145631\",\n \"text\": \"def show\\n\\t\\n\\t@ambit = @name.ambit\\n @area = @name.area\\n\\t@group = @name.group\\n\\t@fascicles = @name.fascicles\\n\\t@dossiers = @name.dossiers\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":185,"cells":{"query_id":{"kind":"string","value":"f74c29bdfc4a183e1ec1b91334cd5be2"},"query":{"kind":"string","value":"Use callbacks to share common setup or constraints between actions."},"positive_passages":{"kind":"list like","value":[{"docid":"186fe3e59bbe968aee6d2e7bdd6a7143","score":"0.0","text":"def set_translatorused\n @translatorused = Translatorused.find(params[:id])\n end","title":""}],"string":"[\n {\n \"docid\": \"186fe3e59bbe968aee6d2e7bdd6a7143\",\n \"score\": \"0.0\",\n \"text\": \"def set_translatorused\\n @translatorused = Translatorused.find(params[:id])\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"bd89022716e537628dd314fd23858181","score":"0.6163163","text":"def set_required_actions\n # TODO: check what fields change to asign required fields\n end","title":""},{"docid":"3db61e749c16d53a52f73ba0492108e9","score":"0.6045976","text":"def action_hook; end","title":""},{"docid":"b8b36fc1cfde36f9053fe0ab68d70e5b","score":"0.5946146","text":"def run_actions; end","title":""},{"docid":"3e521dbc644eda8f6b2574409e10a4f8","score":"0.591683","text":"def define_action_hook; end","title":""},{"docid":"801bc998964ea17eb98ed4c3e067b1df","score":"0.5890051","text":"def actions; end","title":""},{"docid":"bfb8386ef5554bfa3a1c00fa4e20652f","score":"0.58349305","text":"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end","title":""},{"docid":"6c8e66d9523b9fed19975542132c6ee4","score":"0.5776858","text":"def add_actions; end","title":""},{"docid":"9c186951c13b270d232086de9c19c45b","score":"0.5703237","text":"def callbacks; end","title":""},{"docid":"9c186951c13b270d232086de9c19c45b","score":"0.5703237","text":"def callbacks; end","title":""},{"docid":"6ce8a8e8407572b4509bb78db9bf8450","score":"0.5652805","text":"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end","title":""},{"docid":"1964d48e8493eb37800b3353d25c0e57","score":"0.5621621","text":"def define_action_helpers; end","title":""},{"docid":"5df9f7ffd2cb4f23dd74aada87ad1882","score":"0.54210985","text":"def post_setup\n end","title":""},{"docid":"dbebed3aa889e8b91b949433e5260fb5","score":"0.5411113","text":"def action_methods; end","title":""},{"docid":"dbebed3aa889e8b91b949433e5260fb5","score":"0.5411113","text":"def action_methods; end","title":""},{"docid":"dbebed3aa889e8b91b949433e5260fb5","score":"0.5411113","text":"def action_methods; end","title":""},{"docid":"c5904f93614d08afa38cc3f05f0d2365","score":"0.5391541","text":"def before_setup; end","title":""},{"docid":"f099a8475f369ce73a38d665b6ee6877","score":"0.53794575","text":"def action_run\n end","title":""},{"docid":"2c4e5a90aa8efaaa3ed953818a9b30d2","score":"0.5357573","text":"def execute(setup)\n @action.call(setup)\n end","title":""},{"docid":"0464870c8688619d6c104d733d355b3b","score":"0.53402257","text":"def define_action_helpers?; end","title":""},{"docid":"0e7bdc54b0742aba847fd259af1e9f9e","score":"0.53394014","text":"def set_actions\n actions :all\n end","title":""},{"docid":"5510330550e34a3fd68b7cee18da9524","score":"0.53321576","text":"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end","title":""},{"docid":"97c8901edfddc990da95704a065e87bc","score":"0.53124547","text":"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end","title":""},{"docid":"4f9a284723e2531f7d19898d6a6aa20c","score":"0.529654","text":"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end","title":""},{"docid":"83684438c0a4d20b6ddd4560c7683115","score":"0.5296262","text":"def before_actions(*logic)\n self.before_actions = logic\n end","title":""},{"docid":"210e0392ceaad5fc0892f1335af7564b","score":"0.52952296","text":"def setup_handler\n end","title":""},{"docid":"a997ba805d12c5e7f7c4c286441fee18","score":"0.52600986","text":"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end","title":""},{"docid":"1d50ec65c5bee536273da9d756a78d0d","score":"0.52442724","text":"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end","title":""},{"docid":"e6d7c691bed78fb0eeb9647503f4a244","score":"0.52385926","text":"def action; end","title":""},{"docid":"e6d7c691bed78fb0eeb9647503f4a244","score":"0.52385926","text":"def action; end","title":""},{"docid":"e6d7c691bed78fb0eeb9647503f4a244","score":"0.52385926","text":"def action; end","title":""},{"docid":"e6d7c691bed78fb0eeb9647503f4a244","score":"0.52385926","text":"def action; end","title":""},{"docid":"e6d7c691bed78fb0eeb9647503f4a244","score":"0.52385926","text":"def action; end","title":""},{"docid":"635288ac8dd59f85def0b1984cdafba0","score":"0.5232394","text":"def workflow\n end","title":""},{"docid":"e34cc2a25e8f735ccb7ed8361091c83e","score":"0.523231","text":"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end","title":""},{"docid":"78b21be2632f285b0d40b87a65b9df8c","score":"0.5227454","text":"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end","title":""},{"docid":"6350959a62aa797b89a21eacb3200e75","score":"0.52226824","text":"def before(action)\n invoke_callbacks *self.class.send(action).before\n end","title":""},{"docid":"923ee705f0e7572feb2c1dd3c154b97c","score":"0.52201617","text":"def process_action(...)\n send_action(...)\n end","title":""},{"docid":"b89a3908eaa7712bb5706478192b624d","score":"0.5212327","text":"def before_dispatch(env); end","title":""},{"docid":"7115b468ae54de462141d62fc06b4190","score":"0.52079266","text":"def after_actions(*logic)\n self.after_actions = logic\n end","title":""},{"docid":"d89a3e408ab56bf20bfff96c63a238dc","score":"0.52050185","text":"def setup\n # override and do something appropriate\n end","title":""},{"docid":"62c402f0ea2e892a10469bb6e077fbf2","score":"0.51754695","text":"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end","title":""},{"docid":"72ccb38e1bbd86cef2e17d9d64211e64","score":"0.51726824","text":"def setup(_context)\n end","title":""},{"docid":"b4f4e1d4dfd31919ab39aecccb9db1d0","score":"0.51710224","text":"def setup(resources) ; end","title":""},{"docid":"1fd817f354d6cb0ff1886ca0a2b6cce4","score":"0.5166172","text":"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end","title":""},{"docid":"5531df39ee7d732600af111cf1606a35","score":"0.5159343","text":"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end","title":""},{"docid":"bb6aed740c15c11ca82f4980fe5a796a","score":"0.51578903","text":"def determine_valid_action\n\n end","title":""},{"docid":"b38f9d83c26fd04e46fe2c961022ff86","score":"0.51522785","text":"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end","title":""},{"docid":"199fce4d90958e1396e72d961cdcd90b","score":"0.5152022","text":"def startcompany(action)\n @done = true\n action.setup\n end","title":""},{"docid":"994d9fe4eb9e2fc503d45c919547a327","score":"0.51518047","text":"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end","title":""},{"docid":"62fabe9dfa2ec2ff729b5a619afefcf0","score":"0.51456624","text":"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end","title":""},{"docid":"faddd70d9fef5c9cd1f0d4e673e408b9","score":"0.51398855","text":"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end","title":""},{"docid":"adb8115fce9b2b4cb9efc508a11e5990","score":"0.5133759","text":"def define_tasks\n define_weave_task\n connect_common_tasks\n end","title":""},{"docid":"e1dd18cf24d77434ec98d1e282420c84","score":"0.5112076","text":"def setup(&block)\n define_method(:setup, &block)\n end","title":""},{"docid":"3b4fb29fa45f95d436fd3a8987f12de7","score":"0.5111866","text":"def setup\n transition_to(:setup)\n end","title":""},{"docid":"3b4fb29fa45f95d436fd3a8987f12de7","score":"0.5111866","text":"def setup\n transition_to(:setup)\n end","title":""},{"docid":"975ecc8d218b62d480bbe0f6e46e72bb","score":"0.5110294","text":"def action\n end","title":""},{"docid":"f54964387b0ee805dbd5ad5c9a699016","score":"0.5106169","text":"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend","title":""},{"docid":"35b302dd857a031b95bc0072e3daa707","score":"0.509231","text":"def config(action, *args); end","title":""},{"docid":"bc3cd61fa2e274f322b0b20e1a73acf8","score":"0.50873137","text":"def setup\n @setup_proc.call(self) if @setup_proc\n end","title":""},{"docid":"5c3cfcbb42097019c3ecd200acaf9e50","score":"0.5081088","text":"def before_action \n end","title":""},{"docid":"246840a409eb28800dc32d6f24cb1c5e","score":"0.508059","text":"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end","title":""},{"docid":"dfbcf4e73466003f1d1275cdf58a926a","score":"0.50677156","text":"def action\n end","title":""},{"docid":"36eb407a529f3fc2d8a54b5e7e9f3e50","score":"0.50562143","text":"def matt_custom_action_begin(label); end","title":""},{"docid":"b6c9787acd00c1b97aeb6e797a363364","score":"0.5050554","text":"def setup\n # override this if needed\n end","title":""},{"docid":"9fc229b5b48edba9a4842a503057d89a","score":"0.50474834","text":"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend","title":""},{"docid":"9fc229b5b48edba9a4842a503057d89a","score":"0.50474834","text":"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend","title":""},{"docid":"fd421350722a26f18a7aae4f5aa1fc59","score":"0.5036181","text":"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end","title":""},{"docid":"d02030204e482cbe2a63268b94400e71","score":"0.5026331","text":"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end","title":""},{"docid":"4224d3231c27bf31ffc4ed81839f8315","score":"0.5022976","text":"def after(action)\n invoke_callbacks *options_for(action).after\n end","title":""},{"docid":"24506e3666fd6ff7c432e2c2c778d8d1","score":"0.5015441","text":"def pre_task\n end","title":""},{"docid":"0c16dc5c1875787dacf8dc3c0f871c53","score":"0.50121695","text":"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end","title":""},{"docid":"c99a12c5761b742ccb9c51c0e99ca58a","score":"0.5000944","text":"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end","title":""},{"docid":"0cff1d3b3041b56ce3773d6a8d6113f2","score":"0.5000019","text":"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end","title":""},{"docid":"791f958815c2b2ac16a8ca749a7a822e","score":"0.4996878","text":"def setup_signals; end","title":""},{"docid":"6e44984b54e36973a8d7530d51a17b90","score":"0.4989888","text":"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend","title":""},{"docid":"6e44984b54e36973a8d7530d51a17b90","score":"0.4989888","text":"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend","title":""},{"docid":"5aa51b20183964c6b6f46d150b0ddd79","score":"0.49864885","text":"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end","title":""},{"docid":"7647b99591d6d687d05b46dc027fbf23","score":"0.49797225","text":"def initialize(*args)\n super\n @action = :set\nend","title":""},{"docid":"67e7767ce756766f7c807b9eaa85b98a","score":"0.49785787","text":"def after_set_callback; end","title":""},{"docid":"2a2b0a113a73bf29d5eeeda0443796ec","score":"0.4976161","text":"def setup\n #implement in subclass;\n end","title":""},{"docid":"63e628f34f3ff34de8679fb7307c171c","score":"0.49683493","text":"def lookup_action; end","title":""},{"docid":"a5294693c12090c7b374cfa0cabbcf95","score":"0.4965126","text":"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end","title":""},{"docid":"57dbfad5e2a0e32466bd9eb0836da323","score":"0.4958034","text":"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end","title":""},{"docid":"5b6d613e86d3d68152f7fa047d38dabb","score":"0.49559742","text":"def release_actions; end","title":""},{"docid":"4aceccac5b1bcf7d22c049693b05f81c","score":"0.4954353","text":"def around_hooks; end","title":""},{"docid":"2318410efffb4fe5fcb97970a8700618","score":"0.49535993","text":"def save_action; end","title":""},{"docid":"64e0f1bb6561b13b482a3cc8c532cc37","score":"0.4952725","text":"def setup(easy)\n super\n easy.customrequest = @verb\n end","title":""},{"docid":"fbd0db2e787e754fdc383687a476d7ec","score":"0.49467874","text":"def action_target()\n \n end","title":""},{"docid":"b280d59db403306d7c0f575abb19a50f","score":"0.49423352","text":"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end","title":""},{"docid":"9f7547d93941fc2fcc7608fdf0911643","score":"0.49325448","text":"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end","title":""},{"docid":"da88436fe6470a2da723e0a1b09a0e80","score":"0.49282882","text":"def before_setup\n # do nothing by default\n end","title":""},{"docid":"17ffe00a5b6f44f2f2ce5623ac3a28cd","score":"0.49269363","text":"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end","title":""},{"docid":"21d75f9f5765eb3eb36fcd6dc6dc2ec3","score":"0.49269104","text":"def default_action; end","title":""},{"docid":"3ba85f3cb794f951b05d5907f91bd8ad","score":"0.49252945","text":"def setup(&blk)\n @setup_block = blk\n end","title":""},{"docid":"80834fa3e08bdd7312fbc13c80f89d43","score":"0.4923091","text":"def callback_phase\n super\n end","title":""},{"docid":"f1da8d654daa2cd41cb51abc7ee7898f","score":"0.49194667","text":"def advice\n end","title":""},{"docid":"99a608ac5478592e9163d99652038e13","score":"0.49174926","text":"def _handle_action_missing(*args); end","title":""},{"docid":"9e264985e628b89f1f39d574fdd7b881","score":"0.49173003","text":"def duas1(action)\n action.call\n action.call\nend","title":""},{"docid":"399ad686f5f38385ff4783b91259dbd7","score":"0.49171105","text":"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end","title":""},{"docid":"0dccebcb0ecbb1c4dcbdddd4fb11bd8a","score":"0.4915879","text":"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end","title":""},{"docid":"6e0842ade69d031131bf72e9d2a8c389","score":"0.49155936","text":"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend","title":""}],"string":"[\n {\n \"docid\": \"bd89022716e537628dd314fd23858181\",\n \"score\": \"0.6163163\",\n \"text\": \"def set_required_actions\\n # TODO: check what fields change to asign required fields\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3db61e749c16d53a52f73ba0492108e9\",\n \"score\": \"0.6045976\",\n \"text\": \"def action_hook; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b8b36fc1cfde36f9053fe0ab68d70e5b\",\n \"score\": \"0.5946146\",\n \"text\": \"def run_actions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3e521dbc644eda8f6b2574409e10a4f8\",\n \"score\": \"0.591683\",\n \"text\": \"def define_action_hook; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"801bc998964ea17eb98ed4c3e067b1df\",\n \"score\": \"0.5890051\",\n \"text\": \"def actions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bfb8386ef5554bfa3a1c00fa4e20652f\",\n \"score\": \"0.58349305\",\n \"text\": \"def define_action_helpers\\n if super && action == :save\\n @instance_helper_module.class_eval do\\n define_method(:valid?) do |*args|\\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\\n end\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6c8e66d9523b9fed19975542132c6ee4\",\n \"score\": \"0.5776858\",\n \"text\": \"def add_actions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9c186951c13b270d232086de9c19c45b\",\n \"score\": \"0.5703237\",\n \"text\": \"def callbacks; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9c186951c13b270d232086de9c19c45b\",\n \"score\": \"0.5703237\",\n \"text\": \"def callbacks; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6ce8a8e8407572b4509bb78db9bf8450\",\n \"score\": \"0.5652805\",\n \"text\": \"def setup *actions, &proc\\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1964d48e8493eb37800b3353d25c0e57\",\n \"score\": \"0.5621621\",\n \"text\": \"def define_action_helpers; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5df9f7ffd2cb4f23dd74aada87ad1882\",\n \"score\": \"0.54210985\",\n \"text\": \"def post_setup\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbebed3aa889e8b91b949433e5260fb5\",\n \"score\": \"0.5411113\",\n \"text\": \"def action_methods; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbebed3aa889e8b91b949433e5260fb5\",\n \"score\": \"0.5411113\",\n \"text\": \"def action_methods; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbebed3aa889e8b91b949433e5260fb5\",\n \"score\": \"0.5411113\",\n \"text\": \"def action_methods; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c5904f93614d08afa38cc3f05f0d2365\",\n \"score\": \"0.5391541\",\n \"text\": \"def before_setup; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f099a8475f369ce73a38d665b6ee6877\",\n \"score\": \"0.53794575\",\n \"text\": \"def action_run\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2c4e5a90aa8efaaa3ed953818a9b30d2\",\n \"score\": \"0.5357573\",\n \"text\": \"def execute(setup)\\n @action.call(setup)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0464870c8688619d6c104d733d355b3b\",\n \"score\": \"0.53402257\",\n \"text\": \"def define_action_helpers?; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0e7bdc54b0742aba847fd259af1e9f9e\",\n \"score\": \"0.53394014\",\n \"text\": \"def set_actions\\n actions :all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5510330550e34a3fd68b7cee18da9524\",\n \"score\": \"0.53321576\",\n \"text\": \"def action_done(action)\\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\\n :done_reducing, :finalize => :done_finalizing } \\n self.send dispatch[action[:action]], action\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"97c8901edfddc990da95704a065e87bc\",\n \"score\": \"0.53124547\",\n \"text\": \"def dependencies action, &block\\n @actions.each do |other|\\n if action[:requires].include? other[:provide]\\n block.call other\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4f9a284723e2531f7d19898d6a6aa20c\",\n \"score\": \"0.529654\",\n \"text\": \"def setup!\\n return unless @setup_procs\\n http_actions = actions\\n @setup_procs.each do |setup_proc|\\n proc, actions = setup_proc\\n @setup__actions = actions.map do |action|\\n\\n action.is_a?(Regexp) ?\\n http_actions.select { |a| a.to_s =~ action } :\\n action.is_a?(String) && action =~ /\\\\A\\\\./ ?\\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\\n action\\n\\n end.flatten\\n self.class_exec &proc\\n @setup__actions = nil\\n end\\n @setup_procs = nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"83684438c0a4d20b6ddd4560c7683115\",\n \"score\": \"0.5296262\",\n \"text\": \"def before_actions(*logic)\\n self.before_actions = logic\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"210e0392ceaad5fc0892f1335af7564b\",\n \"score\": \"0.52952296\",\n \"text\": \"def setup_handler\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a997ba805d12c5e7f7c4c286441fee18\",\n \"score\": \"0.52600986\",\n \"text\": \"def set_action(opts)\\n opts = check_params(opts,[:actions])\\n super(opts)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d50ec65c5bee536273da9d756a78d0d\",\n \"score\": \"0.52442724\",\n \"text\": \"def setup(action)\\n @targets.clear\\n unless action.item.target_filters.empty?\\n @targets = SES::TargetManager.make_targets(action)\\n else\\n item = action.item\\n if item.for_opponent?\\n @targets = $game_troop.alive_members\\n elsif item.for_dead_friend?\\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\\n else\\n $game_party.battle_members.select { |actor| actor.alive? }\\n end\\n end\\n @item_max = @targets.size\\n create_contents\\n refresh\\n show\\n activate\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6d7c691bed78fb0eeb9647503f4a244\",\n \"score\": \"0.52385926\",\n \"text\": \"def action; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6d7c691bed78fb0eeb9647503f4a244\",\n \"score\": \"0.52385926\",\n \"text\": \"def action; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6d7c691bed78fb0eeb9647503f4a244\",\n \"score\": \"0.52385926\",\n \"text\": \"def action; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6d7c691bed78fb0eeb9647503f4a244\",\n \"score\": \"0.52385926\",\n \"text\": \"def action; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6d7c691bed78fb0eeb9647503f4a244\",\n \"score\": \"0.52385926\",\n \"text\": \"def action; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"635288ac8dd59f85def0b1984cdafba0\",\n \"score\": \"0.5232394\",\n \"text\": \"def workflow\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e34cc2a25e8f735ccb7ed8361091c83e\",\n \"score\": \"0.523231\",\n \"text\": \"def revisable_shared_setup(args, block)\\n class << self\\n attr_accessor :revisable_options\\n end\\n options = args.extract_options!\\n self.revisable_options = Options.new(options, &block)\\n \\n self.send(:include, Common)\\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\\n self.send(:include, WithoutScope::QuotedColumnConditions)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"78b21be2632f285b0d40b87a65b9df8c\",\n \"score\": \"0.5227454\",\n \"text\": \"def setup\\n @action = SampleActionAndroid.new(os_name: 'android',\\n app_name: APP_PATH)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6350959a62aa797b89a21eacb3200e75\",\n \"score\": \"0.52226824\",\n \"text\": \"def before(action)\\n invoke_callbacks *self.class.send(action).before\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"923ee705f0e7572feb2c1dd3c154b97c\",\n \"score\": \"0.52201617\",\n \"text\": \"def process_action(...)\\n send_action(...)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b89a3908eaa7712bb5706478192b624d\",\n \"score\": \"0.5212327\",\n \"text\": \"def before_dispatch(env); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7115b468ae54de462141d62fc06b4190\",\n \"score\": \"0.52079266\",\n \"text\": \"def after_actions(*logic)\\n self.after_actions = logic\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d89a3e408ab56bf20bfff96c63a238dc\",\n \"score\": \"0.52050185\",\n \"text\": \"def setup\\n # override and do something appropriate\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"62c402f0ea2e892a10469bb6e077fbf2\",\n \"score\": \"0.51754695\",\n \"text\": \"def setup(client)\\n return unless @setup\\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\\n actions.each do |action|\\n action.execute(client)\\n end\\n self\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"72ccb38e1bbd86cef2e17d9d64211e64\",\n \"score\": \"0.51726824\",\n \"text\": \"def setup(_context)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b4f4e1d4dfd31919ab39aecccb9db1d0\",\n \"score\": \"0.51710224\",\n \"text\": \"def setup(resources) ; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1fd817f354d6cb0ff1886ca0a2b6cce4\",\n \"score\": \"0.5166172\",\n \"text\": \"def validate_actions\\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5531df39ee7d732600af111cf1606a35\",\n \"score\": \"0.5159343\",\n \"text\": \"def setup\\n @resource_config = {\\n :callbacks => {\\n :before_create => nil,\\n :after_create => nil,\\n :before_update => nil,\\n :after_update => nil,\\n :before_destroy => nil,\\n :after_destroy => nil,\\n },\\n :child_assoc => nil,\\n :model => nil,\\n :parent => nil,\\n :path => nil,\\n :permission => {},\\n :properties => {},\\n :relation => {\\n :create => nil,\\n :delete => nil,\\n },\\n :roles => nil,\\n }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bb6aed740c15c11ca82f4980fe5a796a\",\n \"score\": \"0.51578903\",\n \"text\": \"def determine_valid_action\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b38f9d83c26fd04e46fe2c961022ff86\",\n \"score\": \"0.51522785\",\n \"text\": \"def process_shared\\n handle_taxes\\n handle_shippings\\n create_adjustments_from_params\\n handle_status\\n handle_inventory_refunds\\n handle_payment_transactions\\n order.updater.update\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"199fce4d90958e1396e72d961cdcd90b\",\n \"score\": \"0.5152022\",\n \"text\": \"def startcompany(action)\\n @done = true\\n action.setup\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"994d9fe4eb9e2fc503d45c919547a327\",\n \"score\": \"0.51518047\",\n \"text\": \"def init_actions\\n am = action_manager()\\n am.add_action(Action.new(\\\"&Disable selection\\\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\\n am.add_action(Action.new(\\\"&Edit Toggle\\\") { @edit_toggle = !@edit_toggle; $status_message.value = \\\"Edit toggle is #{@edit_toggle}\\\" })\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"62fabe9dfa2ec2ff729b5a619afefcf0\",\n \"score\": \"0.51456624\",\n \"text\": \"def event_callbacks(event, metadata={})\\n case event\\n when :reset, :review\\n if confirmed\\n update_attributes(confirmed: false)\\n end\\n when :confirm\\n confirm\\n # trigger :order for all applicable items\\n # NOTE: :order event is common to both physical and digital items\\n items.each do |i|\\n if i.event_permitted(:order)\\n user_id = last_transition.user_id\\n i.trigger!(:order, { order_id: id, user_id: user_id })\\n end\\n end\\n when :complete_work\\n request = metadata[:request]\\n work_complete_notification(request)\\n when :close\\n close\\n end\\n if event != :close && !open\\n reopen\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"faddd70d9fef5c9cd1f0d4e673e408b9\",\n \"score\": \"0.51398855\",\n \"text\": \"def setup_action\\n return unless PONY::ERRNO::check_sequence(current_act)\\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\\n @sequence_index = 0\\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\\n execute_sequence\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"adb8115fce9b2b4cb9efc508a11e5990\",\n \"score\": \"0.5133759\",\n \"text\": \"def define_tasks\\n define_weave_task\\n connect_common_tasks\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e1dd18cf24d77434ec98d1e282420c84\",\n \"score\": \"0.5112076\",\n \"text\": \"def setup(&block)\\n define_method(:setup, &block)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3b4fb29fa45f95d436fd3a8987f12de7\",\n \"score\": \"0.5111866\",\n \"text\": \"def setup\\n transition_to(:setup)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3b4fb29fa45f95d436fd3a8987f12de7\",\n \"score\": \"0.5111866\",\n \"text\": \"def setup\\n transition_to(:setup)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"975ecc8d218b62d480bbe0f6e46e72bb\",\n \"score\": \"0.5110294\",\n \"text\": \"def action\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f54964387b0ee805dbd5ad5c9a699016\",\n \"score\": \"0.5106169\",\n \"text\": \"def setup( *args )\\n\\t\\t\\tself.class.setupBlocks.each {|sblock|\\n\\t\\t\\t\\tdebugMsg \\\"Calling setup block method #{sblock}\\\"\\n\\t\\t\\t\\tself.send( sblock )\\n\\t\\t\\t}\\n\\t\\t\\tsuper( *args )\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"35b302dd857a031b95bc0072e3daa707\",\n \"score\": \"0.509231\",\n \"text\": \"def config(action, *args); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bc3cd61fa2e274f322b0b20e1a73acf8\",\n \"score\": \"0.50873137\",\n \"text\": \"def setup\\n @setup_proc.call(self) if @setup_proc\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5c3cfcbb42097019c3ecd200acaf9e50\",\n \"score\": \"0.5081088\",\n \"text\": \"def before_action \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"246840a409eb28800dc32d6f24cb1c5e\",\n \"score\": \"0.508059\",\n \"text\": \"def setup_callbacks\\n defined_callbacks.each do |meth|\\n unless respond_to?(\\\"call_#{meth}_callbacks\\\".to_sym)\\n self.class.module_eval <<-EOE\\n def call_#{meth}_callbacks(*args)\\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\\n self.send :#{meth}, *args if respond_to?(:#{meth})\\n end\\n EOE\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dfbcf4e73466003f1d1275cdf58a926a\",\n \"score\": \"0.50677156\",\n \"text\": \"def action\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36eb407a529f3fc2d8a54b5e7e9f3e50\",\n \"score\": \"0.50562143\",\n \"text\": \"def matt_custom_action_begin(label); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b6c9787acd00c1b97aeb6e797a363364\",\n \"score\": \"0.5050554\",\n \"text\": \"def setup\\n # override this if needed\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9fc229b5b48edba9a4842a503057d89a\",\n \"score\": \"0.50474834\",\n \"text\": \"def setup\\n\\t\\t\\t\\t\\t\\t# Do nothing\\n\\t\\t\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9fc229b5b48edba9a4842a503057d89a\",\n \"score\": \"0.50474834\",\n \"text\": \"def setup\\n\\t\\t\\t\\t\\t\\t# Do nothing\\n\\t\\t\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fd421350722a26f18a7aae4f5aa1fc59\",\n \"score\": \"0.5036181\",\n \"text\": \"def action(options,&callback)\\n new_action = Action===options ? options : Action.new(options,&callback)\\n # replace any with (shared name/alias or both default) + same arity\\n @actions.delete_if do |existing_action|\\n ((existing_action.names & new_action.names).size > 0 ||\\n existing_action.default? && new_action.default?) &&\\n existing_action.required.size == new_action.required.size &&\\n existing_action.optional.size <= new_action.optional.size\\n end\\n @actions = (@actions + [new_action]).sort\\n new_action\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d02030204e482cbe2a63268b94400e71\",\n \"score\": \"0.5026331\",\n \"text\": \"def set_target_and_action target, action\\n self.target = target\\n self.action = 'sugarcube_handle_action:'\\n @sugarcube_action = action\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4224d3231c27bf31ffc4ed81839f8315\",\n \"score\": \"0.5022976\",\n \"text\": \"def after(action)\\n invoke_callbacks *options_for(action).after\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"24506e3666fd6ff7c432e2c2c778d8d1\",\n \"score\": \"0.5015441\",\n \"text\": \"def pre_task\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0c16dc5c1875787dacf8dc3c0f871c53\",\n \"score\": \"0.50121695\",\n \"text\": \"def setup(server)\\n server.on('beforeMethod', method(:before_method), 10)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c99a12c5761b742ccb9c51c0e99ca58a\",\n \"score\": \"0.5000944\",\n \"text\": \"def add_actions\\n attribute = machine.attribute\\n name = self.name\\n \\n owner_class.class_eval do\\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\\n define_method(\\\"#{name}!\\\") {self.class.state_machines[attribute].events[name].fire!(self)}\\n define_method(\\\"can_#{name}?\\\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0cff1d3b3041b56ce3773d6a8d6113f2\",\n \"score\": \"0.5000019\",\n \"text\": \"def init_actions\\n @select_action = SelectAction.new\\n @endpoint_mouse_action = EndpointMouseAction.new\\n @move_action = MoveAction.new\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"791f958815c2b2ac16a8ca749a7a822e\",\n \"score\": \"0.4996878\",\n \"text\": \"def setup_signals; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6e44984b54e36973a8d7530d51a17b90\",\n \"score\": \"0.4989888\",\n \"text\": \"def after_created\\r\\n return unless compile_time\\r\\n Array(action).each do |action|\\r\\n run_action(action)\\r\\n end\\r\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6e44984b54e36973a8d7530d51a17b90\",\n \"score\": \"0.4989888\",\n \"text\": \"def after_created\\r\\n return unless compile_time\\r\\n Array(action).each do |action|\\r\\n run_action(action)\\r\\n end\\r\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5aa51b20183964c6b6f46d150b0ddd79\",\n \"score\": \"0.49864885\",\n \"text\": \"def set_target_and_action target, action\\n self.target = target\\n self.action = 'sugarcube_handle_action:'\\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7647b99591d6d687d05b46dc027fbf23\",\n \"score\": \"0.49797225\",\n \"text\": \"def initialize(*args)\\n super\\n @action = :set\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"67e7767ce756766f7c807b9eaa85b98a\",\n \"score\": \"0.49785787\",\n \"text\": \"def after_set_callback; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2a2b0a113a73bf29d5eeeda0443796ec\",\n \"score\": \"0.4976161\",\n \"text\": \"def setup\\n #implement in subclass;\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"63e628f34f3ff34de8679fb7307c171c\",\n \"score\": \"0.49683493\",\n \"text\": \"def lookup_action; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a5294693c12090c7b374cfa0cabbcf95\",\n \"score\": \"0.4965126\",\n \"text\": \"def setup &block\\n if block_given?\\n @setup = block\\n else\\n @setup.call\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"57dbfad5e2a0e32466bd9eb0836da323\",\n \"score\": \"0.4958034\",\n \"text\": \"def setup_action\\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\\n actions = TSBS::AnimLoop[@acts[1]]\\n if actions.nil?\\n show_action_error(@acts[1])\\n end\\n @sequence_stack.push(@acts[1])\\n @used_sequence = @acts[1]\\n actions.each do |acts|\\n @acts = acts\\n execute_sequence\\n break if @break_action\\n end\\n @sequence_stack.pop\\n @used_sequence = @sequence_stack[-1]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5b6d613e86d3d68152f7fa047d38dabb\",\n \"score\": \"0.49559742\",\n \"text\": \"def release_actions; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4aceccac5b1bcf7d22c049693b05f81c\",\n \"score\": \"0.4954353\",\n \"text\": \"def around_hooks; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2318410efffb4fe5fcb97970a8700618\",\n \"score\": \"0.49535993\",\n \"text\": \"def save_action; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"64e0f1bb6561b13b482a3cc8c532cc37\",\n \"score\": \"0.4952725\",\n \"text\": \"def setup(easy)\\n super\\n easy.customrequest = @verb\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fbd0db2e787e754fdc383687a476d7ec\",\n \"score\": \"0.49467874\",\n \"text\": \"def action_target()\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b280d59db403306d7c0f575abb19a50f\",\n \"score\": \"0.49423352\",\n \"text\": \"def setup\\n callback(:setup) do\\n notify(:setup)\\n migration_check.last_deployed_commit\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9f7547d93941fc2fcc7608fdf0911643\",\n \"score\": \"0.49325448\",\n \"text\": \"def setup\\n return unless @setup\\n\\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\\n run_actions_and_retry(actions)\\n self\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"da88436fe6470a2da723e0a1b09a0e80\",\n \"score\": \"0.49282882\",\n \"text\": \"def before_setup\\n # do nothing by default\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"17ffe00a5b6f44f2f2ce5623ac3a28cd\",\n \"score\": \"0.49269363\",\n \"text\": \"def my_actions(options)\\n @setup = false\\n get_template_part(\\\"custom_used\\\",\\\"action_users\\\",true)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"21d75f9f5765eb3eb36fcd6dc6dc2ec3\",\n \"score\": \"0.49269104\",\n \"text\": \"def default_action; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3ba85f3cb794f951b05d5907f91bd8ad\",\n \"score\": \"0.49252945\",\n \"text\": \"def setup(&blk)\\n @setup_block = blk\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"80834fa3e08bdd7312fbc13c80f89d43\",\n \"score\": \"0.4923091\",\n \"text\": \"def callback_phase\\n super\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1da8d654daa2cd41cb51abc7ee7898f\",\n \"score\": \"0.49194667\",\n \"text\": \"def advice\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"99a608ac5478592e9163d99652038e13\",\n \"score\": \"0.49174926\",\n \"text\": \"def _handle_action_missing(*args); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9e264985e628b89f1f39d574fdd7b881\",\n \"score\": \"0.49173003\",\n \"text\": \"def duas1(action)\\n action.call\\n action.call\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"399ad686f5f38385ff4783b91259dbd7\",\n \"score\": \"0.49171105\",\n \"text\": \"def shared_action(name, &block)\\n @controller.shared_actions[name] = block\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0dccebcb0ecbb1c4dcbdddd4fb11bd8a\",\n \"score\": \"0.4915879\",\n \"text\": \"def before_action action, &block\\n @audience[:before][action] ||= Set.new\\n @audience[:before][action] << block\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6e0842ade69d031131bf72e9d2a8c389\",\n \"score\": \"0.49155936\",\n \"text\": \"def setup_initial_state\\n\\n state_a = State.new(\\\"a\\\", 0)\\n state_b = State.new(\\\"b\\\", 0)\\n state_c = State.new(\\\"c\\\", 10)\\n\\n move_to_b = Action.new(\\\"move_to_b\\\", 1, state_b)\\n\\n move_to_c = Action.new(\\\"move_to_c\\\", 1, state_c)\\n\\n state_a.actions = [move_to_b, move_to_c]\\n\\n return state_a\\n \\nend\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":186,"cells":{"query_id":{"kind":"string","value":"67277383d671ce32f9f5604b833692fa"},"query":{"kind":"string","value":"this method is called from groups_assign using delayed_job therefore this gets executed in background this assigns the groups to the package"},"positive_passages":{"kind":"list like","value":[{"docid":"c241f7b3e1600bebd2ed3424f20b34fc","score":"0.578942","text":"def calculate_delayed_group_learners(groups_to_be_assigned,current_user_id,package_id)\n current_user = User.find(current_user_id)\n package = Package.find(package_id)\n groups_to_be_assigned.each { |g|\n #get all learners who belong to current group 'g'\n learners_for_package_adding = current_user.user.find(:all,:conditions => [\"group_id = ? AND deactivated_at IS NULL\",g])\n save_and_send_mails(learners_for_package_adding,current_user,package)\n }\n end","title":""}],"string":"[\n {\n \"docid\": \"c241f7b3e1600bebd2ed3424f20b34fc\",\n \"score\": \"0.578942\",\n \"text\": \"def calculate_delayed_group_learners(groups_to_be_assigned,current_user_id,package_id)\\n current_user = User.find(current_user_id)\\n package = Package.find(package_id)\\n groups_to_be_assigned.each { |g|\\n #get all learners who belong to current group 'g'\\n learners_for_package_adding = current_user.user.find(:all,:conditions => [\\\"group_id = ? AND deactivated_at IS NULL\\\",g])\\n save_and_send_mails(learners_for_package_adding,current_user,package)\\n }\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"3e6c8c9e9c9a9bb0e0553c0a5823cad8","score":"0.77831966","text":"def groups_assign(groups_to_be_assigned,package)\n groups_delayed = Array.new\n groups_to_be_assigned.each { |g|\n groups_delayed << g[0].to_i\n }\n current_user_id = current_user.id\n #call calculate_delayed_group_learners method using delayedjob\n package_obj = PackagesController.new\n package_obj.delay.calculate_delayed_group_learners(groups_delayed,current_user_id,package.id)\n end","title":""},{"docid":"2de3f255ea1d881d22a3420fa2db38e8","score":"0.6728565","text":"def assign_group\n if self.id == 1\n self.group_id = 1\n end\n end","title":""},{"docid":"0f396cc926ed53c30977f5311a0a6b2d","score":"0.67261016","text":"def manage_groups\n unless params[:group].nil?\n package = Package.find(params[:id])\n groups_to_be_assigned = params[:group]\n groups_assign(groups_to_be_assigned,package)\n flash[:wait_feedback] = \"The learners are being assigned. The process will take some time. Please check later for the updated learner count.\"\n end\n redirect_to(\"/courses\")\n end","title":""},{"docid":"e6d1d27d6df99bcda125c9848a0b73ff","score":"0.6713749","text":"def groups_assign(groups_to_be_assigned,assessment)\n groups_delayed = Array.new\n groups_to_be_assigned.each { |g|\n groups_delayed << g[0].to_i\n }\n assessment_id = assessment.id\n current_user_id = current_user.id\n \n #call calculate_delayed_group_learners method using delayedjob\n assessment_obj = AssessmentsController.new\n assessment_obj.delay.calculate_delayed_group_learners(groups_delayed,current_user_id,assessment_id)\n end","title":""},{"docid":"c0e7a84c075b3e850a0fa7070e7d27fb","score":"0.64841807","text":"def groups_assign(groups_to_be_assigned,course)\n groups_delayed = Array.new\n groups_to_be_assigned.each { |g|\n groups_delayed << g[0].to_i\n }\n course_id = course.id\n current_user_id = current_user.id\n\n course_obj = CoursesController.new\n course_obj.delay.calculate_delayed_group_learners(groups_delayed,current_user_id,course_id)\n# delayed_id = Delayed::Job.enqueue(AssigningJob.new(groups_delayed,current_user_id,course_id,\"assign_to_course\"))\n\n# groups_to_be_assigned.each { |g|\n#\n# learners_for_course_adding = Array.new\n# learners_valid_for_signup = Array.new\n#\n# learners_for_course_adding = current_user.user.find(:all,:conditions => [\"group_id = ? AND crypted_password IS NOT NULL AND deactivated_at IS NULL\",g[0].to_i])\n# learners_valid_for_signup = current_user.user.find(:all,:conditions => [\"group_id = ? AND crypted_password IS NULL AND deactivated_at IS NULL\",g[0].to_i])\n#\n# Delayed::Job.enqueue(AssigningJob.new(learners_for_course_adding,learners_valid_for_signup,current_user,course.id,\"assign_to_course\"))\n# }\n end","title":""},{"docid":"a9e7c983a0b76ce8213150b55c1bc41a","score":"0.62658715","text":"def assignPackage\n while (@packagesQueue.length != 0)\n package = @packagesQueue.shift\n # remove and return our first drone from the queue\n drone = @dronesQueue.shift\n @canLeaveDepoAt = intToTime(drone[\"nextPackageTime\"] + Time.now.to_f)\n if (package[\"departBy\"] > @canLeaveDepoAt)\n SOLUTION[\"assignments\"].push({\n \t\t\t\t\t\tdroneId: drone[\"droneId\"],\n \t\t\t\t\t\tpackageId: package[\"packageId\"]\n \t\t\t\t\t})\n else\n SOLUTION[\"unassignedPackageIds\"].push(package[\"packageId\"])\n end\n end\n end","title":""},{"docid":"062c47d72e1ba2f8a0702f4363ab9ce3","score":"0.622334","text":"def set_package_group\n @package_group = PackageGroup.find(params[:id])\n end","title":""},{"docid":"28cf588e65fef9ca02bab20d7eac5249","score":"0.6197384","text":"def set_group\n if (!self.job_source.nil? && !self.job_source.group.nil?)\n self.group = self.job_source.group\n end\n end","title":""},{"docid":"8cfe81d79de18e8be6081f56a397a966","score":"0.61727124","text":"def tickle_task_groups\n\t\tself.task_groups.each do |task_class, group|\n\t\t\tnew_pids = group.adjust_workers or next\n\t\t\tnew_pids.each do |pid|\n\t\t\t\tself.task_pids[ pid ] = group\n\t\t\tend\n\t\tend\n\tend","title":""},{"docid":"c45bcebc236517f0f158db36c640eda7","score":"0.6146493","text":"def create_group(group_name,group_uuid,classes = {},rule_term,parent_group)\n load_classifier\n groups = @classifier.groups\n @classifier.update_classes.update\n current_group = groups.get_groups.select { |group| group['name'] == group_name}\n if current_group.empty?\n cputs \"Creating #{group_name} group in classifier\"\n groups.create_group({\n 'name' => group_name,\n 'id' => group_uuid,\n 'classes' => classes,\n 'parent' => groups.get_group_id(\"#{parent_group}\"),\n 'rule' => rule_term\n })\n else\n cputs \"NODE GROUP #{group_name} ALREADY EXISTS!!! Skipping\"\n end\nend","title":""},{"docid":"61b931772de9e7c8f226d414fe245258","score":"0.6135778","text":"def create_group(group_name,group_uuid,classes = {},rule_term,parent_group)\n load_classifier\n @classifier.update_classes.update\n groups = @classifier.groups\n current_group = groups.get_groups.select { |group| group['name'] == group_name}\n if current_group.empty?\n cputs \"Creating #{group_name} group in classifier\"\n groups.create_group({\n 'name' => group_name,\n 'id' => group_uuid,\n 'classes' => classes,\n 'parent' => groups.get_group_id(\"#{parent_group}\"),\n 'rule' => rule_term\n })\n else\n cputs \"NODE GROUP #{group_name} ALREADY EXISTS!!! Skipping\"\n end\nend","title":""},{"docid":"3d64546f1014bcb3b1dab0d65cbbc1e7","score":"0.612526","text":"def assign_task_group\n unless self.task_group\n self.task_group = Digest::SHA1.hexdigest(Time.now.to_f.to_s)\n end\n end","title":""},{"docid":"7638fdf20cd82a1ea3e0556be80233c3","score":"0.6108412","text":"def assigned_by_group=(value)\n @assigned_by_group = value\n end","title":""},{"docid":"76586ad08c3ab780bc4542521cb294c5","score":"0.6088305","text":"def set_groups grps\n @groups=grps\n end","title":""},{"docid":"1db0b6d09a19232d6be372f4adde2e99","score":"0.60517603","text":"def startgroup\n @group = Group.new\nend","title":""},{"docid":"7e2f391ea93e60030b1c9f0b9c064c77","score":"0.60257137","text":"def clone_local_item_groups\n\t\t## there can be n such groups.\n\t\tself.quantity_received.to_i.times do \n\t\t\tlocal_item_group = Inventory::ItemGroup.new(self.supplier_item_group.attributes.except(:id,:barcode,:owner_ids,:currently_held_by_organization,:name))\n\t\t\t## this should ideally be working.\n\t\t\tlocal_item_group.created_by_user = self.created_by_user\n\t\t\tlocal_item_group.cloned_from_item_group_id = self.supplier_item_group.id.to_s\n\t\t\tlocal_item_group.transaction_id = self.id.to_s\n\t\t\t#local_item_group.assign_id_from_name\n\t\t\tbegin\n\t\t\t\t## here do that save thingy.\n\t\t\t\tif Rails.env.test? || Rails.env.development?\n\t\t\t\t\tif ENV[\"CREATE_UNIQUE_RECORDS\"].blank?\n\t\t\t\t\t\tlocal_item_group.save(op_type: \"create\")\n\t\t\t\t\telsif ENV[\"CREATE_UNIQUE_RECORDS\"] == \"no\"\n\t\t\t\t\t\tlocal_item_group.save\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tlocal_item_group.save(op_type: \"create\")\n\t\t\t\tend\n\t\t\t\t#puts \"the local item group was created.\"\n\t\t\t\t#puts \"the errors are:\"\n\t\t\t\t#puts local_item_group.errors.full_messages\n\t\t\t\t#puts \"its id is\"\n\t\t\t\t#puts local_item_group.id.to_s\n\t\t\t\t#puts \"the created by user email is:\"\n\t\t\t\t#puts self.created_by_user.email.to_s\n\t\t\t\t#puts \"-------------------------------\"\n\t\t\t\tunless local_item_group.errors.blank?\n\t\t\t\t\tself.errors.add(:local_item_groups, local_item_group.errors.full_messages.to_s)\n\t\t\t\tend\n\t\t\trescue => e\n\t\t\t\tputs e.to_s\n\t\t\t\tself.errors.add(:local_item_groups, \"someone else tried to create an item group at the same time on your organization\")\n\t\t\tend\n\t\tend\n\tend","title":""},{"docid":"7935877e02162ec15b6195f09381e8da","score":"0.599412","text":"def set_group\n if (self.organization.to_s.length > 0)\n group = Group.find_or_create_by_name(self.organization.to_s)\n self.groups << group\n end\n end","title":""},{"docid":"939d569aad0be180bbb775c3215d61ef","score":"0.5949841","text":"def assign_group(g, n)\n\t\tEvent.where(:name => n).each do |e|\n\t\t\te.update_attributes(:eventgroup_id => g)\n\t\tend\n\tend","title":""},{"docid":"29e4709122a06ad3ff1cf038dac23d61","score":"0.59449565","text":"def set_group\n @group = Group.find_by_channel_key(params[:channel_key])\n end","title":""},{"docid":"d1801f99bfeb8fc89567d7e41606af6a","score":"0.5941732","text":"def set_groups\n @groups = Group.all\n end","title":""},{"docid":"3253042dead58be36c904653acf1a489","score":"0.59350747","text":"def perform(group, groups)\n\n puts \"Iniciando mescla de grupos\"\n\n user = group.user\n\n groups.each do |g|\n\n if user.groups.exists?(g)\n group_copy = user.groups.find g\n group.contacts << group_copy.contacts\n end\n\n end\n\n Pusher[group.user_id.to_s].trigger('merge_groups_done', {:status => 'success', :message => \"Contatos de vários grupos foram copiados para o grupo #{group.name} com sucesso!\"})\n\n puts \"Mescla de grupos concluida!\"\n\n end","title":""},{"docid":"b04494c86e22b141d584ebd4ac9f5095","score":"0.5925364","text":"def create_pack_groups\n\n query = \"select distinct color_percentage,grade_code from carton_setups where\n production_schedule_code = '#{self.production_schedule_name}'\"\n\n carton_setup_groups = self.connection.select_all(query)\n\n rebin_setup_groups = RebinSetup.find_by_sql(\"select distinct color_percentage,grade_code from rebin_setups where\n production_schedule_code = '#{self.production_schedule_name}'and standard_size_count_from > -1\")\n group_number = 0\n\n group_list = Array.new\n\n pack_groups = Array.new\n carton_setup_groups.each do |carton_setup_group|\n pack_group = PackGroup.new\n group_number += 1\n #find a 'real' carton setup- we need some info. Although carton setup group is\n #an instance of carton setup, the 'distinc' query disallowed the retrieval of all attributes\n carton_setup = CartonSetup.find(:first, :conditions => \"color_percentage =\\'#{carton_setup_group['color_percentage']}\\'\n and grade_code = '#{carton_setup_group['grade_code']}\\' and production_schedule_code = '#{self.production_schedule_name}'\")\n\n pack_group.pack_group_number = group_number\n pack_group.commodity_code = carton_setup.retail_item_setup.item_pack_product.commodity_code\n pack_group.marketing_variety_code = carton_setup.marketing_variety_code\n pack_group.color_sort_percentage = carton_setup.color_percentage\n pack_group.grade_code = carton_setup.grade_code\n pack_group.production_run_number = self.production_run_number\n pack_group.production_schedule_name = self.production_schedule_name\n pack_group.production_run = self\n pack_group.create\n group_list.push pack_group\n #self.pack_groups.push(pack_group)\n\n end\n\n #---------------------------------------------------------------------------------------------------\n #See if the rebin_groups contain a group (color,grade combo) not found in the groups we already have\n #If not create a new group and add it\n #---------------------------------------------------------------------------------------------------\n\n rebin_setup_groups.each do |rebin_group|\n if !(rebin_group.color_percentage == -1 && !rebin_group.grade_code)&& !group_list.find { |p| p.color_sort_percentage == rebin_group.color_percentage && p.grade_code == rebin_group.grade_code }\n #missing roup, add new one\n pack_group = PackGroup.new\n group_number += 1\n #find a 'real' rebin setup- we need some info. Although rebin setup group is\n #an instance of rebin setup, the 'distinc' query disallowed the retrieval of all attributes\n rebin_setup = nil\n if rebin_group.grade_code\n rebin_setup = RebinSetup.find(:first, :conditions => [\"color_percentage = ? and grade_code = ? and production_schedule_code = ?\", rebin_group.color_percentage, rebin_group.grade_code, self.production_schedule_name])\n else\n rebin_setup = RebinSetup.find(:first, :conditions => [\"color_percentage = ? and grade_code is null and production_schedule_code = ?\", rebin_group.color_percentage, self.production_schedule_name])\n end\n\n pack_group.pack_group_number = group_number\n pack_group.commodity_code = rebin_setup.rmt_product.commodity_code\n pack_group.marketing_variety_code = rebin_setup.variety_output_description\n pack_group.color_sort_percentage = rebin_setup.color_percentage\n pack_group.grade_code = rebin_setup.grade_code\n pack_group.production_run_number = self.production_run_number\n pack_group.production_schedule_name = self.production_schedule_name\n pack_group.production_run = self\n pack_group.create\n self.pack_groups.push(pack_group)\n\n end\n end\n\n\n end","title":""},{"docid":"2ba5b7f1f108cdbc99384ea860ce2ad2","score":"0.59186846","text":"def set_group\n @current_resource.group(current_group)\n end","title":""},{"docid":"95f9a00d79cc04c40ea74dcd480a1c1a","score":"0.5897735","text":"def set_groups\n\t\t\t@groups = @intranet.groups\n\t\tend","title":""},{"docid":"09d5252528eab69e9575a049c2174529","score":"0.5889466","text":"def manage_groups\n unless params[:group].nil?\n assessment = Assessment.find(params[:id])\n groups_to_be_assigned = params[:group]\n groups_assign(groups_to_be_assigned,assessment)\n flash[:wait_feedback] = \"The learners are being assigned. The process will take some time. Please check later for the updated learner count.\"\n end\n redirect_to(\"/courses\")\n end","title":""},{"docid":"057b68e40bb989e990ce8cd371a3012e","score":"0.58777833","text":"def setup_groups\n @groups = [Group.new(:default)]\n end","title":""},{"docid":"09947dbdf12c02815e9f95f932283e7d","score":"0.5872202","text":"def update_groups\n\n # get nearby clients\n\n relevant_envs = self.nearby\n\n # all clients in the same group as a nearby client\n\n @grouped_envs = relevant_envs.inject([]) do |result, element|\n element.all_in_group.each do |group_env|\n unless result.include?( group_env )\n result << group_env\n end\n end\n result\n end\n\n # create new group id and assign to all clients in the new group\n\n new_group_id = rand(Time.now.to_i)\n\n group_uuids = @grouped_envs.map { |e| e.client_uuid }\n puts \"creating new group with id #{new_group_id} and clients #{group_uuids.inspect}\"\n\n ( @grouped_envs | relevant_envs ).each do |foobar|\n foobar[:group_id] = new_group_id\n foobar.save\n end\n\n reload\n end","title":""},{"docid":"5ac2deb8a4a4930bb9a6a06a37643091","score":"0.5870561","text":"def update!(**args)\n @groups = args[:groups] if args.key?(:groups)\n end","title":""},{"docid":"5ac2deb8a4a4930bb9a6a06a37643091","score":"0.5870561","text":"def update!(**args)\n @groups = args[:groups] if args.key?(:groups)\n end","title":""},{"docid":"ad5e9f8d12c9f83f0d44e5d77e827547","score":"0.5847695","text":"def create\n @group = Group.new(group_params)\n @group.user_id = current_user.id #store the information of the user who created this group/project\n\n respond_to do |format|\n if @group.save\n Log.create! description: \"#{current_user.email} created project #{@group.name} at #{@group.created_at.strftime '%d-%m-%Y %H:%M:%S'}\",\n role_id: current_user.roles.ids.first\n\n\n ug = UserGroup.create! user_id: @group.upload_user.id, group_id: @group.id\n Log.create! description: \"#{current_user.email} added user #{@group.upload_user.email} to group #{@group.name} at #{ug.created_at.strftime '%d-%m-%Y %H:%M:%S'}\",\n role_id: current_user.roles.ids.first\n\n # => notify to the upload user about their assignment to this group (mail and sms)\n\n UserNotifierMailer.delay(queue: \"upload user added to project\").added_to_project(@group.upload_user, @group)\n # => send sms after adding user to the project\n if @group.upload_user.mobile\n send_sms(@group.upload_user.mobile, \"#{@group.upload_user.roles.last.name}, You have been added to project - #{@group.name}\")\n end\n\n format.html { redirect_to admin_groups_path, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"7be07c9c9d35950398a7e52934df94b7","score":"0.58473074","text":"def set_urls_group\n if (!self.id.nil? && !self.group_id.nil?)\n Url.update_all(\"group_id = \" + self.group_id.to_s, [ \"job_id = ?\", self.id.to_s ])\n end\n end","title":""},{"docid":"91d87d702c4b443a9f20fedf033aab14","score":"0.5797372","text":"def process_task_group(group)\n @tasks_xml[group] = []\n end","title":""},{"docid":"e7c5e56fbcad7cecbac121324b03b884","score":"0.57956547","text":"def fetch_event_groups\n Delayed::Job.enqueue EventGroupsFetcher.new(sw_id), priority: 10, queue: 'event_groups'\n end","title":""},{"docid":"fb733b22358050df21c381731b8d6114","score":"0.57803565","text":"def groups_id=(groups)\n groups.each do |group|\n group_instance = Group.find(group)\n if !self.groups.include?(group_instance)\n group_instance.tasks << self \n end\n end\n end","title":""},{"docid":"3f3b7a52a53cc6e7febad8fa1f646f0d","score":"0.575204","text":"def sync_group_name\n super\n end","title":""},{"docid":"d46bbc4f648ea747bea405de6742f5d3","score":"0.5747387","text":"def prepare_worker_groups(groups)\n groups.each do |name, options|\n @worker_groups[name] = WorkerGroup.new(\n name, options.merge(manager: self))\n end\n end","title":""},{"docid":"d38ec223fce6011edee1c33ea08cf327","score":"0.5740771","text":"def create\n @group = current_user.mygroups.new(group_params)\n\n respond_to do |format|\n if @group.save\n current_user.groups << @group\n\n # Added as part of activity feed\n @group.create_activity :create, owner: current_user\n \n format.html { redirect_to group_path(@group), notice: 'Group was successfully created.' }\n format.json { render action: 'show', status: :created, location: group_path(@group) }\n else\n format.html { render action: 'new' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"455d5809194afdeefd71e44189a270ee","score":"0.57378703","text":"def assign_group(ids, group_id)\n where(:_id.in => ids).each do |q|\n if q.group_id != group_id\n q.group_id = group_id\n q.sort_order = nil\n end\n end\n return nil\n end","title":""},{"docid":"455d5809194afdeefd71e44189a270ee","score":"0.57378703","text":"def assign_group(ids, group_id)\n where(:_id.in => ids).each do |q|\n if q.group_id != group_id\n q.group_id = group_id\n q.sort_order = nil\n end\n end\n return nil\n end","title":""},{"docid":"32e5ce981801a7fffd185c500591bef2","score":"0.57364315","text":"def assign_users_to_group(group_users)\n group = Group.new\n group.users_number = 3\n group.round_id = 0\n group.betray_penalty = [0, 10, 20].shuffle![0]\n # group.betray_penalty = 0\n if (!group.save)\n puts \"***** group save error *****\"*100\n end\n\n group_users.each do |u|\n u.round_id = 0\n u.group_id = group.id\n if (!u.save)\n puts \"**** user save error *****\"*100\n end\n end\n group\n end","title":""},{"docid":"3ca4537635ed90a2eb2ec8faf35933b1","score":"0.5722673","text":"def install\n execute([command(:cmd), \"-y\", \"groupinstall\", @resource[:name]])\n end","title":""},{"docid":"d7ab2828b3137c1873caadb0737a19e1","score":"0.5717096","text":"def save\n if group.id\n update\n true\n else\n raise \"New #{self.class} are created when a new Fog::Rackspace::AutoScale::Group is created\"\n end\n end","title":""},{"docid":"d7ab2828b3137c1873caadb0737a19e1","score":"0.5717096","text":"def save\n if group.id\n update\n true\n else\n raise \"New #{self.class} are created when a new Fog::Rackspace::AutoScale::Group is created\"\n end\n end","title":""},{"docid":"68f1eb5576378a28877f82c9ab4ff800","score":"0.57124484","text":"def launch!\n @vmgroups.each{|name, group|\n @tg_groups.add(Thread.new {\n Thread.current.abort_on_exception = true\n group.monitor\n })\n }\n\n until @vmgroups.all?{|(n,g)| g.triggered_events.include?(:ready)}\n sleep 5\n end\n\n logger.info \"#{banner}All groups are now READY: #{groups.inspect}.\"\n\n trigger :ready\n ThreadsWait.all_waits(*@tg_groups.list) do |t|\n # http://apidock.com/ruby/Thread/status\n if t.status.nil? || t.status == \"aborting\" || t[:ko]\n trigger :error\n end\n end\n end","title":""},{"docid":"12f05f35ee925733d3eb81d7f2d622af","score":"0.5712329","text":"def create_task_groups\n\t\told_task_groups = @task_groups || {}\n\t\t@task_groups = {}\n\n\t\tself.log.debug \"Managing task groups: %p\" % [ old_task_groups ]\n\n\t\tSymphony.load_configured_tasks.each do |task_class, max|\n\t\t\t# If the task is still configured, restart all of its workers\n\t\t\tif group = old_task_groups.delete( task_class )\n\t\t\t\tself.log.info \"%p still configured; restarting its task group.\" % [ task_class ]\n\t\t\t\tself.restart_task_group( group, task_class, max )\n\t\t\t\t@task_groups[ task_class ] = group\n\n\t\t\t# If it's new, just start it up\n\t\t\telse\n\t\t\t\tself.log.info \"Starting up new task group for %p\" % [ task_class ]\n\t\t\t\t@task_groups[ task_class ] = self.start_task_group( task_class, max )\n\t\t\tend\n\t\tend\n\n\t\t# Any task classes remaining are no longer configured, so stop them.\n\t\told_task_groups.each do |task_class, group|\n\t\t\tself.log.info \"%p no longer configured; stopping its task group.\" % [ task_class ]\n\t\t\tself.stop_task_group( group )\n\t\tend\n\tend","title":""},{"docid":"be9eadf859f65f1bd3b97ef8e25684fe","score":"0.57035446","text":"def internal_group=(group)\n @group = group\n end","title":""},{"docid":"736421ce8d9fa734e78780000f591af5","score":"0.56935596","text":"def created()\n self.update(@@group)\n end","title":""},{"docid":"4e59e48c43795a229e7f85932ba5aec7","score":"0.5687455","text":"def set_group\n @group = Group.find(params[:group_id])\n end","title":""},{"docid":"4e59e48c43795a229e7f85932ba5aec7","score":"0.5687455","text":"def set_group\n @group = Group.find(params[:group_id])\n end","title":""},{"docid":"05f5e6800a29be1580031897f73c6588","score":"0.56850916","text":"def set_group_assignment\n @group_assignment = GroupAssignment.find(params[:id])\n end","title":""},{"docid":"dbb3f6ee9d5e6e19f8447de8382ac17e","score":"0.5675733","text":"def set_group\n\t\t\t@group = Group.find(params[:id])\n\t\tend","title":""},{"docid":"dbb3f6ee9d5e6e19f8447de8382ac17e","score":"0.5675733","text":"def set_group\n\t\t\t@group = Group.find(params[:id])\n\t\tend","title":""},{"docid":"28ac17ded0f18a28b91d751ed19ee139","score":"0.5673522","text":"def set_group\n @group = Group.friendly.find(params[:id])\n end","title":""},{"docid":"2f5e83abfca694a7247c5f726763db56","score":"0.56721836","text":"def set_group\n @group = current_store.groups.find(params[:id])\n end","title":""},{"docid":"4a3b6b0ca5759c38fee7d2aa8bfe98b8","score":"0.5670845","text":"def create\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n\t current_user.groups << @group\n\t current_user.save\n\t send_group_announcement(@group)\n format.html { redirect_to(@group, :notice => 'Group was successfully created.') }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"396e64efd98888ce7d613ca6eb020222","score":"0.5668184","text":"def configure_group(group); end","title":""},{"docid":"4429bc10c4020605129f25e6144b074d","score":"0.56628954","text":"def reassign_packages\n Package.all.each do |package|\n original_branch = package.package_branch\n if original_branch.unit.blank?\n log.info \"Migrating #{package.to_s(:pretty_with_version)}'s package branch...\"\n\n new_branch = retrieve_unit_scoped_branch(original_branch, package.unit, PackageCategory.where(:id => package.package_category_id).first)\n package.package_branch = new_branch\n package.save!\n \n log.info \"ok\"\n end\n end\n end","title":""},{"docid":"5992fab3c28a6f9f0647e985b458882d","score":"0.5658907","text":"def set_group \n @group = Group.find(params[:group])\n \n end","title":""},{"docid":"ac98d6540daab11839545a935da7eab4","score":"0.56576246","text":"def set_group\n @group = Group.find(params[:group_id]) \n end","title":""},{"docid":"8a45d3d8b2dd7a4aefe824425b1b4a5e","score":"0.5656232","text":"def set_group\n\t\t @group = Group.find(params[:id])\n\t\tend","title":""},{"docid":"91e838d26f355d4715c655485eeb8377","score":"0.5652443","text":"def create\n\t\t\n\t\t@group = Group.new(group_params)\n\t\t\n\t\t@group.users << current_user\n\t\t@group.leaders = [current_user.id.to_s]\n\t\t#The created group email should be \"group-name + group-id\", this will prevent people making groups of the same name\n\t\t# with matching emails. Also this makes it so we don't have to return a \"this group already exists\" error, which would\n\t\t# allow people to infer the name of groups on the system\n\t\t#We must save first to get an id generated however\n\t\tputs \"DEBUG===============\"\n\t\tgname = @group.group_name.gsub(/\\s/, \"\")\n\t\tputs gname\n\t\tputs \"====================\"\n\t\tif gname =~ /^[a-zA-Z0-9]+$/\n\t\t\t@group.save\n\t\t\t\n\t\t\t@group.email = gname + \"+\" + @group.id + $Domain\n\t\t\tputs \"DEBUG======2========\"\n\t\t\tputs @group.email\n\t\t\tputs \"====================\"\n\t\t\t# Passphrase for pgp keys is bull-s*** right now, may change later\n\t\t\tKeyGenerator::generatePGPkeyGPGme(@group.group_name, @group.email, \"asldkfjlksdjf\")\n\n\t\t\tcurrent_user.save\n\n\t\t\t\n\t\t\trespond_to do |format|\n\t\t\t\tif @group.save\n\t\t\t\t\tformat.html { redirect_to @group, notice: 'Group was successfully created.' }\n\t\t\t\t\tformat.json { render :show, status: :created, location: @group }\n\t\t\t\telse\n\t\t\t\t\tformat.html { render :new }\n\t\t\t\t\tformat.json { render json: @group.errors, status: :unprocessable_entity }\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html { redirect_to root_url, notice: 'Group was NOT created. Group name must be alpha-numeric characters.'}\n\t\t\tend\n\t\tend\n\n\tend","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"358121ba40019ba4e498ad04e4c458bc","score":"0.5652039","text":"def set_group\n @group = Group.find(params[:id])\n end","title":""},{"docid":"19cebe53541d0981fd8d6beed60776d2","score":"0.5651786","text":"def set_group\n @group = Group.friendly.find(params[:id])\n end","title":""},{"docid":"19cebe53541d0981fd8d6beed60776d2","score":"0.5651786","text":"def set_group\n @group = Group.friendly.find(params[:id])\n end","title":""},{"docid":"29252a76717f22fd5bf5f55744124b15","score":"0.5649687","text":"def set_group\n\t@group = Group.find(params[:id])\nend","title":""},{"docid":"592a926526ba57ea0006d8fd8955a136","score":"0.56473047","text":"def set_group\n @group = Group.find(params[:id])\n authorize @group unless @group.nil?\n @group_identifier = @group.id\n end","title":""},{"docid":"6bed184223911b8194fbc766c582d977","score":"0.5644353","text":"def set_group\n @group = Group.includes(:users).find(params[:group_id])\n end","title":""},{"docid":"027cac536726b222ac099136a26139ba","score":"0.56405115","text":"def setup(map_id)\n\t\t@groups = []\n\t\tconsolidator_setup(map_id)\n\tend","title":""},{"docid":"377f9e784a28eb6225cbf840b0306cae","score":"0.56377774","text":"def set_group\n @group = Group.friendly.find(params[:id]) if params[:id].present?\n end","title":""},{"docid":"0c29d956eeeaca3a5f4dafde9ea4cc6c","score":"0.56376755","text":"def set_group\n @group = Group.find(params[:group_id] || params[:id])\n end","title":""},{"docid":"ec573819536b3e4edf187793d21c3982","score":"0.5636605","text":"def set_group\n @group = Group.find( params[ :id ])\n end","title":""},{"docid":"d77d1a1bfc83934dcb95b692bc615eb8","score":"0.5634949","text":"def set_group\n @group = FortyTwo::Group.find(params[:id])\n end","title":""},{"docid":"d1433df286bf04f2cb223db49f8b101e","score":"0.56334627","text":"def set_task_group\n @task_group = TaskGroup.includes(:project).find(params[:id])\n end","title":""},{"docid":"9cad57e0ced50330d6bc7160c96a0469","score":"0.56316996","text":"def update(group)\n # remove members of the group from pending lists\n for id in group.members\n @pending.delete(id)\n end\n\n # capture group\n @group = group\n end","title":""},{"docid":"ef41290f6aa04795a9672480e448ff42","score":"0.56297964","text":"def set_group\n @group = Group.find(params[:id])\n \n end","title":""},{"docid":"3c916ffedbb5e7c4b525370bada1809d","score":"0.56275505","text":"def set_group\n @group = Group.find(params[:group_id])\n end","title":""},{"docid":"3c916ffedbb5e7c4b525370bada1809d","score":"0.56275505","text":"def set_group\n @group = Group.find(params[:group_id])\n end","title":""},{"docid":"3c916ffedbb5e7c4b525370bada1809d","score":"0.56275505","text":"def set_group\n @group = Group.find(params[:group_id])\n end","title":""},{"docid":"3c916ffedbb5e7c4b525370bada1809d","score":"0.56275505","text":"def set_group\n @group = Group.find(params[:group_id])\n end","title":""},{"docid":"3c916ffedbb5e7c4b525370bada1809d","score":"0.56275505","text":"def set_group\n @group = Group.find(params[:group_id])\n end","title":""},{"docid":"6469a5fe5237633e7bfbb1f6810f280e","score":"0.5621605","text":"def set_groups_variable\n @group_variable = GroupsVariable.find(params[:id])\n end","title":""},{"docid":"4858d84b4a44db7fe0740c47ea227086","score":"0.5617617","text":"def set_os_groups_group\n @os_groups_group = OsGroupsGroup.find(params[:id])\n end","title":""}],"string":"[\n {\n \"docid\": \"3e6c8c9e9c9a9bb0e0553c0a5823cad8\",\n \"score\": \"0.77831966\",\n \"text\": \"def groups_assign(groups_to_be_assigned,package)\\n groups_delayed = Array.new\\n groups_to_be_assigned.each { |g|\\n groups_delayed << g[0].to_i\\n }\\n current_user_id = current_user.id\\n #call calculate_delayed_group_learners method using delayedjob\\n package_obj = PackagesController.new\\n package_obj.delay.calculate_delayed_group_learners(groups_delayed,current_user_id,package.id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2de3f255ea1d881d22a3420fa2db38e8\",\n \"score\": \"0.6728565\",\n \"text\": \"def assign_group\\n if self.id == 1\\n self.group_id = 1\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0f396cc926ed53c30977f5311a0a6b2d\",\n \"score\": \"0.67261016\",\n \"text\": \"def manage_groups\\n unless params[:group].nil?\\n package = Package.find(params[:id])\\n groups_to_be_assigned = params[:group]\\n groups_assign(groups_to_be_assigned,package)\\n flash[:wait_feedback] = \\\"The learners are being assigned. The process will take some time. Please check later for the updated learner count.\\\"\\n end\\n redirect_to(\\\"/courses\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6d1d27d6df99bcda125c9848a0b73ff\",\n \"score\": \"0.6713749\",\n \"text\": \"def groups_assign(groups_to_be_assigned,assessment)\\n groups_delayed = Array.new\\n groups_to_be_assigned.each { |g|\\n groups_delayed << g[0].to_i\\n }\\n assessment_id = assessment.id\\n current_user_id = current_user.id\\n \\n #call calculate_delayed_group_learners method using delayedjob\\n assessment_obj = AssessmentsController.new\\n assessment_obj.delay.calculate_delayed_group_learners(groups_delayed,current_user_id,assessment_id)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c0e7a84c075b3e850a0fa7070e7d27fb\",\n \"score\": \"0.64841807\",\n \"text\": \"def groups_assign(groups_to_be_assigned,course)\\n groups_delayed = Array.new\\n groups_to_be_assigned.each { |g|\\n groups_delayed << g[0].to_i\\n }\\n course_id = course.id\\n current_user_id = current_user.id\\n\\n course_obj = CoursesController.new\\n course_obj.delay.calculate_delayed_group_learners(groups_delayed,current_user_id,course_id)\\n# delayed_id = Delayed::Job.enqueue(AssigningJob.new(groups_delayed,current_user_id,course_id,\\\"assign_to_course\\\"))\\n\\n# groups_to_be_assigned.each { |g|\\n#\\n# learners_for_course_adding = Array.new\\n# learners_valid_for_signup = Array.new\\n#\\n# learners_for_course_adding = current_user.user.find(:all,:conditions => [\\\"group_id = ? AND crypted_password IS NOT NULL AND deactivated_at IS NULL\\\",g[0].to_i])\\n# learners_valid_for_signup = current_user.user.find(:all,:conditions => [\\\"group_id = ? AND crypted_password IS NULL AND deactivated_at IS NULL\\\",g[0].to_i])\\n#\\n# Delayed::Job.enqueue(AssigningJob.new(learners_for_course_adding,learners_valid_for_signup,current_user,course.id,\\\"assign_to_course\\\"))\\n# }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a9e7c983a0b76ce8213150b55c1bc41a\",\n \"score\": \"0.62658715\",\n \"text\": \"def assignPackage\\n while (@packagesQueue.length != 0)\\n package = @packagesQueue.shift\\n # remove and return our first drone from the queue\\n drone = @dronesQueue.shift\\n @canLeaveDepoAt = intToTime(drone[\\\"nextPackageTime\\\"] + Time.now.to_f)\\n if (package[\\\"departBy\\\"] > @canLeaveDepoAt)\\n SOLUTION[\\\"assignments\\\"].push({\\n \\t\\t\\t\\t\\t\\tdroneId: drone[\\\"droneId\\\"],\\n \\t\\t\\t\\t\\t\\tpackageId: package[\\\"packageId\\\"]\\n \\t\\t\\t\\t\\t})\\n else\\n SOLUTION[\\\"unassignedPackageIds\\\"].push(package[\\\"packageId\\\"])\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"062c47d72e1ba2f8a0702f4363ab9ce3\",\n \"score\": \"0.622334\",\n \"text\": \"def set_package_group\\n @package_group = PackageGroup.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"28cf588e65fef9ca02bab20d7eac5249\",\n \"score\": \"0.6197384\",\n \"text\": \"def set_group\\n if (!self.job_source.nil? && !self.job_source.group.nil?)\\n self.group = self.job_source.group\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8cfe81d79de18e8be6081f56a397a966\",\n \"score\": \"0.61727124\",\n \"text\": \"def tickle_task_groups\\n\\t\\tself.task_groups.each do |task_class, group|\\n\\t\\t\\tnew_pids = group.adjust_workers or next\\n\\t\\t\\tnew_pids.each do |pid|\\n\\t\\t\\t\\tself.task_pids[ pid ] = group\\n\\t\\t\\tend\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c45bcebc236517f0f158db36c640eda7\",\n \"score\": \"0.6146493\",\n \"text\": \"def create_group(group_name,group_uuid,classes = {},rule_term,parent_group)\\n load_classifier\\n groups = @classifier.groups\\n @classifier.update_classes.update\\n current_group = groups.get_groups.select { |group| group['name'] == group_name}\\n if current_group.empty?\\n cputs \\\"Creating #{group_name} group in classifier\\\"\\n groups.create_group({\\n 'name' => group_name,\\n 'id' => group_uuid,\\n 'classes' => classes,\\n 'parent' => groups.get_group_id(\\\"#{parent_group}\\\"),\\n 'rule' => rule_term\\n })\\n else\\n cputs \\\"NODE GROUP #{group_name} ALREADY EXISTS!!! Skipping\\\"\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"61b931772de9e7c8f226d414fe245258\",\n \"score\": \"0.6135778\",\n \"text\": \"def create_group(group_name,group_uuid,classes = {},rule_term,parent_group)\\n load_classifier\\n @classifier.update_classes.update\\n groups = @classifier.groups\\n current_group = groups.get_groups.select { |group| group['name'] == group_name}\\n if current_group.empty?\\n cputs \\\"Creating #{group_name} group in classifier\\\"\\n groups.create_group({\\n 'name' => group_name,\\n 'id' => group_uuid,\\n 'classes' => classes,\\n 'parent' => groups.get_group_id(\\\"#{parent_group}\\\"),\\n 'rule' => rule_term\\n })\\n else\\n cputs \\\"NODE GROUP #{group_name} ALREADY EXISTS!!! Skipping\\\"\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3d64546f1014bcb3b1dab0d65cbbc1e7\",\n \"score\": \"0.612526\",\n \"text\": \"def assign_task_group\\n unless self.task_group\\n self.task_group = Digest::SHA1.hexdigest(Time.now.to_f.to_s)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7638fdf20cd82a1ea3e0556be80233c3\",\n \"score\": \"0.6108412\",\n \"text\": \"def assigned_by_group=(value)\\n @assigned_by_group = value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"76586ad08c3ab780bc4542521cb294c5\",\n \"score\": \"0.6088305\",\n \"text\": \"def set_groups grps\\n @groups=grps\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1db0b6d09a19232d6be372f4adde2e99\",\n \"score\": \"0.60517603\",\n \"text\": \"def startgroup\\n @group = Group.new\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7e2f391ea93e60030b1c9f0b9c064c77\",\n \"score\": \"0.60257137\",\n \"text\": \"def clone_local_item_groups\\n\\t\\t## there can be n such groups.\\n\\t\\tself.quantity_received.to_i.times do \\n\\t\\t\\tlocal_item_group = Inventory::ItemGroup.new(self.supplier_item_group.attributes.except(:id,:barcode,:owner_ids,:currently_held_by_organization,:name))\\n\\t\\t\\t## this should ideally be working.\\n\\t\\t\\tlocal_item_group.created_by_user = self.created_by_user\\n\\t\\t\\tlocal_item_group.cloned_from_item_group_id = self.supplier_item_group.id.to_s\\n\\t\\t\\tlocal_item_group.transaction_id = self.id.to_s\\n\\t\\t\\t#local_item_group.assign_id_from_name\\n\\t\\t\\tbegin\\n\\t\\t\\t\\t## here do that save thingy.\\n\\t\\t\\t\\tif Rails.env.test? || Rails.env.development?\\n\\t\\t\\t\\t\\tif ENV[\\\"CREATE_UNIQUE_RECORDS\\\"].blank?\\n\\t\\t\\t\\t\\t\\tlocal_item_group.save(op_type: \\\"create\\\")\\n\\t\\t\\t\\t\\telsif ENV[\\\"CREATE_UNIQUE_RECORDS\\\"] == \\\"no\\\"\\n\\t\\t\\t\\t\\t\\tlocal_item_group.save\\n\\t\\t\\t\\t\\tend\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\tlocal_item_group.save(op_type: \\\"create\\\")\\n\\t\\t\\t\\tend\\n\\t\\t\\t\\t#puts \\\"the local item group was created.\\\"\\n\\t\\t\\t\\t#puts \\\"the errors are:\\\"\\n\\t\\t\\t\\t#puts local_item_group.errors.full_messages\\n\\t\\t\\t\\t#puts \\\"its id is\\\"\\n\\t\\t\\t\\t#puts local_item_group.id.to_s\\n\\t\\t\\t\\t#puts \\\"the created by user email is:\\\"\\n\\t\\t\\t\\t#puts self.created_by_user.email.to_s\\n\\t\\t\\t\\t#puts \\\"-------------------------------\\\"\\n\\t\\t\\t\\tunless local_item_group.errors.blank?\\n\\t\\t\\t\\t\\tself.errors.add(:local_item_groups, local_item_group.errors.full_messages.to_s)\\n\\t\\t\\t\\tend\\n\\t\\t\\trescue => e\\n\\t\\t\\t\\tputs e.to_s\\n\\t\\t\\t\\tself.errors.add(:local_item_groups, \\\"someone else tried to create an item group at the same time on your organization\\\")\\n\\t\\t\\tend\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7935877e02162ec15b6195f09381e8da\",\n \"score\": \"0.599412\",\n \"text\": \"def set_group\\n if (self.organization.to_s.length > 0)\\n group = Group.find_or_create_by_name(self.organization.to_s)\\n self.groups << group\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"939d569aad0be180bbb775c3215d61ef\",\n \"score\": \"0.5949841\",\n \"text\": \"def assign_group(g, n)\\n\\t\\tEvent.where(:name => n).each do |e|\\n\\t\\t\\te.update_attributes(:eventgroup_id => g)\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"29e4709122a06ad3ff1cf038dac23d61\",\n \"score\": \"0.59449565\",\n \"text\": \"def set_group\\n @group = Group.find_by_channel_key(params[:channel_key])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d1801f99bfeb8fc89567d7e41606af6a\",\n \"score\": \"0.5941732\",\n \"text\": \"def set_groups\\n @groups = Group.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3253042dead58be36c904653acf1a489\",\n \"score\": \"0.59350747\",\n \"text\": \"def perform(group, groups)\\n\\n puts \\\"Iniciando mescla de grupos\\\"\\n\\n user = group.user\\n\\n groups.each do |g|\\n\\n if user.groups.exists?(g)\\n group_copy = user.groups.find g\\n group.contacts << group_copy.contacts\\n end\\n\\n end\\n\\n Pusher[group.user_id.to_s].trigger('merge_groups_done', {:status => 'success', :message => \\\"Contatos de vários grupos foram copiados para o grupo #{group.name} com sucesso!\\\"})\\n\\n puts \\\"Mescla de grupos concluida!\\\"\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b04494c86e22b141d584ebd4ac9f5095\",\n \"score\": \"0.5925364\",\n \"text\": \"def create_pack_groups\\n\\n query = \\\"select distinct color_percentage,grade_code from carton_setups where\\n production_schedule_code = '#{self.production_schedule_name}'\\\"\\n\\n carton_setup_groups = self.connection.select_all(query)\\n\\n rebin_setup_groups = RebinSetup.find_by_sql(\\\"select distinct color_percentage,grade_code from rebin_setups where\\n production_schedule_code = '#{self.production_schedule_name}'and standard_size_count_from > -1\\\")\\n group_number = 0\\n\\n group_list = Array.new\\n\\n pack_groups = Array.new\\n carton_setup_groups.each do |carton_setup_group|\\n pack_group = PackGroup.new\\n group_number += 1\\n #find a 'real' carton setup- we need some info. Although carton setup group is\\n #an instance of carton setup, the 'distinc' query disallowed the retrieval of all attributes\\n carton_setup = CartonSetup.find(:first, :conditions => \\\"color_percentage =\\\\'#{carton_setup_group['color_percentage']}\\\\'\\n and grade_code = '#{carton_setup_group['grade_code']}\\\\' and production_schedule_code = '#{self.production_schedule_name}'\\\")\\n\\n pack_group.pack_group_number = group_number\\n pack_group.commodity_code = carton_setup.retail_item_setup.item_pack_product.commodity_code\\n pack_group.marketing_variety_code = carton_setup.marketing_variety_code\\n pack_group.color_sort_percentage = carton_setup.color_percentage\\n pack_group.grade_code = carton_setup.grade_code\\n pack_group.production_run_number = self.production_run_number\\n pack_group.production_schedule_name = self.production_schedule_name\\n pack_group.production_run = self\\n pack_group.create\\n group_list.push pack_group\\n #self.pack_groups.push(pack_group)\\n\\n end\\n\\n #---------------------------------------------------------------------------------------------------\\n #See if the rebin_groups contain a group (color,grade combo) not found in the groups we already have\\n #If not create a new group and add it\\n #---------------------------------------------------------------------------------------------------\\n\\n rebin_setup_groups.each do |rebin_group|\\n if !(rebin_group.color_percentage == -1 && !rebin_group.grade_code)&& !group_list.find { |p| p.color_sort_percentage == rebin_group.color_percentage && p.grade_code == rebin_group.grade_code }\\n #missing roup, add new one\\n pack_group = PackGroup.new\\n group_number += 1\\n #find a 'real' rebin setup- we need some info. Although rebin setup group is\\n #an instance of rebin setup, the 'distinc' query disallowed the retrieval of all attributes\\n rebin_setup = nil\\n if rebin_group.grade_code\\n rebin_setup = RebinSetup.find(:first, :conditions => [\\\"color_percentage = ? and grade_code = ? and production_schedule_code = ?\\\", rebin_group.color_percentage, rebin_group.grade_code, self.production_schedule_name])\\n else\\n rebin_setup = RebinSetup.find(:first, :conditions => [\\\"color_percentage = ? and grade_code is null and production_schedule_code = ?\\\", rebin_group.color_percentage, self.production_schedule_name])\\n end\\n\\n pack_group.pack_group_number = group_number\\n pack_group.commodity_code = rebin_setup.rmt_product.commodity_code\\n pack_group.marketing_variety_code = rebin_setup.variety_output_description\\n pack_group.color_sort_percentage = rebin_setup.color_percentage\\n pack_group.grade_code = rebin_setup.grade_code\\n pack_group.production_run_number = self.production_run_number\\n pack_group.production_schedule_name = self.production_schedule_name\\n pack_group.production_run = self\\n pack_group.create\\n self.pack_groups.push(pack_group)\\n\\n end\\n end\\n\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2ba5b7f1f108cdbc99384ea860ce2ad2\",\n \"score\": \"0.59186846\",\n \"text\": \"def set_group\\n @current_resource.group(current_group)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"95f9a00d79cc04c40ea74dcd480a1c1a\",\n \"score\": \"0.5897735\",\n \"text\": \"def set_groups\\n\\t\\t\\t@groups = @intranet.groups\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"09d5252528eab69e9575a049c2174529\",\n \"score\": \"0.5889466\",\n \"text\": \"def manage_groups\\n unless params[:group].nil?\\n assessment = Assessment.find(params[:id])\\n groups_to_be_assigned = params[:group]\\n groups_assign(groups_to_be_assigned,assessment)\\n flash[:wait_feedback] = \\\"The learners are being assigned. The process will take some time. Please check later for the updated learner count.\\\"\\n end\\n redirect_to(\\\"/courses\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"057b68e40bb989e990ce8cd371a3012e\",\n \"score\": \"0.58777833\",\n \"text\": \"def setup_groups\\n @groups = [Group.new(:default)]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"09947dbdf12c02815e9f95f932283e7d\",\n \"score\": \"0.5872202\",\n \"text\": \"def update_groups\\n\\n # get nearby clients\\n\\n relevant_envs = self.nearby\\n\\n # all clients in the same group as a nearby client\\n\\n @grouped_envs = relevant_envs.inject([]) do |result, element|\\n element.all_in_group.each do |group_env|\\n unless result.include?( group_env )\\n result << group_env\\n end\\n end\\n result\\n end\\n\\n # create new group id and assign to all clients in the new group\\n\\n new_group_id = rand(Time.now.to_i)\\n\\n group_uuids = @grouped_envs.map { |e| e.client_uuid }\\n puts \\\"creating new group with id #{new_group_id} and clients #{group_uuids.inspect}\\\"\\n\\n ( @grouped_envs | relevant_envs ).each do |foobar|\\n foobar[:group_id] = new_group_id\\n foobar.save\\n end\\n\\n reload\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5ac2deb8a4a4930bb9a6a06a37643091\",\n \"score\": \"0.5870561\",\n \"text\": \"def update!(**args)\\n @groups = args[:groups] if args.key?(:groups)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5ac2deb8a4a4930bb9a6a06a37643091\",\n \"score\": \"0.5870561\",\n \"text\": \"def update!(**args)\\n @groups = args[:groups] if args.key?(:groups)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ad5e9f8d12c9f83f0d44e5d77e827547\",\n \"score\": \"0.5847695\",\n \"text\": \"def create\\n @group = Group.new(group_params)\\n @group.user_id = current_user.id #store the information of the user who created this group/project\\n\\n respond_to do |format|\\n if @group.save\\n Log.create! description: \\\"#{current_user.email} created project #{@group.name} at #{@group.created_at.strftime '%d-%m-%Y %H:%M:%S'}\\\",\\n role_id: current_user.roles.ids.first\\n\\n\\n ug = UserGroup.create! user_id: @group.upload_user.id, group_id: @group.id\\n Log.create! description: \\\"#{current_user.email} added user #{@group.upload_user.email} to group #{@group.name} at #{ug.created_at.strftime '%d-%m-%Y %H:%M:%S'}\\\",\\n role_id: current_user.roles.ids.first\\n\\n # => notify to the upload user about their assignment to this group (mail and sms)\\n\\n UserNotifierMailer.delay(queue: \\\"upload user added to project\\\").added_to_project(@group.upload_user, @group)\\n # => send sms after adding user to the project\\n if @group.upload_user.mobile\\n send_sms(@group.upload_user.mobile, \\\"#{@group.upload_user.roles.last.name}, You have been added to project - #{@group.name}\\\")\\n end\\n\\n format.html { redirect_to admin_groups_path, notice: 'Project was successfully created.' }\\n format.json { render :show, status: :created, location: @group }\\n else\\n format.html { render :new }\\n format.json { render json: @group.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7be07c9c9d35950398a7e52934df94b7\",\n \"score\": \"0.58473074\",\n \"text\": \"def set_urls_group\\n if (!self.id.nil? && !self.group_id.nil?)\\n Url.update_all(\\\"group_id = \\\" + self.group_id.to_s, [ \\\"job_id = ?\\\", self.id.to_s ])\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"91d87d702c4b443a9f20fedf033aab14\",\n \"score\": \"0.5797372\",\n \"text\": \"def process_task_group(group)\\n @tasks_xml[group] = []\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e7c5e56fbcad7cecbac121324b03b884\",\n \"score\": \"0.57956547\",\n \"text\": \"def fetch_event_groups\\n Delayed::Job.enqueue EventGroupsFetcher.new(sw_id), priority: 10, queue: 'event_groups'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fb733b22358050df21c381731b8d6114\",\n \"score\": \"0.57803565\",\n \"text\": \"def groups_id=(groups)\\n groups.each do |group|\\n group_instance = Group.find(group)\\n if !self.groups.include?(group_instance)\\n group_instance.tasks << self \\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3f3b7a52a53cc6e7febad8fa1f646f0d\",\n \"score\": \"0.575204\",\n \"text\": \"def sync_group_name\\n super\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d46bbc4f648ea747bea405de6742f5d3\",\n \"score\": \"0.5747387\",\n \"text\": \"def prepare_worker_groups(groups)\\n groups.each do |name, options|\\n @worker_groups[name] = WorkerGroup.new(\\n name, options.merge(manager: self))\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d38ec223fce6011edee1c33ea08cf327\",\n \"score\": \"0.5740771\",\n \"text\": \"def create\\n @group = current_user.mygroups.new(group_params)\\n\\n respond_to do |format|\\n if @group.save\\n current_user.groups << @group\\n\\n # Added as part of activity feed\\n @group.create_activity :create, owner: current_user\\n \\n format.html { redirect_to group_path(@group), notice: 'Group was successfully created.' }\\n format.json { render action: 'show', status: :created, location: group_path(@group) }\\n else\\n format.html { render action: 'new' }\\n format.json { render json: @group.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"455d5809194afdeefd71e44189a270ee\",\n \"score\": \"0.57378703\",\n \"text\": \"def assign_group(ids, group_id)\\n where(:_id.in => ids).each do |q|\\n if q.group_id != group_id\\n q.group_id = group_id\\n q.sort_order = nil\\n end\\n end\\n return nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"455d5809194afdeefd71e44189a270ee\",\n \"score\": \"0.57378703\",\n \"text\": \"def assign_group(ids, group_id)\\n where(:_id.in => ids).each do |q|\\n if q.group_id != group_id\\n q.group_id = group_id\\n q.sort_order = nil\\n end\\n end\\n return nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"32e5ce981801a7fffd185c500591bef2\",\n \"score\": \"0.57364315\",\n \"text\": \"def assign_users_to_group(group_users)\\n group = Group.new\\n group.users_number = 3\\n group.round_id = 0\\n group.betray_penalty = [0, 10, 20].shuffle![0]\\n # group.betray_penalty = 0\\n if (!group.save)\\n puts \\\"***** group save error *****\\\"*100\\n end\\n\\n group_users.each do |u|\\n u.round_id = 0\\n u.group_id = group.id\\n if (!u.save)\\n puts \\\"**** user save error *****\\\"*100\\n end\\n end\\n group\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3ca4537635ed90a2eb2ec8faf35933b1\",\n \"score\": \"0.5722673\",\n \"text\": \"def install\\n execute([command(:cmd), \\\"-y\\\", \\\"groupinstall\\\", @resource[:name]])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7ab2828b3137c1873caadb0737a19e1\",\n \"score\": \"0.5717096\",\n \"text\": \"def save\\n if group.id\\n update\\n true\\n else\\n raise \\\"New #{self.class} are created when a new Fog::Rackspace::AutoScale::Group is created\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7ab2828b3137c1873caadb0737a19e1\",\n \"score\": \"0.5717096\",\n \"text\": \"def save\\n if group.id\\n update\\n true\\n else\\n raise \\\"New #{self.class} are created when a new Fog::Rackspace::AutoScale::Group is created\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"68f1eb5576378a28877f82c9ab4ff800\",\n \"score\": \"0.57124484\",\n \"text\": \"def launch!\\n @vmgroups.each{|name, group|\\n @tg_groups.add(Thread.new {\\n Thread.current.abort_on_exception = true\\n group.monitor\\n })\\n }\\n\\n until @vmgroups.all?{|(n,g)| g.triggered_events.include?(:ready)}\\n sleep 5\\n end\\n\\n logger.info \\\"#{banner}All groups are now READY: #{groups.inspect}.\\\"\\n\\n trigger :ready\\n ThreadsWait.all_waits(*@tg_groups.list) do |t|\\n # http://apidock.com/ruby/Thread/status\\n if t.status.nil? || t.status == \\\"aborting\\\" || t[:ko]\\n trigger :error\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"12f05f35ee925733d3eb81d7f2d622af\",\n \"score\": \"0.5712329\",\n \"text\": \"def create_task_groups\\n\\t\\told_task_groups = @task_groups || {}\\n\\t\\t@task_groups = {}\\n\\n\\t\\tself.log.debug \\\"Managing task groups: %p\\\" % [ old_task_groups ]\\n\\n\\t\\tSymphony.load_configured_tasks.each do |task_class, max|\\n\\t\\t\\t# If the task is still configured, restart all of its workers\\n\\t\\t\\tif group = old_task_groups.delete( task_class )\\n\\t\\t\\t\\tself.log.info \\\"%p still configured; restarting its task group.\\\" % [ task_class ]\\n\\t\\t\\t\\tself.restart_task_group( group, task_class, max )\\n\\t\\t\\t\\t@task_groups[ task_class ] = group\\n\\n\\t\\t\\t# If it's new, just start it up\\n\\t\\t\\telse\\n\\t\\t\\t\\tself.log.info \\\"Starting up new task group for %p\\\" % [ task_class ]\\n\\t\\t\\t\\t@task_groups[ task_class ] = self.start_task_group( task_class, max )\\n\\t\\t\\tend\\n\\t\\tend\\n\\n\\t\\t# Any task classes remaining are no longer configured, so stop them.\\n\\t\\told_task_groups.each do |task_class, group|\\n\\t\\t\\tself.log.info \\\"%p no longer configured; stopping its task group.\\\" % [ task_class ]\\n\\t\\t\\tself.stop_task_group( group )\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be9eadf859f65f1bd3b97ef8e25684fe\",\n \"score\": \"0.57035446\",\n \"text\": \"def internal_group=(group)\\n @group = group\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"736421ce8d9fa734e78780000f591af5\",\n \"score\": \"0.56935596\",\n \"text\": \"def created()\\n self.update(@@group)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4e59e48c43795a229e7f85932ba5aec7\",\n \"score\": \"0.5687455\",\n \"text\": \"def set_group\\n @group = Group.find(params[:group_id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4e59e48c43795a229e7f85932ba5aec7\",\n \"score\": \"0.5687455\",\n \"text\": \"def set_group\\n @group = Group.find(params[:group_id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"05f5e6800a29be1580031897f73c6588\",\n \"score\": \"0.56850916\",\n \"text\": \"def set_group_assignment\\n @group_assignment = GroupAssignment.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbb3f6ee9d5e6e19f8447de8382ac17e\",\n \"score\": \"0.5675733\",\n \"text\": \"def set_group\\n\\t\\t\\t@group = Group.find(params[:id])\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbb3f6ee9d5e6e19f8447de8382ac17e\",\n \"score\": \"0.5675733\",\n \"text\": \"def set_group\\n\\t\\t\\t@group = Group.find(params[:id])\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"28ac17ded0f18a28b91d751ed19ee139\",\n \"score\": \"0.5673522\",\n \"text\": \"def set_group\\n @group = Group.friendly.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2f5e83abfca694a7247c5f726763db56\",\n \"score\": \"0.56721836\",\n \"text\": \"def set_group\\n @group = current_store.groups.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4a3b6b0ca5759c38fee7d2aa8bfe98b8\",\n \"score\": \"0.5670845\",\n \"text\": \"def create\\n @group = Group.new(params[:group])\\n\\n respond_to do |format|\\n if @group.save\\n\\t current_user.groups << @group\\n\\t current_user.save\\n\\t send_group_announcement(@group)\\n format.html { redirect_to(@group, :notice => 'Group was successfully created.') }\\n format.xml { render :xml => @group, :status => :created, :location => @group }\\n else\\n format.html { render :action => \\\"new\\\" }\\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"396e64efd98888ce7d613ca6eb020222\",\n \"score\": \"0.5668184\",\n \"text\": \"def configure_group(group); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4429bc10c4020605129f25e6144b074d\",\n \"score\": \"0.56628954\",\n \"text\": \"def reassign_packages\\n Package.all.each do |package|\\n original_branch = package.package_branch\\n if original_branch.unit.blank?\\n log.info \\\"Migrating #{package.to_s(:pretty_with_version)}'s package branch...\\\"\\n\\n new_branch = retrieve_unit_scoped_branch(original_branch, package.unit, PackageCategory.where(:id => package.package_category_id).first)\\n package.package_branch = new_branch\\n package.save!\\n \\n log.info \\\"ok\\\"\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5992fab3c28a6f9f0647e985b458882d\",\n \"score\": \"0.5658907\",\n \"text\": \"def set_group \\n @group = Group.find(params[:group])\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ac98d6540daab11839545a935da7eab4\",\n \"score\": \"0.56576246\",\n \"text\": \"def set_group\\n @group = Group.find(params[:group_id]) \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8a45d3d8b2dd7a4aefe824425b1b4a5e\",\n \"score\": \"0.5656232\",\n \"text\": \"def set_group\\n\\t\\t @group = Group.find(params[:id])\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"91e838d26f355d4715c655485eeb8377\",\n \"score\": \"0.5652443\",\n \"text\": \"def create\\n\\t\\t\\n\\t\\t@group = Group.new(group_params)\\n\\t\\t\\n\\t\\t@group.users << current_user\\n\\t\\t@group.leaders = [current_user.id.to_s]\\n\\t\\t#The created group email should be \\\"group-name + group-id\\\", this will prevent people making groups of the same name\\n\\t\\t# with matching emails. Also this makes it so we don't have to return a \\\"this group already exists\\\" error, which would\\n\\t\\t# allow people to infer the name of groups on the system\\n\\t\\t#We must save first to get an id generated however\\n\\t\\tputs \\\"DEBUG===============\\\"\\n\\t\\tgname = @group.group_name.gsub(/\\\\s/, \\\"\\\")\\n\\t\\tputs gname\\n\\t\\tputs \\\"====================\\\"\\n\\t\\tif gname =~ /^[a-zA-Z0-9]+$/\\n\\t\\t\\t@group.save\\n\\t\\t\\t\\n\\t\\t\\t@group.email = gname + \\\"+\\\" + @group.id + $Domain\\n\\t\\t\\tputs \\\"DEBUG======2========\\\"\\n\\t\\t\\tputs @group.email\\n\\t\\t\\tputs \\\"====================\\\"\\n\\t\\t\\t# Passphrase for pgp keys is bull-s*** right now, may change later\\n\\t\\t\\tKeyGenerator::generatePGPkeyGPGme(@group.group_name, @group.email, \\\"asldkfjlksdjf\\\")\\n\\n\\t\\t\\tcurrent_user.save\\n\\n\\t\\t\\t\\n\\t\\t\\trespond_to do |format|\\n\\t\\t\\t\\tif @group.save\\n\\t\\t\\t\\t\\tformat.html { redirect_to @group, notice: 'Group was successfully created.' }\\n\\t\\t\\t\\t\\tformat.json { render :show, status: :created, location: @group }\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\tformat.html { render :new }\\n\\t\\t\\t\\t\\tformat.json { render json: @group.errors, status: :unprocessable_entity }\\n\\t\\t\\t\\tend\\n\\t\\t\\tend\\n\\t\\telse\\n\\t\\t\\trespond_to do |format|\\n\\t\\t\\t\\tformat.html { redirect_to root_url, notice: 'Group was NOT created. Group name must be alpha-numeric characters.'}\\n\\t\\t\\tend\\n\\t\\tend\\n\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"358121ba40019ba4e498ad04e4c458bc\",\n \"score\": \"0.5652039\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"19cebe53541d0981fd8d6beed60776d2\",\n \"score\": \"0.5651786\",\n \"text\": \"def set_group\\n @group = Group.friendly.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"19cebe53541d0981fd8d6beed60776d2\",\n \"score\": \"0.5651786\",\n \"text\": \"def set_group\\n @group = Group.friendly.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"29252a76717f22fd5bf5f55744124b15\",\n \"score\": \"0.5649687\",\n \"text\": \"def set_group\\n\\t@group = Group.find(params[:id])\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"592a926526ba57ea0006d8fd8955a136\",\n \"score\": \"0.56473047\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n authorize @group unless @group.nil?\\n @group_identifier = @group.id\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6bed184223911b8194fbc766c582d977\",\n \"score\": \"0.5644353\",\n \"text\": \"def set_group\\n @group = Group.includes(:users).find(params[:group_id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"027cac536726b222ac099136a26139ba\",\n \"score\": \"0.56405115\",\n \"text\": \"def setup(map_id)\\n\\t\\t@groups = []\\n\\t\\tconsolidator_setup(map_id)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"377f9e784a28eb6225cbf840b0306cae\",\n \"score\": \"0.56377774\",\n \"text\": \"def set_group\\n @group = Group.friendly.find(params[:id]) if params[:id].present?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0c29d956eeeaca3a5f4dafde9ea4cc6c\",\n \"score\": \"0.56376755\",\n \"text\": \"def set_group\\n @group = Group.find(params[:group_id] || params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ec573819536b3e4edf187793d21c3982\",\n \"score\": \"0.5636605\",\n \"text\": \"def set_group\\n @group = Group.find( params[ :id ])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d77d1a1bfc83934dcb95b692bc615eb8\",\n \"score\": \"0.5634949\",\n \"text\": \"def set_group\\n @group = FortyTwo::Group.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d1433df286bf04f2cb223db49f8b101e\",\n \"score\": \"0.56334627\",\n \"text\": \"def set_task_group\\n @task_group = TaskGroup.includes(:project).find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9cad57e0ced50330d6bc7160c96a0469\",\n \"score\": \"0.56316996\",\n \"text\": \"def update(group)\\n # remove members of the group from pending lists\\n for id in group.members\\n @pending.delete(id)\\n end\\n\\n # capture group\\n @group = group\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ef41290f6aa04795a9672480e448ff42\",\n \"score\": \"0.56297964\",\n \"text\": \"def set_group\\n @group = Group.find(params[:id])\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c916ffedbb5e7c4b525370bada1809d\",\n \"score\": \"0.56275505\",\n \"text\": \"def set_group\\n @group = Group.find(params[:group_id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c916ffedbb5e7c4b525370bada1809d\",\n \"score\": \"0.56275505\",\n \"text\": \"def set_group\\n @group = Group.find(params[:group_id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c916ffedbb5e7c4b525370bada1809d\",\n \"score\": \"0.56275505\",\n \"text\": \"def set_group\\n @group = Group.find(params[:group_id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c916ffedbb5e7c4b525370bada1809d\",\n \"score\": \"0.56275505\",\n \"text\": \"def set_group\\n @group = Group.find(params[:group_id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c916ffedbb5e7c4b525370bada1809d\",\n \"score\": \"0.56275505\",\n \"text\": \"def set_group\\n @group = Group.find(params[:group_id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6469a5fe5237633e7bfbb1f6810f280e\",\n \"score\": \"0.5621605\",\n \"text\": \"def set_groups_variable\\n @group_variable = GroupsVariable.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4858d84b4a44db7fe0740c47ea227086\",\n \"score\": \"0.5617617\",\n \"text\": \"def set_os_groups_group\\n @os_groups_group = OsGroupsGroup.find(params[:id])\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":187,"cells":{"query_id":{"kind":"string","value":"9045e10a75e0e129cf902b7c248e5bce"},"query":{"kind":"string","value":"GET /table2s/1 GET /table2s/1.json"},"positive_passages":{"kind":"list like","value":[{"docid":"e7e5d85aca81086a28e9424ee8113a61","score":"0.7546781","text":"def show\n @table2 = Table2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table2 }\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"e7e5d85aca81086a28e9424ee8113a61\",\n \"score\": \"0.7546781\",\n \"text\": \"def show\\n @table2 = Table2.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @table2 }\\n end\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"f4f2306617a0e49e577289832716c28c","score":"0.6591401","text":"def new\n @table2 = Table2.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @table2 }\n end\n end","title":""},{"docid":"5ce52391084eeb96a8013183d8dda9ff","score":"0.65425974","text":"def show\n @table1 = Table1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table1 }\n end\n end","title":""},{"docid":"abdb02274b5b106777dc9ad0df55b977","score":"0.6339199","text":"def create\n @table2 = Table2.new(params[:table2])\n\n respond_to do |format|\n if @table2.save\n format.html { redirect_to @table2, notice: 'Table2 was successfully created.' }\n format.json { render json: @table2, status: :created, location: @table2 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @table2.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"d7e54310a7ac7c5f1407793f13dd324d","score":"0.60557795","text":"def update\n @table2 = Table2.find(params[:id])\n\n respond_to do |format|\n if @table2.update_attributes(params[:table2])\n format.html { redirect_to @table2, notice: 'Table2 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @table2.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"16b458bd2f01592b86b89e9a13f7cf8b","score":"0.60480565","text":"def destroy\n @table2 = Table2.find(params[:id])\n @table2.destroy\n\n respond_to do |format|\n format.html { redirect_to table2s_url }\n format.json { head :no_content }\n end\n end","title":""},{"docid":"02ddb7f3b32a45375d455bf3e951c7da","score":"0.60210097","text":"def index\n @user2s = User2.all\n end","title":""},{"docid":"bf1749034e2af3a3b7245c26657f4608","score":"0.5974068","text":"def table(instance_name, table_name)\n get_json(table_endpoint(instance_name, table_name))\n end","title":""},{"docid":"c91f41a4b3a4fd703d9a12af49fa7b9c","score":"0.5921724","text":"def index\n #@category2s = Category2.all\n\n @category1 = Category1.find(params[:category1_id])\n @category2 = @category1.category2s.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: [@category1, @category2] }\n end\n end","title":""},{"docid":"24cdd5bf5fad1982115ac92038f63c6f","score":"0.58977914","text":"def index\n @person2s = Person2.all\n end","title":""},{"docid":"5f4ac13fd34dc191d62429708711de2b","score":"0.5871805","text":"def index\n @example2s = Example2.all\n end","title":""},{"docid":"fd469b61ec674b2dd6c1126fcbc77145","score":"0.58204156","text":"def index\n @l2 = L2.all\n end","title":""},{"docid":"68c1620c2640f46f555423bc92e6c74f","score":"0.57912856","text":"def tables(instance_name)\n get_json(tables_endpoint(instance_name))\n end","title":""},{"docid":"508f515de6928d31f3cbb4f65061f9ef","score":"0.5753385","text":"def index\n @product2s = Product2.all\n end","title":""},{"docid":"df6c0ea9d6e1f4d764ffadd1623d0730","score":"0.5749565","text":"def index\n @table1_copy2s = Table1Copy2.all\n end","title":""},{"docid":"9d55ee08146affe4fe7a9dcd935222f3","score":"0.574924","text":"def index\n @ticket2s = Ticket2.all\n end","title":""},{"docid":"82b2f749366b7ad05edfe1d1662526dd","score":"0.5749168","text":"def index\n @network2s = Network2.all\n end","title":""},{"docid":"0734c936fe2c2662ddd50e54e1f28128","score":"0.57429105","text":"def index\n @employee2s = Employee2.all\n end","title":""},{"docid":"8a151004d074854ee07b27b1525230d5","score":"0.5734882","text":"def fetch_table\n self.class.get('/premier-league/table')\n end","title":""},{"docid":"c08d7588b668153a6aec4a3ceda5d66e","score":"0.5705303","text":"def index\n @image2s = Image2.all\n end","title":""},{"docid":"d216cfcfdd75ccdccb8ce3574e9a5d02","score":"0.5702503","text":"def set_table1_copy2\n @table1_copy2 = Table1Copy2.find(params[:id])\n end","title":""},{"docid":"1556925408e329be7d403384332b8957","score":"0.5660032","text":"def new\n @table1 = Table1.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @table1 }\n end\n end","title":""},{"docid":"6a837931c1367773e9e55d3a4cec8254","score":"0.56451267","text":"def index\n @test2s = Test2.all\n end","title":""},{"docid":"98ad02e897bbf6bd53bd49fbc8c29bab","score":"0.5587844","text":"def index\n @start2s = Start2.all\n end","title":""},{"docid":"168c9c7d62468ca77be309624a4b5d99","score":"0.5586392","text":"def os2_table\n @os2_table ||= TTFunk::Table::OS2.encode(original.os2, subset)\n end","title":""},{"docid":"5bbf5a6dbadf765c4842ce3a7ba43202","score":"0.55613333","text":"def set_table1\n @table1 = Table1.find(params[:id])\n end","title":""},{"docid":"8c392c8402f7bc5eb441882ef587efa5","score":"0.5551566","text":"def index\n @table1s = Table1.all\n end","title":""},{"docid":"c61af28186346db48ff6c48bc42da2b8","score":"0.55358577","text":"def index\n @scat2s = Scat2.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @scat2s }\n end\n end","title":""},{"docid":"d806b7796906fab0fc2dd959687aa969","score":"0.5534007","text":"def index\n @p2s = P2.all\n end","title":""},{"docid":"b1b7fc9b522d33a406eb33c839959e52","score":"0.55337185","text":"def show\n @category1 = Category1.find(params[:category1_id])\n\n @category2 = @category1.category2s.find(params[:id])\n \n\n #@category2 = Category2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category2 }\n end\n end","title":""},{"docid":"7b66142d8617536cfec1fc6eee904d68","score":"0.55178416","text":"def get_table_json\n url = @driver.current_url\n table_id = url.split('/').last\n response = @client.table(table_id)[\"table\"]\n end","title":""},{"docid":"84345ecf6bad8d9ab770a0cd08bb78ca","score":"0.54941803","text":"def index\n @tipo2s = Tipo2.all\n end","title":""},{"docid":"c741d6d590c646bd5399ac2ecee75f46","score":"0.54843915","text":"def love2(api_version: API_VERSION)\n {\n name: \"Operations::Two.love2\",\n path: \"/providers/operations/2?api-version=#{api_version}&\",\n method: :get\n }\n end","title":""},{"docid":"de6c8e2a02f9d1e028a5b111167dc641","score":"0.5441841","text":"def index\n @call2s = Call2.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @call2s }\n end\n end","title":""},{"docid":"0e9d54b02d423623f6732b2137ea9f27","score":"0.5439808","text":"def index\n @sp2s = Sp2.all\n end","title":""},{"docid":"b84f65e487aa35249d0b2e012ebb099d","score":"0.5432863","text":"def index\n @twos = Two.all\n end","title":""},{"docid":"b685ae787baf1da9ab2a8c8310acc30e","score":"0.54238135","text":"def show\n @system_table = SystemTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @system_table }\n end\n end","title":""},{"docid":"d279ebaefdb1d9251fcac00b6fc13264","score":"0.5403137","text":"def index\n @student2s = Student2.all\n end","title":""},{"docid":"29e18f500a464a017db2ef8f288dd84e","score":"0.54020613","text":"def show\n @reservations_table = ReservationsTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reservations_table }\n end\n end","title":""},{"docid":"78315283beb0794512f6b572dfc4b69e","score":"0.5397777","text":"def show\n if ActiveRecord::Base.connection.tables.include? params[:table]\n table = params[:table].classify.constantize\n render json: table.all, status: :ok\n else\n table = {Response: \"Table does not exist\"}\n render json: table, status: :not_found\n end\n end","title":""},{"docid":"917542a959048ab40350e78512b58308","score":"0.5390356","text":"def show\n # params[:id] is device id\n @table = Table.find_by(device: params[:id])\n render json: @table\n end","title":""},{"docid":"78f9bc9e564f8849ea41c5748341ab2e","score":"0.5383646","text":"def index\n @h2 = H2.all\n @h2 = H2.search(params[:search], params[:page])\n end","title":""},{"docid":"b82bc49329c52c15509d332d6335db98","score":"0.5380892","text":"def index\n @rols = Rol.all\n respond_to do | format |\n format.html\n format.json {\n if params.has_key?(:type) && params[:type] == \"select2\"\n render json: Rol.select2(params[:q])\n end\n }\n end\n end","title":""},{"docid":"2e1b07fec901877ad482c2ddc437eb5e","score":"0.5379544","text":"def table_response(key, query = nil, *args)\n url = File.join(properties.primary_endpoints.table, *args)\n\n headers = build_headers(url, key, 'table')\n headers['Accept'] = 'application/json;odata=fullmetadata'\n\n url << \"?#{query}\" if query # Must happen after headers are built\n\n ArmrestService.rest_get(\n :url => url,\n :headers => headers,\n :proxy => proxy,\n :ssl_version => ssl_version,\n :ssl_verify => ssl_verify,\n )\n end","title":""},{"docid":"e5a3cde97bb827f0af69ef019d96fdb0","score":"0.5376099","text":"def index\n @post2s = Post2.all\n end","title":""},{"docid":"b8c6dec6807e0413289d624ab3e04be9","score":"0.53563654","text":"def get_call_1_2(url)\n url = \"1.2/#{url}\"\n response = connection.get(url) {|request| set_headers(request) }\n parse_response(response)\n end","title":""},{"docid":"24feff34a2934ec2f27ed9e072e9a0b5","score":"0.53538406","text":"def show\n rows = []\n unless @connection.tables.include?(params[:id])\n status = 403\n data = {message: \"Table doesn't exist\"}\n else\n res = @connection.execute(\"DESC #{params[:id]};\") \n status = 200\n data = {message: \"Table found\"}\n res.each(:as => :hash) {|ppp| rows << ppp}\n end\n render :json => {status: status, data: data.merge!(rows: rows)}\n end","title":""},{"docid":"1e0eb68a5d3347f9de9937bb0b4c47d9","score":"0.5337639","text":"def index\n @how2s = How2.all\n end","title":""},{"docid":"aa31cc782e8c36a7b6b5b01b9d14f607","score":"0.53354156","text":"def show\n #@table = current_user.organization.tables.find(params[:id])\n @table = Table.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table }\n end\n end","title":""},{"docid":"41d293dfa3012d8cfceb9c4845ab5e3d","score":"0.5329617","text":"def status2\n response = @http.get(\"status2/\")\n msg response, Logger::DEBUG\n return response\n end","title":""},{"docid":"7f61c45e4572b088e745ab7608dc8176","score":"0.53238684","text":"def show\n @oauth_table = OauthTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @oauth_table }\n end\n end","title":""},{"docid":"030661e68426b8674367ee655a15b7c7","score":"0.53230655","text":"def idx2\n\t\t\treturn @idx2 if @idx2\n\t\t\traise FormatError, 'idx2 requested but no idx2 available' unless desc.list_index\n\t\t\t# should check this can't return nil\n\t\t\t@idx2 = desc.pst.load_idx2 desc.list_index\n\t\tend","title":""},{"docid":"120f66b01a3c6166da21786867af0aec","score":"0.5300705","text":"def create\n @table1_copy2 = Table1Copy2.new(table1_copy2_params)\n\n respond_to do |format|\n if @table1_copy2.save\n format.html { redirect_to @table1_copy2, notice: 'Table1 copy2 was successfully created.' }\n format.json { render :show, status: :created, location: @table1_copy2 }\n else\n format.html { render :new }\n format.json { render json: @table1_copy2.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"32a5299a7d57a6e47044147dc302330e","score":"0.5295436","text":"def index\n @interpage2s = Interpage2.all\n end","title":""},{"docid":"684f1c57dd696d5c9fba479742b8970e","score":"0.5293574","text":"def index\n @module2s = Module2.all\n end","title":""},{"docid":"c42b62fd099bdb5b4447d81da6752dc3","score":"0.5293059","text":"def table_response(key, query = nil, *args)\n url = File.join(properties.primary_endpoints.table, *args)\n\n headers = build_headers(url, key, 'table')\n headers['Accept'] = 'application/json;odata=fullmetadata'\n\n # Must happen after headers are built\n unless query.nil? || query.empty?\n url << \"?#{query}\"\n end\n\n ArmrestService.send(\n :rest_get,\n :url => url,\n :headers => headers,\n :proxy => configuration.proxy,\n :ssl_version => configuration.ssl_version,\n :ssl_verify => configuration.ssl_verify,\n :timeout => configuration.timeout\n )\n end","title":""},{"docid":"2173f1433e7f0b1af82691e73c996807","score":"0.529272","text":"def select2\n # find by name\n @component_models = ComponentModel.search(params[\"q\"])\n\n respond_to do |format|\n #format.html # index.html.erb\n format.json { render json: { items: component_models.map(&:select2_json) }}\n end\n end","title":""},{"docid":"f4c657426693d7353a8c8927e8b8a3a3","score":"0.5291514","text":"def get_card_tables\n tables = CardTable.where(board_id: params[:id]).order(:column_index)\n render json: tables\n return\n end","title":""},{"docid":"837bb037ae1f86bbeeb845617bb1eab2","score":"0.52805513","text":"def show\n @scat2 = Scat2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scat2 }\n end\n end","title":""},{"docid":"07d96c1766932f52920ae2f11bc2ba5b","score":"0.52733713","text":"def show\n @table = Table.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table }\n end\n end","title":""},{"docid":"07d96c1766932f52920ae2f11bc2ba5b","score":"0.52733713","text":"def show\n @table = Table.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table }\n end\n end","title":""},{"docid":"617e5e82bf84a1948ca7397a5876441c","score":"0.5273173","text":"def index\n tables = @connection.tables\n data = {message: \"Listing tables in database\", data: tables}\n render :json => {status: 200, data: data}\n end","title":""},{"docid":"bab2ae180c0d52fb52329ddada529b55","score":"0.5266369","text":"def index\n @note2s = Note2.all\n end","title":""},{"docid":"73f9a948aacbd9b9c5e5e6cf66c2be1c","score":"0.5241017","text":"def index\n @events2s = Events2.all\n end","title":""},{"docid":"79c6369a600b5059723dfb0299d37672","score":"0.52274364","text":"def show\n @new_table = NewTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @new_table }\n end\n end","title":""},{"docid":"cef849748b5112250f4c4175c233d6d2","score":"0.52180874","text":"def show\n @eventos2 = Eventos2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @eventos2 }\n end\n end","title":""},{"docid":"5270bb957a4a425f6ec6a1ad731d7509","score":"0.52014935","text":"def getrow\n if ActiveRecord::Base.connection.tables.include? params[:table]\n table = params[:table].classify.constantize\n row = table.find(params[:row])\n render json: row, status: :ok\n else\n error = {Response: \"Table does not exist\"}\n render json: error, status: :not_found\n end\n end","title":""},{"docid":"2997cbfdf9d5771f5cdce841ab2b6fcc","score":"0.5198823","text":"def get_table(table_name)\r\n raise WAZ::Tables::InvalidTableName, table_name unless WAZ::Storage::ValidationRules.valid_table_name?(table_name) \r\n \r\n begin\r\n content = execute :get, \"Tables('#{table_name}')\", {}, default_headers\r\n doc = REXML::Document.new(content)\r\n item = REXML::XPath.first(doc, \"entry\")\r\n return { :name => REXML::XPath.first(item.elements['content'], \"m:properties/d:TableName\", {\"m\" => DATASERVICES_METADATA_NAMESPACE, \"d\" => DATASERVICES_NAMESPACE}).text,\r\n :url => REXML::XPath.first(item, \"id\").text }\r\n rescue RestClient::ResourceNotFound\r\n raise WAZ::Tables::TableDoesNotExist, table_name if $!.http_code == 404\r\n end \r\n end","title":""},{"docid":"f6e96ad2e809a7b7660de7437b236895","score":"0.5181518","text":"def index\n @rice2s = Rice2.all\n end","title":""},{"docid":"46415f44802d6144c47f7a979cb13479","score":"0.5180784","text":"def index\n @scene2s = Scene2.all\n end","title":""},{"docid":"b425ee62540285c175fb203c6703c739","score":"0.517673","text":"def index\n @tables = Table.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tables }\n end\n end","title":""},{"docid":"ca7fc7496759a427a9d1bb65ca420231","score":"0.51715076","text":"def index\n @todo_list2s = TodoList2.all\n end","title":""},{"docid":"ecdb18f73825010f81ea92464e32c19e","score":"0.51706535","text":"def show\n @events2 = Events2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @events2 }\n end\n end","title":""},{"docid":"4f09fa7bc3388c4b49801520dc741e1d","score":"0.51601714","text":"def index\n @timetable_u = TimetableUnit.where timetable_id:params['timetable_id']\n\n respond_to do |format|\n format.html\n format.json { render :json => @timetable_u }\n end\n end","title":""},{"docid":"040505dec50f4986e71c97e1da6f7ca5","score":"0.51587695","text":"def show\n @allTbles = Getdatum.find_by_sql(\"show tables\")\n puts @allTbles.class\n @allTbles=@allTbles.to_json\n @allTbles=JSON.parse @allTbles\n puts \"-----#{@allTbles.class}----\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @allTables }\n end\n end","title":""},{"docid":"c42c57edd9516ad0dec2917f194cb93f","score":"0.51471275","text":"def index\n @database1s = Database1.all\n @server_options = Server.all.map{|u| [ u.server_name, u.id ] }\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @database1s }\n end\n end","title":""},{"docid":"49bad1b4f6ca41456c555abe3d7171b2","score":"0.51357734","text":"def index\n @dummy2s = Dummy2.all\n end","title":""},{"docid":"5e08314081b28524441c1e4a3672864e","score":"0.51327735","text":"def update\n respond_to do |format|\n if @table1_copy2.update(table1_copy2_params)\n format.html { redirect_to @table1_copy2, notice: 'Table1 copy2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @table1_copy2 }\n else\n format.html { render :edit }\n format.json { render json: @table1_copy2.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"e3b28ff4ab8a5d8592b4bbb861232f58","score":"0.51306146","text":"def table\n @nodes = current_user.nodes.order('updated_at DESC')\n respond_to do |format|\n format.html { render partial: \"table\"}\n format.json { render json: @nodes }\n end\n end","title":""},{"docid":"ada6dc2ad9495da19a322e6ac5f9a1da","score":"0.5128225","text":"def show\n @call2 = Call2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @call2 }\n end\n end","title":""},{"docid":"9593216e0f85e571f48fcb98a7f1ace2","score":"0.5127409","text":"def get_list_using_get2(opts = {})\n data, _status_code, _headers = get_list_using_get2_with_http_info(opts)\n data\n end","title":""},{"docid":"9593216e0f85e571f48fcb98a7f1ace2","score":"0.5127409","text":"def get_list_using_get2(opts = {})\n data, _status_code, _headers = get_list_using_get2_with_http_info(opts)\n data\n end","title":""},{"docid":"f3789136f605b3850b6473c8efb93b1c","score":"0.51033455","text":"def show\n @database1 = Database1.find(params[:id])\n @server_options = Server.all.map{|u| [ u.server_name, u.id ] }\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @database1 }\n end\n end","title":""},{"docid":"c0250e868eadb9b722412eca486c9407","score":"0.50993484","text":"def index\n @secondaries = Secondary.all\n end","title":""},{"docid":"f2b1cfb31f16ce773adf230109f9f22c","score":"0.5098249","text":"def indexTo\n oneUser = User.find(params[:id])\n render json: oneUser.obligations\n end","title":""},{"docid":"5037ea414fdca36fc2dfb5b59fd9b186","score":"0.50906116","text":"def show\n @lab2 = Lab2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab2 }\n end\n end","title":""},{"docid":"c4b79ccd8063c39c11656dce16d5c49d","score":"0.50893474","text":"def index\n @joint2s = Joint2.all\n end","title":""},{"docid":"c04fc2f07db312044c2f0071d0148dad","score":"0.5088436","text":"def show\n if (params[:redirect] == \"sql2\")\n sql = <<-SQL\n with src AS (SELECT *, daughters(ear_num), ai_logs(ear_num) \n FROM kine WHERE id = #{params[:id]})\n select json_agg(src) FROM src;\n SQL\n render json: ActiveRecord::Base.connection.select_value(sql)\n end \n end","title":""},{"docid":"e767c3e6b611ec031f87c12cad882cef","score":"0.50830364","text":"def show\n @table_reservation = TableReservation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table_reservation }\n end\n end","title":""},{"docid":"cc99dcd9280208eb42f4021f0f67c0c1","score":"0.5072504","text":"def create\n @table1 = Table1.new(params[:table1])\n\n respond_to do |format|\n if @table1.save\n format.html { redirect_to @table1, notice: 'Table1 was successfully created.' }\n format.json { render json: @table1, status: :created, location: @table1 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @table1.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"d305caaa85a027ef4ae235650354728f","score":"0.5068171","text":"def index\n @pins2s = Pins2.all\n end","title":""},{"docid":"1fc66f57fb1b58a35de9416dfb397847","score":"0.5060621","text":"def table1_params\n params.fetch(:table1, {})\n end","title":""},{"docid":"ecf85677413d65541d0341088e0a9f4a","score":"0.50527626","text":"def show\n @time_table = TimeTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @time_table }\n end\n end","title":""},{"docid":"6f63fbae75f98c36df8a7052d3b1f267","score":"0.5048749","text":"def index\n @mnproduct2s = Mnproduct2.all\n end","title":""},{"docid":"8240e1f036fb569e17279e5126105f6e","score":"0.50471276","text":"def show\n @lineitem2 = Lineitem2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lineitem2 }\n end\n end","title":""},{"docid":"a09a13584b10191e04a9ee3ca0a59bff","score":"0.503984","text":"def index2\n\n\tend","title":""},{"docid":"fc5c98ea9eb5f1b7d3213473dcfd217f","score":"0.50384843","text":"def index\n @supply2s = Supply2.all\n end","title":""},{"docid":"8fc3e8d97265bcd550f4acb743e299e4","score":"0.50281143","text":"def index\n @prof2s = Prof2.all\n end","title":""},{"docid":"6a0bcc299615366c5235ebab8db7b332","score":"0.50236994","text":"def show\n @jimbo2 = Jimbo2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jimbo2 }\n end\n end","title":""},{"docid":"52f3765338ebc1a3617440d030bc546b","score":"0.5020325","text":"def indexAPI\n obj = {}\n @links = Yum.order('created_at desc')\n unless params[:offset].nil?\n @links = @links.offset(params[:offset].to_i)\n end\n unless params[:limit].nil?\n @links = @links.limit(params[:limit].to_i)\n end\n obj[:data] = @links.map{|y| y.api2}\n respond_to do |format|\n format.json {render :json => obj.to_json}\n end\n end","title":""},{"docid":"1228db23ba1020de257f4ae3e0604bfa","score":"0.50175965","text":"def index\n @one_table_templates =\n @one_table.\n one_table_templates.\n by_user(current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @one_table_templates }\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"f4f2306617a0e49e577289832716c28c\",\n \"score\": \"0.6591401\",\n \"text\": \"def new\\n @table2 = Table2.new\\n\\n respond_to do |format|\\n format.html # new.html.erb\\n format.json { render json: @table2 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5ce52391084eeb96a8013183d8dda9ff\",\n \"score\": \"0.65425974\",\n \"text\": \"def show\\n @table1 = Table1.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @table1 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"abdb02274b5b106777dc9ad0df55b977\",\n \"score\": \"0.6339199\",\n \"text\": \"def create\\n @table2 = Table2.new(params[:table2])\\n\\n respond_to do |format|\\n if @table2.save\\n format.html { redirect_to @table2, notice: 'Table2 was successfully created.' }\\n format.json { render json: @table2, status: :created, location: @table2 }\\n else\\n format.html { render action: \\\"new\\\" }\\n format.json { render json: @table2.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7e54310a7ac7c5f1407793f13dd324d\",\n \"score\": \"0.60557795\",\n \"text\": \"def update\\n @table2 = Table2.find(params[:id])\\n\\n respond_to do |format|\\n if @table2.update_attributes(params[:table2])\\n format.html { redirect_to @table2, notice: 'Table2 was successfully updated.' }\\n format.json { head :no_content }\\n else\\n format.html { render action: \\\"edit\\\" }\\n format.json { render json: @table2.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"16b458bd2f01592b86b89e9a13f7cf8b\",\n \"score\": \"0.60480565\",\n \"text\": \"def destroy\\n @table2 = Table2.find(params[:id])\\n @table2.destroy\\n\\n respond_to do |format|\\n format.html { redirect_to table2s_url }\\n format.json { head :no_content }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"02ddb7f3b32a45375d455bf3e951c7da\",\n \"score\": \"0.60210097\",\n \"text\": \"def index\\n @user2s = User2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bf1749034e2af3a3b7245c26657f4608\",\n \"score\": \"0.5974068\",\n \"text\": \"def table(instance_name, table_name)\\n get_json(table_endpoint(instance_name, table_name))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c91f41a4b3a4fd703d9a12af49fa7b9c\",\n \"score\": \"0.5921724\",\n \"text\": \"def index\\n #@category2s = Category2.all\\n\\n @category1 = Category1.find(params[:category1_id])\\n @category2 = @category1.category2s.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: [@category1, @category2] }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"24cdd5bf5fad1982115ac92038f63c6f\",\n \"score\": \"0.58977914\",\n \"text\": \"def index\\n @person2s = Person2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5f4ac13fd34dc191d62429708711de2b\",\n \"score\": \"0.5871805\",\n \"text\": \"def index\\n @example2s = Example2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fd469b61ec674b2dd6c1126fcbc77145\",\n \"score\": \"0.58204156\",\n \"text\": \"def index\\n @l2 = L2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"68c1620c2640f46f555423bc92e6c74f\",\n \"score\": \"0.57912856\",\n \"text\": \"def tables(instance_name)\\n get_json(tables_endpoint(instance_name))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"508f515de6928d31f3cbb4f65061f9ef\",\n \"score\": \"0.5753385\",\n \"text\": \"def index\\n @product2s = Product2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df6c0ea9d6e1f4d764ffadd1623d0730\",\n \"score\": \"0.5749565\",\n \"text\": \"def index\\n @table1_copy2s = Table1Copy2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d55ee08146affe4fe7a9dcd935222f3\",\n \"score\": \"0.574924\",\n \"text\": \"def index\\n @ticket2s = Ticket2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"82b2f749366b7ad05edfe1d1662526dd\",\n \"score\": \"0.5749168\",\n \"text\": \"def index\\n @network2s = Network2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0734c936fe2c2662ddd50e54e1f28128\",\n \"score\": \"0.57429105\",\n \"text\": \"def index\\n @employee2s = Employee2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8a151004d074854ee07b27b1525230d5\",\n \"score\": \"0.5734882\",\n \"text\": \"def fetch_table\\n self.class.get('/premier-league/table')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c08d7588b668153a6aec4a3ceda5d66e\",\n \"score\": \"0.5705303\",\n \"text\": \"def index\\n @image2s = Image2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d216cfcfdd75ccdccb8ce3574e9a5d02\",\n \"score\": \"0.5702503\",\n \"text\": \"def set_table1_copy2\\n @table1_copy2 = Table1Copy2.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1556925408e329be7d403384332b8957\",\n \"score\": \"0.5660032\",\n \"text\": \"def new\\n @table1 = Table1.new\\n\\n respond_to do |format|\\n format.html # new.html.erb\\n format.json { render json: @table1 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6a837931c1367773e9e55d3a4cec8254\",\n \"score\": \"0.56451267\",\n \"text\": \"def index\\n @test2s = Test2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"98ad02e897bbf6bd53bd49fbc8c29bab\",\n \"score\": \"0.5587844\",\n \"text\": \"def index\\n @start2s = Start2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"168c9c7d62468ca77be309624a4b5d99\",\n \"score\": \"0.5586392\",\n \"text\": \"def os2_table\\n @os2_table ||= TTFunk::Table::OS2.encode(original.os2, subset)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5bbf5a6dbadf765c4842ce3a7ba43202\",\n \"score\": \"0.55613333\",\n \"text\": \"def set_table1\\n @table1 = Table1.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8c392c8402f7bc5eb441882ef587efa5\",\n \"score\": \"0.5551566\",\n \"text\": \"def index\\n @table1s = Table1.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c61af28186346db48ff6c48bc42da2b8\",\n \"score\": \"0.55358577\",\n \"text\": \"def index\\n @scat2s = Scat2.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @scat2s }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d806b7796906fab0fc2dd959687aa969\",\n \"score\": \"0.5534007\",\n \"text\": \"def index\\n @p2s = P2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b1b7fc9b522d33a406eb33c839959e52\",\n \"score\": \"0.55337185\",\n \"text\": \"def show\\n @category1 = Category1.find(params[:category1_id])\\n\\n @category2 = @category1.category2s.find(params[:id])\\n \\n\\n #@category2 = Category2.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @category2 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7b66142d8617536cfec1fc6eee904d68\",\n \"score\": \"0.55178416\",\n \"text\": \"def get_table_json\\n url = @driver.current_url\\n table_id = url.split('/').last\\n response = @client.table(table_id)[\\\"table\\\"]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"84345ecf6bad8d9ab770a0cd08bb78ca\",\n \"score\": \"0.54941803\",\n \"text\": \"def index\\n @tipo2s = Tipo2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c741d6d590c646bd5399ac2ecee75f46\",\n \"score\": \"0.54843915\",\n \"text\": \"def love2(api_version: API_VERSION)\\n {\\n name: \\\"Operations::Two.love2\\\",\\n path: \\\"/providers/operations/2?api-version=#{api_version}&\\\",\\n method: :get\\n }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"de6c8e2a02f9d1e028a5b111167dc641\",\n \"score\": \"0.5441841\",\n \"text\": \"def index\\n @call2s = Call2.paginate(:page => params[:page])\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @call2s }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0e9d54b02d423623f6732b2137ea9f27\",\n \"score\": \"0.5439808\",\n \"text\": \"def index\\n @sp2s = Sp2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b84f65e487aa35249d0b2e012ebb099d\",\n \"score\": \"0.5432863\",\n \"text\": \"def index\\n @twos = Two.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b685ae787baf1da9ab2a8c8310acc30e\",\n \"score\": \"0.54238135\",\n \"text\": \"def show\\n @system_table = SystemTable.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @system_table }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d279ebaefdb1d9251fcac00b6fc13264\",\n \"score\": \"0.5403137\",\n \"text\": \"def index\\n @student2s = Student2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"29e18f500a464a017db2ef8f288dd84e\",\n \"score\": \"0.54020613\",\n \"text\": \"def show\\n @reservations_table = ReservationsTable.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @reservations_table }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"78315283beb0794512f6b572dfc4b69e\",\n \"score\": \"0.5397777\",\n \"text\": \"def show\\n if ActiveRecord::Base.connection.tables.include? params[:table]\\n table = params[:table].classify.constantize\\n render json: table.all, status: :ok\\n else\\n table = {Response: \\\"Table does not exist\\\"}\\n render json: table, status: :not_found\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"917542a959048ab40350e78512b58308\",\n \"score\": \"0.5390356\",\n \"text\": \"def show\\n # params[:id] is device id\\n @table = Table.find_by(device: params[:id])\\n render json: @table\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"78f9bc9e564f8849ea41c5748341ab2e\",\n \"score\": \"0.5383646\",\n \"text\": \"def index\\n @h2 = H2.all\\n @h2 = H2.search(params[:search], params[:page])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b82bc49329c52c15509d332d6335db98\",\n \"score\": \"0.5380892\",\n \"text\": \"def index\\n @rols = Rol.all\\n respond_to do | format |\\n format.html\\n format.json {\\n if params.has_key?(:type) && params[:type] == \\\"select2\\\"\\n render json: Rol.select2(params[:q])\\n end\\n }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2e1b07fec901877ad482c2ddc437eb5e\",\n \"score\": \"0.5379544\",\n \"text\": \"def table_response(key, query = nil, *args)\\n url = File.join(properties.primary_endpoints.table, *args)\\n\\n headers = build_headers(url, key, 'table')\\n headers['Accept'] = 'application/json;odata=fullmetadata'\\n\\n url << \\\"?#{query}\\\" if query # Must happen after headers are built\\n\\n ArmrestService.rest_get(\\n :url => url,\\n :headers => headers,\\n :proxy => proxy,\\n :ssl_version => ssl_version,\\n :ssl_verify => ssl_verify,\\n )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e5a3cde97bb827f0af69ef019d96fdb0\",\n \"score\": \"0.5376099\",\n \"text\": \"def index\\n @post2s = Post2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b8c6dec6807e0413289d624ab3e04be9\",\n \"score\": \"0.53563654\",\n \"text\": \"def get_call_1_2(url)\\n url = \\\"1.2/#{url}\\\"\\n response = connection.get(url) {|request| set_headers(request) }\\n parse_response(response)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"24feff34a2934ec2f27ed9e072e9a0b5\",\n \"score\": \"0.53538406\",\n \"text\": \"def show\\n rows = []\\n unless @connection.tables.include?(params[:id])\\n status = 403\\n data = {message: \\\"Table doesn't exist\\\"}\\n else\\n res = @connection.execute(\\\"DESC #{params[:id]};\\\") \\n status = 200\\n data = {message: \\\"Table found\\\"}\\n res.each(:as => :hash) {|ppp| rows << ppp}\\n end\\n render :json => {status: status, data: data.merge!(rows: rows)}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1e0eb68a5d3347f9de9937bb0b4c47d9\",\n \"score\": \"0.5337639\",\n \"text\": \"def index\\n @how2s = How2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"aa31cc782e8c36a7b6b5b01b9d14f607\",\n \"score\": \"0.53354156\",\n \"text\": \"def show\\n #@table = current_user.organization.tables.find(params[:id])\\n @table = Table.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @table }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"41d293dfa3012d8cfceb9c4845ab5e3d\",\n \"score\": \"0.5329617\",\n \"text\": \"def status2\\n response = @http.get(\\\"status2/\\\")\\n msg response, Logger::DEBUG\\n return response\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7f61c45e4572b088e745ab7608dc8176\",\n \"score\": \"0.53238684\",\n \"text\": \"def show\\n @oauth_table = OauthTable.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @oauth_table }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"030661e68426b8674367ee655a15b7c7\",\n \"score\": \"0.53230655\",\n \"text\": \"def idx2\\n\\t\\t\\treturn @idx2 if @idx2\\n\\t\\t\\traise FormatError, 'idx2 requested but no idx2 available' unless desc.list_index\\n\\t\\t\\t# should check this can't return nil\\n\\t\\t\\t@idx2 = desc.pst.load_idx2 desc.list_index\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"120f66b01a3c6166da21786867af0aec\",\n \"score\": \"0.5300705\",\n \"text\": \"def create\\n @table1_copy2 = Table1Copy2.new(table1_copy2_params)\\n\\n respond_to do |format|\\n if @table1_copy2.save\\n format.html { redirect_to @table1_copy2, notice: 'Table1 copy2 was successfully created.' }\\n format.json { render :show, status: :created, location: @table1_copy2 }\\n else\\n format.html { render :new }\\n format.json { render json: @table1_copy2.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"32a5299a7d57a6e47044147dc302330e\",\n \"score\": \"0.5295436\",\n \"text\": \"def index\\n @interpage2s = Interpage2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"684f1c57dd696d5c9fba479742b8970e\",\n \"score\": \"0.5293574\",\n \"text\": \"def index\\n @module2s = Module2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c42b62fd099bdb5b4447d81da6752dc3\",\n \"score\": \"0.5293059\",\n \"text\": \"def table_response(key, query = nil, *args)\\n url = File.join(properties.primary_endpoints.table, *args)\\n\\n headers = build_headers(url, key, 'table')\\n headers['Accept'] = 'application/json;odata=fullmetadata'\\n\\n # Must happen after headers are built\\n unless query.nil? || query.empty?\\n url << \\\"?#{query}\\\"\\n end\\n\\n ArmrestService.send(\\n :rest_get,\\n :url => url,\\n :headers => headers,\\n :proxy => configuration.proxy,\\n :ssl_version => configuration.ssl_version,\\n :ssl_verify => configuration.ssl_verify,\\n :timeout => configuration.timeout\\n )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2173f1433e7f0b1af82691e73c996807\",\n \"score\": \"0.529272\",\n \"text\": \"def select2\\n # find by name\\n @component_models = ComponentModel.search(params[\\\"q\\\"])\\n\\n respond_to do |format|\\n #format.html # index.html.erb\\n format.json { render json: { items: component_models.map(&:select2_json) }}\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f4c657426693d7353a8c8927e8b8a3a3\",\n \"score\": \"0.5291514\",\n \"text\": \"def get_card_tables\\n tables = CardTable.where(board_id: params[:id]).order(:column_index)\\n render json: tables\\n return\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"837bb037ae1f86bbeeb845617bb1eab2\",\n \"score\": \"0.52805513\",\n \"text\": \"def show\\n @scat2 = Scat2.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @scat2 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"07d96c1766932f52920ae2f11bc2ba5b\",\n \"score\": \"0.52733713\",\n \"text\": \"def show\\n @table = Table.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @table }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"07d96c1766932f52920ae2f11bc2ba5b\",\n \"score\": \"0.52733713\",\n \"text\": \"def show\\n @table = Table.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @table }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"617e5e82bf84a1948ca7397a5876441c\",\n \"score\": \"0.5273173\",\n \"text\": \"def index\\n tables = @connection.tables\\n data = {message: \\\"Listing tables in database\\\", data: tables}\\n render :json => {status: 200, data: data}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bab2ae180c0d52fb52329ddada529b55\",\n \"score\": \"0.5266369\",\n \"text\": \"def index\\n @note2s = Note2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"73f9a948aacbd9b9c5e5e6cf66c2be1c\",\n \"score\": \"0.5241017\",\n \"text\": \"def index\\n @events2s = Events2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"79c6369a600b5059723dfb0299d37672\",\n \"score\": \"0.52274364\",\n \"text\": \"def show\\n @new_table = NewTable.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render :json => @new_table }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cef849748b5112250f4c4175c233d6d2\",\n \"score\": \"0.52180874\",\n \"text\": \"def show\\n @eventos2 = Eventos2.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @eventos2 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5270bb957a4a425f6ec6a1ad731d7509\",\n \"score\": \"0.52014935\",\n \"text\": \"def getrow\\n if ActiveRecord::Base.connection.tables.include? params[:table]\\n table = params[:table].classify.constantize\\n row = table.find(params[:row])\\n render json: row, status: :ok\\n else\\n error = {Response: \\\"Table does not exist\\\"}\\n render json: error, status: :not_found\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2997cbfdf9d5771f5cdce841ab2b6fcc\",\n \"score\": \"0.5198823\",\n \"text\": \"def get_table(table_name)\\r\\n raise WAZ::Tables::InvalidTableName, table_name unless WAZ::Storage::ValidationRules.valid_table_name?(table_name) \\r\\n \\r\\n begin\\r\\n content = execute :get, \\\"Tables('#{table_name}')\\\", {}, default_headers\\r\\n doc = REXML::Document.new(content)\\r\\n item = REXML::XPath.first(doc, \\\"entry\\\")\\r\\n return { :name => REXML::XPath.first(item.elements['content'], \\\"m:properties/d:TableName\\\", {\\\"m\\\" => DATASERVICES_METADATA_NAMESPACE, \\\"d\\\" => DATASERVICES_NAMESPACE}).text,\\r\\n :url => REXML::XPath.first(item, \\\"id\\\").text }\\r\\n rescue RestClient::ResourceNotFound\\r\\n raise WAZ::Tables::TableDoesNotExist, table_name if $!.http_code == 404\\r\\n end \\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f6e96ad2e809a7b7660de7437b236895\",\n \"score\": \"0.5181518\",\n \"text\": \"def index\\n @rice2s = Rice2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"46415f44802d6144c47f7a979cb13479\",\n \"score\": \"0.5180784\",\n \"text\": \"def index\\n @scene2s = Scene2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b425ee62540285c175fb203c6703c739\",\n \"score\": \"0.517673\",\n \"text\": \"def index\\n @tables = Table.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @tables }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ca7fc7496759a427a9d1bb65ca420231\",\n \"score\": \"0.51715076\",\n \"text\": \"def index\\n @todo_list2s = TodoList2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ecdb18f73825010f81ea92464e32c19e\",\n \"score\": \"0.51706535\",\n \"text\": \"def show\\n @events2 = Events2.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @events2 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4f09fa7bc3388c4b49801520dc741e1d\",\n \"score\": \"0.51601714\",\n \"text\": \"def index\\n @timetable_u = TimetableUnit.where timetable_id:params['timetable_id']\\n\\n respond_to do |format|\\n format.html\\n format.json { render :json => @timetable_u }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"040505dec50f4986e71c97e1da6f7ca5\",\n \"score\": \"0.51587695\",\n \"text\": \"def show\\n @allTbles = Getdatum.find_by_sql(\\\"show tables\\\")\\n puts @allTbles.class\\n @allTbles=@allTbles.to_json\\n @allTbles=JSON.parse @allTbles\\n puts \\\"-----#{@allTbles.class}----\\\"\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @allTables }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c42c57edd9516ad0dec2917f194cb93f\",\n \"score\": \"0.51471275\",\n \"text\": \"def index\\n @database1s = Database1.all\\n @server_options = Server.all.map{|u| [ u.server_name, u.id ] }\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @database1s }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"49bad1b4f6ca41456c555abe3d7171b2\",\n \"score\": \"0.51357734\",\n \"text\": \"def index\\n @dummy2s = Dummy2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5e08314081b28524441c1e4a3672864e\",\n \"score\": \"0.51327735\",\n \"text\": \"def update\\n respond_to do |format|\\n if @table1_copy2.update(table1_copy2_params)\\n format.html { redirect_to @table1_copy2, notice: 'Table1 copy2 was successfully updated.' }\\n format.json { render :show, status: :ok, location: @table1_copy2 }\\n else\\n format.html { render :edit }\\n format.json { render json: @table1_copy2.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e3b28ff4ab8a5d8592b4bbb861232f58\",\n \"score\": \"0.51306146\",\n \"text\": \"def table\\n @nodes = current_user.nodes.order('updated_at DESC')\\n respond_to do |format|\\n format.html { render partial: \\\"table\\\"}\\n format.json { render json: @nodes }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ada6dc2ad9495da19a322e6ac5f9a1da\",\n \"score\": \"0.5128225\",\n \"text\": \"def show\\n @call2 = Call2.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @call2 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9593216e0f85e571f48fcb98a7f1ace2\",\n \"score\": \"0.5127409\",\n \"text\": \"def get_list_using_get2(opts = {})\\n data, _status_code, _headers = get_list_using_get2_with_http_info(opts)\\n data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9593216e0f85e571f48fcb98a7f1ace2\",\n \"score\": \"0.5127409\",\n \"text\": \"def get_list_using_get2(opts = {})\\n data, _status_code, _headers = get_list_using_get2_with_http_info(opts)\\n data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f3789136f605b3850b6473c8efb93b1c\",\n \"score\": \"0.51033455\",\n \"text\": \"def show\\n @database1 = Database1.find(params[:id])\\n @server_options = Server.all.map{|u| [ u.server_name, u.id ] }\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @database1 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c0250e868eadb9b722412eca486c9407\",\n \"score\": \"0.50993484\",\n \"text\": \"def index\\n @secondaries = Secondary.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f2b1cfb31f16ce773adf230109f9f22c\",\n \"score\": \"0.5098249\",\n \"text\": \"def indexTo\\n oneUser = User.find(params[:id])\\n render json: oneUser.obligations\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5037ea414fdca36fc2dfb5b59fd9b186\",\n \"score\": \"0.50906116\",\n \"text\": \"def show\\n @lab2 = Lab2.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @lab2 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c4b79ccd8063c39c11656dce16d5c49d\",\n \"score\": \"0.50893474\",\n \"text\": \"def index\\n @joint2s = Joint2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c04fc2f07db312044c2f0071d0148dad\",\n \"score\": \"0.5088436\",\n \"text\": \"def show\\n if (params[:redirect] == \\\"sql2\\\")\\n sql = <<-SQL\\n with src AS (SELECT *, daughters(ear_num), ai_logs(ear_num) \\n FROM kine WHERE id = #{params[:id]})\\n select json_agg(src) FROM src;\\n SQL\\n render json: ActiveRecord::Base.connection.select_value(sql)\\n end \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e767c3e6b611ec031f87c12cad882cef\",\n \"score\": \"0.50830364\",\n \"text\": \"def show\\n @table_reservation = TableReservation.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @table_reservation }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cc99dcd9280208eb42f4021f0f67c0c1\",\n \"score\": \"0.5072504\",\n \"text\": \"def create\\n @table1 = Table1.new(params[:table1])\\n\\n respond_to do |format|\\n if @table1.save\\n format.html { redirect_to @table1, notice: 'Table1 was successfully created.' }\\n format.json { render json: @table1, status: :created, location: @table1 }\\n else\\n format.html { render action: \\\"new\\\" }\\n format.json { render json: @table1.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d305caaa85a027ef4ae235650354728f\",\n \"score\": \"0.5068171\",\n \"text\": \"def index\\n @pins2s = Pins2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1fc66f57fb1b58a35de9416dfb397847\",\n \"score\": \"0.5060621\",\n \"text\": \"def table1_params\\n params.fetch(:table1, {})\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ecf85677413d65541d0341088e0a9f4a\",\n \"score\": \"0.50527626\",\n \"text\": \"def show\\n @time_table = TimeTable.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @time_table }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6f63fbae75f98c36df8a7052d3b1f267\",\n \"score\": \"0.5048749\",\n \"text\": \"def index\\n @mnproduct2s = Mnproduct2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8240e1f036fb569e17279e5126105f6e\",\n \"score\": \"0.50471276\",\n \"text\": \"def show\\n @lineitem2 = Lineitem2.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @lineitem2 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a09a13584b10191e04a9ee3ca0a59bff\",\n \"score\": \"0.503984\",\n \"text\": \"def index2\\n\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc5c98ea9eb5f1b7d3213473dcfd217f\",\n \"score\": \"0.50384843\",\n \"text\": \"def index\\n @supply2s = Supply2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8fc3e8d97265bcd550f4acb743e299e4\",\n \"score\": \"0.50281143\",\n \"text\": \"def index\\n @prof2s = Prof2.all\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6a0bcc299615366c5235ebab8db7b332\",\n \"score\": \"0.50236994\",\n \"text\": \"def show\\n @jimbo2 = Jimbo2.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.json { render json: @jimbo2 }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"52f3765338ebc1a3617440d030bc546b\",\n \"score\": \"0.5020325\",\n \"text\": \"def indexAPI\\n obj = {}\\n @links = Yum.order('created_at desc')\\n unless params[:offset].nil?\\n @links = @links.offset(params[:offset].to_i)\\n end\\n unless params[:limit].nil?\\n @links = @links.limit(params[:limit].to_i)\\n end\\n obj[:data] = @links.map{|y| y.api2}\\n respond_to do |format|\\n format.json {render :json => obj.to_json}\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1228db23ba1020de257f4ae3e0604bfa\",\n \"score\": \"0.50175965\",\n \"text\": \"def index\\n @one_table_templates =\\n @one_table.\\n one_table_templates.\\n by_user(current_user)\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.json { render json: @one_table_templates }\\n end\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":188,"cells":{"query_id":{"kind":"string","value":"357584be4aee13c11b85987b8bbe849a"},"query":{"kind":"string","value":"GET /besoin_humains/1 GET /besoin_humains/1.xml"},"positive_passages":{"kind":"list like","value":[{"docid":"169bcdc39f5960d2fbfc5a492d72f49f","score":"0.7421528","text":"def show\n @besoin_humain = BesoinHumain.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @besoin_humain.to_xml }\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"169bcdc39f5960d2fbfc5a492d72f49f\",\n \"score\": \"0.7421528\",\n \"text\": \"def show\\n @besoin_humain = BesoinHumain.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.rhtml\\n format.xml { render :xml => @besoin_humain.to_xml }\\n end\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"1945816b31552af5fa3d6fb25d2c592d","score":"0.71307397","text":"def index\n @besoin_humains = @association.besoin_humains\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @besoin_humains.to_xml }\n end\n end","title":""},{"docid":"6ab3d31683c4571429411b3c397a6fd0","score":"0.6390383","text":"def show\n @indice_bh = IndiceBh.find(params[:id])\n\n respond_to do |format|\n format.html #show.html.erb\n format.xml { render :xml => @indice_bh }\n end\n end","title":""},{"docid":"c05e4c97397b758d7980a113f73c1f92","score":"0.625153","text":"def show\n @bulto = Bulto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bulto }\n end\n end","title":""},{"docid":"335af38450949289c4daafd278e768be","score":"0.6220411","text":"def show\n @historial = Historial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historial }\n end\n end","title":""},{"docid":"4dc928115c1bb526f5b224f658c184d7","score":"0.6202131","text":"def show\n @bolsista = Bolsista.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bolsista }\n end\n end","title":""},{"docid":"44b85edaaa9b5d34825511032eacf7ab","score":"0.6198346","text":"def show\n @bonuse = Bonuse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bonuse }\n end\n end","title":""},{"docid":"378a49fb5e8e95e0dc7bf0320beacb7d","score":"0.6188105","text":"def show\n @buchung = Buchung.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @buchung }\n end\n end","title":""},{"docid":"caccf00160b891d0598885f83ab34c34","score":"0.6176122","text":"def show\n @bout = Bout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bout }\n end\n end","title":""},{"docid":"fa44550a237acee51250dc9e30a40347","score":"0.6174687","text":"def show\n @histoire = Histoire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @histoire }\n end\n end","title":""},{"docid":"6e32a3c20e28c556c334bcf5cc829af8","score":"0.61714804","text":"def show\n @observacao_historico = ObservacaoHistorico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @observacao_historico }\n end\n end","title":""},{"docid":"76d6b3a5af6a8563645823d3a05491c5","score":"0.6164249","text":"def show\n @historia = Historia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historia }\n end\n end","title":""},{"docid":"cba2fbcfe1543d1040cd672be9d62282","score":"0.6098534","text":"def show\n @hub = Hub.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hub }\n end\n end","title":""},{"docid":"b2069cc1c3a228f7167cb5be372a1d96","score":"0.6054227","text":"def show\n @historique = Historique.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historique }\n end\n end","title":""},{"docid":"d57f45020b623bbb06394bb5ef3c40d4","score":"0.60530055","text":"def show\n @microhood = Microhood.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @microhood }\n end\n end","title":""},{"docid":"228ca8b2bbe73248867fad973042dc40","score":"0.6049336","text":"def show\n @historico = Historico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historico }\n end\n end","title":""},{"docid":"c227096c3d3738fcf8d6b1f26c0cedf8","score":"0.60327697","text":"def index\n @boletos = Boleto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @boletos }\n end\n end","title":""},{"docid":"5fa86d4475a4ee00fe1afd59185b091f","score":"0.6031209","text":"def index\n @detalle_recibo_habers = @recibo_sueldo.detalle_recibo_habers.all\n\n respond_to do |format|\n format.html # indexoo.html.erb\n format.xml { render :xml => @detalle_recibo_habers }\n end\n end","title":""},{"docid":"a378256ce3d6338af7180ff544f22b3c","score":"0.6029877","text":"def xml_report\n RestClient::get \"#{@base}/OTHER/core/other/xmlreport/\"\n end","title":""},{"docid":"74f828af558de07addb7d55072e13ee9","score":"0.60107636","text":"def show\n @tumbon = Tumbon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tumbon }\n end\n end","title":""},{"docid":"5287660ffc1da7d33d5de8abe3f2ebbf","score":"0.6010245","text":"def xml_report\n RestClient::get \"#{base}/OTHER/core/other/xmlreport/\"\n end","title":""},{"docid":"168585988a4edab73a6516929a20fd86","score":"0.5991359","text":"def index\n @ubications = Ubication.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ubications }\n end\n end","title":""},{"docid":"dd169fc7aec3180c98dc339cd960891e","score":"0.59766173","text":"def show\n @outfit = Outfit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @outfit }\n end\n end","title":""},{"docid":"bcaf62b20115f596dfe3f3b14828ccc0","score":"0.5973328","text":"def show\n @historial_peso = HistorialPeso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historial_peso }\n end\n end","title":""},{"docid":"0b282a72b3d1f0df6c1f11ae2a5e8066","score":"0.5970103","text":"def index\n @bilans = Bilan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bilans }\n end\n end","title":""},{"docid":"9d6c6fa966acdc838ad4716eff80f185","score":"0.5960725","text":"def show\n @web_bus = WebBus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @web_bus }\n end\n end","title":""},{"docid":"2b25f521dc431739d38a1a4306a91cd5","score":"0.5950924","text":"def show\n @bb = Bb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bb }\n end\n end","title":""},{"docid":"f8ff0ba90f6de30bd32ca6f773b88a04","score":"0.5942832","text":"def show\n @briefing = Briefing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @briefing }\n end\n end","title":""},{"docid":"3f1691e3f406716bcb72e675e33593cd","score":"0.5939988","text":"def get_xml_data(startat_value)\n puts \"getting xml data\"\n url = \"#{BASE_URL}?#{SEARCH_CONDITIONS}#{startat_value}\"\n Net::HTTP.get_response(URI.parse(url)).body\nend","title":""},{"docid":"2d4de694a3e8b5723db4ca574492d433","score":"0.59384257","text":"def show\n @ubication = Ubication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ubication }\n end\n end","title":""},{"docid":"8a18a98b9883e3c4a5aa030465673d87","score":"0.59342885","text":"def show\n @obv = Obv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @obv }\n end\n end","title":""},{"docid":"0e6615260e77cfdd20c3411f307827a3","score":"0.5922698","text":"def show\n @boat_weight = BoatWeight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @boat_weight }\n end\n end","title":""},{"docid":"8fb542494a33ebc65c68d68d22f3260b","score":"0.5912586","text":"def show\n @bloodtest = Bloodtest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bloodtest }\n end\n end","title":""},{"docid":"b1bfa6e5ba9cca6a062b5a933adb92a7","score":"0.59119934","text":"def show\n @hoge = Hoge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hoge }\n end\n end","title":""},{"docid":"a596eb5ee0d88f6e3f20e43df889e2e1","score":"0.5911512","text":"def show\n\t\t@bpay = Bpay.find(params[:id])\n \trespond_to do |format|\t\t\n \t\t format.html \n \t\t\tformat.xml { render :xml => @bpays }\t\t#Render to XML File\n \tend\n\tend","title":""},{"docid":"300fd54d4dbe4c53bd70d8be8dd3987e","score":"0.59082466","text":"def show\n @horary = Horary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @horary }\n end\n end","title":""},{"docid":"211ae98b750120f5bb5b04ed9bccb094","score":"0.59035826","text":"def url\n \"http://www.bom.gov.au/#{self.abbreviation}/observations/#{self.abbreviation}all.shtml\"\n end","title":""},{"docid":"e3b30c0cceac8fbb7ab9b36b8826c028","score":"0.5900591","text":"def show\n @bp_electronic_economic = BpElectronicEconomic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bp_electronic_economic }\n end\n end","title":""},{"docid":"2b326702578a73c9dee640ace49b3a38","score":"0.5896123","text":"def show\n @sisben = Sisben.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sisben }\n end\n end","title":""},{"docid":"c8dd31bff2a111e8bf6a809c691026e7","score":"0.5895407","text":"def show\n @ubicacione = Ubicacione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ubicacione }\n end\n end","title":""},{"docid":"0d784e792ab10eda1c418c9d67a99d3f","score":"0.5890648","text":"def show\n @hap = Hap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hap }\n end\n end","title":""},{"docid":"e7619e6adac8fbea6222a30db984355a","score":"0.5889715","text":"def show\n @soon = Soon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @soon }\n end\n end","title":""},{"docid":"839f1b0b708ec6a562506362ef1f9b6b","score":"0.5879437","text":"def index\n @buses = Bus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @buses }\n end\n end","title":""},{"docid":"800021153c16120235dee7906f58d5f6","score":"0.5878589","text":"def show\n @boleto = Boleto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @boleto }\n end\n end","title":""},{"docid":"f8da309e303e5700359b0ea4318e1a98","score":"0.58764994","text":"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @health_insurance }\n end\n end","title":""},{"docid":"ff2b9be113976dbb9b73df2c2f7fd4bd","score":"0.5876117","text":"def index\n @brokers = @habitat.brokers.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @brokers.to_xml }\n end\n end","title":""},{"docid":"61380a0365b8cdce2500ebe986c32622","score":"0.58750665","text":"def show\n @brinde = Brinde.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @brinde }\n end\n end","title":""},{"docid":"c6ed2d571d349813bbf0b8cd698c411d","score":"0.5858837","text":"def show\n @beak = Beak.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @beak }\n end\n end","title":""},{"docid":"27519824b67207bccfba0de28d5b2919","score":"0.58581764","text":"def url; \"http://localhost:3000/sdn.xml\"; end","title":""},{"docid":"067f5d1783407d4b1aba4532ec3ebd6c","score":"0.5857449","text":"def index\n @offres = Offre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @offres }\n end\n end","title":""},{"docid":"0e9b89b24c1c28d62f7232a7b531c9f6","score":"0.58553195","text":"def show\n @bdhogaresbienestar = Bdhogaresbienestar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bdhogaresbienestar }\n end\n end","title":""},{"docid":"0760cc2b597f72c3e8368afd6600ba72","score":"0.5851272","text":"def show\n @detalle_recibo_haber = @recibo_sueldo.detalle_recibo_habers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @detalle_recibo_haber }\n end\n end","title":""},{"docid":"77170bcae77f6e24d1afa75b5c3c338a","score":"0.58434254","text":"def show\n @tiibb = Tiibb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tiibb }\n end\n end","title":""},{"docid":"adfeb1e5d8b1dd440be72780ca9a9b99","score":"0.5840596","text":"def show\n @ensembl = HTTParty.get('http://rest.ensembl.org' + '/lookup/id/' + @abundance.target_id[/[^.]+/],\n :headers =>{'Content-Type' => 'application/json'} )\n if @ensembl[\"display_name\"].nil? \n @name = \"1\"\n else\n @name = @ensembl[\"display_name\"][0..-5]\n\n @wikis = HTTParty.get('https://webservice.wikipathways.org/findPathwaysByText?query=' + @name + '&species=homo+sapiens&format=json',\n :headers =>{'Content-Type' => 'application/json'} )\n\n @pubs = HTTParty.get('https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&retmode=json&term='+ @name,\n :headers =>{'Content-Type' => 'application/json'} )\n \n @omim = HTTParty.get('https://api.omim.org/api/entry/search?search='+ @name+ '&start=0&limit=1&include=text:description&apiKey=6-p06gbQTZiAWNOpPn-CSw&format=xml',:headers =>{'Content-Type' => 'application/xml'} )\n \n \n\n end\nend","title":""},{"docid":"9e3c05d62b4f1909b72e2180c6df4b95","score":"0.58400345","text":"def show\n @abono = Abono.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @abono }\n end\n end","title":""},{"docid":"0ec68b61c44024a62ab709a97992dc1f","score":"0.5831294","text":"def index\n @bands = Band.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bands }\n end\n end","title":""},{"docid":"5fd6d2bf4ef7c9dfe3a4ac8afee442e2","score":"0.58244467","text":"def get\n @xml = @paths.map { |path|\n puts \"GET\\t#{@host + path}\"\n RestClient.get(@host + path) { |response, request, result|\n puts \"RESPONSE #{response.code}\"\n response.body\n }\n }.map { |response|\n Nokogiri::XML(response).xpath(\"/*\").to_s\n }\n self\n end","title":""},{"docid":"2138663da3b999093a49bbba02c1bcb3","score":"0.5823986","text":"def show\n @norbi_meleg = NorbiMeleg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @norbi_meleg }\n end\n end","title":""},{"docid":"377cb081ee77c45820f56455e54935b5","score":"0.5823383","text":"def show\n @battery = Battery.find(params[:id])\n @station = Station.find(params[:station_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @battery }\n end\n end","title":""},{"docid":"0e728375ec22a2aded4e5f22192b134d","score":"0.58227307","text":"def show\n @boat = Boat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @boat }\n end\n end","title":""},{"docid":"b3c54e16afefdbdc08e11b027b144413","score":"0.58225375","text":"def index\n @user_budges = UserBudge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_budges }\n end\n end","title":""},{"docid":"f3db982b614cb05165f7c9170f093cf7","score":"0.5819906","text":"def index\n @blurbs = Blurb.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @blurbs }\n end\n end","title":""},{"docid":"4b8e05658f012e95f1849d61bd7e97c3","score":"0.58172905","text":"def index\n @has = Ha.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @has }\n end\n end","title":""},{"docid":"bd336589ad6b77a9b0d7aeac37fffde2","score":"0.5815888","text":"def index\n @budgets = Budget.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @budgets }\n end\n end","title":""},{"docid":"bd2d4138d335b58199b7441eeaf1ace9","score":"0.58147484","text":"def index\n @budge_requests = BudgeRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @budge_requests }\n end\n end","title":""},{"docid":"d882ea0c23246c28bde1527482cee890","score":"0.58129376","text":"def show\n @human = Human.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @human }\n end\n end","title":""},{"docid":"8ed572d85766c254bfaea8e52c66c61f","score":"0.5811891","text":"def show\n @headach = Headach.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @headach }\n end\n end","title":""},{"docid":"1af3b7b81a1badbc7d9ff32eba2a3030","score":"0.5810617","text":"def download_xml\r\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/alojamientos_v1_es.xml\")\r\n\t\tresponse = Net::HTTP.get_response(uri)\r\n\t\tcontent = response.body\r\n\r\n\t\txml = REXML::Document.new(content)\r\n\r\n\t\treturn xml\r\n\tend","title":""},{"docid":"9bf12e0775afaa209bc9b1a65d6d89bf","score":"0.5809995","text":"def show\n @boat_height = BoatHeight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @boat_height }\n end\n end","title":""},{"docid":"4208ab736c9a6e9f29e773cac9d44ec4","score":"0.5808421","text":"def show\n @bilan = Bilan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bilan }\n end\n end","title":""},{"docid":"034249810aebad8470ff044869e72ea5","score":"0.5804625","text":"def index\n @micros = Micro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @micros }\n end\n end","title":""},{"docid":"bb313f726e85dd5e62580e7b74267681","score":"0.5803384","text":"def index\n @ayudashumanitarias = Ayudashumanitaria.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ayudashumanitarias }\n end\n end","title":""},{"docid":"1d7258d2f515e35996755f6e690ac351","score":"0.57966685","text":"def show\n @bpack = Bpack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bpack }\n end\n end","title":""},{"docid":"d8d537515bf18d3ac9194f9a7995325f","score":"0.57946986","text":"def beaches\n p \"surf_alarm beach action\"\n respond_to do |format|\n format.text\n format.xml\n end\n end","title":""},{"docid":"bc4407a0a17e48a5a9800f61589f93c4","score":"0.5793817","text":"def show\n @ouve = Ouve.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ouve }\n end\n end","title":""},{"docid":"032ca9bfbb5c1db6401bd02b3e5a1e22","score":"0.5791074","text":"def show\n @bussiness_agent = BussinessAgent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bussiness_agent }\n end\n end","title":""},{"docid":"a2e1a3dc37a9eaba6393caba9cbf9943","score":"0.5789447","text":"def show\n @brief = Brief.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @brief }\n end\n end","title":""},{"docid":"3d200ed1b517bb8836c512ffe46b4c5e","score":"0.5778087","text":"def show\n @haimai = Haimai.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @haimai }\n end\n end","title":""},{"docid":"b679c12f443330040007bcfbda2a7116","score":"0.57740647","text":"def show\n @ustatistic = Ustatistic.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ustatistic }\n end\n end","title":""},{"docid":"779d2ca51a0944711e81fde2ab2d8f94","score":"0.5770477","text":"def show\n @bouty = Bouty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bouty }\n end\n end","title":""},{"docid":"842e389d10c8913ac28964ea73d624cd","score":"0.5767337","text":"def show\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bet }\n end\n end","title":""},{"docid":"03fd209a39c07f75ced02c0259b456d7","score":"0.5765864","text":"def listing_xml(id)\n curl = Curl::Easy.new(\"https://api.datahubus.com/v1/listings/#{id}?auth_token=#{ENV['AUTH_TOKEN']}\")\n curl.perform\n @listing_json = JSON.parse(curl.body_str)['listing']\nend","title":""},{"docid":"03fd209a39c07f75ced02c0259b456d7","score":"0.5765864","text":"def listing_xml(id)\n curl = Curl::Easy.new(\"https://api.datahubus.com/v1/listings/#{id}?auth_token=#{ENV['AUTH_TOKEN']}\")\n curl.perform\n @listing_json = JSON.parse(curl.body_str)['listing']\nend","title":""},{"docid":"e08bbe17972b3bb920f66dab9da4add3","score":"0.5765772","text":"def show\n @stb = Stb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @stb }\n end\n end","title":""},{"docid":"04598b492764e0b2d145581a3fe4f2b9","score":"0.5762406","text":"def show\n @budgets_budget_supply = Budgets::BudgetSupply.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @budgets_budget_supply }\n end\n end","title":""},{"docid":"75778d2881faebe005fb2ea9aefd3338","score":"0.57608914","text":"def show\n @ausencia = Ausencia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ausencia }\n end\n end","title":""},{"docid":"852cacdece11ef474d9dddc15493d5b5","score":"0.5759946","text":"def show\n @agua = Agua.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @agua }\n end\n end","title":""},{"docid":"f519a680bb9db0e909fe6977e1f7545e","score":"0.57504904","text":"def show\n @blurb = Blurb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @blurb }\n end\n end","title":""},{"docid":"f3130a84513cf48be68ff9021b2fb16d","score":"0.5748182","text":"def index\n @station = Station.find(params[:station_id])\n\t\t@batteries = @station.batteries\n \t\t\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @batteries }\n end\n end","title":""},{"docid":"b9b9eb7321243ba3b7fca3ea5a5e4e06","score":"0.57444453","text":"def show\n @item_boni = ItemBoni.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item_boni }\n end\n end","title":""},{"docid":"95ea3c708959947b09d5f836d6b4582f","score":"0.5744045","text":"def show\n @beings_happening = BeingsHappening.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @beings_happening }\n end\n end","title":""},{"docid":"4aa4b3e8e456b918c2d80456002c8ed3","score":"0.57421184","text":"def index\n @bouties_use = Bouty.find_all_by_bouty_type(\"use\");\n @bouties_read = Bouty.find_all_by_bouty_type(\"read\");\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bouties }\n end\n end","title":""},{"docid":"4313f67666f12e7924aeab461dd8de7c","score":"0.5736951","text":"def show\n @kabupaten = Kabupaten.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @kabupaten }\n end\n end","title":""},{"docid":"b0f43fee5f6acf2d18a7f1c80f46edb5","score":"0.57354796","text":"def show\n @besoin_materiel = BesoinMateriel.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @besoin_materiel.to_xml }\n end\n end","title":""},{"docid":"3c73b3682f86cb8a10a5c8e73341216c","score":"0.57350004","text":"def show\n @ilmoitu = Ilmoitu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ilmoitu }\n end\n end","title":""},{"docid":"02c5a3ca907ef514faddb8b3b063c15f","score":"0.5734209","text":"def index\n @unites = Unite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @unites }\n end\n end","title":""},{"docid":"bfe552b1b6ded21c362aff101a0b0c4f","score":"0.57237846","text":"def show\n @biter = Biter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @biter }\n end\n end","title":""},{"docid":"d061f22f0162a2327f8034a3a9087e1d","score":"0.5717785","text":"def index\n @boleta_de_deposito = BoletaDeDeposito.find(params[:boleta_de_deposito_id])\n @boletas_de_depositos_detalles = @boleta_de_deposito.boletas_de_depositos_detalles\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @boletas_de_depositos_detalles }\n end\n end","title":""},{"docid":"979dcda4e87e4157095e5c02eae5ef14","score":"0.571465","text":"def show\n @beat = Beat.find(params[:id]) \n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @beat }\n end\n end","title":""},{"docid":"f495e78683a98a92b7f7c29254f71966","score":"0.57140136","text":"def show\n @offre = Offre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @offre }\n end\n end","title":""},{"docid":"a4b1f145d5bd19e0c1a876b2d5c7b445","score":"0.57098097","text":"def show\n @ouvinte = Ouvinte.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ouvinte }\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"1945816b31552af5fa3d6fb25d2c592d\",\n \"score\": \"0.71307397\",\n \"text\": \"def index\\n @besoin_humains = @association.besoin_humains\\n\\n respond_to do |format|\\n format.html # index.rhtml\\n format.xml { render :xml => @besoin_humains.to_xml }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6ab3d31683c4571429411b3c397a6fd0\",\n \"score\": \"0.6390383\",\n \"text\": \"def show\\n @indice_bh = IndiceBh.find(params[:id])\\n\\n respond_to do |format|\\n format.html #show.html.erb\\n format.xml { render :xml => @indice_bh }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c05e4c97397b758d7980a113f73c1f92\",\n \"score\": \"0.625153\",\n \"text\": \"def show\\n @bulto = Bulto.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bulto }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"335af38450949289c4daafd278e768be\",\n \"score\": \"0.6220411\",\n \"text\": \"def show\\n @historial = Historial.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @historial }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4dc928115c1bb526f5b224f658c184d7\",\n \"score\": \"0.6202131\",\n \"text\": \"def show\\n @bolsista = Bolsista.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bolsista }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"44b85edaaa9b5d34825511032eacf7ab\",\n \"score\": \"0.6198346\",\n \"text\": \"def show\\n @bonuse = Bonuse.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bonuse }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"378a49fb5e8e95e0dc7bf0320beacb7d\",\n \"score\": \"0.6188105\",\n \"text\": \"def show\\n @buchung = Buchung.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @buchung }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"caccf00160b891d0598885f83ab34c34\",\n \"score\": \"0.6176122\",\n \"text\": \"def show\\n @bout = Bout.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bout }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fa44550a237acee51250dc9e30a40347\",\n \"score\": \"0.6174687\",\n \"text\": \"def show\\n @histoire = Histoire.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @histoire }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6e32a3c20e28c556c334bcf5cc829af8\",\n \"score\": \"0.61714804\",\n \"text\": \"def show\\n @observacao_historico = ObservacaoHistorico.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @observacao_historico }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"76d6b3a5af6a8563645823d3a05491c5\",\n \"score\": \"0.6164249\",\n \"text\": \"def show\\n @historia = Historia.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @historia }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cba2fbcfe1543d1040cd672be9d62282\",\n \"score\": \"0.6098534\",\n \"text\": \"def show\\n @hub = Hub.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @hub }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b2069cc1c3a228f7167cb5be372a1d96\",\n \"score\": \"0.6054227\",\n \"text\": \"def show\\n @historique = Historique.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @historique }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d57f45020b623bbb06394bb5ef3c40d4\",\n \"score\": \"0.60530055\",\n \"text\": \"def show\\n @microhood = Microhood.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @microhood }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"228ca8b2bbe73248867fad973042dc40\",\n \"score\": \"0.6049336\",\n \"text\": \"def show\\n @historico = Historico.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @historico }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c227096c3d3738fcf8d6b1f26c0cedf8\",\n \"score\": \"0.60327697\",\n \"text\": \"def index\\n @boletos = Boleto.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @boletos }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5fa86d4475a4ee00fe1afd59185b091f\",\n \"score\": \"0.6031209\",\n \"text\": \"def index\\n @detalle_recibo_habers = @recibo_sueldo.detalle_recibo_habers.all\\n\\n respond_to do |format|\\n format.html # indexoo.html.erb\\n format.xml { render :xml => @detalle_recibo_habers }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a378256ce3d6338af7180ff544f22b3c\",\n \"score\": \"0.6029877\",\n \"text\": \"def xml_report\\n RestClient::get \\\"#{@base}/OTHER/core/other/xmlreport/\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"74f828af558de07addb7d55072e13ee9\",\n \"score\": \"0.60107636\",\n \"text\": \"def show\\n @tumbon = Tumbon.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @tumbon }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5287660ffc1da7d33d5de8abe3f2ebbf\",\n \"score\": \"0.6010245\",\n \"text\": \"def xml_report\\n RestClient::get \\\"#{base}/OTHER/core/other/xmlreport/\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"168585988a4edab73a6516929a20fd86\",\n \"score\": \"0.5991359\",\n \"text\": \"def index\\n @ubications = Ubication.find(:all)\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @ubications }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dd169fc7aec3180c98dc339cd960891e\",\n \"score\": \"0.59766173\",\n \"text\": \"def show\\n @outfit = Outfit.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @outfit }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bcaf62b20115f596dfe3f3b14828ccc0\",\n \"score\": \"0.5973328\",\n \"text\": \"def show\\n @historial_peso = HistorialPeso.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @historial_peso }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0b282a72b3d1f0df6c1f11ae2a5e8066\",\n \"score\": \"0.5970103\",\n \"text\": \"def index\\n @bilans = Bilan.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @bilans }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d6c6fa966acdc838ad4716eff80f185\",\n \"score\": \"0.5960725\",\n \"text\": \"def show\\n @web_bus = WebBus.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @web_bus }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2b25f521dc431739d38a1a4306a91cd5\",\n \"score\": \"0.5950924\",\n \"text\": \"def show\\n @bb = Bb.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bb }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f8ff0ba90f6de30bd32ca6f773b88a04\",\n \"score\": \"0.5942832\",\n \"text\": \"def show\\n @briefing = Briefing.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @briefing }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3f1691e3f406716bcb72e675e33593cd\",\n \"score\": \"0.5939988\",\n \"text\": \"def get_xml_data(startat_value)\\n puts \\\"getting xml data\\\"\\n url = \\\"#{BASE_URL}?#{SEARCH_CONDITIONS}#{startat_value}\\\"\\n Net::HTTP.get_response(URI.parse(url)).body\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2d4de694a3e8b5723db4ca574492d433\",\n \"score\": \"0.59384257\",\n \"text\": \"def show\\n @ubication = Ubication.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @ubication }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8a18a98b9883e3c4a5aa030465673d87\",\n \"score\": \"0.59342885\",\n \"text\": \"def show\\n @obv = Obv.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @obv }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0e6615260e77cfdd20c3411f307827a3\",\n \"score\": \"0.5922698\",\n \"text\": \"def show\\n @boat_weight = BoatWeight.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @boat_weight }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8fb542494a33ebc65c68d68d22f3260b\",\n \"score\": \"0.5912586\",\n \"text\": \"def show\\n @bloodtest = Bloodtest.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bloodtest }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b1bfa6e5ba9cca6a062b5a933adb92a7\",\n \"score\": \"0.59119934\",\n \"text\": \"def show\\n @hoge = Hoge.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @hoge }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a596eb5ee0d88f6e3f20e43df889e2e1\",\n \"score\": \"0.5911512\",\n \"text\": \"def show\\n\\t\\t@bpay = Bpay.find(params[:id])\\n \\trespond_to do |format|\\t\\t\\n \\t\\t format.html \\n \\t\\t\\tformat.xml { render :xml => @bpays }\\t\\t#Render to XML File\\n \\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"300fd54d4dbe4c53bd70d8be8dd3987e\",\n \"score\": \"0.59082466\",\n \"text\": \"def show\\n @horary = Horary.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @horary }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"211ae98b750120f5bb5b04ed9bccb094\",\n \"score\": \"0.59035826\",\n \"text\": \"def url\\n \\\"http://www.bom.gov.au/#{self.abbreviation}/observations/#{self.abbreviation}all.shtml\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e3b30c0cceac8fbb7ab9b36b8826c028\",\n \"score\": \"0.5900591\",\n \"text\": \"def show\\n @bp_electronic_economic = BpElectronicEconomic.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bp_electronic_economic }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2b326702578a73c9dee640ace49b3a38\",\n \"score\": \"0.5896123\",\n \"text\": \"def show\\n @sisben = Sisben.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @sisben }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c8dd31bff2a111e8bf6a809c691026e7\",\n \"score\": \"0.5895407\",\n \"text\": \"def show\\n @ubicacione = Ubicacione.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @ubicacione }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0d784e792ab10eda1c418c9d67a99d3f\",\n \"score\": \"0.5890648\",\n \"text\": \"def show\\n @hap = Hap.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @hap }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e7619e6adac8fbea6222a30db984355a\",\n \"score\": \"0.5889715\",\n \"text\": \"def show\\n @soon = Soon.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @soon }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"839f1b0b708ec6a562506362ef1f9b6b\",\n \"score\": \"0.5879437\",\n \"text\": \"def index\\n @buses = Bus.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @buses }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"800021153c16120235dee7906f58d5f6\",\n \"score\": \"0.5878589\",\n \"text\": \"def show\\n @boleto = Boleto.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @boleto }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f8da309e303e5700359b0ea4318e1a98\",\n \"score\": \"0.58764994\",\n \"text\": \"def show\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @health_insurance }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ff2b9be113976dbb9b73df2c2f7fd4bd\",\n \"score\": \"0.5876117\",\n \"text\": \"def index\\n @brokers = @habitat.brokers.find(:all)\\n\\n respond_to do |format|\\n format.html # index.rhtml\\n format.xml { render :xml => @brokers.to_xml }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"61380a0365b8cdce2500ebe986c32622\",\n \"score\": \"0.58750665\",\n \"text\": \"def show\\n @brinde = Brinde.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @brinde }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c6ed2d571d349813bbf0b8cd698c411d\",\n \"score\": \"0.5858837\",\n \"text\": \"def show\\n @beak = Beak.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @beak }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"27519824b67207bccfba0de28d5b2919\",\n \"score\": \"0.58581764\",\n \"text\": \"def url; \\\"http://localhost:3000/sdn.xml\\\"; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"067f5d1783407d4b1aba4532ec3ebd6c\",\n \"score\": \"0.5857449\",\n \"text\": \"def index\\n @offres = Offre.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @offres }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0e9b89b24c1c28d62f7232a7b531c9f6\",\n \"score\": \"0.58553195\",\n \"text\": \"def show\\n @bdhogaresbienestar = Bdhogaresbienestar.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bdhogaresbienestar }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0760cc2b597f72c3e8368afd6600ba72\",\n \"score\": \"0.5851272\",\n \"text\": \"def show\\n @detalle_recibo_haber = @recibo_sueldo.detalle_recibo_habers.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @detalle_recibo_haber }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"77170bcae77f6e24d1afa75b5c3c338a\",\n \"score\": \"0.58434254\",\n \"text\": \"def show\\n @tiibb = Tiibb.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @tiibb }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"adfeb1e5d8b1dd440be72780ca9a9b99\",\n \"score\": \"0.5840596\",\n \"text\": \"def show\\n @ensembl = HTTParty.get('http://rest.ensembl.org' + '/lookup/id/' + @abundance.target_id[/[^.]+/],\\n :headers =>{'Content-Type' => 'application/json'} )\\n if @ensembl[\\\"display_name\\\"].nil? \\n @name = \\\"1\\\"\\n else\\n @name = @ensembl[\\\"display_name\\\"][0..-5]\\n\\n @wikis = HTTParty.get('https://webservice.wikipathways.org/findPathwaysByText?query=' + @name + '&species=homo+sapiens&format=json',\\n :headers =>{'Content-Type' => 'application/json'} )\\n\\n @pubs = HTTParty.get('https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&retmode=json&term='+ @name,\\n :headers =>{'Content-Type' => 'application/json'} )\\n \\n @omim = HTTParty.get('https://api.omim.org/api/entry/search?search='+ @name+ '&start=0&limit=1&include=text:description&apiKey=6-p06gbQTZiAWNOpPn-CSw&format=xml',:headers =>{'Content-Type' => 'application/xml'} )\\n \\n \\n\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9e3c05d62b4f1909b72e2180c6df4b95\",\n \"score\": \"0.58400345\",\n \"text\": \"def show\\n @abono = Abono.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @abono }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0ec68b61c44024a62ab709a97992dc1f\",\n \"score\": \"0.5831294\",\n \"text\": \"def index\\n @bands = Band.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @bands }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5fd6d2bf4ef7c9dfe3a4ac8afee442e2\",\n \"score\": \"0.58244467\",\n \"text\": \"def get\\n @xml = @paths.map { |path|\\n puts \\\"GET\\\\t#{@host + path}\\\"\\n RestClient.get(@host + path) { |response, request, result|\\n puts \\\"RESPONSE #{response.code}\\\"\\n response.body\\n }\\n }.map { |response|\\n Nokogiri::XML(response).xpath(\\\"/*\\\").to_s\\n }\\n self\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2138663da3b999093a49bbba02c1bcb3\",\n \"score\": \"0.5823986\",\n \"text\": \"def show\\n @norbi_meleg = NorbiMeleg.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @norbi_meleg }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"377cb081ee77c45820f56455e54935b5\",\n \"score\": \"0.5823383\",\n \"text\": \"def show\\n @battery = Battery.find(params[:id])\\n @station = Station.find(params[:station_id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @battery }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0e728375ec22a2aded4e5f22192b134d\",\n \"score\": \"0.58227307\",\n \"text\": \"def show\\n @boat = Boat.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @boat }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b3c54e16afefdbdc08e11b027b144413\",\n \"score\": \"0.58225375\",\n \"text\": \"def index\\n @user_budges = UserBudge.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @user_budges }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f3db982b614cb05165f7c9170f093cf7\",\n \"score\": \"0.5819906\",\n \"text\": \"def index\\n @blurbs = Blurb.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @blurbs }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4b8e05658f012e95f1849d61bd7e97c3\",\n \"score\": \"0.58172905\",\n \"text\": \"def index\\n @has = Ha.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @has }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd336589ad6b77a9b0d7aeac37fffde2\",\n \"score\": \"0.5815888\",\n \"text\": \"def index\\n @budgets = Budget.find(:all)\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @budgets }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd2d4138d335b58199b7441eeaf1ace9\",\n \"score\": \"0.58147484\",\n \"text\": \"def index\\n @budge_requests = BudgeRequest.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @budge_requests }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d882ea0c23246c28bde1527482cee890\",\n \"score\": \"0.58129376\",\n \"text\": \"def show\\n @human = Human.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @human }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8ed572d85766c254bfaea8e52c66c61f\",\n \"score\": \"0.5811891\",\n \"text\": \"def show\\n @headach = Headach.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @headach }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1af3b7b81a1badbc7d9ff32eba2a3030\",\n \"score\": \"0.5810617\",\n \"text\": \"def download_xml\\r\\n\\t\\turi = URI.parse(\\\"http://www.esmadrid.com/opendata/alojamientos_v1_es.xml\\\")\\r\\n\\t\\tresponse = Net::HTTP.get_response(uri)\\r\\n\\t\\tcontent = response.body\\r\\n\\r\\n\\t\\txml = REXML::Document.new(content)\\r\\n\\r\\n\\t\\treturn xml\\r\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9bf12e0775afaa209bc9b1a65d6d89bf\",\n \"score\": \"0.5809995\",\n \"text\": \"def show\\n @boat_height = BoatHeight.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @boat_height }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4208ab736c9a6e9f29e773cac9d44ec4\",\n \"score\": \"0.5808421\",\n \"text\": \"def show\\n @bilan = Bilan.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bilan }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"034249810aebad8470ff044869e72ea5\",\n \"score\": \"0.5804625\",\n \"text\": \"def index\\n @micros = Micro.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @micros }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bb313f726e85dd5e62580e7b74267681\",\n \"score\": \"0.5803384\",\n \"text\": \"def index\\n @ayudashumanitarias = Ayudashumanitaria.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @ayudashumanitarias }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d7258d2f515e35996755f6e690ac351\",\n \"score\": \"0.57966685\",\n \"text\": \"def show\\n @bpack = Bpack.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bpack }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d8d537515bf18d3ac9194f9a7995325f\",\n \"score\": \"0.57946986\",\n \"text\": \"def beaches\\n p \\\"surf_alarm beach action\\\"\\n respond_to do |format|\\n format.text\\n format.xml\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bc4407a0a17e48a5a9800f61589f93c4\",\n \"score\": \"0.5793817\",\n \"text\": \"def show\\n @ouve = Ouve.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @ouve }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"032ca9bfbb5c1db6401bd02b3e5a1e22\",\n \"score\": \"0.5791074\",\n \"text\": \"def show\\n @bussiness_agent = BussinessAgent.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bussiness_agent }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a2e1a3dc37a9eaba6393caba9cbf9943\",\n \"score\": \"0.5789447\",\n \"text\": \"def show\\n @brief = Brief.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @brief }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3d200ed1b517bb8836c512ffe46b4c5e\",\n \"score\": \"0.5778087\",\n \"text\": \"def show\\n @haimai = Haimai.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @haimai }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b679c12f443330040007bcfbda2a7116\",\n \"score\": \"0.57740647\",\n \"text\": \"def show\\n @ustatistic = Ustatistic.find(params[:id])\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @ustatistic }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"779d2ca51a0944711e81fde2ab2d8f94\",\n \"score\": \"0.5770477\",\n \"text\": \"def show\\n @bouty = Bouty.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bouty }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"842e389d10c8913ac28964ea73d624cd\",\n \"score\": \"0.5767337\",\n \"text\": \"def show\\n @bet = Bet.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @bet }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"03fd209a39c07f75ced02c0259b456d7\",\n \"score\": \"0.5765864\",\n \"text\": \"def listing_xml(id)\\n curl = Curl::Easy.new(\\\"https://api.datahubus.com/v1/listings/#{id}?auth_token=#{ENV['AUTH_TOKEN']}\\\")\\n curl.perform\\n @listing_json = JSON.parse(curl.body_str)['listing']\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"03fd209a39c07f75ced02c0259b456d7\",\n \"score\": \"0.5765864\",\n \"text\": \"def listing_xml(id)\\n curl = Curl::Easy.new(\\\"https://api.datahubus.com/v1/listings/#{id}?auth_token=#{ENV['AUTH_TOKEN']}\\\")\\n curl.perform\\n @listing_json = JSON.parse(curl.body_str)['listing']\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e08bbe17972b3bb920f66dab9da4add3\",\n \"score\": \"0.5765772\",\n \"text\": \"def show\\n @stb = Stb.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @stb }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"04598b492764e0b2d145581a3fe4f2b9\",\n \"score\": \"0.5762406\",\n \"text\": \"def show\\n @budgets_budget_supply = Budgets::BudgetSupply.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @budgets_budget_supply }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"75778d2881faebe005fb2ea9aefd3338\",\n \"score\": \"0.57608914\",\n \"text\": \"def show\\n @ausencia = Ausencia.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @ausencia }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"852cacdece11ef474d9dddc15493d5b5\",\n \"score\": \"0.5759946\",\n \"text\": \"def show\\n @agua = Agua.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @agua }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f519a680bb9db0e909fe6977e1f7545e\",\n \"score\": \"0.57504904\",\n \"text\": \"def show\\n @blurb = Blurb.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @blurb }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f3130a84513cf48be68ff9021b2fb16d\",\n \"score\": \"0.5748182\",\n \"text\": \"def index\\n @station = Station.find(params[:station_id])\\n\\t\\t@batteries = @station.batteries\\n \\t\\t\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @batteries }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b9b9eb7321243ba3b7fca3ea5a5e4e06\",\n \"score\": \"0.57444453\",\n \"text\": \"def show\\n @item_boni = ItemBoni.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @item_boni }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"95ea3c708959947b09d5f836d6b4582f\",\n \"score\": \"0.5744045\",\n \"text\": \"def show\\n @beings_happening = BeingsHappening.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @beings_happening }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4aa4b3e8e456b918c2d80456002c8ed3\",\n \"score\": \"0.57421184\",\n \"text\": \"def index\\n @bouties_use = Bouty.find_all_by_bouty_type(\\\"use\\\");\\n @bouties_read = Bouty.find_all_by_bouty_type(\\\"read\\\");\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @bouties }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4313f67666f12e7924aeab461dd8de7c\",\n \"score\": \"0.5736951\",\n \"text\": \"def show\\n @kabupaten = Kabupaten.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @kabupaten }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b0f43fee5f6acf2d18a7f1c80f46edb5\",\n \"score\": \"0.57354796\",\n \"text\": \"def show\\n @besoin_materiel = BesoinMateriel.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.rhtml\\n format.xml { render :xml => @besoin_materiel.to_xml }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c73b3682f86cb8a10a5c8e73341216c\",\n \"score\": \"0.57350004\",\n \"text\": \"def show\\n @ilmoitu = Ilmoitu.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @ilmoitu }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"02c5a3ca907ef514faddb8b3b063c15f\",\n \"score\": \"0.5734209\",\n \"text\": \"def index\\n @unites = Unite.all\\n\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @unites }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bfe552b1b6ded21c362aff101a0b0c4f\",\n \"score\": \"0.57237846\",\n \"text\": \"def show\\n @biter = Biter.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @biter }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d061f22f0162a2327f8034a3a9087e1d\",\n \"score\": \"0.5717785\",\n \"text\": \"def index\\n @boleta_de_deposito = BoletaDeDeposito.find(params[:boleta_de_deposito_id])\\n @boletas_de_depositos_detalles = @boleta_de_deposito.boletas_de_depositos_detalles\\n respond_to do |format|\\n format.html # index.html.erb\\n format.xml { render :xml => @boletas_de_depositos_detalles }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"979dcda4e87e4157095e5c02eae5ef14\",\n \"score\": \"0.571465\",\n \"text\": \"def show\\n @beat = Beat.find(params[:id]) \\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @beat }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f495e78683a98a92b7f7c29254f71966\",\n \"score\": \"0.57140136\",\n \"text\": \"def show\\n @offre = Offre.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @offre }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a4b1f145d5bd19e0c1a876b2d5c7b445\",\n \"score\": \"0.57098097\",\n \"text\": \"def show\\n @ouvinte = Ouvinte.find(params[:id])\\n\\n respond_to do |format|\\n format.html # show.html.erb\\n format.xml { render :xml => @ouvinte }\\n end\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":189,"cells":{"query_id":{"kind":"string","value":"27647e66b0a3becf30c635f375c0792f"},"query":{"kind":"string","value":"Convert to list using recursion"},"positive_passages":{"kind":"list like","value":[{"docid":"039f1a9b4190ed38b0427570164a26dd","score":"0.64115274","text":"def convert_to_list(node,div)\n\tmod = div%10\n\tdiv = div/10\n\tif div == 0 && mod == 0\n\t\treturn nil\n\tend\n\tnode.next = Node.new(mod)\n\tconvert_to_list(node.next,div)\nend","title":""}],"string":"[\n {\n \"docid\": \"039f1a9b4190ed38b0427570164a26dd\",\n \"score\": \"0.64115274\",\n \"text\": \"def convert_to_list(node,div)\\n\\tmod = div%10\\n\\tdiv = div/10\\n\\tif div == 0 && mod == 0\\n\\t\\treturn nil\\n\\tend\\n\\tnode.next = Node.new(mod)\\n\\tconvert_to_list(node.next,div)\\nend\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"d4434bf3e64fc3a6624ffe7573f15126","score":"0.64698726","text":"def return_list\n\t\tarr = []\n\t\tcurrent_node = @head\n\t\twhile current_node do\n\t\t\tarr << current_node\n\t\t\tcurrent_node = current_node.next\n\t\tend\t\n\t\tarr\n\tend","title":""},{"docid":"a90831719d8468d477e020ef1da741a6","score":"0.6449592","text":"def to_list\n if @left!=nil\n [ @left.to_list, [@lval[0]], @middle.to_list, [@rval[0]], @right.to_list ].flatten\n else\n [ @lval[0], @rval[0] ]\n end\n end","title":""},{"docid":"dbcac6796266fbe6dd18e0316562f9a1","score":"0.6410875","text":"def List(arg)\n if arg.respond_to?(:to_list)\n arg.to_list\n elsif arg.respond_to?(:to_ary)\n arg.to_ary.each_with_object(List.new) { |n, l| l.push(Node(n)) }\n else\n List.new.push(Node(arg))\n end\n end","title":""},{"docid":"a14ae8d7794cd00f30c0e5f54dc59b68","score":"0.6295908","text":"def to_list(object)\n if object.nil?\n []\n elsif object.respond_to?(:to_ary)\n object.to_ary || [object]\n else\n [object]\n end\nend","title":""},{"docid":"08de766c3aa9ce01608aa15f9aa2c871","score":"0.615038","text":"def recursive; end","title":""},{"docid":"08de766c3aa9ce01608aa15f9aa2c871","score":"0.615038","text":"def recursive; end","title":""},{"docid":"831acf7547d489b283755e7bbbbdcdba","score":"0.60909593","text":"def return_list\n current = @head\n\tarr = []\n\twhile current != nil\n\t arr.push(current.value)\n\t current = current.next\n\tend\n\treturn arr\n end","title":""},{"docid":"4c55f680e49d7180a5617f5af76662cf","score":"0.60751414","text":"def normalize_list r\n res = []\n r.each do |el|\n if el.class == Array\n res.push normalize_list(el)\n else res.push normalize(el)\n end \n end\n return res\n end","title":""},{"docid":"a7a28cc2ce2b0f0f039db99cda5f6e99","score":"0.6069714","text":"def toList(value)\n if value.is_a?(Array)\n value\n else\n [value]\n end\nend","title":""},{"docid":"ba130bfa810825b2e8c7e11030ef1157","score":"0.6054246","text":"def _list\n if @_structure_changed \n @list = nil\n @_structure_changed = false\n end\n unless @list\n $log.debug \" XXX recreating _list\"\n convert_to_list @treemodel\n $log.debug \" XXXX list: #{@list.size} : #{@list} \"\n end\n return @list\n end","title":""},{"docid":"5ca1092a1fe4d4f75d70b106bcdb5158","score":"0.6022847","text":"def recursive_get_nodes(node, l)\n l.push(node)\n node.children.each {|child| recursive_get_nodes(child, l) } \\\n if node.children.length > 0\n end","title":""},{"docid":"fa215d43056014dc415d866c20f10981","score":"0.6017845","text":"def expand_list(d)\n if d.respond_to?(\"collect\") then\n if d.collect == d then\n return d.collect{|x| expand_list(x)}\n else\n dc = d.collect\n if dc.length > 1 then\n return d.collect{|x| expand_list(x)}\n else\n return [d]\n end\n end\n else\n return [d]\n end\n end","title":""},{"docid":"4135db3f62d4ddb55e50b934fdea3da4","score":"0.60045135","text":"def preorder\n root = @root\n list = []\n\n preorder_helper(root, list)\n\n return list\n end","title":""},{"docid":"6f97aa8d2052ff9b26f8b0fff8d4a798","score":"0.596726","text":"def to_list\n n = Node.new(head)\n n.add tail\n return n\n end","title":""},{"docid":"305ca785110436d650ffc689b8ec5614","score":"0.5905021","text":"def my_flatten(arr)\n res = []\n arr.each do |el|\n if el.is_a?(Array)\n res.concat(my_flatten(el))\n else\n res.push(el)\n end\n p res\n end\n\n res\nend","title":""},{"docid":"ee70bc6cfa6e20339d9376783ad75405","score":"0.5879925","text":"def my_controlled_flatten(n)\n ret = []\n self.each do |el|\n if el.is_a?(Array)\n if n > 0\n ret += el.my_controlled_flatten(n-1)\n else\n ret << el\n end\n else\n ret << el\n end\n end\n ret\n end","title":""},{"docid":"7096f6a674a93c8c9f7295c84b8a3fde","score":"0.58591235","text":"def flatten_tree(tree)\n array = []\n go_looking(tree, array)\n array\nend","title":""},{"docid":"191f2ea6707174cf69cd779f165e439e","score":"0.58472556","text":"def my_controlled_flatten(n)\n return self if n == 0\n result = []\n self.each do |el|\n result << el unless el.is_a? Array\n result += el.my_controlled_flatten(n - 1) if el.is_a? Array\n end\n result\n end","title":""},{"docid":"3571ba1fc9cbea9a02ddae40999428d0","score":"0.58454984","text":"def flattener(arr, result = [])\n arr.each do |element|\n if element.instance_of?(Array)\n flattener(element, result)\n else\n result << element\n end\n end\n result\nend","title":""},{"docid":"059759dce2aaf61b02d238fae71ba766","score":"0.5826554","text":"def my_controlled_flatten(n)\n return self if n.zero?\n res = []\n\n each do |el|\n res += el.is_a?(Array) ? el.my_controlled_flatten(n - 1) : [el]\n end\n\n res\n end","title":""},{"docid":"12d140e8d594ed430b507b7131b709ca","score":"0.5824964","text":"def children_recursive\n a = []\n arr = children_a\n arr.each {|c|\n\ta += c.children_recursive\n }\n a + arr\n end","title":""},{"docid":"b9990f80ca662b40c66f79d4d0cde672","score":"0.58219683","text":"def to_a\r\n if @children.size > 0\r\n sublist = []\r\n @children.each { |child| child.to_a.each { |c| sublist << c } } \r\n [data, sublist]\r\n else\r\n [data]\r\n end\r\n end","title":""},{"docid":"450823268c455e033c8b4bf5c67f203f","score":"0.5818731","text":"def flatten(data)\n return [data] if data.kind_of?(Array) == false\n if data.kind_of?(Array) == true\n arr = []\n data.each do |ele|\n flattened = flatten(ele)\n arr += flattened\n end\n end\n arr\nend","title":""},{"docid":"e8cf010d99c63c109d9bdb934c70232a","score":"0.58096355","text":"def my_flatten\n results = []\n self.my_each do |ele|\n if ele.is_a?(Array)\n results += ele.my_flatten\n else\n results += [ele]\n end\n end\n return results\n end","title":""},{"docid":"c9b53bedfddc7d89b1873ef3ca303bf5","score":"0.5789665","text":"def flat_list_of_lists\n\t\tself.generate if @tree.nil?\n\t\tfinal_queue = Array.new\n\t\tflatten(@tree, Array.new, final_queue)\n\t\tfinal_queue\n\tend","title":""},{"docid":"094307e2c6a06dfaf7e4c568d5e5ea8d","score":"0.57884544","text":"def my_controlled_flatten(n=nil) \n return self.my_flatten if n.nil? \n result = [] \n while n > 0\n self.each do |ele|\n if !ele.is_a? Array\n result << ele \n else\n result += ele\n end\n end\n n -= 1\n end\n result\n end","title":""},{"docid":"a3b720d45af386b60c12347fa6b29bd3","score":"0.57873243","text":"def my_controlled_flatten(level = nil) # 3 times \n return self if level < 1 \n flattend_result = [] \n\n self.each do |elm|\n if elm.is_a?(Array)\n flattend_result += elm.my_controlled_flatten(level - 1)\n else \n flattend_result << elm \n end\n end\n\n flattend_result\n end","title":""},{"docid":"0e44c7009af1a9b7e74ba30281caf739","score":"0.5780929","text":"def rec_flatten(arr)\n result = []\n # debugger\n return arr if arr.empty?\n arr.each do |el|\n if el.is_a?(Array)\n result += rec_flatten(el)\n else\n result << el\n end\n end\n result\n end","title":""},{"docid":"08cfe43ce120ed1746f64379bc45b9d8","score":"0.57806","text":"def recursively_flatten obj\n buffer = Array[obj]\n result = []\n while o = buffer.shift\n if o.respond_to?(:flatten)\n buffer += o.flatten\n else\n result << o\n end\n end\n result\n end","title":""},{"docid":"2b6d21d3fdd4db86ca2bea2a8d89e2f2","score":"0.5765337","text":"def inorder\n root = @root\n list = []\n\n inorder_helper(root, list)\n\n return list\n end","title":""},{"docid":"32e21ffe32fa3ae5d624eb23629f932e","score":"0.5761277","text":"def generator2list(generator)\n l = []\n generator.call(proc{|e| l << e})\n l\nend","title":""},{"docid":"0a3956096d4a9b9b900ad1f71e188467","score":"0.575549","text":"def list_from(object)\n if list?(object)\n object\n elsif (object.respond_to?(:empty?) and object.empty?) or object.nil?\n NullType.new\n elsif object.instance_of?(Array)\n mklist(*object)\n else\n mklist(object)\n end\nend","title":""},{"docid":"586f5f96092fc2ff9a634d7b0c9efd0e","score":"0.5755206","text":"def my_controlled_flatten(n)\n return self if n == 0\n result = []\n self.my_each do |el|\n result << el unless el.is_a? Array\n result += el.my_controlled_flatten(n - 1) if el.is_a? Array\n end\n result\n end","title":""},{"docid":"f1c15506dae0c278b21f2cc9e69815b7","score":"0.5754353","text":"def flatten_tree\n [self]\n end","title":""},{"docid":"48f64a1a7c8e942a6ad5aae710bd000d","score":"0.5746919","text":"def to_list\n self\n end","title":""},{"docid":"30d084c1dbb8368a18de2aa7b8a93276","score":"0.57395524","text":"def range_recursive(start, finish)\n return [] if start >= finish \n [start] + range_recursive(start + 1, finish) \nend","title":""},{"docid":"14abc738efae3cb77c6ea88b3a9c16ad","score":"0.57306796","text":"def flatten!\n ret, out = nil, []\n\n ret = recursively_flatten(self, out)\n replace(out) if ret\n ret\n end","title":""},{"docid":"32965ad9deb506691a9ee99cfb3996d4","score":"0.571859","text":"def generator2list_(generator)\n callcc{|k_main|\n generator.call proc{|e|\n callcc{|k_reenter|\n\tk_main.call [e] + callcc{|k_new_main|\n\t\t\t k_main = k_new_main\n\t\t\t k_reenter.call\n\t\t\t }\n }\n }\n k_main.call []\n }\nend","title":""},{"docid":"5bdb26348800a18a750d9d4467e5cd9d","score":"0.5705296","text":"def flatten!; end","title":""},{"docid":"acd02a54efbc8cd759eb08d0b2043ea1","score":"0.56846267","text":"def inorder\n result = []\n inorder_recursion(@root, result)\n return result\n end","title":""},{"docid":"331cc7dcba733fe269b73a9e1527df4c","score":"0.56130165","text":"def make_list\n raise(ArgumentError, \"Must pass rendering block here.\") unless(block)\n if(elements.is_a?(Hash))\n tree_list\n else\n flat_list\n end\n end","title":""},{"docid":"a0e3b85961d648046089dc045d6c8e2d","score":"0.5610814","text":"def preorder\n result = []\n preorder_recursion(@root, result)\n return result\n end","title":""},{"docid":"78fdbeac0e56546aac951a4108a809a4","score":"0.5606387","text":"def recurisve\n list = []\n (1..4).each do |i|\n e = @quadtree.shift()\n e = recurisve if e == 'x'\n list << e\n end\n return reverse(list)\n end","title":""},{"docid":"ee11c65c83ee9a2b8e1efe16b70332a4","score":"0.55971247","text":"def preorder\n if @root == nil\n return []\n else\n return preorder_helper(@root, [])\n end\n end","title":""},{"docid":"2764f83b281fbfd98fc55a6634c189ad","score":"0.559223","text":"def my_controlled_flatten(n)\n return self if n <= 0\n\n arr = []\n\n self.each do |el|\n if (el.is_a? Array) && n > 0\n arr += el.my_controlled_flatten(n - 1)\n else\n arr << el\n end\n end\n\n arr\n end","title":""},{"docid":"ea740f38eaf0f51ac85ab5f5bb5ef71c","score":"0.5589796","text":"def my_flatten\n arr = []\n self.each do |var|\n unless var.class == Array\n arr << var\n else\n arr += var.my_flatten\n end\n end\n arr\nend","title":""},{"docid":"12ebf3a2eea085756c5786d6e5f0417d","score":"0.5589606","text":"def my_controlled_flatten(n)\n return self if n < 1\n result = []\n each do |el|\n if el.is_a?(Array)\n result += el.my_controlled_flatten(n - 1)\n else\n result << el\n end\n end\n result\n end","title":""},{"docid":"79888a96d21e5bc4daf1924cfd343c5a","score":"0.558567","text":"def node_children(node); node.to_a; end","title":""},{"docid":"9054fde0933f8785247fe6acf17b6e2c","score":"0.5580141","text":"def postorder\n root = @root\n list = []\n\n postorder_helper(root, list)\n\n return list\n end","title":""},{"docid":"072634d7a9cd008ee433b27f153cbaf2","score":"0.5574787","text":"def preorder\n result = []\n preorder_helper(@root, result)\n return result\n end","title":""},{"docid":"f493707cc0b6a4fe592de8f94b664ea3","score":"0.55747694","text":"def to_a\n return [] if self.empty?\n current = self.first\n a = [] \n while (current != nil)\n a << current\n if current.next = nil\n return a\n else\n current = current.next\n end\n end\n end","title":""},{"docid":"c7945bcd5b01d4eceb61d8bbc54a8134","score":"0.55619496","text":"def expand(db, node)\n return [node] if db[node].length == 0\n\n return db[node].map{ |v|\n [node] + expand(db, v)\n }\nend","title":""},{"docid":"d491fd03fb6060186ab50653dddb769f","score":"0.555276","text":"def to_a\n list = []\n traverse { |v| list << v }\n list\n end","title":""},{"docid":"c34fb2bf55f3ef86124b33b216337a7b","score":"0.5550992","text":"def preorder\n return [] if @root.nil?\n return preorder_helper(@root, [])\n end","title":""},{"docid":"ea021d95cf66c90f2938fb8da2d3858b","score":"0.55501807","text":"def to_a(flatten: false)\n return each.to_a if flatten\n return self if leaf?\n [self, children.map(&:to_a)]\n end","title":""},{"docid":"0b9b4f389ed1fc99174ff2d09c42d299","score":"0.5550066","text":"def my_flatten\n flat = []\n\n self.each do |x|\n if x.class != Array\n flat << x\n else\n sub_array = x.my_flatten\n flat.concat(sub_array)\n end\n end\n\n flat\n end","title":""},{"docid":"51bbfc7c82f37638af035f3ff1766ea6","score":"0.5549177","text":"def to_a()\n list_array = []\n node = @head\n\n until node.nil? do\n list_array.push node.data\n node = node.next\n end\n\n list_array\n end","title":""},{"docid":"328ca55ee6ad91d15c54780a844a8d6a","score":"0.5545064","text":"def make_children\n []\n end","title":""},{"docid":"3278431d623f62ae65056302481c8a95","score":"0.5541749","text":"def create_list_from()\nend","title":""},{"docid":"b6547270e1901833b799e6067faca1cf","score":"0.55342853","text":"def flatten!\n end","title":""},{"docid":"d4bc0cbeaab82bcb52b52c0e4e0c3449","score":"0.55254453","text":"def my_flatten\n results = []\n (0..self.length-1).each do |i|\n if self[i].class == Array\n results += self[i].my_flatten\n else\n results << self[i]\n end\n end\n results\n end","title":""},{"docid":"fc6fbc2b32d4e5842253632fd6f15d0c","score":"0.551987","text":"def return_list_values\n arr = []\n curr = @head\n while curr.next != nil\n arr << curr.value\n curr = curr.next\n end\n arr << curr.value\n end","title":""},{"docid":"29b35be0963eb1927998af0f54a39406","score":"0.5514436","text":"def snapshot_list(node=nil)\n unless node\n if self.snapshot\n node = self.snapshot.rootSnapshotList\n else\n return []\n end\n end\n\n list = []\n\n node.each do |child|\n list << child\n\n unless child.childSnapshotList.empty?\n list << snapshot_list(child.childSnapshotList)\n end\n end\n\n list.flatten\n end","title":""},{"docid":"829aac5e48504845792c7b4cb5e1d6f4","score":"0.5510987","text":"def digit_list(num, arr=[])\n q, r = num.divmod(10)\n arr.unshift(r)\n # recursion\n digit_list(q, arr) if q != 0\n arr\nend","title":""},{"docid":"c1d3b9c750014e365113113f18f4f91c","score":"0.5506651","text":"def my_controlled_flatten(n)\n return self if n < 1\n flat = []\n my_each do |el|\n if el.is_a?(Array)\n flat += el.my_controlled_flatten(n-1)\n else\n flat << el\n end\n end\n flat\n end","title":""},{"docid":"92bac5b40cc78048b35219d7e94b1a82","score":"0.5505834","text":"def cal_list\n list_result = infer_value.map do |sub|\n sub_hash = {}\n children.each do |child|\n child.infer_value = nil\n child.subject = sub\n child.parent_gql_type = gql_type\n child.results = sub_hash\n end.each(&:cal)\n sub_hash\n end\n results.merge! _name => list_result\n end","title":""},{"docid":"011ef14ccfa85fb7a766239cb41b83c0","score":"0.5505416","text":"def preorder\n list =[]\n if @root.nil? \n return list\n else \n return @root.preorder_helper(list)\n end\n end","title":""},{"docid":"54752413bdc8831b5c71a78d7598522d","score":"0.54773366","text":"def list_flatten(list, acc = [] )\n return acc if list.empty?\n h, *t = list\n if h.is_a?(Array)\n list_flatten(h, acc)\n else\n acc << h\n end\n list_flatten(t,acc)\nend","title":""},{"docid":"8c190ec7210f5c8dfc021a7281f25a85","score":"0.5475388","text":"def to_list(range)\n if range.is_a? Array\n create_list(range)\n elsif range.is_a? String\n range = JSON.parse(range)\n create_list(range)\n else\n range\n end\n end","title":""},{"docid":"82a931a45e1ec9b0164f2d0238ba45c0","score":"0.5472612","text":"def array_to_list(arr)\n\tarr.each_index do |list|\n\t\tif list != 0\n\t\t\tarr[list].next = arr[list-1]\n\t\telse\n\t\t\tarr[list].next = nil\n\t\tend\n\tend\n\treturn arr[arr.length-1]\nend","title":""},{"docid":"5b9820a8dbdcf4437f1a953ef4d265a4","score":"0.54715985","text":"def preorder\n return [] if @root.nil?\n return preorder_helper(@root)\n end","title":""},{"docid":"44e65cfe63f6bddd8a5e51dd2d9beac2","score":"0.547078","text":"def my_flatten\n return self if self.flatten == self\n new_arr = []\n self.each do |ele|\n if ele.kind_of?(Array)\n ele.length.times{new_arr << ele.shift}\n else\n new_arr << ele\n end\n end\n new_arr.my_flatten\nend","title":""},{"docid":"577a71d458341c327d3db2842d1841df","score":"0.5459418","text":"def preorder\n return [] if @root.nil?\n \n results = []\n preorder_helper(@root, results)\n return results\n end","title":""},{"docid":"51dc1c195efdc4f8825c3b2b5cf78d56","score":"0.5457049","text":"def exercise_five a, results\t# 'results' defaults to an empty list []\n a.each do |x| # for each element 'x' in lst\n if x.class == [].class\t# if that element is a list, then\n exercise_five(x, results) # flatten that sublist, appending results to \"results\"\n else \t# if element is not a list, then\n results << x \n end\t \t\t\t\t\t# insert a copy of it at the end of \"results\"\n end\n return results \nend","title":""},{"docid":"607090433fc747d22e1b4d4b620f0136","score":"0.5451065","text":"def preorder\n result = []\n return result if @root.nil?\n return @root.preorder_list(result)\n end","title":""},{"docid":"4a7badceee826796db9b7853ca291b88","score":"0.54408437","text":"def maven_module_list(path, recurse = false)\n\n module_list = Array.new\n\n maven_xpath_list(path, \"/project/modules/module\").each do |name|\n\n module_list.push(name.to_s)\n\n if recurse\n maven_module_list(\"#{path}/#{name}\", true).each do |name2|\n module_list.push(\"#{name}/#{name2}\")\n end\n end\n end\n\n module_list\nend","title":""},{"docid":"4a7badceee826796db9b7853ca291b88","score":"0.54408437","text":"def maven_module_list(path, recurse = false)\n\n module_list = Array.new\n\n maven_xpath_list(path, \"/project/modules/module\").each do |name|\n\n module_list.push(name.to_s)\n\n if recurse\n maven_module_list(\"#{path}/#{name}\", true).each do |name2|\n module_list.push(\"#{name}/#{name2}\")\n end\n end\n end\n\n module_list\nend","title":""},{"docid":"5857ce35863efd8849b78c5ef80dd343","score":"0.5437695","text":"def recursion_range(start,last)\n return [] if last <= start\n recursion_range(start,last-1) << last-1\nend","title":""},{"docid":"66633daa8056ee4636fc58c18973e5ed","score":"0.5435622","text":"def recursive_s(node)\n if node.is_a? Array\n s(*(node.map { |subnode| recursive_s(subnode) }))\n else\n node\n end\n end","title":""},{"docid":"5c999a2fc12cf0e47beee4d02a14fbc1","score":"0.54327476","text":"def preorder\n return [] if @root.nil?\n array = []\n preorder_helper(@root, array)\n return array\n end","title":""},{"docid":"cece336a8f0bfd212752e32b6dde5b34","score":"0.54248595","text":"def my_flatten\n each_with_object([]) do |el, flattened|\n flattened.push *(el.is_a?(Array) ? el.my_flatten : el)\n end\n\n end","title":""},{"docid":"629dd570eb75d176bb5375a746fd2350","score":"0.5422361","text":"def factorials_rec(num)\n return [1] if num == 1\n return [] if num == 0\n\n factorials_rec(num - 1) + [factorials(num - 1)]\n\nend","title":""},{"docid":"304fc400b40ae3cd0747cce7798906a4","score":"0.5419664","text":"def to_a\n @children.map(&:to_a)\n end","title":""},{"docid":"e375a05ada4dd07fee7d782b6675ab1f","score":"0.5417657","text":"def inorder\n result = []\n inorder_helper(@root, result)\n return result\n end","title":""},{"docid":"df19af27045d32e24829d1d65e11189d","score":"0.54164904","text":"def flatten(level = nil)\n `var result = [], item;\n\n for (var i = 0; i < self.length; i++) {\n item = self[i];\n\n if (item.hasOwnProperty('length')) {\n if (level == nil)\n result = result.concat(#{`item`.flatten});\n else if (level == 0)\n result.push(item);\n else\n result = result.concat(#{`item`.flatten `level - 1`});\n } else {\n result.push(item);\n }\n }\n\n return result;`\n end","title":""},{"docid":"0fb0720fbdebb072a541b4d860b47e10","score":"0.54129595","text":"def list_to_a\n @current = @head\n @output = []\n while @current\n @output.push(@current.value)\n @current = @current.next_node\n end\n return @output\n end","title":""},{"docid":"ec69ba872d2f2524e0de9fb568d611c0","score":"0.54101247","text":"def generate_trees(n)\n return [] if n == 0\n generate_tree(1, n)\nend","title":""},{"docid":"25f48cde9b82bc05144883d517093aa0","score":"0.54062015","text":"def flatten\r\n array = Array.new\r\n children.each { |child|\r\n array = array + recurse_flatten(child)\r\n }\r\n array\r\n end","title":""},{"docid":"ab996017ffa4f12ac3dec68400997c95","score":"0.54057306","text":"def tree_list\n result = \"\\n\"\n elements.each { |parent, children| result << subtree_list_for(parent, children) }\n result << \"
\\n\"\n result\n end","title":""},{"docid":"b30a336e3e4a59d515d59276ffa80cfa","score":"0.54044527","text":"def to_a\n array = []\n current_node = @head\n while current_node\n array << current_node.obj\n curent_node = current_node.to\n end\n\n array\n end","title":""},{"docid":"81564af3152d1bad467054a8804168e7","score":"0.54017556","text":"def recurse_flatten(arr)\n accumulator = []\n # output_array.concat(check_sub_array(el))\n if arr.kind_of?(Array)\n arr.each do |arr|\n accumulator.concat(recurse_flatten(arr))\n end\n else\n accumulator.concat([arr])\n end\n\n return accumulator\n end","title":""},{"docid":"0c32afb27219b1d474b8015c60ffb6c9","score":"0.5397945","text":"def get_recursively(ctx, path)\n this, *rest = path\n\n if rest.any?\n if ctx[this].is_a?(Array)\n ctx[this].map { |e| get_recursively(e, rest) }\n else\n get_recursively(ctx[this], rest)\n end\n else\n ctx[this]\n end\n end","title":""},{"docid":"c61a07209bd86c2ef97255d727f518f6","score":"0.53950125","text":"def flatten(input,data=[])\n\n input.each do |element|\n if element.is_a?(Array)\n flatten(element, data)\n else\n p element\n data << element\n p data.inspect\n end\n end\n return data\nend","title":""},{"docid":"4eebccb0f47c419d1ce3477a89fda75f","score":"0.53931063","text":"def flatten(arr, result = [])\n arr.each do |item|\n if item.kind_of?(Array) \n flatten(item, result)\n else\n result << item\n end\n end\n result\nend","title":""},{"docid":"4c2c173c1741b7783e698e3e9eb41b26","score":"0.5392147","text":"def map \n res = []\n leaves.each do | leaf |\n item = yield leaf\n res << item\n end\n res\n end","title":""},{"docid":"3b30d4ce1999f17d5053283dbd3c41fc","score":"0.5391811","text":"def to_a\n [name, children.map(&:to_a)]\n end","title":""},{"docid":"b7a40bf54d5cba1be9731f1e39b350ad","score":"0.5389832","text":"def my_flatten\n return self if none? { |el| el.is_a?(Array) }\n res = []\n\n each do |el|\n res += el.is_a?(Array) ? el.my_flatten : [el]\n end\n\n res\n end","title":""},{"docid":"c0a1866e3c320836f1c07adaca07cef1","score":"0.53804374","text":"def my_flatten\n flattened = []\n self.each do |ele|\n if !ele.is_a?(Array)\n flattened << ele\n else\n flattened += ele.my_flatten\n end\n end\n\n flattened \n end","title":""},{"docid":"acdc9c10de9a74705a2099a7067be820","score":"0.53781426","text":"def recoger (block)\n listaNodos = []\n self.bfs do |child|\n # Si el predicado del bloque es true agregamos el elemento a la lista\n if block.call(child)\n listaNodos.push(child)\n end\n end\n return listaNodos\n end","title":""},{"docid":"fb17fd3f5c15fd9278b9f4ecf3bc1a58","score":"0.5377527","text":"def my_controlled_flatten(n = nil)\n flattened = []\n\n self.each do |ele|\n if n.nil?\n if ele.is_a?(Array)\n flattened += ele.my_controlled_flatten\n else\n flattened << ele\n end\n else\n if n > 0 && ele.is_a?(Array)\n flattened += ele.my_controlled_flatten(n - 1)\n else\n flattened << ele\n end\n end\n end\n\n flattened\n end","title":""}],"string":"[\n {\n \"docid\": \"d4434bf3e64fc3a6624ffe7573f15126\",\n \"score\": \"0.64698726\",\n \"text\": \"def return_list\\n\\t\\tarr = []\\n\\t\\tcurrent_node = @head\\n\\t\\twhile current_node do\\n\\t\\t\\tarr << current_node\\n\\t\\t\\tcurrent_node = current_node.next\\n\\t\\tend\\t\\n\\t\\tarr\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a90831719d8468d477e020ef1da741a6\",\n \"score\": \"0.6449592\",\n \"text\": \"def to_list\\n if @left!=nil\\n [ @left.to_list, [@lval[0]], @middle.to_list, [@rval[0]], @right.to_list ].flatten\\n else\\n [ @lval[0], @rval[0] ]\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbcac6796266fbe6dd18e0316562f9a1\",\n \"score\": \"0.6410875\",\n \"text\": \"def List(arg)\\n if arg.respond_to?(:to_list)\\n arg.to_list\\n elsif arg.respond_to?(:to_ary)\\n arg.to_ary.each_with_object(List.new) { |n, l| l.push(Node(n)) }\\n else\\n List.new.push(Node(arg))\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a14ae8d7794cd00f30c0e5f54dc59b68\",\n \"score\": \"0.6295908\",\n \"text\": \"def to_list(object)\\n if object.nil?\\n []\\n elsif object.respond_to?(:to_ary)\\n object.to_ary || [object]\\n else\\n [object]\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"08de766c3aa9ce01608aa15f9aa2c871\",\n \"score\": \"0.615038\",\n \"text\": \"def recursive; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"08de766c3aa9ce01608aa15f9aa2c871\",\n \"score\": \"0.615038\",\n \"text\": \"def recursive; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"831acf7547d489b283755e7bbbbdcdba\",\n \"score\": \"0.60909593\",\n \"text\": \"def return_list\\n current = @head\\n\\tarr = []\\n\\twhile current != nil\\n\\t arr.push(current.value)\\n\\t current = current.next\\n\\tend\\n\\treturn arr\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c55f680e49d7180a5617f5af76662cf\",\n \"score\": \"0.60751414\",\n \"text\": \"def normalize_list r\\n res = []\\n r.each do |el|\\n if el.class == Array\\n res.push normalize_list(el)\\n else res.push normalize(el)\\n end \\n end\\n return res\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a7a28cc2ce2b0f0f039db99cda5f6e99\",\n \"score\": \"0.6069714\",\n \"text\": \"def toList(value)\\n if value.is_a?(Array)\\n value\\n else\\n [value]\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ba130bfa810825b2e8c7e11030ef1157\",\n \"score\": \"0.6054246\",\n \"text\": \"def _list\\n if @_structure_changed \\n @list = nil\\n @_structure_changed = false\\n end\\n unless @list\\n $log.debug \\\" XXX recreating _list\\\"\\n convert_to_list @treemodel\\n $log.debug \\\" XXXX list: #{@list.size} : #{@list} \\\"\\n end\\n return @list\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5ca1092a1fe4d4f75d70b106bcdb5158\",\n \"score\": \"0.6022847\",\n \"text\": \"def recursive_get_nodes(node, l)\\n l.push(node)\\n node.children.each {|child| recursive_get_nodes(child, l) } \\\\\\n if node.children.length > 0\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fa215d43056014dc415d866c20f10981\",\n \"score\": \"0.6017845\",\n \"text\": \"def expand_list(d)\\n if d.respond_to?(\\\"collect\\\") then\\n if d.collect == d then\\n return d.collect{|x| expand_list(x)}\\n else\\n dc = d.collect\\n if dc.length > 1 then\\n return d.collect{|x| expand_list(x)}\\n else\\n return [d]\\n end\\n end\\n else\\n return [d]\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4135db3f62d4ddb55e50b934fdea3da4\",\n \"score\": \"0.60045135\",\n \"text\": \"def preorder\\n root = @root\\n list = []\\n\\n preorder_helper(root, list)\\n\\n return list\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6f97aa8d2052ff9b26f8b0fff8d4a798\",\n \"score\": \"0.596726\",\n \"text\": \"def to_list\\n n = Node.new(head)\\n n.add tail\\n return n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"305ca785110436d650ffc689b8ec5614\",\n \"score\": \"0.5905021\",\n \"text\": \"def my_flatten(arr)\\n res = []\\n arr.each do |el|\\n if el.is_a?(Array)\\n res.concat(my_flatten(el))\\n else\\n res.push(el)\\n end\\n p res\\n end\\n\\n res\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee70bc6cfa6e20339d9376783ad75405\",\n \"score\": \"0.5879925\",\n \"text\": \"def my_controlled_flatten(n)\\n ret = []\\n self.each do |el|\\n if el.is_a?(Array)\\n if n > 0\\n ret += el.my_controlled_flatten(n-1)\\n else\\n ret << el\\n end\\n else\\n ret << el\\n end\\n end\\n ret\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7096f6a674a93c8c9f7295c84b8a3fde\",\n \"score\": \"0.58591235\",\n \"text\": \"def flatten_tree(tree)\\n array = []\\n go_looking(tree, array)\\n array\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"191f2ea6707174cf69cd779f165e439e\",\n \"score\": \"0.58472556\",\n \"text\": \"def my_controlled_flatten(n)\\n return self if n == 0\\n result = []\\n self.each do |el|\\n result << el unless el.is_a? Array\\n result += el.my_controlled_flatten(n - 1) if el.is_a? Array\\n end\\n result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3571ba1fc9cbea9a02ddae40999428d0\",\n \"score\": \"0.58454984\",\n \"text\": \"def flattener(arr, result = [])\\n arr.each do |element|\\n if element.instance_of?(Array)\\n flattener(element, result)\\n else\\n result << element\\n end\\n end\\n result\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"059759dce2aaf61b02d238fae71ba766\",\n \"score\": \"0.5826554\",\n \"text\": \"def my_controlled_flatten(n)\\n return self if n.zero?\\n res = []\\n\\n each do |el|\\n res += el.is_a?(Array) ? el.my_controlled_flatten(n - 1) : [el]\\n end\\n\\n res\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"12d140e8d594ed430b507b7131b709ca\",\n \"score\": \"0.5824964\",\n \"text\": \"def children_recursive\\n a = []\\n arr = children_a\\n arr.each {|c|\\n\\ta += c.children_recursive\\n }\\n a + arr\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b9990f80ca662b40c66f79d4d0cde672\",\n \"score\": \"0.58219683\",\n \"text\": \"def to_a\\r\\n if @children.size > 0\\r\\n sublist = []\\r\\n @children.each { |child| child.to_a.each { |c| sublist << c } } \\r\\n [data, sublist]\\r\\n else\\r\\n [data]\\r\\n end\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"450823268c455e033c8b4bf5c67f203f\",\n \"score\": \"0.5818731\",\n \"text\": \"def flatten(data)\\n return [data] if data.kind_of?(Array) == false\\n if data.kind_of?(Array) == true\\n arr = []\\n data.each do |ele|\\n flattened = flatten(ele)\\n arr += flattened\\n end\\n end\\n arr\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e8cf010d99c63c109d9bdb934c70232a\",\n \"score\": \"0.58096355\",\n \"text\": \"def my_flatten\\n results = []\\n self.my_each do |ele|\\n if ele.is_a?(Array)\\n results += ele.my_flatten\\n else\\n results += [ele]\\n end\\n end\\n return results\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c9b53bedfddc7d89b1873ef3ca303bf5\",\n \"score\": \"0.5789665\",\n \"text\": \"def flat_list_of_lists\\n\\t\\tself.generate if @tree.nil?\\n\\t\\tfinal_queue = Array.new\\n\\t\\tflatten(@tree, Array.new, final_queue)\\n\\t\\tfinal_queue\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"094307e2c6a06dfaf7e4c568d5e5ea8d\",\n \"score\": \"0.57884544\",\n \"text\": \"def my_controlled_flatten(n=nil) \\n return self.my_flatten if n.nil? \\n result = [] \\n while n > 0\\n self.each do |ele|\\n if !ele.is_a? Array\\n result << ele \\n else\\n result += ele\\n end\\n end\\n n -= 1\\n end\\n result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a3b720d45af386b60c12347fa6b29bd3\",\n \"score\": \"0.57873243\",\n \"text\": \"def my_controlled_flatten(level = nil) # 3 times \\n return self if level < 1 \\n flattend_result = [] \\n\\n self.each do |elm|\\n if elm.is_a?(Array)\\n flattend_result += elm.my_controlled_flatten(level - 1)\\n else \\n flattend_result << elm \\n end\\n end\\n\\n flattend_result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0e44c7009af1a9b7e74ba30281caf739\",\n \"score\": \"0.5780929\",\n \"text\": \"def rec_flatten(arr)\\n result = []\\n # debugger\\n return arr if arr.empty?\\n arr.each do |el|\\n if el.is_a?(Array)\\n result += rec_flatten(el)\\n else\\n result << el\\n end\\n end\\n result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"08cfe43ce120ed1746f64379bc45b9d8\",\n \"score\": \"0.57806\",\n \"text\": \"def recursively_flatten obj\\n buffer = Array[obj]\\n result = []\\n while o = buffer.shift\\n if o.respond_to?(:flatten)\\n buffer += o.flatten\\n else\\n result << o\\n end\\n end\\n result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2b6d21d3fdd4db86ca2bea2a8d89e2f2\",\n \"score\": \"0.5765337\",\n \"text\": \"def inorder\\n root = @root\\n list = []\\n\\n inorder_helper(root, list)\\n\\n return list\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"32e21ffe32fa3ae5d624eb23629f932e\",\n \"score\": \"0.5761277\",\n \"text\": \"def generator2list(generator)\\n l = []\\n generator.call(proc{|e| l << e})\\n l\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0a3956096d4a9b9b900ad1f71e188467\",\n \"score\": \"0.575549\",\n \"text\": \"def list_from(object)\\n if list?(object)\\n object\\n elsif (object.respond_to?(:empty?) and object.empty?) or object.nil?\\n NullType.new\\n elsif object.instance_of?(Array)\\n mklist(*object)\\n else\\n mklist(object)\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"586f5f96092fc2ff9a634d7b0c9efd0e\",\n \"score\": \"0.5755206\",\n \"text\": \"def my_controlled_flatten(n)\\n return self if n == 0\\n result = []\\n self.my_each do |el|\\n result << el unless el.is_a? Array\\n result += el.my_controlled_flatten(n - 1) if el.is_a? Array\\n end\\n result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f1c15506dae0c278b21f2cc9e69815b7\",\n \"score\": \"0.5754353\",\n \"text\": \"def flatten_tree\\n [self]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"48f64a1a7c8e942a6ad5aae710bd000d\",\n \"score\": \"0.5746919\",\n \"text\": \"def to_list\\n self\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"30d084c1dbb8368a18de2aa7b8a93276\",\n \"score\": \"0.57395524\",\n \"text\": \"def range_recursive(start, finish)\\n return [] if start >= finish \\n [start] + range_recursive(start + 1, finish) \\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"14abc738efae3cb77c6ea88b3a9c16ad\",\n \"score\": \"0.57306796\",\n \"text\": \"def flatten!\\n ret, out = nil, []\\n\\n ret = recursively_flatten(self, out)\\n replace(out) if ret\\n ret\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"32965ad9deb506691a9ee99cfb3996d4\",\n \"score\": \"0.571859\",\n \"text\": \"def generator2list_(generator)\\n callcc{|k_main|\\n generator.call proc{|e|\\n callcc{|k_reenter|\\n\\tk_main.call [e] + callcc{|k_new_main|\\n\\t\\t\\t k_main = k_new_main\\n\\t\\t\\t k_reenter.call\\n\\t\\t\\t }\\n }\\n }\\n k_main.call []\\n }\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5bdb26348800a18a750d9d4467e5cd9d\",\n \"score\": \"0.5705296\",\n \"text\": \"def flatten!; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"acd02a54efbc8cd759eb08d0b2043ea1\",\n \"score\": \"0.56846267\",\n \"text\": \"def inorder\\n result = []\\n inorder_recursion(@root, result)\\n return result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"331cc7dcba733fe269b73a9e1527df4c\",\n \"score\": \"0.56130165\",\n \"text\": \"def make_list\\n raise(ArgumentError, \\\"Must pass rendering block here.\\\") unless(block)\\n if(elements.is_a?(Hash))\\n tree_list\\n else\\n flat_list\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a0e3b85961d648046089dc045d6c8e2d\",\n \"score\": \"0.5610814\",\n \"text\": \"def preorder\\n result = []\\n preorder_recursion(@root, result)\\n return result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"78fdbeac0e56546aac951a4108a809a4\",\n \"score\": \"0.5606387\",\n \"text\": \"def recurisve\\n list = []\\n (1..4).each do |i|\\n e = @quadtree.shift()\\n e = recurisve if e == 'x'\\n list << e\\n end\\n return reverse(list)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ee11c65c83ee9a2b8e1efe16b70332a4\",\n \"score\": \"0.55971247\",\n \"text\": \"def preorder\\n if @root == nil\\n return []\\n else\\n return preorder_helper(@root, [])\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2764f83b281fbfd98fc55a6634c189ad\",\n \"score\": \"0.559223\",\n \"text\": \"def my_controlled_flatten(n)\\n return self if n <= 0\\n\\n arr = []\\n\\n self.each do |el|\\n if (el.is_a? Array) && n > 0\\n arr += el.my_controlled_flatten(n - 1)\\n else\\n arr << el\\n end\\n end\\n\\n arr\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ea740f38eaf0f51ac85ab5f5bb5ef71c\",\n \"score\": \"0.5589796\",\n \"text\": \"def my_flatten\\n arr = []\\n self.each do |var|\\n unless var.class == Array\\n arr << var\\n else\\n arr += var.my_flatten\\n end\\n end\\n arr\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"12ebf3a2eea085756c5786d6e5f0417d\",\n \"score\": \"0.5589606\",\n \"text\": \"def my_controlled_flatten(n)\\n return self if n < 1\\n result = []\\n each do |el|\\n if el.is_a?(Array)\\n result += el.my_controlled_flatten(n - 1)\\n else\\n result << el\\n end\\n end\\n result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"79888a96d21e5bc4daf1924cfd343c5a\",\n \"score\": \"0.558567\",\n \"text\": \"def node_children(node); node.to_a; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9054fde0933f8785247fe6acf17b6e2c\",\n \"score\": \"0.5580141\",\n \"text\": \"def postorder\\n root = @root\\n list = []\\n\\n postorder_helper(root, list)\\n\\n return list\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"072634d7a9cd008ee433b27f153cbaf2\",\n \"score\": \"0.5574787\",\n \"text\": \"def preorder\\n result = []\\n preorder_helper(@root, result)\\n return result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f493707cc0b6a4fe592de8f94b664ea3\",\n \"score\": \"0.55747694\",\n \"text\": \"def to_a\\n return [] if self.empty?\\n current = self.first\\n a = [] \\n while (current != nil)\\n a << current\\n if current.next = nil\\n return a\\n else\\n current = current.next\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c7945bcd5b01d4eceb61d8bbc54a8134\",\n \"score\": \"0.55619496\",\n \"text\": \"def expand(db, node)\\n return [node] if db[node].length == 0\\n\\n return db[node].map{ |v|\\n [node] + expand(db, v)\\n }\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d491fd03fb6060186ab50653dddb769f\",\n \"score\": \"0.555276\",\n \"text\": \"def to_a\\n list = []\\n traverse { |v| list << v }\\n list\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c34fb2bf55f3ef86124b33b216337a7b\",\n \"score\": \"0.5550992\",\n \"text\": \"def preorder\\n return [] if @root.nil?\\n return preorder_helper(@root, [])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ea021d95cf66c90f2938fb8da2d3858b\",\n \"score\": \"0.55501807\",\n \"text\": \"def to_a(flatten: false)\\n return each.to_a if flatten\\n return self if leaf?\\n [self, children.map(&:to_a)]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0b9b4f389ed1fc99174ff2d09c42d299\",\n \"score\": \"0.5550066\",\n \"text\": \"def my_flatten\\n flat = []\\n\\n self.each do |x|\\n if x.class != Array\\n flat << x\\n else\\n sub_array = x.my_flatten\\n flat.concat(sub_array)\\n end\\n end\\n\\n flat\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"51bbfc7c82f37638af035f3ff1766ea6\",\n \"score\": \"0.5549177\",\n \"text\": \"def to_a()\\n list_array = []\\n node = @head\\n\\n until node.nil? do\\n list_array.push node.data\\n node = node.next\\n end\\n\\n list_array\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"328ca55ee6ad91d15c54780a844a8d6a\",\n \"score\": \"0.5545064\",\n \"text\": \"def make_children\\n []\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3278431d623f62ae65056302481c8a95\",\n \"score\": \"0.5541749\",\n \"text\": \"def create_list_from()\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b6547270e1901833b799e6067faca1cf\",\n \"score\": \"0.55342853\",\n \"text\": \"def flatten!\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d4bc0cbeaab82bcb52b52c0e4e0c3449\",\n \"score\": \"0.55254453\",\n \"text\": \"def my_flatten\\n results = []\\n (0..self.length-1).each do |i|\\n if self[i].class == Array\\n results += self[i].my_flatten\\n else\\n results << self[i]\\n end\\n end\\n results\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fc6fbc2b32d4e5842253632fd6f15d0c\",\n \"score\": \"0.551987\",\n \"text\": \"def return_list_values\\n arr = []\\n curr = @head\\n while curr.next != nil\\n arr << curr.value\\n curr = curr.next\\n end\\n arr << curr.value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"29b35be0963eb1927998af0f54a39406\",\n \"score\": \"0.5514436\",\n \"text\": \"def snapshot_list(node=nil)\\n unless node\\n if self.snapshot\\n node = self.snapshot.rootSnapshotList\\n else\\n return []\\n end\\n end\\n\\n list = []\\n\\n node.each do |child|\\n list << child\\n\\n unless child.childSnapshotList.empty?\\n list << snapshot_list(child.childSnapshotList)\\n end\\n end\\n\\n list.flatten\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"829aac5e48504845792c7b4cb5e1d6f4\",\n \"score\": \"0.5510987\",\n \"text\": \"def digit_list(num, arr=[])\\n q, r = num.divmod(10)\\n arr.unshift(r)\\n # recursion\\n digit_list(q, arr) if q != 0\\n arr\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c1d3b9c750014e365113113f18f4f91c\",\n \"score\": \"0.5506651\",\n \"text\": \"def my_controlled_flatten(n)\\n return self if n < 1\\n flat = []\\n my_each do |el|\\n if el.is_a?(Array)\\n flat += el.my_controlled_flatten(n-1)\\n else\\n flat << el\\n end\\n end\\n flat\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"92bac5b40cc78048b35219d7e94b1a82\",\n \"score\": \"0.5505834\",\n \"text\": \"def cal_list\\n list_result = infer_value.map do |sub|\\n sub_hash = {}\\n children.each do |child|\\n child.infer_value = nil\\n child.subject = sub\\n child.parent_gql_type = gql_type\\n child.results = sub_hash\\n end.each(&:cal)\\n sub_hash\\n end\\n results.merge! _name => list_result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"011ef14ccfa85fb7a766239cb41b83c0\",\n \"score\": \"0.5505416\",\n \"text\": \"def preorder\\n list =[]\\n if @root.nil? \\n return list\\n else \\n return @root.preorder_helper(list)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"54752413bdc8831b5c71a78d7598522d\",\n \"score\": \"0.54773366\",\n \"text\": \"def list_flatten(list, acc = [] )\\n return acc if list.empty?\\n h, *t = list\\n if h.is_a?(Array)\\n list_flatten(h, acc)\\n else\\n acc << h\\n end\\n list_flatten(t,acc)\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8c190ec7210f5c8dfc021a7281f25a85\",\n \"score\": \"0.5475388\",\n \"text\": \"def to_list(range)\\n if range.is_a? Array\\n create_list(range)\\n elsif range.is_a? String\\n range = JSON.parse(range)\\n create_list(range)\\n else\\n range\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"82a931a45e1ec9b0164f2d0238ba45c0\",\n \"score\": \"0.5472612\",\n \"text\": \"def array_to_list(arr)\\n\\tarr.each_index do |list|\\n\\t\\tif list != 0\\n\\t\\t\\tarr[list].next = arr[list-1]\\n\\t\\telse\\n\\t\\t\\tarr[list].next = nil\\n\\t\\tend\\n\\tend\\n\\treturn arr[arr.length-1]\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5b9820a8dbdcf4437f1a953ef4d265a4\",\n \"score\": \"0.54715985\",\n \"text\": \"def preorder\\n return [] if @root.nil?\\n return preorder_helper(@root)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"44e65cfe63f6bddd8a5e51dd2d9beac2\",\n \"score\": \"0.547078\",\n \"text\": \"def my_flatten\\n return self if self.flatten == self\\n new_arr = []\\n self.each do |ele|\\n if ele.kind_of?(Array)\\n ele.length.times{new_arr << ele.shift}\\n else\\n new_arr << ele\\n end\\n end\\n new_arr.my_flatten\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"577a71d458341c327d3db2842d1841df\",\n \"score\": \"0.5459418\",\n \"text\": \"def preorder\\n return [] if @root.nil?\\n \\n results = []\\n preorder_helper(@root, results)\\n return results\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"51dc1c195efdc4f8825c3b2b5cf78d56\",\n \"score\": \"0.5457049\",\n \"text\": \"def exercise_five a, results\\t# 'results' defaults to an empty list []\\n a.each do |x| # for each element 'x' in lst\\n if x.class == [].class\\t# if that element is a list, then\\n exercise_five(x, results) # flatten that sublist, appending results to \\\"results\\\"\\n else \\t# if element is not a list, then\\n results << x \\n end\\t \\t\\t\\t\\t\\t# insert a copy of it at the end of \\\"results\\\"\\n end\\n return results \\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"607090433fc747d22e1b4d4b620f0136\",\n \"score\": \"0.5451065\",\n \"text\": \"def preorder\\n result = []\\n return result if @root.nil?\\n return @root.preorder_list(result)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4a7badceee826796db9b7853ca291b88\",\n \"score\": \"0.54408437\",\n \"text\": \"def maven_module_list(path, recurse = false)\\n\\n module_list = Array.new\\n\\n maven_xpath_list(path, \\\"/project/modules/module\\\").each do |name|\\n\\n module_list.push(name.to_s)\\n\\n if recurse\\n maven_module_list(\\\"#{path}/#{name}\\\", true).each do |name2|\\n module_list.push(\\\"#{name}/#{name2}\\\")\\n end\\n end\\n end\\n\\n module_list\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4a7badceee826796db9b7853ca291b88\",\n \"score\": \"0.54408437\",\n \"text\": \"def maven_module_list(path, recurse = false)\\n\\n module_list = Array.new\\n\\n maven_xpath_list(path, \\\"/project/modules/module\\\").each do |name|\\n\\n module_list.push(name.to_s)\\n\\n if recurse\\n maven_module_list(\\\"#{path}/#{name}\\\", true).each do |name2|\\n module_list.push(\\\"#{name}/#{name2}\\\")\\n end\\n end\\n end\\n\\n module_list\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5857ce35863efd8849b78c5ef80dd343\",\n \"score\": \"0.5437695\",\n \"text\": \"def recursion_range(start,last)\\n return [] if last <= start\\n recursion_range(start,last-1) << last-1\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"66633daa8056ee4636fc58c18973e5ed\",\n \"score\": \"0.5435622\",\n \"text\": \"def recursive_s(node)\\n if node.is_a? Array\\n s(*(node.map { |subnode| recursive_s(subnode) }))\\n else\\n node\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5c999a2fc12cf0e47beee4d02a14fbc1\",\n \"score\": \"0.54327476\",\n \"text\": \"def preorder\\n return [] if @root.nil?\\n array = []\\n preorder_helper(@root, array)\\n return array\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cece336a8f0bfd212752e32b6dde5b34\",\n \"score\": \"0.54248595\",\n \"text\": \"def my_flatten\\n each_with_object([]) do |el, flattened|\\n flattened.push *(el.is_a?(Array) ? el.my_flatten : el)\\n end\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"629dd570eb75d176bb5375a746fd2350\",\n \"score\": \"0.5422361\",\n \"text\": \"def factorials_rec(num)\\n return [1] if num == 1\\n return [] if num == 0\\n\\n factorials_rec(num - 1) + [factorials(num - 1)]\\n\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"304fc400b40ae3cd0747cce7798906a4\",\n \"score\": \"0.5419664\",\n \"text\": \"def to_a\\n @children.map(&:to_a)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e375a05ada4dd07fee7d782b6675ab1f\",\n \"score\": \"0.5417657\",\n \"text\": \"def inorder\\n result = []\\n inorder_helper(@root, result)\\n return result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"df19af27045d32e24829d1d65e11189d\",\n \"score\": \"0.54164904\",\n \"text\": \"def flatten(level = nil)\\n `var result = [], item;\\n\\n for (var i = 0; i < self.length; i++) {\\n item = self[i];\\n\\n if (item.hasOwnProperty('length')) {\\n if (level == nil)\\n result = result.concat(#{`item`.flatten});\\n else if (level == 0)\\n result.push(item);\\n else\\n result = result.concat(#{`item`.flatten `level - 1`});\\n } else {\\n result.push(item);\\n }\\n }\\n\\n return result;`\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0fb0720fbdebb072a541b4d860b47e10\",\n \"score\": \"0.54129595\",\n \"text\": \"def list_to_a\\n @current = @head\\n @output = []\\n while @current\\n @output.push(@current.value)\\n @current = @current.next_node\\n end\\n return @output\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ec69ba872d2f2524e0de9fb568d611c0\",\n \"score\": \"0.54101247\",\n \"text\": \"def generate_trees(n)\\n return [] if n == 0\\n generate_tree(1, n)\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"25f48cde9b82bc05144883d517093aa0\",\n \"score\": \"0.54062015\",\n \"text\": \"def flatten\\r\\n array = Array.new\\r\\n children.each { |child|\\r\\n array = array + recurse_flatten(child)\\r\\n }\\r\\n array\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ab996017ffa4f12ac3dec68400997c95\",\n \"score\": \"0.54057306\",\n \"text\": \"def tree_list\\n result = \\\"\\\\n\\\"\\n elements.each { |parent, children| result << subtree_list_for(parent, children) }\\n result << \\\"
\\\\n\\\"\\n result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b30a336e3e4a59d515d59276ffa80cfa\",\n \"score\": \"0.54044527\",\n \"text\": \"def to_a\\n array = []\\n current_node = @head\\n while current_node\\n array << current_node.obj\\n curent_node = current_node.to\\n end\\n\\n array\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"81564af3152d1bad467054a8804168e7\",\n \"score\": \"0.54017556\",\n \"text\": \"def recurse_flatten(arr)\\n accumulator = []\\n # output_array.concat(check_sub_array(el))\\n if arr.kind_of?(Array)\\n arr.each do |arr|\\n accumulator.concat(recurse_flatten(arr))\\n end\\n else\\n accumulator.concat([arr])\\n end\\n\\n return accumulator\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0c32afb27219b1d474b8015c60ffb6c9\",\n \"score\": \"0.5397945\",\n \"text\": \"def get_recursively(ctx, path)\\n this, *rest = path\\n\\n if rest.any?\\n if ctx[this].is_a?(Array)\\n ctx[this].map { |e| get_recursively(e, rest) }\\n else\\n get_recursively(ctx[this], rest)\\n end\\n else\\n ctx[this]\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c61a07209bd86c2ef97255d727f518f6\",\n \"score\": \"0.53950125\",\n \"text\": \"def flatten(input,data=[])\\n\\n input.each do |element|\\n if element.is_a?(Array)\\n flatten(element, data)\\n else\\n p element\\n data << element\\n p data.inspect\\n end\\n end\\n return data\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4eebccb0f47c419d1ce3477a89fda75f\",\n \"score\": \"0.53931063\",\n \"text\": \"def flatten(arr, result = [])\\n arr.each do |item|\\n if item.kind_of?(Array) \\n flatten(item, result)\\n else\\n result << item\\n end\\n end\\n result\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4c2c173c1741b7783e698e3e9eb41b26\",\n \"score\": \"0.5392147\",\n \"text\": \"def map \\n res = []\\n leaves.each do | leaf |\\n item = yield leaf\\n res << item\\n end\\n res\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3b30d4ce1999f17d5053283dbd3c41fc\",\n \"score\": \"0.5391811\",\n \"text\": \"def to_a\\n [name, children.map(&:to_a)]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b7a40bf54d5cba1be9731f1e39b350ad\",\n \"score\": \"0.5389832\",\n \"text\": \"def my_flatten\\n return self if none? { |el| el.is_a?(Array) }\\n res = []\\n\\n each do |el|\\n res += el.is_a?(Array) ? el.my_flatten : [el]\\n end\\n\\n res\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c0a1866e3c320836f1c07adaca07cef1\",\n \"score\": \"0.53804374\",\n \"text\": \"def my_flatten\\n flattened = []\\n self.each do |ele|\\n if !ele.is_a?(Array)\\n flattened << ele\\n else\\n flattened += ele.my_flatten\\n end\\n end\\n\\n flattened \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"acdc9c10de9a74705a2099a7067be820\",\n \"score\": \"0.53781426\",\n \"text\": \"def recoger (block)\\n listaNodos = []\\n self.bfs do |child|\\n # Si el predicado del bloque es true agregamos el elemento a la lista\\n if block.call(child)\\n listaNodos.push(child)\\n end\\n end\\n return listaNodos\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"fb17fd3f5c15fd9278b9f4ecf3bc1a58\",\n \"score\": \"0.5377527\",\n \"text\": \"def my_controlled_flatten(n = nil)\\n flattened = []\\n\\n self.each do |ele|\\n if n.nil?\\n if ele.is_a?(Array)\\n flattened += ele.my_controlled_flatten\\n else\\n flattened << ele\\n end\\n else\\n if n > 0 && ele.is_a?(Array)\\n flattened += ele.my_controlled_flatten(n - 1)\\n else\\n flattened << ele\\n end\\n end\\n end\\n\\n flattened\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":190,"cells":{"query_id":{"kind":"string","value":"cd2af6d8a8fe85dcf1212d4c5ce9e59d"},"query":{"kind":"string","value":"Replace document square annotation"},"positive_passages":{"kind":"list like","value":[{"docid":"4efd150cac1d89903713818449147331","score":"0.0","text":"def put_square_annotation(name, annotation_id, annotation, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_square_annotation_with_http_info(name, annotation_id, annotation, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_square_annotation_with_http_info(name, annotation_id, annotation, opts)\n else\n raise\n end\n return data\n end","title":""}],"string":"[\n {\n \"docid\": \"4efd150cac1d89903713818449147331\",\n \"score\": \"0.0\",\n \"text\": \"def put_square_annotation(name, annotation_id, annotation, opts = {})\\n @api_client.request_token_if_needed\\n data, _status_code, _headers = put_square_annotation_with_http_info(name, annotation_id, annotation, opts)\\n rescue ApiError => error\\n if error.code == 401\\n @api_client.request_token_if_needed\\n data, _status_code, _headers = put_square_annotation_with_http_info(name, annotation_id, annotation, opts)\\n else\\n raise\\n end\\n return data\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"1b86b38309513956fa41806b0049d2a1","score":"0.6619264","text":"def strip_annotations(content); end","title":""},{"docid":"a7a9cf9d365088c03f4876141a14597a","score":"0.63354915","text":"def editAnnotation ## accepts annotation id\n \n\t# Deprecate the old annotation\n deleteAnnotation\n \n\t# Create a new annotation linking back to the old one.\n addAnnotation\nend","title":""},{"docid":"b7f75d124ac2e4646a334f0fdcdb4e41","score":"0.6106981","text":"def reid_annotations!(annotations, doc)\n existing_ids = doc.get_annotation_hids(id)\n unless existing_ids.empty?\n id_change = {}\n if annotations.has_key?(:denotations)\n annotations[:denotations].each do |a|\n id = a[:id]\n id = Denotation.new_id while existing_ids.include?(id)\n if id != a[:id]\n id_change[a[:id]] = id\n a[:id] = id\n existing_ids << id\n end\n end\n\n if annotations.has_key?(:relations)\n annotations[:relations].each do |a|\n id = a[:id]\n id = Relation.new_id while existing_ids.include?(id)\n if id != a[:id]\n id_change[a[:id]] = id\n a[:id] = id\n existing_ids << id\n end\n a[:subj] = id_change[a[:subj]] if id_change.has_key?(a[:subj])\n a[:obj] = id_change[a[:obj]] if id_change.has_key?(a[:obj])\n end\n end\n\n if annotations.has_key?(:attributes)\n Attrivute.new_id_init\n annotations[:attributes].each do |a|\n id = a[:id]\n id = Attrivute.new_id while existing_ids.include?(id)\n if id != a[:id]\n a[:id] = id\n existing_ids << id\n end\n a[:subj] = id_change[a[:subj]] if id_change.has_key?(a[:subj])\n end\n end\n\n if annotations.has_key?(:modifications)\n annotations[:modifications].each do |a|\n id = a[:id]\n id = Modification.new_id while existing_ids.include?(id)\n if id != a[:id]\n a[:id] = id\n existing_ids << id\n end\n end\n end\n end\n end\n\n annotations\n end","title":""},{"docid":"cc9752b2355edb29a4dc946007ce1cad","score":"0.6071591","text":"def annotator; end","title":""},{"docid":"89e9494b2d0cea910b7b55485bc0a71a","score":"0.57871026","text":"def save_annotations!(annotations, doc, options = nil)\n raise ArgumentError, \"nil document\" unless doc.present?\n raise ArgumentError, \"the project does not have the document\" unless doc.projects.include?(self)\n options ||= {}\n\n return ['upload is skipped due to existing annotations'] if options[:mode] == 'skip' && doc.denotations_num > 0\n\n messages = Annotation.prepare_annotations!(annotations, doc, options)\n\n case options[:mode]\n when 'replace'\n delete_doc_annotations(doc, options[:span])\n reid_annotations!(annotations, doc) if options[:span].present?\n when 'add'\n reid_annotations!(annotations, doc)\n when 'merge'\n reid_annotations!(annotations, doc)\n base_annotations = doc.hannotations(self, options[:span])\n Annotation.prepare_annotations_for_merging!(annotations, base_annotations)\n else\n reid_annotations!(annotations, doc) if options[:span].present?\n end\n\n instantiate_and_save_annotations(annotations, doc)\n\n messages\n end","title":""},{"docid":"b0bcd60aab5200ad654321bc9cb7b0df","score":"0.56853545","text":"def annotations; end","title":""},{"docid":"b0bcd60aab5200ad654321bc9cb7b0df","score":"0.56853545","text":"def annotations; end","title":""},{"docid":"b0bcd60aab5200ad654321bc9cb7b0df","score":"0.56853545","text":"def annotations; end","title":""},{"docid":"b0bcd60aab5200ad654321bc9cb7b0df","score":"0.56853545","text":"def annotations; end","title":""},{"docid":"b0bcd60aab5200ad654321bc9cb7b0df","score":"0.56853545","text":"def annotations; end","title":""},{"docid":"b0bcd60aab5200ad654321bc9cb7b0df","score":"0.56853545","text":"def annotations; end","title":""},{"docid":"b0bcd60aab5200ad654321bc9cb7b0df","score":"0.56853545","text":"def annotations; end","title":""},{"docid":"b0bcd60aab5200ad654321bc9cb7b0df","score":"0.56853545","text":"def annotations; end","title":""},{"docid":"8d6cf26d647d39ce7af16bbac7e5e2ab","score":"0.56447047","text":"def update!(**args)\n @annotation = args[:annotation] if args.key?(:annotation)\n end","title":""},{"docid":"8d6cf26d647d39ce7af16bbac7e5e2ab","score":"0.56447047","text":"def update!(**args)\n @annotation = args[:annotation] if args.key?(:annotation)\n end","title":""},{"docid":"9d2e9aef217d3e728959e96a83e8926d","score":"0.5587311","text":"def postprocess(full_document)\n full_document.gsub(/^-(\\*+)/m, '\\1')\n\tend","title":""},{"docid":"085df0c1d79d7e82bc88dbecc1c42925","score":"0.5552476","text":"def update!(**args)\n @annotations = args[:annotations] if args.key?(:annotations)\n end","title":""},{"docid":"085df0c1d79d7e82bc88dbecc1c42925","score":"0.5552476","text":"def update!(**args)\n @annotations = args[:annotations] if args.key?(:annotations)\n end","title":""},{"docid":"905ee6c688bef68e717fa6e6a2a8901b","score":"0.5549782","text":"def after_save\n df = DataFile.find_by_id(self.orig_data_file_id)\n unless df.blank?\n df.annotations.each do |a|\n a.annotatable = self\n #need to call update without callbacks, otherwise a new version is created\n a.send(:update_without_callbacks)\n\n #versions for annotations are no longer enabled in SEEK - but this code is left here incase they are re-enabled in the future.\n a.versions.each do |av|\n av.annotatable =self\n av.save\n end\n end\n end\n super\n end","title":""},{"docid":"a92a35369f2be5370fe7ef1f3c3510ea","score":"0.5504119","text":"def setMainDocumentCssAnnotation(value)\n @fields['main_document_css_annotation'] = value\n self\n end","title":""},{"docid":"4b55bd888d2e52a120d0ef910152b69c","score":"0.5413313","text":"def update!(**args)\n @mask_annotation = args[:mask_annotation] if args.key?(:mask_annotation)\n @polygon_annotation = args[:polygon_annotation] if args.key?(:polygon_annotation)\n @polyline_annotation = args[:polyline_annotation] if args.key?(:polyline_annotation)\n end","title":""},{"docid":"49689e7d62c1040ca5fe740f0e1afd3c","score":"0.5364461","text":"def putAnnotation(text)\n raise unless @state == :asm\n if $enableInstrAnnotations\n @outp.puts text\n @annotation = nil\n end\n end","title":""},{"docid":"cd9aa727998d173d4064cb4cdb5e6826","score":"0.5362777","text":"def collapse_document(doc); end","title":""},{"docid":"90334b39f60acc8b73d45910ebd46b92","score":"0.53553283","text":"def deleteAnnotation ## accepts annotation id\n search_term = params[:id]\n\t# Find the annotation with the given ID\n\tanno = Annotation.find_by(id: search_term)\n\tanno.update(deprecated: true)\n\nend","title":""},{"docid":"2c5651869b3593404d21c78ae71738cd","score":"0.5354648","text":"def text_annotation(rect, contents, options={})\n options = options.merge(:Subtype => :Text, :Rect => rect, :Contents => contents)\n write_note(options)\n end","title":""},{"docid":"71b60b4f73843f8efadbe0042c4b5559","score":"0.5327387","text":"def extra_annotations; end","title":""},{"docid":"951e4021cef5f4e11c6db9be7dd114aa","score":"0.5320079","text":"def annotate(annotation)\n @research_object.create_annotation(@uri, annotation)\n end","title":""},{"docid":"18baae91d18386dc8d89efd383b23d76","score":"0.5294318","text":"def annotate_books!\n update_attribute(:books, annotated_books)\n end","title":""},{"docid":"1c3d35f02a61cc63e11875ce59edbf1b","score":"0.52905077","text":"def annotate_with(annotations, attr = 'tag', owner = User.current_user, user_owned_only = false)\n if annotations.is_a?(String)\n annotations = annotations.split(',').map(&:strip).uniq\n elsif annotations.is_a?(Array)\n annotations = annotations.map(&:strip).uniq\n else\n annotations = []\n end\n potential_values = Array(annotations).uniq(&:downcase).compact\n\n existing = send(\"#{attr}_annotations\")\n\n params = {}\n param_index = 0\n\n any_deletes = false\n duplicates = []\n existing.each do |ann|\n if user_owned_only && ann.source != owner\n params[(param_index += 1).to_s] = { id: ann.id }\n elsif ann.persisted?\n index = potential_values.index { |v| v.casecmp(ann.value_content) == 0 }\n if index\n duplicates << index\n params[(param_index += 1).to_s] = { id: ann.id }\n else\n any_deletes = true\n params[(param_index += 1).to_s] = { id: ann.id, _destroy: true }\n end\n end\n end\n\n potential_values.delete_if.with_index { |_, i| duplicates.include?(i) }\n\n potential_values.each do |value|\n # Annotation model can take either a String or an AR object as the value\n text_value = TextValue.where('lower(text) = ?', value.downcase).first || value\n params[(param_index += 1).to_s] = { source_type: owner.class.name, source_id: owner.id,\n attribute_name: attr, value: text_value }\n end\n\n send(\"#{attr}_annotations\").reset # Clear any previously assigned, but unsaved annotations\n send(\"#{attr}_annotations_attributes=\", params)\n\n potential_values.any? || any_deletes\n end","title":""},{"docid":"d4a45dc3106230230b53188f289afc18","score":"0.52787244","text":"def text_annotation(rect, contents, options = {})\n options = options.merge(Subtype: :Text, Rect: rect, Contents: contents)\n annotate(options)\n end","title":""},{"docid":"d007d4b76561e47f75321e0650a1ba67","score":"0.52771777","text":"def call\n refs = replace_refs\n replace_references(refs)\n\n doc\n end","title":""},{"docid":"e70f3295372a2ff6218814328796c756","score":"0.5261989","text":"def post_process(doc)\n doc.gsub(\"\\n\",'')\n end","title":""},{"docid":"455f7f02af79ec93bae3f71a7e03f522","score":"0.5245364","text":"def update!(**args)\n @annotations_set = args[:annotations_set] if args.key?(:annotations_set)\n end","title":""},{"docid":"dfeb84ff402ba6a6127a00e08dd41a5e","score":"0.5243474","text":"def replace_with_existing_offsets(offsets, annual_rules); end","title":""},{"docid":"3a6e203ed5692c8046ec743018e83247","score":"0.52334267","text":"def annotate(node, annotations, discard: false)\n node = node.dup\n\n annotations.each do |name|\n n = node.element_children.find{ |child| child.name == name }\n\n if n\n case n.name\n when 'annotation'\n allowed_attributes(n)\n ns = node_set(n.element_children, size: 1, names: ['documentation'], optional: ['lang'], children: 'any') # discard lang (\"en\")\n attributes = {annotation: ns[0].text.split(\"\\n\").map(&:strip).join(\"\\n\").strip}\n\n when 'unique'\n allowed_attributes(n, required: ['name']) # discard name (\"lg\")\n ns = node_set(n.element_children, size: 2, index: 1, names: ['field'], attributes: ['xpath'], xml: {0 => ''})\n attributes = {unique: ns[1]['xpath']}\n\n else\n assert false, \"unexpected #{n.name}\", n\n end\n\n if !discard\n set_last(node, attributes)\n end\n\n n.unlink\n end\n end\n\n node\n end","title":""},{"docid":"c14ea62929cd6c991f525470d2859977","score":"0.52257437","text":"def update\n replace_entry \"word/document.xml\", doc.serialize(:save_with => 0)\n end","title":""},{"docid":"6a2d621a6eb886249befc5d258705f1e","score":"0.52204394","text":"def update!(**args)\n @evaluated_annotations = args[:evaluated_annotations] if args.key?(:evaluated_annotations)\n end","title":""},{"docid":"c0eb66b01713b052078585c43d6d332a","score":"0.51983255","text":"def extract_annotations_from(file, pattern); end","title":""},{"docid":"be1c32db2c89f77c14b9efd0aa042f72","score":"0.5169427","text":"def reset_default_annotation(study:)\n current_default = study.default_annotation\n annot_name, annot_type, annot_scope = current_default&.split('--')\n case annot_scope\n when 'study'\n current_default = nil if study.cell_metadata.by_name_and_type(annot_name, annot_type).nil?\n when 'cluster'\n cluster = study.default_cluster\n annotation = cluster&.cell_annotations&.detect { |ca| ca[:name] == annot_name && ca[:type] == annot_type }\n current_default = nil if cluster.nil? || annotation.nil?\n else\n current_default = nil\n end\n if study.default_annotation != current_default\n study.default_options[:annotation] = current_default\n study.save\n end\n end","title":""},{"docid":"a5dceffc43fe48ff17bc1a0a3dc43d2e","score":"0.51594573","text":"def docbook_pgl( text )\n DOCBOOK_GLYPHS.each do |re, resub, tog|\n next if tog and method( tog ).call\n text.gsub! re, resub\n end\n end","title":""},{"docid":"008a30f44bdceba6fb560119ec5164db","score":"0.5153088","text":"def add_existing_annotation\n @text = AnnotationText.find(params[:annotation_text_id])\n @submission_file_id = params[:submission_file_id]\n @submission_file = SubmissionFile.find(@submission_file_id)\n @annotation = Annotation.new\n @annotation.update_attributes({\n line_start: params[:line_start],\n line_end: params[:line_end],\n submission_file_id: params[:submission_file_id]\n })\n @annotation.annotation_text = @text\n @annotation.save\n @submission = @submission_file.submission\n @annotations = @submission.annotations\n end","title":""},{"docid":"e80f28e5924ca7a533f019a18f931dc5","score":"0.5125421","text":"def typogrify(doc)\n content = doc.output\n return unless content.include?(BODY_START_TAG)\n\n doc.output = replace_selected_content(content, config_for_doc(doc))\n end","title":""},{"docid":"7bdb042d61f38bb902dd13f5fe33160a","score":"0.5123733","text":"def process(doc)\n doc.css('[fill^=\"url(#\"]').attr(\"fill\", \"#ffffff\")\n doc.css('[style*=\"fill:url(#\"]').each do |el|\n style = el.attribute(\"style\").to_s\n updated_style = style.gsub(/fill:url\\([^\\)]*\\)/, \"fill:#ffffff\")\n el[\"style\"] = updated_style\n end\nend","title":""},{"docid":"99a69e9bad8817c23aa088d62b35101d","score":"0.51195323","text":"def process!(document); end","title":""},{"docid":"7a75ce1c715aaf9af5998ecf0551ebde","score":"0.5112739","text":"def postprocess(document)\n document.gsub(\"\\n\", ' ').strip\n end","title":""},{"docid":"f3f0ffdfa4dba621e0683131a3fbc302","score":"0.5112038","text":"def annotate(tag)\n tag\n end","title":""},{"docid":"f3f0ffdfa4dba621e0683131a3fbc302","score":"0.5112038","text":"def annotate(tag)\n tag\n end","title":""},{"docid":"9cd0e50544734b17fb1609702e2aea53","score":"0.5086522","text":"def create\n @text = (params[:text] || \"\").strip\n @offset = (params[:offset] || \"-1\").to_i\n @concept = params[:concept] || \"\"\n @type = params[:type] || \"\"\n @note = params[:note] || \"\"\n assign_id = @assign.id if @assign.present?\n @concept = @document.project.normalize_concept_id(@concept, @type)\n\n @is_manager = @project.manager?(current_user)\n if @project.collaborate_round?\n annotator = @document.assigns.map{|a| a.user.email_or_name}.uniq.sort.join(',')\n else\n annotator = current_user.email_or_name\n end\n\n Annotation.transaction do\n max_id = @document.annotations.maximum('a_id_no') || 0;\n @annotation = Annotation.create!({\n a_id: max_id + 1,\n a_id_no: max_id + 1,\n a_type: @type, \n concept: @concept,\n assign_id: assign_id,\n user_id: current_user.id,\n content: @text,\n note: params[:note] || \"\",\n offset: (params[:offset] || \"-1\").to_i,\n passage: params[:passage_id],\n document_id: @document.id,\n project_id: @document.project_id,\n annotator: annotator,\n version: @document.version,\n review_result: 'agreed',\n infons: {}\n });\n if @project.collaborate_round\n @annotation.compute_review_result(nil)\n else\n @annotation.compute_review_result(@assign)\n end\n @document.touch\n end\n\n # @ret = @document.add_annotation(@current_user.email, @text, @offset, @type, @concept, @note)\n # @entity_types = EntityType.where(project_id: @document.project_id)\n @document.create_audit(current_user, 'Create annotation', params.to_json, @annotation.to_json)\n respond_to do |format|\n format.html { redirect_to @annotation, notice: 'The annotation was successfully created.' }\n format.json { render :show, status: :ok, location: @annotation }\n end\n end","title":""},{"docid":"ccf25c010a2380cb04f976380304ebd6","score":"0.50837785","text":"def process_annotation(params=nil)\n validate_params_solr_population(Sinatra::Helpers::SearchHelper::ALLOWED_INCLUDES_PARAMS)\n params ||= @params\n params_copy = params.dup\n\n text = params_copy.delete(\"text\")\n error 400, 'A text to be annotated must be supplied using the argument text=' if text.nil? || text.strip.empty?\n\n acronyms = restricted_ontologies_to_acronyms(params_copy)\n params_copy.delete(\"ontologies\")\n semantic_types = semantic_types_param(params_copy)\n params_copy.delete(\"semantic_types\")\n expand_class_hierarchy = params_copy.delete(\"expand_class_hierarchy\").eql?('true') # default = false\n class_hierarchy_max_level = params_copy.delete(\"class_hierarchy_max_level\").to_i # default = 0\n use_semantic_types_hierarchy = params_copy.delete(\"expand_semantic_types_hierarchy\").eql?('true') # default = false\n longest_only = params_copy.delete(\"longest_only\").eql?('true') # default = false\n expand_with_mappings = params_copy.delete(\"expand_mappings\").eql?('true') # default = false\n exclude_nums = params_copy.delete(\"exclude_numbers\").eql?('true') # default = false\n whole_word_only = params_copy.delete(\"whole_word_only\").eql?('false') ? false : true # default = true\n min_term_size = params_copy.delete(\"minimum_match_length\").to_i # default = 0\n exclude_synonyms = params_copy.delete(\"exclude_synonyms\").eql?('true') # default = false\n recognizer = (Annotator.settings.enable_recognizer_param && params_copy[\"recognizer\"]) || 'mgrep'\n params_copy.delete(\"recognizer\")\n\n annotator = nil\n\n # see if a name of the recognizer has been passed in, use default if not or error\n begin\n recognizer = recognizer.capitalize\n clazz = \"Annotator::Models::Recognizers::#{recognizer}\".split('::').inject(Object) {|o, c| o.const_get c}\n annotator = clazz.new\n rescue\n annotator = Annotator::Models::Recognizers::Mgrep.new\n end\n\n if params_copy[\"stop_words\"]\n annotator.stop_words = params_copy.delete(\"stop_words\")\n end\n\n params_copy.delete(\"display\")\n options = {\n ontologies: acronyms,\n semantic_types: semantic_types,\n use_semantic_types_hierarchy: use_semantic_types_hierarchy,\n filter_integers: exclude_nums,\n expand_class_hierarchy: expand_class_hierarchy,\n expand_hierarchy_levels: class_hierarchy_max_level,\n expand_with_mappings: expand_with_mappings,\n min_term_size: min_term_size,\n whole_word_only: whole_word_only,\n with_synonyms: !exclude_synonyms,\n longest_only: longest_only\n }\n options = params_copy.symbolize_keys().merge(options)\n\n begin\n annotations = annotator.annotate(text, options)\n\n unless includes_param.empty?\n # Move include param to special param so it only applies to classes\n params[\"include_for_class\"] = includes_param\n params.delete(\"display\")\n params.delete(\"include\")\n env[\"rack.request.query_hash\"] = params\n\n orig_classes = annotations.map {|a| [a.annotatedClass, a.hierarchy.map {|h| h.annotatedClass}, a.mappings.map {|m| m.annotatedClass}]}.flatten\n classes_hash = populate_classes_from_search(orig_classes, acronyms)\n annotations = replace_empty_classes(annotations, classes_hash) do |a|\n replace_empty_classes(a.hierarchy, classes_hash)\n replace_empty_classes(a.mappings, classes_hash)\n end\n end\n rescue LinkedData::Models::Ontology::ParsedSubmissionError => e\n error 404, e.message\n rescue Annotator::Models::NcboAnnotator::BadSemanticTypeError => e\n error 404, e.message\n end\n\n reply 200, annotations\n end","title":""},{"docid":"8836191fdc495dd46c2e013990454fe3","score":"0.5072349","text":"def replace_bbox(data)\n regex = /(id='word_\\d+')\\s(title=\"\\w{4}\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\")/\n data.gsub(regex) {\"#{$1} style='left: #{$3.to_i/5}px\\; top: #{$4.to_i/5}px\\;'\"}\n end","title":""},{"docid":"a8fa974a27861953dcd9867c17a97107","score":"0.50616026","text":"def prepare_annotation_as_save_template(annotation)\n ensure_primary_annotation_has_hook(annotation) if annotation.class.primary?\n annotation\n end","title":""},{"docid":"38bf1b5215fa230f4422b6b0a87dd0d1","score":"0.5047189","text":"def document=(_arg0); end","title":""},{"docid":"38bf1b5215fa230f4422b6b0a87dd0d1","score":"0.5047189","text":"def document=(_arg0); end","title":""},{"docid":"38bf1b5215fa230f4422b6b0a87dd0d1","score":"0.5047189","text":"def document=(_arg0); end","title":""},{"docid":"38bf1b5215fa230f4422b6b0a87dd0d1","score":"0.5047189","text":"def document=(_arg0); end","title":""},{"docid":"38bf1b5215fa230f4422b6b0a87dd0d1","score":"0.5047189","text":"def document=(_arg0); end","title":""},{"docid":"38bf1b5215fa230f4422b6b0a87dd0d1","score":"0.5047189","text":"def document=(_arg0); end","title":""},{"docid":"38bf1b5215fa230f4422b6b0a87dd0d1","score":"0.5047189","text":"def document=(_arg0); end","title":""},{"docid":"38bf1b5215fa230f4422b6b0a87dd0d1","score":"0.5047189","text":"def document=(_arg0); end","title":""},{"docid":"38bf1b5215fa230f4422b6b0a87dd0d1","score":"0.5047189","text":"def document=(_arg0); end","title":""},{"docid":"2b60d4f12d94d5d20eb43c8f3bd17b4c","score":"0.50422823","text":"def detected_styles=(_arg0); end","title":""},{"docid":"cbe993ca13f5f50ad489abf8d79053a5","score":"0.5030876","text":"def add_to_doc idea\n GDFile.update_from_string(\n append_idea(IdeaTemplate % [idea[:user],\n idea[:message],\n idea[:link]] ))\nend","title":""},{"docid":"bd0aef64f6577d1ea3dc2a58f16e7abd","score":"0.5029578","text":"def create\n @text = (params[:text] || \"\").strip\n @offset = (params[:offset] || \"-1\").to_i\n @concept = params[:concept] || \"\"\n @type = params[:type] || \"\"\n\n @ret = @document.add_annotation(@text, @offset, @type, @concept)\n @entity_types = EntityType.where(collection_id: @document.collection_id)\n\n respond_to do |format|\n format.html { redirect_to @annotation, notice: 'The annotation was successfully created.' }\n format.json { render :show, status: :ok, location: @annotation }\n end\n end","title":""},{"docid":"48b146c5a9946e554968fe443485d373","score":"0.50278914","text":"def update!(**args)\n @annotation_spec_id = args[:annotation_spec_id] if args.key?(:annotation_spec_id)\n @display_name = args[:display_name] if args.key?(:display_name)\n @text_segment = args[:text_segment] if args.key?(:text_segment)\n end","title":""},{"docid":"d14cc18151b9bfab1c6aa194adfbc35d","score":"0.4977184","text":"def get_document_squiggly_annotations(name, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_document_squiggly_annotations_with_http_info(name, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_document_squiggly_annotations_with_http_info(name, opts)\n else\n raise\n end\n return data\n end","title":""},{"docid":"ddc00099ca108ca932b9bc7d88290fe4","score":"0.49721196","text":"def replace_concepts(s)\n concepts = find_concepts(s).uniq\n #debugger\n concepts.each do |e|\n title = @ct[e[0]]\n #puts \"Replacing #{title}\"\n s.gsub!(/#{title}/i, \"#{e[0]}_#{title.to_id}\")\n end\n end","title":""},{"docid":"37f0e45826de04ad4d81424f6bf0095e","score":"0.49686298","text":"def get_document_square_annotations_with_http_info(name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PdfApi.get_document_square_annotations ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling PdfApi.get_document_square_annotations\"\n end\n # resource path\n local_var_path = \"/pdf/{name}/annotations/square\".sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n # Fix header in file\n post_body = nil\n\n # http body (model)\n # Fix header in file\n # post_body = nil\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SquareAnnotationsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PdfApi#get_document_square_annotations\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end","title":""},{"docid":"a265882a608079a89761ff23630457e1","score":"0.49577183","text":"def post_process(doc)\n doc\n end","title":""},{"docid":"82c6074cd433cd7306a509459a4a5f8d","score":"0.49283475","text":"def _updated_annotator(alpha, beta, mu_winner, sigma_sq_winner, mu_loser, sigma_sq_loser)\n\t c_1 = exp(mu_winner) / (exp(mu_winner) + exp(mu_loser)) + 0.5 *\n\t (sigma_sq_winner + sigma_sq_loser) *\n\t (exp(mu_winner) * exp(mu_loser) * (exp(mu_loser) - exp(mu_winner))) /\n\t ((exp(mu_winner) + exp(mu_loser)) ** 3)\n\t c_2 = 1 - c_1\n\t c = (c_1 * alpha + c_2 * beta) / (alpha + beta)\n\n\t expt = (c_1 * (alpha + 1) * alpha + c_2 * alpha * beta) /\n\t (c * (alpha + beta + 1) * (alpha + beta))\n\t expt_sq = (c_1 * (alpha + 2) * (alpha + 1) * alpha + c_2 * (alpha + 1) * alpha * beta) /\n\t (c * (alpha + beta + 2) * (alpha + beta + 1) * (alpha + beta))\n\n\t variance = (expt_sq - expt ** 2)\n\t updated_alpha = ((expt - expt_sq) * expt) / variance\n\t updated_beta = (expt - expt_sq) * (1 - expt) / variance\n\n\t [updated_alpha, updated_beta, c]\n\tend","title":""},{"docid":"9f4ef9db0771ef0c80811bfc2f3268bb","score":"0.49212003","text":"def replace_all(source_text, replacement)\n case\n # For simple cases we just replace runs to try and keep formatting/layout of source\n when replacement.is_a?(String)\n @main_doc.replace_all_with_text(source_text, replacement)\n when (replacement.is_a?(Magick::Image) or replacement.is_a?(Magick::ImageList))\n runs = @main_doc.replace_all_with_empty_runs(source_text)\n runs.each { |r| r.replace_with_run_fragment(create_image_run_fragment(replacement)) }\n when replacement.is_a?(Hash)\n runs = @main_doc.replace_all_with_empty_runs(source_text)\n runs.each { |r| r.replace_with_body_fragments(create_body_fragments(replacement, {:create_table => true})) }\n when replacement.is_a?(Nokogiri::XML::Element)\n runs = @main_doc.replace_all_with_empty_runs(source_text)\n if replacement.name == \"w:tbl\"\n runs.each { |r| r.replace_with_body_fragments(create_body_fragments(replacement)) }\n else\n runs.each { |r| r.replace_with_run_fragment(create_body_fragments(replacement)) }\n end\n else\n runs = @main_doc.replace_all_with_empty_runs(source_text)\n runs.each { |r| r.replace_with_body_fragments(create_body_fragments(replacement)) }\n end\n end","title":""},{"docid":"dc5f7658c2081b39f4f152c757db55e8","score":"0.4901373","text":"def update!(**args)\n @additional_annotation_data = args[:additional_annotation_data] if args.key?(:additional_annotation_data)\n end","title":""},{"docid":"e538f49e55e2d8eba2b7d21b9d8456b9","score":"0.48888347","text":"def get_document_squiggly_annotations_with_http_info(name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PdfApi.get_document_squiggly_annotations ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling PdfApi.get_document_squiggly_annotations\"\n end\n # resource path\n local_var_path = \"/pdf/{name}/annotations/squiggly\".sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n # Fix header in file\n post_body = nil\n\n # http body (model)\n # Fix header in file\n # post_body = nil\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SquigglyAnnotationsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PdfApi#get_document_squiggly_annotations\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end","title":""},{"docid":"e82666c2c9e0fa685a00c0ccfb925220","score":"0.488784","text":"def regenerate?(document); end","title":""},{"docid":"413ca7c9ba30655c67800ac58e35bd89","score":"0.48779836","text":"def doc_transformed(root)\n\n end","title":""},{"docid":"b8ffe73f6b02d291ee8b08bd6d6b3eb5","score":"0.4877485","text":"def annotate(message); end","title":""},{"docid":"f937bf774fe6e59a7a6b4e0e6babdcb1","score":"0.48683724","text":"def annotate(tag)\n tag\n end","title":""},{"docid":"eba6a396f47674ef4d00ddff5b6d6ac5","score":"0.4866774","text":"def single_image\n page_number = 1\n\n input_image_path = \"/Users/kyle/Dropbox/code/kyletolle/handwriting_transcription/page#{page_number}.jpg\"\n image = Magick::Image.read(input_image_path)[0]\n json_path =\"/Users/kyle/Dropbox/code/kyletolle/handwriting_transcription/output-#{page_number}-to-#{page_number}.json\"\n json_text = File.read(json_path)\n json = JSON.parse(json_text)\n\n bounding_box = json[\"responses\"].first[\"textAnnotations\"][1][\"boundingPoly\"]\n vertices = bounding_box[\"vertices\"]\n\n draw = Magick::Draw.new\n\n # For drawing boxes around all words.\n # text_annotations = json[\"responses\"].first[\"textAnnotations\"][1..-1]\n # text_annotations.each do |text_annotation|\n # bounding_box = text_annotation[\"boundingPoly\"]\n # vertices = bounding_box[\"vertices\"]\n\n # p1 = [ vertices[0]['x'], vertices[0]['y'] ]\n # p2 = [ vertices[1]['x'], vertices[1]['y'] ]\n # p3 = [ vertices[3]['x'], vertices[3]['y'] ]\n # p4 = [ vertices[2]['x'], vertices[2]['y'] ]\n\n # draw.line(p1[0],p1[1], p2[0], p2[1])\n # draw.line(p1[0],p1[1], p3[0], p3[1])\n # draw.line(p2[0],p2[1], p4[0], p4[1])\n # draw.line(p3[0],p3[1], p4[0], p4[1])\n # end\n\n # For drawing colored boxes around all symbols\n\n confidence_symbols_to_colors = {\n very_confidence: '#BED1D8',\n moderately_confidence: '#FFAE03',\n sort_of_confidence: '#E67F0D',\n low_confidence: '#E9190F'\n }\n\n numbers_to_confidence_symbols = {\n 80..100 => :very_confidence,\n 50..80 => :moderately_confidence,\n 31..50 => :sort_of_confidence,\n 0..30 => :low_confidence\n }\n\n pages = json[\"responses\"].first[\"fullTextAnnotation\"]['pages']\n blocks = pages.map{|p| p['blocks'] }.flatten.compact\n paragraphs = blocks.map{|b| b['paragraphs'] }.flatten.compact\n words = paragraphs.map{|p| p['words'] }.flatten.compact\n symbols = words.map{|w| w['symbols'] }.flatten.compact\n symbol_total = symbols.count\n symbols.each.with_index do |symbol, index|\n puts \"Processing symbol #{index} of #{symbol_count}\"\n bounding_box = symbol[\"boundingBox\"]\n vertices = bounding_box[\"vertices\"]\n confidence_number = (symbol['confidence'] * 100).to_i\n confidence_symbol = numbers_to_confidence_symbols.select{|n| n === confidence_number }.values.first\n color = confidence_symbols_to_colors[confidence_symbol]\n\n draw.stroke(color)\n draw.stroke_width(5)\n\n p1 = [ vertices[0]['x'], vertices[0]['y'] ]\n p2 = [ vertices[1]['x'], vertices[1]['y'] ]\n p3 = [ vertices[3]['x'], vertices[3]['y'] ]\n p4 = [ vertices[2]['x'], vertices[2]['y'] ]\n\n draw.line(p1[0],p1[1], p2[0], p2[1])\n draw.line(p1[0],p1[1], p3[0], p3[1])\n draw.line(p2[0],p2[1], p4[0], p4[1])\n draw.line(p3[0],p3[1], p4[0], p4[1])\n\n draw.draw(image)\n end\n output_image_path = \"/Users/kyle/Dropbox/code/kyletolle/handwriting_transcription/page#{page_number}.5px.symbols.jpg\"\n image.write(output_image_path)\nend","title":""},{"docid":"ff4d41530df1cd4bdaca6877500038c1","score":"0.48639157","text":"def update!(**args)\n @annotated_phrase = args[:annotated_phrase] if args.key?(:annotated_phrase)\n @annotations = args[:annotations] if args.key?(:annotations)\n @author = args[:author] if args.key?(:author)\n @byline_date = args[:byline_date] if args.key?(:byline_date)\n @constituency_node = args[:constituency_node] if args.key?(:constituency_node)\n @constituency_root = args[:constituency_root] if args.key?(:constituency_root)\n @content_firstseen = args[:content_firstseen] if args.key?(:content_firstseen)\n @content_type = args[:content_type] if args.key?(:content_type)\n @contentage = args[:contentage] if args.key?(:contentage)\n @date = args[:date] if args.key?(:date)\n @docid = args[:docid] if args.key?(:docid)\n @entity = args[:entity] if args.key?(:entity)\n @entity_label = args[:entity_label] if args.key?(:entity_label)\n @focus_entity = args[:focus_entity] if args.key?(:focus_entity)\n @golden = args[:golden] if args.key?(:golden)\n @http_headers = args[:http_headers] if args.key?(:http_headers)\n @hyperlink = args[:hyperlink] if args.key?(:hyperlink)\n @labeled_spans = args[:labeled_spans] if args.key?(:labeled_spans)\n @language = args[:language] if args.key?(:language)\n @last_significant_update = args[:last_significant_update] if args.key?(:last_significant_update)\n @measure = args[:measure] if args.key?(:measure)\n @privacy_sensitive = args[:privacy_sensitive] if args.key?(:privacy_sensitive)\n @relation = args[:relation] if args.key?(:relation)\n @rpc_error = args[:rpc_error] if args.key?(:rpc_error)\n @semantic_node = args[:semantic_node] if args.key?(:semantic_node)\n @subsection = args[:subsection] if args.key?(:subsection)\n @syntactic_date = args[:syntactic_date] if args.key?(:syntactic_date)\n @text = args[:text] if args.key?(:text)\n @title = args[:title] if args.key?(:title)\n @token = args[:token] if args.key?(:token)\n @topic = args[:topic] if args.key?(:topic)\n @trace = args[:trace] if args.key?(:trace)\n @url = args[:url] if args.key?(:url)\n end","title":""},{"docid":"e6f3529f7a5f1816ba07759fee42021e","score":"0.48614722","text":"def text= text\n raise RDoc::Error, 'replacing document-only comment is not allowed' if\n @text.nil? and @document\n\n @document = nil\n @text = text.nil? ? nil : text.dup\n end","title":""},{"docid":"3285009a79b3d34ecb92e4830f3b3316","score":"0.48585266","text":"def update\n respond_to do |format|\n if editable?(@project) and @annot.update(annot_params)\n format.html { redirect_to @annot, notice: 'Annot was successfully updated.' }\n format.json { render :show, status: :ok, location: @annot }\n else\n format.html { render :edit }\n format.json { render json: @annot.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"baf6b90719d18f004b111dcfa89237f8","score":"0.48554486","text":"def replace(p0) end","title":""},{"docid":"baf6b90719d18f004b111dcfa89237f8","score":"0.48554486","text":"def replace(p0) end","title":""},{"docid":"198505b90247bacf3c5a286330941df3","score":"0.485518","text":"def xreftext xrefstyle = nil\n reftext\n end","title":""},{"docid":"6c7b0d4fa84460397bbd975922b8db20","score":"0.48551318","text":"def update\n DOCUMENT_PATHS.each do |attr_name, path|\n if path.match(/\\*/)\n instance_variable_get(\"@#{attr_name}\").each do |simple_file_name, contents|\n replace_entry(\"word/#{simple_file_name}.xml\", contents.serialize(save_with: 0))\n end\n else\n xml_document = instance_variable_get(\"@#{attr_name}\")\n replace_entry path, xml_document.serialize(save_with: 0) if xml_document\n end\n end\n end","title":""},{"docid":"baf6b90719d18f004b111dcfa89237f8","score":"0.4854786","text":"def replace(p0) end","title":""},{"docid":"322be6eddcbbb811f1b30344bd86da9b","score":"0.4854515","text":"def get_document_square_annotations(name, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_document_square_annotations_with_http_info(name, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_document_square_annotations_with_http_info(name, opts)\n else\n raise\n end\n return data\n end","title":""},{"docid":"032072404cdf512e9a867e4cf4efd44e","score":"0.48492143","text":"def highlight_and_link(source, remove_top_namespace = false)\n\n # debug\n # is_page_of_interest = @context.registers[:page]['fancy_name'] =='reshape') \n \n if remove_top_namespace then \n page_namespace = @context.registers[:page]['namespace'] + \"::\"\n ns = page_namespace.split(\"::\")[0] + \"::\"\n end\n\n highlighted_types = @context.registers[:site].data['highlighted_types'] \n \n # for all types in highlighted_types, \n # - find them \n # - replace them with _X0001X_, _X0002X, which the highlighter will not cut\n # - highlight by calling Rouge\n # - replace back the _X0001X_, _X0002X with the name and adequate url\n # if remove_top_namespace is true, we rerun this a second type with the top namespace removed from the type\n # It is useful for signature when the namespace is not always explicit and would be verbose (e.g. nda:: everywhere in all nda:: functions ?)\n #\n repl_to_original = {}\n c = 1\n highlighted_types.each do |type, url|\n\n type_to_replace = type\n # we are going to run this twice : once with the full type, \n # once with the type_to_replace truncated from top ns if remove_top_namespace is true\n # lambda are closure, it will see the change in type_to_replace\n worker = lambda { \n # the type_to_replace, not followed by a word (e.g. array does not match array_adapter, and not preceded by a :)\n # e.g. array will match array, not nda::array (which could be matched in another part of the loop...), and NOT std::array !\n re = Regexp.new '(?' + r.strip + '
'\n\n repl_to_original.each do |repl, type|\n url = highlighted_types[type] \n\n if remove_top_namespace then\n type = type.gsub(ns, '')\n end\n re = Regexp.new '(' + repl + ')(?!\\w)'\n r = r.gsub(re){ |w| '%s' %[url, type]}\n end\n\n return r\n end","title":""},{"docid":"8a0c4cfa09a8ebcef8d4ccff99dbe030","score":"0.48334524","text":"def update\n concept = params[:concept] || \"\"\n type = params[:type] || \"\"\n note = params[:note] || \"\"\n no_update_note = params[:no_update_note] \n review_result = (params[:review_result] || 1).to_i\n type.strip!\n concept = @document.project.normalize_concept_id(concept, type)\n @error = nil \n if @project.collaborate_round?\n annotator = @document.assigns.map{|a| a.user.email_or_name}.uniq.sort.join(',')\n else\n annotator = current_user.email_or_name\n end\n \n Document.transaction do \n if (params[:mode] == \"true\" || params[:mode] == \"1\" || params[:mode] == \"concept\")\n logger.debug(\"update_concept\")\n\n if @assign.present? \n targets = Annotation.execute_sql(\"\n SELECT id FROM annotations \n WHERE assign_id = ? AND version = ? AND concept = ? AND a_type = ?\n \", @assign.id, @annotation.version, @annotation.concept, @annotation.a_type)\n elsif @project.manager?(current_user) || @project.collaborate_round\n targets = Annotation.execute_sql(\"\n SELECT id FROM annotations \n WHERE document_id = ? AND version = ? AND concept = ? AND a_type = ?\n \", @document.id, @annotation.version, @annotation.concept, @annotation.a_type)\n end\n\n @ids = targets.map{|e| e[0]}\n\n # @document.update_concept(@current_user.email, params[:id], @type, @concept, @note, @no_update_note)\n set_sql = \"concept=?, a_type=?\"\n values = [concept, type]\n set_sql = set_sql + \", review_result=? \"\n values << review_result\n\n if no_update_note.blank? || no_update_note == false\n set_sql = set_sql + \",note=? \"\n values << note\n end \n sql = \"UPDATE annotations\n SET #{set_sql}, annotator=?, updated_at=? \n WHERE \"\n values << annotator\n values << Time.now\n if @assign.present? \n sql = sql + \" assign_id = ? and version = ? \"\n values << @annotation.assign_id\n values << @annotation.version\n elsif @project.manager?(current_user) || @project.collaborate_round\n sql = sql + \" document_id = ? and version = ? \"\n values << @document.id\n values << @annotation.version\n end\n sql = sql + \" AND concept = ? AND a_type = ?\"\n values << @annotation.concept\n values << @annotation.a_type\n\n args = [sql] + values\n ret = Annotation.execute_sql(*args)\n else\n logger.debug(\"update_mention\")\n @annotation.concept = concept\n @annotation.a_type = type\n @annotation.note = note if no_update_note.blank? || no_update_note == false\n @annotation.annotator = annotator\n @annotation.review_result = review_result\n if !@annotation.save\n @error = @annotation.errors\n end\n @ids = [@annotation.id]\n end\n\n if @error.blank? && params[:annotate_all] == \"all\"\n text = (params[:text] || \"\").strip\n case_sensitive = (params[:case_sensitive] == \"y\")\n whole_word = (params[:whole_word] == \"y\")\n result = @document.annotate_all_by_text_into_db(@assign, current_user, annotator, text, type, concept, case_sensitive, whole_word, review_result, note)\n @ids += result\n end\n @annotations = Annotation.where(\"id in (?)\", @ids).all\n logger.debug(@ids.inspect)\n logger.debug(@annotations.inspect)\n @document.touch\n end\n respond_to do |format|\n if @error.blank?\n @document.create_audit(current_user, \"Update annotation\", params.to_json, @ids.join(\",\"))\n format.html { redirect_to @annotation, notice: 'The annotation was successfully updated.' }\n format.json { render :index, status: :ok, location: document_annotations_path(@document) }\n else\n format.html { render :edit }\n format.json { render json: @error, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"5516d4f84b8b6f6405eaaea43b6e9d1a","score":"0.48300216","text":"def replace(text,align=0,raw=false)\n draw_internal(text,align,true,raw)\n reposition_lines\n end","title":""},{"docid":"1f2c5ead14e06b4d267a106a88949941","score":"0.48234272","text":"def set_default_annotation\n return if study.default_options[:annotation].present?\n\n cell_metadatum = study.cell_metadata.keep_if(&:can_visualize?).first || study.cell_metadata.first\n cluster = study.cluster_groups.first\n if cluster.present?\n cell_annotation = cluster.cell_annotations.select { |annot| cluster.can_visualize_cell_annotation?(annot) }\n .first || cluster.cell_annotations.first\n else\n cell_annotation = nil\n end\n annotation_object = cell_metadatum || cell_annotation\n return if annotation_object.nil?\n\n if annotation_object.is_a?(CellMetadatum)\n study.default_options[:annotation] = annotation_object.annotation_select_value\n is_numeric = annotation_object.annotation_type == 'numeric'\n elsif annotation_object.is_a?(Hash) && cluster.present?\n study.default_options[:annotation] = cluster.annotation_select_value(annotation_object)\n is_numeric = annotation_object[:type] == 'numeric'\n end\n study.default_options[:color_profile] = 'Reds' if is_numeric\n end","title":""},{"docid":"73131df1f100f9c74507d336ec0be291","score":"0.48195538","text":"def document\n comment_code\n super\n end","title":""},{"docid":"c33bb8b2cc4c5cd008f5a5e1d78b235e","score":"0.481891","text":"def replace\n end","title":""},{"docid":"be6fd3b9fb9754f0179fb80d058809e7","score":"0.48151663","text":"def replace_document(out = nil)\n print out if out\n exit 202\n end","title":""},{"docid":"424e59a78294b28feefcec6f61d56696","score":"0.48112392","text":"def update\n @annotation = Annotation.find(params[:id])\n\n if @annotation.update(params[:annotation].permit(:start_video, :end_video, :text, :top_align, :left_align, :color))\n head :no_content\n else\n render json: @annotation.errors, status: :unprocessable_entity\n end\n end","title":""},{"docid":"d237bdad23cbcd48ae6c15cd1566a63f","score":"0.48025656","text":"def highlighter_suffix; end","title":""},{"docid":"d237bdad23cbcd48ae6c15cd1566a63f","score":"0.48025656","text":"def highlighter_suffix; end","title":""},{"docid":"dcaa92f45d43ddef45eed10f30027dce","score":"0.47841692","text":"def setMultipleCanvas\n # @annotationIn['canvas'] = '|'\n # @annotationIn['on'].each do |on|\n # @annotationIn['canvas'] += on['full'] + '|'\n # end\n # return @annotationIn['canvas']\n\n @annotationIn['on'][0]['full']\n end","title":""},{"docid":"ed2c0c96e6a44b285be350cc7815b7fc","score":"0.4774949","text":"def build_simple_attributes(document)\n simple_attributes.each do |a|\n document.send(\"#{a}=\", geo_concern.send(a.to_s))\n end\n end","title":""},{"docid":"bd0bfc838ae842e50e0daf3e640c18e7","score":"0.4774824","text":"def update\n @concept = params[:concept] || \"\"\n @type = params[:type] || \"\"\n @concept.strip!\n @type.strip!\n if params[:mode] == \"true\" || params[:mode] == \"1\"\n logger.debug(\"update_concept\")\n @document.update_concept(params[:id], @type, @concept)\n else\n logger.debug(\"update_mention\")\n @document.update_mention(params[:id], @type, @concept)\n end\n @entity_types = EntityType.where(collection_id: @document.collection_id)\n respond_to do |format|\n if true\n format.html { redirect_to @annotation, notice: 'The annotation was successfully updated.' }\n format.json { render :show, status: :ok, location: @annotation }\n else\n format.html { render :edit }\n format.json { render json: @annotation.errors, status: :unprocessable_entity }\n end\n end\n end","title":""},{"docid":"ff0d455829b5486ebdcf72533436bf2a","score":"0.47735092","text":"def set_annotation\n @annotation = Annotation.find(params[:id])\n end","title":""},{"docid":"ff0d455829b5486ebdcf72533436bf2a","score":"0.47735092","text":"def set_annotation\n @annotation = Annotation.find(params[:id])\n end","title":""}],"string":"[\n {\n \"docid\": \"1b86b38309513956fa41806b0049d2a1\",\n \"score\": \"0.6619264\",\n \"text\": \"def strip_annotations(content); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a7a9cf9d365088c03f4876141a14597a\",\n \"score\": \"0.63354915\",\n \"text\": \"def editAnnotation ## accepts annotation id\\n \\n\\t# Deprecate the old annotation\\n deleteAnnotation\\n \\n\\t# Create a new annotation linking back to the old one.\\n addAnnotation\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b7f75d124ac2e4646a334f0fdcdb4e41\",\n \"score\": \"0.6106981\",\n \"text\": \"def reid_annotations!(annotations, doc)\\n existing_ids = doc.get_annotation_hids(id)\\n unless existing_ids.empty?\\n id_change = {}\\n if annotations.has_key?(:denotations)\\n annotations[:denotations].each do |a|\\n id = a[:id]\\n id = Denotation.new_id while existing_ids.include?(id)\\n if id != a[:id]\\n id_change[a[:id]] = id\\n a[:id] = id\\n existing_ids << id\\n end\\n end\\n\\n if annotations.has_key?(:relations)\\n annotations[:relations].each do |a|\\n id = a[:id]\\n id = Relation.new_id while existing_ids.include?(id)\\n if id != a[:id]\\n id_change[a[:id]] = id\\n a[:id] = id\\n existing_ids << id\\n end\\n a[:subj] = id_change[a[:subj]] if id_change.has_key?(a[:subj])\\n a[:obj] = id_change[a[:obj]] if id_change.has_key?(a[:obj])\\n end\\n end\\n\\n if annotations.has_key?(:attributes)\\n Attrivute.new_id_init\\n annotations[:attributes].each do |a|\\n id = a[:id]\\n id = Attrivute.new_id while existing_ids.include?(id)\\n if id != a[:id]\\n a[:id] = id\\n existing_ids << id\\n end\\n a[:subj] = id_change[a[:subj]] if id_change.has_key?(a[:subj])\\n end\\n end\\n\\n if annotations.has_key?(:modifications)\\n annotations[:modifications].each do |a|\\n id = a[:id]\\n id = Modification.new_id while existing_ids.include?(id)\\n if id != a[:id]\\n a[:id] = id\\n existing_ids << id\\n end\\n end\\n end\\n end\\n end\\n\\n annotations\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cc9752b2355edb29a4dc946007ce1cad\",\n \"score\": \"0.6071591\",\n \"text\": \"def annotator; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"89e9494b2d0cea910b7b55485bc0a71a\",\n \"score\": \"0.57871026\",\n \"text\": \"def save_annotations!(annotations, doc, options = nil)\\n raise ArgumentError, \\\"nil document\\\" unless doc.present?\\n raise ArgumentError, \\\"the project does not have the document\\\" unless doc.projects.include?(self)\\n options ||= {}\\n\\n return ['upload is skipped due to existing annotations'] if options[:mode] == 'skip' && doc.denotations_num > 0\\n\\n messages = Annotation.prepare_annotations!(annotations, doc, options)\\n\\n case options[:mode]\\n when 'replace'\\n delete_doc_annotations(doc, options[:span])\\n reid_annotations!(annotations, doc) if options[:span].present?\\n when 'add'\\n reid_annotations!(annotations, doc)\\n when 'merge'\\n reid_annotations!(annotations, doc)\\n base_annotations = doc.hannotations(self, options[:span])\\n Annotation.prepare_annotations_for_merging!(annotations, base_annotations)\\n else\\n reid_annotations!(annotations, doc) if options[:span].present?\\n end\\n\\n instantiate_and_save_annotations(annotations, doc)\\n\\n messages\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b0bcd60aab5200ad654321bc9cb7b0df\",\n \"score\": \"0.56853545\",\n \"text\": \"def annotations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b0bcd60aab5200ad654321bc9cb7b0df\",\n \"score\": \"0.56853545\",\n \"text\": \"def annotations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b0bcd60aab5200ad654321bc9cb7b0df\",\n \"score\": \"0.56853545\",\n \"text\": \"def annotations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b0bcd60aab5200ad654321bc9cb7b0df\",\n \"score\": \"0.56853545\",\n \"text\": \"def annotations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b0bcd60aab5200ad654321bc9cb7b0df\",\n \"score\": \"0.56853545\",\n \"text\": \"def annotations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b0bcd60aab5200ad654321bc9cb7b0df\",\n \"score\": \"0.56853545\",\n \"text\": \"def annotations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b0bcd60aab5200ad654321bc9cb7b0df\",\n \"score\": \"0.56853545\",\n \"text\": \"def annotations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b0bcd60aab5200ad654321bc9cb7b0df\",\n \"score\": \"0.56853545\",\n \"text\": \"def annotations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8d6cf26d647d39ce7af16bbac7e5e2ab\",\n \"score\": \"0.56447047\",\n \"text\": \"def update!(**args)\\n @annotation = args[:annotation] if args.key?(:annotation)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8d6cf26d647d39ce7af16bbac7e5e2ab\",\n \"score\": \"0.56447047\",\n \"text\": \"def update!(**args)\\n @annotation = args[:annotation] if args.key?(:annotation)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d2e9aef217d3e728959e96a83e8926d\",\n \"score\": \"0.5587311\",\n \"text\": \"def postprocess(full_document)\\n full_document.gsub(/^-(\\\\*+)/m, '\\\\1')\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"085df0c1d79d7e82bc88dbecc1c42925\",\n \"score\": \"0.5552476\",\n \"text\": \"def update!(**args)\\n @annotations = args[:annotations] if args.key?(:annotations)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"085df0c1d79d7e82bc88dbecc1c42925\",\n \"score\": \"0.5552476\",\n \"text\": \"def update!(**args)\\n @annotations = args[:annotations] if args.key?(:annotations)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"905ee6c688bef68e717fa6e6a2a8901b\",\n \"score\": \"0.5549782\",\n \"text\": \"def after_save\\n df = DataFile.find_by_id(self.orig_data_file_id)\\n unless df.blank?\\n df.annotations.each do |a|\\n a.annotatable = self\\n #need to call update without callbacks, otherwise a new version is created\\n a.send(:update_without_callbacks)\\n\\n #versions for annotations are no longer enabled in SEEK - but this code is left here incase they are re-enabled in the future.\\n a.versions.each do |av|\\n av.annotatable =self\\n av.save\\n end\\n end\\n end\\n super\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a92a35369f2be5370fe7ef1f3c3510ea\",\n \"score\": \"0.5504119\",\n \"text\": \"def setMainDocumentCssAnnotation(value)\\n @fields['main_document_css_annotation'] = value\\n self\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4b55bd888d2e52a120d0ef910152b69c\",\n \"score\": \"0.5413313\",\n \"text\": \"def update!(**args)\\n @mask_annotation = args[:mask_annotation] if args.key?(:mask_annotation)\\n @polygon_annotation = args[:polygon_annotation] if args.key?(:polygon_annotation)\\n @polyline_annotation = args[:polyline_annotation] if args.key?(:polyline_annotation)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"49689e7d62c1040ca5fe740f0e1afd3c\",\n \"score\": \"0.5364461\",\n \"text\": \"def putAnnotation(text)\\n raise unless @state == :asm\\n if $enableInstrAnnotations\\n @outp.puts text\\n @annotation = nil\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cd9aa727998d173d4064cb4cdb5e6826\",\n \"score\": \"0.5362777\",\n \"text\": \"def collapse_document(doc); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"90334b39f60acc8b73d45910ebd46b92\",\n \"score\": \"0.53553283\",\n \"text\": \"def deleteAnnotation ## accepts annotation id\\n search_term = params[:id]\\n\\t# Find the annotation with the given ID\\n\\tanno = Annotation.find_by(id: search_term)\\n\\tanno.update(deprecated: true)\\n\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2c5651869b3593404d21c78ae71738cd\",\n \"score\": \"0.5354648\",\n \"text\": \"def text_annotation(rect, contents, options={})\\n options = options.merge(:Subtype => :Text, :Rect => rect, :Contents => contents)\\n write_note(options)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"71b60b4f73843f8efadbe0042c4b5559\",\n \"score\": \"0.5327387\",\n \"text\": \"def extra_annotations; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"951e4021cef5f4e11c6db9be7dd114aa\",\n \"score\": \"0.5320079\",\n \"text\": \"def annotate(annotation)\\n @research_object.create_annotation(@uri, annotation)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"18baae91d18386dc8d89efd383b23d76\",\n \"score\": \"0.5294318\",\n \"text\": \"def annotate_books!\\n update_attribute(:books, annotated_books)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1c3d35f02a61cc63e11875ce59edbf1b\",\n \"score\": \"0.52905077\",\n \"text\": \"def annotate_with(annotations, attr = 'tag', owner = User.current_user, user_owned_only = false)\\n if annotations.is_a?(String)\\n annotations = annotations.split(',').map(&:strip).uniq\\n elsif annotations.is_a?(Array)\\n annotations = annotations.map(&:strip).uniq\\n else\\n annotations = []\\n end\\n potential_values = Array(annotations).uniq(&:downcase).compact\\n\\n existing = send(\\\"#{attr}_annotations\\\")\\n\\n params = {}\\n param_index = 0\\n\\n any_deletes = false\\n duplicates = []\\n existing.each do |ann|\\n if user_owned_only && ann.source != owner\\n params[(param_index += 1).to_s] = { id: ann.id }\\n elsif ann.persisted?\\n index = potential_values.index { |v| v.casecmp(ann.value_content) == 0 }\\n if index\\n duplicates << index\\n params[(param_index += 1).to_s] = { id: ann.id }\\n else\\n any_deletes = true\\n params[(param_index += 1).to_s] = { id: ann.id, _destroy: true }\\n end\\n end\\n end\\n\\n potential_values.delete_if.with_index { |_, i| duplicates.include?(i) }\\n\\n potential_values.each do |value|\\n # Annotation model can take either a String or an AR object as the value\\n text_value = TextValue.where('lower(text) = ?', value.downcase).first || value\\n params[(param_index += 1).to_s] = { source_type: owner.class.name, source_id: owner.id,\\n attribute_name: attr, value: text_value }\\n end\\n\\n send(\\\"#{attr}_annotations\\\").reset # Clear any previously assigned, but unsaved annotations\\n send(\\\"#{attr}_annotations_attributes=\\\", params)\\n\\n potential_values.any? || any_deletes\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d4a45dc3106230230b53188f289afc18\",\n \"score\": \"0.52787244\",\n \"text\": \"def text_annotation(rect, contents, options = {})\\n options = options.merge(Subtype: :Text, Rect: rect, Contents: contents)\\n annotate(options)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d007d4b76561e47f75321e0650a1ba67\",\n \"score\": \"0.52771777\",\n \"text\": \"def call\\n refs = replace_refs\\n replace_references(refs)\\n\\n doc\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e70f3295372a2ff6218814328796c756\",\n \"score\": \"0.5261989\",\n \"text\": \"def post_process(doc)\\n doc.gsub(\\\"\\\\n\\\",'')\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"455f7f02af79ec93bae3f71a7e03f522\",\n \"score\": \"0.5245364\",\n \"text\": \"def update!(**args)\\n @annotations_set = args[:annotations_set] if args.key?(:annotations_set)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dfeb84ff402ba6a6127a00e08dd41a5e\",\n \"score\": \"0.5243474\",\n \"text\": \"def replace_with_existing_offsets(offsets, annual_rules); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3a6e203ed5692c8046ec743018e83247\",\n \"score\": \"0.52334267\",\n \"text\": \"def annotate(node, annotations, discard: false)\\n node = node.dup\\n\\n annotations.each do |name|\\n n = node.element_children.find{ |child| child.name == name }\\n\\n if n\\n case n.name\\n when 'annotation'\\n allowed_attributes(n)\\n ns = node_set(n.element_children, size: 1, names: ['documentation'], optional: ['lang'], children: 'any') # discard lang (\\\"en\\\")\\n attributes = {annotation: ns[0].text.split(\\\"\\\\n\\\").map(&:strip).join(\\\"\\\\n\\\").strip}\\n\\n when 'unique'\\n allowed_attributes(n, required: ['name']) # discard name (\\\"lg\\\")\\n ns = node_set(n.element_children, size: 2, index: 1, names: ['field'], attributes: ['xpath'], xml: {0 => ''})\\n attributes = {unique: ns[1]['xpath']}\\n\\n else\\n assert false, \\\"unexpected #{n.name}\\\", n\\n end\\n\\n if !discard\\n set_last(node, attributes)\\n end\\n\\n n.unlink\\n end\\n end\\n\\n node\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c14ea62929cd6c991f525470d2859977\",\n \"score\": \"0.52257437\",\n \"text\": \"def update\\n replace_entry \\\"word/document.xml\\\", doc.serialize(:save_with => 0)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6a2d621a6eb886249befc5d258705f1e\",\n \"score\": \"0.52204394\",\n \"text\": \"def update!(**args)\\n @evaluated_annotations = args[:evaluated_annotations] if args.key?(:evaluated_annotations)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c0eb66b01713b052078585c43d6d332a\",\n \"score\": \"0.51983255\",\n \"text\": \"def extract_annotations_from(file, pattern); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be1c32db2c89f77c14b9efd0aa042f72\",\n \"score\": \"0.5169427\",\n \"text\": \"def reset_default_annotation(study:)\\n current_default = study.default_annotation\\n annot_name, annot_type, annot_scope = current_default&.split('--')\\n case annot_scope\\n when 'study'\\n current_default = nil if study.cell_metadata.by_name_and_type(annot_name, annot_type).nil?\\n when 'cluster'\\n cluster = study.default_cluster\\n annotation = cluster&.cell_annotations&.detect { |ca| ca[:name] == annot_name && ca[:type] == annot_type }\\n current_default = nil if cluster.nil? || annotation.nil?\\n else\\n current_default = nil\\n end\\n if study.default_annotation != current_default\\n study.default_options[:annotation] = current_default\\n study.save\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a5dceffc43fe48ff17bc1a0a3dc43d2e\",\n \"score\": \"0.51594573\",\n \"text\": \"def docbook_pgl( text )\\n DOCBOOK_GLYPHS.each do |re, resub, tog|\\n next if tog and method( tog ).call\\n text.gsub! re, resub\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"008a30f44bdceba6fb560119ec5164db\",\n \"score\": \"0.5153088\",\n \"text\": \"def add_existing_annotation\\n @text = AnnotationText.find(params[:annotation_text_id])\\n @submission_file_id = params[:submission_file_id]\\n @submission_file = SubmissionFile.find(@submission_file_id)\\n @annotation = Annotation.new\\n @annotation.update_attributes({\\n line_start: params[:line_start],\\n line_end: params[:line_end],\\n submission_file_id: params[:submission_file_id]\\n })\\n @annotation.annotation_text = @text\\n @annotation.save\\n @submission = @submission_file.submission\\n @annotations = @submission.annotations\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e80f28e5924ca7a533f019a18f931dc5\",\n \"score\": \"0.5125421\",\n \"text\": \"def typogrify(doc)\\n content = doc.output\\n return unless content.include?(BODY_START_TAG)\\n\\n doc.output = replace_selected_content(content, config_for_doc(doc))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7bdb042d61f38bb902dd13f5fe33160a\",\n \"score\": \"0.5123733\",\n \"text\": \"def process(doc)\\n doc.css('[fill^=\\\"url(#\\\"]').attr(\\\"fill\\\", \\\"#ffffff\\\")\\n doc.css('[style*=\\\"fill:url(#\\\"]').each do |el|\\n style = el.attribute(\\\"style\\\").to_s\\n updated_style = style.gsub(/fill:url\\\\([^\\\\)]*\\\\)/, \\\"fill:#ffffff\\\")\\n el[\\\"style\\\"] = updated_style\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"99a69e9bad8817c23aa088d62b35101d\",\n \"score\": \"0.51195323\",\n \"text\": \"def process!(document); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7a75ce1c715aaf9af5998ecf0551ebde\",\n \"score\": \"0.5112739\",\n \"text\": \"def postprocess(document)\\n document.gsub(\\\"\\\\n\\\", ' ').strip\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f3f0ffdfa4dba621e0683131a3fbc302\",\n \"score\": \"0.5112038\",\n \"text\": \"def annotate(tag)\\n tag\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f3f0ffdfa4dba621e0683131a3fbc302\",\n \"score\": \"0.5112038\",\n \"text\": \"def annotate(tag)\\n tag\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9cd0e50544734b17fb1609702e2aea53\",\n \"score\": \"0.5086522\",\n \"text\": \"def create\\n @text = (params[:text] || \\\"\\\").strip\\n @offset = (params[:offset] || \\\"-1\\\").to_i\\n @concept = params[:concept] || \\\"\\\"\\n @type = params[:type] || \\\"\\\"\\n @note = params[:note] || \\\"\\\"\\n assign_id = @assign.id if @assign.present?\\n @concept = @document.project.normalize_concept_id(@concept, @type)\\n\\n @is_manager = @project.manager?(current_user)\\n if @project.collaborate_round?\\n annotator = @document.assigns.map{|a| a.user.email_or_name}.uniq.sort.join(',')\\n else\\n annotator = current_user.email_or_name\\n end\\n\\n Annotation.transaction do\\n max_id = @document.annotations.maximum('a_id_no') || 0;\\n @annotation = Annotation.create!({\\n a_id: max_id + 1,\\n a_id_no: max_id + 1,\\n a_type: @type, \\n concept: @concept,\\n assign_id: assign_id,\\n user_id: current_user.id,\\n content: @text,\\n note: params[:note] || \\\"\\\",\\n offset: (params[:offset] || \\\"-1\\\").to_i,\\n passage: params[:passage_id],\\n document_id: @document.id,\\n project_id: @document.project_id,\\n annotator: annotator,\\n version: @document.version,\\n review_result: 'agreed',\\n infons: {}\\n });\\n if @project.collaborate_round\\n @annotation.compute_review_result(nil)\\n else\\n @annotation.compute_review_result(@assign)\\n end\\n @document.touch\\n end\\n\\n # @ret = @document.add_annotation(@current_user.email, @text, @offset, @type, @concept, @note)\\n # @entity_types = EntityType.where(project_id: @document.project_id)\\n @document.create_audit(current_user, 'Create annotation', params.to_json, @annotation.to_json)\\n respond_to do |format|\\n format.html { redirect_to @annotation, notice: 'The annotation was successfully created.' }\\n format.json { render :show, status: :ok, location: @annotation }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ccf25c010a2380cb04f976380304ebd6\",\n \"score\": \"0.50837785\",\n \"text\": \"def process_annotation(params=nil)\\n validate_params_solr_population(Sinatra::Helpers::SearchHelper::ALLOWED_INCLUDES_PARAMS)\\n params ||= @params\\n params_copy = params.dup\\n\\n text = params_copy.delete(\\\"text\\\")\\n error 400, 'A text to be annotated must be supplied using the argument text=' if text.nil? || text.strip.empty?\\n\\n acronyms = restricted_ontologies_to_acronyms(params_copy)\\n params_copy.delete(\\\"ontologies\\\")\\n semantic_types = semantic_types_param(params_copy)\\n params_copy.delete(\\\"semantic_types\\\")\\n expand_class_hierarchy = params_copy.delete(\\\"expand_class_hierarchy\\\").eql?('true') # default = false\\n class_hierarchy_max_level = params_copy.delete(\\\"class_hierarchy_max_level\\\").to_i # default = 0\\n use_semantic_types_hierarchy = params_copy.delete(\\\"expand_semantic_types_hierarchy\\\").eql?('true') # default = false\\n longest_only = params_copy.delete(\\\"longest_only\\\").eql?('true') # default = false\\n expand_with_mappings = params_copy.delete(\\\"expand_mappings\\\").eql?('true') # default = false\\n exclude_nums = params_copy.delete(\\\"exclude_numbers\\\").eql?('true') # default = false\\n whole_word_only = params_copy.delete(\\\"whole_word_only\\\").eql?('false') ? false : true # default = true\\n min_term_size = params_copy.delete(\\\"minimum_match_length\\\").to_i # default = 0\\n exclude_synonyms = params_copy.delete(\\\"exclude_synonyms\\\").eql?('true') # default = false\\n recognizer = (Annotator.settings.enable_recognizer_param && params_copy[\\\"recognizer\\\"]) || 'mgrep'\\n params_copy.delete(\\\"recognizer\\\")\\n\\n annotator = nil\\n\\n # see if a name of the recognizer has been passed in, use default if not or error\\n begin\\n recognizer = recognizer.capitalize\\n clazz = \\\"Annotator::Models::Recognizers::#{recognizer}\\\".split('::').inject(Object) {|o, c| o.const_get c}\\n annotator = clazz.new\\n rescue\\n annotator = Annotator::Models::Recognizers::Mgrep.new\\n end\\n\\n if params_copy[\\\"stop_words\\\"]\\n annotator.stop_words = params_copy.delete(\\\"stop_words\\\")\\n end\\n\\n params_copy.delete(\\\"display\\\")\\n options = {\\n ontologies: acronyms,\\n semantic_types: semantic_types,\\n use_semantic_types_hierarchy: use_semantic_types_hierarchy,\\n filter_integers: exclude_nums,\\n expand_class_hierarchy: expand_class_hierarchy,\\n expand_hierarchy_levels: class_hierarchy_max_level,\\n expand_with_mappings: expand_with_mappings,\\n min_term_size: min_term_size,\\n whole_word_only: whole_word_only,\\n with_synonyms: !exclude_synonyms,\\n longest_only: longest_only\\n }\\n options = params_copy.symbolize_keys().merge(options)\\n\\n begin\\n annotations = annotator.annotate(text, options)\\n\\n unless includes_param.empty?\\n # Move include param to special param so it only applies to classes\\n params[\\\"include_for_class\\\"] = includes_param\\n params.delete(\\\"display\\\")\\n params.delete(\\\"include\\\")\\n env[\\\"rack.request.query_hash\\\"] = params\\n\\n orig_classes = annotations.map {|a| [a.annotatedClass, a.hierarchy.map {|h| h.annotatedClass}, a.mappings.map {|m| m.annotatedClass}]}.flatten\\n classes_hash = populate_classes_from_search(orig_classes, acronyms)\\n annotations = replace_empty_classes(annotations, classes_hash) do |a|\\n replace_empty_classes(a.hierarchy, classes_hash)\\n replace_empty_classes(a.mappings, classes_hash)\\n end\\n end\\n rescue LinkedData::Models::Ontology::ParsedSubmissionError => e\\n error 404, e.message\\n rescue Annotator::Models::NcboAnnotator::BadSemanticTypeError => e\\n error 404, e.message\\n end\\n\\n reply 200, annotations\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8836191fdc495dd46c2e013990454fe3\",\n \"score\": \"0.5072349\",\n \"text\": \"def replace_bbox(data)\\n regex = /(id='word_\\\\d+')\\\\s(title=\\\"\\\\w{4}\\\\s+(\\\\d+)\\\\s+(\\\\d+)\\\\s+(\\\\d+)\\\\s+(\\\\d+)\\\")/\\n data.gsub(regex) {\\\"#{$1} style='left: #{$3.to_i/5}px\\\\; top: #{$4.to_i/5}px\\\\;'\\\"}\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a8fa974a27861953dcd9867c17a97107\",\n \"score\": \"0.50616026\",\n \"text\": \"def prepare_annotation_as_save_template(annotation)\\n ensure_primary_annotation_has_hook(annotation) if annotation.class.primary?\\n annotation\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38bf1b5215fa230f4422b6b0a87dd0d1\",\n \"score\": \"0.5047189\",\n \"text\": \"def document=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38bf1b5215fa230f4422b6b0a87dd0d1\",\n \"score\": \"0.5047189\",\n \"text\": \"def document=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38bf1b5215fa230f4422b6b0a87dd0d1\",\n \"score\": \"0.5047189\",\n \"text\": \"def document=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38bf1b5215fa230f4422b6b0a87dd0d1\",\n \"score\": \"0.5047189\",\n \"text\": \"def document=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38bf1b5215fa230f4422b6b0a87dd0d1\",\n \"score\": \"0.5047189\",\n \"text\": \"def document=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38bf1b5215fa230f4422b6b0a87dd0d1\",\n \"score\": \"0.5047189\",\n \"text\": \"def document=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38bf1b5215fa230f4422b6b0a87dd0d1\",\n \"score\": \"0.5047189\",\n \"text\": \"def document=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38bf1b5215fa230f4422b6b0a87dd0d1\",\n \"score\": \"0.5047189\",\n \"text\": \"def document=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38bf1b5215fa230f4422b6b0a87dd0d1\",\n \"score\": \"0.5047189\",\n \"text\": \"def document=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2b60d4f12d94d5d20eb43c8f3bd17b4c\",\n \"score\": \"0.50422823\",\n \"text\": \"def detected_styles=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cbe993ca13f5f50ad489abf8d79053a5\",\n \"score\": \"0.5030876\",\n \"text\": \"def add_to_doc idea\\n GDFile.update_from_string(\\n append_idea(IdeaTemplate % [idea[:user],\\n idea[:message],\\n idea[:link]] ))\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd0aef64f6577d1ea3dc2a58f16e7abd\",\n \"score\": \"0.5029578\",\n \"text\": \"def create\\n @text = (params[:text] || \\\"\\\").strip\\n @offset = (params[:offset] || \\\"-1\\\").to_i\\n @concept = params[:concept] || \\\"\\\"\\n @type = params[:type] || \\\"\\\"\\n\\n @ret = @document.add_annotation(@text, @offset, @type, @concept)\\n @entity_types = EntityType.where(collection_id: @document.collection_id)\\n\\n respond_to do |format|\\n format.html { redirect_to @annotation, notice: 'The annotation was successfully created.' }\\n format.json { render :show, status: :ok, location: @annotation }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"48b146c5a9946e554968fe443485d373\",\n \"score\": \"0.50278914\",\n \"text\": \"def update!(**args)\\n @annotation_spec_id = args[:annotation_spec_id] if args.key?(:annotation_spec_id)\\n @display_name = args[:display_name] if args.key?(:display_name)\\n @text_segment = args[:text_segment] if args.key?(:text_segment)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d14cc18151b9bfab1c6aa194adfbc35d\",\n \"score\": \"0.4977184\",\n \"text\": \"def get_document_squiggly_annotations(name, opts = {})\\n @api_client.request_token_if_needed\\n data, _status_code, _headers = get_document_squiggly_annotations_with_http_info(name, opts)\\n rescue ApiError => error\\n if error.code == 401\\n @api_client.request_token_if_needed\\n data, _status_code, _headers = get_document_squiggly_annotations_with_http_info(name, opts)\\n else\\n raise\\n end\\n return data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ddc00099ca108ca932b9bc7d88290fe4\",\n \"score\": \"0.49721196\",\n \"text\": \"def replace_concepts(s)\\n concepts = find_concepts(s).uniq\\n #debugger\\n concepts.each do |e|\\n title = @ct[e[0]]\\n #puts \\\"Replacing #{title}\\\"\\n s.gsub!(/#{title}/i, \\\"#{e[0]}_#{title.to_id}\\\")\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"37f0e45826de04ad4d81424f6bf0095e\",\n \"score\": \"0.49686298\",\n \"text\": \"def get_document_square_annotations_with_http_info(name, opts = {})\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"Calling API: PdfApi.get_document_square_annotations ...\\\"\\n end\\n # verify the required parameter 'name' is set\\n if @api_client.config.client_side_validation && name.nil?\\n fail ArgumentError, \\\"Missing the required parameter 'name' when calling PdfApi.get_document_square_annotations\\\"\\n end\\n # resource path\\n local_var_path = \\\"/pdf/{name}/annotations/square\\\".sub('{' + 'name' + '}', name.to_s)\\n\\n # query parameters\\n query_params = {}\\n query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?\\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?\\n\\n # header parameters\\n header_params = {}\\n # HTTP header 'Accept' (if needed)\\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\\n # HTTP header 'Content-Type'\\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\\n\\n # form parameters\\n form_params = {}\\n # Fix header in file\\n post_body = nil\\n\\n # http body (model)\\n # Fix header in file\\n # post_body = nil\\n auth_names = ['JWT']\\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\\n :header_params => header_params,\\n :query_params => query_params,\\n :form_params => form_params,\\n :body => post_body,\\n :auth_names => auth_names,\\n :return_type => 'SquareAnnotationsResponse')\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"API called: PdfApi#get_document_square_annotations\\\\nData: #{data.inspect}\\\\nStatus code: #{status_code}\\\\nHeaders: #{headers}\\\"\\n end\\n return data, status_code, headers\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a265882a608079a89761ff23630457e1\",\n \"score\": \"0.49577183\",\n \"text\": \"def post_process(doc)\\n doc\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"82c6074cd433cd7306a509459a4a5f8d\",\n \"score\": \"0.49283475\",\n \"text\": \"def _updated_annotator(alpha, beta, mu_winner, sigma_sq_winner, mu_loser, sigma_sq_loser)\\n\\t c_1 = exp(mu_winner) / (exp(mu_winner) + exp(mu_loser)) + 0.5 *\\n\\t (sigma_sq_winner + sigma_sq_loser) *\\n\\t (exp(mu_winner) * exp(mu_loser) * (exp(mu_loser) - exp(mu_winner))) /\\n\\t ((exp(mu_winner) + exp(mu_loser)) ** 3)\\n\\t c_2 = 1 - c_1\\n\\t c = (c_1 * alpha + c_2 * beta) / (alpha + beta)\\n\\n\\t expt = (c_1 * (alpha + 1) * alpha + c_2 * alpha * beta) /\\n\\t (c * (alpha + beta + 1) * (alpha + beta))\\n\\t expt_sq = (c_1 * (alpha + 2) * (alpha + 1) * alpha + c_2 * (alpha + 1) * alpha * beta) /\\n\\t (c * (alpha + beta + 2) * (alpha + beta + 1) * (alpha + beta))\\n\\n\\t variance = (expt_sq - expt ** 2)\\n\\t updated_alpha = ((expt - expt_sq) * expt) / variance\\n\\t updated_beta = (expt - expt_sq) * (1 - expt) / variance\\n\\n\\t [updated_alpha, updated_beta, c]\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9f4ef9db0771ef0c80811bfc2f3268bb\",\n \"score\": \"0.49212003\",\n \"text\": \"def replace_all(source_text, replacement)\\n case\\n # For simple cases we just replace runs to try and keep formatting/layout of source\\n when replacement.is_a?(String)\\n @main_doc.replace_all_with_text(source_text, replacement)\\n when (replacement.is_a?(Magick::Image) or replacement.is_a?(Magick::ImageList))\\n runs = @main_doc.replace_all_with_empty_runs(source_text)\\n runs.each { |r| r.replace_with_run_fragment(create_image_run_fragment(replacement)) }\\n when replacement.is_a?(Hash)\\n runs = @main_doc.replace_all_with_empty_runs(source_text)\\n runs.each { |r| r.replace_with_body_fragments(create_body_fragments(replacement, {:create_table => true})) }\\n when replacement.is_a?(Nokogiri::XML::Element)\\n runs = @main_doc.replace_all_with_empty_runs(source_text)\\n if replacement.name == \\\"w:tbl\\\"\\n runs.each { |r| r.replace_with_body_fragments(create_body_fragments(replacement)) }\\n else\\n runs.each { |r| r.replace_with_run_fragment(create_body_fragments(replacement)) }\\n end\\n else\\n runs = @main_doc.replace_all_with_empty_runs(source_text)\\n runs.each { |r| r.replace_with_body_fragments(create_body_fragments(replacement)) }\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dc5f7658c2081b39f4f152c757db55e8\",\n \"score\": \"0.4901373\",\n \"text\": \"def update!(**args)\\n @additional_annotation_data = args[:additional_annotation_data] if args.key?(:additional_annotation_data)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e538f49e55e2d8eba2b7d21b9d8456b9\",\n \"score\": \"0.48888347\",\n \"text\": \"def get_document_squiggly_annotations_with_http_info(name, opts = {})\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"Calling API: PdfApi.get_document_squiggly_annotations ...\\\"\\n end\\n # verify the required parameter 'name' is set\\n if @api_client.config.client_side_validation && name.nil?\\n fail ArgumentError, \\\"Missing the required parameter 'name' when calling PdfApi.get_document_squiggly_annotations\\\"\\n end\\n # resource path\\n local_var_path = \\\"/pdf/{name}/annotations/squiggly\\\".sub('{' + 'name' + '}', name.to_s)\\n\\n # query parameters\\n query_params = {}\\n query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?\\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?\\n\\n # header parameters\\n header_params = {}\\n # HTTP header 'Accept' (if needed)\\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\\n # HTTP header 'Content-Type'\\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\\n\\n # form parameters\\n form_params = {}\\n # Fix header in file\\n post_body = nil\\n\\n # http body (model)\\n # Fix header in file\\n # post_body = nil\\n auth_names = ['JWT']\\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\\n :header_params => header_params,\\n :query_params => query_params,\\n :form_params => form_params,\\n :body => post_body,\\n :auth_names => auth_names,\\n :return_type => 'SquigglyAnnotationsResponse')\\n if @api_client.config.debugging\\n @api_client.config.logger.debug \\\"API called: PdfApi#get_document_squiggly_annotations\\\\nData: #{data.inspect}\\\\nStatus code: #{status_code}\\\\nHeaders: #{headers}\\\"\\n end\\n return data, status_code, headers\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e82666c2c9e0fa685a00c0ccfb925220\",\n \"score\": \"0.488784\",\n \"text\": \"def regenerate?(document); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"413ca7c9ba30655c67800ac58e35bd89\",\n \"score\": \"0.48779836\",\n \"text\": \"def doc_transformed(root)\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b8ffe73f6b02d291ee8b08bd6d6b3eb5\",\n \"score\": \"0.4877485\",\n \"text\": \"def annotate(message); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f937bf774fe6e59a7a6b4e0e6babdcb1\",\n \"score\": \"0.48683724\",\n \"text\": \"def annotate(tag)\\n tag\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eba6a396f47674ef4d00ddff5b6d6ac5\",\n \"score\": \"0.4866774\",\n \"text\": \"def single_image\\n page_number = 1\\n\\n input_image_path = \\\"/Users/kyle/Dropbox/code/kyletolle/handwriting_transcription/page#{page_number}.jpg\\\"\\n image = Magick::Image.read(input_image_path)[0]\\n json_path =\\\"/Users/kyle/Dropbox/code/kyletolle/handwriting_transcription/output-#{page_number}-to-#{page_number}.json\\\"\\n json_text = File.read(json_path)\\n json = JSON.parse(json_text)\\n\\n bounding_box = json[\\\"responses\\\"].first[\\\"textAnnotations\\\"][1][\\\"boundingPoly\\\"]\\n vertices = bounding_box[\\\"vertices\\\"]\\n\\n draw = Magick::Draw.new\\n\\n # For drawing boxes around all words.\\n # text_annotations = json[\\\"responses\\\"].first[\\\"textAnnotations\\\"][1..-1]\\n # text_annotations.each do |text_annotation|\\n # bounding_box = text_annotation[\\\"boundingPoly\\\"]\\n # vertices = bounding_box[\\\"vertices\\\"]\\n\\n # p1 = [ vertices[0]['x'], vertices[0]['y'] ]\\n # p2 = [ vertices[1]['x'], vertices[1]['y'] ]\\n # p3 = [ vertices[3]['x'], vertices[3]['y'] ]\\n # p4 = [ vertices[2]['x'], vertices[2]['y'] ]\\n\\n # draw.line(p1[0],p1[1], p2[0], p2[1])\\n # draw.line(p1[0],p1[1], p3[0], p3[1])\\n # draw.line(p2[0],p2[1], p4[0], p4[1])\\n # draw.line(p3[0],p3[1], p4[0], p4[1])\\n # end\\n\\n # For drawing colored boxes around all symbols\\n\\n confidence_symbols_to_colors = {\\n very_confidence: '#BED1D8',\\n moderately_confidence: '#FFAE03',\\n sort_of_confidence: '#E67F0D',\\n low_confidence: '#E9190F'\\n }\\n\\n numbers_to_confidence_symbols = {\\n 80..100 => :very_confidence,\\n 50..80 => :moderately_confidence,\\n 31..50 => :sort_of_confidence,\\n 0..30 => :low_confidence\\n }\\n\\n pages = json[\\\"responses\\\"].first[\\\"fullTextAnnotation\\\"]['pages']\\n blocks = pages.map{|p| p['blocks'] }.flatten.compact\\n paragraphs = blocks.map{|b| b['paragraphs'] }.flatten.compact\\n words = paragraphs.map{|p| p['words'] }.flatten.compact\\n symbols = words.map{|w| w['symbols'] }.flatten.compact\\n symbol_total = symbols.count\\n symbols.each.with_index do |symbol, index|\\n puts \\\"Processing symbol #{index} of #{symbol_count}\\\"\\n bounding_box = symbol[\\\"boundingBox\\\"]\\n vertices = bounding_box[\\\"vertices\\\"]\\n confidence_number = (symbol['confidence'] * 100).to_i\\n confidence_symbol = numbers_to_confidence_symbols.select{|n| n === confidence_number }.values.first\\n color = confidence_symbols_to_colors[confidence_symbol]\\n\\n draw.stroke(color)\\n draw.stroke_width(5)\\n\\n p1 = [ vertices[0]['x'], vertices[0]['y'] ]\\n p2 = [ vertices[1]['x'], vertices[1]['y'] ]\\n p3 = [ vertices[3]['x'], vertices[3]['y'] ]\\n p4 = [ vertices[2]['x'], vertices[2]['y'] ]\\n\\n draw.line(p1[0],p1[1], p2[0], p2[1])\\n draw.line(p1[0],p1[1], p3[0], p3[1])\\n draw.line(p2[0],p2[1], p4[0], p4[1])\\n draw.line(p3[0],p3[1], p4[0], p4[1])\\n\\n draw.draw(image)\\n end\\n output_image_path = \\\"/Users/kyle/Dropbox/code/kyletolle/handwriting_transcription/page#{page_number}.5px.symbols.jpg\\\"\\n image.write(output_image_path)\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ff4d41530df1cd4bdaca6877500038c1\",\n \"score\": \"0.48639157\",\n \"text\": \"def update!(**args)\\n @annotated_phrase = args[:annotated_phrase] if args.key?(:annotated_phrase)\\n @annotations = args[:annotations] if args.key?(:annotations)\\n @author = args[:author] if args.key?(:author)\\n @byline_date = args[:byline_date] if args.key?(:byline_date)\\n @constituency_node = args[:constituency_node] if args.key?(:constituency_node)\\n @constituency_root = args[:constituency_root] if args.key?(:constituency_root)\\n @content_firstseen = args[:content_firstseen] if args.key?(:content_firstseen)\\n @content_type = args[:content_type] if args.key?(:content_type)\\n @contentage = args[:contentage] if args.key?(:contentage)\\n @date = args[:date] if args.key?(:date)\\n @docid = args[:docid] if args.key?(:docid)\\n @entity = args[:entity] if args.key?(:entity)\\n @entity_label = args[:entity_label] if args.key?(:entity_label)\\n @focus_entity = args[:focus_entity] if args.key?(:focus_entity)\\n @golden = args[:golden] if args.key?(:golden)\\n @http_headers = args[:http_headers] if args.key?(:http_headers)\\n @hyperlink = args[:hyperlink] if args.key?(:hyperlink)\\n @labeled_spans = args[:labeled_spans] if args.key?(:labeled_spans)\\n @language = args[:language] if args.key?(:language)\\n @last_significant_update = args[:last_significant_update] if args.key?(:last_significant_update)\\n @measure = args[:measure] if args.key?(:measure)\\n @privacy_sensitive = args[:privacy_sensitive] if args.key?(:privacy_sensitive)\\n @relation = args[:relation] if args.key?(:relation)\\n @rpc_error = args[:rpc_error] if args.key?(:rpc_error)\\n @semantic_node = args[:semantic_node] if args.key?(:semantic_node)\\n @subsection = args[:subsection] if args.key?(:subsection)\\n @syntactic_date = args[:syntactic_date] if args.key?(:syntactic_date)\\n @text = args[:text] if args.key?(:text)\\n @title = args[:title] if args.key?(:title)\\n @token = args[:token] if args.key?(:token)\\n @topic = args[:topic] if args.key?(:topic)\\n @trace = args[:trace] if args.key?(:trace)\\n @url = args[:url] if args.key?(:url)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e6f3529f7a5f1816ba07759fee42021e\",\n \"score\": \"0.48614722\",\n \"text\": \"def text= text\\n raise RDoc::Error, 'replacing document-only comment is not allowed' if\\n @text.nil? and @document\\n\\n @document = nil\\n @text = text.nil? ? nil : text.dup\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3285009a79b3d34ecb92e4830f3b3316\",\n \"score\": \"0.48585266\",\n \"text\": \"def update\\n respond_to do |format|\\n if editable?(@project) and @annot.update(annot_params)\\n format.html { redirect_to @annot, notice: 'Annot was successfully updated.' }\\n format.json { render :show, status: :ok, location: @annot }\\n else\\n format.html { render :edit }\\n format.json { render json: @annot.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"baf6b90719d18f004b111dcfa89237f8\",\n \"score\": \"0.48554486\",\n \"text\": \"def replace(p0) end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"baf6b90719d18f004b111dcfa89237f8\",\n \"score\": \"0.48554486\",\n \"text\": \"def replace(p0) end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"198505b90247bacf3c5a286330941df3\",\n \"score\": \"0.485518\",\n \"text\": \"def xreftext xrefstyle = nil\\n reftext\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6c7b0d4fa84460397bbd975922b8db20\",\n \"score\": \"0.48551318\",\n \"text\": \"def update\\n DOCUMENT_PATHS.each do |attr_name, path|\\n if path.match(/\\\\*/)\\n instance_variable_get(\\\"@#{attr_name}\\\").each do |simple_file_name, contents|\\n replace_entry(\\\"word/#{simple_file_name}.xml\\\", contents.serialize(save_with: 0))\\n end\\n else\\n xml_document = instance_variable_get(\\\"@#{attr_name}\\\")\\n replace_entry path, xml_document.serialize(save_with: 0) if xml_document\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"baf6b90719d18f004b111dcfa89237f8\",\n \"score\": \"0.4854786\",\n \"text\": \"def replace(p0) end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"322be6eddcbbb811f1b30344bd86da9b\",\n \"score\": \"0.4854515\",\n \"text\": \"def get_document_square_annotations(name, opts = {})\\n @api_client.request_token_if_needed\\n data, _status_code, _headers = get_document_square_annotations_with_http_info(name, opts)\\n rescue ApiError => error\\n if error.code == 401\\n @api_client.request_token_if_needed\\n data, _status_code, _headers = get_document_square_annotations_with_http_info(name, opts)\\n else\\n raise\\n end\\n return data\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"032072404cdf512e9a867e4cf4efd44e\",\n \"score\": \"0.48492143\",\n \"text\": \"def highlight_and_link(source, remove_top_namespace = false)\\n\\n # debug\\n # is_page_of_interest = @context.registers[:page]['fancy_name'] =='reshape') \\n \\n if remove_top_namespace then \\n page_namespace = @context.registers[:page]['namespace'] + \\\"::\\\"\\n ns = page_namespace.split(\\\"::\\\")[0] + \\\"::\\\"\\n end\\n\\n highlighted_types = @context.registers[:site].data['highlighted_types'] \\n \\n # for all types in highlighted_types, \\n # - find them \\n # - replace them with _X0001X_, _X0002X, which the highlighter will not cut\\n # - highlight by calling Rouge\\n # - replace back the _X0001X_, _X0002X with the name and adequate url\\n # if remove_top_namespace is true, we rerun this a second type with the top namespace removed from the type\\n # It is useful for signature when the namespace is not always explicit and would be verbose (e.g. nda:: everywhere in all nda:: functions ?)\\n #\\n repl_to_original = {}\\n c = 1\\n highlighted_types.each do |type, url|\\n\\n type_to_replace = type\\n # we are going to run this twice : once with the full type, \\n # once with the type_to_replace truncated from top ns if remove_top_namespace is true\\n # lambda are closure, it will see the change in type_to_replace\\n worker = lambda { \\n # the type_to_replace, not followed by a word (e.g. array does not match array_adapter, and not preceded by a :)\\n # e.g. array will match array, not nda::array (which could be matched in another part of the loop...), and NOT std::array !\\n re = Regexp.new '(?' + r.strip + '
'\\n\\n repl_to_original.each do |repl, type|\\n url = highlighted_types[type] \\n\\n if remove_top_namespace then\\n type = type.gsub(ns, '')\\n end\\n re = Regexp.new '(' + repl + ')(?!\\\\w)'\\n r = r.gsub(re){ |w| '%s' %[url, type]}\\n end\\n\\n return r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8a0c4cfa09a8ebcef8d4ccff99dbe030\",\n \"score\": \"0.48334524\",\n \"text\": \"def update\\n concept = params[:concept] || \\\"\\\"\\n type = params[:type] || \\\"\\\"\\n note = params[:note] || \\\"\\\"\\n no_update_note = params[:no_update_note] \\n review_result = (params[:review_result] || 1).to_i\\n type.strip!\\n concept = @document.project.normalize_concept_id(concept, type)\\n @error = nil \\n if @project.collaborate_round?\\n annotator = @document.assigns.map{|a| a.user.email_or_name}.uniq.sort.join(',')\\n else\\n annotator = current_user.email_or_name\\n end\\n \\n Document.transaction do \\n if (params[:mode] == \\\"true\\\" || params[:mode] == \\\"1\\\" || params[:mode] == \\\"concept\\\")\\n logger.debug(\\\"update_concept\\\")\\n\\n if @assign.present? \\n targets = Annotation.execute_sql(\\\"\\n SELECT id FROM annotations \\n WHERE assign_id = ? AND version = ? AND concept = ? AND a_type = ?\\n \\\", @assign.id, @annotation.version, @annotation.concept, @annotation.a_type)\\n elsif @project.manager?(current_user) || @project.collaborate_round\\n targets = Annotation.execute_sql(\\\"\\n SELECT id FROM annotations \\n WHERE document_id = ? AND version = ? AND concept = ? AND a_type = ?\\n \\\", @document.id, @annotation.version, @annotation.concept, @annotation.a_type)\\n end\\n\\n @ids = targets.map{|e| e[0]}\\n\\n # @document.update_concept(@current_user.email, params[:id], @type, @concept, @note, @no_update_note)\\n set_sql = \\\"concept=?, a_type=?\\\"\\n values = [concept, type]\\n set_sql = set_sql + \\\", review_result=? \\\"\\n values << review_result\\n\\n if no_update_note.blank? || no_update_note == false\\n set_sql = set_sql + \\\",note=? \\\"\\n values << note\\n end \\n sql = \\\"UPDATE annotations\\n SET #{set_sql}, annotator=?, updated_at=? \\n WHERE \\\"\\n values << annotator\\n values << Time.now\\n if @assign.present? \\n sql = sql + \\\" assign_id = ? and version = ? \\\"\\n values << @annotation.assign_id\\n values << @annotation.version\\n elsif @project.manager?(current_user) || @project.collaborate_round\\n sql = sql + \\\" document_id = ? and version = ? \\\"\\n values << @document.id\\n values << @annotation.version\\n end\\n sql = sql + \\\" AND concept = ? AND a_type = ?\\\"\\n values << @annotation.concept\\n values << @annotation.a_type\\n\\n args = [sql] + values\\n ret = Annotation.execute_sql(*args)\\n else\\n logger.debug(\\\"update_mention\\\")\\n @annotation.concept = concept\\n @annotation.a_type = type\\n @annotation.note = note if no_update_note.blank? || no_update_note == false\\n @annotation.annotator = annotator\\n @annotation.review_result = review_result\\n if !@annotation.save\\n @error = @annotation.errors\\n end\\n @ids = [@annotation.id]\\n end\\n\\n if @error.blank? && params[:annotate_all] == \\\"all\\\"\\n text = (params[:text] || \\\"\\\").strip\\n case_sensitive = (params[:case_sensitive] == \\\"y\\\")\\n whole_word = (params[:whole_word] == \\\"y\\\")\\n result = @document.annotate_all_by_text_into_db(@assign, current_user, annotator, text, type, concept, case_sensitive, whole_word, review_result, note)\\n @ids += result\\n end\\n @annotations = Annotation.where(\\\"id in (?)\\\", @ids).all\\n logger.debug(@ids.inspect)\\n logger.debug(@annotations.inspect)\\n @document.touch\\n end\\n respond_to do |format|\\n if @error.blank?\\n @document.create_audit(current_user, \\\"Update annotation\\\", params.to_json, @ids.join(\\\",\\\"))\\n format.html { redirect_to @annotation, notice: 'The annotation was successfully updated.' }\\n format.json { render :index, status: :ok, location: document_annotations_path(@document) }\\n else\\n format.html { render :edit }\\n format.json { render json: @error, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5516d4f84b8b6f6405eaaea43b6e9d1a\",\n \"score\": \"0.48300216\",\n \"text\": \"def replace(text,align=0,raw=false)\\n draw_internal(text,align,true,raw)\\n reposition_lines\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1f2c5ead14e06b4d267a106a88949941\",\n \"score\": \"0.48234272\",\n \"text\": \"def set_default_annotation\\n return if study.default_options[:annotation].present?\\n\\n cell_metadatum = study.cell_metadata.keep_if(&:can_visualize?).first || study.cell_metadata.first\\n cluster = study.cluster_groups.first\\n if cluster.present?\\n cell_annotation = cluster.cell_annotations.select { |annot| cluster.can_visualize_cell_annotation?(annot) }\\n .first || cluster.cell_annotations.first\\n else\\n cell_annotation = nil\\n end\\n annotation_object = cell_metadatum || cell_annotation\\n return if annotation_object.nil?\\n\\n if annotation_object.is_a?(CellMetadatum)\\n study.default_options[:annotation] = annotation_object.annotation_select_value\\n is_numeric = annotation_object.annotation_type == 'numeric'\\n elsif annotation_object.is_a?(Hash) && cluster.present?\\n study.default_options[:annotation] = cluster.annotation_select_value(annotation_object)\\n is_numeric = annotation_object[:type] == 'numeric'\\n end\\n study.default_options[:color_profile] = 'Reds' if is_numeric\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"73131df1f100f9c74507d336ec0be291\",\n \"score\": \"0.48195538\",\n \"text\": \"def document\\n comment_code\\n super\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c33bb8b2cc4c5cd008f5a5e1d78b235e\",\n \"score\": \"0.481891\",\n \"text\": \"def replace\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be6fd3b9fb9754f0179fb80d058809e7\",\n \"score\": \"0.48151663\",\n \"text\": \"def replace_document(out = nil)\\n print out if out\\n exit 202\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"424e59a78294b28feefcec6f61d56696\",\n \"score\": \"0.48112392\",\n \"text\": \"def update\\n @annotation = Annotation.find(params[:id])\\n\\n if @annotation.update(params[:annotation].permit(:start_video, :end_video, :text, :top_align, :left_align, :color))\\n head :no_content\\n else\\n render json: @annotation.errors, status: :unprocessable_entity\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d237bdad23cbcd48ae6c15cd1566a63f\",\n \"score\": \"0.48025656\",\n \"text\": \"def highlighter_suffix; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d237bdad23cbcd48ae6c15cd1566a63f\",\n \"score\": \"0.48025656\",\n \"text\": \"def highlighter_suffix; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dcaa92f45d43ddef45eed10f30027dce\",\n \"score\": \"0.47841692\",\n \"text\": \"def setMultipleCanvas\\n # @annotationIn['canvas'] = '|'\\n # @annotationIn['on'].each do |on|\\n # @annotationIn['canvas'] += on['full'] + '|'\\n # end\\n # return @annotationIn['canvas']\\n\\n @annotationIn['on'][0]['full']\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ed2c0c96e6a44b285be350cc7815b7fc\",\n \"score\": \"0.4774949\",\n \"text\": \"def build_simple_attributes(document)\\n simple_attributes.each do |a|\\n document.send(\\\"#{a}=\\\", geo_concern.send(a.to_s))\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd0bfc838ae842e50e0daf3e640c18e7\",\n \"score\": \"0.4774824\",\n \"text\": \"def update\\n @concept = params[:concept] || \\\"\\\"\\n @type = params[:type] || \\\"\\\"\\n @concept.strip!\\n @type.strip!\\n if params[:mode] == \\\"true\\\" || params[:mode] == \\\"1\\\"\\n logger.debug(\\\"update_concept\\\")\\n @document.update_concept(params[:id], @type, @concept)\\n else\\n logger.debug(\\\"update_mention\\\")\\n @document.update_mention(params[:id], @type, @concept)\\n end\\n @entity_types = EntityType.where(collection_id: @document.collection_id)\\n respond_to do |format|\\n if true\\n format.html { redirect_to @annotation, notice: 'The annotation was successfully updated.' }\\n format.json { render :show, status: :ok, location: @annotation }\\n else\\n format.html { render :edit }\\n format.json { render json: @annotation.errors, status: :unprocessable_entity }\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ff0d455829b5486ebdcf72533436bf2a\",\n \"score\": \"0.47735092\",\n \"text\": \"def set_annotation\\n @annotation = Annotation.find(params[:id])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ff0d455829b5486ebdcf72533436bf2a\",\n \"score\": \"0.47735092\",\n \"text\": \"def set_annotation\\n @annotation = Annotation.find(params[:id])\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":191,"cells":{"query_id":{"kind":"string","value":"731d8847af817710b2c0d4d31a622924"},"query":{"kind":"string","value":"Firefox does some fancy work that seems important here. I don't know precisely what it is, but doing this in various places tends to eliciit different results."},"positive_passages":{"kind":"list like","value":[{"docid":"34722da6919a871d619a6de64fc10dc2","score":"0.5442469","text":"def run_firefox_if_needed\n if @firefox_needs_run\n converge_by \"briefly run firefox to have it set up the newly-created profile\" do\n pipe = IO.popen [firefox_bin, \"-P\", new_resource.profile_name]\n sleep 5\n Process.kill 9, pipe.pid\n end\n end\nend","title":""}],"string":"[\n {\n \"docid\": \"34722da6919a871d619a6de64fc10dc2\",\n \"score\": \"0.5442469\",\n \"text\": \"def run_firefox_if_needed\\n if @firefox_needs_run\\n converge_by \\\"briefly run firefox to have it set up the newly-created profile\\\" do\\n pipe = IO.popen [firefox_bin, \\\"-P\\\", new_resource.profile_name]\\n sleep 5\\n Process.kill 9, pipe.pid\\n end\\n end\\nend\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"110570677937e800bbc37a326066f65c","score":"0.5941491","text":"def badbrowser\n end","title":""},{"docid":"33ab105f935f71467912fe85cb029fde","score":"0.57274455","text":"def desiredBrowser\n #:htmlunit\n #:chrome\n :firefox\n #@caps\nend","title":""},{"docid":"2c95b7ca228294e5d9ed14a2481f8569","score":"0.566204","text":"def firefox?()\n return fetch_boolean(\"_sahi._isFF()\")\n end","title":""},{"docid":"3682c23cb3adce4c8bda15c6a4d83830","score":"0.5653025","text":"def firefox?\n !!(ua =~ /Firefox/)\n end","title":""},{"docid":"3682c23cb3adce4c8bda15c6a4d83830","score":"0.5653025","text":"def firefox?\n !!(ua =~ /Firefox/)\n end","title":""},{"docid":"2164530a83b13606e1a339ea39bdeed8","score":"0.5627564","text":"def browser_name\n :firefox # must be a symbol\nend","title":""},{"docid":"9c12a6fded94a45f8acfe407f2ed5e73","score":"0.56038237","text":"def test_selenium_can_drive_firefox_headless\n options = Selenium::WebDriver::Firefox::Options.new\n options.add_argument('--headless')\n driver = Selenium::WebDriver.for :firefox, options: options\n driver.quit\n end","title":""},{"docid":"78422c9016c8d6ac79b0b77130075566","score":"0.5419949","text":"def firefox?\r\n session[:firefox]\r\n end","title":""},{"docid":"9c0d41a2c4f50dc39b617a31c8a12190","score":"0.5417949","text":"def compression_browser_workaround_state\n super\n end","title":""},{"docid":"a5fbe906103e3be1662ed3c360504c97","score":"0.53660095","text":"def process_firefox(agent)\n @identifier = @engine if @identifier == \"\"\n\n if agent.include?(\"Firefox\")\n @browser = \"Firefox\"\n end\n\n if @identifier.include?(\"Firefox\") || @renderer.include?(\"Firefox\") || @engine.include?(\"Firefox\")\n @browser = \"Firefox\"\n\n identifier_sub = nil\n @identifier.gsub(/[\\\\:\\?'\"%!@#\\$\\^&\\*\\(\\)\\+]/, '').split(\" \").find do |ident|\n if ident.include?(\"Firefox\")\n identifier_sub = ident.sub(\"Firefox\\/\", \"\").sub(\"Gecko/\", \"\")\n identifier_sub.gsub!(/[\\+]/, '')\n end\n identifier_sub\n end\n if identifier_sub.nil? && @renderer.include?(\"Firefox\")\n renderer_gsub_gsub = @renderer.sub(\"\\(\", \"\").sub(\"\\)\", \"\")\n renderer_gsub_gsub.strip.split(\",\").each do |sec|\n identifier_sub = sec.sub(\"Firefox\\/\", \"\").strip if sec.include?(\"Firefox\")\n end\n end\n if identifier_sub.nil? && @engine.include?(\"Firefox\")\n @engine.gsub(/[\\\\:\\?'\"%!@#\\$\\^&\\*\\(\\)\\+]/, '').split(\" \").each do |ident|\n identifier_sub = ident.sub(\"Firefox\\/\", \"\").sub(\"Gecko/\", \"\") if ident.include?(\"Firefox\")\n identifier_sub.gsub!(/[\\+]/, '') if identifier_sub && identifier_sub.include?(\"+\")\n end\n end\n \n identifier_sub.gsub!(/;.*/, '')\n\n if identifier_sub\n version.update(*identifier_sub.split(\".\")[0, 3])\n end\n end\n end","title":""},{"docid":"d21cd380f873c5fe3e9e58be7fc350e5","score":"0.536018","text":"def gecko?() product?('Gecko'); end","title":""},{"docid":"4aa1531e735f4c3fa71a83f27c350033","score":"0.53441","text":"def test_selenium_can_drive_firefox\n assert_nothing_raised do\n driver = ensure_driver(:firefox)\n driver.quit \n end\n end","title":""},{"docid":"8e27a47584187a77bafb1d7703b47652","score":"0.5322406","text":"def browser_version; end","title":""},{"docid":"8e27a47584187a77bafb1d7703b47652","score":"0.5322406","text":"def browser_version; end","title":""},{"docid":"8e27a47584187a77bafb1d7703b47652","score":"0.5322406","text":"def browser_version; end","title":""},{"docid":"8e27a47584187a77bafb1d7703b47652","score":"0.5322406","text":"def browser_version; end","title":""},{"docid":"40d2e99104577a22b4f31456d3c00d6e","score":"0.53056","text":"def wait_for_browser\r\n\t\t\t # Watir 3 does not support it any more\r\n # @browser.waitForIE unless is_firefox?\r\n end","title":""},{"docid":"277ccb1e497904d0cac3a2e6604429ff","score":"0.52812135","text":"def headless!; end","title":""},{"docid":"277ccb1e497904d0cac3a2e6604429ff","score":"0.52812135","text":"def headless!; end","title":""},{"docid":"ae89ce88252325ba8a3d35b8f1e18287","score":"0.5256999","text":"def firefox_min_browser(vers = nil)\n !vers.blank? ? vers : '1.5'\n end","title":""},{"docid":"d39de04f3c78f50c503dfc3ed8bcc38c","score":"0.51993954","text":"def is_like_gecko?\n [:firefox, :iceweasel, :netscape, :safari, :chrome, :gecko].include? @ua\n end","title":""},{"docid":"e07152b2646df15f72a23030d48d49ea","score":"0.51883113","text":"def version_msie\n\t\t\n\tend","title":""},{"docid":"11e9686d7c50d46e1fea43d55c8eca7d","score":"0.5172977","text":"def old_ff?\n\t\t(request.user_agent =~ /Firefox\\/([0-2][0-9])|Firefox\\/([5-9])/) || (request.user_agent =~ /(MSIE 6)/) || (request.user_agent =~ /Chrome\\/([0-2][0-9])/)\n\tend","title":""},{"docid":"574dce7e6e71d52ddb40cb780af0dd10","score":"0.5130247","text":"def webkit_options; end","title":""},{"docid":"f9c06570fe613e470bd5677badaddbe2","score":"0.512814","text":"def browserconfig; end","title":""},{"docid":"57c37b6774e5bcdecd3c556af7e62d2a","score":"0.5123367","text":"def browser_firefox_version\n if browser_is? 'firefox'\n match = ua.match(%r{\\bfirefox/([\\d\\.]+)\\b})\n match[1].to_f if (match)\n end or 0\n end","title":""},{"docid":"70ef271c86fc5c4f60aa60f69f6eea13","score":"0.5121397","text":"def start_firefox\n begin\n profile = Selenium::WebDriver::Firefox::Profile.new\n\n if @geolocation.nil?\n # pas de geolocation\n profile['network.proxy.type'] = 0\n profile['network.proxy.no_proxies_on'] = \"\"\n else\n #geolocation\n profile['network.proxy.type'] = 1\n case @geolocation.protocol\n when \"http\"\n profile['network.proxy.http'] = @geolocation.ip\n profile['network.proxy.http_port'] = @geolocation.port.to_i\n profile['network.proxy.ssl'] = @geolocation.ip\n profile['network.proxy.ssl_port'] = @geolocation.port.to_i\n when \"socks\"\n profile['network.proxy.socks'] = @geolocation.ip\n profile['network.proxy.socks_port'] = @geolocation.port.to_i\n end\n\n\n end\n\n\n Selenium::WebDriver::Firefox.path = @path_firefox\n client = Selenium::WebDriver::Remote::Http::Default.new\n client.read_timeout = 120 # seconds\n\n @driver = Selenium::WebDriver.for :firefox,\n :profile => profile,\n :http_client => client\n @driver.manage.timeouts.implicit_wait = 3\n @user_agent = @driver.execute_script(\"return navigator.userAgent\")\n\n rescue Exception => e\n raise Error.new(FIREFOX_NOT_START, :error => e)\n\n else\n\n end\n end","title":""},{"docid":"871721f84f1d95af5a04619b0de9db61","score":"0.51069635","text":"def start_firefox()\n @started_ff = false\n Log.Debug(\"[START_FIREFOX]\") {\n unless firefox_running?\n # start it\n Log.Debug(\"[starting Firefox]\") {\n rc = POSIX::Spawn::Child.new *CMDLN_START_FF\n raise \"executing '#{CMDLN_START_FF.join(' ')}' failed\" unless rc.success?\n\n # give Firefox a chance to initialize\n sleep 15\n\n @started_ff = true\n\n Log.Debug \"stdout\", rc.out\n Log.Debug \"stderr\", rc.err\n }\n end\n }\n end","title":""},{"docid":"9d12751d8439714c1b087bdc3e85e017","score":"0.51033187","text":"def webkit_options=(_arg0); end","title":""},{"docid":"7b6e0eb43e8a361458b4251d5a95a228","score":"0.50987405","text":"def get_browser\n case RUBY_PLATFORM\n when /darwin/i\n require 'appscript'\n if !defined? @@browser\n if Appscript.app('System Events').processes['Firefox'].exists()\n puts \"stopping Firefox...\"\n sleep 1\n Appscript.app('Firefox').quit\n sleep 3\n puts \"hopefully Firefox is stopped by now. so we can start it. Gah\"\n end\n end\n end\n tries = 1\n begin\n @@browser ||= FireWatir::Firefox.new(:waitTime => tries+3)\n rescue Exception => e\n puts \"e: #{e.inspect}\"\n case RUBY_PLATFORM\n when /darwin/i\n sleep tries\n puts \"trying to start Firefox #{tries}\"\n if Appscript.app('System Events').processes['Firefox'].exists()\n puts \"stopping existing Firefox...\"\n Appscript.app('Firefox').quit\n end\n retry if tries < 5\n end\n end\n \n at_exit do\n if @@browser\n puts \"closing firefox\"\n begin Timeout.timeout(2) do\n if defined? Appscript \n begin\n if Appscript.app('System Events').processes['Firefox'].exists\n Appscript.app('Firefox').quit\n end\n rescue RuntimeError, Exception\n @@browser.close\n end\n else\n @@browser.close\n end\n end rescue Timeout::Error end\n @@browser = nil\n end\n end\n @@browser\n end","title":""},{"docid":"35ae528dfc074f6c81b7a7336d228269","score":"0.5090856","text":"def wait_for_browser\n @browser.waitForIE unless is_firefox?\n end","title":""},{"docid":"11ad897d5f2300b8143f9ce28ffde1cf","score":"0.50643265","text":"def extract_with_selenium\r\n return false\r\n end","title":""},{"docid":"1bd4cb2d30d13f3f097b71f3b1d17c07","score":"0.5060281","text":"def is_firefox?\n begin\n find_window(\"MozillaWindowClass\")#MozillaUIWindowClassname\n return true if @main_window >0\n rescue =>e\n raise \"not exit firefox #{e} only support on windows OS\"\n return false\n end\n end","title":""},{"docid":"922ad13267ad637c9292ec039c11884f","score":"0.5052612","text":"def obscured?; end","title":""},{"docid":"97b80bc3eff1452374f343edd32fd512","score":"0.50146604","text":"def formatted_browser\r\n return \"*#{@browser}\"\r\n end","title":""},{"docid":"eda40b46e3cfb93d116d25605579d161","score":"0.5013493","text":"def kill_foxes\n Sys::ProcTable.ps.each do |ps|\n if ps.comm.downcase =~ /firefox/\n Process.kill('KILL',ps.pid)\n end\n end\nend","title":""},{"docid":"10f3280d366c80c7ea7d3a9f5db6b025","score":"0.49897367","text":"def setup\n @driver = Selenium::WebDriver.for :firefox\nend","title":""},{"docid":"10f3280d366c80c7ea7d3a9f5db6b025","score":"0.49897367","text":"def setup\n @driver = Selenium::WebDriver.for :firefox\nend","title":""},{"docid":"f64a49bf0a46f276e8a235d556d77066","score":"0.49767366","text":"def driver_initialize\n puts \"Step 1: Opening firefox browser\"\n options = Selenium::WebDriver::Firefox::Options.new()\n $web_driver = Selenium::WebDriver.for(:firefox, options: options)\n end","title":""},{"docid":"ae7125ccec346d0d2a0ab000ba9b900a","score":"0.49718082","text":"def get_browser(browser)\n if browser == 'chrome'\n return :chrome\n end\n :firefox\nend","title":""},{"docid":"a7da164c3f7f6b14c3594433f222f6c5","score":"0.49702346","text":"def detect_firefox_o_s()\r\n if (detect_firefox_o_s_phone() || detect_firefox_o_s_tablet())\r\n return true\r\n end\r\n\r\n return false\r\n end","title":""},{"docid":"f99f93486a1fab7f1755a9911ac0226d","score":"0.4948663","text":"def test_base_methods\n browser.goto('https://google.com')\n\n update_action_log(:goto, browser.title.eql?('Google'))\n update_action_log(:title, !(browser.title.nil? || browser.title.empty?))\n update_action_log(:url, !(browser.url.nil? || browser.url.empty?))\n update_action_log(:driver, !browser.driver.nil?)\n update_action_log(:html, !browser.html.nil? && browser.html.include?(''))\n update_action_log(:body, !browser.body.nil? && browser.body.divs.size > 1)\n end","title":""},{"docid":"3339c1bc37628b9eccbba656c731391b","score":"0.49430025","text":"def browser_status\n\n # Create bogus browser for testing purposes.\n if RAILS_ENV == 'test'\n @session_working = TEST_SESSION_WORKING\n @cookies_enabled = TEST_COOKIES_ENABLED\n @js = TEST_JS\n @ua = TEST_UA\n @ua_version = TEST_UA_VERSION\n return true\n end\n\n ua = request.env['HTTP_USER_AGENT']\n ip = request.env['HTTP_X_FORWARDED_FOR'] ||\n request.env['HTTP_CLIENT_IP'] ||\n request.env['HTTP_REMOTE_ADDR']\n browser_id = \"#{ip}|#{ua}\"\n\n # Look up the user's browser. We keep some minimal info about all browsers\n # that do not have a working session yet.\n @@our_session_cache ||= {}\n our_session = @@our_session_cache[browser_id]\n\n if session[:_x]\n\n # Session is working, clear entry from \"our session\" cache.\n session_new = false\n @session_working = true\n if our_session\n @@our_session_cache.delete(browser_id)\n clean_our_session_cache\n end\n\n else\n session[:_x] = true\n if our_session\n\n # Session is not working, but we've seen this browser before.\n session_new = false\n @session_working = false\n our_session[:time] = Time.now\n\n else\n\n # Session in not working, and we've never seen this browser before.\n session_new = true\n @session_working = nil\n our_session = @@our_session_cache[browser_id] = { :time => Time.now }\n clean_our_session_cache\n end\n end\n\n # Is javascript enabled?\n if session[:js_override]\n @js = (session[:js_override] == :on)\n elsif params[:_js]\n @js = (params[:_js] == 'on')\n elsif session[:_js] != nil\n @js = (session[:_js] == true)\n elsif our_session && our_session[:js] != nil\n @js = (our_session[:js] == true)\n else\n @js = nil\n end\n session[:_js] = @js\n our_session[:js] = @js if our_session\n\n # Are cookies enabled?\n if cookies[:_x]\n @cookies_enabled = true\n else\n cookies[:_x] = '1'\n @cookies_enabled = session_new ? nil : false\n end\n\n # What is the user agent?\n @ua, @ua_version = parse_user_agent(ua)\n\n # print \"========================================\\n\"\n # print \"browser_id = [#{browser_id }]\\n\"\n # print \"session_new = [#{session_new }]\\n\"\n # print \"@session_working = [#{@session_working}]\\n\"\n # print \"@cookies_enabled = [#{@cookies_enabled}]\\n\"\n # print \"@js = [#{@js }]\\n\"\n # print \"@ua = [#{@ua }]\\n\"\n # print \"@ua_version = [#{@ua_version }]\\n\"\n # print \"HTTP_USER_AGENT = [#{ua }]\\n\"\n # print \"params = [#{params.inspect }]\\n\"\n # print \"========================================\\n\"\n\n # Find time zone that matches the best.\n Time.zone = cookies[:tz]\n\n # If we've never seen this user before, serve a tiny page that redirects\n # immediately to tell us the state of javascript, and lets us determine\n # whether session and cookies are woring correctly immediately. (The\n # _new thing prevents infinite loops, just in case.)\n if session_new && params[:_new] != 'true'\n render(:text => FIRST_PAGE % [\n reload_with_args(:_js => 'on', :_new => 'true'),\n reload_with_args(:_js => 'off', :_new => 'true'),\n ])\n else\n return true\n end\n end","title":""},{"docid":"9ea9054c31b5460ecdd54430611e5dd6","score":"0.49292597","text":"def browser\n $browser ||= Watir::Browser.new(:chrome)\nend","title":""},{"docid":"a6ae09155610488b3777a4992e161b7b","score":"0.49279916","text":"def setup\n # Do nothing\n @profile = Selenium::WebDriver::Firefox::Profile.from_name 'default'\n @profile['network.cookie.cookieBehavior'] = '2'\n @profile.native_events = true\n @driver = Selenium::WebDriver.for :firefox, :profile => @profile\n #@driver.manage.window.maximize\n @driver.manage.window.resize_to(350, 750)\n @driver.manage.timeouts.implicit_wait = 20\n @wait = Selenium::WebDriver::Wait.new :timeout => 120\n @baseURL = 'http://qa.healthnow.com'\n #@verification_errors = []\n\n end","title":""},{"docid":"3fc62999f66ac51441f9ba80922d1854","score":"0.49030566","text":"def escaper; end","title":""},{"docid":"31c0747ce7e9f90c0f327d4a61a4f41c","score":"0.4894024","text":"def browser_name\n ua = request.user_agent.downcase\n\n if ua =~ /firefox\\/4/\n :is_able_to_ajax\n elsif ua =~ /firefox\\/5/\n :is_able_to_ajax\n elsif ua =~ /firefox\\/6/\n :is_able_to_ajax\n elsif ua =~ /firefox\\/7/\n :is_able_to_ajax\n elsif ua =~ /firefox\\/8/\n :is_able_to_ajax\n elsif ua =~ /firefox\\/9/\n :is_able_to_ajax\n elsif ua =~ /firefox\\/10/\n :is_able_to_ajax\n elsif ua =~ /firefox\\/11/\n :is_able_to_ajax\n elsif ua =~ /firefox\\/12/\n :is_able_to_ajax\n elsif ua =~ /firefox\\/13/\n :is_able_to_ajax\n elsif ua =~ /firefox\\/14/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/7/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/8/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/9/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/10/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/11/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/12/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/13/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/14/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/15/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/16/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/17/\n :is_able_to_ajax\n elsif ua =~ /chrome\\/18/\n :is_able_to_ajax\n elsif ua =~ /chromium/\n :is_able_to_ajax\n elsif ua =~ /Version\\/5.*Safari/\n :is_able_to_ajax\n elsif ua =~ /firefox\\//\n :firefox\n elsif ua =~ /opera\\//\n :opera\n elsif ua =~ /chrome\\//\n :chrome\n elsif ua =~ /safari\\//\n :safari\n elsif ua =~ /msie/\n :ie\n else\n nil\n end\n end","title":""},{"docid":"2264f6faef0391357d3ea6211da35455","score":"0.48919532","text":"def start_firefox\n rt_count = 1\n waittime = 10\n @log.debug(\"Firefox Start::Running Firefox\")\n\t\tbegin\n\t\t\tif @user_choices[:firefox_profile]\n\t\t\t\t@ff = FireWatir::Firefox.new(:waitTime => waittime, :profile => @user_choices[:firefox_profile])\n\t\t\telse\n\t\t\t\t@ff = FireWatir::Firefox.new(:waitTime => waittime)\n\t\t\tend\n\t\t\t@ff.wait\n @log.debug(\"Firefox Start::Success\")\n unless @logged_in\n @log.debug(\"Basic Authorization::Login thread started\")\n Thread.new { self.logon }\n @logged_in = TRUE\n end if @user_choices[:dut].length > 2\n @ff.goto(@user_choices[:dut][0].ip)\n sleep 3 if @user_choices[:dut].length > 2\n @ff.link(:text, \"Manual Setup\").click if @ff.contains_text(\"What would you like to do?\")\n return true\n\t\trescue => ex\n if rt_count < 4\n @log.debug(\"Firefox Start::Firefox didn't start, or no connection to the JSSH server on port 9997 was validated, on attempt #{rt_count}. Trying again...\")\n waittime += 5\n rt_count += 1\n retry\n else\n @log.fatal(\"Firefox Start::Giving up. Last error received: #{ex}\")\n return false\n end\n\t\tend\n end","title":""},{"docid":"f6d3736680fa30e3a529b57549f711fc","score":"0.48774943","text":"def driver_quit\n puts \"Step 12: Closing Firefox browser\"\n $web_driver.quit\n end","title":""},{"docid":"462f660db193e8894824ce01a14e88fd","score":"0.48747057","text":"def during_after_load; end","title":""},{"docid":"5dd4669cf9f84a6e26de3beb364d9d9e","score":"0.48722628","text":"def test_149\n #test_000\n printf \"\\n+ Test 149\"\n open_metric_tab($link_texts[\"metric_tab\"][5])\n file_metric_graph_old=@selenium.get_text($xpath[\"metric\"][\"metric_pane_content\"])\n sleep WAIT_TIME\n click \"#{$xpath[\"metric\"][\"customize_button\"]}\"\n sleep WAIT_TIME\n click \"#{$xpath[\"metric\"][\"check_all_button\"]}\"\n sleep WAIT_TIME\n click \"#{$xpath[\"metric\"][\"cancel_button\"]}\"\n sleep WAIT_TIME\n file_metric_graph_new=@selenium.get_text($xpath[\"metric\"][\"metric_pane_content\"])\n assert_equal file_metric_graph_old,file_metric_graph_new\n logout\n end","title":""},{"docid":"baa3d603d20660ed35dba0923b767228","score":"0.4848062","text":"def test05_D2FLT05_TC_24393\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory)\n\t\t$directory_user.click\n\t\tsleep 2\n\t\t\t\n\t\tbegin\n\t\tassert $browser.text.include? \"Manager Of\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \n\t\tend\n\tend","title":""},{"docid":"ad99819cf0b38a5a1c6d26c6711bc71c","score":"0.48359752","text":"def cur_page\n clean_url(@BROWSER.url)\nend","title":""},{"docid":"07d0de550c03c1388e0d0f9dc399a088","score":"0.48349854","text":"def watir_wait_for_ajax_object(kind, *args) \n no_of_tries = 0\n begin\n element = $browser.__send__(kind, *args)\n if element.respond_to?(:assert_exists)\n # IE\n element.assert_exists\n true\n else\n # Safari\n element.exists?\n end\n rescue ::Watir::Exception::UnknownObjectException => e\n no_of_tries += 1\n debug_log \"no_of_tries= #{no_of_tries}\" if no_of_tries > 10\n sleep 0.2 #Just sleep a little bit and give time\n retry if no_of_tries < 30\n raise\n end\nend","title":""},{"docid":"64f6eb85134474ce2fc9681d5c3eeb6d","score":"0.48198542","text":"def test_152\n #test_000\n printf \"\\n+ Test 152\"\n open_metric_tab($link_texts[\"metric_tab\"][5])\n click ($xpath[\"metric\"][\"redraw_graph_button\"])\n sleep WAIT_TIME\n @selenium.context_menu($xpath[\"metric\"][\"redraw_graph_view\"])\n sleep WAIT_TIME\n assert true\n ##\n logout\n end","title":""},{"docid":"9efc05ed2913a9b11c1d0ea2cdebd3f5","score":"0.48037577","text":"def test_nothing_yet\r\n browser = open_browser(\"/\")\r\n fail \"Need to write my Watir on Rails test\"\r\n end","title":""},{"docid":"8291bb9a632af53bb519eb2ea1a1099d","score":"0.47931185","text":"def test_013\n #login\n login\n\n #Open PU management page\n open_pu_management_page_1\n\n #Register a new PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n # Pu setting page\n click $xpath[\"misc\"][\"PU_setting_page\"]\n sleep 4\n\n assert_equal _(\"General Setting\"), get_text($xpath[\"misc\"][\"tab1_link\"])\n assert_equal _(\"Execution Setting\"), get_text($xpath[\"misc\"][\"tab2_link\"])\n\n click $xpath[\"misc\"][\"general_control_tab\"]\n sleep 4\n assert is_visible(\"content1\")\n assert !is_visible(\"content2\")\n\n general_tab_style = @selenium.get_attribute($xpath[\"misc\"][\"tab1_style\"])\n\n assert_equal TAB_STYLES[\"focused\"],general_tab_style\n\n\n execution_tab_style = @selenium.get_attribute($xpath[\"misc\"][\"tab2_style\"])\n assert_equal TAB_STYLES[\"unfocused\"],execution_tab_style\n\n #logout\n logout\n end","title":""},{"docid":"9a306881e747caf4d1d882730d700810","score":"0.4786033","text":"def setup_firefox_path\n firefox_app = nil\n IO.popen('mdfind \"kMDItemFSName = Firefox*.app\"') { |io|\n firefox_app = io.gets\n }\n raise \"Can't find Firefox app bundle\" unless firefox_app\n firefox_app.chomp!\n\n Selenium::WebDriver::Firefox::Binary.path = File.join(firefox_app, 'Contents/MacOS/firefox')\nend","title":""},{"docid":"9a306881e747caf4d1d882730d700810","score":"0.4786033","text":"def setup_firefox_path\n firefox_app = nil\n IO.popen('mdfind \"kMDItemFSName = Firefox*.app\"') { |io|\n firefox_app = io.gets\n }\n raise \"Can't find Firefox app bundle\" unless firefox_app\n firefox_app.chomp!\n\n Selenium::WebDriver::Firefox::Binary.path = File.join(firefox_app, 'Contents/MacOS/firefox')\nend","title":""},{"docid":"8d551867f3cfe27e4630262cb8c8c45b","score":"0.4785808","text":"def test_014\n #login\n login\n\n #Open PU management page\n open_pu_management_page_1\n\n #Register a new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n # Pu setting page\n click $xpath[\"misc\"][\"PU_setting_page\"]\n sleep 4\n\n assert_equal _(\"General Setting\"), get_text($xpath[\"misc\"][\"tab1_link\"])\n assert_equal _(\"Execution Setting\"), get_text($xpath[\"misc\"][\"tab2_link\"])\n\n click $xpath[\"misc\"][\"display_page\"]\n sleep 4\n assert !is_visible(\"content1\")\n assert is_visible(\"content2\")\n\n general_tab_style = @selenium.get_attribute($xpath[\"misc\"][\"tab1_style\"])\n\n assert_equal TAB_STYLES[\"unfocused\"],general_tab_style\n\n\n execution_tab_style = @selenium.get_attribute($xpath[\"misc\"][\"tab2_style\"])\n assert_equal TAB_STYLES[\"focused\"],execution_tab_style\n\n #logout\n logout\n end","title":""},{"docid":"c3f498ce80bc596054dabda57a836a63","score":"0.47857237","text":"def javascript_driver=(_arg0); end","title":""},{"docid":"1ab57f0da90942d7a7ebdfeb0d12ec85","score":"0.47793958","text":"def error_out(text)\n # Refresh the page using Selenium API. Firefox's JS environment resets.\n refresh_failsafe\n raise(HeadlessBrowserError, \"#{text}\")\n end","title":""},{"docid":"05f3e8223c939e7f9b9c6eba6e51b289","score":"0.47550285","text":"def use_html5_parsing; end","title":""},{"docid":"7bc434b0086b21d845228294a1188899","score":"0.47476685","text":"def frfxchk\n\tfound = false\n\tregistry_enumkeys(\"HKLM\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\").each do |a|\n\t\tif a =~ /Firefox/\n\t\t\tprint_status(\"Firefox was found on this system.\")\n\t\t\tfound = true\n\t\tend\n\tend\n\treturn found\nend","title":""},{"docid":"b160d0f212767025242c6b8ec76c3538","score":"0.47471035","text":"def firefox_browser?\n user_agent = UserAgent.parse(request.user_agent)\n if FirefoxBrowser.detect { |browser| user_agent >= browser }\n true\n else\n false\n end\n end","title":""},{"docid":"2d0092b0f79948d028c650d0a745f14d","score":"0.47455758","text":"def browser_build_version; end","title":""},{"docid":"25be9f40bd0a68cc386da55bb9e103b0","score":"0.4741859","text":"def emulation; end","title":""},{"docid":"ba90f9c66d7eb7845cbc827b2fb7a83e","score":"0.47383216","text":"def test_Save_001_SaveHTML\n\n # Uncomment this line to test with a global logger\n #$logger = capture_results()\n\n puts2(\"\")\n puts2(\"#######################\")\n puts2(\"Testcase: test_Save_001_SaveHTML\")\n puts2(\"#######################\")\n\n sGoogleURL = \"http://google.com\"\n sBingURL = \"http://www.bing.com\"\n\n begin # Start local browsers\n\n # Find a location on the local filesystem that will allow this unit test to write a file\n if(is_win?)\n # Get the TEMP Environment Variable setting\n hEnvVars = getenv(\"TEMP\")\n sOutputDir = hEnvVars[\"TEMP\"].to_s\n else\n sOutputDir = \"/tmp\"\n end\n\n puts2(\"\\nFiles created by this unit test will be saved in: \" + sOutputDir + \"\\n\")\n\n puts2(\"Create a new local Browser Object\")\n browser = start_browser(\"firefox\", sGoogleURL)\n sleep 2\n\n sCurrentURL = browser.url\n puts2(\"Current URL: \" + sCurrentURL)\n\n puts2(\"\\nSave the Web page\")\n browser.save_html(\"Google-HomePage\", sOutputDir)\n\n puts2(\"\\nLoad a different URL\")\n browser.goto(sBingURL)\n sleep 2\n\n sCurrentURL = browser.url\n puts2(\"Current URL: \" + sCurrentURL)\n\n puts2(\"\\nSave the Web page\")\n browser.save_html(\"Bing\")\n #browser.save_html(\"Bing\", sOutputDir)\n\n rescue => e\n\n puts2(\"*** ERROR and Backtrace: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\"), \"ERROR\")\n\n # Close the browser\n browser.close\n\n # Raise the error with a custom message after the rest of the rescue actions\n raise(\"*** TESTCASE - test_Save_001_SaveHTML\")\n\n ensure\n\n # Close the browser\n browser.close\n\n end # Start local browsers\n\n end","title":""},{"docid":"255b128abb2eb262fd52b20ff68129b9","score":"0.47370782","text":"def escaper=(_); end","title":""},{"docid":"9136aa7f776c50fe0350775db445c181","score":"0.4730069","text":"def kill_firefox\n\tprint_status(\"Killing the Firefox Process if open...\")\n\t@client.sys.process.get_processes().each do |x|\n\t\tif x['name'].downcase == \"firefox.exe\"\n\t\t\tprint_status(\"\\tFirefox Process found #{x['name']} #{x['pid']}\")\n\t\t\tprint_status(\"\\tKilling process .....\")\n\t\t\tsession.sys.process.kill(x['pid'])\n\t\tend\n\tend\nend","title":""},{"docid":"ebf2a3eda06460e2a7ac67908f7914e3","score":"0.47130105","text":"def test_150\n #test_000\n printf \"\\n+ Test 150\"\n open_metric_tab($link_texts[\"metric_tab\"][5])\n click (\"#{$xpath[\"metric\"][\"redraw_graph_button\"]}\")\n sleep WAIT_TIME\n assert(is_element_present($xpath[\"metric\"][\"redraw_graph_view\"]))\n ## selenium is not being able to test Flash/Flex/Silverlight or Java Applets\n logout\n end","title":""},{"docid":"4d0e775bbf970c4c956d477f672856bb","score":"0.47019166","text":"def test_008\n # SamplePU2 (last PU) has no pj\n Pj.destroy_all\n pu = Pu.find(:last)\n\n open_pj_registration_page(pu.id)\n xp_tmp = \"//div[@id='add_pj_window']/form/table[2]/tbody/tr[2]/td[1]/ul/li\"\n begin\n assert_equal 1, get_xpath_count(xp_tmp)\n wait_for_element_text(xp_tmp, _(\"Not inherit.\"))\n rescue Test::Unit::AssertionFailedError\n @verification_errors << $!\n end\n logout\n make_original\n end","title":""},{"docid":"3ec127e5edc09e87ef2b83cf65df1a34","score":"0.46960124","text":"def is_explorer?\n \trequest.user_agent.downcase =~ /msie/\n end","title":""},{"docid":"9e630b3f12104138a122dfd693b7f9b1","score":"0.46926922","text":"def test04_click_patch_logo_TC_24407\n\t\tloginGroup\n\t\tsleep 8\n\t\t$browser.goto($patch_groups)\n\t\tsleep 8\n\t\t$location_site_logo.when_present.fire_event(\"onclick\")\n\t\tsleep 8\n\t\t\n\t\tbegin\n\t\tsleep 8\n\t\tassert $browser.text.include? \"Top News\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GS1_T4: FAILED! Unable return home after clicking the Patch logo.\"\n\t\tend\t\n\tend","title":""},{"docid":"72d0925058a97c2f4d265e62256473cb","score":"0.4690154","text":"def redacted_page?\n @browser.url == 'https://site.com/' ? true : false\n end","title":""},{"docid":"eb255f369cccf73fd06771f08e74ff7a","score":"0.4687275","text":"def test_wd_st_008\n printf \"\\n+ Test 008\"\n open_diff_administration_page\n assert is_text_present($diff_administration_xpath[\"link_to_result\"])\n #assert @selenium.is_text_present($diff_administration[\"link_to_result\"])\n assert @selenium.is_text_present($diff_administration[\"no_result_yet\"])\n logout\n end","title":""},{"docid":"f35d1413ac55d9c3cf9f489f3d083c84","score":"0.4683559","text":"def page_load_hack\n page.should_not have_content 'ROGER'\n end","title":""},{"docid":"b617a46f863fa7e89114d6b36666bc69","score":"0.46819454","text":"def firefox_runner\n command = build_cucumber_command(\"firefox\", options)\n run_command(command, options[:verbose])\n end","title":""},{"docid":"33081dfcea281524ffcdd0718c09408f","score":"0.46722192","text":"def start_session\n @download_dir = File.join(Dir::pwd, 'features', 'downloads')\n Dir::mkdir(@download_dir) unless Dir::exists? @download_dir\n mk_screenshot_dir(File.join(Dir::pwd, 'features', 'screenshots'))\n\n if @firefox_profile_name\n @profile = Selenium::WebDriver::Firefox::Profile.from_name @firefox_profile_name\n else\n @profile = Selenium::WebDriver::Firefox::Profile.new\n end\n @profile['browser.download.dir'] = @download_dir\n @profile['browser.download.folderList'] = 2\n @profile['browser.helperApps.neverAsk.saveToDisk'] = \"application/pdf\"\n @profile['browser.link.open_newwindow'] = 3\n\n if @firefox_path\n Selenium::WebDriver::Firefox.path = @firefox_path\n end\n\n if is_headless\n # Possibly later we can use different video capture options...\n #video_capture_options = {:codec => 'mpeg4', :tmp_file_path => \"/tmp/.headless_ffmpeg_#{@headless.display}.mp4\", :log_file_path => 'foo.log'}\n @headless = Headless.new(:dimensions => DEFAULT_DIMENSIONS)\n @headless.start\n end\n\n # Setup some basic Capybara settings\n Capybara.run_server = false\n Capybara.app_host = host\n Capybara.default_wait_time = 5\n\n # Register the Firefox driver that is going to use this profile\n Capybara.register_driver :selenium do |app|\n Capybara::Selenium::Driver.new(app, :profile => @profile)\n end\n Capybara.current_driver = :selenium\n\n visit base_path\n\n @driver = page.driver.browser\n end","title":""},{"docid":"53e8cfcda28af8ce28a98feb7a9c3117","score":"0.46720278","text":"def browser\n @b\n end","title":""},{"docid":"c0b379bf0adf437a35bb82a647a6f592","score":"0.4671293","text":"def use_html5_parsing=(_arg0); end","title":""},{"docid":"474540e5b10cfb713cffdd9cb712ce49","score":"0.46701628","text":"def get_moz_platform_status()\n xml_data = process_get_request(URI.parse(@mozilla_status_url)).body\n extractor = /\\s*(.*?)\\s*<\\/div>.*?
\\s*(.*?)\\s*<\\/p>/m\n xml_data.scan(extractor)[0]\n end","title":""},{"docid":"d8d4fa2c90071e36cd4873e3d45feb0d","score":"0.4669652","text":"def chrome_version; end","title":""},{"docid":"d8d4fa2c90071e36cd4873e3d45feb0d","score":"0.4669652","text":"def chrome_version; end","title":""},{"docid":"98becec4cb9815d6ba543d1c7f6d2527","score":"0.4659996","text":"def test_nothing_yet\n browser = open_browser(\"/\")\n fail \"Need to write my Watir on Rails test\"\n end","title":""},{"docid":"a82f0c25cfbe2fa6d939abb628f094e3","score":"0.4657437","text":"def no_browser # :nologin: :norobots:\n end","title":""},{"docid":"1936c57cd08a2b750d6a4e766b5df351","score":"0.4652684","text":"def test_isSupported12\n features = []\n features << \"Core\"\n features << \"XML\"\n features << \"HTML\"\n features << \"Views\"\n features << \"StyleSheets\"\n features << \"CSS\"\n features << \"CSS2\"\n features << \"Events\"\n features << \"UIEvents\"\n features << \"MouseEvents\"\n features << \"MutationEvents\"\n features << \"HTMLEvents\"\n features << \"Range\"\n features << \"Traversal\"\n features << \"bogus.bogus.bogus\"\n \n doc = nil\n rootNode = nil\n featureElement = nil\n state = nil\n doc = load_document(\"staff\", false)\n rootNode = doc.documentElement()\n state = rootNode.isSupported(\"Core\", \"2.0\")\n assertTrue(\"Core2\", state)\n indexid35967357 = 0\n while (indexid35967357 < features.size())\n featureElement = features.get(indexid35967357)\n state = rootNode.isSupported(featureElement, \"1.0\")\n indexid35967357 += 1\n end\n indexid36022572 = 0\n while (indexid36022572 < features.size())\n featureElement = features.get(indexid36022572)\n state = rootNode.isSupported(featureElement, \"2.0\")\n indexid36022572 += 1\n end\n \n end","title":""},{"docid":"7e72cec381f12353369b813ad654b3fc","score":"0.46506804","text":"def initialize\n\t\t@agent = Mechanize.new\n\t\t@agent.user_agent_alias = 'Mac Firefox'\n\tend","title":""},{"docid":"3178bc4422f8469b926253ad31027edf","score":"0.4646051","text":"def nodeWebKitName\n\t\"nwjs\"\nend","title":""},{"docid":"3178bc4422f8469b926253ad31027edf","score":"0.4646051","text":"def nodeWebKitName\n\t\"nwjs\"\nend","title":""},{"docid":"4bca8534549e21ce625b737f09a74708","score":"0.46445176","text":"def persist_browser\n Capybara.current_session.instance_variable_set(:@touched, true)\n end","title":""},{"docid":"5f2113ef14eed8728c6ae64a05715860","score":"0.46435452","text":"def page!\n puts save_and_open_page\n puts save_and_open_screenshot\n\n puts \"[DEBUG]page.html:\"\n puts page.html\n\n if Capybara.current_driver == :webkit\n puts \"[DEBUG]console_messages:\"\n puts page.driver.console_messages\n # puts page.driver.error_messages\n end\n\n if Capybara.current_driver == :poltergeist\n page.driver.render('tmp/page.png') && `open tmp/page.png`\n end\nend","title":""},{"docid":"e5ddca2de8442a0e0553828efde481c8","score":"0.4635157","text":"def frfxpilfer(frfoxdbloc,session,logs,usrnm,logfile)\n\tprint_status(\"Getting Firefox information for user #{usrnm}\")\n\tfrfxplacesget(frfoxdbloc,usrnm)\n\tfrfxpswd(frfoxdbloc,usrnm)\n\tfile_local_write(logfile,frfxdmp(usrnm))\nend","title":""},{"docid":"541ce0a8013a4101000c359fabaf0cd3","score":"0.46338394","text":"def setup_code_link_handling\n top.runIt(\"Opal.ChromeEval.$eval(Opal.RUBY_ENGINE_VERSION)\",\n lambda { |result, exception|\n `console.orig_log(exception)` if exception\n msg = result ? \"Inspected Window Opal::VERSION = #{result}\\n\" : \"Opal not running or older than 0.7 - Console not supported for this page\\n\"\n write msg\n })\n \n end","title":""},{"docid":"bd734167f80f52d35ac8893163fdce30","score":"0.4626221","text":"def test_WebPage_009_wait_until_status\r\n\r\n puts2(\"\")\r\n puts2(\"#######################\")\r\n puts2(\"Testcase: test_WebPage_009_wait_until_status\")\r\n puts2(\"#######################\")\r\n\r\n #$VERBOSE = true\r\n #$DEBUG = true\r\n iDelay = 2\r\n\r\n # Define components of the URL for the WatirWorks HTML Tags web page\r\n sProtocol = \"file:///\"\r\n sRootURL = Dir.pwd\r\n sPage = \"unittests/data/html/html_tags.html\"\r\n\r\n # Construct the URL\r\n sURL = sProtocol + sRootURL + \"/\" + sPage\r\n\r\n begin # Start local browsers\r\n\r\n puts2(\"Create a new local Browser Object\")\r\n #browser = Watir::Browser.new\r\n browser = start_browser($sDefaultBrowser)\r\n sleep 2\r\n\r\n puts2(\"\\nLoad the WatirWorks HTML tags page\")\r\n browser.goto(sURL)\r\n sleep iDelay\r\n puts2(\"Current URL: \" + browser.url)\r\n\r\n # Set initial values\r\n aStatusTextToCheck = [ \"Done\", \"Bogus Text\"]\r\n tStartTime = Time.now\r\n\r\n # Loop\r\n aStatusTextToCheck.each do | sString |\r\n\r\n puts2(\"\\nChecking Browser's status text = \" + sString)\r\n\r\n # Validate the browser's status text\r\n if(browser.wait_until_status(sString, 3, 0.1))\r\n puts2(\"Found expected Browser's status text = \" + browser.status)\r\n else\r\n puts2(\"Found unexpected Browser's status text = \" + browser.status)\r\n end\r\n\r\n end # Loop\r\n\r\n puts2(\"Elapsed time = \" + calc_elapsed_time(tStartTime))\r\n\r\n rescue => e\r\n\r\n puts2(\"*** ERROR and Backtrace: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\"), \"ERROR\")\r\n\r\n # Close the browser\r\n browser.close\r\n\r\n # Raise the error with a custom message after the rest of the rescue actions\r\n raise(\"*** TESTCASE - test_WebPage_009_wait_until_status\")\r\n\r\n ensure\r\n\r\n # Close the browser\r\n browser.close\r\n\r\n end # Start local browsers\r\n\r\n end","title":""},{"docid":"98ae8e94268eee3c128dc301d4cd778f","score":"0.4624883","text":"def gnu_display\n end","title":""},{"docid":"bd7cfd3ea1e29df6c3d9fa862cbb387b","score":"0.4624765","text":"def prepare_browser\n handles = driver.window_handles.map(&:to_s)\n driver.execute_script \"window.open('','_blank');\"\n sleep 3\n driver.window_handles.each do |handle|\n driver.switch_to.window(handle)\n sleep 1\n driver.close if handles.include? handle.to_s\n end\n driver.switch_to.window(driver.window_handles[0])\n end","title":""},{"docid":"7db0727baf89eb76beac27c515d7fe32","score":"0.46245039","text":"def support; end","title":""},{"docid":"f79c8a7f7270638647d36eedb7e898b9","score":"0.46240333","text":"def firefox_running?()\n rc = nil\n Log.Debug(:h2, \"[FIREFOX_RUNNING?]\") {\n ps = POSIX::Spawn::Child.new( {'COLUMNS' => '9999'}, *CMDLN_PS )\n raise \"executing '/bin/ps' failed\" unless ps.success?\n rc = %r[/Firefox\\.app/Contents/MacOS/firefox].match(ps.out) ? true : false\n }\n Log.Debug :h2, \"{firefox_running?} => #{rc.safe_s}\"\n rc\n end","title":""},{"docid":"9bd0673062b59c78694016f605e4c234","score":"0.46205646","text":"def escaped_styling_rendering_test_method; end","title":""}],"string":"[\n {\n \"docid\": \"110570677937e800bbc37a326066f65c\",\n \"score\": \"0.5941491\",\n \"text\": \"def badbrowser\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"33ab105f935f71467912fe85cb029fde\",\n \"score\": \"0.57274455\",\n \"text\": \"def desiredBrowser\\n #:htmlunit\\n #:chrome\\n :firefox\\n #@caps\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2c95b7ca228294e5d9ed14a2481f8569\",\n \"score\": \"0.566204\",\n \"text\": \"def firefox?()\\n return fetch_boolean(\\\"_sahi._isFF()\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3682c23cb3adce4c8bda15c6a4d83830\",\n \"score\": \"0.5653025\",\n \"text\": \"def firefox?\\n !!(ua =~ /Firefox/)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3682c23cb3adce4c8bda15c6a4d83830\",\n \"score\": \"0.5653025\",\n \"text\": \"def firefox?\\n !!(ua =~ /Firefox/)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2164530a83b13606e1a339ea39bdeed8\",\n \"score\": \"0.5627564\",\n \"text\": \"def browser_name\\n :firefox # must be a symbol\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9c12a6fded94a45f8acfe407f2ed5e73\",\n \"score\": \"0.56038237\",\n \"text\": \"def test_selenium_can_drive_firefox_headless\\n options = Selenium::WebDriver::Firefox::Options.new\\n options.add_argument('--headless')\\n driver = Selenium::WebDriver.for :firefox, options: options\\n driver.quit\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"78422c9016c8d6ac79b0b77130075566\",\n \"score\": \"0.5419949\",\n \"text\": \"def firefox?\\r\\n session[:firefox]\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9c0d41a2c4f50dc39b617a31c8a12190\",\n \"score\": \"0.5417949\",\n \"text\": \"def compression_browser_workaround_state\\n super\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a5fbe906103e3be1662ed3c360504c97\",\n \"score\": \"0.53660095\",\n \"text\": \"def process_firefox(agent)\\n @identifier = @engine if @identifier == \\\"\\\"\\n\\n if agent.include?(\\\"Firefox\\\")\\n @browser = \\\"Firefox\\\"\\n end\\n\\n if @identifier.include?(\\\"Firefox\\\") || @renderer.include?(\\\"Firefox\\\") || @engine.include?(\\\"Firefox\\\")\\n @browser = \\\"Firefox\\\"\\n\\n identifier_sub = nil\\n @identifier.gsub(/[\\\\\\\\:\\\\?'\\\"%!@#\\\\$\\\\^&\\\\*\\\\(\\\\)\\\\+]/, '').split(\\\" \\\").find do |ident|\\n if ident.include?(\\\"Firefox\\\")\\n identifier_sub = ident.sub(\\\"Firefox\\\\/\\\", \\\"\\\").sub(\\\"Gecko/\\\", \\\"\\\")\\n identifier_sub.gsub!(/[\\\\+]/, '')\\n end\\n identifier_sub\\n end\\n if identifier_sub.nil? && @renderer.include?(\\\"Firefox\\\")\\n renderer_gsub_gsub = @renderer.sub(\\\"\\\\(\\\", \\\"\\\").sub(\\\"\\\\)\\\", \\\"\\\")\\n renderer_gsub_gsub.strip.split(\\\",\\\").each do |sec|\\n identifier_sub = sec.sub(\\\"Firefox\\\\/\\\", \\\"\\\").strip if sec.include?(\\\"Firefox\\\")\\n end\\n end\\n if identifier_sub.nil? && @engine.include?(\\\"Firefox\\\")\\n @engine.gsub(/[\\\\\\\\:\\\\?'\\\"%!@#\\\\$\\\\^&\\\\*\\\\(\\\\)\\\\+]/, '').split(\\\" \\\").each do |ident|\\n identifier_sub = ident.sub(\\\"Firefox\\\\/\\\", \\\"\\\").sub(\\\"Gecko/\\\", \\\"\\\") if ident.include?(\\\"Firefox\\\")\\n identifier_sub.gsub!(/[\\\\+]/, '') if identifier_sub && identifier_sub.include?(\\\"+\\\")\\n end\\n end\\n \\n identifier_sub.gsub!(/;.*/, '')\\n\\n if identifier_sub\\n version.update(*identifier_sub.split(\\\".\\\")[0, 3])\\n end\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d21cd380f873c5fe3e9e58be7fc350e5\",\n \"score\": \"0.536018\",\n \"text\": \"def gecko?() product?('Gecko'); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4aa1531e735f4c3fa71a83f27c350033\",\n \"score\": \"0.53441\",\n \"text\": \"def test_selenium_can_drive_firefox\\n assert_nothing_raised do\\n driver = ensure_driver(:firefox)\\n driver.quit \\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e27a47584187a77bafb1d7703b47652\",\n \"score\": \"0.5322406\",\n \"text\": \"def browser_version; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e27a47584187a77bafb1d7703b47652\",\n \"score\": \"0.5322406\",\n \"text\": \"def browser_version; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e27a47584187a77bafb1d7703b47652\",\n \"score\": \"0.5322406\",\n \"text\": \"def browser_version; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8e27a47584187a77bafb1d7703b47652\",\n \"score\": \"0.5322406\",\n \"text\": \"def browser_version; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"40d2e99104577a22b4f31456d3c00d6e\",\n \"score\": \"0.53056\",\n \"text\": \"def wait_for_browser\\r\\n\\t\\t\\t # Watir 3 does not support it any more\\r\\n # @browser.waitForIE unless is_firefox?\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"277ccb1e497904d0cac3a2e6604429ff\",\n \"score\": \"0.52812135\",\n \"text\": \"def headless!; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"277ccb1e497904d0cac3a2e6604429ff\",\n \"score\": \"0.52812135\",\n \"text\": \"def headless!; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ae89ce88252325ba8a3d35b8f1e18287\",\n \"score\": \"0.5256999\",\n \"text\": \"def firefox_min_browser(vers = nil)\\n !vers.blank? ? vers : '1.5'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d39de04f3c78f50c503dfc3ed8bcc38c\",\n \"score\": \"0.51993954\",\n \"text\": \"def is_like_gecko?\\n [:firefox, :iceweasel, :netscape, :safari, :chrome, :gecko].include? @ua\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e07152b2646df15f72a23030d48d49ea\",\n \"score\": \"0.51883113\",\n \"text\": \"def version_msie\\n\\t\\t\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"11e9686d7c50d46e1fea43d55c8eca7d\",\n \"score\": \"0.5172977\",\n \"text\": \"def old_ff?\\n\\t\\t(request.user_agent =~ /Firefox\\\\/([0-2][0-9])|Firefox\\\\/([5-9])/) || (request.user_agent =~ /(MSIE 6)/) || (request.user_agent =~ /Chrome\\\\/([0-2][0-9])/)\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"574dce7e6e71d52ddb40cb780af0dd10\",\n \"score\": \"0.5130247\",\n \"text\": \"def webkit_options; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f9c06570fe613e470bd5677badaddbe2\",\n \"score\": \"0.512814\",\n \"text\": \"def browserconfig; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"57c37b6774e5bcdecd3c556af7e62d2a\",\n \"score\": \"0.5123367\",\n \"text\": \"def browser_firefox_version\\n if browser_is? 'firefox'\\n match = ua.match(%r{\\\\bfirefox/([\\\\d\\\\.]+)\\\\b})\\n match[1].to_f if (match)\\n end or 0\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"70ef271c86fc5c4f60aa60f69f6eea13\",\n \"score\": \"0.5121397\",\n \"text\": \"def start_firefox\\n begin\\n profile = Selenium::WebDriver::Firefox::Profile.new\\n\\n if @geolocation.nil?\\n # pas de geolocation\\n profile['network.proxy.type'] = 0\\n profile['network.proxy.no_proxies_on'] = \\\"\\\"\\n else\\n #geolocation\\n profile['network.proxy.type'] = 1\\n case @geolocation.protocol\\n when \\\"http\\\"\\n profile['network.proxy.http'] = @geolocation.ip\\n profile['network.proxy.http_port'] = @geolocation.port.to_i\\n profile['network.proxy.ssl'] = @geolocation.ip\\n profile['network.proxy.ssl_port'] = @geolocation.port.to_i\\n when \\\"socks\\\"\\n profile['network.proxy.socks'] = @geolocation.ip\\n profile['network.proxy.socks_port'] = @geolocation.port.to_i\\n end\\n\\n\\n end\\n\\n\\n Selenium::WebDriver::Firefox.path = @path_firefox\\n client = Selenium::WebDriver::Remote::Http::Default.new\\n client.read_timeout = 120 # seconds\\n\\n @driver = Selenium::WebDriver.for :firefox,\\n :profile => profile,\\n :http_client => client\\n @driver.manage.timeouts.implicit_wait = 3\\n @user_agent = @driver.execute_script(\\\"return navigator.userAgent\\\")\\n\\n rescue Exception => e\\n raise Error.new(FIREFOX_NOT_START, :error => e)\\n\\n else\\n\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"871721f84f1d95af5a04619b0de9db61\",\n \"score\": \"0.51069635\",\n \"text\": \"def start_firefox()\\n @started_ff = false\\n Log.Debug(\\\"[START_FIREFOX]\\\") {\\n unless firefox_running?\\n # start it\\n Log.Debug(\\\"[starting Firefox]\\\") {\\n rc = POSIX::Spawn::Child.new *CMDLN_START_FF\\n raise \\\"executing '#{CMDLN_START_FF.join(' ')}' failed\\\" unless rc.success?\\n\\n # give Firefox a chance to initialize\\n sleep 15\\n\\n @started_ff = true\\n\\n Log.Debug \\\"stdout\\\", rc.out\\n Log.Debug \\\"stderr\\\", rc.err\\n }\\n end\\n }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d12751d8439714c1b087bdc3e85e017\",\n \"score\": \"0.51033187\",\n \"text\": \"def webkit_options=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7b6e0eb43e8a361458b4251d5a95a228\",\n \"score\": \"0.50987405\",\n \"text\": \"def get_browser\\n case RUBY_PLATFORM\\n when /darwin/i\\n require 'appscript'\\n if !defined? @@browser\\n if Appscript.app('System Events').processes['Firefox'].exists()\\n puts \\\"stopping Firefox...\\\"\\n sleep 1\\n Appscript.app('Firefox').quit\\n sleep 3\\n puts \\\"hopefully Firefox is stopped by now. so we can start it. Gah\\\"\\n end\\n end\\n end\\n tries = 1\\n begin\\n @@browser ||= FireWatir::Firefox.new(:waitTime => tries+3)\\n rescue Exception => e\\n puts \\\"e: #{e.inspect}\\\"\\n case RUBY_PLATFORM\\n when /darwin/i\\n sleep tries\\n puts \\\"trying to start Firefox #{tries}\\\"\\n if Appscript.app('System Events').processes['Firefox'].exists()\\n puts \\\"stopping existing Firefox...\\\"\\n Appscript.app('Firefox').quit\\n end\\n retry if tries < 5\\n end\\n end\\n \\n at_exit do\\n if @@browser\\n puts \\\"closing firefox\\\"\\n begin Timeout.timeout(2) do\\n if defined? Appscript \\n begin\\n if Appscript.app('System Events').processes['Firefox'].exists\\n Appscript.app('Firefox').quit\\n end\\n rescue RuntimeError, Exception\\n @@browser.close\\n end\\n else\\n @@browser.close\\n end\\n end rescue Timeout::Error end\\n @@browser = nil\\n end\\n end\\n @@browser\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"35ae528dfc074f6c81b7a7336d228269\",\n \"score\": \"0.5090856\",\n \"text\": \"def wait_for_browser\\n @browser.waitForIE unless is_firefox?\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"11ad897d5f2300b8143f9ce28ffde1cf\",\n \"score\": \"0.50643265\",\n \"text\": \"def extract_with_selenium\\r\\n return false\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1bd4cb2d30d13f3f097b71f3b1d17c07\",\n \"score\": \"0.5060281\",\n \"text\": \"def is_firefox?\\n begin\\n find_window(\\\"MozillaWindowClass\\\")#MozillaUIWindowClassname\\n return true if @main_window >0\\n rescue =>e\\n raise \\\"not exit firefox #{e} only support on windows OS\\\"\\n return false\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"922ad13267ad637c9292ec039c11884f\",\n \"score\": \"0.5052612\",\n \"text\": \"def obscured?; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"97b80bc3eff1452374f343edd32fd512\",\n \"score\": \"0.50146604\",\n \"text\": \"def formatted_browser\\r\\n return \\\"*#{@browser}\\\"\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eda40b46e3cfb93d116d25605579d161\",\n \"score\": \"0.5013493\",\n \"text\": \"def kill_foxes\\n Sys::ProcTable.ps.each do |ps|\\n if ps.comm.downcase =~ /firefox/\\n Process.kill('KILL',ps.pid)\\n end\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"10f3280d366c80c7ea7d3a9f5db6b025\",\n \"score\": \"0.49897367\",\n \"text\": \"def setup\\n @driver = Selenium::WebDriver.for :firefox\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"10f3280d366c80c7ea7d3a9f5db6b025\",\n \"score\": \"0.49897367\",\n \"text\": \"def setup\\n @driver = Selenium::WebDriver.for :firefox\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f64a49bf0a46f276e8a235d556d77066\",\n \"score\": \"0.49767366\",\n \"text\": \"def driver_initialize\\n puts \\\"Step 1: Opening firefox browser\\\"\\n options = Selenium::WebDriver::Firefox::Options.new()\\n $web_driver = Selenium::WebDriver.for(:firefox, options: options)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ae7125ccec346d0d2a0ab000ba9b900a\",\n \"score\": \"0.49718082\",\n \"text\": \"def get_browser(browser)\\n if browser == 'chrome'\\n return :chrome\\n end\\n :firefox\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a7da164c3f7f6b14c3594433f222f6c5\",\n \"score\": \"0.49702346\",\n \"text\": \"def detect_firefox_o_s()\\r\\n if (detect_firefox_o_s_phone() || detect_firefox_o_s_tablet())\\r\\n return true\\r\\n end\\r\\n\\r\\n return false\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f99f93486a1fab7f1755a9911ac0226d\",\n \"score\": \"0.4948663\",\n \"text\": \"def test_base_methods\\n browser.goto('https://google.com')\\n\\n update_action_log(:goto, browser.title.eql?('Google'))\\n update_action_log(:title, !(browser.title.nil? || browser.title.empty?))\\n update_action_log(:url, !(browser.url.nil? || browser.url.empty?))\\n update_action_log(:driver, !browser.driver.nil?)\\n update_action_log(:html, !browser.html.nil? && browser.html.include?(''))\\n update_action_log(:body, !browser.body.nil? && browser.body.divs.size > 1)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3339c1bc37628b9eccbba656c731391b\",\n \"score\": \"0.49430025\",\n \"text\": \"def browser_status\\n\\n # Create bogus browser for testing purposes.\\n if RAILS_ENV == 'test'\\n @session_working = TEST_SESSION_WORKING\\n @cookies_enabled = TEST_COOKIES_ENABLED\\n @js = TEST_JS\\n @ua = TEST_UA\\n @ua_version = TEST_UA_VERSION\\n return true\\n end\\n\\n ua = request.env['HTTP_USER_AGENT']\\n ip = request.env['HTTP_X_FORWARDED_FOR'] ||\\n request.env['HTTP_CLIENT_IP'] ||\\n request.env['HTTP_REMOTE_ADDR']\\n browser_id = \\\"#{ip}|#{ua}\\\"\\n\\n # Look up the user's browser. We keep some minimal info about all browsers\\n # that do not have a working session yet.\\n @@our_session_cache ||= {}\\n our_session = @@our_session_cache[browser_id]\\n\\n if session[:_x]\\n\\n # Session is working, clear entry from \\\"our session\\\" cache.\\n session_new = false\\n @session_working = true\\n if our_session\\n @@our_session_cache.delete(browser_id)\\n clean_our_session_cache\\n end\\n\\n else\\n session[:_x] = true\\n if our_session\\n\\n # Session is not working, but we've seen this browser before.\\n session_new = false\\n @session_working = false\\n our_session[:time] = Time.now\\n\\n else\\n\\n # Session in not working, and we've never seen this browser before.\\n session_new = true\\n @session_working = nil\\n our_session = @@our_session_cache[browser_id] = { :time => Time.now }\\n clean_our_session_cache\\n end\\n end\\n\\n # Is javascript enabled?\\n if session[:js_override]\\n @js = (session[:js_override] == :on)\\n elsif params[:_js]\\n @js = (params[:_js] == 'on')\\n elsif session[:_js] != nil\\n @js = (session[:_js] == true)\\n elsif our_session && our_session[:js] != nil\\n @js = (our_session[:js] == true)\\n else\\n @js = nil\\n end\\n session[:_js] = @js\\n our_session[:js] = @js if our_session\\n\\n # Are cookies enabled?\\n if cookies[:_x]\\n @cookies_enabled = true\\n else\\n cookies[:_x] = '1'\\n @cookies_enabled = session_new ? nil : false\\n end\\n\\n # What is the user agent?\\n @ua, @ua_version = parse_user_agent(ua)\\n\\n # print \\\"========================================\\\\n\\\"\\n # print \\\"browser_id = [#{browser_id }]\\\\n\\\"\\n # print \\\"session_new = [#{session_new }]\\\\n\\\"\\n # print \\\"@session_working = [#{@session_working}]\\\\n\\\"\\n # print \\\"@cookies_enabled = [#{@cookies_enabled}]\\\\n\\\"\\n # print \\\"@js = [#{@js }]\\\\n\\\"\\n # print \\\"@ua = [#{@ua }]\\\\n\\\"\\n # print \\\"@ua_version = [#{@ua_version }]\\\\n\\\"\\n # print \\\"HTTP_USER_AGENT = [#{ua }]\\\\n\\\"\\n # print \\\"params = [#{params.inspect }]\\\\n\\\"\\n # print \\\"========================================\\\\n\\\"\\n\\n # Find time zone that matches the best.\\n Time.zone = cookies[:tz]\\n\\n # If we've never seen this user before, serve a tiny page that redirects\\n # immediately to tell us the state of javascript, and lets us determine\\n # whether session and cookies are woring correctly immediately. (The\\n # _new thing prevents infinite loops, just in case.)\\n if session_new && params[:_new] != 'true'\\n render(:text => FIRST_PAGE % [\\n reload_with_args(:_js => 'on', :_new => 'true'),\\n reload_with_args(:_js => 'off', :_new => 'true'),\\n ])\\n else\\n return true\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9ea9054c31b5460ecdd54430611e5dd6\",\n \"score\": \"0.49292597\",\n \"text\": \"def browser\\n $browser ||= Watir::Browser.new(:chrome)\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a6ae09155610488b3777a4992e161b7b\",\n \"score\": \"0.49279916\",\n \"text\": \"def setup\\n # Do nothing\\n @profile = Selenium::WebDriver::Firefox::Profile.from_name 'default'\\n @profile['network.cookie.cookieBehavior'] = '2'\\n @profile.native_events = true\\n @driver = Selenium::WebDriver.for :firefox, :profile => @profile\\n #@driver.manage.window.maximize\\n @driver.manage.window.resize_to(350, 750)\\n @driver.manage.timeouts.implicit_wait = 20\\n @wait = Selenium::WebDriver::Wait.new :timeout => 120\\n @baseURL = 'http://qa.healthnow.com'\\n #@verification_errors = []\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3fc62999f66ac51441f9ba80922d1854\",\n \"score\": \"0.49030566\",\n \"text\": \"def escaper; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"31c0747ce7e9f90c0f327d4a61a4f41c\",\n \"score\": \"0.4894024\",\n \"text\": \"def browser_name\\n ua = request.user_agent.downcase\\n\\n if ua =~ /firefox\\\\/4/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\/5/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\/6/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\/7/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\/8/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\/9/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\/10/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\/11/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\/12/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\/13/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\/14/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/7/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/8/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/9/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/10/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/11/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/12/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/13/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/14/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/15/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/16/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/17/\\n :is_able_to_ajax\\n elsif ua =~ /chrome\\\\/18/\\n :is_able_to_ajax\\n elsif ua =~ /chromium/\\n :is_able_to_ajax\\n elsif ua =~ /Version\\\\/5.*Safari/\\n :is_able_to_ajax\\n elsif ua =~ /firefox\\\\//\\n :firefox\\n elsif ua =~ /opera\\\\//\\n :opera\\n elsif ua =~ /chrome\\\\//\\n :chrome\\n elsif ua =~ /safari\\\\//\\n :safari\\n elsif ua =~ /msie/\\n :ie\\n else\\n nil\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2264f6faef0391357d3ea6211da35455\",\n \"score\": \"0.48919532\",\n \"text\": \"def start_firefox\\n rt_count = 1\\n waittime = 10\\n @log.debug(\\\"Firefox Start::Running Firefox\\\")\\n\\t\\tbegin\\n\\t\\t\\tif @user_choices[:firefox_profile]\\n\\t\\t\\t\\t@ff = FireWatir::Firefox.new(:waitTime => waittime, :profile => @user_choices[:firefox_profile])\\n\\t\\t\\telse\\n\\t\\t\\t\\t@ff = FireWatir::Firefox.new(:waitTime => waittime)\\n\\t\\t\\tend\\n\\t\\t\\t@ff.wait\\n @log.debug(\\\"Firefox Start::Success\\\")\\n unless @logged_in\\n @log.debug(\\\"Basic Authorization::Login thread started\\\")\\n Thread.new { self.logon }\\n @logged_in = TRUE\\n end if @user_choices[:dut].length > 2\\n @ff.goto(@user_choices[:dut][0].ip)\\n sleep 3 if @user_choices[:dut].length > 2\\n @ff.link(:text, \\\"Manual Setup\\\").click if @ff.contains_text(\\\"What would you like to do?\\\")\\n return true\\n\\t\\trescue => ex\\n if rt_count < 4\\n @log.debug(\\\"Firefox Start::Firefox didn't start, or no connection to the JSSH server on port 9997 was validated, on attempt #{rt_count}. Trying again...\\\")\\n waittime += 5\\n rt_count += 1\\n retry\\n else\\n @log.fatal(\\\"Firefox Start::Giving up. Last error received: #{ex}\\\")\\n return false\\n end\\n\\t\\tend\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f6d3736680fa30e3a529b57549f711fc\",\n \"score\": \"0.48774943\",\n \"text\": \"def driver_quit\\n puts \\\"Step 12: Closing Firefox browser\\\"\\n $web_driver.quit\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"462f660db193e8894824ce01a14e88fd\",\n \"score\": \"0.48747057\",\n \"text\": \"def during_after_load; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5dd4669cf9f84a6e26de3beb364d9d9e\",\n \"score\": \"0.48722628\",\n \"text\": \"def test_149\\n #test_000\\n printf \\\"\\\\n+ Test 149\\\"\\n open_metric_tab($link_texts[\\\"metric_tab\\\"][5])\\n file_metric_graph_old=@selenium.get_text($xpath[\\\"metric\\\"][\\\"metric_pane_content\\\"])\\n sleep WAIT_TIME\\n click \\\"#{$xpath[\\\"metric\\\"][\\\"customize_button\\\"]}\\\"\\n sleep WAIT_TIME\\n click \\\"#{$xpath[\\\"metric\\\"][\\\"check_all_button\\\"]}\\\"\\n sleep WAIT_TIME\\n click \\\"#{$xpath[\\\"metric\\\"][\\\"cancel_button\\\"]}\\\"\\n sleep WAIT_TIME\\n file_metric_graph_new=@selenium.get_text($xpath[\\\"metric\\\"][\\\"metric_pane_content\\\"])\\n assert_equal file_metric_graph_old,file_metric_graph_new\\n logout\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"baa3d603d20660ed35dba0923b767228\",\n \"score\": \"0.4848062\",\n \"text\": \"def test05_D2FLT05_TC_24393\\n\\t\\t$browser.goto($patch_login)\\n\\t\\tloginDirectory\\n\\t\\t$browser.goto($patch_directory)\\n\\t\\t$directory_user.click\\n\\t\\tsleep 2\\n\\t\\t\\t\\n\\t\\tbegin\\n\\t\\tassert $browser.text.include? \\\"Manager Of\\\"\\n\\t\\trescue => e\\n\\t\\t\\tputs e\\n\\t\\tputs \\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ad99819cf0b38a5a1c6d26c6711bc71c\",\n \"score\": \"0.48359752\",\n \"text\": \"def cur_page\\n clean_url(@BROWSER.url)\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"07d0de550c03c1388e0d0f9dc399a088\",\n \"score\": \"0.48349854\",\n \"text\": \"def watir_wait_for_ajax_object(kind, *args) \\n no_of_tries = 0\\n begin\\n element = $browser.__send__(kind, *args)\\n if element.respond_to?(:assert_exists)\\n # IE\\n element.assert_exists\\n true\\n else\\n # Safari\\n element.exists?\\n end\\n rescue ::Watir::Exception::UnknownObjectException => e\\n no_of_tries += 1\\n debug_log \\\"no_of_tries= #{no_of_tries}\\\" if no_of_tries > 10\\n sleep 0.2 #Just sleep a little bit and give time\\n retry if no_of_tries < 30\\n raise\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"64f6eb85134474ce2fc9681d5c3eeb6d\",\n \"score\": \"0.48198542\",\n \"text\": \"def test_152\\n #test_000\\n printf \\\"\\\\n+ Test 152\\\"\\n open_metric_tab($link_texts[\\\"metric_tab\\\"][5])\\n click ($xpath[\\\"metric\\\"][\\\"redraw_graph_button\\\"])\\n sleep WAIT_TIME\\n @selenium.context_menu($xpath[\\\"metric\\\"][\\\"redraw_graph_view\\\"])\\n sleep WAIT_TIME\\n assert true\\n ##\\n logout\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9efc05ed2913a9b11c1d0ea2cdebd3f5\",\n \"score\": \"0.48037577\",\n \"text\": \"def test_nothing_yet\\r\\n browser = open_browser(\\\"/\\\")\\r\\n fail \\\"Need to write my Watir on Rails test\\\"\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8291bb9a632af53bb519eb2ea1a1099d\",\n \"score\": \"0.47931185\",\n \"text\": \"def test_013\\n #login\\n login\\n\\n #Open PU management page\\n open_pu_management_page_1\\n\\n #Register a new PU\\n\\n @@pu = Pu.find_by_name('SamplePU1')\\n open \\\"/devgroup/pu_index/#{@@pu.id}\\\"\\n wait_for_page_to_load \\\"30000\\\"\\n # Pu setting page\\n click $xpath[\\\"misc\\\"][\\\"PU_setting_page\\\"]\\n sleep 4\\n\\n assert_equal _(\\\"General Setting\\\"), get_text($xpath[\\\"misc\\\"][\\\"tab1_link\\\"])\\n assert_equal _(\\\"Execution Setting\\\"), get_text($xpath[\\\"misc\\\"][\\\"tab2_link\\\"])\\n\\n click $xpath[\\\"misc\\\"][\\\"general_control_tab\\\"]\\n sleep 4\\n assert is_visible(\\\"content1\\\")\\n assert !is_visible(\\\"content2\\\")\\n\\n general_tab_style = @selenium.get_attribute($xpath[\\\"misc\\\"][\\\"tab1_style\\\"])\\n\\n assert_equal TAB_STYLES[\\\"focused\\\"],general_tab_style\\n\\n\\n execution_tab_style = @selenium.get_attribute($xpath[\\\"misc\\\"][\\\"tab2_style\\\"])\\n assert_equal TAB_STYLES[\\\"unfocused\\\"],execution_tab_style\\n\\n #logout\\n logout\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9a306881e747caf4d1d882730d700810\",\n \"score\": \"0.4786033\",\n \"text\": \"def setup_firefox_path\\n firefox_app = nil\\n IO.popen('mdfind \\\"kMDItemFSName = Firefox*.app\\\"') { |io|\\n firefox_app = io.gets\\n }\\n raise \\\"Can't find Firefox app bundle\\\" unless firefox_app\\n firefox_app.chomp!\\n\\n Selenium::WebDriver::Firefox::Binary.path = File.join(firefox_app, 'Contents/MacOS/firefox')\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9a306881e747caf4d1d882730d700810\",\n \"score\": \"0.4786033\",\n \"text\": \"def setup_firefox_path\\n firefox_app = nil\\n IO.popen('mdfind \\\"kMDItemFSName = Firefox*.app\\\"') { |io|\\n firefox_app = io.gets\\n }\\n raise \\\"Can't find Firefox app bundle\\\" unless firefox_app\\n firefox_app.chomp!\\n\\n Selenium::WebDriver::Firefox::Binary.path = File.join(firefox_app, 'Contents/MacOS/firefox')\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8d551867f3cfe27e4630262cb8c8c45b\",\n \"score\": \"0.4785808\",\n \"text\": \"def test_014\\n #login\\n login\\n\\n #Open PU management page\\n open_pu_management_page_1\\n\\n #Register a new PU\\n\\n\\n @@pu = Pu.find_by_name('SamplePU1')\\n open \\\"/devgroup/pu_index/#{@@pu.id}\\\"\\n wait_for_page_to_load \\\"30000\\\"\\n # Pu setting page\\n click $xpath[\\\"misc\\\"][\\\"PU_setting_page\\\"]\\n sleep 4\\n\\n assert_equal _(\\\"General Setting\\\"), get_text($xpath[\\\"misc\\\"][\\\"tab1_link\\\"])\\n assert_equal _(\\\"Execution Setting\\\"), get_text($xpath[\\\"misc\\\"][\\\"tab2_link\\\"])\\n\\n click $xpath[\\\"misc\\\"][\\\"display_page\\\"]\\n sleep 4\\n assert !is_visible(\\\"content1\\\")\\n assert is_visible(\\\"content2\\\")\\n\\n general_tab_style = @selenium.get_attribute($xpath[\\\"misc\\\"][\\\"tab1_style\\\"])\\n\\n assert_equal TAB_STYLES[\\\"unfocused\\\"],general_tab_style\\n\\n\\n execution_tab_style = @selenium.get_attribute($xpath[\\\"misc\\\"][\\\"tab2_style\\\"])\\n assert_equal TAB_STYLES[\\\"focused\\\"],execution_tab_style\\n\\n #logout\\n logout\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c3f498ce80bc596054dabda57a836a63\",\n \"score\": \"0.47857237\",\n \"text\": \"def javascript_driver=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1ab57f0da90942d7a7ebdfeb0d12ec85\",\n \"score\": \"0.47793958\",\n \"text\": \"def error_out(text)\\n # Refresh the page using Selenium API. Firefox's JS environment resets.\\n refresh_failsafe\\n raise(HeadlessBrowserError, \\\"#{text}\\\")\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"05f3e8223c939e7f9b9c6eba6e51b289\",\n \"score\": \"0.47550285\",\n \"text\": \"def use_html5_parsing; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7bc434b0086b21d845228294a1188899\",\n \"score\": \"0.47476685\",\n \"text\": \"def frfxchk\\n\\tfound = false\\n\\tregistry_enumkeys(\\\"HKLM\\\\\\\\SOFTWARE\\\\\\\\Microsoft\\\\\\\\Windows\\\\\\\\CurrentVersion\\\\\\\\Uninstall\\\").each do |a|\\n\\t\\tif a =~ /Firefox/\\n\\t\\t\\tprint_status(\\\"Firefox was found on this system.\\\")\\n\\t\\t\\tfound = true\\n\\t\\tend\\n\\tend\\n\\treturn found\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b160d0f212767025242c6b8ec76c3538\",\n \"score\": \"0.47471035\",\n \"text\": \"def firefox_browser?\\n user_agent = UserAgent.parse(request.user_agent)\\n if FirefoxBrowser.detect { |browser| user_agent >= browser }\\n true\\n else\\n false\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2d0092b0f79948d028c650d0a745f14d\",\n \"score\": \"0.47455758\",\n \"text\": \"def browser_build_version; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"25be9f40bd0a68cc386da55bb9e103b0\",\n \"score\": \"0.4741859\",\n \"text\": \"def emulation; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ba90f9c66d7eb7845cbc827b2fb7a83e\",\n \"score\": \"0.47383216\",\n \"text\": \"def test_Save_001_SaveHTML\\n\\n # Uncomment this line to test with a global logger\\n #$logger = capture_results()\\n\\n puts2(\\\"\\\")\\n puts2(\\\"#######################\\\")\\n puts2(\\\"Testcase: test_Save_001_SaveHTML\\\")\\n puts2(\\\"#######################\\\")\\n\\n sGoogleURL = \\\"http://google.com\\\"\\n sBingURL = \\\"http://www.bing.com\\\"\\n\\n begin # Start local browsers\\n\\n # Find a location on the local filesystem that will allow this unit test to write a file\\n if(is_win?)\\n # Get the TEMP Environment Variable setting\\n hEnvVars = getenv(\\\"TEMP\\\")\\n sOutputDir = hEnvVars[\\\"TEMP\\\"].to_s\\n else\\n sOutputDir = \\\"/tmp\\\"\\n end\\n\\n puts2(\\\"\\\\nFiles created by this unit test will be saved in: \\\" + sOutputDir + \\\"\\\\n\\\")\\n\\n puts2(\\\"Create a new local Browser Object\\\")\\n browser = start_browser(\\\"firefox\\\", sGoogleURL)\\n sleep 2\\n\\n sCurrentURL = browser.url\\n puts2(\\\"Current URL: \\\" + sCurrentURL)\\n\\n puts2(\\\"\\\\nSave the Web page\\\")\\n browser.save_html(\\\"Google-HomePage\\\", sOutputDir)\\n\\n puts2(\\\"\\\\nLoad a different URL\\\")\\n browser.goto(sBingURL)\\n sleep 2\\n\\n sCurrentURL = browser.url\\n puts2(\\\"Current URL: \\\" + sCurrentURL)\\n\\n puts2(\\\"\\\\nSave the Web page\\\")\\n browser.save_html(\\\"Bing\\\")\\n #browser.save_html(\\\"Bing\\\", sOutputDir)\\n\\n rescue => e\\n\\n puts2(\\\"*** ERROR and Backtrace: \\\" + e.message + \\\"\\\\n\\\" + e.backtrace.join(\\\"\\\\n\\\"), \\\"ERROR\\\")\\n\\n # Close the browser\\n browser.close\\n\\n # Raise the error with a custom message after the rest of the rescue actions\\n raise(\\\"*** TESTCASE - test_Save_001_SaveHTML\\\")\\n\\n ensure\\n\\n # Close the browser\\n browser.close\\n\\n end # Start local browsers\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"255b128abb2eb262fd52b20ff68129b9\",\n \"score\": \"0.47370782\",\n \"text\": \"def escaper=(_); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9136aa7f776c50fe0350775db445c181\",\n \"score\": \"0.4730069\",\n \"text\": \"def kill_firefox\\n\\tprint_status(\\\"Killing the Firefox Process if open...\\\")\\n\\t@client.sys.process.get_processes().each do |x|\\n\\t\\tif x['name'].downcase == \\\"firefox.exe\\\"\\n\\t\\t\\tprint_status(\\\"\\\\tFirefox Process found #{x['name']} #{x['pid']}\\\")\\n\\t\\t\\tprint_status(\\\"\\\\tKilling process .....\\\")\\n\\t\\t\\tsession.sys.process.kill(x['pid'])\\n\\t\\tend\\n\\tend\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ebf2a3eda06460e2a7ac67908f7914e3\",\n \"score\": \"0.47130105\",\n \"text\": \"def test_150\\n #test_000\\n printf \\\"\\\\n+ Test 150\\\"\\n open_metric_tab($link_texts[\\\"metric_tab\\\"][5])\\n click (\\\"#{$xpath[\\\"metric\\\"][\\\"redraw_graph_button\\\"]}\\\")\\n sleep WAIT_TIME\\n assert(is_element_present($xpath[\\\"metric\\\"][\\\"redraw_graph_view\\\"]))\\n ## selenium is not being able to test Flash/Flex/Silverlight or Java Applets\\n logout\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d0e775bbf970c4c956d477f672856bb\",\n \"score\": \"0.47019166\",\n \"text\": \"def test_008\\n # SamplePU2 (last PU) has no pj\\n Pj.destroy_all\\n pu = Pu.find(:last)\\n\\n open_pj_registration_page(pu.id)\\n xp_tmp = \\\"//div[@id='add_pj_window']/form/table[2]/tbody/tr[2]/td[1]/ul/li\\\"\\n begin\\n assert_equal 1, get_xpath_count(xp_tmp)\\n wait_for_element_text(xp_tmp, _(\\\"Not inherit.\\\"))\\n rescue Test::Unit::AssertionFailedError\\n @verification_errors << $!\\n end\\n logout\\n make_original\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3ec127e5edc09e87ef2b83cf65df1a34\",\n \"score\": \"0.46960124\",\n \"text\": \"def is_explorer?\\n \\trequest.user_agent.downcase =~ /msie/\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9e630b3f12104138a122dfd693b7f9b1\",\n \"score\": \"0.46926922\",\n \"text\": \"def test04_click_patch_logo_TC_24407\\n\\t\\tloginGroup\\n\\t\\tsleep 8\\n\\t\\t$browser.goto($patch_groups)\\n\\t\\tsleep 8\\n\\t\\t$location_site_logo.when_present.fire_event(\\\"onclick\\\")\\n\\t\\tsleep 8\\n\\t\\t\\n\\t\\tbegin\\n\\t\\tsleep 8\\n\\t\\tassert $browser.text.include? \\\"Top News\\\"\\n\\t\\trescue => e\\n\\t\\t\\tputs e\\n\\t\\tputs \\\"GS1_T4: FAILED! Unable return home after clicking the Patch logo.\\\"\\n\\t\\tend\\t\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"72d0925058a97c2f4d265e62256473cb\",\n \"score\": \"0.4690154\",\n \"text\": \"def redacted_page?\\n @browser.url == 'https://site.com/' ? true : false\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb255f369cccf73fd06771f08e74ff7a\",\n \"score\": \"0.4687275\",\n \"text\": \"def test_wd_st_008\\n printf \\\"\\\\n+ Test 008\\\"\\n open_diff_administration_page\\n assert is_text_present($diff_administration_xpath[\\\"link_to_result\\\"])\\n #assert @selenium.is_text_present($diff_administration[\\\"link_to_result\\\"])\\n assert @selenium.is_text_present($diff_administration[\\\"no_result_yet\\\"])\\n logout\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f35d1413ac55d9c3cf9f489f3d083c84\",\n \"score\": \"0.4683559\",\n \"text\": \"def page_load_hack\\n page.should_not have_content 'ROGER'\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b617a46f863fa7e89114d6b36666bc69\",\n \"score\": \"0.46819454\",\n \"text\": \"def firefox_runner\\n command = build_cucumber_command(\\\"firefox\\\", options)\\n run_command(command, options[:verbose])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"33081dfcea281524ffcdd0718c09408f\",\n \"score\": \"0.46722192\",\n \"text\": \"def start_session\\n @download_dir = File.join(Dir::pwd, 'features', 'downloads')\\n Dir::mkdir(@download_dir) unless Dir::exists? @download_dir\\n mk_screenshot_dir(File.join(Dir::pwd, 'features', 'screenshots'))\\n\\n if @firefox_profile_name\\n @profile = Selenium::WebDriver::Firefox::Profile.from_name @firefox_profile_name\\n else\\n @profile = Selenium::WebDriver::Firefox::Profile.new\\n end\\n @profile['browser.download.dir'] = @download_dir\\n @profile['browser.download.folderList'] = 2\\n @profile['browser.helperApps.neverAsk.saveToDisk'] = \\\"application/pdf\\\"\\n @profile['browser.link.open_newwindow'] = 3\\n\\n if @firefox_path\\n Selenium::WebDriver::Firefox.path = @firefox_path\\n end\\n\\n if is_headless\\n # Possibly later we can use different video capture options...\\n #video_capture_options = {:codec => 'mpeg4', :tmp_file_path => \\\"/tmp/.headless_ffmpeg_#{@headless.display}.mp4\\\", :log_file_path => 'foo.log'}\\n @headless = Headless.new(:dimensions => DEFAULT_DIMENSIONS)\\n @headless.start\\n end\\n\\n # Setup some basic Capybara settings\\n Capybara.run_server = false\\n Capybara.app_host = host\\n Capybara.default_wait_time = 5\\n\\n # Register the Firefox driver that is going to use this profile\\n Capybara.register_driver :selenium do |app|\\n Capybara::Selenium::Driver.new(app, :profile => @profile)\\n end\\n Capybara.current_driver = :selenium\\n\\n visit base_path\\n\\n @driver = page.driver.browser\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53e8cfcda28af8ce28a98feb7a9c3117\",\n \"score\": \"0.46720278\",\n \"text\": \"def browser\\n @b\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c0b379bf0adf437a35bb82a647a6f592\",\n \"score\": \"0.4671293\",\n \"text\": \"def use_html5_parsing=(_arg0); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"474540e5b10cfb713cffdd9cb712ce49\",\n \"score\": \"0.46701628\",\n \"text\": \"def get_moz_platform_status()\\n xml_data = process_get_request(URI.parse(@mozilla_status_url)).body\\n extractor = /
\\\\s*(.*?)\\\\s*<\\\\/div>.*?
\\\\s*(.*?)\\\\s*<\\\\/p>/m\\n xml_data.scan(extractor)[0]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d8d4fa2c90071e36cd4873e3d45feb0d\",\n \"score\": \"0.4669652\",\n \"text\": \"def chrome_version; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d8d4fa2c90071e36cd4873e3d45feb0d\",\n \"score\": \"0.4669652\",\n \"text\": \"def chrome_version; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"98becec4cb9815d6ba543d1c7f6d2527\",\n \"score\": \"0.4659996\",\n \"text\": \"def test_nothing_yet\\n browser = open_browser(\\\"/\\\")\\n fail \\\"Need to write my Watir on Rails test\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a82f0c25cfbe2fa6d939abb628f094e3\",\n \"score\": \"0.4657437\",\n \"text\": \"def no_browser # :nologin: :norobots:\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1936c57cd08a2b750d6a4e766b5df351\",\n \"score\": \"0.4652684\",\n \"text\": \"def test_isSupported12\\n features = []\\n features << \\\"Core\\\"\\n features << \\\"XML\\\"\\n features << \\\"HTML\\\"\\n features << \\\"Views\\\"\\n features << \\\"StyleSheets\\\"\\n features << \\\"CSS\\\"\\n features << \\\"CSS2\\\"\\n features << \\\"Events\\\"\\n features << \\\"UIEvents\\\"\\n features << \\\"MouseEvents\\\"\\n features << \\\"MutationEvents\\\"\\n features << \\\"HTMLEvents\\\"\\n features << \\\"Range\\\"\\n features << \\\"Traversal\\\"\\n features << \\\"bogus.bogus.bogus\\\"\\n \\n doc = nil\\n rootNode = nil\\n featureElement = nil\\n state = nil\\n doc = load_document(\\\"staff\\\", false)\\n rootNode = doc.documentElement()\\n state = rootNode.isSupported(\\\"Core\\\", \\\"2.0\\\")\\n assertTrue(\\\"Core2\\\", state)\\n indexid35967357 = 0\\n while (indexid35967357 < features.size())\\n featureElement = features.get(indexid35967357)\\n state = rootNode.isSupported(featureElement, \\\"1.0\\\")\\n indexid35967357 += 1\\n end\\n indexid36022572 = 0\\n while (indexid36022572 < features.size())\\n featureElement = features.get(indexid36022572)\\n state = rootNode.isSupported(featureElement, \\\"2.0\\\")\\n indexid36022572 += 1\\n end\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7e72cec381f12353369b813ad654b3fc\",\n \"score\": \"0.46506804\",\n \"text\": \"def initialize\\n\\t\\t@agent = Mechanize.new\\n\\t\\t@agent.user_agent_alias = 'Mac Firefox'\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3178bc4422f8469b926253ad31027edf\",\n \"score\": \"0.4646051\",\n \"text\": \"def nodeWebKitName\\n\\t\\\"nwjs\\\"\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3178bc4422f8469b926253ad31027edf\",\n \"score\": \"0.4646051\",\n \"text\": \"def nodeWebKitName\\n\\t\\\"nwjs\\\"\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4bca8534549e21ce625b737f09a74708\",\n \"score\": \"0.46445176\",\n \"text\": \"def persist_browser\\n Capybara.current_session.instance_variable_set(:@touched, true)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5f2113ef14eed8728c6ae64a05715860\",\n \"score\": \"0.46435452\",\n \"text\": \"def page!\\n puts save_and_open_page\\n puts save_and_open_screenshot\\n\\n puts \\\"[DEBUG]page.html:\\\"\\n puts page.html\\n\\n if Capybara.current_driver == :webkit\\n puts \\\"[DEBUG]console_messages:\\\"\\n puts page.driver.console_messages\\n # puts page.driver.error_messages\\n end\\n\\n if Capybara.current_driver == :poltergeist\\n page.driver.render('tmp/page.png') && `open tmp/page.png`\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e5ddca2de8442a0e0553828efde481c8\",\n \"score\": \"0.4635157\",\n \"text\": \"def frfxpilfer(frfoxdbloc,session,logs,usrnm,logfile)\\n\\tprint_status(\\\"Getting Firefox information for user #{usrnm}\\\")\\n\\tfrfxplacesget(frfoxdbloc,usrnm)\\n\\tfrfxpswd(frfoxdbloc,usrnm)\\n\\tfile_local_write(logfile,frfxdmp(usrnm))\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"541ce0a8013a4101000c359fabaf0cd3\",\n \"score\": \"0.46338394\",\n \"text\": \"def setup_code_link_handling\\n top.runIt(\\\"Opal.ChromeEval.$eval(Opal.RUBY_ENGINE_VERSION)\\\",\\n lambda { |result, exception|\\n `console.orig_log(exception)` if exception\\n msg = result ? \\\"Inspected Window Opal::VERSION = #{result}\\\\n\\\" : \\\"Opal not running or older than 0.7 - Console not supported for this page\\\\n\\\"\\n write msg\\n })\\n \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd734167f80f52d35ac8893163fdce30\",\n \"score\": \"0.4626221\",\n \"text\": \"def test_WebPage_009_wait_until_status\\r\\n\\r\\n puts2(\\\"\\\")\\r\\n puts2(\\\"#######################\\\")\\r\\n puts2(\\\"Testcase: test_WebPage_009_wait_until_status\\\")\\r\\n puts2(\\\"#######################\\\")\\r\\n\\r\\n #$VERBOSE = true\\r\\n #$DEBUG = true\\r\\n iDelay = 2\\r\\n\\r\\n # Define components of the URL for the WatirWorks HTML Tags web page\\r\\n sProtocol = \\\"file:///\\\"\\r\\n sRootURL = Dir.pwd\\r\\n sPage = \\\"unittests/data/html/html_tags.html\\\"\\r\\n\\r\\n # Construct the URL\\r\\n sURL = sProtocol + sRootURL + \\\"/\\\" + sPage\\r\\n\\r\\n begin # Start local browsers\\r\\n\\r\\n puts2(\\\"Create a new local Browser Object\\\")\\r\\n #browser = Watir::Browser.new\\r\\n browser = start_browser($sDefaultBrowser)\\r\\n sleep 2\\r\\n\\r\\n puts2(\\\"\\\\nLoad the WatirWorks HTML tags page\\\")\\r\\n browser.goto(sURL)\\r\\n sleep iDelay\\r\\n puts2(\\\"Current URL: \\\" + browser.url)\\r\\n\\r\\n # Set initial values\\r\\n aStatusTextToCheck = [ \\\"Done\\\", \\\"Bogus Text\\\"]\\r\\n tStartTime = Time.now\\r\\n\\r\\n # Loop\\r\\n aStatusTextToCheck.each do | sString |\\r\\n\\r\\n puts2(\\\"\\\\nChecking Browser's status text = \\\" + sString)\\r\\n\\r\\n # Validate the browser's status text\\r\\n if(browser.wait_until_status(sString, 3, 0.1))\\r\\n puts2(\\\"Found expected Browser's status text = \\\" + browser.status)\\r\\n else\\r\\n puts2(\\\"Found unexpected Browser's status text = \\\" + browser.status)\\r\\n end\\r\\n\\r\\n end # Loop\\r\\n\\r\\n puts2(\\\"Elapsed time = \\\" + calc_elapsed_time(tStartTime))\\r\\n\\r\\n rescue => e\\r\\n\\r\\n puts2(\\\"*** ERROR and Backtrace: \\\" + e.message + \\\"\\\\n\\\" + e.backtrace.join(\\\"\\\\n\\\"), \\\"ERROR\\\")\\r\\n\\r\\n # Close the browser\\r\\n browser.close\\r\\n\\r\\n # Raise the error with a custom message after the rest of the rescue actions\\r\\n raise(\\\"*** TESTCASE - test_WebPage_009_wait_until_status\\\")\\r\\n\\r\\n ensure\\r\\n\\r\\n # Close the browser\\r\\n browser.close\\r\\n\\r\\n end # Start local browsers\\r\\n\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"98ae8e94268eee3c128dc301d4cd778f\",\n \"score\": \"0.4624883\",\n \"text\": \"def gnu_display\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd7cfd3ea1e29df6c3d9fa862cbb387b\",\n \"score\": \"0.4624765\",\n \"text\": \"def prepare_browser\\n handles = driver.window_handles.map(&:to_s)\\n driver.execute_script \\\"window.open('','_blank');\\\"\\n sleep 3\\n driver.window_handles.each do |handle|\\n driver.switch_to.window(handle)\\n sleep 1\\n driver.close if handles.include? handle.to_s\\n end\\n driver.switch_to.window(driver.window_handles[0])\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7db0727baf89eb76beac27c515d7fe32\",\n \"score\": \"0.46245039\",\n \"text\": \"def support; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"f79c8a7f7270638647d36eedb7e898b9\",\n \"score\": \"0.46240333\",\n \"text\": \"def firefox_running?()\\n rc = nil\\n Log.Debug(:h2, \\\"[FIREFOX_RUNNING?]\\\") {\\n ps = POSIX::Spawn::Child.new( {'COLUMNS' => '9999'}, *CMDLN_PS )\\n raise \\\"executing '/bin/ps' failed\\\" unless ps.success?\\n rc = %r[/Firefox\\\\.app/Contents/MacOS/firefox].match(ps.out) ? true : false\\n }\\n Log.Debug :h2, \\\"{firefox_running?} => #{rc.safe_s}\\\"\\n rc\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9bd0673062b59c78694016f605e4c234\",\n \"score\": \"0.46205646\",\n \"text\": \"def escaped_styling_rendering_test_method; end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":192,"cells":{"query_id":{"kind":"string","value":"fc8fda5890db418c73e23fdd9d11bd7b"},"query":{"kind":"string","value":"lexer rule r_float! (R_FLOAT) (in Hephaestus.g)"},"positive_passages":{"kind":"list like","value":[{"docid":"d2e4e327f95655edd96b7b76b3a16ef3","score":"0.81768644","text":"def r_float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n\n\n type = R_FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 38:10: 'Float'\n match( \"Float\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 8 )\n\n\n end","title":""}],"string":"[\n {\n \"docid\": \"d2e4e327f95655edd96b7b76b3a16ef3\",\n \"score\": \"0.81768644\",\n \"text\": \"def r_float!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 8 )\\n\\n\\n\\n type = R_FLOAT\\n channel = ANTLR3::DEFAULT_CHANNEL\\n # - - - - label initialization - - - -\\n\\n\\n # - - - - main rule block - - - -\\n # at line 38:10: 'Float'\\n match( \\\"Float\\\" )\\n\\n\\n\\n @state.type = type\\n @state.channel = channel\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 8 )\\n\\n\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"fc68df27b01b9818391b6f71da74b435","score":"0.7542491","text":"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n\n\n type = FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 37:8: 'float'\n match( \"float\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n\n end","title":""},{"docid":"9179fd62663b020c63cd892538f0ec00","score":"0.7403847","text":"def visit_float(node)\n operator =\n if %w[+ -].include?(buffer.source[node.start_char])\n srange_length(node.start_char, 1)\n end\n\n s(\n :float,\n [node.value.to_f],\n smap_operator(operator, srange_node(node))\n )\n end","title":""},{"docid":"53dbb52ff8f8e4d4a5172236177f923c","score":"0.72973883","text":"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n\n type = FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 108:12: INT '.' INT\n int!\n match( 0x2e )\n int!\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n end","title":""},{"docid":"3b797aba9947aced99c933d71cafc9b9","score":"0.7295861","text":"def visit_float(node); end","title":""},{"docid":"2d53080e264a995dcb06f4adf000df3e","score":"0.7193389","text":"def read_float(hash: nil, fail: [\"Expected float literal\"])\n tok = read_token(kinds: %i[float_lit float_exp_lit integer_lit integer_exp_lit hex_lit bin_lit], hash: hash, fail: fail)\n tok && tok.to_f\n end","title":""},{"docid":"ae97b8d40970aeab2e9b91b93a9a1d35","score":"0.71611196","text":"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 33 )\n\n type = FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 61:12: ( INTEGER )+ '.' ( INTEGER )+\n # at file 61:12: ( INTEGER )+\n match_count_3 = 0\n while true\n alt_3 = 2\n look_3_0 = @input.peek( 1 )\n\n if ( look_3_0.between?( 0x30, 0x39 ) )\n alt_3 = 1\n\n end\n case alt_3\n when 1\n # at line 61:12: INTEGER\n integer!\n\n else\n match_count_3 > 0 and break\n eee = EarlyExit(3)\n\n\n raise eee\n end\n match_count_3 += 1\n end\n\n match( 0x2e )\n # at file 61:25: ( INTEGER )+\n match_count_4 = 0\n while true\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0.between?( 0x30, 0x39 ) )\n alt_4 = 1\n\n end\n case alt_4\n when 1\n # at line 61:25: INTEGER\n integer!\n\n else\n match_count_4 > 0 and break\n eee = EarlyExit(4)\n\n\n raise eee\n end\n match_count_4 += 1\n end\n\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 33 )\n\n end","title":""},{"docid":"79ac318f636945f274e8c40ef6e326d9","score":"0.7158026","text":"def t__37!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n\n type = T__37\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 26:9: 'float'\n match( \"float\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 17 )\n\n end","title":""},{"docid":"2489affe0bb6fbab2e87518b030b84df","score":"0.7130779","text":"def read_float(hash: nil, fail: [\"Expected float literal\"])\n tok = read_token(kinds: %i[float_lit float_exp_lit integer_lit integer_exp_lit hex_lit bin_lit], hash: hash, fail: fail)\n tok && tok.to_f\n end","title":""},{"docid":"c4f14ac3b70d5d247153dd3d9efa5ce4","score":"0.7073806","text":"def FloatLiteral(value); end","title":""},{"docid":"3a8bb327b2344e32cd5fd878402d2df4","score":"0.70038676","text":"def t__45!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 28 )\n\n type = T__45\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 36:9: 'float'\n match( \"float\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 28 )\n\n end","title":""},{"docid":"a7b91d626a3e2d1c1e3ff59c10d25edc","score":"0.69434804","text":"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 8)\n\n type = FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 28:3: ( ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ( EXPONENT )? | DECIMAL EXPONENT )\n alt_5 = 2\n alt_5 = @dfa5.predict(@input)\n case alt_5\n when 1\n # at line 28:5: ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ( EXPONENT )?\n # at line 28:5: ( '-' )?\n alt_1 = 2\n look_1_0 = @input.peek(1)\n\n if (look_1_0 == ?-) \n alt_1 = 1\n end\n case alt_1\n when 1\n # at line 28:5: '-'\n match(?-)\n\n end\n # at file 28:10: ( '0' .. '9' )+\n match_count_2 = 0\n loop do\n alt_2 = 2\n look_2_0 = @input.peek(1)\n\n if (look_2_0.between?(?0, ?9)) \n alt_2 = 1\n\n end\n case alt_2\n when 1\n # at line 28:11: '0' .. '9'\n match_range(?0, ?9)\n\n else\n match_count_2 > 0 and break\n eee = EarlyExit(2)\n\n\n raise eee\n end\n match_count_2 += 1\n end\n\n match(?.)\n # at file 28:26: ( '0' .. '9' )+\n match_count_3 = 0\n loop do\n alt_3 = 2\n look_3_0 = @input.peek(1)\n\n if (look_3_0.between?(?0, ?9)) \n alt_3 = 1\n\n end\n case alt_3\n when 1\n # at line 28:27: '0' .. '9'\n match_range(?0, ?9)\n\n else\n match_count_3 > 0 and break\n eee = EarlyExit(3)\n\n\n raise eee\n end\n match_count_3 += 1\n end\n\n # at line 28:38: ( EXPONENT )?\n alt_4 = 2\n look_4_0 = @input.peek(1)\n\n if (look_4_0 == ?E || look_4_0 == ?e) \n alt_4 = 1\n end\n case alt_4\n when 1\n # at line 28:38: EXPONENT\n exponent!\n\n end\n\n when 2\n # at line 29:5: DECIMAL EXPONENT\n decimal!\n exponent!\n\n end\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 8)\n\n end","title":""},{"docid":"6050ccc07c7f30c5ffce23de382338fe","score":"0.6938463","text":"def lex_floating_constant\n scan_token(RE_FLOATING_CONSTANT, :floating_constant)\n end","title":""},{"docid":"e68d0e2703684c4be2b35b21830a368a","score":"0.6910431","text":"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 41 )\n\n type = FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 1064:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT )\n alt_15 = 3\n alt_15 = @dfa15.predict( @input )\n case alt_15\n when 1\n # at line 1064:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )?\n # at file 1064:9: ( '0' .. '9' )+\n match_count_9 = 0\n while true\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0.between?( 0x30, 0x39 ) )\n alt_9 = 1\n\n end\n case alt_9\n when 1\n # at line 1064:10: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n match_count_9 > 0 and break\n eee = EarlyExit(9)\n\n\n raise eee\n end\n match_count_9 += 1\n end\n\n match( 0x2e )\n # at line 1064:25: ( '0' .. '9' )*\n while true # decision 10\n alt_10 = 2\n look_10_0 = @input.peek( 1 )\n\n if ( look_10_0.between?( 0x30, 0x39 ) )\n alt_10 = 1\n\n end\n case alt_10\n when 1\n # at line 1064:26: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n break # out of loop for decision 10\n end\n end # loop for decision 10\n # at line 1064:37: ( EXPONENT )?\n alt_11 = 2\n look_11_0 = @input.peek( 1 )\n\n if ( look_11_0 == 0x45 || look_11_0 == 0x65 )\n alt_11 = 1\n end\n case alt_11\n when 1\n # at line 1064:37: EXPONENT\n exponent!\n\n end\n\n when 2\n # at line 1065:9: '.' ( '0' .. '9' )+ ( EXPONENT )?\n match( 0x2e )\n # at file 1065:13: ( '0' .. '9' )+\n match_count_12 = 0\n while true\n alt_12 = 2\n look_12_0 = @input.peek( 1 )\n\n if ( look_12_0.between?( 0x30, 0x39 ) )\n alt_12 = 1\n\n end\n case alt_12\n when 1\n # at line 1065:14: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n match_count_12 > 0 and break\n eee = EarlyExit(12)\n\n\n raise eee\n end\n match_count_12 += 1\n end\n\n # at line 1065:25: ( EXPONENT )?\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0 == 0x45 || look_13_0 == 0x65 )\n alt_13 = 1\n end\n case alt_13\n when 1\n # at line 1065:25: EXPONENT\n exponent!\n\n end\n\n when 3\n # at line 1066:9: ( '0' .. '9' )+ EXPONENT\n # at file 1066:9: ( '0' .. '9' )+\n match_count_14 = 0\n while true\n alt_14 = 2\n look_14_0 = @input.peek( 1 )\n\n if ( look_14_0.between?( 0x30, 0x39 ) )\n alt_14 = 1\n\n end\n case alt_14\n when 1\n # at line 1066:10: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n match_count_14 > 0 and break\n eee = EarlyExit(14)\n\n\n raise eee\n end\n match_count_14 += 1\n end\n\n exponent!\n\n end\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 41 )\n\n end","title":""},{"docid":"90ce737be806aadf6643a5e159225952","score":"0.68450737","text":"def floating_point_literal!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 88)\n\n type = FLOATING_POINT_LITERAL\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 499:3: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? | '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? | ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? | ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix )\n alt_25 = 4\n alt_25 = @dfa25.predict(@input)\n case alt_25\n when 1\n # at line 499:5: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )?\n # at file 499:5: ( '0' .. '9' )+\n match_count_14 = 0\n while true\n alt_14 = 2\n look_14_0 = @input.peek(1)\n\n if (look_14_0.between?(?0, ?9)) \n alt_14 = 1\n\n end\n case alt_14\n when 1\n # at line 499:6: '0' .. '9'\n match_range(?0, ?9)\n\n else\n match_count_14 > 0 and break\n eee = EarlyExit(14)\n\n\n raise eee\n end\n match_count_14 += 1\n end\n\n match(?.)\n # at line 499:21: ( '0' .. '9' )*\n while true # decision 15\n alt_15 = 2\n look_15_0 = @input.peek(1)\n\n if (look_15_0.between?(?0, ?9)) \n alt_15 = 1\n\n end\n case alt_15\n when 1\n # at line 499:22: '0' .. '9'\n match_range(?0, ?9)\n\n else\n break # out of loop for decision 15\n end\n end # loop for decision 15\n # at line 499:33: ( Exponent )?\n alt_16 = 2\n look_16_0 = @input.peek(1)\n\n if (look_16_0 == ?E || look_16_0 == ?e) \n alt_16 = 1\n end\n case alt_16\n when 1\n # at line 499:33: Exponent\n exponent!\n\n end\n # at line 499:43: ( FloatTypeSuffix )?\n alt_17 = 2\n look_17_0 = @input.peek(1)\n\n if (look_17_0 == ?D || look_17_0 == ?F || look_17_0 == ?d || look_17_0 == ?f) \n alt_17 = 1\n end\n case alt_17\n when 1\n # at line 499:43: FloatTypeSuffix\n float_type_suffix!\n\n end\n\n when 2\n # at line 500:5: '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )?\n match(?.)\n # at file 500:9: ( '0' .. '9' )+\n match_count_18 = 0\n while true\n alt_18 = 2\n look_18_0 = @input.peek(1)\n\n if (look_18_0.between?(?0, ?9)) \n alt_18 = 1\n\n end\n case alt_18\n when 1\n # at line 500:10: '0' .. '9'\n match_range(?0, ?9)\n\n else\n match_count_18 > 0 and break\n eee = EarlyExit(18)\n\n\n raise eee\n end\n match_count_18 += 1\n end\n\n # at line 500:21: ( Exponent )?\n alt_19 = 2\n look_19_0 = @input.peek(1)\n\n if (look_19_0 == ?E || look_19_0 == ?e) \n alt_19 = 1\n end\n case alt_19\n when 1\n # at line 500:21: Exponent\n exponent!\n\n end\n # at line 500:31: ( FloatTypeSuffix )?\n alt_20 = 2\n look_20_0 = @input.peek(1)\n\n if (look_20_0 == ?D || look_20_0 == ?F || look_20_0 == ?d || look_20_0 == ?f) \n alt_20 = 1\n end\n case alt_20\n when 1\n # at line 500:31: FloatTypeSuffix\n float_type_suffix!\n\n end\n\n when 3\n # at line 501:5: ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )?\n # at file 501:5: ( '0' .. '9' )+\n match_count_21 = 0\n while true\n alt_21 = 2\n look_21_0 = @input.peek(1)\n\n if (look_21_0.between?(?0, ?9)) \n alt_21 = 1\n\n end\n case alt_21\n when 1\n # at line 501:6: '0' .. '9'\n match_range(?0, ?9)\n\n else\n match_count_21 > 0 and break\n eee = EarlyExit(21)\n\n\n raise eee\n end\n match_count_21 += 1\n end\n\n exponent!\n # at line 501:26: ( FloatTypeSuffix )?\n alt_22 = 2\n look_22_0 = @input.peek(1)\n\n if (look_22_0 == ?D || look_22_0 == ?F || look_22_0 == ?d || look_22_0 == ?f) \n alt_22 = 1\n end\n case alt_22\n when 1\n # at line 501:26: FloatTypeSuffix\n float_type_suffix!\n\n end\n\n when 4\n # at line 502:5: ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix\n # at file 502:5: ( '0' .. '9' )+\n match_count_23 = 0\n while true\n alt_23 = 2\n look_23_0 = @input.peek(1)\n\n if (look_23_0.between?(?0, ?9)) \n alt_23 = 1\n\n end\n case alt_23\n when 1\n # at line 502:6: '0' .. '9'\n match_range(?0, ?9)\n\n else\n match_count_23 > 0 and break\n eee = EarlyExit(23)\n\n\n raise eee\n end\n match_count_23 += 1\n end\n\n # at line 502:17: ( Exponent )?\n alt_24 = 2\n look_24_0 = @input.peek(1)\n\n if (look_24_0 == ?E || look_24_0 == ?e) \n alt_24 = 1\n end\n case alt_24\n when 1\n # at line 502:17: Exponent\n exponent!\n\n end\n float_type_suffix!\n\n end\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 88)\n\n end","title":""},{"docid":"ef6e417bf9417518a4ff5762ca4c04c2","score":"0.67929715","text":"def t__36!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 14)\n\n type = T__36\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 20:9: 'float'\n match(\"float\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 14)\n\n end","title":""},{"docid":"d28a50f34228dff56e34757e26dbf179","score":"0.67420095","text":"def c_float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 36 )\n\n\n\n type = C_FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 103:10: ( '0' .. '9' )+ '.' ( '0' .. '9' )+\n # at file 103:10: ( '0' .. '9' )+\n match_count_2 = 0\n while true\n alt_2 = 2\n look_2_0 = @input.peek( 1 )\n\n if ( look_2_0.between?( 0x30, 0x39 ) )\n alt_2 = 1\n\n end\n case alt_2\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x30, 0x39 )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n match_count_2 > 0 and break\n eee = EarlyExit(2)\n\n\n raise eee\n end\n match_count_2 += 1\n end\n\n\n match( 0x2e )\n # at file 103:28: ( '0' .. '9' )+\n match_count_3 = 0\n while true\n alt_3 = 2\n look_3_0 = @input.peek( 1 )\n\n if ( look_3_0.between?( 0x30, 0x39 ) )\n alt_3 = 1\n\n end\n case alt_3\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x30, 0x39 )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n match_count_3 > 0 and break\n eee = EarlyExit(3)\n\n\n raise eee\n end\n match_count_3 += 1\n end\n\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 36 )\n\n\n end","title":""},{"docid":"6faef475ff31cfb31838fa39f35ac644","score":"0.6740271","text":"def handle_float(float, lineno_column)\n Literal.new float.to_f\n end","title":""},{"docid":"37ec591e263b9941bba80d7a63a16dee","score":"0.6730366","text":"def float_regexp()\r\n\treturn '[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]\\d+)?';\r\nend","title":""},{"docid":"3a1f769e2b14689518250646add56e30","score":"0.66756654","text":"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 34 )\n\n\n\n type = FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 72:8: ( '0' .. '9' )+ '.' ( '0' .. '9' )+\n # at file 72:8: ( '0' .. '9' )+\n match_count_6 = 0\n while true\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0.between?( 0x30, 0x39 ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x30, 0x39 )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n match_count_6 > 0 and break\n eee = EarlyExit(6)\n\n\n raise eee\n end\n match_count_6 += 1\n end\n\n\n match( 0x2e )\n # at file 72:26: ( '0' .. '9' )+\n match_count_7 = 0\n while true\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0.between?( 0x30, 0x39 ) )\n alt_7 = 1\n\n end\n case alt_7\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x30, 0x39 )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n match_count_7 > 0 and break\n eee = EarlyExit(7)\n\n\n raise eee\n end\n match_count_7 += 1\n end\n\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 34 )\n\n\n end","title":""},{"docid":"1d7e6a1516dcf083ab5d7982f39b67d5","score":"0.6579026","text":"def float?\n @kind == :float_lit || @kind == :float_exp_lit\n end","title":""},{"docid":"77b749ec5cca72e17f1cde02f2d21213","score":"0.6547844","text":"def float_r\n /\\d+\\.*\\d*/\n end","title":""},{"docid":"5d89db632a72136f4e7aeedc2f867b24","score":"0.6476115","text":"def on_float(value)\n FloatLiteral.new(\n value: value,\n location:\n Location.token(\n line: lineno,\n char: char_pos,\n column: current_column,\n size: value.size\n )\n )\n end","title":""},{"docid":"d13e67f798fc8eb800ad3ac0ebb6d96e","score":"0.644263","text":"def float_and_regex x\n return append_regex @@float_rxp, x\n end","title":""},{"docid":"a228aeab1f1ba08470ed620d2793906c","score":"0.6353045","text":"def new_float(value)\n new(Rubinius::AST::FloatLiteral, value)\n end","title":""},{"docid":"bd37c913462efe73604d286d814c59e6","score":"0.6255957","text":"def parse_float(arg) # :doc:\n result = nil\n if x = parse_arg(arg)\n if x.match(/^-?(\\d*\\.\\d+|\\d+)$/)\n result = x.to_f\n else\n raise error(102, \"#{arg} must be a floating-point\")\n end\n end\n return result\n end","title":""},{"docid":"7d5e2c46011a894ecbf59f4bbd446b2e","score":"0.6124071","text":"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n \n # - - - - main rule block - - - -\n # at line 399:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT )\n alt_12 = 3\n alt_12 = @dfa12.predict( @input )\n case alt_12\n when 1\n # at line 399:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )?\n # at file 399:9: ( '0' .. '9' )+\n match_count_6 = 0\n while true\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0.between?( 0x30, 0x39 ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 399:10: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n match_count_6 > 0 and break\n eee = EarlyExit(6)\n\n\n raise eee\n end\n match_count_6 += 1\n end\n\n match( 0x2e )\n # at line 399:25: ( '0' .. '9' )*\n while true # decision 7\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0.between?( 0x30, 0x39 ) )\n alt_7 = 1\n\n end\n case alt_7\n when 1\n # at line 399:26: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n break # out of loop for decision 7\n end\n end # loop for decision 7\n # at line 399:37: ( EXPONENT )?\n alt_8 = 2\n look_8_0 = @input.peek( 1 )\n\n if ( look_8_0 == 0x45 || look_8_0 == 0x65 )\n alt_8 = 1\n end\n case alt_8\n when 1\n # at line 399:37: EXPONENT\n exponent!\n\n end\n\n when 2\n # at line 400:9: '.' ( '0' .. '9' )+ ( EXPONENT )?\n match( 0x2e )\n # at file 400:13: ( '0' .. '9' )+\n match_count_9 = 0\n while true\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0.between?( 0x30, 0x39 ) )\n alt_9 = 1\n\n end\n case alt_9\n when 1\n # at line 400:14: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n match_count_9 > 0 and break\n eee = EarlyExit(9)\n\n\n raise eee\n end\n match_count_9 += 1\n end\n\n # at line 400:25: ( EXPONENT )?\n alt_10 = 2\n look_10_0 = @input.peek( 1 )\n\n if ( look_10_0 == 0x45 || look_10_0 == 0x65 )\n alt_10 = 1\n end\n case alt_10\n when 1\n # at line 400:25: EXPONENT\n exponent!\n\n end\n\n when 3\n # at line 401:9: ( '0' .. '9' )+ EXPONENT\n # at file 401:9: ( '0' .. '9' )+\n match_count_11 = 0\n while true\n alt_11 = 2\n look_11_0 = @input.peek( 1 )\n\n if ( look_11_0.between?( 0x30, 0x39 ) )\n alt_11 = 1\n\n end\n case alt_11\n when 1\n # at line 401:10: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n match_count_11 > 0 and break\n eee = EarlyExit(11)\n\n\n raise eee\n end\n match_count_11 += 1\n end\n\n exponent!\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 37 )\n\n end","title":""},{"docid":"eb50ab0230ce64f260754727ed766836","score":"0.6098546","text":"def float; end","title":""},{"docid":"7c3e10192e8a112410ae94bbc62cc57d","score":"0.59562457","text":"def float_type_suffix!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 90)\n\n \n # - - - - main rule block - - - -\n # at line 509:19: ( 'f' | 'F' | 'd' | 'D' )\n if @input.peek(1) == ?D || @input.peek(1) == ?F || @input.peek(1) == ?d || @input.peek(1) == ?f\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 90)\n\n end","title":""},{"docid":"689d47d0bcc534bc28f4630e9aca8af6","score":"0.5955509","text":"def foorth_coerce(arg)\r\n Float(arg)\r\n rescue\r\n error \"F40: Cannot coerce a #{arg.foorth_name} to a Float instance\"\r\n end","title":""},{"docid":"54cd613eef1556871fb8c321b8910b66","score":"0.59452474","text":"def interpret_as_float()\n sign = (2**31 & self != 0) ? -1 : 1\n expo = ((0xFF * 2**23) & self) >> 23\n frac = (2**23 - 1) & self\n if expo == 0 and frac == 0\n sign.to_f * 0.0 # zero\n elsif expo == 0\n sign * 2**(expo - 126) * (frac.to_f / 2**23.to_f) # denormalized\n elsif expo == 0xFF and frac == 0\n sign.to_f / 0.0 # Infinity\n elsif expo == 0xFF\n 0.0 / 0.0 # NaN\n else\n sign * 2**(expo - 127) * (1.0 + (frac.to_f / 2**23.to_f)) # normalized\n end\n end","title":""},{"docid":"68b33adebfcf200c28bf9a679111d9e5","score":"0.5944261","text":"def float?\n pat = /^[-+]?[1-9]([0-9]*)?\\.[0-9]+$/\n return true if self=~pat \n return false \n end","title":""},{"docid":"44aaad1d9956cac31a94bf611b225c68","score":"0.58783346","text":"def numeric!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n type = NUMERIC\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 8:11: 'numeric'\n match( \"numeric\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end","title":""},{"docid":"4013ae11a0ab8c5f8194a80a2d25a4ae","score":"0.5873282","text":"def float_or_nil(); FLOAT_OR_NIL; end","title":""},{"docid":"b489fce99cf53a97318a9de0d21eb47d","score":"0.58466","text":"def tf\n pipe_2_variable\n start \"Float( #@r )\"\n end","title":""},{"docid":"42e0559903ed30be3ac9137a6a674134","score":"0.5846477","text":"def read_float\n primitive_read_float\n end","title":""},{"docid":"4ceb4080a80d64afe82464e77ffb55c6","score":"0.58412856","text":"def read_float\n Rubinius.primitive :pointer_read_float\n raise PrimitiveFailure, \"Unable to read float\"\n end","title":""},{"docid":"7aaeccfd2ee1237ecbb10552261518ba","score":"0.5820633","text":"def float\n frequency(49 => real_float, 1 => one_of(*@@special_floats.map(&method(:constant))))\n end","title":""},{"docid":"477eed93e61e38faef84ed8f557fb038","score":"0.58136714","text":"def validate_float(v); end","title":""},{"docid":"d7fe52d632795d5b14a0b46c3633bf1e","score":"0.5800057","text":"def to_f\n case @kind\n when :float_lit, :float_exp_lit,\n :integer_lit, :integer_exp_lit,\n :single_string_lit, :double_string_lit\n @value.to_f\n else\n self.to_i.to_f\n end\n end","title":""},{"docid":"dbaa83cd08b43ac3b1053751185b6941","score":"0.5733037","text":"def write_float(flt, depth = 0)\n write_number(flt, depth + 1)\n end","title":""},{"docid":"66f111515ea1c28372bdfeee46bfd840","score":"0.570962","text":"def real_float\n tuple(integer, integer, integer).map do |a, b, c|\n fraction(a, b, c)\n end\n end","title":""},{"docid":"2fa1791fdf330dd5aa96415ff1caeb86","score":"0.5707181","text":"def on_float(value); end","title":""},{"docid":"82eb10ce1e9130d480fcb5ff5332b0ac","score":"0.5689524","text":"def validate_float\n valid_float?.tap { |valid| yield Float(@body) if valid }\n end","title":""},{"docid":"db9ddb7b165be798235995ffa3a95985","score":"0.568176","text":"def set_float\n\t\t\t_rational = @option[:number].to_f.round(2).to_s.to_r\n\t\t\t_nmtr = _rational.numerator\n\t\t\t_dntr = _rational.denominator\n\t\t\t\n\t\t\tif _nmtr > _dntr\n\t\t\t\t@float[:wnum] = Rn.new(_nmtr.divmod(_dntr)[0].to_s)\n\t\t\t\tunless _nmtr.divmod(_dntr)[1] == 0\n\t\t\t\t\t@float[:nmtr] = Rn.new(_nmtr.divmod(_dntr)[1].to_s)\n\t\t\t\telse\n\t\t\t\t\t@option[:number] = _nmtr.divmod(_dntr)[0].to_s\n\t\t\t\t\tset_Integer.print\n\t\t\t\tend\n\t\t\t\t@float[:dntr] = Rn.new(_dntr.to_s) \n\t\t\telse\n\t\t\t\t@float[:nmtr] = Rn.new(_nmtr.to_s)\n\t\t\t\t@float[:dntr] = Rn.new(_dntr.to_s)\n\t\t\tend\n\t\t\tself\n\t\tend","title":""},{"docid":"c9ccadd3ecf737dbf426af9523677aea","score":"0.565579","text":"def parse_float(the_input)\n output = 0\n begin\n output = the_input.to_f\n rescue => detail\n nil\n end\n output\n end","title":""},{"docid":"e5958ba2cc89146aa08bdbe609da3109","score":"0.5612759","text":"def float name, description: nil, mode: :nullable,\n policy_tags: nil, default_value_expression: nil\n add_field name, :float,\n description: description,\n mode: mode,\n policy_tags: policy_tags,\n default_value_expression: default_value_expression\n end","title":""},{"docid":"32f5e794933a5e9df112f6a941978e4a","score":"0.56092554","text":"def float\n @floating = true\n damage(:floating)\n return nil\n end","title":""},{"docid":"36f4ef441f7e798bd11f0b71a79799a4","score":"0.5591785","text":"def float\n read(4).unpack('e')[0]\n end","title":""},{"docid":"ec74b145e032c68fcfb2e8148df7b349","score":"0.5590917","text":"def convert_float_to_type\n\t\tcase @language\n\t\twhen :java, :java_lombok\n\t\t\treturn \"float\"\n\t\telse \n\t\t\terror_and_exit \"Could not convert to output language #{@language}\"\n\t\tend\n\tend","title":""},{"docid":"29006128a81041e2534015c09c74ded0","score":"0.55800325","text":"def float(field_name)\n handle_field(:float, field_name.to_sym)\n end","title":""},{"docid":"29006128a81041e2534015c09c74ded0","score":"0.55800325","text":"def float(field_name)\n handle_field(:float, field_name.to_sym)\n end","title":""},{"docid":"c7e995648a1c6643be87a4979094f8d1","score":"0.557316","text":"def float name, description: nil, mode: nil\n add_field name, :float, nil, description: description, mode: mode\n end","title":""},{"docid":"94318d660438a7cceb82031cb42d3746","score":"0.55709666","text":"def is_float(sentence)\n true if Float(sentence) rescue false\nend","title":""},{"docid":"1de7744beb5b640a41ec88724ecb74a7","score":"0.5570466","text":"def FloatLiteral(value)\n FloatLiteral.new(value: value, location: Location.default)\n end","title":""},{"docid":"b93400a4f27468cc5ed8a8f8e5cd306d","score":"0.55597997","text":"def float( str )\n Float( str )\n end","title":""},{"docid":"1407b0d4e2afedab1d6b6713ab613398","score":"0.555743","text":"def handle_float_type\n case [tags[:endian], tags[:precision]]\n when [:native, :double]\n \"D\"\n when [:native, :single]\n \"F\"\n when [:little, :double]\n \"E\"\n when [:little, :single]\n \"e\"\n when [:big, :double]\n \"G\"\n when [:big, :single]\n \"g\"\n end\n end","title":""},{"docid":"3c16a9b410dca947de91c730868f9ef0","score":"0.5537456","text":"def to_f(type = LLVM::Float.type)\n C.LLVMGenericValueToFloat(type, self)\n end","title":""},{"docid":"be4d6da57cd9944c8134d0596d5965c1","score":"0.5535841","text":"def atom(token)\n int = Integer(token) rescue nil\n float = Float(token) rescue nil\n int || float || token\nend","title":""},{"docid":"dd0317b51e1651bb362059f31d2ff73c","score":"0.5535751","text":"def is_float?\n return is_numeric? unless is_integer?\n false\n end","title":""},{"docid":"2431491791511e5e7a89575fe2a83b9c","score":"0.55298525","text":"def type_string\n \"float\"\n end","title":""},{"docid":"0e97b759152c356fdeb27cd7b6182c63","score":"0.55238515","text":"def test_float\n\t\t42.12345\n\tend","title":""},{"docid":"88b6ac4c74639d02e8ddceb32ae76ff3","score":"0.5518029","text":"def type_f\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n\n return_value = TypeFReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n begin\n # at line 229:5: ( type_s | VOID )\n # at line 229:5: ( type_s | VOID )\n alt_21 = 2\n look_21_0 = @input.peek( 1 )\n\n if ( look_21_0.between?( BOOL, CHAR ) || look_21_0 == FLOAT || look_21_0 == INTEGER )\n alt_21 = 1\n elsif ( look_21_0 == VOID )\n alt_21 = 2\n else\n raise NoViableAlternative( \"\", 21, 0 )\n\n end\n case alt_21\n when 1\n # at line 229:6: type_s\n @state.following.push( TOKENS_FOLLOWING_type_s_IN_type_f_1158 )\n type_s\n @state.following.pop\n\n when 2\n # at line 229:15: VOID\n match( VOID, TOKENS_FOLLOWING_VOID_IN_type_f_1162 )\n\n end\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n\n end\n\n return return_value\n end","title":""},{"docid":"9907d39a233332bd88254b3c8965c09a","score":"0.5508619","text":"def read_float\n decode_float(read(4))\n end","title":""},{"docid":"0fbe285162a713be0073d0d2e381bf29","score":"0.55048287","text":"def match_number\n @token.value if match? :FLOAT or match? :INTEGER\n end","title":""},{"docid":"46717b3eaa01d61ec4b2b3f2b57094d1","score":"0.55022115","text":"def float\n do_spin\n validate\n raw_float / BASE\n end","title":""},{"docid":"0c92495b143f0276a2b09eeecf17a862","score":"0.5488194","text":"def visit_float(node)\n node.copy\n end","title":""},{"docid":"5ed7ff405b31c44c266d26b157f05ed5","score":"0.5481984","text":"def to_f(type = LLVM::Float.type)\n C.generic_value_to_float(type, self)\n end","title":""},{"docid":"08d58cb2720758f546d88ea8c626b303","score":"0.5473274","text":"def real_nonpositive_float\n real_nonnegative_float.map(&:-@)\n end","title":""},{"docid":"a047cade0c848c8d7790ea65fa880858","score":"0.5470216","text":"def float?(input)\n Float(input) rescue false #following previous lesson's suggestion\nend","title":""},{"docid":"a2dc378561fa08f0ab3927b04d6915bf","score":"0.54584134","text":"def is_float?(string)\n if string !~ /^\\s*[+-]?((\\d+_?)*\\d+(\\.(\\d+_?)*\\d+)?|\\.(\\d+_?)*\\d+)(\\s*|([eE][+-]?(\\d+_?)*\\d+)\\s*)$/\n return false\n else\n return true\n end\n end","title":""},{"docid":"b700f6f780d91490a99ffa3ac4dfd9cd","score":"0.5447546","text":"def parseLfactor()\n if getTokenKind == Token::T_BOOLEAN\n nextToken()\n else \n parseRelOp()\n end\nend","title":""},{"docid":"4d4c0831ee26e364d2ca640a311f8f34","score":"0.54435736","text":"def test_is_a_Query_Float\n assert_kind_of(Float, 10.to_l)\n end","title":""},{"docid":"83294a232afa1217d1d4cc1527558094","score":"0.5428877","text":"def float(cell, str = +'')\n numeric cell, str\n end","title":""},{"docid":"24f48506111849012380d068eaf812c4","score":"0.5426999","text":"def convert_var_to_float(param_a)\n param_a = Float(param_a) rescue false\nend","title":""},{"docid":"7616e423cb77c37026801d209175bb44","score":"0.54016477","text":"def parse_float(n, default)\n Float(n)\n rescue\n default\n end","title":""},{"docid":"9901e54895e157d939ec74264303e999","score":"0.5396663","text":"def write_float(obj)\n Rubinius.primitive :pointer_write_float\n raise PrimitiveFailure, \"Unable to write float\"\n end","title":""},{"docid":"77e8f4d1d6a14dcba19933dc2e22faae","score":"0.53956133","text":"def test_float_val\n set_rule = Rules.new\n actual = set_rule.pos_int? '1.2'\n expected = false\n assert_equal expected, actual\n end","title":""},{"docid":"c24af654b8219fa937e1a44887311a56","score":"0.53856736","text":"def literal_float(v)\n v.to_s\n end","title":""},{"docid":"c24af654b8219fa937e1a44887311a56","score":"0.53856736","text":"def literal_float(v)\n v.to_s\n end","title":""},{"docid":"2c46ebe16f49e6abf97eea9899dd10f3","score":"0.5380262","text":"def test_009_floats\n end","title":""},{"docid":"071b04fa3b29850498b6546ef0ae37e1","score":"0.5377404","text":"def float?(input)\n Float(input) rescue false\nend","title":""},{"docid":"071b04fa3b29850498b6546ef0ae37e1","score":"0.5377404","text":"def float?(input)\n Float(input) rescue false\nend","title":""},{"docid":"569554f9977eae00659d0cf052b33e58","score":"0.5375989","text":"def mult\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 3)\n\n begin\n # at line 15:6: ( value ( '*' value )* | value ( '/' value )* )\n alt_7 = 2\n case look_7 = @input.peek(1)\n when FLOAT then look_7_1 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \n alt_7 = 1\n elsif (true) \n alt_7 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 7, 1)\n raise nvae\n end\n when HEXADECIMAL then look_7_2 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \n alt_7 = 1\n elsif (true) \n alt_7 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 7, 2)\n raise nvae\n end\n when DECIMAL then look_7_3 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \n alt_7 = 1\n elsif (true) \n alt_7 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 7, 3)\n raise nvae\n end\n when OCTAL then look_7_4 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \n alt_7 = 1\n elsif (true) \n alt_7 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 7, 4)\n raise nvae\n end\n when BINARY then look_7_5 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \n alt_7 = 1\n elsif (true) \n alt_7 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 7, 5)\n raise nvae\n end\n when T__16 then look_7_6 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \n alt_7 = 1\n elsif (true) \n alt_7 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 7, 6)\n raise nvae\n end\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n\n nvae = NoViableAlternative(\"\", 7, 0)\n raise nvae\n end\n case alt_7\n when 1\n # at line 15:8: value ( '*' value )*\n @state.following.push(TOKENS_FOLLOWING_value_IN_mult_103)\n value\n @state.following.pop\n # at line 15:14: ( '*' value )*\n loop do #loop 5\n alt_5 = 2\n look_5_0 = @input.peek(1)\n\n if (look_5_0 == T__14) \n alt_5 = 1\n\n end\n case alt_5\n when 1\n # at line 15:16: '*' value\n match(T__14, TOKENS_FOLLOWING_T__14_IN_mult_107)\n @state.following.push(TOKENS_FOLLOWING_value_IN_mult_109)\n value\n @state.following.pop\n\n else\n break #loop 5\n end\n end\n\n when 2\n # at line 16:9: value ( '/' value )*\n @state.following.push(TOKENS_FOLLOWING_value_IN_mult_121)\n value\n @state.following.pop\n # at line 16:15: ( '/' value )*\n loop do #loop 6\n alt_6 = 2\n look_6_0 = @input.peek(1)\n\n if (look_6_0 == T__15) \n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 16:17: '/' value\n match(T__15, TOKENS_FOLLOWING_T__15_IN_mult_125)\n @state.following.push(TOKENS_FOLLOWING_value_IN_mult_127)\n value\n @state.following.pop\n\n else\n break #loop 6\n end\n end\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 3)\n\n end\n \n return \n end","title":""},{"docid":"bad572935b58e5f04b61e09c6fd2b9ad","score":"0.5366886","text":"def read_float\n reader.read(4).unpack(\"e\").first\n end","title":""},{"docid":"b4a1892d5744d7458c9f371f073721e8","score":"0.53663486","text":"def get_f_with_units_in_front str, unit_regex\n return (get_f str.match(append_regex( unit_regex, @@float_rxp)).to_s) \n end","title":""},{"docid":"49a5cca24b9ea8ac35702f312d7a71f3","score":"0.53650945","text":"def get_f str\n return nil unless has_num(str)\n myfloat = str.strip.match(/(\\d+,)?\\d+(\\.\\d+)?/).to_s.gsub(/,/,'').to_f\n return nil if myfloat == 0 \n return myfloat\n end","title":""},{"docid":"9d67fe58f2c3bcdaca1ed89881cf53d8","score":"0.53614193","text":"def valid_float?\nbegin\nFloat(self)\ntrue\nrescue ArgumentError\nfalse\nend\nend","title":""},{"docid":"465112992da000a0a180b674d91be826","score":"0.5357488","text":"def read_float32\n primitive_read_float\n end","title":""},{"docid":"38e306a3e4903880a0cf2d2d4204ed4b","score":"0.5343915","text":"def float\n # integer.bind do |a|\n # integer.bind do |b|\n # integer.bind do |c|\n # Generator.wrap(fraction(a, b, c))\n # end\n # end\n # end\n tuple(integer, integer, integer).map do |a, b, c|\n fraction(a, b, c)\n end\n end","title":""},{"docid":"b2b1cbe1d9dad4f5e2cbf23069171765","score":"0.5341721","text":"def float(x)\n x.to_f\n end","title":""},{"docid":"30f05de96adbec9136c5067598f14976","score":"0.53374124","text":"def add\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 2)\n\n begin\n # at line 11:6: ( mult ( '+' mult )* | mult ( '-' mult )* )\n alt_4 = 2\n case look_4 = @input.peek(1)\n when FLOAT then look_4_1 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \n alt_4 = 1\n elsif (true) \n alt_4 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 4, 1)\n raise nvae\n end\n when HEXADECIMAL then look_4_2 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \n alt_4 = 1\n elsif (true) \n alt_4 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 4, 2)\n raise nvae\n end\n when DECIMAL then look_4_3 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \n alt_4 = 1\n elsif (true) \n alt_4 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 4, 3)\n raise nvae\n end\n when OCTAL then look_4_4 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \n alt_4 = 1\n elsif (true) \n alt_4 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 4, 4)\n raise nvae\n end\n when BINARY then look_4_5 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \n alt_4 = 1\n elsif (true) \n alt_4 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 4, 5)\n raise nvae\n end\n when T__16 then look_4_6 = @input.peek(2)\n\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \n alt_4 = 1\n elsif (true) \n alt_4 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 4, 6)\n raise nvae\n end\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n\n nvae = NoViableAlternative(\"\", 4, 0)\n raise nvae\n end\n case alt_4\n when 1\n # at line 11:8: mult ( '+' mult )*\n @state.following.push(TOKENS_FOLLOWING_mult_IN_add_62)\n mult\n @state.following.pop\n # at line 11:13: ( '+' mult )*\n loop do #loop 2\n alt_2 = 2\n look_2_0 = @input.peek(1)\n\n if (look_2_0 == T__12) \n alt_2 = 1\n\n end\n case alt_2\n when 1\n # at line 11:15: '+' mult\n match(T__12, TOKENS_FOLLOWING_T__12_IN_add_66)\n @state.following.push(TOKENS_FOLLOWING_mult_IN_add_68)\n mult\n @state.following.pop\n\n else\n break #loop 2\n end\n end\n\n when 2\n # at line 12:9: mult ( '-' mult )*\n @state.following.push(TOKENS_FOLLOWING_mult_IN_add_80)\n mult\n @state.following.pop\n # at line 12:14: ( '-' mult )*\n loop do #loop 3\n alt_3 = 2\n look_3_0 = @input.peek(1)\n\n if (look_3_0 == T__13) \n alt_3 = 1\n\n end\n case alt_3\n when 1\n # at line 12:16: '-' mult\n match(T__13, TOKENS_FOLLOWING_T__13_IN_add_84)\n @state.following.push(TOKENS_FOLLOWING_mult_IN_add_86)\n mult\n @state.following.pop\n\n else\n break #loop 3\n end\n end\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 2)\n\n end\n \n return \n end","title":""},{"docid":"8f6194d0095b36a538e8f0fed46e9f6a","score":"0.5331395","text":"def read_float(*adjustments)\n num = read_bytes(*adjustments).unpack1('Q>*') >> 11\n num.to_f / 2**53\n end","title":""},{"docid":"cece6c273cd5b38e74479f19339dc932","score":"0.53292406","text":"def float_ext\n read(31, nil).to_f\n end","title":""},{"docid":"ebd4701cc68b6a82e1bf7deb6d493a9b","score":"0.53290826","text":"def normalize_as_float!\n (replace('') ; return nil) if blank?\n rval = to_f_or_nil\n replace(rval.to_s) unless rval.nil?\n rval\n end","title":""},{"docid":"1b410359f4b3fc6feefe965b36c8f087","score":"0.5328105","text":"def literal_float(v)\n if v.infinite? || v.nan?\n raise InvalidValue, \"Infinite floats and NaN values are not valid on MySQL\"\n else\n super\n end\n end","title":""},{"docid":"b020ad482d817447c704d2e47900b104","score":"0.5322224","text":"def raw_float\n @buffer[0].to_f\n end","title":""},{"docid":"55dc069fd4e0a107fcfceb747ad8c5fa","score":"0.53104097","text":"def read_float\n s = read_string(cache: false)\n result = if s == 'nan'\n 0.0 / 0\n elsif s == 'inf'\n 1.0 / 0\n elsif s == '-inf'\n -1.0 / 0\n else\n s.to_f\n end\n @object_cache << result\n result\n end","title":""},{"docid":"8fcf19ca9a638ff75b805555455b9e10","score":"0.5310298","text":"def float name, length, *rest\n opts = parse_options(rest, name, FloatField)\n add_field(name, length, opts)\n end","title":""},{"docid":"290b1070f4e95212b5e70834ef84cad2","score":"0.52916414","text":"def check_float(num)\n num = num.to_s\n\n if /\\d/.match(num) && /^[+-]?\\d*\\.?\\d*$/.match(num)\n if num.to_f.positive?\n 'positive'\n elsif num.to_f.negative?\n 'negative'\n else\n 'zero'\n end\n else\n 'invalid'\n end\nend","title":""},{"docid":"d0ff7f8472bdf7f8315428495e182a5c","score":"0.52900547","text":"def float name, description: nil, mode: :nullable\n add_field name, :float, nil, description: description, mode: mode\n end","title":""}],"string":"[\n {\n \"docid\": \"fc68df27b01b9818391b6f71da74b435\",\n \"score\": \"0.7542491\",\n \"text\": \"def float!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 2 )\\n\\n\\n\\n type = FLOAT\\n channel = ANTLR3::DEFAULT_CHANNEL\\n # - - - - label initialization - - - -\\n\\n\\n # - - - - main rule block - - - -\\n # at line 37:8: 'float'\\n match( \\\"float\\\" )\\n\\n\\n\\n @state.type = type\\n @state.channel = channel\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 2 )\\n\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9179fd62663b020c63cd892538f0ec00\",\n \"score\": \"0.7403847\",\n \"text\": \"def visit_float(node)\\n operator =\\n if %w[+ -].include?(buffer.source[node.start_char])\\n srange_length(node.start_char, 1)\\n end\\n\\n s(\\n :float,\\n [node.value.to_f],\\n smap_operator(operator, srange_node(node))\\n )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"53dbb52ff8f8e4d4a5172236177f923c\",\n \"score\": \"0.72973883\",\n \"text\": \"def float!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 11 )\\n\\n type = FLOAT\\n channel = ANTLR3::DEFAULT_CHANNEL\\n\\n \\n # - - - - main rule block - - - -\\n # at line 108:12: INT '.' INT\\n int!\\n match( 0x2e )\\n int!\\n\\n \\n @state.type = type\\n @state.channel = channel\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 11 )\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3b797aba9947aced99c933d71cafc9b9\",\n \"score\": \"0.7295861\",\n \"text\": \"def visit_float(node); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2d53080e264a995dcb06f4adf000df3e\",\n \"score\": \"0.7193389\",\n \"text\": \"def read_float(hash: nil, fail: [\\\"Expected float literal\\\"])\\n tok = read_token(kinds: %i[float_lit float_exp_lit integer_lit integer_exp_lit hex_lit bin_lit], hash: hash, fail: fail)\\n tok && tok.to_f\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ae97b8d40970aeab2e9b91b93a9a1d35\",\n \"score\": \"0.71611196\",\n \"text\": \"def float!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 33 )\\n\\n type = FLOAT\\n channel = ANTLR3::DEFAULT_CHANNEL\\n\\n \\n # - - - - main rule block - - - -\\n # at line 61:12: ( INTEGER )+ '.' ( INTEGER )+\\n # at file 61:12: ( INTEGER )+\\n match_count_3 = 0\\n while true\\n alt_3 = 2\\n look_3_0 = @input.peek( 1 )\\n\\n if ( look_3_0.between?( 0x30, 0x39 ) )\\n alt_3 = 1\\n\\n end\\n case alt_3\\n when 1\\n # at line 61:12: INTEGER\\n integer!\\n\\n else\\n match_count_3 > 0 and break\\n eee = EarlyExit(3)\\n\\n\\n raise eee\\n end\\n match_count_3 += 1\\n end\\n\\n match( 0x2e )\\n # at file 61:25: ( INTEGER )+\\n match_count_4 = 0\\n while true\\n alt_4 = 2\\n look_4_0 = @input.peek( 1 )\\n\\n if ( look_4_0.between?( 0x30, 0x39 ) )\\n alt_4 = 1\\n\\n end\\n case alt_4\\n when 1\\n # at line 61:25: INTEGER\\n integer!\\n\\n else\\n match_count_4 > 0 and break\\n eee = EarlyExit(4)\\n\\n\\n raise eee\\n end\\n match_count_4 += 1\\n end\\n\\n\\n \\n @state.type = type\\n @state.channel = channel\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 33 )\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"79ac318f636945f274e8c40ef6e326d9\",\n \"score\": \"0.7158026\",\n \"text\": \"def t__37!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 17 )\\n\\n type = T__37\\n channel = ANTLR3::DEFAULT_CHANNEL\\n\\n \\n # - - - - main rule block - - - -\\n # at line 26:9: 'float'\\n match( \\\"float\\\" )\\n\\n \\n @state.type = type\\n @state.channel = channel\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 17 )\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2489affe0bb6fbab2e87518b030b84df\",\n \"score\": \"0.7130779\",\n \"text\": \"def read_float(hash: nil, fail: [\\\"Expected float literal\\\"])\\n tok = read_token(kinds: %i[float_lit float_exp_lit integer_lit integer_exp_lit hex_lit bin_lit], hash: hash, fail: fail)\\n tok && tok.to_f\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c4f14ac3b70d5d247153dd3d9efa5ce4\",\n \"score\": \"0.7073806\",\n \"text\": \"def FloatLiteral(value); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3a8bb327b2344e32cd5fd878402d2df4\",\n \"score\": \"0.70038676\",\n \"text\": \"def t__45!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 28 )\\n\\n type = T__45\\n channel = ANTLR3::DEFAULT_CHANNEL\\n\\n \\n # - - - - main rule block - - - -\\n # at line 36:9: 'float'\\n match( \\\"float\\\" )\\n\\n \\n @state.type = type\\n @state.channel = channel\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 28 )\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a7b91d626a3e2d1c1e3ff59c10d25edc\",\n \"score\": \"0.69434804\",\n \"text\": \"def float!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in(__method__, 8)\\n\\n type = FLOAT\\n channel = ANTLR3::DEFAULT_CHANNEL\\n\\n \\n # - - - - main rule block - - - -\\n # at line 28:3: ( ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ( EXPONENT )? | DECIMAL EXPONENT )\\n alt_5 = 2\\n alt_5 = @dfa5.predict(@input)\\n case alt_5\\n when 1\\n # at line 28:5: ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ( EXPONENT )?\\n # at line 28:5: ( '-' )?\\n alt_1 = 2\\n look_1_0 = @input.peek(1)\\n\\n if (look_1_0 == ?-) \\n alt_1 = 1\\n end\\n case alt_1\\n when 1\\n # at line 28:5: '-'\\n match(?-)\\n\\n end\\n # at file 28:10: ( '0' .. '9' )+\\n match_count_2 = 0\\n loop do\\n alt_2 = 2\\n look_2_0 = @input.peek(1)\\n\\n if (look_2_0.between?(?0, ?9)) \\n alt_2 = 1\\n\\n end\\n case alt_2\\n when 1\\n # at line 28:11: '0' .. '9'\\n match_range(?0, ?9)\\n\\n else\\n match_count_2 > 0 and break\\n eee = EarlyExit(2)\\n\\n\\n raise eee\\n end\\n match_count_2 += 1\\n end\\n\\n match(?.)\\n # at file 28:26: ( '0' .. '9' )+\\n match_count_3 = 0\\n loop do\\n alt_3 = 2\\n look_3_0 = @input.peek(1)\\n\\n if (look_3_0.between?(?0, ?9)) \\n alt_3 = 1\\n\\n end\\n case alt_3\\n when 1\\n # at line 28:27: '0' .. '9'\\n match_range(?0, ?9)\\n\\n else\\n match_count_3 > 0 and break\\n eee = EarlyExit(3)\\n\\n\\n raise eee\\n end\\n match_count_3 += 1\\n end\\n\\n # at line 28:38: ( EXPONENT )?\\n alt_4 = 2\\n look_4_0 = @input.peek(1)\\n\\n if (look_4_0 == ?E || look_4_0 == ?e) \\n alt_4 = 1\\n end\\n case alt_4\\n when 1\\n # at line 28:38: EXPONENT\\n exponent!\\n\\n end\\n\\n when 2\\n # at line 29:5: DECIMAL EXPONENT\\n decimal!\\n exponent!\\n\\n end\\n \\n @state.type = type\\n @state.channel = channel\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out(__method__, 8)\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6050ccc07c7f30c5ffce23de382338fe\",\n \"score\": \"0.6938463\",\n \"text\": \"def lex_floating_constant\\n scan_token(RE_FLOATING_CONSTANT, :floating_constant)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e68d0e2703684c4be2b35b21830a368a\",\n \"score\": \"0.6910431\",\n \"text\": \"def float!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 41 )\\n\\n type = FLOAT\\n channel = ANTLR3::DEFAULT_CHANNEL\\n\\n \\n # - - - - main rule block - - - -\\n # at line 1064:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT )\\n alt_15 = 3\\n alt_15 = @dfa15.predict( @input )\\n case alt_15\\n when 1\\n # at line 1064:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )?\\n # at file 1064:9: ( '0' .. '9' )+\\n match_count_9 = 0\\n while true\\n alt_9 = 2\\n look_9_0 = @input.peek( 1 )\\n\\n if ( look_9_0.between?( 0x30, 0x39 ) )\\n alt_9 = 1\\n\\n end\\n case alt_9\\n when 1\\n # at line 1064:10: '0' .. '9'\\n match_range( 0x30, 0x39 )\\n\\n else\\n match_count_9 > 0 and break\\n eee = EarlyExit(9)\\n\\n\\n raise eee\\n end\\n match_count_9 += 1\\n end\\n\\n match( 0x2e )\\n # at line 1064:25: ( '0' .. '9' )*\\n while true # decision 10\\n alt_10 = 2\\n look_10_0 = @input.peek( 1 )\\n\\n if ( look_10_0.between?( 0x30, 0x39 ) )\\n alt_10 = 1\\n\\n end\\n case alt_10\\n when 1\\n # at line 1064:26: '0' .. '9'\\n match_range( 0x30, 0x39 )\\n\\n else\\n break # out of loop for decision 10\\n end\\n end # loop for decision 10\\n # at line 1064:37: ( EXPONENT )?\\n alt_11 = 2\\n look_11_0 = @input.peek( 1 )\\n\\n if ( look_11_0 == 0x45 || look_11_0 == 0x65 )\\n alt_11 = 1\\n end\\n case alt_11\\n when 1\\n # at line 1064:37: EXPONENT\\n exponent!\\n\\n end\\n\\n when 2\\n # at line 1065:9: '.' ( '0' .. '9' )+ ( EXPONENT )?\\n match( 0x2e )\\n # at file 1065:13: ( '0' .. '9' )+\\n match_count_12 = 0\\n while true\\n alt_12 = 2\\n look_12_0 = @input.peek( 1 )\\n\\n if ( look_12_0.between?( 0x30, 0x39 ) )\\n alt_12 = 1\\n\\n end\\n case alt_12\\n when 1\\n # at line 1065:14: '0' .. '9'\\n match_range( 0x30, 0x39 )\\n\\n else\\n match_count_12 > 0 and break\\n eee = EarlyExit(12)\\n\\n\\n raise eee\\n end\\n match_count_12 += 1\\n end\\n\\n # at line 1065:25: ( EXPONENT )?\\n alt_13 = 2\\n look_13_0 = @input.peek( 1 )\\n\\n if ( look_13_0 == 0x45 || look_13_0 == 0x65 )\\n alt_13 = 1\\n end\\n case alt_13\\n when 1\\n # at line 1065:25: EXPONENT\\n exponent!\\n\\n end\\n\\n when 3\\n # at line 1066:9: ( '0' .. '9' )+ EXPONENT\\n # at file 1066:9: ( '0' .. '9' )+\\n match_count_14 = 0\\n while true\\n alt_14 = 2\\n look_14_0 = @input.peek( 1 )\\n\\n if ( look_14_0.between?( 0x30, 0x39 ) )\\n alt_14 = 1\\n\\n end\\n case alt_14\\n when 1\\n # at line 1066:10: '0' .. '9'\\n match_range( 0x30, 0x39 )\\n\\n else\\n match_count_14 > 0 and break\\n eee = EarlyExit(14)\\n\\n\\n raise eee\\n end\\n match_count_14 += 1\\n end\\n\\n exponent!\\n\\n end\\n \\n @state.type = type\\n @state.channel = channel\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 41 )\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"90ce737be806aadf6643a5e159225952\",\n \"score\": \"0.68450737\",\n \"text\": \"def floating_point_literal!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in(__method__, 88)\\n\\n type = FLOATING_POINT_LITERAL\\n channel = ANTLR3::DEFAULT_CHANNEL\\n\\n \\n # - - - - main rule block - - - -\\n # at line 499:3: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? | '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? | ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? | ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix )\\n alt_25 = 4\\n alt_25 = @dfa25.predict(@input)\\n case alt_25\\n when 1\\n # at line 499:5: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )?\\n # at file 499:5: ( '0' .. '9' )+\\n match_count_14 = 0\\n while true\\n alt_14 = 2\\n look_14_0 = @input.peek(1)\\n\\n if (look_14_0.between?(?0, ?9)) \\n alt_14 = 1\\n\\n end\\n case alt_14\\n when 1\\n # at line 499:6: '0' .. '9'\\n match_range(?0, ?9)\\n\\n else\\n match_count_14 > 0 and break\\n eee = EarlyExit(14)\\n\\n\\n raise eee\\n end\\n match_count_14 += 1\\n end\\n\\n match(?.)\\n # at line 499:21: ( '0' .. '9' )*\\n while true # decision 15\\n alt_15 = 2\\n look_15_0 = @input.peek(1)\\n\\n if (look_15_0.between?(?0, ?9)) \\n alt_15 = 1\\n\\n end\\n case alt_15\\n when 1\\n # at line 499:22: '0' .. '9'\\n match_range(?0, ?9)\\n\\n else\\n break # out of loop for decision 15\\n end\\n end # loop for decision 15\\n # at line 499:33: ( Exponent )?\\n alt_16 = 2\\n look_16_0 = @input.peek(1)\\n\\n if (look_16_0 == ?E || look_16_0 == ?e) \\n alt_16 = 1\\n end\\n case alt_16\\n when 1\\n # at line 499:33: Exponent\\n exponent!\\n\\n end\\n # at line 499:43: ( FloatTypeSuffix )?\\n alt_17 = 2\\n look_17_0 = @input.peek(1)\\n\\n if (look_17_0 == ?D || look_17_0 == ?F || look_17_0 == ?d || look_17_0 == ?f) \\n alt_17 = 1\\n end\\n case alt_17\\n when 1\\n # at line 499:43: FloatTypeSuffix\\n float_type_suffix!\\n\\n end\\n\\n when 2\\n # at line 500:5: '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )?\\n match(?.)\\n # at file 500:9: ( '0' .. '9' )+\\n match_count_18 = 0\\n while true\\n alt_18 = 2\\n look_18_0 = @input.peek(1)\\n\\n if (look_18_0.between?(?0, ?9)) \\n alt_18 = 1\\n\\n end\\n case alt_18\\n when 1\\n # at line 500:10: '0' .. '9'\\n match_range(?0, ?9)\\n\\n else\\n match_count_18 > 0 and break\\n eee = EarlyExit(18)\\n\\n\\n raise eee\\n end\\n match_count_18 += 1\\n end\\n\\n # at line 500:21: ( Exponent )?\\n alt_19 = 2\\n look_19_0 = @input.peek(1)\\n\\n if (look_19_0 == ?E || look_19_0 == ?e) \\n alt_19 = 1\\n end\\n case alt_19\\n when 1\\n # at line 500:21: Exponent\\n exponent!\\n\\n end\\n # at line 500:31: ( FloatTypeSuffix )?\\n alt_20 = 2\\n look_20_0 = @input.peek(1)\\n\\n if (look_20_0 == ?D || look_20_0 == ?F || look_20_0 == ?d || look_20_0 == ?f) \\n alt_20 = 1\\n end\\n case alt_20\\n when 1\\n # at line 500:31: FloatTypeSuffix\\n float_type_suffix!\\n\\n end\\n\\n when 3\\n # at line 501:5: ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )?\\n # at file 501:5: ( '0' .. '9' )+\\n match_count_21 = 0\\n while true\\n alt_21 = 2\\n look_21_0 = @input.peek(1)\\n\\n if (look_21_0.between?(?0, ?9)) \\n alt_21 = 1\\n\\n end\\n case alt_21\\n when 1\\n # at line 501:6: '0' .. '9'\\n match_range(?0, ?9)\\n\\n else\\n match_count_21 > 0 and break\\n eee = EarlyExit(21)\\n\\n\\n raise eee\\n end\\n match_count_21 += 1\\n end\\n\\n exponent!\\n # at line 501:26: ( FloatTypeSuffix )?\\n alt_22 = 2\\n look_22_0 = @input.peek(1)\\n\\n if (look_22_0 == ?D || look_22_0 == ?F || look_22_0 == ?d || look_22_0 == ?f) \\n alt_22 = 1\\n end\\n case alt_22\\n when 1\\n # at line 501:26: FloatTypeSuffix\\n float_type_suffix!\\n\\n end\\n\\n when 4\\n # at line 502:5: ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix\\n # at file 502:5: ( '0' .. '9' )+\\n match_count_23 = 0\\n while true\\n alt_23 = 2\\n look_23_0 = @input.peek(1)\\n\\n if (look_23_0.between?(?0, ?9)) \\n alt_23 = 1\\n\\n end\\n case alt_23\\n when 1\\n # at line 502:6: '0' .. '9'\\n match_range(?0, ?9)\\n\\n else\\n match_count_23 > 0 and break\\n eee = EarlyExit(23)\\n\\n\\n raise eee\\n end\\n match_count_23 += 1\\n end\\n\\n # at line 502:17: ( Exponent )?\\n alt_24 = 2\\n look_24_0 = @input.peek(1)\\n\\n if (look_24_0 == ?E || look_24_0 == ?e) \\n alt_24 = 1\\n end\\n case alt_24\\n when 1\\n # at line 502:17: Exponent\\n exponent!\\n\\n end\\n float_type_suffix!\\n\\n end\\n \\n @state.type = type\\n @state.channel = channel\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out(__method__, 88)\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ef6e417bf9417518a4ff5762ca4c04c2\",\n \"score\": \"0.67929715\",\n \"text\": \"def t__36!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in(__method__, 14)\\n\\n type = T__36\\n channel = ANTLR3::DEFAULT_CHANNEL\\n\\n \\n # - - - - main rule block - - - -\\n # at line 20:9: 'float'\\n match(\\\"float\\\")\\n\\n \\n @state.type = type\\n @state.channel = channel\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out(__method__, 14)\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d28a50f34228dff56e34757e26dbf179\",\n \"score\": \"0.67420095\",\n \"text\": \"def c_float!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 36 )\\n\\n\\n\\n type = C_FLOAT\\n channel = ANTLR3::DEFAULT_CHANNEL\\n # - - - - label initialization - - - -\\n\\n\\n # - - - - main rule block - - - -\\n # at line 103:10: ( '0' .. '9' )+ '.' ( '0' .. '9' )+\\n # at file 103:10: ( '0' .. '9' )+\\n match_count_2 = 0\\n while true\\n alt_2 = 2\\n look_2_0 = @input.peek( 1 )\\n\\n if ( look_2_0.between?( 0x30, 0x39 ) )\\n alt_2 = 1\\n\\n end\\n case alt_2\\n when 1\\n # at line \\n if @input.peek( 1 ).between?( 0x30, 0x39 )\\n @input.consume\\n else\\n mse = MismatchedSet( nil )\\n recover mse\\n raise mse\\n\\n end\\n\\n\\n\\n else\\n match_count_2 > 0 and break\\n eee = EarlyExit(2)\\n\\n\\n raise eee\\n end\\n match_count_2 += 1\\n end\\n\\n\\n match( 0x2e )\\n # at file 103:28: ( '0' .. '9' )+\\n match_count_3 = 0\\n while true\\n alt_3 = 2\\n look_3_0 = @input.peek( 1 )\\n\\n if ( look_3_0.between?( 0x30, 0x39 ) )\\n alt_3 = 1\\n\\n end\\n case alt_3\\n when 1\\n # at line \\n if @input.peek( 1 ).between?( 0x30, 0x39 )\\n @input.consume\\n else\\n mse = MismatchedSet( nil )\\n recover mse\\n raise mse\\n\\n end\\n\\n\\n\\n else\\n match_count_3 > 0 and break\\n eee = EarlyExit(3)\\n\\n\\n raise eee\\n end\\n match_count_3 += 1\\n end\\n\\n\\n\\n\\n @state.type = type\\n @state.channel = channel\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 36 )\\n\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"6faef475ff31cfb31838fa39f35ac644\",\n \"score\": \"0.6740271\",\n \"text\": \"def handle_float(float, lineno_column)\\n Literal.new float.to_f\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"37ec591e263b9941bba80d7a63a16dee\",\n \"score\": \"0.6730366\",\n \"text\": \"def float_regexp()\\r\\n\\treturn '[+-]?\\\\d+(?:\\\\.\\\\d+)?(?:[eE][+-]\\\\d+)?';\\r\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3a1f769e2b14689518250646add56e30\",\n \"score\": \"0.66756654\",\n \"text\": \"def float!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 34 )\\n\\n\\n\\n type = FLOAT\\n channel = ANTLR3::DEFAULT_CHANNEL\\n # - - - - label initialization - - - -\\n\\n\\n # - - - - main rule block - - - -\\n # at line 72:8: ( '0' .. '9' )+ '.' ( '0' .. '9' )+\\n # at file 72:8: ( '0' .. '9' )+\\n match_count_6 = 0\\n while true\\n alt_6 = 2\\n look_6_0 = @input.peek( 1 )\\n\\n if ( look_6_0.between?( 0x30, 0x39 ) )\\n alt_6 = 1\\n\\n end\\n case alt_6\\n when 1\\n # at line \\n if @input.peek( 1 ).between?( 0x30, 0x39 )\\n @input.consume\\n else\\n mse = MismatchedSet( nil )\\n recover mse\\n raise mse\\n\\n end\\n\\n\\n\\n else\\n match_count_6 > 0 and break\\n eee = EarlyExit(6)\\n\\n\\n raise eee\\n end\\n match_count_6 += 1\\n end\\n\\n\\n match( 0x2e )\\n # at file 72:26: ( '0' .. '9' )+\\n match_count_7 = 0\\n while true\\n alt_7 = 2\\n look_7_0 = @input.peek( 1 )\\n\\n if ( look_7_0.between?( 0x30, 0x39 ) )\\n alt_7 = 1\\n\\n end\\n case alt_7\\n when 1\\n # at line \\n if @input.peek( 1 ).between?( 0x30, 0x39 )\\n @input.consume\\n else\\n mse = MismatchedSet( nil )\\n recover mse\\n raise mse\\n\\n end\\n\\n\\n\\n else\\n match_count_7 > 0 and break\\n eee = EarlyExit(7)\\n\\n\\n raise eee\\n end\\n match_count_7 += 1\\n end\\n\\n\\n\\n\\n @state.type = type\\n @state.channel = channel\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 34 )\\n\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1d7e6a1516dcf083ab5d7982f39b67d5\",\n \"score\": \"0.6579026\",\n \"text\": \"def float?\\n @kind == :float_lit || @kind == :float_exp_lit\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"77b749ec5cca72e17f1cde02f2d21213\",\n \"score\": \"0.6547844\",\n \"text\": \"def float_r\\n /\\\\d+\\\\.*\\\\d*/\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5d89db632a72136f4e7aeedc2f867b24\",\n \"score\": \"0.6476115\",\n \"text\": \"def on_float(value)\\n FloatLiteral.new(\\n value: value,\\n location:\\n Location.token(\\n line: lineno,\\n char: char_pos,\\n column: current_column,\\n size: value.size\\n )\\n )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d13e67f798fc8eb800ad3ac0ebb6d96e\",\n \"score\": \"0.644263\",\n \"text\": \"def float_and_regex x\\n return append_regex @@float_rxp, x\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a228aeab1f1ba08470ed620d2793906c\",\n \"score\": \"0.6353045\",\n \"text\": \"def new_float(value)\\n new(Rubinius::AST::FloatLiteral, value)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bd37c913462efe73604d286d814c59e6\",\n \"score\": \"0.6255957\",\n \"text\": \"def parse_float(arg) # :doc:\\n result = nil\\n if x = parse_arg(arg)\\n if x.match(/^-?(\\\\d*\\\\.\\\\d+|\\\\d+)$/)\\n result = x.to_f\\n else\\n raise error(102, \\\"#{arg} must be a floating-point\\\")\\n end\\n end\\n return result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7d5e2c46011a894ecbf59f4bbd446b2e\",\n \"score\": \"0.6124071\",\n \"text\": \"def float!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 37 )\\n\\n \\n # - - - - main rule block - - - -\\n # at line 399:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT )\\n alt_12 = 3\\n alt_12 = @dfa12.predict( @input )\\n case alt_12\\n when 1\\n # at line 399:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )?\\n # at file 399:9: ( '0' .. '9' )+\\n match_count_6 = 0\\n while true\\n alt_6 = 2\\n look_6_0 = @input.peek( 1 )\\n\\n if ( look_6_0.between?( 0x30, 0x39 ) )\\n alt_6 = 1\\n\\n end\\n case alt_6\\n when 1\\n # at line 399:10: '0' .. '9'\\n match_range( 0x30, 0x39 )\\n\\n else\\n match_count_6 > 0 and break\\n eee = EarlyExit(6)\\n\\n\\n raise eee\\n end\\n match_count_6 += 1\\n end\\n\\n match( 0x2e )\\n # at line 399:25: ( '0' .. '9' )*\\n while true # decision 7\\n alt_7 = 2\\n look_7_0 = @input.peek( 1 )\\n\\n if ( look_7_0.between?( 0x30, 0x39 ) )\\n alt_7 = 1\\n\\n end\\n case alt_7\\n when 1\\n # at line 399:26: '0' .. '9'\\n match_range( 0x30, 0x39 )\\n\\n else\\n break # out of loop for decision 7\\n end\\n end # loop for decision 7\\n # at line 399:37: ( EXPONENT )?\\n alt_8 = 2\\n look_8_0 = @input.peek( 1 )\\n\\n if ( look_8_0 == 0x45 || look_8_0 == 0x65 )\\n alt_8 = 1\\n end\\n case alt_8\\n when 1\\n # at line 399:37: EXPONENT\\n exponent!\\n\\n end\\n\\n when 2\\n # at line 400:9: '.' ( '0' .. '9' )+ ( EXPONENT )?\\n match( 0x2e )\\n # at file 400:13: ( '0' .. '9' )+\\n match_count_9 = 0\\n while true\\n alt_9 = 2\\n look_9_0 = @input.peek( 1 )\\n\\n if ( look_9_0.between?( 0x30, 0x39 ) )\\n alt_9 = 1\\n\\n end\\n case alt_9\\n when 1\\n # at line 400:14: '0' .. '9'\\n match_range( 0x30, 0x39 )\\n\\n else\\n match_count_9 > 0 and break\\n eee = EarlyExit(9)\\n\\n\\n raise eee\\n end\\n match_count_9 += 1\\n end\\n\\n # at line 400:25: ( EXPONENT )?\\n alt_10 = 2\\n look_10_0 = @input.peek( 1 )\\n\\n if ( look_10_0 == 0x45 || look_10_0 == 0x65 )\\n alt_10 = 1\\n end\\n case alt_10\\n when 1\\n # at line 400:25: EXPONENT\\n exponent!\\n\\n end\\n\\n when 3\\n # at line 401:9: ( '0' .. '9' )+ EXPONENT\\n # at file 401:9: ( '0' .. '9' )+\\n match_count_11 = 0\\n while true\\n alt_11 = 2\\n look_11_0 = @input.peek( 1 )\\n\\n if ( look_11_0.between?( 0x30, 0x39 ) )\\n alt_11 = 1\\n\\n end\\n case alt_11\\n when 1\\n # at line 401:10: '0' .. '9'\\n match_range( 0x30, 0x39 )\\n\\n else\\n match_count_11 > 0 and break\\n eee = EarlyExit(11)\\n\\n\\n raise eee\\n end\\n match_count_11 += 1\\n end\\n\\n exponent!\\n\\n end\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 37 )\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"eb50ab0230ce64f260754727ed766836\",\n \"score\": \"0.6098546\",\n \"text\": \"def float; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7c3e10192e8a112410ae94bbc62cc57d\",\n \"score\": \"0.59562457\",\n \"text\": \"def float_type_suffix!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in(__method__, 90)\\n\\n \\n # - - - - main rule block - - - -\\n # at line 509:19: ( 'f' | 'F' | 'd' | 'D' )\\n if @input.peek(1) == ?D || @input.peek(1) == ?F || @input.peek(1) == ?d || @input.peek(1) == ?f\\n @input.consume\\n else\\n mse = MismatchedSet(nil)\\n recover(mse)\\n raise mse\\n end\\n\\n\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out(__method__, 90)\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"689d47d0bcc534bc28f4630e9aca8af6\",\n \"score\": \"0.5955509\",\n \"text\": \"def foorth_coerce(arg)\\r\\n Float(arg)\\r\\n rescue\\r\\n error \\\"F40: Cannot coerce a #{arg.foorth_name} to a Float instance\\\"\\r\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"54cd613eef1556871fb8c321b8910b66\",\n \"score\": \"0.59452474\",\n \"text\": \"def interpret_as_float()\\n sign = (2**31 & self != 0) ? -1 : 1\\n expo = ((0xFF * 2**23) & self) >> 23\\n frac = (2**23 - 1) & self\\n if expo == 0 and frac == 0\\n sign.to_f * 0.0 # zero\\n elsif expo == 0\\n sign * 2**(expo - 126) * (frac.to_f / 2**23.to_f) # denormalized\\n elsif expo == 0xFF and frac == 0\\n sign.to_f / 0.0 # Infinity\\n elsif expo == 0xFF\\n 0.0 / 0.0 # NaN\\n else\\n sign * 2**(expo - 127) * (1.0 + (frac.to_f / 2**23.to_f)) # normalized\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"68b33adebfcf200c28bf9a679111d9e5\",\n \"score\": \"0.5944261\",\n \"text\": \"def float?\\n pat = /^[-+]?[1-9]([0-9]*)?\\\\.[0-9]+$/\\n return true if self=~pat \\n return false \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"44aaad1d9956cac31a94bf611b225c68\",\n \"score\": \"0.58783346\",\n \"text\": \"def numeric!\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 6 )\\n\\n type = NUMERIC\\n channel = ANTLR3::DEFAULT_CHANNEL\\n\\n \\n # - - - - main rule block - - - -\\n # at line 8:11: 'numeric'\\n match( \\\"numeric\\\" )\\n\\n \\n @state.type = type\\n @state.channel = channel\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 6 )\\n\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4013ae11a0ab8c5f8194a80a2d25a4ae\",\n \"score\": \"0.5873282\",\n \"text\": \"def float_or_nil(); FLOAT_OR_NIL; end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b489fce99cf53a97318a9de0d21eb47d\",\n \"score\": \"0.58466\",\n \"text\": \"def tf\\n pipe_2_variable\\n start \\\"Float( #@r )\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"42e0559903ed30be3ac9137a6a674134\",\n \"score\": \"0.5846477\",\n \"text\": \"def read_float\\n primitive_read_float\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4ceb4080a80d64afe82464e77ffb55c6\",\n \"score\": \"0.58412856\",\n \"text\": \"def read_float\\n Rubinius.primitive :pointer_read_float\\n raise PrimitiveFailure, \\\"Unable to read float\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7aaeccfd2ee1237ecbb10552261518ba\",\n \"score\": \"0.5820633\",\n \"text\": \"def float\\n frequency(49 => real_float, 1 => one_of(*@@special_floats.map(&method(:constant))))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"477eed93e61e38faef84ed8f557fb038\",\n \"score\": \"0.58136714\",\n \"text\": \"def validate_float(v); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d7fe52d632795d5b14a0b46c3633bf1e\",\n \"score\": \"0.5800057\",\n \"text\": \"def to_f\\n case @kind\\n when :float_lit, :float_exp_lit,\\n :integer_lit, :integer_exp_lit,\\n :single_string_lit, :double_string_lit\\n @value.to_f\\n else\\n self.to_i.to_f\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dbaa83cd08b43ac3b1053751185b6941\",\n \"score\": \"0.5733037\",\n \"text\": \"def write_float(flt, depth = 0)\\n write_number(flt, depth + 1)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"66f111515ea1c28372bdfeee46bfd840\",\n \"score\": \"0.570962\",\n \"text\": \"def real_float\\n tuple(integer, integer, integer).map do |a, b, c|\\n fraction(a, b, c)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2fa1791fdf330dd5aa96415ff1caeb86\",\n \"score\": \"0.5707181\",\n \"text\": \"def on_float(value); end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"82eb10ce1e9130d480fcb5ff5332b0ac\",\n \"score\": \"0.5689524\",\n \"text\": \"def validate_float\\n valid_float?.tap { |valid| yield Float(@body) if valid }\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"db9ddb7b165be798235995ffa3a95985\",\n \"score\": \"0.568176\",\n \"text\": \"def set_float\\n\\t\\t\\t_rational = @option[:number].to_f.round(2).to_s.to_r\\n\\t\\t\\t_nmtr = _rational.numerator\\n\\t\\t\\t_dntr = _rational.denominator\\n\\t\\t\\t\\n\\t\\t\\tif _nmtr > _dntr\\n\\t\\t\\t\\t@float[:wnum] = Rn.new(_nmtr.divmod(_dntr)[0].to_s)\\n\\t\\t\\t\\tunless _nmtr.divmod(_dntr)[1] == 0\\n\\t\\t\\t\\t\\t@float[:nmtr] = Rn.new(_nmtr.divmod(_dntr)[1].to_s)\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t@option[:number] = _nmtr.divmod(_dntr)[0].to_s\\n\\t\\t\\t\\t\\tset_Integer.print\\n\\t\\t\\t\\tend\\n\\t\\t\\t\\t@float[:dntr] = Rn.new(_dntr.to_s) \\n\\t\\t\\telse\\n\\t\\t\\t\\t@float[:nmtr] = Rn.new(_nmtr.to_s)\\n\\t\\t\\t\\t@float[:dntr] = Rn.new(_dntr.to_s)\\n\\t\\t\\tend\\n\\t\\t\\tself\\n\\t\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c9ccadd3ecf737dbf426af9523677aea\",\n \"score\": \"0.565579\",\n \"text\": \"def parse_float(the_input)\\n output = 0\\n begin\\n output = the_input.to_f\\n rescue => detail\\n nil\\n end\\n output\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"e5958ba2cc89146aa08bdbe609da3109\",\n \"score\": \"0.5612759\",\n \"text\": \"def float name, description: nil, mode: :nullable,\\n policy_tags: nil, default_value_expression: nil\\n add_field name, :float,\\n description: description,\\n mode: mode,\\n policy_tags: policy_tags,\\n default_value_expression: default_value_expression\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"32f5e794933a5e9df112f6a941978e4a\",\n \"score\": \"0.56092554\",\n \"text\": \"def float\\n @floating = true\\n damage(:floating)\\n return nil\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"36f4ef441f7e798bd11f0b71a79799a4\",\n \"score\": \"0.5591785\",\n \"text\": \"def float\\n read(4).unpack('e')[0]\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ec74b145e032c68fcfb2e8148df7b349\",\n \"score\": \"0.5590917\",\n \"text\": \"def convert_float_to_type\\n\\t\\tcase @language\\n\\t\\twhen :java, :java_lombok\\n\\t\\t\\treturn \\\"float\\\"\\n\\t\\telse \\n\\t\\t\\terror_and_exit \\\"Could not convert to output language #{@language}\\\"\\n\\t\\tend\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"29006128a81041e2534015c09c74ded0\",\n \"score\": \"0.55800325\",\n \"text\": \"def float(field_name)\\n handle_field(:float, field_name.to_sym)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"29006128a81041e2534015c09c74ded0\",\n \"score\": \"0.55800325\",\n \"text\": \"def float(field_name)\\n handle_field(:float, field_name.to_sym)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c7e995648a1c6643be87a4979094f8d1\",\n \"score\": \"0.557316\",\n \"text\": \"def float name, description: nil, mode: nil\\n add_field name, :float, nil, description: description, mode: mode\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"94318d660438a7cceb82031cb42d3746\",\n \"score\": \"0.55709666\",\n \"text\": \"def is_float(sentence)\\n true if Float(sentence) rescue false\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1de7744beb5b640a41ec88724ecb74a7\",\n \"score\": \"0.5570466\",\n \"text\": \"def FloatLiteral(value)\\n FloatLiteral.new(value: value, location: Location.default)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b93400a4f27468cc5ed8a8f8e5cd306d\",\n \"score\": \"0.55597997\",\n \"text\": \"def float( str )\\n Float( str )\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1407b0d4e2afedab1d6b6713ab613398\",\n \"score\": \"0.555743\",\n \"text\": \"def handle_float_type\\n case [tags[:endian], tags[:precision]]\\n when [:native, :double]\\n \\\"D\\\"\\n when [:native, :single]\\n \\\"F\\\"\\n when [:little, :double]\\n \\\"E\\\"\\n when [:little, :single]\\n \\\"e\\\"\\n when [:big, :double]\\n \\\"G\\\"\\n when [:big, :single]\\n \\\"g\\\"\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"3c16a9b410dca947de91c730868f9ef0\",\n \"score\": \"0.5537456\",\n \"text\": \"def to_f(type = LLVM::Float.type)\\n C.LLVMGenericValueToFloat(type, self)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"be4d6da57cd9944c8134d0596d5965c1\",\n \"score\": \"0.5535841\",\n \"text\": \"def atom(token)\\n int = Integer(token) rescue nil\\n float = Float(token) rescue nil\\n int || float || token\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"dd0317b51e1651bb362059f31d2ff73c\",\n \"score\": \"0.5535751\",\n \"text\": \"def is_float?\\n return is_numeric? unless is_integer?\\n false\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2431491791511e5e7a89575fe2a83b9c\",\n \"score\": \"0.55298525\",\n \"text\": \"def type_string\\n \\\"float\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0e97b759152c356fdeb27cd7b6182c63\",\n \"score\": \"0.55238515\",\n \"text\": \"def test_float\\n\\t\\t42.12345\\n\\tend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"88b6ac4c74639d02e8ddceb32ae76ff3\",\n \"score\": \"0.5518029\",\n \"text\": \"def type_f\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in( __method__, 20 )\\n\\n\\n return_value = TypeFReturnValue.new\\n\\n # $rule.start = the first token seen before matching\\n return_value.start = @input.look\\n\\n\\n begin\\n # at line 229:5: ( type_s | VOID )\\n # at line 229:5: ( type_s | VOID )\\n alt_21 = 2\\n look_21_0 = @input.peek( 1 )\\n\\n if ( look_21_0.between?( BOOL, CHAR ) || look_21_0 == FLOAT || look_21_0 == INTEGER )\\n alt_21 = 1\\n elsif ( look_21_0 == VOID )\\n alt_21 = 2\\n else\\n raise NoViableAlternative( \\\"\\\", 21, 0 )\\n\\n end\\n case alt_21\\n when 1\\n # at line 229:6: type_s\\n @state.following.push( TOKENS_FOLLOWING_type_s_IN_type_f_1158 )\\n type_s\\n @state.following.pop\\n\\n when 2\\n # at line 229:15: VOID\\n match( VOID, TOKENS_FOLLOWING_VOID_IN_type_f_1162 )\\n\\n end\\n\\n # - - - - - - - rule clean up - - - - - - - -\\n return_value.stop = @input.look( -1 )\\n\\n\\n rescue ANTLR3::Error::RecognitionError => re\\n report_error(re)\\n recover(re)\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out( __method__, 20 )\\n\\n\\n end\\n\\n return return_value\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9907d39a233332bd88254b3c8965c09a\",\n \"score\": \"0.5508619\",\n \"text\": \"def read_float\\n decode_float(read(4))\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0fbe285162a713be0073d0d2e381bf29\",\n \"score\": \"0.55048287\",\n \"text\": \"def match_number\\n @token.value if match? :FLOAT or match? :INTEGER\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"46717b3eaa01d61ec4b2b3f2b57094d1\",\n \"score\": \"0.55022115\",\n \"text\": \"def float\\n do_spin\\n validate\\n raw_float / BASE\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"0c92495b143f0276a2b09eeecf17a862\",\n \"score\": \"0.5488194\",\n \"text\": \"def visit_float(node)\\n node.copy\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"5ed7ff405b31c44c266d26b157f05ed5\",\n \"score\": \"0.5481984\",\n \"text\": \"def to_f(type = LLVM::Float.type)\\n C.generic_value_to_float(type, self)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"08d58cb2720758f546d88ea8c626b303\",\n \"score\": \"0.5473274\",\n \"text\": \"def real_nonpositive_float\\n real_nonnegative_float.map(&:-@)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a047cade0c848c8d7790ea65fa880858\",\n \"score\": \"0.5470216\",\n \"text\": \"def float?(input)\\n Float(input) rescue false #following previous lesson's suggestion\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"a2dc378561fa08f0ab3927b04d6915bf\",\n \"score\": \"0.54584134\",\n \"text\": \"def is_float?(string)\\n if string !~ /^\\\\s*[+-]?((\\\\d+_?)*\\\\d+(\\\\.(\\\\d+_?)*\\\\d+)?|\\\\.(\\\\d+_?)*\\\\d+)(\\\\s*|([eE][+-]?(\\\\d+_?)*\\\\d+)\\\\s*)$/\\n return false\\n else\\n return true\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b700f6f780d91490a99ffa3ac4dfd9cd\",\n \"score\": \"0.5447546\",\n \"text\": \"def parseLfactor()\\n if getTokenKind == Token::T_BOOLEAN\\n nextToken()\\n else \\n parseRelOp()\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"4d4c0831ee26e364d2ca640a311f8f34\",\n \"score\": \"0.54435736\",\n \"text\": \"def test_is_a_Query_Float\\n assert_kind_of(Float, 10.to_l)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"83294a232afa1217d1d4cc1527558094\",\n \"score\": \"0.5428877\",\n \"text\": \"def float(cell, str = +'')\\n numeric cell, str\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"24f48506111849012380d068eaf812c4\",\n \"score\": \"0.5426999\",\n \"text\": \"def convert_var_to_float(param_a)\\n param_a = Float(param_a) rescue false\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"7616e423cb77c37026801d209175bb44\",\n \"score\": \"0.54016477\",\n \"text\": \"def parse_float(n, default)\\n Float(n)\\n rescue\\n default\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9901e54895e157d939ec74264303e999\",\n \"score\": \"0.5396663\",\n \"text\": \"def write_float(obj)\\n Rubinius.primitive :pointer_write_float\\n raise PrimitiveFailure, \\\"Unable to write float\\\"\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"77e8f4d1d6a14dcba19933dc2e22faae\",\n \"score\": \"0.53956133\",\n \"text\": \"def test_float_val\\n set_rule = Rules.new\\n actual = set_rule.pos_int? '1.2'\\n expected = false\\n assert_equal expected, actual\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c24af654b8219fa937e1a44887311a56\",\n \"score\": \"0.53856736\",\n \"text\": \"def literal_float(v)\\n v.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"c24af654b8219fa937e1a44887311a56\",\n \"score\": \"0.53856736\",\n \"text\": \"def literal_float(v)\\n v.to_s\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"2c46ebe16f49e6abf97eea9899dd10f3\",\n \"score\": \"0.5380262\",\n \"text\": \"def test_009_floats\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"071b04fa3b29850498b6546ef0ae37e1\",\n \"score\": \"0.5377404\",\n \"text\": \"def float?(input)\\n Float(input) rescue false\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"071b04fa3b29850498b6546ef0ae37e1\",\n \"score\": \"0.5377404\",\n \"text\": \"def float?(input)\\n Float(input) rescue false\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"569554f9977eae00659d0cf052b33e58\",\n \"score\": \"0.5375989\",\n \"text\": \"def mult\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in(__method__, 3)\\n\\n begin\\n # at line 15:6: ( value ( '*' value )* | value ( '/' value )* )\\n alt_7 = 2\\n case look_7 = @input.peek(1)\\n when FLOAT then look_7_1 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \\n alt_7 = 1\\n elsif (true) \\n alt_7 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 7, 1)\\n raise nvae\\n end\\n when HEXADECIMAL then look_7_2 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \\n alt_7 = 1\\n elsif (true) \\n alt_7 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 7, 2)\\n raise nvae\\n end\\n when DECIMAL then look_7_3 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \\n alt_7 = 1\\n elsif (true) \\n alt_7 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 7, 3)\\n raise nvae\\n end\\n when OCTAL then look_7_4 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \\n alt_7 = 1\\n elsif (true) \\n alt_7 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 7, 4)\\n raise nvae\\n end\\n when BINARY then look_7_5 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \\n alt_7 = 1\\n elsif (true) \\n alt_7 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 7, 5)\\n raise nvae\\n end\\n when T__16 then look_7_6 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_6_arithmetic!)) \\n alt_7 = 1\\n elsif (true) \\n alt_7 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 7, 6)\\n raise nvae\\n end\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n\\n nvae = NoViableAlternative(\\\"\\\", 7, 0)\\n raise nvae\\n end\\n case alt_7\\n when 1\\n # at line 15:8: value ( '*' value )*\\n @state.following.push(TOKENS_FOLLOWING_value_IN_mult_103)\\n value\\n @state.following.pop\\n # at line 15:14: ( '*' value )*\\n loop do #loop 5\\n alt_5 = 2\\n look_5_0 = @input.peek(1)\\n\\n if (look_5_0 == T__14) \\n alt_5 = 1\\n\\n end\\n case alt_5\\n when 1\\n # at line 15:16: '*' value\\n match(T__14, TOKENS_FOLLOWING_T__14_IN_mult_107)\\n @state.following.push(TOKENS_FOLLOWING_value_IN_mult_109)\\n value\\n @state.following.pop\\n\\n else\\n break #loop 5\\n end\\n end\\n\\n when 2\\n # at line 16:9: value ( '/' value )*\\n @state.following.push(TOKENS_FOLLOWING_value_IN_mult_121)\\n value\\n @state.following.pop\\n # at line 16:15: ( '/' value )*\\n loop do #loop 6\\n alt_6 = 2\\n look_6_0 = @input.peek(1)\\n\\n if (look_6_0 == T__15) \\n alt_6 = 1\\n\\n end\\n case alt_6\\n when 1\\n # at line 16:17: '/' value\\n match(T__15, TOKENS_FOLLOWING_T__15_IN_mult_125)\\n @state.following.push(TOKENS_FOLLOWING_value_IN_mult_127)\\n value\\n @state.following.pop\\n\\n else\\n break #loop 6\\n end\\n end\\n\\n end\\n rescue ANTLR3::Error::RecognitionError => re\\n report_error(re)\\n recover(re)\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out(__method__, 3)\\n\\n end\\n \\n return \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"bad572935b58e5f04b61e09c6fd2b9ad\",\n \"score\": \"0.5366886\",\n \"text\": \"def read_float\\n reader.read(4).unpack(\\\"e\\\").first\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b4a1892d5744d7458c9f371f073721e8\",\n \"score\": \"0.53663486\",\n \"text\": \"def get_f_with_units_in_front str, unit_regex\\n return (get_f str.match(append_regex( unit_regex, @@float_rxp)).to_s) \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"49a5cca24b9ea8ac35702f312d7a71f3\",\n \"score\": \"0.53650945\",\n \"text\": \"def get_f str\\n return nil unless has_num(str)\\n myfloat = str.strip.match(/(\\\\d+,)?\\\\d+(\\\\.\\\\d+)?/).to_s.gsub(/,/,'').to_f\\n return nil if myfloat == 0 \\n return myfloat\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"9d67fe58f2c3bcdaca1ed89881cf53d8\",\n \"score\": \"0.53614193\",\n \"text\": \"def valid_float?\\nbegin\\nFloat(self)\\ntrue\\nrescue ArgumentError\\nfalse\\nend\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"465112992da000a0a180b674d91be826\",\n \"score\": \"0.5357488\",\n \"text\": \"def read_float32\\n primitive_read_float\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"38e306a3e4903880a0cf2d2d4204ed4b\",\n \"score\": \"0.5343915\",\n \"text\": \"def float\\n # integer.bind do |a|\\n # integer.bind do |b|\\n # integer.bind do |c|\\n # Generator.wrap(fraction(a, b, c))\\n # end\\n # end\\n # end\\n tuple(integer, integer, integer).map do |a, b, c|\\n fraction(a, b, c)\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b2b1cbe1d9dad4f5e2cbf23069171765\",\n \"score\": \"0.5341721\",\n \"text\": \"def float(x)\\n x.to_f\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"30f05de96adbec9136c5067598f14976\",\n \"score\": \"0.53374124\",\n \"text\": \"def add\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_in(__method__, 2)\\n\\n begin\\n # at line 11:6: ( mult ( '+' mult )* | mult ( '-' mult )* )\\n alt_4 = 2\\n case look_4 = @input.peek(1)\\n when FLOAT then look_4_1 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \\n alt_4 = 1\\n elsif (true) \\n alt_4 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 4, 1)\\n raise nvae\\n end\\n when HEXADECIMAL then look_4_2 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \\n alt_4 = 1\\n elsif (true) \\n alt_4 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 4, 2)\\n raise nvae\\n end\\n when DECIMAL then look_4_3 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \\n alt_4 = 1\\n elsif (true) \\n alt_4 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 4, 3)\\n raise nvae\\n end\\n when OCTAL then look_4_4 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \\n alt_4 = 1\\n elsif (true) \\n alt_4 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 4, 4)\\n raise nvae\\n end\\n when BINARY then look_4_5 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \\n alt_4 = 1\\n elsif (true) \\n alt_4 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 4, 5)\\n raise nvae\\n end\\n when T__16 then look_4_6 = @input.peek(2)\\n\\n if (syntactic_predicate?(:synpred_3_arithmetic!)) \\n alt_4 = 1\\n elsif (true) \\n alt_4 = 2\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n nvae = NoViableAlternative(\\\"\\\", 4, 6)\\n raise nvae\\n end\\n else\\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\\n\\n nvae = NoViableAlternative(\\\"\\\", 4, 0)\\n raise nvae\\n end\\n case alt_4\\n when 1\\n # at line 11:8: mult ( '+' mult )*\\n @state.following.push(TOKENS_FOLLOWING_mult_IN_add_62)\\n mult\\n @state.following.pop\\n # at line 11:13: ( '+' mult )*\\n loop do #loop 2\\n alt_2 = 2\\n look_2_0 = @input.peek(1)\\n\\n if (look_2_0 == T__12) \\n alt_2 = 1\\n\\n end\\n case alt_2\\n when 1\\n # at line 11:15: '+' mult\\n match(T__12, TOKENS_FOLLOWING_T__12_IN_add_66)\\n @state.following.push(TOKENS_FOLLOWING_mult_IN_add_68)\\n mult\\n @state.following.pop\\n\\n else\\n break #loop 2\\n end\\n end\\n\\n when 2\\n # at line 12:9: mult ( '-' mult )*\\n @state.following.push(TOKENS_FOLLOWING_mult_IN_add_80)\\n mult\\n @state.following.pop\\n # at line 12:14: ( '-' mult )*\\n loop do #loop 3\\n alt_3 = 2\\n look_3_0 = @input.peek(1)\\n\\n if (look_3_0 == T__13) \\n alt_3 = 1\\n\\n end\\n case alt_3\\n when 1\\n # at line 12:16: '-' mult\\n match(T__13, TOKENS_FOLLOWING_T__13_IN_add_84)\\n @state.following.push(TOKENS_FOLLOWING_mult_IN_add_86)\\n mult\\n @state.following.pop\\n\\n else\\n break #loop 3\\n end\\n end\\n\\n end\\n rescue ANTLR3::Error::RecognitionError => re\\n report_error(re)\\n recover(re)\\n\\n ensure\\n # -> uncomment the next line to manually enable rule tracing\\n # trace_out(__method__, 2)\\n\\n end\\n \\n return \\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8f6194d0095b36a538e8f0fed46e9f6a\",\n \"score\": \"0.5331395\",\n \"text\": \"def read_float(*adjustments)\\n num = read_bytes(*adjustments).unpack1('Q>*') >> 11\\n num.to_f / 2**53\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"cece6c273cd5b38e74479f19339dc932\",\n \"score\": \"0.53292406\",\n \"text\": \"def float_ext\\n read(31, nil).to_f\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"ebd4701cc68b6a82e1bf7deb6d493a9b\",\n \"score\": \"0.53290826\",\n \"text\": \"def normalize_as_float!\\n (replace('') ; return nil) if blank?\\n rval = to_f_or_nil\\n replace(rval.to_s) unless rval.nil?\\n rval\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"1b410359f4b3fc6feefe965b36c8f087\",\n \"score\": \"0.5328105\",\n \"text\": \"def literal_float(v)\\n if v.infinite? || v.nan?\\n raise InvalidValue, \\\"Infinite floats and NaN values are not valid on MySQL\\\"\\n else\\n super\\n end\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"b020ad482d817447c704d2e47900b104\",\n \"score\": \"0.5322224\",\n \"text\": \"def raw_float\\n @buffer[0].to_f\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"55dc069fd4e0a107fcfceb747ad8c5fa\",\n \"score\": \"0.53104097\",\n \"text\": \"def read_float\\n s = read_string(cache: false)\\n result = if s == 'nan'\\n 0.0 / 0\\n elsif s == 'inf'\\n 1.0 / 0\\n elsif s == '-inf'\\n -1.0 / 0\\n else\\n s.to_f\\n end\\n @object_cache << result\\n result\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"8fcf19ca9a638ff75b805555455b9e10\",\n \"score\": \"0.5310298\",\n \"text\": \"def float name, length, *rest\\n opts = parse_options(rest, name, FloatField)\\n add_field(name, length, opts)\\n end\",\n \"title\": \"\"\n },\n {\n \"docid\": \"290b1070f4e95212b5e70834ef84cad2\",\n \"score\": \"0.52916414\",\n \"text\": \"def check_float(num)\\n num = num.to_s\\n\\n if /\\\\d/.match(num) && /^[+-]?\\\\d*\\\\.?\\\\d*$/.match(num)\\n if num.to_f.positive?\\n 'positive'\\n elsif num.to_f.negative?\\n 'negative'\\n else\\n 'zero'\\n end\\n else\\n 'invalid'\\n end\\nend\",\n \"title\": \"\"\n },\n {\n \"docid\": \"d0ff7f8472bdf7f8315428495e182a5c\",\n \"score\": \"0.52900547\",\n \"text\": \"def float name, description: nil, mode: :nullable\\n add_field name, :float, nil, description: description, mode: mode\\n end\",\n \"title\": \"\"\n }\n]"}}},{"rowIdx":193,"cells":{"query_id":{"kind":"string","value":"84257283fc48dfde2c579bf0beb8ecba"},"query":{"kind":"string","value":"Format the clippings to .org format."},"positive_passages":{"kind":"list like","value":[{"docid":"f780f7748f63f185f6f855cb0a3513e5","score":"0.57559943","text":"def format\n puts '* Kindle Clippings'\n @notebook.each do |title, info|\n puts '** ' + title\n info.each do |clipping|\n puts '- ' + clipping.content\n end\n end\n end","title":""}],"string":"[\n {\n \"docid\": \"f780f7748f63f185f6f855cb0a3513e5\",\n \"score\": \"0.57559943\",\n \"text\": \"def format\\n puts '* Kindle Clippings'\\n @notebook.each do |title, info|\\n puts '** ' + title\\n info.each do |clipping|\\n puts '- ' + clipping.content\\n end\\n end\\n end\",\n \"title\": \"\"\n }\n]"},"negative_passages":{"kind":"list like","value":[{"docid":"7af39da59ebe7e5dad77535e6efcd73b","score":"0.5690884","text":"def formatAPA\n (prettyOutput(@authors.map { |x| x.to_s }) + \"(\" + @date.year.to_s + \") \" + @title +\n \"\\n\\t(\" + @edition.to_s + \") \" +\n \"(\" + @editionnumber.to_s + \") \" +\n @issbn)\n end","title":""},{"docid":"e636b15a58c114ce96efa23fda7adb1d","score":"0.5668378","text":"def output_html orgs, attr, rec, path\n file = File.open path, 'w' do |line|\n line.puts ''\n line.puts ''\n line.puts '
'\n # line.puts '
'\n line.puts '
Your OSU Organizations'\n line.puts ''\n line.puts '
'\n line.puts 'List of Organizations
'\n line.puts ' Here are the OSU Organizations you selected.'\n line.print ' Recommended orgs at the bottom.' unless rec.empty?\n line.print '
'\n orgs.each do |org|\n # Output the name first.\n line.puts \"\"\n line.puts ''\n # Go through each attribute array and only print out necessary attributes\n attr.each do |attr|\n # 'Types'\n if attr == 'Primary Type'\n line.puts \"- #{attr}: #{org['Types'][0]}
\"\n elsif attr == 'Secondary Types'\n line.puts \"- #{attr}: #{org['Types'][1...org['Types'].length]}
\"\n elsif attr == 'Constitution'\n if org['Constitution'][0...-1] != 'N/'\n line.puts \"- #{org['Constitution'][0...-1]}
\"\n end\n else\n line.puts \"- #{attr}: #{org[attr]}
\"\n end\n end\n line.puts '
'\n end\n line.puts '
'\n unless rec.empty?\n line.puts 'Recommended for You
'\n # Output an unordered list of recommended organizations and their urls\n line.puts ''\n rec.each do |url|\n line.puts \"- #{url[0]}
\"\n end\n line.puts '
'\n end\n line.puts ''\n line.puts '