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 |
|---|---|---|---|---|---|---|
The flash registry that holds the data for all the recent requests | def flash
@session[SESSION_KEY] || {}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def values\n @store[:__FLASH__] ||= {}\n end",
"def values\n @session[:olelo_flash] ||= {}\n end",
"def registry\n @registry ||= {}\n end",
"def values\n @session[:olelo_flash] ||= {}\n end",
"def data\n flash[@request_id] || {}\n end",
"def fla... | [
"0.6963469",
"0.60774535",
"0.60673153",
"0.60419756",
"0.6041259",
"0.59526247",
"0.5918683",
"0.58956224",
"0.58062303",
"0.5791231",
"0.574215",
"0.574215",
"0.5651993",
"0.56330067",
"0.5581652",
"0.5573823",
"0.5566482",
"0.55521053",
"0.5550624",
"0.5533324",
"0.5530345... | 0.54986936 | 25 |
The flash registry that holds the data only for the current request | def data
flash[@request_id] || {}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def values\n @store[:__FLASH__] ||= {}\n end",
"def values\n @session[:olelo_flash] ||= {}\n end",
"def values\n @session[:olelo_flash] ||= {}\n end",
"def flash\n ActionDispatch::Flash::FlashHash.new\n end",
"def flash\n session[:flash] = Hashie::Mash.new if ... | [
"0.7431991",
"0.66935605",
"0.66269654",
"0.6582615",
"0.6379557",
"0.6294612",
"0.6287259",
"0.62715197",
"0.62583417",
"0.61747634",
"0.61643636",
"0.61524403",
"0.6137107",
"0.60910624",
"0.6090641",
"0.60817426",
"0.60683286",
"0.60660136",
"0.5997736",
"0.59927416",
"0.5... | 0.6875498 | 1 |
Expire the stale data from the previous request. | def expire_stale!
flash.each do |request_id, _|
flash.delete(request_id) if @request_id != request_id
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expire!\n expire_faults!\n expire_perfs!\n end",
"def expire_cache!\n @snapshot = nil\n end",
"def expire!\n headers['Age'] = max_age.to_s if fresh?\n end",
"def clear_expired(request)\n entries_for(request)\n .where {|t| t.created_at < Time.now - ttl }\n ... | [
"0.71122617",
"0.70023537",
"0.6809291",
"0.6708857",
"0.66510004",
"0.66308385",
"0.6627253",
"0.66098243",
"0.65865123",
"0.65094334",
"0.6415521",
"0.6384201",
"0.6358942",
"0.63296974",
"0.63215315",
"0.6317808",
"0.63094604",
"0.6301031",
"0.62997013",
"0.6269406",
"0.62... | 0.7058355 | 1 |
Remove the flash entirely from the session if empty. | def remove!
@session.delete(SESSION_KEY) if empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_flash\n flash.discard \n end",
"def clear_flash\n flash.clear\n end",
"def check_flash\n @flash = session[:flash] if session[:flash]\n session[:flash] = nil\n end",
"def discard_flash\n flash.discard\n end",
"def clear\n # FIXME we're just before a release and I can'... | [
"0.7764486",
"0.76569545",
"0.7553478",
"0.7435806",
"0.74253887",
"0.7162382",
"0.7069044",
"0.7037238",
"0.6936367",
"0.6787647",
"0.6719365",
"0.6688642",
"0.66089016",
"0.6555885",
"0.6506801",
"0.6463963",
"0.6429587",
"0.64135903",
"0.64127135",
"0.6388273",
"0.63581973... | 0.6966859 | 8 |
Values from all the stored requests | def _values
flash.values
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_requests\n @requests\n end",
"def request_info\n @requests = Request.ordered\n end",
"def get_item_requests()\n @item_requests.values\n end",
"def requests\n REQUESTS\n end",
"def requests\n @requests_obj.list\n end",
"def all\n @cache ||= Request.get('/data')\n\... | [
"0.67625546",
"0.668297",
"0.6600901",
"0.646203",
"0.64490455",
"0.6396973",
"0.6370077",
"0.6353521",
"0.6219268",
"0.6112413",
"0.6109214",
"0.60334456",
"0.602136",
"0.5977742",
"0.58870023",
"0.58773094",
"0.5874562",
"0.5840863",
"0.5800724",
"0.57807535",
"0.5779414",
... | 0.0 | -1 |
shift :: (shift) :: Int >? Day | def shift(shift)
check_pre((
(shift.int?)
))
day = self
for n in 1 .. shift.abs
if shift.int_pos?
day = day.succ
else
day = day.pred
end
end
return day
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shift() end",
"def shift() end",
"def shift; end",
"def shift; end",
"def shift\n end",
"def shift\n end",
"def shift\n end",
"def shift_in\n end",
"def shift(ndigits)\n #This is a stub, used for indexing\n end",
"def shift_out\n end",
"def using_shift(arr)\n arr.shift\n... | [
"0.73681676",
"0.73681676",
"0.7295882",
"0.7295882",
"0.7165372",
"0.7165372",
"0.7165372",
"0.7074619",
"0.66639197",
"0.65257704",
"0.6394763",
"0.6386072",
"0.636788",
"0.6346245",
"0.6333931",
"0.63081896",
"0.6286934",
"0.6266265",
"0.62400734",
"0.62254196",
"0.6225419... | 0.8092208 | 1 |
normalize_index :: (index) :: Int > +Int | def normalize_index(index)
check_pre((
(index.int?)
))
index % DAY_SYM_SEQ.length
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input_to_index(index)\n index = (index.to_i) - 1\nend",
"def normalize_index(index)\n norm_index = 0\n index.times do\n while true do\n norm_index += 1 \n break unless columns[norm_index][:included] == false\n end\n end\n no... | [
"0.7205317",
"0.7168586",
"0.7145651",
"0.71075726",
"0.70340073",
"0.70340073",
"0.70269424",
"0.68595797",
"0.67519456",
"0.6627462",
"0.6559707",
"0.6521572",
"0.64745903",
"0.64521384",
"0.64483744",
"0.64275974",
"0.64179873",
"0.6411894",
"0.6405946",
"0.6397118",
"0.63... | 0.6887077 | 7 |
from_index :: (index) :: Int >? Day | def from_index(index)
self.class.from_index(index)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index_to_day(index)\n check_pre((\n (index.int?)\n ))\n\n return index + 1\nend",
"def index_to_day_num(index)\n check_pre((\n (index.int?)\n ))\n\n return index + 1\nend",
"def day_to_index(day_num)\n check_pre((\n (day_num.int?)\n ))\n\n return day_num - 1\nend",
"def day_num_to_index... | [
"0.8175474",
"0.77413905",
"0.7621847",
"0.7446097",
"0.6649948",
"0.6639091",
"0.6129677",
"0.6104649",
"0.5911103",
"0.582599",
"0.5821013",
"0.5812903",
"0.5791108",
"0.5708822",
"0.5692114",
"0.5682679",
"0.5666469",
"0.56564593",
"0.5643112",
"0.56424624",
"0.56424624",
... | 0.6281269 | 6 |
+ :: (obj) :: Day >? Day | def +(value)
check_pre((
(value.int?)
))
from_index(normalize_index(to_index + value))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def +(obj)\n case obj\n when DateTime\n obj + (Rational === @val ? @val/86400 : @val/86400.0)\n when Time\n obj + @val\n else\n super\n end\n end",
"def +(obj)\n case obj\n when Date, DateTime\n obj >> @val\n else\n super\n end\n ... | [
"0.6736095",
"0.6688859",
"0.62580913",
"0.6208628",
"0.6151987",
"0.60875654",
"0.5918905",
"0.59110886",
"0.58161443",
"0.58161443",
"0.58161443",
"0.57428044",
"0.5714149",
"0.56851393",
"0.5665023",
"0.5609083",
"0.55742764",
"0.552324",
"0.5400473",
"0.5374722",
"0.53361... | 0.5095098 | 47 |
:: (obj) :: Day >? Day | def -(value)
check_pre((
(value.int?)
))
from_index(normalize_index(to_index - value))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def day?(v = nil)\n super(v || value)\n end",
"def is_day\n @is_day\n end",
"def day_checked?(day, object)\n #FIXME_AB: use object.persisted?\n #FIXED\n ((object.persisted?) && (object.days.include? day.to_s))\n end",
"def day?(day)\n return (day_num_elem?(day) or day_sym_elem?(day) or day... | [
"0.6780554",
"0.65816003",
"0.6510567",
"0.62352055",
"0.61548597",
"0.61343974",
"0.6128715",
"0.6123337",
"0.59930295",
"0.5926549",
"0.59149575",
"0.5910991",
"0.5898814",
"0.5871367",
"0.5871085",
"0.58682257",
"0.5847044",
"0.58206934",
"0.5797059",
"0.5794319",
"0.57912... | 0.0 | -1 |
== :: (obj) :: Any > Bool | def ==(obj)
return false unless obj.kind_of? self.class
value == obj.value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ==(obj)\n return true if obj.equal?(self)\n self.__getobj__ == obj\n end",
"def eql?(obj)\n self == obj\n end",
"def eql?(obj)\n return true if obj.equal?(self)\n obj.eql?(__getobj__)\n end",
"def ==(obj)\n self.class == obj.class and self.val == obj.val\n end",
"def e... | [
"0.7728354",
"0.7717856",
"0.76855916",
"0.7604637",
"0.75136644",
"0.7454729",
"0.7399585",
"0.7295346",
"0.7162811",
"0.7162811",
"0.70761156",
"0.7064405",
"0.70499367",
"0.7042013",
"0.70396817",
"0.69860125",
"0.69647235",
"0.69226944",
"0.69226944",
"0.69226944",
"0.691... | 0.76975334 | 2 |
=== Abstract methods ======================================================= invariant? > Bool | def invariant?
raise NotImplementedError, "invariant? is not yet implemented"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def abstract?; end",
"def allowed?() raise NotImplementedError end",
"def ordinary?\n raise \"Not implemented yet\"\n end",
"def sos_piedra?() raise NotImplementedError end",
"def pure?\n raise \"Not implemented yet\"\n end",
"def ok?\n raise \"Subclasses must implement this meth... | [
"0.76626885",
"0.75167125",
"0.7444854",
"0.73885787",
"0.7381421",
"0.73745626",
"0.7343804",
"0.7247735",
"0.72189105",
"0.71923023",
"0.7128766",
"0.71225023",
"0.704286",
"0.6917502",
"0.69016314",
"0.685546",
"0.6780567",
"0.67402834",
"0.67264205",
"0.671451",
"0.670170... | 0.67595065 | 17 |
before_action :require_login, except: :create | def index
@neurons = Neuron.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login_required\n not_authorized unless current_user\n end",
"def require_login\n end",
"def login_required\n authenticate_user! \n end",
"def require_login\n redirect_to login_path unless logged_in?\n end",
"def require_login\n redirect_to '/sessions/new' unless current_user\n... | [
"0.771668",
"0.7613013",
"0.74999404",
"0.74569905",
"0.74404216",
"0.7417911",
"0.73693097",
"0.73607343",
"0.73607343",
"0.73447293",
"0.72805136",
"0.72545224",
"0.72487915",
"0.7243391",
"0.72333115",
"0.72333115",
"0.7224069",
"0.7224069",
"0.72203785",
"0.7211135",
"0.7... | 0.0 | -1 |
Are there any more methods needed in this class? | def initialize
@contents = []
@open = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def implementation; end",
"def implementation; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods() end",
"def internal; end",
"def probers; end",
"def internal?; end",
"def internal_methods; end",
"def who_we_are\r\n end"... | [
"0.7802548",
"0.7218733",
"0.7218733",
"0.7074783",
"0.7074783",
"0.7074783",
"0.7074783",
"0.6850992",
"0.6848383",
"0.6811336",
"0.67434734",
"0.67138183",
"0.6606116",
"0.6601731",
"0.6573901",
"0.6573901",
"0.6532324",
"0.65209544",
"0.6518387",
"0.64949733",
"0.64690804"... | 0.0 | -1 |
Are there any more methods needed in this class? => Yes, clean_silverware | def initialize(type, clean = true)
@type = type
@clean = clean
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_silverware\n\t\t@clean = true\n\tend",
"def _clean; end",
"def clean_silverware\n\t\tputs \"#{type} is clean!\"\n\t\t@clean = true\n\tend",
"def clean!; end",
"def site_cleaner; end",
"def clean_up\n end",
"def clean_up\n end",
"def safe; end",
"def clean_silverware \n puts \"cl... | [
"0.7361029",
"0.7153406",
"0.6752443",
"0.6739156",
"0.66366",
"0.65559185",
"0.65559185",
"0.6521889",
"0.63849884",
"0.62821543",
"0.62650895",
"0.6240568",
"0.62246567",
"0.62132454",
"0.61896354",
"0.6130335",
"0.61123717",
"0.60819113",
"0.60425216",
"0.60425216",
"0.604... | 0.0 | -1 |
DRIVER TESTS GO BELOW THIS LINE | def assert
yield
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def running_test_case; end",
"def testing\n # ...\n end",
"def test_cases; end",
"def running_test_step; end",
"def test_step; end",
"def test_case; end",
"def test_steps; end",
"def test_steps; end",
"def tests; end",
"def tests; end",
"def testloop\n \n end",
"def testing_en... | [
"0.73153",
"0.71398866",
"0.7116174",
"0.698727",
"0.6939352",
"0.6920737",
"0.68487316",
"0.68487316",
"0.6835894",
"0.6835894",
"0.68275964",
"0.6690487",
"0.66139585",
"0.66139585",
"0.66138417",
"0.66138417",
"0.66138417",
"0.6593348",
"0.6574246",
"0.65722275",
"0.653437... | 0.0 | -1 |
Set loggedin user (for functional testing) | def login_user(user_name)
user = Goldberg::User.find_by_name(user_name)
@request.session[:goldberg] = {:user_id => (user ? user.id : nil)}
Goldberg::AuthController.set_user(@request.session)
@request.session[:last_time] = Time.now
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_logged_in_user\n @logged_in_user = logged_in_user\n end",
"def set_logged_in_user(user)\n set_temporary_logged_in_user(user)\n session[:user_id] = user.id\n set_unlogged_in_user(nil)\n end",
"def set_user\n require_logged_in\n @user = User.find_by(id: session[:user_id])\n end",
"... | [
"0.8413738",
"0.82577074",
"0.82209814",
"0.8203834",
"0.800388",
"0.79868764",
"0.78985405",
"0.78439975",
"0.7840882",
"0.7839765",
"0.7776024",
"0.7776024",
"0.7770325",
"0.7767073",
"0.77324545",
"0.77324545",
"0.77324545",
"0.77324545",
"0.77324545",
"0.77324545",
"0.773... | 0.0 | -1 |
Formbased login (for integration testing) | def form_login(user, password)
post '/goldberg/auth/login', :login => {
:name => user,
:password => password
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login\n\t#Login Form\n end",
"def do_login page\n page = page.form_with(action: \"/login\") do |f|\n f.userid = @@username\n f.password = @@password\n end.click_button \n end",
"def do_login page\n page = page.form_with(action: \"/login\") do |f|\n f.userid = @@u... | [
"0.78713053",
"0.77565867",
"0.77565867",
"0.7729027",
"0.770762",
"0.77072936",
"0.765807",
"0.7622175",
"0.753588",
"0.753588",
"0.753588",
"0.753588",
"0.753588",
"0.753588",
"0.753588",
"0.753588",
"0.753588",
"0.75223327",
"0.75148743",
"0.7477595",
"0.7475072",
"0.745... | 0.76754105 | 6 |
Formbased logout (for integration testing) | def form_logout
post '/goldberg/auth/logout'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logout\n end",
"def logout\n end",
"def logout\n if User.current.anonymous?\n redirect_to home_url\n elsif request.post?\n logout_user\n # redirect_to home_url\nredirect_to login_url \nend\n # display the logout form\n end",
"def logout\n user_name.click\n logout_li... | [
"0.7624693",
"0.7624693",
"0.75662667",
"0.7536976",
"0.7526943",
"0.74632186",
"0.7455341",
"0.7402959",
"0.7395345",
"0.73819476",
"0.73672974",
"0.7356192",
"0.735217",
"0.73513573",
"0.7340552",
"0.7325157",
"0.7319809",
"0.7299139",
"0.7292652",
"0.7278205",
"0.7278205",... | 0.83883977 | 0 |
Provide a user friendly representation | def to_s
'#<Twilio.Messaging.V1.DomainConfigList>'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_display\n raise NotImplementedError\n end",
"def to_s; description end",
"def to_s\n super\n end",
"def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end",
"def to_s\n super\n end",
"def to_s\n \"#{@nam... | [
"0.70447654",
"0.7025946",
"0.70086724",
"0.7008141",
"0.69449997",
"0.691802",
"0.6843895",
"0.6797355",
"0.6655898",
"0.6622141",
"0.66182053",
"0.66182053",
"0.66182053",
"0.66182053",
"0.66182053",
"0.66182053",
"0.66182053",
"0.66182053",
"0.6610882",
"0.6610882",
"0.658... | 0.0 | -1 |
Build an instance of DomainConfigInstance | def get_instance(payload)
DomainConfigInstance.new(@version, payload, )
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build(domain_name)\n domain = Domain.new(:name => domain_name,\n :ttl => self.ttl,\n :authority_type => Domain::MASTER)\n\n record_templates.dup.each do |template|\n record = template.build(domain_name)\n\n ... | [
"0.61828154",
"0.588146",
"0.5860655",
"0.5840592",
"0.57960504",
"0.57310903",
"0.57193476",
"0.57092",
"0.56846696",
"0.56392395",
"0.5609854",
"0.5609699",
"0.55501074",
"0.5545035",
"0.55124277",
"0.54731655",
"0.54709166",
"0.5394291",
"0.532533",
"0.5312759",
"0.5300320... | 0.7406027 | 0 |
Provide a user friendly representation | def to_s
'<Twilio.Messaging.V1.DomainConfigPage>'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_display\n raise NotImplementedError\n end",
"def to_s; description end",
"def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end",
"def to_s\n super\n end",
"def to_s\n super\n end",
"def to_s\n \"#{@nam... | [
"0.70430577",
"0.7025487",
"0.7008232",
"0.7007793",
"0.69441473",
"0.6917163",
"0.68431",
"0.6797009",
"0.6655106",
"0.66227216",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.660979",
"0.660979",
"0.6585346",
"0... | 0.0 | -1 |
Provide a user friendly representation | def to_s
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
"#<Twilio.Messaging.V1.DomainConfigContext #{context}>"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_display\n raise NotImplementedError\n end",
"def to_s; description end",
"def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end",
"def to_s\n super\n end",
"def to_s\n super\n end",
"def to_s\n \"#{@nam... | [
"0.70430577",
"0.7025487",
"0.7008232",
"0.7007793",
"0.69441473",
"0.6917163",
"0.68431",
"0.6797009",
"0.6655106",
"0.66227216",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.660979",
"0.660979",
"0.6585346",
"0... | 0.0 | -1 |
Provide a detailed, user friendly representation | def inspect
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
"#<Twilio.Messaging.V1.DomainConfigContext #{context}>"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def details; end",
"def to_s; description end",
"def get_detail\n return self.inspect\n end",
"def to_display\n raise NotImplementedError\n end",
"def formatted_info\n \"#{self.name} - #{self.description}\"\n end",
"def toString\n #Not sure if we want this or just use the getters for mor... | [
"0.6817552",
"0.6813698",
"0.6758332",
"0.6717903",
"0.6669525",
"0.6654881",
"0.663228",
"0.6626862",
"0.65499413",
"0.6519309",
"0.64980435",
"0.64802086",
"0.64776045",
"0.6471904",
"0.6450177",
"0.6450177",
"0.6450177",
"0.6450177",
"0.6450177",
"0.6450177",
"0.6450177",
... | 0.0 | -1 |
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context | def context
unless @instance_context
@instance_context = DomainConfigContext.new(@version, @params['domain_sid'], )
end
@instance_context
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def context\n unless @instance_context\n @instance_context = ApplicationContext.new(@version , @params['account_sid'], @params['sid'])\n end\n @instance_context\n end",
"def context\n ... | [
"0.6838772",
"0.6803137",
"0.67969644",
"0.67722964",
"0.67694116",
"0.67694116",
"0.67322564",
"0.6682882",
"0.66802865",
"0.6678856",
"0.6677394",
"0.664103",
"0.662816",
"0.6610689",
"0.6600637",
"0.6592487",
"0.65731186",
"0.65686166",
"0.6561544",
"0.65571475",
"0.655002... | 0.613377 | 55 |
Provide a user friendly representation | def to_s
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
"<Twilio.Messaging.V1.DomainConfigInstance #{values}>"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_display\n raise NotImplementedError\n end",
"def to_s; description end",
"def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end",
"def to_s\n super\n end",
"def to_s\n super\n end",
"def to_s\n \"#{@nam... | [
"0.70430577",
"0.7025487",
"0.7008232",
"0.7007793",
"0.69441473",
"0.6917163",
"0.68431",
"0.6797009",
"0.6655106",
"0.66227216",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.6618043",
"0.660979",
"0.660979",
"0.6585346",
"0... | 0.0 | -1 |
Provide a detailed, user friendly representation | def inspect
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
"<Twilio.Messaging.V1.DomainConfigInstance #{values}>"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def details; end",
"def to_s; description end",
"def get_detail\n return self.inspect\n end",
"def to_display\n raise NotImplementedError\n end",
"def formatted_info\n \"#{self.name} - #{self.description}\"\n end",
"def toString\n #Not sure if we want this or just use the getters for mor... | [
"0.68170065",
"0.68142146",
"0.6758589",
"0.6718451",
"0.66697186",
"0.6655344",
"0.6632312",
"0.66273594",
"0.6550127",
"0.65188134",
"0.6497969",
"0.6480078",
"0.6477721",
"0.6472211",
"0.64502096",
"0.64502096",
"0.64502096",
"0.64502096",
"0.64502096",
"0.64502096",
"0.64... | 0.0 | -1 |
SizedQueuemax= max=(max) Sets the maximum size of the queue. | def max=
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_queue_count()\n @max_queue_count\n end",
"def max_size\n @max_size ||= options[:max_size] || [DEFAULT_MAX_SIZE, min_size].max\n end",
"def max_size=(_arg0); end",
"def set_maximum_queued_data_size(opts)\n opts = check_params(opts,[:sizes])\n super(opts)\n end",
"def... | [
"0.71805286",
"0.70424736",
"0.6799218",
"0.677677",
"0.6747652",
"0.6679507",
"0.6671278",
"0.65676004",
"0.6563907",
"0.6536413",
"0.64352566",
"0.64352566",
"0.64108235",
"0.6404934",
"0.64031684",
"0.6367575",
"0.63514626",
"0.63467586",
"0.6341903",
"0.629316",
"0.628713... | 0.0 | -1 |
SizedQueuedeq deq(args) Alias for pop | def deq
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dequeue; @queue.pop end",
"def pour_out\n @queue.deq\n end",
"def deq\n\t\tremove(0)\n\tend",
"def deq(&proc)\n loop do\n batch = @out_queue.deq\n if batch == CLOSE_BATCH\n break\n end\n proc.call(batch)\n end\n end",
"def pop()\n @si... | [
"0.70663285",
"0.6897825",
"0.6711243",
"0.6668918",
"0.66278106",
"0.6609441",
"0.6602818",
"0.6575751",
"0.657001",
"0.65617365",
"0.65550613",
"0.6540622",
"0.64454746",
"0.6440068",
"0.6432565",
"0.64291376",
"0.64193916",
"0.6412602",
"0.6393885",
"0.6346214",
"0.633032"... | 0.6865089 | 3 |
SizedQueuepush push(obj) Pushes +obj+ to the queue. If there is no space left in the queue, waits until space becomes available. (also known as <<, enq) | def push
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def push(obj)\n @queue.put(obj)\n end",
"def push(obj)\n @mutex.synchronize{\n while true\n break if @que.length < @max\n @queue_wait.push Thread.current\n @mutex.sleep\n end\n\n @que.push obj\n begin\n t = @waiting.shift\n t.wakeup if t\n re... | [
"0.80574936",
"0.7848507",
"0.7593834",
"0.7424288",
"0.74047697",
"0.7252481",
"0.7218256",
"0.71209145",
"0.7063692",
"0.7045691",
"0.70382184",
"0.7007204",
"0.6958485",
"0.687602",
"0.686329",
"0.6777365",
"0.6737085",
"0.670437",
"0.6684252",
"0.6575936",
"0.65441227",
... | 0.5988841 | 60 |
SizedQueueenq enq(obj) Alias for push | def enq
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def push(obj)\n @queue.put(obj)\n end",
"def push(x)\n @size += 1\n @queue_in.push(x)\n end",
"def push(obj)\n @q << obj\n @mutex.synchronize { @cv.signal }\n end",
"def push(x)\n @q << x \n end",
"def push(x)\n @size += 1\n ... | [
"0.7604858",
"0.71997553",
"0.71309674",
"0.704933",
"0.70366764",
"0.7005755",
"0.69188505",
"0.6769716",
"0.67338634",
"0.6723768",
"0.67210025",
"0.66844344",
"0.661802",
"0.65909755",
"0.6580751",
"0.65646136",
"0.6539973",
"0.64986396",
"0.64986396",
"0.6493663",
"0.6478... | 0.623561 | 45 |
SizedQueue<< <<(obj) Alias for push | def <<
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def push(obj)\n @queue.put(obj)\n end",
"def push(x)\n @size += 1\n @queue_in.push(x)\n end",
"def push(x)\n @queue << x\n end",
"def push(*obj)\n obj.each {|obj| self << obj }\n self\n end",
"def push(x)\n @q << x \n end",
"def push(x)\n @size += 1\n ... | [
"0.77916193",
"0.73044306",
"0.72770715",
"0.72311854",
"0.719261",
"0.71228725",
"0.7035134",
"0.7033367",
"0.7018922",
"0.6920289",
"0.685005",
"0.6842519",
"0.6824596",
"0.67952013",
"0.67366254",
"0.67265546",
"0.6717705",
"0.667802",
"0.66583014",
"0.6626136",
"0.6626136... | 0.0 | -1 |
SizedQueuenum_waiting num_waiting() Returns the number of threads waiting on the queue. | def num_waiting
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_waiting\n @waiting.size + @queue_wait.size\n end",
"def num_waiting\n @waiting.size + @queue_wait.size\n end",
"def num_waiting\n @queue.num_waiting\n end",
"def num_waiting\n @waiting.size\n end",
"def num_waiting\n @waiting.size\n end",
"def num_waiting\n @pop_m... | [
"0.8626538",
"0.8626538",
"0.8496577",
"0.8094758",
"0.8094758",
"0.80292296",
"0.78561395",
"0.7841031",
"0.7820085",
"0.77188253",
"0.77188253",
"0.7643842",
"0.75292933",
"0.75292933",
"0.7505393",
"0.7338749",
"0.7252954",
"0.7115378",
"0.7008796",
"0.6892332",
"0.6880550... | 0.7348158 | 16 |
SizedQueueshift shift(args) Alias for pop | def shift
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shift!\n shifted = @queue.shift\n\n return nil if shifted.nil?\n shifted[0]\n end",
"def shift\n @lock.synchronize do\n @queue.shift\n end\n end",
"def *\n push pop * pop\n end",
"def shift\n return nil if empty?\n @que.shift\n end",
"def shift(*args)\n check... | [
"0.76230496",
"0.74617726",
"0.6976964",
"0.6908263",
"0.6906402",
"0.69058967",
"0.68526196",
"0.68323183",
"0.68323183",
"0.67876244",
"0.67876244",
"0.67656374",
"0.67586154",
"0.67586154",
"0.67319316",
"0.67161214",
"0.66296124",
"0.6586207",
"0.6586207",
"0.6586207",
"0... | 0.64452493 | 36 |
SizedQueuemax max() Returns the maximum size of the queue. | def max
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_queue_count()\n @max_queue_count\n end",
"def size\n @max\n end",
"def max\n if size == 0\n 0/0.0\n else\n self.size - 1\n end\n end",
"def max\n max = @storage[0]\n @size.times do |i|\n if @storage[i] > max\n max = @storage[i]\n end\n\n ... | [
"0.8019943",
"0.74576044",
"0.74256676",
"0.70616114",
"0.70515394",
"0.6953006",
"0.6795392",
"0.67894816",
"0.676503",
"0.6689541",
"0.66605026",
"0.66580904",
"0.6651941",
"0.6647054",
"0.66383624",
"0.65992725",
"0.6569792",
"0.6566713",
"0.6554784",
"0.6554215",
"0.65302... | 0.6286838 | 73 |
Se asignan todas las variables de la clase | def initialize(nombre, proteinas, glucidos, lipidos, datos)
@nombre = nombre
@proteinas = proteinas
@glucidos = glucidos
@lipidos = lipidos
@datos = datos
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def class_variables() end",
"def class_variables; end",
"def class_variables\n end",
"def initialize(nombre,edad) #--> se crean los metodos, y se inicializan para darles un valor al crear el objeto \n @nombre = nombre #-->la variable local nombre es asignada a la var. de instancia @nombre, al realiz... | [
"0.7509446",
"0.71626556",
"0.70152843",
"0.6995855",
"0.6915462",
"0.6875864",
"0.6829586",
"0.6710182",
"0.66560745",
"0.6612472",
"0.6606677",
"0.660616",
"0.66034746",
"0.6546871",
"0.65277106",
"0.6522925",
"0.6509909",
"0.6509909",
"0.64592576",
"0.64592576",
"0.6450028... | 0.63056564 | 27 |
Devuelve el alimento formateado | def to_s
"#{nombre}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def formation; end",
"def sigla; @nome; end",
"def create\n @pasteurizacion = Pasteurizacion.new(pasteurizacion_params)\n\n cantidadAlmacenada = @pasteurizacion.cantidad_almacenada\n cantidadDesechada = @pasteurizacion.cantidad_desechada\n\n @pasteurizacion.cantidad = cantidadAlmacenada... | [
"0.63704234",
"0.6276774",
"0.6083955",
"0.6066634",
"0.60361487",
"0.60318416",
"0.5983058",
"0.59668493",
"0.5902646",
"0.5897101",
"0.5891007",
"0.5883611",
"0.5860329",
"0.5852815",
"0.58272004",
"0.58263046",
"0.5800965",
"0.5778072",
"0.5769896",
"0.5743389",
"0.5726706... | 0.0 | -1 |
Recibe un vector con los datos de un alimento para los individuos, devuelve un vector con los AIBC de cada individuo | def aibc(g)
# recibe un vector de datos del alimento
# devuelve los aibc del alimento, o glucosa, para cada individuo
g.map{ |gi| gi.each_with_index.map{ |gindex, i| if0(gindex, gi[0], gi[i-1]) if i > 0 } }.map{ |gi| gi.reject{ |gij| gij.class == nil::NilClass } }.map{ |ri| ri.reduce(0, :+) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ig_ind\n\t\taibc(@datos[0]).each_with_index.map{ |ind, i| (ind/aibc(@datos[1])[i])*100 }\n\tend",
"def IVA (precio_iva)\n precio_iva.map {|plato, precio| precio * 1.19}\n end",
"def get_AIBC(i)\n @@tam = @medidas.length\n if i >= @@tam\n return 0\n else\n retur... | [
"0.6007659",
"0.56969637",
"0.5678715",
"0.56126714",
"0.5480602",
"0.5461627",
"0.543828",
"0.53736323",
"0.5330251",
"0.53236663",
"0.53039074",
"0.5253131",
"0.52451694",
"0.52360743",
"0.5181971",
"0.5145404",
"0.5134785",
"0.51045185",
"0.5081362",
"0.50781745",
"0.50269... | 0.7621092 | 0 |
Calcula los AIBC de los datos del alimento y los divide entre los AIBC de los datos de la glucosa Devolviendo un vector con los IG de cada individuo | def ig_ind
aibc(@datos[0]).each_with_index.map{ |ind, i| (ind/aibc(@datos[1])[i])*100 }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aibc(g)\n\t\t# recibe un vector de datos del alimento\n\t\t# devuelve los aibc del alimento, o glucosa, para cada individuo\n\t\tg.map{ |gi| gi.each_with_index.map{ |gindex, i| if0(gindex, gi[0], gi[i-1]) if i > 0 } }.map{ |gi| gi.reject{ |gij| gij.class == nil::NilClass } }.map{ |ri| ri.reduce(0, :+) }\n\tend... | [
"0.74153733",
"0.707304",
"0.65571314",
"0.6335022",
"0.6333896",
"0.63335115",
"0.6330948",
"0.6261433",
"0.6256084",
"0.6214904",
"0.6201673",
"0.61691177",
"0.61563027",
"0.61404485",
"0.6112163",
"0.6111031",
"0.61016923",
"0.6100657",
"0.60714185",
"0.6038083",
"0.602752... | 0.66840976 | 2 |
Calcula el IG del alimento haciendo la media con los IG de los individuos | def ig
ig_ind.reduce(0, :+)/ig_ind.size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aliquot_media()\r\n reps = 1 # operations.collect {|op| op.input(PARAMETER_1).val.to_i} ### Will become a parameter that will allow for replicates flexablity\r\n media_vol = (operations.length * 1.1 * reps).round()\r\n \r\n # Aliquot media needed for experiment\r\n show do\r\... | [
"0.56762683",
"0.5482078",
"0.54041374",
"0.53810024",
"0.5253011",
"0.52217114",
"0.519203",
"0.5129555",
"0.51229566",
"0.5094883",
"0.5057687",
"0.50525016",
"0.5052041",
"0.50432813",
"0.5035687",
"0.50214046",
"0.5009403",
"0.4988351",
"0.49776003",
"0.49771377",
"0.4973... | 0.0 | -1 |
Se llama al contructor de la clase madre y se asigna el valor de la nueva variable | def initialize(nombre, proteinas, glucidos, lipidos, datos, grupo)
super(nombre, proteinas, glucidos, lipidos, datos)
@grupo = grupo
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(nombre,edad) #--> se crean los metodos, y se inicializan para darles un valor al crear el objeto \n @nombre = nombre #-->la variable local nombre es asignada a la var. de instancia @nombre, al realizar esto cada instancia tendra un valor propio.\n @edad = edad #--> lo mismo para edad\... | [
"0.7653821",
"0.75024724",
"0.7465968",
"0.7357546",
"0.7283821",
"0.7262986",
"0.7262986",
"0.7262986",
"0.7262986",
"0.7262986",
"0.7240207",
"0.7237952",
"0.72262955",
"0.71999234",
"0.7136645",
"0.7123702",
"0.7107761",
"0.7074116",
"0.70406926",
"0.70204705",
"0.70204705... | 0.0 | -1 |
GET /project_users GET /project_users.json | def index
@project = Project.where("id=?", params[:project_id]).first
if @project.nil?
redirect_to "/", error: 'Not exist project'
return
else
@project_users = @project.project_users
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def users_for_a_project\n uri = \"#{@api_url}/#{@project_id}/users?access_token=#{@access_token}\"\n get uri\n end",
"def get_users\n if @project\n if ProjectUser.verify_role(current_user.id, @project, 'client')\n render json: @project.project_users, status: 200\n else\n render ... | [
"0.8737035",
"0.8082397",
"0.79402184",
"0.7823491",
"0.78098977",
"0.7783156",
"0.77342933",
"0.773081",
"0.7533003",
"0.7483676",
"0.7414451",
"0.7385242",
"0.7360415",
"0.7309616",
"0.72798467",
"0.7226319",
"0.71880436",
"0.70940655",
"0.70805097",
"0.70646405",
"0.704591... | 0.69161 | 25 |
GET /project_users/1 GET /project_users/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def users_for_a_project\n uri = \"#{@api_url}/#{@project_id}/users?access_token=#{@access_token}\"\n get uri\n end",
"def project_users(project_id, params = {})\n make_get_request(\"/projects/#{project_id}/users\", params)\n end",
"def index\n\t\trender json: Project.find(params[:project_id]).users.... | [
"0.8323378",
"0.7616855",
"0.7613032",
"0.76047635",
"0.75894535",
"0.75163496",
"0.74666387",
"0.74455726",
"0.74418086",
"0.72088164",
"0.7196835",
"0.7165189",
"0.7119488",
"0.7076129",
"0.7067283",
"0.70557797",
"0.70424753",
"0.70227325",
"0.7007731",
"0.6995613",
"0.693... | 0.0 | -1 |
POST /project_users POST /project_users.json | def create
@project = Project.find(params[:project_id])
@user = User.where("email = ?", params[:email]).first
pu = ProjectUser.where("")
privs = []
privs << "r" if params[:r] == "1"
privs << "w" if params[:w] == "1"
privs << "a" if params[:a] == "1"
@priv = privs.join("")
@project_us... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_users\n if @project.user_id == current_user.id\n success = []\n errors = []\n @users.each do |user|\n new_user = create_user(user, @project)\n new_user.valid? ? success << new_user : errors << new_user.errors\n end\n if errors.empty?\n success.each { |user| ... | [
"0.73747206",
"0.6995722",
"0.69931924",
"0.691402",
"0.6817186",
"0.67559457",
"0.6709352",
"0.6698845",
"0.66743237",
"0.6669077",
"0.6642097",
"0.6640091",
"0.66285884",
"0.66066915",
"0.660236",
"0.6589887",
"0.6549011",
"0.654342",
"0.65407956",
"0.6495227",
"0.64828116"... | 0.7015992 | 1 |
PATCH/PUT /project_users/1 PATCH/PUT /project_users/1.json | def update
privs = []
privs << "r" if params[:r] == "1"
privs << "w" if params[:w] == "1"
privs << "a" if params[:a] == "1"
@priv = privs.join("")
@project_user.priv = @priv
@project = @project_user.project
respond_to do |format|
if @project_user.save
format.html { redirect... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n authorize @project\n if @project.update(project_params.merge!(updated_by_id: current_user.id))\n render json: @project\n else\n render json: {errors: @project.errors.full_messages}, status: 422\n end\n end",
"def update\n respond_to do |format|\n if @project_user.u... | [
"0.67906183",
"0.67779887",
"0.67664677",
"0.67328393",
"0.6715027",
"0.66633433",
"0.6635072",
"0.66326183",
"0.66135937",
"0.65941715",
"0.6537806",
"0.650017",
"0.6486264",
"0.6484129",
"0.6470388",
"0.6460202",
"0.6451431",
"0.64181715",
"0.63955086",
"0.6391677",
"0.6385... | 0.6393369 | 19 |
DELETE /project_users/1 DELETE /project_users/1.json | def destroy
@project_user.destroy
respond_to do |format|
format.html { redirect_to project_users_url, notice: 'User setting was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n @project.users.delete_all\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_name = params[:username]\n @project = Proje... | [
"0.7628352",
"0.7423634",
"0.73515826",
"0.7347687",
"0.73249906",
"0.7304885",
"0.7279545",
"0.71843714",
"0.716758",
"0.7149002",
"0.7140196",
"0.7099484",
"0.7026009",
"0.7006714",
"0.6987024",
"0.6924469",
"0.69200224",
"0.6918255",
"0.6897342",
"0.688836",
"0.6870292",
... | 0.7189081 | 7 |
Use callbacks to share common setup or constraints between actions. | def set_project_user
@project_user = ProjectUser.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.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def project_user_params
params.require(:project_user).permit(:email, :project_id, :r, :w, :a)
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 |
GET /groups GET /groups.json | def index
if params[:search]
@groups = Group.search((params[:search]).to_s.downcase)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetGroups params = {}\n\n params = params.merge(path: 'groups.json')\n APICall(params)\n\n end",
"def groups\n \n \n @groups = @current_user.groups\n render 'groups.json.jbuilder', status: :ok\n end",
"def index\n @groups = Group.all\n\n respond_to do... | [
"0.82872087",
"0.82785934",
"0.7801081",
"0.77628714",
"0.77264166",
"0.7655801",
"0.7655801",
"0.7653884",
"0.76372904",
"0.7562278",
"0.75476146",
"0.74831414",
"0.7476794",
"0.7468396",
"0.7465664",
"0.7380685",
"0.7368016",
"0.73517954",
"0.7335838",
"0.72986573",
"0.7242... | 0.0 | -1 |
GET /groups/1 GET /groups/1.json | def show
if @group.users.include?(current_user) || @group.creator == current_user
@contacts = @group.contacts.search((params[:search]).to_s.downcase)
else
redirect_to join_group_path
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetGroup id\n\n APICall(path: \"groups/#{id}.json\")\n\n end",
"def groups\n \n \n @groups = @current_user.groups\n render 'groups.json.jbuilder', status: :ok\n end",
"def show\n group = Group.find(params[:id])\n\n render json: group\n end",
"def GetGroup... | [
"0.7906696",
"0.77682996",
"0.77013576",
"0.7696094",
"0.76500016",
"0.7552326",
"0.7552326",
"0.7536221",
"0.74999285",
"0.74999285",
"0.74628925",
"0.7451343",
"0.7425182",
"0.7417058",
"0.7410386",
"0.7380656",
"0.73710245",
"0.7351068",
"0.7332308",
"0.73154056",
"0.73041... | 0.0 | -1 |
POST /groups POST /groups.json | def create
@group = Group.new(group_params)
if current_user
@group.user_id = current_user.id
end
respond_to do |format|
if @group.save
format.html { redirect_to @group, notice: 'Group was successfully created.' }
format.json { render action: 'show', status: :created, loc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def CreateGroup params = {}\n \n APICall(path: 'groups.json',method: 'POST',payload: params.to_json)\n \n end",
"def create\n #logger.info \"Post parameters: #{params}\"\n @group = Group.new(name: params[:group][:name], expiration: params[:group][:expiration], owner: current_user)... | [
"0.77380043",
"0.7621419",
"0.751383",
"0.74283075",
"0.738724",
"0.738724",
"0.7202902",
"0.7202091",
"0.7180679",
"0.71750224",
"0.71592236",
"0.71332103",
"0.7128259",
"0.70654404",
"0.7040274",
"0.7027708",
"0.70119005",
"0.70049846",
"0.70049846",
"0.70049846",
"0.700498... | 0.658166 | 78 |
PATCH/PUT /groups/1 PATCH/PUT /groups/1.json | def update
respond_to do |format|
if @group.update(group_params)
format.html { redirect_to @group, notice: 'Group was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @group.errors, status: :un... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n logger.info \"Put parameters: #{params.to_json}\"\n @group = Group.find(params[:id])\n\n if @group.update_attributes(params[:group])\n head :no_content\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"def UpdateGroup params = {}\n \n ... | [
"0.7466507",
"0.74578977",
"0.74070287",
"0.7302792",
"0.7140245",
"0.7124225",
"0.7098948",
"0.70921224",
"0.7057236",
"0.7057236",
"0.70501083",
"0.70501083",
"0.70501083",
"0.70233816",
"0.6994502",
"0.6980002",
"0.69678557",
"0.69506794",
"0.69306016",
"0.69253594",
"0.69... | 0.69751716 | 19 |
DELETE /groups/1 DELETE /groups/1.json | def destroy
@group.destroy
respond_to do |format|
format.html { redirect_to groups_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteGroup id\n \n APICall(path: \"groups/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n group = Group.find(params[:id])\n group.destroy\n render json: {}\n end",
"def deleteGroup( group_id)\n params = Hash.new\n params['group_id'] = group_id\n return... | [
"0.80836385",
"0.7981561",
"0.7918146",
"0.7863548",
"0.7863548",
"0.78492594",
"0.78492594",
"0.7833518",
"0.7833518",
"0.7833518",
"0.7833518",
"0.7833518",
"0.7833518",
"0.7808881",
"0.778925",
"0.77889484",
"0.7776976",
"0.77554834",
"0.7734696",
"0.76846194",
"0.76684403... | 0.78424275 | 10 |
Use callbacks to share common setup or constraints between actions. | def set_group
@group = Group.friendly.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.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def group_params
params.require(:group).permit(:name, :password, :search)
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 |
GET /hospitalization_days GET /hospitalization_days.json | def index
@hospitalization_days = HospitalizationDay.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entries\n uri = URI(BASE_URL + ENTRIES_ENDPOINT + days_query)\n\n make_request(uri)\n end",
"def index\n @days = @trip.days.order(trip_day: :asc)\n render json: @days, include: [:activities]\n end",
"def days\n @trainings = Training.all\n @activities = Activity.all\n\n resp... | [
"0.6266668",
"0.6172979",
"0.6169462",
"0.612278",
"0.6065074",
"0.6046113",
"0.601401",
"0.5975222",
"0.59307826",
"0.5899083",
"0.5878973",
"0.5860098",
"0.58365303",
"0.58335125",
"0.5814893",
"0.58118457",
"0.5768163",
"0.5737642",
"0.5736235",
"0.5706451",
"0.5657468",
... | 0.726228 | 0 |
GET /hospitalization_days/1 GET /hospitalization_days/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @hospitalization_days = HospitalizationDay.all\n end",
"def set_hospitalization_day\n @hospitalization_day = HospitalizationDay.find(params[:id])\n end",
"def create\n @hospitalization_day = @adverse_event.hospitalization_days.create(hospitalization_day_params)\n\n respond_to do |... | [
"0.7194558",
"0.6503073",
"0.63845086",
"0.6201435",
"0.6153555",
"0.6146213",
"0.6113926",
"0.6033329",
"0.59819746",
"0.59506917",
"0.5915661",
"0.5909721",
"0.58924115",
"0.58633286",
"0.5862187",
"0.58538365",
"0.5850403",
"0.58303565",
"0.5828599",
"0.5822305",
"0.582185... | 0.0 | -1 |
POST /hospitalization_days POST /hospitalization_days.json | def create
@hospitalization_day = @adverse_event.hospitalization_days.create(hospitalization_day_params)
respond_to do |format|
if @hospitalization_day.save
format.html { redirect_to adverse_event_path(@adverse_event), notice: 'Día de estancia ingresado satisfactoriamente.' }
format.json ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hospitalization_day_params\n params.require(:hospitalization_day).permit(:qty, :price, :subtotal, :date, :adverse_event_id, :service_id)\n end",
"def index\n @hospitalization_days = HospitalizationDay.all\n end",
"def set_hospitalization_day\n @hospitalization_day = HospitalizationDay.find... | [
"0.6332337",
"0.6304989",
"0.6217499",
"0.6197467",
"0.6176528",
"0.60687923",
"0.60387564",
"0.59719217",
"0.5970033",
"0.59568095",
"0.5931699",
"0.58775467",
"0.58208954",
"0.582045",
"0.5772554",
"0.5734075",
"0.572752",
"0.5722149",
"0.5704851",
"0.5695546",
"0.5669442",... | 0.7615407 | 0 |
PATCH/PUT /hospitalization_days/1 PATCH/PUT /hospitalization_days/1.json | def update
respond_to do |format|
if @hospitalization_day.update(hospitalization_day_params)
format.html { redirect_to adverse_event_path(@adverse_event), notice: 'Día de estancia actualizado satisfactoriamente.' }
format.json { render :show, status: :ok, location: @hospitalization_day }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @daily_happiness.update(daily_happiness_params)\n format.html { redirect_to @daily_happiness, notice: 'Daily happiness was successfully updated.' }\n format.json { render :show, status: :ok, location: @daily_happiness }\n else\n format.html... | [
"0.66583097",
"0.66504556",
"0.6640793",
"0.6635424",
"0.6603996",
"0.65735763",
"0.6544069",
"0.6533692",
"0.6516743",
"0.6509548",
"0.6499186",
"0.6496349",
"0.64497286",
"0.64470947",
"0.64141554",
"0.6397706",
"0.6395659",
"0.63697",
"0.63347447",
"0.6292579",
"0.6286247"... | 0.71816415 | 0 |
DELETE /hospitalization_days/1 DELETE /hospitalization_days/1.json | def destroy
@hospitalization_day.destroy
respond_to do |format|
format.html { redirect_to hospitalization_days_url, notice: 'Día de estancia eliminado satisfactoriamente.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @hospitalization = Hospitalization.find(params[:id])\n @hospitalization.destroy\n\n respond_to do |format|\n format.html { redirect_to client_hospitalizations_url(@client) }\n format.json { head :ok }\n end\n end",
"def destroy\n @theory_day.destroy\n respond_to do |for... | [
"0.7481781",
"0.7293893",
"0.72584295",
"0.7257791",
"0.72551346",
"0.7192646",
"0.7176689",
"0.7124633",
"0.71113783",
"0.71021",
"0.7084953",
"0.70569396",
"0.7032007",
"0.6973628",
"0.696361",
"0.69544065",
"0.6951986",
"0.6937665",
"0.692534",
"0.6920798",
"0.69171524",
... | 0.7774703 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_hospitalization_day
@hospitalization_day = HospitalizationDay.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 hospitalization_day_params
params.require(:hospitalization_day).permit(:qty, :price, :subtotal, :date, :adverse_event_id, :service_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 |
Get metadata proxy status Get metadata proxy status | def read_metadata_proxy_statistics(metadata_proxy_id, opts = {})
data, _status_code, _headers = read_metadata_proxy_statistics_with_http_info(metadata_proxy_id, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_metadata_proxy_status(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts)\n data\n end",
"def read_metadata_proxy_status_0(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_st... | [
"0.75380427",
"0.72399455",
"0.6702983",
"0.65566075",
"0.6365063",
"0.6007418",
"0.59904766",
"0.59862214",
"0.5950217",
"0.5894908",
"0.5786421",
"0.57438207",
"0.5683461",
"0.5677034",
"0.567392",
"0.56736684",
"0.5625396",
"0.5617031",
"0.5615506",
"0.5607354",
"0.5604845... | 0.6028542 | 5 |
Get metadata proxy status Get metadata proxy status | def read_metadata_proxy_statistics_with_http_info(metadata_proxy_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesMetadataProxyStatusApi.read_metadata_proxy_statistics ...'
end
# verify the required parameter 'metadata_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_metadata_proxy_status(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts)\n data\n end",
"def read_metadata_proxy_status_0(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_st... | [
"0.75380427",
"0.72399455",
"0.6702983",
"0.65566075",
"0.6365063",
"0.6028542",
"0.6007418",
"0.59904766",
"0.5950217",
"0.5894908",
"0.5786421",
"0.57438207",
"0.5683461",
"0.5677034",
"0.567392",
"0.56736684",
"0.5625396",
"0.5617031",
"0.5615506",
"0.5607354",
"0.5604845"... | 0.59862214 | 8 |
Get metadata proxy status Get metadata proxy status | def read_metadata_proxy_statistics_0(metadata_proxy_id, opts = {})
data, _status_code, _headers = read_metadata_proxy_statistics_0_with_http_info(metadata_proxy_id, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_metadata_proxy_status(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts)\n data\n end",
"def read_metadata_proxy_status_0(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_st... | [
"0.7539077",
"0.72408056",
"0.6702792",
"0.6556298",
"0.63644993",
"0.6029089",
"0.6008634",
"0.59909755",
"0.59859115",
"0.5949829",
"0.5895641",
"0.57845306",
"0.5682534",
"0.5677839",
"0.56726944",
"0.56724775",
"0.56259006",
"0.5615592",
"0.5614066",
"0.56077486",
"0.5603... | 0.57442886 | 12 |
Get metadata proxy status Get metadata proxy status | def read_metadata_proxy_statistics_0_with_http_info(metadata_proxy_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesMetadataProxyStatusApi.read_metadata_proxy_statistics_0 ...'
end
# verify the required parameter 'metad... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_metadata_proxy_status(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts)\n data\n end",
"def read_metadata_proxy_status_0(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_st... | [
"0.75380427",
"0.72399455",
"0.6702983",
"0.65566075",
"0.6365063",
"0.6028542",
"0.6007418",
"0.59904766",
"0.59862214",
"0.5894908",
"0.5786421",
"0.57438207",
"0.5683461",
"0.5677034",
"0.567392",
"0.56736684",
"0.5625396",
"0.5617031",
"0.5615506",
"0.5607354",
"0.5604845... | 0.5950217 | 9 |
Get metadata proxy status Get metadata proxy status | def read_metadata_proxy_status(metadata_proxy_id, opts = {})
data, _status_code, _headers = read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_metadata_proxy_status_0(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_status_0_with_http_info(metadata_proxy_id, opts)\n data\n end",
"def read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts = {})\n if @api_client.config.debugging\n ... | [
"0.72399455",
"0.6702983",
"0.65566075",
"0.6365063",
"0.6028542",
"0.6007418",
"0.59904766",
"0.59862214",
"0.5950217",
"0.5894908",
"0.5786421",
"0.57438207",
"0.5683461",
"0.5677034",
"0.567392",
"0.56736684",
"0.5625396",
"0.5617031",
"0.5615506",
"0.5607354",
"0.5604845"... | 0.75380427 | 0 |
Get metadata proxy status Get metadata proxy status | def read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesMetadataProxyStatusApi.read_metadata_proxy_status ...'
end
# verify the required parameter 'metadata_proxy_id... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_metadata_proxy_status(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts)\n data\n end",
"def read_metadata_proxy_status_0(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_st... | [
"0.75380427",
"0.72399455",
"0.65566075",
"0.6365063",
"0.6028542",
"0.6007418",
"0.59904766",
"0.59862214",
"0.5950217",
"0.5894908",
"0.5786421",
"0.57438207",
"0.5683461",
"0.5677034",
"0.567392",
"0.56736684",
"0.5625396",
"0.5617031",
"0.5615506",
"0.5607354",
"0.5604845... | 0.6702983 | 2 |
Get metadata proxy status Get metadata proxy status | def read_metadata_proxy_status_0(metadata_proxy_id, opts = {})
data, _status_code, _headers = read_metadata_proxy_status_0_with_http_info(metadata_proxy_id, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_metadata_proxy_status(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts)\n data\n end",
"def read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts = {})\n if @api_client.config.debugging\n ... | [
"0.7539077",
"0.6702792",
"0.6556298",
"0.63644993",
"0.6029089",
"0.6008634",
"0.59909755",
"0.59859115",
"0.5949829",
"0.5895641",
"0.57845306",
"0.57442886",
"0.5682534",
"0.5677839",
"0.56726944",
"0.56724775",
"0.56259006",
"0.5615592",
"0.5614066",
"0.56077486",
"0.5603... | 0.72408056 | 1 |
Get metadata proxy status Get metadata proxy status | def read_metadata_proxy_status_0_with_http_info(metadata_proxy_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesMetadataProxyStatusApi.read_metadata_proxy_status_0 ...'
end
# verify the required parameter 'metadata_prox... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_metadata_proxy_status(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_status_with_http_info(metadata_proxy_id, opts)\n data\n end",
"def read_metadata_proxy_status_0(metadata_proxy_id, opts = {})\n data, _status_code, _headers = read_metadata_proxy_st... | [
"0.75380427",
"0.72399455",
"0.6702983",
"0.6365063",
"0.6028542",
"0.6007418",
"0.59904766",
"0.59862214",
"0.5950217",
"0.5894908",
"0.5786421",
"0.57438207",
"0.5683461",
"0.5677034",
"0.567392",
"0.56736684",
"0.5625396",
"0.5617031",
"0.5615506",
"0.5607354",
"0.5604845"... | 0.65566075 | 3 |
GET /submissions GET /submissions.json | def index
if params.key? :assignment_id
@submissions = Submission.where(assignment_id: params[:assignment_id])
else
@submissions = Submission.where(user_id: current_user.id)
end
if @submissions.is_a?(FalseClass)
@submissions = []
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @submissions = Contests.get_contest_submissions(params[:id])\n unless @submissions.nil?\n render json: @submissions\n return\n end\n end",
"def index\n @submissions = Submission.all\n end",
"def index\n @submissions = Submission.all\n end",
"def index\n @submissions ... | [
"0.76500607",
"0.70762527",
"0.70762527",
"0.70762527",
"0.70762527",
"0.7048374",
"0.67152554",
"0.67048156",
"0.67044914",
"0.67044914",
"0.6643374",
"0.65846646",
"0.65773135",
"0.6516428",
"0.6496505",
"0.6439337",
"0.64390016",
"0.64051247",
"0.64051247",
"0.6393608",
"0... | 0.6354381 | 22 |
GET /submissions/1 GET /submissions/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @submissions = Contests.get_contest_submissions(params[:id])\n unless @submissions.nil?\n render json: @submissions\n return\n end\n end",
"def show\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json {... | [
"0.75976753",
"0.69953114",
"0.69953114",
"0.6980844",
"0.68887013",
"0.68887013",
"0.68887013",
"0.68887013",
"0.6793104",
"0.6693824",
"0.65924597",
"0.65682155",
"0.65682155",
"0.6524869",
"0.6435726",
"0.6354281",
"0.634649",
"0.6322576",
"0.63194156",
"0.63111156",
"0.63... | 0.0 | -1 |
POST /submissions POST /submissions.json | def create
# TODO: Make sure user can have multiple submissions per assignment
uploader = AttachmentUploader.new
uploader.store! params[:submission][:subm_file]
#TODO: REPLACE WITH CURRENT USER
@submission = Submission.new(course_id: params[:course_id].to_i, user_id: current_user.id)
@submission... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @submission = Submission.new(:student_id => current_student.id, :assignment_id => params[:assignment_id])\n\n respond_to do |format|\n if @submission.save\n @assignment = @submission.assignment\n @assignment.questions.each do |question| \n answer = SubmittedAnswer.new... | [
"0.6623204",
"0.642875",
"0.6398464",
"0.6364947",
"0.6286592",
"0.62701714",
"0.6255137",
"0.62333924",
"0.62277746",
"0.6220439",
"0.61854404",
"0.61780053",
"0.61623746",
"0.61426646",
"0.6131754",
"0.61310446",
"0.6130297",
"0.6064885",
"0.6064885",
"0.6064885",
"0.606488... | 0.0 | -1 |
PATCH/PUT /submissions/1 PATCH/PUT /submissions/1.json | def update
old_ta_id = @submission.ta.id
if(! params[:submission][:subm_file].nil?)
uploader = AttachmentUploader.new
uploader.store! params[:submission][:subm_file]
byebug
UploadIndividualZipFileJob.perform_later uploader.filename,@submission.assignment.id
else
puts "NO FILE"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_submission\n id = unsafe_params[:id].to_i\n fail \"id needs to be an Integer\" unless id.is_a?(Integer)\n\n title = unsafe_params[:title]\n fail \"title needs to be a String\" unless title.is_a?(String)\n\n content = unsafe_params[:content] || \"\"\n fail \"content needs to be a String... | [
"0.6564178",
"0.6548657",
"0.64544123",
"0.63710743",
"0.6354202",
"0.63161224",
"0.6312707",
"0.6283423",
"0.6273181",
"0.6200182",
"0.6190547",
"0.6190547",
"0.61844087",
"0.6153101",
"0.6147042",
"0.60542566",
"0.6039832",
"0.6017421",
"0.59923583",
"0.59824324",
"0.596260... | 0.0 | -1 |
DELETE /submissions/1 DELETE /submissions/1.json | def destroy
@submission.destroy
respond_to do |format|
format.html { redirect_to submissions_url, notice: 'Submission was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n Submission.find(params[:id]).destroy\n redirect_to '/submissions'\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n ... | [
"0.7630916",
"0.7599591",
"0.7599591",
"0.7599591",
"0.75543237",
"0.75543237",
"0.75542164",
"0.73203903",
"0.72502047",
"0.7228872",
"0.7178442",
"0.7151294",
"0.71501744",
"0.71501744",
"0.71501744",
"0.70832145",
"0.6992959",
"0.69806916",
"0.6939897",
"0.692701",
"0.6915... | 0.7266821 | 14 |
Use callbacks to share common setup or constraints between actions. | def set_submission
@submission = Submission.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.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def submission_params
params.require(:submission).permit(:ta_id, :subm_file, :tests_passed, :total_tests, :ta_grade, :is_valid, :late_penalty, :final_grade_override, :ta_comment, :comment_override)
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.6980629",
"0.67819995",
"0.67467666",
"0.67419875",
"0.67347664",
"0.65928614",
"0.6504013",
"0.6498014",
"0.64819515",
"0.64797956",
"0.64562726",
"0.64400834",
"0.6380117",
"0.6377456",
"0.63656694",
"0.6320543",
"0.63002014",
"0.62997127",
"0.629425",
"0.6293866",
"0.62... | 0.0 | -1 |
play the given minefield | def play(minefield)
raise 'Already playing a game!' unless @minefield.nil?
setup(minefield)
DISPLAY.call @minefield
reveal @minefield.cell_at(@minefield.first_click)
won = play_out
DISPLAY.call @minefield
clean_up
won
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def play\n end",
"def play\n \n end",
"def play\n end",
"def play\n end",
"def play\n end",
"def play\n end",
"def play \n end",
"def play; end",
"def play\n\tend",
"def play()\n @ole.Play()\n end",
"def play()\n @ole.Play()\n end",
"def play(cmd)\n play_game(cm... | [
"0.67219675",
"0.6679637",
"0.6660084",
"0.6660084",
"0.6660084",
"0.6660084",
"0.6625272",
"0.6624288",
"0.6590247",
"0.65253365",
"0.65253365",
"0.64663064",
"0.6407053",
"0.63746184",
"0.6370903",
"0.63361067",
"0.6231921",
"0.6226364",
"0.6183158",
"0.61709124",
"0.613323... | 0.82539606 | 0 |
implementations of Player should overwrite the methods below as appropriate setup and clean_up should call super triggered when the minefield successfully reveals a cell, either from a chosen move or cascading reveal | def notify_revealed(cell); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_ok\n $game_party.menu_actor = $game_party.member_at_position(index)\n super\n end",
"def process_ok\r\n super\r\n $game_party.menu_actor = $game_party.members[index]\r\n end",
"def update args\n\n\t\t# Normalise the mouse position to the board origin\n\t\tmouse_x = ( ( args.inputs.mou... | [
"0.6041733",
"0.59518564",
"0.5926868",
"0.59072644",
"0.58557737",
"0.5741557",
"0.57404876",
"0.5740364",
"0.5736689",
"0.5729704",
"0.5695421",
"0.56811666",
"0.56755304",
"0.56458676",
"0.561616",
"0.56112945",
"0.5588813",
"0.5587527",
"0.55684525",
"0.5532685",
"0.55288... | 0.60903883 | 0 |
triggered when the minefield successfully flags a cell | def notify_flagged(cell); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flag(cell)\n announce_flag(cell)\n @minefield.flag(cell)\n end",
"def notify_unflagged(_cell); end",
"def notify_revealed(cell); end",
"def reveal(cell)\n if cell.flagged?\n DISPLAY.call 'Attempted to reveal flagged cell.'\n else\n announce_reveal(cell)\n @minefield.reveal(cel... | [
"0.79594874",
"0.78503776",
"0.7320118",
"0.6466359",
"0.6391403",
"0.6250907",
"0.60933024",
"0.60298896",
"0.59394836",
"0.57731193",
"0.56705064",
"0.55795455",
"0.55625176",
"0.5519948",
"0.5516058",
"0.54158366",
"0.5415737",
"0.540939",
"0.5369777",
"0.536181",
"0.53556... | 0.82341874 | 0 |
triggered when the minefield successfully removes a flag from a cell | def notify_unflagged(_cell); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unflag(cell)\n announce_unflag(cell)\n @minefield.unflag(cell)\n end",
"def notify_flagged(cell); end",
"def notify_revealed(cell); end",
"def flag(cell)\n announce_flag(cell)\n @minefield.flag(cell)\n end",
"def remove_message_reaction(data); end",
"def unflag_map(row,col)\n row... | [
"0.77274156",
"0.69934934",
"0.6437458",
"0.6340429",
"0.62076235",
"0.5987048",
"0.59123737",
"0.59123737",
"0.5905831",
"0.58722323",
"0.5804977",
"0.5782575",
"0.5781487",
"0.5673424",
"0.56443584",
"0.5614325",
"0.5592169",
"0.55727804",
"0.5556861",
"0.5545629",
"0.55424... | 0.7917868 | 0 |
get the player's first click choice, otherwise random to be implemented by children | def choose_first_click; end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choose_first\n num = 1 + rand(2)\n puts \"Player #{num} will start the game.\"\n if num == 1\n @current_player = @player1\n else\n @current_player = @player2\n end\n end",
"def select_first_player\n \t\t\tprint \"Do you want to play first? <y/n>: \"\n \t\t\tans = gets.chomp\n \t\... | [
"0.6954909",
"0.65208364",
"0.6510156",
"0.65031403",
"0.6415795",
"0.63135874",
"0.6305068",
"0.6264559",
"0.6229886",
"0.62092674",
"0.62047714",
"0.6192668",
"0.6138993",
"0.6107058",
"0.60633546",
"0.6053132",
"0.60490704",
"0.6042775",
"0.6031021",
"0.60290813",
"0.60089... | 0.7288112 | 0 |
keep making moves until the game is won or lost, return true if won, else false | def play_out
begin
make_move(choose_move) until @minefield.clear?
DISPLAY.call 'Victory!'
rescue TrippedMineError
DISPLAY.call 'Boom!'
return false
end
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def winning_state_for_next_move?\n # for each possible move that could be made:\n # return true if the move leaves a losing_state_for_next_move for the opponent\n # else\n # false\n # end\n\n\n # a player can win with one move\n # / there is a move that makes true losing_state_for_next_mov... | [
"0.7848727",
"0.7747456",
"0.7628928",
"0.76255745",
"0.7565044",
"0.75092584",
"0.74900824",
"0.7485984",
"0.7482511",
"0.7367314",
"0.7353571",
"0.73469496",
"0.732731",
"0.7327002",
"0.7322305",
"0.7306189",
"0.7302837",
"0.7273839",
"0.7263409",
"0.7249934",
"0.72465056",... | 0.73593444 | 10 |
choose the next cell to reveal or flag/unflag | def choose_move
raise 'No strategy defined.'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_next!\n pane.next_row!\n end",
"def reveal(cell)\n if cell.flagged?\n DISPLAY.call 'Attempted to reveal flagged cell.'\n else\n announce_reveal(cell)\n @minefield.reveal(cell)\n end\n end",
"def reveal!\n raise Errors::CellAlreadyRevealedError, \"(#{row}, #{co... | [
"0.67753917",
"0.6697289",
"0.6304738",
"0.6257309",
"0.6152426",
"0.59906447",
"0.5978573",
"0.590787",
"0.58962226",
"0.5883271",
"0.57850677",
"0.57790756",
"0.5775234",
"0.5730875",
"0.57155055",
"0.569559",
"0.56750065",
"0.5652781",
"0.562659",
"0.5570698",
"0.5565859",... | 0.0 | -1 |
initialize the game state | def setup(minefield)
raise 'Expected a minefield' unless minefield.is_a? Minefield
@minefield = minefield
@minefield.player = self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def game_init\r\n state(0)\r\n @game_deck.create_new_deck\r\n @player_deck = {}\r\n @dealer_deck = {}\r\n @player.points = 0\r\n @dealer.points = 0\r\n end",
"def init\n\t\t@state = NewGame.new(self)\n\t\t# Deck.create({:game => self})\n\tend",
"def initialize_game\n setup_boards\n end",... | [
"0.7867461",
"0.78388554",
"0.7508804",
"0.73246217",
"0.72743744",
"0.7221427",
"0.7052342",
"0.70269734",
"0.7003303",
"0.6965827",
"0.69133604",
"0.6901751",
"0.6894773",
"0.6881919",
"0.6830666",
"0.6825925",
"0.68258077",
"0.68009025",
"0.67937905",
"0.6790595",
"0.67867... | 0.0 | -1 |
reset the player state to prepare for a new game | def clean_up
@minefield = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resetStates()\r\n @players.each do |player|\r\n if(player.money > 0)\r\n player.state = \"fine\"\r\n else\r\n player.state = \"broke\"\r\n end\r\n end\r\n end",
"def reset_game\n @cur_board.clear_board\n @cur_board.setup_board\n @turn = 1\n @pla... | [
"0.7885988",
"0.7850358",
"0.7657899",
"0.7657899",
"0.75944364",
"0.7444744",
"0.73460233",
"0.7324274",
"0.7273212",
"0.7099688",
"0.7090766",
"0.7074044",
"0.70707935",
"0.7034256",
"0.7009556",
"0.6934664",
"0.6934172",
"0.6898896",
"0.68376625",
"0.6819613",
"0.6748294",... | 0.0 | -1 |
end of methods to be overwritten, the ones below should be left alone "click" a cell | def reveal(cell)
if cell.flagged?
DISPLAY.call 'Attempted to reveal flagged cell.'
else
announce_reveal(cell)
@minefield.reveal(cell)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _cell_click\n render :js => handle_cell_click(param(:id).to_i, param(:table), param(:cell_column).to_i, param(:table_view))\n end",
"def click; end",
"def click; end",
"def click; end",
"def clicked;end",
"def handle_cell_click(parmid, table, cell_column, table_view)\n puts \"handle_cell_click... | [
"0.705845",
"0.6717139",
"0.6717139",
"0.6717139",
"0.65875113",
"0.65466315",
"0.62830603",
"0.62583625",
"0.6258019",
"0.625145",
"0.6169525",
"0.6090879",
"0.60745543",
"0.60648865",
"0.60524017",
"0.60178506",
"0.5981383",
"0.5964036",
"0.5944815",
"0.59387845",
"0.59351"... | 0.0 | -1 |
mark a cell as a mine without revealing it | def flag(cell)
announce_flag(cell)
@minefield.flag(cell)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reveal!\n raise Errors::CellAlreadyRevealedError, \"(#{row}, #{col})\" if revealed?\n\n @revealed = true\n\n raise Errors::MineFoundError, \"Mine found error\" if mine?\n\n revealed_cells = [self]\n\n neighbor_cells.each do |neighbor|\n if !neighbor.revealed? && neighbor.neighbors_count.zer... | [
"0.6589091",
"0.6587632",
"0.64652306",
"0.6464735",
"0.6450735",
"0.64504963",
"0.64453053",
"0.64024955",
"0.63952374",
"0.63385165",
"0.6334877",
"0.630451",
"0.6287878",
"0.6245401",
"0.62233305",
"0.62177235",
"0.6216957",
"0.6167877",
"0.61188114",
"0.61093795",
"0.6080... | 0.7020082 | 0 |
unmark a cell as a mine so it can be revealed | def unflag(cell)
announce_unflag(cell)
@minefield.unflag(cell)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def notify_unflagged(_cell); end",
"def uncover(row,col)\n @mine_field[:cover][col][row] = true\n end",
"def clear_at(cell)\n coordinate = @board_map.fetch(cell)\n set_cell(coordinate[0],coordinate[1],cell)\n end",
"def unflag(x:, y:)\n cell = load_flagged_cell(x, y)\n\n return invalid... | [
"0.7013518",
"0.6574257",
"0.6517906",
"0.6423218",
"0.6325935",
"0.6231294",
"0.6176795",
"0.6175955",
"0.6055423",
"0.59993696",
"0.58658487",
"0.5862383",
"0.58622974",
"0.58389515",
"0.58249766",
"0.57931024",
"0.57817686",
"0.5776978",
"0.5764017",
"0.5758479",
"0.574635... | 0.7994958 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_comment_and_post
@comment = Comment.find(params[:id])
@post = @comment.post
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.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def comment_params
params.require(:comment).permit(:user_id, :post_id, :text).merge(user_id: current_user.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 |
Return actual amount of children | def actual_amount
children.length
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def number_of_children\n @children.size\n end",
"def num_children\n @children.size\n end",
"def total_child_count\n count = 0\n self.apply_to_children { |e| count += 1 }\n count\n end",
"def num_children\n count = 0\n self.children.each do |child|\n count ... | [
"0.9040129",
"0.90040296",
"0.8920797",
"0.8914057",
"0.86847097",
"0.8658812",
"0.8636678",
"0.847992",
"0.83032936",
"0.82751006",
"0.81959474",
"0.8010028",
"0.7958026",
"0.7948688",
"0.7896063",
"0.7886896",
"0.7871078",
"0.78127354",
"0.76365745",
"0.7608121",
"0.7597381... | 0.87421334 | 4 |
Return user firendly children message | def _children
expected_amount == 1 ? 'child' : 'children'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parent_message\n end",
"def users_messaged_by\r\n self.users_who_messaged_me\r\n end",
"def users_messaged_by\r\n self.users_who_messaged_me\r\n end",
"def child_replies\n Reply.find_by_parent_id(self.id) \n end",
"def messages\n @zk.children(full_queue_pa... | [
"0.6780739",
"0.6074413",
"0.6074413",
"0.59721106",
"0.59522593",
"0.591914",
"0.58672446",
"0.5798583",
"0.5779827",
"0.57445776",
"0.5697241",
"0.5697241",
"0.5697241",
"0.5697241",
"0.5697241",
"0.5697241",
"0.5697241",
"0.5697241",
"0.5697241",
"0.5697241",
"0.5697241",
... | 0.52450264 | 76 |
Return exception error message | def message
"Node type: #{type.inspect} is unknown"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error_message(e)\n fail e\n end",
"def error_message\n error.message\n end",
"def error_msg\n name\n end",
"def exception_message\n @e_m ||= @exception.nil? ? '' : @exception.message\n end",
"def formatted_exception\n @exception && \"#{@exception.class.nam... | [
"0.7995215",
"0.7887877",
"0.7685458",
"0.75760376",
"0.7563234",
"0.75499",
"0.7510935",
"0.74975246",
"0.7448631",
"0.7337919",
"0.7324001",
"0.73115206",
"0.72878784",
"0.72611505",
"0.72232485",
"0.72136",
"0.71978414",
"0.71786046",
"0.7139781",
"0.7128839",
"0.71082747"... | 0.0 | -1 |
Checks if the deleted paragraph is a winner, and if so, removes the winning id from the scene. | def paragraph_cleanup
if self.scene.winner_id == self.id
self.scene.winner_id = nil
self.scene.save
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_game_question\n Graphics.transition\n # Message break prevention\n Graphics.update while Input.press?(:B)\n scene = $scene\n $scene = self\n message = text_get(25, 18)\n oui = text_get(25, 20)\n non = text_get(25, 21)\n # Delete the game ?\n c = display_... | [
"0.6309667",
"0.5980342",
"0.56773543",
"0.5645866",
"0.5623821",
"0.54404795",
"0.5428984",
"0.54192054",
"0.54021645",
"0.53946483",
"0.53899825",
"0.5374033",
"0.5369147",
"0.5359994",
"0.53426754",
"0.53339994",
"0.53273207",
"0.52825624",
"0.52691936",
"0.5247158",
"0.52... | 0.7869686 | 0 |
GET /unit_names GET /unit_names.json | def index
@unit_names = UnitName.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def foods_units\n get('/foods/units.json')\n end",
"def units\n @units = Item.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units += Detail.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units = @uni... | [
"0.67171276",
"0.6665784",
"0.65687925",
"0.64807665",
"0.63679457",
"0.61477584",
"0.61115587",
"0.6089647",
"0.60801506",
"0.6066165",
"0.6058563",
"0.6058563",
"0.6058563",
"0.6058563",
"0.6058563",
"0.6058563",
"0.60177016",
"0.600261",
"0.5972747",
"0.59563327",
"0.59431... | 0.7410414 | 0 |
GET /unit_names/1 GET /unit_names/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @unit_names = UnitName.all\n end",
"def foods_units\n get('/foods/units.json')\n end",
"def units\n @units = Item.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units += Detail.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{pa... | [
"0.7172158",
"0.67093796",
"0.6585225",
"0.6540931",
"0.63406086",
"0.6323143",
"0.6323143",
"0.6323143",
"0.6284665",
"0.6259523",
"0.61602986",
"0.6109968",
"0.60829794",
"0.6016631",
"0.6016631",
"0.6016631",
"0.6016631",
"0.6016631",
"0.6016631",
"0.6002752",
"0.5988631",... | 0.0 | -1 |
POST /unit_names POST /unit_names.json | def create
@unit_name = UnitName.new(unit_name_params)
respond_to do |format|
if @unit_name.save
format.html { redirect_to @unit_name, notice: 'Unit name was successfully created.' }
format.json { render action: 'show', status: :created, location: @unit_name }
else
format.ht... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @unit = Unit.new(unit_params)\n @unit.name = @unit.name.downcase\n\n respond_to do |format|\n if @unit.save\n format.html { redirect_to new_food_path, notice: 'Unit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @unit }\n ... | [
"0.65744084",
"0.6495897",
"0.643464",
"0.61366785",
"0.607717",
"0.6038366",
"0.6028151",
"0.5977996",
"0.5977996",
"0.59019667",
"0.5867705",
"0.58253765",
"0.58035034",
"0.5793531",
"0.5733568",
"0.5714199",
"0.5690144",
"0.5685571",
"0.56440556",
"0.56440556",
"0.56302726... | 0.68981934 | 0 |
PATCH/PUT /unit_names/1 PATCH/PUT /unit_names/1.json | def update
respond_to do |format|
if @unit_name.update(unit_name_params)
format.html { redirect_to @unit_name, notice: 'Unit name was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @unit_name... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n query = {\n 'name' => params[:name]\n }\n response = HTTParty.put(url, :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n redirect_to unit_path(params[:id... | [
"0.71968645",
"0.70905435",
"0.6697151",
"0.66415036",
"0.6593448",
"0.65784234",
"0.646448",
"0.6452987",
"0.6271243",
"0.6252786",
"0.6235664",
"0.618938",
"0.61822844",
"0.61753494",
"0.6137225",
"0.61348516",
"0.61305606",
"0.61184865",
"0.61141217",
"0.6098237",
"0.60792... | 0.7486782 | 0 |
DELETE /unit_names/1 DELETE /unit_names/1.json | def destroy
@unit_name.destroy
respond_to do |format|
format.html { redirect_to unit_names_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n f... | [
"0.721305",
"0.7178507",
"0.7159628",
"0.7159628",
"0.7159628",
"0.7159628",
"0.7127426",
"0.7113733",
"0.70819294",
"0.70351756",
"0.70200366",
"0.70072",
"0.700238",
"0.70009947",
"0.6962761",
"0.6838451",
"0.6831202",
"0.682109",
"0.6811545",
"0.67903996",
"0.67775756",
... | 0.79070246 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.