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
remove leading and trailing whitespace from expression
def trim_whitespace @expression.strip! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rstrip\r\n match = rewrite(/\\s+\\z/)\r\n match ? match[0] : ''\r\n end", "def undent\n gsub /^.{#{slice(/^ +/).length}}/, ''\n end", "def strip_whitespace!\n replace(self.strip_whitespace)\n end", "def trim\n self.gsub(/^\\s+/,'').gsub(/\\s+$/,'')\n end", "def trim_whitespace;...
[ "0.7307711", "0.7171218", "0.70892143", "0.7087", "0.70736927", "0.7025794", "0.69583726", "0.69527805", "0.6921175", "0.69098747", "0.6826063", "0.6826063", "0.68033904", "0.67857105", "0.67702067", "0.6761271", "0.6749779", "0.67470104", "0.67125535", "0.67108345", "0.67066...
0.8477355
0
if nonblank expression is invalid then mark mode as :invalid
def validate # @expression && !@expression.blank? if !@expression || @expression.blank? return elsif !Calculator.valid?(@expression) @expression = nil @mode = :invalid end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate!\n # Expression must be present.\n if expression.to_s.length == 0\n raise SkyDB::Query::ValidationError.new(\"Invalid expression for selection group: '#{expression.to_s}'\")\n end\n end", "def match_regex\n if !self.value.blank? && self.regex\n errors.add(:...
[ "0.628122", "0.62244105", "0.62024724", "0.62024724", "0.61063355", "0.60719776", "0.6065709", "0.6065709", "0.6015074", "0.5882369", "0.57849026", "0.57636803", "0.57636803", "0.57636803", "0.57636803", "0.57636803", "0.57636803", "0.5759746", "0.5747975", "0.574058", "0.572...
0.727553
0
Determines if the uploaded file should be committed to the blockchain and if so, commits it.
def commit_file if @upload.public? && @upload.file_type.public? && @upload.address.blank? && (@upload.creating? || @upload.failed?) BlockchainCommitJob.perform_later(@upload.id) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commit_file\n\t\tlogger.info(\"[File Attribute #{sprintf('0x%08x', self.object_id)}] Committing file for #{@obj.class}(#{@obj.id}).#{attribute_name} ...\")\n\t\tif @file\n\t\t\tlogger.info(\"[File Attribute] Saving file #{local_file_name} ...\")\n\t\t\t@file.rewind if @file.respond_to?(:rewind)\n\t\t\tFile.mak...
[ "0.70447665", "0.65341896", "0.6500315", "0.6240958", "0.62225926", "0.6187146", "0.60833895", "0.60467666", "0.602827", "0.5978281", "0.5943722", "0.5923486", "0.5871943", "0.5862198", "0.58589554", "0.5825412", "0.5822279", "0.57865465", "0.5734036", "0.5720119", "0.5697462...
0.7668371
0
Determines if the uploaded file can be retrieved from the blockchain and if so, retrieves it.
def retrieve_file if @upload.public? && @upload.file_type.public? && @upload.address.present? && @upload.success? BlockchainRetrieveJob.perform_later(@upload.id) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve_file(file)\n begin\n @ftp.getbinaryfile(file)\n return true\n rescue Exception => e\n error_message(e)\n return false\n end\n end", "def fetchFile #:doc:\n \n begin\n @user = User.find_by_username(params[:username])\n @device = @user.devices.find_by_dev_...
[ "0.6731581", "0.666982", "0.65142936", "0.6495629", "0.62553185", "0.61968386", "0.61654264", "0.6135881", "0.6132813", "0.60777885", "0.5985837", "0.5973886", "0.59500945", "0.5936127", "0.5932834", "0.59322786", "0.59254086", "0.59176177", "0.58598405", "0.58598405", "0.583...
0.75448596
0
PATCH/PUT /markets/1 PATCH/PUT /markets/1.json
def update respond_to do |format| if @market.update(market_params) format.html { redirect_to @market, notice: 'Market was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @market.errors, status...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end", "def update\n respond_to do |format|\n if @market.update(market_params)...
[ "0.6689297", "0.6285735", "0.62254876", "0.6205059", "0.6087899", "0.5969578", "0.5943647", "0.5923731", "0.5918055", "0.58609074", "0.5856743", "0.58487135", "0.5837215", "0.5828785", "0.58192664", "0.581824", "0.5796044", "0.5793048", "0.5785845", "0.5774626", "0.57715815",...
0.63627464
1
DELETE /markets/1 DELETE /markets/1.json
def destroy @market.destroy respond_to do |format| format.html { redirect_to markets_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @market.destroy\n respond_to do |format|\n format.html { redirect_to markets_url, notice: 'Market was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @simulation_market = SimulationMarket.find(params[:id])\n @simulation_market.des...
[ "0.71753776", "0.7122614", "0.6966567", "0.6872031", "0.6830154", "0.68011874", "0.6796561", "0.6779791", "0.67787063", "0.6742691", "0.6737567", "0.6702646", "0.6678278", "0.66740394", "0.66698384", "0.66698384", "0.66698384", "0.66572165", "0.66490245", "0.6637208", "0.6630...
0.7435892
0
Returns the chosen colour mode.
def colour_mode instance.options[:colour_mode] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_modes\n return @color_modes\n end", "def colormode\n # TODO: Return a ColorMode object\n mode_value = @attributes.fetch('colormode', nil)\n ColorMode.new(mode_value)\n end", "def detect_colour_mode\n case ENV['TERM']\n when /-truec...
[ "0.74411714", "0.7409013", "0.7105346", "0.7105346", "0.7052336", "0.6993235", "0.68241763", "0.6773737", "0.66509247", "0.66509247", "0.6645449", "0.6645449", "0.66019326", "0.65880203", "0.65370166", "0.6438889", "0.6363784", "0.6352362", "0.6347746", "0.633593", "0.6274141...
0.8042531
1
Return the configured foreground colour for the client application.
def foreground instance.options[:foreground] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def context_get_fgcolor()\n return $gimp_iface.gimp_context_get_foreground()[0]\nend", "def fg(c)\n return self unless ANSI_COLORS[c]\n return colorize(ANSI_COLORS[c])\n end", "def foreground(color=nil)\n @options[:foreground] = color unless color.nil?\n @options[:foreground]\n end", "de...
[ "0.7220582", "0.6944194", "0.69083774", "0.68901694", "0.65666145", "0.63970095", "0.63934714", "0.629649", "0.6244703", "0.62362814", "0.62349343", "0.620977", "0.61222553", "0.60984665", "0.60984665", "0.6093749", "0.6068151", "0.60643", "0.6055229", "0.60005957", "0.598882...
0.73054874
0
Returns a boolean indicating whether the log has been configured.
def log? log != nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logging_enabled?\n !!logging_enabled\n end", "def log?\n @log != false\n end", "def log?\n @log != false\n end", "def log?\n @log != false\n end", "def configured?\n @configuration != nil\n end", "def configured?\n true\n end", "def log?\n ...
[ "0.7564051", "0.7503003", "0.7503003", "0.7503003", "0.7425709", "0.73688424", "0.7344686", "0.73230577", "0.7267191", "0.7242818", "0.7238527", "0.71988904", "0.71643555", "0.68795055", "0.6860532", "0.6847547", "0.68415576", "0.6700446", "0.6700446", "0.6646372", "0.6596024...
0.76316434
1
Returns whether mouse support was enabled or disabled.
def mouse? instance.options[:mouse] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_mouse(enable = true)\n\t\trequest = Packet.create_request('stdapi_ui_enable_mouse')\n\n\t\trequest.add_tlv(TLV_TYPE_BOOL, enable)\n\n\t\tresponse = client.send_request(request)\n\n\t\treturn true\n\tend", "def enable_mouse(enable = true)\n\t\trequest = Packet.create_request('stdapi_ui_enable_mouse')\n...
[ "0.7116251", "0.7116251", "0.7009626", "0.7009626", "0.6825022", "0.6778455", "0.67144376", "0.67072976", "0.67072976", "0.6642208", "0.64730716", "0.64441854", "0.6404923", "0.6321781", "0.6320107", "0.6320107", "0.6309202", "0.6308145", "0.627824", "0.6268673", "0.624547", ...
0.78489006
0
Returns the renderers which should receive output.
def renderers instance.options[:renderers] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def renderer\n DirRenderer.renderers.partition {|r| !r.built_in?}.flatten.find do |r|\n r.can_render?(self) && !plugin_disabled?(r)\n end\n end", "def printers\n return @printers\n end", "def render_for(renderers={})\n @renderers = @renderers.merge(renderers)\...
[ "0.6508994", "0.64511365", "0.6198719", "0.60217834", "0.5933137", "0.59107757", "0.57832867", "0.56539553", "0.5584377", "0.5567623", "0.5567623", "0.54825735", "0.54778224", "0.54296845", "0.54173297", "0.5396047", "0.5355134", "0.5340255", "0.5337511", "0.5290253", "0.5283...
0.75514686
1
Returns the redefined setting for STDERR.
def stderr instance.options[:stderr] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restore_stderr\n $stderr = @original_stderr unless @original_stderr.nil?\n end", "def error_mode; end", "def re_stderr\n @logdev.re_stderr\n self\n end", "def stderr_device\n # TODO: Find a more elegant way to access the internal log device\n @logger_stderr.instance_variable_get(:@lo...
[ "0.6253591", "0.60084534", "0.58104354", "0.5795258", "0.5755715", "0.57440335", "0.5678762", "0.56595397", "0.56595397", "0.56595397", "0.56595397", "0.56587636", "0.5657373", "0.56494117", "0.56427616", "0.56298184", "0.5593333", "0.5551608", "0.55033475", "0.5458253", "0.5...
0.628809
1
Returns the terminal mode for the application. Default is `:raw`.
def terminal_mode instance.options[:terminal_mode] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mode\n @_mode ||= Configuration.terminal_mode\n end", "def mode\n @mode = Vedeu.config.terminal_mode\n end", "def raw_mode!\n Vedeu.log(\"Terminal switching to 'raw' mode\")\n\n @_mode = :raw\n end", "def detect_mode\n if ENV['NO_COLOR'] # see https://no-color.org/\n...
[ "0.7904988", "0.7670779", "0.6814931", "0.6731271", "0.65007764", "0.62405264", "0.61243325", "0.6123772", "0.6108121", "0.6108121", "0.60713387", "0.60500383", "0.60384876", "0.6027768", "0.6001426", "0.58739185", "0.58739185", "0.5841296", "0.58196074", "0.58196074", "0.580...
0.80960536
1
Attempt to determine the terminal colour mode via $TERM environment variable, or be optimistic and settle for 256 colours.
def detect_colour_mode case ENV['TERM'] when /-truecolor$/ then 16_777_216 when /-256color$/, 'xterm' then 256 when /-color$/, 'rxvt' then 16 else 256 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detect_mode\n if ENV['NO_COLOR'] # see https://no-color.org/\n 0\n elsif RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ # windows\n if ENV['ANSICON']\n 16\n elsif ENV['ConEmuANSI'] == 'ON'\n TRUE_COLOR\n else\n 0\n end\n elsif ENV['TERM...
[ "0.7915949", "0.7265764", "0.6604198", "0.652807", "0.6379686", "0.63699687", "0.63104486", "0.6305616", "0.63039577", "0.6267237", "0.62081486", "0.6180651", "0.61370623", "0.6135211", "0.60576063", "0.6057117", "0.5967524", "0.5956693", "0.58894897", "0.5851682", "0.584972"...
0.86316514
1
Represents the Attachment as a String
def to_s "#{@name}, #{@mime_type}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n \"#<#{self.class.inspect}(#{attachment_name})>\"\n end", "def to_s\n @file.to_s\n end", "def to_s\n @file_text\n end", "def to_s\n @file_text\n end", "def to_str\n @filename\n end", "def name\n attachment.name\n end", "def inspect\n ...
[ "0.79617786", "0.69646347", "0.68179035", "0.68179035", "0.67063075", "0.66860205", "0.6684484", "0.65533376", "0.6540408", "0.6502132", "0.6412219", "0.6359773", "0.63488597", "0.6329455", "0.6325604", "0.6279575", "0.62631744", "0.6239195", "0.62306917", "0.6183978", "0.618...
0.70827
1
GET /tarifas/1 GET /tarifas/1.xml
def show @tarifas = Tarifas.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @tarifas } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @tipo_lancamentos = TipoLancamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_lancamentos }\n end\n end", "def show\n @tipo_vinculo = TipoVinculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.ht...
[ "0.6611034", "0.65347433", "0.65265346", "0.6475856", "0.6475464", "0.64754367", "0.6474112", "0.64481735", "0.64366114", "0.6436377", "0.643464", "0.6427724", "0.6413615", "0.64103067", "0.63989913", "0.63988274", "0.63898265", "0.6385304", "0.63831544", "0.63829446", "0.637...
0.7439461
0
GET /tarifas/new GET /tarifas/new.xml
def new @tarifas = Tarifas.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @tarifas } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @vestimenta = Vestimenta.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vestimenta }\n end\n end", "def new\n @tservicio = Tservicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :x...
[ "0.7193035", "0.71898395", "0.7185879", "0.7153766", "0.7145487", "0.7138322", "0.7135436", "0.7129469", "0.70920223", "0.70788026", "0.70781255", "0.70747286", "0.70711845", "0.70665693", "0.7062387", "0.70511985", "0.7049408", "0.70473796", "0.70450765", "0.7041942", "0.702...
0.78653103
0
POST /tarifas POST /tarifas.xml
def create @tarifas = Tarifas.new(params[:tarifas]) respond_to do |format| if @tarifas.save flash[:notice] = 'Tarifas was successfully created.' format.html { redirect_to(@tarifas) } format.xml { render :xml => @tarifas, :status => :created, :location => @tarifas } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @tarifas = Tarifas.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tarifas }\n end\n end", "def create\n @tarifas_servicio = TarifasServicio.new(tarifas_servicio_params)\n\n respond_to do |format|\n if @tarifas_servicio.save\n ...
[ "0.63334435", "0.6222863", "0.62075955", "0.5886238", "0.58609736", "0.57375246", "0.5684854", "0.5676212", "0.56584096", "0.56313324", "0.5609841", "0.56089234", "0.5602563", "0.557928", "0.55672836", "0.5538161", "0.5531761", "0.55143356", "0.55066615", "0.5506644", "0.5498...
0.69729114
0
PUT /tarifas/1 PUT /tarifas/1.xml
def update @tarifas = Tarifas.find(params[:id]) respond_to do |format| if @tarifas.update_attributes(params[:tarifas]) flash[:notice] = 'Tarifas was successfully updated.' format.html { redirect_to(@tarifas) } format.xml { head :ok } else format.html { render :actio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def upd...
[ "0.65757364", "0.6441648", "0.6123665", "0.6032004", "0.6014631", "0.60115", "0.59326005", "0.58998877", "0.5853577", "0.58267653", "0.57823783", "0.57458484", "0.57298297", "0.5720079", "0.57131314", "0.5694692", "0.56598544", "0.5656274", "0.56539905", "0.56480175", "0.5596...
0.66311055
0
DELETE /tarifas/1 DELETE /tarifas/1.xml
def destroy @tarifas = Tarifas.find(params[:id]) @tarifas.destroy respond_to do |format| format.html { redirect_to(tarifas_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\n @relatestagiario = Relatestagiario.find(params[:id])\n @relatestagiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(relatestagiarios_url) }\n format.xml { head :ok }...
[ "0.7028977", "0.6990223", "0.68493015", "0.6820654", "0.6811805", "0.680114", "0.67998344", "0.67856073", "0.67825335", "0.6775166", "0.677094", "0.6770407", "0.6770217", "0.67671126", "0.67662394", "0.676394", "0.6744263", "0.6733172", "0.67313904", "0.67313904", "0.6720583"...
0.7418895
0
POST /group_events POST /group_events.json
def create @group_event = GroupEvent.new(group_event_params) respond_to do |format| if @group_event.save format.html { redirect_to @group_event, notice: 'Group event was successfully created.' } format.json { render :show, status: :created, location: @group_event } else form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @group_event = GroupEvent.new(params[:group_event])\n\n respond_to do |format|\n if @group_event.save\n format.html { redirect_to @group_event, notice: 'Groups event was successfully created.' }\n format.json { render json: @group_event, status: :created, location: @group_even...
[ "0.76607907", "0.7596514", "0.73429585", "0.7249151", "0.71680295", "0.71391046", "0.70267564", "0.67507607", "0.6727875", "0.6668374", "0.6651771", "0.66348547", "0.66257167", "0.66139084", "0.65420526", "0.6526086", "0.6508799", "0.64960104", "0.64747274", "0.646939", "0.64...
0.7679999
0
GET /group_events/1/publish GET /group_events/1/publish.json
def publish @group_event.published = true begin @group_event.save! rescue Exception => ex respond_to do |format| format.json { render :json => {:errors => @group_event.errors.full_messages}, :status => 422 } format.html { redirect_to group_events_url, notice: ex.message } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def publish\n @event = Event.find_by_id(params[:event_id].to_i)\n if @event != nil && !@event.archived\n if !@event.published\n @event.published = true\n @event.published_date = Time.now\n if @event.save\n # send push notifications\n # send_push_notification_to_mem...
[ "0.7046523", "0.6570648", "0.6553778", "0.6503953", "0.645239", "0.631697", "0.631697", "0.631697", "0.62403786", "0.62081283", "0.61946356", "0.61842644", "0.6179885", "0.6178765", "0.61327875", "0.6116769", "0.6111745", "0.6057187", "0.60542345", "0.60478944", "0.60476506",...
0.7469186
0
creates a new renderer instance of given id or the default one if id is not recognized
def renderer_named(id) id == 'cool' ? CoolRenderer.new : DefaultRenderer.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_default_renderer\n r = ListRenderer.new self\n renderer(r)\n end", "def get_renderer(name)\n begin\n class_name = name.to_s.capitalize.to_sym\n renderer = ::Hyde::Renderers.const_get(class_name)\n rescue NameError\n renderer = nil\n end\n renderer\...
[ "0.6213088", "0.61684525", "0.61214805", "0.5872002", "0.5709375", "0.5699175", "0.5699175", "0.55510175", "0.5539786", "0.5533279", "0.55280685", "0.5522035", "0.5503524", "0.5463763", "0.5417843", "0.54096055", "0.534494", "0.53226334", "0.5312226", "0.5288216", "0.5210759"...
0.7880787
0
Restituisce true se l'array contiene altri array (es. [[1],2,3] => true)
def boolean_nested_array(array) array.each do |slot| return true if slot.kind_of?(Array) end return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test3(array)\n\tputs \"Test3: Should return an array of arrays -> \"\n\tabg_maker(array).any? {|x| x.class != Array} ? false : true\nend", "def include_array?(array)\n array.any? { |member| array?(member) }\n end", "def test3(array)\n\tputs \"Test3: Should return an array of arrays -> \"\n\tgroupMaker(...
[ "0.7458098", "0.7379841", "0.72258526", "0.7049583", "0.6999908", "0.69542456", "0.6894341", "0.6882627", "0.67809975", "0.6770511", "0.6747358", "0.67222947", "0.6676707", "0.6671731", "0.66442484", "0.66285926", "0.6619986", "0.66072136", "0.6607144", "0.65868145", "0.65851...
0.74307317
1
la funzione + riceve come argomento un oggetto Point2D e restituisce un nuovo oggetto Point2D che ha come coordinate la somma delle coordinate dei due oggetti. (x1 + x2, y1 + y2) la funzione non deve alterare lo stato interno dell'oggetto, ma restituire un nuovo oggetto
def + (point) return Point2D.new(@x + point.x, @y + point.y) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def +(other)\n Point2D.new(@x + other.x, @y + other.y)\n end", "def Point2dAdd(arg0, arg1)\n ret = _invoke(1610743816, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "def add_line(point1, point2)\n end", "def +(other_point)\n Point...
[ "0.6714917", "0.63348395", "0.62350893", "0.61987555", "0.6192249", "0.61214775", "0.6083849", "0.600457", "0.59969807", "0.5988945", "0.5925182", "0.590834", "0.5905427", "0.5895979", "0.58886397", "0.58872885", "0.5874775", "0.5859913", "0.5858302", "0.58543277", "0.5841083...
0.65798247
1
VM information Returns an Array of snapshot names
def snapshots raise Fission::Error,"VM #{@name} does not exist" unless self.exists? command = "#{vmrun_cmd} listSnapshots #{vmx_path.shellescape} 2>&1" output = `#{command}` raise "There was an error listing the snapshots of #{@name} :\n #{output}" unless $?.exitstatus==0 snaps_unfilte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_snapshots\n snaps = execute(:list_snapshots, VmID: vm_id)\n snaps.map { |s| s['Name'] }\n end", "def snapshots\n unless @vm.exists?\n return Response.new :code => 1, :message => 'VM does not exist'\n end\n\n conf_file_response = @vm.conf_file\n ...
[ "0.7319119", "0.71669644", "0.7153999", "0.6923329", "0.67877907", "0.67184603", "0.6675733", "0.6673279", "0.66490376", "0.6545397", "0.64824367", "0.6316332", "0.6287981", "0.622398", "0.61647075", "0.6128748", "0.6089432", "0.60887355", "0.6086411", "0.605722", "0.6042591"...
0.7733573
0
Retrieve the ip address for a vm. This will only look for dynamically assigned ip address via vmware dhcp
def ip_address raise ::Fission::Error,"VM #{@name} does not exist" unless self.exists? unless mac_address.nil? lease=LeasesFile.new("/var/db/vmware/vmnet-dhcpd-vmnet8.leases").find_lease_by_mac(mac_address) if lease.nil? return nil else return lease.ip en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ip_address\n # Does not work for now as the vmx path is not escape correctly by fission 0.4.0\n #return raw.network_info.data.first['ip_address']\n raise ::Fission::Error,\"VM #{name} does not exist\" unless self.exists?\n \n # Use alternate method to retrieve the I...
[ "0.76284814", "0.752667", "0.7457153", "0.7347785", "0.72087175", "0.71711296", "0.69107574", "0.6891406", "0.6850987", "0.6764583", "0.668296", "0.6617597", "0.6596634", "0.6594578", "0.6567539", "0.6539812", "0.6466149", "0.6445676", "0.64088595", "0.64080715", "0.6396263",...
0.7576724
1
Returns true if the text chunk is international, false otherwise
def international? @international end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unicode?\n self.local =~ /[^\\p{InBasicLatin}]/ ? true : false\n end", "def textual?\n properties.include?(\"textual\")\n end", "def localize_present?\n false\n end", "def is_international?\n internation.present?\n end", "def text?\n [:ascii, :text].include?(type)\n ...
[ "0.6982029", "0.67750406", "0.65705204", "0.64699537", "0.6374134", "0.63158965", "0.62764", "0.6249086", "0.62488264", "0.6231267", "0.6218963", "0.621181", "0.6196331", "0.6175422", "0.6157065", "0.61568975", "0.6122454", "0.6115466", "0.6104696", "0.6053358", "0.60468656",...
0.6834056
1
Prints formatted keyword and text
def report if @language == "" && @translated_keyword == "" puts @keyword + ": " + text else puts @language puts @keyword + ", " + @translated_keyword + ": " + text end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n text = \"#{keyword} #{self.text}\"\n text << \"\\n\" + block.to_s.split(\"\\n\").collect { |line| \" #{line}\" }.join(\"\\n\") if block\n\n text\n end", "def show_word\n print \"The word was: #{@word} \\n\"\n puts \"\\n\"\n end", "def to_s\n text = \"#{keyword} #{base}...
[ "0.6458207", "0.6131731", "0.6064634", "0.60563797", "0.6001674", "0.59674597", "0.59522015", "0.59356445", "0.59262383", "0.59262383", "0.58965904", "0.58951765", "0.5876211", "0.58717483", "0.5829043", "0.58243555", "0.5814244", "0.5812931", "0.5806812", "0.5766679", "0.573...
0.6708472
0
paginate a call to find_tagged_with klass is the tagged class tag is the tag to find count is the total number of items with that tag, if nil count_tags is called per_page is numbe rof items per page page is the page we are on order is the order to return the items in
def tag_paginator(klass, tag, count=nil, per_page=10, page=1, offset = 0, order='created_at DESC') count ||= klass.count_tags(tag) pager = ::Paginator.new(count, per_page) do |offset, per_page| klass.find_tagged_with(tag, :order => order, :limit => per_page, :offset => offset) end page ||= 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def articles_tagged(tag, options = {})\n tag = Tag.first(:name => tag)\n return 0 unless tag\n t = self.taggings.paginate(options.merge(:tag_id => tag.id))\n collection = t.collect{|tagging| tagging.article}\n collection = collection.delete_if{|a| !a.published?}\n \n collection.instance_variab...
[ "0.66003436", "0.6391298", "0.6306939", "0.62793404", "0.627472", "0.6229027", "0.62264585", "0.6220754", "0.6141646", "0.60669404", "0.6031202", "0.59485465", "0.5931235", "0.59171915", "0.58777076", "0.58730084", "0.58580357", "0.58524275", "0.5837237", "0.58119905", "0.580...
0.7661707
0
format time to long style
def timelong( time ) time.strftime('%Y-%m-%d %H:%M:%S') if time end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tt(time, format=:short); '13:37'; end", "def time_str\n Time.at(time[0..-4].to_f + time[-3..-1].to_f / 1000)\n .strftime(\"%M:%S.%L\")\n end", "def format_time(time)\n return time.strftime(\"%l:%M%p\")\n end", "def log_fmt_timestamp(time)\n [(time/3600).to_i, (time/60 % 60).to_i...
[ "0.762114", "0.7618584", "0.7519751", "0.74997866", "0.7366242", "0.73236287", "0.7310665", "0.7303636", "0.72753733", "0.7223913", "0.71899843", "0.71463454", "0.71317875", "0.71317875", "0.71245646", "0.7123734", "0.7113938", "0.7100749", "0.7097445", "0.70783395", "0.70604...
0.7941969
0
Explicitly set the name of a queue for the given method route Ex. queue_for :created, "derp.derp" queue_for :updated, "foo.bar"
def queue_for(method, queue_name) @_queue_names ||= {} @_queue_names[method] = queue_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_for(clazz, method)\n ClassAndMethodRouting.queue_for(clazz, method)\n end", "def method_name(queue)\n queue.split(\"__\").last\n end", "def set_queue\n self.add_queue(queue_name) do |metadata, payload|\n log.info(\"Message received with the routing key: #{metad...
[ "0.6981014", "0.68962336", "0.6525915", "0.6506201", "0.6461485", "0.645893", "0.63431305", "0.6225817", "0.62112796", "0.6160546", "0.6122204", "0.6091297", "0.6089492", "0.6051676", "0.6035763", "0.6011947", "0.60045457", "0.5979919", "0.5968651", "0.5962902", "0.59467983",...
0.8305483
0
Explicitly set the whole routing key to use for a given method route.
def routing_key_for(method, routing_key_name) @_routing_key_names ||= {} @_routing_key_names[method] = routing_key_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key(method)\n @_key = method\n end", "def key_method method\n @key_method = method\n validates_presence_of method\n validates_length_of method, minimum: 1\n define_method(:key) { prepare_key(self.send method) }\n end", "def routeable(method, opts={})\n ctrlr_m = me...
[ "0.69384617", "0.6651482", "0.63513935", "0.63444024", "0.6307341", "0.6268025", "0.6026637", "0.5884365", "0.57612115", "0.5741135", "0.57030064", "0.5680921", "0.567883", "0.56576055", "0.5643051", "0.5601336", "0.5593304", "0.5539606", "0.5539606", "0.5539606", "0.5531875"...
0.7632306
0
=begin input: float, output: string. rules: use two digit numbers with leading zeros when formatting minutes and seconds. Use constant to represent degree symbol. if num greater than 360... DS: string algo: define a method called dms, takes one float number parameter num init lv angle, set to empty string turn float nu...
def dms(num) angle_str = %() num_ary = num.to_s.partition('.') #degree angle_str << (num_ary[0] + DEGREE) minutes_seconds_ary = ((num_ary[-1].to_f * 60.0) / 10**(num_ary[-1].size).to_f).to_s.partition('.') #minutes if minutes_seconds_ary[0].size <= 1 angle_str << ('0' + minutes_seconds_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dms(angle)\n# How does LS round them?\n# Also we have to make sure that minutes and seconds esp are either *60 if < than 60, otherwise 0.\n if angle < 0\n degrees = 360 + angle\n elsif angle >= 0 && angle < 360\n degrees = angle.floor\n else\n degrees = angle.floor - 360\n end\n\n minutes =...
[ "0.811914", "0.7688109", "0.7490294", "0.7240925", "0.6438802", "0.6285384", "0.62104726", "0.61305416", "0.61305416", "0.60969335", "0.6086194", "0.5946115", "0.59192365", "0.5828534", "0.5799975", "0.57745075", "0.57702416", "0.57607013", "0.5759594", "0.57516843", "0.57483...
0.8862008
0
OCSP response stapling information.
def ocsp_response @ocsp_response ||= if (ocsp_response = @node.at('ocspStapling/ocspResponse')) OCSPResponse.new(ocsp_response) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def...
[ "0.5713922", "0.5713922", "0.5713922", "0.5713922", "0.5713922", "0.57137907", "0.57137907", "0.57137907", "0.57137907", "0.57137907", "0.57137907", "0.57137907", "0.57137907", "0.5713761", "0.57137346", "0.57137346", "0.57137346", "0.57137346", "0.57137346", "0.57137346", "0...
0.7117692
0
Moves an existing attachment to its target directory
def move_to_target_directory! return if new_record? || !readable? src = diskfile self.disk_directory = target_directory dest = diskfile return if src == dest if !RedmicaS3::Connection.move_object(src, dest) Rails.logger.error "Could not move attachment from #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_path(target_path)\n move_to(cotta.dir(target_path))\n end", "def move_to!(dest)\n Pow(dest).parent.create_directory\n move_to(dest)\n end", "def move_file\n\n end", "def move_to(target)\n target.parent.mkdirs\n factory.system.move_dir(@path, target.path)\n end",...
[ "0.6403506", "0.6348001", "0.6257209", "0.6237689", "0.6198515", "0.6142221", "0.6127432", "0.6096149", "0.60808796", "0.6074945", "0.60710275", "0.59910333", "0.5947841", "0.5944923", "0.5939825", "0.5934065", "0.59334517", "0.5912414", "0.5912376", "0.58944285", "0.5880901"...
0.74365443
0
Updates attachment digest to SHA256
def update_digest_to_sha256! return unless readable? object = self.s3_object sha = Digest::SHA256.new sha.update(object.get.body.read) new_digest = sha.hexdigest unless new_digest == object.metadata['digest'] object.copy_from(object, content_dispos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update!(**args)\n @digest = args[:digest] if args.key?(:digest)\n end", "def update!(**args)\n @sha256_fingerprint = args[:sha256_fingerprint] if args.key?(:sha256_fingerprint)\n end", "def digest\n OpenSSL::Digest::SHA256.file(path).hexdigest\n end", "def update_d...
[ "0.68261296", "0.65919334", "0.64462334", "0.6438088", "0.63679403", "0.62825465", "0.62335134", "0.62332696", "0.6175101", "0.61477673", "0.6091481", "0.60665935", "0.6051113", "0.60375136", "0.6027281", "0.60187125", "0.59736866", "0.5967593", "0.5942377", "0.5942377", "0.5...
0.7091695
0
Extract the connection string for the rabbitmq service from the service information provided by Cloud Foundry in an environment variable.
def amqp_url if not ENV['VCAP_SERVICES'] return { :host => "localhost", :port => 5672, :username => "guest", :password => "guest", :vhost => "/", } end services = JSON.parse(ENV['VCAP_SERVICES'], :symbolize_names => true) url = services.values.map do |srvs| srvs.map do...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def amqp_url\n if not ENV['VCAP_SERVICES']\n return {\n :host => \"172.16.32.11\",\n :port => 5672,\n :username => \"guest\",\n :password => \"guest\",\n :vhost => \"/\",\n }\n end\n\n services = JSON.parse(ENV['VCAP_SERVICES'], :symbolize_names => true)\n url = service...
[ "0.744864", "0.64117", "0.60329986", "0.5871954", "0.58560705", "0.57894254", "0.57065386", "0.5627882", "0.55615014", "0.5546482", "0.5546482", "0.55334806", "0.55314684", "0.55079055", "0.5474078", "0.54584104", "0.544193", "0.54413456", "0.542486", "0.542486", "0.54162025"...
0.7228656
1
Opens a client connection to the RabbitMQ service, if one isn't already open. This is a class method because a new instance of the controller class will be created upon each request. But AMQP connections can be longlived, so we would like to reuse the connection across many requests.
def client unless $client u = amqp_url conn = Bunny.new(u) conn.start $client = conn.create_channel # We only want to accept one un-acked message $client.prefetch(1) end $client end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client\n set_connection unless @client\n @client\n end", "def connect\n @client = @client_class.new\n @client.connect\n \n begin\n yield\n ensure\n @client.close\n ActiveRecord::Base.verify_active_connections...
[ "0.6548404", "0.64997256", "0.64857477", "0.60641325", "0.5975623", "0.5912363", "0.59114003", "0.5911384", "0.58854485", "0.58396304", "0.58234626", "0.5794034", "0.57795596", "0.57611126", "0.5743635", "0.5731797", "0.57183796", "0.5711126", "0.56997025", "0.5653327", "0.56...
0.6635481
0
Return a queue named "messages". This will create the queue on the server, if it did not already exist. Again, we use a class method to share this across requests.
def messages_queue $messages_queue ||= client.queue("messages", :durable => true, :auto_delete => false) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_message_counting_queue\n\t\t@queue ||= begin\n\t\t\tself.log.debug \"Creating the message-counting queue.\"\n\t\t\tchannel = Symphony::Queue.amqp_channel\n\t\t\tchannel.queue( self.task_class.queue_name, passive: true, prefetch: 0 )\n\t\tend\n\n\t\tunless @queue.channel.open?\n\t\t\tself.log.info \"Message...
[ "0.6965326", "0.6934442", "0.6900829", "0.68643856", "0.669572", "0.6582891", "0.6572753", "0.64675933", "0.6448573", "0.64448285", "0.6387933", "0.6336", "0.6335639", "0.6327123", "0.63090515", "0.6302529", "0.62941766", "0.6272013", "0.6270611", "0.619088", "0.616224", "0...
0.71517956
0
If all gates are hidden, the sation must be hidden, if one is visible, station must be visible.
def check_station_visibility station.update(hidden: station.access_control_gates.where.not(id: id).pluck(:hidden).push(hidden).uniq.all?) if hidden_changed? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hidden?\n not visible\n end", "def hidden?\n hidden_at?\n end", "def hidden?\n hidden_at?\n end", "def hidden?\n hidden_at?\n end", "def is_hidden?\n\t\tself.hidden\n\tend", "def visible=(vis)\n if vis\n show\n else\n hide\n end\n en...
[ "0.59830505", "0.5975337", "0.5975337", "0.5975337", "0.58056545", "0.57636184", "0.5762808", "0.5742529", "0.57018614", "0.5693261", "0.5692501", "0.56769437", "0.5599049", "0.5597899", "0.556726", "0.5563838", "0.5563838", "0.5510256", "0.55089086", "0.5505045", "0.55018234...
0.7611455
0
Create a status record if one does not exist
def check_create_status if self.v_status.nil? status = VStatus.new status.v_project = self status.v_user_data = self.v_user_data self.v_status = status end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_status(Status status)\n Status.create(group_id: @group_id, status: status)\n end", "def status\n s = statuses.find(:first, :order => \"updated_at DESC\")\n if s.nil?\n s = statuses.create :organization_quarter_status_type_id => OrganizationQuarterStatusType.find_or_create_by_title(\"Nee...
[ "0.7206832", "0.64852256", "0.6247204", "0.6198068", "0.6172983", "0.617294", "0.61392707", "0.61080515", "0.60675484", "0.6065306", "0.60581666", "0.60264796", "0.60083133", "0.5981415", "0.5973524", "0.5959304", "0.59199077", "0.59189254", "0.59189254", "0.59052587", "0.587...
0.7056659
1
GET /maintenance_schedules/1 GET /maintenance_schedules/1.xml
def show @maintenance_schedule = MaintenanceSchedule.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @maintenance_schedule } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @schedules = Schedule.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @schedules }\n end\n end", "def maintenance_list(statuspage_id)\n request :method => :get,\n :url => @url + 'maintenance/list/' + statuspage_id\n end...
[ "0.6799355", "0.67379797", "0.66771525", "0.6662656", "0.661458", "0.65610164", "0.6522342", "0.6514605", "0.64728725", "0.6445298", "0.6423056", "0.63741785", "0.6374074", "0.6298707", "0.62879014", "0.62817985", "0.62353796", "0.6233531", "0.6213049", "0.6212554", "0.619498...
0.74508256
0
GET /maintenance_schedules/new GET /maintenance_schedules/new.xml
def new @maintenance_schedule = MaintenanceSchedule.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @maintenance_schedule } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n respond_to do |format|\n format.xml { render :xml => @schedule }\n end\n end", "def new\n @schedule = Schedule.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @schedule }\n end\n end", "def new\n @schedule = Schedule.n...
[ "0.7685377", "0.7409408", "0.7407814", "0.73829937", "0.73501813", "0.72707444", "0.7183455", "0.6852251", "0.6832066", "0.6758014", "0.66073716", "0.6599364", "0.65242624", "0.65040135", "0.64763653", "0.6439372", "0.6435777", "0.64250743", "0.6356924", "0.6353907", "0.63486...
0.79876274
0
POST /maintenance_schedules POST /maintenance_schedules.xml
def create @maintenance_schedule = MaintenanceSchedule.new(params[:maintenance_schedule]) respond_to do |format| if @maintenance_schedule.save format.html { redirect_to(@maintenance_schedule, :notice => 'Maintenance schedule was successfully created.') } format.xml { render :xml => @main...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maintenance_schedule(statuspage_id, maintenance_name, maintenance_details, infrastructure_affected,\n date_planned_start, time_planned_start, date_planned_end, time_planned_end,\n automation = \"0\", all_infrastructure_affected = \"0\",\n ...
[ "0.7592277", "0.61357504", "0.60902613", "0.6038409", "0.6036109", "0.6004008", "0.5988473", "0.5984874", "0.59486353", "0.59261113", "0.59167206", "0.5914411", "0.59142184", "0.5912462", "0.5911313", "0.5902852", "0.5888488", "0.58406913", "0.5836415", "0.58203983", "0.58186...
0.70385146
1
PUT /maintenance_schedules/1 PUT /maintenance_schedules/1.xml
def update @maintenance_schedule = MaintenanceSchedule.find(params[:id]) respond_to do |format| if @maintenance_schedule.update_attributes(params[:maintenance_schedule]) format.html { redirect_to(@maintenance_schedule, :notice => 'Maintenance schedule was successfully updated.') } format....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to(@schedule, :notice => 'Schedule was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render ...
[ "0.66244733", "0.6582157", "0.65461344", "0.6512493", "0.6391176", "0.63862675", "0.63702404", "0.6367937", "0.63517505", "0.6341044", "0.62997496", "0.62910575", "0.62886566", "0.6260788", "0.62589717", "0.6247493", "0.6247493", "0.6247493", "0.6247493", "0.6247493", "0.6247...
0.719088
0
DELETE /maintenance_schedules/1 DELETE /maintenance_schedules/1.xml
def destroy @maintenance_schedule = MaintenanceSchedule.find(params[:id]) @maintenance_schedule.destroy respond_to do |format| format.html { redirect_to(maintenance_schedules_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to(schedules_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to(sched...
[ "0.71289223", "0.711882", "0.711882", "0.711882", "0.69836265", "0.69667125", "0.6863063", "0.67685264", "0.6731389", "0.6713114", "0.6693143", "0.66671944", "0.66583836", "0.66100526", "0.6592417", "0.6592277", "0.6559888", "0.655949", "0.65569353", "0.6556303", "0.6544897",...
0.7805734
0
Check that all arguments are probabilites i.e. the are numbers between 0.0 and 1.0
def assert_probability *args assert_floatable(*args) args.each do |var| assert do var >= 0.0 && var <= 1.0 end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validates_probability_constraints\n if project_state\n if (project_state.name == 'lead') && (probability >= 1.0)\n errors.add(:base,\n \"Probability of #{probability} is not allowed for the project state #{project_state.name}\")\n end\n\n if (project_state.name == 'of...
[ "0.66886836", "0.61350894", "0.61068773", "0.60648835", "0.59587735", "0.59119785", "0.588656", "0.57861376", "0.5775112", "0.5772532", "0.5768143", "0.57274085", "0.57232666", "0.56961894", "0.5673697", "0.5658413", "0.56407744", "0.56374884", "0.56367", "0.56323916", "0.562...
0.76469076
0
Checks that all arguments are float or can be converted to a float.
def assert_floatable *args args.each do |var| assert do var.not_nil? && var.is_a?(Numeric) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def are_floats?(x,y)\n return x.is_a?(Float) && y.is_a?(Float)\n end", "def float3?(input)\n Float(input) rescue false\nend", "def float?\n !!Float(self)\n rescue ArgumentError, TypeError\n false\n end", "def expect_float(value, field, subfield)\n return true if value....
[ "0.7191555", "0.7092259", "0.7052646", "0.6985228", "0.69429123", "0.6911194", "0.68796366", "0.6865836", "0.68004644", "0.6793842", "0.6787838", "0.67493224", "0.6737424", "0.6661897", "0.6661897", "0.6627653", "0.6617286", "0.6613689", "0.6613377", "0.6606092", "0.65955573"...
0.74273723
0
Checks that all arguments are symbols.
def assert_symbol *args args.each{|a| assert{a.is_a?(Symbol)}} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def only_symbols?(*args)\n symbols = args.select { |_| _.is_a? Symbol }\n if symbols.length == args.length\n return true\n end\n false\n end", "def no_symbols?(*args)\n symbols = args.select { |_| _.is_a? Symbol }\n if symbols.length > 0\n return false\n end\n true\n end", "...
[ "0.77265733", "0.74199957", "0.6752929", "0.6687441", "0.6634704", "0.62949455", "0.6239125", "0.6207252", "0.61717194", "0.61463135", "0.6138728", "0.6074802", "0.6074802", "0.58708584", "0.58428615", "0.5813767", "0.57811606", "0.5779471", "0.57729316", "0.5757847", "0.5747...
0.74488574
1
Checks that all arguments are a Proc object or +nil+.
def assert_proc_or_nil *args args.each{|a| assert{a.nil? || a.is_a?(Proc)}} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_proc?(p)\n p.is_a?(Proc) || p.is_a?(Method)\n end", "def any_args?\n @any_args\n end", "def any_args?\n @any_args\n end", "def callable_with?(args, callable=nil)\n signatures = @func.dispatcher.to_type\n callables = signatures.is_a?(Puppet::Pops::Types::PVariantType) ...
[ "0.6297956", "0.6170972", "0.6170972", "0.5925793", "0.57466346", "0.56804603", "0.56517655", "0.564564", "0.56393903", "0.56253296", "0.56065905", "0.55867416", "0.5580973", "0.5560038", "0.5558509", "0.5510403", "0.5493208", "0.5493208", "0.5469272", "0.5432577", "0.5421892...
0.7289663
0
POST /employees_roles POST /employees_roles.json
def create @employees_role = EmployeesRole.create(employees_role_params) redirect_to employees_roles_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_employee_role(body:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v1/me/roles'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json',\n 'content-type' => ...
[ "0.7080383", "0.68218297", "0.6687899", "0.6650206", "0.6552826", "0.6469759", "0.6410619", "0.6390163", "0.63549286", "0.63196176", "0.6303331", "0.63011956", "0.62763643", "0.6245801", "0.6241004", "0.62396085", "0.62288684", "0.62150186", "0.61875415", "0.61672366", "0.614...
0.7312509
0
clean up the filters so only valid ones exist
def clean_filters cleaned_filters = {} self.filters.each do |name, value| if (self.filter_options[name.to_sym][:fields].detect{|f| f[:value] == value } rescue false) cleaned_filters[name.to_sym] = value end end self.filters = cleaned_filters end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_filters\n params = instance_values.symbolize_keys\n filters = clean_params(params)\n validate_filters(filters)\n end", "def remove_filters!\n @filters = []\n end", "def filters; end", "def filters; end", "def set_filters\n @filters = ''\n @filters.concat(\"status:'Avail...
[ "0.794043", "0.7490198", "0.7308222", "0.7308222", "0.71641165", "0.71485585", "0.7070446", "0.7038898", "0.7034479", "0.6862236", "0.68190986", "0.67827415", "0.67598474", "0.67598474", "0.67598474", "0.67114085", "0.67074555", "0.67074555", "0.6700287", "0.66866624", "0.667...
0.8127907
0
test return via tail call
def test_will_return_via_tail_call src =<<-EOC defn g() {9} defn f(x) { zero?(:x) && return %g %g + 9 } EOC vi = mkvi src+"\nf(0)\n";ti = mkti src+"\nf(0)\n" assert (vi.run == 9) && (ti.run == 9), "Expected both optimized and non_optiized to return9, but one of them did not" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_ending(_result)\n end", "def demonstrate_early_return\n return\n puts \"You will never see this, because we never get here.\"\nend", "def call\n [false, yield]\n rescue halt => e\n [true, e.payload[0]]\n end", "def success?() end", "def exit(res=0) end",...
[ "0.6785964", "0.6284976", "0.624223", "0.62293106", "0.6119412", "0.6087102", "0.60093004", "0.59873486", "0.5900966", "0.58965045", "0.5880964", "0.5872966", "0.58577317", "0.58067894", "0.57845235", "0.57704794", "0.57646817", "0.5745195", "0.5735738", "0.57289803", "0.5717...
0.6735239
1
Should not have any tail calls for toplevel conditionals, either.
def test_top_level_conditionals_should_not_have_tail_calls tcompile 'zero?(0) && %g' tail_found = false lambdacall_found = false visit_tree @tc.ast, lambdacall: ->(x) { lambdacall_found = true }, tailcall: ->(x) { tail_found = true } assert !tail_found, "Expected to not find any :tailcalls, but di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def naked_top_level?; end", "def naked_top_level; end", "def test_non_tail_position_blocks_cannot_have_tailcalls\n tails_found = 0\n tcompile 'defn foo() {{9; %g}; 99}'\n visit_tree @tc.ast, tailcall:->(x) {tails_found += 1 }\n assert tails_found.zero?, \"Expected to not find any tail calls, but fo...
[ "0.7108519", "0.6499122", "0.6320789", "0.61334276", "0.61334276", "0.61334276", "0.60807234", "0.6032399", "0.6032399", "0.6032399", "0.5990137", "0.5982177", "0.5982177", "0.5909732", "0.59077466", "0.58573425", "0.580224", "0.5733866", "0.5727014", "0.566493", "0.56537306"...
0.71061885
1
Cannot have tail calls in blocks that are not the tail position inside lambdas. Must refrain from promoting anything in block or conditional into tailcall.
def test_non_tail_position_blocks_cannot_have_tailcalls tails_found = 0 tcompile 'defn foo() {{9; %g}; 99}' visit_tree @tc.ast, tailcall:->(x) {tails_found += 1 } assert tails_found.zero?, "Expected to not find any tail calls, but found #{tails_found} instead" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_does_not_convert_lambdacalls_to_tailcalls_for_top_level_constructs\n tcompile 'defn g() {9}; {1; %g}'\n tail_found = false\n lambdacall_found = false\n visit_tree @tc.ast, lambdacall: ->(x) { lambdacall_found = true }, tailcall: ->(x) { tail_found = true }\n assert !tail_found, \"Expected t...
[ "0.6700456", "0.6526589", "0.6526163", "0.6451164", "0.6203788", "0.6100986", "0.6070055", "0.6023657", "0.59866434", "0.5948143", "0.59413046", "0.59318626", "0.58681124", "0.58627313", "0.58618885", "0.5852341", "0.5849713", "0.584776", "0.58378494", "0.58378494", "0.582796...
0.6599951
1
PATCH/PUT /tutorials/1 PATCH/PUT /tutorials/1.json
def update respond_to do |format| if @tutorial.update(tutorial_params) format.html { redirect_to @tutorial, notice: 'Tutorial was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @tutorial.erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @tutorial = Tutorial.find(params[:id])\n\n respond_to do |format|\n if @tutorial.update_attributes(params[:tutorial])\n format.html { redirect_to @tutorial, notice: 'Tutorial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { ren...
[ "0.66692483", "0.66692483", "0.66230613", "0.66168857", "0.66019565", "0.64313674", "0.64128816", "0.62854636", "0.62485856", "0.617944", "0.6116152", "0.6110436", "0.6091951", "0.60826355", "0.60359186", "0.6025176", "0.60157734", "0.59678245", "0.5939726", "0.5926772", "0.5...
0.6698879
0
DELETE /tutorials/1 DELETE /tutorials/1.json
def destroy @tutorial.destroy respond_to do |format| format.html { redirect_to tutorials_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @tutorial = Tutorial.find(params[:id])\n @tutorial.destroy\n render json: @tutorial\n end", "def destroy\n @tutorial = Tutorial.find(params[:id])\n @tutorial.destroy\n\n respond_to do |format|\n format.html { redirect_to tutorials_url }\n format.json { head :no_content ...
[ "0.77756006", "0.77635777", "0.76979846", "0.7655823", "0.7637724", "0.7615782", "0.7406003", "0.7403622", "0.7369901", "0.7306867", "0.7271038", "0.72081655", "0.72025627", "0.71776426", "0.7145344", "0.71135455", "0.7080351", "0.70493287", "0.7030867", "0.70085275", "0.6996...
0.78816277
0
Right now we have /v2/exercises and /v2/exercises/:track_id. Let's tweak the /v2/exercises to take an optional parameter ?tracks=a,b,c and if that parameter is passed, only return the data for those tracks.
def test_that_you_may_filter_to_single_track getting '/v2/exercises?tracks=fruit' returns_tracks %w( fruit ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n if params[:track_id]\n @track = Track.find(params[:track_id])\n @events = Event.where(track_id: params[:track_id]).where(event_type: 'track')\n else\n @events = Event.all\n end\n end", "def search_track(opts = {}, &block)\n if opts.is_a? String\n query = opts\n ...
[ "0.606591", "0.57334566", "0.5726674", "0.56712407", "0.558732", "0.55744505", "0.5491342", "0.54742", "0.5463494", "0.5418604", "0.5404517", "0.54043984", "0.53959787", "0.5373809", "0.5305484", "0.52836776", "0.5282571", "0.5272556", "0.52332693", "0.52332693", "0.52280957"...
0.7185951
0
Debit the label's account, and each parent up the tree.
def debit_sign_up user, transaction_event, label return if label.nil? # It's ok if the balance goes negative, we want the sign up either way. This is an atomic update Label.update_all("available_balance = available_balance - package_signup_rate", {id: label.id}) label.reload ce = CreditEvent.cre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def debit\n @debit ||= begin\n @debit = if parent\n expenses.debit.sum(:transaction_amount)\n else\n children.inject(0) { |total, child| total += child.debit }\n end\n end\n end", "def unbranch\n @child\n end", "def down\n @level += 1\n add_newline\n ...
[ "0.6143413", "0.5633018", "0.55283314", "0.54975086", "0.52922297", "0.5230875", "0.5215906", "0.5189633", "0.51758176", "0.5163152", "0.5151609", "0.51502055", "0.5149883", "0.51460785", "0.5141521", "0.51234025", "0.51225007", "0.5096106", "0.509563", "0.5074093", "0.502501...
0.62035877
0
Each month, debit the label for each active subscription. Care has been taken so that this job, which usually runs from a cron > rake task, can safely be rerun in case an error occurs.
def debit_monthly_subscriptions ccp = CreditCardProcessor.new(@label) # subscriptions dont start for atleast a month after being created. # filter out any recently billed subscriptions. This allows a job to rerun safely if an error occurs. @label.subscriptions.where('created_at < ? and label_last_bi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def month_label\n \"#{label}\"\n end", "def perform\n @previousMonth = (Date.today - 1.months).strftime(\"%Y-%m\")\n\n \t# Only exec with subscription status is active\n # Subscription subscription_type == 1 is free trial\n # If user upgrade subscription, and then subscription_type update to 2 is i...
[ "0.5627847", "0.554653", "0.55419827", "0.5530015", "0.5518673", "0.5309939", "0.52983016", "0.5261452", "0.5261452", "0.52268386", "0.5170234", "0.5152929", "0.50666344", "0.50568134", "0.50348157", "0.50147647", "0.5014254", "0.49698037", "0.49676493", "0.49538717", "0.4953...
0.72310346
0
GET /armas/new GET /armas/new.json
def new @arma = Arma.new respond_to do |format| format.html # new.html.erb format.json { render json: @arma } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @aroma = Aroma.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aroma }\n end\n end", "def new\n @manga = Manga.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manga }\n end\n end"...
[ "0.7549714", "0.7383404", "0.7377255", "0.7367986", "0.730991", "0.72938913", "0.72883743", "0.72838646", "0.72799796", "0.7267717", "0.72607434", "0.72563845", "0.72356594", "0.7224617", "0.7216198", "0.7216198", "0.7216198", "0.7209998", "0.7201315", "0.71820986", "0.717998...
0.74300873
1
POST /armas POST /armas.json
def create @arma = Arma.new(params[:arma]) respond_to do |format| if @arma.save format.html { redirect_to @arma, notice: 'Arma was successfully created.' } format.json { render json: @arma, status: :created, location: @arma } else format.html { render action: "new" } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @armazena = Armazena.new(armazena_params)\n\n respond_to do |format|\n if @armazena.save\n format.html { redirect_to @armazena, notice: 'Armazena was successfully created.' }\n format.json { render :show, status: :created, location: @armazena }\n else\n format.html...
[ "0.6315217", "0.63119906", "0.6170182", "0.6012161", "0.59608924", "0.592838", "0.5910538", "0.5907308", "0.5897372", "0.58575916", "0.5857578", "0.5840712", "0.58275205", "0.5826234", "0.5800352", "0.57831806", "0.57798153", "0.576889", "0.57540303", "0.57385564", "0.5730596...
0.6746256
0
Save auto scale group
def group_save(group) raise NotImplementedError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_save\n api.group_save(self)\n end", "def auto_scaling_group_name\n data.auto_scaling_group_name\n end", "def save_groups\n self.groups.each { |c| if c.destroy_association? then c.destroy else c.save end }\n self.added_groups.each { |c| c.save unless c.nil? } unless...
[ "0.63678324", "0.57937557", "0.57171226", "0.5675286", "0.5606568", "0.55539775", "0.55265784", "0.55089664", "0.55089664", "0.5476972", "0.5460333", "0.5449027", "0.54341185", "0.540207", "0.53455514", "0.5318177", "0.5265907", "0.5244669", "0.52410775", "0.5230672", "0.5198...
0.6210058
1
Reload the group data from the API
def group_reload(group) if(group.persisted?) result = request( :method => :get, :path => "/groups/#{group.id}", :expects => 200 ) grp = result.get(:body, :group) group.load_data( :name => grp.get('groupConf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_reload\n api.group_reload(self)\n end", "def fetch_group_data\n response = fetch_data(@@SETTINGS.group_tab)\n unless response.nil?\n adjust_groups response\n end\n end", "def refresh_ce_group!\n self.save! if refresh_ce_group\n end", "def refresh\n fetch_...
[ "0.81318593", "0.703726", "0.6859572", "0.6815805", "0.6695819", "0.6631904", "0.6581476", "0.656722", "0.6537091", "0.6537091", "0.64264214", "0.64112556", "0.64005286", "0.6383394", "0.63491476", "0.63233507", "0.6278371", "0.62172574", "0.61674315", "0.6104667", "0.6093864...
0.7543723
1
Throws InvalidListOptions if options were passed that shouldn't have been.
def sanitize_options(options) options.keys.each do |key| unless Facade.options[:valid_find_options].include?(key) || Facade.options[:valid_list_options].include?(key) raise InvalidListOptions, "Bad key passed: #{key}" end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_arguments!(list)\n chk_idx = list.find_index do |item|\n item.start_with?(\"-\")\n end\n if chk_idx\n marker = list.find_index do |item|\n item == \"--\"\n end\n if marker.nil? || chk_idx.to_i < marker\n raise ArgumentError...
[ "0.60217386", "0.5918961", "0.5694803", "0.56383955", "0.5546811", "0.5538718", "0.5532386", "0.5525195", "0.550749", "0.550749", "0.550749", "0.550749", "0.550749", "0.550749", "0.550749", "0.550749", "0.550749", "0.550749", "0.550749", "0.5477994", "0.54726887", "0.543106...
0.6877995
0
Merge options for a specified name and type into the defaults and return the result.
def merge_default_options(name, type, options = {}) list_options[name][type].merge(options) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_defaults(options = {})\n defaults = {}\n # defaults[:character_name] = @charater_name if @charater_name\n defaults[:region] = @region if @region\n defaults[:caching] = @caching if @caching\n defaults[:cache_timeout] = @cache_timeout if @c...
[ "0.6763694", "0.66728336", "0.6660936", "0.6320446", "0.6311713", "0.6286139", "0.62812316", "0.62222826", "0.6202263", "0.6159285", "0.61196816", "0.61132604", "0.6086944", "0.6043457", "0.6018442", "0.5958097", "0.5932961", "0.5932961", "0.5873984", "0.5847051", "0.58383256...
0.8110009
0
Does this questionnaire contain true/false questions?
def true_false_questions? for question in questions if question.true_false return true end end return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def true_false_questions?\n questions.each {|question| return true if question.type == \"Checkbox\" }\n false\n end", "def accurate?(bools)\n self.answers.map(&:correct) == bools\n end", "def has_questions?\n all_questions.any?\n end", "def asks_mentor_questions?\n !mentor_questions.emp...
[ "0.81814826", "0.7937805", "0.7718431", "0.74691224", "0.7414392", "0.7267982", "0.72587055", "0.7108089", "0.6977733", "0.69633234", "0.6924816", "0.69076", "0.68839586", "0.6853858", "0.6846446", "0.6827125", "0.6693314", "0.6689697", "0.6688145", "0.661745", "0.6606379", ...
0.8456944
0
Produces a speech from V For Vendetta.
def speech fetch('v_for_vendetta.speeches') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def speech; end", "def speak\n object_instance = object_instances.last\n Liquid::Template.parse(text_to_voice).render(object_instance.try(:attributes))\n end", "def song(verse_a, verse_b)\np \"#{verse_a} #{verse_b}\"\nend", "def create_speech(*options)\n CreateSpeech.new(self, options).run\...
[ "0.6464186", "0.5780375", "0.57137156", "0.5661812", "0.5639414", "0.54925907", "0.54823005", "0.54450345", "0.54207647", "0.54061383", "0.5394538", "0.53883016", "0.5357197", "0.53524727", "0.5351263", "0.53418714", "0.5319124", "0.5303272", "0.5272527", "0.5261624", "0.5257...
0.76637614
0
Produces a quote from V For Vendetta.
def quote fetch('v_for_vendetta.quotes') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def marvin_quote; end", "def king_richard_iii_quote; end", "def quote; end", "def quote; end", "def quote; end", "def quote; end", "def quote; end", "def quote; end", "def quote; end", "def quote; end", "def quote; end", "def quote; end", "def quote; end", "def quote; end", "def quote; ...
[ "0.6398001", "0.5817355", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "0.5687348", "...
0.74163526
0
Download a recording of a webinar downloading the webinar records via the download url is only possible if: you enable redirection you use the JWT access token will not work with the Oauth token. This is a known bug in the API.
def meeting_recordings_download_file(download_url) raise "You must use JWT client" unless self.class == Zoom::Clients::JWT file=Tempfile.create file.binmode response = HTTParty.get("#{download_url}?access_token=#{access_token}", stream_body: true, follow_redirects: tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download(recording, filename = nil)\n \n # If no filename is given, we default to <title>_<recstartts>.<extension>\n if filename.nil?\n filename = recording.title + \"_\" +\n recording.myth_nondelimited_recstart + File.extname(recording.filename) \n end\n\n Fil...
[ "0.6099939", "0.6029227", "0.595342", "0.5923552", "0.58909374", "0.588413", "0.5815108", "0.57964456", "0.5755457", "0.5736824", "0.5724132", "0.5716938", "0.5714595", "0.5707191", "0.5705633", "0.5700611", "0.56973696", "0.56591284", "0.5654231", "0.5643808", "0.5617047", ...
0.77112764
0
Used to perform a mouse up on this view in the remote application
def mouse_up() mouse_up_at :center, :center end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mouse_up *args; end", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def mouseUp event\n return if viewAtPoint(convertPoint(event.locationInWindow, fromView:nil)).nil?\n super(event) \n end", "def onLButtonUp(flags, x, y, view)\n end", "def mouseup(btn = 'left')\n co...
[ "0.74409336", "0.70411247", "0.7015006", "0.68757945", "0.66723114", "0.66310817", "0.65456325", "0.643381", "0.64202833", "0.6317513", "0.6235888", "0.6089067", "0.6086203", "0.60452515", "0.5999381", "0.59874123", "0.5944232", "0.5944232", "0.59237576", "0.5908306", "0.5902...
0.7168414
1
Used to perform a mouse down with right button on this view in the remote application
def right_mouse_down() right_mouse_down_at :center, :center end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def right_click(name, *args)\n widget(name, *args).right_click\n end", "def mouseButton()\n @view__.mouseButton\n end", "def mousedown(btn = 'left')\n compatible_call...
[ "0.8220887", "0.71045494", "0.6909964", "0.68614495", "0.67855126", "0.67848325", "0.6757193", "0.6700054", "0.6669304", "0.6649842", "0.65229195", "0.65229195", "0.6459944", "0.64044327", "0.6401079", "0.6364125", "0.6337989", "0.6335398", "0.6329051", "0.63116217", "0.62975...
0.7414242
1
Used to perform a mouse up with right button on this view in the remote application
def right_mouse_up() right_mouse_up_at :center, :center end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def onRButtonUp(flags, x, y, view)\n end", "def right_mouse_down()\n right_mouse_down_at :center, :center\n end", "def onLButtonUp(flags, x, y, view)\n end", "def mous...
[ "0.7615465", "0.7209488", "0.6829979", "0.67707485", "0.6718878", "0.66101974", "0.6556208", "0.65283513", "0.64247715", "0.64025277", "0.6345036", "0.62631476", "0.6256526", "0.6186642", "0.61424077", "0.61206996", "0.6113832", "0.6061944", "0.60308164", "0.60274345", "0.600...
0.7255497
1
Used to perform a single right click on this view in the remote application
def right_click() right_mouse_down right_mouse_up stall :right_click end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click\n p [ :app_click ]\n view.click\n end", "def right_click(name, *args)\n widget(name, *args).right_click\n end", "def click(btn)\n not_supported \"anything other than left clicking\" unless btn == 'left'\n execute_applescript(%Q`\n tell application \"Extra Sui...
[ "0.69611996", "0.6806256", "0.66562665", "0.64541644", "0.63785434", "0.6358608", "0.630985", "0.63055325", "0.6230192", "0.6185122", "0.616992", "0.6126149", "0.5999554", "0.59909505", "0.5973776", "0.59367365", "0.5917623", "0.5895321", "0.5859786", "0.5852538", "0.5851412"...
0.6970275
0
Used to perform a mouse wheel action on the xaxis
def mouse_wheel_delta_x(delta) @driver.sc_mouse_wheel_delta_x action_target, delta, *action_locator_args stall :mouse_wheel end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scroll_mouse(x_amount, y_amount)\n send_request RequestMessage.new(mouse_wheel_message: MouseWheel.new(x_scroll: x_amount, y_scroll: y_amount))\n end", "def mouse_x\n end", "def mouse_x_update(val)\n $mouse_x += val\n sc_osc \"/n_set\", $synth_g, \"x\", $mouse_x\nend", "def mouseX; end", "de...
[ "0.6770733", "0.6498436", "0.63490856", "0.6292921", "0.6154801", "0.60555744", "0.60477966", "0.6037942", "0.6001609", "0.59388274", "0.591052", "0.591052", "0.5729326", "0.5668674", "0.5656004", "0.5642068", "0.5602431", "0.55874383", "0.55874383", "0.5560465", "0.55550665"...
0.7761264
0
Used to perform a mouse wheel action on the yaxis
def mouse_wheel_delta_y(delta) @driver.sc_mouse_wheel_delta_y action_target, delta, *action_locator_args stall :mouse_wheel end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mouse_y\n end", "def move_home_y\n @axis_y.move_home()\n @axis_y.disable_motor()\n end", "def mouseY; end", "def yaxis\n end", "def mouse_moved\n modulate_amount = map1d(mouse_y, (0..height), (220..1))\n modulate_frequency = map1d(mouse_x, (0..width), (0.1..100)) \n fm.frequency.set_last_v...
[ "0.6374681", "0.61653805", "0.61569786", "0.61246145", "0.6017624", "0.59153116", "0.58866054", "0.5867629", "0.5809054", "0.5772996", "0.57716495", "0.5763039", "0.5592902", "0.5578934", "0.5560531", "0.55119735", "0.55083764", "0.54832613", "0.54794395", "0.5450281", "0.544...
0.7782795
0
Used to perform a key down on this view in the remote application You can either type a printable character or a function key. If you want to type a printable character then the 'key' parameter just has to be a string, such as 'a'. If you want to type a function key such as F1, then the 'key' parameter must be the corr...
def key_down(key) focus @driver.sc_key_down action_target, key, *action_locator_args stall :key_down end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def down(key)\n key = normalize_keys(Array(key)).first\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: type, **key)\n self\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "...
[ "0.81894314", "0.77000344", "0.77000344", "0.71842504", "0.6992742", "0.69250065", "0.6849509", "0.6667458", "0.6621216", "0.6574964", "0.65252584", "0.65185386", "0.64259654", "0.6388991", "0.63725513", "0.63124335", "0.63088435", "0.62571913", "0.6159989", "0.61031437", "0....
0.77849996
1
Used to type a key on this view in the remote application. This will cause a key down followed by a key up You can either type a printable character or a function key. If you want to type a printable character then the 'key' parameter just has to be a string, such as 'a'. If you want to type a function key such as F1, ...
def type_key(key) focus @driver.sc_type_key action_target, key, *action_locator_args stall :type_key end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type(key)\n send_command([:type, key])\n end", "def type(key)\n call_command(['type', key])\n end", "def type(key)\n call_command(['type', key])\n end", "def type(*keys)\n keys = normalize_keys(Array(keys))\n\n keys.each do |key|\n type = key[:text] ? \"keyDown\" ...
[ "0.7480066", "0.73115885", "0.72530967", "0.71177316", "0.6900506", "0.6753131", "0.661871", "0.64906937", "0.6437501", "0.6437501", "0.63951325", "0.62520427", "0.62520427", "0.61219114", "0.6108311", "0.6108311", "0.61071455", "0.60195", "0.5999828", "0.5995542", "0.5982869...
0.7402131
1
Override this to supply the arguments to generate the locator
def action_locator_args() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __find_args__\n self\n end", "def locator(options={})\n options.inject([]) do |locators, locator|\n key, value = locator\n locators << \"#{key}:#{value}\"\n end.join(',')\n end", "def args()\n #This is a stub, used for indexing\n end", "def regio...
[ "0.6004458", "0.59963995", "0.59331214", "0.5824153", "0.5785663", "0.57632834", "0.5745456", "0.5745456", "0.573316", "0.5699353", "0.5698791", "0.5696598", "0.5635229", "0.5607605", "0.5593467", "0.5593467", "0.5554346", "0.55269915", "0.54894", "0.5470132", "0.5441323", ...
0.6621261
0
Merges accepted corrections for specially formatted files into content AT. This is done in two steps: 1. Apply all corrections that can be done automatically (based on exact text matches) 2. Apply manual corrections where no or multiple extact matches are found. We have to do it in two steps so that when we open the fi...
def merge_accepted_corrections_into_content_at(options) # First validate the spot sheets and cancel process if errors are found. validate_spot_sheet(options.merge('validate_or_merge' => 'merge')) accepted_corrections_base_dir = config.compute_base_dir( options['base-dir'] || ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fix_adjust_merged_record_mark_positions(options)\n input_file_spec = options['input'] || 'staging_dir/at_files'\n Repositext::Cli::Utils.change_files_in_place(\n config.compute_glob_pattern(input_file_spec),\n /\\.at\\z/i,\n \"Adjusting merged :record_mark positions\",\...
[ "0.54476726", "0.5409826", "0.5293991", "0.52066636", "0.5095803", "0.5063352", "0.50611675", "0.49807286", "0.4966632", "0.4940869", "0.4900983", "0.48987687", "0.48934543", "0.4866788", "0.48495376", "0.4838936", "0.48299643", "0.48292568", "0.48143947", "0.4813448", "0.480...
0.7996232
0
Merges gap_mark_tagging_import into content AT. Uses content AT as authority for text.
def merge_gap_mark_tagging_import_into_content_at(options) gap_mark_tagging_import_base_dir = config.compute_base_dir( options['base-dir'] || options['base-dir-1'] || :gap_mark_tagging_import_dir ) gap_mark_tagging_import_glob_pattern = config.compute_glob_pattern( gap_mark_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_gap_mark_tagging(options)\n input_file_spec = options['input'] || 'content_dir/at_files'\n input_base_dir_name, input_file_pattern_name = input_file_spec.split(\n Repositext::Cli::FILE_SPEC_DELIMITER\n )\n output_base_dir = options['output'] || config.base_dir('gap_m...
[ "0.6669897", "0.6423653", "0.5679911", "0.5664879", "0.5527974", "0.5379095", "0.5342197", "0.52206373", "0.5152867", "0.5109662", "0.50669765", "0.50081336", "0.49331763", "0.478046", "0.47328126", "0.47231713", "0.47207317", "0.4708869", "0.4655644", "0.46509063", "0.462561...
0.7781892
0
Merges record_marks from FOLIO XML import into IDML import Uses IDML as authority for text and all tokens except record_marks. If no IDML file is present, uses FOLIO XML as authority for everything.
def merge_record_marks_from_folio_xml_at_into_idml_at(options) input_folio_base_dir = config.compute_base_dir( options['base-dir'] || options['base-dir-1'] || :folio_import_dir ) input_idml_base_dir = config.compute_base_dir(options['base-dir-2'] || :idml_import_dir) input_file...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_author_identities_set(import_settings)\n import_settings.map do |import_setting|\n # ensure that we have a *new* identity worth saving\n next unless author_identity_different?(import_setting_to_attribs(import_setting))\n\n normalize_author_identity(import_setting['firstName'], import_s...
[ "0.51859033", "0.51580006", "0.47088492", "0.46572605", "0.45058817", "0.44985515", "0.44369283", "0.44071212", "0.44071007", "0.43925086", "0.43878338", "0.43812704", "0.4317431", "0.42685977", "0.42623025", "0.42609125", "0.42325857", "0.4231966", "0.41948512", "0.4176468", ...
0.63851887
0
Merges subtitle_marks from subtitle_import into content AT. Uses content AT as authority for text and all tokens except subtitle_marks.
def merge_subtitle_marks_from_subtitle_import_into_content_at(options) subtitle_import_base_dir = config.compute_base_dir( options['base-dir'] || options['base-dir-1'] || :subtitle_import_dir ) subtitle_import_glob_pattern = config.compute_glob_pattern( subtitle_import_base_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_subtitle_marks_from_subtitle_tagging_import_into_content_at(options)\n subtitle_tagging_import_base_dir = config.compute_base_dir(\n options['base-dir'] || options['base-dir-1'] || :subtitle_tagging_import_dir\n )\n subtitle_tagging_import_glob_pattern = config.compute_glob_...
[ "0.80893487", "0.60355467", "0.56063306", "0.5563302", "0.55631053", "0.5482907", "0.54163516", "0.5389429", "0.53316957", "0.5297075", "0.52208096", "0.5157434", "0.5102568", "0.5079679", "0.50069255", "0.4964183", "0.4943861", "0.4942114", "0.48841727", "0.48463398", "0.476...
0.8202545
0
Merges subtitle_marks from subtitle_tagging_import into content AT. Uses content AT as authority for text and all tokens except subtitle_marks.
def merge_subtitle_marks_from_subtitle_tagging_import_into_content_at(options) subtitle_tagging_import_base_dir = config.compute_base_dir( options['base-dir'] || options['base-dir-1'] || :subtitle_tagging_import_dir ) subtitle_tagging_import_glob_pattern = config.compute_glob_pattern( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_subtitle_marks_from_subtitle_import_into_content_at(options)\n subtitle_import_base_dir = config.compute_base_dir(\n options['base-dir'] || options['base-dir-1'] || :subtitle_import_dir\n )\n subtitle_import_glob_pattern = config.compute_glob_pattern(\n subtitle_imp...
[ "0.8073107", "0.6250079", "0.60288954", "0.5826444", "0.5427378", "0.5423028", "0.53833884", "0.5312697", "0.5263177", "0.52549976", "0.5229811", "0.51592773", "0.51465636", "0.5127518", "0.5099899", "0.4941452", "0.48906457", "0.47415972", "0.47116363", "0.46969014", "0.4677...
0.83738387
0
Merges titles from folio roundtrip compare txt files into content AT to get correct spelling.
def merge_titles_from_folio_roundtrip_compare_into_folio_import(options) folio_roundtrip_compare_base_dir = File.join( config.compute_base_dir( options['base-dir'] || options['base-dir-1'] || :compare_dir ), 'folio_source/with_folio_import' ) folio_impor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def report_compare_titles_with_those_of_erp(options)\n input_file_spec = options['input'] || 'content_dir/at_files'\n titles_from_erp = load_titles_from_erp\n file_count = 0\n titles_with_differences = []\n Repositext::Cli::Utils.read_files(\n config.compute_glob_pattern...
[ "0.68886334", "0.5963178", "0.58270115", "0.57796055", "0.56616473", "0.5658089", "0.5650263", "0.56049395", "0.55702674", "0.5556202", "0.5552666", "0.55489075", "0.55408376", "0.5492955", "0.54602766", "0.54545224", "0.5394314", "0.5377122", "0.5366659", "0.53440577", "0.53...
0.74505836
0
GET /exam_managements GET /exam_managements.json
def index @exam_managements = ExamManagement.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @managements = Management.all\n end", "def set_exam_management\n @exam_management = ExamManagement.find(params[:id])\n end", "def exam_management_params\n params[:exam_management]\n end", "def index\n @product_managements = ProductManagement.all\n\n render json: @product...
[ "0.6691709", "0.6376951", "0.615914", "0.61048347", "0.6024783", "0.59841484", "0.5923909", "0.5871902", "0.5850734", "0.5838046", "0.58378536", "0.5837433", "0.5683783", "0.5663371", "0.5661857", "0.56558764", "0.5653756", "0.564942", "0.5639136", "0.56313556", "0.5618737", ...
0.75781417
0
POST /exam_managements POST /exam_managements.json
def create @exam_management = ExamManagement.new(exam_management_params) respond_to do |format| if @exam_management.save format.html { redirect_to @exam_management, notice: 'Exam management was successfully created.' } format.json { render :show, status: :created, location: @exam_manageme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @exam_managements = ExamManagement.all\n end", "def create\n @exam_set = ExamSet.new(exam_set_params)\n\n respond_to do |format|\n if @exam_set.save\n format.html { redirect_to @exam_set, notice: 'Exam set was successfully created.' }\n format.json { render :show, status:...
[ "0.6509114", "0.6235746", "0.60923886", "0.60821307", "0.6022878", "0.6022878", "0.5989685", "0.5982695", "0.5969359", "0.59178036", "0.59096515", "0.5891241", "0.5866648", "0.5845734", "0.5825597", "0.5807066", "0.57910025", "0.5787659", "0.5783099", "0.5780498", "0.57164174...
0.6725472
0
PATCH/PUT /exam_managements/1 PATCH/PUT /exam_managements/1.json
def update respond_to do |format| if @exam_management.update(exam_management_params) format.html { redirect_to @exam_management, notice: 'Exam management was successfully updated.' } format.json { render :show, status: :ok, location: @exam_management } else format.html { render :...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to exams_path, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\...
[ "0.6895557", "0.68855846", "0.6880162", "0.6808966", "0.6785631", "0.6678732", "0.6678732", "0.6678732", "0.6678732", "0.6628142", "0.65718216", "0.6540536", "0.6492062", "0.64654267", "0.6451805", "0.6390057", "0.6369078", "0.63637996", "0.634729", "0.63406545", "0.6309019",...
0.6901353
0
GET /legalstatuses GET /legalstatuses.json
def index @legalstatuses = Legalstatus.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def statuses\n Sifter.\n get(\"/api/statuses\").\n parsed_response[\"statuses\"]\n end", "def index\n @statuses = Status.all\n end", "def index\n @statuses = Status.all\n end", "def statuses\n request(:get, \"applicant_tracking/statuses\")\n end", "def index\n @statuses...
[ "0.6845886", "0.6465115", "0.6465115", "0.6464044", "0.636774", "0.62718093", "0.6264999", "0.6180492", "0.6174048", "0.61573136", "0.61374754", "0.61334693", "0.60591936", "0.6051795", "0.6031431", "0.60227746", "0.60095674", "0.5990998", "0.59709334", "0.59526783", "0.59458...
0.7404985
0
DELETE /legalstatuses/1 DELETE /legalstatuses/1.json
def destroy @legalstatus.destroy respond_to do |format| format.html { redirect_to legalstatuses_url, notice: 'Legalstatus was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @reqstatus.destroy\n respond_to do |format|\n format.html { redirect_to reqstatuses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @status = Status.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to(sta...
[ "0.73920476", "0.73458785", "0.73326504", "0.7237071", "0.72144437", "0.7211335", "0.71939945", "0.7157266", "0.7122924", "0.7085873", "0.70427907", "0.70313346", "0.70313346", "0.70294374", "0.70289266", "0.7002675", "0.6991998", "0.69873947", "0.69333905", "0.6917524", "0.6...
0.7413961
0
GET /buddyfights GET /buddyfights.json
def index @buddyfights = Buddyfight.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n gateway_alive = GatewayAlive.all\n render json: gateway_alive.to_json(:except => [:id])\n end", "def index\n @girlfriends = Girlfriend.all\n render json: @girlfriends, status: 200 \n end", "def breakdown\n @points = current_user.points.limit(5)\n render json: @points, ...
[ "0.60715854", "0.5926916", "0.5924033", "0.59208554", "0.5827693", "0.5801998", "0.58001655", "0.5779875", "0.57729566", "0.57603973", "0.5757087", "0.573221", "0.57222956", "0.57210886", "0.5703818", "0.5697461", "0.5694296", "0.56819487", "0.5681444", "0.56712115", "0.56640...
0.73732185
0
POST /buddyfights POST /buddyfights.json
def create @buddyfight = Buddyfight.new(buddyfight_params) respond_to do |format| if @buddyfight.save format.html { redirect_to @buddyfight, notice: 'Buddyfight was successfully created.' } format.json { render :show, status: :created, location: @buddyfight } else format.htm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @buddyfights = Buddyfight.all\n end", "def create\n #@buddy = Buddy.new(buddy_params)\n @buddy = current_user.buddies.build(buddy_params)\n\n respond_to do |format|\n if @buddy.save\n format.html { redirect_to @buddy, notice: \"Buddy was successfully created.\" }\n fo...
[ "0.6472698", "0.59794897", "0.5909013", "0.5754998", "0.56470066", "0.5450042", "0.54413", "0.539094", "0.5339248", "0.5324998", "0.5297267", "0.52962697", "0.5288078", "0.5266932", "0.524439", "0.522984", "0.5226278", "0.5203779", "0.5200533", "0.5156734", "0.51198804", "0...
0.6356847
1
DELETE /buddyfights/1 DELETE /buddyfights/1.json
def destroy @buddyfight.destroy respond_to do |format| format.html { redirect_to buddyfights_url, notice: 'Buddyfight was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @buddy.destroy\n respond_to do |format|\n format.html { redirect_to buddies_url, notice: \"Buddy was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @buddy = Buddy.find(param...
[ "0.70315355", "0.6775857", "0.67417806", "0.67115635", "0.6507376", "0.64911884", "0.64599603", "0.64336133", "0.6394245", "0.63872856", "0.63478756", "0.63468444", "0.6346075", "0.6331447", "0.63210344", "0.63184744", "0.6318289", "0.6315614", "0.62983215", "0.628507", "0.62...
0.7034131
0
////////////////////////////////////////////////////////////////////////// Properties ////////////////////////////////////////////////////////////////////////// Get a specific selected actor or current actor i : index of the selected actor GET
def selected_actor(i=nil) actor = nil if i == nil actor = @data[self.index] else actor = (index < 0 || self.index(i) < 0 ? nil : @data[self.index(i)]) end return actor end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selected_actor\n return nil unless actor_selected?\n get_actor @active_index\n end", "def get_actor(index)\n @data[index]\n end", "def selected_reserve_actor(i=nil)\n actor = nil\n if i == nil\n actor = @data[self.index]\n else\n actor = (index < 0 || self.index(i) < 0 ? nil :...
[ "0.81715715", "0.76902163", "0.71803135", "0.66437393", "0.66295344", "0.66295344", "0.66063595", "0.6575213", "0.6575213", "0.6575213", "0.655686", "0.647524", "0.6469444", "0.64618087", "0.64066714", "0.635936", "0.634233", "0.6334411", "0.6279572", "0.6268531", "0.61687344...
0.8488137
1
////////////////////////////////////////////////////////////////////////// Private Methods ////////////////////////////////////////////////////////////////////////// Create an item for CharFacesList index : item index
def create_item(index) actor = @data[index] rect = item_rect(index, true) ucChar = UCFormationCharFace.new(self, actor, rect) return ucChar end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_item(index)\n actor = @data[index]\n rect = item_rect(index)\n \n ucItem = UCCharacterGraphic.new(self, Rect.new(rect.x+9,rect.y+9,30,30), actor,\n 0, 255, 0, PARTY_CONFIG::CHARS_FACING_DIRECTION)\n \n if actor != nil && actor.reserve_locked\n ucIt...
[ "0.7662621", "0.7636722", "0.7592121", "0.72477305", "0.7087319", "0.70122004", "0.6987993", "0.6957028", "0.6855867", "0.6855867", "0.66067153", "0.66067153", "0.6596195", "0.6519527", "0.630674", "0.58808196", "0.58012563", "0.5765026", "0.569752", "0.5696452", "0.5666526",...
0.8059416
0
puts "nyan" break end counter + 1 while counter < 11 puts counter counter = counter + 1 end def hungry_sb kitkat = 0 while < 30 puts "Give me another kitkat!" kitkat +=
def hungry_person mango= 0 until mango == 10 puts "Give me my mango! i only want #{mango}" mango += 1 end puts "thank you" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def monkey(n)\n i = n\n loop do\n if i > 1\n p \"#{i} little monkeys jumping on the bed,\"\n p \"One fell off and bumped his head,\"\n p \"Mama called the doctor and the doctor said,\"\n p \"No more monkeys jumping on the bed\"\n else\n p \"#{i} little monkey jumping on the bed,\"\...
[ "0.70303243", "0.6988207", "0.6977826", "0.6949915", "0.6896138", "0.68927455", "0.68828565", "0.68824446", "0.6852196", "0.68253917", "0.6818178", "0.6788263", "0.6782082", "0.6744941", "0.6744941", "0.6744941", "0.6744941", "0.6744941", "0.6744941", "0.6744941", "0.6744941"...
0.7084161
0
PATCH/PUT /calllists/1 PATCH/PUT /calllists/1.json
def update respond_to do |format| if @calllist.update(calllist_params) format.html { redirect_to @calllist, notice: 'Calllist was successfully updated.' } format.json { render :show, status: :ok, location: @calllist } else format.html { render :edit } format.json { render...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_list(list_id, name)\n data = {\n list: {\n name: name\n }\n }\n rest(\"patch\", \"lists/#{list_id}\", data)\n end", "def update_list(id, list)\n record \"/todos/update_list/#{id}\", :list => list\n end", "def update\n @call_list_owner = CallListOwner.find(params[:id...
[ "0.6996695", "0.6796956", "0.6646768", "0.65260017", "0.64233965", "0.64014107", "0.636995", "0.635389", "0.6289805", "0.627942", "0.62759566", "0.62745863", "0.6246258", "0.62419814", "0.62419814", "0.6230335", "0.622694", "0.62245065", "0.6214325", "0.6212348", "0.61828446"...
0.70516884
1
DELETE /calllists/1 DELETE /calllists/1.json
def destroy @calllist.destroy respond_to do |format| format.html { redirect_to calllists_url, notice: 'Calllist was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_list(list_id)\n rest(\"delete\", \"lists/#{list_id}\")\n\n return true\n end", "def delete_list(user, list)\n delete(\"/#{user}/lists/#{list}.json\")\n end", "def delete_list(id)\n record \"/todos/delete_list/#{id}\"\n end", "def destroy\n @invite_list = InviteList.find(param...
[ "0.737909", "0.7237097", "0.7104932", "0.69288784", "0.68634534", "0.680756", "0.6781529", "0.6768832", "0.6768832", "0.6768832", "0.67651886", "0.6722435", "0.6722435", "0.6722435", "0.6710659", "0.6681779", "0.6681386", "0.6678337", "0.6671298", "0.66649324", "0.6655452", ...
0.7562142
1
remove a stock from database
def remove_stock(db,stock_ticker) db.execute(<<-SQL DELETE FROM stocks2 Where stock_ticker="#{stock_ticker}"; SQL ) puts "===================================================" puts "#{stock_ticker} has been removed from the database." puts "=================================================...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete()\n sql = \"DELETE FROM stock_items WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\n end", "def deleteStock\n p params[:ticker]\n Stock.where(:ticker => params[:ticker]).destroy_all \n end", "def rem_stock_entity(stock_id)\n redis.srem(\"#{Porp.ns}:saleentity:id...
[ "0.7314341", "0.7244771", "0.7157054", "0.70789826", "0.70109254", "0.698456", "0.69810426", "0.6920175", "0.688013", "0.6864305", "0.6626184", "0.6587378", "0.6523363", "0.6521096", "0.65153295", "0.65153295", "0.65130085", "0.64820665", "0.6475954", "0.64438754", "0.6440132...
0.84008443
0