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 |
|---|---|---|---|---|---|---|
Sets the ephemeralContainers property value. The list of pod ephemeral containers. | def ephemeral_containers=(value)
@ephemeral_containers = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ephemeral_containers\n return @ephemeral_containers\n end",
"def containers=(value)\n @containers = value\n end",
"def init_containers=(value)\n @init_containers = value\n end",
"def containers\n @containers ||= Docker::... | [
"0.64774215",
"0.55380553",
"0.48167664",
"0.4680562",
"0.44575647",
"0.44331056",
"0.44293505",
"0.4305809",
"0.42976215",
"0.42909667",
"0.42610446",
"0.42297187",
"0.41875792",
"0.41623524",
"0.4154813",
"0.41231385",
"0.4112073",
"0.4110572",
"0.40862584",
"0.40834674",
"... | 0.8154758 | 0 |
Gets the initContainers property value. The list of pod init containers. | def init_containers
return @init_containers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_containers\n init_folder unless @init # have I been initialized?\n return @containers \n end",
"def init_containers=(value)\n @init_containers = value\n end",
"def container_names\n (@pod.dig(:spec, :containers) + self.class.init_containers(@pod)).map { |... | [
"0.69731504",
"0.678098",
"0.62346655",
"0.600757",
"0.5980256",
"0.5922547",
"0.58301455",
"0.57645226",
"0.5599619",
"0.54999536",
"0.547958",
"0.5400424",
"0.53696215",
"0.5348747",
"0.5309606",
"0.52768356",
"0.5265537",
"0.5226873",
"0.5158116",
"0.5151092",
"0.5097855",... | 0.71963346 | 0 |
Sets the initContainers property value. The list of pod init containers. | def init_containers=(value)
@init_containers = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_containers\n return @init_containers\n end",
"def containers=(value)\n @containers = value\n end",
"def get_containers\n init_folder unless @init # have I been initialized?\n return @containers \n end",
"def ephemeral_containers=(val... | [
"0.63124317",
"0.5728977",
"0.53709406",
"0.53589725",
"0.5100092",
"0.49856606",
"0.48962176",
"0.48259032",
"0.47804964",
"0.466164",
"0.46189958",
"0.45922372",
"0.45637724",
"0.4561608",
"0.4538034",
"0.44935462",
"0.44893464",
"0.4447271",
"0.44359076",
"0.43656534",
"0.... | 0.7650426 | 0 |
Gets the labels property value. The pod labels. | def labels
return @labels
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def labels\n fields[\"labels\"]\n end",
"def get_labels\n if labels.present?\n @labels_as_list = labels.join(\"\\n\")\n end\n end",
"def labels\n # TODO: Make a proper Label class to represent this structure...\n Array @gapi[\"labels\"]\n end",
"def labels\n ... | [
"0.73559016",
"0.728965",
"0.72779375",
"0.70195055",
"0.6931028",
"0.69293314",
"0.6879322",
"0.68593574",
"0.68593574",
"0.67462254",
"0.66846085",
"0.6628499",
"0.6628499",
"0.6598765",
"0.65419984",
"0.65377176",
"0.64676195",
"0.6449223",
"0.64230776",
"0.6334688",
"0.62... | 0.76295674 | 1 |
Sets the labels property value. The pod labels. | def labels=(value)
@labels = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_labels\n if labels_as_list.present?\n self.labels = labels_as_list.split(\"\\n\").map(&:strip).reject(&:empty?)\n end\n end",
"def set_label labels, key, value\n labels[key] = value if value.is_a? ::String\n end",
"def labels(labelItem)\n @labels = labelItem\n ... | [
"0.7085852",
"0.685406",
"0.6836844",
"0.68354607",
"0.66684175",
"0.6667085",
"0.6607078",
"0.6546563",
"0.6425982",
"0.62546015",
"0.6188519",
"0.6183244",
"0.61541444",
"0.61541444",
"0.6127749",
"0.6111867",
"0.6111867",
"0.60549444",
"0.59984684",
"0.59112734",
"0.589099... | 0.78985983 | 1 |
Gets the namespace property value. The pod namespace. | def namespace
return @namespace
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def namespace\n @namespace.ns\n end",
"def namespace\n read_property 'RootNamespace'\n end",
"def namespace\n @namespace ||= schema.attributes['Namespace'].value\n end",
"def namespace\n cfg_get(:namespace)\n end",
"def namespace\n @namespace\n end",
"def names... | [
"0.74331033",
"0.74062616",
"0.7311692",
"0.72282517",
"0.71247053",
"0.70038867",
"0.6965018",
"0.6961729",
"0.683634",
"0.6829817",
"0.67724943",
"0.67724943",
"0.66979086",
"0.66676426",
"0.66542894",
"0.66018647",
"0.6582419",
"0.6573071",
"0.6540779",
"0.6524286",
"0.649... | 0.75226533 | 1 |
Sets the namespace property value. The pod namespace. | def namespace=(value)
@namespace = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def namespace=(v)\n cfg_set(:namespace, v)\n end",
"def namespace=(value)\n self.namespaces = [value]\n end",
"def namespace=(v)\n cfg_set(:namespace, v)\n end",
"def namespace=( namespace )\n\t\t@namespace = namespace.nil? ? nil : namespace.to_sym\n\tend",
"def namespac... | [
"0.8320013",
"0.82605207",
"0.82156956",
"0.7695297",
"0.75389504",
"0.7495795",
"0.73865736",
"0.73382187",
"0.7308553",
"0.7170331",
"0.71438617",
"0.7139718",
"0.7109808",
"0.69017226",
"0.69017226",
"0.6892572",
"0.68321633",
"0.6742892",
"0.6687001",
"0.6687001",
"0.6669... | 0.8498635 | 1 |
Gets the podIp property value. The pod IP. | def pod_ip
return @pod_ip
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pod_ip=(value)\n @pod_ip = value\n end",
"def ip\n # Get its IP that could have changed upon restart\n # cf https://github.com/moby/moby/issues/2801\n # Make sure we refresh its info before querying it, as we could hit a cache of a previous IP.\n ... | [
"0.8127378",
"0.69721866",
"0.6570768",
"0.6536781",
"0.6530532",
"0.6530532",
"0.652821",
"0.6474135",
"0.63960433",
"0.6378165",
"0.6366251",
"0.6358045",
"0.63558614",
"0.6344928",
"0.6332024",
"0.63056195",
"0.62465507",
"0.6231543",
"0.6230669",
"0.614722",
"0.6145023",
... | 0.85376704 | 0 |
Sets the podIp property value. The pod IP. | def pod_ip=(value)
@pod_ip = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ip=(value)\n if value == @defaults['ai.device.ip']\n @values.delete 'ai.device.ip' if @values.key? 'ai.device.ip'\n else\n @values['ai.device.ip'] = value\n end\n end",
"def set_current_ip(ip)\n @ip = ip\n end",
"def set_ip\n @ip = get_ip(reque... | [
"0.65650254",
"0.62873316",
"0.6203587",
"0.61386466",
"0.60865164",
"0.596472",
"0.5940856",
"0.58087176",
"0.57868415",
"0.5732936",
"0.56708914",
"0.56415236",
"0.5558605",
"0.5414188",
"0.5401072",
"0.5376897",
"0.53611445",
"0.52652705",
"0.52245986",
"0.5200505",
"0.519... | 0.8531775 | 0 |
Gets the serviceAccount property value. The pod service account. | def service_account
return @service_account
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_account=(value)\n @service_account = value\n end",
"def service_principal_name\n return @service_principal_name\n end",
"def service_principal_id\n return @service_principal_id\n end",
"def get_service_arn\n return @... | [
"0.6351408",
"0.5890937",
"0.5797074",
"0.56451136",
"0.56225955",
"0.5591661",
"0.5539784",
"0.54659545",
"0.54515886",
"0.53912926",
"0.52374053",
"0.5185336",
"0.51757956",
"0.5172988",
"0.51633453",
"0.5114669",
"0.51046443",
"0.51046443",
"0.5068837",
"0.5042738",
"0.502... | 0.75284696 | 0 |
Sets the serviceAccount property value. The pod service account. | def service_account=(value)
@service_account = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service=(service)\n @service = service\n end",
"def service=(value)\n @service = value\n end",
"def update!(**args)\n @service_account = args[:service_account] if args.key?(:service_account)\n end",
"def []=(key, service)\n set(key, service)\n end... | [
"0.6256418",
"0.6047224",
"0.59423476",
"0.57751894",
"0.5758303",
"0.5692704",
"0.5600118",
"0.55910313",
"0.5571984",
"0.5459307",
"0.53054285",
"0.5301998",
"0.5293144",
"0.5293144",
"0.5277411",
"0.5277411",
"0.5277411",
"0.5277411",
"0.5277411",
"0.5277411",
"0.5277411",... | 0.7474471 | 0 |
GET /outlet_goods_receive_note_items GET /outlet_goods_receive_note_items.xml | def index
@outlet_goods_receive_note_items = OutletGoodsReceiveNoteItem.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @outlet_goods_receive_note_items }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @goods_receive_note = GoodsReceiveNote.find(params[:id])\n @items = @goods_receive_note.goods_receive_note_items\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @goods_receive_note }\n end\n end",
"def show\n @outlet_goods_receive_note_it... | [
"0.75058776",
"0.7157007",
"0.67334",
"0.6479718",
"0.61217785",
"0.60058206",
"0.5972826",
"0.59497744",
"0.59069103",
"0.5885532",
"0.5879826",
"0.5803955",
"0.57842475",
"0.5781744",
"0.5748569",
"0.57372046",
"0.57271606",
"0.57206756",
"0.567706",
"0.5671425",
"0.5645957... | 0.74826336 | 1 |
GET /outlet_goods_receive_note_items/new GET /outlet_goods_receive_note_items/new.xml | def new
@outlet_goods_receive_note_item = OutletGoodsReceiveNoteItem.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @outlet_goods_receive_note_item }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @outlet_goods_receive_note_item = OutletGoodsReceiveNoteItem.new(params[:outlet_goods_receive_note_item])\n\n respond_to do |format|\n if @outlet_goods_receive_note_item.save\n flash[:notice] = 'OutletGoodsReceiveNoteItem was successfully created.'\n format.html { redirect_to(... | [
"0.7298417",
"0.7141553",
"0.7078938",
"0.6875981",
"0.6875981",
"0.6875981",
"0.6824907",
"0.6821406",
"0.68060577",
"0.6780145",
"0.67474127",
"0.67266345",
"0.67266345",
"0.67266345",
"0.67266345",
"0.67266345",
"0.67266345",
"0.67266345",
"0.67266345",
"0.6724471",
"0.669... | 0.7779053 | 0 |
POST /outlet_goods_receive_note_items POST /outlet_goods_receive_note_items.xml | def create
@outlet_goods_receive_note_item = OutletGoodsReceiveNoteItem.new(params[:outlet_goods_receive_note_item])
respond_to do |format|
if @outlet_goods_receive_note_item.save
flash[:notice] = 'OutletGoodsReceiveNoteItem was successfully created.'
format.html { redirect_to(@outlet_goo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @outlet_goods_receive_note_item = OutletGoodsReceiveNoteItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @outlet_goods_receive_note_item }\n end\n end",
"def update_items\n @goods_receive_note = GoodsReceiveNote.find(params[:id])\n ... | [
"0.6484846",
"0.6421804",
"0.6324672",
"0.63198787",
"0.6213731",
"0.62013155",
"0.6173079",
"0.6049827",
"0.59910583",
"0.5979914",
"0.58977264",
"0.5782238",
"0.5759544",
"0.5719831",
"0.56931174",
"0.5692831",
"0.5684723",
"0.5638742",
"0.563368",
"0.55712134",
"0.5546268"... | 0.6988186 | 0 |
PUT /outlet_goods_receive_note_items/1 PUT /outlet_goods_receive_note_items/1.xml | def update
@outlet_goods_receive_note_item = OutletGoodsReceiveNoteItem.find(params[:id])
respond_to do |format|
if @outlet_goods_receive_note_item.update_attributes(params[:outlet_goods_receive_note_item])
flash[:notice] = 'OutletGoodsReceiveNoteItem was successfully updated.'
format.htm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_items\n @goods_receive_note = GoodsReceiveNote.find(params[:id])\n params[:item] ||= []\n if params[:commit] == \"Update Items\"\n errors = @goods_receive_note.update_items(params[:item])\n if errors.empty?\n flash[:notice] = \"Goods Receive Note Item... | [
"0.6924273",
"0.64945227",
"0.63810754",
"0.6234934",
"0.6204915",
"0.6172079",
"0.6161759",
"0.603742",
"0.5968998",
"0.5943747",
"0.59410906",
"0.59347945",
"0.5924281",
"0.5891142",
"0.58856356",
"0.5880035",
"0.58741575",
"0.58249944",
"0.58041215",
"0.5786158",
"0.577662... | 0.7342537 | 0 |
DELETE /outlet_goods_receive_note_items/1 DELETE /outlet_goods_receive_note_items/1.xml | def destroy
@outlet_goods_receive_note_item = OutletGoodsReceiveNoteItem.find(params[:id])
@outlet_goods_receive_note_item.destroy
respond_to do |format|
format.html { redirect_to(outlet_goods_receive_note_items_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def destroy\n @receiving_item = ReceivingItem.find(params[:id])\n @receiving_item.destroy\n\n respond_to do |format|\n format.html { redirect_to... | [
"0.6592637",
"0.65083903",
"0.6394697",
"0.6387257",
"0.63607013",
"0.6359978",
"0.63509744",
"0.6346087",
"0.63125527",
"0.6301142",
"0.6272237",
"0.62595177",
"0.6234018",
"0.62307405",
"0.6209337",
"0.62069374",
"0.6173788",
"0.61696565",
"0.6165477",
"0.61541617",
"0.6149... | 0.740495 | 0 |
Realiza calculos de liquidacion, sumas | def salvar_calculados
self.cif_dolares = fob_dolares.to_f + seguro.to_f + flete_I.to_f + flete_II.to_f + otros_gastos.to_f
self.cif_bolivianos = 7.07 * cif_dolares.to_f
self.ga = cif_bolivianos * 0.10
self.iva = (cif_bolivianos.to_f + ga.to_f) * 0.1494
self.ice = (cif_bolivianos.to_f + ga.to_f) * 0.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sum_totals\n @total = Lote.where(:programacion_id => @programacion.first).sum(:precio_t)\n @total = Money.new(\"#{@total}00\", \"USD\").format\n @cantidades = Lote.where(:programacion_id => @programacion.first).sum(:cantidad)\n end",
"def precio_total_compras\n compras.sum(:precio_total)\n #p... | [
"0.6849921",
"0.67362285",
"0.6729999",
"0.6662902",
"0.66160905",
"0.6569595",
"0.6560852",
"0.6560717",
"0.6478398",
"0.64773554",
"0.6385383",
"0.62954754",
"0.62860847",
"0.6284316",
"0.6276862",
"0.6248511",
"0.62200475",
"0.6211712",
"0.6188946",
"0.6178688",
"0.6173711... | 0.7138852 | 0 |
Checks if the logged user has rights on the given comment | def authorized_user? comment
comment.user_id == current_user.id || comment.post.user_id == current_user.id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_see_comment?(comment); comment.user.admin?; end",
"def permitted_to_comment?(user)\n self.is_writable? && self.is_commentable? && self.permitted_to_read?(user)\n end",
"def commentable_by?(user_id)\n user_id = user_id.id if user_id.is_a?(User)\n has_role(user_id, :commenter)\n end",
"def c... | [
"0.7710328",
"0.7412333",
"0.7325907",
"0.7298488",
"0.7296778",
"0.7266314",
"0.7259139",
"0.7225777",
"0.708885",
"0.692104",
"0.6847857",
"0.67602104",
"0.6757368",
"0.67342865",
"0.67067236",
"0.6603055",
"0.6586291",
"0.65639305",
"0.65596557",
"0.65454215",
"0.6543803",... | 0.78818125 | 0 |
Returns the percentile value for percentile _p_; nil if array is empty. _p_ should be expressed as an integer; percentile(90) returns the 90th percentile of the array. Algorithm from NIST[ Implementation from | def percentile(p)
sorted_array = self.sort
rank = (p.to_f / 100) * (self.length + 1)
return nil if self.length == 0
if rank.truncate > 0 && rank.truncate < self.length
sample_0 = sorted_array[rank.truncate - 1]
sample_1 = sorted_array[rank.truncate]
# Returns the fractional part of ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def percentile p\n sorted_array = self.sort\n rank = (p.to_f / 100) * (self.length + 1)\n\n return nil if self.length == 0\n\n if rank.truncate > 0 && rank.truncate < self.length\n sample_0 = sorted_array[rank.truncate - 1]\n sample_1 = sorted_array[rank.truncate]\n\n (rank.fractional_pa... | [
"0.79135346",
"0.79133296",
"0.7257068",
"0.70792896",
"0.65291667",
"0.6424552",
"0.6323507",
"0.60856587",
"0.60707986",
"0.595298",
"0.57416505",
"0.56785446",
"0.551433",
"0.5321256",
"0.5204509",
"0.51902074",
"0.51726717",
"0.51218265",
"0.5113898",
"0.5083657",
"0.5082... | 0.841208 | 0 |
Delete a Space security policy definition | def delete_space_security_policy_definition(name, headers=default_headers)
@logger.info("Deleting Space Security Policy Definition \"#{name}\".")
# Delete the space security policy definition
delete("#{@api_url}/securityPolicyDefinitions/#{encode(name)}", headers)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_security_policy_definition(kapp_slug, name, headers=default_headers)\n @logger.info(\"Deleting Security Policy Definition \\\"#{name}\\\" from the \\\"#{kapp_slug}\\\" kapp.\")\n # Delete the kapp security policy definition\n delete(\"#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitio... | [
"0.73101413",
"0.71215916",
"0.6856315",
"0.6806808",
"0.6723694",
"0.66619",
"0.6533659",
"0.6498599",
"0.64733505",
"0.646976",
"0.6422549",
"0.62538606",
"0.62296426",
"0.6225626",
"0.6201134",
"0.61925876",
"0.6155098",
"0.61289835",
"0.60283715",
"0.60136783",
"0.6013608... | 0.8285969 | 0 |
Delete all Space security policy definitions | def delete_space_security_policy_definitions(headers=default_headers)
(find_space_security_policy_definitions({}, headers).content["securityPolicyDefinitions"] || []).each do |s|
delete_space_security_policy_definition(s['name'], headers)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_security_policy_definitions(kapp_slug, headers=default_headers)\n (find_security_policy_definitions(kapp_slug, {}, headers).content[\"securityPolicyDefinitions\"] || []).each do |s|\n delete_security_policy_definition(kapp_slug, s['name'], headers)\n end\n end",
"def delete_space_s... | [
"0.7657835",
"0.71264607",
"0.6634686",
"0.63789797",
"0.6351527",
"0.6277526",
"0.61373115",
"0.6005349",
"0.5948989",
"0.5948851",
"0.5934649",
"0.5931983",
"0.5803627",
"0.57959867",
"0.5774871",
"0.56910956",
"0.56733274",
"0.5652378",
"0.56512254",
"0.5639972",
"0.563362... | 0.81342643 | 0 |
Find all Space security policy definitions | def find_space_security_policy_definitions(params={}, headers=default_headers)
@logger.info("Finding Space Security Policy Definitions.")
get("#{@api_url}/securityPolicyDefinitions", params, headers)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_security_policy_definitions(kapp_slug, params={}, headers=default_headers)\n @logger.info(\"Listing Security Policy Definitions on the \\\"#{kapp_slug}\\\" kapp.\")\n get(\"#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions\", params, headers)\n end",
"def find_space_security_policy_d... | [
"0.7068025",
"0.69292545",
"0.6527644",
"0.6388117",
"0.63050675",
"0.6183675",
"0.6119915",
"0.61049986",
"0.6095572",
"0.5933559",
"0.5857375",
"0.58132505",
"0.5747004",
"0.57288903",
"0.5710456",
"0.5687315",
"0.56802255",
"0.5647013",
"0.56323254",
"0.56154054",
"0.56145... | 0.8165297 | 0 |
Find a single Space security policy definition | def find_space_security_policy_definition(name, params={}, headers=default_headers)
@logger.info("Finding Space Security Policy Definition \"#{name}\"")
get("#{@api_url}/securityPolicyDefinitions/#{encode(name)}", params, headers)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_space_security_policy_definitions(params={}, headers=default_headers)\n @logger.info(\"Finding Space Security Policy Definitions.\")\n get(\"#{@api_url}/securityPolicyDefinitions\", params, headers)\n end",
"def find_security_policy_definition(kapp_slug, name, params={}, headers=default_hea... | [
"0.6923906",
"0.67407644",
"0.6231533",
"0.6057611",
"0.5985544",
"0.58630323",
"0.5805886",
"0.5758017",
"0.5708712",
"0.5686957",
"0.5681145",
"0.5673319",
"0.5465989",
"0.54377246",
"0.54362375",
"0.5421145",
"0.5402222",
"0.53822786",
"0.53214794",
"0.5316205",
"0.5275882... | 0.80704695 | 0 |
Update a Space security policy definition | def update_space_security_policy_definition(name, body, headers=default_headers)
@logger.info("Updating Space Security Policy Definition \"#{name}\"")
put("#{@api_url}/securityPolicyDefinitions/#{encode(name)}", body, headers)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_security_policy_definition(kapp_slug, name, body, headers=default_headers)\n @logger.info(\"Updating Security Policy Definition \\\"#{name}\\\" on the \\\"#{kapp_slug}\\\" kapp.\")\n put(\"#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions/#{encode(name)}\", body, headers)\n end",
"... | [
"0.702268",
"0.68934786",
"0.6633738",
"0.6633738",
"0.6633738",
"0.6633738",
"0.6633738",
"0.6633738",
"0.6633738",
"0.6633738",
"0.6633738",
"0.6633738",
"0.6633738",
"0.6633738",
"0.6492674",
"0.6379594",
"0.6331079",
"0.62696064",
"0.61966735",
"0.6186828",
"0.61231285",
... | 0.8084511 | 0 |
Add a Kapp security policy definition | def add_security_policy_definition(kapp_slug, body, headers=default_headers)
@logger.info("Adding Security Policy Definition \"#{body['name']}\" to the \"#{kapp_slug}\" kapp.")
# Create the kapp security policy definition
post("#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions", body, headers)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_security_policy_definition(kapp_slug, name, body, headers=default_headers)\n @logger.info(\"Updating Security Policy Definition \\\"#{name}\\\" on the \\\"#{kapp_slug}\\\" kapp.\")\n put(\"#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions/#{encode(name)}\", body, headers)\n end",
"... | [
"0.6607108",
"0.65851724",
"0.60989314",
"0.6014458",
"0.5992039",
"0.59860337",
"0.59860337",
"0.5926282",
"0.5825392",
"0.5815788",
"0.57299465",
"0.57094437",
"0.5709257",
"0.5661323",
"0.55970746",
"0.55941224",
"0.55791694",
"0.55759805",
"0.5552562",
"0.5538619",
"0.553... | 0.7957641 | 0 |
Delete a Kapp security policy definition | def delete_security_policy_definition(kapp_slug, name, headers=default_headers)
@logger.info("Deleting Security Policy Definition \"#{name}\" from the \"#{kapp_slug}\" kapp.")
# Delete the kapp security policy definition
delete("#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions/#{encode(name)}"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_space_security_policy_definition(name, headers=default_headers)\n @logger.info(\"Deleting Space Security Policy Definition \\\"#{name}\\\".\")\n # Delete the space security policy definition\n delete(\"#{@api_url}/securityPolicyDefinitions/#{encode(name)}\", headers)\n end",
"def del... | [
"0.73524624",
"0.71685004",
"0.7088754",
"0.7056876",
"0.69340676",
"0.6585557",
"0.65657437",
"0.6563653",
"0.6445994",
"0.6325097",
"0.6323357",
"0.62876797",
"0.6273654",
"0.6225504",
"0.62132",
"0.6150874",
"0.6074689",
"0.6071233",
"0.60100883",
"0.59983903",
"0.59983903... | 0.80652374 | 0 |
Delete all Kapp security policy definitions | def delete_security_policy_definitions(kapp_slug, headers=default_headers)
(find_security_policy_definitions(kapp_slug, {}, headers).content["securityPolicyDefinitions"] || []).each do |s|
delete_security_policy_definition(kapp_slug, s['name'], headers)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_space_security_policy_definitions(headers=default_headers)\n (find_space_security_policy_definitions({}, headers).content[\"securityPolicyDefinitions\"] || []).each do |s|\n delete_space_security_policy_definition(s['name'], headers)\n end\n end",
"def delete_security_policy_defini... | [
"0.72511154",
"0.69416237",
"0.63715154",
"0.61664367",
"0.6106546",
"0.59951395",
"0.5988864",
"0.598647",
"0.58832496",
"0.5778073",
"0.5732528",
"0.5729444",
"0.5715016",
"0.5680766",
"0.56531215",
"0.5649792",
"0.5645255",
"0.5636504",
"0.56149524",
"0.56149524",
"0.55827... | 0.8157673 | 0 |
Find all Kapp security policy definitions | def find_security_policy_definitions(kapp_slug, params={}, headers=default_headers)
@logger.info("Listing Security Policy Definitions on the \"#{kapp_slug}\" kapp.")
get("#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions", params, headers)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_space_security_policy_definitions(params={}, headers=default_headers)\n @logger.info(\"Finding Space Security Policy Definitions.\")\n get(\"#{@api_url}/securityPolicyDefinitions\", params, headers)\n end",
"def find_security_policy_definition(kapp_slug, name, params={}, headers=default_hea... | [
"0.6656102",
"0.6490146",
"0.64839566",
"0.6474339",
"0.6318198",
"0.62859017",
"0.6266009",
"0.618416",
"0.6183718",
"0.6115021",
"0.6055244",
"0.5978034",
"0.5953023",
"0.58736616",
"0.5828352",
"0.5809889",
"0.5779282",
"0.5736677",
"0.5698575",
"0.56478643",
"0.563945",
... | 0.773679 | 0 |
Find a single Kapp security policy definition | def find_security_policy_definition(kapp_slug, name, params={}, headers=default_headers)
@logger.info("Finding Security Policy Definition \"#{name}\" on the \"#{kapp_slug}\" kapp.")
get("#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions/#{encode(name)}", params, headers)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_space_security_policy_definition(name, params={}, headers=default_headers)\n @logger.info(\"Finding Space Security Policy Definition \\\"#{name}\\\"\")\n get(\"#{@api_url}/securityPolicyDefinitions/#{encode(name)}\", params, headers)\n end",
"def searchpolicy\n eval @policy_key\n en... | [
"0.6856381",
"0.659287",
"0.65210724",
"0.6424309",
"0.624844",
"0.6243996",
"0.6076662",
"0.59538954",
"0.5861594",
"0.5861594",
"0.5858534",
"0.57895863",
"0.5676499",
"0.56625366",
"0.56533563",
"0.5577169",
"0.55744493",
"0.556082",
"0.55466205",
"0.5535285",
"0.5529972",... | 0.7578974 | 0 |
Update a Kapp security policy definition | def update_security_policy_definition(kapp_slug, name, body, headers=default_headers)
@logger.info("Updating Security Policy Definition \"#{name}\" on the \"#{kapp_slug}\" kapp.")
put("#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions/#{encode(name)}", body, headers)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_policy(resource, name, config)\n puts Colors.blue(\"\\tupdating policy #{name}...\")\n policy = resource.policy(name)\n if config.empty?\n policy.delete()\n else\n policy.put({\n :policy_document => config.as_pretty_json\n })\n end... | [
"0.7428816",
"0.71220815",
"0.705478",
"0.68209547",
"0.6747457",
"0.6747457",
"0.6747457",
"0.6747457",
"0.6747457",
"0.6747457",
"0.6747457",
"0.6747457",
"0.6747457",
"0.6747457",
"0.6747457",
"0.6747457",
"0.6618654",
"0.661829",
"0.6477928",
"0.64774126",
"0.6461509",
... | 0.77452284 | 0 |
Gets the reactionType property value. Supported values are like, angry, sad, laugh, heart, surprised. | def reaction_type
return @reaction_type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reaction_type=(value)\n @reaction_type = value\n end",
"def ris_type\n return @ris_type if defined?(@ris_type)\n\n @ris_type ||= begin\n if @citable_attributes.treat_as_local_photograph?\n # we're treating as a photo taken by us, \"ART\" is best we've got in RIS?\n... | [
"0.80785006",
"0.57565",
"0.57244205",
"0.5669802",
"0.5638646",
"0.56147397",
"0.5590885",
"0.55849624",
"0.556041",
"0.5535714",
"0.5511335",
"0.55112386",
"0.55054843",
"0.5461065",
"0.5426774",
"0.54254603",
"0.5417143",
"0.5415908",
"0.5408387",
"0.5406713",
"0.5397339",... | 0.84805065 | 0 |
Sets the reactionType property value. Supported values are like, angry, sad, laugh, heart, surprised. | def reaction_type=(value)
@reaction_type = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reaction_type\n return @reaction_type\n end",
"def set_adverse_reaction_type\n @adverse_reaction_type = AdverseReactionType.find(params[:id])\n end",
"def set_type(v)\n self.type = v\n self\n end",
"def set_type(val)\n self.type = val\n self\n e... | [
"0.6817704",
"0.66684705",
"0.5977975",
"0.5954687",
"0.5896737",
"0.5802647",
"0.5789711",
"0.57214963",
"0.57214963",
"0.57125705",
"0.57125705",
"0.57125705",
"0.57125705",
"0.57125705",
"0.57125705",
"0.57125705",
"0.5696639",
"0.5642836",
"0.5594949",
"0.55915475",
"0.55... | 0.87293303 | 0 |
Sets the user property value. The user property | def user=(value)
@user = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_users_property\n @users_property = UsersProperty.find(params[:id])\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def s... | [
"0.7501743",
"0.74786144",
"0.74786144",
"0.74786144",
"0.74786144",
"0.74786144",
"0.74786144",
"0.74786144",
"0.7478348",
"0.734122",
"0.7137815",
"0.7074885",
"0.7034603",
"0.69832367",
"0.69832367",
"0.6981609",
"0.693033",
"0.69279456",
"0.6918809",
"0.6918327",
"0.68937... | 0.7774833 | 1 |
POST /pmplayers POST /pmplayers.json | def create
@pmplayer = Pmplayer.new(pmplayer_params)
respond_to do |format|
if @pmplayer.save
format.html { redirect_to @pmplayer, notice: 'Pmplayer was successfully created.' }
format.json { render :show, status: :created, location: @pmplayer }
else
format.html { render :ne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @layer = Layer.new(params[:layer])\n\n respond_to do |format|\n if @layer and @layer.save\n @layers = Layer.all\n format.html { redirect_to layers_path, notice: 'Layer was successfully created.' }\n format.json { render json: {layers: @layers.map {|layer| {id: layer.id,... | [
"0.61780995",
"0.5902904",
"0.56801856",
"0.56190354",
"0.56060755",
"0.55449075",
"0.548172",
"0.54420274",
"0.54171",
"0.53921926",
"0.5365741",
"0.5347531",
"0.5345083",
"0.5329167",
"0.528731",
"0.5279376",
"0.5275578",
"0.5271866",
"0.52092636",
"0.51906216",
"0.51821953... | 0.63796437 | 0 |
PATCH/PUT /pmplayers/1 PATCH/PUT /pmplayers/1.json | def update
respond_to do |format|
if @pmplayer.update(pmplayer_params)
format.html { redirect_to @pmplayer, notice: 'Pmplayer was successfully updated.' }
format.json { render :show, status: :ok, location: @pmplayer }
else
format.html { render :edit }
format.json { render... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @capitol.update(capitol_params)\n format.html { redirect_to root_path, notice: 'Capitol was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @capi... | [
"0.6095898",
"0.6023699",
"0.59849447",
"0.5977264",
"0.59325063",
"0.5925841",
"0.5879706",
"0.5826746",
"0.58089304",
"0.58005816",
"0.5797719",
"0.57834876",
"0.57834876",
"0.5771857",
"0.57228684",
"0.56546164",
"0.56425196",
"0.5622989",
"0.5594996",
"0.5589612",
"0.5586... | 0.66031414 | 0 |
DELETE /pmplayers/1 DELETE /pmplayers/1.json | def destroy
@pmplayer.destroy
respond_to do |format|
format.html { redirect_to pmplayers_url, notice: 'Pmplayer was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @layer = Layer.find(params[:id])\n @layer.destroy\n\n respond_to do |format|\n format.html { redirect_to layers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@ru = request.original_url\n @ru = request.protocol + request.host_with_port + \"/layer... | [
"0.6993073",
"0.6782744",
"0.66825914",
"0.6632998",
"0.66224",
"0.66097766",
"0.6486974",
"0.6455607",
"0.6455607",
"0.64442134",
"0.6421341",
"0.6394262",
"0.6370976",
"0.6365071",
"0.6353457",
"0.63447237",
"0.634213",
"0.6324749",
"0.63172036",
"0.6314868",
"0.6303981",
... | 0.7148487 | 0 |
logout fails flakely on CI. To further pinpoint problem we start storing more screenshots if this fails. | def logout_using_menu
screenshots_for_debugging = []
find_button("user-menu").click
assert has_text?("Abmelden")
screenshots_for_debugging << page.save_screenshot(Rails.root.join("tmp/screenshots/after-opening-menu.png"))
list_of_user_menu_items = find("#user-menu-list")
logout_link = list_of_user_menu_ite... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def after_teardown # I reset sessions here so capybara-screenshot can still make screenshots when tests fail\n super(); Capybara.reset_sessions!\n end",
"def log_out\n @image.each do |row|\n Useditor::Log.ok row.join('')\n end\n end",
"def teardown\n log_useful_data\n @b... | [
"0.73933417",
"0.67005765",
"0.65041506",
"0.64180666",
"0.6200076",
"0.6196983",
"0.6122753",
"0.6122753",
"0.6077032",
"0.6073095",
"0.6042494",
"0.6042494",
"0.6042494",
"0.60309607",
"0.6008774",
"0.60008246",
"0.596171",
"0.59184974",
"0.59040946",
"0.59037846",
"0.58898... | 0.7271394 | 1 |
Is the media item valid? A media item must have a show title, season number and episode number. | def valid?
return !(self.show.empty? or self.season.zero? or self.episode.zero?)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid?\n @errors = []\n \n if !item_id.nil? && item_id !~ GUID_REGEX\n @errors << ['line_item_id', 'must be blank or a valid Xero GUID']\n end\n \n unless description\n @errors << ['description', \"can't be blank\"]\n end\n \n @errors.size == 0\n... | [
"0.65405446",
"0.62866133",
"0.6116615",
"0.6048081",
"0.6048081",
"0.6044979",
"0.6042887",
"0.60371745",
"0.6016459",
"0.59717333",
"0.5936629",
"0.58610284",
"0.5828075",
"0.5822852",
"0.5800244",
"0.5791411",
"0.56992495",
"0.56639075",
"0.5632314",
"0.56234485",
"0.55952... | 0.6620874 | 0 |
Where did the file come from? Example: /origin/some/path/ | def origin
# Split the full path of the video file by /
# and then exclude the last part (whic is the filename)
# and join the path back together
paths = self.fullpath.split('/')
if paths.length > 1 then
res = Helpers::trailingslash(Helpers::trailingslash($config[:origin_dir]) + paths.slice(0, paths.length... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_origin\n\t\treturn @transport.get_path(\"meta\",\"origin\")\n\tend",
"def original_fullpath; end",
"def file() = pathname.relative_path_from(Cnfs.config.paths.definitions)",
"def path\n file.url\n end",
"def relative_to_mount(remote_file) # :nodoc:\n remote_file\n end",
"def local_pat... | [
"0.70352745",
"0.6746947",
"0.6712334",
"0.66964126",
"0.6639504",
"0.663759",
"0.6621714",
"0.65360117",
"0.6474849",
"0.64408857",
"0.64286244",
"0.6413674",
"0.6390591",
"0.6381685",
"0.63788235",
"0.63738155",
"0.63373727",
"0.6336172",
"0.6336172",
"0.63310826",
"0.63208... | 0.6969104 | 1 |
Write a method that will take a short line of text, and print it within a box. Example: print_in_box('To boldly go where no one has gone before.') ++ | | | To boldly go where no one has gone before. | | | ++ print_in_box('') ++ | | | | | | ++ You may assume that the input will always fit in your terminal window. | def print_in_box(text)
width = text.size
result = <<EOS
+-#{'-' * width}-+
| #{' ' * width} |
| #{text} |
| #{' ' * width} |
+-#{'-' * width}-+
EOS
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_in_box(text)\n\n text_length = text.size + 2\n\n line_one_five = puts '+' + '-'* text_length + '+'\n line_two_four = puts '|' + ' '* text_length + '|'\n line_three = puts '| ' + text + ' |'\n line_two_four = puts '|' + ' '* text_length + '|'\n line_one_five = puts '+' + '-'* text_length + '+'\n\n\n... | [
"0.73571736",
"0.73254025",
"0.73154986",
"0.73084706",
"0.7249918",
"0.72095966",
"0.71822596",
"0.7179915",
"0.7147688",
"0.7072471",
"0.704862",
"0.7047547",
"0.70413244",
"0.6958616",
"0.693993",
"0.68584335",
"0.68584335",
"0.6856004",
"0.67688936",
"0.6707734",
"0.66444... | 0.75014776 | 0 |
returns all sorted alpha matches | def all_alpha_matches(input)
where(alpha: sort_letters(input)).pluck :text
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def match(anagram_ary)\n match_ary = []\n anagram_ary.each do |anagram|\n if word.split('').sort == anagram.split('').sort\n match_ary << anagram\n end\n end\n match_ary\n end",
"def alpha_sort(phrase)\n char_count = Hash.new(0)\n\n phrase.split(\"\").each { |char| char_count[char]+=1 }... | [
"0.65829104",
"0.6447493",
"0.64408374",
"0.6432845",
"0.63753074",
"0.6313376",
"0.62958086",
"0.6265489",
"0.6262587",
"0.6240811",
"0.62128407",
"0.6176865",
"0.6167725",
"0.6142076",
"0.6127926",
"0.61132956",
"0.6098924",
"0.6098411",
"0.6089313",
"0.60870796",
"0.608531... | 0.7621021 | 0 |
Get or check current session secure token | def secure_token token=nil
generated = Crypt.sha1(request.ip)
return generated == token if token
generated
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_token\n session[:token] if authorized?\n end",
"def token?\n @session_token\n end",
"def session_token\n refresh_session_token unless token_valid?\n return @session_token\n end",
"def get_token\n LastFM.get( \"auth.getToken\", {}, :secure )\n end",
"def token\n ... | [
"0.80701023",
"0.7464514",
"0.7444015",
"0.7288389",
"0.72517747",
"0.72351503",
"0.71188396",
"0.70427907",
"0.7029641",
"0.7010948",
"0.7009165",
"0.70061374",
"0.6977172",
"0.69557667",
"0.69534314",
"0.69408715",
"0.694024",
"0.694024",
"0.694024",
"0.6935568",
"0.6922637... | 0.76521385 | 1 |
Empty out the build directory | def clean_build_directory
FileUtils.rm_rf Dir.glob(File.join(@project.build_path, '*'))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean(ant)\n @build_dir.delete\n end",
"def clean\n cache = Cache.instance\n # remove all built files\n cache.targets(false).each do |target|\n cache.remove_target(target)\n FileUtils.rm_f(target)\n end\n # remove all created directories if they are empty\n cac... | [
"0.79805446",
"0.7620593",
"0.761291",
"0.7502541",
"0.73644483",
"0.7296819",
"0.72967637",
"0.7231974",
"0.7208295",
"0.7194442",
"0.7162795",
"0.71216977",
"0.71013796",
"0.70951974",
"0.7008042",
"0.699792",
"0.6949921",
"0.69236803",
"0.6918391",
"0.6894281",
"0.6888572"... | 0.81467307 | 0 |
Write an .erb from source to destination, catching and reporting errors along the way | def write_erb(source, destination)
begin
@task.shell.mute do
@task.create_file(destination) do
@project.parse_erb(source)
end
end
rescue Exception => e
@task.say "Error while building #{File.basename(source)}:"
@task.say e.message + "\n", Thor:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def erbFileHandler(src)\n # try to copy file to the project directory\n dest = getFileDest(src)\n raise \"File \" + src + \"does not belong to the template\" if dest == nil\n\n if dest =~ /.erb$/ then dest = dest[0..dest.length-5] end\n\n cmdline = ''\n\n # set environment variables if possible\n... | [
"0.6553724",
"0.6489394",
"0.63403064",
"0.6284842",
"0.6217545",
"0.61641157",
"0.6161068",
"0.61047214",
"0.6074828",
"0.6002059",
"0.59314746",
"0.5918138",
"0.59011805",
"0.5898837",
"0.5839922",
"0.5839922",
"0.58382523",
"0.58367664",
"0.58190125",
"0.5808264",
"0.57954... | 0.78918356 | 0 |
Join the underlying thread. This is a blocking call. | def join
@thread.join
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def join\n @thread.join\n end",
"def join\n return if not running?\n @thread.join\n end",
"def join\n thread && thread.join\n end",
"def join\n @thread.join\n unset_thread_task\n end",
"def join_thread\n @thread&.join\n end",
"def join\n @cond.wa... | [
"0.8089089",
"0.8054324",
"0.79739195",
"0.79482424",
"0.79436535",
"0.7605656",
"0.75707054",
"0.750054",
"0.73913306",
"0.7377309",
"0.73613846",
"0.72548044",
"0.7228799",
"0.7213692",
"0.7213456",
"0.7183658",
"0.70915383",
"0.7078526",
"0.70576555",
"0.70228267",
"0.6919... | 0.8172442 | 0 |
POST /datos_usuarios POST /datos_usuarios.json | def create
@datos_usuario = DatosUsuario.new(datos_usuario_params)
respond_to do |format|
if @datos_usuario.save
format.html { redirect_to "/inicio/success", success: 'Datos usuario was successfully created.' }
else
format.html { render action: 'new' }
format.json {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @usuario = Usuario.new(usuario_params)\n\n if @usuario.save\n render json: @usuario, status: :created, location: @usuario\n else\n render json: @usuario.errors, status: :unprocessable_entity\n end\n end",
"def create\n\n puts request.body.string\n\n if request.body.strin... | [
"0.7109719",
"0.6738844",
"0.6637198",
"0.6607863",
"0.6558902",
"0.6545033",
"0.65222543",
"0.64741856",
"0.6442691",
"0.6431416",
"0.6431416",
"0.6431416",
"0.64096564",
"0.63900983",
"0.6371617",
"0.634856",
"0.633861",
"0.63312125",
"0.63268054",
"0.6308064",
"0.630754",
... | 0.6822908 | 1 |
DELETE /datos_usuarios/1 DELETE /datos_usuarios/1.json | def destroy
@datos_usuario.destroy
respond_to do |format|
format.html { redirect_to datos_usuarios_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @usuario = Usuario.find(params[:id])\n @usuario.destroy\n\n respond_to do |format|\n format.html { redirect_to usuarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @usuario = Usuario.find(params[:id])\n @usuario.destroy\n\n respond_to do |fo... | [
"0.726784",
"0.726784",
"0.726784",
"0.7264051",
"0.713006",
"0.71264446",
"0.7099148",
"0.7086893",
"0.7081484",
"0.7074859",
"0.7073987",
"0.70734173",
"0.70703757",
"0.70668596",
"0.7061297",
"0.7061297",
"0.7061297",
"0.70513105",
"0.70404595",
"0.70344204",
"0.7025415",
... | 0.74203104 | 0 |
Increase the dogs position values by 5 using Array.map!. | def chasing_squirrels(dogs)
dogs.map! do |individual_dog|
individual_dog[:position] += 5
individual_dog
end
return dogs
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def return_dogs(dogs)\n dogs.map! do |individual_dogs|\n individual_dogs[:position] = 0\n individual_dogs\n end \n return dogs\nend",
"def return_dogs(my_dogs)\n my_dogs.map! do |dog|\n dog[:position] = 0\n end\nend",
"def walk_dogs\n dogs.map {|dog| dog.mood = \"happy\"}\n end"... | [
"0.6887292",
"0.6700912",
"0.6237477",
"0.6179858",
"0.6001572",
"0.5958741",
"0.5921573",
"0.5817727",
"0.57489455",
"0.5707864",
"0.5541045",
"0.5515709",
"0.55032694",
"0.54967415",
"0.5496465",
"0.54896796",
"0.5483739",
"0.5477751",
"0.5451388",
"0.545095",
"0.54459155",... | 0.77814525 | 0 |
Write a new method called return_dogs that takes an array of dogs as an argument. It should reset all of the dogs' positions back to 0. | def return_dogs(dogs)
dogs.map! do |individual_dogs|
individual_dogs[:position] = 0
individual_dogs
end
return dogs
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def return_dogs(my_dogs)\n my_dogs.map! do |dog|\n dog[:position] = 0\n end\nend",
"def chasing_squirrels(dogs)\n dogs.map! do |individual_dog|\n individual_dog[:position] += 5\n individual_dog\n end\n return dogs\nend",
"def dogs_by_size_results\n dogs_by_size_results = []\n end"... | [
"0.70954454",
"0.6231123",
"0.55703455",
"0.5535698",
"0.5495427",
"0.54411733",
"0.5422618",
"0.5411562",
"0.5411562",
"0.5411562",
"0.5411562",
"0.5411562",
"0.5411562",
"0.5411562",
"0.5411562",
"0.5411562",
"0.5411562",
"0.5244353",
"0.52318317",
"0.5107641",
"0.5105909",... | 0.7431859 | 0 |
This method takes three parameters: (1) An input file object containing the log messages that need to be translated (2) An output file object to write the translated messages to (3) The depth of the translations The input file object should be open for reading, while the output file object should be open for writing. T... | def reverse_translate(input_file, output_file, depth)
LogParser.parse(input_file).each do |log_message|
@tables[0].reverse_translate(log_message, depth)
output_file.puts(log_message)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_file(filename, locale, output_locale)\n\n def assemble(templ, local)\n # If already assembling the string\n return local unless templ.is_a?(Hash)\n\n # If templ is a hash but local is nil, it means that the entire current \n # branch is not yet translated. Therefore cre... | [
"0.59356",
"0.5324292",
"0.53112483",
"0.52723163",
"0.5198342",
"0.51301986",
"0.51266295",
"0.5124699",
"0.5114014",
"0.5016925",
"0.49943918",
"0.4972415",
"0.49414447",
"0.49370247",
"0.4913986",
"0.4822616",
"0.48075086",
"0.47923738",
"0.47459108",
"0.4742143",
"0.47181... | 0.7104412 | 0 |
Pause for one second before each vote Pass in array of candidates to vote from | def vote(candidates) sleep(1) end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vote \n \t\n voters = Voter.voters_created\n \n politicians = Voter.voters_created.select {|voter| voter if voter.is_a? Politician}\n vote_count = Hash.new(0)\n who_voted_for_whom = Hash.new(0)\n #introduce an element of fairness by varying when candidates get to visit voters \n campaign_s... | [
"0.6240795",
"0.6240795",
"0.600417",
"0.6002265",
"0.59443545",
"0.5872333",
"0.5861349",
"0.5665093",
"0.5640046",
"0.5535868",
"0.5522088",
"0.5502625",
"0.54801744",
"0.54690236",
"0.54465747",
"0.5413406",
"0.53993326",
"0.53858495",
"0.5385673",
"0.53786284",
"0.5355261... | 0.8610753 | 0 |
toggle status of a chain_task to be active/inactive | def toggle_status
@chain_task.toggle_status!
render :text => :ok and return
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toggle(task_number) # Toggle method that calls the toggle_status method on the appropriate task from the all_tasks array\n all_tasks[task_number - 1].toggle_status\n end",
"def make_inactive\n self.status = \"I\"\n end",
"def toggle_status # Toggle status method that negates the completed? meth... | [
"0.7088847",
"0.6777788",
"0.6747348",
"0.66822916",
"0.6665876",
"0.6624774",
"0.6588358",
"0.653686",
"0.65157086",
"0.6429222",
"0.6387258",
"0.6383257",
"0.6362976",
"0.63434106",
"0.62647796",
"0.6263705",
"0.6255527",
"0.6252904",
"0.6242338",
"0.6238309",
"0.6222973",
... | 0.7906999 | 0 |
It is used for define an xml handler's task. It does 1) locking, 2) authenticating, 3) executing a task, and 4)returning a result to a client. +task_name+ name of task +session+ a string that represents a user session +lock_mode+ a mode flag for exclusive access :rd for read lock and :wt for write lock. +admin_auth+ it... | def task(task_name, session, lock_mode, admin_auth=false, &block)
begin
# lock
if lock_mode == :wt
@lock.write_lock
else
@lock.read_lock
end
begin
rc = authenticate(session, admin_auth, &block)
log_msg = rc
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_task(task_name, session, admin_auth=false, &block)\n task(task_name, session, :wt, admin_auth, &block)\n end",
"def task(&block) \n task = TaskRunnable.new\n task.proc = Proc.new(block)\n task\n end",
"def read_task(task_name, session, admin_auth=false, &block)\n tas... | [
"0.6658985",
"0.62150043",
"0.6152634",
"0.6058406",
"0.60057646",
"0.5915731",
"0.57130474",
"0.56931907",
"0.56901515",
"0.5670516",
"0.5629411",
"0.5472292",
"0.5410859",
"0.54104996",
"0.54104996",
"0.54072577",
"0.53668725",
"0.53229",
"0.5310133",
"0.5310133",
"0.527507... | 0.73301953 | 0 |
It log rpc call result. +task_name+ name of called method +user+ name of user who executes this rpc call +result[0]+ true or false +result[1]+ a string representing error if result[0] is false, otherwise undefined | def log_result(task_name, user, result)
if result[0]
log_success(user, task_name)
else
log_fail(user, task_name, result[1])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def result_log\n end",
"def result_log\n end",
"def result_log\n end",
"def add_result name, res\n \n end",
"def print_rpc_stats(stats)\n out.puts stats.report(\"Task Stats\", false, @verbose)\n end",
"def log_http_call(payload); end",
"def log_http_call(pay... | [
"0.6135386",
"0.6135386",
"0.6135386",
"0.58090156",
"0.5774704",
"0.5705321",
"0.5705321",
"0.56731874",
"0.55995214",
"0.55908805",
"0.55908805",
"0.5586277",
"0.5569239",
"0.5554616",
"0.5554616",
"0.5534579",
"0.5484125",
"0.5464913",
"0.54558444",
"0.5438367",
"0.5433518... | 0.76327723 | 0 |
Fin de def showUserList Permet d'afficher la liste des users non sportif voulant faire du sport | def showNonSportifList
@users = User.where(isSportif: false, wantDoSport: true)
@titre = "Liste des utilisateurs non sportifs"
generatePDFnonSportif(@users)
render 'showUserList'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list\n flash[:notice] = \"Het volg-systeem is neergestort als een mir. Iedereen volgt gewoon iedereen. Wel zo communistisch en makkelijk\";\n @user = User.find(:all)\n end",
"def list\n # ask the user_repository for a list of all the users\n users = @user_repository.all\n # pass that list to ... | [
"0.7508745",
"0.7289053",
"0.7224238",
"0.72154486",
"0.713127",
"0.71035314",
"0.70729965",
"0.70715046",
"0.7012907",
"0.70045507",
"0.698844",
"0.6974018",
"0.6945427",
"0.6931473",
"0.6894762",
"0.6888174",
"0.6881643",
"0.6876684",
"0.6847996",
"0.6827284",
"0.68108994",... | 0.7696338 | 0 |
Fin de def generatePDFsportif Genere un PDF de la liste des users non sportif voulant faire du sport | def generatePDFnonSportif(all_users)
Prawn::Document.generate("public/listUsers.pdf", :page_layout => :landscape) do |pdf|
table_data = [["Nom", "Email", "Date de naissance", "Poids actuel", "Poids Idéal", "Taille", "IMC"]]
all_users.each do |u|
table_data += [["#{u.nom}", "#{u.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generatePDF(all_users) \n Prawn::Document.generate(\"public/listUsers.pdf\", :page_layout => :landscape) do |pdf|\n \n table_data = [[\"Nom\", \"Email\", \"Date de naissance\", \"Poids actuel\", \"Poids Idéal\", \"Taille\", \"IMC\", \"Sportif\", \"Souhaite faire du sport\" ]]\n \n all... | [
"0.84078646",
"0.7781275",
"0.77485985",
"0.72366893",
"0.7180817",
"0.6885193",
"0.6836498",
"0.6719058",
"0.6714711",
"0.6677746",
"0.66435486",
"0.6566865",
"0.65306133",
"0.65212435",
"0.6520843",
"0.6507961",
"0.6481148",
"0.6470316",
"0.6405768",
"0.6405592",
"0.6389643... | 0.86636144 | 0 |
:nodoc: Google Calendar does not have a category concept. Instead a feed consists of multiple calendars. We've chosen to map the category into the calendar concept. This function, category, returns an array of calendar objects which match the requested category(ies). categories can be a single string/symbol or an array... | def category categories
categories = categories.to_a if !categories.is_a? Array
categories.collect { |i| calendars.find_by_title i.to_s }.compact
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def categories\n nodes = @doc.xpath(\"atom:feed/atom:category\", ::AtomFeed::NS) || []\n nodes.map { |node| AtomCategory.new(node) }\n end",
"def categories\n if @categories.nil?\n @categories = []\n category_nodes =\n FeedTools::XmlHelper.try_xpaths_all(self.channel_node... | [
"0.6852299",
"0.6690106",
"0.66218275",
"0.6471427",
"0.6290092",
"0.6238935",
"0.6154424",
"0.61530167",
"0.5992287",
"0.5916889",
"0.588686",
"0.5878624",
"0.58754045",
"0.58141625",
"0.5810971",
"0.58008677",
"0.57922906",
"0.5766532",
"0.57505065",
"0.57494134",
"0.574028... | 0.76557314 | 0 |
Sessions are opened to the google api using a google username and password. This implemented so that only one session is used per feed. You probably won't need to use this, but if you do, you can access the session for a feed object by: feed = GCalendar::Feed.first feed.login assigns session feed.session => returns the... | def session
@@session ||= []
if @@session[self.id].nil?
session = GData::Client::Calendar.new
token = session.clientlogin(username,password)
@@session[self.id] = session
end
@@session[self.id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login\n self.session = GData::Client::Calendar.new if session.nil?\n @token = session.clientlogin(username,password)\n true\n end",
"def get_session\n\t\trefresh_token = get_refresh_token\n\n\t\tclient = OAuth2::Client.new(\n\t\t CLIENT_ID,\n\t\t CLIENT_SECRET,\n\t\t si... | [
"0.68258905",
"0.672245",
"0.63258857",
"0.6272637",
"0.6261305",
"0.6250484",
"0.6180397",
"0.61020875",
"0.61020875",
"0.61020875",
"0.601425",
"0.59638363",
"0.5951496",
"0.59470797",
"0.5916242",
"0.5915621",
"0.5907507",
"0.58968884",
"0.5867331",
"0.586653",
"0.58419687... | 0.7790588 | 0 |
create a new calendar object for this feed. name name or title of the calendar opts hash of fields for creating the calendar object. TODO, move or add function to the calendars association | def create_calendar(name, opts={})
opts[:name] = name
cal = GCalendar::Calendar.new(:opts=>opts)
calendars << cal
cal.sync
save
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_google_calendar\n unless self.apps_cal_id\n result = Gandalf::GoogleApiClient.insert_google_calendar({\n \"summary\" => self.name\n })\n self.apps_cal_id = result.data.id\n self.save!\n end\n end",
"def create\n\t@calendar = @user.calendars.build(params[:calendar])\n\... | [
"0.6745043",
"0.64037484",
"0.6184438",
"0.61106306",
"0.60955787",
"0.604115",
"0.60359687",
"0.60336",
"0.60326886",
"0.5978073",
"0.59324664",
"0.5932209",
"0.59209985",
"0.5810863",
"0.57801867",
"0.570104",
"0.559059",
"0.5587822",
"0.5585916",
"0.55622834",
"0.55153537"... | 0.82752556 | 0 |
Uses session to get the calendar feed for the user | def get_user_calendar_xml # :nodoc:
response = session.get(USER_FEED)
Nokogiri::XML(response.body)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calendar\n @calendars = Calendar.all.where(:UserId => [current_user.id, nil]).order(:start_time)\n end",
"def get_feed\n if user_authorized?\n self.class.fetch_from_cache @canvas_course_id do\n get_feed_internal\n end\n else\n nil\n end\n end",
"def get_calendars\r\n ... | [
"0.66995835",
"0.65903664",
"0.6545744",
"0.64435136",
"0.64212537",
"0.6359534",
"0.63205767",
"0.6309486",
"0.62912303",
"0.62804157",
"0.62491924",
"0.6234602",
"0.62235904",
"0.61670417",
"0.61228895",
"0.6111004",
"0.6107281",
"0.6093176",
"0.6074947",
"0.6073134",
"0.60... | 0.69711167 | 0 |
As stated, the goal of this library is to manipulate the google calendar, using ActiveRecord as a cache. This means that synchronization needs to follow these rules: a) data exists in gcal and not in local > create local objects note that deletion of a local event must either immediately delete the google object, or ma... | def sync_calendars(opts={})
# why does the primary calendar feed change every time?
feed_xml = get_user_calendar_xml
xml_ts = Time.zone.parse(feed_xml.xpath('/ns:feed/ns:updated', 'ns'=>'http://www.w3.org/2005/Atom').text)
self.body = feed_xml.to_s if xml_ts != synced_at
feed_xml.css('ent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_events\n # TODO: handle simple \"date\" in \"all day\" events\n google_updated_events = get_updated_events\n current_user.events.destroy_all\n if google_updated_events.length > 0\n google_updated_events.each do |event|\n new_event = current_user.events.find_or_create_by(g_id: eve... | [
"0.59438396",
"0.5750888",
"0.5750374",
"0.5620669",
"0.54809636",
"0.5429109",
"0.53840345",
"0.5326818",
"0.52438563",
"0.52224904",
"0.52220815",
"0.52198017",
"0.5211574",
"0.51997334",
"0.5149853",
"0.51306593",
"0.5128895",
"0.5109369",
"0.5105655",
"0.5094184",
"0.5074... | 0.6464298 | 0 |
compare the results of "working solution" with "optimized solution" | def compare_solutions(count = 5, n_min = 1, n_max = 300)
arr = generate(count, n_min, n_max)
if solve(arr) != solve_opt(arr)
puts "\nFAILED"
puts 'data: ' + arr.to_s
puts 'solution: ' + solve(arr).to_s
puts 'optimized solution: ' + solve_opt(arr).to_s
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_tests\n check_solution(1, [6, 29, 18, 2, 72, 19, 18, 10, 37], 18, 2)\n check_solution(2, [6, 29, 18, 2, 72, 19, 18, 10, 37], 9, -1)\nend",
"def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], fals... | [
"0.7030417",
"0.67422885",
"0.67422885",
"0.66741127",
"0.6667087",
"0.6551995",
"0.6245569",
"0.6243538",
"0.62407213",
"0.62390614",
"0.62370056",
"0.6219705",
"0.61195153",
"0.61195153",
"0.61195153",
"0.6039978",
"0.60141444",
"0.5994897",
"0.5981281",
"0.59684575",
"0.59... | 0.76241046 | 0 |
prompt asks us to create a list of directors with their names only using source as an argument. pping source indicates that source is the entire nds | def list_of_directors(source)
dir_list = []
dir_index =0
while dir_index<source.length do
dir_list << source[dir_index][:name]
dir_index +=1
end
dir_list
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_of_directors(source)\nrow_index = 0\narray =[]\nwhile row_index < source.length\n array << source[row_index][:name]\n row_index += 1\nend\narray\nend",
"def print_directors(nds)\n pp nds\nend",
"def directors\n parse_crew('Directed by')\n end",
"def list_sources\n sources = Profile.g... | [
"0.6226463",
"0.5875862",
"0.5812536",
"0.5537217",
"0.5404482",
"0.530637",
"0.52944124",
"0.5172631",
"0.5120825",
"0.51141346",
"0.5075698",
"0.5062013",
"0.5061534",
"0.50594467",
"0.5026288",
"0.500214",
"0.500214",
"0.4969472",
"0.4941467",
"0.49374163",
"0.48720124",
... | 0.6517475 | 0 |
cscope egrep is pretty bad very few character classes | def generate_cscope_pattern(base)
pattern = base.downcase #in order to do case insensitive matching cscope requires lower case
return "^(.* )?#{pattern}" if pattern.length <= 2
return "^(.* )?#{pattern}"
#return '^(.* )?p[a-zA-Z0-9]*a'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def re; end",
"def filter_chars\n # In Python we apply a string to a regexp,\n # but in Ruby we apply a regexp to a string, that's why we don't have to append\n $stack.push($stack.pop().gsub(Regexp.compile('[\\W_]+'), ' ').downcase)\nend",
"def regexp; end",
"def regexp; end",
"def regexps; end",
"def... | [
"0.59010875",
"0.5761099",
"0.5750851",
"0.5750851",
"0.5691109",
"0.5656059",
"0.56263065",
"0.56263065",
"0.56263065",
"0.55732644",
"0.55520415",
"0.55158806",
"0.5479506",
"0.5418283",
"0.5416123",
"0.53727305",
"0.5343021",
"0.5310164",
"0.52442944",
"0.52180696",
"0.521... | 0.5864471 | 1 |
turn compression on or off | def compression=(bool); @store.compression = bool; end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compression?; end",
"def default_compression; end",
"def compression; end",
"def compression\n configuration[:copy_compression] || :gzip\n end",
"def compression_method; end",
"def compressed?\n false\n end",
"def gzip_enabled; end",
"def gzip_enabled; end",
... | [
"0.79042566",
"0.7686397",
"0.7352654",
"0.730841",
"0.7262949",
"0.72500896",
"0.72238404",
"0.72238404",
"0.7205714",
"0.7174773",
"0.7150642",
"0.7114816",
"0.7114453",
"0.70307225",
"0.69887763",
"0.6977512",
"0.6913873",
"0.6909236",
"0.6869278",
"0.68684053",
"0.6856234... | 0.8008264 | 0 |
GET /legalissues GET /legalissues.json | def index
@legalissues = Legalissue.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gather_issues\n url = \"#{URL}/projects/foreman/issues.json?status_id=1&limit=100&release_id=#{@current_release_id}\"\n puts url\n uri = URI(URI.escape(url))\n response = Net::HTTP.get(uri)\n JSON.parse(response)\nend",
"def index\n @issues = Issue.all\n\n respond_to do |format|\n format.html... | [
"0.67881715",
"0.6640637",
"0.65331256",
"0.65331256",
"0.65331256",
"0.65331256",
"0.65331256",
"0.65185523",
"0.6490595",
"0.6456931",
"0.6420763",
"0.6381829",
"0.6354505",
"0.629856",
"0.6297153",
"0.6279212",
"0.6173057",
"0.6162876",
"0.61561894",
"0.6114037",
"0.611284... | 0.7637797 | 0 |
POST /legalissues POST /legalissues.json | def create
@legalissue = Legalissue.new(legalissue_params)
respond_to do |format|
if @legalissue.save
format.html { redirect_to @legalissue, notice: 'Legalissue was successfully created.' }
format.json { render :show, status: :created, location: @legalissue }
else
format.htm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def legalissue_params\n params.require(:legalissue).permit(:name, :issue, :comment, :done)\n end",
"def create\n @issue = Issue.new(issue_params)\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to issues_url, notice: 'Issue was successfully created.' }\n form... | [
"0.6914207",
"0.6222062",
"0.6152061",
"0.61462396",
"0.6139026",
"0.611973",
"0.611973",
"0.611973",
"0.611973",
"0.60966796",
"0.59854704",
"0.5918201",
"0.5905252",
"0.58883154",
"0.58745193",
"0.5866919",
"0.58435154",
"0.5821397",
"0.58004516",
"0.5793907",
"0.5792755",
... | 0.70450634 | 0 |
PATCH/PUT /legalissues/1 PATCH/PUT /legalissues/1.json | def update
respond_to do |format|
if @legalissue.update(legalissue_params)
format.html { redirect_to @legalissue, notice: 'Legalissue was successfully updated.' }
format.json { render :show, status: :ok, location: @legalissue }
else
format.html { render :edit }
format.jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit... | [
"0.65650684",
"0.65646195",
"0.65445703",
"0.65286845",
"0.6524324",
"0.6488429",
"0.6436699",
"0.64295053",
"0.6403991",
"0.6403991",
"0.6403991",
"0.6403991",
"0.6403991",
"0.6394467",
"0.63700014",
"0.63647205",
"0.6310345",
"0.6296002",
"0.62875754",
"0.62737715",
"0.6266... | 0.697537 | 0 |
DELETE /legalissues/1 DELETE /legalissues/1.json | def destroy
@legalissue.destroy
respond_to do |format|
format.html { redirect_to legalissues_url, notice: 'Legalissue was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n issues_permissions\n @issue.destroy\n respond_to do |format|\n format.html { redirect_to issues_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @normal_issue = NormalIssue.find(params[:id])\n @normal_issue.destroy\n\n respond_to do |format|\n ... | [
"0.7490082",
"0.73655206",
"0.7324575",
"0.7291069",
"0.7239899",
"0.7239899",
"0.7239899",
"0.7239899",
"0.71790385",
"0.71443486",
"0.7019203",
"0.7019203",
"0.7019203",
"0.7019203",
"0.7019203",
"0.7019203",
"0.7018853",
"0.7018107",
"0.69881946",
"0.6968155",
"0.6956399",... | 0.7760089 | 0 |
REQUIRED. FluidFeatures will call this to determine if your user is logged in, what the unique id of this user is and any additional attributes you wish to use for selecting users. | def fluidfeatures_current_user(verbose=false)
if current_user
if verbose
{
:id => @current_user[:id],
:name => @current_user[:name],
:uniques => {
:twitter => @current_user[:twitter_id]
},
:cohorts => {
# Example attributes for ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identify_the_user\n \t@current_user = User.find_by_id(session[\"user_id\"])\n end",
"def user?\n get_mode == :user\n end",
"def user_on\n session[:user_id] = '3980284084'\n end",
"def user_id; config[:user_id]; end",
"def client_side_current_user\n if session[:user_id]\n User.... | [
"0.6494902",
"0.6472428",
"0.63992727",
"0.6356453",
"0.6355614",
"0.6339612",
"0.6291046",
"0.6288785",
"0.6267838",
"0.6265769",
"0.6265769",
"0.6265769",
"0.6265769",
"0.6265769",
"0.6265769",
"0.6265769",
"0.6265769",
"0.6265769",
"0.6265769",
"0.6230814",
"0.6205879",
... | 0.6771621 | 0 |
OPTIONAL Set default for any new features. These are only used for the first time that FluidFeatures sees a feature. This happens when this feature is deployed for the first time. | def fluidfeatures_defaults
{
# By default unknown features are disabled.
:enabled => false, # no visible to any users
# You can also use these values...
#:enabled => true, # visible to all users (use for depreciating old features)
#:enabled => 10, # 10 percent of user will see it
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_defaults\n self.featured ||= 1\n end",
"def set_default\n end",
"def default\n @default = true\n end",
"def feature_flags_with_defaults\n flag_names = FeatureFlag.pluck(:name).sort\n FeatureFlag.default_flag_hash.merge(feature_flags_for(*flag_names)).with_indifferent_access\n... | [
"0.73025465",
"0.7030864",
"0.6691541",
"0.6508182",
"0.64392126",
"0.6403648",
"0.6371976",
"0.63308704",
"0.63308704",
"0.62926894",
"0.62926894",
"0.62926894",
"0.62926894",
"0.62926894",
"0.62926894",
"0.6229842",
"0.62219995",
"0.62165314",
"0.6201505",
"0.6201505",
"0.6... | 0.7272927 | 1 |
each "number" card scores as its value | def score_numbers(cards_numbers)
cards_numbers.sum { |card| card.value.to_i }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def score\n @cards.map(&:value).inject(:+)\n end",
"def possible_scores\n card_values.inject([0]) do |memo, item|\n if ace_value?(item)\n added_one = memo.map { |score| score + 1 }\n added_one << (added_one.last + 10)\n else\n memo.map { |number| number + ite... | [
"0.76956964",
"0.75683993",
"0.7422125",
"0.7393633",
"0.726646",
"0.71756077",
"0.70987636",
"0.709381",
"0.7031035",
"0.7025631",
"0.70127255",
"0.6932173",
"0.69259346",
"0.6896456",
"0.6887969",
"0.6864512",
"0.68408483",
"0.6835614",
"0.6831197",
"0.6813478",
"0.67920417... | 0.7665152 | 1 |
each "picture" card scores as 10 | def score_pictures(cards_pictures)
cards_pictures.count * 10
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def score(cards)\n\nend",
"def score\n score = 0\n aces_count = 0\n @hand_contents.each do |card|\n if card.type == :face\n score += 10\n elsif card.type == :ace\n aces_count += 1\n score += 11\n elsif card.type == :number\n score += card.rank.to_i\n end\n... | [
"0.6931209",
"0.6881471",
"0.6875299",
"0.6792881",
"0.6695651",
"0.6609313",
"0.65657145",
"0.65402746",
"0.6505792",
"0.64568233",
"0.64367497",
"0.6379364",
"0.6326207",
"0.6300978",
"0.62843573",
"0.62837124",
"0.62398225",
"0.6170008",
"0.6141564",
"0.6128588",
"0.612218... | 0.81018424 | 0 |
each "ace" card can score 11 or 1, depending on what is closer to 21, but not exceeding 21 | def score_aces(cards_aces, score_without_aces)
# first, assume all "ace" cards score as 1
aces_count = cards_aces.count
return 0 if aces_count.zero?
# check if we can convert one ace card to 11
if (score_without_aces + aces_count <= 11)
11 + (aces_count - 1)
else
# all ace cards sti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ace_check\n cards[index_of_11][:points] = 1 if index_of_11 && (total > 21)\n end",
"def calculate_score(hand_of_cards)\n card_values = hand_of_cards.map{|card_value| card_value[1]}\n total = 0 \n card_values.each do |card_value| \n if card_value == \"ACE\"\n total+= 11\n elsif card_value.to... | [
"0.78671134",
"0.75782806",
"0.75747365",
"0.7501459",
"0.7448186",
"0.7339252",
"0.72493607",
"0.7155661",
"0.70416915",
"0.7010129",
"0.69990826",
"0.696954",
"0.69459033",
"0.69375",
"0.69259953",
"0.69159365",
"0.6891451",
"0.68762803",
"0.6831305",
"0.6802142",
"0.676052... | 0.77168137 | 1 |
GET /dvds/new GET /dvds/new.xml | def new
@dvd = Dvd.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @dvd }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @pdig = Pdig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pdig }\n end\n end",
"def new\n @dbs_... | [
"0.7429372",
"0.6814892",
"0.6732278",
"0.6720067",
"0.6705508",
"0.6691929",
"0.668242",
"0.66818345",
"0.66818345",
"0.6681061",
"0.66394335",
"0.66275203",
"0.6624707",
"0.66233355",
"0.65573037",
"0.6549791",
"0.65289134",
"0.6521459",
"0.65106595",
"0.6474533",
"0.646096... | 0.7042849 | 1 |
DELETE /dvds/1 DELETE /dvds/1.xml | def destroy
@dvd = Dvd.find(params[:id])
@dvd.destroy
respond_to do |format|
format.html { redirect_to(dvds_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @rdv = Rdv.find(params[:id])\n @rdv.destroy\n\n respond_to do |format|\n format.html { redirect_to(rdvs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\r\n @dcf = Dcf.find(params[:id])\r\n @dcf.destroy\r\n\r\n respond_to do |format|\r\n format.html ... | [
"0.6729065",
"0.6678106",
"0.6599096",
"0.65213645",
"0.64879185",
"0.64695346",
"0.639679",
"0.6383926",
"0.63635933",
"0.6357291",
"0.6327999",
"0.62914777",
"0.62910974",
"0.62866396",
"0.6248221",
"0.62423587",
"0.62402815",
"0.6238557",
"0.62075335",
"0.6204866",
"0.6198... | 0.67309105 | 0 |
Here we want to make a method add_song that takes in an argument of a song and associates that song with the artist by telling the song that it belongs to that artist. | def add_song(song)
# We want to tell the song_name passed in that it belongs to the instance
# of Artist for which this method is called on aka self.
song.artist = self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_song(song) # Third, we create 'add_song' to associate a song name with a particular artist.\n song.artist = self # When we call 'song.artist', we set the result equal to 'self', or the artist on which we are calling the method.\n end",
"def add_song(song)\n @songs << song #add... | [
"0.9042165",
"0.8549802",
"0.84904087",
"0.8483025",
"0.84642076",
"0.84505314",
"0.8435702",
"0.8414457",
"0.84127015",
"0.84127015",
"0.8391136",
"0.8389795",
"0.838415",
"0.838415",
"0.838415",
"0.838415",
"0.838415",
"0.838415",
"0.83786017",
"0.8346484",
"0.8346484",
"... | 0.86801213 | 1 |
Here we make a method add_song_by_name that takes in an argument of a song name, creates a new song with it, and associates the song and artist. | def add_song_by_name(song_name)
# Create a new song called "song" with argument passed in.
song = Song.new(song_name)
# Associate it with the artist
song.artist = self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_song_by_name(song_name)\n song = Song.new(song_name)\n song.artist = self\n @songs << song\n end",
"def add_song_by_name(name) #takes in argument name of (song)\n song = Song.new(name) #creating a new instance of a song\n song.artist = self #Right here all w... | [
"0.8796029",
"0.8791209",
"0.87682277",
"0.8764704",
"0.876115",
"0.87141365",
"0.87141365",
"0.8692366",
"0.8617347",
"0.8602969",
"0.85712034",
"0.85517794",
"0.853808",
"0.8475339",
"0.8433028",
"0.8133378",
"0.8076293",
"0.80304086",
"0.7768808",
"0.7701056",
"0.7688671",... | 0.90073407 | 0 |
returns true if current_user has a facebook profile | def facebook_profile?
@network = current_user.network ||= Network.new
!(@network.facebook.nil? || @network.facebook.blank?)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_facebook_profile?\n fb_userid.present?\n end",
"def has_profile?\n return self.profile.present?\n end",
"def connected_to_facebook?\n fb_uid && fb_access_token\n end",
"def is_current_profile?(profile)\n if current_user.present?\n @current_profile = current_user.profile\n ret... | [
"0.87015873",
"0.76989144",
"0.7509506",
"0.74241304",
"0.7413598",
"0.7387876",
"0.7323472",
"0.7251311",
"0.7251311",
"0.7223152",
"0.71958345",
"0.71569824",
"0.7134959",
"0.70727354",
"0.7048229",
"0.7044053",
"0.7040191",
"0.6987692",
"0.6985623",
"0.6981677",
"0.6973202... | 0.84910864 | 1 |
Returns current frame's `location.href`. | def url
evaluate("document.location.href")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_url\n evaluate(\"window.top.location.href\")\n end",
"def href\n `window.location.href`\n end",
"def actual_url\n @browser.current_url\n end",
"def current_url\n @rawpage.current_url\n end",
"def current_url\n request.env['REQUEST_URI']\n end",
"def cur... | [
"0.80965084",
"0.71785486",
"0.6995556",
"0.6910226",
"0.6843511",
"0.6820817",
"0.6812508",
"0.6775048",
"0.6736839",
"0.66783345",
"0.66783345",
"0.6664685",
"0.65422636",
"0.65134716",
"0.64588803",
"0.6351641",
"0.6296681",
"0.6283395",
"0.62478876",
"0.62277806",
"0.6169... | 0.724398 | 1 |
GET /drug_stores GET /drug_stores.json | def index
@drug_stores = DrugStore.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @stores = Store.all\n render json: @stores\n end",
"def show\n render json: @store\n end",
"def index\n @api_v1_stores = Store.all\n json_response(@api_v1_stores)\n end",
"def index\n @stores = Store.all.includes(:admin)\n\n respond_to do |format|\n format.html\... | [
"0.6709867",
"0.65023243",
"0.64579064",
"0.6446975",
"0.64360434",
"0.6435191",
"0.6431837",
"0.6297562",
"0.6259508",
"0.62141985",
"0.6208471",
"0.6195126",
"0.6195126",
"0.6195126",
"0.6195126",
"0.61933506",
"0.61603856",
"0.6156894",
"0.6149985",
"0.6133582",
"0.6106834... | 0.7264478 | 0 |
POST /drug_stores POST /drug_stores.json | def create
@drug_store = DrugStore.new(drug_store_params)
respond_to do |format|
if @drug_store.save
format.html { redirect_to @drug_store, notice: 'Drug store was successfully created.' }
format.json { render :show, status: :created, location: @drug_store }
else
format.html... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(add_params = nil)\n params = {\n }\n api_call('/stores(.:format)',:post,params,add_params)\n end",
"def create\n @store = Store.new(params.require(:store).permit(:break_even, :capacity, :city, :county_id, :manager_id,\n :name, :number, :number_of_lifts, :pho... | [
"0.65901494",
"0.646261",
"0.6295786",
"0.62833464",
"0.62730956",
"0.62726563",
"0.62284404",
"0.6222316",
"0.6216965",
"0.62096083",
"0.61872613",
"0.617285",
"0.617285",
"0.6149776",
"0.6136852",
"0.6096941",
"0.60839796",
"0.60568315",
"0.5993013",
"0.59866303",
"0.595221... | 0.7323824 | 0 |
PATCH/PUT /drug_stores/1 PATCH/PUT /drug_stores/1.json | def update
respond_to do |format|
if @drug_store.update(drug_store_params)
format.html { redirect_to @drug_store, notice: 'Drug store was successfully updated.' }
format.json { render :show, status: :ok, location: @drug_store }
else
format.html { render :edit }
format.jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n if @store.update(store_params)\n render json: @store\n else\n render json: @store.errors, status: :unprocessable_entity\n end\n end",
"def update\n @store = Store.find(params[:id])\n\n respond_to do |format|\n if @store.update_attributes(params.require(:s... | [
"0.65545964",
"0.6262163",
"0.6226827",
"0.6209489",
"0.6165126",
"0.61627114",
"0.61604273",
"0.61604273",
"0.61604273",
"0.61604273",
"0.6131849",
"0.61309266",
"0.60972077",
"0.60814285",
"0.6067092",
"0.6060184",
"0.6058264",
"0.60133386",
"0.60096925",
"0.60095274",
"0.5... | 0.6767939 | 0 |
DELETE /drug_stores/1 DELETE /drug_stores/1.json | def destroy
@drug_store.destroy
respond_to do |format|
format.html { redirect_to drug_stores_url, notice: 'Drug store was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @datastore = Datastore.find(params[:id])\n @datastore.destroy\n\n respond_to do |format|\n format.html { redirect_to datastores_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t\t\t @store = Store.find(params[:id])\n\t\t\t\t @store.destroy\n\n\t\... | [
"0.7103534",
"0.6975748",
"0.6972588",
"0.6972448",
"0.6972448",
"0.6972448",
"0.6972448",
"0.6964395",
"0.6964395",
"0.6964395",
"0.6964395",
"0.6918858",
"0.6855227",
"0.6850654",
"0.6846446",
"0.6846399",
"0.68323153",
"0.68154836",
"0.6805286",
"0.678241",
"0.67671454",
... | 0.7445788 | 0 |
GET /user_game_levels GET /user_game_levels.json | def index
@user_game_levels = UserGameLevel.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def levels\n response = JSON.parse(@client.get(\"/api/v1/levels\").body)\n return response[\"levels\"] || response\n end",
"def get_levels\n if params[:levels_by_nf] == 'true'\n @foundation = Foundation.find_by(name: params[:name])\n if @foundation\n render json: {levels: @founda... | [
"0.7679649",
"0.74169904",
"0.7085923",
"0.69168246",
"0.6909223",
"0.67923754",
"0.67761004",
"0.6735388",
"0.6557576",
"0.6480894",
"0.6480894",
"0.64552176",
"0.6388151",
"0.63154495",
"0.6302286",
"0.6289503",
"0.628408",
"0.62678546",
"0.62046224",
"0.6203519",
"0.620216... | 0.74439305 | 1 |
POST /user_game_levels POST /user_game_levels.json | def create
@user_game_level = UserGameLevel.new(user_game_level_params)
respond_to do |format|
if @user_game_level.save
format.html { redirect_to @user_game_level, notice: 'User game level was successfully created.' }
format.json { render :show, status: :created, location: @user_game_leve... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_game_level_params\n params.require(:user_game_level).permit(:user_game_id, :game_level_id)\n end",
"def create\n @game_level = GameLevel.new(game_level_params)\n\n respond_to do |format|\n if @game_level.save\n format.html { redirect_to @game_level, notice: 'Game level was succ... | [
"0.68166804",
"0.66407984",
"0.66223514",
"0.6443282",
"0.64159703",
"0.6394431",
"0.63865507",
"0.63865507",
"0.6385977",
"0.6376677",
"0.6305708",
"0.62947303",
"0.6218576",
"0.6195919",
"0.6159602",
"0.61058134",
"0.60856575",
"0.6084296",
"0.6029324",
"0.60020775",
"0.599... | 0.7171693 | 0 |
PATCH/PUT /user_game_levels/1 PATCH/PUT /user_game_levels/1.json | def update
respond_to do |format|
if @user_game_level.update(user_game_level_params)
format.html { redirect_to @user_game_level, notice: 'User game level was successfully updated.' }
format.json { render :show, status: :ok, location: @user_game_level }
else
format.html { render :... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @game_level.update(game_level_params)\n format.html { redirect_to @game_level, notice: 'Game level was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_level }\n else\n format.html { render :edit }\n ... | [
"0.7083745",
"0.6962488",
"0.69384944",
"0.6766968",
"0.67299163",
"0.6706209",
"0.6613066",
"0.6599353",
"0.65270686",
"0.65017706",
"0.64997035",
"0.6496667",
"0.6411599",
"0.63944346",
"0.63325256",
"0.63192433",
"0.6298037",
"0.6285173",
"0.62652344",
"0.625497",
"0.62305... | 0.7388686 | 0 |
DELETE /user_game_levels/1 DELETE /user_game_levels/1.json | def destroy
@user_game_level.destroy
respond_to do |format|
format.html { redirect_to user_game_levels_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @game_level.destroy\n respond_to do |format|\n format.html { redirect_to game_levels_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @level.destroy\n respond_to do |format|\n format.html { redirect_to levels_url }\n format.json { head :no_co... | [
"0.7574058",
"0.73912174",
"0.73760444",
"0.7357212",
"0.7175903",
"0.71207124",
"0.70038354",
"0.6990399",
"0.6952091",
"0.6905523",
"0.6818826",
"0.6762851",
"0.675949",
"0.675949",
"0.6747088",
"0.6666204",
"0.6618588",
"0.65951085",
"0.6594954",
"0.65947294",
"0.65925294"... | 0.7834086 | 0 |
GET /glass_store_links GET /glass_store_links.json | def index
@glass_store_links = GlassStoreLink.all
@glass_store_links.each do |glass_store_link|
@glass = Glass.find(glass_store_link.glass_id)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_glass_store_link\n @glass_store_link = GlassStoreLink.find(params[:id])\n end",
"def index\n render json: @links\n end",
"def index\n links = all_links\n render json: { success: true, links: links }\n end",
"def get_links(service)\n\t\treturn @transport.get_path(\"links\",service)\... | [
"0.68160135",
"0.6572148",
"0.65378535",
"0.6456903",
"0.63367766",
"0.6296662",
"0.6205558",
"0.6098075",
"0.60904443",
"0.60904443",
"0.6042652",
"0.59915334",
"0.5979884",
"0.59631354",
"0.59516263",
"0.59302264",
"0.5912459",
"0.5906209",
"0.5906209",
"0.5906209",
"0.5906... | 0.74833053 | 0 |
PATCH/PUT /glass_store_links/1 PATCH/PUT /glass_store_links/1.json | def update
respond_to do |format|
if @glass_store_link.update(glass_store_link_params)
format.html { redirect_to @glass_store_link, notice: 'Glass store link was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.js... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n update_and_respond(@link, link_params)\n end",
"def update\n @link = Link.find(params[:id])\n paginate_all_links\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to root_url+\"#show-links\", notice: 'Link was successfully updated.... | [
"0.64537716",
"0.64327043",
"0.6407661",
"0.63829696",
"0.63622206",
"0.6321147",
"0.62963456",
"0.6267089",
"0.62629944",
"0.62629944",
"0.625568",
"0.6173176",
"0.6167491",
"0.61569244",
"0.6146763",
"0.61368936",
"0.61368936",
"0.61368936",
"0.61368936",
"0.61368936",
"0.6... | 0.7342254 | 0 |
DELETE /glass_store_links/1 DELETE /glass_store_links/1.json | def destroy
@glass_store_link.destroy
respond_to do |format|
format.html { redirect_to glass_store_links_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete; rest_delete(link('self')); end",
"def delete; rest_delete(link('self')); end",
"def destroy\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :ok }\n end\n end",
"def delete\n delete_from_server single_url\n end",
... | [
"0.72141606",
"0.72141606",
"0.6916389",
"0.6848405",
"0.67865056",
"0.6749795",
"0.6717293",
"0.670681",
"0.6705216",
"0.6702807",
"0.6702807",
"0.6702807",
"0.6688399",
"0.66583216",
"0.66334695",
"0.6627897",
"0.66239774",
"0.66220963",
"0.66187125",
"0.66187125",
"0.66187... | 0.7869396 | 0 |
test comment ^^^ meta.function.method.withoutarguments.ruby keyword.control.def.ruby ^^^^^^ meta.function.method.withoutarguments.ruby entity.name.function.ruby ^ punctuation.separator.statement.ruby ^^^^^ variable.other.ruby ^ punctuation.separator.object.ruby ^^^^^ variable.other.ruby ^ keyword.operator.assignment.ru... | def method # test comment
# ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby
# ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby
# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby
# ^^^^^^^^^^^^^ comment.line.number-sign.ru... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method_without_parentheses *a, **b, &c # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby storag... | [
"0.74315435",
"0.73857355",
"0.7227881",
"0.67796427",
"0.67796427",
"0.67796427",
"0.67796427",
"0.6574589",
"0.6574589",
"0.6574589",
"0.6574589",
"0.65241516",
"0.6462989",
"0.6428282",
"0.6350332",
"0.6297015",
"0.6294113",
"0.6287649",
"0.6274447",
"0.62367874",
"0.62367... | 0.90345776 | 0 |
test comment ^^^ meta.function.method.witharguments.ruby keyword.control.def.ruby ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.witharguments.ruby entity.name.function.ruby ^ meta.function.method.witharguments.ruby punctuation.definition.parameters.ruby ^ meta.function.method.witharguments.ruby variable.parameter.functi... | def method_with_parentheses(a, b, c = [foo,bar,baz]) # test comment
# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby
# ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby
# ^ meta.function.method.with-arguments.ruby punctuation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method # test comment\n# ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby\n# ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.numbe... | [
"0.85339177",
"0.7283759",
"0.71949273",
"0.62480134",
"0.60588056",
"0.594318",
"0.594318",
"0.594318",
"0.594318",
"0.5935349",
"0.5935349",
"0.5935349",
"0.5935349",
"0.58191425",
"0.58144915",
"0.5764691",
"0.57327837",
"0.5720057",
"0.5716596",
"0.568763",
"0.56681824",
... | 0.7403491 | 1 |
Reverse the IP address for the inaddr.arpa zone | def reverse_ip(ipaddress)
reverse_ip = IPAddr.new ipaddress
reverse_ip.reverse
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reverses\n if @family == Socket::AF_INET\n if self.length == 32\n [ self.reverse ]\n else\n boundary = self.length % 8 == 0 && self.length != 0 ? self.length / 8 - 1 : self.length / 8\n divisor = (boundary + 1) * 8\n count = (self.last.to_i - self.first.to_i) / (1 << 32... | [
"0.68461573",
"0.6763319",
"0.6297015",
"0.6206993",
"0.61474293",
"0.6120734",
"0.60907465",
"0.6047302",
"0.6026123",
"0.5990444",
"0.58971715",
"0.5872474",
"0.58502626",
"0.58052695",
"0.5774855",
"0.57199717",
"0.5684227",
"0.5684227",
"0.56642294",
"0.5632766",
"0.56078... | 0.8084351 | 0 |
GET /police_units GET /police_units.json | def index
@police_units = PoliceUnit.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def foods_units\n get('/foods/units.json')\n end",
"def units\n @units = Item.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units += Detail.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units = @uni... | [
"0.77088684",
"0.6707797",
"0.66707706",
"0.65505856",
"0.6391909",
"0.6391407",
"0.6386095",
"0.63806885",
"0.63610554",
"0.62738866",
"0.62525475",
"0.6187228",
"0.6159946",
"0.6151872",
"0.6151586",
"0.61315656",
"0.61315656",
"0.61315656",
"0.61315656",
"0.61315656",
"0.6... | 0.7100343 | 1 |
POST /police_units POST /police_units.json | def create
@police_unit = PoliceUnit.new(police_unit_params)
respond_to do |format|
if @police_unit.save
format.html { redirect_to @police_unit, notice: 'Police unit was successfully created.' }
format.json { render :show, status: :created, location: @police_unit }
else
form... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def police_unit_params\n params.require(:police_unit).permit(:name)\n end",
"def unit_params\n params.require(:unit).permit(:user_id, :building_id, :floor_number, :side, :unit_number, :area, :resident_count)\n end",
"def unit_params\n params.require(:unit).permit(:short_label, :long_label,... | [
"0.68024886",
"0.6286745",
"0.61887956",
"0.61375326",
"0.6131262",
"0.6131262",
"0.6064084",
"0.6011934",
"0.599415",
"0.5967944",
"0.5943915",
"0.59236676",
"0.5913525",
"0.59119546",
"0.59108055",
"0.5897829",
"0.5892359",
"0.5868904",
"0.5855435",
"0.5854826",
"0.5852203"... | 0.70055985 | 0 |
PATCH/PUT /police_units/1 PATCH/PUT /police_units/1.json | def update
respond_to do |format|
if @police_unit.update(police_unit_params)
format.html { redirect_to @police_unit, notice: 'Police unit was successfully updated.' }
format.json { render :show, status: :ok, location: @police_unit }
else
format.html { render :edit }
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n params.require(%i[id units])\n retrieve_and_validate_put.update!(units: params[:units])\n head :no_content\n end",
"def update\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n query = {\n 'name' => params[:name]\n }\n response = HTTParty.put(url, :query... | [
"0.725439",
"0.66535574",
"0.64343554",
"0.64299977",
"0.63783497",
"0.6377676",
"0.6337713",
"0.63096845",
"0.62711847",
"0.62492824",
"0.61797994",
"0.6176337",
"0.6156407",
"0.6142014",
"0.61223763",
"0.6110088",
"0.61057603",
"0.60966545",
"0.6091156",
"0.60808694",
"0.60... | 0.7327537 | 0 |
DELETE /police_units/1 DELETE /police_units/1.json | def destroy
@police_unit.destroy
respond_to do |format|
format.html { redirect_to police_units_url, notice: 'Police unit was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n response = HTTParty.delete(url, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n redirect_to units_url, notice: 'Unit was successfully deleted.'\n end",
"def destroy\n @base_unit.destroy\n respond_to do ... | [
"0.7377552",
"0.7196428",
"0.7112594",
"0.70558965",
"0.70533097",
"0.70533097",
"0.70533097",
"0.70533097",
"0.7045154",
"0.704073",
"0.70177144",
"0.6928192",
"0.69131756",
"0.6911436",
"0.6890533",
"0.68621445",
"0.6824292",
"0.68233156",
"0.6813879",
"0.6808456",
"0.68017... | 0.74588656 | 0 |
POST /team_years POST /team_years.json | def create
@team_year = TeamYear.new(team_year_params)
respond_to do |format|
if @team_year.save
format.html { redirect_to @team_year, notice: 'Team year was successfully created.' }
format.json { render :show, status: :created, location: @team_year }
else
format.html { rend... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @team_year = TeamYear.new(team_year_params)\n\n respond_to do |format|\n if @team_year.save\n format.html { redirect_to @team_year, notice: 'Team year was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team_year }\n else\n ... | [
"0.7126538",
"0.68674433",
"0.68016756",
"0.667947",
"0.65270364",
"0.65270364",
"0.6486491",
"0.6351944",
"0.62293893",
"0.6184752",
"0.6135743",
"0.6135743",
"0.6118629",
"0.61119145",
"0.60461664",
"0.6036638",
"0.60352916",
"0.59885275",
"0.59883964",
"0.5967399",
"0.5892... | 0.7204664 | 0 |
PATCH/PUT /team_years/1 PATCH/PUT /team_years/1.json | def update
respond_to do |format|
if @team_year.update(team_year_params)
format.html { redirect_to @team_year, notice: 'Team year was successfully updated.' }
format.json { render :show, status: :ok, location: @team_year }
else
format.html { render :edit }
format.json { r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @team_year.update(team_year_params)\n format.html { redirect_to @team_year, notice: 'Team year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json... | [
"0.7258103",
"0.6863658",
"0.67249566",
"0.6508965",
"0.6507997",
"0.6507997",
"0.6499393",
"0.6488017",
"0.6484749",
"0.6467119",
"0.64489543",
"0.64489543",
"0.6444716",
"0.6444716",
"0.6444716",
"0.6444716",
"0.6444716",
"0.6444716",
"0.64426476",
"0.64426476",
"0.64086086... | 0.72314394 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.