query stringlengths 7 9.55k | document stringlengths 10 363k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Find all the end points of possible sequences which contain (x, y) | def find_end_points(x, y, chip)
end_points = @DIR_DELTAS.keys.map { |dir| end_point_in_direction(x, y, chip, dir) }
end_points.uniq { |point| point.take(2) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_all_sequences(x,y)\n ret = []\n ret << [[x,y],[x+1,y],[x+2,y],[x+3,y]] if x+3 <= 19\n ret << [[x,y],[x,y+1],[x,y+2],[x,y+3]] if y+3 <= 19\n ret << [[x,y],[x+1,y+1],[x+2,y+2],[x+3,y+3]] if y+3 <= 19 && x+3 <= 19\n ret << [[x,y],[x-1,y+1],[x-2,y+2],[x-3,y+3]] if x-3 >= 0 && y+3 <= 19\n ret\nend",
"d... | [
"0.74988186",
"0.63319415",
"0.62827826",
"0.620051",
"0.6174181",
"0.61383367",
"0.61313665",
"0.6036854",
"0.6014866",
"0.5998312",
"0.5890408",
"0.5840188",
"0.582595",
"0.58235514",
"0.58069175",
"0.5785054",
"0.5761803",
"0.57585657",
"0.5742389",
"0.57158446",
"0.570155... | 0.7209214 | 1 |
Find the end point of a possible sequence which contains (x, y) in a given direction | def end_point_in_direction(x, y, chip, dir)
# TODO: Currently this will keep searching for an end point until it reaches
# an empty space, the end of the board, or an opposing chip. It would be
# more efficient to also stop searching if the distance searched exceeds
# the number of chips needed in a row... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_end_points(x, y, chip)\n end_points = @DIR_DELTAS.keys.map { |dir| end_point_in_direction(x, y, chip, dir) }\n end_points.uniq { |point| point.take(2) }\n end",
"def near_xy direction\n nx = @x\n ny = @y\n delta = [\"ny -= 1\", \"nx += 1\", \"ny += 1\", \"nx -= 1\"]\n @angle.times{del... | [
"0.70214534",
"0.6337787",
"0.6285724",
"0.6195561",
"0.6174354",
"0.6166344",
"0.6163015",
"0.6147472",
"0.614348",
"0.61239076",
"0.61098874",
"0.6051253",
"0.59652793",
"0.5955394",
"0.5945795",
"0.59189653",
"0.5903233",
"0.588819",
"0.5877357",
"0.5869024",
"0.5868138",
... | 0.7133353 | 0 |
Determine if the given point, which is an end point of a sequence, is the end point of a winning sequence of chips | def winning_end_point?(point, num_to_win)
x = point[0]
y = point[1]
dir = point[2]
chip = get_chip_at(x, y)
delta = @DIR_DELTAS[dir]
count = 1
1.upto(num_to_win - 1) do |i|
check_x = x + (i * delta[0])
check_y = y + (i * delta[1])
if in_bounds?(check_x, check_y) && get_chip... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_obstructed?(start_point, end_point)\n\t\terror_msg = \"Invalid input. Not diagonal, horizontal, or vertical\"\n\n\t\t# Define starting and ending coordinates for pieces\n\t\tstart_x, start_y = start_point\n\t\tend_x, end_y = end_point\n\n\t\t# Determine if piece is moving vertically, x coordinates being th... | [
"0.69955385",
"0.6958027",
"0.68983555",
"0.67728853",
"0.6662118",
"0.66382575",
"0.65926164",
"0.64591473",
"0.6443716",
"0.6442097",
"0.6390122",
"0.63873357",
"0.6360482",
"0.63402694",
"0.6256101",
"0.62452847",
"0.6235443",
"0.6209122",
"0.6188691",
"0.61872816",
"0.617... | 0.78859764 | 0 |
Does not check that the position is empty | def set_chip_at!(x, y, chip)
@grid[y][x] = chip
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty?(pos)\n self[pos].empty?\n end",
"def empty?(pos)\n self[pos].empty?\n end",
"def empty?(pos)\n self[pos].nil?\n end",
"def empty?(pos)\n self[pos] == nil\n end",
"def empty?(position)\n self[position].value == 0\n end",
"def empty_slot\n @positions.index {|i| i.nil... | [
"0.78803426",
"0.783546",
"0.7816148",
"0.7732",
"0.7611996",
"0.75667316",
"0.7501292",
"0.7488393",
"0.7443038",
"0.74093497",
"0.733022",
"0.72377616",
"0.72160596",
"0.7190721",
"0.71487993",
"0.7109758",
"0.70182526",
"0.70156455",
"0.69657904",
"0.6962473",
"0.69501436"... | 0.0 | -1 |
Converts an array of either 'x', 'o', or nil into a displayable string | def display_row(row)
# Replace nils with space
no_nils = row.map do |chip|
if chip.nil?
# Columns are two characters wide to handle double-digit column
# numbers
" "
else
if chip == 'x'
" " + chip.red
else
" " + chip.blue
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n array.map { |x| x.map { |y| y.zero? ? ' ' : '█' }.join }.join(\"\\n\")\n end",
"def convert_guesses_to_str(arr)\n str = \"\"\n arr.each do |char|\n if char.nil?\n str << \"_\"\n else\n str << char\n end\n end\n str\nend",
"def join_strings_reject_empty(display_array, separ... | [
"0.7002395",
"0.6579814",
"0.65276605",
"0.6225498",
"0.60497326",
"0.6045464",
"0.6034383",
"0.60276824",
"0.6001701",
"0.5979208",
"0.5973803",
"0.5956195",
"0.59230185",
"0.5913918",
"0.5907395",
"0.5897484",
"0.5884931",
"0.58663195",
"0.585952",
"0.58476067",
"0.58222824... | 0.56561303 | 29 |
The string representing the display of the column numbers | def column_numbers_string
normalize_widths = (1..@width).to_a.map do |num|
# If the column number is 1 digit, put a space in front of it
if num > 9
num.to_s
else
" " + num.to_s
end
end
normalize_widths.join('|')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def col(num)\n \"#{27.chr}[3#{num.to_s}m\"\nend",
"def column_header\n (0..upper_bound_x+1)\n .to_a\n .map { |num| num.to_s.rjust((upper_bound_y + 1).to_s.size,'0')}\n .map { |num| num.chars }\n .transpose\n .map { |num| num.join }\n .map { |num| num.rjust(num.size + 5,\" \") }\... | [
"0.7418365",
"0.7326004",
"0.72353595",
"0.71211386",
"0.7110258",
"0.70543796",
"0.701946",
"0.7001598",
"0.6943218",
"0.6865305",
"0.6848023",
"0.6826987",
"0.68131703",
"0.67986625",
"0.6690474",
"0.66486806",
"0.66485494",
"0.6645692",
"0.66343397",
"0.66241103",
"0.66025... | 0.82369345 | 0 |
=> bird Reflection I started to understand what James told me. I had never played boggle board before. This started to make sense Part 2: Write a method that takes a row number and returns all the elements in the row. Pseudocode define a method called row that takes the parameters board and row the method will take row... | def get_row(row,board) # row(x,*y)
board[row]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_row(row,board)\n return board[row] \nend",
"def get_row(board, row)\n return board[row]\nend",
"def get_row(board, row)\n board[row]\nend",
"def get_row(board, row)\n board[row]\nend",
"def get_row(board,row)\n\treturn board[row]\nend",
"def get_row(board, row)\n\tboard[row]\nend",
"def ... | [
"0.83422846",
"0.82192457",
"0.8204516",
"0.8204516",
"0.7987279",
"0.7973894",
"0.79043615",
"0.7758191",
"0.76202047",
"0.7565667",
"0.7520509",
"0.75092447",
"0.73850787",
"0.728682",
"0.72866213",
"0.7250632",
"0.7248611",
"0.7235055",
"0.7235055",
"0.7041446",
"0.6896862... | 0.83176666 | 1 |
=> ["i", "o", "d", "t"] Reflection We changed the name to boggle_board to make it make sense. This test returns the entire row Part 3: Now write a method that takes a column number and returns all the elements in the column. Pseudocode Part 3: write a method that takes a column number and returns a new array with all o... | def get_col(col, boggle_board)
boggle_board.map {|x| x.fetch(col)} # so the .fetch method calls the index of each sub-array.
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_col(col)\n boggle_board = [\n\t \t\t\t\t[\"b\", \"r\", \"a\", \"e\"],\n\t [\"i\", \"o\", \"d\", \"t\"],\n\t [\"e\", \"c\", \"l\", \"r\"],\n\t [\"t\", \"a\", \"k\", \"e\"]\n\t \t\t\t\t\t\t\t]\ncol_arr = []\nrow_num = boggle_board.length\nrow_num.times ... | [
"0.7472763",
"0.7322576",
"0.7056434",
"0.69773775",
"0.6974658",
"0.69436157",
"0.692507",
"0.6903074",
"0.68925345",
"0.68364865",
"0.6745783",
"0.6733427",
"0.6732605",
"0.6709573",
"0.66998535",
"0.6695616",
"0.66055393",
"0.65805036",
"0.65597886",
"0.65588933",
"0.65537... | 0.6517998 | 25 |
Take care of the changes in the font_awsome icon names. Now, instead of "iconsomething" we must return "fa fasomething" | def the_icon
icon.sub(/^icon\-/, 'fa fa-')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def iconify (icon_name) # currently action_name (preferred as more specific) or controller_name \n icon_name_s = icon_name.to_s\n\n # logger.debug(\"SessionsHelper: Icon_array: #{Icon_array.inspect}, Icon_hash: #{Icon_hash.inspect}\")\n\n case \n when Icon_array.index(icon_name_s) then\n kla... | [
"0.7373603",
"0.6882922",
"0.6592968",
"0.6517975",
"0.6445371",
"0.64206636",
"0.639481",
"0.6336134",
"0.63056326",
"0.6246027",
"0.6245383",
"0.6203799",
"0.61436456",
"0.6132929",
"0.61225474",
"0.6119426",
"0.60747045",
"0.6070015",
"0.6058797",
"0.60353404",
"0.6027202"... | 0.74090815 | 0 |
Instance Methods Verify all of the audit's design checks. :callseq: verify_all_checks() > boolean Set all design check results, both self and peer, to 'Verified' and set the audit's state variables to indicate that the audit is complete. | def verify_all_checks
now = Time.now
self.trim_checklist_for_design_type
self.design_checks each do | design_check |
if design_check.check.is_peer_check?
design_check.auditor_result = 'Verified'
design_check.auditor_checked_on = now
end
if design_check.check.is_se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify\n\t\t#puts \"INSIDE DEF: vERIFY IN ORDER CONCERN.\"\n\t\tself.reports.each do |report|\n\t\t\treport.a_test_was_verified = false\n\t\t\tif report.consider_for_processing?(self.history_tags)\n\t\t\t#puts \"checking report: #{report.name}\"\n\t\t\t#puts \"report verify all is: #{report.verify_all},,, #{Di... | [
"0.6584456",
"0.6499969",
"0.6109346",
"0.56838506",
"0.5649918",
"0.56274796",
"0.5605371",
"0.5497898",
"0.54755086",
"0.5421821",
"0.5372998",
"0.5370191",
"0.53474885",
"0.53420305",
"0.5315498",
"0.5247397",
"0.522044",
"0.5207043",
"0.5205145",
"0.5190862",
"0.5156672",... | 0.807409 | 0 |
Reset all of the audit's design checks. :callseq: clear_all_checks() > boolean Set all design check results, both self and peer, to 'None' and reset the audit's state variables. | def clear_all_checks
self.trim_checklist_for_design_type
self.design_checks.each do | design_check |
design_check.auditor_result = 'None' #if design_check.check.is_peer_check?
design_check.designer_result = 'None' #if design_check.check.is_self_check?
design_check.save
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset\n self.skip = false\n self.designer_complete = false\n self.designer_completed_checks = 0\n self.auditor_complete = false\n self.auditor_completed_checks = 0\n self.save\n\n now = Time.now\n self.design_checks.each do |design_check|\n de... | [
"0.7219865",
"0.6921075",
"0.6740429",
"0.671229",
"0.6416154",
"0.6362735",
"0.62930495",
"0.629212",
"0.6248875",
"0.6084076",
"0.5931339",
"0.59183735",
"0.5857863",
"0.5857863",
"0.5739948",
"0.57396233",
"0.57393664",
"0.57200783",
"0.5675604",
"0.5634235",
"0.56165165",... | 0.80160457 | 0 |
Force a skip of a setup audit :callseq: force_skip_audit() => status message Delete all the audit checks and set the audit to skipped If auditor_completed_checks == 0 | def force_skip_audit
msg = "Can't force skip because audit has started"
return msg if self.designer_completed_checks != 0
msg = ""
ok = true
self.trim_checklist_for_design_type
self.design_checks.each do | design_check |
unless design_check.delete
msg += "Can't delete... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def without_auditing(&block)\n auditing_was_enabled = auditing_enabled\n disable_auditing\n block.call\n ensure\n enable_auditing if auditing_was_enabled\n end",
"def without_auditing\n auditing_was_enabled = auditing_enabled\n disable_auditing\n ... | [
"0.6060189",
"0.58660007",
"0.57881534",
"0.5716922",
"0.56553847",
"0.5644383",
"0.56098855",
"0.5591979",
"0.557069",
"0.5518814",
"0.541093",
"0.5366112",
"0.5364395",
"0.5356335",
"0.5285416",
"0.51984465",
"0.5195033",
"0.5171951",
"0.5140851",
"0.51294315",
"0.5119368",... | 0.8621508 | 0 |
Report the status of the audit. :callseq: audit_state() > integer Returns one of the following values that indicate the state of the audit. Audit::SELF_AUDIT:: the audit is in the self audit state Audit::PEER_AUDIT:: the audit is in the peer audit state Audit::AUDIT_COMPLETE:: the audit is complete | def audit_state
return SELF_AUDIT unless self.designer_complete?
return PEER_AUDIT unless self.auditor_complete?
return AUDIT_COMPLETE
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def audit_status(sequence)\n context = sequence.context\n title = context.decommission? ? 'decommission ' : ''\n title += context.succeeded ? 'completed' : 'failed'\n context.audit.update_status(\"#{title}: #{context.payload}\")\n true\n rescue Exception => e\n Log.error(Log.format... | [
"0.5885777",
"0.587853",
"0.5848738",
"0.5825476",
"0.57141376",
"0.56842643",
"0.55244106",
"0.547562",
"0.5433565",
"0.52672523",
"0.5185326",
"0.5163672",
"0.5147645",
"0.51327235",
"0.5127956",
"0.51149356",
"0.511089",
"0.5110627",
"0.5079238",
"0.5079238",
"0.5065885",
... | 0.71364576 | 0 |
is_self_audit? Description: This method determines if the audit is a self audit. Parameters: None Return value: TRUE if the audit is in the SELF_AUDIT state, FALSE otherwise. | def is_self_audit?
self.audit_state == SELF_AUDIT
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def self_update?(user)\n self.is_self_audit? && self.is_self_auditor?(user)\n end",
"def is_self_auditor?(user)\n (self.design.designer_id == user.id ||\n self.audit_teammates.detect { |t| t.user_id == user.id && t.self? })\n end",
"def set_is_accessing_self\n @is_accessing_self = (\n u... | [
"0.71803844",
"0.707266",
"0.6171357",
"0.6123573",
"0.5959105",
"0.5764502",
"0.5721102",
"0.57035506",
"0.56125695",
"0.5439506",
"0.5358177",
"0.5348918",
"0.53347695",
"0.53278077",
"0.52399904",
"0.52349955",
"0.5205808",
"0.5158221",
"0.51486117",
"0.5120224",
"0.509889... | 0.86600584 | 0 |
is_peer_audit? Description: This method determines if the audit is a peer audit. Parameters: None Return value: TRUE if the audit is in the PEER_AUDIT state, FALSE otherwise. | def is_peer_audit?
self.audit_state == PEER_AUDIT
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_peer_auditor?(user)\n (self.design.peer_id == user.id ||\n self.audit_teammates.detect { |t| t.user_id == user.id && !t.self? })\n end",
"def peer_update?(user)\n self.is_peer_audit? && self.is_peer_auditor?(user)\n end",
"def is_self_audit?\n self.audit_state == SELF_AUDIT\n end",
"de... | [
"0.73330075",
"0.7232444",
"0.62496156",
"0.60884947",
"0.56724846",
"0.5597915",
"0.5595024",
"0.5595009",
"0.5467834",
"0.54121834",
"0.54121834",
"0.537874",
"0.5326348",
"0.5291402",
"0.5287577",
"0.49888662",
"0.49303117",
"0.48784524",
"0.4874322",
"0.48648852",
"0.4852... | 0.88995993 | 0 |
is_complete? Description: This method determines if the audit is complete. Parameters: None Return value: TRUE if the audit is in the AUDIT_COMPLETE state, FALSE otherwise. | def is_complete?
self.audit_state == AUDIT_COMPLETE
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_complete?\n return ApprovalState::COMPLETED_STATES.include? self.status.to_i\n end",
"def complete?\r\n @is_complete\r\n end",
"def complete?\n return state == \"complete\"\n end",
"def complete?\n status == \"Completed\"\n end",
"def is_complete?\n ... | [
"0.7310249",
"0.7194396",
"0.7101261",
"0.7079849",
"0.7049138",
"0.69464886",
"0.6926913",
"0.680255",
"0.67890316",
"0.6760755",
"0.6687264",
"0.6642547",
"0.66112334",
"0.6608648",
"0.66084236",
"0.65580475",
"0.65580475",
"0.65569997",
"0.647354",
"0.64700705",
"0.644271"... | 0.90991366 | 0 |
is_self_auditor? Description: This method determines if the user is a self auditor. Parameters: user A User record for the person this method is checking to if the person is on the self audit team. Return value: TRUE if the user is on the self audit team, FALSE otherwise. | def is_self_auditor?(user)
(self.design.designer_id == user.id ||
self.audit_teammates.detect { |t| t.user_id == user.id && t.self? })
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def self_update?(user)\n self.is_self_audit? && self.is_self_auditor?(user)\n end",
"def is_self_audit?\n self.audit_state == SELF_AUDIT\n end",
"def is_peer_auditor?(user)\n (self.design.peer_id == user.id ||\n self.audit_teammates.detect { |t| t.user_id == user.id && !t.self? })\n end",
"de... | [
"0.76193017",
"0.7221138",
"0.6784522",
"0.6218802",
"0.6115417",
"0.6072813",
"0.6003871",
"0.5956692",
"0.589647",
"0.5870371",
"0.58407885",
"0.57952553",
"0.57952553",
"0.57952553",
"0.57933366",
"0.5755613",
"0.5734781",
"0.57263815",
"0.5712257",
"0.5712257",
"0.5712257... | 0.85235447 | 0 |
is_peer_auditor? Description: This method determines if the user is a peer auditor. Parameters: user A User record for the person this method is checking to if the person is on the peer audit team. Return value: TRUE if the user is on the peer audit team, FALSE otherwise. | def is_peer_auditor?(user)
(self.design.peer_id == user.id ||
self.audit_teammates.detect { |t| t.user_id == user.id && !t.self? })
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peer_update?(user)\n self.is_peer_audit? && self.is_peer_auditor?(user)\n end",
"def is_peer_audit?\n self.audit_state == PEER_AUDIT\n end",
"def is_self_auditor?(user)\n (self.design.designer_id == user.id ||\n self.audit_teammates.detect { |t| t.user_id == user.id && t.self? })\n end",
... | [
"0.7833702",
"0.7185923",
"0.67568946",
"0.6548543",
"0.61751485",
"0.6126878",
"0.6114919",
"0.59587806",
"0.57193774",
"0.5633051",
"0.5629759",
"0.55728513",
"0.5566296",
"0.5532504",
"0.5457554",
"0.54176825",
"0.54096586",
"0.54083866",
"0.5401223",
"0.5376232",
"0.53520... | 0.8658108 | 0 |
create_checklist Description: This method creates a new checklist at the kick off of a Peer Audit Revew. Parameters: None | def create_checklist
self.checklist.each_check do |check|
DesignCheck.add(self, check) if check.belongs_to?(self.design)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @checklist = Checklist.new(checklist_params)\n @checklist.user_id = current_user.id\n @checklist.completed = false\n if @checklist.save\n redirect_to '/checklists/index'\n else\n redirect_to '/checklists/new'\n flash[:notice] = \"Error saving your Task. Task name is blank... | [
"0.6959407",
"0.67461205",
"0.6702515",
"0.66835934",
"0.6410932",
"0.638234",
"0.63450277",
"0.63162094",
"0.62904406",
"0.6286196",
"0.627621",
"0.61722136",
"0.60447544",
"0.6021695",
"0.59950286",
"0.5971572",
"0.59643537",
"0.59419054",
"0.59075487",
"0.5853385",
"0.5808... | 0.7249017 | 0 |
update_checklist_type Description: This method creates or destroys design checks based on the type of design the audit is tied to. This is used when the type of design is changed. Parameters: None Returns: The number of design checks added or deleted. | def update_checklist_type
design_checks = DesignCheck.find(:all, :conditions => "audit_id=#{self.id}")
delta = 0
# Keep track of the completed checks that are deleted to update the
# audit counts of the completed checks.
completed_self_check_delta = 0
completed_peer_audit_delta = 0
sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_checklist_type\n @checklist_type = ChecklistType.find(params[:id])\n end",
"def increment_checklist_counters(checklist, increment)\n\n checklist = [checklist] if checklist.class == Check\n\n checklist.each do |check|\n\n if check.designer_auditor?\n self.designer_auditor_count ... | [
"0.6074705",
"0.6022533",
"0.5938901",
"0.5780847",
"0.5608492",
"0.55065405",
"0.52933323",
"0.5276897",
"0.52163076",
"0.51878375",
"0.5108334",
"0.50785595",
"0.5058037",
"0.50099957",
"0.4991524",
"0.498579",
"0.4968399",
"0.49548343",
"0.49548343",
"0.49512842",
"0.49092... | 0.8120455 | 0 |
check_count Description: This method returns the number of checks for the designer and the peer based on the design type. Parameters: None | def check_count
count = { :designer => 0, :peer => 0 }
checklist = self.checklist
case self.design.design_type
when 'New'
count[:designer] = checklist.new_design_self_check_count
count[:peer] = checklist.new_design_peer_check_count
when 'Dot Rev'
count[:designer] = checkl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peer_check_count\n \n checklist = self.checklist\n\n case self.design.design_type\n when 'New'\n checklist.new_design_peer_check_count\n when 'Dot Rev'\n checklist.bareboard_design_peer_check_count\n end\n\n end",
"def compute_check_counts\n \n self.new_design_self_check_coun... | [
"0.7972903",
"0.7433278",
"0.7424092",
"0.73984426",
"0.7382588",
"0.73762643",
"0.707435",
"0.6605191",
"0.6600599",
"0.6519967",
"0.6175891",
"0.6163186",
"0.6123195",
"0.61077875",
"0.59730303",
"0.5871787",
"0.58130306",
"0.5792625",
"0.5782108",
"0.5770936",
"0.57263905"... | 0.81009585 | 0 |
peer_check_count Description: This method returns the number of checks for the peer audit team based on the design type. Parameters: None | def peer_check_count
checklist = self.checklist
case self.design.design_type
when 'New'
checklist.new_design_peer_check_count
when 'Dot Rev'
checklist.bareboard_design_peer_check_count
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def partial_review_peer_check_count\n check_count = 0\n self.sections.each do |s|\n next if !s.dot_rev_check?\n s.subsections.each do |ss|\n next if !ss.dot_rev_check?\n ss.checks.each { |c| check_count += 1 if c.bare_board_design_check? && c.is_peer_check? }\n end\n end\n ... | [
"0.7420237",
"0.72616684",
"0.7244692",
"0.6776612",
"0.67229235",
"0.65658",
"0.6338006",
"0.6153179",
"0.6047396",
"0.580333",
"0.5786069",
"0.56681806",
"0.5646792",
"0.55845916",
"0.5567173",
"0.5481626",
"0.5476395",
"0.5447165",
"0.5417821",
"0.5395046",
"0.53931427",
... | 0.804705 | 0 |
peer_percent_complete Description: This method returns percent complete statistics for the peer audit team. Parameters: None | def peer_percent_complete
if !self.peer_check_count.blank?
if self.auditor_completed_checks <= self.peer_check_count
self.auditor_completed_checks * 100.0 / self.peer_check_count
else
100.0
end
else
0
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def percent_complete\n @percent_complete ||= calculate_percent_complete\n end",
"def percent_complete\n (accepted_points.to_f / total_points * 100.0).round(1)\n end",
"def complete_percent\n if learner\n # check if this is a reportable thing, if not then base the percent on the existance of... | [
"0.6794197",
"0.6770791",
"0.67141503",
"0.6638751",
"0.6638751",
"0.65838665",
"0.6581005",
"0.6573064",
"0.6507677",
"0.65068793",
"0.640853",
"0.6378715",
"0.6336408",
"0.6287042",
"0.62723756",
"0.6231024",
"0.6227938",
"0.6213347",
"0.61001575",
"0.6065683",
"0.6042902",... | 0.80035615 | 0 |
self_check_count Description: This method returns the number of checks for the self audit team based on the design type. Parameters: None | def self_check_count
checklist = self.checklist
case self.design.design_type
when 'New'
checklist.new_design_self_check_count
when 'Dot Rev'
checklist.bareboard_design_self_check_count
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_review_self_check_count\n check_count = 0\n self.sections.each do |s|\n next if !s.full_review?\n s.subsections.each do |ss|\n next if !ss.full_review?\n ss.checks.each { |c| check_count += 1 if c.new_design_check? && c.is_self_check? }\n end\n end\n check_count\n ... | [
"0.7154113",
"0.70908964",
"0.6868443",
"0.66528547",
"0.66268724",
"0.6489431",
"0.63244766",
"0.6269248",
"0.6214885",
"0.6171722",
"0.5997929",
"0.5908064",
"0.58912665",
"0.57739574",
"0.576309",
"0.56996447",
"0.5661268",
"0.5616212",
"0.55984974",
"0.54475963",
"0.54163... | 0.80219156 | 0 |
self_percent_complete Description: This method returns percent complete statistics for the self audit team. Parameters: None | def self_percent_complete
if !self.self_check_count.blank?
if self.designer_completed_checks <= self.self_check_count
self.designer_completed_checks * 100.0 / self.self_check_count
else
100.0
end
else
0
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def percent_complete\n @percent_complete ||= calculate_percent_complete\n end",
"def percent_complete\n self.completeness_score.to_f / self.class.max_completeness_score.to_f * 100\n end",
"def percent_complete\n self.completeness_score.to_f / self.class.max_completeness_score.to_f * 10... | [
"0.6879627",
"0.6586499",
"0.6586499",
"0.64555454",
"0.64424866",
"0.6355683",
"0.62882155",
"0.62703425",
"0.6247535",
"0.6212233",
"0.61718976",
"0.60849243",
"0.60796547",
"0.6056718",
"0.6040961",
"0.60308605",
"0.60138506",
"0.59420717",
"0.59419566",
"0.580712",
"0.576... | 0.72732246 | 0 |
completion_stats Description: This method returns percent complete statistics for the self and peer audit. Parameters: None | def completion_stats
stats = { :self => "0.0", :peer => "0.0" }
total_checks = self.check_count
if total_checks[:designer] > 0
stats[:self] = self.designer_completed_checks * 100.0 / total_checks[:designer]
end
if total_checks[:peer] > 0
stats[:peer] = self.auditor_completed_chec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def profile_completion\n percentage = 0\n percentage += 25 if self.full_name.present?\n percentage += 25 if self.has_avatar? and self.city\n percentage += 25 if self.subjects.any?\n percentage += 25 if self.favorites.any?\n percentage\n end",
"def profile_completion_score\n attrs = [:name, ... | [
"0.67217046",
"0.650833",
"0.64723676",
"0.64723676",
"0.64464945",
"0.6444201",
"0.64050275",
"0.6359705",
"0.6340494",
"0.6303261",
"0.6274393",
"0.61885756",
"0.61724955",
"0.6129189",
"0.6087565",
"0.6077359",
"0.60079527",
"0.60042685",
"0.5975852",
"0.590973",
"0.590971... | 0.7693727 | 0 |
completed_self_audit_check_count Description: This method provides the number of self audit design checks that have been completed for the subsection. Parameters: subsection the subsection record that is used to group the design checks. | def completed_self_audit_check_count(subsection)
design_checks = []
self.design_checks.each { |dc| design_checks << dc if dc.self_auditor_checked? }
design_checks.delete_if do |dc|
check = Check.find(dc.check_id)
!subsection.checks.include?(check)
end
design_checks.size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def completed_peer_audit_check_count(subsection)\n\n design_checks = []\n self.design_checks.each { |dc| design_checks << dc if dc.peer_auditor_checked? }\n design_checks.delete_if do |dc| \n check = Check.find(dc.check_id)\n !subsection.checks.include?(check) \n end\n\n design_checks.size... | [
"0.7040738",
"0.63952845",
"0.6390976",
"0.61057913",
"0.60787535",
"0.59616363",
"0.5661769",
"0.54449093",
"0.54058945",
"0.5273259",
"0.5273032",
"0.5166041",
"0.5119747",
"0.51034707",
"0.50583297",
"0.49980456",
"0.49592283",
"0.4957053",
"0.4905644",
"0.48934555",
"0.48... | 0.78984094 | 0 |
completed_check_count Description: Returns the number of design checks that are completed for both the self and peer audit. Parameters: None | def completed_check_count
count = { :self => 0, :peer => 0 }
self.checklist.each_check do |check|
design_check = self.design_checks.detect { |dc| dc.check_id == check.id }
next if !design_check
count[:self] += 1 if design_check.self_auditor_checked?
count[:peer] += 1 if design_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def complete_check_count\r\n check_number = []\r\n self.jobs.each do |job|\r\n if job.job_status = JobStatus::COMPLETED\r\n check_number << job.check_number\r\n end\r\n end\r\n check_number.uniq!\r\n if check_number.nil?\r\n return 0\r\n else\r\n return check_number.si... | [
"0.6896412",
"0.6630502",
"0.65999764",
"0.6568564",
"0.6562039",
"0.6400344",
"0.63444597",
"0.6331304",
"0.6273334",
"0.62706614",
"0.6234876",
"0.6078225",
"0.6076779",
"0.60607046",
"0.60093164",
"0.5979473",
"0.59380466",
"0.58988506",
"0.58948797",
"0.5874825",
"0.58677... | 0.8069459 | 0 |
completed_peer_audit_check_count Description: This method provides the number of peer audit design checks that have been completed for the subsection. Parameters: subsection the subsection record that is used to group the design checks. | def completed_peer_audit_check_count(subsection)
design_checks = []
self.design_checks.each { |dc| design_checks << dc if dc.peer_auditor_checked? }
design_checks.delete_if do |dc|
check = Check.find(dc.check_id)
!subsection.checks.include?(check)
end
design_checks.size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def completed_self_audit_check_count(subsection)\n\n design_checks = []\n self.design_checks.each { |dc| design_checks << dc if dc.self_auditor_checked? }\n design_checks.delete_if do |dc| \n check = Check.find(dc.check_id)\n !subsection.checks.include?(check)\n end\n\n design_checks.size\... | [
"0.68276036",
"0.6194622",
"0.6149812",
"0.6142044",
"0.57348794",
"0.56564337",
"0.53120375",
"0.5209317",
"0.5141689",
"0.5118171",
"0.49845767",
"0.49347854",
"0.49154055",
"0.48478177",
"0.48362648",
"0.48141608",
"0.4734473",
"0.47299317",
"0.46910343",
"0.46813583",
"0.... | 0.7659594 | 0 |
user_complete?(user) Description: Checks to see if the logged in user has finished all assigned checks Parameters: user a user record that identifies the person who is logged in. Return value: true if user has finished all checks | def completed_user?(user)
incomplete = false;
self.design_checks.each do | dsn_chk |
section = dsn_chk.check.section
if ( self.is_self_audit? && dsn_chk.designer_result == "None" )
auditor = self.audit_teammates.detect { |tmate|
tmate.section_id == section.id && tmate.self? }... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_if_completed(user)\n\n \tlogger.info(\"Checking completion for workout \" + id.to_s + \" by user \" + user.name.to_s)\n\n \tif complete?(user) # If a CompletedWorkout exists already, no further action\n \t\tlogger.info(\"Already completed\")\n \t\treturn false\n elsif self.workout_exercises.map {... | [
"0.8090364",
"0.798528",
"0.74487805",
"0.7429293",
"0.73720896",
"0.71534544",
"0.71012014",
"0.686356",
"0.6855692",
"0.6757829",
"0.6738324",
"0.67283577",
"0.67279786",
"0.67218083",
"0.6615237",
"0.661009",
"0.660705",
"0.6595778",
"0.6534787",
"0.65179557",
"0.64928883"... | 0.81724215 | 0 |
get_section_teammate Description: Retrieves the teammate for the audit section. Parameters: section a record that identifies the section Return value: A user record for the teammate, if one exists. Otherwise a nil is returned. | def get_section_teammate(section)
teammate = self.audit_teammates.detect do |at|
at.section_id == section.id && at.self == (self.is_self_audit? ? 1 : 0)
end
# If a teammate was located, return the user record.
teammate ? teammate.user : nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peer_auditor(section)\n \n auditor = self.audit_teammates.detect { |tmate| tmate.section_id == section.id && !tmate.self? }\n\n if auditor \n return auditor.user\n elsif self.design.peer_id > 0\n return self.design.peer\n else\n nil\n end\n \n end",
"def self_auditor(sect... | [
"0.61885905",
"0.6084248",
"0.5469292",
"0.536348",
"0.52452046",
"0.52443224",
"0.49301338",
"0.48932308",
"0.4889791",
"0.48296943",
"0.47976226",
"0.4721242",
"0.47201762",
"0.47000128",
"0.46929687",
"0.46701804",
"0.4644869",
"0.46024892",
"0.45866132",
"0.45787904",
"0.... | 0.88291085 | 0 |
section_auditor? Description: Indicates that the user can perform the audit for the audit section. Parameters: section a record that identifies the section user a record that identifies the user Return value: TRUE the user can perform the audit for the section FALSE the user can not perform the audit for the section | def section_auditor?(section, user)
teammate = self.get_section_teammate(section)
if self.is_self_audit?
((!teammate && user.id == self.design.designer_id) || ( teammate && user == teammate))
else
(!self.is_complete? &&
((!teammate && user.id == self.design.peer_id) || ( teammate && use... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auditor(section)\n if self.is_self_audit?\n self.self_auditor(section)\n elsif self.is_peer_audit?\n self.peer_auditor(section)\n end\n end",
"def self_auditor(section)\n \n auditor = self.audit_teammates.detect { |tmate| tmate.section_id == section.id && tmate.self? }\n\n if au... | [
"0.7624841",
"0.68652344",
"0.6679002",
"0.6062383",
"0.5866006",
"0.56536853",
"0.55885243",
"0.5531798",
"0.5460906",
"0.5372858",
"0.5372549",
"0.53336203",
"0.522441",
"0.5174751",
"0.5113408",
"0.5095937",
"0.5095694",
"0.50938135",
"0.50862694",
"0.50343883",
"0.5023342... | 0.8168984 | 0 |
filtered_checklist Description: The method will removed sections and subsections based on whether the audit is a full, date code, or dot rev audit Parameters: user a user record that identifies the person who is logged in. Return value: The audit's checklist will be modified as described above. | def filtered_checklist(user)
sections = self.checklist.sections
if self.design.date_code?
sections.delete_if { |sec| !sec.date_code_check? }
sections.each do |section|
section.subsections.delete_if { |subsec| !subsec.date_code_check? }
end
elsif self.design.dot_rev?
sec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trim_checklist_for_design_type\n \n design = self.design\n \n # Remove the sections that are not used in the audit.\n self.checklist.sections.delete_if { |section| !design.belongs_to(section) }\n \n self.checklist.sections.each do |section|\n \n # Remove the subsections that ar... | [
"0.7281746",
"0.672191",
"0.6653163",
"0.52723205",
"0.5239235",
"0.51416266",
"0.5032237",
"0.5000088",
"0.489343",
"0.4887875",
"0.48694545",
"0.48439667",
"0.48284325",
"0.47998777",
"0.47926068",
"0.47844583",
"0.47682405",
"0.47666618",
"0.47439873",
"0.47439873",
"0.473... | 0.84733105 | 0 |
update_type Description: The method returns the update type based on the user and the state of the audit (self audit vs. peer audit). Parameters: user a user record that identifies the person who is logged in. Return value: A string that indicates the state of audit self, peer, or none | def update_type(user)
if (self.is_self_auditor?(user) && self.is_self_audit?)
:self
elsif (self.is_peer_auditor?(user) && self.is_peer_audit?)
:peer
else
:none
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_type(user)\n userExists = User.find_by_id(user.id)\n if userExists && user.permission_level == 1\n return \"Admin\"\n elsif userExists && user.permission_level == 0\n return \"Standard\"\n end\n end",
"def user_type\n @user_type || NORMAL_USER\n end",
"def check_user_typ... | [
"0.62694615",
"0.6245771",
"0.62322134",
"0.6138296",
"0.6057154",
"0.6055328",
"0.60336894",
"0.59539294",
"0.59170294",
"0.58988756",
"0.58041894",
"0.58040345",
"0.57792723",
"0.575903",
"0.56751",
"0.56468",
"0.56434035",
"0.55907404",
"0.55578184",
"0.55578184",
"0.55531... | 0.831728 | 0 |
self_update? Description: The method determines if the update that is being processed is a self audit update. Parameters: user a user record that identifies the person who is logged in. Return value: True if the update is to the self audit. Otherwise, false | def self_update?(user)
self.is_self_audit? && self.is_self_auditor?(user)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_self_audit?\n self.audit_state == SELF_AUDIT\n end",
"def is_self_auditor?(user)\n (self.design.designer_id == user.id ||\n self.audit_teammates.detect { |t| t.user_id == user.id && t.self? })\n end",
"def update?\n !record.private? || record.user_id == user.id || record.user_collaborator... | [
"0.7103459",
"0.70025706",
"0.67478323",
"0.6705855",
"0.6551936",
"0.646282",
"0.6437144",
"0.6415489",
"0.6415489",
"0.6415489",
"0.639112",
"0.63566947",
"0.6272746",
"0.622131",
"0.61881584",
"0.61810464",
"0.61643916",
"0.61629045",
"0.61463124",
"0.6144918",
"0.6133552"... | 0.89141107 | 0 |
peer_update? Description: The method determines if the update that is being processed is a peer audit update. Parameters: user a user record that identifies the person who is logged in. Return value: True if the update is to the peer audit. Otherwise, false | def peer_update?(user)
self.is_peer_audit? && self.is_peer_auditor?(user)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_peer_auditor?(user)\n (self.design.peer_id == user.id ||\n self.audit_teammates.detect { |t| t.user_id == user.id && !t.self? })\n end",
"def is_peer_audit?\n self.audit_state == PEER_AUDIT\n end",
"def updated_by?(peer)\n plan&.updated_by?(peer) || super\n end",
"def sel... | [
"0.7547791",
"0.71464",
"0.67264223",
"0.6643118",
"0.64644265",
"0.6446522",
"0.64387476",
"0.6415565",
"0.6134962",
"0.6103711",
"0.5946179",
"0.59050304",
"0.5902637",
"0.58939207",
"0.588088",
"0.58393365",
"0.5824501",
"0.57936114",
"0.5785359",
"0.577921",
"0.5773849",
... | 0.90806293 | 0 |
process_self_audit_update Description: The method processes self audit input. If the result is anything than "None" then the designer completed checks is incremented and the design_check.designer_result is updated with the new result. If the self audit is complete then email is sent indicating that the self audit is co... | def process_self_audit_update(result_update, design_check, user)
if design_check.designer_result == "None"
self.update_self_check_count
if self.designer_complete?
AuditMailer.self_audit_complete(self).deliver
AuditMailer.final_review_warning(self.design).deliver
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_peer_audit_update(result_update, comment, design_check, user)\n\n check = Check.find(design_check.check_id)\n return if check.check_type != 'designer_auditor'\n\n incr = design_check.update_auditor_result(result_update, user)\n\n if incr != 0\n self.update_peer_check_count(incr)\n ... | [
"0.7782529",
"0.69690746",
"0.63019794",
"0.6296653",
"0.58423847",
"0.5522571",
"0.5352337",
"0.53194577",
"0.5264874",
"0.5245003",
"0.51893634",
"0.51746404",
"0.51665664",
"0.5163645",
"0.5160046",
"0.512883",
"0.5040592",
"0.5038545",
"0.50108284",
"0.4990173",
"0.496895... | 0.891286 | 0 |
process_peer_audit_update Description: The method processes peer audit input. If the result is anything than "None" or "Comment then the auditor completed checks is incremented and the design_check.auditor_result is updated with the new result. If the peer audit is complete then email is sent indicating that the peer a... | def process_peer_audit_update(result_update, comment, design_check, user)
check = Check.find(design_check.check_id)
return if check.check_type != 'designer_auditor'
incr = design_check.update_auditor_result(result_update, user)
if incr != 0
self.update_peer_check_count(incr)
AuditMailer.p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_self_audit_update(result_update, design_check, user)\n\n if design_check.designer_result == \"None\"\n\n self.update_self_check_count\n \n if self.designer_complete?\n AuditMailer.self_audit_complete(self).deliver\n AuditMailer.final_review_warning(self.design).deliver\n ... | [
"0.73201686",
"0.6552961",
"0.5811057",
"0.5697863",
"0.55258775",
"0.5285233",
"0.51355827",
"0.5123371",
"0.502453",
"0.49804118",
"0.49606857",
"0.4898902",
"0.48851863",
"0.4815852",
"0.4815434",
"0.48150572",
"0.47943538",
"0.47349966",
"0.4714234",
"0.4700986",
"0.46922... | 0.8723285 | 0 |
manage_auditor_list Description: The method processes updates to the audit team. Audit Teammate records are added and removed from the database based on the user's input. Parameters: self_auditor_list a hash of self audit assignments. The hash is accessed by section ids (key) to provide the user of id of the self audit... | def manage_auditor_list(self_auditor_list, peer_auditor_list, user)
lead_designer_assignments = {}
self_auditor_list.each do |key, auditor|
lead_designer_assignments[key] = (self.design.designer_id == auditor.to_i)
end
lead_peer_assignments = {}
peer_auditor_list.each do |key, auditor|
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peer_auditor_list\n @peer_auditor_list ||= (self.self_auditor_list - [self.design.designer])\n end",
"def self_auditor_list\n @self_auditor_list ||= Role.active_designers\n end",
"def set_attendance_list\n @attendance_list = AttendanceList.find(params[:id])\n end",
"def commit_list!\n ... | [
"0.55654776",
"0.5404002",
"0.47908518",
"0.4780332",
"0.4750581",
"0.47018236",
"0.46998352",
"0.46871442",
"0.4681324",
"0.4654796",
"0.46026933",
"0.4597757",
"0.45790362",
"0.45784414",
"0.45542765",
"0.45342493",
"0.45329648",
"0.44960552",
"0.44531778",
"0.44431815",
"0... | 0.7977408 | 0 |
process_design_checks Description: Processes a list of design check updates. Processing is done for both the self and peer updates. Parameters: design_check_list a list of self or peer design check updates user the record for the user making the update Return value: None | def process_design_checks(design_check_list, user)
# Go through the paramater list and pull out the checks.
design_check_list.each { |design_check_update|
design_check = DesignCheck.find(design_check_update[:design_check_id])
if self.self_update?(user)
result = design_check.designe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_design_check(design_check_update, user)\n\n self.errors.clear\n \n self_audit_result = design_check_update[:designer_result]\n peer_audit_result = design_check_update[:auditor_result]\n\n updated = false\n design_check = DesignCheck.find(design_check_update[:design_check_id])\n if s... | [
"0.62288696",
"0.62206674",
"0.61443514",
"0.6093237",
"0.60488015",
"0.59101045",
"0.5738165",
"0.54554343",
"0.5289495",
"0.5268358",
"0.5122182",
"0.5102563",
"0.49853933",
"0.49252537",
"0.48998404",
"0.48677176",
"0.48005837",
"0.47935393",
"0.4721755",
"0.4706274",
"0.4... | 0.8699422 | 0 |
clear_message Description: The method clears all of the error messages Parameters: None Return value: None | def clear_message
errors.clear
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_error_message\n self[:error_message] = nil\n end",
"def clear_messages\n @messages.clear\n end",
"def clear\n messages.clear\n end",
"def clear\n messages.clear\n end",
"def clear_message\n @m.synchronize do\n @message=\"\"\n end\n end",
"def clear\n message... | [
"0.81312007",
"0.7757343",
"0.75382495",
"0.75382495",
"0.7430598",
"0.7219582",
"0.71442926",
"0.7089181",
"0.7080884",
"0.7034848",
"0.7022871",
"0.6994301",
"0.6982907",
"0.6972835",
"0.69557834",
"0.6942701",
"0.6905125",
"0.68664414",
"0.6750513",
"0.6628789",
"0.6547643... | 0.88045156 | 0 |
message? Description: The method indicates if there is an error message available for the object Parameters: None Return value: True if an error message exists. Otherwise False | def message?
#errors.on(:message) != nil
errors[:message] != nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error_message?\n true if message[:error]\n end",
"def error?\n !error.blank?\n end",
"def message\n @errormsg\n end",
"def error?\n error\n end",
"def error?\n message.fields[0] == 'WE'\n end",
"def error\n valid? ? nil : @error_message\n end",
... | [
"0.819331",
"0.724184",
"0.72230375",
"0.72055566",
"0.72016567",
"0.71871203",
"0.7177113",
"0.7177113",
"0.7147535",
"0.714722",
"0.70948154",
"0.7092029",
"0.7060361",
"0.7042574",
"0.7042574",
"0.70265615",
"0.699566",
"0.6962345",
"0.6962345",
"0.69618434",
"0.6951769",
... | 0.7799105 | 1 |
set_message Description: Creates or appends the message to the error message depending on the append flag Parameters: append a flag that indicates the message should be appended to any existing error message when True Return value: None | def set_message(message, append=false)
errors.clear if !append
errors.add(:message, message)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_error_message(msg)\n if self[:error_message]\n self[:error_message] += \"\\n\" + msg\n else\n self[:error_message] = msg\n end\n end",
"def append_error(msg)\n @errors.empty? ? @errors = msg : @errors << \"\\n\" + msg + \" \"\n end",
"def error_message=(value)\n @... | [
"0.7507533",
"0.67579305",
"0.6712861",
"0.66108036",
"0.6598495",
"0.6487644",
"0.6448188",
"0.642416",
"0.6362475",
"0.63257205",
"0.6164181",
"0.6163432",
"0.61415386",
"0.6136241",
"0.6117679",
"0.6117679",
"0.611264",
"0.6090513",
"0.60797435",
"0.6021499",
"0.60108167",... | 0.8696251 | 0 |
set_message Description: Returns the error message that is stored with the object Parameters: None Return value: A string representing the store error message. | def message
message = errors[:message]
if message.class == String
message
elsif message.class == Array
message.join
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error_message=(value)\n @error_message = value\n end",
"def set_error_message(msg)\n if self[:error_message]\n self[:error_message] += \"\\n\" + msg\n else\n self[:error_message] = msg\n end\n end",
"def error=(message)\n flash[:error] = message\n end",
"... | [
"0.7815961",
"0.70809066",
"0.6996685",
"0.6936512",
"0.69049186",
"0.68971807",
"0.6881638",
"0.6866692",
"0.68656474",
"0.6849735",
"0.6790259",
"0.6719108",
"0.6666595",
"0.665583",
"0.66168",
"0.6536342",
"0.6506166",
"0.644126",
"0.6428923",
"0.63983047",
"0.6380559",
... | 0.58984 | 89 |
update_self_check_count Description: Increments the designer (self) completed check count by count. If the caller does not specify the count then the increment is by 1. If another user has updated the record, the exception handler code is executed. The audit record is reloaded and the work is redone. Parameters: count ... | def update_self_check_count(count = 1)
begin
completed_checks = self.designer_completed_checks + count
self.designer_completed_checks = completed_checks
self.designer_complete = (completed_checks == self.self_check_count)
self.save
rescue ActiveRecord::StaleObjectError
self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_peer_check_count(count = 1)\n begin\n completed_checks = self.auditor_completed_checks + count\n self.auditor_completed_checks = completed_checks\n self.auditor_complete = (completed_checks == self.peer_check_count)\n self.save\n rescue ActiveRecord::StaleObjectError\n ... | [
"0.7185629",
"0.62458247",
"0.61473835",
"0.6137091",
"0.5927621",
"0.58863413",
"0.5803138",
"0.5772031",
"0.5719315",
"0.5703745",
"0.5698656",
"0.56968194",
"0.5672064",
"0.56703234",
"0.56530654",
"0.5629812",
"0.5625083",
"0.5597394",
"0.55886275",
"0.55690944",
"0.55641... | 0.8588637 | 0 |
update_peer_check_count Description: Increments the auditor (peer) completed check count by count. If the caller does not specify the count then the increment is by 1. If another user has updated the record, the exception handler code is executed. The audit record is reloaded and the work is redone. Parameters: count p... | def update_peer_check_count(count = 1)
begin
completed_checks = self.auditor_completed_checks + count
self.auditor_completed_checks = completed_checks
self.auditor_complete = (completed_checks == self.peer_check_count)
self.save
rescue ActiveRecord::StaleObjectError
self.re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_self_check_count(count = 1)\n begin\n completed_checks = self.designer_completed_checks + count\n self.designer_completed_checks = completed_checks\n self.designer_complete = (completed_checks == self.self_check_count)\n self.save\n rescue ActiveRecord::StaleObjectError... | [
"0.64491236",
"0.5769097",
"0.5491968",
"0.5401138",
"0.5337405",
"0.5257001",
"0.5230315",
"0.51845896",
"0.51773673",
"0.5172052",
"0.51625264",
"0.51509297",
"0.5140942",
"0.50756705",
"0.50756705",
"0.50756705",
"0.5075506",
"0.5075506",
"0.5065442",
"0.5036786",
"0.50367... | 0.8423388 | 0 |
Retrieve a list of designers eligible to perform a self audit. :callseq: self_audtor_list() > array The array returned contains a list of active designers. | def self_auditor_list
@self_auditor_list ||= Role.active_designers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @advisers = Adviser.reserved_by(current_user)\n end",
"def peer_auditor_list\n @peer_auditor_list ||= (self.self_auditor_list - [self.design.designer])\n end",
"def designs_on_subject_event(current_user)\n current_user.all_viewable_designs.where(id: required_design_ids)\n end",
"def a... | [
"0.5804556",
"0.5608351",
"0.555842",
"0.53983456",
"0.5382998",
"0.5209964",
"0.51941353",
"0.5179771",
"0.5176421",
"0.5153815",
"0.51471955",
"0.5144669",
"0.51184255",
"0.50984967",
"0.5042442",
"0.5037778",
"0.50302905",
"0.50167453",
"0.5011869",
"0.4993208",
"0.4985866... | 0.71451825 | 0 |
Retrieve a list of designers eligible to perform a peer audit. :callseq: peer_audtor_list() > array The array returned contains a list of active designers with the record for the lead designer removed. | def peer_auditor_list
@peer_auditor_list ||= (self.self_auditor_list - [self.design.designer])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def self_auditor_list\n @self_auditor_list ||= Role.active_designers\n end",
"def manage_auditor_list(self_auditor_list, peer_auditor_list, user)\n\n lead_designer_assignments = {}\n self_auditor_list.each do |key, auditor|\n lead_designer_assignments[key] = (self.design.designer_id == auditor.to_... | [
"0.59836775",
"0.5374741",
"0.5205044",
"0.50381577",
"0.48292655",
"0.48148066",
"0.4813114",
"0.47891292",
"0.477665",
"0.47704762",
"0.47187015",
"0.4701058",
"0.4679544",
"0.4660793",
"0.46024293",
"0.4600723",
"0.46002623",
"0.45722747",
"0.45557797",
"0.45457017",
"0.45... | 0.682048 | 0 |
Locate and remove any orphaned design checks associated with the audit :callseq: orphaned_design_checks Find all design checks that were incorrectly created and processed and remove them from the database. The design checks were created due to a bug that existed that blindly created design checks new designs. The progr... | def orphaned_design_checks
log = []
total_design_checks = self.design_checks.size
self.trim_checklist_for_design_type
self.get_design_checks
completed_check_counts = self.completed_check_count
attached_design_checks = []
self.checklist.each_check { |ch| attached_design_ch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_all_checks\n \n self.trim_checklist_for_design_type\n \n self.design_checks.each do | design_check |\n design_check.auditor_result = 'None' #if design_check.check.is_peer_check?\n design_check.designer_result = 'None' #if design_check.check.is_self_check?\n design_check.save\n... | [
"0.6878321",
"0.644792",
"0.6029625",
"0.59987485",
"0.5856365",
"0.5836254",
"0.58195305",
"0.57916266",
"0.5764896",
"0.5729196",
"0.5531073",
"0.5505768",
"0.5388969",
"0.52672315",
"0.5243826",
"0.52130437",
"0.5198636",
"0.51852036",
"0.51716334",
"0.5159058",
"0.5128487... | 0.853859 | 0 |
Trim sections, subsections, and checks from the audit that do not apply. :callseq: trim_checklist_for_design_type() > audit The resulting audit checklist contains only the sections, subsection, and checks that apply to the audit. | def trim_checklist_for_design_type
design = self.design
# Remove the sections that are not used in the audit.
self.checklist.sections.delete_if { |section| !design.belongs_to(section) }
self.checklist.sections.each do |section|
# Remove the subsections that are not used in ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trim_checklist_for_self_audit\n \n self.trim_checklist_for_design_type\n self.checklist.sections.each do |section|\n section.subsections.each do |subsection|\n subsection.checks.delete_if { |check| !check.is_self_check? }\n end\n end\n \n # Lop off any empty sections and subsections... | [
"0.7377257",
"0.7152503",
"0.67273176",
"0.56785786",
"0.5395446",
"0.5342728",
"0.51560295",
"0.48903516",
"0.48629618",
"0.46144742",
"0.46119577",
"0.45787132",
"0.4569715",
"0.45588794",
"0.4543003",
"0.44787788",
"0.4452496",
"0.44519925",
"0.4395279",
"0.43753695",
"0.4... | 0.86244565 | 0 |
Trim checks that do no apply to a self audit. :callseq: trim_checklist_for_self_audit() > audit The resulting audit checklist contains only the checks that apply to a self audit. | def trim_checklist_for_self_audit
self.trim_checklist_for_design_type
self.checklist.sections.each do |section|
section.subsections.each do |subsection|
subsection.checks.delete_if { |check| !check.is_self_check? }
end
end
# Lop off any empty sections and subsections
self.check... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trim_checklist_for_peer_audit\n \n self.trim_checklist_for_design_type\n \n self.checklist.sections.each do |section|\n section.subsections.each do |subsection|\n subsection.checks.delete_if { |check| !check.is_peer_check? }\n end\n end\n \n # Lop off any empty sections and... | [
"0.6914214",
"0.6763352",
"0.56618124",
"0.5584792",
"0.5568969",
"0.5548621",
"0.5153646",
"0.5019457",
"0.49921212",
"0.49414718",
"0.49133816",
"0.48760813",
"0.48436487",
"0.47674528",
"0.47194794",
"0.47058755",
"0.4646495",
"0.4642296",
"0.46375948",
"0.4637272",
"0.463... | 0.75251764 | 0 |
Trim checks that do no apply to a peer audit. :callseq: trim_checklist_for_peer_audit() > audit The resulting audit checklist contains only the checks that apply to a peer audit. | def trim_checklist_for_peer_audit
self.trim_checklist_for_design_type
self.checklist.sections.each do |section|
section.subsections.each do |subsection|
subsection.checks.delete_if { |check| !check.is_peer_check? }
end
end
# Lop off any empty sections and subsections
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trim_checklist_for_self_audit\n \n self.trim_checklist_for_design_type\n self.checklist.sections.each do |section|\n section.subsections.each do |subsection|\n subsection.checks.delete_if { |check| !check.is_self_check? }\n end\n end\n \n # Lop off any empty sections and subsections... | [
"0.6090341",
"0.6073866",
"0.56282514",
"0.55395806",
"0.5369361",
"0.52605385",
"0.49751198",
"0.4727788",
"0.4713315",
"0.46969235",
"0.46711776",
"0.46167788",
"0.46128556",
"0.4579494",
"0.45354754",
"0.45150936",
"0.45120683",
"0.45024008",
"0.44547457",
"0.44306517",
"0... | 0.76857066 | 0 |
Retrieve and load the associated design checks :callseq: get_design_checks() > audit Go through all of the checks in the check list and attach the associated design checks. | def get_design_checks
design_checks = self.design_checks # DesignCheck.find(:all, :conditions => "audit_id=#{self.id}")
self.checklist.each_check do |check|
design_check = design_checks.detect { |dc| dc.check_id == check.id }
check.design_check = design_check if design_check
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_checklist\n self.checklist.each_check do |check|\n DesignCheck.add(self, check) if check.belongs_to?(self.design)\n end\n end",
"def process_design_checks(design_check_list, user)\n\n # Go through the paramater list and pull out the checks.\n design_check_list.each { |design_check_up... | [
"0.61688733",
"0.6159678",
"0.61370844",
"0.59420407",
"0.5739586",
"0.5641711",
"0.5558204",
"0.55316067",
"0.55181766",
"0.5440599",
"0.54005146",
"0.5295585",
"0.52103585",
"0.51827425",
"0.51556486",
"0.51132435",
"0.51116794",
"0.5099165",
"0.5085456",
"0.50366855",
"0.5... | 0.7555783 | 0 |
Provide the user record of the self of peer auditor depending on the state of the audit (self or peer) :callseq: auditor(section) > user Returns the user record of the auditor assigned to perform the self or peer audit depending on the state of the audit. | def auditor(section)
if self.is_self_audit?
self.self_auditor(section)
elsif self.is_peer_audit?
self.peer_auditor(section)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peer_auditor\n if self.auditor_id > 0 \n User.find(self.auditor_id)\n else\n User.new(:first_name => 'Not', :last_name => 'Assigned')\n end\n rescue\n User.new(:first_name => 'Not', :last_name => 'Assigned')\n end",
"def audit_user\n user = ::Sequel::Auditer::Railtie.user\n\n m ... | [
"0.7146591",
"0.7128406",
"0.6950554",
"0.68971646",
"0.6556426",
"0.63785595",
"0.6322058",
"0.6100367",
"0.6021791",
"0.59962887",
"0.59388274",
"0.59335434",
"0.5911065",
"0.59091556",
"0.5877842",
"0.5853041",
"0.5853041",
"0.5853041",
"0.5842535",
"0.5842535",
"0.5833664... | 0.53937185 | 84 |
Retrieve the self auditor for the section. :callseq: self_audtor(section) > user If a self auditor for the section is assigned then the user record is returned. Otherwise the user record for the design's lead designer is returned. A nil is returned if none of the above conditions apply. | def self_auditor(section)
auditor = self.audit_teammates.detect { |tmate| tmate.section_id == section.id && tmate.self? }
if auditor
auditor.user
elsif self.design.designer_id > 0
self.design.designer
else
nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peer_auditor(section)\n \n auditor = self.audit_teammates.detect { |tmate| tmate.section_id == section.id && !tmate.self? }\n\n if auditor \n return auditor.user\n elsif self.design.peer_id > 0\n return self.design.peer\n else\n nil\n end\n \n end",
"def audit_user\n u... | [
"0.6805244",
"0.65489465",
"0.65027124",
"0.6397247",
"0.61712456",
"0.61267394",
"0.58275974",
"0.56747323",
"0.5580167",
"0.553661",
"0.55088955",
"0.5454845",
"0.5451303",
"0.54187346",
"0.54116416",
"0.532768",
"0.5268539",
"0.5266975",
"0.52649873",
"0.5256278",
"0.52479... | 0.7837695 | 0 |
Retrieve the peer auditor for the section. :callseq: peer_audtor(section) > user If a peer auditor for the section is assigned then the user record is returned. Otherwise the user record for the design's lead peer auditor is returned. A nil is returned if none of the above conditions apply. | def peer_auditor(section)
auditor = self.audit_teammates.detect { |tmate| tmate.section_id == section.id && !tmate.self? }
if auditor
return auditor.user
elsif self.design.peer_id > 0
return self.design.peer
else
nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def self_auditor(section)\n \n auditor = self.audit_teammates.detect { |tmate| tmate.section_id == section.id && tmate.self? }\n\n if auditor\n auditor.user\n elsif self.design.designer_id > 0 \n self.design.designer\n else\n nil\n end\n \n end",
"def peer_auditor\n if sel... | [
"0.6127",
"0.60913116",
"0.6061363",
"0.5898279",
"0.5701955",
"0.5526474",
"0.5281213",
"0.52197784",
"0.514169",
"0.5027586",
"0.4901541",
"0.484763",
"0.48453686",
"0.46024647",
"0.45789537",
"0.45630187",
"0.44613367",
"0.44599167",
"0.44307488",
"0.44170994",
"0.4410196"... | 0.8157328 | 0 |
Retrieve the next subsection in the audit. :callseq: next_subsection(subsection) > subsection Returns the next subsection in the current section. If the current subsection is the last subsection in the section then the first subsection in the next section is returned. If there is no section following the current sectio... | def next_subsection(subsection)
section = self.checklist.sections.detect { |s| s.id == subsection.section_id}
i = section.subsections.index(subsection)
if i < section.subsections.size - 1
return section.subsections[i+1]
else
j = self.checklist.sections.index(section)
if j < self.check... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_section\n @current_section = Elf.elf_nextscn(self,@current_section)\n\n if @current_section.null?\n @current_section = nil\n return nil\n else\n return Section.new(@current_section)\n end\n end",
"def previous_subsection(subsection)\n\n sect... | [
"0.6212567",
"0.6202977",
"0.5837008",
"0.58279705",
"0.5409986",
"0.5368312",
"0.5188212",
"0.5111534",
"0.50590956",
"0.5004826",
"0.4997997",
"0.48034775",
"0.4695796",
"0.4617244",
"0.46043184",
"0.45967197",
"0.45723164",
"0.45673156",
"0.45457244",
"0.44458914",
"0.4444... | 0.80032855 | 0 |
Retrieve the previous subsection in the audit. :callseq: previous_subsection(subsection) > subsection Returns the previous subsection in the current section. If the current subsection is the first subsection in the section then the last subsection in the previous section is returned. If there is no section preceeding t... | def previous_subsection(subsection)
section = self.checklist.sections.detect { |s| s.id == subsection.section_id}
i = section.subsections.index(subsection)
if i > 0
return section.subsections[i-1]
else
j = self.checklist.sections.index(section)
if j > 0
return self.checklist.s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def previous_segment\n return nil if sibling_segments.empty?\n index = sibling_segments.sort_by(&:index).index(self)\n if index && index >= 1\n sibling_segments[index - 1]\n else\n nil\n end\n end",
"def previous\n return nil if self.position == se... | [
"0.72019154",
"0.6917209",
"0.6449874",
"0.6325138",
"0.63048524",
"0.6269056",
"0.62513137",
"0.6216936",
"0.62134963",
"0.6204892",
"0.61930263",
"0.61930263",
"0.61928487",
"0.61722",
"0.61722",
"0.6165042",
"0.6163859",
"0.6163859",
"0.6163859",
"0.6163859",
"0.6163859",
... | 0.8618386 | 0 |
Update the audit's design check. :callseq: update_design_check(design_check_update, user) > nil Determine the type of update that was passed in, self or peer, and use the information to make the update to the stored design check. Also make sure that any update that requires a comment includes the comment. If a required... | def update_design_check(design_check_update, user)
self.errors.clear
self_audit_result = design_check_update[:designer_result]
peer_audit_result = design_check_update[:auditor_result]
updated = false
design_check = DesignCheck.find(design_check_update[:design_check_id])
if self_audit_resu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_design_checks(design_check_list, user)\n\n # Go through the paramater list and pull out the checks.\n design_check_list.each { |design_check_update|\n\n design_check = DesignCheck.find(design_check_update[:design_check_id])\n\n if self.self_update?(user)\n result = design_... | [
"0.68924505",
"0.67145604",
"0.6529874",
"0.5492405",
"0.53877777",
"0.53263074",
"0.52502906",
"0.5225508",
"0.5172312",
"0.5108325",
"0.50956374",
"0.5090034",
"0.5040326",
"0.49970606",
"0.49846634",
"0.4962878",
"0.49119034",
"0.48832065",
"0.48832065",
"0.48624545",
"0.4... | 0.84482545 | 0 |
Dump the audit and all of the associated design checks :callseq: dump_all() > [] Produces a dump of the audit. | def dump_all
puts "----------------------------------------------------------------------"
puts " AUDIT ID: #{self.id}\t\t\tDESIGN: #{self.design.directory_name}"
puts " DESIGN CHECKS: #{self.design_checks.size.to_s}"
puts " SELF COMPLETE: #{self.designer_complete?.to_s} " +
" #{self.desi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def report\n @audits = Audit.all\n end",
"def dump\n if @ctx.checks.one? && @ctx.checks.first.kind_of?(Pippi::Checks::MethodSequenceFinder)\n @ctx.checks.first.dump\n end\n @ctx.report.problems.each do |problem|\n @io.puts(problem.to_text)\n end\n end",
"def dump_constr... | [
"0.61115557",
"0.5804633",
"0.5565329",
"0.5524055",
"0.55108815",
"0.55030257",
"0.5493493",
"0.5473912",
"0.54305196",
"0.5425783",
"0.53497577",
"0.5334263",
"0.5326669",
"0.5318271",
"0.5287236",
"0.5287236",
"0.52622133",
"0.52340525",
"0.52322066",
"0.522991",
"0.521594... | 0.78779626 | 0 |
Reset the audit and all of the associated design checks :callseq: reset() > [] Updates the audit record to reset as well as all of the associated design check records. | def reset
self.skip = false
self.designer_complete = false
self.designer_completed_checks = 0
self.auditor_complete = false
self.auditor_completed_checks = 0
self.save
now = Time.now
self.design_checks.each do |design_check|
design_check.audi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_all_checks\n \n self.trim_checklist_for_design_type\n \n self.design_checks.each do | design_check |\n design_check.auditor_result = 'None' #if design_check.check.is_peer_check?\n design_check.designer_result = 'None' #if design_check.check.is_self_check?\n design_check.save\n... | [
"0.66611993",
"0.61918473",
"0.6183096",
"0.6132851",
"0.5958997",
"0.58916754",
"0.58646",
"0.5793568",
"0.5746999",
"0.569217",
"0.56858885",
"0.56740814",
"0.5667866",
"0.5663974",
"0.5640999",
"0.5633795",
"0.56178796",
"0.5615866",
"0.56094",
"0.558026",
"0.55690503",
... | 0.70912737 | 0 |
Generate an refund Use the payment of the transaction as refund money if amount is not explicitly specified | def generate_refund(transaction, amount = nil, options = {})
raise ArgumentError, "Invalid transaction state: #{transaction.state}" if transaction.state != "completed"
raise ArgumentError, "Transaction is not belongs to the order" if transaction.order != self
refunds.create(options.merge(amount: amount || ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refund(amount: nil)\n api_request(\"/charges/#{id}/refund\", :post, amount: amount)\n end",
"def refund(money, card, transaction_id, options = {})\n if options[:refund_all].present?\n transaction { refund_all(transaction_id) }\n else\n transaction do\n refun... | [
"0.81626946",
"0.7866774",
"0.77946806",
"0.7775884",
"0.7711419",
"0.76127017",
"0.7579566",
"0.754563",
"0.74864876",
"0.7464079",
"0.7425878",
"0.74201477",
"0.740215",
"0.7398038",
"0.7392138",
"0.73874223",
"0.73661244",
"0.7355082",
"0.73440325",
"0.73213184",
"0.729548... | 0.78723174 | 1 |
Bootstrap styled flash helper | def bootstrap_flash_tag
return if flash.blank?
css_mapping = {notice: 'success', alert: 'danger', info: 'info'}
[:notice, :alert, :info].select{|type| flash[type].present?}.inject("") do |result, type|
inner_html = content_tag(:a, "x", class: "close", :'data-dismiss' => 'alert', href: "#") + flash[typ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bootstrap_flash\n messages = flash.flat_map do |type, message|\n next if message.blank?\n\n type = type.to_sym\n type = :success if type == :notice\n type = :danger if type == :alert\n type = :danger if type == :error\n next unless ALERT_TYPES.include?(type)\n\n options = ... | [
"0.77248037",
"0.7688102",
"0.7604672",
"0.7584524",
"0.75765085",
"0.7574909",
"0.75630033",
"0.7493387",
"0.7485391",
"0.7485391",
"0.7465366",
"0.74259716",
"0.7422553",
"0.74125904",
"0.7397754",
"0.7323511",
"0.7318782",
"0.7299357",
"0.7289049",
"0.7276247",
"0.724479",... | 0.8084179 | 0 |
Displays a Bootstrap labeltag in green or red, depending on what +expression+ evaluates to. The default label content is 'Ja' or 'Nein' respectively and can be over === Parameters +expression+: determines green (truey) or red (falsey) label colour +value+: Alternative conditional output. Expected to be an Array like ['... | def boolean_label(expression, value = nil)
value = Array(value).compact
value = %w(Ja Nein) if value.empty?
value = expression ? value.first : value.last
content_tag :span, value, :class => "label label-#{expression ? 'success' : 'danger'}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def truth_label(is_true, true_label = 'true', false_label = 'false')\n content_tag(:span, is_true ? true_label : false_label,\n class: ['label', is_true ? 'label-success' : 'label-danger'])\n end",
"def true_label(is_true, true_label = 'true')\n content_tag(:span, true_label, class:... | [
"0.7185832",
"0.669322",
"0.62031",
"0.60585386",
"0.5897908",
"0.5854154",
"0.5795005",
"0.57843906",
"0.57163095",
"0.5715414",
"0.56919116",
"0.56211627",
"0.560368",
"0.55886817",
"0.5572195",
"0.5568336",
"0.55539",
"0.5520888",
"0.54945815",
"0.54919523",
"0.5475154",
... | 0.8515844 | 0 |
iconized links helper pass an icon into your typical link call like this: icon_link_to("Linktext", url, :class => "btn btndefault", :icon => :comment) | def icon_link_to(name, options={}, html_options={})
if html_options[:icon].present?
link_to(options, html_options) do
bootstrap_icon_tag(html_options[:icon], html_options[:color]) + " " + name
end
else
link_to(name, options, html_options)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def icon_link text, icon\n \"#{content_tag(:i, '', :class => \"#{icon}\")} #{text}\".html_safe\n end",
"def link_with_icon(title, link, icon, type, link_options={})\n @icon = icon\n @type = type\n link_to(content_tag(:span, %{#{content_tag(:i, nil, :class => @icon)} #{title}}.html_safe, :class => @t... | [
"0.8035976",
"0.7959891",
"0.7697573",
"0.76617384",
"0.76089954",
"0.7607245",
"0.7305475",
"0.7148847",
"0.71037316",
"0.7045808",
"0.698749",
"0.6978031",
"0.68256515",
"0.6665551",
"0.65408516",
"0.6483845",
"0.64758664",
"0.64758664",
"0.6467867",
"0.6461689",
"0.6426571... | 0.71682745 | 7 |
Method to load in data from file | def load_athletes(file = 'athletes_london2012.csv')
puts "Clearing out old athletes .."
Athlete.destroy_all
puts "Importing athletes .."
CSV.read(file, headers: true).each do |row|
Athlete.create({
name: row["Name"],
country: row["Country"],
age: row["Age"],
h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(file); end",
"def load_file(file); end",
"def load(file_path); end",
"def load(file_path); end",
"def load(data)\n end",
"def load_file(filename); end",
"def load_file(filename); end",
"def read_data_file(path); end",
"def load_data\n @data ||= CSV.read(@file)\n end",
"def fromFile(... | [
"0.78332484",
"0.7818694",
"0.76551217",
"0.76551217",
"0.7612763",
"0.7580317",
"0.7580317",
"0.75361115",
"0.7504167",
"0.7495848",
"0.7395734",
"0.73337865",
"0.7304604",
"0.71744716",
"0.71509147",
"0.71299404",
"0.7010242",
"0.6978174",
"0.6970022",
"0.69433504",
"0.6898... | 0.0 | -1 |
Le texte complet et initial, tel que fourni en ligne de commande ou dans le fichier. | def texte
@texte ||= begin
exist? && File.read(path).force_encoding('utf-8')
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recuperationEtape()\n\t\tstring=@techniqueObjet.etape(@etapeEnCours)\n\t\t@texteContenu.set_text(string)\n\tend",
"def recuperationEtape()\n\t\tstring=@techniqueObjet.etape(@etapeEnCours)\n\t\t@texteContenu.set_text(string)\n\tend",
"def open_text\n \"\"\n end",
"def texte_aide\n <<-EOT\n=== Aid... | [
"0.58253235",
"0.58253235",
"0.5754274",
"0.56645983",
"0.5638366",
"0.56328094",
"0.56321216",
"0.56222826",
"0.55971354",
"0.55534256",
"0.55341196",
"0.55341196",
"0.5497755",
"0.5497755",
"0.54776067",
"0.54724205",
"0.54425544",
"0.54123217",
"0.5391311",
"0.5387139",
"0... | 0.5723146 | 3 |
GET /expriences/1 GET /expriences/1.json | def show
@exprience = Exprience.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @exprience }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @exprience = Exprience.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exprience }\n end\n end",
"def index\n @expertises = Expertise.all\n\n render json: @expertises\n end",
"def index\n @resumes = Resume.where(:book_id => param... | [
"0.6460535",
"0.62191874",
"0.6128675",
"0.61056995",
"0.6066044",
"0.606225",
"0.60457474",
"0.60388494",
"0.60388494",
"0.602078",
"0.6011448",
"0.5985234",
"0.59758854",
"0.5968628",
"0.59645826",
"0.5924307",
"0.5884493",
"0.58731914",
"0.5873013",
"0.58635384",
"0.584615... | 0.7250396 | 0 |
GET /expriences/new GET /expriences/new.json | def new
@exprience = Exprience.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @exprience }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @sentence = Sentence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sentence }\n end\n end",
"def new\n @absence = Absence.new\n @title = \"New Absence\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.js... | [
"0.69618356",
"0.6954727",
"0.6952975",
"0.6948043",
"0.69414175",
"0.6921609",
"0.6921609",
"0.6921609",
"0.6904323",
"0.6848965",
"0.6824646",
"0.68182695",
"0.6814266",
"0.6814266",
"0.6814266",
"0.68107444",
"0.6809511",
"0.68081343",
"0.6786989",
"0.6783678",
"0.67735857... | 0.7760246 | 0 |
POST /expriences POST /expriences.json | def create
user=User.find_by_id(current_user.id)
@exprience = Exprience.new(params[:exprience])
@exprience.user=user
respond_to do |format|
if @exprience.save
format.html { redirect_to @exprience, notice: 'Exprience was successfully created.' }
format.json { render json: @exprience, status... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @exprience = Exprience.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exprience }\n end\n end",
"def create\n course = Course.includes(:professors).new(course_params)\n course.professor_ids=(params[:professors])\n\n if course.save\... | [
"0.60418683",
"0.5504403",
"0.54598135",
"0.5393327",
"0.53903437",
"0.53627",
"0.53606176",
"0.5354886",
"0.5352611",
"0.53404397",
"0.53278655",
"0.5323961",
"0.52871704",
"0.5253892",
"0.52499837",
"0.52462786",
"0.52307975",
"0.52054685",
"0.51901203",
"0.51899433",
"0.51... | 0.59723157 | 1 |
PUT /expriences/1 PUT /expriences/1.json | def update
@exprience = Exprience.find(params[:id])
respond_to do |format|
if @exprience.update_attributes(params[:exprience])
format.html { redirect_to @exprience, notice: 'Exprience was successfully updated.' }
format.json { head :no_content }
else
format.html { render act... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @exalt = Exalt.find(params[:id])\n\n respond_to do |format|\n if @exalt.update_attributes(params[:exalt])\n format.html { redirect_to @exalt, notice: 'Exalt was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n ... | [
"0.58631426",
"0.57196045",
"0.56989515",
"0.5677132",
"0.5659",
"0.56532633",
"0.56518877",
"0.56220526",
"0.5607844",
"0.56046045",
"0.5588235",
"0.5575718",
"0.55729246",
"0.55729246",
"0.55729246",
"0.5566658",
"0.555049",
"0.5545957",
"0.55381113",
"0.5536728",
"0.553463... | 0.69488513 | 0 |
DELETE /expriences/1 DELETE /expriences/1.json | def destroy
@exprience = Exprience.find(params[:id])
@exprience.destroy
respond_to do |format|
format.html { redirect_to expriences_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @annex = Annex.find(params[:id])\n @annex.destroy\n\n respond_to do |format|\n format.html { redirect_to annexes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exalt = Exalt.find(params[:id])\n @exalt.destroy\n\n respond_to do |format|\n ... | [
"0.67561865",
"0.67502695",
"0.6639476",
"0.6632508",
"0.6592452",
"0.6560615",
"0.65595174",
"0.6548551",
"0.65477246",
"0.654579",
"0.6534753",
"0.6533171",
"0.6504652",
"0.6504282",
"0.6492756",
"0.64438814",
"0.6443214",
"0.64405656",
"0.6436957",
"0.6434173",
"0.6432182"... | 0.74021333 | 0 |
Create a new context. If this is called within a context, a new subcontext will be created. Aliases are 'testcase' and 'describe' | def context(name=nil, parent=self, &block)
c = Class.new(parent)
c.send(:include, Kintama::Context)
c.name = name.to_s if name
c.definition = find_definition(&block)
c.class_eval(&block) if block
c
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def context(label, *tags, &block)\n return if @_omit\n\n @_testcase.tests << context_class.new(\n :context => @_testcase,\n :target => @_testcase.target,\n :setup => @_setup,\n :skip => @_skip,\n :label => label,\n :tags => tags,\n ... | [
"0.7110888",
"0.6785569",
"0.66602254",
"0.6638066",
"0.66287357",
"0.6537035",
"0.6534283",
"0.6427181",
"0.64076406",
"0.63871264",
"0.63533354",
"0.63320196",
"0.63302356",
"0.61346203",
"0.61247236",
"0.6121453",
"0.61144376",
"0.6073008",
"0.6025723",
"0.5956539",
"0.593... | 0.5536563 | 51 |
Create a new context starting with "given " | def given(name, parent=self, &block)
context("given " + name, parent, &block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_context(env)\n\n makara_context, makara_status = makara_values(env)\n\n context = nil\n\n # if the previous request was a redirect, let's keep that context\n if makara_status.to_s =~ /^3/ # 300+ redirect\n context = makara_context\n end\n\n context ||= Makara::Context.g... | [
"0.6063445",
"0.60196924",
"0.59300286",
"0.5881906",
"0.5880922",
"0.5873954",
"0.58689225",
"0.5826239",
"0.5788682",
"0.57348275",
"0.57348275",
"0.57348275",
"0.57348275",
"0.57348275",
"0.57348275",
"0.57348275",
"0.57348275",
"0.57348275",
"0.57348275",
"0.5729926",
"0.... | 0.6552716 | 0 |
Define the setup for this context. It will also be run for any subcontexts, before their own setup blocks | def setup(&block)
self.setup_blocks << block
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup\n result = instance_eval(&@block)\n contexts.each { |context| context.setup }\n result\n end",
"def setup(_context)\n end",
"def setup(&blk)\n @setup_block = blk\n end",
"def setup(&block)\n @setup = block\n end",
"def setup\n @setup_proc.call(self) i... | [
"0.8125328",
"0.80310994",
"0.767892",
"0.76371646",
"0.762692",
"0.7566261",
"0.7565491",
"0.75554967",
"0.75554967",
"0.7550539",
"0.754579",
"0.7484245",
"0.7484245",
"0.7484245",
"0.7484245",
"0.7484245",
"0.7484245",
"0.7455918",
"0.74496675",
"0.7434119",
"0.73729897",
... | 0.76789594 | 2 |
Define the teardown for this context. It will also be run for any subcontexts, after their own teardown blocks | def teardown(&block)
self.teardown_blocks << block
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def teardown( *args )\n\t\t\tsuper( *args )\n\t\t\tself.class.teardownBlocks.each {|tblock|\n\t\t\t\tdebugMsg \"Calling teardown block method #{tblock}\"\n\t\t\t\tself.send( tblock )\n\t\t\t}\n\t\tend",
"def teardown(&block)\n passed_through_teardown = self.teardown_chained\n self.teardown_chained = la... | [
"0.8127557",
"0.8097463",
"0.7765261",
"0.7748829",
"0.767391",
"0.75679505",
"0.75676644",
"0.7530309",
"0.75213957",
"0.74100333",
"0.7363085",
"0.7339571",
"0.7301706",
"0.7301706",
"0.72830135",
"0.7249303",
"0.7211908",
"0.7181189",
"0.7181189",
"0.71625435",
"0.7150887"... | 0.81217647 | 1 |
Defines the subject of any matcherbased tests. | def subject(&block)
let("subject", &block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def submatchers; end",
"def matcher_name; end",
"def matcher_name; end",
"def tests\n config.tests(subject)\n end",
"def matcher; end",
"def matcher; end",
"def initialize\n @matchers = []\n @matches = {}\n end",
"def tests(subject)\n subject.match_expressions.each do |m... | [
"0.65481937",
"0.637469",
"0.637469",
"0.6220092",
"0.6203109",
"0.6203109",
"0.6062549",
"0.59396863",
"0.5854118",
"0.582513",
"0.58042324",
"0.58042324",
"0.58042324",
"0.58042324",
"0.58042324",
"0.58042324",
"0.58042324",
"0.58042324",
"0.57743096",
"0.57743096",
"0.5774... | 0.5246813 | 70 |
Define a test to run in this context. | def test(name, &block)
c = Class.new(self)
c.send(:include, Kintama::Test)
c.name = name
c.definition = find_definition(&block)
c.block = block if block_given?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test desc, &block\n self.setup {}\n desc = Testing::Functions.make_constantizeable(desc)\n if block_given?\n test = \"test_#{desc.gsub(/\\W+/, '_').downcase}\"\n define_method(test, &lambda {$current_spec = self; instance_eval(&block)})\n (@@_tests ||= []) << test.to_sym\n ... | [
"0.7051314",
"0.70174843",
"0.7015935",
"0.68873185",
"0.68477035",
"0.68251365",
"0.68251365",
"0.68236303",
"0.68046284",
"0.68046284",
"0.67993003",
"0.67931896",
"0.67819214",
"0.67553014",
"0.6747415",
"0.6720637",
"0.66597843",
"0.66345525",
"0.66345525",
"0.6626415",
"... | 0.6920323 | 3 |
Define a test to run in this context. The test name will start with "should " You can either supply a name and block, or a matcher. In the latter case, a test will be generated using that matcher. | def should(name_or_matcher, &block)
if name_or_matcher.respond_to?(:matches?)
test("should " + name_or_matcher.description) do
assert name_or_matcher.matches?(subject), name_or_matcher.failure_message
end
else
test("should " + name_or_matcher, &block)
en... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test(name, &block)\n c = Class.new(self)\n c.send(:include, Kintama::Test)\n c.name = name\n c.definition = find_definition(&block)\n c.block = block if block_given?\n end",
"def test desc, &block\n self.setup {}\n desc = Testing::Functions.make_constantizeab... | [
"0.7110096",
"0.70546705",
"0.6859727",
"0.6640593",
"0.66302586",
"0.65529",
"0.6329149",
"0.61828804",
"0.6155052",
"0.60907555",
"0.60673666",
"0.60669017",
"0.60147053",
"0.59526306",
"0.5926391",
"0.5814493",
"0.58131266",
"0.58091694",
"0.5784491",
"0.57823443",
"0.5774... | 0.67535436 | 3 |
Define a test to run in this context. The test name will start with "it " | def it(name, &block)
test("it " + name, &block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _it( test )\n puts \"--- On saute les tests pour \\\"#{test}\\\" ---\"\n end",
"def test desc, &block\n self.setup {}\n desc = Testing::Functions.make_constantizeable(desc)\n if block_given?\n test = \"test_#{desc.gsub(/\\W+/, '_').downcase}\"\n define_method(test, &lambda {$... | [
"0.75742376",
"0.70027876",
"0.6861763",
"0.67709833",
"0.67562723",
"0.6585383",
"0.6563721",
"0.6549438",
"0.65452033",
"0.6511056",
"0.6511056",
"0.64980996",
"0.64980173",
"0.6484394",
"0.64706016",
"0.646698",
"0.6446924",
"0.6435516",
"0.64153254",
"0.6404978",
"0.63967... | 0.6736726 | 5 |
Returns true if this context has no known failed tests. | def passed?
failures.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flexmock_test_has_failed? # :nodoc:\n passed? == false\n end",
"def failed?\n @passed == false\n end",
"def failing?\n return false if self.product_tests.empty?\n failing = self.product_tests.includes(:test_executions).select do |p|\n p.execution_state == :failed\n end\n f... | [
"0.74247056",
"0.72116256",
"0.72100294",
"0.71981823",
"0.7136929",
"0.71041965",
"0.7085865",
"0.70858204",
"0.70632124",
"0.70384866",
"0.6996263",
"0.69576055",
"0.69166136",
"0.6912542",
"0.69086593",
"0.68701476",
"0.68615514",
"0.68585014",
"0.6852107",
"0.6851423",
"0... | 0.7666951 | 0 |
Returns an array of tests in this and all subcontexts which failed in the previous run | def failures
ran_tests.select { |t| !t.passed? } + subcontexts.map { |s| s.failures }.flatten
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def failing_tests\n return self.product_tests.includes(:test_executions).select do |test|\n test.execution_state == :failed\n end\n end",
"def completed_tests()\n test_array = []\n self.problems.each do |problem|\n problem.tests.each do |test|\n test_array.push(test)\n end\n ... | [
"0.6921651",
"0.64910924",
"0.6472996",
"0.6450329",
"0.6441359",
"0.6429665",
"0.63754714",
"0.6307659",
"0.62305653",
"0.6192798",
"0.6071827",
"0.6008375",
"0.5972533",
"0.59657764",
"0.58606464",
"0.5814482",
"0.5807816",
"0.58030844",
"0.57998663",
"0.5767531",
"0.576072... | 0.8401579 | 0 |
Runs all tests in this context and any subcontexts. Returns true if all tests passed; otherwise false | def run(reporter=nil)
run_tests(tests, true, reporter)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_tests\n tests_passed = true\n %w(desktop mobile kc_dm).each do |profile|\n tests_passed &= execute_test(profile)\n end\n tests_passed\n end",
"def run_tests(test_set, run_subcontexts, reporter)\n @ran_tests = []\n reporter.context_started(self) if reporter\n on_star... | [
"0.7242202",
"0.7102257",
"0.65659976",
"0.6519309",
"0.6488928",
"0.6451005",
"0.63420784",
"0.630378",
"0.6166578",
"0.6103706",
"0.6028015",
"0.59864575",
"0.5970731",
"0.59661674",
"0.5879938",
"0.5841013",
"0.5836491",
"0.58279324",
"0.58279324",
"0.58279324",
"0.5827932... | 0.0 | -1 |
Run a specific set of tests using the given the reporter | def run_tests(test_set, run_subcontexts, reporter)
@ran_tests = []
reporter.context_started(self) if reporter
on_start_blocks.each { |b| instance_eval(&b) }
test_set.each { |t| instance = t.new; instance.run(reporter); ran_tests << instance }
subcontexts.each { |s| s.run(reporter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(reporter=nil)\n run_tests(tests, true, reporter)\n end",
"def run(reporter)\n @reporter = reporter\n\n reporter.start(:suite, @suite)\n suite.concerns.each do |concern|\n run_concern(concern)\n end\n reporter.finish(:suite, @suite)\n end",
"def run(*tests)... | [
"0.81513786",
"0.6949472",
"0.6782181",
"0.658122",
"0.6408914",
"0.63959664",
"0.6238389",
"0.6226604",
"0.6217692",
"0.61507416",
"0.6097935",
"0.6085377",
"0.6085148",
"0.6064233",
"0.6041483",
"0.6011009",
"0.60037607",
"0.6001202",
"0.5996111",
"0.59925777",
"0.5983083",... | 0.68048704 | 2 |
GET /submissions GET /submissions.xml | def index
request.parameters.reject! {|p| p=="authenticity_token"}
if params[:c1] and params[:d]
@submissions = Submission.ordered_search(params[:c1], params[:d], params[:c2], params[:s], params[:e], params[:u], params[:v])
else
@submissions = Submission.ordered_search("submissions.updated_at", ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @submissions = Submission.find(:all)\n\n respond_to do |format|\n format.html # index.haml\n format.xml { render :xml => @submission }\n end\n end",
"def index\n @submissions = Submission.all\n end",
"def index\n @submissions = Submission.all\n end",
"def index\n @... | [
"0.71108484",
"0.66141176",
"0.66141176",
"0.66141176",
"0.66141176",
"0.65001535",
"0.6341488",
"0.6310742",
"0.6292747",
"0.62614465",
"0.6208307",
"0.61492217",
"0.60981256",
"0.6043553",
"0.6026837",
"0.6024365",
"0.60053784",
"0.5987203",
"0.59686625",
"0.59455425",
"0.5... | 0.5850877 | 27 |
GET /submissions/1 GET /submissions/1.xml | def show
@submission = Submission.find(params[:id])
if user_signed_in? and can?( :create, SubmissionComment )
@comment = @submission.comments.build
end
if user_signed_in? and can?( :create, Vote )
@vote = @submission.votes.build
end
respond_to do |format|
format.html # show.ht... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @submissions = Submission.find(:all)\n\n respond_to do |format|\n format.html # index.haml\n format.xml { render :xml => @submission }\n end\n end",
"def show\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n f... | [
"0.70200837",
"0.6637492",
"0.64644307",
"0.6330454",
"0.6330454",
"0.6330454",
"0.6330454",
"0.6227234",
"0.6139682",
"0.60325634",
"0.5994084",
"0.59742385",
"0.59385324",
"0.58836997",
"0.58836997",
"0.5879098",
"0.5869685",
"0.58558345",
"0.5849706",
"0.58307076",
"0.5774... | 0.0 | -1 |
GET /submissions/new GET /submissions/new.xml | def new
@submission = Submission.new
3.times { @submission.images.build }
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @submission }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @submission = Submission.new\n\n respond_to do |format|\n format.html # new.haml\n format.xml { render :xml => @submission }\n end\n end",
"def new\n @submission_comment = SubmissionComment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { ... | [
"0.74712205",
"0.69771075",
"0.685582",
"0.675771",
"0.6754608",
"0.6724431",
"0.6659576",
"0.6653778",
"0.66323596",
"0.66178834",
"0.6616047",
"0.6615652",
"0.6614104",
"0.6599522",
"0.6595323",
"0.6594214",
"0.656463",
"0.656205",
"0.6549862",
"0.654919",
"0.65307224",
"... | 0.0 | -1 |
POST /submissions POST /submissions.xml | def create
@submission = Submission.new(params[:submission])
@submission.link_updated_at = Time.now
unless params[:submission][:map_author_id]
@submission.map_author = current_user.map_author
end
respond_to do |format|
if @submission.save
format.html { redirect_to(@submission, :... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_submission(path, xml = nil)\n if xml.nil?\n form = create(:form, question_types: %w(integer integer))\n form.publish!\n xml = build_odk_submission(form)\n end\n\n # write xml to file\n require 'fileutils'\n FileUtils.mkpath('test/fixtures')\n fixture_file = Rails.root.join('... | [
"0.632886",
"0.61175877",
"0.60245174",
"0.60130566",
"0.6006371",
"0.5991936",
"0.59799415",
"0.5946496",
"0.59143066",
"0.5897665",
"0.5849799",
"0.5789208",
"0.5756997",
"0.57558453",
"0.5749486",
"0.5746775",
"0.5718623",
"0.5714078",
"0.56997436",
"0.5691585",
"0.5678533... | 0.5368018 | 58 |
PUT /submissions/1 PUT /submissions/1.xml | def update
@submission = Submission.find(params[:id])
respond_to do |format|
if @submission.update_attributes(params[:submission])
format.html { redirect_to(@submission, :notice => 'Submission was successfully updated.') }
format.xml { head :ok }
else
format.html { render :... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n if @submission.update_attributes(params[:submission])\n flash[:notice] = 'Su... | [
"0.63226694",
"0.6076921",
"0.59614944",
"0.59559876",
"0.5803203",
"0.57267976",
"0.5635816",
"0.56304777",
"0.56232756",
"0.55906576",
"0.5586893",
"0.5554691",
"0.5531482",
"0.5522647",
"0.55137986",
"0.550962",
"0.5502943",
"0.54957855",
"0.54816896",
"0.54610014",
"0.544... | 0.6108969 | 2 |
DELETE /submissions/1 DELETE /submissions/1.xml | def destroy
@submission = Submission.find(params[:id])
@submission.destroy
respond_to do |format|
format.html { redirect_to(submissions_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @submission = Submission.find(params[:id])\n @submission.destroy\n\n respond_to do |format|\n format.html { redirect_to(submission_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n Submission.find(params[:id]).destroy\n redirect_to '/submissions'\n end",
... | [
"0.7097178",
"0.7065991",
"0.6689395",
"0.66484356",
"0.6634616",
"0.66009927",
"0.66009927",
"0.6600896",
"0.65906423",
"0.65760815",
"0.65760815",
"0.65760815",
"0.64931285",
"0.6401233",
"0.636572",
"0.6343439",
"0.6331523",
"0.6329475",
"0.63271004",
"0.6326472",
"0.62962... | 0.7185909 | 2 |
Hydrate all the records in this collection from a database query | def load!
records_by_identity = index_by { |record| record.key_values }
record_set.find_each_row do |row|
identity = row.values_at(*record_set.key_column_names)
records_by_identity[identity].hydrate(row)
end
loaded_count = count { |record| record.loaded? }
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(records, query)\n repository = query.repository\n fields = query.fields\n discriminator = properties(repository.name).discriminator\n no_reload = !query.reload?\n\n field_map = fields.map { |property| [ property, property.field ] }.to_hash\n\n records.map do |re... | [
"0.5961719",
"0.59509486",
"0.59298396",
"0.5916332",
"0.5881869",
"0.58740675",
"0.5836159",
"0.583224",
"0.5815397",
"0.58131486",
"0.5793536",
"0.57835186",
"0.5765095",
"0.57427853",
"0.56912446",
"0.5688929",
"0.5683119",
"0.5682361",
"0.5658788",
"0.56544197",
"0.562188... | 0.6267259 | 0 |
GET /gethotelstaticdatagds/1 GET /gethotelstaticdatagds/1.json | def show
@gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @gethotelstaticdatagd }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n # @gethotelstaticdatagd = Gethotelstaticdatagd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end",
"def index\n @gpsds = Gpsd.all\n #respond_to do |format|\n # format.json { render }\n #end\n end... | [
"0.6223897",
"0.606822",
"0.6002928",
"0.5969697",
"0.5894499",
"0.58921814",
"0.58584297",
"0.5853182",
"0.5825266",
"0.5823623",
"0.58013004",
"0.5743797",
"0.57242924",
"0.57036763",
"0.5675348",
"0.56734824",
"0.5672069",
"0.5658301",
"0.56496334",
"0.5637111",
"0.5634097... | 0.7429042 | 0 |
GET /gethotelstaticdatagds/new GET /gethotelstaticdatagds/new.json | def new
# @gethotelstaticdatagd = Gethotelstaticdatagd.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @gethotelstaticdatagd }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @gpath = Gpath.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gpath }\n end\n end",
"def new\n @gnode = Gnode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gnode }\n end\n end"... | [
"0.6673179",
"0.6661282",
"0.6660709",
"0.66504174",
"0.6570877",
"0.6564872",
"0.65642494",
"0.654022",
"0.6517216",
"0.64429414",
"0.6434843",
"0.64322925",
"0.63928664",
"0.63727105",
"0.6361882",
"0.63561606",
"0.6355939",
"0.63445073",
"0.6335992",
"0.6334958",
"0.63338"... | 0.7433233 | 0 |
POST /gethotelstaticdatagds POST /gethotelstaticdatagds.json | def create
gethotelstaticdatagd = Gethotelstaticdatagd.get_hotel_static_data_gds(params)
respond_to do |format|
if gethotelstaticdatagd.body.include?("<boolean xmlns=\"http://www.reconline.com/\">true</boolean>")
flash[:notice] = 'Gethotelstaticdatagd was successfully created.'
format.htm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n # @gethotelstaticdatagd = Gethotelstaticdatagd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end",
"def create\n @gpsd = Gpsd.new(gpsd_params)\n\n if @gpsd.save\n render json: @gpsd, status: :create... | [
"0.59326917",
"0.5665354",
"0.5664883",
"0.54844415",
"0.54373217",
"0.5433553",
"0.5412626",
"0.54092747",
"0.53782624",
"0.53717136",
"0.53462744",
"0.5325891",
"0.530718",
"0.52887297",
"0.526905",
"0.5268331",
"0.52635014",
"0.5254946",
"0.524068",
"0.5222808",
"0.5195280... | 0.6745324 | 0 |
PUT /gethotelstaticdatagds/1 PUT /gethotelstaticdatagds/1.json | def update
@gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])
respond_to do |format|
if @gethotelstaticdatagd.update_attributes(params[:gethotelstaticdatagd])
format.html { redirect_to @gethotelstaticdatagd, notice: 'Gethotelstaticdatagd was successfully updated.' }
format.jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update_array_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/arrays/{arrayId}\"\n path = t... | [
"0.6134215",
"0.596273",
"0.5842223",
"0.5792792",
"0.5741506",
"0.5732822",
"0.56933665",
"0.5621038",
"0.5615776",
"0.561011",
"0.5576421",
"0.5575338",
"0.5553155",
"0.55364394",
"0.55141664",
"0.55029756",
"0.5497736",
"0.5492067",
"0.5489984",
"0.5458374",
"0.54296786",
... | 0.6672631 | 0 |
DELETE /gethotelstaticdatagds/1 DELETE /gethotelstaticdatagds/1.json | def destroy
@gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])
@gethotelstaticdatagd.destroy
respond_to do |format|
format.html { redirect_to gethotelstaticdatagds_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @dataload_ga = DataloadGa.find(params[:id])\n @dataload_ga.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_gas_url }\n format.json { head :no_content }\... | [
"0.70240843",
"0.6955485",
"0.681725",
"0.6815277",
"0.67029345",
"0.668335",
"0.6613186",
"0.6609484",
"0.66008663",
"0.65720874",
"0.656527",
"0.65562665",
"0.65520066",
"0.6515421",
"0.6474822",
"0.64702547",
"0.6467606",
"0.6467606",
"0.6467606",
"0.6467606",
"0.6467561",... | 0.7709696 | 0 |
Using here docs for a cheap templating system | def base_class
# create the base class file
File.open(File.join(repo_name, 'lib', "#{use_kata_name}.rb"), 'w') {|f| f.write <<EOF}
class #{class_name}
end
EOF
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def template(_template_name)\n \"This is a dummy template! <%= dummy %> \\n \"\\\n 'Here is a global value <%= dummy_global %>'\n end",
"def template(name); end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"de... | [
"0.7593935",
"0.7537032",
"0.7241182",
"0.7241182",
"0.7241182",
"0.7241182",
"0.7241182",
"0.7241182",
"0.7241182",
"0.7206264",
"0.70593435",
"0.6969467",
"0.68708247",
"0.68600833",
"0.68600833",
"0.68062156",
"0.68062156",
"0.6804482",
"0.67141706",
"0.6633778",
"0.660782... | 0.0 | -1 |
TODO: consider introducing new error types | def _require_implementation!(method)
raise ::NotImplementedError, "#{method} not implemented by #{self.class}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error; end",
"def error; end",
"def error; end",
"def error; end",
"def error; end",
"def error; end",
"def error; end",
"def original_error; end",
"def original_error; end",
"def error?; end",
"def error?; end",
"def error?; end",
"def recover_from(_error); end",
"def error\n end",
... | [
"0.7597668",
"0.7597668",
"0.7597668",
"0.7597668",
"0.7597668",
"0.7597668",
"0.7597668",
"0.75299513",
"0.75299513",
"0.71927875",
"0.71927875",
"0.71927875",
"0.71350694",
"0.71124196",
"0.70911556",
"0.70911556",
"0.70900947",
"0.7085769",
"0.7085769",
"0.7085769",
"0.705... | 0.0 | -1 |
Service show selected, redirect to proper controller | def show
@record = Service.find(params[:id].to_i)
@lastaction = "show"
@gtl_url = "/show"
set_display
case @display
when 'generic_objects'
show_generic_object
return
when 'custom_button_events'
display_nested_list(@display)
return
end
unless @explorer
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @service = Service.find(params[:id])\n end",
"def show\n @service = Service.find(params[:id])\n end",
"def show\n @page_id = \"services\"\n @service = Service.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { rende... | [
"0.69031876",
"0.68722177",
"0.6649758",
"0.6616135",
"0.64578426",
"0.64391935",
"0.6361672",
"0.6339317",
"0.630955",
"0.62843746",
"0.6211938",
"0.6210782",
"0.6210782",
"0.6210782",
"0.6183971",
"0.61712956",
"0.6159977",
"0.6155577",
"0.61507106",
"0.61431444",
"0.613493... | 0.6728059 | 2 |
ST clicked on in the explorer right cell | def x_show
identify_service(params[:id])
generic_x_show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end",
"def mouse_clicked(event)\n \n puts \"IN schemasTreeTable_mouse_clicked : #{event.inspect}\"\n puts \"MOUSE #{event.class} : #{event.getClickCount} : BUTTON #{event.getButton}\"\n\n # ... | [
"0.6729195",
"0.6514427",
"0.6385578",
"0.6343953",
"0.6266277",
"0.6218412",
"0.61875045",
"0.6179781",
"0.606588",
"0.6054027",
"0.5917583",
"0.58830255",
"0.5882537",
"0.5871165",
"0.58529294",
"0.58514065",
"0.58235884",
"0.5804982",
"0.5804982",
"0.5804982",
"0.5794628",... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.