query
stringlengths
7
6.41k
document
stringlengths
12
28.8k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Returns the previous element of the given node
def prev_element_of(node) return valid(node) ? node.previous_element : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_prev()\n return @prev_node\n end", "def prev_element\n\t\treturn prev_element_of @current_node\n\tend", "def previous\n DOM::Element.from_node `#{@el}.previousElementSibling || Opal.nil`\n end", "def prev_sibling_of(node)\n\t\treturn valid(node) ? node.previous_sibling : nil\n\tend", "d...
[ "0.8735777", "0.86872214", "0.83443296", "0.833913", "0.8275222", "0.8080957", "0.8059967", "0.8054861", "0.7836243", "0.78321314", "0.7765692", "0.7731378", "0.7603952", "0.7550879", "0.75392854", "0.7463779", "0.7438966", "0.7435683", "0.74280757", "0.7348391", "0.73206437"...
0.8985553
0
Returns the previous sibling of the current node
def prev_sibling return prev_sibling_of @current_node end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prev_sibling_of(node)\n\t\treturn valid(node) ? node.previous_sibling : nil\n\tend", "def previous_sibling\n return nil if parent.nil? # self is root\n return nil if 1 == parent.children.size # self is parent's only child\n if 0 == own_child_index\n return nil # self is first child\n ...
[ "0.87419695", "0.8696707", "0.8630646", "0.85605544", "0.84713054", "0.84206885", "0.83649904", "0.7981851", "0.7932079", "0.7851961", "0.78427726", "0.77472585", "0.7678344", "0.7561046", "0.74988776", "0.74839747", "0.7367846", "0.7330575", "0.7320181", "0.72175026", "0.719...
0.911287
0
Returns the previous sibling of the given node
def prev_sibling_of(node) return valid(node) ? node.previous_sibling : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prev_sibling\n\t\treturn prev_sibling_of @current_node\n\tend", "def previous_sibling\n return nil if parent.nil? # self is root\n return nil if 1 == parent.children.size # self is parent's only child\n if 0 == own_child_index\n return nil # self is first child\n else\n # ...
[ "0.86686254", "0.8503803", "0.85004866", "0.8299519", "0.82088727", "0.8158872", "0.80423623", "0.78661317", "0.7691367", "0.766529", "0.76146114", "0.76119834", "0.76002145", "0.7580425", "0.7485071", "0.74039453", "0.7376988", "0.7258424", "0.71953845", "0.7175583", "0.7064...
0.89993024
0
Returns the next element of the current node
def next_element return next_element_of @current_node end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next()\n return @next_node\n end", "def next\n DOM::Element.from_node `#{@el}.nextElementSibling || Opal.nil`\n end", "def next_node\n @current_node = @current_node.children[0]\n end", "def next_node\n @current_node = @current_node.children[0]\n end", "def next\n value ...
[ "0.8395456", "0.7913779", "0.78747284", "0.7857217", "0.77050483", "0.768974", "0.7527583", "0.75050586", "0.7442074", "0.739274", "0.7337858", "0.7234564", "0.7219672", "0.71539634", "0.71497303", "0.71329665", "0.7107348", "0.7075512", "0.70687616", "0.7050191", "0.69945884...
0.8747819
0
Returns the next element of the given node
def next_element_of(node) return valid(node) ? node.next_element : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_element\n\t\treturn next_element_of @current_node\n\tend", "def get_next()\n return @next_node\n end", "def next\n DOM::Element.from_node `#{@el}.nextElementSibling || Opal.nil`\n end", "def get_next_node(node)\n i = node.number + 1\n i = 0 if i >= nodes.size\n get_node(i)...
[ "0.794192", "0.77441555", "0.7472502", "0.74486667", "0.73922247", "0.7379621", "0.729231", "0.7101187", "0.7099507", "0.7029849", "0.69311917", "0.6923216", "0.6899006", "0.6849636", "0.6727263", "0.669937", "0.66752076", "0.6628868", "0.6565717", "0.65427136", "0.6518837", ...
0.8305558
0
Returns the next sibling of the current node
def next_sibling return next_sibling_of @current_node end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_sibling\n return @links[:next_sibling]\n end", "def next_sibling_of(node)\n\t\treturn valid(node) ? node.next_sibling : nil\n\tend", "def nextSibling\n native_node.next_sibling && Browser.wrap_node(native_node.next_sibling)\n end", "def next_element_sibling\n n = self.next_sib...
[ "0.81352", "0.80332613", "0.77566147", "0.75963545", "0.7527461", "0.75008225", "0.7399003", "0.7388899", "0.7334685", "0.7251409", "0.72411394", "0.7180755", "0.71534973", "0.7129781", "0.69619197", "0.6934453", "0.68840724", "0.68248236", "0.6730522", "0.6714905", "0.666482...
0.88003904
0
Returns the next sibling of the current node.
def next_sibling_of(node) return valid(node) ? node.next_sibling : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_sibling\n\t\treturn next_sibling_of @current_node\n\tend", "def next_sibling\n return @links[:next_sibling]\n end", "def nextSibling\n native_node.next_sibling && Browser.wrap_node(native_node.next_sibling)\n end", "def next_element_sibling\n n = self.next_sibling\n whi...
[ "0.859301", "0.7917772", "0.7579492", "0.7487571", "0.7276858", "0.7193409", "0.7192539", "0.7075441", "0.7037588", "0.6996282", "0.69843125", "0.6909993", "0.69076943", "0.6900498", "0.6832504", "0.670869", "0.6684521", "0.6634229", "0.66265196", "0.6524457", "0.6457342", ...
0.7919493
1
Returns set of elements by type
def elements_by_type(type) return xpath('//' + type) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def by_type\n return @by_type if @by_type\n\n @by_type = {}\n self.all.each do |set|\n next unless set[:types].count > 0\n\n set[:types].each do |t|\n @by_type[t] ||= []\n @by_type[t] << set\n end\n end\n\n @by_type\n end", "def elements\n return @types.dup\n ...
[ "0.7372266", "0.71640664", "0.6970619", "0.69129604", "0.67684513", "0.67684513", "0.6729588", "0.6680755", "0.6673888", "0.6650561", "0.65323806", "0.64995325", "0.646765", "0.64671856", "0.64671856", "0.627714", "0.6265765", "0.6245004", "0.617194", "0.61620355", "0.6066770...
0.7425538
0
Initializes a new keychain from the specified keychain file
def initialize(options={}) unless options.has_key?(:keychain_file) || options.has_key?(:keychain_data) raise ArgumentError, 'Either a keychain_file or keychain_data is required to create a new keychain class' end @keychain = options[:keychain_data] || JSON.parse(IO.read(options[:keychain_file...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keychain\n @keychain ||= Keychain.new\n end", "def open(path)\n raise ArgumentError unless path\n out_buffer = FFI::MemoryPointer.new(:pointer)\n status = Sec.SecKeychainOpen(path,out_buffer);\n Sec.check_osstatus(status)\n Keychain.new(out_buffer.read_pointer).release_on_gc\...
[ "0.6764559", "0.6604155", "0.65220153", "0.65177053", "0.62628347", "0.625992", "0.610372", "0.6082258", "0.6002221", "0.599431", "0.59017736", "0.5871112", "0.58412194", "0.5766371", "0.57511413", "0.57114697", "0.5698304", "0.5624285", "0.5613551", "0.56077284", "0.56032497...
0.7851533
0
Lists the names of all keys in the keychain
def list @keychain.keys end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_keychains(params: {})\n call :get, '/keychain', params\n end", "def list_keys()\n # TODO\n end", "def list_keys\n @keydict.keys\n end", "def list_keys\n @keys.keys\n end", "def all_keys\n @cluster.client.list_keys(@name)\n end", "def list_checkout_keys\n ...
[ "0.7622633", "0.76178783", "0.75705016", "0.75571156", "0.70517576", "0.6900648", "0.68866533", "0.68799704", "0.68799704", "0.68628806", "0.6859105", "0.6853512", "0.67059165", "0.66911805", "0.6687311", "0.66767424", "0.6670743", "0.66431934", "0.6604101", "0.6594838", "0.6...
0.8521618
0
Index action to render all companies
def index @companies = Company.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @companies = Company.all\n end", "def index\n @companies = Company.all\n end", "def index\n @companies = Company.all\n end", "def index\n @companies = Company.all\n end", "def index\n @companies = Company.all\n end", "def index\n @companies = Company.all\n end", "def...
[ "0.8519863", "0.8519863", "0.8519863", "0.8519863", "0.8519863", "0.8519863", "0.8468628", "0.832885", "0.83087826", "0.82209325", "0.8141195", "0.81384903", "0.80968875", "0.8066812", "0.8035232", "0.80041826", "0.8001578", "0.7999802", "0.79804623", "0.7973436", "0.7971096"...
0.85308367
1
GET /proposals/passed GET /proposals/passed.json
def passed # the non-preliminary ones go first @proposals = Proposal.select{ |p| p.committee.preliminary == false and p.status == 'Passed'} @proposals += Proposal.select{ |p| p.committee.preliminary == true and p.status == 'Passed'} respond_to do |format| format.html # passed.html.erb forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @proposals = listing.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end", "def index\n @proposals = current_user.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json...
[ "0.68021756", "0.6721464", "0.6610791", "0.63833416", "0.61589944", "0.6157168", "0.6157168", "0.615602", "0.61308897", "0.6048299", "0.5965278", "0.5956122", "0.5862362", "0.5791369", "0.57696813", "0.57696813", "0.57696813", "0.5732901", "0.5709056", "0.56706655", "0.564084...
0.78760844
0
para almacenar la tarea, se debe validar si ya existe o no, se debe utililzar un match porque en la base de datos las tareas estan con el nombre mas el nombre del usuario si la tarea no existe se crea la tarea con el nombre de la tarea y el nombre del usuario, para poder luego sacar las tareas correspondientes al usuar...
def almacenar(nombre) array = Tarea.all @@existente = false array.each{|x| @@existente = true if /#{nombre}/.match(x["title"])} unless @@existente Tarea.create("#{nombre} #{@@usuario}") end @@existente end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def obtener\narray = Tarea.all\n \n @@tareas = Array.new\n array.each{|x| @@tareas.push(x) if /#{@@usuario}/.match(x[\"title\"])}\n\n @@tareas.each do |x|\nstring = x[\"title\"].split\n string.pop\nx[\"title\"] = string.join(\" \")\n\n\n end\n #esto es para que no quede una tarea vacia al princip...
[ "0.59642744", "0.5899846", "0.5511915", "0.54818285", "0.544675", "0.54358274", "0.5411925", "0.5399754", "0.53953266", "0.53914344", "0.5381514", "0.5363181", "0.5362122", "0.5315221", "0.5314342", "0.5248974", "0.5230554", "0.5224633", "0.51843625", "0.515506", "0.51540273"...
0.70636255
0
obtiene las tareas correspondientes a cada usuario para mostrarla en la vista, como en la base de datos el nombre de la tarea esta con el nombre mas el usuario se debe quitar el usuario para poder mostrar solo el nombre de la tarea
def obtener array = Tarea.all @@tareas = Array.new array.each{|x| @@tareas.push(x) if /#{@@usuario}/.match(x["title"])} @@tareas.each do |x| string = x["title"].split string.pop x["title"] = string.join(" ") end #esto es para que no quede una tarea vacia al principio, la cual es la correspo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alta_profesores_lista\n\t\t@profesores = []\n\t\t@tab = \"admin\"\n\t\tusuarios = User.select('id, matricula, nombre, apellido, admin, profesor').order(:matricula)\n\t\tusuarios.each do |usuario|\n\t\t\tif (usuario.matricula[0].chr == \"l\") || (usuario.matricula[0].chr == \"L\")\n\t\t\t#se checa primero que l...
[ "0.5945775", "0.5942997", "0.5903607", "0.5740135", "0.5599673", "0.5557967", "0.5499954", "0.54700273", "0.54623455", "0.5425284", "0.54154193", "0.5392129", "0.53889495", "0.53850555", "0.5361046", "0.53598773", "0.5352898", "0.5348539", "0.53281385", "0.53147465", "0.53136...
0.66560787
0
valida si una tarea existe, si lo esta la elimina
def eliminar(id) @@encontrada = false array = Tarea.all array.each{|x| @@encontrada = true if x["id"] == id.to_i} if @@encontrada Tarea.destroy(id) end @@encontrada end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n tmp_element_error = PostitTask.new\n tmp = PostitTask.find(params[:id])\n if tmp\n name = tmp.name\n unless tmp.destroy\n tmp.errors.full_messages.each do |tmp_error| \n tmp_element_error.errors.add(:base, tmp_error)\n end\n end\n end\n if tmp_elem...
[ "0.65420526", "0.65188605", "0.6476775", "0.64403194", "0.64224887", "0.6373143", "0.632365", "0.62232006", "0.6194863", "0.6190611", "0.6156925", "0.6076415", "0.60588896", "0.5997926", "0.59929645", "0.59666306", "0.5931902", "0.59313625", "0.5925074", "0.5871588", "0.58454...
0.69417965
0
Render the error message with a status of 404 and a message letting the user know the resource does not exist.
def render_404 render( json: { error_messages: ['Resource does not exist'], error_code: 'NOT_FOUND' }, status: 404 ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_missing\r\n RenderError.new('404')\r\n end", "def not_found\n render(status: :not_found, json: { errors: [{\n status: '404', code: :not_found, title: 'Not Found'\n }]})\n # render jsonapi: nil, code: 404, title: 'Invalid Path', detail: params[:path], status: :...
[ "0.8218796", "0.81986064", "0.8143563", "0.8131394", "0.8115979", "0.8108247", "0.8099551", "0.8097435", "0.80966157", "0.80960447", "0.8017813", "0.7997156", "0.79967624", "0.7992711", "0.7984181", "0.7970211", "0.7950132", "0.7933182", "0.7915035", "0.7908608", "0.78991777"...
0.8725738
0
points are 2d with as in [x,y] example invocation: closest_pair([[2,3], [1,4], [3,5], [2,2]]) approach: brute force complexity: O(nn)
def closest_pair1(points) min_distance = Float::MAX best_pair = nil (0...points.length).each do |i| (i...points.length).each do |j| if i != j curr_distance = distance1(points[i], points[j]) if curr_distance < min_distance min_distance = curr_distance best_pair = [poin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(points) # array with all the points\n #copy of the array by an especific cordinate\n #nlogn\n # This is a primitive, aka operations that are costless compared to the\n # total complexity we are aming for\n px = sort_by_cordinate(points, 0)\n py = sort_by_cordinate(points, 1)\n\n result = closest_pa...
[ "0.85408145", "0.8106821", "0.7751728", "0.7697608", "0.69138294", "0.6890541", "0.67882025", "0.6780664", "0.6744194", "0.6680858", "0.6556518", "0.6529613", "0.6514368", "0.6484864", "0.6425766", "0.63992155", "0.6346496", "0.63223886", "0.62771577", "0.6265098", "0.6232421...
0.84537935
1
Returns if account number is already present, else continues to generate a token
def generate_account_number return if account_number.present? self.account_number = generate_account_number_token end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_account_number_token\n loop do\n token = SecureRandom.hex(3).upcase\n break token unless User.find_by(account_number: token)\n end\n end", "def generate_auth_token\n loop do \n token = SecureRandom.hex\n break token unless self.class.exists?(auth_token: token)\n end\...
[ "0.7797333", "0.7063733", "0.6776236", "0.6755165", "0.6741222", "0.670835", "0.6672453", "0.66361755", "0.6619657", "0.6612816", "0.6607426", "0.65576863", "0.65078455", "0.6486288", "0.6486288", "0.6439464", "0.64173603", "0.6401108", "0.6376855", "0.637618", "0.6359196", ...
0.7640776
1
GET /meetings GET /meetings.xml
def index @meetings = Meeting.recent @past_meetings = Meeting.recent.past @upcoming_meetings = Meeting.upcoming respond_to do |format| format.html # index.html.erb format.xml { render :xml => @meetings } format.atom end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_meetings\n prepare\n @api.get_meetings\n end", "def index\n respond_to do |format|\n format.html { render action: 'index' } # index.html.erb\n format.json do\n out = meetings.per(500).map(&:to_json_attributes)\n out.each { |m| m[:url] = meeting_path(m[:url]) }\n r...
[ "0.73006713", "0.7228295", "0.7150945", "0.71381956", "0.70992327", "0.70992327", "0.70992327", "0.70992327", "0.70992327", "0.70992327", "0.7081934", "0.70216846", "0.7017986", "0.69139695", "0.68607235", "0.678778", "0.6680968", "0.6652381", "0.6564465", "0.65491414", "0.64...
0.75696325
0
GET /meetings/new GET /meetings/new.xml
def new @meeting = Meeting.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @meeting } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end", "def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n ...
[ "0.7177989", "0.7177989", "0.7177989", "0.7172814", "0.69502544", "0.68651795", "0.68575746", "0.68321866", "0.67510706", "0.672825", "0.67152536", "0.66885686", "0.66578853", "0.66542256", "0.6652893", "0.66417617", "0.6626984", "0.6626984", "0.66234565", "0.66234565", "0.66...
0.7672542
1
POST /meetings POST /meetings.xml
def create @meeting = Meeting.new(params[:meeting]) respond_to do |format| if @meeting.save flash[:notice] = 'Meeting was successfully created.' format.html { redirect_to(@meeting) } format.xml { render :xml => @meeting, :status => :created, :location => @meeting } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @meeting = current_user.meetings.new(meeting_params)\n new_event(@meeting)\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to new_event_path, notice: 'Meeting was successfully created.' }\n else\n format.html { render :new }\n format.json { ...
[ "0.6385355", "0.63697445", "0.63660413", "0.6332388", "0.6302386", "0.6289513", "0.62788576", "0.6221645", "0.6170628", "0.6160674", "0.614793", "0.61457247", "0.60964406", "0.6095229", "0.60608953", "0.606086", "0.60464096", "0.60216075", "0.60052437", "0.59765655", "0.59733...
0.63848025
1
DELETE /meetings/1 DELETE /meetings/1.xml
def destroy @meeting = Meeting.find(params[:id]) @meeting.destroy respond_to do |format| format.html { redirect_to(meetings_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to( committee_meetings_url( meeting.committee ),\n flash: { success: \"Meeting destroyed.\" } ) }\n format.xml { head :ok }\n end\n end", "def destroy\n @meetup = Meetup.find(params[:id])\n @meetup...
[ "0.7192475", "0.71921545", "0.71268713", "0.707988", "0.7069304", "0.7069304", "0.7069304", "0.7014493", "0.7010651", "0.7009012", "0.6978566", "0.6970698", "0.69154376", "0.69109815", "0.690946", "0.6866191", "0.68227875", "0.6816975", "0.68023515", "0.6794282", "0.6767315",...
0.7587487
1
Add top tweets data onto feeds GET /feeds_with_top_tweets
def feeds_with_top_tweets end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feed_tweets(max_tweets = nil, latest_date = nil )\n @tweets = Tweet.joins(:user)\n .joins(\"LEFT OUTER JOIN follows ON users.id = follows.followee_id\")\n .where(\"tweets.user_id = :id OR follows.follower_id = :id\", id: self.id)\n .order(\"tweets.created_at DESC\")\n .uniq\n #debugge...
[ "0.7275259", "0.7072762", "0.6885682", "0.68314815", "0.670396", "0.6624022", "0.66227055", "0.6522871", "0.6467999", "0.64549625", "0.6415657", "0.64075404", "0.637743", "0.6356602", "0.63205814", "0.6310111", "0.6289296", "0.62812", "0.62709296", "0.6202506", "0.6184749", ...
0.8702587
0
Symlink the dynamic linker, ld.so
def symlink_ld_so ld_so = HOMEBREW_PREFIX/"lib/ld.so" return if ld_so.readable? sys_interpreter = [ "/lib64/ld-linux-x86-64.so.2", "/lib/ld-linux.so.3", "/lib/ld-linux.so.2", "/lib/ld-linux-armhf.so.3", "/lib/ld-linux-aarch64.so.1", "/system/bin/linker",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_link_hook(linker)\n basic_name = get_basic_name(linker)\n soname = get_soname(linker)\n symlink_lib_to basic_name\n symlink_lib_to soname\n end", "def post_link_hook(linker, bb)\n basic_name = get_basic_name(linker, bb)\n symlink_lib_to(basic_name, bb)\n end", "def ...
[ "0.7580968", "0.7148825", "0.7120533", "0.6471518", "0.63533896", "0.6184087", "0.61486834", "0.58158135", "0.57919675", "0.5790475", "0.57530034", "0.5734655", "0.5685838", "0.5631665", "0.56026757", "0.5596154", "0.55924875", "0.5586103", "0.55793375", "0.55639243", "0.5557...
0.82425684
0
Symlink the host's compiler
def symlink_host_gcc version = DevelopmentTools.non_apple_gcc_version "/usr/bin/gcc" return if version.null? suffix = (version < 5) ? version.to_s[/^\d+\.\d+/] : version.to_s[/^\d+/] return if File.executable?("/usr/bin/gcc-#{suffix}") || File.executable?(HOMEBREW_PREFIX/"bin/gcc-#{suffix}") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link(filename, outdir, platform='linux')\n f = base(filename)\n cmd, args = *case platform\n when 'darwin'\n ['gcc', '-arch i386']\n when 'linux'\n ['ld', '']\n else\n raise \"unsupported platform: #{platform}\"\n ...
[ "0.6607594", "0.61349684", "0.6115538", "0.59941584", "0.59676796", "0.5895924", "0.587867", "0.5805132", "0.577564", "0.5770861", "0.57555145", "0.57321453", "0.57066673", "0.5703489", "0.5626191", "0.5576637", "0.5545239", "0.5505228", "0.5503875", "0.5474848", "0.54355013"...
0.7200219
0
given a dropdown list, return the list items as an array of strings with symbols for header or divider
def dropdown_list_items(list) css_select(list, "li").map do |item| if item['class'] && item['class'].include?("divider") :divider elsif item['class'] && item['class'].include?("dropdown-header") { :header => item.text.strip } else item.text.strip end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_options(items)\n items.map do |item|\n if item.is_a?(Array)\n \"<option value=\\\"#{item.last}\\\">#{item.first}</option>\"\n else\n \"<option value=\\\"#{item}\\\">#{item}</option>\"\n end\n end.join(\"\\n\")\n end", "def format_for_dr...
[ "0.6703572", "0.6472989", "0.6442024", "0.6339355", "0.625227", "0.62237626", "0.6216079", "0.6163029", "0.6160544", "0.6160544", "0.61278826", "0.6117026", "0.6082532", "0.60705376", "0.60685676", "0.6016247", "0.59884906", "0.59873635", "0.5909746", "0.5871464", "0.57388884...
0.73770213
1
GET /inversions GET /inversions.json
def index permission_denied and return if current_user.cannot 'read_inversion' @inversions = Inversion.all @new_inversion = Inversion.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def versions\n JSON.parse(RestClient.get(\"#{VERSION_URL}/.json\", self.default_headers))[\"versions\"].collect { |v| v[\"id\"] }.uniq\n end", "def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend", "def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", arg...
[ "0.6828426", "0.6658833", "0.6615265", "0.656496", "0.6462295", "0.6443544", "0.634676", "0.6336408", "0.6273345", "0.62544596", "0.6249097", "0.6248858", "0.61608666", "0.6144573", "0.6137064", "0.6088992", "0.6064875", "0.5995043", "0.59650743", "0.5959151", "0.58936846", ...
0.6722068
1
POST /inversions POST /inversions.json
def create permission_denied and return if current_user.cannot 'create_inversion' @inversion = Inversion.new(inversion_params) respond_to do |format| if @inversion.save format.html { redirect_to inversions_url, success: @inversion.table_name_to_show.concat( ' fue creada satisfactoriamente.')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n permission_denied and return if current_user.cannot 'read_inversion'\n @inversions = Inversion.all\n @new_inversion = Inversion.new\n end", "def add_aos_version(args = {}) \n post(\"/aosversions.json/\", args)\nend", "def create\n version_attributes = params.require(:version).permit(:...
[ "0.6122786", "0.5995528", "0.59828323", "0.58740574", "0.5815153", "0.5805874", "0.5504974", "0.54876375", "0.5440713", "0.54056454", "0.5298512", "0.52474576", "0.51993805", "0.51987857", "0.5129507", "0.5112156", "0.5097236", "0.5069937", "0.50551194", "0.5051203", "0.50483...
0.6142687
0
PATCH/PUT /inversions/1 PATCH/PUT /inversions/1.json
def update permission_denied and return if current_user.cannot 'update_inversion' respond_to do |format| if @inversion.update(inversion_params) format.html { redirect_to inversion_url, success: @inversion.table_name_to_show.concat( ' fue actualizado satisfactoriamente.') } format.json { r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aos...
[ "0.6500243", "0.6379029", "0.6197282", "0.6197282", "0.6197282", "0.6192458", "0.6028327", "0.6007387", "0.59853804", "0.59819144", "0.59643567", "0.59149766", "0.5907336", "0.5897103", "0.5831606", "0.57979035", "0.5796307", "0.5796307", "0.57659876", "0.57554513", "0.573842...
0.6464035
1
Returns my accounts as Padma::Account objects
def padma_accounts return nil if self.accounts.nil? self.accounts.map{|a|PadmaAccount.new(a)} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accounts\n Management::Account.all(self)\n end", "def accounts\n\t\treturn @accounts\n\tend", "def accounts\n response = query_api(\"/rest/accounts\")\n return response[\"accounts\"].map {|account| Account.new(self, account)}\n end", "def get_accounts\n @accounts = Account.all\n ...
[ "0.7751779", "0.7661673", "0.7652608", "0.7641887", "0.7597057", "0.75443", "0.754061", "0.752987", "0.75099534", "0.74770606", "0.74174017", "0.7405429", "0.71041197", "0.70661867", "0.70654166", "0.70612395", "0.70393413", "0.7033915", "0.7000612", "0.69850373", "0.6976003"...
0.8455378
0
Returns me enabled accounts as Padma::Account objects
def enabled_accounts return [] if self.accounts.nil? self.accounts.reject{|a|!a['enabled']}.map{|a|PadmaAccount.new(a)} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enabled_accounts\n self.padma.try(:enabled_accounts)\n end", "def padma_accounts\n return nil if self.accounts.nil?\n self.accounts.map{|a|PadmaAccount.new(a)}\n end", "def accounts\n Management::Account.all(self)\n end", "def all\n @dealing_platform.gather 'accounts', :acco...
[ "0.7983615", "0.75145507", "0.7334475", "0.7208966", "0.70647144", "0.7052674", "0.7043298", "0.70306796", "0.70035243", "0.6908325", "0.6865661", "0.68348813", "0.68333775", "0.6779871", "0.6750549", "0.67298484", "0.6705439", "0.6623847", "0.66135246", "0.65814143", "0.6568...
0.84496975
0
Writes the chunk to the IO stream. It will call the +content+ method to get the content for this chunk, and will calculate and append the checksum automatically.
def write(io) write_with_crc(io, content || '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(chunk)\n chunk.read\n end", "def write(io)\n write_with_crc(io, content || \"\")\n end", "def write(chunk)\n @size += chunk.bytesize\n # Worth noting that size always appears larger during this check than it\n # is in reality since the size is updated prior to w...
[ "0.6953399", "0.6554605", "0.6513914", "0.62119555", "0.6108585", "0.6107049", "0.5999084", "0.59141713", "0.57899016", "0.5699912", "0.5671154", "0.5651358", "0.56068385", "0.559704", "0.559704", "0.55875796", "0.5359926", "0.53571254", "0.5320443", "0.5314533", "0.53140837"...
0.6640842
1
fetch details and create/update model for a particular DC title
def fetch_title_dc(publisher, title, url, date = nil) log("retrieving title information for [#{title}]", :debug) doc = Hpricot(open(url)) # span.display_talent = "Written by, Art by... " # span.display_copy = "A final confrontation pits..." # span.display_data = "DC Universe &nbsp;|...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_title_marvel(publisher, title, url, date = nil) \n log(\"retrieving title information for [#{title}]\", :debug)\n doc = Hpricot(open(url))\n \n display_description = (doc/\"font[@class=plain_text]\").innerHTML\n\n title = RubyPants.new(title, -1).to_html\n display_name,...
[ "0.55922514", "0.55852306", "0.55035514", "0.5496427", "0.54549944", "0.5409511", "0.5382595", "0.53744924", "0.5301359", "0.5301359", "0.5301359", "0.5301359", "0.5301359", "0.52581793", "0.52512264", "0.5244808", "0.5237615", "0.52089113", "0.51761216", "0.51709807", "0.508...
0.6131278
0
fetch details and create/update model for a particular DC title
def fetch_title_marvel(publisher, title, url, date = nil) log("retrieving title information for [#{title}]", :debug) doc = Hpricot(open(url)) display_description = (doc/"font[@class=plain_text]").innerHTML title = RubyPants.new(title, -1).to_html display_name, display_number ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_title_dc(publisher, title, url, date = nil)\n log(\"retrieving title information for [#{title}]\", :debug)\n doc = Hpricot(open(url))\n \n # span.display_talent = \"Written by, Art by... \"\n # span.display_copy = \"A final confrontation pits...\"\n # span.display_data = \"D...
[ "0.6131278", "0.55852306", "0.55035514", "0.5496427", "0.54549944", "0.5409511", "0.5382595", "0.53744924", "0.5301359", "0.5301359", "0.5301359", "0.5301359", "0.5301359", "0.52581793", "0.52512264", "0.5244808", "0.5237615", "0.52089113", "0.51761216", "0.51709807", "0.5087...
0.55922514
1
replace name with the converted value in TITLE_CONVERSION_LIST if it's been flagged for modification (due to an improper solicitation, etc)
def check_title(name) # titleize without the botched 'S (apostrophe-s) issue name = name.humanize.strip.squeeze(' ').gsub(/\b([a-z])/) { $1.capitalize }.gsub(/\'S/, '\'s') match = TITLE_CONVERSION_LIST.keys.select { |t| name.match(/#{Regexp.escape(t)}/i) } unless match.empty? match = ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def titleize_proper_names\n self.author = self.author.titleize\n self.editor = self.editor.titleize if self.editor\n self.buyed_from = self.buyed_from.titleize if self.buyed_from\n end", "def parameterize_title_for_name\n self.name = title.parameterize if title\n end", "def titleize\n dup.tap(...
[ "0.64437896", "0.59596187", "0.59278756", "0.58932835", "0.58932835", "0.5821976", "0.5809699", "0.5759938", "0.5744363", "0.572556", "0.5718931", "0.5718462", "0.57045025", "0.56232184", "0.5615835", "0.5611629", "0.55944186", "0.55754536", "0.5556236", "0.5552546", "0.55311...
0.5975166
1
Manufacture an EC2 security group. The second parameter, rules, is an "ingress_rules" structure parsed and validated by MU::Config.
def setRules(rules, add_to_self: false, ingress: true, egress: false) return if rules.nil? or rules.size == 0 if add_to_self rules.each { |rule| if rule['sgs'].nil? new_rule = rule.clone new_rule.delete('hosts') rule['sgs'] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convertToEc2(rules)\n ec2_rules = []\n if rules != nil\n rules.each { |rule|\n ec2_rule = Hash.new\n rule['proto'] = \"tcp\" if rule['proto'].nil? or rule['proto'].empty?\n ec2_rule[:ip_protocol] = rule['proto']\n\n p_start = nil\...
[ "0.7184339", "0.61924857", "0.58716196", "0.5747694", "0.55351424", "0.5526258", "0.5476864", "0.5455429", "0.5451784", "0.5440346", "0.5416581", "0.5384735", "0.52951914", "0.51761967", "0.5116565", "0.51091504", "0.5106706", "0.5069618", "0.50331575", "0.5004386", "0.499176...
0.6506932
1
Convert our config languages description of firewall rules into Amazon's. This rule structure is as defined in MU::Config.
def convertToEc2(rules) ec2_rules = [] if rules != nil rules.each { |rule| ec2_rule = Hash.new rule['proto'] = "tcp" if rule['proto'].nil? or rule['proto'].empty? ec2_rule[:ip_protocol] = rule['proto'] p_start = nil p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def formatRules config\n\tresult = \"\"\n\t\n\t# rule set filename is not indicated from the name of the rule set, so a mapping is used\n\trulesetFiles = {\"Android\" => \"android\",\"Basic\" => \"basic\",\"Braces\" => \"braces\",\"Clone Implementation\" => \"clone\",\"Code Size\" => \"codesize\",\"Comments\" => \...
[ "0.61242247", "0.57955056", "0.579042", "0.57717", "0.55693173", "0.5555996", "0.55405885", "0.5540385", "0.55349433", "0.5494803", "0.54843014", "0.54843014", "0.5432833", "0.539634", "0.5370612", "0.53447706", "0.53441375", "0.5321945", "0.5312328", "0.5306548", "0.52898777...
0.5943718
1
=begin :type prefix: String :type suffix: String :rtype: Integer =end
def f(prefix, suffix) @hash[prefix].nil? || @hash[prefix][suffix].nil? ? -1 : @hash[prefix][suffix] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_part_with_prefix(prefix, suffix)\n num = @parts.select { |n, _| n.start_with?(prefix) && n.end_with?(suffix) }\n .map { |n, _| n[prefix.length..-1][0..-(suffix.size + 1)].to_i }\n .max\n num = (num || 0) + 1\n \"#{prefix}#{num}#{suffix}\"\n end...
[ "0.7463263", "0.6559145", "0.64508134", "0.60494727", "0.60494727", "0.60494727", "0.60494727", "0.60494727", "0.59450126", "0.5874299", "0.58166337", "0.5691618", "0.5691618", "0.56827635", "0.5674452", "0.5581028", "0.5558828", "0.5558499", "0.5558499", "0.5558499", "0.5558...
0.6696163
1
return the chef config files dir or fail hard
def chef_config_path if Chef::Config['config_file'] ::File.dirname(Chef::Config['config_file']) else raise("No chef config file defined. Are you running \ chef-solo? If so you will need to define a path for the ohai_plugin as the \ path cannot be determined") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_directory\n \"C:\\\\chef\"\n end", "def find_config_path\n path = Pathname(Pathname.pwd).ascend{|d| h=d+config_filename; break h if h.file?}\n end", "def cfg_dir\n File.join(@full_path, CONFIG_DIR)\n end", "def chef_config_path\n Berkshelf.root.join(\"spec/config...
[ "0.78017294", "0.7541503", "0.7502662", "0.7380222", "0.7167201", "0.71493816", "0.7068944", "0.70639604", "0.7021905", "0.7008876", "0.7008876", "0.7001938", "0.69809324", "0.6899863", "0.6894657", "0.6793473", "0.6776487", "0.67223704", "0.67008024", "0.66179454", "0.660591...
0.77907807
1
is the desired plugin dir in the ohai config plugin dir array?
def in_plugin_path?(path) # get the directory where we plan to stick the plugin (not the actual file path) desired_dir = ::File.directory?(path) ? path : ::File.dirname(path) case node['platform'] when 'windows' ::Ohai::Config.ohai['plugin_path'].map(&:downcase).include?(desired_dir.downcase) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maybe_plugin_dir(path:)\n path and plugin_dir path: path or self\n end", "def plugin_directory; end", "def plugins_directory\n @@plugins_directory ||= './plugins'\n end", "def plugins_path; end", "def current_plugin?\n if Origen.application_loaded?\n Origen.app.plugins.curre...
[ "0.75336653", "0.7378803", "0.7114235", "0.70886266", "0.70205355", "0.69956034", "0.6961204", "0.6949756", "0.68870604", "0.68290204", "0.6709665", "0.6660084", "0.6555435", "0.6493822", "0.6465093", "0.64543086", "0.64234895", "0.634609", "0.63372", "0.6327181", "0.6302366"...
0.820934
0
we need to warn the user that unless the path for this plugin is in Ohai's plugin path already we're going to have to reload Ohai on every Chef run. Ideally in future versions of Ohai /etc/chef/ohai/plugins is in the path.
def plugin_path_warning Chef::Log.warn("The Ohai plugin_path does not include #{desired_plugin_path}. \ Ohai will reload on each chef-client run in order to add this directory to the \ path unless you modify your client.rb configuration to add this directory to \ plugin_path. The plugin_path can be set via the chef...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ohai_plugin_path\n \"/etc/chef/ohai_plugins\"\n end", "def setup_ohai\n Ohai::Config[:plugin_path] << ohai_plugin_path\n @ohai = Ohai::System.new\n @ohai.all_plugins\n end", "def compile_ohai_plugins\n return super unless $CHEFSPEC_MODE\n return if $CHEFSPEC_PRELOAD\n\n s...
[ "0.7636913", "0.66288525", "0.6389356", "0.63807756", "0.6358395", "0.6192538", "0.58402437", "0.58359164", "0.56772554", "0.56727105", "0.56377244", "0.55836606", "0.5564606", "0.55620384", "0.5516394", "0.5486679", "0.5484506", "0.5479545", "0.5479366", "0.54792345", "0.546...
0.8726781
0
Add a frame to the message (positioning it at the end of message). Any ZMQ::Message automatically gets copied out to a ruby string (user still responsible for original ZMQ::Message), strings are added directly.
def add(frame) msg_frame = convert_frame(frame) return nil if msg_frame.nil? @msg_frames << msg_frame self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(frame)\n msg_frame = convert_frame(frame)\n return nil if msg_frame.nil?\n @msg_frames.unshift(msg_frame)\n self\n end", "def push(frame)\n msg_frame = convert_frame(frame)\n return nil if msg_frame.nil?\n @msg_frames.unshift(msg_frame)\n self\n end", "def...
[ "0.70751184", "0.70751184", "0.64102805", "0.6161355", "0.60879815", "0.59986806", "0.59584296", "0.58947015", "0.58887535", "0.5644586", "0.558231", "0.55789757", "0.5523461", "0.5521585", "0.5515992", "0.55045575", "0.5493586", "0.5429489", "0.5426171", "0.5420571", "0.5411...
0.7219567
1
Add a frame to the front of the message. Frame can be either a string or a ZMQ::Message. The method copies out any string given in a ZMQ::Message (and the user is still in charge of properly closing such a message).
def push(frame) msg_frame = convert_frame(frame) return nil if msg_frame.nil? @msg_frames.unshift(msg_frame) self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(frame)\n msg_frame = convert_frame(frame)\n return nil if msg_frame.nil?\n @msg_frames << msg_frame\n self\n end", "def add(frame)\n msg_frame = convert_frame(frame)\n return nil if msg_frame.nil?\n @msg_frames << msg_frame\n self\n end", "def push(obj)\n ...
[ "0.6618648", "0.6618648", "0.59120953", "0.5898879", "0.58269763", "0.57802206", "0.5601004", "0.54635406", "0.5391144", "0.53286916", "0.5303479", "0.5247716", "0.5223775", "0.5216274", "0.51866853", "0.512249", "0.51193976", "0.5116066", "0.5103631", "0.50944704", "0.506547...
0.72565156
1
Create a duplicate of the message.
def duplicate dup_frames = @msg_frames.map {|frame| frame.dup} ZMQ::StringMultipartMessage.new(dup_frames) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_duplicate_message(message, clone)\n if message.request?\n if message.from_user_info == @from && message.to_user_info == @to\n if clone.outgoing? && message.incoming?\n clone.duplicate = true\n else\n ...
[ "0.7034578", "0.6996422", "0.6937953", "0.67715174", "0.6319098", "0.6307666", "0.6281456", "0.6262816", "0.62531364", "0.6162757", "0.61578", "0.61570317", "0.61515903", "0.61447096", "0.6094837", "0.60811496", "0.6079748", "0.6079748", "0.6045895", "0.6016814", "0.59561193"...
0.71045434
0
Decrypts a block of data (encrypted_data) given an encryption key and an initialization vector (iv). Keys, iv's, and the data returned are all binary strings. Cipher_type should be "AES256CBC", "AES256ECB", or any of the cipher types supported by OpenSSL. Pass nil for the iv if the encryption type doesn't use iv's (lik...
def decrypt(encrypted_data, key, iv, cipher_type) aes = OpenSSL::Cipher::Cipher.new(cipher_type) aes.decrypt aes.key = key aes.iv = iv if iv != nil aes.update(encrypted_data) + aes.final end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decrypt_data(encrypted_data, key, iv, cipher_type)\n aes = OpenSSL::Cipher::Cipher.new(cipher_type)\n aes.decrypt\n aes.key = key\n aes.padding = 0\n aes.iv = iv if iv != nil\n aes.update(encrypted_data) + aes.final\n end", "def decrypt encrypted_data, key, iv, cipher_type\n aes = OpenS...
[ "0.8432963", "0.8187987", "0.75452805", "0.74710566", "0.7119538", "0.70949453", "0.70847267", "0.7000138", "0.6980801", "0.6946616", "0.693633", "0.688547", "0.6851703", "0.6817218", "0.68083364", "0.6757908", "0.66244787", "0.6618416", "0.659759", "0.65801257", "0.6572465",...
0.8439621
0
Encrypts a block of data given an encryption key and an initialization vector (iv). Keys, iv's, and the data returned are all binary strings. Cipher_type should be "AES256CBC", "AES256ECB", or any of the cipher types supported by OpenSSL. Pass nil for the iv if the encryption type doesn't use iv's (like ECB). :return: ...
def encrypt(data, key, iv, cipher_type) aes = OpenSSL::Cipher::Cipher.new(cipher_type) aes.encrypt aes.key = key aes.iv = iv if iv != nil aes.update(data) + aes.final end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encrypt_data(data, key, iv, cipher_type)\n aes = OpenSSL::Cipher::Cipher.new(cipher_type)\n aes.encrypt\n aes.key = key\n aes.iv = iv if iv != nil\n aes.update(data) + aes.final\n end", "def encrypt data, key, iv, cipher_type\n aes = OpenSSL::Cipher::Cipher.new cipher_type\n aes.encrypt...
[ "0.8367523", "0.8310651", "0.8018604", "0.7561377", "0.7245172", "0.7221345", "0.69133705", "0.68800205", "0.6872039", "0.68715656", "0.68711346", "0.6845555", "0.6768463", "0.6674719", "0.6661547", "0.65922177", "0.6588938", "0.6569504", "0.6516006", "0.6479473", "0.6410227"...
0.83820516
0
Runs a program locally.
def run(program,*args) system(program,*args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_local(cmd)\n system(cmd)\n end", "def run_locally(cmd)\n logger.trace \"executing locally: #{cmd.inspect}\" if logger\n `#{cmd}`\n end", "def run(cmd)\n #logger.trace \"executing locally: #{cmd.inspect}\" if logger\n run_locally cmd\n # puts `#{cmd}`\nend", "def local\n...
[ "0.69531864", "0.68587", "0.6522916", "0.6191551", "0.6101409", "0.6028299", "0.6013207", "0.599349", "0.5983679", "0.5983679", "0.59690535", "0.5917468", "0.588048", "0.5861798", "0.5851168", "0.5830518", "0.5827285", "0.5826208", "0.57766294", "0.5772347", "0.5694776", "0...
0.6893583
1
GET /efforts GET /efforts.json
def index @efforts = Effort.all respond_to do |format| format.html # index.html.erb format.json { render json: @efforts } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @effort = Effort.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @effort }\n end\n end", "def show\n @effort = Effort.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.er...
[ "0.7128618", "0.7128059", "0.6579969", "0.6416515", "0.6225248", "0.6212075", "0.60979205", "0.59309536", "0.5849424", "0.57973653", "0.57282275", "0.5720143", "0.5697248", "0.5672627", "0.56671894", "0.5658207", "0.56552464", "0.56409734", "0.56394607", "0.5636336", "0.56323...
0.7651738
0
GET /efforts/1 GET /efforts/1.json
def show @effort = Effort.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @effort } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @effort = Effort.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @effort }\n end\n end", "def index\n @efforts = Effort.all\n\n respond_to do |format|\n format.html # index.html.erb\n fo...
[ "0.7495704", "0.74258894", "0.6464546", "0.6396182", "0.638218", "0.6340826", "0.62139845", "0.60046506", "0.5952846", "0.59344625", "0.5875357", "0.5875357", "0.58585757", "0.58548373", "0.5851356", "0.5851356", "0.5831068", "0.5828114", "0.5814851", "0.57949436", "0.5786053...
0.75051475
0
GET /efforts/new GET /efforts/new.json
def new @effort = Effort.new respond_to do |format| format.html # new.html.erb format.json { render json: @effort } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @effort = Effort.new(user_id: spree_current_user.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @effort }\n end\n end", "def create\n @effort = Effort.new(params[:effort])\n\n respond_to do |format|\n if @e...
[ "0.730456", "0.70629305", "0.69774073", "0.68256575", "0.6792218", "0.6576796", "0.6576796", "0.65649194", "0.65649194", "0.65513456", "0.6547807", "0.6547807", "0.6547807", "0.6547807", "0.65412456", "0.6538537", "0.65374184", "0.6531159", "0.6520965", "0.6515067", "0.651147...
0.80478424
0
POST /efforts POST /efforts.json
def create @effort = Effort.new(params[:effort]) respond_to do |format| if @effort.save format.html { redirect_to @effort, notice: 'Effort was successfully created.' } format.json { render json: @effort, status: :created, location: @effort } else format.html { render action:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @efforts = Effort.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @efforts }\n end\n end", "def create\n @effort = Effort.new(params[:effort])\n @effort.started_at = Time.now if params[:commit] == \"Iniciar atividade\"\n\n ...
[ "0.6383167", "0.6292616", "0.60142577", "0.6010825", "0.57508177", "0.5703241", "0.5688933", "0.55571604", "0.5556797", "0.5534042", "0.5513427", "0.54798985", "0.547407", "0.5438401", "0.5421402", "0.5394739", "0.5378964", "0.5377503", "0.53509384", "0.53286004", "0.532108",...
0.6762209
0
PUT /efforts/1 PUT /efforts/1.json
def update @effort = Effort.find(params[:id]) respond_to do |format| if @effort.update_attributes(params[:effort]) format.html { redirect_to @effort, notice: 'Effort was successfully updated.' } format.json { head :ok } else format.html { render action: "edit" } form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @effort = Effort.find(params[:id])\n @effort.completed_at = Time.now if params[:commit] == \"Concluir atividade\"\n\n respond_to do |format|\n if @effort.update_attributes(params[:effort])\n format.html { redirect_to admin_efforts_path, notice: 'Alocação atuali...
[ "0.65331805", "0.64933944", "0.6129887", "0.6000726", "0.5985331", "0.5969388", "0.5923918", "0.5922773", "0.59196436", "0.5885111", "0.5882329", "0.5845489", "0.5836597", "0.58312607", "0.5830117", "0.5828616", "0.57698005", "0.5761425", "0.5739286", "0.5726388", "0.57254183...
0.7192345
0
DELETE /efforts/1 DELETE /efforts/1.json
def destroy @effort = Effort.find(params[:id]) @effort.destroy respond_to do |format| format.html { redirect_to efforts_url } format.json { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @effort = Effort.find(params[:id])\n @effort.destroy\n\n respond_to do |format|\n format.html { redirect_to efforts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @editability = Editability.find(params[:id])\n @editabil...
[ "0.73529345", "0.6870871", "0.68154883", "0.66863745", "0.65773666", "0.6575156", "0.65736735", "0.65386367", "0.6522808", "0.65180516", "0.6500292", "0.6498986", "0.6470524", "0.6450188", "0.6443897", "0.6429751", "0.6413883", "0.64088935", "0.6404612", "0.6390975", "0.63871...
0.7626579
0
Saves the current state of all merged entities. For more complete error reporting, this method attempts to save all entities regardless of whether or not a previous entity or set of entities failed to save. However, it will return true if and only if all entities were saved. When data dependencies exist, this can lead ...
def save collections = [participants, people, contacts, events, instruments, response_sets, question_response_sets ].map { |c| current_for(c).compact } ActiveRecord::Base.transaction do collections.map { |c| save_col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def committed?\n @saved\n end", "def save\n save!\n rescue StandardError\n false\n end", "def save\n begin\n save!\n true\n rescue\n false\n end\n end", "def save!\n unless save\n self.class.fail_validate!(self) unless errors.empty?\n ...
[ "0.6109903", "0.60229796", "0.59732074", "0.5901313", "0.5892655", "0.57836634", "0.57782817", "0.57714987", "0.57659143", "0.5695334", "0.5694243", "0.5682495", "0.56547755", "0.56536376", "0.56320524", "0.56197196", "0.5610536", "0.55997616", "0.5595881", "0.5588441", "0.55...
0.63260096
0
Search gem data paths.
def data_path(match, options={}) specs = specifications(options) matches = [] specs.each do |spec| list = [] glob = File.join(spec.full_gem_path, 'data', match) list = Dir[glob] #.map{ |f| f.untaint } list = list.map{ |d| d.chomp('/') } matches....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paths_from_software_gems\n @paths_from_software_gems ||=\n Array(Config.software_gems).inject([]) do |array, name|\n if (spec = Gem::Specification.find_all_by_name(name).first)\n array << File.expand_path(spec.gem_dir)\n end\n\n array\n end\n end", ...
[ "0.67978895", "0.6582824", "0.65235054", "0.64876014", "0.6485551", "0.63830143", "0.6360867", "0.63585126", "0.6349846", "0.63223344", "0.6300142", "0.6299768", "0.6294332", "0.6285686", "0.6240776", "0.62154865", "0.62132496", "0.6209585", "0.6206423", "0.6202027", "0.62020...
0.70380396
0
DELETE /problems/1 DELETE /problems/1.json
def destroy @problem.destroy respond_to do |format| format.html { redirect_to problems_url } format.json { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @problem.destroy\n respond_to do |format|\n format.html { redirect_to problems_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @problem = Problem.find_by_shortname(params[:id])\n @problem.destroy\n\n respond_to do |format|\n format.html { redi...
[ "0.7560659", "0.7557449", "0.755692", "0.755692", "0.755692", "0.755692", "0.7495239", "0.7386734", "0.7368817", "0.73638684", "0.73053366", "0.72629756", "0.7138887", "0.7128535", "0.70500004", "0.70385283", "0.70229536", "0.70055926", "0.7003952", "0.68813664", "0.67814624"...
0.76009053
0
Scales a primitive rect by a percentage.
def scale_rect percentage, *anchors Geometry.scale_rect self, percentage, *anchors end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale(*args)\n r = Rect.new x, y, w, h\n r.resolution = r.resolution * Vector2[args.singularize]\n r\n end", "def vscale(factor)\n @height = @height * factor\n @top *= factor\n self\n end", "def scale(value)\r\n value * @height/2 + @height/4\r\n end", "def scale(x, y)\n ...
[ "0.63197976", "0.6116605", "0.60990804", "0.5944514", "0.58709925", "0.5776801", "0.5719672", "0.56415004", "0.56407744", "0.5614465", "0.5609648", "0.5562131", "0.55542594", "0.5543392", "0.55390245", "0.5535034", "0.5492933", "0.54394084", "0.5434011", "0.5426827", "0.54217...
0.84678346
0
Returns the angle to one primitive from another primitive.
def angle_from other_point Geometry.angle_from self, other_point end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle_to other_point\n Geometry.angle_to self, other_point\n end", "def other_angle(a, b)\n 180 - (a + b)\nend", "def other_angle(a, b)\n 180 - (a + b)\nend", "def angle(other)\n\n # Two options here:\n #\n # 1. Math.atan2(other.cross_length(self), dot(other)) \n #\n ...
[ "0.7545739", "0.7384567", "0.7372221", "0.7313503", "0.7262168", "0.7184892", "0.71301836", "0.7107542", "0.70649385", "0.7044069", "0.6990309", "0.69445723", "0.6893734", "0.68116015", "0.6789178", "0.67859197", "0.6727259", "0.6716903", "0.6675718", "0.6672194", "0.6672194"...
0.7746496
0
GET /party_approvals or /party_approvals.json
def index @party_approvals = PartyApproval.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def approvals\n approvals_list = []\n if params[:count]\n if params[:skip]\n approvals_list = current_user.db_user.approval_approvers.order('created_at desc').offset(params[:skip].to_i).take(params[:count].to_i)\n else\n approvals_list = current_user.db_user.approval_approvers.order('...
[ "0.643207", "0.6275669", "0.592398", "0.5904591", "0.578622", "0.5747836", "0.5730095", "0.56563437", "0.56369066", "0.5601522", "0.55984646", "0.55951494", "0.55613357", "0.55613214", "0.5529902", "0.54554397", "0.5448509", "0.5426189", "0.54034215", "0.53918517", "0.5356828...
0.6605213
0
POST /party_approvals or /party_approvals.json
def create @party_approval = PartyApproval.new(party_approval_params) respond_to do |format| if @party_approval.save format.html { redirect_to @party_approval, notice: 'Party approval was successfully created.' } format.json { render :show, status: :created, location: @party_approval } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def party_approval_params\n params.require(:party_approval).permit(:user, :party, :approval)\n end", "def politician_approval_params\n params.require(:politician_approval).permit(:user, :party, :approval)\n end", "def set_party_approval\n @party_approval = PartyApproval.find(params[:id])\n end", ...
[ "0.69791937", "0.6520171", "0.6458408", "0.63690704", "0.6335551", "0.6312647", "0.62580043", "0.6023837", "0.5969117", "0.5886409", "0.58461154", "0.5826825", "0.58157295", "0.5810201", "0.578843", "0.57762676", "0.576642", "0.57582396", "0.5749369", "0.5747433", "0.572701",...
0.6896017
1
PATCH/PUT /party_approvals/1 or /party_approvals/1.json
def update respond_to do |format| if @party_approval.update(party_approval_params) format.html { redirect_to @party_approval, notice: 'Party approval was successfully updated.' } format.json { render :show, status: :ok, location: @party_approval } else format.html { render :edit,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_party_approval\n @party_approval = PartyApproval.find(params[:id])\n end", "def update\n respond_to do |format|\n if @political_party.update(political_party_params)\n format.html { redirect_to @political_party, notice: 'Political party was successfully updated.' }\n format.json ...
[ "0.6594875", "0.6508229", "0.64911336", "0.6352692", "0.6327853", "0.63191134", "0.62818646", "0.6247028", "0.6158167", "0.6094758", "0.6075864", "0.60524327", "0.6009123", "0.5998709", "0.598375", "0.59671915", "0.58947796", "0.5890873", "0.58388966", "0.58255935", "0.582113...
0.7152015
0
DELETE /party_approvals/1 or /party_approvals/1.json
def destroy @party_approval.destroy respond_to do |format| format.html { redirect_to party_approvals_url, notice: 'Party approval was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_approver\n\n # get the client\n @client = Client.find(params[:client_id])\n\n # get the contract\n @contract = Contract.find(params[:id])\n\n # find the approver\n @approver = User.find(params[:user_id])\n\n # double check use is an approver\n if @contract.is_approver?(@approver)...
[ "0.6725972", "0.6553308", "0.6502757", "0.65018857", "0.63829803", "0.6318106", "0.63008183", "0.621909", "0.61684126", "0.6152238", "0.6144509", "0.6131181", "0.6101823", "0.6059425", "0.60181546", "0.60181546", "0.6016522", "0.60050917", "0.6000904", "0.59897053", "0.598824...
0.6904088
0
POST /pro_asphalts POST /pro_asphalts.json
def create @pro_asphalt = ProAsphalt.new(pro_asphalt_params) respond_to do |format| if @pro_asphalt.save format.html { redirect_to pro_asphalts_path(@pro_asphalt), notice: 'Pro asphalt was successfully created.' } format.json { render :show, status: :created, location: @pro_asphalt } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @pro_asphalt_type = ProAsphaltType.new(pro_asphalt_type_params)\n\n respond_to do |format|\n if @pro_asphalt_type.save\n format.html { redirect_to @pro_asphalt_type, notice: 'Pro asphalt type was successfully created.' }\n format.json { render :show, status: :created, location...
[ "0.62469727", "0.6104164", "0.5992982", "0.5991333", "0.5924378", "0.5784002", "0.5672843", "0.56616414", "0.56147814", "0.5579136", "0.5576561", "0.5573956", "0.557165", "0.55567193", "0.5496198", "0.54859376", "0.54844826", "0.54456675", "0.5439304", "0.5392716", "0.5384893...
0.68560326
0
PATCH/PUT /pro_asphalts/1 PATCH/PUT /pro_asphalts/1.json
def update respond_to do |format| if @pro_asphalt.update(pro_asphalt_params) format.html { redirect_to pro_asphalts_path(@pro_asphalt), notice: 'Pro asphalt was successfully updated.' } format.json { render :show, status: :ok, location: @pro_asphalt } else format.html { render :e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => ...
[ "0.64197206", "0.6389722", "0.6289051", "0.62460405", "0.6230696", "0.622748", "0.62242496", "0.61871284", "0.6154919", "0.6154137", "0.61442643", "0.61331826", "0.6088461", "0.60534203", "0.60404587", "0.6039339", "0.6038272", "0.60241663", "0.60094815", "0.5997083", "0.5992...
0.6804847
0
DELETE /pro_asphalts/1 DELETE /pro_asphalts/1.json
def destroy @pro_asphalt.destroy respond_to do |format| format.html { redirect_to pro_asphalts_url, notice: 'Pro asphalt was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @healthpro.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @apuesta_detail = ApuestaDetail.find(params[:id])\n @apuesta_detail.destroy\n\n respond_to do |format|\n format.html ...
[ "0.7073675", "0.6944771", "0.69359535", "0.69125956", "0.6895646", "0.68633246", "0.68496364", "0.6821556", "0.6819525", "0.6805395", "0.6791739", "0.67755556", "0.67601293", "0.675454", "0.67471665", "0.67424715", "0.67424715", "0.67424715", "0.67424715", "0.6740911", "0.673...
0.71840423
0
Returns true if the current user is reviewing the other user
def reviewing?(other_user) reviewing.include?(other_user) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ever_reviewed_by?(user_id)\n\t\tself.reviews.any?{|review| review.user_id == user_id}\n\tend", "def is_resident_review?\n user_review = self.user \n if user_review != nil\n user_review = self.user\n if user_review.is_resident_of?(self.city)\n return true \n else\n return fa...
[ "0.75062317", "0.73316294", "0.729414", "0.71572375", "0.7104558", "0.7097598", "0.7087988", "0.707417", "0.70628905", "0.7010617", "0.69329786", "0.6839503", "0.68301105", "0.6784396", "0.678437", "0.67695665", "0.67623967", "0.67427266", "0.6731118", "0.6730113", "0.6712953...
0.8577895
0
PATCH/PUT /veiculo_motoristas/1 PATCH/PUT /veiculo_motoristas/1.json
def update respond_to do |format| if @veiculo_motorista.update(veiculo_motorista_params) format.html { redirect_to @veiculo_motorista, notice: 'Veiculo motorista was successfully updated.' } format.json { render :show, status: :ok, location: @veiculo_motorista } else format.html ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @motorista.update(motorista_params)\n format.html { redirect_to @motorista, notice: 'Motorista was successfully updated.' }\n format.json { render :show, status: :ok, location: @motorista }\n else\n format.html { render :edit }\n for...
[ "0.6697531", "0.64190316", "0.6380966", "0.63192177", "0.62720495", "0.61819303", "0.61576074", "0.61467355", "0.6096365", "0.6069864", "0.6065608", "0.60617673", "0.60515505", "0.6050087", "0.6042295", "0.60370535", "0.60250884", "0.6024544", "0.6024063", "0.6011435", "0.600...
0.6876356
0
DELETE /veiculo_motoristas/1 DELETE /veiculo_motoristas/1.json
def destroy @veiculo_motorista.destroy respond_to do |format| format.html { redirect_to veiculo_motoristas_url, notice: 'Veiculo motorista was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @motorista.destroy\n respond_to do |format|\n format.html { redirect_to motoristas_url, notice: 'Motorista was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @motoristum.destroy\n respond_to do |format|\n format.html { redir...
[ "0.7443823", "0.7443297", "0.72892845", "0.7154575", "0.71507543", "0.7120174", "0.71023834", "0.70814943", "0.70771194", "0.7076857", "0.7065652", "0.7059782", "0.70542973", "0.70409906", "0.7026376", "0.6993293", "0.69803995", "0.6974884", "0.69677144", "0.69633025", "0.694...
0.7515056
0
==== Parameters: +options+:: Hash of options ==== Options: +access_key_id+:: access key id +secret_access_key+:: secret access key +use_ssl+:: optional, defaults to false +debug+:: optional, defaults to false +timeout+:: optional, for Net::HTTP
def initialize(options = {}) @access_key_id = options[:access_key_id] @secret_access_key = options[:secret_access_key] @use_ssl = options[:use_ssl] || false @debug = options[:debug] @timeout = options[:timeout] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(options)\n @access_key_id = options[:access_key_id] or raise ArgumentError, \"No access key id given\"\n @secret_access_key = options[:secret_access_key] or raise ArgumentError, \"No secret access key given\"\n @use_ssl = options[:use_ssl]\n @timeout = options[:timeout]\n @d...
[ "0.72505903", "0.6038918", "0.583578", "0.57985514", "0.5779334", "0.5758519", "0.5720048", "0.5704394", "0.5670463", "0.564725", "0.56459254", "0.56380093", "0.5605419", "0.5554778", "0.55327874", "0.5530953", "0.552661", "0.5480762", "0.54777825", "0.54507196", "0.54481685"...
0.7309609
0
Create a new Redirect instance if the fields have been changed
def create_redirect_if_permalink_fields_changed former = send(self.class.permalink_field) current = PermalinkFu.escape(create_permalink_for(self.class.permalink_attributes)) attributes = {:model => self.class.name, :former_permalink => former, :current_permalink => current} if !former.nil? && f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_redirect_action\n if params[:redirect_from].strip.size == 0\n flash[:error] = \"Original URL cannot be empty\"\n return redirect_to \"/admin\"\n end\n if params[:redirect_to].strip.size == 0\n flash[:error] = \"New URL cannot be empty\"\n return redirect_to \"/admin\"\n e...
[ "0.6520001", "0.6351845", "0.6325829", "0.6309564", "0.62364286", "0.6219673", "0.6083324", "0.5975588", "0.5966061", "0.59267414", "0.57616824", "0.5713381", "0.5653719", "0.562784", "0.5589663", "0.55734503", "0.5546721", "0.54753965", "0.54564196", "0.54424274", "0.5435866...
0.7034233
0
Returns an empty or existing array of abilities
def abilities @abilities ||= {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abilities_to_register\n []\n end", "def abilities_to_register\n []\n end", "def abilities\n (read_attribute(:abilities) || '').split(' ')\n end", "def abilities\n @abilities ||= Six.new\n end", "def abilities\n get('/ability/')\n end", "def activated_abilities\n act...
[ "0.754501", "0.7383248", "0.7233026", "0.71824116", "0.6516052", "0.6487794", "0.6312706", "0.6312706", "0.6077586", "0.59423876", "0.593129", "0.59195054", "0.5914095", "0.5863681", "0.58461815", "0.5838893", "0.57735115", "0.57509035", "0.5732901", "0.5720581", "0.5701555",...
0.7582291
0
Registers a new Girlfriend ability Girlfriend.register_ability :talk do |girl| Girlfriend::Ability::Talk.new(girl) end
def register_ability(name, &block) abilities[name] = block end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize ability\n @ability = ability\n end", "def add_ability(func_name, timeout=nil, &block)\n @abilities[func_name] = Ability.new(func_name, block, timeout)\n @connection_pool.with_all_connections do |connection|\n announce_ability(func_name, timeout, connection)\n end\n ...
[ "0.5804026", "0.573823", "0.57246786", "0.5690421", "0.5690421", "0.5690421", "0.5690421", "0.5690421", "0.56817305", "0.56157243", "0.56028426", "0.5547905", "0.5520074", "0.54803413", "0.5477103", "0.5406545", "0.534792", "0.530494", "0.52957565", "0.52653575", "0.52394325"...
0.64486384
0
Returns TRUE if the given ability exists, otherwise FALSE
def can?(name) abilities.include? name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ability?\n self.__ability.present?\n end", "def has_achievement?(name)\n achievements.exists?(name: name)\n end", "def exist?\n @access.exist?\n end", "def exist?\n @access.exist?\n end", "def _has_capability?(capability)\n allow = nil\n deny = nil\n\n roles.each do...
[ "0.79016674", "0.67917013", "0.6772654", "0.6772654", "0.65737516", "0.6456097", "0.6439611", "0.6417155", "0.6400718", "0.6366617", "0.63634366", "0.6350886", "0.6326208", "0.6317813", "0.62612975", "0.62588996", "0.62570196", "0.6228", "0.6219924", "0.62103456", "0.61864394...
0.74174196
1
Interact with Girlfriend name name of an ability input text input (default: '') if name is :interactive then it enters interactive mode, otherwise executes and returns immediately Returns the result of the interaction.
def interact?(name, input='') if name == :interactive interactive(input) else if can? name ability = abilities[name].call(self) ability.try? name, input else reply end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_user_name\n puts \"Please enter your name: \"\n name = gets.chomp\n end", "def interactive(input)\n\t\t\tputs 'Say hi to ' + name + ' now or type `leave` to stop talking to her!'\n\n\t\t\twhile true\n\t\t\t\tprint 'Dude > '\n\t\t\t\tinput = gets.chomp\n\t\t\n\t\t\t\tif input == 'leave'\n\t\t\t...
[ "0.62065065", "0.619596", "0.60996425", "0.6053882", "0.6030305", "0.6001681", "0.59616333", "0.5952143", "0.5950341", "0.5864927", "0.58646375", "0.5850955", "0.5843785", "0.58253497", "0.57997364", "0.5794855", "0.5770388", "0.5741676", "0.5725465", "0.5716886", "0.5714298"...
0.7485019
0
POST /api/bikes/reserve/:id Dont let a user reserve a bike unless they have a payment method added and are in good standing Expected params: XApiKey: api_key
def reserve # Start Ride return render json: { error: "This bike is not available to reserve" }, status: :forbidden unless @bike.available? begin ActiveRecord::Base.transaction do @bike.current_ride = Ride.build_from_user_bike(@user, @bike) @bike.reserved! case params[:payment_type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bike_params\n params.require(:bike).permit(:bike_index_uid, :user_id)\n end", "def set_bike\n @bike = Bike.find(params[:id])\n authorize @bike\n end", "def bike_params\n params.require(:bike).permit(:bikeid, :serialnumber, :rating, :condition, :maintenance, :style, :size, :color, ...
[ "0.6272552", "0.61437535", "0.61261225", "0.6092075", "0.5988227", "0.5956369", "0.5892189", "0.5867415", "0.5867415", "0.5867415", "0.5823128", "0.58165795", "0.57885647", "0.57801604", "0.5774022", "0.575455", "0.57489383", "0.57458764", "0.57410276", "0.57336164", "0.57207...
0.62075686
1
return view page create a slide
def create @mode = 'I' render 'admin/slides/slide' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @page_slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page_slide }\n end\n end", "def show\n @slides =@lecture.slides(params[:urlpage])\n \n end", "def show\n @contents = @slide.contents\n end", "def show\n se...
[ "0.69299203", "0.6904884", "0.6800734", "0.67499614", "0.6744819", "0.667199", "0.6669424", "0.66220504", "0.66192925", "0.6611391", "0.6611391", "0.66070235", "0.65402", "0.65184635", "0.6500471", "0.6487202", "0.6487202", "0.6487202", "0.64664435", "0.64406675", "0.64167476...
0.75595266
0
return view page edit a slide
def edit @data = SlidesHlp.getSlide(params[:id]) if @data['slide_vi'] == nil @mode = 'I' else @slide = @data['slide_vi'] @slide_ja = @data['slide_ja'] @lang = @data['lang'] @mode = 'U' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_slide\n @slide = @presentation.slides.friendly.find(params[:id]) \n end", "def set_slide\n @slide = Slide.nondraft.find(params[:id])\n end", "def set_slide\n @slide = Slide.find(params[:id])\n end", "def create\n @mode = 'I'\n render 'admin/slides/slide'...
[ "0.72954106", "0.7116887", "0.71042323", "0.7039532", "0.69894713", "0.6987289", "0.6987289", "0.6987289", "0.6987289", "0.6987289", "0.69081426", "0.68734515", "0.6873193", "0.68410283", "0.6732529", "0.6664729", "0.66635966", "0.65734047", "0.6557006", "0.6555633", "0.65448...
0.77079725
0
update data translate of slide
def updateSlideTrans result = Hash.new result['status'] = true begin # try if !SlidesHlp.updateSlideTrans(params[:slide]) result['status'] = false end rescue # catch result['status'] = false ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def migrate(data)\n keys = I18n::Translate.hash_to_keys(data, @translate.options[:separator])\n keys.each do |key|\n entry = I18n::Translate.find(key, data, @translate.options[:separator])\n next unless I18n::Translate.is_enhanced?(entry)\n %w(old t).each do |prop|\n ...
[ "0.600775", "0.6000597", "0.58729243", "0.5831652", "0.5821957", "0.57016015", "0.569445", "0.5568196", "0.5447744", "0.5447744", "0.54306793", "0.5430647", "0.5430561", "0.54159015", "0.5387675", "0.53738725", "0.536614", "0.53024817", "0.52914494", "0.5286722", "0.5283436",...
0.60674554
0
update show status of slide
def updateShowSlide result = Hash.new result['status'] = true begin # try result['status'] = Slide.where(id: params[:id]) .update_all('slides.show = NOT slides.show, updated_by = ' + $user_id.to_s + ', updated_at = \''...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show; @showing = false; end", "def show_slide\n @slide = @slideshow.slides[session[:slide_index]]\n session[:slide_index] += 1\n if @slide.nil?\n session[:slide_index] = 0\n @slide = @slideshow.slides[0]\n end\n render partial: \"show_slides\"\n end", "def show_slide\n @slidesh...
[ "0.6542944", "0.64448625", "0.6404435", "0.6346779", "0.62538993", "0.60797113", "0.60591894", "0.60416937", "0.59968007", "0.59854925", "0.5942338", "0.5942338", "0.59081703", "0.5873936", "0.5863659", "0.58616453", "0.5834114", "0.5834114", "0.5834114", "0.5834114", "0.5834...
0.7222382
0
Initialize CWLSLas object passing las file as argument Example: >> my_well = CWLSLas.new('my_well.las') => Arguments: las_file_name: (String) file_options: (Hash) options: encoding
def initialize(filename=nil, file_options={}) load_file(filename, file_options) if not filename.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(file_or_path, options = {})\n data = file_or_path.read if file_or_path.respond_to?(:read)\n data ||= File.read file_or_path\n\n @keystore = options[:keystore]\n\n init(data)\n end", "def initialize(options)\n options.each { |k, v| self.send :\"#{k}=\", v }\n self.file ...
[ "0.61706287", "0.6159244", "0.6005976", "0.59396875", "0.588578", "0.588578", "0.5879552", "0.5879552", "0.5879552", "0.5865736", "0.5858681", "0.58512884", "0.58512884", "0.58512884", "0.5815233", "0.58008766", "0.5799979", "0.576145", "0.576145", "0.576145", "0.57358986", ...
0.6415842
0
Return a list of mnemonics representing the curve names Example: >> my_well = CWLSLas.new('my_well.las') => >> my_well.curve_names => ["ILD", "ILM", "DT", "NPHI", "RHOB", "SFLA", "SFLU", "DEPT"]
def curve_names self.curves.keys end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def names\n @mplab_pin.names\n end", "def standarized_coeffs\n assign_names(@coeffs_stan)\n end", "def curve(curve_name)\n self.curves[curve_name]\n end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", ...
[ "0.55047166", "0.5396108", "0.5383436", "0.53287905", "0.53287905", "0.53287905", "0.53287905", "0.53287905", "0.53287905", "0.53287905", "0.5303541", "0.52750933", "0.5259933", "0.52515334", "0.52482504", "0.52275157", "0.5216438", "0.5197078", "0.51948726", "0.51739776", "0...
0.7154525
0
Returns an object representing the curve selected Example: >> my_well = CWLSLas.new('my_well.las') => >> my_well.curve('ILD')
def curve(curve_name) self.curves[curve_name] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def curve\n end", "def curve\n end", "def add_curve(*args)\n end", "def curve(base)\n if base.respond_to?(:to_curve) && base.length == Fever::FRAMES\n return base.to_curve\n end\n\n case base\n when Numeric then curve_from_numeric(base)\n when Enumerable then curve_from_enum(base)\n ...
[ "0.66901845", "0.66901845", "0.6249164", "0.61700153", "0.6108652", "0.61054754", "0.6104347", "0.59153837", "0.59153837", "0.58253616", "0.5818646", "0.5791126", "0.56843776", "0.5656987", "0.5641351", "0.56204563", "0.55703455", "0.55378777", "0.5532485", "0.5500147", "0.54...
0.7155257
0
Returns the company name tha owns the well Example: >> my_well = CWLSLas.new('my_well.las') => >> my_well.company_name => "ANY OIL COMPANY LTD."
def company_name self.well_info.company_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def company_name\t\t\t# Getter method - return nil if name is not found\n\t\tcompany.try(:name)\n\tend", "def company_name\n @company_name\n end", "def company_name\n object.company.name\n end", "def company_name\n @company_name\n end", "def name\n latest_ccla_signature.company\n end"...
[ "0.7688148", "0.7644459", "0.7523862", "0.74599236", "0.73722374", "0.733742", "0.7231664", "0.71790296", "0.7172417", "0.71318823", "0.7102993", "0.7085619", "0.6997876", "0.6976442", "0.6913566", "0.68805295", "0.68650687", "0.683369", "0.683369", "0.6803127", "0.6766914", ...
0.7886307
0
Returns the province described in the file Example: >> my_well = CWLSLas.new('my_well.las') => >> my_well.province => "RIO DE JANEIRO"
def province self.well_info.province end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def province\n ::Province.find_by(contabilium_id: self.IdProvincia)\n end", "def province\n sale.province\n end", "def province\n self.municipality.province\n end", "def find_province_terrain(province_data)\n v = province_data[3]\n v = \"urban\" if urban_province_types.include?(v)\n # v ...
[ "0.6514513", "0.62548363", "0.6029765", "0.5938827", "0.5837015", "0.5730205", "0.5709851", "0.5691844", "0.5570934", "0.551172", "0.54329526", "0.54239106", "0.53504586", "0.5322867", "0.5319085", "0.5305472", "0.53042424", "0.52975625", "0.52730817", "0.5267117", "0.5264360...
0.64560485
1
Returns the service company that performed the log acquisition Example: >> my_well = CWLSLas.new('my_well.las') => >> my_well.service_company => "ANY LOGGING COMPANY LTD."
def service_company self.well_info.service_company end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def company\n @company ||= research_param(:company) || company_list.first\n end", "def name\n latest_ccla_signature.company\n end", "def company_name\n self.dig_for_string(\"agentSummary\", \"office\", \"companyName\")\n end", "def getcompany\n Company.company_than(need_calc_company)\n ...
[ "0.6822279", "0.6714972", "0.67119133", "0.67011994", "0.6520701", "0.643856", "0.64375067", "0.639938", "0.6284502", "0.6275567", "0.6275199", "0.62654847", "0.62477225", "0.61418927", "0.61036944", "0.6094983", "0.6093869", "0.603673", "0.60061926", "0.59661937", "0.5949760...
0.73509735
0
Returns the API () described in the file Example: >> my_well = CWLSLas.new('my_well.las') => >> my_well.api => "1513120205"
def api self.well_info.api end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api(path)\n OodAppkit.files.api(path: path).to_s\n end", "def api\n @api\n end", "def api_base_path\n \"/lol/platform/#{api_version}\"\n end", "def api_name\n to_s.split('::').last.gsub(/[^\\A]([A-Z])/, '_\\\\1').downcase\n end", "def get_api_version\n :v201502\n end", ...
[ "0.6092216", "0.60680616", "0.6053059", "0.604105", "0.59798735", "0.5959112", "0.5939222", "0.58953714", "0.58548737", "0.5849631", "0.57478416", "0.5705776", "0.57041574", "0.5689066", "0.5661654", "0.56575954", "0.5617997", "0.56079394", "0.56039745", "0.55859435", "0.5556...
0.6546905
0
Returns the UWI (UNIQUE WELL ID) described in the file Returns API if UWI not found (for locations outside Canada) Example: >> my_well = CWLSLas.new('my_well.las') => >> my_well.uwi => "100091604920W300"
def uwi self.well_info.uwi || self.well_info.api end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name_of_uvhw(well)\n plate, r, c = find_uvhw(well)\n return \"Well #{plate.id}(#{'ABCD'[r]}#{c+1})\"\n end", "def wpi\n data[:wpi]\n end", "def get_WOEID()\n \t return @outputs[\"WOEID\"]\n \tend", "def get_WOEID()\n \t return @outputs[\"WOEID\"]\n \tend", "def wiki...
[ "0.58519405", "0.55437887", "0.5113649", "0.5113649", "0.5034688", "0.50089514", "0.49868485", "0.49679846", "0.4937397", "0.4928996", "0.48776057", "0.48640478", "0.48640436", "0.4858467", "0.48494008", "0.48494008", "0.48388565", "0.47967997", "0.4796675", "0.47878236", "0....
0.7319451
0
Returns the county described in the file Example: >> my_well = CWLSLas.new('my_well.las') => >> my_well.county => "KENAI"
def county self.well_info.county end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def business_county\n business_location.county if business_location.present?\n end", "def decode_county\n\t#\tcase county_code.to_s.slice(-2,2)\n\t#\twhat if '01' or '1' or 1 or '12341234123401'\n\t\tcase sprintf('%02d',self.to_i).to_s.slice(-2,2).to_i\n\t#\t\twhen 0 then the given state code was all text\n\...
[ "0.6126817", "0.5840096", "0.5806407", "0.57190007", "0.5713216", "0.56970817", "0.56970817", "0.56970817", "0.5654555", "0.5235436", "0.51854503", "0.5128856", "0.50996417", "0.50856274", "0.5079576", "0.49857908", "0.49810976", "0.49487928", "0.49149308", "0.49089268", "0.4...
0.6615666
0
if eresource put catalog link in coverage else put in url field.
def generate_rdf_catlink(b,ty) ul = "http://catalog.library.cornell.edu/catalog/#{id}" # if no elect access data, 'description' field. b.dc(:description,ul) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def catalog_generator(bib)\n QuickSearch::Engine::WORLD_CAT_DISCOVERY_API_ARTICLE_CONFIG['url_link'] +\n bib.oclc_number.to_s\n end", "def ajax_catalog_link_and_source\n instance_id = params['instanceId']\n url = ENV['OKAPI_URL']\n tenant = ENV['OKAPI_TENANT']\n # Get instance ...
[ "0.55972606", "0.55344504", "0.55250597", "0.5484369", "0.54650277", "0.54366934", "0.53981376", "0.53907686", "0.5372756", "0.53431016", "0.5312575", "0.5293552", "0.5248956", "0.52340806", "0.5197136", "0.5188058", "0.5169922", "0.51620907", "0.5158144", "0.51543087", "0.51...
0.55700177
1
Returns all repos as pythonlike generators
def all_repos_as_generator Enumerator.new do |enum| each do |repo| enum.yield repo end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repos\n pry(Git::Multi.repositories)\nend", "def all\n return @raw_repos unless @raw_repos.empty?\n return [Template.root.basename.to_s] if Template.project?\n Template.root.join(Meta.new({}).repos_dir).children.map do |path|\n path.basename.to_s\n end\n\n rescue Er...
[ "0.6886352", "0.6706091", "0.6547711", "0.6488232", "0.64740634", "0.64513975", "0.6448159", "0.64425504", "0.6407408", "0.6400587", "0.6387641", "0.6384363", "0.63795084", "0.63451135", "0.63272053", "0.63034374", "0.6265424", "0.6264255", "0.62005675", "0.61952955", "0.6194...
0.81309724
1
DELETE /feed_entries/1 DELETE /feed_entries/1.json
def destroy @feed_entry = FeedEntry.find(params[:id]) @feed_entry.destroy respond_to do |format| format.html { redirect_to feed_entries_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @entry = Entry.find(params[:id])\n @feed = @entry.feed\n @entry.destroy\n\n respond_to do |format|\n format.html { redirect_to feed_path(@feed) }\n format.json { head :no_content }\n end\n end", "def destroy\n @feedentry = Feedentry.find(params[:id])\n @feedentry.des...
[ "0.7675228", "0.7567747", "0.7458496", "0.7410145", "0.7379684", "0.7348866", "0.7295838", "0.7239369", "0.7239369", "0.72324055", "0.7209484", "0.72024554", "0.72024554", "0.72024554", "0.71721816", "0.7163158", "0.7163158", "0.7163158", "0.7163036", "0.7148303", "0.714283",...
0.76343584
1
add screener to playlist
def add_screener @screener_playlist = ScreenerPlaylist.find(params[:id]) @screener_playlist_item_position = ScreenerPlaylistItem.where("screener_playlist_id=?", params[:id]) .order("position ASC") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_queue(playlist)\n @queue << playlist\n if @current_playlist.nil? \n @current_playlist = @queue.shift\n play @current_playlist\n end\n end", "def add_to_playlist(media)\n connection.write(\"enqueue #{media(media)}\")\n end", "def add_to_playlist(media)\n connect...
[ "0.6616027", "0.64913815", "0.64092594", "0.638075", "0.6302139", "0.6292513", "0.62877065", "0.6255536", "0.62553316", "0.62321717", "0.6228287", "0.6226817", "0.6194212", "0.6181943", "0.61334336", "0.6117756", "0.6101854", "0.6098525", "0.6084723", "0.60626733", "0.6057634...
0.67087215
0
DELETE /extractions_extraction_forms_projects_sections_type1/1 DELETE /extractions_extraction_forms_projects_sections_type1/1.json
def destroy @extractions_extraction_forms_projects_sections_type1.destroy respond_to do |format| format.html do redirect_to work_extraction_path(@extractions_extraction_forms_projects_sections_type1 .extractions_extraction_forms_projects_secti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @extractions_extraction_forms_projects_sections_type1.destroy\n respond_to do |format|\n format.html { redirect_to work_extraction_path(@extractions_extraction_forms_projects_sections_type1\n .extractions_extraction_forms_projects_secti...
[ "0.7626632", "0.6354295", "0.63228387", "0.63028866", "0.62969583", "0.6292912", "0.62236863", "0.62202066", "0.62114114", "0.61981344", "0.6196551", "0.61782646", "0.6177106", "0.6175349", "0.6148747", "0.6143146", "0.61424005", "0.6111107", "0.61093783", "0.6106999", "0.610...
0.76073885
1
POST /extractions_extraction_forms_projects_sections_type1s/1/add_population POST /extractions_extraction_forms_projects_sections_type1s/1/add_population.json
def add_population authorize(@extractions_extraction_forms_projects_sections_type1) @extractions_extraction_forms_projects_sections_type1.extractions_extraction_forms_projects_sections_type1_rows.each do |eefpst1r| eefpst1r.extractions_extraction_forms_projects_sections_type1_row_columns.create end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_population\n @extractions_extraction_forms_projects_sections_type1.extractions_extraction_forms_projects_sections_type1_rows.each do |eefpst1r|\n eefpst1r.extractions_extraction_forms_projects_sections_type1_row_columns.create\n end\n\n redirect_to edit_populations_extractions_extraction_form...
[ "0.7874224", "0.6710033", "0.6270805", "0.6023102", "0.55719763", "0.55287224", "0.55287224", "0.5522431", "0.54312444", "0.53367424", "0.5334908", "0.52677965", "0.51416105", "0.5138206", "0.50998086", "0.5098964", "0.5084003", "0.5073172", "0.50245917", "0.50188595", "0.501...
0.8248006
0
Set a random variate as the arrival rate.
def with_arrival_rate(species, *args) @arrival_rate = RandomVariate.send(species, *args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_rand()\n rdm = Random.new()\n @step = rdm.rand(1..10) * 100\n @rate = rdm.rand(1.2..3.0) \n end", "def random= rnd\n @sampling.random = rnd\n end", "def random= rnd \n @random = rnd\n @codon.random = rnd\n end", "def random= rnd \n @random = rnd\n @codon.rando...
[ "0.7482969", "0.6874706", "0.6385189", "0.6385189", "0.6219564", "0.5987749", "0.59391564", "0.5915967", "0.58853525", "0.5838061", "0.5833849", "0.5826422", "0.5779618", "0.57551825", "0.57127553", "0.5711869", "0.57027256", "0.56578696", "0.56396675", "0.5619194", "0.560149...
0.76901466
0
Have an item arrive from the population.
def arrive! raise(DSQ::PopulationError, "You can not produce an arrival while the Population is waiting.", caller) if waiting? @waiting = true return Item.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pick_up(item)\n @items.push(item) unless items_weight + item.weight > CAPACITY\n @equipped_weapon = item if item.is_a?(Weapon) \n if item.is_a?(BoxOfBolts) \n item.feed(self) if self.health <= 80\n end\n end", "def pick_up(item)\n return false if items_weight + item.weight > MAX_WEIGHT\...
[ "0.64498615", "0.6302443", "0.6135156", "0.6074962", "0.60643816", "0.6026765", "0.5939954", "0.5905071", "0.58802426", "0.58473086", "0.56653774", "0.56487507", "0.5631647", "0.5574348", "0.5568417", "0.554843", "0.55342615", "0.5510227", "0.5491626", "0.54584455", "0.545451...
0.7662382
0
Send an email after the app has been redeployed
def redeploy setup_email @@to_emails @subject = "[#{Rails.env.titleize}] BestDebates redeployed (#{Time.now.to_s})" @body = @subject end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_email(email)\n email.deliver_now\n end", "def email_notification\n return unless app.emailable? && should_email?\n Mailer.err_notification(self).deliver_now\n rescue => e\n HoptoadNotifier.notify(e)\n end", "def notify\n @greeting = \"Just a test\"\n mail(to: \"cneumann@marsmo...
[ "0.69222033", "0.69193697", "0.6883864", "0.67806935", "0.6772746", "0.67186886", "0.6695353", "0.6639254", "0.66225237", "0.6608702", "0.65947366", "0.65700966", "0.6558848", "0.6553054", "0.65474105", "0.6541321", "0.6539925", "0.6535232", "0.65346843", "0.6533135", "0.6517...
0.815746
0
GET /setquestionlinks GET /setquestionlinks.json
def index @setquestionlinks = Setquestionlink.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_setquestionlink\n @setquestionlink = Setquestionlink.find(params[:id])\n end", "def setquestionlink_params\n params.require(:setquestionlink).permit(:set_id, :question_id, :follower_id)\n end", "def questions\n self.class.get(\"/2.2/questions\", @options)\n end", "def linking\n ...
[ "0.69735473", "0.6266377", "0.6213912", "0.602999", "0.5992899", "0.59813577", "0.59813577", "0.59813577", "0.58711857", "0.5832766", "0.58084995", "0.57767934", "0.5749406", "0.57004195", "0.55756235", "0.55699885", "0.55546534", "0.55438536", "0.5517849", "0.5510561", "0.55...
0.70140237
0
PATCH/PUT /setquestionlinks/1 PATCH/PUT /setquestionlinks/1.json
def update respond_to do |format| if @setquestionlink.update(setquestionlink_params) format.html { redirect_to @setquestionlink, notice: 'Setquestionlink was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @question.update(question_params)\n @question_link = QuizQuestion.find_by_id(@question.questionid)\n @question_link.update(:points => params[:points])\n @quiz = Quiz.find_by_id(@question_link.quizid)\n format.html { redirect_to admin_quiz...
[ "0.650731", "0.64011365", "0.6293118", "0.6172139", "0.6054418", "0.59332246", "0.58732957", "0.5834798", "0.58216316", "0.5812505", "0.579367", "0.5769157", "0.576753", "0.574778", "0.5744626", "0.5710741", "0.5659557", "0.56441414", "0.56336343", "0.56285787", "0.5614193", ...
0.69223136
0
DELETE /setquestionlinks/1 DELETE /setquestionlinks/1.json
def destroy @setquestionlink.destroy respond_to do |format| format.html { redirect_to setquestionlinks_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @questionset = Questionset.find(params[:id])\n @questionset.destroy\n\n respond_to do |format|\n format.html { redirect_to questionsets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @question_link = QuizQuestion.find_by_id(@question.questionid)\n ...
[ "0.6963999", "0.6888334", "0.68757546", "0.6780139", "0.67669904", "0.67380655", "0.6661244", "0.6661244", "0.6659347", "0.6642675", "0.6605192", "0.66041017", "0.6569903", "0.65624434", "0.65621936", "0.65567404", "0.6549401", "0.65439034", "0.6537834", "0.65244365", "0.6522...
0.77665687
0