query stringlengths 7 6.41k | document stringlengths 12 28.8k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Return the next lower item in the list. | def lower_item
return nil unless in_list?
acts_as_list_class.find(:first, :conditions =>
"position = #{(send(:position).to_i + 1).to_s}"
)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lower_item\n return nil unless in_list?\n lower_items(1).first\n end",
"def move_lower\n return if self == self_and_siblings(true).last\n move_to(position_in_list + 1)\n end",
"def find_lt(list, item, &block)\r\n\t\ti = bisect_left(list, item, &block)\r\n\t\tretu... | [
"0.7830517",
"0.728753",
"0.72604984",
"0.7019275",
"0.6981675",
"0.6970054",
"0.68971944",
"0.68971944",
"0.6853704",
"0.67496645",
"0.6717482",
"0.67153007",
"0.67058164",
"0.6630305",
"0.65746784",
"0.6537143",
"0.651084",
"0.6452789",
"0.64444345",
"0.6438452",
"0.6425565... | 0.7377293 | 1 |
Decrease the position of this item without adjusting the rest of the list. | def decrement_position
return unless in_list?
update_attribute :position, self.send(:position).to_i - 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def decrement_position\n return unless in_list?\n set_list_position(current_position - 1)\n end",
"def decrement_position\n return unless in_list?\n\n # self_class_all_or_in_collection.where(:pos => my_position).\n adjust_position!(-1)\n end",
"def decrement_p... | [
"0.78441364",
"0.7756966",
"0.77155715",
"0.7483058",
"0.7363868",
"0.7135145",
"0.7029498",
"0.694255",
"0.6940081",
"0.6910789",
"0.6874631",
"0.68350005",
"0.66091406",
"0.6557186",
"0.6520704",
"0.65114504",
"0.6485874",
"0.6408452",
"0.63783157",
"0.63783157",
"0.6366913... | 0.80463296 | 0 |
Returns the bottom position number in the list. bottom_position_in_list => 2 | def bottom_position_in_list(except = nil)
item = bottom_item(except)
item ? item.send(:position) : 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_position_in_list\n return nil unless in_list?\n bottom_position_in_list\n end",
"def bottom_position_in_list(except = nil)\n item = bottom_item(except)\n item ? item.send(position_column) : 0\n end",
"def bottom_position_in_list(except = nil)\n item = botto... | [
"0.81155956",
"0.8079379",
"0.80280375",
"0.7928457",
"0.7911197",
"0.69945776",
"0.6879014",
"0.67420703",
"0.67404836",
"0.6604313",
"0.65601915",
"0.65463865",
"0.65017986",
"0.6450243",
"0.6329894",
"0.6293622",
"0.6293622",
"0.6283526",
"0.62620646",
"0.6239669",
"0.6200... | 0.8109231 | 1 |
Use equivalentxml to determine equivalence | def equivalent_nokogiri(other)
if defined?(::EquivalentXml)
EquivalentXml.equivalent?(object, other.object)
else
equivalent_rexml(other)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equivalent_rexml(other)\n begin\n require 'active_support'\n require 'active_support/core_ext'\n rescue LoadError\n # string equivalence\n end\n\n if Hash.respond_to?(:from_xml)\n Hash.from_xml(\"<root>#{self}</root>\") == Hash.from_xml(\"<root>#{other}</root>\")... | [
"0.7360179",
"0.70576596",
"0.6480727",
"0.6468421",
"0.64491636",
"0.6258976",
"0.62296516",
"0.598884",
"0.5913244",
"0.5804363",
"0.57848096",
"0.5780509",
"0.5732317",
"0.5587081",
"0.5512715",
"0.54148257",
"0.5400435",
"0.53641295",
"0.5327247",
"0.5314293",
"0.52894455... | 0.733993 | 1 |
Simple equivalence test for REXML | def equivalent_rexml(other)
begin
require 'active_support'
require 'active_support/core_ext'
rescue LoadError
# string equivalence
end
if Hash.respond_to?(:from_xml)
Hash.from_xml("<root>#{self}</root>") == Hash.from_xml("<root>#{other}</root>")
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xml_should_eql(actual, expected)\n same = xml_cmp(actual, expected)\n actual.should.== expected unless same \nend",
"def xml_compare a, b\n a = REXML::Document.new(a.to_s)\n b = REXML::Document.new(b.to_s)\n\n normalized = Class.new(REXML::Formatters::Pretty) do\n def write_text(node, output... | [
"0.71979046",
"0.70567",
"0.70154643",
"0.69066465",
"0.6902816",
"0.688589",
"0.6804099",
"0.6660397",
"0.6615836",
"0.6555921",
"0.65196425",
"0.636508",
"0.63044393",
"0.62656343",
"0.6247824",
"0.62137634",
"0.6153384",
"0.5979433",
"0.59192795",
"0.5901599",
"0.5901475",... | 0.72662044 | 0 |
Affiche en console la liste des instances | def show_list
clear
puts "= LISTE DES INSTANCES #{name} =".bleu
puts "\n\n"
len_delim = defined?(LIST_ENTETE) ? LIST_ENTETE.length + 2 : 80
delim = ("-"*len_delim).bleu
if defined?(LIST_ENTETE)
puts delim
puts LIST_ENTETE
end
puts delim
all.each do |inst|
puts " #{inst.to_console}"
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_of_instances\n super\n end",
"def instances; end",
"def instances; end",
"def instances\n end",
"def print_instances_details(only_running=true)\n @groups.values.each_with_index do |instances, i|\n instances.each do |instance|\n if only_running and (not instance.ready?... | [
"0.7148263",
"0.691316",
"0.691316",
"0.68694407",
"0.68495244",
"0.68187",
"0.67520285",
"0.6622422",
"0.64641416",
"0.6419328",
"0.6419328",
"0.6409997",
"0.63860893",
"0.6375767",
"0.6326579",
"0.62862766",
"0.62723833",
"0.6269662",
"0.6263259",
"0.6246511",
"0.6237165",
... | 0.7773426 | 0 |
create resources is used to create the resources needed | def create_resources(project)
raise NotImplementedError
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup(resources) ; end",
"def create(resources)\n #resources[0].model.last_query = resources\n counter = 0\n resources.each do |resource|\n fm_params = prepare_fmp_attributes(resource.dirty_attributes)\n rslt = layout(resource.model).create(fm_params)\n merge_f... | [
"0.7098429",
"0.6946261",
"0.69214714",
"0.687821",
"0.687821",
"0.6748614",
"0.6731864",
"0.6577058",
"0.65576774",
"0.6489712",
"0.6418785",
"0.6398197",
"0.63402456",
"0.63235515",
"0.6282782",
"0.6251337",
"0.62312806",
"0.6201025",
"0.61962813",
"0.61736757",
"0.61672485... | 0.70261425 | 1 |
GET /fhir_base_urls GET /fhir_base_urls.json | def index
@fhir_base_urls = FhirBaseUrl.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @fhir_base_urls }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def base_href\n '/api/v1'\n end",
"def show\n @fhir_base_url = FhirBaseUrl.find(params[:id])\n\n respond_to do |format|\n format.html { redirect_to :action => :edit }\n format.json { render json: @fhir_base_url }\n end\n end",
"def base_url\n return url\n end",
"def base_url\n ... | [
"0.65288126",
"0.644742",
"0.62251186",
"0.6215531",
"0.62133396",
"0.620405",
"0.61742246",
"0.61429673",
"0.6136415",
"0.61359584",
"0.6083833",
"0.608366",
"0.6076272",
"0.6029362",
"0.60067344",
"0.5993861",
"0.59799045",
"0.59788996",
"0.5930055",
"0.5895603",
"0.5895229... | 0.78445756 | 0 |
GET /fhir_base_urls/new GET /fhir_base_urls/new.json | def new
@fhir_base_url = FhirBaseUrl.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @fhir_base_url }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @base_url = BaseUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @base_url }\n end\n\n end",
"def create\n @fhir_base_url = FhirBaseUrl.new(params[:fhir_base_url])\n\n respond_to do |format|\n if @fhir_base_url.save\n for... | [
"0.7343179",
"0.72189087",
"0.66810304",
"0.6576273",
"0.64594054",
"0.63996327",
"0.6364573",
"0.63496935",
"0.627866",
"0.6262519",
"0.62583095",
"0.6251131",
"0.6109657",
"0.6095987",
"0.6078266",
"0.60770625",
"0.60255694",
"0.60255694",
"0.60228497",
"0.5989396",
"0.5967... | 0.7730156 | 0 |
POST /fhir_base_urls POST /fhir_base_urls.json | def create
@fhir_base_url = FhirBaseUrl.new(params[:fhir_base_url])
respond_to do |format|
if @fhir_base_url.save
format.html { redirect_to @fhir_base_url, notice: 'Fhir base url was successfully created.' }
format.json { render json: @fhir_base_url, status: :created, location: @fhir_base... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @fhir_base_urls = FhirBaseUrl.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fhir_base_urls }\n end\n end",
"def create\n @base_url = BaseUrl.new(params[:base_url])\n\n respond_to do |format|\n if @base_url.save\n form... | [
"0.647281",
"0.5907034",
"0.5837732",
"0.5816133",
"0.56918824",
"0.56825995",
"0.56635875",
"0.5544441",
"0.5533057",
"0.5531832",
"0.55203277",
"0.55153286",
"0.54954576",
"0.54795194",
"0.54064965",
"0.54005194",
"0.5389489",
"0.5383957",
"0.5330269",
"0.5329335",
"0.53263... | 0.65894955 | 0 |
PUT /fhir_base_urls/1 PUT /fhir_base_urls/1.json | def update
@fhir_base_url = FhirBaseUrl.find(params[:id])
respond_to do |format|
if @fhir_base_url.update_attributes(params[:fhir_base_url])
format.html { redirect_to @fhir_base_url, notice: 'Fhir base url was successfully updated.' }
format.json { head :no_content }
else
fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @base_url = BaseUrl.find(params[:id])\n\n respond_to do |format|\n if @base_url.update_attributes(params[:base_url])\n format.html { redirect_to @base_url, notice: 'Base url was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { rend... | [
"0.60500896",
"0.6005032",
"0.5930877",
"0.57847446",
"0.57821643",
"0.5653477",
"0.55667156",
"0.55542773",
"0.5554221",
"0.55478483",
"0.5534516",
"0.55053484",
"0.54694843",
"0.54195803",
"0.54020816",
"0.5352201",
"0.5344933",
"0.5333442",
"0.53221613",
"0.5319447",
"0.53... | 0.68342924 | 0 |
DELETE /fhir_base_urls/1 DELETE /fhir_base_urls/1.json | def destroy
begin
@fhir_base_url = FhirBaseUrl.find(params[:id])
@fhir_base_url.destroy
rescue ActiveRecord::DeleteRestrictionError
flash[:"alert-danger"] = "Could not delete the URL because there are resources assigned to it."
redirect_to resources_path
return
end
respond... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @base_url = BaseUrl.find(params[:id])\n @base_url.destroy\n\n respond_to do |format|\n format.html { redirect_to base_urls_url }\n format.json { head :no_content }\n end\n end",
"def delete; rest_delete(link('self')); end",
"def delete; rest_delete(link('self')); end",
"d... | [
"0.7013541",
"0.66653395",
"0.66653395",
"0.658072",
"0.65619445",
"0.64821774",
"0.64821774",
"0.64821774",
"0.64821774",
"0.64769125",
"0.64567477",
"0.6446747",
"0.6429665",
"0.63629025",
"0.63601214",
"0.6324692",
"0.6324058",
"0.6320892",
"0.630077",
"0.6275",
"0.627127"... | 0.7637462 | 0 |
GET /reports GET /reports.xml | def index
@reports = Report.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @reports }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reports\n collection(\"reports\")\n end",
"def reports\n @node = resource\n @reports = params[:kind] == \"inspect\" ? @node.reports.inspections : @node.reports.applies\n respond_to do |format|\n format.html { @reports = paginate_scope(@reports); render 'reports/index' }\n end\n end"... | [
"0.75744605",
"0.73578554",
"0.7341337",
"0.721651",
"0.721651",
"0.71889627",
"0.7100547",
"0.70582396",
"0.7038257",
"0.7038257",
"0.7038257",
"0.7038257",
"0.7038257",
"0.7038257",
"0.7038257",
"0.7038257",
"0.7038257",
"0.7038257",
"0.7038257",
"0.7038257",
"0.7038257",
... | 0.77149165 | 0 |
PUT /reports/1 PUT /reports/1.xml | def update
@report = Report.find(params[:id])
respond_to do |format|
if @report.update_attributes(params[:report])
format.html { redirect_to(@report, :notice => 'Report was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update\n @report = Mg::Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to(@repor... | [
"0.6636008",
"0.65041757",
"0.64983416",
"0.64934784",
"0.6209521",
"0.6200539",
"0.6200248",
"0.6200248",
"0.61958337",
"0.61544424",
"0.61226845",
"0.6119069",
"0.611681",
"0.61123073",
"0.6112214",
"0.60990727",
"0.6088551",
"0.6043774",
"0.6036607",
"0.60289955",
"0.60289... | 0.6513428 | 1 |
Return if a dataset with provided name exists | def dataset?(name)
datasets.key?(name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dataset?(name)\n self[name] ? true : false\n end",
"def dataset?(name)\n run rql.db(options[:db]).table_list.contains(name.to_s)\n end",
"def dataset?(name)\n connection.query(\"select * from #{name} limit 1\")\n true\n rescue ::InfluxDB::Error\n false\n e... | [
"0.853543",
"0.8333764",
"0.80609053",
"0.7299681",
"0.7186603",
"0.7077373",
"0.7035662",
"0.69494444",
"0.681599",
"0.68006873",
"0.67570317",
"0.6641808",
"0.66224843",
"0.6567562",
"0.653844",
"0.6459573",
"0.6457092",
"0.6434239",
"0.6412482",
"0.64020854",
"0.640058",
... | 0.87435895 | 1 |
Private: Fail the check if ActiveRecord cannot check migration status | def unsupported
mark_failure
mark_message "This version of ActiveRecord does not support checking whether migrations are pending"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def migration_error?\n render :migration_error, status: 500 unless ENV[\"DB_MIGRATE_FAILED\"].blank?\n end",
"def migrate?\n raise NotImplementedError\n end",
"def supports_migrations?\n false\n end",
"def supports_migrations?\n false\n end",
"def integrity_check\n ... | [
"0.7106798",
"0.6724601",
"0.6706887",
"0.6706887",
"0.6653206",
"0.65198195",
"0.65198195",
"0.6516664",
"0.6516664",
"0.6516664",
"0.6452443",
"0.63467443",
"0.631587",
"0.6194073",
"0.608931",
"0.605167",
"0.60339427",
"0.599644",
"0.59961903",
"0.59688634",
"0.5968473",
... | 0.7452502 | 0 |
Make sure a pitch fits in the key's allowed range. | def check_pitch pitch
raise ArgumentError, "pitch is less than pitch range min" if pitch < @pitch_range.min
raise ArgumentError, "pitch is more than pitch range max" if pitch > @pitch_range.max
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def key_length_valid?(number)\n number >= 1024 && ( number & (number - 1) == 0 )\n end",
"def key_length_valid?(number)\n number >= 1024 && ( number & (number - 1) == 0 )\n end",
"def valid_key?(match_data)\n match_data[:key].to_i == (97 - match_data[1..-2].join.to_i) % 97\nend",
"de... | [
"0.56189775",
"0.56189775",
"0.5522284",
"0.5513022",
"0.5493864",
"0.53659564",
"0.53391254",
"0.52893674",
"0.52798766",
"0.5230192",
"0.5197499",
"0.5140459",
"0.5120379",
"0.50213265",
"0.50053483",
"0.49846",
"0.49839526",
"0.49651346",
"0.495985",
"0.49499112",
"0.49279... | 0.7555697 | 0 |
GET /datasets/1 GET /datasets/1.xml GET /dataset/1.eml | def show
@dataset = Dataset.find(params[:id])
@title = @dataset.title
@roles = @dataset.roles
respond_to do |format|
format.html # show.rhtml
format.eml { render :xml => @dataset.to_eml }
format.xml { render :xml => @dataset.to_xml }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @dataset = Dataset.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @dataset }\n end\n end",
"def show\n @dataset = Dataset.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.x... | [
"0.6515531",
"0.6515531",
"0.6430059",
"0.6369675",
"0.6369675",
"0.6369675",
"0.63256216",
"0.62667674",
"0.6231876",
"0.60140026",
"0.59460634",
"0.59143174",
"0.5913164",
"0.58865386",
"0.58772343",
"0.587506",
"0.587506",
"0.587506",
"0.587506",
"0.58724594",
"0.58608234"... | 0.6559103 | 0 |
PUT /datasets/1 PUT /datasets/1.xml | def update
@dataset = Dataset.find(params[:id])
respond_to do |format|
if @dataset.update_attributes(params[:dataset])
flash[:notice] = 'Dataset was successfully updated.'
format.html { redirect_to dataset_url(@dataset) }
format.xml { head :ok }
else
format.html { r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @dataset = Dataset.find(params[:id])\n\n respond_to do |format|\n if @dataset.update_attributes(params[:dataset])\n format.html { redirect_to(@dataset, :notice => 'Dataset was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :actio... | [
"0.6526648",
"0.6329613",
"0.6190557",
"0.61218303",
"0.6041167",
"0.5998395",
"0.59983724",
"0.59983724",
"0.59983724",
"0.59983724",
"0.59376717",
"0.59293675",
"0.58789486",
"0.58299065",
"0.5808605",
"0.57836634",
"0.5779558",
"0.568264",
"0.5639311",
"0.5623167",
"0.5608... | 0.6552326 | 0 |
GET /dairies GET /dairies.json | def index
@dairies = Dairy.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @dices = Dice.all\n\n render json: @dices\n end",
"def index\n @diaries = current_user.diaries.all\n respond_to do |format|\n format.html {render :index}\n format.json { render json: @diaries }\n end\n end",
"def index\n @my_dairies = MyDairy.all\n end",
"def show\n... | [
"0.68365806",
"0.6676271",
"0.6571826",
"0.6405233",
"0.6368298",
"0.62711257",
"0.61993396",
"0.613877",
"0.6069747",
"0.6063064",
"0.6053844",
"0.59664583",
"0.5966046",
"0.595462",
"0.59324247",
"0.5931901",
"0.5925932",
"0.5886758",
"0.5883489",
"0.58756554",
"0.5862489",... | 0.6861026 | 0 |
Clean the changed paths and return only valid PHPUnit tests files. | def clean(paths)
paths.uniq!
paths.compact!
populate_test_files
paths = paths.select { |p| test_file?(p) }
clear_tests_files_list
paths
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_tests\n puts \"Removing generated tests from '#{Settings[:test_dir]}'...\"\n Dir.foreach(Settings[:test_dir]) do |dir|\n path = Pathname.new(Settings[:test_dir]) + dir\n next if dir == '.' or dir == '..' or dir == 'support' or not path.directory?\n FileUtils.rm_rf(path)\n end\nend",
"def re... | [
"0.70650643",
"0.6703281",
"0.63987005",
"0.634393",
"0.6166886",
"0.60558796",
"0.5962308",
"0.5946638",
"0.5909081",
"0.5880959",
"0.5846157",
"0.5843148",
"0.5783122",
"0.5782859",
"0.575021",
"0.5728827",
"0.57137936",
"0.57040197",
"0.56911045",
"0.5689036",
"0.5665183",... | 0.72773135 | 0 |
Checks if the paths is a valid test file. | def test_file?(path)
@tests_files.include?(path)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid?\n ensure_file_open!\n\n ['Makefile', 'submission/', 'tests/'].all? { |entry| @file.find_entry(entry).present? }\n end",
"def valid_file_path?(path)\n path && File.exist?(path) && File.readable?(path)\n end",
"def valid_file?(path)\n case path\n when %r|/abcdef$|, %r|^\\./tmp/d... | [
"0.70958656",
"0.6820039",
"0.66966206",
"0.6581964",
"0.6551448",
"0.65437734",
"0.65351826",
"0.6528706",
"0.64767516",
"0.6473018",
"0.6456283",
"0.6391489",
"0.6373879",
"0.6336423",
"0.63254166",
"0.6311913",
"0.6297002",
"0.6291849",
"0.629128",
"0.62630975",
"0.6251614... | 0.6956083 | 1 |
A constructor that requires both the IP address of the machine to communicate with as well as the secret (string) needed to perform communication. AppControllers will reject SOAP calls if this secret (basically a password) is not present it can be found in the user's .appscale directory, and a helper method is usually ... | def initialize(ip, secret)
@ip = ip
@secret = secret
@conn = SOAP::RPC::Driver.new("https://#{@ip}:17443")
@conn.add_method("set_parameters", "djinn_locations", "database_credentials", "app_names", "secret")
@conn.add_method("set_apps", "app_names", "secret")
@conn.add_method("set_apps_to_r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(params)\n @ip_address = params[:ip_address]\n @port = params[:port]\n @keystone = params[:keystone]\n end",
"def initialize(user, password, application_name, host=\"192.168.0.8\", port=3790, mode='multiUser')\n @user = user\n @password = password\n @application_name = appl... | [
"0.66503626",
"0.65358144",
"0.6535395",
"0.6480533",
"0.64308",
"0.6396983",
"0.6384762",
"0.63621587",
"0.6292732",
"0.62678444",
"0.62308407",
"0.62217575",
"0.6219481",
"0.62122536",
"0.62012225",
"0.61954975",
"0.6175477",
"0.61457026",
"0.6129223",
"0.61158544",
"0.6096... | 0.6999236 | 0 |
Provides automatic retry logic for transient SOAP errors. Args: time: A Fixnum that indicates how long the timeout should be set to when executing the caller's block. retry_on_except: A boolean that indicates if nontransient Exceptions should result in the caller's block being retried or not. callr: A String that names... | def make_call(time, retry_on_except, callr)
refused_count = 0
max = 5
begin
Timeout::timeout(time) {
yield if block_given?
}
rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH
if refused_count > max
raise FailedNodeException.new("Connection was refused. Is the " +
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_call(time, retry_on_except)\n begin\n Timeout::timeout(time) {\n yield if block_given?\n }\n rescue Errno::ECONNREFUSED\n if retry_on_except\n retry\n else\n abort(\"Connection was refused. Is the AppController running?\")\n end\n rescue OpenSSL::SSL:... | [
"0.7141372",
"0.7072266",
"0.61995095",
"0.61632055",
"0.5999939",
"0.5973251",
"0.5835871",
"0.5751888",
"0.5729174",
"0.56570053",
"0.56415325",
"0.55510527",
"0.54901165",
"0.54878",
"0.5485897",
"0.5440209",
"0.54388845",
"0.5421436",
"0.53913474",
"0.5365222",
"0.5322838... | 0.7846086 | 0 |
Tells an AppController that it needs to restart one or more Google App Engine applications. Args: app_names: An Array of Strings, where each String is an appid corresponding to an application that needs to be restarted. | def set_apps_to_restart(app_names)
make_call(NO_TIMEOUT, RETRY_ON_FAIL, "set_apps_to_restart") {
@conn.set_apps_to_restart(app_names, @secret)
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def restart_appengine_apps\n # use a copy of @apps_to_restart here since we delete from it in\n # setup_appengine_application\n apps = @apps_to_restart\n apps.each { |app_name|\n if !my_node.is_login? # this node has the new app - don't erase it here\n Djinn.log_info(\"Removing old version... | [
"0.7103693",
"0.638339",
"0.63114",
"0.6247003",
"0.60410404",
"0.5946801",
"0.5723514",
"0.57176965",
"0.5648942",
"0.55736613",
"0.5540254",
"0.54087836",
"0.53502554",
"0.53469425",
"0.5303953",
"0.5221235",
"0.5207263",
"0.5165295",
"0.5155961",
"0.5124913",
"0.5098495",
... | 0.8250547 | 0 |
Tells an AppController to no longer route HAProxy traffic to the given location. Args: app_id: A String that identifies the application that runs the AppServer to remove. ip: A String that identifies the private IP address where the AppServer to remove runs. port: A Fixnum that identifies the port where the AppServer w... | def remove_appserver_from_haproxy(app_id, ip, port)
make_call(NO_TIMEOUT, RETRY_ON_FAIL, "remove_appserver_from_haproxy") {
@conn.remove_appserver_from_haproxy(app_id, ip, port, @secret)
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_appserver_from_haproxy(app_id, ip, port, secret)\n if !valid_secret?(secret)\n return BAD_SECRET_MSG\n end\n\n if !my_node.is_login?\n return NO_HAPROXY_PRESENT\n end\n\n Djinn.log_debug(\"Removing AppServer for app #{app_id} at #{ip}:#{port}\")\n get_scaling_info_for_app(app... | [
"0.8289475",
"0.7399267",
"0.5790702",
"0.5787291",
"0.57453823",
"0.5711031",
"0.5699406",
"0.5597189",
"0.55916697",
"0.5579129",
"0.5542733",
"0.53383416",
"0.5310369",
"0.5241229",
"0.52137506",
"0.5170206",
"0.51689225",
"0.5160986",
"0.514857",
"0.51254684",
"0.5103936"... | 0.75486976 | 1 |
creates a audit log record instance that each method model will use | def initialize_audit_log
# only save logs for POST,PUT,PATCH and DELETE methods
# creates
if (request.post? || request.patch? || request.put? || request.delete? )
@audit_log = AuditLog.new
@audit_log.ip = request.remote_ip
@audit_log.user_name = current_user.full_name
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def audit_log\n AuditLog.new(space_id, store_id)\n end",
"def build_created_audit(rec, eh)\n build_audit_payload(rec, eh[:new], nil, \"#{rec.class.to_s.downcase}_record_add\", \"Record created\")\n end",
"def log_create\n if self.class.name == 'ParticipantsSportEntry'\n model = self.sport_e... | [
"0.7297494",
"0.70551753",
"0.7006811",
"0.68369746",
"0.6808096",
"0.6797971",
"0.6742281",
"0.67354566",
"0.6696821",
"0.6581385",
"0.6576137",
"0.6565416",
"0.6540325",
"0.652979",
"0.64371985",
"0.63804054",
"0.63773644",
"0.63701457",
"0.63411784",
"0.63338846",
"0.63052... | 0.707178 | 1 |
saves the initialzied audit log | def save_audit_log
if (@audit_log && @audit_log.auditable)
if ["update","destroy"].include?(action_name)
update_and_destroy_audit
elsif action_name == "create"
create_audit
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_with_auditing\n with_auditing { save }\n end",
"def initialize_audit_log\n # only save logs for POST,PUT,PATCH and DELETE methods\n # creates\n if (request.post? || request.patch? || request.put? || request.delete? )\n @audit_log = AuditLog.new\n @audit_log.ip = request.re... | [
"0.6781204",
"0.6777003",
"0.65401375",
"0.65389395",
"0.6495411",
"0.6422484",
"0.6408047",
"0.6390071",
"0.636754",
"0.6296661",
"0.6294444",
"0.62675506",
"0.6263227",
"0.6200449",
"0.6181618",
"0.6155426",
"0.6144565",
"0.6141821",
"0.6105673",
"0.60847324",
"0.607508",
... | 0.7843606 | 0 |
Parse locations of chunks Offset: bytes 0 2 Sectors: byte 3 Empty offset, is an empty chunk | def locations
@locations ||= bytes(L_BYTES).each_slice(4).map do |loc_bytes|
{
offset: ByteArray.to_i(loc_bytes[0..2]),
sector_count: loc_bytes[3]
}
end.reject{ |l| l[:offset] == 0 }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_line_and_column_from_chunk(offset)\n if offset.zero?\n return [@chunk_line, @chunk_column]\n end\n\n string =\n offset >= @chunk.size ? @chunk : @chunk[0..offset-1]\n\n line_count = string.count(\"\\n\")\n\n column = @chunk_column\n if line_count > 0\n lines = string.split(... | [
"0.606822",
"0.5671967",
"0.5565513",
"0.5539293",
"0.54782075",
"0.546624",
"0.5439181",
"0.54218227",
"0.5415949",
"0.5408346",
"0.5375469",
"0.53612405",
"0.53612405",
"0.5359969",
"0.53538597",
"0.5352803",
"0.53192264",
"0.53177345",
"0.5305644",
"0.5294771",
"0.5294771"... | 0.66109675 | 0 |
Timestamps are 4 bytes read with Timeat | def timestamps
@timestamps ||= bytes[T_BYTES].each_slice(4).map do |t_bytes|
ByteArray.to_i(t_bytes)
end.reject{ |t| t == 0 }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timestamp(time)\n date = @file[/(\\w+ \\d+, \\d+)/]\n ASF::Board::TIMEZONE.parse(\"#{date} #{time}\").to_i * 1000\n end",
"def load_timestamp(fname)\n stamps = []\n File.open(fname).read().each_line do |line|\n parsed = line.strip().split() \n stamps << [parsed[2].to_f, parsed[3].to_f, parsed[... | [
"0.646188",
"0.6248137",
"0.6183079",
"0.6069663",
"0.59347457",
"0.59249425",
"0.58973867",
"0.5881721",
"0.588112",
"0.587202",
"0.5859514",
"0.5834923",
"0.5815452",
"0.5792059",
"0.5770045",
"0.57601553",
"0.57601553",
"0.57601553",
"0.57601553",
"0.57601553",
"0.57601553... | 0.74335706 | 0 |
////////////////////////////////////////////////////////////////////////// Properties ////////////////////////////////////////////////////////////////////////// Get icon_index of the element GET | def icon_index()
return CORE_CONFIG::ELEMENT_ICONS[self.id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def icon\n self.number\n end",
"def icon_index(item)\n return $data_items[item.item_id].icon_index if item.item?\n return ($data_items.find { |i| !i.nil? && i.subtype_id == item.category_id}).icon_index if item.category?\n end",
"def icon_index(level = @skl_level)\n return @skl_levelcache[level][... | [
"0.7523847",
"0.7255705",
"0.72204465",
"0.7114549",
"0.70309913",
"0.701399",
"0.68072164",
"0.6746772",
"0.66348696",
"0.6561145",
"0.6408674",
"0.6346601",
"0.63315576",
"0.63032377",
"0.6242245",
"0.61814386",
"0.6108079",
"0.60693747",
"0.60654444",
"0.6059303",
"0.60317... | 0.8290366 | 0 |
Allows for purchasing a product. Creates a new transaction with the proper data if the product is in stock. Takes a product and a date argument. The date can be passed as string "20160525" or as a date value type. The date defaults to today's date. | def purchase(product, date = Date.today)
date = date.is_a?(String) ? Date.parse(date) : date
if product.in_stock?
Transaction.new(self, product, date)
else
raise OutOfStockError, "'#{product.title}' is out of stock."
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def purchase(product)\n \t\tif product.in_stock?\n \t\t\tTransaction.new(self, product)\n \t\telse\n \t\t\traise OutOfStockError, \"#{product.title} is out of stock\"\n \t\tend\n \tend",
"def create_cart_product_for_new_product(product)\n cp = cart_products.create\n cp.product = product\n cp.quant... | [
"0.7721127",
"0.6255211",
"0.6175181",
"0.6087245",
"0.5956929",
"0.59548867",
"0.58961296",
"0.58674425",
"0.5854622",
"0.585424",
"0.5722002",
"0.5697451",
"0.56728494",
"0.56639904",
"0.5653883",
"0.56465626",
"0.56376",
"0.5628084",
"0.56279325",
"0.56273425",
"0.5623776"... | 0.8818048 | 0 |
Allows for returning a product. Checks if a transaction has been made in the store. It takes a product and a defect argument. The defect argument if true signals that the product bought has a defect. | def return_product(product, defect = false)
if Transaction.find_by(customer: self, product: product).empty?
raise NotRecordedTransactionError, "There was no such transaction recorded."
else
ProductReturn.new(self, product, defect)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def purchase(product)\n \t\tif product.in_stock?\n \t\t\tTransaction.new(self, product)\n \t\telse\n \t\t\traise OutOfStockError, \"#{product.title} is out of stock\"\n \t\tend\n \tend",
"def determine_valid_product(product)\n valid = true\n if @products.has_key?(product)\n valid\n else\n ... | [
"0.6345241",
"0.62344027",
"0.6205176",
"0.6150152",
"0.6091521",
"0.6077948",
"0.6050113",
"0.5984292",
"0.5981422",
"0.59573865",
"0.59494066",
"0.5923946",
"0.59215933",
"0.5913597",
"0.5913597",
"0.5908349",
"0.58826417",
"0.5873261",
"0.5870277",
"0.5859097",
"0.582599",... | 0.8138255 | 0 |
=begin This method checks if a user thumbed up this comment before Inputs: user who we want to check if he upped or not. Output: boolean true or false Author: Menisy =end | def upped_by_user?(user)
up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # get the up that a user gave to this comment before "if exists"
!up.nil? # if up is nil then return false if not then return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def downed_by_user?(user)\n down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) # get the down that a user gave to this comment before \"if exists\"\n !down.nil? # if down is nil then return false if not then return true\n end",
"def up_comment(user)\n upped_before = self.upped_by_user?(... | [
"0.7199514",
"0.707595",
"0.653329",
"0.6292011",
"0.6243375",
"0.6200053",
"0.61881196",
"0.6110206",
"0.6005291",
"0.5989424",
"0.5957557",
"0.59369016",
"0.59129316",
"0.59000254",
"0.58777636",
"0.5843153",
"0.58414036",
"0.58069694",
"0.58015496",
"0.57767844",
"0.575156... | 0.7711889 | 0 |
=begin This method checks if a user thumbed down this comment before Inputs: user who we want to check if he upped or not. Output: boolean true or false Author: Menisy =end | def downed_by_user?(user)
down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) # get the down that a user gave to this comment before "if exists"
!down.nil? # if down is nil then return false if not then return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upped_by_user?(user)\n up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # get the up that a user gave to this comment before \"if exists\"\n !up.nil? # if up is nil then return false if not then return true\n end",
"def up_comment(user)\n upped_before = self.upped_by_user?(user)\n ... | [
"0.7538691",
"0.69439965",
"0.6871517",
"0.62694585",
"0.61994",
"0.61727524",
"0.5876259",
"0.58750856",
"0.5789535",
"0.57670224",
"0.5731327",
"0.5716213",
"0.5642832",
"0.56402373",
"0.5636984",
"0.5636606",
"0.5629734",
"0.5592459",
"0.5584061",
"0.55372924",
"0.5511598"... | 0.7611069 | 0 |
=begin Returns number of ups for a comment Inputs: none Output: int number of ups Author: Menisy =end | def get_num_ups
ups = self.comment_up_downs.find_all_by_action(1).size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_comment_score(c)\n upcount = (c['up'] ? c['up'].length : 0)\n downcount = (c['down'] ? c['down'].length : 0)\n upcount-downcount\nend",
"def get_num_downs\n downs = self.comment_up_downs.find_all_by_action(2).size\n end",
"def increment_num_comments\n\n end",
"def compute_comment_sc... | [
"0.6960234",
"0.69509375",
"0.6933406",
"0.6806268",
"0.66469365",
"0.6492806",
"0.640031",
"0.62952965",
"0.62896365",
"0.62858915",
"0.619988",
"0.616674",
"0.6156696",
"0.6102019",
"0.61011696",
"0.60990554",
"0.60990554",
"0.60471517",
"0.5991153",
"0.5976966",
"0.5916078... | 0.77432495 | 0 |
=begin Returns number of downs for a comment Inputs: none Output: int number of downs Author: Menisy =end | def get_num_downs
downs = self.comment_up_downs.find_all_by_action(2).size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_num_ups\n ups = self.comment_up_downs.find_all_by_action(1).size\n end",
"def compute_comment_score(c)\n upcount = (c['up'] ? c['up'].length : 0)\n downcount = (c['down'] ? c['down'].length : 0)\n upcount-downcount\nend",
"def compute_comment_score(c)\n upcount = (c['up'] ? c['up'].... | [
"0.7143779",
"0.70730305",
"0.7051696",
"0.68160594",
"0.6667954",
"0.6358727",
"0.62098014",
"0.6004241",
"0.59985244",
"0.5978681",
"0.59504306",
"0.59256",
"0.59256",
"0.5914564",
"0.58918214",
"0.5891177",
"0.5890678",
"0.58732986",
"0.58191663",
"0.5803583",
"0.57873106"... | 0.78357047 | 0 |
=begin Ups a comment. Input: user who is upping the comment. Output: boolean indicating success or failure Author: Menisy =end | def up_comment(user)
upped_before = self.upped_by_user?(user)
downed_before = self.downed_by_user?(user)
if !upped_before && !downed_before then #if user never upped or downed the comment then up it
up = CommentUpDown.new(:action => 1)
up.comment = self
up.user = user
up.save
u... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upped_by_user?(user)\n up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # get the up that a user gave to this comment before \"if exists\"\n !up.nil? # if up is nil then return false if not then return true\n end",
"def upcomment\n comm = Comment.find_by_id(params[:id])\n if !com... | [
"0.64954954",
"0.61798835",
"0.61450386",
"0.61450386",
"0.6125262",
"0.5901997",
"0.59014744",
"0.5804496",
"0.5791708",
"0.5778875",
"0.57758504",
"0.57027066",
"0.56988496",
"0.5698222",
"0.56838405",
"0.56787574",
"0.56494707",
"0.56389534",
"0.56368935",
"0.5634246",
"0.... | 0.63475513 | 1 |
=begin Downs a comment. Input: user who is downing the comment. Output: boolean indicating success or failure Author: Menisy =end | def down_comment(user)
upped_before = self.upped_by_user?(user)
downed_before = self.downed_by_user?(user)
if !upped_before && !downed_before then #if user never upped or downed the comment then up it
down = CommentUpDown.new(:action => 2)
down.comment = self
down.user = user
down.sa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def downed_by_user?(user)\n down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) # get the down that a user gave to this comment before \"if exists\"\n !down.nil? # if down is nil then return false if not then return true\n end",
"def downcomment\n comm = Comment.find_by_id(params[:id])\n... | [
"0.72441554",
"0.7017349",
"0.6250808",
"0.6222246",
"0.58906364",
"0.5852679",
"0.5828789",
"0.5695721",
"0.5638064",
"0.5624087",
"0.55421865",
"0.55421865",
"0.55078185",
"0.5454527",
"0.54468954",
"0.5445814",
"0.5431789",
"0.54209906",
"0.5407877",
"0.5404402",
"0.540270... | 0.7527961 | 0 |
=begin Description: This story is mainly used in the notification system to summarize the content of the comment to fit within a certain length input: char_num:Int which is the number of chars it will be summarized to output: String > The summarized String Author: Kiro =end | def summarize_content (char_num)
if self.content.length <= char_num
return self.content
else return self.content[0..(char_num-1)] + "..."
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def comment_length\n\t120\nend",
"def description_complexity(pr)\n pull_req = pull_req_entry(pr[:id])\n (pull_req['title'] + ' ' + pull_req['body']).gsub(/[\\n\\r]\\s+/, ' ').split(/\\s+/).size\n end",
"def description_from_string(str)\n len = 12\n return str unless str.length > len\n ... | [
"0.70011026",
"0.6411546",
"0.63406503",
"0.6306612",
"0.61043483",
"0.607377",
"0.6041252",
"0.6026639",
"0.60241747",
"0.60133034",
"0.5949859",
"0.59486544",
"0.59285885",
"0.5905003",
"0.590407",
"0.5899543",
"0.5890872",
"0.5882059",
"0.5857261",
"0.58479726",
"0.58358",... | 0.77979815 | 0 |
Field assigments Assigns the tweet's fields from a Twitter status object Returns the tweet record without saving it and persisting the changes to the database | def assign_fields(status)
self.text = expand_urls(status.text, status.urls)
self.in_reply_to_user_id = status.in_reply_to_user_id
self.in_reply_to_status_id = status.in_reply_to_status_id
self.source = status.source
self.lang = status.lang
self.retweet_count = status.retweet_count
self.favor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_to_database(t, i)\n created_at = DateTime.strptime(t['created_at'], '%a %b %d %H:%M:%S %z %Y')\n # get rid of annoying Asian characters\n location = t['user']['location']#.gsub(/[^\\p{Latin}\\/ \\-,]/, '')\n\n begin\n # if the object contains latitude and longitude and retweeted status\n if t['co... | [
"0.5984665",
"0.57777435",
"0.5751553",
"0.56884736",
"0.55796427",
"0.55776656",
"0.55295026",
"0.5526155",
"0.5499975",
"0.5488875",
"0.54535866",
"0.5430363",
"0.5409972",
"0.53913707",
"0.5380252",
"0.5376062",
"0.5368158",
"0.5348213",
"0.5313817",
"0.5303217",
"0.530129... | 0.68355423 | 1 |
Assigns a certain workflow state given a symbol or string Knows about a whitelist of valid states | def assign_state(state)
state &&= state.try(:to_sym)
raise "Unknown state: #{ state }" unless Tweet.available_states.include?(state)
case state
when :conversation then self.state ||= state # do not override existing states with :conversation state
else self.state = state
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_to_state(s)\n case s.to_sym\n when :pending\n register if passive?\n when :active\n activate if pending? || deleted?\n unsuspend if suspended?\n when :suspended\n suspend if passive? || pending? || active?\n when :deleted\n delete if passive? || pending? || active? ... | [
"0.6481978",
"0.64131534",
"0.63184446",
"0.62278825",
"0.60918456",
"0.604355",
"0.6011745",
"0.59891486",
"0.59716976",
"0.59408146",
"0.5933534",
"0.5921859",
"0.5919237",
"0.5900503",
"0.58076984",
"0.57849354",
"0.5759678",
"0.5756897",
"0.5755993",
"0.57469743",
"0.5724... | 0.658227 | 0 |
Implement an instance method in your Ingredient class that helps check whether an ingredient is valid (i.e., contains only the ingredient names above)? | def allowed_ingredients
SAFE_INGREDIENTS.include?(name.downcase)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_ingredient?(ingredient_name)\n ingredient_names.include?(ingredient_name)\n end",
"def must_have_at_least_one_ingredient\n errors.add(:ingredients, \"must exist!\") if self.ingredients.empty?\n end",
"def strict_matching(ingredient_name,item)\n return item.downcase.include?(ingredient_na... | [
"0.6767781",
"0.6306675",
"0.6278676",
"0.6172744",
"0.61275464",
"0.611898",
"0.61106807",
"0.6100629",
"0.60225934",
"0.59977853",
"0.5893108",
"0.58866984",
"0.5877923",
"0.5819596",
"0.5810549",
"0.58058375",
"0.58023393",
"0.57733536",
"0.5744651",
"0.57437634",
"0.57387... | 0.7081761 | 0 |
get the document an allowable privacy object for the document according to the db_tag raise if it is an invalid db_tag | def get_privacy db_tag
privacy_obj = privacy_objects.find{|p| p.db_tag == db_tag}
raise unless privacy_obj
return privacy_obj
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_privacy db_tag\r\n privacy_obj = privacy_objects.find{|p| p.db_tag == db_tag}\r\n raise unless privacy_obj\r\n self.update_attribute(\"privacy\",privacy_obj.db_tag)\r\n return privacy_obj\r\n end",
"def document_auth doc_id=nil\n doc_id ||= params[:doc]\n doc_id = doc_id.d... | [
"0.7015408",
"0.57167286",
"0.5583481",
"0.55200374",
"0.5388634",
"0.5336983",
"0.53242034",
"0.52800137",
"0.5251779",
"0.51859087",
"0.5156365",
"0.51321447",
"0.512183",
"0.5118841",
"0.5115315",
"0.5111158",
"0.50635034",
"0.50543433",
"0.5051888",
"0.50420666",
"0.50346... | 0.8157782 | 0 |
set the document privacy according to the db_tag raise if it is an invalid db_tag | def set_privacy db_tag
privacy_obj = privacy_objects.find{|p| p.db_tag == db_tag}
raise unless privacy_obj
self.update_attribute("privacy",privacy_obj.db_tag)
return privacy_obj
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_privacy db_tag\r\n privacy_obj = privacy_objects.find{|p| p.db_tag == db_tag}\r\n raise unless privacy_obj\r\n return privacy_obj \r\n end",
"def propagate_privacy\n return unless name_tag\n name_tag.is_global = List.exists? name_tag_id: name_tag_id, availability: [0,1]\n name... | [
"0.6345327",
"0.5905161",
"0.55838084",
"0.55792767",
"0.54093903",
"0.53289783",
"0.52577215",
"0.5215325",
"0.52100235",
"0.5175946",
"0.5159295",
"0.5102317",
"0.5069592",
"0.49712023",
"0.49712023",
"0.49661666",
"0.4869075",
"0.48646545",
"0.48379436",
"0.48318478",
"0.4... | 0.8162818 | 0 |
PATCH/PUT /subscriptions/1 PATCH/PUT /subscriptions/1.json | def update
@subscription = Subscription.find(params[:id])
if @subscription.update(subscription_params)
head :no_content
else
render json: @subscription.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @subscription = Subscription.get(params[:id])\n @subscription.update(params[:subscription])\n respond_with(@subscription.reload)\n end",
"def update\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(par... | [
"0.7237877",
"0.71868026",
"0.7146975",
"0.7088031",
"0.70832556",
"0.7082959",
"0.70335835",
"0.7015554",
"0.7015554",
"0.7015554",
"0.69606966",
"0.6954959",
"0.6939982",
"0.6907186",
"0.6907186",
"0.6896157",
"0.6876353",
"0.68551904",
"0.68187803",
"0.67266816",
"0.672580... | 0.71870714 | 1 |
Return the vCloud data associated with vAppTemplate | def vcloud_attributes
Vcloud::Core::Fog::ServiceInterface.new.get_vapp_template(id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_vapp_template(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vAppTemplate/vappTemplate-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VAppTemplate').first\n if vapp_node\n n... | [
"0.71081287",
"0.70635027",
"0.6211215",
"0.6018454",
"0.59863305",
"0.59576523",
"0.58353865",
"0.5812524",
"0.5775796",
"0.5667276",
"0.56505835",
"0.5600491",
"0.5588983",
"0.5534086",
"0.55229366",
"0.551654",
"0.547936",
"0.5463351",
"0.5443816",
"0.5424494",
"0.53998023... | 0.7795347 | 0 |
stop_data contains any information we need for creating new stops. e.g. city id's stop time and ticket price | def update(stop_data)
@color = stop_data.fetch(:color, @color)
DB.exec("UPDATE trains SET color = '#{@color}' WHERE id = #{@id};")
times = stop_data.fetch(:times, [])
stop_data.fetch(:city_ids, []).each_with_index do |city_id, index|
DB.exec("INSERT INTO stops (train_id, city_id, time) VALUES (#{@... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(stop_data)\n @name = stop_data.fetch(:name, @name)\n DB.exec(\"UPDATE cities SET name = '#{@name}' WHERE id = #{@id};\")\n times = stop_data.fetch(:times, [])\n stop_data.fetch(:train_ids, []).each_with_index do |train_id, index|\n DB.exec(\"INSERT INTO stops (city_id, train_id, time) V... | [
"0.6656736",
"0.650241",
"0.6382034",
"0.62685996",
"0.6268304",
"0.6213005",
"0.6146444",
"0.61268073",
"0.61259097",
"0.60939354",
"0.60435146",
"0.60259885",
"0.60218275",
"0.5953063",
"0.5927397",
"0.59246105",
"0.59229445",
"0.59229445",
"0.59097373",
"0.59014356",
"0.58... | 0.6591327 | 1 |
input = two arguments, a positive integer representing salary, and a boolean output = an integer representing bonus for salary rules: if boolean == true, bonus is half of salary if boolean == false, bonus is 0 test cases: what if salary is 0 and boolean is true? what if salary is an odd number, should integer or float ... | def calculate_bonus(salary, boolean)
boolean ? (salary.to_f / 2) : 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_bonus(salary, boolean)\n return salary / 2 if boolean == true \n return 0 if boolean == false\nend",
"def calculate_bonus(salary, boolean)\n boolean ? (salary/2.0) : 0\nend",
"def calculate_bonus(salary,boolean)\n \n if boolean == true\n return (salary / 2) \n else\n return 0\n end\... | [
"0.91724765",
"0.9143219",
"0.9095274",
"0.90872914",
"0.9069101",
"0.89350736",
"0.89265174",
"0.8810697",
"0.8810228",
"0.86985445",
"0.85585463",
"0.8485025",
"0.8485025",
"0.8485025",
"0.8485025",
"0.8485025",
"0.84756905",
"0.84292835",
"0.84292835",
"0.84292835",
"0.842... | 0.91687465 | 1 |
GET /roster_squares/1/edit edit the behavior squares available to a student | def edit
@roster_square = RosterSquare.new
@roster_squares = RosterSquare.all
@student = Student.find_by_id(params[:id])
@student_squares = RosterSquare.where(student_id: @student.id)
@not_student_squares = []
#Set the squares for the specific school
@school_squares = Square.where(school_i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_roster_square\n #Sets the edit page to the specified student\n @roster_squares = RosterSquare.all\n @student = Student.find(params[:id])\n end",
"def edit\n respond_with(@sicoss_location)\n end",
"def edit\n respond_with(@sicoss_situation)\n end",
"def edit\n board_games\... | [
"0.7591398",
"0.6604159",
"0.64801496",
"0.64296114",
"0.6410641",
"0.6361647",
"0.63563746",
"0.6353334",
"0.6278119",
"0.6259901",
"0.6250012",
"0.62411696",
"0.6158141",
"0.61566734",
"0.6146029",
"0.6146029",
"0.61211026",
"0.61089665",
"0.6098568",
"0.6098052",
"0.605273... | 0.7454045 | 1 |
Checks if the square is used for the specific student. Unused at the moment | def is_student_square(square)
@is_square = false
@student_squares.each do |student_square|
if square.id == student_square.square_id
@is_square = true
break
end
if @is_square != true
@is_square = false
end
end
if @is_square == false
@no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isSquare()\n\n truth = (@rowSize == @colSize) ? true : false\n truth\n\n end",
"def square_available?(square)\n board.values.include?(square)\n end",
"def square?()\n return (@height == @width) & (@type == \"rectangle\")\n end",
"def valid_square?(pos)\n y, x = pos\n y.between?(0... | [
"0.65709186",
"0.6449969",
"0.6416244",
"0.6334376",
"0.63267237",
"0.6305692",
"0.62639636",
"0.6201371",
"0.6155469",
"0.6153109",
"0.61430776",
"0.61420405",
"0.6140051",
"0.612233",
"0.60141087",
"0.5997237",
"0.59910303",
"0.598717",
"0.59691674",
"0.5961965",
"0.5955282... | 0.8055263 | 0 |
Get an Array of all scripts that have been imported into the Plot. | def imported_scripts
@imported_scripts ||= []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scripts\n @parts.values.map(&:script).compact\n end",
"def list_all_scripts\n scripts = []\n\n Hook.hooks(event_instance.class).each_value do |klass|\n scripts.concat(list_scripts(klass))\n end\n\n scripts\n end",
"def scripts\n @scripts\n end",
"def scripts\n ... | [
"0.74343014",
"0.7068649",
"0.690905",
"0.68276185",
"0.6801287",
"0.6754027",
"0.6659049",
"0.64578724",
"0.6320397",
"0.6320397",
"0.62072533",
"0.60786325",
"0.60341024",
"0.60105026",
"0.59371144",
"0.59022814",
"0.58862406",
"0.5868887",
"0.5866156",
"0.58411753",
"0.583... | 0.80782133 | 0 |
Get an Array of the Plot's current Syntaxes. | def syntaxes
playbook.syntaxes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_syntaxes\n uri = URI.parse(\"#{BASE_URL}/syntaxes\")\n response = JSON.parse(@client.get(uri).body)\n return response['syntaxes'].map { |obj| Pastee::Syntax.new(obj) } if response['success']\n\n throw_error(response)\n end",
"def syntax(tokens)\n tokens = expect(:\".syntax\", tokens)\n ... | [
"0.6616718",
"0.5914168",
"0.58122456",
"0.5598634",
"0.54084706",
"0.52474123",
"0.5245073",
"0.51947457",
"0.51875925",
"0.5181786",
"0.51713645",
"0.50887334",
"0.5070031",
"0.5057521",
"0.5021981",
"0.5012417",
"0.49847165",
"0.49529937",
"0.49337205",
"0.49230424",
"0.49... | 0.64173704 | 1 |
return => An Array of Squirrel instances | def squirrels
# self.nests # what are my nests?
self.nests.map do |nest| # Nest instance
nest.squirrel
end
# binding.pry
# [#<Nest>, #<Nest>, #<Nest>]
# ||
# \/
# [#<Squirrel>, #<Squirrel>, #<Squirrel>]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queries\n qrs = []\n self.each_query {|qr| qrs << qr }\n qrs\n end",
"def get_shelves\n shelves = [@shelf_ag, @shelf_hp, @shelf_qz]\n return shelves\n end",
"def all\n # Figure out the table's name from the class we're calling the method on.\n table_name = self.to_s.p... | [
"0.6476854",
"0.61224896",
"0.6083525",
"0.6074826",
"0.6042455",
"0.5914627",
"0.5872662",
"0.58673775",
"0.5865003",
"0.5857872",
"0.58548903",
"0.5803283",
"0.5802454",
"0.57944906",
"0.5774669",
"0.57738656",
"0.57335556",
"0.57330734",
"0.5725632",
"0.5669892",
"0.566045... | 0.7075513 | 0 |
PUT /job_requests/1 PUT /job_requests/1.json | def update
begin
@job_request = job_requests.find( params[ :id ] )
rescue ActiveRecord::RecordNotFound
@job_request = nil
end
respond_to do |format|
if @job_request && @job_request.update_attributes( params[ :job_request ] )
format.html { redirect_to root_path, notice: "Job Re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", {\"passed\" => success}.to_json, :content_type => :json\nend",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"d... | [
"0.7060899",
"0.701508",
"0.701508",
"0.701508",
"0.6841361",
"0.67931044",
"0.6441181",
"0.6381785",
"0.63714504",
"0.6276087",
"0.6202867",
"0.62005585",
"0.6125181",
"0.6124246",
"0.61224884",
"0.61198634",
"0.6106911",
"0.61025417",
"0.60993516",
"0.60967475",
"0.60869175... | 0.72622836 | 0 |
slurp CDS > Protein a.) common_data | def slurp_commondata(f)
var1=Hash.new
File.new(f,'r').each_line{|l|
l.chomp!
l.gsub!('"','')
cols= l.split(/\t/)
var1[cols[0]]=cols[1]
}
return var1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_refseq\n # prepare output files\n system(%Q[cut -f4 #{$prepare_dir}/refseq_genes_result.tsv | cut -c1-5 | sort | uniq > #{$prepare_dir}/refp_prefix_list.txt ]) # get exist prefix list of protein_id\n FileUtils.mkdir_p(\"#{$prepare_dir}/refp\") unless File.exist?(\"#{$prepare_dir}/refp\")\n refp_outpu... | [
"0.5410093",
"0.5275363",
"0.5234244",
"0.5195857",
"0.512016",
"0.5108919",
"0.510191",
"0.5046017",
"0.5037706",
"0.50304896",
"0.5027487",
"0.49786612",
"0.49605885",
"0.4947074",
"0.4940088",
"0.49292764",
"0.49202317",
"0.49107608",
"0.48956367",
"0.48707545",
"0.4839346... | 0.5986447 | 0 |
Takes a string as argument, and returns the first Todo object that matches the argument. Return nil if no todo is found. | def find_by_title(str)
self.each do |todo|
return todo if todo.title == str
end
nil
# select { |todo| todo.title == str }.first # alt from solution
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_by_title(string)\n @todos.each do |todo|\n return todo if (todo.title =~ /#{string}/)\n end\n nil\n end",
"def find_by_title(todo_title)\n select { |todo| todo.title == todo_title }.first\n end",
"def todo_with_substring(substring) \n issue_todo = @remaining_todos.detect{ ... | [
"0.73197424",
"0.7082518",
"0.5925521",
"0.57626754",
"0.574034",
"0.5645423",
"0.56425625",
"0.55725354",
"0.5558545",
"0.5493785",
"0.54746956",
"0.5443234",
"0.5440293",
"0.54157585",
"0.54141414",
"0.5403148",
"0.5372902",
"0.53702646",
"0.5351545",
"0.53336",
"0.5288524"... | 0.7316401 | 1 |
Takes a string as argument, and marks the first Todo object that matches the argument as done. | def mark_done(str)
todo = self.find_by_title(str)
todo.done! if todo
# find_by_title(str) && find_by_title(str).done! # alt from solution
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mark_done(string)\n @todos.each do |todo|\n todo.done! if (todo.title =~ /#{string}/)\n end\n end",
"def mark_todo\n puts \"Which todo have you finished?\"\n action = get_input.to_i\n arr_index = 0\n @todos.each do |x|\n if x[\"completed\"] == \"no\"\n arr_index = arr_inde... | [
"0.78871566",
"0.7128225",
"0.64186907",
"0.6344688",
"0.62784827",
"0.62169224",
"0.6200314",
"0.59818006",
"0.59785736",
"0.59520334",
"0.5876329",
"0.5861583",
"0.581879",
"0.57727945",
"0.57180214",
"0.5662999",
"0.56130207",
"0.5593954",
"0.55824095",
"0.55468065",
"0.55... | 0.8049822 | 0 |
Mark every todo as done | def mark_all_done
self.each { |todo| todo.done! }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def done!\n @todos.each {|todo| todo.done! }\n end",
"def mark_as_done(todo)\n @data_object.aff_to_do &= ~todo\n end",
"def mark_todo\n puts \"Which todo have you finished?\"\n action = get_input.to_i\n arr_index = 0\n @todos.each do |x|\n if x[\"completed\"] == \"no\"\n arr_ind... | [
"0.7927046",
"0.7835611",
"0.7511289",
"0.72529584",
"0.7136976",
"0.70940804",
"0.70915896",
"0.70643324",
"0.7044478",
"0.70238686",
"0.70120925",
"0.69323087",
"0.6931281",
"0.68638426",
"0.68568313",
"0.6724465",
"0.6660171",
"0.66105545",
"0.65963537",
"0.6596016",
"0.65... | 0.8608676 | 0 |
Move a +Tile+ on the +Map+. This movement action causes a chain reaction potentially moving (or killing) tiles down the map in that same direction. It does this by comparing each neighboring pair tile_1 > tile_2 tile_2 > tile_3 tile_3 > tile_4 And follows these rules empty tiles don't transfer movement enemies block en... | def move(tile, direction)
tiles = send(direction, tile)
move = []
tiles.each_cons(2) do |this, that|
break if this.empty?
# break move.clear if (tile == this) && this.enemy? && that.empty?
break move.clear if this.enemy? && that.enemy?
break move.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_if_needed\n positions.each {|dir, pos|\n t = tile_at(pos)\n if t\n @direction, @position = directions.invert[dir], pos\n # Update the image so that the user actually sees the bug\n # turning if it did.\n update_image\n t.on\n return ... | [
"0.66526705",
"0.66092914",
"0.6592572",
"0.65756977",
"0.6566913",
"0.6489996",
"0.6418296",
"0.6296263",
"0.62415653",
"0.6214329",
"0.6149912",
"0.61496544",
"0.6126512",
"0.61131924",
"0.61026967",
"0.6080054",
"0.60781395",
"0.6068451",
"0.60475737",
"0.604509",
"0.60049... | 0.7090508 | 0 |
show navbar date component | def show_header_date
I18n.localize(Date.today, format: :long)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_by_date\n @city = City.find(params[:city_id])\n @events = @city.events.show_by_date(params[:date])\n d = Date.parse(params[:date])\n @started_at = d\n @date = d\n\n add_breadcrumb @city.name, city_path( @city )\n add_breadcrumb d.strftime(\"%b. %e, %Y\"), \"/show-by-date/\" + d.strfti... | [
"0.6479346",
"0.6250476",
"0.62121177",
"0.6143302",
"0.6099917",
"0.6030608",
"0.5989627",
"0.59467703",
"0.58439547",
"0.58019143",
"0.5778906",
"0.5742497",
"0.5741989",
"0.5731145",
"0.56853014",
"0.56690234",
"0.56516856",
"0.5637627",
"0.5593742",
"0.5593128",
"0.559308... | 0.6390898 | 1 |
Select all the paragraphs from the body text which are actual paragraphs (ie not headings). It's probably not an entirely accurate algorithm, but I think it's good enough for extracting the first paragraph to use as an excerpt. | def article_paragraphs(article)
source = article.file_descriptor.read
body = source.split("---\n", 3).last
body.split(/\n{2,}/).select { |paragraph| paragraph !~ /^#/ }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_paragraphs(body)\n without_line_breaks = ignore_unnecessary_line_breaks body\n paragraphs = split_body_to_paragraphs without_line_breaks\n paragraphs = remove_blank_spaces paragraphs\n end",
"def paragraphs\n raw_content['blocks'].map { |x| x['text'] }\n rescue StandardError\n []\n end",... | [
"0.7406742",
"0.67261267",
"0.6710166",
"0.655919",
"0.6441846",
"0.6341218",
"0.63394237",
"0.6295219",
"0.62396485",
"0.6211436",
"0.6153675",
"0.615007",
"0.6016181",
"0.597451",
"0.593671",
"0.5908489",
"0.5899642",
"0.58964217",
"0.5891824",
"0.5866849",
"0.58635885",
... | 0.6773492 | 1 |
Gets the accessPackage property value. Access package containing this policy. Readonly. Supports $expand. | def access_package
return @access_package
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def access_package=(value)\n @access_package = value\n end",
"def access_package=(value)\n @access_package = value\n end",
"def access_packages\n return @access_packages\n end",
"def access_packages\n return @access_... | [
"0.72808987",
"0.72808987",
"0.6381779",
"0.6381779",
"0.63023806",
"0.63023806",
"0.6206695",
"0.5798183",
"0.57096916",
"0.50586104",
"0.49319774",
"0.49246022",
"0.4918219",
"0.4918219",
"0.49067923",
"0.49056503",
"0.48911703",
"0.48806414",
"0.48778886",
"0.48398876",
"0... | 0.78515923 | 1 |
Sets the accessPackage property value. Access package containing this policy. Readonly. Supports $expand. | def access_package=(value)
@access_package = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def access_packages=(value)\n @access_packages = value\n end",
"def access_packages=(value)\n @access_packages = value\n end",
"def access_package_assignment_approvals=(value)\n @access_package_assignment_approvals = value\n end",
... | [
"0.72447586",
"0.72447586",
"0.64238185",
"0.5963689",
"0.5963689",
"0.56943214",
"0.54830503",
"0.5214372",
"0.5178155",
"0.5079735",
"0.4995955",
"0.49955738",
"0.4914539",
"0.4914539",
"0.48534617",
"0.48534617",
"0.48534617",
"0.48534617",
"0.48534617",
"0.48534617",
"0.4... | 0.8118019 | 1 |
Gets the allowedTargetScope property value. Principals that can be assigned the access package through this policy. The possible values are: notSpecified, specificDirectoryUsers, specificConnectedOrganizationUsers, specificDirectoryServicePrincipals, allMemberUsers, allDirectoryUsers, allDirectoryServicePrincipals, all... | def allowed_target_scope
return @allowed_target_scope
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_target_scope=(value)\n @allowed_target_scope = value\n end",
"def policy_scope(target, options={})\n policy(target, options).scope\n end",
"def specific_allowed_targets\n return @specific_allowed_targets\n end",
"def authorization_scope_type... | [
"0.7413168",
"0.565327",
"0.5066602",
"0.49834818",
"0.48791662",
"0.4832463",
"0.4775261",
"0.46609005",
"0.4629174",
"0.46046853",
"0.4589094",
"0.45679033",
"0.45487618",
"0.45356905",
"0.4510491",
"0.45086253",
"0.44844607",
"0.44803149",
"0.44548732",
"0.4438318",
"0.441... | 0.7646298 | 0 |
Sets the allowedTargetScope property value. Principals that can be assigned the access package through this policy. The possible values are: notSpecified, specificDirectoryUsers, specificConnectedOrganizationUsers, specificDirectoryServicePrincipals, allMemberUsers, allDirectoryUsers, allDirectoryServicePrincipals, all... | def allowed_target_scope=(value)
@allowed_target_scope = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_target_scope\n return @allowed_target_scope\n end",
"def policy_scope(target, options={})\n policy(target, options).scope\n end",
"def apply_scopes_if_available(target_object) #:nodoc:\n respond_to?(:apply_scopes, true) ? apply_scopes(target_object) : target_obj... | [
"0.70541763",
"0.57116973",
"0.55637753",
"0.55198485",
"0.51172066",
"0.5087534",
"0.5087534",
"0.5087534",
"0.5087534",
"0.5087534",
"0.5087534",
"0.4944643",
"0.48839843",
"0.48804262",
"0.48154005",
"0.48098823",
"0.48083642",
"0.4790291",
"0.47869527",
"0.47424296",
"0.4... | 0.8244284 | 0 |
Gets the automaticRequestSettings property value. This property is only present for an auto assignment policy; if absent, this is a requestbased policy. | def automatic_request_settings
return @automatic_request_settings
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def automatic_request_settings=(value)\n @automatic_request_settings = value\n end",
"def automatic_user_consent_settings\n return @automatic_user_consent_settings\n end",
"def request_approval_settings\n return @request_approval_settings\n ... | [
"0.77007043",
"0.63104504",
"0.6288458",
"0.62032455",
"0.6085594",
"0.59338486",
"0.5910752",
"0.5715669",
"0.551615",
"0.5428545",
"0.53918755",
"0.5382438",
"0.5346777",
"0.53011143",
"0.52262855",
"0.512753",
"0.5082034",
"0.5025978",
"0.49699062",
"0.49638557",
"0.496385... | 0.83910197 | 0 |
Sets the automaticRequestSettings property value. This property is only present for an auto assignment policy; if absent, this is a requestbased policy. | def automatic_request_settings=(value)
@automatic_request_settings = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def automatic_request_settings\n return @automatic_request_settings\n end",
"def automatic_user_consent_settings=(value)\n @automatic_user_consent_settings = value\n end",
"def automatic_replies_setting=(value)\n @automatic_replies_setting = va... | [
"0.67025477",
"0.6361373",
"0.61569047",
"0.60746825",
"0.5946907",
"0.5942239",
"0.5506444",
"0.5435651",
"0.53962266",
"0.5353729",
"0.5124269",
"0.5030916",
"0.4955568",
"0.491338",
"0.48835823",
"0.48016283",
"0.47961512",
"0.47801524",
"0.4768167",
"0.47270432",
"0.47060... | 0.858434 | 0 |
Gets the catalog property value. Catalog of the access package containing this policy. Readonly. | def catalog
return @catalog
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def catalog=(value)\n @catalog = value\n end",
"def catalogs\n return @catalogs\n end",
"def catalog_type\n return @catalog_type\n end",
"def catalog\n puts \"library.catalog\"\n ap self.inspect\n end",
"def cata... | [
"0.6886362",
"0.6348108",
"0.62530214",
"0.60943",
"0.59707475",
"0.5828219",
"0.5828219",
"0.54213417",
"0.54213417",
"0.5409492",
"0.5382642",
"0.53472424",
"0.5221966",
"0.52041954",
"0.51092523",
"0.50759554",
"0.50553364",
"0.5006224",
"0.500295",
"0.500295",
"0.49893075... | 0.7106348 | 0 |
Sets the catalog property value. Catalog of the access package containing this policy. Readonly. | def catalog=(value)
@catalog = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def catalogs=(value)\n @catalogs = value\n end",
"def set_catalog\n @catalog = Catalog.find(params[:catalog_id])\n end",
"def set_catalog\n @catalog = Catalog.find(params[:id])\n end",
"def set_catalog\n @catalog = Catalog.find(params[:id])\n end",
"def set... | [
"0.6936077",
"0.6475803",
"0.642271",
"0.642271",
"0.63700366",
"0.62222606",
"0.6049683",
"0.6042137",
"0.6035421",
"0.60003555",
"0.5932964",
"0.5802521",
"0.57066476",
"0.56293386",
"0.549607",
"0.549607",
"0.53815085",
"0.53324425",
"0.53214383",
"0.53214383",
"0.5292925"... | 0.7956617 | 0 |
Gets the customExtensionStageSettings property value. The collection of stages when to execute one or more custom access package workflow extensions. Supports $expand. | def custom_extension_stage_settings
return @custom_extension_stage_settings
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def custom_extension_stage_settings=(value)\n @custom_extension_stage_settings = value\n end",
"def custom_workflow_extensions\n return @custom_workflow_extensions\n end",
"def custom_extension_stage_instance_detail\n return @custom_extension_s... | [
"0.71281826",
"0.57687587",
"0.5696145",
"0.565536",
"0.55297357",
"0.5125914",
"0.50607264",
"0.49756873",
"0.49669826",
"0.48470446",
"0.47110742",
"0.46430245",
"0.46310404",
"0.4630035",
"0.4630035",
"0.4630035",
"0.4608793",
"0.45643523",
"0.45600885",
"0.45335364",
"0.4... | 0.80594397 | 0 |
Sets the customExtensionStageSettings property value. The collection of stages when to execute one or more custom access package workflow extensions. Supports $expand. | def custom_extension_stage_settings=(value)
@custom_extension_stage_settings = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def custom_extension_stage_settings\n return @custom_extension_stage_settings\n end",
"def custom_workflow_extensions=(value)\n @custom_workflow_extensions = value\n end",
"def custom_extension_stage_instance_id=(value)\n @custom_extension_stag... | [
"0.66998315",
"0.638794",
"0.5124113",
"0.49520212",
"0.49162185",
"0.49162185",
"0.49162185",
"0.4872088",
"0.48630068",
"0.47883472",
"0.4732849",
"0.47153306",
"0.4654839",
"0.459281",
"0.45498553",
"0.45368066",
"0.45260113",
"0.4497987",
"0.44833574",
"0.44431505",
"0.44... | 0.7716308 | 0 |
Gets the expiration property value. The expiration date for assignments created in this policy. | def expiration
return @expiration
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expiration=(value)\n @expiration = value\n end",
"def expiration_date_time\n return @expiration_date_time\n end",
"def expiration_date_time\n return @expiration_date_time\n end",
"def expiration_date_time\n retur... | [
"0.7475697",
"0.74282974",
"0.74282974",
"0.74282974",
"0.74282974",
"0.74282974",
"0.74282974",
"0.7268263",
"0.721422",
"0.7117366",
"0.7078226",
"0.694817",
"0.69333786",
"0.6890828",
"0.68806505",
"0.6843641",
"0.6827719",
"0.6826211",
"0.6826211",
"0.6826211",
"0.6823118... | 0.7590961 | 0 |
Sets the expiration property value. The expiration date for assignments created in this policy. | def expiration=(value)
@expiration = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expiration=(expiration_date)\n unless self.new_record?\n logger.warn(\"Attempted to set expiration on existing record: access_token id=#{self.id}. Update ignored\")\n return\n end\n super(expiration_date)\n\n self.expired = expiration_date.nil? || (expiration_date == '') || expiration_dat... | [
"0.7450147",
"0.7269094",
"0.7269094",
"0.7269094",
"0.7269094",
"0.7269094",
"0.7269094",
"0.71587944",
"0.71504253",
"0.7139623",
"0.7079358",
"0.70657253",
"0.70072144",
"0.6945491",
"0.6865402",
"0.6853953",
"0.68402207",
"0.6744601",
"0.67100227",
"0.66930974",
"0.668508... | 0.8418747 | 0 |
Gets the modifiedDateTime property value. The Timestamp 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 modified_date_time
return @modified_date_time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modified_at\n @photo.updated.to_datetime.utc\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @... | [
"0.7203478",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.717537",
"0.71723247",
"0.7141531",
"0.69719416",
"0.6924966",
"0.6844074",
"0.6844074",
"0.6844074",
... | 0.7697877 | 1 |
Sets the modifiedDateTime property value. The Timestamp 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 modified_date_time=(value)
@modified_date_time = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n ... | [
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.7118067",
"0.700718",
"0.66480327",
"0.66480327",
"0.65516776",
"0.65516776",
"0.65516776",
"0.65422887"... | 0.7798356 | 1 |
Gets the questions property value. Questions that are posed to the requestor. | def questions
return @questions
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def questions=(value)\n @questions = value\n end",
"def questions\n @root.questions\n end",
"def questions\n @_questions ||= fetch_questions\n end",
"def questions\r\n return @questions \r\nend",
"def question\n self.question\n end",
"def answers\n ... | [
"0.7430519",
"0.66309375",
"0.6624312",
"0.6539379",
"0.64167684",
"0.64119095",
"0.63117385",
"0.6229876",
"0.6224637",
"0.62125176",
"0.6156245",
"0.6155125",
"0.6134332",
"0.61029404",
"0.60241115",
"0.59530973",
"0.5914879",
"0.58562684",
"0.58282465",
"0.58282465",
"0.58... | 0.7675316 | 0 |
Sets the questions property value. Questions that are posed to the requestor. | def questions=(value)
@questions = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def answers=(value)\n @answers = value\n end",
"def question=(value)\n @children['question'][:value] = value\n end",
"def question=(value)\n @children['question'][:value] = value\n end",
"def set_question\n @question = Question.find(params[\"ques... | [
"0.70386976",
"0.7014029",
"0.7014029",
"0.6030558",
"0.5925973",
"0.5925973",
"0.5925973",
"0.59027964",
"0.5902654",
"0.58851177",
"0.58496267",
"0.58392197",
"0.5828103",
"0.58253294",
"0.5820249",
"0.5820249",
"0.5820249",
"0.5820249",
"0.5820249",
"0.5820249",
"0.5820249... | 0.8678519 | 0 |
Gets the requestApprovalSettings property value. Specifies the settings for approval of requests for an access package assignment through this policy. For example, if approval is required for new requests. | def request_approval_settings
return @request_approval_settings
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_approval_settings=(value)\n @request_approval_settings = value\n end",
"def get_access_approval_settings request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body ... | [
"0.8051811",
"0.69303685",
"0.6435635",
"0.63760555",
"0.6246672",
"0.5903661",
"0.5872205",
"0.5865275",
"0.58333534",
"0.5704713",
"0.56319773",
"0.5566952",
"0.55030644",
"0.54560083",
"0.53921473",
"0.5290603",
"0.5276922",
"0.52046865",
"0.5179562",
"0.5135223",
"0.51351... | 0.78985685 | 1 |
Sets the requestApprovalSettings property value. Specifies the settings for approval of requests for an access package assignment through this policy. For example, if approval is required for new requests. | def request_approval_settings=(value)
@request_approval_settings = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_access_approval_settings request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_update_access_approval_settings_request request_pb\n query_string_para... | [
"0.6657894",
"0.6259991",
"0.61092204",
"0.5946931",
"0.59429383",
"0.59375066",
"0.5823624",
"0.5560329",
"0.53794026",
"0.5348856",
"0.5246192",
"0.5225701",
"0.5221783",
"0.5109287",
"0.50910115",
"0.5072751",
"0.50519526",
"0.5020044",
"0.49376327",
"0.49360403",
"0.49353... | 0.8034666 | 0 |
Gets the requestorSettings property value. Provides additional settings to select who can create a request for an access package assignment through this policy, and what they can include in their request. | def requestor_settings
return @requestor_settings
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def requestor_settings=(value)\n @requestor_settings = value\n end",
"def request_approval_settings\n return @request_approval_settings\n end",
"def request_approval_settings=(value)\n @request_approval_settings = value\n end",
"de... | [
"0.8177266",
"0.69143474",
"0.656335",
"0.64698523",
"0.63895756",
"0.63207036",
"0.600975",
"0.5777073",
"0.5724139",
"0.5673334",
"0.5620587",
"0.5620587",
"0.5609717",
"0.560598",
"0.5570528",
"0.5570528",
"0.55498683",
"0.5526068",
"0.5526068",
"0.549345",
"0.5478358",
... | 0.8397786 | 0 |
Sets the requestorSettings property value. Provides additional settings to select who can create a request for an access package assignment through this policy, and what they can include in their request. | def requestor_settings=(value)
@requestor_settings = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def requestor=(value)\n @requestor = value\n end",
"def requestor_settings\n return @requestor_settings\n end",
"def request_approval_settings=(value)\n @request_approval_settings = value\n end",
"def automatic_request_settings=(va... | [
"0.69491047",
"0.6694846",
"0.66472524",
"0.5910212",
"0.56414366",
"0.5528489",
"0.54736614",
"0.5290751",
"0.5210239",
"0.51855016",
"0.51855016",
"0.5182978",
"0.5164257",
"0.51500183",
"0.5109502",
"0.51059014",
"0.5095363",
"0.5013148",
"0.5003357",
"0.5002272",
"0.49849... | 0.8393434 | 0 |
Gets the reviewSettings property value. Settings for access reviews of assignments through this policy. | def review_settings
return @review_settings
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def review_settings=(value)\n @review_settings = value\n end",
"def get_review_generation_settings(account_id, v, opts = {})\n data, _status_code, _headers = get_review_generation_settings_with_http_info(account_id, v, opts)\n return data\n end",
"def settings\n ... | [
"0.7144041",
"0.56842154",
"0.56083494",
"0.56083494",
"0.5601404",
"0.5543098",
"0.54984236",
"0.54552794",
"0.5412952",
"0.5391258",
"0.5359631",
"0.5344572",
"0.5322947",
"0.53086245",
"0.52901113",
"0.5230328",
"0.51592904",
"0.51199985",
"0.5083028",
"0.5071174",
"0.5059... | 0.7801948 | 0 |
Sets the reviewSettings property value. Settings for access reviews of assignments through this policy. | def review_settings=(value)
@review_settings = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def review_set=(value)\n @review_set = value\n end",
"def update_review_generation_settings(account_id, v, review_generation_settings_request, opts = {})\n data, _status_code, _headers = update_review_generation_settings_with_http_info(account_id, v, review_generation_settings_requ... | [
"0.5615794",
"0.5519889",
"0.5505968",
"0.53927994",
"0.53927994",
"0.53349066",
"0.525815",
"0.525815",
"0.5209798",
"0.51535475",
"0.5094786",
"0.5083746",
"0.50653064",
"0.50643164",
"0.50643164",
"0.50643164",
"0.50643164",
"0.50643164",
"0.50643164",
"0.50643164",
"0.506... | 0.7529697 | 0 |
Gets the specificAllowedTargets property value. The principals that can be assigned access from an access package through this policy. | def specific_allowed_targets
return @specific_allowed_targets
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def specific_allowed_targets=(value)\n @specific_allowed_targets = value\n end",
"def allowed_target_scope\n return @allowed_target_scope\n end",
"def query_target_permission_set\n @attributes[:query_target_permission_set]\n end",
"def query_target_... | [
"0.6294513",
"0.5980861",
"0.55531824",
"0.5541049",
"0.5178076",
"0.50905323",
"0.5085866",
"0.5082821",
"0.5082263",
"0.5048445",
"0.50375015",
"0.50342625",
"0.5008593",
"0.49651688",
"0.49140137",
"0.49022925",
"0.49022925",
"0.48880875",
"0.48801762",
"0.48367324",
"0.48... | 0.7193956 | 0 |
Sets the specificAllowedTargets property value. The principals that can be assigned access from an access package through this policy. | def specific_allowed_targets=(value)
@specific_allowed_targets = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def specific_allowed_targets\n return @specific_allowed_targets\n end",
"def allowed_target_scope=(value)\n @allowed_target_scope = value\n end",
"def target_objects=(value)\n @target_objects = value\n end",
"def target_objects=(va... | [
"0.5994857",
"0.54671526",
"0.51062584",
"0.51062584",
"0.49750328",
"0.49081966",
"0.49081966",
"0.48718238",
"0.48024967",
"0.4786071",
"0.47721398",
"0.47691765",
"0.47506768",
"0.4747814",
"0.47474512",
"0.47301874",
"0.47243786",
"0.47059035",
"0.46632898",
"0.4642823",
... | 0.7185911 | 0 |
pins that are dropped | def dropped_pins
location = Location.new
location.name = params[:locations][:name]
location.description = ""
location.user_id = @current_user.id
location.trip_id = params[:locations][:trip_id]
location.coordinates = [params[:locations][:pin][1].to_f, params[:locations][:pin][0].to_f]
location.save!
@... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drops\n @drops\n end",
"def disconnect\n @pins.each { |n, p| p.close } if @pins\n @pins = {}\n super\n end",
"def pin_clear\n @pinmap.each { |pin_name, pin| pin.destroy }\n @pinmap.clear\n @patternpinindex.clear\n @patternorder.delete_if { true ... | [
"0.61977303",
"0.607159",
"0.5801572",
"0.5566668",
"0.5502558",
"0.5485826",
"0.5485507",
"0.5428434",
"0.53852636",
"0.53320086",
"0.53207254",
"0.5316393",
"0.52836984",
"0.5243039",
"0.52288467",
"0.52195853",
"0.52174443",
"0.5215813",
"0.5212699",
"0.5180796",
"0.517159... | 0.6105408 | 1 |
TL;DR: adds data layers between existing base layers. Stacks data layer on top of the last data layer and/or the first base layer found, and keeps any existing "top" base layers on top. | def copy_data_layers(origin_map, destination_map, user)
last_data = destination_map.layers.reverse.find(&:data_layer?)
order = if last_data
last_data.order + 1
else
first_base = destination_map.layers.find(&:base_layer?)
first_base ? ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def non_basemap_base_layers_for(visualization)\n base_layers = visualization.layers(:base)\n if base_layers.length > 0\n # Remove the basemap, which is always first\n base_layers.slice(1, visualization.layers(:base).length)\n .map do |layer|\n CartoDB:... | [
"0.5955297",
"0.5563202",
"0.5553294",
"0.55439633",
"0.53566885",
"0.53262013",
"0.5261436",
"0.52387744",
"0.5215683",
"0.5156324",
"0.51273966",
"0.5114609",
"0.5104246",
"0.50616765",
"0.50574696",
"0.50460875",
"0.50376344",
"0.5034433",
"0.49607298",
"0.49291694",
"0.49... | 0.5765683 | 1 |
Public: Getter. Gets all activities for a given board. | def activities
return @activities if @activities != nil && @activities.length > 0
@activities = []
self.board.cards.each do |card|
card.actions.each do |action|
member = Trello::Member.find(action.member_creator_id)
action_record = {action: action, member: member}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def activities\n return @activities\n end",
"def all_activities\n t = PublicActivity::Activity.arel_table\n PublicActivity::Activity.where(\n t[:trackable_id].eq(id).and(t[:trackable_type].eq(Classroom.to_s)).or(\n t[:recipient_i... | [
"0.692477",
"0.6535767",
"0.6513734",
"0.6493531",
"0.6484644",
"0.6429408",
"0.6264161",
"0.6185259",
"0.6172574",
"0.6142869",
"0.6103",
"0.59649736",
"0.5931967",
"0.5920747",
"0.591234",
"0.5886356",
"0.5856966",
"0.58530396",
"0.58500516",
"0.58106",
"0.5809421",
"0.57... | 0.75982445 | 0 |
POST /role_funcions POST /role_funcions.json | def create
@role_funcion = RoleFuncion.new(role_funcion_params)
respond_to do |format|
if @role_funcion.save
format.html { redirect_to @role_funcion }
format.json { render action: 'show', status: :created, location: @role_funcion }
else
format.html { render action: 'new' }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def role_funcion_params\n params.require(:role_funcion).permit(:role_id, :funcion_id, :funcions)\n end",
"def create\n abilities = []\n client_application = current_user.client_application_id.to_s\n @abilities = Role.get_method_names.sort\n @role = Role.new(role_params)\n params[:role][:ro... | [
"0.74267626",
"0.65071577",
"0.6487636",
"0.62072855",
"0.6137399",
"0.6070119",
"0.6011283",
"0.5988191",
"0.5950294",
"0.5867114",
"0.5830203",
"0.5821593",
"0.5800196",
"0.57921594",
"0.5776231",
"0.5707571",
"0.56972575",
"0.56824195",
"0.5676192",
"0.5632752",
"0.5618535... | 0.7447437 | 0 |
PATCH/PUT /role_funcions/1 PATCH/PUT /role_funcions/1.json | def update
respond_to do |format|
if @role_funcion.update(role_funcion_params)
format.html { redirect_to @role_funcion }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @role_funcion.errors, status: :unprocessable_ent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def UpdateRole params = {}\n \n APICall(path: 'custom_roles.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n if !grant_access(\"alter_roles\", current_user)\n head(403)\n end\n @role.user_id = current_user.id\n @role.start_point = false if !params[:... | [
"0.690492",
"0.68374765",
"0.6813389",
"0.66920257",
"0.6645745",
"0.66119397",
"0.66000706",
"0.6543117",
"0.6520068",
"0.6509679",
"0.6497725",
"0.64884764",
"0.64763564",
"0.6427757",
"0.6395278",
"0.6389816",
"0.63856095",
"0.63725626",
"0.6365653",
"0.6365653",
"0.636416... | 0.7766647 | 0 |
DELETE /role_funcions/1 DELETE /role_funcions/1.json | def destroy
@role_funcion.destroy
respond_to do |format|
format.html { redirect_to role_funcions_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_path }\n format.json { head :no_content }\n end\n end",
"def DeleteRole id\n \n APICall(path: \"custom_roles/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n @role... | [
"0.7129084",
"0.70189804",
"0.7010891",
"0.7004442",
"0.69502735",
"0.69491225",
"0.6949014",
"0.69430315",
"0.69271135",
"0.69168305",
"0.6910375",
"0.6874708",
"0.68575794",
"0.6843911",
"0.68059534",
"0.68025565",
"0.68025565",
"0.68025565",
"0.68025565",
"0.68025565",
"0.... | 0.796886 | 0 |
GET /trials/1 GET /trials/1.xml | def show
@trial = Trial.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @trial }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @trial = Trial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trial }\n end\n end",
"def show\n @trial = Trial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trial ... | [
"0.6455325",
"0.63403314",
"0.62679386",
"0.6238086",
"0.6176045",
"0.59208447",
"0.58383536",
"0.5796926",
"0.5773541",
"0.56708795",
"0.56697667",
"0.5644533",
"0.5641433",
"0.5606891",
"0.55835944",
"0.5575981",
"0.553889",
"0.55211014",
"0.55211014",
"0.55147",
"0.5509353... | 0.708527 | 1 |
GET /trials/new GET /trials/new.xml | def new
@trial = Trial.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @trial }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @trial = Trial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trial }\n end\n end",
"def create\n @trial = Trial.new(params[:trial])\n\n respond_to do |format|\n if @trial.save\n flash[:notice] = 'Trial was successfully cr... | [
"0.72461754",
"0.7164848",
"0.7125318",
"0.65755737",
"0.64915645",
"0.6489564",
"0.6454047",
"0.6454047",
"0.63882256",
"0.63846743",
"0.6348695",
"0.6348695",
"0.6348695",
"0.63227135",
"0.6318691",
"0.6307796",
"0.62801623",
"0.62801623",
"0.6264935",
"0.62607425",
"0.6256... | 0.79213166 | 0 |
POST /trials POST /trials.xml | def create
@trial = Trial.new(params[:trial])
respond_to do |format|
if @trial.save
flash[:notice] = 'Trial was successfully created.'
format.html { redirect_to(@trial) }
format.xml { render :xml => @trial, :status => :created, :location => @trial }
else
format.html... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @trial = Trial.new(params[:trial])\n\n respond_to do |format|\n if @trial.save\n format.html { redirect_to(@trial, :notice => 'Trial was successfully created.') }\n format.xml { render :xml => @trial, :status => :created, :location => @trial }\n else\n format.html... | [
"0.7127306",
"0.6726273",
"0.6597655",
"0.6336137",
"0.6316415",
"0.62623215",
"0.6139367",
"0.6121985",
"0.60838497",
"0.5993323",
"0.5978392",
"0.59493846",
"0.5913752",
"0.58503157",
"0.5799361",
"0.5752214",
"0.5673787",
"0.56559587",
"0.55617106",
"0.5474019",
"0.5465556... | 0.7121765 | 1 |
PUT /trials/1 PUT /trials/1.xml | def update
@trial = Trial.find(params[:id])
respond_to do |format|
if @trial.update_attributes(params[:trial])
flash[:notice] = 'Trial was successfully updated.'
format.html { redirect_to(@trial) }
format.xml { head :ok }
else
format.html { render :action => "edit" ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n p = trial_params.clone\n if p[\"question_ids\"].nil?\n p[\"question_ids\"] = []\n end\n\n respond_to do |format|\n if @trial.update(p)\n format.html { redirect_to @trial, notice: 'Trial was successfully updated.' }\n format.json { head :no_content }\n else\n ... | [
"0.62472373",
"0.62109756",
"0.62040067",
"0.6133514",
"0.59581023",
"0.59560335",
"0.5946118",
"0.59452057",
"0.5937637",
"0.5857082",
"0.5854942",
"0.58395743",
"0.5803279",
"0.57890713",
"0.5788552",
"0.5725071",
"0.5717323",
"0.56885856",
"0.5655561",
"0.5604429",
"0.5560... | 0.6948411 | 0 |
DELETE /trials/1 DELETE /trials/1.xml | def destroy
@trial = Trial.find(params[:id])
@trial.destroy
respond_to do |format|
format.html { redirect_to(trials_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @trial.destroy\n respond_to do |format|\n format.html { redirect_to trials_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @testcase = Testcase.find(params[:id])\n @testcase.destroy\n\n respond_to do |format|\n format.html { redirect_to(testca... | [
"0.66106206",
"0.64824325",
"0.6421248",
"0.6387784",
"0.6380229",
"0.6350266",
"0.6316285",
"0.6307214",
"0.6304542",
"0.62871355",
"0.6286438",
"0.6273298",
"0.62615937",
"0.62515026",
"0.6245197",
"0.62292403",
"0.6227967",
"0.6227562",
"0.6210164",
"0.6195747",
"0.6178816... | 0.73777854 | 1 |
Gets the queryType property value. Represents the type of query associated with an event. 'files' for SPO and ODB and 'messages' for EXO.The possible values are: files, messages, unknownFutureValue. | def query_type
return @query_type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query_type=(value)\n @query_type = value\n end",
"def query_type=(value)\n @query_type = value\n end",
"def query_type_str\n query_type_enum[query_type]\n end",
"def event_type\n @event_type ||= Event.get_event_result_type(@event_name)\n ... | [
"0.7405513",
"0.7405513",
"0.70401925",
"0.6278289",
"0.6115533",
"0.60419774",
"0.5888226",
"0.588775",
"0.5692775",
"0.56700844",
"0.566044",
"0.5630374",
"0.56017894",
"0.5559805",
"0.5553432",
"0.5536399",
"0.54901755",
"0.5428957",
"0.5395716",
"0.5388438",
"0.5369279",
... | 0.7748451 | 1 |
Sets the queryType property value. Represents the type of query associated with an event. 'files' for SPO and ODB and 'messages' for EXO.The possible values are: files, messages, unknownFutureValue. | def query_type=(value)
@query_type = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_query_type\n @query_type = QueryType.find(params[:id])\n end",
"def query_type\n return @query_type\n end",
"def query_type\n return @query_type\n end",
"def set_query_params_type\n @query_params[:type]= @query_params[:type] || \"json\"... | [
"0.68881464",
"0.65252733",
"0.65252733",
"0.6367013",
"0.6072721",
"0.5995089",
"0.5694649",
"0.56605864",
"0.5598151",
"0.5598151",
"0.55736166",
"0.5529148",
"0.55240077",
"0.55240077",
"0.55240077",
"0.55240077",
"0.55240077",
"0.54766995",
"0.54766995",
"0.54766995",
"0.... | 0.8155463 | 1 |
Builds billing, shipping and origin addresses | def build_addresses(options={})
raise "override in purchase_order or sales_order"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def billing_address(params={})\n add_field(mappings[:billing_address][:zip], params[:zip])\n add_field(mappings[:billing_address][:country], lookup_country_code(params[:country]))\n \n address = [params[:address1], params[:address2], params[:city], params[:state]].compac... | [
"0.7586082",
"0.7566728",
"0.7545258",
"0.7430905",
"0.7295885",
"0.72423446",
"0.70783085",
"0.706874",
"0.6958772",
"0.6954858",
"0.6953143",
"0.68913597",
"0.68504983",
"0.68504983",
"0.68174565",
"0.67384326",
"0.6719942",
"0.6697222",
"0.6683689",
"0.663448",
"0.6633632"... | 0.7585675 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.