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
skip_before_filter :authorize, :only => [:show, :new, :create] GET /members/1/edit GET /members GET /members.xml
def validate_me @member = Member.find(params[:id]) @member.send_validation_email respond_to do |format| format.html end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n redirect_to useradmin_members_path(params[:id])\n end", "def show\n skip_authorization\n end", "def index\n #@members = member.all\n #@members = member.with_restricted_access_access\n @members = policy_scope(Member)\n end", "def index\n @pending_affiliations = Affiliation.find...
[ "0.6444065", "0.63825685", "0.6350558", "0.6272049", "0.6177851", "0.6152723", "0.61238974", "0.61238974", "0.6118133", "0.60910034", "0.60751176", "0.6057838", "0.60511726", "0.5984137", "0.59630615", "0.59555984", "0.59336203", "0.5929755", "0.59128886", "0.59123147", "0.59...
0.0
-1
GET /members/new GET /members/new.xml
def new @member = Member.new @member.email = @search_string ||= "" respond_to do |format| format.html # new.html.erb format.xml { render :xml => @member} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @member = Member.new\n @title = \"New member\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { re...
[ "0.7645127", "0.75905365", "0.75905365", "0.75905365", "0.73785937", "0.7339909", "0.73335916", "0.7262581", "0.71329445", "0.71195185", "0.71195185", "0.71195185", "0.71195185", "0.71195185", "0.71195185", "0.71195185", "0.6980091", "0.69704103", "0.69519126", "0.69349664", ...
0.70735514
16
PUT /members/1 PUT /members/1.xml
def update @member = Member.find(params[:id]) respond_to do |format| if @member.update_attributes(params[:member]) Emailer.welcome_email(@member).deliver format.html { redirect_to(@member, :notice => 'Member was successfully updated.') } format.xml { head :ok } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Member was successfully updated.'\n format.html { redirect_to '/members/myindex' }\n format.xml { head :ok }\n else\n format.ht...
[ "0.6269145", "0.6249128", "0.6249128", "0.6236707", "0.6228516", "0.61484236", "0.6046281", "0.6043036", "0.6031233", "0.59462476", "0.594322", "0.59085166", "0.5906704", "0.59049994", "0.5901699", "0.588197", "0.5859677", "0.58532315", "0.58532315", "0.58532315", "0.58532315...
0.5881651
16
DELETE /members/1 DELETE /members/1.xml
def destroy @member = Member.find(params[:id]) @member.destroy respond_to do |format| format.html { redirect_to(members_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n f...
[ "0.7141851", "0.7141851", "0.7141851", "0.7141851", "0.70842797", "0.70696974", "0.70696974", "0.70323604", "0.69961685", "0.6849304", "0.6777742", "0.6717248", "0.6684298", "0.6666834", "0.66305155", "0.6599085", "0.6599085", "0.6592147", "0.65882736", "0.65861404", "0.65861...
0.7257433
0
Create a method that adds a new player to the players array.
def test_add_team_player @team.add_team_player("Chloe") assert_equal("Chloe",@team.players.last) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_player(new_player)\n @players << new_player\n end", "def add_new_player(new_player)\n players.push(new_player)\n end", "def add_new_player(new_player)\n @players.push(new_player)\n end", "def add_new_player(new_player)\n @players.push(new_player)\nend", "def add_player_to_players(pla...
[ "0.90403396", "0.90256566", "0.88572186", "0.8794092", "0.8728051", "0.87264353", "0.8580402", "0.84765637", "0.8443745", "0.8371832", "0.83629704", "0.82856673", "0.81945497", "0.8167648", "0.8019482", "0.8019482", "0.7939238", "0.7760898", "0.77050006", "0.7642282", "0.7636...
0.60104614
93
Add a method that takes in a string of a player's name and checks to see if they are in the players array.
def test_check_player_in__true result = @team.check_player_in("Valentina") assert_equal(true,result) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_name_in_players(player_name)\n return true if @players.include?(player_name)\nend", "def search_players(search_names)\n @player_names.include?(each_player)\n end", "def member?(player)\n players.include?(player)\n end", "def player(player_name)\n players.find{|player| player.name == p...
[ "0.74835926", "0.6648027", "0.65395707", "0.65020823", "0.64950347", "0.64687777", "0.6429911", "0.63458514", "0.62315506", "0.61842775", "0.61831796", "0.60775894", "0.60381764", "0.6021471", "0.601643", "0.59941936", "0.5988815", "0.5965177", "0.59152746", "0.5872955", "0.5...
0.0
-1
Add a points property into your class that starts at 0.
def test_add_points assert_equal(0,@team.points) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_points\n self.points ||= 0.0\n end", "def add_points_property(points_gained)\n @points = points_gained\n return @points\nend", "def set_points!\n self.points = 0 unless self.points.presence\n end", "def initialize_points\n self.current_points = 0\n self.expiring_points =...
[ "0.81180793", "0.7746719", "0.7737274", "0.753523", "0.7382177", "0.732844", "0.7149211", "0.71415704", "0.7119873", "0.70620877", "0.6903722", "0.68546915", "0.68369204", "0.68369204", "0.66676635", "0.6608889", "0.65687954", "0.6565761", "0.656014", "0.6543312", "0.65330774...
0.0
-1
Create a method that takes in whether the team has won or lost and updates the points property for a win.
def test_update_points @team.update_points("win") assert_equal(3,@team.points) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_points__when_win\n sports_team = SportsTeam.new('Benfica', ['Rafa', 'Raul', 'Pizzi', 'Odisseias'], 'Bruno Nascimento', 0)\n sports_team.add_or_remove_points(2)\n assert_equal(2, sports_team.points())\n end", "def wins_ball(winner)\n # TODO: Think it's gross to pass an integer instead ...
[ "0.73651993", "0.73214626", "0.7277738", "0.7183555", "0.71566975", "0.6975616", "0.6970831", "0.6970334", "0.6961573", "0.6930382", "0.6930382", "0.6930382", "0.6930382", "0.6930382", "0.6930382", "0.6930382", "0.6930382", "0.6808958", "0.68005425", "0.67830366", "0.676962",...
0.61420965
53
Refiere a la cantidad maxima de respuestas que se da en alguna respuesta
def max_position @words.first[1].length end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximo()\n\t\tmaximo = 0;\n\t\t@hash_no_nulos.each do |key,valor|\n\t\t\tif (valor > maximo)\n\t\t\t\tmaximo = valor\n\t\t\tend\n end\n\t\treturn maximo\n\tend", "def get_max_results\n @max_results\n end", "def doGetMaxCountPerRequest()\n end", "def max\n\t\tm = self.valor[0]\n\...
[ "0.6505084", "0.63971597", "0.63698184", "0.6203888", "0.6185229", "0.61765563", "0.61747503", "0.61329865", "0.611008", "0.6109654", "0.60976315", "0.60970557", "0.609487", "0.6080438", "0.60525876", "0.6027249", "0.6015063", "0.60144085", "0.60144085", "0.59947824", "0.5986...
0.0
-1
POST /comments POST /comments.json
def create @comment = @match.comments.create(body: comment_params[:body], user_id: current_user.id) contact = Contact.new subject = I18n.t(:subject, scope: 'custom.controller.comment', nom: "#{current_user.nom} #{current_user.prenom}") contact.build(current_user, subject, @comment) @match.users.each...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @comment = @post.comments.new(comment_params)\n if @comment.save\n render json: @comment, status: :created\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n\n end", "def comment options={}\n client.post(\"/#{id}/comments\", options)\n end", ...
[ "0.75120175", "0.74212646", "0.7374645", "0.72364116", "0.7205224", "0.7086658", "0.7069151", "0.70549524", "0.7049054", "0.6989455", "0.69825", "0.69657713", "0.69578165", "0.6910411", "0.6909373", "0.68731725", "0.6871654", "0.6822542", "0.6810818", "0.6787486", "0.6785412"...
0.0
-1
DELETE /comments/1 DELETE /comments/1.json
def destroy @comment = @match.comments.find(params[:id]) @comment.destroy respond_to do |format| format.html { redirect_to match_url(@match) } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @comment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n\n @comment.destroy\n render json: @comment, status: :ok\n\n end", "def destroy\n @comment1 = Comment1.find(params[:id])\n @comment1.destroy\n\n respond_to do |f...
[ "0.7561756", "0.7436636", "0.7375283", "0.73687786", "0.7360027", "0.73558295", "0.7295163", "0.7295163", "0.7278833", "0.7270536", "0.72607595", "0.72607595", "0.72607595", "0.725645", "0.725645", "0.725645", "0.7242338", "0.7241291", "0.7240714", "0.7240714", "0.7240714", ...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_match @match = Match.find(params[:match_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 comment_params params.require(:comment).permit(:body) 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
Body should not be blank
def blank? redirect_to matche_url(@match), alert: I18n.t(:alert, scope: 'custom.controller.comment.blank') if comment_params[:body].blank? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def body?\n !body.empty?\n end", "def blank_body?\n Sanitize.clean(self.body).gsub(/[ | ]/, '').blank? \n end", "def body?\n\t\t\t\t\t@body and !@body.empty?\n\t\t\t\tend", "def set_body\n self.body = \"\" unless body\n body\n end", "def set_body\n self.body = \"\" unl...
[ "0.7720762", "0.75488925", "0.73216426", "0.7317211", "0.7317211", "0.71888477", "0.7062146", "0.70620996", "0.70530987", "0.7017217", "0.699865", "0.699865", "0.6779107", "0.67744946", "0.65909123", "0.656039", "0.65031093", "0.647461", "0.64611775", "0.6360594", "0.6332697"...
0.599313
45
Only admins have the right to create, update or destroy fields
def playing? redirect_to matche_url(@match), alert: I18n.t(:alert, scope: 'custom.controller.comment.playing') unless playing_user?(@match, current_user) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_only\n false\n end", "def update_permitted?\n\t\tacting_user.administrator?\n\tend", "def admin_only\n deny_access(\"Necesitas tener privilegios de administrador para entrar.\") unless signed_in_as_admin?\n end", "def create_permitted?\n acting_user.administrator?\n end", ...
[ "0.7368799", "0.7272396", "0.7267043", "0.72529113", "0.72529113", "0.72529113", "0.72529113", "0.7190417", "0.71455944", "0.7088465", "0.7069596", "0.706638", "0.70640886", "0.7057038", "0.7039171", "0.7008857", "0.69942725", "0.6983556", "0.6957856", "0.69491655", "0.694916...
0.0
-1
NOTE: This method doesn't look conventional on purpose. The app these bits are taken from has some crazy stuff in it.
def update if @appointment = Appointment.check_in(@visitor, appointment_params) redirect_to root_path, notice: 'Checked-in' else redirect_to root_path, alert: 'Failed check-in' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def schubert; end", "def anchored; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def formation; end", "def user_os_complex\r\n end", "def escaper; end", "def custom; end", "def custom; end", "def internal; end",...
[ "0.6901752", "0.60692203", "0.5702686", "0.5691652", "0.56804025", "0.56804025", "0.56804025", "0.56804025", "0.5652786", "0.55516195", "0.55463195", "0.5498524", "0.5498524", "0.5495907", "0.547546", "0.547546", "0.5463433", "0.5442009", "0.54256505", "0.541286", "0.53801763...
0.0
-1
This is to authenticate that the call is set from an account of the frontend
def authenticate_token @is_authenticated = false if request.headers["TOKEN"] if request.headers["TOKEN"] == "AppDipre" @is_authenticated = true end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auth(value); end", "def Authentication\n call('', '')\n end", "def auth\n end", "def auth\n end", "def authenticate\n end", "def authenticate\n auth.call(:authenticate)\n end", "def authenticate!\n # Do nothing yet\n end", "def authenticate(request)\n\n ...
[ "0.7170132", "0.7159344", "0.70388144", "0.70388144", "0.69791156", "0.6970143", "0.6838447", "0.68367535", "0.68132263", "0.6805527", "0.6782098", "0.6765327", "0.6759957", "0.6744766", "0.67396355", "0.67160964", "0.6682719", "0.6660883", "0.6660883", "0.66471606", "0.66456...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_news @news = New.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 trusted parameter "white list" through.
def news_params params.require(:news).permit(:title, :description, :publishedAt, :source, :urlToImage, :url) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7122899", "0.7054107", "0.69478", "0.6902101", "0.67359334", "0.67178756", "0.66889167", "0.6677724", "0.6661157", "0.6555896", "0.6527207", "0.64584696", "0.64517015", "0.6450208", "0.644749", "0.6435074", "0.6413329", "0.6413329", "0.6391818", "0.6380081", "0.6380081", ...
0.0
-1
The runtime implementation of the "+loop" word.
def vm_do_increment inc_raw = self.pop unless (inc_value = inc_raw.to_foorth_n) error "F40: Cannot convert a #{inc_raw.foorth_name} to a Numeric instance" end if inc_value > 0 inc_value else error "F41: Invalid loop increment value: #{inc_value}" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loop; end", "def pre_loop; end", "def preloop\n end", "def endless_loop?; end", "def kloop\n end", "def loop\n end", "def execute_LOOP(operand)\n\t\tjump_conditionally_to_signed_displacement(operand, !(perform_counting_loop.zero?))\n\tend", "def loop\n end", "def loop\n end", "def in...
[ "0.6558414", "0.63045776", "0.61335677", "0.61002433", "0.5985722", "0.59512186", "0.5949716", "0.5918068", "0.5918068", "0.5800301", "0.5762464", "0.57480127", "0.5734648", "0.57213163", "0.57209873", "0.5666757", "0.5648005", "0.56174916", "0.5610652", "0.5610652", "0.55935...
0.49930918
92
Gets the callee property value. Endpoint that answered this segment.
def callee return @callee end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def callee_number\n return @callee_number\n end", "def outgoing_value\n @attrs[\"outgoing\"]\n end", "def ref\n @messaging['optin']['ref']\n end", "def callee=(value)\n @callee = value\n end", "def endpoint\n data[:endpoint]\n ...
[ "0.65004194", "0.6003591", "0.58587825", "0.5806105", "0.5760108", "0.5760108", "0.57471466", "0.5636676", "0.5607761", "0.5594807", "0.5541302", "0.5511753", "0.54547656", "0.5419744", "0.5333241", "0.5323504", "0.53224605", "0.53224605", "0.52929014", "0.52490246", "0.52383...
0.6532976
0
Sets the callee property value. Endpoint that answered this segment.
def callee=(value) @callee = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def callee_number=(value)\n @callee_number = value\n end", "def caller=(value)\n @caller = value\n end", "def caller=(value)\n @caller = value\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end"...
[ "0.67240447", "0.6668522", "0.6668522", "0.58720046", "0.58720046", "0.58720046", "0.58720046", "0.58720046", "0.5836516", "0.5824575", "0.5733934", "0.5733601", "0.5733601", "0.5733601", "0.5733601", "0.5733601", "0.55291975", "0.54973894", "0.54761213", "0.53940296", "0.534...
0.75542843
0
Gets the caller property value. Endpoint that initiated this segment.
def caller return @caller end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def caller_number\n return @caller_number\n end", "def get_caller\n caller[1].split(\":\")[0]\n end", "def caller=(value)\n @caller = value\n end", "def caller=(value)\n @caller = value\n end", "def caller_url\n ni...
[ "0.71281666", "0.63679665", "0.62284625", "0.62284625", "0.61827785", "0.61818", "0.6156316", "0.6134045", "0.61147714", "0.6002349", "0.59033835", "0.5858972", "0.5819477", "0.58166873", "0.58166873", "0.58109987", "0.58109987", "0.5784983", "0.5784983", "0.57349116", "0.572...
0.67600423
2
Sets the caller property value. Endpoint that initiated this segment.
def caller=(value) @caller = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def caller_number=(value)\n @caller_number = value\n end", "def set_caller\n @caller = Caller.find(params[:id])\n end", "def callee=(value)\n @callee = value\n end", "def set_caller_params\n end", "def caller_number\n return @caller_...
[ "0.676467", "0.6691427", "0.6050619", "0.5765187", "0.55774933", "0.5522188", "0.5522188", "0.55168766", "0.55168766", "0.55168766", "0.5446346", "0.5434235", "0.5434235", "0.5434235", "0.5434235", "0.5434235", "0.5426773", "0.5337025", "0.5296629", "0.5295614", "0.5295614", ...
0.75288296
1
Instantiates a new callRecordsSegment and sets the default values.
def initialize() super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(record = nil, *)\n @record = record\n end", "def initialize(record)\n @record = record\n end", "def initialize_segments\n\t\t\t@line \t= Segment.new(self, 0, 0)\n\t\t\t@word = Segment.new(self, 0, 0)\n\t\t\t@selection = Segment.new(self, 0, 0)\n\t\tend", "def initiali...
[ "0.6027058", "0.5900391", "0.5839657", "0.574987", "0.5545598", "0.552628", "0.55014354", "0.54665476", "0.5451133", "0.54281175", "0.5410717", "0.53933007", "0.53340626", "0.5329714", "0.52454066", "0.5210699", "0.51884365", "0.51841325", "0.51841325", "0.5163802", "0.516266...
0.0
-1
Gets the endDateTime property value. UTC time when the segment ended. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z
def end_date_time return @end_date_time end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_time\n data.end_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_time\n eval(self.end) if self.end.present?\n end", "def ended_at\n Convert.millis_to_time @gapi.statistics.end_time\n end", "def end...
[ "0.6899383", "0.6835033", "0.66883427", "0.65824455", "0.65572745", "0.6471218", "0.63727134", "0.63727134", "0.63649833", "0.62673056", "0.6201399", "0.6201399", "0.6201399", "0.6201399", "0.6201399", "0.6201399", "0.6200145", "0.6195642", "0.61812514", "0.6168133", "0.61366...
0.6962315
6
Sets the endDateTime property value. UTC time when the segment ended. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z
def end_date_time=(value) @end_date_time = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_date_time=(value)\n @end_date_time = value\n end", "def end_time=(end_time)\n assert_unloaded\n raise ArgumentError, \"you have already set end_date\" if @end_date\n @end_time = end_time\n end", "def end_date=(end_date)\n assert_u...
[ "0.7250783", "0.6844995", "0.6517433", "0.6500622", "0.64702785", "0.6449737", "0.6152687", "0.61392915", "0.6139184", "0.60937876", "0.60534513", "0.60373616", "0.60373616", "0.60373616", "0.60373616", "0.60373616", "0.60373616", "0.60373616", "0.60180366", "0.599716", "0.59...
0.73430943
5
Gets the failureInfo property value. Failure information associated with the segment if it failed.
def failure_info return @failure_info end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def failure_info=(value)\n @failure_info = value\n end", "def get_FailureDescription()\n \t return @outputs[\"FailureDescription\"]\n \tend", "def failure_message\n @message\n end", "def failure_type\n @attributes[:failure_type]\n end", "def error_detail...
[ "0.72006786", "0.608494", "0.60647535", "0.58346087", "0.57439595", "0.5595279", "0.5586554", "0.5483551", "0.5422048", "0.5390115", "0.5385124", "0.53712237", "0.53430057", "0.53430057", "0.5338135", "0.5261866", "0.5255741", "0.51621836", "0.5144921", "0.5144702", "0.513901...
0.78241456
0
Sets the failureInfo property value. Failure information associated with the segment if it failed.
def failure_info=(value) @failure_info = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info=(info)\n if info.nil?\n fail ArgumentError, 'invalid value for \"info\", info cannot be nil.'\n end\n @info = info\n end", "def failure_info\n return @failure_info\n end", "def mark_failure\n self.failure_occurred = true\n end", "def mark_fa...
[ "0.5522867", "0.530572", "0.52207434", "0.52207434", "0.5138425", "0.5030642", "0.5016718", "0.5009727", "0.49940568", "0.49915618", "0.4876344", "0.4859861", "0.48050398", "0.4708275", "0.46937415", "0.46845797", "0.46688893", "0.46688893", "0.46688893", "0.46688893", "0.464...
0.7837434
0
The deserialization information for the current model
def get_field_deserializers() return super.merge({ "callee" => lambda {|n| @callee = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallRecordsEndpoint.create_from_discriminator_value(pn) }) }, "caller" => lambda {|n| @caller = n.get_object_value(lambda {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end", "def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },...
[ "0.6510734", "0.63224316", "0.6322254", "0.63094735", "0.62954384", "0.6238735", "0.6232461", "0.62155676", "0.6200175", "0.6199403", "0.6173917", "0.61733985", "0.61705345", "0.61631054", "0.61620396", "0.6158031", "0.6156071", "0.6142402", "0.613998", "0.6138061", "0.612005...
0.0
-1
Gets the media property value. Media associated with this segment.
def media return @media end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def media=(value)\n @media = value\n end", "def media\n parse(delete('media'))\n end", "def media\n self\n end", "def media_config\n return @media_config\n end", "def media_duration\n return @media_duration\n ...
[ "0.75548327", "0.7418938", "0.69695705", "0.6866331", "0.64596444", "0.6458818", "0.6394781", "0.6318138", "0.6283729", "0.62132555", "0.61702025", "0.6126942", "0.6081915", "0.607812", "0.60400516", "0.5974739", "0.5974739", "0.5974739", "0.5974739", "0.5974739", "0.5974739"...
0.773355
0
Sets the media property value. Media associated with this segment.
def media=(value) @media = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def...
[ "0.7867402", "0.7867402", "0.7867402", "0.7867402", "0.7867402", "0.7867402", "0.7867402", "0.7867402", "0.7476403", "0.7286296", "0.6815662", "0.67164767", "0.6706243", "0.66996133", "0.669862", "0.669862", "0.66427255", "0.65458715", "0.65317374", "0.65056884", "0.63480896"...
0.8655443
0
Serializes information the current object
def serialize(writer) raise StandardError, 'writer cannot be null' if writer.nil? super writer.write_object_value("callee", @callee) writer.write_object_value("caller", @caller) writer.write_date_time_value("endDateTime", @end_date_time) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize\n end", "def serialize(object) end", "def serialize; end", "def serialize; end", "def serialize\n \n end", "def serialize\n raise NotImplementedError\n end", "def serialize\n raise NotImplementedError\n end", "def dump\r\n super + to_s\r\n end", ...
[ "0.7951372", "0.7645999", "0.7579812", "0.7579812", "0.7440032", "0.720861", "0.720861", "0.7207583", "0.7016516", "0.70007193", "0.6992252", "0.69838214", "0.69723576", "0.69666415", "0.69666415", "0.6942002", "0.69417155", "0.6933786", "0.6913977", "0.6891677", "0.68810964"...
0.65378475
66
Gets the startDateTime property value. UTC time when the segment started. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z
def start_date_time return @start_date_time end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time\n dtstart_property ? dtstart.to_datetime : nil\n end", "def utc_start_time\n @time.utc.strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")\n end", "def start_time\n dtstart.to_datetime\n end", "def starts_at\n Time.at(start_time_millis / 1000).utc.to_datetime\n ...
[ "0.71682936", "0.70000684", "0.6914536", "0.68673843", "0.67584425", "0.66408116", "0.6514147", "0.6514147", "0.65047127", "0.65036494", "0.6453193", "0.6439327", "0.64325476", "0.64277023", "0.6382145", "0.6289503", "0.627477", "0.624708", "0.6233226", "0.62318784", "0.61815...
0.6578073
15
Sets the startDateTime property value. UTC time when the segment started. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z
def start_date_time=(value) @start_date_time = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_started_at\n if @started_at_date_string && @started_at_time_string\n self.start_date_time = Time.parse(\"#{@started_at_date_string} #{@started_at_time_string}\")\n end\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "...
[ "0.6829363", "0.6743439", "0.66322327", "0.6604408", "0.64989954", "0.64989954", "0.6450398", "0.63964355", "0.6345349", "0.6309143", "0.6308488", "0.62425715", "0.62425715", "0.62114173", "0.61761725", "0.61761725", "0.6153852", "0.61144495", "0.60943204", "0.6085175", "0.60...
0.6825709
10
Returns "AND" or "OR", how keyword_queries will be combined
def keyword_op @params["op"] || "AND" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query\n ([query_for_one_keyword] * split_query_string.size).join(' AND ')\n end", "def query_for_one_keyword\n return @query_for_one_keyword if @query_for_one_keyword\n\n query = fields.map { |field| \"lower(#{field}) LIKE ?\" }\n .join(' OR ')\n @query_for_one_keywo...
[ "0.7517001", "0.69484407", "0.6889234", "0.6676508", "0.6606359", "0.65587467", "0.65093046", "0.6500294", "0.6476187", "0.64577395", "0.6438638", "0.6423618", "0.64190125", "0.6281548", "0.61976916", "0.6184967", "0.6184967", "0.6150798", "0.6108333", "0.6092285", "0.6085807...
0.7218076
2
returns advancedtype keyword queries, see also keyword_op
def keyword_queries unless(@keyword_queries) @keyword_queries = {} return @keyword_queries unless @params[:search_field] == ::AdvancedController.blacklight_config.advanced_search[:url_key] config.search_fields.each do | key, field_def | if ! @params[ key.to_sym ].blank?...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keyword_queries\n unless @keyword_queries\n @keyword_queries = {}\n\n return @keyword_queries unless @params[:search_field] == ::AdvancedController.blacklight_config.advanced_search[:url_key]\n\n config.search_fields.each do |key, _field_def|\n unless @params[key.to_sym].blan...
[ "0.6775193", "0.6425376", "0.6425376", "0.6223311", "0.62141836", "0.6197322", "0.61601746", "0.61321044", "0.60698414", "0.60523957", "0.60429716", "0.5958189", "0.5958189", "0.59499913", "0.5911102", "0.5908567", "0.59078825", "0.5899219", "0.5885147", "0.5837124", "0.58371...
0.67507017
1
returns just advancedtype filters
def filters unless (@filters) @filters = {} return @filters unless @params[:f_inclusive] @params[:f_inclusive].each_pair do |field, value_hash| value_hash.each_pair do |value, type| @filters[field] ||= [] @filters[field] << value end end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filters; end", "def filters; end", "def filters\n end", "def typus_filters\n\n fields_with_type = ActiveSupport::OrderedHash.new\n\n if self.respond_to?('admin_filters')\n fields = self.admin_filters\n else\n return [] unless Typus::Configuration.config[self.name]['filters...
[ "0.7341577", "0.7341577", "0.71478045", "0.70831174", "0.70450586", "0.7012888", "0.6963002", "0.6932608", "0.6915274", "0.6892258", "0.6892258", "0.6834419", "0.6751952", "0.67210317", "0.66579914", "0.65859604", "0.65724003", "0.65724003", "0.6566239", "0.65251976", "0.6490...
0.6548252
19
this method is necessary to access the cell contents directly it's not meant to be used outside of the collaborator classes FIXME feels a bit like a kludge
def at(x, y) @codeGrid[y][x] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cells\n @cells\n end", "def cells\n @cells\n end", "def contents_of(cell)\n \" \"\n end", "def actual_cells\n @cells.compact\n end", "def cells\n attributes.fetch(:cells)\n end", "def get_elem cell\n\t\treturn @elements[cell]\n\tend", "def contents_of cel...
[ "0.6524635", "0.6524635", "0.652332", "0.63858575", "0.63336927", "0.6305337", "0.62197185", "0.6204106", "0.6173848", "0.60755056", "0.6062459", "0.59461564", "0.58938855", "0.5838327", "0.5832231", "0.582465", "0.5811749", "0.5738986", "0.57300335", "0.5724039", "0.56993717...
0.0
-1
assignment goes through to the underlying row, so we get the actual part if a CodeGridPosition was passed instead
def []=(column_index, value) @row[column_index] = value.part $dirty << [column_index, @row_index] $blocks_to_redraw << [column_index, @row_index] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_cell(args)\n arr = @rows.flatten\n arr[arr.find_index(args[:position])] = args[:piece]\n @rows = arr.enum_for(:each_slice, 3).to_a\n end", "def row(position)\n position[0]\n end", "def row_at(row_idx)\n @grid[row_idx]\n end", "def build_cell(cell)\n # implement in row...
[ "0.6162706", "0.59831804", "0.5907341", "0.5801971", "0.57807225", "0.57263637", "0.5697083", "0.5664467", "0.55998814", "0.5582373", "0.5562", "0.55215603", "0.55120116", "0.55120116", "0.5501046", "0.5482159", "0.54778266", "0.5473612", "0.5461401", "0.5456282", "0.5452968"...
0.0
-1
interacting with the pointed at cell
def ==(part) $theGrid.at(@x, @y) == part end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selection(cell)\n\t\t@last = cell\n\t\t@currentSelection.update(cellsFromFirstToEnd())\n\t\t@currentSelection.show()\n\tend", "def _cell_click\n render :js => handle_cell_click(param(:id).to_i, param(:table), param(:cell_column).to_i, param(:table_view))\n end", "def touch_cell\n self.cell.touch\n...
[ "0.6595937", "0.6444704", "0.63723683", "0.6344221", "0.6335378", "0.6194271", "0.61497897", "0.60813284", "0.6063878", "0.60170776", "0.59164035", "0.5910524", "0.5800149", "0.57907146", "0.5703414", "0.56727654", "0.56603825", "0.5655755", "0.5655123", "0.560214", "0.559506...
0.0
-1
wrapping this method so it returns a position, so other methods can be &. chained to it
def crate? $theGrid.at(@x, @y).crate? ? self : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pos()\n #This is a stub, used for indexing\n end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def pos()\n #This is a stub, used for indexing\n ...
[ "0.7715312", "0.7582428", "0.7582428", "0.7582428", "0.7582428", "0.7582428", "0.7582428", "0.7582428", "0.7582428", "0.75589454", "0.75589454", "0.74888235", "0.74669373", "0.74669373", "0.74669373", "0.74669373", "0.73013514", "0.7284325", "0.7267006", "0.7242483", "0.72424...
0.0
-1
moving through the grid
def up @y.positive? ? $theGrid[@y-1][@x] : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn\n\t\tnew_grid = Array.new(@size + 1) { Array.new(@size + 1)}\n\t\t0.upto(@size) do |row|\n\t\t\t0.upto(@size) do |column|\n\t\t\t\tnew_grid[column][@size - row] = @grid[row][column]\n\t\t\tend\n\t\tend\n\t\t@grid = new_grid\n\tend", "def next_move\n return false if @n.zero? && @grid.empty?\n show_...
[ "0.7168583", "0.7013342", "0.7005228", "0.7004463", "0.69918585", "0.68964064", "0.6727364", "0.6652382", "0.6651018", "0.66299087", "0.6525214", "0.6508586", "0.64858186", "0.6467565", "0.6467565", "0.6467565", "0.64178395", "0.6410734", "0.6398985", "0.6367399", "0.63577425...
0.60271174
65
testing position these may not be necessary since, whenever a cell wants to know if it's not at an edge, it's because it wants to do something with that position, and the movement methods already test for edgeness
def notTopEdge? @y.positive? ? self : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position_is_valid?(position)\r\n position.x < @col &&\r\n position.y < @row &&\r\n position.x >= 0 &&\r\n position.y >= 0\r\n end", "def pos_nt?(x, y)\r\n pos?(x, y) && !@through\r\n end", "def valid_move?\n\t\t@table.stays_on_table?(@robot_direction, @x, @y)\n\tend", "def invalid_cell?(...
[ "0.6903216", "0.6779049", "0.673842", "0.67366546", "0.67255175", "0.66582733", "0.66227096", "0.6614334", "0.6594225", "0.65722984", "0.656498", "0.65641475", "0.6550783", "0.65323925", "0.65230536", "0.65141696", "0.6505918", "0.6502542", "0.65016514", "0.64917654", "0.6449...
0.0
-1
proxy any unknown method to the referenced Part
def method_missing(name, *args, &block) $theGrid.at(@x, @y).send(name, *args, &block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_proxy(*)\n raise NotImplementedError, \"#{__method__} must be implemented in a descendant class!\"\n end", "def to_proxy(*)\n raise NotImplementedError, \"#{__method__} must be implemented in a descendant class!\"\n end", "def method_missing(name, *args, &block)\n\t if(@part.r...
[ "0.6837945", "0.6837945", "0.68185043", "0.6499762", "0.6461625", "0.6368551", "0.6285678", "0.62588704", "0.623574", "0.62302125", "0.62302125", "0.612466", "0.61205405", "0.60762626", "0.6076032", "0.6041817", "0.6026485", "0.6018271", "0.6018271", "0.6018271", "0.60111535"...
0.0
-1
GET /config_tables/1 GET /config_tables/1.json
def show @config_table = ConfigTable.find(params[:id]) respond_to do |format| format.js format.html # show.html.erb end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @configtable = Configtable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @configtable }\n end\n end", "def get_table_list()\n resp = @dynamo_db.list_tables()\n puts \"Table list : \" + resp.table_names.to_s\nend", "def l...
[ "0.74101096", "0.6346767", "0.6217009", "0.61968213", "0.6138534", "0.6107675", "0.6063181", "0.6037319", "0.6028485", "0.5991478", "0.5958607", "0.59477735", "0.5934612", "0.5927", "0.5901325", "0.5808314", "0.58078724", "0.5801319", "0.57814103", "0.578059", "0.5778919", ...
0.5931553
13
GET /config_tables/new GET /config_tables/new.json
def new @config_table = ConfigTable.new respond_to do |format| format.js format.html # new.html.erb end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @configtable = Configtable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @configtable }\n end\n end", "def create\n @configtable = Configtable.new(params[:configtable])\n\n respond_to do |format|\n if @configtable.save\n f...
[ "0.79658824", "0.73223513", "0.68264925", "0.68264925", "0.6751242", "0.6603381", "0.65405256", "0.6509538", "0.62613326", "0.6238379", "0.6107124", "0.61063665", "0.609677", "0.6087505", "0.6083514", "0.60793495", "0.6061373", "0.6051682", "0.6036759", "0.6003502", "0.600166...
0.68837845
2
POST /config_tables POST /config_tables.json
def create @config_table = ConfigTable.new(params[:config_table]) @config_table.year = params[:config_table][:id] respond_to do |format| if @config_table.save format.html { redirect_to config_tables_path, :notice => 'Config table was successfully created.' } else format.html { r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @configtable = Configtable.new(params[:configtable])\n\n respond_to do |format|\n if @configtable.save\n format.html { redirect_to @configtable, notice: 'Configtable was successfully created.' }\n format.json { render json: @configtable, status: :created, location: @configtabl...
[ "0.70930433", "0.6398037", "0.6278978", "0.5945581", "0.59276456", "0.57608575", "0.56159836", "0.56158894", "0.5548966", "0.55304754", "0.5507424", "0.5471813", "0.5457857", "0.54023975", "0.5391116", "0.5391028", "0.53833014", "0.5376602", "0.5322543", "0.53113735", "0.5276...
0.53820014
17
PUT /config_tables/1 PUT /config_tables/1.json
def update @config_table = ConfigTable.find(params[:id]) @config_table.year = params[:config_table][:id] respond_to do |format| if @config_table.update_attributes(params[:config_table]) format.html { redirect_to config_tables_path, :notice => 'Config table was successfully updated.' } e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @configtable = Configtable.find(params[:id])\n\n respond_to do |format|\n if @configtable.update_attributes(params[:configtable])\n format.html { redirect_to @configtable, notice: 'Configtable was successfully updated.' }\n format.json { head :no_content }\n else\n ...
[ "0.67758095", "0.59656894", "0.5854576", "0.5742794", "0.5655333", "0.56162375", "0.5560202", "0.5522187", "0.5515743", "0.5417478", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.5388336", "0.5...
0.5810449
3
DELETE /config_tables/1 DELETE /config_tables/1.json
def destroy @config_table = ConfigTable.find(params[:id]) @config_table.destroy respond_to do |format| @config_tables = ConfigTable.all format.js end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @configtable = Configtable.find(params[:id])\n @configtable.destroy\n\n respond_to do |format|\n format.html { redirect_to configtables_url }\n format.json { head :no_content }\n end\n end", "def delete_table(table_id); delete(\"tables/#{table_id}\"); nil; end", "def delete...
[ "0.75203604", "0.673097", "0.665987", "0.64183164", "0.6256067", "0.6233195", "0.6229347", "0.6221335", "0.62204826", "0.6214161", "0.62134194", "0.61959535", "0.61733806", "0.6151156", "0.6141388", "0.61253417", "0.6114254", "0.6112506", "0.60952306", "0.60897404", "0.608893...
0.6572693
3
Add an action that gives us the user's status
def check_status user = current_user respond_to do |format| format.html format.json { render json: { status: user.order_status } } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def active_callout\n\t\t\tbegin\n\t\t\t\t@user = User.find params[:id]\n\t\t\t\t@status = params[:status]\n\t\t\trescue \n\t\t\t\tredirect_to '/'\n\t\t\tend\n\t\tend", "def user_action=(value)\n @user_action = value\n end", "def status(text)\n @user.enqueue_message('_' + text + '...
[ "0.6770906", "0.67382973", "0.6667645", "0.6667645", "0.648531", "0.6409905", "0.6383007", "0.6300225", "0.6285226", "0.6285226", "0.6285226", "0.6285226", "0.6269964", "0.6262727", "0.6248893", "0.6241792", "0.6241005", "0.6235596", "0.6231385", "0.6216671", "0.61669743", ...
0.5894418
84
Represent mine/notmine with a boolean, removing borders. '| |' > [false, true, false, true, false]
def as_booleans(row) fail ValueError unless row =~ /\A\|[ *]+\|\z/ row[1..-2].each_char.map { |c| c == '*' } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_boolean(col)\n _draw_head(col){\n @f.select(col.name, [\n ['(both)', ''],\n ['', 'false'],\n ['√', 'true']])\n }\n end", "def any_mines_detonated?\n @field.flatten.each do |cell|\n if cell.mine == true && cell.revea...
[ "0.58801216", "0.5868243", "0.582488", "0.5823771", "0.5815627", "0.56671077", "0.5574644", "0.5546624", "0.54644334", "0.54420507", "0.54393446", "0.54065824", "0.5384596", "0.5370461", "0.5341761", "0.5274628", "0.5264457", "0.52258366", "0.51862407", "0.5184713", "0.518308...
0.5461252
9
Generate top/bottom border of the form ++
def border '+' + ('-' * @max_y) + '+' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def border; end", "def bottom_border\n \"#{self.align_center} \\n#{BORDER}\"\n end", "def top_border\n \"#{BORDER}\\n #{self.align_center}\"\n end", "def border(top_or_bottom)\n if top_or_bottom == \"top\"\n puts \"\\n ╔═══ ☆ .·:·. ☽ ✧    †    ✧ ☾ .·:·. ☆ ═══╗ \\n\"\n else\n ...
[ "0.7198731", "0.7197691", "0.7186019", "0.710462", "0.7068174", "0.6899728", "0.67883116", "0.66856563", "0.6665067", "0.6623333", "0.6572159", "0.6570054", "0.65555686", "0.65298265", "0.64721256", "0.64132386", "0.640519", "0.640465", "0.6295759", "0.6285698", "0.6254861", ...
0.6102992
27
input: string of items separated by spaces (example: "carrots apples cereal pizza") steps: create an empty hash seperate string into individual items set default quantity 1. print the hash list to the console output: hash
def new_list(items) grocery_list = Hash.new(0) items.split(" ").each do |x| grocery_list[x] += 1 end grocery_list end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_list_items(input_string)\n \n hsh = {}\n \n # create an array containing each item \n array_input = input_string.split(' ')\n \n # create a hash from the array (iterate), containing the information of key/value pairs \n array_input.each do |item|\n # set default quantity as value\n hsh[it...
[ "0.7665453", "0.76168394", "0.7438915", "0.74234116", "0.7272734", "0.7244853", "0.72332364", "0.7034979", "0.70265496", "0.69833905", "0.69032085", "0.6901773", "0.6889736", "0.6884736", "0.68624735", "0.68544567", "0.6853886", "0.684291", "0.6842335", "0.6819255", "0.681266...
0.62439126
100
TEST create ("carrots apples cereal pizza") Method to add an item to a list input: list, item, quantity steps: add new items into hash output: modified hash
def add_item (list, item, qty) list[item]=qty end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item(list_name, item, quantity=1)\r\n# input: list, item name, and optional quantity\r\n# steps: add item and its quantity to the hash\r\n list_name.store(item, quantity)\r\n# output: hash with new item\r\n p list_name\r\nend", "def add_item(list, add_item, add_quantity=1)\n# steps:\n # Add item as ke...
[ "0.8325434", "0.8278482", "0.8077802", "0.8012966", "0.7872219", "0.78114843", "0.76849246", "0.76555085", "0.7629873", "0.75650144", "0.7531389", "0.7458549", "0.7447121", "0.7419465", "0.73851377", "0.73597777", "0.7353414", "0.73521495", "0.73295164", "0.73235667", "0.7308...
0.7031826
69
Method to remove an item from the list input: modified list and item steps: delete all instances of that key output: modified hash
def remove_item (list, item) list.delete(item) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_item(input_hash, item)\n# input: list, item name, and optional quantity\n# steps: use input item to delete key\n input_hash.delete(item)\n# output: hash data structure of key/value pairs\nreturn input_hash\nend", "def remove_item(my_list, item)\r\n# input: an item (something already in the list)\r\n#...
[ "0.8513027", "0.8449736", "0.82606137", "0.8243336", "0.8191159", "0.79246914", "0.790148", "0.79001886", "0.78839546", "0.7832594", "0.78273636", "0.7810499", "0.77728224", "0.7771637", "0.7771193", "0.77403504", "0.77369833", "0.77369833", "0.77310324", "0.7716798", "0.7655...
0.7411385
43
TEST remove_item(grocery_list, "cereal") Method to update the quantity of an item input: modified list, item, new quantity steps: call hash key directly to modify value with new quantity. overwrites value (qty) for the key (item output: modified key and value added to existing hash
def update (list, item, qty) list[item] = qty end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_item(input_hash, item)\n# input: list, item name, and optional quantity\n# steps: use input item to delete key\n input_hash.delete(item)\n# output: hash data structure of key/value pairs\nreturn input_hash\nend", "def update_quantity(list, upd_item, new_quantity)\n# steps:\n # reassign key (item) a ...
[ "0.7769257", "0.77278125", "0.7676681", "0.757336", "0.7557803", "0.75198805", "0.74278843", "0.74084425", "0.73759836", "0.7366034", "0.73604685", "0.73420167", "0.7340971", "0.732701", "0.7322868", "0.7320516", "0.7283889", "0.728333", "0.72782373", "0.72777706", "0.7274694...
0.0
-1
TEST update(grocery_list, "pizza", 2) Method to print a list and make it look pretty input: modified existing hash steps: print out each key/value pair output: The keys/value pair on a new line.
def print_hash(list) puts "Current grocery list:" puts "---------------------" list.each do |item_name, item_quant| puts " #{item_name}: #{item_quant}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pretty_list(groceries_list)\n\t# Print a line of text to lead into the list\n\tputs \"Here is your updated grocery list:\"\n\t# for each key and value in the list, print a string \n\t# containing the key and value\n\tgroceries_list.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend", "de...
[ "0.79600006", "0.77071047", "0.77007097", "0.7676889", "0.7673049", "0.7530384", "0.7444486", "0.73834115", "0.7252337", "0.7232628", "0.71854717", "0.7148049", "0.71371967", "0.7125083", "0.70946795", "0.70877594", "0.7081908", "0.70806897", "0.70653534", "0.70589316", "0.70...
0.73108095
8
Counts the amount of jobs in the (provided) Sidekiq queue(s).
def queue(*queues) queues = queues.flatten.map(&:to_s) queues = ::Sidekiq::Stats.new.queues.map { |name, _| name.to_s } if queues.empty? list = queue_list queues.inject(0) do |memo, name| memo += (list[name.to_s] || 0) memo end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_count()\n cnt = 0\n @tasks.each_value { |task| cnt += task.queue_count() }\n cnt\n end", "def queue_count\n @queues.length\n end", "def queue_count()\n @queue.length\n end", "def queue_count()\n cnt = 0\n @flows.each_value { |f| cnt += f.queue_count() }\n ...
[ "0.8109058", "0.77909243", "0.76031846", "0.75695056", "0.73891485", "0.7380489", "0.73770404", "0.73154205", "0.7260825", "0.72463125", "0.71987826", "0.7108839", "0.70993125", "0.7090734", "0.70874506", "0.7034426", "0.7032", "0.69567364", "0.6951876", "0.6929466", "0.69251...
0.62735814
62
GET /ambassadorships GET /ambassadorships.json
def index @ambassadorships = Ambassadorship.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @clientships = current_user.clientships.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientships }\n end\n end", "def index\n @ships = Ship.all\n end", "def index\n @ships = Ship.all\n end", "def index\n @player_shi...
[ "0.70189935", "0.6638649", "0.6638649", "0.6504566", "0.64973927", "0.64056635", "0.6387467", "0.63668627", "0.63471466", "0.63451767", "0.63451767", "0.63426745", "0.6336469", "0.6313026", "0.63055575", "0.62719774", "0.615957", "0.6158081", "0.6155434", "0.61181337", "0.610...
0.7758714
0
GET /ambassadorships/1 GET /ambassadorships/1.json
def show; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @ambassadorships = Ambassadorship.all\n end", "def index\n @clientships = current_user.clientships.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientships }\n end\n end", "def show\n @clientship = current_user.clientship...
[ "0.74249715", "0.69088787", "0.67929137", "0.66098756", "0.66098756", "0.64122766", "0.6376047", "0.6348181", "0.6338665", "0.633301", "0.632581", "0.63221586", "0.6314819", "0.63043183", "0.6255079", "0.62542844", "0.6253122", "0.622468", "0.6199019", "0.61884296", "0.618842...
0.0
-1
POST /ambassadorships POST /ambassadorships.json
def create respond_to do |format| if @ambassadorship.save format.html { redirect_to @ambassadorship, notice: t('.notice') } format.json { render :show, status: :created, location: @ambassadorship } else format.html { render :new } format.json { render json: @ambassadorshi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_ambassadorship\n @ambassadorship = Ambassadorship.new(ambassadorship_params)\n end", "def index\n @ambassadorships = Ambassadorship.all\n end", "def ambassadorship_params\n params.require(:ambassadorship).permit(:user_id, :area_id)\n end", "def create\n \n @ship = current_user.creat...
[ "0.67556465", "0.6519189", "0.6400249", "0.62767327", "0.6252982", "0.62013", "0.6160292", "0.6115367", "0.6046786", "0.5992935", "0.59367615", "0.59199184", "0.5917137", "0.5911482", "0.5907564", "0.5898504", "0.58899087", "0.5880348", "0.5866841", "0.58353525", "0.5824651",...
0.65172654
2
PATCH/PUT /ambassadorships/1 PATCH/PUT /ambassadorships/1.json
def update respond_to do |format| if @ambassadorship.update(ambassadorship_params) format.html { redirect_to @ambassadorship, notice: t('.notice') } format.json { render :show, status: :ok, location: @ambassadorship } else format.html { render :edit } format.json { render...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @clientship = current_user.clientships.find(params[:id])\n\n respond_to do |format|\n if @clientship.update_attributes(params[:clientship])\n format.html { redirect_to @clientship, notice: 'Clientship was successfully updated.' }\n format.json { head :ok }\n else\n ...
[ "0.6758441", "0.6562153", "0.65591365", "0.6439037", "0.63681656", "0.6357641", "0.626143", "0.6250236", "0.62233746", "0.6206132", "0.61961305", "0.61761284", "0.61761284", "0.6104844", "0.60774344", "0.60728025", "0.60728025", "0.60598695", "0.6029983", "0.60124785", "0.600...
0.6813494
0
DELETE /ambassadorships/1 DELETE /ambassadorships/1.json
def destroy @ambassadorship.destroy @ambassadorship = Ambassadorship.new(area: @ambassadorship.area) respond_to do |format| format.html { redirect_to ambassadorships_url, notice: t('.notice') } format.json { head :no_content } format.js { render :destroy } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @clientship = current_user.clientships.find(params[:id])\n @clientship.destroy\n\n respond_to do |format|\n format.html { redirect_to clientships_url }\n format.json { head :ok }\n end\n end", "def destroy\n @ab_reltionship.destroy\n respond_to do |format|\n format...
[ "0.7468423", "0.73904705", "0.7234936", "0.7204991", "0.71942276", "0.7180705", "0.7180705", "0.7180705", "0.71706295", "0.7120672", "0.7117969", "0.70641387", "0.70641387", "0.70409733", "0.6977525", "0.69609594", "0.6939803", "0.6919941", "0.68774265", "0.68427783", "0.6840...
0.74057776
1
Only allow for create action
def new_ambassadorship @ambassadorship = Ambassadorship.new(ambassadorship_params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auth_create_filter\n if not self.class.allowed_to_create\n false\n else\n true\n end\n end", "def put_can_create?\n false\n end", "def only_create!\n self.operation = :only_create\n end", "def can_create?\n allows_current_user_access_to? :cre...
[ "0.8085444", "0.78276765", "0.7824523", "0.773198", "0.75993186", "0.7487814", "0.7476423", "0.7476423", "0.74034476", "0.73480743", "0.73480743", "0.73480743", "0.7282872", "0.7278761", "0.7195469", "0.7195469", "0.7195469", "0.7195469", "0.7195469", "0.7195469", "0.7195469"...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_ambassadorship @ambassadorship = Ambassadorship.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 ambassadorship_params params.require(:ambassadorship).permit(:user_id, :area_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.69802505", "0.6781974", "0.67470175", "0.67430073", "0.67350477", "0.6593221", "0.6504263", "0.64988977", "0.6481794", "0.64800006", "0.64568025", "0.64411247", "0.6379476", "0.63765615", "0.6368045", "0.6320141", "0.6300363", "0.6300057", "0.62952244", "0.6294712", "0.629...
0.0
-1
Fetch user projects from Github
def fetch_projects! projects.destroy_all if github? result = YAML.load open("http://github.com/api/v2/yaml/repos/show/#{github}/") result['repositories'].each do |repository| projects.create! :name => repository[:name], :description => repository[:description] end end rescue O...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def github_projects\n Rails.cache.fetch(\"/users/#{self.id}/github_projects\", :expires_in => 1.day) {\n gh = Github.new(authentications.where(:provider => 'github').first.provider_token)\n gh.repos\n }\n end", "def projects\n @projects ||= begin\n http = Net::HTTP.ne...
[ "0.7888363", "0.73321056", "0.70928615", "0.7084315", "0.7065468", "0.7051613", "0.703337", "0.7010018", "0.694997", "0.6905266", "0.68602264", "0.6850607", "0.6822165", "0.6791497", "0.6768402", "0.67608654", "0.6729191", "0.67078304", "0.6693352", "0.668834", "0.66871387", ...
0.83093596
0
Use callbacks to share common setup or constraints between actions.
def set_hospital_line_item @hospital_line_item = HospitalLineItem.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 trusted parameter "white list" through.
def hospital_line_item_params params.fetch(:hospital_line_item, {}) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.638045...
0.0
-1
Once an ActiveJob is queued, ActiveRecord references get serialized into some internal reserved keys, such as _aj_globalid. The problem is, if this job in turn gets queued back into ActiveJob with these magic reserved keys, ActiveJob will throw up and error. We want to capture these and mutate the keys so we can sanely...
def filter_context(context) case context when Array context.map { |arg| filter_context(arg) } when Hash Hash[context.map { |key, value| filter_context_hash(key, value) }] else format_globalid(context) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize\n {\n \"job_class\" => self.class.name,\n \"job_id\" => job_id,\n \"provider_job_id\" => provider_job_id,\n \"queue_name\" => queue_name,\n \"priority\" => priority,\n \"arguments\" => serialize_arguments_if_needed(arguments),\n \"executio...
[ "0.58941185", "0.58293444", "0.57308203", "0.5455141", "0.53911585", "0.5358757", "0.535672", "0.53209", "0.52920973", "0.5289223", "0.5248281", "0.52013266", "0.51835877", "0.51483655", "0.5130928", "0.5114305", "0.5111343", "0.51082706", "0.50590307", "0.50407714", "0.50290...
0.0
-1
GET /space_cats GET /space_cats.json
def index @space_cats = SpaceCat.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @space_cat = SpaceCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @space_cat }\n end\n end", "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :jso...
[ "0.7006992", "0.6792795", "0.67924243", "0.66692597", "0.6621316", "0.65918255", "0.63607717", "0.63496894", "0.6304581", "0.6281507", "0.6270946", "0.6225216", "0.6218042", "0.61899453", "0.61755335", "0.6169439", "0.6123937", "0.6112873", "0.61059767", "0.610256", "0.608658...
0.7184111
0
GET /space_cats/1 GET /space_cats/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @space_cat = SpaceCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @space_cat }\n end\n end", "def index\n @space_cats = SpaceCat.all\n end", "def index\n render json: @owner.cats\n end", "def index\n res...
[ "0.7246262", "0.6943989", "0.67936987", "0.6779616", "0.65675044", "0.6553342", "0.646155", "0.64427453", "0.6412308", "0.6398899", "0.6382829", "0.6358546", "0.6329365", "0.63113683", "0.62889105", "0.6277655", "0.6241431", "0.61556053", "0.6152391", "0.6140274", "0.61342514...
0.0
-1
POST /space_cats POST /space_cats.json
def create @space_cat = SpaceCat.new(space_cat_params) respond_to do |format| if @space_cat.save format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' } format.json { render action: 'show', status: :created, location: @space_cat } else format.ht...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @space_cat = SpaceCat.new(params[:space_cat])\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render json: @space_cat, status: :created, location: @space_cat }\n else\n...
[ "0.71639806", "0.6535278", "0.6386513", "0.63362503", "0.6325344", "0.6247361", "0.6221174", "0.6163169", "0.61283386", "0.6084104", "0.6083778", "0.60169536", "0.60167485", "0.5973172", "0.5937826", "0.59300584", "0.5902818", "0.5894493", "0.58809674", "0.5797", "0.57599175"...
0.71181846
1
PATCH/PUT /space_cats/1 PATCH/PUT /space_cats/1.json
def update respond_to do |format| if @space_cat.update(space_cat_params) format.html { redirect_to @space_cat, notice: 'Space cat was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @space_cat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @space_cat = SpaceCat.find(params[:id])\n\n respond_to do |format|\n if @space_cat.update_attributes(params[:space_cat])\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html ...
[ "0.7052962", "0.67820835", "0.65232986", "0.6351166", "0.63274974", "0.62632525", "0.6228405", "0.6121107", "0.6081268", "0.60692", "0.6057287", "0.6031685", "0.60066086", "0.5997953", "0.59776133", "0.5975814", "0.59701675", "0.59572995", "0.5932737", "0.59149164", "0.590840...
0.7046794
1
DELETE /space_cats/1 DELETE /space_cats/1.json
def destroy @space_cat.destroy respond_to do |format| format.html { redirect_to space_cats_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @space_cat = SpaceCat.find(params[:id])\n @space_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to space_cats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cat = Cat.find(params[:id])\n @cat.destroy\n\n respond_to do |format|...
[ "0.7420269", "0.68448037", "0.68448037", "0.6783321", "0.67816484", "0.6687884", "0.667114", "0.65857", "0.65779877", "0.6571176", "0.6569351", "0.65614915", "0.6533694", "0.65197694", "0.6504651", "0.6487761", "0.6486724", "0.64756393", "0.64723355", "0.64576125", "0.6457470...
0.741151
1
Use callbacks to share common setup or constraints between actions.
def set_space_cat @space_cat = SpaceCat.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 space_cat_params params.require(:space_cat).permit(:name) 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
Never trust parameters from the scary internet, only allow the white list through.
def payment_donation_params params.require(:payment_donation).permit(policy(@donation || Payment::Donation).permitted_attributes) 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.69802505", "0.6781974", "0.67470175", "0.67430073", "0.67350477", "0.6593221", "0.6504263", "0.64988977", "0.6481794", "0.64800006", "0.64568025", "0.64411247", "0.6379476", "0.63765615", "0.6368045", "0.6320141", "0.6300363", "0.6300057", "0.62952244", "0.6294712", "0.629...
0.0
-1
CUSTOM FUNCTIONS Builds a maven command line according to the given goals, project and the current environment
def maven(goals, project) command = 'mvn ' # Goals if !goals.is_a?(Array) goals = [goals] end for goal in goals command += goal+' ' end # Options (from environment) if ENV['offline'] == 'yes' command += '-o ' end if ENV['test'] == 'no' command += '-DskipTests=true ' end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maven(*goals)\n Dir.chdir(\"./recipeminer-java\") { |path| system('/usr/bin/mvn', *goals)}\nend", "def process(args, flags, mavenArgs, dirMappings)\n doMavenArgs = true;\n args.each do |arg|\n if(/^-/.match(arg))\n next\n end\n\n if(doMavenArgs)\n setToForIn(false, \"cipt\", mavenArgs)\...
[ "0.7134042", "0.6587739", "0.65063107", "0.63672405", "0.6364035", "0.61755776", "0.59287566", "0.59153837", "0.5698165", "0.568441", "0.5618777", "0.5569372", "0.5516172", "0.5450874", "0.5429077", "0.5422712", "0.5402287", "0.5376412", "0.5375085", "0.53579277", "0.5323111"...
0.8005089
0
GET /courses GET /courses.json
def index @courses = Course.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n\t\t@courses = Course.all\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @courses }\n\t\tend\n\tend", "def index\n @courses = Course.all\n render json: @courses, status: :ok\n end", "def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).or...
[ "0.7943173", "0.78570646", "0.7742099", "0.7729055", "0.7729055", "0.76939315", "0.76708746", "0.76526207", "0.752899", "0.74440956", "0.74415404", "0.73988724", "0.7373047", "0.7365082", "0.73555565", "0.7347125", "0.7311683", "0.7271882", "0.7270879", "0.72251445", "0.72230...
0.7169304
46
GET /courses/1 GET /courses/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def course\n\t\t@course = Course.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend", "def index\n @courses = Course.all\n render json: @courses, status: :ok\n end", "def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do...
[ "0.7639248", "0.7600732", "0.7561499", "0.7498261", "0.7492566", "0.7492566", "0.7460362", "0.7459336", "0.7438278", "0.7280991", "0.7248682", "0.7241407", "0.723878", "0.72222453", "0.72222453", "0.72222453", "0.72222453", "0.72222453", "0.72222453", "0.721023", "0.71961445"...
0.0
-1
POST /courses POST /courses.json
def create @course = Course.new(course_params) #section_chunks = get_chunks(params) sections = JSON.parse(params['sections']) # The course has been created by the signed-in user. @course.user_id = current_user.id respond_to do |format| if @course.save # Save the course's subcompo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n # render plain: params[:courses].inspect\n @courses = Courses.new(courses_params)\n\n respond_to do |format|\n if @courses.save\n format.html { redirect_to @courses, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @cour...
[ "0.76892596", "0.73786503", "0.733382", "0.72321343", "0.7226333", "0.7156661", "0.71277976", "0.71260464", "0.71082616", "0.710302", "0.710302", "0.710302", "0.710302", "0.710302", "0.710302", "0.710302", "0.7091641", "0.7081471", "0.706835", "0.705234", "0.705234", "0.705...
0.6863272
45
PATCH/PUT /courses/1 PATCH/PUT /courses/1.json
def update section_chunks = get_chunks(params) puts params redirect_to @course return sections = params['sections'] if sections.nil? # Loop through course's existing sections. @course.sections.each do |section| end end respond_to do |format| # Update subc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @course.update(course_params)\n render_jsonapi_response(@course)\n end", "def update\n @course = Course.find(params[:id])\n respond_to do |format|\n if @course.update(courses_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n f...
[ "0.72374034", "0.7137671", "0.7121435", "0.7102951", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.70531946", "0.70469433", "0.6967811", "0.696716", "0.6964841", "0.6954444", "0.6949194", "0.6934083", "0.6929629", "0.6929...
0.0
-1
DELETE /courses/1 DELETE /courses/1.json
def destroy @course.destroy respond_to do |format| format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :ok }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n ...
[ "0.77230847", "0.77079666", "0.77079666", "0.77079666", "0.77079666", "0.76962376", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.76494783", "0.76408905", "0.7619815", "0.76093...
0.73929405
62
Use callbacks to share common setup or constraints between actions.
def set_course @course = Course.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 course_params params.require(:course).permit(:title, :description, :user_id, :tag_ids => []) 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.69490993", "0.6812977", "0.6801889", "0.67950445", "0.6745037", "0.6740698", "0.65270424", "0.6519444", "0.6492448", "0.6430671", "0.6430671", "0.6430671", "0.63992614", "0.6355569", "0.6354901", "0.63456345", "0.63430274", "0.63376623", "0.6327184", "0.6327184", "0.632718...
0.0
-1
EXAMPLE OUTPUT What is your name? Clair Hello, Clair, nice to meet you! CONSTRAINTS Keep the input, string concatenation and output seperate
def say_hello p "What is your name?" name = gets.chomp p "Hello, #{name}, nice to meet you!" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combine_name(first_name, last_name)\n # Q3 CODE HERE\n return \"#{first_name} #{last_name}\"\nend", "def introduce_yourself\n \"Hi, my name is #{name} and I am the boss. YAY!\"\n end", "def string_concat(name_1, name_2)\n puts \"I went to the concert with \" +name_1 + \" and \" + name_2 + \".\"\nend...
[ "0.68104285", "0.6732113", "0.6697524", "0.6653155", "0.6610109", "0.6574876", "0.6562749", "0.6556261", "0.65466225", "0.6512053", "0.65084684", "0.65050846", "0.6500953", "0.6483936", "0.6477636", "0.6473342", "0.6472008", "0.6466545", "0.6452884", "0.643852", "0.6438458", ...
0.0
-1
Given a hash with numeric values, return the key for the smallest valu
def key_for_min_value(hash) lowest_key = nil lowest_value = Float::INFINITY hash.each do |key, value| if value < lowest_value lowest_value = value lowest_key = key end end lowest_key end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "def key_for_min_value(hash)\n smallest_value = nil\n smallest_key = nil\n hash.each do |name, nu...
[ "0.86987203", "0.86949843", "0.8660648", "0.8621884", "0.8582308", "0.8569927", "0.85285586", "0.85255176", "0.84987754", "0.8477007", "0.8472328", "0.8472328", "0.8453883", "0.8446745", "0.84344155", "0.84309626", "0.8410307", "0.8410307", "0.8408448", "0.8407354", "0.839058...
0.8727882
0
GET /estimates/1 GET /estimates/1.json
def show @estimate = Estimate.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @estimate } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @estimates = Estimate.all\n end", "def index\n @estimates = Estimate.all\n end", "def retrieve_estimates_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EstimatesApi.retrieve_estimates ...'\n end\n # resource ...
[ "0.7323198", "0.7323198", "0.67951244", "0.6603065", "0.6570356", "0.64702016", "0.6095763", "0.60942274", "0.6083348", "0.60623455", "0.6042251", "0.60322577", "0.5974085", "0.5931608", "0.5878422", "0.5875207", "0.58408123", "0.58300257", "0.5828794", "0.5823716", "0.582320...
0.7521585
0
GET /estimates/new GET /estimates/new.json
def new @estimate = Estimate.new respond_to do |format| format.html # new.html.erb format.json { render json: @estimate } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest }\n end\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @intere...
[ "0.70564336", "0.70256335", "0.697581", "0.67708963", "0.67598325", "0.673785", "0.6693691", "0.66905004", "0.66465515", "0.66363513", "0.6626176", "0.6626176", "0.6620286", "0.6598921", "0.65976405", "0.65867835", "0.65867835", "0.65558636", "0.6547752", "0.65472966", "0.654...
0.7816572
0
POST /estimates POST /estimates.json
def create @estimate = Estimate.new(params[:estimate]) respond_to do |format| if @estimate.save format.html { redirect_to @estimate, notice: 'Estimate was successfully created.' } format.json { render json: @estimate, status: :created, location: @estimate } else format.html ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @estimate = Estimate.new(estimate_params)\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to root_path, notice: 'Estimate was successfully created.' }\n format.json { render :show, status: :created, location: @estimate }\n else\n format.html...
[ "0.70562315", "0.68773574", "0.68394464", "0.6381009", "0.6381009", "0.636285", "0.61552906", "0.61375886", "0.6101923", "0.59458786", "0.59409535", "0.59311026", "0.5916251", "0.5872112", "0.58600605", "0.5811628", "0.57637084", "0.5735993", "0.56948423", "0.5616753", "0.561...
0.70079684
1
PUT /estimates/1 PUT /estimates/1.json
def update @estimate = Estimate.find(params[:id]) respond_to do |format| if @estimate.update_attributes(params[:estimate]) format.html { redirect_to @estimate, notice: 'Estimate was successfully updated.' } format.json { head :no_content } else format.html { render action: "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @estimate.update(estimate_params)\n format.html { redirect_to @estimate, notice: 'Estimate was successfully updated.' }\n format.json { render :show, status: :ok, location: @estimate }\n else\n format.html { render :edit }\n format.j...
[ "0.6668553", "0.6668553", "0.6609188", "0.6127689", "0.60707873", "0.60226333", "0.59655094", "0.5887948", "0.5881626", "0.5881626", "0.58655113", "0.5859236", "0.5845", "0.5791681", "0.5770557", "0.57633036", "0.5754522", "0.5743896", "0.57413566", "0.5728985", "0.5717488", ...
0.69992155
0
DELETE /estimates/1 DELETE /estimates/1.json
def destroy @estimate = Estimate.find(params[:id]) @estimate.destroy respond_to do |format| format.html { redirect_to estimates_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @estimate.destroy\n respond_to do |format|\n format.html { redirect_to estimates_url, notice: 'Estimate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @estimate.destroy\n respond_to do |format|\n format.html { redirect_t...
[ "0.7375703", "0.7375703", "0.70845735", "0.70742697", "0.6888593", "0.68539464", "0.6818487", "0.6757967", "0.6746333", "0.67379695", "0.6719186", "0.6700015", "0.66478366", "0.66345173", "0.66298896", "0.65979904", "0.659366", "0.6583303", "0.65820277", "0.65814215", "0.6528...
0.76779664
0
Public: Initialize a new Gollum Repo. path The String path to the Git repository that holds the Gollum site. options Optional Hash: :universal_toc Table of contents on all pages. Default: false :base_path String base path for all Wiki links. Default: "/" :page_file_dir String the directory in which all page files resid...
def initialize(path, options = {}) options = self.class.default_options.merge(options) if path.is_a?(GitAccess) options[:access] = path path = path.path end @path = path @repo_is_bare = options.fetch :repo_is_bare, nil @page_file_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(path=Dir.pwd, options={})\n @grit = path.kind_of?(Grit::Repo) ? path : Grit::Repo.new(path, options)\n @sandbox = false\n @branch = nil\n @work_dir = path(options[:work_dir] || DEFAULT_WORK_DIR)\n @work_tree = options[:work_tree] || File.join(work_dir, 'tmp', object_id.to_s...
[ "0.7109744", "0.7041847", "0.6848038", "0.66577363", "0.6619191", "0.6599755", "0.64829564", "0.64829564", "0.64089274", "0.6382232", "0.63275844", "0.63234204", "0.6310823", "0.62418413", "0.619803", "0.6170417", "0.611312", "0.6064326", "0.6048316", "0.60084414", "0.598814"...
0.74790776
0
Public: check whether the wiki's git repo exists on the filesystem. Returns true if the repo exists, and false if it does not.
def exist? @access.exist? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exists?\n File.exists?(File.join(@repo_dir, '.git'))\n end", "def git_repository?\n @root.join('.git').directory?\n end", "def git_repo?\n !repository_root.to_s.empty?\n end", "def is_git_repo?\n Pkg::Util.in_project_root do\n _, _, ret = Pkg::Util::Execution.c...
[ "0.8149847", "0.7756363", "0.7594913", "0.75082135", "0.7500999", "0.7350848", "0.73361695", "0.7204345", "0.7179654", "0.7145069", "0.713737", "0.7122003", "0.7074788", "0.7073366", "0.70320404", "0.70320404", "0.7014439", "0.6933787", "0.6904349", "0.68840027", "0.6842989",...
0.0
-1
Public: Get the formatted page for a given page name, version, and dir. path The String path to the the wiki page (may or may not include file extension).
def page(path, version = nil, global_match = false) ::Gollum::Page.find(self, path, version.nil? ? @ref : version, false, global_match) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_path(name, version='master')\n page = wiki.page(name, version)\n if !page.nil?\n \"#{path}/#{page.path}/#{page.version.id}\"\n end\n end", "def wiki_page(name, path = nil, version = nil, exact = true)\n wiki = wiki_new\n path = name if path.nil?\n name = extract_n...
[ "0.7022979", "0.68316793", "0.66783845", "0.6618312", "0.63708484", "0.626719", "0.5977951", "0.5949476", "0.5936378", "0.5913472", "0.5903474", "0.5856933", "0.582536", "0.5764518", "0.5661519", "0.5623566", "0.5580037", "0.5560238", "0.5518194", "0.5510842", "0.5478415", ...
0.6145772
6
Public: Get the static file for a given name. name The full String pathname to the file.
def file(name, version = nil, try_on_disk = false) ::Gollum::File.find(self, name, version.nil? ? @ref : version, try_on_disk) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_file(name)\n File.read(\"%s/%s\" % [uri, name])\n end", "def asset(name)\n path = Root.join name.to_s.sub(/^\\//, '')\n path.file? && path.readable? ? path : nil\n end", "def file( name )\n\t\t\t\tKesh::ArgTest::type( \"name\", name, String )\n\t\t\t\tKesh::ArgTest::stringLeng...
[ "0.7485978", "0.665862", "0.65115386", "0.64184266", "0.639946", "0.6292126", "0.6229353", "0.61551964", "0.6091743", "0.6045", "0.5980185", "0.5978757", "0.59780645", "0.5977316", "0.5968465", "0.5939294", "0.5924837", "0.5912804", "0.5891153", "0.5890666", "0.58866966", "...
0.56507397
45
Public: Create an inmemory Page with the given data and format. This is useful for previewing what content will look like before committing it to the repository. name The String name of the page. format The Symbol format of the page. data The new String contents of the page. Returns the inmemory Gollum::Page.
def preview_page(name, data, format) ::Gollum::PreviewPage.new(self, "#{name}.#{::Gollum::Page.format_to_ext(format.to_sym)}", data, @access.commit(@ref)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preview_page(name, data, format)\n page = @page_class.new(self)\n ext = @page_class.format_to_ext(format.to_sym)\n path = @page_class.cname(name) + '.' + ext\n blob = OpenStruct.new(:name => path, :data => data)\n page.populate(blob, path)\n page.version = @access.commit('HEAD')\...
[ "0.7734778", "0.6498444", "0.60033786", "0.58993345", "0.587632", "0.5600008", "0.55831236", "0.5442831", "0.5397244", "0.5347892", "0.5341293", "0.532073", "0.5261203", "0.5188034", "0.5129272", "0.50140464", "0.50136095", "0.4997512", "0.49733093", "0.4944775", "0.48992378"...
0.7227259
1
Public: Write a new version of a page to the Gollum repo root. path The String path where the page will be written. format The Symbol format of the page. data The new String contents of the page. commit The commit Hash details: :message The String commit message. :name The String author full name. :email The String ema...
def write_page(path, format, data, commit = {}) write(merge_path_elements(nil, path, format), data, commit) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_page(page, name, format, data, commit = {})\n name = name ? ::File.basename(name) : page.name\n format ||= page.format\n dir = ::File.dirname(page.path)\n dir = '' if dir == '.'\n filename = (rename = page.name != name) ? Gollum::Page.cname(name) : page.filename_stripp...
[ "0.71911764", "0.71654", "0.7164895", "0.70490754", "0.58375853", "0.5573226", "0.54572463", "0.5356908", "0.5331896", "0.52793103", "0.5252364", "0.5220166", "0.51847", "0.50496584", "0.49997962", "0.49817222", "0.49259976", "0.49062657", "0.4904201", "0.48799556", "0.485666...
0.69084716
4