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 |
|---|---|---|---|---|---|---|
Gets the index of the next line that will be fetched by gets, starting at 0. | def lineno
@source.lineno
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_line_index\n scanner = StringScanner.new(@string)\n result = [0] # first line starts at 0\n while scanner.scan_until(/\\n/)\n result << scanner.pos\n end\n @line_index = result\n end",
"def get_next_line(file, index)\n index.value += 1\n return get_current_line(fi... | [
"0.7382335",
"0.7222228",
"0.69436646",
"0.68897915",
"0.685765",
"0.6754902",
"0.6691898",
"0.66674817",
"0.6660438",
"0.6552503",
"0.6537625",
"0.653273",
"0.6455776",
"0.6442657",
"0.64307666",
"0.64033633",
"0.6379832",
"0.63787097",
"0.6352932",
"0.6321197",
"0.6280669",... | 0.0 | -1 |
Gets the next scanline from the image. | def gets
@source.gets
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_scanline(&block)\n for line_no in 0...height do\n scanline = pixels[width * line_no, width]\n yield(scanline)\n end\n end",
"def next_tile_img\n next_tile_img = @current_tile_indx + 1\n case @current_move\n when Direction::Up\n next_ti... | [
"0.6727522",
"0.5699969",
"0.5695894",
"0.56392694",
"0.56215143",
"0.5598582",
"0.5414653",
"0.53608847",
"0.5341764",
"0.5335011",
"0.5294246",
"0.5280069",
"0.5276989",
"0.52690667",
"0.52583206",
"0.52565295",
"0.52398974",
"0.5227226",
"0.5226742",
"0.51903397",
"0.51595... | 0.0 | -1 |
Setup the database migrations | def copy_migrations
[
'create_file_view_stats.rb',
'create_file_download_stats.rb'
].each do |file|
better_migration_template file
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def migrate\n run_migrations pending_migrations, :up\n end",
"def run\n load_migrations\n @migrations.each do |mig_class, version|\n mig_class.up\n # Add it to the schema_migrations table as well\n # This will fail if auto-migrations is only and always used,\n # as t... | [
"0.74758285",
"0.7456984",
"0.74459994",
"0.7405735",
"0.7358846",
"0.7246884",
"0.7202893",
"0.7149887",
"0.7090692",
"0.7038769",
"0.70298225",
"0.6974153",
"0.6974153",
"0.6860222",
"0.6855415",
"0.68009853",
"0.6789679",
"0.6785831",
"0.6687629",
"0.6627187",
"0.65969884"... | 0.0 | -1 |
returns array of arrays mapping annotation to value | def annotated_values_list(values_to_split=self.values)
values_to_split.split(VALUES_SPLITTER).map {|e|
k = e.gsub(/\((.*)?\)/, '')
$1 ? [$1, k] : [e,e]
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def [] name\n annotations_hash[name.to_sym]\n end",
"def annotations\n form = self.to_json\n annotations = Array.new\n annotations += bc_annotations\n annotations += question_annotations\n return annotations\n end",
"def spreadsheet_annotation_search_fields\n annotations = []\n un... | [
"0.67670727",
"0.6676099",
"0.6590774",
"0.65003717",
"0.6200452",
"0.61243695",
"0.60560536",
"0.60560536",
"0.60560536",
"0.60560536",
"0.60560536",
"0.60560536",
"0.60560536",
"0.60560536",
"0.60516894",
"0.5891641",
"0.58614075",
"0.58585715",
"0.5786706",
"0.56332755",
"... | 0.62658453 | 4 |
Index all pages except pages matching any value in config[:indextank][:excludes] The main content from each page is extracted and indexed at indextank.com The doc_id of each indextank document will be the absolute url to the resource without domain name | def run(content, params={})
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, space_after_headers: true)
page_text = extract_text(markdown.render(item.raw_content))
title = item[:title] || item.identifier
file_name = item.identifier.to_s.gsub(/\//,'_')
puts "Indexing page: #{@item.identifier} to #{@tmp_index}/#{file_name}.idx"
unless Dir.exists?(@tmp_index)
Dir.mkdir(@tmp_index)
end
idx_file_name = "#{@tmp_index}/#{file_name}.idx"
if File.exists?(idx_file_name)
File.delete(idx_file_name)
end
File.open(idx_file_name,"w+") do |file|
file.write({title: title, text: page_text, tags: "api", loc: @item.path }.to_json)
end
content
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index_pages\n debug_msg \" generating pages search index\"\n\n pages = @files.select do |file|\n file.text?\n end\n\n pages.each do |page|\n debug_msg \" #{page.page_name}\"\n record = page.search_record\n @index[:searchIndex] << search_string(record.shift)\n @index... | [
"0.67897886",
"0.6443216",
"0.63677955",
"0.6316591",
"0.6270402",
"0.60933906",
"0.6065452",
"0.6006128",
"0.59498966",
"0.5900518",
"0.58711773",
"0.5818041",
"0.58163923",
"0.5811085",
"0.5801141",
"0.57747304",
"0.5763593",
"0.57465756",
"0.5745121",
"0.5709401",
"0.56974... | 0.54789686 | 44 |
Changes fill color of cell | def change_fill(rgb = 'ffffff')
validate_worksheet
Color.validate_color(rgb)
self.style_index = workbook.modify_fill(self.style_index, rgb)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill(color)\n @style[:fill] = color\n end",
"def fill_color(color)\n end",
"def change_fill(rgb='ffffff')\n validate_worksheet\n Color.validate_color(rgb)\n @style_index = modify_fill(@workbook, @style_index,rgb)\n end",
"def setfillcolorind(*)\n super\n end",
"def ... | [
"0.7817586",
"0.7680768",
"0.7537821",
"0.74548644",
"0.7234923",
"0.7226518",
"0.70177794",
"0.69221914",
"0.68277735",
"0.67624754",
"0.66980034",
"0.6589905",
"0.6563709",
"0.6500531",
"0.64753926",
"0.6473927",
"0.63611907",
"0.63611335",
"0.6320901",
"0.62614584",
"0.620... | 0.75035655 | 4 |
Changes font name of cell | def change_font_name(new_font_name = 'Verdana')
validate_worksheet
font = get_cell_font.dup
font.set_name(new_font_name)
update_font_references(font)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def change_column_font_name(col=0, font_name='Verdana')\n # Get style object\n xf_id = xf_id(get_col_style(col))\n # Get copy of font object with modified name\n font = deep_copy(@workbook.fonts[xf_id[:fontId].to_s][:font])\n font[:name][:attributes][:val] = font_name.to_s\n # Update font and xf ... | [
"0.81314415",
"0.7896164",
"0.7712866",
"0.77062994",
"0.72959864",
"0.7255562",
"0.71670526",
"0.7110613",
"0.71081805",
"0.6693014",
"0.6693014",
"0.66816",
"0.66816",
"0.66166097",
"0.6615892",
"0.65713406",
"0.65297943",
"0.6436224",
"0.6427392",
"0.6379348",
"0.6362969",... | 0.8321192 | 1 |
Changes font size of cell | def change_font_size(font_size = 10)
validate_worksheet
raise 'Argument must be a number' unless font_size.is_a?(Integer) || font_size.is_a?(Float)
font = get_cell_font.dup
font.set_size(font_size)
update_font_references(font)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def change_column_font_size(col=0, font_size=10)\n # Get style object\n xf_id = xf_id(get_col_style(col))\n # Get copy of font object with modified size\n font = deep_copy(@workbook.fonts[xf_id[:fontId].to_s][:font])\n font[:sz][:attributes][:val] = font_size\n # Update font and xf array\n cha... | [
"0.77199495",
"0.7712393",
"0.7611653",
"0.71374416",
"0.6978516",
"0.692586",
"0.6728187",
"0.66601753",
"0.66556317",
"0.6619674",
"0.6533546",
"0.6522609",
"0.6501379",
"0.64703393",
"0.64372236",
"0.64372236",
"0.6417534",
"0.6395196",
"0.63928103",
"0.6318056",
"0.626153... | 0.7972899 | 1 |
Changes font color of cell | def change_font_color(font_color = '000000')
validate_worksheet
Color.validate_color(font_color)
font = get_cell_font.dup
font.set_rgb_color(font_color)
update_font_references(font)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def change_column_font_color(col=0, font_color='000000')\n Color.validate_color(font_color)\n # Get style object\n xf_id = xf_id(get_col_style(col))\n # Get copy of font object with modified color\n font = deep_copy(@workbook.fonts[xf_id[:fontId].to_s][:font])\n font = modify_font_color(font, fon... | [
"0.7460085",
"0.72489184",
"0.72067857",
"0.7135468",
"0.71241385",
"0.7105533",
"0.70734954",
"0.70734954",
"0.7011126",
"0.70002514",
"0.68595064",
"0.68219143",
"0.68219143",
"0.68104655",
"0.6794587",
"0.67466515",
"0.67338556",
"0.66503805",
"0.66452426",
"0.64654624",
"... | 0.769588 | 1 |
Changes font italics settings of cell | def change_font_italics(italicized = false)
validate_worksheet
font = get_cell_font.dup
font.set_italic(italicized)
update_font_references(font)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def change_font_italics(italicized=false)\n validate_worksheet\n # Get copy of font object with modified italics settings\n font = deep_copy(workbook.fonts[font_id().to_s][:font])\n font = modify_font_italics(font, italicized)\n # Update font and xf array\n change_font(font)\n end"... | [
"0.72236353",
"0.678297",
"0.6767767",
"0.6639636",
"0.6613759",
"0.6494832",
"0.6494832",
"0.64336115",
"0.6389968",
"0.63753814",
"0.63357896",
"0.6335046",
"0.63281983",
"0.63196945",
"0.62855744",
"0.62762696",
"0.62762696",
"0.6264959",
"0.6257875",
"0.6174606",
"0.61452... | 0.78815913 | 1 |
Changes font bold settings of cell | def change_font_bold(bolded = false)
validate_worksheet
font = get_cell_font.dup
font.set_bold(bolded)
update_font_references(font)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bold_cell(options = {}, &block)\n cell({ font_style: :bold }.merge(options || {}), &block)\n end",
"def change_font_bold(bolded=false)\n validate_worksheet\n # Get copy of font object with modified bold settings\n font = deep_copy(workbook.fonts[font_id().to_s][:font])\n font = mo... | [
"0.8035638",
"0.7800186",
"0.73778224",
"0.7356081",
"0.7309667",
"0.70927423",
"0.6959655",
"0.69148815",
"0.6847863",
"0.6847863",
"0.67769545",
"0.67683005",
"0.674681",
"0.674681",
"0.66853034",
"0.66853034",
"0.66616106",
"0.66564745",
"0.6619126",
"0.6587305",
"0.657956... | 0.8302406 | 1 |
Changes font underline settings of cell | def change_font_underline(underlined = false)
validate_worksheet
font = get_cell_font.dup
font.set_underline(underlined)
update_font_references(font)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def change_font_underline(underlined=false)\n validate_worksheet\n # Get copy of font object with modified underline settings\n font = deep_copy(workbook.fonts[font_id().to_s][:font])\n font = modify_font_underline(font, underlined)\n # Update font and xf array\n change_font(font)\n ... | [
"0.7695589",
"0.7397015",
"0.7152001",
"0.6990113",
"0.66901463",
"0.66901463",
"0.63874716",
"0.637665",
"0.6372925",
"0.6372925",
"0.63182336",
"0.6254913",
"0.61407024",
"0.6133203",
"0.6093899",
"0.60723346",
"0.60723346",
"0.59276927",
"0.58676517",
"0.5845751",
"0.58457... | 0.826207 | 1 |
Helper method to update the font array and xf array | def update_font_references(modified_font)
xf = workbook.register_new_font(modified_font, get_cell_xf)
self.style_index = workbook.register_new_xf(xf)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_fonts # :nodoc:\n fonts = {}\n\n @xf_formats.each { |format| format.set_font_info(fonts) }\n\n @font_count = fonts.size\n\n # For the DXF formats we only need to check if the properties have changed.\n @dxf_formats.each do |format|\n # The only font properties that can c... | [
"0.7217223",
"0.7196069",
"0.6780197",
"0.6752662",
"0.65118295",
"0.6366855",
"0.629789",
"0.6283244",
"0.62583375",
"0.6256828",
"0.61211723",
"0.6081258",
"0.6046304",
"0.6038587",
"0.6025069",
"0.6016777",
"0.60059357",
"0.599288",
"0.5972548",
"0.59718275",
"0.59718275",... | 0.6951909 | 3 |
Performs correct modification based on what type of change_type is specified | def font_switch(change_type, arg)
case change_type
when Worksheet::NAME then change_font_name(arg)
when Worksheet::SIZE then change_font_size(arg)
when Worksheet::COLOR then change_font_color(arg)
when Worksheet::ITALICS then change_font_italics(arg)
when Worksheet::BOLD then change_font_bold(arg)
when Worksheet::UNDERLINE then change_font_underline(arg)
when Worksheet::STRIKETHROUGH then change_font_strikethrough(arg)
else raise 'Invalid change_type'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def change_type=(value)\n @change_type = value\n end",
"def change_type\n return @change_type\n end",
"def change?\n type == 'change'\n end",
"def changeType(newType)\n\t\t\t#remove accessors for old type\n\t\t\tremoveAccessors()\n\t\t\t@type = newT... | [
"0.7415962",
"0.70975107",
"0.65295625",
"0.63964105",
"0.6308899",
"0.62117475",
"0.6207137",
"0.60622466",
"0.6033784",
"0.59838253",
"0.5969564",
"0.59412515",
"0.57860947",
"0.57648253",
"0.5755102",
"0.57204807",
"0.56712013",
"0.5636245",
"0.56282115",
"0.55879545",
"0.... | 0.62650555 | 6 |
insert a message into table | def single_insert(table_name, hash)
status = true
begin
columns = []
values = []
hash.keys.each do |item|
columns.push(item)
values.push("'#{hash[item]}'")
end
columns = columns.join(",")
values = values.join(",")
@mysql_client.query("INSERT INTO #{table_name} (#{columns}) VALUES (#{values})")
rescue
status = false
end
return status
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_message_table\n execute_sql_statement(\"CREATE TABLE messages (\\n\" \\\n \" id CHAR PRIMARY KEY, \\n\" \\\n \" sender CHAR NOT NULL, -- Hostname of sender \\n\" \\\n \" action CHAR NOT NULL, -- The action to perform \\n\" \\\n \" payload CHAR, -- Optional payload \\n\" \\... | [
"0.69987446",
"0.68026465",
"0.6523364",
"0.62094504",
"0.6206268",
"0.6183485",
"0.6135957",
"0.61356354",
"0.60963815",
"0.60535014",
"0.60174793",
"0.592762",
"0.5897302",
"0.589414",
"0.5870947",
"0.5870938",
"0.5868112",
"0.58478814",
"0.5839603",
"0.5834173",
"0.5784849... | 0.0 | -1 |
delete a table message or single message | def single_delete(table_name, id=nil)
status = true
begin
sql = "DELETE FROM #{table_name}"
sql << "WHERE id = #{id}" unless id.nil?
@mysql_client.query(sql)
rescue
status = false
end
return status
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_message(data); end",
"def delete_message(data); end",
"def destroy\n # delete a specific message\n end",
"def destroy\n # delete a specific message\n end",
"def destroy\n # delete a specific message\n end",
"def delete_message(id)\n record \"/msg/delete/#{id}\"\n end",
... | [
"0.7788787",
"0.7788787",
"0.7491494",
"0.7476153",
"0.74711",
"0.7355781",
"0.7272073",
"0.7231599",
"0.70730984",
"0.69947916",
"0.69696033",
"0.69531834",
"0.6899367",
"0.6844329",
"0.6842122",
"0.6702027",
"0.6698341",
"0.6674545",
"0.66705793",
"0.66674906",
"0.66562545"... | 0.0 | -1 |
Endpoint /images exists on both v1 and v2 API The attribute 'visibility' is used to detect if the call has been made on v1 or v2 In case of v2 we have all the needed information, but in case of v1 we don't and we have to call /images/detail to get full details | def get_all_images(env)
images_json = get(env, "#{@session.endpoints[:image]}/images")
images = JSON.parse(images_json)['images']
return images if images.empty?
is_v1 = false
unless images[0].key? 'visibility'
is_v1 = true
images_json = get(env, "#{@session.endpoints[:image]}/images/detail")
images = JSON.parse(images_json)['images']
end
images.map do |i|
i['visibility'] = i['is_public'] ? 'public' : 'private' if is_v1
Image.new(i['id'], i['name'], i['visibility'], i['size'], i['min_ram'], i['min_disk'])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def images() \n uri = URI.parse(\"http://\" + @location.host + \":9292/v2/images\")\n return get_request(uri, @token)\n end",
"def marketplace_image_my_images_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VnfsApi.marketplace_i... | [
"0.69040823",
"0.679674",
"0.6651114",
"0.66303474",
"0.66300285",
"0.66095346",
"0.6472469",
"0.63388175",
"0.6218389",
"0.61983496",
"0.6182718",
"0.6181039",
"0.6158568",
"0.61570495",
"0.6153924",
"0.61496735",
"0.61372",
"0.6112597",
"0.61104816",
"0.6085985",
"0.6065200... | 0.724104 | 0 |
this makes puppet serialize it as an array for backwards compatibility | def to_zaml(z)
to_a.to_zaml(z)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize_array\n `self.serializeArray()`.map { |e| Hash.new(e) }\n end",
"def to_a; Array(force) end",
"def to_ary() end",
"def to_ary\n end",
"def to_a\n to_array(@version)\n end",
"def to_a\n to_array(@version)\n end",
"def to_a; [Array]; end",
"def to_ary; self.to_a; en... | [
"0.71346045",
"0.708722",
"0.7059569",
"0.69795847",
"0.6864735",
"0.6864735",
"0.6754864",
"0.67372924",
"0.67151636",
"0.6714871",
"0.6714871",
"0.6677164",
"0.6673366",
"0.66657084",
"0.66579926",
"0.6644083",
"0.6621313",
"0.6604245",
"0.6591526",
"0.65850824",
"0.6572028... | 0.0 | -1 |
The list of record types that are subject to rolebased authorization. | def authorizable_classes
[].tap do |result|
ObjectSpace.each_object(Class) do |c|
next unless c.superclass == ApplicationRecord
result << c if c.ancestors.include?(Record::Authorizable)
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_types\n return [] unless allow_new_records?\n\n # build our list\n Record.record_types - %w{ SOA NS } - self.permissions['protected_types']\n end",
"def permissions\n Roles.type_map[role_type].permissions\n end",
"def type\n TYPES[roletype_id]\n end",
"def roles\n # we ... | [
"0.716263",
"0.64408636",
"0.6407403",
"0.6221865",
"0.6221865",
"0.619954",
"0.6161902",
"0.6125767",
"0.6112597",
"0.61106265",
"0.6098491",
"0.6019373",
"0.60175246",
"0.59589326",
"0.59574884",
"0.5944856",
"0.5934277",
"0.58913875",
"0.5860091",
"0.5839778",
"0.5825049",... | 0.58287704 | 20 |
create a new method called encrypt_file | def encrypt_file(filename)
#open the file by passing it the name and ..
input = File.open(filename, 'r')
#this is a string now so
contents = input.read
encrypted_contents = encrypt_string(contents)
input.close
output = File.open(filename + '.encrypted', 'w')
output.write(encrypted_contents)
output.close
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _encrypt\n cryptor_files(@encrypting)\n end",
"def encrypt; end",
"def encrypt_file(path, password = nil)\n salt = random_bytes(@salt_len)\n iv = random_bytes(@salt_len)\n aes_key, mac_key = keys(salt, password)\n\n cipher = cipher(aes_key, iv)\n hmac = OpenSSL::HMAC.new(mac_key, OpenSSL... | [
"0.8163636",
"0.7333509",
"0.7324852",
"0.711056",
"0.71002173",
"0.7091229",
"0.69009787",
"0.6887336",
"0.6855868",
"0.6695875",
"0.6693692",
"0.6673215",
"0.6595401",
"0.6578915",
"0.6559419",
"0.654343",
"0.63634336",
"0.6324155",
"0.6296088",
"0.62679666",
"0.62218285",
... | 0.78390193 | 1 |
GET /idea_events/1 GET /idea_events/1.json | def show
@idea_event = IdeaEvent.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @idea_event }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n event_id = params[:id]\n if event_id.present?\n @event = Com::Nbos::Events::Event.active_events.where(id: event_id, tenant_id: @user.tenant_id)\n if @event.present?\n render :json => @event\n else\n render :json => {messageCode: \"event.notfound\", message: \"Event Not... | [
"0.7197953",
"0.7134962",
"0.71243465",
"0.7120562",
"0.7075237",
"0.70402384",
"0.7034575",
"0.6994844",
"0.6988892",
"0.69875777",
"0.69693494",
"0.69682765",
"0.6964784",
"0.6964719",
"0.69442165",
"0.69442165",
"0.6905342",
"0.68974143",
"0.68942356",
"0.6893209",
"0.6886... | 0.76614374 | 0 |
GET /idea_events/new GET /idea_events/new.json | def new
@idea_event = IdeaEvent.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @idea_event }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @event = Event.new\n\n @idea = Idea.find(params[:idea_id])\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @create_event = CreateEvent.new\n\n respond_to do |format|\n format.html # new.html.erb... | [
"0.8198065",
"0.7807702",
"0.7785182",
"0.77731454",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
"0.7770926",
... | 0.8179622 | 1 |
POST /idea_events POST /idea_events.json | def create
@idea_event = IdeaEvent.new(params[:idea_event])
respond_to do |format|
if @idea_event.save
format.html { redirect_to @idea_event, notice: 'Idea event was successfully created.' }
format.json { render json: @idea_event, status: :created, location: @idea_event }
else
format.html { render action: "new" }
format.json { render json: @idea_event.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n event = Event.new(event_params)\n event.save!\n render json: event\n end",
"def create\n @event = Event.new(params[:event])\n\n if @event.save\n render json: @event, status: :created, location: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n ... | [
"0.71049494",
"0.70508987",
"0.7032693",
"0.70037943",
"0.69367915",
"0.6895117",
"0.6892014",
"0.6888186",
"0.6881555",
"0.68300587",
"0.68238586",
"0.6814062",
"0.6814062",
"0.6804513",
"0.6785903",
"0.67474085",
"0.6739564",
"0.67283446",
"0.67163396",
"0.6708329",
"0.6707... | 0.75621074 | 0 |
PUT /idea_events/1 PUT /idea_events/1.json | def update
@idea_event = IdeaEvent.find(params[:id])
respond_to do |format|
if @idea_event.update_attributes(params[:idea_event])
format.html { redirect_to @idea_event, notice: 'Idea event was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
format.json { render json: @idea_event.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n if @event.update(event_params)\n render json: @event, status: 201\n else\n render json: { message: \"Error. Error. Please try again.\"}, status: 400\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { head :no_content... | [
"0.717151",
"0.7011583",
"0.69779676",
"0.6961609",
"0.6927854",
"0.6927854",
"0.6925483",
"0.6925483",
"0.6918708",
"0.6892866",
"0.688861",
"0.6880861",
"0.68747026",
"0.68413895",
"0.6805405",
"0.6805405",
"0.67964655",
"0.67947567",
"0.67864186",
"0.6774603",
"0.67690945"... | 0.7532498 | 0 |
DELETE /idea_events/1 DELETE /idea_events/1.json | def destroy
@idea_event = IdeaEvent.find(params[:id])
@idea_event.destroy
respond_to do |format|
format.html { redirect_to idea_events_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format... | [
"0.7356678",
"0.7356678",
"0.7356678",
"0.72667587",
"0.7262428",
"0.725565",
"0.72413594",
"0.72362095",
"0.7225875",
"0.7220038",
"0.7208296",
"0.7172826",
"0.71633935",
"0.7155159",
"0.71438223",
"0.71438223",
"0.71438223",
"0.71438223",
"0.71438223",
"0.71438223",
"0.7143... | 0.7519186 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_step
@step = @recipe_item.steps.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 step_params
params.require(:step).permit(:recipe_item_id, :comment, cards: [:c_type, :c_id, :c_varient]
)
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 |
Convert the freebase ID for a type into an API endpoint ID | def to_endpoint id
t=id.split('/')
domain = t[1..-2].join('_')
type = t[-1]
"freebase_tsv_#{domain}__#{type}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input_id_from_type(type); end",
"def input_id_from_type(type)\n id = input_name_from_type(type).gsub(/([\\[(])|(\\]\\[)/, \"_\").gsub(/[\\])]/, \"\")\n id = @options[:namespace] + \"_\" + id if @options[:namespace]\n\n id\n end",
"def to_global_id(type_name, id)\n B... | [
"0.6792407",
"0.6662417",
"0.6573084",
"0.6489617",
"0.6410082",
"0.59508866",
"0.59441143",
"0.5940383",
"0.5859375",
"0.5813677",
"0.57950646",
"0.5763398",
"0.573497",
"0.57264423",
"0.57264423",
"0.57245207",
"0.5715948",
"0.5667675",
"0.56559783",
"0.5621114",
"0.5607873... | 0.7049781 | 0 |
used for if then statements! | def user_login?
!!current_user
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conditionally(*) end",
"def conditionally(*) end",
"def if_condition; end",
"def cond; end",
"def cond; end",
"def cond; end",
"def condition; end",
"def if_proc; end",
"def else_clause\n expect :if\n self[3]\n end",
"def statement; end",
"def check ; true ; end",
"def if_proc=(_ar... | [
"0.7320614",
"0.7320614",
"0.7181289",
"0.6968806",
"0.6968806",
"0.6968806",
"0.68913114",
"0.6626747",
"0.66117996",
"0.6603368",
"0.6441278",
"0.6436673",
"0.6352818",
"0.631207",
"0.62904346",
"0.62904346",
"0.6248565",
"0.6234932",
"0.6142858",
"0.6104267",
"0.6084472",
... | 0.0 | -1 |
downloads csv of all research data submitted to users computer | def get_rex
if Project.exists?
@grant_data = Project.all_csv
respond_to do |format|
format.html
format.csv do
send_data @grant_data, filename: "research_data#{Time.now.to_s(:db)}.csv"
end
# format.CSV {render csv: @grant_data.to_csv}
# format.xls {render text: @grant_data.to_csv(col_sep: "\t")}
end
else
flash[:success] = "Research Expenditure Table is Empty"
redirect_to :controller => 'amrc_reports', :action => 'reports'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def csv_download\n filename = sprintf(\"%s-%s.csv\",\n model_name,\n Time.now.strftime(\"%Y%m%d-%H%M%S\"))\n file = Tempfile.new(filename, Settings.edgarj.csv_dir)\n csv_visitor = EdgarjHelper::CsvVisitor.new(view_context)\n file.write CSV... | [
"0.7011126",
"0.69842565",
"0.686099",
"0.678201",
"0.66817033",
"0.66473687",
"0.65763",
"0.657369",
"0.65720564",
"0.6526086",
"0.6525991",
"0.65042615",
"0.6411234",
"0.6344524",
"0.6336109",
"0.6324183",
"0.62556845",
"0.62349075",
"0.6234365",
"0.6226747",
"0.621516",
... | 0.6199916 | 21 |
downloads csv of all unsubmitted charity information to users computer | def get_unsubmitted
@grant_data = User.to_csv_unsubmitted
respond_to do |format|
format.html
format.csv do
send_data @grant_data, filename: "unsubmitted_charity_data#{Time.now.to_s(:db)}.csv"
end
# format.CSV {render csv: @grant_data.to_csv}
# format.xls {render text: @grant_data.to_csv(col_sep: "\t")}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def csv_download\n filename = sprintf(\"%s-%s.csv\",\n model_name,\n Time.now.strftime(\"%Y%m%d-%H%M%S\"))\n file = Tempfile.new(filename, Settings.edgarj.csv_dir)\n csv_visitor = EdgarjHelper::CsvVisitor.new(view_context)\n file.write CSV... | [
"0.6814283",
"0.6776089",
"0.6498901",
"0.64953804",
"0.64366996",
"0.64343286",
"0.6416474",
"0.6397308",
"0.63735765",
"0.63432944",
"0.6314342",
"0.6137285",
"0.6128341",
"0.61055076",
"0.60093373",
"0.6004062",
"0.59937435",
"0.59893876",
"0.59883535",
"0.5964434",
"0.593... | 0.64995736 | 2 |
downloads csv of all grant data to users computer | def get_grant_data
if GrantsData.exists?
@grant_data = GrantsData.all_csv
respond_to do |format|
format.html
format.csv do
send_data @grant_data, filename: "all_grants_data_#{Time.now.to_s(:db)}.csv"
end
end
else
flash[:notice] = 'Grant Data Table Empty'
redirect_to :controller => 'amrc_reports', :action => 'reports'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download_csv\n case current_user.role.name\n when 'Edutor Admin'\n usages = Usage\n when 'Institute Admin'\n usages = current_user.usages\n when 'Center Representative'\n usages = current_user.usages\n when 'Teacher'\n class_contents = current_user.class_conte... | [
"0.7116747",
"0.692551",
"0.674647",
"0.6619299",
"0.65484095",
"0.6452047",
"0.63973594",
"0.63890463",
"0.6355495",
"0.6330534",
"0.63282967",
"0.63040084",
"0.62965393",
"0.6282694",
"0.62816906",
"0.6239026",
"0.6235171",
"0.6225189",
"0.6220521",
"0.6188535",
"0.6173388"... | 0.70627373 | 1 |
downloads csv of all daashboard data to users computer | def to_csv_dash_data
@grant_data = dash_data_create
respond_to do |format|
format.html
format.csv do
send_data @grant_data, filename: "all_dashboard_data#{Time.now.to_s(:db)}.csv"
end
# format.CSV {render csv: @grant_data.to_csv}
# format.xls {render text: @grant_data.to_csv(col_sep: "\t")}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def csv_download\n filename = sprintf(\"%s-%s.csv\",\n model_name,\n Time.now.strftime(\"%Y%m%d-%H%M%S\"))\n file = Tempfile.new(filename, Settings.edgarj.csv_dir)\n csv_visitor = EdgarjHelper::CsvVisitor.new(view_context)\n file.write CSV... | [
"0.7141524",
"0.70957816",
"0.687725",
"0.681005",
"0.6804725",
"0.6769631",
"0.6722505",
"0.66143596",
"0.6534622",
"0.6529854",
"0.6515218",
"0.6496916",
"0.6465505",
"0.64329946",
"0.6424665",
"0.6418542",
"0.63845885",
"0.63584995",
"0.6355562",
"0.6339171",
"0.63039297",... | 0.6429926 | 14 |
creates csv file containing two tables, one with Total_Research_Spending, Total_Estimated_Research_Spending, Total_Grants_Spending, Total_Number_of_Charities, Research_Forms_Submitted and Grant_Forms_Submitted and another table containing category data. | def dash_data_create
set_cat_data
grants_percent = ((session[:research_sub].to_f / session[:num_charities].to_f) * 100).to_s + '%'
research_percent = ((session[:grants_sub].to_f / session[:num_charities].to_f) * 100).to_s + '%'
a_val = Array.new()
b_val = Array.new()
c_val = Array.new()
d_val = Array.new()
e_val = Array.new()
values = Array.new()
a_val.push('a', @a_research, @a_grant)
b_val.push('b', @b_research, @b_grant)
c_val.push('c', @c_research, @c_grant)
d_val.push('d', @d_research, @d_grant)
e_val.push('e', @e_research, @e_grant)
values.push(session[:rex_spending], session[:rex_est_spending], session[:grant_total], session[:num_charities], grants_percent, research_percent)
attributes = %w{Total_Research_Spending Total_Estimated_Research_Spending Total_Grants_Spending Total_Number_of_Charities Research_Forms_Submitted Grant_Forms_Submitted}
attributes1 = values
attributes2 = %w{Category Research_Expenditure Grant_Expenditure}
attributesa = a_val
attributesb = b_val
attributesc = c_val
attributesd = d_val
attributese = e_val
CSV.generate(headers: true) do |csv|
csv << attributes
csv << attributes1
csv << attributes2
csv << attributesa
csv << attributesb
csv << attributesc
csv << attributesd
csv << attributese
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_summary_csv(summary_csv_path)\n puts \"creating summary csv: #{summary_csv_path}\"\n\n CSV.open(summary_csv_path, \"wb\") do |csv|\n csv << SUMMARY_CSV_HEADINGS\n end\nend",
"def to_csv()\n all = general_info_csv() + \"\\r\\n\" +\n teacher_for_csv() + \"\\r\\n\" +\n contributor_to_c... | [
"0.65237296",
"0.63733584",
"0.61526465",
"0.61163276",
"0.6080415",
"0.604004",
"0.59639037",
"0.5943307",
"0.58680505",
"0.5860356",
"0.58485687",
"0.5837901",
"0.5829537",
"0.58263755",
"0.57953906",
"0.5744318",
"0.5739315",
"0.57381576",
"0.57033294",
"0.57029927",
"0.56... | 0.62720853 | 2 |
downloads csv of research data individual charity to users computer | def get_individual
individual = User.find(params[:charity_id])
if Project.exists?(userID: params[:charity_id])
csv_data = Project.particular_csv(individual.id)
respond_to do |format|
format.html
format.csv do
send_data csv_data, filename: "individual_research_expenditure_data#{Time.now.to_s(:db)}.csv"
end
# format.CSV {render csv: @grant_data.to_csv}
# format.xls {render text: @grant_data.to_csv(col_sep: "\t")}
end
else
flash[:notice] = 'No Research Data for ' + individual.charity_name
redirect_to :controller => 'amrc_reports', :action => 'research_individual'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def csv_download\n filename = sprintf(\"%s-%s.csv\",\n model_name,\n Time.now.strftime(\"%Y%m%d-%H%M%S\"))\n file = Tempfile.new(filename, Settings.edgarj.csv_dir)\n csv_visitor = EdgarjHelper::CsvVisitor.new(view_context)\n file.write CSV... | [
"0.72661763",
"0.7228881",
"0.6951488",
"0.69504035",
"0.68587995",
"0.68145156",
"0.681413",
"0.67607623",
"0.67035186",
"0.6702409",
"0.670057",
"0.6665862",
"0.6545669",
"0.6513945",
"0.646444",
"0.64043987",
"0.63994145",
"0.63984376",
"0.63079965",
"0.6307336",
"0.630668... | 0.65077966 | 14 |
downloads csv of grant data for individual to users computer | def get_individual_grant
individual = User.find(params[:charity_id])
if GrantsData.exists?(userID: params[:charity_id])
csv_data = GrantsData.particular_csv(individual.id)
respond_to do |format|
format.html
format.csv do
send_data csv_data, filename: "individual_grants_data#{Time.now.to_s(:db)}.csv"
end
# format.CSV {render csv: @grant_data.to_csv}
# format.xls {render text: @grant_data.to_csv(col_sep: "\t")}
end
else
flash[:notice] = 'No Grant Data for ' + individual.charity_name
redirect_to :controller => 'amrc_reports', :action => 'grants_individual'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download_csv\n case current_user.role.name\n when 'Edutor Admin'\n usages = Usage\n when 'Institute Admin'\n usages = current_user.usages\n when 'Center Representative'\n usages = current_user.usages\n when 'Teacher'\n class_contents = current_user.class_conte... | [
"0.72140783",
"0.720665",
"0.67683274",
"0.6712821",
"0.6648203",
"0.6629684",
"0.65356046",
"0.6455421",
"0.6428573",
"0.6386088",
"0.63263327",
"0.6281056",
"0.6259903",
"0.62355286",
"0.62216735",
"0.6213511",
"0.620566",
"0.61847556",
"0.6174584",
"0.6166345",
"0.61079746... | 0.68278235 | 2 |
passes all Users research_individual page | def research_individual
@users = Array.new()
User.all.each do |u|
if !u.admin?
@users.push(u)
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def research_index\n @houdd_user = HouddUser.find(params[:user_id])\n @researches = HouddUser.find(params[:user_id]).researches\n\n respond_to do |format|\n format.html # research_index.html.erb\n end\n end",
"def search_results\n @individual = Individual.by_uid( params[:'names-search-uid'] ... | [
"0.7037881",
"0.6689106",
"0.66761935",
"0.6341753",
"0.629902",
"0.6236115",
"0.62332314",
"0.61650485",
"0.612081",
"0.61120796",
"0.60854584",
"0.60741794",
"0.60646766",
"0.603476",
"0.6031838",
"0.60244644",
"0.5999334",
"0.59984946",
"0.5975857",
"0.59227735",
"0.591880... | 0.66935796 | 1 |
passes all Users grant_individual page | def grants_individual
@users = Array.new()
User.all.each do |u|
if !u.admin?
@users.push(u)
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @users = User.all\n @page_title = 'Управление топлива и транспорта'\n @authorized_user = User.find(session[:user_id])\n\n respond_to do |format|\n format.html {redirect_to(controller: 'users', action: 'home') if @authorized_user.grants & 256 == 0}\n format.json { render json: @use... | [
"0.6506483",
"0.6187792",
"0.60953796",
"0.60393095",
"0.6032976",
"0.5996649",
"0.599077",
"0.59881985",
"0.595903",
"0.5936245",
"0.59281325",
"0.5910543",
"0.58918375",
"0.58573866",
"0.5854398",
"0.5803139",
"0.5795631",
"0.5794108",
"0.5765949",
"0.5730097",
"0.571552",
... | 0.6908038 | 0 |
change client password for the solus admin | def change_password(username, password)
perform_request({:action => "client-updatepassword", :username => username, :password => password})
statusmsg.match /success/i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def change_password!(password)\n json = JSON.generate(:changePassword => { :adminPass => password })\n @compute.connection.req('POST', \"/servers/#{@id}/action\", :data => json)\n @adminPass = password\n end",
"def change_password(username, new_password)\n perform_request({:action => \"cli... | [
"0.793124",
"0.7350705",
"0.71624875",
"0.69166595",
"0.69084907",
"0.6891743",
"0.6863151",
"0.68233085",
"0.674484",
"0.6740427",
"0.67357725",
"0.6700214",
"0.6661063",
"0.6637813",
"0.66173005",
"0.65869164",
"0.6579392",
"0.65749407",
"0.6556639",
"0.6524318",
"0.6520393... | 0.7255236 | 2 |
checks wether a specific client exists | def exists?(username)
perform_request({:action => 'client-checkexists', :username => username})
statusmsg.match /client exists/i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exists?(username)\n perform_request({:action => 'client-checkexists', :username => username})\n end",
"def client_exists(client_id, &callback)\n callback.call(@connected.containsKey(client_id))\n end",
"def client?\n !!@client\n end",
"def client?\n !!@client\n end",
"def re... | [
"0.7496921",
"0.7363739",
"0.7176204",
"0.7176204",
"0.7113123",
"0.70755416",
"0.70607466",
"0.7052736",
"0.70427513",
"0.6930154",
"0.69246525",
"0.69246525",
"0.69246525",
"0.69246525",
"0.6894699",
"0.68587893",
"0.6844123",
"0.6816736",
"0.6816736",
"0.6800355",
"0.67597... | 0.80413896 | 0 |
Verify a clients login. Returns true when the specified login is correct | def authenticate(username, password)
perform_request({:action => 'client-authenticate', :username => username, :password => password})
statusmsg.match /validated/i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_correct_login\n res = make_login Configuration.USER, Configuration.PASSWORD\n puts \"\\nTester#test_correct_login:\\n#{res}\" if Configuration.VERBOSE\n res and res.length == Constants.TOKEN_LENGTH and res =~ /^[0-9a-f]*$/\n end",
"def credential_match?(user, login, password)\n return f... | [
"0.7224755",
"0.7023317",
"0.7023317",
"0.7023317",
"0.6988713",
"0.6818284",
"0.6800512",
"0.67621803",
"0.6728221",
"0.67221004",
"0.6692971",
"0.6649924",
"0.664224",
"0.65973926",
"0.65734494",
"0.65288544",
"0.6464526",
"0.64614815",
"0.6452756",
"0.6435171",
"0.63927394... | 0.6087821 | 52 |
Generate the JWT required for the initial GitHub Integrations API handshake. | def new_jwt_token
payload = {
iat: Time.now.to_i, # Issued at time.
exp: (10 * 60) + Time.now.to_i, # JWT expiration time.
iss: APP_ID # Integration's GitHub identifier.
}
JWT.encode(payload, PRIVATE_KEY, 'RS256')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_jwt\n JWT.encode({\n id: id, \n exp: 60.days.from_now.to_i\n }, \n Rails.application.secrets.secret_key_base\n )\n end",
"def generate_jwt\n JWT.encode({ id: id,\n exp: 60.days.from_now.to_i },\n Rails.application.secrets.secret_key_base)\n end",... | [
"0.770027",
"0.76739204",
"0.75817466",
"0.7255995",
"0.7002499",
"0.6947139",
"0.6928979",
"0.68599576",
"0.68227065",
"0.6818304",
"0.68032545",
"0.67955744",
"0.6738663",
"0.6720331",
"0.6719839",
"0.6706644",
"0.6667884",
"0.66223526",
"0.6599878",
"0.6583407",
"0.6580559... | 0.75237906 | 3 |
Gets the attachments property value. Readonly. Nullable. Supports $expand. | def attachments
return @attachments
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attachment\n @attachment\n end",
"def attachments\n @attachments\n end",
"def attachments\n mail&.attachments || []\n end",
"def attachments\n parts.attachments\n end",
"def attachments=(value)\n @attachments = value\n end",
... | [
"0.6709699",
"0.6701456",
"0.6624822",
"0.6510028",
"0.6489727",
"0.6489727",
"0.6489727",
"0.62525403",
"0.6244717",
"0.6181477",
"0.6153343",
"0.61388344",
"0.60685533",
"0.5976693",
"0.5935467",
"0.59322715",
"0.59322715",
"0.5931048",
"0.592182",
"0.5915424",
"0.5894746",... | 0.6567483 | 5 |
Sets the attachments property value. Readonly. Nullable. Supports $expand. | def attachments=(value)
@attachments = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attachments=(value)\n @attachments = Array.new\n unless value.nil? || value.empty?\n value.each do |v1|\n if v1.instance_of? AttachmentJson\n @attachments.push(v1)\n end\n end\n end\n end",
"def... | [
"0.7079706",
"0.69901305",
"0.69901305",
"0.69901305",
"0.69901305",
"0.69037825",
"0.6379742",
"0.62929124",
"0.6069635",
"0.6069635",
"0.6069635",
"0.6069635",
"0.6069635",
"0.6069635",
"0.6069635",
"0.6069635",
"0.6022422",
"0.6022422",
"0.602212",
"0.59902143",
"0.5975776... | 0.8004808 | 2 |
Gets the body property value. The contents of the post. This is a default property. This property can be null. | def body
return @body
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getBody\n @body\n end",
"def body\n self[:body]\n end",
"def body\n read_attribute(:body) || ''\n end",
"def body\n @body || \"\"\n end",
"def body\n data[:body]\n end",
"def body\n if defined? @body\n @body\n else\n Null\n end\... | [
"0.77817756",
"0.7737702",
"0.77064764",
"0.75504357",
"0.75313973",
"0.7431701",
"0.74137205",
"0.7396692",
"0.7342609",
"0.7332517",
"0.72996557",
"0.72766846",
"0.7207902",
"0.71907204",
"0.7170452",
"0.71642023",
"0.71642023",
"0.71642023",
"0.71642023",
"0.7137812",
"0.7... | 0.7334725 | 12 |
Sets the body property value. The contents of the post. This is a default property. This property can be null. | def body=(value)
@body = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def body=(value)\n @body = value\n end",
"def body=(value)\n @body = value\n end",
"def set_body\n self.body = \"\" unless body\n body\n end",
"def set_body\n self.body = \"\" unless body\n body\n end",
"def set_body\n self.body = \"\" unless self.body\n end",
"def body=... | [
"0.83940953",
"0.8258356",
"0.78562945",
"0.78562945",
"0.7826137",
"0.75900346",
"0.7557674",
"0.74825907",
"0.74683005",
"0.7433115",
"0.73629755",
"0.7320466",
"0.73097104",
"0.7208749",
"0.71763206",
"0.70647293",
"0.70517606",
"0.70163375",
"0.70163375",
"0.6828269",
"0.... | 0.834245 | 4 |
Instantiates a new post and sets the default values. | def initialize()
super
@odata_type = "#microsoft.graph.post"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_post\n @post = Post.new post_params\n end",
"def new\n @post = Post.new()\n end",
"def new\n @post = Post.new()\n end",
"def new\n @post = Post.new()\n end",
"def new\n @post = Post.new()\n end",
"def new\n @post = Post.new #returns an empty post\n end"... | [
"0.77533215",
"0.7449862",
"0.7398832",
"0.7398832",
"0.7398832",
"0.7389544",
"0.73541325",
"0.72788274",
"0.7187685",
"0.715627",
"0.7130591",
"0.70875096",
"0.70814353",
"0.70811623",
"0.70811623",
"0.70811623",
"0.70811623",
"0.70811623",
"0.70811623",
"0.7052429",
"0.704... | 0.0 | -1 |
Gets the conversationId property value. Unique ID of the conversation. Readonly. | def conversation_id
return @conversation_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conversation_id=(value)\n @conversation_id = value\n end",
"def conversation_id=(value)\n @conversation_id = value\n end",
"def conversation_thread_id\n return @conversation_thread_id\n end",
"def chat_id\n retur... | [
"0.804745",
"0.804745",
"0.7515663",
"0.6822819",
"0.6822819",
"0.6656735",
"0.66101885",
"0.6587035",
"0.6587035",
"0.6559587",
"0.6471356",
"0.64310956",
"0.6400675",
"0.62336504",
"0.6226752",
"0.6222848",
"0.6222848",
"0.6192165",
"0.61167383",
"0.60516506",
"0.6032556",
... | 0.86132896 | 1 |
Sets the conversationId property value. Unique ID of the conversation. Readonly. | def conversation_id=(value)
@conversation_id = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"def set_conversation\n @conversation = ... | [
"0.6950916",
"0.69257045",
"0.69257045",
"0.69257045",
"0.69257045",
"0.69257045",
"0.69257045",
"0.69257045",
"0.69257045",
"0.69257045",
"0.69257045",
"0.69257045",
"0.69257045",
"0.69257045",
"0.687652",
"0.68558764",
"0.6766833",
"0.6637297",
"0.6637297",
"0.6637297",
"0.... | 0.8422973 | 1 |
Gets the conversationThreadId property value. Unique ID of the conversation thread. Readonly. | def conversation_thread_id
return @conversation_thread_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conversation_thread_id=(value)\n @conversation_thread_id = value\n end",
"def conversation_id\n return @conversation_id\n end",
"def conversation_id\n return @conversation_id\n end",
"def thread_id\n return @thre... | [
"0.7625181",
"0.74000466",
"0.74000466",
"0.72015804",
"0.6623548",
"0.63250613",
"0.63250613",
"0.6158092",
"0.6158092",
"0.61338323",
"0.60831684",
"0.5995234",
"0.59119195",
"0.5764345",
"0.5680798",
"0.565587",
"0.5647614",
"0.5541468",
"0.5510627",
"0.5510627",
"0.543149... | 0.8546284 | 0 |
Sets the conversationThreadId property value. Unique ID of the conversation thread. Readonly. | def conversation_thread_id=(value)
@conversation_thread_id = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conversation_id=(value)\n @conversation_id = value\n end",
"def conversation_id=(value)\n @conversation_id = value\n end",
"def conversation_thread_id\n return @conversation_thread_id\n end",
"def thread_id=(value)\n ... | [
"0.68099767",
"0.68099767",
"0.6674897",
"0.65233916",
"0.5958593",
"0.5958593",
"0.5958593",
"0.5958593",
"0.5958593",
"0.5958593",
"0.5958593",
"0.5958593",
"0.5958593",
"0.5958593",
"0.5958593",
"0.59405696",
"0.59405696",
"0.59405696",
"0.59405696",
"0.59405696",
"0.59405... | 0.8150457 | 0 |
Gets the extensions property value. The collection of open extensions defined for the post. Readonly. Nullable. Supports $expand. | def extensions
return @extensions
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extensions\n @@extensions\n end",
"def extensions\n @@extensions\n end",
"def extensions\n @extensions.to_a\n end",
"def extensions\n data.extensions\n end",
"def extensions\n @extensions ||= []\n end",
"def extensions\n @extensions ||= []\n end",
"de... | [
"0.6979415",
"0.6979415",
"0.6979126",
"0.6968796",
"0.6774288",
"0.6774288",
"0.6657614",
"0.6621277",
"0.65884674",
"0.65884674",
"0.65792555",
"0.65792555",
"0.65792555",
"0.65336263",
"0.6531385",
"0.6531385",
"0.64769137",
"0.6385995",
"0.6354665",
"0.6318663",
"0.627825... | 0.7304631 | 2 |
Sets the extensions property value. The collection of open extensions defined for the post. Readonly. Nullable. Supports $expand. | def extensions=(value)
@extensions = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extensions=(extensions)\n @extensions = Array extensions\n end",
"def extensions=(val)\n set_extensions(val)\n val\n end",
"def extensions=(value)\n subtags = Array(value).flatten\n self.extensions_sequence = subtags.empty? ? nil : subtags.join(HYPHEN)\n end",
"def set... | [
"0.7719422",
"0.7679009",
"0.76493114",
"0.75424236",
"0.697394",
"0.6780455",
"0.6521282",
"0.6521282",
"0.64599013",
"0.6401049",
"0.6389613",
"0.6346257",
"0.6161969",
"0.61548823",
"0.61548823",
"0.61243296",
"0.61243296",
"0.6102344",
"0.6090421",
"0.60843617",
"0.606107... | 0.80081564 | 2 |
Gets the from property value. The from property | def from
return @from
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_property(property_name)\n value = get() and value[property_name]\n end",
"def get_property _property\n send_cmd(\"get_property #{_property}\")\n end",
"def get_value(property)\n if @env_properties.get_value(property)\n return @env_properties.get_value(property)\n end\n ... | [
"0.69360006",
"0.6776098",
"0.675788",
"0.6733413",
"0.6686744",
"0.6662315",
"0.66568536",
"0.6504543",
"0.64941776",
"0.64657277",
"0.6423776",
"0.6418536",
"0.640316",
"0.6397828",
"0.6364443",
"0.63341135",
"0.63312095",
"0.63224614",
"0.6202996",
"0.6200379",
"0.6166773"... | 0.0 | -1 |
Sets the from property value. The from property | def from=(value)
@from = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from(val = nil)\n self.from = val if val\n @from\n end",
"def from(value)\n @from = value\n @options[:from] = value\n self\n end",
"def from=(val)\n @from = val ? Number.new(val, vanity: true) : nil\n end",
"def from=(from)\n write_attr :from, from\n end",
... | [
"0.74252534",
"0.734053",
"0.7271644",
"0.7140039",
"0.7095981",
"0.7080337",
"0.68769306",
"0.6429729",
"0.63151515",
"0.6152368",
"0.60757756",
"0.6034785",
"0.585997",
"0.5854877",
"0.576354",
"0.57218987",
"0.57218987",
"0.57218987",
"0.57218987",
"0.57218987",
"0.5663588... | 0.7613539 | 1 |
The deserialization information for the current model | def get_field_deserializers()
return super.merge({
"attachments" => lambda {|n| @attachments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Attachment.create_from_discriminator_value(pn) }) },
"body" => lambda {|n| @body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },
"conversationId" => lambda {|n| @conversation_id = n.get_string_value() },
"conversationThreadId" => lambda {|n| @conversation_thread_id = n.get_string_value() },
"extensions" => lambda {|n| @extensions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Extension.create_from_discriminator_value(pn) }) },
"from" => lambda {|n| @from = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },
"hasAttachments" => lambda {|n| @has_attachments = n.get_boolean_value() },
"inReplyTo" => lambda {|n| @in_reply_to = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Post.create_from_discriminator_value(pn) }) },
"multiValueExtendedProperties" => lambda {|n| @multi_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MultiValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },
"newParticipants" => lambda {|n| @new_participants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },
"receivedDateTime" => lambda {|n| @received_date_time = n.get_date_time_value() },
"sender" => lambda {|n| @sender = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },
"singleValueExtendedProperties" => lambda {|n| @single_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SingleValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },
})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },... | [
"0.6510734",
"0.63224316",
"0.6322254",
"0.63094735",
"0.62954384",
"0.6238735",
"0.6232461",
"0.62155676",
"0.6200175",
"0.6199403",
"0.6173917",
"0.61733985",
"0.61705345",
"0.61631054",
"0.61620396",
"0.6158031",
"0.6156071",
"0.6142402",
"0.613998",
"0.6138061",
"0.612005... | 0.0 | -1 |
Gets the hasAttachments property value. Indicates whether the post has at least one attachment. This is a default property. | def has_attachments
return @has_attachments
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attachments?\n !attachments.empty?\n end",
"def has_attachments=(value)\n @has_attachments = value\n end",
"def has_attachments=(value)\n @has_attachments = value\n end",
"def has_attachments=(value)\n @has_attachments = value\n ... | [
"0.7489739",
"0.74411935",
"0.74411935",
"0.74411935",
"0.74411935",
"0.74204534",
"0.7360084",
"0.73251975",
"0.73251975",
"0.7294886",
"0.7228975",
"0.70737815",
"0.69212735",
"0.686036",
"0.6769941",
"0.65512073",
"0.6496719",
"0.64298147",
"0.63883096",
"0.6359371",
"0.61... | 0.80477417 | 3 |
Sets the hasAttachments property value. Indicates whether the post has at least one attachment. This is a default property. | def has_attachments=(value)
@has_attachments = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_attachments\n return @has_attachments\n end",
"def has_attachments\n return @has_attachments\n end",
"def has_attachments\n return @has_attachments\n end",
"def has_attachments\n return @has_attachments\n ... | [
"0.6699245",
"0.6699245",
"0.6699245",
"0.6699245",
"0.6426565",
"0.63194615",
"0.62844735",
"0.622033",
"0.622033",
"0.622033",
"0.61577463",
"0.61577463",
"0.6126364",
"0.6028388",
"0.5874492",
"0.5825956",
"0.5799817",
"0.57327735",
"0.5727103",
"0.5637154",
"0.5509644",
... | 0.78124654 | 3 |
Gets the inReplyTo property value. Readonly. Supports $expand. | def in_reply_to
return @in_reply_to
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_reply_to\n headers['In-Reply-To']\n end",
"def reply_to\n address_list_fetch('reply-to')\n end",
"def in_reply_to=(value)\n @in_reply_to = value\n end",
"def get_reply_to\n @reply_to\n end",
"def set_InReplyTo(value)\n set_input(\"InReplyTo\", value... | [
"0.69207305",
"0.6692837",
"0.6652508",
"0.6604852",
"0.6496073",
"0.63015074",
"0.62397194",
"0.6159394",
"0.60975665",
"0.59925383",
"0.5813927",
"0.5728539",
"0.56737214",
"0.560972",
"0.55890465",
"0.55890465",
"0.55776894",
"0.5448267",
"0.5428158",
"0.539586",
"0.537027... | 0.72811353 | 0 |
Sets the inReplyTo property value. Readonly. Supports $expand. | def in_reply_to=(value)
@in_reply_to = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_InReplyTo(value)\n set_input(\"InReplyTo\", value)\n end",
"def reply_to=(value)\n @reply_to = value\n end",
"def reply_to=( val )\n header[:reply_to] = val\n end",
"def reply_to=(address)\n address = Qpid::Messaging::Address.new \"#{address}\"... | [
"0.8516198",
"0.70250094",
"0.6587329",
"0.6471791",
"0.6452012",
"0.6220507",
"0.6202828",
"0.6160427",
"0.61155653",
"0.60962045",
"0.60667175",
"0.5961754",
"0.5927536",
"0.586672",
"0.58318466",
"0.582511",
"0.5732018",
"0.5682525",
"0.56577617",
"0.56074256",
"0.5570272"... | 0.8018943 | 1 |
Gets the multiValueExtendedProperties property value. The collection of multivalue extended properties defined for the post. Readonly. Nullable. | def multi_value_extended_properties
return @multi_value_extended_properties
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def multi_value_extended_properties=(value)\n @multi_value_extended_properties = value\n end",
"def multi_value_extended_properties=(value)\n @multi_value_extended_properties = value\n end",
"def multi_value_extended_properties=(value)\n @multi... | [
"0.7393384",
"0.7393384",
"0.7393384",
"0.7101371",
"0.7101371",
"0.7101371",
"0.63477707",
"0.63477707",
"0.63477707",
"0.541738",
"0.5293812",
"0.50841457",
"0.50493103",
"0.4986824",
"0.49632427",
"0.4952229",
"0.48423252",
"0.4840834",
"0.47651646",
"0.47634137",
"0.47548... | 0.80404097 | 2 |
Sets the multiValueExtendedProperties property value. The collection of multivalue extended properties defined for the post. Readonly. Nullable. | def multi_value_extended_properties=(value)
@multi_value_extended_properties = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def single_value_extended_properties=(value)\n @single_value_extended_properties = value\n end",
"def single_value_extended_properties=(value)\n @single_value_extended_properties = value\n end",
"def single_value_extended_properties=(value)\n @... | [
"0.69510794",
"0.69510794",
"0.69510794",
"0.5983602",
"0.5983602",
"0.5983602",
"0.5511717",
"0.53901494",
"0.49919668",
"0.49919668",
"0.49919668",
"0.495143",
"0.49347976",
"0.483236",
"0.4754334",
"0.4748352",
"0.4748352",
"0.4748352",
"0.47416958",
"0.47303638",
"0.46471... | 0.81445426 | 2 |
Gets the newParticipants property value. Conversation participants that were added to the thread as part of this post. | def new_participants
return @new_participants
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_participants=(value)\n @new_participants = value\n end",
"def participants_added # :nodoc:\n @properties[ADDED].map { |id| @context.users[id] }\n end",
"def getParticipants\r\n\t\t\t\t\treturn @participants\r\n\t\t\t\tend",
"def participants=(new_participants... | [
"0.7143321",
"0.6168938",
"0.60920346",
"0.6035905",
"0.5810662",
"0.5810662",
"0.5790408",
"0.57590985",
"0.57590985",
"0.5481565",
"0.5471669",
"0.53882396",
"0.5254906",
"0.5252629",
"0.5200686",
"0.5183107",
"0.5143379",
"0.50829077",
"0.5081971",
"0.50524557",
"0.5052455... | 0.7551031 | 0 |
Sets the newParticipants property value. Conversation participants that were added to the thread as part of this post. | def new_participants=(value)
@new_participants = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def participants=(new_participants)\n @participants = new_participants\n self.participant_ids = new_participants.collect(&:id)\n end",
"def setParticipants(participants)\r\n\t\t\t\t\t@participants = participants\r\n\t\t\t\tend",
"def participants=(value)\n @participants = value\n ... | [
"0.7037466",
"0.6376834",
"0.6308306",
"0.6308306",
"0.6022701",
"0.5907998",
"0.57874614",
"0.55644",
"0.534605",
"0.521189",
"0.5210973",
"0.51620924",
"0.51449126",
"0.50891286",
"0.5083837",
"0.5056697",
"0.5046132",
"0.5006741",
"0.5006741",
"0.5006741",
"0.5006741",
"... | 0.7493142 | 0 |
Gets the receivedDateTime property value. Specifies when the post was received. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z | def received_date_time
return @received_date_time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def received_at\n params['_raw_orderCreatedDatetime']\n end",
"def message_received_date_time\n return @message_received_date_time\n end",
"def received_at\n request_datetime\n end",
"def received_at\n Time.parse(params['created']) if params[... | [
"0.7229156",
"0.69821215",
"0.6949472",
"0.68040156",
"0.6638946",
"0.6619124",
"0.651624",
"0.646386",
"0.6388152",
"0.6388152",
"0.6385655",
"0.6303818",
"0.6279794",
"0.6250664",
"0.62407196",
"0.6234332",
"0.620122",
"0.6158274",
"0.61064506",
"0.607306",
"0.60000485",
... | 0.74083483 | 1 |
Sets the receivedDateTime property value. Specifies when the post was received. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z | def received_date_time=(value)
@received_date_time = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def message_received_date_time=(value)\n @message_received_date_time = value\n end",
"def received_at\n params['_raw_orderCreatedDatetime']\n end",
"def received_at\n Time.parse(params['created']) if params['created']\n end",
"def received_date_time\n... | [
"0.6847314",
"0.6300801",
"0.6121688",
"0.6041164",
"0.6041164",
"0.6032692",
"0.5979375",
"0.59409666",
"0.5921429",
"0.5868537",
"0.58281744",
"0.5805354",
"0.5766811",
"0.5714113",
"0.5668339",
"0.5626505",
"0.559062",
"0.5590175",
"0.55610156",
"0.5471812",
"0.5467572",
... | 0.71871555 | 1 |
Gets the sender property value. Contains the address of the sender. The value of Sender is assumed to be the address of the authenticated user in the case when Sender is not specified. This is a default property. | def sender
return @sender
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sender_address\n @sender_address || ''\n end",
"def sender(sender_id)\n if sender = User.find(sender_id)\n address = default_sender_address\n address.display_name = sender.name\n address.format\n end\n end",
"def sender\n begin\n User.cached_find(self.sender_id)\n r... | [
"0.7677934",
"0.764343",
"0.75346863",
"0.74634045",
"0.7427191",
"0.73489726",
"0.7190978",
"0.7184124",
"0.71835005",
"0.7183047",
"0.7051706",
"0.68450606",
"0.6840625",
"0.6823984",
"0.6823034",
"0.6823034",
"0.6792492",
"0.6655992",
"0.65891725",
"0.65613836",
"0.6526046... | 0.70061344 | 12 |
Sets the sender property value. Contains the address of the sender. The value of Sender is assumed to be the address of the authenticated user in the case when Sender is not specified. This is a default property. | def sender=(value)
@sender = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sender=(sender)\n @sender = ensure_type(Sender, sender)\n end",
"def sender=(sender)\n @sender = ensure_type(Sender, sender)\n end",
"def from=(address)\n self.sender = address\n end",
"def sender=(hostname)\n @message[:sender] = hostname\n end",
"def sender(sender_id)\n ... | [
"0.81107867",
"0.81107867",
"0.76451635",
"0.7347496",
"0.7240935",
"0.72400665",
"0.7126398",
"0.7087838",
"0.70114356",
"0.68866825",
"0.67442554",
"0.6702892",
"0.66146463",
"0.64597374",
"0.6443462",
"0.6348953",
"0.62901735",
"0.6285501",
"0.62735003",
"0.6270729",
"0.62... | 0.78481275 | 3 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
super
writer.write_collection_of_object_values("attachments", @attachments)
writer.write_object_value("body", @body)
writer.write_string_value("conversationId", @conversation_id)
writer.write_string_value("conversationThreadId", @conversation_thread_id)
writer.write_collection_of_object_values("extensions", @extensions)
writer.write_object_value("from", @from)
writer.write_boolean_value("hasAttachments", @has_attachments)
writer.write_object_value("inReplyTo", @in_reply_to)
writer.write_collection_of_object_values("multiValueExtendedProperties", @multi_value_extended_properties)
writer.write_collection_of_object_values("newParticipants", @new_participants)
writer.write_date_time_value("receivedDateTime", @received_date_time)
writer.write_object_value("sender", @sender)
writer.write_collection_of_object_values("singleValueExtendedProperties", @single_value_extended_properties)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
... | [
"0.79519033",
"0.76465106",
"0.75808734",
"0.75808734",
"0.7441225",
"0.7209669",
"0.7209669",
"0.720668",
"0.701747",
"0.7002693",
"0.69936407",
"0.6983181",
"0.6972398",
"0.69675887",
"0.69675887",
"0.6942931",
"0.69420123",
"0.6935524",
"0.69145155",
"0.6891068",
"0.688034... | 0.0 | -1 |
Gets the singleValueExtendedProperties property value. The collection of singlevalue extended properties defined for the post. Readonly. Nullable. | def single_value_extended_properties
return @single_value_extended_properties
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def single_value_extended_properties=(value)\n @single_value_extended_properties = value\n end",
"def single_value_extended_properties=(value)\n @single_value_extended_properties = value\n end",
"def single_value_extended_properties=(value)\n @... | [
"0.7429581",
"0.7429581",
"0.7429581",
"0.73794264",
"0.73794264",
"0.73794264",
"0.64755225",
"0.64755225",
"0.64755225",
"0.5374968",
"0.5173842",
"0.5150889",
"0.5003208",
"0.50031954",
"0.49146128",
"0.4742407",
"0.47397512",
"0.4735001",
"0.4692821",
"0.46807307",
"0.468... | 0.81328946 | 2 |
Sets the singleValueExtendedProperties property value. The collection of singlevalue extended properties defined for the post. Readonly. Nullable. | def single_value_extended_properties=(value)
@single_value_extended_properties = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def multi_value_extended_properties=(value)\n @multi_value_extended_properties = value\n end",
"def multi_value_extended_properties=(value)\n @multi_value_extended_properties = value\n end",
"def multi_value_extended_properties=(value)\n @multi... | [
"0.71901274",
"0.71901274",
"0.71901274",
"0.62671053",
"0.62671053",
"0.62671053",
"0.5506882",
"0.5506882",
"0.5506882",
"0.5151416",
"0.4680786",
"0.45876145",
"0.43944556",
"0.4372095",
"0.43574515",
"0.4357376",
"0.4357376",
"0.43562883",
"0.43423206",
"0.42975816",
"0.4... | 0.81243765 | 2 |
End of SE Segment Details Start of N3_PR Segment Details | def payer_address_two(*options)
@payer.address_two.to_s.strip.upcase
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_line\n attributes.fetch(:endLine)\n end",
"def segments; end",
"def segment_0; segments[0]; end",
"def street_segments\r\n\t\tstart_street_segments + end_street_segments\r\n\tend",
"def output_ris_end\n \"\"\n end",
"def nontrivial_end_line\n if successor\n ... | [
"0.5763126",
"0.57605004",
"0.5734976",
"0.55284214",
"0.55141",
"0.5512948",
"0.54200757",
"0.5416026",
"0.54143846",
"0.54108256",
"0.5408269",
"0.5403333",
"0.533853",
"0.5336713",
"0.5336219",
"0.53338856",
"0.5271985",
"0.52717525",
"0.52717525",
"0.5256794",
"0.525457",... | 0.0 | -1 |
End of N3_PR Segment Details Start of TRN Segment Details | def originating_company_id_trace(*options)
'1000000009'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_line\n attributes.fetch(:endLine)\n end",
"def nontrivial_end_line\n if successor\n successor.line_numbers.begin - 1\n else\n @document.last_non_empty_line\n end\n end",
"def start_line_number; end",
"def start_line_number; end",
"def multi_end2(ttls)... | [
"0.57012254",
"0.5604279",
"0.54739887",
"0.54739887",
"0.5416935",
"0.5403451",
"0.5363855",
"0.5349448",
"0.5348509",
"0.5344419",
"0.53170377",
"0.5304454",
"0.5300531",
"0.5280336",
"0.5280336",
"0.5271441",
"0.5263564",
"0.52548236",
"0.5251289",
"0.52215534",
"0.5198501... | 0.0 | -1 |
End of TRN Segment Details Start of BPR Segment Details | def payment_format(*options)
@is_ach_payment ? 'CCP' : ''
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_line\n attributes.fetch(:endLine)\n end",
"def nontrivial_end_line\n if successor\n successor.line_numbers.begin - 1\n else\n @document.last_non_empty_line\n end\n end",
"def end\n attributes.fetch(:end)\n end",
"def stop\n return... | [
"0.61290276",
"0.58103645",
"0.58057463",
"0.5569222",
"0.55574316",
"0.55574316",
"0.55082184",
"0.54987603",
"0.54856926",
"0.5480722",
"0.5480722",
"0.5470453",
"0.5470246",
"0.54409635",
"0.5424857",
"0.5401535",
"0.5392369",
"0.53892976",
"0.5373312",
"0.5363859",
"0.536... | 0.0 | -1 |
End of BPR Segment Details Start of REF_F8 Segment Details | def original_reference_number(*options)
get_eob_image.try(:original_file_name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def b_offset\n @last_4[1].to_i\n end",
"def end_footnote\n @mode = @mode.split('|').last\n end",
"def pos_fseg_header\n pos_index_header + size_index_header\n end",
"def frtrefheader(io)\n result = frtheader(io.read(4)) # rt, grbitFrt\n result[:ref8] = ref8u(io.read(8)) # ref8 (... | [
"0.5860463",
"0.575525",
"0.5515742",
"0.55073863",
"0.5480592",
"0.5452496",
"0.5342762",
"0.53357714",
"0.5328968",
"0.5327417",
"0.52869266",
"0.52869266",
"0.52869266",
"0.52869266",
"0.5276431",
"0.5270954",
"0.52605766",
"0.52424914",
"0.523367",
"0.52047014",
"0.519582... | 0.0 | -1 |
End of REF_F8 Segment Details Start of CLP Segment Details | def claim_payment_amount(*options)
@eob.amount('total_amount_paid_for_claim')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ld_hl_sp_plusr8\n end",
"def end_footnote\n @mode = @mode.split('|').last\n end",
"def pos_fseg_header\n pos_index_header + size_index_header\n end",
"def cp_hl\n end",
"def b_offset\n @last_4[1].to_i\n end",
"def show_section_h_offset\n\t\t\tputs \" Start of sectio... | [
"0.5818006",
"0.5657622",
"0.5643015",
"0.54958326",
"0.54188406",
"0.54075307",
"0.537706",
"0.53250694",
"0.53011256",
"0.52572614",
"0.5251237",
"0.5222466",
"0.5220437",
"0.52007854",
"0.51944447",
"0.51516056",
"0.5142462",
"0.51390076",
"0.5134795",
"0.5127802",
"0.5111... | 0.0 | -1 |
End of CLP Segment Details Start of NM1_82 Segment Details | def rendering_provider_name_suffix(*options)
blank_segment
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def coding_region_cdna_end\n answer = 0\n \n self.exons.each do |exon|\n if exon == self.translation.end_exon\n answer += self.translation.seq_end\n return answer\n else\n answer += exon.length\n end\n end\n end",
"def e... | [
"0.58320814",
"0.5785247",
"0.57065535",
"0.5654377",
"0.562356",
"0.559991",
"0.5580909",
"0.5546707",
"0.5503432",
"0.5459237",
"0.54423064",
"0.54423064",
"0.54371065",
"0.5424614",
"0.5419647",
"0.5414141",
"0.5395217",
"0.5395217",
"0.53616524",
"0.53274345",
"0.5325603"... | 0.0 | -1 |
End of NM1_82 Segment Details Start of DTM_232 Segment Details | def claim_statement_period_start(*options)
claim_start_date = @classified_eob.get_date_for_netwrx(:start_date, @claim)
return nil if claim_start_date.nil?
return claim_start_date if @classified_eob.is_claim_eob? && claim_start_date.eql?('00000000')
claim_start_date if can_print_service_date(claim_start_date)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def segment_0; segments[0]; end",
"def street_segments\r\n\t\tstart_street_segments + end_street_segments\r\n\tend",
"def coding_region_cdna_end\n answer = 0\n \n self.exons.each do |exon|\n if exon == self.translation.end_exon\n answer += self.translation.seq_end\n ... | [
"0.5543945",
"0.5540212",
"0.5531124",
"0.54698503",
"0.5462701",
"0.54379207",
"0.541752",
"0.5398819",
"0.5388276",
"0.5382018",
"0.53728616",
"0.5352744",
"0.53500956",
"0.5344256",
"0.5343119",
"0.53359777",
"0.5304033",
"0.52917093",
"0.52869225",
"0.5284558",
"0.5271343... | 0.0 | -1 |
End of DTM_232 Segment Details Start of DTM_233 Segment Details | def claim_statement_period_end(*options)
claim_start_date = @classified_eob.get_date_for_netwrx(:end_date, @claim)
return nil if claim_start_date.nil?
return claim_start_date if @classified_eob.is_claim_eob? && claim_start_date.eql?('00000000')
claim_start_date if can_print_service_date(claim_start_date)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def street_segments\r\n\t\tstart_street_segments + end_street_segments\r\n\tend",
"def read_end_stops()\n execute_command('F81', false, @status_debug_msg)\n end",
"def segment_0; segments[0]; end",
"def findEndBuffer\n offset = @file_size - 4\n while EVENTRECORDLENGTH.decode(read_buffer(offset, 4, ... | [
"0.5510913",
"0.5483743",
"0.5474959",
"0.54597807",
"0.5455413",
"0.5451109",
"0.5449231",
"0.54243255",
"0.54228336",
"0.5385733",
"0.5356914",
"0.53561366",
"0.5348496",
"0.53478235",
"0.5344739",
"0.53081435",
"0.5260658",
"0.5235439",
"0.52218175",
"0.52101743",
"0.52024... | 0.0 | -1 |
End of DTM_233 Segment Details Client Specific Helper Methods End of Client Specific Helper Methods Conditions to print a Segment : Overwritten Methods | def verify_ts3_condition
Unified835Output::BenignNull.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_of_section\n\t$report_file.puts(\"-------END OF SECTION-------\")\n\t$report_file.puts\nend",
"def end_section\n end",
"def end; end",
"def end; end",
"def end; end",
"def end\n end",
"def end\n end",
"def end\n end",
"def end\n end",
"def Com6 # Recuperation Info\n \n ... | [
"0.6391423",
"0.63385576",
"0.60705686",
"0.60705686",
"0.60705686",
"0.5980476",
"0.5980476",
"0.5969855",
"0.5968507",
"0.5950886",
"0.57932425",
"0.57872635",
"0.5742891",
"0.5705",
"0.5704522",
"0.5666644",
"0.56256664",
"0.56256664",
"0.56157744",
"0.5559606",
"0.5487116... | 0.0 | -1 |
Config pagination header manually | def set_pagination_header(name, options = {})
scope = instance_variable_get("@#{name}")
request_params = request.query_parameters
url_without_params = request.original_url.slice(0..(request.original_url.index("?")-1)) unless request_params.empty?
url_without_params ||= request.original_url
page = {}
page[:first] = 1 if scope.total_pages > 1 && !scope.first_page?
page[:last] = scope.total_pages if scope.total_pages > 1 && !scope.last_page?
page[:next] = scope.current_page + 1 unless scope.last_page?
page[:prev] = scope.current_page - 1 unless scope.first_page?
pagination_links = []
page.each do |k, v|
new_request_hash= request_params.merge({ page: v })
pagination_links << "<#{url_without_params}?#{new_request_hash.to_param}>; rel=\"#{k}\""
end
headers['Link'] = pagination_links.join(', ')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_pagination_header(resource,resource_name)\n #print current page\n headers[\"x-page\"] = page\n #print records per page\n headers[\"x-per-page\"] = per_page\n #print total records\n headers[\"x-total\"] = resource.total_count\n #print next page url\n headers[\"next_page\"] = eval \"a... | [
"0.754653",
"0.74930876",
"0.6708229",
"0.6503024",
"0.6232348",
"0.6212366",
"0.62021303",
"0.6172817",
"0.6148266",
"0.61431813",
"0.61431813",
"0.6095978",
"0.6084311",
"0.6083161",
"0.59970886",
"0.5986855",
"0.59765905",
"0.5972433",
"0.5948929",
"0.5921677",
"0.5903181"... | 0.7530348 | 1 |
Store user in session to simulate logging in | def login(user)
request.session[:uid] = user.id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_log_in(user)\n session[:user_id] = user.id\n end",
"def log_in(user)\n session[:user_id] = user.id\n end",
"def log_in(user)\n session[:user_id] = user.id\n end",
"def log_in(user)\n session[:user_id] = user.id\n end",
"def log_in(user)\n session[:user_id] = user.id\n end... | [
"0.79796517",
"0.7946116",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7914858",
"0.7907733",
"0.7877703",
"0.7869816",
"0.78360236",
"0.7821741",
... | 0.75240034 | 58 |
sha1_file.c unpack_object_header_buffer unpackobjects.c unpack_one | def parse_type_and_size
hdr = byte
hdr_size = 1
continue = (hdr & 0b10000000)
type = (hdr & 0b01110000) >> 4
size = (hdr & 0b00001111)
size_len = 4
while continue != 0
hdr = byte
hdr_size += 1
continue = (hdr & 0b10000000)
size += (hdr & 0b01111111) << size_len
size_len += 7
end
return [type, size, hdr_size]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unpack(data); end",
"def unpack(binary)\n end",
"def unpack_header(header)\n # fixed fields\n self.version = header.slice!(0)\n self.type = header.slice!(0)\n self.seq_no = header.slice!(0)\n self.flags = header.slice!(0)\n self.session_id = header.slice!(0..3)... | [
"0.5682494",
"0.56126815",
"0.5607991",
"0.5605144",
"0.54417396",
"0.539379",
"0.5384476",
"0.53790593",
"0.53275424",
"0.52762884",
"0.5268248",
"0.5265314",
"0.5241195",
"0.52087337",
"0.5157022",
"0.5052081",
"0.5038033",
"0.5030748",
"0.5024052",
"0.49997893",
"0.4999789... | 0.0 | -1 |
sha1_file.c get_delta_base unpackobjects.c unpack_delta_entry | def parse_delta_offset
offset = -1
hdr_size = 0
begin
hdr = byte
hdr_size += 1
continue = hdr & 0b10000000
low_offset = hdr & 0b01111111
offset = ((offset + 1) << 7) | low_offset
end while continue != 0
return [offset, hdr_size]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_delta_entry(entry)\n path = entry[0]\n metadata = entry[1]\n photo = dropbox_event.dropbox_photos.find_by_path(path)\n if !metadata\n Rails.logger.debug(\"Destroying photo with path #{path}\")\n photo.destroy if photo.present?\n elsif /\\.((jpg)|(jpeg)|(png))$/ =~ path\n c... | [
"0.552862",
"0.5391449",
"0.5317819",
"0.5299938",
"0.526601",
"0.52436566",
"0.5187634",
"0.5091055",
"0.50745004",
"0.5057651",
"0.5035649",
"0.50208414",
"0.5008146",
"0.49874026",
"0.49746084",
"0.49548158",
"0.49505496",
"0.4945198",
"0.49419287",
"0.493956",
"0.493956",... | 0.45495617 | 81 |
GET /character/geo_positions/1 GET /character/geo_positions/1.json | def show
@character_geo_position = Character::GeoPosition.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @character_geo_position }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @character_geo_position = Character::GeoPosition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @character_geo_position }\n end\n end",
"def index\n @positions = Position.all.order :id\n @geojson = Hash.new\n\n @points = Position.ge... | [
"0.65410924",
"0.63755864",
"0.61864567",
"0.60786736",
"0.6040894",
"0.60065997",
"0.59626114",
"0.5901784",
"0.5868109",
"0.5863196",
"0.576979",
"0.57410073",
"0.5722417",
"0.5721037",
"0.5698015",
"0.56925607",
"0.5685136",
"0.568214",
"0.568214",
"0.568214",
"0.568214",
... | 0.7293571 | 0 |
GET /character/geo_positions/new GET /character/geo_positions/new.json | def new
@character_geo_position = Character::GeoPosition.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @character_geo_position }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @character_geo_position = Character::GeoPosition.new(params[:character_geo_position])\n\n respond_to do |format|\n if @character_geo_position.save\n format.html { redirect_to @character_geo_position, notice: 'Geo position was successfully created.' }\n format.json { render jso... | [
"0.7227565",
"0.707564",
"0.707564",
"0.707564",
"0.68282133",
"0.66331935",
"0.6611183",
"0.65948105",
"0.6525071",
"0.64507747",
"0.6448005",
"0.63941914",
"0.6375476",
"0.63684785",
"0.6366236",
"0.63476855",
"0.6338557",
"0.6329629",
"0.62621737",
"0.6220882",
"0.6209307"... | 0.76666987 | 0 |
POST /character/geo_positions POST /character/geo_positions.json | def create
@character_geo_position = Character::GeoPosition.new(params[:character_geo_position])
respond_to do |format|
if @character_geo_position.save
format.html { redirect_to @character_geo_position, notice: 'Geo position was successfully created.' }
format.json { render json: @character_geo_position, status: :created, location: @character_geo_position }
else
format.html { render action: "new" }
format.json { render json: @character_geo_position.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def correct_geo_coords\n coords = params.seek :geo, :geojson, :geometry, :coordinates\n if coords\n array = GeosHelper.geo_coords_to_array(coords)\n params[:geo][:geojson][:geometry][:coordinates] = array\n end\n end",
"def map_coordinates\n loc = find_or_create_geolocation(params)\n ... | [
"0.60359406",
"0.602981",
"0.5953773",
"0.5920963",
"0.5917561",
"0.5895335",
"0.5880196",
"0.5863509",
"0.5862524",
"0.5862524",
"0.5851815",
"0.58228683",
"0.581096",
"0.5748399",
"0.57393765",
"0.573566",
"0.5720172",
"0.5692822",
"0.5682632",
"0.56799394",
"0.5667723",
... | 0.73566043 | 0 |
PUT /character/geo_positions/1 PUT /character/geo_positions/1.json | def update
@character_geo_position = Character::GeoPosition.find(params[:id])
respond_to do |format|
if @character_geo_position.update_attributes(params[:character_geo_position])
format.html { redirect_to @character_geo_position, notice: 'Geo position was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
format.json { render json: @character_geo_position.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @character_geo_position = Character::GeoPosition.new(params[:character_geo_position])\n\n respond_to do |format|\n if @character_geo_position.save\n format.html { redirect_to @character_geo_position, notice: 'Geo position was successfully created.' }\n format.json { render jso... | [
"0.6205665",
"0.6190675",
"0.6161236",
"0.600425",
"0.5979568",
"0.59693027",
"0.59693027",
"0.59693027",
"0.5958358",
"0.5930068",
"0.59215546",
"0.5919159",
"0.5916072",
"0.5859566",
"0.58403295",
"0.5826592",
"0.5757375",
"0.575664",
"0.5751904",
"0.56965977",
"0.56790584"... | 0.72673297 | 0 |
DELETE /character/geo_positions/1 DELETE /character/geo_positions/1.json | def destroy
@character_geo_position = Character::GeoPosition.find(params[:id])
@character_geo_position.destroy
respond_to do |format|
format.html { redirect_to character_geo_positions_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @geo.destroy\n respond_to do |format|\n format.html { redirect_to geos_url, notice: 'Geo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post_geo = current_user.post_geos.find(params[:id])\n @post_geo.destroy\n\n respond_t... | [
"0.7031428",
"0.6983041",
"0.68709964",
"0.6789183",
"0.67276955",
"0.6675587",
"0.6669673",
"0.66657853",
"0.66563004",
"0.665613",
"0.66424036",
"0.6629626",
"0.6615284",
"0.66061103",
"0.65896654",
"0.6583766",
"0.65780336",
"0.65647817",
"0.6558075",
"0.6550642",
"0.65506... | 0.77763456 | 0 |
engine registry is a simple hash | def register hash
hash.each_pair do |name, engine_class|
raise "Class must implement the CanTango::Engine API." unless self.class.valid_engine?(engine_class)
raise "Name of engine must be a String or Symbol" if !name.kind_of_label?
registered[name.to_s] = ability_engine(engine_class)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def registry\n @registry ||= {}\n end",
"def registry; end",
"def registry; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"de... | [
"0.68308985",
"0.68308985",
"0.68308985",
"0.68308985",
"0.68308985",
"0.68308985",
"0.68308985",
"0.67354125",
"0.6539229",
"0.6539229",
"0.64283586",
"0.64283586",
"0.64283586",
"0.64283586",
"0.64283586",
"0.64283586",
"0.64283586",
"0.64283586",
"0.64283586",
"0.64283586",
... | 0.6171483 | 29 |
Callbacks Constants Methods Default | def to_s
name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def callbacks; end",
"def callbacks; end",
"def callback\n\n end",
"def callback\n end",
"def callback\n\tend",
"def callback=(_arg0); end",
"def callback_type; end",
"def callbacks\n @callbacks ||= {}\n end",
"def definecallback(&b)\r\n\t\t\t@callback = b\r\n\t\tend",
"def callback(&... | [
"0.79225594",
"0.79225594",
"0.72916436",
"0.72867084",
"0.7238036",
"0.72067416",
"0.698272",
"0.6414605",
"0.63994104",
"0.62620276",
"0.6211972",
"0.6207387",
"0.61792666",
"0.6110566",
"0.61039805",
"0.61039805",
"0.6072172",
"0.6072172",
"0.60457146",
"0.60457146",
"0.60... | 0.0 | -1 |
Write a method reverse_words that takes in a sentence string and returns the sentence with the order of the characters in each word reversed. Note that we need to reverse the order of characters in the words, do not reverse the order of words in the sentence. | def reverse_words(sentence)
new_sentence = []
sentence.split(" ").each do |word|
rev_word = ""
word.each_char {|char| rev_word = char + rev_word }
new_sentence << rev_word
end
new_sentence.join(" ")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reverse_words sentence\n sentence.split(\" \").map{ |x| x.reverse }.join(\" \")\nend",
"def reverse_words(sentence)\n\tsentence.split.map! { |word| word.reverse }.join(\" \")\nend",
"def reverse_words(sentence)\n\twords = sentence.split(' ')\n\twords.each do |word|\n\t\tword.reverse!\n\tend\n\treversed_se... | [
"0.84299076",
"0.841687",
"0.83713937",
"0.83434224",
"0.832155",
"0.8298649",
"0.82913035",
"0.82836974",
"0.8276433",
"0.8265693",
"0.82495147",
"0.8248501",
"0.8248501",
"0.82393116",
"0.82341933",
"0.8226766",
"0.8226766",
"0.8226766",
"0.8226766",
"0.8208294",
"0.8206099... | 0.80678165 | 41 |
Return command line arguments | def cli_arguments
%W(
--fail-fast
) + strategy.spec_files(mutation.subject)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arguments\n @args ||= {}\n unless @args.size > 0\n ARGV.each_with_index do |arg, index|\n if arg.start_with?('-')\n if index + 1 < ARGV.size\n next_arg = ARGV[index + 1]\n if next_arg.start_with?('-') then\n @args.update(argument_pre... | [
"0.731129",
"0.72981286",
"0.7187144",
"0.71825874",
"0.71825874",
"0.71825874",
"0.71825874",
"0.71825874",
"0.71825874",
"0.71825874",
"0.71793294",
"0.71138155",
"0.7080656",
"0.7080656",
"0.70412344",
"0.7027032",
"0.7008863",
"0.6998146",
"0.6962612",
"0.6871486",
"0.684... | 0.0 | -1 |
We are going to avoid indexing of README.md when there is also an index.md in the same directory, to keep behavior consistent with the display logic | def skip_index?(file)
if file.end_with? 'README.md'
dir = File.dirname file
File.exist? "#{dir}/index.md"
else
false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def buildReadMeIndex\n x = 0\n fileOutArr = Array.new\n\n # Build each Fn Command Card\n fileOutArr.push \"# Fn Command Reference\\n\\n\"\n @cmdListArr.each do |command|\n # Start markdown file\n fileOutArr.push \"[\" + command + \"](\" + @fileNameArr[x] + \... | [
"0.70091426",
"0.68860865",
"0.66454583",
"0.6599822",
"0.6556787",
"0.6556787",
"0.6556787",
"0.6525539",
"0.6373534",
"0.6365624",
"0.6364324",
"0.63603204",
"0.63311034",
"0.6317537",
"0.6239274",
"0.61938655",
"0.61938655",
"0.6176773",
"0.61716115",
"0.61703575",
"0.6159... | 0.7049303 | 0 |
This is poormans markdown strip. Convert to HTML, strip tags and return plain text suitable to act as the content for the search index. | def searchable_content(file)
content = File.read file
content = CommonMarker.render_html content
content.remove(/<\/?[^>]*>/).gsub("\n", " ")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plain_text(text)\n strip_tags(markdown.render(text.to_s)).strip\n end",
"def markdown(text)\n sanitize(BlueCloth::new(text).to_html)\n end",
"def markdown(text)\n sanitize BlueCloth::new(text).to_html\n end",
"def process_markdown\n self.data = self.class.convert_markdown(self.data)\n s... | [
"0.74352145",
"0.68507135",
"0.68481845",
"0.6817936",
"0.677911",
"0.67780447",
"0.6670449",
"0.6661747",
"0.6655667",
"0.6638147",
"0.66181946",
"0.6597262",
"0.6528594",
"0.6495768",
"0.6495768",
"0.6495768",
"0.6469273",
"0.64557076",
"0.644955",
"0.6448245",
"0.64395905"... | 0.0 | -1 |
must follow any before filters | def parse_values_from_ui
unless self.period_value.blank? and self.period_units.blank?
p = self.period_value.to_i
self.period = p.send(self.period_units).to_i
end
unless self.breach_duration_value.blank? and self.breach_duration_units.blank?
p = self.breach_duration_value.to_i
self.breach_duration = p.send(self.breach_duration_units).to_i
end
unless self.lower_breach_scale_increment_action.blank? and self.lower_breach_scale_increment_value.blank? and self.lower_breach_scale_increment_units.blank?
self.lower_breach_scale_increment = ''
self.lower_breach_scale_increment = '-' if self.lower_breach_scale_increment_action == 'decrease'
self.lower_breach_scale_increment += self.lower_breach_scale_increment_value.to_s
self.lower_breach_scale_increment += '%' if self.lower_breach_scale_increment_units == '%'
end
unless self.upper_breach_scale_increment_action.blank? and self.upper_breach_scale_increment_value.blank? and self.upper_breach_scale_increment_units.blank?
self.upper_breach_scale_increment = ''
self.upper_breach_scale_increment = '-' if self.upper_breach_scale_increment_action == 'decrease'
self.upper_breach_scale_increment += self.upper_breach_scale_increment_value.to_s
self.upper_breach_scale_increment += '%' if self.upper_breach_scale_increment_units == '%'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def before(&b)\n filter :before, &b\n end",
"def before filter\n @station.before filter\n end",
"def before(*args, &block)\n add_filter :before, &(args.empty? ? block : construct_filter(*args, &block))\n end",
"def before; end",
"def before &block\n @before_blocks ||= [... | [
"0.7641463",
"0.6953068",
"0.6872635",
"0.65766823",
"0.6538966",
"0.65335405",
"0.6519498",
"0.65084827",
"0.6483308",
"0.6453054",
"0.64445287",
"0.6424519",
"0.6411271",
"0.64094234",
"0.63996077",
"0.63953644",
"0.63746446",
"0.6333937",
"0.6311281",
"0.6302508",
"0.62487... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def item_params
params.require(:item).permit(:name, :price, :quantity, :description, :image, :tag_list)
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.6981273",
"0.6783789",
"0.67460483",
"0.6742222",
"0.67354137",
"0.65934366",
"0.65028495",
"0.6497783",
"0.64826745",
"0.6479415",
"0.6456823",
"0.6440081",
"0.63800216",
"0.6376521",
"0.636652",
"0.6319898",
"0.6300256",
"0.62994003",
"0.6293621",
"0.6292629",
"0.6291586... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_store
if !params[:store_id].nil?
@store = Store.find(params[:store_id])
else
@store = @item.store
end
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 |
Use callbacks to share common setup or constraints between actions. | def set_item
if !params[:item_id].nil?
@item = Item.find(params[:item_id])
else
@item = Item.find(params[:id])
end
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 |
ensure that there are no line items referencing this product | def ensure_not_referenced_by_any_line_item
if line_items.empty?
return true
else
errors.add(:base, 'Line Items present')
return false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ensure_not_referenced_by_any_line_item\n\t\t\tunless line_items.empty?\n\t\t\t\terrors.add(:base, 'Line items reference this product')\n\t\t\t\tthrow :abort\n\t\t\tend\n\t\tend",
"def ensure_not_referenced_by_any_line_item_product\n unless line_item_products.empty?\n errors.add(:base, 'Line Items Pro... | [
"0.8736616",
"0.853958",
"0.8289557",
"0.8246923",
"0.82232034",
"0.82068616",
"0.8206619",
"0.81594956",
"0.81327915",
"0.8104883",
"0.81018025",
"0.80855167",
"0.8076766",
"0.8076766",
"0.80568",
"0.8037973",
"0.8020351",
"0.8020351",
"0.8020351",
"0.80173016",
"0.8011286",... | 0.78552985 | 91 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.