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 |
|---|---|---|---|---|---|---|
POST /starts POST /starts.json | def create
@start = Start.new(start_params)
respond_to do |format|
if @start.save
format.html { redirect_to @start, notice: 'Start was successfully created.' }
format.json { render :show, status: :created, location: @start }
else
format.html { render :new }
format.js... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @start = Start.new(params[:start])\n\n respond_to do |format|\n if @start.save\n flash[:notice] = 'Start was successfully created.'\n format.html { redirect_to(@start) }\n format.xml { render :xml => @start, :status => :created, :location => @start }\n else\n ... | [
"0.6393599",
"0.62886375",
"0.6229231",
"0.62081087",
"0.61377347",
"0.6093833",
"0.60547477",
"0.60206705",
"0.6015595",
"0.6015595",
"0.59591234",
"0.59455246",
"0.59455246",
"0.59350187",
"0.5923464",
"0.59216124",
"0.59216124",
"0.58759695",
"0.5842548",
"0.58381575",
"0.... | 0.71388274 | 0 |
PATCH/PUT /starts/1 PATCH/PUT /starts/1.json | def update
respond_to do |format|
if @start.update(start_params)
format.html { redirect_to @start, notice: 'Start was successfully updated.' }
format.json { render :show, status: :ok, location: @start }
else
format.html { render :edit }
format.json { render json: @start.e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @start = Start.find(params[:id])\n\n respond_to do |format|\n if @start.update_attributes(params[:start])\n flash[:notice] = 'Start was successfully updated.'\n format.html { redirect_to(@start) }\n format.xml { head :ok }\n else\n format.html { render :act... | [
"0.6030541",
"0.58475214",
"0.5847404",
"0.5839992",
"0.58153296",
"0.5774663",
"0.5766027",
"0.5732252",
"0.57311445",
"0.57311445",
"0.5651513",
"0.5602971",
"0.55780566",
"0.55711764",
"0.5558788",
"0.5552743",
"0.55316705",
"0.550754",
"0.550754",
"0.550754",
"0.550754",
... | 0.6572822 | 0 |
DELETE /starts/1 DELETE /starts/1.json | def destroy
@start.destroy
respond_to do |format|
format.html { redirect_to starts_url, notice: 'Start was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @start = Start.find(params[:id])\n @start.destroy\n\n respond_to do |format|\n format.html { redirect_to(starts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @bare_start = BareStart.find(params[:id])\n @bare_start.destroy\n\n respond_to do |format|\n... | [
"0.72844136",
"0.6826206",
"0.6812174",
"0.6611977",
"0.6606425",
"0.65752137",
"0.65462285",
"0.65220946",
"0.63978606",
"0.6331363",
"0.6314457",
"0.6310929",
"0.6268035",
"0.62521005",
"0.62519306",
"0.6231679",
"0.6218423",
"0.6197841",
"0.6162357",
"0.6162357",
"0.616235... | 0.7221004 | 1 |
validations so that each carrier can have 1 fee schedule for a date range and also each practice can have standard charge type for 1 date range . | def validate
carrier_fk = carrier_id if carrier_fk.nil?
if id.nil?
date_array = FeeSchedule.find(:all,:conditions=>["carrier_id =? and practice_id = ? ",carrier_fk,practice_id]).collect{|x|[x.start_date,x.end_date]} if carrier_fk != 0
else
date_array = FeeSchedule.find(:all,:conditions=>["carri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate\n if self.start_date.present? && self.due_date.present?\n errors.add_to_base :start_date_cant_be_after_due_date if self.start_date > self.due_date\n # errors.add_to_base :start_date_cant_be_after_due_date if self.start_date > self.due_date\n # errors.add_to_base :end_date_c... | [
"0.7057863",
"0.6804229",
"0.6645855",
"0.6611478",
"0.6527621",
"0.64313924",
"0.64224106",
"0.6385412",
"0.6341738",
"0.63059855",
"0.62680805",
"0.6259231",
"0.62381744",
"0.6231044",
"0.6219691",
"0.62150675",
"0.6204915",
"0.6193173",
"0.6188991",
"0.61724246",
"0.616097... | 0.8095385 | 0 |
than others depending on the number of students he must train in the morning. He is curious how many stairs might be climbed over the next 20 years and has spent a year marking down his daily progress. The sum of all the stairs logged in a year will be used for estimating the number he might climb in 20. 20_year_estima... | def stairs_in_20(stairs)
sums = stairs.map { | day | day.sum }
sums.sum * 20
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_yearwise(incomes_or_deductions)\n income_deduction_per_year = Hash.new(0)\n\n incomes_or_deductions.each do |income_deduction|\n working_days_in_year = Float(52*5)\n daily_income = 0\n\n case income_deduction.frequency\n when \"daily\"\n daily_income = income_deduct... | [
"0.6394595",
"0.5964387",
"0.5750984",
"0.5648261",
"0.56361717",
"0.55898166",
"0.55702055",
"0.5470149",
"0.5461178",
"0.5452435",
"0.5444837",
"0.542539",
"0.54214597",
"0.5347058",
"0.53340745",
"0.53177416",
"0.5317295",
"0.53129727",
"0.53077173",
"0.53028786",
"0.52918... | 0.7112041 | 0 |
Returns a specific challange, categories, prizes and terms Args : access_token > the oauth token to use challenge_id > the id of the challenge to fetch Returns : JSON a challenge object containing a terms_of_service__r and collection of challenge_categories__r and challenge_prizes__r Raises : ++ > 404 if not found or h... | def find
challenge = Challenge.find(@oauth_token, params[:challenge_id].strip,
params[:admin] ||= false)
error! :not_found unless challenge
error! :not_found if challenge['status'].downcase == 'hidden'
expose challenge
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search\n expose Challenge.search(@oauth_token, params[:keyword])\n end",
"def for_connection(id)\n id.require!(as: :id)\n api(:get, \"/connections/#{id}/challenges\")\n .fetch('challenges')\n .cast(Challenge)\n end",
"def terms_get_with_http_info(opts = {})\n i... | [
"0.5901767",
"0.57325804",
"0.57289594",
"0.570902",
"0.5677187",
"0.56347364",
"0.5566078",
"0.55602103",
"0.55426794",
"0.54662716",
"0.5429337",
"0.5423983",
"0.5414602",
"0.540187",
"0.5392262",
"0.5387003",
"0.5387003",
"0.5387003",
"0.5387003",
"0.5309144",
"0.5259649",... | 0.62772155 | 0 |
Returns all currently open or closed challenges Args : access_token > the oauth token to use open > 'true'/'false' category (optional) > the category of challenges to return. Defaults to nil. order_by (optional) > the field to order the results by. Defaults to name. Returns : JSON a collection of challenge objects with... | def all
challenges = Challenge.all(@oauth_token, params[:open],
params[:technology] ||= nil,
params[:platform] ||= nil,
params[:category] ||= nil,
enforce_order_by_params(params[:order_by], 'end_date__c'),
params[:limit] ||= 50,
params[:offset] ||= 0)
# merge in the topc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def categories\n expose Metadata.categories(@oauth_token)\n end",
"def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\trai... | [
"0.5912483",
"0.5439315",
"0.5379654",
"0.53504676",
"0.5332477",
"0.5253184",
"0.5242528",
"0.52317905",
"0.52092373",
"0.5194682",
"0.51898664",
"0.5164409",
"0.51297927",
"0.5123359",
"0.50785136",
"0.507777",
"0.50761557",
"0.5075205",
"0.5062917",
"0.5059088",
"0.5039503... | 0.70875627 | 0 |
Returns all challenges in review Args : access_token > the oauth token to use limit > the number of records to return offset > specifies the starting row offset into the result set returned by your query Returns : JSON a collection of challenge objects with challenge_categories__r and challenge_participants__r Raises :... | def review
expose Challenge.review(@oauth_token,
params[:technology] ||= nil,
params[:platform] ||= nil,
params[:category] ||= nil,
params[:limit] ||= 25,
params[:offset] ||= 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def challenges\n @limit = get_limit\n @offset = get_offset(params)\n if !params[:keyword].nil?\n @results_count = Challenge.count(:conditions => [ \"name like :kw or description like :kw\", { :kw => \"%\" + params[:keyword].to_s + \"%\" }])\n @challenges = Challenge.find(:all,\n ... | [
"0.5815882",
"0.57760364",
"0.5660661",
"0.5566182",
"0.5485318",
"0.5468347",
"0.53991467",
"0.5384681",
"0.5368284",
"0.5350841",
"0.53349614",
"0.5324385",
"0.53205454",
"0.5311259",
"0.5310036",
"0.52515715",
"0.5245335",
"0.52284616",
"0.52284616",
"0.52198917",
"0.52182... | 0.66149175 | 0 |
Creates a new challenge Args : access_token > the oauth token to use params[:data] > the JSON to use to create the challenge. See spec/data/create_challenge.json for example. Returns : a hash containing the following keys: success, challenge_id, errors Raises : ++ > | def create
expose Challenge.create(@oauth_token, params[:data])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @challenge = Challenge.new(challenge_params)\n\n respond_to do |format|\n if @challenge.save\n format.html { redirect_to @challenge, notice: \"Challenge was successfully created.\" }\n format.json { render :show, status: :created, location: @challenge }\n else\n fo... | [
"0.618596",
"0.6151295",
"0.611568",
"0.6073756",
"0.60605747",
"0.58879894",
"0.57978827",
"0.5758241",
"0.5753846",
"0.57418114",
"0.57317185",
"0.5589685",
"0.5589685",
"0.55109245",
"0.5485689",
"0.54637545",
"0.5376359",
"0.5357123",
"0.5330578",
"0.52501327",
"0.5231579... | 0.7499791 | 0 |
Updates an existing challenge Args : access_token > the oauth token to use params[:data] > the JSON to use to update the challenge. See spec/data/update_challenge.json for example. Returns : a hash containing the following keys: success, challenge_id, errors Raises : ++ > | def update
expose Challenge.update(@oauth_token, params[:challenge_id].strip,
params[:data])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @response_challenge = ResponseChallenge.find(params[:id])\n\n respond_to do |format|\n if @response_challenge.update_attributes(params[:response_challenge])\n format.html { redirect_to @response_challenge, notice: 'Response challenge was successfully updated.' }\n format.json ... | [
"0.63483584",
"0.6305761",
"0.62643695",
"0.62643695",
"0.6226585",
"0.6180847",
"0.61525637",
"0.61525637",
"0.61525637",
"0.61525637",
"0.61525637",
"0.6114581",
"0.6031975",
"0.6029226",
"0.5965443",
"0.5922042",
"0.5785507",
"0.5785507",
"0.5718546",
"0.5641364",
"0.56349... | 0.7709294 | 0 |
Performs advanced search Args : access_token > the oauth token to use keyword > a series of search parameters Returns : JSON an array of challenges Raises : ++ > | def advsearch
expose Challenge.advsearch(@oauth_token, params)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search\n expose Challenge.search(@oauth_token, params[:keyword])\n end",
"def search(query, access_token, options={})\n account = VagrantCloud::Account.new(\n custom_server: api_server_url,\n access_token: access_token\n )\n params = {query: query}.merge(o... | [
"0.7528122",
"0.6198722",
"0.6189551",
"0.60947275",
"0.60128534",
"0.6004302",
"0.58906513",
"0.58751655",
"0.5811122",
"0.5789812",
"0.57799774",
"0.576823",
"0.5749731",
"0.57420194",
"0.5699054",
"0.5631897",
"0.5624129",
"0.5608858",
"0.56025475",
"0.55916053",
"0.558944... | 0.8004117 | 0 |
Performs simple, keyword search against open challenges Args : access_token > the oauth token to use keyword > the keyword used in the search Returns : JSON an array of challenges Raises : ++ > | def search
expose Challenge.search(@oauth_token, params[:keyword])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def advsearch\n expose Challenge.advsearch(@oauth_token, params)\n end",
"def challenges\n @limit = get_limit\n @offset = get_offset(params)\n if !params[:keyword].nil?\n @results_count = Challenge.count(:conditions => [ \"name like :kw or description like :kw\", { :kw => \"%\" + params[:keywor... | [
"0.70636725",
"0.6187113",
"0.5908558",
"0.5849095",
"0.5808614",
"0.58075184",
"0.5793514",
"0.57755244",
"0.5729009",
"0.57260996",
"0.5707187",
"0.5663633",
"0.56616664",
"0.56428677",
"0.5604051",
"0.55875224",
"0.5517998",
"0.5504449",
"0.5488344",
"0.5483738",
"0.547993... | 0.7612532 | 0 |
Returns a collection of participants for a challenge Args : access_token > the oauth token to use challenge_id > the id of the challenge to fetch participants for Returns : JSON a collection of participants with member__r data Raises : ++ > | def participants
expose Challenge.participants(@oauth_token, params[:challenge_id].strip)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_participants\n user = self.load_user(params)\n meeting = self.load_meeting(params)\n\n if user != nil and meeting != nil\n users = meeting.participants\n send_json(users)\n else\n send_error 401\n end\n end",
"def get_members()\n @client.make_request(... | [
"0.6973401",
"0.651632",
"0.64648366",
"0.64648366",
"0.6341736",
"0.63167965",
"0.6310607",
"0.62184125",
"0.61908996",
"0.6168839",
"0.6134922",
"0.6130515",
"0.61103934",
"0.60747206",
"0.60062474",
"0.60049045",
"0.60049045",
"0.5933942",
"0.59174025",
"0.59092087",
"0.58... | 0.78122437 | 0 |
Returns a collection of scorecards for a challenge Args : access_token > the oauth token to use challenge_id > the id of the challenge to fetch scorecards for Returns : JSON a collection of scorecards records Raises : ++ > | def scorecards
expose Challenge.scorecards(@oauth_token, params[:challenge_id].strip)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scorecard\n expose Challenge.scorecard(@oauth_token, params[:challenge_id].strip)\n end",
"def scorecard\n\n teetime_id = params.require :teetime_id\n\n @scorecard = Score.where(teetime_id: teetime_id).order(:hole)\n\n\n\n render json: @scorecard,root: :scorecard\n\n end",
"de... | [
"0.73144394",
"0.6334757",
"0.61731756",
"0.6160984",
"0.5998924",
"0.5986827",
"0.58426344",
"0.5726867",
"0.5692754",
"0.5688549",
"0.5665146",
"0.5656651",
"0.5654395",
"0.5634238",
"0.55963933",
"0.55770135",
"0.5551387",
"0.55475515",
"0.55371565",
"0.5529793",
"0.552979... | 0.84695053 | 0 |
Returns a collection of comments for a challenge Args : access_token > the oauth token to use challenge_id > the id of the challenge to fetch participants for Returns : JSON a collection of comments objects with member__r data and challenge_comments__r for comment replies Raises : ++ > | def comments
expose Challenge.comments(@oauth_token, params[:challenge_id].strip)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def comments\n client.get(\"/#{id}/comments\")\n end",
"def get_conversation_comments(conversation_id)\n list(\"conversations/#{conversation_id}/comments\")\n end",
"def get_comments()\n return self.get_all_comments()\n #issues = @issues\n #issues.each do |issue|\n # puts \"Pro... | [
"0.6694364",
"0.6662048",
"0.6659715",
"0.6532204",
"0.6532204",
"0.6518455",
"0.645724",
"0.6457199",
"0.64517874",
"0.64435095",
"0.6432792",
"0.6426158",
"0.64247125",
"0.6410681",
"0.6409718",
"0.6329705",
"0.6276136",
"0.6275875",
"0.6241701",
"0.6241701",
"0.6241701",
... | 0.8029807 | 0 |
Creates a new discussion board comment for the challenge Args : access_token > the oauth token to use params[:data] > the JSON to use to create the comment. Returns : a hash containing the following keys: success, errors Raises : ++ > | def comment
expose Challenge.comment(@oauth_token, params[:data])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_comment(data)\n current_user.comments.create!(content: data['comment'], blog_id: data['blog_id'])\n end",
"def create\n comment = @project.comments.build(comment_params)\n\n if comment.save\n render json: comment \n else\n render json: { message: 'Error: Failed to add comment.'}\n... | [
"0.6868846",
"0.66405874",
"0.6630049",
"0.66153765",
"0.6570712",
"0.65515023",
"0.65311396",
"0.6514393",
"0.65131134",
"0.65011597",
"0.6489212",
"0.64412665",
"0.64351493",
"0.6417336",
"0.6414038",
"0.64036787",
"0.63857853",
"0.6381213",
"0.6358744",
"0.6341692",
"0.633... | 0.6757685 | 1 |
Creates a new survey for a challenge Args : access_token > the oauth token to use challenge_id > the id of the challenge to create the survey for params[:data] > the hash containing the survey responses Returns : a hash containing the following keys: success, message Raises : ++ > | def survey
expose Survey.create(@oauth_token, params[:challenge_id].strip,
params[:data])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n builder = SurveyBuilder.new\n\n if builder.build(survey_params)\n @survey = builder.survey\n render json: @survey, status: :created, location: @survey\n else\n render json: builder.errors, status: :unprocessable_entity\n end\n end",
"def create\n @title = t('view.surve... | [
"0.66284674",
"0.65385264",
"0.65381587",
"0.65346986",
"0.6534543",
"0.65102065",
"0.6455762",
"0.64469635",
"0.64469635",
"0.6437185",
"0.64295894",
"0.6427167",
"0.6397262",
"0.6397262",
"0.6397262",
"0.6379128",
"0.63527876",
"0.6347804",
"0.6339512",
"0.6315907",
"0.6187... | 0.7729105 | 0 |
Returns the scorecard for a challenge Args : access_token > the oauth token to use challenge_id > the id of the challenge to fetch the scorecard fro Returns : a JSON collection of scorecard questions Raises : ++ > | def scorecard
expose Challenge.scorecard(@oauth_token, params[:challenge_id].strip)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scorecards\n expose Challenge.scorecards(@oauth_token, params[:challenge_id].strip)\n end",
"def scorecard\n\n teetime_id = params.require :teetime_id\n\n @scorecard = Score.where(teetime_id: teetime_id).order(:hole)\n\n\n\n render json: @scorecard,root: :scorecard\n\n end",
"... | [
"0.8144439",
"0.64954644",
"0.582636",
"0.5751943",
"0.56872886",
"0.56307983",
"0.55437666",
"0.5524865",
"0.5503448",
"0.5501449",
"0.54876816",
"0.54192173",
"0.5408345",
"0.5395009",
"0.5394428",
"0.5387044",
"0.5382207",
"0.5363298",
"0.53519243",
"0.5338992",
"0.5335473... | 0.80262184 | 1 |
11112222222222222222 20 9998 1111980581673483 [9899, 9989] | def busqueda6
9899.step(999999999999999999999,9899){|x|break (x) unless (p x).to_s =~ /[^0-2]/}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_integer_list\n assert_equal 'li1ee', [1].bencode\n assert_equal 'li1ei2ei3ei4ee', [1, 2, 3, 4].bencode\n end",
"def p13\n\tnumbers = [\n\t\t37107287533902102798797998220837590246510135740250,\n\t\t46376937677490009712648124896970078050417018260538,\n\t\t7432498619952474105947423330951305812372661... | [
"0.5901647",
"0.58877337",
"0.5830754",
"0.5784885",
"0.5738952",
"0.5702946",
"0.56946945",
"0.5686363",
"0.56828266",
"0.5675808",
"0.5660578",
"0.56574786",
"0.5641826",
"0.5620029",
"0.561039",
"0.55767334",
"0.5551045",
"0.5541052",
"0.5534812",
"0.55252576",
"0.55118215... | 0.588851 | 1 |
Updates the bitmap based on the current direction of the actor | def update_bitmap
if @direction != @actor.direction
@direction = @actor.direction
self.bitmap.dispose if self.bitmap and !self.bitmap.disposed?
if !@iso
self.bitmap = Cache.picture(sprintf("GTBS/wait%d", @direction))
else
self.bitmap = Cache.picture(sprintf("GTBS/wait_iso%d",... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_origin\n if bitmap\n unless @battler && @battler.data_battler.use_sprite\n self.ox = bitmap.width / 2\n self.oy = bitmap.height / 2\n else\n if @anim_cell != @battler.anim_cell\n @anim_cell = @battler.anim_cell\n src_rect.y = (@anim_cell / MaxCol) * he... | [
"0.6870565",
"0.6766179",
"0.65474075",
"0.6330398",
"0.6231352",
"0.6203058",
"0.6202061",
"0.617463",
"0.6045179",
"0.60401976",
"0.59722626",
"0.59570456",
"0.59337234",
"0.59000546",
"0.58997476",
"0.58995557",
"0.58982456",
"0.58683896",
"0.5867448",
"0.5867448",
"0.5857... | 0.77975047 | 0 |
fetch the json for the given url and retun an Array of Result objects. if block is given, each json hash is yielded to it before creating the Result object return nil or false to exclude it from the returned results (i.e. when checking for updates). | def fetch_json(url, &block)
require 'net/http'
require 'json'
resp = Net::HTTP.get_response(URI.parse(url))
json = JSON.parse(resp.body)
return [] unless json.has_key?(KEY)
return [] unless (jrs = json[KEY]).is_a?(Array)
return [] if jrs.empty?
results = []
jrs... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_all_with_url(url, options = {}, &block)\n use_callback = block_given?\n App.delegate.api_client.get(url) do |response, status_code|\n if response.present?\n records = fetch_all_with_attributes(response, save_associations: options[:save], &block)\n else\n ... | [
"0.6918611",
"0.6248108",
"0.61397046",
"0.61079395",
"0.6076975",
"0.58444154",
"0.57969093",
"0.5762408",
"0.57080126",
"0.56953865",
"0.56805116",
"0.56688446",
"0.563604",
"0.55821955",
"0.5543431",
"0.55317473",
"0.55277044",
"0.55221504",
"0.5504743",
"0.54833657",
"0.5... | 0.8386839 | 0 |
aur's search rpc url for the given search term. | def url_for_search(term)
require 'cgi'
'http://aur.archlinux.org/rpc.php' +
'?type=search&arg=' + CGI::escape(term)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_url(term='')\n param = URI.encode_www_form('term' => term)\n \"http://api.urbandictionary.com/v0/define?#{param}\"\n end",
"def search_url(term, opts = {})\n param = URI.encode_www_form(\"term\" => term)\n\n if opts[:api] != false\n \"#{API_ROOT}/define?#{param}\"\n ... | [
"0.77891946",
"0.76015866",
"0.7301985",
"0.7255236",
"0.7060399",
"0.70099723",
"0.66883624",
"0.6489704",
"0.64797777",
"0.64190185",
"0.6410273",
"0.6407864",
"0.6403339",
"0.6374683",
"0.6362807",
"0.6332283",
"0.6308747",
"0.62882733",
"0.6263743",
"0.62396634",
"0.61921... | 0.8889686 | 0 |
aur's info rpc url for the given array of package names. | def url_for_info(terms)
require 'cgi'
'http://aur.archlinux.org/rpc.php?type=multiinfo' +
terms.collect { |t| '&arg[]=' + CGI::escape(t) }.join
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def package_info_command(*args)\n Licensed::Shell.execute(\"go\", \"list\", \"-e\", \"-json\", *Array(args)).strip\n end",
"def itemsUrl(url, repo_name)\n url + '/api/repos/' + repo_name + '/items'\nend",
"def net_http_get_package_info\n thread = @thread\n timestamp = Time.now.utc.strftime(\... | [
"0.6108035",
"0.56471175",
"0.5611671",
"0.5411987",
"0.5313277",
"0.5293131",
"0.5254604",
"0.52124494",
"0.5163154",
"0.5153227",
"0.5153227",
"0.51377416",
"0.51034915",
"0.5066672",
"0.5056564",
"0.5051806",
"0.5036415",
"0.50232625",
"0.50198674",
"0.5016013",
"0.5011859... | 0.6743089 | 0 |
send email notification that invoice is ready | def invoice_is_ready invoice = Invoice.first
@invoice = invoice
mail(to: @invoice.user.email, subject: "You Invoice is ready") do |format|
format.text
format.mjml
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shipping_invoice_ready(invoice) \n @invoice = invoice\n sc = invoice.site.store_config\n mail(:to => sc.shipping_email, :subject => 'Order ready for shipping')\n end",
"def successfully_charged(invoice, user)\n @subscription = invoice.lines.data.first\n @user = user\n @subscri... | [
"0.8170356",
"0.7480277",
"0.72229135",
"0.7170663",
"0.70192534",
"0.6958918",
"0.6946466",
"0.69410414",
"0.69168913",
"0.68985415",
"0.68816227",
"0.6842973",
"0.6822944",
"0.67700434",
"0.6755525",
"0.6754151",
"0.67198557",
"0.66819024",
"0.66649663",
"0.66566545",
"0.66... | 0.852567 | 0 |
wlst_create_PIA_domain call dapps_wlst_create_PIA_domain.bsh file | def wlst_create_PIA_domain
Puppet.alert(" begin : wlst_create_PIA_domain")
lcl_bash_fle_location = get_value4key("bash_file_location", resource[:web_scripts_location] )
lcl_ps_location_arr = resource[:web_location_attrib]
env_action_cmd = lcl_bash_fle_location + "/dapps_wlst_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_domain\n unless domain_exists?\n require 'chef/win32/version'\n version = Chef::ReservedNames::Win32::Version.new\n\n Chef::Log.info(\"Configuring network interface settings and creating domain\")\n if version.windows_server_2012?\n code =<<-EOH\n#{network_interface_code}\n\t\t\t\t$DCP... | [
"0.6363747",
"0.6006324",
"0.5902509",
"0.5771907",
"0.55257636",
"0.5525397",
"0.551637",
"0.5470431",
"0.54341173",
"0.5409512",
"0.535525",
"0.5338537",
"0.53271955",
"0.52886295",
"0.5239844",
"0.5232594",
"0.522196",
"0.5209238",
"0.52088547",
"0.5206762",
"0.5204409",
... | 0.82694644 | 0 |
web_copy_boot_prop_file call web_copy_boot_prop_file.bsh file | def web_copy_boot_prop_file
Puppet.alert(" begin : web_copy_boot_prop_file.bsh ")
lcl_bash_fle_location = get_value4key("bash_file_location", resource[:web_scripts_location] )
lcl_ps_location_arr = resource[:web_location_attrib]
env_action_cmd = lcl_bash_fle_location + "/web_cop... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copy_js_sparc_boot_images(options)\n boot_list=[]\n options['tftpdir']=\"/tftpboot\"\n boot_list.push(\"sun4u\")\n if options['version'] == \"10\"\n boot_list.push(\"sun4v\")\n end\n boot_list.each do |boot_arch|\n boot_file = options['repodir']+\"/Solaris_\"+options['version']+\"/Tools/Boot/platfo... | [
"0.6283076",
"0.6248814",
"0.5718156",
"0.5525484",
"0.55221176",
"0.5457759",
"0.5349866",
"0.53249204",
"0.5287301",
"0.5285582",
"0.5285313",
"0.5277465",
"0.52694046",
"0.52519333",
"0.5234944",
"0.5232865",
"0.5231636",
"0.51984334",
"0.5175955",
"0.51615924",
"0.5157205... | 0.7840871 | 0 |
GET /client_sexes/1 GET /client_sexes/1.json | def show
@client_sex = ClientSex.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @client_sex }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @client_sex = ClientSex.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_sex }\n end\n end",
"def create\n @client_sex = ClientSex.new(params[:client_sex])\n\n respond_to do |format|\n if @client_sex.save\n format.htm... | [
"0.70311564",
"0.6532377",
"0.6361497",
"0.6285556",
"0.6268899",
"0.61568815",
"0.6145933",
"0.606016",
"0.6055177",
"0.6055177",
"0.6055177",
"0.601202",
"0.601202",
"0.601202",
"0.601202",
"0.601202",
"0.601202",
"0.601202",
"0.59994745",
"0.5997154",
"0.59739053",
"0.59... | 0.77581733 | 0 |
GET /client_sexes/new GET /client_sexes/new.json | def new
@client_sex = ClientSex.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @client_sex }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @client_sex = ClientSex.new(params[:client_sex])\n\n respond_to do |format|\n if @client_sex.save\n format.html { redirect_to @client_sex, notice: 'Client sex was successfully created.' }\n format.json { render json: @client_sex, status: :created, location: @client_sex }\n ... | [
"0.7891413",
"0.7068366",
"0.7068366",
"0.7068366",
"0.7068366",
"0.7068366",
"0.706038",
"0.706038",
"0.706038",
"0.706038",
"0.69396275",
"0.6907072",
"0.6895514",
"0.689117",
"0.68453765",
"0.6843827",
"0.6824839",
"0.68195456",
"0.6794216",
"0.67577165",
"0.67525595",
"... | 0.8270946 | 0 |
POST /client_sexes POST /client_sexes.json | def create
@client_sex = ClientSex.new(params[:client_sex])
respond_to do |format|
if @client_sex.save
format.html { redirect_to @client_sex, notice: 'Client sex was successfully created.' }
format.json { render json: @client_sex, status: :created, location: @client_sex }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @client_sex = ClientSex.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_sex }\n end\n end",
"def create\n @sexe = Sexe.new(sexe_params)\n\n respond_to do |format|\n if @sexe.save\n format.html { redirect_to @sexe, no... | [
"0.66816413",
"0.6490108",
"0.6096509",
"0.6087412",
"0.5984205",
"0.5784344",
"0.57363594",
"0.57095754",
"0.5652716",
"0.5632906",
"0.5622302",
"0.5590819",
"0.55589265",
"0.55383587",
"0.5520151",
"0.5494981",
"0.5478235",
"0.54605615",
"0.5456782",
"0.5450252",
"0.5414314... | 0.7679186 | 0 |
PUT /client_sexes/1 PUT /client_sexes/1.json | def update
@client_sex = ClientSex.find(params[:id])
respond_to do |format|
if @client_sex.update_attributes(params[:client_sex])
format.html { redirect_to @client_sex, notice: 'Client sex was successfully updated.' }
format.json { head :ok }
else
format.html { render action... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @client_sex = ClientSex.new(params[:client_sex])\n\n respond_to do |format|\n if @client_sex.save\n format.html { redirect_to @client_sex, notice: 'Client sex was successfully created.' }\n format.json { render json: @client_sex, status: :created, location: @client_sex }\n ... | [
"0.6638461",
"0.6427358",
"0.63436717",
"0.6152071",
"0.61161476",
"0.6100209",
"0.577368",
"0.5731641",
"0.5687157",
"0.5662791",
"0.56527764",
"0.5646491",
"0.56453544",
"0.56011206",
"0.5596883",
"0.558968",
"0.55484015",
"0.5548338",
"0.5541305",
"0.5530262",
"0.5521275",... | 0.7350655 | 0 |
DELETE /client_sexes/1 DELETE /client_sexes/1.json | def destroy
@client_sex = ClientSex.find(params[:id])
@client_sex.destroy
respond_to do |format|
format.html { redirect_to client_sexes_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client a été supprimer.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @my_studio_client = MyStudio::Client.find(params[:id])\n @my_studio_client.destroy\n\n r... | [
"0.6957661",
"0.6954223",
"0.68613017",
"0.68438596",
"0.68361515",
"0.6800059",
"0.6800059",
"0.6800059",
"0.6800059",
"0.6800059",
"0.6800059",
"0.6800059",
"0.6800059",
"0.6800059",
"0.6799382",
"0.6794516",
"0.6794516",
"0.6789139",
"0.6785932",
"0.67842865",
"0.6782122",... | 0.79675126 | 0 |
Returns the width for the game area. Defaults to screen width. | def game_width
screen_size = NSScreen.mainScreen.frame.size
if (screen_size.width / screen_size.height) > GAME_ASPECT
screen_size.width = screen_size.height * GAME_ASPECT
end
screen_size.width
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def screen_width(width)\n ((width.to_f / @scene_width) * $window.width).to_i\n end",
"def window_width\n $game_system.macmm_command_width\n end",
"def get_ScreenWidth\n System::get_property('screen_width')\n end",
"def screenshot_width_for(game)\n return 0 if game.nil? || game.image_width.nil?... | [
"0.7941512",
"0.73830503",
"0.7372366",
"0.73107976",
"0.72904724",
"0.72688913",
"0.7232832",
"0.7190437",
"0.713206",
"0.713206",
"0.713206",
"0.713206",
"0.713206",
"0.7123119",
"0.7085797",
"0.70518124",
"0.7031445",
"0.6966924",
"0.6912472",
"0.6895981",
"0.6862645",
"... | 0.8193712 | 0 |
Returns the height for the game area. Defaults to screen height. | def game_height
screen_size = NSScreen.mainScreen.frame.size
if (screen_size.width / screen_size.height) > GAME_ASPECT
screen_size.height = screen_size.width / GAME_ASPECT
end
screen_size.height
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def screen_height(height)\n ((height.to_f / @scene_height) * $window.height).to_i\n end",
"def get_ScreenHeight\n System::get_property('screen_height')\n end",
"def height\n @dimensions.y\n end",
"def height\n bounds[:bottom] - bounds[:top]\n end",
"def height\n bounds[:bottom]... | [
"0.76830643",
"0.75953317",
"0.72608894",
"0.722389",
"0.722389",
"0.70553344",
"0.6908079",
"0.6880038",
"0.68668705",
"0.68658847",
"0.6834653",
"0.68155754",
"0.6803828",
"0.6749218",
"0.6749127",
"0.67395467",
"0.67391336",
"0.67170465",
"0.66994816",
"0.66641474",
"0.665... | 0.79807 | 0 |
Returns an array of ruby layers colliding with the player layer | def collided_rubies
ruby_layers.map do |ruby|
ruby if ruby.collide_with?(GameData.player_layer.rect_version)
end.compact
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def collided_bombs\n bomb_layers.map do |bomb|\n bomb if bomb.collide_with?(GameData.player_layer.rect_version)\n end.compact\n end",
"def collisions\n [collided_bombs, collided_rubies]\n end",
"def collidesWithPlayer\n for x in @x.round..(@x + @width).round\n for y in (@y - @height).ro... | [
"0.7049699",
"0.5996933",
"0.57983637",
"0.5762428",
"0.5736011",
"0.57232225",
"0.57215554",
"0.5712843",
"0.5686257",
"0.56807905",
"0.56777847",
"0.55670005",
"0.5542911",
"0.5527751",
"0.54811263",
"0.54705715",
"0.54642",
"0.5447838",
"0.5430347",
"0.5410732",
"0.5406005... | 0.7181322 | 0 |
Returns an array of bomb layers colliding with the player layer | def collided_bombs
bomb_layers.map do |bomb|
bomb if bomb.collide_with?(GameData.player_layer.rect_version)
end.compact
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def collided_rubies\n ruby_layers.map do |ruby|\n ruby if ruby.collide_with?(GameData.player_layer.rect_version)\n end.compact\n end",
"def collisions\n [collided_bombs, collided_rubies]\n end",
"def collide_with_other_blocks\n @game.blocks.each do |block|\n if collide(block)\... | [
"0.6814512",
"0.6649743",
"0.59960276",
"0.5882908",
"0.5840554",
"0.5701813",
"0.56726974",
"0.5645326",
"0.563662",
"0.5631486",
"0.56160164",
"0.5576448",
"0.55664843",
"0.55657953",
"0.55650806",
"0.55622494",
"0.55484587",
"0.55150545",
"0.5474863",
"0.5419918",
"0.54038... | 0.81953335 | 0 |
This class always responds to method calls, even those missing. Therefore, respond_to_missing? always returns true. | def respond_to_missing?(_, _ = false)
true # responds to everything, always
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def respond_to_missing?(*)\n true\n end",
"def respond_to_missing?(*)\n true\n end",
"def respond_to_missing?(*_args); super; end",
"def respond_to_missing?(_method_name, _include_all)\n ::Kernel.raise ::NotImplementedError\n end",
"def respond_to_missing?(_method_name, _inc... | [
"0.8440758",
"0.84363526",
"0.8386732",
"0.81997526",
"0.81997526",
"0.8126688",
"0.81239635",
"0.80995595",
"0.8081506",
"0.8015114",
"0.7968101",
"0.7959039",
"0.7959039",
"0.79425037",
"0.7897993",
"0.7886299",
"0.7882746",
"0.78569347",
"0.7837735",
"0.78351504",
"0.78188... | 0.8439611 | 1 |
Take the given object as "self" in the current interpolation context while running a given block. The most typical use case for this is to evaluate options for a received message like this: def receive(message) interpolate_with(message) do Handle each message based on "interpolated" options. end end | def interpolate_with(self_object)
case self_object
when nil
yield
else
context = interpolation_context
begin
context.environments.unshift(self_object.to_liquid)
yield
ensure
context.environments.shift
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_interpolate(token, &block)\n Interpolation.to_interpolate(token, &block)\n end",
"def accept(evaluator)\n evaluator.string_interpolation(self)\n end",
"def run _obj, _binding = nil\n @template.placeholders.each do |ph|\n proc = instance_variable_get(\"@proc_for_#{ph}\".to_sym)\... | [
"0.5790113",
"0.5484998",
"0.5335559",
"0.530176",
"0.52565485",
"0.5158158",
"0.515001",
"0.50823647",
"0.4982942",
"0.4981983",
"0.4981983",
"0.49740404",
"0.49740404",
"0.4941529",
"0.4940105",
"0.4906705",
"0.4896696",
"0.48874158",
"0.48841095",
"0.48784262",
"0.48746255... | 0.6024367 | 0 |
Selects ALL from the memes table | def memes()
db = connect_to_database()
return db.execute("SELECT * FROM memes ORDER BY MemeId DESC")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all(query); end",
"def all\n\t\tquery.execute\n end",
"def select_all; end",
"def all\n self.as_objects(CONNECTION.execute(\"SELECT * FROM #{table_name};\"))\n end",
"def query_all(args = {})\n query(args.merge(select: \"DISTINCT #{model.table_name}.*\"))\n end",
"def all \n resul... | [
"0.62854886",
"0.6220825",
"0.618489",
"0.609385",
"0.59720224",
"0.597029",
"0.5930173",
"0.5875489",
"0.58617705",
"0.5858623",
"0.57923526",
"0.5790393",
"0.57866603",
"0.5773394",
"0.5735194",
"0.5696544",
"0.5683284",
"0.5611347",
"0.5600245",
"0.5594088",
"0.5571202",
... | 0.6309305 | 0 |
Attempts to delete a row in the memes table | def delete_meme(memeid)
db = connect_to_database()
db.execute("DELETE FROM memes WHERE MemeId = ?", memeid)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_row(id)\n table_name = self.to_s.pluralize.underscore\n DATABASE.execute(\"DELETE FROM #{table_name} WHERE id = #{id}\")\n end",
"def delete\n FC::DB.query(\"DELETE FROM #{self.class.table_name} WHERE id=#{@id.to_i}\") if @id\n end",
"def delete\n\n DB.execute(\"DELETE FROM #{table... | [
"0.7140955",
"0.7039575",
"0.7016946",
"0.69010246",
"0.6829959",
"0.68278307",
"0.6806929",
"0.6801121",
"0.6797757",
"0.67130286",
"0.6695775",
"0.6666599",
"0.666383",
"0.6640873",
"0.66108364",
"0.65534633",
"0.6507319",
"0.6506524",
"0.6498072",
"0.6491237",
"0.64837253"... | 0.7734091 | 0 |
Selects the auther id from the meme id | def match_id(memeid)
db = connect_to_database()
return db.execute("SELECT MemeAutherId FROM memes WHERE MemeId = ?", memeid).first["MemeAutherId"]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auth_user_id\n auth[:user_id]\n end",
"def setme\n # retrieve the user name\n id = %x{id}.chomp\n if id =~ /uid=\\d+\\(([^\\)]+)\\)/\n @me = $1\n else\n puts id\n end\n raise \"Could not retrieve user name; 'id' did not work\" unless defined?(@me)\n end",
"def meu_id\n ... | [
"0.66046673",
"0.6365507",
"0.62882906",
"0.6278689",
"0.6278689",
"0.62397856",
"0.62000215",
"0.61678046",
"0.6119488",
"0.6088597",
"0.60664207",
"0.6063457",
"0.60548156",
"0.6034386",
"0.6034024",
"0.59935856",
"0.5982448",
"0.59529275",
"0.5948135",
"0.59451103",
"0.592... | 0.75663626 | 0 |
Validates input data and attempts to update vault credentials | def update_vault_credentials(params, session_id)
db = connect_to_database()
db_old_password = db.execute("SELECT Password FROM users WHERE UserId = ?", session_id).first
byebug
if BCrypt::Password.new(db_old_password["Password"]) == params["old_password"]
if params["new_usern... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update!(**args)\n @has_valid_creds = args[:has_valid_creds] if args.key?(:has_valid_creds)\n end",
"def set_vault\n @vault = params[:vault_id] ? Vault.find_by_id(params[:vault_id]) : Vault.find_by_id(params[:id])\n redirect_to root_url if @vault.nil? || @vault.user_username != params[:u... | [
"0.61541265",
"0.589861",
"0.5745183",
"0.5653469",
"0.5647441",
"0.56186",
"0.55554783",
"0.5511478",
"0.5463835",
"0.54479545",
"0.54445565",
"0.54063135",
"0.53987527",
"0.53540856",
"0.5328933",
"0.532239",
"0.531588",
"0.53122157",
"0.5303853",
"0.52963305",
"0.52844465"... | 0.5908509 | 1 |
wrap socket with OpenSSL. | def create_ssl_socket(raw_socket)
SSLSocketWrap.new(raw_socket, @ssl_config, (DEBUG_SSL ? @debug_dev : nil))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_ssl\n ctx = OpenSSL::SSL::SSLContext.new\n ctx.set_params(verify_mode: OpenSSL::SSL::VERIFY_PEER)\n # We are overwriting the TCP socket with the SSL socket here.\n @socket = OpenSSL::SSL::SSLSocket.new(@socket, ctx)\n @socket.sync_close = true\n @socket.connect\n end",
"def socket\n ... | [
"0.704678",
"0.70148826",
"0.68330216",
"0.68111634",
"0.67568356",
"0.6665241",
"0.6633655",
"0.6633655",
"0.6624647",
"0.6574776",
"0.6486213",
"0.6365541",
"0.63276726",
"0.6223213",
"0.62135804",
"0.6212816",
"0.61849964",
"0.61695516",
"0.6154555",
"0.6140167",
"0.604464... | 0.7173692 | 0 |
SYNOPSIS Client.new(proxy = nil, agent_name = nil, from = nil) ARGS proxy A String of HTTP proxy URL. ex. " agent_name A String for "UserAgent" HTTP request header. from A String for "From" HTTP request header. DESCRIPTION Create an instance. SSLConfig cannot be reinitialized. Create new client. | def initialize(proxy = nil, agent_name = nil, from = nil)
@proxy = nil # assigned later.
@no_proxy = nil
@agent_name = agent_name
@from = from
@www_auth = WWWAuth.new
@proxy_auth = ProxyAuth.new
@request_filter = [@proxy_auth, @www_auth]
@debug_dev = nil
@redirect_uri_callback... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(opts)\n # Get the options and assign default values:\n @host = opts[:host]\n @port = opts[:port] || 443\n @username = opts[:username]\n @password = opts[:password]\n @insecure = opts[:insecure] || false\n @ca_file = opts... | [
"0.6841487",
"0.6438353",
"0.6277071",
"0.627387",
"0.6238929",
"0.62236136",
"0.6043419",
"0.5993548",
"0.5993548",
"0.5984235",
"0.5961692",
"0.5951638",
"0.5900441",
"0.58596975",
"0.5858265",
"0.58293873",
"0.58263063",
"0.57986754",
"0.5795522",
"0.57875496",
"0.57506764... | 0.66201526 | 1 |
GET /tinymap2s/1 GET /tinymap2s/1.json | def show
@tinymap2 = Tinymap.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @tinymap2 }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @tinymap = Tinymap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tinymap }\n end\n end",
"def new\n @moretinymap = Moretinymap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { rend... | [
"0.6957274",
"0.65031767",
"0.644233",
"0.60891217",
"0.60511553",
"0.6048481",
"0.5995585",
"0.59391785",
"0.59084624",
"0.57365686",
"0.57274526",
"0.57097596",
"0.569849",
"0.5695628",
"0.5695628",
"0.56732434",
"0.5670395",
"0.5640644",
"0.55711806",
"0.55522406",
"0.5548... | 0.75103974 | 0 |
Configure and return an S3 bucket for Document storage. | def configure_s3_bucket
connection = Fog::Storage.new(:provider => 'AWS',
:aws_access_key_id => Constants::S3_ACCESS_KEY_ID,
:aws_secret_access_key => Constants::S3_SECRET_ACCESS_KEY)
connection.directories.create(:key => C... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bucket; ::AWS::S3.new({ secure: true }).buckets[DC::SECRETS['bucket']]; end",
"def bucket; ::AWS::S3.new( { :secure => false } ).buckets[DC::SECRETS['bucket']]; end",
"def s3_bucket(bucket_name)\n S3Bucket.new(bucket_name)\n end",
"def upload_bucket\n ::AWS::S3.new( { :secure => false } ).buck... | [
"0.74387014",
"0.72661895",
"0.7257632",
"0.7176038",
"0.71700436",
"0.7080301",
"0.7002872",
"0.6976048",
"0.69294566",
"0.6822975",
"0.6792119",
"0.6744469",
"0.6738645",
"0.6728447",
"0.6717309",
"0.6664159",
"0.66638696",
"0.66177344",
"0.65962195",
"0.6571074",
"0.654507... | 0.76312006 | 0 |
XLink element type attribute: type | def xlink_type # type MUST be defined in every type of link except simple; in simple links, either type or href MUST be specified
qattr(NS_XLINK, 'type')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(node, type); end",
"def type\n @node[\"type\"]\n end",
"def type\n @attributes[:type]\n end",
"def type\n @attributes[:type]\n end",
"def type\n @attributes[:type]\n end",
"def _type\n @link['type']\n end",
"def type\n @attributes[:type]\n end",
"d... | [
"0.7189047",
"0.679509",
"0.67912173",
"0.67912173",
"0.67912173",
"0.6787577",
"0.67548996",
"0.66314983",
"0.6627463",
"0.6609845",
"0.6603661",
"0.6572347",
"0.6572347",
"0.65312546",
"0.65151286",
"0.6492644",
"0.64741766",
"0.6468473",
"0.64227974",
"0.64190316",
"0.6368... | 0.729387 | 0 |
locator attribute: href XLink 1.1 Section 5.4: The value of the href attribute is a [Legacy extended IRIs] (LEIRI). | def xlink_href # href MUST be defined in locator-type elements
qattr(NS_XLINK, 'href')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def href\n attributes[:href]\n end",
"def xlink_href\n LegacyExtendedIRI.new(super).to_target(base)\n end",
"def href\n @node[\"href\"]\n end",
"def href_attribute_node_set(nokogiri_xml_element)\n nokogiri_xml_element.xpath(XPATH[:href_attribute])\n end",
"def hr... | [
"0.68634385",
"0.6391368",
"0.63162065",
"0.6256923",
"0.6231264",
"0.607406",
"0.60280526",
"0.6017024",
"0.6014043",
"0.6001411",
"0.59392375",
"0.5927702",
"0.5884583",
"0.5874054",
"0.5849802",
"0.57646006",
"0.57593185",
"0.57452494",
"0.5732789",
"0.56656915",
"0.566380... | 0.72051615 | 0 |
Creates a unified request body from components converted to JSON | def request_body
MAPPING.keys.inject({}) do |mem, e|
next mem unless value = send(e)
mem.merge!(e.to_s => value.to_json)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_request_body(header_params, form_params, body)\n # http form\n if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||\n header_params['Content-Type'] == 'multipart/form-data'\n data = {}\n form_params.each do |key, value|\n case value\n ... | [
"0.6969642",
"0.6969642",
"0.6969642",
"0.6969642",
"0.6772414",
"0.6754656",
"0.66087157",
"0.6590096",
"0.6519151",
"0.647193",
"0.64544654",
"0.64241743",
"0.6367063",
"0.6366733",
"0.63286465",
"0.63268745",
"0.6314483",
"0.6314123",
"0.63138866",
"0.63138866",
"0.6313886... | 0.72617966 | 0 |
Creates memoized Minfraud::HTTPService::Request instance | def request
@request ||= Request.new(::Minfraud::HTTPService.configuration)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_new_http_request\n # Create a new HTTP request instance\n request_spec = @data[:request][:instance]\n http_class = \"Net::HTTP::#{request_spec.verb._camelize}\"\n http_request = http_class._constantize::new(request_spec.path)\n # Set the request body\n ... | [
"0.6988064",
"0.68402195",
"0.67724246",
"0.6707171",
"0.6645894",
"0.6616075",
"0.65307945",
"0.65175354",
"0.65143734",
"0.6476765",
"0.6397762",
"0.63776165",
"0.6320475",
"0.63137835",
"0.6304847",
"0.62888527",
"0.6256114",
"0.62279373",
"0.6224722",
"0.62104356",
"0.620... | 0.719725 | 0 |
Create a world for the user | def create_world
my_world = World.create!(:world_template => WorldTemplate.first, :user => self)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @world = current_user.worlds.build(world_params)\n\n if @world.save\n redirect_to world_path(@world)\n else\n render 'new'\n end \nend",
"def newWorld(db, name)\n\tif db.hexists('sgt-worlds', name)\n\t\treturn World.new(db, db.hget('sgt-worlds', name))\n\tend\n\tnewId = newU... | [
"0.76075375",
"0.72406584",
"0.69617957",
"0.68799293",
"0.67209893",
"0.67096627",
"0.66040653",
"0.6512583",
"0.6495884",
"0.6443821",
"0.6433526",
"0.6428586",
"0.6415537",
"0.64103127",
"0.6371248",
"0.6329702",
"0.6329702",
"0.6326918",
"0.62750655",
"0.62635547",
"0.607... | 0.80942357 | 0 |
get fullname with namespace and title | def full_title
"#{namespace}:#{title}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_name\n if namespace\n \"#{namespace}#{SEPARATOR}#{name}\"\n else\n \"#{name}\"\n end\n end",
"def full_title\n # if used default namespaces -> remove from full title\n if (self.namespace == '101') or (self.namespace == 'Concept')\n self.title\n else\n #... | [
"0.7768374",
"0.7754954",
"0.70782554",
"0.7063091",
"0.70546544",
"0.6998636",
"0.69204015",
"0.6904485",
"0.6715959",
"0.66961706",
"0.66864866",
"0.6632191",
"0.66281223",
"0.6626439",
"0.6601137",
"0.65893215",
"0.65893215",
"0.65893215",
"0.6579537",
"0.65705156",
"0.656... | 0.78234005 | 0 |
GET /aquizitions_rows GET /aquizitions_rows.json | def index
@aquizitions_rows = AquizitionsRow.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_aquizitions_row\n @aquizitions_row = AquizitionsRow.find(params[:id])\n end",
"def rows\n render 'rows.html'\n end",
"def rows\n return @rows if @rows\n if execute && result['rows']\n @rows ||= result['rows'].map{|v| ViewRow.new(v, model)}\n els... | [
"0.6582241",
"0.64102477",
"0.6325718",
"0.6313988",
"0.6261782",
"0.6114885",
"0.61123216",
"0.610318",
"0.610318",
"0.610318",
"0.6016357",
"0.5945949",
"0.5916441",
"0.5848099",
"0.5844462",
"0.5785492",
"0.57716393",
"0.57484955",
"0.57469624",
"0.57455444",
"0.5716646",
... | 0.750453 | 0 |
POST /aquizitions_rows POST /aquizitions_rows.json | def create
@aquizitions_row = AquizitionsRow.new(aquizitions_row_params)
respond_to do |format|
if @aquizitions_row.save
format.html { redirect_to @aquizitions_row, notice: 'Aquizitions row was successfully created.' }
format.json { render action: 'show', status: :created, location: @aqui... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_aquizitions_row\n @aquizitions_row = AquizitionsRow.find(params[:id])\n end",
"def index\n @aquizitions_rows = AquizitionsRow.all\n end",
"def aquizitions_row_params\n params.require(:aquizitions_row).permit(:file_lines, :id)\n end",
"def destroy\n @aquizitions_row.destroy\n ... | [
"0.66690797",
"0.6545431",
"0.6116113",
"0.5836252",
"0.56984866",
"0.56951904",
"0.5690345",
"0.54652125",
"0.54609275",
"0.53995943",
"0.53977346",
"0.53615254",
"0.5323362",
"0.53130156",
"0.53013676",
"0.5291105",
"0.5287196",
"0.52796406",
"0.5254058",
"0.525267",
"0.524... | 0.68659484 | 0 |
PATCH/PUT /aquizitions_rows/1 PATCH/PUT /aquizitions_rows/1.json | def update
respond_to do |format|
if @aquizitions_row.update(aquizitions_row_params)
format.html { redirect_to @aquizitions_row, notice: 'Aquizitions row was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_aquizitions_row\n @aquizitions_row = AquizitionsRow.find(params[:id])\n end",
"def edit_question\n\t\t\tquizzes = current_instructor.quizzes\n\t\t\t@found = 0\n\t\t\tquizzes.each do |quiz|\n\t\t\t\tif(quiz.questions.exists?(:id => params[:question_id]))\n\t\t\t\t\t@found = @found + 1\n\t\t\t\tend... | [
"0.6615313",
"0.63248104",
"0.6111721",
"0.603484",
"0.6019604",
"0.60064155",
"0.5918047",
"0.58841074",
"0.58751076",
"0.58729523",
"0.58681834",
"0.58608454",
"0.5858179",
"0.5847606",
"0.58444446",
"0.5844406",
"0.58140826",
"0.57987833",
"0.57860875",
"0.5762165",
"0.575... | 0.7404451 | 0 |
DELETE /aquizitions_rows/1 DELETE /aquizitions_rows/1.json | def destroy
@aquizitions_row.destroy
respond_to do |format|
format.html { redirect_to aquizitions_rows_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_row(row_id); rest_delete(\"#{link('rows')}/#{row_id}\"); nil; end",
"def destroy\n @quiz.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @tgl_row = TglRow.find(params[:id])\n @tgl_row.destroy\n\n respond_to do |format|\n f... | [
"0.7135025",
"0.66576004",
"0.6657298",
"0.66565824",
"0.6631077",
"0.6609615",
"0.6562591",
"0.65604615",
"0.6550273",
"0.65210295",
"0.64994925",
"0.6493193",
"0.6429477",
"0.64218605",
"0.6393957",
"0.63919306",
"0.63695794",
"0.636355",
"0.6362079",
"0.63619775",
"0.63533... | 0.79463214 | 0 |
GET /patients/1 GET /patients/1.xml | def show
@patient = Patient.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @patient }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @patients = Patient.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @patients }\n end\n end",
"def show\r\n @patient = Patient.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.x... | [
"0.71160966",
"0.7069938",
"0.70295644",
"0.6823327",
"0.676281",
"0.6602721",
"0.65908",
"0.6581587",
"0.6545546",
"0.65092075",
"0.65092075",
"0.65092075",
"0.6468581",
"0.642652",
"0.6420123",
"0.6397472",
"0.6383748",
"0.6382015",
"0.6367971",
"0.6367971",
"0.6367971",
... | 0.72247374 | 0 |
PUT /patients/1 PUT /patients/1.xml | def update
@patient = Patient.find(params[:id])
respond_to do |format|
if @patient.update_attributes(params[:patient])
format.html { redirect_to(@patient, :notice => 'Patient was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\r\n @patient = Patient.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @patient.update_attributes(params[:patient])\r\n format.html { redirect_to(@patient, :notice => I18n.t(\"notifications.patients.update_success\")) }\r\n format.xml { head :ok }\r\n else\r\n ... | [
"0.6375704",
"0.6227242",
"0.6167802",
"0.613947",
"0.61337733",
"0.6115589",
"0.60673475",
"0.59703493",
"0.5961303",
"0.5956277",
"0.5912528",
"0.5912442",
"0.5901895",
"0.5892971",
"0.58609205",
"0.5855395",
"0.5853954",
"0.58484757",
"0.5846383",
"0.5839581",
"0.5839581",... | 0.6440351 | 1 |
DELETE /patients/1 DELETE /patients/1.xml | def destroy
@patient = Patient.find(params[:id])
@patient.destroy
respond_to do |format|
format.html { redirect_to(patients_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\r\n @patient = Patient.find(params[:id])\r\n @patient.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(patients_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def delete\n @patient = Patient.find(params[:id])\n end",
"def delete_patient_by_id(p... | [
"0.7309154",
"0.71975136",
"0.71773696",
"0.7004435",
"0.69748276",
"0.6910371",
"0.69099474",
"0.68992794",
"0.6869169",
"0.6859384",
"0.6797873",
"0.67464256",
"0.67400473",
"0.6731184",
"0.6724773",
"0.6724773",
"0.6724773",
"0.6724773",
"0.6718866",
"0.6718471",
"0.666007... | 0.7378587 | 1 |
GET /complaints GET /complaints.xml | def index
@complaints = Complaint.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @complaints }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all\n get(\"#{domain}/complaints\")\n end",
"def list\n\t @complaints = Complaint.find(:all, :conditions => \"approved = 0\")\n\t\trespond_to do |format|\t\t\n\t\t\tformat.html \n\t\t\tformat.xml { render :xml => @complaints }\t#Render to XML File\n\t\tend\n\t end",
"def show\n @compl... | [
"0.76533085",
"0.7190986",
"0.6222202",
"0.6158179",
"0.6008332",
"0.5974777",
"0.59718674",
"0.596792",
"0.5774028",
"0.5770083",
"0.5751088",
"0.574277",
"0.5742076",
"0.57250255",
"0.5702774",
"0.5691709",
"0.5620347",
"0.5617507",
"0.5613732",
"0.560052",
"0.55523014",
... | 0.7275538 | 1 |
PUT /complaints/1 PUT /complaints/1.xml | def update
@complaint = Complaint.find(params[:id])
respond_to do |format|
if @complaint.update_attributes(params[:complaint])
format.html { redirect_to("/complaints/new/1", :notice => 'Complaint was successfully updated.') }
format.xml { head :ok }
else
format.html { render... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @complaint = Complaint.find(params[:id])\n\n respond_to do |format|\n if @complaint.update_attributes(params[:complaint])\n flash[:notice] = 'Complaint was successfully updated.'\n format.html { redirect_to(@complaint) }\n format.xml { head :ok }\n else\n f... | [
"0.6278014",
"0.6262089",
"0.60542595",
"0.60153484",
"0.59573394",
"0.5752005",
"0.5752005",
"0.57385075",
"0.56924707",
"0.5658653",
"0.56069374",
"0.55741674",
"0.5512251",
"0.5508635",
"0.54568726",
"0.5416739",
"0.5402295",
"0.5392951",
"0.5391027",
"0.53876853",
"0.5379... | 0.64626116 | 0 |
DELETE /complaints/1 DELETE /complaints/1.xml | def destroy
@complaint = Complaint.find(params[:id])
@complaint.destroy
respond_to do |format|
format.html { redirect_to(complaints_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @complaint = Complaint.find(params[:id])\n @complaint.destroy\n\n respond_to do |format|\n format.html { redirect_to(complaints_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @cec_complaint = CecComplaint.find(params[:id])\n @cec_complaint.destroy\n\n ... | [
"0.69261515",
"0.644731",
"0.6430722",
"0.635521",
"0.634594",
"0.63443893",
"0.6287502",
"0.62843066",
"0.62727535",
"0.62368035",
"0.6222604",
"0.6213844",
"0.6212471",
"0.6202713",
"0.61900127",
"0.6152949",
"0.6125057",
"0.60988945",
"0.6048498",
"0.6048498",
"0.6037823",... | 0.69084823 | 1 |
Builds the druby URL from the given options and returns it | def build_url(options)
protocol = options.include?(:certificate) ? 'drbssl' : 'druby'
"#{protocol}://#{options[:host]}:#{options[:port]}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def url_for(*args)\n options = {}\n options = args.pop if args.last.kind_of?(Hash)\n\n segments = []\n segments << url_options[:base_path] if url_options[:base_path]\n segments << prefix if prefix\n segments << version\n segments += args.collect {|part| part.respond... | [
"0.6861716",
"0.67143786",
"0.6603794",
"0.6556127",
"0.6556127",
"0.6556127",
"0.65486234",
"0.65236986",
"0.64968795",
"0.640975",
"0.63585967",
"0.635369",
"0.6325929",
"0.6315305",
"0.62857085",
"0.62479275",
"0.62283707",
"0.6195796",
"0.61747503",
"0.6126138",
"0.611627... | 0.77055275 | 0 |
Git pull from repo to deploy dir | def pull
Dir.chdir @app_dir do
`git pull #{@repo} master`
raise "Deployment of code failed" unless $?.exitstatus == 0
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pull_execute(branch, dir)\n vConfig(CONFIG['configWebsite'])\n read_json(CONFIG['configWebsite'])\n pull = @parse_json_config['deploy']['github']['config']['pull']\n if pull == \"yes\"\n system_commands(\"cd #{dir}; git pull origin #{branch}\")\n end\n end",
"def deploySource\n verify... | [
"0.7689694",
"0.7018174",
"0.693248",
"0.6916149",
"0.6792911",
"0.6767703",
"0.6764744",
"0.6761048",
"0.6747598",
"0.67437905",
"0.6715727",
"0.6688315",
"0.6672388",
"0.66527313",
"0.6651407",
"0.6633185",
"0.66319907",
"0.6575841",
"0.6574947",
"0.6566254",
"0.6563762",
... | 0.77932113 | 0 |
Default action for oauth callbacks. Tries to find and sign in a +User+ object and saves oauth data and yields to a block on failure Params: +request.env['omniauth.auth']+:: Omniauth authetication data recieved from authentications provider +on_fail+:: Block to yield to on failure Author: Mina Nagy | def default_oauth_callback(&on_fail)
auth = request.env['omniauth.auth']
@user = User.send("find_for_#{auth.provider.to_s}_oauth", auth, current_user)
unless @user.persisted?
# save oauth data if user creation failed
session["devise.#{auth.provider.to_s}_data"] = auth.except(:extra)
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_oauth\n data = request.env['omniauth.auth']\n\n # Try find student for provider, if found authenticate normally otherwise redirect to oauth signup page.\n student = Student.find_open_auth(data.provider, data.uid).first\n\n if student&.persisted?\n flash[:notice] = I18n.t 'devi... | [
"0.6885333",
"0.6763251",
"0.64990973",
"0.648158",
"0.6455985",
"0.64336395",
"0.64336395",
"0.6428965",
"0.6337608",
"0.633164",
"0.63016677",
"0.62893987",
"0.6204544",
"0.6191382",
"0.61244804",
"0.6106944",
"0.60910076",
"0.6090916",
"0.6078958",
"0.6070922",
"0.6034347"... | 0.8422162 | 0 |
Default oauth failure handling. Destroys the saved oauth session data and displays the failure reason to the user. Params: +request.env['omniauth.auth']+:: Omniauth authetication data recieved from authentications provider Author: Mina Nagy | def default_oauth_fail
auth = request.env['omniauth.auth']
session.delete("devise.#{auth.provider.to_s}_data")
flash[:alert] = @user.errors.to_a[0] if @user.errors
redirect_to auth.fail_redirect
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fail\n render :text => request.env[\"omniauth.auth\"].to_yaml\n end",
"def rescue_api_error\n session.delete(:access_token)\n\t session.delete(:individual_user_id)\n\t oauth = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET, AUTH_CALLBACK)\n\t redirect_to(:action => \"exit_portal\", :url => oauth.ur... | [
"0.7367877",
"0.7171425",
"0.68349516",
"0.6784225",
"0.64986193",
"0.64804024",
"0.6459591",
"0.6290961",
"0.6272428",
"0.62682253",
"0.61994517",
"0.61685973",
"0.60969234",
"0.60574293",
"0.60504866",
"0.604671",
"0.60413206",
"0.6041187",
"0.60209787",
"0.6015074",
"0.600... | 0.8152023 | 0 |
node value if found to match target_value return addional children to check nil if no additional children to check | def bfs(target_value)
child_arr = [self]
# children.each {|child| children_arr << child }
while child_arr.length > 0
node_to_check = child_arr.shift
return node_to_check if node_to_check.value == target_value
node_to_check.children.each { |child| child_arr << child }
end
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_recursive(root,target_value)\n\n return root if root.payload == target_value\n\n root.children.each do |child|\n node = search_recursive(child,target_value)\n return node if node\n end\n\n return nil\n\nend",
"def find_node(value)\n met_resp = find_node_support(value)\n return nil ... | [
"0.7134803",
"0.64154935",
"0.64154935",
"0.63444525",
"0.6314108",
"0.6313335",
"0.62620676",
"0.620661",
"0.61902595",
"0.6170083",
"0.6149834",
"0.6136485",
"0.61284226",
"0.6094644",
"0.60500103",
"0.6024372",
"0.60164577",
"0.6008851",
"0.6000554",
"0.59942275",
"0.59615... | 0.6777883 | 1 |
GET /extra_holidays GET /extra_holidays.json | def index
@extra_holidays = ExtraHoliday.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @special_holidays = SpecialHoliday.all\n end",
"def set_extra_holiday\n @extra_holiday = ExtraHoliday.find(params[:id])\n end",
"def index\n @holidays = Holiday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidays }\n en... | [
"0.65467286",
"0.6508912",
"0.63775283",
"0.6115221",
"0.6102078",
"0.6086971",
"0.60589355",
"0.6049213",
"0.6006358",
"0.5931214",
"0.5915194",
"0.58860075",
"0.58711946",
"0.58536273",
"0.5818673",
"0.5790784",
"0.5768863",
"0.5700581",
"0.5682843",
"0.56186754",
"0.558546... | 0.7325657 | 0 |
POST /extra_holidays POST /extra_holidays.json | def create
@extra_holiday = ExtraHoliday.new(extra_holiday_params)
respond_to do |format|
if @extra_holiday.save
format.html { redirect_to @extra_holiday, notice: 'Extra holiday was successfully created.' }
format.json { render :show, status: :created, location: @extra_holiday }
els... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extra_holiday_params\n params.require(:extra_holiday).permit(:title, :description, :is_hourly, :is_comment_required, :is_paid, :is_as_attended)\n end",
"def set_extra_holiday\n @extra_holiday = ExtraHoliday.find(params[:id])\n end",
"def index\n @extra_holidays = ExtraHoliday.all\n end"... | [
"0.6724001",
"0.6450218",
"0.62999016",
"0.6220971",
"0.6215155",
"0.6127905",
"0.6057927",
"0.60574317",
"0.60532236",
"0.60368484",
"0.5988962",
"0.5968239",
"0.59227735",
"0.5875025",
"0.5874605",
"0.58598065",
"0.5796264",
"0.5781415",
"0.57542026",
"0.57440114",
"0.56849... | 0.68640095 | 0 |
PATCH/PUT /extra_holidays/1 PATCH/PUT /extra_holidays/1.json | def update
respond_to do |format|
if @extra_holiday.update(extra_holiday_params)
format.html { redirect_to @extra_holiday, notice: 'Extra holiday was successfully updated.' }
format.json { render :show, status: :ok, location: @extra_holiday }
else
format.html { render :edit }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @special_holiday.update(special_holiday_params)\n format.html { redirect_to @special_holiday, notice: 'Special holiday was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_holiday }\n else\n format.html... | [
"0.6825452",
"0.6505103",
"0.6501809",
"0.6488936",
"0.64049214",
"0.6284009",
"0.6263764",
"0.62506837",
"0.6234673",
"0.61881256",
"0.6179817",
"0.6127373",
"0.6063539",
"0.60473907",
"0.59222305",
"0.5875883",
"0.5868683",
"0.5839099",
"0.5826465",
"0.5781931",
"0.5781931"... | 0.7228071 | 0 |
DELETE /extra_holidays/1 DELETE /extra_holidays/1.json | def destroy
@extra_holiday.destroy
respond_to do |format|
format.html { redirect_to extra_holidays_url, notice: 'Extra holiday was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @holiday.destroy\n respond_to do |format|\n format.html { redirect_to holidays_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @special_holiday.destroy\n respond_to do |format|\n format.html { redirect_to special_holidays_url, notice: 'Special ho... | [
"0.7101461",
"0.70239174",
"0.6829199",
"0.6811833",
"0.67788166",
"0.67190295",
"0.6696182",
"0.6692866",
"0.6684754",
"0.6661513",
"0.6658757",
"0.6585972",
"0.6476996",
"0.6463292",
"0.644461",
"0.6443623",
"0.64051294",
"0.6384196",
"0.6379479",
"0.6377657",
"0.6370824",
... | 0.73311543 | 0 |
GET /reconciles/1 GET /reconciles/1.json | def show
@reconcile = Reconcile.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @reconcile }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @reconcile = Reconcile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reconcile }\n end\n end",
"def index\n @commits = Commits.all(params[:branche_id])\n\n respond_to do |format|\n format.json { render json: @commits... | [
"0.5966554",
"0.57992464",
"0.57109743",
"0.5494665",
"0.54782814",
"0.54751503",
"0.54660356",
"0.5435986",
"0.54267496",
"0.5419695",
"0.54005444",
"0.5359135",
"0.53461623",
"0.5335975",
"0.53083044",
"0.5305544",
"0.5302464",
"0.5289102",
"0.5280878",
"0.5275863",
"0.5274... | 0.61224174 | 0 |
GET /reconciles/new GET /reconciles/new.json | def new
@reconcile = Reconcile.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @reconcile }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @gitto = Gitto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gitto }\n end\n end",
"def new\n @colaboration = Colaboration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @colaborati... | [
"0.6784719",
"0.6622676",
"0.6562249",
"0.6560897",
"0.65577465",
"0.6550415",
"0.6472804",
"0.64355594",
"0.6413818",
"0.6413818",
"0.63898385",
"0.6370863",
"0.6370025",
"0.63281935",
"0.6314486",
"0.6304425",
"0.6295252",
"0.628805",
"0.6265966",
"0.6265966",
"0.6257718",
... | 0.7197377 | 0 |
POST /reconciles POST /reconciles.json | def create
@reconcile = Reconcile.new(reconcile_params)
respond_to do |format|
if @reconcile.save
format.html { redirect_to @reconcile, notice: 'Reconcile was successfully created.' }
format.json { render json: @reconcile, status: :created, location: @reconcile }
else
format... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_be_reconciled\n @params.select { |_order_detail_id, params| params[:reconciled] == \"1\" }\n end",
"def index\n @catched = Catched.all\n end",
"def create\n @catched = Catched.new(catched_params)\n @catched.user_id = current_user.id\n\n respond_to do |format|\n if @catched.save... | [
"0.5432884",
"0.5232738",
"0.5194209",
"0.5193124",
"0.5179074",
"0.51760757",
"0.5120972",
"0.511014",
"0.5105625",
"0.50759524",
"0.5041922",
"0.5038187",
"0.50330496",
"0.49651328",
"0.49181432",
"0.49097398",
"0.4907613",
"0.49060982",
"0.48926413",
"0.48639792",
"0.48547... | 0.569085 | 0 |
PUT /reconciles/1 PUT /reconciles/1.json | def update
@reconcile = Reconcile.find(params[:id])
respond_to do |format|
if @reconcile.update_attributes(reconcile_params)
format.html { redirect_to @reconcile, notice: 'Reconcile was successfully updated.' }
format.json { head :no_content }
else
format.html { render actio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go thr... | [
"0.57087636",
"0.5506127",
"0.54998904",
"0.5444469",
"0.5240468",
"0.523391",
"0.5216338",
"0.52162147",
"0.5203784",
"0.5178296",
"0.51691395",
"0.5157656",
"0.51460326",
"0.5115788",
"0.5109169",
"0.5100581",
"0.5056619",
"0.5025986",
"0.50167257",
"0.49672556",
"0.4959783... | 0.57564396 | 0 |
DELETE /reconciles/1 DELETE /reconciles/1.json | def destroy
@reconcile = Reconcile.find(params[:id])
@reconcile.destroy
respond_to do |format|
format.html { redirect_to reconciles_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @patron_merge.destroy\n\n respond_to do |format|\n format.html { redirect_to(patron_merges_url) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercia... | [
"0.64349717",
"0.6431683",
"0.63366836",
"0.6329586",
"0.63024175",
"0.6283485",
"0.62732613",
"0.6270347",
"0.6266295",
"0.62384516",
"0.6201161",
"0.61835736",
"0.6177379",
"0.61706907",
"0.6169964",
"0.6169701",
"0.6169701",
"0.6169701",
"0.6160167",
"0.61573553",
"0.61276... | 0.7266206 | 0 |
:callseq: project(name) => project See Buildrproject. | def project(*args, &block) #:nodoc:
options = args.pop if Hash === args.last
return define(args.first, options, &block) if block
rake_check_options options, :scope, :no_invoke if options
no_invoke = options && options[:no_invoke]
raise ArgumentError, 'Only one project name at a time' unle... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def project(name)\n Ow2mirror::Project.new(self, name)\n end",
"def project(name)\n @projects.find { |p| p.name == name }\n end",
"def project; end",
"def get(project_name)\n response = get_request(\"/projects/#{project_name}/\")\n TheShiningSource::Project.new(response)\n end",
... | [
"0.7515979",
"0.7347624",
"0.729809",
"0.7065876",
"0.69586724",
"0.69586724",
"0.69562936",
"0.6951196",
"0.69191486",
"0.6870662",
"0.68693537",
"0.68601406",
"0.68099594",
"0.676926",
"0.6708143",
"0.6708143",
"0.66952604",
"0.6655262",
"0.66179806",
"0.6597262",
"0.656823... | 0.7587127 | 0 |
Gets the html class to scope css (action). | def action_html_class
"#{h action_name}-action"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def css_class\n end",
"def controller_css_class\n controller_name\n end",
"def css_class\n result = [self.project.try(:css_class), self.try(:format).try(:css_class)].join(' ')\n result = 'other' unless CSS_CLASSES.include?(result)\n result += ' invisible' unless self.is_visible\n result\n end... | [
"0.6897439",
"0.6704273",
"0.6532806",
"0.6452688",
"0.64412355",
"0.63742924",
"0.63134736",
"0.62670225",
"0.6251121",
"0.6225738",
"0.62250596",
"0.6184907",
"0.6165331",
"0.60724777",
"0.6040747",
"0.6020403",
"0.6009758",
"0.6009644",
"0.59603226",
"0.59418225",
"0.59207... | 0.74989706 | 0 |
Manipulates the url, adding or removing parameters. | def manipulate_url(options = {})
params_to_remove = options[:remove_query_param]
page = options[:page]
l_d_exp = options[:l_d_exp]
me_d_exp = options[:me_d_exp]
escape = options[:escape]
path = options[:path] || request.path
query_params = r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def paramaterize params\n segments = @url.split('/')\n segments.map { |item| item[0] == ':' ? params.shift : item }.join('/')\n end",
"def url_with_params(url, params)\n url + '?' + params.delete_if {|k,v| v.nil? || v.empty?}.to_query\n end",
"def process_url_params url, headers\n url_param... | [
"0.6731015",
"0.6712343",
"0.6710368",
"0.6707143",
"0.66744196",
"0.665492",
"0.6620843",
"0.66015166",
"0.6577158",
"0.653043",
"0.64705646",
"0.64705646",
"0.6459118",
"0.6441281",
"0.64195967",
"0.63780546",
"0.63664955",
"0.6364905",
"0.6262333",
"0.6206718",
"0.62030584... | 0.6842426 | 0 |
Renders a two digits number even in the case the number is only onedigit. | def two_digits_number(x)
x < 10 ? "0#{x}" : x.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def two_digit(number)\n dizaine = (number/10) * 10\n unit = (number % 10)\n if unit == 0\n return specific_word(dizaine)\n else\n return specific_word(dizaine) + \" \" + specific_word(unit)\n end\nend",
"def double_digit(num)\n if num.to_s.length < 2\n \"0\" + num.to_s\n else\n num.to_s\... | [
"0.7035192",
"0.6921595",
"0.6810764",
"0.66230285",
"0.6537986",
"0.65370786",
"0.644094",
"0.64207363",
"0.6349055",
"0.63420975",
"0.6334659",
"0.6298861",
"0.6280195",
"0.62723446",
"0.6260903",
"0.6260135",
"0.6235157",
"0.6228408",
"0.6136799",
"0.6136799",
"0.60937834"... | 0.7162834 | 0 |
Url by url type. | def url_by_url_type(url, url_type)
UrlTypes.url_by_url_type url ,url_type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def by_type(type)\n (types['url'].find { |url| url['@type'] == type }).tap do |url|\n raise(StandardError, 'URL details are missing.') if url.nil?\n end['$']\n end",
"def url_for_list(type); end",
"def url_type\n content_type.gsub(\"/\", \"_\")\n end",
"def selected_type\n... | [
"0.7992101",
"0.6861653",
"0.6750155",
"0.6636466",
"0.6562263",
"0.65400195",
"0.6514612",
"0.64740485",
"0.64524025",
"0.6409311",
"0.63916755",
"0.6372725",
"0.6354276",
"0.63065135",
"0.62042516",
"0.6148741",
"0.6058644",
"0.6048223",
"0.6011734",
"0.60002047",
"0.598641... | 0.9001542 | 0 |
name of the mongo DB where the admin user is located | def db_name
'admin'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mongodb_name\n mongodb_stats[\"db\"]\n end",
"def db_prefix\n /mongo_/\n end",
"def mongo\n @mongo[@environment.to_s]\n end",
"def get_mongo_id\n 'mongo-myMongo'\n end",
"def database\n @database ? @database : Database::ADMIN\n end",
"def collection\n ... | [
"0.7600994",
"0.74283826",
"0.70990217",
"0.7067628",
"0.70046324",
"0.6925855",
"0.69161236",
"0.6886182",
"0.6848849",
"0.68427616",
"0.6790209",
"0.67590916",
"0.67236966",
"0.6712337",
"0.6705644",
"0.6630408",
"0.66291773",
"0.66291773",
"0.66266084",
"0.65381145",
"0.65... | 0.7817534 | 0 |
matches namespace from the name remote_repo e.g. "dtk" | def get_namespace(remote_repo_name)
if remote_repo_name
remote_repo_name.scan(/\A.*?(?=--)/).first
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_repo\n matches = @source_url.match @github_regexp\n return unless matches\n owner = matches[:owner]\n name = matches[:name]\n \"#{owner}/#{name}\"\n end",
"def repo_named(full_name)\n pry(Git::Multi.repositories.find { |repo| repo.full_name == full_name })\nend",
"def get_remote_rep... | [
"0.6120136",
"0.6068758",
"0.59914887",
"0.5893701",
"0.5837161",
"0.5720057",
"0.5676164",
"0.5650392",
"0.5638379",
"0.5604331",
"0.55929846",
"0.558395",
"0.55582356",
"0.5553531",
"0.5528466",
"0.5515613",
"0.54913044",
"0.54913044",
"0.5485433",
"0.547119",
"0.54521036",... | 0.7712276 | 0 |
Can check for a specific type e.g., is_device?('iphone') or is_device?('mobileexplorer') | def is_device? type
request.user_agent.to_s.downcase.include?(type.to_s.downcase)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_device?(type)\n\t\trequest.user_agent.to_s.downcase.include?(type.to_s.downcase)\n\tend",
"def is_device?(type)\n request.user_agent.to_s.downcase.include?(type.to_s.downcase)\n end",
"def is_device?(type)\n request.user_agent.to_s.downcase.include?(type.to_s.downcase)\n end",
"def... | [
"0.80945814",
"0.8050232",
"0.80449164",
"0.8014564",
"0.8014564",
"0.73203045",
"0.7290845",
"0.7026375",
"0.69864434",
"0.6749571",
"0.6632978",
"0.6583575",
"0.6499472",
"0.6497284",
"0.64827096",
"0.64718765",
"0.6425119",
"0.637732",
"0.6366877",
"0.6346012",
"0.6287596"... | 0.815832 | 0 |
Can check for a specific type e.g., is_handset?('iphone') or is_handset?('mobileexplorer') | def is_handset? type
Handset.is_handset? request.user_agent, type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_device? type\n request.user_agent.to_s.downcase.include?(type.to_s.downcase)\n end",
"def is_device?(type)\n\t\trequest.user_agent.to_s.downcase.include?(type.to_s.downcase)\n\tend",
"def is_device?(type)\n request.user_agent.to_s.downcase.include?(type.to_s.downcase)\n end",
"def is_d... | [
"0.6714332",
"0.6609988",
"0.6542703",
"0.65415365",
"0.6507949",
"0.6507949",
"0.65073764",
"0.64816725",
"0.64480656",
"0.62584007",
"0.62558323",
"0.6215059",
"0.620137",
"0.620001",
"0.6034369",
"0.6032558",
"0.5991687",
"0.5985207",
"0.5974316",
"0.59555656",
"0.59512913... | 0.7725678 | 0 |
Can check for a specific brand e.g., is_brand?('Nokia') or is_brand?('HTC') | def is_brand? brand
Handset.is_brand? request.user_agent, brand
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_brand(brand)\n case brand\n when \"master\"\n return \"mastercard\"\n when \"american_express\"\n return \"amex\"\n else\n return brand\n end\n end",
"def require_company?\n !!(self.brand && self.brand.name.to_s.match(/studer/i))\n en... | [
"0.7714884",
"0.72361183",
"0.6928444",
"0.67742395",
"0.66304946",
"0.6588179",
"0.6436178",
"0.63787025",
"0.63787025",
"0.6296002",
"0.6282162",
"0.6246939",
"0.62134254",
"0.6142111",
"0.6142111",
"0.5994449",
"0.5993186",
"0.59804136",
"0.59550244",
"0.59483033",
"0.5929... | 0.8161518 | 0 |
Can check for a specific Mobile Model e.g., is_model?('NokiaE72') or is_model?('Nokia6630') | def is_model? model
Handset.is_model? request.user_agent, model
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mobile?\n os_parser.mobile?\n end",
"def is_mobile_or_tablet?\n # mobile_fu's method\n is_mobile_device? || is_tablet_device?\n end",
"def iphone_4?\n GBDeviceInfo.deviceDetails.model == GBDeviceModeliPhone4\n end",
"def mobile_device?\n ua = request.user_agent.to_s.downcase\n ua... | [
"0.6478958",
"0.6359471",
"0.6181932",
"0.61175984",
"0.61009264",
"0.610034",
"0.6049615",
"0.6049615",
"0.5989336",
"0.59481335",
"0.591032",
"0.5907246",
"0.58831626",
"0.5871046",
"0.58658147",
"0.58658147",
"0.58535016",
"0.5852381",
"0.5841688",
"0.5834684",
"0.5827301"... | 0.65303475 | 0 |
Can check for a specific Engine e.g., is_engine?('Webkit') or is_engine?('Chrome') | def is_engine? engine
Engine.is_engine? request.user_agent, engine
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_engine?\n @_se ||= (@platform == 'web' && browser.user_agent.match(/\\(.*https?:\\/\\/.*\\)/)) || params[:se] == '1'\n end",
"def isEngineOn _args\n \"isEngineOn _args;\" \n end",
"def engine? engine_class\n [:execute!, :ability].all? {|meth| engine_class.instance_methods.include?... | [
"0.6832823",
"0.6720559",
"0.6697428",
"0.66129625",
"0.6560056",
"0.6433126",
"0.6417105",
"0.6315499",
"0.6314937",
"0.6294442",
"0.6294442",
"0.6241958",
"0.61879957",
"0.61534786",
"0.61499316",
"0.6098156",
"0.6089066",
"0.6046239",
"0.6014152",
"0.6012893",
"0.6010298",... | 0.80668336 | 0 |
Returns the predictors and target value for the k nearest neighbors for the vector parameter | def nearest_neighbors(vector)
vector = Vector.elements(vector)
distances = @predictors.map.with_index do |p, index|
{ index: index, distance: euclidian_distance(p, vector), value: targets[index] }
end
distances.sort! { |x,y| x[:distance] <=> y[:distance] }
neighborin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nearest_neighbor(target_vector)\n find_nearest_neighbors(target_vector, :results => 1).first\n end",
"def nearest_neighbors(limit, target_vector)\n find_nearest_neighbors(target_vector, :distance => limit)\n end",
"def use_KNN(training, prediction, k_number = 5)\r\n y = []\r\n ... | [
"0.6284379",
"0.6125791",
"0.60565066",
"0.5999633",
"0.5975694",
"0.5647819",
"0.56439394",
"0.559942",
"0.55777264",
"0.55264497",
"0.5415874",
"0.5346391",
"0.53461796",
"0.52974284",
"0.5168156",
"0.51292676",
"0.51283115",
"0.5105457",
"0.5072073",
"0.5022495",
"0.500633... | 0.7661563 | 0 |
GET /lendingitems or /lendingitems.json | def index
@lendingitems = Lendingitem.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_items( args={} )\n @session.base_url = \"http://my.cl.ly\"\n \n url = \"/items\"\n args.each do |k, v|\n # probably a nicer way to do this\n if url == \"/items\"\n url << \"?#{k.to_s}=#{v.to_s}\"\n else\n url << \"&#{k.to_s}=#{v.to_s}\"\n e... | [
"0.6517427",
"0.62317115",
"0.6189845",
"0.608283",
"0.606795",
"0.6033535",
"0.6004582",
"0.59924614",
"0.59734774",
"0.58816785",
"0.5873071",
"0.5869561",
"0.5844979",
"0.5839189",
"0.5832035",
"0.5828103",
"0.5822397",
"0.5807434",
"0.5807434",
"0.5807434",
"0.5807434",
... | 0.6678544 | 0 |
POST /lendingitems or /lendingitems.json | def create
@lendingitem = Lendingitem.new(lendingitem_params)
p @lendingitem
p lendingitem_params
respond_to do |format|
if @lendingitem.save
format.html { redirect_to '/lendingitems', notice: "Lendingitem was successfully created." }
format.json { render :show, status: :created, l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n item = list.items.create!(item_params)\n render json: item, status: 201\n end",
"def create_item()\n\n request_body = {\n 'name' => 'Milkshake',\n 'variations' => [\n {\n 'name' => 'Small',\n 'pricing_type' => 'FIXED_PRICING',\n 'price_money' => {\n '... | [
"0.67605233",
"0.63869405",
"0.6354905",
"0.6229282",
"0.6212031",
"0.6190168",
"0.61579555",
"0.61522603",
"0.6131434",
"0.609278",
"0.6067677",
"0.6043472",
"0.60304254",
"0.6015917",
"0.60062104",
"0.5973167",
"0.5969577",
"0.5964833",
"0.5952722",
"0.5934857",
"0.5913224"... | 0.70614696 | 0 |
PATCH/PUT /lendingitems/1 or /lendingitems/1.json | def update
respond_to do |format|
if @lendingitem.update(lendingitem_params)
format.html { redirect_to @lendingitem, notice: "Lendingitem was successfully updated." }
format.json { render :show, status: :ok, location: @lendingitem }
else
format.html { render :edit, status: :unpro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @liner_item.update(liner_item_params)\n format.html { redirect_to @liner_item, notice: 'Liner item was successfully updated.' }\n format.json { render :show, status: :ok, location: @liner_item }\n else\n format.html { render :edit }\n ... | [
"0.6567001",
"0.6500878",
"0.6441021",
"0.6434923",
"0.64223146",
"0.6413244",
"0.6402069",
"0.6397953",
"0.63345414",
"0.631944",
"0.630141",
"0.62952346",
"0.6280727",
"0.6244063",
"0.6208862",
"0.6147764",
"0.61330014",
"0.6121525",
"0.6121525",
"0.6121525",
"0.6114414",
... | 0.7183546 | 0 |
DELETE /lendingitems/1 or /lendingitems/1.json | def destroy
@lendingitem.destroy
respond_to do |format|
format.html { redirect_to lendingitems_url, notice: "登録商品を削除しました." }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_from_entzumena\n headline = Headline.where({:source_item_type => params[:source_item_type], :source_item_id => params[:source_item_id]}).first\n if headline.destroy\n render :json => true, :status => 200\n else\n render :json => false, :status => :error\n end\n end",
"def delete... | [
"0.696749",
"0.67602235",
"0.67324793",
"0.6695246",
"0.6677494",
"0.66462934",
"0.6644922",
"0.6644922",
"0.6644111",
"0.6607939",
"0.6607939",
"0.6607939",
"0.6607939",
"0.6590927",
"0.65817356",
"0.65483683",
"0.64765334",
"0.64727175",
"0.64675117",
"0.6462071",
"0.643524... | 0.6795582 | 1 |
GET /schools/new GET /schools/new.json | def new
@school = School.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @school }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inschool }\n end\n end",
"def new\n @school_class = SchoolClass.new\n\n respond_to do |format|\n form... | [
"0.76917654",
"0.75687677",
"0.75487125",
"0.75232995",
"0.7504321",
"0.7343061",
"0.73263836",
"0.72634506",
"0.7130509",
"0.71022207",
"0.70990413",
"0.70880693",
"0.70547587",
"0.7048385",
"0.7048385",
"0.7048385",
"0.7048385",
"0.7048385",
"0.7048385",
"0.7048385",
"0.704... | 0.7994683 | 1 |
POST /schools POST /schools.json | def create
@school = School.new(params[:school])
respond_to do |format|
if @school.save
format.html { redirect_to @school, notice: 'School was successfully created.' }
format.json { render json: @school, status: :created, location: @school }
else
format.html { render action:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @school = School.new(school_params)\n respond_to do |format|\n if @school.save\n format.html { redirect_to schools_path }\n format.json { render :show, status: :created, location: @school }\n else\n format.html { render :new }\n format.json { render json: @s... | [
"0.6951859",
"0.68713224",
"0.6835075",
"0.6835075",
"0.6835075",
"0.68343127",
"0.6782188",
"0.6749214",
"0.67319435",
"0.66967875",
"0.6687429",
"0.6681252",
"0.6681252",
"0.66199374",
"0.6602221",
"0.6569052",
"0.6533242",
"0.65302205",
"0.65048254",
"0.6431703",
"0.638082... | 0.6920464 | 1 |
GET /history_studies/1 GET /history_studies/1.json | def show
@history_study = HistoryStudy.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @history_study }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @studies = Study.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @studies }\n end\n end",
"def index\n @studies = Study.all\n #render json: @studies\n end",
"def new\n @history_study = HistoryStudy.new\n\n respond_to do |fo... | [
"0.69189906",
"0.6916025",
"0.6848031",
"0.67021996",
"0.6692331",
"0.66321874",
"0.6614891",
"0.65966827",
"0.65713954",
"0.65107256",
"0.64577997",
"0.64444625",
"0.643765",
"0.643765",
"0.6416466",
"0.64079845",
"0.63992995",
"0.63676816",
"0.6349798",
"0.6312715",
"0.6309... | 0.7390729 | 0 |
GET /history_studies/new GET /history_studies/new.json | def new
@history_study = HistoryStudy.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @history_study }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @history_study = HistoryStudy.new(params[:history_study])\n\n respond_to do |format|\n if @history_study.save\n format.html { redirect_to @history_study, notice: 'History study was successfully created.' }\n format.json { render json: @history_study, status: :created, location... | [
"0.74013186",
"0.73973346",
"0.7319653",
"0.7141873",
"0.7054966",
"0.69098544",
"0.6897402",
"0.6894511",
"0.681599",
"0.6768247",
"0.6718362",
"0.6718362",
"0.6715791",
"0.6713915",
"0.670371",
"0.6697569",
"0.66831964",
"0.6681293",
"0.6676542",
"0.66581714",
"0.66502184",... | 0.80128664 | 0 |
POST /history_studies POST /history_studies.json | def create
@history_study = HistoryStudy.new(params[:history_study])
respond_to do |format|
if @history_study.save
format.html { redirect_to @history_study, notice: 'History study was successfully created.' }
format.json { render json: @history_study, status: :created, location: @history_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @study = Study.new(params[:study])\n\n respond_to do |format|\n if @study.save\n format.html { redirect_to @study, notice: 'Study was successfully created.' }\n format.json { render json: @study, status: :created, location: @study }\n else\n format.html { render ac... | [
"0.656318",
"0.64271194",
"0.61857086",
"0.61057943",
"0.6065652",
"0.597781",
"0.59746647",
"0.59737575",
"0.59414375",
"0.59351367",
"0.59182185",
"0.5859575",
"0.5859575",
"0.5852697",
"0.5849697",
"0.5788892",
"0.5780582",
"0.5779663",
"0.5778679",
"0.5770625",
"0.5770246... | 0.72885835 | 0 |
PUT /history_studies/1 PUT /history_studies/1.json | def update
@history_study = HistoryStudy.find(params[:id])
respond_to do |format|
if @history_study.update_attributes(params[:history_study])
format.html { redirect_to @history_study, notice: 'History study was successfully updated.' }
format.json { head :no_content }
else
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @history_study = HistoryStudy.new(params[:history_study])\n\n respond_to do |format|\n if @history_study.save\n format.html { redirect_to @history_study, notice: 'History study was successfully created.' }\n format.json { render json: @history_study, status: :created, location... | [
"0.65817946",
"0.6197441",
"0.6134894",
"0.61214733",
"0.6103987",
"0.61029696",
"0.60942125",
"0.6072341",
"0.60620785",
"0.60620785",
"0.60620785",
"0.60620785",
"0.60620785",
"0.60620785",
"0.60620785",
"0.59895897",
"0.5916551",
"0.5903508",
"0.5898465",
"0.5879525",
"0.5... | 0.70358497 | 0 |
DELETE /history_studies/1 DELETE /history_studies/1.json | def destroy
@history_study = HistoryStudy.find(params[:id])
@history_study.destroy
respond_to do |format|
format.html { redirect_to history_studies_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @study = Study.find(params[:id])\n @study.destroy\n\n respond_to do |format|\n format.html { redirect_to studies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @history.destroy\n respond_to do |format|\n format.html { redirect_to histories_ur... | [
"0.748273",
"0.7261853",
"0.7246419",
"0.71731365",
"0.71731365",
"0.7167748",
"0.7128457",
"0.7098752",
"0.70448166",
"0.70390093",
"0.70250773",
"0.7014435",
"0.7011534",
"0.69830704",
"0.6953205",
"0.6929655",
"0.6923729",
"0.69074804",
"0.6906838",
"0.68809605",
"0.687809... | 0.799844 | 0 |
Processing to reconcile all options Configliere::Commandline's resolve!: processes all commandline params if the help param was given, prints out a usage statement (using any +:description+ set with define) and then exits lastly, calls the next method in the resolve! chain. | def resolve!
process_argv!
dump_help_if_requested
super()
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolve!\n process_argv!\n if self[:help]\n dump_help\n exit(2)\n end\n super()\n self\n end",
"def run!\n trace = false\n require_program :version, :description\n\n global_option('-h', '--help', 'Help on any command', :hide => true)\n global_opti... | [
"0.75146836",
"0.65301585",
"0.6368446",
"0.62626064",
"0.6139468",
"0.6112446",
"0.61107373",
"0.6105787",
"0.6051712",
"0.5982145",
"0.5966605",
"0.596137",
"0.5930895",
"0.5922832",
"0.5916147",
"0.5906993",
"0.5890882",
"0.5882394",
"0.5879337",
"0.58776605",
"0.587758",
... | 0.74957544 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.