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 |
|---|---|---|---|---|---|---|
Never trust parameters from the scary internet, only allow the white list through. | def informacao_ged_params
params.require(:informacao_ged).permit(:orgao_id, :processo_digitalizacao, :numero_digitalizacao, :documentos_indexados, :hospedado_sepog)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
why can't I use alias for this? | def item_description
"Donation: #{account_code.name_or_code}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alias_of; end",
"def aliased_name; end",
"def alias_decls; end",
"def is_alias?; end",
"def aliases; end",
"def aliases; end",
"def aliases; end",
"def alias_method(sym1,sym2) end",
"def aliases=(_arg0); end",
"def aliases=(_arg0); end",
"def aliases\n end",
"def with_class_alias(x); e... | [
"0.8360058",
"0.75075996",
"0.7261705",
"0.72487354",
"0.71658796",
"0.71658796",
"0.71658796",
"0.7137943",
"0.702921",
"0.702921",
"0.6907842",
"0.69076127",
"0.6889313",
"0.67918396",
"0.66580033",
"0.6648208",
"0.66142905",
"0.6512604",
"0.6479124",
"0.6479124",
"0.622270... | 0.0 | -1 |
GET /status_de_la_inscripcions GET /status_de_la_inscripcions.json | def index
@status_de_la_inscripcions = StatusDeLaInscripcion.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @status_de_la_inscripcions }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @status_de_la_notificacions = StatusDeLaNotificacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_notificacions }\n end\n end",
"def index\n @status_ref_pago_inscs = StatusRefPagoInsc.all\n\n respond_to do |format|\... | [
"0.6817553",
"0.6750615",
"0.6737539",
"0.6696948",
"0.6389955",
"0.6274525",
"0.62664276",
"0.62091666",
"0.6182181",
"0.618101",
"0.6176908",
"0.6150047",
"0.6121304",
"0.61050725",
"0.61016417",
"0.60100645",
"0.60027856",
"0.5997084",
"0.597072",
"0.5937746",
"0.592776",
... | 0.7461563 | 0 |
GET /status_de_la_inscripcions/1 GET /status_de_la_inscripcions/1.json | def show
@status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @status_de_la_inscripcion }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @status_de_la_inscripcions = StatusDeLaInscripcion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_inscripcions }\n end\n end",
"def index\n @status_de_la_notificacions = StatusDeLaNotificacion.all\n\n respond_to do |f... | [
"0.73690134",
"0.6739656",
"0.66322225",
"0.65064174",
"0.6447876",
"0.6446406",
"0.63924336",
"0.63177633",
"0.63115704",
"0.6276682",
"0.62350416",
"0.6232295",
"0.6220298",
"0.62199974",
"0.62154335",
"0.6141549",
"0.61362237",
"0.6094502",
"0.60912776",
"0.6070321",
"0.60... | 0.7122019 | 1 |
GET /status_de_la_inscripcions/new GET /status_de_la_inscripcions/new.json | def new
@status_de_la_inscripcion = StatusDeLaInscripcion.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @status_de_la_inscripcion }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @status_de_la_notificacion = StatusDeLaNotificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_de_la_notificacion }\n end\n end",
"def new\n @new_status = NewStatus.new\n\n respond_to do |format|\n format.html # new.ht... | [
"0.740104",
"0.73748904",
"0.69888073",
"0.6972228",
"0.69482505",
"0.6943155",
"0.6906172",
"0.6898177",
"0.6893697",
"0.68728787",
"0.6843964",
"0.6828469",
"0.6769151",
"0.6768448",
"0.6748386",
"0.6746288",
"0.6740954",
"0.6739909",
"0.6729575",
"0.67295265",
"0.67252254"... | 0.7762496 | 0 |
POST /status_de_la_inscripcions POST /status_de_la_inscripcions.json | def create
@status_de_la_inscripcion = StatusDeLaInscripcion.new(params[:status_de_la_inscripcion])
respond_to do |format|
if @status_de_la_inscripcion.save
format.html { redirect_to @status_de_la_inscripcion, notice: 'Status de la inscripcion was successfully created.' }
format.json { render json: @status_de_la_inscripcion, status: :created, location: @status_de_la_inscripcion }
else
format.html { render action: "new" }
format.json { render json: @status_de_la_inscripcion.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @inscripcion = Inscripcion.new(inscripcion_params)\n\n respond_to do |format|\n if @inscripcion.save\n format.html { redirect_to @inscripcion, notice: 'Inscripcion was successfully created.' }\n format.json { render :show, status: :created, location: @inscripcion }\n else... | [
"0.6513466",
"0.6204412",
"0.6174564",
"0.6056668",
"0.5968436",
"0.5911479",
"0.58587986",
"0.58019316",
"0.57594216",
"0.5749314",
"0.5697092",
"0.56924576",
"0.56914103",
"0.5672923",
"0.56533813",
"0.56482595",
"0.56437844",
"0.5611982",
"0.55920184",
"0.55852854",
"0.558... | 0.6544218 | 0 |
PUT /status_de_la_inscripcions/1 PUT /status_de_la_inscripcions/1.json | def update
@status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id])
respond_to do |format|
if @status_de_la_inscripcion.update_attributes(params[:status_de_la_inscripcion])
format.html { redirect_to @status_de_la_inscripcion, notice: 'Status de la inscripcion was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
format.json { render json: @status_de_la_inscripcion.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def suscribe\n @estate = Estate.find(params[:id])\n @estate.update_attribute(:status, true)\n respond_to do |format|\n format.html { redirect_to estates_url, notice: 'Propiedad publicada exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |forma... | [
"0.6380254",
"0.627651",
"0.61416256",
"0.61043155",
"0.60850084",
"0.6033485",
"0.6012915",
"0.6007504",
"0.5993994",
"0.5984675",
"0.59749246",
"0.594909",
"0.59403986",
"0.5934573",
"0.59191024",
"0.5898397",
"0.5866879",
"0.5849501",
"0.5835973",
"0.58139676",
"0.5787276"... | 0.66473645 | 0 |
DELETE /status_de_la_inscripcions/1 DELETE /status_de_la_inscripcions/1.json | def destroy
rol = Role.where(:id=>current_user.role).first
if rol.nombre == "ACRM"
@status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id])
@status_de_la_inscripcion.destroy
else
flash[:error] ='No tienes permiso para realizar esta accion'
end
respond_to do |format|
format.html { redirect_to status_de_la_inscripcions_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\",... | [
"0.71111596",
"0.6977709",
"0.6918947",
"0.68485117",
"0.6823194",
"0.6798436",
"0.67939365",
"0.67886096",
"0.67820346",
"0.6779645",
"0.67665964",
"0.67656493",
"0.67538947",
"0.6748301",
"0.67446303",
"0.6732159",
"0.672812",
"0.67167014",
"0.67012346",
"0.6653971",
"0.664... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_course
@course = Course.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 course_params
params.require(:course).permit(:title, :description, :time, :day, :limit, :price)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
Toy and Product Helper Methods | def get_products_report(include_header = true)
# method generates a products report
# optional argument 'include_header', if true, includes a products header in ascii-art
# reliant upon the 'items' list in $products_hash file
report = ''
report += get_products_report_header if include_header
# For each product in the data set:
$products_hash['items'].each do | toy |
report += get_toy_report(toy)
end
return report
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_stock(toy)\n \"Toy Stock: #{toy.stock}\"\n end",
"def products\n end",
"def product_price(toy)\n \"Retail Price: $#{toy.price}\"\n end",
"def product_info_seller\n products = @seller.show_product_info \n choice = @view.display_info_product(products)\n choice == \"1\" ? buy_pro... | [
"0.63411975",
"0.61930186",
"0.6177824",
"0.60906893",
"0.5951873",
"0.58251035",
"0.5809664",
"0.5784339",
"0.5764976",
"0.57347864",
"0.5724205",
"0.56822073",
"0.5668991",
"0.56638443",
"0.5655707",
"0.5626236",
"0.55807257",
"0.55781674",
"0.55771846",
"0.5574581",
"0.556... | 0.0 | -1 |
SHOW / HIDE FORM Hides the Use of Collections Information form | def hide_uoc_info_form
logger.info 'Hiding the Use of Collections Info form'
wait_for_element_and_click form_show_hide_button('Use of Collections Information')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide_uoc_info_form\n wait_for_element_and_click form_show_hide_button('Use of Collections Information')\n end",
"def show_uoc_info_form\n logger.info 'Showing the Use of Collections Info form'\n wait_for_element_and_click form_show_hide_button('Use of Collections Information')\n end",
"def show_... | [
"0.7118138",
"0.67549753",
"0.64603233",
"0.61388296",
"0.60713583",
"0.60540086",
"0.596597",
"0.596597",
"0.5956695",
"0.59062546",
"0.5876109",
"0.5767108",
"0.5704933",
"0.56766367",
"0.56766367",
"0.5676521",
"0.5676521",
"0.56571317",
"0.5640662",
"0.5640662",
"0.563819... | 0.7515609 | 0 |
Unhides the Use of Collections Information form | def show_uoc_info_form
logger.info 'Showing the Use of Collections Info form'
wait_for_element_and_click form_show_hide_button('Use of Collections Information')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide_uoc_info_form\n logger.info 'Hiding the Use of Collections Info form'\n wait_for_element_and_click form_show_hide_button('Use of Collections Information')\n end",
"def hide_uoc_info_form\n wait_for_element_and_click form_show_hide_button('Use of Collections Information')\n end",
"def hide; ... | [
"0.71880895",
"0.71395576",
"0.6606297",
"0.6606297",
"0.634565",
"0.63103616",
"0.6225441",
"0.6158702",
"0.6151472",
"0.6141419",
"0.6085629",
"0.6085629",
"0.6085629",
"0.60803616",
"0.60803616",
"0.60292125",
"0.6016051",
"0.59640527",
"0.5871893",
"0.5845322",
"0.5834976... | 0.5692069 | 25 |
REFERENCE NUMBER Selects the next autogenerated reference number and inserts it into the test data set | def select_auto_reference_nbr(test_data)
hide_notifications_bar
ref_nbr = select_id_generator_option(reference_nbr_input, reference_nbr_options)
logger.info "Selected auto-generated reference number '#{ref_nbr}'"
test_data.merge!({CoreUseOfCollectionsData::REFERENCE_NBR.name => ref_nbr})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_auto_reference_nbr(test_data)\n hide_notifications_bar\n ref_nbr = select_id_generator_option(reference_nbr_input, reference_nbr_options)\n test_data.merge!({ UseOfCollections::REFERENCE_NBR.name => ref_nbr})\n end",
"def enter_reference_nbr(test_data)\n hide_notifications_bar\n logger... | [
"0.73228556",
"0.6703032",
"0.642455",
"0.6364688",
"0.6173592",
"0.6141458",
"0.60801643",
"0.58830035",
"0.5871635",
"0.5862146",
"0.58420545",
"0.58301",
"0.57963765",
"0.57961184",
"0.57651025",
"0.57562673",
"0.57513845",
"0.5722359",
"0.56142944",
"0.5597772",
"0.557936... | 0.731959 | 1 |
Adds or removes a custom reference number per a given set of test data | def enter_reference_nbr(test_data)
hide_notifications_bar
logger.info "Entering reference number '#{test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name]}'"
wait_for_options_and_type(reference_nbr_input, reference_nbr_options, test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_auto_reference_nbr(test_data)\n hide_notifications_bar\n ref_nbr = select_id_generator_option(reference_nbr_input, reference_nbr_options)\n test_data.merge!({ UseOfCollections::REFERENCE_NBR.name => ref_nbr})\n end",
"def select_auto_reference_nbr(test_data)\n hide_notifications_bar\n ... | [
"0.63957834",
"0.61673796",
"0.61345214",
"0.6068089",
"0.5763147",
"0.55785394",
"0.55367684",
"0.5531793",
"0.5478721",
"0.53989387",
"0.53921115",
"0.53144467",
"0.52319586",
"0.5187802",
"0.5167938",
"0.5128536",
"0.5123717",
"0.5083208",
"0.50793636",
"0.50664884",
"0.50... | 0.5636159 | 5 |
Verifies that the reference number matches test data | def verify_reference_nbr(test_data)
verify_values_match(test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name], element_value(reference_nbr_input))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_reference_nbr(test_data)\n verify_values_match(test_data[UseOfCollections::REFERENCE_NBR.name], element_value(reference_nbr_input))\n end",
"def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend",
"def check_solution(test_number, argu... | [
"0.8212068",
"0.6081907",
"0.6033673",
"0.597357",
"0.5970292",
"0.59285074",
"0.5892478",
"0.58428234",
"0.5833653",
"0.58187497",
"0.58135235",
"0.5802544",
"0.5802495",
"0.58012086",
"0.5772549",
"0.57659805",
"0.5756517",
"0.5742261",
"0.57177",
"0.5711213",
"0.56960005",... | 0.8157735 | 1 |
PROJECT ID Selects the autogenerated project ID and returns it. If a test data set is given, inserts the ID. | def select_auto_project_id(test_data=nil)
hide_notifications_bar
id = select_id_generator_option(project_id_input, project_id_options)
logger.info "Selected auto-generated project ID '#{id}'"
test_data.merge!({CoreUseOfCollectionsData::PROJECT_ID.name => id}) if test_data
id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_auto_project_id(test_data=nil)\n hide_notifications_bar\n id = select_id_generator_option(project_id_input, project_id_options)\n test_data.merge!({ UseOfCollections::PROJECT_ID.name => id}) if test_data\n id\n end",
"def project_id=(value)\n @project_id = value\n ... | [
"0.79203147",
"0.7268741",
"0.71865326",
"0.71851313",
"0.7110384",
"0.70827234",
"0.70095074",
"0.6907711",
"0.6833138",
"0.68052846",
"0.6702941",
"0.66431975",
"0.6634928",
"0.6634928",
"0.6634928",
"0.6630542",
"0.6628057",
"0.6624162",
"0.6620479",
"0.66204554",
"0.66098... | 0.78171176 | 1 |
Enters a project ID per a given set of test data | def select_project_id(test_data)
hide_notifications_bar
logger.info "Entering project ID '#{test_data[CoreUseOfCollectionsData::PROJECT_ID.name]}'"
wait_for_options_and_select(project_id_input, project_id_options, test_data[CoreUseOfCollectionsData::PROJECT_ID.name])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_auto_project_id(test_data=nil)\n hide_notifications_bar\n id = select_id_generator_option(project_id_input, project_id_options)\n test_data.merge!({ UseOfCollections::PROJECT_ID.name => id}) if test_data\n id\n end",
"def select_project_id(test_data)\n hide_notifications_bar\n wait_... | [
"0.70523965",
"0.6975713",
"0.68460196",
"0.6595247",
"0.6561248",
"0.636094",
"0.63221335",
"0.60930926",
"0.6076015",
"0.6063935",
"0.6032345",
"0.5850612",
"0.5850452",
"0.5807385",
"0.58002424",
"0.57622015",
"0.5726558",
"0.57243687",
"0.56805694",
"0.5672121",
"0.565653... | 0.7086459 | 0 |
Verifies a project ID matches test data | def verify_project_id(test_data)
verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_ID.name], element_value(project_id_input))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_project_id(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_ID.name], element_value(project_id_input))\n end",
"def verify_project_desc(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_DESC.name], element_value(project_desc_text_area))\n end",
... | [
"0.82428104",
"0.606331",
"0.6037059",
"0.600743",
"0.5998955",
"0.58873504",
"0.58233535",
"0.58202916",
"0.5815638",
"0.5767355",
"0.5765058",
"0.5727829",
"0.57093954",
"0.57072514",
"0.5702081",
"0.5693344",
"0.56857747",
"0.56680983",
"0.5664844",
"0.56332624",
"0.562270... | 0.824223 | 1 |
METHODS Selects or removes UoC methods per a given set of test data | def select_methods(test_data)
test_methods = test_data[CoreUseOfCollectionsData::METHOD_LIST.name]
hide_notifications_bar
test_methods = [{CoreUseOfCollectionsData::METHOD.name => ''}] unless test_methods
prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::METHOD_LIST.name)], test_methods)
test_methods.each_with_index do |method, index|
logger.info "Entering method data set at index #{index}: #{method}"
wait_for_options_and_select(method_input(index), method_options(index), method[CoreUseOfCollectionsData::METHOD.name])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_methods(test_data)\n test_methods = test_data[UseOfCollections::METHOD_LIST.name]\n test_methods = [{ UseOfCollections::METHOD.name => ''}] unless test_methods\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::METHOD_LIST.name)], test_methods)\n\n test_methods.each_with_index do |me... | [
"0.70495033",
"0.5854722",
"0.58523846",
"0.54527867",
"0.5427867",
"0.53290844",
"0.5313165",
"0.52532786",
"0.5209976",
"0.52067477",
"0.5191136",
"0.5143307",
"0.51115346",
"0.50907755",
"0.50867933",
"0.5065239",
"0.50629497",
"0.5032853",
"0.5029713",
"0.50059325",
"0.50... | 0.7028503 | 1 |
Verifies that the methods match test data | def verify_methods(test_data)
test_methods = test_data[CoreUseOfCollectionsData::METHOD_LIST.name]
test_methods = [{CoreUseOfCollectionsData::METHOD.name => ''}] unless test_methods
test_methods.each_with_index { |test_method, index| verify_values_match(test_method[CoreUseOfCollectionsData::METHOD.name], element_value(method_input index)) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_methods(test_data)\n test_methods = test_data[UseOfCollections::METHOD_LIST.name]\n test_methods = [{ UseOfCollections::METHOD.name => ''}] unless test_methods\n test_methods.each_with_index { |test_method, index| verify_values_match(test_method[UseOfCollections::METHOD.name], element_value(met... | [
"0.8013722",
"0.7122673",
"0.7068992",
"0.6806825",
"0.6743819",
"0.6634731",
"0.66051084",
"0.65887034",
"0.65598166",
"0.65438324",
"0.65086675",
"0.6503619",
"0.6463923",
"0.64303386",
"0.64132994",
"0.6397789",
"0.63871634",
"0.63600063",
"0.63037246",
"0.62977415",
"0.62... | 0.80452883 | 0 |
COLLECTION TYPE Selects collection types per a given set of test data | def select_collection_types(test_data)
types = test_data[CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name] || [{CoreUseOfCollectionsData::COLLECTION_TYPE.name => ''}]
hide_notifications_bar
prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name)], types)
types.each_with_index do |type, index|
logger.info "Entering collection type data set at index #{index}: #{type}"
logger.debug "Hitting input at '#{collection_type_input(index)}'"
wait_for_options_and_select(collection_type_input(index), collection_type_options(index), type[CoreUseOfCollectionsData::COLLECTION_TYPE.name])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_collection_types(test_data)\n types = test_data[UseOfCollections::COLLECTION_TYPE_LIST.name] || [{ UseOfCollections::COLLECTION_TYPE.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::COLLECTION_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n wait... | [
"0.7981642",
"0.73535734",
"0.7240342",
"0.6451149",
"0.61875546",
"0.6155347",
"0.61327434",
"0.6115007",
"0.6094356",
"0.5970014",
"0.5865509",
"0.58474404",
"0.58366066",
"0.5832844",
"0.573668",
"0.57352275",
"0.57003826",
"0.57003826",
"0.56800413",
"0.5589772",
"0.55513... | 0.7683633 | 1 |
Verifies collection types match test data | def verify_collection_types(test_data)
types = test_data[CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name] || [{CoreUseOfCollectionsData::COLLECTION_TYPE.name => ''}]
types.each_with_index { |type, index| verify_values_match(type[CoreUseOfCollectionsData::COLLECTION_TYPE.name], element_value(collection_type_input index)) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_collection_types(test_data)\n types = test_data[UseOfCollections::COLLECTION_TYPE_LIST.name] || [{ UseOfCollections::COLLECTION_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[UseOfCollections::COLLECTION_TYPE.name], element_value(collection_type_input index)) }\... | [
"0.8485936",
"0.72509843",
"0.7112232",
"0.69382584",
"0.6560072",
"0.6537137",
"0.62807506",
"0.62482685",
"0.62462085",
"0.62047637",
"0.6187995",
"0.61844355",
"0.61744356",
"0.61450964",
"0.60818154",
"0.607067",
"0.6007147",
"0.5998209",
"0.59925616",
"0.5934632",
"0.592... | 0.84081537 | 1 |
MATERIAL TYPE Selects material types per a given set of test data | def select_material_types(test_data)
types = test_data[CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name] || [{CoreUseOfCollectionsData::MATERIAL_TYPE.name => ''}]
hide_notifications_bar
prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name)], types)
types.each_with_index do |type, index|
logger.info "Entering material type data set at index #{index}: #{type}"
wait_for_options_and_select(material_type_input(index), material_type_options(index), type[CoreUseOfCollectionsData::MATERIAL_TYPE.name])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_material_types(test_data)\n types = test_data[UseOfCollections::MATERIAL_TYPE_LIST.name] || [{ UseOfCollections::MATERIAL_TYPE.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::MATERIAL_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n wait_for_opt... | [
"0.80065763",
"0.7580582",
"0.7498252",
"0.6767219",
"0.6767219",
"0.658974",
"0.6354749",
"0.6354749",
"0.6114087",
"0.6076884",
"0.60666686",
"0.60666686",
"0.601766",
"0.5950648",
"0.5894276",
"0.5893818",
"0.58537537",
"0.58061254",
"0.5797567",
"0.579412",
"0.5750425",
... | 0.791595 | 1 |
Verifies material types match test data | def verify_material_types(test_data)
types = test_data[CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name] || [{CoreUseOfCollectionsData::MATERIAL_TYPE.name => ''}]
types.each_with_index { |type, index| verify_values_match(type[CoreUseOfCollectionsData::MATERIAL_TYPE.name], element_value(material_type_input index)) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_material_types(test_data)\n types = test_data[UseOfCollections::MATERIAL_TYPE_LIST.name] || [{ UseOfCollections::MATERIAL_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[UseOfCollections::MATERIAL_TYPE.name], element_value(material_type_input index)) }\n end",
... | [
"0.83487576",
"0.70979154",
"0.6338917",
"0.62564254",
"0.60257024",
"0.598183",
"0.59112257",
"0.5895662",
"0.5881709",
"0.5857173",
"0.5820585",
"0.58130556",
"0.58076584",
"0.57677066",
"0.57661945",
"0.5734019",
"0.5653002",
"0.5621054",
"0.5612898",
"0.55921984",
"0.5586... | 0.8319044 | 1 |
USERS Enters users data per a given set of test data | def enter_users(test_data)
users = test_data[CoreUseOfCollectionsData::USER_GRP.name] || [CoreUseOfCollectionsData.empty_user]
hide_notifications_bar
prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::USER_GRP.name)], users)
users.each_with_index do |user, index|
logger.info "Entering user data set at index #{index}: #{user}"
enter_auto_complete(user_name_input(index), user_name_options(index), user[CoreUseOfCollectionsData::USER.name], 'Local Persons')
wait_for_options_and_select(user_type_input(index), user_type_options(index), user[CoreUseOfCollectionsData::USER_INSTITUTION_ROLE.name])
wait_for_options_and_select(user_role_input(index), user_role_options(index), user[CoreUseOfCollectionsData::USER_UOC_ROLE.name])
enter_auto_complete(user_institution_input(index), user_institution_options(index), user[CoreUseOfCollectionsData::USER_INSTITUTION.name], 'Local Organizations')
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enter_users(test_data)\n users = test_data[UseOfCollections::USER_GRP.name] || [UseOfCollections.empty_user]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::USER_GRP.name)], users)\n\n users.each_with_index do |user, index|\n enter_auto_complete(user_name_input(index), user_name_option... | [
"0.67769736",
"0.66842794",
"0.6639067",
"0.6607368",
"0.6545218",
"0.65018505",
"0.6457336",
"0.6306099",
"0.62721264",
"0.6192115",
"0.6191121",
"0.6189597",
"0.6107406",
"0.610279",
"0.60416794",
"0.6029497",
"0.60209984",
"0.6008897",
"0.5998435",
"0.59935635",
"0.5970462... | 0.70134825 | 0 |
Verifies that the users data matches test data | def verify_users(test_data)
users = test_data[CoreUseOfCollectionsData::USER_GRP.name] || [CoreUseOfCollectionsData.empty_user]
users.each_with_index do |user, index|
verify_values_match(user[CoreUseOfCollectionsData::USER.name], element_value(user_name_input index))
verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION_ROLE.name], element_value(user_type_input index))
verify_values_match(user[CoreUseOfCollectionsData::USER_UOC_ROLE.name], element_value(user_role_input index))
verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION.name], element_value(user_institution_input index))
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_users(test_data)\n users = test_data[UseOfCollections::USER_GRP.name] || [UseOfCollections.empty_user]\n users.each_with_index do |user, index|\n verify_values_match(user[UseOfCollections::USER.name], element_value(user_name_input index))\n verify_values_match(user[UseOfCollections::USER... | [
"0.7462034",
"0.6795422",
"0.6402874",
"0.6344402",
"0.6316823",
"0.61643094",
"0.6157272",
"0.61483634",
"0.61266863",
"0.6124156",
"0.6095644",
"0.6052236",
"0.6044671",
"0.6033212",
"0.6024998",
"0.59950775",
"0.5969058",
"0.5906203",
"0.58998317",
"0.58980805",
"0.5854002... | 0.740942 | 1 |
TITLE Enters or removes a title per a given set of test data | def enter_title(test_data)
hide_notifications_bar
logger.info "Entering title '#{test_data[CoreUseOfCollectionsData::TITLE.name]}'"
wait_for_element_and_type(title_input, test_data[CoreUseOfCollectionsData::TITLE.name])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def removeDummyTitles(titleCount)\n\t\tif @oc[\"TitleString\"]==\"\"\n\t\t\tc=\"\"\n\t\t\t(1..titleCount).each do |i|\n\t\t\t\tc=c+\"@\" if i>1\n\t\t\t\tc=c+\"empty-notitle\"\n\t\t\tend\n\t\t\t@oc[\"TitleString\"]=c\n\t\tend\n\tend",
"def verify_title(test_data)\n verify_values_match(test_data[UseOfCollection... | [
"0.68603224",
"0.6850197",
"0.68352836",
"0.650551",
"0.64567566",
"0.64107186",
"0.6375972",
"0.6375972",
"0.63110954",
"0.6283459",
"0.62795055",
"0.62751764",
"0.6249691",
"0.6245936",
"0.62413746",
"0.6213181",
"0.6205336",
"0.6150767",
"0.61251175",
"0.6099708",
"0.60930... | 0.63115764 | 8 |
Verifies that the title matches test data | def verify_title(test_data)
verify_values_match(test_data[CoreUseOfCollectionsData::TITLE.name], element_value(title_input))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_title(test_data)\n verify_values_match(test_data[UseOfCollections::TITLE.name], element_value(title_input))\n end",
"def assert_title(title)\n assert_seen title, :within => \"head title\"\n end",
"def title_check\n \n\n if self.title\n \n if !self.title.include? \"Bel... | [
"0.8420171",
"0.6995966",
"0.6959363",
"0.69580567",
"0.69216394",
"0.68472767",
"0.6770389",
"0.6705961",
"0.66408145",
"0.6490771",
"0.6489154",
"0.6463696",
"0.64600486",
"0.6415759",
"0.6334921",
"0.6272647",
"0.62379944",
"0.6235383",
"0.6148467",
"0.6126681",
"0.6126098... | 0.8483728 | 0 |
DATE REQUESTED Enters date requested per a given set of test data | def enter_date_requested(test_data)
hide_notifications_bar
logger.info "Entering date requested '#{test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name]}'"
wait_for_element_and_type(date_requested_input, test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name])
hit_enter
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_date_requested(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_REQUESTED.name], element_value(date_requested_input))\n end",
"def verify_date_requested(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input... | [
"0.69345003",
"0.6905148",
"0.6390723",
"0.6099584",
"0.5985273",
"0.59790194",
"0.59706354",
"0.5935033",
"0.5909702",
"0.5871551",
"0.58661664",
"0.58104175",
"0.5780501",
"0.57795286",
"0.57478637",
"0.5746177",
"0.57028973",
"0.57023907",
"0.5670102",
"0.5664096",
"0.5663... | 0.6471673 | 2 |
Verifies date requested matches test data | def verify_date_requested(test_data)
verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_date_requested(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_REQUESTED.name], element_value(date_requested_input))\n end",
"def verify_foundation_date(test_data)\n errors = []\n text_values_match?(test_data[Org::FOUNDING_DATE.name], element_value(foundation_date_input), e... | [
"0.80194193",
"0.7471824",
"0.743819",
"0.7415723",
"0.7403816",
"0.73284316",
"0.73203146",
"0.7101655",
"0.6920093",
"0.67597854",
"0.67322046",
"0.6729371",
"0.66519946",
"0.6644999",
"0.6637887",
"0.6637822",
"0.6621194",
"0.6607913",
"0.65953946",
"0.65491605",
"0.653543... | 0.8073814 | 0 |
DATE COMPLETED Enters date completed per a given set of test data | def enter_date_completed(test_data)
hide_notifications_bar
logger.info "Entering date completed '#{test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name]}'"
wait_for_element_and_type(date_completed_input, test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name])
hit_enter
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_date_completed(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name], element_value(date_completed_input))\n end",
"def verify_date_completed(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_COMPLETED.name], element_value(date_completed_input... | [
"0.6891963",
"0.6883246",
"0.6543294",
"0.57092565",
"0.56728524",
"0.5656371",
"0.5603191",
"0.5586998",
"0.55691063",
"0.55672586",
"0.55639",
"0.55581975",
"0.5546032",
"0.5484491",
"0.5466815",
"0.54416984",
"0.54120487",
"0.540198",
"0.5401393",
"0.5377785",
"0.5373921",... | 0.6637029 | 2 |
Verifies date completed matches test data | def verify_date_completed(test_data)
verify_values_match(test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name], element_value(date_completed_input))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_date_completed(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_COMPLETED.name], element_value(date_completed_input))\n end",
"def verify_date_requested(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input... | [
"0.8341166",
"0.7105125",
"0.70442903",
"0.666714",
"0.6660662",
"0.66597664",
"0.6641813",
"0.66349506",
"0.658938",
"0.65710187",
"0.64267975",
"0.6424494",
"0.6405465",
"0.6322645",
"0.62721294",
"0.6220005",
"0.6211923",
"0.6203252",
"0.6202072",
"0.6157452",
"0.6153661",... | 0.8371164 | 0 |
OCCASIONS Enters occasions per a given set of test data | def enter_occasions(test_data)
occasions = test_data[CoreUseOfCollectionsData::OCCASION_LIST.name] || [{CoreUseOfCollectionsData::OCCASION.name => ''}]
hide_notifications_bar
prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::OCCASION_LIST.name)], occasions)
occasions.each_with_index do |occasion, index|
logger.info "Entering occasion data set at index #{index}: #{occasion}"
enter_auto_complete(occasion_input(index), occasion_options(index), occasion[CoreUseOfCollectionsData::OCCASION.name], 'Occasion Concepts')
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_occasions(test_data)\n occasions = test_data[CoreUseOfCollectionsData::OCCASION_LIST.name] || [{CoreUseOfCollectionsData::OCCASION.name => ''}]\n occasions.each_with_index { |occasion, index| verify_values_match(occasion[CoreUseOfCollectionsData::OCCASION.name], element_value(occasion_input index)... | [
"0.6667795",
"0.6657743",
"0.64520264",
"0.6071771",
"0.5657711",
"0.5128094",
"0.5081924",
"0.50161386",
"0.5003963",
"0.49939463",
"0.49630982",
"0.4942076",
"0.4942076",
"0.4942076",
"0.49415475",
"0.49330622",
"0.4888488",
"0.48785657",
"0.48690873",
"0.4866526",
"0.48584... | 0.66651464 | 1 |
Verifies occasions match test data | def verify_occasions(test_data)
occasions = test_data[CoreUseOfCollectionsData::OCCASION_LIST.name] || [{CoreUseOfCollectionsData::OCCASION.name => ''}]
occasions.each_with_index { |occasion, index| verify_values_match(occasion[CoreUseOfCollectionsData::OCCASION.name], element_value(occasion_input index)) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pix_feed_compare\n test_plan.expected = PatientIdentifier.new params[:patient_identifier]\n\n test_plan.patient.patient_identifiers.each do |pi|\n if test_plan.matches_expected? pi\n test_plan.pass\n break\n end\n end\n\n unless test_plan.passed?\n tes... | [
"0.6480882",
"0.6372067",
"0.63353753",
"0.6115042",
"0.61078775",
"0.60995275",
"0.60554236",
"0.6024318",
"0.5981473",
"0.5944085",
"0.59133285",
"0.5910317",
"0.5901079",
"0.58943504",
"0.5869047",
"0.5851933",
"0.58485425",
"0.58390445",
"0.58315474",
"0.5829393",
"0.5824... | 0.6060249 | 6 |
PROJECT DESCRIPTION Enters project description per a given set of test data | def enter_project_desc(test_data)
hide_notifications_bar
logger.info "Entering project description '#{test_data[CoreUseOfCollectionsData::PROJECT_DESC.name]}'"
wait_for_element_and_type(project_desc_text_area, test_data[CoreUseOfCollectionsData::PROJECT_DESC.name])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_project_desc(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_DESC.name], element_value(project_desc_text_area))\n end",
"def verify_project_desc(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_DESC.name], element_value(project_desc_text_area))\n... | [
"0.7484834",
"0.7426628",
"0.7066008",
"0.6692473",
"0.6624863",
"0.6624863",
"0.6368204",
"0.63073653",
"0.6232441",
"0.6153696",
"0.60862726",
"0.59314036",
"0.59187055",
"0.5891368",
"0.5818819",
"0.5814073",
"0.57859427",
"0.5782038",
"0.5772886",
"0.57672167",
"0.5733661... | 0.7310079 | 2 |
Verifies project description matches test data | def verify_project_desc(test_data)
verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_DESC.name], element_value(project_desc_text_area))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_project_desc(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_DESC.name], element_value(project_desc_text_area))\n end",
"def verify_project_id(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_ID.name], element_value(project_id_input))\n end",
"def ver... | [
"0.825243",
"0.6627522",
"0.65851676",
"0.63383394",
"0.6198498",
"0.61342806",
"0.6125127",
"0.61203575",
"0.6052599",
"0.6051125",
"0.6023687",
"0.59743345",
"0.5962489",
"0.58685297",
"0.5855546",
"0.58372307",
"0.5831967",
"0.58305585",
"0.58274776",
"0.58077896",
"0.5807... | 0.827891 | 0 |
AUTHORIZATIONS Enters authorizations per a given set of test data | def enter_authorizations(test_data)
authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization]
hide_notifications_bar
prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::AUTHORIZATION_GRP.name)], authorizations)
authorizations.each_with_index do |auth, index|
logger.info "Entering authorization data set at index #{index}: #{auth}"
enter_auto_complete(authorized_by_input(index), authorized_by_options(index), auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], 'Local Persons')
wait_for_element_and_type(authorization_date_input(index), auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name])
hit_enter
wait_for_element_and_type(authorization_note_input(index), auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name])
wait_for_options_and_select(authorization_status_input(index), authorization_status_options(index), auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[UseOfCollections::AUTHORIZED_BY.name], element_value(authorized_by_input inde... | [
"0.73924065",
"0.7369466",
"0.73413664",
"0.69584966",
"0.6077782",
"0.6047196",
"0.60247546",
"0.5831679",
"0.57561964",
"0.567943",
"0.5657679",
"0.56197613",
"0.55741775",
"0.55505776",
"0.55505776",
"0.5503196",
"0.54036134",
"0.53916806",
"0.53885525",
"0.53673524",
"0.5... | 0.73114604 | 3 |
Verifies authorizations match test data | def verify_authorizations(test_data)
authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization]
authorizations.each_with_index do |auth, index|
verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], element_value(authorized_by_input index))
verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))
verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))
verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[UseOfCollections::AUTHORIZED_BY.name], element_value(authorized_by_input inde... | [
"0.8358752",
"0.6307299",
"0.63008535",
"0.6188723",
"0.61446315",
"0.61429673",
"0.608929",
"0.60514903",
"0.60482997",
"0.59818226",
"0.597407",
"0.5931718",
"0.59058934",
"0.5903351",
"0.58933544",
"0.5871764",
"0.5817203",
"0.58089256",
"0.58004326",
"0.57967824",
"0.5779... | 0.83103573 | 1 |
USE DATES Enters use dates per a given set of test data | def enter_use_dates(test_data)
dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]
hide_notifications_bar
prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::USE_DATE_GRP.name)], dates)
dates.each_with_index do |date, index|
logger.info "Entering use date data set at index #{index}: #{date}"
wait_for_element_and_type(use_date_input(index), date[CoreUseOfCollectionsData::USE_DATE.name])
hit_enter
wait_for_element_and_type(use_date_time_note(index), date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name])
wait_for_element_and_type(use_num_visitors_input(index), date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name])
wait_for_element_and_type(use_hours_spent_input(index), date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name])
wait_for_element_and_type(use_note_input(index), date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCo... | [
"0.6976588",
"0.69226384",
"0.6822835",
"0.67585146",
"0.60089093",
"0.59574413",
"0.59156114",
"0.59090245",
"0.57875764",
"0.57688",
"0.5733654",
"0.5644477",
"0.5638423",
"0.5628136",
"0.56105125",
"0.5583802",
"0.5579486",
"0.55758893",
"0.5575779",
"0.5554881",
"0.553189... | 0.67348754 | 4 |
Verifies use dates match test data | def verify_use_dates(test_data)
dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]
dates.each_with_index do |date, index|
verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))
verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))
verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))
verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))
verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCo... | [
"0.83223957",
"0.7540422",
"0.75246006",
"0.7374537",
"0.7211184",
"0.7193179",
"0.7189002",
"0.70658135",
"0.67955405",
"0.6784354",
"0.6760487",
"0.6750339",
"0.66987586",
"0.66741383",
"0.6640236",
"0.65985096",
"0.6556969",
"0.649744",
"0.6467938",
"0.6462258",
"0.6452838... | 0.8342175 | 0 |
END DATE Enters or removes a UoC end date per a given set of test data | def enter_end_date(test_data)
hide_notifications_bar
logger.info "Entering end date '#{test_data[CoreUseOfCollectionsData::END_DATE.name]}'"
wait_for_element_and_type(end_date_input, test_data[CoreUseOfCollectionsData::END_DATE.name])
hit_enter
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_end_date(test_data)\n verify_values_match(test_data[UseOfCollections::END_DATE.name], element_value(end_date_input))\n end",
"def verify_end_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::END_DATE.name], element_value(end_date_input))\n end",
"def enter_end_date(te... | [
"0.71782464",
"0.71765155",
"0.6536046",
"0.6271381",
"0.6169916",
"0.61282",
"0.60889465",
"0.6064384",
"0.6063975",
"0.6035453",
"0.60273093",
"0.5982766",
"0.59401584",
"0.5926396",
"0.58647066",
"0.585268",
"0.58213115",
"0.58041376",
"0.580068",
"0.57866025",
"0.57765037... | 0.6616113 | 2 |
Verifies that the end date matches test data | def verify_end_date(test_data)
verify_values_match(test_data[CoreUseOfCollectionsData::END_DATE.name], element_value(end_date_input))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_end_date(test_data)\n verify_values_match(test_data[UseOfCollections::END_DATE.name], element_value(end_date_input))\n end",
"def test_end_date_after_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.tomorrow\r\n @moderated_search.cobrand_id ... | [
"0.84818196",
"0.7233434",
"0.7230404",
"0.7134945",
"0.70578676",
"0.69782734",
"0.696285",
"0.6957164",
"0.6913282",
"0.68879133",
"0.68874925",
"0.68628925",
"0.6856296",
"0.68358004",
"0.68188196",
"0.68188196",
"0.670295",
"0.6698731",
"0.66931",
"0.6664221",
"0.6654288"... | 0.8507463 | 0 |
STAFF Enters staff per a given set of test data | def enter_staff(test_data)
staff = test_data[CoreUseOfCollectionsData::STAFF_GRP.name] || [CoreUseOfCollectionsData.empty_staff]
hide_notifications_bar
prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::STAFF_GRP.name)], staff)
staff.each_with_index do |staf, index|
logger.info "Entering staff data set at index #{index}: #{staf}"
enter_auto_complete(staff_name_input(index), staff_name_options(index), staf[CoreUseOfCollectionsData::STAFF_NAME.name], 'Local Persons')
wait_for_options_and_select(staff_role_input(index), staff_role_options(index), staf[CoreUseOfCollectionsData::STAFF_ROLE.name])
wait_for_element_and_type(staff_hours_spent_input(index), staf[CoreUseOfCollectionsData::STAFF_HOURS_SPENT.name])
wait_for_element_and_type(staff_note_input(index), staf[CoreUseOfCollectionsData::STAFF_NOTE.name])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[UseOfCollections::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[UseOfCollecti... | [
"0.7007298",
"0.69529206",
"0.69408417",
"0.6672082",
"0.60582364",
"0.58644193",
"0.56636554",
"0.5658313",
"0.5651512",
"0.55732346",
"0.5560925",
"0.5560925",
"0.5532442",
"0.5531731",
"0.55038667",
"0.54973894",
"0.54571545",
"0.53950775",
"0.538978",
"0.533669",
"0.53173... | 0.6878165 | 3 |
Verifies staff match test data | def verify_staff(test_data)
staff = test_data[CoreUseOfCollectionsData::STAFF_GRP.name] || [CoreUseOfCollectionsData.empty_staff]
staff.each_with_index do |staf, index|
verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NAME.name], element_value(staff_name_input index))
verify_values_match(staf[CoreUseOfCollectionsData::STAFF_ROLE.name], element_value(staff_role_input index))
verify_values_match(staf[CoreUseOfCollectionsData::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))
verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NOTE.name], element_value(staff_note_input index))
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[UseOfCollections::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[UseOfCollecti... | [
"0.7881304",
"0.6380798",
"0.6353641",
"0.6246095",
"0.6234794",
"0.62119454",
"0.61281",
"0.6124484",
"0.6103201",
"0.6087095",
"0.6020533",
"0.6010558",
"0.59397715",
"0.5916913",
"0.58997613",
"0.585314",
"0.58262813",
"0.5813097",
"0.58024675",
"0.5764486",
"0.57613873",
... | 0.7840825 | 1 |
LOCATIONS Enters locations per a given set of test data | def enter_locations(test_data)
locations = test_data[CoreUseOfCollectionsData::LOCATION_LIST.name] || [{CoreUseOfCollectionsData::LOCATION.name => ''}]
hide_notifications_bar
prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::LOCATION_LIST.name)], locations)
locations.each_with_index do |location, index|
logger.info "Entering location data set at index #{index}: #{location}"
enter_auto_complete(location_input(index), location_options(index), location[CoreUseOfCollectionsData::LOCATION.name], 'Local Places')
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enter_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::LOCATION_LIST.name)], locations)\n locations.each_with_index do |location, index|\n enter_auto_complete... | [
"0.7358205",
"0.7197582",
"0.7186002",
"0.66445935",
"0.66213596",
"0.65132487",
"0.65008503",
"0.6458574",
"0.64343363",
"0.64279574",
"0.6394133",
"0.6322496",
"0.6299176",
"0.6299176",
"0.6274033",
"0.61833894",
"0.61833894",
"0.61792886",
"0.6113836",
"0.6078811",
"0.6038... | 0.7382622 | 0 |
Verifies locations match a given set of test data | def verify_locations(test_data)
locations = test_data[CoreUseOfCollectionsData::LOCATION_LIST.name] || [{CoreUseOfCollectionsData::LOCATION.name => ''}]
locations.each_with_index { |location, index| verify_values_match(location[CoreUseOfCollectionsData::LOCATION.name], element_value(location_input index)) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n locations.each_with_index { |location, index| verify_values_match(location[UseOfCollections::LOCATION.name], element_value(location_input index)) }\n end",
"def tes... | [
"0.7846891",
"0.6538321",
"0.6509385",
"0.61529636",
"0.59977186",
"0.597671",
"0.59543914",
"0.5935601",
"0.59063804",
"0.59042025",
"0.58744466",
"0.5868029",
"0.5826107",
"0.5803772",
"0.5783328",
"0.5753785",
"0.57491106",
"0.5711637",
"0.56879723",
"0.5683051",
"0.567260... | 0.78097284 | 1 |
FEE Enters fees per a given set of test data | def enter_fees(test_data)
fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee]
hide_notifications_bar
prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::FEE_GRP.name)], fees)
fees.each_with_index do |fee, index|
logger.info "Entering fee data set at index #{index}: #{fee}"
wait_for_options_and_select(fee_currency_input(index), fee_currency_options(index), fee[CoreUseOfCollectionsData::FEE_CURRENCY.name])
wait_for_element_and_type(fee_value_input(index), fee[CoreUseOfCollectionsData::FEE_VALUE.name])
wait_for_element_and_type(fee_note_input(index), fee[CoreUseOfCollectionsData::FEE_NOTE.name])
wait_for_element_and_click(fee_paid_input(index)) if fee[CoreUseOfCollectionsData::FEE_PAID.name]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[UseOfCollections::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[UseOfCollections::F... | [
"0.78026605",
"0.7739401",
"0.7490415",
"0.71905243",
"0.6995158",
"0.6895972",
"0.6779702",
"0.6769731",
"0.6651839",
"0.6651839",
"0.6651839",
"0.6346239",
"0.63112605",
"0.629387",
"0.62936807",
"0.6267589",
"0.6266887",
"0.61886513",
"0.6066112",
"0.60280365",
"0.60067075... | 0.7189085 | 4 |
Verifies fees match test data | def verify_fees(test_data)
fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee]
fees.each_with_index do |fee, index|
verify_values_match(fee[CoreUseOfCollectionsData::FEE_CURRENCY.name], element_value(fee_currency_input index))
verify_values_match(fee[CoreUseOfCollectionsData::FEE_VALUE.name], element_value(fee_value_input index))
verify_values_match(fee[CoreUseOfCollectionsData::FEE_NOTE.name], element_value(fee_note_input index))
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[UseOfCollections::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[UseOfCollections::F... | [
"0.83063674",
"0.62973666",
"0.6166606",
"0.6162033",
"0.5983335",
"0.59627163",
"0.5927743",
"0.5905976",
"0.58138597",
"0.58053136",
"0.5782406",
"0.5765115",
"0.5746944",
"0.56767064",
"0.5674568",
"0.5674419",
"0.5647779",
"0.5635091",
"0.5623951",
"0.5619228",
"0.5603061... | 0.82692397 | 1 |
NOTE Enters or removes a UoC note per a given set of test data | def enter_note(test_data)
hide_notifications_bar
logger.info "Entering note '#{test_data[CoreUseOfCollectionsData::NOTE.name]}'"
wait_for_element_and_type(note_text_area, test_data[CoreUseOfCollectionsData::NOTE.name])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_note(test_data)\n verify_values_match(test_data[UseOfCollections::NOTE.name], element_value(note_text_area))\n end",
"def verify_note(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::NOTE.name], element_value(note_text_area))\n end",
"def handle_notes(notes)\n\n notes.... | [
"0.64049107",
"0.6381191",
"0.6062252",
"0.59177274",
"0.57676107",
"0.574939",
"0.57445514",
"0.57286924",
"0.5711052",
"0.5585502",
"0.5568033",
"0.556653",
"0.5539169",
"0.5530218",
"0.5509743",
"0.5493581",
"0.54554504",
"0.5454089",
"0.5432212",
"0.5370264",
"0.5351698",... | 0.56930095 | 9 |
Verifies that the note matches test data | def verify_note(test_data)
verify_values_match(test_data[CoreUseOfCollectionsData::NOTE.name], element_value(note_text_area))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_note(test_data)\n verify_values_match(test_data[UseOfCollections::NOTE.name], element_value(note_text_area))\n end",
"def verify_history_notes(test_data)\n test_histories = test_data[Org::HISTORY_NOTES.name]\n errors = []\n test_histories = [{ Org::HISTORY_NOTE.name => ''}] unless test_hi... | [
"0.8228131",
"0.7070411",
"0.6932775",
"0.60628676",
"0.59932244",
"0.5953828",
"0.5859783",
"0.5825521",
"0.5762382",
"0.57510424",
"0.57493937",
"0.57026863",
"0.566392",
"0.5652546",
"0.56464803",
"0.5595954",
"0.5570968",
"0.55679035",
"0.5567318",
"0.55651224",
"0.551667... | 0.823546 | 0 |
PROVISOS Enters or removes provisos per a given set of test data | def enter_provisos(test_data)
hide_notifications_bar
logger.info "Entering provisos '#{test_data[CoreUseOfCollectionsData::PROVISOS.name]}'"
wait_for_element_and_type(provisos_text_area, test_data[CoreUseOfCollectionsData::PROVISOS.name])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_002\n # delete all existed projects\n delete_all_pus\n begin\n # there is no project\n open_pu_management_page\n assert is_element_not_present(xpath[\"pu_management\"][\"search_box\"])\n assert is_element_not_present(xpath[\"pu_management\"][\"pu_table\"])\n logout\n r... | [
"0.6101667",
"0.5871965",
"0.5866242",
"0.5758524",
"0.5736607",
"0.5681461",
"0.56410456",
"0.5619978",
"0.55291146",
"0.5479975",
"0.5469446",
"0.54309833",
"0.5392201",
"0.538284",
"0.5313692",
"0.5274072",
"0.52509636",
"0.5216407",
"0.5213342",
"0.52042246",
"0.51963884"... | 0.5955965 | 1 |
Verifies that the provisos match test data | def verify_provisos(test_data)
verify_values_match(test_data[CoreUseOfCollectionsData::PROVISOS.name], element_value(provisos_text_area))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_provisos(test_data)\n verify_values_match(test_data[UseOfCollections::PROVISOS.name], element_value(provisos_text_area))\n end",
"def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend",
"def verify_result(test_data)\n verify_values... | [
"0.74271333",
"0.6471244",
"0.643594",
"0.6350065",
"0.6345271",
"0.6323167",
"0.6268271",
"0.6247416",
"0.62469137",
"0.62074935",
"0.6188318",
"0.61853796",
"0.6042191",
"0.60177153",
"0.60109514",
"0.59783953",
"0.5936607",
"0.5891009",
"0.58907545",
"0.58778477",
"0.58754... | 0.74541885 | 0 |
RESULT Enters or removes a result per a given set of test data | def enter_result(test_data)
hide_notifications_bar
logger.info "Entering result '#{test_data[CoreUseOfCollectionsData::RESULT.name]}'"
wait_for_element_and_type(result_text_area, test_data[CoreUseOfCollectionsData::RESULT.name])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_multiple_users_should_update_test_result_under_c1_0\n test_target_instance = get_new_test_target_instance(\"example5\", \"2012112805\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n batch_edit_test_results(test_target_instance, membe... | [
"0.6645193",
"0.66376686",
"0.6630972",
"0.65602446",
"0.650284",
"0.64844567",
"0.64429146",
"0.64163446",
"0.63618034",
"0.63436174",
"0.63162977",
"0.6291909",
"0.6253884",
"0.6211486",
"0.61765534",
"0.61069846",
"0.61049044",
"0.60897076",
"0.607499",
"0.6031293",
"0.598... | 0.56286865 | 45 |
Verifies that the result matches test data | def verify_result(test_data)
verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end",
"def verify_result(expect, model)\n puts \"running query: #{build_query(model)}\"\n result = search(build_query(model))\n assert_equal(expect.size, result.hit.size)\n... | [
"0.77462626",
"0.7147781",
"0.7025612",
"0.6886706",
"0.66408885",
"0.6549903",
"0.65296674",
"0.6512537",
"0.64803106",
"0.6453954",
"0.6433727",
"0.6397276",
"0.63816094",
"0.62602884",
"0.6233375",
"0.6233375",
"0.62136537",
"0.62130344",
"0.61987656",
"0.61943716",
"0.619... | 0.78071636 | 0 |
OBLIGATIONS Clicks the obligations fulfilled checkbox, though it knows nothing about whether it is checking or unchecking | def click_obligations_fulfilled
wait_for_element_and_click obligations_input
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check\n click unless checked?\n end",
"def offenses_to_check; end",
"def check_box; end",
"def legal_terms_acceptance_on!\n @legal_terms_acceptance = true\n end",
"def uncheck\n click unless unchecked?\n end",
"def ensure_user_checked_terms\n account_required(nil)\n en... | [
"0.60629874",
"0.5994372",
"0.5858613",
"0.57750976",
"0.5540947",
"0.5488588",
"0.5463598",
"0.5460786",
"0.5459908",
"0.5417722",
"0.5397253",
"0.53897214",
"0.5342777",
"0.5339122",
"0.53008366",
"0.5289087",
"0.5288259",
"0.52799505",
"0.527131",
"0.52597016",
"0.5257368"... | 0.71981066 | 1 |
Because any nonregular fraction m / n is periodic, and has a period (i.e. recurring cycle length) independent of m, which is at most n 1 digits long. Equality happens when n is a prime. Return the cycle length of 1 / n; n is a prime. | def recurringCycleLengthOfPrime(n)
return 0 if n == 2 || n == 5
# Solve multiplicative order of 10 (mod n)
i = 1
until (10 ** i - 1) % n == 0
i = i.next
end
i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cycle_length(n,d)\n remainders = [n.remainder(d) * 10]\n finished = false\n\n until remainders.include?(remainders.last.remainder(d) * 10)\n remainders << remainders.last.remainder(d) * 10\n end\n return remainders[remainders.index(remainders.last.remainder(d) * 10)..remainders.size - 1].si... | [
"0.7258266",
"0.7096669",
"0.7076458",
"0.6855291",
"0.6838141",
"0.68158853",
"0.6477822",
"0.6476729",
"0.64062476",
"0.6399346",
"0.63765496",
"0.62871647",
"0.6273994",
"0.62450063",
"0.6242124",
"0.6230203",
"0.6217357",
"0.621171",
"0.61949706",
"0.6187867",
"0.61663246... | 0.70092076 | 3 |
return the line and column of a given offset into this string line and column are 1based | def line_column(string, offset)
return 1,1 if string.length==0 || offset==0
lines = (string[0..offset-1] + " ").split("\n")
return lines.length, lines[-1].length
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_line_and_column_from_chunk(offset)\n if offset.zero?\n return [@chunk_line, @chunk_column]\n end\n\n string =\n offset >= @chunk.size ? @chunk : @chunk[0..offset-1]\n\n line_count = string.count(\"\\n\")\n\n column = @chunk_column\n if line_count > 0\n lines = string.split(... | [
"0.7780862",
"0.777223",
"0.77504903",
"0.771346",
"0.7664354",
"0.75300133",
"0.7514555",
"0.7513169",
"0.74829495",
"0.7435217",
"0.7395403",
"0.72273517",
"0.72117454",
"0.7208537",
"0.70074046",
"0.69908077",
"0.6919554",
"0.69150877",
"0.68561566",
"0.6836645",
"0.683664... | 0.79417413 | 0 |
sort strings first, regexp second sort strings by lenght, longest first will then match first to last | def sort_operator_patterns(array)
array.sort_by {|a| a.kind_of?(Regexp) ? 0 : -a.length}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def longest(str)\n \n alphabet_substr = find_substr(str).select do |substr|\n substr.chars == substr.chars.sort\n end\n alphabet_substr.sort_by! { |str| str.length }\n\n longest = alphabet_substr.select { |str| str.length == alphabet_substr.last.length }\n longest.shift\nend",
"def sort_by_length(my_sen... | [
"0.718832",
"0.6930336",
"0.6835696",
"0.68058467",
"0.67672914",
"0.67205065",
"0.6704554",
"0.66997546",
"0.6674899",
"0.6660011",
"0.6640362",
"0.66145897",
"0.6612656",
"0.66058177",
"0.65998316",
"0.65588486",
"0.6557286",
"0.65525705",
"0.65395004",
"0.6513521",
"0.6508... | 0.0 | -1 |
Takes an array of Strings and Regexp and generates a new Regexp that matches the or ("|") of all strings and Regexp | def array_to_or_regexp_string(array)
array = symbols_to_strings array.flatten
array = sort_operator_patterns array
array = regexp_and_strings_to_regexpstrings array
array.collect {|op| "(#{op})"}.join('|')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_regex(arr)\n return nil if arr.empty?\n\n regex_str = arr.join('|')\n Regexp.new(regex_str)\nend",
"def or(*array_matchers, **keyword_matchers)\n create_matcher('or', array_matchers, keyword_matchers)\n end",
"def or(*array_matchers, **keyword_matchers)\n create_matcher('or', a... | [
"0.7485174",
"0.6648452",
"0.6648452",
"0.6321851",
"0.6293496",
"0.6088856",
"0.5971724",
"0.5868424",
"0.57127434",
"0.57005244",
"0.5695597",
"0.5613001",
"0.55720836",
"0.5564028",
"0.5548862",
"0.55442566",
"0.5536933",
"0.54876405",
"0.54561657",
"0.54528064",
"0.545280... | 0.6960057 | 1 |
associativity = :left => operators of the same precidence execut from left to right :right => operators of the same precidence execut from right to left | def index_of_lowest_precedence(operators,associativity=:left)
lowest = lowest_precedence = nil
operators.each_with_index do |operator,i|
operator_string = operator.to_s
precedence = operator_precedence(operator_string)
right_associative = @right_operators_regexp && operator_string[@right_operators_regexp]
if !lowest || (right_associative ? precedence < lowest_precedence : precedence <= lowest_precedence)
lowest = i
lowest_precedence = precedence
end
end
lowest
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reduce_associativity\n pos, neg = [], []\n\n @x.each do |x_el|\n case x_el\n when CAS::Invert\n neg << x_el.x\n when CAS::Diff\n pos << x_el.x\n neg << x_el.y\n else\n pos << x_el\n end\n end\n\n pos, neg = self.reduce_a... | [
"0.73216146",
"0.6714029",
"0.64412826",
"0.6320429",
"0.6286455",
"0.6284881",
"0.6246867",
"0.6164832",
"0.6150292",
"0.61183876",
"0.60515356",
"0.6016038",
"0.59278256",
"0.58445466",
"0.57779664",
"0.57339877",
"0.5723413",
"0.5699328",
"0.56726533",
"0.56667364",
"0.563... | 0.6673662 | 2 |
generates a tree of nodes of the specified node_class The nodes have access to the following useful methods: self.left > return the left operand parsetreenode self.right > return the right operand parsetreenode self.operator_node > return the operator parsetreenode self.operator > return the operator as a ruby symbol | def generate_tree(operands, operators, parent_node)
return operands[0] if operands.length==1
i = index_of_lowest_precedence(operators)
operator = operators[i]
new_operand = node_class.new(parent_node)
new_operand.add_match generate_tree(operands[0..i], operators[0..i-1],new_operand), :left
new_operand.add_match operators[i], :operator_node
new_operand.add_match generate_tree(operands[i+1..-1], operators[i+1..-1],new_operand), :right
new_operand
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tree\n while token = @tokens.next\n case token.type\n when :operator\n token.build(@nodes.pop, tree).tap do |node|\n @nodes.push(node)\n end\n when :value\n token.build.tap do |leaf|\n ... | [
"0.6275866",
"0.62736005",
"0.6018715",
"0.60012925",
"0.585359",
"0.5835047",
"0.58197993",
"0.58078945",
"0.57921153",
"0.57454836",
"0.5729815",
"0.57293296",
"0.56752497",
"0.5658922",
"0.56317186",
"0.5609146",
"0.556063",
"0.5557924",
"0.5543804",
"0.553794",
"0.5505827... | 0.6900111 | 0 |
ajust 1..1 scale to 1..5 | def corrected_rating
[(weighted_rating + 2) * 1.6666666666666667, 5.0].min
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scale(*amount)\n self.dup.scale! *amount\n end",
"def scales\n \n end",
"def scale(range)\n u = uninterpolate\n i = interpolate(range[0], range[1])\n\n lambda do |x|\n x = ([0.0, x, (wrong + right).to_f].sort[1]).to_f\n i.call(u.call(x))\n end\n end",
"def scale_up(scal... | [
"0.659849",
"0.650903",
"0.63455266",
"0.6266132",
"0.6255369",
"0.61050284",
"0.6043595",
"0.5935968",
"0.5927438",
"0.5875096",
"0.5863823",
"0.5817157",
"0.58076835",
"0.5796524",
"0.5790055",
"0.57640874",
"0.5758132",
"0.568345",
"0.5658112",
"0.5653517",
"0.56284386",
... | 0.0 | -1 |
check getting checksums of a stream | def test_get_checksum_stream
basechecksum = Cfruby::Checksum::Checksum.get_checksums(@tempfile.path)
File.open(@tempfile.path) { |fp|
streamchecksum = Cfruby::Checksum::Checksum.get_checksums(fp)
assert_equal(basechecksum, streamchecksum)
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checksums; end",
"def verify_checksum!\n log.info(log_key) { \"Verifying checksum\" }\n\n expected = checksum\n actual = digest(downloaded_file, digest_type)\n\n if expected != actual\n raise ChecksumMismatch.new(self, expected, actual)\n end\n end",
"def checksum\n ... | [
"0.7468779",
"0.71035594",
"0.6917121",
"0.68430865",
"0.6829304",
"0.6769859",
"0.6753421",
"0.6686078",
"0.66789913",
"0.66578263",
"0.66264963",
"0.6616337",
"0.66141623",
"0.66036636",
"0.6599573",
"0.6489481",
"0.6464086",
"0.64549595",
"0.6429551",
"0.64264727",
"0.6416... | 0.75762135 | 0 |
checks the permission, existence, and ownership controls on the database file | def test_database_checks()
currentmode = File.stat(@databasefile).mode
Cfruby::FileOps.chmod(@databasefile, 0700)
assert_not_equal(currentmode, File.stat(@databasefile).mode)
assert_raise(Cfruby::Checksum::ChecksumPermissionError) {
@checksum.update_all
}
Cfruby::FileOps.chmod(@databasefile, 0600)
if(Process.euid() == 0)
assert_raise(Cfruby::Checksum::ChecksumOwnershipError) {
Cfruby::FileOps.chown(@databasefile, 200, 200)
@checksum.update_all
}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_file(file = @dbrc_file)\n File.open(file) do |f|\n # Permissions must be set to 600 or better on Unix systems.\n # Must be hidden on Win32 systems.\n if WINDOWS\n raise Error, 'The .dbrc file must be hidden' unless File.hidden?(file)\n else\n raise Error... | [
"0.6985257",
"0.6840328",
"0.6332122",
"0.6323429",
"0.6215494",
"0.61220217",
"0.6069742",
"0.6066387",
"0.6066387",
"0.6066387",
"0.6039412",
"0.6029911",
"0.5968827",
"0.5933483",
"0.5931091",
"0.5923775",
"0.58590275",
"0.582068",
"0.57200634",
"0.5705908",
"0.56982094",
... | 0.7618825 | 0 |
check adding a file to the database | def test_check_new()
assert_nothing_raised() {
@checksum.check(@databasefile)
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_file_to_database(name, path, size, owner)\n $db.execute(\"INSERT INTO files (owner_id, file_name, file_size, file_path, publicity) VALUES (?, ?, ?, ?, 0)\", [owner, name, size, path])\nend",
"def insert_file_into_db(owner_id, file_name, upload_date, last_access_date, file_type, file_size, folder_id, pu... | [
"0.72816503",
"0.6815475",
"0.68144625",
"0.67744654",
"0.6555745",
"0.6491231",
"0.6410132",
"0.6317758",
"0.6267307",
"0.6258463",
"0.62376666",
"0.6217068",
"0.6144557",
"0.6129433",
"0.6120731",
"0.6119832",
"0.6118655",
"0.6114964",
"0.6090242",
"0.6070681",
"0.60572296"... | 0.0 | -1 |
check a file being added to the database and then changed | def test_checksum_change()
assert_nothing_raised() {
@checksum.check(@databasefile)
}
assert_raise(Cfruby::Checksum::ChecksumMatchError, "check of changed file content in database failed to raise exception") {
@checksum.check(@databasefile)
}
assert_equal(false, @checksum.check?(@databasefile))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_files\n updated = []\n files.each do |filename, mtime| \n begin\n current_mtime = File.stat(filename).mtime\n rescue Errno::ENOENT\n # file was not found and was probably deleted\n # remove the file from the file list \n ... | [
"0.7124365",
"0.6888104",
"0.6713643",
"0.6653271",
"0.6636206",
"0.6603193",
"0.65893626",
"0.65155685",
"0.65058947",
"0.6461709",
"0.6283171",
"0.62694514",
"0.6246396",
"0.6242405",
"0.6242105",
"0.6225797",
"0.62089515",
"0.62012064",
"0.6194413",
"0.6193761",
"0.6178327... | 0.0 | -1 |
check update of file in database | def test_update()
@checksum.check(@databasefile)
File.open(@tempfile.path, File::WRONLY|File::APPEND) { |fp|
fp.print("New content")
}
assert_nothing_raised("update of checksum failed") {
@checksum.update(@tempfile.path)
@checksum.check(@tempfile.path)
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_for_update\n file = download_file(UPSTREAM_DATABASE[:URL], Dir.mktmpdir)\n # Same hash = no update\n !check_hash(file, UPSTREAM_DATABASE[:HASH])\n end",
"def updatedb_file_exists?(file)\n @updatedb.key?(file)\n end",
"def check_files\n updated = []\n ... | [
"0.7424319",
"0.6938043",
"0.6933724",
"0.68207365",
"0.6784457",
"0.6688145",
"0.66833335",
"0.65170157",
"0.6513125",
"0.6511205",
"0.6504571",
"0.65002894",
"0.64989567",
"0.64021623",
"0.63641363",
"0.63622504",
"0.6283345",
"0.6265417",
"0.62490267",
"0.6243863",
"0.6227... | 0.6363366 | 15 |
overwrite to_s to display | def to_s
"ID: #{@id}\nFirst Name: #{@first_name}\nLast Name: #{@last_name}\nEmail: #{@email}\nNotes: #{@note}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s(*) end",
"def to_s(*) end",
"def to_s(*) end",
"def to_s\n to_text\n end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end... | [
"0.8051406",
"0.8051406",
"0.8051406",
"0.80350894",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
"0.8019739",
... | 0.0 | -1 |
Invoked with the form parameters when this extension point is created from a configuration screen. | def initialize(attrs = {})
@appspider_url = attrs['appspider_url']
@username = attrs['username']
@password = attrs['password']
@config_name = attrs['config_name']
@startscan = attrs['startscan']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def form_setup\n\tend",
"def initialize config={}, &block\n @config = config\n\n\n widget_shortcuts_init\n @variables = {}\n # if we are creating child objects then we will not use outer form. this object will manage\n #@current_object = [] # 2014-08-29 - 17:35 unused\n @_system_co... | [
"0.627893",
"0.6001749",
"0.5884149",
"0.5882792",
"0.5880317",
"0.58374894",
"0.58089715",
"0.5787512",
"0.5776966",
"0.57768196",
"0.5758157",
"0.57458335",
"0.57381916",
"0.57308215",
"0.56495804",
"0.5596882",
"0.5539714",
"0.5524258",
"0.54859304",
"0.5446382",
"0.543892... | 0.0 | -1 |
Runs before the build begins | def prebuild(build, listener)
# do any setup that needs to be done before this build runs.
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prebuild(build, listener)\n # do any setup that needs to be done before this build runs.\n end",
"def before_setup\n # do nothing by default\n end",
"def before_run; end",
"def post_setup\n end",
"def prebuild(build, listener)\n end",
"def prebuild(build, listener)\n end",
... | [
"0.75876105",
"0.70303434",
"0.7024104",
"0.6919467",
"0.68747675",
"0.68747675",
"0.68747675",
"0.6644995",
"0.6642181",
"0.66390675",
"0.66047144",
"0.65400916",
"0.6499688",
"0.64914507",
"0.6444174",
"0.63720775",
"0.63720775",
"0.6365221",
"0.6362908",
"0.63565016",
"0.6... | 0.7666797 | 0 |
Runs the step over the given build and reports the progress to the listener. | def perform(build, launcher, listener)
# actually perform the build step
# (1) Get build url for AppSpider to scan
listener.info "AppSpider Url: '#{@appspider_url}'"
listener.info "Username: '#{@username}'"
listener.info "Password: '#{@password}'"
listener.info "Config name: '#{@config_name}'"
listener.info "Start Scan: '#{@startscan}'"
if @startscan
listener.info "Starting AppSpider Scan"
# builder = Appsider::Publisher::MessageBuilderFactory.create(build.native)
# message = builder.build_message
options = {
url: @appspider_url,
username: @username,
password: @password,
config_name: @config_name
}
Appspider::ApiExtended.run_scan_config options
else
listener.info "AppSpider was not enabled."
end
listener.info "Finished Scanning scan id: #{@config_name}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _run\n Sparrow.logger.info(\"received a build\", build: build.data)\n end",
"def completed(build, listener)\n end",
"def run\n while @running\n step\n end\n end",
"def test_run_completed(test_run)\n report_results test_run\n end",
"def buildwise_run_sequential_bui... | [
"0.6675924",
"0.6064393",
"0.6002176",
"0.5923482",
"0.5817822",
"0.57595235",
"0.5709222",
"0.5706443",
"0.5695791",
"0.56374663",
"0.56328315",
"0.5628286",
"0.559973",
"0.55960625",
"0.5591285",
"0.55885094",
"0.55885094",
"0.55885094",
"0.55805016",
"0.55734",
"0.5567311"... | 0.5813523 | 5 |
Generate a password if no password define. This password if generate by rangexp. A gem require by dmsweatshop. If password no send after by mail, the password is not getting another time. | def generate_password
if new_record?
self.password = self.password_confirmation = /\w{0,10}/.gen unless password
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate\n @password = (1..@length).map { (33 + rand(89)).chr }.join \n check_password_contents\n @password\n end",
"def generate_password\n self.password = Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{self.email}--#{self.id}\")\n end",
"def generate_new_password\n chars = 'abcde... | [
"0.79126346",
"0.76742905",
"0.7668596",
"0.7574189",
"0.7570792",
"0.7567037",
"0.75636303",
"0.75169516",
"0.7503771",
"0.7464348",
"0.74511606",
"0.7421255",
"0.7279182",
"0.72705656",
"0.7221403",
"0.7165341",
"0.71633637",
"0.7150701",
"0.7140875",
"0.7084795",
"0.708058... | 0.7891413 | 1 |
String origin Fixnum offset Fixnum limit | def hours
render json: Pings::Selector.new.hours(params)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def translate_offset(str, byte_offset)\n chunk = str[0..byte_offset]\n begin\n chunk.unpack(\"U*\").length - 1\n rescue ArgumentError # we damaged a character\n chunk = str[0..(byte_offset+=1)]\n retry\n end\n end",
"def to_offset(text, position); end",
"def get_str(... | [
"0.65438384",
"0.6261865",
"0.62605834",
"0.5966196",
"0.59470475",
"0.59242624",
"0.5922919",
"0.58978355",
"0.588022",
"0.5859147",
"0.5853865",
"0.58457434",
"0.5820027",
"0.5808079",
"0.5804861",
"0.57925075",
"0.57863146",
"0.5774931",
"0.5727166",
"0.57192177",
"0.57062... | 0.0 | -1 |
If the work includes our default processable terms | def perform
debug_verbose = ::Hyrax::OrcidIntegrationService.hyrax_orcid_jobs_debug_verbose
::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,
::Deepblue::LoggingHelper.called_from,
"Flipflop.hyrax_orcid?=#{Flipflop.hyrax_orcid?}",
"@work.id=#{@work.id}",
"" ] if debug_verbose
return unless Flipflop.hyrax_orcid?
orcids = Hyrax::Orcid::WorkOrcidExtractor.new(@work).extract
::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,
::Deepblue::LoggingHelper.called_from,
"Flipflop.hyrax_orcid?=#{Flipflop.hyrax_orcid?}",
"orcids=#{orcids}",
"" ] if debug_verbose
orcids.each { |orcid| perform_user_strategy(orcid) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def term_required?( term )\n #puts \"=====> GenericWork.term_required? #{term}\"\n return true if [:author_email, :author_first_name, :author_last_name, :author_institution, :title, :creator, :contributor, :description, :publisher, :rights, :identifier, :department, :degree, :license].include? term\n fals... | [
"0.62416565",
"0.6066064",
"0.59441483",
"0.5721702",
"0.5719298",
"0.56041795",
"0.5555217",
"0.553414",
"0.549041",
"0.5456885",
"0.5447266",
"0.5430971",
"0.5410429",
"0.5369382",
"0.5369382",
"0.53581196",
"0.5350809",
"0.53417367",
"0.5331624",
"0.5315956",
"0.52638537",... | 0.0 | -1 |
Find the identity and farm out the rest of the logic to a background worker | def perform_user_strategy(orcid_id)
debug_verbose = ::Hyrax::OrcidIntegrationService.hyrax_orcid_jobs_debug_verbose
::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,
::Deepblue::LoggingHelper.called_from,
"orcid_id=#{orcid_id}",
"" ] if debug_verbose
identity = OrcidIdentity.find_by(orcid_id: orcid_id)
::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,
::Deepblue::LoggingHelper.called_from,
"identity=#{identity}",
"" ] if debug_verbose
return if identity.blank?
# return if (identity = OrcidIdentity.find_by(orcid_id: orcid_id)).blank?
Hyrax::Orcid::PerformIdentityStrategyJob.send(active_job_type, @work, identity)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_worker id\n self.workers.find{ |worker| worker[:id] == id } \n end",
"def worker_id\n self.class.worker_id\n end",
"def worker\n Worker.find_by_code worker_code\n end",
"def check_worker_id(args)\n \n # Load params\n worker = args['worker'].to_s.strip\n word = args['w... | [
"0.6033032",
"0.58844507",
"0.5846595",
"0.56282604",
"0.5616885",
"0.55815035",
"0.55813175",
"0.5522891",
"0.55054367",
"0.5487688",
"0.5465305",
"0.54567885",
"0.5413703",
"0.54034543",
"0.54034543",
"0.54034543",
"0.5399031",
"0.53824276",
"0.537892",
"0.5378129",
"0.5364... | 0.52019155 | 36 |
GET /trip_routes GET /trip_routes.json | def index
@trip_routes = TripRoute.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def routes\n routes = get('/gtfs/routes')\n routes.map do |route|\n Route.from_json(route)\n end\n end",
"def trips\n get '/gtfs/trips'\n end",
"def trips_by_route_id(route_id)\n get \"/gtfs/trips/routeid/#{route_id}\"\n end",
"def index\n Rails.logger.info('👻 Dis... | [
"0.7030553",
"0.7006096",
"0.69626975",
"0.6746778",
"0.67030895",
"0.65971345",
"0.6565987",
"0.65631354",
"0.64541",
"0.64541",
"0.6431112",
"0.6431112",
"0.640581",
"0.63941807",
"0.638933",
"0.6389246",
"0.6334889",
"0.6334889",
"0.6334889",
"0.6334889",
"0.63313705",
"... | 0.7836891 | 0 |
GET /trip_routes/1 GET /trip_routes/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @trip_routes = TripRoute.all\n end",
"def trips_by_route_id(route_id)\n get \"/gtfs/trips/routeid/#{route_id}\"\n end",
"def trips\n get '/gtfs/trips'\n end",
"def index\n trips = Trip.all\n render json: trips\n end",
"def trips\n flight = Flight.where(\"... | [
"0.7561082",
"0.70709825",
"0.6723711",
"0.66525227",
"0.6535597",
"0.6526628",
"0.6526628",
"0.64575624",
"0.6442518",
"0.6441559",
"0.6441559",
"0.64107764",
"0.64107764",
"0.6393423",
"0.6385029",
"0.6378023",
"0.636311",
"0.63177043",
"0.62971497",
"0.62921554",
"0.629215... | 0.0 | -1 |
POST /trip_routes POST /trip_routes.json | def create
@trip_route = TripRoute.new(trip_route_params)
respond_to do |format|
if @trip_route.save
format.html { redirect_to @trip_route, notice: 'Trip route was successfully created.' }
format.json { render :show, status: :created, location: @trip_route }
else
format.html { render :new }
format.json { render json: @trip_route.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_route(route, message)\n raise TypeError unless route.is_a? Route\n @changeset = @api.create_changeset(message, tags={'created_by'=>'ITCR'})\n ways_list = []\n nodes_list = create_node_list(route.path)\n\n until nodes_list.empty? # For node's maximum limit of a way\n way_nodes = nodes_l... | [
"0.7198111",
"0.6731935",
"0.66497546",
"0.662146",
"0.6363889",
"0.62762296",
"0.62604165",
"0.6230909",
"0.6227994",
"0.62254465",
"0.62159413",
"0.62015706",
"0.6197352",
"0.6174321",
"0.61385125",
"0.612738",
"0.6107465",
"0.60945064",
"0.6089672",
"0.6085119",
"0.6070074... | 0.69839543 | 1 |
PATCH/PUT /trip_routes/1 PATCH/PUT /trip_routes/1.json | def update
respond_to do |format|
if @trip_route.update(trip_route_params)
format.html { redirect_to @trip_route, notice: 'Trip route was successfully updated.' }
format.json { render :show, status: :ok, location: @trip_route }
else
format.html { render :edit }
format.json { render json: @trip_route.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @route = Route.find(params[:id])\n if user_signed_in?\n routeInfo = JSON.parse(params[:route_map_points].gsub(\"jb\",\"latitude\").gsub(\"kb\",\"longitude\"))\n \n \n @route.route_points = routeInfo['overview_path']\n @route.starting_point = routeInfo['overview_path'].fi... | [
"0.67473924",
"0.66796476",
"0.6358128",
"0.63258094",
"0.63078284",
"0.63078284",
"0.63063705",
"0.6288646",
"0.6273215",
"0.62713164",
"0.62097603",
"0.62097603",
"0.6171023",
"0.6149323",
"0.6144342",
"0.6134545",
"0.61335737",
"0.61186916",
"0.6099913",
"0.6099913",
"0.60... | 0.6914655 | 0 |
DELETE /trip_routes/1 DELETE /trip_routes/1.json | def destroy
@trip_route.destroy
respond_to do |format|
format.html { redirect_to trip_routes_url, notice: 'Trip route was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n trip = Trip.find(params[:id])\n trip.destroy\n render json: {message: \"Successfully deleted trip\"}\n end",
"def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :ok }\n ... | [
"0.7145841",
"0.7142615",
"0.7142615",
"0.71369636",
"0.71369636",
"0.71369636",
"0.7111704",
"0.7103552",
"0.70966786",
"0.70966786",
"0.70966786",
"0.70195603",
"0.69662875",
"0.69591546",
"0.6954721",
"0.6954721",
"0.6954721",
"0.6954721",
"0.6951944",
"0.6938198",
"0.6930... | 0.75354147 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_trip_route
@trip_route = TripRoute.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 trip_route_params
params.require(:trip_route).permit(:pointlat, :pointlong, :DriverTrip_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
GET /ped_programs GET /ped_programs.json | def index
@ped_programs = PedProgram.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @ped_programs }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_programs\n uri = URI.parse(URL)\n response = Net::HTTP.get_response(uri)\n response.body\n end",
"def show\n @ped_program = PedProgram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ped_program }\n end\... | [
"0.73311335",
"0.6878419",
"0.6875702",
"0.68594396",
"0.68486893",
"0.68486893",
"0.68138915",
"0.6601128",
"0.65932405",
"0.6561959",
"0.64414346",
"0.63657534",
"0.6334446",
"0.63279384",
"0.63015985",
"0.6276734",
"0.6264216",
"0.62576157",
"0.61734676",
"0.6151699",
"0.6... | 0.7347414 | 0 |
GET /ped_programs/1 GET /ped_programs/1.json | def show
@ped_program = PedProgram.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @ped_program }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @program_app = ProgramApp.find(params[:id])\n\n respond_to do |format|\n format.json do\n render json: @program_app\n end\n end\n end",
"def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { r... | [
"0.7406592",
"0.73802394",
"0.73802394",
"0.7340742",
"0.72754884",
"0.69640154",
"0.6950823",
"0.69468045",
"0.67080843",
"0.6681949",
"0.6600035",
"0.6582392",
"0.6547388",
"0.65361536",
"0.65361536",
"0.6526064",
"0.65259045",
"0.65111274",
"0.6464885",
"0.6443576",
"0.640... | 0.72405416 | 5 |
GET /ped_programs/new GET /ped_programs/new.json | def new
@ped_program = PedProgram.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @ped_program }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end",
"def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n ... | [
"0.7818672",
"0.7818672",
"0.7524971",
"0.7400569",
"0.7267751",
"0.72644407",
"0.72306544",
"0.72296077",
"0.719304",
"0.7162572",
"0.70703703",
"0.70597124",
"0.70255417",
"0.696877",
"0.69405913",
"0.68864995",
"0.68658566",
"0.68197685",
"0.6761808",
"0.67614615",
"0.6759... | 0.77364576 | 2 |
POST /ped_programs POST /ped_programs.json | def create
@ped_program = PedProgram.new(params[:ped_program])
respond_to do |format|
if @ped_program.save
format.html { redirect_to @ped_program, notice: 'Ped program was successfully created.' }
format.json { render json: @ped_program, status: :created, location: @ped_program }
else
format.html { render action: "new" }
format.json { render json: @ped_program.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to @program, :notice => 'Program was successfully created.' }\n format.json { render :json => @program, :status => :created, :location => @program }\n else\n ... | [
"0.6897134",
"0.68759775",
"0.65981025",
"0.6593094",
"0.6563242",
"0.64376944",
"0.63941115",
"0.63401514",
"0.6332472",
"0.62788737",
"0.62684083",
"0.6233224",
"0.62068486",
"0.61877185",
"0.6179231",
"0.61584264",
"0.61286414",
"0.612771",
"0.6104234",
"0.60931903",
"0.60... | 0.699054 | 0 |
PUT /ped_programs/1 PUT /ped_programs/1.json | def update
@ped_program = PedProgram.find(params[:id])
respond_to do |format|
if @ped_program.update_attributes(params[:ped_program])
format.html { redirect_to @ped_program, notice: 'Ped program was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @ped_program.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, :notice => 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render... | [
"0.7207248",
"0.72069585",
"0.7000489",
"0.7000489",
"0.6974762",
"0.696703",
"0.6813224",
"0.6782424",
"0.67741454",
"0.66492826",
"0.6613973",
"0.66127384",
"0.6587482",
"0.6574013",
"0.65543246",
"0.65495664",
"0.64871085",
"0.6467312",
"0.64556366",
"0.6417795",
"0.639193... | 0.7176295 | 2 |
DELETE /ped_programs/1 DELETE /ped_programs/1.json | def destroy
@ped_program = PedProgram.find(params[:id])
@ped_program.destroy
respond_to do |format|
format.html { redirect_to ped_programs_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to progr... | [
"0.7274469",
"0.7268227",
"0.7268227",
"0.726555",
"0.7105637",
"0.70289755",
"0.7012836",
"0.7012836",
"0.7012836",
"0.7012836",
"0.6980171",
"0.68485576",
"0.68390507",
"0.67973566",
"0.67736775",
"0.67310476",
"0.6715477",
"0.66977954",
"0.66870177",
"0.6643717",
"0.659256... | 0.72272885 | 4 |
Calculates the row / column of an adjoining tile, based on the side 'sides' are numbered 0 through 5, with 0 being upper left, and moving clockwise. Returns a tuple of [row, column] for the resulting tile. | def adjoiningTile(row, column, side)
if( row.is_a?(Integer) && column.is_a?(Integer) && side.is_a?(Integer) )
case side
when 0
return [row - 1, column - 1]
when 1
return [row - 1, column]
when 2
return [row, column + 1]
when 3
return [row + 1, column]
when 4
return [row + 1, column - 1]
when 5
return [row, column - 1]
else
raise "Invalid side (" + side.to_s + ")!"
end
else
raise "Expected a (row, column, side) as (int, int, int)"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjacent_tiles(row, col)\n adj_tiles = []\n\n if row.positive?\n adj_tiles << tile_at(row - 1, col)\n adj_tiles << tile_at(row - 1, col - 1) unless col.zero?\n adj_tiles << tile_at(row - 1, col + 1) unless col == @size - 1\n end\n\n adj_tiles << tile_at(row, col - 1) unless col.zero?... | [
"0.6080967",
"0.583671",
"0.5737862",
"0.5715071",
"0.5705014",
"0.5667341",
"0.5632189",
"0.5615154",
"0.5582474",
"0.55503035",
"0.5535825",
"0.5484313",
"0.5461644",
"0.54614824",
"0.54484874",
"0.5445892",
"0.54359275",
"0.5403869",
"0.5376977",
"0.536974",
"0.5360599",
... | 0.775937 | 0 |
Returns the PublicEarth::Db::Collection, rather than an Atlas::Collection. TODO: Finish conversion of PublicEarth::Db::Collection to Atlas::Collection. | def collection
@collection ||= PublicEarth::Db::Collection.find_by_id!(collection_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def collection\n @collection ||= self.db.collection(self.collection_name)\n end",
"def collection\n @collection ||= database.collection Crocoduck::Store.server_collection\n end",
"def collection\n Jrodb::Collection::Basic.new(self)\n end",
"def collection\n @collection ||= Co... | [
"0.77548736",
"0.75899637",
"0.7507125",
"0.7496576",
"0.7479419",
"0.73512304",
"0.7310169",
"0.72744805",
"0.726776",
"0.7264631",
"0.7139148",
"0.7103905",
"0.7050674",
"0.702575",
"0.6961634",
"0.6953748",
"0.69424254",
"0.68506646",
"0.68506646",
"0.6803446",
"0.6801915"... | 0.82306665 | 0 |
We rewrite the provided canvas ids to: ensure it exists in the manifest (if they don't, mirador puts the user into a weird initial state) rewrite precocina canvas ids to postcocina canvas ids as appropriate (to avoid breaking embeds that used to work) rubocop:disable Metrics/AbcSize | def canvas_id
return if request.canvas_id.blank?
if canvases.any? { |canvas| canvas['@id'] == request.canvas_id }
request.canvas_id
elsif cocinafied_canvases? && request.canvas_id.exclude?('cocina-fileSet')
cocinafied_canvas_id
else
Honeybadger.notify(
"Unable to find requested canvas id '#{request.canvas_id}' in manifest for #{purl_object.druid}"
)
nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setMultipleCanvas\n # @annotationIn['canvas'] = '|'\n # @annotationIn['on'].each do |on|\n # @annotationIn['canvas'] += on['full'] + '|'\n # end\n # return @annotationIn['canvas']\n\n @annotationIn['on'][0]['full']\n end",
"def configureCanvasProvider(config_hash)\n logger.error \"@@@... | [
"0.51671386",
"0.5106367",
"0.47858417",
"0.47071484",
"0.47009945",
"0.4624035",
"0.46234953",
"0.45965797",
"0.45164967",
"0.4490806",
"0.44689232",
"0.44512233",
"0.44357508",
"0.44357508",
"0.44298148",
"0.44162613",
"0.44056684",
"0.4389592",
"0.4387859",
"0.4379568",
"0... | 0.6614143 | 0 |
List all available interfaces | def interfaces
iflist = `ifconfig | egrep "^[a-z0-9]+:" | awk '{print $1}' | sed 's/://'`.split
interfaces = Hash.new
interfaces['carp'] = []; interfaces['logical'] = []; interfaces['pfsync'] = []; interfaces['tunnel'] = []
interfaces['vlan'] = []; interfaces['trunk'] = []; interfaces['physical'] = []
iflist.each do |interface|
ifconfig = `ifconfig #{interface}`
iface = Hash.new
iface['ip'] = Array.new
iface['name'] = interface
ifconfig.each do |line|
case
when line =~ /flags=\d+\<(.*)\>\s+mtu\s+([0-9]+)/
iface['mtu'] = $2
iface['flags'] = $1.split(",")
iface["up?"] = iface['flags'].to_a.include?("UP") ? "up" : "down"
when line =~ /^\s*media:\s+(.*)/
iface['media'] = $1
when line =~ /lladdr\s+(.*)/
iface['lladdr'] = $1
when line =~ /description: (.*)/
iface['description'] = $1
when line =~ /^\s+inet ([0-9\.]+) netmask ([0-9\.a-fx]+) broadcast ([0-9\.])/
ip_address = $1
broadcast = $3
$2 =~ /(0x..)(..)(..)(..)/
netmask = $1.hex.to_s + "." + $2.hex.to_s + "." + $3.hex.to_s + "." + $4.hex.to_s
# Add a nice (dhcp) tag if the address has been given using dhcp
ip_address += " (dhcp)" if `ps -ax | egrep "dhclient: #{iface['name']} " | grep -v grep | wc -l`.to_i > 0
iface['ip'] << { "address" => ip_address, "netmask" => netmask, "broadcast" => broadcast }
end
end
case iface['name']
when /^carp/ then interfaces['carp'] << iface
when /^(tun|gif)/ then interfaces['tunnel'] << iface
when /^(enc|pflog|lo)[0-9]+/ then interfaces['logical'] << iface
when /^pfsync/ then interfaces['pfsync'] << iface
when /^vlan/ then interfaces['vlan'] << iface
when /^trunk/ then interfaces['trunk'] << iface
else interfaces['physical'] << iface
end
end
interfaces
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_interfaces\n @list = %x(/usr/sbin/networksetup -listallnetworkservices).split(\"\\n\").drop(1)\n end",
"def interfaces_list\n\t\t[\n\t\t\t{\n\t\t\t\t'uri' => '/',\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'purpose' => 'REST API Structure and Capability Discovery'\n\t\t\t}\n\t\t]\n\tend",
"def interfac... | [
"0.7889084",
"0.76509845",
"0.7390691",
"0.7368879",
"0.7358693",
"0.7311803",
"0.70828545",
"0.704498",
"0.70353276",
"0.68507147",
"0.68278056",
"0.68234175",
"0.6802205",
"0.6641686",
"0.655568",
"0.6536816",
"0.65230703",
"0.648733",
"0.6451476",
"0.6334007",
"0.63130057"... | 0.60195714 | 41 |
Use callbacks to share common setup or constraints between actions. | def set_media
@media = Media.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 |
Only allow a trusted parameter "white list" through. | def media_params
params.permit(:user_id, :type, :title, :description, :item, :message_id, :is_deleted)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
... | [
"0.7121987",
"0.70541996",
"0.69483954",
"0.6902367",
"0.6733912",
"0.6717838",
"0.6687021",
"0.6676254",
"0.66612333",
"0.6555296",
"0.6527056",
"0.6456324",
"0.6450841",
"0.6450127",
"0.6447226",
"0.6434961",
"0.64121825",
"0.64121825",
"0.63913447",
"0.63804525",
"0.638045... | 0.0 | -1 |
If servers is given, then this environment variable will only apply to that server (or array of servers) (these should match names given in :domain). If servers is not given, then this environment variable applies to all servers. | def env(key, value, servers = nil)
servers = Array(servers) if servers
@environment[[key, servers]] = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def servers=(servers)\r\n @servers = {}\r\n servers.each{|s| @servers[s.host] = s}\r\n end",
"def set_servers(servers)\n servers = Array(servers)\n servers.map! do |server|\n server.is_a?(String) ? server : inspect_server(server)\n end\n super\n end",
"def enter... | [
"0.6727048",
"0.66139",
"0.61317766",
"0.6121265",
"0.60839874",
"0.60374045",
"0.59241694",
"0.59241694",
"0.5913596",
"0.5811272",
"0.5779118",
"0.5750701",
"0.5742925",
"0.5716683",
"0.5696739",
"0.56193817",
"0.5572627",
"0.5555297",
"0.54933023",
"0.54788536",
"0.5453523... | 0.59428513 | 6 |
Returns an array of hashes for redis to pass to publisher | def team_members_for_output
members = team_memberships.map do |tm|
profile = tm.person_profile.published_version
next unless profile.present?
{
title: profile.content_item.title,
url_path: profile.content_item.url_path,
role_holder_name: profile.role_holder_name,
summary: profile.content_item.summary,
role_holder_photo_url: profile.role_holder_photo_url,
role_holder_photo_alt_text: profile.role_holder_photo_alt_text,
role_holder_photo_caption: profile.role_holder_photo_caption,
member_order: tm.member_order
}
end
members.compact!
# Split up the members who have or do not have an order for separate sorting later
members_without_order = []
members_with_order = []
members.each do |member|
if member[:member_order].nil?
members_without_order << member
else
members_with_order << member
end
end
# Sort the team members who have a specified order by order, then name
members_with_order.sort_by! { |m| [m[:member_order], m[:role_holder_name]] }
# Sort the team members who do not have a specified order by name only
members_without_order.sort_by! { |m| m[:role_holder_name] }
# List the ordered ones first, then ones without an order
members_with_order + members_without_order
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entries\n @redis.keys('*')\n end",
"def hash_to_redis(hash)\n hash.inject([]) { |arr, kv| arr + [kv[0], kv[1]] }\n end",
"def to_json_redis\r\n JSON.generate({:application_id => @application_id, \r\n :secure_hash_key => @secure_hash_key, \r\n ... | [
"0.6576654",
"0.6424024",
"0.6396166",
"0.6395923",
"0.6322102",
"0.6284408",
"0.61999875",
"0.6188677",
"0.6064842",
"0.6042535",
"0.59600085",
"0.5922322",
"0.58391297",
"0.58147764",
"0.5805049",
"0.5802257",
"0.57898283",
"0.57757455",
"0.5765015",
"0.57619435",
"0.574262... | 0.0 | -1 |
, :avatar_url def avatar_url object.avatar.url end | def success
object.member?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avatar_url\n avatar_uri(object)\n end",
"def avatar_url\n @attributes[:avatar_url]\n end",
"def avatar_url\n @attributes[:avatar_url]\n end",
"def avatar_url\r\n return @user.avatar_url\r\n end",
"def avatar\n object.avatar.url\n end",
"def avatar_url\n @d... | [
"0.88326186",
"0.84959793",
"0.84959793",
"0.8480823",
"0.8419805",
"0.83732456",
"0.7999302",
"0.79641056",
"0.796162",
"0.7920086",
"0.7909154",
"0.788931",
"0.78592026",
"0.77745324",
"0.7749754",
"0.7688729",
"0.7590882",
"0.7566636",
"0.7526722",
"0.75108284",
"0.7487780... | 0.0 | -1 |
Copyright (C) Hamsterland. All rights reserved. | def divisible min, max, num
for i in min..max
if num % i != 0
return false
end
end
return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def probers; end",
"def schubert; end",
"def berlioz; end",
"def hiss; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def dh; end",
"def terpene; end",
"def herald; end",
"def identify; end",
"def weber; end",
"def blg; end",
"de... | [
"0.6940908",
"0.63237536",
"0.61760026",
"0.6125841",
"0.6124663",
"0.6070463",
"0.6070463",
"0.6070463",
"0.6070463",
"0.60607785",
"0.59713674",
"0.59098226",
"0.5906366",
"0.5885416",
"0.5859558",
"0.5856454",
"0.5851987",
"0.5816286",
"0.577079",
"0.5747805",
"0.5747805",... | 0.0 | -1 |
Don't do anything; the interesting work has already been done in | def validate(*args, &block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def done!\n # Do nothing\n end",
"def done!\n # Do nothing\n end",
"def behold_nothing_happens!\n behold! {}\n end",
"def pausable; end",
"def done\n # Do nothing.\n end",
"def done; end",
"def keep_going; end",
"def post_process; end",
"def running; end",
"def... | [
"0.63040125",
"0.63040125",
"0.62884694",
"0.62741685",
"0.62526935",
"0.61460346",
"0.6144904",
"0.6094074",
"0.6082118",
"0.6082118",
"0.6078432",
"0.60683423",
"0.60683423",
"0.60496694",
"0.60496694",
"0.60496694",
"0.60496694",
"0.60496694",
"0.60496694",
"0.60496694",
"... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.