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
Return host with optional port Only returns port if protocols default port diffes from actual port.
def host_with_port uhost, uport = self.host, self.port if port != protocol.default_port "#{uhost}:#{uport}" else uhost end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def host_with_port\n [config.host, optional_port].compact.join(\":\")\n end", "def port_string\n (protocol == 'http://' && port == 80) || (protocol == 'https://' && port == 443) ? '' : \":#{port}\"\n end", "def optional_port; end", "def port(port, host = T.unsafe(nil)); end", "def port_default?...
[ "0.7663858", "0.73588896", "0.7333526", "0.71444106", "0.70652854", "0.7048128", "0.7034594", "0.70061225", "0.6895596", "0.6804654", "0.67131305", "0.66542584", "0.6651736", "0.6595916", "0.65558726", "0.65549535", "0.65393084", "0.64886016", "0.6436052", "0.6415306", "0.640...
0.7835748
0
Checks if a format is known. Returns the associated content type.
def known_format?(f) FORMAT_TO_CONTENT_TYPE[f] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def content_type\n if format == :auto\n MIME_TYPES.values.join(',')\n elsif MIME_TYPES.has_key? format\n MIME_TYPES[format]\n else\n raise ArgumentError, \"Unknown format '#{format}'\"\n end\n end", "def content_type\n if format == :auto\n ...
[ "0.747522", "0.747522", "0.74192584", "0.73139757", "0.7129845", "0.675387", "0.6727898", "0.66968566", "0.66531587", "0.6634469", "0.662036", "0.66054255", "0.656686", "0.65333974", "0.65037787", "0.6493091", "0.6489986", "0.647038", "0.6470336", "0.64406425", "0.64369", "...
0.82989985
0
GET /reservations/new GET /reservations/new.json
def new @reservation = Reservation.new respond_to do |format| format.html # new.html.erb format.json { render json: @reservation } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @reservation = Reservation.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end", "def new\n\t\t@reservation = Reservation.new\n\tend", "def new\n @reserf = Reserve.new\n\n respond_to do |format|\n format.html...
[ "0.7976941", "0.752405", "0.74309754", "0.74203265", "0.7392128", "0.73398656", "0.7239581", "0.7238058", "0.7161617", "0.71141356", "0.7062703", "0.7062703", "0.7060762", "0.69739974", "0.69480234", "0.694256", "0.694256", "0.6937633", "0.6850717", "0.6814992", "0.6797522", ...
0.7990907
1
very large) containing integers. The array is either entirely comprised of odd integers or entirely comprised of even integers except for a single integer N. Write a method that takes the array as an argument and returns this "outlier" N. Examples [2, 4, 0, 100, 4, 11, 2602, 36] Should return: 11 (the only odd number) ...
def find_outlier(array) odd_array=[] even_array=[] array.each do |i| odd_array << i if i % 2 == 0 even_array << i if i % 2 != 0 end odd_array.size > even_array.size ? even_array[0] : odd_array[0] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_outlier(integers)\n answer = Array.new\n answer << integers[0] if integers[0].even?\n answer << integers[1] if integers[1].even?\n answer << integers[2] if integers[2].even?\n answer.length < 2 ? integers.select { |num| num.even? }.first : integers.select { |num| num.odd? }.first\nend", "def find_o...
[ "0.81638974", "0.80912226", "0.79702824", "0.79320204", "0.79155713", "0.7895303", "0.7888832", "0.78201056", "0.7746092", "0.7737106", "0.7725151", "0.76431423", "0.7635388", "0.76237893", "0.758933", "0.7525271", "0.7452129", "0.7020654", "0.6992041", "0.6951101", "0.694842...
0.8325568
0
Public: Checks to see if the LinkedList is empty. Examples
def empty? @head.next == nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty?\n !node_next(@head, 0)\n end", "def empty?\n node_next(@head, 0) == @tail\n end", "def is_list_empty?\n @head.nil?\n end", "def empty?\n \n @head == nil\n end", "def list_empty?\n return (@first_node == nil) ? true : false\n end", "def empty()\...
[ "0.808619", "0.79841375", "0.79121846", "0.79017", "0.7849999", "0.78498334", "0.7828492", "0.7773693", "0.77234215", "0.770682", "0.7684284", "0.7666984", "0.76391226", "0.7625747", "0.76221085", "0.7590762", "0.75690895", "0.7551998", "0.7542543", "0.7536963", "0.74892604",...
0.8029039
1
Public: Finds and removes the first occurrence of a Node with the desired value. value the Ruby object value to find and remove from the LinkedList Examples
def remove(value) element = self.head previous_element = @head while element.value != value if element.next.nil? return nil else previous_element = element element = element.next end end previous_element.next = element.next element end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_value value\r\n #find the pointer to the wanted node using LIST-SEARCH(value)\r\n #then delete that node with LIST-DELETE-BY-NODE(node)\r\n delete_node(self.search(value))\r\n end", "def remove(value)\n if head.value == value\n @head = head.next\n else\n current_node = head.n...
[ "0.8160187", "0.7892186", "0.7808302", "0.7783561", "0.7775286", "0.77493376", "0.7657638", "0.7645884", "0.75886655", "0.75370705", "0.7420589", "0.7416904", "0.73902255", "0.7367681", "0.73483914", "0.73420864", "0.724532", "0.7206845", "0.71579784", "0.71557736", "0.710428...
0.796211
1
A helper method to validate the state
def validate_state(state = {}); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_state\n errors.add(:state, \"must be yes, no or don't care\") unless state_changed? and %w(yes no dont_care).include? changes['state'][1]\n end", "def invalid?\n !@state\n end", "def verify(state) ; end", "def is_valid; end", "def valid; end", "def is_valid_state(state)\n temp...
[ "0.7685361", "0.7204157", "0.71687615", "0.70502776", "0.69686997", "0.69333065", "0.6869811", "0.68592036", "0.68433756", "0.68433756", "0.6837611", "0.6837611", "0.6837611", "0.6837611", "0.6837611", "0.6824323", "0.6823994", "0.682069", "0.6801818", "0.6801818", "0.6798891...
0.8486307
1
Sees in the datacenter exists or not
def datacenter_exists?(name) filter = Com::Vmware::Vcenter::Datacenter::FilterSpec.new(names: Set.new([name])) dc_obj = Com::Vmware::Vcenter::Datacenter.new(vapi_config) dc = dc_obj.list(filter) raise format("Unable to find data center: %s", name) if dc.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datacenter_exists?(folder, name)\n dc_api = VSphereAutomation::VCenter::DatacenterApi.new(api_client)\n raise_if_unauthenticated dc_api, \"checking for datacenter `#{name}`\"\n\n opts = { filter_names: name }\n opts[:filter_folders] = get_folder(folder, \"DATACENTER\") if folder\n ...
[ "0.7077185", "0.70334375", "0.70077485", "0.6645091", "0.66017485", "0.6539742", "0.6495642", "0.6452316", "0.64396536", "0.640671", "0.64036036", "0.6403373", "0.6331183", "0.6272513", "0.62603533", "0.624374", "0.62267417", "0.6212251", "0.62039655", "0.61849576", "0.617891...
0.7810365
0
Checks if a network exists or not
def network_exists?(name) net_obj = Com::Vmware::Vcenter::Network.new(vapi_config) filter = Com::Vmware::Vcenter::Network::FilterSpec.new(names: Set.new([name])) net = net_obj.list(filter) raise format("Unable to find target network: %s", name) if net.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def network_exists?(network_name)\n networks_list.include?(network_name)\n end", "def network_exists?(name)\n net_api = VSphereAutomation::VCenter::NetworkApi.new(api_client)\n raise_if_unauthenticated net_api, \"checking for VM network `#{name}`\"\n\n nets = net_api.list({ filter_names:...
[ "0.83544916", "0.8068502", "0.7202114", "0.6857433", "0.68385494", "0.67289007", "0.6660758", "0.6647937", "0.65889585", "0.6517109", "0.6439652", "0.6284661", "0.62508065", "0.6232452", "0.62237513", "0.61374754", "0.6129674", "0.6090193", "0.6085285", "0.60835993", "0.60765...
0.82898605
1
Get location of lookup service
def lookup_service_host # Allow manual overrides return config[:lookup_service_host] unless config[:lookup_service_host].nil? # Retrieve SSO service via RbVmomi, which is always co-located with the Lookup Service. vim = RbVmomi::VIM.connect @connection_options vim_settings = vim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location(location)\n client = Weatherman::Client.new\n client.lookup_by_location(location)\nend", "def location\n fetch('doraemon.locations')\n end", "def location\n fetch('hey_arnold.locations')\n end", "def get_location(user_location)\n\tclient=Weatherman::Client.n...
[ "0.6801704", "0.67613333", "0.6681403", "0.65907353", "0.65626335", "0.65594304", "0.65248835", "0.6492449", "0.64749235", "0.6453345", "0.6439432", "0.627982", "0.62766397", "0.62718785", "0.6271654", "0.62700903", "0.6205303", "0.619846", "0.61938053", "0.61883193", "0.6172...
0.6901233
0
== GET /about/list/:topic An informational listing on a given subject. == GET /about/list/library == GET /about/list/libraries == GET /about/list/location == GET /about/list/locations
def list @topic = get_topic(params) @topic_list = get_topic_list(@topic) respond_to do |format| format.html format.xml { render xml: @topic_list.to_xml } format.json { render json: @topic_list.to_json } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list\n\t\t@notes = Note.where(topic: params[:topic])\n\tend", "def index\n joins = {:user_id => doorkeeper_token.resource_owner_id, :slug => params[:topic_id]}\n joins.merge!(:application_id => doorkeeper_token.application_id) unless has_scope?(\"read_any_publications\")\n @publications = Topi...
[ "0.6889292", "0.6699159", "0.6665145", "0.66056716", "0.6537002", "0.65369064", "0.6529126", "0.65150285", "0.6494337", "0.64824903", "0.64824903", "0.64824903", "0.64688253", "0.64487106", "0.6432399", "0.6428444", "0.6428444", "0.6428444", "0.64223737", "0.6414862", "0.6401...
0.7695852
0
== GET /about/solr == GET /about/solr?lens=:lens Administratoronly Solr information.
def solr @solr_fields = get_solr_fields @solr_info = get_solr_information end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solr(url, handler, params={})\n connection, solr_url = connection(url)\n req_url = solr_url.path + '/select?' + hash_to_query_string(params.merge(:qt => handler))\n # puts \"*** requesting to Solr: #{req_url}\"\n connection.get(req_url)\nend", "def solr_stats\n @solr_stats = get_solr_statistics\n r...
[ "0.6705973", "0.6662194", "0.6624481", "0.6564986", "0.6513837", "0.6383423", "0.62608135", "0.62519354", "0.6242167", "0.6222342", "0.6206506", "0.61802095", "0.6170342", "0.616341", "0.6140831", "0.608454", "0.60834855", "0.6073331", "0.60699946", "0.6045608", "0.60370624",...
0.71127635
0
== GET /about/solr_stats Administratoronly Solr information.
def solr_stats @solr_stats = get_solr_statistics render 'about/solr' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solr\n @solr_fields = get_solr_fields\n @solr_info = get_solr_information\n end", "def index\n @config_vars = ENVIRONMENT_VARIABLES_TO_PRINT\n @corpus_size = RLetters::Solr::CorpusStats.new.size\n @ping = RLetters::Solr::Connection.ping\n @solr_info = RLetters::Solr::Connection.info\n e...
[ "0.654221", "0.6466917", "0.64406633", "0.6387317", "0.6387317", "0.6262488", "0.6156257", "0.6109965", "0.6075348", "0.60701334", "0.6035382", "0.60095936", "0.59551084", "0.59423053", "0.5930332", "0.58983016", "0.5861903", "0.5861903", "0.5857144", "0.5856435", "0.58140063...
0.8535216
0
== DELETE /about/log Administratoronly command to wipe the application log.
def log_wipe lines = wipe_log respond_with(lines, template: 'about/log') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_log\n request('clearLog')\n end", "def clear_log\r\n\r\n file = Rails.public_path.join('bg_worker.log')\r\n FileUtils.rm file\r\n flash[:warning] = \"Cleared log file\"\r\n redirect_to :action => :list\r\n end", "def delete_log(log_file = '')\n File.delete(log_file) if File....
[ "0.70575684", "0.6709301", "0.6520443", "0.64608884", "0.6441817", "0.64084476", "0.635158", "0.6290828", "0.62805754", "0.60182387", "0.59994334", "0.59255266", "0.5911193", "0.5891146", "0.58537716", "0.5843142", "0.58160335", "0.5813592", "0.58046234", "0.57949734", "0.577...
0.68820006
1
Override __prefix__ class method to have better prefixes for some of these longer vocabulary names.
def __prefix__ __name__.demodulize.underscore.dasherize.to_sym end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name_prefix; end", "def prefixes; end", "def prefixes; end", "def words_with_prefix(prefix, words)\n raise NotImplementedError # TODO\nend", "def prefix; end", "def prefix; end", "def prefix; end", "def prefix; end", "def prefix; end", "def prefix; end", "def prefix; end", "def prefix; e...
[ "0.6865738", "0.675726", "0.675726", "0.66747403", "0.6585286", "0.6585286", "0.6585286", "0.6585286", "0.6585286", "0.6585286", "0.6585286", "0.6585286", "0.6585286", "0.6585286", "0.6540014", "0.65229684", "0.6400325", "0.63975704", "0.6286913", "0.6269063", "0.62565523", ...
0.69234943
0
Make department requirement junction when new requirement is made. Also serves as a Model.within(dept), minus foreign key injection
def core(d) dept = Department.search!(d) raise "[Requirement.core] Error: core already declared for department #{dept.name}" unless dept.core_requirements.empty? requirement = make "#{dept.abbreviation}" # make junctions mk = self.method(:make) se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def department_set(dept)\n self.department.set dept\n end", "def setup_departments\n Department.delete_all \n Employee.delete_all\n dep = Department.create(:name=> 'department1', :city => 'Littleton', :state => 'CO') \n employee1 = dep.employees.create(:first_name=>\"first_1\", ...
[ "0.56608427", "0.56564736", "0.5552948", "0.553551", "0.5534745", "0.5534745", "0.5534745", "0.5512788", "0.54641384", "0.5439059", "0.52215725", "0.5196148", "0.5161448", "0.5145264", "0.5126229", "0.51245975", "0.5052786", "0.49754107", "0.49749613", "0.49749613", "0.497496...
0.64783174
0
Configure the isaac backend for basic functions
def configure # Give the bot a handle to config and handler conf = @config # Configure the bot @bot = Isaac::Bot.new @bot.configure{|c| c.server = conf[:server] c.port = conf[:port] c.ssl = conf[:ssl] c.nick = conf[:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_audio ; end", "def ayah_init\r\n ayah = AYAH::Integration.new(\"d5fbcc5d5d32f645158e72fc00b55eea205b13b4\", \"3969dc9a22c5378abdfc1d576b8757a8638b16d7\")\r\n end", "def backends=(_arg0); end", "def create_audio!(enc, manifest, s3_input, s3_output)\n\n # Create or load the Audio Config\n ...
[ "0.58001405", "0.5630417", "0.5626259", "0.56152296", "0.54894656", "0.54694736", "0.54372865", "0.54372686", "0.53559417", "0.53166527", "0.52689433", "0.52419055", "0.5233905", "0.5224675", "0.51922506", "0.5191189", "0.51908624", "0.51848185", "0.51399815", "0.5138905", "0...
0.57062036
1
Run the bot This can be done in a blocking or nonblocking way if verify is true and threaded is true, the bot will sit and check that it has successfully connected before continuing (and raise an exception on connection failure).
def run(threaded=true, verify=true) $log.info "Starting IRC Bot..." if threaded then # Run the bot. @thread = Thread.new do $log.info "Bot thread started." @bot.start end # Wait for it to connect if verify then delay = 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(async = false)\n @bot.run(async)\n end", "def run\n @bot.run\n end", "def run\n Telebot::Bot.new(@token).run do |chat, message|\n if block_given?\n yield(chat, message)\n elsif !chat.nil?\n id = message.chat.id\n if id.positive?\n post(\n me...
[ "0.64450514", "0.6265872", "0.62259525", "0.6147667", "0.61247224", "0.6115461", "0.5882167", "0.5845172", "0.58262604", "0.5772978", "0.5741848", "0.56309247", "0.56008327", "0.5597614", "0.55508184", "0.550517", "0.5467129", "0.5466942", "0.5432297", "0.54012644", "0.539777...
0.80901283
0
Is the bot currently connected? Falls through to Isaac.
def connected? @bot.connected? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connected?\n @bot.connected?\n end", "def is_connected?\n if @client.is_connected?\n @log.info \"Asked if bot is connected: YES it is\"\n return true\n else\n @log.info \"Asked if bot is connected: NO it isn't\"\n return false\n end\n end", "def connected?\n ...
[ "0.7953467", "0.78557104", "0.74663305", "0.72863525", "0.7250291", "0.718196", "0.7154962", "0.7110553", "0.7110553", "0.71059996", "0.7084845", "0.704109", "0.6996413", "0.69754934", "0.69754934", "0.69754934", "0.69754934", "0.69754934", "0.69680333", "0.6943595", "0.69175...
0.8032407
0
Which server is the bot connected to?
def server @bot.server end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_server\n @_current_server\n end", "def current_server\n @_current_server\n end", "def server\n @server.to_s\n end", "def get_server\n get_general['server']\n end", "def bot_mode\n self['BOT']\n end", "def server\n servers[0]\n end", "d...
[ "0.6890562", "0.6890562", "0.6842552", "0.6810676", "0.673647", "0.67030543", "0.6667216", "0.6579218", "0.65775716", "0.65214145", "0.64920014", "0.6402963", "0.63250816", "0.630544", "0.62802505", "0.62802505", "0.62707716", "0.6261175", "0.6242128", "0.6240805", "0.6227667...
0.7476169
0
Which nick does the bot currently have?
def nick @bot.nick end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nick\r\n return for_context(nil, false) { |c| c.nick }\r\n end", "def nickname\n @nick\n end", "def nick\n @name\n end", "def nick(nick)\n @nick = nick\n sendmsg(\"NICK #{nick}\")\n end", "def nick(msg)\n if msg.user.last_nick == @settings['identity']['nick']\n bot....
[ "0.7959913", "0.78586936", "0.7832504", "0.73713166", "0.7224003", "0.71348643", "0.7099389", "0.7083882", "0.69918257", "0.6970741", "0.69122684", "0.6911308", "0.6890828", "0.68761694", "0.6825434", "0.6795342", "0.67913824", "0.67271507", "0.67045605", "0.66967267", "0.667...
0.8594065
0
Tell the bot to join a channel
def join(channel) @bot.join(channel) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_join(m, channel)\r\n if_admin(m) { @bot.join(channel) }\r\n end", "def join(channel)\n\t\t\tsend_to_server(\"JOIN #{channel}\")\n\t\tend", "def join_channel(message)\n message.send_raw \"JOIN ##{message.channel.name}\"\n end", "def irc_send_join(channel)\n # We send an IRC me...
[ "0.80779046", "0.80608284", "0.8025712", "0.7705018", "0.7528838", "0.75123936", "0.71361214", "0.7085131", "0.6968965", "0.6820501", "0.6793049", "0.67460245", "0.6730669", "0.6632969", "0.66176176", "0.66052604", "0.65724325", "0.65570456", "0.6484972", "0.6443919", "0.6440...
0.83357835
0
Register a command, only invoked when COMMAND_RX is triggered. mod A link to the module object, used in tracking threads name A name for this command, for unregistering later trigger A regex which, if the command matches (see COMMAND_RX), will cause the callback to fire types The types of message to respond to. p A pro...
def register_command(mod, name, trigger, types = /channel/, &p) raise "Please define a block" if not block_given? raise "That command is already hooked." if @cmds[name] raise "The module given is not a module" if not mod.is_a?(HookService) # Ensure types is an array and is ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_hook(mod, name, trigger = nil, types = /channel/, &p)\n raise \"Please define a block\" if not block_given?\n raise \"That command is already hooked.\" if @hooks[name]\n raise \"The module given is not a module\" if not mod.is_a?(HookService)\n trigger ||= lamb...
[ "0.6438206", "0.6047119", "0.6015615", "0.58937085", "0.5891112", "0.5639508", "0.5610444", "0.55031943", "0.54022527", "0.5361733", "0.53507745", "0.5316901", "0.5295533", "0.5295533", "0.5277333", "0.52728903", "0.52683675", "0.52515525", "0.5175824", "0.516278", "0.5160571...
0.7320989
0
Register a hook to be run on any message. mod A link to the module object, used in tracking threads name A name for this hook, for unregistering later trigger A procedure to run. If this returns true, it will cause the callback to fire. types The types of message to respond to. p A procedure to run when all the checks ...
def register_hook(mod, name, trigger = nil, types = /channel/, &p) raise "Please define a block" if not block_given? raise "That command is already hooked." if @hooks[name] raise "The module given is not a module" if not mod.is_a?(HookService) trigger ||= lambda{|*| return t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dispatch_hooks(msg, type, bot)\n return if @hooks.length == 0\n\n @hooks_mutex.synchronize{\n @hooks.each{|name, hook|\n types, trigger, p, mod, mod_info = hook[:types], hook[:trigger], hook[:proc], hook[:module], @modules[hook[:module]]\n\n # Go through and kill any old thre...
[ "0.6690939", "0.6446525", "0.60287565", "0.6013262", "0.59964734", "0.59964734", "0.5715657", "0.56536424", "0.56026316", "0.5518584", "0.54847103", "0.54602575", "0.54424983", "0.5437172", "0.5415499", "0.53846705", "0.53805155", "0.5349809", "0.533685", "0.533685", "0.53119...
0.7221015
0
Remove a selection of hooks by name If the first argument is a number, it will be used as the timeout when waiting for any threads to end. If no timeout is given, it will wait indefinitely for threads to end.
def unregister_hooks(*names) # Load a timeout if one is given names.delete(nil) timeout = nil if names and names[0].is_a?(Numeric) then timeout = names[0].to_f names = names[1..-1] end # Then unhook things @hooks_mutex.synchronize{ names.each{|name| ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(name)\n if hook = by_name(name)\n hook.destroy!\n end\n end", "def unregister_commands(*names)\n # Load a timeout if one is given\n names.delete(nil)\n timeout = nil\n if names and names[0].is_a?(Numeric) then\n timeout = names[0].to_f\n names = na...
[ "0.60684276", "0.60297287", "0.5662722", "0.5517949", "0.546", "0.54435277", "0.53744686", "0.53689307", "0.53615576", "0.53613186", "0.535067", "0.5311134", "0.52910626", "0.5247928", "0.5224371", "0.5220938", "0.5214941", "0.5199518", "0.5158245", "0.51174766", "0.5105547",...
0.730544
0
Remove cmd by name If the first argument is a number, it will be used as the timeout when waiting for any threads to end. If no timeout is given, it will wait indefinitely for threads to end.
def unregister_commands(*names) # Load a timeout if one is given names.delete(nil) timeout = nil if names and names[0].is_a?(Numeric) then timeout = names[0].to_f names = names[1..-1] end # And then unhook things @hooks_mutex.synchronize{ names.each{|na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove name, type = nil, &block\n debug \"Runner#remove name:#{name}, type:#{type}\" \n \n batch \"#{name}.#{type}\", \"kill\", true\n batch \"#{name}.#{type}\", \"rm\", true \n unregister_all(/#{name}\\.#{type}\\./)\n end", "def delete(name, _options = {})\n ...
[ "0.574469", "0.5506502", "0.5496572", "0.5301204", "0.52708554", "0.52347267", "0.52190846", "0.52145755", "0.51994157", "0.5180374", "0.51475143", "0.5128506", "0.51164967", "0.509563", "0.5060454", "0.50186694", "0.5002888", "0.4968418", "0.4963091", "0.49486768", "0.493202...
0.58705926
0
Register a module by calling hook_thyself. Since modules should extend HookService, they should implement hook_thyself in order to make initial hooks.
def register_module(mod) $log.debug "Registering module: #{mod.class}..." mod.hook_thyself end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_hook(mod, name, trigger = nil, types = /channel/, &p)\n raise \"Please define a block\" if not block_given?\n raise \"That command is already hooked.\" if @hooks[name]\n raise \"The module given is not a module\" if not mod.is_a?(HookService)\n trigger ||= lamb...
[ "0.62208337", "0.61620885", "0.5999698", "0.59990335", "0.59953105", "0.59561485", "0.59293103", "0.5878872", "0.57645583", "0.5731485", "0.57212275", "0.5720117", "0.5718751", "0.57021195", "0.56959605", "0.5677144", "0.56751263", "0.5620916", "0.56035733", "0.55920416", "0....
0.7623903
0
Unregister all hooks and commands by unloading all modules.
def unregister_all(timeout = nil) $log.debug "Unregistering all modules..." # clone to avoid editing whilst iterating unregister_modules(timeout, *@modules.keys.clone) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unregister_hooks(*names)\n # Load a timeout if one is given\n names.delete(nil)\n timeout = nil\n if names and names[0].is_a?(Numeric) then\n timeout = names[0].to_f\n names = names[1..-1]\n end\n\n # Then unhook things\n @hooks_mutex.synchronize{\n names...
[ "0.7282198", "0.7212914", "0.71175766", "0.7104871", "0.7079972", "0.7006872", "0.68909824", "0.6859601", "0.6843821", "0.6721234", "0.66921777", "0.66297454", "0.6579977", "0.65479416", "0.64810187", "0.6434752", "0.6395531", "0.63487756", "0.6330146", "0.6302321", "0.624605...
0.74080807
0
Join all threads of a given module with an overall timeout
def join_module_threads(threads, timeout = nil) return if not threads threads.each{|t| # Keep track of time start = Time.now # Allow the thread to close for up to timeout seconds t.join(timeout) # Then subtract how long it took for the next one timeout -= (T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join(timeout)\n @thread.join timeout\n end", "def join\n @threads.each { |t| t.join }\n @threads.clear\n end", "def join_threads\n @worker_threads.each do |name, t|\n puts \"Joining thread: #{name}\"\n t.join\n end\n @worker_threads = {}\n end", "def join\n ...
[ "0.69774336", "0.6723436", "0.6447908", "0.6335663", "0.6331302", "0.6317171", "0.6242954", "0.62136984", "0.6190614", "0.61132056", "0.61046004", "0.60708666", "0.60655725", "0.6061742", "0.60146165", "0.5878396", "0.5857489", "0.5849045", "0.58001727", "0.575175", "0.574974...
0.8145977
0
Dispatch things to hooks
def dispatch_hooks(msg, type, bot) return if @hooks.length == 0 @hooks_mutex.synchronize{ @hooks.each{|name, hook| types, trigger, p, mod, mod_info = hook[:types], hook[:trigger], hook[:proc], hook[:module], @modules[hook[:module]] # Go through and kill any old threads, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_hooks!\n @perform_hooks = true\n end", "def hooks\n # ???\n end", "def fire(hook, *args); end", "def hook1; end", "def pre_hook_send(handler); end", "def action_hook; end", "def around_hooks; end", "def perform\n\n begin\n\n # acquire lock and fetch the loc...
[ "0.70549625", "0.69858056", "0.6834492", "0.67891943", "0.66985357", "0.6669872", "0.66516715", "0.6519832", "0.6518559", "0.6513162", "0.6478594", "0.64385027", "0.64381707", "0.6407273", "0.63715243", "0.63507575", "0.6339826", "0.63356465", "0.63339627", "0.63265985", "0.6...
0.6997882
1
converts amount in float or integer into Money object
def money(amount) Money.new((amount * 100).to_i) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def money\n Money.from_amount(amount.to_f)\n end", "def to_money amount\n\t\t\tamount.to_f.round(2) rescue 0.0\n\t\tend", "def coerce_money(v)\n SpookAndPuff::Money.new(v.to_s)\n end", "def to_currency(amount)\n\n decimal = BigDecimal.new(amount.to_s)\n\n full_integer = (decimal * 100)\n\n ...
[ "0.8190561", "0.77708507", "0.7509132", "0.7434018", "0.73027354", "0.7203289", "0.7181826", "0.71665597", "0.713698", "0.7114385", "0.7096725", "0.7091911", "0.7039345", "0.7034379", "0.6992524", "0.69801664", "0.69664097", "0.6963474", "0.6931813", "0.6844594", "0.6834525",...
0.7804323
1
UNIT TESTS FOR METHOD connect_angels_with_other(cities)
def test_angel_camp_connections map = Map.new # checking if Angel camp on index @cities[1] # is connected with...... # # First: with Nevada, it should be on index 0 of array connections # checking Angel camp is connected with Nevada # checking by name assert_equal 'Nevada City', map.citi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validate_cities\n skip('this is a helper method for validating location names')\n # ignored cities are ones for which I don't know the location code\n # that the API accepts\n ignored_cities = %w(chongqing koln cologne dusseldorf eugene honolulu\n milan southbay)\n ci...
[ "0.67130727", "0.65000224", "0.64120615", "0.62656534", "0.60036236", "0.5957624", "0.5855112", "0.5818224", "0.5816393", "0.5793313", "0.576407", "0.5761168", "0.57517266", "0.57243514", "0.57153165", "0.56975263", "0.5655579", "0.5648212", "0.5623234", "0.56030244", "0.5550...
0.7062134
0
UNIT TESTS FOR METHOD connect_sutter_with_other(cities)
def test_connect_sutter map = Map.new # testing connect with Coloma assert_equal 4, map.cities[2].connections[1].id # testing connect angel camp assert_equal 1, map.cities[2].connections[0].id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validate_cities\n skip('this is a helper method for validating location names')\n # ignored cities are ones for which I don't know the location code\n # that the API accepts\n ignored_cities = %w(chongqing koln cologne dusseldorf eugene honolulu\n milan southbay)\n ci...
[ "0.6770048", "0.65557903", "0.64728314", "0.62022567", "0.6044166", "0.5971957", "0.59166145", "0.5823278", "0.57693213", "0.5763808", "0.57588565", "0.57450837", "0.5724179", "0.57118154", "0.5698426", "0.56920874", "0.5664725", "0.5646683", "0.56414545", "0.5622036", "0.562...
0.6878134
0
PUT /workout_templates/1 PUT /workout_templates/1.json
def update @workout_template = WorkoutTemplate.find(params[:id]) respond_to do |format| if @workout_template.update_attributes(params[:workout_template]) format.html { redirect_to @workout_template, notice: 'Workout template was successfully updated.' } format.json { head :no_content } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_workout_template\n @workout_template = WorkoutTemplate.find(params[:id])\n end", "def workout_template_params\n # params.require(:workout_template).permit(:title, :isTemplate, :boolean, :exerciseCount, :user_id,:id)\n params .permit(:title, :isTemplate, :boolean, :exerciseCount, :user_...
[ "0.7166186", "0.62536865", "0.62524974", "0.62363636", "0.6178014", "0.6150158", "0.5980344", "0.59165096", "0.5878204", "0.5869198", "0.5859482", "0.5850555", "0.5828405", "0.58210343", "0.578458", "0.5782863", "0.5777991", "0.5773472", "0.5736808", "0.5723785", "0.5718111",...
0.7241972
0
DELETE /workout_templates/1 DELETE /workout_templates/1.json
def destroy @workout_template = WorkoutTemplate.find(params[:id]) @workout_template.destroy respond_to do |format| format.html { redirect_to workout_templates_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n super \"/templates/#{template_id}.json\", {}\n end", "def destroy\n @inspection_template.destroy\n respond_to do |format|\n format.html { redirect_to inspection_templates_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @template_shift = Template...
[ "0.7443243", "0.71824217", "0.7181598", "0.7115013", "0.7107723", "0.70816416", "0.70725995", "0.7044704", "0.70158654", "0.7015127", "0.7009052", "0.6989359", "0.69866323", "0.6977606", "0.6973286", "0.69618255", "0.695753", "0.6954994", "0.695063", "0.694221", "0.69258916",...
0.7972006
0
this could be optimized a tiny bit by only calling superclass.build_xray but i am le tired
def build_xray @build_xray ||= begin retval = Hash.new { |hash,key| hash[key] = {} } klasses = [] klass = self while klass && klass <= UIView klasses.unshift(klass) klass = klass.superclass end klasses.each do |klass| xray_props = klas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_xml\n raise NotImplementedError, \"Override build_xml in subclass\"\n end", "def build_xml(builder)\n super(builder)\n builder.Type { |b| self.object_type.build_xml(b) } if object_type\n end", "def initialize(arry = [])\n @base = arry.collect{|el| el } # poor man's clone\n @...
[ "0.5859437", "0.5634151", "0.55204886", "0.551021", "0.5495675", "0.5474111", "0.5443462", "0.5440317", "0.53660965", "0.53269243", "0.5323505", "0.5304804", "0.52597165", "0.52544576", "0.52079296", "0.51994175", "0.5156718", "0.51438683", "0.51424146", "0.5129548", "0.51177...
0.69425344
0
fetch currency rates from application configuration file config/currency_rate.yml will return currency rates along with it's type
def currency_rates @currency_rates = fetch_currency_rates end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def currency_rates\n response['rates'][currency.target_currency.to_s]\n end", "def available_currencies\n set_default_rate\n currency_rates.keys\n end", "def update_rates\n clear_rates\n add_currency_rate(\"EUR\", 1)\n add_currency_rates(config[\"exchange_rates\"]) # rates from ...
[ "0.76544577", "0.7239134", "0.72228706", "0.7119703", "0.70455575", "0.70168304", "0.69450223", "0.6929443", "0.6825915", "0.67561793", "0.66868603", "0.6650373", "0.6592395", "0.65588903", "0.6504443", "0.64992106", "0.6494795", "0.64883167", "0.64810306", "0.64431286", "0.6...
0.74599874
1
GET /trust_moneys GET /trust_moneys.json
def index @trust_moneys = TrustMoney.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_trust_objects_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.get_trust_objects ...\"\n end\n # resource path\n local_var_path = \"/trust-management\"\n\n # query parameters\n que...
[ "0.5751301", "0.5500747", "0.53771687", "0.5355662", "0.53144306", "0.5300288", "0.52667034", "0.52211887", "0.5193867", "0.51418126", "0.5121417", "0.5094779", "0.50687957", "0.5034705", "0.50021213", "0.4988404", "0.49769038", "0.49628618", "0.49396548", "0.4939509", "0.487...
0.59640765
0
DELETE /trust_moneys/1 DELETE /trust_moneys/1.json
def destroy @trust_money.destroy respond_to do |format| format.html { redirect_to trust_moneys_url, notice: 'Trust money was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @moresmalltrial = Moresmalltrial.find(params[:id])\n @moresmalltrial.destroy\n\n respond_to do |format|\n format.html { redirect_to moresmalltrials_url }\n format.json { head :...
[ "0.6612225", "0.6435048", "0.642754", "0.6395023", "0.63516265", "0.6321232", "0.63130873", "0.6241977", "0.6236176", "0.6235031", "0.62324655", "0.6185294", "0.615585", "0.6150322", "0.61460894", "0.6117683", "0.6115404", "0.61024165", "0.6095944", "0.6092853", "0.6082935", ...
0.65613014
1
POST /alumni_news_items POST /alumni_news_items.json
def create @alumni_news_item = AlumniNewsItem.new(alumni_news_item_params) respond_to do |format| if @alumni_news_item.save format.html { redirect_to @alumni_news_item, notice: 'Alumni news was successfully created.' } format.json { render action: 'show', status: :created, location: @alum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n respond_to do |format|\n if @news_item.save\n format.html { redirect_to @news_item, :notice => 'News item was successfully created.' }\n format.json { render :json => @news_item, :status => :created, :location => @news_item }\n else\n format.html { render ...
[ "0.69212556", "0.679088", "0.6723702", "0.6716267", "0.67068595", "0.6584015", "0.65362185", "0.640015", "0.6383678", "0.6381812", "0.6381812", "0.6365448", "0.63312453", "0.6326434", "0.62806755", "0.625567", "0.6251146", "0.62226677", "0.6180844", "0.61353314", "0.61287814"...
0.7126492
0
PATCH/PUT /alumni_news_items/1 PATCH/PUT /alumni_news_items/1.json
def update respond_to do |format| if @alumni_news_item.update(alumni_news_item_params) format.html { redirect_to @alumni_news_item, notice: 'Alumni news was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @news_item.update_attributes(params[:news_item])\n format.html { redirect_to @news_item, :notice => 'News item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n for...
[ "0.68376845", "0.66334856", "0.662979", "0.65002084", "0.6474196", "0.6450485", "0.6431119", "0.6429213", "0.6350141", "0.6314212", "0.62687004", "0.6259719", "0.62417406", "0.62033004", "0.6198649", "0.6178684", "0.6169075", "0.61415565", "0.6141403", "0.6119451", "0.6110288...
0.7107624
0
DELETE /alumni_news_items/1 DELETE /alumni_news_items/1.json
def destroy @alumni_news_item.destroy respond_to do |format| format.html { redirect_to alumni_news_items_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @news_item.destroy\n \n respond_to do |format|\n format.html { redirect_to news_items_url }\n format.json { head :ok }\n end\n end", "def destroy\n @news_item.destroy\n respond_to do |format|\n format.html { redirect_to admin_news_items_url, notice: 'News...
[ "0.7383478", "0.72197795", "0.70828426", "0.7070211", "0.70491827", "0.70027846", "0.6960674", "0.6952112", "0.6912653", "0.68666136", "0.6832792", "0.682805", "0.6815279", "0.6811384", "0.68070203", "0.67974824", "0.6794741", "0.67810625", "0.6780675", "0.6776958", "0.677312...
0.77582276
0
Callback called after initialization.
def after_initialize end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_initialize; end", "def after_initialize; end", "def after_initialize; end", "def after_initialize; end", "def after_initialize\n end", "def after_initialize\n end", "def after_initialized\n end", "def after_initialize(&block); end", "def post_init\n end", "def on_initializat...
[ "0.80069876", "0.80069876", "0.80069876", "0.80069876", "0.79419285", "0.79419285", "0.7929937", "0.7924348", "0.78855515", "0.7848953", "0.7838372", "0.7807316", "0.77661324", "0.77393824", "0.7725614", "0.7725614", "0.7679504", "0.76715547", "0.7515325", "0.7494911", "0.745...
0.80124795
0
Callback before begin assertions.
def before_assert end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def before_assert(symbol=nil, &block)\n if block_given?\n @before_assert_callbacks << block\n elsif symbol\n @before_assert_callbacks << symbol\n end\n end", "def assertions; end", "def assertions; end", "def assert\n\traise \"Assertion fail...
[ "0.6926338", "0.67333734", "0.67333734", "0.656793", "0.656793", "0.65607977", "0.6560058", "0.6560058", "0.65542305", "0.65458816", "0.6536247", "0.65192246", "0.6517277", "0.6498014", "0.6498014", "0.64941454", "0.64876235", "0.64876235", "0.6475417", "0.6475417", "0.647541...
0.788816
0
The list of attributes that are permitted to be used as data attributes in tables and in the tag on show pages.
def html_data_attributes data_attributes = record.class.columns.select do |column| column.type.in?(%i[integer boolean datetime float uuid interval]) && !column.array? end.map(&:name).map(&:to_sym) api_attributes & data_attributes end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attributes\n @allowed_attributes\n end", "def list_attributes\n list = \"Age: #{@age} Earth years old\\nSize: #{@size}\\nVisitor Count: #{@visitor_count}\\nInhabitants: #{@inhabitants}\\n\"\n return list\n end", "def attribute_list # :nodoc:\n [:id, :version, :uid, :user, :timestamp, :c...
[ "0.7580632", "0.72128683", "0.7202275", "0.7202074", "0.714402", "0.7090582", "0.7079916", "0.7048852", "0.7030326", "0.6994557", "0.6994492", "0.6980055", "0.69781053", "0.6971298", "0.6969956", "0.6955982", "0.6954862", "0.6909662", "0.68979704", "0.68924457", "0.68919957",...
0.72819895
1
Executes a command in the Heroku Toolbelt
def heroku(command) system("GEM_HOME='' BUNDLE_GEMFILE='' GEM_PATH='' RUBYOPT='' /usr/local/heroku/bin/heroku #{command}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heroku(command)\n s = system(\"GEM_HOME='' BUNDLE_GEMFILE='' GEM_PATH='' RUBYOPT='' /usr/local/heroku/bin/heroku #{command}\")\nend", "def heroku(cmd)\n Bundler.with_clean_env { system(\"heroku #{cmd}\") }\nend", "def run(cmd_type, command = nil, options = {}, &block)\n command = cmd_type.to_...
[ "0.77212226", "0.72314775", "0.69322175", "0.6915362", "0.68885267", "0.68885267", "0.67473763", "0.64000255", "0.6346544", "0.6271409", "0.62036175", "0.6161484", "0.6151011", "0.6119241", "0.6067952", "0.6039589", "0.60343295", "0.6012852", "0.6012852", "0.5965465", "0.5927...
0.7632713
1
GET /flickr_accounts GET /flickr_accounts.json
def index @flickr_accounts = FlickrAccount.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_accounts()\n http_get(accounts_url)\n end", "def accounts\n get('/accounts')['accounts']\n end", "def set_flickr_account\n @flickr_account = FlickrAccount.find(params[:id])\n end", "def social_accounts_for_a_project\n uri = \"#{@api_url}/#{@project_id}/accounts?access_token...
[ "0.6776277", "0.66489214", "0.66225606", "0.66021496", "0.6461425", "0.6384925", "0.6365791", "0.6320858", "0.62570953", "0.62461966", "0.6241318", "0.62353927", "0.61798775", "0.6128891", "0.6116205", "0.60819024", "0.6067792", "0.6064186", "0.60636634", "0.60282004", "0.598...
0.7629078
0
POST /flickr_accounts POST /flickr_accounts.json
def create @flickr_account = FlickrAccount.new(flickr_account_params) if @flickr_account.save redirect_to flickr_accounts_path else render :new end # respond_to do |format| # if @flickr_account.save # format.html { redirect_to @flickr_account, notice: 'Flickr account was ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n megam_rest.post_accounts(to_hash)\n end", "def save\n Account.create!(account_params.map do |data|\n {\n type: :facebook,\n user: current_user,\n name: data[:name],\n data: data\n }\n end)\n\n render json: success\n end", "def set_flickr_acco...
[ "0.66967624", "0.62125397", "0.6038969", "0.6014178", "0.5993962", "0.58316964", "0.58119494", "0.57744527", "0.5771591", "0.5614921", "0.5611416", "0.5591132", "0.5576551", "0.5562358", "0.55380666", "0.5530687", "0.55035764", "0.54898775", "0.5480192", "0.5462454", "0.54462...
0.6866553
0
PATCH/PUT /flickr_accounts/1 PATCH/PUT /flickr_accounts/1.json
def update # respond_to do |format| # if @flickr_account.update(flickr_account_params) # format.html { redirect_to @flickr_account, notice: 'Flickr account was successfully updated.' } # format.json { render :show, status: :ok, location: @flickr_account } # else # format.html { r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend", "def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend", "def set_flickr_account\n @flickr_account = F...
[ "0.6163037", "0.6163037", "0.6143675", "0.6103595", "0.6045521", "0.6026423", "0.6009034", "0.59985757", "0.59904814", "0.59378904", "0.59052396", "0.59001744", "0.58787555", "0.58690876", "0.58534294", "0.58274466", "0.57986957", "0.5784053", "0.5784053", "0.5772434", "0.573...
0.7124585
0
DELETE /flickr_accounts/1 DELETE /flickr_accounts/1.json
def destroy # @flickr_account.destroy # respond_to do |format| # format.html { redirect_to flickr_accounts_url, notice: 'Flickr account was successfully destroyed.' } # format.json { head :no_content } # end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete photo_id\n @flickr.photos.delete(photo_id: photo_id)\n end", "def delete_account\n @user = current_user\n if @user.flickr_account.destroy\n flash[:notice] = 'You are not connected to flickr anymore $green'\n else \n flash[:notice] = 'Something went wrong. Please try again $r...
[ "0.67956614", "0.6630035", "0.66133296", "0.6531147", "0.6523471", "0.6443541", "0.6432054", "0.6431538", "0.6367408", "0.6355235", "0.6355235", "0.6355235", "0.6355235", "0.6354484", "0.63486004", "0.63327396", "0.63327396", "0.6329291", "0.63243115", "0.6323775", "0.6323775...
0.77141327
0
This is a special version of popen which captures stdout, stdin and stdout and the PID of the executing process
def custom_popen(*cmd) pw = IO::pipe # pipe[0] for read, pipe[1] for write pr = IO::pipe pe = IO::pipe pid_pipe = IO::pipe # pipe for communicating the process id of the started process executing_proc_pid = nil pid = fork{ # child executing_proc_pid = fork{ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_popen2(cmd)\n stdin_reader, stdin_writer = IO.pipe\n stdout_reader, stdout_writer = IO.pipe\n\n pid = fork {\n stdin_writer.close\n $stdin.reopen(stdin_reader)\n\n stdout_reader.close\n $stdout.reopen(stdout_writer)\n\n exec(cmd)\n }\n\n stdin_reader.close\n stdout_writer.close\n\n yie...
[ "0.6945913", "0.6926403", "0.6560002", "0.65075195", "0.63351536", "0.6281145", "0.6250021", "0.6241206", "0.62267417", "0.6038773", "0.6036861", "0.60131353", "0.59852", "0.59559953", "0.5927879", "0.58659935", "0.58659935", "0.58659935", "0.5864546", "0.5846288", "0.5798707...
0.7112495
0
does crazy things on arrays : The magic_array function takes an array of number or an array of array of number as parameter and return the same array : flattened (i.e. no more arrays in array) reversed with each number multiplicated by 2 with each multiple of 3 removed with each number duplicate removed (any number sho...
def magic_array(array) array.flatten.reverse.map! {|i| i = i*2}.delete_if {|i| i.modulo(3) == 0}.uniq.sort end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magic_array(ma)\nma.flatten.sort.map{|n|n*2}.uniq.delete_if{|n|n%3==0}\nend", "def magic_array(a)\n a.flatten.sort.map{|x| x*2}.reject{|x| x%3==0}.uniq\n end", "def magic_array(arr)\n arr.flatten.sort.uniq.map{|x| x*2}\nend", "def magic_array(long)\n\tless_long = long.flatten\n\treversed = less_long...
[ "0.8331963", "0.8118887", "0.7783273", "0.7496129", "0.74763614", "0.67675245", "0.64840126", "0.6378727", "0.6306332", "0.6258576", "0.6254475", "0.6165096", "0.6147559", "0.6125871", "0.6123693", "0.61127734", "0.6112463", "0.60992086", "0.6096679", "0.6093359", "0.60905343...
0.8487766
0
merges sections by prefering other's attributes FIXME: needs specing
def +(other) fail "Unmergable sections:\n1) #{self.inspect}\n2) #{other.inspect}\nReason: values must differ." unless self.value == other.value @attrs.each do |a| case a when Attribute other.attrs << a unless other.attrs.map(&:name).include?(a.name) when Section...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge(with); end", "def merge_attributes\n attrs = self.attributes.dup.reject{ |k,v| ignored_merge_attributes.include?(k) }\n attrs.merge!(address_attributes) # we want addresses to be shown in the UI\n sorted = attrs.sort do |a,b|\n (ordered_merge_attributes.index(a.first) || 1000) <=>...
[ "0.64014214", "0.6200959", "0.61221826", "0.6073041", "0.6031088", "0.5989343", "0.5943767", "0.5878308", "0.584094", "0.57912856", "0.5758747", "0.57207125", "0.5687047", "0.5637179", "0.560761", "0.5605013", "0.55937785", "0.5565393", "0.5541474", "0.5535425", "0.55179334",...
0.6673078
0
GET /facility_items GET /facility_items.json
def index @facility_items = FacilityItem.where("true").order(:facility_name).page params[:page] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n if facility_params[:facility_id]\n @facility_items = FacilityItem.where(facility_id: @facility.id).order(:name).page params[:page]\n else \n @facility_items = [] \n for value in @template.template_facility_item do\n @facility_items.push(FacilityItem.find(value.facility_it...
[ "0.6908514", "0.6566139", "0.64723986", "0.64697", "0.64472127", "0.643034", "0.6387884", "0.63350093", "0.6324776", "0.6298998", "0.62669265", "0.6260958", "0.6191614", "0.61812186", "0.61637247", "0.61539084", "0.6118062", "0.6109231", "0.60649705", "0.60556024", "0.604473"...
0.6690664
1
POST /facility_items POST /facility_items.json
def create @facility_item = FacilityItem.new(facility_item_params) respond_to do |format| if @facility_item.save format.html { redirect_to @facility_item, notice: 'Facility item was successfully created.' } format.json { render :show, status: :created, location: @facility_item } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @facility_item = FacilityItem.new(facility_item_params)\n\n respond_to do |format|\n if @facility_item.save\n format.html { redirect_to '/facilities/'+@facility_item.facility_id.to_s+'/facility_items', notice: 'Facility item was successfully created.' }\n format.json { render ...
[ "0.7530436", "0.72076565", "0.6937627", "0.6723996", "0.6638696", "0.6614608", "0.66044796", "0.65928334", "0.6577001", "0.6502905", "0.64931077", "0.6305512", "0.61998236", "0.6138269", "0.6123877", "0.6118823", "0.61153483", "0.6102799", "0.61004335", "0.60927486", "0.60864...
0.7639089
0
PATCH/PUT /facility_items/1 PATCH/PUT /facility_items/1.json
def update respond_to do |format| if @facility_item.update(facility_item_params) format.html { redirect_to @facility_item, notice: 'Facility item was successfully updated.' } format.json { render :show, status: :ok, location: @facility_item } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @facility_item.update(facility_item_params)\n format.html { redirect_to facility_facility_items_path(@facility_item.facility_id), notice: 'Facility item was successfully updated.' }\n format.json { render :show, status: :ok, location: @facility_item }\...
[ "0.7439538", "0.7114478", "0.7021754", "0.6973534", "0.6972735", "0.6950552", "0.69238806", "0.6923682", "0.6654412", "0.65743184", "0.6570628", "0.65443194", "0.6532439", "0.651008", "0.6402472", "0.639943", "0.6386934", "0.6349682", "0.6348803", "0.63340867", "0.6306759", ...
0.7419252
1
DELETE /facility_items/1 DELETE /facility_items/1.json
def destroy @facility_item.destroy respond_to do |format| format.html { redirect_to facility_items_url, notice: 'Facility item was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @facility_item.destroy\n respond_to do |format|\n format.html { redirect_to facility_facility_items_path(facility_params), notice: 'Facility item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @facility = Facility.find(params[:i...
[ "0.7655816", "0.73253876", "0.73086375", "0.7104393", "0.7102174", "0.70010686", "0.69382125", "0.69306666", "0.69006467", "0.6890064", "0.68247855", "0.6793187", "0.6783173", "0.6767782", "0.6740683", "0.67321223", "0.67216706", "0.66904354", "0.6689707", "0.6678089", "0.665...
0.76135737
1
This should contain expected class of the returning message. Might be overwritten in child class
def expected_messages_class self.class.name.sub("Lookups", "Messages").constantize end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expect_message(type); end", "def message; Message.new; end", "def message_class\n return Scene_Battle::Message\n end", "def to_message\n fail NotImplementedError\n end", "def message_class\n Yuki::Message\n end", "def message\n @message || super\n end", "def message\n ...
[ "0.7179703", "0.6744682", "0.6650263", "0.66481745", "0.6565897", "0.64626825", "0.6453455", "0.64412063", "0.6376764", "0.6376764", "0.6376764", "0.6376764", "0.6376764", "0.6376764", "0.63290435", "0.6311117", "0.627904", "0.627904", "0.62737465", "0.62347186", "0.62238055"...
0.6789119
1
Generate the last part of the breadcrumb for a static page within a unit
def getPageBreadcrumb(unit, pageName) (!pageName || pageName == "home" || pageName == "campus_landing") and return [] pageName == "search" and return [{ name: "Search", id: unit.id + ":" + pageName}] pageName == "profile" and return [{ name: "Profile", id: unit.id + ":" + pageName}] pageName == "sidebar" and re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_breadcrumb\n end", "def breadcrumbs\n breadcrumbs = link_to this_webapp.webapp_name, root_path, :class => 'first-breadcrumb'\n unless @breadcrumb.nil?\n breadcrumbs += content_tag(:label, \" > \")\n if @breadcrumb.kind_of? Picture\n picture = @breadcrumb\n @breadcrumb =...
[ "0.64884925", "0.64713144", "0.6470853", "0.640594", "0.640171", "0.6315557", "0.6289883", "0.6289883", "0.62805516", "0.62773037", "0.62586904", "0.6146591", "0.61463636", "0.604957", "0.6041256", "0.6034665", "0.60077864", "0.60077864", "0.599243", "0.5989021", "0.59852535"...
0.6657726
0
Get recent items (with author info) for a unit, by most recent eschol_date
def getRecentItems(unit) items = Item.join(:unit_items, :item_id => :id).where(unit_id: unit.id) .where(Sequel.lit("attrs->\"$.suppress_content\" is null")) .reverse(:eschol_date).limit(5) return items.map { |item| { id: item.id, title: item.title, authors: getItemAuthors(item.id) } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def most_recent_recipe\n recipes.sort_by do |i| \n i.date\n end.last\n end", "def authors_top\n\t\t\t@db.js('musicthoughts.top_authors($1)', [20])\n\t\tend", "def recent_item\n raise MsdApi::Exception::InvalidParameter.new(_('errors.missing_param', key: :date)) unless params[:date]\n\n...
[ "0.56707156", "0.56666803", "0.55680346", "0.5535638", "0.549315", "0.54838085", "0.5454201", "0.545385", "0.54419273", "0.5429123", "0.5428824", "0.54213077", "0.5343198", "0.52986926", "0.52909523", "0.52649343", "0.526475", "0.5253439", "0.5236696", "0.5236447", "0.5220996...
0.69658273
0
Traverse the nav bar, including subfolders, yielding each item in turn to the supplied block.
def travNav(navBar, &block) navBar.each { |nav| block.yield(nav) if nav['type'] == 'folder' travNav(nav['sub_nav'], &block) end } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bootstrap_nav(*args, &block)\n levels = { :primary => 1, :secondary => 2, :tertiary => 3 }\n options = args.extract_options!\n level = levels[options[:level]] || (options[:level] || 1).to_i\n\n\n # If there are no arguments, use the current page\n args.unshift page if args.empty? && !p...
[ "0.6650002", "0.6526568", "0.65144163", "0.6413888", "0.6250708", "0.6249965", "0.61853987", "0.60712755", "0.5941075", "0.592345", "0.59190845", "0.58274376", "0.5810377", "0.580561", "0.5765988", "0.57558376", "0.57232195", "0.5702313", "0.5700346", "0.5696164", "0.5694098"...
0.78703076
0
For Displaying all The Shop Profiles
def index @shops = current_user.shop_profiles end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @shop_profiles = ShopProfile.all\n end", "def index\n @professional_profiles = ProfessionalProfile.all\n end", "def index\n @promotions = current_shop_owner.promotions.all\n end", "def index\n @proccs = Procc.all\n end", "def index\n @profanes = Profane.all\n end", "def sh...
[ "0.70421696", "0.65438896", "0.643277", "0.6274076", "0.6222612", "0.6157539", "0.61419964", "0.6141957", "0.6112224", "0.6061302", "0.6055706", "0.60032475", "0.59595627", "0.5955043", "0.5943252", "0.59336287", "0.5824984", "0.5816122", "0.57842875", "0.57842875", "0.577777...
0.69859815
1
For Displaying all the Shop Products for a particular Shop Profile
def show @shop_profile = ShopProfile.find(params[:id]) @items = @shop_profile.shop_products.where(shop_profile_id: @shop_profile.id) .paginate(page: params[:page], per_page: 6).search(params[:search]) if !params[:category_id].nil? @items = @shop_profile.shop_products.where(category_id: params[:category_id]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @shop_profiles = ShopProfile.all\n end", "def index\n\t\t@shops = current_user.shop_profiles\n\tend", "def shop_products\n products.shop_products\n end", "def index\n @products = current_user.products.all\n end", "def index\n @products = current_user.products\n end", "def inde...
[ "0.760567", "0.7407571", "0.6582207", "0.65487456", "0.65304255", "0.6521858", "0.6498808", "0.647377", "0.6451767", "0.64466614", "0.64156866", "0.64089644", "0.6393801", "0.6338596", "0.6328616", "0.6328505", "0.63187605", "0.631062", "0.62999624", "0.62958145", "0.6264457"...
0.8070445
0
For Creating a New Shop Profile for a Shopkeeper
def create authorize ShopProfile @shop = ShopProfile.new(shop_params) @shop.build_address(address_params_shopkeeper) if @shop.valid? and ! current_user.user_profile.nil? current_user.shop_profiles << @shop flash[:success] = 'Shop Details added' redirect_to root_path elsif current_user.user_profile.ni...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @profile = current_user.profile || Profile.new\n @profile.user_id = current_user.id\n @profile.status = :start\n @profile.save(validate: false)\n session[:profile_id] = @profile.id\n redirect_to vendor_setup_store_index_path\n end", "def create_profile!\n bundle_id = Sigh.con...
[ "0.74843675", "0.72974294", "0.69844735", "0.6946472", "0.6910242", "0.6909806", "0.68356186", "0.68322736", "0.6830035", "0.6820872", "0.68167704", "0.6811026", "0.68055683", "0.6772831", "0.6762305", "0.67601204", "0.6744072", "0.67392904", "0.6732139", "0.67272365", "0.671...
0.78790224
0
For Updating a Shop Profile Details
def update @shop = current_user.shop_profiles.find(params[:id]) authorize @shop if @shop.update_attributes(shop_params) and @shop.address.update_attributes(address_params_shopkeeper) flash[:success] = 'Updated Successfully' redirect_to shop_profiles_path else flash[:danger] = 'Shop Details not Updated...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n\t\t# Updating the details according the that particular profile\n\t\t@profile.update_attributes(profile_params)\n\t\t# Redirect to the particular surgeon profile show page\n\t\tredirect_to profile_path(@profile)\n\tend", "def update_profile\n @profile = @account.employee\n \n if...
[ "0.7538919", "0.75251615", "0.7493007", "0.7369756", "0.7299349", "0.7240679", "0.71428186", "0.7133239", "0.7107589", "0.70974326", "0.7091699", "0.70606875", "0.7047986", "0.7009914", "0.7000479", "0.6980883", "0.6963947", "0.6961477", "0.69480884", "0.6916052", "0.69102186...
0.7961084
0
Changing Status of a Shop Profile to Approved or Disapproved
def change_status authorize ShopProfile @shop = ShopProfile.find(params[:shop_profile_id]) #Calling method approve_shop from Model ShopProfile.approve_shop(@shop, flash) redirect_to request.referrer || root_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def approve\n @profile.approved = true\n @profile.save!\n redirect_to profiles_path(status: 'prohibited')\n end", "def approve!\n self.update_attribute(:status, ConfigCenter::User::APPROVED)\n end", "def prohibit\n @profile.approved = false\n @profile.save!\n redirect_to profiles_path(st...
[ "0.73740405", "0.71982944", "0.7121713", "0.70578563", "0.6901096", "0.6889874", "0.67824244", "0.67653364", "0.6623727", "0.6538617", "0.6535128", "0.6463564", "0.6462462", "0.64054704", "0.63577175", "0.634895", "0.6343886", "0.6298567", "0.6297889", "0.62971133", "0.629437...
0.7957978
0
returns next wednesday from current date
def next_wednesday date = self while !date.wednesday? date = date.next end date end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_weekday(weekday = 2)\n date = Date.today\n unless date.strftime(\"%w\") == weekday.to_s\n date += 1 + ((weekday -1 -date.wday) % 7)\n end\n date\n end", "def next_weekday\n if next_day.on_weekend?\n next_week(:monday, same_time: true)\n else\n next_day\n en...
[ "0.787096", "0.78274405", "0.78274405", "0.77540743", "0.7439524", "0.73969996", "0.73674405", "0.7300648", "0.7283888", "0.72757596", "0.72629964", "0.7194018", "0.71866417", "0.7171831", "0.7162202", "0.7143157", "0.70982337", "0.7096239", "0.7072825", "0.7052127", "0.70347...
0.8511923
0
Store data to memcache using the specified key ==== Parameters key:: The key identifying the cache entry data:: The data to be put in cache from_now:: The number of minutes (from now) the cache should persist
def cache_set(key, data, from_now = nil) _expire = from_now ? from_now.minutes.from_now.to_i : 0 @memcache.set(key, data, _expire) cache_start_tracking(key) Merb.logger.info("cache: set (#{key})") true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_set(key, data, from_now = nil)\n cache_file = @config[:cache_directory] / \"#{key}.cache\"\n cache_directory = File.dirname(cache_file)\n FileUtils.mkdir_p(cache_directory)\n _expire = from_now ? from_now.minutes.from_now : nil\n cache_write(cache_file, Marshal.dump([data, _expire]))\n ...
[ "0.7734826", "0.7644012", "0.72194594", "0.679156", "0.67078197", "0.6538201", "0.65369654", "0.649038", "0.64066094", "0.6400164", "0.64001536", "0.6334162", "0.6283211", "0.6273677", "0.6272086", "0.6251098", "0.6229982", "0.62237704", "0.62216747", "0.62216306", "0.6197455...
0.7843338
0
Expire the cache entries matching the given key ==== Parameter key:: The key matching the cache entries ==== Additional info In memcache this requires to keep track of all keys (on by default). If you don't need this, set :no_tracking => true in the config.
def expire_match(key) if @tracking_key for _key in get_tracked_keys expire(_key) if /#{key}/ =~ _key end else Merb.logger.info("cache: expire_match is not supported with memcache (set :no_tracking => false in your config") end true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expire_cache(key)\n end", "def expire_cached(key:)\n Stockpile::CachedValueExpirer.expire_cached(key: key)\n end", "def expire_cache!(key)\n raise 'The expire_cache method must be implemented'\n end", "def expire(key)\n @memcache.delete(key)\n cache_stop_tracking(key)\n Merb.logge...
[ "0.7690933", "0.743312", "0.7368731", "0.73639005", "0.71412426", "0.7056961", "0.7027988", "0.69537395", "0.6872803", "0.68672925", "0.68589056", "0.6831445", "0.6762894", "0.6760081", "0.64866287", "0.6430128", "0.63304", "0.63207585", "0.62576133", "0.62451077", "0.6230127...
0.751995
1
Gives info on the current cache store ==== Returns The type of the current cache store
def cache_store_type "memcache" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type\n @config[:caching][:type]\n end", "def cache_store_type\n \"dummy\"\n end", "def retrieve_store_class(store)\n # require_relative cannot be used here because the class might be\n # provided by another gem, like redis-activesupport for example.\n require \"ac...
[ "0.7330008", "0.7032524", "0.69761693", "0.6729079", "0.66565555", "0.6566218", "0.6535954", "0.6385915", "0.635425", "0.6250811", "0.6250811", "0.6225362", "0.6225362", "0.620501", "0.61576974", "0.6132443", "0.6070084", "0.6056202", "0.6039879", "0.6037328", "0.6023099", ...
0.73608345
0
Store the tracked keys in memcache (used by expire_match) ==== Parameter keys:: The keys to keep track of
def set_tracked_keys(keys) @memcache.set(@tracking_key, keys) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expire_cache_keys *keys\r\n keys.each { |k| @cache.delete k.to_sym }\r\n end", "def _expire_cache(*keys)\n Rails.cache.delete( _cache_key(keys) )\n end", "def cache_delete(*keys)\n if keys\n keys.each do |key|\n record = @store[:key => namespaced(key)]\n ...
[ "0.67881894", "0.6468192", "0.6461815", "0.645246", "0.64341456", "0.6167566", "0.5959207", "0.5951273", "0.5951273", "0.5942901", "0.5911913", "0.5887257", "0.5858332", "0.58387387", "0.58237934", "0.5716165", "0.56794083", "0.5675588", "0.56434715", "0.56392115", "0.554742"...
0.81636864
0
Retrieve tracked keys from memcache ==== Returns keys:: The tracked keys
def get_tracked_keys @memcache.get(@tracking_key) || [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_objects_keys\n @object_data[].keys\n end", "def key_ids\n @keys.keys\n end", "def keys\n @monitor.synchronize { @stash.keys }\n end", "def keys\n\t\t\treturn @storage.keys\n\t\tend", "def keys\n @hash.keys\n end", "def keys\n @hash.keys\n end", "def key...
[ "0.7004097", "0.6902772", "0.68922305", "0.6824827", "0.6816982", "0.6816982", "0.6816982", "0.67646813", "0.67646813", "0.6726424", "0.6712907", "0.6700374", "0.6668381", "0.6648168", "0.6617792", "0.65991104", "0.6525515", "0.6477177", "0.64321655", "0.64056975", "0.6398333...
0.82069546
0
Seed an image by passing its file name, imageable type (e.g. Banner, Product) and imageable id (the id of the object being the image belongs to)
def seed_image(filename, imageable_type, imageable_id) Picture.create!( :id => $image_id, :image => image(filename), :imageable_type => imageable_type, :imageable_id => imageable_id ) $image_id += 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_image(title, description, parent_id, mime_type, file_name)\n\t insert_file(title, description, parent_id, 'application/vnd.google-apps.photo', file_name)\n\tend", "def create_image(image)\n self.images.create(image: image) if image.present?\n end", "def image(filename)\n if not File.file?(File...
[ "0.67103827", "0.6587216", "0.64055264", "0.634066", "0.6290271", "0.62429047", "0.6206341", "0.6201628", "0.6168619", "0.6123131", "0.61099833", "0.609694", "0.6067298", "0.60596555", "0.60488516", "0.6036508", "0.6034444", "0.6034444", "0.6034444", "0.6034444", "0.6034444",...
0.83658993
0
recipient (string) sms recipient in general format; e.g. '+886912345678' message (string) message content options (hash) optional config options.ignore_cert (boolean) Ignore SSL certificate or not options.insecure (boolean) Use plain HTTP or HTTPS options.mode (string) delivery mode 'bit' instant delivery (default) 'bu...
def deliver(recipient, message, options={}) protocol = options[:insecure] ? "http" : "https" uri = URI.parse "#{protocol}://#{API_HOST}" uri.path = case (options[:mode].to_sym rescue nil) when nil, :bit SMS_ENDPOINT when :bulk BULK_SMS_ENDPOINT else raise StandardError...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deliver_sms(params)\n#puts \"**** Message#deliver_sms; params=#{params}\"\n sms_gateway = params[:sms_gateway]\n phone_number_array = @contact_info.map {|c| c[:phone]}.compact.uniq\n phone_numbers = phone_number_array.join(',')\n assemble_sms()\n#puts \"**** sms_gateway.deliver #{sms_gateway} w #{p...
[ "0.6247631", "0.6133201", "0.5962416", "0.5926002", "0.5901603", "0.5879868", "0.58379805", "0.58018184", "0.58001703", "0.5750512", "0.5749427", "0.5743206", "0.57254726", "0.5708531", "0.5705451", "0.5702569", "0.5699854", "0.5676836", "0.5674442", "0.56590253", "0.56587434...
0.63261914
0
GET Modifies the starting location passed via URL (QR Codes) Passes starting location as the room number Redirects immediately to Map
def start unless params[:origin].blank? params[:origin].slice!(0) if params[:origin][0].upcase == "R" # Remove proceeding R if present origin = params[:origin].to_s.rjust(4, '0').prepend("R") # Add zero padding and Prepend R session[:start] = origin.upcase end redirect_to "/map" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @mapURL = map_url(@location.address)\n render :show\n end", "def location\n @client.get(\"#{path}/location\")\n end", "def get_by_location\n \tlat = params[:lat]\n \tlng = params[:lng]\n \tnext_start = params[:next_start]\n \tshops = Hotpepper.search_location(lat, lng, next_st...
[ "0.6155691", "0.585538", "0.5851553", "0.58069074", "0.57812464", "0.5770744", "0.57235765", "0.57201725", "0.5680059", "0.55999684", "0.55897725", "0.5575051", "0.5547962", "0.55264217", "0.5519914", "0.5516726", "0.54907876", "0.5490285", "0.54848766", "0.5468661", "0.54567...
0.66142786
0
POST /logvisitor Logs a visitor. Called from redirect.js, which redirects to home after 2 minutes of inactivity. Logs a visitor after one minute of inactivity.
def logvisitor @visitor.end = DateTime.current @visitor.save render :nothing => true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_visit\n session_id = request.session_options[:id]\n client = DeviceDetector.new(request.env[\"HTTP_USER_AGENT\"])\n client_os = client.os_name\n if !VisitorLog.find_by_session_id(session_id)\n VisitorLog.create(:session_id => session_id, :logged_in => false, :device_type => client_os)\n ...
[ "0.67755216", "0.65221065", "0.6351727", "0.61986196", "0.60083514", "0.6008046", "0.5907962", "0.5881883", "0.5810546", "0.5589945", "0.5542837", "0.55297786", "0.5526256", "0.5517241", "0.54993564", "0.54477334", "0.5386828", "0.5366683", "0.5328699", "0.5314285", "0.530728...
0.747792
0
POST Upload an SVG map
def map_upload unless params[:uploaded_map].blank? require 'fileutils' # Ensure public/maps exists FileUtils::mkdir_p "public/maps" directory = "public/maps.tmp" # Ensure a blank maps.tmp directory exists FileUtils.rm_rf directory FileUtils::mkdir_p directory # Cop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_modified_svg(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :POST, 'File')\n end", "def create\n @svgpost = Svgpost.new(params[:svgpost])\n\n respond_to do |format|\n if @svgpost.save\n format.html { redirect_to @svgpost, ...
[ "0.6345288", "0.60454863", "0.5910406", "0.5904281", "0.57501334", "0.5699276", "0.55295473", "0.55014163", "0.53606075", "0.5318381", "0.53156465", "0.5296549", "0.5285719", "0.5275586", "0.5257626", "0.5251734", "0.5231633", "0.52070206", "0.5196743", "0.5192396", "0.517660...
0.7257759
0
currently a noop method. If a format other than mongo query format is used for prefilters, this method would do the appropriate conversion
def convert_filter_to_mongo_query(filter) filter end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast_value\n value.mongoize\n end", "def queryAndConvert() \n\t\tres = self.query()\n\t\treturn res.convert()\n end", "def convert(obj)\n ret = convert_proc.call(obj)\n filters.execute(ret)\n end", "def post_conversion(converted_query)\n return unless (converted_query && ...
[ "0.61837065", "0.6159584", "0.5950193", "0.58030474", "0.578086", "0.5766119", "0.5676294", "0.5637948", "0.5543535", "0.5540873", "0.5540873", "0.5540873", "0.54870456", "0.54727894", "0.54264444", "0.53915036", "0.5389541", "0.5389541", "0.53628594", "0.5360193", "0.5345107...
0.6503161
0
Retrieves the git channel for the specific IRC channel
def git_channel(channel) return @channels[channel] if @channels[channel] @channels[channel] = Git::Channel.new(@config[channel.server.name][channel.nname]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_channel_by_name(client, channel_name)\n channel_data = client.channels_info(channel: \"#\" + channel_name.to_s)\n channel_data.channel.id\nend", "def channel\n Channel.get(@name)\n end", "def channel\n @channels[BASE_PATH]\n end", "def channel_name\n @channel_name ||= SlackUtils::S...
[ "0.6916028", "0.69111717", "0.6870902", "0.65356845", "0.64999634", "0.6493034", "0.64337313", "0.6372567", "0.635321", "0.6327158", "0.6298036", "0.6194856", "0.618641", "0.61220217", "0.6047776", "0.6002146", "0.59374535", "0.59219605", "0.59219605", "0.5915711", "0.5908137...
0.7265467
0
Simply make sure that `opts` can be converted into a Hash, then does so. Then returns `opts` as a HashWithIndifferentAccess.
def sanitize_options(opts) opts = opts.to_hsh rescue opts.to_h HashWithIndifferentAccess.new(opts) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_opts(opts)\n {}.tap do |o|\n o[:serialize] = if opts[:serialize] && opts[:serialize].is_a?(Array)\n opts[:serialize].map(&:to_s)\n else\n []\n end\n\n o[:only] = opts[:only] || [\"add\", \"remove\"]\n o[:notify] = opts[:notify] |...
[ "0.6497648", "0.62586224", "0.6141342", "0.612988", "0.61116034", "0.60891175", "0.60677", "0.60211694", "0.60211694", "0.59898317", "0.59881794", "0.5985856", "0.59845215", "0.5969746", "0.5966751", "0.5882005", "0.5870401", "0.5862344", "0.58554083", "0.58532906", "0.583563...
0.7970074
0
Raises an error if `opts` does not contain the `key`
def validate_option_key(opts, key) raise "opts[:#{key}] or opts['#{key}'] must be given" unless opts.has_key?(key) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key; @opts['key'] end", "def required_option(options, key)\n result = get_option(options, key)\n raise ArgumentError, \"Missing required option: #{key}\" if result == \"\"\n result\n end", "def assert_bad_or_good_if_key(key, value, missing, message_key = :message)\n return true unless @opt...
[ "0.7309869", "0.6836964", "0.672941", "0.6708919", "0.6691647", "0.6531362", "0.6530075", "0.6465956", "0.6425331", "0.6342309", "0.6336891", "0.6311184", "0.62602305", "0.6217104", "0.61788005", "0.6177685", "0.61524093", "0.61458796", "0.61087173", "0.60677516", "0.60348254...
0.8797754
0
Converts the input entertrack (probably from barcode scanner) into the computer_id
def track_to_id self.computer_id = (entertrack - 10000000) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def char_to_id(ch); end", "def determine_name\n name = nil\n\n case @type\n when :computer\n name = `sudo dmidecode -s system-serial-number`.chomp\n when :hard_drive\n `sudo smartctl -i #{@options['device']}`.each_line do |line|\n line =~ /^Serial\\sNumber:\\s...
[ "0.6026348", "0.58002263", "0.5672722", "0.5344034", "0.52405816", "0.52302474", "0.52178574", "0.51649517", "0.51032585", "0.5098331", "0.50870067", "0.50818", "0.5061149", "0.5052782", "0.50460136", "0.50144506", "0.4973266", "0.49655682", "0.49583212", "0.49554807", "0.495...
0.73323953
0
Ensures that a computer's status can only be either scrapped or sold
def scrapped_or_sold if (scrapped.blank? and sold.blank?) # Do nothing elsif !(scrapped.blank? ^ sold.blank?) errors.add(:base, "Please indicate whether a computer has been scrapped or sold, not both.") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def power_safety_status\n unless powered_up or is_empty?\n errors.add(:powered_up, \"Cannot have a dinosaur in a cage that is powered off. \")\n end\n end", "def reserved?(product)\n product.status == 'Reserved'\n end", "def can_be_assigned?\n\t\t(!status.include? STATUS[\"Assigned\"]) && (!sta...
[ "0.6342658", "0.6252511", "0.62040097", "0.60894203", "0.6016636", "0.5940866", "0.5861526", "0.58253396", "0.5807886", "0.5807163", "0.5791245", "0.5789773", "0.5771152", "0.57687783", "0.57543445", "0.5749269", "0.5724948", "0.5718888", "0.57077575", "0.5704767", "0.5692924...
0.6944911
0
Ensures that a customer and price can only be assigned for sold computers
def been_sold if (customer.present? or price.present?) and sold != true errors.add(:base, "Only sold computers can have customers or prices.") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def customer_can_afford_pet(supplied_customer, new_pet)\n supplied_customer[:cash] < new_pet[:price] ? false : true\nend", "def customer_can_afford_pet(customer, new_pet)\n if customer[:cash] >= new_pet[:price]\n true\n else\n false\n end\nend", "def customer_can_afford_pet(customer, new_pet)\n if c...
[ "0.66864747", "0.64822686", "0.64427733", "0.64427733", "0.6417069", "0.64124364", "0.6412113", "0.63891304", "0.63891304", "0.63840896", "0.63685167", "0.63636523", "0.6358056", "0.6326425", "0.6315005", "0.62852156", "0.62250865", "0.62083805", "0.61884385", "0.616832", "0....
0.7172353
0
Returns boolean for user being/not being considered a military person, by eMIS, based on their Title 38 Status Code.
def military_person? title38_status == 'V3' || title38_status == 'V6' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status\n return :not_authorized unless user_loa3\n\n mvi_response&.status\n end", "def detect_protect_on_status(pkmn, check_status = true)\n return true if check_status and pkmn.status != 0\n return true if pkmn.battle_effect.has_substitute_effect? and pkmn != @IA_Info[:launcher]\n retu...
[ "0.6440953", "0.615688", "0.6069206", "0.6055143", "0.6004144", "0.5953719", "0.59451836", "0.5884087", "0.5873185", "0.5828828", "0.58201045", "0.5808816", "0.57922435", "0.57781124", "0.5767824", "0.57117885", "0.57112074", "0.57019615", "0.56921774", "0.5679763", "0.567937...
0.75771916
0
This action is used to retrieve data to be display on the IDSR MONTHLY REPORT Is called by Ajax and renders results in json
def idsr_monthly_report_summary date = params[:year_month].split('-') @start_date = Date.new(date[0].to_i,date[1].to_i) @end_date = @start_date + 1.month - 1.day @disaggregated_diagnosis = {} idsr_monthly_set = ConceptName.where(["name IN (?)",["Idsr Monthly Summary"]]).map(&:concept_id)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data\n d = Date.new(0, 1, 1)-1\n months = params[:months].to_i\n respond_to do |format|\n format.json { render json: JournalEntry.build_stairs(months).to_json }\n #format.csv {render csv: 'foo'}\n format.text { render :text => JournalEntry.all.map { |j| \"#{(j.entry_date - d).to_i} #{j....
[ "0.70137846", "0.6785619", "0.6720179", "0.6631924", "0.6617991", "0.6590482", "0.65688187", "0.65620434", "0.6554017", "0.65317035", "0.6530003", "0.6527418", "0.6514168", "0.648938", "0.64826316", "0.6481623", "0.6471996", "0.6471361", "0.6462856", "0.6459926", "0.6455072",...
0.6801321
1
This action is used to display form content on the IDSR MONTHLY REPORT
def idsr_monthly_summary @report_name = 'IDSR Monthly Summary' @logo = CoreService.get_global_property_value('logo').to_s @current_location_name =Location.current_health_center.name @obs_start_year = Observation.first.obs_datetime.year render :layout => 'report' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @report_lines = @monthly_report.report_lines\n end", "def new\n @silicaship = Silicaship.new\n @form_code = \"PKI-\"+Date.current.strftime('%Y%m%d')+\"-\"+\"#{Silicaship.where('created_at BETWEEN ? and ?', Date.current.beginning_of_month, Date.current.end_of_month).count+1}\"\n\n respond_...
[ "0.6275323", "0.61825", "0.6169359", "0.61175704", "0.6067816", "0.60425353", "0.6011588", "0.5957585", "0.5946823", "0.59013975", "0.58804923", "0.5849079", "0.5801529", "0.5789817", "0.5763517", "0.57531786", "0.57516295", "0.57463527", "0.57455254", "0.5720824", "0.5716822...
0.6418573
0
Parse out a teamweek file and return an array of players
def get_team_for_week(team, week) file = "#{@teamweek_dir}/#{team}_#{week}.html" n = Nokogiri.HTML(File.open(file)) players = [] [0,1,2].each do |i| t0 = n.css("#statTable#{i}") t0.css('tr').each do |tr| opts = {} next unless tr.css('t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def by_season_team_parser\n by_season_team_data = []\n target_dir = by_season_team_dir\n Dir.foreach(target_dir) do |file|\n next if file == '.' or file == '..'\n json_file = File.open(target_dir + file)\n parsed_file = JSON.parse(File.read(json_file))\n pla...
[ "0.6817765", "0.637809", "0.6128131", "0.6094855", "0.60939497", "0.6004025", "0.5923187", "0.5913318", "0.58579904", "0.57875556", "0.5769979", "0.5762732", "0.57520354", "0.57518446", "0.5742133", "0.57237667", "0.5708538", "0.56871444", "0.56789535", "0.56763893", "0.56627...
0.71144485
0
reset session and other
def reset reset_session redirect_to root_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_session!\n raw_session.clear\n end", "def reset_session!\n request.reset_session\n end", "def reset_session!\n request.reset_session\n end", "def reset!\n @session_key = nil\n end", "def sessions_reset\n self.sessions_flush\n @sessions = {}\n end", ...
[ "0.8241069", "0.7826838", "0.7826838", "0.7817339", "0.78161067", "0.7787506", "0.7481623", "0.7460084", "0.7452106", "0.7449858", "0.7426106", "0.72550815", "0.72262806", "0.7223491", "0.71642435", "0.7163155", "0.714617", "0.71420133", "0.71261406", "0.7118419", "0.7082083"...
0.7883568
1
For example: the summation of 3 is 6 because 1 + 2 + 3 = 6, the summation of 6 is 21 because 1 + 2 + 3 + 4 + 5 + 6 = 21. Write a method summation_sequence that takes in a two numbers: start and length. The method should return an array containing length total elements. The first number of the sequence should be the sta...
def summation_sequence(start, length) arr = [start] i = 1 while i < length arr << summation(arr[i-1]) i += 1 end return arr end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def summation_sequence(start, length)\n sequence = [start]\n while sequence.length < length\n sequence << summation(sequence[-1])\n end\n return sequence\nend", "def summation_sequence(start, length)\n sequence = [start]\n while sequence.length < length\n sequence << summation(sequence[-1])\n end\n ...
[ "0.9032482", "0.9031881", "0.90134704", "0.8991493", "0.8931953", "0.88800484", "0.8856925", "0.8836007", "0.88068587", "0.77654916", "0.7759579", "0.7733978", "0.7499312", "0.7348537", "0.7255668", "0.72519195", "0.7043504", "0.6892303", "0.686528", "0.6832037", "0.6831154",...
0.9049595
0
Retrieve the RASD item that specifies memory properties of a VM.
def get_memory_rasd_item(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/memory" ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def memory\n flavor[1]\n end", "def query(base)\n request = Packet.create_request(COMMAND_ID_STDAPI_SYS_PROCESS_MEMORY_QUERY)\n\n request.add_tlv(TLV_TYPE_HANDLE, process.handle)\n request.add_tlv(TLV_TYPE_BASE_ADDRESS, base)\n\n response = process.client.send_request(request)\n\n # Build out ...
[ "0.6056893", "0.57646495", "0.57121444", "0.56995195", "0.56995195", "0.5681972", "0.56463814", "0.5639503", "0.55555516", "0.554191", "0.5517495", "0.5515491", "0.55139035", "0.54963505", "0.5422232", "0.54161584", "0.5366832", "0.5352788", "0.52860767", "0.5276052", "0.5264...
0.764388
0
GET /skill_user_profiles GET /skill_user_profiles.json
def index @skill_user_profiles = SkillUserProfile.all render json: @skill_user_profiles end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n render json: @skill_user_profile\n end", "def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end", "def find_skills\n @user = User.find(params[:id])\n @user_skill = UserSkill.where(\"user_id = @user.id\")\n end", "def profile(user_id: '-')\...
[ "0.7359693", "0.73411167", "0.68477875", "0.68435335", "0.6801662", "0.6649178", "0.65548605", "0.65348184", "0.65195537", "0.6508138", "0.6503332", "0.64921105", "0.64660364", "0.6422087", "0.6382217", "0.6382217", "0.6376064", "0.63727033", "0.6358367", "0.63502324", "0.633...
0.76519805
0
GET /skill_user_profiles/1 GET /skill_user_profiles/1.json
def show render json: @skill_user_profile end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @skill_user_profiles = SkillUserProfile.all\n\n render json: @skill_user_profiles\n end", "def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end", "def show\n @user_skill = UserSkill.find(params[:id])\n\n respond_to do |format|\n format.ht...
[ "0.7540472", "0.72380435", "0.6891493", "0.68833876", "0.6773084", "0.6703959", "0.6617603", "0.6580237", "0.6506313", "0.6501368", "0.6499838", "0.64959013", "0.6494269", "0.64883816", "0.64490336", "0.6437379", "0.6426821", "0.64254457", "0.64235854", "0.6380797", "0.633752...
0.74593276
1
POST /skill_user_profiles POST /skill_user_profiles.json
def create byebug @skill_user_profile = SkillUserProfile.new(skill_user_profile_params) if @skill_user_profile.save render json: @skill_user_profile, status: :created, location: @skill_user_profile else render json: @skill_user_profile.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n respond_to do |format|\n begin\n if params[\"skills_user\"][\"user_id\"]\n skill_id = params[\"skills_user\"][\"skill_id\"]\n user_ids = params[\"skills_user\"][\"user_id\"].reject{ |c| c.empty? }\n user_ids.each do |user_id|\n SkillsUser.create(ski...
[ "0.7002764", "0.67209226", "0.6702857", "0.66788155", "0.6667141", "0.6573299", "0.65645134", "0.6552559", "0.65306515", "0.6505235", "0.6467825", "0.64630437", "0.6426796", "0.64245105", "0.64229363", "0.64203393", "0.6418879", "0.6416533", "0.64134467", "0.64090407", "0.640...
0.77314943
0
PATCH/PUT /skill_user_profiles/1 PATCH/PUT /skill_user_profiles/1.json
def update @skill_user_profile = SkillUserProfile.find(params[:id]) if @skill_user_profile.update(skill_user_profile_params) head :no_content else render json: @skill_user_profile.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @user_skill = UserSkill.find(params[:id])\n\n respond_to do |format|\n if @user_skill.update_attributes(params[:user_skill])\n format.html { redirect_to @user_skill, notice: 'User skill was successfully updated.' }\n format.json { head :no_content }\n else\n format...
[ "0.7215414", "0.7133178", "0.7074115", "0.7019957", "0.6900675", "0.67652017", "0.6746017", "0.6702953", "0.67025644", "0.66894346", "0.66782457", "0.66709757", "0.6657884", "0.6657884", "0.66356015", "0.66048175", "0.6593843", "0.6578351", "0.6568655", "0.6542333", "0.653621...
0.790409
0
DELETE /skill_user_profiles/1 DELETE /skill_user_profiles/1.json
def destroy @skill_user_profile.destroy head :no_content end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @user_skill = UserSkill.find(params[:id])\n @user_skill.destroy\n\n respond_to do |format|\n format.html { redirect_to user_skills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n profileSkill = ProfileManager.find_by_skill_id(@skill.id)\n if profil...
[ "0.74844587", "0.7300922", "0.72757494", "0.72757494", "0.7270497", "0.7195045", "0.7182725", "0.7151382", "0.7121585", "0.70660055", "0.70649016", "0.7027839", "0.69821835", "0.6973593", "0.69674", "0.69589704", "0.6921344", "0.6915201", "0.68976235", "0.6895558", "0.6895548...
0.79608434
0
Invokes the view for the given model, passing the assigns as instance variables.
def view( model, view, assigns = {} ) self << Waves.main::Views[ model ].process( request ) do send( view, assigns ) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view(model_name, *args)\n orange[model_name].view(self, *args)\n end", "def method_missing(*args, &block)\n @_view.send(*args, &block)\n end", "def execute(*args)\n \n # Verify if the controller answers to the @view_name value\n if args[0].respond_to? lookup_method_to_call(@vie...
[ "0.63349307", "0.5727461", "0.5683393", "0.55732816", "0.5539871", "0.547029", "0.5461702", "0.5348249", "0.5338373", "0.52163655", "0.5191867", "0.51638395", "0.5134275", "0.5130592", "0.50653106", "0.5046084", "0.5044053", "0.5034385", "0.50319874", "0.50297946", "0.5021908...
0.72150844
0
Take a number of server/detail records for hosts, then format it into a data structure with standardized fields for display.
def convert_yaml(servers) serverdata = {} servers.each do |server| hostname = server.hostname # Initialize our root fields so that there won't be any surprises from # hosts that don't have data. serverdata[hostname] = {} fields = %w(general netdb puppetfacts puppetstatus advisorie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def formatted_servers\n static_ips = connect.describe_addresses.addresses.map(&:public_ip)\n\n servers.select { |server| include_server? server }.map do |server|\n o = {\n date: server.launch_time.to_s,\n az: server.placement.availability_zone,\n id: server.instance_id,\...
[ "0.65381384", "0.65141135", "0.6379995", "0.6336167", "0.6336167", "0.63080657", "0.6054485", "0.60374767", "0.5977949", "0.5946662", "0.58972645", "0.58563995", "0.5850363", "0.5833558", "0.57789594", "0.57771313", "0.5771989", "0.57710767", "0.57526517", "0.57496554", "0.57...
0.67029256
0
converts a JDBC recordset to an array of hashes, with one hash per record
def rs_to_array(rs) # creates an array of hashes from a jdbc record set arr = [] # get basic metadata for the recordset meta = rs.getMetaData cols = meta.getColumnCount.to_i # loop through the records to add them into hash while rs.next do # r is a temporary hash for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resultset_to_hash(resultset)\n meta = resultset.meta_data\n rows = []\n\n while resultset.next\n row = {}\n\n (1..meta.column_count).each do |i|\n name = meta.column_name i\n row[name] = case meta.column_type(i)\n when -6, -5, 5, 4\n # TINYINT, B...
[ "0.7396678", "0.6852979", "0.68526137", "0.67747927", "0.67481357", "0.6468946", "0.6457917", "0.6401315", "0.6384862", "0.63340676", "0.6262384", "0.61914194", "0.61816084", "0.6106723", "0.60552233", "0.60021657", "0.5940283", "0.58896726", "0.584722", "0.57943976", "0.5793...
0.7760621
0
converts a JDBC recordset to an array of hashes, with one hash per record creates a hash from a jdbc record set index_key_field is the field you want to use as the top level hash key... and should exist in the record set multi_val=true will create an array below each index_key_filed, false will create a hash as the chi...
def rs_to_hash(rs, index_key_field, multi_val) # setting default hash value is necessary for appending to arrays hash=Hash.new{ |h, k| h[k] = [] } # get basic metadata for the recordset meta = rs.getMetaData cols = meta.getColumnCount.to_i # loop through the records to add them int...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resultset_to_hash(resultset)\n meta = resultset.meta_data\n rows = []\n\n while resultset.next\n row = {}\n\n (1..meta.column_count).each do |i|\n name = meta.column_name i\n row[name] = case meta.column_type(i)\n when -6, -5, 5, 4\n # TINYINT, B...
[ "0.63470525", "0.6316901", "0.6035682", "0.59250784", "0.59112215", "0.58994716", "0.5812303", "0.5791376", "0.56319875", "0.5567946", "0.5563927", "0.5560006", "0.5557613", "0.54811406", "0.54792386", "0.5462003", "0.54352885", "0.54093677", "0.54042464", "0.539987", "0.5396...
0.7308031
0