query stringlengths 7 9.5k | document stringlengths 10 1.07M | negatives listlengths 19 19 | metadata dict |
|---|---|---|---|
UTILITY METHODS USED THROUGHOUT THIS SCRIPT Function to retrieve all data from Eve Dump Database and Import all the data into the new schema/db | def fetch_and_import!(opts={})
eve_table = opts[:eve_table]
dest_table = opts[:dest_table]
mapping = opts[:mapping]
dbh = opts[:conn] || @dbh
comment_label = opts[:label]
# Fetch Data from crpActivities Table
results = dbh.query("SELECT * FROM "+eve_table)
# Clear Destination Table to eliminate Redun... | [
"def import_data\n puts \"loading #{DATADIR}/dumped_data.sql in #{@database} DB\"\n Dir.chdir(DATADIR)\n queries = ['SET foreign_key_checks = 0',\n \"source #{DATADIR}/dumped_data.sql\",\n 'SET foreign_key_checks = 1;']\n Sql.query(@normal_mode, querie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Export group repository for testing. Students' submitted files are stored in the group repository. They must be exported before copying to the test server. | def export_group_repo(test_run)
grouping = test_run.grouping
group = grouping.group
repo_dir = File.join(AutomatedTestsClientHelper::STUDENTS_DIR, group.repo_name)
if File.exist?(AutomatedTestsClientHelper::STUDENTS_DIR)
if File.exist?(repo_dir) # can exist from other assignments, we don't want to... | [
"def export_group_repo(test_run)\n grouping = test_run.grouping\n group = grouping.group\n assignment = grouping.assignment\n export_path = File.join(TestRun::STUDENTS_DIR, group.repo_name)\n assignment_path = File.join(export_path, assignment.repository_folder)\n if File.exist?(TestRun::STUDENTS_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for Creating the profile with surgeon | def create
# Creating the profile for particular surgeon
surgeon_profile = devise_current_user.setting.build_profile(profile_params)
# Condition checking the profile is saved or not
if surgeon_profile.save
# If Profile is save then that's take it into the profile show page
redirect_to profile_path(surgeo... | [
"def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = current_user.setting.build_profile(speciality_name: params[:speciality_name],sub_speciality_name:params[:sub_speciality_name],:medical_school=>params[:medical_school],:residency=>params[:residency],:spe_training=>params[:spe_train... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
showing the list of the profile setting details | def profile_setting_list
# find the home address
@home_addresses = @profile_setting.addresses.where(address_type: "home")
end | [
"def index\n @profile_settings = ProfileSetting.all\n end",
"def index\n @full_profiles = FullProfile.all\n end",
"def profiles\r\n ProfilesController.instance\r\n end",
"def show_metadata_profiles\n @profiles = @institution.metadata_profiles.order(:name)\n render partial: \"show_metadat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for updating the particular profile details | def update
# Updating the details according the that particular profile
@profile.update_attributes(profile_params)
# Redirect to the particular surgeon profile show page
redirect_to profile_path(@profile)
end | [
"def update_profile\n @profile = @account.employee\n \n if params[:profile].present?\n @profile.assign_attributes(profile_params)\n @profile.save\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {success: 'Profile has been updated successfully.'}\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method for find the user profile data of the address | def user_profile_data
@user = devise_current_user
# find the work address
@work_addresses = @profile_setting.addresses.where(address_type: "work").count
# find the home address
@home_addresses = @profile_setting.addresses.where(address_type: "home").count
end | [
"def address\n user.addresses.find(_address_id) if _address_id\n end",
"def find_profile\n @user = User.find_by_username(params[:id])\n @profile = @user.profile\n end",
"def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info['query']['results'][\"profile\"]\n end",
"def profile_de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for user app data page | def user_app_data
# assign devise user as instance variable
@user = devise_current_user
end | [
"def user_data\n @config.user_data\n end",
"def index\n @app_data = AppDatum.all\n end",
"def user_data\n data.user_data\n end",
"def decide\n @meta = { title: 'Select Application', description: 'Select the application you want to login to' }\n @user_app_access_list = ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for user work phone page | def user_work_phone
end | [
"def work_phone\n return unless @user.loa3?\n\n dig_out('telephones', 'phone_type', VAProfile::Models::Telephone::WORK)\n end",
"def user_home_phone\n\tend",
"def set_WorkPhone(value)\n set_input(\"WorkPhone\", value)\n end",
"def set_WorkPhone(value)\n set_input(\"WorkPhon... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for user home phone page | def user_home_phone
end | [
"def home_phone\n return unless @user.loa3?\n\n dig_out('telephones', 'phone_type', VAProfile::Models::Telephone::HOME)\n end",
"def _home_page\n _get_page 'home.php', :promote => ''\n end",
"def set_HomePhone(value)\n set_input(\"HomePhone\", value)\n end",
"def set_HomePhone(val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for user address page | def user_address
end | [
"def address\n user.address\n end",
"def visit_user_addresses(user)\n visit spree.edit_admin_user_path(user)\n expect_address_list\n\n expect_user_addresses(user)\n end",
"def address_form\n @user = Athlete.find session[:user_id]\n respond_with @user do |format|\n format.js { render 'co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for Update the user profile address inside the setting | def update_address
if !params[:profile_setting].present?
redirect_to user_profile_data_profile_path
else
@address = @user.update_attributes(address_params)
if @address
# redirect to the profile app page
redirect_to user_profile_data_profile_path
else
# redirect to the user address page
... | [
"def update_contact_info post\n AddressManager::set_user_address post.user, post\n end",
"def update_address\n @address = Spree::Address.where(id: params[:address][:id]).first\n @address.update_attributes(address_params_list) if @address.present?\n @user = current_user\n end",
"def update_prof... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for high school the page | def high_school
end | [
"def secondary_school; end",
"def primary_school; end",
"def medical_school\n\tend",
"def getStudentAdvisorPageFromSchoology(id)\n\n end",
"def instructor_home\n end",
"def index\n authorize Highschool\n @highschools = Highschool.order(:name).search(params[:search]).page(params[:page])\n end",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for Update the user profile high school inside the setting | def update_high_school
if !params[:profile_setting].present?
redirect_to user_profile_data_profile_path
else
# update the user school with high school params
@high_school = @user.update_attributes(high_school_params)
if @high_school
# redirect to the profile app page
redirect_to user_profile_da... | [
"def apply_user_settings!\n user.update_attributes(current_school_id: self.school_id, teacher: self.teacher, grade: self.grade)\n end",
"def update_medical_school\n\t\tif !params[:profile_setting].present?\n\t\t\tredirect_to user_profile_data_profile_path \n\t\telse\n\t\t\t# update the user medical school... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for medical school the page | def medical_school
end | [
"def high_school\n\tend",
"def getStudentAdvisorPageFromSchoology(id)\n\n end",
"def primary_school; end",
"def secondary_school; end",
"def thesis\n 'Thesis/Dissertation' if record.find { |a| a.tag == '502' }\n end",
"def student_page\n if session[:role] == \"Teacher\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for Update the user profile medical school inside the setting | def update_medical_school
if !params[:profile_setting].present?
redirect_to user_profile_data_profile_path
else
# update the user medical school with medical_school_params
@medical_school = @user.update_attributes(medical_school_params)
if @medical_school
# redirect to the profile app page
redi... | [
"def update_high_school\n\t\tif !params[:profile_setting].present?\n\t\t\tredirect_to user_profile_data_profile_path \n\t\telse\n\t\t\t# update the user school with high school params\n\t\t\t@high_school = @user.update_attributes(high_school_params)\n\t\t\tif @high_school\n\t\t\t\t# redirect to the profile app page... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for residency the page | def residency_diploma
end | [
"def residency\n return @residency\n end",
"def residency=(value)\n @residency = value\n end",
"def page_setup_pr; end",
"def page page; super page.to_i; end",
"def fit_to_page?; end",
"def active_page_design\n self.page_design\n end",
"def get_sur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for Update the user residency diploma inside the setting | def update_residency_diploma
if !params[:profile_setting].present?
redirect_to user_profile_data_profile_path
else
# Method for the creating the residency or diploma attributes
@residency_diploma = @user.update_attributes(residency_diploma_params)
# redirect to the profile app page
redirect_to user_... | [
"def residency=(value)\n @residency = value\n end",
"def residency_diploma\n\tend",
"def set_relevancy!\n # calculate total of ratings\n ratings = rating.count_attributes\n ratings.each do |key,value|\n ratings[key] = value * SolutionRelevancy.send(\"rating_value_#{key}\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for specility training page | def spe_training
end | [
"def index\n @training = Training.find(params[:training])\n @trainee_distributions = @training.trainee_distributions\n end",
"def sample_page\n\n end",
"def index\n @training_methods = TrainingMethod.all\n end",
"def page_setup_pr; end",
"def notes_from_training\n end",
"def update_train\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method of update the user spec training inside the setting | def update_spe_training
if !params[:profile_setting].present?
redirect_to user_profile_data_profile_path
else
# creating the spec training the according the spe training params
@spe_training = @user.update_attributes(spe_training_params)
# redirect to the profile app page
redirect_to user_profile_da... | [
"def set_user_training\n @user_training = UserTraining.find_by_id( params[:id].to_i )\n end",
"def update_user\n @user.send(\"set_\" + GlobalConstant::User.kyc_submitted_property)\n # @user.send(\"set_\" + GlobalConstant::User.doptin_mail_sent_property)\n @user.save! if @user.changed?\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for creating the award page | def award
end | [
"def create\n @award = Award.new(params[:award])\n\n respond_to do |format|\n if @award.save\n flash[:notice] = 'Award was successfully created.'\n format.html { redirect_to awards_path }\n format.xml { render :xml => @award, :status => :created, :location => @award }\n else\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for update the award attributes | def update_award
if !params[:profile_setting].present?
redirect_to user_profile_data_profile_path
else
# creating the award by using the award params
@award = @user.update_attributes(award_params)
# redirect to the profile app page
redirect_to user_profile_data_profile_path
end
end | [
"def update_award! \n increment_award\n update_expiration\n end",
"def update\n @award = Award.find(params[:id])\n\n respond_to do |format|\n if @award.update_attributes(params[:award])\n format.html { redirect_to @award, notice: 'Award was successfully updated.' }\n format.json { ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for listing the all the surgery name list | def surgery_name_list
@surgeries = devise_current_user.surgeries.to_a.uniq {|surgery| surgery.name}
end | [
"def surgery_name_list\n\t\tsurgeries = current_user.surgeries\n\t\tif surgeries.present?\n\t\t# response to the JSON\n \t render json: { success: true, response: {surgeries: surgeries.collect(&:name).as_json } },:status=> 200\n\t else\n\t render :json=> { success: false, message: \"Surgeries are not ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for edit the surgery name | def edit_surgery_name
end | [
"def update_surgery_name\n\t\t@surgery.update(surgery_params)\n\t\tredirect_to surgery_name_list_profiles_path\n\tend",
"def update_surgery\n # update the surgery name \n Surgery.where(case_id: self.id).update(name: self.surgery_name)\n end",
"def edit_diagnose_name\n\t\t\n\tend",
"def edit_name\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for update the surgery name | def update_surgery_name
@surgery.update(surgery_params)
redirect_to surgery_name_list_profiles_path
end | [
"def update_surgery\n # update the surgery name \n Surgery.where(case_id: self.id).update(name: self.surgery_name)\n end",
"def edit_surgery_name\n\tend",
"def change_name(new_name)\n\t\t@name = new_name\n\tend",
"def update_research_name\n res_name = I18n.transliterate(Tag.sanitize_name(self.n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for listing the all the diagnose name list | def diagnosis_name_list
@diagnose = devise_current_user.diagnose.to_a.uniq {|diagnosis| diagnosis.name}
end | [
"def diagnoses_list\n\t\tdiagnoses.any? ? diagnoses.map{|diagnosis| diagnosis.description_and_code}.to_sentence : \"\"\n\tend",
"def diagnosis_name_list\n\t\tdiagnose = current_user.diagnose\n\t\tif diagnose.present?\n\t\t# response to the JSON\n \t render json: { success: true, response: {diagnose: diagnos... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for edit the diagnose name | def edit_diagnose_name
end | [
"def update_diagnose\n # update the diagnose name \n Diagnose.where(case_id: self.id).update(name: self.diagnose_name)\n end",
"def update_diagnose_name\n\t\t@diagonse.update(diagonse_params)\n\t\tredirect_to diagnosis_name_list_profiles_path\n\tend",
"def set_name\n self.update(name: \"Xtra-La... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for update the diagnose name | def update_diagnose_name
@diagonse.update(diagonse_params)
redirect_to diagnosis_name_list_profiles_path
end | [
"def update_diagnose\n # update the diagnose name \n Diagnose.where(case_id: self.id).update(name: self.diagnose_name)\n end",
"def edit_diagnose_name\n\t\t\n\tend",
"def set_name\n self.update(name: \"Xtra-Large Washer ##{self.id}\") unless self.name\n end",
"def set_name\n self.update(n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for showing the profile photo | def profile_photo
end | [
"def show_avatar\n @profile = current_user.profile\n if @profile.avatar.present?\n image_tag(@profile.avatar.url(:large), :class => \"img-thumbnail img-responsive\")\n else\n image_tag(\"/images/avatar.png\", :class => \"img-thumbnail img-responsive\")\n end \n end",
"def profile_pic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for showing the specialist_setting page | def specialist_setting
end | [
"def reseller_settings\n @page_title = _('Settings')\n @page_icon = 'cog.png'\n\n @countries = Direction.find(:all, :order => \"name ASC\")\n if Confline.get_value(\"User_Wholesale_Enabled\").to_i == 0\n cond = \" AND purpose = 'user' \"\n else\n cond = \" AND (purpose = 'user' OR purpose =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search the specialist name from all the specialities | def profile_specialist_search
# search the the speciality name according to the terms
specialities = Speciality.any_of({ :name => /^#{params[:term]}/i }).all.collect{|speciality| {label: speciality.name ,value: speciality.id.to_s}}.to_json
# render to the surgery name page
respond_to do |format|
format.js... | [
"def specialities(characters)\n # initialize empty array\n result = []\n\n #iterate through characters\n characters.each do |character_hash|\n phrase = character_hash[:name]+\"'s specialty is to \" + character_hash[:specialty].upcase\n result << phrase\n end\n\n return result\n\nend",
"def autocomplet... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for Permitting the residency diploma params | def residency_diploma_params
params.require(:profile_setting).permit( residency_diplomas_attributes: [:id, :text, :_destroy])
end | [
"def residency_diploma\n\tend",
"def update_residency_diploma\n\t\tif !params[:profile_setting].present?\n\t\t\tredirect_to user_profile_data_profile_path \n\t\telse\n\t\t\t# Method for the creating the residency or diploma attributes\n\t\t\t@residency_diploma = @user.update_attributes(residency_diploma_params)\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for Finding the particular profile for the surgeon | def find_profile
# Find particular Profile
@profile = Profile.find(params[:id])
end | [
"def profile(name = 'CoursAvenue')\n @profile ||= user.profiles.first\n # @profile ||= user.profiles.find do |profile|\n # profile.name == name\n # end\n end",
"def find_profile\n @user = User.find_by_username(params[:id])\n @profile = @user.profile\n end",
"def find_profile\n unles... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for Find the all surgery location for the profile surgeon | def find_surgery_location
# Find the surgeon location based on the profile
@surgery_locations = devise_current_user.setting.surgery_locations.all
end | [
"def find_surgery_location\n\t\t# Find the surgeon location based on the profile\n\t\t@surgery_locations = current_user.setting.surgery_locations.all\n\tend",
"def find_location\n\t\t@surgery_location = SurgeryLocation.find(params[:id])\n\tend",
"def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for find all the question for the particular profile surgeon | def questions_list
# List of the questions for the particular surgeon
@questions = devise_current_user.questions.all
end | [
"def surgeon_questions\n\t\t@questions = current_user.questions.all\n\tend",
"def question\n # get the question for every user\n end",
"def questions\n questions = Pairwise::Question.find(:all, :params => {:creator => @local_identifier})\n questions.select {|q| q if q.local_identifier == @local_identi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method the surgery by name | def find_surgery
@surgery = Surgery.find(params[:id])
end | [
"def edit_surgery_name\n\tend",
"def update_surgery\n # update the surgery name \n Surgery.where(case_id: self.id).update(name: self.surgery_name)\n end",
"def update_surgery_name\n\t\t@surgery.update(surgery_params)\n\t\tredirect_to surgery_name_list_profiles_path\n\tend",
"def update_gate_metho... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse organization data from given url, parses also repositories | def parse_org(org_url)
puts "reading: #{org_url}"
org_data = load_json(org_url)
write(org_url, org_data)
org_data.each do |repo|
parse_repo(repo['contributors_url'], " ")
end
end | [
"def get_org_repos\n url = URI(\"#{$api}/user/orgs\")\n response = git_api_response(url)\n if response.kind_of? Net::HTTPSuccess\n orgs = JSON.parse(response.body)\n orgs.each do |org|\n org_repos_url = org['repos_url']\n url = URI(org_repos_url)\n response = git_api_response(url) # Get t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse user data from given url | def parse_user(user_url, str_prefix="")
puts "#{str_prefix}reading: #{user_url}"
user_data = load_json(user_url)
write(user_url, user_data)
end | [
"def parse_url\n set_url_type_and_command\n generate_field\n set_domain\n end",
"def get_data\n if @nickname && @url\n @page = fetch_url(@url)\n @parse_time = parse_profile_page\n self.total_time\n end\n end",
"def parse(url)\n matches = url.match(%r{[:/](?<user>[^/]+... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Meeting Header" context type definition. | def context_type_meeting_header
ContextTypeDef.new(
:meeting_header,
[
/(\s*(Distanze speciali|((\d{1,3}\D{1,2}|[IXVMCDL]{1,8})\s(\S+|Trof|Region))))|(\d{1,2}((\/|-|\,)\d{1,2})*\s(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic).*\s\d{4})/i,
/(\s*Manifestazione organizzata da)|(\s*(Dista... | [
"def context_type_meeting_header\n V3::ContextType.new(\n :meeting_header,\n conditions: [\n /(\\s*(Distanze speciali|((\\d{1,3}\\D{1,2}|[IXVMCDL]{1,8})\\s(\\S+|Trof|Region))))|(\\d{1,2}((\\/|-|\\,)\\d{1,2})*\\s(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic).*\\s\\d{4})/i,\n /(\\s*Manif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Category Header" context type definition. | def context_type_category_header
ContextTypeDef.new(
:category_header,
[
/^\s*(\r\n|\n|$|\Z|Torna a inizio pagina)/i, # matches any kind of newline, an empty line or a line with only invisible chars
/(?<!\dx)(50\s|100\s|200\s|400\s|800\s|1500\s) *(stile|misti|dorso|rana|farf|SL|DO|RA|FA... | [
"def context_type_category_header\n V3::ContextType.new(\n :category_header,\n conditions: [\n# /(?<anything>^.*)/i,\n# /(?<empty>^\\s*\\n|^\\r\\n|^\\z)/i,\n /-{60}/,\n /(?<style>\\s{3}-{3}\\s{1,3}(?<distance>50|100|200|400|800|1500))\\s(?<stroke>\\w+)/i\n\n# /-{80}|^... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Relay Header" context type definition. | def context_type_relay_header
ContextTypeDef.new(
:relay_header,
[
/^\s*(\r\n|\n|$|\Z|Torna a inizio pagina)/i,
/(mistaff|staff).*\s+\d{1,2}x\d{2,3}\s+(stile|mi|sl|mx).*\s+-\s+cat/i,
/\s*-{10}-*/
]
)
end | [
"def context_type_relay_header\n ContextTypeDef.new(\n :relay_header,\n [\n# /(?<empty>^\\s*\\r?\\n|^\\r?\\n|^\\s*\\n|^\\s*$)/i,\n# /(?<empty>^\\s*\\r?\\n|^\\r?\\n|^\\s*\\n|^\\s*$)/i,\n /\\s(4|8)x(25|50|100|200)\\s+(mista|stile libero)\\s+Cat/i,\n /-{60,}/\n ]\n )\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Team Stats" (header) context type definition. | def context_type_team_stats
ContextTypeDef.new(
:team_stats,
[
/statistiche\s+societ./i
]
)
end | [
"def context_type_team_ranking\n ContextTypeDef.new(\n :team_ranking,\n [\n /(classifica)(\\s+di)?(\\s+societ.)?/i\n ]\n )\n end",
"def context_type_meeting_header\n V3::ContextType.new(\n :meeting_header,\n conditions: [\n /(\\s*(Distanze speciali|((\\d{1,3}\\D{1,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
== DETAIL CONTEXT TYPES definitions: == "Result row" (detail) context type definition. | def context_type_result_row
ContextTypeDef.new(
:result_row,
[
/(Ritir.*|Squal.*|\d{1,2}'\d\d"\d\d)( {1,6})+\d{1,4}[\,|\.]\d\d(\r\n|\n|$|\Z)/i
],
:category_header # parent context
)
end | [
"def context_type_result_row\n ContextTypeDef.new(\n :result_row,\n [\n /(\\s{3,20}NP|\\s{3,20}SQ|\\s{3,20}RIT|(\\d{1,2}')?\\d\\d.\\d\\d\\s*\\d{3,4}[\\,|\\.]\\d{1,2}\\s*(RI|RE|RM)?)(\\r\\n|\\n|$|\\Z)/i\n ],\n :individual_category_header # parent context\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Statistics details section" context type definition. | def context_type_stats_details
ContextTypeDef.new(
:stats_details,
[
/numero di soc.+\siscritte\s/i,
/(?<anything>^.*)/i,
/numero di soc.+\spartecipanti\s/i,
/(?<anything>^.*)/i,
/numero tot.+\sdi atleti iscritti\s/i,
/(?<anything>^.*)/i,
/(?<anyt... | [
"def context_type_stats_details_type1\n V3::ContextType.new(\n :stats_details_1,\n conditions: [\n /\\ssociet.\\siscritte\\s/i,\n /(?<anything>^.*)/i,\n /\\ssociet.\\spartecipanti\\s/i,\n /(?<anything>^.*)/i,\n\n /\\satleti\\siscritti\\s/i,\n /(?<anything>^.*)/... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
++ Returns the list of all the ContextTypeDefs member objects defined. (Commodity method used only inside specs.) | def get_context_types_list
[
context_type_meeting_header,
context_type_category_header,
context_type_relay_header,
context_type_team_ranking,
context_type_team_stats,
context_type_stats,
context_type_result_row,
context_type_relay_row,
context_type_ranking_row,
... | [
"def get_context_types_list\n [\n context_type_meeting_header,\n context_type_category_header,\n context_type_entry_row\n ]\n end",
"def get_context_types_list\n [\n context_type_meeting_header,\n context_type_category_header,\n context_type_relay_header,\n context_typ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
++ "meeting_header.title" token extractor definition | def tokenizer_meeting_header_title
TokenExtractor.new(
:title,
/((?<roman>(([IXVMCDL]{1,6})(?<cardinal>°|ª|\^|�|\.o)?\s))(?<type>(Tr|Meeting|Gara|(?<special>region|distanze|campion))\D*\s)|(\d{1,2}(\g<cardinal>))|\g<type>)/i,
# Old version; /((?<roman>(([IXVMCDL]{1,6})(?<cardinal>°|ª|\^|�|\.o)?\s)... | [
"def tokenizer_meeting_header_title\n V3::TokenExtractor.new(\n :title,\n /((?<roman>(([IXVMCDL]{1,6})(?<cardinal>°|ª|\\^|�|\\.o)?\\s))(?<type>(Tr|Meeting|Gara|(?<special>region|distanze|campion))\\D*\\s)|(\\d{1,2}(\\g<cardinal>))|\\g<type>)/i,\n /$/i,\n 4 ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"meeting_header.meeting_dates" token extractor definition | def tokenizer_meeting_header_meeting_dates
TokenExtractor.new(
:meeting_dates,
/(?<wholedate>(?<=\s\-\s|\s\-\-\-\s|\s\s|^)(?<weekday>(dom|lun|mar|mer|gio|ven|sab)\D*\s)?((?<twodigitsep>(\d{1,2})(\/|-|\,|\s)){1,4}(?<month>\d{1,2}|(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)\D*))(\/|-|\,|\s)(?<year>\... | [
"def tokenizer_meeting_header_meeting_dates\n V3::TokenExtractor.new(\n :meeting_dates,\n /(?<wholedate>(?<=\\s\\-\\s|\\s\\-\\-\\-\\s|\\s\\s|^)(?<weekday>(dom|lun|mar|mer|gio|ven|sab)\\D*\\s)?((?<twodigitsep>(\\d{1,2})(\\/|-|\\,|\\s)){1,4}(?<month>\\d{1,2}|(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"meeting_header.organization" token extractor definition | def tokenizer_meeting_header_organization
TokenExtractor.new(
:organization,
/(?<=manifestazione organizzata da )/i,
/\z/i,
3 # line_timeout
)
end | [
"def tokenizer_meeting_header_organization\n V3::TokenExtractor.new(\n :organization,\n /(?<=manifestazione organizzata da )/i,\n /\\z/i,\n 4 # line_timeout\n )\n end",
"def tokenizer_meeting_header_organization\n V3::TokenExtractor.new(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
++ "category_header.distance" token extractor definition | def tokenizer_category_header_distance
TokenExtractor.new(
:distance,
/(?<!\dx)(50 |100 |200 |400 |800 |1500 ) */i,
/ *(stile|mi|do|ra|fa|sl|MX|DF|DS|RN).*/i
)
end | [
"def tokenizer_category_header_distance\n V3::TokenExtractor.new(\n :distance,\n /(?<!\\dx)(50 |100 |200 |400 |800 |1500 ) */i,\n / *(stile|mi|do|ra|fa|sl|MX|DF|DS|RN).*/i\n )\n end",
"def tokenizer_category_header_distance\n V3::TokenExtractor.new(\n :distance,\n /(?<!\\dx)(50|... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"category_header.style" token extractor definition | def tokenizer_category_header_style
TokenExtractor.new(
:style,
/ *(stile|mi|do|ra|fa|sl|MX|DF|DS|RN).*/i,
/ *(maschi|femmi)/i
)
end | [
"def tokenizer_category_header_style\n TokenExtractor.new(\n :style,\n /(?<=0)\\s+(stile\\slibero|farfalla|dorso|rana|misti)/ix,\n /\\s*(master|under)/i\n )\n end",
"def tokenizer_category_header_style\n V3::TokenExtractor.new(\n :style,\n /\\s*(stile|mi|do|ra|fa|sl|MX|DF|DS|RN)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"category_header.gender" token extractor definition | def tokenizer_category_header_gender
TokenExtractor.new(
:gender,
/ *(maschi|femmi)/i,
# Alt. vers.: /\s+(maschi|femmi)/ui
/\s+-\s+categoria/i
)
end | [
"def tokenizer_category_header_gender\n V3::TokenExtractor.new(\n :gender,\n /\\s*(maschi|femmi)/i,\n /(?<=ile|chi|ine)(\\s+\\-{3}|\\s+\\-\\s+categoria)/i\n )\n end",
"def tokenizer_category_header_gender\n TokenExtractor.new(\n :gender,\n /(femmine|maschi)/i,\n /\\s*codice... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"category_header.category_group" token extractor definition | def tokenizer_category_header_group
TokenExtractor.new(
:category_group,
/ *((master|under)\s\d\d|[MU]\d\d)/i,
/ *tempo base */i
)
end | [
"def tokenizer_category_header_group\n TokenExtractor.new(\n :category_group,\n /(?<=(master|under\\s))\\s*[MU].{2}\\s*(?=maschi|femmine)/ix,\n 3\n )\n end",
"def tokenizer_individual_category_header_group\n TokenExtractor.new(\n :category_group,\n / *master\\s*(\\d[05]})/i,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"category_header.base_time" token extractor definition | def tokenizer_category_header_base_time
TokenExtractor.new(
:base_time,
/\d{1,2}'\d\d"\d\d/,
9 # (max size)
)
end | [
"def tokenizer_individual_category_header_base_time\n TokenExtractor.new(\n :base_time,\n /(\\d{1,2}')?\\d{2}.\\d{2}/,\n 9 # (max size)\n )\n end",
"def tokenizer_relay_category_header_base_time\n TokenExtractor.new(\n :base_time,\n /(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
++ "relay_header.type" token extractor definition | def tokenizer_relay_header_type
TokenExtractor.new(
:type,
/(mistaff|staff).*\s+\d{1,2}x\d{2,3}\s+(stile|mi|sl|mx)/i,
/\s+-\s+cat/i
)
end | [
"def tokenizer_relay_header_type\n V3::TokenExtractor.new(\n :type,\n /(mistaff|staff).*\\s+\\d{1,2}x\\d{2,3}\\s+(stile|mi|sl|mx)/i,\n /(?<=ile|chi|ine|ero|sta|sti)(\\s+\\-{3}|\\s+\\-\\s+categoria)/i\n )\n end",
"def tokenizer_relay_header_type\n TokenExtractor.new(\n :type,\n /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"relay_header.distance" token extractor definition | def tokenizer_relay_header_distance
TokenExtractor.new(
:distance,
/\dx\d{2,3}\s+(stile|mi|sl|mx)/i,
4 # (max size)
)
end | [
"def tokenizer_relay_header_distance\n V3::TokenExtractor.new(\n :distance,\n /\\dx\\d{2,3}\\s+(stile|mi|sl|mx)/i,\n 4 # (max size)\n )\n end",
"def tokenizer_event_detailed_header_distance\n TokenExtractor.new(\n :distance,\n /(mista ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"relay_header.style" token extractor definition | def tokenizer_relay_header_style
TokenExtractor.new(
:style,
/(?<=\d\s)\s*(stile|mi|sl|mx)/i,
/\s+(-\s+cat|masch|femm)/i
)
end | [
"def tokenizer_relay_header_style\n V3::TokenExtractor.new(\n :style,\n /(?<=\\d\\s)\\s*(stile|mi|sl|mx)/i,\n /(\n (\\s+\\-\\s+categoria)|\n (\\s{3}\\-{3}(\\n|$)|\\smista(\\n|$|\\s{3}\\-{3})|\\smasch|\\sfemm)\n )/ix\n )\n end",
"def tokenizer_relay_header_style\n TokenE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"relay_header.category_group" token extractor definition | def tokenizer_relay_header_category_group
TokenExtractor.new(
:category_group,
/(\s+|M)\d\d0(\-\d\d\d)*/i,
7 # (max size)
# Alt. vers. (instead of '7'): /\s*tempo base\s*/ui
)
end | [
"def tokenizer_relay_category_header_group\n TokenExtractor.new(\n :category_group,\n / *master\\s+([1234][02468]0})/i,\n / *(maschi|femmi|mist)/i\n )\n end",
"def tokenizer_category_header_group\n TokenExtractor.new(\n :category_group,\n / *((master|under)\\s\\d\\d|[MU]\\d\\d)/... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"relay_header.base_time" token extractor definition | def tokenizer_relay_header_base_time
TokenExtractor.new(
:base_time,
/\s\d{1,2}'\d\d"\d\d/i,
9 # (max size)
)
end | [
"def tokenizer_relay_category_header_base_time\n TokenExtractor.new(\n :base_time,\n /(\\d{1,2}')?\\d{2}.\\d{2}/,\n 9 # (max size)\n )\n end",
"def tokenizer_category_header_base_time\n TokenExtractor.new(\n :base_time,\n /\\d{1,2}'\\d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"result_row.team_code" token extractor definition | def tokenizer_result_row_team_code
TokenExtractor.new(
:team_code,
/([a-z?]{3}-\d{6})/i,
10 # (max size)
)
end | [
"def tokenizer_result_row_team_code\n V3::TokenExtractor.new(\n :team_code,\n /(?<team_code>\\w{3}\\-.\\d{5}|\\w{3}.\\d{5})\\s/i,\n# /(?<=\\w{3}\\-.\\d{5}|\\w{3}.\\d{5}\\s)/i\n 9 # (max size)\n )\n end",
"def tokenizer_result_row_team_name\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"result_row.swimmer_name" token extractor definition | def tokenizer_result_row_swimmer_name
TokenExtractor.new(
:swimmer_name,
/
(
(?<=[\s\?a-z0-9-]{10}\s\d{4})
)\s([a-z]\D{4,28}\s)
/uix,
29 # (max size)
)
end | [
"def tokenizer_result_row_swimmer_name\n TokenExtractor.new(\n :swimmer_name,\n 7,\n 26\n )\n end",
"def tokenizer_result_row_swimmer_name\n V3::TokenExtractor.new(\n :swimmer_name,\n /(?<=fc\\s|fc\\s\\s|fg\\s|fg\\s\\s|\\d\\s|\\d\\s\\s|\\D{3}\\-.\\d{5}\\s|\\D{3}.\\d{5}\\s)(\\D{2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"result_row.result_score" token extractor definition | def tokenizer_result_row_result_score
TokenExtractor.new(
:result_score,
/\b\d{1,4}[\,|\.]\d\d(\r\n|\n|$|\Z)/i,
7 # (max size)
)
end | [
"def tokenizer_result_row_result_score\n V3::TokenExtractor.new(\n :result_score,\n /\\b(?<score>\\d{1,4}[\\,|\\.]\\d\\d)(?=\\s*(\\D\\D\\s\\(\\D\\d\\d\\))?(\\r\\n|\\n|$|\\Z))/i,\n /(?<=\\d[\\,|\\.]\\d\\d)(\\s|\\r\\n|\\n|$|\\Z)/i\n )\n end",
"def tokenizer_ranking_row_result_score\n V3::To... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"relay_row.result_score" token extractor definition | def tokenizer_relay_row_result_score
TokenExtractor.new(
:result_score,
/\s\d{1,4}[\,|\.]\d\d(\r\n|\n|$|\Z)/i,
# 68, # (starting idx)
8 # (max size)
)
end | [
"def tokenizer_result_row_result_score\n V3::TokenExtractor.new(\n :result_score,\n /\\b(?<score>\\d{1,4}[\\,|\\.]\\d\\d)(?=\\s*(\\D\\D\\s\\(\\D\\d\\d\\))?(\\r\\n|\\n|$|\\Z))/i,\n /(?<=\\d[\\,|\\.]\\d\\d)(\\s|\\r\\n|\\n|$|\\Z)/i\n )\n end",
"def tokenizer_result_row_result_score\n TokenEx... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
++ "ranking_row.result_position" token extractor definition | def tokenizer_ranking_row_result_position
TokenExtractor.new(
:result_position,
0,
#/(.)(?=[a-z°)])/i
/\s*(\w|\?){3}-(\d|\?){6}/i
)
end | [
"def tokenizer_ranking_row_result_position\n TokenExtractor.new(\n :result_position,\n /(?<rank>\\s*(\\d{1,3}|\\s*)(?=(\\)|\\s)\\s{2}\\d{3}))/i,\n #/(\\)|\\s)\\s{2}\\d{3}\\s+\\w+/i\n 2\n )\n end",
"def tokenizer_ranking_row_result_position\n V3::TokenExtractor.new(\n :result_pos... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"ranking_row.team_code" token extractor definition | def tokenizer_ranking_row_team_code
TokenExtractor.new(
:team_code,
/(?<=\s)\w\w\w-\d{6}/i,
10 # (max size)
)
end | [
"def tokenizer_ranking_row_team_code\n TokenExtractor.new(\n :team_code,\n 6,\n 3\n )\n end",
"def tokenizer_ranking_row_team_code\n V3::TokenExtractor.new(\n :team_code,\n /(?<=\\s)(?<teamcode>\\w{3}.\\d{5})(?=\\s)/i,\n 9 # (max ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"ranking_row.result_score" token extractor definition | def tokenizer_ranking_row_result_score
TokenExtractor.new(
:result_score,
/
(?<=\s)
(?<decimal_score>
(?<thousand>\d{1,3}\.)*\d{1,3}
(?<decimals>[\,|\.]\d\d)
(?<endline>\s+|\r\n|\n|$|\Z)
(?!\D+)
)|
(?<score_comma>
\s+\d+[\... | [
"def tokenizer_ranking_row_result_score\n V3::TokenExtractor.new(\n :result_score,\n /(?<=\\s\\s)(?<score>\\d{1,6}(?:\\,|\\.)\\d{1,3})(?=\\s\\s)/i,\n /\n (?<=\\d(?:\\,|\\.)\\d\\d\\d|\\d(?:\\,|\\.)\\d\\d|\\d(?:\\,|\\.)\\d)\n (\\s\\s)\n /ix\n )\n end",
"def tokenizer_ranking... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
++ "stats_details.teams_tot" token extractor definition | def tokenizer_stats_teams_tot
TokenExtractor.new(
:teams_tot,
/\s{2}\d/i,
10 # (max size)
)
end | [
"def tokenizer_stats_teams_tot\n V3::TokenExtractor.new(\n :teams_tot,\n /\\s{2}\\d/i,\n 10 # (max size)\n )\n end",
"def tokenizer_stats_teams_presence\n TokenExtractor.new(\n :teams_presence,\n /\\s{2}\\d/i,\n 10\n )\n end",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"stats_details.teams_presence" token extractor definition | def tokenizer_stats_teams_presence
TokenExtractor.new(
:teams_presence,
/\s{2}\d/i,
10
)
end | [
"def tokenizer_stats_teams_presence\n V3::TokenExtractor.new(\n :teams_presence,\n /\\s{2}\\d/i,\n 10\n )\n end",
"def tokenizer_stats_swimmers_presence\n V3::TokenExtractor.new(\n :swimmer_presence,\n /\\s{2}\\d/i,\n 10\n )\n end",
"def tokenizer_stats_swimmers_prese... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"stats_details.swimmer_tot" token extractor definition | def tokenizer_stats_swimmers_tot
TokenExtractor.new(
:swimmer_tot,
/\s{2}\d/i,
10
)
end | [
"def tokenizer_stats_swimmers_tot\n V3::TokenExtractor.new(\n :swimmer_tot,\n /\\s{2}\\d/i,\n 10\n )\n end",
"def tokenizer_stats_entries_tot\n TokenExtractor.new(\n :entries_tot,\n /\\s{2}\\d+/i,\n 10\n )\n end",
"def tokenizer_stats_disqual_tot\n TokenExtractor.n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"stats_details.swimmer_presence" token extractor definition | def tokenizer_stats_swimmers_presence
TokenExtractor.new(
:swimmer_presence,
/\s{2}\d/i,
10
)
end | [
"def tokenizer_stats_swimmers_presence\n V3::TokenExtractor.new(\n :swimmer_presence,\n /\\s{2}\\d/i,\n 10\n )\n end",
"def tokenizer_stats_teams_presence\n TokenExtractor.new(\n :teams_presence,\n /\\s{2}\\d/i,\n 10\n )\n end",
"def tokenizer_stats_teams_presence\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"stats_details.entries_tot" token extractor definition | def tokenizer_stats_entries_tot
TokenExtractor.new(
:entries_tot,
/\s{2}\d+/i,
10
)
end | [
"def tokenizer_stats_entries_tot\n V3::TokenExtractor.new(\n :entries_tot,\n /\\s{2}\\d+/i,\n 10\n )\n end",
"def tokenizer_stats_disqual_tot\n TokenExtractor.new(\n :disqual_tot,\n /\\s{2}\\d/i,\n 10\n )\n end",
"def tokenizer_stats_entries_presence\n TokenExtract... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"stats_details.entries_presence" token extractor definition | def tokenizer_stats_entries_presence
TokenExtractor.new(
:entries_presence,
/\s{2}\d+/i,
10
)
end | [
"def tokenizer_stats_entries_presence\n V3::TokenExtractor.new(\n :entries_presence,\n /\\s{2}\\d+/i,\n 10\n )\n end",
"def tokenizer_stats_teams_presence\n TokenExtractor.new(\n :teams_presence,\n /\\s{2}\\d/i,\n 10\n )\n end",
"def tokenizer_stats_teams_presence\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"stats_details.disqual_tot" token extractor definition | def tokenizer_stats_disqual_tot
TokenExtractor.new(
:disqual_tot,
/\s{2}\d/i,
10
)
end | [
"def tokenizer_stats_disqual_tot\n V3::TokenExtractor.new(\n :disqual_tot,\n /\\s{2}\\d/i,\n 10\n )\n end",
"def tokenizer_stats_entries_tot\n TokenExtractor.new(\n :entries_tot,\n /\\s{2}\\d+/i,\n 10\n )\n end",
"def tokenizer_stats_entries_tot\n V3::TokenExtracto... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"stats_details.withdrawals_tot" token extractor definition | def tokenizer_stats_withdrawals_tot
TokenExtractor.new(
:withdrawals_tot,
/\s{2}\d/i,
10
)
end | [
"def tokenizer_stats_withdrawals_tot\n V3::TokenExtractor.new(\n :withdrawals_tot,\n /\\s{2}\\d/i,\n 10\n )\n end",
"def tokenizer_stats_entries_tot\n TokenExtractor.new(\n :entries_tot,\n /\\s{2}\\d+/i,\n 10\n )\n end",
"def tokenizer_stats_entries_tot\n V3::Token... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET /cvs GET /cvs.xml | def index
@cvs = Cv.find(:all)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @cvs }
end
end | [
"def find_rdoc_cvs_url( catalog_file=\"docs/CATALOG\" )\n\t\tfind_catalog_keyword( 'webcvs', catalog_file )\n\tend",
"def index\n @csos = Cso.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @csos }\n end\n end",
"def index\n @cst_cofins ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DELETE /cvs/1 DELETE /cvs/1.xml | def destroy
@cv = Cv.find(params[:id])
@cv.destroy
respond_to do |format|
format.html { redirect_to(cvs_url) }
format.xml { head :ok }
end
end | [
"def destroy\n @cv.destroy\n\n respond_to do |format|\n format.html { redirect_to(cvs_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mycv = Mycv.find(params[:id])\n @mycv.destroy\n\n respond_to do |format|\n format.html { redirect_to(mycvs_url) }\n format.x... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET /cocktail_markers/1 GET /cocktail_markers/1.json | def show
@cocktail_marker = CocktailMarker.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @cocktail_marker }
end
end | [
"def new\n @cocktail_marker = CocktailMarker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cocktail_marker }\n end\n end",
"def show\r\n marker = Marker.find(params[:id])\r\n render json: marker\r\n end",
"def show\n @marker = Marker.find... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET /cocktail_markers/new GET /cocktail_markers/new.json | def new
@cocktail_marker = CocktailMarker.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @cocktail_marker }
end
end | [
"def new\n @marker = Marker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @marker }\n end\n end",
"def new\n @map_marker = MapMarker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @map_marker }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
POST /cocktail_markers POST /cocktail_markers.json | def create
@cocktail_marker = CocktailMarker.new(params[:cocktail_marker])
respond_to do |format|
if @cocktail_marker.save
format.html { redirect_to @cocktail_marker, notice: 'Cocktail marker was successfully created.' }
format.json { render json: @cocktail_marker, status: :created, locat... | [
"def new\n @cocktail_marker = CocktailMarker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cocktail_marker }\n end\n end",
"def create\n @marker = Marker.new(params[:marker])\n\n respond_to do |format|\n if @marker.save\n format.htm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PUT /cocktail_markers/1 PUT /cocktail_markers/1.json | def update
@cocktail_marker = CocktailMarker.find(params[:id])
respond_to do |format|
if @cocktail_marker.update_attributes(params[:cocktail_marker])
format.html { redirect_to @cocktail_marker, notice: 'Cocktail marker was successfully updated.' }
format.json { head :no_content }
el... | [
"def create\n @cocktail_marker = CocktailMarker.new(params[:cocktail_marker])\n\n respond_to do |format|\n if @cocktail_marker.save\n format.html { redirect_to @cocktail_marker, notice: 'Cocktail marker was successfully created.' }\n format.json { render json: @cocktail_marker, status: :cre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DELETE /cocktail_markers/1 DELETE /cocktail_markers/1.json | def destroy
@cocktail_marker = CocktailMarker.find(params[:id])
@cocktail_marker.destroy
respond_to do |format|
format.html { redirect_to cocktail_markers_url }
format.json { head :no_content }
end
end | [
"def destroy\n @marker = Marker.find(params[:id])\n @marker.destroy\n\n respond_to do |format|\n format.html { redirect_to markers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @accessablemarker.destroy\n respond_to do |format|\n format.html { redirect_to ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a new Schema::AlterTableGenerator instance with the receiver as the database and the given block. | def alter_table_generator(&block)
alter_table_generator_class.new(self, &block)
end | [
"def create_table_generator(&block)\n create_table_generator_class.new(self, &block)\n end",
"def alter_table_generator(&block)\n super do\n extend AlterTableGeneratorMethods\n @validations = []\n instance_eval(&block) if block\n end\n end",
"def alter_table_generator_c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Forcibly create a join table, attempting to drop it if it already exists, then creating it. | def create_join_table!(hash, options=OPTS)
drop_table?(join_table_name(hash, options))
create_join_table(hash, options)
end | [
"def create_join_table?(hash, options=OPTS)\n if supports_create_table_if_not_exists? && options[:no_index]\n create_join_table(hash, options.merge(:if_not_exists=>true))\n elsif !table_exists?(join_table_name(hash, options))\n create_join_table(hash, options)\n end\n end",
"def cr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the join table unless it already exists. | def create_join_table?(hash, options=OPTS)
if supports_create_table_if_not_exists? && options[:no_index]
create_join_table(hash, options.merge(:if_not_exists=>true))
elsif !table_exists?(join_table_name(hash, options))
create_join_table(hash, options)
end
end | [
"def create_join_table!(hash, options=OPTS)\n drop_table?(join_table_name(hash, options))\n create_join_table(hash, options)\n end",
"def create_table_joins(klass)\n if join_tables = klass.ann(:self, :join_tables)\n for info in join_tables\n begin\n # UGGLY hack!\n ke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a new Schema::CreateTableGenerator instance with the receiver as the database and the given block. | def create_table_generator(&block)
create_table_generator_class.new(self, &block)
end | [
"def create_table(name, &block)\n g = Schema::Generator.new(self, &block)\n create_table_sql_list(name, *g.create_info).each {|sql| execute(sql)}\n end",
"def create_table_generator(&block)\n super do\n extend CreateTableGeneratorMethods\n @validations = []\n instance_eval(&... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a view, replacing a view with the same name if one already exists. DB.create_or_replace_view(:some_items, "SELECT FROM items WHERE price < 100") DB.create_or_replace_view(:some_items, DB[:items].where(category: 'ruby')) For databases where replacing a view is not natively supported, support is emulated by dropp... | def create_or_replace_view(name, source, options = OPTS)
if supports_create_or_replace_view?
options = options.merge(:replace=>true)
else
swallow_database_error{drop_view(name)}
end
create_view(name, source, options)
nil
end | [
"def create_or_replace_view(name, source)\n source = source.sql if source.is_a?(Dataset)\n execute(\"CREATE OR REPLACE VIEW #{name} AS #{source}\")\n end",
"def create_or_replace_view(name, select_query, options={})\n if supports_views? && replaces_views?\n view_definition = ViewDefin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes an index for the given table and column(s): DB.drop_index :posts, :title DB.drop_index :posts, [:author, :title] See alter_table. | def drop_index(table, columns, options=OPTS)
alter_table(table){drop_index(columns, options)}
end | [
"def drop_index(table, columns)\n alter_table(table) {drop_index(columns)}\n end",
"def drop_index_sql(table, op)\n \"DROP INDEX #{quote_identifier(op[:name] || default_index_name(table, op[:columns]))} ON #{quote_schema_table(table)}\"\n end",
"def drop_index(*col_names)\r\n raise \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drop the join table that would have been created with the same arguments to create_join_table: drop_join_table(cat_id: :cats, dog_id: :dogs) DROP TABLE cats_dogs | def drop_join_table(hash, options=OPTS)
drop_table(join_table_name(hash, options), options)
end | [
"def drop_join_table(table_1, table_2, **options); end",
"def drop_join_table(table_1, table_2, **options)\n join_table_name = find_join_table_name(table_1, table_2, options)\n drop_table(join_table_name, **options)\n end",
"def drop_table(*args)\n options = args.extract_options!\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drops one or more tables corresponding to the given names: DB.drop_table(:posts) DROP TABLE posts DB.drop_table(:posts, :comments) DB.drop_table(:posts, :comments, cascade: true) | def drop_table(*names)
options = names.last.is_a?(Hash) ? names.pop : OPTS
names.each do |n|
execute_ddl(drop_table_sql(n, options))
remove_cached_schema(n)
end
nil
end | [
"def drop_table(*names)\n names.each {|n| execute(drop_table_sql(n))}\n end",
"def drop_tables!\n migrate(:down)\n end",
"def drop_tables!\n connect\n connection.tables.each do |table|\n connection.drop_table table\n end\n end",
"def drop_table(*args)\n options ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drops the table if it already exists. If it doesn't exist, does nothing. DB.drop_table?(:a) SELECT NULL FROM a LIMIT 1 check existence DROP TABLE a if it already exists | def drop_table?(*names)
options = names.last.is_a?(Hash) ? names.pop : OPTS
if supports_drop_table_if_exists?
options = options.merge(:if_exists=>true)
names.each do |name|
drop_table(name, options)
end
else
names.each do |name|
drop_table(name, opti... | [
"def drop_table(table)\n puts \"attempting to drop table #{table}...\"\n begin\n tt = @dbr.prepare(\"DROP TABLE #{table};\")\n ee = tt.execute\n puts \"table created correctly.\".green\n rescue\n puts \"error while dropping table #{table}\".red\n end\n end",
"def... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drops one or more views corresponding to the given names: DB.drop_view(:cheap_items) DB.drop_view(:cheap_items, :pricey_items) DB.drop_view(:cheap_items, :pricey_items, cascade: true) DB.drop_view(:cheap_items, :pricey_items, if_exists: true) Options: :cascade :: Also drop objects depending on this view. :if_exists :: ... | def drop_view(*names)
options = names.last.is_a?(Hash) ? names.pop : OPTS
names.each do |n|
execute_ddl(drop_view_sql(n, options))
remove_cached_schema(n)
end
nil
end | [
"def drop_view(*args)\n options = args.extract_options!\n args.flatten!\n\n sql = 'DROP VIEW '\n sql << 'IF EXISTS ' if options[:if_exists]\n sql << Array.wrap(args).collect { |v| quote_view_name(v) }.join(', ')\n sql << ' CASCADE' if options[:cascade]\n execute(\"#{... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renames a column in the specified table. This method expects the current column name and the new column name: DB.rename_column :items, :cntr, :counter See alter_table. | def rename_column(table, *args)
alter_table(table) {rename_column(*args)}
end | [
"def rename_column(table_name, column_name, new_column_name); end",
"def rename_column(table_name, column_name, new_column_name)\n raise NotImplementedError, \"rename_column is not implemented\"\n end",
"def rename_column(table_name, column_name, new_column_name)\n execute \"ALTER TABLE #{quote_table... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the default value for the given column in the given table: DB.set_column_default :items, :category, 'perl!' See alter_table. | def set_column_default(table, *args)
alter_table(table) {set_column_default(*args)}
end | [
"def change_column_default(table_name, column_name, default_or_changes); end",
"def change_column_default(table, column, value)\n current_instructions << Instructions::ChangeColumnDefault.new(\n table: table,\n column: column,\n value: value,\n )\n end",
"def change_column_defa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the data type for the given column in the given table: DB.set_column_type :items, :price, :float See alter_table. | def set_column_type(table, *args)
alter_table(table) {set_column_type(*args)}
end | [
"def set_column_type(name, type)\n @operations << {:op => :set_column_type, :name => name, :type => type}\n end",
"def change_column(table_name, column_name, type, options = {})\n # null/not nulling is easy, handle that separately\n if options.include?(:null)\n # This seems to only wo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply the changes in the given alter table ops to the table given by name. | def apply_alter_table(name, ops)
alter_table_sql_list(name, ops).each{|sql| execute_ddl(sql)}
end | [
"def alter_table(name, &block)\n g = Schema::AlterTableGenerator.new(self, &block)\n alter_table_sql_list(name, g.operations).each {|sql| execute(sql)}\n end",
"def alter_table_sql(table, op)\n quoted_table = quote_identifier(table)\n quoted_name = quote_identifier(op[:name]) if op[:nam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply the operations in the given generator to the table given by name. | def apply_alter_table_generator(name, generator)
ops = generator.operations
unless can_add_primary_key_constraint_on_nullable_columns?
if add_pk = ops.find{|op| op[:op] == :add_constraint && op[:type] == :primary_key}
ops = add_pk[:columns].map{|column| {:op => :set_column_null, :name => ... | [
"def each_name\n @statements[:each_name].execute!(NamesTable) { |res| yield res[0] }\n end",
"def alter_table_generator(&block)\n alter_table_generator_class.new(self, &block)\n end",
"def create_table_from_generator(name, generator, options)\n unless generator.validations.empty?\n proce... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The class used for alter_table generators. | def alter_table_generator_class
Schema::AlterTableGenerator
end | [
"def alter_table_generator(&block)\n alter_table_generator_class.new(self, &block)\n end",
"def alter_table_generator(&block)\n super do\n extend AlterTableGeneratorMethods\n @validations = []\n instance_eval(&block) if block\n end\n end",
"def base_generate_migration_a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The order of the column definition, as an array of symbols. | def column_definition_order
COLUMN_DEFINITION_ORDER
end | [
"def column_definition_order\n COLUMN_DEFINITION_ORDER\n end",
"def column_names\n columns_in_order.map { |c| c.name }\n end",
"def ordered_columns\n @columns.map { |_, v| v }.sort_by(&:sequence_no)\n end",
"def symbol cols\n decode_values :symbol, cols\n end",
"def colum... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SQL fragment containing the column creation SQL for the given column. | def column_definition_sql(column)
sql = String.new
sql << "#{quote_identifier(column[:name])} #{type_literal(column)}"
column_definition_order.each{|m| send(:"column_definition_#{m}_sql", sql, column)}
sql
end | [
"def create_column_sql column, table = table_name\n full_table_create_sql = create_table_sql(table)\n parts = full_table_create_sql.split(\"\\n\")\n create_table = parts.shift # take off the first CREATE TABLE part\n create_table_options = parts.pop # take off the last options for the table, lea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add auto increment SQL fragment to column creation SQL. | def column_definition_auto_increment_sql(sql, column)
sql << " #{auto_increment_sql}" if column[:auto_increment]
end | [
"def auto_increment_sql\n 'AUTO_INCREMENT'\n end",
"def auto_increment_sql\n AUTOINCREMENT\n end",
"def auto_increment_sql\n AUTO_INCREMENT\n end",
"def auto_increment_sql\n 'IDENTITY'\n end",
"def auto_increment_sql\n 'IDENTITY(1,1)'\n end",
"de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add collate SQL fragment to column creation SQL. | def column_definition_collate_sql(sql, column)
if collate = column[:collate]
sql << " COLLATE #{collate}"
end
end | [
"def column_definition_collate_sql(sql, column)\n if collate = column[:collate]\n collate = literal(collate) unless collate.is_a?(String)\n sql << \" COLLATE #{collate}\"\n end\n end",
"def alter_table_add_column_sql(table, op)\n \"ADD COLUMNS (#{column_definition_sql(o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add default SQL fragment to column creation SQL. | def column_definition_default_sql(sql, column)
sql << " DEFAULT #{literal(column[:default])}" if column.include?(:default)
end | [
"def column_definition_default_sql(sql, column)\n sql << \" DEFAULT (#{literal(column[:default])})\" if column.include?(:default)\n end",
"def column_definition_default_sql(sql, column)\n super\n if !column[:serial] && !['smallserial', 'serial', 'bigserial'].include?(column[:type].to_s) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.