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
Borrowed shamelessly from Eric Lindvall:
def counter(name, value, options = {}, &block) current_time = Time.now if data = memory(name) last_time, last_value = data[:time], data[:value] elapsed_seconds = current_time - last_time # We won't log it if the value has wrapped or enough time hasn't # elapsed unless value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def anchored; end", "def stderrs; end", "def schubert; end", "def rassoc(p0) end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def offences_by; end", "def berlioz; end", "def terpene; end", "def trd; end", "def loc...
[ "0.66472375", "0.61039555", "0.5755592", "0.5725", "0.5716255", "0.5649417", "0.5636843", "0.5636843", "0.5636843", "0.5636843", "0.56179494", "0.55953825", "0.5540351", "0.54064983", "0.5395165", "0.5395165", "0.5395165", "0.53663564", "0.53590703", "0.5355935", "0.53434026"...
0.0
-1
AMF RPC Connection Callbacks. Override this method in your subclass.
def receive_request(request) request.reply("You should override #{self.class.to_s}#receive_request.") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def callbacks; end", "def callbacks; end", "def callback\n\n end", "def on_connect(&callback)\n @connect_cb = callback\n end", "def connect; end", "def post_connect_hooks; end", "def post_connect_hooks; end", "def on_connection_success &block\n @connection_success_callback = block\n end", ...
[ "0.61272204", "0.61272204", "0.5983884", "0.59163994", "0.5851674", "0.5848701", "0.5848701", "0.5831182", "0.58211124", "0.5789043", "0.5789043", "0.5789043", "0.5789043", "0.5789043", "0.5789043", "0.5789043", "0.5789043", "0.5727232", "0.57248116", "0.5712208", "0.5712208"...
0.0
-1
Respond to server ping requests (when used with EM.connect for client side sockets).
def receive_ping_request(request) request.reply(nil) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ping\n check_connection\n @protocol.ping_command\n self\n end", "def ping\n client.ping\n end", "def ping(request)\n if request.message =~ /PING$/i\n request.answer 'PONG'\n end\n end", "def ping\n with_client do |client|\n client.ping\n end\n end", "def pi...
[ "0.7168445", "0.7151359", "0.71318626", "0.70896524", "0.700361", "0.6975102", "0.6957231", "0.6865324", "0.6802987", "0.6769309", "0.6766976", "0.675798", "0.6756062", "0.6756062", "0.671936", "0.67138475", "0.67108005", "0.67095566", "0.6630813", "0.661019", "0.6602586", ...
0.591552
72
Override this method in your subclass.
def receive_message(message) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overrides; end", "def initialize\n super\n end", "def initialize\n super\n end", "def tag; raise 'Override this method'; end", "def private; end", "def initialize()\n super\n end", "def initialize()\n super\n end", ...
[ "0.7273625", "0.72561777", "0.72561777", "0.71607053", "0.7101504", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", "0.7085604", ...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_document @document = Document.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
Roman numeral for (self 10place). Precondition: 0 <= self <= 9
def digit_to_roman(place) numerals_offset = place * 2 one, five, ten = ROMAN_NUMERALS[numerals_offset..numerals_offset + 3] case self # Example for place==0: when 0..3 then one * self # I..III when 4 then one + five # IV when 5..8 then f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def roman\n return \"-#{(-self).roman}\" if self < 0\n return \"\" if self == 0\n @@roman_values_assoc.each do | (i, v) | return(i+(self-v).roman) if v <= self end\n end", "def roman_numeral num\n\tif num > 999999\n\t\treturn \"number too big for roman numerals\"\n\tend\n\n\trom_digits = ['I','V','X','...
[ "0.71907663", "0.7164913", "0.7094948", "0.70700884", "0.70581764", "0.7049254", "0.70300096", "0.7022249", "0.70219815", "0.70219815", "0.70037234", "0.6956282", "0.6951647", "0.69382554", "0.6930307", "0.69300205", "0.69176775", "0.68899137", "0.6874944", "0.6874574", "0.68...
0.78711236
0
Allows providing custom JSON key/value pairs for advanced usage
def raw(key, value) @raw_parameters[key] = JSON.generate(value) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_json(*args)\n { EXTENDED_JSON_KEY => to_s }\n end", "def json_field\n @opts.fetch(:json, @name.to_s)\n end", "def apply_json_trait(value); end", "def as_json(_options = {})\n {:custom => to_hash}\n end", "def the_json_field(field_key, default_val = '')\n r ...
[ "0.66182864", "0.6538407", "0.6460148", "0.6208804", "0.61830896", "0.615676", "0.6150753", "0.6134042", "0.6105795", "0.6068292", "0.59810394", "0.596118", "0.59324414", "0.59313613", "0.5892601", "0.58856463", "0.5877063", "0.58713067", "0.58511436", "0.5837773", "0.5820361...
0.60293144
11
GET /anamneses GET /anamneses.json
def index @anamneses = Anamnese.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @anuncios = Anuncio.all\n render json: @anuncios, status: :ok\n end", "def show\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @anuncio }\n end\n end", "def show\n @anuncio= set_anuncio\n render json: @an...
[ "0.6897856", "0.654913", "0.6531803", "0.6523757", "0.64659303", "0.6360085", "0.63259315", "0.6317048", "0.63160616", "0.6312858", "0.62861115", "0.62838626", "0.6271255", "0.6237588", "0.6212089", "0.6211325", "0.6184718", "0.61442786", "0.6128877", "0.612141", "0.6118375",...
0.7354663
0
GET /anamneses/1 GET /anamneses/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @anamneses = Anamnese.all\n end", "def show\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @anuncio }\n end\n end", "def show\r\n @antenne = Antenne.find(params[:id])\r\n\r\n respond_to do |format|\r\n ...
[ "0.683207", "0.6740389", "0.67090666", "0.6653873", "0.6630449", "0.6629339", "0.65931606", "0.6547803", "0.6451804", "0.6443434", "0.64360374", "0.6422545", "0.6402125", "0.636907", "0.6331093", "0.63196385", "0.62897116", "0.6262171", "0.6260921", "0.62191945", "0.6212649",...
0.0
-1
POST /anamneses POST /anamneses.json
def create @anamnese = Anamnese.new(anamnese_params) @usuarios = Usuario.all respond_to do |format| if @anamnese.save format.html { redirect_to @anamnese, notice: 'Anamnese criada com sucesso.' } format.json { render :show, status: :created, location: @anamnese } else fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @teste_anamnese = TesteAnamnese.new(teste_anamnese_params)\n\n respond_to do |format|\n if @teste_anamnese.save\n format.html { redirect_to @teste_anamnese, notice: 'Teste anamnese was successfully created.' }\n format.json { render action: 'show', status: :created, location: ...
[ "0.65213156", "0.64525944", "0.6394697", "0.63768345", "0.63529664", "0.63342214", "0.6270681", "0.62381953", "0.6119824", "0.6110836", "0.6110684", "0.6090923", "0.609006", "0.6043495", "0.60243875", "0.6016977", "0.59988475", "0.59959155", "0.5993474", "0.59890306", "0.5970...
0.67281866
0
PATCH/PUT /anamneses/1 PATCH/PUT /anamneses/1.json
def update respond_to do |format| if @anamnese.update(anamnese_params) format.html { redirect_to @anamnese, notice: 'Anamnese editada com sucesso.' } format.json { render :show, status: :ok, location: @anamnese } else format.html { render :edit } format.json { render json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render json: Alien.update(params[\"id\"], params[\"alien\"])\n end", "def update\n respond_to do |format|\n if @teste_anamnese.update(teste_anamnese_params)\n format.html { redirect_to @teste_anamnese, notice: 'Teste anamnese was successfully updated.' }\n format.json { hea...
[ "0.631059", "0.627707", "0.62635696", "0.6248722", "0.6222126", "0.6218936", "0.61877763", "0.6184832", "0.61309844", "0.6130911", "0.61158997", "0.60976714", "0.606889", "0.60676837", "0.6048902", "0.60392743", "0.6030052", "0.60286885", "0.60162866", "0.60147506", "0.601475...
0.64813846
0
DELETE /anamneses/1 DELETE /anamneses/1.json
def destroy @anamnese.destroy respond_to do |format| format.html { redirect_to anamneses_url, notice: 'Anamnese deletada com sucesso.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @teste_anamnese.destroy\n respond_to do |format|\n format.html { redirect_to teste_anamneses_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "de...
[ "0.72432774", "0.71631086", "0.7096926", "0.70809275", "0.70579714", "0.70269436", "0.7008152", "0.7005093", "0.69582415", "0.6943628", "0.6936194", "0.68958837", "0.6891959", "0.6887104", "0.6881773", "0.68673986", "0.68647605", "0.68391365", "0.6838971", "0.6837385", "0.683...
0.72035223
1
Use callbacks to share common setup or constraints between actions.
def set_anamnese @anamnese = Anamnese.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 anamnese_params params.require(:anamnese).permit(:atividade_trabalho, :desc_atividade_trabalho, :data_exame_clinico, :descricao_exame_clinico, :cardiopatia, :cirurgia, :descricao_cirurgia, :problema_saude, :dor_corporal, :desc_dor_corporal, :lesao, :desc_lesao, :alergia, :desc_alergia, :fumante, :alcolotra, :...
{ "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
////////////////////////////////////////////////////////////////////////// Properties ////////////////////////////////////////////////////////////////////////// Get the current comparer GET
def selected_view return @data[self.index].view end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comparators\n @@comparators\n end", "def comparer_methods\n super + [\n :four_of_a_kind_rank,\n :kicker_rank\n ]\n end", "def comparer_methods\n super + [\n :highest_rank,\n :second_highest_rank,\n :third_highest_rank,\n :fourth_highest_rank,\n :fifth_highes...
[ "0.6617845", "0.63645643", "0.6355054", "0.6321814", "0.62004554", "0.6150587", "0.60183096", "0.5998705", "0.5715241", "0.5430522", "0.5404461", "0.5355439", "0.5283941", "0.5275337", "0.5265813", "0.52443355", "0.52141297", "0.5187345", "0.51613545", "0.5145319", "0.5122955...
0.0
-1
////////////////////////////////////////////////////////////////////////// Constructors ////////////////////////////////////////////////////////////////////////// Object Initialization x : window xcoordinate y : window ycoordinate width : window width height : window height views : views list
def initialize(x, y, width, height, views) super(x, y, width, height, 8, 24, true, 24, 2) @row_max = 1 @column_max = views.size @viewsList = [] window_update(views) self.index = 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(x, y, width, height, items, dataview=nil)\n super(x, y, width, height)\n @column_max = 2\n @ucItemsList = []\n window_update(items, dataview)\n self.index = 0\n end", "def initialize(window)\n super(window)\n @width = 1\n @height = 1\n rebuild_vertices\n end"...
[ "0.6543966", "0.64913493", "0.6390554", "0.63113153", "0.63113153", "0.62390363", "0.6095085", "0.60398376", "0.5989553", "0.5972137", "0.59506786", "0.58535254", "0.58502746", "0.5849799", "0.58380544", "0.5837793", "0.58323497", "0.5828633", "0.5824637", "0.5822581", "0.581...
0.8318873
1
Update views : views list
def window_update(views) @data = [] if views != nil for view in views if view != nil @data.push(view) end end @item_max = @data.size create_contents() @viewsList.clear() for i in 0..@item_max-1 @viewsList.push(create_item(i)) end en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_views\n gauges_config = YAML.load_file(\"#{CACHE_DIR_PATH}/config\")\n views = load_views\n last_run = gauges_config[:last_run] || gauges_config[:signup_date]\n yesterday = Date.today - 1\n\n if last_run.nil?\n views = fetch_views(views, yesterday...
[ "0.6951188", "0.69109625", "0.6826252", "0.6626243", "0.6621475", "0.651234", "0.64127046", "0.6388466", "0.637025", "0.62869394", "0.626114", "0.6179663", "0.6165756", "0.61311185", "0.61311185", "0.61311185", "0.61311185", "0.611017", "0.609001", "0.60709393", "0.60164064",...
0.6807478
4
////////////////////////////////////////////////////////////////////////// Private Methods ////////////////////////////////////////////////////////////////////////// Create an item for the views list index : item index
def create_item(index) dataview = @data[index] rect = item_rect(index) viewItem = UCLabelIcon.new(self, Rect.new(rect.x,rect.y,24,24), Rect.new(rect.x,rect.y,24,24), dataview.label, dataview.icon_index) v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_item(index)\n item = @data[index]\n rect = item_rect(index)\n \n ucItem = UCVictoryItem.new(self, item, rect)\n \n return ucItem\n end", "def create_item(index)\n item = @data[index]\n rect = item_rect(index)\n # Lists\n $game_system.outline_ena...
[ "0.77330273", "0.7372231", "0.7367207", "0.7281433", "0.7066276", "0.69083166", "0.69083166", "0.6898253", "0.6790548", "0.6736107", "0.671067", "0.6655871", "0.6637054", "0.66011155", "0.64701754", "0.6391788", "0.63766384", "0.6325513", "0.631669", "0.62926084", "0.62816864...
0.76860785
2
PATCH/PUT /developer_teams/1 PATCH/PUT /developer_teams/1.json
def update respond_to do |format| if developerTeamParams developers_ids = @developers.pluck(:id) if params[:developer_ids] (developers_ids - params[:developer_ids]).each do |id| developer = Developer.find(id) if developer.team_id == @team.id de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @team = Team.find(params[:id])\n\n if @team.update_attributes(params[:team])\n head :no_content\n else\n render json: @team.errors, status: :unprocessable_entity\n end\n end", "def update\n team_name = params[:name]\n team_description = params[:description]\n team_id ...
[ "0.71107644", "0.70345694", "0.70098203", "0.68945926", "0.687927", "0.6861177", "0.6859923", "0.6831369", "0.68287337", "0.6820746", "0.6820746", "0.6813231", "0.6804525", "0.6804525", "0.6804525", "0.6804525", "0.6804525", "0.6804525", "0.6777475", "0.6749513", "0.6745631",...
0.68495226
7
Use callbacks to share common setup or constraints between actions.
def set_team @team = Team.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.6163443", "0.604317", "0.5943409", "0.59143174", "0.5887026", "0.58335453", "0.57738566", "0.5701527", "0.5701527", "0.56534666", "0.5618685", "0.54237175", "0.5407991", "0.5407991", "0.5407991", "0.5394463", "0.5376582", "0.5355932", "0.53376216", "0.5337122", "0.5329516"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def developerTeamParams params.permit(:developer_ids) 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
here we needed to find the favourite then put all the favourite in an array so we could use the transform_json method and have a standard return
def index @faves_arr = [] @favourites = current_user.favourites.map do |fave| @faves_arr << Location.find_by_id(fave.location_id) end render json: @faves_arr.map(&:transform_json), status: 201 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_favorite\n @json = FavoriteBeer&.all.where(user_id: @current_user.id).as_json\n\n @json.map! { |beer| beer.slice('id', 'name', 'tagline', 'description', 'abv', 'punk_id') }\n @json.each { |beer| beer[:favorite] = true }\n\n render json: {\n favorite_beers: @json\n }\n end", "def get_...
[ "0.7166158", "0.7133141", "0.71056825", "0.7066381", "0.66520786", "0.6626243", "0.6620508", "0.65857995", "0.6541216", "0.65319693", "0.6519198", "0.64857674", "0.6417191", "0.6414906", "0.64062566", "0.64058656", "0.63463235", "0.632062", "0.62478024", "0.62467873", "0.6243...
0.6472077
12
read in the text file and save values as an array
def arraycreate(filename) array = IO.readlines(filename) selector(array, filename) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_loaded_txt_file_to_array(file)\n\ttext_array = file.read.split(\",\")\nend", "def q1_read_to_array(data_file_name)\r\n array2d = []\r\n \r\n read_file(\"data/\"+data_file_name).each{ |line|\r\n array1d = line.split(\",\").map(&:strip).map(&:to_s)\r\n array2d << array1d\r\n }\r\n return array2...
[ "0.791997", "0.74029267", "0.7280643", "0.7198899", "0.71184164", "0.6979534", "0.6844392", "0.68270946", "0.68009883", "0.679329", "0.6766325", "0.66202575", "0.65718573", "0.6528029", "0.64607245", "0.63980734", "0.63876253", "0.6367683", "0.63552904", "0.6348593", "0.63283...
0.58403504
77
select the scenario using sample method
def selector(array, filename) selected = array.sample system "clear" puts "Incoming Scenario: "+selected.strip+"\n\n (Press any key to continue.)" STDIN.getch end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample\n self\n end", "def sample(value)\n end", "def sample_question\n get_all_from_database.sample\n end", "def test_using_random_sample\n @filelist = nil\n sublist = sample_from( self.filelist ) \n results = test_using_sublist( sublist )\n output.puts \"Test Usin...
[ "0.68079394", "0.671486", "0.6687665", "0.65475875", "0.65010303", "0.6325407", "0.6259498", "0.62387323", "0.62032646", "0.6186636", "0.6159428", "0.61476195", "0.61225754", "0.6111601", "0.61100656", "0.6106551", "0.60944164", "0.6084363", "0.6067452", "0.60543716", "0.6051...
0.5991255
25
draw the grid, showing the state of each cell
def draw @grid.each do |row| puts row.map{|cell| cell.to_s }.join("") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawBoard\n\t$firstRow.each do |i|\n\t\ti.printState\n\tend\n\tnewLine\n\t$secondRow.each do |i|\n\t\ti.printState\n\tend\n\tnewLine\n\t$thirdRow.each do |i|\n\t\ti.printState\n\tend\n\tnewLine\nend", "def draw\n @grid.draw\n show_info\n end", "def render\n #puts \"current state of the grid:\"\n ...
[ "0.7767157", "0.7455387", "0.74528474", "0.7423464", "0.7376957", "0.7304672", "0.72733957", "0.71965367", "0.7170205", "0.71457255", "0.71067953", "0.70580924", "0.7044", "0.70196515", "0.69495046", "0.6939908", "0.69204587", "0.68913573", "0.6883476", "0.68829894", "0.68198...
0.82632196
0
there are 8 possible postions for any cell in a grid
def possible_neighbors(y,x) # (-1..1).to_a.map do |row_offset| # (-1..1).to_a.map do |col_offset| # return y - row_offset, x - col_offset # end # end up = y-1 down = y + 1 my_row = y left = x - 1 right = x + 1 my_column = x [ [my_row,x-1],[y,x+1], # sides ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cells_grid_1by1\n [\n [\n MazeMagic::Maze::Edge.instance,\n MazeMagic::Maze::HorizontalWall.instance,\n MazeMagic::Maze::Edge.instance\n ],\n [\n MazeMagic::Maze::VerticalWall.instance,\n MazeMagic::Maze::HorizontalWall.instance,\n MazeMagic::Maze::Ve...
[ "0.7092457", "0.66919994", "0.6584267", "0.6542738", "0.6487446", "0.6438787", "0.6400695", "0.6330733", "0.63261414", "0.63093454", "0.62901264", "0.628903", "0.62854564", "0.62698", "0.626151", "0.6252517", "0.6224737", "0.62091136", "0.619947", "0.6180968", "0.6149169", ...
0.0
-1
GET /barcodes GET /barcodes.json
def index @barcodes = Barcode.all respond_to do |format| format.html # index.html.erb end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @bar_codes = BarCode.all\n end", "def index\n @bar_codes = BarCode.all\n end", "def access_decision_by_barcodes\n response = {}\n status = 200\n success = true\n ad = []\n begin\n bcs = JSON.parse(request.body.read)\n bcs.each do |bc|\n if ApplicationHelper.v...
[ "0.75111026", "0.75111026", "0.66177154", "0.62130994", "0.6186225", "0.61329365", "0.61248684", "0.6101457", "0.6005448", "0.5991894", "0.59682584", "0.59677535", "0.5904802", "0.5873676", "0.5873676", "0.5864345", "0.5861966", "0.5828333", "0.58278316", "0.58278316", "0.582...
0.72603685
2
GET /barcodes/1 GET /barcodes/1.json
def show @barcode = Barcode.find(params[:id]) respond_to do |format| format.html # show.html.erb end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @bar_codes = BarCode.all\n end", "def index\n @bar_codes = BarCode.all\n end", "def index\n\t\t@barcodes = Barcode.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\tend\n\tend", "def access_decision_by_barcodes\n response = {}\n status = 200\n success = t...
[ "0.742859", "0.742859", "0.71316904", "0.6494784", "0.63318235", "0.62933195", "0.61951953", "0.61493504", "0.61345446", "0.61345446", "0.61342704", "0.611546", "0.610845", "0.6047279", "0.60013986", "0.5998889", "0.59984446", "0.59957844", "0.59231716", "0.58897096", "0.5884...
0.6384931
4
GET /barcodes/new GET /barcodes/new.json
def new @barcode = Barcode.new respond_to do |format| format.html # new.html.erb end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @barcode_list = BarcodeList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @barcode }\n end\n end", "def create\n @bar_code = BarCode.new(bar_code_params)\n\n respond_to do |format|\n if @bar_code.save\n format.html { re...
[ "0.7433759", "0.731694", "0.72466755", "0.7222478", "0.7193562", "0.6978632", "0.6740317", "0.6731647", "0.67038846", "0.669614", "0.6662637", "0.66623145", "0.66410214", "0.66317177", "0.66243774", "0.6592492", "0.65821636", "0.65821636", "0.6568536", "0.6561931", "0.6549887...
0.7232623
3
POST /barcodes POST /barcodes.json
def create @barcode = Barcode.new(params[:barcode]) respond_to do |format| if @barcode.save format.html { redirect_to barcodes_url, flash: { info: 'Barcode was successfully created.' } } else format.html { render action: "new" } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @bar_code = BarCode.new(bar_code_params)\n\n respond_to do |format|\n if @bar_code.save\n format.html { redirect_to @bar_code, notice: 'Bar code was successfully created.' }\n format.json { render :show, status: :created, location: @bar_code }\n else\n format.html ...
[ "0.7415044", "0.67078596", "0.66389763", "0.63912237", "0.63683516", "0.6326794", "0.62927216", "0.62461287", "0.6160359", "0.6160359", "0.6097982", "0.60931355", "0.6035097", "0.5938596", "0.59351057", "0.59063536", "0.59051657", "0.59041905", "0.5892215", "0.5863132", "0.58...
0.6550227
3
PUT /barcodes/1 PUT /barcodes/1.json
def update @barcode = Barcode.find(params[:id]) respond_to do |format| if @barcode.update_attributes(params[:barcode]) format.html { redirect_to barcodes_url, flash: { info: 'Barcode was successfully updated.' } } else format.html { render action: "edit" } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @bar_code.update(bar_code_params)\n format.html { redirect_to @bar_code, notice: 'Bar code was successfully updated.' }\n format.json { render :show, status: :ok, location: @bar_code }\n else\n format.html { render :edit }\n format.j...
[ "0.70886743", "0.70886743", "0.659894", "0.6584221", "0.653215", "0.653215", "0.6477575", "0.6220498", "0.6192343", "0.6184671", "0.6149298", "0.61095387", "0.60460126", "0.6006087", "0.6000393", "0.60001373", "0.5998216", "0.59557414", "0.5944713", "0.5935645", "0.5916291", ...
0.63209647
7
DELETE /barcodes/1 DELETE /barcodes/1.json
def destroy @barcode = Barcode.find(params[:id]) @barcode.destroy respond_to do |format| format.html { redirect_to barcodes_url } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @bar_code.destroy\n respond_to do |format|\n format.html { redirect_to bar_codes_url, notice: 'Bar code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bar_code.destroy\n respond_to do |format|\n format.html { redirect_t...
[ "0.76170814", "0.76170814", "0.71585536", "0.7130638", "0.7075718", "0.70602757", "0.70592546", "0.69488937", "0.6932125", "0.6910546", "0.68962175", "0.6886249", "0.68790877", "0.68582165", "0.6851659", "0.6837574", "0.6826401", "0.6809527", "0.679244", "0.67901444", "0.6770...
0.6912562
9
callseq: elem.add_class(sym) > elem Returns _elem_ with class name _sym_ added.
def add_class(sym) `if(!this.m$has_class_bool(sym)){var el=this.__native__,c=el.className,s=sym.__value__;el.className=(c.length>0)?c+' '+s:s;}` return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def <<(sym)\n `c$Element.prototype.m$add_class.call(#{@element},sym)`\n return self\n end", "def add_class class_name\n each do |el|\n next unless el.respond_to? :get_attribute\n classes = el.get_attribute('class').to_s.split(\" \")\n el.set_attribute('class', classes.push(...
[ "0.7784495", "0.69214886", "0.68303394", "0.68303394", "0.6735375", "0.6674394", "0.6674394", "0.6595221", "0.65945494", "0.6550625", "0.64354295", "0.62009585", "0.6181665", "0.606861", "0.6056475", "0.6048839", "0.5928737", "0.58670306", "0.5825199", "0.57932717", "0.573945...
0.75371796
1
callseq: elem.add_classes(sym, ...) > elem Calls elem.add_class(sym) once for each argument.
def add_classes(*args) args.each {|x| self.add_class(x) } return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_class class_name\n each do |el|\n next unless el.respond_to? :get_attribute\n classes = el.get_attribute('class').to_s.split(\" \")\n el.set_attribute('class', classes.push(class_name).uniq.join(\" \"))\n end\n self\n end", "def add_classes(*classes)\n classes....
[ "0.7011723", "0.7009879", "0.6765727", "0.67062396", "0.6690673", "0.6690673", "0.6550523", "0.6550523", "0.64823645", "0.6237476", "0.6236916", "0.62358886", "0.6212731", "0.61946905", "0.6165728", "0.61276096", "0.6126845", "0.60769385", "0.6038406", "0.5991376", "0.5983060...
0.71145284
0
callseq: elem.class > string Returns a string representation of _elem_'s class names, separated by " ".
def class `$q(this.__native__.className)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def class_name\n element.attribute_value \"class\"\n end", "def inspect_class_name\n s = \"#{element_type.to_s.scan(/Elem|Obj|V|E/).last}\"\n s = \"#{s}-#{function.name.split('::').last.sub(/Filter|Route$/, '')}\" if function\n s = \"#{s} #{ @info }\" if @info\n s\n end", "de...
[ "0.73725903", "0.7010437", "0.69138837", "0.68819237", "0.6743912", "0.67404723", "0.6736298", "0.66650474", "0.6626584", "0.6546588", "0.64619535", "0.64584833", "0.64512205", "0.6376232", "0.63238704", "0.63145214", "0.626006", "0.6241287", "0.6241287", "0.6230668", "0.6224...
0.0
-1
callseq: elem.class = str > str Sets _elem_'s HTML class property to _str_, which consists of one or many class names separated by " ".
def class=(str) `this.__native__.className=str.__value__` return str end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join_dom_classes(*names)\n names.reject(&:blank?).join(' ')\n end", "def strclass=(val) @records.set(GRT_STRCLASS, val); end", "def add_class c\n each do |q|\n str = q.get_attribute(\"class\")\n\n if str.empty?\n str = c.to_s\n else\n str = str+\" #{c}\"\n ...
[ "0.64961183", "0.635904", "0.62787205", "0.6210156", "0.6015022", "0.59522116", "0.59469813", "0.5912748", "0.5884626", "0.5799927", "0.57399803", "0.57399803", "0.57192695", "0.56986237", "0.56985855", "0.5687211", "0.5646574", "0.5646377", "0.56262577", "0.56062007", "0.560...
0.6466408
1
callseq: elem.classes > object Returns an Element::Classes accessor object, which represents the classes assigned to _elem_, and allows for operations such as elem.classes , elem.classes.include? :klass, and elem.classes.toggle(:klass).
def classes @class_list ||= Element::Classes.new(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def classes()\n return @driver.get_sc_core_query_element_classes(@handle, @index)\n end", "def classes(*args)\n [node ? node.classes(*args) : [], @wrapped_classes].flatten\n end", "def classes\n kwattr_values(\"class\")\n end", "def classes=(ary)\n `for(var result=[],i=0,l=...
[ "0.7231637", "0.6824717", "0.6779109", "0.6672545", "0.66481274", "0.6593858", "0.6486228", "0.64735866", "0.6407227", "0.6407227", "0.63714993", "0.6255144", "0.62187076", "0.6177457", "0.6147122", "0.61366314", "0.61152107", "0.6114396", "0.6087834", "0.60609204", "0.602699...
0.7577436
0
callseq: elem.classes = [sym, ...] > array Sets _elem_'s HTML class property to a string equivalent to the concatenation of each of the classes in _array_ joined by " ", then returns _array_.
def classes=(ary) `for(var result=[],i=0,l=ary.length;i<l;++i){result.push(ary[i].__value__);}` `this.__native__.className=result.join(' ')` return ary end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arrayize_html_class_key(value)\n case value\n when Hash\n arrayize_html_class_key(value[:class])\n when Array\n value.compact.map(&:to_s)\n when String\n value.split(' ')\n when Symbol\n [value.to_s]\n else\n []\n end\n end", "def add_c...
[ "0.6340402", "0.62346405", "0.61649233", "0.6141995", "0.5947341", "0.5898712", "0.5881616", "0.5772546", "0.57313037", "0.5661118", "0.5637887", "0.5632156", "0.5617713", "0.5523222", "0.54700524", "0.5446821", "0.54143447", "0.536293", "0.5361895", "0.53580254", "0.53490496...
0.6956921
0
callseq: elem.clear_styles > elem Removes the CSS styles that have been applied to _elem_.
def clear_styles `this.__native__.style.cssText=''` return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear\n `c$Element.prototype.m$clear_styles.call(#{@element})`\n end", "def clear_css\n self\n end", "def remove_styles(*args)\n args.each {|x| self.remove_style(x) }\n return self\n end", "def clear(*styles_to_clear)\n if styles_to_clear.any?\n queue_some_for_delete(*style...
[ "0.84897816", "0.66037065", "0.61380243", "0.60932", "0.6064349", "0.56118834", "0.5594822", "0.5566178", "0.5507755", "0.5471944", "0.5461912", "0.5438124", "0.5414617", "0.5403734", "0.53852123", "0.5356018", "0.5343487", "0.53417444", "0.5317804", "0.53175485", "0.53175485...
0.7196486
1
callseq: elem.get_property(sym) > object or nil Returns the value of _elem_'s property _sym_, or +nil+ if no value is set.
def get_property(attribute) `var el=this.__native__,attr=attribute.__value__,key=c$Element.__keyed_attributes__[attr],bool=c$Element.__boolean_attributes__[attr]` `var value=key||bool?el[key||bool]:el.getAttribute(attr,2)` return `bool ? !!value : (value==null) ? nil : $q(value)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_property(prop)\r\n prop = URI.parse(prop) unless prop.is_a?(URI)\r\n\r\n each_property{|predicate, object|\r\n return object if predicate == prop\r\n }\r\n nil\r\n end", "def getProperty(propName)\n begin\n elementObject = waitForObject(@symbolicName, OBJECT_WAIT_TIMEOUT)\n ...
[ "0.60082203", "0.59429955", "0.5811265", "0.5796062", "0.5770326", "0.5669581", "0.56332374", "0.5631839", "0.56065583", "0.5530822", "0.5518348", "0.5502335", "0.5502335", "0.5487504", "0.5441518", "0.5412671", "0.5376316", "0.53692454", "0.53256124", "0.5301126", "0.5299616...
0.5451231
14
callseq: elem.get_style(sym) > object or nil Returns the value of the CSS style rule _sym_ applied to _elem_, or +nil+ if no value is set.
def get_style(attribute) `var el=this.__native__,attr=attribute.__value__.replace(/[_-]\\D/g, function(match){return match.charAt(1).toUpperCase();}),result=el.style[attr]` `result===undefined?nil:$q(result)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getStyleElement\n return @element\n end", "def [](attribute)\n `c$Element.prototype.m$get_style.call(#{@element},attribute)`\n end", "def style\n defined?(@style) ? @style : 0\n end", "def get_symbol_output_rule(sym, type = 'scalar')\n\t\t\trule = nil\n\t\t\t@rules.each do |r|\n\t\t\t...
[ "0.6404568", "0.61523074", "0.5664945", "0.53615886", "0.5301419", "0.52654713", "0.5206738", "0.51760983", "0.51647794", "0.51430684", "0.51228344", "0.51189476", "0.50789535", "0.5072415", "0.5072068", "0.5060543", "0.5036394", "0.5022393", "0.4933779", "0.4926389", "0.4921...
0.63319045
1
callseq: elem.has_class?(sym) > true or false Returns +true+ if _elem_ has class _sym_, +false+ otherwise. elem = Document['div_a'] => elem.has_class?('container') => true elem.has_class?(:draggable) => false
def has_class?(sym) `var str=' '+this.__native__.className+' ',match=' '+sym.__value__+' '` `str.indexOf(match) > -1` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_class(cls)\n `#{@el}.classList.contains(#{cls})`\n end", "def include?(sym)\n `c$Element.prototype.m$has_class_bool.call(#{@element},sym)`\n end", "def has_class?(c)\n find_all do |q|\n n=q.get_attribute(\"class\").split(\" \")\n n.index(c.to_s)\n end\n end", ...
[ "0.76876473", "0.73999256", "0.7372899", "0.7358895", "0.7283331", "0.69203204", "0.68902546", "0.6511616", "0.64940226", "0.6460038", "0.64591545", "0.644424", "0.6319117", "0.62739336", "0.62641716", "0.6238828", "0.6223773", "0.61947215", "0.6192938", "0.615406", "0.615059...
0.6537955
7
callseq: elem.html > string Returns a string representation of the HTML inside _elem_.
def html `$q(this.__native__.innerHTML)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def html\n `#{@el}.innerHTML`\n end", "def html_string\n @html.join(\"\")\n end", "def inner_html(options = T.unsafe(nil)); end", "def inner_html(*string)\n if string.empty?\n map { |x| x.inner_html }.join\n else\n x = self.inner_html = string.pop || x\n end\n ...
[ "0.75402606", "0.70995265", "0.66310656", "0.6611429", "0.65885603", "0.64851016", "0.6413742", "0.6413742", "0.63426346", "0.6265425", "0.62508494", "0.62389714", "0.61893857", "0.61768776", "0.6168779", "0.6148735", "0.6123551", "0.61217785", "0.61214775", "0.6096554", "0.6...
0.6714722
2
callseq: elem.html = str > str Sets the HTML inside _elem_ to _str_.
def html=(str) `this.__native__.innerHTML=str.__value__` return str end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def html=(value)\n `#{@el}.innerHTML = #{value}`\n end", "def inner_html=(string)\n each { |x| x.inner_html = string }\n end", "def escape_html(str, type = T.unsafe(nil)); end", "def html(raw_html)\n `#{@element}.innerHTML = #{raw_html}`\n end", "def inner_html(*string)\n if st...
[ "0.67941356", "0.6686318", "0.64829916", "0.6439368", "0.62574565", "0.6151115", "0.61286646", "0.60942316", "0.6026659", "0.5902999", "0.5902999", "0.5871454", "0.5839841", "0.58375883", "0.5813714", "0.5811862", "0.57721275", "0.57705057", "0.56712747", "0.56586975", "0.565...
0.73799664
0
callseq: elem.id > string Returns a string representation of the HTML id of _elem_.
def id `$q(this.__native__.id||nil)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def element_dom_id(element)\n return \"\" if element.nil?\n \"#{element.name}_#{element.id}\".html_safe\n end", "def element_dom_id(element)\n return \"\" if element.nil?\n \"#{element.name}_#{element.id}\"\n end", "def element_id(str)\n find_element(:id, str)\n end", "def html_id_for...
[ "0.82196313", "0.7994577", "0.7302401", "0.71578985", "0.6929779", "0.69003993", "0.682541", "0.66049576", "0.6524583", "0.6435969", "0.64154154", "0.6406277", "0.6406277", "0.6385904", "0.6348557", "0.63366014", "0.6280362", "0.6202443", "0.62018585", "0.61868006", "0.618018...
0.0
-1
callseq: elem.properties > object Returns an Element::Properties accessor object, which represents the HTML properties assigned to _elem_, and allows for operations such as elem.properties[:title] = 'figure_1' and elem.properties.set? :name.
def properties @properties ||= Element::Properties.new(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modify_properties(properties_element)\n end", "def properties\n map(element_type: :hash) { |v| v.properties }\n end", "def element_property(element, name)\n execute_script 'return arguments[0][arguments[1]]', element, name\n end", "def populate_properties_from(element)\n ...
[ "0.6819564", "0.6631596", "0.63026667", "0.62331444", "0.6188072", "0.61030614", "0.6082573", "0.59936845", "0.592818", "0.5914123", "0.582806", "0.5821774", "0.5796461", "0.5795973", "0.5792656", "0.57715327", "0.56828976", "0.56800056", "0.56518817", "0.56428075", "0.563505...
0.7542004
0
callseq: elem.remove_class(sym) > elem Removes _sym_ from _elem_'s HTML class property if it was included, then returns _elem_.
def remove_class(sym) `var el=this.__native__,klass=sym.__value__` `el.className=el.className.replace(new(RegExp)('(^|\\\\s)'+klass+'(?:\\\\s|$)'),'$1')` return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_class c\n each do |q|\n str = q.get_attribute(\"class\")\n\n str = str.split(\" \").find_all do |n|\n n != c.to_s\n end.join(\" \")\n \n q.set_attribute(\"class\",str)\n end\n end", "def remove_class name = nil\n each do |el|\n next un...
[ "0.6936683", "0.6837257", "0.66320026", "0.65478635", "0.6540587", "0.6483382", "0.6405631", "0.63132083", "0.6089746", "0.6065493", "0.5997552", "0.5997552", "0.5852255", "0.58332896", "0.573149", "0.5621915", "0.5621915", "0.5616404", "0.5604875", "0.54909647", "0.5487233",...
0.80009687
0
callseq: elem.remove_classes(sym, ...) > elem Calls elem.remove_class(sym) once for each argument.
def remove_classes(*args) args.each {|x| self.remove_class(x) } return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_class(names = T.unsafe(nil)); end", "def remove_class(sym)\n `var el=this.__native__,klass=sym.__value__`\n `el.className=el.className.replace(new(RegExp)('(^|\\\\\\\\s)'+klass+'(?:\\\\\\\\s|$)'),'$1')`\n return self\n end", "def remove_class c\n each do |q|\n str = q.get_attri...
[ "0.75044405", "0.7146934", "0.71345645", "0.69990635", "0.6961715", "0.6938919", "0.6873034", "0.6873034", "0.6627009", "0.65680176", "0.6450014", "0.6394031", "0.6394031", "0.63454914", "0.627085", "0.62129503", "0.61882627", "0.61356336", "0.5946739", "0.5914124", "0.584692...
0.7389238
1
callseq: elem.remove_property(sym) > elem Unsets _elem_'s HTML property _sym_ if it was set, then returns _elem_.
def remove_property(attribute) `var el=this.__native__,attr=attribute.__value__,bool=c$Element.__boolean_attributes__[attr],key=c$Element.__boolean_attributes__[attr]||bool` `key ? el[key]=bool?false:'' : el.removeAttribute(attr)` return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(attribute)\n `c$Element.prototype.m$remove_property.call(#{@element},attribute)`\n end", "def remove_property(element)\n Forbidden\n end", "def remove_property(element)\n Forbidden\n end", "def remove_attribute(name)\n `#{@element}.removeAttribute(#{name})`\n end", ...
[ "0.62450993", "0.609571", "0.609571", "0.60780716", "0.59582937", "0.59582937", "0.59376794", "0.5908663", "0.5908663", "0.5908663", "0.5908663", "0.59045875", "0.58818865", "0.5875824", "0.5853069", "0.58325905", "0.5813845", "0.57979184", "0.5657529", "0.56527627", "0.56394...
0.6471542
0
callseq: elem.remove_properties(sym, ...) > elem Calls elem.remove_property(sym) once for each argument.
def remove_properties(*args) args.each {|x| self.remove_property(x) } return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rm_properties(resource, elements)\n for element, value in elements\n resource.remove_property(element)\n end\n end", "def remove_property(element)\n Forbidden\n end", "def remove_property(element)\n Forbidden\n end", "def remove_property(key)\n end", "def kwat...
[ "0.7515472", "0.6306776", "0.6306776", "0.6305965", "0.61419064", "0.60773766", "0.59793335", "0.59510237", "0.59510237", "0.59440273", "0.5935822", "0.5893628", "0.58659863", "0.58659863", "0.58659863", "0.58659863", "0.5853881", "0.5847282", "0.5802144", "0.57681423", "0.57...
0.7416989
1
callseq: elem.remove_style(sym) > elem Unsets _elem_'s CSS style _sym_ if it was set, then returns _elem_.
def remove_style(attribute) `var attr=attribute.__value__.replace(/[_-]\\D/g, function(match){return match.charAt(1).toUpperCase();})` `this.__native__.style[attr]=null` return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear\n `c$Element.prototype.m$clear_styles.call(#{@element})`\n end", "def delete(attribute)\n `c$Element.prototype.m$remove_style.call(#{@element},attribute)`\n end", "def remove_inline_style(_permalink, node)\n node.remove_attribute('style')\n end", "def remove_style(st...
[ "0.65853935", "0.631148", "0.63080305", "0.6261742", "0.60580415", "0.5671258", "0.5635237", "0.5580928", "0.55797404", "0.55589086", "0.55316603", "0.5429981", "0.53933316", "0.53352964", "0.51982486", "0.51897305", "0.515794", "0.5125895", "0.5028562", "0.49660912", "0.4962...
0.6646428
0
callseq: elem.remove_styles(sym, ...) > elem Calls elem.remove_style(sym) once for each argument.
def remove_styles(*args) args.each {|x| self.remove_style(x) } return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear\n `c$Element.prototype.m$clear_styles.call(#{@element})`\n end", "def remove_style(style_str, screen)\n if screen\n styles_pool[screen]&.delete(style_str)\n elsif styles_pool[:_common]\n styles_pool[:_common].delete(style_str)\n end\n end", "def rem...
[ "0.6619145", "0.65190345", "0.6418559", "0.6155249", "0.61523765", "0.6117595", "0.59801936", "0.5978262", "0.56332517", "0.562238", "0.5449351", "0.54096925", "0.5399897", "0.53921646", "0.5371873", "0.5259925", "0.5184083", "0.5138669", "0.5138669", "0.5138669", "0.51364285...
0.77357984
0
callseq: elem.set_property(sym, value) > elem Sets _elem_'s HTML property _sym_ to _value_, then returns _elem_.
def set_property(attribute, value) `var el=this.__native__,attr=attribute.__value__,bool=c$Element.__boolean_attributes__[attr],key=c$Element.__boolean_attributes__[attr]||bool` `key ? el[key]=bool?$T(value):value : el.setAttribute(attr,''+value)` return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def []=(attribute,value)\n `c$Element.prototype.m$set_property.call(#{@element},attribute,value)`\n end", "def set(property, value)\n self.send(\"#{property}=\".to_sym, value)\n end", "def set_attribute_for element, attr, value\n AXUIElementSetAttributeValue(element, attr, value)\n end", ...
[ "0.7083313", "0.6523979", "0.6523601", "0.64827377", "0.6276837", "0.62757146", "0.6150326", "0.6125316", "0.6108555", "0.61068517", "0.61005074", "0.6077094", "0.6044076", "0.6026856", "0.59604764", "0.5942865", "0.5920032", "0.5920032", "0.5848654", "0.5830164", "0.57910264...
0.64838743
3
callseq: elem.set_style(sym, value) > elem Sets _elem_'s CSS style _sym_ to _value_, then returns _elem_.
def set_style(attribute, value) `var attr=attribute.__value__.replace(/[_-]\\D/g, function(match){return match.charAt(1).toUpperCase();}),val=value.__value__||value` `if(attr == 'opacity'){return this.m$set_opacity(value);}` `if(attr==='float'){val=#{trident?}?'styleFloat':'cssFloat'}` `if(val===String(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def []=(attribute, value)\n `c$Element.prototype.m$set_style.call(#{@element},attribute,value)`\n end", "def setElement(elem)\n if @element\n # replace element in its parent with elem.\n DOM.replace(@element, elem)\n end\n\n @element = elem\n\n # We do not actually force the creatio...
[ "0.7235749", "0.67769635", "0.652361", "0.63471967", "0.6239281", "0.6167028", "0.6014925", "0.5974998", "0.57905674", "0.5708411", "0.56974936", "0.5643588", "0.56392634", "0.5584598", "0.55546016", "0.55437464", "0.5484087", "0.54425764", "0.5435484", "0.54276663", "0.53543...
0.6871257
1
callseq: elem.style > string Returns the value of _elem_'s HTML style property.
def style `$q(this.__native__.style.cssText)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_style(attribute)\n `var el=this.__native__,attr=attribute.__value__.replace(/[_-]\\\\D/g, function(match){return match.charAt(1).toUpperCase();}),result=el.style[attr]`\n `result===undefined?nil:$q(result)`\n end", "def getStyleElement\n return @element\n end", "def [](attribute)\n `c$E...
[ "0.6640676", "0.6583128", "0.6535659", "0.6425813", "0.6194954", "0.6121221", "0.6083657", "0.60634863", "0.6044057", "0.59832144", "0.5968778", "0.5887172", "0.58739513", "0.57490844", "0.57120496", "0.5708318", "0.56829953", "0.5674927", "0.56548095", "0.5646383", "0.563171...
0.69259125
0
callseq: elem.style = str > str Sets the value of _elem_'s HTML style property to _str_.
def style=(str) `this.__native__.style.cssText=str.__value__` return str end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def s(val); @style = val; end", "def html=(str)\n `this.__native__.innerHTML=str.__value__`\n return str\n end", "def []=(attribute, value)\n `c$Element.prototype.m$set_style.call(#{@element},attribute,value)`\n end", "def set_style(attribute, value)\n `var attr=attribute.__value__.replace(...
[ "0.6312693", "0.6176428", "0.5980351", "0.59376484", "0.5898022", "0.57973367", "0.56959385", "0.56505275", "0.56009346", "0.55947626", "0.5592416", "0.5592416", "0.5585343", "0.5559372", "0.5449681", "0.54485774", "0.5432327", "0.5379043", "0.5327907", "0.53216404", "0.52799...
0.73092276
0
callseq: elem.styles > object Returns an Element::Styles accessor object, which represents the CSS styles applied to _elem_, and allows for operations such as elem.styles[:color] = 'C80404' and elem.styles.set? :font_weight.
def styles @styles ||= Element::Styles.new(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def styles\n @styles ||= DEFAULT_STYLES\n end", "def styles\n @document.styles\n end", "def getStyleElement\n return @element\n end", "def styles\n @styles ||= Hash.new do |_styles, stylename|\n _styles[stylename] = Style.new\n _styles[stylename].stylename = stylena...
[ "0.63187605", "0.6274595", "0.6249639", "0.61247075", "0.61237955", "0.60837847", "0.6069752", "0.5967642", "0.58937216", "0.5884658", "0.58778995", "0.584587", "0.5811392", "0.5810234", "0.58085847", "0.5800959", "0.5702022", "0.5681512", "0.5677042", "0.56765664", "0.566484...
0.7416198
0
callseq: elem.text > string Returns the text inside _elem_ as a string.
def text `$q(#{trident?} ? this.__native__.innerText : this.__native__.textContent)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def text\n element.text\n end", "def get_text(element)\n element.text\n end", "def text(el)\n return el.value if el.type == :text\n\n xs = el.children.map do |x|\n text(x)\n end\n\n xs.join(\" \").gsub(\"\\n\", '')\n end", "def element_text(element)\n ...
[ "0.79446125", "0.7930543", "0.7752257", "0.76418245", "0.7492606", "0.71795124", "0.71141493", "0.705971", "0.700676", "0.6860659", "0.6858599", "0.6850548", "0.6837708", "0.6755498", "0.66355175", "0.66195786", "0.6613489", "0.6602532", "0.6598934", "0.65074474", "0.6495978"...
0.6156768
40
callseq: elem.text = str > str Sets the text inside _elem_ to the value _str_.
def text=(str) trident? ? `this.__native__.innerText=str.__value__` : `this.__native__.textContent=str.__value__` return str end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_text( *args )\n value = args.pop\n elements = args\n\n value_node = build_document_tree( elements )\n modified_node = build_document_tree( elements, self.modified_document ) if self.modified_document\n\n value_node.text = value\n modified_no...
[ "0.67359036", "0.6662662", "0.6357575", "0.609461", "0.60540473", "0.60279083", "0.5994401", "0.5923873", "0.5901214", "0.58976626", "0.58941424", "0.5861267", "0.58591264", "0.58154863", "0.5811512", "0.58112645", "0.5801512", "0.57722515", "0.5746213", "0.5722279", "0.57064...
0.69676363
0
callseq: elem.toggle_class(sym) > elem Returns _elem_ with the HTML class _sym_ added to its HTML classes if they did not include _sym_, or with _sym_ removed from its HTML classes if they did include _sym_.
def toggle_class(sym) self.has_class?(sym) ? self.remove_class(sym) : self.add_class(sym); return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle(sym)\n `c$Element.prototype.m$toggle_class.call(#{@element},sym)`\n return @element\n end", "def toggle_class(*names)\n to_remove, to_add = names.partition { |name| class_names.include? name }\n\n add_class(*to_add)\n remove_class(*to_remove)\n end", "def remove_class(sym)\n ...
[ "0.6931648", "0.67874867", "0.6693255", "0.66268325", "0.6214355", "0.58980286", "0.58571714", "0.57361656", "0.57243824", "0.5709452", "0.56453943", "0.54649204", "0.5460523", "0.54545075", "0.5391821", "0.535584", "0.5323213", "0.53130054", "0.5258916", "0.52525806", "0.519...
0.7829817
0
callseq: classes classes Adds _sym_ to the HTML classes of the element represented by _classes_, then returns _classes_. See also Elementadd_class.
def <<(sym) `c$Element.prototype.m$add_class.call(#{@element},sym)` return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_classes(*classes)\n classes.map{|e| e.kind_of?(String) ? [e, nil] : e}.map{|p| add_class(*p)}\n end", "def add_class class_name\n each do |el|\n next unless el.respond_to? :get_attribute\n classes = el.get_attribute('class').to_s.split(\" \")\n el.set_attribute('class', ...
[ "0.656125", "0.65151006", "0.640374", "0.63862664", "0.6256278", "0.6159011", "0.6138442", "0.6056273", "0.6052461", "0.60231483", "0.59798944", "0.5948302", "0.58924115", "0.5849465", "0.5832573", "0.57869107", "0.571003", "0.56763464", "0.56623715", "0.56572413", "0.5656649...
0.49159297
78
callseq: classes.include?(sym) > true or false Returns +true+ if the element represented by _classes_ has the HTML class _sym_, +false+ otherwise. See also Elementhas_class?.
def include?(sym) `c$Element.prototype.m$has_class_bool.call(#{@element},sym)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_class(cls)\n `#{@el}.classList.contains(#{cls})`\n end", "def has_class?(c)\n find_all do |q|\n n=q.get_attribute(\"class\").split(\" \")\n n.index(c.to_s)\n end\n end", "def has_class?(class_names)\n class_names.strip.downcase.split(' ').compact.any? { |other_cl...
[ "0.7457599", "0.7366914", "0.72542834", "0.7172966", "0.6784528", "0.6782347", "0.6701996", "0.67009574", "0.6698978", "0.6691073", "0.66725653", "0.66151536", "0.66102844", "0.6499393", "0.6331299", "0.6299114", "0.61914784", "0.6175207", "0.6170793", "0.6133896", "0.6101002...
0.7752041
0
callseq: classes.toggle(sym) > element If the element represented by _classes_ has the HTML class _sym_, removes _sym_; otherwise, adds _sym_ to the element's classes. See also Elementtoggle_class.
def toggle(sym) `c$Element.prototype.m$toggle_class.call(#{@element},sym)` return @element end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle_class(sym)\n self.has_class?(sym) ? self.remove_class(sym) : self.add_class(sym);\n return self\n end", "def remove_class(sym)\n `var el=this.__native__,klass=sym.__value__`\n `el.className=el.className.replace(new(RegExp)('(^|\\\\\\\\s)'+klass+'(?:\\\\\\\\s|$)'),'$1')`\n return self\n...
[ "0.7195768", "0.60435754", "0.58820295", "0.55701303", "0.54570985", "0.5434641", "0.53254896", "0.52197605", "0.51879746", "0.50534105", "0.5048266", "0.50224316", "0.4920821", "0.48628393", "0.4857849", "0.48540366", "0.47892416", "0.47195524", "0.46645737", "0.46277046", "...
0.74920976
0
callseq: properties[sym] > object or nil Returns the value of the HTML property _sym_ for the element represented by _properties_, or +nil+ if the property is not set. See also Elementget_property.
def [](attribute) `c$Element.prototype.m$get_property.call(#{@element},attribute)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def property(name)\n get(\"/session/#{session_id}/element/#{element_id}/property/#{name}\").value\n end", "def parse_properties(element, properties)\n properties.each_pair do |name, prop_fields|\n if name == 'UserData'\n # Special case\n code = extract_code(prop_...
[ "0.5826686", "0.58169526", "0.570996", "0.5573476", "0.55464303", "0.54992115", "0.54989845", "0.54484326", "0.539312", "0.5379893", "0.5357224", "0.534339", "0.5335558", "0.53242755", "0.5297483", "0.52694166", "0.52685905", "0.52281094", "0.5226791", "0.5216506", "0.5211651...
0.0
-1
callseq: properties[sym] = value > value Sets the value of the HTML property _sym_ to _value_ for the element represented by _properties_. See also Elementset_property.
def []=(attribute,value) `c$Element.prototype.m$set_property.call(#{@element},attribute,value)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modify_properties(properties_element)\n end", "def set(property, value)\n self.send(\"#{property}=\".to_sym, value)\n end", "def properties=(value)\n if value == @defaults['properties']\n @values.delete 'properties' if @values.key? 'properties'\n else\n @v...
[ "0.6095027", "0.5930584", "0.57478195", "0.5737717", "0.566323", "0.5661921", "0.56003034", "0.55820966", "0.55328035", "0.55230093", "0.54658127", "0.5457836", "0.5430206", "0.5412385", "0.53918654", "0.538977", "0.538977", "0.53766876", "0.53004885", "0.52950263", "0.529230...
0.5025568
43
callseq: properties.delete(sym) > object or nil If the element represented by _properties_ has the HTML property _sym_, unsets the property and returns its value, otherwise returns +nil+. See also Elementremove_property.
def delete(attribute) `c$Element.prototype.m$remove_property.call(#{@element},attribute)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_property(attribute)\n `var el=this.__native__,attr=attribute.__value__,bool=c$Element.__boolean_attributes__[attr],key=c$Element.__boolean_attributes__[attr]||bool`\n `key ? el[key]=bool?false:'' : el.removeAttribute(attr)`\n return self\n end", "def discard_property\n if(object.is_a?(S...
[ "0.60504", "0.6023277", "0.5966245", "0.5948493", "0.5939446", "0.5919866", "0.59043974", "0.58938074", "0.58246213", "0.57730514", "0.57647836", "0.57647836", "0.5692826", "0.5613106", "0.56059253", "0.55982214", "0.55518836", "0.5486776", "0.54565436", "0.5401808", "0.53793...
0.5708996
12
callseq: properties.set?(sym) > true or false Returns +true+ if the HTML property _sym_ is set for the element represented by _properties_, +false+ otherwise.
def set?(attribute) `$T(c$Element.prototype.m$get_property.call(#{@element},attribute))` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def property_is_set?(name)\n property = self.class.properties[name.to_sym]\n raise ArgumentError, \"Property #{name} is not defined in class #{self}\" unless property\n\n property.is_set?(self)\n end", "def property?(prop_name)\n return false if properties_info[prop_name.to_sym].nil?...
[ "0.6316356", "0.6111512", "0.60378295", "0.60213685", "0.6002882", "0.59922653", "0.5980293", "0.58537173", "0.58364606", "0.57960933", "0.5786382", "0.5681602", "0.5659493", "0.56391805", "0.560785", "0.56075275", "0.5511362", "0.5482264", "0.54650754", "0.54106736", "0.5408...
0.59403944
7
callseq: styles[sym] > object Returns the value of the CSS style _sym_ for the element represented by _styles_, or +nil+ if no such style is applied. See also Elementget_style.
def [](attribute) `c$Element.prototype.m$get_style.call(#{@element},attribute)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def style(*styles, fg: nil, bg: nil)\n # convert styles to codes\n codes = STYLES.values_at(*styles.flatten).compact\n\n # convert foreground and background codes\n codes.push(*coerce_rgb_code(fg))\n codes.push(*coerce_rgb_code(bg, bg: true))\n\n style_code(codes)\n end", "def st...
[ "0.6209656", "0.60506004", "0.5979212", "0.5916568", "0.57563543", "0.56957686", "0.56538707", "0.56521976", "0.56365854", "0.5552973", "0.545317", "0.5446388", "0.54425305", "0.5422591", "0.5405705", "0.5397467", "0.5390482", "0.5354719", "0.5320205", "0.5300583", "0.5292278...
0.50731796
30
callseq: styles[sym] = value > value Sets the value of the CSS style _sym_ to _value_ for the element represented by _styles_. See also Elementset_style.
def []=(attribute, value) `c$Element.prototype.m$set_style.call(#{@element},attribute,value)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def style(value)\n attributes[:style] = value\n end", "def styles(styles)\n @styles.set(styles)\n yield(self) if block_given?\n self\n end", "def set_style(*v)\n styles = v.map { |i| @@style[i.to_sym] }.transpose\n prepend(\"\\e[\" << styles[0].join(';') << '...
[ "0.5528193", "0.54418623", "0.54019326", "0.53454787", "0.52413285", "0.5190505", "0.5135042", "0.5132833", "0.51146114", "0.50955254", "0.4996602", "0.49825397", "0.49150568", "0.48570615", "0.4838619", "0.48153877", "0.47680357", "0.4692565", "0.4661882", "0.46436167", "0.4...
0.5109696
9
callseq: styles.clear > styles Removes the CSS styles that have been applied to the element represented by _styles_. See also Elementclear_styles.
def clear `c$Element.prototype.m$clear_styles.call(#{@element})` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(*styles_to_clear)\n if styles_to_clear.any?\n queue_some_for_delete(*styles_to_clear)\n else\n queue_all_for_delete\n @queued_for_write = {}\n @errors = {}\n end\n end", "def clear_styles\n `this.__native__.style.cssText=''`\n return self\...
[ "0.7493624", "0.7123405", "0.6612035", "0.6121467", "0.5580768", "0.54179466", "0.5411694", "0.53974235", "0.5371504", "0.5362519", "0.5355055", "0.53535116", "0.5315364", "0.5314683", "0.5250864", "0.5222881", "0.51945806", "0.5188489", "0.5180179", "0.51646966", "0.51317036...
0.80599374
0
callseq: styles.delete(sym) > object or nil If the element represented by _styles_ has the CSS style _sym_ applied, removes the style and returns its value, otherwise returns +nil+. See also Elementremove_style.
def delete(attribute) `c$Element.prototype.m$remove_style.call(#{@element},attribute)` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_style(style_str, screen)\n if screen\n styles_pool[screen]&.delete(style_str)\n elsif styles_pool[:_common]\n styles_pool[:_common].delete(style_str)\n end\n end", "def remove_styles(*args)\n args.each {|x| self.remove_style(x) }\n return self\n end",...
[ "0.6374886", "0.59525496", "0.59194034", "0.58872914", "0.57681686", "0.5705003", "0.5585287", "0.5508445", "0.54657346", "0.54110324", "0.53813493", "0.5371126", "0.5362239", "0.53467476", "0.5277308", "0.52584916", "0.5226139", "0.52058035", "0.5180572", "0.5122135", "0.505...
0.57478505
5
callseq: styles.set?(sym) > true or false Returns +true+ if the element represented by _styles_ has the CSS style _sym_ applied, +false+ otherwise.
def set?(attribute) `$T(c$Element.prototype.m$get_style.call(#{@element},attribute))` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_style?(style)\n @styles.include? style\n end", "def style_changed?(new_styles)\n new_styles.each_pair.any? do |key, value|\n @style[key] != value\n end\n end", "def process(styles, options={}, &block)\n @styles = styles\n return false if styles.empty?\n...
[ "0.70343804", "0.62145483", "0.59537923", "0.59222376", "0.5839107", "0.5620053", "0.5568072", "0.55389154", "0.55241174", "0.53466386", "0.5284574", "0.52802277", "0.5271874", "0.52584195", "0.5249528", "0.5240333", "0.52099204", "0.5191642", "0.5187175", "0.51662344", "0.51...
0.6257459
1
Use callbacks to share common setup or constraints between actions.
def set_notice @notice = Notice.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 notice_params params.fetch(:notice, {}) 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
test does not seem to update deleted_by_sender or deleted_by_recipient fields and does not remove record. I don't know why, the code works when tested manually.
def test_should_destroy_message old_count = Message.count assert_equal false, messages(:jane_to_john).deleted_by_sender assert_equal false, messages(:jane_to_john).deleted_by_recipient login_as(:john) delete :destroy, :id => 2 assert_redirected_to messages_path #assert_equal true, message...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark_as_deleted!(deleted_by_recipient)\n \n # first of all, mark the message as deleted by current_user -> sender or recipient\n if deleted_by_recipient\n puts \"receipent delete\"\n self.deleted_by_recipient = true\n else\n puts \"sender delete\"\n self.deleted_by_sender = true...
[ "0.68805027", "0.6451849", "0.63266844", "0.6244542", "0.62116295", "0.62116295", "0.62026924", "0.62026924", "0.6178466", "0.6138183", "0.60924554", "0.60167646", "0.5998225", "0.59961414", "0.59961414", "0.5874603", "0.5827135", "0.5810393", "0.58085376", "0.579801", "0.577...
0.7160605
0
Decorates an event stream when it is appended to the event store
def decorate_for_append(type_identifier, aggregate, stream) stream end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(stream, *events)\n @store[stream]\n events.each { |event| @store[stream] << event }\n puts '+' * 80\n end", "def envolve(stream, producer, payload)\n events = get_stream(stream)\n new_events = producer.call(events, payload)\n @store[stream] += new_events\n puts '<' * 80\n end", ...
[ "0.67051923", "0.6592702", "0.60213095", "0.5991449", "0.5979756", "0.596931", "0.59103227", "0.57235837", "0.56251067", "0.5621809", "0.55711055", "0.5528039", "0.55200845", "0.53715706", "0.5367272", "0.53549707", "0.53457004", "0.5280449", "0.5274431", "0.5229864", "0.5222...
0.7464383
0
Is this wacky syntax useful for anything? t2 :set . run = "poop"
def t2(*args) OpenStruct.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def t2\n tc('t2.vs')\nend", "def CTT02=(arg)", "def set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n type = SET\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 158:7: 'set'\n ...
[ "0.56232303", "0.5527168", "0.5508768", "0.54640335", "0.5436198", "0.5415714", "0.54029727", "0.5400498", "0.53915215", "0.5382478", "0.53812504", "0.537527", "0.5359652", "0.5352492", "0.5329119", "0.5309043", "0.5308408", "0.53047776", "0.5297951", "0.527845", "0.5244051",...
0.0
-1
"To be as competitive as possible, we decide to have a decreasing pricing for longer rentals."
def calculate_price number_of_days = calculate_number_of_days if number_of_days == FIRST_RANGE_LOWER_INTERVAL price_time_component = @car.price_per_day elsif number_of_days > FIRST_RANGE_LOWER_INTERVAL && number_of_days <= SECOND_RANGE_LOWER_INTERVAL # price per day decreases by 10% after 1 day price_ti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_sale_price \n noi(num_years_to_hold + 1) / cap_rate(num_years_to_hold + 1)\n end", "def goods_produced\n (0.2 * base_production + trade_goods_bonus).round(6)\n end", "def final_price\n price * (100 - discount) / 100\n end", "def cigaret_price\n 0.30\n end", "def mark_up_amt\n rou...
[ "0.6924555", "0.6820217", "0.6724762", "0.6663106", "0.66629845", "0.66580445", "0.662854", "0.6579207", "0.6561366", "0.65523946", "0.65332204", "0.6526996", "0.6521764", "0.65168923", "0.6515416", "0.6511018", "0.65025336", "0.6490559", "0.6480944", "0.6480444", "0.64556044...
0.0
-1
send inquiry contact email to website owner
def new_inquiry(name, email, phone, message) mail( :to => ENV['GMAIL_USERNAME'], :from => ENV['GMAIL_USERNAME'], :subject => 'NEW INQUIRY' + ' from ' + name, :body => message ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_signup_email(enquiry)\n @enquiry = enquiry\n mail( :to => 'info@refunction.ca',\n :subject => 'Customer Enquiry' )\n end", "def inquiry(contact_message)\n @contact_message = contact_message\n mail to: \"newsletterstar@gmail.com\",\n from: contact_message.email,\n ...
[ "0.7812812", "0.77086323", "0.764063", "0.7634006", "0.7610687", "0.75704503", "0.749198", "0.7489423", "0.74704915", "0.7462062", "0.73981416", "0.73963565", "0.7390423", "0.7290029", "0.72733074", "0.7255436", "0.72474927", "0.71638125", "0.71367353", "0.71307904", "0.71171...
0.71446514
18
mutation method _obj is the parent element (nil in this case) _ctx is the GraphQL context
def call(_obj, args, ctx) Link.create! description: args[:description], url: args[:url], user: ctx[:current_user] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update!(**args)\n @mutation_context = args[:mutation_context] if args.key?(:mutation_context)\n end", "def update!(**args)\n @mutation_context = args[:mutation_context] if args.key?(:mutation_context)\n end", "def update!(**args)\n @mutation_context = args[:mutation...
[ "0.57582986", "0.57582986", "0.57582986", "0.562751", "0.53723574", "0.5327387", "0.52956736", "0.5218655", "0.52169263", "0.51192355", "0.5006992", "0.49932274", "0.49763986", "0.49758187", "0.49649394", "0.4953065", "0.49202985", "0.482851", "0.47992802", "0.47471708", "0.4...
0.0
-1
config.around(:each) do |example| ActiveRecord::Base.transaction do example.run raise ActiveRecord::Rollback end end The above code comes with spec_helper.rb by default, the code below is what I added the blow code is 3 methods,the first creates a state, the second creates a user, and the third one logs in a user. Putt...
def create_state State.create(state:'TX') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup\n\n create_new_user({id: 1,\n username: \"user1\",\n email: \"user1@example.com\",\n password: \"password\",\n password_confirmation: \"password\"})\n create_new_user({id: 2,\n username...
[ "0.60445094", "0.60006297", "0.58250016", "0.57974577", "0.5796162", "0.57716024", "0.57346994", "0.5705188", "0.5687958", "0.56729674", "0.5666363", "0.5665227", "0.5644206", "0.56031233", "0.55968595", "0.5596562", "0.5580214", "0.55797005", "0.5538692", "0.5523665", "0.551...
0.55523664
18
this creates a user, I just put it here so I can have a basic example to work with. For example, in sessions_controller_spec.rb, at the top I have: before do
def log_in(user, password='password', email='email') visit new_session_path #tells rspec which link to go to, can also specify the link, ex: visit '/session/new' if email == 'email' fill_in 'email', with: user.email # this just checks if I didn't input the email paramter. If I did, then it wouldn't be 'em...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_user\n user = create(:user)\n login_as(user, scope: :user)\n end", "def create_user\n User.create name: \"test\", email: \"test@example.com\", password: \"123456\"\n end", "def create_user\n User.create name: 'test', email: 'test@example.com', password: '123456'\n end", "def ...
[ "0.78777826", "0.78524834", "0.78503007", "0.76819676", "0.75862366", "0.7550309", "0.7502645", "0.74848384", "0.73926044", "0.7389541", "0.73823893", "0.73801565", "0.7369465", "0.7325631", "0.7325261", "0.73090297", "0.7302317", "0.7301597", "0.7298556", "0.728784", "0.7271...
0.0
-1
GET /ratings/1 GET /ratings/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ratings\n Birdman::Requester.get(\"movies/#{id}/ratings\")\n end", "def index\n @ratings = Rating.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ratings }\n end\n end", "def index\n @ratings = Rating.all\n\n respond_to do |format|\n...
[ "0.79479593", "0.7569988", "0.7569988", "0.7569988", "0.7533048", "0.7533048", "0.7533048", "0.7461376", "0.7443839", "0.7254109", "0.71720254", "0.71525574", "0.71525574", "0.71525574", "0.6919846", "0.687797", "0.685387", "0.6787376", "0.67247385", "0.6721159", "0.6705848",...
0.0
-1
POST /ratings POST /ratings.json
def create @rating = Rating.new @rating.user_id = params[:user_id] @rating.rate = params[:rate].to_i if @answer if @answer.user_id == current_user.id redirect_to @post, alert: "You can't rate your own answer." and return end @rating.answer_id = @answer.id @answer.rati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\r\n rating = Rating.create(score: params[:score], comment: params[:comment], rater_id: current_user.id, ratee_id: params[:ratee_id])\r\n\r\n if rating.save\r\n render json: rating\r\n else\r\n render json: { error: \"Rating creating error\" }, status: :unprocessable_entity\r\n end\...
[ "0.7309379", "0.7308457", "0.71287555", "0.7037013", "0.68736815", "0.677953", "0.67712134", "0.67655545", "0.67461497", "0.6732804", "0.6691654", "0.6690826", "0.6685617", "0.6665971", "0.662996", "0.6619785", "0.6600474", "0.6595148", "0.6592155", "0.65689254", "0.6547833",...
0.6321144
35
PATCH/PUT /ratings/1 PATCH/PUT /ratings/1.json
def update if @answer if @answer.user_id == current_user.id redirect_to @post, alert: "You can't rate your own answer." and return end @rating.answer_id = @answer.id @answer.rating_score += @rating.rate @answer.save else if @post.user_id == current_user.id ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @rating = Rating.find(params[:id])\n\n respond_to do |format|\n if @rating.update_attributes(params[:rating])\n format.html { redirect_to @rating, notice: 'Rating was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\"...
[ "0.7331691", "0.73204297", "0.718708", "0.7138605", "0.7128801", "0.70639634", "0.6904285", "0.68417764", "0.6800094", "0.6787205", "0.6785595", "0.67550427", "0.6741723", "0.6722049", "0.6716543", "0.6709174", "0.6697767", "0.66961026", "0.6669806", "0.66443074", "0.66338676...
0.0
-1
DELETE /ratings/1 DELETE /ratings/1.json
def destroy @rating.destroy respond_to do |format| format.html { redirect_to ratings_url, notice: 'Rating was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @rating.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @rating = Rating.find(params[:id])\n @rating.destroy\n\n respond_to do |format|\n format.html { redirect_to ratings_url }\n format.json { head :ok }\n end\n ...
[ "0.7766074", "0.77041376", "0.7688728", "0.7495329", "0.74287987", "0.71717685", "0.71169704", "0.70956814", "0.7065442", "0.7025573", "0.70206547", "0.701196", "0.6982104", "0.69804466", "0.6964511", "0.6940283", "0.6907258", "0.6891105", "0.688661", "0.6858959", "0.6856145"...
0.73097146
6
Use callbacks to share common setup or constraints between actions.
def set_rating @rating = Rating.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.6162554", "0.60452986", "0.5945278", "0.59169763", "0.58877826", "0.5834763", "0.5775349", "0.5704972", "0.5704972", "0.56543803", "0.5621491", "0.5427202", "0.54093206", "0.54093206", "0.54093206", "0.53975695", "0.53776276", "0.53562194", "0.5340594", "0.5337824", "0.532...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def rating_params params.require(:rating).permit(:user_id, :rate, :answer_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.69811666", "0.6782836", "0.6747644", "0.6742015", "0.6735273", "0.6593917", "0.65037674", "0.6498627", "0.6482372", "0.64795715", "0.64566946", "0.6439213", "0.6380714", "0.6378147", "0.63657266", "0.63206697", "0.6300169", "0.62992156", "0.6295538", "0.62943023", "0.62915...
0.0
-1
User Account Balance every deposit adds to account balance, every transaction takes away
def account_balance balance = 0 deposits.each {|deposit| balance += deposit.amount} transactions.each do |transaction| amount = transaction.price * transaction.num_shares transaction.order_type == 'BUY' ? balance -= amount : balance += amount end return balance.round(2) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def balance(account)\n net_deposits(account) - net_withdraws(account)\n end", "def balance\n txns.inject(Amount::ZERO) { |sum, t| sum + t.amount }\n end", "def balance\n @balance ||= starting_balance + transactions.inject(0) do |result, element|\n result + element.amount\n end\n end", ...
[ "0.7585994", "0.7539662", "0.74724126", "0.7466728", "0.74341756", "0.7357658", "0.72970253", "0.7293095", "0.7262057", "0.7230596", "0.72272164", "0.72128814", "0.71650356", "0.71370673", "0.71365047", "0.7121214", "0.7118401", "0.7097968", "0.7096826", "0.70938903", "0.7086...
0.778249
0
GET /product_owners/1 GET /product_owners/1.json
def show @product_owner = ProductOwner.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @product_owner } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @product_owners = ProductOwner.all\n end", "def get_owners\n return make_request(\"#{self.endpoint}/list/owners\")\n end", "def product_owner_params\n params[:product_owner]\n end", "def index\n @owners = Owner.all\n render json: @owners, include: [], adapt...
[ "0.76524216", "0.7536293", "0.6712182", "0.65920293", "0.6553372", "0.65123767", "0.6510895", "0.6400844", "0.63863766", "0.6370144", "0.6335187", "0.6316979", "0.6272686", "0.6272686", "0.6232447", "0.6226577", "0.6197152", "0.6151325", "0.6125245", "0.611836", "0.6085895", ...
0.73384905
2
GET /product_owners/new GET /product_owners/new.json
def new @product_owner = ProductOwner.new respond_to do |format| format.html # new.html.erb format.json { render json: @product_owner } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @product_owner = ProductOwner.new(params[:product_owner])\n\n respond_to do |format|\n if @product_owner.save\n format.html { redirect_to @product_owner, notice: 'Product owner was successfully created.' }\n format.json { render json: @product_owner, status: :created, location...
[ "0.7390083", "0.7249103", "0.7077108", "0.65144473", "0.6511177", "0.6506571", "0.6490629", "0.644047", "0.64299035", "0.6331044", "0.6309474", "0.62976784", "0.62820613", "0.62778693", "0.6269079", "0.62447876", "0.62434554", "0.6241529", "0.6223699", "0.62127846", "0.617513...
0.7763624
0
POST /product_owners POST /product_owners.json
def create @product_owner = ProductOwner.new(params[:product_owner]) respond_to do |format| if @product_owner.save format.html { redirect_to @product_owner, notice: 'Product owner was successfully created.' } format.json { render json: @product_owner, status: :created, location: @product_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @product_owner = ProductOwner.new(product_owner_params)\n\n respond_to do |format|\n if @product_owner.save\n format.html { redirect_to @product_owner, notice: 'Product owner was successfully created.' }\n format.json { render :show, status: :created, location: @product_owner ...
[ "0.7044359", "0.6654602", "0.6422898", "0.60939926", "0.60318875", "0.5963036", "0.5959567", "0.59528136", "0.5809576", "0.5807849", "0.5753986", "0.57060164", "0.5674087", "0.566269", "0.5640855", "0.562087", "0.5608182", "0.56013334", "0.55697864", "0.5551896", "0.5538038",...
0.6975262
1
PUT /product_owners/1 PUT /product_owners/1.json
def update @product_owner = ProductOwner.find(params[:id]) respond_to do |format| if @product_owner.update_attributes(params[:product_owner]) format.html { redirect_to @product_owner, notice: 'Product owner was successfully updated.' } format.json { head :no_content } else f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @product_owner.update(product_owner_params)\n format.html { redirect_to @product_owner, notice: 'Product owner was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_owner }\n else\n format.html { render ...
[ "0.7072099", "0.70434135", "0.6450226", "0.64500093", "0.635573", "0.62896734", "0.6117797", "0.59790164", "0.59731126", "0.59606194", "0.5941456", "0.5825746", "0.5825746", "0.58148855", "0.57462406", "0.57360274", "0.5707357", "0.56912017", "0.568601", "0.56788945", "0.5662...
0.7010998
2
DELETE /product_owners/1 DELETE /product_owners/1.json
def destroy @product_owner = ProductOwner.find(params[:id]) @product_owner.destroy respond_to do |format| format.html { redirect_to product_owners_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @product_owner.destroy\n respond_to do |format|\n format.html { redirect_to product_owners_url, notice: 'Product owner was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @owner.destroy\n respond_to do |format|\n format.html ...
[ "0.7599877", "0.706324", "0.702121", "0.69692624", "0.6921174", "0.6821001", "0.6821001", "0.6821001", "0.6797748", "0.6721777", "0.6710075", "0.6709864", "0.6695947", "0.66560036", "0.6652342", "0.665163", "0.66200584", "0.6615357", "0.6589725", "0.65533763", "0.6552875", ...
0.787905
0
provides getters and setters for specified variables attr_reader :username provides only the getter, not the setter
def initialize(firstname, lastname, username, email, password) @first_name = firstname @last_name = lastname @username = username @email = email @password = password end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def username #for each attribute of a class you have two methods a reader and a writer method (same as a gettter and setter methods)\n return @username #the variable \"@username\" is ONLY created when the WRITER, NOT the reader is called; it's created when lana.username - \"lana\" is called ; if the reader is c...
[ "0.82416904", "0.7645535", "0.73043984", "0.7163875", "0.7014678", "0.6908975", "0.6869919", "0.6869919", "0.6869919", "0.6869919", "0.67668533", "0.6762323", "0.6762323", "0.6762323", "0.6762323", "0.6712332", "0.6674625", "0.65957236", "0.6548558", "0.6548558", "0.6548558",...
0.0
-1
def initialize(role_id = 0)
def role?(role_name) role == role_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init\n self.role ||= \"standard\" #will set the default value only if it's nil\n end", "def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end", "def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end", "def setup...
[ "0.76505226", "0.762831", "0.762831", "0.762831", "0.7514657", "0.74968064", "0.7351741", "0.7276061", "0.70976686", "0.70689493", "0.7043017", "0.7002961", "0.6983019", "0.6942275", "0.6942275", "0.69169366", "0.68529886", "0.68448985", "0.6786835", "0.6768706", "0.6748578",...
0.0
-1
must be after :game, :game_set, and :league
def index respond_to do |format| format.html # index.html.erb format.xml { render :xml => @games } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def league; end", "def team; end", "def team; end", "def team; end", "def team; end", "def team; end", "def team; end", "def is_game_over?; won_by?(:hunter) || won_by?(:prey) end", "def unusual_sport; end", "def create_group_stage_game(game) \n \n if Game.cup_home_away_exist?(self, game[...
[ "0.6292009", "0.5878749", "0.5878749", "0.5878749", "0.5878749", "0.5878749", "0.5878749", "0.57795537", "0.5742698", "0.570272", "0.56577164", "0.5557147", "0.5524707", "0.54615206", "0.54166996", "0.54112124", "0.5398445", "0.539282", "0.5391479", "0.5382477", "0.53712445",...
0.0
-1
FUNCTIONS get_page_nav creates an instance var to store the pages from the db
def get_page_nav @page_nav = Page.where(display_in_menu: 't').where(is_published: 't').order(id: :asc) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pages\n @pages ||= get_pages\n end", "def pages\n @pages \n end", "def pages\n @pages ||= []\n end", "def getNavBar(unitID, pageName, navItems)\n if navItems\n navItems.each { |navItem|\n if navItem['slug']\n navItem['url'] = \"/uc/#{unitID}#{navItem['slug']==\"\" ? \"...
[ "0.673646", "0.6587849", "0.65356666", "0.6515442", "0.6487062", "0.6427968", "0.6424927", "0.6405672", "0.6400109", "0.6377113", "0.63252497", "0.63152826", "0.63009036", "0.6237529", "0.62183446", "0.62183446", "0.6188859", "0.61706126", "0.6144396", "0.6111554", "0.6106657...
0.7954518
0
end get_page_nav FUNCTION creates an instance var to store the blocks from the db
def get_all_blocks @all_blocks = Block.where(is_published: 't') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_page_nav\n\n @page_nav = Page.where(display_in_menu: 't').where(is_published: 't').order(id: :asc)\n\n end", "def render_nav( current_user, params, nav ) \n # nav blocks is array of blocks' navigation element (without the divider yet)\n nav_blocks = []\n nav_blocks_string = \"\"\n @is_nav...
[ "0.6385481", "0.6100732", "0.5862254", "0.5806241", "0.57815856", "0.57659334", "0.5737653", "0.56911606", "0.5654682", "0.5617938", "0.5616385", "0.5600731", "0.55855274", "0.5543114", "0.5533513", "0.55239123", "0.5520976", "0.54884946", "0.54785395", "0.5465061", "0.545037...
0.5065389
98
all caps the string
def string_in_all_caps(the_string) puts 'your string in all caps is ' + the_string.upcase end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def caps(str)\n str.upcase\n end", "def caps(string)\n return string.upcase\nend", "def caps(string)\n return string.upcase\nend", "def all_caps(string)\n\tif string.length > 10\n\t return string.upcase!\n \telse\n \t return string\n \tend\nend", "def caps (string)\n\tif string.length > 10 \n\t\tst...
[ "0.85416645", "0.8072894", "0.8072894", "0.8025455", "0.79291886", "0.7877017", "0.78497636", "0.7668683", "0.75220144", "0.7503145", "0.7499998", "0.7499998", "0.7499998", "0.7499998", "0.7494921", "0.74913263", "0.7487667", "0.7476225", "0.7465324", "0.74528027", "0.7444312...
0.806768
3