query stringlengths 7 9.55k | document stringlengths 10 363k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Use callbacks to share common setup or constraints between actions. | def set_vendedor
@vendedor = Vendedor.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163754",
"0.6045816",
"0.5944853",
"0.59169096",
"0.58892167",
"0.58342934",
"0.5776148",
"0.57057375",
"0.57057375",
"0.56534296",
"0.56209534",
"0.54244673",
"0.54101455",
"0.54101455",
"0.54101455",
"0.53951085",
"0.5378493",
"0.53563684",
"0.53399915",
"0.5338049",
"0... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def vendedor_params
params.require(:vendedor).permit(:foto, :numero, :fecha_alta, :fecha_baja, :persona_id, :punto_venta_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
Summe 3 letzten ZugKomponente bestimmen TODO | def letzte_komponente
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zuruecksetzen()\n end",
"def konversiMenit(menit) \n # =================================\n # Area Kode Kode di sini\n \n \n \n # =================================\n end",
"def funktionsname\n\tanweisung\nend",
"def sichtbar_machen()\n end",
"def sichtbar_machen()\n # TODO\n end",
"de... | [
"0.6340743",
"0.606892",
"0.60336643",
"0.6014581",
"0.5962886",
"0.58892316",
"0.5831306",
"0.5831306",
"0.5831306",
"0.54412395",
"0.54372436",
"0.5395506",
"0.5394973",
"0.5283816",
"0.52435666",
"0.5229542",
"0.5227611",
"0.522212",
"0.5215394",
"0.5211413",
"0.5163264",
... | 0.67966497 | 0 |
Summe 2 TODO Iterator | def each(&block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each\n @todos.each do |todo|\n yield(todo)\n end\n self\n end",
"def iterator()\n raise NotImplementedError\n end",
"def next() end",
"def next() end",
"def iterator?() end",
"def get_iterator\n\t\tend",
"def get_next_entry; end",
"def next()\n \n end",
"def next()\... | [
"0.5744441",
"0.56883883",
"0.564369",
"0.564369",
"0.548922",
"0.5472498",
"0.54721594",
"0.5422455",
"0.5422455",
"0.5413662",
"0.5286481",
"0.52862066",
"0.5271135",
"0.52708536",
"0.5244285",
"0.5224126",
"0.52098036",
"0.51280904",
"0.51280904",
"0.51222533",
"0.50990057... | 0.0 | -1 |
puts knap(0, weights, values, W, hash) | def change hash, n
if n > 0
hash["New Stuff #{n}"] = 1
change hash, n - 1
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def knapsack(weights, values, capacity)\n\n end",
"def knapSack(wt, val, capacity)\n row = wt.length + 1\n col = capacity + 1\n res = Array.new(row) {Array.new(col)}\n \n for i in 0...row\n for w in 0...col\n if i == 0 || w == 0\n res[i][w] = 0\n elsif ... | [
"0.6501995",
"0.6356534",
"0.6221285",
"0.60850495",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.607498",
"0.... | 0.0 | -1 |
Validate that a context and target method have been supplied. | def validate_settings
raise "method test has no module or class context" unless @context
raise "#{@target} is not a method name" unless Symbol === @target
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method_valid?(method_name)\n # validate method, see if we support given method in current tasks\n (current_context_task_names() + ['help']).include?(method_name)\n end",
"def valid_target\n if method == 'text'\n errors.add(:target, \"That doesn't look like a phone number.... | [
"0.66462183",
"0.6176398",
"0.59984046",
"0.5873459",
"0.5862605",
"0.5798882",
"0.5794802",
"0.57759184",
"0.57727915",
"0.5710372",
"0.5602734",
"0.5602734",
"0.55525404",
"0.5542807",
"0.5522495",
"0.5520157",
"0.55113053",
"0.54811865",
"0.54605883",
"0.5456691",
"0.54505... | 0.72001225 | 0 |
Description of the type of test case. | def type
'Method'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type\n 'Test Case'\n end",
"def test_test_type(test)\n test.type_name\n end",
"def type\n 'describe'\n end",
"def type_name\n TYPE[self.exercise_type].to_s\n end",
"def describe_type\n puts \"I am a #{type} of Bees Wax\"\n end",
"def to_s\n self.test_type\n end",
... | [
"0.85560834",
"0.77670634",
"0.7589083",
"0.7079443",
"0.70549077",
"0.7019962",
"0.6824837",
"0.67932665",
"0.6756447",
"0.6755061",
"0.66691345",
"0.66691345",
"0.66691345",
"0.66691345",
"0.66691345",
"0.66691345",
"0.66691345",
"0.66691345",
"0.66691345",
"0.66691345",
"0... | 0.0 | -1 |
If class method, returns target method's name prefixed with double colons. If instance method, then returns target method's name prefixed with hash character. | def name
"##{target}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method\n self.class.name.split('::').last || ''\n end",
"def method_name\n self.fullname[/\\A(.*)([\\.\\#])([^\\.\\#]+)\\z/, 3]\n end",
"def name\n \"#{@method_name}(#{self.class.name})\"\n end",
"def method_name\n m = @method_stack.first || @@no_method\n m = \"##{m}\" unles... | [
"0.70779794",
"0.70024353",
"0.6988357",
"0.69781345",
"0.69781345",
"0.6952683",
"0.69423807",
"0.6751773",
"0.647786",
"0.63964546",
"0.6366519",
"0.6360977",
"0.6350763",
"0.630936",
"0.630936",
"0.6305427",
"0.6283121",
"0.62395364",
"0.62395364",
"0.62395364",
"0.6220477... | 0.0 | -1 |
TODO: If subcases are to be supported than we need to incorporate the label into to_s. Returns the prefixed method name. | def to_s
"##{target}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def singularized_method_name method\n (method.predicate? ? method[0..-2] : method).singularize.to_sym\n end",
"def build_method_name\n \"#{METHOD_PREFIX}#{super}\"\n end",
"def build_method_name\n \"#{METHOD_PREFIX}#{super}\"\n end",
"def label_text\n method.to_s.gsub('... | [
"0.6891448",
"0.68227977",
"0.68227977",
"0.6644756",
"0.66421723",
"0.6607101",
"0.6389667",
"0.6362387",
"0.6359026",
"0.63493913",
"0.63437086",
"0.63118136",
"0.6293076",
"0.628552",
"0.62531215",
"0.623528",
"0.61796176",
"0.61458856",
"0.6133993",
"0.6133993",
"0.613399... | 0.0 | -1 |
Returns the fully qulaified name of the target method. This is the standard interface used by Ruby Test. | def unit
"#{context}##{target}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method_name\n self.fullname[/\\A(.*)([\\.\\#])([^\\.\\#]+)\\z/, 3]\n end",
"def name\n if @internal_data.have_test_data?\n \"#{@method_name}[#{data_label}](#{self.class.name})\"\n else\n \"#{@method_name}(#{self.class.name})\"\n end\n end",
"def name\n \"#... | [
"0.6935106",
"0.68208927",
"0.6769982",
"0.671449",
"0.671449",
"0.6673762",
"0.6634226",
"0.6597592",
"0.6504683",
"0.64235175",
"0.64175314",
"0.64175314",
"0.64175314",
"0.63752717",
"0.633708",
"0.6325736",
"0.628108",
"0.62810165",
"0.6267059",
"0.6262793",
"0.6228313",
... | 0.5910205 | 51 |
Run test in the context of this case. Notice that run for TestMethod is more complex than a general TestCase. This is to ensure that the target method is invoked during the course of the test. | def run(test, &block)
target = self.target
raise_pending(test.procedure) unless test.procedure
begin
target_class.class_eval do
alias_method "_lemon_#{target}", target
define_method(target) do |*a,&b|
test.tested = true
__send__("_lemon_#{target}",... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call(*params)\n self.send :test, *params\n end",
"def run(*args) #:nodoc:\n return if @method_name == \"default_test\"\n super\n end",
"def _run(context)\n return unless matches_context?(context)\n\n if @run_block\n puts \"[#{context.host}] Executing \\\"#{self.name}\\\"... | [
"0.6443885",
"0.6421036",
"0.6387278",
"0.6355838",
"0.62447697",
"0.6228736",
"0.6228736",
"0.62253374",
"0.61958796",
"0.6194668",
"0.61009145",
"0.60808635",
"0.60792387",
"0.604021",
"0.5993604",
"0.59932214",
"0.59493357",
"0.5941978",
"0.5937916",
"0.5918483",
"0.587567... | 0.6499297 | 0 |
Define a unit test for this case. | def test(label=nil, *tags, &block)
return if @_omit
test = TestProc.new(
:context => @_testcase,
:setup => @_setup,
:skip => @_skip,
:label => label,
:tags => tags,
&block
)
@_testcase.tests << test
test
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testing\n # ...\n end",
"def test_case; end",
"def my_tests\n end",
"def tests; end",
"def tests; end",
"def __dummy_test__\n end",
"def default_test\r\n end",
"def default_test\n end",
"def default_test; end",
"def test_entry\n raise 'Implement the method \"test_entr... | [
"0.7582825",
"0.7504648",
"0.73673135",
"0.7328383",
"0.7328383",
"0.73158365",
"0.7228634",
"0.7167906",
"0.7141021",
"0.7067502",
"0.7060365",
"0.7050997",
"0.70397466",
"0.7039474",
"0.6952019",
"0.6952019",
"0.6908947",
"0.6906686",
"0.6861945",
"0.6861945",
"0.6797514",
... | 0.0 | -1 |
Create a subcase of the method case. | def context(label, *tags, &block)
return if @_omit
@_testcase.tests << TestMethod.new(
:context => @_testcase,
:target => @_testcase.target,
:setup => @_setup,
:skip => @_skip,
:label => label,
:tags => tags,
&block
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cases()\n \n end",
"def UseCase( name )\n return UseCase.new name\nend",
"def define_case(sym, *args)\n record(sym, *args)\n end",
"def create_new_case(project_id,suite_id,sub_section_id,test_case)\n testrail_api_client.send_post(\"add_case/#{sub_section_id || suite_id}\",test_case_data... | [
"0.6215084",
"0.61895764",
"0.59941083",
"0.5714837",
"0.5678057",
"0.5654481",
"0.553861",
"0.5454681",
"0.54349804",
"0.54349804",
"0.5368565",
"0.53326464",
"0.52809304",
"0.5260131",
"0.5245876",
"0.5236501",
"0.5202841",
"0.5160663",
"0.51050204",
"0.5103782",
"0.5088289... | 0.0 | -1 |
If sent via DM, lets make it Anonymous by default. All other messages are public, unless the user has a protected profile, or of course they really were anonymous when creating message. | def anonymous?
private? || guest? || user.protected?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def anonymous\n @@_cache_anonymous ||= (User.where(email: 'anonymous@loverealm.com').take || User.create!(first_name: 'Anonymous', last_name: 'N/A', email: 'anonymous@loverealm.com', password: ENV['LR_SUPER_USERS_PASSWORD'], password_confirmation: ENV['LR_SUPER_USERS_PASSWORD'], roles: [:bot]))\n end",
"... | [
"0.6284868",
"0.6267695",
"0.61706233",
"0.6033318",
"0.5920697",
"0.58470356",
"0.5756893",
"0.572007",
"0.5695258",
"0.56356",
"0.56274027",
"0.56031895",
"0.5600127",
"0.55996376",
"0.55996376",
"0.5595448",
"0.55478495",
"0.5536372",
"0.5516883",
"0.550165",
"0.5450055",
... | 0.5577167 | 16 |
This is called from after_save and after_destroy on Vote | def update_rating!
# not using count because lates some votes might be something other than +/- 1
self.positive_vote_count = votes.positive.sum(:value).abs
self.negative_vote_count = votes.negative.sum(:value).abs
self.rating = votes.sum(:value)
save!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def after_create\n election.vote_count = election.vote_count + 1\n election.save\n end",
"def destroy\n @vote.destroy\n end",
"def upvote\n self.votes += 1\n save\n end",
"def vote up\n end",
"def delete_the_votes\n ActsAsVotable::Vote.destroy_all\n end",
"def destroy_votes\n ... | [
"0.68086076",
"0.61320406",
"0.6057865",
"0.6057304",
"0.6036322",
"0.60020167",
"0.6001629",
"0.5999733",
"0.5992209",
"0.5977822",
"0.59424734",
"0.59114695",
"0.5909093",
"0.5909093",
"0.5833217",
"0.5833217",
"0.5833217",
"0.58330905",
"0.5821353",
"0.5820619",
"0.5803643... | 0.5383833 | 99 |
When a user creates a message, we assume they want to vote for the message | def create_initial_vote_for_author
votes.create(:user => user, :value => 1)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def showing_message\n #if self.user.find_by(User.find(session[:user_id]))\n errors.add(:base, 'A user can vote only once!')\n\n end",
"def create_answer_votes\n\t\tif @answer.vote_not_present?(current_user)\n vote = @answer.votes.new\n vote.user = current_user\n end\n if vote.save\n ... | [
"0.68532395",
"0.6710792",
"0.66420597",
"0.6641358",
"0.6641358",
"0.6634992",
"0.6610456",
"0.66048074",
"0.66032094",
"0.6566201",
"0.6562021",
"0.65577185",
"0.65501255",
"0.65422714",
"0.65222764",
"0.6475055",
"0.643948",
"0.643426",
"0.639422",
"0.6299182",
"0.6286582"... | 0.6260869 | 21 |
Return all tasks in JSON format | def tasks
@todos = Todo.all
render json: @todos
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n render json: {\n tasks: tasks.map(&:to_hash)\n }\n end",
"def tasks\n render json: [{id: 1, name: 'One'}, {id: 2, name: 'Two'}]\n end",
"def index\n @tasks = Task.all\n\n render json: @tasks\n end",
"def index\n @tasks = Task.all\n response = @tasks.map{|task| get_tas... | [
"0.8050764",
"0.78444844",
"0.7532935",
"0.7494509",
"0.7477617",
"0.73913294",
"0.7380798",
"0.735982",
"0.73434794",
"0.73421323",
"0.72526145",
"0.72464216",
"0.7169591",
"0.714067",
"0.714067",
"0.714067",
"0.7111531",
"0.7097425",
"0.70963293",
"0.70759565",
"0.7073603",... | 0.7565953 | 2 |
create a new task (accept data in JSON format) | def create
@todo = Todo.new(user_params)
if @todo.save
render json: @todo
else
render nothing: true, status: :bad_request
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def task_create(task, data=nil)\n if task_present? task\n task = task_get task\n elsif task.is_a? Deployment::Task\n task = task_add task\n else\n task = Deployment::Task.new task, node, data\n task = task_add task\n end\n task.data = data if data\n task\n ... | [
"0.7722445",
"0.7568813",
"0.7542255",
"0.75160605",
"0.7498798",
"0.7487802",
"0.74762636",
"0.74723834",
"0.74636483",
"0.7461022",
"0.7436506",
"0.74243003",
"0.73898363",
"0.7368383",
"0.7336086",
"0.7286394",
"0.7272036",
"0.7242413",
"0.7241469",
"0.72177464",
"0.718299... | 0.0 | -1 |
update an existing task | def update
@todo = Todo.find(params[:todo][:id])
if @todo.update_attributes(user_params)
render json: @todo
else
render nothing: true, status: :bad_request
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @task.update(task_params)\n end",
"def update \n\t logger.debug \"Params --------------------------------------- #{params}\"\n\n\t logger.debug \"task params --------------------------------------#{task_params}\"\n\t format_task_attributes(task_params)\n\t \n\t logger.debug \"--------------... | [
"0.846005",
"0.8338417",
"0.79906183",
"0.79562145",
"0.79524505",
"0.79340124",
"0.791393",
"0.78923744",
"0.78473294",
"0.7810406",
"0.77920544",
"0.7784867",
"0.7722477",
"0.7700279",
"0.7657357",
"0.764593",
"0.7592311",
"0.7550447",
"0.75388056",
"0.7497748",
"0.7487488"... | 0.0 | -1 |
delete an existing task | def destroy
@todo = Todo.find(params[:todo][:id])
if @todo.destroy
render json: {status: 200, message: "Task with id " + @todo.id.to_s + ': removed'}
else
render nothing: true, status: :bad_request
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_task id\n request :delete, \"tasks/#{id}\"\n nil\n end",
"def destroy\n find_task\n @task.destroy\n end",
"def delete(task)\n raise ArgumentError, \"Task expected, got #{task.class}.\" unless task.is_a?(Task)\n\n @tasks.delete_if { |t2| t2.to_s == task.to_s }\n end",... | [
"0.825596",
"0.81537515",
"0.80353016",
"0.79957724",
"0.7978364",
"0.7978364",
"0.7950645",
"0.78616077",
"0.78449583",
"0.78150934",
"0.7786264",
"0.77735525",
"0.7693395",
"0.76883155",
"0.76702994",
"0.76573753",
"0.7615928",
"0.7609044",
"0.7608291",
"0.7573615",
"0.7544... | 0.0 | -1 |
GET /prospectives/1 GET /prospectives/1.json | def show
@prospective = Prospective.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @prospective }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propose }\n end\n end",
"def show\n render json: @prossumer\n end",
"def show\n @proficiency = Proficiency.find(params[:id])\n\n respond_to do |fo... | [
"0.69295615",
"0.65686446",
"0.6461768",
"0.6416212",
"0.6401707",
"0.6356119",
"0.6342506",
"0.62999207",
"0.6281479",
"0.6269066",
"0.62535816",
"0.6250046",
"0.623554",
"0.62344486",
"0.6187102",
"0.61854064",
"0.61759305",
"0.6157451",
"0.6146485",
"0.61278033",
"0.612755... | 0.66239995 | 1 |
GET /prospectives/new GET /prospectives/new.json | def new
@prospective = Prospective.new
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @prospective }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @propose = Propose.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @propose }\n end\n end",
"def new\n @precinct = Precinct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @precinct }\n... | [
"0.7431826",
"0.72933596",
"0.7244358",
"0.7243972",
"0.71830875",
"0.7144136",
"0.714343",
"0.713225",
"0.70333993",
"0.70221204",
"0.70210457",
"0.7020027",
"0.70065826",
"0.6977229",
"0.69627225",
"0.6955841",
"0.69525445",
"0.69434226",
"0.69434226",
"0.69434226",
"0.6926... | 0.7180269 | 5 |
POST /prospectives POST /prospectives.json | def create
@prospective = Prospective.new(params[:prospective])
respond_to do |format|
if @prospective.save
format.html { redirect_to @prospective, :notice => 'Prospective was successfully created.' }
format.json { render :json => @prospective, :status => :created, :location => @prospecti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @prospect = current_user.prospects.new(prospect_params)\n\n respond_to do |format|\n if @prospect.save\n format.html { redirect_to @prospect, notice: 'Prospect was successfully created.' }\n format.json { render :show, status: :created, location: @prospect }\n else\n ... | [
"0.65618974",
"0.6549785",
"0.6501185",
"0.64891243",
"0.6316235",
"0.6160285",
"0.6067613",
"0.59307885",
"0.58422416",
"0.58026147",
"0.5674781",
"0.5663077",
"0.56578165",
"0.5646201",
"0.5635456",
"0.5595834",
"0.5591058",
"0.5580695",
"0.5570142",
"0.55680335",
"0.554275... | 0.581935 | 9 |
PUT /prospectives/1 PUT /prospectives/1.json | def update
@prospective = Prospective.find(params[:id])
respond_to do |format|
if @prospective.update_attributes(params[:prospective])
format.html { redirect_to @prospective, :notice => 'Prospective was successfully updated.' }
format.json { head :ok }
else
format.html { ren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @prospect.update(prospect_params)\n format.html { redirect_to @prospect, notice: 'Prospect was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @p... | [
"0.67753464",
"0.6761774",
"0.6742634",
"0.6732857",
"0.6625708",
"0.65972054",
"0.6567872",
"0.63838875",
"0.6324458",
"0.6281542",
"0.61883974",
"0.6166649",
"0.6162978",
"0.6162978",
"0.6162978",
"0.60674703",
"0.6012296",
"0.5997589",
"0.59715235",
"0.59475183",
"0.593988... | 0.6011597 | 17 |
DELETE /prospectives/1 DELETE /prospectives/1.json | def destroy
@prospective = Prospective.find(params[:id])
@prospective.destroy
respond_to do |format|
format.html { redirect_to prospectives_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @prospect.destroy\n respond_to do |format|\n format.html { redirect_to prospects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @prospect.destroy\n respond_to do |format|\n format.html { redirect_to prospects_url, notice: 'Prospect was successfu... | [
"0.7407406",
"0.7167777",
"0.7167777",
"0.7136883",
"0.71173644",
"0.7103871",
"0.7103337",
"0.70931655",
"0.7048003",
"0.7027579",
"0.6989285",
"0.6871649",
"0.68307847",
"0.67963463",
"0.6776666",
"0.6768239",
"0.6744292",
"0.6744292",
"0.67346126",
"0.6722385",
"0.6721204"... | 0.7033972 | 9 |
Get the status of an Order GET /api/v1/orders/status | def status
if params[:reference]
@orders = Order.where(["reference = ?", params[:reference]])
elsif params[:client_name]
@orders = Order.where(["client_name = ?", params[:client_name].downcase])
@orders = @orders.page(params[:page] || 1).per(params[:per_page] || 10)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def order_status(id)\n authenticated_post(\"order/status\", params: {order_id: id.to_i}).body\n end",
"def test_status\n assert_equal @order.status, order_status_codes(:ordered_paid_to_ship).name\n end",
"def order_status_list(opts = {})\n data, _status_code, _headers = order_status_list_with_... | [
"0.79711735",
"0.67970675",
"0.6781651",
"0.67751485",
"0.6745015",
"0.6694509",
"0.66724044",
"0.6667523",
"0.66486955",
"0.6645044",
"0.66145164",
"0.6603133",
"0.65870196",
"0.65845436",
"0.6554252",
"0.6536656",
"0.65355426",
"0.65082306",
"0.64892936",
"0.6485724",
"0.64... | 0.6878007 | 1 |
List the Orders of a Purchase Channel GET /api/v1/orders/pipeline | def pipeline
if params[:purchase_channel] && params[:status]
@orders = Order.where(["purchase_channel = ? AND status = ?", params[:purchase_channel].downcase, params[:status].downcase])
@orders = @orders.page(params[:page] || 1).per(params[:per_page] || 10)
render json: @orde... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end",
"def orders\n params = { command: 'account_orders' }\n get('/json.php', params)\n end",
"def get_orders\n return ShopifyAPI::Order.all\n end",
"def orders\n authenticated_post(\"auth/r... | [
"0.6563321",
"0.6274605",
"0.62178993",
"0.6055395",
"0.5974339",
"0.59488237",
"0.59483343",
"0.5920112",
"0.590686",
"0.59042144",
"0.58791226",
"0.58428234",
"0.58428234",
"0.58428234",
"0.58428234",
"0.58428234",
"0.58208245",
"0.5815061",
"0.57941306",
"0.5784925",
"0.57... | 0.6743987 | 0 |
A simple financial report GET /api/v1/orders/financialReport | def financialReport
result = []
channels = ActiveRecord::Base.connection.execute("select distinct purchase_channel from orders;")
channels.each do |channel|
orders_per_channel = Order.where(["purchase_channel = ?", channel['purchase_channel']])
sum_total_value = orders_pe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @financial_reports = @company.financial_reports.annual.recent.include_statements\n end",
"def financials_with_http_info(symbol, statement, freq, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.financials ...'\n end\n # ... | [
"0.67927414",
"0.67729425",
"0.6681451",
"0.66793567",
"0.66761893",
"0.6613873",
"0.64959794",
"0.6494007",
"0.6317872",
"0.6313477",
"0.63020015",
"0.62091076",
"0.6135329",
"0.6126528",
"0.6121586",
"0.60493535",
"0.6032174",
"0.60318",
"0.6014046",
"0.60125285",
"0.598086... | 0.6878583 | 0 |
Only allow a trusted parameter "white list" through. | def order_params
params.permit(:reference, :purchase_channel, :client_name, :address, :delivery_service, :total_value, :line_items)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
... | [
"0.71207976",
"0.705222",
"0.69488335",
"0.69021654",
"0.67362636",
"0.6717561",
"0.6689192",
"0.6678948",
"0.66622657",
"0.6555007",
"0.6527569",
"0.64588845",
"0.64522904",
"0.6450812",
"0.6448551",
"0.6434285",
"0.6412147",
"0.6412147",
"0.6393719",
"0.6381976",
"0.6381976... | 0.0 | -1 |
Remove this if you are only supporting portrait | def application(application, willChangeStatusBarOrientation: new_orientation, duration: duration)
# Manually set RMQ's orientation before the device is actually oriented
# So that we can do stuff like style views before the rotation begins
device.orientation = new_orientation
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def portrait?; end",
"def landscape?; end",
"def portrait?\n height > width\n end",
"def set_portrait\n @orientation = 1\n end",
"def shouldAutorotateToInterfaceOrientation interfaceOrientation\n # // Return YES for supported orientations.\n # //return interfaceOrientation == UIInterfaceO... | [
"0.8543852",
"0.7476303",
"0.725208",
"0.72307175",
"0.71094304",
"0.7055323",
"0.68509936",
"0.6612344",
"0.6565011",
"0.6536434",
"0.653378",
"0.62911654",
"0.62660617",
"0.62651664",
"0.62608093",
"0.62608093",
"0.6232547",
"0.6137738",
"0.6102896",
"0.60004246",
"0.584432... | 0.0 | -1 |
Setup a different method to determine the current user or admin logged in. This is run inside the controller instance and made available as a helper. By default, _request.env["warden"].user_ or _current_user_ will be used. | def current_user_method(&block)
@current_user = block if block
@current_user || DEFAULT_CURRENT_USER
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user\n @current_user = current_admin || current_user\n end",
"def current_user\n # super: don't change anything, i just want the exact same behavior \n # as in the method that we are overriding\n\n # what this line means is that if the user is logged in, super is true,\n ... | [
"0.7083513",
"0.70480037",
"0.68443924",
"0.67605245",
"0.6745754",
"0.67389107",
"0.67329913",
"0.6728709",
"0.66464365",
"0.6640609",
"0.66360897",
"0.66128397",
"0.6610974",
"0.6607662",
"0.660201",
"0.6599622",
"0.65741706",
"0.6571177",
"0.6571177",
"0.6562046",
"0.65487... | 0.62180847 | 96 |
def current_time Time.zone.now.in_time_zone("CET").strftime("%m %b %Y, %H:%M %a") end | def schedule_time(time)
time.in_time_zone('Moscow').strftime('%e %b %Y, %H:%M %a')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def curent_time\n Time.zone.now.strftime('%l:%M %p')\n end",
"def current_time\n Time.now.in_time_zone(\"Berlin\").to_date\n end",
"def current_time\n Time.now.strftime(\"%l:%M %p\")\n end",
"def current_time\n Time.now.strftime('%I:%M:%S %p')\n end",
"def get_current_time\n now ... | [
"0.875331",
"0.8329788",
"0.832411",
"0.8276734",
"0.82222277",
"0.8107708",
"0.7889118",
"0.7852446",
"0.7834227",
"0.7798996",
"0.77941173",
"0.77071077",
"0.7605216",
"0.7594192",
"0.7580317",
"0.753165",
"0.753165",
"0.74994886",
"0.74488765",
"0.7445762",
"0.7425908",
... | 0.70632404 | 57 |
State transition tables end reduce 0 omitted | def _reduce_1(val, _values, result)
self.lexer.lex_state = :expr_beg
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transitions; end",
"def closure! \n cstart = new_state\n cend = new_state\n\n add_transition(cstart, cend, \"\")\n add_transition(cend, cstart, \"\")\n\n add_transition(cstart, @start, \"\")\n @final.keys.each { |key| add_transition(key, cend, \"\")}\n\n set_start(cstart)\n... | [
"0.6405813",
"0.6066433",
"0.60406244",
"0.6008255",
"0.59485066",
"0.5936225",
"0.5936225",
"0.59112704",
"0.5890009",
"0.5869181",
"0.5869181",
"0.5781325",
"0.5780357",
"0.5712554",
"0.5698061",
"0.56579924",
"0.55741525",
"0.5503383",
"0.54930097",
"0.54810333",
"0.544074... | 0.0 | -1 |
reduce 4 omitted reduce 5 omitted | def _reduce_6(val, _values, result)
result = self.block_append val[0], val[2]
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_555(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_612(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_76(val, _values, result); end",
"def _reduce_76(val, _values, result); en... | [
"0.6742373",
"0.65648335",
"0.654707",
"0.654707",
"0.6541003",
"0.6525085",
"0.6525085",
"0.6521839",
"0.6508959",
"0.64965284",
"0.64932734",
"0.6476861",
"0.6471889",
"0.64710945",
"0.64710945",
"0.64671123",
"0.6461539",
"0.64605373",
"0.6456827",
"0.6451995",
"0.6449653"... | 0.0 | -1 |
reduce 7 omitted reduce 8 omitted | def _reduce_9(val, _values, result)
if (self.in_def || self.in_single > 0) then
yyerror "BEGIN in method"
end
self.env.extend
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_608(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_712(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_76(val, _values, result); end",
"def _reduce_76(val, _values, result); en... | [
"0.66837204",
"0.6590019",
"0.6586223",
"0.6586223",
"0.6548612",
"0.6548612",
"0.6495922",
"0.64880127",
"0.6474689",
"0.6474689",
"0.64545155",
"0.64492273",
"0.6447717",
"0.6439769",
"0.6436363",
"0.64181256",
"0.6414136",
"0.6405875",
"0.63854575",
"0.6379449",
"0.6374117... | 0.0 | -1 |
reduce 13 omitted reduce 14 omitted | def _reduce_15(val, _values, result)
result = self.block_append val[0], val[2]
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_13(val, _values, result); end",
"def _reduce_608(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_612(val, _values, result)\n ... | [
"0.71051943",
"0.66943073",
"0.66871536",
"0.666146",
"0.6659532",
"0.6659532",
"0.6639964",
"0.6634204",
"0.6625384",
"0.6612673",
"0.6612673",
"0.6604862",
"0.660372",
"0.660372",
"0.6600507",
"0.65962356",
"0.6593521",
"0.656864",
"0.656864",
"0.6563033",
"0.65618736",
"... | 0.0 | -1 |
reduce 51 omitted reduce 52 omitted reduce 53 omitted | def _reduce_54(val, _values, result)
result = new_call val[0], val[2].to_sym, val[3]
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_53(val, _values, result); end",
"def _reduce_53(val, _values, result); end",
"def _reduce_603(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_528(val, _values, result); end",
"def _reduce_528(val, _values, result); end",
"def _reduce... | [
"0.732568",
"0.732568",
"0.7272932",
"0.7253454",
"0.7253454",
"0.7249883",
"0.7249883",
"0.72351694",
"0.7222394",
"0.7209067",
"0.7205201",
"0.72016424",
"0.72016424",
"0.7189783",
"0.7189783",
"0.7188918",
"0.7187796",
"0.7178317",
"0.71751434",
"0.7168192",
"0.7156956",
... | 0.0 | -1 |
reduce 113 omitted reduce 114 omitted reduce 115 omitted | def _reduce_116(val, _values, result)
lexer.lex_state = :expr_end
result = val[0]
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_712(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_603(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_496(val, _values, result)\n result = nil\n ... | [
"0.71825397",
"0.71459824",
"0.71399105",
"0.71028167",
"0.7089302",
"0.7081099",
"0.70778596",
"0.70778596",
"0.7054926",
"0.70519644",
"0.70321715",
"0.702919",
"0.7027227",
"0.699238",
"0.69842535",
"0.69759667",
"0.6972183",
"0.6953069",
"0.694594",
"0.69456875",
"0.69396... | 0.0 | -1 |
reduce 118 omitted reduce 119 omitted | def _reduce_120(val, _values, result)
result = s(:lit, val[0].to_sym)
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_603(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_712(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_608(val, _values, result)\n result = nil\n ... | [
"0.7533375",
"0.75092214",
"0.7501045",
"0.75004625",
"0.7469827",
"0.7463333",
"0.7442663",
"0.7432673",
"0.74326605",
"0.7431104",
"0.7431104",
"0.74256355",
"0.7419391",
"0.7419391",
"0.73965085",
"0.7385927",
"0.73742676",
"0.7362189",
"0.736214",
"0.7361346",
"0.7359733"... | 0.0 | -1 |
reduce 125 omitted reduce 126 omitted reduce 127 omitted reduce 128 omitted reduce 129 omitted reduce 130 omitted reduce 131 omitted reduce 132 omitted reduce 133 omitted reduce 134 omitted reduce 135 omitted reduce 136 omitted reduce 137 omitted reduce 138 omitted reduce 139 omitted reduce 140 omitted reduce 141 omitt... | def _reduce_195(val, _values, result)
result = self.node_assign val[0], val[2]
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_596(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_596(val, _values, result)\n yyerrok\n\n result\nend",
"def _r... | [
"0.65904015",
"0.656489",
"0.64915484",
"0.64688724",
"0.6463361",
"0.6441237",
"0.64360166",
"0.63988274",
"0.63988274",
"0.63734335",
"0.6349865",
"0.6344875",
"0.6326494",
"0.63179976",
"0.63076824",
"0.62985396",
"0.62965494",
"0.62965494",
"0.6285425",
"0.62585664",
"0.6... | 0.0 | -1 |
reduce 246 omitted reduce 247 omitted | def _reduce_248(val, _values, result)
result = val[0]
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_608(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_263(val, _values, result); end",
"def _reduce_263(val, _values, result); end",... | [
"0.7105621",
"0.70648277",
"0.7061862",
"0.7061862",
"0.70454246",
"0.70432085",
"0.7039957",
"0.7039957",
"0.7038627",
"0.7038627",
"0.70244807",
"0.70174265",
"0.69270563",
"0.6917704",
"0.6917704",
"0.6916984",
"0.68907064",
"0.68907064",
"0.6888267",
"0.6880522",
"0.68787... | 0.0 | -1 |
reduce 270 omitted reduce 271 omitted reduce 272 omitted reduce 273 omitted reduce 274 omitted reduce 275 omitted reduce 276 omitted reduce 277 omitted | def _reduce_278(val, _values, result)
result = new_call nil, val[0].to_sym
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_608(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_496(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_608(val, _values, result)\n yyerrok\n ... | [
"0.69234747",
"0.6879158",
"0.68536663",
"0.68433553",
"0.6829806",
"0.67998517",
"0.67939925",
"0.67939925",
"0.6780215",
"0.6777696",
"0.6764554",
"0.6764554",
"0.67615116",
"0.6756582",
"0.6739291",
"0.6739291",
"0.6736641",
"0.6716005",
"0.670091",
"0.6684469",
"0.6684248... | 0.0 | -1 |
reduce 332 omitted reduce 333 omitted reduce 334 omitted reduce 335 omitted reduce 336 omitted reduce 337 omitted reduce 338 omitted reduce 339 omitted reduce 340 omitted reduce 341 omitted reduce 342 omitted reduce 343 omitted reduce 344 omitted reduce 345 omitted reduce 346 omitted reduce 347 omitted reduce 348 omitt... | def _reduce_349(val, _values, result)
result = s(:if, val[1], val[3], val[4])
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_608(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_596(val, _values, result)\n yyerrok\n \n ... | [
"0.72046906",
"0.7194836",
"0.7189244",
"0.7173194",
"0.71719515",
"0.71574193",
"0.71559465",
"0.714328",
"0.7137825",
"0.7121614",
"0.71120924",
"0.71104103",
"0.7107208",
"0.7075216",
"0.7068912",
"0.70686984",
"0.70678955",
"0.70629716",
"0.7052429",
"0.7047688",
"0.70393... | 0.0 | -1 |
reduce 382 omitted reduce 383 omitted | def _reduce_384(val, _values, result)
result = args val
result = 0 if result == s(:args)
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_603(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_263(val, _values, result); end",
"def _reduce_263(val, _values, result); end",... | [
"0.7549085",
"0.7492645",
"0.74771494",
"0.74771494",
"0.74735606",
"0.74690366",
"0.7458376",
"0.7428298",
"0.742011",
"0.74172705",
"0.74159026",
"0.74159026",
"0.73996145",
"0.73991394",
"0.73873687",
"0.7376045",
"0.73759866",
"0.7365444",
"0.7361063",
"0.73543084",
"0.73... | 0.0 | -1 |
reduce 423 omitted reduce 424 omitted | def _reduce_425(val, _values, result)
_, klasses, var, _, body, rest = val
klasses ||= s(:array)
klasses << node_assign(var, s(:gvar, :"$!")) if var
result = new_resbody(klasses, body)
result << rest if rest ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_464(val, _values, result); end",
"def _reduce_496(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_605(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_603(val, _values, resul... | [
"0.74395657",
"0.7427486",
"0.7425364",
"0.7423187",
"0.73986953",
"0.73905987",
"0.7368707",
"0.7367",
"0.7356262",
"0.7353822",
"0.7353822",
"0.7340635",
"0.7340635",
"0.7334769",
"0.7331453",
"0.7331453",
"0.7324182",
"0.7313852",
"0.7313327",
"0.73104155",
"0.729942",
"... | 0.0 | -1 |
reduce 428 omitted reduce 429 omitted | def _reduce_430(val, _values, result)
result = val[1]
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_599(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_498(val, _values, result)\n result = nil\n\n result\nend",
"def _reduce_476(val, _values, result); end",
"def _reduce_528(val, _values, result); end",
"def _reduce_... | [
"0.72794974",
"0.7180759",
"0.715993",
"0.7137513",
"0.7137513",
"0.70795727",
"0.7041806",
"0.70415074",
"0.7033475",
"0.7033475",
"0.7024692",
"0.69850475",
"0.69850475",
"0.6976235",
"0.6964206",
"0.6964206",
"0.69523305",
"0.6945641",
"0.69296527",
"0.6921543",
"0.6919967... | 0.0 | -1 |
reduce 471 omitted reduce 472 omitted reduce 473 omitted reduce 474 omitted | def _reduce_475(val, _values, result)
lexer.lex_state = :expr_end
result = val[1]
result ||= s(:str, "")
case result[0]
when :dstr then
result[0] = :dsym
when :st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_496(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_712(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_608(val, _values, result)\n result = nil\n ... | [
"0.7305685",
"0.7291753",
"0.727185",
"0.7256294",
"0.7229698",
"0.72275364",
"0.7164301",
"0.7164301",
"0.7147817",
"0.7147817",
"0.7138128",
"0.71366864",
"0.71336395",
"0.711345",
"0.7112745",
"0.71042013",
"0.70980865",
"0.70949143",
"0.70944005",
"0.7083761",
"0.7082064"... | 0.0 | -1 |
reduce 476 omitted reduce 477 omitted | def _reduce_478(val, _values, result)
result = -val[1] # TODO: pt_testcase
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_496(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_527(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_608(val, _values, result)\n result = nil\n ... | [
"0.75777876",
"0.7544213",
"0.7534901",
"0.7528574",
"0.75193626",
"0.7494828",
"0.74469954",
"0.7437716",
"0.7437716",
"0.7435916",
"0.74246126",
"0.7424271",
"0.7424271",
"0.7423144",
"0.7422177",
"0.7419648",
"0.74159795",
"0.74159795",
"0.7401823",
"0.7401823",
"0.7401254... | 0.0 | -1 |
reduce 480 omitted reduce 481 omitted reduce 482 omitted reduce 483 omitted reduce 484 omitted | def _reduce_485(val, _values, result)
result = s(:nil)
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_608(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_496(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_527(val, _values, result)\n result = nil\n ... | [
"0.73158604",
"0.72883624",
"0.7262044",
"0.7228162",
"0.7201088",
"0.7174327",
"0.7160705",
"0.7135595",
"0.7132155",
"0.7117656",
"0.7117656",
"0.7116211",
"0.7115996",
"0.71138424",
"0.7109929",
"0.7107085",
"0.7107085",
"0.7098821",
"0.70983",
"0.70925695",
"0.70925695",
... | 0.0 | -1 |
reduce 535 omitted reduce 536 omitted | def _reduce_537(val, _values, result)
# TODO: differs from parse.y - needs tests
name = val[1].to_sym
self.assignable name
result = :"*#{name}"
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_608(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_496(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_527(val, _values, result)\n result = nil\n ... | [
"0.73110145",
"0.73064643",
"0.729236",
"0.7286325",
"0.727155",
"0.725784",
"0.7252664",
"0.7248543",
"0.72484213",
"0.72432756",
"0.72353584",
"0.7233372",
"0.7233372",
"0.7227072",
"0.72196937",
"0.7218696",
"0.72060937",
"0.7192466",
"0.7192466",
"0.71883047",
"0.7184619"... | 0.0 | -1 |
reduce 539 omitted reduce 540 omitted | def _reduce_541(val, _values, result)
identifier = val[1].to_sym
self.env[identifier] = :lvar
result = "&#{identifier}".to_sym
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_600(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_600(val, _values, result)\n yyerrok\n \n ... | [
"0.7396396",
"0.737134",
"0.7364044",
"0.73345536",
"0.7299169",
"0.72801554",
"0.7271815",
"0.72606826",
"0.72557366",
"0.7248027",
"0.7248027",
"0.7233033",
"0.7233033",
"0.7211184",
"0.7209541",
"0.7207891",
"0.72045034",
"0.7194998",
"0.7188296",
"0.7187496",
"0.7187092",... | 0.0 | -1 |
reduce 553 omitted reduce 554 omitted reduce 555 omitted reduce 556 omitted reduce 557 omitted reduce 558 omitted reduce 559 omitted reduce 560 omitted reduce 561 omitted reduce 562 omitted reduce 563 omitted reduce 564 omitted reduce 565 omitted reduce 566 omitted reduce 567 omitted reduce 568 omitted reduce 569 omitt... | def _reduce_574(val, _values, result)
yyerrok
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_608(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_527(val, _values, result)\n result = nil\n ... | [
"0.72759986",
"0.7268454",
"0.722888",
"0.7221808",
"0.7211086",
"0.71987885",
"0.7196699",
"0.71945935",
"0.7184595",
"0.7182387",
"0.7165846",
"0.7154785",
"0.71519125",
"0.71484756",
"0.71436286",
"0.7128956",
"0.7113669",
"0.7089579",
"0.70880705",
"0.70671785",
"0.706585... | 0.0 | -1 |
reduce 575 omitted reduce 576 omitted | def _reduce_577(val, _values, result)
yyerrok
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reduce_600(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_576(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend",
"def _reduce_576(val, _values, result)\n ... | [
"0.71347106",
"0.7113259",
"0.7113259",
"0.71103215",
"0.71069336",
"0.7047718",
"0.70343995",
"0.7024808",
"0.69957554",
"0.69957554",
"0.6947051",
"0.6890144",
"0.6881705",
"0.6881216",
"0.6845281",
"0.6845281",
"0.68302125",
"0.6826452",
"0.68260163",
"0.6822126",
"0.68144... | 0.0 | -1 |
A helper to shutdown a Log Courier server | def shutdown_server(which = nil)
which = if which.nil?
@servers.keys
else
[which]
end
which.each do |id|
@server_threads[id].raise LogCourier::ShutdownSignal
@server_threads[id].join
@server_threads.delete id
@server_counts.delete id
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shutdown\n request('shutdown')\n end",
"def shutdown!; end",
"def shutdown!; end",
"def shutdown!; end",
"def shutdown\n @server.shutdown\n end",
"def shutdown\n @server_active = false\n end",
"def shutdown!\n shutdown\n end",
"def shutdown; end",
"def shutdown; ... | [
"0.7505575",
"0.73987937",
"0.73987937",
"0.73987937",
"0.73428744",
"0.7311867",
"0.7255391",
"0.72364414",
"0.72364414",
"0.72364414",
"0.72364414",
"0.72364414",
"0.72364414",
"0.72364414",
"0.7164088",
"0.70998645",
"0.70998645",
"0.70998645",
"0.70998645",
"0.70645547",
... | 0.6837042 | 31 |
A helper to get the port a server is bound to | def server_port(id = '__default__')
@servers[id].port
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def obtain_port\n server = TCPServer.new(\"127.0.0.1\", 0)\n port = server.addr[1]\n server.close\n port\n end",
"def port\n raise \"Http-server not spawned yet. Call Hayabusa#start to spawn it.\" if !@httpserv\n return @httpserv.server.addr[1]\n end",
"def port\n connect_address.ip_... | [
"0.8100157",
"0.80549014",
"0.79219216",
"0.7920988",
"0.7745259",
"0.7690854",
"0.7690511",
"0.76466596",
"0.76050276",
"0.75703174",
"0.75703174",
"0.75053257",
"0.7504128",
"0.7480877",
"0.7451407",
"0.7446089",
"0.7438557",
"0.74357134",
"0.7433384",
"0.7391933",
"0.73824... | 0.8012593 | 2 |
A helper to get number of events received on the server | def server_count(id = '__default__')
@server_counts[id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def length\n\t\trequest = Packet.create_request('stdapi_sys_eventlog_numrecords')\n\n\t\trequest.add_tlv(TLV_TYPE_EVENT_HANDLE, self.handle);\n\n\t\tresponse = client.send_request(request)\n\n\t\treturn response.get_tlv_value(TLV_TYPE_EVENT_NUMRECORDS)\n\tend",
"def number_of_events\n self.events.length\n en... | [
"0.7658427",
"0.73439837",
"0.73098075",
"0.73001814",
"0.71185726",
"0.69498026",
"0.6940319",
"0.6912197",
"0.6903751",
"0.68937784",
"0.6788631",
"0.6773297",
"0.6748163",
"0.67066413",
"0.6638674",
"0.66114265",
"0.66078717",
"0.6607766",
"0.6595871",
"0.65812236",
"0.657... | 0.0 | -1 |
GET /documentocategorias GET /documentocategorias.xml | def index
@documentocategorias = Documentocategoria.nombre_like(params[:search]).paginate(:page => params[:page])
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @documentocategorias }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @documentocategoria = Documentocategoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @documentocategoria }\n end\n end",
"def new\n @documentocategoria = Documentocategoria.new\n\n respond_to do |format|\n for... | [
"0.7320398",
"0.6863245",
"0.66295815",
"0.6589802",
"0.6230192",
"0.6230192",
"0.62118185",
"0.61812466",
"0.6147123",
"0.61464816",
"0.6138108",
"0.61315054",
"0.6097211",
"0.60898393",
"0.607697",
"0.6075903",
"0.6057686",
"0.60435915",
"0.6027111",
"0.5995884",
"0.5973006... | 0.6767802 | 2 |
GET /documentocategorias/1 GET /documentocategorias/1.xml | def show
@documentocategoria = Documentocategoria.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @documentocategoria }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @documentocategoria = Documentocategoria.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documentocategoria }\n end\n end",
"def index\n @documentocategorias = Documentocategoria.nombre_like(params[:search]).paginate(:page => params[:pa... | [
"0.6989386",
"0.67366064",
"0.6538706",
"0.6374015",
"0.6347163",
"0.6308596",
"0.6297666",
"0.6249346",
"0.62368965",
"0.6185679",
"0.61742795",
"0.61742795",
"0.6166962",
"0.61608475",
"0.61319965",
"0.61205524",
"0.6113725",
"0.6059113",
"0.6035927",
"0.6030984",
"0.599212... | 0.752869 | 0 |
GET /documentocategorias/new GET /documentocategorias/new.xml | def new
@documentocategoria = Documentocategoria.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @documentocategoria }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @documentocategoria = Documentocategoria.new(params[:documentocategoria])\n\n respond_to do |format|\n if @documentocategoria.save\n format.html { redirect_to(@documentocategoria, :notice => 'Documentocategoria was successfully created.') }\n format.xml { render :xml => @docu... | [
"0.7565868",
"0.71559507",
"0.7109809",
"0.7068819",
"0.70669335",
"0.69497067",
"0.6911372",
"0.6907605",
"0.6899098",
"0.684674",
"0.68030536",
"0.67935795",
"0.6790382",
"0.677962",
"0.6764843",
"0.6764843",
"0.6764843",
"0.6764843",
"0.6748405",
"0.674461",
"0.6688954",
... | 0.8077454 | 0 |
POST /documentocategorias POST /documentocategorias.xml | def create
@documentocategoria = Documentocategoria.new(params[:documentocategoria])
respond_to do |format|
if @documentocategoria.save
format.html { redirect_to(@documentocategoria, :notice => 'Documentocategoria was successfully created.') }
format.xml { render :xml => @documentocatego... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n flash[:notice] = t('item.saved', :item => t('document.document'))\n format.html { redirect_to admin_document_path(@document)}\n #format.xml { render :xml => @document, :status ... | [
"0.68756986",
"0.66641814",
"0.6171838",
"0.60893124",
"0.6017601",
"0.60017824",
"0.59893245",
"0.5987683",
"0.5975844",
"0.5940962",
"0.59121734",
"0.5911587",
"0.5905529",
"0.5904909",
"0.5888164",
"0.58675796",
"0.5857834",
"0.5826873",
"0.5810325",
"0.5796307",
"0.577414... | 0.74853873 | 0 |
PUT /documentocategorias/1 PUT /documentocategorias/1.xml | def update
@documentocategoria = Documentocategoria.find(params[:id])
respond_to do |format|
if @documentocategoria.update_attributes(params[:documentocategoria])
format.html { redirect_to(@documentocategoria, :notice => 'Documentocategoria was successfully updated.') }
format.xml { head... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n flash[:notice] = t('item.updated', :item => t('document.document'))\n format.html { redirect_to admin_document_path(@document) }\n format.xml { head ... | [
"0.67245173",
"0.6576134",
"0.63272864",
"0.627872",
"0.61964685",
"0.6103632",
"0.60881716",
"0.6016194",
"0.5981473",
"0.59665674",
"0.5892261",
"0.588364",
"0.58442444",
"0.58360994",
"0.5752963",
"0.57446307",
"0.5730119",
"0.5724563",
"0.5709614",
"0.5702716",
"0.5701837... | 0.74653995 | 0 |
DELETE /documentocategorias/1 DELETE /documentocategorias/1.xml | def destroy
@documentocategoria = Documentocategoria.find(params[:id])
@documentocategoria.destroy
respond_to do |format|
format.html { redirect_to(documentocategorias_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n respond_to do |format|\n if @category.documents.empty?\n @category.destroy\n format.html { redirect_to categories_url, notice: 'Категория была удалена.' }\n else\n logger.info 'else'\n format.html { redirect_to categories_url, :flash => {:error => 'Нельзя удал... | [
"0.68504363",
"0.68319887",
"0.68189263",
"0.68081325",
"0.68024683",
"0.67931753",
"0.6784632",
"0.6773847",
"0.67250884",
"0.67009026",
"0.66853386",
"0.6663437",
"0.66614085",
"0.6619843",
"0.6602749",
"0.656701",
"0.6565609",
"0.65602416",
"0.65497947",
"0.6474875",
"0.64... | 0.7916811 | 0 |
return our textilized 'body_html' field or 'html' field, depending on the 'to_html' field | def template_text
self.to_html ? self.body_html : self.body
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def body_as_html\n return '' if !body\n return body if content_type && content_type =~ %r{text/html}i\n\n body.text2html\n end",
"def html\n process_message_body if !@html\n @html\n end",
"def html_body\n self[:html_body]\n end",
"def cleaned_up_text_body(format = false)\n ... | [
"0.7592758",
"0.729759",
"0.7264608",
"0.705258",
"0.69876724",
"0.694391",
"0.6827307",
"0.6790776",
"0.67569107",
"0.67263156",
"0.66849375",
"0.66849375",
"0.66849375",
"0.6680267",
"0.6583983",
"0.654243",
"0.65219045",
"0.64980733",
"0.64333564",
"0.64258295",
"0.6424063... | 0.7355255 | 1 |
print out each name in a list with numbers, using puts | def roll_call_dwarves(array)
# .each_with_index(1) --> use 1-based enumerator (start index at 1)
# each.with_index method takes an optional parameter to offset the starting index
# each_with_index does the same thing, but has no optional starting index
array.each.with_index(1) do |name, index|
puts "#{index... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"#{item.capitalize}: #{quantity}\"\n\tend\nend",
"def print(names)\n names.each do |name|\n puts name\n end \nend",
"def print_list(list)\n list.each do |name, quantity|\n puts \"#{name} : #{quantity}\"\n end\nend",
"def pri... | [
"0.743198",
"0.7330324",
"0.7278116",
"0.7180092",
"0.70799905",
"0.7065282",
"0.6969901",
"0.69412583",
"0.69199413",
"0.68931246",
"0.68672574",
"0.68624437",
"0.68624437",
"0.68570924",
"0.68416095",
"0.68416095",
"0.68384093",
"0.68367255",
"0.68278193",
"0.6815951",
"0.6... | 0.0 | -1 |
Accept an array, capitalize each element and add an exclamation point at the end return value should be an array | def summon_captain_planet(calls)
calls.map do |call|
call.capitalize + "!"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cap_me(array)\n array.map! {|x| x.capitalize}\nend",
"def cap_me(arr)\n\tarr.map { |i| i.capitalize}\nend",
"def cap_me(arr)\n arr.map(&:downcase).map(&:capitalize)\nend",
"def capitalize_array(arr)\n arr.map {|name| name = name.capitalize}\nend",
"def transform(a)\n a.map(&:capitalize)\n \n en... | [
"0.85332584",
"0.8353075",
"0.81676465",
"0.7973972",
"0.79487526",
"0.794517",
"0.7922415",
"0.79186964",
"0.77513784",
"0.77285314",
"0.7716136",
"0.7699552",
"0.76983523",
"0.76626086",
"0.765576",
"0.765576",
"0.76552016",
"0.7653742",
"0.76390123",
"0.7618029",
"0.759482... | 0.0 | -1 |
Accept an array of calls Return true or false if any of the calls are longer than 4 characters | def long_planeteer_calls(calls)
calls.any? do |call|
call.length > 4
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def long_planeteer_calls(calls)\n calls.each do |word|\n if word.length > 4\n return true\n else\n return false\n end\n end\nend",
"def long_planeteer_calls(calls)\n calls.any? { |word| word.length > 4 }\nend",
"def long_planeteer_calls(calls)# code an argument here\n # Your code here\n ... | [
"0.84826475",
"0.82841766",
"0.8274931",
"0.82508135",
"0.8246749",
"0.8204572",
"0.82029766",
"0.8107197",
"0.80946434",
"0.80946434",
"0.8027119",
"0.8003289",
"0.7970144",
"0.7921418",
"0.78791434",
"0.78535587",
"0.7792185",
"0.77383626",
"0.7715582",
"0.76824224",
"0.766... | 0.8005672 | 11 |
Accept an array of strings Find and return the first string that is a type of cheese | def find_the_cheese(array)
# types of cheese
cheese_types = ["cheddar", "gouda", "camembert"]
array.find do |cheese| # find first item in the array
cheese_types.include?(cheese) # that exists in cheese types list
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_the_cheese(arr)\n # look through each string\n # return the first string that is a cheese with include?\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n arr.find do |type|\n cheese_types.include?(type)\n end \nend",
"def find_the_cheese(arr_of_str)\n ... | [
"0.85964113",
"0.83213407",
"0.8242253",
"0.81482106",
"0.81327635",
"0.8096641",
"0.7967416",
"0.7964201",
"0.7956595",
"0.7933263",
"0.79136515",
"0.788671",
"0.7852279",
"0.7851555",
"0.7849253",
"0.7831915",
"0.7738071",
"0.77214295",
"0.7707407",
"0.7703458",
"0.76788574... | 0.8183043 | 3 |
TODO_PROHEALTH move to an abstract level so it can be used anywhere | def file_field(form_datum, k, file_type)
file = form_datum.attachments.detect{ |a| a.section_field_id.to_s == k.to_s}
file_text = file_type == 'expirable_file' ? (file.try(:expiration_date) || '') : ''
unless file && file.file.url.include?('placeholder.jpg')
file ? (link_to file_text, file.fil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def implementation; end",
"def implementation; end",
"def internal; end",
"def abstract!; end",
"def abstract?; end",
"def custom; end",
"def custom; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def strategy; end",
"def who_we_are\... | [
"0.69884795",
"0.67867035",
"0.67867035",
"0.65922",
"0.65576506",
"0.6489417",
"0.64224106",
"0.64224106",
"0.6311831",
"0.6311831",
"0.6311831",
"0.6311831",
"0.61963826",
"0.6108043",
"0.6091024",
"0.6077074",
"0.59851646",
"0.59716696",
"0.59687275",
"0.59650856",
"0.5961... | 0.0 | -1 |
GET /user_account_registrations/validate/1 GET /user_account_registrations/validate/1.json | def show
@validation_result = UserAccountValidation.validate_account params[:id]
if @validation_result[:success] and APP_CONFIG["is_sandbox"]
#email slc operator about newly created user
begin
user = APP_LDAP_CLIENT.read_user_emailtoken(params[:id])
ApplicationMailer.notify_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate(params)\n post('v1/account/validate', params)\n end",
"def validate_email\n @user = User.find(params[:id])\n if @user.check_verification(params[:code])\n render :json => {:message => :validation_success }\n else\n render :json => {:message => :validation_failed}, :status =... | [
"0.67932886",
"0.6065631",
"0.5762915",
"0.57573915",
"0.57181245",
"0.5645732",
"0.55644315",
"0.55465025",
"0.55151004",
"0.549242",
"0.5457812",
"0.5446587",
"0.5441384",
"0.54252785",
"0.54060614",
"0.54000974",
"0.53929096",
"0.5387629",
"0.53746766",
"0.53678584",
"0.53... | 0.0 | -1 |
Public: Creates a new instance auth_token the authentication token to be used | def initialize(auth_token)
@auth_token = auth_token
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_auth_token\n token = AuthToken.new(user: self)\n token if token.save\n end",
"def auth_token\n AuthToken.new payload: { sub: user.id }\n end",
"def generate_authentication_token\n self.auth_token = User.new_token\n\t\t\tself.auth_expires_at = Time.now + 240.hours\n\tend",
"d... | [
"0.80411375",
"0.7731852",
"0.7640456",
"0.7568784",
"0.75484455",
"0.74195683",
"0.7350132",
"0.7309645",
"0.7285116",
"0.7266613",
"0.7259631",
"0.72565186",
"0.7256117",
"0.72371906",
"0.7232117",
"0.72305053",
"0.72249544",
"0.7223628",
"0.7222294",
"0.7182975",
"0.717579... | 0.7269741 | 11 |
Adds token to tree's children | def add_tree token
@tree_stack.last.children << NaryTree.new(token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_child(tag)\n @parent_node = @current_node\n @current_node = ParseTag.new(tag).tag\n @current_node.parent = @parent_node\n @parent_node.children.push @current_node\n # @current_node.depth = @parent_node.depth + 1\n end",
"def add_child(node_or_tags); end",
"def add_child(node_or_tags); e... | [
"0.6625926",
"0.65691406",
"0.65691406",
"0.65603876",
"0.6496855",
"0.63028777",
"0.62853485",
"0.62697536",
"0.62139875",
"0.61783266",
"0.6121588",
"0.5985809",
"0.5977817",
"0.5903271",
"0.58526295",
"0.5850968",
"0.58207303",
"0.57722145",
"0.576451",
"0.5763807",
"0.575... | 0.78219974 | 0 |
Called on left paren | def push_tree
new_node = NaryTree.new nil
@tree_stack.last.children << new_node
@tree_stack.push new_node
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def left\n visit(input.left)\n end",
"def DISABLED_test_left_parenthesis_token\n assert_tokenises_as '(', LeftParenthesisToken.instance\n assert_tokenises_as ' (', LeftParenthesisToken.instance\n assert_tokenises_as ' ( ', LeftParenthesisToken.instance\n end",
"def skip_pa... | [
"0.68972373",
"0.6837442",
"0.6807886",
"0.6725307",
"0.6725307",
"0.6725307",
"0.6689718",
"0.6689718",
"0.6689718",
"0.668056",
"0.6663491",
"0.66576636",
"0.66576636",
"0.6633377",
"0.66150635",
"0.66150635",
"0.6506665",
"0.64854705",
"0.6464332",
"0.6448903",
"0.6332388"... | 0.0 | -1 |
Called on right paren | def pop_tree
@tree_stack.pop
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def paren_nest; end",
"def paren_nest; end",
"def paren_nest; end",
"def rparen!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n\n type = RPAREN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # ... | [
"0.7278815",
"0.7278815",
"0.7278815",
"0.6721523",
"0.66726315",
"0.666661",
"0.66654277",
"0.66242564",
"0.6566933",
"0.6503676",
"0.6425757",
"0.6424671",
"0.6365999",
"0.6356979",
"0.63517773",
"0.63501775",
"0.63121784",
"0.628312",
"0.62158006",
"0.61887175",
"0.6121309... | 0.0 | -1 |
=> STILL HAVE AMBIGUITY BETWEEN STMT AND OPER | def push_to_stack transition, token
transition.options[transit(transition, token)].reverse.each do |thing|
@stack.push thing
end
if @stack.last.token?
# We just read in the first token. Get rid of it from the stack
@stack.pop
else
# We just read in the first token of some other t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def statement; end",
"def op; end",
"def operation; end",
"def next_statement; end",
"def operations; end",
"def operations; end",
"def statement=(_arg0); end",
"def execute!; end",
"def execute; end",
"def execute; end",
"def cops; end",
"def cops; end",
"def cops; end",
"def boring_parr... | [
"0.6309155",
"0.6173761",
"0.59773",
"0.5921395",
"0.588869",
"0.588869",
"0.5849683",
"0.5843865",
"0.57729876",
"0.57729876",
"0.57574636",
"0.57574636",
"0.57574636",
"0.5745242",
"0.5725506",
"0.5725506",
"0.5584909",
"0.5520202",
"0.5518695",
"0.5473404",
"0.5471854",
... | 0.0 | -1 |
Confirms a loggedin user. | def logged_in
unless logged_in?
redirect_to root_url, flash: {danger: '请登陆'}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def correct_user\n @user = User.find(params[:id])\n if !current_user?(@user)\n message = \"currently logged in as #{current_user.name}. Not you? \"\n message += \"#{view_context.link_to('Log out.', log_out)}\".html_safe\n flash[:warning] = message\n redirect_to(root_url)\n ... | [
"0.70087826",
"0.6982988",
"0.6919373",
"0.688131",
"0.6845446",
"0.68326277",
"0.67944413",
"0.67929715",
"0.6642435",
"0.6624581",
"0.66114175",
"0.66022736",
"0.6589018",
"0.65539706",
"0.65349805",
"0.65303934",
"0.6512816",
"0.650312",
"0.64878744",
"0.6487622",
"0.64804... | 0.0 | -1 |
Confirms the correct user. | def correct_user
@user = User.find(params[:id])
unless current_user?(@user)
redirect_to root_url, flash: {:warning => '此操作需要管理员身份'}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def correct_user\n msg = \"You do not have permission to update another user's information\"\n require_correct_user(@user, msg)\n end",
"def correct_user\n\t\t\tauthenticate_user!\n\t\t\tunless @user == current_user || current_user.admin?\n\t\t\t\tredirect_to (root_path)\n\t\t\t\tflash[:alert]\n... | [
"0.7474727",
"0.73414856",
"0.73176336",
"0.7183247",
"0.71750194",
"0.705034",
"0.7012752",
"0.7011754",
"0.7006919",
"0.70057875",
"0.70035315",
"0.6966616",
"0.6913424",
"0.6911236",
"0.69037426",
"0.68929136",
"0.6844362",
"0.6843171",
"0.68401915",
"0.68352634",
"0.68265... | 0.0 | -1 |
GET /enregistrements/1 GET /enregistrements/1.json | def show
@enregistrement = Enregistrement.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @enregistrement }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @registrations = Registration.all\n \n render json: @registrations\n end",
"def new\n @enregistrement = Enregistrement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @enregistrement }\n end\n end",
"def index\n @registri... | [
"0.6922082",
"0.69142187",
"0.686624",
"0.669881",
"0.6693717",
"0.65750426",
"0.6562668",
"0.65520537",
"0.6464821",
"0.62874734",
"0.62874734",
"0.62874734",
"0.62874734",
"0.62874734",
"0.6267971",
"0.62654346",
"0.6228477",
"0.62207043",
"0.62104106",
"0.620445",
"0.62044... | 0.7178196 | 0 |
GET /enregistrements/new GET /enregistrements/new.json | def new
@enregistrement = Enregistrement.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @enregistrement }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @requerimiento = Requerimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requerimiento }\n end\n end",
"def new\n @sitio_entrega = SitioEntrega.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json {... | [
"0.750104",
"0.74675703",
"0.7334406",
"0.7306185",
"0.72779566",
"0.726825",
"0.7237688",
"0.7203422",
"0.7199447",
"0.71952045",
"0.71642804",
"0.7151381",
"0.7145528",
"0.7131787",
"0.7122875",
"0.71185064",
"0.7112205",
"0.71111405",
"0.71034473",
"0.7099462",
"0.70981634... | 0.81235856 | 0 |
POST /enregistrements POST /enregistrements.json | def create
@enregistrement = Enregistrement.new(params[:enregistrement])
respond_to do |format|
if @enregistrement.save
format.html { redirect_to @enregistrement, notice: 'Enregistrement was successfully created.' }
format.json { render json: @enregistrement, status: :created, location: @... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @registrer = Registrer.new(registrer_params)\n\n respond_to do |format|\n if @registrer.save\n format.html { redirect_to @registrer, notice: 'Registrer was successfully created.' }\n format.json { render :show, status: :created, location: @registrer }\n else\n form... | [
"0.6457338",
"0.6275237",
"0.6120344",
"0.611402",
"0.6084384",
"0.60619533",
"0.6049432",
"0.6045876",
"0.60273266",
"0.6015849",
"0.6014664",
"0.60085917",
"0.60048854",
"0.59972614",
"0.59835565",
"0.5970706",
"0.59532857",
"0.5946419",
"0.59393877",
"0.5933755",
"0.590977... | 0.70962346 | 0 |
PUT /enregistrements/1 PUT /enregistrements/1.json | def update
@enregistrement = Enregistrement.find(params[:id])
respond_to do |format|
if @enregistrement.update_attributes(params[:enregistrement])
format.html { redirect_to @enregistrement, notice: 'Enregistrement was successfully updated.' }
format.json { head :no_content }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\r\n respond_to do |format|\r\n if @comite_registro.update(comite_registro_params)\r\n format.html { redirect_to @comite_registro, notice: 'Su petición para registrar su comité tutorial fue actualizada.' }\r\n format.json { render :show, status: :ok, location: @comite_registro }\r\n... | [
"0.6189508",
"0.60774595",
"0.6067003",
"0.5957674",
"0.59487194",
"0.59451765",
"0.59325266",
"0.5904715",
"0.5881157",
"0.58801275",
"0.5867124",
"0.5851682",
"0.58329135",
"0.5827326",
"0.5821038",
"0.58159983",
"0.58006954",
"0.57829565",
"0.57726735",
"0.57553124",
"0.57... | 0.6480627 | 0 |
DELETE /enregistrements/1 DELETE /enregistrements/1.json | def destroy
@enregistrement = Enregistrement.find(params[:id])
@enregistrement.destroy
respond_to do |format|
format.html { redirect_to enregistrements_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @reg.destroy\n respond_to do |format|\n format.html { redirect_to regs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @registo.... | [
"0.71121943",
"0.7094278",
"0.7059077",
"0.7015785",
"0.7010872",
"0.6998139",
"0.6984569",
"0.69840854",
"0.6966029",
"0.6939681",
"0.6938319",
"0.69282824",
"0.6922018",
"0.69107115",
"0.6902668",
"0.6886355",
"0.68852544",
"0.6870062",
"0.6867726",
"0.68627506",
"0.6852460... | 0.7637768 | 0 |
Perform verification via unparser cli | def verify
checkout
start = Time.now
total = Parallel.map(Pathname.glob(repo_path.join('**/*.rb')).sort_by(&:size).reverse, finish: method(:progress)) do |path|
count = 0
node =
begin
Parser::CurrentRuby.parse(path.read)
rescue EncodingError, ArgumentErr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify\n checkout\n command = %W(unparser #{repo_path})\n exclude.each do |name|\n command.concat(%W(--ignore #{repo_path.join(name)}))\n end\n system(command) do\n raise \"Verifing #{name} failed!\"\n end\n self\n end",
"def verify!(executable, *args, &blo... | [
"0.6443046",
"0.63544524",
"0.6319535",
"0.6220943",
"0.61274284",
"0.61260104",
"0.6076731",
"0.6073477",
"0.60604495",
"0.60511893",
"0.60473204",
"0.60441095",
"0.5999457",
"0.59803545",
"0.59629005",
"0.59490615",
"0.5919896",
"0.5919896",
"0.5919741",
"0.5892464",
"0.578... | 0.0 | -1 |
Helper method to execute system commands | def system(arguments)
unless Kernel.system(*arguments)
if block_given?
yield
else
raise 'System command failed!'
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def system(cmd, *rest) end",
"def sys cmd\n puts cmd\n system cmd\n raise \"Running '#{cmd}' failed\" if $? != 0\nend",
"def system(cmd,*params)\n\t\tself.log \"VantagePoint::system: running \\\"#{cmd} #{params.join(\" \")}\\\"\"\n\t\treturn Kernel::system(cmd,*params)\n\tend",
"def execute(command)... | [
"0.80979276",
"0.7756067",
"0.7744158",
"0.7704394",
"0.75357366",
"0.75357366",
"0.75103647",
"0.74226356",
"0.73962784",
"0.73887753",
"0.73882437",
"0.73026645",
"0.7297921",
"0.7282579",
"0.724783",
"0.72438353",
"0.721948",
"0.72147536",
"0.7211879",
"0.7177687",
"0.7173... | 0.7047007 | 27 |
Generic profile Given a panelName and the panelInfoName, it reads the table for a generic info section | def viewInfoPanel(panelName, panelInfoName = nil)
panel = @explicitWait.until{@driver.find_element(:class, panelName)}
name = panel.find_element(:css, "h1")
hTable = Hash.new
hTable["Name"] = name.text
puts name.text
if (panelInfoName != nil)
infoPanel = panel.find_element(:class, panelInfoName)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_profile\n if GeneralInfo.exists?(:userKey => params[:id])\n @general_info = GeneralInfo.find_by(userKey: params[:id])\n @general_info_attributes = GeneralInfo.attribute_names\n @general_info_values = @general_info.attribute_values\n \n case @general_info.specific_profile_id\n ... | [
"0.5586735",
"0.5293267",
"0.52569985",
"0.51806366",
"0.5147073",
"0.5147073",
"0.5147073",
"0.5147073",
"0.5147073",
"0.5147073",
"0.51096433",
"0.5096663",
"0.5096663",
"0.5054534",
"0.50529784",
"0.5035583",
"0.49395463",
"0.49118453",
"0.49114203",
"0.49053246",
"0.48586... | 0.6041762 | 0 |
Let's add a new Teddit feature. Upvotes! Complete the application below. Where you see comments (lines that begin with ) replace it with code so that the program works. | def get_input
story = gets.chomp
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test04_L1DLT04_TC_24418\n\t\t#skipping for now, currently unable to interact with the \"Tweet\" button\n\tend",
"def test05_contributor_post\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_pre_closed_article_new)\n\t\t\n#\t\t$post_activate_note.when_present.fire_event(\"onclick\")... | [
"0.60508925",
"0.5770122",
"0.57376844",
"0.573558",
"0.57099885",
"0.5678443",
"0.56045127",
"0.5592867",
"0.5581361",
"0.5550919",
"0.5531194",
"0.5523288",
"0.55202615",
"0.54782796",
"0.5472406",
"0.5464669",
"0.54604405",
"0.5452839",
"0.54490274",
"0.5431286",
"0.542958... | 0.0 | -1 |
p cat_upvote?('cats') p cat_upvote?('dogs') | def bacon_upvote?(topic)
topic == "bacon"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def food_upvote?(topic)\n\ttopic == \"food\"\nend",
"def determine_upvotes(story, upvotes)\n if story.include?(\"cats\") || story.include?(\"Cats\")\n upvotes = upvotes * 5\n elsif story.include?(\"bacon\") || story.include?(\"Bacon\")\n upvotes = upvotes * 8\n elsif story.include?(\"food\") || story.in... | [
"0.73510754",
"0.6936527",
"0.68734",
"0.6629956",
"0.6454331",
"0.6426825",
"0.64136904",
"0.6382285",
"0.63624626",
"0.6307049",
"0.6210667",
"0.61561567",
"0.61265093",
"0.6116513",
"0.60812384",
"0.6043304",
"0.60250324",
"0.60198027",
"0.5988699",
"0.5988699",
"0.5988018... | 0.69268215 | 2 |
p bacon_upvote?('bruno mars') p bacon_upvote?('bacon') | def food_upvote?(topic)
topic == "food"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bacon_upvote?(topic)\n\ttopic == \"bacon\"\nend",
"def up_vote?\n value == 1\n end",
"def up_vote?\n\t\tvalue == 1\n\tend",
"def humanify_vote(vote)\n return \"for\" if vote == \"aye\"\n \"against\"\nend",
"def determine_upvotes(story, upvotes)\n if story.include?(\"cats\") || story.include?(\"C... | [
"0.76812667",
"0.69631976",
"0.67261475",
"0.661406",
"0.6585657",
"0.6562347",
"0.6356304",
"0.63471836",
"0.63319564",
"0.6247507",
"0.62288094",
"0.6227016",
"0.6172663",
"0.6147005",
"0.61422205",
"0.60793215",
"0.606632",
"0.6034726",
"0.603194",
"0.5995264",
"0.5991337"... | 0.7057335 | 1 |
Updates the rates by getting the information from Open Exchange Rates for today or a defined historical date The call gets cached for a maximum of 24 hours. | def update opts={}
time = helper.assure_time(opts[:at])
Call.new(api_url(time), :at => time, :api => self.class) do |result|
@base = result['base'].downcase.to_sym
@rates = extract_rates(result)
@timestamp = result['timesta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refresh_exchange_rates\n CurrencyConverter.cache_current_exchange_rates!\n end",
"def update_rates\n # clear all existing rates, even inferred ones\n store.each_rate do |iso_from, iso_to, _rate|\n add_rate(iso_from, iso_to, nil)\n end\n exchange_rates.each do |ticker|... | [
"0.75740695",
"0.7392107",
"0.73326725",
"0.72363013",
"0.71879816",
"0.7072931",
"0.6984444",
"0.69591516",
"0.69130427",
"0.6850598",
"0.6808367",
"0.6740248",
"0.6740248",
"0.6621831",
"0.66108066",
"0.6573509",
"0.6514214",
"0.64843154",
"0.64715797",
"0.64191484",
"0.636... | 0.56203634 | 79 |
Helper method to extract rates from the api call result | def extract_rates parsed
to_hash! parsed['rates'].keys.map{|k| k.downcase.to_sym }.zip(parsed['rates'].values.map{|v| BigDecimal.new(v.to_s) }).flatten
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def currency_rates\n response['rates'][currency.target_currency.to_s]\n end",
"def rates; end",
"def rates; end",
"def extract_rate(data)\n request_hash = JSON.parse(data)\n error = request_hash['error']\n raise JsonRatesRequestError, request_hash['error'] unless (error.nil? || error... | [
"0.76652133",
"0.73893094",
"0.73893094",
"0.7350274",
"0.71590996",
"0.7118261",
"0.68038076",
"0.6785118",
"0.6681882",
"0.66161644",
"0.65905213",
"0.657779",
"0.6527697",
"0.65235823",
"0.64820296",
"0.64491814",
"0.64089453",
"0.636474",
"0.63619524",
"0.6356781",
"0.635... | 0.7356817 | 3 |
A helper function to build an api url for either a specific time or the latest available rates | def api_url time=nil
today = Time.now
[
"#{config.protocol}:/",
API_URL,
time && (time.year != today.year || time.yday != today.yday) ? "historical/#{time.strftime("%Y-%m-%d")}.json" : "latest.json"
].join('/') + "?app_id=#{config.app_id}"
e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_url\n base_url + time_path + build_query(time_params)\n end",
"def build_url(options = {})\n o = {\n :type => :recent,\n :limit => 20,\n :offset => 0\n }.merge(options)\n\n unless [ :recent, :popular, :rating, :random ].include? o[:type]\n raise ArgumentError, \"unkno... | [
"0.6719101",
"0.65202606",
"0.6445709",
"0.63279176",
"0.62750906",
"0.61506087",
"0.61442417",
"0.60848504",
"0.600206",
"0.597388",
"0.59383965",
"0.5931073",
"0.5917379",
"0.58912504",
"0.5873409",
"0.5871071",
"0.585574",
"0.5842494",
"0.5816608",
"0.5813196",
"0.57900274... | 0.766076 | 0 |
Excerpted from "Programming Ruby", published by The Pragmatic Bookshelf. Copyrights apply to this code. It may not be used to create training material, courses, books, articles, and the like. Contact us if you are in doubt. We make no guarantees that this code is fit for any purpose. Visit for more book information. | def require_relative(relative_feature)
c = caller.first
fail "Can't parse #{c}" unless c.rindex(/:\d+(:in `.*')?$/)
file = $`
if /\A\((.*)\)/ =~ file # eval, etc.
raise LoadError, "require_relative is called in #{$1}"
end
absolute = File.expand_path(relative_feature, File.dirname(file))
require absolu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def herald; end",
"def jack_handey; end",
"def p15\n\t\nend",
"def how_it_works\r\n end",
"def king_richard_iii; end",
"def probers; end",
"def who_we_are\r\n end",
"def r; end",
"def r; end",
"def hello_world # \"def\" is short for \"defining a method\" and we are\n ... | [
"0.6627858",
"0.6486517",
"0.6201257",
"0.6183628",
"0.6166455",
"0.61479807",
"0.6118649",
"0.60830194",
"0.60830194",
"0.5992331",
"0.59859884",
"0.59859884",
"0.591986",
"0.587794",
"0.5867173",
"0.58240366",
"0.5821774",
"0.58110887",
"0.5793742",
"0.5791042",
"0.57886136... | 0.0 | -1 |
PassAll:getters and setters price | def price_as_string
return "$%.2f" % @price.to_f #PassAll:price_as_string
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def price\n \n end",
"def price\n @price\n end",
"def price\n @price\n end",
"def price=(new_price)\n\t\t@price = new_price\n\tend",
"def price\n \n end",
"def price\n raise 'Redefine this method in your billing model.'\n end",
"def price\n raise 'Redefine... | [
"0.8001364",
"0.78199697",
"0.78199697",
"0.762276",
"0.75884783",
"0.7423738",
"0.7423738",
"0.7416369",
"0.7410936",
"0.7326242",
"0.72906715",
"0.725504",
"0.72544885",
"0.723771",
"0.7213358",
"0.7213358",
"0.7213358",
"0.7213358",
"0.7213358",
"0.7213358",
"0.7213358",
... | 0.0 | -1 |
GET /port_models GET /port_models.json | def index
@port_models = PortModel.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def port_model_params\n params[:port_model]\n end",
"def find_bridge_models(params={}, headers=default_headers)\n @logger.info(\"Find Bridge models.\")\n get(\"#{@api_url}/models\", params, headers)\n end",
"def set_port_model\n @port_model = PortModel.find(params[:id])\n end",
"... | [
"0.65429556",
"0.6325273",
"0.62015694",
"0.5923805",
"0.590311",
"0.5879433",
"0.58342725",
"0.58099484",
"0.57794714",
"0.5729568",
"0.5717088",
"0.57130456",
"0.5707703",
"0.5635421",
"0.56332237",
"0.56326765",
"0.5628661",
"0.55705345",
"0.55701685",
"0.55386853",
"0.550... | 0.7232043 | 0 |
GET /port_models/1 GET /port_models/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @port_models = PortModel.all\n end",
"def set_port_model\n @port_model = PortModel.find(params[:id])\n end",
"def port_model_params\n params[:port_model]\n end",
"def model\r\n\t\t\t@model ||= json['model']\r\n\t\tend",
"def index\n @models = ClientService.all\n end",
... | [
"0.709416",
"0.6358119",
"0.63234353",
"0.6071833",
"0.5911569",
"0.58926344",
"0.58753854",
"0.58483344",
"0.5807972",
"0.57915974",
"0.57565916",
"0.5736907",
"0.5723037",
"0.57227623",
"0.57201403",
"0.5714206",
"0.56789047",
"0.56755686",
"0.55897677",
"0.55584717",
"0.55... | 0.0 | -1 |
POST /port_models POST /port_models.json | def create
@port_model = PortModel.new(port_model_params)
respond_to do |format|
if @port_model.save
format.html { redirect_to @port_model, notice: 'Port model was successfully created.' }
format.json { render action: 'show', status: :created, location: @port_model }
else
fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def port_model_params\n params[:port_model]\n end",
"def add_bridge_model(body={}, headers=default_headers)\n @logger.info(\"Adding the \\\"#{body['name']}\\\" Bridge Model and Mappings.\")\n post(\"#{@api_url}/models\", body, headers)\n end",
"def set_port_model\n @port_model = PortM... | [
"0.64914703",
"0.62845457",
"0.61007166",
"0.6055252",
"0.604767",
"0.59661734",
"0.58539605",
"0.5771692",
"0.5630974",
"0.5629781",
"0.5542336",
"0.5536033",
"0.5523011",
"0.5518042",
"0.5512828",
"0.5494842",
"0.5460106",
"0.54417545",
"0.5428659",
"0.53607446",
"0.5331676... | 0.698375 | 0 |
PATCH/PUT /port_models/1 PATCH/PUT /port_models/1.json | def update
respond_to do |format|
if @port_model.update(port_model_params)
format.html { redirect_to @port_model, notice: 'Port model was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @port_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch_model dataset_id, model_id, patched_model_gapi, etag = nil\n patch_with_backoff = false\n options = { skip_deserialization: true }\n if etag\n options[:header] = { \"If-Match\" => etag }\n # The patch with etag operation is considered idempotent\n ... | [
"0.62524974",
"0.62018716",
"0.6071487",
"0.6045801",
"0.59767187",
"0.5908577",
"0.5833271",
"0.58270544",
"0.5785112",
"0.575209",
"0.5717457",
"0.5717457",
"0.5717457",
"0.57109797",
"0.5710267",
"0.56974876",
"0.568807",
"0.56635064",
"0.5654738",
"0.56387526",
"0.5634976... | 0.68487567 | 0 |
DELETE /port_models/1 DELETE /port_models/1.json | def destroy
@port_model.destroy
respond_to do |format|
format.html { redirect_to port_models_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n f... | [
"0.6946484",
"0.6946484",
"0.6946484",
"0.69199276",
"0.6841535",
"0.682523",
"0.6813002",
"0.6805834",
"0.6788826",
"0.6762613",
"0.6745469",
"0.6696324",
"0.6681138",
"0.6681138",
"0.6660866",
"0.6638162",
"0.6630381",
"0.6613336",
"0.65843546",
"0.6578984",
"0.6572118",
... | 0.75645024 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_port_model
@port_model = PortModel.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6164095",
"0.6046031",
"0.5945298",
"0.59179014",
"0.58890367",
"0.58341795",
"0.5776118",
"0.5700777",
"0.5700777",
"0.5656277",
"0.56218207",
"0.5423995",
"0.5411516",
"0.5411516",
"0.5411516",
"0.5395004",
"0.53783494",
"0.53593004",
"0.53412604",
"0.534078",
"0.5332865... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def port_model_params
params[:port_model]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6979893",
"0.6781746",
"0.6746611",
"0.6742344",
"0.6735229",
"0.6592651",
"0.65027124",
"0.6498011",
"0.648163",
"0.647716",
"0.64556813",
"0.64386255",
"0.63784456",
"0.63756156",
"0.636574",
"0.6319542",
"0.63004524",
"0.6299559",
"0.62925464",
"0.62923217",
"0.6289894"... | 0.0 | -1 |
The directory of the application ./app for 'app' architecture ./apps/APPLICATION_NAME for 'container' | def application_path
if environment.container?
applications_path.join(application_name_as_snake_case)
else
Pathname.new('app')
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def app_dir\n File.join(home_dir, \"#{sanitized_app_name}.#{name}\")\n end",
"def app_dir\n @app_dir ||= Chef::Resource::Directory.new(deploy_dir, run_context)\n end",
"def app_name\n Dir.pwd.split(\"/\").last.gsub(/\\./, \"_\")\n end",
"def applications_path\n Pathna... | [
"0.78366727",
"0.747328",
"0.74703556",
"0.7435222",
"0.74322194",
"0.7400858",
"0.7227855",
"0.7202398",
"0.7189048",
"0.71437955",
"0.7089557",
"0.7089557",
"0.70510626",
"0.69820976",
"0.6908835",
"0.68968743",
"0.6872382",
"0.6872382",
"0.6802016",
"0.6794308",
"0.6768618... | 0.86598694 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.