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
DELETE /certifieds/1 DELETE /certifieds/1.json
def destroy @certified.destroy respond_to do |format| format.html { redirect_to certifieds_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @cert.destroy\n respond_to do |format|\n format.html { redirect_to certs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cert.destroy\n respond_to do |format|\n format.html { redirect_to certs_url, notice: 'Cert was successfully destroyed.' }\n ...
[ "0.7595877", "0.741068", "0.73887163", "0.7270093", "0.7259015", "0.7259015", "0.71330494", "0.7105309", "0.7025883", "0.7000783", "0.6947421", "0.6929092", "0.6903883", "0.6903883", "0.6903883", "0.68865", "0.6877033", "0.6791788", "0.67452013", "0.6692637", "0.6690766", "...
0.79015255
0
display all current user computers
def list user = User.find(current_user.id) @computers = user.computer.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n if signed_in?\n @computers = current_user.computers.all.decorate\n @computer = current_user.computers.new\n end\n end", "def list_current_user\n abort \"You have no current user set!\".yellow unless current_user_exists?\n puts \"\\nCurrent User\"\n config.current_user....
[ "0.6756206", "0.6462351", "0.6424491", "0.63315994", "0.62772167", "0.62321085", "0.6181889", "0.6097736", "0.6088224", "0.60542756", "0.60407895", "0.5988704", "0.5986329", "0.5938417", "0.59100336", "0.5893264", "0.5864887", "0.5836878", "0.5789722", "0.5788966", "0.5776196...
0.83014435
0
simulate the P2P network i starting origins n peers tr array of [t, r]
def simulate i, n, tr unless tr[0].is_a?(Numeric) && tr[1].is_a?(Numeric) require 'pry' binding.pry end er = tr[0].to_f / (n-2) ps = i.to_f / n data = {prior_s: ps, prob_ex: er, total_queries: 0, kdist: []} # every peer (other than origins) might get to do a direct query and/or get extra responses...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate i, n, t\n er = t.to_f / (n-2)\n ps = i.to_f / n\n data = {prior_s: ps, prob_ex: er, total_queries: 0, kdist: []}\n\n # every peer (other than origins) might get to do a direct query and/or get extra responses\n know = Array.new(n - i) { false }\n data[:responses] = []\n\n k = i\n j = 0\n whil...
[ "0.62776434", "0.56342787", "0.55337226", "0.54760855", "0.5253529", "0.5198142", "0.517477", "0.5146634", "0.5137675", "0.5136337", "0.5064142", "0.50373375", "0.4990826", "0.49727556", "0.49395207", "0.49336106", "0.48921725", "0.4889871", "0.4880847", "0.48753926", "0.4868...
0.67510366
0
GET /drawings/1 GET /drawings/1.json
def show @drawing = Drawing.find(params[:id]) render json: @drawing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @drawings = Drawing.all\n end", "def index\n @draws = Draw.paginate(:page => params[:page], :per_page => 50)\n @winning_draws = Draw.where(:selection => \"WINNER\")\n @draw = Draw.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dra...
[ "0.71373606", "0.7108541", "0.7031232", "0.6586291", "0.6414555", "0.63620937", "0.62450653", "0.60835487", "0.60278845", "0.6012221", "0.5936713", "0.5911544", "0.58977276", "0.58437717", "0.5809068", "0.5800402", "0.5795278", "0.5788694", "0.5782666", "0.5779801", "0.574471...
0.74483734
0
GET /drawings/new GET /drawings/new.json
def new @drawing = Drawing.new render json: @drawing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @draw = Draw.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @draw }\n end\n end", "def new\n @withdrawal = Withdrawal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @withdrawal }\n ...
[ "0.75208336", "0.6978218", "0.69780195", "0.6862454", "0.68167627", "0.6771684", "0.6691346", "0.6449592", "0.6449592", "0.639493", "0.6382087", "0.636552", "0.63246375", "0.63104844", "0.63050336", "0.6297263", "0.62531143", "0.62492716", "0.6231992", "0.61975193", "0.618364...
0.7591941
0
POST /drawings POST /drawings.json
def create @drawing = Drawing.new(params[:drawing]) if @drawing.save render json: @drawing, status: :created, location: @drawing else render json: @drawing.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @drawing = Drawing.new(drawing_params)\n\n respond_to do |format|\n if @drawing.save\n format.html { redirect_to @drawing, notice: 'Drawing was successfully created.' }\n format.json { render :show, status: :created, location: @drawing }\n else\n format.html { rend...
[ "0.6910724", "0.6687737", "0.6657411", "0.64601356", "0.6385349", "0.62101865", "0.6162789", "0.60166717", "0.5957114", "0.59391785", "0.59104735", "0.58873063", "0.58715785", "0.58024114", "0.5800152", "0.56954676", "0.5686099", "0.56544584", "0.56416744", "0.5616906", "0.55...
0.7109006
0
PATCH/PUT /drawings/1 PATCH/PUT /drawings/1.json
def update @drawing = Drawing.find(params[:id]) if @drawing.update_attributes(params[:drawing]) head :no_content else render json: @drawing.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @draw = Draw.find(params[:id])\n\n respond_to do |format|\n if @draw.update_attributes(params[:draw])\n format.html { redirect_to @draw, notice: 'Draw was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n...
[ "0.7125346", "0.711631", "0.70599157", "0.7040108", "0.6485048", "0.6449785", "0.63194305", "0.611239", "0.608619", "0.60325533", "0.59873444", "0.5968558", "0.59627676", "0.59383816", "0.5936856", "0.59348726", "0.59338003", "0.5921413", "0.59095186", "0.588861", "0.586535",...
0.73792917
0
Resolves the given relative path of file in repository into canonical path based on the specified base_path. Examples: File in the same directory as the current path resolve_relative_path("users.adoc", "doc/api/README.adoc") => "doc/api/users.adoc" File in the same directory, which is also the current path resolve_rela...
def resolve_relative_path(path, base_path) p = Pathname(base_path) p = p.dirname unless p.extname.empty? p += path p.cleanpath.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resolvePath(possiblyRelativePath, rootDir)\n\t\tpath = Pathname.new(possiblyRelativePath)\n\t\tif(path.absolute?()) then\n\t\t\treturn path.to_s()\n\t\telse\n\t\t\trootPath = Pathname.new(rootDir)\n\t\t\treturn rootPath.join(path)\n\t\tend\n\tend", "def getFullPath(relativePath)\n return baseDir + relat...
[ "0.67939013", "0.66590774", "0.65517515", "0.6457611", "0.63275474", "0.6311323", "0.6311323", "0.6248949", "0.62245446", "0.62243205", "0.62130475", "0.617739", "0.61402327", "0.60703576", "0.60664487", "0.60357606", "0.6007003", "0.5976108", "0.5955329", "0.59388083", "0.59...
0.78591824
0
Generalized tick fetch. If the block is used, the arrays will be retured in chunks, which should be accumulated. This is to eliminate the problem of passing large arrays across DRb.
def fetchTicks(symbol, days=nil, startTime=nil, endTime=nil, eos=true, &block) brokerFetchTicks(symbol, days, startTime, endTime, eos, &block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch!\n fetch0(Array, true)\n end", "def fetch\n fetch0(Array, false)\n end", "def loop(num_ticks, tick_time)\n @tick_time = tick_time\n \n (0..num_ticks).each do |tick|\n time = java.lang.System.currentTimeMillis\n\n @tick = tick\n yield tick\n\n sleep_time = ...
[ "0.50891334", "0.49669623", "0.49631178", "0.4961839", "0.490971", "0.490971", "0.490971", "0.4906705", "0.48321116", "0.48271874", "0.47950685", "0.47831956", "0.47815818", "0.47815818", "0.47524658", "0.4751764", "0.47227207", "0.4715458", "0.46931627", "0.4640604", "0.4640...
0.50351614
1
Returns HTML with all authors of an article
def display_article_authors(article, with_info=false) authors = article.authors.map{|author| author.gplus_profile.blank? ? author.name : link_to(author.name, author.gplus_profile)}.to_sentence(two_words_connector: " & ", last_word_connector: " & ").html_safe if with_info authors += (" — " + article....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_all_article_titles_with_authors\n @all = all_article_titles_with_authors\n @all.each do |title, author|\n puts \"#{author} - #{title}\"\n end\n return @all\n end", "def authors\n document.search(\"[@id='bookAuthors']/[@itemprop='author']/a/span\").map { |elem| elem.innerHTML.strip...
[ "0.7708442", "0.7538625", "0.7473535", "0.7401987", "0.73058116", "0.71103686", "0.7078655", "0.7023631", "0.6996439", "0.6994805", "0.6988791", "0.69733304", "0.69548464", "0.69210076", "0.6910337", "0.68971044", "0.6881655", "0.68402195", "0.67442596", "0.6728819", "0.66628...
0.77495617
0
POST /cyclists POST /cyclists.json
def create @cyclist = Cyclist.new(cyclist_params) @cyclist.shift_id = params["shift"]["id"] respond_to do |format| if @cyclist.save format.html { redirect_to "/shifts/#{params['shift']['id']}", notice: "Cyclist data was successfully submitted at #{Time.now.localtime.strftime("%a, %b %d %Y, %I...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @cyclist = Cyclist.new(params[:cyclist])\n\n respond_to do |format|\n if @cyclist.save\n format.html { redirect_to @cyclist, notice: 'Cyclist was successfully created.' }\n format.json { render json: @cyclist, status: :created, location: @cyclist }\n else\n format....
[ "0.7611551", "0.6480665", "0.6416619", "0.61685336", "0.6167848", "0.61156625", "0.58950394", "0.5883342", "0.5850696", "0.57932186", "0.57357115", "0.5664974", "0.5620122", "0.55992705", "0.55777174", "0.55715436", "0.5565492", "0.55392015", "0.5537278", "0.5516368", "0.5485...
0.67147046
1
GET /high_schools GET /high_schools.json
def index @high_schools = HighSchool.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @user = User.find(session[:user_id])\n @schools = @user.schools\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schools }\n end\n end", "def show\n\t\trecords = University.where(['name LIKE ?', \"#{params[:name]}%\"])\n\t\tschools = Array.n...
[ "0.7190601", "0.7041431", "0.6871373", "0.6644633", "0.653639", "0.64757884", "0.6472032", "0.6472032", "0.6472032", "0.6472032", "0.6472032", "0.6472032", "0.6472032", "0.64653105", "0.6441137", "0.638774", "0.63849664", "0.6382589", "0.63516265", "0.63516265", "0.6349064", ...
0.741594
1
POST /high_schools POST /high_schools.json
def create @high_school = HighSchool.new(high_school_params) respond_to do |format| if @high_school.save format.html { redirect_to @high_school, notice: 'High school was successfully created.' } format.json { render :show, status: :created, location: @high_school } else form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def high_school_params\n params.require(:high_school).permit(:city, :state, :name, :uid, :county)\n end", "def create\n @school = School.new(school_params)\n respond_to do |format|\n if @school.save\n format.html { redirect_to schools_path }\n format.json { render :show, status: ...
[ "0.66235936", "0.64127934", "0.63907987", "0.63736504", "0.6356734", "0.6312544", "0.63091415", "0.63091415", "0.63091415", "0.6308481", "0.62944937", "0.6293078", "0.6271033", "0.6243532", "0.6243532", "0.6225897", "0.6220088", "0.62183994", "0.6212547", "0.620444", "0.61520...
0.7236414
1
PATCH/PUT /high_schools/1 PATCH/PUT /high_schools/1.json
def update respond_to do |format| if @high_school.update(high_school_params) format.html { redirect_to @high_school, notice: 'High school was successfully updated.' } format.json { render :show, status: :ok, location: @high_school } else format.html { render :edit } forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.find(params[:id])\n\n respond_to do |format|\n if @inschool.update_attributes(params[:inschool])\n format.html { redirect_to :back, notice: 'Inschool was successfully updated.' }\n format.json { h...
[ "0.6817056", "0.6743827", "0.6743827", "0.6704701", "0.6696226", "0.66632456", "0.6616371", "0.6563845", "0.6563845", "0.6563845", "0.6563845", "0.6558982", "0.6539282", "0.6526617", "0.64916337", "0.6483248", "0.6470588", "0.64704317", "0.6466912", "0.64638954", "0.6459862",...
0.7044703
1
DELETE /high_schools/1 DELETE /high_schools/1.json
def destroy @high_school.destroy respond_to do |format| format.html { redirect_to high_schools_url, notice: 'High school was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @school = School.find(params[:id])\n @school.destroy\n\n respond_to do |format|\n format.html { redirect_to cms_schools_url }\n format.json { head :ok }\n end\n end", "def destroy\n @school = School.find(params[:id])\n @school.destroy\n\n respond_to do |format|\n ...
[ "0.7446309", "0.73377365", "0.73377365", "0.7284948", "0.72463757", "0.7223396", "0.7195795", "0.71851903", "0.70984054", "0.7093525", "0.70910907", "0.70910907", "0.70910907", "0.70910907", "0.70576614", "0.70258963", "0.70234764", "0.6968764", "0.6954573", "0.6947198", "0.6...
0.7578352
1
GET /pickup_point_time_details GET /pickup_point_time_details.json
def index @pickup_point_time_details = PickupPointTimeDetail.includes(:route, :location, :pickup_route_start_time) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_pickup_point_time_detail\n @pickup_point_time_detail = PickupPointTimeDetail.find(params[:id])\n end", "def show\n @time_point = TimePoint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @time_point }\n end\n end", "def...
[ "0.73081887", "0.7270402", "0.71565807", "0.688972", "0.6757597", "0.67381096", "0.6684565", "0.6590121", "0.65166855", "0.6437241", "0.64303213", "0.64291006", "0.63696826", "0.6330444", "0.63184285", "0.63182986", "0.63182986", "0.6307483", "0.6300095", "0.62642473", "0.626...
0.76053977
0
POST /pickup_point_time_details POST /pickup_point_time_details.json
def create @pickup_point_time_detail = PickupPointTimeDetail.new(pickup_point_time_detail_params) respond_to do |format| if @pickup_point_time_detail.save format.html { redirect_to pickup_point_time_details_path, notice: 'Pickup point time detail was successfully created.' } format.json {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pickup_point_time_detail_params\n #params[:pickup_point_time_detail]\n params.require(:pickup_point_time_detail).permit(:route_id, :location_id, :pickup_route_start_time_id, :pickup_time)\n end", "def set_pickup_point_time_detail\n @pickup_point_time_detail = PickupPointTimeDetail.find(para...
[ "0.76083297", "0.7414556", "0.7245251", "0.67128", "0.6640143", "0.66362816", "0.6511833", "0.64674044", "0.6441322", "0.64413005", "0.64108527", "0.6384961", "0.6375037", "0.6370077", "0.6355481", "0.6317949", "0.62920445", "0.6280445", "0.625384", "0.62518287", "0.62374717"...
0.7998177
0
PATCH/PUT /pickup_point_time_details/1 PATCH/PUT /pickup_point_time_details/1.json
def update respond_to do |format| if @pickup_point_time_detail.update(pickup_point_time_detail_params) format.html { redirect_to pickup_point_time_details_path, notice: 'Pickup point time detail was successfully updated.' } format.json { render :show, status: :ok, location: @pickup_point_time_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @time_point = TimePoint.find(params[:id])\n\n respond_to do |format|\n if @time_point.update_attributes(params[:time_point])\n format.html { redirect_to @time_point, notice: 'Time point was successfully updated.' }\n format.json { head :no_content }\n else\n format...
[ "0.7049888", "0.7009255", "0.67103887", "0.66318226", "0.65971214", "0.64411294", "0.6431845", "0.6430065", "0.6395657", "0.6385543", "0.6366297", "0.63523287", "0.6340919", "0.6332876", "0.6331364", "0.63246447", "0.6321546", "0.6306469", "0.6304709", "0.6286071", "0.6271091...
0.7767961
0
DELETE /pickup_point_time_details/1 DELETE /pickup_point_time_details/1.json
def destroy @pickup_point_time_detail.destroy respond_to do |format| format.html { redirect_to pickup_point_time_details_url, notice: 'Pickup point time detail was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @time_point = TimePoint.find(params[:id])\n @time_point.destroy\n\n respond_to do |format|\n format.html { redirect_to time_points_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @touchpoint = Touchpoint.find(params[:id])\n @touchpoint.destroy\n\n ...
[ "0.71817905", "0.6950857", "0.68433964", "0.6753407", "0.6737451", "0.6728959", "0.67184174", "0.6683086", "0.6678557", "0.6666907", "0.66424465", "0.66377705", "0.66283524", "0.6628253", "0.6627046", "0.66243964", "0.66201854", "0.6614446", "0.66093975", "0.6606172", "0.6571...
0.7754922
0
=begin def start_date start_date end def rental_days rental_days end =end
def last_day start_date + rental_days.days end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def day_calculations\n\t\t@prev_beg_range = @beg_range.to_date-1.day\n\t\t@prev_end_range = @beg_range.to_date-1.day\n\t\t@next_beg_range = @beg_range.to_date+1.day\n\t\t@next_end_range = @beg_range.to_date+1.day\n\tend", "def estimated_end_date\n start_date + 12.days\n end", "def number_of_days(rental)\n\...
[ "0.688894", "0.6758236", "0.6753731", "0.666843", "0.655105", "0.6413499", "0.6404946", "0.63953614", "0.63264555", "0.6317546", "0.63113", "0.630452", "0.6297992", "0.62641895", "0.6260592", "0.624658", "0.6229436", "0.6225248", "0.6224174", "0.62112546", "0.62010264", "0....
0.7659485
0
Wait section ==================================================== This function wait for Freelancer page to be visible
def wait_for_freelancer_page_visible sleep 15 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_page\n sleep 0.7\n end", "def wait_for_browser\r\n # NOTE: no need any more\r\n end", "def wait_to_load\n activity_div.wait_until(&:exists?)\n @page = @bank_page.load_page\n end", "def wait_for_ready(wait: 10)\n Support::Waiter.wait_until(max_duration: wait, reloa...
[ "0.76040167", "0.72971225", "0.71547556", "0.71169984", "0.70667595", "0.69891137", "0.66882175", "0.6648524", "0.6646172", "0.6641512", "0.6608792", "0.65810823", "0.6574439", "0.6566478", "0.65220696", "0.65143555", "0.6474001", "0.64476734", "0.64396656", "0.64186007", "0....
0.8818552
0
This function wait for Freelancer Skills to Be displayed
def wait_for_freelancer_skills_displayed wait_for_element_present@driver.find_elements(:xpath, FREELANCER_SKILLS) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_freelancer_page_visible\n sleep 15\n end", "def wait_for_company_skills_displayed\n wait_for_element_present@driver.find_elements(:xpath, COMPANY_SKILLS)\n end", "def is_freelancer_skills_displayed\n @driver.find_element(:xpath, FREELANCER_SKILLS).displayed?\n end", "def flash_card_t...
[ "0.7320436", "0.6873017", "0.6355161", "0.63391227", "0.61390126", "0.6137762", "0.6122016", "0.6011918", "0.59464854", "0.59044504", "0.5866783", "0.585784", "0.5830147", "0.5822819", "0.5813866", "0.5791037", "0.5791037", "0.5791037", "0.5778776", "0.5774143", "0.5770044", ...
0.7697839
0
This function wait for Company Skills to bo visible
def wait_for_company_skills_displayed wait_for_element_present@driver.find_elements(:xpath, COMPANY_SKILLS) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_freelancer_skills_displayed\n wait_for_element_present@driver.find_elements(:xpath, FREELANCER_SKILLS)\n end", "def is_company_skills_displayed\n @driver.find_element(:xpath, COMPANY_SKILLS).displayed?\n end", "def wait_for_freelancer_page_visible\n sleep 15\n end", "def app_sign_cit...
[ "0.6856827", "0.66906625", "0.5963678", "0.5916244", "0.579606", "0.5784677", "0.5731739", "0.5718268", "0.5717535", "0.56803304", "0.56781155", "0.5630464", "0.56303316", "0.55838555", "0.5582438", "0.5582438", "0.55660903", "0.5564731", "0.5564731", "0.55552554", "0.5540803...
0.784874
0
Is Displayed Section ============================================ This function verifying is Freelancer title visible
def is_freelancer_title_displayed @driver.find_element(:xpath, FREELANCER_TITLE).displayed? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def third_screen_visible?\n @third_screen_title.visible?\n end", "def second_screen_visible?\n @second_screen_title.visible?\n end", "def display_header?\n !@request.hide_title?\n end", "def post_title_displayed?\n wait = Selenium::WebDriver::Wait.new(timeout: 15)\n wait.until {...
[ "0.764265", "0.740151", "0.709556", "0.6934321", "0.6927972", "0.68464124", "0.68008417", "0.6769768", "0.67285717", "0.66852236", "0.66709924", "0.6662933", "0.6656356", "0.66417414", "0.66417414", "0.6620933", "0.6610969", "0.65987206", "0.6582707", "0.65347195", "0.6534719...
0.779525
0
This function verifying is Company title visible
def is_company_title_displayed @driver.find_element(:xpath, COMPANY_TITLE).displayed? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visible?(title)\n @driver.wait { @driver.text(title).displayed? }\n @driver.wait do\n @driver.find_element(\n @rows[:type], @rows[:value]\n ).displayed?\n end\n end", "def title_check\n \n\n if self.title\n \n if !self.title.include? \"Believe\" || \"Won't\"...
[ "0.67883676", "0.672336", "0.66816527", "0.6651884", "0.6413975", "0.63672215", "0.633768", "0.62695855", "0.62595093", "0.62374586", "0.62158734", "0.6193987", "0.61713064", "0.61666167", "0.6162868", "0.61390465", "0.6122508", "0.6108706", "0.6087422", "0.6087422", "0.60873...
0.78528446
0
This function verifying is Freelancer description displayed
def is_freelancer_description_displayed @driver.find_element(:xpath, FREELANCER_DESCRIPTION).displayed? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_description?\n true\n end", "def compare_description?(freelancer_descr, profile_descr)\n serialized_freelance_descr = freelancer_descr.chomp(\"...\").split(\" \")\n serialized_profile_descr = profile_descr.gsub(\"\\n\", \" \").split(\" \")[0..serialized_freelance_descr.size-1]\n...
[ "0.69349825", "0.678449", "0.65462655", "0.65162784", "0.64722085", "0.6456985", "0.6433818", "0.6417562", "0.640336", "0.6402933", "0.6396678", "0.6365976", "0.6354546", "0.63342744", "0.6312018", "0.6241672", "0.6222901", "0.6215725", "0.61958957", "0.61919767", "0.6135295"...
0.7505479
0
This function verifying is Freelancer Skills displayed
def is_freelancer_skills_displayed @driver.find_element(:xpath, FREELANCER_SKILLS).displayed? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_company_skills_displayed\n @driver.find_element(:xpath, COMPANY_SKILLS).displayed?\n end", "def verify_persinfo\n\t\t@browser.url == \"https://www.autogravity.com/credit/application/personal\"\n\t\t@browser.div(:visible_text, /Personal Information$/).present?\n\tend", "def verify_admission_preview(o...
[ "0.6313923", "0.6224503", "0.6219658", "0.61862093", "0.61831677", "0.59142196", "0.5908934", "0.5901913", "0.58925664", "0.5890618", "0.5883302", "0.5859034", "0.580531", "0.5792772", "0.57713014", "0.5737664", "0.5715716", "0.56702536", "0.5661672", "0.56448835", "0.5631394...
0.7369797
0
This function verifying is Company Skills displayed
def is_company_skills_displayed @driver.find_element(:xpath, COMPANY_SKILLS).displayed? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_company_skills_displayed\n wait_for_element_present@driver.find_elements(:xpath, COMPANY_SKILLS)\n end", "def is_freelancer_skills_displayed\n @driver.find_element(:xpath, FREELANCER_SKILLS).displayed?\n end", "def partner_info_verify(partner)\n h3_section.text.eql?(partner.company_in...
[ "0.63267136", "0.6303509", "0.60321546", "0.58982456", "0.5890195", "0.5854142", "0.58538437", "0.58419794", "0.57609874", "0.5738396", "0.56913054", "0.5656232", "0.5619824", "0.55785066", "0.5562495", "0.5556789", "0.55514973", "0.5525279", "0.54784787", "0.5469178", "0.545...
0.7352047
0
GET /promotions/new GET /promotions/new.json
def new @title = t('admin.promotions.new.title') @promotion = Promotion.new respond_to do |format| format.html # new.html.erb format.json { render json: @promotion } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @promotion = Promotion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @promotion }\n end\n end", "def new\n @promotion = Promotion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prom...
[ "0.6773825", "0.6773825", "0.6723257", "0.67167276", "0.6670944", "0.66099197", "0.6547896", "0.6534966", "0.6522893", "0.6518899", "0.6454145", "0.6409984", "0.64054096", "0.6387803", "0.6377172", "0.6376353", "0.6376353", "0.63630754", "0.6361718", "0.6357101", "0.6351314",...
0.7212576
0
Return the current loggedin author (if any)
def current_author Author.find(current_user.id) unless current_user.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_author\n @current_author ||= session[:current_user_id] && Author.find(session[:current_user_id])\n end", "def author; User.get(self.author_id); end", "def author\n return User.find(self.user_id).user_name\n end", "def author\n @author ||= begin\n UnfuddleAPI::People.find(self[...
[ "0.8496916", "0.8378038", "0.8239637", "0.8208727", "0.818924", "0.81181395", "0.808904", "0.8052152", "0.8044936", "0.79666424", "0.7950728", "0.7943942", "0.79297084", "0.7906964", "0.78874916", "0.78838074", "0.7875883", "0.7835582", "0.78184617", "0.77619386", "0.7719598"...
0.8601786
0
Creates the Move method that takes a array, position and value.
def move(array,position,value = "X") array[position.to_i - 1] = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move( array, index, value=\"X\" )\n array[index] = value\nend", "def move(array, index, value = \"X\")\n array[index] = value\nend", "def move(array, position ,value = \"X\")\n position = position.to_i\n position = position - 1\n if array[position] != \"X\" and array[position] != \"O\"\n array[po...
[ "0.7541419", "0.7452942", "0.7298216", "0.7074355", "0.6769837", "0.6632056", "0.65359604", "0.64776385", "0.6392817", "0.6362932", "0.63206774", "0.6312236", "0.6212682", "0.6212682", "0.618601", "0.6169062", "0.61350507", "0.6134265", "0.61115277", "0.6077917", "0.6077917",...
0.7676141
0
get all users in the graph
def get_users(neo) cypher_query = ' START me = node:nodes_index(type = "user")' cypher_query << ' RETURN ID(me), me.name' cypher_query << ' ORDER BY ID(me)' neo.execute_query(cypher_query)['data'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_users()\n response = HTTParty.get(\"https://graph.microsoft.com/v1.0/users\", { \n headers: {\n \"Authorization\" => \"Bearer #{bearerToken}\",\n \"Host\" => 'graph.microsoft.com' \n ...
[ "0.7535191", "0.7437218", "0.74323624", "0.73720616", "0.73589134", "0.7345213", "0.73325175", "0.7277267", "0.72661966", "0.72155476", "0.7213228", "0.72066355", "0.7196767", "0.7187327", "0.71700126", "0.71645075", "0.7152486", "0.7141491", "0.7122641", "0.712086", "0.71167...
0.75305843
1
get all repo's with a follow_count > 2
def get_repos(neo) # return repo's that have more than 1 connection # TODO: try this; n<-r[follows*2..]-m cypher_query = ' START n = node:nodes_index(type = "repo")' cypher_query << ' MATCH n<-[r:follows]-m' cypher_query << ' WITH n, count(m) AS follow_count' cypher_query << ' WHERE follow_count > 2' cypher_qu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repositories\n Repository.where(user_id: group_ids).or(membered_repositories).order(\"updated_at desc\")\n end", "def activity_watching_following()\n\t Activity.where('$or' => [{ :project_id => { \"$in\" => self[:watching] } }, { :project_id => { \"$in\" => repo_ids } }, {:author_id => { \"$in\" => self...
[ "0.5932431", "0.5884256", "0.58509874", "0.5850755", "0.5832055", "0.569113", "0.56283444", "0.5611019", "0.54878515", "0.5467303", "0.54627734", "0.5409336", "0.53812915", "0.5371475", "0.5336227", "0.5296693", "0.5284301", "0.5277139", "0.52546793", "0.5250612", "0.52483416...
0.66640586
0
get the users for a repo
def get_users_for_repo(neo, repo) neo.traverse(repo, 'nodes', { :order => 'breadth first', :uniqueness => 'node global', :relationships => { :type => 'follows', :direction => 'in' }, }) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_repo_users\n repo_users = Array.new\n github = Github.new :oauth_token => github_token\n\n github.repos.list.body.each do |repo|\n repo_users << repo[\"owner\"][\"login\"]\n end\n\n repo_users\n end", "def get_all_user_repos\n user = User.find_by(uuid: params[:uuid])\n\n client...
[ "0.8831717", "0.7594455", "0.733468", "0.7199064", "0.7116713", "0.7096837", "0.7087345", "0.7025816", "0.7003137", "0.6926963", "0.6855608", "0.6847159", "0.6806955", "0.6793283", "0.67886394", "0.6774231", "0.6760473", "0.67336935", "0.6683094", "0.66607404", "0.6646639", ...
0.7610166
1
get the relationships for a repo, with user id and user name
def get_relationships_for_repo(neo, repo) cypher_query = ' START user = node:nodes_index(type = "user"), repo = node:nodes_index(type = "repo")' cypher_query << ' MATCH user-[r:follows]->repo' cypher_query << ' WHERE ID(repo) = {repo_id}' cypher_query << ' RETURN ID(user), user.name' neo.execute_query(cypher_qu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relationships\n model.relationships(repository.name)\n end", "def find_repos(user)\n user.repos\n end", "def get_users_for_repo(neo, repo)\n\n\tneo.traverse(repo, 'nodes', {\n\t\t:order => 'breadth first',\n\t\t:uniqueness => 'node global',\n\t\t:relationships => {\n\t\t\t:type ...
[ "0.721598", "0.68205875", "0.652867", "0.6370234", "0.63568276", "0.6260161", "0.62548524", "0.60606635", "0.6008354", "0.6002312", "0.59954065", "0.5979937", "0.59636974", "0.59211624", "0.58956385", "0.5737095", "0.57164115", "0.57111883", "0.5703567", "0.5692235", "0.56865...
0.7237486
0
build json for longest paths
def get_longest_path(clear_cache = false) File.delete(longest_cache_file) if clear_cache && File.exist?(longest_cache_file) if File.exist?(longest_cache_file) content_type :json unless is_rake send_file longest_cache_file else neo = Neography::Rest.new(ENV['NEO4J_URL'] || 'http://localhost:7474') out =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paths_to_json\n JSON.unparse(paths_to_array) \n end", "def longest_path_1(edges)\nend", "def generate_json\n if @path\n output = formatted_output\n File.open(@path, 'w') { |f| f.write(output.to_json) }\n end\n end", "def generate_json\n ...
[ "0.6154557", "0.5814891", "0.5700766", "0.5700766", "0.56640106", "0.5627103", "0.5567338", "0.552168", "0.5510911", "0.5458932", "0.5442601", "0.5441034", "0.5424834", "0.5400485", "0.53824484", "0.53822553", "0.5371723", "0.5341395", "0.53331554", "0.5294324", "0.52785754",...
0.6817712
0
Show the details of one place
def show @place = Place.find_by(:id=> params["id"]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @place = Place.find(params[:id])\n end", "def show_place_detail(params, options = {})\n query_str = params[:text]\n query_str = query_str.match(/「(.*)」の情報/)\n query_str = query_str[1]\n res = get_place_info(query_str)\n place_info = JSON.load(res.body)\n i...
[ "0.79349697", "0.75223684", "0.75033444", "0.7499598", "0.74456936", "0.74244684", "0.734506", "0.734506", "0.734506", "0.7254699", "0.7235666", "0.7235666", "0.7235666", "0.7235666", "0.7235666", "0.72238415", "0.7218615", "0.72095394", "0.7178379", "0.7168021", "0.7164558",...
0.766379
1
Delete a place from the database
def delete @place = Place.find_by(:id => params["id"]) # Find out what link has been clicked @place.delete # Delete the item which has been clicked redirect_to root_url # Show home page to verify that the place has been deleted end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @place.destroy\n \n \n end", "def destroy\n @place = Place.find(params[:id])\n @place.destroy\n redirect_to places_path\n end", "def destroy\n @place.destroy\n head :no_content\n end", "def delete\n\t\t@place = Place.find_by(:id => params[\"id\"])\n\n\t\tif @plac...
[ "0.7879893", "0.77100843", "0.7655565", "0.75244796", "0.7475509", "0.744981", "0.74018425", "0.7312178", "0.72758377", "0.7233697", "0.71646184", "0.71539354", "0.70906746", "0.70906746", "0.70906746", "0.70906746", "0.70906746", "0.70906746", "0.70906746", "0.707276", "0.70...
0.7719449
1
Convert all fonts to ems
def convert_fonts out = "" sass.each_line do |line| line.gsub!(/(\s*)(word-spacing|letter-spacing|font-size|line-height|margin-[^\s]+|margin|padding-[\s]+|padding)\s*:(.*)/) do |m| # indent rule: value m = "#{$1}#{$2}: #{CSS.val_to_em($3)}" end o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_fonts(sass)\n out = \"\"\n sass.each_line do |line|\n line.gsub!(/(\\s*)(word-spacing|letter-spacing|font-size|line-height|margin-[^\\s]+|margin|padding-[\\s]+|padding)\\s*:(.*)/) do |m|\n # :spacing :rule :value\n m = \"%s%s: %s\" % [$1, ...
[ "0.6490057", "0.61487615", "0.6108373", "0.5908551", "0.5895589", "0.5843664", "0.5416169", "0.53674954", "0.5332667", "0.5294704", "0.52872396", "0.52648693", "0.5236899", "0.5188425", "0.51730424", "0.5149428", "0.51386946", "0.5102211", "0.50768965", "0.50674284", "0.50339...
0.7056603
0
Replace body css rule and add it to the above rule using the sass '&'
def rename_body puts "renaming sass body element" self.sass.gsub!(/^(\s*)body\n/, "\n#{$1}&\n") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_unmergable_css_rules(doc, unmergable_rules) # :nodoc:\n styles = unmergable_rules.to_s\n\n unless styles.empty?\n style_tag = \"<style type=\\\"text/css\\\">\\n#{styles}</style>\"\n if body = doc.search('body')\n if doc.at_css('body').children && !doc.at_css('bo...
[ "0.57379687", "0.569437", "0.5649964", "0.5635443", "0.56238586", "0.5512798", "0.5507444", "0.5490131", "0.54834735", "0.54481226", "0.54481226", "0.54370546", "0.531204", "0.5301126", "0.52723217", "0.5248213", "0.52280563", "0.5198434", "0.5193462", "0.51603824", "0.511317...
0.6865634
0
CSS directives must be top levl We namespace the css so these will bork So loop through identifying directives and remove them an anything indented inside
def move_css_directives puts "moving css directives to top of file" css_directives = "" new_sass = "" directive_indent = 0 # Go through the lines rewriting paths as appropriate sass.each_line do |line| sass_line = SassLine.new(@epub, self, line.to_s, directive_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def css_omit\n %w()\nend", "def directives; end", "def directives; end", "def clean_css\n return if self.css.blank?\n prefix = \"#workskin\"\n scanner = StringScanner.new(self.css)\n if !scanner.exist?(/\\/\\*/)\n # no comments, clean the whole thing\n self.css = clean_css_code(self.cs...
[ "0.6319556", "0.6056606", "0.6056606", "0.59757024", "0.5853228", "0.5581586", "0.55681336", "0.55295616", "0.53764224", "0.53764224", "0.53764224", "0.5369006", "0.53676164", "0.53469825", "0.52993876", "0.5289558", "0.5286437", "0.52749735", "0.5210161", "0.5190277", "0.516...
0.6912303
0
Displays a progress indicator for a given message. This progress report is only displayed on TTY displays, otherwise the message is passed to the +nontty_log+ level.
def progress(msg, nontty_log = :debug) send(nontty_log, msg) if nontty_log return unless show_progress icon = "" if defined?(::Encoding) icon = PROGRESS_INDICATORS[@progress_indicator] + " " end @mutex.synchronize do print("\e[2K\e[?25l\e[1m#{icon}#{msg}\e[0m\r") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def progress(msg, nontty_log = T.unsafe(nil)); end", "def report_progress(message)\n @progress_block.call(message) if @progress_block\n end", "def ReportProgress(progress_s)\n progress_s = Builtins.sformat(\"=== %1 ===\", progress_s)\n\n Builtins.y2milestone(\"%1\", progress_s)\n UI.ChangeWi...
[ "0.77027094", "0.6517017", "0.6432016", "0.63986486", "0.63013893", "0.62673146", "0.5994179", "0.5977254", "0.59584814", "0.58779776", "0.58413565", "0.5832809", "0.573447", "0.57272077", "0.57156104", "0.57072085", "0.56922144", "0.5677506", "0.5674355", "0.5667573", "0.565...
0.8307875
0
Clears the progress indicator in the TTY display.
def clear_progress return unless show_progress print_no_newline("\e[?25h\e[2K") @progress_msg = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_progress; end", "def clear_output(wait=false)\n Display.clear_output(wait)\n end", "def clear\n $stdout.print \"\\n\"\n $stdout.flush\n end", "def clear\n Vedeu::Terminal.clear\n end", "def clear_screen\n puts \"\\e[H\\e[2J\"\n end", "def clear\n # If n is 2, c...
[ "0.76503116", "0.7068279", "0.70485336", "0.69376385", "0.6849531", "0.6820603", "0.68204975", "0.6789234", "0.6782584", "0.67592484", "0.67498493", "0.6729563", "0.6717679", "0.6708802", "0.6690987", "0.6677897", "0.6676975", "0.66718906", "0.667078", "0.6648937", "0.6631548...
0.85260814
0
Prints the backtrace +exc+ to the logger as error data.
def backtrace(exc, level_meth = :error) return unless show_backtraces send(level_meth, "#{exc.class.class_name}: #{exc.message}") send(level_meth, "Stack trace:" + exc.backtrace[0..5].map {|x| "\n\t#{x}" }.join + "\n") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(msg, exc=nil)\n return synchronize{@out.print(\"#{@error}#{msg}\\n\")} unless exc\n synchronize{@out.print(\"#{@error}#{msg}: #{exc}\\n#{exc.backtrace.join(\"\\n\")}\\n\")}\n end", "def exception(ex, msg='')\n line = ''\n ex.backtrace.each do |l|\n line += \"\\n #{l}\"\n end...
[ "0.6682094", "0.6382295", "0.63343036", "0.61962634", "0.6130218", "0.6102125", "0.6064013", "0.602026", "0.5987188", "0.5961902", "0.59611785", "0.59099096", "0.5905247", "0.58743876", "0.5774503", "0.5765145", "0.57406294", "0.57210904", "0.57158697", "0.5700352", "0.567704...
0.6421739
1
Warns that the Ruby environment does not support continuations. Applies to JRuby, Rubinius and MacRuby. This warning will only display once per Ruby process.
def warn_no_continuations end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def warn_no_continuations; end", "def rubinius_skip(message = '')\n skip message if RUBY_ENGINE == 'rbx'\nend", "def rubinius_skip(message = '')\n skip message if RUBY_ENGINE == 'rbx'\nend", "def rubinius_skip(message = '')\n skip message if RUBY_ENGINE == 'rbx'\nend", "def warn(progname = T.unsafe(nil)...
[ "0.7130728", "0.5488456", "0.5488456", "0.5488456", "0.5397916", "0.53552765", "0.5345994", "0.5299118", "0.5293796", "0.5293796", "0.5293796", "0.5215354", "0.5186471", "0.5135099", "0.5126447", "0.50751024", "0.506705", "0.5034577", "0.49753577", "0.49483946", "0.49292287",...
0.70627606
1
Initializes and returns an Iterator
def iter @iter ||= Iterator.new(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_iterator\n\t\tend", "def begin_iterator\n ListIterator.new @head, self\n end", "def to_iter\n Iterator.new @entries, @capacity\n end", "def iterator()\n raise NotImplementedError\n end", "def getIterator() \n XMLDB::Base::ResourceIterator.getInstance(@obj.getIterator())\n ...
[ "0.7022715", "0.7019512", "0.6894122", "0.6449395", "0.63852686", "0.62473184", "0.6089897", "0.58430946", "0.5811757", "0.57916164", "0.5742037", "0.57390785", "0.57236403", "0.56869006", "0.56869006", "0.56869006", "0.56869006", "0.5675764", "0.5662358", "0.56622213", "0.56...
0.7505006
0
Comparing elevator to previous best
def checkBestElevator(scoreToCheck, newElevator, bestElevatorInfo, floor) #If elevators situation is more favourable if scoreToCheck < bestElevatorInfo[1] bestElevatorInfo[1] = scoreToCheck bestElevatorInfo[0] = newElevator bestElevatorInfo[2] = (n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def choose_elevator\n elevator_scores = []\n\n for elevator in @column.elevator_list do\n \n # Initialize score to 0\n score = 0\n floor_difference = elevator.current_floor - @floor\n\n # Prevents use of any offline/under-maintenance elevators\n ...
[ "0.7092161", "0.6612731", "0.65469885", "0.6142631", "0.5933778", "0.5923163", "0.59172934", "0.5877978", "0.58687085", "0.5857423", "0.58505124", "0.58122474", "0.57705396", "0.5767235", "0.57530624", "0.5752622", "0.5724877", "0.5722437", "0.57156116", "0.57017064", "0.5698...
0.73192716
0
End getters Method to create floor request buttons
def makeFloorRequestButton floorRequestButtonFloor = 1 for i in 1..@amountOfFloors floorRequestButton = FloorRequestButton.new(i, 'off', floorRequestButtonFloor) @floorRequestButtonsList.push(floorRequestButton) floorRequestButtonFloor += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_floor_buttons\n for floor in 1..Elevator.num_floors do\n button = FloorButton.new(floor, self)\n @floor_buttons.append(button)\n end\n end", "def create_call_buttons\n \n for floor in 1..Elevator.num_floors do\n \n up_btn = Cal...
[ "0.725043", "0.6995777", "0.6883464", "0.6748535", "0.65568984", "0.6451425", "0.6248393", "0.6185009", "0.61505955", "0.59828275", "0.59518325", "0.5936965", "0.59348613", "0.58649135", "0.58584106", "0.5817088", "0.5807335", "0.5726247", "0.57021666", "0.56969005", "0.56808...
0.77983236
0
User requesting floor inside elevator
def requestFloor(floor) puts "The elevator is requested to move to floor #{floor}." @floorRequestList.push(floor) sortFloorList() puts "Elevator is moving." moveElevator() puts "Elevator is #{@status}." doorController() if @...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_floor(elevator, requested_floor)\n floor_btn_to_press = elevator.floor_buttons.find { |btn| btn.floor == requested_floor } \n \n floor_btn_to_press.press()\n elevator.do_requests()\n end", "def requestElevator(floor, direction)\n puts \"A request for an eleva...
[ "0.793773", "0.7650569", "0.7575021", "0.74889666", "0.74183387", "0.7154896", "0.7093107", "0.7078495", "0.70356715", "0.6796759", "0.6785355", "0.6701571", "0.6570387", "0.65656316", "0.6461453", "0.6383427", "0.6357844", "0.634533", "0.62568986", "0.62568986", "0.6230515",...
0.8025594
0
Sorting floor request list
def sortFloorList if @direction == 'up' @floorRequestList.sort! elsif @direction == 'down' @floorRequestList.sort!.reverse end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_params; end", "def sort_params; end", "def sort_entries; end", "def sort_requests_queue\n request = @requests_queue[0]\n get_movement()\n\n if @requests_queue.length() > 1\n\n if @movement == \"up\"\n # Sort the queue in ascending order\n ...
[ "0.68617064", "0.68617064", "0.6753194", "0.6752096", "0.6388564", "0.6361775", "0.6293843", "0.6293843", "0.6278227", "0.62235636", "0.6135104", "0.6038651", "0.59794766", "0.597288", "0.5957384", "0.5868069", "0.58595574", "0.58451015", "0.58067507", "0.579388", "0.57817155...
0.79077053
0
GET /mission_memberships GET /mission_memberships.json
def index @mission_memberships = MissionMembership.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def memberships\n @list.client.get(\"#{url}/memberships\")\n end", "def index\n @memberships = @user.memberships\n end", "def GetMemberships params = {}\n\n params = params.merge(path: 'group_memberships.json')\n APICall(params)\n\n end", "def list_memberships(user)\n get(...
[ "0.76106286", "0.7396231", "0.72806555", "0.72588444", "0.70949376", "0.70320547", "0.6945259", "0.69267637", "0.68940276", "0.6810406", "0.67558146", "0.67558146", "0.67558146", "0.6728887", "0.6690107", "0.6661255", "0.6593517", "0.65318435", "0.6506067", "0.64345264", "0.6...
0.78292584
0
POST /mission_memberships POST /mission_memberships.json
def create @mission_membership = MissionMembership.new(mission_membership_params) respond_to do |format| if @mission_membership.save format.html { redirect_to @mission_membership, notice: 'Mission membership was successfully created.' } format.json { render :show, status: :created, locati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateMembership params = {}\n \n APICall(path: 'group_memberships.json',method: 'POST',payload: params.to_json)\n \n end", "def mission_membership_params\n params.require(:mission_membership).permit(:user_id, :mission_id)\n end", "def create\n @membership = Adhocra...
[ "0.74409395", "0.7237003", "0.719769", "0.70858735", "0.701683", "0.68935937", "0.6871786", "0.6861041", "0.67830914", "0.6780647", "0.67684424", "0.6766007", "0.6600742", "0.6540821", "0.65174806", "0.6459168", "0.6427318", "0.6395617", "0.63640666", "0.63258076", "0.6318312...
0.7569
0
PATCH/PUT /mission_memberships/1 PATCH/PUT /mission_memberships/1.json
def update respond_to do |format| if @mission_membership.update(mission_membership_params) format.html { redirect_to @mission_membership, notice: 'Mission membership was successfully updated.' } format.json { render :show, status: :ok, location: @mission_membership } else format....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @membership ||= Membership.find(params[:id])\n\n respond_to do |format|\n if @membership.update_attributes(params[:membership])\n format.html { redirect_to @membership, notice: 'Membership was successfully updated.' }\n format.json { head :no_content }\n else\n for...
[ "0.7122485", "0.70846295", "0.70549154", "0.70328283", "0.70328283", "0.70328283", "0.70328283", "0.70328283", "0.7025758", "0.70087314", "0.6939785", "0.6920675", "0.69048536", "0.68792355", "0.6831834", "0.6770367", "0.66976655", "0.6664359", "0.66423", "0.658141", "0.65712...
0.77228504
0
DELETE /mission_memberships/1 DELETE /mission_memberships/1.json
def destroy @mission_membership.destroy respond_to do |format| format.html { redirect_to mission_memberships_url, notice: 'Mission membership was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @membership.destroy\n respond_to do |format|\n format.html { redirect_to memberships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @membership.destroy\n respond_to do |format|\n format.html { redirect_to memberships_url }\n format.json { h...
[ "0.77090037", "0.77090037", "0.7646792", "0.7564791", "0.7497444", "0.7477663", "0.7469547", "0.7458328", "0.74232525", "0.7390943", "0.7321565", "0.7270806", "0.72695017", "0.72127837", "0.7205155", "0.71368515", "0.7113252", "0.7090446", "0.7066427", "0.70397353", "0.702391...
0.80314225
0
Dispatch remaining units in owned territories. Used when the user didn't do it himself during deployment.
def dispatch_remaining_units! Participation.transaction do shuffled_ownerships = ownerships.shuffle 1.upto(units_count) do ownerships.sample.deploy_units!(1) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_free_places\n max_participants - compute_occupied_places\n end", "def getAllUnits\n deep_copy(@allUnits)\n end", "def completed_units\n return @completed_units\n end", "def user_units\n @user.units\n end", "def available_units\n return 0 if status ==...
[ "0.5652705", "0.55627716", "0.5475168", "0.5465182", "0.54602784", "0.545765", "0.54546475", "0.54125816", "0.53626484", "0.53552467", "0.53325886", "0.53312206", "0.53278375", "0.53141254", "0.52933687", "0.5287663", "0.52581763", "0.52441067", "0.5226708", "0.52012277", "0....
0.68727684
0
Method that adds git repo (if it does not exist)
def add_repo_git(dir) if not Dir.exist?("#{dir}/.git") system_commands("git init #{dir}") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(path, param=File.split(path).last)\n unless self.has_repo?(param)\n begin\n list << Repo.new(path)\n rescue Rugged::RepositoryError\n logger.warn \"SKIPPING '#{path}' - not a git repository\"\n end\n end\n list\n end", "def git_add_everything(host,...
[ "0.7786885", "0.7279959", "0.725854", "0.71903586", "0.7140012", "0.70737445", "0.7009269", "0.6834908", "0.67963755", "0.67793787", "0.6749535", "0.6740471", "0.6685378", "0.66643465", "0.6618561", "0.6605729", "0.66043293", "0.65890884", "0.65625286", "0.65524465", "0.65443...
0.83147377
0
Method that checks and adds or not the remote github url
def add_remoteurl(dir) vConfig(CONFIG['configWebsite']) read_json(CONFIG['configWebsite']) remoteURL = @parse_json_config['deploy']['github']['config']['remoteURL'] remoteVerify = `sed -n '/url/p' #{dir}/.git/config | cut -d'=' -f2 | cut -d' ' -f2` if remoteVerify.nil? || remoteVerify.empty? s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_github?\n !github_url.blank?\n end", "def github_url\n [homepage, source_code_uri].find do |url|\n GemsBond::Fetchers::Github.valid_url?(url)\n end\n end", "def harmonize_remote_url(expected_url)\n remote_url = Cocaine::CommandLine.new(\"git config --get remote.origin.url...
[ "0.76588166", "0.71272326", "0.7058315", "0.7052431", "0.70423794", "0.69761235", "0.69377404", "0.66902834", "0.6660783", "0.66258305", "0.6621216", "0.6594847", "0.653276", "0.65156406", "0.65015984", "0.64983886", "0.6460231", "0.6424185", "0.64228576", "0.6418765", "0.641...
0.746424
1
The color of this user's messages.
def name_color # HACK(pwnall): come up with better colors user.key == @room.user1.key ? 'red' : 'blue' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_text_color(user)\n user_color = get_user_color(user).gsub(\"#\", \"\")\n\n # Get the hex color as red, green, blue\n r = user_color[0..1].hex\n g = user_color[2..3].hex\n b = user_color[4..5].hex\n\n if ((r * 0.299) + (g * 0.587) + (b * 0.114)) > 186\n \"#4a4a4a\"\n else\n ...
[ "0.6822189", "0.6671622", "0.6671622", "0.6510276", "0.64185995", "0.64103967", "0.6400676", "0.6391661", "0.6387521", "0.63467145", "0.6305448", "0.62759256", "0.62428457", "0.61948776", "0.6142574", "0.6139737", "0.61388814", "0.6075754", "0.60551226", "0.60551226", "0.6039...
0.6738438
1
CREATE TALLY METHOD TO KEEP TRACK TO TOTALS a hand would currently look like this: [["3", "Diamonds"], ["5", "Clubs"], ["3", "Hearts"], ["J", "Spades"], ["2", "Hearts"]]
def tally(hand) arr = hand.map{|e| e[0]} #gets the second element of the nested array (cos arrays are zero indexed) running_total = 0 #initialise this at the beginning & then iterate through each value to get the total from our new hand_total array arr.each do |value| if value == 'A' running_total +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_total hand\n\ttotal=0\n\tarray = hand.map {|e| e[1]}\n\tarray.each do |card|\n\t\t## face card \n\t\tif card == \"10\" || card ==\"J\" || card ==\"K\" || card ==\"Q\"\n\t\t\ttotal +=10\n\t\t## Ace card\t\n\t\telsif card ==\"A\"\n\t\t\ttotal += 11\n\t\telse \n\t\t\ttotal += card.to_i\n\t\tend\n\tend\n...
[ "0.65477335", "0.64149565", "0.63654476", "0.627301", "0.62686116", "0.6237541", "0.62072265", "0.61817276", "0.61564887", "0.61469185", "0.6100209", "0.6097997", "0.609409", "0.6091887", "0.60677624", "0.60031635", "0.59898496", "0.59854573", "0.59734213", "0.59586465", "0.5...
0.65437436
1
A B B C D update of tags is tricky in that it can produce three groups of changes: 1. tags being removed (exist on record, but not in params) 2. tags unchanged (exist both on record and in params) 3. tags being added (do not exiust on record but are passed in params)
def update_tags! return unless @params.key?(:tags) tags_to_remove.each do |tag_title| TaskTag.where(task: task).joins(:tag).merge(Tag.where(title: tag_title)).destroy_all end tags_to_add.each do |tag_title| TaskTag.where(task: task, tag: tag_from_title(tag_title)).first_or_crea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n\n old_tags = @event.tags.pluck(:tag)\n new_tags = params[:tags].split(',')\n\n #logger.debug old_tags\n #logger.debug new_tags\n #logger.debug (old_tags - new_tags)\n #logger.debug (new_tags - old_tags)\n\n (old_tags - new_tags).each do |stag|\n @event.tags.where(tag: stag).f...
[ "0.70100665", "0.67962426", "0.67500234", "0.67500234", "0.67167956", "0.66967404", "0.66706336", "0.6635702", "0.6629786", "0.66270185", "0.65346444", "0.65046", "0.6500159", "0.6496419", "0.64748824", "0.64666843", "0.6454377", "0.64531195", "0.6418324", "0.6418135", "0.641...
0.75297046
0
The model's fullyqualified and quoted primary key.
def primary_key "#{quoted_table_name}.#{model_class.send :primary_key}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primary_key\n '_id'\n end", "def full_primary_key(klass)\n \"#{klass.quoted_table_name}.#{klass.quoted_primary_key}\"\n end", "def primary_key\n 'id'\n end", "def primary_key\n @primary_key ||= @klass.primary_key.to_s\n end", "def quoted_primary_key\n ...
[ "0.7934944", "0.7922524", "0.7919046", "0.7885284", "0.7765311", "0.7662968", "0.76024866", "0.75943035", "0.75943035", "0.75943035", "0.7562853", "0.75185937", "0.7502828", "0.74844855", "0.744577", "0.74371296", "0.73982894", "0.73734903", "0.73720175", "0.73550135", "0.733...
0.8766146
1
The old and new values for the friendly_id column.
def friendly_id_changes changes[friendly_id_config.column.to_s] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def friendly_id; end", "def oldid(value)\n merge(oldid: value.to_s)\n end", "def oldid(value)\n merge(oldid: value.to_s)\n end", "def history_update\n return if !saved_changes?\n\n # return if it's no update\n return if new_record?\n\n # new record also triggers update, so...
[ "0.574171", "0.5280585", "0.5280585", "0.5245634", "0.5233118", "0.5188976", "0.51878655", "0.51878655", "0.51878655", "0.51878655", "0.51878655", "0.5180392", "0.5126743", "0.51084876", "0.51058644", "0.50968534", "0.5092864", "0.50747055", "0.50657624", "0.50622606", "0.505...
0.7785411
1
set the choosen number into the board
def set(num) player_id = @players[@turn % 2].id @board[num - 1] = @player_char[player_id] @turn += 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_player(input, player_num)\n board[input.to_i] = player_num\n end", "def set_board(board)\n @board = board\n end", "def set\n\t$one = \"1\"\n\t$two = \"2\"\n\t$three = \"3\"\n\t$four = \"4\"\n\t$five = \"5\"\n\t$six = \"6\"\n\t$seven = \"7\"\n\t$eight = \"8\"\n\t$nine = \"9\"\n\t$turn = 0\t\t\ne...
[ "0.72061247", "0.6614173", "0.6608064", "0.65731436", "0.6559795", "0.65297574", "0.64886427", "0.6485483", "0.64492375", "0.6421589", "0.64139074", "0.63991094", "0.63991094", "0.6387553", "0.63794553", "0.6378448", "0.6338022", "0.633373", "0.633373", "0.633373", "0.633373"...
0.7860766
0
reset the raw parameters for each filter received by the form
def reset_filter_params params[:search] = nil params[:status] = nil params[:unassigned] = nil params[:assigned_to_me] = nil params[:needs_attention] = nil params[:year] = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_params\n @params = {}\n end", "def reset\n @params = {}\n @query_filters = []\n @uri = ''\n self\n end", "def reset\n super\n @params.values.uniq.each do |param|\n param.send(:reset) if param.is_a? Parameter\n end\n end", "def rese...
[ "0.7312239", "0.72822034", "0.72426456", "0.7208308", "0.7156524", "0.7128091", "0.7106637", "0.7101697", "0.7072232", "0.69068617", "0.6905468", "0.6870684", "0.67339295", "0.67339295", "0.66478246", "0.66478246", "0.66198885", "0.6570264", "0.6553955", "0.65506566", "0.6509...
0.79791284
0
create date object with the given integer loop 365 times if date is a friday, and date is the 13th of the month add 1 to unlucky_days variable
def friday_13th(year) date = Date.new(year) unlucky_days = 0 365.times do date = date + 1 if date.friday? == true && date.mday == 13 unlucky_days += 1 end end unlucky_days end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_days\n month = (1..@day_num).collect do |day|\n Day.new(Date.parse(\"#{@year}-#{@month}-#{day}\"))\n end\n\n month[0].date.wday.times { month.insert(0, Day.new(Date.new))}\n month\n end", "def unlucky_days(year)\r\n (1..12).count { |month| Time.new(year, month, 13).frida...
[ "0.66368306", "0.6629865", "0.6624537", "0.6605464", "0.65711623", "0.6459968", "0.63914263", "0.63739103", "0.6373012", "0.6337704", "0.63307947", "0.61945593", "0.617135", "0.61478686", "0.61069566", "0.61055416", "0.6056321", "0.6031889", "0.60201555", "0.600777", "0.60051...
0.7075502
0
Context Tools Used to call pdb functions which change or retrieve information about context features within gimp Flushes displays so that the images displayed in windows are up to date
def context_update_displays!() $gimp_iface.gimp_displays_flush() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def features\n features = {}\n sexp_newtype_block.each do |s|\n if s[0] == :command and\n s[1][0..1] == [:@ident, \"feature\"] and\n s[2][0] == :args_add_block\n\n name = s[2][1][0][1][1][1]\n desc = s[2][1][1][1][1][1]\n\n features[name] = desc\n end\n end\n...
[ "0.58085936", "0.5470395", "0.54541117", "0.5428322", "0.5416372", "0.53946114", "0.5382076", "0.53657544", "0.53657544", "0.53657544", "0.53657544", "0.53657544", "0.53657544", "0.53657544", "0.53657544", "0.53657544", "0.53657544", "0.53657544", "0.53657544", "0.53657544", ...
0.64635056
0
context_get_bgcolor: retrieves the current background color. This returns an integer, not an object
def context_get_bgcolor() return $gimp_iface.gimp_context_get_background()[0] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def background_color\n return @background_color\n end", "def bgcolor\n @bgcolor || $def_bg_color\n end", "def bgColor\n return @bg_color\n end", "def background_colour\n @cr[0xf] >> 4\n end", "def background_color\n return @peer.background_color\n end", "...
[ "0.75258", "0.74347776", "0.741705", "0.7208971", "0.7142372", "0.696189", "0.6879816", "0.6850754", "0.6720105", "0.6720105", "0.6632355", "0.6425548", "0.64068097", "0.6327581", "0.6295605", "0.62035584", "0.6187676", "0.6130814", "0.61186284", "0.60704035", "0.5986553", ...
0.78690106
0
context_get_fgcolor: retrieves the current foreground color. This returns an integer, not an object
def context_get_fgcolor() return $gimp_iface.gimp_context_get_foreground()[0] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fg(c)\n return self unless ANSI_COLORS[c]\n return colorize(ANSI_COLORS[c])\n end", "def color\n @color || $def_fg_color\n end", "def context_get_bgcolor()\n return $gimp_iface.gimp_context_get_background()[0]\nend", "def foreground(fgcolor)\n fgcolor.split(/\\s+/).collect { |fg| names_t...
[ "0.7346399", "0.6942602", "0.69361687", "0.69330835", "0.6913224", "0.66612613", "0.6584758", "0.62667686", "0.6253607", "0.62124634", "0.61855555", "0.61113816", "0.60780895", "0.6024602", "0.5978909", "0.5978909", "0.58511955", "0.58346057", "0.582379", "0.5733057", "0.5702...
0.82968277
0
context_set_bgcolor: sets the background color to rgb. This does not change the color of existing images, but new images will be initialized with a layer filled with the background color
def _context_set_bgcolor!(rgb) $gimp_iface.gimp_context_set_background(rgb) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_background\n\t\tcolor = self.colour_scheme.background\t\n\t\t@canvas.new_image(@canvas_width, @canvas_height) { self.background_color = color }\n\tend", "def change_bg_color(color)\n @bg_color = color\n self.bitmap.fill_rect(self.bitmap.rect,color)\n end", "def setBackground(r,g,b,a)\n super...
[ "0.69413316", "0.69022894", "0.68575335", "0.6821368", "0.6630635", "0.6433094", "0.6346172", "0.6333049", "0.623851", "0.6236334", "0.6205428", "0.6161943", "0.61124456", "0.6087063", "0.6041322", "0.5976113", "0.59546477", "0.59286004", "0.58972466", "0.58885115", "0.588851...
0.77112925
0
context_set_fgcolor: sets the foreground color to rgb. This is the color that is used to fill selections and draw with gimp tools
def _context_set_fgcolor!(rgb) $gimp_iface.gimp_context_set_foreground(rgb) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _context_set_bgcolor!(rgb)\n $gimp_iface.gimp_context_set_background(rgb)\nend", "def context_get_fgcolor()\n return $gimp_iface.gimp_context_get_foreground()[0]\nend", "def set_colors(fg, bg)\n cp = RubyText::Color.pair(fg, bg)\n @cwin.color_set(cp)\n end", "def foreground=(value)\n @for...
[ "0.72037005", "0.7117945", "0.682541", "0.65912384", "0.6522317", "0.6444266", "0.6436844", "0.64007425", "0.63941514", "0.63784206", "0.62146825", "0.6078303", "0.60298216", "0.59687364", "0.59157544", "0.5911042", "0.5833632", "0.5833632", "0.5776536", "0.5725411", "0.57195...
0.84491634
0
context_get_brush: Returns the current brush as a string
def context_get_brush() return $gimp_iface.gimp_context_get_brush()[0] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _context_set_brush!(brush_name)\n $gimp_iface.gimp_context_set_brush(brush_name)\nend", "def markerBrush _args\n \"markerBrush _args;\" \n end", "def current_branch\n hg('branch').to_s.strip\n end", "def context_list_brushes(pattern = nil)\n if pattern == nil\n return $gimp_iface.gim...
[ "0.61980766", "0.55831283", "0.5544273", "0.55354285", "0.5531942", "0.5514982", "0.54537123", "0.5436998", "0.5348929", "0.52988863", "0.5191989", "0.5162451", "0.5141147", "0.5139729", "0.5136548", "0.51061976", "0.5049303", "0.50474876", "0.5031778", "0.5029652", "0.499903...
0.7975319
0
context_set_brush: Takes a brush name and sets the brush accordingly
def _context_set_brush!(brush_name) $gimp_iface.gimp_context_set_brush(brush_name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMarkerBrush _obj, _args\n \"_obj setMarkerBrush _args;\" \n end", "def set_brush_holder\n @brush_holder = BrushHolder.find(params[:id])\n end", "def setMarkerBrushLocal _obj, _args\n \"_obj setMarkerBrushLocal _args;\" \n end", "def setBrushSize(size)\n puts(\"Brush size...
[ "0.66233206", "0.6411085", "0.61420393", "0.5755998", "0.57285947", "0.53350013", "0.5073856", "0.49332157", "0.48792353", "0.48563275", "0.47966868", "0.47849363", "0.47437993", "0.47134793", "0.45473495", "0.454404", "0.45254093", "0.45074755", "0.44992483", "0.44978228", "...
0.81278855
0
contextlistcolors: returns an array of color names. If given a string, the array only contains the names that contain that string.
def context_list_colors(pattern = nil) if pattern == nil return $gimp_iface.ggimp_rgb_list()[1] elsif pattern.is_a? String names = $gimp_iface.ggimp_rgb_list()[1] names.select!{|element| element.include?(pattern)} return names else raise ArgumentError, "context_list_color_names only accepts a ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def colorNames\n colors = [\"red\", \"orange\", \"yellow\", \"green\", \"mint\", \"navy\", \"light blue\", \"lavender\", \"plum\", \"pink\"]; \n return colors;\n end", "def colors\n keys = []\n COLORS.each_key do | key |\n keys << key\n end\n keys\n end", "def colors\n ...
[ "0.69695807", "0.62754905", "0.62739664", "0.61538494", "0.60605234", "0.5847429", "0.5790094", "0.5787053", "0.5745596", "0.570813", "0.56230557", "0.55329263", "0.5522375", "0.5511621", "0.54972005", "0.5470148", "0.5445049", "0.54142094", "0.5388828", "0.5348647", "0.53333...
0.8192782
0
contextlistbrushes: returns an array of brush names. If given a string, the array only contains the names that contain that string.
def context_list_brushes(pattern = nil) if pattern == nil return $gimp_iface.gimp_brushes_get_list("")[1] elsif pattern.is_a? String return $gimp_iface.gimp_brushes_get_list(pattern)[1] else raise ArgumentError, "context_list_brushes only accepts a string as an argument" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def context_list_colors(pattern = nil)\n if pattern == nil\n return $gimp_iface.ggimp_rgb_list()[1]\n elsif pattern.is_a? String\n names = $gimp_iface.ggimp_rgb_list()[1]\n names.select!{|element| element.include?(pattern)}\n return names\n else\n raise ArgumentError, \"context_list_color_names o...
[ "0.59051013", "0.49843502", "0.49527097", "0.48982787", "0.48217726", "0.47377667", "0.471358", "0.47100002", "0.46386588", "0.4580997", "0.45541644", "0.45173135", "0.4503447", "0.44865084", "0.44663262", "0.44300905", "0.44162086", "0.43835965", "0.4378289", "0.43639383", "...
0.7297061
0
Public: Underline a string (make it a title). string The String to underline. Examples StringHelper.underline('1234') => "" Returns the String underline.
def underline(string) '-' * string.size end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def underline(str)\n str += \"\\n\" + \"-\"*str.length\n end", "def underline(str)\n \"<u>#{str.to_s}</u>\"\n end", "def underline_message(message)\n Format(:underline, message)\n end", "def underline\n surround_with_ansi(ANSI_UNDERLINE)\n end", "def underline(underl...
[ "0.7776272", "0.761674", "0.68934166", "0.6820372", "0.6599249", "0.63962066", "0.63962066", "0.6216913", "0.6161652", "0.6155356", "0.54567057", "0.5362469", "0.535676", "0.53393173", "0.5245526", "0.52365553", "0.5236024", "0.5236024", "0.5236024", "0.5236024", "0.5236024",...
0.77408844
1
Returns HTML ready to be used in the email body, HTML is generated by parsing the email.html template and applying realease_notes.md content
def parsed_body(opts) file = File.open(File.dirname(__FILE__) + "/email.html", "r") content = file.read markdown = Yolo::Tools::Ios::ReleaseNotes.html content = content.gsub("YOLO.TITLE",opts[:title]) content = content.gsub("YOLO.CONTENT",markdown) if opts[:o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_html_email(html, triggered_by_user_test)\n if triggered_by_user_test\n test_notice = create_test_notice_html()\n end\n <<-EOF\n<html>\n <head>\n <title>AppOptics Alert</title>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n </head>\n <body style=...
[ "0.7019986", "0.6804039", "0.6741336", "0.6708741", "0.6657069", "0.66140777", "0.6596342", "0.65372205", "0.6511521", "0.6376375", "0.6371209", "0.6284104", "0.6240819", "0.6227364", "0.6212095", "0.61974335", "0.6196765", "0.61920637", "0.6187838", "0.6176927", "0.6169199",...
0.686195
1
GET /syndromes GET /syndromes.json
def index @syndromes = Syndrome.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @division_syns = DivisionSyn.all\n\n render json: @division_syns\n end", "def create\n @syndrome = Syndrome.new(syndrome_params)\n\n respond_to do |format|\n if @syndrome.save\n format.html { redirect_to @syndrome, notice: 'Syndrome was successfully created.' }\n forma...
[ "0.61419743", "0.6117845", "0.59873486", "0.5809191", "0.5761091", "0.56547326", "0.56007016", "0.550228", "0.5498117", "0.54955137", "0.54951334", "0.5492723", "0.54742706", "0.5458776", "0.5454497", "0.5419186", "0.5365704", "0.5357591", "0.53476876", "0.53193563", "0.53070...
0.6881174
0
POST /syndromes POST /syndromes.json
def create @syndrome = Syndrome.new(syndrome_params) respond_to do |format| if @syndrome.save format.html { redirect_to @syndrome, notice: 'Syndrome was successfully created.' } format.json { render :show, status: :created, location: @syndrome } else format.html { render :ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def syndrome_params\n params.require(:syndrome).permit(:name, :description, :position)\n end", "def synonymprotein_params\n params.require(:synonymprotein).permit(:synonymname)\n end", "def set_syndrome\n @syndrome = Syndrome.find(params[:id])\n end", "def update\n respond_to do |f...
[ "0.656634", "0.60592175", "0.605054", "0.5982213", "0.5965555", "0.58764756", "0.5839133", "0.5611199", "0.5542197", "0.549306", "0.5409444", "0.5406993", "0.5356894", "0.5338517", "0.53040856", "0.5303876", "0.5290515", "0.5289807", "0.52886647", "0.52757597", "0.5252225", ...
0.7169076
0
PATCH/PUT /syndromes/1 PATCH/PUT /syndromes/1.json
def update respond_to do |format| if @syndrome.update(syndrome_params) format.html { redirect_to @syndrome, notice: 'Syndrome was successfully updated.' } format.json { render :show, status: :ok, location: @syndrome } else format.html { render :edit } format.json { render...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @synonymprotein.update(synonymprotein_params)\n format.html { redirect_to @synonymprotein, notice: 'Synonymprotein was successfully updated.' }\n format.json { render :show, status: :ok, location: @synonymprotein }\n else\n format.html { re...
[ "0.6044321", "0.5980634", "0.59310615", "0.58973354", "0.58475137", "0.5774499", "0.57632846", "0.57520026", "0.57478845", "0.5709029", "0.568328", "0.56721574", "0.56721574", "0.5634188", "0.56287706", "0.5614691", "0.5603879", "0.560066", "0.55834323", "0.5576043", "0.55749...
0.68181163
0
DELETE /syndromes/1 DELETE /syndromes/1.json
def destroy @syndrome.destroy respond_to do |format| format.html { redirect_to syndromes_url, notice: 'Syndrome was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @syndic.destroy\n respond_to do |format|\n format.html { redirect_to syndics_url, notice: \"Syndic was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @synonymprotein.destroy\n respond_to do |format|\n format.html { redirect...
[ "0.667361", "0.6666594", "0.6501036", "0.64855397", "0.6410822", "0.6407785", "0.6386162", "0.6375737", "0.6356847", "0.6356513", "0.6336847", "0.6324983", "0.63224137", "0.63047963", "0.6302607", "0.6291801", "0.62760407", "0.6269153", "0.6264207", "0.626374", "0.6256768", ...
0.7042794
0
Initializes a Twitch client. client_id [String] The client ID. Used as the ClientID header in a request. access_token [String] An access token. Used as the Authorization header in a request. Any "Bearer " prefix will be stripped. with_raw [Boolean] Whether to include raw HTTP response Intended for testing/checking API ...
def initialize(client_id: nil, access_token: nil, with_raw: false) if client_id.nil? && access_token.nil? raise "An identifier token (client ID or bearer token) is required" elsif !!client_id && !!access_token warn(%{WARNING: It is recommended that only one identifier token is specified. Unp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(options = {})\n client_id = options[:client_id]\n\n @oauth2_client = TwitchOAuth2::Client.new(\n client_id: client_id, **options.slice(:client_secret, :redirect_uri, :scopes)\n )\n\n @token_type = options.fetch(:token_type, :application)\n\n @tokens = @oauth2_client.c...
[ "0.7119859", "0.6726576", "0.6346222", "0.6262825", "0.6262037", "0.6226952", "0.622132", "0.60878927", "0.60878927", "0.6076046", "0.60646445", "0.60483915", "0.6046482", "0.6039473", "0.6015484", "0.60124874", "0.6011871", "0.5992625", "0.59925216", "0.59692603", "0.593184"...
0.84234625
0
hack to generate yajl_version.h without using cmake
def generate_yajl_version build_path = File.expand_path("../ext/libyajl2", __FILE__) vendor_path = File.expand_path("../ext/libyajl2/vendor/yajl", __FILE__) yajl_major = yajl_minor = yajl_micro = nil File.open("#{vendor_path}/CMakeLists.txt").each do |line| if (m = line.match(/YAJL_MAJOR (\d+)/)) yaj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_version_header(app_name, pkgname, dir = \"src\")\n version = PKGConfig.modversion(pkgname).split(/\\./)\n (0..2).each do |v|\n version[v] = \"0\" unless version[v]\n end\n filename = \"rb#{app_name.downcase}version.h\"\n\n puts \"creating #{filename}\"\n\n add_distcleanfile(filename)\n\n FileUti...
[ "0.607159", "0.56491", "0.5541313", "0.53789246", "0.5327139", "0.5255877", "0.5255877", "0.5255877", "0.52176255", "0.52176255", "0.52176255", "0.52176255", "0.52155167", "0.5198248", "0.51929784", "0.5165983", "0.51187086", "0.51185787", "0.5116837", "0.5098749", "0.5098749...
0.89106363
0
def revision(scm, target, ref)
def revision(host, scm, target, ref) args = [] case scm when 'hg' args.push('update', 'clean', '-r', ref) when 'git' args.push('reset', '--hard', ref) else fail "Unfortunately #{scm} is not supported yet" end on host, "cd #{target} && #{scm} #{args.flatten.join ' '}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_revision\n end", "def ref\n reference(@id, @revision)\n end", "def get_revision(rev = 'HEAD')\n unless @resource.value(:source)\n status = at_path { git_with_identity('status') }\n is_it_new = status =~ %r{Initial commit|No commits yet}\n if is_it_new\n status ...
[ "0.7230082", "0.72139263", "0.69580775", "0.6917695", "0.6915714", "0.68644476", "0.6816542", "0.67362523", "0.6699058", "0.66314906", "0.6587015", "0.65758854", "0.64748067", "0.6471422", "0.6403111", "0.6387499", "0.63868743", "0.63727075", "0.63588274", "0.6343399", "0.629...
0.8321204
0
Returns the intervals precision. Mixed precisions are currently not supported; in that case, the start date's precision takes precedence.
def precision min.precision || max.precision end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision\n self['precision']\n end", "def precision\n @precision = self.class::MAX_PRECISION unless @precision\n return @precision\n end", "def precision\n @precision ||= cells.map(&:to_f).map { |n| n.round(3) }.map { |n| n.to_s.split(\".\").last.gsub(/0+$/, \"\").length }.max\n end"...
[ "0.6552927", "0.64642155", "0.6390553", "0.62247926", "0.61783713", "0.6112884", "0.6036813", "0.60146314", "0.6004275", "0.5877995", "0.58046436", "0.57315046", "0.57246745", "0.5688037", "0.5683462", "0.5671486", "0.562912", "0.55948746", "0.55886495", "0.5549376", "0.55493...
0.6828826
0
TODO how to handle +/ Infinity for Dates? TODO we can't delegate to Ruby range for mixed precision intervals Returns the Interval as a Range.
def to_range case when open?, unknown? nil else Range.new(unknown_start? ? Date.new : @from, max) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_range\n Range.new(self.start, self.end)\n end", "def unbounded\n ::Unbounded::Range.new(self.min, self.max, exclude_end?)\n end", "def to_a\n get_range('-inf', '+inf', include_boundaries: true)\n end", "def to_range\n min .. max\n end", "def to_range\n start_date...
[ "0.6671649", "0.6599144", "0.6597801", "0.6468024", "0.64024574", "0.6245468", "0.6215531", "0.61930454", "0.6171799", "0.61442727", "0.6117625", "0.60772216", "0.6051633", "0.60105985", "0.6000623", "0.59989506", "0.59437037", "0.59286714", "0.58351845", "0.5833981", "0.5825...
0.6807673
0
GET /availability_products GET /availability_products.json
def index @availability_products = AvailabilityProduct.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available\n @products = Product.where.not(inventory_count: 0)\n json_response(@products)\n end", "def index\n limit = params[:limit]&.to_i || 10\n page = params[:page]&.to_i || 0\n if params[:available] == \"1\"\n @products = Product.paginate(page, limit).available\n else\n ...
[ "0.7711631", "0.7450315", "0.73196596", "0.68163335", "0.6724529", "0.66865385", "0.6612116", "0.65708023", "0.65629584", "0.6531176", "0.6524272", "0.65159017", "0.6507209", "0.64764553", "0.6461579", "0.6419418", "0.6414017", "0.64119", "0.6383029", "0.63594824", "0.6330268...
0.760284
1
POST /availability_products POST /availability_products.json
def create @availability_product = AvailabilityProduct.new(availability_product_params) respond_to do |format| if @availability_product.save format.html { redirect_to @availability_product, notice: 'Availability product was successfully created.' } format.json { render :show, status: :cre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def availability_product_params\n params.require(:availability_product).permit(:name)\n end", "def index\n @availability_products = AvailabilityProduct.all\n end", "def create\n if params[:products]\n params[:products].each do |product|\n @product = Product.new(name: product[:name],\...
[ "0.6918476", "0.6472128", "0.6329468", "0.6292604", "0.6284863", "0.6228448", "0.6216361", "0.62088215", "0.6200017", "0.61845714", "0.61789376", "0.6147109", "0.6144949", "0.61317223", "0.6118531", "0.60875213", "0.6084217", "0.605357", "0.6046187", "0.60458016", "0.6043235"...
0.74523354
0
PATCH/PUT /availability_products/1 PATCH/PUT /availability_products/1.json
def update respond_to do |format| if @availability_product.update(availability_product_params) format.html { redirect_to @availability_product, notice: 'Availability product was successfully updated.' } format.json { render :show, status: :ok, location: @availability_product } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n begin\n @api_v1_product.update!(api_v1_product_params)\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end", "def update\n if @product.update(product_params)\n render json: @product, status: :ok#, location: @colle...
[ "0.7196018", "0.69728374", "0.689465", "0.6746116", "0.6716206", "0.6709353", "0.6709279", "0.6705631", "0.66779226", "0.66370094", "0.6625007", "0.6588894", "0.65620744", "0.65620744", "0.6561498", "0.6557892", "0.6527632", "0.6521966", "0.64918685", "0.6450863", "0.6444042"...
0.7322962
0
DELETE /availability_products/1 DELETE /availability_products/1.json
def destroy @availability_product.destroy respond_to do |format| format.html { redirect_to availability_products_url, notice: 'Availability product was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @product.destroy\n\n render json: @product, status: :ok#, location: @collection\n end", "def delete_product(name)\n delete(\"/apiproducts/#{name}\")\n end", "def destroy\n begin\n @api_v1_product.destroy!\n head :no_content\n rescue => ex\n json_response({e...
[ "0.72155315", "0.71297914", "0.710702", "0.7095869", "0.7094918", "0.7064186", "0.7033315", "0.7018584", "0.69936174", "0.69714177", "0.69658566", "0.69491524", "0.69387835", "0.69240564", "0.690999", "0.6898615", "0.68963456", "0.6893211", "0.6885956", "0.6884188", "0.687826...
0.7531934
0
Determine which gem will be used for the projects CSS framework
def template_engine_gem_str(css_framework = '') case css_framework.to_s when 'semantic' 'semantic_ui' else 'bootstrap' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gems_for_testing_framework(testing_framework)\n testing_framework == :rspec ? '' : %Q{gem \"#{testing_framework}\", :group => :test} \n end", "def stylesheet\n @stylesheet ||= Dir.glob(root+'/**/parts.*css').first\n end", "def target_frameworks\n if netcore?\n tfw = @proj_xml_n...
[ "0.5801476", "0.5783976", "0.5718329", "0.56976354", "0.56976354", "0.56976354", "0.56912494", "0.5659007", "0.56516767", "0.5620703", "0.5543281", "0.55301464", "0.55301464", "0.55301464", "0.55301464", "0.55301464", "0.55301464", "0.55103683", "0.54837906", "0.5422308", "0....
0.74732846
0
Make a directory in the applications directory path
def mk_appdir(dir) path = Rails.root.join(dir) FileUtils.mkdir(path) unless File.directory?(path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_app_directories\n @shell.call \"mkdir -p #{self.directories.join(\" \")}\"\n end", "def make_directory(path)\n mkdir(path)\n chown(path, user)\n path\n end", "def make_dir(path)\n FileUtils.mkdir_p( path )# unless File.exists?(path)\n end", "def make_dir_for_path(path)\...
[ "0.762671", "0.7165527", "0.7157186", "0.7153562", "0.71301025", "0.7121114", "0.7038211", "0.69959074", "0.68819857", "0.6864578", "0.6857136", "0.68466306", "0.6843986", "0.6774119", "0.6727233", "0.6706691", "0.67018026", "0.6681632", "0.6656103", "0.6647229", "0.6645504",...
0.74310064
1
Used to add additional assets to be considered when compiling your assets
def add_to_assets(asset_str) append_to_file('config/initializers/assets.rb', "Rails.application.config.assets.precompile += %w( #{asset_str} )\n") unless asset_str.blank? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precompile_assets; end", "def precompile_assets=(_arg0); end", "def add_assets(paths)\n copy_assets(paths)\n characterize_assets\n create_or_update_assets\n end", "def extra_asset_links\n lines = []\n if item.attributes.has_key?(:css)\n for stylesheet in item.attributes[:css]\n ...
[ "0.7377304", "0.72177356", "0.7204855", "0.71728927", "0.7171373", "0.714031", "0.714031", "0.714031", "0.69778085", "0.6976124", "0.6918127", "0.69025934", "0.69012356", "0.6818183", "0.68151057", "0.6813914", "0.67877734", "0.6784348", "0.6774915", "0.6630029", "0.66153955"...
0.7250944
1
Add a specific line to the config/routes.rb file
def add_to_routes(route_str = '') inject_into_file('config/routes.rb', optimize_indentation("#{route_str.strip}\n", 2), after: "\s# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html\n") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_routes m\n file_to_update = 'config/routes.rb'\n line_to_add = \"map.resources :casein_#{controller_file_name}\"\n insert_sentinel = 'CaseinAddRoutes::mapper map'\n gsub_add_once m, file_to_update, \" \" + line_to_add, insert_sentinel\n logger.route line_to_add\n end", "de...
[ "0.74240524", "0.6807506", "0.66621584", "0.6560786", "0.6524357", "0.6517764", "0.64951235", "0.64284015", "0.6424449", "0.6383891", "0.63717604", "0.63510203", "0.63503414", "0.63451463", "0.62634265", "0.62113035", "0.620693", "0.61696994", "0.61264646", "0.60574025", "0.6...
0.7298145
1
Build an instance of ConfigurationInstance
def get_instance(payload) ConfigurationInstance.new(@version, payload) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instantiate_configuration(options={}) #:nodoc:\n Capistrano::Configuration.new(options)\n end", "def configuration\n @configuration ||= configuration_type.new\n end", "def initialize\n @configuration = Configuration.new\n end", "def build(&block)\n # provide access to '...
[ "0.672848", "0.66624016", "0.6656234", "0.643264", "0.6399296", "0.63736844", "0.63736844", "0.6367376", "0.63276356", "0.6311111", "0.6302225", "0.6302225", "0.6297931", "0.62911105", "0.62911105", "0.62911105", "0.62911105", "0.62911105", "0.62911105", "0.62911105", "0.6291...
0.6783076
0
Splices to the pipe from the given source. If maxlen is negative, splices repeatedly using absolute value of maxlen until EOF is encountered.
def splice_from(src, maxlen) Polyphony.backend_splice(src, self, maxlen) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def splice(src, dest, maxlen)\n Polyphony.backend_splice(src, dest, maxlen)\n end", "def readpartial(maxlen=99, buf=\"buffer\") end", "def readpartial(maxlen, buf=nil)\n if maxlen == 0\n if buf\n buf.clear\n return buf\n else\n return \"\"\n ...
[ "0.6756934", "0.5335579", "0.52518076", "0.5160258", "0.5158399", "0.5146615", "0.51364076", "0.5130741", "0.5129564", "0.5129564", "0.5127515", "0.51227415", "0.50734925", "0.50629175", "0.50275797", "0.50035566", "0.50035566", "0.4989617", "0.49786207", "0.48795536", "0.486...
0.723598
1
8. Perfect numbers between 1 to 100
def sample for num in 1..100 sum = 0 for j in 1..num-1 if( num % j == 0 ) sum = sum + j end end if( sum == num ) puts "perfect number : #{num}" end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def problem_six\n (1.upto(100).reduce(:+)) ** 2 - (1.upto(100).map { |n| n ** 2 }).reduce { |sum, n| sum + n }\n end", "def p206\n re = /1.2.3.4.5.6.7.8.9.0/\n max = Math.sqrt(1929394959697989990).floor\n\n # Round since only squares of multiples of 30 and 70 end with 9_0 (e.g. 900)\n i = round_u...
[ "0.7088248", "0.7083985", "0.70444626", "0.6881134", "0.68630105", "0.68528044", "0.6840165", "0.6784488", "0.6782659", "0.67424595", "0.66867125", "0.66520375", "0.66219944", "0.6586693", "0.6554745", "0.6532103", "0.6527514", "0.6527514", "0.6517824", "0.65173745", "0.65070...
0.7134008
0
Public: Initialize a CSS generation / distribution. name A String name that will be used to name a font and stylesheet file. file A String name that will be used to link to the font files. has A zero or more Symbol font types that a stylesheet will use. Valid symbols are: :eot, :svg, :woff, :ttf. Returns the String CSS...
def initialize(name, file, *has) [name, file, has] @has = has @name = name @filename = File.basename(file, '.*') # :nocov: @url = (self.class.relative_from.nil? ? (self.class.link_to ? (self.class.link_to + '/' + File.basename(file)) : file) : (self.class.link_to ?...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def css(file)\n\t\t\t\"<link rel='stylesheet' type='text/css' href='#{file}'>\"\n\t\tend", "def initialize(name,stylesheet)\n @name = name\n @stylesheet = stylesheet\n end", "def initialize(name,stylesheet)\n @name = name\n @stylesheet = stylesheet\n end", "def compile(n...
[ "0.6177854", "0.5792176", "0.5792176", "0.575686", "0.57238257", "0.56745803", "0.56512165", "0.56038404", "0.5405856", "0.53903514", "0.53752583", "0.5373458", "0.5315361", "0.52358884", "0.5209652", "0.52000433", "0.5186539", "0.51644284", "0.5153708", "0.5152381", "0.51429...
0.6157282
1
Internal: (Re)Create a CSS file and write code there. dir The String directory path to write CSS file to. Returns the css file just written.
def write(dir) @dir = FileUtils.mkdir_p dir @css_file = File.join(@dir, @filename + '.css') File.delete(@css_file) if File.exist?(@css_file) @output = File.open(@css_file, 'w') { |file| file.write(@result) } @css_file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile(dir)\r\n\tsavedir = Dir.pwd\r\n\tDir.chdir(dir)\r\n\r\n\t# 中間ファイル削除\r\n\tclean\r\n\r\n\t# 個別ファイルコンパイル\r\n\tDir::glob(\"*.pdf\").each do |file|\r\n\t\tnext if \"nzmath_doc\" == file[0...-4]\r\n\t\ttex_compile(file[0...-4])\r\n\tend\r\n\r\n\theader_footer = [\"header_overview.tex\", \"header_basic_util.t...
[ "0.5898902", "0.57185215", "0.567795", "0.5611694", "0.5572777", "0.5522076", "0.5483323", "0.5462372", "0.5448493", "0.53976876", "0.53748834", "0.52758175", "0.5220733", "0.5174061", "0.517192", "0.5120866", "0.5098613", "0.5077205", "0.5077205", "0.5076975", "0.50692004", ...
0.8405349
0
Public: Use template to fill placeholders with relevant values. Returns the String containing a CSS stylesheet code.
def make_css template = ERB.new TEMPLATE result = template.result binding (0..3).each { result.gsub!(/\n;\n/m, ";\n") } @result = result.gsub /^$\n/, '' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assemble_css\n renderer = Liquid::Template.parse(@stylesheet.data)\n renderer.render(global_template_data, :filters => liquid_filters)\n end", "def css(*args); end", "def css(*args); end", "def css(*args); end", "def css(*args); end", "def to_css\n css = '('\n css << resolved_name\n ...
[ "0.63095415", "0.5806732", "0.5806732", "0.5806732", "0.5806732", "0.578862", "0.5722213", "0.56791705", "0.5675144", "0.56462574", "0.56446165", "0.5600719", "0.55762386", "0.55540633", "0.5548197", "0.5528408", "0.5481213", "0.5472172", "0.5458201", "0.5441029", "0.5410685"...
0.72517484
0
GET /opinion_reports GET /opinion_reports.json
def index @opinion_reports = OpinionReport.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reports\n @node = resource\n @reports = params[:kind] == \"inspect\" ? @node.reports.inspections : @node.reports.applies\n respond_to do |format|\n format.html { @reports = paginate_scope(@reports); render 'reports/index' }\n end\n end", "def index\n @reports = Report.all\n\n respond_...
[ "0.676599", "0.6744532", "0.67176515", "0.6636575", "0.66225827", "0.659227", "0.65313697", "0.6501744", "0.64977497", "0.6422435", "0.6414742", "0.6414742", "0.6414742", "0.6414742", "0.6414742", "0.6414742", "0.6414742", "0.6414742", "0.6414742", "0.6414742", "0.6414742", ...
0.7774515
0