query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
GET /pets GET /pets.json
def index @client = Client.find params[:client_id] @pets = @client.pets end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @pets = Pet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pets }\n end\n end", "def show\n @pet = Pet.find_by(id: params[:id])\n if @pet\n render json: @pet\n else\n render json: {}, status: 404\n end\n end", "...
[ "0.7532614", "0.74807626", "0.7442378", "0.7442378", "0.73665094", "0.72322184", "0.71107155", "0.6978894", "0.69401866", "0.68483084", "0.6835015", "0.67964625", "0.6686958", "0.6652686", "0.6652686", "0.6601181", "0.659029", "0.6583978", "0.6523635", "0.6477457", "0.6458241...
0.6696298
12
GET /pets/1 GET /pets/1.json
def show @client = Client.find params[:client_id] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @pet = Pet.find_by(id: params[:id])\n if @pet\n render json: @pet\n else\n render json: {}, status: 404\n end\n end", "def show\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pet }\n end\n ...
[ "0.75733095", "0.7517837", "0.7517837", "0.73931026", "0.7245301", "0.70816267", "0.7062426", "0.7058671", "0.6981802", "0.6895421", "0.6866418", "0.6858466", "0.6762347", "0.66688824", "0.6666302", "0.64767885", "0.6471701", "0.6471701", "0.64502436", "0.6442229", "0.6401544...
0.0
-1
POST /pets POST /pets.json
def create @client = Client.find params[:client_id].to_i @pet = Pet.new(pet_params) @pet.client = @client respond_to do |format| if @pet.save format.html { redirect_to client_pet_path(@client, @pet), notice: 'Mascota registrada exitosamente.' } else format.html { render :new } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @pet = @person.pets.build(pet_params)\n\n respond_to do |format|\n if @pet.save\n format.html { redirect_to person_path(@person), notice: 'Pet was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { re...
[ "0.7303997", "0.7081908", "0.7000595", "0.6952367", "0.68931097", "0.6804849", "0.6789769", "0.6748069", "0.6664846", "0.66344166", "0.6613724", "0.65952945", "0.6573272", "0.6449908", "0.64429986", "0.64418715", "0.6437518", "0.64174235", "0.6417186", "0.6385124", "0.6381243...
0.634393
22
PATCH/PUT /pets/1 PATCH/PUT /pets/1.json
def update @client = Client.find params[:client_id] respond_to do |format| if @pet.update(pet_params) format.html { redirect_to client_pet_path(@client,@pet), notice: 'Datos de mascota actualizados.' } else format.html { render :edit } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n if @pet.update_attributes(params[:pet])\n format.html { redirect_to root_path, notice: 'Pet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n ...
[ "0.6922292", "0.6913852", "0.68434143", "0.6791602", "0.6760817", "0.6760817", "0.6760817", "0.6760817", "0.6760817", "0.6760817", "0.6746039", "0.66579527", "0.6571282", "0.6497338", "0.6474511", "0.6447766", "0.6432734", "0.64289886", "0.63764375", "0.6368412", "0.63189304"...
0.6123776
36
DELETE /pets/1 DELETE /pets/1.json
def destroy @client = Client.find params[:client_id] @pet.destroy respond_to do |format| format.html { redirect_to client_pets_path(@client), notice: 'Mascota eliminada... Todos los perritos van al cielo' } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n pet = @user.pets.find(params[:id])\n pet.destroy\n render json: pet\n end", "def pet_delete(pet)\n @db.delete(\"pets\", pet[\"id\"])\n end", "def destroy\n @pet = Pet.find(params[:id])\n @pet.destroy\n\n respond_to do |format|\n format.html { redire...
[ "0.76552933", "0.76330024", "0.750838", "0.750838", "0.750838", "0.7302086", "0.7267687", "0.7248253", "0.72239506", "0.721972", "0.72023845", "0.72023845", "0.72023845", "0.72023845", "0.72023845", "0.71824735", "0.7175317", "0.7128093", "0.7128093", "0.7124565", "0.7117816"...
0.69471693
27
Use callbacks to share common setup or constraints between actions.
def set_pet @pet = Pet.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 pet_params params.require(:pet).permit(:name, :race, :birthdate) 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 /personal_infos GET /personal_infos.json
def index @user = User.find(session[:user_id]) @personal_info = PersonalInfo.find_by(users_id: session[:user_id]) if !@personal_info.nil? @hall = Hall.find(@personal_info.halls_id) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @personal_info = current_user.personal_info\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personal_info }\n end\n end", "def show\n @personal_info = @user.personal_info\n @user = current_user.id\n respond_to do |format|\n f...
[ "0.7972116", "0.7776827", "0.71741253", "0.7036345", "0.6944974", "0.6836923", "0.68325764", "0.68102545", "0.67983836", "0.67647135", "0.67423314", "0.6676139", "0.6517811", "0.6457251", "0.64024085", "0.6374373", "0.63718206", "0.63718206", "0.63579965", "0.63248605", "0.63...
0.0
-1
GET /personal_infos/1 GET /personal_infos/1.json
def show @user = User.find(session[:user_id]) @personal_info = PersonalInfo.find_by(users_id: session[:user_id]) if !@personal_info.nil? @hall = Hall.find(@personal_info.halls_id) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @personal_info = current_user.personal_info\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personal_info }\n end\n end", "def show\n @personal_info = @user.personal_info\n @user = current_user.id\n respond_to do |format|\n f...
[ "0.7831713", "0.77326345", "0.73118746", "0.71988845", "0.69787633", "0.69631976", "0.6898131", "0.6810969", "0.67595005", "0.67091185", "0.66903734", "0.668653", "0.6599174", "0.6599174", "0.65815806", "0.65759104", "0.65614355", "0.65248436", "0.65056413", "0.64893734", "0....
0.0
-1
POST /personal_infos POST /personal_infos.json
def create @personal_info = PersonalInfo.new(personal_info_params) respond_to do |format| if @personal_info.save format.html { redirect_to students_login_path, notice: 'Personal info was successfully created.' } format.json { render :show, status: :created, location: @personal_info } else format.html { render :new } format.json { render json: @personal_info.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @personal_info = current_user.create_personal_info(params[:personal_info])\n\n respond_to do |format|\n if @personal_info.save\n format.html { redirect_to user_path(current_user), notice: 'Personal info was successfully created.' }\n format.json { render json: @personal_info, ...
[ "0.7927793", "0.7889763", "0.7281096", "0.7254106", "0.71513087", "0.69870514", "0.6960742", "0.69475466", "0.694264", "0.6902676", "0.6899883", "0.687479", "0.6846886", "0.67692035", "0.6696551", "0.6696468", "0.6673107", "0.6639486", "0.6588965", "0.6565874", "0.64840174", ...
0.76345265
2
PATCH/PUT /personal_infos/1 PATCH/PUT /personal_infos/1.json
def update @personal_info = PersonalInfo.find(params[:id]) @personal_info.assign_attributes(personal_info_params) @user = User.find(session[:user_id]) @personal_info.users_id = session[:user_id] if @personal_info.save respond_to do |format| success = 'Student info updated successfully' format.html { redirect_to @user, success: success } format.json { render json: {status: :ok, message: success} } end else respond_to do |format| format.html { render('edit') } format.json { render json: { status: :unprocessable_entity, message: @student.errors.full_messages } } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n user = current_user\n @personal_info = user.personal_info\n\n respond_to do |format|\n if @personal_info.update_attributes(params[:personal_info])\n format.html { redirect_to user_path notice: 'Personal info was successfully updated.' }\n format.json { head :no_content }\n ...
[ "0.74077535", "0.7362165", "0.70729995", "0.7056774", "0.69313616", "0.6889697", "0.687924", "0.6867171", "0.6779576", "0.67319864", "0.6719642", "0.667761", "0.6629085", "0.6621766", "0.6619921", "0.6608888", "0.6606119", "0.6570756", "0.64928967", "0.648275", "0.6455859", ...
0.6553648
18
DELETE /personal_infos/1 DELETE /personal_infos/1.json
def destroy @personal_info.destroy respond_to do |format| format.html { redirect_to personal_infos_url, notice: 'Personal info was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @personal_info = PersonalInfo.find(params[:id])\n @personal_info.destroy\n\n respond_to do |format|\n format.html { redirect_to personal_info_index_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @personal_info = current_user.personal_info\n @perso...
[ "0.78211915", "0.7694526", "0.75697404", "0.7538551", "0.74840546", "0.73290986", "0.7221993", "0.71991456", "0.7194215", "0.71924263", "0.7181636", "0.7158854", "0.7138231", "0.69806784", "0.69444287", "0.69322556", "0.6891749", "0.6871409", "0.6858749", "0.6846834", "0.6842...
0.76470304
2
Use callbacks to share common setup or constraints between actions.
def set_personal_info @personal_info = PersonalInfo.find_by(users_id: session[:user_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 personal_info_params params.require(:personal_info).permit(:fathers_name, :mothers_name, :halls_id, :date_of_birth, :address, :phone_number, :genders_id, :users_id, :batches_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
This is used to get a rough approximation of the amount of time required to call action once. We do this so that we will be able to run the actual timing loop in chunks of iterations, rather than calling Process.clock_gettime in between every iteration.
def estimate_time_per_iteration(action, duration) start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) deadline = start_time + duration iterations = 0 while Process.clock_gettime(Process::CLOCK_MONOTONIC) < deadline action.call iterations += 1 end (Process.clock_gettime(Process::CLOCK_MONOTONIC) - start_time) / iterations end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def benchmark\n start_time = Time.now\n calculation = yield\n end_time = Time.now\n run_time = end_time - start_time\n run_time\nend", "def bench(action, msg = nil)\n @t ||= Time.now\n @total ||= 0\n @step ||= 0\n case action\n when :start\n @step = 0\n @total = 0\n @t = Time.now\n when :step...
[ "0.6453082", "0.64124227", "0.63859004", "0.6372792", "0.624135", "0.62390155", "0.6222307", "0.62086195", "0.6168873", "0.61267084", "0.6072011", "0.6054649", "0.60402954", "0.5988472", "0.5986004", "0.5972439", "0.5972242", "0.59626055", "0.5943436", "0.59422505", "0.594123...
0.74359125
0
Show invalid properties with the reasons. Usually used together with valid?
def list_invalid_properties invalid_properties = Array.new if !@store_id.nil? && @store_id.to_s.length > 20 invalid_properties.push('invalid value for "store_id", the character length must be smaller than or equal to 20.') end if @transaction_amount.nil? invalid_properties.push('invalid value for "transaction_amount", transaction_amount cannot be nil.') end if @transaction_type.nil? invalid_properties.push('invalid value for "transaction_type", transaction_type cannot be nil.') end if !@hosted_payment_page_text.nil? && @hosted_payment_page_text.to_s.length > 255 invalid_properties.push('invalid value for "hosted_payment_page_text", the character length must be smaller than or equal to 255.') end invalid_properties end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil....
[ "0.76480395", "0.76480395", "0.76480395", "0.76480395", "0.76357543", "0.76357543", "0.76357543", "0.76357543", "0.76357543", "0.76357543", "0.76357543", "0.76357543", "0.73546803", "0.7333273", "0.72667927", "0.7237672", "0.7230264", "0.72240895", "0.7206086", "0.71745956", ...
0.0
-1
Check to see if the all the properties in the model are valid
def valid? return false if !@store_id.nil? && @store_id.to_s.length > 20 return false if @transaction_amount.nil? return false if @transaction_type.nil? return false if !@hosted_payment_page_text.nil? && @hosted_payment_page_text.to_s.length > 255 true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_properties\n true\n end", "def validate_properties\n true\n end", "def validate\n super\n\n check_optional_property :collection, String\n check_optional_property :create, String\n check_optional_property :delete, String\n check_optional_property :...
[ "0.78992486", "0.78992486", "0.70971805", "0.70782334", "0.7032205", "0.7031276", "0.69510347", "0.6869891", "0.6858077", "0.6858077", "0.68287027", "0.6823878", "0.6820306", "0.68144894", "0.6794656", "0.6752167", "0.66843414", "0.6676546", "0.6667755", "0.66296124", "0.6618...
0.0
-1
Custom attribute writer method with validation
def store_id=(store_id) if !store_id.nil? && store_id.to_s.length > 20 fail ArgumentError, 'invalid value for "store_id", the character length must be smaller than or equal to 20.' end @store_id = store_id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method with validation
def hosted_payment_page_text=(hosted_payment_page_text) if !hosted_payment_page_text.nil? && hosted_payment_page_text.to_s.length > 255 fail ArgumentError, 'invalid value for "hosted_payment_page_text", the character length must be smaller than or equal to 255.' end @hosted_payment_page_text = hosted_payment_page_text end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Checks equality by comparing each attribute.
def ==(o) return true if self.equal?(o) self.class == o.class && store_id == o.store_id && client_locale == o.client_locale && transaction_amount == o.transaction_amount && transaction_type == o.transaction_type && order_id == o.order_id && billing == o.billing && shipping == o.shipping && transaction_notification_url == o.transaction_notification_url && expiration == o.expiration && authenticate_transaction == o.authenticate_transaction && dynamic_merchant_name == o.dynamic_merchant_name && invoice_number == o.invoice_number && purchase_order_number == o.purchase_order_number && hosted_payment_page_text == o.hosted_payment_page_text && ip == o.ip && revolving_options == o.revolving_options && installment_options == o.installment_options && basket == o.basket end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ==(other)\n attributes == other.attributes\n end", "def ==(other) # :nodoc:\n @attrs == other.attrs\n end", "def eql?(other)\n return true if self == other\n @@ATTRIBUTES.each do |att|\n return false unless self.send(att).eql?(other.send(att))\n end\n true\n en...
[ "0.72932124", "0.7189842", "0.70406866", "0.7007727", "0.68881786", "0.68621296", "0.67085785", "0.66622394", "0.661674", "0.6586541", "0.65844727", "0.65818226", "0.65561724", "0.6545535", "0.6508076", "0.64813215", "0.64577025", "0.64179385", "0.6414028", "0.6414028", "0.64...
0.0
-1
Calculates hash code according to all attributes.
def hash [store_id, client_locale, transaction_amount, transaction_type, order_id, billing, shipping, transaction_notification_url, expiration, authenticate_transaction, dynamic_merchant_name, invoice_number, purchase_order_number, hosted_payment_page_text, ip, revolving_options, installment_options, basket].hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_hash\n Digest::MD5.hexdigest(\"#{@name}:#{@ruby_type}\")\n end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash\n code = 17\n code = 37*code + @x.hash\n code = 37*code + @y.hash\n ...
[ "0.7118691", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.68960655", "0.67847186", "0.6707762", "0.670052", "0.6688737", "0.66705376", "0.6489735", "0.6462376", "0.6462376", "0.64444333", "0.6413127", "0.6395483", "0.638...
0.0
-1
Builds the object from hash
def build_from_hash(attributes, attribute_map = self.class.attribute_map, openapi_types = self.class.openapi_types) return nil unless attributes.is_a?(Hash) openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(hash)\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v if variables[k]\n end\n return obj\n end", "def build_from_hash(attributes)\n\n end", "def build_from_hash(hash)\n instance = self.new\n\n # Add the instance attributes dynamically ...
[ "0.8011074", "0.7470833", "0.7457607", "0.7256629", "0.72455454", "0.70060325", "0.6973257", "0.6955014", "0.69459796", "0.69398683", "0.69363195", "0.6917627", "0.6872358", "0.6796184", "0.6783521", "0.67575246", "0.67575246", "0.67560464", "0.67514306", "0.67136854", "0.666...
0.0
-1
Deserializes the data based on type
def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model klass = OpenapiClient.const_get(type) if klass.respond_to?(:openapi_discriminator_name) klass = OpenapiClient.const_get(value[klass.attribute_map[klass.openapi_discriminator_name]]) end klass.build_from_hash(value) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s...
[ "0.7330926", "0.7274019", "0.72504056", "0.7245751", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", ...
0.0
-1
Returns the string representation of the object
def to_s to_hash.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n @object.to_s\n end", "def to_s\n object.to_s\n end", "def serialize(object)\n object.to_s\n end", "def to_s\n self.inspect\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s\n @string || @object.to_s('F')\n end", "de...
[ "0.9011548", "0.8951823", "0.8472387", "0.8339536", "0.8336845", "0.8336845", "0.83325315", "0.82546043", "0.8144802", "0.81426954", "0.813444", "0.8125573", "0.80915654", "0.80848795", "0.8071387", "0.8037398", "0.803006", "0.8003827", "0.8003827", "0.8003827", "0.8003827", ...
0.0
-1
to_body is an alias to to_hash (backward compatibility)
def to_body to_hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_body\r\n to_hash\r\n end", "def to_body\n to_hash\nend", "def to_body\n to_hash\nend" ]
[ "0.84283537", "0.8347048", "0.8347048" ]
0.0
-1
Returns the object in the form of hash
def to_hash(attribute_map = self.class.attribute_map, openapi_nullable = Set.new([])) hash = {} attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_hash\n object\n end", "def hash\r\n return to_s.hash\r\n end", "def hash\n to_a.hash\n end", "def hash\n [_hash, name, owner].hash\n end", "def hash\n return to_s.hash\n end", "def hash\n @hash\n end", "def hash\n @hash.hash\n end", "def hash\n ...
[ "0.8270299", "0.78767854", "0.78726953", "0.7802364", "0.7789188", "0.77806795", "0.7775915", "0.7767511", "0.7760525", "0.7760525", "0.77559966", "0.7731286", "0.7713916", "0.7713916", "0.7713916", "0.7713916", "0.7713916", "0.7713916", "0.7713916", "0.7713916", "0.7713916",...
0.0
-1
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value
def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n [value].hash\n end", "def hash\n [value].hash\n end", "def hash\n\t\tvalue.hash\n\tend", "def hash\n value.hash\n end", "def hash\n @value.hash\n end", "def hash\r\n return to_s.hash\r\n end", "def to_hash\n @value\n end", "def to_hash\n @va...
[ "0.6719518", "0.6719518", "0.666832", "0.66565555", "0.6586841", "0.6452931", "0.6414911", "0.6414911", "0.6382046", "0.6346188", "0.6302933", "0.62237245", "0.6151989", "0.6101756", "0.60795677", "0.60795677", "0.60717124", "0.6035991", "0.6021168", "0.5936472", "0.5903488",...
0.0
-1
GET /cms/1 GET /cms/1.json
def show @cm = Cm.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @cm } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @cms_pages = CmsPage.all\n end", "def index\n @cmms = Cmm.all\n render json: @cmms\n end", "def index\n @cms_pages = Cms::Page.all\n end", "def index\n @pages = current_cms.pages.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :x...
[ "0.6407261", "0.63677377", "0.6351769", "0.62532735", "0.61691445", "0.615172", "0.61233634", "0.6065707", "0.6059847", "0.60125643", "0.60107124", "0.5978079", "0.596103", "0.5922788", "0.59023184", "0.58990544", "0.58785737", "0.58736503", "0.58689916", "0.5865461", "0.5864...
0.6230221
4
GET /cms/new GET /cms/new.json
def new @cm = Cm.new respond_to do |format| format.html # new.html.erb format.json { render json: @cm } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @page = current_site.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = current_cms.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @...
[ "0.77427584", "0.759891", "0.74795735", "0.7464193", "0.7464193", "0.7464193", "0.7464193", "0.7298688", "0.7273727", "0.7273727", "0.7273727", "0.7273727", "0.7273727", "0.7273727", "0.725843", "0.72582686", "0.72573936", "0.7253391", "0.72430265", "0.72296435", "0.7227275",...
0.7160613
26
POST /cms POST /cms.json
def create @cm = Cm.new(params[:cm]) respond_to do |format| if @cm.save format.html { redirect_to @cm, notice: 'Cm was successfully created.' } format.json { render json: @cm, status: :created, location: @cm } else format.html { render action: "new" } format.json { render json: @cm.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @cms_page = CmsPage.new(cms_page_params)\n\n respond_to do |format|\n if @cms_page.save\n format.html { redirect_to @cms_page, notice: 'Cms page was successfully created.' }\n format.json { render :show, status: :created, location: @cms_page }\n else\n format.html ...
[ "0.64834964", "0.63998115", "0.61314774", "0.5810777", "0.5799501", "0.57874966", "0.57684714", "0.5724294", "0.5698191", "0.5675777", "0.56578356", "0.56166327", "0.5580794", "0.55416936", "0.5536756", "0.5519746", "0.5513732", "0.55096245", "0.5503751", "0.5465793", "0.5460...
0.5150945
100
PUT /cms/1 PUT /cms/1.json
def update @cm = Cm.find(params[:id]) respond_to do |format| if @cm.update_attributes(params[:cm]) format.html { redirect_to @cm, notice: 'Cm was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @cm.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @cms_page.update(cms_page_params)\n format.html { redirect_to @cms_page, notice: 'Cms page was successfully updated.' }\n format.json { render :show, status: :ok, location: @cms_page }\n else\n format.html { render :edit }\n format.j...
[ "0.6057394", "0.60189575", "0.5848225", "0.58391994", "0.5753595", "0.5704055", "0.5660645", "0.5615672", "0.5610236", "0.56065965", "0.5596199", "0.5582196", "0.5578005", "0.556296", "0.5559274", "0.55519867", "0.5551535", "0.5516483", "0.550786", "0.55009925", "0.55000085",...
0.5331773
45
DELETE /cms/1 DELETE /cms/1.json
def destroy @cm = Cm.find(params[:id]) @cm.destroy respond_to do |format| format.html { redirect_to cms_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @cms_page.destroy\n respond_to do |format|\n format.html { redirect_to cms_pages_url, notice: \"#{@cms_page.title} has been deleted.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @cms_page.destroy\n respond_to do |format|\n format.html { redirect...
[ "0.7125588", "0.7036153", "0.70290005", "0.6880609", "0.6794949", "0.6769156", "0.67688805", "0.674759", "0.67191213", "0.67185956", "0.67012674", "0.6697827", "0.66638106", "0.6656746", "0.6650727", "0.6650532", "0.6639657", "0.66391474", "0.6634274", "0.66252136", "0.662435...
0.7319338
0
Term object variants are organized into different realms. Inside one realm, the attribute_ary must always be homogeneous and consist of comparable and hashable objects. attribute_ary is owned by new object. children can be nil, if not nil, it must return a new array of term objects in response to :ordered_values
def initialize(realm, attribute_ary, children) realm = @@realms.index realm raise "Using unregistered realm!" unless realm @realmidx, @attributes = realm, attribute_ary @children = children ? children.ordered_values : [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_child_terms\n get_all_child_lists\n return @all_child_terms\n end", "def get_children( node=self )\n sql = <<-SQL\n select\n subject_term.identifier as child_identifier,\n subject_term.term_name as child_term,\n predicate_term.term_name as relation,\n object_...
[ "0.5804891", "0.55256337", "0.54760957", "0.53586817", "0.5165771", "0.5161152", "0.51232517", "0.5112355", "0.50783986", "0.50783986", "0.50783986", "0.5073503", "0.50662947", "0.50610673", "0.50229335", "0.50148726", "0.5003102", "0.49994543", "0.49878955", "0.4961954", "0....
0.5766749
1
Returns the id for the given user or raises RecordNotFound Implements a cache of users based on login name
def user_for_login!(login) begin if !@user_by_login.has_key?(login) @user_by_login[login] = User.find_by_login!(login) end rescue ActiveRecord::RecordNotFound if params[:use_anonymous] @user_by_login[login] = User.anonymous() else @unfound_class = "User" @unfound_key = login raise end end @user_by_login[login] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_id_for(user)\n find(user.id, user.login)\n end", "def get_id(name)\n @users.each do |user|\n return user[:id] if user[:name] == name\n end\n nil\n end", "def get_user_id_by_login(login)\n @user = User.find(:first ,:select=>\"id\",:conditions...
[ "0.742391", "0.7268961", "0.6915439", "0.6801867", "0.6695053", "0.6630163", "0.6609127", "0.6574889", "0.6550067", "0.6536255", "0.6447911", "0.64220387", "0.6378892", "0.6321503", "0.63113606", "0.62913406", "0.62719136", "0.6215256", "0.6186603", "0.618168", "0.6174891", ...
0.6163922
21
SUGGESTION: make sure PublicActivity record gets deleted too?
def destroy if @phrase.destroy flash[:notice] = 'Phrase has been deleted' redirect_to user_path(@phrase.user) else flash[:danger] = @phrase.errors.full_messages.to_sentence end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete; raise ActiveRecord::ReadOnlyRecord; end", "def destroy\n # @activity.destroy\n # instead lets be lets be more gentle:\n @activity.archived = true;\n @activity.save\n respond_to do |format|\n format.html { redirect_to(:action => 'index', :page => params[:page] || 1) }\n format...
[ "0.6610744", "0.651687", "0.64407146", "0.6301611", "0.62699234", "0.62398374", "0.62398374", "0.61898977", "0.61278117", "0.61278117", "0.61278117", "0.60906196", "0.60779715", "0.60779715", "0.6059627", "0.60298806", "0.59982455", "0.59982455", "0.59908015", "0.5964177", "0...
0.0
-1
Allow users to vote for phrases
def vote shared_vote(params[:vote], @phrase, current_user) redirect_back(fallback_location: root_path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_phrases\n mario\n toadstool\n link\nend", "def all_phrases\n mario\n toadstool\n link\nend", "def vote\n id = params[:id]\n @tweet = Tweet.find(id)\n selection = params[:selection]\n #Check if the user already liked this tweet\n if (@tweet.like.present? and @tweet.like.in...
[ "0.637212", "0.637212", "0.62005246", "0.61642087", "0.5978937", "0.5930541", "0.583057", "0.5786273", "0.5737435", "0.57269067", "0.57115304", "0.56805694", "0.5664658", "0.5641013", "0.5621192", "0.55933535", "0.5590815", "0.5590815", "0.5590815", "0.557624", "0.54652536", ...
0.66526335
0
should disallow changing other user's phrases
def authorship_filter unless helpers.can_delete_phrase? @phrase flash[:danger] = 'You are not author of the phrase!' redirect_to root_path end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autocorrect(input)\n input.gsub(/\\b(you+|u)\\b/, 'your sister')\nend", "def read_phrases\n raise \"Override me\"\n end", "def query_wo_exact_phrases(txt)\n self.query_without_exact_phrases ||= txt.gsub(Awesome::Definitions::Stopwords::QUOTED_REGEX, '')\n end", "def autocorrect(s...
[ "0.61762756", "0.6123365", "0.60682005", "0.6041531", "0.5948353", "0.591558", "0.591558", "0.58884776", "0.58246297", "0.58246297", "0.58246297", "0.5789642", "0.5644079", "0.56437474", "0.56123453", "0.55955464", "0.5537787", "0.55122805", "0.5495134", "0.5480394", "0.54606...
0.5943358
5
Private method to obtain single PDF value. x should be greater than 0 returns the probability that a stochastic variable x has the value X, i.e. P(x=X).
def get_pdf(x) d = Vector.elements(x) - @mu @pdf_factor * Math.exp(-0.5 * d.inner_product(@sigma_inv*d).to_f) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pdf(x)\n raise \"Argument Error: x must be greater than zero\" if x <= 0.0\n return 1.0/x.to_f * @norm.pdf(Math.log(x.to_f))\n end", "def get_pdf(x) \n return @pdf_factor * (1.0 + (x**2.0) / @dof)**(-(@dof+1.0)/2.0)\n end", "def pdf(_x)\n if _x.class == Array\n pdf...
[ "0.8279697", "0.81088126", "0.78605586", "0.762035", "0.727046", "0.6880953", "0.6854855", "0.6690661", "0.64497644", "0.6244446", "0.6200721", "0.611927", "0.60777074", "0.5965171", "0.5965171", "0.5946785", "0.5945519", "0.5911721", "0.5847722", "0.57712644", "0.5756316", ...
0.79488343
2
Private method to obtain single CDF value. param x should be greater than 0 return the probability that a stochastic variable x is less then X, i.e. P(x<X).
def get_cdf(x) raise "cdf for multivariate normal distribution not implemented" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cdf(x)\n return 0.5 + 0.5 * Math.erf((Math.log(x.to_f) - @meanlog) / (NumericalConstants::SQRT2 * @sdlog))\n end", "def get_cdf(x)\n raise \"method 'cdf' not implemented for student t\"\n end", "def get_cdf(x)\n end", "def get_cdf(_x)\n check_range(_x, 0.0, @n)\n sum = 0...
[ "0.7629624", "0.7610661", "0.75876087", "0.7571987", "0.74029744", "0.72717035", "0.6999543", "0.6856111", "0.6717249", "0.6682264", "0.666276", "0.66423786", "0.64369804", "0.6424093", "0.6361306", "0.6226767", "0.6173409", "0.6162367", "0.60454434", "0.5905242", "0.58941126...
0.72960496
5
Private method to obtain single inverse CDF value. return the value X for which P(x<X).
def get_icdf(p) check_range(p) raise "inverse cdf for multivariate normal distribution not implemented" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inverse_f\n return 0 if f_x.zero?\n temp_value = i = 0\n while temp_value <= f_x && i < n\n temp_value = gsl_cdf.binomial_P(i, p, n)\n next if temp_value >= f_x\n i += 1\n end\n i.zero? ? 0 : i - 1\n end", "def inverse_f\n return 0 if ...
[ "0.7334814", "0.72948354", "0.65790737", "0.612099", "0.61098677", "0.6084197", "0.6048374", "0.6020192", "0.59524155", "0.5847093", "0.5760519", "0.57526135", "0.5736061", "0.572028", "0.565058", "0.5575824", "0.5557389", "0.5546693", "0.5513874", "0.5476753", "0.54223937", ...
0.71328175
2
Private method to obtain single RNG value.
def get_rng z = Vector.elements(@mu.collect{ @stdnorm.rng }) (@mu + @a * z).to_a end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random()\n random = rand(0..@vals.length-1)\n return @vals[random]\n end", "def get_random\n @num.sample.first\n end", "def get_random()\n rand(@count).times { @cur = @cur.next }\n @cur.val\n end", "def get_random()\n values[rand(values.size)]\n end", "de...
[ "0.7325833", "0.7275283", "0.7105899", "0.70283216", "0.6896846", "0.68692094", "0.6823519", "0.6823519", "0.6823519", "0.6823519", "0.6815216", "0.6768864", "0.6682432", "0.65859425", "0.65859425", "0.65685177", "0.6558948", "0.6511198", "0.64849097", "0.6481575", "0.6403127...
0.0
-1
branch = Vebra::Branch.new(nokogiri_xml_object, vebra_client_object)
def initialize(nokogiri_xml, client) @xml = nokogiri_xml.to_xml @client = client @attributes = Vebra.parse(nokogiri_xml) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_branch\n nokogiri_xml_full = client.call(attributes[:url]).parsed_response\n @xml = nokogiri_xml_full.to_xml\n nokogiri_xml = nokogiri_xml_full.css('branch')\n @attributes.merge!(Vebra.parse(nokogiri_xml))\n end", "def get_branches\n xml = call(:branches).par...
[ "0.74870765", "0.5863478", "0.57034814", "0.5693569", "0.5659204", "0.55475277", "0.5510387", "0.5474704", "0.5452194", "0.54170513", "0.5372635", "0.535761", "0.535761", "0.535761", "0.535761", "0.535761", "0.535761", "0.535761", "0.535761", "0.535761", "0.5353947", "0.533...
0.6189112
1
Retrieve the full set of attributes for this branch
def get_branch nokogiri_xml_full = client.call(attributes[:url]).parsed_response @xml = nokogiri_xml_full.to_xml nokogiri_xml = nokogiri_xml_full.css('branch') @attributes.merge!(Vebra.parse(nokogiri_xml)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attributes\n\t\t\t@@attributes\n\t\tend", "def attributes\n @attributes ||= []\n @attributes\n end", "def attributes\n @attributes ||= []\n end", "def attributes\n @attribute_ids.collect { |idx| BAttribute.store[idx] }\n end", "def attributes\n ...
[ "0.7222328", "0.7069748", "0.69630814", "0.6951119", "0.6917646", "0.6855659", "0.6839134", "0.678554", "0.678554", "0.678554", "0.67562777", "0.6754996", "0.67384744", "0.6738292", "0.6725228", "0.67169064", "0.67017645", "0.6695742", "0.6645315", "0.6617429", "0.6610915", ...
0.0
-1
Call the API method to retrieve a collection of properties for this branch, and build a Vebra::Property object for each
def get_properties xml = client.call("#{attributes[:url]}/property").parsed_response xml.css('properties property').map { |p| Vebra::Property.new(p, self) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_properties\n properties.each do |key,val|\n prop = listing_properties.find_or_initialize_by(key:key)\n prop.value = val\n\n end\n end", "def properties\n # vendor = Vendor.find(params[:vendor_id])\n search_params = { vendor_id: params[:vendor_id].to_i, results_per_page: 150 }\n ...
[ "0.65887845", "0.65752155", "0.65145075", "0.649212", "0.6491012", "0.6193657", "0.6073973", "0.6068773", "0.5900388", "0.5889938", "0.5887827", "0.58727545", "0.58642715", "0.586362", "0.5848836", "0.5835323", "0.5824019", "0.5823862", "0.57352656", "0.57250553", "0.57178706...
0.7059579
0
As above, but uses the API method to get only properties updated since a given date/time
def get_properties_updated_since(datetime) year = datetime.year month = "%02d" % datetime.month day = "%02d" % datetime.day hour = "%02d" % datetime.hour minute = "%02d" % datetime.min second = "%02d" % datetime.sec base = API.compile(API::BASE_URI, client.config, {}) xml = client.call("#{base}/property/#{year}/#{month}/#{day}/#{hour}/#{minute}/#{second}").parsed_response xml.css('propertieschanged property').map { |p| Vebra::Property.new(p, self) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_updated\n self.dig_for_datetime(\"lastUpdateOn\")\n end", "def updated(opts={})\n ordered(:updated_at)\n date_time_filter(:updated_at, time_range(opts[:on], opts[:during], opts[:since], opts[:until]))\n self\n end", "def records_modified_since(time)\n []\n end", ...
[ "0.6603456", "0.65178984", "0.6430945", "0.6363671", "0.62921906", "0.62649685", "0.6155055", "0.6077061", "0.60664797", "0.60591376", "0.60414827", "0.6038649", "0.6032994", "0.599959", "0.59737206", "0.59679276", "0.5957975", "0.59430337", "0.59134734", "0.5885404", "0.5876...
0.7758782
0
encapsulation def initialize(username:, message:, id: nil) self.username, self.message = username, message
def initialize(hash) hash.each do |k, v| self.send("#{k}=", v) if self.respond_to?("#{k}=") end @id = hash["id"] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(message, user)\n @message = message\n @user = user\n end", "def initialize(props={})\n @message = props['message']\n @username = props['username']\n @id = props['id']\n ALL << self\n end", "def initialize message_id, sender_number, timestamp, text\n @message_id = messa...
[ "0.83446145", "0.8219996", "0.786741", "0.78020936", "0.77989054", "0.77989054", "0.77430224", "0.77419746", "0.7601657", "0.7498705", "0.7433136", "0.7277399", "0.70658934", "0.7062066", "0.70483077", "0.7047076", "0.70361865", "0.7020211", "0.6978676", "0.6961429", "0.69533...
0.0
-1
Parses the given "checkfile" FXP_EXTENDED_REPL packet and returns a hash with two keys, :algo, which references the hash algorithm used and :hashes which references the computed hashes.
def parse_hash_packet(data) hashes = [] algo = data.read_string size = case algo when "md5" then 128 when "sha256" then 256 when "sha384" then 284 when "sha512" then 512 else raise NotImplementedError, "unsupported algorithm: #{algo}" end while !data.eof? do hashes << data.read(size) end { :algo => algo, :hashes => hashes } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n [check_id, exceptions, key, links, port, proof, protocol, since, status].hash\n end", "def parse_config(rehash)\n open_config() if rehash\n @opers = []\n @ulines = []\n @options = {}\n \n while true\n line = @f.gets(\"\\n\")\n break if line == nil\n line.chomp!...
[ "0.53121525", "0.5138052", "0.50883794", "0.49994516", "0.48822543", "0.48791653", "0.48696357", "0.48524153", "0.48469138", "0.48421836", "0.48236346", "0.48082274", "0.48020944", "0.47873074", "0.47591317", "0.47563377", "0.46776003", "0.46692517", "0.466306", "0.46610093", ...
0.5863489
0
Parses the given "homedirectory" FXP_EXTENDED_REPL packet and returns a hash with one key, :home, which references the home directory returned by the server.
def parse_home_packet(data) { :home => data.read_string } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home\n Pathname.new(node.chopped.nginx.nginx_home)\n end", "def get_account_home_mountpoint()\n account_home_mountpoint = \"/export/home/\"+$q_struct[\"account_login\"].value\n return account_home_mountpoint\nend", "def home(username)\n send_request(FXP_EXTENDED, :string, \"home-director...
[ "0.575844", "0.5454618", "0.5371631", "0.5337917", "0.52577704", "0.5185275", "0.51493293", "0.5148376", "0.5092633", "0.50910854", "0.50657636", "0.50197685", "0.4945718", "0.4940299", "0.48661834", "0.48472598", "0.4793397", "0.47423533", "0.47088483", "0.46946728", "0.4688...
0.6162612
0
Parses the given FXP_EXTENDED_REPL packet and returns a hash, with :extension key, which references SFTP extension and the associated keys
def parse_extented_reply_packet(packet) packet.read_string do |extension| data = packet.remainder_as_buffer parsed_packet = case extension when "md5-hash" then parse_md5_packet(data) when "check-file" then parse_hash_packet(data) when "home-directory" then parse_home_packet(data) else raise NotImplementedError, "unknown packet type: #{extension}" end end { :extension => extension }.merge(parsed_packet) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_extensions(extension_request)\n extension_request_hash = {}\n extension_request.each do |extension|\n extension_request_hash[extension.value[0].value] = extension.value[1].value\n end\n return extension_request_hash\nend", "def find_extras(packet, mode)\n {}\n end", "def _xfext(io)\n ...
[ "0.5811842", "0.5598262", "0.51460224", "0.51246023", "0.4969804", "0.4839078", "0.48181564", "0.47671425", "0.47301418", "0.46752375", "0.4668906", "0.45981592", "0.45802647", "0.4528711", "0.45281646", "0.4495789", "0.44913307", "0.44865093", "0.44624978", "0.44499478", "0....
0.6600898
0
Sends a FXP_EXTENDED packet to the server to request MD5 checksum computation for file (or portion of file) obtained on the given +handle+, for the given byte +offset+ and +length+. The +quick_hash+ parameter is the hash over the first 2048 bytes of the data. It allows the server to quickly check if it is worth the resources to hash a big file.
def md5(handle, offset, length, quick_hash) send_request(FXP_EXTENDED, :string, "md5-hash-handle", :int64, offset, :int64, length, :string, quick_hash) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash(handle, offset, length, block_size=0)\n if block_size != 0 && block_size < 255\n block_size = 256\n end\n send_request(FXP_EXTENDED, :string, \"check-file-handle\", :string, handle, :string, \"md5,sha256,sha384,sha512\", :int64, offset, :int64, length, :long, block_size)\n end", ...
[ "0.6424286", "0.4887563", "0.47043386", "0.46730313", "0.45876923", "0.45839334", "0.45585066", "0.45278424", "0.43831092", "0.43775454", "0.4376493", "0.43592945", "0.4340354", "0.42930982", "0.42679438", "0.42649812", "0.42613766", "0.4232087", "0.42141905", "0.42132986", "...
0.7782032
0
Sends a FXP_EXTENDED packet to the server to request checksum computation for file (or portion of file) obtained on the given +handle+, for the given byte +offset+ and +length+. The +block_size+ parameter is used to compute over every +block_size+ block in the file. If the +block_size+ is 0, then only one hash, over the entire range, is made.
def hash(handle, offset, length, block_size=0) if block_size != 0 && block_size < 255 block_size = 256 end send_request(FXP_EXTENDED, :string, "check-file-handle", :string, handle, :string, "md5,sha256,sha384,sha512", :int64, offset, :int64, length, :long, block_size) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def md5(handle, offset, length, quick_hash)\n send_request(FXP_EXTENDED, :string, \"md5-hash-handle\", :int64, offset, :int64, length, :string, quick_hash)\n end", "def checksum(file_path, hash_class, _bit_size)\n # Size of each chunk\n chunk_size = 2048\n # Hash that is the checksum function\n # whe...
[ "0.5467314", "0.48675466", "0.48260993", "0.4686893", "0.46233553", "0.4605913", "0.46038654", "0.4520876", "0.44735864", "0.44729158", "0.4465444", "0.44459736", "0.44377795", "0.43980405", "0.43949682", "0.43703648", "0.4367681", "0.43552607", "0.43297112", "0.42973626", "0...
0.657518
0
Sends a FXP_EXTENDED packet to the server to request disk space availability for the given +path+ location.
def space_available(path) send_request(FXP_EXTENDED, :string, "space-available", :string, path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allocate_disk( amount )\n return false\n end", "def expand_volume_path(path)\n return path if path.start_with? '/'\n\n # Retrieve volume for the path\n volume = volume_pattern.match path\n\n unless volume\n raise \"Unable to expend path '#{path}': make sure your path is...
[ "0.5065478", "0.49581683", "0.49524722", "0.4861327", "0.47875276", "0.47705582", "0.4701093", "0.4675417", "0.46037772", "0.4576026", "0.45405048", "0.44893184", "0.44795984", "0.44683304", "0.4446984", "0.44459066", "0.44241863", "0.4415651", "0.43945622", "0.43801287", "0....
0.7694341
0
Sends a FXP_EXTENDED packet to the server to request home directory for the given +username+.
def home(username) send_request(FXP_EXTENDED, :string, "home-directory", :string, username) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user(username, mode, realname)\n send_data(\"USER #{username} #{mode} * :#{realname}\")\n end", "def user(username, realname, mode = 0)\n host = TCPSocket.gethostbyname(Socket.gethostname)[0]\n send_msg(\"USER #{username} #{mode} * :#{realname}\")\n end", "def infer_homedir(usernam...
[ "0.55341405", "0.54862833", "0.5478332", "0.49840182", "0.48217687", "0.4811426", "0.47954747", "0.47617483", "0.47585014", "0.47217572", "0.46927047", "0.4682622", "0.46410877", "0.46391237", "0.46278623", "0.4600517", "0.45883474", "0.45618105", "0.45610455", "0.4555594", "...
0.7661049
0
3. Threes and Fives
def threes_and_fives for i in 100..4000000 if (i % 3 == 0 and not i % 5 == 0) or (i % 5 == 0 and not i % 3) puts i end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def passage_of_time\n \n # if the tree is 20 years old, or @dead is true outputs that your tree is dead. \n puts \"Your tree is dead :(\" if @age == 20 || @dead == true\n \n # if the tree is still creating produce and there is a drought, it dies. \n # if there are no produce, it survives and the drou...
[ "0.5743288", "0.56060255", "0.55429524", "0.5464408", "0.5438544", "0.5384285", "0.5374145", "0.53131884", "0.5304246", "0.52660054", "0.52507037", "0.5249419", "0.52442247", "0.52027106", "0.51919067", "0.51800734", "0.51783353", "0.5171897", "0.51579714", "0.51334804", "0.5...
0.47667956
80
6. Sum to One Digit
def sum_to_one_digit(num) if num < 1 or not num.is_a? Integer puts "Num must be positive integer" return false; end get_sum = ->(intgr) { digit_sum = 0 intgr = intgr.to_s.split('') intgr.each do |i| digit_sum += i.to_i end return digit_sum } sum = get_sum.call(num) while sum.to_s.length > 1 do sum = get_sum.call(sum) end puts sum return sum end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_digits\n self.to_s.split('').inject(0) { |memo, c| memo + c.to_i }\n end", "def digits_sum(n)\n n.to_s.split('').inject(0){|a,b|a+=b.to_i}\nend", "def digits_sum\n self.split('').map {|x| x.to_i}.inject(0) do |res,elt|\n res += elt\n res\n end\n end", "def sum(number)\n sum = 0...
[ "0.79311764", "0.75316966", "0.7422316", "0.73804796", "0.7361712", "0.7344452", "0.73230594", "0.73230594", "0.73164886", "0.73164886", "0.7306617", "0.7305416", "0.72852623", "0.7269085", "0.72543323", "0.72438896", "0.7241085", "0.72280127", "0.7219585", "0.72141427", "0.7...
0.6793572
85
GET /repairers GET /repairers.json
def index @repairers = Repairer.all @electronics_repairers = Repairer.where(category: 'Electronics') @carpentry_repairers = Repairer.where(category: 'Carpentry') @jewellery_repairers = Repairer.where(category: 'Jewellery') @whitegoods_repairers = Repairer.where(category: 'Whitegoods') @clothing_repairers = Repairer.where(category: 'Clothing') @upholstery_repairers = Repairer.where(category: 'Upholstery') @ceramics_repairers = Repairer.where(category: 'Ceramics') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @repairer = Repairer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repairer }\n end\n end", "def show\n @repairer = Repairer.find(params[:id])\n end", "def destroy\n @repairer = Repairer.find(params[:id])\n @rep...
[ "0.7319652", "0.6572383", "0.6225905", "0.5943592", "0.58656496", "0.57837665", "0.5779982", "0.5772063", "0.5755199", "0.57401574", "0.573082", "0.5728073", "0.5686378", "0.5635922", "0.5623866", "0.5610411", "0.56062615", "0.5606111", "0.5606085", "0.56052285", "0.55842966"...
0.57490194
9
GET /repairers/1 GET /repairers/1.json
def show @repairer = Repairer.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @repairer = Repairer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repairer }\n end\n end", "def destroy\n @repairer = Repairer.find(params[:id])\n @repairer.destroy\n\n respond_to do |format|\n format.html { ...
[ "0.7719747", "0.64903283", "0.62678933", "0.6182999", "0.60170454", "0.5933978", "0.5933978", "0.5881573", "0.5881408", "0.58739775", "0.5826876", "0.582346", "0.5793623", "0.5766361", "0.57561123", "0.57372874", "0.5734435", "0.57023185", "0.5693971", "0.5693971", "0.5679586...
0.7080497
1
POST /repairers POST /repairers.json
def create @repairer = Repairer.new(repairer_params) @repairer.user = current_user respond_to do |format| if @repairer.save format.html { redirect_to @repairer, notice: 'Repairer was successfully created.' } format.json { render :show, status: :created, location: @repairer } else format.html { render :new } format.json { render json: @repairer.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @repairer = Repairer.new(params[:repairer])\n\n respond_to do |format|\n if @repairer.save\n format.html { redirect_to @repairer, notice: 'Repairer was successfully created.' }\n format.json { render json: @repairer, status: :created, location: @repairer }\n else\n ...
[ "0.69924724", "0.6167414", "0.6005678", "0.59674585", "0.5936493", "0.58602905", "0.57868075", "0.5728699", "0.57127887", "0.57081014", "0.5649496", "0.561759", "0.55338657", "0.5523063", "0.5511159", "0.54969805", "0.54758346", "0.5444536", "0.5409037", "0.5389674", "0.53663...
0.67555976
1
PATCH/PUT /repairers/1 PATCH/PUT /repairers/1.json
def update respond_to do |format| if @repairer.update(repairer_params) format.html { redirect_to @repairer, notice: 'Repairer was successfully updated.' } format.json { render :show, status: :ok, location: @repairer } else format.html { render :edit } format.json { render json: @repairer.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @repairer = Repairer.find(params[:id])\n\n respond_to do |format|\n if @repairer.update_attributes(params[:repairer])\n format.html { redirect_to @repairer, notice: 'Repairer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { ren...
[ "0.7193579", "0.6417123", "0.6326277", "0.6237479", "0.61153877", "0.60916376", "0.6049923", "0.6049923", "0.6049923", "0.6049895", "0.6032167", "0.6030691", "0.6020629", "0.6020495", "0.60148567", "0.60060555", "0.5991067", "0.5938141", "0.59217954", "0.5904961", "0.58888304...
0.696083
1
DELETE /repairers/1 DELETE /repairers/1.json
def destroy @repairer.destroy respond_to do |format| format.html { redirect_to repairers_url, notice: 'Repairer was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @repairer = Repairer.find(params[:id])\n @repairer.destroy\n\n respond_to do |format|\n format.html { redirect_to repairers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @repair.destroy\n respond_to do |format|\n format.html { redirect_to re...
[ "0.76297843", "0.7295967", "0.71490043", "0.6714776", "0.6641083", "0.66315794", "0.654417", "0.65371615", "0.65280503", "0.6516148", "0.65038466", "0.64948267", "0.64929163", "0.6487382", "0.64491946", "0.6432615", "0.6429474", "0.64268386", "0.64268386", "0.63970006", "0.63...
0.73074424
1
Use callbacks to share common setup or constraints between actions.
def set_repairer @repairer = Repairer.find_by(user: current_user) 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 repairer_params params.require(:repairer).permit(:user_id, :business_name, :category, :description, :will_travel, :photo, :remove_photo, address_attributes: [:street, :suburb, :postcode, :state, :country, :latitude, :longitude]) 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
we define keepable as 4 or more cards with at least 3 lands
def keepable_hand keepable = false if @hand.count('land') >= 3 && @hand.count('land') <= 4 && @hand.size > 5 keepable = true elsif @hand.count('land') >= 3 && @hand.count('low_curve') >= 1 && @hand.size >= 5 keepable = true elsif @hand.count('land') >= 2 && @hand.count('ramp') >= 1 && @hand.size >= 5 end keepable end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_deal?\n size() >= 6\n end", "def cards_needed\n [@size, 5].min\n end", "def three_of_a_kind?\n cards_by_rank.values.first.count >= 3\n end", "def full_house?\n return unless size >= 5\n\n the_cards = cards_by_rank.values\n the_cards[0].count >= 3 && the_cards[1].count >= 2\n ...
[ "0.66396385", "0.6379532", "0.6255486", "0.60741144", "0.5935389", "0.59204465", "0.5745587", "0.5735135", "0.5698495", "0.5657136", "0.563316", "0.56197435", "0.56193304", "0.561488", "0.5578064", "0.55661327", "0.555569", "0.55495304", "0.551384", "0.5509186", "0.5461913", ...
0.7562322
0
save the starting dir to restore later
def setup # wipe and recreate .test directory Dir.chdir(@@start_dir) if File.exist?('.test') FileUtils.rm_rf('.test') end # NOTE: I don't think we want to kill .repository in pwd from running test if File.exist?('.repository') FileUtils.rm_rf('.repository') end Dir.mkdir('.test') Dir.chdir('.test') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restore_dir\n cd @dir\n end", "def store_dir\n @dir = Dir.pwd\n end", "def saving_path\n path = home_path + '/.gitstagram'\n \n Dir.mkdir(path) unless Dir.exists?(path)\n path\n end", "def save_dir(filename)\n @save_save_dir = @dispatch.save_dir\n @dispatch.save_dir...
[ "0.73709327", "0.6975106", "0.6931209", "0.67534524", "0.6330191", "0.6302857", "0.6211243", "0.6160911", "0.61545146", "0.61399084", "0.6133731", "0.6117519", "0.61160827", "0.6047587", "0.59887433", "0.5974938", "0.5931674", "0.5891448", "0.5883241", "0.5824956", "0.5803050...
0.0
-1
This test add one file at a time and then commit for 101 times
def test_commit_stress_1 Repository.create() # should be 1000, since we wrote 1000 in our acceptance test (0..10).each do |e| filename = '.test_file' + e.to_s FileUtils.touch(filename) a = [filename] Repository.add(a) Repository.commit() end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add100\n\n # make new file and fill with data\n\t\tfill_file(100)\n\t\t \t\n \tfb=Fastabin.new(TEST_FILE,'r') \t \t\n assert_equal(100,fb.count)\n fb.close\n \t\t\n end", "def git_add_all_files\n files = `git ls-files`.split(\"\\n\").collect {|f| \"'#{f}'\"}\n index = 0\n w...
[ "0.66294175", "0.6599447", "0.63247895", "0.6131414", "0.61024", "0.60317636", "0.6031357", "0.60282075", "0.6025271", "0.5978689", "0.5972042", "0.59320647", "0.59019285", "0.5878396", "0.58749104", "0.58659774", "0.5837118", "0.5802716", "0.5783515", "0.57633114", "0.575433...
0.83649343
0
Repository doesn't have version yet hg is handling version, not sure if it makes sense to move to repository
def test_version_message Repository.create() FileUtils.touch('.test_file1') a = ['.test_file1'] Repository.add(a) Repository.commit() #Repository.version() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repo; end", "def repo; end", "def repo; end", "def repo; end", "def hg_repo_path\n path = `hg root 2>/dev/null`.strip\n @hg_repo_path ||= path + '/.hg' unless path == ''\nend", "def set_safe_revision\n case repository_type\n when 'git'\n %x[git rev-list --max-parents=0 HEAD].chomp\n when 'git...
[ "0.65108764", "0.65108764", "0.65108764", "0.65108764", "0.64156646", "0.61907566", "0.60420096", "0.60394627", "0.6022889", "0.59949493", "0.59949493", "0.59949493", "0.59949493", "0.59857595", "0.59560406", "0.5948654", "0.59007716", "0.5899318", "0.58935624", "0.58884853", ...
0.5843422
22
Repository doesn't have help yet hg is handling help, not sure if it makes sense to move to repository
def test_help_message Repository.create() #Repository.help() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hg_repo_path\n path = `hg root 2>/dev/null`.strip\n @hg_repo_path ||= path + '/.hg' unless path == ''\nend", "def load_hg_info\n hg_progressbar = ProgressBar.create(title: 'Hg Info', total: errors.size) if display_bar?\n errors.each do |error|\n info_command = \"cd #{@runner.class.base_pat...
[ "0.63079613", "0.6138545", "0.6003532", "0.6003532", "0.6003532", "0.6003532", "0.5899056", "0.586445", "0.584282", "0.58325857", "0.58142763", "0.56948423", "0.5672224", "0.5649325", "0.5649325", "0.5649325", "0.5648724", "0.56395864", "0.56277436", "0.5603573", "0.55818063"...
0.5750756
11
Show invalid properties with the reasons. Usually used together with valid?
def list_invalid_properties invalid_properties = Array.new if !@default_email.nil? && @default_email.to_s.length > 250 invalid_properties.push("invalid value for 'default_email', the character length must be smaller than or equal to 250.") end if !@default_phone.nil? && @default_phone.to_s.length > 15 invalid_properties.push("invalid value for 'default_phone', the character length must be smaller than or equal to 15.") end if @first_name.nil? invalid_properties.push("invalid value for 'first_name', first_name cannot be nil.") end if @first_name.to_s.length > 30 invalid_properties.push("invalid value for 'first_name', the character length must be smaller than or equal to 30.") end if !@home_email.nil? && @home_email.to_s.length > 250 invalid_properties.push("invalid value for 'home_email', the character length must be smaller than or equal to 250.") end if !@home_extension.nil? && @home_extension.to_s.length > 10 invalid_properties.push("invalid value for 'home_extension', the character length must be smaller than or equal to 10.") end if !@home_phone.nil? && @home_phone.to_s.length > 15 invalid_properties.push("invalid value for 'home_phone', the character length must be smaller than or equal to 15.") end if @identifier.nil? invalid_properties.push("invalid value for 'identifier', identifier cannot be nil.") end if @identifier.to_s.length > 15 invalid_properties.push("invalid value for 'identifier', the character length must be smaller than or equal to 15.") end if @last_name.nil? invalid_properties.push("invalid value for 'last_name', last_name cannot be nil.") end if @last_name.to_s.length > 30 invalid_properties.push("invalid value for 'last_name', the character length must be smaller than or equal to 30.") end if !@mobile_email.nil? && @mobile_email.to_s.length > 250 invalid_properties.push("invalid value for 'mobile_email', the character length must be smaller than or equal to 250.") end if !@mobile_extension.nil? && @mobile_extension.to_s.length > 10 invalid_properties.push("invalid value for 'mobile_extension', the character length must be smaller than or equal to 10.") end if !@mobile_phone.nil? && @mobile_phone.to_s.length > 15 invalid_properties.push("invalid value for 'mobile_phone', the character length must be smaller than or equal to 15.") end if !@office_email.nil? && @office_email.to_s.length > 250 invalid_properties.push("invalid value for 'office_email', the character length must be smaller than or equal to 250.") end if !@office_extension.nil? && @office_extension.to_s.length > 10 invalid_properties.push("invalid value for 'office_extension', the character length must be smaller than or equal to 10.") end if !@office_phone.nil? && @office_phone.to_s.length > 15 invalid_properties.push("invalid value for 'office_phone', the character length must be smaller than or equal to 15.") end if !@title.nil? && @title.to_s.length > 50 invalid_properties.push("invalid value for 'title', the character length must be smaller than or equal to 50.") end return invalid_properties end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil....
[ "0.76480395", "0.76480395", "0.76480395", "0.76480395", "0.76357543", "0.76357543", "0.76357543", "0.76357543", "0.76357543", "0.76357543", "0.76357543", "0.76357543", "0.73546803", "0.7333273", "0.72667927", "0.7237672", "0.7230264", "0.72240895", "0.7206086", "0.71745956", ...
0.0
-1
Check to see if the all the properties in the model are valid
def valid? return false if @default_department_id.nil? return false if !@default_email.nil? && @default_email.to_s.length > 250 return false if @default_location_id.nil? return false if !@default_phone.nil? && @default_phone.to_s.length > 15 return false if @expense_approver.nil? return false if @first_name.nil? return false if @first_name.to_s.length > 30 return false if !@home_email.nil? && @home_email.to_s.length > 250 return false if !@home_extension.nil? && @home_extension.to_s.length > 10 return false if !@home_phone.nil? && @home_phone.to_s.length > 15 return false if @identifier.nil? return false if @identifier.to_s.length > 15 return false if @last_name.nil? return false if @last_name.to_s.length > 30 return false if @license_class.nil? license_class_validator = EnumAttributeValidator.new('String', ["F", "A", "C", "X"]) return false unless license_class_validator.valid?(@license_class) return false if !@mobile_email.nil? && @mobile_email.to_s.length > 250 return false if !@mobile_extension.nil? && @mobile_extension.to_s.length > 10 return false if !@mobile_phone.nil? && @mobile_phone.to_s.length > 15 return false if !@office_email.nil? && @office_email.to_s.length > 250 return false if !@office_extension.nil? && @office_extension.to_s.length > 10 return false if !@office_phone.nil? && @office_phone.to_s.length > 15 return false if @sales_default_location_id.nil? return false if @time_approver.nil? return false if @time_zone.nil? return false if !@title.nil? && @title.to_s.length > 50 return false if @work_role.nil? return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_properties\n true\n end", "def validate_properties\n true\n end", "def validate\n super\n\n check_optional_property :collection, String\n check_optional_property :create, String\n check_optional_property :delete, String\n check_optional_property :...
[ "0.78992486", "0.78992486", "0.70971805", "0.70782334", "0.7032205", "0.7031276", "0.69510347", "0.6869891", "0.6858077", "0.6858077", "0.68287027", "0.6823878", "0.6820306", "0.68144894", "0.6794656", "0.6752167", "0.66843414", "0.6676546", "0.6667755", "0.66296124", "0.6618...
0.0
-1
Custom attribute writer method with validation
def default_email=(default_email) if !default_email.nil? && default_email.to_s.length > 250 fail ArgumentError, "invalid value for 'default_email', the character length must be smaller than or equal to 250." end @default_email = default_email end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method with validation
def default_phone=(default_phone) if !default_phone.nil? && default_phone.to_s.length > 15 fail ArgumentError, "invalid value for 'default_phone', the character length must be smaller than or equal to 15." end @default_phone = default_phone end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method with validation
def first_name=(first_name) if first_name.nil? fail ArgumentError, "first_name cannot be nil" end if first_name.to_s.length > 30 fail ArgumentError, "invalid value for 'first_name', the character length must be smaller than or equal to 30." end @first_name = first_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6469466", "0.63154924", "0.63154924", "0.62801963", "0.6276904", "0.6209469", "0.6185987", "0.6180369", "0.6069702", "0.60325414", "0.5996202", "0.5990781", "0.59591186", "0.5935022", "0.59287345", "0.5892344", "0.58594006", "0.58489454", "0.5847319", "0.5844102", "0.58309...
0.0
-1
Custom attribute writer method with validation
def home_email=(home_email) if !home_email.nil? && home_email.to_s.length > 250 fail ArgumentError, "invalid value for 'home_email', the character length must be smaller than or equal to 250." end @home_email = home_email end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method with validation
def home_extension=(home_extension) if !home_extension.nil? && home_extension.to_s.length > 10 fail ArgumentError, "invalid value for 'home_extension', the character length must be smaller than or equal to 10." end @home_extension = home_extension end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method with validation
def home_phone=(home_phone) if !home_phone.nil? && home_phone.to_s.length > 15 fail ArgumentError, "invalid value for 'home_phone', the character length must be smaller than or equal to 15." end @home_phone = home_phone end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method with validation
def identifier=(identifier) if identifier.nil? fail ArgumentError, "identifier cannot be nil" end if identifier.to_s.length > 15 fail ArgumentError, "invalid value for 'identifier', the character length must be smaller than or equal to 15." end @identifier = identifier end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6469466", "0.63154924", "0.63154924", "0.62801963", "0.6276904", "0.6209469", "0.6185987", "0.6180369", "0.6069702", "0.60325414", "0.5996202", "0.5990781", "0.59591186", "0.5935022", "0.59287345", "0.5892344", "0.58594006", "0.58489454", "0.5847319", "0.5844102", "0.58309...
0.0
-1
Custom attribute writer method with validation
def last_name=(last_name) if last_name.nil? fail ArgumentError, "last_name cannot be nil" end if last_name.to_s.length > 30 fail ArgumentError, "invalid value for 'last_name', the character length must be smaller than or equal to 30." end @last_name = last_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method checking allowed values (enum).
def license_class=(license_class) validator = EnumAttributeValidator.new('String', ["F", "A", "C", "X"]) unless validator.valid?(license_class) fail ArgumentError, "invalid value for 'license_class', must be one of #{validator.allowable_values}." end @license_class = license_class end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n ...
[ "0.7088127", "0.64820594", "0.6429773", "0.6227689", "0.61418885", "0.5809922", "0.57507086", "0.5743216", "0.5736045", "0.5708027", "0.57014966", "0.56777334", "0.5601988", "0.55947953", "0.55464065", "0.55371004", "0.55344343", "0.5528221", "0.5434983", "0.54312384", "0.541...
0.0
-1
Custom attribute writer method with validation
def mobile_email=(mobile_email) if !mobile_email.nil? && mobile_email.to_s.length > 250 fail ArgumentError, "invalid value for 'mobile_email', the character length must be smaller than or equal to 250." end @mobile_email = mobile_email end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method with validation
def mobile_extension=(mobile_extension) if !mobile_extension.nil? && mobile_extension.to_s.length > 10 fail ArgumentError, "invalid value for 'mobile_extension', the character length must be smaller than or equal to 10." end @mobile_extension = mobile_extension end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6469466", "0.63154924", "0.63154924", "0.62801963", "0.6276904", "0.6209469", "0.6185987", "0.6180369", "0.6069702", "0.60325414", "0.5996202", "0.5990781", "0.59591186", "0.5935022", "0.59287345", "0.5892344", "0.58594006", "0.58489454", "0.5847319", "0.5844102", "0.58309...
0.0
-1
Custom attribute writer method with validation
def mobile_phone=(mobile_phone) if !mobile_phone.nil? && mobile_phone.to_s.length > 15 fail ArgumentError, "invalid value for 'mobile_phone', the character length must be smaller than or equal to 15." end @mobile_phone = mobile_phone end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method with validation
def office_email=(office_email) if !office_email.nil? && office_email.to_s.length > 250 fail ArgumentError, "invalid value for 'office_email', the character length must be smaller than or equal to 250." end @office_email = office_email end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method with validation
def office_extension=(office_extension) if !office_extension.nil? && office_extension.to_s.length > 10 fail ArgumentError, "invalid value for 'office_extension', the character length must be smaller than or equal to 10." end @office_extension = office_extension end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Custom attribute writer method with validation
def office_phone=(office_phone) if !office_phone.nil? && office_phone.to_s.length > 15 fail ArgumentError, "invalid value for 'office_phone', the character length must be smaller than or equal to 15." end @office_phone = office_phone end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6469466", "0.63154924", "0.63154924", "0.62801963", "0.6276904", "0.6209469", "0.6185987", "0.6180369", "0.6069702", "0.60325414", "0.5996202", "0.5990781", "0.59591186", "0.5935022", "0.59287345", "0.5892344", "0.58594006", "0.58489454", "0.5847319", "0.5844102", "0.58309...
0.0
-1
Custom attribute writer method with validation
def title=(title) if !title.nil? && title.to_s.length > 50 fail ArgumentError, "invalid value for 'title', the character length must be smaller than or equal to 50." end @title = title end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{at...
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.5832836...
0.0
-1
Checks equality by comparing each attribute.
def ==(o) return true if self.equal?(o) self.class == o.class && admin_flag == o.admin_flag && allow_expenses_entered_against_companies_flag == o.allow_expenses_entered_against_companies_flag && allow_in_cell_entry_on_time_sheet == o.allow_in_cell_entry_on_time_sheet && billable_forecast == o.billable_forecast && calendar == o.calendar && calendar_sync_integration_flag == o.calendar_sync_integration_flag && country == o.country && daily_capacity == o.daily_capacity && days_tolerance == o.days_tolerance && default_department_id == o.default_department_id && default_email == o.default_email && default_location_id == o.default_location_id && default_phone == o.default_phone && disable_online_flag == o.disable_online_flag && enable_ldap_authentication_flag == o.enable_ldap_authentication_flag && enable_mobile_flag == o.enable_mobile_flag && enable_mobile_gps_flag == o.enable_mobile_gps_flag && enter_time_against_company_flag == o.enter_time_against_company_flag && expense_approver == o.expense_approver && first_name == o.first_name && hide_member_in_dispatch_portal_flag == o.hide_member_in_dispatch_portal_flag && hire_date == o.hire_date && home_email == o.home_email && home_extension == o.home_extension && home_phone == o.home_phone && hourly_cost == o.hourly_cost && hourly_rate == o.hourly_rate && id == o.id && identifier == o.identifier && inactive_date == o.inactive_date && inactive_flag == o.inactive_flag && include_in_utilization_reporting_flag == o.include_in_utilization_reporting_flag && last_login == o.last_login && last_name == o.last_name && license_class == o.license_class && mapi_name == o.mapi_name && middle_initial == o.middle_initial && minimum_hours == o.minimum_hours && mobile_email == o.mobile_email && mobile_extension == o.mobile_extension && mobile_phone == o.mobile_phone && notes == o.notes && office_email == o.office_email && office_extension == o.office_extension && office_phone == o.office_phone && project_default_board == o.project_default_board && project_default_department_id == o.project_default_department_id && project_default_location_id == o.project_default_location_id && reports_to == o.reports_to && require_expense_entry_flag == o.require_expense_entry_flag && require_start_and_end_time_on_time_entry_flag == o.require_start_and_end_time_on_time_entry_flag && require_time_sheet_entry_flag == o.require_time_sheet_entry_flag && restrict_default_sales_territory_flag == o.restrict_default_sales_territory_flag && restrict_default_warehouse_bin_flag == o.restrict_default_warehouse_bin_flag && restrict_default_warehouse_flag == o.restrict_default_warehouse_flag && restrict_department_flag == o.restrict_department_flag && restrict_location_flag == o.restrict_location_flag && restrict_project_default_department_flag == o.restrict_project_default_department_flag && restrict_project_default_location_flag == o.restrict_project_default_location_flag && restrict_schedule_flag == o.restrict_schedule_flag && restrict_service_default_department_flag == o.restrict_service_default_department_flag && restrict_service_default_location_flag == o.restrict_service_default_location_flag && sales_default_location_id == o.sales_default_location_id && schedule_capacity == o.schedule_capacity && schedule_default_department_id == o.schedule_default_department_id && schedule_default_location_id == o.schedule_default_location_id && security_level == o.security_level && security_location_id == o.security_location_id && security_role == o.security_role && service_default_board == o.service_default_board && service_default_department_id == o.service_default_department_id && service_default_location_id == o.service_default_location_id && service_location == o.service_location && service_teams == o.service_teams && time_approver == o.time_approver && time_reminder_email_flag == o.time_reminder_email_flag && time_sheet_start_date == o.time_sheet_start_date && time_zone == o.time_zone && title == o.title && type == o.type && vendor_number == o.vendor_number && warehouse == o.warehouse && warehouse_bin == o.warehouse_bin && work_role == o.work_role && work_type == o.work_type && _info == o._info && system_flag == o.system_flag end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ==(other)\n attributes == other.attributes\n end", "def ==(other) # :nodoc:\n @attrs == other.attrs\n end", "def eql?(other)\n return true if self == other\n @@ATTRIBUTES.each do |att|\n return false unless self.send(att).eql?(other.send(att))\n end\n true\n en...
[ "0.7291717", "0.7188103", "0.70395297", "0.7007927", "0.68874705", "0.6861532", "0.6707156", "0.6660597", "0.66147524", "0.658478", "0.6584619", "0.6580019", "0.65543133", "0.6543933", "0.65068495", "0.6479513", "0.6456241", "0.6415999", "0.6412208", "0.6412208", "0.6412208",...
0.0
-1
Calculates hash code according to all attributes.
def hash [admin_flag, allow_expenses_entered_against_companies_flag, allow_in_cell_entry_on_time_sheet, billable_forecast, calendar, calendar_sync_integration_flag, country, daily_capacity, days_tolerance, default_department_id, default_email, default_location_id, default_phone, disable_online_flag, enable_ldap_authentication_flag, enable_mobile_flag, enable_mobile_gps_flag, enter_time_against_company_flag, expense_approver, first_name, hide_member_in_dispatch_portal_flag, hire_date, home_email, home_extension, home_phone, hourly_cost, hourly_rate, id, identifier, inactive_date, inactive_flag, include_in_utilization_reporting_flag, last_login, last_name, license_class, mapi_name, middle_initial, minimum_hours, mobile_email, mobile_extension, mobile_phone, notes, office_email, office_extension, office_phone, project_default_board, project_default_department_id, project_default_location_id, reports_to, require_expense_entry_flag, require_start_and_end_time_on_time_entry_flag, require_time_sheet_entry_flag, restrict_default_sales_territory_flag, restrict_default_warehouse_bin_flag, restrict_default_warehouse_flag, restrict_department_flag, restrict_location_flag, restrict_project_default_department_flag, restrict_project_default_location_flag, restrict_schedule_flag, restrict_service_default_department_flag, restrict_service_default_location_flag, sales_default_location_id, schedule_capacity, schedule_default_department_id, schedule_default_location_id, security_level, security_location_id, security_role, service_default_board, service_default_department_id, service_default_location_id, service_location, service_teams, time_approver, time_reminder_email_flag, time_sheet_start_date, time_zone, title, type, vendor_number, warehouse, warehouse_bin, work_role, work_type, _info, system_flag].hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_hash\n Digest::MD5.hexdigest(\"#{@name}:#{@ruby_type}\")\n end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash\n code = 17\n code = 37*code + @x.hash\n code = 37*code + @y.hash\n ...
[ "0.7118691", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.68960655", "0.67847186", "0.6707762", "0.670052", "0.6688737", "0.66705376", "0.6489735", "0.6462376", "0.6462376", "0.64444333", "0.6413127", "0.6395483", "0.638...
0.0
-1
Builds the object from hash
def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(hash)\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v if variables[k]\n end\n return obj\n end", "def build_from_hash(attributes)\n\n end", "def build_from_hash(hash)\n instance = self.new\n\n # Add the instance attributes dynamically ...
[ "0.8012219", "0.74724483", "0.745956", "0.72583616", "0.7245182", "0.7006886", "0.6973024", "0.6955572", "0.6944315", "0.6940353", "0.6937024", "0.6917436", "0.6871505", "0.6796401", "0.678333", "0.6756041", "0.6756041", "0.6755624", "0.67541397", "0.6714415", "0.6668172", ...
0.0
-1
Deserializes the data based on type
def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /^(true|t|yes|y|1)$/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = Connectwise.const_get(type).new temp_model.build_from_hash(value) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s...
[ "0.7330926", "0.7274019", "0.72504056", "0.7245751", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", ...
0.0
-1
Returns the string representation of the object
def to_s to_hash.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n @object.to_s\n end", "def to_s\n object.to_s\n end", "def serialize(object)\n object.to_s\n end", "def to_s\n self.inspect\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s\n @string || @object.to_s('F')\n end", "de...
[ "0.901024", "0.89506465", "0.84703195", "0.83409667", "0.8337169", "0.8337169", "0.8332247", "0.82546586", "0.8145818", "0.8144667", "0.81357557", "0.812714", "0.8093436", "0.8086725", "0.8073356", "0.8039774", "0.80308646", "0.80064154", "0.80064154", "0.80064154", "0.800641...
0.0
-1
to_body is an alias to to_hash (backward compatibility)
def to_body to_hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_body\r\n to_hash\r\n end", "def to_body\n to_hash\nend", "def to_body\n to_hash\nend" ]
[ "0.84283537", "0.8347048", "0.8347048" ]
0.0
-1
Returns the object in the form of hash
def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_hash\n object\n end", "def hash\r\n return to_s.hash\r\n end", "def hash\n to_a.hash\n end", "def hash\n [_hash, name, owner].hash\n end", "def hash\n return to_s.hash\n end", "def hash\n @hash\n end", "def hash\n @hash.hash\n end", "def hash\n ...
[ "0.82709855", "0.78793657", "0.7874668", "0.7803157", "0.7791461", "0.7781624", "0.77770436", "0.77689373", "0.77623206", "0.77623206", "0.77583927", "0.77330536", "0.7714564", "0.7714564", "0.7714564", "0.7714564", "0.7714564", "0.7714564", "0.7714564", "0.7714564", "0.77145...
0.0
-1
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value
def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n [value].hash\n end", "def hash\n [value].hash\n end", "def hash\n\t\tvalue.hash\n\tend", "def hash\n value.hash\n end", "def hash\n @value.hash\n end", "def hash\r\n return to_s.hash\r\n end", "def to_hash\n @value\n end", "def to_hash\n @va...
[ "0.6719518", "0.6719518", "0.666832", "0.66565555", "0.6586841", "0.6452931", "0.6414911", "0.6414911", "0.6382046", "0.6346188", "0.6302933", "0.62237245", "0.6151989", "0.6101756", "0.60795677", "0.60795677", "0.60717124", "0.6035991", "0.6021168", "0.5936472", "0.5903488",...
0.0
-1
v (always 2 ???)
def initialize(options={}) @query, @max_results, @offset = nil @alt = 'atom' @strict = 'false' @v = 2 @url = base_url set_instance_variables(options) @url << build_query_params(to_youtube_params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bil\n v=1\n end", "def v\n @v ||= operand(0).evaluate\n end", "def iv=(v); end", "def bv d\n 1 << d\n end", "def qv\n end", "def __value(v); end", "def c2= c; @c2 = (c == 1) ? 1 : 0; end", "def x; 1; end", "def _V(data) ; end", "def s(x); 1; end", "def V(*args)\n ...
[ "0.695779", "0.6316852", "0.63024235", "0.5955223", "0.5919705", "0.58733815", "0.58577675", "0.579769", "0.57556415", "0.5745734", "0.5708207", "0.56844825", "0.5670293", "0.5641198", "0.5620955", "0.55852556", "0.5546423", "0.553099", "0.5525058", "0.5504558", "0.5497411", ...
0.0
-1
usage: ruby scrapper.rb query filter [free|paid] sort [relevance|popularity]
def start_scrapping query = ARGV.first if query.nil? puts "Lo estas haciendo mal!" puts "Sintaxis: ruby scrapper.rb query --filter [free|paid] --sort [relevance|popularity]" else filter = "no_filter" sort = nil pages = 2 start_time = Time.now sort = "relevance" filter = ARGV[(ARGV.index "--filter") + 1] unless (ARGV.index "--filter").nil? sort = ARGV[(ARGV.index "--sort") + 1] unless (ARGV.index "--sort").nil? pages = ARGV[(ARGV.index "--pages") + 1].to_i unless (ARGV.index "--pages").nil? apps = search(query, {:filter => filter, :sort => sort, :pages => pages}) puts "" puts "Obteniendo datos de las aplicaciones." puts "" apps.each do |app| print "#{app.name} " prev_time = Time.now obtain_app_details app print "(#{Time.now-prev_time} s)" puts "" end open("#{query}-apps.csv", "a") { |f| f.puts "Nombre,Url,Precio,DwnMin,DwnMax,DwnAvg,Espacio" apps.each do |app| f.puts "#{app.name},#{app.url},#{app.price},#{app.downloads_min},#{app.downloads_max},#{app.downloads_avg},#{app.size}" end } puts "" puts "Finalizado en #{Time.now - start_time} s" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search\n\t \n\t \n\t # get the parameters from URL \n # products/?keywords=food&min_price=2\n # filter the output to avoid SQL injection\n @safe_keywords = params[:keywords].gsub(/[^0-9a-z\\ ]/i, '') if params[:keywords].present? \n @safe_category_id = params[:category_id].to_i if param...
[ "0.6191119", "0.60940766", "0.5944829", "0.5899895", "0.58926165", "0.5891055", "0.5869359", "0.5860391", "0.584236", "0.5828833", "0.5803631", "0.5802028", "0.577873", "0.5774776", "0.5756196", "0.5751334", "0.57347697", "0.5732127", "0.57236576", "0.57157004", "0.5713152", ...
0.6474883
0
=begin Here is a shorter and better version of my solution. As we can see, there we could have made the regex much shorter, there was no need for square brackets. Here the boolean evaluates the size of the pairs array rather than the size of the string divided by 2. =end
def pairs_of_bears(x,s) pairs = s.scan(/(B8|8B)/) [pairs.join, pairs.size >= x] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeating_pair?(text)\n text.match(/(\\w{2})\\w*\\1/) ? true : false\nend", "def expand_balanced?(string)\n pairs_unmatched = string.scan(/[\\(\\)\\'\\\"\\{\\}\\[\\]]*/).join\n loop { break if pairs_unmatched.gsub!(/(\\(\\))|(\\[\\])|(\\{\\})|(\\'\\')|(\\\"\\\")/, '').nil? }\n pairs_unmatched.size.zero?\...
[ "0.6756942", "0.6598491", "0.63005984", "0.6136633", "0.604882", "0.6035375", "0.60352606", "0.6015439", "0.5949369", "0.5918694", "0.5903236", "0.5894701", "0.588379", "0.58765554", "0.58710974", "0.5868209", "0.58590335", "0.58537287", "0.582477", "0.581576", "0.5803634", ...
0.5826903
18
The active_section_plane method is used to access the currently active section plane in the Entities object.
def active_section_plane end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def active_section_plane\n end", "def active_section_plane\n end", "def active_section_plane=(sec_plane)\n end", "def add_section_plane(plane)\n end", "def plane\n return nil if @vertices.length < 3\n Plane.three_points(*@vertices[0..2])\n end", "def has_plane(plane)\n @planes.inc...
[ "0.74355143", "0.74355143", "0.69086975", "0.6019148", "0.5588092", "0.53767335", "0.5357188", "0.52466893", "0.51819444", "0.49825087", "0.49631995", "0.49391696", "0.4860505", "0.48077917", "0.47152704", "0.46985424", "0.46867162", "0.46844554", "0.45816332", "0.45599157", ...
0.7135732
2
The active_section_plane= method is used to set the active section plane in the Entities object.
def active_section_plane=(sec_plane) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def active_section_plane\n end", "def active_section_plane\n end", "def active_section_plane\n end", "def add_section_plane(plane)\n end", "def use_section_planes=(setting)\n end", "def add_plane(plane)\n @planes << plane\n end", "def set_airplane\n @airplane = Airplane.find(param...
[ "0.7266666", "0.7266666", "0.6998598", "0.63439906", "0.56677526", "0.5184822", "0.5167513", "0.5167513", "0.50869733", "0.5085014", "0.50536764", "0.5042245", "0.50105846", "0.5010294", "0.49899668", "0.4950605", "0.49413878", "0.4928752", "0.49043873", "0.48866206", "0.4880...
0.77724785
0
The add_arc method is used to create an arc curve segment.
def add_arc(*args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_arc(centerPoint: { x: 0.0, y: 0.0 }, radius: 1.0, \n startAngle: 0.0, endAngle: Math::PI * 0.25,\n isClockwise: false)\n pathElement = { elementtype: :patharc,\n centerpoint: centerPoint,\n radius: radius,\n ...
[ "0.756371", "0.70085746", "0.68496895", "0.6623744", "0.66129583", "0.6586651", "0.6373637", "0.6262746", "0.6182431", "0.6090832", "0.60807985", "0.6033006", "0.6032096", "0.5983472", "0.5907752", "0.5809187", "0.5715258", "0.5671065", "0.5329148", "0.5329076", "0.5300027", ...
0.67001635
3
The add_circle method is used to create a circle.
def add_circle(center, normal, radius, numsegs = 24) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_circle(options)\n circle = OptionsHelper.to_circle(options)\n self.add_overlay circle\n\n circle\n end", "def draw_circle_shape(circle)\n body = circle.body\n c = body.p + circle.center.rotate(body.rot)\n self.draw_circle(c.x,c.y,circle.radius,body.a)\n end", "def ci...
[ "0.80569744", "0.6890897", "0.6585188", "0.6567913", "0.64942646", "0.64926046", "0.6447456", "0.6428423", "0.6416997", "0.6401681", "0.63700825", "0.62510484", "0.62470216", "0.6206563", "0.6206563", "0.6194595", "0.6174517", "0.61422366", "0.61416954", "0.613191", "0.612314...
0.7706777
1