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 |
|---|---|---|---|---|---|---|
This method is called when we need to add a specialization to RoadBike. | def default_tire_size
'23'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def register_spec_type(*args, &block); end",
"def set_specialization\n @specialization = Specialization.find(params[:id])\n end",
"def _add_method\n :\"_add_#{singularize(self[:name])}\"\n end",
"def spec_type(desc, *additional); end",
"def add_spec(name, config)\n unless spec ... | [
"0.55237955",
"0.529767",
"0.5262308",
"0.51903945",
"0.51003176",
"0.5045814",
"0.49377948",
"0.49364457",
"0.49217698",
"0.49216086",
"0.49216086",
"0.49216086",
"0.49216086",
"0.49116206",
"0.48851684",
"0.48225248",
"0.48225248",
"0.48035964",
"0.47967124",
"0.47765055",
... | 0.0 | -1 |
This method is called when we need to add a specialization to MountainBike. | def default_tire_size
'2.1'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def register_spec_type(*args, &block); end",
"def addSetupBlock( &block ); self.class.addSetupBlock( &block ); end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def set_specialization\n @specialization = Specialization.find(params[:id])\n end",
"def sti_subcla... | [
"0.5670765",
"0.53502417",
"0.5333336",
"0.5333336",
"0.5333336",
"0.5333336",
"0.53084505",
"0.5132197",
"0.5112328",
"0.51103485",
"0.5052655",
"0.50344926",
"0.5030865",
"0.50307935",
"0.503073",
"0.503073",
"0.50127965",
"0.50038123",
"0.49872363",
"0.49859345",
"0.497475... | 0.0 | -1 |
remember user in persistent session | def remember(user)
user.remember
cookies.permanent.signed[:user_id] = user.id
cookies.permanent[:remember_token] = user.remember_token
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remember(user)\n user.remember # Calls model\n cookies.permanent.signed[:user_id] = user.id # Save off encryped user ID\n cookies.permanent[:remember_token] = user.remember_token # Save off random thing for validation\n end",
"def remember(user)\n user.remember\n cookies.permanent.signed[:user_id]... | [
"0.8394349",
"0.82762825",
"0.826709",
"0.82072407",
"0.82040524",
"0.81992024",
"0.8141346",
"0.8082362",
"0.8072846",
"0.80542",
"0.80503416",
"0.8031862",
"0.8024503",
"0.8019556",
"0.8017316",
"0.8015269",
"0.7999434",
"0.79976696",
"0.7966352",
"0.7966007",
"0.7958609",
... | 0.7999868 | 44 |
log out the current user | def logout
forget(current_user)
session.delete(:user_id)
@current_user = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_out\n\t\t# current_user.delete_auth_token # won't work with curl, but html is good\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
... | [
"0.88792306",
"0.8861149",
"0.8861149",
"0.8861149",
"0.8861149",
"0.8860963",
"0.8844885",
"0.8840504",
"0.8805988",
"0.8805988",
"0.8805988",
"0.8805988",
"0.8805988",
"0.88028395",
"0.88028395",
"0.88028395",
"0.88028395",
"0.88028395",
"0.8801117",
"0.8789391",
"0.8778011... | 0.0 | -1 |
forget user in persistent session | def forget(user)
user.forget
cookies.delete(:user_id)
cookies.delete(:remember_token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forget(user)\n user.forget # Defined in the User model\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget_user(user)\n user.forget_user\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget_user(user)\n user.forget_user\n co... | [
"0.83336115",
"0.8279981",
"0.8279981",
"0.8271097",
"0.8270323",
"0.8253552",
"0.82465607",
"0.82465607",
"0.8244282",
"0.82403463",
"0.82156277",
"0.82156277",
"0.8211036",
"0.82039756",
"0.8185923",
"0.8184973",
"0.81803244",
"0.81755435",
"0.8163968",
"0.81626576",
"0.814... | 0.8140059 | 48 |
return the current user that is logged in | def current_user
if (user_id = session[:user_id])
@current_user ||= User.find_by(id: user_id)
elsif (user_id = cookies.signed[:user_id])
user = User.find_by(id: user_id)
if user && user.authenticated?(cookies[:remember_token])
login user
@current_user = user
end
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_user\n User.find_by(uid: session[:user]) if logged_in?\n end",
"def current_user\n User.get_user(session[:user_id]) if session[:user_id]\n end",
"def current_user\n @current_user if logged_in?\n end",
"def current_user\n @current_user if logged_in?\n end",
"def cur... | [
"0.8620517",
"0.8558693",
"0.85469157",
"0.85469157",
"0.8493746",
"0.84774774",
"0.84629506",
"0.8461794",
"0.8460646",
"0.8460646",
"0.8452493",
"0.8446895",
"0.8427255",
"0.8414367",
"0.8414367",
"0.84096247",
"0.8395401",
"0.8388651",
"0.8388651",
"0.8388031",
"0.8385576"... | 0.0 | -1 |
return true if given user is the current user | def current_user?(user)
user == current_user
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_user?(user)\n\t\tuser == current_user\n\tend",
"def current_user?(user)\n\t\tuser == current_user\n\tend",
"def current_user?(user)\n\t\tuser == current_user\n\tend",
"def current_user?(user)\n\t\tuser == current_user\n\tend",
"def current_user?(user)\n\t\tuser == current_user\n\tend",
"def c... | [
"0.91030586",
"0.91029966",
"0.91029966",
"0.91029966",
"0.91029966",
"0.91029966",
"0.91029966",
"0.91029966",
"0.91029966",
"0.91029966",
"0.91029966",
"0.9092927",
"0.90843654",
"0.9083215",
"0.9083215",
"0.9083215",
"0.9083215",
"0.9083215",
"0.9083215",
"0.9083215",
"0.9... | 0.0 | -1 |
return true if a user is currently logged in | def logged_in?
return !current_user.nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_is_logged_in()\n user = get_user()\n if user != nil\n true\n else\n false\n end\n end",
"def logged_in?\n if current_user\n true\n else\n false\n end\n end",
"def logged_in?\n current_user\n end",
"def logged_in?\n current_user\n end",
"de... | [
"0.886236",
"0.8779197",
"0.8737837",
"0.8737837",
"0.87363565",
"0.8716173",
"0.8707536",
"0.87002796",
"0.8698717",
"0.8694882",
"0.8692945",
"0.8692945",
"0.8689975",
"0.8684339",
"0.8653988",
"0.8643313",
"0.86084986",
"0.86084986",
"0.86064327",
"0.8604771",
"0.86041445"... | 0.0 | -1 |
is the person accessing the page logged in? | def logged_in_user?
unless logged_in?
store_URL
flash[:alert] = 'Please log in.'
redirect_to login_path
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logged_in?\n !!link_to_account_detail_page\n end",
"def logged_in?\n !session[:user_id].nil? #&& User.find(session[:user_id]).owns(@current_site)\n end",
"def user_is_logged_in()\n user = get_user()\n if user != nil\n true\n else\n false\n end\n end",
"def user_logg... | [
"0.82931316",
"0.82762897",
"0.82444143",
"0.8221483",
"0.82067835",
"0.81957096",
"0.81428593",
"0.81426597",
"0.8141107",
"0.8139033",
"0.8129945",
"0.8122724",
"0.8095351",
"0.8095351",
"0.8092544",
"0.80915576",
"0.8082974",
"0.8076283",
"0.80625945",
"0.80605155",
"0.805... | 0.0 | -1 |
store the URL trying to be accessed | def store_URL
session[:forwarding_url] = request.original_url if request.get?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def url=(_); end",
"def store_location\n # store last url as long as it isn't a /users path\n\tsession[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/ or request.fullpath =~ /\\/json/ or request.fullpath =~ /\\/static/\n\t\n end",
"def url= new_url\n new_url = self.class.standard... | [
"0.70503724",
"0.697813",
"0.67542744",
"0.67445993",
"0.67209363",
"0.67209363",
"0.67209363",
"0.67209363",
"0.67209363",
"0.67209363",
"0.6653226",
"0.6625379",
"0.6582837",
"0.65546316",
"0.6550655",
"0.653477",
"0.653477",
"0.653477",
"0.653477",
"0.6513286",
"0.6504192"... | 0.6564917 | 13 |
redirect to stored url or, if none, go to provided location | def redirect_to_forwarding_url_or(default)
redirect_to(session[:forwarding_url] || default)
session.delete(:forwarding_url)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def redirect(url); end",
"def redirect_to_stored_location_or(default)\n redirect_to(session[:forward_url] || default)\n session.delete(:forward_url)\n end",
"def redirect(location, status = '302'); request.redirect(location, status); end",
"def get_location_or_redirect(options = {})\n r... | [
"0.76495796",
"0.7632966",
"0.74096686",
"0.73938465",
"0.73854095",
"0.7218614",
"0.712752",
"0.712086",
"0.7112321",
"0.7046239",
"0.7030234",
"0.7006181",
"0.7005729",
"0.6981954",
"0.6965189",
"0.6957053",
"0.6946816",
"0.6937357",
"0.69294447",
"0.69019085",
"0.6888364",... | 0.67881924 | 26 |
Write a method find_by_name, which takes an array of hashes, each of which has the property :name, and a string and finds the first one that has that name. | def find_by_name(arrHash,strang)
ret = nil
arrHash.each_with_index do |chack,index|
if chack[:name]==strang
ret=chack
break
end
end
ret
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_first(name)\n find_all(name).first\n end",
"def find_by_name(name)\n return nil unless name.present?\n names.select {|e| e == name}\n end",
"def find_by_name(name)\n end",
"def find_by_name(name)\n find_by('name', name)\n end",
"def find_first(na... | [
"0.77223414",
"0.7601173",
"0.7492018",
"0.7465802",
"0.7409944",
"0.7354837",
"0.73310167",
"0.726787",
"0.71987313",
"0.7115148",
"0.71017164",
"0.7063352",
"0.70253265",
"0.6931768",
"0.689564",
"0.68858385",
"0.68651396",
"0.68532044",
"0.6821226",
"0.6794995",
"0.6793263... | 0.694515 | 13 |
Use callbacks to share common setup or constraints between actions. | def set_movie_review
@movie_review = MovieReview.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Only allow a list of trusted parameters through. | def movie_review_params
params.require(:movie_review).permit(:comment, :reviewer, :movie_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def param_whitelist\n [:role, :title]\... | [
"0.69497335",
"0.6812623",
"0.6803639",
"0.6795365",
"0.67448795",
"0.67399913",
"0.6526815",
"0.6518771",
"0.64931697",
"0.6430388",
"0.6430388",
"0.6430388",
"0.63983387",
"0.6356042",
"0.63535863",
"0.63464934",
"0.63444513",
"0.6337208",
"0.6326454",
"0.6326454",
"0.63264... | 0.0 | -1 |
GET /transferences GET /transferences.json | def index
@transferences = Transference.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_transference\n @transference = Transference.find(params[:id])\n end",
"def transactions\n JSON.parse(response.body).fetch('transactions')\n end",
"def create\n @transference = Transference.new(transference_params)\n\n respond_to do |format|\n if @transference.save\n fo... | [
"0.6027824",
"0.58282536",
"0.5787434",
"0.5720145",
"0.56887525",
"0.5670672",
"0.5624934",
"0.5548853",
"0.55383706",
"0.55295706",
"0.55247754",
"0.5511844",
"0.54960746",
"0.54903936",
"0.5475591",
"0.5474376",
"0.5460736",
"0.5454536",
"0.5454448",
"0.5433533",
"0.542978... | 0.72812235 | 0 |
GET /transferences/1 GET /transferences/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @transferences = Transference.all\n end",
"def set_transference\n @transference = Transference.find(params[:id])\n end",
"def show\n @translantion = Translantion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tran... | [
"0.7170096",
"0.6589255",
"0.6419933",
"0.6250138",
"0.6174778",
"0.61219937",
"0.58381337",
"0.5826869",
"0.5820866",
"0.5773242",
"0.5773242",
"0.5773242",
"0.5773242",
"0.5773242",
"0.5755714",
"0.57435775",
"0.5717959",
"0.571747",
"0.5716374",
"0.5715329",
"0.5679415",
... | 0.0 | -1 |
POST /transferences POST /transferences.json | def create
@transference = Transference.new(transference_params)
respond_to do |format|
if @transference.save
format.html { redirect_to @transference, notice: 'Transference was successfully created.' }
format.json { render :show, status: :created, location: @transference }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transference_params\n params.require(:transference).permit(:new_cost_center, :old_cost_center, :cost_center_id, :status, :who_ask, :user_id, :collaborator, :new_branch, :old_branch, :branch_id, :new_company, :old_company, :company_id, :tranference_date, :old_city, :new_city)\n end",
"def index\n @... | [
"0.62170047",
"0.61825293",
"0.6021567",
"0.561041",
"0.5511341",
"0.54670703",
"0.5454508",
"0.54189974",
"0.5406838",
"0.539899",
"0.5358836",
"0.5324159",
"0.530877",
"0.5215243",
"0.5215243",
"0.5204153",
"0.5180949",
"0.5165129",
"0.5126005",
"0.51137674",
"0.50988257",
... | 0.72675544 | 0 |
PATCH/PUT /transferences/1 PATCH/PUT /transferences/1.json | def update
respond_to do |format|
if @transference.update(transference_params)
format.html { redirect_to @transference, notice: 'Transference was successfully updated.' }
format.json { render :show, status: :ok, location: @transference }
else
format.html { render :edit }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n authorize @trip\n\n\n @trip.estimated_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @trip.destination\n req.expense_type = 'estimated'\n end\n end\n\n respond_to do |format|\... | [
"0.60052466",
"0.59662753",
"0.59576494",
"0.595488",
"0.5945739",
"0.5938819",
"0.5918057",
"0.5913815",
"0.59122485",
"0.5873087",
"0.5837971",
"0.5808703",
"0.5807274",
"0.5806339",
"0.5800243",
"0.57868665",
"0.5785557",
"0.57833064",
"0.5779331",
"0.5774113",
"0.57385",
... | 0.6791676 | 0 |
DELETE /transferences/1 DELETE /transferences/1.json | def destroy
@transference.destroy
respond_to do |format|
format.html { redirect_to transferences_url, notice: 'Transference was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @translantion = Translantion.find(params[:id])\n @translantion.destroy\n\n respond_to do |format|\n format.html { redirect_to translantions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @transaccion = Transaccion.find(params[:id])\n @transaccion.... | [
"0.7317299",
"0.72046584",
"0.7103289",
"0.6990557",
"0.69714916",
"0.6968919",
"0.6953228",
"0.6951607",
"0.6949724",
"0.69459254",
"0.6942211",
"0.6932132",
"0.6932132",
"0.6932132",
"0.6932132",
"0.6932132",
"0.6932132",
"0.6932132",
"0.6932132",
"0.69275266",
"0.69117737"... | 0.77265006 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_transference
@transference = Transference.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 transference_params
params.require(:transference).permit(:new_cost_center, :old_cost_center, :cost_center_id, :status, :who_ask, :user_id, :collaborator, :new_branch, :old_branch, :branch_id, :new_company, :old_company, :company_id, :tranference_date, :old_city, :new_city)
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.6981269",
"0.6783559",
"0.6746007",
"0.67423046",
"0.6735905",
"0.6593568",
"0.6504213",
"0.649792",
"0.6482664",
"0.6478558",
"0.64566684",
"0.64392304",
"0.6380194",
"0.6376366",
"0.636562",
"0.63208145",
"0.63006365",
"0.63001287",
"0.6292953",
"0.62927175",
"0.62911004... | 0.0 | -1 |
Amazon's description: > Call the CloseOrderReference operation to indicate that a previously > confirmed order reference has been fulfilled (fully or partially) and that > you do not expect to create any new authorizations on this order > reference. You can still capture funds against open authorizations on the > order... | def close_order_reference
client.close_order_reference(@amazon_order_reference_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close_order_reference(\n amazon_order_reference_id,\n closure_reason: nil,\n merchant_id: @merchant_id,\n mws_auth_token: nil\n )\n\n parameters = {\n 'Action' => 'CloseOrderReference',\n 'SellerId' => merchant_id,\n 'AmazonOrderReferenceId' => amazon_order_refe... | [
"0.852008",
"0.6932497",
"0.672758",
"0.62557137",
"0.6145952",
"0.5993691",
"0.5891179",
"0.57508147",
"0.5582657",
"0.55144054",
"0.54654205",
"0.5318896",
"0.5312864",
"0.5292023",
"0.5285824",
"0.5243086",
"0.5227629",
"0.521219",
"0.5211484",
"0.5185712",
"0.51652986",
... | 0.8556126 | 1 |
GET /tags GET /tags.json | def index
@tag = Tag.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags\n get('tags')\n end",
"def get_tags_by_url\n url = Url.find_by(id: params[:id])\n tags = url.tags\n render json: {code: 200, tags: tags}\n end",
"def tags\n @tags_with_count = Asset.tag_counts_on(:tags)\n \n @tags = @tags_with_count.map{|tag_hash| tag_hash = tag_ha... | [
"0.8318351",
"0.80082244",
"0.7899023",
"0.7879115",
"0.76126605",
"0.75905406",
"0.7558966",
"0.74964124",
"0.7353586",
"0.7334286",
"0.72791773",
"0.72511166",
"0.72000086",
"0.71767664",
"0.7171876",
"0.70648646",
"0.7060771",
"0.70546377",
"0.7047039",
"0.7014166",
"0.700... | 0.0 | -1 |
GET /tags/1 GET /tags/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags\n get('tags')\n end",
"def get_tags_by_url\n url = Url.find_by(id: params[:id])\n tags = url.tags\n render json: {code: 200, tags: tags}\n end",
"def tags\n @tags_with_count = Asset.tag_counts_on(:tags)\n \n @tags = @tags_with_count.map{|tag_hash| tag_hash = tag_ha... | [
"0.7841505",
"0.7612557",
"0.7493275",
"0.7401228",
"0.7207367",
"0.71431935",
"0.7123889",
"0.70965606",
"0.7029651",
"0.69644773",
"0.69596124",
"0.6939314",
"0.68929696",
"0.6886842",
"0.68744135",
"0.6864103",
"0.68359417",
"0.6822819",
"0.68169296",
"0.67671245",
"0.6754... | 0.0 | -1 |
POST /tags POST /tags.json | def create
@post =Post.find(params[:post_id])
@tag = @post.tags.build(tag_params)
@tag.sharer =current_user.id.to_s
respond_to do |format|
if @tag.save
format.html { redirect_to post_path(@post), notice: 'Post shared' }
format.json { render :show, status: :created, location: post_p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tag!(params = {})\n self.post params, edge: :tags\n end",
"def create\n @tag = Tag.new(tag_params)\n if @tag.save\n render json: @tag\n else\n render json: @tag.errors, status: :unprocessable_entity\n end\n end",
"def create\r\n @tag = Tag.new(tag_params)\r\n\r\n if... | [
"0.7692835",
"0.7152648",
"0.7079401",
"0.69583875",
"0.68204635",
"0.677452",
"0.6769902",
"0.67647225",
"0.67260826",
"0.66941917",
"0.6688469",
"0.66698825",
"0.6658007",
"0.660596",
"0.659979",
"0.6581441",
"0.6563798",
"0.6547826",
"0.6547316",
"0.65432066",
"0.653725",
... | 0.0 | -1 |
PATCH/PUT /tags/1 PATCH/PUT /tags/1.json | def update
real_post_path = @tag.post
respond_to do |format|
if @tag.update(tag_params)
format.html { redirect_to post_path(real_post_path), notice: 'updated tag' }
format.json { render :show, status: :ok, location: @tag }
else
format.html { render :edit }
format.json... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modify_tag tag\n data = {\n \"tag\" => params\n }\n temp = data[\"servers\"]\n data[\"servers\"] = { \"server\" => temp }\n\n json = JSON.generate data\n\n response = put \"tag/#{tag}\", json\n return response unless response.code == 200\n\n body = JSON.parse response.body\n bod... | [
"0.70848805",
"0.703989",
"0.6955299",
"0.6920452",
"0.6823741",
"0.68110615",
"0.668597",
"0.6678135",
"0.6666578",
"0.665387",
"0.66521186",
"0.6624217",
"0.6574784",
"0.6572931",
"0.6571493",
"0.65688616",
"0.65200925",
"0.65200925",
"0.64832884",
"0.6457828",
"0.64531267"... | 0.62664783 | 39 |
DELETE /tags/1 DELETE /tags/1.json | def destroy
real_post_path = @tag.post
@tag.destroy
respond_to do |format|
format.html { redirect_to post_path(real_post_path), notice: 'tag deleted.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete(tag)\n api_client.tags.multi_delete(resource_hrefs: [api_client.get_instance.href], tags: [tag])\n end",
"def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n \n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :ok }\n end\n\n ... | [
"0.77049047",
"0.7578366",
"0.75631344",
"0.75317156",
"0.75252473",
"0.7507605",
"0.7507605",
"0.7507605",
"0.74904907",
"0.74870014",
"0.7461779",
"0.7456964",
"0.7387652",
"0.73832756",
"0.73818654",
"0.7368147",
"0.73671025",
"0.7343283",
"0.7313129",
"0.72514915",
"0.723... | 0.7075407 | 37 |
Use callbacks to share common setup or constraints between actions. | def set_comment
@tag = Tag.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 tag_params
params.require(:tag).permit(:post_id, :sharer,:user_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6981269",
"0.6783559",
"0.6746007",
"0.67423046",
"0.6735905",
"0.6593568",
"0.6504213",
"0.649792",
"0.6482664",
"0.6478558",
"0.64566684",
"0.64392304",
"0.6380194",
"0.6376366",
"0.636562",
"0.63208145",
"0.63006365",
"0.63001287",
"0.6292953",
"0.62927175",
"0.62911004... | 0.0 | -1 |
TODO: remove this hack (after deprecating filter) | def method_for(klass, meth)
klass.instance_method(meth)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter; end",
"def filter; end",
"def filter; end",
"def apply_filter\n end",
"def strict_filters; end",
"def named_filter; end",
"def filter!; end",
"def strict_filters=(_arg0); end",
"def filter_argument; end",
"def global_filter; end",
"def filter\n end",
"def filter\n super... | [
"0.71827936",
"0.71827936",
"0.71827936",
"0.71545494",
"0.71457696",
"0.69761807",
"0.6944415",
"0.6811394",
"0.6799972",
"0.67099524",
"0.66744155",
"0.66112167",
"0.6544803",
"0.6544803",
"0.65266746",
"0.64577216",
"0.64274263",
"0.64247054",
"0.64247054",
"0.62315226",
"... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_possession
@possession = Possession.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 possession_params
params.require(:possession).permit(:name, :description, :image_url, :got_rid_of_at, :got_rid_of_reason, :month_purchased, :year_purchased, :amazon_link, :category_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 |
" !ruby/object:Delayed::PerformableMethod\nobject: !ruby/object:SyncRequest\n attributes:\n id: 146506\n school_id: 90\n year: 2019\n state: finished\n created_at: 20190404 14:30:44.882430000 Z\n updated_at: 20190404 14:31:55.492554000 Z\n priority: 15\n month: 2\n filter_by_event: \nmethod_name: :start\nargs:\n false\... | def queue_dj
if persisted?
handler_matcher = "%SyncRequest%id: #{id}%school_id: #{school_id}%year: #{year}%priority: #{priority}%month: #{month}%"
if filter_by_event
handler_matcher = "#{handler_matcher}%filter_by_event: #{filter_by_event}%"
end
unless Delayed::Job.where("handler li... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def formationTask _args\n \"formationTask _args;\" \n end",
"def async_call_string(info, name)\n <<~ASYNC_CALL\n if Correspondent.should_notify?(self, #{info[:options].to_s.delete('\"')})\n Async do\n Correspondent << {\n instance: self,\n entity: :#{info[:en... | [
"0.5400661",
"0.5304914",
"0.5051319",
"0.50344026",
"0.5014109",
"0.5002486",
"0.49775806",
"0.49611276",
"0.49422497",
"0.49125203",
"0.49080896",
"0.48973608",
"0.48754033",
"0.4872381",
"0.48694524",
"0.48648024",
"0.48635447",
"0.4857178",
"0.48395693",
"0.4838615",
"0.4... | 0.0 | -1 |
Return if this syncRequest should be run only at night. | def night_only?
priority.nil? || priority < 5
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def should_run?\n Time.zone.now - @info.last_sent - @config.delay_time >= @config.run_every\n end",
"def should_run?\n Time.zone.now - @info.last_sent - @config.delay_time >= @config.run_every\n end",
"def night?\n return $game_switches[::Yuki::Sw::TJN_NightTime]\n end",
"... | [
"0.6628744",
"0.65950143",
"0.6423898",
"0.6412693",
"0.64063036",
"0.6236062",
"0.62107044",
"0.61944306",
"0.6139738",
"0.61220914",
"0.6076207",
"0.60482186",
"0.60270697",
"0.6013437",
"0.5975446",
"0.59725267",
"0.5948893",
"0.5946597",
"0.59440345",
"0.594395",
"0.59356... | 0.6109226 | 10 |
Checks if given month is not in the future | def syncable_month?(month)
(self.year < Time.now.year && month <= 12) || (self.year == Time.now.year && month <= Time.now.month)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def could_be_month?(month); end",
"def month_not_valid?\n if (@month > 0) && (@month < 13)\n return false\n end\n return true\n end",
"def deadline_in(month_number)\n month = Time.at(self.deadline).mon\n if (month == month_number)\n return true\n else\n return false\n end\n... | [
"0.7427435",
"0.72147745",
"0.70538795",
"0.69153035",
"0.6844408",
"0.6762856",
"0.67350554",
"0.6666052",
"0.6657313",
"0.66440463",
"0.6642212",
"0.662566",
"0.662442",
"0.6539902",
"0.65378577",
"0.6537236",
"0.6497427",
"0.6493996",
"0.6470652",
"0.64385957",
"0.6395831"... | 0.6581804 | 13 |
Removes unnecessary white spaces (and possibly other unwanted characters) from the given input string. Note: this method doesn't touch quoted parts, ie. that are surrounded by (") characters | def sanitize_input(input)
clean_input = input.to_s.scan(/("[^"]+?"|\S+)/).flatten.join " "
case clean_input[-1]
when '+'
[ clean_input[0...-1], :verbose ]
when '!'
[ clean_input[0...-1], :full ]
else
[ clean_input, :basic ]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_up_spaces(string)\n string.gsub(\"\\n\", ' ').gsub(/[[:space:]]+/, ' ').strip if string.is_a? String\n end",
"def cleanup(str)\n str.gsub!(/[^0-9a-z ]/i, ' ')\n str.gsub!(/\\s+/, ' ')\nend",
"def cleanup(str)\n output = [] \n no_go = false\n str = str.gsub(/[^A-Za-z0-9 ]/, ' ').split(\"\")\... | [
"0.76486486",
"0.76195896",
"0.75952536",
"0.75852275",
"0.7532516",
"0.75244236",
"0.7485195",
"0.74743015",
"0.7458281",
"0.74030656",
"0.7379355",
"0.73570687",
"0.7350495",
"0.73471683",
"0.7347054",
"0.7345492",
"0.7338354",
"0.73367894",
"0.73334086",
"0.73313546",
"0.7... | 0.0 | -1 |
Takes a line of user input from the standard input, attempts to look up the appropriate reponse to the request and execute it. | def process(raw_input)
clean_input, verbosity = sanitize_input raw_input
if clean_input.length > 0
command = find_command(clean_input) || @modes.current_mode.dynamic_command(clean_input) || @modes.global_mode.command_not_found
user_args = extract_user_args command, clean_input
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_response\nresponse = gets.chomp\nend",
"def get_response_for question\nprint question + \": \"\ngets.chomp\nend",
"def user_choice (text)\n\tputs text\n\tresponse = gets.strip.to_i\n\treturn response\nend",
"def read_input_line line_in, line_number\n\t\tinput_params = line_in.split(\" \")\n\t\tunless... | [
"0.68545604",
"0.64937824",
"0.6332479",
"0.6320005",
"0.6290294",
"0.6282479",
"0.6243144",
"0.6238021",
"0.62154055",
"0.6200955",
"0.6196262",
"0.61887276",
"0.6155114",
"0.61496633",
"0.61469156",
"0.6107784",
"0.6073282",
"0.6064982",
"0.6059404",
"0.60195124",
"0.600999... | 0.0 | -1 |
Attempts to find an request handler for the current input. It might return nil when there's no corresponding handler to the input or it might return a command object containing the vital information to react | def find_command(input)
available_accessors = @modes.current_accessors.find_all { |accessor| accessor.signature.matches? input }
(@modes.active_modes.map { |mode| mode.find_command(input) } + available_accessors).find { |command| !command.nil? }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handler_for_request(req)\n req.path =~ /^#{@url_prefix}\\/([^\\/]+)/\n\n return @entry_points[$1] || Borges::NotFoundHandler.new\n end",
"def find_handler_class location\n @@archive_handlers.each do |h|\n return h if h.handles?(location)\n end\n return nil\n end",
"def get_handler(han... | [
"0.64996433",
"0.5728745",
"0.56815076",
"0.5665548",
"0.5661631",
"0.5551018",
"0.5460559",
"0.5437383",
"0.53799736",
"0.53489923",
"0.52698576",
"0.5200376",
"0.51163685",
"0.5096537",
"0.5095613",
"0.5041661",
"0.5033897",
"0.5033725",
"0.5030545",
"0.5022674",
"0.5017412... | 0.5528817 | 6 |
Perform a key lookup in the registered data tables | def table_lookup(key, arg, table = nil)
lookup_key = key[1..-1].to_sym
lookup_table = table || @tables[lookup_key]
if lookup_table.kind_of? Hash
lookup_table[arg.to_sym]
elsif lookup_table.kind_of? Array
if lookup_table.member? arg or lookup_table.member? arg.t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lookup(key=nil)\n silo = self.lookup_silo_name\n dict = nil\n ActiveRecord::Base.benchmark(\"Lookup: #{silo}#{key.ergo{'#'+to_s}}\") do\n dict = self.fetch_object(silo){\n # FIXME Exceptions within this block are silently swallowed by something. This is bad.\n self.find(... | [
"0.6345362",
"0.6335568",
"0.63058096",
"0.63058096",
"0.61418647",
"0.60832137",
"0.6055057",
"0.6040019",
"0.6014103",
"0.5965513",
"0.5963341",
"0.59249365",
"0.5887201",
"0.58803284",
"0.5870959",
"0.5852537",
"0.58426255",
"0.5835181",
"0.5835181",
"0.5825391",
"0.582218... | 0.6834899 | 0 |
Selects arguments from the current context that the given command requires. | def resolve_args(command, ctx)
resolvers = ctx.preferred
if command.kind_of? Method or command.kind_of? Proc
method = command
elsif command.kind_of? Command
method = command.method
end
method.parameters.map do |param|
param_name = param[1]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arguments command\n @@auto_completion_arguments[command]\n end",
"def cmd(options={})\n arguments\n end",
"def given_options\n @given_options ||= command_options.select do |option|\n @arguments[option.name] || option.include?\n end\n end",
"def required... | [
"0.65169126",
"0.63292986",
"0.6303143",
"0.62485856",
"0.6113403",
"0.60544723",
"0.60119784",
"0.58311963",
"0.5781951",
"0.56925374",
"0.5608342",
"0.55557734",
"0.5521321",
"0.551139",
"0.54751825",
"0.5449937",
"0.54057056",
"0.53865945",
"0.53759843",
"0.53749543",
"0.5... | 0.6275316 | 3 |
a list method that shows without the layout when called via AJAX, making the results controller able to fit inside of a modal dialog | def list
do_list
respond_to do |type|
type.html {
render :action => 'list', :layout => true
}
type.js {
do_list
render :action => 'list', :layout => false
}
type.xml { render :xml => response_object.to_xml, :content_type => Mime::XML, :status => response_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_view\n\t\t# render the partial page with js to show the list view\n\t\trespond_to do |format|\n\t\t\tformat.js\n\t\tend\n\tend",
"def list\n index\n render :partial => 'list'\n end",
"def index\n @wines = Wine.all\n @items = @wines\n @items_name=\"Weine\"\n @item_name=\"Wein\"\n ... | [
"0.72842354",
"0.68845576",
"0.66659516",
"0.662809",
"0.662809",
"0.6593384",
"0.65789694",
"0.6569538",
"0.6547179",
"0.65324074",
"0.6526265",
"0.65029395",
"0.64733404",
"0.64638966",
"0.645277",
"0.64490545",
"0.6448772",
"0.6423154",
"0.64198303",
"0.64198303",
"0.64198... | 0.67905265 | 2 |
GET /pictures GET /pictures.xml | def index
@picture = Picture.front_page
@categories = Category.find(:all)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @pictures = Picture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pictures }\n end\n end",
"def index\n @pictures = @album.pictures #JRD111115\n\n respond_to do |format|\n format.html #index.html.erb\n format.json {... | [
"0.7298022",
"0.67736226",
"0.6757711",
"0.6757711",
"0.6757711",
"0.6675551",
"0.6648741",
"0.66406375",
"0.6629451",
"0.66261446",
"0.6606394",
"0.655076",
"0.65427196",
"0.65334713",
"0.64908594",
"0.6460135",
"0.6432068",
"0.64126754",
"0.6393394",
"0.6393394",
"0.6393394... | 0.0 | -1 |
GET /pictures/1 GET /pictures/1.xml | def show
@picture = Picture.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @picture }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @pictures = Picture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pictures }\n end\n end",
"def index\n @activity = Activity.find(params[:activity_id])\n @pictures = @activity.pictures\n\n respond_to do |format|\n forma... | [
"0.72456527",
"0.66568106",
"0.66449493",
"0.66398853",
"0.6617927",
"0.66147345",
"0.6570786",
"0.65474355",
"0.64901257",
"0.6458331",
"0.6423975",
"0.63807434",
"0.63731855",
"0.63731855",
"0.6337803",
"0.6329089",
"0.6324292",
"0.63235724",
"0.63212854",
"0.63165534",
"0.... | 0.69313806 | 3 |
GET /pictures/new GET /pictures/new.xml | def new
@picture = Picture.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @picture = Picture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @picture }\n end\n end",
"def new\n @picture = Picture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @picture }\... | [
"0.7557399",
"0.7557399",
"0.7501984",
"0.74720556",
"0.703855",
"0.70337975",
"0.70245165",
"0.70245165",
"0.70245165",
"0.70245165",
"0.6974265",
"0.6948854",
"0.6948854",
"0.6948854",
"0.69125247",
"0.6902151",
"0.6894744",
"0.68625206",
"0.6856017",
"0.68492",
"0.6846423"... | 0.0 | -1 |
POST /pictures POST /pictures.xml | def create
@picture = Picture.new(params[:picture])
if @picture.save
redirect_to :controller => 'pictures', :action => 'admin_show', :id => @picture.id
else
render :action => 'new'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @picture = @imageable.pictures.new(picture_params)\n respond_to do |format|\n if @picture.save\n format.html do\n redirect_to @imageable, notice: I18n.t('pictures.save_success')\n end\n format.json { render :show, status: :created, location: @imageable }\n ... | [
"0.63953686",
"0.6341831",
"0.62757117",
"0.6197448",
"0.616109",
"0.6080188",
"0.6057797",
"0.6047714",
"0.6013316",
"0.6001971",
"0.6001971",
"0.5969761",
"0.5959212",
"0.59524304",
"0.59482914",
"0.59404683",
"0.5937841",
"0.59288",
"0.5895104",
"0.5894057",
"0.58929485",
... | 0.5637499 | 44 |
PUT /pictures/1 PUT /pictures/1.xml | def update
@picture = Picture.find(params[:id])
if @picture.update_attributes(params[:picture])
respond_to do |format|
format.js
end
else
render :action => 'edit'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n if @picture.update_attributes(params[:picture])\n flash[:notice] = 'Picture was successfully updated.'\n format.html { redirect_to(@picture) }\n format.xml { head :ok }\n else\n format.html {... | [
"0.6578667",
"0.6578667",
"0.65231586",
"0.64214694",
"0.6367069",
"0.6329701",
"0.6311454",
"0.62598515",
"0.62571496",
"0.62571496",
"0.62571496",
"0.6225321",
"0.62130415",
"0.61872053",
"0.6157581",
"0.61562055",
"0.61454976",
"0.6132001",
"0.6130134",
"0.61159265",
"0.60... | 0.5718079 | 68 |
DELETE /pictures/1 DELETE /pictures/1.xml | def destroy
@picture = Picture.find(params[:id])
@category = Category.find(@picture.category_id)
@picture.destroy
render :partial => 'admin_thumbnails', :locals => { :pictures => @category.pictures }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @picture = Picture.find(params[:id])\n @picture.destroy\n\n respond_to do |format|\n format.html { redirect_to(pictures_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @picture = Picture.find(params[:id])\n @picture.destroy\n\n respond_to do |format|\n... | [
"0.7274041",
"0.7274041",
"0.7044276",
"0.7032115",
"0.6981714",
"0.69103616",
"0.6899788",
"0.68839717",
"0.68839717",
"0.68839717",
"0.68839717",
"0.68672377",
"0.6850739",
"0.6806095",
"0.68038523",
"0.67962605",
"0.67962605",
"0.67962605",
"0.6765404",
"0.6733865",
"0.671... | 0.0 | -1 |
this could use an external gem to print tables instead. | def to_s
str = ""
str << "Item\t\t\t\tPrice\n"
str << "----\t\t\t\t-----\n"
@transactions.each do |t|
price = Market::Transaction::transaction_list[t][:price]
type = Market::Transaction::transaction_list[t][:type]
if type == :discount
str << "\t\t#{t}\t\t#{price... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_table\n\t$table.each do |row|\n\t\trow.each_with_index do |c, index|\n\t\t\tif index != 0\n\t\t\t\tprint ' '\n\t\t\tend\n\t\t\tprint c\n\t\tend\n\t\tprint \"\\n\"\n\tend\nend",
"def print_table(columns, data, print_headings = true)\n\n # Fill base lengths\n columns.each do |col|\n col[:length] = (... | [
"0.7460946",
"0.7285435",
"0.7274166",
"0.7121363",
"0.7085354",
"0.7038711",
"0.7019964",
"0.69767416",
"0.6969451",
"0.69615823",
"0.6943312",
"0.69373286",
"0.6797011",
"0.67710334",
"0.67626923",
"0.6753911",
"0.6717705",
"0.6715384",
"0.6702952",
"0.6673915",
"0.6658685"... | 0.0 | -1 |
if you need to generate any additional configuration into the test app, this generator will be run immediately after setting up the application | def add_gems
Bundler.with_clean_env do
run 'bundle install'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup\n yield(application_config)\n end",
"def app_generators; end",
"def generate_configuration\n template \"mebla.yml\", \"config/mebla.yml\"\n end",
"def setup_config\n # To be Extended\n end",
"def setup\n yield(configuration)\n end",
"def generate_config\n ... | [
"0.70486945",
"0.6915853",
"0.6847269",
"0.6763468",
"0.6717504",
"0.6634623",
"0.6614558",
"0.66043335",
"0.6600317",
"0.65982455",
"0.655115",
"0.6539878",
"0.6506271",
"0.64812505",
"0.6401951",
"0.63859975",
"0.6341402",
"0.63233",
"0.62982583",
"0.6266854",
"0.62612325",... | 0.0 | -1 |
Sum all the numbers in the array an_array can contain lots of different things Be sure to only sum the numbers (Hint: the is_a? method might be useful here) | def sum_only_numbers(an_array)
count = 0
an_array.map {|index|
if index.is_a? Fixnum or index.is_a? Float
count += index
end
}
return count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sum_only_numbers(an_array)\n\tsummation = 0\n\tfor item in an_array\n\t\tif item.is_a? Integer\n\t\t\tsummation += item\n\t\tend\n\t\tif item.is_a? Float\n\t\t\tsummation += item\n\t\tend\n\tend\n\treturn summation\nend",
"def sum_array(some_array) \n sum = 0\n\tsome_array.each do |x|\n\t if x.is_a?Integ... | [
"0.8239717",
"0.81843144",
"0.81174886",
"0.8098827",
"0.8007008",
"0.7968392",
"0.7931425",
"0.7912672",
"0.7877151",
"0.78424865",
"0.78197473",
"0.7813646",
"0.77861655",
"0.77762496",
"0.7760958",
"0.7742118",
"0.7737278",
"0.7732798",
"0.77297866",
"0.77163714",
"0.76843... | 0.7400951 | 95 |
For i from 1 to 100, return an array. The elements in the array should follow this algorithm: If i is a multiple of 3, the element is 'Fizz' If i is a multiple of 5, the element is 'Buzz' If i is a multiple of 3 and 5, the element is 'FizzBuzz' Otherwise, the element is simply the value of i For example [1, 2, 'Fizz', ... | def fizzbuzz
fb_array = (1..100).to_a
for i in fb_array
if i % 3 == 0
if i % 5 == 0
fb_array[i-1] = 'FizzBuzz'
else
fb_array[i-1] = 'Fizz'
end
elsif i % 5 == 0
fb_array[i-1] = 'Buzz'
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fizzbuzz(n)\n array = (1..n).to_a\n answer = []\n for i in array do\n if (i % 15 == 0)\n answer.push('FizzBuzz')\n elsif (i % 3 == 0)\n answer.push('Fizz')\n elsif (i % 5 == 0)\n answer.push('Buzz')\n else \n answer.push(i)\n end\n end\n answer\nend",
"def super_fizzbu... | [
"0.7868065",
"0.7862555",
"0.7862555",
"0.78396994",
"0.7801727",
"0.7787027",
"0.776631",
"0.774076",
"0.7735931",
"0.7697735",
"0.76833045",
"0.7642155",
"0.76382864",
"0.76210433",
"0.76062554",
"0.7556864",
"0.7536449",
"0.752645",
"0.752112",
"0.75163805",
"0.75123334",
... | 0.7271865 | 38 |
class Config def instance() return Config() end def temp(input) return input end end | def unpack
trace :debug, "Build: apktool extract: #{@tmpdir}/apk"
apktool = path('apktool.jar')
Dir[path('core.*.apk')].each do |d|
version = d.scan(/core.android.(.*).apk/).flatten.first
if version == "melt" then
trace :debug, "-jar #{apktool} d -f #{d} -o #{@tmpdir}/apk.#{version}"
#Cros... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def config=(_arg0); end",
"def config=(_arg0); end",
"def config=(_arg0); end",
"def config=(_arg0); end",
"def config=(_arg0); end",
"def config\n @config ||= Config.new\n end",
"def config\n @config ||= Config.new\n end",
"def config=(*args); end",
"def config=(*args); end",
"de... | [
"0.68039757",
"0.68039757",
"0.68039757",
"0.68039757",
"0.68039757",
"0.65898967",
"0.65898967",
"0.65892696",
"0.65892696",
"0.65429777",
"0.65009636",
"0.64399743",
"0.6405729",
"0.6405729",
"0.6405729",
"0.6405729",
"0.6405729",
"0.6405729",
"0.6405729",
"0.6405729",
"0.6... | 0.0 | -1 |
Deletes all PII for a learnerId Deletes all of the PII information for the learner. This is meant for use with complying with GDPR requests from learners. >Note: >This method is asynchronous. A returned success status indicates a background process has been started, but there will still be a delay before the deletion o... | def delete_all_learner_data(learner_id, user_email, opts = {})
delete_all_learner_data_with_http_info(learner_id, user_email, opts)
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (did not find instance)\n # authorize @learner\n @portal_learner = Portal::Learner.find(params[:id])\n @portal_learner.destroy\n\n respond_to do |format|\n format.html { redirect_to(portal_learners_url) }\n format.xml {... | [
"0.52733684",
"0.50487316",
"0.5040014",
"0.5037111",
"0.50295293",
"0.49698663",
"0.49476784",
"0.48997188",
"0.48609704",
"0.4860871",
"0.48552206",
"0.4852461",
"0.48323303",
"0.4829794",
"0.48164165",
"0.48142135",
"0.4806832",
"0.48032412",
"0.4802226",
"0.47972822",
"0.... | 0.47090405 | 43 |
Deletes all PII for a learnerId Deletes all of the PII information for the learner. This is meant for use with complying with GDPR requests from learners. >Note: >This method is asynchronous. A returned success status indicates a background process has been started, but there will still be a delay before the deletion o... | def delete_all_learner_data_with_http_info(learner_id, user_email, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LearnerApi.delete_all_learner_data ...'
end
# verify the required parameter 'learner_id' is set
if learner_id.nil?
fail Argu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (did not find instance)\n # authorize @learner\n @portal_learner = Portal::Learner.find(params[:id])\n @portal_learner.destroy\n\n respond_to do |format|\n format.html { redirect_to(portal_learners_url) }\n format.xml {... | [
"0.52742976",
"0.50499386",
"0.50414944",
"0.503077",
"0.49706295",
"0.49473283",
"0.49009445",
"0.48614588",
"0.4860768",
"0.48568016",
"0.48519447",
"0.48314306",
"0.48293415",
"0.481594",
"0.48136327",
"0.4807776",
"0.48024127",
"0.48013875",
"0.47965392",
"0.47940847",
"0... | 0.5036929 | 3 |
Delete tags from a learnerId Delete the specified tags from the learner. Deleting tags that do not exist will still result in a success. | def delete_learner_tags(learner_id, tags, opts = {})
delete_learner_tags_with_http_info(learner_id, tags, opts)
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_learner_tags_with_http_info(learner_id, tags, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LearnerApi.delete_learner_tags ...'\n end\n # verify the required parameter 'learner_id' is set\n if learner_id.nil?\n fail Argumen... | [
"0.73326707",
"0.65890735",
"0.6294065",
"0.62899333",
"0.61576474",
"0.59523106",
"0.5875303",
"0.58677757",
"0.5840874",
"0.5827503",
"0.580925",
"0.5808189",
"0.58037084",
"0.57895905",
"0.57785535",
"0.57701147",
"0.57071227",
"0.5678882",
"0.5619069",
"0.5599222",
"0.559... | 0.66478974 | 1 |
Delete tags from a learnerId Delete the specified tags from the learner. Deleting tags that do not exist will still result in a success. | def delete_learner_tags_with_http_info(learner_id, tags, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LearnerApi.delete_learner_tags ...'
end
# verify the required parameter 'learner_id' is set
if learner_id.nil?
fail ArgumentError, "Mi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_learner_tags(learner_id, tags, opts = {})\n delete_learner_tags_with_http_info(learner_id, tags, opts)\n nil\n end",
"def remove_tags(tag_id)\n self.tags.destroy(tag_id)\n end",
"def delete_tag(tag_id)\n @api.delete(\"#{@api.path}/List/#{@id}/Tag/#{tag_id}\")\n end",
"... | [
"0.6648784",
"0.6590318",
"0.62957233",
"0.6292301",
"0.6159142",
"0.5955739",
"0.58766955",
"0.5868921",
"0.5843445",
"0.5829038",
"0.58123165",
"0.5811391",
"0.5804703",
"0.5791164",
"0.57814145",
"0.5771185",
"0.5709879",
"0.56814194",
"0.56203556",
"0.56014305",
"0.559470... | 0.7333469 | 0 |
Get tags for a learnerId Returns the tags for the learner. | def get_learner_tags(learner_id, opts = {})
data, _status_code, _headers = get_learner_tags_with_http_info(learner_id, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_learner_tags_with_http_info(learner_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LearnerApi.get_learner_tags ...'\n end\n # verify the required parameter 'learner_id' is set\n if learner_id.nil?\n fail ArgumentError, \"Mi... | [
"0.69842875",
"0.6062941",
"0.57755655",
"0.5678672",
"0.56636274",
"0.5564169",
"0.5475757",
"0.5461756",
"0.5364569",
"0.53527546",
"0.5330336",
"0.5308702",
"0.52873755",
"0.5258057",
"0.51945895",
"0.51871836",
"0.5174344",
"0.5173385",
"0.5168488",
"0.51611286",
"0.51400... | 0.77817595 | 0 |
Get tags for a learnerId Returns the tags for the learner. | def get_learner_tags_with_http_info(learner_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LearnerApi.get_learner_tags ...'
end
# verify the required parameter 'learner_id' is set
if learner_id.nil?
fail ArgumentError, "Missing the re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_learner_tags(learner_id, opts = {})\n data, _status_code, _headers = get_learner_tags_with_http_info(learner_id, opts)\n data\n end",
"def tags(id)\n wf_event_id?(id)\n api.get([id, 'tag'].uri_concat)\n end",
"def get_tags() tag_ids.inject([]) { |l, tag_id| l << get_tag_from_i... | [
"0.7780954",
"0.6063932",
"0.57759875",
"0.5679213",
"0.56640935",
"0.55624074",
"0.54744405",
"0.54619765",
"0.5362401",
"0.53517246",
"0.53289205",
"0.53091896",
"0.5286628",
"0.5259362",
"0.51934767",
"0.51869255",
"0.5173127",
"0.51716137",
"0.5168834",
"0.5159145",
"0.51... | 0.6983886 | 1 |
Add tags to a learnerId Applies the provided tags to the learner. Tags are used to easily identify resources. Adding tags can enable more refined searches when working with Reportage. | def put_learner_tags(learner_id, tags, opts = {})
put_learner_tags_with_http_info(learner_id, tags, opts)
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def put_learner_tags_with_http_info(learner_id, tags, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LearnerApi.put_learner_tags ...'\n end\n # verify the required parameter 'learner_id' is set\n if learner_id.nil?\n fail ArgumentError... | [
"0.6757535",
"0.618978",
"0.6161273",
"0.6142172",
"0.607561",
"0.6052855",
"0.6038517",
"0.59928507",
"0.5914838",
"0.5912478",
"0.5892988",
"0.5818468",
"0.57646865",
"0.5761485",
"0.57603556",
"0.5740323",
"0.57321334",
"0.5717708",
"0.5686359",
"0.56687623",
"0.5668293",
... | 0.61399347 | 4 |
Add tags to a learnerId Applies the provided tags to the learner. Tags are used to easily identify resources. Adding tags can enable more refined searches when working with Reportage. | def put_learner_tags_with_http_info(learner_id, tags, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LearnerApi.put_learner_tags ...'
end
# verify the required parameter 'learner_id' is set
if learner_id.nil?
fail ArgumentError, "Missing ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tag_set(id, tags)\n wf_event_id?(id)\n tags = Array(tags)\n tags.each { |t| wf_string?(t) }\n api.post([id, 'tag'].uri_concat, tags, 'application/json')\n end",
"def add_tags(identifier, body, opts = {})\n data, _status_code, _headers = add_tags_with_http_info(identifier, body, op... | [
"0.6189396",
"0.616149",
"0.61430943",
"0.61398804",
"0.6074406",
"0.6052473",
"0.60377675",
"0.59927666",
"0.5913662",
"0.5911392",
"0.5891772",
"0.5817213",
"0.57640666",
"0.5760433",
"0.5760182",
"0.5739501",
"0.57312053",
"0.5716421",
"0.568512",
"0.5667906",
"0.56672174"... | 0.6756875 | 0 |
Add a group of tags to a group of learnerIds Applies all of the provided tags on all of the provided learners. Tags are used to easily identify resources. Adding tags can enable more refined searches when working with Reportage. | def put_learner_tags_batch(batch, opts = {})
put_learner_tags_batch_with_http_info(batch, opts)
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def put_learner_tags(learner_id, tags, opts = {})\n put_learner_tags_with_http_info(learner_id, tags, opts)\n nil\n end",
"def add_tags(alert_ids, tags)\n query = generate_query_params(alertIds: alert_ids, tags: tags)\n http_put('/tags' + query, {})\n end",
"def put_learner_tags_with_... | [
"0.6199298",
"0.5918485",
"0.59110266",
"0.57290536",
"0.57097536",
"0.5685266",
"0.5682318",
"0.5680777",
"0.5680777",
"0.56216294",
"0.5618238",
"0.5578459",
"0.554899",
"0.5532816",
"0.54668015",
"0.5427153",
"0.5386382",
"0.53627175",
"0.5344353",
"0.5318399",
"0.530403",... | 0.57623094 | 3 |
Add a group of tags to a group of learnerIds Applies all of the provided tags on all of the provided learners. Tags are used to easily identify resources. Adding tags can enable more refined searches when working with Reportage. | def put_learner_tags_batch_with_http_info(batch, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LearnerApi.put_learner_tags_batch ...'
end
# verify the required parameter 'batch' is set
if batch.nil?
fail ArgumentError, "Missing the requi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def put_learner_tags(learner_id, tags, opts = {})\n put_learner_tags_with_http_info(learner_id, tags, opts)\n nil\n end",
"def add_tags(alert_ids, tags)\n query = generate_query_params(alertIds: alert_ids, tags: tags)\n http_put('/tags' + query, {})\n end",
"def put_learner_tags_with_... | [
"0.62002945",
"0.5920451",
"0.5911994",
"0.5764149",
"0.57295364",
"0.5711069",
"0.56879175",
"0.56851095",
"0.56829345",
"0.56829345",
"0.5623832",
"0.5620375",
"0.55806905",
"0.5551114",
"0.5534979",
"0.5468737",
"0.5430112",
"0.53872675",
"0.5364799",
"0.53469825",
"0.5319... | 0.48010466 | 80 |
Update all Registrations for a learnerId Updates information about a group of registrations, such as learner email and name. A learner in SCORM Cloud is not an entity on its own. In fact, learners only exist as information on individual registrations. This method will update the information on each of the registrations... | def update_learner_info(learner_id, learner_info, opts = {})
update_learner_info_with_http_info(learner_id, learner_info, opts)
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @learner.update(learner_params)\n format.html { redirect_to @learner, notice: 'Learner was successfully updated.' }\n format.json { head :ok, location: @learner }\n else\n format.html { render :edit }\n format.json { render json: @le... | [
"0.5547499",
"0.54714644",
"0.53898793",
"0.51804966",
"0.48552445",
"0.48346615",
"0.48278606",
"0.48179838",
"0.48060307",
"0.4761075",
"0.47500354",
"0.4742438",
"0.47256553",
"0.46923462",
"0.4686171",
"0.46665373",
"0.4624624",
"0.4616788",
"0.46141946",
"0.46110767",
"0... | 0.5036261 | 4 |
Update all Registrations for a learnerId Updates information about a group of registrations, such as learner email and name. A learner in SCORM Cloud is not an entity on its own. In fact, learners only exist as information on individual registrations. This method will update the information on each of the registrations... | def update_learner_info_with_http_info(learner_id, learner_info, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LearnerApi.update_learner_info ...'
end
# verify the required parameter 'learner_id' is set
if learner_id.nil?
fail ArgumentEr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (did not find instance)\n # authorize @learner\n @portal_learner = Portal::Learner.find(params[:id])\n\n respond_to do |format|\n if @portal_learner.update_attributes(params[:learner])\n flash[:notice] = 'Portal::Learner w... | [
"0.5428825",
"0.54149413",
"0.5349455",
"0.49685228",
"0.49042168",
"0.48201072",
"0.481684",
"0.47852093",
"0.47717494",
"0.47348392",
"0.47044706",
"0.47024134",
"0.46961555",
"0.46623987",
"0.46541846",
"0.46357942",
"0.4634372",
"0.46231538",
"0.46133128",
"0.4601315",
"0... | 0.51149803 | 3 |
=begin maybe need to override initialize to init arrays to [] =end | def museum_clue
index = rand(1..@museum_clues.length)
@museum_clues[index]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize; @ary = []; end",
"def initialize arr = []\n super arr\n end",
"def initialize\n @array = []\n end",
"def Array(p0) end",
"def initialize\n @data = []\n end",
"def initialize array\n @array = array\n end",
"def initialize()\n\t@list_arr\t= []\nend",
"def... | [
"0.7948283",
"0.7709086",
"0.7621622",
"0.7469081",
"0.7157864",
"0.71264017",
"0.7107325",
"0.7026718",
"0.69862825",
"0.6937577",
"0.6912566",
"0.69014525",
"0.68958867",
"0.68878204",
"0.6837355",
"0.682054",
"0.68159187",
"0.67938036",
"0.6767753",
"0.67651093",
"0.676433... | 0.0 | -1 |
It's important to regularly remove devices that Apple reports as stale. If you continue to try to notify stale devices, Apple may revoke your access to APNS! | def deactivate_stale_devices!
device_tokens = client.devices
Rails.logger.info "Found #{device_tokens.length} stale devices."
device_tokens.each do |device_token|
Rails.logger.debug("deactivating device with token: #{device_token}")
devices = Device.where(notification_token: device_token)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_missing\n sync do\n devices.delete_if do |dev|\n pdev = ct.group.devices.get(dev)\n pdev.nil? || !pdev.mode.compatible?(dev.mode)\n end\n end\n end",
"def unregister\n puts \"APN::Device.unregister\"\n http_delete(\"/api/device_tokens/#{self.token}\")... | [
"0.6417499",
"0.63291705",
"0.62556666",
"0.6030259",
"0.59357595",
"0.57524586",
"0.5739295",
"0.5736351",
"0.5708673",
"0.5685973",
"0.5676474",
"0.5599496",
"0.557151",
"0.5534465",
"0.55253124",
"0.55242914",
"0.549664",
"0.5493139",
"0.54486626",
"0.54191595",
"0.5409406... | 0.6870319 | 0 |
Attempting to implement Merge Sort with ruby. | def mergeSort array
if array.count <= 1
return array
end
middle = array.count / 2
left = mergeSort array.slice(0, middle)
right = mergeSort array.slice(middle, array.count)
left_offset = 0
right_offset = 0
while left_offset < left.count && right_offset < right.count
a ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mergeSort(arr)\n puts \"Running merge sort on array: \" + arr.to_s\n temp = copyArr(arr)\n #this block determines what the subproblems that should be merged are\n splitMerge(temp, 1, arr) do |a, t, n|\n if n == 1\n return a\n end\n jump = a.length/n\n i = 0\n ... | [
"0.79009014",
"0.7802069",
"0.7775747",
"0.7716475",
"0.76997316",
"0.7698353",
"0.76974845",
"0.7646673",
"0.7617558",
"0.7602619",
"0.7601588",
"0.7598899",
"0.7598026",
"0.75946957",
"0.7593529",
"0.75893843",
"0.75800467",
"0.75783026",
"0.75757194",
"0.7570672",
"0.75588... | 0.76918703 | 7 |
Methods this method adds a random number from range 110 and adds to array | def generate_random_number
(1..10).to_a.sample
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_rand_num (random_num_array, num_of_itens)\n num_of_itens.times do |i|\n random_num = rand(0..num_of_itens - 1 )\n while random_num_array.include?(random_num)\n random_num = rand(0..num_of_itens - 1 )\n end\n random_num_array << random_num\n end\nend",
"def rand_array_ten\n rand_a... | [
"0.6765033",
"0.66763103",
"0.66602105",
"0.6633842",
"0.65814626",
"0.658102",
"0.6464961",
"0.6440413",
"0.6437469",
"0.63913614",
"0.63776904",
"0.63672453",
"0.63205457",
"0.6268004",
"0.61995375",
"0.6194772",
"0.61896163",
"0.6183112",
"0.6170408",
"0.61596745",
"0.6152... | 0.62207943 | 14 |
prints a message in green | def alert(message)
$stdout.puts(message.green)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def success_message\n puts \"Correct!\".green\nend",
"def print_status(msg, color)\n cprint RESET + BOLD\n cprint WHITE + \"[ \"\n cprint \"#{ msg } \", color\n cprint WHITE + \"] \" + RESET\n end",
"def print_status(msg, color)\n cprint RESET + BOLD\n cprint WHITE + \"[ \"\n ... | [
"0.8371245",
"0.8016412",
"0.8016412",
"0.7682418",
"0.7664079",
"0.7588235",
"0.75751114",
"0.7556814",
"0.74773705",
"0.7444585",
"0.743639",
"0.7366315",
"0.7342311",
"0.7330859",
"0.7325612",
"0.7285741",
"0.7209248",
"0.72081536",
"0.7195747",
"0.7194214",
"0.71907073",
... | 0.7756873 | 3 |
prints a message in red | def warn(message)
$stdout.puts(message.red)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_error(msg)\n puts \" #{color(\"!\", 33)} #{color(msg, 31)}\"\n end",
"def error_message( msg, details='' )\n\t\t\t$stderr.puts colorize( 'bold', 'white', 'on_red' ) { msg } + details\n\t\tend",
"def error(message)\n message = message.red unless message.color?\n puts(stderr, mess... | [
"0.76679814",
"0.7651551",
"0.7649019",
"0.76447475",
"0.7639324",
"0.76344734",
"0.7583419",
"0.75401264",
"0.75108296",
"0.74533314",
"0.743791",
"0.742224",
"0.742224",
"0.7384514",
"0.73515606",
"0.7287702",
"0.7208489",
"0.71743375",
"0.71715856",
"0.7161591",
"0.7152318... | 0.74038494 | 13 |
method that asks the question, gives indictator for answer, chomps the entry | def ask(question)
$stdout.puts(question)
$stdout.print('> ')
$stdin.gets.chomp
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ask\n gets.strip\n end",
"def ask\n\t\tbegin\n\t\t\tputs self\n\t\t\tprint \"Su respuesta: \" \n\t\t\tanswerno = gets.to_i - 1\n\t\tend while (answerno < 0 or answerno >= @answers.length)\n\t\t#Comprobamos si es correcta la respuesta\n\t\t@answers[answerno].is_right? \n\tend",
"def asks_questio... | [
"0.7543116",
"0.7409052",
"0.7298502",
"0.7290074",
"0.7283991",
"0.7279046",
"0.72608405",
"0.72604585",
"0.7229019",
"0.7191527",
"0.7176993",
"0.71711886",
"0.7126593",
"0.7101859",
"0.70916665",
"0.70862865",
"0.70859855",
"0.7079814",
"0.7076341",
"0.70726043",
"0.704633... | 0.68000036 | 49 |
GET /categorias GET /categorias.json | def index
@categorias = Categoria.where(ativo: true)
render json: @categorias
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n render json: @categoria\n end",
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def index\n if params[:categoria_producto]\n render json: Producto.find(params[:producto_id]).catego... | [
"0.78605634",
"0.7668335",
"0.75674355",
"0.74389696",
"0.74274486",
"0.7353787",
"0.7346481",
"0.7324065",
"0.72895575",
"0.7171488",
"0.69858474",
"0.69081706",
"0.6860746",
"0.6838017",
"0.68209946",
"0.68208915",
"0.68208915",
"0.67935497",
"0.6791525",
"0.678794",
"0.676... | 0.75216573 | 3 |
GET /categorias/1 GET /categorias/1.json | def show
render json: @categoria
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categoria }\n end\n end",
"def show\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n ... | [
"0.77424973",
"0.7667131",
"0.75771433",
"0.7529609",
"0.7493106",
"0.74652046",
"0.72957826",
"0.72778887",
"0.72754854",
"0.70459354",
"0.6998477",
"0.69755214",
"0.6969114",
"0.6952852",
"0.69030017",
"0.68909496",
"0.6877623",
"0.68637633",
"0.6814066",
"0.6797523",
"0.67... | 0.7887554 | 0 |
POST /categorias POST /categorias.json | def create
@categoria = Categoria.new(categoria_params)
if @categoria.save
render json: @categoria
else
render json: @categoria.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n if params[:categoria_producto]\n p = Producto.find(params[:producto_id])\n c = Categoria.find(params[:categoria_id])\n\n if p.categorias << c\n render json: c, status: :created\n else\n render json: {:errors => {categoria: [\"No se ha podido agregar categoria\"]}},... | [
"0.74540937",
"0.73545885",
"0.71821916",
"0.7063484",
"0.70269084",
"0.6978074",
"0.6972654",
"0.6964912",
"0.6888522",
"0.6874212",
"0.6766149",
"0.6739463",
"0.6730424",
"0.6675526",
"0.66747445",
"0.6671698",
"0.66611403",
"0.6654375",
"0.66212916",
"0.6536164",
"0.653145... | 0.7745614 | 0 |
PATCH/PUT /categorias/1 PATCH/PUT /categorias/1.json | def update
if @categoria.update(categoria_params)
render json: @categoria
else
render json: @categoria.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n if @categoria.update_attributes(params[:categoria])\n format.html { redirect_to [:admin, @categoria], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.h... | [
"0.6960239",
"0.69292897",
"0.69081634",
"0.6875341",
"0.6843645",
"0.6822764",
"0.6810402",
"0.67256373",
"0.6724895",
"0.6723475",
"0.6630628",
"0.65831226",
"0.64941436",
"0.6484316",
"0.6408087",
"0.64013296",
"0.63994426",
"0.6397613",
"0.6388647",
"0.6386823",
"0.637302... | 0.71914697 | 0 |
DELETE /categorias/1 DELETE /categorias/1.json | def destroy
@categoria.update(ativo: false)
render json: @categoria
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @categoria.destroy\n respond_to do |format|\n format.html { redirect_to categorias_path, notice: @@titulo + t('msg.remove') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categoria = Categoria.find(params[:id])\n @categoria.destroy\n\n respond_to do ... | [
"0.78320897",
"0.78167415",
"0.7675722",
"0.7670464",
"0.7624127",
"0.7457356",
"0.7451686",
"0.74435395",
"0.7423012",
"0.7377931",
"0.73605233",
"0.73600537",
"0.7354897",
"0.73373127",
"0.73143834",
"0.7310547",
"0.728946",
"0.72877705",
"0.7259493",
"0.7259292",
"0.722995... | 0.6989468 | 39 |
Use callbacks to share common setup or constraints between actions. | def set_categoria
@categoria = Categoria.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 categoria_params
params.require(:categoria).permit(:descricao, :ativo)
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 |
Creates the new association by setting the internal document as the passed in Document. This should be the parent. All method calls on this object will then be delegated to the internal document itself. | def initialize(document)
@document = document.parent
decorate!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(document, options)\n @klass = options.klass\n attributes = document.attributes[options.association_name]\n @document = klass.instantiate(attributes || {})\n @document.parentize(document, options.association_name)\n decorate!\n end",
"def add_association(type... | [
"0.66758823",
"0.61539686",
"0.5968308",
"0.5944857",
"0.5926889",
"0.5855154",
"0.58086425",
"0.57510155",
"0.57150036",
"0.5583238",
"0.55568963",
"0.54760265",
"0.5474487",
"0.5419226",
"0.5409384",
"0.54054743",
"0.540393",
"0.5400971",
"0.539806",
"0.5391123",
"0.5384478... | 0.5390902 | 20 |
Returns the parent document. The id param is present for compatibility with rails, however this could be overwritten in the future. | def find(id)
@document
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parent_document\n pi = parent_item\n return if pi == nil\n pi_id = pi.id\n return if pi_id == nil\n DocumentRepository.find(pi_id)\n end",
"def parent\n if parent_id.blank? then nil else unscoped_find(parent_id) end\n end",
"def parent\n tree.parent_for(parent_id).first\n e... | [
"0.8291091",
"0.81077814",
"0.77860457",
"0.77841145",
"0.7714459",
"0.7535644",
"0.7518978",
"0.74956393",
"0.74235123",
"0.74189764",
"0.7364799",
"0.73577505",
"0.7229101",
"0.72118974",
"0.72060984",
"0.71941936",
"0.7184539",
"0.71825755",
"0.71737087",
"0.71637064",
"0.... | 0.0 | -1 |
Starts and identifies an interchange of zero or more functional groups and interchangerelated control segments | def interchange_control_header
['ISA', '00', (' ' * 10), '00', (' ' * 10), 'ZZ', payer_id.to_s.justify(15),
'ZZ', isa_08, Time.now().strftime("%y%m%d"), Time.now().strftime("%H%M"),
((!@output_version || @output_version == '4010') ? 'U' : '^'),
((!@output_version || @output_version == '4010') ? '0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ii_groups; end",
"def iii_groups; end",
"def i_groups; end",
"def functional_group_loop\n segments = []\n batchids.each do |batch_id|\n Output835.log.info \"batch_id : #{batch_id}\"\n segments << functional_group_header\n segments << transactions\n segments << functional_group_t... | [
"0.5782815",
"0.5734713",
"0.53156894",
"0.5201068",
"0.5193212",
"0.5146884",
"0.5129744",
"0.51066387",
"0.50322676",
"0.49107122",
"0.49081755",
"0.49060944",
"0.47921142",
"0.47531128",
"0.46987367",
"0.4697771",
"0.465526",
"0.46486443",
"0.4647279",
"0.46403602",
"0.462... | 0.0 | -1 |
A functional group of related transaction sets, within the scope of X12 standards, consists of a collection of similar transaction sets enclosed by a functional group header and a functional group trailer | def functional_group_loop
[functional_group_header, transactions, functional_group_trailer(@batch.id)].compact
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def functional_group_loop\n segments = []\n segments << functional_group_header\n segments << transactions\n segments << functional_group_trailer(nil)\n segments = segments.compact\n segments\n end",
"def functional_group_loop\n segments = []\n batchids.each do |batch_id|\n Output83... | [
"0.70272624",
"0.6431121",
"0.5928883",
"0.58905935",
"0.5791267",
"0.57008934",
"0.5653576",
"0.5243517",
"0.51896995",
"0.51050967",
"0.5100749",
"0.5083472",
"0.5073232",
"0.5055131",
"0.49966165",
"0.49822393",
"0.49718705",
"0.4963298",
"0.4963298",
"0.4963298",
"0.49457... | 0.68605167 | 1 |
The use of identical data interchange control numbers in the associated functional group header and trailer is designed to maximize functional group integrity. The control number is the same as that used in the corresponding header. | def functional_group_trailer(batch_id = nil)
['GE', checks_in_functional_group(batch_id), '2831'].join(@element_seperator)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def interchange_control_header\n empty_str = ''\n isa_elements = []\n isa_elements << 'ISA'\n isa_elements << '00'\n isa_elements << trim(empty_str,10)\n isa_elements << '00'\n isa_elements << trim(empty_str,10)\n isa_elements << 'ZZ'\n isa_elements << trim(payer_id, 15)\n isa_element... | [
"0.59701735",
"0.54696715",
"0.5406903",
"0.5376386",
"0.5355225",
"0.5289154",
"0.52848154",
"0.5242616",
"0.515166",
"0.5052002",
"0.50255233",
"0.49996623",
"0.49764648",
"0.49744514",
"0.4959544",
"0.49267748",
"0.49141595",
"0.48787144",
"0.4834999",
"0.47820318",
"0.473... | 0.54565346 | 2 |
To define the end of an interchange of zero or more functional groups and interchangerelated control segments | def interchange_control_trailer
[ 'IEA', '1', (@isa_record.isa_number.to_s.rjust(9, '0') if @isa_record)].join(@element_seperator)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_group(kind); end",
"def end_group(kind); end",
"def ii_groups; end",
"def rl_end_undo_group()\r\n rl_add_undo(UNDO_END, 0, 0, nil)\r\n @_rl_undo_group_level-=1\r\n 0\r\n end",
"def end_group kind\n end",
"def begin_group(kind); end",
"def iii_groups; end",
"def i_groups; end",
... | [
"0.5932845",
"0.5932845",
"0.56640553",
"0.5457374",
"0.53804034",
"0.5334768",
"0.5298702",
"0.5112511",
"0.4879914",
"0.4817763",
"0.4809668",
"0.48028642",
"0.47586754",
"0.47535676",
"0.47466853",
"0.47465056",
"0.47273824",
"0.47259632",
"0.47204572",
"0.47188136",
"0.47... | 0.43753088 | 64 |
Wrapper for each check in this 835 | def transactions
segments = []
batch_based_index = 0
@checks.each_with_index do |check, index|
@check_grouper.last_check = check
@check = check
@check_index = index
@batch = check.batch
@job = check.job
@flag = 0 #for identify if any of the billing provider details is mi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checks; end",
"def result_of_checking; end",
"def check\n \n end",
"def check\n \n end",
"def checks=(_arg0); end",
"def multi_check\n raise NotImplementedError\n end",
"def check ; true ; end",
"def check\n each { |m| m.check }\n end",
"d... | [
"0.73231524",
"0.70450664",
"0.6877773",
"0.6877773",
"0.67324543",
"0.665207",
"0.6634304",
"0.6363723",
"0.6304034",
"0.61996853",
"0.6191147",
"0.6124666",
"0.59687746",
"0.5954068",
"0.5948225",
"0.5850663",
"0.5840343",
"0.5803274",
"0.5799415",
"0.57774734",
"0.5763018"... | 0.0 | -1 |
Generating check level segments | def generate_check
Output835.log.info "\n\nCheck number : #{@check.check_number} undergoing processing"
transaction_segments =[ transaction_set_header, financial_info, reassociation_trace]
transaction_segments << ref_ev_loop if @facility_output_config.details[:ref_ev_batchid]
transaction_segments += [r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transactions\n segments = []\n batch_based_index = 0\n\n check_klass = Output835.class_for(\"Check\", facility)\n Output835.log.info \"Applying class #{check_klass}\"\n check_op = check_klass.new(nil, facility, 0, @element_seperator, @check_eob_hash)\n check_op.instance_variable_set(\"@plb_ex... | [
"0.6078815",
"0.554194",
"0.5534386",
"0.5471448",
"0.5446783",
"0.543605",
"0.53607666",
"0.5295136",
"0.5241401",
"0.5231374",
"0.5218446",
"0.5162566",
"0.51621455",
"0.51324904",
"0.5104028",
"0.5066837",
"0.505797",
"0.50529706",
"0.50168824",
"0.50092334",
"0.4997686",
... | 0.66065955 | 0 |
The ST segment indicates the start of a transaction set and assigns a control number | def transaction_set_header
['ST', '835' ,(@check_index + 1).to_s.rjust(4, '0')].join(@element_seperator)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_start(v)\nadd_state(v)\n@start = v\nend",
"def set_start(v)\n add_state(v)\n @start = v\n end",
"def set_start(v)\n add_state(v)\n @start = v\n end",
"def set_segment\n @segment = Segment.find(params[:id])\n @stage = @segment.stage\n end",
"def segment... | [
"0.58385175",
"0.57905555",
"0.57905555",
"0.5775517",
"0.55400115",
"0.55266327",
"0.54962426",
"0.5492643",
"0.540834",
"0.5397732",
"0.53147566",
"0.5239338",
"0.52285665",
"0.5206064",
"0.51877946",
"0.51698583",
"0.5168981",
"0.5158361",
"0.514071",
"0.5122037",
"0.50820... | 0.52560294 | 11 |
The TRN segment is used to uniquely identify a claim payment and advice. | def reassociation_trace
simple_client_array_for_1000000009 = ["NAVICURE", "ASCEND CLINICAL LLC"]
trn_elements = ['TRN', '1', ref_number]
if simple_client_array_for_1000000009.include? (@client_name)
trn_elements << '1000000009'
elsif @check_amount.to_f > 0 && @check.payment_method == "EFT"
t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reassociation_trace\n trn_elements = ['TRN', '1', ref_number]\n if @check_amount.to_f > 0 && @check.payment_method == \"EFT\"\n trn_elements << '1' + @facility.facility_tin if @facility.facility_tin.present?\n else\n trn_elements << '1999999999'\n end\n trn_elements.join(@element_sep... | [
"0.52943814",
"0.52118546",
"0.5184797",
"0.5149168",
"0.51062495",
"0.50990087",
"0.4833568",
"0.4832205",
"0.48219177",
"0.48013112",
"0.4788337",
"0.4769391",
"0.47535005",
"0.47455162",
"0.47307733",
"0.47184253",
"0.46480992",
"0.463094",
"0.46116254",
"0.46116254",
"0.4... | 0.53947395 | 0 |
specifies pertinent dates and times of 835 generation | def date_time_reference
['DTM', '405', @batch.date.strftime("%Y%m%d")].join(@element_seperator)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_daytime_distribution \n \n end",
"def dates\n\t\t@times = { \n\t\t\t:haiti=>{\n\t\t\t\t:one_week_before=>\tTime.new(2010,01,5),\n\t\t\t\t:event\t\t\t=>\tTime.new(2010,01,12),\n\t\t\t\t:one_week_after\t=>\tTime.new(2010,01,19),\n\t\t\t\t:dw_end\t\t\t=>\tTime.new(2010,02,12)\n\t\t\t},\n\n\t\t... | [
"0.6556878",
"0.6497791",
"0.6404691",
"0.6341079",
"0.6341079",
"0.607355",
"0.59619486",
"0.5874665",
"0.58094215",
"0.58020794",
"0.58020794",
"0.5800354",
"0.57809216",
"0.57732856",
"0.5762558",
"0.5748555",
"0.5741308",
"0.57134813",
"0.5689955",
"0.5688232",
"0.5683832... | 0.0 | -1 |
The N1 loop allows for name/address information for the payer which would be utilized to address remittance(s) for delivery. | def payer_identification_loop(repeat = 1)
payer = get_payer
if payer
Output835.log.info "\n payer is #{payer.name}"
payer_segments = []
repeat.times do
payer_segments << payer_identification(payer)
payer_segments << address(payer)
payer_segments << geographic_locati... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def payee_identification_loop(repeat = 1)\n payee = get_facility\n if payee\n if ( payee.name.blank? || payee.address_one.blank? || payee.city.blank? || payee.state.blank? || payee.zip_code.blank?)\n @claim = payee.clone\n payee = @facility #if any of the billing provider address details i... | [
"0.62921506",
"0.6256368",
"0.55745333",
"0.5344296",
"0.52161956",
"0.5168677",
"0.51218396",
"0.5087225",
"0.5049853",
"0.5030059",
"0.5007748",
"0.4997905",
"0.4987968",
"0.49865928",
"0.4984046",
"0.49680662",
"0.49460635",
"0.49453306",
"0.49134797",
"0.4902711",
"0.4890... | 0.6242321 | 2 |
The N1 loop allows for name/address information for the payee which would be utilized to address remittance(s) for delivery. | def payee_identification_loop(repeat = 1)
payee = get_facility
if payee
if ( payee.name.blank? || payee.address_one.blank? || payee.city.blank? || payee.state.blank? || payee.zip_code.blank?)
@claim = payee.clone
payee = @facility #if any of the billing provider address details is missing ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def payee_identification_loop(repeat = 1)\n payee = get_facility\n if payee\n if ( payee.name.blank? || payee.address_one.blank? || payee.city.blank? || payee.state.blank? || payee.zip_code.blank?)\n @claim = payee.clone\n payee = @facility #if any of the billing provider address details i... | [
"0.66184485",
"0.5846712",
"0.5586201",
"0.5276382",
"0.5198368",
"0.51736844",
"0.51698524",
"0.5129587",
"0.51131934",
"0.5043477",
"0.50116915",
"0.49954066",
"0.49906054",
"0.49784195",
"0.49771616",
"0.49560034",
"0.49462622",
"0.4942801",
"0.49199936",
"0.49190298",
"0.... | 0.6586868 | 1 |
The LX segment is used to provide a looping structure and logical grouping of claim payment information. | def transaction_set_line_number(index)
['LX', index.to_s.rjust(4, '0')].join(@element_seperator)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_llo_x()\n llo = to_llo\n\n op = analysis(Analysis::APS_NAME, primary_lead_name())\n llo << op.index(Index::APS_C1_NAME).value.to_f\n llo << op.index(Index::APS_C2_NAME).value.to_f\n llo << op.index(Index::APS_C3_NAME).value.to_f\n\n op = analysis(Analysi... | [
"0.5640425",
"0.5345761",
"0.52368295",
"0.51290005",
"0.5087683",
"0.5011095",
"0.49656186",
"0.49045813",
"0.4869456",
"0.4842872",
"0.4836445",
"0.4823623",
"0.4794454",
"0.47819278",
"0.472283",
"0.47207403",
"0.46869776",
"0.4675483",
"0.46122098",
"0.4537262",
"0.453560... | 0.48907164 | 8 |
Reports adjustments to the actual payment that are NOT specific to a particular claim or service These adjustments can either decrease the payment (a positive number) or increase the payment (a negative number) such as the remainder of check amount subtracted by total eob payemnts (provider adjustment) or interest amou... | def provider_adjustment(eobs = nil,facility = nil,payer=nil,check = nil,plb_excel_sheet = nil,facility_output_config = nil,orb_xml_flag=nil)
@eobs = (@eobs.nil? || @eobs.blank? || orb_xml_flag) ? eobs : @eobs
@facility = (@facility.nil? || orb_xml_flag)? facility : @facility
@payer = (@payer.nil? || orb_xml... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def provider_adjustment\n eob_klass = Output835.class_for(\"Eob\", facility)\n eob_obj = eob_klass.new(eobs.first, facility, payer, 1, @element_seperator) if eobs.first\n\n interest_exists_and_should_be_printed = false\n # Collect all eobs for which the interest amount is non zero\n interest_eobs = ... | [
"0.70897514",
"0.6767127",
"0.6742765",
"0.6614591",
"0.6614591",
"0.64564395",
"0.62885785",
"0.619232",
"0.6135869",
"0.6010378",
"0.5937952",
"0.59112453",
"0.58923024",
"0.5874979",
"0.587377",
"0.5839453",
"0.58234555",
"0.57790184",
"0.57499576",
"0.5748554",
"0.569994"... | 0.6693149 | 3 |
Generating Eob level segments | def generate_eobs
Output835.log.info "\n\nPatient account number : #{@eob.patient_account_number}"
Output835.log.info "This EOB has #{@services.length} service lines"
Output835.log.info "This is a CLAIM LEVEL EOB" if @is_claim_eob
claim_segments = [claim_payment_loop, include_claim_dates]
claim_seg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def segments; end",
"def Segment\n A = 1\n B = 2\n C = 4\n D = 8\n E = 16\n F = 32\n G = 64\n H = 128\n J = 256\n K = 512\n M = 1024\n N = 2048\n P = 4096\n\n def initialize(segments=0)\n @segments = segments\n end\n\n def s(seg=Segment.new)\n Segment.new seg.segments + SOUTH\n end\nend",
... | [
"0.616536",
"0.6050643",
"0.55417985",
"0.54690576",
"0.5385677",
"0.5382693",
"0.52583516",
"0.5247545",
"0.51739496",
"0.5157609",
"0.51527894",
"0.5112163",
"0.51003504",
"0.51003504",
"0.5086204",
"0.50796926",
"0.50705373",
"0.50653744",
"0.50653744",
"0.5037154",
"0.502... | 0.65999275 | 0 |
Loop 2100 : Supplies information common to all services of a claim | def claim_payment_loop
claim_payment_segments = []
@clp_pr_amount = nil
claim_payment_segments << claim_payment_information
service_eob = @services.detect{|service| service.adjustment_line_is? }
if service_eob
cas_segments, @clp_pr_amount, crosswalked_codes = Output835.cas_adjustment_segments(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def claim_loop\n segments = []\n @eobs.each_with_index do |eob, index|\n @check_grouper.last_eob = eob\n @check = eob.check_information\n @job = @check.job\n if @check.micr_line_information && @check.micr_line_information.payer && @facility.details[:micr_line_info]\n @payer = @ch... | [
"0.71214765",
"0.6911893",
"0.69110173",
"0.6903225",
"0.67716616",
"0.6081325",
"0.60438937",
"0.5956244",
"0.58530664",
"0.5794688",
"0.55835664",
"0.55633456",
"0.55593854",
"0.5512016",
"0.5510911",
"0.54950434",
"0.54365844",
"0.5368469",
"0.5367723",
"0.5362046",
"0.536... | 0.6879679 | 4 |
Supplies information common to all services of a claim | def claim_payment_information
claim_weight = claim_type_weight
clp_elements = ['CLP', captured_or_blank_patient_account_number(@eob.patient_account_number), claim_weight,
@eob.amount('total_submitted_charge_for_claim'), @eob.payment_amount_for_output(@facility, @facility_output_config),
( claim_weig... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_payment_information(eob = nil,service = nil,check = nil,is_claim_eob = nil,payer = nil)\n @service = @service.nil?? service : @service\n ['SVC', composite_med_proc_id, @service.amount('service_procedure_charge_amount'), @service.amount('service_paid_amount'),\n svc_revenue_code, @service.se... | [
"0.61048096",
"0.6013383",
"0.59969187",
"0.598453",
"0.5912042",
"0.5876793",
"0.5876793",
"0.587401",
"0.5861153",
"0.58514893",
"0.58080626",
"0.57767224",
"0.5712397",
"0.5675546",
"0.56036097",
"0.5601868",
"0.55929863",
"0.5576181",
"0.55687076",
"0.55388206",
"0.551710... | 0.50857323 | 71 |
Get claim_number for payer_group not of type 'PatPay' | def claim_number
@eob.claim_number.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def claim_number\n str = eob.check_information.check_number.to_s if eob.check_information\n (str += '_' + eob.claim_number) if !eob.claim_number.blank?\n str\n end",
"def payer_id\n payer = @first_check.payer\n payer_type = payer.payer_type if payer\n output_config = @facility.output_config(pa... | [
"0.6027029",
"0.5782901",
"0.5726156",
"0.5623404",
"0.5597491",
"0.5535263",
"0.5491672",
"0.5445134",
"0.5441101",
"0.53247625",
"0.5308545",
"0.5238663",
"0.5188976",
"0.5179709",
"0.51416236",
"0.5135443",
"0.5132143",
"0.5131256",
"0.5125264",
"0.5125264",
"0.5116556",
... | 0.6047227 | 0 |
Supplies the full name of an individual or organizational entity | def patient_name
patient_id, qualifier = @eob.patient_id_and_qualifier
patient_name_details = [ 'NM1', 'QC', '1', captured_or_blank_patient_last_name(@eob.patient_last_name),
captured_or_blank_patient_first_name(@eob.patient_first_name), @eob.patient_middle_initial.to_s.strip,
'', @eob.patient_suffi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entity_name(entity)\n entity_value(entity, :full_name, :name, I18n.t('name_missing'))\n end",
"def display_name\n \"#{entity_name} (#{entity_type.entity_type_abbreviation})\"\n end",
"def full_name\n object.first_name + \" \" + object.last_name\n end",
"def full_name\n name\n end",
"def... | [
"0.78135395",
"0.7572471",
"0.7517015",
"0.7481097",
"0.7475367",
"0.7473698",
"0.74184465",
"0.7396141",
"0.7383907",
"0.7373663",
"0.73686385",
"0.7363108",
"0.73630977",
"0.7360705",
"0.73573035",
"0.73483706",
"0.7343278",
"0.7343278",
"0.7343278",
"0.7335176",
"0.7327831... | 0.0 | -1 |
Required when the insured or subscriber is different from the patient | def insured_name
if @eob_type != 'Patient'
id, qual = @eob.member_id_and_qualifier
['NM1', 'IL', '1', @eob.subscriber_last_name, @eob.subscriber_first_name,
@eob.subscriber_middle_initial, '', @eob.subscriber_suffix, qual,id].trim_segment.join(@element_seperator)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patient_implicit?\n @authorized_user.patients.size == 1 \n end",
"def fields_user_id_and_reviewer_id_are_different\n if self.user_id == self.reviewer_id\n errors.add(\"You cannot give yourself a review\")\n end\n end",
"def has_related_patient?\n if registrations.count > 0\n return... | [
"0.657426",
"0.6013006",
"0.5821485",
"0.5809933",
"0.58035415",
"0.57882476",
"0.57570213",
"0.5743794",
"0.57176065",
"0.5696234",
"0.56878865",
"0.5685244",
"0.56852007",
"0.5679518",
"0.56657505",
"0.5654744",
"0.56542194",
"0.56524634",
"0.56524634",
"0.5640376",
"0.5601... | 0.0 | -1 |
Supplies the full name of an individual or organizational entity Required when the insured or subscriber is different from the patient | def service_prov_name(eob = nil,claim = nil )
@eob = @eob.nil?? eob : @eob
prov_id, qualifier = service_prov_identification
['NM1', '82', (@eob.rendering_provider_last_name.to_s.strip.blank? ? '2': '1'),
prov_last_name_or_org, @eob.rendering_provider_first_name,
@eob.rendering_provider_middle_i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insured_name\n if @eob_type != 'Patient'\n id, qual = @eob.member_id_and_qualifier\n ['NM1', 'IL', '1', @eob.subscriber_last_name, @eob.subscriber_first_name,\n @eob.subscriber_middle_initial, '', @eob.subscriber_suffix, qual,id].trim_segment.join(@element_seperator)\n end\n end",
"de... | [
"0.71226186",
"0.70130026",
"0.6980299",
"0.6943233",
"0.69420606",
"0.6903538",
"0.6895194",
"0.6842419",
"0.6836573",
"0.6815898",
"0.68127453",
"0.6795466",
"0.679342",
"0.6781095",
"0.67155707",
"0.67050254",
"0.6701097",
"0.66793793",
"0.6671982",
"0.6670654",
"0.6652339... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.