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 |
|---|---|---|---|---|---|---|
Find the first instance, matching +token_or_object+, and optional +options+. | def find_limitable_by_token(token, options = {})
if token.is_a?(Hash)
options = token
token = nil
end
options[:unique_session_id] = token if token
options = session_limitable_condition(options)
session_limitable_adapter.find_first options
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_first(options = {})\n construct_scope(options).first\n end",
"def find(*args)\n if args[0].is_a?(String) && args[0].length == has_token_id_options[:length]\n record = find_by_token(args[0])\n end\n record || super(*args)\n end",
"def first(options={})\r\n fi... | [
"0.6819342",
"0.6779257",
"0.65023845",
"0.64415574",
"0.6378083",
"0.6335719",
"0.63296676",
"0.62694174",
"0.6236344",
"0.6160305",
"0.6081722",
"0.6078829",
"0.5999372",
"0.59602296",
"0.59539056",
"0.59530157",
"0.5938923",
"0.59124553",
"0.58774513",
"0.5869311",
"0.5864... | 0.5162834 | 97 |
Check if it will allow authentication and remove session if possible. | def authenticate_limitable?
return true if limit_session_to > session_limits.count
opts = session_limitable_condition(order: %i(last_accessed_at asc))
if reject_session_on_limit
# When +reject_session_on_limit+ is true, check for session that already timeout.
# If exist, remove that session.
session_limitable_adapter.find_all(opts).any? do |session|
expire_session_limit(session) if ((Time.current - timeout_session_in) <=> session.last_accessed_at) >= 0
end
else
# Remove oldest session if +reject_session_on_limit+ is false.
session = session_limitable_adapter.find_first(opts)
expire_session_limit(session) if session
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ensure_logged_in\n authenticate unless token_authenticated? || @skip_authenticate\n end",
"def authenticate\n deny_access unless loged_in?\n end",
"def site_authenticate\n deny_access unless signed_in?\n end",
"def authenticate\n deny_access unless signed_in? \n end",
"def requi... | [
"0.6993237",
"0.6987407",
"0.6903305",
"0.68486065",
"0.68222934",
"0.68192333",
"0.68192333",
"0.68192333",
"0.68192333",
"0.68192333",
"0.6779032",
"0.6752647",
"0.67491734",
"0.67491734",
"0.6744026",
"0.6744026",
"0.67342633",
"0.67059493",
"0.6705443",
"0.66918457",
"0.6... | 0.6401191 | 66 |
action to get all the videos | def index
@movies = Movie.all
respond_with @movies
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def videos options={}\n response = client.get(\"/#{id}/videos\", options)\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all... | [
"0.7753373",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.7745534",
"0.770961",
"0.7571254",
"0.7571254",
"0... | 0.0 | -1 |
to show just one record | def show
@movie = Movie.find params[:id]
respond_with @movie
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n\t @person = Entry.last\n end",
"def show\t\t\t\t\n\t\t\tend",
"def show\n\t\t#no need b/c we just show all at once\n\tend",
"def show_row\n @dataset = Dataset.find(params[:dataset_id])\n if params[:row_id].gsub(/[0-9]/,\"\").length == 0 #il n'y a que des chiffres\n @data = ActiveRecord:... | [
"0.7163084",
"0.6976573",
"0.6855532",
"0.6805043",
"0.6751737",
"0.6718434",
"0.6684086",
"0.6684086",
"0.6684086",
"0.6682415",
"0.6682415",
"0.6682415",
"0.66705835",
"0.6647132",
"0.6647132",
"0.6640839",
"0.66202176",
"0.66202176",
"0.66202176",
"0.66202176",
"0.66202176... | 0.0 | -1 |
GET /work_orders or /work_orders.json | def index
@work_orders = WorkOrder.pending
@completed_work_orders = WorkOrder.completed
@work_order_requests = WorkOrderRequest.pending
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @work_orders = WorkOrder.accessible_by(current_ability).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @work_orders }\n format.xml { render xml: @work_orders }\n end\n end",
"def show\n ... | [
"0.7086121",
"0.7080624",
"0.70347786",
"0.68612075",
"0.6860363",
"0.6752979",
"0.6752979",
"0.6734233",
"0.67226034",
"0.6650292",
"0.66231185",
"0.6597508",
"0.65677947",
"0.6521065",
"0.6496573",
"0.64862835",
"0.6406873",
"0.63954955",
"0.6392797",
"0.6390331",
"0.637105... | 0.6576312 | 12 |
GET /work_orders/1 or /work_orders/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_work_order\n if !is_numeric?(params[:id]) || params[:id] == '0'\n render json: :bad_request, status: :bad_request\n else\n @work_order = WorkOrder.find(params[:id]) rescue nil\n render json: :not_found, status: :not_found unless @work_order.present?\n end\n end",
"... | [
"0.71286756",
"0.70767915",
"0.70360166",
"0.6981735",
"0.6839416",
"0.68004274",
"0.66186184",
"0.66073114",
"0.6589435",
"0.6540855",
"0.6540855",
"0.6520142",
"0.6514074",
"0.6463923",
"0.64558476",
"0.6450223",
"0.644517",
"0.6440727",
"0.64233893",
"0.6412113",
"0.640284... | 0.0 | -1 |
POST /work_orders or /work_orders.json | def create
@work_order = WorkOrder.new(work_order_params)
respond_to do |format|
if @work_order.save
format.html { redirect_to @work_order, notice: "Work order was successfully created." }
format.json { render :show, status: :created, location: @work_order }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @work_order.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @work_order = WorkOrder.new(work_order_params)\n\n respond_to do |format|\n if @work_order.save\n format.html { redirect_to @work_order, notice: 'Work order was successfully created.' }\n format.json { render :show, status: :created, location: @work_order }\n else\n ... | [
"0.7093797",
"0.70524096",
"0.69922006",
"0.6932895",
"0.66960317",
"0.6581095",
"0.65136456",
"0.6477542",
"0.63537896",
"0.6351503",
"0.63468224",
"0.627304",
"0.6240671",
"0.6225582",
"0.6166329",
"0.6153152",
"0.6151447",
"0.61240906",
"0.6116668",
"0.60931695",
"0.606656... | 0.7104326 | 0 |
PATCH/PUT /work_orders/1 or /work_orders/1.json | def update
respond_to do |format|
if @work_order.update(work_order_params)
format.html { redirect_to @work_order, notice: "Work order was successfully updated." }
format.json { render :show, status: :ok, location: @work_order }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @work_order.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @work_order.update(work_order_params)\n format.html { redirect_to \"/\", notice: 'Work order was successfully updated.' }\n format.json { render :show, status: :ok, location: @work_order }\n else\n format.html { render :edit }\n form... | [
"0.74276525",
"0.7385749",
"0.73043853",
"0.7267081",
"0.7245943",
"0.71147776",
"0.69847083",
"0.6865372",
"0.6825763",
"0.67332447",
"0.666819",
"0.6662556",
"0.663212",
"0.66103715",
"0.6608452",
"0.6556171",
"0.65483063",
"0.65383714",
"0.6523433",
"0.65123105",
"0.649043... | 0.7395378 | 1 |
DELETE /work_orders/1 or /work_orders/1.json | def destroy
@work_order.destroy
respond_to do |format|
format.html { redirect_to work_orders_url, notice: "Work order was successfully destroyed." }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @workorder = Workorder.find(params[:id])\n @workorder.destroy\n\n respond_to do |format|\n format.html { redirect_to workorders_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @workorder.destroy\n respond_to do |format|\n format.html { redirec... | [
"0.7599452",
"0.75878084",
"0.74199873",
"0.7333525",
"0.7274303",
"0.7272477",
"0.7258886",
"0.7234191",
"0.7170656",
"0.70960635",
"0.70861983",
"0.70220447",
"0.70220447",
"0.70220447",
"0.70220447",
"0.7006155",
"0.6950714",
"0.68447053",
"0.68392795",
"0.68364745",
"0.68... | 0.7332084 | 4 |
Use callbacks to share common setup or constraints between actions. | def set_work_order
@work_order = WorkOrder.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 work_order_params
params.require(:work_order).permit(:location, :status, :issue, :line, :recurring, :recurring_frequency, :machine, :work_order_type, :request_date_time, :level_of_issue, :requested_by, :email, :description_of_issue, :planned_date_and_time, :complete_date_and_time)
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 |
returns a flat hash of all default fields | def default_fields
# @kase.default_fields_with_name(:kase) if @kase
defaults = {}
defaults = defaults.merge(@review.default_fields_with_name(:review)) if @review
defaults = defaults.merge(@comment.default_fields_with_name(:comment)) if @comment
defaults
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_fields\n defaults = {}\n defaults = defaults.merge(@user.default_fields_with_name(:user)) if @user\n defaults = defaults.merge(@person.default_fields_with_name(:person)) if @person\n defaults = defaults.merge(@person.default_fields_with_name(:person_business_address_attributes)) if @person.... | [
"0.79852545",
"0.78090465",
"0.7535569",
"0.7319393",
"0.7280594",
"0.7203",
"0.7150944",
"0.7091923",
"0.70664537",
"0.70359945",
"0.70331556",
"0.70327187",
"0.7021439",
"0.700837",
"0.6994271",
"0.6991556",
"0.697627",
"0.688634",
"0.68835074",
"0.68835074",
"0.6829504",
... | 0.77219886 | 2 |
AJAX end point to retrieve the next page of user comments. | def comments
@comments = @user.comments.list.page(params[:page])
render partial: "comments/comment", layout: false,
collection: @comments, locals: {with_posted_in: true}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_comments\n present Thing::Show\n\n render js: concept(\"comment/cell/grid\", @model, page: params[:page]).(:append)\n end",
"def ajax_get_new_page\n case params[ :type ] \n when \"following\" , \"followers\" \n data = User.fetch_follow( params[ :id ] , current_user , params[ :type ], p... | [
"0.75088936",
"0.6554779",
"0.64800096",
"0.62444025",
"0.61910486",
"0.6116215",
"0.6112615",
"0.60355955",
"0.6003112",
"0.5996505",
"0.59760463",
"0.59673303",
"0.5967055",
"0.59568775",
"0.594196",
"0.5938457",
"0.5908751",
"0.5896064",
"0.5878164",
"0.5869054",
"0.585966... | 0.5993183 | 10 |
renders 404 in an exception template. A generic template exists in error which shows the error in a usage way. | def render_404(exception = nil)
@not_found_path = exception.message if exception
if !signed_in?
#gflash error: "#{exception}"
redirect_to signin_path, flash: { error: 'You must first sign in or sign up.' }
else
respond_to do |format|
format.html { render template: 'errors/not_found', layout: 'application', status: 404 }
format.all { render nothing: true, status: 404 }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_404\n render :template => \"errors/404\", :status => :not_found, :layout => false\n end",
"def render_missing\r\n RenderError.new('404')\r\n end",
"def render_404(exception=nil)\n if exception\n logger.error \"Rendering 404 with exception: #{exception.message}\"\n logger... | [
"0.81255436",
"0.8122052",
"0.8083134",
"0.8072791",
"0.8072791",
"0.80653155",
"0.80334973",
"0.7941167",
"0.78958917",
"0.7886388",
"0.78725594",
"0.7860532",
"0.78402084",
"0.7797359",
"0.7787853",
"0.77810746",
"0.77733076",
"0.7743614",
"0.7734635",
"0.773232",
"0.772363... | 0.74399596 | 51 |
renders 505 in an exception template. A generic template exists in error which shows the error in a usage way. | def render_500(exception = nil)
puts_stacktrace(exception) if exception
if !signed_in?
# gflash error: "#{exception.message}"
redirect_to signin_path, flash: { error: 'You must first sign in or sign up.' }
else
respond_to do |format|
format.html { render template: 'errors/internal_server_error', layout: 'application', status: 500 }
format.js { render template: 'errors/internal_server_error', layout: 'application', status: 500 }
format.all { render nothing: true, status: 500 }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_exception(e)\n @message = e.message\n @backtrace = e.backtrace\n\n response_erb = ERB.new(File.read(\"../lib/templates/rescue.html.erb\"))\n response_text = response_erb.result(binding)\n response = ['500', {'Content-type' => 'text/html'}, [response_text]]\n end",
"def render_500\n ... | [
"0.71216464",
"0.7023425",
"0.69115573",
"0.68553704",
"0.6845398",
"0.68452007",
"0.6836042",
"0.6810808",
"0.6707384",
"0.6701645",
"0.6690059",
"0.6686217",
"0.6681991",
"0.6679331",
"0.6679331",
"0.6652468",
"0.6567075",
"0.6521265",
"0.6475773",
"0.6430815",
"0.64221525"... | 0.6474239 | 19 |
if the request is from the root url (eg: console.megam.io) then no message is shown if the request is form a non root url like users/1/edit, then we show message. | def require_signin
if signed_in?
else
if request.fullpath.to_s == '/' || request.original_url.to_s == '/'
redirect_to signin_path
else
if request.fullpath.to_s.match('auth')
auth = request.env['omniauth.auth']['extra']['raw_info']
session[:auth] = { email: auth[:email], first_name: auth[:first_name], last_name: auth[:last_name] }
redirect_to social_create_path
else
# gflash error: 'You must first sign in or sign up.'
redirect_to signup_path, flash: { error: 'You must first sign in or sign up.' }
end
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def root\n super\n if @remaining_path == \"/\" && !is_get?\n always{method_not_allowed(\"GET\")}\n end\n end",
"def show\n redirect_to :root, notice: 'There\\'s nothing to see at the URL entered.'\n end",
"def check_uri\n \tif current_user.nil? and !/^www/.mat... | [
"0.6451613",
"0.6180173",
"0.61671686",
"0.59415495",
"0.5910693",
"0.5889135",
"0.5820643",
"0.5779447",
"0.5766591",
"0.5763764",
"0.57596093",
"0.5756716",
"0.575452",
"0.5754371",
"0.57509804",
"0.57094526",
"0.56965023",
"0.56688964",
"0.56671554",
"0.56553096",
"0.56538... | 0.0 | -1 |
we will move this to our own lib | def catch_exceptions
yield
rescue Accounts::MegamAPIError => mai
ascii_bomb
puts_stacktrace(mai)
# notify hipchat, send an email to support@megam.io which creates a support ticket.
# redirect to the users last visited page.
if !signed_in?
#gflash error: "#{mai.message}"
redirect_to(signin_path, flash: { api_error: 'api_error' }) && return
else
# gflash error: "#{mai.message}"
redirect_to(cockpits_path, flash: { api_error: 'api_error' }) && return
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def probers; end",
"def schubert; end",
"def implementation; end",
"def implementation; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def refutal()\n end",
"def internal; end",
"def custom; end",
"def custom; end",
"def wrapper; ... | [
"0.76381254",
"0.6349455",
"0.6206595",
"0.61386144",
"0.61386144",
"0.6136254",
"0.6136254",
"0.6136254",
"0.6136254",
"0.6079653",
"0.60749954",
"0.6029338",
"0.6029338",
"0.598037",
"0.59739006",
"0.58757156",
"0.5833816",
"0.583231",
"0.5788169",
"0.5768171",
"0.5762671",... | 0.0 | -1 |
just show our stuff . | def puts_stacktrace(exception)
logger.debug "\033[1m\033[32m#{exception.message}\033[0m\033[22m"
filtered_trace = exception.backtrace.grep(/#{Regexp.escape("nilavu")}/)
unless filtered_trace.empty?
full_stacktrace = (filtered_trace.map { |ft| ft.split('/').last }).join("\n")
logger.debug "\033[1m\033[36m#{full_stacktrace}\033[0m\033[22m"
end
logger.debug "\033[1m\033[32m..(*_*)...\033[0m"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show() end",
"def show() end",
"def show() end",
"def show\n puts \"******* show *******\"\n end",
"def show \r\n end",
"def show\n\t\t end",
"def show ; end",
"def show\n \n end",
"def show\n \n end",
"def show\n \n end",
"def show\n \n end",
"def show\n \n ... | [
"0.81558985",
"0.81558985",
"0.81558985",
"0.8053593",
"0.80379826",
"0.79141337",
"0.78567004",
"0.7651478",
"0.7651478",
"0.7651478",
"0.7651478",
"0.7651478",
"0.7651478",
"0.7651478",
"0.7651478",
"0.7651478",
"0.7634643",
"0.76279736",
"0.7588129",
"0.7373788",
"0.733984... | 0.0 | -1 |
Unloads the given classes from CLI::UI, reloads them and stubs the OS to the given one. This is used to run tests on classes with variables that depend on the OS (e.g. Glyph), so that we can mock their state in the context of this block. | def with_os_mock_and_reload(os, class_names = [], files = [])
class_names = Array(class_names)
files = Array(files)
CLI::UI::OS.stubs(:current).returns(os)
class_names.each { |classname| CLI::UI.send(:remove_const, classname) }
files.each { |file| load(file) }
yield
ensure
CLI::UI::OS.unstub(:current)
class_names.each { |classname| CLI::UI.send(:remove_const, classname) }
files.each { |file| load(file) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reload_classes\n klasses = [:Inject]\n\n # unload classes\n Object.class_eval do\n klasses.each do |klass|\n remove_const klass.to_s if const_defined? klass.to_s\n end\n end\n\n # reload classes\n klasses.each do |klass|\n load \"#{klass.to_s.underscore}.rb\"\n end\n ... | [
"0.62564576",
"0.56486017",
"0.54004097",
"0.53735065",
"0.53324556",
"0.5285842",
"0.5255584",
"0.52352035",
"0.5221185",
"0.5196356",
"0.5176559",
"0.513618",
"0.513618",
"0.50943863",
"0.50763613",
"0.5030562",
"0.5027552",
"0.5027265",
"0.4968354",
"0.49631885",
"0.494205... | 0.7662515 | 0 |
Tunes a robustness measure using a competitionconfigured REVAC tuner on a given benchmark function. | def tune(measure, output, benchmark = 'keijzer-15')
revac([
['Population', 10..200],
['Mutation', 0.0001..0.5],
['Crossover', 0.1..1.0],
['Tournament', 2..10],
['Elites', 0.0..0.5]
],
output: output,
) do |setup|
evolve(
silent: true,
population_size: setup['Population'],
length: 100,
evaluation_threads: 8,
breeding_threads: 8,
evaluation_limit: 10_000,
elites: (setup['Population'] * setup['Elites']).floor,
tournament_size: setup['Tournament'],
mutation_rate: setup['Mutation'],
crossover_rate: setup['Crossover'],
measure: measure,
benchmark: benchmark).fitness
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tune(*args)\n argv = to_pointer([\"tune\"] + args)\n rrd_tune(args.size+1, argv) == 0\n ensure\n free_pointers\n end",
"def benchmark\nend",
"def tune(&block)\n clone().tune!(&block)\n end",
"def tune!(&block)\n each do |tunable|\n if tunable.respond_to?... | [
"0.62501246",
"0.53007305",
"0.5112643",
"0.50479645",
"0.5001998",
"0.4955962",
"0.4900583",
"0.48360077",
"0.47854427",
"0.47474122",
"0.4713965",
"0.4713186",
"0.47036844",
"0.46684244",
"0.45923853",
"0.45652962",
"0.45559275",
"0.45552385",
"0.45340335",
"0.45242855",
"0... | 0.508651 | 3 |
GET /item_rankings GET /item_rankings.json | def index
@item_rankings = ItemRanking.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ranking(opts={})\r\n Rakuten::Request.get(\"https://app.rakuten.co.jp/services/api/IchibaItem/Ranking/20120927\", Rakuten::Api.merge(opts))\r\n end",
"def get_event_rankings ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}/rankings\"\n end",
"def set_item_ranking\n... | [
"0.72139746",
"0.6896911",
"0.6643657",
"0.659491",
"0.64716196",
"0.6453341",
"0.6373512",
"0.63703084",
"0.63243186",
"0.632234",
"0.62185717",
"0.6214583",
"0.6207837",
"0.62075925",
"0.620475",
"0.6160642",
"0.6150194",
"0.6080413",
"0.6069298",
"0.6030084",
"0.6011758",
... | 0.77147114 | 0 |
GET /item_rankings/1 GET /item_rankings/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @item_rankings = ItemRanking.all\n end",
"def ranking(opts={})\r\n Rakuten::Request.get(\"https://app.rakuten.co.jp/services/api/IchibaItem/Ranking/20120927\", Rakuten::Api.merge(opts))\r\n end",
"def set_item_ranking\n @item_ranking = ItemRanking.find(params[:id])\n end... | [
"0.7614627",
"0.72608393",
"0.6944169",
"0.665789",
"0.6580147",
"0.6436905",
"0.6402222",
"0.63420624",
"0.63035154",
"0.62454647",
"0.6224339",
"0.6220214",
"0.62070376",
"0.61939895",
"0.6190158",
"0.6139326",
"0.61081517",
"0.61016107",
"0.60966384",
"0.6087773",
"0.60854... | 0.0 | -1 |
POST /item_rankings POST /item_rankings.json | def create
@item_ranking = ItemRanking.new(item_ranking_params)
respond_to do |format|
if @item_ranking.save
format.html { redirect_to @item_ranking, notice: 'Item ranking was successfully created.' }
format.json { render :show, status: :created, location: @item_ranking }
else
format.html { render :new }
format.json { render json: @item_ranking.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @item_rankings = ItemRanking.all\n end",
"def item_ranking_params\n params.require(:item_ranking).permit(:rate, :item_id)\n end",
"def set_item_ranking\n @item_ranking = ItemRanking.find(params[:id])\n end",
"def post_search_rankings(date, expires_in: 1.minute)\n request(\"... | [
"0.68096066",
"0.6789939",
"0.6666405",
"0.6439185",
"0.63918465",
"0.62733364",
"0.6188241",
"0.61412334",
"0.6078728",
"0.6003345",
"0.5916057",
"0.59083617",
"0.58862156",
"0.5881707",
"0.58772343",
"0.58504343",
"0.5837703",
"0.58015203",
"0.5788694",
"0.5786926",
"0.5782... | 0.6901273 | 0 |
PATCH/PUT /item_rankings/1 PATCH/PUT /item_rankings/1.json | def update
respond_to do |format|
if @item_ranking.update(item_ranking_params)
format.html { redirect_to @item_ranking, notice: 'Item ranking was successfully updated.' }
format.json { render :show, status: :ok, location: @item_ranking }
else
format.html { render :edit }
format.json { render json: @item_ranking.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @item = Item.find(params[:id])\n if params[:item][:index]\n index = params[:item][:index]\n params[:item].delete :index\n @item.update_attribute :ranked_position, index\n end \n\n respond_to do |format|\n if @item.update_attributes(params[:item].slice(*Item.accessibl... | [
"0.68599015",
"0.66274136",
"0.6508496",
"0.6340348",
"0.63239443",
"0.62848413",
"0.62710446",
"0.62439257",
"0.61559725",
"0.6145884",
"0.60575366",
"0.5971054",
"0.5936134",
"0.59322625",
"0.59126186",
"0.58988595",
"0.58931506",
"0.58705455",
"0.58664817",
"0.5864502",
"0... | 0.71110916 | 0 |
DELETE /item_rankings/1 DELETE /item_rankings/1.json | def destroy
@item_ranking.destroy
respond_to do |format|
format.html { redirect_to item_rankings_url, notice: 'Item ranking was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @rank = Rank.find(params[:id])\n @rank.destroy\n\n respond_to do |format|\n format.html { redirect_to ranks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rankings = Rankings.find(params[:id])\n @rankings.destroy\n\n respond_to do |format|\n ... | [
"0.68501824",
"0.68422025",
"0.6840022",
"0.6770794",
"0.67589015",
"0.65938085",
"0.6571634",
"0.65698636",
"0.6538403",
"0.65367013",
"0.6523786",
"0.65098137",
"0.6484703",
"0.64690304",
"0.64682484",
"0.64209443",
"0.6415747",
"0.6407332",
"0.6360723",
"0.63552964",
"0.63... | 0.7505948 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_item_ranking
@item_ranking = ItemRanking.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 item_ranking_params
params.require(:item_ranking).permit(:rate, :item_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 |
def created_at I18n.l(object.created_at) if object.created_at end | def edit_path
"/answers/#{object.id}/edit"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_at\n I18n.l object.created_at\n end",
"def created_at\n formatted_time(object.created_at)\n end",
"def created_at\n formatted_time(object.created_at)\n end",
"def created_at\n formatted_time(object.created_at)\n end",
"def created_at\n formatted_time(object.created_at)\n end... | [
"0.9296421",
"0.8435211",
"0.8435211",
"0.8435211",
"0.8435211",
"0.8263993",
"0.82636976",
"0.81734043",
"0.81369704",
"0.8067361",
"0.79412645",
"0.7920489",
"0.78970414",
"0.7880418",
"0.7818646",
"0.7818646",
"0.7815767",
"0.7780171",
"0.7751934",
"0.7751934",
"0.7751934"... | 0.0 | -1 |
This allows us to support IE89 and their shimmed pseudoCORS support. This parses the post body as form data, even if the contenttype is text/plain or unknown. The issue is that IE89 will send POST data with an empty ContentType (see: Some Rails servers (Passenger) will treat this as nil, in which case Rack parses the post data as a form data (see: However, other Rails server (Puma) will default an empty ContentType as "text/plain", in which case Rack will not parse the post data (see: For this latter case of Rack servers, we will force parsing of our post body as form data so IE's form data is present on the rails "params" object. But even aside from these differences in Rack servers, this is probably a good idea, since apparently historically IE89 would actually send the data as "text/plain" rather than an empty contenttype. | def parse_post_for_pseudo_ie_cors
if(request.post? && request.POST.blank? && request.raw_post.present?)
params.merge!(Rack::Utils.parse_nested_query(request.raw_post))
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_form_data(request, params, sep = '&')\n request.body = params.map {|k,v|\n if v.instance_of?(Array)\n v.map {|e| \"#{urlencode(k.to_s)}=#{urlencode(e.to_s)}\"}.join(sep)\n else\n \"#{urlencode(k.to_s)}=#{urlencode(v.to_s)}\"\n end\n }.join(sep)\n\n request.content_type = 'application/... | [
"0.60795456",
"0.591431",
"0.59020835",
"0.58857805",
"0.5850121",
"0.5850121",
"0.5850121",
"0.5850121",
"0.5832998",
"0.57904124",
"0.56843203",
"0.5557801",
"0.55250865",
"0.55151635",
"0.5480747",
"0.54667395",
"0.5453187",
"0.5440593",
"0.54059327",
"0.5365653",
"0.53323... | 0.6961951 | 0 |
def index ar_friendships = current_user.friendships.where(status: 'accepted') friendships = ar_friendships.map do |ar_friend| friend = User.find( ar_friend.friend_id ) data = ar_friend.as_json data['friend_name'] = friend.username data end render json: friendships end | def index
@user = current_user
render json: @user.friends
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @friendships = @user.friendships\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @friendships }\n end\n end",
"def show_list_by_user_id\n @id = current_user.id\n @userfriendships = User.find(@id).friends\n if @userfriendships.empty?\... | [
"0.8320625",
"0.8054562",
"0.8018408",
"0.7982256",
"0.78971964",
"0.78971964",
"0.7773522",
"0.7728358",
"0.76968557",
"0.7679429",
"0.7648935",
"0.76224095",
"0.7606261",
"0.75727224",
"0.7572466",
"0.7570316",
"0.74314004",
"0.73649013",
"0.73437345",
"0.73317647",
"0.7323... | 0.8178186 | 1 |
2. In order to keep yourself organized, sort your zombie_apocalypse_supplies in alphabetical order. Do not use any special builtin methods. | def sorter(array)
loop do
switched = false
for i in 0...array.length - 1
if array[i].downcase > array[i + 1].downcase
array[i], array[i + 1] = array[i + 1], array[i]
switched = true
end
end
break if !switched
end
array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sort_zombies\n index = 0\n while index < @zombie_apocalypse_supplies.length\n index2 = index + 1\n while index2 < @zombie_apocalypse_supplies.length\n if @zombie_apocalypse_supplies[index2] < @zombie_apocalypse_supplies[index]\n @zombie_apocalypse_supplies[index], @zombie_apocalypse_supplies[index2] = ... | [
"0.67969924",
"0.6730859",
"0.6652333",
"0.65661055",
"0.638727",
"0.6244279",
"0.61923575",
"0.6168182",
"0.6152561",
"0.61156976",
"0.61000615",
"0.60661966",
"0.6055",
"0.6052632",
"0.60143054",
"0.6013267",
"0.6007428",
"0.5994213",
"0.59904367",
"0.597918",
"0.5953287",
... | 0.0 | -1 |
3. Create a method to see if a particular item (string) is in the zombie_apocalypse_supplies. Do not use any special builtin methods. For instance: are boots in your list of supplies? | def in_supplies?(string, supplies)
supplies.each do |item|
return true if item == string
end
false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_item(string)\n zombie_apocalypse_supplies = [\"hatchet\", \"rations\", \"water jug\", \"binoculars\",\n \"shotgun\", \"compass\", \"CB radio\", \"batteries\"]\n\n i = 0\n is_supply = false\n\n while i < zombie_apocalypse_supplies.length\n if zombie_apocalypse_supplies[... | [
"0.76571524",
"0.74470526",
"0.7132986",
"0.6896234",
"0.67134064",
"0.6694458",
"0.6544314",
"0.64940953",
"0.64900964",
"0.6433929",
"0.64124745",
"0.6289699",
"0.62678015",
"0.6266765",
"0.6216749",
"0.616886",
"0.6168236",
"0.6148342",
"0.6142186",
"0.6125588",
"0.6082959... | 0.76505107 | 1 |
4. You've heard that the following animals might be extinct, but you're not sure. Check if they're included in extinct_animals, one by one: "Andean Cat" "Dodo" "Saiga Antelope" Do not use any special builtin methods. | def check_extinct(animal, extinct_list)
if extinct_list[animal]
puts "#{animal} is extinct"
else
puts "#{animal} is not extinct"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_extinct_animal(animal)\n extinct_animals = {\n \"Tasmanian Tiger\" => 1936,\n \"Eastern Hare Wallaby\" => 1890,\n \"Dodo\" => 1662,\n \"Pyrenean Ibex\" => 2000,\n \"Passenger Pigeon\" => 1914,\n \"West African Black Rhinoceros\" => 2011,\n \"Laysan Crake\" => 1923\n }\n in_list = false\n extinct_... | [
"0.7414375",
"0.6663922",
"0.66616917",
"0.64059746",
"0.63151616",
"0.62521374",
"0.622866",
"0.6140318",
"0.61202025",
"0.61101234",
"0.61020046",
"0.60617363",
"0.6060068",
"0.60401064",
"0.6006544",
"0.5924958",
"0.588766",
"0.58550495",
"0.579571",
"0.57668453",
"0.57620... | 0.7974839 | 0 |
5. We just found out that the Passenger Pigeon is actually not extinct! Remove them from extinct_animals and return the key value pair as a two item array. Find the builtin method that helps you accomplish this in the Ruby documentation for Hashes. Haven't quite figured out what method to use, so here are a couple ways. The shift method returns an array and gets rid of an item, but it drops items from the array in the order they were entered, making it difficult to use. | def delete_hash_item(hash, item)
[item, hash.delete(item)]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_some(species)\n p @extinct_animals.key(species)\n small_array = []\n small_array << @extinct_animals[species]\n small_array << @extinct_animals.key(@extinct_animals[species])\n @extinct_animals.delete(species)\n p small_array\n p @extinct_animals\nend",
"def vegetarian_ingredients\n vegetari... | [
"0.7259498",
"0.62406546",
"0.60775775",
"0.59675676",
"0.5957783",
"0.58576685",
"0.583439",
"0.5779126",
"0.5751515",
"0.56938607",
"0.56671834",
"0.5571456",
"0.55406237",
"0.54597014",
"0.5445142",
"0.5441025",
"0.54053646",
"0.5386598",
"0.5356065",
"0.53402543",
"0.5336... | 0.51448977 | 37 |
GET /items GET /items.json | def index
@galleries = Gallery.all.order(updated_at: :desc)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @items = Item.find(params[:id])\n render json: @items\n end",
"def items\n\t\tresponse = self.get('items').body\n\t\titems = JSON.parse(response)\n\t\tparse_items(items)\n\t\treturn items\n\tend",
"def getItems()\n return mergeWithAPI(@item_json)['data']\n end",
"def index\n @items =... | [
"0.79562956",
"0.7546286",
"0.74375594",
"0.7434485",
"0.73975587",
"0.7358414",
"0.7358414",
"0.7358414",
"0.7358414",
"0.7357372",
"0.7313286",
"0.73129123",
"0.7311041",
"0.7306297",
"0.7281173",
"0.7273615",
"0.72629416",
"0.72484964",
"0.72301924",
"0.71767205",
"0.71181... | 0.0 | -1 |
GET /items/1 GET /items/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @items = Item.find(params[:id])\n render json: @items\n end",
"def get_item( item )\n @session.base_url = \"http://cl.ly\"\n resp = @session.get( \"/\" + item )\n \n raise ItemNotFound if resp.status == 404\n Crack::JSON.parse(resp.body)\n end",
"def show\n item = I... | [
"0.7736526",
"0.7547988",
"0.74948645",
"0.73696035",
"0.7328169",
"0.7293223",
"0.7287578",
"0.71326286",
"0.71247333",
"0.71196556",
"0.70882183",
"0.70882183",
"0.70882183",
"0.70882183",
"0.70882183",
"0.70882183",
"0.70882183",
"0.70882183",
"0.70882183",
"0.70882183",
"... | 0.0 | -1 |
ID of the post to moderate. | def postId(value)
merge(mppostId: value.to_s)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postid\n warn \"Post#postid is deprecated, use #id.\"\n @id\n end",
"def id\n @permalink.to_i\n end",
"def id\n object.id.to_i\n end",
"def get_id\n return @m_id\n end",
"def get_id\n return @m_id\n end",
"def get_id\n return @m_... | [
"0.669737",
"0.6517807",
"0.64840883",
"0.6298702",
"0.6298702",
"0.6298702",
"0.6298702",
"0.6298702",
"0.6209405",
"0.6131683",
"0.61081016",
"0.61067784",
"0.6075176",
"0.6075176",
"0.6075176",
"0.6075176",
"0.6075176",
"0.6075176",
"0.6075176",
"0.6074271",
"0.6074271",
... | 0.61776024 | 9 |
A "csrf" token retrieved from action=query&meta=tokens | def token(value)
merge(token: value.to_s)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auth_csrf_token\n request.env['HTTP_X_AUTH_CSRF']\n end",
"def submitted_csrf_token\n request.env['HTTP_X_CSRF_TOKEN'] || params['csrf_token']\n end",
"def csrf_token\n env[\"rack.session\"].fetch(:csrf)\nend",
"def get_token\r\n render :text => form_authenticity_token\r\n end",
"def form_... | [
"0.76965046",
"0.7482129",
"0.73197687",
"0.72848094",
"0.7279598",
"0.7269601",
"0.7264029",
"0.7212866",
"0.71556115",
"0.7143424",
"0.7088392",
"0.705316",
"0.7050594",
"0.70502067",
"0.69997543",
"0.69603556",
"0.69457924",
"0.69173896",
"0.6896466",
"0.6849962",
"0.68107... | 0.0 | -1 |
post count starts at zero | def initialize(name)
@name = name
@posts = []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count\n @count ||= 0\n @count += 1\n end",
"def count\n @count ||= 0\n end",
"def count\n @count ||= 1\n end",
"def count\n @count ||= 1\n end",
"def count; end",
"def count; end",
"def count; end",
"def count=(_); end",
"def incr_count\n @count ||= 0\n @c... | [
"0.7164659",
"0.7058399",
"0.6913796",
"0.6913796",
"0.6865817",
"0.6865817",
"0.6865817",
"0.68605036",
"0.6843266",
"0.6815536",
"0.6811142",
"0.6769491",
"0.66626704",
"0.66369903",
"0.6527764",
"0.6524079",
"0.65183246",
"0.6477224",
"0.64763063",
"0.6467334",
"0.64608836... | 0.0 | -1 |
Handles rendering a supervision in a JSON format. | def as_json(options={})
super(:except => [:created_at, :updated_at])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @supervision }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @supervisions }\n end\n end",
"def show\n @sup... | [
"0.74281067",
"0.65581053",
"0.62701476",
"0.6249636",
"0.62112844",
"0.6163874",
"0.59432524",
"0.5941447",
"0.5926862",
"0.5881658",
"0.5865245",
"0.5840141",
"0.5829089",
"0.5826787",
"0.58171767",
"0.5811964",
"0.5792604",
"0.5783711",
"0.57638645",
"0.5761546",
"0.574854... | 0.0 | -1 |
O(n) T | O(d) S | def validate_bst(tree)
return validate_bst_helper(tree, - 1.0 / 0, 1.0 / 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tdist(n, t); p_t(n, t); end",
"def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend",
"def my_min_2(list)\r\n min = 0 # O(1)\r\n \r\n list.each do |ele| # O(n) \... | [
"0.6304019",
"0.5958798",
"0.5924932",
"0.58728",
"0.57460773",
"0.57429856",
"0.57397467",
"0.57093406",
"0.56450105",
"0.55833066",
"0.5575761",
"0.5527193",
"0.55133045",
"0.5503797",
"0.5470678",
"0.546242",
"0.54599816",
"0.54362386",
"0.5425811",
"0.54215616",
"0.541310... | 0.0 | -1 |
prints the current board representation based on the board argument passed to the method. | def display_board(board)
puts " #{board[0]} | #{board[1]} | #{board[2]} "
puts "-----------"
puts " #{board[3]} | #{board[4]} | #{board[5]} "
puts "-----------"
puts " #{board[6]} | #{board[7]} | #{board[8]} "
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def board_display\n puts @board\n end",
"def print_board\n\t\tputs \"**********************************\"\n\t\tputs \"| ♔ ♚ ♕ ♛ ♖ ♜ ♗ ♝ ♘ ♞ ♙ ♟ |\"\n\t\tputs \"| Actual board |\"\n\t\tputs \"| ♔ ♚ ♕ ♛ ♖ ♜ ♗ ♝ ♘ ♞ ♙ ♟ |\"\n\t\tputs \"**********************************\"\n\t\t@b... | [
"0.79762095",
"0.7961041",
"0.7850163",
"0.7830224",
"0.77970105",
"0.77723324",
"0.77574736",
"0.7750442",
"0.7749698",
"0.7729775",
"0.7729775",
"0.7720683",
"0.77164155",
"0.7713858",
"0.7696231",
"0.7676611",
"0.76706195",
"0.7657999",
"0.761952",
"0.7613198",
"0.76105195... | 0.7608023 | 57 |
This method takes the user_input (which is a string), converts it to an Integer, and subtracts 1. Remember that, from the player's point of view, the board contains spaces 19. But, an array's indexes start their count at 0. | def input_to_index(string)
string.to_i - 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input_to_index(user_input)\n #take the user's input (\"1\"-\"9\") and convert it to the index of the board array (0-8)\n user_input.to_i - 1\nend",
"def input_to_index(user_input) #this method converts the user_input into the 0-8 index, AKA the position on the board\n user_input = user_input.to_i # assi... | [
"0.78960943",
"0.7826286",
"0.74544096",
"0.7431199",
"0.7286725",
"0.7238844",
"0.7225308",
"0.7225308",
"0.7222447",
"0.7168779",
"0.71601224",
"0.71535516",
"0.71535516",
"0.71535516",
"0.71535516",
"0.71535516",
"0.71535516",
"0.71535516",
"0.71501267",
"0.7143049",
"0.71... | 0.0 | -1 |
The move method must take in three arguments: 1) the board array, 2) the index in the board array that the player would like to fill out with an "X" or and "O", and 3) the player's character (either "X" or "O") | def move(board, index, token)
board[index] = token
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move(board, pos, character= \"X\")\n update_array_at_with(board, pos, character)\nend",
"def move(board, index, char=\"X\")\n update_array_at_with(board, index, char)\nend",
"def move(index, character = \"X\")\n if character == \"X\"\n @board[index] = \"X\"\n else character == \"O\"\n @board[inde... | [
"0.8451088",
"0.84379804",
"0.84116673",
"0.83274084",
"0.8138006",
"0.8136709",
"0.8136709",
"0.8089857",
"0.8082982",
"0.8071937",
"0.8059457",
"0.8056691",
"0.80551404",
"0.80174303",
"0.80174303",
"0.79803073",
"0.79719746",
"0.79702276",
"0.7937695",
"0.7925747",
"0.7925... | 0.0 | -1 |
The position_taken? method will be responsible for evaluating the position selected by the user against the Tic Tac Toe board and checking to see whether or not that index on the board array is occupied. If the user would like to fill out position 1, our position_taken? method will check to see if that board index is vacant or if it contains an "X" or an "O". If the position is free, the method should return false (i.e. "not taken"), otherwise it will return true. | def position_taken?(board, index)
!(board[index] == " ")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position_taken?(board, index_to_validate)\n if (board[index_to_validate] == \"X\" || board[index_to_validate] == \"O\")\n return true\n end\n return false # NOTE: if we arrive here, the position is definitely not taken\nend",
"def position_taken?(board, position)\n\tif board[position] == \"X\" || board... | [
"0.8526672",
"0.84849024",
"0.839655",
"0.839057",
"0.8375734",
"0.8375464",
"0.83750993",
"0.83741343",
"0.83688176",
"0.8368408",
"0.83604836",
"0.83565575",
"0.8352992",
"0.8352408",
"0.8351627",
"0.8351627",
"0.8351627",
"0.8341422",
"0.83377767",
"0.83377767",
"0.8334120... | 0.0 | -1 |
valid_move? that accepts a board and an index to check and returns true if the move is valid and false or nil if not. A valid move means that the submitted position is: Present on the game board. Not already filled with a token. | def valid_move?(board, index)
index.between?(0,8) && !position_taken?(board, index)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_move?(board, index)\n if !position_taken?(board, index) && index.between?(0, 8)\n return true\n else\n return false\n end\n end",
"def valid_move?(index)\n return index.between?(0, @board.length) && !position_taken?(index)\n end",
"def valid_move?(board, index)\n ... | [
"0.8505138",
"0.84543043",
"0.8426177",
"0.8418295",
"0.84067327",
"0.84067327",
"0.84055996",
"0.8384689",
"0.8324645",
"0.8324278",
"0.8310018",
"0.83082736",
"0.8291126",
"0.82787526",
"0.8274865",
"0.82720435",
"0.82631874",
"0.8262681",
"0.825679",
"0.82546675",
"0.82520... | 0.81943357 | 52 |
The turn method to encapsulate the logic of a single complete turn composed of the following routine: Asking the user for their move by position 19. Receiving the user input. Convert user input to an index If the move is valid, make the move and display board. Otherwise (that is, if the move is invalid) ask for a new position until a valid move is received. | def turn(board)
puts "Please enter 1-9:"
input = gets.strip
index = input_to_index(input)
if valid_move?(board, index)
move(board, index, current_player(board))
display_board(board)
else
turn(board)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn\n puts \"Please enter 1-9:\"\n user_input = gets.strip\n index = input_to_index(user_input)\n\n until valid_move?(index)\n puts \"Invalid Move! Try again.\"\n user_input = gets.strip\n index = input_to_index(user_input)\n\n end\n\n move(index, current_player)\n display_... | [
"0.8608871",
"0.8596559",
"0.8555808",
"0.851743",
"0.8495549",
"0.84456897",
"0.8438181",
"0.843552",
"0.8414887",
"0.8399469",
"0.8386477",
"0.83759624",
"0.83736163",
"0.83721715",
"0.8361765",
"0.83487695",
"0.8343105",
"0.83378714",
"0.832018",
"0.8319918",
"0.83193827",... | 0.82282734 | 49 |
TURN_COUNT method takes in an argument of the board array and returns the number of turns that have been played. | def turn_count(board)
9 - board.count(" ")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_count\n turns_played = 0\n @board.each do |index|\n if index != \" \"\n turns_played += 1\n end\n end\n return turns_played\n end",
"def turn_count(board)\n count = 0\n board.each do |index|\n index == \"X\" || index == \"O\" ? count += 1 : nil\n end\n return... | [
"0.82278633",
"0.82011276",
"0.81168574",
"0.8108692",
"0.8106988",
"0.80936605",
"0.80549985",
"0.8042444",
"0.7993852",
"0.7951233",
"0.7926986",
"0.79252887",
"0.79160446",
"0.7910684",
"0.7906576",
"0.79058975",
"0.7890611",
"0.788665",
"0.7879151",
"0.78774714",
"0.78696... | 0.7480153 | 68 |
The current_player method should take in an argument of the game board and use the turn_count method to determine if it is "X"'s turn or "O"'s. | def current_player(board)
if turn_count(board) % 2 == 0
return "X"
else
return "O"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_player(board)\n if turn_count(board) == 0\n return \"X\"\n elsif\n turn_count(board) % 2 == 0 \n return \"X\"\n else\n return \"O\"\n end \n end",
"def current_player(board)\n if turn_count(board) == 0\n return \"X\"\n elsif\n turn_count(board) % 2 == ... | [
"0.84786737",
"0.84786737",
"0.8466685",
"0.84314495",
"0.83208543",
"0.8316863",
"0.8305818",
"0.83050823",
"0.8304052",
"0.8297651",
"0.8292477",
"0.82897115",
"0.82812065",
"0.827316",
"0.8267978",
"0.8243465",
"0.82433254",
"0.8232037",
"0.8232037",
"0.82221013",
"0.82142... | 0.8313999 | 9 |
The won? method should accept a board as an argument and return false/nil if there is no win combination present in the board and return the winning combination indexes as an array if there is a win. Use your WIN_COMBINATIONS constant in this method. | def won?(board)
WIN_COMBINATIONS.detect do |win_combination|
board[win_combination[0]] == board[win_combination[1]] &&
board[win_combination[1]] == board[win_combination[2]] &&
position_taken?(board, win_combination[0])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def won?(board)\n WIN_COMBINATIONS.each do |win_combo|\n # win_combo is a 3 element array of indexes that compose a win, [0,1,2]\n if (board[win_combo[0]] == \"X\" && board[win_combo[1]] == \"X\" && board[win_combo[2]] == \"X\") || (board[win_combo[0]] == \"O\" && board[win_combo[1]] == \"O\" && board[win_c... | [
"0.8657385",
"0.85791206",
"0.85038006",
"0.8452536",
"0.84206885",
"0.8370301",
"0.83383644",
"0.8332746",
"0.8322734",
"0.8317341",
"0.8316779",
"0.8312901",
"0.8308399",
"0.83080846",
"0.83041096",
"0.8293366",
"0.8279045",
"0.82721007",
"0.82705444",
"0.82700896",
"0.8270... | 0.8164956 | 42 |
The full? method should accept a board and return true if every element in the board contains either an "X" or an "O". | def full?(board)
board.all? {|token| token == "X" || token == "O"}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full?(board)\n return board.all?{|pos| pos == \"X\" or pos == \"O\"}\nend",
"def full?(board)\n board.all? { |element| element == \"X\" || element == \"O\" }\nend",
"def full?(board)\n board.all? { |element| element == \"X\" || element == \"O\" }\nend",
"def full?\n return @board.all?{|pos| pos == ... | [
"0.9203483",
"0.9185957",
"0.9185957",
"0.91543627",
"0.9152987",
"0.91484094",
"0.9135577",
"0.9117472",
"0.91044116",
"0.91022855",
"0.91022855",
"0.9096866",
"0.90910214",
"0.90864134",
"0.9081597",
"0.90703386",
"0.9062306",
"0.90579534",
"0.90579534",
"0.9057175",
"0.905... | 0.8867422 | 50 |
The draw? method accepts a board and returns true if the board has not been won and is full and false if the board is not won and the board is not full, and false if the board is won. | def draw?(board)
full?(board) && !won?(board)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw?(board)\n !won?(board) && full?(board)\n end",
"def draw?(board)\n\tif won?(board) == nil && full?(board) == true\n\t\treturn true\n\tend\nend",
"def draw?(board)\n if (full?(board) == false)\n return false\n else\n if (won?(board) != false)\n return false\n ... | [
"0.9141344",
"0.91146857",
"0.9068307",
"0.90463865",
"0.9043717",
"0.89918077",
"0.8976751",
"0.89671713",
"0.89663404",
"0.8943543",
"0.89424855",
"0.8942481",
"0.8936074",
"0.8924374",
"0.8922912",
"0.8922368",
"0.8922368",
"0.8917582",
"0.8917582",
"0.8917528",
"0.8917528... | 0.8743311 | 72 |
The over? method accepts a board and returns true if the board has been won, is a draw, or is full. | def over?(board)
won?(board) || draw?(board) || full?(board)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def over?(board)\n \n if draw?(board) || won?(board) || full?(board)\n return true\n else\n return false\n end\n \n end",
"def over?(board)\n if draw?(@board) || won?(@board) || full?(@board)\n return true\n else\n return false\n ... | [
"0.9117715",
"0.9112874",
"0.8993075",
"0.8949392",
"0.88605803",
"0.88359046",
"0.8834621",
"0.881869",
"0.87903684",
"0.8777798",
"0.87561506",
"0.87407374",
"0.87400484",
"0.8724917",
"0.87218463",
"0.87218463",
"0.87170386",
"0.8713818",
"0.8713818",
"0.8712674",
"0.87126... | 0.8383509 | 76 |
The winner method should accept a board and return the token, "X" or "O" that has won the game given a winning board. | def winner(board)
if win_combo = won?(board)
board[win_combo.first]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def winner\n if won?\n win_combination = won?\n token = @board[win_combination[0]]\n return token\n end\n end",
"def winner(board)\n token = nil\n if won?(board) != nil\n win_combo = won?(board)\n token = board[win_combo[0]]\n end\n token\nend",
"def winner(board)\n array... | [
"0.8829854",
"0.87633127",
"0.8724141",
"0.8683814",
"0.8668035",
"0.85436386",
"0.84791714",
"0.83705217",
"0.8370031",
"0.8340156",
"0.829",
"0.82881254",
"0.82499856",
"0.82462186",
"0.8171036",
"0.8134459",
"0.81268215",
"0.8117349",
"0.81155443",
"0.8089268",
"0.8038917"... | 0.0 | -1 |
sends the user on a trip to the provider, and after authorizing there back to the callback url. | def oauth
puts '*'*50
puts session[:category]
session[:category] = nil
session[:category] = params[:category]
puts '*'*50
puts session[:category]
login_at(auth_params[:provider])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def callback\n # evernote returns a verifier if user authorized the app\n oauth_verifier = params[:oauth_verifier]\n if oauth_verifier\n consumer = get_consumer\n request_token = OAuth::RequestToken.new(consumer, flash[:request_token], flash[:request_secret])\n # contains the real token, us... | [
"0.59293056",
"0.57702553",
"0.5762782",
"0.5760852",
"0.5755574",
"0.57312137",
"0.5668285",
"0.56649506",
"0.56614506",
"0.56591713",
"0.5643107",
"0.5623813",
"0.5622648",
"0.56012",
"0.5595962",
"0.5586331",
"0.55531394",
"0.55484146",
"0.55458987",
"0.5544393",
"0.552978... | 0.0 | -1 |
find rebound of that player | def most_points_scored
most_points = 0
name = nil
game_hash.each { |keys, values|
i = 0
while i < game_hash[keys][:players].length do
if game_hash[keys][:players][i][:points] > most_points
most_points = game_hash[keys][:players][i][:points]
name = game_hash[keys][:players][i][:player_name]
end
i += 1
end
}
name
# binding.pry
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def most_rebound(player_name)\r\n game_hash.each do |team, data|\r\n data.each do |team_info, value|\r\n if team_info == \"players\".to_sym\r\n value.each do |player, detail|\r\n if player == player_name\r\n return detail[:rebounds]\r\n end\r\n end\r\n ... | [
"0.68288803",
"0.63347274",
"0.58970165",
"0.58707523",
"0.5655602",
"0.5622745",
"0.56023425",
"0.55962133",
"0.5589982",
"0.55702317",
"0.55622727",
"0.55404174",
"0.5518541",
"0.55054986",
"0.5494978",
"0.54911596",
"0.54876995",
"0.54830277",
"0.54642177",
"0.54590374",
"... | 0.0 | -1 |
, :avatar_file_name, :avatar_content_type, :avatar_file_size | def to_s
self.name.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avatar_file\n @attributes[:avatar_file]\n end",
"def avatar_filename\n if avatar_content_type == 'image/jpeg'\n self.avatar_file_name = 'avatar.jpg' if avatar.present?\n end\n end",
"def avatar\n if object.dp.present?\n k = object.dp.url.gsub('upload','upload/g_face,c_thumb,w_15... | [
"0.7660123",
"0.74463683",
"0.7426824",
"0.72244054",
"0.7082309",
"0.7080101",
"0.7080101",
"0.7045468",
"0.7022466",
"0.70139414",
"0.70052165",
"0.6988886",
"0.684772",
"0.684772",
"0.6771377",
"0.67678785",
"0.67598265",
"0.67598265",
"0.6741655",
"0.6741655",
"0.6741655"... | 0.0 | -1 |
Activates the user in the database. | def activate
@activated = true
self.activated_at = Time.now.utc
self.activation_code = nil
save(false)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def activate\r\n Marketplace::Database.instance.delete_deactivated_user(self)\r\n Marketplace::Database.instance.add_user(self)\r\n Marketplace::Activity.create(Activity.USER_REACTIVATE, self, \"#{self.name} has been reactivated\")\r\n end",
"def activate_user(user_id)\n post(\"/users/#{us... | [
"0.7746603",
"0.77337503",
"0.750554",
"0.74590904",
"0.7389596",
"0.73547816",
"0.7308838",
"0.72856855",
"0.7264758",
"0.72618395",
"0.7260988",
"0.7222055",
"0.72197217",
"0.7215781",
"0.72018164",
"0.7118911",
"0.7095531",
"0.70851445",
"0.7053755",
"0.704818",
"0.703194"... | 0.66916156 | 58 |
Returns true if the user has just been activated. | def recently_activated?
@activated
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def activated?\n self.user && self.user.activated?\n end",
"def recently_activated?\n @activated\n end",
"def recently_activated?\n @activated\n end",
"def recently_activated?\n @activated\n end",
"def recently_activated?\n @activated\n end",
"def recently_... | [
"0.82776856",
"0.7811329",
"0.7804574",
"0.7778738",
"0.7778738",
"0.77549386",
"0.77341413",
"0.7729316",
"0.7685652",
"0.76716274",
"0.7668748",
"0.7614284",
"0.759112",
"0.75275487",
"0.7495403",
"0.74625885",
"0.73862773",
"0.73260075",
"0.72826624",
"0.7257669",
"0.71833... | 0.76535165 | 64 |
Encrypts the password with the user salt | def encrypt(password)
self.class.encrypt(password, salt)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encrypt_password\n self.salt = make_salt unless has_password?(password)\n self.encrypted_password = encrypt(password)\n end",
"def encrypt_password\n self.salt = make_salt unless has_password?(password)\n self.encrypted_password = encrypt(password)\n end",
"def encrypt_password\n ... | [
"0.8456656",
"0.83809954",
"0.837295",
"0.83666867",
"0.8361271",
"0.83577955",
"0.83577955",
"0.83577955",
"0.83577955",
"0.83577955",
"0.83577955",
"0.83539045",
"0.8353123",
"0.83147633",
"0.8314556",
"0.83011955",
"0.82853645",
"0.8279242",
"0.8253498",
"0.82321554",
"0.8... | 0.0 | -1 |
These create and unset the fields required for remembering users between browser closes | def remember_me
remember_me_for 2.weeks
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forgets\n update_attribute(:remember_digest, nil)\n end",
"def after_save\n cookies['global_properties_for_user'] = nil\n end",
"def forget\n \tupdate_attribute(:remember_digest, nil)\n end",
"def forget\n \tupdate_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:... | [
"0.6560162",
"0.6457634",
"0.6432463",
"0.6432463",
"0.6318209",
"0.6318103",
"0.62973624",
"0.62973624",
"0.6265811",
"0.6265811",
"0.6265811",
"0.6265811",
"0.6265811",
"0.6265811",
"0.6265811",
"0.6265811",
"0.6265811",
"0.6265811",
"0.6265811",
"0.6265811",
"0.6265811",
... | 0.0 | -1 |
it needs to point the station which one goes before inserting | def add(station, previous_station = @stations.first)
previous_station != @stations.last ? @stations.insert(@stations.index(previous_station) + 1, station) : @stations.insert(-1, station)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_station(station)\n @stations.insert(-2, station)\n end",
"def add_station(station)\n @stations.insert(-2, station)\n end",
"def data_add_stations\n @routes[0].stations.insert(-2, @stations[1])\n @routes[0].stations.insert(-2, @stations[2])\n @routes[2].stations.insert(-2, @stations[1])... | [
"0.7227804",
"0.7227804",
"0.6674007",
"0.6367138",
"0.6365781",
"0.635653",
"0.63213503",
"0.6233224",
"0.6160552",
"0.613165",
"0.6079586",
"0.602257",
"0.59271026",
"0.5897214",
"0.5871579",
"0.58498687",
"0.5841334",
"0.5810642",
"0.5800033",
"0.579762",
"0.5794555",
"0... | 0.61718875 | 8 |
Using this information, update the method from the previous exercise to determine leap years both before and after 1752. | def jul_leap_year? year
if year < 1752
return year % 4 == 0 ? true : false
else
return year % 4 == 0 && year % 100 != 0 || year % 400 == 0 ? true : false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def leap_year?(yr1)\r\n if yr1 % 4 > 0\r\n false\r\n elsif yr1 % 100 == 0\r\n if yr1 % 400 == 0\r\n true\r\n else\r\n false\r\n end\r\n elsif yr1 % 4 == 0\r\n true\r\n end\r\nend",
"def setleap ( year )\n if year % 4 == 0\n\tif year % 100 == 0 && year % 400 != 0\n\t return 0\n\... | [
"0.74418944",
"0.7415891",
"0.7319638",
"0.72576386",
"0.7203976",
"0.7195291",
"0.71788865",
"0.7176745",
"0.7148393",
"0.7148393",
"0.71451193",
"0.7135654",
"0.7105061",
"0.70904833",
"0.70721126",
"0.7070879",
"0.7062641",
"0.70473015",
"0.7042878",
"0.704012",
"0.7029154... | 0.0 | -1 |
Funcion que muesta todos los carreras | def index
@careers = Career.all
json_response(@careers)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mi_carrera\n\n\tend",
"def mostrar_candidatos\n \n puts \" \"\n puts \"Quantidade de votos por candidato\"\n #Buca o candidato em seu array\n for candidato in @candidato\n candidato.mostrar_dados \n end \n end",
"def metodos_con(letras,*clase) # p... | [
"0.64290315",
"0.6262794",
"0.61632997",
"0.61270785",
"0.6123356",
"0.61075324",
"0.6084273",
"0.6069779",
"0.6044364",
"0.60384524",
"0.59475917",
"0.59234226",
"0.5877913",
"0.58163834",
"0.58051646",
"0.57996494",
"0.5706206",
"0.5689119",
"0.5651908",
"0.56518",
"0.56489... | 0.0 | -1 |
Funcion que crea una carrera | def create
@careers = Career.create!(career_params)
json_response(@careers, :created)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mi_carrera\n\n\tend",
"def construct\n end",
"def new\n\t\t# Aqui criamos o Carrinho de Compras se ele não existir...\n\t\tif !defined?($CarrinhoCompras)\n\t\t\t$CarrinhoCompras = Array.new()\n\t\tend\n\t\tif !defined?($CarrinhoComprasQuant)\n\t\t\t$CarrinhoComprasQuant = Array.new()\n\t\tend\t\n\t\tcreat... | [
"0.66981983",
"0.63249755",
"0.60816807",
"0.6036803",
"0.60011715",
"0.5916946",
"0.5891921",
"0.5866804",
"0.58414745",
"0.581946",
"0.5815478",
"0.5774177",
"0.5707868",
"0.56830394",
"0.5644938",
"0.56369644",
"0.56100994",
"0.56034344",
"0.560286",
"0.55972624",
"0.55947... | 0.0 | -1 |
Funcion que actualiza una carrera | def update
@career.update(career_params)
head :no_content
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mi_carrera\n\n\tend",
"def reiniciar\n reset()\n @mapaactual=@mapainicio\n\n end",
"def actualizar\n if toca_actualizar\n actualizar_privado\n end\n end",
"def resale\n\n end",
"def retire\n\n end",
"def suivre; end",
"def reloader; end",
"def reloader; end",
"def... | [
"0.6359018",
"0.60772717",
"0.601708",
"0.59349114",
"0.58886826",
"0.58754224",
"0.58030057",
"0.58030057",
"0.5717422",
"0.5707183",
"0.5703251",
"0.5675398",
"0.5665818",
"0.56107634",
"0.55878246",
"0.55876505",
"0.55697656",
"0.55674773",
"0.55486244",
"0.55232656",
"0.5... | 0.0 | -1 |
Funcion que muestra una carrera | def show
json_response(@career)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mi_carrera\n\n\tend",
"def suivre; end",
"def calculCouleur(cellule,clique)\n #Gestion du clique gauche\n if clique == CLIQUEGAUCHE\n couleur = cellule.clicGauche\n #Gestion duclique droit\n elsif clique == CLIQUEDROIT\n couleur = cellule.clicDroit\n #Aucune gestion pour tout les a... | [
"0.7728873",
"0.67343265",
"0.6128712",
"0.60268486",
"0.60006225",
"0.59697074",
"0.5958855",
"0.5958855",
"0.5958855",
"0.59134716",
"0.58328086",
"0.5814186",
"0.57840705",
"0.57750493",
"0.5774857",
"0.5761336",
"0.5761336",
"0.57350737",
"0.57063735",
"0.56769466",
"0.56... | 0.0 | -1 |
Funcion que elimina una carrera | def destroy
if @career.destroy!
render json: {"status" => "exito", "message" => "La carrera fue eliminada"}
else
render json: {"status" => "error", "message" => @career.errors}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove!; end",
"def eliminar_una_venta(venta)\n venta[:size]-=1\n nodo = venta[:tope]\n venta[:tope] = venta[:siguiente]\n nodo = nil\nend",
"def eliminar_elem_arr(arreglo, index)\n arreglo[index] = nil\n arreglo.delete(nil)\n arreglo\nend",
"def eliminar_ult_elem_arr(arreg... | [
"0.6733753",
"0.66934186",
"0.6682975",
"0.66819733",
"0.66071963",
"0.66071963",
"0.66071963",
"0.66071963",
"0.652752",
"0.6496636",
"0.6479356",
"0.64297146",
"0.6427939",
"0.6362485",
"0.63386315",
"0.6294033",
"0.6255417",
"0.60982376",
"0.6089257",
"0.6076226",
"0.60671... | 0.0 | -1 |
Funcion que define los parametros aceptados por una carrera | def career_params
params.permit(:name, :faculty_id, :status)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parameters=(_arg0); end",
"def _wrap_parameters(parameters); end",
"def parameters=(_); end",
"def params(*); {}; end",
"def parse_parameters; end",
"def params=(_); end",
"def params=(_arg0); end",
"def params=(_arg0); end",
"def parameterize(value); end",
"def methodWithParams nombre,apelli... | [
"0.6809679",
"0.67680997",
"0.665134",
"0.6647029",
"0.663183",
"0.658595",
"0.65735614",
"0.65735614",
"0.64999294",
"0.6478262",
"0.64532554",
"0.64532554",
"0.6387156",
"0.6387156",
"0.6387156",
"0.6387156",
"0.6387156",
"0.6387156",
"0.6387156",
"0.6387156",
"0.6387156",
... | 0.0 | -1 |
Funcion que setea una carrera especifica | def set_career
@career = Career.find(params[:id], params[:faculty_id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_inventario\n end",
"def mi_carrera\n\n\tend",
"def preencher\n nome.set 'leticia'\n \n end",
"def setting; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def suivre; end",
"def initialize(nombre, carrera)\n # se ejecuta el consutr... | [
"0.6720751",
"0.6632958",
"0.6326215",
"0.6216483",
"0.61355674",
"0.61355674",
"0.61355674",
"0.61355674",
"0.6096511",
"0.6035367",
"0.6031021",
"0.6002711",
"0.5994535",
"0.59926784",
"0.59926784",
"0.59893304",
"0.5968279",
"0.59663963",
"0.5902867",
"0.5887337",
"0.58872... | 0.0 | -1 |
=begin def view_checksum_detail(checksum_detail:) last = checksum_detail.checksum.nil? if last && checksum_detail.last_checksum ret = checksum_detail.last_checksum else last = false ret = checksum_detail end [ret, last] end =end | def view_discovery_detail(discovery_detail:) #todo cris test this!!
last = discovery_detail.hl7_message.nil?
if last && discovery_detail.last_discovery
ret = discovery_detail.last_discovery
else
last = false
ret = discovery_detail
end
[ret, last]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checksum_trailer\n fil_trailer[:checksum]\n end",
"def checksum\n fil_header[:checksum]\n end",
"def specified_checksum\n @resource[:checksum]\n end",
"def checksums; end",
"def checksum\n end",
"def checksum\n self[:ip_sum]\n end",
"def inspect_details\n\t\t\tretur... | [
"0.6387454",
"0.62568676",
"0.6142638",
"0.61165273",
"0.6052294",
"0.60317934",
"0.5944898",
"0.5883598",
"0.5753363",
"0.5709842",
"0.56965464",
"0.56615293",
"0.5656124",
"0.5654116",
"0.5634257",
"0.56115437",
"0.55311686",
"0.5518896",
"0.551615",
"0.5502455",
"0.5481947... | 0.6200752 | 2 |
Use callbacks to share common setup or constraints between actions. | def set_post
@post = Blogelator::Post.find_by_slug(params[:id])
set_previous_post
set_next_post
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 |
Various Restriction that Provider enforce | def restriction
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed?() raise NotImplementedError end",
"def allowed?; true end",
"def restriction \n end",
"def check_for_requirements; end",
"def permitted?; end",
"def requirements; end",
"def requirements; end",
"def requirements; end",
"def requirements; end",
"def whitelist_providers\n [:n... | [
"0.64168704",
"0.6372509",
"0.6156479",
"0.60064304",
"0.58986974",
"0.5897998",
"0.5897998",
"0.5897998",
"0.5897998",
"0.5886006",
"0.58733225",
"0.5850528",
"0.57893956",
"0.5778021",
"0.5771257",
"0.573001",
"0.56884253",
"0.56753254",
"0.5645325",
"0.5645325",
"0.5640796... | 0.625316 | 2 |
Beware, on old versions of manticore some uncommon failures are not handled | def handle_failure(output_queue, name, request, exception, execution_time)
event = LogStash::Event.new
apply_metadata(event, name, request)
event.tag('_http_request_failure')
# This is also in the metadata, but we send it anyone because we want this
# persisted by default, whereas metadata isn't. People don't like mysterious errors
event['http_request_failure'] = {
'request' => structure_request(request),
'name' => name,
'error' => exception.to_s,
'backtrace' => exception.backtrace,
'runtime_seconds' => execution_time
}
output_queue << event
rescue StandardError, java.lang.Exception => e
@logger.error? && @logger.error('Cannot read URL or send the error as an event!',
:exception => e,
:exception_message => e.message,
:exception_backtrace => e.backtrace,
:name => name,
:url => request
)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def failures; end",
"def failures; end",
"def failures; end",
"def do_failure; end",
"def storage_failure=(_arg0); end",
"def recover_from(_error); end",
"def catch_exceptions; end",
"def run_failed; end",
"def storage_failure; end",
"def handle_perform_error(_e); end",
"def failures=(_arg0); e... | [
"0.64524716",
"0.64524716",
"0.64524716",
"0.6426947",
"0.63941914",
"0.613759",
"0.61054087",
"0.6089939",
"0.6052936",
"0.59620285",
"0.5958624",
"0.5958624",
"0.59126544",
"0.584901",
"0.58147377",
"0.5809133",
"0.5808276",
"0.57933974",
"0.5752131",
"0.57054436",
"0.56892... | 0.0 | -1 |
Turn [method, url, spec] requests into a hash for friendlier logging / ES indexing | def structure_request(request)
method, url, spec = request
# Flatten everything into the 'spec' hash, also stringify any keys to normalize
Hash[(spec||{}).merge({
'method' => method.to_s,
'url' => url,
}).map { |k, v| [k.to_s, v] }]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def structure_request(request)\n method, url, spec = request\n # Flatten everything into the 'spec' hash, also stringify any keys to normalize\n Hash[(spec||{}).merge({\n \"method\" => method.to_s,\n \"url\" => url,\n }).map {|k,v| [k.to_s,v] }]\n end",
"def structure_request(request)\n ... | [
"0.64031225",
"0.64031225",
"0.64031225",
"0.64031225",
"0.61808264",
"0.6125406",
"0.6119374",
"0.60565525",
"0.6031721",
"0.59082514",
"0.5859369",
"0.5809513",
"0.5808876",
"0.57893693",
"0.5775593",
"0.5711714",
"0.57083094",
"0.57004344",
"0.5654371",
"0.5637343",
"0.558... | 0.63918334 | 4 |
Question 7 Cool Hashes | def find_cool(array)
container = []
array.each do |element|
container << element if element[:temperature] == "cool"
end
container
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash\n @symbols.hash + 37*positive?.hash\n end",
"def test_hash_correct\n\t\n\t\tString test_array1 = '2|abb2|George>Amina(16):Henry>James(4):Henry>Cyrus(17):Hen... | [
"0.74125904",
"0.74125904",
"0.74125904",
"0.74125904",
"0.74125904",
"0.74125904",
"0.74125904",
"0.73080516",
"0.7190638",
"0.7063136",
"0.68544",
"0.68544",
"0.68544",
"0.68544",
"0.68544",
"0.68544",
"0.68544",
"0.68544",
"0.68544",
"0.68544",
"0.67984706",
"0.6723241",... | 0.0 | -1 |
Colorize the time in red if the bus leaves in 10 or less minutes | def departure_time
text = @transit_details['departure_time']['text']
if @transit_details['departure_time']['value'].to_i - Time.now.to_i <= 600
text.colorize(:red)
else
text
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_for_new_paint(new_color)\n @color = new_color\n ahh_fresh_paint\nend",
"def initialize(time)\n super(label:\"%02dh %02dm %02ds\" % [time.hour, time.min, time.sec])\n @font=\"Arial\"\n @color=\"black\"\n @weight=\"normal\"\n @style=\"normal\"\n\t\tscreen=Gdk::Screen.default\n\t\tsetBackg... | [
"0.61671656",
"0.6088907",
"0.5885887",
"0.58775216",
"0.58315504",
"0.5822127",
"0.57659763",
"0.5724839",
"0.5550674",
"0.5488168",
"0.5486996",
"0.5486386",
"0.5472931",
"0.5450368",
"0.54492867",
"0.5436585",
"0.54300857",
"0.5406273",
"0.53764814",
"0.53722453",
"0.53641... | 0.7377865 | 0 |
Update properties of this object | def update!(**args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@has_valid_creds = args[:has_valid_creds] if args.key?(:has_valid_creds)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@authorization_type = args[:authorization_type] if args.key?(:authorization_type)
@client_id = args[:client_id] if args.key?(:client_id)
@data_refresh_type = args[:data_refresh_type] if args.key?(:data_refresh_type)
@data_source_id = args[:data_source_id] if args.key?(:data_source_id)
@default_data_refresh_window_days = args[:default_data_refresh_window_days] if args.key?(:default_data_refresh_window_days)
@default_schedule = args[:default_schedule] if args.key?(:default_schedule)
@description = args[:description] if args.key?(:description)
@display_name = args[:display_name] if args.key?(:display_name)
@help_url = args[:help_url] if args.key?(:help_url)
@manual_runs_disabled = args[:manual_runs_disabled] if args.key?(:manual_runs_disabled)
@minimum_schedule_interval = args[:minimum_schedule_interval] if args.key?(:minimum_schedule_interval)
@name = args[:name] if args.key?(:name)
@parameters = args[:parameters] if args.key?(:parameters)
@scopes = args[:scopes] if args.key?(:scopes)
@supports_custom_schedule = args[:supports_custom_schedule] if args.key?(:supports_custom_schedule)
@supports_multiple_transfers = args[:supports_multiple_transfers] if args.key?(:supports_multiple_transfers)
@transfer_type = args[:transfer_type] if args.key?(:transfer_type)
@update_deadline_seconds = args[:update_deadline_seconds] if args.key?(:update_deadline_seconds)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@allowed_values = args[:allowed_values] if args.key?(:allowed_values)
@deprecated = args[:deprecated] if args.key?(:deprecated)
@description = args[:description] if args.key?(:description)
@display_name = args[:display_name] if args.key?(:display_name)
@fields = args[:fields] if args.key?(:fields)
@immutable = args[:immutable] if args.key?(:immutable)
@max_value = args[:max_value] if args.key?(:max_value)
@min_value = args[:min_value] if args.key?(:min_value)
@param_id = args[:param_id] if args.key?(:param_id)
@recurse = args[:recurse] if args.key?(:recurse)
@repeated = args[:repeated] if args.key?(:repeated)
@required = args[:required] if args.key?(:required)
@type = args[:type] if args.key?(:type)
@validation_description = args[:validation_description] if args.key?(:validation_description)
@validation_help_url = args[:validation_help_url] if args.key?(:validation_help_url)
@validation_regex = args[:validation_regex] if args.key?(:validation_regex)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.70124525",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.6738901",
"0.67084897",
"0.67084897",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66188794",
"0.6571416",
"0.6538292",
"0.65194744",
"0.63953435",
"0.63903284",
"0.63903284",
... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@enable_failure_email = args[:enable_failure_email] if args.key?(:enable_failure_email)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@kms_key_name = args[:kms_key_name] if args.key?(:kms_key_name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@data_source_ids = args[:data_source_ids] if args.key?(:data_source_ids)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.70124525",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.6738901",
"0.67084897",
"0.67084897",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66188794",
"0.6571416",
"0.6538292",
"0.65194744",
"0.63953435",
"0.63903284",
"0.63903284",
... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@data_sources = args[:data_sources] if args.key?(:data_sources)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@locations = args[:locations] if args.key?(:locations)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@transfer_configs = args[:transfer_configs] if args.key?(:transfer_configs)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@transfer_messages = args[:transfer_messages] if args.key?(:transfer_messages)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.70124525",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.6738901",
"0.67084897",
"0.67084897",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66188794",
"0.6571416",
"0.6538292",
"0.65194744",
"0.63953435",
"0.63903284",
"0.63903284",
... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@transfer_runs = args[:transfer_runs] if args.key?(:transfer_runs)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@display_name = args[:display_name] if args.key?(:display_name)
@labels = args[:labels] if args.key?(:labels)
@location_id = args[:location_id] if args.key?(:location_id)
@metadata = args[:metadata] if args.key?(:metadata)
@name = args[:name] if args.key?(:name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@disable_auto_scheduling = args[:disable_auto_scheduling] if args.key?(:disable_auto_scheduling)
@end_time = args[:end_time] if args.key?(:end_time)
@start_time = args[:start_time] if args.key?(:start_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@end_time = args[:end_time] if args.key?(:end_time)
@start_time = args[:start_time] if args.key?(:start_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.70124525",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.6738901",
"0.67084897",
"0.67084897",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66188794",
"0.6571416",
"0.6538292",
"0.65194744",
"0.63953435",
"0.63903284",
"0.63903284",
... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@runs = args[:runs] if args.key?(:runs)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@requested_run_time = args[:requested_run_time] if args.key?(:requested_run_time)
@requested_time_range = args[:requested_time_range] if args.key?(:requested_time_range)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@runs = args[:runs] if args.key?(:runs)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@code = args[:code] if args.key?(:code)
@details = args[:details] if args.key?(:details)
@message = args[:message] if args.key?(:message)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.70124525",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.6738901",
"0.67084897",
"0.67084897",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66188794",
"0.6571416",
"0.6538292",
"0.65194744",
"0.63953435",
"0.63903284",
"0.63903284",
... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@end_time = args[:end_time] if args.key?(:end_time)
@start_time = args[:start_time] if args.key?(:start_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@data_refresh_window_days = args[:data_refresh_window_days] if args.key?(:data_refresh_window_days)
@data_source_id = args[:data_source_id] if args.key?(:data_source_id)
@dataset_region = args[:dataset_region] if args.key?(:dataset_region)
@destination_dataset_id = args[:destination_dataset_id] if args.key?(:destination_dataset_id)
@disabled = args[:disabled] if args.key?(:disabled)
@display_name = args[:display_name] if args.key?(:display_name)
@email_preferences = args[:email_preferences] if args.key?(:email_preferences)
@encryption_configuration = args[:encryption_configuration] if args.key?(:encryption_configuration)
@name = args[:name] if args.key?(:name)
@next_run_time = args[:next_run_time] if args.key?(:next_run_time)
@notification_pubsub_topic = args[:notification_pubsub_topic] if args.key?(:notification_pubsub_topic)
@owner_info = args[:owner_info] if args.key?(:owner_info)
@params = args[:params] if args.key?(:params)
@schedule = args[:schedule] if args.key?(:schedule)
@schedule_options = args[:schedule_options] if args.key?(:schedule_options)
@state = args[:state] if args.key?(:state)
@update_time = args[:update_time] if args.key?(:update_time)
@user_id = args[:user_id] if args.key?(:user_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@message_text = args[:message_text] if args.key?(:message_text)
@message_time = args[:message_time] if args.key?(:message_time)
@severity = args[:severity] if args.key?(:severity)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.