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 |
|---|---|---|---|---|---|---|
POST /materia POST /materia.json | def create
@materia = Materia.new(params[:materia])
respond_to do |format|
if @materia.save
format.html { redirect_to @materia, notice: 'La materia ha sido registrada.' }
format.json { render json: @materia, status: :created, location: @materia }
else
@docentes = Docente.find(:all)
@cursos = Curso.find(:all)
format.html { render action: "new" }
format.json { render json: @materia.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @materia = Materia.new(params[:materia])\n\n if @materia.save\n render json: @materia, status: :created, location: @materia\n else\n render json: @materia.errors, status: :unprocessable_entity\n end\n end",
"def create\n @materia = Materia.new(materia_params)\n\n ... | [
"0.8213514",
"0.7769784",
"0.7765004",
"0.76545286",
"0.76076573",
"0.71307296",
"0.70424724",
"0.70420235",
"0.7011536",
"0.6979687",
"0.689579",
"0.68428993",
"0.6837837",
"0.68282396",
"0.6817781",
"0.68079853",
"0.67693067",
"0.6746628",
"0.67120063",
"0.6692678",
"0.6681... | 0.75760204 | 5 |
PUT /materia/1 PUT /materia/1.json | def update
@materia = Materia.find(params[:id])
respond_to do |format|
if @materia.update_attributes(params[:materia])
format.html { redirect_to @materia, notice: 'La materia ha sido actualizada.' }
format.json { head :no_content }
else
@docentes = Docente.find(:all)
@cursos = Curso.find(:all)
edit_auxiliar @materia
format.html { render action: "edit" }
format.json { render json: @materia.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @materia = Materia.find(params[:id])\n\n if @materia.update(params[:materia])\n head :no_content\n else\n render json: @materia.errors, status: :unprocessable_entity\n end\n end",
"def update\n @materia = Materia.find(params[:id])\n\n respond_to do |format|\n if @ma... | [
"0.78412765",
"0.7560132",
"0.7480863",
"0.73526573",
"0.7293167",
"0.71706957",
"0.7005944",
"0.6784879",
"0.6784879",
"0.6775927",
"0.67682064",
"0.67323273",
"0.6693209",
"0.6676202",
"0.66735345",
"0.66480833",
"0.66034955",
"0.65862364",
"0.6561407",
"0.65504056",
"0.651... | 0.7443117 | 3 |
DELETE /materia/1 DELETE /materia/1.json | def destroy
@materia = Materia.find(params[:id])
@materia.destroy
respond_to do |format|
format.html { redirect_to materia_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @materia = Materia.find(params[:id])\n @materia.destroy\n\n respond_to do |format|\n format.html { redirect_to materie_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @materia.destroy\n respond_to do |format|\n format.html { redirect_to materi... | [
"0.7705259",
"0.7686247",
"0.74915457",
"0.74679554",
"0.7417012",
"0.7306481",
"0.7297884",
"0.7280885",
"0.7277162",
"0.7265537",
"0.7243452",
"0.72327286",
"0.7213426",
"0.7201773",
"0.7168421",
"0.71677285",
"0.71558774",
"0.71542716",
"0.71344167",
"0.7130815",
"0.711713... | 0.7728883 | 0 |
Created (Andrew Fox, 11/28/2016): Overwrite default to get titleized string. | def name
read_attribute(:name).try(:titleize)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def title_or_default(page_title = '') # turn nil into empty\n if page_title.empty?\n title = DEFAULT_TITLE\n else\n title = page_title\n end\n \n return \"#{title} | #{TITLE_SUFFIX}\"\n end",
"def title\n\t\tbase_title = title_extend\n\t\tif @title.nil?\n\t\t\tbase_title\n\t\telse\n\t\t... | [
"0.79761493",
"0.7808179",
"0.778914",
"0.778914",
"0.77571666",
"0.77571666",
"0.77571666",
"0.7731557",
"0.77121866",
"0.76884514",
"0.76813304",
"0.7652454",
"0.76361704",
"0.7592905",
"0.7592359",
"0.75082666",
"0.74868244",
"0.74740565",
"0.74687177",
"0.74509245",
"0.74... | 0.0 | -1 |
def take_input puts "type a string" output = gets.chomp end | def write(take_input)
string = []
take_input.chars.each do |c|
@dura > 0 ? string << c : string << ' '
@dura -= 1 if c =~ /[a-z]/
@dura -= 2 if c =~ /[A-Z]/
end
@paper += string.join
"You wrote: #{string.join}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_input\n gets.chomp\n end",
"def get_input\n gets.chomp \nend",
"def get_user_input\n input = gets.chomp\n #input\nend",
"def user_input\n input = gets.chomp\n end",
"def input(thing)\n print \"Enter #{thing}: \"\n gets.chomp\nend",
"def get_user_input\n gets.chomp\nend",
"def get_us... | [
"0.89351106",
"0.88995045",
"0.8887613",
"0.8809847",
"0.8754063",
"0.8746003",
"0.8746003",
"0.8725452",
"0.87025493",
"0.8698065",
"0.86839837",
"0.86839837",
"0.8644526",
"0.86400914",
"0.8615394",
"0.86038584",
"0.8565116",
"0.85335505",
"0.85250026",
"0.8386154",
"0.8384... | 0.0 | -1 |
Takes a string, and abbreviates the string to a specified length, adding '...' at the end if necessary. The string is allowed to be 3 characters longer to allow for the '...' that we add. if 'start' is true, it'll chop at the start of the string. This feature was added but its intended use was abandoned. | def abbrev(in_string, max_length, start = false)
if (in_string.length - 3) > max_length # So we don't end up making the string longer by chopping off 1-2 characters then adding 3.
start ? ('...' + in_string.slice(-max_length, max_length)) : (in_string.slice(0, max_length) + '...')
else
in_string
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shorten(string, length)\n return string if string.length <= length\n return string[0..length-3] + '...' \n end",
"def shorten(text, length)\n if text.length <= length - 1\n text\n else\n text[0..length - 1] + \"...\"\n end\n end",
"def shortened_string(string)\n string[0... | [
"0.83242583",
"0.78755736",
"0.78077364",
"0.77969974",
"0.7781481",
"0.76862717",
"0.7579775",
"0.75049055",
"0.7484997",
"0.742349",
"0.7349586",
"0.7192297",
"0.71761876",
"0.71429646",
"0.71087044",
"0.71002316",
"0.7095293",
"0.70642596",
"0.70538354",
"0.70260084",
"0.6... | 0.8431597 | 0 |
Return the tag for a thumbnail image of the given product if available. | def product_thumbnail(product, width = nil, height = nil)
width ||= @design_config[:sizes][:category_page_thumbnail_width]
height ||= @design_config[:sizes][:category_page_thumbnail_height]
if product.image
alt_text = product.image_alt_tag || product.image.caption
image_tag("/product_images/thumbnail/#{product.image.id}/#{width}/#{height}", :class => "thumbnail", :size => "#{width}x#{height}", :alt => alt_text, :title => product.name)
else
"<table class=\"no-image\"><tr><td style=\"width: #{width - 2}px; height: #{height - 2}px;\">(No image available)</td></tr></table>"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def thumbnail\n unless @thumbnail_url\n BabboBackend.get.request_thumbnail_url_for_identifier(@productIdentifier, sender:self)\n return nil\n end\n\n unless @thumbnail\n load_thumbnail(@thumbnail_url)\n return nil\n end\n\n return @thumbnail\n end",
"def thumbnail_url\n ret... | [
"0.70859915",
"0.67951787",
"0.6764522",
"0.6719729",
"0.6669881",
"0.65952843",
"0.65204865",
"0.6452319",
"0.6429402",
"0.63941896",
"0.6390081",
"0.6318905",
"0.61987734",
"0.61305004",
"0.6072944",
"0.6067382",
"0.60652953",
"0.6057942",
"0.60069144",
"0.6001919",
"0.5975... | 0.7139453 | 0 |
wrapper around cvs common tasks | def root
settings[:basedir]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cvs command, *args\n run 'cvs', command.to_s, *args\nend",
"def import_csv_smart\n \n end",
"def import_csv_full\n \n end",
"def main\n process_csv_files_from_dir\nend",
"def convert\n STDERR.print \"\\nThis may take 10 minutes or more. Lines processed: \"\n line_in_count = 0\n\n # Cre... | [
"0.64870393",
"0.6275596",
"0.5936151",
"0.57963264",
"0.559885",
"0.55239123",
"0.54435784",
"0.5431759",
"0.54141814",
"0.5414112",
"0.5378044",
"0.53628945",
"0.53464425",
"0.53400576",
"0.53065896",
"0.5289064",
"0.5283205",
"0.5281612",
"0.52402574",
"0.5238027",
"0.5231... | 0.0 | -1 |
Contiguous Sum Demo O(n) solution | def contiguous_sub_sum2(arr)
max = arr.first
curr_sum = 0
arr.each do |num|
curr_sum += num
max = curr_sum if curr_sum > max
curr_sum = 0 if curr_sum < 0
end
max
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def efficient_contiguous_subsum(list)\n current_sum = list[0] #0\n largest_sum = list[0] #5\n # debugger\n (1...list.length).each do |i| \n if current_sum + list[i] > 0 \n current_sum += list[i] \n largest_sum = current_sum if current_sum > larg... | [
"0.7432056",
"0.7143694",
"0.7118527",
"0.7052758",
"0.6961925",
"0.6955379",
"0.6932378",
"0.6928074",
"0.69137186",
"0.69100577",
"0.6906442",
"0.6876121",
"0.6874539",
"0.6859899",
"0.68545043",
"0.6849378",
"0.68450016",
"0.68416667",
"0.6834202",
"0.6833669",
"0.68074036... | 0.66774094 | 44 |
get southwest and northeast rectangle for answer | def getAnswer(polygons, precision)
s = nil
w = nil
n = nil
e = nil
init = false
polygons.elements.each do |polygon|
coordinates = polygon.text.split
coordinates.each do |coord|
arr = coord.split ","
if (!init)
s = arr[1].to_f
w = arr[0].to_f
n = s
e = w
init = true
else
s = s > arr[1].to_f ? arr[1].to_f : s
n = n < arr[1].to_f ? arr[1].to_f : n
w = w > arr[0].to_f ? arr[0].to_f : w
e = e < arr[0].to_f ? arr[0].to_f : e
end
end
end
# give a human a chance to get into the square
s = (s-precision).round(4)
w = (w-precision).round(4)
n = (n+precision).round(4)
e = (e+precision).round(4)
return "{#{s},#{w},#{n},#{e}}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bounds\n \"#{top},#{left}:#{bottom},#{right}\"\n end",
"def upper_level_bounds\n {\n x: G.current_level.pixel_width - width / 2,\n y: G.current_level.pixel_height - height / 2\n }\n end",
"def box\r\n x = (@constrict.nil? || @width <= @constrict) ? 0 : ((@width-@constrict)/2.0).ceil... | [
"0.6618542",
"0.6447268",
"0.6447142",
"0.6421688",
"0.6361733",
"0.6304705",
"0.6251728",
"0.6242542",
"0.62144166",
"0.62144166",
"0.6212326",
"0.6174921",
"0.6172159",
"0.6161702",
"0.61448854",
"0.61448854",
"0.61332935",
"0.612773",
"0.61151415",
"0.61130816",
"0.6050233... | 0.0 | -1 |
TODO: should be in memberships table as a role Generate current week's newsletter | def generate_and_update_newsletter_for_current_week
date = Date.today
generate_and_update_newsletter(Newsletter::WEEKLY, date.cweek, date.month, date.year)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_and_update_newsletter(period, week, month, year)\n newsletter = Newsletter.where(period: period,\n week: week, month: month, year: year,\n community: self).first\n\n return if newsletter.delivered?\n\n if newsletter.nil?\n ... | [
"0.70591265",
"0.6754319",
"0.6375782",
"0.6220134",
"0.61983794",
"0.6117357",
"0.6112674",
"0.60984266",
"0.60751545",
"0.6044693",
"0.60411465",
"0.6034206",
"0.60091025",
"0.5989295",
"0.592904",
"0.5870241",
"0.58645785",
"0.5851848",
"0.5840136",
"0.579868",
"0.5785683"... | 0.77075696 | 0 |
Generate or update a newsletter newsletter and send it | def generate_and_update_newsletter(period, week, month, year)
newsletter = Newsletter.where(period: period,
week: week, month: month, year: year,
community: self).first
return if newsletter.delivered?
if newsletter.nil?
newsletter = Newsletter.new(period: period,
week: week, month: month, year: year,
community: self)
end
newsletter.update_attributes!(
users: users,
links: get_links(period, week, month, year)
)
newsletter
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def news(email, newsletter)\n @email = email\n @newsletter = newsletter\n\n mail to: email, :subject => newsletter.title\n end",
"def newsletter(newsletter, user)\n @newsletter = newsletter\n @greeting = \"Repeat Eats Newsletter!\"\n mail to: user.email, subject: @newsletter.title\n end",
"... | [
"0.7336496",
"0.73108584",
"0.7294432",
"0.7226116",
"0.7136635",
"0.70403254",
"0.694039",
"0.69365525",
"0.6874796",
"0.6861213",
"0.68388724",
"0.6794876",
"0.6710832",
"0.6701774",
"0.66411215",
"0.6607421",
"0.6534809",
"0.653126",
"0.6510615",
"0.63910073",
"0.6370049",... | 0.7193028 | 4 |
Return link digest given a period, and date information | def get_links(period, week, _month, year)
case period
when Newsletter::WEEKLY
date = Date.commercial(year, week)
links.where(created_at: [date.at_beginning_of_week..date.at_end_of_week])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def digest_for(entry) \n MD5.hexdigest( [ entry.title, entry.content, entry.date_published ].join )\n end",
"def digested_reference\n url\n end",
"def digested_reference\n url\n end",
"def get_download_pattern(data, end_date=Date.today)\n if data['version_downloads_days'].nil? || data['... | [
"0.62068516",
"0.60315675",
"0.60315675",
"0.584863",
"0.5554663",
"0.53153753",
"0.5287937",
"0.5263175",
"0.5253122",
"0.52375937",
"0.5231327",
"0.5212185",
"0.5160618",
"0.5159993",
"0.5141114",
"0.5118109",
"0.5115863",
"0.51131564",
"0.506818",
"0.50556695",
"0.50279164... | 0.0 | -1 |
select the product, before or after coins have been entered into the machine | def select_product code
@selected_product = @products.find_by_code(code)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_product\n puts Rainbow(' > ').black.underline.bg(:yellow) + 'Type your choice:'\n choice = ''\n coins = false\n while choice\n choice = gets.chomp\n @machine.check_for_product(choice) == 1 ? buy_product(choice, coins) : [intro, menu_setting]\n end\n end",
"def buy_product(cho... | [
"0.79425615",
"0.7423078",
"0.65663594",
"0.65393907",
"0.6471231",
"0.59910524",
"0.5983728",
"0.59692854",
"0.5964697",
"0.59332174",
"0.58686274",
"0.5854739",
"0.5850645",
"0.58016133",
"0.5779022",
"0.5766822",
"0.5727492",
"0.57262313",
"0.5721796",
"0.57105833",
"0.570... | 0.54076546 | 59 |
UCS2/UTF16 is used for unicode text messaging. UCS2/UTF16 represents characters in minimum 2bytes, any characters in the basic plane are represented with 2bytes, so each codepoint within the Basic Plane counts as a single character. Any codepoint outside the Basic Plane is encoded using 4bytes and therefore counts as 2 characters in a text message. | def character_count(char)
char.each_codepoint.sum { |codepoint| BASIC_PLANE.include?(codepoint) ? 1 : 2 }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_utf16\r\n Iconv.iconv(\"utf-16LE\", \"utf-8\", self).first + \"\\x00\\x00\"\r\n end",
"def get_utf16_of(character)\n character.encode('UTF-16BE').unpack('H*').first.upcase\nend",
"def toutf16; Kconv.toutf16(self) end",
"def from_utf16\r\n ret = Iconv.iconv(\"utf-8\", \"ut... | [
"0.7621005",
"0.7513707",
"0.7252406",
"0.7170394",
"0.69834757",
"0.68798864",
"0.6691294",
"0.6664909",
"0.65978783",
"0.6450834",
"0.61092883",
"0.5987998",
"0.5829261",
"0.5746236",
"0.5738984",
"0.5738984",
"0.5738984",
"0.57235795",
"0.5670381",
"0.56385446",
"0.5593409... | 0.0 | -1 |
initializess with 52 cards | def initialize(cards = Deck.all_cards)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_deck\n deck = []\n n = 0\n suit = 0x8000\n\n (0..3).each do\n (0..12).each do |j|\n deck[n] = Arrays::PRIMES[j] | (j << 8) | suit | (1 << (16+j))\n n+=1\n end\n suit >>= 1\n end\n deck\n end",
"def initialize\n\t\t@cards = (1..52).t... | [
"0.7533302",
"0.7466313",
"0.7461762",
"0.7276681",
"0.71975464",
"0.709142",
"0.7058433",
"0.7057576",
"0.7031876",
"0.70294404",
"0.69938964",
"0.6948562",
"0.69278675",
"0.69178724",
"0.6899246",
"0.68083787",
"0.6782648",
"0.6767389",
"0.6767389",
"0.6767389",
"0.67656136... | 0.6461706 | 46 |
retrieves one card from the deck in an array | def get_card
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getCardById(deck,id)\n deck.each do |card|\n return card if card.id == id\n end\n return nil\nend",
"def get_card\n @deck.pop\n end",
"def get_a_card(card_number)\n @cards[card_number]\n end",
"def get_card (random_num)\n\t\t@deck[random_num]\n\tend",
"def get_card_at_index(index)\n ... | [
"0.7719669",
"0.7617875",
"0.75353676",
"0.74045104",
"0.7379824",
"0.7314951",
"0.7297969",
"0.72611",
"0.7203044",
"0.72030264",
"0.7174439",
"0.71660167",
"0.71191746",
"0.7090579",
"0.70244443",
"0.7017891",
"0.69321674",
"0.6922843",
"0.6919285",
"0.6915444",
"0.6907005"... | 0.643654 | 60 |
checks is there are any meaningful variants (ie. variants with at least one option value) | def variants?
self.variants.each do |v|
return true unless v.option_values.empty?
end
false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def variants?\n self.variants.each do |v|\n return true unless v.option_values.empty?\n end\n false\n end",
"def has_argument_variations?\n @variations.size > 1\n end",
"def has_variants?\n !variants.empty?\n end",
"def has_variants?\n variants.any?\n end",
"def option_... | [
"0.79272467",
"0.72618127",
"0.7098676",
"0.70834893",
"0.687184",
"0.68387115",
"0.65846086",
"0.6584338",
"0.657475",
"0.65704626",
"0.652906",
"0.65093917",
"0.64670706",
"0.6466422",
"0.63427925",
"0.6342747",
"0.6330159",
"0.6330159",
"0.63263553",
"0.63118196",
"0.62858... | 0.7968238 | 0 |
special method that returns the single empty variant (but only if there are no meaningful variants) | def variant
return nil if variants?
variants.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty_variant\r\n self.variants << Variant.new \r\n end",
"def variant\n return nil if variants?\n variants.first\n end",
"def empty\n @first.nil?\n end",
"def empty?; end",
"def empty?; end",
"def empty?; end",
"def empty?; end",
"def empty?; end",
"def empty?; end",... | [
"0.7334024",
"0.7202417",
"0.639808",
"0.6329386",
"0.6329386",
"0.6329386",
"0.6329386",
"0.6329386",
"0.6329386",
"0.6329386",
"0.6329386",
"0.6329386",
"0.6329386",
"0.6329386",
"0.6329386",
"0.6256619",
"0.6256619",
"0.6256619",
"0.62419945",
"0.61922",
"0.6100468",
"0.... | 0.7107823 | 2 |
all products must have an "empty variant" (this variant will be ignored if meaningful ones are added later) | def empty_variant
self.variants << Variant.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ensure_not_referenced_by_any_product\n if products.empty?\n return true\n else\n errors.add(:base, 'Kann nicht geloescht werden! Es gibt Produkte dieser Marke!')\n return false\n end\n end",
"def has_variants?\n !variants.empty?\n end",
"def delete_ok?\n product_versions.emp... | [
"0.68999946",
"0.67522794",
"0.6739168",
"0.6681076",
"0.66458815",
"0.64913964",
"0.6358768",
"0.63548714",
"0.63087755",
"0.6299094",
"0.625651",
"0.62461525",
"0.62419987",
"0.6198268",
"0.6194985",
"0.61787224",
"0.61775684",
"0.61485237",
"0.6147277",
"0.6146251",
"0.612... | 0.7488437 | 0 |
Examples: numberToString(123); // returns '123';` numberToString(999); // returns '999';` | def numberToString(num)
num.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def numberToString(num)\n \"#{num}\"\nend",
"def numberToString(num)\r\n num.to_s\r\nend",
"def numberToString(num) \n\t num.to_s \n end",
"def number_to_string(num)\n num.to_s\nend",
"def number_to_string (num) \n p num.to_s\nend",
"def num_to_string(number)\n case number\n when '1'\n ... | [
"0.89627844",
"0.8749416",
"0.8497562",
"0.8408009",
"0.83948725",
"0.81734616",
"0.8019493",
"0.8019493",
"0.7937105",
"0.78703785",
"0.78184307",
"0.77938396",
"0.7710159",
"0.766514",
"0.76311094",
"0.76141846",
"0.7607196",
"0.75022817",
"0.747998",
"0.74785006",
"0.74384... | 0.87712735 | 2 |
7:1: prog : ( statement )+ ; | def prog()
# 8:5: ( statement )+
# 8:5: ( statement )+
matchedOnce1 = false
while true
alt1 = 2
# ()+ loopback of 8:5: ( statement )+
look_ahead1_0 = look_ahead(1)
if look_ahead1_0 == :CLASS || (TOKENS[look_ahead1_0] >= 10 && TOKENS[look_ahead1_0] <= 20)
alt1 = 1
end
case alt1
when 1
# 8:5: statement
statement()
else
break
end
matchedOnce1 = true
end
if !matchedOnce1
raise "Expected at least one match: 8:5: ( statement )+"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prog\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n\n begin\n # at line 39:11: PROGRAM LKEY ( dclrG ';' )* ( fun )* RKEY\n match( PROGRAM, TOKENS_FOLLOWING_PROGRAM_IN_prog_143 )\n match( LKEY, TOKENS_FOLLOWING_LKEY_IN_prog_145 ... | [
"0.6557726",
"0.64966625",
"0.64082855",
"0.6405478",
"0.6273288",
"0.6147533",
"0.61265707",
"0.6087651",
"0.6059083",
"0.6057022",
"0.6040212",
"0.60271275",
"0.6017735",
"0.6015768",
"0.59986776",
"0.59723914",
"0.595142",
"0.5949379",
"0.5926673",
"0.59220654",
"0.5916016... | 0.70164675 | 0 |
11:1: statement : class_definition ; | def statement()
# 12:5: class_definition
class_definition()
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def class_def!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 90 )\n\n type = CLASS_DEF\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 211:13: 'class'\n match( \"class\" )\n\n \n @s... | [
"0.65102553",
"0.6402253",
"0.6290183",
"0.6271027",
"0.62608737",
"0.6176078",
"0.6058641",
"0.5856577",
"0.5828014",
"0.580658",
"0.5741562",
"0.5734137",
"0.5697911",
"0.56886405",
"0.5638095",
"0.55806243",
"0.55677855",
"0.5481235",
"0.5340173",
"0.53293675",
"0.5324308"... | 0.82291096 | 0 |
15:1: class_definition : modifier[class_def] CLASS ( IDENTIFIER ) ( class_name_parameters[class_def] )? ( inheritance[class_def] )? ( interface[class_def] )? class_body[class_def] ; | def class_definition()
_IDENTIFIER1 = nil
class_def = ClassDefinition.new
# 19:7: modifier[class_def] CLASS ( IDENTIFIER ) ( class_name_parameters[class_def] )? ( inheritance[class_def] )? ( interface[class_def] )? class_body[class_def]
modifier(class_def)
match(:CLASS)
# 21:8: IDENTIFIER
_IDENTIFIER1 = @input.look_ahead(1)
match(:IDENTIFIER)
class_def.name = _IDENTIFIER1.text
# 22:7: ( class_name_parameters[class_def] )?
alt2 = 2
# 22:7: ( class_name_parameters[class_def] )?
look_ahead2_0 = look_ahead(1)
if look_ahead2_0 == :LEFT_ANGULAR_BRACKET
alt2 = 1
end
case alt2
when 1
# 22:9: class_name_parameters[class_def]
class_name_parameters(class_def)
end
# 23:7: ( inheritance[class_def] )?
alt3 = 2
# 23:7: ( inheritance[class_def] )?
look_ahead3_0 = look_ahead(1)
if look_ahead3_0 == :EXTENDS
alt3 = 1
end
case alt3
when 1
# 23:8: inheritance[class_def]
inheritance(class_def)
end
# 24:7: ( interface[class_def] )?
alt4 = 2
# 24:7: ( interface[class_def] )?
look_ahead4_0 = look_ahead(1)
if look_ahead4_0 == :IMPLEMENTS
alt4 = 1
end
case alt4
when 1
# 24:8: interface[class_def]
interface(class_def)
end
class_body(class_def)
puts class_def.report
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def defclass\n rule(Stone::AST::Statement::Class).sep('class').identifier(reserved)\n .option(rule.sep('extends').identifier(reserved))\n .ast(class_body)\n end",
"def class_def!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 90 )\n\n ... | [
"0.74939656",
"0.7127179",
"0.6956009",
"0.67881024",
"0.6708657",
"0.6292234",
"0.6068598",
"0.6067361",
"0.6051204",
"0.60408634",
"0.58979887",
"0.5869214",
"0.58670694",
"0.58670694",
"0.58670694",
"0.58670694",
"0.58670694",
"0.58670694",
"0.58559453",
"0.5823221",
"0.58... | 0.72146815 | 1 |
31:1: class_name_parameters[class_def] : '' ; | def class_name_parameters(class_def)
# 32:7: '<' ( class_special_identifier[class_def] )* '>'
match(:LEFT_ANGULAR_BRACKET)
class_def.name += '<'
# 33:7: ( class_special_identifier[class_def] )*
while true
alt5 = 2
# ()* loopback of 33:7: ( class_special_identifier[class_def] )*
look_ahead5_0 = look_ahead(1)
if look_ahead5_0 == :RIGHT_ANGULAR_BRACKET
# ()* loopback of 33:7: ( class_special_identifier[class_def] )*
look_ahead5_1 = look_ahead(2)
if look_ahead5_1 == :EXTENDS
# ()* loopback of 33:7: ( class_special_identifier[class_def] )*
look_ahead5_3 = look_ahead(3)
if look_ahead5_3 == :IDENTIFIER
# ()* loopback of 33:7: ( class_special_identifier[class_def] )*
look_ahead5_5 = look_ahead(4)
if (TOKENS[look_ahead5_5] >= 5 && TOKENS[look_ahead5_5] <= 6) || (TOKENS[look_ahead5_5] >= 25 && TOKENS[look_ahead5_5] <= 28)
alt5 = 1
end
elsif look_ahead5_3 == :EXTENDS || (TOKENS[look_ahead5_3] >= 25 && TOKENS[look_ahead5_3] <= 28)
alt5 = 1
end
elsif look_ahead5_1 == :IDENTIFIER || (TOKENS[look_ahead5_1] >= 25 && TOKENS[look_ahead5_1] <= 28)
alt5 = 1
end
elsif (TOKENS[look_ahead5_0] >= 5 && TOKENS[look_ahead5_0] <= 6) || look_ahead5_0 == :LEFT_ANGULAR_BRACKET || (TOKENS[look_ahead5_0] >= 27 && TOKENS[look_ahead5_0] <= 28)
alt5 = 1
end
case alt5
when 1
# 33:9: class_special_identifier[class_def]
class_special_identifier(class_def)
else
break
end
end
match(:RIGHT_ANGULAR_BRACKET)
class_def.name += '>'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def class_definition()\n \t_IDENTIFIER1 = nil\n\n\n\n\n \t class_def = ClassDefinition.new\n\n\n # 19:7: modifier[class_def] CLASS ( IDENTIFIER ) ( class_name_parameters[class_def] )? ( inheritance[class_def] )? ( interface[class_def] )? class_body[class_def]\n modifier(class_def)\n\n ... | [
"0.6824738",
"0.67987645",
"0.66409945",
"0.63728976",
"0.6364241",
"0.63227534",
"0.6314096",
"0.62888056",
"0.6264938",
"0.6258272",
"0.62322843",
"0.62115496",
"0.6182805",
"0.61624235",
"0.6115888",
"0.6109265",
"0.6036031",
"0.6031988",
"0.6002873",
"0.59990907",
"0.5997... | 0.6784476 | 2 |
37:1: class_special_identifier[class_def] : ( IDENTIFIER | ',' | '&' | '' | EXTENDS ); | def class_special_identifier(class_def)
_IDENTIFIER2 = nil
_EXTENDS3 = nil
# 38:5: ( IDENTIFIER | ',' | '&' | '<' | '>' | EXTENDS )
alt6 = 6
# 37:1: class_special_identifier[class_def] : ( IDENTIFIER | ',' | '&' | '<' | '>' | EXTENDS );
case look_ahead(1)
when :IDENTIFIER
alt6 = 1
when :COMMA
alt6 = 2
when :ECOMMERCIAL
alt6 = 3
when :LEFT_ANGULAR_BRACKET
alt6 = 4
when :RIGHT_ANGULAR_BRACKET
alt6 = 5
when :EXTENDS
alt6 = 6
else
raise "Expected: 37:1: class_special_identifier[class_def] : ( IDENTIFIER | ',' | '&' | '<' | '>' | EXTENDS );"
end
case alt6
when 1
# 38:7: IDENTIFIER
_IDENTIFIER2 = @input.look_ahead(1)
match(:IDENTIFIER)
class_def.name += _IDENTIFIER2.text
when 2
# 39:7: ','
match(:COMMA)
class_def.name += ", "
when 3
# 40:7: '&'
match(:ECOMMERCIAL)
class_def.name += " & "
when 4
# 41:7: '<'
match(:LEFT_ANGULAR_BRACKET)
class_def.name += '<'
when 5
# 42:7: '>'
match(:RIGHT_ANGULAR_BRACKET)
class_def.name += '>'
when 6
# 43:7: EXTENDS
_EXTENDS3 = @input.look_ahead(1)
match(:EXTENDS)
class_def.name += " #{_EXTENDS3.text} "
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def class_name_parameters(class_def)\n\n\n\n # 32:7: '<' ( class_special_identifier[class_def] )* '>'\n match(:LEFT_ANGULAR_BRACKET)\n class_def.name += '<'\n # 33:7: ( class_special_identifier[class_def] )*\n while true\n alt5 = 2\n # ()* loopback of 33:7:... | [
"0.6600726",
"0.62957686",
"0.5912002",
"0.5705198",
"0.5687842",
"0.5612305",
"0.55592203",
"0.55576074",
"0.53957504",
"0.53957504",
"0.53594077",
"0.53594077",
"0.53178704",
"0.5233183",
"0.52164525",
"0.51980525",
"0.5193508",
"0.51865226",
"0.51545185",
"0.5132156",
"0.5... | 0.8206093 | 0 |
46:1: inheritance[class_def] : EXTENDS IDENTIFIER ; | def inheritance(class_def)
_IDENTIFIER4 = nil
# 47:7: EXTENDS IDENTIFIER
match(:EXTENDS)
_IDENTIFIER4 = @input.look_ahead(1)
match(:IDENTIFIER)
class_def.add_parent(_IDENTIFIER4.text)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inherited(subclass); end",
"def defclass\n rule(Stone::AST::Statement::Class).sep('class').identifier(reserved)\n .option(rule.sep('extends').identifier(reserved))\n .ast(class_body)\n end",
"def inherited(subclass)\n longname = subclass.to_s\n if longname =~ /#<Class/\n ... | [
"0.6430645",
"0.6423231",
"0.6354229",
"0.6244149",
"0.6117889",
"0.6083603",
"0.60578054",
"0.5924209",
"0.5924209",
"0.59168917",
"0.5902433",
"0.57864916",
"0.57483524",
"0.5677862",
"0.56140363",
"0.5600279",
"0.5567146",
"0.5538005",
"0.55057734",
"0.5492515",
"0.5466746... | 0.80032134 | 0 |
50:1: interface[class_def] : IMPLEMENTS interface_name[class_def] ( ',' interface_name[class_def] ) ; | def interface(class_def)
# 51:7: IMPLEMENTS interface_name[class_def] ( ',' interface_name[class_def] )*
match(:IMPLEMENTS)
interface_name(class_def)
# 51:44: ( ',' interface_name[class_def] )*
while true
alt7 = 2
# ()* loopback of 51:44: ( ',' interface_name[class_def] )*
look_ahead7_0 = look_ahead(1)
if look_ahead7_0 == :COMMA
alt7 = 1
end
case alt7
when 1
# 51:45: ',' interface_name[class_def]
match(:COMMA)
interface_name(class_def)
else
break
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def interface_decls; end",
"def interface_methods; end",
"def interface; end",
"def interface; end",
"def implements(intf)\n @intfs[intf.name] = intf\n end",
"def interface_name(class_def)\n \t_IDENTIFIER5 = nil\n\n\n\n\n # 55:7: IDENTIFIER\n _IDENTIFIER5 = @input.look_ahead(1)\n... | [
"0.6798243",
"0.65958315",
"0.6458423",
"0.6458423",
"0.6082482",
"0.60443604",
"0.6023686",
"0.60179055",
"0.59333366",
"0.5928666",
"0.5817366",
"0.5804546",
"0.5753158",
"0.57449",
"0.56793624",
"0.56752676",
"0.5668235",
"0.5621536",
"0.55989933",
"0.5587963",
"0.55818504... | 0.81244135 | 0 |
54:1: interface_name[class_def] : IDENTIFIER ; | def interface_name(class_def)
_IDENTIFIER5 = nil
# 55:7: IDENTIFIER
_IDENTIFIER5 = @input.look_ahead(1)
match(:IDENTIFIER)
class_def.add_interface(_IDENTIFIER5.text)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def interface(class_def)\n\n\n\n # 51:7: IMPLEMENTS interface_name[class_def] ( ',' interface_name[class_def] )*\n match(:IMPLEMENTS)\n interface_name(class_def)\n\n # 51:44: ( ',' interface_name[class_def] )*\n while true\n alt7 = 2\n # ()* loopback of 51:4... | [
"0.7561626",
"0.6532876",
"0.65037364",
"0.6259207",
"0.61174834",
"0.60889566",
"0.60889566",
"0.6058583",
"0.60387003",
"0.60371566",
"0.60080034",
"0.5807053",
"0.5785225",
"0.5720503",
"0.5715231",
"0.56297827",
"0.5620438",
"0.55977786",
"0.55629426",
"0.553429",
"0.5532... | 0.80349755 | 0 |
64:1: member_definition[class_def] : ( attribute_definition[class_def] | method_definition[class_def] ); | def member_definition(class_def)
# 65:5: ( attribute_definition[class_def] | method_definition[class_def] )
alt9 = 2
alt9 = DFA9.predict(self, @input)
case alt9
when 1
# 65:7: attribute_definition[class_def]
attribute_definition(class_def)
when 2
# 66:7: method_definition[class_def]
method_definition(class_def)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attribute_definition(class_def)\n\n\n\n \t attribute = AttributeDefinition.new\n \t attributes = []\n\n\n # 75:5: modifier[attribute] type[attribute] attributes_list[attribute, attributes] ';'\n modifier(attribute)\n\n type(attribute)\n\n attributes_list(attribute, attr... | [
"0.6913914",
"0.6386713",
"0.57755905",
"0.56767255",
"0.56460524",
"0.5557844",
"0.5519601",
"0.5400056",
"0.5397057",
"0.5359947",
"0.53581834",
"0.53581834",
"0.53581834",
"0.53581834",
"0.53581834",
"0.53581834",
"0.5351991",
"0.53416",
"0.53398186",
"0.53398186",
"0.5328... | 0.8078765 | 0 |
69:1: attribute_definition[class_def] : modifier[attribute] type[attribute] attributes_list[attribute, attributes] ';' ; | def attribute_definition(class_def)
attribute = AttributeDefinition.new
attributes = []
# 75:5: modifier[attribute] type[attribute] attributes_list[attribute, attributes] ';'
modifier(attribute)
type(attribute)
attributes_list(attribute, attributes)
match(:SEMICOLON)
attributes.each do |attribute|
class_def.add_member(attribute)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_attribute(name, definition)\n @attributes << Attribute.new(name, definition)\n end",
"def type\n \"AttributeDefinition\"\n end",
"def attlistdecl element_name, attributes, raw_content\n end",
"def class_attribute(*attributes)\n attributes.each do |attr|\n singleton_... | [
"0.64628816",
"0.6089133",
"0.60219884",
"0.59646374",
"0.5877873",
"0.57286835",
"0.56590056",
"0.5631879",
"0.56016773",
"0.5563793",
"0.5486877",
"0.54669183",
"0.54328215",
"0.5431016",
"0.5431016",
"0.5415543",
"0.5399555",
"0.53659844",
"0.5349015",
"0.5326865",
"0.5295... | 0.8448942 | 0 |
82:1: attributes_list[attribute, attributes] : attribute_declarator[attribute, attributes] ( ',' attribute_declarator[attribute, attributes] ) ; | def attributes_list(attribute, attributes)
# 83:7: attribute_declarator[attribute, attributes] ( ',' attribute_declarator[attribute, attributes] )*
attribute_declarator(attribute, attributes)
# 84:7: ( ',' attribute_declarator[attribute, attributes] )*
while true
alt10 = 2
# ()* loopback of 84:7: ( ',' attribute_declarator[attribute, attributes] )*
look_ahead10_0 = look_ahead(1)
if look_ahead10_0 == :COMMA
alt10 = 1
end
case alt10
when 1
# 84:9: ',' attribute_declarator[attribute, attributes]
match(:COMMA)
attribute_declarator(attribute, attributes)
else
break
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attribute_list(el); end",
"def parse_attrlist\n tok = readbyte\n list = []\n currentname = nil\n currentvalue = \"\"\n while tok != END_T\n if tok == SWITCH_PAGE\n @attr_codepage = readbyte\n elsif tok ==... | [
"0.666165",
"0.658353",
"0.6466988",
"0.6364796",
"0.6283416",
"0.62484515",
"0.5990175",
"0.5987258",
"0.5944102",
"0.58615005",
"0.5830094",
"0.5803239",
"0.57881814",
"0.57443005",
"0.5705855",
"0.5657857",
"0.5641321",
"0.5635718",
"0.5586624",
"0.5532432",
"0.54859525",
... | 0.8498737 | 0 |
87:1: attribute_declarator[attribute_to_copy_from, attributes] : IDENTIFIER ( array_brackets[new_attribute] ) ( initialization )? ; | def attribute_declarator(attribute_to_copy_from, attributes)
_IDENTIFIER6 = nil
# 88:7: IDENTIFIER ( array_brackets[new_attribute] )* ( initialization )?
_IDENTIFIER6 = @input.look_ahead(1)
match(:IDENTIFIER)
new_attribute = AttributeDefinition.new
new_attribute.name = _IDENTIFIER6.text
new_attribute.line = _IDENTIFIER6.line
new_attribute.type = attribute_to_copy_from.type
new_attribute.copy_modifiers_from(attribute_to_copy_from)
attributes << new_attribute
# 96:7: ( array_brackets[new_attribute] )*
while true
alt11 = 2
# ()* loopback of 96:7: ( array_brackets[new_attribute] )*
look_ahead11_0 = look_ahead(1)
if look_ahead11_0 == :LEFT_SQUARE_BRACKET
alt11 = 1
end
case alt11
when 1
# 96:9: array_brackets[new_attribute]
array_brackets(new_attribute)
else
break
end
end
# 97:7: ( initialization )?
alt12 = 2
# 97:7: ( initialization )?
look_ahead12_0 = look_ahead(1)
if look_ahead12_0 == :EQUAL
alt12 = 1
end
case alt12
when 1
# 97:7: initialization
initialization()
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attributes_list(attribute, attributes)\n\n\n\n # 83:7: attribute_declarator[attribute, attributes] ( ',' attribute_declarator[attribute, attributes] )*\n attribute_declarator(attribute, attributes)\n\n # 84:7: ( ',' attribute_declarator[attribute, attributes] )*\n while true\n ... | [
"0.5805611",
"0.5570624",
"0.5570624",
"0.55329996",
"0.5459648",
"0.54561776",
"0.5432651",
"0.5388748",
"0.5381868",
"0.5354575",
"0.52950937",
"0.5275997",
"0.5272003",
"0.525509",
"0.5216679",
"0.52044433",
"0.5203584",
"0.5187949",
"0.51703733",
"0.5121716",
"0.5113662",... | 0.8486882 | 0 |
100:1: initialization : '=' initializer ; | def initialization()
# 101:7: '=' initializer
match(:EQUAL)
initializer()
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initial=(_arg0); end",
"def explicit=(_arg0); end",
"def assign!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n\n type = ASSIGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 373:10... | [
"0.65337896",
"0.65156853",
"0.63849956",
"0.6330144",
"0.6330144",
"0.6330144",
"0.6330144",
"0.6330144",
"0.6289354",
"0.62035704",
"0.62007624",
"0.6157247",
"0.61223173",
"0.6116186",
"0.60596",
"0.60596",
"0.60596",
"0.60596",
"0.60596",
"0.60596",
"0.60596",
"0.60596"... | 0.7721981 | 0 |
104:1: initializer : ( array_initializer | initializer_expression | 'new' IDENTIFIER '(' ')' ); | def initializer()
# 105:5: ( array_initializer | initializer_expression | 'new' IDENTIFIER '(' ')' )
alt13 = 3
# 104:1: initializer : ( array_initializer | initializer_expression | 'new' IDENTIFIER '(' ')' );
case look_ahead(1)
when :LEFT_BRACE
alt13 = 1
when :NUMBER
alt13 = 2
when :NEW
alt13 = 3
else
raise "Expected: 104:1: initializer : ( array_initializer | initializer_expression | 'new' IDENTIFIER '(' ')' );"
end
case alt13
when 1
# 105:7: array_initializer
array_initializer()
when 2
# 106:7: initializer_expression
initializer_expression()
when 3
# 107:7: 'new' IDENTIFIER '(' ')'
match(:NEW)
match(:IDENTIFIER)
match(:LEFT_PARENTESIS)
match(:RIGHT_PARENTESIS)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initializer_expression()\n\n\n\n # 115:7: NUMBER\n match(:NUMBER)\n\n\n\n end",
"def initialize(*); end",
"def constructor\n\t\t\tarray_of_arrays = []\n\t\t\t6.times do |i|\n\t\t\t\tarray_of_arrays[i] = []\n\t\t\t\t7.times do \n\t\t\t\t\tarray_of_arrays[i] << Token.new \n\t\t\t\tend\n\t\t\... | [
"0.6116102",
"0.594676",
"0.5759306",
"0.57430005",
"0.57430005",
"0.5628242",
"0.5576193",
"0.5439035",
"0.54320973",
"0.54213697",
"0.53995425",
"0.53995425",
"0.53995425",
"0.53995425",
"0.53995425",
"0.53914934",
"0.5359491",
"0.53590584",
"0.5327811",
"0.5318798",
"0.531... | 0.7965248 | 0 |
114:1: initializer_expression : NUMBER ; | def initializer_expression()
# 115:7: NUMBER
match(:NUMBER)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initializer()\n\n\n\n # 105:5: ( array_initializer | initializer_expression | 'new' IDENTIFIER '(' ')' )\n alt13 = 3\n # 104:1: initializer : ( array_initializer | initializer_expression | 'new' IDENTIFIER '(' ')' );\n case look_ahead(1)\n when :LEFT_BRACE\n ... | [
"0.6970793",
"0.60213274",
"0.5592673",
"0.54364383",
"0.54312545",
"0.52682745",
"0.5261831",
"0.52491176",
"0.5242437",
"0.52239233",
"0.5210084",
"0.51896834",
"0.51807684",
"0.516158",
"0.5149789",
"0.51078415",
"0.5102738",
"0.5054558",
"0.5053584",
"0.50286204",
"0.5024... | 0.8555968 | 0 |
118:1: method_definition[class_def] : modifier[method] ( type[method] )? IDENTIFIER parameters[method] ( method_body[method] | ';' ) ; | def method_definition(class_def)
_IDENTIFIER7 = nil
method = MethodDefinition.new
# 123:5: modifier[method] ( type[method] )? IDENTIFIER parameters[method] ( method_body[method] | ';' )
modifier(method)
# 123:22: ( type[method] )?
alt16 = 2
# 123:22: ( type[method] )?
look_ahead16_0 = look_ahead(1)
if look_ahead16_0 == :IDENTIFIER
# 123:22: ( type[method] )?
look_ahead16_1 = look_ahead(2)
if look_ahead16_1 == :IDENTIFIER || look_ahead16_1 == :LEFT_ANGULAR_BRACKET || (TOKENS[look_ahead16_1] >= 34 && TOKENS[look_ahead16_1] <= 35)
alt16 = 1
end
end
case alt16
when 1
# 123:23: type[method]
type(method)
end
_IDENTIFIER7 = @input.look_ahead(1)
match(:IDENTIFIER)
parameters(method)
# 123:68: ( method_body[method] | ';' )
alt17 = 2
# 123:68: ( method_body[method] | ';' )
look_ahead17_0 = look_ahead(1)
if look_ahead17_0 == :LEFT_BRACE
alt17 = 1
elsif look_ahead17_0 == :SEMICOLON
alt17 = 2
else
raise "Expected: 123:68: ( method_body[method] | ';' )"
end
case alt17
when 1
# 123:69: method_body[method]
method_body(method)
when 2
# 123:89: ';'
match(:SEMICOLON)
end
method.name = _IDENTIFIER7.text
method.line = _IDENTIFIER7.line
class_def.add_member(method)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_method_declaration\n if peek?(:KW_MAIN)\n parse_main_declaration\n elsif peek?(:KW_CONSTRUCTOR)\n parse_constructor_declaration\n else\n method = DefMethod.new(nil, nil,nil, nil, nil)\n @methods << method\n\n name = expect(:ID)\n params = parse_params\n\n expec... | [
"0.6689681",
"0.6600036",
"0.65753216",
"0.6524118",
"0.63120604",
"0.6291142",
"0.6039755",
"0.603671",
"0.59876734",
"0.597837",
"0.57888997",
"0.57077396",
"0.5648229",
"0.5549138",
"0.5540005",
"0.5539354",
"0.5539354",
"0.552958",
"0.5519014",
"0.5517408",
"0.5517408",
... | 0.80545115 | 0 |
137:1: body_statement[method] : ( local_variable_declaration[method] | return_expression[method] | assign_operation[method] | method_call[method] ); | def body_statement(method)
# 138:5: ( local_variable_declaration[method] | return_expression[method] | assign_operation[method] | method_call[method] )
alt19 = 4
alt19 = DFA19.predict(self, @input)
case alt19
when 1
# 138:7: local_variable_declaration[method]
local_variable_declaration(method)
when 2
# 139:7: return_expression[method]
return_expression(method)
when 3
# 140:7: assign_operation[method]
assign_operation(method)
when 4
# 141:7: method_call[method]
method_call(method)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unchanged_body_expr=(_); end",
"def variable_assignment_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n\n value = nil\n\n\n a = nil\n type = nil\n b = nil\n\n\n begin\n # at line 97:6: a= function_call_stateme... | [
"0.6094948",
"0.5850102",
"0.5829558",
"0.5814935",
"0.5781374",
"0.5769771",
"0.570541",
"0.56263775",
"0.56263775",
"0.5557723",
"0.5502586",
"0.55014473",
"0.5490994",
"0.5456403",
"0.54550344",
"0.543898",
"0.5395413",
"0.53862894",
"0.5380676",
"0.53559977",
"0.5352324",... | 0.7761778 | 0 |
144:1: local_variable_declaration[method] : variable_modifier type[dummy_variable] local_variable_list[dummy_variable, local_variables, method] ';' ; | def local_variable_declaration(method)
dummy_variable = LocalVariableDefinition.new
local_variables = []
# 149:7: variable_modifier type[dummy_variable] local_variable_list[dummy_variable, local_variables, method] ';'
variable_modifier()
type(dummy_variable)
local_variable_list(dummy_variable, local_variables, method)
match(:SEMICOLON)
local_variables.each do |local_variable|
method.add_local_variable(local_variable)
end
local_variables.each do |local_variable|
method.add_use_of(local_variable.name, local_variable.line) if local_variable.was_initialized?
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def local_variable_declarator(dummy_variable, local_variables, method)\n \t_IDENTIFIER8 = nil\n\n\n\n\n \t local_variable = LocalVariableDefinition.new\n\n\n # 169:7: IDENTIFIER ( '[' ']' )* ( local_variable_initialization[method] )?\n _IDENTIFIER8 = @input.look_ahead(1)\n match(:IDEN... | [
"0.69328755",
"0.6571559",
"0.64915866",
"0.6488337",
"0.6350899",
"0.63045347",
"0.61181015",
"0.59293145",
"0.59268725",
"0.5864013",
"0.5822507",
"0.5790846",
"0.5751892",
"0.5748313",
"0.5735289",
"0.5728408",
"0.57247424",
"0.5712769",
"0.5625442",
"0.5567634",
"0.556271... | 0.8630151 | 0 |
160:1: local_variable_list[dummy_variable, local_variables, method] : local_variable_declarator[dummy_variable, local_variables, method] ( ',' local_variable_declarator[dummy_variable, local_variables, method] ) ; | def local_variable_list(dummy_variable, local_variables, method)
# 161:7: local_variable_declarator[dummy_variable, local_variables, method] ( ',' local_variable_declarator[dummy_variable, local_variables, method] )*
local_variable_declarator(dummy_variable, local_variables, method)
# 162:7: ( ',' local_variable_declarator[dummy_variable, local_variables, method] )*
while true
alt20 = 2
# ()* loopback of 162:7: ( ',' local_variable_declarator[dummy_variable, local_variables, method] )*
look_ahead20_0 = look_ahead(1)
if look_ahead20_0 == :COMMA
alt20 = 1
end
case alt20
when 1
# 162:8: ',' local_variable_declarator[dummy_variable, local_variables, method]
match(:COMMA)
local_variable_declarator(dummy_variable, local_variables, method)
else
break
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def local_variable_declarator(dummy_variable, local_variables, method)\n \t_IDENTIFIER8 = nil\n\n\n\n\n \t local_variable = LocalVariableDefinition.new\n\n\n # 169:7: IDENTIFIER ( '[' ']' )* ( local_variable_initialization[method] )?\n _IDENTIFIER8 = @input.look_ahead(1)\n match(:IDEN... | [
"0.742689",
"0.7172824",
"0.6517705",
"0.6245364",
"0.6129492",
"0.60790837",
"0.6014788",
"0.57097745",
"0.56499904",
"0.55184716",
"0.54335123",
"0.5425081",
"0.54171205",
"0.54110307",
"0.5397069",
"0.5396712",
"0.5301926",
"0.52994615",
"0.52703404",
"0.5269776",
"0.52533... | 0.8568527 | 0 |
165:1: local_variable_declarator[dummy_variable, local_variables, method] : IDENTIFIER ( '[' ']' ) ( local_variable_initialization[method] )? ; | def local_variable_declarator(dummy_variable, local_variables, method)
_IDENTIFIER8 = nil
local_variable = LocalVariableDefinition.new
# 169:7: IDENTIFIER ( '[' ']' )* ( local_variable_initialization[method] )?
_IDENTIFIER8 = @input.look_ahead(1)
match(:IDENTIFIER)
local_variable.name = _IDENTIFIER8.text
local_variable.line = _IDENTIFIER8.line
local_variable.type = dummy_variable.type
# 174:7: ( '[' ']' )*
while true
alt21 = 2
# ()* loopback of 174:7: ( '[' ']' )*
look_ahead21_0 = look_ahead(1)
if look_ahead21_0 == :LEFT_SQUARE_BRACKET
alt21 = 1
end
case alt21
when 1
# 174:8: '[' ']'
match(:LEFT_SQUARE_BRACKET)
match(:RIGHT_SQUARE_BRACKET)
local_variable.type << "[]"
else
break
end
end
# 175:7: ( local_variable_initialization[method] )?
alt22 = 2
# 175:7: ( local_variable_initialization[method] )?
look_ahead22_0 = look_ahead(1)
if look_ahead22_0 == :EQUAL
alt22 = 1
end
case alt22
when 1
# 175:8: local_variable_initialization[method]
local_variable_initialization(method)
local_variable.was_initialized
end
local_variables << local_variable
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def local_variable_list(dummy_variable, local_variables, method)\n\n\n\n # 161:7: local_variable_declarator[dummy_variable, local_variables, method] ( ',' local_variable_declarator[dummy_variable, local_variables, method] )*\n local_variable_declarator(dummy_variable, local_variables, method)\n\n ... | [
"0.7048456",
"0.691103",
"0.62125534",
"0.554567",
"0.5533443",
"0.54931337",
"0.5256843",
"0.5230073",
"0.5114104",
"0.51046985",
"0.49924442",
"0.49361506",
"0.49336442",
"0.49288625",
"0.489634",
"0.48718184",
"0.48348978",
"0.48302373",
"0.47928542",
"0.4785738",
"0.47778... | 0.83473736 | 0 |
181:1: local_variable_initialization[method] : '=' ( constructor_call[method] | ( expression[method] ) ) ; | def local_variable_initialization(method)
# 182:7: '=' ( constructor_call[method] | ( expression[method] )* )
match(:EQUAL)
# 182:11: ( constructor_call[method] | ( expression[method] )* )
alt24 = 2
# 182:11: ( constructor_call[method] | ( expression[method] )* )
look_ahead24_0 = look_ahead(1)
if look_ahead24_0 == :NEW
alt24 = 1
elsif look_ahead24_0 == :IDENTIFIER || look_ahead24_0 == :NUMBER || (TOKENS[look_ahead24_0] >= 24 && TOKENS[look_ahead24_0] <= 28) || (TOKENS[look_ahead24_0] >= 31 && TOKENS[look_ahead24_0] <= 32) || (TOKENS[look_ahead24_0] >= 35 && TOKENS[look_ahead24_0] <= 46) || (TOKENS[look_ahead24_0] >= 48 && TOKENS[look_ahead24_0] <= 49) || look_ahead24_0 == :T58
alt24 = 2
else
raise "Expected: 182:11: ( constructor_call[method] | ( expression[method] )* )"
end
case alt24
when 1
# 182:12: constructor_call[method]
constructor_call(method)
when 2
# 182:39: ( expression[method] )*
# 182:39: ( expression[method] )*
while true
alt23 = 2
# ()* loopback of 182:39: ( expression[method] )*
look_ahead23_0 = look_ahead(1)
if look_ahead23_0 == :IDENTIFIER || look_ahead23_0 == :NUMBER || (TOKENS[look_ahead23_0] >= 25 && TOKENS[look_ahead23_0] <= 26) || look_ahead23_0 == :ECOMMERCIAL || (TOKENS[look_ahead23_0] >= 31 && TOKENS[look_ahead23_0] <= 32) || (TOKENS[look_ahead23_0] >= 35 && TOKENS[look_ahead23_0] <= 46) || (TOKENS[look_ahead23_0] >= 48 && TOKENS[look_ahead23_0] <= 49) || look_ahead23_0 == :T58
alt23 = 1
end
case alt23
when 1
# 182:39: expression[method]
expression(method)
else
break
end
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def local_variable_declarator(dummy_variable, local_variables, method)\n \t_IDENTIFIER8 = nil\n\n\n\n\n \t local_variable = LocalVariableDefinition.new\n\n\n # 169:7: IDENTIFIER ( '[' ']' )* ( local_variable_initialization[method] )?\n _IDENTIFIER8 = @input.look_ahead(1)\n match(:IDEN... | [
"0.62917703",
"0.5934706",
"0.5788724",
"0.56597584",
"0.5550818",
"0.54226553",
"0.54180497",
"0.54179394",
"0.5400153",
"0.5367586",
"0.53587425",
"0.53433996",
"0.53332883",
"0.5329136",
"0.5325182",
"0.5317991",
"0.52691716",
"0.52643466",
"0.52577126",
"0.5256892",
"0.52... | 0.7673242 | 0 |
185:1: constructor_call[method] : 'new' IDENTIFIER '(' ( expression[method] ) ')' ; | def constructor_call(method)
_IDENTIFIER9 = nil
# 186:7: 'new' IDENTIFIER '(' ( expression[method] )* ')'
match(:NEW)
_IDENTIFIER9 = @input.look_ahead(1)
match(:IDENTIFIER)
match(:LEFT_PARENTESIS)
# 186:28: ( expression[method] )*
while true
alt25 = 2
# ()* loopback of 186:28: ( expression[method] )*
look_ahead25_0 = look_ahead(1)
if look_ahead25_0 == :IDENTIFIER || look_ahead25_0 == :NUMBER || (TOKENS[look_ahead25_0] >= 25 && TOKENS[look_ahead25_0] <= 26) || look_ahead25_0 == :ECOMMERCIAL || (TOKENS[look_ahead25_0] >= 31 && TOKENS[look_ahead25_0] <= 32) || (TOKENS[look_ahead25_0] >= 35 && TOKENS[look_ahead25_0] <= 46) || (TOKENS[look_ahead25_0] >= 48 && TOKENS[look_ahead25_0] <= 49) || look_ahead25_0 == :T58
alt25 = 1
end
case alt25
when 1
# 186:28: expression[method]
expression(method)
else
break
end
end
match(:RIGHT_PARENTESIS)
method.add_method_call( "#{_IDENTIFIER9.text} constructor", _IDENTIFIER9.line)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call_as_constructor(ctx,object,argumentCount,arguments,exception)\n JS::Lib.JSObjectCallAsConstructor(ctx,object,argumentCount,arguments,exception)\n end",
"def local_variable_initialization(method)\n\n\n\n # 182:7: '=' ( constructor_call[method] | ( expression[method] )* )\n match(... | [
"0.6180802",
"0.5962797",
"0.5693113",
"0.5604008",
"0.5604008",
"0.5604008",
"0.5604008",
"0.5604008",
"0.5604008",
"0.5604008",
"0.5604008",
"0.5604008",
"0.5581824",
"0.55781084",
"0.55726504",
"0.55528665",
"0.5550575",
"0.5546853",
"0.55165666",
"0.55114627",
"0.549085",... | 0.83154494 | 0 |
192:1: return_expression[method] : RETURN ( expression[method] ) ';' ; | def return_expression(method)
# 193:7: RETURN ( expression[method] )* ';'
match(:RETURN)
# 193:14: ( expression[method] )*
while true
alt26 = 2
# ()* loopback of 193:14: ( expression[method] )*
look_ahead26_0 = look_ahead(1)
if look_ahead26_0 == :IDENTIFIER || look_ahead26_0 == :NUMBER || (TOKENS[look_ahead26_0] >= 25 && TOKENS[look_ahead26_0] <= 26) || look_ahead26_0 == :ECOMMERCIAL || (TOKENS[look_ahead26_0] >= 31 && TOKENS[look_ahead26_0] <= 32) || (TOKENS[look_ahead26_0] >= 35 && TOKENS[look_ahead26_0] <= 46) || (TOKENS[look_ahead26_0] >= 48 && TOKENS[look_ahead26_0] <= 49) || look_ahead26_0 == :T58
alt26 = 1
end
case alt26
when 1
# 193:16: expression[method]
expression(method)
else
break
end
end
match(:SEMICOLON)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def returning(expression, name=nil)\n str = \"returning #{expression}\"\n str += \" as #{name}\" if name\n @returning_expression = str\n end",
"def return_statement\n unless token_is? :return\n return nil\n end\n\n @scanner.get_next_token # :return\n expr = expression... | [
"0.73014814",
"0.7221371",
"0.72035974",
"0.7091044",
"0.70406485",
"0.7037299",
"0.694996",
"0.6694839",
"0.65806746",
"0.6574233",
"0.64756876",
"0.6404895",
"0.6372579",
"0.6349473",
"0.6297559",
"0.62885946",
"0.62718844",
"0.6266838",
"0.6176473",
"0.6119463",
"0.6111506... | 0.8224173 | 0 |
196:1: method_call[method] : called_method_name[method] '(' ( arguments[method] )? ')' ';' ; | def method_call(method)
# 197:7: called_method_name[method] '(' ( arguments[method] )? ')' ';'
called_method_name(method)
match(:LEFT_PARENTESIS)
# 197:38: ( arguments[method] )?
alt27 = 2
# 197:38: ( arguments[method] )?
look_ahead27_0 = look_ahead(1)
if look_ahead27_0 == :IDENTIFIER || look_ahead27_0 == :NUMBER || (TOKENS[look_ahead27_0] >= 25 && TOKENS[look_ahead27_0] <= 26) || look_ahead27_0 == :ECOMMERCIAL || (TOKENS[look_ahead27_0] >= 31 && TOKENS[look_ahead27_0] <= 32) || (TOKENS[look_ahead27_0] >= 35 && TOKENS[look_ahead27_0] <= 46) || (TOKENS[look_ahead27_0] >= 48 && TOKENS[look_ahead27_0] <= 49) || look_ahead27_0 == :T58
alt27 = 1
end
case alt27
when 1
# 197:38: arguments[method]
arguments(method)
end
match(:RIGHT_PARENTESIS)
match(:SEMICOLON)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call(method, args)\n send(method, *args)\n end",
"def call_method(method_name, params=nil)\n if params.nil?\n self.method(method_name).call\n else\n self.method(method_name).call(params)\n end\n end",
"def call(method, arguments=[], context)\n value = (@runtime_class.lo... | [
"0.7602898",
"0.7124755",
"0.70866024",
"0.69153863",
"0.6768088",
"0.674845",
"0.67325836",
"0.67206514",
"0.67206514",
"0.66969705",
"0.66875803",
"0.66270965",
"0.66270965",
"0.6624099",
"0.6612666",
"0.65824586",
"0.6556328",
"0.6532934",
"0.6532934",
"0.65082735",
"0.649... | 0.8292214 | 0 |
200:1: called_method_name[method] : ( 'this' '.' )? IDENTIFIER ( fragment_of_called_method_name[method_name] ) ; | def called_method_name(method)
_IDENTIFIER10 = nil
method_name = ""
# 204:7: ( 'this' '.' )? IDENTIFIER ( fragment_of_called_method_name[method_name] )*
# 204:7: ( 'this' '.' )?
alt28 = 2
# 204:7: ( 'this' '.' )?
look_ahead28_0 = look_ahead(1)
if look_ahead28_0 == :T58
alt28 = 1
end
case alt28
when 1
# 204:9: 'this' '.'
match(:T58)
match(:DOT)
end
_IDENTIFIER10 = @input.look_ahead(1)
match(:IDENTIFIER)
method_name << _IDENTIFIER10.text
# 206:7: ( fragment_of_called_method_name[method_name] )*
while true
alt29 = 2
# ()* loopback of 206:7: ( fragment_of_called_method_name[method_name] )*
look_ahead29_0 = look_ahead(1)
if look_ahead29_0 == :DOT
alt29 = 1
end
case alt29
when 1
# 206:7: fragment_of_called_method_name[method_name]
fragment_of_called_method_name(method_name)
else
break
end
end
method.add_method_call(method_name, _IDENTIFIER10.line)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fragment_of_called_method_name(method_name)\n \t_IDENTIFIER11 = nil\n\n\n\n\n # 227:7: '.' IDENTIFIER\n match(:DOT)\n _IDENTIFIER11 = @input.look_ahead(1)\n match(:IDENTIFIER)\n method_name << \".#{_IDENTIFIER11.text}\"\n\n\n\n end",
"def method_call(method)\n\n\n\n ... | [
"0.7759469",
"0.6958594",
"0.68435764",
"0.668585",
"0.65680987",
"0.65680987",
"0.65680987",
"0.65680987",
"0.65680987",
"0.65680987",
"0.65680987",
"0.65680987",
"0.65680987",
"0.65680987",
"0.65680987",
"0.65680987",
"0.65151817",
"0.644784",
"0.6436002",
"0.6362276",
"0.6... | 0.7794436 | 0 |
210:1: arguments[method] : first_argument[method] ( other_arguments[method] ) ; | def arguments(method)
# 211:7: first_argument[method] ( other_arguments[method] )*
first_argument(method)
# 211:30: ( other_arguments[method] )*
while true
alt30 = 2
# ()* loopback of 211:30: ( other_arguments[method] )*
look_ahead30_0 = look_ahead(1)
if look_ahead30_0 == :COMMA
alt30 = 1
end
case alt30
when 1
# 211:32: other_arguments[method]
other_arguments(method)
else
break
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def first_argument(method)\n\n\n\n # 215:7: argument[method]\n argument(method)\n\n\n\n\n end",
"def other_arguments(method)\n\n\n\n # 219:7: ',' argument[method]\n match(:COMMA)\n argument(method)\n\n\n\n\n end",
"def method(arg_1, arg_2)\n p arg_1\n p arg_2\nend",
... | [
"0.8025585",
"0.75105107",
"0.6875673",
"0.677167",
"0.67313474",
"0.67034185",
"0.66728705",
"0.6635947",
"0.66111207",
"0.6592582",
"0.65695554",
"0.6557301",
"0.6557301",
"0.6543545",
"0.6480261",
"0.6441614",
"0.6441614",
"0.6441614",
"0.6428472",
"0.6406274",
"0.6386792"... | 0.773052 | 1 |
214:1: first_argument[method] : argument[method] ; | def first_argument(method)
# 215:7: argument[method]
argument(method)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arguments(method)\n\n\n\n # 211:7: first_argument[method] ( other_arguments[method] )*\n first_argument(method)\n\n # 211:30: ( other_arguments[method] )*\n while true\n alt30 = 2\n # ()* loopback of 211:30: ( other_arguments[method] )*\n look_ahead3... | [
"0.71101654",
"0.6851663",
"0.6657612",
"0.6526276",
"0.6526276",
"0.6340849",
"0.625301",
"0.6240512",
"0.6236947",
"0.61447304",
"0.60747033",
"0.60747033",
"0.60747033",
"0.6048668",
"0.6048668",
"0.6048668",
"0.6048668",
"0.6018942",
"0.6018942",
"0.5996748",
"0.59941894"... | 0.91116697 | 0 |
218:1: other_arguments[method] : ',' argument[method] ; | def other_arguments(method)
# 219:7: ',' argument[method]
match(:COMMA)
argument(method)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arguments(method)\n\n\n\n # 211:7: first_argument[method] ( other_arguments[method] )*\n first_argument(method)\n\n # 211:30: ( other_arguments[method] )*\n while true\n alt30 = 2\n # ()* loopback of 211:30: ( other_arguments[method] )*\n look_ahead3... | [
"0.79439497",
"0.68954206",
"0.6853849",
"0.67737496",
"0.6717039",
"0.65925777",
"0.6581383",
"0.6551397",
"0.65335584",
"0.6348168",
"0.63090336",
"0.63090336",
"0.63090336",
"0.6289644",
"0.6275767",
"0.6223197",
"0.6183584",
"0.6168522",
"0.61231536",
"0.6064304",
"0.6053... | 0.8570149 | 0 |
222:1: argument[method] : ( expression[method] )+ ; | def argument(method)
# 223:7: ( expression[method] )+
# 223:7: ( expression[method] )+
matchedOnce31 = false
while true
alt31 = 2
# ()+ loopback of 223:7: ( expression[method] )+
look_ahead31_0 = look_ahead(1)
if look_ahead31_0 == :IDENTIFIER || look_ahead31_0 == :NUMBER || (TOKENS[look_ahead31_0] >= 25 && TOKENS[look_ahead31_0] <= 26) || look_ahead31_0 == :ECOMMERCIAL || (TOKENS[look_ahead31_0] >= 31 && TOKENS[look_ahead31_0] <= 32) || (TOKENS[look_ahead31_0] >= 35 && TOKENS[look_ahead31_0] <= 46) || (TOKENS[look_ahead31_0] >= 48 && TOKENS[look_ahead31_0] <= 49) || look_ahead31_0 == :T58
alt31 = 1
end
case alt31
when 1
# 223:7: expression[method]
expression(method)
else
break
end
matchedOnce31 = true
end
if !matchedOnce31
raise "Expected at least one match: 223:7: ( expression[method] )+"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def other_arguments(method)\n\n\n\n # 219:7: ',' argument[method]\n match(:COMMA)\n argument(method)\n\n\n\n\n end",
"def first_argument(method)\n\n\n\n # 215:7: argument[method]\n argument(method)\n\n\n\n\n end",
"def arguments(method)\n\n\n\n # 211:7: first_arg... | [
"0.74750936",
"0.7417164",
"0.71561474",
"0.68366647",
"0.6812575",
"0.67807394",
"0.6759945",
"0.6674962",
"0.6653788",
"0.6653788",
"0.6653788",
"0.6641053",
"0.64481515",
"0.64097506",
"0.64097506",
"0.6395763",
"0.6395763",
"0.6395763",
"0.6362004",
"0.6313679",
"0.630426... | 0.80432516 | 0 |
226:1: fragment_of_called_method_name[method_name] : '.' IDENTIFIER ; | def fragment_of_called_method_name(method_name)
_IDENTIFIER11 = nil
# 227:7: '.' IDENTIFIER
match(:DOT)
_IDENTIFIER11 = @input.look_ahead(1)
match(:IDENTIFIER)
method_name << ".#{_IDENTIFIER11.text}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def called_method_name(method)\n \t_IDENTIFIER10 = nil\n\n\n\n\n \t method_name = \"\"\n\n\n # 204:7: ( 'this' '.' )? IDENTIFIER ( fragment_of_called_method_name[method_name] )*\n # 204:7: ( 'this' '.' )?\n alt28 = 2\n # 204:7: ( 'this' '.' )?\n look_ahead28_0 = look_ahe... | [
"0.78167605",
"0.6532732",
"0.63910246",
"0.63910246",
"0.63699317",
"0.62473285",
"0.6169149",
"0.6164754",
"0.61590374",
"0.61390865",
"0.610215",
"0.610215",
"0.610215",
"0.610215",
"0.610215",
"0.610215",
"0.610215",
"0.610215",
"0.610215",
"0.610215",
"0.610215",
"0.61... | 0.84978247 | 0 |
230:1: assign_operation[method] : variable_name[method] assign_operator ( expression[method] ) ';' ; | def assign_operation(method)
# 231:7: variable_name[method] assign_operator ( expression[method] )* ';'
variable_name(method)
assign_operator()
# 231:45: ( expression[method] )*
while true
alt32 = 2
# ()* loopback of 231:45: ( expression[method] )*
look_ahead32_0 = look_ahead(1)
if look_ahead32_0 == :IDENTIFIER || look_ahead32_0 == :NUMBER || (TOKENS[look_ahead32_0] >= 25 && TOKENS[look_ahead32_0] <= 26) || look_ahead32_0 == :ECOMMERCIAL || (TOKENS[look_ahead32_0] >= 31 && TOKENS[look_ahead32_0] <= 32) || (TOKENS[look_ahead32_0] >= 35 && TOKENS[look_ahead32_0] <= 46) || (TOKENS[look_ahead32_0] >= 48 && TOKENS[look_ahead32_0] <= 49) || look_ahead32_0 == :T58
alt32 = 1
end
case alt32
when 1
# 231:47: expression[method]
expression(method)
else
break
end
end
match(:SEMICOLON)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assign_operator()\n\n\n\n # 289:5: ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' )\n alt42 = 12\n # 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '... | [
"0.715573",
"0.7058073",
"0.6576486",
"0.65378016",
"0.6519319",
"0.6492897",
"0.64720374",
"0.6457977",
"0.6435549",
"0.6390605",
"0.6339971",
"0.6274303",
"0.6229864",
"0.622036",
"0.62112236",
"0.62018424",
"0.61505336",
"0.6134512",
"0.60854065",
"0.5993569",
"0.59702796"... | 0.82075787 | 0 |
234:1: variable_name[method] : ( 'this' '.' )? IDENTIFIER ; | def variable_name(method)
_IDENTIFIER12 = nil
name = ""
# 238:7: ( 'this' '.' )? IDENTIFIER
# 238:7: ( 'this' '.' )?
alt33 = 2
# 238:7: ( 'this' '.' )?
look_ahead33_0 = look_ahead(1)
if look_ahead33_0 == :T58
alt33 = 1
end
case alt33
when 1
# 238:9: 'this' '.'
match(:T58)
match(:DOT)
name << "this."
end
_IDENTIFIER12 = @input.look_ahead(1)
match(:IDENTIFIER)
name << _IDENTIFIER12.text
method.add_use_of(name, _IDENTIFIER12.line)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def variable_or_method_use(method)\n \t_IDENTIFIER13 = nil\n\n\n\n\n \t name = \"\"\n \t is_method = false\n\n\n # 254:7: ( 'this' '.' )? ( IDENTIFIER ) ( fragment_of_variable_or_method_name[name] )* ( '(' ')' )?\n # 254:7: ( 'this' '.' )?\n alt35 = 2\n # 254:7: ( 'this' ... | [
"0.6906352",
"0.6291929",
"0.62187076",
"0.61607283",
"0.6159476",
"0.6159476",
"0.61420864",
"0.6140236",
"0.5941264",
"0.5941264",
"0.58898085",
"0.588442",
"0.5781593",
"0.5761247",
"0.56726",
"0.56726",
"0.5592575",
"0.5551384",
"0.5536002",
"0.553247",
"0.55199516",
"0... | 0.74400586 | 0 |
244:1: expression[method] : ( variable_or_method_use[method] | any_expression[method] ); | def expression(method)
# 245:5: ( variable_or_method_use[method] | any_expression[method] )
alt34 = 2
# 244:1: expression[method] : ( variable_or_method_use[method] | any_expression[method] );
look_ahead34_0 = look_ahead(1)
if look_ahead34_0 == :IDENTIFIER || look_ahead34_0 == :T58
alt34 = 1
elsif look_ahead34_0 == :NUMBER || (TOKENS[look_ahead34_0] >= 25 && TOKENS[look_ahead34_0] <= 26) || look_ahead34_0 == :ECOMMERCIAL || (TOKENS[look_ahead34_0] >= 31 && TOKENS[look_ahead34_0] <= 32) || (TOKENS[look_ahead34_0] >= 35 && TOKENS[look_ahead34_0] <= 46) || (TOKENS[look_ahead34_0] >= 48 && TOKENS[look_ahead34_0] <= 49)
alt34 = 2
else
raise "Expected: 244:1: expression[method] : ( variable_or_method_use[method] | any_expression[method] );"
end
case alt34
when 1
# 245:7: variable_or_method_use[method]
variable_or_method_use(method)
when 2
# 246:7: any_expression[method]
any_expression(method)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def any_expression(method)\n\n\n\n # 273:5: ( '(' ( expression[method] )+ ')' | NUMBER | expression_operator | double_quoted_expression | single_quoted_expression )\n alt39 = 5\n # 272:1: any_expression[method] : ( '(' ( expression[method] )+ ')' | NUMBER | expression_operator | double_quoted_... | [
"0.7074755",
"0.6865965",
"0.6836124",
"0.6683514",
"0.63048166",
"0.6277126",
"0.6251025",
"0.6041379",
"0.59916234",
"0.5893276",
"0.5893276",
"0.58521205",
"0.58521205",
"0.5716392",
"0.5685543",
"0.5659366",
"0.56493163",
"0.56361705",
"0.56302196",
"0.5620805",
"0.553406... | 0.78968996 | 0 |
249:1: variable_or_method_use[method] : ( 'this' '.' )? ( IDENTIFIER ) ( fragment_of_variable_or_method_name[name] ) ( '(' ')' )? ; | def variable_or_method_use(method)
_IDENTIFIER13 = nil
name = ""
is_method = false
# 254:7: ( 'this' '.' )? ( IDENTIFIER ) ( fragment_of_variable_or_method_name[name] )* ( '(' ')' )?
# 254:7: ( 'this' '.' )?
alt35 = 2
# 254:7: ( 'this' '.' )?
look_ahead35_0 = look_ahead(1)
if look_ahead35_0 == :T58
alt35 = 1
end
case alt35
when 1
# 254:9: 'this' '.'
match(:T58)
match(:DOT)
name << "this."
end
# 255:9: IDENTIFIER
_IDENTIFIER13 = @input.look_ahead(1)
match(:IDENTIFIER)
name << _IDENTIFIER13.text
# 256:7: ( fragment_of_variable_or_method_name[name] )*
while true
alt36 = 2
# ()* loopback of 256:7: ( fragment_of_variable_or_method_name[name] )*
look_ahead36_0 = look_ahead(1)
if look_ahead36_0 == :DOT
alt36 = 1
end
case alt36
when 1
# 256:7: fragment_of_variable_or_method_name[name]
fragment_of_variable_or_method_name(name)
else
break
end
end
# 257:7: ( '(' ')' )?
alt37 = 2
# 257:7: ( '(' ')' )?
look_ahead37_0 = look_ahead(1)
if look_ahead37_0 == :LEFT_PARENTESIS
# 257:7: ( '(' ')' )?
look_ahead37_1 = look_ahead(2)
if look_ahead37_1 == :RIGHT_PARENTESIS
alt37 = 1
end
end
case alt37
when 1
# 257:9: '(' ')'
match(:LEFT_PARENTESIS)
match(:RIGHT_PARENTESIS)
is_method = true
end
if is_method
method.add_method_call(name, _IDENTIFIER13.line)
else
method.add_use_of(name, _IDENTIFIER13.line)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def variable_name(method)\n \t_IDENTIFIER12 = nil\n\n\n\n\n \t name = \"\"\n\n\n # 238:7: ( 'this' '.' )? IDENTIFIER\n # 238:7: ( 'this' '.' )?\n alt33 = 2\n # 238:7: ( 'this' '.' )?\n look_ahead33_0 = look_ahead(1)\n\n if look_ahead33_0 == :T58 \n alt33... | [
"0.6583175",
"0.56895757",
"0.55683684",
"0.55321056",
"0.5492001",
"0.5476959",
"0.5474568",
"0.53565866",
"0.5267553",
"0.5240187",
"0.5199441",
"0.51816255",
"0.5112523",
"0.51094335",
"0.50516003",
"0.50516003",
"0.5050752",
"0.5032506",
"0.5032506",
"0.5032506",
"0.50103... | 0.78085446 | 0 |
268:1: fragment_of_variable_or_method_name[name] : '.' IDENTIFIER ; | def fragment_of_variable_or_method_name(name)
_IDENTIFIER14 = nil
# 269:7: '.' IDENTIFIER
match(:DOT)
_IDENTIFIER14 = @input.look_ahead(1)
match(:IDENTIFIER)
name << ".#{_IDENTIFIER14.text}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fragment_of_called_method_name(method_name)\n \t_IDENTIFIER11 = nil\n\n\n\n\n # 227:7: '.' IDENTIFIER\n match(:DOT)\n _IDENTIFIER11 = @input.look_ahead(1)\n match(:IDENTIFIER)\n method_name << \".#{_IDENTIFIER11.text}\"\n\n\n\n end",
"def variable_name(method)\n \... | [
"0.72456485",
"0.6735062",
"0.6419386",
"0.6387757",
"0.62380594",
"0.5660788",
"0.5648998",
"0.5648998",
"0.558675",
"0.55733633",
"0.5498269",
"0.54531324",
"0.54461026",
"0.5444615",
"0.5414972",
"0.53850883",
"0.53839684",
"0.53814113",
"0.53805625",
"0.53805625",
"0.5340... | 0.84843343 | 0 |
272:1: any_expression[method] : ( '(' ( expression[method] )+ ')' | NUMBER | expression_operator | double_quoted_expression | single_quoted_expression ); | def any_expression(method)
# 273:5: ( '(' ( expression[method] )+ ')' | NUMBER | expression_operator | double_quoted_expression | single_quoted_expression )
alt39 = 5
# 272:1: any_expression[method] : ( '(' ( expression[method] )+ ')' | NUMBER | expression_operator | double_quoted_expression | single_quoted_expression );
case look_ahead(1)
when :LEFT_PARENTESIS
alt39 = 1
when :NUMBER
alt39 = 2
when :LEFT_ANGULAR_BRACKET,:RIGHT_ANGULAR_BRACKET,:ECOMMERCIAL,:EQUAL,:LEFT_SQUARE_BRACKET,:RIGHT_SQUARE_BRACKET,:QUESTION_MARK,:PLUS,:MINUS,:TIMES,:MODULUS,:COLON,:PIPE,:WEDGE,:EXCLATION_MARK,:SLASH
alt39 = 3
when :DOUBLE_QUOTES
alt39 = 4
when :SINGLE_QUOTES
alt39 = 5
else
raise "Expected: 272:1: any_expression[method] : ( '(' ( expression[method] )+ ')' | NUMBER | expression_operator | double_quoted_expression | single_quoted_expression );"
end
case alt39
when 1
# 273:6: '(' ( expression[method] )+ ')'
match(:LEFT_PARENTESIS)
# 273:10: ( expression[method] )+
matchedOnce38 = false
while true
alt38 = 2
# ()+ loopback of 273:10: ( expression[method] )+
look_ahead38_0 = look_ahead(1)
if look_ahead38_0 == :IDENTIFIER || look_ahead38_0 == :NUMBER || (TOKENS[look_ahead38_0] >= 25 && TOKENS[look_ahead38_0] <= 26) || look_ahead38_0 == :ECOMMERCIAL || (TOKENS[look_ahead38_0] >= 31 && TOKENS[look_ahead38_0] <= 32) || (TOKENS[look_ahead38_0] >= 35 && TOKENS[look_ahead38_0] <= 46) || (TOKENS[look_ahead38_0] >= 48 && TOKENS[look_ahead38_0] <= 49) || look_ahead38_0 == :T58
alt38 = 1
end
case alt38
when 1
# 273:12: expression[method]
expression(method)
else
break
end
matchedOnce38 = true
end
if !matchedOnce38
raise "Expected at least one match: 273:10: ( expression[method] )+"
end
match(:RIGHT_PARENTESIS)
when 2
# 274:7: NUMBER
match(:NUMBER)
when 3
# 275:7: expression_operator
expression_operator()
when 4
# 276:7: double_quoted_expression
double_quoted_expression()
when 5
# 277:7: single_quoted_expression
single_quoted_expression()
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expression(method)\n\n\n\n # 245:5: ( variable_or_method_use[method] | any_expression[method] )\n alt34 = 2\n # 244:1: expression[method] : ( variable_or_method_use[method] | any_expression[method] );\n look_ahead34_0 = look_ahead(1)\n if look_ahead34_0 == :IDENTIFIER || look... | [
"0.7494853",
"0.6798871",
"0.6569862",
"0.6429253",
"0.60248685",
"0.59372383",
"0.592586",
"0.55222285",
"0.54909664",
"0.54900444",
"0.54626745",
"0.54015076",
"0.5350309",
"0.5326908",
"0.5322695",
"0.5219129",
"0.5216213",
"0.5174028",
"0.51731384",
"0.5155873",
"0.514838... | 0.84218407 | 0 |
280:1: double_quoted_expression : '\"' ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\\'' ) '\"' ; | def double_quoted_expression()
# 281:7: '\"' ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\\'' )* '\"'
match(:DOUBLE_QUOTES)
# 281:11: ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\\'' )*
while true
alt40 = 6
# ()* loopback of 281:11: ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\\'' )*
case look_ahead(1)
when :IDENTIFIER
alt40 = 1
when :NUMBER
alt40 = 2
when :LEFT_ANGULAR_BRACKET,:RIGHT_ANGULAR_BRACKET,:ECOMMERCIAL,:EQUAL,:LEFT_SQUARE_BRACKET,:RIGHT_SQUARE_BRACKET,:QUESTION_MARK,:PLUS,:MINUS,:TIMES,:MODULUS,:COLON,:PIPE,:WEDGE,:EXCLATION_MARK,:SLASH
alt40 = 3
when :SEMICOLON,:COMMA,:LEFT_BRACE,:RIGHT_BRACE,:LEFT_PARENTESIS,:RIGHT_PARENTESIS,:DOT,:BACKSLASH,:DOLLAR,:AT,:TILDE,:HASH,:T59,:T60
alt40 = 4
when :SINGLE_QUOTES
alt40 = 5
end
case alt40
when 1
# 281:12: IDENTIFIER
match(:IDENTIFIER)
when 2
# 281:25: NUMBER
match(:NUMBER)
when 3
# 281:34: expression_operator
expression_operator()
when 4
# 281:56: quoted_operator
quoted_operator()
when 5
# 281:74: '\\''
match(:SINGLE_QUOTES)
else
break
end
end
match(:DOUBLE_QUOTES)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def single_quoted_expression()\n\n\n\n # 285:7: '\\\\'' ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\\\"' )* '\\\\''\n match(:SINGLE_QUOTES)\n # 285:12: ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\\\"' )*\n while true\n alt41 = 6\n ... | [
"0.68650645",
"0.6362428",
"0.6353357",
"0.6334436",
"0.6311653",
"0.62132114",
"0.6164939",
"0.6160781",
"0.61148876",
"0.5967645",
"0.596502",
"0.5934927",
"0.5932217",
"0.5911983",
"0.58977926",
"0.5876935",
"0.5844442",
"0.5836917",
"0.5782268",
"0.57802504",
"0.5756739",... | 0.83926916 | 0 |
284:1: single_quoted_expression : '\\'' ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\"' ) '\\'' ; | def single_quoted_expression()
# 285:7: '\\'' ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\"' )* '\\''
match(:SINGLE_QUOTES)
# 285:12: ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\"' )*
while true
alt41 = 6
# ()* loopback of 285:12: ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\"' )*
case look_ahead(1)
when :IDENTIFIER
alt41 = 1
when :NUMBER
alt41 = 2
when :LEFT_ANGULAR_BRACKET,:RIGHT_ANGULAR_BRACKET,:ECOMMERCIAL,:EQUAL,:LEFT_SQUARE_BRACKET,:RIGHT_SQUARE_BRACKET,:QUESTION_MARK,:PLUS,:MINUS,:TIMES,:MODULUS,:COLON,:PIPE,:WEDGE,:EXCLATION_MARK,:SLASH
alt41 = 3
when :SEMICOLON,:COMMA,:LEFT_BRACE,:RIGHT_BRACE,:LEFT_PARENTESIS,:RIGHT_PARENTESIS,:DOT,:BACKSLASH,:DOLLAR,:AT,:TILDE,:HASH,:T59,:T60
alt41 = 4
when :DOUBLE_QUOTES
alt41 = 5
end
case alt41
when 1
# 285:13: IDENTIFIER
match(:IDENTIFIER)
when 2
# 285:26: NUMBER
match(:NUMBER)
when 3
# 285:35: expression_operator
expression_operator()
when 4
# 285:57: quoted_operator
quoted_operator()
when 5
# 285:75: '\"'
match(:DOUBLE_QUOTES)
else
break
end
end
match(:SINGLE_QUOTES)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def double_quoted_expression()\n\n\n\n # 281:7: '\\\"' ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\\\\'' )* '\\\"'\n match(:DOUBLE_QUOTES)\n # 281:11: ( IDENTIFIER | NUMBER | expression_operator | quoted_operator | '\\\\'' )*\n while true\n alt40 = 6\n ... | [
"0.69304144",
"0.62869143",
"0.613452",
"0.606961",
"0.6038775",
"0.60290104",
"0.597133",
"0.59267044",
"0.5801543",
"0.5775905",
"0.57630706",
"0.57545024",
"0.5715934",
"0.5704777",
"0.56333226",
"0.5619928",
"0.55793864",
"0.5518491",
"0.5518491",
"0.5516242",
"0.55058265... | 0.8259961 | 0 |
288:1: assign_operator : ( '=' | '+' '=' | '' '=' | '' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '' '>' '>' '=' | '>' '>' '=' ); | def assign_operator()
# 289:5: ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' )
alt42 = 12
# 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );
case look_ahead(1)
when :EQUAL
alt42 = 1
when :PLUS
alt42 = 2
when :MINUS
alt42 = 3
when :TIMES
alt42 = 4
when :SLASH
alt42 = 5
when :ECOMMERCIAL
alt42 = 6
when :PIPE
alt42 = 7
when :WEDGE
alt42 = 8
when :MODULUS
alt42 = 9
when :LEFT_ANGULAR_BRACKET
alt42 = 10
when :RIGHT_ANGULAR_BRACKET
# 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );
look_ahead42_11 = look_ahead(2)
if look_ahead42_11 == :RIGHT_ANGULAR_BRACKET
# 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );
look_ahead42_12 = look_ahead(3)
if look_ahead42_12 == :RIGHT_ANGULAR_BRACKET
alt42 = 11
elsif look_ahead42_12 == :EQUAL
alt42 = 12
else
raise "Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );"
end
else
raise "Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );"
end
else
raise "Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );"
end
case alt42
when 1
# 289:9: '='
match(:EQUAL)
when 2
# 290:9: '+' '='
match(:PLUS)
match(:EQUAL)
when 3
# 291:9: '-' '='
match(:MINUS)
match(:EQUAL)
when 4
# 292:9: '*' '='
match(:TIMES)
match(:EQUAL)
when 5
# 293:9: '/' '='
match(:SLASH)
match(:EQUAL)
when 6
# 294:9: '&' '='
match(:ECOMMERCIAL)
match(:EQUAL)
when 7
# 295:9: '|' '='
match(:PIPE)
match(:EQUAL)
when 8
# 296:9: '^' '='
match(:WEDGE)
match(:EQUAL)
when 9
# 297:9: '%' '='
match(:MODULUS)
match(:EQUAL)
when 10
# 298:9: '<' '<' '='
match(:LEFT_ANGULAR_BRACKET)
match(:LEFT_ANGULAR_BRACKET)
match(:EQUAL)
when 11
# 299:9: '>' '>' '>' '='
match(:RIGHT_ANGULAR_BRACKET)
match(:RIGHT_ANGULAR_BRACKET)
match(:RIGHT_ANGULAR_BRACKET)
match(:EQUAL)
when 12
# 300:9: '>' '>' '='
match(:RIGHT_ANGULAR_BRACKET)
match(:RIGHT_ANGULAR_BRACKET)
match(:EQUAL)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assignment\n expr = conditional\n\n if match?(:equal)\n equals = previous\n value = expression\n\n if expr.is_a?(Ringo::Variable)\n name = expr.name\n return Ringo::Assign.new(name, value)\n elsif expr.is_a?(Ringo::Get)\n return Ringo::Set.new(ex... | [
"0.70166063",
"0.69434756",
"0.6848899",
"0.67697173",
"0.6609473",
"0.6563043",
"0.6520636",
"0.6474638",
"0.64623344",
"0.64365304",
"0.6367272",
"0.63491255",
"0.6309592",
"0.6211463",
"0.62106246",
"0.6192434",
"0.6138009",
"0.6115656",
"0.60508233",
"0.60454726",
"0.6039... | 0.84064776 | 0 |
303:1: expression_operator : ( '+' | '' | '' | '/' | '%' | '=' | '?' | ':' | '&' | '|' | '^' | '>' | '<' | '!' | '[' | ']' ); | def expression_operator()
#
if (TOKENS[look_ahead(1)] >= 25 && TOKENS[look_ahead(1)] <= 26) || look_ahead(1) == :ECOMMERCIAL || look_ahead(1) == :EQUAL || (TOKENS[look_ahead(1)] >= 35 && TOKENS[look_ahead(1)] <= 46)
match()
else
raise "Expected set"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expression\n n = term\n while next_token == '+' || next_token == '-'\n op = consume\n m = term\n n = case op\n when '+'\n n + m\n when '-'\n n - m\n else\n nil\n end\n end\n n\n end",
"def operator\n case ... | [
"0.6227945",
"0.6187861",
"0.61494666",
"0.6140805",
"0.6079684",
"0.6021894",
"0.6012933",
"0.59022075",
"0.58812493",
"0.5871035",
"0.5842354",
"0.58216774",
"0.5820788",
"0.5795019",
"0.57940584",
"0.57940584",
"0.57773906",
"0.57628167",
"0.575427",
"0.57432693",
"0.57353... | 0.5786623 | 16 |
314:1: parameters[method] : '(' ( parameter_definition[method] )? ')' ; | def parameters(method)
# 315:7: '(' ( parameter_definition[method] )? ')'
match(:LEFT_PARENTESIS)
# 316:7: ( parameter_definition[method] )?
alt43 = 2
# 316:7: ( parameter_definition[method] )?
look_ahead43_0 = look_ahead(1)
if look_ahead43_0 == :IDENTIFIER || look_ahead43_0 == :FINAL || look_ahead43_0 == :ANNOTATION
alt43 = 1
end
case alt43
when 1
# 316:8: parameter_definition[method]
parameter_definition(method)
end
match(:RIGHT_PARENTESIS)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_method_parameters method\n res = parse_method_or_yield_parameters method\n\n res = \"(#{res})\" unless res =~ /\\A\\(/\n method.params = res unless method.params\n\n return if method.block_params\n\n skip_tkspace_without_nl\n read_documentation_modifiers method, RDoc::METHOD_MODIFIERS\... | [
"0.70937717",
"0.6971488",
"0.6675348",
"0.65483874",
"0.65000767",
"0.64553845",
"0.63389945",
"0.6288045",
"0.6288045",
"0.6288045",
"0.6288045",
"0.6288045",
"0.6288045",
"0.6288045",
"0.6288045",
"0.62217486",
"0.62198937",
"0.62186795",
"0.62136346",
"0.6197688",
"0.6186... | 0.8194967 | 0 |
320:1: parameter_definition[method] : variable_modifier type[parameter] IDENTIFIER ; | def parameter_definition(method)
_IDENTIFIER15 = nil
parameter = ParameterDefinition.new
# 325:5: variable_modifier type[parameter] IDENTIFIER
variable_modifier()
type(parameter)
_IDENTIFIER15 = @input.look_ahead(1)
match(:IDENTIFIER)
parameter.name = _IDENTIFIER15.text
method.add_parameter(parameter)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parameters(method)\n\n\n\n # 315:7: '(' ( parameter_definition[method] )? ')'\n match(:LEFT_PARENTESIS)\n # 316:7: ( parameter_definition[method] )?\n alt43 = 2\n # 316:7: ( parameter_definition[method] )?\n look_ahead43_0 = look_ahead(1)\n\n if look_ahead43_0 =... | [
"0.7028891",
"0.64857787",
"0.6156725",
"0.6071212",
"0.6014268",
"0.5976514",
"0.5796508",
"0.5758215",
"0.574575",
"0.574575",
"0.5629874",
"0.5629874",
"0.56179154",
"0.56132066",
"0.56111234",
"0.56088835",
"0.5583434",
"0.55649745",
"0.55567014",
"0.5553484",
"0.5506977"... | 0.83672166 | 0 |
331:1: type[member] : type_name[member] ( array_brackets[member] ) ; | def type(member)
# 332:7: type_name[member] ( array_brackets[member] )*
type_name(member)
# 332:25: ( array_brackets[member] )*
while true
alt44 = 2
# ()* loopback of 332:25: ( array_brackets[member] )*
look_ahead44_0 = look_ahead(1)
if look_ahead44_0 == :LEFT_SQUARE_BRACKET
alt44 = 1
end
case alt44
when 1
# 332:26: array_brackets[member]
array_brackets(member)
else
break
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def array_brackets(member)\n\n\n\n # 352:7: '[' ']'\n match(:LEFT_SQUARE_BRACKET)\n match(:RIGHT_SQUARE_BRACKET)\n member.type += '[]' \n\n\n\n end",
"def type_argument(member)\n\n\n\n # 346:7: '<' ( member_special_identifier[member] )* '>'\n match(:LEFT_ANGULAR_BRAC... | [
"0.7563598",
"0.63135237",
"0.60763854",
"0.53600746",
"0.5338219",
"0.5268534",
"0.52630585",
"0.5240688",
"0.5113643",
"0.50764877",
"0.5056033",
"0.5052316",
"0.5040391",
"0.49865267",
"0.49846128",
"0.49409363",
"0.4933637",
"0.49142262",
"0.49044305",
"0.4886447",
"0.488... | 0.8492859 | 0 |
335:1: type_name[member] : ( IDENTIFIER ) ( package_descriptors[member] ) ( type_argument[member] )? ; | def type_name(member)
_IDENTIFIER16 = nil
# 336:7: ( IDENTIFIER ) ( package_descriptors[member] )* ( type_argument[member] )?
# 336:8: IDENTIFIER
_IDENTIFIER16 = @input.look_ahead(1)
match(:IDENTIFIER)
member.type = _IDENTIFIER16.text
# 337:7: ( package_descriptors[member] )*
while true
alt45 = 2
# ()* loopback of 337:7: ( package_descriptors[member] )*
look_ahead45_0 = look_ahead(1)
if look_ahead45_0 == :DOT
alt45 = 1
end
case alt45
when 1
# 337:9: package_descriptors[member]
package_descriptors(member)
else
break
end
end
# 338:7: ( type_argument[member] )?
alt46 = 2
# 338:7: ( type_argument[member] )?
look_ahead46_0 = look_ahead(1)
if look_ahead46_0 == :LEFT_ANGULAR_BRACKET
alt46 = 1
end
case alt46
when 1
# 338:9: type_argument[member]
type_argument(member)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type_name *args\n (@type_names ||= { })[args] ||=\n _type_name(args)\n end",
"def name_attr(type) type_info(type, :name_attr) end",
"def type_argument(member)\n\n\n\n # 346:7: '<' ( member_special_identifier[member] )* '>'\n match(:LEFT_ANGULAR_BRACKET)\n member.type +=... | [
"0.7021318",
"0.6197704",
"0.618721",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.61045086",
"0.6055746",
"0.60409784",
"... | 0.8022068 | 0 |
341:1: package_descriptors[member] : '.' IDENTIFIER ; | def package_descriptors(member)
_IDENTIFIER17 = nil
# 342:7: '.' IDENTIFIER
match(:DOT)
_IDENTIFIER17 = @input.look_ahead(1)
match(:IDENTIFIER)
member.type += ".#{_IDENTIFIER17.text}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def package\n file_descriptor_proto.package\n end",
"def type_name(member)\n \t_IDENTIFIER16 = nil\n\n\n\n\n # 336:7: ( IDENTIFIER ) ( package_descriptors[member] )* ( type_argument[member] )?\n # 336:8: IDENTIFIER\n _IDENTIFIER16 = @input.look_ahead(1)\n match(:IDENTIFIER)... | [
"0.5894619",
"0.5791324",
"0.5233321",
"0.52135366",
"0.5193104",
"0.5172915",
"0.50700796",
"0.49944174",
"0.49558547",
"0.49414757",
"0.48988074",
"0.48444313",
"0.48444313",
"0.4789991",
"0.4777417",
"0.47327268",
"0.47301278",
"0.47275892",
"0.4704",
"0.46971852",
"0.4696... | 0.77930003 | 0 |
345:1: type_argument[member] : '' ; | def type_argument(member)
# 346:7: '<' ( member_special_identifier[member] )* '>'
match(:LEFT_ANGULAR_BRACKET)
member.type += '<'
# 347:7: ( member_special_identifier[member] )*
while true
alt47 = 2
alt47 = DFA47.predict(self, @input)
case alt47
when 1
# 347:9: member_special_identifier[member]
member_special_identifier(member)
else
break
end
end
match(:RIGHT_ANGULAR_BRACKET)
member.type += '>'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type_name(member)\n \t_IDENTIFIER16 = nil\n\n\n\n\n # 336:7: ( IDENTIFIER ) ( package_descriptors[member] )* ( type_argument[member] )?\n # 336:8: IDENTIFIER\n _IDENTIFIER16 = @input.look_ahead(1)\n match(:IDENTIFIER)\n member.type = _IDENTIFIER16.text \n # 337:7: ... | [
"0.7451744",
"0.71890545",
"0.71890545",
"0.71890545",
"0.71890545",
"0.71890545",
"0.71890545",
"0.71890545",
"0.71890545",
"0.71890545",
"0.71890545",
"0.71890545",
"0.71890545",
"0.71890545",
"0.67901945",
"0.65315384",
"0.6344923",
"0.6337174",
"0.6192832",
"0.6165643",
"... | 0.75493044 | 0 |
351:1: array_brackets[member] : '[' ']' ; | def array_brackets(member)
# 352:7: '[' ']'
match(:LEFT_SQUARE_BRACKET)
match(:RIGHT_SQUARE_BRACKET)
member.type += '[]'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(member)\n\n\n\n # 332:7: type_name[member] ( array_brackets[member] )*\n type_name(member)\n\n # 332:25: ( array_brackets[member] )*\n while true\n alt44 = 2\n # ()* loopback of 332:25: ( array_brackets[member] )*\n look_ahead44_0 = look_ahead(1... | [
"0.73954606",
"0.67897916",
"0.58255243",
"0.56282693",
"0.5609302",
"0.5587507",
"0.5494408",
"0.54565567",
"0.5411959",
"0.5340733",
"0.532749",
"0.52971923",
"0.5278388",
"0.5198819",
"0.5198819",
"0.5198819",
"0.5198819",
"0.5198819",
"0.5198819",
"0.5198819",
"0.5198819"... | 0.8813806 | 0 |
355:1: modifier[member] : ( PRIVATE | PUBLIC | PROTECTED | STATIC | ABSTRACT | FINAL | NATIVE | SYNCHRONIZED | TRANSIENT | VOLATILE | STRICTFP ) ; | def modifier(member)
# 357:5: ( PRIVATE | PUBLIC | PROTECTED | STATIC | ABSTRACT | FINAL | NATIVE | SYNCHRONIZED | TRANSIENT | VOLATILE | STRICTFP )*
# 357:5: ( PRIVATE | PUBLIC | PROTECTED | STATIC | ABSTRACT | FINAL | NATIVE | SYNCHRONIZED | TRANSIENT | VOLATILE | STRICTFP )*
while true
alt48 = 12
# ()* loopback of 357:5: ( PRIVATE | PUBLIC | PROTECTED | STATIC | ABSTRACT | FINAL | NATIVE | SYNCHRONIZED | TRANSIENT | VOLATILE | STRICTFP )*
case look_ahead(1)
when :PRIVATE
alt48 = 1
when :PUBLIC
alt48 = 2
when :PROTECTED
alt48 = 3
when :STATIC
alt48 = 4
when :ABSTRACT
alt48 = 5
when :FINAL
alt48 = 6
when :NATIVE
alt48 = 7
when :SYNCHRONIZED
alt48 = 8
when :TRANSIENT
alt48 = 9
when :VOLATILE
alt48 = 10
when :STRICTFP
alt48 = 11
end
case alt48
when 1
# 357:7: PRIVATE
match(:PRIVATE)
member.add_modifier('private')
when 2
# 358:7: PUBLIC
match(:PUBLIC)
member.add_modifier('public')
when 3
# 359:7: PROTECTED
match(:PROTECTED)
member.add_modifier('protected')
when 4
# 360:7: STATIC
match(:STATIC)
member.add_modifier('static')
when 5
# 361:7: ABSTRACT
match(:ABSTRACT)
member.add_modifier('abstract')
when 6
# 362:7: FINAL
match(:FINAL)
member.add_modifier('final')
when 7
# 363:7: NATIVE
match(:NATIVE)
member.add_modifier('native')
when 8
# 364:7: SYNCHRONIZED
match(:SYNCHRONIZED)
member.add_modifier('synchronized')
when 9
# 365:7: TRANSIENT
match(:TRANSIENT)
member.add_modifier('transient')
when 10
# 366:7: VOLATILE
match(:VOLATILE)
member.add_modifier('volatile')
when 11
# 367:7: STRICTFP
match(:STRICTFP)
member.add_modifier('strictfp')
else
break
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modifier; end",
"def private=(_); end",
"def member; end",
"def member; end",
"def member; end",
"def member; end",
"def member; end",
"def modifier(modifier)\n\t\t\t\t@modifier = modifier\n\t\t\tend",
"def member\n end",
"def members(*) end",
"def a_private_method\n\tend",
"def method3 ... | [
"0.66460913",
"0.63518625",
"0.6318098",
"0.6318098",
"0.6318098",
"0.6318098",
"0.6318098",
"0.60772175",
"0.5979318",
"0.59788203",
"0.59641784",
"0.5859855",
"0.58470535",
"0.5841409",
"0.58258647",
"0.58154404",
"0.58154404",
"0.57291865",
"0.5727028",
"0.5708794",
"0.569... | 0.78946024 | 0 |
371:1: variable_modifier : ( FINAL | ANNOTATION ) ; | def variable_modifier()
# 372:7: ( FINAL | ANNOTATION )*
# 372:7: ( FINAL | ANNOTATION )*
while true
alt49 = 2
# ()* loopback of 372:7: ( FINAL | ANNOTATION )*
look_ahead49_0 = look_ahead(1)
if look_ahead49_0 == :FINAL || look_ahead49_0 == :ANNOTATION
alt49 = 1
end
case alt49
when 1
#
if look_ahead(1) == :FINAL || look_ahead(1) == :ANNOTATION
match()
else
raise "Expected set"
end
else
break
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def var!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 75 )\n\n type = VAR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 196:7: 'var'\n match( \"var\" )\n\n \n @state.type = type\... | [
"0.63443506",
"0.5864059",
"0.581492",
"0.57550496",
"0.5683653",
"0.56415397",
"0.56415397",
"0.54938364",
"0.5490141",
"0.54794174",
"0.543149",
"0.5414406",
"0.541143",
"0.5347423",
"0.5331616",
"0.53105146",
"0.53105146",
"0.53105146",
"0.5308234",
"0.52837354",
"0.527565... | 0.7766638 | 0 |
377:1: member_special_identifier[member] : ( IDENTIFIER | ',' | '&' | '' | EXTENDS | '?' ); | def member_special_identifier(member)
_IDENTIFIER18 = nil
_EXTENDS19 = nil
# 378:5: ( IDENTIFIER | ',' | '&' | '<' | '>' | EXTENDS | '?' )
alt50 = 7
# 377:1: member_special_identifier[member] : ( IDENTIFIER | ',' | '&' | '<' | '>' | EXTENDS | '?' );
case look_ahead(1)
when :IDENTIFIER
alt50 = 1
when :COMMA
alt50 = 2
when :ECOMMERCIAL
alt50 = 3
when :LEFT_ANGULAR_BRACKET
alt50 = 4
when :RIGHT_ANGULAR_BRACKET
alt50 = 5
when :EXTENDS
alt50 = 6
when :QUESTION_MARK
alt50 = 7
else
raise "Expected: 377:1: member_special_identifier[member] : ( IDENTIFIER | ',' | '&' | '<' | '>' | EXTENDS | '?' );"
end
case alt50
when 1
# 378:7: IDENTIFIER
_IDENTIFIER18 = @input.look_ahead(1)
match(:IDENTIFIER)
member.type += _IDENTIFIER18.text
when 2
# 379:7: ','
match(:COMMA)
member.type += ", "
when 3
# 380:7: '&'
match(:ECOMMERCIAL)
member.type += " & "
when 4
# 381:7: '<'
match(:LEFT_ANGULAR_BRACKET)
member.type += '<'
when 5
# 382:7: '>'
match(:RIGHT_ANGULAR_BRACKET)
member.type += '>'
when 6
# 383:7: EXTENDS
_EXTENDS19 = @input.look_ahead(1)
match(:EXTENDS)
member.type += " #{_EXTENDS19.text} "
when 7
# 384:7: '?'
match(:QUESTION_MARK)
member.type += '?'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type_argument(member)\n\n\n\n # 346:7: '<' ( member_special_identifier[member] )* '>'\n match(:LEFT_ANGULAR_BRACKET)\n member.type += '<' \n # 347:7: ( member_special_identifier[member] )*\n while true\n alt47 = 2\n alt47 = DFA47.predict(self, @input)\n... | [
"0.68583834",
"0.61183983",
"0.6049733",
"0.58449066",
"0.5841453",
"0.5667469",
"0.55971",
"0.5571553",
"0.5571553",
"0.55610377",
"0.54461056",
"0.5438282",
"0.5420241",
"0.5386203",
"0.53481746",
"0.52909887",
"0.52909887",
"0.52879316",
"0.5275331",
"0.526409",
"0.5215803... | 0.8269752 | 0 |
GET /physicians GET /physicians.json | def index
@physicians = Physician.all
render json: @physicians, :include => [:patients => {:include => [:surveys]}]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def physicians\n physicians = User.physicians\n render json: { status: 200, data: physicians }\n end",
"def index\n @physicians = Physician.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @physicians }\n end\n end",
"def show\n @physician... | [
"0.83802414",
"0.7782005",
"0.70627874",
"0.6989763",
"0.672182",
"0.65860224",
"0.6545116",
"0.6052438",
"0.59979284",
"0.59052706",
"0.58609104",
"0.58547896",
"0.5850033",
"0.5846019",
"0.5811788",
"0.58047986",
"0.5802724",
"0.5788797",
"0.5777363",
"0.5766233",
"0.576235... | 0.70365363 | 3 |
GET /physicians/1 GET /physicians/1.json | def show
id = params[:id]
@physician = Physician.find(id)
render json: @physician, :include => [:patients => {:include => [:surveys]}]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def physicians\n physicians = User.physicians\n render json: { status: 200, data: physicians }\n end",
"def index\n @physicians = Physician.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @physicians }\n end\n end",
"def show\n @physician... | [
"0.7876794",
"0.7754104",
"0.7541756",
"0.7474097",
"0.70901096",
"0.704096",
"0.6479008",
"0.6453929",
"0.64043903",
"0.62971026",
"0.6275762",
"0.62233233",
"0.6203377",
"0.6179499",
"0.61784035",
"0.6139286",
"0.61313325",
"0.61301017",
"0.6047758",
"0.60445964",
"0.602913... | 0.70143545 | 6 |
POST /physicians POST /physicians.json | def create
@physician = Physician.new(physician_params)
if @physician.save
render json: @physician, status: :created
else
render json: @physician.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @physician = Physician.new(params[:physician])\n\n respond_to do |format|\n if @physician.save\n format.html { redirect_to @physician, :notice => 'Physician was successfully created.' }\n format.json { render :json => @physician, :status => :created, :location => @physician }\... | [
"0.71451133",
"0.71336144",
"0.7122341",
"0.63286954",
"0.62816155",
"0.6269866",
"0.6184625",
"0.6107087",
"0.60036224",
"0.5932585",
"0.5887157",
"0.5844557",
"0.5703227",
"0.56753194",
"0.5668774",
"0.56347674",
"0.56261665",
"0.56041336",
"0.5599454",
"0.55923337",
"0.558... | 0.7433979 | 0 |
PATCH/PUT /physicians/1 PATCH/PUT /physicians/1.json | def update
if @physician.update(survey_params)
head :no_content
else
render json: @physician.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @physician = Physician.find(params[:id])\n\n respond_to do |format|\n if @physician.update_attributes(params[:physician])\n format.html { redirect_to @physician, :notice => 'Physician was successfully updated.' }\n format.json { head :ok }\n else\n format.html { re... | [
"0.7209596",
"0.71976155",
"0.7183674",
"0.67852783",
"0.65791965",
"0.6330243",
"0.62501544",
"0.62347394",
"0.6223055",
"0.61989665",
"0.61897063",
"0.6182827",
"0.61631393",
"0.6130827",
"0.61027",
"0.6091789",
"0.6044731",
"0.6029879",
"0.600601",
"0.6004111",
"0.59943265... | 0.6510118 | 5 |
DELETE /physicians/1 DELETE /physicians/1.json | def destroy
@physician.destroy
head :no_content
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @physician = Physician.find(params[:id])\n @physician.destroy\n\n respond_to do |format|\n format.html { redirect_to physicians_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @physician = Physician.find(params[:id])\n @physician.destroy\n\n respond_to ... | [
"0.7794894",
"0.7785268",
"0.7785268",
"0.7078376",
"0.7033774",
"0.70059246",
"0.69435686",
"0.6903898",
"0.68614376",
"0.6856796",
"0.68472886",
"0.68301165",
"0.6822456",
"0.67844504",
"0.6782772",
"0.67602783",
"0.6746717",
"0.6742452",
"0.6741215",
"0.672915",
"0.6726485... | 0.7598691 | 3 |
Use callbacks to share common setup or constraints between actions. | def set_physician
@physician = Physician.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def physician_params
params.require(:physician).permit(:name, :practice, :address1, :address2, :city, :state, :zipcode, :phone, :email)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
GET /fundstore_categories GET /fundstore_categories.json | def index
@fundstore_categories = FundstoreCategory.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_ba... | [
"0.7716713",
"0.7221441",
"0.6959142",
"0.6899958",
"0.68872076",
"0.6863562",
"0.6856117",
"0.6814017",
"0.68105876",
"0.6805967",
"0.6785796",
"0.6751427",
"0.6734797",
"0.67070776",
"0.67041916",
"0.6696905",
"0.66912365",
"0.6667438",
"0.666136",
"0.6624551",
"0.6607059",... | 0.74238783 | 1 |
GET /fundstore_categories/1 GET /fundstore_categories/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def index\n @fundstore_categories = FundstoreCategory.all\n end",
"def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\tren... | [
"0.7423175",
"0.73589104",
"0.689543",
"0.6730919",
"0.67181015",
"0.6678725",
"0.66614175",
"0.66194856",
"0.6592876",
"0.6578529",
"0.65677667",
"0.6566447",
"0.65153795",
"0.6511639",
"0.6483316",
"0.6478982",
"0.64683026",
"0.6461751",
"0.64591277",
"0.6456636",
"0.643411... | 0.0 | -1 |
POST /fundstore_categories POST /fundstore_categories.json | def create
@fundstore_category = FundstoreCategory.new(fundstore_category_params)
respond_to do |format|
if @fundstore_category.save
format.html { redirect_to @fundstore_category, notice: 'Fundstore category was successfully created.' }
format.json { render :show, status: :created, location: @fundstore_category }
else
format.html { render :new }
format.json { render json: @fundstore_category.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend",
"def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params.to_json)\n \n end",
"def create\n json_create(cat... | [
"0.7245732",
"0.686832",
"0.64773136",
"0.6464873",
"0.6403704",
"0.6396564",
"0.6352514",
"0.6333927",
"0.6291001",
"0.6264222",
"0.61969334",
"0.6176018",
"0.61707973",
"0.6160041",
"0.61395746",
"0.61385554",
"0.6094284",
"0.6082161",
"0.6065309",
"0.6041927",
"0.60365",
... | 0.6786835 | 2 |
PATCH/PUT /fundstore_categories/1 PATCH/PUT /fundstore_categories/1.json | def update
respond_to do |format|
if @fundstore_category.update(fundstore_category_params)
format.html { redirect_to @fundstore_category, notice: 'Fundstore category was successfully updated.' }
format.json { render :show, status: :ok, location: @fundstore_category }
else
format.html { render :edit }
format.json { render json: @fundstore_category.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n json_update(category,category_params, Category)\n end",
"def UpdateCategory params = {}\n \n APICall(path: 'categories.json',method: 'PUT',payload: params.to_json)\n \n end",
"def category_update\n @finance_category = FinanceTransactionCategory.find(params[:id])\n ... | [
"0.7047102",
"0.702177",
"0.65225434",
"0.6506039",
"0.6459263",
"0.6371344",
"0.63594985",
"0.63586307",
"0.6357297",
"0.6354518",
"0.6315225",
"0.6255824",
"0.624838",
"0.62327147",
"0.6205163",
"0.6192408",
"0.61607647",
"0.6150388",
"0.61469024",
"0.61382955",
"0.6137594"... | 0.670916 | 2 |
DELETE /fundstore_categories/1 DELETE /fundstore_categories/1.json | def destroy
@fundstore_category.destroy
respond_to do |format|
format.html { redirect_to fundstore_categories_url, notice: 'Fundstore category was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @fee_category.destroy\n respond_to do |format|\n format.html { redirect_to fee_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budgetcategory = Budgetcategory.find(params[:id])\n @budgetcategory.destroy\n\n respond_to do |format|\n ... | [
"0.7252344",
"0.7114194",
"0.70945287",
"0.7081909",
"0.7073485",
"0.70677334",
"0.7059402",
"0.7039098",
"0.70126426",
"0.69815814",
"0.69631785",
"0.6955547",
"0.69546485",
"0.6944633",
"0.69417703",
"0.6934994",
"0.6929852",
"0.6929522",
"0.6925033",
"0.6921208",
"0.690062... | 0.7557115 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_fundstore_category
@fundstore_category = FundstoreCategory.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def fundstore_category_params
params.require(:fundstore_category).permit(:category_heading, :category_subheading, :fund_store_id, :fund_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
initialize url and get the html content | def initialize(params = {})
@url = params[:url]
@body = Nokogiri::HTML( open(@url) )
@result = {}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get\n @html = Nokogiri::HTML(URI.open(@url))\n\n self\n end",
"def get_url\n Nokogiri::HTML(open(@url))\n end",
"def html_source\n @html_source ||= fetch_uri uri if uri\n @html_source\n end",
"def get()\n html = html_for(baseurl)\n scrape html, baseurl\n end",
"def get_page()\n... | [
"0.76673394",
"0.72629374",
"0.71565276",
"0.7060642",
"0.70077515",
"0.700158",
"0.69906557",
"0.6916589",
"0.68754697",
"0.67984325",
"0.677184",
"0.6762658",
"0.6716926",
"0.67078817",
"0.66625506",
"0.66622174",
"0.66190994",
"0.65657294",
"0.6552104",
"0.65177244",
"0.64... | 0.67125326 | 13 |
list of searched tags | def tags
@result.keys
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_of_tags\n tag_list\n end",
"def tags\n klass = Object.const_get(\"Concepts\").const_get(params[:tag_class])\n results = klass.search_for_label_starting_with(params[:term]).map(&:label)\n render :json => results.uniq.sort\n end",
"def my_tag_list\n self.taggings.order('id ASC').map(&:t... | [
"0.7506971",
"0.7441545",
"0.73439056",
"0.7325814",
"0.72879714",
"0.7121791",
"0.71178454",
"0.70994884",
"0.7085142",
"0.7085142",
"0.7085142",
"0.7085142",
"0.7085142",
"0.7075453",
"0.70599574",
"0.70599574",
"0.7059069",
"0.7058737",
"0.7027073",
"0.7027073",
"0.7027073... | 0.6947299 | 27 |
GET /leads GET /leads.json | def index
@leads = Lead.all.page params[:page]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_leads(opts = {})\n data, status_code, headers = get_leads_with_http_info(opts)\n return data\n end",
"def index\n @leads = Lead.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leads }\n end\n end",
"def index\n @leads = Lea... | [
"0.77831686",
"0.7606565",
"0.73641014",
"0.7103904",
"0.70641804",
"0.70641804",
"0.7010339",
"0.70090216",
"0.6883306",
"0.6799886",
"0.67958355",
"0.6773183",
"0.67269236",
"0.6713216",
"0.6609284",
"0.6442092",
"0.6277877",
"0.62445587",
"0.6208993",
"0.61537194",
"0.6107... | 0.678237 | 11 |
GET /leads/1 GET /leads/1.json | def show
@lead_note = LeadNote.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @leads = Lead.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leads }\n end\n end",
"def index\n @leads = Lead.upcoming\n .includes(:updates, :agents, :agent)\n .order(created_at: :desc)\n ... | [
"0.7620046",
"0.71956867",
"0.70910174",
"0.6984261",
"0.69822013",
"0.69822013",
"0.6943176",
"0.693309",
"0.69249356",
"0.6832504",
"0.680083",
"0.6786299",
"0.653677",
"0.6536444",
"0.6535567",
"0.6486025",
"0.64588827",
"0.6431008",
"0.6392895",
"0.63410264",
"0.6340198",... | 0.0 | -1 |
POST /leads POST /leads.json | def create
@lead = Lead.new(lead_params)
if current_user
@lead.rep_id = current_user.id
end
respond_to do |format|
if @lead.save
if lead_params[:source] == 'landing'
send_notification(@lead)
end
if current_user.is_admin
format.html { redirect_to admin_leads_path, notice: 'Lead was successfully created.' }
else
format.html { redirect_to landing_thank_you_path, notice: 'Lead was successfully created.' }
format.json { render :show, status: :created, location: @lead }
end
else
format.html { redirect_to landing_marketing_path }
format.json { render json: @lead.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(lead)\n validate_type!(lead)\n\n attributes = sanitize(lead)\n _, _, root = @client.post(\"/leads\", attributes)\n\n Lead.new(root[:data])\n end",
"def create\n @lead = current_user.leads.build(params[:lead])\n\n respond_to do |format|\n if @lead.save\n format.... | [
"0.70162195",
"0.6988889",
"0.69738215",
"0.6810859",
"0.6682621",
"0.66040474",
"0.65756524",
"0.649473",
"0.6423695",
"0.63496786",
"0.6343331",
"0.6336863",
"0.63212484",
"0.62829643",
"0.62086904",
"0.6135985",
"0.6135985",
"0.6124143",
"0.6081969",
"0.60774946",
"0.60716... | 0.5894817 | 33 |
PATCH/PUT /leads/1 PATCH/PUT /leads/1.json | def update
respond_to do |format|
if @lead.update(lead_params)
if current_user.is_admin
format.html { redirect_to admin_leads_path, notice: 'Lead was successfully created.' }
else
format.html { redirect_to @lead, notice: 'Lead was successfully updated.' }
format.json { render :show, status: :ok, location: @lead }
end
else
format.html { render :edit }
format.json { render json: @lead.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @lead = current_user.leads.find(params[:id])\n\n respond_to do |format|\n if @lead.update_attributes(params[:lead])\n format.html { redirect_to @lead, :notice => 'Lead was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :ac... | [
"0.68052846",
"0.6797777",
"0.6654227",
"0.66289854",
"0.6526418",
"0.6510545",
"0.6505066",
"0.6482541",
"0.6437564",
"0.64361393",
"0.6428428",
"0.63580394",
"0.6260969",
"0.6250523",
"0.6246267",
"0.6212431",
"0.6174743",
"0.6103846",
"0.60978687",
"0.6096416",
"0.6079045"... | 0.6368078 | 11 |
DELETE /leads/1 DELETE /leads/1.json | def destroy
@lead.destroy
respond_to do |format|
format.html { redirect_to leads_url, notice: 'Lead was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @lead = Lead.find(params[:id])\n @lead.destroy\n\n respond_to do |format|\n format.html { redirect_to leads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lead = Lead.find(params[:id])\n @lead.destroy\n\n respond_to do |format|\n format.h... | [
"0.7310889",
"0.7310889",
"0.71970737",
"0.71564037",
"0.7108995",
"0.7048404",
"0.6873277",
"0.6857619",
"0.684245",
"0.6827654",
"0.6819612",
"0.6781248",
"0.67582166",
"0.6737902",
"0.6710801",
"0.6707262",
"0.6704508",
"0.6698268",
"0.66864574",
"0.6642896",
"0.6637567",
... | 0.68972945 | 9 |
Use callbacks to share common setup or constraints between actions. | def set_lead
@lead = Lead.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def lead_params
params.require(:lead).permit(:name, :email, :company_name, :office_phone, :cell_phone, :last_contacted, :next_contact, :next_contact_time, :source)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
method to calculate the size of nth Fibonacci number | def fib(n)
arr = []
for i in 0..n do
if i == 0
arr.push(0)
elsif i == 1
arr.push(1)
else
arr.push(arr[i-1] + arr[i-2])
end
end
return arr.last.to_s.size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_fibonacci_index_by_length(num)\n first_num = 1\n second_num = 1\n count = 3\n loop do \n result = first_num + second_num\n break if result.to_s.size == num\n first_num, second_num = second_num, result\n count += 1\n end\n count\nend",
"def nthFibonacci (n)\n # Your code here\n fArr =... | [
"0.77486396",
"0.76672125",
"0.7662239",
"0.7636998",
"0.76261735",
"0.75843513",
"0.7497672",
"0.74841917",
"0.7462462",
"0.74268335",
"0.74268335",
"0.74268335",
"0.74268335",
"0.74268335",
"0.74132675",
"0.7387797",
"0.7384352",
"0.737555",
"0.73666435",
"0.7362517",
"0.73... | 0.7999713 | 0 |
Receives Array of required keys and a Hash of attributes | def confirm_attrs(required, attrs)
raise "The pramater you passed needs be a Hash of attributes. You passed a #{attrs.class}." unless attrs.is_a? Hash
required.each do |req|
raise "#{req} key required, of type #{req.class}" unless attrs[req]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def required_attributes!(keys)\n keys.each do |key|\n bad_request!(key) unless params[key].present?\n end\n end",
"def required_attributes!(keys)\n keys.each do |key|\n bad_request!(key) unless params[key].present?\n end\n end",
"def coerce_keys(*attrs); end",
"def val... | [
"0.6841959",
"0.6841959",
"0.6837118",
"0.6576179",
"0.64600337",
"0.63800055",
"0.634109",
"0.6327754",
"0.6256141",
"0.62504005",
"0.619837",
"0.61837643",
"0.6180681",
"0.61801195",
"0.6173598",
"0.6160434",
"0.61117536",
"0.61117536",
"0.609998",
"0.6074639",
"0.605074",
... | 0.7064637 | 0 |
Init Arguments: client: (Client) | def initialize(client)
@client = client
@client.epoint = ENTRY_POINT
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(client)\n self.client=client\n\n\tend",
"def initialize(client)\n\t self.client=client\n end",
"def initialize(client)\n\t\tself.client = client\n\tend",
"def initialize(client)\n\t\tself.client = client\n\tend",
"def initialize(client)\n @client = client\n end",
"def init_client;... | [
"0.8760165",
"0.8753106",
"0.8676584",
"0.8676584",
"0.860482",
"0.8586876",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.847831",
"0.... | 0.0 | -1 |
Get tray by type Arguments: username: (String) type: (String) | def get_tray_by_type(username, type)
$LOG.i "running " + __method__.to_s
@client.get '/mc/v1/trays/' + username + '/' + type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_action (type)\n raise ArgumentError, 'type must be either :admins or :trusted.' unless TYPES.include?(type)\n case type\n when :admins then shared[:redis].smembers(\"bot.%s:admins\" % @bot.irc.isupport['NETWORK'].downcase)\n when :trusted then shared[:redis].sunion(\"bot.%s:admins\" % @... | [
"0.5784244",
"0.55979604",
"0.5576323",
"0.5526403",
"0.54225326",
"0.54225326",
"0.54062665",
"0.5396966",
"0.5396966",
"0.53809154",
"0.53257984",
"0.5313164",
"0.5241699",
"0.5206963",
"0.51811665",
"0.5138293",
"0.5136637",
"0.51315564",
"0.5129698",
"0.5108318",
"0.51042... | 0.8800069 | 0 |
List thread details based on thread id Arguments: username: (String) thread_id: (String) | def get_thread_details(username, thread_id)
$LOG.i "running " + __method__.to_s
@client.get '/mc/v1/threads/' + username + '/' + thread_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def threads\n @threads = Contribution.where(\"user_id=?\",params[:id]).all.order(\"created_at desc\")\n end",
"def list_threads\n @client.call(\"core.thread_list\")\n end",
"def load_thread thread_id\n results = perform :thread, :args => [thread_id]\n results.map { |m, depth| [Message... | [
"0.67880374",
"0.67591995",
"0.66476846",
"0.6638207",
"0.6532455",
"0.64377147",
"0.6340475",
"0.6273605",
"0.6256329",
"0.6217641",
"0.61668444",
"0.60662067",
"0.60188234",
"0.59845114",
"0.5976487",
"0.5939447",
"0.5927311",
"0.58918506",
"0.5840369",
"0.58371025",
"0.583... | 0.7999063 | 0 |
Get a specific thread by context Arguments: username: (String) job_key: (String) application_id: (String) context: (String) | def get_thread_by_context(username, job_key, application_id, context = 'Interviews')
$LOG.i "running " + __method__.to_s
@client.get '/mc/v1/contexts/' + username + '/' + context + ':' + job_key + ':' + application_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_thread_by_context_last_posts(username, job_key, application_id, context = 'Interviews')\n $LOG.i \"running \" + __method__.to_s\n @client.get '/mc/v1/contexts/' + username + '/' + context + ':' + job_key + ':' + application_id + '/last_posts'\n end",
"def get_thread_details(usern... | [
"0.7240415",
"0.6642903",
"0.64021266",
"0.6171239",
"0.5904969",
"0.5617778",
"0.55844253",
"0.5494885",
"0.54487",
"0.5404614",
"0.5324927",
"0.5311593",
"0.53029436",
"0.5289133",
"0.52874136",
"0.52820754",
"0.5224994",
"0.5217989",
"0.5184978",
"0.51796854",
"0.51777285"... | 0.90434414 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.