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 |
|---|---|---|---|---|---|---|
GET /fixtures/new GET /fixtures/new.json | def new
@competition = Competition.find(params[:competition_id])
session[:competition_id] = @competition.id
@teamsInComp = @competition.teams
@fixture = Fixture.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @fixture }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @fixture = Fixture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fixture }\n end\n end",
"def new\n @fixture = Fixture.new\n\n respond_to do |format|\n format.json { render json: @fixture }\n end\n end",
"def new\n @fix... | [
"0.80540824",
"0.80191207",
"0.75275475",
"0.68829775",
"0.6665311",
"0.66637444",
"0.6488544",
"0.6446256",
"0.64093345",
"0.6369702",
"0.6364666",
"0.6339861",
"0.6335969",
"0.6326523",
"0.63203686",
"0.63203686",
"0.63186866",
"0.63169897",
"0.63159454",
"0.6312448",
"0.62... | 0.66239846 | 6 |
POST /fixtures POST /fixtures.json | def create
id = session[:competition_id]
@competition = Competition.find(id)
@fixture = Fixture.new(params[:fixture])
@fixture.competition_id = @competition.id
respond_to do |format|
if @fixture.save
format.html { redirect_to @fixture, notice: 'Fixture was successfully created.' }
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @fixture = Fixture.new(params[:fixture])\n\n respond_to do |format|\n if @fixture.save\n format.html { redirect_to @fixture, notice: 'Fixture was successfully created.' }\n format.json { render json: @fixture, status: :created, location: @fixture }\n else\n format.... | [
"0.719821",
"0.6594596",
"0.6537704",
"0.6528066",
"0.64602804",
"0.6408171",
"0.6305111",
"0.61508787",
"0.61244607",
"0.6078216",
"0.6050461",
"0.6005518",
"0.5846979",
"0.5817523",
"0.5805031",
"0.5798595",
"0.5791832",
"0.5773946",
"0.5773946",
"0.5751946",
"0.57422394",
... | 0.65889156 | 2 |
PUT /fixtures/1 PUT /fixtures/1.json | def update
@fixture = Fixture.find(params[:id])
@fixture.winningteam.points = @fixture.winningteam.points + 3
@fixture.winningteam.save
respond_to do |format|
if @fixture.update_attributes(params[:fixture])
format.html { redirect_to @fixture, notice: 'Fixture was successfully updated.' }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @fixture = Fixture.find(params[:id])\n\n respond_to do |format|\n if @fixture.update_attributes(fixture_params)\n format.json { head :no_content }\n else\n format.json { render json: @fixture.errors, status: :unprocessable_entity }\n end\n end\n end",
"def upda... | [
"0.71988535",
"0.67752033",
"0.64817965",
"0.5934452",
"0.58486116",
"0.58486116",
"0.58411455",
"0.57906467",
"0.57505745",
"0.57367396",
"0.57068276",
"0.5705913",
"0.5686451",
"0.56673545",
"0.56348145",
"0.5613505",
"0.5567389",
"0.5540112",
"0.55179393",
"0.5504427",
"0.... | 0.591663 | 4 |
DELETE /fixtures/1 DELETE /fixtures/1.json | def destroy
@fixture = Fixture.find(params[:id])
@fixture.destroy
respond_to do |format|
format.html { redirect_to fixtures_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @fixture = Fixture.find(params[:id])\n @fixture.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @fixturestat = Fixturestat.find(params[:id])\n @fixturestat.destroy\n\n respond_to do |format|\n format.html { redirect_... | [
"0.7836846",
"0.7184197",
"0.6914058",
"0.68618053",
"0.6758956",
"0.67210346",
"0.6623227",
"0.66181767",
"0.6584474",
"0.65634257",
"0.6556558",
"0.6556558",
"0.6556558",
"0.6556558",
"0.65484494",
"0.65484494",
"0.654549",
"0.6533572",
"0.65190905",
"0.6516628",
"0.6489175... | 0.7886989 | 1 |
GET /admin/banners GET /admin/banners.json | def index
@q = Banner.ransack(params[:q])
@q.sorts = 'created_at desc' if @q.sorts.empty?
@banners = @q.result.page(params[:pagina])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index \n @banners = Banner.for_admin\n end",
"def index\n @banners = Banner.all\n end",
"def index\n @banners = Banner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banners }\n end\n end",
"def show\n render json: @banner\n end... | [
"0.8108852",
"0.78743917",
"0.78076696",
"0.7327541",
"0.71853733",
"0.7080456",
"0.70627576",
"0.6944162",
"0.69025975",
"0.68546855",
"0.68162876",
"0.6705895",
"0.6705895",
"0.6692708",
"0.6670698",
"0.6572392",
"0.65440136",
"0.6530112",
"0.6508353",
"0.6508353",
"0.65059... | 0.6164378 | 42 |
GET /admin/banners/1 GET /admin/banners/1.json | def show; end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index \n @banners = Banner.for_admin\n end",
"def index\n @banners = Banner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banners }\n end\n end",
"def index\n @banners = Banner.all\n end",
"def show\n render json: @banner\n end... | [
"0.79527175",
"0.7756957",
"0.7669884",
"0.7491584",
"0.72181374",
"0.70856833",
"0.7071232",
"0.69708157",
"0.69152826",
"0.690575",
"0.690575",
"0.6893127",
"0.6882997",
"0.68747246",
"0.68747246",
"0.687029",
"0.6866457",
"0.6860346",
"0.6774201",
"0.667136",
"0.66635954",... | 0.0 | -1 |
POST /admin/banners POST /admin/banners.json | def create
@banner = Banner.new(admin_banner_params)
@banner.bannerable_type = "Article"
@banner.bannerable_id = Article.last.id
@banner.banner_category_id = BannerCategory.last.id
respond_to do |format|
if @banner.save
format.html { redirect_to admin_banners_url, notice: 'banner was s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @banner = Banner.new(params[:banner])\n\n respond_to do |format|\n if @banner.save\n format.html { redirect_to admin_banner_path(@banner), notice: 'Banner was successfully created.' }\n format.json { render json: @banner, status: :created, location: @banner }\n else\n ... | [
"0.74635744",
"0.7447223",
"0.7077141",
"0.70681924",
"0.70153373",
"0.69113624",
"0.6844345",
"0.679873",
"0.67515785",
"0.6725247",
"0.6683063",
"0.6600474",
"0.6600474",
"0.6559309",
"0.6473947",
"0.6454881",
"0.6373234",
"0.6373234",
"0.6373124",
"0.6371926",
"0.63283855"... | 0.739213 | 2 |
PATCH/PUT /admin/banners/1 PATCH/PUT /admin/banners/1.json | def update
respond_to do |format|
if @banner.update(admin_banner_params)
format.html { redirect_to admin_banners_url, notice: 'banner was successfully updated.' }
format.json { render :show, status: :ok, location: @banner }
else
format.html { render :edit }
format.json { ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @banner = Banner.find(params[:id])\n\n respond_to do |format|\n if @banner.update_attributes(params[:banner])\n format.html { redirect_to admin_banner_path(@banner), notice: 'Banner was successfully updated.' }\n format.json { head :no_content }\n else\n format.htm... | [
"0.73753965",
"0.7346043",
"0.6960082",
"0.69146055",
"0.6847741",
"0.6736868",
"0.6724722",
"0.653085",
"0.6488504",
"0.64728147",
"0.64257014",
"0.63800484",
"0.63698864",
"0.6281641",
"0.6279423",
"0.62307936",
"0.61938846",
"0.61580807",
"0.61037034",
"0.6098754",
"0.6096... | 0.72655976 | 2 |
DELETE /admin/banners/1 DELETE /admin/banners/1.json | def destroy
respond_to do |format|
if @banner.destroy
format.html { redirect_to admin_banners_url, notice: 'banner was successfully updated.' }
format.json { render :show, status: :ok, location: @banner }
else
format.html { render :edit }
format.json { render json: @banne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banners_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |for... | [
"0.80422086",
"0.7973537",
"0.76623625",
"0.7499161",
"0.7446779",
"0.7432755",
"0.7326384",
"0.72540134",
"0.71416974",
"0.71368444",
"0.7108537",
"0.70297706",
"0.69761676",
"0.6958016",
"0.6911853",
"0.69061065",
"0.6901085",
"0.6856612",
"0.68379545",
"0.681785",
"0.68151... | 0.73600054 | 6 |
Use callbacks to share common setup or constraints between actions. | def set_admin_banner
@banner = Banner.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 admin_banner_params
params.fetch(:banner).permit!
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 |
Generates a table. Usage: | def table_for(collection, headers, options = {})
options = Defaults.get.merge options
content_tag :table, options do
concat (content_tag :thead do
content_tag :tr do
headers.map do |header|
case header
when String
concat(con... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_table(options={})\n get_table(options).rows\n end",
"def generate_table\n letters.reverse.each_with_index do |letter, index|\n row = build_row(letter, index)\n table << row\n table.unshift(row) unless index == 0\n end\n end",
"def table; end",
"def table; end",
... | [
"0.78756",
"0.7324389",
"0.7305953",
"0.7305953",
"0.7305953",
"0.7305953",
"0.7234006",
"0.7229319",
"0.71734595",
"0.7043341",
"0.6976577",
"0.697127",
"0.69556576",
"0.6955443",
"0.6941441",
"0.6919406",
"0.6910439",
"0.6907093",
"0.6889231",
"0.68786687",
"0.68685776",
... | 0.6271771 | 85 |
get the level of the entity | def level
@level || Helpers.char_level(@entity)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def level\n return @level\n end",
"def level\n return @level\n end",
"def level\n @level\n end",
"def level\n @level\n end",
"def level\n @level\n end",
"def getLevels\n @level\n end",
"def level\n parent_id.ni... | [
"0.79726076",
"0.79726076",
"0.79340446",
"0.79340446",
"0.7927716",
"0.75353867",
"0.741066",
"0.7185816",
"0.7162389",
"0.6986828",
"0.6897657",
"0.6897657",
"0.6897657",
"0.6897657",
"0.6897657",
"0.6897657",
"0.68958986",
"0.68930036",
"0.6848053",
"0.6767155",
"0.6722736... | 0.8264317 | 0 |
get the value for this field from the base entity | def base
# we're going to create a new entity from the base entities of this
# entity. We'll then patch up the base of that entity to point at the
# grandparent bases, so that we can safely iterate up the entity
# ancestry.
bases = Helpers.entity_base(@entity)
b = Helpers.create_e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value(field)\n field = item_type.find_field(field) unless field.is_a? Field\n field.value_for_item(self)\n end",
"def value\n @base_object\n end",
"def value\n @base_object\n end",
"def value\n self.send :\"#{_mapped_value_column}\"\n end",
"def field_valu... | [
"0.7145864",
"0.70280224",
"0.70280224",
"0.6742791",
"0.6742763",
"0.66471785",
"0.65001947",
"0.6465298",
"0.6464025",
"0.6406653",
"0.6397037",
"0.63950425",
"0.63834196",
"0.6377353",
"0.63353485",
"0.63078886",
"0.62755686",
"0.62418395",
"0.62028235",
"0.6181848",
"0.61... | 0.0 | -1 |
get a value from the range based on the level of the entity. Examples: level 1 entity, will get the minimum sandbox = Sandbox.new(some_level_1_entity) sandbox.by_level(13..30, max_at: 65) => 13 level 65 entity, will get the maximum sandbox = Sandbox.new(some_level_65_entity) by_level(13..30, max_at: 65) => 60 | def by_level(range, max_at:)
level >= max_at ? range.last :
range.first + (((range.size - 1)/max_at.to_f)*level).to_i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_level\n level = 0\n max_value = max_number_of_a_level(level)\n while max_value < input\n level += 1\n max_value = max_number_of_a_level(level)\n end\n level\n end",
"def min_number_of_a_level(level)\n max_number_of_a_level(level - 1) + 1\n end",
"def l... | [
"0.5949171",
"0.59003973",
"0.58338094",
"0.5762448",
"0.5692094",
"0.564824",
"0.55767345",
"0.54381406",
"0.54236424",
"0.5373478",
"0.53695464",
"0.5354873",
"0.53532916",
"0.5332896",
"0.53273714",
"0.5326451",
"0.53250384",
"0.53060937",
"0.5300951",
"0.529546",
"0.52948... | 0.73580605 | 0 |
def select_category_from_projects "SELECT category FROM projects;" end Make sure each ruby method returns a string containing a valid SQL statement. | def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name
"SELECT title, SUM(pledges.amount)
FROM projects
LEFT JOIN pledges
ON projects.id = pledges.project_id
GROUP BY title"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_category_from_projects\n\"SELECT category FROM projects;\"\nend",
"def selects_the_category_names_and_pledge_amounts_of_all_pledges_in_the_music_category\n\"SELECT projects.category, pledges.amount\nFROM pledges\nINNER JOIN projects\nON projects.id = pledges.project_id\nWHERE projects.category = 'musi... | [
"0.9197262",
"0.70678186",
"0.6989936",
"0.66513103",
"0.662253",
"0.65135354",
"0.6487179",
"0.6323825",
"0.6060308",
"0.59413064",
"0.5937617",
"0.59356964",
"0.5900855",
"0.5882159",
"0.58700216",
"0.58530766",
"0.5852864",
"0.5839607",
"0.5818678",
"0.57847345",
"0.578157... | 0.0 | -1 |
GET /proforma_invoices GET /proforma_invoices.json | def index
@proforma_invoices = ProformaInvoice.all.paginate(page: params[:page], per_page: 15)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def url\n '/api/invoices'\n end",
"def index\n @invoices = @user.invoices.all\n render json: @invoices, status: :ok\n end",
"def index\n @invoices = Invoice.all.order(invoice_date: :desc).order(created_at: :desc).paginate(:page => params[:page], per_pag... | [
"0.76411325",
"0.7532687",
"0.72262746",
"0.71031344",
"0.70964795",
"0.709242",
"0.70756775",
"0.7073139",
"0.7050229",
"0.70397776",
"0.70259356",
"0.6989803",
"0.695268",
"0.69077617",
"0.690428",
"0.690428",
"0.690428",
"0.690428",
"0.690428",
"0.690428",
"0.690428",
"0... | 0.7535783 | 1 |
GET /proforma_invoices/1 GET /proforma_invoices/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def url\n '/api/invoices'\n end",
"def index\n @proforma_invoices = ProformaInvoice.all.paginate(page: params[:page], per_page: 15)\n end",
"def index\n @invoices = @user.invoices.all\n render json: @invoices, status: :ok\n end",
"def show\n # @invo... | [
"0.73504317",
"0.7310367",
"0.7217619",
"0.719651",
"0.71180326",
"0.7116411",
"0.7042371",
"0.7031782",
"0.70224035",
"0.69992626",
"0.6947938",
"0.6817291",
"0.6814286",
"0.6793679",
"0.6793679",
"0.6764457",
"0.6764208",
"0.6701342",
"0.6644382",
"0.6634358",
"0.6614985",
... | 0.0 | -1 |
POST /proforma_invoices POST /proforma_invoices.json | def create
@proforma_invoice = ProformaInvoice.new(proforma_invoice_params)
respond_to do |format|
if @proforma_invoice.save
format.html { redirect_to @proforma_invoice, notice: 'Proforma invoice was successfully created.' }
format.json { render :show, status: :created, location: @proform... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invoice(options = nil)\n request = Request.new(@client)\n path = \"/products/\" + CGI.escape(@id) + \"/invoices\"\n data = {\n\n }\n\n response = Response.new(request.post(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = bod... | [
"0.7198768",
"0.7189938",
"0.7166846",
"0.6999084",
"0.6961364",
"0.6949848",
"0.6933863",
"0.69135267",
"0.6882092",
"0.688133",
"0.687455",
"0.68719673",
"0.68695545",
"0.6860048",
"0.6860048",
"0.6860048",
"0.6860048",
"0.6860048",
"0.6860048",
"0.6859358",
"0.68451774",
... | 0.72543013 | 0 |
PATCH/PUT /proforma_invoices/1 PATCH/PUT /proforma_invoices/1.json | def update
respond_to do |format|
if @proforma_invoice.update(proforma_invoice_params)
format.html { redirect_to @proforma_invoice, notice: 'Proforma invoice was successfully updated.' }
format.json { render :show, status: :ok, location: @proforma_invoice }
else
format.html { ren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n # @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render ... | [
"0.67713964",
"0.67509276",
"0.67506164",
"0.6733258",
"0.67018175",
"0.6658586",
"0.6658586",
"0.6656627",
"0.66541433",
"0.6649492",
"0.66357386",
"0.66357386",
"0.66202664",
"0.6618257",
"0.6599874",
"0.6597051",
"0.6597051",
"0.6597051",
"0.6597051",
"0.6597051",
"0.65970... | 0.7201345 | 0 |
DELETE /proforma_invoices/1 DELETE /proforma_invoices/1.json | def destroy
@proforma_invoice.destroy
respond_to do |format|
format.html { redirect_to proforma_invoices_url, notice: 'Proforma invoice was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n # @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice.destroy\n respond_to do |format|\n format.html { redirect_to inv... | [
"0.773613",
"0.76700675",
"0.7625277",
"0.7625277",
"0.7625277",
"0.7625277",
"0.75644755",
"0.751149",
"0.7503016",
"0.73787653",
"0.7371713",
"0.73544836",
"0.7350344",
"0.7343859",
"0.73334056",
"0.73334056",
"0.73334056",
"0.73334056",
"0.73334056",
"0.73334056",
"0.73334... | 0.76712203 | 1 |
Use callbacks to share common setup or constraints between actions. | def set_proforma_invoice
@proforma_invoice = ProformaInvoice.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 proforma_invoice_params
params.require(:proforma_invoice).permit(:supplier_name, :proforma_invoice_nos, :pfi_date)
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 |
Example dwarfdump link: UUID: 618BEB794C7F3692B140131FB983AC5E (i386) Carthage/Build/iOS/CocoaLumberjackSwift.framework/CocoaLumberjackSwift | def parse_uuids(raw_dwarfdump)
lines = raw_dwarfdump.split("\n")
uuids = lines.map { |line| line[/^UUID: ([A-Z0-9\-]+)\s+\(.*$/, 1] }
uuids.compact
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dump()\n puts \"fan_home = #@fan_home\"\n puts \"fan_bin = #@fan_bin\"\n puts \"fan_lib = #@fan_lib\"\n puts \"fan_lib_fan = #@fan_lib_fan\"\n puts \"fan_lib_java = #@fan_lib_java\"\n puts \"fan_lib_net = #@fan_lib_net\"\n puts \"fan_src = #@fan_src\"\n puts \"src_j... | [
"0.5730582",
"0.57265574",
"0.5607448",
"0.55411303",
"0.5469384",
"0.5455877",
"0.5435919",
"0.52615297",
"0.52107716",
"0.52052325",
"0.51966184",
"0.51819295",
"0.51665926",
"0.5160022",
"0.5125143",
"0.511228",
"0.5088704",
"0.5076316",
"0.5070211",
"0.503418",
"0.5030021... | 0.0 | -1 |
4. Use a loop to find the total population of the UK. | def findPopulation(country_array, country_name)
for country in country_array
if country[:name] == country_name
return country[:population]
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count_population_of_uk(collection_of_countries)\n total_population = 0\n for country in collection_of_countries\n total_population += country[:population]\n end\n return total_population\nend",
"def find_total_population(countries) #function\n population = 0\n\n for country in countries\n ... | [
"0.7660696",
"0.75137395",
"0.7508467",
"0.72938704",
"0.6260112",
"0.62388384",
"0.61952245",
"0.6168683",
"0.6071432",
"0.604099",
"0.60155666",
"0.6001408",
"0.59944355",
"0.59789056",
"0.59629565",
"0.5951854",
"0.5936532",
"0.59183395",
"0.58879244",
"0.5885958",
"0.5797... | 0.66867256 | 4 |
Loop through reader infos | def parse_reader_infos(reader_infos)
reader_infos.each do |reader_info|
process_emails(reader_info)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_metadata; end",
"def read_all(&block); end",
"def read_details\r\n read_detail while peek == 'LX'\r\n self\r\n end",
"def reader; end",
"def each\n loop do\n yield read\n end\n end",
"def __read_info_entry(entries)\n info_entry = entries.detect do |entry|\n ... | [
"0.61010504",
"0.6029258",
"0.5904671",
"0.58763546",
"0.5874986",
"0.5859304",
"0.5729247",
"0.56914437",
"0.56831217",
"0.56460977",
"0.5595918",
"0.5590657",
"0.55837286",
"0.55660754",
"0.5544503",
"0.55131406",
"0.55125004",
"0.54977953",
"0.54914814",
"0.5446467",
"0.54... | 0.6812486 | 0 |
Only process reader_infos with email enabled | def process_emails(reader_info)
notifications = reader_info.notifications
notifications.each do |notification|
case notification[:notification_type]
when "email"
send_email(reader_info) if notification[:checked]
when "internal"
send_internal(reader_info) if notification[:c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_reader_infos(reader_infos)\n reader_infos.each do |reader_info|\n process_emails(reader_info)\n end\n end",
"def inbound_email; end",
"def inbound_email; end",
"def receive_inbound_email_from_mail(**kwargs, &block); end",
"def getEmailList()\n emailListFile = File.dirname(File.dirn... | [
"0.73534703",
"0.6156041",
"0.6156041",
"0.6028833",
"0.59915054",
"0.5891854",
"0.58824575",
"0.5876469",
"0.58535504",
"0.58318716",
"0.58000135",
"0.5745092",
"0.57132256",
"0.56569386",
"0.56366575",
"0.5632966",
"0.56313246",
"0.5605277",
"0.56017774",
"0.55183536",
"0.5... | 0.72307354 | 1 |
Should be called before all laplaya based actions | def setup_laplaya
js false
@laplaya_ide_params = {}
@laplaya_ide_params['root_path'] = Rails.application.config.laplaya_root_path
@laplaya_ide_params['server_load_time'] = (Time.now.to_f*1000).to_i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def before_run; end",
"def before\n end",
"def before() ; end",
"def before\n end",
"def before\n\t\t\ttrue\n\t\tend",
"def before_dispatch(env); end",
"def before() nil ; end",
"def before; end",
"def before_setup\n # do nothing by default\n end",
"def before_setup; end",
"de... | [
"0.75197774",
"0.747735",
"0.73339885",
"0.72717935",
"0.7237489",
"0.72199386",
"0.72043777",
"0.7185947",
"0.716202",
"0.709901",
"0.70572",
"0.69453233",
"0.68918985",
"0.6841716",
"0.6815036",
"0.68096143",
"0.67532635",
"0.66824013",
"0.6655976",
"0.662792",
"0.6607735",... | 0.0 | -1 |
Should be used whenever we are loading a specific file | def force_no_trailing_slash
force_slash :noslash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(file_path); end",
"def load(file_path); end",
"def load_file(file); end",
"def load_file(filename); end",
"def load_file(filename); end",
"def load(file); end",
"def load_path; end",
"def load(path); end",
"def load(filename)\n end",
"def load(filename)\n\t\tend",
"def load; end",
... | [
"0.7884816",
"0.7884816",
"0.7824399",
"0.7793823",
"0.7793823",
"0.7698388",
"0.7550409",
"0.7530879",
"0.74689513",
"0.74294126",
"0.73187137",
"0.73187137",
"0.73187137",
"0.72594774",
"0.7189131",
"0.71475273",
"0.7068314",
"0.7061112",
"0.70600665",
"0.7038237",
"0.70155... | 0.0 | -1 |
Should be used whenever we are loading an empty sandbox | def force_trailing_slash
force_slash :slash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sandbox; end",
"def sandbox; end",
"def sandbox?; end",
"def sandbox?; end",
"def sandbox\n @sandbox ||= File.expand_path \"tmp/sandbox\"\nend",
"def disable_sandbox; end",
"def disable_sandbox; end",
"def prepare_sandbox\n clear_sandbox\n FileUtils.mkdir_p sandbox\nend",
"def has_sandbox?\n... | [
"0.7747646",
"0.7747646",
"0.7693678",
"0.7693678",
"0.71018314",
"0.6956953",
"0.6956953",
"0.6868477",
"0.6812221",
"0.64450735",
"0.64032245",
"0.6347965",
"0.6347965",
"0.633081",
"0.6285576",
"0.6285576",
"0.62802994",
"0.6279732",
"0.6252904",
"0.61539334",
"0.6153216",... | 0.0 | -1 |
we will come back to this | def starts_with_consonant? s
cond1 = /[[:alpha:]]/ =~ s
cond2 = /[^aeiouAEIOU]/ =~ s
if cond1 != 0
return false
else
if cond2 == 0
return true
else
return false
end
end
return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reap; end",
"def finish()\n #This is a stub, used for indexing\n end",
"def remaining; end",
"def keep_going; end",
"def resets; end",
"def handle_backtrack\n\t\tend",
"def leave; end",
"def retire\n\n end",
"def end\n end",
"def celebration; end",
"def finished; e... | [
"0.6621124",
"0.6605272",
"0.6519077",
"0.65007234",
"0.64177793",
"0.6373343",
"0.6306013",
"0.6272823",
"0.6242714",
"0.6153459",
"0.6113302",
"0.61101276",
"0.61065197",
"0.6099223",
"0.6079954",
"0.6079954",
"0.6079954",
"0.6079954",
"0.6079954",
"0.6079954",
"0.6079954",... | 0.0 | -1 |
Stubs out RefernetService class with fake API responses | def stub_refernet_service(*methods)
# Categories
allow_any_instance_of(RefernetService)
.to receive(:get_categories)
.and_return(REFERNET_RESPONSES[:categories])
# SubCategories
allow_any_instance_of(RefernetService)
.to receive(:get_sub_categories)
.with("T... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stub_responses\n Creditsafe::Api::DummyResponse.new\n end",
"def stub_service(name, status: 200, method: nil, headers: {}, with: nil, response_body: nil, response_fixture: nil)\n service = SERVICES.fetch(name)\n raise \"No service #{name}\" unless service.present?\n\n response_body = loa... | [
"0.6653624",
"0.64720184",
"0.64572275",
"0.6429516",
"0.61352664",
"0.6059821",
"0.6059821",
"0.5989482",
"0.5933021",
"0.5908673",
"0.5908296",
"0.5893979",
"0.5848756",
"0.5841232",
"0.58268625",
"0.58115685",
"0.57649934",
"0.57558495",
"0.57434106",
"0.5733148",
"0.57270... | 0.72821665 | 0 |
GET /resources GET /resources.json | def index
@lesson_plans = LessonPlan.includes(:lesson).order("lessons.unit_id, lessons.number").all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resources\n @resources\n end",
"def index\n @resources = Resource.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resources }\n end\n end",
"def resources\n @resources ||= process_data(decoded_body[resources_key])\n end",
... | [
"0.73260355",
"0.7318418",
"0.73032725",
"0.7268941",
"0.7259738",
"0.72570455",
"0.72257876",
"0.7176583",
"0.7119785",
"0.71015924",
"0.70855975",
"0.7081732",
"0.6995291",
"0.6992412",
"0.6984025",
"0.6984025",
"0.6984025",
"0.6973065",
"0.6973065",
"0.6973065",
"0.6959983... | 0.0 | -1 |
GET /resources/1 GET /resources/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @resource = Resource.find(params[:id])\n render json: @resource, status: 200\n end",
"def show\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resource }\n end\n end",
"def show\n ... | [
"0.7515277",
"0.7052293",
"0.7052293",
"0.7042287",
"0.7025744",
"0.7019292",
"0.69824135",
"0.6886918",
"0.6866278",
"0.678798",
"0.6774099",
"0.6736506",
"0.6728263",
"0.6728263",
"0.6728263",
"0.66987556",
"0.66502416",
"0.66417676",
"0.6598396",
"0.65546304",
"0.65453637"... | 0.0 | -1 |
POST /resources POST /resources.json | def create
@lesson_plan = LessonPlan.new(lesson_plan_params)
respond_to do |format|
if @lesson_plan.save
format.html { redirect_to @lesson_plan, notice: 'Lesson plan was successfully created.' }
format.json { render action: 'show', status: :created, location: @lesson_plan }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @resource = current_admin.resources.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render action: 'show', status: :created, location: @resource }\n e... | [
"0.6782017",
"0.67154324",
"0.6590601",
"0.6579788",
"0.65671504",
"0.6551243",
"0.65447736",
"0.6438797",
"0.64352286",
"0.638871",
"0.6339702",
"0.6252932",
"0.62459856",
"0.62336427",
"0.6231247",
"0.6231247",
"0.62027365",
"0.6188406",
"0.6179404",
"0.6164853",
"0.6144263... | 0.0 | -1 |
PATCH/PUT /resources/1 PATCH/PUT /resources/1.json | def update
respond_to do |format|
if @lesson_plan.update(lesson_plan_params)
format.html { redirect_to @lesson_plan, notice: 'Lesson plan was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update!(**args)\n @resources = args[:resources] if args.key?(:resources)\n end",
"def update!(**args)\n @resources = args[:resources] if args.key?(:resources)\n end",
"def update\n respond_to do |format|\n if @api_v1_resource.update(api_v1_resource_params)\n f... | [
"0.6933328",
"0.6933328",
"0.67063934",
"0.6605271",
"0.65987694",
"0.65987694",
"0.65860564",
"0.65738136",
"0.6445397",
"0.6362907",
"0.63622504",
"0.63450414",
"0.6310965",
"0.6309866",
"0.62898445",
"0.6253725",
"0.6250437",
"0.6239266",
"0.6235374",
"0.62342703",
"0.6227... | 0.0 | -1 |
DELETE /resources/1 DELETE /resources/1.json | def destroy
@lesson_plan.destroy
respond_to do |format|
format.html { redirect_to lesson_plans_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @api_v1_resource.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @resource = Resource.find(params[:id])\n @resource.destroy\n... | [
"0.752646",
"0.747283",
"0.747283",
"0.747283",
"0.747283",
"0.7412341",
"0.7351312",
"0.7316791",
"0.7316791",
"0.7298273",
"0.7298273",
"0.7267741",
"0.72379947",
"0.71972245",
"0.71972245",
"0.71972245",
"0.7175858",
"0.70818",
"0.70397365",
"0.70397365",
"0.70397365",
"... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_resource
@lesson_plan = LessonPlan.includes(:lesson).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 lesson_plan_params
params.require(:lesson_plan).permit(:lesson_id, :content)
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 |
GET /entities GET /entities.json | def index
@entities = Entity.where(entity_id: nil)
@entity = Entity.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entities\n return bad_request unless params[:id] and request.format.json? || request.format.js?\n return not_found unless current_document\n @response = {'entities' => current_document.ordered_entity_hash}\n render_cross_origin_json\n end",
"def get_entity(entity_name)\n uri = URI(@config[:se... | [
"0.7629082",
"0.7057737",
"0.70089823",
"0.6918353",
"0.690861",
"0.67363095",
"0.67363095",
"0.67092526",
"0.6573348",
"0.6537064",
"0.65149176",
"0.6476023",
"0.6476023",
"0.64672345",
"0.64437264",
"0.64116454",
"0.6381577",
"0.6378227",
"0.63459814",
"0.63120294",
"0.6306... | 0.0 | -1 |
GET /entities/1 GET /entities/1.json | def show
@parent = @entity.entity
@entities = @entity.sub_entities
@entity = Entity.new(entity_id: @entity.id)
render :index
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @entity = Entity.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entity }\n end\n end",
"def show\n @entity = Entity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n f... | [
"0.73059016",
"0.7262498",
"0.7172078",
"0.70438725",
"0.69249177",
"0.67339206",
"0.66999793",
"0.6682798",
"0.6642746",
"0.6642746",
"0.66318595",
"0.6631506",
"0.65661216",
"0.654263",
"0.6520137",
"0.6460875",
"0.6456213",
"0.645117",
"0.6424482",
"0.6377246",
"0.63651377... | 0.5883394 | 41 |
POST /entities POST /entities.json | def create
@entity = Entity.new(entity_params)
respond_to do |format|
if @entity.save
format.html { redirect_to @entity.entity ? @entity.entity : entities_path, notice: 'Entity was successfully created.' }
format.json { render :show, status: :created, location: @entity }
else
@e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(entity)\n post(resource_path_for_entity(entity), entity.to_json)\n end",
"def create(options)\n API::request(:post, 'entities', options)\n end",
"def create\n @entity = Entity.new(params[:entity])\n\n respond_to do |format|\n if @entity.save\n format.html { redirect... | [
"0.6795084",
"0.6658709",
"0.64463085",
"0.62647",
"0.62327075",
"0.6167029",
"0.6081216",
"0.6039084",
"0.6016947",
"0.59644383",
"0.59453404",
"0.5940503",
"0.59323305",
"0.5928325",
"0.58773166",
"0.5876597",
"0.5863562",
"0.5782515",
"0.57802844",
"0.57796234",
"0.5769725... | 0.6596827 | 2 |
PATCH/PUT /entities/1 PATCH/PUT /entities/1.json | def update
respond_to do |format|
if @entity.update(entity_params)
format.html { redirect_to @entity.entity ? @entity.entity : entities_path, notice: 'Entity was successfully updated.' }
format.json { render :show, status: :ok, location: @entity }
else
format.html { render :edit ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n begin\n @resource = Entity.find params[:id]\n @resource.update_attributes! params[:entity]\n render :response => :PUT\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n end",
"def update(entity)\n entity_id = get_id(enti... | [
"0.6944973",
"0.6892469",
"0.6865145",
"0.67200565",
"0.670368",
"0.6605927",
"0.6563776",
"0.64312565",
"0.64165497",
"0.64083856",
"0.6376142",
"0.634363",
"0.63354653",
"0.62961775",
"0.6290086",
"0.6288887",
"0.62690896",
"0.62617093",
"0.622574",
"0.62241966",
"0.6223434... | 0.66701865 | 5 |
DELETE /entities/1 DELETE /entities/1.json | def destroy
@entity.destroy
respond_to do |format|
format.html { redirect_to entities_url, notice: 'Entity was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @entity = Entity.find(params[:id])\n @entity.destroy\n\n respond_to do |format|\n format.html { redirect_to entities_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @entity.destroy\n respond_to do |format|\n format.html { redirect_to entities_... | [
"0.7795828",
"0.7728728",
"0.7728657",
"0.7550168",
"0.7340277",
"0.7322574",
"0.7218803",
"0.7140964",
"0.7107382",
"0.70708424",
"0.70644283",
"0.7044764",
"0.7025782",
"0.6985431",
"0.69737154",
"0.69244325",
"0.6856135",
"0.6782969",
"0.67679864",
"0.67675394",
"0.6767105... | 0.73711085 | 5 |
Use callbacks to share common setup or constraints between actions. | def set_entity
@entity = Entity.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 entity_params
params.require(:entity).permit(:name, :entity_type, :entity_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.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 |
Mozilla/5.0 (Ubuntu; X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0 | def initialize
@departure_date = nil
@return_date = nil
@trip_type_string = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def some_user_agent\n \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090920 Firefox/3.5.3 (Swiftfox)\"\n end",
"def firefox\n @web_browser.firefox\n end",
"def firefox\r\n @web_browser.firefox\r\n end",
"def http_user_agent\n # User agent is required for cookie validatio... | [
"0.7206665",
"0.67410856",
"0.6699793",
"0.66971755",
"0.66687196",
"0.66687196",
"0.66687196",
"0.65844774",
"0.648178",
"0.63591313",
"0.62883",
"0.62382036",
"0.62201244",
"0.62091327",
"0.61838394",
"0.61680394",
"0.61680394",
"0.61680394",
"0.6119664",
"0.6107853",
"0.60... | 0.0 | -1 |
Returns the price value for the route | def fetch_price_result file_name
doc = Nokogiri::HTML(open(file_name))
book_elems = doc.css('h6.bold')
book_elems.each do |elem|
if elem.content == "I'm Booking"
return :route_not_supported
end
end
tables = doc.css('div.ibe_content_select_table')
#price_str = doc.css('label.medgrey').first.css(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def price\n response[\"price\"]\n end",
"def get_price\n return @data['android']['price']\n end",
"def price\n hash[\"Price\"]\n end",
"def get_price\n item_prc_1\n end",
"def price\n @price\n end",
"def price\n @price\n end",
"def price\n total\n end",
... | [
"0.71230626",
"0.7079101",
"0.7063367",
"0.6976105",
"0.69063765",
"0.69063765",
"0.68776166",
"0.6762115",
"0.67359394",
"0.6735878",
"0.6708396",
"0.6694401",
"0.6650422",
"0.66318095",
"0.66288555",
"0.6621311",
"0.65971595",
"0.6591337",
"0.6575464",
"0.6551555",
"0.64956... | 0.0 | -1 |
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength | def find
return my_arr[0][:activation_date] if length == 1
activation_date = my_sorted_arr[0][:activation_date]
i = length - 1
while i >= 1
if date_diff(my_sorted_arr[i][:activation_date], my_sorted_arr[i - 1][:deactivation_date])
activation_date = my_sorted_arr[i][:activation_date]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def probers; end",
"def implementation; end",
"def implementation; end",
"def refutal()\n end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def schubert; end",
"def strategy; end",
"def used?; end",
"def offences_by; end",
"def custo... | [
"0.7688723",
"0.63485044",
"0.63171065",
"0.63171065",
"0.6276333",
"0.6209769",
"0.6209769",
"0.6209769",
"0.6209769",
"0.6173215",
"0.6030849",
"0.5963694",
"0.5912135",
"0.5882012",
"0.5882012",
"0.586075",
"0.5852541",
"0.5852541",
"0.5840645",
"0.57902825",
"0.57716626",... | 0.0 | -1 |
GET /estados_civiles/1 GET /estados_civiles/1.xml | def show
@estados_civil = EstadosCivil.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @estados_civil }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @estados_civil = EstadosCivil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estados_civil }\n end\n end",
"def show\n @estagiarios = Estagiario.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n fo... | [
"0.6384609",
"0.63007396",
"0.6243439",
"0.6233369",
"0.6108565",
"0.6106292",
"0.6072201",
"0.60488194",
"0.60455716",
"0.6044056",
"0.6026647",
"0.602244",
"0.60201496",
"0.600281",
"0.59969014",
"0.59959817",
"0.5987328",
"0.598076",
"0.596365",
"0.59607893",
"0.59604806",... | 0.7144735 | 0 |
GET /estados_civiles/new GET /estados_civiles/new.xml | def new
@estados_civil = EstadosCivil.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @estados_civil }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @estagiarios = Estagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagiarios }\n end\n end",
"def new\n @estagio = Estagio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { rende... | [
"0.7076173",
"0.70673954",
"0.7022925",
"0.6939606",
"0.6905641",
"0.68343604",
"0.6820306",
"0.68145657",
"0.67875123",
"0.67633396",
"0.675001",
"0.6747563",
"0.67320657",
"0.6710122",
"0.6709553",
"0.66783845",
"0.66707957",
"0.66653234",
"0.66515297",
"0.66507715",
"0.664... | 0.765194 | 0 |
POST /estados_civiles POST /estados_civiles.xml | def create
@estados_civil = EstadosCivil.new(params[:estados_civil])
respond_to do |format|
if @estados_civil.save
flash[:notice] = 'EstadosCivil was successfully created.'
format.html { redirect_to(@estados_civil) }
format.xml { render :xml => @estados_civil, :status => :created... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @estados_civil = EstadosCivil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estados_civil }\n end\n end",
"def create\n \n @estacion = Estacion.new(params[:estacion])\n \n params[:estacion].delete(:colonias).each do |col|\n ... | [
"0.57646257",
"0.5572118",
"0.5357507",
"0.53177446",
"0.5298375",
"0.5258589",
"0.51651317",
"0.5137445",
"0.5117669",
"0.51053566",
"0.5094262",
"0.50898916",
"0.5072911",
"0.506866",
"0.5030776",
"0.5016825",
"0.49233416",
"0.49063718",
"0.4886507",
"0.48858535",
"0.487441... | 0.6093896 | 0 |
PUT /estados_civiles/1 PUT /estados_civiles/1.xml | def update
@estados_civil = EstadosCivil.find(params[:id])
respond_to do |format|
if @estados_civil.update_attributes(params[:estados_civil])
flash[:notice] = 'EstadosCivil was successfully updated.'
format.html { redirect_to(@estados_civil) }
format.xml { head :ok }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @estagio = Estagio.find(params[:id])\n\n respond_to do |format|\n if @estagio.update_attributes(params[:estagio])\n flash[:notice] = 'Estagio was successfully updated.'\n format.html { redirect_to(@estagio) }\n format.xml { head :ok }\n else\n format.html {... | [
"0.6291252",
"0.61211044",
"0.5944307",
"0.5831416",
"0.5811737",
"0.5768978",
"0.5765644",
"0.5756037",
"0.5752921",
"0.57453215",
"0.57366765",
"0.5711061",
"0.5707215",
"0.570642",
"0.5703609",
"0.56918496",
"0.56405294",
"0.5634313",
"0.5634303",
"0.5633903",
"0.5628394",... | 0.66835696 | 0 |
DELETE /estados_civiles/1 DELETE /estados_civiles/1.xml | def destroy
@estados_civil = EstadosCivil.find(params[:id])
@estados_civil.destroy
respond_to do |format|
format.html { redirect_to(estados_civiles_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @estacion = Estacion.find(params[:id])\n @estacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(estaciones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @estagio = Estagio.find(params[:id])\n @estagio.destroy\n\n respond_to do |form... | [
"0.6751016",
"0.67308104",
"0.6654897",
"0.66356844",
"0.66149604",
"0.6614385",
"0.64837676",
"0.6473413",
"0.64421725",
"0.6439601",
"0.6436181",
"0.6423491",
"0.64216745",
"0.64124125",
"0.6403442",
"0.6399446",
"0.6396905",
"0.63915056",
"0.63899404",
"0.63897717",
"0.638... | 0.7339474 | 0 |
wait for a REST request | def wait_on_status(jobid)
uri = URI("http://api.idolondemand.com/1/job/status/" + jobid)
uri.query = URI.encode_www_form(:apikey => $api_key)
res = Net::HTTP.get_response(uri, p_addr = $proxy_host, p_port = $proxy_port)
obj = JSON.parse(res.body)
if obj['status'] == 'queued'
puts "job [#{jobid}] #... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait\n #$_api_queue.clear\n wait_for(/>/)\nend",
"def wait_connection; end",
"def wait_connection; end",
"def wait_before_new_request\n return unless @last_request # this is the first request\n diff = Time.now - @last_request\n if diff < SECONDS_BEFORE_NEW_REQUEST\n sleep(... | [
"0.69363755",
"0.68863875",
"0.68863875",
"0.67028165",
"0.6606851",
"0.6606851",
"0.6606851",
"0.6587018",
"0.65420234",
"0.6522662",
"0.64450294",
"0.64085937",
"0.64085937",
"0.6360563",
"0.63408196",
"0.63299716",
"0.6291361",
"0.6283821",
"0.6266321",
"0.6256234",
"0.624... | 0.6307336 | 16 |
retrieve results of a job | def job_results(jobid)
wait_on_status(jobid)
puts "Retrieving results for job [#{jobid}]"
uri = URI("http://api.idolondemand.com/1/job/result/" + jobid)
uri.query = URI.encode_www_form(:apikey => $api_key)
res = Net::HTTP.get_response(uri, p_addr = $proxy_host, p_port = $proxy_port)
return JSON.parse(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def job_results(sid, options = {})\n\t\t\tresponse = connection.get do |req|\n\t\t\t\treq.url \"search/jobs/#{sid}/results\"\n\t\t\t\treq.body = options\n\t\t\tend\n\t\t\treturn_error_or_body(response, response.body)\n\t\tend",
"def job\n @job\n end",
"def job\n @job\n end",
"def job \n ... | [
"0.7127172",
"0.70274234",
"0.70274234",
"0.69777316",
"0.6931782",
"0.6925622",
"0.6895565",
"0.6795539",
"0.6749923",
"0.67425823",
"0.6652309",
"0.6628929",
"0.6611097",
"0.6590753",
"0.657865",
"0.6513372",
"0.6485492",
"0.64846337",
"0.64758456",
"0.646829",
"0.64488304"... | 0.70701504 | 1 |
POST a new job and wait for results | def iod_request (api, params)
uri = URI("http://api.idolondemand.com/1/api/async/#{api}/v1")
uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri, p_addr = $proxy_host, p_port = $proxy_port)
jobid = JSON.parse(res.body)['jobID']
puts "Post request jobid [#{jobid}]"
return job_resul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_job(job, username, password)\n puts \"Requesting quote for job:\"\n puts JSON.pretty_generate(job)\n puts \"\"\n res = post_json('jobs.json', job, username, password)\n if res['error'] || res['status'] == 'error'\n puts \"Job rejected (error #{res['status']}): #{res['error'] || res['reason']}\"\n ... | [
"0.678404",
"0.6738482",
"0.67284924",
"0.6600151",
"0.6571825",
"0.65463483",
"0.65321964",
"0.63960177",
"0.6347877",
"0.6347877",
"0.6330421",
"0.6298197",
"0.6282815",
"0.6281295",
"0.62807584",
"0.62460303",
"0.62143904",
"0.61915135",
"0.61614513",
"0.6151661",
"0.61476... | 0.0 | -1 |
Run Sentiment Analysis on a text string | def sentiment(text)
return iod_request('analyzesentiment',
{:text => text, :language => $sentiment_language, :apikey => $api_key})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exec_sentiment_analysis\n sentiment_al.call text: description\n\n create_tracking! if sentiment_al.successfully?\n end",
"def sentiment_from_text text_content:\n # [START language_sentiment_text]\n # text_content = \"Text to run sentiment analysis on\"\n\n require \"google/cloud/language\"\n\n lan... | [
"0.77574116",
"0.7387631",
"0.7005599",
"0.67901117",
"0.6691754",
"0.6638528",
"0.6619769",
"0.6547667",
"0.63030446",
"0.6295552",
"0.6238318",
"0.60722756",
"0.5914185",
"0.5901455",
"0.5900686",
"0.589595",
"0.58217925",
"0.5693476",
"0.56594574",
"0.56396914",
"0.5615467... | 0.75391555 | 1 |
Run Speech Analysis on a media asset | def speech_analysis(url)
return iod_request('recognizespeech',
{:url => url, :language => $audio_language, :apikey => $api_key})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def audio; end",
"def get_audio_samples \n send_cmd(\"get_audio_samples\")\n end",
"def main_audio ; end",
"def speech; end",
"def speech_sync_recognize audio_file_path: nil\n # [START speech_transcribe_sync]\n # audio_file_path = \"Path to file on which to perform speech recognition\"\n\n requ... | [
"0.62210804",
"0.61336136",
"0.6082836",
"0.60226464",
"0.59580183",
"0.5922859",
"0.59202564",
"0.5873062",
"0.57950866",
"0.57855606",
"0.5750631",
"0.56992346",
"0.5596896",
"0.5590469",
"0.5549433",
"0.55471784",
"0.5541527",
"0.55360085",
"0.5530841",
"0.5498868",
"0.545... | 0.67295605 | 0 |
no more skipping features, track all | def AxeDownload(download)
uri = URI('https://axeweb.intel.com/axe/api/testlist/295/latest/combined')
puts uri
req = Net::HTTP::Get.new(uri)
req.basic_auth 'autoclient', 'gr@ph1c$'
if download
print "#{Time.now.strftime("%l:%M:%S %p")} - Start download\n"
res = Net::HTTP.start(uri.hostname,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loaded_features; end",
"def incomplete\n puts \"not a feature of GoalTracker\"\n end",
"def features\n []\n end",
"def scan_ff_for_tag feature\n if feature[:gherkin][\"tags\"]\n feature[:gherkin][\"tags\"].each do |tag|\n if tag[\"name\"] == Observer.tag\n f = feature.... | [
"0.6473048",
"0.60501325",
"0.6029687",
"0.60073006",
"0.59639287",
"0.5919401",
"0.5819149",
"0.57998186",
"0.5774052",
"0.57635784",
"0.5751718",
"0.5711199",
"0.57067174",
"0.5678709",
"0.5658968",
"0.5639686",
"0.56379896",
"0.5627256",
"0.55961114",
"0.55961114",
"0.5594... | 0.0 | -1 |
method: GET, PUT, PATCH, DELETE | def allowed?(method:, by: nil, action: '')
return readable?(by: by, action: action) if method == 'GET'
case by&.role_id
when ROLE_ID[:admin]
true
when ROLE_ID[:writer]
marker_id == by.id
else # nologin, ...
false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def non_get_methods\n [:post, :put, :delete]\n end",
"def http_method\n :get\n end",
"def get_action request_method\n case request_method\n when 'POST' then 'create'\n when 'GET' then 'read'\n when 'PUT' then 'update'\n when 'DELETE' then 'delete'\n end\n end",
"def method(... | [
"0.7871419",
"0.7262845",
"0.722452",
"0.71742487",
"0.71189374",
"0.7078314",
"0.7022799",
"0.70055664",
"0.6852338",
"0.6852338",
"0.6828698",
"0.68021256",
"0.6799106",
"0.67866474",
"0.6776801",
"0.6759782",
"0.675249",
"0.67046505",
"0.66822636",
"0.66627216",
"0.6657725... | 0.0 | -1 |
p maze maze = [1,1,1,1,1,1,1,1,1,1,1,1,1,1] | def disp_maze(maze)
#n = Math.sqrt(maze.length+2)
printf "A"
(0...@n*@n-2).each do |i|
print " " if maze[i] == 0
print "■" if maze[i] == 1
print "\n" if i % @n == @n-2
end
print "B\n"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initializeMaze(size)\n return Array.new(size[0] + 1){Array.new(size[1] + 1, '#')}\nend",
"def print_maze\n\t\tcount = 1\n\t\t@maze.each do |x|\n\t\t\tputs x.to_s\n\t\tend\n\tend",
"def steps(maze)\n width = maze[0].length\n height = maze.length\n\n dup = Array.new(height) { Array.new(width) {0} }... | [
"0.69093746",
"0.6898654",
"0.67359924",
"0.6725336",
"0.6370144",
"0.6345377",
"0.6331718",
"0.6331718",
"0.63297886",
"0.62786007",
"0.6255606",
"0.6241021",
"0.6217518",
"0.6208724",
"0.6208117",
"0.6208117",
"0.62054896",
"0.61700463",
"0.6105741",
"0.60749555",
"0.605497... | 0.6370921 | 5 |
Disconnects the streaming session. | def disconnect
@lightstreamer&.disconnect
@lightstreamer = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disconnect\n _logout\n @connection.close\n end",
"def disconnect\n @connection.logout\n end",
"def disconnect\n @streams.each { |_, stream| try { stream.finalize } }\n @conn.Disconnect()\n end",
"def disconnect\n @connection.close if connected?\n @connectio... | [
"0.75886756",
"0.7568494",
"0.7481791",
"0.72665477",
"0.71623844",
"0.71462923",
"0.71265143",
"0.7061349",
"0.70190763",
"0.69885373",
"0.694704",
"0.6938581",
"0.6915372",
"0.68923867",
"0.6885849",
"0.68855995",
"0.68833596",
"0.6870446",
"0.6846839",
"0.67989594",
"0.679... | 0.7066579 | 7 |
Stops streaming data for the specified subscription(s) and removes them from the streaming session. | def remove_subscriptions(subscriptions)
lightstreamer_subscriptions = Array(subscriptions).compact.map(&:lightstreamer_subscription)
return if lightstreamer_subscriptions.empty?
@lightstreamer.remove_subscriptions lightstreamer_subscriptions
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unsubscribed\n stop_all_streams\n end",
"def unsubscribed\n # Any cleanup needed when channel is unsubscribed\n stop_all_streams\n end",
"def unsubscribed\n # Any cleanup needed when channel is unsubscribed\n stop_all_streams\n end",
"def unsubscribe\n if @subscriber\n @... | [
"0.732676",
"0.7111172",
"0.7111172",
"0.66652435",
"0.6521266",
"0.6447892",
"0.63580245",
"0.635408",
"0.6272118",
"0.6089243",
"0.60137665",
"0.6010423",
"0.59440124",
"0.5905006",
"0.590146",
"0.58863133",
"0.58727103",
"0.5872442",
"0.5866608",
"0.58530307",
"0.585123",
... | 0.6466166 | 5 |
GET /transactions GET /transactions.json | def index
#valid_account_ids = current_user.accounts.map{|a|a.id}
if params[:account_id]
@account = current_user.accounts.find(params[:account_id])
elsif params[:category_id]
@category = Category.find(params[:category_id])
else
@account = current_user.accounts.current_accounts.first
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transactions\n JSON.parse(response.body).fetch('transactions')\n end",
"def transactions\n JSON.parse(call_blockchain_api(\"transactions\"))\n end",
"def index\n @transactions = Transaction.all\n render json: @transactions\n end",
"def all_transactions\n json_respo... | [
"0.81648093",
"0.7963399",
"0.77854913",
"0.7750781",
"0.7727809",
"0.7706358",
"0.7691205",
"0.7651106",
"0.7590885",
"0.7566833",
"0.75474614",
"0.7517924",
"0.75113904",
"0.74594325",
"0.74594325",
"0.74594325",
"0.73981684",
"0.7327195",
"0.7299904",
"0.72886753",
"0.7288... | 0.6536135 | 86 |
GET /transactions/1 GET /transactions/1.json | def show
@transaction = Transaction.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @transaction }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transactionById\n results = HTTParty.get(\"http://192.168.99.101:4050/transactions/\" + (params[:id]).to_s)\n render json: results.parsed_response, status: results.code\n end",
"def transactions\n JSON.parse(response.body).fetch('transactions')\n end",
"def index\n @transactions... | [
"0.80329096",
"0.7573623",
"0.75322455",
"0.74359256",
"0.74158716",
"0.7407037",
"0.73547655",
"0.73547655",
"0.73547655",
"0.72990084",
"0.7277108",
"0.7185798",
"0.7177073",
"0.7136822",
"0.71119857",
"0.7071874",
"0.70371443",
"0.7035032",
"0.7035032",
"0.7035032",
"0.703... | 0.69585496 | 38 |
GET /transactions/new GET /transactions/new.json | def new
@transaction = Transaction.new
@transaction.date = Date.today
respond_to do |format|
format.html # new.html.erb
format.json { render json: @transaction }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @transaction = Transaction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @transaction }\n end\n end",
"def new\n @transaction = Transaction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render j... | [
"0.788369",
"0.788369",
"0.788369",
"0.78145844",
"0.7654576",
"0.73472095",
"0.73359185",
"0.73281926",
"0.7256975",
"0.7246248",
"0.7246248",
"0.71795315",
"0.7157652",
"0.7152532",
"0.71520513",
"0.7137101",
"0.70835507",
"0.7076312",
"0.7058589",
"0.70566726",
"0.7037931"... | 0.7284914 | 8 |
POST /transactions POST /transactions.json | def create
@transaction = Transaction.new(params[:transaction])
respond_to do |format|
if @transaction.save
format.html { redirect_to account_transactions_path(@transaction.account), notice: 'Transaction was successfully created.' }
format.json { render json: @transaction, status: :create... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postTransaction(useridgiving, useridreceiving, amount)\n parameters={useridgiving: useridgiving.to_i, useridreceiving: useridreceiving.to_i, amount: amount.to_f, state: \"initial\"}\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/js... | [
"0.71245927",
"0.71082085",
"0.7106816",
"0.70631224",
"0.69725966",
"0.6940331",
"0.6884778",
"0.68746823",
"0.6864952",
"0.6829711",
"0.6797897",
"0.67917734",
"0.67908776",
"0.67444444",
"0.6721237",
"0.67069376",
"0.6682088",
"0.6679079",
"0.6675172",
"0.66539776",
"0.664... | 0.6838678 | 9 |
PUT /transactions/1 PUT /transactions/1.json | def update
@transaction = Transaction.find(params[:id])
respond_to do |format|
if @transaction.update_attributes(params[:transaction])
@transaction.account.update_transactions
format.html { redirect_to transactions_path, notice: 'Transaction was successfully updated.' }
format.jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def putTransaction( entity_id, user_id, basket_total, basket, currency, notes)\n params = Hash.new\n params['entity_id'] = entity_id\n params['user_id'] = user_id\n params['basket_total'] = basket_total\n params['basket'] = basket\n params['currency'] = currency\n params['notes'] = notes\n ... | [
"0.68901366",
"0.6832755",
"0.6363582",
"0.6299814",
"0.6278765",
"0.6278765",
"0.6278765",
"0.6278765",
"0.62568355",
"0.6252811",
"0.6198273",
"0.6190985",
"0.6176775",
"0.61571765",
"0.61419106",
"0.61063075",
"0.60703856",
"0.60686797",
"0.60572594",
"0.6051472",
"0.60490... | 0.6627254 | 2 |
DELETE /transactions/1 DELETE /transactions/1.json | def destroy
@transaction = Transaction.find(params[:id])
@transaction.destroy
respond_to do |format|
format.html { redirect_to transactions_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to transactions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @transaction.destroy\n respond_to do |format|\n format.html { redirect_to transactions_url }\n format.js... | [
"0.7447903",
"0.7432787",
"0.7432787",
"0.7432787",
"0.7432787",
"0.7432787",
"0.7432787",
"0.7432787",
"0.7332132",
"0.72434884",
"0.7207153",
"0.7150743",
"0.7150743",
"0.7150743",
"0.7150743",
"0.7150743",
"0.7150743",
"0.7150743",
"0.71465504",
"0.7113606",
"0.71102095",
... | 0.7468478 | 7 |
This method is not available in has_secure_token | def invalidate_token
self.update_columns(token: nil)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_secret; end",
"def token_secret; end",
"def token_secret; end",
"def verify_authenticity_token; end",
"def assign_secure_token\n self.secure_token = SecureRandom.hex\n end",
"def request_authenticity_tokens; end",
"def any_authenticity_token_valid?; end",
"def secure_token token=nil\n ... | [
"0.7123094",
"0.7123094",
"0.7123094",
"0.7049546",
"0.70103925",
"0.694141",
"0.6899037",
"0.67524624",
"0.67228746",
"0.6624133",
"0.6595855",
"0.65794176",
"0.6573612",
"0.656285",
"0.65397114",
"0.6498842",
"0.6498842",
"0.6498842",
"0.64957315",
"0.6484994",
"0.6474266",... | 0.0 | -1 |
(8070)/10 = 1; 1.oom = 1; start with interval = 10^1 = 10 (800350)/10 = 45; 45.oom = 2; start with interval = 10^2 = 100 | def starting_interval_size
(10 ** ((@max - @min) / @maximum_intervals).order_of_magnitude)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def work(interval = 5.0)\n end",
"def p206\n re = /1.2.3.4.5.6.7.8.9.0/\n max = Math.sqrt(1929394959697989990).floor\n\n # Round since only squares of multiples of 30 and 70 end with 9_0 (e.g. 900)\n i = round_up Math.sqrt(1020304050607080900).floor, 100\n while i < max\n p30 = (i+30) **... | [
"0.6530518",
"0.6393372",
"0.6262224",
"0.6232076",
"0.61514777",
"0.6092598",
"0.6092598",
"0.607769",
"0.6015331",
"0.5965576",
"0.5936561",
"0.5862512",
"0.5847743",
"0.58191675",
"0.58141357",
"0.5789895",
"0.5714185",
"0.5697225",
"0.5686055",
"0.5602113",
"0.5594965",
... | 0.6024799 | 8 |
default method of any class | def to_s
"First name: #{ @first_name }, Last name #{ @last_name}, Username: #{username}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method_missing(*args)\n default\n end",
"def default_proc() end",
"def default; end",
"def default; end",
"def method_missing(m,*a,&block)\n if Default.respond_to?(m)\n Default.send(m,*a,&block)\n else\n super\n end\n end",
"def default\n end",
"def de... | [
"0.7063352",
"0.700886",
"0.69992775",
"0.69992775",
"0.6760707",
"0.6748603",
"0.6527855",
"0.6508416",
"0.6455774",
"0.6444471",
"0.6420694",
"0.64158994",
"0.6400373",
"0.6363788",
"0.6363272",
"0.6342266",
"0.6342266",
"0.63194466",
"0.6313156",
"0.6282004",
"0.6247931",
... | 0.0 | -1 |
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.reservation_mailer.update_reservation.subject | def update_reservation(reservation)
@reservation=reservation
@reserver=@reservation.reserver
mail to: @reserver.email_address, subject: "Reservation at Les Arbres Paresseux updated"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subject=(subject); @message_impl.setSubject subject; end",
"def message_subject=(value)\n @message_subject = value\n end",
"def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n ... | [
"0.6962458",
"0.6926732",
"0.6879879",
"0.6869315",
"0.6782888",
"0.6758164",
"0.669943",
"0.66785115",
"0.66636544",
"0.6578046",
"0.6576975",
"0.65718704",
"0.6504745",
"0.6504745",
"0.6504745",
"0.6504745",
"0.6504745",
"0.6504745",
"0.6503529",
"0.6503529",
"0.6503529",
... | 0.0 | -1 |
bad name, because for the main table the name is not really 'fully_qualified' | def attribute_name_fully_qualified_for_all_but_main_table_columns #:nodoc:
self.main_table ? attribute : table_alias_or_table_name + '.' + attribute
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unqualified(table_name)\n table_name.split('.').last\n end",
"def real_table_name\n packageid.gsub('.', '_')\n end",
"def qualified(table_name, context:)\n return table_name if table_name['.'].present?\n return table_name if context['.'].blank?\n\n \"#{context.sub(%r{[^.]*$}, '')... | [
"0.77396166",
"0.7256891",
"0.7232887",
"0.7120777",
"0.7047139",
"0.6972747",
"0.6962248",
"0.69214267",
"0.68981504",
"0.68981504",
"0.68832886",
"0.6873972",
"0.6818866",
"0.68080294",
"0.6773603",
"0.66860396",
"0.6682185",
"0.6652786",
"0.66487724",
"0.6645129",
"0.66202... | 0.6833711 | 12 |
Like TOP, but CPU Find oldest timestamp and newest slice. Compare the duration, vs the total of slice.methods.all.duration That's your app's "load" | def get_app_load(slices)
tstart = slices.first.timestamp
tend = TruestackClient.to_timestamp(Time.now)
total = slices.inject(0) do |sum, slice|
sum + (slice.method_types['all']['duration'] || 0)
end
(total / (tend.to_f - tstart)) * 100
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def top()\n # O(1) time\n @arr.last\n end",
"def find_sorted_entries_by_timelimit(section, oldest,limit)\n # entries = record.send(section).any_of([:time.gt => e], [:start_time.gt => e]).limit(limit)\n entries = send(section).timelimit(oldest).limit(limit)\n now = Time.now\n recs = entries.to_... | [
"0.5799988",
"0.5775799",
"0.5716001",
"0.5353075",
"0.53215337",
"0.52906024",
"0.5245433",
"0.52187455",
"0.5140627",
"0.5134755",
"0.5131197",
"0.5124641",
"0.5121868",
"0.5095008",
"0.5047215",
"0.50119096",
"0.5001916",
"0.49698615",
"0.49655008",
"0.4961539",
"0.4960107... | 0.5870157 | 0 |
[2, 5, 19, 31, 32, 1001] [3, 8, 24, 33, 35, 1002] [40, 41, 42, 44, 45, 1003] [99, 100, 103, 106, 128, 1004] target = 44 Output: [3, 3] | def search_sorted_matrix(array, target)
row = 0
col = matrix[0].length - 1
while row < array.length && col >= 0
if matrix[row][col] > target
col -= 1
elsif matrix[row][col] < target
row += 1
else
return [row, col]
end
end
return [-1, -1]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_triplets(target)\n @nums.each do |num, occ|\n pair = find_pairs(target - num)\n return num * pair if pair != -1\n end\n end",
"def given\n [6,5,3,1,8,7,2,3]\nend",
"def find_target_sum_arrays(arr, target)\n helper(arr, target, arr.length - 1, [], 0)\nend",
"def twosum(array, targe... | [
"0.6708406",
"0.6641344",
"0.6427849",
"0.6401582",
"0.62492645",
"0.62483984",
"0.6196557",
"0.61926144",
"0.613146",
"0.60716534",
"0.60430926",
"0.6026013",
"0.602417",
"0.5998369",
"0.5972995",
"0.5972289",
"0.59653056",
"0.5965133",
"0.59616953",
"0.59499675",
"0.5938206... | 0.0 | -1 |
SPECIFIC ACTIONS USING PERMISSION | def can_view_employee(employee)
return (self.can_view_dept? && self.is_same_department(employee) && self.can_view_all?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def action_want_to_perform(arg)\r\n self.class.actions_allowed[arg]\r\n end",
"def is_authorized_to_perform(action)\n permission = role.shift_management_permissions_table.read_attribute(:\"#{action}\")\n return permission != :nobody\n end",
"def check_permissions\n\n case params[:action]\n whe... | [
"0.69554853",
"0.67116284",
"0.66506505",
"0.663239",
"0.65646255",
"0.64278686",
"0.63953084",
"0.63570935",
"0.6332483",
"0.6332483",
"0.63073784",
"0.6297462",
"0.62960756",
"0.6275785",
"0.627027",
"0.6256064",
"0.625176",
"0.6188047",
"0.61837274",
"0.61754227",
"0.61637... | 0.0 | -1 |
Check if employee is a designated approver for departments. Find bucks he/she must approve within those departments. | def get_pending_bucks
jobcode = self.job_id
approve_for = ::Department.where('bucks_approve1 = \'' + jobcode + '\' OR bucks_approve2 = \'' + jobcode + '\'')
bucks = Array.new
approve_for.each { |d| Buck.joins('INNER JOIN employees ON bucks_bucks.issuer_id = employees.IDnum WHERE employees.de... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_approve?(target)\n is_staff? && target && target.active? && !target.approved?\n end",
"def check_if_approval_is_required\n check_by_families || check_by_supplier || check_by_project ||\n check_by_office || check_by_company || check_by_zone\n end",
"def employee?(user_asking)\n user_asking... | [
"0.59591603",
"0.59500134",
"0.5910278",
"0.5650506",
"0.561991",
"0.5602597",
"0.5591805",
"0.557776",
"0.5574536",
"0.55449915",
"0.5541695",
"0.5493402",
"0.5490291",
"0.5469861",
"0.54620045",
"0.54572487",
"0.5439057",
"0.5418086",
"0.53612643",
"0.5361106",
"0.53608775"... | 0.0 | -1 |
Used in correlation with prize limits that adhere to the prize, not just the inventory. | def purchase_count(prize)
case prize.class.name.demodulize
when "Prize"
Purchase.where(employee_id: self.IDnum).where(prize_id: prize.id).where(returned: false).count
when "Inventory"
Purchase.where(employee_id: self.IDnum).where(inventory_id: prize.id).where(returned: false).count
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reduce_inventory\n Inventory.reduce_inventory(prize)\n end",
"def potential_revenue\n @inventory.inject(0) do |total, inventory|\n total += inventory.first.price * inventory.last\n end\n end",
"def worthInventory\n total_worth = 0\n @@products.each_with_index { |p, i|\n ... | [
"0.7145246",
"0.62238634",
"0.6104363",
"0.59388185",
"0.59112924",
"0.5895374",
"0.5859287",
"0.57720006",
"0.5680902",
"0.56578165",
"0.565684",
"0.56524366",
"0.56353474",
"0.5595293",
"0.55894566",
"0.5582258",
"0.55657876",
"0.5554937",
"0.55377626",
"0.55210614",
"0.551... | 0.0 | -1 |
, :if => :address_changed? | def address
[inst_add1, inst_add2, inst_city, inst_state, inst_zip].compact.join(", ")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def address_changed?\n \tstreet_changed? || city_changed? || state_changed?\n end",
"def address_change\n @update_cart_invoice = zip_code_changed?\n true\n end",
"def address_changed?\n return self.address_hash_changed?\n end",
"def full_hq_address_changed?\n hq_address_changed? || hq_zip... | [
"0.8321227",
"0.78205895",
"0.7512314",
"0.7456105",
"0.73674196",
"0.7163237",
"0.70516413",
"0.66640043",
"0.6474982",
"0.64311284",
"0.6411997",
"0.63608354",
"0.63591653",
"0.63591653",
"0.63586",
"0.63280046",
"0.62180984",
"0.62068087",
"0.6200986",
"0.620068",
"0.61905... | 0.0 | -1 |
for displaying in objectivesindex short or long quest | def type
"#{duration.capitalize} Quest"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quest; end",
"def short_term_objective\n @user = User.find(params[:data])\n per_page = params[:obj_per_page] || 5\n short_term_id = params[:obj_id] || \"\"\n\n @current_title = @user.current_title\n if short_term_id == \"\"\n @max_length = @current_title.short_term_objectives.count\n ... | [
"0.65390134",
"0.6245454",
"0.6223217",
"0.6169041",
"0.5970086",
"0.5934868",
"0.58967066",
"0.58567494",
"0.58563703",
"0.5819126",
"0.5779778",
"0.57754993",
"0.5743584",
"0.5731785",
"0.57304496",
"0.569505",
"0.56705457",
"0.56702536",
"0.56702536",
"0.56641376",
"0.5642... | 0.554665 | 36 |
Description Deletes the attachment. MethodRequestType DELETE Parameters attachment_id ID of the attachement to be deleted. attachment_number Number of attachements linked to this post. | def delete
Attachment.destroy(params[:id]) unless params[:id].blank? if request.delete?
@attachment_count = params[:attachment_number] || 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy_attachment(resource_id, attachment_id)\n http.delete(\"#{attachment_endpoint(resource_id)}/#{attachment_id}\") do |response|\n true\n end\n end",
"def delete_attachment(attachable:)\n raw_response = connection.post do |request|\n request.url \"#{realm_id}/attachable?op... | [
"0.7151794",
"0.7131242",
"0.68820226",
"0.68810415",
"0.67848",
"0.67848",
"0.67830664",
"0.6781351",
"0.6743334",
"0.66647625",
"0.6659478",
"0.6658151",
"0.6643076",
"0.66106665",
"0.6574632",
"0.65529937",
"0.6401589",
"0.6401589",
"0.6401589",
"0.6365196",
"0.6340118",
... | 0.7415872 | 0 |
input: string of letters, numbers, etc. output: get rid of everything but the letters. Replace with spaces. use ^az. take the string, replace all ^az with ' '. Then replace any ' ' with ' ' (double spaces with single) | def cleanup(string)
string.gsub!(/[^a-zA-Z]/, ' ').squeeze(' ')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cleanup(string)\n characters = string.chars\n characters.each_with_index do |char, index|\n if !('a'..'z').include?(char.downcase)\n if characters[index - 1] == ' '\n characters[index - 1] = ''\n characters[index] = ' '\n else\n characters[index] = ' '\n end\n end\n ... | [
"0.7860285",
"0.78066236",
"0.77824944",
"0.7776209",
"0.77532667",
"0.7721106",
"0.76486284",
"0.76470953",
"0.76457274",
"0.76426154",
"0.76138127",
"0.75937295",
"0.7570815",
"0.75679994",
"0.75668",
"0.7562227",
"0.75557166",
"0.75532466",
"0.75493544",
"0.7538016",
"0.75... | 0.76861125 | 6 |
Shorthand for `md2key convert .md` | def method_missing(*args)
path = args.first.to_s
if args.length == 1 && path.end_with?('.md')
convert(path)
else
return super(*args)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extension\n 'md'\n end",
"def convert_key(key)\n case key\n when '$'\n 'text'\n when 'D', 'Dm', 'F', 'FDm', 'FNm', 'G', 'Gm', 'Gn', 'H', 'Hm', 'Hn', 'Nm', 'P', 'Pp', 'PPd', 'PPn', 'S', 'T', 'U', 'V', 'W'\n key\n else\n key.to_s.strip.\n ... | [
"0.5997786",
"0.59509355",
"0.5886304",
"0.5886304",
"0.5886304",
"0.5582637",
"0.5575858",
"0.55486673",
"0.54625106",
"0.54335284",
"0.543187",
"0.543187",
"0.5417471",
"0.5404777",
"0.534704",
"0.5311574",
"0.52879804",
"0.5274658",
"0.5265665",
"0.52530605",
"0.52260035",... | 0.5744535 | 5 |
For output purposes, use "puts" instead of "print" or "p" | def meal_choice(veg1, veg2, protein = "meat")
mer = "What a nutritious meal!"
mer2 = "A plate of #{protein} with #{veg1} and #{veg2}."
puts mer
puts mer2
mer
mer2
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def puts\n end",
"def puts(*strs); $stdout.puts(*strs) if ENV['DEBUG'] end",
"def puts( *args )\n @output.puts(*args)\n end",
"def pout(str)\n print str\n $stdout.flush\nend",
"def puts(str='')\n output(str)\n end",
"def puts *args\n @output.puts(*args)\n end",
"def print(*args)\n ... | [
"0.7546392",
"0.73657894",
"0.7291295",
"0.7291051",
"0.725948",
"0.72567075",
"0.72204983",
"0.7209738",
"0.71434444",
"0.71417135",
"0.71281224",
"0.7107793",
"0.70547396",
"0.7041029",
"0.7038998",
"0.69841146",
"0.69649035",
"0.6944776",
"0.69404733",
"0.69336826",
"0.691... | 0.0 | -1 |
GET /plcmanuals GET /plcmanuals.json | def index
@plcmanuals = Plcmanual.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_plcmanual\n @plcmanual = Plcmanual.find(params[:id])\n end",
"def index\n @manuals = Manual.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @manuals }\n end\n end",
"def create\n @plcmanual = Plcmanual.new(plcmanual_params)\n\... | [
"0.6726388",
"0.6549088",
"0.6536391",
"0.62530375",
"0.609712",
"0.588733",
"0.5887032",
"0.5706414",
"0.5700603",
"0.5685491",
"0.55242527",
"0.55119765",
"0.55102533",
"0.5503132",
"0.5503132",
"0.5496272",
"0.547521",
"0.54299295",
"0.54218966",
"0.54103976",
"0.54101837"... | 0.73883605 | 0 |
GET /plcmanuals/1 GET /plcmanuals/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @plcmanuals = Plcmanual.all\n end",
"def set_plcmanual\n @plcmanual = Plcmanual.find(params[:id])\n end",
"def create\n @plcmanual = Plcmanual.new(plcmanual_params)\n\n respond_to do |format|\n if @plcmanual.save\n format.html { redirect_to @plcmanual, notice: 'Plcmanu... | [
"0.733394",
"0.7122244",
"0.67310476",
"0.6326846",
"0.6161589",
"0.61543494",
"0.6025314",
"0.5965991",
"0.5771257",
"0.5671282",
"0.5597261",
"0.5549966",
"0.55412614",
"0.5539926",
"0.5504729",
"0.5486942",
"0.5458714",
"0.545123",
"0.5436844",
"0.54147846",
"0.5410261",
... | 0.0 | -1 |
POST /plcmanuals POST /plcmanuals.json | def create
@plcmanual = Plcmanual.new(plcmanual_params)
respond_to do |format|
if @plcmanual.save
format.html { redirect_to @plcmanual, notice: 'Plcmanual was successfully created.' }
format.json { render :show, status: :created, location: @plcmanual }
else
format.html { ren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_plcmanual\n @plcmanual = Plcmanual.find(params[:id])\n end",
"def plcmanual_params\n params.require(:plcmanual).permit(:name, :attachment)\n end",
"def index\n @plcmanuals = Plcmanual.all\n end",
"def create\n need_edit!\n @manual = Manual.new(params[:manual])\n\n respond... | [
"0.675443",
"0.6316556",
"0.628078",
"0.6221537",
"0.6205582",
"0.59734815",
"0.5857033",
"0.5779657",
"0.571406",
"0.56520975",
"0.55642825",
"0.55509144",
"0.5529888",
"0.54612714",
"0.5371218",
"0.5303629",
"0.5260901",
"0.5260587",
"0.5251948",
"0.5220522",
"0.52112544",
... | 0.7693727 | 0 |
PATCH/PUT /plcmanuals/1 PATCH/PUT /plcmanuals/1.json | def update
respond_to do |format|
if @plcmanual.update(plcmanual_params)
format.html { redirect_to @plcmanual, notice: 'Plcmanual was successfully updated.' }
format.json { render :show, status: :ok, location: @plcmanual }
else
format.html { render :edit }
format.json { r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n need_edit!\n @manual = Manual.find(params[:id])\n\n respond_to do |format|\n if @manual.update_attributes(params[:manual])\n format.html { redirect_to @manual, :notice => 'Manual was successfully updated.' }\n format.json { head :ok }\n else\n format.html { rend... | [
"0.62423384",
"0.62078786",
"0.616005",
"0.6018591",
"0.5907761",
"0.5892979",
"0.5826562",
"0.58232737",
"0.5809542",
"0.57555956",
"0.5708289",
"0.56670123",
"0.5665785",
"0.56620294",
"0.5657102",
"0.5655383",
"0.5653662",
"0.56467384",
"0.5645049",
"0.56184363",
"0.561532... | 0.7220821 | 0 |
DELETE /plcmanuals/1 DELETE /plcmanuals/1.json | def destroy
@plcmanual.destroy
respond_to do |format|
format.html { redirect_to plcmanuals_url, notice: 'Plcmanual was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n need_admin!\n\n @manual = Manual.find(params[:id])\n @manual.destroy\n\n respond_to do |format|\n format.html { redirect_to manuals_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @manual.destroy\n respond_to do |format|\n format.html { redirect_to... | [
"0.7150236",
"0.7037147",
"0.7015627",
"0.67894197",
"0.67163825",
"0.6594045",
"0.6515109",
"0.6514737",
"0.6513081",
"0.6481544",
"0.64299846",
"0.64282554",
"0.6384171",
"0.63830703",
"0.63825166",
"0.63762784",
"0.6373262",
"0.6361359",
"0.63511586",
"0.6348436",
"0.63422... | 0.76108307 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_plcmanual
@plcmanual = Plcmanual.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 plcmanual_params
params.require(:plcmanual).permit(:name, :attachment)
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.6981537",
"0.67835593",
"0.6748275",
"0.67436063",
"0.6736311",
"0.65937173",
"0.6503359",
"0.6498499",
"0.6482832",
"0.6478776",
"0.645703",
"0.6439998",
"0.63802195",
"0.6377008",
"0.6366287",
"0.632018",
"0.63016284",
"0.63011277",
"0.62932974",
"0.62919617",
"0.6290564... | 0.0 | -1 |
POST /users/1/characters POST /users/1/characters.json | def bulk_create
current_user.characters.destroy_all
current_user.default_character_id = nil
current_user.save
characters = []
ok = true
params[:import].each do |character_id|
c = Character.new(:user => current_user)
c.name = params[:name][character_id]
c.character_id = cha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @character = Character.new(character_params)\n if @character.save\n render json: @character, status: 201\n else\n render json: @character.errors, status: :unprocessable_entity\n end\n end",
"def create\n @character = current_user.characters.new(character_params)\n\n resp... | [
"0.71160567",
"0.71102285",
"0.71032023",
"0.7082712",
"0.69362986",
"0.68298346",
"0.6789667",
"0.6789667",
"0.6772088",
"0.675652",
"0.6733206",
"0.6709656",
"0.6694751",
"0.66894794",
"0.6662601",
"0.66242313",
"0.66177064",
"0.6612078",
"0.660263",
"0.660164",
"0.6500456"... | 0.0 | -1 |
GET /characters GET /characters.json | def index
if params[:user_id]
@characters = User.find(params[:user_id]).characters
else
@characters = Character.all
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @characters }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @characters = Character.all\n\n render json: @characters\n end",
"def index\n characters = @project.characters.all\n render json: { characters: characters }\n end",
"def read_characters()\n readfile = File.read(\"characters.json\")\n return JSON.parse(readfile)\nend",
"def show\n ... | [
"0.7834479",
"0.7492228",
"0.74345416",
"0.73284185",
"0.729945",
"0.72562623",
"0.7219943",
"0.7210853",
"0.7186145",
"0.7174598",
"0.7153262",
"0.7148434",
"0.7126641",
"0.7092793",
"0.7092793",
"0.7092793",
"0.7092793",
"0.7092793",
"0.7092793",
"0.7092793",
"0.7092793",
... | 0.7314125 | 4 |
GET /characters/1 GET /characters/1.json | def show
@character = Character.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @character }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @characters = Character.all\n\n render json: @characters\n end",
"def show\n @character = current_user.characters.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @character }\n end\n end",
"def show\n render json:... | [
"0.7621389",
"0.75803363",
"0.73692536",
"0.7295979",
"0.7288016",
"0.7253188",
"0.72261953",
"0.7158439",
"0.7144036",
"0.7092409",
"0.70431465",
"0.70354694",
"0.70055395",
"0.7005538",
"0.69941694",
"0.696007",
"0.6928025",
"0.6910152",
"0.6875888",
"0.6875888",
"0.6875888... | 0.750532 | 2 |
DELETE /users/1/characters/1 DELETE /users/1/characters/1.json | def destroy
@character = Character.find(params[:id])
@character.destroy
respond_to do |format|
format.html { redirect_to characters_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @character = current_user.characters.find(params[:id])\n @character.destroy\n\n respond_to do |format|\n format.html { redirect_to characters_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @character.destroy\n respond_to do |format|\n format.... | [
"0.7492881",
"0.7390446",
"0.7269419",
"0.7248073",
"0.72274107",
"0.7121608",
"0.70770156",
"0.7039056",
"0.69855285",
"0.69491065",
"0.69491065",
"0.69491065",
"0.69491065",
"0.69491065",
"0.69491065",
"0.69491065",
"0.69491065",
"0.6919342",
"0.69122565",
"0.6902221",
"0.6... | 0.7161928 | 5 |
GET /location_url_maps/1 GET /location_url_maps/1.json | def show
@location_url_map = LocationUrlMap.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @location_url_map }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @map = Map.find(params[:map_id])\n if @map.kind == \"activity\"\n @locations = @map.locations.activity\n elsif @map.kind == \"news\"\n @locations = @map.locations.news\n else\n @locations = @map.locations\n end\n respond_to do |format|\n format.json { render :json ... | [
"0.70032",
"0.6911782",
"0.68421274",
"0.6818824",
"0.68129504",
"0.68077177",
"0.6783496",
"0.6746607",
"0.64777124",
"0.64684266",
"0.63724244",
"0.63575095",
"0.6350854",
"0.63489884",
"0.6339859",
"0.63285583",
"0.63285583",
"0.63028944",
"0.6302837",
"0.6302837",
"0.6302... | 0.74961036 | 0 |
GET /location_url_maps/new GET /location_url_maps/new.json | def new
@location_url_map = LocationUrlMap.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @location_url_map }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @locationmap = Locationmap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @locationmap }\n end\n end",
"def create\n @location_url_map = LocationUrlMap.new(params[:location_url_map])\n\n respond_to do |format|\n if @location_url_m... | [
"0.7863535",
"0.7471662",
"0.7452357",
"0.7382085",
"0.72232157",
"0.71958184",
"0.7045853",
"0.70221823",
"0.70221823",
"0.70221823",
"0.70221823",
"0.70221823",
"0.7014947",
"0.7014821",
"0.6984939",
"0.69701594",
"0.69701594",
"0.6964708",
"0.6951287",
"0.69209313",
"0.692... | 0.8329481 | 0 |
POST /location_url_maps POST /location_url_maps.json | def create
@location_url_map = LocationUrlMap.new(params[:location_url_map])
respond_to do |format|
if @location_url_map.save
format.html { redirect_to @location_url_map, notice: 'Location url map was successfully created.' }
format.json { render json: @location_url_map, status: :created,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @locationmap = Locationmap.new(params[:locationmap])\n\n respond_to do |format|\n if @locationmap.save\n format.html { redirect_to @locationmap, notice: 'Locationmap was successfully created.' }\n format.json { render json: @locationmap, status: :created, location: @locationma... | [
"0.66335195",
"0.6600316",
"0.63536596",
"0.6319643",
"0.6251485",
"0.6219994",
"0.61492276",
"0.61356413",
"0.6113942",
"0.6042525",
"0.60377276",
"0.6013013",
"0.59665215",
"0.58850014",
"0.58772564",
"0.5851057",
"0.58510554",
"0.5834196",
"0.57707775",
"0.5733268",
"0.572... | 0.7361905 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.