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 |
|---|---|---|---|---|---|---|
GET /enrolled_scores/1 GET /enrolled_scores/1.json | def show
@enrolled_score = EnrolledScore.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @enrolled_score }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @enrolled_score = EnrolledScore.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @enrolled_score }\n end\n end",
"def index\n @scores = Score.all\n\n respond_to do |format|\n format.html # index.html.erb\n form... | [
"0.7364148",
"0.713677",
"0.70864064",
"0.6824758",
"0.675787",
"0.6751253",
"0.6751253",
"0.6747894",
"0.6723467",
"0.6696465",
"0.6679241",
"0.66767514",
"0.6645658",
"0.6629436",
"0.65871304",
"0.65810555",
"0.65552485",
"0.65534526",
"0.65534526",
"0.65534526",
"0.652552"... | 0.79492754 | 0 |
GET /enrolled_scores/new GET /enrolled_scores/new.json | def new
@enrolled_score = EnrolledScore.new
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @enrolled_score }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @score = Score.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @score }\n end\n end",
"def new\n @score = Score.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @score }\n end\n end"... | [
"0.7724893",
"0.7724893",
"0.7653757",
"0.75568426",
"0.75476986",
"0.74960244",
"0.72854",
"0.72817767",
"0.7274524",
"0.7193825",
"0.7137036",
"0.71213657",
"0.7111504",
"0.7076221",
"0.7067663",
"0.7067663",
"0.70469695",
"0.70456177",
"0.70261896",
"0.6998579",
"0.6982083... | 0.8289539 | 0 |
POST /enrolled_scores POST /enrolled_scores.json | def create
@enrolled_score = EnrolledScore.new(params[:enrolled_score])
respond_to do |format|
if @enrolled_score.save
format.html { redirect_to @enrolled_score, :notice => t('selecao_admin.flash_messages.successfully_created', :model => @enrolled_score.class.model_name.human) }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n score = current_user.scores.new(score_params)\n\n if score.save\n render json: score\n else\n render json: { errors: score.errors.join(',') }, status: 422\n end\n end",
"def new\n @enrolled_score = EnrolledScore.new\n \n respond_to do |format|\n format.html #... | [
"0.72698176",
"0.70734835",
"0.6950084",
"0.6886128",
"0.68583757",
"0.67395294",
"0.67395294",
"0.6681131",
"0.6654938",
"0.6654938",
"0.66040945",
"0.65855503",
"0.65548396",
"0.65105915",
"0.6498581",
"0.6495733",
"0.6434336",
"0.6415318",
"0.6405162",
"0.6282225",
"0.6257... | 0.7669158 | 0 |
PUT /enrolled_scores/1 PUT /enrolled_scores/1.json | def update
@enrolled_score = EnrolledScore.find(params[:id])
respond_to do |format|
if @enrolled_score.update_attributes(params[:enrolled_score])
format.html { redirect_to @enrolled_score, :notice => t('selecao_admin.flash_messages.successfully_updated', :model => @enrolled_score.class.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_score\n question_params = params.require(:question).permit(:id, :score)\n\n render json: Question.update_score(question_params)\n end",
"def update\n @score = Score.find(params[:id])\n\n respond_to do |format|\n if @score.update_attributes(params[:score])\n format.ht... | [
"0.7013944",
"0.68859345",
"0.68859345",
"0.68859345",
"0.6808532",
"0.67891353",
"0.67891353",
"0.67891353",
"0.67891353",
"0.67533666",
"0.671632",
"0.6694003",
"0.6692928",
"0.6582246",
"0.65721697",
"0.65700793",
"0.6567353",
"0.6558193",
"0.6521755",
"0.6455358",
"0.6434... | 0.75799346 | 0 |
DELETE /enrolled_scores/1 DELETE /enrolled_scores/1.json | def destroy
@enrolled_score = EnrolledScore.find(params[:id])
@enrolled_score.destroy
respond_to do |format|
format.html { redirect_to enrolled_scores_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @score.destroy\n respond_to do |format|\n format.html { redirect_to scores_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @score = Score.find(params[:id])\n @score.destroy\n\n respond_to do |format|\n format.html { redirect_to scores_url }\n ... | [
"0.75194716",
"0.7400891",
"0.7400891",
"0.7400891",
"0.7400891",
"0.73859453",
"0.73463345",
"0.7313429",
"0.7271169",
"0.7227591",
"0.7227591",
"0.7227591",
"0.7227591",
"0.71666104",
"0.71637857",
"0.71455",
"0.712116",
"0.71194524",
"0.71194524",
"0.7104779",
"0.7093619",... | 0.77627677 | 0 |
Returns the offset that was given in the request | def offset
@offset ||= raw_response['response']['start']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_offset\n @offset\n end",
"def offset\n sanitize search_params['offset']\n end",
"def offset()\n @offset__\n end",
"def offset\n execute['offset']\n end",
"def get_current_offset\n @offset < 0 ? 0 : @offset\n end",
"def offset\n limit_an... | [
"0.83975756",
"0.7800804",
"0.7694254",
"0.7447479",
"0.74038315",
"0.73133326",
"0.730925",
"0.73012954",
"0.72694385",
"0.7230044",
"0.722516",
"0.722283",
"0.72023773",
"0.7188196",
"0.71738625",
"0.70578796",
"0.70578796",
"0.70578796",
"0.7044722",
"0.69927454",
"0.69457... | 0.78759104 | 1 |
Helper for displaying a given field (first tries the highlight, then the stored value) | def display_for(doc, field)
highlights_for(doc['unique_id'], field) || doc[field]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def highlight(field_name)\n highlights(field_name).first\n end",
"def render_field(label, value)\n render_field_content(label, (h value))\n end",
"def display_field\n current_field_values_with_field_type_id(field_types.first.id).first.try(:value) || 'no display field available'\n end",
"d... | [
"0.66360116",
"0.65344566",
"0.64229006",
"0.64062375",
"0.6378067",
"0.63744247",
"0.6296703",
"0.60968494",
"0.6080412",
"0.60333765",
"0.6029947",
"0.6002301",
"0.6001936",
"0.5997678",
"0.5971128",
"0.59649956",
"0.59589076",
"0.59544677",
"0.59321433",
"0.5929533",
"0.58... | 0.7532586 | 0 |
Returns the highlights for a given id for a given field | def highlights_for(unique_id, field)
raw_response['highlighting'] ||= {}
raw_response['highlighting'][unique_id] ||= {}
raw_response['highlighting'][unique_id][field]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def highlights(field_name = nil)\n if field_name.nil?\n highlights_cache.values.flatten \n else\n highlights_cache[field_name.to_sym]\n end || []\n end",
"def highlight(field_name)\n highlights(field_name).first\n end",
"def highlights\n @solr_data[:... | [
"0.72343576",
"0.6988769",
"0.66050494",
"0.6603448",
"0.65995955",
"0.65995955",
"0.65995955",
"0.65439826",
"0.62912464",
"0.626399",
"0.6263871",
"0.6194471",
"0.5993255",
"0.58568305",
"0.578976",
"0.5739368",
"0.5739368",
"0.57009244",
"0.5595658",
"0.55736756",
"0.54975... | 0.79082835 | 0 |
Returns all of the facet queries | def facet_queries
@facet_queries ||= facets['facet_queries'] || {}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facet_queries\n @facet_queries ||= facet_counts['facet_queries'] || {}\n end",
"def facet_queries\n @facet_queries ||= facet_counts['facet_queries'] || {}\n end",
"def facets\n self.facet_list.any? ? SearchFacet.where(:identifier.in => self.facet_list) : SearchFacet.visible\n end",
"def facet... | [
"0.7699961",
"0.7699961",
"0.72593987",
"0.6977772",
"0.6948198",
"0.68664515",
"0.68663245",
"0.6819633",
"0.6814148",
"0.67839456",
"0.6762405",
"0.661558",
"0.65688324",
"0.64851075",
"0.6433383",
"0.6424039",
"0.6422826",
"0.6400028",
"0.63898635",
"0.6382945",
"0.6332879... | 0.79379267 | 0 |
Returns the count for the given field/value pair | def facet_field_count(field, value)
facet_fields_by_hash[field.to_s][value.to_s] if facet_fields_by_hash[field.to_s]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def field_count(field)\n return 0 if /^(\\w+)s_versions/.match?(field.to_s)\n\n # constantize is safe here because `field` is not user input\n FIELD_QUERIES[field]&.count || field.to_s.classify.constantize.count\n end",
"def value_count(hash, value)\n hash.select { |_k, v| v == value }.length\nend",
... | [
"0.698522",
"0.6873907",
"0.6811726",
"0.6738298",
"0.66344357",
"0.66197896",
"0.6560104",
"0.64770913",
"0.6427973",
"0.6368535",
"0.6365065",
"0.632001",
"0.6258066",
"0.62240195",
"0.6157146",
"0.6151686",
"0.61318624",
"0.60647434",
"0.60407794",
"0.60309434",
"0.6027806... | 0.7691915 | 0 |
Returns the counts for a given facet_query_name | def facet_query_count_by_key(facet_query_key)
facet_queries[facet_query_key.to_s]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facet_queries\n @facet_queries ||= facet_counts['facet_queries'] || {}\n end",
"def facet_queries\n @facet_queries ||= facet_counts['facet_queries'] || {}\n end",
"def results_count(query)\n refresh_elasticsearch\n Opportunity.__elasticsearch__.search(query: query[:query],\n ... | [
"0.69817835",
"0.69817835",
"0.68778104",
"0.66933393",
"0.6689976",
"0.65545374",
"0.6524657",
"0.63777614",
"0.63579404",
"0.63351923",
"0.6282268",
"0.62799156",
"0.62645364",
"0.621667",
"0.61970013",
"0.6186021",
"0.6163584",
"0.6136508",
"0.60974234",
"0.60519683",
"0.6... | 0.8048948 | 0 |
Create multiple rooms for the hotel. | def create_rooms(rooms_params)
rooms_params[:extra_info] ||= ""
rooms_params[:range].each do |number|
rooms << Room.create( number: number.to_i,
capacity: rooms_params[:capacity].to_i,
extra_info: rooms_params[:extra_info],
name: rooms_params[:name] )
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_hotel_rooms\n (1..20).each do |num|\n @all_rooms << num #Hotel::Room.new(num) I don't think I have to do this\n end\n end",
"def create_rooms(rooms_id_array)\n if self.room_areas.empty?\n 1.upto(self.bedrooms) do \n room_area = RoomArea.new(:property_id => self.id,\n ... | [
"0.8082136",
"0.7784406",
"0.682074",
"0.67886865",
"0.6748974",
"0.66174585",
"0.66144365",
"0.65795076",
"0.65550345",
"0.65462756",
"0.6497435",
"0.6491688",
"0.64914095",
"0.64692",
"0.6443607",
"0.6394163",
"0.6339617",
"0.63248146",
"0.6320879",
"0.6310198",
"0.6309739"... | 0.78060424 | 1 |
Returns the capcity of the hotel based on the sum of the capacity of its rooms | def capacity
capacity = 0
rooms.all.each do |room|
capacity += room.capacity
end
capacity
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def house_capacity\n has_reserved_seating? ? seatmap.seat_count : attributes['house_capacity']\n end",
"def get_rooms_by_capacity(range_filter, room, rooms_capacity)\n range = split_string(range_filter)\n if room.capacity >= range[0].to_i && room.capacity < range[1].to_i\n rooms_capacity << room\n... | [
"0.65121174",
"0.645556",
"0.64078385",
"0.6084425",
"0.603976",
"0.59885114",
"0.59358305",
"0.591256",
"0.58992904",
"0.58814365",
"0.58691144",
"0.5807097",
"0.5793603",
"0.5788157",
"0.5742271",
"0.57110983",
"0.5663643",
"0.56625175",
"0.56538224",
"0.5649196",
"0.560322... | 0.69363534 | 0 |
Returns an array with all users inside the rooms of the hotel | def users
users = []
rooms.each do |room|
room.users.each do |user|
users << user
end
end
users
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_all_rooms_in_hotel\n\n return @rooms.map { |room| room }\n end",
"def users(*room_names)\n users = Hpricot(get.body).search(\"div.room\").collect do |room|\n if room_names.empty? || room_names.include?((room/\"h2/a\").inner_html)\n room.search(\"//li.user\").collect { |user|... | [
"0.7864",
"0.7080872",
"0.7049938",
"0.7011431",
"0.6878699",
"0.6860403",
"0.6707236",
"0.66398877",
"0.661424",
"0.65959454",
"0.6512391",
"0.6502784",
"0.6447893",
"0.64208484",
"0.64175427",
"0.64134425",
"0.6411824",
"0.6397663",
"0.6381197",
"0.635584",
"0.6349109",
"... | 0.79857415 | 0 |
Returns the number of people inside the hotel | def number_of_people
users.length
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_guests_in_rooms()\n guests_in_bar = 0\n for room in @rooms\n guests_in_bar += room.guests_in_room()\n end\n return guests_in_bar\n end",
"def guest_count\n return @guests.count\n end",
"def check_in_count()\n return @guests.length #guests array length\n end",
"def passenge... | [
"0.6798899",
"0.6787638",
"0.6757495",
"0.67293143",
"0.66701454",
"0.66249317",
"0.6619746",
"0.6609006",
"0.66055214",
"0.66024345",
"0.6484868",
"0.6467623",
"0.6467442",
"0.64547175",
"0.6448798",
"0.643226",
"0.6425737",
"0.6401865",
"0.6401058",
"0.63738364",
"0.6348555... | 0.6813858 | 0 |
=begin logic for sending Emails. if current_user.id matches the resource_requests/user_id then he is the project manager and the email should go to admin. else it will go to project managers from current_user.id parameters need to be passed current_user object and resource_request object. =end | def ResourceRequestsAndReply(current_user, resource_request, comments)
@current_user = current_user
@resource_request = resource_request
@comments = comments
if ['submitted'].include?(@resource_request.status)
# @admin = true
@message = "Hi, <br/> #{@current_user.full_name()} has requested r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin_request # :prefetch: :norobots:\n sender = @user\n pass_query_params\n if @project = find_or_goto_index(Project, params[:id].to_s)\n if request.method == :post\n subject = params[:email][:subject]\n content = params[:email][:content]\n for receiver in @project.admin_gro... | [
"0.68854",
"0.6523105",
"0.6332865",
"0.62843895",
"0.62825876",
"0.62142384",
"0.6180528",
"0.61587936",
"0.6148605",
"0.6063049",
"0.60549706",
"0.60544926",
"0.60397464",
"0.6033936",
"0.602889",
"0.6026375",
"0.6009743",
"0.59850353",
"0.59807867",
"0.59780246",
"0.597313... | 0.6561742 | 1 |
GET /intervals/1 GET /intervals/1.json | def show
@interval = Interval.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @interval }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def intervals\n rest.get instrument_path('activeIntervals')\n end",
"def show\n Interval.find(params[:id])\n end",
"def get_interval_data(sensor_id, access_token, interval)\n data= MySmartGrid.get(\n \"/sensor/#{sensor_id}?interval=#{interval}&resolution=minute&unit=watt\",\n :headers ... | [
"0.80088484",
"0.6778432",
"0.6346739",
"0.63318133",
"0.6281635",
"0.62257814",
"0.6077866",
"0.6046728",
"0.60460895",
"0.6005589",
"0.5893589",
"0.5859223",
"0.58526427",
"0.5831104",
"0.5824255",
"0.5784098",
"0.5742841",
"0.5730703",
"0.5706181",
"0.564695",
"0.5617343",... | 0.7081861 | 1 |
GET /intervals/new GET /intervals/new.json | def new
@interval = Interval.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @interval }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @interval = Interval.new(params[:interval])\n\n respond_to do |format|\n if @interval.save\n format.html { redirect_to @interval, notice: 'Interval was successfully created.' }\n format.json { render json: @interval, status: :created, location: @interval }\n else\n ... | [
"0.7264185",
"0.7137619",
"0.6408773",
"0.6279478",
"0.61838967",
"0.615904",
"0.60526365",
"0.6005903",
"0.598918",
"0.5953488",
"0.5936657",
"0.5854133",
"0.58369577",
"0.579972",
"0.5781284",
"0.5769225",
"0.5748122",
"0.5702627",
"0.5683337",
"0.56713635",
"0.56399065",
... | 0.7943582 | 0 |
POST /intervals POST /intervals.json | def create
@interval = Interval.new(params[:interval])
respond_to do |format|
if @interval.save
format.html { redirect_to @interval, notice: 'Interval was successfully created.' }
format.json { render json: @interval, status: :created, location: @interval }
else
format.html ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @interval = Interval.new(interval_params)\n\n respond_to do |format|\n if @interval.save\n format.html { redirect_to @interval, notice: 'Interval was successfully created.' }\n format.json { render :show, status: :created, location: @interval }\n else\n format.html... | [
"0.6927481",
"0.67218024",
"0.6366835",
"0.6256302",
"0.59467745",
"0.5943228",
"0.5845371",
"0.5840887",
"0.57896054",
"0.57688963",
"0.5756314",
"0.57203054",
"0.5698124",
"0.5609115",
"0.5449912",
"0.5426786",
"0.5344713",
"0.5296285",
"0.5284035",
"0.52645314",
"0.5251820... | 0.69765866 | 0 |
PUT /intervals/1 PUT /intervals/1.json | def update
@interval = Interval.find(params[:id])
respond_to do |format|
if @interval.update_attributes(params[:interval])
format.html { redirect_to @interval, notice: 'Interval was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_interval\n @interval = Interval.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @interval.update(interval_params)\n format.html { redirect_to @interval, notice: 'Interval was successfully updated.' }\n format.json { render :show, status: :ok, location: @i... | [
"0.6427973",
"0.63097686",
"0.6118346",
"0.5999847",
"0.575412",
"0.571396",
"0.568996",
"0.56198615",
"0.56122905",
"0.54825395",
"0.5443053",
"0.54045177",
"0.5391283",
"0.5360666",
"0.5324008",
"0.52961034",
"0.52954674",
"0.5286055",
"0.526202",
"0.5248202",
"0.5248202",
... | 0.6662279 | 0 |
DELETE /intervals/1 DELETE /intervals/1.json | def destroy
@interval = Interval.find(params[:id])
@interval.destroy
respond_to do |format|
format.html { redirect_to intervals_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @interval = Interval.find(params[:id])\n @interval.destroy\n redirect_to(intervals_url)\n end",
"def destroy\n @interval.destroy\n respond_to do |format|\n format.html { redirect_to intervals_url, notice: 'Interval was successfully destroyed.' }\n format.json { head :no_co... | [
"0.73726887",
"0.7306665",
"0.6756895",
"0.6610774",
"0.63216203",
"0.62866354",
"0.6198366",
"0.615666",
"0.61230856",
"0.61127913",
"0.60606503",
"0.5990973",
"0.59823424",
"0.5953434",
"0.59455365",
"0.5942608",
"0.59171945",
"0.5908938",
"0.5899089",
"0.5884848",
"0.58682... | 0.76928604 | 0 |
Construct a BrowseEverything::FileEntry object | def entry_for(name, size, date, dir)
BrowseEverything::FileEntry.new(name, [key, name].join(':'), File.basename(name), size, date, dir)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def directory_entry(file)\n BrowseEverything::FileEntry.new(file.id, \"#{key}:#{file.id}\", file.name, file.size, file.created_at, file.type == 'folder')\n end",
"def make_entry()\n\n seq_id = @filehandler.readline.chomp\n puts seq_id\n sequence = @filehandler.readline.chomp\n ide... | [
"0.707368",
"0.6435443",
"0.60239404",
"0.60206103",
"0.6004584",
"0.6004584",
"0.5979974",
"0.5979406",
"0.5894683",
"0.5795043",
"0.5780083",
"0.5776476",
"0.5754656",
"0.5693253",
"0.5684063",
"0.56812537",
"0.55654967",
"0.5563625",
"0.55517024",
"0.55432194",
"0.551408",... | 0.7328789 | 0 |
Given a listing and a S3 listing and path, populate the entries | def add_files(listing, path)
listing.contents.each do |entry|
key = from_base(entry.key)
new_entry = entry_for(key, entry.size, entry.last_modified, false)
@entries << new_entry unless strip(key) == strip(path) || new_entry.nil?
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n foldernames = []\n if listing_params.has_key?('photo') && @listing.photo.present?\n foldernames.push(@listing.photo.match(/uploads.*/)[0])\n end\n if listing_params.has_key?('manual') && @listing.manual.present?\n foldernames.push(@listing.manual.match(/uploads.*/)[0])\n end\n... | [
"0.599189",
"0.59633696",
"0.5762322",
"0.5449545",
"0.53749627",
"0.5353506",
"0.5343103",
"0.530078",
"0.52214676",
"0.5099324",
"0.5081939",
"0.5073247",
"0.50525165",
"0.5037741",
"0.5031225",
"0.49870032",
"0.49837878",
"0.49469855",
"0.49145597",
"0.49112913",
"0.490404... | 0.6207067 | 0 |
Read the failing log from our test stack | def read_failing_log()
failed_files = []
# Read in the file
file = File.readlines(@failing_log)
# Get lines which begin with rspec
file.each do |line|
if line =~ /rspec \.\//
# Get the file name only
failed_files << get_error_info(line)
end
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log\n File.read(SPEC_LOG) rescue \"\"\n end",
"def log_and_fail_test(exception)\n @logger.error(exception.inspect)\n bt = exception.backtrace\n @logger.pretty_backtrace(bt).each_line do |line|\n @logger.error(line)\n end\n @test_status = :error\n ... | [
"0.65006655",
"0.62214607",
"0.59948045",
"0.59848666",
"0.58924156",
"0.5834719",
"0.57631034",
"0.5689074",
"0.56279415",
"0.56176585",
"0.55789346",
"0.55740136",
"0.5520207",
"0.5510251",
"0.550669",
"0.54862994",
"0.54499424",
"0.54341286",
"0.54132015",
"0.54132015",
"0... | 0.71612245 | 0 |
POST /session_events POST /session_events.json | def create
@session_event = SessionEvent.new(session_event_params)
respond_to do |format|
if @session_event.save
format.html { redirect_to @session_event, notice: 'Session event was successfully created.' }
format.json { render :show, status: :created, location: @session_event }
els... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @session = @event.sessions.new(params[:session])\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to [@event, @session], notice: 'Session was successfully created.' }\n format.json { render json: [@event, @session], status: :created, location: [@event, @s... | [
"0.7517827",
"0.7058798",
"0.6721352",
"0.66793525",
"0.6621008",
"0.66182894",
"0.6571327",
"0.652709",
"0.6447281",
"0.6414531",
"0.6405927",
"0.6403908",
"0.6388276",
"0.6371743",
"0.6354938",
"0.6330283",
"0.6285086",
"0.6273645",
"0.62593985",
"0.616768",
"0.6149811",
... | 0.7557729 | 0 |
DELETE /session_events/1 DELETE /session_events/1.json | def destroy
@session_event.destroy
respond_to do |format|
format.html { redirect_to session_events_url, notice: 'Session event was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n\n @session = @event.sessions.find(params[:id])\n\n #when destroying the last session, also destroy the related event\n #i know i can refactor this\n # event = Event.find(@session.event_id)\n # if event.sessions.count == 1\n # event.destroy\n # end\n \n @session.destroy\n\... | [
"0.7367564",
"0.7260218",
"0.71650034",
"0.71180654",
"0.71180654",
"0.71180654",
"0.7074594",
"0.7038552",
"0.7034156",
"0.70272607",
"0.7016465",
"0.7013384",
"0.70056844",
"0.69898",
"0.69881374",
"0.69881374",
"0.69881374",
"0.69881374",
"0.69881374",
"0.69881374",
"0.698... | 0.75508803 | 0 |
name: select_exam explanation: this method associate select_exam view with this controller parameters: none return: select_exam | def select_exam
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_exam\n\t\t@exam = Exam.find(params[:id])\n\tend",
"def set_exam\r\n @exam = Exam.find(params[:id])\r\n end",
"def set_exam\n @exam = Exam.find(params[:id])\n end",
"def set_exam\n @exam = Exam.find(params[:id])\n end",
"def set_exam\n @exam = Exam.find(params[:id])\n end... | [
"0.7294504",
"0.7265085",
"0.7234758",
"0.72006327",
"0.7199503",
"0.7199503",
"0.7199503",
"0.7199503",
"0.7199503",
"0.7199503",
"0.7199503",
"0.7199503",
"0.7199503",
"0.71032923",
"0.706874",
"0.70462865",
"0.7034299",
"0.6945866",
"0.68353766",
"0.67811567",
"0.6737791",... | 0.83269066 | 0 |
name: exams_statistics explanation: this method associate exams_statistics view with this controller parameters: none return: exams_statistics | def exams_statistics
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def statistics\n @survey = Survey.find(params[:survey_id])\n @result = @survey.results.find(params[:id])\n end",
"def index\n @exam_results = ExamResult.order(:week_s => :desc).first(200)\n @exam_results_all = ExamResult.all\n\n @exam_results_weeks = ExamResult.count(:week_s)\n @exams_results_... | [
"0.6563129",
"0.63776696",
"0.63682985",
"0.6346621",
"0.63041836",
"0.6240867",
"0.6188893",
"0.6098332",
"0.6098332",
"0.6098332",
"0.60977805",
"0.6015416",
"0.60016423",
"0.6000348",
"0.5968198",
"0.59553456",
"0.5925617",
"0.5903492",
"0.5892124",
"0.58904016",
"0.586600... | 0.7585871 | 0 |
name: answer_exam explanation: this method parameters: none return: questions of enemamigo | def answer_exam
if params[:year_exam]
questions ||= Question.where(year: params[:year_exam])
assert(questions.kind_of?(Question))
else
questions ||= Question.all
assert(questions.kind_of?(Question))
end
if !questions.empty?
auxiliar_exam ||= push_questions_auxiliar(questi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quiz\n end",
"def answers\n request('answers')\n end",
"def questions\n \n end",
"def questions_explanation\n puts \"Time to do the quiz!.\"\n puts \"\"\n puts \"Each question will be printed to the screen.\"\n puts \"Once you see it, simply type in your answer and hit the en... | [
"0.71127754",
"0.7039764",
"0.6930175",
"0.68301004",
"0.681634",
"0.676265",
"0.6695201",
"0.6671346",
"0.6658527",
"0.66309214",
"0.66309214",
"0.66185904",
"0.6578523",
"0.6575479",
"0.6536835",
"0.65213466",
"0.6467937",
"0.6463808",
"0.6453757",
"0.64475524",
"0.6426967"... | 0.7520396 | 0 |
name: exam_result explanation: this method list result of the exam of enemamigo parameters: none | def exam_result
if params[:exam_id]
@exam = Exam.find(params[:exam_id])
assert(exam.kind_of?(Exam))
@exam = fill_user_answers(@exam)
current_user.exams_total_questions += @exam.questions.count
current_user.update_attribute(:exam_performance, current_user.exam_performance + [@exam.acce... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def result\n @exam = current_exam(params)\n\n @exam_reporter = @exam.evaluate(params[:answers])\n end",
"def exam_details(ex)\n exams_data = ex.exams.all\n flag = false\n exams_data.each do |exam|\n exam.exam_scores.each do |es|\n flag = true if es.is_failed?\n end\n exams <... | [
"0.7414072",
"0.68553007",
"0.6782322",
"0.669051",
"0.65174335",
"0.64520144",
"0.63652766",
"0.63248646",
"0.6303901",
"0.6285304",
"0.62602276",
"0.62182003",
"0.6196837",
"0.61287975",
"0.6094099",
"0.60848856",
"0.6083606",
"0.59941715",
"0.59941715",
"0.59879875",
"0.59... | 0.7052254 | 1 |
name: cancel_exam explanation: this method cancel of exam of enemamigo parameters: none return:redirect_to root_path | def cancel_exam
exam = Exam.find(params[:exam_id])
assert(exam.kind_of?(Exam))
exam.destroy
return redirect_to root_path
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cancel\n redirect_to root_url, flash[:alert] = \"Something went wrong.\"\n end",
"def cancel_and_redirect\r\n redirect_back\r\n end",
"def cancel\n redirect_to checkid_request.cancel_url\n end",
"def cancel\n @ride = Ride.find_by_id(params[:ride])\n current_user.cancel!(@ride)\n redi... | [
"0.65735763",
"0.6524342",
"0.6455042",
"0.6442101",
"0.6426792",
"0.6405751",
"0.6405751",
"0.64008623",
"0.63403577",
"0.6338053",
"0.63374233",
"0.6292941",
"0.62845296",
"0.6270667",
"0.6258545",
"0.62511384",
"0.6201362",
"0.6198756",
"0.6187564",
"0.6184752",
"0.6173746... | 0.8292112 | 0 |
Float() style conversion, or false if conversion impossible. | def to_Float
begin
fl = Float stripn
return fl
rescue ArgumentError
return false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def float?\n !!Float(self)\n rescue ArgumentError, TypeError\n false\n end",
"def float3?(input)\n Float(input) rescue false\nend",
"def float?(str)\n true if Float(str) rescue false\n end",
"def is_float?\n\t\tFloat(self) != nil rescue false\n\tend",
"def is_float?\n ... | [
"0.76726866",
"0.755282",
"0.751132",
"0.74429536",
"0.7392249",
"0.7293784",
"0.7283553",
"0.71981525",
"0.7183453",
"0.7047361",
"0.70467025",
"0.70077723",
"0.6999853",
"0.69730014",
"0.696569",
"0.69635713",
"0.6942991",
"0.69027007",
"0.68591404",
"0.6844093",
"0.6785711... | 0.8372635 | 0 |
Like strip, but also strips newlines. | def stripn
encode( universal_newline: true )
.gsub("\n", "")
.strip
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rstrip() end",
"def strip_newlines(input); end",
"def strip() end",
"def rstrip!() end",
"def strip_trailing_whitespace(text)\n text.split(\"\\n\").collect(&:strip).join(\"\\n\")\n end",
"def lstrip() end",
"def strip_lines(value)\n value.to_s.gsub(/\\n\\s*/, ' ')\n end",
... | [
"0.71943414",
"0.7168402",
"0.71346223",
"0.705175",
"0.69402874",
"0.6912578",
"0.68956614",
"0.6710288",
"0.659029",
"0.6584463",
"0.6574741",
"0.6565644",
"0.6553379",
"0.6508228",
"0.6503529",
"0.64322543",
"0.6400062",
"0.6362053",
"0.6362053",
"0.63575774",
"0.63425326"... | 0.76229817 | 0 |
Applies standardize to the receiver and converts the result to a symbol. | def to_standardized_sym
standardize
.to_sym
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_sym() end",
"def to_sym() end",
"def to_sym() end",
"def to_sym\n return super unless @to_s_sym\n value = self.to_s\n return value.nil? ? value : value.to_sym\n\t\tend",
"def conform_to_symbol(text_or_symbol)\n underscore(text_or_symbol.to_s).downcase.to_sym\n en... | [
"0.63168347",
"0.63168347",
"0.63168347",
"0.6195802",
"0.60290104",
"0.5988072",
"0.594167",
"0.5940939",
"0.5937854",
"0.5890646",
"0.58764994",
"0.58407253",
"0.58407253",
"0.58407253",
"0.5827341",
"0.5800763",
"0.5800763",
"0.57970273",
"0.5778103",
"0.57741684",
"0.5763... | 0.7052987 | 0 |
Workhorse utility method for logging funnel events (This is probably how MOST funnel events will be triggered) checks if we are an admin visitor first sends the funnel event msg to the current user, if we're logged in sets the url, referer, ua data automatically using the request otherwise, sends it to the current visi... | def log_funnel_event(event, data={})
return if ignore_funnel_tracking?
register_funnel_visitor if current_visitor.nil?
unless current_visitor.nil?
data.reverse_merge!({
:url=>request.request_uri,
:referer=>request.referer,
:user_agent=>... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_funnel_page_visit\n log_funnel_event(:view_page)\n end",
"def log_funnel_event(event, data={})\n unless self.valid_events.include?(event.to_sym)\n Rails.logger.info \"#{self.class.to_s} couldn't log FunnelCake event: #{event} This event is not valid for state: #{self.current_state... | [
"0.635289",
"0.6267571",
"0.6267571",
"0.6187196",
"0.55726147",
"0.553493",
"0.54904956",
"0.539742",
"0.53672236",
"0.5338377",
"0.5333843",
"0.5252021",
"0.5244352",
"0.52382517",
"0.520691",
"0.5148758",
"0.51268154",
"0.5083651",
"0.5046718",
"0.5042269",
"0.50162965",
... | 0.7238873 | 0 |
Utility method for logging a page visit | def log_funnel_page_visit
log_funnel_event(:view_page)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def goto_weblog(page)\n #generally speaking, we want to goto \"http://[username].xanga.com/\n\n page = @agent.click page.links.href(\"http://#{@user}.xanga.com/\").first\n end",
"def visited_page(url); end",
"def visited_page(url); end",
"def logVisit record=nil, rateable=false\n return if !valid_b... | [
"0.6675028",
"0.66497064",
"0.66497064",
"0.6556473",
"0.6507742",
"0.6419096",
"0.6418814",
"0.6294446",
"0.61958575",
"0.6167854",
"0.61454034",
"0.61243266",
"0.6122999",
"0.6122999",
"0.6122999",
"0.6122999",
"0.6122999",
"0.6122999",
"0.6122999",
"0.6122999",
"0.60728747... | 0.75481397 | 0 |
Utility method for syncing the current visitor to the current user (This should be called when a user logs in!) Bails out if not logged in otherwise, sets the .user of the current_visitor | def sync_funnel_visitor
return unless FunnelCake.enabled?
if not logged_in?
logger.info "Couldn't sync Analytics::Visitor to nil User"
return
end
if current_visitor.nil?
logger.info "Couldn't sync nil Analytics::Visitor to current User: #{curr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_current_user\n if logged_in?\n @current_user = current_user\n end\n end",
"def set_current_user\n if logged_in?\n User.current_user = current_user\n else\n User.current_user = nil\n end\n end",
"def set_current_user\n \t\tif session[:user_id]\n \t\t\tCurrent.user = User.... | [
"0.71031487",
"0.7061895",
"0.7033756",
"0.701274",
"0.6972991",
"0.69189906",
"0.69166034",
"0.6909499",
"0.68816924",
"0.68760806",
"0.6862525",
"0.6862525",
"0.6862525",
"0.6862525",
"0.6857685",
"0.6856365",
"0.6849019",
"0.6849019",
"0.68476367",
"0.68375707",
"0.6801216... | 0.7564509 | 0 |
Is the current visitor registered? We check the cookie state to find out | def visitor_registered?
cookies[self.class.read_inheritable_attribute(:cookie_name)].nil? == false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_cookie?\n \n cookie = request.cookies[\"kindle\"]\n \n # attempt to look up cookie in registration DB\n reg = Registration.first(:content => cookie)\n \n if $DEBUG\n puts \"Cookie: \" + (cookie.nil? ? \"nil\" : cookie.to_s )\n puts \"Registration: \" + (reg.nil? ? \"nil\" :... | [
"0.74209034",
"0.6884273",
"0.6788344",
"0.6766331",
"0.67409414",
"0.6707545",
"0.6691672",
"0.6680515",
"0.66242874",
"0.66047823",
"0.65944004",
"0.6589199",
"0.6554048",
"0.6549198",
"0.6504574",
"0.6463556",
"0.6415464",
"0.639112",
"0.639112",
"0.63783354",
"0.6376519",... | 0.87935054 | 0 |
Register the current visitor (without checking anything first, just do it) We create a new Analytics::Visitor here, using a new random hex key Set the cookie value for this visitor | def register_funnel_visitor
@current_visitor = FunnelCake.engine.visitor_class.create(
:ip=>request.remote_ip.to_s
)
@current_visitor.user_id = current_user.id if logged_in?
@current_visitor.save
cookies[self.class.read_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def record_visit\n unless (visit_key = cookies[:id])\n visit_key = SecureRandom.urlsafe_base64(16)\n cookies.permanent[:id] = visit_key\n end\n VisitCounter.record(visit_key)\n end",
"def track_visitor\n visitor_cookie_name = \"teaser.#{@teaser.id}.visitor\"\n if cookies[visitor_coo... | [
"0.73304033",
"0.66246873",
"0.655579",
"0.6404724",
"0.6201737",
"0.61668074",
"0.60564953",
"0.6044377",
"0.60066134",
"0.5912472",
"0.58503366",
"0.57785815",
"0.5758547",
"0.56748974",
"0.5650055",
"0.56169564",
"0.5613965",
"0.5577536",
"0.556677",
"0.5558418",
"0.553838... | 0.7774939 | 0 |
returns the current Analytics::Visitor object, using the visitor's cookie | def current_visitor
return @current_visitor unless @current_visitor.nil?
# Check if we're logged in first, set the current_visitor from the current_user
if logged_in?
@current_visitor = current_user.visitor
end
# If we are not logged in, or if the current_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_site_visitor\n @current_site_visitor ||= begin\n code = ensure_code_cookie\n GreenFlag::SiteVisitor.for_visitor_code!(code)\n end\n end",
"def visitor\n @visitor ||= user_signed_in? ? current_user : UserAnon.new(session)\n end",
"def track_visitor\n visitor_cookie_name = \... | [
"0.6747968",
"0.6712068",
"0.62937355",
"0.62856764",
"0.6272715",
"0.61715776",
"0.6121291",
"0.60851467",
"0.60616726",
"0.6061551",
"0.6045324",
"0.6008674",
"0.5947324",
"0.5932483",
"0.58395094",
"0.5770199",
"0.5742773",
"0.57132494",
"0.56777716",
"0.5668247",
"0.56604... | 0.76355803 | 0 |
Accessor for target_path The target_path is the path where the finalizers will put the release | def target_path
Pathname.new(config[:target_path])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def target_path\n Pathname.new(self.config[:target_path])\n end",
"def target_path(target_name)\r\n File.join(package_dir, target_name)\r\n end",
"def path\n File.join(@base, @target)\n end",
"def getPath(target)\n File.expand_path(File.join(File.dirname(__FILE__), target))\nend",
... | [
"0.7227858",
"0.6816888",
"0.6516648",
"0.6437539",
"0.636318",
"0.63157594",
"0.6267534",
"0.6256255",
"0.612292",
"0.5992524",
"0.5947253",
"0.59334385",
"0.59148294",
"0.5802213",
"0.57843894",
"0.57562286",
"0.5748186",
"0.5716268",
"0.57156",
"0.57070684",
"0.5683034",
... | 0.71371746 | 1 |
Generates a banner if a block is given, or returns the currently set banner. It automatically takes care of adding comment marks around the banner. The default banner looks like this: ======================= = Version : v1.0.0 = = Date : 20120620 = ======================= | def banner(options = {}, &_block)
options = {
comment: :js
}.update(options)
if block_given?
@_banner = yield.to_s
elsif !@_banner
@_banner = default_banner.join("\n")
end
if options[:comment]
comment(@_banner, style: options[:comment])
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def banner(options = {}, &block)\n options = {\n :comment => :js\n }.update(options)\n \n if block_given?\n @_banner = yield.to_s\n elsif !@_banner\n banner = []\n banner << \"Version : #{self.scm.version}\"\n banner << \"Date : #{self.scm.date.strftime(... | [
"0.78166753",
"0.70299935",
"0.6992959",
"0.6880235",
"0.68714345",
"0.68714345",
"0.6574665",
"0.656644",
"0.6546895",
"0.63553697",
"0.62773603",
"0.6258911",
"0.6249515",
"0.62452143",
"0.62332374",
"0.621797",
"0.62174773",
"0.620887",
"0.6182099",
"0.6050421",
"0.603197"... | 0.7765645 | 1 |
============== = The runway = ============== Checks if build path exists (and cleans it up) Checks if target path exists (if not, creates it) | def validate_paths!
ensure_clean_build_path!
ensure_existing_target_path!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_paths!\n if self.build_path.exist?\n log self, \"Cleaning up previous build \\\"#{self.build_path}\\\"\"\n rm_rf(self.build_path)\n end\n \n if !self.target_path.exist?\n log self, \"Creating target path \\\"#{self.target_path}\\\"\"\n mkdir self.targe... | [
"0.6942509",
"0.6190765",
"0.616429",
"0.61332756",
"0.59299403",
"0.5907227",
"0.5828116",
"0.5824962",
"0.57918704",
"0.57817394",
"0.57297724",
"0.57290787",
"0.5717126",
"0.56875616",
"0.56801456",
"0.5677445",
"0.56576836",
"0.56522954",
"0.5643231",
"0.56342417",
"0.563... | 0.6355515 | 1 |
Find a processor in the stack | def find_in_stack(klass)
@stack.find { |(processor, _options)| processor.class == klass }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_processor_by_dataset(dataset)\n processors.values.detect { |p| p.datasets&.include? dataset }\n end",
"def fetch(processor_name)\n idx = processors.index {|processor| processor.name.equal?(processor_name)}\n idx or raise(UnknownProcessor.new(processor_name))\n end",
"def loc... | [
"0.63662827",
"0.62281543",
"0.6001952",
"0.56400645",
"0.5556072",
"0.5550804",
"0.5449586",
"0.5342971",
"0.5336633",
"0.52724665",
"0.5239903",
"0.5185863",
"0.5110354",
"0.5093909",
"0.50866336",
"0.50786215",
"0.50699306",
"0.50662357",
"0.5063109",
"0.50586224",
"0.5004... | 0.7201373 | 0 |
Let's make our own `each` method on AnimalSet. Now, we can have a set of animals and get one at a time. Because the animals is ultimately just an array (look at the initialize method), we're going to cheat a little bit and just take a block to AnimalSet's each method and then | def each(&block)
@animals.each(&block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each(&block)\n to_set.each(&block)\n end",
"def each_set\n \n end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&blk)\n to_a.each(&blk)\n end",
"def each(&blk)\r... | [
"0.74520004",
"0.6771321",
"0.6714319",
"0.6714319",
"0.6714319",
"0.6714319",
"0.6714319",
"0.6714319",
"0.6712648",
"0.6606891",
"0.66025525",
"0.66025525",
"0.6601737",
"0.65995485",
"0.6589604",
"0.6571258",
"0.6534822",
"0.65341634",
"0.6518419",
"0.65175265",
"0.6513707... | 0.7883949 | 0 |
Returns a list of specified user's splatts GET /users/splatts/1 GET /users/splatts/1.json | def splatts
@user = User.find(params[:id])
render json: @user.splatts
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def splatts\n \t@user = User.find(params[:id])\n \t\n \trender json: @user.splatts\n end",
"def splatts_feed\n \t@feed = Splatt.find_by_sql(\"SELECT user_id, body, created_at FROM splatts JOIN follows ON follows.followed_id = splatts.user_id WHERE follows.follower_id = '#{params[:id]}' ORDER BY splatts.crea... | [
"0.84186566",
"0.62961507",
"0.6205785",
"0.6168993",
"0.60175306",
"0.5870528",
"0.5870528",
"0.5860279",
"0.58402807",
"0.57501084",
"0.5745007",
"0.57437515",
"0.5723455",
"0.5719962",
"0.57161933",
"0.56872386",
"0.5676178",
"0.5630771",
"0.5630121",
"0.5619994",
"0.56191... | 0.84677845 | 0 |
POST /admin_panels POST /admin_panels.json | def create
@admin_panel = AdminPanel.new(admin_panel_params)
respond_to do |format|
if @admin_panel.save
format.html { redirect_to @admin_panel, notice: 'Admin panel was successfully created.' }
format.json { render action: 'show', status: :created, location: @admin_panel }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @panel = Panel.new(params[:panel])\n\n respond_to do |format|\n if @panel.save\n format.html { redirect_to(admin_panel_path(@panel), :notice => 'Panel was successfully created.') }\n format.xml { render :xml => @panel, :status => :created, :location => @panel }\n else\n ... | [
"0.6527788",
"0.63824564",
"0.633019",
"0.6245982",
"0.62453824",
"0.5860257",
"0.58516514",
"0.579617",
"0.5777765",
"0.57460743",
"0.57059425",
"0.5699958",
"0.5649252",
"0.5623576",
"0.56196934",
"0.55935884",
"0.5406349",
"0.5383279",
"0.53630465",
"0.5353849",
"0.534657"... | 0.7130741 | 0 |
PATCH/PUT /admin_panels/1 PATCH/PUT /admin_panels/1.json | def update
respond_to do |format|
if @admin_panel.update(admin_panel_params)
format.html { redirect_to @admin_panel, notice: 'Admin panel was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @panel = Panel.find(params[:id])\n\n respond_to do |format|\n if @panel.update_attributes(params[:panel])\n format.html { redirect_to(admin_panel_path(@panel), :notice => 'Panel was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render ... | [
"0.6814441",
"0.6558909",
"0.6390522",
"0.6368118",
"0.6266316",
"0.60912967",
"0.6084242",
"0.60687673",
"0.5981208",
"0.5948328",
"0.5786139",
"0.5765855",
"0.57264185",
"0.57002145",
"0.56980145",
"0.56680197",
"0.5658721",
"0.5613816",
"0.561247",
"0.55899686",
"0.5580736... | 0.7056478 | 0 |
DELETE /admin_panels/1 DELETE /admin_panels/1.json | def destroy
@admin_panel.destroy
respond_to do |format|
format.html { redirect_to admin_panels_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @panel = Panel.find(params[:id])\n @panel.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_panels_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @panel = Panel.find(params[:id])\n @panel.destroy\n\n respond_to do |format|\n fo... | [
"0.7414868",
"0.70485306",
"0.689241",
"0.6883058",
"0.6851572",
"0.68437153",
"0.6747899",
"0.66987664",
"0.667577",
"0.6669158",
"0.6649219",
"0.65649974",
"0.6553565",
"0.6524404",
"0.64714277",
"0.6470395",
"0.64145106",
"0.6414252",
"0.639615",
"0.6342583",
"0.6328403",
... | 0.77658314 | 0 |
GET /containers GET /containers.json | def index
@containers = Container.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def containers\n @containers ||= Docker::Container.all(\n all: true, # include stopped containers\n filters: { id: container_ids }.to_json\n ).map(&:json)\n end",
"def containers\n TestLab::Container.all\n end",
"def containers(key = nil, options = {})\n key ||= ... | [
"0.7165998",
"0.7068954",
"0.6897867",
"0.6833766",
"0.6760254",
"0.6758191",
"0.67024255",
"0.6604404",
"0.6592616",
"0.6590891",
"0.65503347",
"0.6488054",
"0.6399582",
"0.6274847",
"0.62428796",
"0.62336564",
"0.6215182",
"0.6203278",
"0.61912113",
"0.607803",
"0.6036521",... | 0.7273097 | 0 |
PATCH/PUT /containers/1 PATCH/PUT /containers/1.json | def update
respond_to do |format|
if @container.update(container_params)
format.html { redirect_to @container, notice: 'Container was successfully updated.' }
format.json { render :show, status: :ok, location: @container }
else
format.html { render :edit }
format.json { r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @container = Container.find(params[:id])\n\n respond_to do |format|\n if @container.update_attributes(params[:container])\n format.html { redirect_to @container, notice: 'Container was successfully updated.' }\n format.json { head :no_content }\n else\n format.html... | [
"0.6936837",
"0.65907705",
"0.65039676",
"0.6361538",
"0.63550586",
"0.6173861",
"0.6113243",
"0.609286",
"0.60480607",
"0.5989976",
"0.58575135",
"0.583319",
"0.58241105",
"0.5778027",
"0.57750654",
"0.57386357",
"0.5709766",
"0.5704527",
"0.5668994",
"0.5651344",
"0.5637639... | 0.6783597 | 1 |
GET /participant_quotes GET /participant_quotes.json | def index
@participant_quotes = ParticipantQuote.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @participant_quotes }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @participant_quote = ParticipantQuote.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @participant_quote }\n end\n end",
"def destroy\n @participant_quote = ParticipantQuote.find(params[:id])\n @participant_quote.destroy... | [
"0.7152615",
"0.6397558",
"0.6345617",
"0.6281185",
"0.6272502",
"0.62399006",
"0.6232049",
"0.62028545",
"0.6193352",
"0.61696094",
"0.60210025",
"0.60089386",
"0.5990835",
"0.5953325",
"0.59272003",
"0.59262174",
"0.59074295",
"0.59029293",
"0.5901017",
"0.5898677",
"0.5870... | 0.75764847 | 0 |
GET /participant_quotes/1 GET /participant_quotes/1.json | def show
@participant_quote = ParticipantQuote.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @participant_quote }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @participant_quotes = ParticipantQuote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @participant_quotes }\n end\n end",
"def destroy\n @participant_quote = ParticipantQuote.find(params[:id])\n @participant_quote.destroy\n\n re... | [
"0.75045645",
"0.6509631",
"0.6467268",
"0.63699657",
"0.62532365",
"0.6225809",
"0.6214231",
"0.6205739",
"0.6154353",
"0.61189735",
"0.6078182",
"0.6078182",
"0.6078182",
"0.60727996",
"0.60698277",
"0.6067165",
"0.60335726",
"0.59817874",
"0.5975427",
"0.59591585",
"0.5947... | 0.7344995 | 1 |
GET /participant_quotes/new GET /participant_quotes/new.json | def new
@participant_quote = ParticipantQuote.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @participant_quote }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @quote = Quote.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quote }\n end\n end",
"def new\n @quoteable = find_quoteable\n @quote = Quote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { r... | [
"0.7353266",
"0.7290599",
"0.71510077",
"0.69096905",
"0.66836864",
"0.66836864",
"0.66836864",
"0.66770554",
"0.6649301",
"0.66387993",
"0.66115195",
"0.66063255",
"0.66063255",
"0.6601417",
"0.65713185",
"0.6557265",
"0.6540016",
"0.6514769",
"0.6510395",
"0.6504937",
"0.64... | 0.7997766 | 0 |
POST /participant_quotes POST /participant_quotes.json | def create
@participant_quote = ParticipantQuote.new(params[:participant_quote])
@participant_quote.user_id = current_user.id
respond_to do |format|
if @participant_quote.save
format.html { redirect_to @participant_quote, notice: 'Participant quote was successfully created.' }
format.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @client=Client.find_by_id(params['q_param']['client'])\n title=params['q_param']['title']\n comment=params['q_param']['comment']\n list = [[\"\",\"\",\"1\",\"\"]]\n quote_p={:title=>title,:comment=>comment, :status=>1, :list=>list}\n @quote = @client.quotes.create(quote_p)\n render json: {:quo... | [
"0.65628976",
"0.6458151",
"0.64493793",
"0.6426537",
"0.6315236",
"0.614887",
"0.61268556",
"0.60901684",
"0.60508174",
"0.60490125",
"0.60490125",
"0.60316014",
"0.60283315",
"0.6021632",
"0.59683275",
"0.5949569",
"0.59227866",
"0.5812546",
"0.57873976",
"0.5772727",
"0.57... | 0.74273187 | 0 |
PUT /participant_quotes/1 PUT /participant_quotes/1.json | def update
@participant_quote = ParticipantQuote.find(params[:id])
respond_to do |format|
if @participant_quote.update_attributes(params[:participant_quote])
format.html { redirect_to @participant_quote, notice: 'Participant quote was successfully updated.' }
format.json { head :no_conten... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @participant_quote = ParticipantQuote.new(params[:participant_quote])\n @participant_quote.user_id = current_user.id\n\n respond_to do |format|\n if @participant_quote.save\n format.html { redirect_to @participant_quote, notice: 'Participant quote was successfully created.' }\n ... | [
"0.6646239",
"0.6392883",
"0.63439757",
"0.6314633",
"0.6243085",
"0.62193173",
"0.6218981",
"0.6218981",
"0.6170778",
"0.61642927",
"0.6139782",
"0.6139782",
"0.6139782",
"0.6139782",
"0.6139782",
"0.6139782",
"0.6139782",
"0.6123719",
"0.6117449",
"0.60724217",
"0.6052955",... | 0.74743 | 0 |
DELETE /participant_quotes/1 DELETE /participant_quotes/1.json | def destroy
@participant_quote = ParticipantQuote.find(params[:id])
@participant_quote.destroy
respond_to do |format|
format.html { redirect_to participant_quotes_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @quote_line.destroy\n respond_to do |format|\n format.html { redirect_to quote_lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @kid_quote.destroy\n\n respond_to do |format|\n format.html { redirect_to kid_quotes_url }\n format.json { h... | [
"0.7170655",
"0.7156321",
"0.7148859",
"0.7135716",
"0.71331376",
"0.71331376",
"0.71331376",
"0.7118539",
"0.70611763",
"0.70055383",
"0.69864243",
"0.6945002",
"0.6933887",
"0.6926167",
"0.69126016",
"0.69126016",
"0.69126016",
"0.69126016",
"0.69126016",
"0.69126016",
"0.6... | 0.7952621 | 0 |
Marks a key readonly. Returns self. | def read_only! key
set_data! key, :read_only, true
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def readonly! #:nodoc:\n @readonly = true\n end",
"def readonly!\n @readonly = true\n end",
"def set_readonly\n readonly! if persisted? && !parent\n end",
"def readonly=(value)\n if value\n self[:readonly] = ''\n else\n remove_attribute :readonly\n end\n ... | [
"0.6546846",
"0.65401816",
"0.59213346",
"0.5785873",
"0.57742524",
"0.56710845",
"0.5644326",
"0.54534036",
"0.545066",
"0.54113257",
"0.5361511",
"0.5348421",
"0.53416693",
"0.5333156",
"0.5306583",
"0.5305598",
"0.5305598",
"0.5305598",
"0.5298332",
"0.52912545",
"0.528633... | 0.7547733 | 0 |
Returns true if the value for key is marked 'inherited'. If so, any attempt to call []= will be ignored and the value returned from [] will the ENV[key] value at initialization. | def inherit? key
! ! (data(key, INHERIT) && data(key, DEFAULT))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inherits_key? k\n !(@hash.key? k) && (!! @parents.find {|parent| parent.key? k } )\n end",
"def inherits_key? k\n !(@hash.key? k) && (!! @parents.find {|parent| parent.key? k } )\n end",
"def env?(key)\n blank?(ENV[key])\n end",
"def key_inheritable_in_parent?(*key)\n ... | [
"0.65181106",
"0.6462525",
"0.63119984",
"0.59950995",
"0.5760447",
"0.57421875",
"0.572275",
"0.5683113",
"0.5676117",
"0.56717056",
"0.56517655",
"0.563552",
"0.5634367",
"0.5627991",
"0.55664897",
"0.5558068",
"0.5545557",
"0.55309534",
"0.54966104",
"0.54808336",
"0.54714... | 0.70132136 | 0 |
Returns true if the value for key is marked 'locked' If so, any attempt to call []= will be ignored. | def locked? key
! ! data(key, LOCKED)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def locked?(key)\n raise NotImplementedError\n end",
"def locked?\n @locked\n end",
"def locked?\n @locked\n end",
"def locked?\n @locked\n end",
"def locked?\n @locked\n end",
"def locked?\n @locked\n end",
"def locked?\n @locked\n end",
... | [
"0.7454825",
"0.7390553",
"0.73161703",
"0.73161703",
"0.73161703",
"0.73161703",
"0.72735626",
"0.72596794",
"0.7245564",
"0.7153851",
"0.7130027",
"0.7127562",
"0.70990014",
"0.70923525",
"0.70795846",
"0.7079581",
"0.70446825",
"0.6998114",
"0.6977817",
"0.69634235",
"0.69... | 0.8380538 | 0 |
Executes block while setting dst with each element of env. dst is restored after completion of the block. nil values are equivalent to deleting the dst element dst defaults to the global ENV NOT THREADSAFE if dst == ENV | def with dst = nil
dst ||= ENV
with_env(@h, dst) do
yield
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def with_env(options, &block)\n backup = ENV.to_h\n ENV.clear\n ENV.update(options)\n yield\nensure\n ENV.clear\n ENV.update(backup)\nend",
"def withenv(env, &block)\n original = ENV.to_hash\n reset(original.merge(env))\n block.call\n ensure\n reset(original)\n end",
... | [
"0.5675896",
"0.5532706",
"0.5494883",
"0.5427228",
"0.53598213",
"0.5304405",
"0.5263251",
"0.5195921",
"0.5178359",
"0.5156537",
"0.5153828",
"0.51467794",
"0.50784034",
"0.5068004",
"0.5047206",
"0.50176156",
"0.500382",
"0.49426588",
"0.49259073",
"0.49259073",
"0.4914977... | 0.64974326 | 0 |
Guarantee to read n bytes | def read_bytes(sd, n)
out = []
while (n > out.size)
data = sd.read_bytes(n - out.size)
break unless data
out = out + data
end
return out
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read(n)\n end",
"def read(n)\n Buffer.new(slice!(0, n))\n end",
"def readpartial(size, buffer = T.unsafe(nil)); end",
"def readpartial(size, buffer = T.unsafe(nil)); end",
"def readpartial(size, buffer = T.unsafe(nil)); end",
"def recvExactNBytes(n)\n buffer = \"\" ;\n while(... | [
"0.7577687",
"0.73801863",
"0.7329298",
"0.7329298",
"0.7329298",
"0.7244138",
"0.7131295",
"0.70470035",
"0.70083845",
"0.6996167",
"0.6858447",
"0.6833026",
"0.6775157",
"0.6770802",
"0.6766239",
"0.6728644",
"0.6709728",
"0.66529816",
"0.66504604",
"0.66234726",
"0.6621393... | 0.73996717 | 1 |
GET /portal_grades GET /portal_grades.xml | def index
# PUNDIT_REVIEW_AUTHORIZE
# PUNDIT_CHECK_AUTHORIZE
# authorize Portal::Grade
# PUNDIT_REVIEW_SCOPE
# PUNDIT_CHECK_SCOPE (did not find instance)
# @grades = policy_scope(Portal::Grade)
@portal_grades = Portal::Grade.all
respond_to do |format|
format.html # index.html.erb
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_grades\r\n grade_nodes = BankNodestructure.grade_gather(params[:subject])\r\n render json: grade_nodes.to_json\r\n end",
"def get_grades(user_id, course_id, use_source_domain = nil)\r\n relative_url = Path::USERS_COURSES_GRADEBOOK_USERGRADEBOOKITEMS \r\n\t if !use_source_domain.nil?\r\n... | [
"0.6848463",
"0.6273877",
"0.6213627",
"0.6159683",
"0.60664153",
"0.60664153",
"0.60664153",
"0.60664153",
"0.60399175",
"0.59853023",
"0.5867989",
"0.5865154",
"0.58452487",
"0.57138264",
"0.56874514",
"0.5670687",
"0.5666528",
"0.56659317",
"0.56618047",
"0.565782",
"0.565... | 0.67424566 | 1 |
GET /portal_grades/new GET /portal_grades/new.xml | def new
# PUNDIT_REVIEW_AUTHORIZE
# PUNDIT_CHECK_AUTHORIZE
# authorize Portal::Grade
@portal_grade = Portal::Grade.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @portal_grade }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @staffgrade = Staffgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @staffgrade }\n end\n end",
"def new\n @ratgrade = Ratgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => ... | [
"0.73631287",
"0.72598237",
"0.7080281",
"0.69860333",
"0.6914125",
"0.68992996",
"0.6819383",
"0.6804884",
"0.6765627",
"0.6765627",
"0.6713686",
"0.6680785",
"0.6654715",
"0.6653923",
"0.6646789",
"0.6636223",
"0.66305894",
"0.6623268",
"0.6617407",
"0.6612715",
"0.65941685... | 0.7378837 | 0 |
POST /portal_grades POST /portal_grades.xml | def create
# PUNDIT_REVIEW_AUTHORIZE
# PUNDIT_CHECK_AUTHORIZE
# authorize Portal::Grade
@portal_grade = Portal::Grade.new(params[:portal_grade])
respond_to do |format|
if @portal_grade.save
flash[:notice] = 'Grade was successfully created.'
format.html { redirect_to(@portal_gr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @grade = Grade.new(params[:grade])\n respond_to do |format|\n if @grade.save\n @grade.upload_to_scribd!\n format.html { redirect_to \"/assignments/#{@grade.assignment_id}\" }\n format.json { render json: @grade, status: :created, location: @grade }\n else\n ... | [
"0.5947724",
"0.5840544",
"0.5790898",
"0.5761745",
"0.57548195",
"0.57503563",
"0.5746813",
"0.571952",
"0.568838",
"0.56789315",
"0.5657114",
"0.5634986",
"0.5504122",
"0.5463288",
"0.54486215",
"0.5370755",
"0.5369821",
"0.5328143",
"0.53201514",
"0.530921",
"0.53070384",
... | 0.6705665 | 0 |
PUT /portal_grades/1 PUT /portal_grades/1.xml | def update
# PUNDIT_REVIEW_AUTHORIZE
# PUNDIT_CHECK_AUTHORIZE (did not find instance)
# authorize @grade
@portal_grade = Portal::Grade.find(params[:id])
respond_to do |format|
if @portal_grade.update_attributes(params[:portal_grade])
flash[:notice] = 'Grade was successfully updated.'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @grade = Grade.find(params[:id])\n\n if @grade.update(grade_params)\n head :no_content\n else\n render json: @grade.errors, status: :unprocessable_entity\n end\n end",
"def update\n @staffgrade = Staffgrade.find(params[:id])\n\n respond_to do |format|\n if @staffgra... | [
"0.6365745",
"0.6319611",
"0.6290411",
"0.62235326",
"0.6215058",
"0.60693717",
"0.60411453",
"0.603023",
"0.6004324",
"0.599807",
"0.598671",
"0.59574413",
"0.5932828",
"0.58600396",
"0.58561796",
"0.5842538",
"0.58272594",
"0.57889843",
"0.57829535",
"0.5696921",
"0.5694922... | 0.683574 | 0 |
DELETE /portal_grades/1 DELETE /portal_grades/1.xml | def destroy
# PUNDIT_REVIEW_AUTHORIZE
# PUNDIT_CHECK_AUTHORIZE (did not find instance)
# authorize @grade
@portal_grade = Portal::Grade.find(params[:id])
@portal_grade.destroy
respond_to do |format|
format.html { redirect_to(portal_grades_url) }
format.xml { head :ok }
end
en... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @ratgrade = Ratgrade.find(params[:id])\n @ratgrade.destroy\n\n respond_to do |format|\n format.html { redirect_to(ratgrades_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @staffgrade = Staffgrade.find(params[:id])\n @staffgrade.destroy\n\n respond_to ... | [
"0.66639835",
"0.66347754",
"0.65093625",
"0.64378923",
"0.6200371",
"0.61861765",
"0.61788267",
"0.61274105",
"0.61256903",
"0.6082417",
"0.607264",
"0.6048897",
"0.6045539",
"0.60418683",
"0.60165656",
"0.6012558",
"0.5996852",
"0.59816706",
"0.598102",
"0.5973938",
"0.5955... | 0.68664056 | 0 |
Assigns the cookie string. | def cookie= cookie_str
@headers['Cookie'] = cookie_str if @use_cookies
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_cookie(name, value)\n @cookies[\"flexi_#{@id}_#{name}\"] = value\n return value\n end",
"def set_cookie(name, value)\n test_cookies[name] = value\n end",
"def set_cookie(name, value, attributes = {})\n cookie = Webmachine::Cookie.new(name, value, attributes).to_s\n ca... | [
"0.70979655",
"0.68490267",
"0.6825364",
"0.6768513",
"0.673038",
"0.67127407",
"0.66908425",
"0.6681502",
"0.6642656",
"0.6594423",
"0.6581152",
"0.6576023",
"0.6573805",
"0.65453744",
"0.65151227",
"0.6514807",
"0.65130264",
"0.6496046",
"0.6489468",
"0.648389",
"0.648389",... | 0.78433967 | 1 |
Assigns the http method. | def http_method= new_verb
@http_method = new_verb.to_s.upcase
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def http_method(value = nil)\n if value\n @http_method = value\n else\n @http_method\n end\n end",
"def http_method\n\t\t\t\treturn @http_method if defined?(@http_method)\n\n\t\t\t\tmethod_from_met... | [
"0.8014927",
"0.7979425",
"0.78619057",
"0.78400034",
"0.7651818",
"0.7536041",
"0.7244738",
"0.7244738",
"0.72335696",
"0.7164667",
"0.6886686",
"0.6886241",
"0.6867984",
"0.6851551",
"0.6840861",
"0.68332154",
"0.68193287",
"0.68173474",
"0.67559063",
"0.6743401",
"0.672977... | 0.80735403 | 1 |
Decide whether to use cookies or not. | def use_cookies= bool
if bool && (!@headers['Cookie'] || @headers['Cookie'].empty?)
cookie = Kronk.cookie_jar.get_cookie_header @uri.to_s
@headers['Cookie'] = cookie unless cookie.empty?
else
@headers.delete 'Cookie'
end
@use_cookies = bool
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def use_cookies= bool\n if bool && (!@headers['Cookie'] || @headers['Cookie'].empty?)\n cookie = Kronk.cookie_jar.get_cookie_header @uri.to_s\n @headers['Cookie'] = cookie unless cookie.empty?\n\n elsif !bool\n @headers.delete 'Cookie'\n end\n\n @use_cookies = bool\n end... | [
"0.76650417",
"0.75777227",
"0.70494753",
"0.69706666",
"0.69706666",
"0.69706666",
"0.69706666",
"0.69706666",
"0.69706666",
"0.69706666",
"0.695557",
"0.6807186",
"0.6799025",
"0.6770178",
"0.6764302",
"0.6694582",
"0.6694582",
"0.6690253",
"0.66819286",
"0.66791683",
"0.66... | 0.75971156 | 1 |
Assign whether to use ssl or not. | def ssl= bool
@uri.scheme = bool ? "https" : "http"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ssl=(ssl)\n @ssl = if ssl == true || ssl =~ /(true|t|yes|y|1)$/i\n true\n else\n false\n end\n end",
"def use_ssl?; end",
"def ssl?; end",
"def ssl?; end",
"def use_ssl?\n @ssl\n end",
"def usessl?\n @usessl\n end",
"def use_ssl?\n... | [
"0.8319328",
"0.82412237",
"0.8113454",
"0.8113454",
"0.80570805",
"0.805706",
"0.8051032",
"0.80060554",
"0.7918468",
"0.7877911",
"0.7808463",
"0.77716917",
"0.77716917",
"0.77628624",
"0.7761831",
"0.7761831",
"0.77568835",
"0.7753574",
"0.77359855",
"0.77359855",
"0.77270... | 0.8393315 | 1 |
Returns the raw HTTP request String. | def to_s
out = "#{@http_method} #{@uri.request_uri} HTTP/1.1\r\n"
out << "host: #{@uri.host}:#{@uri.port}\r\n"
self.http_request.each do |name, value|
out << "#{name}: #{value}\r\n" unless name =~ /host/i
end
out << "\r\n"
out << @body.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n out = \"#{@http_method} #{@uri.request_uri} HTTP/1.1\\r\\n\"\n out << \"Host: #{@uri.host}:#{@uri.port}\\r\\n\"\n\n http_request.each do |name, value|\n out << \"#{name}: #{value}\\r\\n\" unless name =~ /host/i\n end\n\n out << \"\\r\\n\"\n\n if @body.respond_to?(:re... | [
"0.727364",
"0.69600296",
"0.66420066",
"0.6527482",
"0.6520622",
"0.64491695",
"0.63976574",
"0.6271037",
"0.6259756",
"0.6236128",
"0.6132159",
"0.6083503",
"0.6081281",
"0.607472",
"0.6061257",
"0.5991761",
"0.59768283",
"0.59693193",
"0.59610456",
"0.59242535",
"0.5910411... | 0.7152661 | 1 |
This method is for brand users to see their requests that are related to this startup | def requests
@requests = @startup.requests.startup_related_requests(current_user.brand_id)
.order(created_at: :desc)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_started\n intro_and_request_permissions\n end",
"def show_startup\n authorize! :investor_connect_with_startups, current_user\n # Only allow temporary investor account access to their suggested startups\n if [2367, 2375, 2435, 2436, 2437, 2438, 2459, 2466].include?(current_user.id)\n cal... | [
"0.6185273",
"0.60964185",
"0.59822327",
"0.59533244",
"0.5846475",
"0.58300793",
"0.58265173",
"0.5817101",
"0.57669276",
"0.5752893",
"0.57413894",
"0.57252264",
"0.56760705",
"0.56101936",
"0.5583395",
"0.55816245",
"0.55812365",
"0.5568494",
"0.55577356",
"0.55425817",
"0... | 0.6791154 | 0 |
=> Analyse l'option de ligne de commande | def treat_as_option doption
option = nil
valeur = nil
if doption.start_with? '--'
doption.gsub(/^--([^=]+)=?(.*)?$/){
option = $1
valeur = $2
}
else
option_courte = doption[1..1]
option = OPTION_LIST[option_courte]
fatal_error(:unknown_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def options(opt); end",
"def options(opt); end",
"def options() end",
"def process_command_line_options\r\n begin\r\n defer, found = \"\", false\r\n opts = GetoptLong.new(\r\n [ \"--help\", \"-h\", \"-?\", GetoptLong::NO_ARGUMENT ],\r\n [ \"--load\", \"-l\", Getop... | [
"0.6377345",
"0.637626",
"0.63755816",
"0.63435525",
"0.62745917",
"0.6246886",
"0.6246886",
"0.6246886",
"0.62201804",
"0.6167451",
"0.6167451",
"0.6129034",
"0.60767967",
"0.6074044",
"0.6066357",
"0.60486495",
"0.60095185",
"0.59998876",
"0.5972892",
"0.59635955",
"0.59334... | 0.67668897 | 0 |
Recursivly call the transformer_worker with all the the compound data we have collected in the first pass | def transform_and_load_compounds!
compound_records.each_slice(batch_size) do |compound_records_batch|
transformer_worker_klass.perform_async(
compound_records_batch,
solr_config,
cdm_endpoint,
oai_endpoint,
field_mappings,
batch_size
)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_and_transform; end",
"def each_needed_transformation(&block)\n if !block_given?\n return enum_for(:each_needed_transformation)\n end\n\n needed_transformations.each(&block)\n supercall(nil, :each_needed_transformation, &block)\n end",
"d... | [
"0.6490351",
"0.609604",
"0.55886",
"0.5522557",
"0.5509941",
"0.54616594",
"0.542857",
"0.5385354",
"0.5308729",
"0.5260288",
"0.52414185",
"0.5203903",
"0.52021337",
"0.5192116",
"0.517876",
"0.5143641",
"0.5127899",
"0.5125328",
"0.5124403",
"0.51190645",
"0.51115704",
"... | 0.73334426 | 0 |
topic_reply_count is a count of posts in other users' topics | def update_topic_reply_count
self.topic_reply_count = Topic
.joins("INNER JOIN posts ON topics.id = posts.topic_id AND topics.user_id <> posts.user_id")
.where("posts.deleted_at IS NULL AND posts.user_id = ?", self.user_id)
.distinct
.count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def topics_count\n object.topics.count\n end",
"def user_topic_share_count(user_id, topic_neo_id)\n #Rails.cache.fetch(\"neo4j-#{user_id}-#{topic_id}-share_count\", :expires_in => 1.day) do\n count = 0\n query = \"\n START n=node(#{topic_neo_id})\n MATCH n-[:pull*0..20]->... | [
"0.7249491",
"0.68897986",
"0.68819386",
"0.67542744",
"0.66232777",
"0.6512704",
"0.641848",
"0.63893986",
"0.6151594",
"0.6043848",
"0.6042928",
"0.6040166",
"0.60299367",
"0.6027247",
"0.5970238",
"0.59689224",
"0.5939298",
"0.5925119",
"0.59123915",
"0.58930373",
"0.58873... | 0.86833245 | 0 |
Queue jobs for OauthTokenRefreshWorker. Accounts whose OAuth tokens will expire in the next 25 minutes will have their tokens refreshed. | def perform
Account.tokens_expiring_soon(Time.zone.now).each do |account|
OauthTokenRefreshWorker.perform_async(account.id)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refresh_tokens\n @token = @token.refresh!\n tokens\n end",
"def perform\n\n # Get all twitter accounts if any\n accounts = TwitterAccount.exists? ? TwitterAccount.least_checked(LIMIT) : []\n\n accounts.each do |account|\n account_name = account.twitter_name\n\n if Event.exists... | [
"0.60563064",
"0.58627564",
"0.58311164",
"0.5668823",
"0.55954665",
"0.5591859",
"0.5570507",
"0.55671525",
"0.5549174",
"0.55449975",
"0.5542361",
"0.55396026",
"0.55389833",
"0.5515025",
"0.5481069",
"0.54714197",
"0.5460772",
"0.5455158",
"0.54092854",
"0.53463215",
"0.53... | 0.8199903 | 0 |
Returns under supervision clinics and examining clinics | def related_clinics
_clinics = []
under_supervision_clinics.each do |c|
unless _clinics.include?(c)
_clinics.append(c)
end
end
clinics.each do |c|
unless _clinics.include?(c)
_clinics.append(c)
end
end
return _clinics
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_related_clinics?\n if under_supervision_clinics.count > 0 || clinics.count > 0\n return true\n end\n return false\n end",
"def collect_crime_information\n ### Crime information\n mark_data_crime_information = Array.new\n crime_information = @case_details[:case][:system][:crime]\n\... | [
"0.57600874",
"0.5593624",
"0.5485031",
"0.5426158",
"0.541172",
"0.5404782",
"0.53919417",
"0.53701174",
"0.5294311",
"0.52568156",
"0.5213306",
"0.52102417",
"0.52045923",
"0.5204297",
"0.5203712",
"0.5191047",
"0.51907796",
"0.51808304",
"0.5177272",
"0.51751316",
"0.51733... | 0.65987307 | 0 |
Returns all patient in under supervision clinics or patient which has registered by user. | def related_patients
_patients=[]
under_supervision_clinics.each do |clinic|
clinic.registrations.each do |reg|
unless _patients.include?(reg.patient)
_patients.append(reg.patient)
end
end
end
registrations.each do |reg|
unless _patients.include?(reg.patient)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patients \n patients = Patient.all.select do |patient|\n patient.doctor == self\n end\n\n # patients.map do |patient|\n # patient.name\n # end\n end",
"def patients \n # patients = []\n # Appointment.all.each do | appointment |\n # ... | [
"0.6718713",
"0.6711171",
"0.6654876",
"0.66456383",
"0.6594897",
"0.6467883",
"0.64512306",
"0.63740176",
"0.6357986",
"0.63559896",
"0.6330614",
"0.6329396",
"0.63286906",
"0.6292245",
"0.62911683",
"0.6262743",
"0.626208",
"0.6252315",
"0.6251028",
"0.61814636",
"0.616832"... | 0.7480559 | 0 |
Returns all under supervision Studies plus related Studies. | def related_studies
_studies = []
under_supervision_studies.each do |study|
unless _studies.include?(study)
_studies.append(study)
end
end
studies.each do |study|
unless _studies.include?(study)
_studies.append(study)
end
end
return _studies
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @studies = current_user.available_studies\n end",
"def list_studies\n act = StudyListAction.new(self)\n act.get\n end",
"def index\n @studies = Study.all\n end",
"def index\n @studies = Study.all\n end",
"def search_studies\n @studies = Study.search(search_query, query_arg... | [
"0.6606388",
"0.6588492",
"0.647142",
"0.647142",
"0.6366238",
"0.61600095",
"0.61304826",
"0.6032676",
"0.60041785",
"0.5976543",
"0.59527296",
"0.58857405",
"0.5883488",
"0.5823642",
"0.57641864",
"0.5749698",
"0.57420963",
"0.57380223",
"0.57028353",
"0.569883",
"0.5682165... | 0.8671109 | 0 |
Returns true if User has at least one related Patient | def has_related_patient?
if registrations.count > 0
return true
end
under_supervision_clinics.each do |clinic|
clinic.registrations.each do |reg|
return true
end
end
return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patient_implicit?\n @authorized_user.patients.size == 1 \n end",
"def recipe_belongs_to_user(user)\n if user.recipes.select {|s| s.users == users}.count > 0\n return true\n else\n return false\n end\n end",
"def in_relationship?(user)\n return true if UserProject.where(user: use... | [
"0.7036032",
"0.6339519",
"0.6283754",
"0.62703687",
"0.62432325",
"0.62104934",
"0.61614543",
"0.6143775",
"0.6142951",
"0.61388975",
"0.6086811",
"0.6022274",
"0.5994241",
"0.59829044",
"0.5973832",
"0.59705424",
"0.5957213",
"0.5952646",
"0.5923433",
"0.5915635",
"0.591428... | 0.6925893 | 1 |
Returns true if User has at least one related Clinic | def has_related_clinics?
if under_supervision_clinics.count > 0 || clinics.count > 0
return true
end
return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_relationship?(user)\n return true if UserProject.where(user: user, project: self).first\n end",
"def recipe_belongs_to_user(user)\n if user.recipes.select {|s| s.users == users}.count > 0\n return true\n else\n return false\n end\n end",
"def has_competitor?(user_id)\n get_rel... | [
"0.67243934",
"0.6620375",
"0.6517182",
"0.63059944",
"0.6282876",
"0.6255948",
"0.62288344",
"0.6199234",
"0.6159448",
"0.61420673",
"0.6131008",
"0.6104984",
"0.6049592",
"0.6048655",
"0.60464734",
"0.6042106",
"0.6022729",
"0.60218203",
"0.60066277",
"0.59614027",
"0.59469... | 0.7263277 | 0 |
Returns true if User is a supervisor of at least one Clinic | def is_supervisor?
not under_supervision_clinics.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def superuser?\n member_of_group?(\"Superusers\")\n end",
"def super_user? \n current_user.role.role == \"Super\" \n end",
"def validate_supervisor\r\n return false unless @current_user.is_supervisor?\r\n expense = Expense.find(params[:id]) rescue nil\r\n return false if expense.blank?\r\... | [
"0.64548934",
"0.64488566",
"0.64465547",
"0.63090485",
"0.6204991",
"0.6194085",
"0.6141487",
"0.61306256",
"0.6126601",
"0.6125404",
"0.6058233",
"0.6046268",
"0.60306084",
"0.6016667",
"0.6002127",
"0.5987492",
"0.5985422",
"0.59661233",
"0.5956504",
"0.5942219",
"0.592170... | 0.7470939 | 0 |
Returns true if User has access to Study | def can_edit_study(study_id)
study = Study.find(study_id)
if study
if study.admin == self
return true
end
study.users.each do | user |
if user == self
return true
end
end
end
return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def student_access_allowed?\n return true if scopes.include_any?(Scopes::READ_ALL)\n if username && scopes.include_any?(Scopes::READ_ROLE_BASED)\n return has_any_role? PRIVILEGED_ROLES\n end\n false\n end",
"def can_edit_study?(user)\n if self.study.queued_for_deletion?\n re... | [
"0.7554266",
"0.74695235",
"0.7322401",
"0.7247211",
"0.72334814",
"0.7179571",
"0.71436745",
"0.7126309",
"0.709993",
"0.700414",
"0.69817096",
"0.6959944",
"0.6943501",
"0.69411284",
"0.6924641",
"0.6922579",
"0.6905834",
"0.69035757",
"0.69035757",
"0.6898159",
"0.6872384"... | 0.758039 | 0 |
Returns true if user is approved or is admin (devise overrides) | def active_for_authentication?
super && (approved? || self.admin)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def approved?\n (status == ConfigCenter::User::APPROVED)\n end",
"def is_user_admin?\n user_active && user_active.permission_level == 2\n end",
"def admin_user?\n (current_user.role == 'admin') if logged_in?\n end",
"def admin_user?\n self.admin ==true\n end",
"def admin_require... | [
"0.78165925",
"0.7652688",
"0.76422215",
"0.7614828",
"0.7598862",
"0.7593871",
"0.75682545",
"0.75663036",
"0.75628185",
"0.7550705",
"0.75460887",
"0.75263524",
"0.7524237",
"0.75115806",
"0.75082296",
"0.75049746",
"0.7502475",
"0.7501267",
"0.7489247",
"0.74862254",
"0.74... | 0.7961931 | 0 |
execute a block scoped to the current tenant unsets the current tenant after execution | def with_tenant(tenant, &block)
Multitenant.current_tenant = tenant
Multitenant.in_block = true
save_and_change_default_scope_for_all
yield
ensure
restore_default_scope
Multitenant.in_block = false
Multitenant.current_tenant = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def temp(tenant_session, &block)\n original = self.tenant_session\n begin\n self.tenant_session = tenant_session\n yield\n ensure\n self.tenant_session = original\n end\n end",
"def scope_current_tenant &block\n if current_user\n ... | [
"0.6456303",
"0.64423615",
"0.6166946",
"0.5938257",
"0.58941853",
"0.58114016",
"0.57852954",
"0.5697681",
"0.5680729",
"0.5643279",
"0.5631496",
"0.5615195",
"0.55845416",
"0.557084",
"0.5536898",
"0.55174583",
"0.54833204",
"0.5469118",
"0.54576856",
"0.5455664",
"0.545239... | 0.7533424 | 0 |
Extract long flag name | def long_name
long.to_s.sub(/^(--.+?)(\s+|\=|\[).*$/, "\\1")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def long_flag_syntax\n @long_flag_syntax ||= flag_syntax.find_all { |ss| ss.flag_style == :long }\n end",
"def get_flag_name(flag)\n if flag.start_with?(\"--no-\")\n flag[5..-1]\n elsif flag.start_with?(\"--\")\n flag[2..-1]\n else\n raise \"Assertion error: we're here by mistake\"\n end\nen... | [
"0.71888006",
"0.6685242",
"0.63991433",
"0.63319576",
"0.6254689",
"0.62044317",
"0.61581546",
"0.6124005",
"0.6112861",
"0.6086082",
"0.60566664",
"0.60566664",
"0.60408974",
"0.602815",
"0.5951273",
"0.5927557",
"0.5922415",
"0.59057003",
"0.58458316",
"0.57825786",
"0.577... | 0.7618007 | 0 |
POST /rental_cars POST /rental_cars.json | def create
@rental_car = RentalCar.new(rental_car_params)
respond_to do |format|
if @rental_car.save
format.html { redirect_to rental_cars_path, notice: 'Rental car was successfully created.' }
format.json { render :index, status: :created, location: @rental_car }
else
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @car = Car.new(car_params)\n\n if @car.save\n render json: @car, status: :created, location: @car\n else\n render json: @car.errors, status: :bad_request\n end\n end",
"def create\n @car = Car.new(car_params)\n respond_to do |format|\n if @car.save\n format.h... | [
"0.72345227",
"0.69063675",
"0.6847033",
"0.68284893",
"0.68284893",
"0.68284893",
"0.68284893",
"0.68284893",
"0.68284893",
"0.68284893",
"0.68178475",
"0.67889917",
"0.67889917",
"0.6740238",
"0.67308533",
"0.6710483",
"0.6614746",
"0.660719",
"0.653375",
"0.64877975",
"0.6... | 0.7420582 | 0 |
PATCH/PUT /rental_cars/1 PATCH/PUT /rental_cars/1.json | def update
respond_to do |format|
if @rental_car.update(rental_car_params)
format.html { redirect_to rental_cars_path, notice: 'Rental car was successfully updated.' }
format.json { render :index, status: :ok, location: @rental_car }
else
format.html { render :edit }
form... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @car = Car.find(params[:id])\n\n if @car.update(car_params)\n head :no_content\n else\n render json: @car.errors, status: :unprocessable_entity\n end\n end",
"def update\n authenticate_request!\n\n @car = Car.find(params[:id])\n\n if @car.update(car_params)\n ... | [
"0.7065507",
"0.7058446",
"0.6793542",
"0.6776894",
"0.6776894",
"0.672278",
"0.66935647",
"0.66935647",
"0.66656405",
"0.6629475",
"0.66082126",
"0.6607564",
"0.6607564",
"0.6607564",
"0.6607564",
"0.6607564",
"0.6607564",
"0.6607564",
"0.6607564",
"0.6607564",
"0.6607564",
... | 0.7066692 | 0 |
DELETE /rental_cars/1 DELETE /rental_cars/1.json | def destroy
@rental_car.destroy
respond_to do |format|
format.html { redirect_to rental_cars_url, notice: 'Rental car was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @car = Car.find(params[:id])\n @car.destroy\n\n respond_to do |format|\n format.html { redirect_to cars_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @car = Car.find(params[:id])\n @car.destroy\n\n respond_to do |format|\n format.html { r... | [
"0.73858577",
"0.73858577",
"0.73850286",
"0.73850286",
"0.73323447",
"0.7266304",
"0.72424483",
"0.722783",
"0.72217613",
"0.7181927",
"0.71810055",
"0.7178219",
"0.7172007",
"0.71236455",
"0.71236455",
"0.71236455",
"0.71236455",
"0.71236455",
"0.71236455",
"0.71236455",
"0... | 0.74562234 | 0 |
Indicates whether the renderer handles animations or not. false indicates that slides should not be repeated. | def handles_animation?
false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handles_animation?\n true\n end",
"def animated?\n @animated\n end",
"def animation?\n return @animation != nil\n end",
"def inPartyAnimation?\r\n return @animations.length>0\r\n end",
"def animation?\n for sprite in @enemy_sprites + @actor_sprites\n return tru... | [
"0.8096767",
"0.76583505",
"0.74129844",
"0.6555348",
"0.62362456",
"0.6214282",
"0.6214282",
"0.61646605",
"0.61646605",
"0.60942906",
"0.6080439",
"0.5908779",
"0.5886608",
"0.5852896",
"0.5851341",
"0.58097315",
"0.58097315",
"0.57868123",
"0.578375",
"0.5780767",
"0.57322... | 0.8116292 | 1 |
Model.human_name is deprecated. Use Model.model_name.human instead. | def human_name(*args)
ActiveSupport::Deprecation.warn("human_name has been deprecated, please use model_name.human instead", caller[0,1])
model_name.human(*args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def human_model_name\n model_name.humanize\n end",
"def human_model_name\n model_name.humanize\n end",
"def human_model name=nil, pluralize=false\n s = model(name).human_name\n s = s.pluralize if pluralize && pluralize != 1\n s\n end",
"def human_model_name(object)\n if object.clas... | [
"0.83423424",
"0.83423424",
"0.80238086",
"0.7833945",
"0.77923775",
"0.764233",
"0.7599657",
"0.7581026",
"0.7498146",
"0.74338466",
"0.7408258",
"0.74073416",
"0.7393924",
"0.73533976",
"0.7341057",
"0.72971845",
"0.7202835",
"0.71300805",
"0.71073735",
"0.70728",
"0.704662... | 0.8492617 | 0 |
resource wrappers (wrapped around Localeze elements) element 2935 get categories | def get_categories
body = build_request(2935, 1501, "ACTIVEHEADINGS")
response = send_to_localeze(body)
xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def categories\n @categories ||= (@doc/\"Category\").collect { |it| Element.new(it) }\n end",
"def uhook_category_partial category\n locale = ::Locale.find_by_iso_code(category.locale)\n content_tag(:dt, ::Category.human_attribute_name(\"locale\") + ':') +\n content_t... | [
"0.6873484",
"0.6751526",
"0.67265433",
"0.65874094",
"0.6584037",
"0.64311963",
"0.643012",
"0.63962334",
"0.6374662",
"0.6371184",
"0.632317",
"0.6268836",
"0.6258889",
"0.62543905",
"0.6233066",
"0.6222465",
"0.6195614",
"0.6193665",
"0.6187521",
"0.6168951",
"0.61427045",... | 0.71457523 | 0 |
Gets the decimalPlaces property value. How many decimal places to display. See below for information about the possible values. | def decimal_places
return @decimal_places
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def decimal_places=(value)\n @decimal_places = value\n end",
"def decimal_places; end",
"def decimal_places\n self.class.decimal_places_cache[subunit_to_unit]\n end",
"def decimal_places=(decimal_places)\n if !decimal_places.nil? && decimal_places < 0\n fail Argu... | [
"0.79378015",
"0.72057074",
"0.6854736",
"0.6664293",
"0.6383574",
"0.63156074",
"0.59380436",
"0.5906819",
"0.5783315",
"0.571241",
"0.5590575",
"0.5509442",
"0.5485004",
"0.54627514",
"0.5427095",
"0.53781307",
"0.5353258",
"0.5353258",
"0.53439474",
"0.53133315",
"0.527577... | 0.8294227 | 0 |
Sets the decimalPlaces property value. How many decimal places to display. See below for information about the possible values. | def decimal_places=(value)
@decimal_places = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def decimal_places=(decimal_places)\n if !decimal_places.nil? && decimal_places < 0\n fail ArgumentError, 'invalid value for \"decimal_places\", must be greater than or equal to 0.'\n end\n\n @decimal_places = decimal_places\n end",
"def decimal_places\n return @decimal_pl... | [
"0.78652674",
"0.6619695",
"0.6260934",
"0.5837648",
"0.5775854",
"0.57409495",
"0.5514737",
"0.5460927",
"0.5347748",
"0.53474444",
"0.51275134",
"0.5071308",
"0.5048323",
"0.504428",
"0.50328684",
"0.5009434",
"0.49796298",
"0.47458932",
"0.474393",
"0.45743322",
"0.4556078... | 0.84519744 | 0 |
Gets the displayAs property value. How the value should be presented in the UX. Must be one of number or percentage. If unspecified, treated as number. | def display_as
return @display_as
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_as=(value)\n @display_as = value\n end",
"def display_value\n case self.value_type\n when 'Numeric'\n unless self.multiplier.nil? || self.multiplier.blank?\n \"#{self.value} #{self.multiplier}(s) <span class='badge'>#{self.convert_value_by_type} bytes... | [
"0.6946745",
"0.64114344",
"0.6094438",
"0.60136867",
"0.594675",
"0.5850479",
"0.58494115",
"0.5813908",
"0.57994914",
"0.5788746",
"0.56153053",
"0.5596943",
"0.5496521",
"0.5465239",
"0.5362395",
"0.5357115",
"0.52523196",
"0.52523196",
"0.5213264",
"0.51875585",
"0.517661... | 0.67938846 | 1 |
Sets the displayAs property value. How the value should be presented in the UX. Must be one of number or percentage. If unspecified, treated as number. | def display_as=(value)
@display_as = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_as\n return @display_as\n end",
"def display_as\n params[:display_as]\n end",
"def display_value(value)\n return \"N/A\" if value.zero?\n number_to_currency(value, precision: 0)\n end",
"def display_value\n case self.value_type\n when 'Numeric'\n ... | [
"0.6043243",
"0.5642977",
"0.55330557",
"0.54842114",
"0.5449902",
"0.54137105",
"0.5237193",
"0.49191257",
"0.49078047",
"0.4905036",
"0.4905036",
"0.4905036",
"0.4905036",
"0.4905036",
"0.4905036",
"0.4905036",
"0.4905036",
"0.4905036",
"0.4905036",
"0.4905036",
"0.4905036"... | 0.7724298 | 0 |
Gets the minimum property value. The minimum permitted value. | def minimum
return @minimum
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def minimum_value\n @minimum_value || store.min\n end",
"def get_min()\n @min\n end",
"def get_min\n @min\n end",
"def minvalue\n MINVALUE\n end",
"def get_min()\n @min \n end",
"def get_min()\n @data.min\n end",
"def minimum\n object.minimum.to_f\n ... | [
"0.8171997",
"0.7887271",
"0.76492554",
"0.7582714",
"0.74359554",
"0.7310375",
"0.72689843",
"0.7231755",
"0.71982193",
"0.71006185",
"0.7017271",
"0.70034164",
"0.698863",
"0.693419",
"0.692787",
"0.6889345",
"0.6888529",
"0.6815768",
"0.67396724",
"0.6707904",
"0.67045254"... | 0.79085547 | 1 |
Sets the minimum property value. The minimum permitted value. | def minimum=(value)
@minimum = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_Minimum(value)\n set_input(\"Minimum\", value)\n end",
"def set_min(min)\n\n @min = min \n\n end",
"def min(value)\n opts[:min] = value\n end",
"def set_min( min )\n if IntegerOption.bounds_ok?( min, @max )\n @min = min\n else\n @min = nil\n ... | [
"0.819543",
"0.7879908",
"0.7622051",
"0.74416244",
"0.74145067",
"0.7106753",
"0.7106753",
"0.70925885",
"0.70925885",
"0.6830137",
"0.67900425",
"0.67332417",
"0.6639685",
"0.6613037",
"0.65425646",
"0.65425646",
"0.6509885",
"0.6481013",
"0.64481896",
"0.6441025",
"0.64242... | 0.83990884 | 0 |
=begin i: array with 'faces'strings o: number of smiling faces r: face has : or ; face may have or ~ face has ) or D nothing else! f: loop throug faces if 2 long: index 0 in valid eyes index 1 in valid mouth if 3 long: index 0 in valid eyes index 1 in valid nose index 2 in valid mouth if valid face up counter output co... | def countSmileys(faces)
valid_eyes = [':', ';']
valid_nose = ['-', '~']
valid_mouth = [')', 'D']
counter = 0
faces.each do |face|
case face.size
when 2
if valid_eyes.include?(face[0]) &&
valid_mouth.include?(face[1])
counter += 1
end
when 3
if valid_eyes.incl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count_smileys(arr)\n count = 0\n arr.each do |face|\n case\n when face == \":)\"\n count += 1\n when face == \":-)\"\n count += 1\n when face == \":~)\"\n count += 1\n when face == \":D\"\n count += 1\n when face == \":-D\"\n count += 1\n wh... | [
"0.7118032",
"0.6936785",
"0.6496086",
"0.60318416",
"0.60110873",
"0.58371985",
"0.58162344",
"0.5764312",
"0.5764312",
"0.5638524",
"0.56019145",
"0.55512035",
"0.5549019",
"0.55447537",
"0.5506901",
"0.54708034",
"0.5418709",
"0.54167885",
"0.54089683",
"0.540799",
"0.5400... | 0.81330156 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.