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 |
|---|---|---|---|---|---|---|
retrieve the font size from the options hash for a cluster labels file | def coordinate_labels_font_size
if self.options[:font_size].blank?
10
else
self.options[:font_size]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def font_size\n size_tag = @styles.xpath('//w:docDefaults//w:rPrDefault//w:rPr//w:sz').first\n size_tag ? size_tag.attributes['val'].value.to_i / 2 : nil\n end",
"def font_size\n return nil unless @styles\n\n size_tag = @styles.xpath('//w:docDefaults//w:rPrDefault//w:rPr//w:sz').first\n ... | [
"0.74190974",
"0.73396415",
"0.7314836",
"0.7204597",
"0.715149",
"0.703122",
"0.6990144",
"0.6990144",
"0.68657684",
"0.6741478",
"0.6645941",
"0.6638075",
"0.6544334",
"0.6537782",
"0.64950943",
"0.6457983",
"0.6425493",
"0.62576836",
"0.6215513",
"0.6193634",
"0.6166036",
... | 0.73618764 | 1 |
retrieve the font color from the options hash for a cluster labels file | def coordinate_labels_font_color
if self.options[:font_color].blank?
'#333333'
else
self.options[:font_color]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def color_text\n @attributes[:color_text]\n end",
"def color\n @color ||= COLORS[label.length%COLORS.length].to_sym\n end",
"def font_color()\n validate_worksheet\n if @workbook.fonts[font_id()][:font][:color].nil?\n '000000' #black\n else\n @workbook.fonts[font_id(... | [
"0.64091957",
"0.6378907",
"0.6312512",
"0.62464577",
"0.623406",
"0.60951436",
"0.60669243",
"0.6063546",
"0.602486",
"0.5959452",
"0.5957207",
"0.59312934",
"0.58998066",
"0.5838549",
"0.58186525",
"0.58009166",
"0.5800043",
"0.5753012",
"0.5732467",
"0.57233185",
"0.571245... | 0.7188441 | 0 |
determine a file's content type by reading the first 2 bytes and comparing to known magic numbers | def determine_content_type
location = File.join(self.study.data_store_path, self.download_location)
signature = File.open(location).read(2)
if signature == StudyFile::GZIP_MAGIC_NUMBER
'application/gzip'
else
'text/plain'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _extract_mime_type_with_filemagic(io)\n filemagic = FileMagic.new(FileMagic::MAGIC_MIME_TYPE)\n data = io.read(MAGIC_NUMBER); io.rewind\n filemagic.buffer(data)\n end",
"def extract_content_type(new_file)\n content_type = nil\n\n File.open(new_file.path) do |fd... | [
"0.7641062",
"0.7448318",
"0.7409246",
"0.73327357",
"0.7222804",
"0.7199239",
"0.71945286",
"0.71200633",
"0.71172106",
"0.70046383",
"0.6989799",
"0.6965961",
"0.6918752",
"0.690463",
"0.68976897",
"0.6868769",
"0.68181187",
"0.6791473",
"0.6779104",
"0.67707795",
"0.672536... | 0.69200206 | 12 |
CACHING METHODS helper method to invalidate any matching frontend caches when parsing/deleting a study_file | def invalidate_cache_by_file_type
cache_key = self.cache_removal_key
unless cache_key.nil?
# clear matching caches in background
CacheRemovalJob.new(cache_key).delay.perform
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cache_removal_key\n study_name = self.study.url_safe_name\n case self.file_type\n when 'Cluster'\n name_key = self.cluster_groups.first.name.split.join('-')\n @cache_key = \"#{study_name}.*render_cluster.*#{name_key}\"\n when 'Coordinate Labels'\n name_key = self.coordinate... | [
"0.75605685",
"0.729459",
"0.729459",
"0.6986781",
"0.6787982",
"0.6690548",
"0.66776204",
"0.65831316",
"0.65681607",
"0.6549927",
"0.64537144",
"0.64438623",
"0.6429861",
"0.6347924",
"0.63321084",
"0.6324414",
"0.63216025",
"0.63197964",
"0.62895274",
"0.6285645",
"0.62665... | 0.64473945 | 11 |
helper method to return cache removal key based on file type (this is refactored out for use in tests) | def cache_removal_key
study_name = self.study.url_safe_name
case self.file_type
when 'Cluster'
name_key = self.cluster_groups.first.name.split.join('-')
@cache_key = "#{study_name}.*render_cluster.*#{name_key}"
when 'Coordinate Labels'
name_key = self.coordinate_labels_target... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invalidate_cache_by_file_type\n cache_key = self.cache_removal_key\n unless cache_key.nil?\n # clear matching caches in background\n CacheRemovalJob.new(cache_key).delay.perform\n end\n end",
"def get_filename(key)\n\thash = hash(key)\n\n\tif File.exist?(File.join(@cache_dir, hash))\n\t ... | [
"0.65641433",
"0.6198728",
"0.61698425",
"0.6164549",
"0.5902778",
"0.588842",
"0.58814806",
"0.5877777",
"0.5805626",
"0.5805062",
"0.5782132",
"0.5767274",
"0.57486695",
"0.57378954",
"0.57215726",
"0.56884664",
"0.5660078",
"0.5611548",
"0.55937964",
"0.5587273",
"0.556963... | 0.74887186 | 0 |
remove a local copy on the file system if a parse fails | def remove_local_copy
Dir.chdir(self.study.data_store_path)
if File.exists?(self.download_location)
File.delete(self.download_location)
subdir = self.remote_location.blank? ? self.id : self.remote_location.split('/').first
if Dir.exist?(subdir) && Dir.entries(subdir).delete_if {|e| e.start_wit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_local_file\n File.delete(@file_path) if File.exist? @file_path\n end",
"def clean_up\n pathname.delete if pathname.exist?\n end",
"def clean_test_case\n if File.exists?(@local_file_download_destination)\n File.delete(@local_file_download_destination)\n end\n end",
"def c... | [
"0.7078629",
"0.6957252",
"0.6450083",
"0.6417578",
"0.62650424",
"0.6263082",
"0.61341417",
"0.6123204",
"0.6101164",
"0.60953504",
"0.60953504",
"0.60756993",
"0.6027718",
"0.60224587",
"0.60125136",
"0.599523",
"0.59889334",
"0.5961605",
"0.593622",
"0.5929544",
"0.5849191... | 0.641868 | 3 |
CUSTOM VALIDATIONS & CALLBACKS strip whitespace from name if the file is a cluster or gene list (will cause problems when rendering) | def sanitize_name
if ['Gene List', 'Cluster'].include?(self.file_type)
self.name.strip!
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sanitize_file_name_as_name\n sanitized_name_array = name.split('.')\n sanitized_name_array.pop if sanitized_name_array.length > 1\n self.name = sanitized_name_array.join('.').tr('-_', ' ').split.map(&:capitalize)*' '\n end",
"def name_valid_format\n if name.present? and not name.match(/[\\w]+([\... | [
"0.6315623",
"0.6200248",
"0.6199221",
"0.61764413",
"0.6167214",
"0.6163021",
"0.6142419",
"0.6141979",
"0.6141783",
"0.61064136",
"0.60767156",
"0.60737664",
"0.5958417",
"0.59495676",
"0.5941656",
"0.5912952",
"0.58819705",
"0.58749366",
"0.58687085",
"0.5858656",
"0.58502... | 0.79053783 | 0 |
set filename and construct url safe name from study | def set_file_name_and_data_dir
if self.upload_file_name.nil?
self.status = 'uploaded'
if self.name.nil?
self.name = ''
end
elsif (self.name.nil? || self.name.blank?) || (!self.new_record? && self.upload_file_name != self.name)
self.name = self.upload_file_name
end
self.da... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def file_name\n # file = full_name\n # file = file.gsub('::', '/')\n # file = file.gsub('#' , '/')\n # file = file.gsub('.' , '-')\n # #file = File.join(output, file + '.html')\n # file\n WebRI.entry_to_path(full_name)\n end",
"def filename\n if original_filename.present?\n ... | [
"0.6969394",
"0.69468665",
"0.6892968",
"0.687904",
"0.6868049",
"0.67227674",
"0.6718253",
"0.67123204",
"0.6592359",
"0.65917265",
"0.6587474",
"0.6569451",
"0.65668064",
"0.6550986",
"0.65505546",
"0.65423447",
"0.652489",
"0.65204877",
"0.6515992",
"0.64964277",
"0.648581... | 0.0 | -1 |
set ranges for cluster_groups if necessary | def set_cluster_group_ranges
if self.file_type == 'Cluster' && self.cluster_groups.any?
cluster = self.cluster_groups.first
# check if range values are present and set accordingly
if !self.x_axis_min.nil? && !self.x_axis_max.nil? && !self.y_axis_min.nil? && !self.y_axis_max.nil?
domain_ran... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_all_ranges\n if self.file_type == 'Cluster'\n required_vals = 4\n domain = {\n x_axis_min: self.x_axis_min.to_i == 0 ? nil : self.x_axis_min.to_i,\n x_axis_max: self.x_axis_max.to_i == 0 ? nil : self.x_axis_max.to_i,\n y_axis_min: self.y_axis_min.to_i == 0 ? nil ... | [
"0.7284334",
"0.62827903",
"0.62348294",
"0.5871909",
"0.5841381",
"0.5757659",
"0.56151915",
"0.5544197",
"0.54821914",
"0.5467405",
"0.54571843",
"0.5440195",
"0.54297006",
"0.5423253",
"0.54163074",
"0.53505003",
"0.53408486",
"0.53375304",
"0.53180873",
"0.5311491",
"0.53... | 0.8351703 | 0 |
return information in response email | def get_order_information_from_csc
{
id: csc_order_number_txt.text,
prod_detail: csc_prod_detail_tbl.text,
shipping_detail: csc_shipping_detail_tbl.text,
billing_detail: csc_billing_detail_tbl.text,
subject: csc_subject_order_txt.text
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def response(email)\n @greeting = \"Hi\"\n\n mail(to:email, subject:\"You received a payment\")\n end",
"def email_body\n sponsor_name = @config.plan.sponsor_name\n message = 'Hi there!'\\\n '<br />'\\\n '<br />'\\\n \"#{sponsor_name} has run their payroll. Please download the relevan... | [
"0.71539646",
"0.6951516",
"0.6895929",
"0.68889403",
"0.68282354",
"0.6817157",
"0.68021053",
"0.6797529",
"0.67622346",
"0.67147225",
"0.6686663",
"0.6683884",
"0.66830325",
"0.66357714",
"0.66185576",
"0.6613329",
"0.6586991",
"0.65011084",
"0.6461235",
"0.64482653",
"0.64... | 0.0 | -1 |
define the arguments that the user will input | def arguments(model)
args = OpenStudio::Ruleset::OSArgumentVector.new
#make a start date argument
start_date = OpenStudio::Ruleset::OSArgument::makeStringArgument("start_date",true)
start_date.setDisplayName("Start date")
args << start_date
#make an end date argument
end_date = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arguments; end",
"def arguments; end",
"def arguments; end",
"def arguments\n \"\"\n end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end... | [
"0.73748195",
"0.73748195",
"0.73748195",
"0.7087363",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
"0.7008232",
... | 0.6167057 | 66 |
end the arguments method define what happens when the measure is run | def run(model, runner, user_arguments)
super(model, runner, user_arguments)
#use the built-in error checking
if not runner.validateUserArguments(arguments(model), user_arguments)
return false
end
#assign the user inputs to variables
start_date = runner.getStringArgumentValue("start_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def measure=(_arg0); end",
"def measure(*args, &b)\n end",
"def measure; end",
"def communicate_measure_result(_ = nil, _ = nil); end",
"def communicate_measure_result(_ = nil, _ = nil); end",
"def arguments; end",
"def arguments; end",
"def arguments; end",
"def run(model, runner, user_argument... | [
"0.7515346",
"0.6953783",
"0.6926668",
"0.62934387",
"0.62934387",
"0.6224306",
"0.6224306",
"0.6224306",
"0.6148769",
"0.6120832",
"0.6115748",
"0.60427964",
"0.5981118",
"0.59800285",
"0.59734416",
"0.5967499",
"0.5963045",
"0.5957965",
"0.5948404",
"0.59070843",
"0.5907084... | 0.0 | -1 |
I worked on this challenge [by myself, with: ]. myself Your Solution Below | def get_grade(avg)
if avg <= 100 and avg > 89
return "A"
elsif avg < 90 and avg > 79
return "B"
elsif avg < 80 and avg > 69
return "C"
elsif avg < 70 and avg > 59
return "D"
else avg < 60 and avg > 0
return "F"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solution4(input)\n end",
"def isLucky(n)\r\nhalf1 = []\r\nhalf2 = []\r\nn_string = n.to_s\r\n\r\n\r\nfirsthalf = (n_string.length / 2) - 1\r\nsecondhalfstart = (n_string.length / 2)\r\nsecondhalfend = (n_string.length - 1)\r\n(0..firsthalf).each do |idx|\r\n half1 << n_string[idx].to_i\r\nend\r\n\r\n(sec... | [
"0.62465304",
"0.60775834",
"0.5944991",
"0.5923835",
"0.59035957",
"0.58349985",
"0.5831979",
"0.5823577",
"0.5816454",
"0.581468",
"0.5800374",
"0.58000517",
"0.5760254",
"0.5754721",
"0.57498497",
"0.5739808",
"0.573251",
"0.5723238",
"0.5722115",
"0.5718797",
"0.57175094"... | 0.0 | -1 |
params can be an array or a hash | def remove_params(params)
self.tap do |u|
u.query_values = (u.query_values || {}).tap do |qv|
params.each do |key, value|
qv.delete key
end
end
if u.query_values.empty?
u.query_values = nil
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _parse_params(params)\n\n if params.is_a? Hash\n return_value = {}\n params.each do |key, value|\n return_value[key] = self._parse_params(value)\n end\n elsif params.is_a? Array\n return_value = []\n params.each_index {|i|\n retur... | [
"0.7006391",
"0.69073254",
"0.682576",
"0.6813587",
"0.6813587",
"0.6799796",
"0.6651957",
"0.6637866",
"0.66060287",
"0.6588309",
"0.6585264",
"0.6585264",
"0.6585264",
"0.6585264",
"0.6585264",
"0.6585264",
"0.6585264",
"0.6585264",
"0.6585264",
"0.6585264",
"0.6585264",
... | 0.0 | -1 |
Returns the tail of the array | def tail(input)
input[1..-1]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tail\n \t@array[-1]\n end",
"def tail\n @values[1..-1]\n end",
"def last(array)\n array[-1]\nend",
"def last_of(array)\n return array[array.length - 1]\nend",
"def last_of(array)\n return array[array.length - 1]\nend",
"def tail\n return @tail\n end",
"def last\n @tail\n end",... | [
"0.9125246",
"0.83899504",
"0.7743386",
"0.7741904",
"0.7741904",
"0.7732762",
"0.7721429",
"0.7703555",
"0.76818407",
"0.7658934",
"0.76509386",
"0.7627034",
"0.7596011",
"0.75914484",
"0.75675035",
"0.75616664",
"0.7545397",
"0.7540025",
"0.7522507",
"0.75167626",
"0.750280... | 0.7686904 | 8 |
Takes at most max elements from array | def take(input, max)
if input!= nil and max > 0
input[0..(max - 1)]
else
[]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_max array_of_elements\n\ti = 0\n\tlargest = array_of_elements[0]\n\twhile i < array_of_elements.length do\n\t\tif array_of_elements[i] > largest\n\t\t\tlargest = array_of_elements[i]\n\t\tend\n\t\ti += 1\n\tend\n\tlargest\nend",
"def clever_octopus(array)\n max = nil\n array.each_with_index do |el, i|\... | [
"0.74364775",
"0.73660207",
"0.73040736",
"0.7198238",
"0.71331537",
"0.703159",
"0.70275223",
"0.7011268",
"0.69926417",
"0.69625336",
"0.69118977",
"0.686034",
"0.6860029",
"0.683649",
"0.68355525",
"0.6821296",
"0.68193203",
"0.6817708",
"0.67867345",
"0.6762502",
"0.67310... | 0.0 | -1 |
Sorts array of objects by surname, requires field name that contains the full name | def sort_by_surname(input, fullname_field)
input.sort_by { |i| i[fullname_field].downcase.split(/ /)[1] }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sort_name\n n = \"#{self.last_name}, #{self.first_name}\"\n if self.middle_name.present?\n n += \" #{self.middle_name}\"\n end\n n\n end",
"def alphabetical_list(students)\n sorted_array = students.sort_by {|person| person[:last_name].downcase}\n sorted_array.each do |student|\n # puts \... | [
"0.66753185",
"0.6357483",
"0.62607414",
"0.6160155",
"0.6155201",
"0.6126934",
"0.6094962",
"0.6083574",
"0.60094684",
"0.5922443",
"0.5892196",
"0.5880997",
"0.5869726",
"0.58553743",
"0.5843282",
"0.5843282",
"0.5827995",
"0.58241946",
"0.5767376",
"0.5752961",
"0.57524896... | 0.8261374 | 1 |
Converts an integer to a string containing commas every three digits. Optionally supports a delimiter override for commas. | def intcomma(value, delimiter=".")
begin
orig = value.to_s
delimiter = delimiter.to_s
rescue Exception => e
puts "#{e.class} #{e}"
return value
end
copy = orig.gsub(/(\d)(?=(\d{3})+(?!\d))/, "\\1#{delimiter}")
orig == copy ? copy : intcomma(copy, deli... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commatize(number, delimiter = ',')\n number.to_s.reverse.gsub(%r{([0-9]{3}(?=([0-9])))}, \"\\\\1#{delimiter}\").reverse\n end",
"def number_with_delimiter(n, delim = ',')\n n.to_i.to_s.reverse.chars.each_slice(3).map(&:join).join(delim).reverse\n end",
"def seperator(num)\n num_string = num.to... | [
"0.76924616",
"0.76066166",
"0.7532681",
"0.74958616",
"0.74553925",
"0.7416228",
"0.7387747",
"0.7387747",
"0.726586",
"0.72619426",
"0.7254914",
"0.7236767",
"0.7215942",
"0.72134566",
"0.7184965",
"0.7184757",
"0.7180158",
"0.7160204",
"0.7155401",
"0.7150601",
"0.7148708"... | 0.68494403 | 61 |
Initialize a mandate resource instance | def initialize(object, response = nil)
@object = object
@authorisation_source = object['authorisation_source']
@consent_parameters = object['consent_parameters']
@created_at = object['created_at']
@id = object['id']
@links = object['links']
@metadata = object['me... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(resource)\n @resource = resource\n end",
"def initialize(resource)\n @resource = resource\n end",
"def initialize(resource)\n @resource = resource\n end",
"def initialize(resource:, authorisation_server:)\n @resource = resource\n @authorisation_server = authorisat... | [
"0.6887757",
"0.68159807",
"0.6780746",
"0.63577473",
"0.6330142",
"0.63289046",
"0.6267616",
"0.6218962",
"0.6037115",
"0.60356826",
"0.6017445",
"0.59600204",
"0.59508735",
"0.59406805",
"0.59265584",
"0.5886026",
"0.5841821",
"0.5814259",
"0.5806718",
"0.58023983",
"0.5801... | 0.0 | -1 |
Return the links that the resource has | def links
@mandate_links ||= Links.new(@links)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def links\n return @links\n end",
"def links\n return @links\n end",
"def links\n return @links\n end",
"def links()\n return @links\n end",
"def links\n @data[\"_links\"]\n end",
"def links\n response = Clever... | [
"0.80605316",
"0.80605316",
"0.80605316",
"0.7979162",
"0.7794723",
"0.77008724",
"0.7686157",
"0.7679065",
"0.7679065",
"0.7669786",
"0.76474917",
"0.7639643",
"0.7639643",
"0.7639643",
"0.76383716",
"0.76383716",
"0.7587679",
"0.75305825",
"0.75129217",
"0.73835135",
"0.735... | 0.7086784 | 30 |
Provides the mandate resource as a hash of all its readable attributes | def to_h
@object
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n @attrs\n end",
"def resource_attributes\n %w(\n auth_users\n comment\n dont_compress\n exclude\n exclude_from\n fake_super\n gid\n hosts_allow\n hosts_deny\n include\n include_from\n ... | [
"0.6632965",
"0.6553031",
"0.6519547",
"0.64894676",
"0.64620084",
"0.6458304",
"0.6366858",
"0.635252",
"0.6339681",
"0.6339681",
"0.6339681",
"0.62199104",
"0.6148225",
"0.614745",
"0.6139752",
"0.60975975",
"0.6093799",
"0.60336107",
"0.60097975",
"0.6009661",
"0.59963626"... | 0.0 | -1 |
Currently supports name, url, personality, and species. | def find_by(**args)
matches = list.select do |_key, hash|
args.each_pair.map { |k, v| hash[k].casecmp?(v) }.all?
end
return [] if matches.empty?
matches.map { |_key, hash| hash[:name] }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name\n self.species\n end",
"def species; end",
"def name\n description\n end",
"def name\n description\n end",
"def say_name_and_species\n puts \"#{name} is a #{self.class.species}\"\n end",
"def species\n return \"human\"\n end",
"def identify\n 'name'\n end",
"d... | [
"0.67184544",
"0.6369873",
"0.62502533",
"0.62502533",
"0.61896044",
"0.6181042",
"0.6064394",
"0.6064394",
"0.6064394",
"0.6064394",
"0.60512435",
"0.6050748",
"0.603765",
"0.6029474",
"0.60185456",
"0.6003327",
"0.6003327",
"0.6003327",
"0.6003327",
"0.6003327",
"0.6003327"... | 0.0 | -1 |
Further Exploration Modify this method so the caller can request that the first character be downcased rather than upcased? If the first character is downcased, then the second character should be upcased, and so on. Hint: Use a keyword argument. Initial Solution | def staggered_case(string)
staggered = []
string.chars.each_with_index do |char, index|
if index.odd?
staggered << char.downcase
else
staggered << char.upcase
end
end
staggered.join
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def downcase(input); end",
"def downcase() end",
"def downcase!() end",
"def downcase; end",
"def upcase(input); end",
"def upcase() end",
"def upcase!() end",
"def upcase; end",
"def swapcase() end",
"def swapcase!() end",
"def downer1(string)\n string.downcase\nend",
"def translate_char(ch... | [
"0.82889307",
"0.8286312",
"0.8191804",
"0.81651366",
"0.8131284",
"0.8117315",
"0.80645144",
"0.79435277",
"0.7707899",
"0.76987225",
"0.7589754",
"0.7573735",
"0.75343746",
"0.748205",
"0.7446703",
"0.74409693",
"0.7394964",
"0.7386674",
"0.7383994",
"0.73708963",
"0.735704... | 0.0 | -1 |
GET /posts GET /posts.json | def index
@posts = Post.all.order(created_at: :desc)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"def index\n @posts = Post.all\n render json: @posts\n end",
"def index\n @posts = Post.all\n\n render json: @posts\n end",
"def index\n @posts = Post.all\n\n render json: @posts\n end",
"def index\n ... | [
"0.78659517",
"0.74962544",
"0.7495792",
"0.7495792",
"0.74899817",
"0.743243",
"0.7287362",
"0.7287362",
"0.7287362",
"0.725721",
"0.7253427",
"0.7248423",
"0.7247239",
"0.7223018",
"0.7205441",
"0.7204395",
"0.71704173",
"0.7169458",
"0.7165757",
"0.71213764",
"0.7116395",
... | 0.0 | -1 |
GET /posts/1 GET /posts/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"def show\n render json: Post.find(params[\"id\"])\n end",
"def show\r\n post = Post.find(params[:id])\r\n render json: post\r\n end",
"def show\n @post = Post.find(params[:id])\n\n render json: @post\n end",
... | [
"0.77110183",
"0.73537844",
"0.73433185",
"0.73379177",
"0.73228735",
"0.7293139",
"0.7275997",
"0.7256934",
"0.7161576",
"0.7158913",
"0.71552676",
"0.71552676",
"0.7119547",
"0.7094749",
"0.7094749",
"0.7094749",
"0.70943594",
"0.7071599",
"0.70607626",
"0.70452625",
"0.703... | 0.0 | -1 |
POST /posts POST /posts.json | def create
@post = Post.new(post_params)
if @post.save
@post.category_ids = params["post"][:category_ids]
@post.tag_ids = params["post"][:tag_ids]
redirect_to [:admin, @post], notice: 'Post has been successfully created.'
else
flash.now[:alert] = 'Post creation failed.'
render ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n render json: Post.create(params[\"post\"])\n end",
"def create\n respond_with Post.create(params[:posts])\n end",
"def create\n @post = Post.create(post_params)\n render json: @post, serializer: PostSerializer\n end",
"def create\n @post = Post.new(post_params)\n @po... | [
"0.74463975",
"0.73221767",
"0.73072433",
"0.7123966",
"0.7015686",
"0.701327",
"0.69841874",
"0.6939327",
"0.69313824",
"0.69053805",
"0.68196476",
"0.6812792",
"0.6793222",
"0.6792862",
"0.6779654",
"0.6779654",
"0.67625546",
"0.67602354",
"0.67515427",
"0.6735786",
"0.6698... | 0.0 | -1 |
PATCH/PUT /posts/1 PATCH/PUT /posts/1.json | def update
if @post.update(post_params)
@post.category_ids = params["post"][:category_ids]
@post.tag_ids = params["post"][:tag_ids]
redirect_to [:admin, @post], notice: 'Post has been successfully updated.'
else
flash.now[:alert] = 'Post update failed.'
render :edit
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end",
"def update\n respond_with Post.update(params[:id], params[:posts])\n end",
"def update\n @post = Post.find(params[:id])\n respond_to do |format|\n if @post.update_attributes(params[:post])\n forma... | [
"0.7186348",
"0.70419043",
"0.67732435",
"0.67665803",
"0.6669072",
"0.66479206",
"0.65784687",
"0.65560424",
"0.6550196",
"0.65497214",
"0.65348804",
"0.65306944",
"0.64987326",
"0.6496231",
"0.6467487",
"0.6430537",
"0.64281607",
"0.64265805",
"0.6426157",
"0.6418946",
"0.6... | 0.0 | -1 |
DELETE /posts/1 DELETE /posts/1.json | def destroy
@post.destroy
if @post.destroyed?
@post.categories.clear
@post.tags.clear
@post.comments.clear
redirect_to admin_posts_url, notice: 'Post was successfully destroyed.'
else
flash.now[:alert] = 'Post has not been destroyed.'
redirect_to admin_posts_url
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n post = Post.find(params[:id])\n if post.destroy\n render json: {status: \"success\", data: {id: param... | [
"0.8047287",
"0.7690689",
"0.7584699",
"0.758098",
"0.75686055",
"0.75052667",
"0.7503448",
"0.74758047",
"0.7468409",
"0.7466228",
"0.74649256",
"0.7460206",
"0.7460206",
"0.7460206",
"0.7460206",
"0.74587125",
"0.74587125",
"0.74587125",
"0.74587125",
"0.74587125",
"0.74587... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_post
@post = Post.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 |
I worked on this challenge [by myself, with: ]. myself Your Solution Below | def do_something(a, b , c)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solution4(input)\n end",
"def isLucky(n)\r\nhalf1 = []\r\nhalf2 = []\r\nn_string = n.to_s\r\n\r\n\r\nfirsthalf = (n_string.length / 2) - 1\r\nsecondhalfstart = (n_string.length / 2)\r\nsecondhalfend = (n_string.length - 1)\r\n(0..firsthalf).each do |idx|\r\n half1 << n_string[idx].to_i\r\nend\r\n\r\n(sec... | [
"0.62465304",
"0.60775834",
"0.5944991",
"0.5923835",
"0.59035957",
"0.58349985",
"0.5831979",
"0.5823577",
"0.5816454",
"0.581468",
"0.5800374",
"0.58000517",
"0.5760254",
"0.5754721",
"0.57498497",
"0.5739808",
"0.573251",
"0.5723238",
"0.5722115",
"0.5718797",
"0.57175094"... | 0.0 | -1 |
int64 History Export ID | def id
@attributes[:id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def numId\n id.to_s.slice(-9,9).hex.to_i\n end",
"def ref_id\n 300_000_000 + data[0].to_i\n end",
"def export_id\n if members.empty?\n nil\n else\n members.first.external_id\n end\n end",
"def hex_trace_id\n trace_id.unpack1('H*')\n ... | [
"0.6141722",
"0.6029602",
"0.5953884",
"0.5952135",
"0.59071785",
"0.5813181",
"0.578654",
"0.5767741",
"0.5747938",
"0.57268894",
"0.5709565",
"0.5700431",
"0.5700431",
"0.5682196",
"0.56573534",
"0.56524396",
"0.56524396",
"0.5646999",
"0.56406236",
"0.55992734",
"0.5586536... | 0.0 | -1 |
datetime Start date/time of export range. | def start_at
@attributes[:start_at]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_datetime\n d = date\n t = start_time || Time.new.midnight\n DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec)\n end",
"def start_time\n dtstart.to_datetime\n end",
"def start_date_time\n return @start_date_time\n end",
... | [
"0.7160854",
"0.71453273",
"0.68475777",
"0.6841517",
"0.68063617",
"0.6803775",
"0.6803775",
"0.6803775",
"0.6803775",
"0.6803775",
"0.6803775",
"0.6803775",
"0.6803775",
"0.6803775",
"0.6803775",
"0.6705303",
"0.66394114",
"0.66106576",
"0.6609672",
"0.66006434",
"0.6595773... | 0.0 | -1 |
datetime End date/time of export range. | def end_at
@attributes[:end_at]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_date_time\n return @end_date_time\n end",
"def end_date_time\n return @end_date_time\n end",
"def end_date_time\n return @end_date_time\n end",
"def end_date_time\n return @end_date_ti... | [
"0.74193645",
"0.735885",
"0.735885",
"0.735885",
"0.735885",
"0.735885",
"0.735885",
"0.735885",
"0.717076",
"0.702121",
"0.7018554",
"0.6995131",
"0.69699484",
"0.69699484",
"0.69699484",
"0.69699484",
"0.69699484",
"0.69699484",
"0.69684154",
"0.69074845",
"0.688138",
"0... | 0.6132254 | 52 |
string Status of export. Will be: `building` or `ready` | def status
@attributes[:status]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status\n\t\treturn \"Pending\" if !completed\n\t\t\"Completed\"\n\tend",
"def status_text\n return 'Unknown' if state.blank?\n\n return I18n.t(\"activerecord.attributes.export_job.status.#{state}\") unless in_progress?\n\n I18n.t('activerecord.attributes.export_job.status.in_progress') + progress_te... | [
"0.71058124",
"0.70719653",
"0.7069328",
"0.6822807",
"0.6812926",
"0.66996425",
"0.66522443",
"0.66504574",
"0.6633725",
"0.66297966",
"0.65513057",
"0.65186995",
"0.6491829",
"0.64864045",
"0.64766353",
"0.6465858",
"0.6463863",
"0.6432897",
"0.6410454",
"0.6386061",
"0.637... | 0.0 | -1 |
string Filter results by this this action type. Valid values: `create`, `read`, `update`, `destroy`, `move`, `login`, `failedlogin`, `copy`, `user_create`, `user_update`, `user_destroy`, `group_create`, `group_update`, `group_destroy`, `permission_create`, `permission_destroy`, `api_key_create`, `api_key_update`, `api_... | def query_action
@attributes[:query_action]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def typus_actions_for(filter)\n if self.respond_to?(\"admin_actions_for_#{filter}\")\n self.send(\"admin_actions_for_#{filter}\").map { |a| a.to_s }\n else\n Typus::Configuration.config[self.name]['actions'][filter.to_s].split(', ') rescue []\n end\n end",
"def get_action (type)\n... | [
"0.63831794",
"0.6234522",
"0.62214285",
"0.6100267",
"0.60902363",
"0.5961014",
"0.59435725",
"0.5943455",
"0.5931554",
"0.5869923",
"0.5860846",
"0.58464575",
"0.5773341",
"0.573141",
"0.5690745",
"0.5676327",
"0.5663859",
"0.5631192",
"0.56291735",
"0.56195164",
"0.5602630... | 0.0 | -1 |
string Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim` | def query_interface
@attributes[:query_interface]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_string\n\t\treturn self.filter.to_s\n\tend",
"def type\n self.class.name.demodulize.underscore.gsub(/_filter$/, '').to_sym\n end",
"def search_type\n\t\tif is_user_search == \"1\"\n\t\t\treturn \"User Search\"\n\t\telsif is_tag_search == \"1\"\n\t\t\treturn \"Tag Search\"\n\t\tend\n\tend",
... | [
"0.63859826",
"0.63787663",
"0.59233373",
"0.5866931",
"0.5866931",
"0.5838145",
"0.58079565",
"0.5750929",
"0.57439834",
"0.5704885",
"0.5651677",
"0.5585761",
"0.55492747",
"0.54967165",
"0.5485864",
"0.5469005",
"0.5453565",
"0.545",
"0.5449065",
"0.5368577",
"0.53476906",... | 0.0 | -1 |
int64 Return results that are actions performed by the user indiciated by this User ID | def query_user_id
@attributes[:query_user_id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def completed_user_count\n return @completed_user_count\n end",
"def get_UserID()\n \t return @outputs[\"UserID\"]\n \tend",
"def user_count; end",
"def quantify_edits\n\t\t@res.each_with_index do |changeset, index|\n\t\t\tthis_user = changeset['properties']['user']\n\t\t... | [
"0.5587292",
"0.555768",
"0.5546589",
"0.5522316",
"0.5513349",
"0.55112976",
"0.5397105",
"0.53866965",
"0.5373749",
"0.5368884",
"0.53295135",
"0.5308356",
"0.53008854",
"0.5285582",
"0.52781403",
"0.52752006",
"0.52752006",
"0.5240407",
"0.52068025",
"0.5173948",
"0.514341... | 0.49508622 | 60 |
int64 Return results that are file actions related to the file indicated by this File ID | def query_file_id
@attributes[:query_file_id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filestotal\r\n\t\t\t`#{BITS::BITSADMIN} /getfilestotal {#{@id}}`\r\n\t\tend",
"def filestransferred\r\n\t\t\t`#{BITS::BITSADMIN} /getfilestransferred {#{@id}}`\r\n\t\tend",
"def file_stats\n @stats = @ff.get_stats\n end",
"def file_ids(id)\n criteria = {:type_ids => [Runcible::Extensions::... | [
"0.62197953",
"0.60138613",
"0.5759879",
"0.5749416",
"0.57276434",
"0.55370855",
"0.5524695",
"0.55055165",
"0.5490522",
"0.53895116",
"0.53482723",
"0.5343487",
"0.5337004",
"0.53181994",
"0.5317761",
"0.5265421",
"0.5257635",
"0.5251663",
"0.52315724",
"0.52118653",
"0.519... | 0.5629056 | 5 |
int64 Return results that are file actions inside the parent folder specified by this folder ID | def query_parent_id
@attributes[:query_parent_id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def files\n return unless session\n session.files.find_all_by_parent_folder_id(id)\n end",
"def top_level_files\n program_files.where parent_id: 0\n end",
"def find_files\n find_files_recursive(@build_result_dir, '')\n end",
"def results\n # Get folder and file\n @content... | [
"0.6215318",
"0.57685536",
"0.56320757",
"0.55853534",
"0.5547984",
"0.5529693",
"0.55046654",
"0.54878986",
"0.5435741",
"0.5414575",
"0.53922945",
"0.5370459",
"0.53588045",
"0.53416246",
"0.53245085",
"0.53116596",
"0.53065157",
"0.52871513",
"0.52623487",
"0.5232593",
"0.... | 0.0 | -1 |
string Return results that are file actions related to this path. | def query_path
@attributes[:query_path]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def files\n return get_result('files')\n end",
"def filestransferred\r\n\t\t\t`#{BITS::BITSADMIN} /getfilestransferred {#{@id}}`\r\n\t\tend",
"def result_and_file(action)\n result = render_method(action)\n\n if file = action.template\n content = File.read(file)\n e... | [
"0.6195577",
"0.5855223",
"0.582862",
"0.58044666",
"0.57848346",
"0.57766414",
"0.5726663",
"0.57188207",
"0.57129556",
"0.569733",
"0.56820005",
"0.5638689",
"0.56328243",
"0.562446",
"0.5616619",
"0.5604942",
"0.5539938",
"0.5539938",
"0.5526908",
"0.550226",
"0.5501754",
... | 0.0 | -1 |
string Return results that are file actions related to files or folders inside this folder path. | def query_folder
@attributes[:query_folder]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def results\n # Get folder and file\n @content = BrowsingFile.bind_folder params[:fold]\n @file = BrowsingFile.bind_files params[:fold]\n\n if @delete_type == 0 || @delete_type == 1 || @delete_type.nil?\n # Get paths and push to array\n folder_name = File.basename(params[:fold])\n path =... | [
"0.62674737",
"0.59783596",
"0.5964753",
"0.5770458",
"0.57549214",
"0.57389367",
"0.5738558",
"0.5706725",
"0.56760824",
"0.56361616",
"0.5612311",
"0.56046027",
"0.55845565",
"0.5542588",
"0.552143",
"0.55024624",
"0.55024624",
"0.54695916",
"0.5455853",
"0.54449433",
"0.54... | 0.0 | -1 |
string Return results that are file moves originating from this path. | def query_src
@attributes[:query_src]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_source_movs(path)\n files = []\n Find.find(path) do |filename|\n if !FileTest.directory?(filename)\n if filename =~ MOV_PATTERN\n files << Pathname.new(filename)\n end\n end\n end\n\n files.sort\nend",
"def rover_positions_as_string\n @maxX = @file[0]\n @maxY = @file[1]\n... | [
"0.55424535",
"0.54582125",
"0.54040784",
"0.53319144",
"0.52992946",
"0.52430034",
"0.5234982",
"0.52199566",
"0.5207021",
"0.5164886",
"0.51646316",
"0.51545274",
"0.51397115",
"0.5117696",
"0.510505",
"0.5090859",
"0.50817865",
"0.5067065",
"0.5028056",
"0.50171995",
"0.50... | 0.0 | -1 |
string Return results that are file moves with this path as destination. | def query_destination
@attributes[:query_destination]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destination_file_name\n return @destination_file_name\n end",
"def relocate(test_case)\r\n # temp_fix_for_ascii(test_case)\r\n file_name = String(test_case[0][:materials][0]) + \"_\" + String(test_case[0][:lengths][0]) + \"cm*\"\r\n path_or... | [
"0.59974533",
"0.5919399",
"0.5766423",
"0.57014954",
"0.5657929",
"0.557094",
"0.5558463",
"0.55209494",
"0.549703",
"0.54967153",
"0.5485776",
"0.54620594",
"0.5459171",
"0.5445559",
"0.53772455",
"0.5358721",
"0.53561825",
"0.5332375",
"0.5315803",
"0.5315723",
"0.53148997... | 0.0 | -1 |
string Filter results by this IP address. | def query_ip
@attributes[:query_ip]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_string\n\t\treturn self.filter.to_s\n\tend",
"def search_whois\n s = TCPsocket.open(@server.server, 43)\n s.write(\"#{self.ip.to_s}\\n\")\n ret = ''\n while s.gets do ret += $_ end\n s.close\n @all = ret\n end",
"def filter_by_... | [
"0.65881366",
"0.59553444",
"0.58085275",
"0.5806155",
"0.57559127",
"0.56227607",
"0.5616033",
"0.5575312",
"0.55671287",
"0.552622",
"0.5499275",
"0.5497855",
"0.5438175",
"0.53995705",
"0.53405017",
"0.5313207",
"0.5313207",
"0.5313207",
"0.5262822",
"0.5256972",
"0.522949... | 0.57115805 | 5 |
string Filter results by this username. | def query_username
@attributes[:query_username]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def username_with_filter\n\t\treturn @unf\n\tend",
"def user_filter\n username_attribute = options[:ldap][:username_attribute] || default_username_attribute\n\n filter = Net::LDAP::Filter.eq(username_attribute, @username)\n unless @options[:ldap][:filter].blank?\n filter &= Net::LDAP::Filte... | [
"0.7043956",
"0.6773088",
"0.6575555",
"0.6369581",
"0.6004512",
"0.60031885",
"0.59582144",
"0.59342813",
"0.5898985",
"0.58672905",
"0.5832159",
"0.5806493",
"0.5758539",
"0.5720301",
"0.56640625",
"0.5655768",
"0.5629508",
"0.5621622",
"0.5608662",
"0.55633473",
"0.5539353... | 0.6037931 | 4 |
string If searching for Histories about login failures, this parameter restricts results to failures of this specific type. Valid values: `expired_trial`, `account_overdue`, `locked_out`, `ip_mismatch`, `password_mismatch`, `site_mismatch`, `username_not_found`, `none`, `no_ftp_permission`, `no_web_permission`, `no_dir... | def query_failure_type
@attributes[:query_failure_type]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def failure(log_data = nil)\n results false, log_data\n end",
"def failure_type\n @attributes[:failure_type]\n end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; en... | [
"0.59141856",
"0.58339846",
"0.5748541",
"0.5748541",
"0.5748541",
"0.5748541",
"0.5748541",
"0.5748541",
"0.5748541",
"0.571674",
"0.5667907",
"0.5654411",
"0.56492114",
"0.5635974",
"0.56286705",
"0.55460745",
"0.5501074",
"0.5496137",
"0.54293305",
"0.54293305",
"0.5429330... | 0.5858137 | 1 |
int64 If searching for Histories about specific objects (such as Users, or API Keys), this paremeter restricts results to objects that match this ID. | def query_target_id
@attributes[:query_target_id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def throttle_filter_id\n {:id.nin => [id]}\n end",
"def enforce_search_for_show_permissions\n enforce_permissions!(\"show_digital_object\", params[:id])\n end",
"def enforce_search_for_show_permissions\n enforce_permissions!(\"show_digital_object\", params[:id])\n end",
"def f... | [
"0.636116",
"0.58689857",
"0.58689857",
"0.58404016",
"0.5802027",
"0.5554079",
"0.5434222",
"0.53129363",
"0.5305075",
"0.52334976",
"0.52311337",
"0.52310973",
"0.52236444",
"0.51459295",
"0.5091283",
"0.5077947",
"0.50625134",
"0.5053011",
"0.5023589",
"0.5023589",
"0.5020... | 0.0 | -1 |
string If searching for Histories about Users, Groups or other objects with names, this parameter restricts results to objects with this name/username. | def query_target_name
@attributes[:query_target_name]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_username_matches_visualization_owner\n # Support both for username at `/u/username` and subdomain, prioritizing first\n username = [CartoDB.username_from_request(request), CartoDB.subdomain_from_request(request)].compact.first\n # URL must always contain username, either at subdoma... | [
"0.62003666",
"0.60339874",
"0.5942059",
"0.59341425",
"0.5883104",
"0.5680206",
"0.5662058",
"0.5660255",
"0.55330545",
"0.54420125",
"0.54293984",
"0.54127216",
"0.5401626",
"0.5383436",
"0.5378714",
"0.5339569",
"0.5339569",
"0.53300136",
"0.532364",
"0.53155476",
"0.53077... | 0.0 | -1 |
string If searching for Histories about Permisisons, this parameter restricts results to permissions of this level. | def query_target_permission
@attributes[:query_target_permission]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def permissions = {}",
"def permissions_level_description\n \"#{Customer.mentors_Label} in this group can view and edit #{PERMISSION_LEVELS[permissions_level.to_sym]}\"\n end",
"def permissions\n if @prm\n @prm\n else\n @maximum_prms\n end\n end",
"def permissions\n [\"read_permiss... | [
"0.65554184",
"0.6337324",
"0.62927246",
"0.6282862",
"0.6268794",
"0.6211704",
"0.6162643",
"0.60114497",
"0.5995154",
"0.5974176",
"0.5836815",
"0.5814406",
"0.5812655",
"0.5812655",
"0.57968396",
"0.5795006",
"0.5755471",
"0.5753161",
"0.5753161",
"0.5741498",
"0.5724923",... | 0.0 | -1 |
int64 If searching for Histories about API keys, this parameter restricts results to API keys created by/for this user ID. | def query_target_user_id
@attributes[:query_target_user_id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @keys = ApiKey.where(user_id: current_user.id).order(id: :desc).page params[:page] # kaminari\n end",
"def restrict_access\n # check if the request has an API key as part of it...\n end",
"def authorize_api_key\n # If it's blank, send a 403\n if params[:api_key].blank?\n head :fo... | [
"0.60513484",
"0.60299003",
"0.5955008",
"0.5857672",
"0.5792686",
"0.5766151",
"0.56769896",
"0.5672585",
"0.56475794",
"0.56181157",
"0.56098855",
"0.5592251",
"0.5592251",
"0.5532107",
"0.5532107",
"0.5522934",
"0.5498074",
"0.54798967",
"0.5477774",
"0.547538",
"0.5473779... | 0.0 | -1 |
string If searching for Histories about API keys, this parameter restricts results to API keys created by/for this username. | def query_target_username
@attributes[:query_target_username]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api_key\n\t\t\t@username || 'unknown'\n\t\tend",
"def keys_for(username)\n @api.client.users.keys.list(user: username).body\n end",
"def api_keys\n rest_query(:api_key)\n end",
"def restrict_access\n # check if the request has an API key as part of it...\n end",
"def show_api_key\n ... | [
"0.6561815",
"0.634059",
"0.6085517",
"0.59957093",
"0.5861306",
"0.58320224",
"0.58320224",
"0.58314276",
"0.5813088",
"0.573016",
"0.5710577",
"0.5645214",
"0.5632963",
"0.5580187",
"0.55659425",
"0.55659425",
"0.5539051",
"0.5495171",
"0.54937273",
"0.5484354",
"0.54694474... | 0.0 | -1 |
string If searching for Histories about API keys, this parameter restricts results to API keys associated with this platform. | def query_target_platform
@attributes[:query_target_platform]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api_keys\n rest_query(:api_key)\n end",
"def api_keys; rest_query(:api_key); end",
"def api_keys; rest_query(:api_key); end",
"def api_key_param_name\n nil\n end",
"def api_key; end",
"def api_key; end",
"def api_key_field(value = nil)\n rw_config(:api_key_field, ... | [
"0.669468",
"0.6258587",
"0.6258587",
"0.6231595",
"0.6078034",
"0.6078034",
"0.60548913",
"0.60445434",
"0.6024062",
"0.60214925",
"0.6005923",
"0.596818",
"0.59551513",
"0.59484035",
"0.5902243",
"0.5864122",
"0.58416384",
"0.5840312",
"0.5839929",
"0.58080244",
"0.5791378"... | 0.0 | -1 |
string If searching for Histories about API keys, this parameter restricts results to API keys with this permission set. | def query_target_permission_set
@attributes[:query_target_permission_set]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def restrict_access\n # check if the request has an API key as part of it...\n end",
"def api_keys\n rest_query(:api_key)\n end",
"def restrict_access\n authenticate_or_request_with_http_token do |token, options|\n ApiKey.exists?(access_token: token)\n end\n end",
... | [
"0.6503278",
"0.62734526",
"0.61093587",
"0.60827005",
"0.60827005",
"0.6009197",
"0.5995066",
"0.5995066",
"0.5908267",
"0.5838364",
"0.57969046",
"0.5764683",
"0.5762328",
"0.57544994",
"0.5744472",
"0.5671727",
"0.56547683",
"0.56547683",
"0.5631503",
"0.56201494",
"0.5605... | 0.0 | -1 |
int64 User ID. Provide a value of `0` to operate the current session's user. | def user_id
@attributes[:user_id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_id\n unless @user_id.nil? || @user_id == 0\n @user_id\n else\n read_attribute(:user_id) # TODO: Might need to cache result\n end\n end",
"def user_id\n @user_id ||= self.user ? self.user.to_global_id : nil\n end",
"def user_id\n if (id = (@opts[:user_id] || @opts['user_i... | [
"0.776652",
"0.75123686",
"0.73855305",
"0.7251331",
"0.7204862",
"0.71916384",
"0.71916384",
"0.71916384",
"0.71916384",
"0.71916384",
"0.71916384",
"0.71799254",
"0.7057415",
"0.70463544",
"0.7034901",
"0.70043916",
"0.6960425",
"0.6952839",
"0.69376874",
"0.68521243",
"0.6... | 0.6327116 | 72 |
indicate whether the template should be added to the global template namespace | def amd_with_template_namespace
@amd_with_template_namespace || false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def templated?\n !template.nil?\n end",
"def use_template_by_default\n @use_template_by_default || false\n end",
"def templated?\n @templated\n end",
"def template() false end",
"def global_index_namespace?\n false\n end",
"def has_template?(templates, klass, sym)\n ... | [
"0.69472516",
"0.68143374",
"0.6743847",
"0.661908",
"0.62841254",
"0.62427866",
"0.6208969",
"0.61779207",
"0.6131613",
"0.6088328",
"0.6053738",
"0.6047068",
"0.6047068",
"0.60283124",
"0.59799236",
"0.59756094",
"0.59659016",
"0.59652644",
"0.5955169",
"0.59262025",
"0.591... | 0.78511864 | 0 |
path specified by the require.js paths during configuration for the handlebars | def handlebars_amd_path
@handlebars_amd_path || 'handlebars'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handlebars_file\n # don't want to force the user to serve my handlebars.js from sprockets so...\n @handlebars_file ||= File.expand_path('../../../vendor/assets/javascripts/mutton/handlebars.js', __FILE__)\n end",
"def configured_require_paths; end",
"def require_paths; end",
"def require_pat... | [
"0.6920703",
"0.6450746",
"0.6365518",
"0.6365518",
"0.6195598",
"0.6189594",
"0.6150328",
"0.609918",
"0.5960857",
"0.5960857",
"0.5960857",
"0.5960857",
"0.5942313",
"0.5884012",
"0.5841174",
"0.57942307",
"0.57942307",
"0.57942307",
"0.5791014",
"0.5773681",
"0.5750076",
... | 0.7290763 | 0 |
Indicate if leading underscore should be allowed when creating partial definition. Allows compatibility with handlebarsrails | def chomp_underscore_for_partials?
@chomp_underscore_for_partials || false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def partial?\n @partial ||= filename.start_with?(\"_\")\n end",
"def underscore_flags?\n config[:underscore_flags]\n end",
"def trim_underscore_prefix(name)\n if config['allow_leading_underscore']\n # Remove if there is a single leading underscore\n name = name.sub(/^_(?!_)/,... | [
"0.64529854",
"0.62890226",
"0.6135346",
"0.6122114",
"0.5908734",
"0.58586776",
"0.5837765",
"0.5832529",
"0.5810925",
"0.58020157",
"0.57911",
"0.57732254",
"0.5756227",
"0.5722749",
"0.56685305",
"0.5660116",
"0.56556314",
"0.559788",
"0.5562421",
"0.5561672",
"0.5556271",... | 0.68699604 | 0 |
Log in as admin and delete repositories in gitlab if exist | def setup
create(:admin)
log_user("sazor_test_admin", "foo")
gitlab_destroy_all({ token: User.current.gitlab_token })
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_all repos\n unless repos\n raise \"required repository name\"\n end\n repos = @login + '/' + repos unless repos.include? '/'\n list_files(repos).each { |obj|\n delete repos, obj[:id]\n }\n end",
"def delete_maybe!(repositories)\n return ... | [
"0.65619105",
"0.6234484",
"0.6017595",
"0.5960642",
"0.59559214",
"0.59334457",
"0.59334457",
"0.5925021",
"0.5925021",
"0.5877002",
"0.5858784",
"0.58502734",
"0.582619",
"0.57470155",
"0.57326937",
"0.56764394",
"0.5667359",
"0.56652397",
"0.5638161",
"0.56339514",
"0.5622... | 0.65040374 | 1 |
GET /focusing_sections/1 GET /focusing_sections/1.xml | def show
@focusing_section = FocusingSection.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @focusing_section }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @focusing_section = FocusingSection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @focusing_section }\n end\n end",
"def view_all_sections \n @section = Section.find(:all)\n render_sections_xml(@section)\nend",
"def create\n @focus... | [
"0.6680284",
"0.599545",
"0.5791296",
"0.5619284",
"0.55900407",
"0.55418235",
"0.543906",
"0.5261863",
"0.5211927",
"0.5200693",
"0.51951224",
"0.51951224",
"0.51674634",
"0.5152114",
"0.51062137",
"0.51062137",
"0.51000583",
"0.50852275",
"0.5078364",
"0.50431126",
"0.50409... | 0.73625827 | 0 |
GET /focusing_sections/new GET /focusing_sections/new.xml | def new
@focusing_section = FocusingSection.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @focusing_section }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @sections = Section.find(:all) # TODO: refactor so I don't have to repeat this all over the place\n @section = Section.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @section }\n end\n end",
"def create\n @focusing_section = Focusin... | [
"0.67263204",
"0.6701025",
"0.6486304",
"0.6292984",
"0.62844634",
"0.6273585",
"0.6211352",
"0.6152979",
"0.6140588",
"0.61357623",
"0.6069758",
"0.60546815",
"0.60506546",
"0.60454816",
"0.6038793",
"0.6031259",
"0.6024017",
"0.6019589",
"0.59966856",
"0.59802336",
"0.59775... | 0.8027104 | 0 |
POST /focusing_sections POST /focusing_sections.xml | def create
@focusing_section = FocusingSection.new(params[:focusing_section])
respond_to do |format|
if @focusing_section.save
format.html { redirect_to(@focusing_section, :notice => 'Focusing section was successfully created.') }
format.xml { render :xml => @focusing_section, :status =>... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @focusing_section = FocusingSection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @focusing_section }\n end\n end",
"def show\n @focusing_section = FocusingSection.find(params[:id])\n\n respond_to do |format|\n format.html # sh... | [
"0.6411956",
"0.58798367",
"0.5781588",
"0.57198817",
"0.5389876",
"0.53613573",
"0.5297421",
"0.51577204",
"0.5156349",
"0.506541",
"0.506541",
"0.5059162",
"0.5026882",
"0.50017333",
"0.498552",
"0.49551302",
"0.49446183",
"0.49371514",
"0.4927198",
"0.4906829",
"0.486967",... | 0.67581743 | 0 |
PUT /focusing_sections/1 PUT /focusing_sections/1.xml | def update
@focusing_section = FocusingSection.find(params[:id])
respond_to do |format|
if @focusing_section.update_attributes(params[:focusing_section])
format.html { redirect_to(@focusing_section, :notice => 'Focusing section was successfully updated.') }
format.xml { head :ok }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @focusing_section = FocusingSection.new(params[:focusing_section])\n\n respond_to do |format|\n if @focusing_section.save\n format.html { redirect_to(@focusing_section, :notice => 'Focusing section was successfully created.') }\n format.xml { render :xml => @focusing_section,... | [
"0.6475105",
"0.61730427",
"0.61295223",
"0.58213407",
"0.551249",
"0.5440206",
"0.53887695",
"0.533315",
"0.5286995",
"0.5285215",
"0.5285215",
"0.5261533",
"0.52312094",
"0.52171457",
"0.52030003",
"0.5182742",
"0.517165",
"0.5164885",
"0.5150262",
"0.51486653",
"0.5146005"... | 0.72560865 | 0 |
DELETE /focusing_sections/1 DELETE /focusing_sections/1.xml | def destroy
@focusing_section = FocusingSection.find(params[:id])
@focusing_section.destroy
respond_to do |format|
format.html { redirect_to(focusing_sections_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @auto1h_fold_change = Auto1hFoldChange.find(params[:id])\n @auto1h_fold_change.destroy\n\n respond_to do |format|\n format.html { redirect_to(auto1h_fold_changes_url) }\n format.xml { head :ok }\n end\n end",
"def delete(slide)\n # ./_rels/presentation.xml.rels\n ... | [
"0.62300044",
"0.622103",
"0.61442953",
"0.6040826",
"0.6016747",
"0.6014932",
"0.59886545",
"0.59547704",
"0.5906735",
"0.5901866",
"0.59013474",
"0.59013474",
"0.5897394",
"0.58934116",
"0.5863656",
"0.5842811",
"0.5820115",
"0.5819179",
"0.5817798",
"0.5811004",
"0.5801395... | 0.73709065 | 0 |
GET /login_requests GET /login_requests.json | def index
@login_requests = LoginRequest.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login_request(username, password)\n post(data['hosts']['auth'] + '/login', {\n headers: {\n 'Content-Type' => 'application/json'\n },\n body: {\n username: username,\n password: password\n }\n })\nend",
"def login(email, password)\n post api_v1_user_session... | [
"0.6487079",
"0.62841916",
"0.6269545",
"0.6251792",
"0.6223876",
"0.6209219",
"0.6179111",
"0.6179111",
"0.61392313",
"0.6115614",
"0.60641867",
"0.60641867",
"0.605886",
"0.6052643",
"0.60437465",
"0.601462",
"0.59967446",
"0.599345",
"0.5976162",
"0.59639686",
"0.59639686"... | 0.6765701 | 0 |
GET /login_requests/1 GET /login_requests/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @login_requests = LoginRequest.all\n end",
"def process_login\n user = User.where(login: params[:user][:login], password: params[:user][:password]).first\n respond_with :api, json:!user.nil?\n end",
"def login\n #handle unexpected error with status code 500\n begin\n if reques... | [
"0.6674802",
"0.63301146",
"0.625843",
"0.6215068",
"0.6195142",
"0.6195142",
"0.61709183",
"0.61587834",
"0.6154423",
"0.6129986",
"0.6107484",
"0.6083886",
"0.60654837",
"0.6033618",
"0.60005397",
"0.5998963",
"0.5997019",
"0.5937574",
"0.5925529",
"0.5925529",
"0.5875238",... | 0.0 | -1 |
POST /login_requests POST /login_requests.json | def create
@login_request = LoginRequest.new(login_request_params)
respond_to do |format|
if @login_request.save
format.html { redirect_to @login_request, notice: 'Login request was successfully created.' }
format.json { render :show, status: :created, location: @login_request }
els... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login_request(username, password)\n post(data['hosts']['auth'] + '/login', {\n headers: {\n 'Content-Type' => 'application/json'\n },\n body: {\n username: username,\n password: password\n }\n })\nend",
"def login(email, password)\n post api_v1_user_session... | [
"0.6788316",
"0.6735249",
"0.6300447",
"0.6300447",
"0.6168401",
"0.60183007",
"0.59801483",
"0.5875261",
"0.58437073",
"0.5821884",
"0.5819806",
"0.5791825",
"0.5788628",
"0.5786673",
"0.5773386",
"0.5751632",
"0.5718359",
"0.57044166",
"0.56974757",
"0.5683435",
"0.5666759"... | 0.6468139 | 2 |
PATCH/PUT /login_requests/1 PATCH/PUT /login_requests/1.json | def update
respond_to do |format|
if @login_request.update(login_request_params)
format.html { redirect_to @login_request, notice: 'Login request was successfully updated.' }
format.json { render :show, status: :ok, location: @login_request }
else
format.html { render :edit }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch!\n request! :patch\n end",
"def update\n @request.assign_json_attributes(params) if @request.resume?\n respond_to do |format|\n if @request.update(request_params)\n format.html { redirect_to @request, notice: 'Request was successfully updated.' }\n format.json { render :sho... | [
"0.6442373",
"0.62619805",
"0.6161518",
"0.6135698",
"0.6053383",
"0.6053383",
"0.6053383",
"0.6053383",
"0.60049367",
"0.5925642",
"0.59198225",
"0.59166145",
"0.58602846",
"0.5835842",
"0.58146584",
"0.57942444",
"0.5793438",
"0.57795733",
"0.5765392",
"0.5712173",
"0.57015... | 0.66168296 | 0 |
DELETE /login_requests/1 DELETE /login_requests/1.json | def destroy
@login_request.destroy
respond_to do |format|
format.html { redirect_to login_requests_url, notice: 'Login request was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deleteLogin( login_id)\n params = Hash.new\n params['login_id'] = login_id\n return doCurl(\"delete\",\"/login\",params)\n end",
"def destroy\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",... | [
"0.7116501",
"0.69860506",
"0.69717765",
"0.69717765",
"0.69717765",
"0.691857",
"0.69020694",
"0.68720984",
"0.6859061",
"0.6859061",
"0.6859061",
"0.6859061",
"0.6859061",
"0.6859061",
"0.67637616",
"0.67427844",
"0.67400813",
"0.67165154",
"0.670706",
"0.67023623",
"0.6680... | 0.72338605 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_login_request
@login_request = LoginRequest.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 |
Only allow a list of trusted parameters through. | def login_request_params
params.require(:login_request).permit(:fname, :lname, :username, :department, :email)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def param_whitelist\n [:role, :title]\... | [
"0.69497335",
"0.6812623",
"0.6803639",
"0.6795365",
"0.67448795",
"0.67399913",
"0.6526815",
"0.6518771",
"0.64931697",
"0.6430388",
"0.6430388",
"0.6430388",
"0.63983387",
"0.6356042",
"0.63535863",
"0.63464934",
"0.63444513",
"0.6337208",
"0.6326454",
"0.6326454",
"0.63264... | 0.0 | -1 |
Mechanism to allow words to be declared into the parser. See the examples in 'initialize' for example usage. | def def_word(declaration, automap_values=:both, &block)
parts = declaration.split(' ')
name = parts[0]
state = :input
input = []
input_escapes = []
output = []
output_escapes = []
parts[1..-1].each do |x|
next if ['(', ')'].include?(x)
if x == '--'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize\n @words = (KEYWORDS + OTHERS).map(&:downcase)\n end",
"def initialize(word) # initialize with the arguement word\n @name = word # set the name = to the word that is paaed\n end",
"def word=(_arg0); end",
"def initialize(word)\n @word = word\n end",
"def initialize(wo... | [
"0.7187582",
"0.6870198",
"0.66938007",
"0.6638645",
"0.6638645",
"0.6638645",
"0.6638645",
"0.6638645",
"0.6638645",
"0.6638645",
"0.6638645",
"0.6638645",
"0.6638645",
"0.6579762",
"0.65673316",
"0.6515891",
"0.6466092",
"0.64299715",
"0.64094627",
"0.6406082",
"0.6400873",... | 0.62191427 | 40 |
You can create your own "vocabulary" for your parser by subclassing Prie::Parser and adding your own "words" (API). | def extended_base(word)
word_hash = self.words[word.value]
if word_hash
# automatically grab the stack values
stack_input_types = word_hash[:input]
from_stack = from_stack(word.value, *stack_input_types)
input_params = []
if [:both, :input].include?(word_hash[:automap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_vocabulary1\n json = File.read(VOCABULARY_FILE)\n object = JSON.parse(json)\n result = []\n (1..6).each do |i|\n result.push(object[\"LEVEL#{i}\"][\"words\"])\n end\n result\n end",
"def lex_en_interp_words; end",
"def lex_en_interp_words; end",
"def lex_en_interp_words; end... | [
"0.6582827",
"0.62966335",
"0.62966335",
"0.62966335",
"0.6219993",
"0.6167351",
"0.6147187",
"0.6144423",
"0.6039554",
"0.6039554",
"0.6039554",
"0.60231847",
"0.60082847",
"0.5948019",
"0.5948019",
"0.5948019",
"0.5922378",
"0.59165335",
"0.5915704",
"0.5897448",
"0.5897448... | 0.0 | -1 |
Put this in a subclass to provide API hooks for 3rd party developers | def extended_api(word)
case word.value
when "blah"
true
else
raise "word '#{word.value}' not defined"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def overrides; end",
"def private; end",
"def tag; raise 'Override this method'; end",
"def custom; end",
"def custom; end",
"def internal; end",
"def parent_api; end",
"def parent_api; end",
"def implementation; end",
"def implementation; end",
"def process_hook\n fail 'sub class to imp... | [
"0.7048754",
"0.6916686",
"0.6799326",
"0.6759837",
"0.6759837",
"0.669736",
"0.65916157",
"0.65916157",
"0.65716594",
"0.65716594",
"0.65227735",
"0.64510846",
"0.64428526",
"0.64398384",
"0.6413698",
"0.64101946",
"0.64101946",
"0.631516",
"0.6308267",
"0.63019896",
"0.6301... | 0.0 | -1 |
Return a legend with _contents_. | def legend contents, attrs = {}, &block
Tagz.tag :legend, contents, attrs, &block
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def legend(content, options ={})\n @template.form_legend(content, options)\n end",
"def form_legend(content, options ={})\n content_tag(:legend, content, options)\n end",
"def legend_html\n \"<h3 class='legend'>#{self.to_s}</h3>\" unless default?\n end",
"def legend\n title\n ... | [
"0.73988014",
"0.722647",
"0.705896",
"0.6940568",
"0.6760099",
"0.6758937",
"0.6758184",
"0.6538207",
"0.65236723",
"0.6516385",
"0.6487006",
"0.64624274",
"0.6451191",
"0.64365715",
"0.64009935",
"0.63861454",
"0.6329783",
"0.6269309",
"0.6213032",
"0.61867887",
"0.61819744... | 0.8071164 | 0 |
Return a fieldset with optional _legend_. | def fieldset name, legend = nil, attrs = {}, &block
attrs, legend = legend, nil if legend.is_a? Hash
Tagz.tag :fieldset, legend ? legend(legend) : nil, { :id => "fieldset-#{name}" }.merge(attrs), &block
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fieldset legend, &block\n concat content_tag(:fieldset) {\n output = String.new\n output << content_tag(:legend, legend) unless legend.blank?\n output << capture(&block)\n } \n end",
"def fieldset_tag(legend_name, options = {}, &block)\n if block_given?\n concat(content_tag(... | [
"0.80252874",
"0.7819512",
"0.77209705",
"0.7545782",
"0.74681085",
"0.7398325",
"0.7245302",
"0.70132625",
"0.69217265",
"0.68846554",
"0.67801666",
"0.6728997",
"0.6651485",
"0.6646116",
"0.660953",
"0.6583495",
"0.6496553",
"0.6430325",
"0.632535",
"0.6318738",
"0.630631",... | 0.7819906 | 1 |
Wrap form elements in div _name_. | def group name, &block
Tagz.tag :div, { :class => "group-#{name}" }, &block
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def form_input_group(&block)\n content_tag(:div, capture(&block), class: \"col-lg-10\")\n end",
"def new_nested_form_marker(name, opts={})\n options = {\n :class => 'dynamic_marker',\n :id => \"#{dynamic_name name}_marker\"\n }\n @template.content_tag 'div', '', options\n end",
"def ... | [
"0.6426993",
"0.6180591",
"0.6048508",
"0.597403",
"0.5904253",
"0.5868091",
"0.5821592",
"0.58118606",
"0.5791142",
"0.5782278",
"0.5771918",
"0.57557154",
"0.57437617",
"0.57323015",
"0.56857735",
"0.56582",
"0.5644219",
"0.5520283",
"0.5499195",
"0.54984534",
"0.54702145",... | 0.5463603 | 22 |
Wrap form buttons defined within _block_ in a div. | def buttons attrs = {}, &block
Tagz.tag :div, { :class => 'form-buttons' }.merge(attrs), &block
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bootstrap_form_buttons(&block)\n content_tag :div, class: 'form-actions row' do\n content_tag :div, class: 'col-md-10 col-md-offset-2', &block\n end\n end",
"def buttons(&block)\n content = @template.capture(self, &block)\n @template.concat '<div class=\"buttons\">'\n @templa... | [
"0.7885911",
"0.7423319",
"0.71851766",
"0.7026181",
"0.677677",
"0.67068857",
"0.655284",
"0.6534272",
"0.6519559",
"0.64565533",
"0.64254564",
"0.64235514",
"0.6327627",
"0.62559605",
"0.62334275",
"0.6205848",
"0.61580145",
"0.6016809",
"0.59211284",
"0.5919212",
"0.588700... | 0.7439537 | 1 |
Return select element _name_ with _options_ hash. | def select name, options, attrs = {}
options = select_options options, attrs
attrs.delete :selected
Tagz.tag :select, options, { :name => name }.merge(attrs)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def options(select_name)\n select = Praline::browser.find_element(:name, select_name)\n options = select.find_elements(:tag_name, 'option')\n options.map {|option| option.text }\n end",
"def options_of(name)\n search(\"[name='#{name}'] > option\").inject({}) do |memo, node|\n ... | [
"0.70933515",
"0.6985246",
"0.6975703",
"0.69195807",
"0.6793771",
"0.678846",
"0.67658156",
"0.66685694",
"0.66679376",
"0.66673946",
"0.65376234",
"0.6483191",
"0.64652306",
"0.6333821",
"0.63265604",
"0.63159823",
"0.6265537",
"0.6142398",
"0.6088518",
"0.6083976",
"0.6076... | 0.7564581 | 0 |
Return select option _contents_ with _value_. | def select_option value, contents, attrs = {}
Tagz.tag :option, contents, { :value => value }.merge(attrs)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value_text\n raise \"value_text is only valid for select items\" unless self.tag_name == \"select\"\n\n values = self.value\n if values.is_a?(Array)\n values.map do |value|\n self.find(\"option[value=\\\"#{value}\\\"]\", visible: false).text\n end\n else... | [
"0.63779193",
"0.6251691",
"0.6227347",
"0.61684686",
"0.60948485",
"0.60435486",
"0.5879598",
"0.5829506",
"0.57408005",
"0.5718614",
"0.57166487",
"0.5705466",
"0.57025427",
"0.56964594",
"0.5670779",
"0.5670779",
"0.5670779",
"0.5670779",
"0.5649937",
"0.5633125",
"0.55865... | 0.7789863 | 0 |
Return select option elements from _values_ with _options_ passed. === Options :selected string, symbol, or array of options selected | def select_options values, options = {}
normalize_select_prompt values, options
values.map do |key, value|
if value.is_a? Hash
Tagz.tag :optgroup, select_options(value, options), :label => key
elsif option_selected? key, options[:selected]
select_option key, value, :selec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_value(values)\n raise \"select_value is only valid for select items\" unless self.tag_name == \"select\"\n\n if values.is_a?(Array)\n values.each do |value|\n html_safe_value = \"\".html_safe + value.to_s\n self.find(\"option[value=\\\"#{html_safe_value}\\\"]... | [
"0.71090454",
"0.67063326",
"0.66184527",
"0.6512906",
"0.6454375",
"0.6421959",
"0.6409224",
"0.64087915",
"0.6405793",
"0.63359827",
"0.6274142",
"0.6243598",
"0.6197512",
"0.61141366",
"0.6059441",
"0.6053575",
"0.60140103",
"0.59781426",
"0.59673804",
"0.5949024",
"0.5949... | 0.7643366 | 0 |
Check if option _key_ is _selected_. | def option_selected? key, selected
if Array === selected
selected.any? do |value|
key.to_s == value.to_s
end
else
key.to_s == selected.to_s
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def options_selected?(option_id)\n question_option_ids.include?(option_id)\n end",
"def get_selected(key)\n option = find(key)\n\n if option.is_a?(Option)\n _debug(\"get_selected: found Option #{option}\")\n option\n elsif option\n _debug(\"get_selected: found ... | [
"0.70891833",
"0.6947304",
"0.6852696",
"0.6838517",
"0.6771726",
"0.66806495",
"0.6674705",
"0.6627943",
"0.6507149",
"0.6499973",
"0.64125514",
"0.6402219",
"0.63095075",
"0.6292514",
"0.62911344",
"0.6267563",
"0.60641056",
"0.60187787",
"0.60108995",
"0.60108995",
"0.5987... | 0.8267784 | 0 |
Normalize select prompt. When _options_ contains a :prompt string it is assigned as the prompt When :prompt is true the default of ' Select ' will become the prompt The prompt is selected unless a specific option is explicitly selected. | def normalize_select_prompt values, options = {}
return unless :prompt.in? options
prompt = options.delete :prompt
options[:selected] = '' unless :selected.in? options
values[''] = String === prompt ? prompt : '- Select -'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blank_option(prompt)\n case prompt\n when nil, false\n nil\n when String\n content_tag(:option, prompt, :value => '')\n when Array\n content_tag(:option, prompt.first, :value => prompt.last)\n else\n content_tag(:opt... | [
"0.6618459",
"0.61915827",
"0.6014915",
"0.6014915",
"0.59125173",
"0.58361626",
"0.5752419",
"0.56823176",
"0.5666062",
"0.5614734",
"0.55741066",
"0.5535681",
"0.5516193",
"0.55079067",
"0.54973626",
"0.5457563",
"0.5450662",
"0.54435456",
"0.5382256",
"0.5351523",
"0.53030... | 0.84348685 | 0 |
GET /shop/bonus_offers GET /shop/bonus_offers.json | def index
@shop_bonus_offers = Shop::BonusOffer.order('resource_id asc, currency asc, price asc')
respond_to do |format|
format.html # index.html.erb
format.json do
@shop_bonus_offers.each do |offer|
offer[:resource_effect] = offer.effect_for_character(current_character)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @shop_bonus_offer = Shop::BonusOffer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop_bonus_offer }\n end\n end",
"def new\n @shop_bonus_offer = Shop::BonusOffer.new\n\n respond_to do |format|\n format.html # n... | [
"0.73519313",
"0.7002178",
"0.68376976",
"0.6743816",
"0.6595599",
"0.6592788",
"0.6484554",
"0.645639",
"0.64309204",
"0.64184934",
"0.638307",
"0.63762724",
"0.6369747",
"0.63327676",
"0.6299929",
"0.628464",
"0.6257369",
"0.6257369",
"0.6244624",
"0.6229193",
"0.62054783",... | 0.6876914 | 2 |
GET /shop/bonus_offers/1 GET /shop/bonus_offers/1.json | def show
@shop_bonus_offer = Shop::BonusOffer.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @shop_bonus_offer }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @shop_bonus_offer = Shop::BonusOffer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shop_bonus_offer }\n end\n end",
"def index\n @shop_bonus_offers = Shop::BonusOffer.order('resource_id asc, currency asc, price asc')\n \n respond_... | [
"0.7202859",
"0.69210726",
"0.6785388",
"0.6586136",
"0.6481548",
"0.63914126",
"0.6368458",
"0.63675624",
"0.63653684",
"0.63505673",
"0.63370484",
"0.63370484",
"0.631936",
"0.62895685",
"0.6287289",
"0.62719643",
"0.6266679",
"0.62653154",
"0.6263336",
"0.62491405",
"0.618... | 0.7552387 | 0 |
GET /shop/bonus_offers/new GET /shop/bonus_offers/new.json | def new
@shop_bonus_offer = Shop::BonusOffer.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @shop_bonus_offer }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @offers = Offer.all\n @price = Price.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @price }\n end\n end",
"def new\n @offer = Offer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ... | [
"0.7626529",
"0.75301445",
"0.75301445",
"0.75301445",
"0.7471735",
"0.74588394",
"0.7456203",
"0.7287905",
"0.71748525",
"0.7124031",
"0.7110542",
"0.70957756",
"0.7092108",
"0.70135677",
"0.7003092",
"0.69793576",
"0.6973366",
"0.6959526",
"0.6919579",
"0.69051415",
"0.6894... | 0.80701846 | 0 |
POST /shop/bonus_offers POST /shop/bonus_offers.json | def create
@shop_bonus_offer = Shop::BonusOffer.new(params[:shop_bonus_offer])
respond_to do |format|
if @shop_bonus_offer.save
format.html { redirect_to @shop_bonus_offer, notice: 'Bonus offer was successfully created.' }
format.json { render json: @shop_bonus_offer, status: :created, lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @shop_bonus_offer = Shop::BonusOffer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shop_bonus_offer }\n end\n end",
"def create\n @offer = Offer.new(offers_params)\n\n respond_to do |format|\n if @offer.save\n format.json... | [
"0.67134875",
"0.65152776",
"0.6477072",
"0.6271032",
"0.62532634",
"0.6241223",
"0.61333394",
"0.6101613",
"0.60965455",
"0.6067531",
"0.6037174",
"0.6025135",
"0.5992187",
"0.59856147",
"0.5971456",
"0.59690565",
"0.5954996",
"0.59515244",
"0.5935612",
"0.5910889",
"0.59108... | 0.7241689 | 0 |
PUT /shop/bonus_offers/1 PUT /shop/bonus_offers/1.json | def update
@shop_bonus_offer = Shop::BonusOffer.find(params[:id])
respond_to do |format|
if @shop_bonus_offer.update_attributes(params[:shop_bonus_offer])
format.html { redirect_to @shop_bonus_offer, notice: 'Bonus offer was successfully updated.' }
format.json { head :ok }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updateOffer()\n @offer_operation = :update\n end",
"def update\n respond_to do |format|\n if @offer.update(offers_params)\n format.jsonapi { render :show, status: :ok, location: @offer }\n else\n format.jsonapi { render jsonapi: @offer.errors, status: :unprocessable_entity }\n ... | [
"0.6794867",
"0.66618025",
"0.66247505",
"0.65099084",
"0.64968795",
"0.6396222",
"0.63141197",
"0.63141197",
"0.6297085",
"0.62813556",
"0.6281051",
"0.6230976",
"0.62223315",
"0.61529326",
"0.612292",
"0.6114513",
"0.6109953",
"0.61098516",
"0.61098516",
"0.6105059",
"0.610... | 0.7571184 | 0 |
DELETE /shop/bonus_offers/1 DELETE /shop/bonus_offers/1.json | def destroy
@shop_bonus_offer = Shop::BonusOffer.find(params[:id])
@shop_bonus_offer.destroy
respond_to do |format|
format.html { redirect_to shop_bonus_offers_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @offer = Offer.find(params[:id])\n checkaccountobject(\"offers\",@offer)\n @offer.destroy\n\n respond_to do |format|\n format.html { redirect_to offers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @offer.destroy\n respond_to do |format|\n format... | [
"0.72270614",
"0.7174914",
"0.7174914",
"0.7118658",
"0.71046317",
"0.6966799",
"0.6856898",
"0.6856898",
"0.6846354",
"0.6846354",
"0.68198955",
"0.68041366",
"0.6800669",
"0.677624",
"0.6752574",
"0.67322105",
"0.67294097",
"0.6725201",
"0.6713076",
"0.6700821",
"0.6697689"... | 0.7828085 | 0 |
GET /yarns GET /yarns.json | def index
@yarns = Yarn.where(user: current_user)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @yarns = Yarn.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @yarns }\n end\n end",
"def index\n @yarns = Yarn.all\n end",
"def view_api\n api_string = RestClient.get(\"https://itunes.apple.com/search?term=star+wars&entity=song&at... | [
"0.67182815",
"0.60511965",
"0.5451818",
"0.53134495",
"0.53022534",
"0.52926224",
"0.52661437",
"0.5250046",
"0.52298695",
"0.52122504",
"0.5164399",
"0.51287836",
"0.5112124",
"0.51064366",
"0.51062477",
"0.5100662",
"0.50885856",
"0.50812685",
"0.50731343",
"0.50515443",
"... | 0.57295454 | 2 |
GET /yarns/1 GET /yarns/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @yarns = Yarn.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @yarns }\n end\n end",
"def index\n @yarns = Yarn.all\n end",
"def show\n @nyan = Nyan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.e... | [
"0.7017413",
"0.62444127",
"0.56989646",
"0.5680525",
"0.55797386",
"0.5529755",
"0.55235744",
"0.5516896",
"0.54878837",
"0.5475291",
"0.54616314",
"0.54315394",
"0.5430485",
"0.54303396",
"0.53574747",
"0.5311701",
"0.529817",
"0.5288181",
"0.5271894",
"0.5271838",
"0.52684... | 0.0 | -1 |
POST /yarns POST /yarns.json | def create
#clone yarn params (in private) to attrs var
form_data = params().clone
attrs2 = yarn_params().clone
#set user_id in attr = current user
attrs2[:user_id] = current_user.id
@yarn = Yarn.new(attrs2)
@array_stop_point = ((form_data[:skein_lengths].length * 2) - 1)
@skei... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_to_api(snack_name, snack_location, snack_optional)\n RestClient.post ENV['NERDERY_API'], { name: snack_name,\n location: snack_location,\n optional: snack_optional\n }.to_json, conte... | [
"0.5792791",
"0.53882813",
"0.52078253",
"0.5166424",
"0.5132446",
"0.510249",
"0.5090972",
"0.50396",
"0.5018864",
"0.5007804",
"0.5004839",
"0.49814922",
"0.49782112",
"0.49768463",
"0.4975386",
"0.49590126",
"0.48926792",
"0.48923576",
"0.4890478",
"0.48674744",
"0.4860472... | 0.0 | -1 |
PATCH/PUT /yarns/1 PATCH/PUT /yarns/1.json | def update
respond_to do |format|
if @yarn.update(yarn_params)
format.html { redirect_to @yarn, notice: 'Yarn was successfully updated.' }
format.json { render :show, status: :ok, location: @yarn }
else
format.html { render :edit }
format.json { render json: @yarn.errors,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update_tenant_circle(args =... | [
"0.63413256",
"0.6172974",
"0.61093014",
"0.60405475",
"0.6023118",
"0.5908009",
"0.5867053",
"0.5844658",
"0.584118",
"0.58397317",
"0.5800354",
"0.5799929",
"0.5791407",
"0.57832336",
"0.5761724",
"0.57559925",
"0.575419",
"0.5754132",
"0.57464075",
"0.57278407",
"0.5708832... | 0.55072147 | 54 |
DELETE /yarns/1 DELETE /yarns/1.json | def destroy
@yarn.destroy
respond_to do |format|
format.html { redirect_to yarns_url, notice: 'Yarn was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @yarn.destroy\n respond_to do |format|\n format.html { redirect_to yarns_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @uriy.destroy\n respond_to do |format|\n format.html { redirect_to uriys_url }\n format.json { head :no_content }\n e... | [
"0.69695526",
"0.65960824",
"0.64855325",
"0.6484717",
"0.6385343",
"0.6319391",
"0.63156366",
"0.62802",
"0.62621826",
"0.62591904",
"0.62591904",
"0.62411344",
"0.6236555",
"0.621872",
"0.6209185",
"0.6207909",
"0.6201316",
"0.6194933",
"0.619258",
"0.6180607",
"0.61632746"... | 0.62804115 | 8 |
Use callbacks to share common setup or constraints between actions. | def set_yarn
@yarn = Yarn.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 yarn_params
params.require(:yarn).permit(:name, :color, :weight, :gauge, :user_id)
# MAY NEED TO ADD ABOVE - skeins_attributes: [:length]
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.69802505",
"0.6781974",
"0.67470175",
"0.67430073",
"0.67350477",
"0.6593221",
"0.6504263",
"0.64988977",
"0.6481794",
"0.64800006",
"0.64568025",
"0.64411247",
"0.6379476",
"0.63765615",
"0.6368045",
"0.6320141",
"0.6300363",
"0.6300057",
"0.62952244",
"0.6294712",
"0.629... | 0.0 | -1 |
Creates a Call object from a call_id. | def initialize(call_id)
raise ArgumentError("Cannot pass nil call_id") if call_id.nil?
@call_id = call_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(call)\n validate_type!(call)\n\n attributes = sanitize(call)\n _, _, root = @client.post(\"/calls\", attributes)\n\n Call.new(root[:data])\n end",
"def by_call_id(call_id)\n raise StandardError, 'call_id cannot be null' if call_id.nil?\n url... | [
"0.73854953",
"0.725655",
"0.6749935",
"0.6681578",
"0.65551114",
"0.63996524",
"0.63870376",
"0.638371",
"0.638371",
"0.63687825",
"0.63687825",
"0.63687825",
"0.63687825",
"0.63687825",
"0.63687825",
"0.63687825",
"0.63687825",
"0.6312355",
"0.62455595",
"0.62230814",
"0.61... | 0.725309 | 2 |
Retrieves the status of the current call. Untested | def status
Skype.send_ :command => "get call #{@call_id} status"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getStatus\n call(STATUS_PATH)\n end",
"def get_call_status\r\n\t dialstatus = get_variable(\"dialstatus\")\r\n\t if dialstatus == nil #the dial command has not returned yet..thus the call is in progress\r\n\t return :InProgress\r\n\t elsif dialstatus == \"ANSWER\" #the dial command returned f... | [
"0.7642488",
"0.7528901",
"0.7460585",
"0.7370375",
"0.73344296",
"0.7190425",
"0.71415937",
"0.7129705",
"0.70971483",
"0.70836174",
"0.7056102",
"0.7045565",
"0.7034771",
"0.702811",
"0.69638264",
"0.69530463",
"0.6917111",
"0.69165856",
"0.6856835",
"0.6846352",
"0.6839084... | 0.8465671 | 0 |
Returns one of: VIDEO_NONE, VIDEO_SEND_ENABLED, VIDEO_RECV_ENABLED, VIDEO_BOTH_ENABLED | def get_video_status
Skype.send_ :command => "get call #{id} video_status"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def video?\n self.sti_type == VIDEO_TYPE\n end",
"def video_codec\n @video_codec ||= begin\n case self[:video_codec]\n when \"h264\"\n 'H264'\n when \"mpeg4\"\n 'MP4'\n when 'hevc'\n \"HEVC\"\n else\n nil\n end\n end \n end",
"def video?\n ... | [
"0.6746829",
"0.6613485",
"0.65962774",
"0.6481058",
"0.641199",
"0.63304216",
"0.6293086",
"0.62393767",
"0.62079424",
"0.6136534",
"0.61175376",
"0.608173",
"0.6072641",
"0.5963627",
"0.5937521",
"0.59061974",
"0.58930427",
"0.58711666",
"0.5767526",
"0.5698762",
"0.5627775... | 0.5821631 | 18 |
Accepts :START or :STOP | def send_video(toggle_flag)
raise Error.new("Illegal flag: #{toggle_flag}") if not @@TOGGLE_FLAGS.index toggle_flag
Skype.send_ :command => "alter call #{id} #{toggle_flag.downcase.to_s}_video_send"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start;end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",... | [
"0.67944336",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67302537",
"0.67178106",
"0.6597245",
"0.64884543",
"0.643164",
... | 0.0 | -1 |
Accepts :START or :STOP | def rcv_video(toggle_flag)
raise Error.new("Illegal flag: #{toggle_flag}") if not @@TOGGLE_FLAGS.index toggle_flag
Skype.send_ :command => "alter call #{id} #{toggle_flag.downcase.to_s}_video_receive"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start;end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",... | [
"0.679346",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.6729224",
"0.67177224",
"0.6596765",
"0.6488194",
"0.64316064",
"0.6267793",
... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.