query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
cd421a9f3c2167c17a2e1fe9a7ffbac8
Check whether game has been lost by the player currently on the move in the specified state
[ { "docid": "c36cf90a3e26841ba0af9197029f7f7f", "score": "0.7487401", "text": "def lost?(state)\n # Fill this in\n end", "title": "" } ]
[ { "docid": "c336e29e3102de685cfdcaec79edb026", "score": "0.804565", "text": "def lost?(state)\n pieces = state[:pieces]\n player = state[:player]\n pieces[player].empty?\n end", "title": "" }, { "docid": "0670883207080626873851ff2227ed39", "score": "0.7997427", "text": "def...
96ded32b7ab2b210c4d58f2538c3cd42
returns array of crop_type instances that match the farmer's season
[ { "docid": "63944a3dfe63dda313f6597063ebc297", "score": "0.74108356", "text": "def crops_in_season\n CropType.where(\"season = ?\", self.season)\n end", "title": "" } ]
[ { "docid": "cd1308c8bba7bb14d1cbb4756734476f", "score": "0.6078872", "text": "def new_episodes( season )\n return @seasons[season][1].flatten\n end", "title": "" }, { "docid": "f8c931a0b9137819159fce30ac577572", "score": "0.57701206", "text": "def episodes( season )\n re...
5c1d0608a75aa9c43c8718f00941fc61
Given a username, return First and Last names
[ { "docid": "7fdf04ced64d82a8c68977c66df7c618", "score": "0.73456997", "text": "def name_of_user(username)\n username.split('.').map(&:capitalize)\n end", "title": "" } ]
[ { "docid": "62815bbc616a37b0a6fddffb5e8cd463", "score": "0.780366", "text": "def name\n if first_name.present? || last_name.present?\n [first_name, last_name].join(\" \").strip\n else\n username\n end\n end", "title": "" }, { "docid": "a831b5112e6601c81dc6dfe30f08492a", ...
2365c090fadd32e80e61311bfec1e141
end modify_or_create_user modify or create eleve
[ { "docid": "18b36b29d9ae8f95140cb9c530d1c72b", "score": "0.6290354", "text": "def modify_or_create_eleves(data) \n # Example data: \n #COMPTE profil eleve: \n #{\"profil\"=>\"ELEVE\", \"id_sconet\"=>\"1035780\", \"id_jointure_aaf\"=>\"2414273\", \n # \"nom\"=>\"AISSOU\", \"prenom\"...
[ { "docid": "4e0366a145d2b58d03b031e4970734e0", "score": "0.71457106", "text": "def create_or_update_local_user provider, user_data\n raise 'not implemented'\n end", "title": "" }, { "docid": "a8360d1d265c8da627d1318bf318a549", "score": "0.6880748", "text": "def create_or_update_u...
aac199edde022419bb8838ade6d066d1
=> return ends_at format hour:minutes
[ { "docid": "46a9bae0b89c4dc19bcee1dba0a58229", "score": "0.70262295", "text": "def end\n ends_at.strftime(\"%R\")\n end", "title": "" } ]
[ { "docid": "d0ea036514037fafc5cd53aa076efc1c", "score": "0.7857584", "text": "def ends_at\n starts_at + minutes.minutes\n end", "title": "" }, { "docid": "3f2eac3784281850ce0fa4e0ed6b7b46", "score": "0.72400296", "text": "def end_time(*args)\n raw = ends_at || shift.ends_at\n ...
41cc678428b4614e51fd0fb3a152b95e
save order? 1. save frequency for each character 2. iterate freq if count is one return key
[ { "docid": "f6be6a0bdd4b6a21eea8083269c4ae0b", "score": "0.66338944", "text": "def non_repeating(s)\n freq = Hash.new\n\n # 1) save frequency for each character\n for i in 0...(s.length)\n char = s[i]\n if freq[char].nil?\n freq[char] = 1\n else\n freq[char] += 1\n end\n end\n\...
[ { "docid": "7c5d87bf06b7329476ba39ff3f12b15a", "score": "0.75526834", "text": "def char_frequency\n hits = {}\n self.each_byte {|c| hits[c.chr] ||= 0; hits[c.chr] += 1 }\n hits.to_a.sort {|a,b| b[1] <=> a[1] }\n end", "title": "" }, { "docid": "3a2764f2b92cc334ee06475846451f88", ...
9593ef901be534c09b1379a0d9fa03a4
Print "Brands" in ascii art
[ { "docid": "be3d2586dcde044bbeaed851ac071fb1", "score": "0.0", "text": "def make_brands_section\n\tbrands = $products_hash[\"items\"].map {|toy| toy[\"brand\"]}.uniq\n\tbrands.each do |brand|\n\t\t$same_brand = $products_hash[\"items\"].select {|toy| toy[\"brand\"] == brand}\n\t print_brand_name brand\...
[ { "docid": "1bcbbd492f70735bd0fae0bf1ab64317", "score": "0.7761194", "text": "def print_brands\n\treturn \"\n ____ _ \n | __ ) _ __ __ _ _ __ __| |___ \n | _ \\\\| '__/ _` | '_ \\\\ / _` / __|\n | |_) | | | (_| | | | | (_| \\\\__ \\\\\n |____/|_| \\\\__,_|_| |_|\\\\__,_|___...
fb2e1eed49d66fa6ee561014c70b1e4f
GET /harvestings GET /harvestings.json
[ { "docid": "0af92e0143930abde8dae8f16a937365", "score": "0.7061671", "text": "def index\n if params[:harvest_id]\n @parent = Harvest.find(params[:harvest_id])\n @harvestings = @parent.harvestings\n elsif params[:person_id]\n @parent = Person.find(params[:person_id])\n @harvesti...
[ { "docid": "381f228778d3343e3e046de490404528", "score": "0.7933294", "text": "def index\n @harvestings = Harvesting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvestings }\n end\n end", "title": "" }, { "docid": "9a4bdc306...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "4d325c71ca38e50b7c4ef0e289adca1e", "score": "0.0", "text": "def new_input_set()\n return DeleteBloodPressureLogInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.6741255", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65807736", "text": "def new_input_set()\n return Ru...
c8b4d68b2934317f3f5e7a0e0f36f0f7
create path of distanation and make link
[ { "docid": "54061ccb63cc15e3af9282d7cdd451f6", "score": "0.6520761", "text": "def slink node, p2\n link_dir, link_name = split_path p2\n mkdir link_dir unless link_dir == ''\n link node, link_dir, link_name\n end", "title": "" } ]
[ { "docid": "53891801986564cd3a38a1b59f13c091", "score": "0.7328312", "text": "def create_symlink(dest_path); end", "title": "" }, { "docid": "2b713e0d603abeb40321a06338a3be8a", "score": "0.7153519", "text": "def make_link(inside, from, to)\n Dir.chdir(inside) do\n from.gsub...
901adc1d2d3d4c75c859589cf9d29c28
STATUS Indica si el estado del evento es Abierto
[ { "docid": "d15cb37b13e6566f949066805f2c8672", "score": "0.67617613", "text": "def open?\n event_status_id == 1\n end", "title": "" } ]
[ { "docid": "c4bfadbade33b17785afb79743f68cfd", "score": "0.6752672", "text": "def status\n\t\t\t\ttrue\n\t\t\tend", "title": "" }, { "docid": "9fba60c778bcd24be8ac47b92f13342e", "score": "0.6708487", "text": "def status\n case @status\n when 0 then :off\n when 1 then :on\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ca54320371d1df3443e0d37f9023c757", "score": "0.0", "text": "def set_ballonfahrer\n @ballonfahrer = Ballonfahrer.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
fc52b807260118f2295d7730b225c081
Return current user or raise error
[ { "docid": "b48a3d32391050259317d15453e11b1f", "score": "0.7577938", "text": "def current_user\n user = User.find_by(id: session[:user_id])\n raise AuthenticationError.new if user.nil?\n user\n end", "title": "" } ]
[ { "docid": "ca20bc7ac50dcd80639bc35f28dba112", "score": "0.8128321", "text": "def user\n current_user rescue @user\n end", "title": "" }, { "docid": "f1c975e0323490444fbe9e2c8b0d4674", "score": "0.8071183", "text": "def current_user!\n raise User::RecordNotFound unless current...
5ee6a919e3a2c5c48a31cf684cc044c6
TODO should change id to title since links will be handled by title not id ++ displays a new note Inputs: [id] +Fixnum+ of the id of the note
[ { "docid": "9fbd675f17abb1088d3a3dd9103b3a68", "score": "0.6343338", "text": "def show( id )\n note = Note.find id\n\n @text_stack.clear do\n tokens = Scanner.scan( note.body )\n root_node = Parser.parse( tokens )\n eval_string = WalkTreeShoes.walk_root( root_node )\n puts eval...
[ { "docid": "c5bde34a1049ad017b8a2643daa08a86", "score": "0.65778416", "text": "def note_detail(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"notes/#{id}\", params)\n end", "title": "" }, { "docid": "fb8f2cf3ed4e2a6a3b...
815236a643bdaea551f9ed682d474c2f
POST /walls POST /walls.xml
[ { "docid": "d7d93bbda12949e428be5d9a87451958", "score": "0.0", "text": "def create\n @wall = Wall.new(params[:wall])\n @wall.doctor_id=current_user.person.id\n @appointments=Appointment.where(:doctor_id=>@wall.doctor_id, :dateapp=>@wall.dateini,:timeapp=>@wall.hourini, :status=>'Scheduled')\n ...
[ { "docid": "8be9f7a6aca6e7c076484f12461d70aa", "score": "0.66245764", "text": "def create\n @wall = current_user.walls.new(wall_params)\n\n respond_to do |format|\n if @wall.save\n format.html { redirect_to @wall, notice: 'Wall was successfully created.' }\n format.json { render...
4375b61cfebe471a3dce07ac151ddd7d
Depending on the type of the argument, either adds a number to each coordinate or adds two points.
[ { "docid": "78456e4b3a0683c42741397fe38123fa", "score": "0.6375268", "text": "def +(other)\n case other\n when Point\n Point.new(x + other.x, y + other.y)\n when Numeric\n Point.new(x + other, y + other)\n when Array\n self + Geom2D::Point(other)\n else\n ...
[ { "docid": "ff1bf1853e0cbc9d5468d37943ce1700", "score": "0.6679734", "text": "def add!(x=0,y=0,z=0)\n if x.kind_of? Numeric\n set(@x+x, @y+y, @z+z)\n elsif x.point3_like?\n add! x.x, x.y, x.z\n else\n raise_no_conversion x\n end\n end", "title": "" }, ...
fa8c6fba39632200bd78d22b728f2f9b
move_left mode flag for overriding check turning flag Moves. (pixel movement)
[ { "docid": "14f25586d81ac180559e62a86be65b57", "score": "0.8129233", "text": "def move_left(mode = true, check = false)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # which type of moving\n case mode\n # override and set moving route\n when 0 then rand(pix*2).times{@force_move....
[ { "docid": "ee46b9b78061152634b4e5a4559e3eb5", "score": "0.8002536", "text": "def move_left(mode = true, check = true)\n mode == 0 ? move_generic(mode, check, 4) : super(check)\n end", "title": "" }, { "docid": "e13408ace104a0c0bb47e22378acd36c", "score": "0.765907", "text": "def...
8df9e898c86fd2181bf90f9da0378510
POST /backend/meetings POST /backend/meetings.xml
[ { "docid": "28707ac181240ea800612c41644172b8", "score": "0.6834929", "text": "def create\n @backend_meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @backend_meeting.save\n format.html { redirect_to(backend_meeting_path(@backend_meeting), :notice => 'Meeting was ...
[ { "docid": "a617a369ed477cc52d90eae61426d185", "score": "0.6647813", "text": "def create\n @meetup = Meetup.new(params[:meetup])\n @meetup.staff_id = current_staff\n @meetup.status = PLANNED\n\n respond_to do |format|\n if @meetup.save\n format.html { redirect_to meetups_path }\n...
9c931dda2554aee40209be0f15241ca4
GET /elements or /elements.json
[ { "docid": "85efa2ad26a903342cb7147fbab7d39f", "score": "0.6146962", "text": "def index\n @elements = Element.all\n end", "title": "" } ]
[ { "docid": "26dbbeff2f146b457c39e36d441cb342", "score": "0.71765834", "text": "def index\n @elements = Element.all\n render json: @elements\n end", "title": "" }, { "docid": "a8e7de780f2dc583406d52b8d450f5d4", "score": "0.7044289", "text": "def index\n @elements = Eleme...
35ebd59de1ec41deec7b9f44b672dbea
begin Gets the job departemnt using CSS selectors for the given page
[ { "docid": "752b27999683022ddafd7014c9c9c683", "score": "0.7430633", "text": "def get_department(page)\n page.css(WebScraper::JOB_INFO_SELECTOR)[WebScraper::JOB_DEPT_POS].content.strip\n end", "title": "" } ]
[ { "docid": "36eef9b886296b7002970de7a2a85865", "score": "0.6563119", "text": "def get_department_pages\n return [Nokogiri::HTML(open('https://www.sis.hawaii.edu/uhdad/avail.classes?i=MAN&t=201430&s=ICS')).css(\".listOfClasses\").to_s,\n Nokogiri::HTML(open('https://www.sis.hawaii.edu/uhdad...
f4e6222cd59951a8319953baa3f924c5
GET /sport_levels/1 GET /sport_levels/1.json
[ { "docid": "f66b28a24cbd1e211a3cf24d8171c0e5", "score": "0.63104224", "text": "def show\n @sport_level = SportLevel.find(params[:id])\n render :layout => nil\n end", "title": "" } ]
[ { "docid": "de00b958a8794eb8efbd79ded80c02b7", "score": "0.75219893", "text": "def sport_level_list\n @sport_levels = SportLevel.find_by_user(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @sport_levels }\n end\n end", "...
ca7efa6f10efaa878a61c3033a62e1e6
GET /internship_instances/1 GET /internship_instances/1.xml
[ { "docid": "c817bef0b10e88075fd1caf5bab2c5a9", "score": "0.72875386", "text": "def show\n @internship_instance = InternshipInstance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @internship_instance }\n end\n end", "titl...
[ { "docid": "8ac30b00adc7f80efe49d4e06f030df2", "score": "0.72478193", "text": "def index\n @internship_instances = InternshipInstance.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @internship_instances }\n end\n end", "title": "" }...
c9d41fe6817c0a0c484ed7e88bc47db6
GET /ad_matrix_categories/1 GET /ad_matrix_categories/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9d86d42f292b4988e517f6b03d747383", "score": "0.7484336", "text": "def index\n @ad_matrix_categories = AdMatrixCategory.all\n end", "title": "" }, { "docid": "04779fc6a7223751fb3e79f2b7a6f82c", "score": "0.6854937", "text": "def get_categories\r\n categories = Taxon...
930332ee9fc3c426cf5c64b955540e4c
Join all the category strings into a commaseparated string.
[ { "docid": "489ca05860cab08edb19591ed8b14340", "score": "0.7067317", "text": "def join_categories(categories)\n categories.reduce([]) { |union, category| union | category.values.map(&:downcase) }.join(\",\")\nend", "title": "" } ]
[ { "docid": "54b211a7a1cb504299340e704cd4d317", "score": "0.6974244", "text": "def get_some_category_name\n result = ''\n i = 0\n curriculum_categories.each do |category|\n if i.eql?0\n result += category.category_name\n else\n result += ','+category.category_name\n ...
aafceaf62c80943ebfb857ab072d661a
Perform an atomic $pullAll operation on the matching documents.
[ { "docid": "1c9195804ffb5e8db09213610d814c67", "score": "0.7500418", "text": "def pull_all(pulls)\n view.update_many(\"$pullAll\" => collect_operations(pulls))\n end", "title": "" } ]
[ { "docid": "2eb491a8df03e961d28767117b74ceb9", "score": "0.8113981", "text": "def delete_all\n atomically(:$pull) do\n set_collection\n count.tap do\n filter.each { |doc| doc.delete }\n end\n end\n end", "title": "" }, { "docid": "576f...
c9955336af4d6c29b053f7cfacc5bf7a
returns the distance between two cells
[ { "docid": "0bd743fc5582450feb30505fbdd74122", "score": "0.6142092", "text": "def manhattan_distance(start_row, start_col, end_row, end_col)\n (end_row - start_row).abs + (end_col - start_col).abs\n end", "title": "" } ]
[ { "docid": "d0ddeee1b88eebde4cec8c5982d47965", "score": "0.8572944", "text": "def find_distance_between(cell1, cell2)\n if cell1.nil? || cell2.nil?\n return 0\n end\n\n if cell1.col == cell2.col || cell1.row == cell2.row\n return ((cell1.row - cell2.row) + (cell1.col - cell2.col)).abs...
87a9396f4ea1ebc74e5fbbdf0fb2d439
register a remove event action
[ { "docid": "a7fcbe82fa5607ea8e59d249e25c147e", "score": "0.6766247", "text": "def remove(trigger, action)\n trigger.java_send :registerAction, [Java::com::eventswarm::RemoveEventAction.java_class], java_object(action)\n end", "title": "" } ]
[ { "docid": "a36dfbcbf8c9309efdbf083ea8be5b68", "score": "0.79986686", "text": "def on_remove\n\n end", "title": "" }, { "docid": "74e72460d6b6720fd8830c7c1ec284ff", "score": "0.79901206", "text": "def on_remove\n #override if you want to do something on this event\n end", ...
c70fffdf12d341bcf1b29d000c3702df
GET /events/1 GET /events/1.json
[ { "docid": "66513fb4ef7b7a451803b7424d989324", "score": "0.0", "text": "def show\n if params[:format] == \"img\"\n @img_url = EventBanner.find(params[:banner_id]).file.path\n if Rails.env == \"development\"\n send_file @img_url, :type => 'image/jpeg', :disposition => 'attachment'\n ...
[ { "docid": "2d5580b43c7c18bcd8a06713fa4be0f1", "score": "0.75926495", "text": "def show\n\t\tevent_id = params[:id]\n\t\tif event_id.present?\n\t\t\t@event = Com::Nbos::Events::Event.active_events.where(:id => event_id)\n\t\t\trender :json => @event\n\t\telse\n\t\t\trender :json => {status: 400, message...
c088202dc0c45c55dc47438e2d249804
Agrega alumnos al grupo, que esten sin grupo, se pueden filtrar con la busqueda
[ { "docid": "82c946167ced9d06abbcec9e5997fa91", "score": "0.54103947", "text": "def agregar_alumnos\n @grupo = Grupo.find(params[:id])\n if request.get?\n @alumnos = Alumno.alumnos_sin_grupo(params[:buscar])\n end\n if request.put?\n unless params[:alumno_ids].nil?\n @alumnos...
[ { "docid": "b80b693a211f648a27ce402f2828bdf5", "score": "0.6321125", "text": "def mostrar_palabras_clave_grupos \n \n puts \"Esta operación puede tardar un poco, le rogamos tenga paciencia por favor.\"\n puts\n puts\n coleccion = @hemeroteca.palabras_clave_grupos \n coleccion....
36f93107654312f503fc37c63dffe8ab
PATCH/PUT /datos_usuarios/1 PATCH/PUT /datos_usuarios/1.json
[ { "docid": "34fcbc609d39dd2a80ea8b75caf219b8", "score": "0.6692051", "text": "def update\n respond_to do |format|\n if @datos_usuario.update(datos_usuario_params)\n format.html { redirect_to @datos_usuario, notice: 'Datos usuario was successfully updated.' }\n format.json { head :n...
[ { "docid": "9d91fe8ffe79c0ce9f854a7339dc24d6", "score": "0.7016392", "text": "def update\n #response.headers['Content-Type'] = 'application/json'\n\n if Usuario.exists?(params[:id])\n usuario = Usuario.find(params[:id])\n n_param = JSON.parse(request.body.read)\n\n #request.req...
127b6d49303193712445ca650caca596
Return name of file system
[ { "docid": "77af067b5d3bad0f48cc2e6372ce50c9", "score": "0.651003", "text": "def get_filesystem\n @@current_fake ? @@current_fake[:filesystem] : ''\n end", "title": "" } ]
[ { "docid": "1f54005691dd72574fb6267221f5f7ba", "score": "0.767065", "text": "def name\n\t\t\"Stdapi: File system\"\n\tend", "title": "" }, { "docid": "cf0b14a6809d1818ec78e82e088d5193", "score": "0.6864035", "text": "def name\n File.basename(@root)\n end", "title": "" }...
d02274ed4a248342ae22e4722b7a7cf5
Return true if the hand is a bust
[ { "docid": "927228cfff8a76ee20d6fa2ee9543ce8", "score": "0.6693988", "text": "def is_bust\n self.update_points\n if @points > 21\n return true\n else\n return false\n end\n end", "title": "" } ]
[ { "docid": "cd6cbb8721ef876fc2d812a409f74c8d", "score": "0.8509246", "text": "def busted?\n self.hand.busted?\n end", "title": "" }, { "docid": "dc8b062427d41efa26f08306cf396951", "score": "0.8430949", "text": "def bust?(hand)\n hand.total > 21\n # From Demetra: this will r...
d538f3af74c937906ea9449464b493f8
POST /cotizaciones POST /cotizaciones.json
[ { "docid": "9bbc45fca79da2d36828649f6a341286", "score": "0.6722342", "text": "def create\n @cotizacione = Cotizacione.new(cotizacione_params)\n\n respond_to do |format|\n if @cotizacione.save\n format.html { redirect_to @cotizacione, notice: 'Cotizacione was successfully created.' }\n ...
[ { "docid": "52f3f6d2cd935e511c15b789adecb251", "score": "0.6617825", "text": "def cotizacione_params\n params.require(:cotizacione).permit(:token, :paqueteria, :producto, :precio)\n end", "title": "" }, { "docid": "ee226da0ece4da26429fb1e43fbb7624", "score": "0.6404725", "tex...
bcaad86c06c182c98e94d76b636c0a94
these should be moved to a helper function or maybe be an extension of the String class
[ { "docid": "1edda59bcbfb615a67d68c3dac6bd208", "score": "0.0", "text": "def float_val?(val)\n !!(val =~ /\\A[-+]?\\d+(\\.\\d+)?\\z/)\n end", "title": "" } ]
[ { "docid": "325ffadb3e3b7a5846f3c5804435e216", "score": "0.7012156", "text": "def string(str); end", "title": "" }, { "docid": "3125932334f0c2647ed666cf211b57cb", "score": "0.68459797", "text": "def str(str); end", "title": "" }, { "docid": "3125932334f0c2647ed666cf211b57...
a7b38b802e9595749ff07cce26e250ef
Method to set up a binary tree with an array of data and display the tree
[ { "docid": "a06226ee8d883c488597381ffe1a3b6e", "score": "0.7623716", "text": "def set_next_binary_tree(tree, arr)\n puts \"\\n=======================================================================\"\n puts \"=======================================================================\"\n puts \"=========...
[ { "docid": "ae0e39c49226840903fcbb1980610c18", "score": "0.7529211", "text": "def build_tree(array)\n @root = Node.new(array.shift)\n array.each do |i|\n insert(@root,i)\n end\n end", "title": "" }, { "docid": "8cfe532992c2714865acf32e325366ab", "score"...
a25b05b0e24d4dc15026c5773f843da2
Exercise 5 Reverse Write a function reverse(string) that takes in a string and returns it reversed.
[ { "docid": "7aefee03610d3c0b7226f4acd6c69306", "score": "0.0", "text": "def reverse(string)\n return string if string.length <= 1\n reverse(string[1..-1]) + string[0]\nend", "title": "" } ]
[ { "docid": "d14471b5a64486b09658bfff828f2bfa", "score": "0.83787835", "text": "def reverse(string)\n\nend", "title": "" }, { "docid": "d14471b5a64486b09658bfff828f2bfa", "score": "0.83787835", "text": "def reverse(string)\n\nend", "title": "" }, { "docid": "d14471b5a64486...
4739881ce9f6e462fb26f1cef0e52979
initializes this MDN_OAuthToken with a json hash
[ { "docid": "63f8151859fb9d0988ac9f65d4c1925a", "score": "0.63286537", "text": "def init_jaxb_json_hash(_o)\n if !_o['verifier'].nil?\n _oa = _o['verifier']\n if(_oa.is_a? Hash)\n @verifier = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n ...
[ { "docid": "3c393fcc6ffb9e6794c21c2306676289", "score": "0.7491736", "text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @accessToken = extract_value(hash, :accessToken)\n @clientId = extract_integer_value(hash, :cl...
0106aeb6cf0a242b587ac1997b7a0cc2
This action is to list all the quizzes in our database. We access it with GET request to "/quizzes"
[ { "docid": "217a76d89b2b02311039421c3d0ee7c6", "score": "0.73658705", "text": "def index\n @quiz = Quiz.all\n end", "title": "" } ]
[ { "docid": "7bbb9095b85b33efc257d8d546039af4", "score": "0.8432245", "text": "def index\n @quizzes = Quiz.all\n end", "title": "" }, { "docid": "eaddf9f2c7c4356050fa5a54fb8d3374", "score": "0.84190214", "text": "def index\n @quizzes = Quiz.all\n end", "title": "" ...
8e2bdadaf2d911cea23981af4f46ebc9
NOTE: you can't change the region once the bucket is created
[ { "docid": "ff968142268e2a70507e5274d1bbb824", "score": "0.0", "text": "def location=(new_location)\n new_location = 'oss-' + new_location unless new_location.start_with?('oss-')\n @location = new_location\n end", "title": "" } ]
[ { "docid": "a8768b6bdab531d909cdb2a45bb36e02", "score": "0.76994586", "text": "def default_bucket_region(region)\n @cycler.bucket_region = region\n end", "title": "" }, { "docid": "0eb2f2d3457ad542dac2b74447050cb9", "score": "0.7334912", "text": "def create?(region)\n @bucket....
7db1dbfbd4fa715084e8b20b21547124
Returns the value of attribute main_sort_running_order. source://rbzip2//lib/rbzip2/ruby/output_data.rb10
[ { "docid": "b22b3546c20a91573ef3c2c8c18b3a0f", "score": "0.68569183", "text": "def main_sort_running_order; end", "title": "" } ]
[ { "docid": "0e430f1b16e58d6768f7fda8c0b3afd1", "score": "0.6279808", "text": "def value\n requested_sort[:key]\n end", "title": "" }, { "docid": "608c0bd1eb79ce5c614dfa7b3155b749", "score": "0.62518215", "text": "def sort_order\n return @sort_order\n ...
c5eba075eb0dbb4fd6a1692ec452b7a8
MySQL supports ORDER and LIMIT clauses in UPDATE statements.
[ { "docid": "b3e8a38a1e1ab027baaeb87ba9f7acd8", "score": "0.684847", "text": "def update_sql(values, opts = nil, &block)\n sql = super\n opts = opts ? @opts.merge(opts) : @opts\n\n if order = opts[:order]\n sql << \" ORDER BY #{column_list(order)}\"\n end\n if ...
[ { "docid": "320965acea764888495193383eb4bd3d", "score": "0.6060693", "text": "def _update_sql\n clause_sql(:update)\n end", "title": "" }, { "docid": "8fbec19e369f1a9d919bafe87eda2421", "score": "0.6052184", "text": "def _execute_position_update!(sql, async: false)\n ...
58a14a6350d7e30f540ce2d1d1f5854b
def _print_da_results_headers Diagnostic Test Results are different from Standard Extraction. The measurements are always the same. There's currently no customization permitted. This may change in the future. This will return an array of measure names to use in the header. returns Array
[ { "docid": "2225a0c2fd717b2170aeb5c7627a1ccd", "score": "0.0", "text": "def _lsof_measures_in_rss(rss_type)\n case rss_type\n when :descriptive_statistics\n rsstms = ResultStatisticSectionTypesMeasure\n .where(result_statistic_section_type_id: 5, default: true, type1_type_id: ni...
[ { "docid": "7b1c2608f7a2dd514944d1470f50cbfa", "score": "0.61777866", "text": "def expected_results\n return self.product_test.measure_defs.collect do |measure|\n expected_result(measure)\n end\n end", "title": "" }, { "docid": "7d8ae2e1ca73b9b8a6546ca3bc77f6c8", "score": "0....
81348be91725d09e801318391806c31a
Return Trainers that are nearby and have live kudomon
[ { "docid": "9d7ebc48359221f49e611e33549f2c42", "score": "0.798703", "text": "def challengeable_trainers\n other_trainers = Trainer.all.reject { |trainer| trainer == self }\n other_trainers.select do |trainer|\n trainer.nearby?(coordinates) && trainer.live_kudomon?\n end\n end", "title...
[ { "docid": "1bc97dcd3e3b34aaf501464e22faef58", "score": "0.63523656", "text": "def trainees\n users = []\n ongoing_trainings.each do |t|\n users << t.user unless t.is_trainer?\n end\n users.sort { |a,b| User.sort_value(a) <=> User.sort_value(b) }\n end", "title": "" }, { "d...
14bd3eea046832e02f6ef6815060f3d7
indicates whether this view has to be rendered inside a component
[ { "docid": "41011044b492b24840a6a8c68bedf6c6", "score": "0.0", "text": "def has_container?\n !container.nil?\n end", "title": "" } ]
[ { "docid": "bd64189e3237f081dc0319b9edd5671d", "score": "0.72424734", "text": "def component?\n !!@component\n end", "title": "" }, { "docid": "81619635988c6c2d793d55079cb7bb3d", "score": "0.7234283", "text": "def component?\n @object.labeled?(:ui)\n end", "ti...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8fc4adc1a69772a07d841daa530ed09f", "score": "0.0", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
958136479b07448652d7c7a4f8b4b942
DELETE /admin/jobs/1 DELETE /admin/jobs/1.json
[ { "docid": "825484eae9a905e95c59a6b3002cca72", "score": "0.79554325", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to admin_jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "66db0ef98d50e458b6aaead27c514ac5", "score": "0.8001244", "text": "def delete(args)\n options = { body: args, basic_auth: { username: @api_key } }\n Try { self.class.post(\"/api/jobs/delete.json\", options) }.to_either >-> response {\n if response.code == 200\n Right...
8e46fddb95e220f55b119a7041547571
[3,4,6,1] 3 + 4 = 7 3 + 6 = 9 3 + 1 = 4 4 + 6 = 10 4 + 1 = 5 6 + 1 = 7
[ { "docid": "0008bc55f0a054ae15539cb5a5eba2bb", "score": "0.0", "text": "def sumTwo(array, sum)\n\tfor i in 0..array.length-2\n\t\tn1 = array[i]\n\t\tn2 = array[i+1]\n\t\tif n1 + n2 == sum\n\t\t\toutput = [n1, n2]\n\t\t\tbreak\n\t\tend\n\tend\n\toutput ||= \"no pairs sum to this input\"\n\tputs \"#{outpu...
[ { "docid": "354acc44d23902170d18ef50bb27f5b1", "score": "0.6858116", "text": "def dynamic_programming(sorted)\n acc = { sorted.length - 1 => 1 }\n result = 1\n (2..sorted.length).each do |offset|\n (sorted.length - offset + 2...sorted.length).each do |index|\n break unless sorted[index] - sor...
063389526a1df2178b2262a561203520
The total duration of the replayed data, in seconds
[ { "docid": "b208be933411e58db80c163d0804405d", "score": "0.0", "text": "def duration\n intervals = used_streams.map { |s| s.info.interval_lg }\n min = intervals.map(&:first).min\n max = intervals.map(&:last).max\n if min && max\n ...
[ { "docid": "32a2bebc7cdb4f32b204d08756d08ac9", "score": "0.79164404", "text": "def total_duration; end", "title": "" }, { "docid": "32a2bebc7cdb4f32b204d08756d08ac9", "score": "0.79164404", "text": "def total_duration; end", "title": "" }, { "docid": "b338fe16c2e56e0414ce...
ef893008b4e080829b72502070536337
separates args into tag or subcommand and items This allows user to pass e.g. a priority first and then item list or item list first and then priority. This can only be used if the tag or pri or status is nonnumeric and the item is numeric.
[ { "docid": "120170b1c8ef7dd7a338c892a5b21c08", "score": "0.6175047", "text": "def _separate args, pattern=nil #/^[a-zA-Z]/ \n tag = nil\n items = []\n args.each do |arg| \n if arg =~ /^[0-9\\.]+$/\n items << arg\n else\n tag = arg\n if pattern\n die \"#{@...
[ { "docid": "8299e0a77b11ed5b499bae3e819087cb", "score": "0.5704439", "text": "def preprocess_arguments_for_commands(args)\n # All arguments should be passed through to the atlantis command.\n if args.first == \"atlantis\"\n return args.slice!(1..-1)\n end\n if args.first == \"ssh\"\n arg_index...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f71344478ed87533b34c8a3c7c3660ee", "score": "0.0", "text": "def set_djcat\n @djcat = Djcat.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
b83c101c76c9a72cbe7a9ab5ce2a411b
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Draw Data data_type : the data block to draw next ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ { "docid": "dc4625edfa7669f6bb44a4a7aa5d471c", "score": "0.74938154", "text": "def draw_data(data_type)\n @maqj_font_data_type = data_type\n reset_font_settings\n send(:\"draw_#{data_type}\") if self.class.method_defined?(:\"draw_#{data_type}\")\n @draw_y += data_height(data_type)\n end", ...
[ { "docid": "d5bdf726c20ccf517a108a32b0820b07", "score": "0.6572497", "text": "def draw_data?(data_type)\n case data_type\n when :line then true\n when :level then @quest.level > 0 \n when :objectives then !@quest.revealed_objectives.empty?\n when Array then (data_type - [:line]).any? { |d...
5f5538dd28b3882589ef7d74723738e0
Get common channel information. This method returns a common set of channel data, for use by the access keys. The hash returned by this method contains the following keys: :channel_title A string containing the channel title. :channel_id A string containing the channel identifier. :channel_description A string containi...
[ { "docid": "2102dc5c7aa5dfabe22476b4e06b094c", "score": "0.6850354", "text": "def get_channel_info(user_id = nil)\n response = self.get_channel_data(user_id, {\n :part => [ :contentDetails, :snippet ],\n :fields => [ 'i...
[ { "docid": "ec61ff8da9a70aacee82b3155a2c3611", "score": "0.6663863", "text": "def get_channels\n data_hash = retrieve_external_data\n channels_hash = data_hash[\"channels\"] \n channels = build_channels channels_hash\n return channels\n end", "title": "" }, { "docid": "ec0fd2d05...
85db0ca632bd4fc60d85db532e22d335
POST /ies POST /ies.json
[ { "docid": "8d2c139239af11219b9353181890e597", "score": "0.0", "text": "def create\n @category = Category.new(category_params)\n\n # myBucket = 'isaprespdf-informacionisapres-repository.s3.amazonaws.com'\n image = params[:category][:img_url].tempfile\n image_name = params[:category][:img_url...
[ { "docid": "22201f22e629399ac67e583badeab894", "score": "0.58461237", "text": "def post_users_json payload\n\tJSON.parse ( rest_client_request :post, HF_URL, payload ).body\nend", "title": "" }, { "docid": "23764999421105031b1d8b26a9d126b4", "score": "0.5773872", "text": "def create\...
dc3495ae358804a158429fe4d99af02b
POST /lifts POST /lifts.json
[ { "docid": "581733347569accee1d52c6ab52d7879", "score": "0.5391051", "text": "def create\n @lift = @user.lift.build(lift_params)\n @liftsets = params['liftsets']\n\n respond_to do |format|\n if @lift.save\n redirect_to \n else\n format.html { render action: 'new' }\n ...
[ { "docid": "edfb8fb5c63f3788b95d3e3063a5e37b", "score": "0.68366873", "text": "def create\n @lift = Lift.new(params[:lift])\n\n if @lift.save\n render json: @lift, status: :created, location: @lift\n else\n render json: @lift.errors, status: :unprocessable_entity\n end\n end", ...
6982cadfc9d34df4d49b8a06a515d4fa
Move file field data to keywords BY PROJECT for ANY File field (builtin or custom) and tag associated files.
[ { "docid": "8902c2fbfc3ff045628b08ef5476c7dc", "score": "0.69854355", "text": "def move_file_field_data_to_keywords_by_project(project=nil,\n target_keyword_category=nil,\n source_field=nil,\n ...
[ { "docid": "f584761abfa0f149042e6706e42e2031", "score": "0.6275192", "text": "def move_file_keywords_to_field_by_project(project,\n keyword_category,\n target_field,\n ...
1b5b833c954f4a6ca1fddfd9de0170d9
create a file with the name self.git_name into the keydir of the local repo gitosisadmin
[ { "docid": "47be16e1f5657d6515c8b41a394c96bd", "score": "0.731282", "text": "def add_key_to_git\n path =GITOSIS_ADMIN_LOCAL_PATH + \"/keydir/\" + self.git_name.to_s+\".pub\" \n puts path\n File.open(path,'w'){ |f| f.write(self.value)}\n apply_changes(\"Added #{self.git_name.to_s}.pu...
[ { "docid": "cf010b9136bc0a124068e71d569ba91a", "score": "0.6503538", "text": "def create_in_repo(repo, base_dir)\n repo.chdir do\n # do not create if already exists!\n next if (File.exist? base_dir) && (File.directory? base_dir)\n create_dir_for_modelitem(base_dir)\n\n ...
3bc098059349a1e31f95a86f167eaf86
fetch initial from Aspaway
[ { "docid": "c824a06c171ec54b8501f6431f448708", "score": "0.7169366", "text": "def fetch\n AspawayImporter.fetch(@initial_path)\n end", "title": "" } ]
[ { "docid": "eae37117c6d22f08ecf89029793eaea6", "score": "0.6222056", "text": "def fetch\n end", "title": "" }, { "docid": "4cf1dbcd0106243f9d28f81eccaa53df", "score": "0.6135375", "text": "def fetch\n neography\n self\n end", "title": "" }, { "docid": "a...
a6450c675cf20b589e742eaa7f298e2a
GET /bests/1 GET /bests/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "80e9574bf90ff8068900e6f22ae352d4", "score": "0.7182183", "text": "def index\n @bests = Best.all\n end", "title": "" }, { "docid": "afcdc3ea6a73c4cc60fe0ee216373f44", "score": "0.6738199", "text": "def show\n @bestgame = Bestgame.find(params[:id])\n\n respond_to ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9367b2fdf756150c14d4805e2299daab", "score": "0.0", "text": "def set_promotion\n @promotion = Promotion.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163754", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045816", "text": "def action_hook;...
5df92ecf5fd4a3a461f42aa74e64e795
GET /cubes/new GET /cubes/new.json
[ { "docid": "1d86cbf6f04bb91cf7c632560c3b5289", "score": "0.7468796", "text": "def new\n @cube = Cube.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cube }\n end\n end", "title": "" } ]
[ { "docid": "47dc48e4ad78e8f9cc75895963646fdc", "score": "0.74299556", "text": "def new\n @cuba = Cuba.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cuba }\n end\n end", "title": "" }, { "docid": "81e148fb290ca5d7b2ad2270cff2a059...
6e26582c9400672f79d482ae25df2343
GET /higher_education_institutions GET /higher_education_institutions.json
[ { "docid": "20cbbf55675bb91b544e4f24626bf76b", "score": "0.7149614", "text": "def index\n authorize HigherEducationInstitution\n @higher_education_institutions = HigherEducationInstitution.order(:name).search(params[:search]).page(params[:page])\n end", "title": "" } ]
[ { "docid": "2967b0eb6ed7eca2c523512e1df4eb03", "score": "0.6843123", "text": "def get_institutions\r\n # Prepare query url.\r\n _path_url = '/institutions'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query...
c3d4de1b4984acee72914c89b12026be
finds a channel input: aUser_input (String) Returns a found channel (Channel Object)
[ { "docid": "1778cd32d8324cab3e19c380202535d2", "score": "0.8656159", "text": "def find_channel(aUser_input)\n found_channel = nil\n self.channels.each do |channel|\n if (aUser_input == channel.id) || (aUser_input == channel.name)\n return channel\n end\n end\n ...
[ { "docid": "d5a2c08876b3a06e75771f18b4488c98", "score": "0.763307", "text": "def select_channel(user_input)\n @channels.each do |channel|\n if channel.id == user_input\n @selected = channel\n elsif channel.name == user_input\n @selected = channel\n end\n end\n retur...
adfa0d7a94a403ba91f57f6ec591c1c6
list = [ 0, 3, 5, 4, 5, 10, 1, 90 ] p my_min_2(list) => 5
[ { "docid": "cabb940f99bc4de3fb39d010df4f5ade", "score": "0.0", "text": "def largest_contiguous_subsum(list) #O(n ^ 2)\n largest_sum = list.first\n (0...list.length).each do |i|\n (i...list.length).each do |j|\n if j >= i && list[i..j].sum > largest_sum\n largest_sum = list[i..j].sum\n ...
[ { "docid": "ca93761f2aa64b603bae9794e0ffa9b7", "score": "0.87082946", "text": "def my_min_2(list)\n current_min = 0\n list.each do |el|\n current_min = el if el < current_min\n end\n current_min\nend", "title": "" }, { "docid": "0b015fced50d909c0a168a4a825597a2", "scor...
6aaff03eeefc3d4d7853d1655c0d8042
use explicit return statement when you have to
[ { "docid": "30bf267986966c0742d4c3c55ef07ad5", "score": "0.0", "text": "def change_my_name\n name = \"John\"\n name.reverse\n return name\nend", "title": "" } ]
[ { "docid": "dd68931a1a7f77eb4fd41ce35988a9bb", "score": "0.80254245", "text": "def returns; end", "title": "" }, { "docid": "5f8a25b50efbe7dbcbbe60f560fdc30e", "score": "0.7418965", "text": "def return_value; end", "title": "" }, { "docid": "cbfd9f8702c76d3c76641c3a542bc9...
996346535126e40218a7cc94817e0d79
Returns the Redis database file name
[ { "docid": "f0d0507fe488fe8339d3c53492f4f0b5", "score": "0.7608348", "text": "def database\n \"#{ name }.rdb\"\n end", "title": "" } ]
[ { "docid": "d8db4b25fc8b1693e53fdfe78bc5d90d", "score": "0.7666538", "text": "def filepath db_name\n \"#{@path}/#{filename db_name}\"\n end", "title": "" }, { "docid": "a011c8355a676e44937f113719c0441d", "score": "0.7478078", "text": "def filename db_name\n @file || \"#{db_nam...
5e1ea368fbb0046dc42dde2070d9023b
Update quantity of item in order/cart
[ { "docid": "cabb30932daf56c4d9729368efee6f73", "score": "0.0", "text": "def update\n save_update(@order_item)\n end", "title": "" } ]
[ { "docid": "c875d59c840ae54061bcfabf07430322", "score": "0.84870017", "text": "def updateqty\r\n # Assume user is logged in to be viewing cart\r\n # get the product based on the id passed in\r\n product = Product.find(params[:id])\r\n newquantity = params[:newqty].to_i\r\n # get the users...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "7f583de77ad96f3e5dfbf54ab4477375", "score": "0.0", "text": "def browsertype_params\n params.require(:browsertype).permit(:browser, :device_type, :remote, :human_name, :active)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
8d8a2af37d0d6de308db6afbd4ade598
Add a white list of extensions which are allowed to be uploaded.
[ { "docid": "bb3ddec98a824d97bb8752bd94c3776b", "score": "0.0", "text": "def extension_white_list\n %w(jpg jpeg gif png)\n end", "title": "" } ]
[ { "docid": "dedd34d73a25e418139b8cd2116fb452", "score": "0.78198254", "text": "def extension_whitelist\n ['jpg', 'jpeg', 'gif', 'png']\n end", "title": "" }, { "docid": "95059183f635e6d4c51d4dd70d9ee8c3", "score": "0.7744172", "text": "def extension_white_list\n allowed_types ...
5574c5c804c8b325820e49fc70d5ba83
PATCH/PUT /tag_devises/1 PATCH/PUT /tag_devises/1.json
[ { "docid": "9b023e9680511bdaf495a99f5a025b64", "score": "0.6203567", "text": "def update\n respond_to do |format|\n if @tag_devise.update(tag_devise_params)\n format.html { redirect_to @tag_devise, notice: 'Tag devise was successfully updated.' }\n format.json { render :show, statu...
[ { "docid": "2c1d562ec964eee9463cfb7293ea74da", "score": "0.72218037", "text": "def update\n @tag.update(tag_params)\n render json: @tag\n end", "title": "" }, { "docid": "24d02e126cea8aced7fe6f374c2aa286", "score": "0.709797", "text": "def update\n if tag.update(tag_params)...
17139cc5705d2ffef441c427e9f96290
Returns the help String for this option. source://pry//lib/pry/slop/option.rb124
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "cabbd835b97c236b5349f2b37061a832", "score": "0.8621852", "text": "def help_message\n option_parser.to_s\n end", "title": "" }, { "docid": "d32b37a1d5e5d41db00772cbce54cff5", "score": "0.8584885", "text": "def option_help\n @options ? option_parser.to_s : ''\n...
a66ac6ad586a5888370cefd4d670c63a
The idea of 'supplied' means it was provided to the object and not calculated in any way. This is used when determining the value for the endpoint, in the context of a github user vs github organization
[ { "docid": "83df7c76941055001eb4bdb38e68c641", "score": "0.56746244", "text": "def supplied_org\n @org\n end", "title": "" } ]
[ { "docid": "96cdf3f5a2a01b8259bfffaa4b1a356c", "score": "0.66620266", "text": "def user_provided_value; end", "title": "" }, { "docid": "96cdf3f5a2a01b8259bfffaa4b1a356c", "score": "0.66620266", "text": "def user_provided_value; end", "title": "" }, { "docid": "20409c4518...
7e3cbf1b1f47fb5db469799f76858ddc
Updates the indexed keys for the given node. If the node's attribute has changed since it was added to the collection, the old indexed keys will be replaced with the updated ones.
[ { "docid": "179d82fc8ace7efc755a8d11e4218007", "score": "0.6716597", "text": "def update(node)\n @index_names.each { |name| update_index(name, node) }\n end", "title": "" } ]
[ { "docid": "c921171e634719c4540b654a3e8ce0f1", "score": "0.6955184", "text": "def update_index(name, node)\n index = self.index(name)\n old_key = index.key(node)\n new_key = value(node, name)\n\n # Only replace the key if it's changed\n if old_key != new_key\n remove_from...
b9eb89693687fd06cf47fea5cc4ba8a1
Test 3: Populated group, populated description, populated media
[ { "docid": "cd6834a9789b9b49234dde025387c8a7", "score": "0.5337723", "text": "def test03_EmptyGPopDMPublish\n\t\t\tloginPost\n\t\t\t$browser.goto($patch_media)\n\t\t\tsleep 2\n\t\t\tif $post_media_description.exists?\n\t\t\t\t$post_media_description.set(\"Media Description #{random}.\")\n \t\t\t\tpostGr...
[ { "docid": "9c42d539cef1bb09f2b445669302f510", "score": "0.6182834", "text": "def test03_MediaAllFields\n\t\tloginPost\n\t\t$browser.goto($patch_media)\n\t\t\t\n\t\t\tsleep 2\n\t\t\tif $post_media_description.exists?\n\t\t\t\t$post_media_description.set(\"pictures of hiking mr. rainier #{random}.\")\n \...
4c67f8ca0ff772dc36f7a421e9b8f191
temporory file path with name
[ { "docid": "6f6ba67699530afbaf32f9eaf6c89fc7", "score": "0.6454865", "text": "def tmp_file_path\n File.join(Dir.tmpdir, \"#{tmp_name}.csv\")\n end", "title": "" } ]
[ { "docid": "bbb589a9494c8cb48c25904a50a78781", "score": "0.76767373", "text": "def file_name\n Pathname(\"#{dir_name}temporaryfile\")\n end", "title": "" }, { "docid": "7f67b9627d33c58de9bdc8a175adbe57", "score": "0.7655763", "text": "def path\n File.join @@temp, name.gsub(N...
7760c5a2b1ddfbb5f801bd7f4971e578
enable :sessions For secured endpoints only config.client_ips = ''
[ { "docid": "80a50546dfef150460bdbf4acc793e56", "score": "0.0", "text": "def index\n if current_user.sexual_preference == \"male\" && current_user.gender == \"male\"\n @user = User.where(gender: \"male\").where(sexual_preference: \"male\")\n elsif current_user.sexual_preference == \"female\...
[ { "docid": "73f742418c6593897fc8b7281077de45", "score": "0.6204667", "text": "def session_endpoint_public(_options)\n nil\n end", "title": "" }, { "docid": "76d1eb909e191c23e9023c0a7535499b", "score": "0.6085182", "text": "def using_authenticated_proxy?; end", "title": ""...
774e596d8aed81d2450f7bf419065427
GET /advertisements/1 GET /advertisements/1.json
[ { "docid": "88779ab337da6d15db4596235f6c9fb9", "score": "0.57923865", "text": "def show\n @advertisement = Advertisement.where(id: params[:id]).last\n end", "title": "" } ]
[ { "docid": "08b084142167e533c4f61d246c6ec142", "score": "0.76745564", "text": "def show\n respond_to do |format|\n format.html\n format.json { render json: { advertisements: @advertisements } }\n end\n end", "title": "" }, { "docid": "032f3506b1c3562078418df18497fac2", "...
d0e9a640eab8e73330110a2a7754b6f0
DELETE /admin/contact_groups/:contact_group_id/contacts/1 DELETE /admin/contact_groups/:contact_group_id/contacts/1.json
[ { "docid": "c140bb4bd134f54aedab6cedc4581acf", "score": "0.7587783", "text": "def destroy\n @contact.destroy\n\n render json: @contact, status: :ok\n end", "title": "" } ]
[ { "docid": "a9f50026f2440bff8c2bebf2d695684c", "score": "0.8331248", "text": "def destroy\n @contacts_group = ContactsGroup.find(params[:id])\n @contacts_group.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_groups_url }\n format.json { head :no_content }\n ...
26341c28bf0457b6c3f88ea5e216aeb9
returns date of period start
[ { "docid": "e283905715b41c649dc406d6c464b5bf", "score": "0.8039575", "text": "def get_period_start(i)\n self.start + get_period_offset(i)\n end", "title": "" } ]
[ { "docid": "a1cc48a947ccd742aff79730ba9856a9", "score": "0.8516619", "text": "def min_date(period)\n period.start_date\n end", "title": "" }, { "docid": "033e89b99e2b32c2cc6e35eddca18f1e", "score": "0.7729136", "text": "def start_date\n start.to_date\n end", "title"...
fd3bd94deabe0fb10b21c183c343ded8
This is a dangerous method because it will delete directories that are not empty. So this is called in delete_dir method with the root directory appended to the dir_name so you cannot delete directories outside of this project.
[ { "docid": "6a3f7492fc7626bd3b3f834fc58d477b", "score": "0.7772447", "text": "def delete_dir_base(dir_name)\n FileUtils.remove_dir(dir_name)\n end", "title": "" } ]
[ { "docid": "e68b2af095ffca076abc331a09eaf479", "score": "0.77864397", "text": "def delete_dir!(path)\n # do nothing, because there's no such things as 'empty directory'\n end", "title": "" }, { "docid": "66d9af491ec8df5da78350a1cc860450", "score": "0.75141543", "text": "d...
26db4e42e9043d38fb7887551516362d
Minifies the whole application
[ { "docid": "152496f1d0e7305ec3bc5e7ca62fec9c", "score": "0.66296744", "text": "def minify()\r\n # Parse the index.html\r\n doc = Hpricot(open(\"index.html\"))\r\n\r\n puts \"Minifying framework files\"\r\n # Select the framework files into an array\r\n fwk_files = doc.search('head script[@src]').ma...
[ { "docid": "bc38f53332d6d78f25deb8cc834f4eab", "score": "0.6870435", "text": "def minify_build_js()\n puts 'Minifying JS...'\n %x[closure --js #{BUILD_JS} --js_output_file #{BUILD_JS}.tmp]\n %x[mv #{BUILD_JS}.tmp #{BUILD_JS}]\nend", "title": "" }, { "docid": "62d56ad06cb1dc602d58db5...
fe1d2e1f14b98b8529f46acdb67edb13
DELETE /deliveries/1 DELETE /deliveries/1.json
[ { "docid": "66ccce34383c7de068420f23dd93a844", "score": "0.0", "text": "def destroy\n @delivery = Delivery.find(params[:id])\n order = Order.find(@delivery.order_id)\n order.order_items.each do |order_item|\n ordered_item = OrderedItem.find_by sale_item_id: order_item.sale_item_id\n ...
[ { "docid": "7385e655a7593360c652be872eb0c48f", "score": "0.74534893", "text": "def destroy\n @deliverable = Deliverable.find(params[:id])\n @deliverable.destroy\n\n respond_to do |format|\n format.html { redirect_to deliverables_url }\n format.json { head :ok }\n end\n end", "...
d201608fd00b0625332d6d176536ed51
callseq: join( timeout = nil ) => spawner or nil The calling thread will suspend execution until all child processes have been stopped. Does not return until all spawner threads have exited (the child processes have been stopped) or until _timeout seconds have passed. If the timeout expires +nil+ will be returned; othe...
[ { "docid": "bf45fb21638d8f22bc893ce0ef66c0e4", "score": "0.48349893", "text": "def join( limit = nil )\n loop do\n t = @group.list.first\n break if t.nil?\n return nil unless t.join(limit)\n end\n self\n end", "title": "" } ]
[ { "docid": "3e5dedb28e4127ecd0af232bfc5ecdad", "score": "0.70817626", "text": "def join(timeout)\n @thread.join timeout\n end", "title": "" }, { "docid": "449d2ec18dcd68fa2d0d51efecb4541b", "score": "0.69918334", "text": "def join(timeout: nil)\n if timeout...
05f690b888a41c1dcb5ab04c0848fb8e
Merges two build.cfg files
[ { "docid": "f5b5d6e751f01aa6ab509bc604732e7b", "score": "0.69768655", "text": "def merge_configurations cfg,cfg2\n cfg['prefix']||=cfg2['prefix']\n raise \"Attempting to merge configurations with differing prefixes: '#{cfg['prefix']}' vs. '#{cfg2['prefix']}' \" if cfg['prefix']!=cfg2['prefix']\n cfg[...
[ { "docid": "9c1c8318e63e833622f758d75f398507", "score": "0.6401581", "text": "def merge(cfg_file)\n cfg = read_configuration(cfg_file)\n list_keys, = *keys\n cfg.each_key do |k|\n if @config.keys.include?(k) && list_keys.include?(k)\n @config[k] += cfg[k]\n ...
00b628bf3453b6aad7362f4fc47d3af8
Returns the value of attribute combining_class. source://mail//lib/mail/multibyte/unicode.rb12
[ { "docid": "f5e09e5e6737a4d8652669383902867b", "score": "0.64018345", "text": "def combining_class; end", "title": "" } ]
[ { "docid": "e0c3143e12de50494b57886186de7f49", "score": "0.6109653", "text": "def class_value\n @pairs.fetch(\"class\", \"\")\n end", "title": "" }, { "docid": "47f6428d53b6d3aebc115e372d1d1422", "score": "0.5938113", "text": "def get_comp_type\n \tcomp_type_value = ...
652c8a0fa975e0cec23001cff93d203e
GET /parliaments/1 GET /parliaments/1.json
[ { "docid": "02e8431d1c922333f2576d5c6c05046c", "score": "0.66671115", "text": "def show\n @parliament = Parliament.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @parliament }\n end\n end", "title": "" } ]
[ { "docid": "52cbe1e521186ee23e7ed12f6e6f58e8", "score": "0.67865366", "text": "def index\n @parishes = Parish.all\n\n render json: @parishes\n end", "title": "" }, { "docid": "825d97350a54503e7a635363e3e19325", "score": "0.6721505", "text": "def index\n @parliaments = Parli...
867f00e85c1e259d5be44ed1f5e6fad4
generates html for a field label
[ { "docid": "fef06fa2ea1470599ebeaa65d9ce0fb5", "score": "0.78989875", "text": "def elmo_field_label(field_name, options)\n label_str = options[:label] || @object.class.human_attribute_name(field_name)\n label_html = (options[:required] ? \"#{@template.reqd_sym} \" : \"\") + label_str + \":\"\n...
[ { "docid": "5d0a4e7adf632266a1f1059f4fb872ba", "score": "0.82565945", "text": "def label_and_field(field_html, errors_html, attr, label_text, label_options)\n output = ''.html_safe\n output << label(attr, label_text, label_options)\n output << field_html\n output << errors_html if errors_htm...
124896c3c8ef6e853d70f5f5922cdcdc
Very simple, given a number, find its opposite. Examples: 1: 1 14: 14 34: 34
[ { "docid": "cdabfd0921478277993a8cd9741c46e0", "score": "0.7117432", "text": "def opposite(num)\n if num < 0\n return num * -1\n \n else\n return num * -1\n end\nend", "title": "" } ]
[ { "docid": "209b1349fb319312759a49506781df4c", "score": "0.78078616", "text": "def opposite(number)\n 0 - number\nend", "title": "" }, { "docid": "209b1349fb319312759a49506781df4c", "score": "0.78078616", "text": "def opposite(number)\n 0 - number\nend", "title": "" }, { ...
1d6673549b1dc699d019adca0d316eda
PATCH/PUT /originating_histories/1 PATCH/PUT /originating_histories/1.json
[ { "docid": "86a443439ec464b1a70965e35d0bb98b", "score": "0.6852895", "text": "def update\n respond_to do |format|\n if @originating_history.update(originating_history_params)\n format.html { redirect_to @originating_history, notice: 'Originating history was successfully updated.' }\n ...
[ { "docid": "5adc071ac70442e8ab9181648c94eed9", "score": "0.65348697", "text": "def update\n @historical = Historical.find(params[:id])\n\n respond_to do |format|\n if @historical.update_attributes(params[:historical])\n format.html { redirect_to @historical, notice: 'Historical was suc...
a58d361afb5ed130943a304a16cb06ea
Evict the cache entry for key
[ { "docid": "880bb562e385bf682c4e76d2ef40c35c", "score": "0.8241675", "text": "def evict(key)\n @data_expires_at.delete(key)\n cache_value = @data.delete(key)\n @current_size_bytes -= size_of(key, cache_value)\n end", "title": "" } ]
[ { "docid": "052aa53d7254791a358b017c36b321cc", "score": "0.7879288", "text": "def remove(key)\n cache.delete(key)\n end", "title": "" }, { "docid": "cc9816a369f3c960ff1e4cbb2ade2fef", "score": "0.7519028", "text": "def delete_from_cache(key)\n cache_class.delete(key)\n...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "55d874dcd885a2dd3df61c83675d1233", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = LoginResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "ea872306361fc864408e8279b0199bbe", "score": "0.75943273", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0....
9d84fbfa44d367ab93975b0c6275014f
Return the position of this cursor.
[ { "docid": "e3a66b03e2ed0d8769376ed83c21cad0", "score": "0.66143084", "text": "def position\n @position = Vedeu::Geometry::Position[y, x]\n end", "title": "" } ]
[ { "docid": "ce15cefcdfc10bda2a6bc3cad27d4a19", "score": "0.84886086", "text": "def position\n @cursor[0]\n end", "title": "" }, { "docid": "3447747acb280f092f43bdbd91c90c84", "score": "0.8333751", "text": "def get_cursor_pos\n @cursor_pos.dup\n end", "title": "" }, ...
b77144b49642150aeed116c24ed6778c
Check if the boggle board has all the possible alphabets
[ { "docid": "d04b483dac79c95a83ed28968c309e14", "score": "0.7008293", "text": "def include_every_alphabet?(word)\n for i in 0..word.length-1\n return false if (check_hash(word[i])==[])\n end\n return true\n end", "title": "" } ]
[ { "docid": "576c34e8e74953cb00510f2716d9b0f4", "score": "0.69435513", "text": "def uses_available_letters?(input, letters_in_hand)\n word_array = []\n input.each_char { |letter| word_array << letter }\n return word_array & letters_in_hand == word_array\nend", "title": "" }, { "docid": "83...
7b2ea56142b52fb7d3be735699b666ca
Returns 1 if player 1 wins, 0 if tie and 1 if player 2 wins
[ { "docid": "b3fa3edc6398a52416cb19f1eca81eeb", "score": "0.7612444", "text": "def result(player1, player2)\n if player1 == player2\n 0\n elsif win?(player1, player2)\n 1\n else\n -1\n end\nend", "title": "" } ]
[ { "docid": "6de2126cb3c8ef073fe2547c35a34a25", "score": "0.80338305", "text": "def player_1_wins?\n @current_Score[\"Player 1\"] >= @games_needed_to_win\n end", "title": "" }, { "docid": "c37d9aeadec98c6cea4aed0dfd80dd53", "score": "0.7910568", "text": "def tie?\n player1....
71f5f217872aa3038ff3f4dccc041abd
Based on assert_difference just checks using not_equal instead of a numeric difference so you can compare nonnumeric things
[ { "docid": "8f15a7ea58d814cb785b191d1ddea803", "score": "0.0", "text": "def assert_change(expressions, message = nil, &block)\n expressions = Array(expressions)\n\n exps = expressions.map { |e|\n e.respond_to?(:call) ? e : lambda { eval(e, block.binding) }\n }\n before = exps.map { |e| ...
[ { "docid": "c514eb0345eb253a32f533249e483563", "score": "0.688172", "text": "def assert_no_difference(expression, &block)\n assert_difference expression, 0, &block\n end", "title": "" }, { "docid": "6e6905d2b85927ebcf7632f621e77e33", "score": "0.6865912", "text": "def ass...
e49ba28f6731dbe583c16d38e2079417
Generate seed data with the POCDriver.
[ { "docid": "0c1e5e239a24cbce658158ae4cc1e78a", "score": "0.542991", "text": "def seed(connections, rebuilt, options)\n return if !options[:force] && !rebuilt && File.exists?(\".seeded-#{connections}\")\n\n exec!(\"mongo --host #{options[:host]} --port #{options[:port]} --eval #{DROP_DB}\", 'unable to ...
[ { "docid": "3d8f562c5e7c4ada7ab4a866439dc6a0", "score": "0.6897159", "text": "def seed_data()\n self.seed_client_stylist\n self.seed_offering_assignment\n self.seed_date_maker\n end", "title": "" }, { "docid": "ed07a8a9880b819819271a009061e305", "score": "0.6455074", "text"...
efe034b6f781f559f85116844f055780
The range of the word at the current position.
[ { "docid": "37e906bd64dccc3d583eecc648eeab43", "score": "0.8005786", "text": "def range\n @range ||= begin\n s = Position.from_offset(source.code, offset - start_of_word.length)\n e = Position.from_offset(source.code, offset + end_of_word.length)\n Solargraph::Range.new...
[ { "docid": "faa470f76997351e46d624859aa2646f", "score": "0.7701425", "text": "def word_range\n @word_range ||= word_range_at(offset, false)\n end", "title": "" }, { "docid": "d7e33133323f2e4cfccf1c8968bd212d", "score": "0.74746734", "text": "def range\n return ...
e8d94279a3e8a7f9621c4b8a80d00d81
Method that goes to our create car page, fills in the make, model year, description, and then clicks the simulate car button
[ { "docid": "e19c3d022c41093db0efc760a6cfade1", "score": "0.79223603", "text": "def fill_in_make_and_modelyear\n visit \"/car/create\"\n fill_in(\"Make\", with: \"Mini\")\n fill_in(\"Model Year\", with: 2012)\n fill_in(\"Description\", with: \"This is the description for our car! It is a grea...
[ { "docid": "0bd907f934b71db24a928eedf0f92114", "score": "0.62388265", "text": "def create\n @car = Car.new(params[:make], params[:model_year])\n #converting the Car.new object into a YAML which stands for Yet Another Markup Language. Storing this car's information in a session. (When not using a d...
693e8dd05bed06df9b3e60a433097834
Returns the link containing the commenter's name at a given index in the list of comments
[ { "docid": "42c34173baffed8e5a1e4b733ecf5e98", "score": "0.85405654", "text": "def commenter_link(index)\n comment_elements[index].link_element\n end", "title": "" } ]
[ { "docid": "e5d5a3bd3445307ff015bd007e552927", "score": "0.8215443", "text": "def commenter_name(index)\n commenter_link(index).text\n end", "title": "" }, { "docid": "4712fc4e4127857fb240a573a9f59d1a", "score": "0.7977978", "text": "def commenter_name(index_position)\n ...
3fbc03d4c6bc797133a58ac4e7e2ee58
def name rid end
[ { "docid": "2c116b49093e9e5f1a43a4a6b6888349", "score": "0.0", "text": "def short\n rid\n end", "title": "" } ]
[ { "docid": "bbafb6243eac8aa73662abbbdfc3959e", "score": "0.8344623", "text": "def name() end", "title": "" }, { "docid": "c46e9ba44fc89c917b462bf75204fb61", "score": "0.80337435", "text": "def name\n \n end", "title": "" }, { "docid": "8374af945e2e0b9fed...
bddd6a10903088efb8af246f075d529d
PATCH/PUT /tuhu/brands/1 PATCH/PUT /tuhu/brands/1.json
[ { "docid": "ea15a2520d28c65493b1245650731696", "score": "0.6487213", "text": "def update\n respond_to do |format|\n if @tuhu_brand.update(tuhu_brand_params)\n format.html { redirect_to @tuhu_brand, notice: 'Brand was successfully updated.' }\n format.json { render :show, status: :o...
[ { "docid": "116265a7f9e066972d73afa764876e28", "score": "0.7005842", "text": "def update_brands\n brands_raw = search_brands_shopstyle\n brands = format_brands_hash(brands_raw[\"brands\"])\n render json: {status: 0, data: {brands: brands}}\n end", "title": "" }, { "docid": "5e52ee0...